bootloader-riscv's Issues
the new edk2 firmware startup error
I download the new single maste firmware, copy SG2042.fd to be riscv64_Image, then burn it into my three sdcards, they all startup error in pioneer v1.3 with the same problem .
This is the log:
SOPHGO ZSBL
sg2042:v0.3
sg2042 work in single socket mode
chip0 ddr info: raw data=0x5050505,
ddr0 size:0x800000000
ddr1 size:0x800000000
ddr2 size:0x800000000
ddr3 size:0x800000000
SD initializing 100000000Hz (transfer frequency at 25000000Hz)
sd card init ok
open 0:riscv64/conf.ini failed
conf.ini should start with "[sophgo-config]"
have no conf.ini file
rv boot from sd card
SD initializing 100000000Hz (transfer frequency at 25000000Hz)
sd card init ok
0:riscv64/fw_dynamic.bin file size is 270032
0:riscv64/riscv64_Image file size is 8585216
0:riscv64/initrd.img file size is 15773284
0:riscv64/mango-milkv-pioneer.dtb file size is 44551
sd read file ok
chip0 ddr node in dtb:
base:0x0000000000, len:0xc0000000
base:0x0100000000, len:0x700000000
base:0x0800000000, len:0x800000000
base:0x1000000000, len:0x800000000
base:0x1800000000, len:0x800000000
use default mac address
main core sbi jump to 0x0, dynamic info:40019860
OpenSBI v1.2
Build time: 2024-05-14 02:32:42 +0000
Build compiler: gcc version 13.2.0 ()
/ __ \ / | _ _ |
| | | | __ ___ _ __ | ( | |) || |
| | | | '_ \ / _ \ '_ \ ___ | _ < | |
| || | |) | __/ | | |) | |) || |
_/| ./ _|| ||/|/___|
| |
|_|
Platform Name : Sophgo Mango
Platform Features : medeleg
Platform HART Count : 64
Platform IPI Device : aclint-mswi
Platform Timer Device : aclint-mtimer @ 50000000Hz
Platform Console Device : uart8250
Platform HSM Device : ---
Platform PMU Device :
Platform Reboot Device : mango-reset
Platform Shutdown Device : mango-reset
Platform Suspend Device : ---
Firmware Base : 0x0
Firmware Size : 1376 KB
Firmware RW Offset : 0x40000
Runtime SBI Version : 1.0
Domain0 Name : root
Domain0 Boot HART : 4
Domain0 HARTs : 0*,1*,2*,3*,4*,5*,6*,7*,8*,9*,10*,11*,12*,13*,14*,15*,16*,17*,18*,19*,20*,21*,22*,23*,24*,25*,26*,27*,28*,29*,30*,31*,32*,33*,34*,35*,36*,37*,38*,39*,40*,41*,42*,43*,44*,45*,46*,47*,48*,49*,50*,51*,52*,53*,54*,55*,56*,57*,58*,59*,60*,61*,62*,63*
Domain0 Region00 : 0x0000007094000000-0x0000007094003fff M: (I,R,W) S/U: ()
Domain0 Region01 : 0x0000000000000000-0x000000000003ffff M: (R,X) S/U: ()
Domain0 Region02 : 0x0000000000000000-0x00000000001fffff M: (R,W) S/U: ()
Domain0 Region03 : 0x00000070ac000000-0x00000070ac3fffff M: (I,R,W) S/U: ()
Domain0 Region04 : 0x0000000000000000-0xffffffffffffffff M: (R,W,X) S/U: (R,W,X)
Domain0 Next Address : 0x0000000002000000
Domain0 Next Arg1 : 0x000000004009fd90
Domain0 Next Mode : S-mode
Domain0 SysReset : yes
Domain0 SysSuspend : yes
Boot HART ID : 4
Boot HART Domain : root
Boot HART Priv Version : v1.11
Boot HART Base ISA : rv64imafdcvx
Boot HART ISA Extensions : time
Boot HART PMP Count : 8
Boot HART PMP Granularity : 2048
Boot HART PMP Address Bits: 38
Boot HART MHPM Count : 29
Boot HART MIDELEG : 0x0000000000020222
Boot HART MEDELEG : 0x000000000000b109
PROGRESS CODE: V03040003 I0
PROGRESS CODE: V03040002 I0
PROGRESS CODE: V03040003 I0
PROGRESS CODE: V03040002 I0
PROGRESS CODE: V03040003 I0
PROGRESS CODE: V03040002 I0
!!!! RISCV64 Exception Type - 000000000000000D(EXCEPT_RISCV_LOAD_ACCESS_PAGE_FAULT) !!!!
t0 = 0x000000000048FFB78 t1 = 0x000000000048FFB80
t2 = 0x00000000000002000 t3 = 0x00000000000000000
t4 = 0x00000000000000000 t5 = 0x00000000000000000
t6 = 0x00000000000000000 s0 = 0x000000000048FFA60
s1 = 0x00000000000000000 s2 = 0x00000000000000000
s3 = 0x00000000000000000 s4 = 0x00000000000000000
s5 = 0x00000000000000000 s6 = 0x00000000000000004
s7 = 0x00000000000000040 s8 = 0x00000000000004000
s9 = 0x0000000000004EAC8 s10 = 0x00000000000000000
s11 = 0x00000000000000000 a0 = 0x000000000BF56C128
a1 = 0x000000000BF56C0A8 a2 = 0x000000000BF56C0A0
a3 = 0x000000000BF56C108 a4 = 0x00000000000000001
a5 = 0x01417B715610EE55F a6 = 0x000000000BFED1790
a7 = 0x00000000000000010 zero = 0x00000000000000000
ra = 0x000000000BFDD3304 sp = 0x00000000000000000
gp = 0x00000000000000000 tp = 0x00000000000146000
sepc = 0x000000000BFDD22BC sstatus = 0x08000000200006120
stval = 0x000000015610EE55F
use efibootmgr set boot order, but not save after reboot
I use Action#550 single master firmware, copy SG2042.fd to be riscv64_Image, then burn it into sdcard or mtd, i run fs0:\EFI\openeuler\grubriscv64.efi in UEFI SHELL to startup grub, i run
efibootmgr -c -d /dev/nvme0n1 -p 1 -w -L 'openEuler' -l '\EFI\openEuler\grubriscv64.efi' to set boot order,
but it not save efibootmgr set when i reboot pioneer v1.3
Missing GPL source for fip.bin
It seems that fip.bin contains different pieces of software with different licenses:
- ARM Trusted Firmware (BSD-3-Clause license)
- U-Boot 2022.10 (GPL v2 license)
The Gnu Public License of U-Boot requires providing the source code of derived works. fp.bin is such a derived work.
The BSD 3 license of ARM Trusted Firmware allows binary only distribution.
To comply with the U-Boot license, please, consider either providing all code to create fp.bin or separating the two software pieces and providing the U-Boot in source form and TF-A in binary form.
Publishing your U-Boot source will provide a starting point for adding Sophgo specific parts to the mainline U-Boot and thereby to ensure long term support.
Bootloader removes custom console bootargs
I have the milkv pioneer board and installed nixos on it. The contents of my /boot/extlinux/extlinux.conf
includes bootargs for outputting on ttyS0
APPEND init=/nix/store/3xsvpmg37mcky27my30nvxsjh98c0xwc-nixos-system-mvp-24.05.20240203.c8d11da/init earlycon console=ttyS0,115200 debug nvme_core.io_timeout=600 nvme_core.admin_timeout=600 cma=512M swiotlb=65536
however, when checking /proc/cmdline
after booting
init=/nix/store/3xsvpmg37mcky27my30nvxsjh98c0xwc-nixos-system-mvp-24.05.20240203.c8d11da/init earlycon debug nvme_core.io_timeout=600 nvme_core.admin_timeout=600 cma=512M swiotlb=65536 console=tty1
my custom console=ttyS0,115200
bootarg was removed and a console=tty1
was appended instead. As a result, the output on the serial console stops once the bootconsole is disabled.
Since I intend to use my machine mainly in headless mode, I really want to see the console output on the serial port. I saw that the revyos people are forcing output on the serial console (revyos/sg2042-vendor-kernel@ac43de7) by changing the kernel config, which I am also using as a workaround
Source code for generating fip.bin?
Is the source code available for generating the firmware/fip.bin
?
I am trying to put together a custom bootloader and would like to be able to reproduce this file from source if possible.
I also created an issue asking for more information about fip.bin
in the sophgo-doc repository:
The closest thing I have been able to find regarding the fip.bin
is from the cv18xx
documentation:
Section 3.3.1 Generate Image:
Please refer to <U-boot Porting Development Guide> to generate FIP.bin image.
Section 3.3 Compile U-boot
Since the native u-boot compiled u-boot.bin cannot be burned directly into FLASH, we adopt
the Firmware Image Package (FIP) method in ARM Trusted Firmware Design to encapsulate
uboot.bin in fip.bin. fip_spl.bin contains several images that need to be loaded during the fast
boot process.
I notice that there is a u-boot
repository with an sg2042-dev
branch:
https://github.com/sophgo/u-boot/tree/sg2042-dev
But I'm not sure if this is where the firmware/fip.bin
in this repository is being generated from.
Any information would be appreciated.
Parallelize building GNU toolchain
I was following the Milk-V kernel build instructions here: https://milkv.io/docs/pioneer/development/kernel and found that build_rv_gcc
was taking a long time. Examining /scripts/envsource.sh
, I find the make
commands on lines 234 and 252 are not using -j $(nproc)
, leading to a slow single-threaded build.
Binary bootloader release on github
I would like to develop a sdcard installer image for NixOS for the Pioneer board and contribute it to https://github.com/NixOS/nixos-hardware. I currently face problems packaging LinuxBoot for NixOS. I also have no Go experience which does not help. To get things started it would be convenient to just use binaries of the bootloader stages compiled on a different distribution, and then iteratively replace them by NixOS versions.
For acceptance into nixos-hardware it would be better to have vendor-provided binaries, i.e. you, instead of binaries from some random guy on the internet, i.e. me ;) So could you package compiled versions of the different bootloader stages and release it here on github? A compressed tarball containing the individual files is also better for packaging than a firmware image/bin.
Note: The artifacts from the CI runs unfortunately only have a limited retention time, so they are not suitable.
Cannot change dtb using kexec
I tried to boot a kernel with another dtb using kexec, but it is not possible and the kernel always takes dtb from memory which Linuxboot uses.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.