-
Notifications
You must be signed in to change notification settings - Fork 147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Visionfive2: Build bootable SD card image #397
Conversation
@cordlandwehr which boot source did you use with your PR #382? Have you seen issues with SPL and/or kernel resets as described here? |
@@ -1,2 +1,8 @@ | |||
# Support fdt drivers for AE350 | |||
SRCREV:ae350-ax45mp = "22f38ee6c658a660083aa45c4ec6c72f66a17260" | |||
|
|||
BRANCH:visionfive2 = "JH7110_VisionFive2_devel" | |||
SRC_URI:visionfive2 = "git://github.com/starfive-tech/opensbi.git;protocol=https;branch=${BRANCH}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how different is this fork from upstream? is there a plan to upstream the changes can you comment on that ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I was looking at the upstream version, some VF2 reset related things were missing, but those were merged last week (riscv-software-src/opensbi@908be1b). I will try with the upstream version.
install -m 644 ${WORKDIR}/uEnv-visionfive2.txt ${DEPLOYDIR}/uEnv.txt | ||
} | ||
|
||
COMPATIBLE_MACHINE = "(visionfive2)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does it support visionfive1
as well? if so can we add that here as well, so we can have both machines share same u-boot.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JH7110_VisionFive2_devel
branch of github.com/starfive-tech/u-boot moved to U-Boot v2021.10. Seems like this particular branch/tag is missing visionfive1
support. I decided to create a new recipe because all branches supporting visionfive1
are based on v2021.04.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmmm, this is not good, Can you check with upstream if there is a plan to maintain single branch for all visionfive variants ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Asked here starfive-tech/u-boot#43.
JH7110/Visionfive2 support in mainline U-Boot is currently under review (see https://rvspace.org/en/project/JH7110_Upstream_Plan and https://patchwork.ozlabs.org/project/uboot/list/?series=346514), so hopefully we can use upstream recipe soon.
Meanwhile, current u-boot-starfive_v2021.04 in meta-riscv is kind of broken:
- BRANCH for Visionfive is "JH7100_VisionFive_OH_dev" which is based on v2022.04
- BRANCH for Visionfive2 is "JH7110_VisionFive2_devel" which is based on v2021.10
- BRANCH for beaglev-starlight-jh7100 is "Fedora_JH7100_2021.04" which is based on v2021.04
@kraj I guess the optimal solution now would be to rename "u-boot-starfive_v2021.04" to "u-boot-starfive" and set branches/SRCREV for each board.
@@ -0,0 +1,25 @@ | |||
DESCRIPTION = "spl_tool is a jh7110 signature tool used to generate spl header information and generate u-boot-spl.bin.normal.out." | |||
LICENSE = "GPLv2" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mark it GPL-2.0-or-later
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
do_install () { | ||
cd ${S} | ||
install -d ${D}${bindir} | ||
install -m 0755 spl_tool ${D}${bindir}/spl_tool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whole function could be a single line
install -Dm 0755 ${S}/spl_tool ${D}${bindir}/spl_tool
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
DESCRIPTION = "spl_tool is a jh7110 signature tool used to generate spl header information and generate u-boot-spl.bin.normal.out." | ||
LICENSE = "GPLv2" | ||
LIC_FILES_CHKSUM = "file://LICENSE;md5=e6dc25dc2418b8831c906d43809d8336" | ||
SECTION = "BSP" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make this to match u-boot
SECTION = "bootloaders"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
I did all my tests by booting via the onboard SPL and than loading Kernel/rootfs from sd card. Right now I cannot recall any Kernel reset problems, but I am currently too many timezones away from my board to double check... |
Updated PR:
Still in progress:
|
@kraj please review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please rebase the pr on top of latest master and push again after you have addressed the feedback. Thanks
@@ -0,0 +1,20 @@ | |||
diff --git a/board/starfive/visionfive2/visionfive2-i2c-eeprom.c b/board/starfive/visionfive2/visionfive2-i2c-eeprom.c |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a patch header with some description of this patch and upstream status. For reference you can use this template
https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines
install -m 644 ${WORKDIR}/uEnv-visionfive2.txt ${DEPLOYDIR}/uEnv.txt | ||
} | ||
|
||
COMPATIBLE_MACHINE = "(visionfive2)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmmm, this is not good, Can you check with upstream if there is a plan to maintain single branch for all visionfive variants ?
Add u-boot-starfive_v2021.10.bb recipe to build U-Boot v2021.10 from https://github.com/starfive-tech/u-boot Signed-off-by: Alexey Firago <alexey.firago@gmail.com>
Add recipe for a jh7110 signature tool, which is used to generate SPL header information and generate u-boot-spl.bin.normal.out. Signed-off-by: Alexey Firago <alexey.firago@gmail.com>
Build and deploy u-boot-spl.bin.normal.out. It is used to boot from SD Card. Signed-off-by: Alexey Firago <alexey.firago@gmail.com>
Add wks with the layout similar to the Starfive SDK from here: https://github.com/starfive-tech/VisionFive2/blob/JH7110_VisionFive2_devel/conf/genimage-vf2.cfg Signed-off-by: Alexey Firago <alexey.firago@gmail.com>
Deploy uEnv.txt as vf2_uEnv.txt. This file is expected by the Starfive U-Boot. Signed-off-by: Alexey Firago <alexey.firago@gmail.com>
Align uEnv.txt with the Starfive SDK to boot from SD card. uEnv sets required variables to read the fitImage from the partition 3 on the SD card and rootfs is expected on the partition 4. Signed-off-by: Alexey Firago <alexey.firago@gmail.com>
* Use visionfive2.wks * Install required files on the boot partition Signed-off-by: Alexey Firago <alexey.firago@gmail.com>
c26a77c
to
ceda92a
Compare
Add v3:
@kraj please review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
This PR provides changes to create a bootable Visionfive2 SD card image, similar to the one created in the original Starfive SDK.
Changes include:
Current state - SD card flashed with the core-image-minimal-visionfive2.wic using 'dd' or 'bmaptool' boots fine with few issues: