Closed pdp7 closed 3 years ago
I believe the problem is that the opensbi submodule points to 7fdc458 which is the initial commit in main branch. but it should be on the HEAD of starfive branch: https://github.com/starfive-tech/sft-riscv-opensbi/commit/b4f8f7ca312804fd99bc3ebfa0644ea4b369c307
I tried to update the submodule but got error:
pdp7@x1:~/dev/starfive/freelight-u-sdk$ git submodule update --remote --merge
fatal: refusing to merge unrelated histories
Unable to merge 'b4f8f7ca312804fd99bc3ebfa0644ea4b369c307' in submodule path 'opensbi'
That commit is HEAD of starfive branch:
pdp7@x1:~/dev/starfive/freelight-u-sdk/opensbi$ git log b4f8f7ca312804fd99bc3ebfa0644ea4b369c307
commit b4f8f7ca312804fd99bc3ebfa0644ea4b369c307 (origin/starfive)
Author: Huan.Feng <huan.feng@starfivetech.com>
Date: Tue Feb 9 14:51:36 2021 +0800
change default memory size for opensbi
commit c94c243f55e2817643e14e87aaae3b6069345d45
Author: 封欢 <huan.feng@starfivetech.com>
Date: Tue Feb 9 11:41:26 2021 +0800
add vic7100 support
commit c4a0624c3cf59069e95dfe47ebffa38cd85bea6c
Author: 封欢 <huan.feng@starfivetech.com>
Date: Tue Feb 9 11:40:43 2021 +0800
initial opensbi use v0.9 release package from github.com/riscv/opensbi
pdp7@x1:~/dev/starfive/freelight-u-sdk/opensbi$
This seems to have solved the problem:
pdp7@x1:~/dev/starfive/freelight-u-sdk$ git submodule update --remote
Submodule path 'opensbi': checked out 'b4f8f7ca312804fd99bc3ebfa0644ea4b369c307'
pdp7@x1:~/dev/starfive/freelight-u-sdk/opensbi$ git log --oneline
b4f8f7ca3128 (HEAD, origin/starfive) change default memory size for opensbi
c94c243f55e2 add vic7100 support
c4a0624c3cf5 initial opensbi use v0.9 release package from github.com/riscv/opensbi
make completed succesfully:
pdp7@x1:~/dev/starfive/freelight-u-sdk$ ls -ltar work/
total 209260
drwxrwxr-x 10 pdp7 pdp7 4096 Apr 16 13:08 ..
drwxr-xr-x 16 pdp7 pdp7 4096 Apr 16 14:57 buildroot_initramfs_sysroot
drwxrwxr-x 7 pdp7 pdp7 4096 Apr 16 14:58 buildroot_initramfs
-rw-rw-r-- 1 pdp7 pdp7 0 Apr 16 14:58 .buildroot_initramfs_sysroot
-rw-rw-r-- 1 pdp7 pdp7 275994 Apr 16 14:58 initramfs.cpio.gz.d
drwxrwxr-x 17 pdp7 pdp7 4096 Apr 16 14:58 HiFive_U-Boot
drwxrwxr-x 20 pdp7 pdp7 4096 Apr 16 15:03 linux
-rwxrwxr-x 1 pdp7 pdp7 15558144 Apr 16 15:03 vmlinux.bin
-rw-rw-r-- 1 pdp7 pdp7 26653105 Apr 16 15:04 initramfs.cpio.gz
drwxrwxr-x 4 pdp7 pdp7 4096 Apr 18 13:32 opensbi
-rw-rw-r-- 1 pdp7 pdp7 42229814 Apr 18 13:32 image.fit
drwxrwxr-x 7 pdp7 pdp7 4096 Apr 18 13:32 .
-rw-rw-r-- 1 pdp7 pdp7 134888448 Apr 18 13:32 hifive-unleashed-vfat.part
here is the log:
<SNIP>
OBJCOPY platform/starfive/vic7100/firmware/fw_dynamic.bin
OBJCOPY platform/starfive/vic7100/firmware/fw_payload.bin
make[1]: Leaving directory '/home/pdp7/dev/starfive/freelight-u-sdk/opensbi'
/home/pdp7/dev/starfive/freelight-u-sdk/work/HiFive_U-Boot/tools/mkimage -f /home/pdp7/dev/starfive/freelight-u-sdk/conf/u74_nvdla-uboot-fit-image.its -A riscv -O linux -T flat_dt /home/pdp7/dev/starfive/freelight-u-sdk/work/image.fit
FIT description: U-boot FIT image for HiFive Nvdla
Created: Sun Apr 18 13:32:57 2021
Image 0 (vmlinux)
Description: vmlinux
Created: Sun Apr 18 13:32:57 2021
Type: Kernel Image
Compression: uncompressed
Data Size: 15558144 Bytes = 15193.50 KiB = 14.84 MiB
Architecture: RISC-V
OS: Linux
Load Address: 0x80200000
Entry Point: 0x80200000
Image 1 (ramdisk)
Description: buildroot initramfs
Created: Sun Apr 18 13:32:57 2021
Type: RAMDisk Image
Compression: uncompressed
Data Size: 26653105 Bytes = 26028.42 KiB = 25.42 MiB
Architecture: RISC-V
OS: Linux
Load Address: 0x86100000
Entry Point: unavailable
Hash algo: sha256
Hash value: c48da5cbe34ae1763de9815406d4aac09ee7c90ad749f34daa4402d5d215a4ce
Image 2 (fdt)
Description: unavailable
Created: Sun Apr 18 13:32:57 2021
Type: Flat Device Tree
Compression: uncompressed
Data Size: 16615 Bytes = 16.23 KiB = 0.02 MiB
Architecture: RISC-V
Load Address: 0x86000000
Hash algo: sha256
Hash value: 053878cf119adeece6fefb74f210948905a48cab9ab9da278d9bff3fdd045f33
Default Configuration: 'config-1'
Configuration 0 (config-1)
Description: HiFive Nvdla with opensbi
Kernel: vmlinux
FDT: fdt
Loadables: ramdisk
inFile: /home/pdp7/dev/starfive/freelight-u-sdk/work/opensbi/platform/starfive/vic7100/firmware/fw_payload.bin
inSize: 641336 (0x0009c938, LE:0x38c90900)
outFile: /home/pdp7/dev/starfive/freelight-u-sdk/work/opensbi/platform/starfive/vic7100/firmware/fw_payload.bin.out
outSize: 641340 (0x0009c93c)
dd if=/dev/zero of=/home/pdp7/dev/starfive/freelight-u-sdk/work/hifive-unleashed-vfat.part bs=512 count=263454
263454+0 records in
263454+0 records out
134888448 bytes (135 MB, 129 MiB) copied, 0.271447 s, 497 MB/s
/sbin/mkfs.vfat /home/pdp7/dev/starfive/freelight-u-sdk/work/hifive-unleashed-vfat.part
mkfs.fat 4.1 (2017-01-24)
PATH=/home/pdp7/dev/starfive/freelight-u-sdk/work/buildroot_initramfs/host/bin:/home/pdp7/dev/fpga/symbiotic/symbiotic-20200324A/bin:/home/pdp7/.cargo/bin:/home/pdp7/.local/bin:/home/pdp7/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/pdp7/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin:/home/pdp7/dev/fpga/ecp5-toolchain/ecp5-toolchain-linux_x86_64-v1.6.9/bin MTOOLS_SKIP_CHECK=1 mcopy -i /home/pdp7/dev/starfive/freelight-u-sdk/work/hifive-unleashed-vfat.part /home/pdp7/dev/starfive/freelight-u-sdk/work/image.fit ::hifiveu.fit
PATH=/home/pdp7/dev/starfive/freelight-u-sdk/work/buildroot_initramfs/host/bin:/home/pdp7/dev/fpga/symbiotic/symbiotic-20200324A/bin:/home/pdp7/.cargo/bin:/home/pdp7/.local/bin:/home/pdp7/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/pdp7/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin:/home/pdp7/dev/fpga/ecp5-toolchain/ecp5-toolchain-linux_x86_64-v1.6.9/bin MTOOLS_SKIP_CHECK=1 mcopy -i /home/pdp7/dev/starfive/freelight-u-sdk/work/hifive-unleashed-vfat.part /home/pdp7/dev/starfive/freelight-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
The contents of work:
There is nothing in work/opensbi:
It looks like opensbi is not on the correct branch:
That commit is the HEAD of main: