Skip to content
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

feat: add support for ODroid HC4 #643

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
5 changes: 5 additions & 0 deletions Pkgfile
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,11 @@ vars:
arm_trusted_firmware_sha256: 60fad60eeb6840097f8e64f16093c06ddb2ef269c7a22affed02beaa6cefe466
arm_trusted_firmware_sha512: 958cf8f9e258638e59d0fbd8b053fce7d8a9ea2fc922686c9d20ea16f79f55219ac18a12ab240c528ee98e49c2e0eef4c963fdb255cc14b92437a5b3cffc8640

# renovate: datasource=git-refs versioning=git depName=LibreELEC/amlogic-boot-fip.git
amlogic_boot_fip_ref: 36f258b88ca019be511d315e58dfbb3a964d5b78
amlogic_boot_fip_sha256: 655e5b2a1451e7e404783dd481e6655e198adef4f1471f0ecc1fb54a3ec44896
amlogic_boot_fip_sha512: 947dcefdc0487e918a16712ceeb353a0e6aaded1f7bef4d39ef19d0d058f9dd3a0ed6afb1f0f7061e3bedb7401332f395b108be003374227416c62e2680d007b

# renovate: datasource=github-tags extractVersion=^v(?<version>.*)$ depName=u-boot/u-boot
uboot_version: 2023.01
uboot_sha256: 69423bad380f89a0916636e89e6dcbd2e4512d584308d922d1039d1e4331950f
Expand Down
7 changes: 5 additions & 2 deletions kernel/build/config-arm64
Original file line number Diff line number Diff line change
Expand Up @@ -1907,7 +1907,7 @@ CONFIG_PCIE_ARMADA_8K=y
# CONFIG_PCIE_ROCKCHIP_DW_HOST is not set
# CONFIG_PCIE_KIRIN is not set
# CONFIG_PCIE_HISI_STB is not set
# CONFIG_PCI_MESON is not set
CONFIG_PCI_MESON=m
CONFIG_PCIE_TEGRA194=y
CONFIG_PCIE_TEGRA194_HOST=y
# CONFIG_PCIE_TEGRA194_EP is not set
Expand Down Expand Up @@ -1976,7 +1976,9 @@ CONFIG_FW_CACHE=y
# CONFIG_FW_UPLOAD is not set
# end of Firmware loader

CONFIG_WANT_DEV_COREDUMP=y
CONFIG_ALLOW_DEV_COREDUMP=y
CONFIG_DEV_COREDUMP=y
# CONFIG_DEBUG_DRIVER is not set
CONFIG_DEBUG_DEVRES=y
# CONFIG_DEBUG_TEST_DRIVER_REMOVE is not set
Expand Down Expand Up @@ -4705,6 +4707,7 @@ CONFIG_DRM_DISPLAY_HDMI_HELPER=y
# CONFIG_DRM_DP_CEC is not set
CONFIG_DRM_GEM_DMA_HELPER=y
CONFIG_DRM_GEM_SHMEM_HELPER=y
CONFIG_DRM_SCHED=y

#
# I2C encoder or helper chips
Expand Down Expand Up @@ -4925,7 +4928,7 @@ CONFIG_DRM_MESON_DW_HDMI=y
# CONFIG_DRM_PL111 is not set
# CONFIG_DRM_XEN_FRONTEND is not set
# CONFIG_DRM_LIMA is not set
# CONFIG_DRM_PANFROST is not set
CONFIG_DRM_PANFROST=y
# CONFIG_DRM_TIDSS is not set
# CONFIG_DRM_GUD is not set
# CONFIG_DRM_SSD130X is not set
Expand Down
14 changes: 14 additions & 0 deletions u-boot/odroid_hc4/patches/fixup-usb-boot.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# We need to enumerate PCI devices in order to be able to detect USB devices and boot from them
# TODO Remove this patch once fixed upstream
diff --git a/include/config_distro_bootcmd.h b/include/config_distro_bootcmd.h
index c3a2414b91..95b7eb5675 100644
--- a/include/config_distro_bootcmd.h
+++ b/include/config_distro_bootcmd.h
@@ -289,6 +289,7 @@
#define BOOTENV_SHARED_USB \
"boot_net_usb_start=usb start\0" \
"usb_boot=" \
+ BOOTENV_RUN_PCI_ENUM \
"usb start; " \
BOOTENV_SHARED_BLKDEV_BODY(usb)
#define BOOTENV_DEV_USB BOOTENV_DEV_BLKDEV
30 changes: 30 additions & 0 deletions u-boot/pkg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
# - https://u-boot.readthedocs.io/en/latest/board/rockchip/rockchip.html
# Broadcom/RaspberryPi
# - https://github.com/u-boot/u-boot/blob/master/doc/board/broadcom/raspberrypi.rst
# ODroid HC4
# - https://u-boot.readthedocs.io/en/latest/board/amlogic/odroid-c4.html
name: u-boot
variant: scratch
shell: /toolchain/bin/bash
Expand All @@ -23,6 +25,10 @@ steps:
destination: arm-trusted-firmware.tar.gz
sha256: "{{ .arm_trusted_firmware_sha256 }}"
sha512: "{{ .arm_trusted_firmware_sha512 }}"
- url: https://github.com/LibreELEC/amlogic-boot-fip/archive/{{ .amlogic_boot_fip_ref }}.tar.gz
destination: amlogic-boot-fip.tar.gz
sha256: "{{ .amlogic_boot_fip_sha256 }}"
sha512: "{{ .amlogic_boot_fip_sha512 }}"
- url: https://ftp.denx.de/pub/u-boot/u-boot-{{ .uboot_version }}.tar.bz2
destination: u-boot.tar.bz2
sha256: "{{ .uboot_sha256 }}"
Expand All @@ -41,6 +47,8 @@ steps:
ROCK_PI_4C_RK3399_U_BOOT: rock-pi-4c-rk3399_u-boot
JETSON_NANO_U_BOOT: jetson-nano_u-boot
NANOPI_R4S_U_BOOT: nanopi-r4s_u-boot
ODROID_HC4_AMLOGIC_BOOT_FIP: odroid-hc4_amlogic-boot-fip
ODROID_HC4_U_BOOT: odroid-hc4_u-boot
prepare:
- |
mkdir -p /usr/bin \
Expand Down Expand Up @@ -136,6 +144,15 @@ steps:
cd ${NANOPI_R4S_U_BOOT}
make nanopi-r4s-rk3399_defconfig
sed -i "s/CONFIG_TOOLS_LIBCRYPTO=y/# CONFIG_TOOLS_LIBCRYPTO is not set/" .config
# odroid-hc4
- |
mkdir ${ODROID_HC4_U_BOOT}
tar -xjf u-boot.tar.bz2 --strip-components=1 -C ${ODROID_HC4_U_BOOT}
cd ${ODROID_HC4_U_BOOT}
echo Applying fixup patch for USB boot
patch -p1 < /pkg/odroid_hc4/patches/fixup-usb-boot.patch
make odroid-hc4_defconfig
sed -i "s/CONFIG_TOOLS_LIBCRYPTO=y/# CONFIG_TOOLS_LIBCRYPTO is not set/" .config
build:
# sun50i_a64
- |
Expand Down Expand Up @@ -223,6 +240,11 @@ steps:
export BL31=$(pwd)/${RK3399_ARM_TRUSTED_FIRMWARE}/build/rk3399/release/bl31/bl31.elf
cd ${NANOPI_R4S_U_BOOT}
make -j $(nproc) HOSTLDLIBS_mkimage="-lssl -lcrypto"
# odroid-hc4
- |
mkdir ${ODROID_HC4_AMLOGIC_BOOT_FIP}
cd ${ODROID_HC4_U_BOOT}
make -j $(nproc) HOSTLDLIBS_mkimage="-lssl -lcrypto"
install:
# libretech_all_h3_cc_h5
- |
Expand Down Expand Up @@ -266,6 +288,14 @@ steps:
- |
mkdir -p /rootfs/nanopi_r4s
cp -v ${NANOPI_R4S_U_BOOT}/u-boot-rockchip.bin /rootfs/nanopi_r4s
# odroid-hc4
- |
mkdir -p /rootfs/odroid_hc4
export U_BOOT_BIN=$(pwd)/${ODROID_HC4_U_BOOT}/u-boot.bin
tar -xf amlogic-boot-fip.tar.gz --strip-components=1 -C ${ODROID_HC4_AMLOGIC_BOOT_FIP}
cd ${ODROID_HC4_AMLOGIC_BOOT_FIP}
./build-fip.sh odroid-hc4 ${U_BOOT_BIN} /rootfs/odroid_hc4

# {{ else }}
- install:
- |
Expand Down