LS1021A : Accessing NOR from bare metal application

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

LS1021A : Accessing NOR from bare metal application

490 次查看
amolshrotri
Contributor II


Hello,

I am trying to access NOR from bare metal application. My understanding is as it is connected through IFC, we need to access NOR through IFC. Currently I can see as it is mapped at 0x60000000 and I can read the data directly from NOR as buffer. But I am not getting clear understanding how can i write, erase the NOR sectors. I am not able to understand how to send the program / erase command sequence to CFI NOR. Can you please provide some reference for the same?

So for writing as per CFI command sequence can I use something like below

Writing 0xAA at address 0x0x60000100

#define NOR_DEV_BASE_ADDRESS     0x60000000

{

  volatile uint16_t   *cfi_nor_flash_base = (volatile uint16_t *)NOR_DEV_BASE_ADDRESS;

  volatile uint8_t   *cfi_nor_flash_8x_base = (volatile uint8_t *)NOR_DEV_BASE_ADDRESS;

 

  cfi_nor_flash_base[0x555] = 0xAA;

  cfi_nor_flash_base[0x2AA] = 0x55;

  cfi_nor_flash_base[0x555] = 0xA0;

 

  cfi_nor_flash_8x_base[0x100] = 0xAA;

}

Thanks & Regards,

Amol M Shrotri

0 项奖励
回复
1 回复

395 次查看
ufedor
NXP Employee
NXP Employee

It is recommended to refer to the U-Boot source code provided in the Linux SDK available at:

Linux® SDK for QorIQ Processors|NXP

or Freescale Public GIT:

Freescale Public GIT

/drivers/mtd/cfi_flash.c

/board/freescale/ls1021atwr/ls1021atwr.c

0 项奖励
回复