AnsweredAssumed Answered

P2020 Change Nor Flash From 16M to 32M

Question asked by zhaoping yang on Dec 5, 2016
Latest reply on Dec 5, 2016 by ufedor

Hi,

 From the BSP P2020_RDB, the Nor Flash size is 16M,from 0xff00_0000 to 0xffff_ffff,but Now i want change the nor flash size to 32M, From 0xfe00_0000 to 0xffff_ffff.

FLASH_BOOT_ADRS = 0xff00_0000,FLASH_BASE_ADRS = 0xfe00_0000

follow is my TLB setting:
addis r4, 0, 0x1000 /* TLB1 entry#0 */
ori r4, r4, 0x0000
mtspr MAS0, r4
addis r5, 0, HI(MMU_STATE_VALID|MMU_STATE_IPROT)
ori r5, r5, _MMU_TLB_SZ_16M /* TS = 0, TSIZE = 16 MByte */
mtspr MAS1, r5
addis r6, 0, HI(FLASH_BOOT_ADRS) /* EPN */
ori r6, r6, MMU_ROM_ACCESS
mtspr MAS2, r6
addis r7, 0, HI(FLASH_BOOT_ADRS) /* RPN */
ori r7, r7, 0x0015 /* Supervisor XWR */
mtspr MAS3, r7
tlbwe
tlbsync


addis r4, 0, 0x1001 /* TLB1 entry#0 */
ori r4, r4, 0x0000
mtspr MAS0, r4
addis r5, 0, HI(MMU_STATE_VALID|MMU_STATE_IPROT)
ori r5, r5, _MMU_TLB_SZ_16M /* TS = 0, TSIZE = 16 MByte */
mtspr MAS1, r5
addis r6, 0, HI(FLASH_BASE_ADRS) /* EPN */
ori r6, r6, MMU_ROM_ACCESS
mtspr MAS2, r6
addis r7, 0, HI(FLASH_BASE_ADRS) /* RPN */
ori r7, r7, 0x0015 /* Supervisor XWR */
mtspr MAS3, r7
tlbwe
tlbsync

 

/*LAW config from 0xfe00_0000 64M size*/

/* Local access window 0 (Nor Flash) initialize */
WRITEADR(r6, r7, M85XX_LAWBAR0(CCSBAR), 0x000fc000)
WRITEADR(r6, r7, M85XX_LAWAR0(CCSBAR), 0x80400019)

 

/*ELBC Cs 0*/

WRITEADR(r6, r7, M85XX_BR0(CCSBAR), 0xfe001001)
WRITEADR(r6, r7, M85XX_OR0(CCSBAR), 0xfe000030)

 

but P2020 NorFlash didnot work correct。

 

I want to know how to config TLB/LAW And eLbc OR and AR register

Outcomes