This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

am437x SPI with 4 chip selects.

Other Parts Discussed in Thread: ASH, AM4372

Hi Forum,


I am gradually developing my device tree for the custom pinmux configuration. In our design we are using spi port with multiple chip selects. my question is will the chip selects be automatically be assigned to the device nodes??

cpu_spi1_pins_default: cpu_spi1_pins_default {
	pinctrl-single,pins = <
		0x108 ( PIN_OUTPUT | MUX_MODE2 ) /* (D16) mii1_col.spi1_sclk */
		0x10c ( PIN_OUTPUT | MUX_MODE2 ) /* (B14) mii1_crs.spi1_d0 */
		0x110 ( PIN_OUTPUT | MUX_MODE2 ) /* (B13) mii1_rx_er.spi1_d1 */
		0x144 ( PIN_OUTPUT | MUX_MODE2 ) /* (A16) rmii1_ref_clk.spi1_cs0 */
		0x164 ( PIN_OUTPUT | MUX_MODE2 ) /* (G24) eCAP0_in_PWM0_out.spi1_cs1 */
		0x194 ( PIN_OUTPUT | MUX_MODE2 ) /* (N22) mcasp0_fsx.spi1_cs2 */
		0x198 ( PIN_OUTPUT | MUX_MODE2 ) /* (H23) mcasp0_axr0.spi1_cs3 */
	>;
};


     &spi1 {
            status = "okay";
            pinctrl-names = "default";
            pinctrl-0 = <&cpu_spi1_pins_default>;
	    ti,spi-num-cs = <4>;
            spidev@0 {
                spi-max-frequency = <48000000>;
                reg = <0>;
                compatible = "ti,rohm,dh2228fv";
           };
	   spidev@1{
                spi-max-frequency = <48000000>;
                reg = <1>;
                compatible = "ti,rohm,dh2228fv";
           };
	  spidev@2 {
                spi-max-frequency = <48000000>;
                reg = <2>;
                compatible = "ti,rohm,dh2228fv";
           };
	  spidev@3 {
                spi-max-frequency = <48000000>;
                reg = <3>;
                compatible = "ti,rohm,dh2228fv";
           };
      };

my question is will the chip selects automatically assign themselves to the nodes ??

Regards

-Ash

  • Hi,

    I will ask the software team to look at this.
  • Hi Ash,

    "my question is will the chip selects automatically assign themselves to the nodes ??"
    Yes, they should assign automatically.

    Have in mind that you need to add the number of chip selects for spi1:
    spi1: spi@481a0000 {
    ........
    ti,spi-num-cs = <4>;
    .......
    };
    in am4372.dtsi

    Best Regards,
    Yordan
  • Hi Yordan,

    What is the bare minimum binary tree elements i need to have to successfully boot kernel in my am437x gpevm ??

    Regards
    -Ash
  • Hi, 

    ash parker said:
    What is the bare minimum binary tree elements

    Do you mean the minimum elements needed in the DTS?

    If so, then the absolutely necessary elements are: 
    tps

    i2c that controls the pmic

    fixed voltage regulators (if there are any on your board)

    booting device: mmc (whether it is interfaced with sd card or emmc), gpmc (if interfaced with nand), etc...

    and the pinmux of the i2c, boot device, and so on.... 

    Everything that is essential for the proper device operation MUST be described in the dts (dts node & pinmux). 

    All non essential peripherals, like gpios, spis, displays, cameras & so on can be removed. 

    Best Regards, 
    Yordan

  • Hi Yordan,

    I have used the pinmux tool and avoided all the pin conflicts in my custom design. and will i be able to use this design (dtb file) on the am437x gp evm. because fabrication might take a while ?? I thought may be i will be able to check the devices relating to my custom tree if this is possible.

    regards
    -Ash
  • Hi Ash,

    ash parker said:
    will i be able to use this design (dtb file) on the am437x gp evm.

    Yes, you should be able to use it.

    Best Regards, 

    Yordan