当前位置:网站首页>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
.reptand.endrIt's a pair of features0x100It's ten years ago 256, So the cycle 256 Time , Then this paragraph is 256MBFL_SECTION_ENTRYBefore macro 20 Bit sets the base address- In the loop body ,
__baseFor the initial 0, Then add 1 Enter againFL_SECTION_ENTRY, Reason by analogy . .rept 0x100Can 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 .
边栏推荐
- Chapter 8 - shared model JUC
- House raiding 2
- VS2015 DLIB 1916 USER_ ERROR__ inconsistent_ build_ configuration__ see_ dlib_ faq_ 1 USER_ ERROR__ inconsiste
- [issue 30] shopee golang development experience
- Abstract methods and abstract classes
- C # graphic tutorial (Fourth Edition) chapter7-7.6.1 virtual and override
- Face detection: mtcnn
- How leaflet gracefully displays the bubble window of overlapping points
- Using baserecyclerviewadapterhelper to implement tree structure
- Operation of simulation test platform for G3 boiler water treatment test questions in 2022
猜你喜欢

Enterprise wechat H5_ Authentication, H5 application web page authorization login to obtain identity

Dry goods sharing | BitSet application details

你真的会用PostGIS中的buffer缓冲吗?

Test platform series (97) perfect the case part
![[North Asia data recovery] data recovery cases in which the partitions disappear and the partitions are inaccessible after the server reinstalls the system](/img/a9/7726139037860a5f880667cec4b6c2.jpg)
[North Asia data recovery] data recovery cases in which the partitions disappear and the partitions are inaccessible after the server reinstalls the system

Running of NCF dapr application instance

H5時代leaflet中還在用DivIcon?

如何实现OSM地图本地发布并自定义配图

VS2015 DLIB 1916 USER_ ERROR__ inconsistent_ build_ configuration__ see_ dlib_ faq_ 1 USER_ ERROR__ inconsiste
![[leetcode] understanding and usage of map[key]+](/img/f5/9718f1020bddf913c09592697eb903.jpg)
[leetcode] understanding and usage of map[key]+
随机推荐
Actual combat | inductance element positioning -- detailed explanation of Halcon and opencv implementation (with source code)
M_ 8: Design a MySQL table for message queue to store message data
How leaflet gracefully displays the bubble window of overlapping points
Gradient accumulation in pytorch [during the experiment, due to the limitation of GPU video memory, the batch\u size can no longer be increased. To solve this problem, the gradient accumulation method
2022年危险化学品经营单位安全管理人员考试试题及在线模拟考试
Shardingsphere-proxy-5.0.0 deployment table implementation (I)
如何让矢量瓦片配图神器maputnik支持 geoserver
如何实现OSM地图本地发布并自定义配图
Zhengzhou University of light industry -- development and sharing of harmonyos pet health system
Leetcode 2200. Find all k nearest neighbor subscripts in the array (yes, one pass)
SAP 业务技术平台(BTP) Workflow(工作流)功能介绍
基于Three.js海上风电数字孪生三维效果
Cherry Blossom powder Dudu
2022 R2 mobile pressure vessel filling test questions and online simulation test
自动获取结构体内部成员变量的位置偏移
〖Kubernetes指南④〗Pod快速入门
启牛帮开通的股票账户是安全可信的吗?
PostgreSQL 中文社区黑龙江分会和辽宁分会成立啦!
同花顺开证券账户怎么样?到底安不安全呢
MySQL row to column, column to row, multiple columns to one row, one row to multiple columns