diff options
Diffstat (limited to 'arch/arm/boards/lxa-mc1/board.c')
-rw-r--r-- | arch/arm/boards/lxa-mc1/board.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/arch/arm/boards/lxa-mc1/board.c b/arch/arm/boards/lxa-mc1/board.c index 9126973dcb..8be265b0fc 100644 --- a/arch/arm/boards/lxa-mc1/board.c +++ b/arch/arm/boards/lxa-mc1/board.c @@ -3,8 +3,9 @@ #include <linux/sizes.h> #include <init.h> #include <asm/memory.h> -#include <mach/bbu.h> +#include <mach/stm32mp/bbu.h> #include <bootsource.h> +#include <deep-probe.h> #include <of.h> static int of_fixup_regulator_supply_disable(struct device_node *root, void *path) @@ -28,8 +29,9 @@ static int of_fixup_regulator_supply_disable(struct device_node *root, void *pat return 0; } -static int mc1_probe(struct device_d *dev) +static int mc1_probe(struct device *dev) { + struct device_node *state_node, *state_backend; int flags; flags = bootsource_get_instance() == 0 ? BBU_HANDLER_FLAG_DEFAULT : 0; @@ -39,10 +41,18 @@ static int mc1_probe(struct device_d *dev) stm32mp_bbu_mmc_register_handler("emmc", "/dev/mmc1.ssbl", flags); - if (bootsource_get_instance() == 0) + if (bootsource_get_instance() == 0) { of_device_enable_path("/chosen/environment-sd"); - else + state_backend = of_find_node_by_alias(NULL, "mmc0"); + } else { of_device_enable_path("/chosen/environment-emmc"); + state_backend = of_find_node_by_alias(NULL, "mmc1"); + } + + state_node = of_find_node_by_alias(NULL, "state"); + if (state_node) + of_property_write_u32(state_node, "backend", + of_node_create_phandle(state_backend)); barebox_set_hostname("lxa-mc1"); @@ -58,8 +68,9 @@ static const struct of_device_id mc1_of_match[] = { { .compatible = "lxa,stm32mp157c-mc1" }, { /* sentinel */ }, }; +BAREBOX_DEEP_PROBE_ENABLE(mc1_of_match); -static struct driver_d mc1_board_driver = { +static struct driver mc1_board_driver = { .name = "board-lxa-mc1", .probe = mc1_probe, .of_compatible = mc1_of_match, |