diff options
author | Lucas Stach <l.stach@pengutronix.de> | 2018-11-06 18:42:54 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2018-11-09 08:21:57 +0100 |
commit | 5200ea0ff626ccf6602331ce9d0fe4ef6ab128ca (patch) | |
tree | b231875b3ea37dc031db63024f3761fa93121db2 /arch | |
parent | 5ac0ca4bc04fafa31de832cffb31ab3514c71b70 (diff) | |
download | barebox-5200ea0ff626ccf6602331ce9d0fe4ef6ab128ca.tar.gz barebox-5200ea0ff626ccf6602331ce9d0fe4ef6ab128ca.tar.xz |
ARM: nxp-imx8mq-evk: add barebox and env partitions
So we can have a persistent env and a bit safer barebox update. Also
switch the environment and update default depending on the bootsource,
as this is really helpful on an eval board where one might want to
have totally different systems on eMMC and SD card.
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Acked-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/boards/nxp-imx8mq-evk/board.c | 20 | ||||
-rw-r--r-- | arch/arm/dts/imx8mq-evk.dts | 37 |
2 files changed, 54 insertions, 3 deletions
diff --git a/arch/arm/boards/nxp-imx8mq-evk/board.c b/arch/arm/boards/nxp-imx8mq-evk/board.c index 7918b5fb3e..299d056e27 100644 --- a/arch/arm/boards/nxp-imx8mq-evk/board.c +++ b/arch/arm/boards/nxp-imx8mq-evk/board.c @@ -17,11 +17,12 @@ * */ +#include <asm/memory.h> +#include <bootsource.h> #include <common.h> #include <init.h> -#include <asm/memory.h> -#include <linux/sizes.h> #include <linux/phy.h> +#include <linux/sizes.h> #include <mach/bbu.h> #include <envfs.h> @@ -47,12 +48,25 @@ static int ar8031_phy_fixup(struct phy_device *phydev) static int nxp_imx8mq_evk_init(void) { + int flags; + if (!of_machine_is_compatible("fsl,imx8mq-evk")) return 0; barebox_set_hostname("imx8mq-evk"); - imx8mq_bbu_internal_mmc_register_handler("eMMC", "/dev/mmc0", 0); + flags = bootsource_get_instance() == 0 ? BBU_HANDLER_FLAG_DEFAULT : 0; + imx8mq_bbu_internal_mmc_register_handler("eMMC", + "/dev/mmc0.barebox", flags); + + flags = bootsource_get_instance() == 1 ? BBU_HANDLER_FLAG_DEFAULT : 0; + imx8mq_bbu_internal_mmc_register_handler("SD", + "/dev/mmc1.barebox", flags); + + if (bootsource_get_instance() == 0) + of_device_enable_path("/chosen/environment-emmc"); + else + of_device_enable_path("/chosen/environment-sd"); phy_register_fixup_for_uid(PHY_ID_AR8031, AR_PHY_ID_MASK, ar8031_phy_fixup); diff --git a/arch/arm/dts/imx8mq-evk.dts b/arch/arm/dts/imx8mq-evk.dts index a6e724e2e2..56a35173a0 100644 --- a/arch/arm/dts/imx8mq-evk.dts +++ b/arch/arm/dts/imx8mq-evk.dts @@ -15,6 +15,17 @@ chosen { stdout-path = &uart1; + + environment-emmc { + compatible = "barebox,environment"; + device-path = &usdhc1, "partname:barebox-environment"; + status = "disabled"; + }; + environment-sd { + compatible = "barebox,environment"; + device-path = &usdhc2, "partname:barebox-environment"; + status = "disabled"; + }; }; reg_usdhc2_vmmc: regulator-vsd-3v3 { @@ -177,6 +188,19 @@ no-sd; no-sdio; status = "okay"; + + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "barebox"; + reg = <0x0 0xe0000>; + }; + + partition@e0000 { + label = "barebox-environment"; + reg = <0xe0000 0x20000>; + }; }; &usdhc2 { @@ -190,6 +214,19 @@ cd-gpios = <&gpio2 12 GPIO_ACTIVE_LOW>; vmmc-supply = <®_usdhc2_vmmc>; status = "okay"; + + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "barebox"; + reg = <0x0 0xe0000>; + }; + + partition@e0000 { + label = "barebox-environment"; + reg = <0xe0000 0x20000>; + }; }; &wdog1 { |