当前位置:网站首页>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 .
边栏推荐
- Test platform series (97) perfect the case part
- Introduction to message oriented middleware (message queue)
- Alien skin exposure X7 color filter plug-in, raw post-processing tool
- Explanation and practice of implicit transformation and implicit parameters in Scala
- [issue 30] shopee golang development experience
- TCP与UDP
- Basic operations of dict and set
- Leetcode 2164. Sort odd and even subscripts separately (yes, once)
- OSM map local publishing - how to generate vector maps of provinces and cities
- How to get Matplotlib figure size
猜你喜欢
The programmer has worked for 7 years. At the age of 31, he has no choice but to deliver takeout. I really don't want you to go through his journey again
[redis sentinel] failed listening on port 26379 (TCP) & sentinel mode no response problem solved
Opencv source code compilation
[literature translation - Part] revealing the structure of clinical EEG signals by self supervised learning (SSL and RP principles / data / preprocessing)
基于Three.js海上风电数字孪生三维效果
leaflet如何优雅的展示重叠点位的气泡窗口
支持Canvas的Leaflet.Path.DashFlow动态流向线
Record 5 - the serial port of stm32f411ceu6 realizes the sending and receiving of fixed length data and variable length data
leaflet如何加载10万条数据
Theory + practice will help you master the dynamic programming method
随机推荐
Pytorch common parameter initialization methods: [uniform distribution, normal (Gaussian) distribution, Xavier, Kaiming, orthogonal matrix, sparse matrix, constant, identity matrix, zero filling]
leaflet中如何优雅的解决百度、高德地图的偏移问题
[kubernetes guide ⑤] label quick start
Hongmeng starts
2022年危险化学品经营单位安全管理人员考试试题及在线模拟考试
Design MySQL table structure for message queue to store information data
SAP QM qp03 displays an inspection plan with multiple specs inspection features
[Yugong series] wechat applet in February 2022 - Reference
[kubernetes guide ④] pod quick start
Introduction to message oriented middleware (message queue)
Divicon est toujours utilisé dans le leaflet de l'ère H5?
[opencv learning] use the Tesseract OCR movement to recognize numbers
Don't write about the full screen explosion, try the decorator mode, this is the elegant way!!
Summary of individual NLP internship experience
华为云会议初体验【华为云至简致远】
Start blogging
So, what is the difference between e.target and e.currenttarget?
Actual combat | inductance element positioning -- detailed explanation of Halcon and opencv implementation (with source code)
Automatically obtain the position offset of member variables inside the structure
Initial experience of Huawei cloud Conference [Huawei cloud to jianzhiyuan]