On Fri, May 31, 2019 at 11:47:28AM +0200, Lucas Stach wrote: > While barebox itself should be on the eMMC boot partitions eventually > it's nice to have this set up, so one can dd a prebuilt SD card image > to the eMMC and have something working. A working Barebox env is also > very convinient to have around during development. > > Signed-off-by: Lucas Stach <l.stach@xxxxxxxxxxxxxx> > --- > arch/arm/boards/zii-imx8mq-dev/board.c | 6 +++++ > arch/arm/dts/imx8mq-zii-ultra.dtsi | 37 ++++++++++++++++++++++++++ > 2 files changed, 43 insertions(+) Applied, thanks Sascha > > diff --git a/arch/arm/boards/zii-imx8mq-dev/board.c b/arch/arm/boards/zii-imx8mq-dev/board.c > index 94e71f58ceb7..4dbe23f58ce2 100644 > --- a/arch/arm/boards/zii-imx8mq-dev/board.c > +++ b/arch/arm/boards/zii-imx8mq-dev/board.c > @@ -4,6 +4,7 @@ > * Author: Andrey Smirnov <andrew.smirnov@xxxxxxxxx> > */ > > +#include <bootsource.h> > #include <common.h> > #include <init.h> > #include <asm/memory.h> > @@ -19,6 +20,11 @@ static int zii_imx8mq_dev_init(void) > > imx8mq_bbu_internal_mmcboot_register_handler("eMMC", "/dev/mmc0", 0); > > + if (bootsource_get_instance() == 0) > + of_device_enable_path("/chosen/environment-emmc"); > + else > + of_device_enable_path("/chosen/environment-sd"); > + > return 0; > } > device_initcall(zii_imx8mq_dev_init); > diff --git a/arch/arm/dts/imx8mq-zii-ultra.dtsi b/arch/arm/dts/imx8mq-zii-ultra.dtsi > index ccf80d3de838..53679b0d3c40 100644 > --- a/arch/arm/dts/imx8mq-zii-ultra.dtsi > +++ b/arch/arm/dts/imx8mq-zii-ultra.dtsi > @@ -10,6 +10,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"; > + }; > }; > > mdio0: bitbang-mdio { > @@ -348,6 +359,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 { > @@ -358,6 +382,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>; > + }; > }; > > &iomuxc { > -- > 2.20.1 > > > _______________________________________________ > barebox mailing list > barebox@xxxxxxxxxxxxxxxxxxx > http://lists.infradead.org/mailman/listinfo/barebox > -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list barebox@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/barebox