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 <[email protected]>
---
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


Reply via email to