Skip to content

Instantly share code, notes, and snippets.

@RobertCNelson
Last active March 4, 2021 20:51
Show Gist options
  • Select an option

  • Save RobertCNelson/ecaf167fc2f73ea8cfd9c5342fcde01c to your computer and use it in GitHub Desktop.

Select an option

Save RobertCNelson/ecaf167fc2f73ea8cfd9c5342fcde01c to your computer and use it in GitHub Desktop.
voodoo@debian-devbox:~/temp$ git clone [email protected]:starfive-tech/beagle_freedeom_u_sdk.git --depth=1
Cloning into 'beagle_freedeom_u_sdk'...
remote: Enumerating objects: 14410, done.
remote: Counting objects: 100% (14410/14410), done.
remote: Compressing objects: 100% (13333/13333), done.
remote: Total 14410 (delta 765), reused 14393 (delta 765), pack-reused 0
Receiving objects: 100% (14410/14410), 381.49 MiB | 36.48 MiB/s, done.
Resolving deltas: 100% (765/765), done.
voodoo@debian-devbox:~/temp$ cd ./beagle_freedeom_u_sdk
voodoo@debian-devbox:~/temp/beagle_freedeom_u_sdk$
voodoo@debian-devbox:~/temp/beagle_freedeom_u_sdk$ echo '[submodule "linux"]' >.gitmodules
voodoo@debian-devbox:~/temp/beagle_freedeom_u_sdk$ echo 'path = linux' >>.gitmodules
voodoo@debian-devbox:~/temp/beagle_freedeom_u_sdk$ echo 'url = ssh://[email protected]:2303/RobertCNelson/beagle_kernel_4.19.git' >>.gitmodules
voodoo@debian-devbox:~/temp/beagle_freedeom_u_sdk$ echo '[submodule "riscv-isa-sim"]' >>.gitmodules
voodoo@debian-devbox:~/temp/beagle_freedeom_u_sdk$ echo 'path = riscv-isa-sim' >>.gitmodules
voodoo@debian-devbox:~/temp/beagle_freedeom_u_sdk$ echo 'url = https://github.com/riscv/riscv-isa-sim.git' >>.gitmodules
voodoo@debian-devbox:~/temp/beagle_freedeom_u_sdk$ echo '[submodule "riscv-fesvr"]' >>.gitmodules
voodoo@debian-devbox:~/temp/beagle_freedeom_u_sdk$ echo 'path = riscv-fesvr' >>.gitmodules
voodoo@debian-devbox:~/temp/beagle_freedeom_u_sdk$ echo 'url = https://github.com/riscv/riscv-fesvr.git' >>.gitmodules
voodoo@debian-devbox:~/temp/beagle_freedeom_u_sdk$ echo '[submodule "HiFive_U-Boot"]' >>.gitmodules
voodoo@debian-devbox:~/temp/beagle_freedeom_u_sdk$ echo 'path = HiFive_U-Boot' >>.gitmodules
voodoo@debian-devbox:~/temp/beagle_freedeom_u_sdk$ echo 'url = ssh://[email protected]:2303/RobertCNelson/beagle_u_boot.git' >>.gitmodules
sed -i -e 's:BR2_KERNEL_HEADERS_CUSTOM_REPO_URL:#BR2_KERNEL_HEADERS_CUSTOM_REPO_URL:g' conf/buildroot_initramfs_config
echo "BR2_KERNEL_HEADERS_CUSTOM_REPO_URL=\"ssh://[email protected]:2303/RobertCNelson/beagle_kernel_4.19.git\"" >> conf/buildroot_initramfs_config
voodoo@debian-devbox:~/temp/beagle_freedeom_u_sdk$ git diff
diff --git a/.gitmodules b/.gitmodules
index b628425..a507d3c 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,12 +1,12 @@
[submodule "linux"]
- path = linux
- url = https://github.com/starfive-tech/beagle_kernel_4.19.git
+path = linux
+url = ssh://[email protected]:2303/RobertCNelson/beagle_kernel_4.19.git
[submodule "riscv-isa-sim"]
- path = riscv-isa-sim
- url = https://github.com/riscv/riscv-isa-sim.git
+path = riscv-isa-sim
+url = https://github.com/riscv/riscv-isa-sim.git
[submodule "riscv-fesvr"]
- path = riscv-fesvr
- url = https://github.com/riscv/riscv-fesvr.git
+path = riscv-fesvr
+url = https://github.com/riscv/riscv-fesvr.git
[submodule "HiFive_U-Boot"]
- path = HiFive_U-Boot
- url = https://github.com/starfive-tech/beagle_U_Boot.git
+path = HiFive_U-Boot
+url = ssh://[email protected]:2303/RobertCNelson/beagle_u_boot.git
diff --git a/conf/buildroot_initramfs_config b/conf/buildroot_initramfs_config
index 18a524b..2b7ace0 100755
--- a/conf/buildroot_initramfs_config
+++ b/conf/buildroot_initramfs_config
@@ -1,7 +1,7 @@
BR2_riscv=y
BR2_RISCV_ABI_LP64D=y
BR2_KERNEL_HEADERS_CUSTOM_GIT=y
-BR2_KERNEL_HEADERS_CUSTOM_REPO_URL="https://github.com/starfive-tech/beagle_kernel_4.19.git"
+#BR2_KERNEL_HEADERS_CUSTOM_REPO_URL="https://github.com/starfive-tech/beagle_kernel_4.19.git"
BR2_KERNEL_HEADERS_CUSTOM_REPO_VERSION="starfive"
BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_19=y
BR2_GCC_VERSION_8_X=y
@@ -81,3 +81,4 @@ BR2_PACKAGE_HOST_GENIMAGE=y
BR2_PACKAGE_HOST_GPTFDISK=y
BR2_PACKAGE_HOST_MTOOLS=y
BR2_PACKAGE_HOST_SQUASHFS=y
+BR2_KERNEL_HEADERS_CUSTOM_REPO_URL="ssh://[email protected]:2303/RobertCNelson/beagle_kernel_4.19.git"
voodoo@debian-devbox:~/temp/beagle_freedeom_u_sdk$ git submodule sync
voodoo@debian-devbox:~/temp/beagle_freedeom_u_sdk$ git submodule update --recursive --init
Submodule 'HiFive_U-Boot' (ssh://[email protected]:2303/RobertCNelson/beagle_u_boot.git) registered for path 'HiFive_U-Boot'
Submodule 'linux' (ssh://[email protected]:2303/RobertCNelson/beagle_kernel_4.19.git) registered for path 'linux'
Cloning into '/home/voodoo/temp/beagle_freedeom_u_sdk/HiFive_U-Boot'...
Cloning into '/home/voodoo/temp/beagle_freedeom_u_sdk/linux'...
Submodule path 'HiFive_U-Boot': checked out '81bbb6244b021a659067ded8c3123df4d89b0c31'
Submodule path 'linux': checked out '1bdcc10aa30a67c92c32f5ade891bac6f94e7d08'
voodoo@debian-devbox:~/temp/beagle_freedeom_u_sdk$ make -j12
riscv64-buildroot-linux-gnu-ranlib libmachine.a
riscv64-buildroot-linux-gnu-gcc -Wl,--build-id=none -nostartfiles -nostdlib -static -o pk pk.o -L. -lpk -lmachine -lsoftfloat -lutil -lgcc -Wl,--defsym=MEM_START=0x80700000,-T,/home/voodoo/temp/beagle_freedeom_u_sdk/riscv-pk/pk/pk.lds
riscv64-buildroot-linux-gnu-gcc -Wl,--build-id=none -nostartfiles -nostdlib -static -o bbl bbl.o -L. -lbbl -ldummy_payload -lmachine -lsoftfloat -lutil -lgcc -Wl,--defsym=MEM_START=0x80700000,-T,/home/voodoo/temp/beagle_freedeom_u_sdk/riscv-pk/bbl/bbl.lds
make[1]: Leaving directory '/home/voodoo/temp/beagle_freedeom_u_sdk/work/riscv-pk'
PATH=/home/voodoo/temp/beagle_freedeom_u_sdk/work/buildroot_initramfs/host/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games riscv64-buildroot-linux-gnu-objcopy -S -O binary --change-addresses -0x80000000 /home/voodoo/temp/beagle_freedeom_u_sdk/work/riscv-pk/bbl /home/voodoo/temp/beagle_freedeom_u_sdk/work/bbl.bin
/home/voodoo/temp/beagle_freedeom_u_sdk/work/HiFive_U-Boot/tools/mkimage -f /home/voodoo/temp/beagle_freedeom_u_sdk/conf/u74_nvdla-uboot-fit-image.its -A riscv -O linux -T flat_dt /home/voodoo/temp/beagle_freedeom_u_sdk/work/image.fit
FIT description: U-boot FIT image for HiFive Nvdla
Created: Thu Mar 4 14:44:23 2021
Image 0 (bbl)
Description: BBL/SBI/riscv-pk
Created: Thu Mar 4 14:44:23 2021
Type: Kernel Image
Compression: uncompressed
Data Size: 15949180 Bytes = 15575.37 KiB = 15.21 MiB
Architecture: RISC-V
OS: Linux
Load Address: 0x80700000
Entry Point: 0x80700000
Hash algo: sha256
Hash value: f1137d2d4ff2b95c8db2158813b40f4fd0d7ea8897a2302f3a41198090d5a197
Image 1 (ramdisk)
Description: buildroot initramfs
Created: Thu Mar 4 14:44:23 2021
Type: RAMDisk Image
Compression: gzip compressed
Data Size: 14269774 Bytes = 13935.33 KiB = 13.61 MiB
Architecture: RISC-V
OS: Linux
Load Address: 0x86100000
Entry Point: unavailable
Hash algo: sha256
Hash value: 546abaa4e2bfc7ee0bc7d512c1d43b54840c91ed6c8dc71863f696298c82d134
Image 2 (fdt)
Description: unavailable
Created: Thu Mar 4 14:44:23 2021
Type: Flat Device Tree
Compression: uncompressed
Data Size: 21268 Bytes = 20.77 KiB = 0.02 MiB
Architecture: RISC-V
Load Address: 0x86000000
Hash algo: sha256
Hash value: 1a6b445c35055d1c6ef6a853a386d1202da7332ac0bba71d040648516b042a78
Default Configuration: 'config-1'
Configuration 0 (config-1)
Description: HiFive Nvdla with BBL
Kernel: bbl
FDT: fdt
Loadables: ramdisk
inFile: /home/voodoo/temp/beagle_freedeom_u_sdk/work/HiFive_U-Boot/u-boot.bin
inSize: 553228 (0x0008710c, LE:0x0c710800)
outFile: /home/voodoo/temp/beagle_freedeom_u_sdk/work/HiFive_U-Boot/u-boot.bin.out
outSize: 553232 (0x00087110)
dd if=/dev/zero of=/home/voodoo/temp/beagle_freedeom_u_sdk/work/hifive-unleashed-vfat.part bs=512 count=63454
63454+0 records in
63454+0 records out
32488448 bytes (32 MB, 31 MiB) copied, 0.061773 s, 526 MB/s
/sbin/mkfs.vfat /home/voodoo/temp/beagle_freedeom_u_sdk/work/hifive-unleashed-vfat.part
mkfs.fat 4.1 (2017-01-24)
PATH=/home/voodoo/temp/beagle_freedeom_u_sdk/work/buildroot_initramfs/host/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games MTOOLS_SKIP_CHECK=1 mcopy -i /home/voodoo/temp/beagle_freedeom_u_sdk/work/hifive-unleashed-vfat.part /home/voodoo/temp/beagle_freedeom_u_sdk/work/image.fit ::hifiveu.fit
PATH=/home/voodoo/temp/beagle_freedeom_u_sdk/work/buildroot_initramfs/host/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games MTOOLS_SKIP_CHECK=1 mcopy -i /home/voodoo/temp/beagle_freedeom_u_sdk/work/hifive-unleashed-vfat.part /home/voodoo/temp/beagle_freedeom_u_sdk/conf/u74_uEnv.txt ::u74_uEnv.txt
To completely erase, reformat, and program a disk sdX, run:
make DISK=/dev/sdX format-nvdla-disk
... you will need gdisk and e2fsprogs installed
Please note this will not currently format the SDcard ext4 partition
This can be done manually if needed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment