Skip to contentSkip to conversation

riscv: sifive: unmatched: Adjust for big ramdisk image

PATCH In review Bin Meng 2 participants 6 messages May 24, 2022 – May 26, 2022

Subsystems (2)
lore
Share & tools
lore

Bin Meng

author
#0 lore raw

PATCH 1/3 riscv: sifive: unmatched: Adjust for big ramdisk image

Move kernel_comp_addr_r to an address that comes before the ramdisk image, since the decompressed kernel size is known to us. This way we can allow big ramdisk image to be loaded.

---

 include/configs/sifive-unmatched.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
include/configs/sifive-unmatched.h +5 -5
index 087764666b..fa734a66be 100644
@@ -56,12 +56,12 @@
 
 #define CONFIG_EXTRA_ENV_SETTINGS \
 	"kernel_addr_r=0x84000000\0" \
-	"fdt_addr_r=0x88000000\0" \
-	"scriptaddr=0x88100000\0" \
-	"pxefile_addr_r=0x88200000\0" \
-	"ramdisk_addr_r=0x88300000\0" \
-	"kernel_comp_addr_r=0x90000000\0" \
+	"kernel_comp_addr_r=0x88000000\0" \
 	"kernel_comp_size=0x4000000\0" \
+	"fdt_addr_r=0x8c000000\0" \
+	"scriptaddr=0x8c100000\0" \
+	"pxefile_addr_r=0x8c200000\0" \
+	"ramdisk_addr_r=0x8c300000\0" \
 	"type_guid_gpt_loader1=" TYPE_GUID_LOADER1 "\0" \
 	"type_guid_gpt_loader2=" TYPE_GUID_LOADER2 "\0" \
 	"type_guid_gpt_system=" TYPE_GUID_SYSTEM "\0" \
Signature · 1 line
2.34.1
author
#1 lore raw

PATCH 2/3 riscv: sifive: unleashed: Set kernel_comp_addr_r for compressed kernel

Set kernel_comp_addr_r and kernel_comp_size for compressed kernel. Adjust existing addresses for ramdisk, so that kernel_comp_addr_r comes before the ramdisk image, since the decompressed kernel size is known to us. This way we can allow big ramdisk image to be loaded.

Update unleashed.rst to remove the manual environment configuration for compressed kernel boot.

---

 doc/board/sifive/unleashed.rst     |  2 --
 include/configs/sifive-unleashed.h | 10 ++++++----
 2 files changed, 6 insertions(+), 6 deletions(-)
doc/board/sifive/unleashed.rst +0 -2
index c8a62068a7..ce38b701d7 100644
@@ -216,8 +216,6 @@ Or if you want to use a compressed kernel image file such as Image.gz
             1.2 MiB/s
    done
    Bytes transferred = 4809458 (4962f2 hex)
-   =>setenv kernel_comp_addr_r 0x90000000
-   =>setenv kernel_comp_size 0x500000
 
 By this time, correct kernel image is loaded and required environment variables
 are set. You can proceed to load the ramdisk and device tree from the tftp server
include/configs/sifive-unleashed.h +6 -4
index 920f3140f6..96e2eb6798 100644
@@ -61,12 +61,14 @@
 	"fdt_high=0xffffffffffffffff\0" \
 	"initrd_high=0xffffffffffffffff\0" \
 	"kernel_addr_r=0x84000000\0" \
-	"fdt_addr_r=0x88000000\0" \
-	"scriptaddr=0x88100000\0" \
+	"kernel_comp_addr_r=0x88000000\0" \
+	"kernel_comp_size=0x4000000\0" \
+	"fdt_addr_r=0x8c000000\0" \
+	"scriptaddr=0x8c100000\0" \
 	"script_offset_f=0x1fff000\0" \
 	"script_size_f=0x1000\0" \
-	"pxefile_addr_r=0x88200000\0" \
-	"ramdisk_addr_r=0x88300000\0" \
+	"pxefile_addr_r=0x8c200000\0" \
+	"ramdisk_addr_r=0x8c300000\0" \
 	"type_guid_gpt_loader1=" TYPE_GUID_LOADER1 "\0" \
 	"type_guid_gpt_loader2=" TYPE_GUID_LOADER2 "\0" \
 	"type_guid_gpt_system=" TYPE_GUID_SYSTEM "\0" \
Signature · 1 line
2.34.1
Reviewed-by on v1 2/3
#2 lore raw

Re: [PATCH 2/3] riscv: sifive: unleashed: Set kernel_comp_addr_r for compressed kernel

Quoted 8 lines · Bin Meng

Set kernel_comp_addr_r and kernel_comp_size for compressed kernel. Adjust existing addresses for ramdisk, so that kernel_comp_addr_r comes before the ramdisk image, since the decompressed kernel size is known to us. This way we can allow big ramdisk image to be loaded.

Update unleashed.rst to remove the manual environment configuration for compressed kernel boot.

Quoted 6 lines

---

 doc/board/sifive/unleashed.rst     |  2 --
 include/configs/sifive-unleashed.h | 10 ++++++----
 2 files changed, 6 insertions(+), 6 deletions(-)
author
#3 lore raw

PATCH 3/3 riscv: qemu: Set kernel_comp_addr_r for compressed kernel

In reply to Bin Meng

Set kernel_comp_addr_r and kernel_comp_size for compressed kernel. Adjust existing addresses for ramdisk, so that kernel_comp_addr_r comes before the ramdisk image, since the decompressed kernel size is known to us. This way we can allow big ramdisk image to be loaded.

---

 include/configs/qemu-riscv.h | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
include/configs/qemu-riscv.h +6 -4
index 618c3b63d4..f462895fb5 100644
@@ -54,10 +54,12 @@
 	"fdt_high=0xffffffffffffffff\0" \
 	"initrd_high=0xffffffffffffffff\0" \
 	"kernel_addr_r=0x84000000\0" \
-	"fdt_addr_r=0x88000000\0" \
-	"scriptaddr=0x88100000\0" \
-	"pxefile_addr_r=0x88200000\0" \
-	"ramdisk_addr_r=0x88300000\0" \
+	"kernel_comp_addr_r=0x88000000\0" \
+	"kernel_comp_size=0x4000000\0" \
+	"fdt_addr_r=0x8c000000\0" \
+	"scriptaddr=0x8c100000\0" \
+	"pxefile_addr_r=0x8c200000\0" \
+	"ramdisk_addr_r=0x8c300000\0" \
 	BOOTENV
 #endif
 
Signature · 1 line
2.34.1
Reviewed-by on v1 3/3
#4 lore raw

Re: [PATCH 3/3] riscv: qemu: Set kernel_comp_addr_r for compressed kernel

Quoted 11 lines · Bin Meng

Set kernel_comp_addr_r and kernel_comp_size for compressed kernel. Adjust existing addresses for ramdisk, so that kernel_comp_addr_r comes before the ramdisk image, since the decompressed kernel size is known to us. This way we can allow big ramdisk image to be loaded.

---

 include/configs/qemu-riscv.h | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)