Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp2708994pxx; Sun, 1 Nov 2020 07:15:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJxmsK1MOvHR59OYlO9ngGRb7XSILcUnQJ1HegnNOYPssJH5dj5qA6agZMAfZUZ3ZnrB4Vf/ X-Received: by 2002:a50:96d2:: with SMTP id z18mr12906533eda.367.1604243742027; Sun, 01 Nov 2020 07:15:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604243742; cv=none; d=google.com; s=arc-20160816; b=m/uf16XSar+teqZJ+vWDoPsJPNGqgUgaiKNl4Fpsyyb255bpTLEBsBb7IHIWtwK+UG EqqKiZEK9rXcrIsM5Y09fdupTqqOHvreWkuYiQU3DbKU/Lz9qqfT4LLKzdMJU+xmyoCN Mu//bPQ5mrHtlVqNaxB+c8r08ivKNHCx0nhO451wEZ5dUNilbbW0sNuq47hqQku3alXA hf7FcpB+Ko5U5QDeSHoWbZ4UzIUWr0ygCmlQY4uU0fBdXxu46YX0ISlIVuh+Ytwty/Ds klB0HBBdCNNCoOssI0qHT64RsuVPFzBJFcM2jIFCYIt2QdLL3IvOcCW91G2Vg711l/JL hlpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:subject:reply-to:cc:from:to:dkim-signature:date; bh=r7VPPdvNAzF9CgvJDErC+SkdSrKz+wzaXEr5lvipxXw=; b=dNbuSFO5N7i77RKrLc+kANlDwW8vtqnYN6L+N9hCCCd0lATe2FLQRtl6e+0Zn0zxXL TQJaSlzXUFZedC1ZiEHCBsRtTRJJFqbI0ltrNdM5T3W8QmGQi7Ib03NYnOQl2m291+L+ QRhBRuc0oidXeIpCMtDEWZrSvMTQ/J1BuUhLstaWcu7P7buBKciLEHYIQwOaLfdSYXCE r27HU8Bpc1ca+nQmLWovDZWYXX4C4xIvDm0eMjsY8w4Dtb7/kt3KFu4yxMX8nJkpNh7p 0D1mYABElpDpTw5A1lgNVbOXhKzrDZSD1GIr0OIHU+mpTw4DWHEuOxh9P9jZtxpi09JR 1+eA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@pm.me header.s=protonmail header.b="HxW/l+vC"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=pm.me Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e21si721108edr.26.2020.11.01.07.15.19; Sun, 01 Nov 2020 07:15:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@pm.me header.s=protonmail header.b="HxW/l+vC"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=pm.me Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726848AbgKAPNQ (ORCPT + 99 others); Sun, 1 Nov 2020 10:13:16 -0500 Received: from mail-40136.protonmail.ch ([185.70.40.136]:32051 "EHLO mail-40136.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726499AbgKAPNP (ORCPT ); Sun, 1 Nov 2020 10:13:15 -0500 X-Greylist: delayed 85484 seconds by postgrey-1.27 at vger.kernel.org; Sun, 01 Nov 2020 10:13:13 EST Date: Sun, 01 Nov 2020 15:13:01 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail; t=1604243592; bh=r7VPPdvNAzF9CgvJDErC+SkdSrKz+wzaXEr5lvipxXw=; h=Date:To:From:Cc:Reply-To:Subject:From; b=HxW/l+vCx48Rpye0VEwu1kFCS0fXtlN4zd26a8p9ojYYWJ0XT/I7ePjFZtxf/3q9w WF/OmyDydikGFWNvg37+Y1WgH5iDz3ZlquLqwSr0tOKr119y2rV+TkicRpC6irqZjf NemLvsKH0UujBx3H0pZi7zjHvl83TudfM31siRu/8pRkZzTml9IQmu+TdeipsnQddP ZZJyZksxlzBMOeQo6NRcrjPCFma6337M8/+sL5U/B86MY2gJyls2YGQHE8XvChJ3B/ gAaCJ7KXUkgyOHTwPYYDX28xTRLoX+TrTjWaKckpxvCmlDf4enrt3qLEbbztOE3MlF dF/PTEk3/Bfzw== To: Thomas Bogendoerfer From: Alexander Lobakin Cc: Alexander Lobakin , Greg Kroah-Hartman , Masahiro Yamada , Paul Burton , Paul Cercueil , Huacai Chen , Jiaxun Yang , linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org Reply-To: Alexander Lobakin Subject: [PATCH mips-next 2/2] mips: boot: add support for self-extracting FIT images (vmlinuz.itb) Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=10.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on mailout.protonmail.ch Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit c3e2ee657418 ("MIPS: generic: Add support for zboot") added support for self-extracting images to Generic MIPS. However, the intended way to boot Generic MIPS kernels is using FIT Images and UHI boot protocol, but currently there's no way to make self-extracting FIT Image (only legacy uzImages). Add a target for this named "vmlinuz.itb", which will consist of vmlinuz.bin and selected DT blobs. It will allow to have the advantages of both UHI and self-extracting images. Signed-off-by: Alexander Lobakin --- arch/mips/Makefile | 1 + arch/mips/boot/compressed/Makefile | 48 ++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) diff --git a/arch/mips/Makefile b/arch/mips/Makefile index 622ee83dbb9b..cd4343edeb11 100644 --- a/arch/mips/Makefile +++ b/arch/mips/Makefile @@ -347,6 +347,7 @@ bootz-y=09=09=09+=3D vmlinuz.srec ifeq ($(shell expr $(zload-y) \< 0xffffffff80000000 2> /dev/null), 0) bootz-y=09=09=09+=3D uzImage.bin endif +bootz-y=09=09=09+=3D vmlinuz.itb =20 # # Some machines like the Indy need 32-bit ELF binaries for booting purpose= s. diff --git a/arch/mips/boot/compressed/Makefile b/arch/mips/boot/compressed= /Makefile index fa2c1e1b303f..4c3bc7e3d56d 100644 --- a/arch/mips/boot/compressed/Makefile +++ b/arch/mips/boot/compressed/Makefile @@ -172,3 +172,51 @@ targets +=3D ../uzImage.bin =20 $(objboot)/uzImage.bin: $(objboot)/vmlinuz.bin FORCE =09$(call if_changed,uimage,none) + +# +# Flattened Image Tree (.itb) image +# + +ifeq ($(ADDR_BITS),32) +itb_addr_cells =3D 1 +endif +ifeq ($(ADDR_BITS),64) +itb_addr_cells =3D 2 +endif + +targets +=3D ../vmlinuz.its.S + +quiet_cmd_its_cat =3D CAT $@ + cmd_its_cat =3D cat $(real-prereqs) >$@ + +$(objboot)/vmlinuz.its.S: $(addprefix $(srctree)/arch/mips/$(PLATFORM)/,$(= ITS_INPUTS)) FORCE +=09$(call if_changed,its_cat) + +targets +=3D ../vmlinuz.its + +quiet_cmd_cpp_its_S =3D ITS $@ + cmd_cpp_its_S =3D $(CPP) -P -C -o $@ $< \ +=09=09 -DKERNEL_NAME=3D"\"Linux $(KERNELRELEASE)\"" \ +=09=09=09-DVMLINUX_BINARY=3D"\"$(2)\"" \ +=09=09=09-DVMLINUX_COMPRESSION=3D"\"none\"" \ +=09=09=09-DVMLINUX_LOAD_ADDRESS=3D$(VMLINUZ_LOAD_ADDRESS) \ +=09=09=09-DVMLINUX_ENTRY_ADDRESS=3D$(VMLINUZ_LOAD_ADDRESS) \ +=09=09=09-DADDR_BITS=3D$(ADDR_BITS) \ +=09=09=09-DADDR_CELLS=3D$(itb_addr_cells) + +$(objboot)/vmlinuz.its: $(objboot)/vmlinuz.its.S FORCE +=09$(call if_changed,cpp_its_S,vmlinuz.bin) + +targets +=3D ../vmlinuz.itb + +quiet_cmd_itb-image =3D ITB $@ + cmd_itb-image =3D \ +=09=09env PATH=3D"$(objtree)/scripts/dtc:$(PATH)" \ +=09=09$(BASH) $(MKIMAGE) \ +=09=09-D "-I dts -O dtb -p 500 \ +=09=09=09--include $(objtree)/arch/mips \ +=09=09=09--warning no-unit_address_vs_reg" \ +=09=09-f $(2) $@ + +$(objboot)/vmlinuz.itb: $(objboot)/vmlinuz.its $(objboot)/vmlinuz.bin FORC= E +=09$(call if_changed,itb-image,$<) --=20 2.29.2