I modify the spi to the following into “myspi”, the driver probes ok but I can not see spi waveform on SPI0 in 40 pinmux (the below default comment about 40 pin should be wrong? should be SPI0/SPI1 ?)
After building the dtb file under kernel_out, I copy it to /boot/kernel_…dtb and /boot/dtb/kernel…dtb, then reboot and insmod my ko to test it
spi@3210000{ /* SPI1 in 40 pin conn */
status = "okay";
/* spi@0 { /1* chip select 0 *1/ */
/* compatible = "tegra-spidev"; */
/* reg = <0x0>; */
/* spi-max-frequency = <50000000>; */
/* controller-data { */
/* nvidia,enable-hw-based-cs; */
/* nvidia,rx-clk-tap-delay = <0x10>; */
/* nvidia,tx-clk-tap-delay = <0x0>; */
/* }; */
/* }; */
myspi@0 { /* chip select 0 */
status = "okay";
compatible = "myspidev";
reg = <0x0>;
spi-max-frequency = <50000000>;
};
spi@1 { /* chip select 1 */
compatible = "tegra-spidev";
reg = <0x1>;
spi-max-frequency = <50000000>;
controller-data {
nvidia,enable-hw-based-cs;
nvidia,rx-clk-tap-delay = <0x10>;
nvidia,tx-clk-tap-delay = <0x0>;
};
};
};
spi@3230000{ /* SPI3 in 40 pin conn */
status = "okay";
spi@0 { /* chip select 0 */
compatible = "tegra-spidev";
reg = <0x0>;
spi-max-frequency = <50000000>;
controller-data {
nvidia,enable-hw-based-cs;
nvidia,rx-clk-tap-delay = <0x10>;
nvidia,tx-clk-tap-delay = <0x0>;
};
};
spi@1 { /* chips select 1 */
compatible = "tegra-spidev";
reg = <0x1>;
spi-max-frequency = <50000000>;
controller-data {
nvidia,enable-hw-based-cs;
nvidia,rx-clk-tap-delay = <0x10>;
nvidia,tx-clk-tap-delay = <0x0>;
};
};
};