[PATCH v2 1/3] arm64: dts: armada-3720-espressobin: use Linux model/compatible strings

Fix the actual board vendor and ease synching dts files from Linux.
Signed-off-by: Andre Heider a.heider@gmail.com --- arch/arm/dts/armada-3720-espressobin.dts | 4 ++-- board/Marvell/mvebu_armada-37xx/board.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/arm/dts/armada-3720-espressobin.dts b/arch/arm/dts/armada-3720-espressobin.dts index 4534f5ff29..be67a45870 100644 --- a/arch/arm/dts/armada-3720-espressobin.dts +++ b/arch/arm/dts/armada-3720-espressobin.dts @@ -50,8 +50,8 @@ #include "armada-372x.dtsi"
/ { - model = "Marvell Armada 3720 Community Board ESPRESSOBin"; - compatible = "marvell,armada-3720-espressobin", "marvell,armada3720", "marvell,armada3710"; + model = "Globalscale Marvell ESPRESSOBin Board"; + compatible = "globalscale,espressobin", "marvell,armada3720", "marvell,armada3710";
chosen { stdout-path = "serial0:115200n8"; diff --git a/board/Marvell/mvebu_armada-37xx/board.c b/board/Marvell/mvebu_armada-37xx/board.c index 7b9c3223ed..90bfc139aa 100644 --- a/board/Marvell/mvebu_armada-37xx/board.c +++ b/board/Marvell/mvebu_armada-37xx/board.c @@ -201,7 +201,7 @@ static int mii_multi_chip_mode_write(struct mii_dev *bus, int dev_smi_addr, /* Bring-up board-specific network stuff */ int board_network_enable(struct mii_dev *bus) { - if (!of_machine_is_compatible("marvell,armada-3720-espressobin")) + if (!of_machine_is_compatible("globalscale,espressobin")) return 0;
/* @@ -253,7 +253,7 @@ int ft_board_setup(void *blob, struct bd_info *bd) int part_off;
/* Fill SPI MTD partitions for Linux kernel on Espressobin */ - if (!of_machine_is_compatible("marvell,armada-3720-espressobin")) + if (!of_machine_is_compatible("globalscale,espressobin")) return 0;
spi_off = fdt_node_offset_by_compatible(blob, -1, "jedec,spi-nor");

Move most of the dts to the new common armada-3720-espressobin.dtsi file, just like Linux, but keep the current, downstream based, version.
The dts itself is imported from Linux.
Signed-off-by: Andre Heider a.heider@gmail.com --- arch/arm/dts/armada-3720-espressobin.dts | 190 ++---------------- ...sobin.dts => armada-3720-espressobin.dtsi} | 3 - 2 files changed, 20 insertions(+), 173 deletions(-) rewrite arch/arm/dts/armada-3720-espressobin.dts (95%) copy arch/arm/dts/{armada-3720-espressobin.dts => armada-3720-espressobin.dtsi} (96%)
diff --git a/arch/arm/dts/armada-3720-espressobin.dts b/arch/arm/dts/armada-3720-espressobin.dts dissimilarity index 95% index be67a45870..1542d836c0 100644 --- a/arch/arm/dts/armada-3720-espressobin.dts +++ b/arch/arm/dts/armada-3720-espressobin.dts @@ -1,170 +1,20 @@ -/* - * Device Tree file for Marvell Armada 3720 community board - * (ESPRESSOBin) - * Copyright (C) 2016 Marvell - * - * Gregory CLEMENT gregory.clement@free-electrons.com - * Konstantin Porotchkin kostap@marvell.com - * - * This file is dual-licensed: you can use it either under the terms - * of the GPL or the X11 license, at your option. Note that this dual - * licensing only applies to this file, and not this project as a - * whole. - * - * a) This file is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This file is distributed in the hope that it will be useful - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Or, alternatively - * - * b) Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use - * copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED , WITHOUT WARRANTY OF ANY KIND - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - */ - -/dts-v1/; - -#include "armada-372x.dtsi" - -/ { - model = "Globalscale Marvell ESPRESSOBin Board"; - compatible = "globalscale,espressobin", "marvell,armada3720", "marvell,armada3710"; - - chosen { - stdout-path = "serial0:115200n8"; - }; - - aliases { - ethernet0 = ð0; - i2c0 = &i2c0; - spi0 = &spi0; - }; - - memory { - device_type = "memory"; - reg = <0x00000000 0x00000000 0x00000000 0x20000000>; - }; - - vcc_sd_reg0: regulator@0 { - compatible = "regulator-gpio"; - regulator-name = "vcc_sd0"; - regulator-min-microvolt = <1800000>; - regulator-max-microvolt = <3300000>; - regulator-type = "voltage"; - states = <1800000 0x1 - 3300000 0x0>; - gpios = <&gpionb 4 GPIO_ACTIVE_HIGH>; - }; -}; - -&comphy { - max-lanes = <3>; - phy0 { - phy-type = <PHY_TYPE_USB3_HOST0>; - phy-speed = <PHY_SPEED_5G>; - }; - - phy1 { - phy-type = <PHY_TYPE_PEX0>; - phy-speed = <PHY_SPEED_2_5G>; - }; - - phy2 { - phy-type = <PHY_TYPE_SATA0>; - phy-speed = <PHY_SPEED_5G>; - }; -}; - -ð0 { - status = "okay"; - pinctrl-names = "default"; - pinctrl-0 = <&rgmii_pins>, <&smi_pins>; - phy-mode = "rgmii"; - phy_addr = <0x1>; - fixed-link { - speed = <1000>; - full-duplex; - }; -}; - -&i2c0 { - pinctrl-names = "default"; - pinctrl-0 = <&i2c1_pins>; - status = "okay"; -}; - -/* CON3 */ -&sata { - status = "okay"; -}; - -&sdhci0 { - pinctrl-names = "default"; - pinctrl-0 = <&sdio_pins>; - bus-width = <4>; - cd-gpios = <&gpionb 3 GPIO_ACTIVE_LOW>; - vqmmc-supply = <&vcc_sd_reg0>; - status = "okay"; -}; - -&spi0 { - status = "okay"; - pinctrl-names = "default"; - pinctrl-0 = <&spi_quad_pins>; - - spi-flash@0 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "st,m25p128", "jedec,spi-nor"; - reg = <0>; /* Chip select 0 */ - spi-max-frequency = <50000000>; - m25p,fast-read; - }; -}; - -/* Exported on the micro USB connector CON32 through an FTDI */ -&uart0 { - pinctrl-names = "default"; - pinctrl-0 = <&uart1_pins>; - status = "okay"; -}; - -/* CON29 */ -&usb2 { - status = "okay"; -}; - -/* CON31 */ -&usb3 { - status = "okay"; -}; - -&pcie0 { - pinctrl-names = "default"; - pinctrl-0 = <&pcie_pins>; - reset-gpios = <&gpiosb 3 GPIO_ACTIVE_LOW>; - status = "okay"; -}; +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/* + * Device Tree file for Globalscale Marvell ESPRESSOBin Board + * Copyright (C) 2016 Marvell + * + * Romain Perier romain.perier@free-electrons.com + * + */ +/* + * Schematic available at http://espressobin.net/wp-content/uploads/2017/08/ESPRESSObin_V5_Schematics.... + */ + +/dts-v1/; + +#include "armada-3720-espressobin.dtsi" + +/ { + model = "Globalscale Marvell ESPRESSOBin Board"; + compatible = "globalscale,espressobin", "marvell,armada3720", "marvell,armada3710"; +}; diff --git a/arch/arm/dts/armada-3720-espressobin.dts b/arch/arm/dts/armada-3720-espressobin.dtsi similarity index 96% copy from arch/arm/dts/armada-3720-espressobin.dts copy to arch/arm/dts/armada-3720-espressobin.dtsi index be67a45870..05dec89834 100644 --- a/arch/arm/dts/armada-3720-espressobin.dts +++ b/arch/arm/dts/armada-3720-espressobin.dtsi @@ -50,9 +50,6 @@ #include "armada-372x.dtsi"
/ { - model = "Globalscale Marvell ESPRESSOBin Board"; - compatible = "globalscale,espressobin", "marvell,armada3720", "marvell,armada3710"; - chosen { stdout-path = "serial0:115200n8"; };

On 04.09.20 17:33, Andre Heider wrote:
Move most of the dts to the new common armada-3720-espressobin.dtsi file, just like Linux, but keep the current, downstream based, version.
The dts itself is imported from Linux.
Signed-off-by: Andre Heider a.heider@gmail.com
Applied to u-boot-marvell/master
Thanks, Stefan
arch/arm/dts/armada-3720-espressobin.dts | 190 ++---------------- ...sobin.dts => armada-3720-espressobin.dtsi} | 3 - 2 files changed, 20 insertions(+), 173 deletions(-) rewrite arch/arm/dts/armada-3720-espressobin.dts (95%) copy arch/arm/dts/{armada-3720-espressobin.dts => armada-3720-espressobin.dtsi} (96%)
diff --git a/arch/arm/dts/armada-3720-espressobin.dts b/arch/arm/dts/armada-3720-espressobin.dts dissimilarity index 95% index be67a45870..1542d836c0 100644 --- a/arch/arm/dts/armada-3720-espressobin.dts +++ b/arch/arm/dts/armada-3720-espressobin.dts @@ -1,170 +1,20 @@ -/*
- Device Tree file for Marvell Armada 3720 community board
- (ESPRESSOBin)
- Copyright (C) 2016 Marvell
- Gregory CLEMENT gregory.clement@free-electrons.com
- Konstantin Porotchkin kostap@marvell.com
- This file is dual-licensed: you can use it either under the terms
- of the GPL or the X11 license, at your option. Note that this dual
- licensing only applies to this file, and not this project as a
- whole.
- a) This file is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This file is distributed in the hope that it will be useful
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
- Or, alternatively
- b) Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use
copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED , WITHOUT WARRANTY OF ANY KIND
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
- */
-/dts-v1/;
-#include "armada-372x.dtsi"
-/ {
- model = "Globalscale Marvell ESPRESSOBin Board";
- compatible = "globalscale,espressobin", "marvell,armada3720", "marvell,armada3710";
- chosen {
stdout-path = "serial0:115200n8";
- };
- aliases {
ethernet0 = ð0;
i2c0 = &i2c0;
spi0 = &spi0;
- };
- memory {
device_type = "memory";
reg = <0x00000000 0x00000000 0x00000000 0x20000000>;
- };
- vcc_sd_reg0: regulator@0 {
compatible = "regulator-gpio";
regulator-name = "vcc_sd0";
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <3300000>;
regulator-type = "voltage";
states = <1800000 0x1
3300000 0x0>;
gpios = <&gpionb 4 GPIO_ACTIVE_HIGH>;
- };
-};
-&comphy {
- max-lanes = <3>;
- phy0 {
phy-type = <PHY_TYPE_USB3_HOST0>;
phy-speed = <PHY_SPEED_5G>;
- };
- phy1 {
phy-type = <PHY_TYPE_PEX0>;
phy-speed = <PHY_SPEED_2_5G>;
- };
- phy2 {
phy-type = <PHY_TYPE_SATA0>;
phy-speed = <PHY_SPEED_5G>;
- };
-};
-ð0 {
- status = "okay";
- pinctrl-names = "default";
- pinctrl-0 = <&rgmii_pins>, <&smi_pins>;
- phy-mode = "rgmii";
- phy_addr = <0x1>;
- fixed-link {
speed = <1000>;
full-duplex;
- };
-};
-&i2c0 {
- pinctrl-names = "default";
- pinctrl-0 = <&i2c1_pins>;
- status = "okay";
-};
-/* CON3 */ -&sata {
- status = "okay";
-};
-&sdhci0 {
- pinctrl-names = "default";
- pinctrl-0 = <&sdio_pins>;
- bus-width = <4>;
- cd-gpios = <&gpionb 3 GPIO_ACTIVE_LOW>;
- vqmmc-supply = <&vcc_sd_reg0>;
- status = "okay";
-};
-&spi0 {
- status = "okay";
- pinctrl-names = "default";
- pinctrl-0 = <&spi_quad_pins>;
- spi-flash@0 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "st,m25p128", "jedec,spi-nor";
reg = <0>; /* Chip select 0 */
spi-max-frequency = <50000000>;
m25p,fast-read;
- };
-};
-/* Exported on the micro USB connector CON32 through an FTDI */ -&uart0 {
- pinctrl-names = "default";
- pinctrl-0 = <&uart1_pins>;
- status = "okay";
-};
-/* CON29 */ -&usb2 {
- status = "okay";
-};
-/* CON31 */ -&usb3 {
- status = "okay";
-};
-&pcie0 {
- pinctrl-names = "default";
- pinctrl-0 = <&pcie_pins>;
- reset-gpios = <&gpiosb 3 GPIO_ACTIVE_LOW>;
- status = "okay";
-}; +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/*
- Device Tree file for Globalscale Marvell ESPRESSOBin Board
- Copyright (C) 2016 Marvell
- Romain Perier romain.perier@free-electrons.com
- */
+/*
- Schematic available at http://espressobin.net/wp-content/uploads/2017/08/ESPRESSObin_V5_Schematics....
- */
+/dts-v1/;
+#include "armada-3720-espressobin.dtsi"
+/ {
- model = "Globalscale Marvell ESPRESSOBin Board";
- compatible = "globalscale,espressobin", "marvell,armada3720", "marvell,armada3710";
+}; diff --git a/arch/arm/dts/armada-3720-espressobin.dts b/arch/arm/dts/armada-3720-espressobin.dtsi similarity index 96% copy from arch/arm/dts/armada-3720-espressobin.dts copy to arch/arm/dts/armada-3720-espressobin.dtsi index be67a45870..05dec89834 100644 --- a/arch/arm/dts/armada-3720-espressobin.dts +++ b/arch/arm/dts/armada-3720-espressobin.dtsi @@ -50,9 +50,6 @@ #include "armada-372x.dtsi"
/ {
- model = "Globalscale Marvell ESPRESSOBin Board";
- compatible = "globalscale,espressobin", "marvell,armada3720", "marvell,armada3710";
- chosen { stdout-path = "serial0:115200n8"; };
Viele Grüße, Stefan

Import armada-3720-espressobin-emmc.dts from Linux, but use sdhc1 for emmc, since our dtsi is still based on downstream and sdhc0 is used for the sd card.
Signed-off-by: Andre Heider a.heider@gmail.com --- arch/arm/dts/Makefile | 1 + arch/arm/dts/armada-3720-espressobin-emmc.dts | 44 +++++++++++++++++++ doc/README.marvell | 7 ++- 3 files changed, 50 insertions(+), 2 deletions(-) create mode 100644 arch/arm/dts/armada-3720-espressobin-emmc.dts
diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile index 5e34192be6..8f1958b5a7 100644 --- a/arch/arm/dts/Makefile +++ b/arch/arm/dts/Makefile @@ -202,6 +202,7 @@ dtb-$(CONFIG_ARCH_TEGRA) += tegra20-harmony.dtb \ dtb-$(CONFIG_ARCH_MVEBU) += \ armada-3720-db.dtb \ armada-3720-espressobin.dtb \ + armada-3720-espressobin-emmc.dtb \ armada-3720-turris-mox.dtb \ armada-3720-uDPU.dtb \ armada-375-db.dtb \ diff --git a/arch/arm/dts/armada-3720-espressobin-emmc.dts b/arch/arm/dts/armada-3720-espressobin-emmc.dts new file mode 100644 index 0000000000..29ccb6a573 --- /dev/null +++ b/arch/arm/dts/armada-3720-espressobin-emmc.dts @@ -0,0 +1,44 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/* + * Device Tree file for Globalscale Marvell ESPRESSOBin Board with eMMC + * Copyright (C) 2018 Marvell + * + * Romain Perier romain.perier@free-electrons.com + * Konstantin Porotchkin kostap@marvell.com + * + */ +/* + * Schematic available at http://espressobin.net/wp-content/uploads/2017/08/ESPRESSObin_V5_Schematics.... + */ + +/dts-v1/; + +#include "armada-3720-espressobin.dtsi" + +/ { + model = "Globalscale Marvell ESPRESSOBin Board (eMMC)"; + compatible = "globalscale,espressobin-emmc", "globalscale,espressobin", + "marvell,armada3720", "marvell,armada3710"; +}; + +/* U11 */ +&sdhci1 { + non-removable; + bus-width = <8>; + mmc-ddr-1_8v; + mmc-hs400-1_8v; + marvell,xenon-emmc; + marvell,xenon-tun-count = <9>; + marvell,pad-type = "fixed-1-8v"; + + pinctrl-names = "default"; + pinctrl-0 = <&mmc_pins>; + status = "okay"; + + #address-cells = <1>; + #size-cells = <0>; + mmccard: mmccard@0 { + compatible = "mmc-card"; + reg = <0>; + }; +}; diff --git a/doc/README.marvell b/doc/README.marvell index 5416bc3035..be07f31f8c 100644 --- a/doc/README.marvell +++ b/doc/README.marvell @@ -43,8 +43,11 @@ Build Procedure In order to prevent this, the required device-tree MUST be set during compilation. All device-tree files are located in ./arch/arm/dts/ folder.
- For other DB boards (MacchiatoBin, EspressoBin and 3700 DB board) compile u-boot with - just default device-tree from defconfig using: + For the EspressoBin board with populated eMMC device use + # make DEVICE_TREE=armada-3720-espressobin-emmc + + For other DB boards (MacchiatoBin, EspressoBin without soldered eMMC and 3700 DB board) + compile u-boot with just default device-tree from defconfig using:
# make

On 04/09/2020 17:33, Andre Heider wrote:
Import armada-3720-espressobin-emmc.dts from Linux, but use sdhc1 for emmc, since our dtsi is still based on downstream and sdhc0 is used for the sd card.
Signed-off-by: Andre Heider a.heider@gmail.com
We've found a tester with an eMMC board, and unfortunately this patch is not sufficient. eMMC shows up, but accessing it errors out with "MMC: no card present".
Stefan, please ignore 3/3 for now. If you agree, 1/3 and 2/3 are still worth having, they prepare for syncing dts files with Linux.
Regards, Andre

On 09/09/2020 11:16, Andre Heider wrote:
On 04/09/2020 17:33, Andre Heider wrote:
Import armada-3720-espressobin-emmc.dts from Linux, but use sdhc1 for emmc, since our dtsi is still based on downstream and sdhc0 is used for the sd card.
Signed-off-by: Andre Heider a.heider@gmail.com
We've found a tester with an eMMC board, and unfortunately this patch is not sufficient. eMMC shows up, but accessing it errors out with "MMC: no card present".
Stefan, please ignore 3/3 for now. If you agree, 1/3 and 2/3 are still worth having, they prepare for syncing dts files with Linux.
Thanks to Gérald we managed to fix it. 3/3 is good to go, the missing piece was just respecting "non-removable", see [0].
That patch combined with this set makes it work, so please go ahead and review :)
Thanks, Andre
[0] https://patchwork.ozlabs.org/project/uboot/patch/20200910175340.515227-1-a.h...

On 04.09.20 17:33, Andre Heider wrote:
Import armada-3720-espressobin-emmc.dts from Linux, but use sdhc1 for emmc, since our dtsi is still based on downstream and sdhc0 is used for the sd card.
Signed-off-by: Andre Heider a.heider@gmail.com
Applied to u-boot-marvell/master
Thanks, Stefan
arch/arm/dts/Makefile | 1 + arch/arm/dts/armada-3720-espressobin-emmc.dts | 44 +++++++++++++++++++ doc/README.marvell | 7 ++- 3 files changed, 50 insertions(+), 2 deletions(-) create mode 100644 arch/arm/dts/armada-3720-espressobin-emmc.dts
diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile index 5e34192be6..8f1958b5a7 100644 --- a/arch/arm/dts/Makefile +++ b/arch/arm/dts/Makefile @@ -202,6 +202,7 @@ dtb-$(CONFIG_ARCH_TEGRA) += tegra20-harmony.dtb \ dtb-$(CONFIG_ARCH_MVEBU) += \ armada-3720-db.dtb \ armada-3720-espressobin.dtb \
- armada-3720-espressobin-emmc.dtb \ armada-3720-turris-mox.dtb \ armada-3720-uDPU.dtb \ armada-375-db.dtb \
diff --git a/arch/arm/dts/armada-3720-espressobin-emmc.dts b/arch/arm/dts/armada-3720-espressobin-emmc.dts new file mode 100644 index 0000000000..29ccb6a573 --- /dev/null +++ b/arch/arm/dts/armada-3720-espressobin-emmc.dts @@ -0,0 +1,44 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/*
- Device Tree file for Globalscale Marvell ESPRESSOBin Board with eMMC
- Copyright (C) 2018 Marvell
- Romain Perier romain.perier@free-electrons.com
- Konstantin Porotchkin kostap@marvell.com
- */
+/*
- Schematic available at http://espressobin.net/wp-content/uploads/2017/08/ESPRESSObin_V5_Schematics....
- */
+/dts-v1/;
+#include "armada-3720-espressobin.dtsi"
+/ {
- model = "Globalscale Marvell ESPRESSOBin Board (eMMC)";
- compatible = "globalscale,espressobin-emmc", "globalscale,espressobin",
"marvell,armada3720", "marvell,armada3710";
+};
+/* U11 */ +&sdhci1 {
- non-removable;
- bus-width = <8>;
- mmc-ddr-1_8v;
- mmc-hs400-1_8v;
- marvell,xenon-emmc;
- marvell,xenon-tun-count = <9>;
- marvell,pad-type = "fixed-1-8v";
- pinctrl-names = "default";
- pinctrl-0 = <&mmc_pins>;
- status = "okay";
- #address-cells = <1>;
- #size-cells = <0>;
- mmccard: mmccard@0 {
compatible = "mmc-card";
reg = <0>;
- };
+}; diff --git a/doc/README.marvell b/doc/README.marvell index 5416bc3035..be07f31f8c 100644 --- a/doc/README.marvell +++ b/doc/README.marvell @@ -43,8 +43,11 @@ Build Procedure In order to prevent this, the required device-tree MUST be set during compilation. All device-tree files are located in ./arch/arm/dts/ folder.
- For other DB boards (MacchiatoBin, EspressoBin and 3700 DB board) compile u-boot with
- just default device-tree from defconfig using:
For the EspressoBin board with populated eMMC device use
# make DEVICE_TREE=armada-3720-espressobin-emmc
For other DB boards (MacchiatoBin, EspressoBin without soldered eMMC and 3700 DB board)
compile u-boot with just default device-tree from defconfig using:
# make
Viele Grüße, Stefan

On Wednesday 14 October 2020 10:17:45 Stefan Roese wrote:
On 04.09.20 17:33, Andre Heider wrote:
Import armada-3720-espressobin-emmc.dts from Linux, but use sdhc1 for emmc, since our dtsi is still based on downstream and sdhc0 is used for the sd card.
Signed-off-by: Andre Heider a.heider@gmail.com
Applied to u-boot-marvell/master
Thanks, Stefan
arch/arm/dts/Makefile | 1 + arch/arm/dts/armada-3720-espressobin-emmc.dts | 44 +++++++++++++++++++ doc/README.marvell | 7 ++- 3 files changed, 50 insertions(+), 2 deletions(-) create mode 100644 arch/arm/dts/armada-3720-espressobin-emmc.dts
diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile index 5e34192be6..8f1958b5a7 100644 --- a/arch/arm/dts/Makefile +++ b/arch/arm/dts/Makefile @@ -202,6 +202,7 @@ dtb-$(CONFIG_ARCH_TEGRA) += tegra20-harmony.dtb \ dtb-$(CONFIG_ARCH_MVEBU) += \ armada-3720-db.dtb \ armada-3720-espressobin.dtb \
- armada-3720-espressobin-emmc.dtb \ armada-3720-turris-mox.dtb \ armada-3720-uDPU.dtb \ armada-375-db.dtb \
diff --git a/arch/arm/dts/armada-3720-espressobin-emmc.dts b/arch/arm/dts/armada-3720-espressobin-emmc.dts new file mode 100644 index 0000000000..29ccb6a573 --- /dev/null +++ b/arch/arm/dts/armada-3720-espressobin-emmc.dts @@ -0,0 +1,44 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/*
- Device Tree file for Globalscale Marvell ESPRESSOBin Board with eMMC
- Copyright (C) 2018 Marvell
- Romain Perier romain.perier@free-electrons.com
- Konstantin Porotchkin kostap@marvell.com
- */
+/*
- Schematic available at http://espressobin.net/wp-content/uploads/2017/08/ESPRESSObin_V5_Schematics....
- */
+/dts-v1/;
+#include "armada-3720-espressobin.dtsi"
+/ {
- model = "Globalscale Marvell ESPRESSOBin Board (eMMC)";
- compatible = "globalscale,espressobin-emmc", "globalscale,espressobin",
"marvell,armada3720", "marvell,armada3710";
+};
+/* U11 */ +&sdhci1 {
- non-removable;
- bus-width = <8>;
- mmc-ddr-1_8v;
- mmc-hs400-1_8v;
- marvell,xenon-emmc;
- marvell,xenon-tun-count = <9>;
- marvell,pad-type = "fixed-1-8v";
- pinctrl-names = "default";
- pinctrl-0 = <&mmc_pins>;
- status = "okay";
- #address-cells = <1>;
- #size-cells = <0>;
- mmccard: mmccard@0 {
compatible = "mmc-card";
reg = <0>;
- };
+}; diff --git a/doc/README.marvell b/doc/README.marvell index 5416bc3035..be07f31f8c 100644 --- a/doc/README.marvell +++ b/doc/README.marvell @@ -43,8 +43,11 @@ Build Procedure In order to prevent this, the required device-tree MUST be set during compilation. All device-tree files are located in ./arch/arm/dts/ folder.
- For other DB boards (MacchiatoBin, EspressoBin and 3700 DB board) compile u-boot with
- just default device-tree from defconfig using:
- For the EspressoBin board with populated eMMC device use
# make DEVICE_TREE=armada-3720-espressobin-emmc
- For other DB boards (MacchiatoBin, EspressoBin without soldered eMMC and 3700 DB board)
- compile u-boot with just default device-tree from defconfig using:
Hello! Does not it really make sense to do autodetection of eMMC presence and enable it in U-Boot code only when needed and therefore avoid having two DTS files and needs for specifying DEVICE_TREE variable and therefore variant of Espressobin, as I stated in previous emails?
I think this just complicates build process... E.g. we already have a code in U-Boot which detects V5 vs V7 variant.
# make
Viele Grüße, Stefan
-- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr@denx.de

On 14/10/2020 10:21, Pali Rohár wrote:
<snip>
diff --git a/doc/README.marvell b/doc/README.marvell index 5416bc3035..be07f31f8c 100644 --- a/doc/README.marvell +++ b/doc/README.marvell @@ -43,8 +43,11 @@ Build Procedure In order to prevent this, the required device-tree MUST be set during compilation. All device-tree files are located in ./arch/arm/dts/ folder.
- For other DB boards (MacchiatoBin, EspressoBin and 3700 DB board) compile u-boot with
- just default device-tree from defconfig using:
- For the EspressoBin board with populated eMMC device use
# make DEVICE_TREE=armada-3720-espressobin-emmc
- For other DB boards (MacchiatoBin, EspressoBin without soldered eMMC and 3700 DB board)
- compile u-boot with just default device-tree from defconfig using:
Hello! Does not it really make sense to do autodetection of eMMC presence and enable it in U-Boot code only when needed and therefore avoid having two DTS files and needs for specifying DEVICE_TREE variable and therefore variant of Espressobin, as I stated in previous emails?
I think this just complicates build process... E.g. we already have a code in U-Boot which detects V5 vs V7 variant.
I still like the idea, but I'm still hesitating to just enable the emmc everywhere. There's the issue with powering down the emmc block if it's not populated. How would that work once we switch to atf for comphy control?
From a different angle: If we could just do that, why does Linux have different devicetrees?
Regards, Andre

On Wednesday 14 October 2020 10:37:57 Andre Heider wrote:
On 14/10/2020 10:21, Pali Rohár wrote:
<snip>
diff --git a/doc/README.marvell b/doc/README.marvell index 5416bc3035..be07f31f8c 100644 --- a/doc/README.marvell +++ b/doc/README.marvell @@ -43,8 +43,11 @@ Build Procedure In order to prevent this, the required device-tree MUST be set during compilation. All device-tree files are located in ./arch/arm/dts/ folder.
- For other DB boards (MacchiatoBin, EspressoBin and 3700 DB board) compile u-boot with
- just default device-tree from defconfig using:
- For the EspressoBin board with populated eMMC device use
# make DEVICE_TREE=armada-3720-espressobin-emmc
- For other DB boards (MacchiatoBin, EspressoBin without soldered eMMC and 3700 DB board)
- compile u-boot with just default device-tree from defconfig using:
Hello! Does not it really make sense to do autodetection of eMMC presence and enable it in U-Boot code only when needed and therefore avoid having two DTS files and needs for specifying DEVICE_TREE variable and therefore variant of Espressobin, as I stated in previous emails?
I think this just complicates build process... E.g. we already have a code in U-Boot which detects V5 vs V7 variant.
I still like the idea, but I'm still hesitating to just enable the emmc everywhere. There's the issue with powering down the emmc block if it's not populated. How would that work once we switch to atf for comphy control?
Is there issue with powering it down? I just do not know about it. And could we fix it?
From a different angle: If we could just do that, why does Linux have different devicetrees?
I do not know exact answer, so I just guess two reasons:
1) historic, nobody wanted to think about it, so rather created secondary DTS
2) linux driver model does not have API and solution how to do this auto-detection and in case of absence, turn blocks off and reconfigure it.
IIRC similar problem was with MOX (also based on A3720) and final solution is that kernel has only one DTB and U-Boot "modifies" it prior booting kernel, based on autodetection which U-Boot did. Similarly like MAC address of MTD partitions are put into espressobin DTB prior booting kernel.
Regards, Andre

On Wednesday 14 October 2020 10:45:33 Pali Rohár wrote:
On Wednesday 14 October 2020 10:37:57 Andre Heider wrote:
On 14/10/2020 10:21, Pali Rohár wrote:
<snip>
diff --git a/doc/README.marvell b/doc/README.marvell index 5416bc3035..be07f31f8c 100644 --- a/doc/README.marvell +++ b/doc/README.marvell @@ -43,8 +43,11 @@ Build Procedure In order to prevent this, the required device-tree MUST be set during compilation. All device-tree files are located in ./arch/arm/dts/ folder.
- For other DB boards (MacchiatoBin, EspressoBin and 3700 DB board) compile u-boot with
- just default device-tree from defconfig using:
- For the EspressoBin board with populated eMMC device use
# make DEVICE_TREE=armada-3720-espressobin-emmc
- For other DB boards (MacchiatoBin, EspressoBin without soldered eMMC and 3700 DB board)
- compile u-boot with just default device-tree from defconfig using:
Hello! Does not it really make sense to do autodetection of eMMC presence and enable it in U-Boot code only when needed and therefore avoid having two DTS files and needs for specifying DEVICE_TREE variable and therefore variant of Espressobin, as I stated in previous emails?
I think this just complicates build process... E.g. we already have a code in U-Boot which detects V5 vs V7 variant.
I still like the idea, but I'm still hesitating to just enable the emmc everywhere. There's the issue with powering down the emmc block if it's not populated. How would that work once we switch to atf for comphy control?
Is there issue with powering it down? I just do not know about it. And could we fix it?
From a different angle: If we could just do that, why does Linux have different devicetrees?
I do not know exact answer, so I just guess two reasons:
- historic, nobody wanted to think about it, so rather created
secondary DTS
- linux driver model does not have API and solution how to do this
auto-detection and in case of absence, turn blocks off and reconfigure it.
IIRC similar problem was with MOX (also based on A3720) and final solution is that kernel has only one DTB and U-Boot "modifies" it prior booting kernel, based on autodetection which U-Boot did. Similarly like MAC address of MTD partitions are put into espressobin DTB prior booting kernel.
MOX has uSD slot for uSD card and SDIO slot for SDIO wifi card, both removable. Standard product configuration does not contain SDIO wifi card, but kernel's DTS file have it enabled by default: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch...
So it is really problem to enable eMMC by default on espressobin?

Fix the actual board vendor and ease synching dts files from Linux.
Signed-off-by: Andre Heider a.heider@gmail.com --- v3: rebase on master
arch/arm/dts/armada-3720-espressobin.dts | 4 ++-- board/Marvell/mvebu_armada-37xx/board.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/arch/arm/dts/armada-3720-espressobin.dts b/arch/arm/dts/armada-3720-espressobin.dts index 4534f5ff29..be67a45870 100644 --- a/arch/arm/dts/armada-3720-espressobin.dts +++ b/arch/arm/dts/armada-3720-espressobin.dts @@ -50,8 +50,8 @@ #include "armada-372x.dtsi"
/ { - model = "Marvell Armada 3720 Community Board ESPRESSOBin"; - compatible = "marvell,armada-3720-espressobin", "marvell,armada3720", "marvell,armada3710"; + model = "Globalscale Marvell ESPRESSOBin Board"; + compatible = "globalscale,espressobin", "marvell,armada3720", "marvell,armada3710";
chosen { stdout-path = "serial0:115200n8"; diff --git a/board/Marvell/mvebu_armada-37xx/board.c b/board/Marvell/mvebu_armada-37xx/board.c index 2bfc7171c4..73d69e0388 100644 --- a/board/Marvell/mvebu_armada-37xx/board.c +++ b/board/Marvell/mvebu_armada-37xx/board.c @@ -88,14 +88,14 @@ int board_late_init(void) if (env_get("fdtfile")) return 0;
- if (!of_machine_is_compatible("marvell,armada-3720-espressobin")) + if (!of_machine_is_compatible("globalscale,espressobin")) return 0;
/* If the memory controller has been configured for DDR4, we're running on v7 */ ddr4 = ((readl(A3700_CH0_MC_CTRL2_REG) >> A3700_MC_CTRL2_SDRAM_TYPE_OFFS) & A3700_MC_CTRL2_SDRAM_TYPE_MASK) == A3700_MC_CTRL2_SDRAM_TYPE_DDR4;
- emmc = of_machine_is_compatible("marvell,armada-3720-espressobin-emmc"); + emmc = of_machine_is_compatible("globalscale,espressobin-emmc");
if (ddr4 && emmc) env_set("fdtfile", "marvell/armada-3720-espressobin-v7-emmc.dtb"); @@ -248,7 +248,7 @@ static int mii_multi_chip_mode_write(struct mii_dev *bus, int dev_smi_addr, /* Bring-up board-specific network stuff */ int board_network_enable(struct mii_dev *bus) { - if (!of_machine_is_compatible("marvell,armada-3720-espressobin")) + if (!of_machine_is_compatible("globalscale,espressobin")) return 0;
/* @@ -300,7 +300,7 @@ int ft_board_setup(void *blob, struct bd_info *bd) int part_off;
/* Fill SPI MTD partitions for Linux kernel on Espressobin */ - if (!of_machine_is_compatible("marvell,armada-3720-espressobin")) + if (!of_machine_is_compatible("globalscale,espressobin")) return 0;
spi_off = fdt_node_offset_by_compatible(blob, -1, "jedec,spi-nor");

CCing Heinrich, I think you should be interested in this patch.
On Friday 02 October 2020 07:51:12 Andre Heider wrote:
Fix the actual board vendor and ease synching dts files from Linux.
Signed-off-by: Andre Heider a.heider@gmail.com
Reviewed-by: Pali Rohár pali@kernel.org
v3: rebase on master
arch/arm/dts/armada-3720-espressobin.dts | 4 ++-- board/Marvell/mvebu_armada-37xx/board.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/arch/arm/dts/armada-3720-espressobin.dts b/arch/arm/dts/armada-3720-espressobin.dts index 4534f5ff29..be67a45870 100644 --- a/arch/arm/dts/armada-3720-espressobin.dts +++ b/arch/arm/dts/armada-3720-espressobin.dts @@ -50,8 +50,8 @@ #include "armada-372x.dtsi"
/ {
- model = "Marvell Armada 3720 Community Board ESPRESSOBin";
- compatible = "marvell,armada-3720-espressobin", "marvell,armada3720", "marvell,armada3710";
model = "Globalscale Marvell ESPRESSOBin Board";
compatible = "globalscale,espressobin", "marvell,armada3720", "marvell,armada3710";
chosen { stdout-path = "serial0:115200n8";
diff --git a/board/Marvell/mvebu_armada-37xx/board.c b/board/Marvell/mvebu_armada-37xx/board.c index 2bfc7171c4..73d69e0388 100644 --- a/board/Marvell/mvebu_armada-37xx/board.c +++ b/board/Marvell/mvebu_armada-37xx/board.c @@ -88,14 +88,14 @@ int board_late_init(void) if (env_get("fdtfile")) return 0;
- if (!of_machine_is_compatible("marvell,armada-3720-espressobin"))
if (!of_machine_is_compatible("globalscale,espressobin")) return 0;
/* If the memory controller has been configured for DDR4, we're running on v7 */ ddr4 = ((readl(A3700_CH0_MC_CTRL2_REG) >> A3700_MC_CTRL2_SDRAM_TYPE_OFFS) & A3700_MC_CTRL2_SDRAM_TYPE_MASK) == A3700_MC_CTRL2_SDRAM_TYPE_DDR4;
- emmc = of_machine_is_compatible("marvell,armada-3720-espressobin-emmc");
emmc = of_machine_is_compatible("globalscale,espressobin-emmc");
if (ddr4 && emmc) env_set("fdtfile", "marvell/armada-3720-espressobin-v7-emmc.dtb");
@@ -248,7 +248,7 @@ static int mii_multi_chip_mode_write(struct mii_dev *bus, int dev_smi_addr, /* Bring-up board-specific network stuff */ int board_network_enable(struct mii_dev *bus) {
- if (!of_machine_is_compatible("marvell,armada-3720-espressobin"))
if (!of_machine_is_compatible("globalscale,espressobin")) return 0;
/*
@@ -300,7 +300,7 @@ int ft_board_setup(void *blob, struct bd_info *bd) int part_off;
/* Fill SPI MTD partitions for Linux kernel on Espressobin */
- if (!of_machine_is_compatible("marvell,armada-3720-espressobin"))
if (!of_machine_is_compatible("globalscale,espressobin")) return 0;
spi_off = fdt_node_offset_by_compatible(blob, -1, "jedec,spi-nor");
-- 2.28.0

On 02.10.20 07:51, Andre Heider wrote:
Fix the actual board vendor and ease synching dts files from Linux.
Signed-off-by: Andre Heider a.heider@gmail.com
Reviewed-by: Stefan Roese sr@denx.de
Thanks, Stefan
v3: rebase on master
arch/arm/dts/armada-3720-espressobin.dts | 4 ++-- board/Marvell/mvebu_armada-37xx/board.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/arch/arm/dts/armada-3720-espressobin.dts b/arch/arm/dts/armada-3720-espressobin.dts index 4534f5ff29..be67a45870 100644 --- a/arch/arm/dts/armada-3720-espressobin.dts +++ b/arch/arm/dts/armada-3720-espressobin.dts @@ -50,8 +50,8 @@ #include "armada-372x.dtsi"
/ {
- model = "Marvell Armada 3720 Community Board ESPRESSOBin";
- compatible = "marvell,armada-3720-espressobin", "marvell,armada3720", "marvell,armada3710";
model = "Globalscale Marvell ESPRESSOBin Board";
compatible = "globalscale,espressobin", "marvell,armada3720", "marvell,armada3710";
chosen { stdout-path = "serial0:115200n8";
diff --git a/board/Marvell/mvebu_armada-37xx/board.c b/board/Marvell/mvebu_armada-37xx/board.c index 2bfc7171c4..73d69e0388 100644 --- a/board/Marvell/mvebu_armada-37xx/board.c +++ b/board/Marvell/mvebu_armada-37xx/board.c @@ -88,14 +88,14 @@ int board_late_init(void) if (env_get("fdtfile")) return 0;
- if (!of_machine_is_compatible("marvell,armada-3720-espressobin"))
if (!of_machine_is_compatible("globalscale,espressobin")) return 0;
/* If the memory controller has been configured for DDR4, we're running on v7 */ ddr4 = ((readl(A3700_CH0_MC_CTRL2_REG) >> A3700_MC_CTRL2_SDRAM_TYPE_OFFS) & A3700_MC_CTRL2_SDRAM_TYPE_MASK) == A3700_MC_CTRL2_SDRAM_TYPE_DDR4;
- emmc = of_machine_is_compatible("marvell,armada-3720-espressobin-emmc");
emmc = of_machine_is_compatible("globalscale,espressobin-emmc");
if (ddr4 && emmc) env_set("fdtfile", "marvell/armada-3720-espressobin-v7-emmc.dtb");
@@ -248,7 +248,7 @@ static int mii_multi_chip_mode_write(struct mii_dev *bus, int dev_smi_addr, /* Bring-up board-specific network stuff */ int board_network_enable(struct mii_dev *bus) {
- if (!of_machine_is_compatible("marvell,armada-3720-espressobin"))
if (!of_machine_is_compatible("globalscale,espressobin")) return 0;
/*
@@ -300,7 +300,7 @@ int ft_board_setup(void *blob, struct bd_info *bd) int part_off;
/* Fill SPI MTD partitions for Linux kernel on Espressobin */
- if (!of_machine_is_compatible("marvell,armada-3720-espressobin"))
if (!of_machine_is_compatible("globalscale,espressobin")) return 0;
spi_off = fdt_node_offset_by_compatible(blob, -1, "jedec,spi-nor");
Viele Grüße, Stefan

On 02.10.20 07:51, Andre Heider wrote:
Fix the actual board vendor and ease synching dts files from Linux.
Signed-off-by: Andre Heider a.heider@gmail.com
v3: rebase on master
Applied to u-boot-marvell/master
Thanks, Stefan
arch/arm/dts/armada-3720-espressobin.dts | 4 ++-- board/Marvell/mvebu_armada-37xx/board.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/arch/arm/dts/armada-3720-espressobin.dts b/arch/arm/dts/armada-3720-espressobin.dts index 4534f5ff29..be67a45870 100644 --- a/arch/arm/dts/armada-3720-espressobin.dts +++ b/arch/arm/dts/armada-3720-espressobin.dts @@ -50,8 +50,8 @@ #include "armada-372x.dtsi"
/ {
- model = "Marvell Armada 3720 Community Board ESPRESSOBin";
- compatible = "marvell,armada-3720-espressobin", "marvell,armada3720", "marvell,armada3710";
model = "Globalscale Marvell ESPRESSOBin Board";
compatible = "globalscale,espressobin", "marvell,armada3720", "marvell,armada3710";
chosen { stdout-path = "serial0:115200n8";
diff --git a/board/Marvell/mvebu_armada-37xx/board.c b/board/Marvell/mvebu_armada-37xx/board.c index 2bfc7171c4..73d69e0388 100644 --- a/board/Marvell/mvebu_armada-37xx/board.c +++ b/board/Marvell/mvebu_armada-37xx/board.c @@ -88,14 +88,14 @@ int board_late_init(void) if (env_get("fdtfile")) return 0;
- if (!of_machine_is_compatible("marvell,armada-3720-espressobin"))
if (!of_machine_is_compatible("globalscale,espressobin")) return 0;
/* If the memory controller has been configured for DDR4, we're running on v7 */ ddr4 = ((readl(A3700_CH0_MC_CTRL2_REG) >> A3700_MC_CTRL2_SDRAM_TYPE_OFFS) & A3700_MC_CTRL2_SDRAM_TYPE_MASK) == A3700_MC_CTRL2_SDRAM_TYPE_DDR4;
- emmc = of_machine_is_compatible("marvell,armada-3720-espressobin-emmc");
emmc = of_machine_is_compatible("globalscale,espressobin-emmc");
if (ddr4 && emmc) env_set("fdtfile", "marvell/armada-3720-espressobin-v7-emmc.dtb");
@@ -248,7 +248,7 @@ static int mii_multi_chip_mode_write(struct mii_dev *bus, int dev_smi_addr, /* Bring-up board-specific network stuff */ int board_network_enable(struct mii_dev *bus) {
- if (!of_machine_is_compatible("marvell,armada-3720-espressobin"))
if (!of_machine_is_compatible("globalscale,espressobin")) return 0;
/*
@@ -300,7 +300,7 @@ int ft_board_setup(void *blob, struct bd_info *bd) int part_off;
/* Fill SPI MTD partitions for Linux kernel on Espressobin */
- if (!of_machine_is_compatible("marvell,armada-3720-espressobin"))
if (!of_machine_is_compatible("globalscale,espressobin")) return 0;
spi_off = fdt_node_offset_by_compatible(blob, -1, "jedec,spi-nor");
Viele Grüße, Stefan
participants (3)
-
Andre Heider
-
Pali Rohár
-
Stefan Roese