Skip to content

devices/visionfive-2: adapt for /boot as ext4 #3

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

Merged
merged 1 commit into from
Apr 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 4 additions & 18 deletions devices/starfive/visionfive-2/apply-bootloader.bash
Original file line number Diff line number Diff line change
@@ -1,29 +1,15 @@
#!/bin/bash

case "$DEVICE_ID" in
visionfive-2)
DTB_NAME=jh7110-starfive-visionfive-2-v1.3b
;;
*)
DTB_NAME=jh7110-starfive-visionfive-2-v1.2a
;;
esac

echo "Generating uEnv.txt ..."
cat > /boot/u-boot/uEnv.txt <<- EOF
echo "Generating vf2_uEnv.txt ..."
cat > /efi/vf2_uEnv.txt <<- EOF
fdt_high=0xffffffffffffffff
initrd_high=0xffffffffffffffff
kernel_addr_r=0x40200000
kernel_comp_addr_r=0x5a000000
kernel_comp_size=0x4000000
fdt_addr_r=0x46000000
ramdisk_addr_r=0x46100000
#Move distro to first boot to speed up booting
boot_targets=distro mmc0 dhcp
#Fix wrong fdtfile name
fdtfile=starfive/${DTB_NAME}.dtb
#Fix missing bootcmd
bootcmd=run load_distro_uenv;run bootcmd_distro
boot2=if test \${chip_vision} = B; then setenv fdtfile starfive/jh7110-starfive-visionfive-2-v1.3b.dtb; else setenv fdtfile starfive/jh7110-starfive-visionfive-2-v1.2a.dtb; fi; sysboot \${bootdev} \${devnum}:4 any \${scriptaddr} /extlinux/extlinux.conf
EOF

echo "Configuring U-Boot ..."
Expand All @@ -35,6 +21,6 @@ cat > /etc/default/u-boot <<- EOF
U_BOOT_SYNC_DTBS=true
EOF

echo "Syncing dtbs to /boot/u-boot ..."
echo "Syncing dtbs to /boot ..."
_KERNEL=$(ls boot/vmlinux-* | sed 's#boot/vmlinux-##')
/etc/kernel/postinst.d/zz-u-boot-menu ${_KERNEL}
18 changes: 13 additions & 5 deletions devices/starfive/visionfive-2/device.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ bsp_packages = [

kernel_cmdline = ["rw", "console=tty0", "console=ttyS0,115200", "earlycon", "rootwait", "stmmaceth=chain_mode:1", "selinux=0"]
partition_map = "gpt"
num_partitions = 4
num_partitions = 5

[size]
base = 6144
base = 7400
desktop = 25000
server = 6144
server = 7400

# U-Boot SPL
[[partition]]
Expand All @@ -42,13 +42,21 @@ filesystem = "none"
num = 3
type = "esp"
usage = "boot"
size_in_sectors = 307200
size_in_sectors = 32768
filesystem = "fat32"
mountpoint = "/boot/u-boot"
mountpoint = "/efi"

[[partition]]
num = 4
type = "linux"
usage = "boot"
size_in_sectors = 4194304
filesystem = "ext4"
mountpoint = "/boot"

[[partition]]
num = 5
type = "linux"
usage = "rootfs"
size_in_sectors = 0
filesystem = "btrfs"
Expand Down