Skip to contentSkip to conversation

rockchip: rk3568: Include all addressable DRAM in memory map

PATCH In review Jonas Karlman 3 participants 4 messages Mar 9 – Mar 13

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rockchip: rk3568: Include all addressable DRAM in memory map

Rockchip RK356x supports up to 8 GiB DRAM, however U-Boot only includes the initial 32-bit 0-4 GiB addressable range in its memory map, something that matches gd->ram_top and current expected memory available for use in U-Boot.

The vendor DRAM init blobs add following ddr_mem rk atags [1]:

4 GiB: [0x0, 0xf0000000) and [0x1f0000000, 0x200000000) 8 GiB: [0x0, 0x200000000)

Add the remaining 64-bit 4-8 GiB addressable range, that already is reported to OS, to the U-Boot memory map to more correctly describe all available and addressable DRAM of RK356x. While at it also add the missing UL suffix to the PCIe address range for consistency.

[1] https://gist.github.com/Kwiboo/6d983693c79365b43c330eb3191cbace

---
Changes in v2:
- Update commit message
- Collect a-b tag

---
 arch/arm/mach-rockchip/rk3568/rk3568.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
arch/arm/mach-rockchip/rk3568/rk3568.c +9 -3
index c2b96902d2dd..2b1eafee37c9 100644
@@ -72,9 +72,15 @@ static struct mm_region rk3568_mem_map[] = {
 			 PTE_BLOCK_NON_SHARE |
 			 PTE_BLOCK_PXN | PTE_BLOCK_UXN
 	}, {
-		.virt = 0x300000000,
-		.phys = 0x300000000,
-		.size = 0x0c0c00000,
+		.virt = 0x100000000UL,
+		.phys = 0x100000000UL,
+		.size = 0x100000000UL,
+		.attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) |
+			 PTE_BLOCK_INNER_SHARE
+	}, {
+		.virt = 0x300000000UL,
+		.phys = 0x300000000UL,
+		.size = 0x0c0c00000UL,
 		.attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
 			 PTE_BLOCK_NON_SHARE |
 			 PTE_BLOCK_PXN | PTE_BLOCK_UXN
Signature · 1 line
2.53.0
#1 lore raw

Hi,

This was intended to be sent as a v2, should I re-send?

Regards,
Jonas

Quoted 50 lines · Jonas Karlman

Rockchip RK356x supports up to 8 GiB DRAM, however U-Boot only includes the initial 32-bit 0-4 GiB addressable range in its memory map, something that matches gd->ram_top and current expected memory available for use in U-Boot.

The vendor DRAM init blobs add following ddr_mem rk atags [1]:

4 GiB: [0x0, 0xf0000000) and [0x1f0000000, 0x200000000) 8 GiB: [0x0, 0x200000000)

Add the remaining 64-bit 4-8 GiB addressable range, that already is reported to OS, to the U-Boot memory map to more correctly describe all available and addressable DRAM of RK356x. While at it also add the missing UL suffix to the PCIe address range for consistency.

[1] https://gist.github.com/Kwiboo/6d983693c79365b43c330eb3191cbace

---
Changes in v2:
- Update commit message
- Collect a-b tag

---
 arch/arm/mach-rockchip/rk3568/rk3568.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
arch/arm/mach-rockchip/rk3568/rk3568.c +9 -3
index c2b96902d2dd..2b1eafee37c9 100644
@@ -72,9 +72,15 @@ static struct mm_region rk3568_mem_map[] = {
 			 PTE_BLOCK_NON_SHARE |
 			 PTE_BLOCK_PXN | PTE_BLOCK_UXN
 	}, {
-		.virt = 0x300000000,
-		.phys = 0x300000000,
-		.size = 0x0c0c00000,
+		.virt = 0x100000000UL,
+		.phys = 0x100000000UL,
+		.size = 0x100000000UL,
+		.attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) |
+			 PTE_BLOCK_INNER_SHARE
+	}, {
+		.virt = 0x300000000UL,
+		.phys = 0x300000000UL,
+		.size = 0x0c0c00000UL,
 		.attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
 			 PTE_BLOCK_NON_SHARE |
 			 PTE_BLOCK_PXN | PTE_BLOCK_UXN
Reviewed-by on v1 1/1
#2 lore raw
In reply to Jonas Karlman
Quoted 15 lines · Jonas Karlman

Rockchip RK356x supports up to 8 GiB DRAM, however U-Boot only includes the initial 32-bit 0-4 GiB addressable range in its memory map, something that matches gd->ram_top and current expected memory available for use in U-Boot.

The vendor DRAM init blobs add following ddr_mem rk atags [1]:

   4 GiB: [0x0, 0xf0000000) and [0x1f0000000, 0x200000000)
   8 GiB: [0x0, 0x200000000)

Add the remaining 64-bit 4-8 GiB addressable range, that already is reported to OS, to the U-Boot memory map to more correctly describe all available and addressable DRAM of RK356x. While at it also add the missing UL suffix to the PCIe address range for consistency.

Quoted 4 lines

[1] https://gist.github.com/Kwiboo/6d983693c79365b43c330eb3191cbace

Thanks,
- Kever

Quoted 31 lines

---
Changes in v2:
- Update commit message
- Collect a-b tag

---
  arch/arm/mach-rockchip/rk3568/rk3568.c | 12 +++++++++---
  1 file changed, 9 insertions(+), 3 deletions(-)
arch/arm/mach-rockchip/rk3568/rk3568.c +9 -3
index c2b96902d2dd..2b1eafee37c9 100644
@@ -72,9 +72,15 @@ static struct mm_region rk3568_mem_map[] = {
  			 PTE_BLOCK_NON_SHARE |
  			 PTE_BLOCK_PXN | PTE_BLOCK_UXN
  	}, {
-		.virt = 0x300000000,
-		.phys = 0x300000000,
-		.size = 0x0c0c00000,
+		.virt = 0x100000000UL,
+		.phys = 0x100000000UL,
+		.size = 0x100000000UL,
+		.attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) |
+			 PTE_BLOCK_INNER_SHARE
+	}, {
+		.virt = 0x300000000UL,
+		.phys = 0x300000000UL,
+		.size = 0x0c0c00000UL,
  		.attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
  			 PTE_BLOCK_NON_SHARE |
  			 PTE_BLOCK_PXN | PTE_BLOCK_UXN
#3 lore raw
In reply to Jonas Karlman
Quoted 8 lines · Jonas Karlman

Rockchip RK356x supports up to 8 GiB DRAM, however U-Boot only includes the initial 32-bit 0-4 GiB addressable range in its memory map, something that matches gd->ram_top and current expected memory available for use in U-Boot.

The vendor DRAM init blobs add following ddr_mem rk atags [1]:

[...]

Applied to u-boot/next, thanks!

[1/1] rockchip: rk3568: Include all addressable DRAM in memory map

      commit: fab3b667b4128fae2d94752bb03088f84dafcf89
Signature · 1 line
Tom