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

add board h96 max v56 tvbox to u-boot 2025.01 #1179

Open
wants to merge 2 commits 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
27 changes: 14 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ run-name: Build

jobs:
rootfs:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
name: Build rootfs
strategy:
matrix:
Expand Down Expand Up @@ -39,11 +39,11 @@ jobs:
shell: bash
run: |
sudo apt-get update && apt-get purge needrestart -y && sudo apt-get upgrade -y
sudo apt-get install -y build-essential gcc-aarch64-linux-gnu bison \
sudo apt-get install -y build-essential gnutls-dev gcc-aarch64-linux-gnu bison \
qemu-user-static qemu-system-arm qemu-efi u-boot-tools binfmt-support \
debootstrap flex libssl-dev bc rsync kmod cpio xz-utils fakeroot parted \
udev dosfstools uuid-runtime git-lfs device-tree-compiler python2 python3 \
python-is-python3 fdisk bc debhelper python3-pyelftools python3-setuptools \
udev dosfstools uuid-runtime git-lfs libgnutls28-dev device-tree-compiler python2 python3 \
python-is-python3 fdisk bc debhelper libgnutls30 python3-pyelftools python3-setuptools \
python3-distutils python3-pkg-resources swig libfdt-dev libpython3-dev dctrl-tools

- name: Build
Expand All @@ -58,7 +58,7 @@ jobs:
if-no-files-found: error

kernel:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
name: Build kernel
strategy:
matrix:
Expand Down Expand Up @@ -87,12 +87,12 @@ jobs:
shell: bash
run: |
sudo apt-get update && apt-get purge needrestart -y && sudo apt-get upgrade -y
sudo apt-get install -y build-essential gcc-aarch64-linux-gnu bison \
sudo apt-get install -y build-essential gnutls-dev gcc-aarch64-linux-gnu bison \
qemu-user-static qemu-system-arm qemu-efi u-boot-tools binfmt-support \
debootstrap flex libssl-dev bc rsync kmod cpio xz-utils fakeroot parted \
udev dosfstools uuid-runtime git-lfs device-tree-compiler python2 python3 \
python-is-python3 fdisk bc debhelper python3-pyelftools python3-setuptools \
python3-distutils python3-pkg-resources swig libfdt-dev libpython3-dev
udev dosfstools uuid-runtime git-lfs libgnutls28-dev device-tree-compiler python2 python3 \
python-is-python3 fdisk bc debhelper libgnutls30 python3-pyelftools python3-setuptools \
python3-distutils python3-pkg-resources swig libfdt-dev libpython3-dev dctrl-tools

- name: Build
shell: bash
Expand All @@ -106,7 +106,7 @@ jobs:
if-no-files-found: error

build:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
needs: [rootfs, kernel]
name: Build image

Expand All @@ -118,6 +118,7 @@ jobs:
- armsom-sige5
- armsom-sige7
- armsom-w3
- h96max-v56
- indiedroid-nova
- lubancat-4
- mixtile-blade3
Expand Down Expand Up @@ -176,11 +177,11 @@ jobs:
shell: bash
run: |
sudo apt-get update && apt-get purge needrestart -y && sudo apt-get upgrade -y
sudo apt-get install -y build-essential gcc-aarch64-linux-gnu bison \
sudo apt-get install -y build-essential gnutls-dev gcc-aarch64-linux-gnu bison \
qemu-user-static qemu-system-arm qemu-efi u-boot-tools binfmt-support \
debootstrap flex libssl-dev bc rsync kmod cpio xz-utils fakeroot parted \
udev dosfstools uuid-runtime git-lfs device-tree-compiler python2 python3 \
python-is-python3 fdisk bc debhelper python3-pyelftools python3-setuptools \
udev dosfstools uuid-runtime git-lfs libgnutls28-dev device-tree-compiler python2 python3 \
python-is-python3 fdisk bc debhelper libgnutls30 python3-pyelftools python3-setuptools \
python3-distutils python3-pkg-resources swig libfdt-dev libpython3-dev dctrl-tools

- name: Checkout rootfs
Expand Down
22 changes: 11 additions & 11 deletions .github/workflows/next.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ jobs:
shell: bash
run: |
sudo apt-get update && apt-get purge needrestart -y && sudo apt-get upgrade -y
sudo apt-get install -y build-essential gcc-aarch64-linux-gnu bison \
sudo apt-get install -y build-essential gnutls-dev gcc-aarch64-linux-gnu bison \
qemu-user-static qemu-system-arm qemu-efi u-boot-tools binfmt-support \
debootstrap flex libssl-dev bc rsync kmod cpio xz-utils fakeroot parted \
udev dosfstools uuid-runtime git-lfs device-tree-compiler python2 python3 \
python-is-python3 fdisk bc debhelper python3-pyelftools python3-setuptools \
udev dosfstools uuid-runtime git-lfs libgnutls28-dev device-tree-compiler python2 python3 \
python-is-python3 fdisk bc debhelper libgnutls30 python3-pyelftools python3-setuptools \
python3-distutils python3-pkg-resources swig libfdt-dev libpython3-dev dctrl-tools

- name: Build
shell: bash
run: sudo ./build.sh --suite=${{ matrix.suite }} --flavor=${{ matrix.flavor }} --rootfs-only
Expand Down Expand Up @@ -85,12 +85,12 @@ jobs:
shell: bash
run: |
sudo apt-get update && apt-get purge needrestart -y && sudo apt-get upgrade -y
sudo apt-get install -y build-essential gcc-aarch64-linux-gnu bison \
sudo apt-get install -y build-essential gnutls-dev gcc-aarch64-linux-gnu bison \
qemu-user-static qemu-system-arm qemu-efi u-boot-tools binfmt-support \
debootstrap flex libssl-dev bc rsync kmod cpio xz-utils fakeroot parted \
udev dosfstools uuid-runtime git-lfs device-tree-compiler python2 python3 \
python-is-python3 fdisk bc debhelper python3-pyelftools python3-setuptools \
python3-distutils python3-pkg-resources swig libfdt-dev libpython3-dev
udev dosfstools uuid-runtime git-lfs libgnutls28-dev device-tree-compiler python2 python3 \
python-is-python3 fdisk bc debhelper libgnutls30 python3-pyelftools python3-setuptools \
python3-distutils python3-pkg-resources swig libfdt-dev libpython3-dev dctrl-tools

- name: Build
shell: bash
Expand Down Expand Up @@ -160,11 +160,11 @@ jobs:
shell: bash
run: |
sudo apt-get update && apt-get purge needrestart -y && sudo apt-get upgrade -y
sudo apt-get install -y build-essential gcc-aarch64-linux-gnu bison \
sudo apt-get install -y build-essential gnutls-dev gcc-aarch64-linux-gnu bison \
qemu-user-static qemu-system-arm qemu-efi u-boot-tools binfmt-support \
debootstrap flex libssl-dev bc rsync kmod cpio xz-utils fakeroot parted \
udev dosfstools uuid-runtime git-lfs device-tree-compiler python2 python3 \
python-is-python3 fdisk bc debhelper python3-pyelftools python3-setuptools \
udev dosfstools uuid-runtime git-lfs libgnutls28-dev device-tree-compiler python2 python3 \
python-is-python3 fdisk bc debhelper libgnutls30 python3-pyelftools python3-setuptools \
python3-distutils python3-pkg-resources swig libfdt-dev libpython3-dev dctrl-tools

- name: Checkout rootfs
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ jobs:
echo "suite_version=$RELASE_VERSION" >> $GITHUB_OUTPUT

- name: Checkout rootfs
uses: actions/[email protected].2
uses: actions/[email protected].8
with:
name: ubuntu-${{ steps.vars.outputs.suite_version }}-preinstalled-${{ matrix.flavor }}-arm64-rootfs
path: ./build/
Expand Down
34 changes: 34 additions & 0 deletions config/boards/h96max-v56.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# shellcheck shell=bash

export BOARD_NAME="h96 v56 tvbox"
export BOARD_MAKER="h96-max"
export BOARD_SOC="Rockchip RK3566"
export BOARD_CPU="ARM Cortex A55"
export UBOOT_PACKAGE="u-boot-rk3566"
export UBOOT_RULES_TARGET="h96max-v56-rk3566"
export COMPATIBLE_SUITES=("jammy" "noble")
export COMPATIBLE_FLAVORS=("server" "desktop")

function config_image_hook__h96max-v56() {
local rootfs="$1"
local overlay="$2"
local suite="$3"

if [ "${suite}" == "jammy" ] || [ "${suite}" == "noble" ]; then
# Kernel modules to load at boot time
echo "sprdbt_tty" >> "${rootfs}/etc/modules"
echo "sprdwl_ng" >> "${rootfs}/etc/modules"

# Install BCMDHD SDIO WiFi and Bluetooth DKMS
chroot "${rootfs}" apt-get -y install dkms bcmdhd-sdio-dkms

# Enable bluetooth for AP6275P
mkdir -p "${rootfs}/usr/lib/scripts"
cp "${overlay}/usr/lib/systemd/system/ap6275p-bluetooth.service" "${rootfs}/usr/lib/systemd/system/ap6275p-bluetooth.service"
cp "${overlay}/usr/lib/scripts/ap6275p-bluetooth.sh" "${rootfs}/usr/lib/scripts/ap6275p-bluetooth.sh"
cp "${overlay}/usr/bin/brcm_patchram_plus" "${rootfs}/usr/bin/brcm_patchram_plus"
chroot "${rootfs}" systemctl enable ap6275p-bluetooth
fi

return 0
}
3 changes: 3 additions & 0 deletions packages/u-boot-rk3566/debian/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
files
build
tmp
1 change: 1 addition & 0 deletions packages/u-boot-rk3566/debian/arch
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
arm64
28 changes: 28 additions & 0 deletions packages/u-boot-rk3566/debian/bin/u-boot-install
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash

set -eE

disk="$1"
if [ $# -ne 1 ]; then
echo "Usage: $(basename "$0") /dev/mmcblk0"
exit 1
fi

if [ ! -b "${disk}" ]; then
echo "$(basename "$0"): block device '${disk}' not found"
exit 1
fi

if [ -f /usr/lib/u-boot/u-boot-rockchip.bin ]; then
echo "Writing idbloader and u-boot image"
sudo dd if=/usr/lib/u-boot/u-boot-rockchip.bin of="${disk}" seek=1 bs=32k conv=fsync
else
echo "Writing idbloader"
sudo dd if=/usr/lib/u-boot/idbloader.img of="${disk}" seek=64 conv=notrunc
echo "Writing u-boot image"
sudo dd if=/usr/lib/u-boot/u-boot.itb of="${disk}" seek=16384 conv=notrunc
fi

sudo sync "${disk}"

sleep 2
23 changes: 23 additions & 0 deletions packages/u-boot-rk3566/debian/bin/u-boot-install-mtd
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash

set -eE

disk="/dev/mtd0"
if [ ! -c "${disk}" ]; then
echo "$(basename "$0"): block device '${disk}' not found"
exit 1
fi
echo "$(basename "$0"): writing U-Boot to the SPI flash"

uboot_spi_image="/usr/lib/u-boot/u-boot-rockchip-spi.bin"
if [ ! -f "${uboot_spi_image}" ]; then
uboot_spi_image="/usr/lib/u-boot/rkspi_loader.img"
fi

extra_opts_flashcp=("--verbose")
if flashcp -h | grep -q -e '--partition'; then
extra_opts_flashcp+=("--partition")
fi
sudo flashcp "${extra_opts_flashcp[@]}" "${uboot_spi_image}" "${disk}"

sudo sync
3 changes: 3 additions & 0 deletions packages/u-boot-rk3566/debian/changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
u-boot-rk3566 (2025.01) jammy; urgency=medium

* Update ddr and spl blobs
41 changes: 41 additions & 0 deletions packages/u-boot-rk3566/debian/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
Source: u-boot-rk3566
Section: admin
Priority: optional
Maintainer: Joshua Riek <[email protected]>
Build-Depends:
debhelper-compat (= 12),
parted,
gcc,
make,
bc,
bison,
flex,
device-tree-compiler,
udev,
python3,
libpython3-dev,
python3-pyelftools,
python3-setuptools,
python3-distutils,
python3-pkg-resources,
swig,
libfdt-dev,
libssl-dev,
Standards-Version: 4.6.0
Homepage: https://www.denx.de/wiki/U-Boot/
Vcs-Browser: https://salsa.debian.org/debian/u-boot
Vcs-Git: https://salsa.debian.org/debian/u-boot.git

Package: u-boot-h96max-v56
Architecture: arm64
Priority: optional
Depends: mtd-utils
Provides: u-boot
Replaces: u-boot
Conflicts: u-boot
Description: A U-Boot for H96Max V56.
Das U-Boot is a cross-platform bootloader for embedded systems,
used as the default boot loader by several board vendors. It is
intended to be easy to port and to debug, and runs on many
supported architectures, including PPC, ARM, MIPS, x86, m68k,
NIOS, and Microblaze.
71 changes: 71 additions & 0 deletions packages/u-boot-rk3566/debian/copyright
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
U-Boot is Free Software. It is copyrighted by Wolfgang Denk and
many others who contributed code (see the actual source code and the
git commit messages for details). You can redistribute U-Boot and/or
modify it under the terms of version 2 of the GNU General Public
License as published by the Free Software Foundation. Most of it can
also be distributed, at your option, under any later version of the
GNU General Public License -- see individual files for exceptions.

NOTE! This license does *not* cover the so-called "standalone"
applications that use U-Boot services by means of the jump table
provided by U-Boot exactly for this purpose - this is merely
considered normal use of U-Boot, and does *not* fall under the
heading of "derived work" -- see file Licenses/Exceptions for
details.

Also note that the GPL and the other licenses are copyrighted by
the Free Software Foundation and other organizations, but the
instance of code that they refer to (the U-Boot source code) is
copyrighted by me and others who actually wrote it.
-- Wolfgang Denk


Like many other projects, U-Boot has a tradition of including big
blocks of License headers in all files. This not only blows up the
source code with mostly redundant information, but also makes it very
difficult to generate License Clearing Reports. An additional problem
is that even the same licenses are referred to by a number of
slightly varying text blocks (full, abbreviated, different
indentation, line wrapping and/or white space, with obsolete address
information, ...) which makes automatic processing a nightmare.

To make this easier, such license headers in the source files will be
replaced with a single line reference to Unique License Identifiers
as defined by the Linux Foundation's SPDX project [1]. For example,
in a source file the full "GPL v2.0 or later" header text will be
replaced by a single line:

SPDX-License-Identifier: GPL-2.0+

Ideally, the license terms of all files in the source tree should be
defined by such License Identifiers; in no case a file can contain
more than one such License Identifier list.

If a "SPDX-License-Identifier:" line references more than one Unique
License Identifier, then this means that the respective file can be
used under the terms of either of these licenses, i. e. with

SPDX-License-Identifier: GPL-2.0+ BSD-3-Clause

you can choose between GPL-2.0+ and BSD-3-Clause licensing.

We use the SPDX Unique License Identifiers here; these are available
at [2].

[1] http://spdx.org/
[2] http://spdx.org/licenses/

Full name SPDX Identifier OSI Approved File name URI
=======================================================================================================================================
GNU General Public License v2.0 only GPL-2.0 Y gpl-2.0.txt http://www.gnu.org/licenses/gpl-2.0.txt
GNU General Public License v2.0 or later GPL-2.0+ Y gpl-2.0.txt http://www.gnu.org/licenses/gpl-2.0.txt
GNU Library General Public License v2 or later LGPL-2.0+ Y lgpl-2.0.txt http://www.gnu.org/licenses/old-licenses/lgpl-2.0.txt
GNU Lesser General Public License v2.1 or later LGPL-2.1+ Y lgpl-2.1.txt http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt
eCos license version 2.0 eCos-2.0 eCos-2.0.txt http://www.gnu.org/licenses/ecos-license.html
BSD 2-Clause License BSD-2-Clause Y bsd-2-clause.txt http://spdx.org/licenses/BSD-2-Clause
BSD 3-clause "New" or "Revised" License BSD-3-Clause Y bsd-3-clause.txt http://spdx.org/licenses/BSD-3-Clause#licenseText
IBM PIBS (PowerPC Initialization and IBM-pibs ibm-pibs.txt
Boot Software) license
ISC License ISC Y isc.txt https://spdx.org/licenses/ISC
SIL OPEN FONT LICENSE (OFL-1.1) OFL-1.1 Y OFL.txt https://spdx.org/licenses/OFL-1.1.html
X11 License X11 x11.txt https://spdx.org/licenses/X11.html
Loading