I want to use FBTFT Driver to enable OLED via SPI
1. I 've checked SPI in menuconfig, spidev.ko was built and installed.
2. I 've also modified imx7s-warp.dts => change ecspi1-2-3-4 from "Disabled" to "okay"
3. Then I rebuild Linux Kernel success.
4. But when I install kernel (copy zImage, imx7s-warp.dtb, imx7s-warp.dts to /boot folder) & reboot again.
5. there are no /dev/spi* folder.
6. when I run "modprobe fbtft_device name=pioled" to test it. It always return error "spi_busnum_to_master(0) returned NULL"
7. I searched a lot in google and NXP forum, there are no specific answer.
8. I tried to modify Device Tree as some discussion suggested.
===== imx7s-warp.dts
......
&ecspi1 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_ecspi1>;
status = "okay";
};
&ecspi2 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_ecspi1>;
status = "okay";
};
&ecspi3 {
fsl,spi-num-chipselects = <0>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_ecspi3>;
status = "okay";
spidev@0x00 {
compatible = "spidev";
spi-max-frequency = <20000000>;
reg = <0>;
};
spidev@0x01 {
compatible = "spidev";
spi-max-frequency = <20000000>;
reg = <1>;
};
};
&iomuxc {
pinctrl-names = "default";
ecspi3 {
pinctrl_ecspi3: ecspi3grp {
fsl,pins = <
MX7D_PAD_ECSPI2_SCLK__MKBUS_ESPI3_SCLK 0x80000000
MX7D_PAD_ECSPI2_MOSI__MKBUS_ESPI3_MOSI 0x80000000
MX7D_PAD_ECSPI2_MISO__MKBUS_ESPI3_MISO 0x80000000
MX7D_PAD_ECSPI2_SS0__MKBUS_ESPI3_SS0_B 0x80000000
>;
};
imx7d-sdb {
.................
.................
pinctrl_ecspi1: ecspi1grp {
fsl,pins = <
MX7D_PAD_ECSPI1_SCLK__MKBUS_UART5_TXD 0x80000000
MX7D_PAD_ECSPI1_MOSI__MKBUS_UART5_RXD 0x80000000
>;
};
pinctrl_ecspi2: ecspi2grp {
fsl,pins = <
MX7D_PAD_ECSPI2_SCLK__MKBUS_ESPI3_SCLK 0x80000000
MX7D_PAD_ECSPI2_MOSI__MKBUS_ESPI3_MOSI 0x80000000
MX7D_PAD_ECSPI2_MISO__MKBUS_ESPI3_MISO 0x80000000
MX7D_PAD_ECSPI2_SS0__MKBUS_ESPI3_SS0_B 0x80000000
>;
};
.....
};
=====
9. There is error when I rebuild my imx7s-warp.dtb.
====
But error occured when I build imx7s-warp.dtb file.
Error: arch/arm/boot/dts/imx7s-warp.dts:388.5-6 syntax error
FATAL ERROR: Unable to parse input tree
make[1]: *** [arch/arm/boot/dts/imx7s-warp.dtb] Error 1
make: *** [imx7s-warp.dtb] Error 2
====
- What is wrong in my modification ?
- Am I going in right way ?
Note:
- I modify it follow schematic "warp7_cpu_1109.pdf"
- Linux Kernel: GitHub - WaRP7/linux-fslc: Linux kernel source tree
- I also refer some file: pinctrl-imx7d.c, imx7d.dtsi but no hope :smileysad:
It is very thankful if there is a specific way to enable SPI for WARP7