当前位置:网站首页>Memory address mapping of u-boot
Memory address mapping of u-boot
2022-06-12 23:44:00 【Cheap sword】
summary
- This article mainly analyzes
Memory address mapping
- ARM The length in the segmented mapping of is 1MB, So we're all 4G Need... Within the scope 4G/1MB=4096 A mapping unit
Code
1. Memory address mapping 1
.macro FL_SECTION_ENTRY base,ap,d,c,b
.word (\base << 20) | (\ap << 10) | \
(\d << 5) | (1<<4) | (\c << 3) | (\b << 2) | (1<<1)
.endm
mmu_table:
.set __base,0
// Access for iRAM
.rept 0x100
FL_SECTION_ENTRY __base,3,0,0,0
.set __base,__base+1
.endr
.rept
and.endr
It's a pair of features0x100
It's ten years ago 256, So the cycle 256 Time , Then this paragraph is 256MBFL_SECTION_ENTRY
Before macro 20 Bit sets the base address- In the loop body ,
__base
For the initial 0, Then add 1 Enter againFL_SECTION_ENTRY
, Reason by analogy . .rept 0x100
Can be seen as.rept 0x100 - 0x0
, Then the mapped virtual address is0 To 0x10000000
- Physical address from 0 Start , until 0x1000000, Therefore, the mapped virtual address is equal to the real address
- Every time you move left 20 position (10 Is it K,20 Is it M), So from 0 To 0x100,base The correspondence between and address is as follows
address | base |
---|---|
0 | 0 |
0x00100000 | 1 |
0x00200000 | 2 |
0x00300000 | 3 |
0x00400000 | 4 |
…… | …… |
0x10000000 | 256(0x100) |
2. Memory address mapping 2
// Not Allowed
.rept 0x200 - 0x100
.word 0x00000000
.endr
- Circulated
0x200-0x100=0x100
(256) Time , Is mapped 256MB - The mapping of 256MB The virtual address of corresponds to the physical address 0 Address
3. Memory address mapping 3
.set __base,0x200
// should be accessed
.rept 0x600 - 0x200
FL_SECTION_ENTRY __base,3,0,1,1
.set __base,__base+1
.endr
- Mapping 1G(0x400) Of memory space
- Both physical and virtual addresses are from 0x20000000 From to 0x60000000
4. Memory address mapping 4
.rept 0x800 - 0x600
.word 0x00000000
.endr
- Mapping 512MB(0x200) Space to 0 Address
5. Memory address mapping 5
.set __base,0x800
.rept 0xb00 - 0x800
FL_SECTION_ENTRY __base,3,0,0,0
.set __base,__base+1
.endr
- Mapping 768MB(0x300) Of memory space
- Both physical and virtual addresses are from 0x80000000 to 0xb0000000
6. Memory address mapping 6
.set __base,0xB00
.rept 0xc00 - 0xb00
FL_SECTION_ENTRY __base,3,0,0,0
.set __base,__base+1
.endr
- Mapping 256MB(0x100) Memory space
- Both physical and virtual addresses are from 0xb0000000 From to 0xc0000000
7. Memory address mapping 7
// 0xC000_0000 Mapping to 0x2000_0000
.set __base,0x300
//.set __base,0x200
// 256MB for SDRAM with cacheable
.rept 0xD00 - 0xC00
FL_SECTION_ENTRY __base,3,0,1,1
.set __base,__base+1
.endr
- Mapping 256MB(0x100) Memory space
- Physical address from 0x30000000 To 0x40000000
- Virtual address from 0xc0000000 To 0xd0000000
8. Memory address mapping 8
set __base,0xD00
.rept 0x1000 - 0xD00
FL_SECTION_ENTRY __base,3,0,0,0
.set __base,__base+1
.endr
- Mapping 768MB(0x300) Memory space
- Both physical and virtual addresses are from 0xd0000000 To 0x1000000000
summary
Virtual address (16 Base number ) | Physical address (16 Base number ) | length |
---|---|---|
0-10000000 | 0-10000000 | 256MB |
10000000-20000000 | 0 | 256MB |
20000000-60000000 | 20000000-60000000 | 1GB |
60000000-80000000 | 0 | 512MB |
80000000-b0000000 | 80000000-b0000000 | 768MB |
b0000000-c0000000 | b0000000-c0000000 | 256MB |
c0000000-d0000000 | 30000000-40000000 | 256MB |
d0000000-100000000 | d0000000-0x100000000 | 768MB |
- So this MMU The function of is to put the virtual address 0xc0000000-0xd0000000 Mapping to 0x30000000-0x40000000
- It is the same as the physical address except for two unreachable virtual addresses
- In the physical address 30000000-40000000 Did
Twice mapping
, So here uboot in , Virtual address 30000000-40000000 And c0000000-d0000000 yesThe same address
, It's just that it may be in different on-board chips .
边栏推荐
- Actual combat | inductance element positioning -- detailed explanation of Halcon and opencv implementation (with source code)
- 2202 - production de CV
- Xi'an Jiaotong 22nd autumn e-commerce technology online expansion resources (IV) [standard answer]
- Model over fitting - solution (II): dropout
- 最全预告!华为云精彩议程火速收藏
- 华为云会议初体验【华为云至简致远】
- Summary of individual NLP internship experience
- [literature translation - Part] revealing the structure of clinical EEG signals by self supervised learning (SSL and RP principles / data / preprocessing)
- 36 krypton's debut | "osogena" won nearly ten million angel rounds of financing. The original DLR scientists of German Aerospace Research and development system modeling and simulation CAE software PA
- CST learning: four element array design of circular patch antenna (II) array formation and combination results
猜你喜欢
Leetcode 890 finding and replacing patterns [map] the leetcode path of heroding
M_8:设计消息队列存储消息数据的 MySQL 表格
Preparing for the Blue Bridge Cup Day11__ Basic operation of serial port communication
leaflet中如何优雅的解决百度、高德地图的偏移问题
Based on three JS offshore wind power digital twin 3D effect
SAP QM qp03 displays an inspection plan with multiple specs inspection features
TCP与UDP
dict和set的基本操作
[redis sentinel] failed listening on port 26379 (TCP) & sentinel mode no response problem solved
Design a MySQL table for message queue to store message data
随机推荐
Leetcode 2164. 对奇偶下标分别排序(可以,一次过)
〖Kubernetes指南⑤〗Label快速入门
2022年危險化學品經營單比特安全管理人員考試試題及在線模擬考試
Start blogging
NCF 的Dapr应用实例的运行
2202 - production de CV
Ast, really fragrant
Industry reshuffle, a large number of programmers are going to lose their jobs? How can we break the current workplace dilemma
How to publish OSM maps locally and customize the mapping
Operation of simulation test platform for G3 boiler water treatment test questions in 2022
Summary of the lowest level error types in PHP
Detr (detection with transformers) learning notes
Using baserecyclerviewadapterhelper to implement tree structure
[opencv learning] small ticket recognition based on perspective transformation and OCR recognition
支持Canvas的Leaflet.Path.DashFlow动态流向线
M_8:设计消息队列存储消息数据的 MySQL 表格
2022起重机械指挥上岗证题目模拟考试平台操作
利率降低导致债券价格上涨
如何利用华为云容灾解决方案替代灾备一体机
[redis sentinel] failed listening on port 26379 (TCP) & sentinel mode no response problem solved