NOR Flash support on DM365

From Texas Instruments Embedded Processors Wiki

Jump to: navigation, search
Translate this page to   

The following is a guideline on how to add NOR flash support to DM365 LSP:




Define NOR flash support in Uboot


*=======*/
/* Board */
/*=======*/
#define CFG_DM365_EVM
/* #define CFG_USE_NAND */
#define CFG_USE_NOR
#ifdef CFG_USE_NAND
#define CFG_DAVINCI_STD_NAND_LAYOUT
#endif
#define CONFIG_ENV_OVERWRITE

...

Add Flash configuration in the header file: see example below

/*=====================*/
/* Flash & Environment */
/*=====================*/

elif defined(CFG_USE_NOR)
#define CONFIG_SKIP_LOWLEVEL_INIT /* U-Boot is loaded by a bootloader */
#define CONFIG_SKIP_RELOCATE_UBOOT /* to a proper address, init done */
#define CFG_ENV_IS_IN_FLASH
#undef CFG_NO_FLASH
#define CONFIG_FLASH_CFI_DRIVER
#define CFG_FLASH_CFI
#define CFG_MAX_FLASH_BANKS 1
#define CFG_FLASH_SECT_SZ 0x10000 /* 64 KByte *sector size AMD flash */
#define PHYS_FLASH_SIZE 0x800000 /* Flash Size 8 MByte */
#define CFG_ENV_OFFSET 0x60000
#define PHYS_FLASH_1 0x02000000 /* CS1 Based Address */
#define CFG_FLASH_BASE PHYS_FLASH_1 /* Flash Base for U-Boot */
#define CFG_MAX_FLASH_SECT 0x80 /* 128 Sector */
#define CFG_ENV_SECT_SIZE CFG_FLASH_SECT_SZ




If you need support for NOR MTD file system, modify Linux MTD driver to add support for NOR flash. This can be done by porting MTD driver code from DM6446 (since we have NOR support already in DM6446 MTD driver).

  1. Copy davinci_nor.c from DM6446 LSP
  2. Modify the code to add the appropriate header ( /linux/platform_device.h> )
  3. Modify Kconfig and Makefile
  4. Modify NOR partition in board-dm365-evm.c
  5. Disable MMC/SD driver.  (EMIF address line EM_A20 is muxed with MMCSD1_CLK)
  6. Additional information on MTD filesystem can be found in related WIKI page ( Filesystem_in_NOR_or_NAND )


Below are some detail on PIN MUX and boot strap for NOR flash support. HW boot strap

BTSEL[2:0] = 001 (AEMIF boot), this disable HPI, set EM_A0, EM_A1, EM_A2, EM_BA1

AECFG[2:0] = 101 Activate 16 bit mode (EM_D0-15), this enable address pins EM_A0 – EM_A14 (switch EM_BA0 to EM_A14) , EM_BA1



SW pinmux register programming (done in UBL code)

PINMUX0 [ xx xx : xx xx : xx xx : xx 10 : xx xx : xx xx : xx xx : xx xx ]


PINMUX4 [10 10 : 10 10 : 10 xx : 10 xx : xx xx : xx xx : xx xx : xx xx ]


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