Hi Team,
I created an overlay to enable SPI3 for connecting my 3.5” MSP3520 TFT Display.
Hereby adding my overlay file,
🐧 root @GalaxyBook/home/Meenakshy/Projects/SPI_TFT_Display/tcbdir: cat device-trees/overlays/verdin-am62_msp3520_tft_display_spi3_overlay.dts
/dts-v1/;
/plugin/;
#include "../../linux/arch/arm64/boot/dts/ti/k3-pinctrl.h"
#include "../../linux/include/dt-bindings/interrupt-controller/irq.h"
#include "../../linux/include/dt-bindings/gpio/gpio.h"
/ {
compatible = "toradex,verdin-am62";
};
/* Disable HDMI using the actual node name */
&{/hdmi-connector} {
status = "disabled";
};
/* Disable the HDMI bridge on I2C1 */
&{/bus@f0000/i2c@20010000/hdmi@48} {
status = "disabled";
};
/* Remove the conflicting HPD GPIO pin configuration */
&main_pmx0 {
/delete-node/ main-gpio1-17-default-pins;
};
/* Remove connector configuration that uses PIN113 */
&{/connector} {
status = "disabled";
};
/* Verdin SPI_3 pins */
&main_pmx0 {
spi3_pins_default: spi3-default-pins {
pinctrl-single,pins = <
AM62X_IOPAD(0x01bc, PIN_OUTPUT, 0) /* (A14) SPI0_CLK - SODIMM_19 */
AM62X_IOPAD(0x01b4, PIN_OUTPUT, 0) /* (A13) SPI0_CS0 - SODIMM_15 */
AM62X_IOPAD(0x01b8, PIN_OUTPUT, 0) /* (C13) SPI0_CS1 - SODIMM_16 */
AM62X_IOPAD(0x01c4, PIN_OUTPUT, 0) /* (B14) SPI0_D1 - MOSI - SODIMM_161 */
AM62X_IOPAD(0x01c0, PIN_INPUT, 0) /* (B13) SPI0_D0 - MISO - SODIMM_66 */
>;
};
};
&epwm1 {
status = "disabled";
};
&epwm0 {
status = "disabled";
};
/* Verdin SPI_0 - Enable for LCD */
&main_spi0 {
pinctrl-names = "default";
pinctrl-0 = <&spi3_pins_default>;
status = "okay";
ti,spi-num-cs = <2>;
#address-cells = <1>;
#size-cells = <0>;
msp3520_display@0 {
compatible = "rohm,dh2228fv";
reg = <0>;
spi-max-frequency = <10000000>;
status = "okay";
};
msp3520_touch@1 {
compatible = "ti,ads7846";
reg = <1>;
spi-max-frequency = <1000000>;
status = "okay";
interrupt-parent = <&mcu_gpio0>;
interrupts = <4 IRQ_TYPE_EDGE_FALLING>;
pendown-gpio = <&mcu_gpio0 4 GPIO_ACTIVE_LOW>;
ti,x-plate-ohms = /bits/ 16 <180>;
ti,pressure-max = /bits/ 16 <255>;
wakeup-source;
};
};
🐧 root @GalaxyBook/home/Meenakshy/Projects/SPI_TFT_Display/tcbdir:
In Toradex pinout-designer tool, we can use SODIMM_161 and SODIMM_66 as MOSI and MISO for SPI3.
So, I configured in my overlay as SODIMM_161 as PIN_OUTPUT, which is MOSI and SODIMM_66 as PIN_INPUT, which is MISO. My display got worked when my LCD’s MOSI is connected to SODIMM_161 (MOSI).
After that, I reversed the configuration. I configured SODIMM_161 as PIN_INPUT, which is MISO and SODIMM_66 as PIN_OUTPUT, which is MOSI. My display should work when I connect the MOSI pin of my LCD to SODIMM_66(MOSI). But my display got worked, when I connected to SODIMM_161 (MISO).
In overlay I made a small change,
/* Verdin SPI_3 pins */
&main_pmx0 {
spi3_pins_default: spi3-default-pins {
pinctrl-single,pins = <
AM62X_IOPAD(0x01bc, PIN_OUTPUT, 0) /* (A14) SPI0_CLK - SODIMM_19 */
AM62X_IOPAD(0x01b4, PIN_OUTPUT, 0) /* (A13) SPI0_CS0 - SODIMM_15 */
AM62X_IOPAD(0x01b8, PIN_OUTPUT, 0) /* (C13) SPI0_CS1 - SODIMM_16 */
AM62X_IOPAD(0x01c4, PIN_INPUT, 0) /* (B14) SPI0_D1 - MISO - SODIMM_161 */
AM62X_IOPAD(0x01c0, PIN_OUTPUT, 0) /* (B13) SPI0_D0 - MOSI - SODIMM_66 */
>;
};
};
What is the reason behind this strange behavior?
Thanks & Regards,
Meenakshy