|
|
|
@ -93,6 +93,20 @@ create_partitions() {
|
|
|
|
|
--change-name=12:CIDATA \
|
|
|
|
|
--new=1:: \
|
|
|
|
|
--attributes=1:set:2
|
|
|
|
|
elif [ "${SUBARCH:-}" = "icicle" ]; then
|
|
|
|
|
# Microchip Icicle Kit
|
|
|
|
|
sgdisk "${disk_image}" \
|
|
|
|
|
--set-alignment=2 \
|
|
|
|
|
--new=13:256:25575 \
|
|
|
|
|
--change-name=13:loader \
|
|
|
|
|
--typecode=13:ef02 \
|
|
|
|
|
--new=15::+106M \
|
|
|
|
|
--typecode=15:ef00 \
|
|
|
|
|
--change-name=15:ESP \
|
|
|
|
|
--new=12::+4M \
|
|
|
|
|
--change-name=12:CIDATA \
|
|
|
|
|
--new=1:: \
|
|
|
|
|
--attributes=1:set:2
|
|
|
|
|
elif [ "${SUBARCH:-}" = "visionfive" ]; then
|
|
|
|
|
# VisionFive
|
|
|
|
|
sgdisk "${disk_image}" \
|
|
|
|
@ -223,6 +237,35 @@ install_grub() {
|
|
|
|
|
if [ -n "${SUBARCH:-}" ]; then
|
|
|
|
|
# Per-device images
|
|
|
|
|
case "${SUBARCH}" in
|
|
|
|
|
"icicle")
|
|
|
|
|
echo "Installing GRUB for ${SUBARCH} board" &1>2
|
|
|
|
|
# flash-kernel is needed to install the dtb for update-grub: it uses the
|
|
|
|
|
# /proc/device-tree/model value to pick the correct dtb and as we are in a chroot,
|
|
|
|
|
# the model value is wrong and we need to use /etc/flash-kernel/machine instead.
|
|
|
|
|
# This explains why we install flash-kernel here.
|
|
|
|
|
chroot mountpoint mkdir -p /etc/flash-kernel/
|
|
|
|
|
chroot mountpoint bash -c "echo 'Microchip PolarFire-SoC Icicle Kit' > /etc/flash-kernel/machine"
|
|
|
|
|
chroot mountpoint bash -c 'FK_FORCE=yes apt-get install -qqy grub-efi-riscv64 flash-kernel'
|
|
|
|
|
efi_target=riscv64-efi
|
|
|
|
|
# The real U-Boot
|
|
|
|
|
chroot mountpoint apt-get install -qqy u-boot-microchip
|
|
|
|
|
loader="/dev/mapper${loop_device///dev/}p13"
|
|
|
|
|
dd if=mountpoint/usr/lib/u-boot/microchip_icicle/u-boot.payload of=$loader
|
|
|
|
|
# Provide end-user modifyable CIDATA
|
|
|
|
|
cidata_dev="/dev/mapper${loop_device///dev/}p12"
|
|
|
|
|
setup_cidata "${cidata_dev}"
|
|
|
|
|
# Provide stock nocloud datasource
|
|
|
|
|
# Allow interactive login on baremetal board,
|
|
|
|
|
# without a cloud datasource.
|
|
|
|
|
setup_cinocloud mountpoint
|
|
|
|
|
|
|
|
|
|
# u-boot-microchip will boot using UEFI if it does not find
|
|
|
|
|
# any extlinux.conf or boot.scr: but flash-kernel will
|
|
|
|
|
# install a boot.scr if it believes it did not boot in
|
|
|
|
|
# EFI mode, so make sure we don't leave a boot.scr
|
|
|
|
|
# behind.
|
|
|
|
|
chroot mountpoint rm -f /boot/boot.scr
|
|
|
|
|
;;
|
|
|
|
|
"nezha"|"licheerv")
|
|
|
|
|
echo "Installing U-Boot for ${SUBARCH} board" &1>2
|
|
|
|
|
# flash-kernel is needed to install the dtb for update-grub: it uses the
|
|
|
|
@ -346,7 +389,7 @@ EOF
|
|
|
|
|
chroot mountpoint u-boot-update
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if [ "${SUBARCH:-}" != "visionfive" ] && [ "${SUBARCH:-}" != "nezha" ] && [ "${SUBARCH:-}" != "licheerv" ]; then
|
|
|
|
|
if [ "${SUBARCH:-}" != "visionfive" ] && [ "${SUBARCH:-}" != "nezha" ] && [ "${SUBARCH:-}" != "licheerv" ] && [ "${SUBARCH:-}" != "icicle" ]; then
|
|
|
|
|
## TODO remove below once we have grub-efi-riscv64 for the platforms
|
|
|
|
|
rm mountpoint/tmp/device.map
|
|
|
|
|
umount mountpoint/boot/efi
|
|
|
|
|