Skip to content
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
4 changes: 2 additions & 2 deletions config/platform/rpi4.ini
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[ostree]
# RPi4 chooses the generic arm64 ostree
platform = arm64
# RPi4 chooses the rpi ostree
platform = rpi
7 changes: 6 additions & 1 deletion data/arm64/boot.src
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@ ext4load ${devtype} ${devnum}:${distro_bootpart} ${scriptaddr} /boot/uEnv.txt
env import -t ${scriptaddr} ${filesize}

echo "Load device tree ..."
ext4load ${devtype} ${devnum}:${distro_bootpart} ${fdt_addr_r} /boot/${fdtdir}/${fdtfile}
if test ${board} = "rpi"; then
fdt addr ${fdt_addr}
fdt move ${fdt_addr} ${fdt_addr_r}
else
ext4load ${devtype} ${devnum}:${distro_bootpart} ${fdt_addr_r} /boot/${fdtdir}/${fdtfile}
fi;

echo "Load kernel and unzip it ..."
kernel_load_addr_r=${ramdisk_addr_r}
Expand Down
Binary file removed data/rpi-common/bcm2711-rpi-4-b.dtb
Binary file not shown.
Binary file removed data/rpi-common/bcm2711-rpi-400.dtb
Binary file not shown.
22 changes: 9 additions & 13 deletions stages/eib_image
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,6 @@ else
ostree --repo="${REPOPATH}" config set sysroot.bootloader none
fi

# Platform dependent boot arguments
platform_bootargs="platform_bootargs="
if [ "${EIB_PLATFORM:0:3}" == "rpi" ]; then
# Raspberry Pi needs the memory config if vc4 is loaded
# https://phabricator.endlessm.com/T27774#757530
platform_bootargs+="cma=256M@512M"
fi

# 62MB seems to be arbitrarily chosen to minimize the impact of the ESP
# on non-EFI and low storage (small EMMC) devices.
esp_size=62
Expand Down Expand Up @@ -214,7 +206,7 @@ create_image() {
# from the first partition which must be VFAT.
if [ "${EIB_PLATFORM:0:3}" == "rpi" ]; then
# BOOT Partition using EFI System type for RPi firmware
echo "size=100MiB, type=C12A7328-F81F-11D2-BA4B-00A0C93EC93B"
echo "size=512MiB, type=C12A7328-F81F-11D2-BA4B-00A0C93EC93B"
fi

if [ "${EIB_IMAGE_PARTITION_TABLE}" == "dos" ]; then
Expand Down Expand Up @@ -338,12 +330,9 @@ EOF
# Install bootloader
case "${EIB_ARCH}" in
arm64)
cp "${EIB_DATADIR}"/arm64/boot.src "${EIB_TMPDIR}"/boot.src
sed -i "1s/^/"$platform_bootargs"\n/" "${EIB_TMPDIR}"/boot.src

# Make a boot script for u-boot
mkimage -T script -C none -n "Endless OS arm64 boot script" -d \
"${EIB_TMPDIR}"/boot.src \
"${EIB_DATADIR}"/arm64/boot.src \
"${ROOT}"/boot/boot.scr

case "${EIB_PLATFORM}" in
Expand All @@ -354,7 +343,14 @@ EOF
# https://phabricator.endlessm.com/T27942#760094
mkdir ${EIB_TMPDIR}/rpiboot
eib_mount ${boot_loop} ${EIB_TMPDIR}/rpiboot

cp ${EIB_DATADIR}/rpi-common/* ${EIB_TMPDIR}/rpiboot/

eval $(grep "^fdtdir=" ${ROOT}/boot/uEnv.txt)
FDTDIR="${ROOT}/${fdtfit}"
cp ${FDTDIR}/broadcom/bcm2711-rpi-4*.dtb ${EIB_TMPDIR}/rpiboot/
cp -r ${FDTDIR}/overlays ${EIB_TMPDIR}/rpiboot/

# Copy Raspberry Pi's u-boot
local UBOOT_PATH="${DEPLOY}"/usr/lib/u-boot/rpi_arm64
cp ${UBOOT_PATH}/u-boot.bin ${EIB_TMPDIR}/rpiboot/kernel8.img
Expand Down