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.

OMAP-L138 accessing Serial Flash from kernel

Other Parts Discussed in Thread: OMAP-L138

Hi,

The wiki page for the OMAP-L138 PSP http://processors.wiki.ti.com/index.php/DaVinci_PSP_03.20.00.11_Device_Driver_Features_and_Performance_Guide shows that the working SPI flash driver gets exposed as a /dev/mtdX device. For NAND devices e.g. there are utilities like nandwrite, nanddump, flash_erase to read/write/erase from an mtd partition. What are the utilities for read/write/erase using the serial flash driver? Are they in the out-of-the-box filesystem inside the PSP?

Thanks,

--Gunter

  • Hi Gunter,

    You can use "flash_eraseall /dev/mtdX" to erase the SPI partition. To read/write from the SPI device, you need to mount the SPI partition(/dev/mtdblockX). You can also read/write to the SPI device using the character interface (dev/mtdX) with the help of "cat" command from the command line.

    Regards,

    Sudhakar

  • Thanks, Sudhakar.

     

    Could you tell me how I can erase just parts of the SPI flash and write, e.g. just the u-boot without touching the UBL?

     

    Regards,

    --Gunter

  • Hi Gunter,

    For this, the spi flash MTD part definitions provided in arch/arm/mach-davinci/board-da850-evm.c, spi_flash_partitions[] array should be made to match the UBL/U-boot locations. I realized this structure is not aligned currently. On OMAP-L138 EVM, the UBL is at offset 0 of SPI flash and U-Boot is at offset of 64K within the SPI flash.

    Note that the U-Boot needs to be written with a header as defined by armubl/include/spiboot.h

    Thanks,

    Sekhar