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.
54 changes: 54 additions & 0 deletions data/rpi-common/config.txt
Original file line number Diff line number Diff line change
@@ -1 +1,55 @@
# For more options and information see
# http://rptl.io/configtxt
# Some settings may impact device functionality. See link above for details

# Uncomment some or all of these to enable the optional hardware interfaces
#dtparam=i2c_arm=on
#dtparam=i2s=on
#dtparam=spi=on

# Enable audio (loads snd_bcm2835)
dtparam=audio=on

# Additional overlays and parameters are documented
# /boot/firmware/overlays/README

# Automatically load overlays for detected cameras
camera_auto_detect=1

# Automatically load overlays for detected DSI displays
display_auto_detect=1

# Automatically load initramfs files, if found
auto_initramfs=1

# Enable DRM VC4 V3D driver
dtoverlay=vc4-kms-v3d
max_framebuffers=2

# Don't have the firmware create an initial video= setting in cmdline.txt.
# Use the kernel's default instead.
disable_fw_kms_setup=1

# Run in 64-bit mode
arm_64bit=1

# Disable compensation for displays with overscan
disable_overscan=1

# Run as fast as firmware / board allows
arm_boost=1

[pi4]
# U-Boot cannot boot systems on RPi 4 series until enable UART
enable_uart=1

[cm4]
# Enable host mode on the 2711 built-in XHCI USB controller.
# This line should be removed if the legacy DWC2 controller is required
# (e.g. for USB device mode) or if USB support is not required.
otg_mode=1

[cm5]
dtoverlay=dwc2,dr_mode=host

[all]
23 changes: 10 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,15 @@ 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 ${FDTDIR}/broadcom/bcm2712-rpi-5*.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