NAND FLASH分区规划
U-Boot中的NAND分區
文件:include/configs/開發板.h 這是Phy3250的參數,Phy3250采用32MB的NAND FLASH,扇區大小為16KB:189 /* Phy3250's NAND FLASH, 32MB, 16K size(Block, Sector) */ 190 //#define CFG_ENV_SIZE ? ? ? ? ? ? 0x4000 ? ? ?/* 1 block, 16K */ 191 //#define CFG_ENV_OFFSET ? ? ? ?0x168000 ?/* Block 90 ? ? ? */
如下是SmartARM3250的NAND FLASH,K9F2G08,256MB,扇區大小為128K:
193 /* SmartARM3250's NAND FLASH, K9F2G08, 256MB, 128K size(Block, Sector) */ 194 #define CFG_ENV_SIZE ? ? ? ? ? 0x40000 ? ? ? /* 2 Block, 256K */ 195 #define CFG_ENV_OFFSET ? ? ?0x180000 ? ? /* Block 12 ? ? ? ? */??
Kernel中的NAND FLASH分區
????NAND FLASH規劃
分???? 區?????????????????????????????????? 地址范圍??????????????????????? 扇區范圍??????????????????? 大??? 小??????????????? 用???? 途
?Bootloader???????????? 0x0000 0000 ~ 0x0018 0000?????0 ~ 11????????? 12個扇區,1.50M?????????????? S1L和U-Boot
?param????????????????? 0x0018 0000 ~ 0x001C 0000??????12~13?????????? 2個扇區,? 256K???????????????? U-Boot參數
保留??????????????????? 0x001C 0000 ~ 0x0020 0000???????? 14~15
?Linux Kernel?????????? 0x0020 0000 ~ 0x0060 0000????16~47?????????? 32個扇區,4.00M??????????????? ?Linux內核
?Rootfs???????????????? 0x0060 0000 ~ 0x1000 0000????????48~2047???????? 2000個扇區,250M?????????? Linux文件系統???
?
rootfs | 2047 48 | ? 共2000扇區 |
?Kernel | 47 16 | 共32扇區? |
?保留 | 15? 14 | ? 共2扇區 |
?param | 13 ? 12 | ? 共2扇區 |
| ? Bootlloader | 11? 0 | ? 共12扇區 |
分區實現
在linux-2.6.27.8/arch/arm/mach-lpc32xx/board-smartarm3250.c中的實現代碼: 153 #define BLK_SIZE (0x20000) //128KB 154 static struct mtd_partition __initdata smartarm3250_nand_partition[] = { 155 ? ? { 156 ? ? ? ? .name ? = "smartarm3250-boot", 157 ? ? ? ? .offset = 0, 158 ? ? ? ? .size ? = (BLK_SIZE * 12) 159 ? ? }, 160 ? ? { 161 ? ? ? ? .name ? = "smartarm3250-ubt-prms", 162 ? ? ? ? .offset = (BLK_SIZE * 12), 163 ? ? ? ? .size ? = (BLK_SIZE * 2) 164 ? ? }, 165 ? ? { 166 ? ? ? ? .name ? = "smartarm3250-kernel", 167 ? ? ? ? .offset = (BLK_SIZE * 16), 168 ? ? ? ? .size ? = (BLK_SIZE * 32) 169 ? ? }, 170 ? ? { 171 ? ? ? ? .name ? = "smartarm3250-rootfs", 172 ? ? ? ? .offset = (BLK_SIZE * 48), 173 ? ? ? ? .size ? = MTDPART_SIZ_FULL 174 ? ? }, 175 };?
?
?
總結
以上是生活随笔為你收集整理的NAND FLASH分区规划的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: linux 刷新磁盘分区,linux中关
- 下一篇: [转]字符串和编码