diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2019-07-12 07:10:18 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2019-07-12 07:10:18 +0200 |
commit | e4b6fc41713549a214081f8a0c3a5dbf787a4ac4 (patch) | |
tree | b5f53cc08c39bfe6d3a6e9f934bcdd28e465f795 | |
parent | 3ec7fca4c8ea7b993588d86d3817f30a62f32518 (diff) | |
parent | ba660c39331500be4b0da9579dac8b13344fd197 (diff) | |
download | barebox-e4b6fc41713549a214081f8a0c3a5dbf787a4ac4.tar.gz barebox-e4b6fc41713549a214081f8a0c3a5dbf787a4ac4.tar.xz |
Merge branch 'for-next/imx'
27 files changed, 596 insertions, 134 deletions
diff --git a/arch/arm/boards/phytec-som-imx6/board.c b/arch/arm/boards/phytec-som-imx6/board.c index d808517975..730115702b 100644 --- a/arch/arm/boards/phytec-som-imx6/board.c +++ b/arch/arm/boards/phytec-som-imx6/board.c @@ -190,7 +190,8 @@ static int physom_imx6_devices_init(void) default_environment_path = "/chosen/environment-spinor"; default_envdev = "SPI NOR flash"; - } else if (of_machine_is_compatible("phytec,imx6ul-pcl063")) { + } 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 @@ static int physom_imx6_devices_init(void) 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 @@ static int physom_imx6_devices_init(void) 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")) { + } 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 0000000000..15cba6f5ac --- /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 0000000000..8de2efa997 --- /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 71d9086582..36759de7c6 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 @@ automount /mnt/tftp 'ifup eth0 && mount -t tftp $eth0.serverip /mnt/tftp' 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 0000000000..beb7afe9c2 --- /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 diff --git a/arch/arm/boards/phytec-som-imx6/lowlevel.c b/arch/arm/boards/phytec-som-imx6/lowlevel.c index 915534ea94..07bb0ed1b5 100644 --- a/arch/arm/boards/phytec-som-imx6/lowlevel.c +++ b/arch/arm/boards/phytec-som-imx6/lowlevel.c @@ -109,13 +109,16 @@ PHYTEC_ENTRY(start_phytec_phyboard_subra_512mb_1bank, imx6dl_phytec_phyboard_sub PHYTEC_ENTRY(start_phytec_phyboard_subra_1gib_1bank, imx6q_phytec_phyboard_subra, SZ_1G, false); PHYTEC_ENTRY(start_phytec_phycore_imx6dl_som_nand_256mb, imx6dl_phytec_phycore_som_nand, SZ_256M, true); +PHYTEC_ENTRY(start_phytec_phycore_imx6dl_som_lc_nand_256mb, imx6dl_phytec_phycore_som_lc_nand, SZ_256M, true); PHYTEC_ENTRY(start_phytec_phycore_imx6dl_som_nand_1gib, imx6dl_phytec_phycore_som_nand, SZ_1G, true); PHYTEC_ENTRY(start_phytec_phycore_imx6dl_som_emmc_1gib, imx6dl_phytec_phycore_som_emmc, SZ_1G, true); +PHYTEC_ENTRY(start_phytec_phycore_imx6dl_som_lc_emmc_1gib, imx6dl_phytec_phycore_som_lc_emmc, SZ_1G, true); PHYTEC_ENTRY(start_phytec_phycore_imx6q_som_nand_1gib, imx6q_phytec_phycore_som_nand, SZ_1G, true); PHYTEC_ENTRY(start_phytec_phycore_imx6qp_som_nand_1gib, imx6qp_phytec_phycore_som_nand, SZ_1G, true); PHYTEC_ENTRY(start_phytec_phycore_imx6q_som_emmc_1gib, imx6q_phytec_phycore_som_emmc, SZ_1G, true); PHYTEC_ENTRY(start_phytec_phycore_imx6q_som_emmc_2gib, imx6q_phytec_phycore_som_emmc, SZ_2G, true); -PHYTEC_ENTRY(start_phytec_phycore_imx6ul_som_512mb, imx6ul_phytec_phycore_som, SZ_512M, false); -PHYTEC_ENTRY(start_phytec_phycore_imx6ull_som_lc_256mb, imx6ull_phytec_phycore_som_lc, SZ_256M, false); -PHYTEC_ENTRY(start_phytec_phycore_imx6ull_som_512mb, imx6ull_phytec_phycore_som, SZ_512M, false); +PHYTEC_ENTRY(start_phytec_phycore_imx6ul_som_nand_512mb, imx6ul_phytec_phycore_som_nand, SZ_512M, false); +PHYTEC_ENTRY(start_phytec_phycore_imx6ull_som_lc_nand_256mb, imx6ull_phytec_phycore_som_lc_nand, SZ_256M, false); +PHYTEC_ENTRY(start_phytec_phycore_imx6ull_som_nand_512mb, imx6ull_phytec_phycore_som_nand, SZ_512M, false); +PHYTEC_ENTRY(start_phytec_phycore_imx6ull_som_emmc_512mb, imx6ull_phytec_phycore_som_emmc, SZ_512M, false); diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile index 561653930b..87ddc57b89 100644 --- a/arch/arm/dts/Makefile +++ b/arch/arm/dts/Makefile @@ -63,10 +63,13 @@ pbl-dtb-$(CONFIG_MACH_PHYTEC_SOM_IMX6) += imx6q-phytec-pbaa03.dtb.o \ imx6q-phytec-phycore-som-emmc.dtb.o \ imx6qp-phytec-phycore-som-nand.dtb.o \ imx6dl-phytec-phycore-som-nand.dtb.o \ + imx6dl-phytec-phycore-som-lc-nand.dtb.o \ imx6dl-phytec-phycore-som-emmc.dtb.o \ - imx6ul-phytec-phycore-som.dtb.o \ - imx6ull-phytec-phycore-som-lc.dtb.o \ - imx6ull-phytec-phycore-som.dtb.o + imx6dl-phytec-phycore-som-lc-emmc.dtb.o \ + imx6ul-phytec-phycore-som-nand.dtb.o \ + imx6ull-phytec-phycore-som-lc-nand.dtb.o \ + imx6ull-phytec-phycore-som-nand.dtb.o \ + imx6ull-phytec-phycore-som-emmc.dtb.o pbl-dtb-$(CONFIG_MACH_PHYTEC_PHYCORE_IMX7) += imx7d-phyboard-zeta.dtb.o pbl-dtb-$(CONFIG_MACH_PHYTEC_SOM_IMX8MQ) += imx8mq-phytec-phycore-som.dtb.o pbl-dtb-$(CONFIG_MACH_PLATHOME_OPENBLOCKS_AX3) += armada-xp-openblocks-ax3-4-bb.dtb.o diff --git a/arch/arm/dts/imx6dl-phytec-phycore-som-emmc.dts b/arch/arm/dts/imx6dl-phytec-phycore-som-emmc.dts index e602b77e99..21cbb5f944 100644 --- a/arch/arm/dts/imx6dl-phytec-phycore-som-emmc.dts +++ b/arch/arm/dts/imx6dl-phytec-phycore-som-emmc.dts @@ -15,6 +15,7 @@ #include <arm/imx6dl.dtsi> #include "imx6dl.dtsi" #include "imx6qdl-phytec-phycore-som.dtsi" +#include "imx6qdl-phytec-state.dtsi" / { model = "Phytec phyCORE-i.MX6 DualLite/SOLO with eMMC"; @@ -30,7 +31,7 @@ }; ðphy { - max-speed = <100>; + max-speed = <1000>; }; &fec { diff --git a/arch/arm/dts/imx6dl-phytec-phycore-som-lc-emmc.dts b/arch/arm/dts/imx6dl-phytec-phycore-som-lc-emmc.dts new file mode 100644 index 0000000000..b8efb95ee0 --- /dev/null +++ b/arch/arm/dts/imx6dl-phytec-phycore-som-lc-emmc.dts @@ -0,0 +1,66 @@ +// SPDX-License-Identifier: (GPL-2.0-or-later OR MIT) +/* + * Copyright (C) 2019 PHYTEC Messtechnik GmbH, + * Author: Stefan Riedmueller <s.riedmueller@phytec.de> + */ + +/dts-v1/; + +#include <arm/imx6dl.dtsi> +#include "imx6dl.dtsi" +#include "imx6qdl-phytec-phycore-som.dtsi" +#include "imx6qdl-phytec-state.dtsi" + +/ { + model = "PHYTEC phyCORE-i.MX6 DualLite/SOLO with eMMC low-cost"; + compatible = "phytec,imx6dl-pcm058-emmc", "fsl,imx6dl"; +}; + +&ecspi1 { + status = "okay"; +}; + +&eeprom { + status = "okay"; +}; + +ðphy { + max-speed = <100>; +}; + +&fec { + status = "okay"; +}; + +&flash { + status = "okay"; +}; + +&usbh1 { + status = "okay"; +}; + +&usbotg { + status = "okay"; +}; + +&usdhc1 { + status = "okay"; + + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "barebox"; + reg = <0x0 0xe0000>; + }; + + partition@e0000 { + label = "barebox-environment"; + reg = <0xe0000 0x20000>; + }; +}; + +&usdhc4 { + status = "okay"; +}; diff --git a/arch/arm/dts/imx6dl-phytec-phycore-som-lc-nand.dts b/arch/arm/dts/imx6dl-phytec-phycore-som-lc-nand.dts new file mode 100644 index 0000000000..4d38d1698a --- /dev/null +++ b/arch/arm/dts/imx6dl-phytec-phycore-som-lc-nand.dts @@ -0,0 +1,58 @@ +// SPDX-License-Identifier: (GPL-2.0-or-later OR MIT) +/* + * Copyright (C) 2019 PHYTEC Messtechnik GmbH, + * Author: Stefan Riedmueller <s.riedmueller@phytec.de> + */ + +/dts-v1/; + +#include <arm/imx6dl.dtsi> +#include "imx6dl.dtsi" +#include "imx6qdl-phytec-phycore-som.dtsi" +#include "imx6qdl-phytec-state.dtsi" + +/ { + model = "PHYTEC phyCORE-i.MX6 Duallite/SOLO with NAND low-cost"; + compatible = "phytec,imx6dl-pcm058-nand", "fsl,imx6dl"; +}; + +&eeprom { + status = "okay"; +}; + +ðphy { + max-speed = <100>; +}; + +&fec { + status = "okay"; +}; + +&gpmi { + status = "okay"; +}; + +&usbh1 { + status = "okay"; +}; + +&usbotg { + status = "okay"; +}; + +&usdhc1 { + status = "okay"; + + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "barebox"; + reg = <0x0 0xe0000>; + }; + + partition@e0000 { + label = "barebox-environment"; + reg = <0xe0000 0x20000>; + }; +}; diff --git a/arch/arm/dts/imx6dl-phytec-phycore-som-nand.dts b/arch/arm/dts/imx6dl-phytec-phycore-som-nand.dts index 77f143438b..3ad3723d28 100644 --- a/arch/arm/dts/imx6dl-phytec-phycore-som-nand.dts +++ b/arch/arm/dts/imx6dl-phytec-phycore-som-nand.dts @@ -14,6 +14,7 @@ #include <arm/imx6dl.dtsi> #include "imx6dl.dtsi" #include "imx6qdl-phytec-phycore-som.dtsi" +#include "imx6qdl-phytec-state.dtsi" / { model = "Phytec phyCORE-i.MX6 Duallite/SOLO with NAND"; @@ -25,7 +26,7 @@ }; ðphy { - max-speed = <100>; + max-speed = <1000>; }; &fec { diff --git a/arch/arm/dts/imx6q-phytec-phycore-som-emmc.dts b/arch/arm/dts/imx6q-phytec-phycore-som-emmc.dts index 94a70389f0..7a86d5b94d 100644 --- a/arch/arm/dts/imx6q-phytec-phycore-som-emmc.dts +++ b/arch/arm/dts/imx6q-phytec-phycore-som-emmc.dts @@ -14,6 +14,7 @@ #include <arm/imx6q.dtsi> #include "imx6q.dtsi" #include "imx6qdl-phytec-phycore-som.dtsi" +#include "imx6qdl-phytec-state.dtsi" / { model = "Phytec phyCORE-i.MX6 Quad with eMMC"; diff --git a/arch/arm/dts/imx6q-phytec-phycore-som-nand.dts b/arch/arm/dts/imx6q-phytec-phycore-som-nand.dts index 6d82ec34d6..96d1de224c 100644 --- a/arch/arm/dts/imx6q-phytec-phycore-som-nand.dts +++ b/arch/arm/dts/imx6q-phytec-phycore-som-nand.dts @@ -14,6 +14,7 @@ #include <arm/imx6q.dtsi> #include "imx6q.dtsi" #include "imx6qdl-phytec-phycore-som.dtsi" +#include "imx6qdl-phytec-state.dtsi" / { model = "Phytec phyCORE-i.MX6 Quad with NAND"; diff --git a/arch/arm/dts/imx6qdl-phytec-phycore-som.dtsi b/arch/arm/dts/imx6qdl-phytec-phycore-som.dtsi index 8fde27bd0c..1d39368165 100644 --- a/arch/arm/dts/imx6qdl-phytec-phycore-som.dtsi +++ b/arch/arm/dts/imx6qdl-phytec-phycore-som.dtsi @@ -110,6 +110,7 @@ phy-handle = <ðphy>; phy-mode = "rgmii"; phy-reset-gpios = <&gpio1 14 GPIO_ACTIVE_LOW>; + phy-reset-duration = <10>; /* in msecs */ status = "disabled"; mdio { diff --git a/arch/arm/dts/imx6qdl-phytec-state.dtsi b/arch/arm/dts/imx6qdl-phytec-state.dtsi new file mode 100644 index 0000000000..1522b92be1 --- /dev/null +++ b/arch/arm/dts/imx6qdl-phytec-state.dtsi @@ -0,0 +1,82 @@ +// SPDX-License-Identifier: (GPL-2.0-or-later OR MIT) +/* + * Copyright (C) 2019 PHYTEC Messtechnik GmbH, + * Author: Daniel Schultz <d.schultz@phytec.de> + */ + +/ { + aliases { + state = &state; + }; + + state: imx6qdl_phytec_boot_state { + magic = <0x883b86a6>; + compatible = "barebox,state"; + backend-type = "raw"; + backend = <&backend_update_eeprom>; + backend-storage-type = "direct"; + backend-stridesize = <54>; + + #address-cells = <1>; + #size-cells = <1>; + bootstate { + #address-cells = <1>; + #size-cells = <1>; + last_chosen { + reg = <0x0 0x4>; + type = "uint32"; + }; + system0 { + #address-cells = <1>; + #size-cells = <1>; + remaining_attempts { + reg = <0x4 0x4>; + type = "uint32"; + default = <3>; + }; + priority { + reg = <0x8 0x4>; + type = "uint32"; + default = <21>; + }; + ok { + reg = <0xc 0x4>; + type = "uint32"; + default = <0>; + }; + }; + system1 { + #address-cells = <1>; + #size-cells = <1>; + remaining_attempts { + reg = <0x10 0x4>; + type = "uint32"; + default = <3>; + }; + priority { + reg = <0x14 0x4>; + type = "uint32"; + default = <20>; + }; + ok { + reg = <0x18 0x4>; + type = "uint32"; + default = <0>; + }; + }; + }; + }; +}; + +&eeprom { + status = "okay"; + partitions { + compatible = "fixed-partitions"; + #size-cells = <1>; + #address-cells = <1>; + backend_update_eeprom: state@0 { + reg = <0x0 0x100>; + label = "update-eeprom"; + }; + }; +}; diff --git a/arch/arm/dts/imx6ul-phytec-phycore-som-nand.dts b/arch/arm/dts/imx6ul-phytec-phycore-som-nand.dts new file mode 100644 index 0000000000..67478e26dc --- /dev/null +++ b/arch/arm/dts/imx6ul-phytec-phycore-som-nand.dts @@ -0,0 +1,48 @@ +// SPDX-License-Identifier: (GPL-2.0-or-later OR MIT) +/* + * Copyright (C) 2019 PHYTEC Messtechnik GmbH + * Author: Christian Hemp <c.hemp@phytec.de> + */ + +/dts-v1/; + +#include <arm/imx6ul.dtsi> +#include "imx6ul-phytec-phycore-som.dtsi" +#include "imx6ul-phytec-state.dtsi" + +/ { + model = "PHYTEC phyCORE-i.MX6 Ultra Lite SOM with NAND"; + compatible = "phytec,imx6ul-pcl063-nand", "fsl,imx6ul"; +}; + +&fec1 { + status = "okay"; +}; + +&gpmi { + status = "okay"; +}; + +&i2c1 { + status = "okay"; +}; + +&state { + status = "okay"; +}; + +&uart1 { + status = "okay"; +}; + +&usdhc1 { + status = "okay"; +}; + +&usbotg1 { + status = "okay"; +}; + +&usbotg2 { + status = "okay"; +}; diff --git a/arch/arm/dts/imx6ul-phytec-phycore-som.dts b/arch/arm/dts/imx6ul-phytec-phycore-som.dts deleted file mode 100644 index 6d1876702d..0000000000 --- a/arch/arm/dts/imx6ul-phytec-phycore-som.dts +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (C) 2016 PHYTEC Messtechnik GmbH - * Author: Christian Hemp <c.hemp@phytec.de> - * - * The code contained herein is licensed under the GNU General Public - * License. You may obtain a copy of the GNU General Public License - * Version 2 or later at the following locations: - * - * http://www.opensource.org/licenses/gpl-license.html - * http://www.gnu.org/copyleft/gpl.html - */ - -/dts-v1/; - -#include <arm/imx6ul.dtsi> -#include "imx6ul-phytec-phycore-som.dtsi" - -/ { - model = "Phytec phyCORE-i.MX6 Ultra Lite SOM"; - compatible = "phytec,imx6ul-pcl063", "fsl,imx6ul"; -}; - -&fec1 { - status = "okay"; -}; - -&gpmi { - status = "okay"; -}; - -&i2c1 { - status = "okay"; -}; - -&uart1 { - status = "okay"; -}; - -&usdhc1 { - status = "okay"; -}; - -&usbotg1 { - status = "okay"; -}; - -&usbotg2 { - status = "okay"; -}; diff --git a/arch/arm/dts/imx6ul-phytec-phycore-som.dtsi b/arch/arm/dts/imx6ul-phytec-phycore-som.dtsi index 964f91950d..c7c657bcd4 100644 --- a/arch/arm/dts/imx6ul-phytec-phycore-som.dtsi +++ b/arch/arm/dts/imx6ul-phytec-phycore-som.dtsi @@ -25,6 +25,12 @@ device-path = &usdhc1, "partname:barebox-environment"; status = "disabled"; }; + + environment-sd2 { + compatible = "barebox,environment"; + device-path = &usdhc2, "partname:barebox-environment"; + status = "disabled"; + }; }; }; @@ -79,7 +85,7 @@ clock-frequency = <100000>; status = "disabled"; - eeprom@52 { + eeprom: eeprom@52 { compatible = "cat,24c32"; reg = <0x52>; }; @@ -125,6 +131,27 @@ }; }; +&usdhc2 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_usdhc2>; + bus-width = <8>; + non-removable; + status = "disabled"; + + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "barebox"; + reg = <0x0 0xe0000>; + }; + + partition@e0000 { + label = "barebox-environment"; + reg = <0xe0000 0x20000>; + }; +}; + &iomuxc { pinctrl-names = "default"; @@ -132,16 +159,16 @@ pinctrl_enet1: enet1grp { fsl,pins = < - MX6UL_PAD_GPIO1_IO07__ENET1_MDC 0x1b0b0 - MX6UL_PAD_GPIO1_IO06__ENET1_MDIO 0x1b0b0 + MX6UL_PAD_GPIO1_IO07__ENET1_MDC 0x10010 + MX6UL_PAD_GPIO1_IO06__ENET1_MDIO 0x10010 MX6UL_PAD_ENET1_RX_EN__ENET1_RX_EN 0x1b0b0 MX6UL_PAD_ENET1_RX_ER__ENET1_RX_ER 0x1b0b0 MX6UL_PAD_ENET1_RX_DATA0__ENET1_RDATA00 0x1b0b0 MX6UL_PAD_ENET1_RX_DATA1__ENET1_RDATA01 0x1b0b0 - MX6UL_PAD_ENET1_TX_EN__ENET1_TX_EN 0x1b0b0 - MX6UL_PAD_ENET1_TX_DATA0__ENET1_TDATA00 0x1b0b0 - MX6UL_PAD_ENET1_TX_DATA1__ENET1_TDATA01 0x1b0b0 - MX6UL_PAD_ENET1_TX_CLK__ENET1_REF_CLK1 0x4001b031 + MX6UL_PAD_ENET1_TX_EN__ENET1_TX_EN 0x1b010 + MX6UL_PAD_ENET1_TX_DATA0__ENET1_TDATA00 0x1b010 + MX6UL_PAD_ENET1_TX_DATA1__ENET1_TDATA01 0x1b010 + MX6UL_PAD_ENET1_TX_CLK__ENET1_REF_CLK1 0x4001b010 >; }; @@ -196,6 +223,21 @@ MX6UL_PAD_UART1_RTS_B__GPIO1_IO19 0x17059 /* SD1 CD */ >; }; + + pinctrl_usdhc2: usdhc2grp { + fsl,pins = < + MX6UL_PAD_NAND_WE_B__USDHC2_CMD 0x17059 + MX6UL_PAD_NAND_RE_B__USDHC2_CLK 0x10059 + MX6UL_PAD_NAND_DATA00__USDHC2_DATA0 0x17059 + MX6UL_PAD_NAND_DATA01__USDHC2_DATA1 0x17059 + MX6UL_PAD_NAND_DATA02__USDHC2_DATA2 0x17059 + MX6UL_PAD_NAND_DATA03__USDHC2_DATA3 0x17059 + MX6UL_PAD_NAND_DATA04__USDHC2_DATA4 0x17059 + MX6UL_PAD_NAND_DATA05__USDHC2_DATA5 0x17059 + MX6UL_PAD_NAND_DATA06__USDHC2_DATA6 0x17059 + MX6UL_PAD_NAND_DATA07__USDHC2_DATA7 0x17059 + >; + }; }; }; diff --git a/arch/arm/dts/imx6ul-phytec-state.dtsi b/arch/arm/dts/imx6ul-phytec-state.dtsi new file mode 100644 index 0000000000..78a32ed96b --- /dev/null +++ b/arch/arm/dts/imx6ul-phytec-state.dtsi @@ -0,0 +1,82 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/* + * Copyright (C) 2019 PHYTEC Messtechnik GmbH, + * Author: Stefan Riedmueller <s.riedmueller@phytec.de> + */ + +/ { + aliases { + state = &state; + }; + + state: imx6ul_phytec_boot_state { + magic = <0x883b86a6>; + compatible = "barebox,state"; + backend-type = "raw"; + backend = <&backend_update_eeprom>; + backend-storage-type = "direct"; + backend-stridesize = <54>; + status = "disabled"; + + #address-cells = <1>; + #size-cells = <1>; + bootstate { + #address-cells = <1>; + #size-cells = <1>; + last_chosen { + reg = <0x0 0x4>; + type = "uint32"; + }; + system0 { + #address-cells = <1>; + #size-cells = <1>; + remaining_attempts { + reg = <0x4 0x4>; + type = "uint32"; + default = <3>; + }; + priority { + reg = <0x8 0x4>; + type = "uint32"; + default = <21>; + }; + ok { + reg = <0xc 0x4>; + type = "uint32"; + default = <0>; + }; + }; + system1 { + #address-cells = <1>; + #size-cells = <1>; + remaining_attempts { + reg = <0x10 0x4>; + type = "uint32"; + default = <3>; + }; + priority { + reg = <0x14 0x4>; + type = "uint32"; + default = <20>; + }; + ok { + reg = <0x18 0x4>; + type = "uint32"; + default = <0>; + }; + }; + }; + }; +}; + +&eeprom { + partitions { + compatible = "fixed-partitions"; + #size-cells = <1>; + #address-cells = <1>; + backend_update_eeprom: state@0 { + reg = <0x0 0x100>; + label = "update-eeprom"; + }; + }; +}; diff --git a/arch/arm/dts/imx6ull-phytec-phycore-som-emmc.dts b/arch/arm/dts/imx6ull-phytec-phycore-som-emmc.dts new file mode 100644 index 0000000000..aa162cc42d --- /dev/null +++ b/arch/arm/dts/imx6ull-phytec-phycore-som-emmc.dts @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: (GPL-2.0-or-later OR MIT) +/* + * Copyright (C) 2019 PHYTEC Messtechnik GmbH + * Author: Stefan Riedmueller <s.riedmueller@phytec.de> + */ + +/dts-v1/; + +#include <arm/imx6ull.dtsi> +#include "imx6ul-phytec-phycore-som.dtsi" + +/ { + model = "PHYTEC phyCORE-i.MX6 ULL SOM with eMMC"; + compatible = "phytec,imx6ul-pcl063-emmc", "fsl,imx6ull"; +}; + +&fec1 { + status = "okay"; +}; + +&i2c1 { + status = "okay"; +}; + +&uart1 { + status = "okay"; +}; + +&usdhc1 { + status = "okay"; +}; + +&usdhc2 { + status = "okay"; +}; + +&usbotg1 { + status = "okay"; +}; + +&usbotg2 { + status = "okay"; +}; diff --git a/arch/arm/dts/imx6ull-phytec-phycore-som-lc.dts b/arch/arm/dts/imx6ull-phytec-phycore-som-lc-nand.dts index 94a7830756..e6c588b449 100644 --- a/arch/arm/dts/imx6ull-phytec-phycore-som-lc.dts +++ b/arch/arm/dts/imx6ull-phytec-phycore-som-lc-nand.dts @@ -1,6 +1,6 @@ // SPDX-License-Identifier: (GPL-2.0-or-later OR MIT) /* - * Copyright (C) 2018 PHYTEC Messtechnik GmbH + * Copyright (C) 2019 PHYTEC Messtechnik GmbH * Author: Stefan Riedmueller <s.riedmueller@phytec.de> */ @@ -10,8 +10,8 @@ #include "imx6ul-phytec-phycore-som.dtsi" / { - model = "Phytec phyCORE-i.MX6 ULL SOM low-cost"; - compatible = "phytec,imx6ul-pcl063", "fsl,imx6ull"; + model = "PHYTEC phyCORE-i.MX6 ULL SOM low-cost with NAND"; + compatible = "phytec,imx6ul-pcl063-nand", "fsl,imx6ull"; }; &fec1 { diff --git a/arch/arm/dts/imx6ull-phytec-phycore-som-nand.dts b/arch/arm/dts/imx6ull-phytec-phycore-som-nand.dts new file mode 100644 index 0000000000..a5fa3e051c --- /dev/null +++ b/arch/arm/dts/imx6ull-phytec-phycore-som-nand.dts @@ -0,0 +1,48 @@ +// SPDX-License-Identifier: (GPL-2.0-or-later OR MIT) +/* + * Copyright (C) 2019 PHYTEC Messtechnik GmbH + * Author: Stefan Riedmueller <s.riedmueller@phytec.de> + */ + +/dts-v1/; + +#include <arm/imx6ull.dtsi> +#include "imx6ul-phytec-phycore-som.dtsi" +#include "imx6ul-phytec-state.dtsi" + +/ { + model = "PHYTEC phyCORE-i.MX6 ULL SOM with NAND"; + compatible = "phytec,imx6ul-pcl063-nand", "fsl,imx6ull"; +}; + +&fec1 { + status = "okay"; +}; + +&gpmi { + status = "okay"; +}; + +&i2c1 { + status = "okay"; +}; + +&state { + status = "okay"; +}; + +&uart1 { + status = "okay"; +}; + +&usdhc1 { + status = "okay"; +}; + +&usbotg1 { + status = "okay"; +}; + +&usbotg2 { + status = "okay"; +}; diff --git a/arch/arm/dts/imx6ull-phytec-phycore-som.dts b/arch/arm/dts/imx6ull-phytec-phycore-som.dts deleted file mode 100644 index 4d73010131..0000000000 --- a/arch/arm/dts/imx6ull-phytec-phycore-som.dts +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (C) 2017 PHYTEC Messtechnik GmbH - * Author: Stefan Riedmueller <s.riedmueller@phytec.de> - * - * The code contained herein is licensed under the GNU General Public - * License. You may obtain a copy of the GNU General Public License - * Version 2 or later at the following locations: - * - * http://www.opensource.org/licenses/gpl-license.html - * http://www.gnu.org/copyleft/gpl.html - */ - -/dts-v1/; - -#include <arm/imx6ull.dtsi> -#include "imx6ul-phytec-phycore-som.dtsi" - -/ { - model = "Phytec phyCORE-i.MX6 ULL SOM"; - compatible = "phytec,imx6ul-pcl063", "fsl,imx6ull"; -}; - -&fec1 { - status = "okay"; -}; - -&gpmi { - status = "okay"; -}; - -&i2c1 { - status = "okay"; -}; - -&uart1 { - status = "okay"; -}; - -&usdhc1 { - status = "okay"; -}; - -&usbotg1 { - status = "okay"; -}; - -&usbotg2 { - status = "okay"; -}; diff --git a/arch/arm/mach-imx/imx6.c b/arch/arm/mach-imx/imx6.c index e898be9ab5..0fdd9f082f 100644 --- a/arch/arm/mach-imx/imx6.c +++ b/arch/arm/mach-imx/imx6.c @@ -23,6 +23,7 @@ #include <mach/reset-reason.h> #include <mach/imx6-anadig.h> #include <mach/imx6-regs.h> +#include <mach/imx6-fusemap.h> #include <mach/usb.h> #include <asm/mmu.h> #include <asm/cache-l2x0.h> @@ -38,6 +39,9 @@ #define BM_CLPCR_COSC_PWRDOWN (0x1 << 11) #define BM_CLPCR_BYP_MMDC_CH1_LPM_HS (0x1 << 21) +#define MX6_OCOTP_CFG0 0x410 +#define MX6_OCOTP_CFG1 0x420 + static void imx6_init_lowlevel(void) { void __iomem *aips1 = (void *)MX6_AIPS1_ON_BASE_ADDR; @@ -186,17 +190,30 @@ int imx6_cpu_revision(void) return soc_revision; } +u64 imx6_uid(void) +{ + void __iomem *ocotpbase = IOMEM(MX6_OCOTP_BASE_ADDR); + u64 uid; + + uid = ((u64)readl(ocotpbase + MX6_OCOTP_CFG0) << 32); + uid |= (u64)readl(ocotpbase + MX6_OCOTP_CFG1); + + return uid; +} + int imx6_init(void) { const char *cputypestr; u32 mx6_silicon_revision; void __iomem *src = IOMEM(MX6_SRC_BASE_ADDR); + u64 mx6_uid; imx6_init_lowlevel(); imx6_boot_save_loc(); mx6_silicon_revision = imx6_cpu_revision(); + mx6_uid = imx6_uid(); switch (imx6_cpu_type()) { case IMX6_CPUTYPE_IMX6Q: @@ -236,6 +253,8 @@ int imx6_init(void) imx_set_silicon_revision(cputypestr, mx6_silicon_revision); imx_set_reset_reason(src + IMX_SRC_SRSR, imx_reset_reasons); + pr_info("%s unique ID: %llx\n", cputypestr, mx6_uid); + imx6_setup_ipu_qos(); imx6ul_enet_clk_init(); diff --git a/arch/arm/mach-imx/include/mach/imx6.h b/arch/arm/mach-imx/include/mach/imx6.h index 5701bd480c..f0d20833fd 100644 --- a/arch/arm/mach-imx/include/mach/imx6.h +++ b/arch/arm/mach-imx/include/mach/imx6.h @@ -124,4 +124,6 @@ static inline int __imx6_cpu_revision(void) int imx6_cpu_revision(void); +u64 imx6_uid(void); + #endif /* __MACH_IMX6_H */ diff --git a/drivers/hab/habv4.c b/drivers/hab/habv4.c index 844fafed27..6a60be6853 100644 --- a/drivers/hab/habv4.c +++ b/drivers/hab/habv4.c @@ -419,7 +419,7 @@ static bool is_known_rng_fail_event(const uint8_t *data, size_t len) int i; for (i = 0; i < ARRAY_SIZE(habv4_known_rng_fail_events); i++) { if (memcmp(data, habv4_known_rng_fail_events[i], - min(len, (uint32_t)RNG_FAIL_EVENT_SIZE)) == 0) { + min_t(size_t, len, RNG_FAIL_EVENT_SIZE)) == 0) { return true; } } diff --git a/images/Makefile.imx b/images/Makefile.imx index 9a7187ac78..a287c11c40 100644 --- a/images/Makefile.imx +++ b/images/Makefile.imx @@ -443,11 +443,21 @@ CFG_start_phytec_phycore_imx6dl_som_nand_1gib.pblb.imximg = $(board)/phytec-som- FILE_barebox-phytec-phycore-imx6dl-som-nand-1gib.img = start_phytec_phycore_imx6dl_som_nand_1gib.pblb.imximg image-$(CONFIG_MACH_PHYTEC_SOM_IMX6) += barebox-phytec-phycore-imx6dl-som-nand-1gib.img +pblb-$(CONFIG_MACH_PHYTEC_SOM_IMX6) += start_phytec_phycore_imx6dl_som_lc_nand_256mb +CFG_start_phytec_phycore_imx6dl_som_lc_nand_256mb.pblb.imximg = $(board)/phytec-som-imx6/flash-header-phytec-pcm058dl-256mb.imxcfg +FILE_barebox-phytec-phycore-imx6dl-som-lc-nand-256mb.img = start_phytec_phycore_imx6dl_som_lc_nand_256mb.pblb.imximg +image-$(CONFIG_MACH_PHYTEC_SOM_IMX6) += barebox-phytec-phycore-imx6dl-som-lc-nand-256mb.img + pblb-$(CONFIG_MACH_PHYTEC_SOM_IMX6) += start_phytec_phycore_imx6dl_som_emmc_1gib CFG_start_phytec_phycore_imx6dl_som_emmc_1gib.pblb.imximg = $(board)/phytec-som-imx6/flash-header-phytec-pcm058dl-1gib.imxcfg FILE_barebox-phytec-phycore-imx6dl-som-emmc-1gib.img = start_phytec_phycore_imx6dl_som_emmc_1gib.pblb.imximg image-$(CONFIG_MACH_PHYTEC_SOM_IMX6) += barebox-phytec-phycore-imx6dl-som-emmc-1gib.img +pblb-$(CONFIG_MACH_PHYTEC_SOM_IMX6) += start_phytec_phycore_imx6dl_som_lc_emmc_1gib +CFG_start_phytec_phycore_imx6dl_som_lc_emmc_1gib.pblb.imximg = $(board)/phytec-som-imx6/flash-header-phytec-pcm058dl-1gib.imxcfg +FILE_barebox-phytec-phycore-imx6dl-som-lc-emmc-1gib.img = start_phytec_phycore_imx6dl_som_lc_emmc_1gib.pblb.imximg +image-$(CONFIG_MACH_PHYTEC_SOM_IMX6) += barebox-phytec-phycore-imx6dl-som-lc-emmc-1gib.img + pblb-$(CONFIG_MACH_KONTRON_SAMX6I) += start_imx6q_samx6i CFG_start_imx6q_samx6i.pblb.imximg = $(board)/kontron-samx6i/flash-header-samx6i-quad.imxcfg FILE_barebox-imx6q-samx6i.img = start_imx6q_samx6i.pblb.imximg @@ -494,20 +504,25 @@ CFG_start_nxp_imx6ull_evk.pblb.imximg = $(board)/nxp-imx6ull-evk/flash-header-nx FILE_barebox-nxp-imx6ull-evk.img = start_nxp_imx6ull_evk.pblb.imximg image-$(CONFIG_MACH_NXP_IMX6ULL_EVK) += barebox-nxp-imx6ull-evk.img -pblb-$(CONFIG_MACH_PHYTEC_SOM_IMX6) += start_phytec_phycore_imx6ul_som_512mb -CFG_start_phytec_phycore_imx6ul_som_512mb.pblb.imximg = $(board)/phytec-som-imx6/flash-header-phytec-pcl063-512mb.imxcfg -FILE_barebox-phytec-phycore-imx6ul-512mb.img = start_phytec_phycore_imx6ul_som_512mb.pblb.imximg -image-$(CONFIG_MACH_PHYTEC_SOM_IMX6) += barebox-phytec-phycore-imx6ul-512mb.img - -pblb-$(CONFIG_MACH_PHYTEC_SOM_IMX6) += start_phytec_phycore_imx6ull_som_lc_256mb -CFG_start_phytec_phycore_imx6ull_som_lc_256mb.pblb.imximg = $(board)/phytec-som-imx6/flash-header-phytec-pcl063-256mb.imxcfg -FILE_barebox-phytec-phycore-imx6ull-lc-256mb.img = start_phytec_phycore_imx6ull_som_lc_256mb.pblb.imximg -image-$(CONFIG_MACH_PHYTEC_SOM_IMX6) += barebox-phytec-phycore-imx6ull-lc-256mb.img - -pblb-$(CONFIG_MACH_PHYTEC_SOM_IMX6) += start_phytec_phycore_imx6ull_som_512mb -CFG_start_phytec_phycore_imx6ull_som_512mb.pblb.imximg = $(board)/phytec-som-imx6/flash-header-phytec-pcl063-512mb.imxcfg -FILE_barebox-phytec-phycore-imx6ull-512mb.img = start_phytec_phycore_imx6ull_som_512mb.pblb.imximg -image-$(CONFIG_MACH_PHYTEC_SOM_IMX6) += barebox-phytec-phycore-imx6ull-512mb.img +pblb-$(CONFIG_MACH_PHYTEC_SOM_IMX6) += start_phytec_phycore_imx6ul_som_nand_512mb +CFG_start_phytec_phycore_imx6ul_som_nand_512mb.pblb.imximg = $(board)/phytec-som-imx6/flash-header-phytec-pcl063-512mb.imxcfg +FILE_barebox-phytec-phycore-imx6ul-nand-512mb.img = start_phytec_phycore_imx6ul_som_nand_512mb.pblb.imximg +image-$(CONFIG_MACH_PHYTEC_SOM_IMX6) += barebox-phytec-phycore-imx6ul-nand-512mb.img + +pblb-$(CONFIG_MACH_PHYTEC_SOM_IMX6) += start_phytec_phycore_imx6ull_som_lc_nand_256mb +CFG_start_phytec_phycore_imx6ull_som_lc_nand_256mb.pblb.imximg = $(board)/phytec-som-imx6/flash-header-phytec-pcl063-256mb.imxcfg +FILE_barebox-phytec-phycore-imx6ull-lc-nand-256mb.img = start_phytec_phycore_imx6ull_som_lc_nand_256mb.pblb.imximg +image-$(CONFIG_MACH_PHYTEC_SOM_IMX6) += barebox-phytec-phycore-imx6ull-lc-nand-256mb.img + +pblb-$(CONFIG_MACH_PHYTEC_SOM_IMX6) += start_phytec_phycore_imx6ull_som_nand_512mb +CFG_start_phytec_phycore_imx6ull_som_nand_512mb.pblb.imximg = $(board)/phytec-som-imx6/flash-header-phytec-pcl063-512mb.imxcfg +FILE_barebox-phytec-phycore-imx6ull-nand-512mb.img = start_phytec_phycore_imx6ull_som_nand_512mb.pblb.imximg +image-$(CONFIG_MACH_PHYTEC_SOM_IMX6) += barebox-phytec-phycore-imx6ull-nand-512mb.img + +pblb-$(CONFIG_MACH_PHYTEC_SOM_IMX6) += start_phytec_phycore_imx6ull_som_emmc_512mb +CFG_start_phytec_phycore_imx6ull_som_emmc_512mb.pblb.imximg = $(board)/phytec-som-imx6/flash-header-phytec-pcl063-512mb.imxcfg +FILE_barebox-phytec-phycore-imx6ull-emmc-512mb.img = start_phytec_phycore_imx6ull_som_emmc_512mb.pblb.imximg +image-$(CONFIG_MACH_PHYTEC_SOM_IMX6) += barebox-phytec-phycore-imx6ull-emmc-512mb.img pblb-$(CONFIG_MACH_TECHNEXION_PICO_HOBBIT) += start_imx6ul_pico_hobbit_256mb CFG_start_imx6ul_pico_hobbit_256mb.pblb.imximg = $(board)/technexion-pico-hobbit/flash-header-imx6ul-pico-hobbit-256.imxcfg |