J784S4XEVM: Configuration and use of the SPI5 of the J784S4XEVM board

Part Number: J784S4XEVM

Tool/software:

Hi,

We are trying to use the SPI5 on the J784S4XEVM. 

For that, firstly, I try to activate it under Linux and detect it. 

However, until now, I can't detect anything. I would wait a new spi appearing in /sys/class/spi_master. For now, I only have spi0 and spi1 and what I have modified doesn't change anything.

I have tried to add in the device tree file k3-j784s4-evm.dts the following node "main_spi5_pins_default": 

&main_pmx0 {
	bootph-all;
	main_cpsw2g_default_pins: main-cpsw2g-default-pins {
		pinctrl-single,pins = <
			J784S4_IOPAD(0x0b8, PIN_INPUT, 6) /* (AC34) MCASP1_ACLKX.RGMII1_RD0 */
			J784S4_IOPAD(0x0a0, PIN_INPUT, 6) /* (AD34) MCASP0_AXR12.RGMII1_RD1 */
			J784S4_IOPAD(0x0a4, PIN_INPUT, 6) /* (AJ36) MCASP0_AXR13.RGMII1_RD2 */
			J784S4_IOPAD(0x0a8, PIN_INPUT, 6) /* (AF34) MCASP0_AXR14.RGMII1_RD3 */
			J784S4_IOPAD(0x0b0, PIN_INPUT, 6) /* (AL33) MCASP1_AXR3.RGMII1_RXC */
			J784S4_IOPAD(0x0ac, PIN_INPUT, 6) /* (AE34) MCASP0_AXR15.RGMII1_RX_CTL */
			J784S4_IOPAD(0x08c, PIN_INPUT, 6) /* (AE35) MCASP0_AXR7.RGMII1_TD0 */
			J784S4_IOPAD(0x090, PIN_INPUT, 6) /* (AC35) MCASP0_AXR8.RGMII1_TD1 */
			J784S4_IOPAD(0x094, PIN_INPUT, 6) /* (AG35) MCASP0_AXR9.RGMII1_TD2 */
			J784S4_IOPAD(0x098, PIN_INPUT, 6) /* (AH36) MCASP0_AXR10.RGMII1_TD3 */
			J784S4_IOPAD(0x0b4, PIN_INPUT, 6) /* (AL34) MCASP1_AXR4.RGMII1_TXC */
			J784S4_IOPAD(0x09c, PIN_INPUT, 6) /* (AF35) MCASP0_AXR11.RGMII1_TX_CTL */
		>;
	};

	main_spi5_pins_default: main-spi5-pins-default {
		pinctrl-single,pins = <
			J784S4_IOPAD(0x07c, PIN_OUTPUT, 8) /* (AJ38) SPI_CLK */
			J784S4_IOPAD(0x068, PIN_OUTPUT, 8) /* (AE38) SPI5_CS0 */
			J784S4_IOPAD(0x064, PIN_OUTPUT, 8) /* (AF38) SPI5_CS1 */
			J784S4_IOPAD(0x054, PIN_OUTPUT, 8) /* (AD37) SPI5_CS2 */
			J784S4_IOPAD(0x058, PIN_OUTPUT, 8) /* (AE37) SPI5_CS3 */
			J784S4_IOPAD(0x070, PIN_OUTPUT, 8) /* (AH38) SPI5_D0 (MOSI) */
			J784S4_IOPAD(0X088, PIN_INPUT, 11) /* (AF36) SPI5_D1 (MISO) */

		>;
	};

and use it in the same file: 

&main_spi5 {
	status = "okay";
	pinctrl-names = "default";
	pinctrl-0 = <&main_spi5_pins_default>;
	#address-cells = <1>;
	#size-cells = <0>;

    spidev@0 {
		compatible = "linux,spidev";
		reg = <0>; 
		spi-max-frequency = <10000000>; //10MHz
	};
};

I also put the status of main_spi5 from "disabled" to "okay" in the file "k3-j784s4-main.dtsi.

When booting with the new dtb, I first stop in u-boot to configure the mux to enable spi5. 

For that, I do the following command in u-boot : "i2c dev 3; i2c mw 0x22 0xd 0x1f; i2c mw 0x22 0x5 0x20; i2c md 0x22 0x1".

It shows me a value of 0x2a, that looks to be what we expect to configure spi5 through the mux.

However, after booting, I didn't see any new spi.

Do I miss something to use spi5?

Thanks in advance for your help.

Best Regards,

K.Luong

  • Hi K.Luong,

    For compatible string, could you use "rohm,dh2228fv" or another compatible name defined in spidev.c but not "spidev"? There had been some changes to spidev driver in newer kernel versions that checks and rejects "spidev" compatible name.

    Regards,

    Takuma

  • Hi,

    I tried to put different string in the compatible string but it doesn't change anything. 

    Can you confirm that my mux is well configured to use spi5 with the i2c commands I do in U-boot?

    Thank you for your help.

    Best regards,

    K.Luong