[PATCH 7/9] ARM: boards: protonic-rk356x: Move bbu setup to device late init
Robin van der Gracht
robin.van.der.gracht at protonic.nl
Wed Mar 4 03:00:11 PST 2026
Move bbu setup to a separate function and call it from the devices_init
late initcall.
Signed-off-by: Robin van der Gracht <robin.van.der.gracht at protonic.nl>
---
arch/arm/boards/protonic-rk356x/board.c | 26 +++++++++++++++----------
1 file changed, 16 insertions(+), 10 deletions(-)
diff --git a/arch/arm/boards/protonic-rk356x/board.c b/arch/arm/boards/protonic-rk356x/board.c
index 1d707bb715..5fba0be98a 100644
--- a/arch/arm/boards/protonic-rk356x/board.c
+++ b/arch/arm/boards/protonic-rk356x/board.c
@@ -123,10 +123,26 @@ static int prt_rk356x_mecsbc_init(void)
return 0;
}
+static void prt_rk356x_bbu(void)
+{
+ enum bootsource bootsource = bootsource_get();
+ int instance = bootsource_get_instance();
+
+ if (bootsource == BOOTSOURCE_MMC && instance == 1)
+ of_device_enable_path("/chosen/environment-sd");
+ else
+ of_device_enable_path("/chosen/environment-emmc");
+
+ rockchip_bbu_mmc_register("emmc", BBU_HANDLER_FLAG_DEFAULT, "/dev/mmc0");
+ rockchip_bbu_mmc_register("sd", 0, "/dev/mmc1");
+}
+
static int prt_rk356x_devices_init(void)
{
int ret;
+ prt_rk356x_bbu();
+
if (prt_priv.model->init) {
ret = prt_priv.model->init();
if (ret) {
@@ -157,8 +173,6 @@ static int prt_rk356x_of_fixup_hwrev(struct device *dev)
static int prt_rk356x_probe(struct device *dev)
{
int error;
- enum bootsource bootsource = bootsource_get();
- int instance = bootsource_get_instance();
const struct prt_rk356x_model *model;
error = of_device_ensure_probed_by_alias("saradc");
@@ -172,14 +186,6 @@ static int prt_rk356x_probe(struct device *dev)
barebox_set_model(model->name);
barebox_set_hostname(model->shortname);
- if (bootsource == BOOTSOURCE_MMC && instance == 1)
- of_device_enable_path("/chosen/environment-sd");
- else
- of_device_enable_path("/chosen/environment-emmc");
-
- rockchip_bbu_mmc_register("emmc", BBU_HANDLER_FLAG_DEFAULT, "/dev/mmc0");
- rockchip_bbu_mmc_register("sd", 0, "/dev/mmc1");
-
prt_rk356x_process_adc(dev, &model->adc_channels);
prt_rk356x_of_fixup_hwrev(dev);
--
2.43.0
More information about the barebox
mailing list