目录
一、芯片的基础知识说起
MCU、MPU、CPU这些主控芯片,有8位、16位和32位、64位,
为啥一般的芯片的开始地址是0x80000000,那是因为芯片制造商的想法。
一、地址空间
一个颗32位架构的芯片它的寻址空间为:0 ~ 0xFFFFFFFF
大小 | 字节 | 尺寸 | 地址范围 |
---|---|---|---|
2^32(4294967296) | 4GB | 0x1 0000 0000 | 0 ~ 0xFFFFFFFF |
(1)i.MX6ULL系列芯片
i.MX6ULL 应用处理器内存地址映射表
来源:《IMX6ULL参考手册》
ARM Platform Memory Map
Start address | End address | Size | Description |
---|---|---|---|
8000_0000 | FFFF_FFFF | 2048 MB | MMDC—x16 DDR Controller. |
7000_0000 | 7FFF_FFFF | 256 MB | Reserved |
6000_0000 | 6FFF_FFFF | 256 MB | QSPI1 Memory |
5800_0000 | 5FFF_FFFF | 128 MB | EIM Aliased |
5000_0000 | 57FF_FFFF | 128 MB | EIM (NOR/SRAM) |
1000_0000 | 4FFF_FFFF | 1024 MB | Reserved |
0E00_0000 | 0FFF_FFFF | 32 MB | Reserved |
0C00_0000 | 0DFF_FFFF | 32 MB | QSPI1 Rx Buffer |
0900_0000 | 0BFF_FFFF | 48 MB | Reserved |
0800_0000 | 08FF_FFFF | 16 MB | Reserved |
02C0_0000 | 07FF_FFFF | 84 MB | Reserved |
0230_0000 | 02BF_FFFF | 9 MB | Reserved |
0220_0000 | 022F_FFFF | 1 MB | Table 2-4 AIPS-3. See IP listing on the separate map. |
0210_0000 | 021F_FFFF | 1 MB | Table 2-3 AIPS-2. See the IP listing on the separate map. |
0200_0000 | 020F_FFFF | 1 MB | Table 2-2 AIPS-1. See the IP listing on the separate map. |
0181_0000 | 01FF_FFFF | 8128 KB | Reserved |
0180_C000 | 0180_FFFF | 16 KB | Reserved |
0180_8000 | 0180_BFFF | 16 KB | BCH |
0180_6000 | 0180_7FFF | 8 KB | GPMI |
0180_4000 | 0180_5FFF | 32 KB | APBH DMA |
0180_0000 | 0180_3FFF | 16 KB | Reserved |
0120_0000 | 017F_FFFF | 6 MB | Reserved |
0110_0000 | 011F_FFFF | 1 MB | Reserved |
0100_0000 | 010F_FFFF | 1 MB | Reserved |
00F0_0000 | 00FF_FFFF | 1 MB | Reserved |
00E0_0000 | 00EF_FFFF | 1 MB | (per_m) configuration port |
00D0_0000 | 00DF_FFFF | 1 MB | (cpu) configuration port |
00C0_0000 | 00CF_FFFF | 1 MB | GPV_1 PL301 |
00B0_0000 | 00BF_FFFF | 1 MB | GPV_0 PL301 configuration port |
00A0_8000 | 00AF_FFFF | 992 KB | Reserved |
00A0_0000 | 00A0_7FFF | 32 KB | ARM Peripherals: GIC400 Only visible to ARM core(s) |
009C_0000 | 009F_FFFF | 256 KB | Reserved |
0098_0000 | 009B_FFFF | 256 KB | Reserved |
0092_0000 | 0097_FFFF | 384 KB | OCRAM aliased |
0090_0000 | 0091_FFFF | 128 KB | OCRAM 128 KB |
008F_8000 | 008F_FFFF | 32 KB | Reserved |
007F_8000 | 008F_7FFF | 1 MB | Reserved |
0010_0000 | 0010_7FFF | 32 KB | Reserved |
0001_8000 | 000F_FFFF | 928 KB | Reserved |
0001_7000 | 0001_7FFF | 4 KB | Boot ROM—Protected 4 KB area |
0000_0000 | 0001_6FFF | 92 KB | Boot ROM (ROMCP) |
从上表可以看出,在整个4GB的地址空间内,前2GB的地址空间有其他用处,后2GB的地址空间分配给了内存控制器,所以在操作内存地址的时候都是从0x80000000地址开始的,这其实就限制了该类型(32位架构)的芯片最大支持内存为4GB,而i.MX6ULL芯片所支持的最大的内存为2GB。
二、正点原子Linux开发板
- 512MB DDR3L
- 8GB EMMC
大小 | 字节 | 尺寸 | 地址范围 |
---|---|---|---|
536870912 | 512MB | 0x2000 0000 | 0 ~ 0x1FFF FFFF |
对应i.MX6ULL地址映射空间:
字节 | 尺寸 | 地址范围 | 对应 |
---|---|---|---|
512MB | 0x2000 0000 | 0 ~ 0x1FFF FFFF | 0x8000 0000 ~ 0xA000 0000 |
我在这里的操作:
嵌入式Linux–U-Boot(九)通过TFT/NFS网络更新U-Boot、Kernel、DTB文件
可以看到:
=> tftp 80800000 zImage
Using FEC1 device
TFTP from server 192.168.0.120; our IP address is 192.168.0.121
Filename 'zImage'.
Load address: 0x80800000
Loading: #################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
########
2.4 MiB/s
done
Bytes transferred = 6786368 (678d40 hex)
=> tftp 83000000 imx6ull_liefyuan_emmc.dtb
Using FEC1 device
TFTP from server 192.168.0.120; our IP address is 192.168.0.121
Filename 'imx6ull_liefyuan_emmc.dtb'.
Load address: 0x83000000
Loading: ###
2.1 MiB/s
done
Bytes transferred = 38823 (97a7 hex)
从上面可以看到:
- 地址0x80800000是从8MB的地方开始的一个内存区域,那前面8MB区域放了些啥玩意?
- 地址0x83000000是从48MB的地方开始的一个内存区域
- 地址一:0x83000000
- 地址二:0x80800000