DistroKit Mailinglist
 help / color / mirror / Atom feed
From: Roland Hieber <rhi@pengutronix.de>
To: Ahmad Fatoum <a.fatoum@pengutronix.de>
Cc: distrokit@pengutronix.de
Subject: Re: [DistroKit] [PATCH 6/6] v7a: add stm32mp157c-dk2 SD-Card image
Date: Tue, 3 Mar 2020 13:08:10 +0100	[thread overview]
Message-ID: <20200303120810.tu63awt4yysdurap@pengutronix.de> (raw)
In-Reply-To: <20200302110356.19112-7-a.fatoum@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 <a.fatoum@pengutronix.de>
> ---
>  .../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 <s.hauer@pengutronix.de>
> +#
> +# 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 <s.hauer@pengutronix.de>")
> +	@$(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 <s.hauer@pengutronix.de>
> +#
> +# 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

  reply	other threads:[~2020-03-03 12:08 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-02 11:03 [DistroKit] [PATCH 0/6] v7a: add basic STM32MP157C-DK2 support Ahmad Fatoum
2020-03-02 11:03 ` [DistroKit] [PATCH 1/6] v7a: kernel: configure for STM32MP157 support Ahmad Fatoum
2020-03-05 16:43   ` Robert Schwebel
2020-03-02 11:03 ` [DistroKit] [PATCH 2/6] v7a: barebox: add new stm32mp rule Ahmad Fatoum
2020-03-03  9:43   ` Roland Hieber
2020-03-03  9:54     ` Ahmad Fatoum
2020-03-05 16:44   ` Robert Schwebel
2020-03-02 11:03 ` [DistroKit] [PATCH 3/6] rules: add ARM Trusted Firmware-A Ahmad Fatoum
2020-03-05 16:44   ` Robert Schwebel
2020-03-05 17:28     ` Robert Schwebel
2020-03-02 11:03 ` [DistroKit] [PATCH 4/6] v7a: stm32mp: enable TF-A for first stage Ahmad Fatoum
2020-03-05 16:45   ` Robert Schwebel
2020-03-02 11:03 ` [DistroKit] [PATCH 5/6] datapartition: disable autoformat of non-MBR Linux partitions Ahmad Fatoum
2020-03-05 16:45   ` Robert Schwebel
2020-03-02 11:03 ` [DistroKit] [PATCH 6/6] v7a: add stm32mp157c-dk2 SD-Card image Ahmad Fatoum
2020-03-03 12:08   ` Roland Hieber [this message]
2020-03-05 16:46     ` Robert Schwebel
2020-03-05 16:46   ` Robert Schwebel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200303120810.tu63awt4yysdurap@pengutronix.de \
    --to=rhi@pengutronix.de \
    --cc=a.fatoum@pengutronix.de \
    --cc=distrokit@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox