From ccee81c650cb10c96bb61d67b83d2ecd031e38f5 Mon Sep 17 00:00:00 2001 From: Pierre-Philipp Braun Date: Tue, 31 Dec 2024 10:02:49 +0300 Subject: [PATCH 1/4] use updated device tree, avoid oom workaround `fatal error: th1520-lichee-cluster-4a-16g.dts: No such file or directory` --- .../elastic-metal-rv1-guidelines.mdx | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/bare-metal/elastic-metal/reference-content/elastic-metal-rv1-guidelines.mdx b/bare-metal/elastic-metal/reference-content/elastic-metal-rv1-guidelines.mdx index 997dbc098d..4987551827 100644 --- a/bare-metal/elastic-metal/reference-content/elastic-metal-rv1-guidelines.mdx +++ b/bare-metal/elastic-metal/reference-content/elastic-metal-rv1-guidelines.mdx @@ -72,35 +72,43 @@ Linux kernel. cd linux/ make revyos_defconfig # This can take several hours. - make -j + make -j4 sudo make modules_install cd .. ``` 5. Build OpenSBI. ```bash cd opensbi/ - make PLATFORM=generic -j + make PLATFORM=generic -j4 cd .. ``` 6. Build and install the FIT image. ```bash cd em-rv1/fit/ + # Fix path to board device tree + ls -lF ../../linux/arch/riscv/boot/dts/thead/th1520-lichee-pi-4a-16g.dts + vi em-rv1-c4m16s128-a.dts + + #include "th1520-lichee-pi-4a-16g.dts" + # Build the device tree cpp \ -nostdinc \ - -I ../linux/arch/riscv/boot/dts/thead/ \ - -I ../linux/include/ \ + -I ../../linux/arch/riscv/boot/dts/thead/ \ + -I ../../linux/include/ \ -undef \ -x assembler-with-cpp \ em-rv1-c4m16s128-a.dts \ | dtc -o em-rv1-c4m16s128-a.dtb - # Build the FIT image + # Build the FIT image and check sudo mv /boot/boot.itb /boot/boot.itb.bak sudo mkimage -f em-rv1-c4m16s128-a-boot.its /boot/boot.itb + sha256sum ../../linux/arch/riscv/boot/Image + sudo mkimage -l /boot/boot.itb - cd - + cd ../.. ``` 7. Reboot the server to load the new kernel. From c73aa6e5aff36576b0ba204284a8cfc152eadc10 Mon Sep 17 00:00:00 2001 From: "elge@alpha15" Date: Tue, 31 Dec 2024 09:59:01 +0300 Subject: [PATCH 2/4] fix(riscv): minimize the changes --- .../reference-content/elastic-metal-rv1-guidelines.mdx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/bare-metal/elastic-metal/reference-content/elastic-metal-rv1-guidelines.mdx b/bare-metal/elastic-metal/reference-content/elastic-metal-rv1-guidelines.mdx index 4987551827..f42d8cfc62 100644 --- a/bare-metal/elastic-metal/reference-content/elastic-metal-rv1-guidelines.mdx +++ b/bare-metal/elastic-metal/reference-content/elastic-metal-rv1-guidelines.mdx @@ -102,11 +102,9 @@ Linux kernel. em-rv1-c4m16s128-a.dts \ | dtc -o em-rv1-c4m16s128-a.dtb - # Build the FIT image and check + # Build the FIT image sudo mv /boot/boot.itb /boot/boot.itb.bak sudo mkimage -f em-rv1-c4m16s128-a-boot.its /boot/boot.itb - sha256sum ../../linux/arch/riscv/boot/Image - sudo mkimage -l /boot/boot.itb cd ../.. ``` From f2ac64593c5d562b6886ca74feb2e911ba4d68c4 Mon Sep 17 00:00:00 2001 From: "elge@alpha15" Date: Wed, 1 Jan 2025 07:52:48 +0300 Subject: [PATCH 3/4] fix(risc): check for device tree --- .../elastic-metal-rv1-guidelines.mdx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/bare-metal/elastic-metal/reference-content/elastic-metal-rv1-guidelines.mdx b/bare-metal/elastic-metal/reference-content/elastic-metal-rv1-guidelines.mdx index f42d8cfc62..56b9272467 100644 --- a/bare-metal/elastic-metal/reference-content/elastic-metal-rv1-guidelines.mdx +++ b/bare-metal/elastic-metal/reference-content/elastic-metal-rv1-guidelines.mdx @@ -70,6 +70,13 @@ Linux kernel. 4. Build the Linux kernel. ```bash cd linux/ + + # Make sure the device required device tree is available in the default branch + ls -lhF arch/riscv/boot/dts/thead/th1520-lichee-cluster-4a-16g.dts + # Otherwise switch to another branch that has it + #git branch -a + #git switch ... + make revyos_defconfig # This can take several hours. make -j4 @@ -86,12 +93,6 @@ Linux kernel. ```bash cd em-rv1/fit/ - # Fix path to board device tree - ls -lF ../../linux/arch/riscv/boot/dts/thead/th1520-lichee-pi-4a-16g.dts - vi em-rv1-c4m16s128-a.dts - - #include "th1520-lichee-pi-4a-16g.dts" - # Build the device tree cpp \ -nostdinc \ From 7bbe9309e3f408ce18d1b1e22dfcda830b830c33 Mon Sep 17 00:00:00 2001 From: "elge@alpha15" Date: Wed, 1 Jan 2025 08:38:06 +0300 Subject: [PATCH 4/4] fix(risc): remove repetition --- .../reference-content/elastic-metal-rv1-guidelines.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bare-metal/elastic-metal/reference-content/elastic-metal-rv1-guidelines.mdx b/bare-metal/elastic-metal/reference-content/elastic-metal-rv1-guidelines.mdx index 56b9272467..05d8f5367a 100644 --- a/bare-metal/elastic-metal/reference-content/elastic-metal-rv1-guidelines.mdx +++ b/bare-metal/elastic-metal/reference-content/elastic-metal-rv1-guidelines.mdx @@ -71,7 +71,7 @@ Linux kernel. ```bash cd linux/ - # Make sure the device required device tree is available in the default branch + # Make sure the required device tree is available in the default branch ls -lhF arch/riscv/boot/dts/thead/th1520-lichee-cluster-4a-16g.dts # Otherwise switch to another branch that has it #git branch -a