mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] ARM: stm32mp: phycore: register barebox update handlers
@ 2023-08-25 12:07 Ahmad Fatoum
  2023-09-04  9:07 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Ahmad Fatoum @ 2023-08-25 12:07 UTC (permalink / raw)
  To: barebox; +Cc: ejo, Ahmad Fatoum

We have barebox update handlers for updating barebox on SD (ssbl GPT
partition) and on eMMC boot partition (with or without TF-A).

Let's put them to use.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
Only build-tested. Waiting for ejo's Tested-by
---
 arch/arm/boards/phytec-phycore-stm32mp1/board.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boards/phytec-phycore-stm32mp1/board.c b/arch/arm/boards/phytec-phycore-stm32mp1/board.c
index 731880c3d16a..6b10ebbdb2e6 100644
--- a/arch/arm/boards/phytec-phycore-stm32mp1/board.c
+++ b/arch/arm/boards/phytec-phycore-stm32mp1/board.c
@@ -2,13 +2,22 @@
 #include <common.h>
 #include <driver.h>
 #include <bootsource.h>
+#include <mach/stm32mp/bbu.h>
 
 static int phycore_stm32mp1_probe(struct device *dev)
 {
-	if (bootsource_get_instance() == 0)
+	int sd_bbu_flags = 0, emmc_bbu_flags = 0;
+
+	if (bootsource_get_instance() == 0) {
 		of_device_enable_path("/chosen/environment-sd");
-	else
+		sd_bbu_flags = BBU_HANDLER_FLAG_DEFAULT; 
+	} else {
 		of_device_enable_path("/chosen/environment-emmc");
+		emmc_bbu_flags = BBU_HANDLER_FLAG_DEFAULT; 
+	}
+
+	stm32mp_bbu_mmc_register_handler("sd", "/dev/mmc0.ssbl", sd_bbu_flags);
+	stm32mp_bbu_mmc_fip_register("emmc", "/dev/mmc1", emmc_bbu_flags);
 
 	barebox_set_hostname("phyCORE-STM32MP1");
 
-- 
2.39.2




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

* Re: [PATCH] ARM: stm32mp: phycore: register barebox update handlers
  2023-08-25 12:07 [PATCH] ARM: stm32mp: phycore: register barebox update handlers Ahmad Fatoum
@ 2023-09-04  9:07 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2023-09-04  9:07 UTC (permalink / raw)
  To: Ahmad Fatoum; +Cc: barebox, ejo

On Fri, Aug 25, 2023 at 02:07:36PM +0200, Ahmad Fatoum wrote:
> We have barebox update handlers for updating barebox on SD (ssbl GPT
> partition) and on eMMC boot partition (with or without TF-A).
> 
> Let's put them to use.
> 
> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> ---
> Only build-tested. Waiting for ejo's Tested-by
> ---
>  arch/arm/boards/phytec-phycore-stm32mp1/board.c | 13 +++++++++++--
>  1 file changed, 11 insertions(+), 2 deletions(-)

Applied, thanks

Sascha

> 
> diff --git a/arch/arm/boards/phytec-phycore-stm32mp1/board.c b/arch/arm/boards/phytec-phycore-stm32mp1/board.c
> index 731880c3d16a..6b10ebbdb2e6 100644
> --- a/arch/arm/boards/phytec-phycore-stm32mp1/board.c
> +++ b/arch/arm/boards/phytec-phycore-stm32mp1/board.c
> @@ -2,13 +2,22 @@
>  #include <common.h>
>  #include <driver.h>
>  #include <bootsource.h>
> +#include <mach/stm32mp/bbu.h>
>  
>  static int phycore_stm32mp1_probe(struct device *dev)
>  {
> -	if (bootsource_get_instance() == 0)
> +	int sd_bbu_flags = 0, emmc_bbu_flags = 0;
> +
> +	if (bootsource_get_instance() == 0) {
>  		of_device_enable_path("/chosen/environment-sd");
> -	else
> +		sd_bbu_flags = BBU_HANDLER_FLAG_DEFAULT; 
> +	} else {
>  		of_device_enable_path("/chosen/environment-emmc");
> +		emmc_bbu_flags = BBU_HANDLER_FLAG_DEFAULT; 
> +	}
> +
> +	stm32mp_bbu_mmc_register_handler("sd", "/dev/mmc0.ssbl", sd_bbu_flags);
> +	stm32mp_bbu_mmc_fip_register("emmc", "/dev/mmc1", emmc_bbu_flags);
>  
>  	barebox_set_hostname("phyCORE-STM32MP1");
>  
> -- 
> 2.39.2
> 
> 
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



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

end of thread, other threads:[~2023-09-04  9:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-25 12:07 [PATCH] ARM: stm32mp: phycore: register barebox update handlers Ahmad Fatoum
2023-09-04  9:07 ` Sascha Hauer

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