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-c6x: Can't work with SPI NOR flash

Hi, All!

I want to work with SPI NOR flash from linux-c6x (on custom board, on EVM I will check for few days). SPI the same as on EVM6678 - N25Q128 and connected to the CS0. In ti_evmc6678_defconfig I disable option CONFIG_IDLE_LED but my system can't boot. last kernel message:

...

Serial: 8250/16550 driver, 1 ports, IRQ sharing disabled
serial8250.0: ttyS0 at MMIO 0x2540000 (irq = 276) is a 16550A
console [ttyS0] enabled
brd: module loaded
loop: module loaded
at24 1-0050: 131072 byte 24c1024 EEPROM (writable)

In platform devices I can see that davincy driver was loaded:

/ # ls -l /sys/devices/platform/
drwxr-xr-x 2 root root 0 Nov 30 00:00 serial8250.0
drwxr-xr-x 3 root root 0 Nov 30 00:00 spi_davinci.0

Please, tell me, does anybody worked with SPI flash in linux-c6x?
What I need else in kernel configuration for working with SPI partitions via /dev/mtdblockXX or /dev/mtdXX?

I try different kernel options from TI wiki (for other boards) and google search but has no result at that time. I found that system stop booting if I enable this option in kernel:

CONFIG_MTD_M25P80=y

Thank you.

Vladimir

  • Update 1:

    I add output debug messages from davinci_spi driver and found that system is hung in interrupt service routine:

    ...

    Serial: 8250/16550 driver, 1 ports, IRQ sharing disabled
    serial8250.0: ttyS0 at MMIO 0x2540000 (irq = 276) is a 16550A
    console [ttyS0] enabled
    brd: module loaded
    loop: module loaded
    at24 1-0050: 131072 byte 24c1024 EEPROM (writable)
    mtdoops: mtd device (mtddev=name/number) must be supplied
    m25p80_init()
    davinci_spi_init()
    davinci_spi_probe()
    set_io_bits()
    set_io_bits()
    davinci_spi_setup()
    clear_fmt_bits()
    clear_io_bits()
    clear_fmt_bits()
    clear_io_bits()
    set_fmt_bits()
    set_io_bits()
    davinci_spi_setup_transfer()
    clear_fmt_bits()
    clear_io_bits()
    set_fmt_bits()
    set_io_bits()
    clear_fmt_bits()
    clear_io_bits()
    set_fmt_bits()
    set_io_bits()
    m25p_probe()
    jedec_probe()
    spi_write_then_read()
    spi_message_init()
    spi_message_add_tail()
    spi_message_add_tail()
    spi_sync()
    spi_async()
    davinci_spi_setup_transfer()
    clear_fmt_bits()
    clear_io_bits()
    set_fmt_bits()
    set_io_bits()
    clear_fmt_bits()
    clear_io_bits()
    set_fmt_bits()
    set_io_bits()
    davinci_spi_chipselect()
    clear_io_bits()
    set_io_bits()
    clear_io_bits()
    clear_io_bits()
    davinci_spi_setup_transfer()
    clear_fmt_bits()
    clear_io_bits()
    set_fmt_bits()
    set_io_bits()
    clear_fmt_bits()
    clear_io_bits()
    set_fmt_bits()
    set_io_bits()
    clear_io_bits()
    set_io_bits()
    clear_io_bits()
    set_io_bits()
    davinci_spi_irq() int_status = 0x1000300
    set_io_bits()

    If I enable polling mode in struct evm_spi0_pdata

    poll_mode = 1, /* 0 -> interrupt mode, 1-> polling mode */

    system boot up and I can see the /dev/mtdXX

    / # ls -l /dev/mtd*
    crw-rw---- 1 root root 90, 0 Nov 30 00:00 /dev/mtd0
    crw-rw---- 1 root root 90, 1 Nov 30 00:00 /dev/mtd0ro

    Please, tell me why SPI can't work in interrupt mode?

    Vladimir