SPI flash boot and flashing tool for DM36x

From Texas Instruments Embedded Processors Wiki

Jump to: navigation, search
Translate this page to   

SPI Flash Support in the kernel

devices such as an EEPORM or a SPI Flash are considered specific to the EVM.

i.e /arch/arm/mach-davinci/board-dm365-evm.c.

SPI Flash is treated as a MTD devices.

static struct mtd_partition dm365_spi_flash_partitions[] = {

       {
               .name           = "Bootloader",
               .size           = 0x00080000,
               .offset         = 0,
               .mask_flags     = MTD_WRITEABLE, /* we want this to be read only */
       },{
               .name           = "Kernel-Filesystem",
               .offset         = MTDPART_OFS_APPEND,
               .size           = MTDPART_SIZ_FULL,
               .mask_flags     = 0,
       },

};

static const struct flash_platform_data dm365_spi_flash = {

       .type           = "m25p16", /* part tested was a Numonyx m25p16 device */
       .name           = "spi_flash",
       .parts          = dm365_spi_flash_partitions,
       .nr_parts       = ARRAY_SIZE(dm365_spi_flash_partitions),

}

static struct spi_board_info dm365_evm_spi_info[] __initconst = {

       {
               .modalias       = "m25p80",
               .platform_data  = &dm365_spi_flash,
               .max_speed_hz	= 20 * 1000 * 1000,
               .bus_num        = 0,
               .chip_select	= 0,
               .mode           =SPI_MODE_0,
       }

}

Please note that not all SPI FLASH devices will support the "fast read" option so please refer the device specific data sheet before enabling this option in DM365 .config

   davinci_nand davinci_nand.0: controller rev. 2.3
   spi_davinci spi_davinci.0: DaVinci SPI driver in EDMA mode
   Using RX channel = 17 , TX channel = 16 and event queue = 3
   m25p80 spi0.0: m25p16 (2048 Kbytes)
   Creating 2 MTD partitions on "spi_flash":
   0x000000000000-0x000000080000 : "Bootloader"
   0x000000080000-0x000000200000 : "Kernel-Filesystem"

partitions will be mtd5 and mtd6.

 root@dm365-evm:/# flash_eraseall /dev/mtd6
 Erasing 64 Kibyte @ 180000 -- 100 % complete.
 root@dm365-evm:/# echo "Texas Instruments" > /dev/mtd6
 root@dm365-evm:/# strings /dev/mtd6
 Texas Instruments
E2e.jpg For technical support please post your questions at http://e2e.ti.com. Please post only comments about the article SPI flash boot and flashing tool for DM36x here.
Hyperlink blue.png Links
ARM Microcontroller MCU ARM Processor Digital Media Processor Digital Signal Processing Microcontroller MCU Multi Core Processor
Ultra Low Power DSP 8 bit Microcontroller MCU 16 bit Microcontroller MCU 32 bit Microcontroller MCU

Leave a Comment
Personal tools
Namespaces
Variants
Actions
Navigation
Print/export
Toolbox