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.

AM5728: Enabling SPI1 Issues

Part Number: AM5728

Hello, 

I'm having some issues enabling SPI1 with the following configurations: 

1.)

In U-boot-2017.1/board/ti/am57xx/mux_data.h:

const struct pad_conf_entry core_padconf_array_essential_am572x_idk[] = {

{SPI1_SCLK, (M14 | PIN_OUTPUT)},

{SPI1_D1, (M14 | PIN_OUTPUT)},

{SPI1_D0, (M14 | PIN_OUTPUT)},

{SPI1_CS0, (M14 | PIN_OUTPUT)}

};

2.) I have enabled CONFIG_SPI_SPIDEV in linux-kernel/arch/arm/configs/tisdk_am57xx-evm_defconfig

3.) I have modifed the device tree file as follows: 

&dra7_pmx_core {


spi1_pins_s0: spi1_pins_s0 {
pinctrl-single,pins = <
0x3A4 (PIN_INPUT_PULLUP | MUX_MODE0) /* GW SPI CLIK | Ballpin A25 */
0x3A8 (PIN_INPUT_PULLUP | MUX_MODE0) /* GW SPI MISO | Ballpin F16 */
0x3AC (PIN_OUTPUT_PULLUP | MUX_MODE0) /* GW SPI MOSI | Ballpin B25 */
0x3B0 (PIN_OUTPUT_PULLUP | MUX_MODE0) /* GW SPI CS | Ballpin A24 */
>;

};

&mcspi1 {
     status = "okay";
     pinctrl-names = "default";
     pinctrl-0 = <&spi1_pins_s0>;
     ti,pindir-d0-out-d1-in;
     spidev@1 {
         spi-max-frequency = <48000000>;
         reg = <0>;
         compatible = "rohm,dh2228fv";
     };
};

4.) When the device boots up, I am able to see /dev/spidev1.0. However, when I perform the command echo "deadbeat" >> /dev/spidev1.0, I'm not seeing any activity on the clk line, cs line, or MOSI line! 

What steps am I missing? 

  • Hi,

    Could you share which Processor SDK Linux version is this, so I can reproduce on my side?

    Best Regards,
    Yordan

  • Hi,

    As I see from your pinmux configurations in mux_data.h you still use muxmode 14, which is GPIO7. Can you try using muxmode 0 (or M0 in mux_data.h), which corresponds to the SPI pins? 

    Best Regards,
    Yordan

  • Hey Yordon, 

    I have tried setting the pinmux to M0 in mux_data.h, but still no luck! 

    I'm using the ti-processor-linux-am57XX-evm-4.00.00.04 

    Thanks!

  • Hey Yordon, 


    I also wanted to add that I have an AM5728 dev board and it looks some spi1 lines are attached to some USR leds. Whenever I boot up the leds turn on, and looking at the device tree files, some leds are for heartbeat, mmc,  cpu0, and disk activity! I've tried changing the gpio pins to something else thinking that somehow my pinmux got overridden, but even this yielded no luck... Perhaps something else is overriding SPI1 pinmux that I'm not aware of? 

  • Hey Yordon and the rest of the community, 

    It turns out the way above did get spidev1.0 working correctly! 

    The SPI1 lines were hooked up to another driver which wasn't working, thus we saw no output after the driver (facepalm).

    For the dev board, since it has an EEPROM present, it never loaded my device tree file with spi1 driver enabled. Thus, couldn't see the LEDs blink.

    In terms of uboot pinmux, I don't think it really mattered what I did since the device tree file in Linux would overwrite what I've pinmuxed in u-boot. Although I think it's best practice to set everything in uboot and not have to modify pinmuxing in the device tree. 

    Thanks for the help anyways! :)