From patchwork Wed Nov 3 17:12:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 1550446 X-Patchwork-Delegate: zajec5@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=HG2Hx3Xn; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=P20D4xMo; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HktgW29svz9sRK for ; Thu, 4 Nov 2021 04:15:03 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=t/Nz/+lXcbWF2Gm/sIMFNBEHWfz1DJk/sOt2pflJGIw=; b=HG2Hx3XniaGzjl OBtl35zrOPGSdKUUytekFk6I6INVlMN81V2v/bZWWYiuQD0QZSyXKZvvIoTTsMPUTAaCQ9VqNoEDg tP2IrSNdGdNZx/oXohccS3iJCy96DyKHis+iheE1FmK1pkWjf5MJtLF3uwguNIBlgsCDUJLhOcjyc CUG5QPg3oaCSeHxoMZt5GcbftOw8xmfTMhXwVTEZhqif/wxPKkohzBv/rcE12x6qYa0EZEMTG4U2h dCzBSC0m3AQaKgpVyi2dsxN+/nNx7OZBzI3LHvSYtHkd3cvx3COD/Hl5fbicui9ocSOpFB46XKIco 8xlPnT71H5NRqL+yQSwQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1miJoE-005vtA-Il; Wed, 03 Nov 2021 17:12:22 +0000 Received: from mail-lf1-x131.google.com ([2a00:1450:4864:20::131]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1miJoB-005vsD-CB for openwrt-devel@lists.openwrt.org; Wed, 03 Nov 2021 17:12:20 +0000 Received: by mail-lf1-x131.google.com with SMTP id br12so4680137lfb.8 for ; Wed, 03 Nov 2021 10:12:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=X1FyNirMhiRvzDcP+3sPGA1BMmKVmX0OSpzMupCjvYo=; b=P20D4xMopTpNC2n1HQvA2kSZTZ6Ol6SZYg5qZMA5ILlxQofjxvgTbChmW5wlpVwRt4 IUdYvJKNF+Jil66etDAF/VIQ+3W8CLqmTFCCBAXHO2zQ/AzAseYixEz/T9EOqkkSGITt 25hYXI4NBaQQNZQ3/oEJRD6Ayrddu/RXeH3tBWZt7SE2OENQ/FnFXdXyJgZpKuGSS3SJ en6gJZlfzk8mwQ8Q/nBmFFJvM6j+2bz+9L03GvyLzoDILEQ/JUzMPVzqYGUJbpLU3lgY E3g2cXPIB2ANmbO+yZp6Y/z/dUTX3LcqOk1Ssm/tKiFjT0pnPQu7kCxjueNYOgDlzcjN qoGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=X1FyNirMhiRvzDcP+3sPGA1BMmKVmX0OSpzMupCjvYo=; b=LwZcqKTXX1ipCI0SYnBEMQa57JtxmKgREN66RBPzWdGB50z/Jpsv2ParNPvt0I9lfn rMnb20Ay+jyFfCSBFBAAi/Jfn1Vc5sGxHWLrFttwerp2ADYTARHUMh77LNm35c2IvgxK wJapNeB4rgueHNhCRDnESle6Tmcv7yActhxWc6VlaOnXal2D4C6ay1SvAN0VrgldFscj C6pdj0ZO9xD4A1kbFKupAVaX4+L9FYROyXeUEkYq9twdvL2rSxgIqdTNEuOvcsDIjRWY xNfZb3n9QmDJGOhHFRHjKjs/4wxXvEopyFQdVt5keBZGWJvTcfeqowtg2wPKwW2in50A dC1A== X-Gm-Message-State: AOAM532heEwiLpGhcoEeB/RLd1Mv5JoKUPuMijH/Eh1pmI1bGbI2eaMw fD4YFwGf71/f8/SQy+xCWPhPfvLWPbE= X-Google-Smtp-Source: ABdhPJyyZWPNTCBe1Qbt9gAyO9R5FSySO/gkwSVhOaop31bcJ/B+c6sQYW/2xzk0076e0DXToHlXjQ== X-Received: by 2002:ac2:41cf:: with SMTP id d15mr42507770lfi.310.1635959531177; Wed, 03 Nov 2021 10:12:11 -0700 (PDT) Received: from localhost.lan (ip-194-187-74-233.konfederacka.maverick.com.pl. [194.187.74.233]) by smtp.gmail.com with ESMTPSA id y28sm226547lfa.92.2021.11.03.10.12.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Nov 2021 10:12:10 -0700 (PDT) From: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= To: openwrt-devel@lists.openwrt.org Cc: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= Subject: [PATCH] bcm4908: start work on images for devices using U-Boot Date: Wed, 3 Nov 2021 18:12:05 +0100 Message-Id: <20211103171205.17787-1-zajec5@gmail.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211103_101219_464761_14F3DC57 X-CRM114-Status: GOOD ( 14.55 ) X-Spam-Score: 0.1 (/) X-Spam-Report: =?unknown-8bit?q?Spam_detection_software=2C_running_on_the_sy?= =?unknown-8bit?q?stem_=22bombadil=2Einfradead=2Eorg=22=2C?= =?unknown-8bit?q?_has_NOT_identified_this_incoming_email_as_spam=2E__The_ori?= =?unknown-8bit?q?ginal?= =?unknown-8bit?q?_message_has_been_attached_to_this_so_you_can_view_it_or_la?= =?unknown-8bit?q?bel?= =?unknown-8bit?q?_similar_future_email=2E__If_you_have_any_questions=2C_see?= =?unknown-8bit?q?_the_administrator_of_that_system_for_details=2E?= =?unknown-8bit?q?_?= =?unknown-8bit?q?_Content_preview=3A__From=3A_Rafa=C5=82_Mi=C5=82ecki_New_BC?= =?unknown-8bit?q?M4908_family_based_routers_will?= =?unknown-8bit?q?_use_U-Boot_bootloader=2E_That_will_require_using_a_totally?= =?unknown-8bit?q?_different_firmware?= =?unknown-8bit?q?_format=2E_Kernel_has_to_be_put_in_a_FIT_image=2E_OpenWrt_h?= =?unknown-8bit?q?as_some_helpers_for?= =?unknown-8bit?q?_generating_=2Eits_files_but_they_don=27t_fit_BCM4908_requi?= =?unknown-8bit?q?rements_and_there_is?= =?unknown-8bit?q?_no_simple_way_of_extending_any_of_them=2E_The_best_solutio?= =?unknown-8bit?q?n_seems_to_be_storing?= =?unknown-8bit?q?_an_=2Eits_template=2E_?= =?unknown-8bit?q?_?= =?unknown-8bit?q?_Content_analysis_details=3A___=280=2E1_points=2C_5=2E0_req?= =?unknown-8bit?q?uired=29?= =?unknown-8bit?q?_?= =?unknown-8bit?q?_pts_rule_name______________description?= =?unknown-8bit?q?_----_----------------------_------------------------------?= =?unknown-8bit?q?--------------------?= =?unknown-8bit?q?_-0=2E0_RCVD=5FIN=5FDNSWL=5FNONE_____RBL=3A_Sender_listed_a?= =?unknown-8bit?q?t_https=3A//www=2Ednswl=2Eorg/=2C?= =?unknown-8bit?q?_no_trust?= =?unknown-8bit?b?IFsyYTAwOjE0NTA6NDg2NDoyMDowOjA6MDoxMzEgbGlzdGVkIGluXQ==?= =?unknown-8bit?b?IFtsaXN0LmRuc3dsLm9yZ10=?= =?unknown-8bit?q?_-0=2E0_SPF=5FPASS_______________SPF=3A_sender_matches_SPF_?= =?unknown-8bit?q?record?= =?unknown-8bit?q?_0=2E0_SPF=5FHELO=5FNONE__________SPF=3A_HELO_does_not_publ?= =?unknown-8bit?q?ish_an_SPF_Record?= =?unknown-8bit?q?_0=2E0_FREEMAIL=5FFROM__________Sender_email_is_commonly_ab?= =?unknown-8bit?q?used_enduser_mail?= =?unknown-8bit?q?_provider?= =?unknown-8bit?q?_=5Bzajec5=5Bat=5Dgmail=2Ecom=5D?= =?unknown-8bit?q?_0=2E2_FREEMAIL=5FENVFROM=5FEND=5FDIGIT_Envelope-from_freem?= =?unknown-8bit?q?ail_username_ends?= =?unknown-8bit?q?_in_digit?= =?unknown-8bit?q?_=5Bzajec5=5Bat=5Dgmail=2Ecom=5D?= =?unknown-8bit?q?_-0=2E1_DKIM=5FVALID=5FAU__________Message_has_a_valid_DKIM?= =?unknown-8bit?q?_or_DK_signature_from?= =?unknown-8bit?q?_author=27s_domain?= =?unknown-8bit?q?_-0=2E1_DKIM=5FVALID_____________Message_has_at_least_one_v?= =?unknown-8bit?q?alid_DKIM_or_DK_signature?= =?unknown-8bit?q?_0=2E1_DKIM=5FSIGNED____________Message_has_a_DKIM_or_DK_si?= =?unknown-8bit?q?gnature=2C_not_necessarily?= =?unknown-8bit?q?_valid?= =?unknown-8bit?q?_-0=2E1_DKIM=5FVALID=5FEF__________Message_has_a_valid_DKIM?= =?unknown-8bit?q?_or_DK_signature_from?= =?unknown-8bit?q?_envelope-from_domain?= X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org From: Rafał Miłecki 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 --- target/linux/bcm4908/image/Makefile | 11 ++++++++ target/linux/bcm4908/image/bootfs-generic.its | 25 +++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 target/linux/bcm4908/image/bootfs-generic.its 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"; + }; + }; + }; +};