[Buildroot] [PATCH] board/broadcom: add support for Northstar platform devices

Baruch Siach baruch at tkos.co.il
Tue Aug 10 14:01:27 UTC 2021


Hi Rafał,

on Tue, Aug 10 2021, Rafał Miłecki wrote:
> From: Rafał Miłecki <rafal at milecki.pl>
>
> Broadcom Northstar family of SoCs is most commonly used for home
> routers. It's an ARM platform with Cortex-A9 CPU(s).
>
> All known Northstar devices come with CFE bootloader which almost always
> expects a TRX firmware format (with exception for the D-Link). Some
> vendors (like Luxul and Netgear) wrap TRX in their own containers.
>
> For above reason a plain kernel and rootfs are useless for flashing
> purposes. CFE requires TRX(-like) format and there isn't any CFE
> replacement. Another issue is lack for DTS support in CFE.
> That's why for this board there is post-image script building device
> specific images. It takes care of appending DTB to the kernel and
> putting everything in a TRX image.
>
> Kernel config was adjusted to provide minimal support all on-SoC blocks
> (like Ethernet, switch, USB, PCIe). For rootfs this boards adds network
> config that setups interfaces making device accessible over the network.
>
> Signed-off-by: Rafał Miłecki <rafal at milecki.pl>
> ---

[meta-patch text goes here]

> +++ b/board/broadcom/ns/post-image.sh
> @@ -0,0 +1,43 @@
> +#!/bin/sh
> +
> +# $1: images directory path
> +# $2: device dts filename
> +# $3: board id
> +build_lxl() {
> +	local images="$1"
> +	local device="$2"
> +	local board="$3"
> +
> +	lzma-alone e $images/zImage.$device $images/zImage.$device.lzma -d16
> +	rm -f $images/zImage.$device
> +	$HOST_DIR/bin/otrx create $images/$device.trx -f $images/zImage.$device.lzma
> +	rm -f $images/zImage.$device.lzma
> +	$HOST_DIR/bin/lxlfw create $images/$device.lxl -i $images/$device.trx -b "$board"
> +}
> +
> +# $1: images directory path
> +# $2: device dts filename
> +build_trx() {
> +	local images="$1"
> +	local device="$2"
> +
> +	lzma-alone e $images/zImage.$device $images/zImage.$device.lzma -d16
> +	rm -f $images/zImage.$device
> +	$HOST_DIR/bin/otrx create $images/$device.trx -f $images/zImage.$device.lzma

Is this utility part of the firmware-utils host package? I see that
defconfig selects BR2_PACKAGE_HOST_FIRMWARE_UTILS which is not in
current Buildroot master. So this patch depends on the patch
"package/firmware-utils: add package":

  http://patchwork.ozlabs.org/project/buildroot/patch/20210809144144.30105-1-zajec5@gmail.com/

You should mentions that in the meta-patch part of the email (see
above).

baruch

> +	rm -f $images/zImage.$device.lzma
> +}
> +
> +devices="$(sed -n 's/^BR2_LINUX_KERNEL_INTREE_DTS_NAME="\([a-z0-9 \-]*\)"$/\1/p' ${BR2_CONFIG})"
> +for device in $devices; do
> +	case "$device" in
> +		"bcm4708-smartrg-sr400ac")
> +			build_trx "$1" "$device"
> +			;;
> +		"bcm47094-luxul-xap-1610")
> +			build_lxl "$1" "$device" "XAP-1610"
> +			;;
> +		"bcm47094-luxul-xwr-3150-v1")
> +			build_lxl "$1" "$device" "XWR-3150"
> +			;;
> +	esac
> +done

-- 
                                                     ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -


More information about the buildroot mailing list