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.

Linux/AM3354: Chip Select Problem with Two Slave (NOR flash)connected to SPI0 (cs0,cs1)

Part Number: AM3354

Tool/software: Linux

hi ,

I have a custom AM335x board, where we have connected two SPI NOR flash with separate chip Selects.

SPI0

CLK---------------------I--------------32MB flash 

                                I---------------8MB Flash

MOSI------------------|--------------32MB Flash

                               |------------- 8MB Flash

MISO------------------|-------------32MB flash

                               |------------8MB flash

CS0--------------------------------32MB flash

CS1--------------------------------8MB flash

the problem is as per  TRM of AM3354 as soon as pinmux is changed to SPI the both CS0 and Cs1 get low  24.2.3 

SPI chip select O output when master, input when slave (active low)

SPI chip select 1 output when master, input when slave (active low)

and to make it master we have clear MCSPI_MODULCTRL, as this register is Written only after spi get  register and while do register because both CS are low both chips respond which corrupt JDEG ID and it not working at all .

what is Solution ?

  • Hi,

    the problem is as per TRM of AM3354 as soon as pinmux is changed to SPI the both CS0 and Cs1 get low 24.2.3


    Can you share your dts settings? Specifically the pinmux configurations.

    Best Regards,
    Yordan
  • spi0_pins: pinmux_spi0 {
    pinctrl-single,pins = <
    AM33XX_IOPAD(0x950, PIN_INPUT_PULLUP | MUX_MODE0) /* (A17) spi0_sclk.spi0_sclk */
    AM33XX_IOPAD(0x954, PIN_INPUT_PULLUP | MUX_MODE0) /* (B17) spi0_d0.spi0_d0 */
    AM33XX_IOPAD(0x958, PIN_INPUT_PULLUP | MUX_MODE0) /* (B16) spi0_d1.spi0_d1 */
    AM33XX_IOPAD(0x95c, PIN_OUTPUT_PULLUP | MUX_MODE0) /* (A16) spi0_cs0.spi0_cs0 */
    AM33XX_IOPAD(0x960, PIN_OUTPUT_PULLUP | MUX_MODE0) /* (C15) spi0_cs1.spi0_cs1 */
    >;
    };


    &spi0 {
    pinctrl-names = "default";
    pinctrl-0 = <&spi0_pins>;

    status = "okay";
    };
  • Hi,

    You need to define:

    nor1@0 {
    compatible = "<cprresponding driver>";
    status = "okay";
    reg = <0>;
    etc..
    };
    nor@1 {
    compatible = "<cprresponding driver>";
    status = "okay";
    reg = <1>;
    etc..
    };
    See Documentation/devictree/bindings/spi/spi-davinci.txt or Documentation/devicetree/bindings/mtd/jedec,spi-nor.txt.

    In your current dts you've only enabled the spi controller and you didn't define the devices connected to cs1 and cs0

    Best Regards,
    Yordan