Skip to content

Commit

Permalink
feat: add support for ODroid HC4
Browse files Browse the repository at this point in the history
Adds the kernel module required to ensure proper functioning of the
ODroid HC4's GPU so that HDMI output works as expected.

Adds the kernel module required to ensure proper functioning of the SATA
ODroid HC4's SATA ports.

Adds a u-boot variant for the ODroid HC4. This is not used directly, but
rather flashed into the SPI of the unit so that it can boot Talos.
Documentation on this process can be found in the Talos repo.
  • Loading branch information
DWSR committed Jan 31, 2023
1 parent 1fae0b2 commit 708d78e
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 2 deletions.
5 changes: 5 additions & 0 deletions Pkgfile
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,11 @@ vars:
arm_trusted_firmware_sha256: 60fad60eeb6840097f8e64f16093c06ddb2ef269c7a22affed02beaa6cefe466
arm_trusted_firmware_sha512: 958cf8f9e258638e59d0fbd8b053fce7d8a9ea2fc922686c9d20ea16f79f55219ac18a12ab240c528ee98e49c2e0eef4c963fdb255cc14b92437a5b3cffc8640

# renovate: datasource=git-refs currentValueTemplate=master depName=git://github.com/LibreELEC/amlogic-boot-fip.git
amlogic_boot_fip_version: 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
4 changes: 2 additions & 2 deletions kernel/build/config-arm64
Original file line number Diff line number Diff line change
Expand Up @@ -1901,7 +1901,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=y
CONFIG_PCIE_TEGRA194=y
CONFIG_PCIE_TEGRA194_HOST=y
# CONFIG_PCIE_TEGRA194_EP is not set
Expand Down Expand Up @@ -4906,7 +4906,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_version }}.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 @@ -40,6 +46,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 @@ -135,6 +143,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 @@ -222,6 +239,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 @@ -265,6 +287,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

0 comments on commit 708d78e

Please sign in to comment.