DistroKit Mailinglist
 help / color / mirror / Atom feed
* [DistroKit] [PATCH 1/2] v7a: stm32mp: tf-a: enable boot from eMMC boot partition
@ 2023-12-13 16:50 Ahmad Fatoum
  2023-12-13 16:50 ` [DistroKit] [PATCH 2/2] v7a: images: stm32mp: generate eMMC boot partition image as well Ahmad Fatoum
  2023-12-13 17:23 ` [DistroKit] [PATCH 1/2] v7a: stm32mp: tf-a: enable boot from eMMC boot partition Robert Schwebel
  0 siblings, 2 replies; 3+ messages in thread
From: Ahmad Fatoum @ 2023-12-13 16:50 UTC (permalink / raw)
  To: distrokit; +Cc: Ahmad Fatoum

By default, TF-A located on eMMC boot partition will only boot
FIP from eMMC user area. Toggle STM32MP_EMMC_BOOT, so FIP image is first
looked for at offset 256K on the eMMC boot partition, before booting
from GPT partition in user area.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 configs/platform-v7a/platformconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configs/platform-v7a/platformconfig b/configs/platform-v7a/platformconfig
index 5516e1ae2b87..efc6618ffbd6 100644
--- a/configs/platform-v7a/platformconfig
+++ b/configs/platform-v7a/platformconfig
@@ -212,7 +212,7 @@ PTXCONF_TF_A_ARM_ARCH_MAJOR_7=y
 # PTXCONF_TF_A_ARM_ARCH_MAJOR_8_32_BIT is not set
 PTXCONF_TF_A_ARM_ARCH_MAJOR=7
 PTXCONF_TF_A_PLATFORMS="stm32mp1"
-PTXCONF_TF_A_EXTRA_ARGS="DTB_FILE_NAME='stm32mp157c-dk2.dtb stm32mp157c-ev1.dtb stm32mp157c-lxa-mc1.dtb' STM32MP_EMMC=1 STM32MP_SDMMC=1 STM32MP_USB_PROGRAMMER=1"
+PTXCONF_TF_A_EXTRA_ARGS="DTB_FILE_NAME='stm32mp157c-dk2.dtb stm32mp157c-ev1.dtb stm32mp157c-lxa-mc1.dtb' STM32MP_EMMC=1 STM32MP_SDMMC=1 STM32MP_USB_PROGRAMMER=1 STM32MP_EMMC_BOOT=1"
 PTXCONF_TF_A_ARTIFACTS="tf-a-*.stm32 bl32.bin fdts/*-fw-config.dtb fdts/*-bl32.dtb"
 
 #
-- 
2.39.2




^ permalink raw reply	[flat|nested] 3+ messages in thread

* [DistroKit] [PATCH 2/2] v7a: images: stm32mp: generate eMMC boot partition image as well
  2023-12-13 16:50 [DistroKit] [PATCH 1/2] v7a: stm32mp: tf-a: enable boot from eMMC boot partition Ahmad Fatoum
@ 2023-12-13 16:50 ` Ahmad Fatoum
  2023-12-13 17:23 ` [DistroKit] [PATCH 1/2] v7a: stm32mp: tf-a: enable boot from eMMC boot partition Robert Schwebel
  1 sibling, 0 replies; 3+ messages in thread
From: Ahmad Fatoum @ 2023-12-13 16:50 UTC (permalink / raw)
  To: distrokit; +Cc: Ahmad Fatoum

The DistroKit image is capable of booting both from SD-Card and eMMC
user area. For boot from eMMC boot partition, we can keep reusing the
same image for the user area, but need to place the boot firmware into
the boot partition as well. Add an extra image that does just that.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 .../platform-v7a/config/images/stm32mp.config | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/configs/platform-v7a/config/images/stm32mp.config b/configs/platform-v7a/config/images/stm32mp.config
index 58b9232d84a6..f75d6adc054a 100644
--- a/configs/platform-v7a/config/images/stm32mp.config
+++ b/configs/platform-v7a/config/images/stm32mp.config
@@ -4,6 +4,8 @@ image @IMAGE@ {
 		partition-table-type = gpt
 		gpt-no-backup = true
 	}
+
+	/* below three partitions are unused when booting from eMMC boot partition */
 	partition fsbl1 {
 		image = "stm32mp1-tf-a-@STM32MP_BOARD@.stm32"
 		size = 256K
@@ -16,6 +18,7 @@ image @IMAGE@ {
 		image = "@STM32MP_BOARD@.fip"
 		size = 1M
 	}
+
 	partition barebox-environment {
 		size = 1M
 	}
@@ -29,6 +32,22 @@ image @IMAGE@ {
 	}
 }
 
+image @STM32MP_BOARD@-emmcboot.img {
+	hdimage {
+		partition-table = false
+	}
+
+	partition fsbl {
+		image = "stm32mp1-tf-a-@STM32MP_BOARD@.stm32"
+		size = 256K
+	}
+
+	partition fip {
+		image = "@STM32MP_BOARD@.fip"
+		offset = 256K
+	}
+}
+
 image @STM32MP_BOARD@.fip {
 	fip {
 		fw-config = "stm32mp1-@STM32MP_BOARD@-fw-config.dtb"
-- 
2.39.2




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [DistroKit] [PATCH 1/2] v7a: stm32mp: tf-a: enable boot from eMMC boot partition
  2023-12-13 16:50 [DistroKit] [PATCH 1/2] v7a: stm32mp: tf-a: enable boot from eMMC boot partition Ahmad Fatoum
  2023-12-13 16:50 ` [DistroKit] [PATCH 2/2] v7a: images: stm32mp: generate eMMC boot partition image as well Ahmad Fatoum
@ 2023-12-13 17:23 ` Robert Schwebel
  1 sibling, 0 replies; 3+ messages in thread
From: Robert Schwebel @ 2023-12-13 17:23 UTC (permalink / raw)
  To: Ahmad Fatoum; +Cc: distrokit

Applied to next.

On Wed, Dec 13, 2023 at 05:50:14PM +0100, Ahmad Fatoum wrote:
> By default, TF-A located on eMMC boot partition will only boot
> FIP from eMMC user area. Toggle STM32MP_EMMC_BOOT, so FIP image is first
> looked for at offset 256K on the eMMC boot partition, before booting
> from GPT partition in user area.
> 
> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> ---
>  configs/platform-v7a/platformconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/configs/platform-v7a/platformconfig b/configs/platform-v7a/platformconfig
> index 5516e1ae2b87..efc6618ffbd6 100644
> --- a/configs/platform-v7a/platformconfig
> +++ b/configs/platform-v7a/platformconfig
> @@ -212,7 +212,7 @@ PTXCONF_TF_A_ARM_ARCH_MAJOR_7=y
>  # PTXCONF_TF_A_ARM_ARCH_MAJOR_8_32_BIT is not set
>  PTXCONF_TF_A_ARM_ARCH_MAJOR=7
>  PTXCONF_TF_A_PLATFORMS="stm32mp1"
> -PTXCONF_TF_A_EXTRA_ARGS="DTB_FILE_NAME='stm32mp157c-dk2.dtb stm32mp157c-ev1.dtb stm32mp157c-lxa-mc1.dtb' STM32MP_EMMC=1 STM32MP_SDMMC=1 STM32MP_USB_PROGRAMMER=1"
> +PTXCONF_TF_A_EXTRA_ARGS="DTB_FILE_NAME='stm32mp157c-dk2.dtb stm32mp157c-ev1.dtb stm32mp157c-lxa-mc1.dtb' STM32MP_EMMC=1 STM32MP_SDMMC=1 STM32MP_USB_PROGRAMMER=1 STM32MP_EMMC_BOOT=1"
>  PTXCONF_TF_A_ARTIFACTS="tf-a-*.stm32 bl32.bin fdts/*-fw-config.dtb fdts/*-bl32.dtb"
>  
>  #
> -- 
> 2.39.2
> 
> 
> 

-- 
Pengutronix e.K.                           | Dipl.-Ing. Robert Schwebel  |
Steuerwalder Str. 21                       | https://www.pengutronix.de/ |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-9    |



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-12-13 17:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-13 16:50 [DistroKit] [PATCH 1/2] v7a: stm32mp: tf-a: enable boot from eMMC boot partition Ahmad Fatoum
2023-12-13 16:50 ` [DistroKit] [PATCH 2/2] v7a: images: stm32mp: generate eMMC boot partition image as well Ahmad Fatoum
2023-12-13 17:23 ` [DistroKit] [PATCH 1/2] v7a: stm32mp: tf-a: enable boot from eMMC boot partition Robert Schwebel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox