From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Date: Tue, 3 Mar 2020 13:08:10 +0100 From: Roland Hieber Message-ID: <20200303120810.tu63awt4yysdurap@pengutronix.de> References: <20200302110356.19112-1-a.fatoum@pengutronix.de> <20200302110356.19112-7-a.fatoum@pengutronix.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200302110356.19112-7-a.fatoum@pengutronix.de> Subject: Re: [DistroKit] [PATCH 6/6] v7a: add stm32mp157c-dk2 SD-Card image List-Id: DistroKit Mailinglist List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: distrokit-bounces@pengutronix.de Sender: "DistroKit" To: Ahmad Fatoum Cc: distrokit@pengutronix.de On Mon, Mar 02, 2020 at 12:03:56PM +0100, Ahmad Fatoum wrote: > Both STM32MP BootROM and TF-A expect the subsequent bootloader stage to > come from a GPT partition when booting from SD-Card. > Add a genimage config that describes this. > > Signed-off-by: Ahmad Fatoum > --- > .../platform-v7a/config/images/stm32mp.config | 31 +++++++++++++++ > configs/platform-v7a/platformconfig | 4 +- > .../platforms/blspec-stm32mp157c-dk2.in | 5 +++ > .../platforms/image-stm32mp157c-dk2.in | 11 ++++++ > .../loader/entries/stm32mp157c-dk2.conf | 6 +++ > .../rules/blspec-stm32mp157c-dk2.make | 36 ++++++++++++++++++ > .../rules/image-stm32mp157c-dk2.make | 38 +++++++++++++++++++ > 7 files changed, 130 insertions(+), 1 deletion(-) > create mode 100644 configs/platform-v7a/config/images/stm32mp.config > create mode 100644 configs/platform-v7a/platforms/blspec-stm32mp157c-dk2.in > create mode 100644 configs/platform-v7a/platforms/image-stm32mp157c-dk2.in > create mode 100644 configs/platform-v7a/projectroot/loader/entries/stm32mp157c-dk2.conf > create mode 100644 configs/platform-v7a/rules/blspec-stm32mp157c-dk2.make > create mode 100644 configs/platform-v7a/rules/image-stm32mp157c-dk2.make > > diff --git a/configs/platform-v7a/config/images/stm32mp.config b/configs/platform-v7a/config/images/stm32mp.config > new file mode 100644 > index 000000000000..0b9cfe888791 > --- /dev/null > +++ b/configs/platform-v7a/config/images/stm32mp.config > @@ -0,0 +1,31 @@ > +image @IMAGE@ { > + hdimage { > + align = 1M > + gpt = "true" > + } > + partition fsbl1 { > + image = "tf-a-@STM32MP_BOARD@.stm32" > + size = 256K > + } > + partition fsbl2 { > + image = "tf-a-@STM32MP_BOARD@.stm32" > + size = 256K > + } > + partition ssbl { > + image = "barebox-@STM32MP_BOARD@.img" > + size = 1M > + } > + partition barebox-environment { > + size = 1M > + } > + partition root { > + image = root.ext2 > + partition-type = 0x83 > + size = 512M > + } > + partition data { > + partition-type = 0x83 > + size = 100M > + } > +} > +/* vim: set tabstop=8 noexpandtab : */ > diff --git a/configs/platform-v7a/platformconfig b/configs/platform-v7a/platformconfig > index 02111f2750d7..d4dbc9a47b6f 100644 > --- a/configs/platform-v7a/platformconfig > +++ b/configs/platform-v7a/platformconfig > @@ -143,7 +143,7 @@ PTXCONF_KERNEL_EXTRA_MAKEVARS="" > PTXCONF_DTC=y > PTXCONF_DTC_INSTALL_OFTREE=y > PTXCONF_DTC_OFTREE_DTS_PATH="${KERNEL_DIR}/arch/${GENERIC_KERNEL_ARCH}/boot/dts" > -PTXCONF_DTC_OFTREE_DTS="am335x-bone.dts am335x-boneblack.dts vexpress-v2p-ca9.dts bcm2836-rpi-2-b.dts imx6q-sabrelite.dts imx6sx-udoo-neo-full.dts imx6dl-riotboard.dts imx6q-nitrogen6x.dts imx6qp-nitrogen6_max.dts bcm2837-rpi-3-b.dts" > +PTXCONF_DTC_OFTREE_DTS="am335x-bone.dts am335x-boneblack.dts vexpress-v2p-ca9.dts bcm2836-rpi-2-b.dts imx6q-sabrelite.dts imx6sx-udoo-neo-full.dts imx6dl-riotboard.dts imx6q-nitrogen6x.dts imx6qp-nitrogen6_max.dts bcm2837-rpi-3-b.dts stm32mp157c-dk2.dts" > PTXCONF_DTC_EXTRA_ARGS="" > PTXCONF_HOST_DTC=y > PTXCONF_HOST_DTC_VERSION="1.5.1" > @@ -214,6 +214,7 @@ PTXCONF_BLSPEC_RIOTBOARD=y > PTXCONF_BLSPEC_RPI2=y > PTXCONF_BLSPEC_RPI3=y > PTXCONF_BLSPEC_SABRELITE=y > +PTXCONF_BLSPEC_STM32MP157C_DK2=y > PTXCONF_BLSPEC_UDOO_NEO=y > PTXCONF_BLSPEC_VEXPRESS=y > > @@ -258,6 +259,7 @@ PTXCONF_IMAGE_ROOT_TGZ_LABEL="" > PTXCONF_IMAGE_RPI2=y > PTXCONF_IMAGE_RPI3=y > PTXCONF_IMAGE_SABRELITE=y > +PTXCONF_IMAGE_STM32MP157C_DK2=y > PTXCONF_IMAGE_UDOO_NEO=y > PTXCONF_IMAGE_VEXPRESS_NOR=y > PTXCONF_IMAGE_VEXPRESS=y > diff --git a/configs/platform-v7a/platforms/blspec-stm32mp157c-dk2.in b/configs/platform-v7a/platforms/blspec-stm32mp157c-dk2.in > new file mode 100644 > index 000000000000..fc142950e21a > --- /dev/null > +++ b/configs/platform-v7a/platforms/blspec-stm32mp157c-dk2.in > @@ -0,0 +1,5 @@ > +## SECTION=blspec > + > +config BLSPEC_STM32MP157C_DK2 > + tristate > + prompt "/loader/entries/stm32mp157c-dk2.conf bootloader spec entry" > diff --git a/configs/platform-v7a/platforms/image-stm32mp157c-dk2.in b/configs/platform-v7a/platforms/image-stm32mp157c-dk2.in > new file mode 100644 > index 000000000000..d7b9c235edaa > --- /dev/null > +++ b/configs/platform-v7a/platforms/image-stm32mp157c-dk2.in > @@ -0,0 +1,11 @@ > +## SECTION=image > + > +config IMAGE_STM32MP157C_DK2 > + tristate > + select HOST_GENIMAGE > + select IMAGE_ROOT_EXT > + select BAREBOX_STM32MP > + select TF_A > + prompt "Generate images/stm32mp157c-dk2.hdimg" > + help > + Generate GPT image for the STM32MP157C-DK2 > diff --git a/configs/platform-v7a/projectroot/loader/entries/stm32mp157c-dk2.conf b/configs/platform-v7a/projectroot/loader/entries/stm32mp157c-dk2.conf > new file mode 100644 > index 000000000000..1fbba657bfbe > --- /dev/null > +++ b/configs/platform-v7a/projectroot/loader/entries/stm32mp157c-dk2.conf > @@ -0,0 +1,6 @@ > +title PTXdist - Pengutronix-DistroKit > +version 5.3 > +options rootwait rw > +linux /boot/zImage > +devicetree /boot/stm32mp157c-dk2.dtb > +linux-appendroot true > diff --git a/configs/platform-v7a/rules/blspec-stm32mp157c-dk2.make b/configs/platform-v7a/rules/blspec-stm32mp157c-dk2.make > new file mode 100644 > index 000000000000..e057fa95f98c > --- /dev/null > +++ b/configs/platform-v7a/rules/blspec-stm32mp157c-dk2.make > @@ -0,0 +1,36 @@ > +# -*-makefile-*- > +# > +# Copyright (C) 2017 by Sascha Hauer > +# > +# For further information about the PTXdist project and license conditions > +# see the README file. > +# > + > +# > +# We provide this package > +# > +PACKAGES-$(PTXCONF_BLSPEC_STM32MP157C_DK2) += blspec-stm32mp157c-dk2 > + > +BLSPEC_STM32MP157C_DK2_VERSION := 4.11 > + > +# ---------------------------------------------------------------------------- > +# Target-Install > +# ---------------------------------------------------------------------------- > + > +$(STATEDIR)/blspec-stm32mp157c-dk2.targetinstall: > + @$(call targetinfo) > + > + @$(call install_init, blspec-stm32mp157c-dk2) > + @$(call install_fixup,blspec-stm32mp157c-dk2,PRIORITY,optional) > + @$(call install_fixup,blspec-stm32mp157c-dk2,SECTION,base) > + @$(call install_fixup,blspec-stm32mp157c-dk2,AUTHOR,"Sascha Hauer ") > + @$(call install_fixup,blspec-stm32mp157c-dk2,DESCRIPTION,missing) > + > + @$(call install_alternative, blspec-stm32mp157c-dk2, 0, 0, 0644, \ > + /loader/entries/stm32mp157c-dk2.conf) > + > + @$(call install_finish,blspec-stm32mp157c-dk2) > + > + @$(call touch) > + > +# vim: syntax=make > diff --git a/configs/platform-v7a/rules/image-stm32mp157c-dk2.make b/configs/platform-v7a/rules/image-stm32mp157c-dk2.make > new file mode 100644 > index 000000000000..d5e524646a50 > --- /dev/null > +++ b/configs/platform-v7a/rules/image-stm32mp157c-dk2.make > @@ -0,0 +1,38 @@ > +# -*-makefile-*- > +# > +# Copyright (C) 2017 by Sascha Hauer > +# > +# See CREDITS for details about who has contributed to this project. Leave these lines out, I just sent a patch for all other rules. - Roland > +# > +# For further information about the PTXdist project and license conditions > +# see the README file. > +# > + > +# > +# We provide this package > +# > +IMAGE_PACKAGES-$(PTXCONF_IMAGE_STM32MP157C_DK2) += image-stm32mp157c-dk2 > + > +IMAGE_STM32MP157C_DK2_ENV := \ > + STM32MP_BOARD=stm32mp157c-dk2 > + > +# > +# Paths and names > +# > +IMAGE_STM32MP157C_DK2 := image-stm32mp157c-dk2 > +IMAGE_STM32MP157C_DK2_DIR := $(BUILDDIR)/$(IMAGE_STM32MP157C_DK2) > +IMAGE_STM32MP157C_DK2_IMAGE := $(IMAGEDIR)/stm32mp157c-dk2.hdimg > +IMAGE_STM32MP157C_DK2_FILES := $(IMAGEDIR)/root.tgz > +IMAGE_STM32MP157C_DK2_CONFIG := stm32mp.config > + > +# ---------------------------------------------------------------------------- > +# Image > +# ---------------------------------------------------------------------------- > + > +$(IMAGE_STM32MP157C_DK2_IMAGE): > + @$(call targetinfo) > + @$(call image/genimage, IMAGE_STM32MP157C_DK2) > + @$(call finish) > + > +# vim: syntax=make > + > -- > 2.25.0 > > > _______________________________________________ > DistroKit mailing list > DistroKit@pengutronix.de > -- Roland Hieber, Pengutronix e.K. | r.hieber@pengutronix.de | Steuerwalder Str. 21 | https://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ DistroKit mailing list DistroKit@pengutronix.de