Other Parts Discussed in Thread: SK-AM62, ADC128S052, TCA6424
I am using a SK-AM62 evaluation board. I am trying to use SPI2 on J3 connector. Also, I am trying to use LCD with the board. I have connected an SPI module - ADC128S052. To bring up SPI2 & LCD, I have made changes to k3-am625-sk.dts file:-
// SPDX-License-Identifier: GPL-2.0 /* * AM625 SK: https://www.ti.com/lit/zip/sprr448 * * Copyright (C) 2021-2022 Texas Instruments Incorporated - https://www.ti.com/ */ /dts-v1/; #include <dt-bindings/leds/common.h> #include <dt-bindings/gpio/gpio.h> #include <dt-bindings/net/ti-dp83867.h> #include <dt-bindings/pinctrl/k3.h> #include <dt-bindings/interrupt-controller/irq.h> #include "k3-am625.dtsi" #include "k3-am62x-sk-common.dtsi" //#include "k3-am62x-lp-sk-oldi-panel.dts" / { compatible = "ti,am625-sk", "ti,am625"; model = "Platform-AM625-SK-13mar2023"; transceiver1: can-phy0 { compatible = "ti,tcan1042"; #phy-cells = <0>; max-bitrate = <5000000>; }; display { compatible = "microtips,13-101hieb0hf0-s"; /* * Note that the OLDI TX 0 transmits the odd set of pixels * while the OLDI TX 1 transmits the even set. This is a * fixed configuration in the IP integration and is not * changeable. The properties, "dual-lvds-odd-pixels" and * "dual-lvds-even-pixels" have been used to merely * identify if a Dual Link configuration is required. * Swapping them will not make any difference. */ port@0 { dual-lvds-odd-pixels; lcd_in0: endpoint { remote-endpoint = <&oldi_out0>; }; }; port@1 { dual-lvds-even-pixels; lcd_in1: endpoint { remote-endpoint = <&oldi_out1>; }; }; }; wlan_lten: regulator-5 { compatible = "regulator-fixed"; regulator-name = "wlan_lten"; regulator-min-microvolt = <3300000>; regulator-max-microvolt = <3300000>; regulator-always-on; vin-supply = <&vcc_3v3_sys>; gpios = <&exp1 11 GPIO_ACTIVE_LOW>; }; wlan_en: regulator-6 { /* OUTPUT of SN74AVC2T244DQMR */ compatible = "regulator-fixed"; regulator-name = "wlan_en"; regulator-min-microvolt = <1800000>; regulator-max-microvolt = <1800000>; enable-active-high; vin-supply = <&wlan_lten>; gpios = <&main_gpio0 71 GPIO_ACTIVE_HIGH>; pinctrl-names = "default"; pinctrl-0 = <&wlan_en_pins_default>; }; }; &main_pmx0 { wlan_en_pins_default: wlan-en-pins-default { pinctrl-single,pins = < AM62X_IOPAD(0x124, PIN_OUTPUT, 7) /* (A23) MMC2_SDCD.GPIO0_71 */ >; }; main_mmc2_pins_default: main-mmc2-pins-default { pinctrl-single,pins = < AM62X_IOPAD(0x120, PIN_INPUT, 0) /* (C24) MMC2_CMD */ AM62X_IOPAD(0x118, PIN_INPUT, 0) /* (D25) MMC2_CLK */ AM62X_IOPAD(0x114, PIN_INPUT, 0) /* (B24) MMC2_DAT0 */ AM62X_IOPAD(0x110, PIN_INPUT, 0) /* (C25) MMC2_DAT1 */ AM62X_IOPAD(0x10c, PIN_INPUT, 0) /* (E23) MMC2_DAT2 */ AM62X_IOPAD(0x108, PIN_INPUT, 0) /* (D24) MMC2_DAT3 */ AM62X_IOPAD(0x11c, PIN_INPUT, 0) /* (#N/A) MMC2_CLKB */ >; }; main_wlirq_pins_default: main-wlirq-pins-default { pinctrl-single,pins = < AM62X_IOPAD(0x128, PIN_INPUT, 7) /* (B23) MMC2_SDWP.GPIO0_72 */ >; }; main_spi2_pins_default: main-spi2-pins-default { pinctrl-single,pins = < AM62X_IOPAD(0x1B0, PIN_INPUT, 1) /* (A20) SPI2_CLK pins on expansion Header*/ AM62X_IOPAD(0x1AC, PIN_OUTPUT, 1) /* (E19) SPI2_CS0 pins on expansion Header */ AM62X_IOPAD(0x194, PIN_INPUT, 1) /* (B19) SPI2_D0 pins on expansion Header */ AM62X_IOPAD(0x198, PIN_INPUT, 1) /* (A19) SPI2_D1 pins on expansion Header */ >; }; main_mcan0_pins_default: main-mcan0-pins-default { pinctrl-single,pins = < AM62X_IOPAD(0x1dc, PIN_INPUT, 0) /* (E15) MCAN0_RX */ AM62X_IOPAD(0x1d8, PIN_OUTPUT, 0) /* (C15) MCAN0_TX */ >; }; main_oldi0_pins_default: main-oldi0-pins-default { pinctrl-single,pins = < AM62X_IOPAD(0x0260, PIN_OUTPUT, 0) /* (AA5) OLDI0_A0N */ AM62X_IOPAD(0x025c, PIN_OUTPUT, 0) /* (Y6) OLDI0_A0P */ AM62X_IOPAD(0x0268, PIN_OUTPUT, 0) /* (AD3) OLDI0_A1N */ AM62X_IOPAD(0x0264, PIN_OUTPUT, 0) /* (AB4) OLDI0_A1P */ AM62X_IOPAD(0x0270, PIN_OUTPUT, 0) /* (Y8) OLDI0_A2N */ AM62X_IOPAD(0x026c, PIN_OUTPUT, 0) /* (AA8) OLDI0_A2P */ AM62X_IOPAD(0x0278, PIN_OUTPUT, 0) /* (AB6) OLDI0_A3N */ AM62X_IOPAD(0x0274, PIN_OUTPUT, 0) /* (AA7) OLDI0_A3P */ AM62X_IOPAD(0x0280, PIN_OUTPUT, 0) /* (AC6) OLDI0_A4N */ AM62X_IOPAD(0x027c, PIN_OUTPUT, 0) /* (AC5) OLDI0_A4P */ AM62X_IOPAD(0x0288, PIN_OUTPUT, 0) /* (AE5) OLDI0_A5N */ AM62X_IOPAD(0x0284, PIN_OUTPUT, 0) /* (AD6) OLDI0_A5P */ AM62X_IOPAD(0x0290, PIN_OUTPUT, 0) /* (AE6) OLDI0_A6N */ AM62X_IOPAD(0x028c, PIN_OUTPUT, 0) /* (AD7) OLDI0_A6P */ AM62X_IOPAD(0x0298, PIN_OUTPUT, 0) /* (AD8) OLDI0_A7N */ AM62X_IOPAD(0x0294, PIN_OUTPUT, 0) /* (AE7) OLDI0_A7P */ AM62X_IOPAD(0x02a0, PIN_OUTPUT, 0) /* (AD4) OLDI0_CLK0N */ AM62X_IOPAD(0x029c, PIN_OUTPUT, 0) /* (AE3) OLDI0_CLK0P */ AM62X_IOPAD(0x02a8, PIN_OUTPUT, 0) /* (AE4) OLDI0_CLK1N */ AM62X_IOPAD(0x02a4, PIN_OUTPUT, 0) /* (AD5) OLDI0_CLK1P */ >; }; }; &main_mcan0 { status = "okay"; pinctrl-names = "default"; pinctrl-0 = <&main_mcan0_pins_default>; phys = <&transceiver1>; }; &mcu_pmx0 { /* MPU_I2C0_SCL -> MPU_I2C3_RTC_SCL & MPU_I2C0_SDA -> MPU_I2C3_RTC_SDA */ /* These pins are pulled high on hardware */ mcu_i2c0_pins_default: mcu_i2c0-pins-default { pinctrl-single,pins = < AM62X_MCU_IOPAD(0x0044, PIN_INPUT, 0) /* (A8) MCU_I2C0_SCL */ AM62X_MCU_IOPAD(0x0048, PIN_INPUT, 0) /* (D10) MCU_I2C0_SDA */ >; }; }; &mcu_i2c0 { status = "okay"; pinctrl-names = "default"; pinctrl-0 = <&mcu_i2c0_pins_default>; clock-frequency = <400000>; bq32000: rtc@68 { compatible = "ti,bq32000"; //trickle-resistor-ohms = <1120>; reg = <0x68>; }; }; /************************************************************************************/ &dss { pinctrl-names = "default"; pinctrl-0 = <&main_oldi0_pins_default &main_dss0_pins_default>; }; &dss_ports { #address-cells = <1>; #size-cells = <0>; /* VP1: LVDS Output (OLDI TX 0) */ port@0 { reg = <0>; oldi_out0: endpoint { remote-endpoint = <&lcd_in0>; }; }; /* VP1: LVDS Output (OLDI TX 1) */ port@2 { reg = <2>; oldi_out1: endpoint { remote-endpoint = <&lcd_in1>; }; }; }; &main_i2c1 { exp1: gpio@22 { compatible = "ti,tca6424"; reg = <0x22>; gpio-controller; #gpio-cells = <2>; gpio-line-names = "GPIO_CPSW2_RST", "GPIO_CPSW1_RST", "PRU_DETECT", "MMC1_SD_EN", "VPP_LDO_EN", "EXP_PS_3V3_En", "EXP_PS_5V0_En", "EXP_HAT_DETECT", "GPIO_AUD_RSTn", "GPIO_eMMC_RSTn", "UART1_FET_BUF_EN", "WL_LT_EN", "GPIO_HDMI_RSTn", "CSI_GPIO1", "CSI_GPIO2", "PRU_3V3_EN", "HDMI_INTn", "TEST_GPIO2", "MCASP1_FET_EN", "MCASP1_BUF_BT_EN", "MCASP1_FET_SEL", "UART1_FET_SEL", "TSINT#", "IO_EXP_TEST_LED"; interrupt-parent = <&main_gpio1>; interrupts = <23 IRQ_TYPE_EDGE_FALLING>; interrupt-controller; #interrupt-cells = <2>; pinctrl-names = "default"; pinctrl-0 = <&main_gpio1_ioexp_intr_pins_default>; }; }; &sdhci2 { vmmc-supply = <&wlan_en>; pinctrl-names = "default"; pinctrl-0 = <&main_mmc2_pins_default>; bus-width = <4>; non-removable; ti,fails-without-test-cd; cap-power-off-card; keep-power-in-suspend; ti,driver-strength-ohm = <50>; assigned-clocks = <&k3_clks 157 158>; assigned-clock-parents = <&k3_clks 157 160>; #address-cells = <1>; #size-cells = <0>; wlcore: wlcore@2 { compatible = "ti,wl1837"; reg = <2>; pinctrl-names = "default"; pinctrl-0 = <&main_wlirq_pins_default>; interrupt-parent = <&main_gpio0>; interrupts = <72 IRQ_TYPE_EDGE_FALLING>; }; }; &ospi0 { flash@0 { compatible = "jedec,spi-nor"; reg = <0x0>; spi-tx-bus-width = <8>; spi-rx-bus-width = <8>; spi-max-frequency = <25000000>; cdns,tshsl-ns = <60>; cdns,tsd2d-ns = <60>; cdns,tchsh-ns = <60>; cdns,tslch-ns = <60>; cdns,read-delay = <4>; cdns,phy-mode; partitions { compatible = "fixed-partitions"; #address-cells = <1>; #size-cells = <1>; partition@0 { label = "ospi.tiboot3"; reg = <0x0 0x80000>; }; partition@80000 { label = "ospi.tispl"; reg = <0x80000 0x200000>; }; partition@280000 { label = "ospi.u-boot"; reg = <0x280000 0x400000>; }; partition@680000 { label = "ospi.env"; reg = <0x680000 0x40000>; }; partition@6c0000 { label = "ospi.env.backup"; reg = <0x6c0000 0x40000>; }; partition@800000 { label = "ospi.rootfs"; reg = <0x800000 0x37c0000>; }; partition@3fc0000 { label = "ospi.phypattern"; reg = <0x3fc0000 0x40000>; }; }; }; }; &main_spi2{ pinctrl-names = "default"; pinctrl-0 = <&main_spi2_pins_default>; status = "okay"; adc@0 { compatible = "ti,adc128s052"; reg = <0>; spi-max-frequency = <1000000>; #io-channel-cells = <1>; }; }; /* &main_i2c0 { #address-cells = <1>; #size-cells = <0>; touchscreen@41 { compatible = "ilitek,ili251x"; reg = <0x41>; interrupt-parent = <&exp1>; interrupts = <15 IRQ_TYPE_EDGE_FALLING>; reset-gpios = <&exp2 18 GPIO_ACTIVE_LOW>; }; }; */
After adding my changes, I observe that in '/sys/class/i2c-adapter/i2c-1/' there is no file present related to TCA6424 ( as this IC is controlling SPI2 on J3 connector on board).
Also, there is no file related to SPI in /dev.
I removed LCD related changes from 'k3-am625-sk' , now I can see file '1-0022' in /sys/class/i2c-adapter/i2c-1/, but there there is no spi related file in /dev. Here is my dts file without lcd changes:-
// SPDX-License-Identifier: GPL-2.0
/*
* AM625 SK: https://www.ti.com/lit/zip/sprr448
*
* Copyright (C) 2021-2022 Texas Instruments Incorporated - https://www.ti.com/
*/
/dts-v1/;
#include <dt-bindings/leds/common.h>
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/net/ti-dp83867.h>
#include <dt-bindings/pinctrl/k3.h>
#include <dt-bindings/interrupt-controller/irq.h>
#include "k3-am625.dtsi"
#include "k3-am62x-sk-common.dtsi"
/ {
compatible = "ti,am625-sk", "ti,am625";
model = "Platform-AM625-SK-13mar2023";
transceiver1: can-phy0 {
compatible = "ti,tcan1042";
#phy-cells = <0>;
max-bitrate = <5000000>;
};
wlan_lten: regulator-5 {
compatible = "regulator-fixed";
regulator-name = "wlan_lten";
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
regulator-always-on;
vin-supply = <&vcc_3v3_sys>;
gpios = <&exp1 11 GPIO_ACTIVE_LOW>;
};
wlan_en: regulator-6 {
/* OUTPUT of SN74AVC2T244DQMR */
compatible = "regulator-fixed";
regulator-name = "wlan_en";
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
enable-active-high;
vin-supply = <&wlan_lten>;
gpios = <&main_gpio0 71 GPIO_ACTIVE_HIGH>;
pinctrl-names = "default";
pinctrl-0 = <&wlan_en_pins_default>;
};
};
&main_pmx0 {
wlan_en_pins_default: wlan-en-pins-default {
pinctrl-single,pins = <
AM62X_IOPAD(0x124, PIN_OUTPUT, 7) /* (A23) MMC2_SDCD.GPIO0_71 */
>;
};
main_mmc2_pins_default: main-mmc2-pins-default {
pinctrl-single,pins = <
AM62X_IOPAD(0x120, PIN_INPUT, 0) /* (C24) MMC2_CMD */
AM62X_IOPAD(0x118, PIN_INPUT, 0) /* (D25) MMC2_CLK */
AM62X_IOPAD(0x114, PIN_INPUT, 0) /* (B24) MMC2_DAT0 */
AM62X_IOPAD(0x110, PIN_INPUT, 0) /* (C25) MMC2_DAT1 */
AM62X_IOPAD(0x10c, PIN_INPUT, 0) /* (E23) MMC2_DAT2 */
AM62X_IOPAD(0x108, PIN_INPUT, 0) /* (D24) MMC2_DAT3 */
AM62X_IOPAD(0x11c, PIN_INPUT, 0) /* (#N/A) MMC2_CLKB */
>;
};
main_wlirq_pins_default: main-wlirq-pins-default {
pinctrl-single,pins = <
AM62X_IOPAD(0x128, PIN_INPUT, 7) /* (B23) MMC2_SDWP.GPIO0_72 */
>;
};
main_spi2_pins_default: main-spi2-pins-default {
pinctrl-single,pins = <
AM62X_IOPAD(0x1B0, PIN_INPUT, 1) /* (A20) SPI2_CLK pins on expansion Header*/
AM62X_IOPAD(0x1AC, PIN_OUTPUT, 1) /* (E19) SPI2_CS0 pins on expansion Header */
AM62X_IOPAD(0x194, PIN_INPUT, 1) /* (B19) SPI2_D0 pins on expansion Header */
AM62X_IOPAD(0x198, PIN_INPUT, 1) /* (A19) SPI2_D1 pins on expansion Header */
>;
};
main_mcan0_pins_default: main-mcan0-pins-default {
pinctrl-single,pins = <
AM62X_IOPAD(0x1dc, PIN_INPUT, 0) /* (E15) MCAN0_RX */
AM62X_IOPAD(0x1d8, PIN_OUTPUT, 0) /* (C15) MCAN0_TX */
>;
};
};
&main_i2c1 {
exp1: gpio@22 {
compatible = "ti,tca6424";
reg = <0x22>;
gpio-controller;
#gpio-cells = <2>;
gpio-line-names = "GPIO_CPSW2_RST", "GPIO_CPSW1_RST",
"PRU_DETECT", "MMC1_SD_EN",
"VPP_LDO_EN", "EXP_PS_3V3_En",
"EXP_PS_5V0_En", "EXP_HAT_DETECT",
"GPIO_AUD_RSTn", "GPIO_eMMC_RSTn",
"UART1_FET_BUF_EN", "WL_LT_EN",
"GPIO_HDMI_RSTn", "CSI_GPIO1",
"CSI_GPIO2", "PRU_3V3_EN",
"HDMI_INTn", "TEST_GPIO2",
"MCASP1_FET_EN", "MCASP1_BUF_BT_EN",
"MCASP1_FET_SEL", "UART1_FET_SEL",
"TSINT#", "IO_EXP_TEST_LED";
interrupt-parent = <&main_gpio1>;
interrupts = <23 IRQ_TYPE_EDGE_FALLING>;
interrupt-controller;
#interrupt-cells = <2>;
pinctrl-names = "default";
pinctrl-0 = <&main_gpio1_ioexp_intr_pins_default>;
};
};
&sdhci2 {
vmmc-supply = <&wlan_en>;
pinctrl-names = "default";
pinctrl-0 = <&main_mmc2_pins_default>;
bus-width = <4>;
non-removable;
ti,fails-without-test-cd;
cap-power-off-card;
keep-power-in-suspend;
ti,driver-strength-ohm = <50>;
assigned-clocks = <&k3_clks 157 158>;
assigned-clock-parents = <&k3_clks 157 160>;
#address-cells = <1>;
#size-cells = <0>;
wlcore: wlcore@2 {
compatible = "ti,wl1837";
reg = <2>;
pinctrl-names = "default";
pinctrl-0 = <&main_wlirq_pins_default>;
interrupt-parent = <&main_gpio0>;
interrupts = <72 IRQ_TYPE_EDGE_FALLING>;
};
};
&main_mcan0 {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&main_mcan0_pins_default>;
phys = <&transceiver1>;
};
&ospi0 {
flash@0 {
compatible = "jedec,spi-nor";
reg = <0x0>;
spi-tx-bus-width = <8>;
spi-rx-bus-width = <8>;
spi-max-frequency = <25000000>;
cdns,tshsl-ns = <60>;
cdns,tsd2d-ns = <60>;
cdns,tchsh-ns = <60>;
cdns,tslch-ns = <60>;
cdns,read-delay = <4>;
cdns,phy-mode;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
label = "ospi.tiboot3";
reg = <0x0 0x80000>;
};
partition@80000 {
label = "ospi.tispl";
reg = <0x80000 0x200000>;
};
partition@280000 {
label = "ospi.u-boot";
reg = <0x280000 0x400000>;
};
partition@680000 {
label = "ospi.env";
reg = <0x680000 0x40000>;
};
partition@6c0000 {
label = "ospi.env.backup";
reg = <0x6c0000 0x40000>;
};
partition@800000 {
label = "ospi.rootfs";
reg = <0x800000 0x37c0000>;
};
partition@3fc0000 {
label = "ospi.phypattern";
reg = <0x3fc0000 0x40000>;
};
};
};
};
&main_spi2{
pinctrl-names = "default";
pinctrl-0 = <&main_spi2_pins_default>;
status = "okay";
adc@0 {
compatible = "ti,adc128s052";
reg = <0>;
spi-max-frequency = <1000000>;
#io-channel-cells = <1>;
};
};
/*
&main_i2c0 {
#address-cells = <1>;
#size-cells = <0>;
touchscreen@41 {
compatible = "ilitek,ili251x";
reg = <0x41>;
interrupt-parent = <&exp1>;
interrupts = <15 IRQ_TYPE_EDGE_FALLING>;
reset-gpios = <&exp2 18 GPIO_ACTIVE_LOW>;
};
};
*/
Please confirm the correct way to enable SPI2 & LCD on SK-AM62 evaluation board. Thanks