Subject: main/u-boot-rockchip: Add board, which requires TPL blob

From: Daniel Martin <[email-masked]>
Date: Tue, 28 Jan 2025 10:43:44 +0100

Hi,

I would like to add support for the Radxa Zero 3E [1] to main/u-boot-rockchip.

U-Boot requires an additional TPL (third program loader) for this
board. The TPL (and more) can be found at [2], which I would like to
package first. For boards requiring such a TPL, one has to set the
ROCKCHIP_TPL variable referencing the TPL when building U-Boot. Due to
this I would call the package "rockchip-tpl".

Anyone could tell me, if that [3] is an MIT license?

I tried arch="aarch64" before, as U-Boot requires the TPL to boot
aarch64. Imho, they don't make much sense on i. e. "x86-64" other than
cross-building U-Boot.
Though, they're identified as "data" only and abuild said, that
"noarch" would be better. Should I stick to "noarch"?

Below you can find the APKBUILD I've screwed up so far. (Copy'n'paste just
replaced the tabs.)

Cheers,
    Daniel Martin

[1] http://radxa.com/products/zeros/zero3e/
[2] https://github.com/rockchip-linux/rkbin
[3] https://github.com/rockchip-linux/rkbin/blob/master/LICENSE

-----8< APKBUILD 8<-----
pkgname=rockchip-tpl
pkgver=20241209  # date of the commit
pkgrel=0
pkgdesc="Third Program Loader for RK3308, RK3568 and RK3588"
url="https://github.com/rockchip-linux/rkbin"
commit="0f8ac860f0479da56a1decae207ddc99e289f2e2"
arch="noarch"  # XXX
license="MIT"  # XXX:
https://github.com/rockchip-linux/rkbin/blob/master/LICENSE
options="!check"  # no tests
source="rkbin-$commit.tar.gz::https://github.com/rockchip-linux/rkbin/archive/$commit.tar.gz"

# TPLs referenced in U-Boot documentation, roughly:
# grep -r export.ROCKCHIP_TPL u-boot/doc/board | cut -f2 -d=
tpls="bin/rk33/rk3308_ddr_589MHz_uart?_m?_v*.bin
    bin/rk35/rk3568_ddr_1056MHz_v*.bin
    bin/rk35/rk3568_ddr_1560MHz_v*.bin
    bin/rk35/rk3588_ddr_lp4_2112MHz_lp5_2400MHz_v*.bin
    bin/rk35/rk3588_ddr_lp4_2112MHz_lp5_2736MHz_eyescan_v*.bin"

package() {
    mkdir -p "$pkgdir"/usr/share/$pkgname

    cd "$srcdir"/rkbin-$commit
    for bin in $tpls; do
        fname="${bin##*/}"
        lname="${fname/_v*/.bin}"
        install $bin "$pkgdir"/usr/share/$pkgname/$fname
        # link name without version as a more stable reference
        ln -s $fname "$pkgdir"/usr/share/$pkgname/$lname
    done
}

sha512sums="
4287fb19042e9b090e8eb51287eef289224c6ae95f6bc3e9040eaa4d783a28e377685e4d32a984b8a49ab5bd95b885248e910a644d088d679b4cdd94cd735de9
 rkbin-0f8ac860f0479da56a1decae207ddc99e289f2e2.tar.gz
"
----->8 APKBUILD >8-----

---

From: Naomi Rennie-Waldock <[email-masked]>
Date: Wed, 29 Jan 2025 02:46:45 +0000

>Anyone could tell me, if that [3] is an MIT license?

It's not MIT, but I don't see a reason it can't be accepted. The license is very similar to a lot of the linux-firmware licenses.

---

From: Yao Zi <[email-masked]>
Date: Tue, 28 Jan 2025 10:10:23 +0000

> Anyone could tell me, if that [3] is an MIT license?

(claim: I'm not a lawyer)

Refering to its content,

> Except as expressively authorized by Rockchip in writing, you may NOT:
> (a) decompile, reverse-engineer, dissemble, or attempt to derive any
> source code from the Software;
> (b) remove or obscure any copyright, patent, or trademark statement
> or notices contained in the Software.

and considering rkbin doesn't come with corresponding source, I don't
even think it's an open-source project and suspect whether Aports is
willing to accept it.

> Below you can find the APKBUILD I've screwed up so far. (Copy'n'paste just

Best regards,
Yao Zi

---

From: Daniel Martin <[email-masked]>
Date: Tue, 28 Jan 2025 11:17:54 +0100

> even think it's an open-source project and suspect whether Aports is

Even when "... Rockchip hereby grants to you a non-exclusive license
(a) to use, copy,
distribute the Software; ..."?