diff --git a/arch/arm/boards/phytec-som-imx6/board.c b/arch/arm/boards/phytec-som-imx6/board.c index cf50ad9..7301157 100644 --- a/arch/arm/boards/phytec-som-imx6/board.c +++ b/arch/arm/boards/phytec-som-imx6/board.c @@ -190,7 +190,8 @@ default_environment_path = "/chosen/environment-spinor"; default_envdev = "SPI NOR flash"; - } else if (of_machine_is_compatible("phytec,imx6ul-pcl063-nand")) { + } else if (of_machine_is_compatible("phytec,imx6ul-pcl063-nand") + || of_machine_is_compatible("phytec,imx6ul-pcl063-emmc")) { barebox_set_hostname("phyCORE-i.MX6UL"); default_environment_path = "/chosen/environment-nand"; default_envdev = "NAND flash"; @@ -236,6 +237,10 @@ imx6_bbu_internal_mmc_register_handler("mmc3", "/dev/mmc3", BBU_HANDLER_FLAG_DEFAULT); + } else if (of_machine_is_compatible("phytec,imx6ul-pcl063-emmc")) { + imx6_bbu_internal_mmc_register_handler("mmc1", + "/dev/mmc1", + BBU_HANDLER_FLAG_DEFAULT); } else { imx6_bbu_nand_register_handler("nand", BBU_HANDLER_FLAG_DEFAULT); } @@ -243,13 +248,20 @@ defaultenv_append_directory(defaultenv_physom_imx6); /* Overwrite file /env/init/automount */ - if (of_machine_is_compatible("phytec,imx6qp-pcm058-nand") + if (of_machine_is_compatible("phytec,imx6q-pfla02") + || of_machine_is_compatible("phytec,imx6dl-pfla02") + || of_machine_is_compatible("phytec,imx6s-pfla02") + || of_machine_is_compatible("phytec,imx6q-pcaaxl3")) { + defaultenv_append_directory(defaultenv_physom_imx6); + } else if (of_machine_is_compatible("phytec,imx6qp-pcm058-nand") || of_machine_is_compatible("phytec,imx6q-pcm058-nand") || of_machine_is_compatible("phytec,imx6q-pcm058-emmc") || of_machine_is_compatible("phytec,imx6dl-pcm058-nand") || of_machine_is_compatible("phytec,imx6dl-pcm058-emmc")) { + defaultenv_append_directory(defaultenv_physom_imx6); defaultenv_append_directory(defaultenv_physom_imx6_phycore); - } else if (of_machine_is_compatible("phytec,imx6ul-pcl063-nand")) { + } else if (of_machine_is_compatible("phytec,imx6ul-pcl063-nand") + || of_machine_is_compatible("phytec,imx6ul-pcl063-emmc")) { defaultenv_append_directory(defaultenv_physom_imx6ul_phycore); } diff --git a/arch/arm/boards/phytec-som-imx6/defaultenv-physom-imx6ul-phycore/boot/emmc b/arch/arm/boards/phytec-som-imx6/defaultenv-physom-imx6ul-phycore/boot/emmc new file mode 100644 index 0000000..15cba6f --- /dev/null +++ b/arch/arm/boards/phytec-som-imx6/defaultenv-physom-imx6ul-phycore/boot/emmc @@ -0,0 +1,5 @@ +#!/bin/sh + +global.bootm.image="/mnt/emmc/zImage" +global.bootm.oftree="/mnt/emmc/oftree" +global.linux.bootargs.dyn.root="root=/dev/mmcblk1p2 rootflags='discard,data=journal'" diff --git a/arch/arm/boards/phytec-som-imx6/defaultenv-physom-imx6ul-phycore/boot/mmc b/arch/arm/boards/phytec-som-imx6/defaultenv-physom-imx6ul-phycore/boot/mmc new file mode 100644 index 0000000..8de2efa --- /dev/null +++ b/arch/arm/boards/phytec-som-imx6/defaultenv-physom-imx6ul-phycore/boot/mmc @@ -0,0 +1,5 @@ +#!/bin/sh + +global.bootm.image="/mnt/mmc/zImage" +global.bootm.oftree="/mnt/mmc/oftree" +global.linux.bootargs.dyn.root="root=/dev/mmcblk0p2 rootflags='data=journal'" diff --git a/arch/arm/boards/phytec-som-imx6/defaultenv-physom-imx6ul-phycore/init/automount b/arch/arm/boards/phytec-som-imx6/defaultenv-physom-imx6ul-phycore/init/automount index 71d9086..36759de 100644 --- a/arch/arm/boards/phytec-som-imx6/defaultenv-physom-imx6ul-phycore/init/automount +++ b/arch/arm/boards/phytec-som-imx6/defaultenv-physom-imx6ul-phycore/init/automount @@ -7,3 +7,8 @@ mkdir -p /mnt/mmc automount -d /mnt/mmc 'mmc0.probe=1 && [ -e /dev/mmc0.0 ] && mount /dev/mmc0.0 /mnt/mmc' + +if [ -e /dev/mmc1 ]; then + mkdir -p /mnt/emmc + automount -d /mnt/emmc 'mmc1.probe=1 && [ -e /dev/mmc1.0 ] && mount /dev/mmc1.0 /mnt/emmc' +fi diff --git a/arch/arm/boards/phytec-som-imx6/defaultenv-physom-imx6ul-phycore/init/bootsource b/arch/arm/boards/phytec-som-imx6/defaultenv-physom-imx6ul-phycore/init/bootsource new file mode 100644 index 0000000..beb7afe --- /dev/null +++ b/arch/arm/boards/phytec-som-imx6/defaultenv-physom-imx6ul-phycore/init/bootsource @@ -0,0 +1,17 @@ +#!/bin/sh + +if [ -n "$nv.boot.default" ]; then + exit +fi + +if [ $bootsource = mmc ]; then + if [ $bootsource_instance = 0 ]; then + global.boot.default="mmc emmc nand spi net" + elif [ $bootsource_instance = 1 ]; then + global.boot.default="emmc mmc nand spi net" + fi +elif [ $bootsource = nand ]; then + global.boot.default="nand spi mmc net" +elif [ $bootsource = net ]; then + global.boot.default="net nand spi mmc" +fi