aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafał Miłecki <rafal@milecki.pl>2021-11-03 18:12:05 +0100
committerRafał Miłecki <rafal@milecki.pl>2021-11-08 15:57:55 +0100
commita02c971dff934a11ddadf7ffd850dabcab5a3cdf (patch)
tree9f43b68434b0b33e895f2811c3d8d1841c87aeb3
parent29f12fefc01039e9a14fade54b24e5ba8be35f9e (diff)
downloadupstream-a02c971dff934a11ddadf7ffd850dabcab5a3cdf.tar.gz
upstream-a02c971dff934a11ddadf7ffd850dabcab5a3cdf.tar.bz2
upstream-a02c971dff934a11ddadf7ffd850dabcab5a3cdf.zip
bcm4908: start work on images for devices using U-Boot
New BCM4908 family based routers will use U-Boot bootloader. That will require using a totally different firmware format. Kernel has to be put in a FIT image. OpenWrt has some helpers for generating .its files but they don't fit BCM4908 requirements and there is no simple way of extending any of them. The best solution seems to be storing an .its template. BCM4908 bootfs may: 1. contain extra binaries (other than kernel & DTB) 2. include multiple DTB files 3. store device specific U-Boot configurations with custom properties Such setups are too complex to generate using shell script. Raw .its file on the other hand seems quire clean & reasonable. Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
-rw-r--r--target/linux/bcm4908/image/Makefile11
-rw-r--r--target/linux/bcm4908/image/bootfs-generic.its25
2 files changed, 36 insertions, 0 deletions
diff --git a/target/linux/bcm4908/image/Makefile b/target/linux/bcm4908/image/Makefile
index 426db4c5a6..929e626e0e 100644
--- a/target/linux/bcm4908/image/Makefile
+++ b/target/linux/bcm4908/image/Makefile
@@ -6,6 +6,17 @@ include $(INCLUDE_DIR)/image.mk
DEVICE_VARS += ASUS_PRODUCTID ASUS_BUILD_NO ASUS_FW_REV ASUS_EXT_NO
DEVICE_VARS += NETGEAR_BOARD_ID NETGEAR_REGION
+define Image/Prepare
+ cp bootfs-generic.its $(KDIR)/
+endef
+
+define Build/bootfs
+ cat $@ | $(STAGING_DIR_HOST)/bin/lzma e -eos -si -so > $@.tmp
+ mv $@.tmp $@
+ sed -i "s=\$${kernel}=$@=" $(KDIR)/bootfs-generic.its
+ PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage -f $(KDIR)/bootfs-generic.its $(KDIR)/bootfs-generic.itb
+endef
+
define Build/bcm4908asus
$(STAGING_DIR_HOST)/bin/bcm4908asus create -i $@ \
-p $(ASUS_PRODUCTID) -b $(ASUS_BUILD_NO) -f $(ASUS_FW_REV) \
diff --git a/target/linux/bcm4908/image/bootfs-generic.its b/target/linux/bcm4908/image/bootfs-generic.its
new file mode 100644
index 0000000000..d2f19ed752
--- /dev/null
+++ b/target/linux/bcm4908/image/bootfs-generic.its
@@ -0,0 +1,25 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+/dts-v1/;
+
+/ {
+ description = "OpenWrt bootfs image";
+ #address-cells = <1>;
+
+ images {
+ kernel {
+ description = "Linux kernel";
+ data = /incbin/("${kernel}");
+ type = "kernel";
+ os = "linux";
+ arch = "arm64";
+ compression = "lzma";
+ load = <0x80000>;
+ entry = <0x80000>;
+
+ hash-1 {
+ algo = "sha256";
+ };
+ };
+ };
+};