Skip to content

Instantly share code, notes, and snippets.

@pdp7
Created November 23, 2023 22:42
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save pdp7/f6d7f23a87981fa9edb2fc08ca72e408 to your computer and use it in GitHub Desktop.
xuantie-ubuntu.diff
diff --git a/02_build_opensbi.sh b/02_build_opensbi.sh
index 61896ed9a4ef..d2a5563d6f44 100755
--- a/02_build_opensbi.sh
+++ b/02_build_opensbi.sh
@@ -1,12 +1,12 @@
-#!/bin/bash
+#!/bin/bash -xe
CORES=$(getconf _NPROCESSORS_ONLN)
+CROSS="riscv64-linux-gnu-"
wdir=`pwd`
-make -C opensbi ARCH=riscv CROSS_COMPILE=${wdir}/riscv-toolchain/bin/riscv64-unknown-linux-gnu- PLATFORM=generic clean
-echo "make -C opensbi -j${CORES} ARCH=riscv CROSS_COMPILE=${wdir}/riscv-toolchain/bin/riscv64-unknown-linux-gnu- PLATFORM=generic"
-make -C opensbi -j${CORES} ARCH=riscv CROSS_COMPILE=${wdir}/riscv-toolchain/bin/riscv64-unknown-linux-gnu- PLATFORM=generic
+make -C opensbi ARCH=riscv CROSS_COMPILE=${CROSS} PLATFORM=generic clean
+make -C opensbi -j${CORES} ARCH=riscv CROSS_COMPILE=${CROSS} PLATFORM=generic
cp -v ./opensbi/build/platform/generic/firmware/fw_dynamic.bin ./deploy/
diff --git a/03_build_uboot.sh b/03_build_uboot.sh
index d4924d9a1fc8..d7f9d388237d 100755
--- a/03_build_uboot.sh
+++ b/03_build_uboot.sh
@@ -1,21 +1,20 @@
-#!/bin/bash
+#!/bin/bash -xe
CORES=$(getconf _NPROCESSORS_ONLN)
+CROSS="riscv64-linux-gnu-"
wdir=`pwd`
-make -C u-boot ARCH=riscv CROSS_COMPILE=${wdir}/riscv-toolchain/bin/riscv64-unknown-linux-gnu- distclean
+make -C u-boot ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu- distclean
-#make -C u-boot ARCH=riscv CROSS_COMPILE=${wdir}/riscv-toolchain/bin/riscv64-unknown-linux-gnu- light_beagle_defconfig
-#make -C u-boot ARCH=riscv CROSS_COMPILE=${wdir}/riscv-toolchain/bin/riscv64-unknown-linux-gnu- menuconfig
-#make -C u-boot ARCH=riscv CROSS_COMPILE=${wdir}/riscv-toolchain/bin/riscv64-unknown-linux-gnu- savedefconfig
+#make -C u-boot ARCH=riscv CROSS_COMPILE=${CROSS} light_beagle_defconfig
+#make -C u-boot ARCH=riscv CROSS_COMPILE=${CROSS} menuconfig
+#make -C u-boot ARCH=riscv CROSS_COMPILE=${CROSS} savedefconfig
#cp -v ./u-boot/defconfig ./u-boot/configs/light_beagle_defconfig
-#make -C u-boot ARCH=riscv CROSS_COMPILE=${wdir}/riscv-toolchain/bin/riscv64-unknown-linux-gnu- distclean
+#make -C u-boot ARCH=riscv CROSS_COMPILE=${CROSS} distclean
-echo "make -C u-boot ARCH=riscv CROSS_COMPILE=${wdir}/riscv-toolchain/bin/riscv64-unknown-linux-gnu- light_beagle_defconfig"
-make -C u-boot ARCH=riscv CROSS_COMPILE=${wdir}/riscv-toolchain/bin/riscv64-unknown-linux-gnu- light_beagle_defconfig
-echo "make -C u-boot -j${CORES} ARCH=riscv CROSS_COMPILE=${wdir}/riscv-toolchain/bin/riscv64-unknown-linux-gnu- all"
-make -C u-boot -j${CORES} ARCH=riscv CROSS_COMPILE=${wdir}/riscv-toolchain/bin/riscv64-unknown-linux-gnu- all
+make -C u-boot ARCH=riscv CROSS_COMPILE=${CROSS} light_beagle_defconfig
+make -C u-boot -j${CORES} ARCH=riscv CROSS_COMPILE=${CROSS} all
cp -v ./u-boot/u-boot-with-spl.bin ./deploy/
diff --git a/04_build_linux.sh b/04_build_linux.sh
index 3602cc7f689b..d0c75afdb478 100755
--- a/04_build_linux.sh
+++ b/04_build_linux.sh
@@ -22,20 +22,20 @@ cp -v ../BeagleBoard-DeviceTrees/include/dt-bindings/board/light-fm-bone-pins.h
cp -v ../BeagleBoard-DeviceTrees/include/dt-bindings/pinctrl/light.h ./include/dt-bindings/pinctrl/
cd ../BeagleBoard-DeviceTrees/
-make clean ; make
+echo make clean ; echo make
cd ../linux
-make ARCH=riscv CROSS_COMPILE=${CC} clean
+echo make ARCH=riscv CROSS_COMPILE=${CC} clean
if [ ! -f ./arch/riscv/configs/beaglev_defconfig ] ; then
cp -v ./arch/riscv/configs/light_defconfig ./arch/riscv/configs/beaglev_defconfig
fi
-make ARCH=riscv CROSS_COMPILE=${CC} beaglev_defconfig
+echo make ARCH=riscv CROSS_COMPILE=${CC} beaglev_defconfig
echo "make -j${CORES} ARCH=riscv CROSS_COMPILE=${CC} Image modules dtbs"
-make -j${CORES} ARCH=riscv CROSS_COMPILE=${CC} Image modules dtbs
+echo make -j${CORES} ARCH=riscv CROSS_COMPILE=${CC} Image modules dtbs
KERNEL_UTS=$(cat "${wdir}/linux/include/generated/utsrelease.h" | awk '{print $3}' | sed 's/\"//g' )
-make -s ARCH=riscv CROSS_COMPILE=${CC} modules_install INSTALL_MOD_PATH="${wdir}/deploy/tmp"
+echo make -s ARCH=riscv CROSS_COMPILE=${CC} modules_install INSTALL_MOD_PATH="${wdir}/deploy/tmp"
if [ -f "${wdir}/deploy/${KERNEL_UTS}-modules.tar.gz" ] ; then
rm -rf "${wdir}/deploy/${KERNEL_UTS}-modules.tar.gz" || true
diff --git a/06_generate_boot.sh b/06_generate_boot.sh
index f4aa90987b7d..fa38afe99c9f 100755
--- a/06_generate_boot.sh
+++ b/06_generate_boot.sh
@@ -16,6 +16,7 @@ if [ ! -f ./deploy/Image ] ; then
fi
cp -v ./deploy/Image ./ignore/.boot
cp -v ./deploy/light-beagle.dtb ./ignore/.boot
+cp -v ./deploy/th1520-lichee-pi-4a.dtb ./ignore/.boot
mkdir -p ./ignore/.boot/overlays/ || true
cp -v ./BeagleBoard-DeviceTrees/src/riscv/overlays/*.dtbo ./ignore/.boot/overlays/
@@ -23,7 +24,9 @@ cp -v ./BeagleBoard-DeviceTrees/src/riscv/overlays/*.dtbo ./ignore/.boot/overlay
mkdir -p ./ignore/.boot/extlinux/ || true
echo "label Linux eMMC" > ./ignore/.boot/extlinux/extlinux.conf
echo " kernel /Image" >> ./ignore/.boot/extlinux/extlinux.conf
-echo " append root=/dev/mmcblk0p3 ro rootfstype=ext4 rootwait console=ttyS0,115200 earlycon clk_ignore_unused net.ifnames=0" >> ./ignore/.boot/extlinux/extlinux.conf
+#echo " append root=/dev/mmcblk0p3 ro rootfstype=ext4 rootwait loglevel=8 console=ttyS0,115200 earlycon clk_ignore_unused net.ifnames=0 ftrace=function_graph ffftrace_dump_on_oops ftrace_filter=*sdhci*,*mmc*,*dma*,*dwc*,*blk* " >> ./ignore/.boot/extlinux/extlinux.conf
+#echo " append root=/dev/mmcblk0p3 ro rootfstype=ext4 rootwait loglevel=8 console=ttyS0,115200 earlycon clk_ignore_unused net.ifnames=0 ftrace=function_graph ffftrace_dump_on_oops ftrace_filter=*sdhci*,*mmc*,*dwc*,*thead*,*th1520*" >> ./ignore/.boot/extlinux/extlinux.conf
+echo " append root=/dev/mmcblk0p3 rootfstype=ext4 rootwait console=ttyS0,115200 loglevel=8 earlycon" >> ./ignore/.boot/extlinux/extlinux.conf
echo " fdtdir /" >> ./ignore/.boot/extlinux/extlinux.conf
echo " #fdtoverlays /overlays/<file>.dtbo" >> ./ignore/.boot/extlinux/extlinux.conf
@pdp7
Copy link
Author

pdp7 commented Nov 23, 2023

commit 7c2ff812334459ad2f8c5e308bf8ff59a6456334 (tag: 2023-07-05)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment