From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 17F77C432BE for ; Fri, 13 Aug 2021 09:08:35 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 388E66103E for ; Fri, 13 Aug 2021 09:08:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 388E66103E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=sartura.hr Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6D10182D91; Fri, 13 Aug 2021 11:08:31 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=sartura.hr Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=sartura-hr.20150623.gappssmtp.com header.i=@sartura-hr.20150623.gappssmtp.com header.b="ca2MZ+Uy"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E295582DA1; Fri, 13 Aug 2021 11:08:29 +0200 (CEST) Received: from mail-io1-xd33.google.com (mail-io1-xd33.google.com [IPv6:2607:f8b0:4864:20::d33]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 98A5C81FC6 for ; Fri, 13 Aug 2021 11:08:21 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=sartura.hr Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=luka.kovacic@sartura.hr Received: by mail-io1-xd33.google.com with SMTP id y1so12292059iod.10 for ; Fri, 13 Aug 2021 02:08:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sartura-hr.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=YtLB3/Myz2K0aJ/pJPP+K15okm07ZNMLdODNIP0Jhy8=; b=ca2MZ+Uy5qiIOpkcAKl7ahwxjVYify7mnMKUAgWPQRdrvRjkCjVKjmF8CPRbW/Q3rb bQklJkSulFny7aq4JSDQpCYAVxh7c8UDwNYnp8RHR/LXeoWysn6tTlqqgRNHgOEMcfFh KFe2YXjJdWIJQQA4XCc5pkyyLCKXwsjU2XmBXfgXhM4jS8VRojvCTutcI2Bv7gEyEDH5 3v2I0pxpW4dhMWJ3vAmVe/zrhWCEcZpgNEGG4s72Jf31707pXu8p3+puDqsGmsEFrnDA nEuL/zeMJWqua20t6EDvsqBujwAqUySZPYnpUANjrsIklCKpyasaJ68F5Gtb6tGQU3Vq tWUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=YtLB3/Myz2K0aJ/pJPP+K15okm07ZNMLdODNIP0Jhy8=; b=qq0f69UbRawcnas4KEAw6kjHnfnOJwtZPwm/kel/P+iyOWwL5dB/JiwW8ApP5sp9XL ULSXz+4V8WcQiS7lzvqyH98I39P/7DGPjA+v2hUfod5XXL4VMw9PcXLxfjNcssdw71qs fCPFw60jiWsBrL56egN9bXtUg567zIHNsgrnQPDdlkuAHlD+MxJTCPPHn461kLaGNCpO Xm7n8OHxs/lVik5tJVYksgP7irwVp3vYCMAoavKkPM1olm6/669hda3hC+A/owzk8U0O OeTF+f6YByUKkjFH6r3zIVNcgR1yPfMXI+nyPCObhw+F5Y0HQzuEm6PFc4we5282xuem jg0Q== X-Gm-Message-State: AOAM532oEUXN9YfVeRjBvE9mf/zK2y8fxfcM60mM9NKe2BJbHO5wPkl7 OjbR4EyyDyWKJEmJmuePsMhCyviKAzSWhzNIXDzvWQ== X-Google-Smtp-Source: ABdhPJz4LL7uxKbNMhqI+1XZJyJv5HAhe6ctlKny/Y4ub6081mUoEBqZMUn5FwnWa1YxkrifUxEyrG4pw4qMHIUnK+c= X-Received: by 2002:a02:c9c4:: with SMTP id c4mr1340491jap.67.1628845700109; Fri, 13 Aug 2021 02:08:20 -0700 (PDT) MIME-Version: 1.0 References: <20210812233938.11633-1-luka.kovacic@sartura.hr> <20210812233938.11633-4-luka.kovacic@sartura.hr> <20210813081425.y7wf2lpxh37ewu6k@pali> In-Reply-To: <20210813081425.y7wf2lpxh37ewu6k@pali> From: Luka Kovacic Date: Fri, 13 Aug 2021 11:08:08 +0200 Message-ID: Subject: Re: [PATCH v3 3/3] arm: mvebu: Initial ESPRESSOBin-Ultra board support To: =?UTF-8?Q?Pali_Roh=C3=A1r?= Cc: u-boot@lists.denx.de, Robert Marko , Luka Perkov , Marek Behun , sr@denx.de, sjg@chromium.org, patrick.delaunay@foss.st.com, xypron.glpk@gmx.de Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean Hello Pali, On Fri, Aug 13, 2021 at 10:14 AM Pali Roh=C3=A1r wrote: > > On Friday 13 August 2021 01:39:38 Luka Kovacic wrote: > > Add initial support for the ESPRESSOBin-Ultra board from Globalscale > > Technologies, Inc. > > > > The board is based on the 64-bit dual-core Marvell Armada 3720 SoC. > > Peripherals: > > - 5 Gigabit Ethernet ports (WAN has PoE, up to 30W, Topaz 6341 switch) > > - RTC clock (PCF8563) > > - USB 3.0 port > > - USB 2.0 port > > - 4x LED > > - UART over Micro-USB > > - M.2 slot (2280) > > - Mini PCI-E slot > > > > Additionally, automatic import of the Marvell hw_info parameters is > > enabled via the recently added mac command for A37XX platforms. > > The parameters stored in Marvell hw_info are usually the board serial > > number and MAC addresses. > > > > Signed-off-by: Luka Kovacic > > Cc: Luka Perkov > > Cc: Robert Marko > > --- > > arch/arm/dts/Makefile | 1 + > > .../arm/dts/armada-3720-espressobin-ultra.dts | 114 ++++++++++ > > arch/arm/dts/armada-3720-espressobin.dts | 199 +---------------- > > arch/arm/dts/armada-3720-espressobin.dtsi | 210 ++++++++++++++++++ > > board/Marvell/mvebu_armada-37xx/MAINTAINERS | 8 + > > board/Marvell/mvebu_armada-37xx/board.c | 92 +++++++- > > .../mvebu_espressobin-ultra-88f3720_defconfig | 93 ++++++++ > > 7 files changed, 514 insertions(+), 203 deletions(-) > > create mode 100644 arch/arm/dts/armada-3720-espressobin-ultra.dts > > create mode 100644 arch/arm/dts/armada-3720-espressobin.dtsi > > create mode 100644 configs/mvebu_espressobin-ultra-88f3720_defconfig > > Hello Luka! Please look at my comments from previous review: > https://lore.kernel.org/u-boot/20210227004852.5urcwnn6uxehuk72@pali/ > > I think it is not a good idea to duplicate espressobin code, specially > now when differences between v5, v7, non-emmc and emmc were > de-duplicated and correctly detected at runtime. Just use one DTS and > one config file and differences can be handled in board code functions > "board_fix_fdt" and "board_late_init". I believe that patching the DTS at runtime diminishes the value of device trees in the first case. As far as the v5, v7, non-emmc and emmc boards go I do understand that, as they are physically similar and more or less different revisions of the same board. The ESPRESSOBin Ultra board is completely different from those boards physically and so I doesn't make sense to me, why we would merge all of them into one device tree. I resorted to the Linux way and used a common dtsi for both the ESPRESSOBin - which is the base and the ESPRESSOBin-Ultra. > > > diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile > > index c42715ead4..f21c9c94d3 100644 > > --- a/arch/arm/dts/Makefile > > +++ b/arch/arm/dts/Makefile > > @@ -213,6 +213,7 @@ dtb-$(CONFIG_ARCH_TEGRA) +=3D tegra20-harmony.dtb \ > > dtb-$(CONFIG_ARCH_MVEBU) +=3D \ > > armada-3720-db.dtb \ > > armada-3720-espressobin.dtb \ > > + armada-3720-espressobin-ultra.dtb \ > > armada-3720-turris-mox.dtb \ > > armada-3720-uDPU.dtb \ > > armada-375-db.dtb \ > > diff --git a/arch/arm/dts/armada-3720-espressobin-ultra.dts b/arch/arm/= dts/armada-3720-espressobin-ultra.dts > > new file mode 100644 > > index 0000000000..5ad0c723e3 > > --- /dev/null > > +++ b/arch/arm/dts/armada-3720-espressobin-ultra.dts > > @@ -0,0 +1,114 @@ > > +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) > > +/* > > + * Device Tree file for ESPRESSObin-Ultra board > > + * Copyright (C) 2016 Marvell > > + * Copyright (C) 2019 Globalscale technologies, Inc. > > + * Copyright (C) 2021 Sartura Ltd. > > + * > > + * Author: Jason Hung > > + * Author: Luka Kovacic > > + * Author: Vladimir Vid > > + */ > > + > > +/dts-v1/; > > + > > +#include "armada-3720-espressobin.dtsi" > > + > > +/ { > > + model =3D "Globalscale Marvell ESPRESSOBin Ultra Board"; > > + compatible =3D "globalscale,espressobin-ultra", "marvell,armada37= 20", "marvell,armada3710"; > > + > > + gpio-leds { > > + pinctrl-names =3D "default"; > > + pinctrl-0 =3D <&led1_pins>, <&led2_pins>, <&led3_pins>, <= &led4_pins>; > > + compatible =3D "gpio-leds"; > > + > > + led1 { > > + label =3D "led1"; > > + gpios =3D <&gpionb 11 GPIO_ACTIVE_LOW>; > > + default-state =3D "on"; > > + }; > > + led2 { > > + label =3D "led2"; > > + gpios =3D <&gpionb 12 GPIO_ACTIVE_LOW>; > > + default-state =3D "on"; > > + }; > > + led3 { > > + label =3D "led3"; > > + gpios =3D <&gpionb 13 GPIO_ACTIVE_LOW>; > > + default-state =3D "on"; > > + }; > > + led4 { > > + label =3D "led4"; > > + gpios =3D <&gpionb 14 GPIO_ACTIVE_LOW>; > > + default-state =3D "on"; > > + }; > > + }; > > +}; > > + > > +&pinctrl_nb { > > + led1_pins: led1-pins { > > + groups =3D "pwm0"; > > + function =3D "gpio"; > > + }; > > + led2_pins: led2-pins { > > + groups =3D "pwm1"; > > + function =3D "gpio"; > > + }; > > + led3_pins: led3-pins { > > + groups =3D "pwm2"; > > + function =3D "gpio"; > > + }; > > + led4_pins: led4-pins { > > + groups =3D "pwm3"; > > + function =3D "gpio"; > > + }; > > +}; > > + > > +ð0 { > > + status =3D "okay"; > > + phy_addr =3D <0x3>; > > +}; > > + > > +&i2c0 { > > + status =3D "okay"; > > + #address-cells =3D <1>; > > + #size-cells =3D <0>; > > + rtc@51 { > > + compatible =3D "nxp,pcf8563"; > > + reg =3D <0x51>; > > + }; > > +}; > > + > > +&sata { > > + status =3D "okay"; > > +}; > > + > > +&sdhci0 { > > + status =3D "disabled"; > > +}; > > + > > +&sdhci1 { > > + status =3D "okay"; > > +}; > > + > > +&spi0 { > > + status =3D "okay"; > > +}; > > + > > +/* Exported on the micro USB connector through an FTDI */ > > +&uart0 { > > + status =3D "okay"; > > +}; > > + > > +&usb2 { > > + status =3D "okay"; > > +}; > > + > > +&usb3 { > > + status =3D "okay"; > > +}; > > + > > +&pcie0 { > > + status =3D "okay"; > > +}; > > diff --git a/arch/arm/dts/armada-3720-espressobin.dts b/arch/arm/dts/ar= mada-3720-espressobin.dts > > index cba6139be6..925ce6a38e 100644 > > --- a/arch/arm/dts/armada-3720-espressobin.dts > > +++ b/arch/arm/dts/armada-3720-espressobin.dts > > @@ -1,210 +1,15 @@ > > +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) > > /* > > * Device Tree file for Marvell Armada 3720 community board > > * (ESPRESSOBin) > > * Copyright (C) 2016 Marvell > > - * > > - * Gregory CLEMENT > > - * Konstantin Porotchkin > > - * > > - * 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" > > +#include "armada-3720-espressobin.dtsi" > > > > / { > > model =3D "Globalscale Marvell ESPRESSOBin Board"; > > compatible =3D "globalscale,espressobin", "marvell,armada3720", "= marvell,armada3710"; > > - > > - chosen { > > - stdout-path =3D "serial0:115200n8"; > > - }; > > - > > - aliases { > > - ethernet0 =3D ð0; > > - i2c0 =3D &i2c0; > > - spi0 =3D &spi0; > > - }; > > - > > - memory { > > - device_type =3D "memory"; > > - reg =3D <0x00000000 0x00000000 0x00000000 0x20000000>; > > - }; > > - > > - vcc_sd_reg0: regulator@0 { > > - compatible =3D "regulator-gpio"; > > - regulator-name =3D "vcc_sd0"; > > - regulator-min-microvolt =3D <1800000>; > > - regulator-max-microvolt =3D <3300000>; > > - regulator-type =3D "voltage"; > > - states =3D <1800000 0x1 > > - 3300000 0x0>; > > - gpios =3D <&gpionb 4 GPIO_ACTIVE_HIGH>; > > - }; > > -}; > > - > > -&comphy { > > - max-lanes =3D <3>; > > - phy0 { > > - phy-type =3D ; > > - phy-speed =3D ; > > - }; > > - > > - phy1 { > > - phy-type =3D ; > > - phy-speed =3D ; > > - }; > > - > > - phy2 { > > - phy-type =3D ; > > - phy-speed =3D ; > > - }; > > -}; > > - > > -ð0 { > > - status =3D "okay"; > > - pinctrl-names =3D "default"; > > - pinctrl-0 =3D <&rgmii_pins>, <&smi_pins>; > > - phy-mode =3D "rgmii"; > > - phy_addr =3D <0x1>; > > - fixed-link { > > - speed =3D <1000>; > > - full-duplex; > > - }; > > -}; > > - > > -&i2c0 { > > - pinctrl-names =3D "default"; > > - pinctrl-0 =3D <&i2c1_pins>; > > - status =3D "okay"; > > -}; > > - > > -/* CON3 */ > > -&sata { > > - status =3D "okay"; > > -}; > > - > > -&sdhci0 { > > - pinctrl-names =3D "default"; > > - pinctrl-0 =3D <&sdio_pins>; > > - bus-width =3D <4>; > > - cd-gpios =3D <&gpionb 3 GPIO_ACTIVE_LOW>; > > - vqmmc-supply =3D <&vcc_sd_reg0>; > > - status =3D "okay"; > > -}; > > - > > -/* U11 */ > > -&sdhci1 { > > - non-removable; > > - bus-width =3D <8>; > > - mmc-ddr-1_8v; > > - mmc-hs400-1_8v; > > - marvell,xenon-emmc; > > - marvell,xenon-tun-count =3D <9>; > > - marvell,pad-type =3D "fixed-1-8v"; > > - > > - pinctrl-names =3D "default"; > > - pinctrl-0 =3D <&mmc_pins>; > > - status =3D "okay"; > > - > > - #address-cells =3D <1>; > > - #size-cells =3D <0>; > > - mmccard: mmccard@0 { > > - compatible =3D "mmc-card"; > > - reg =3D <0>; > > - }; > > -}; > > - > > -&spi0 { > > - status =3D "okay"; > > - pinctrl-names =3D "default"; > > - pinctrl-0 =3D <&spi_quad_pins>; > > - > > - spi-flash@0 { > > - #address-cells =3D <1>; > > - #size-cells =3D <1>; > > - compatible =3D "st,m25p128", "jedec,spi-nor"; > > - reg =3D <0>; /* Chip select 0 */ > > - spi-max-frequency =3D <50000000>; > > - m25p,fast-read; > > - > > -#ifdef CONFIG_ENV_IS_IN_SPI_FLASH > > - partitions { > > - compatible =3D "fixed-partitions"; > > - #address-cells =3D <1>; > > - #size-cells =3D <1>; > > - > > - partition@firmware { > > - reg =3D <0 CONFIG_ENV_OFFSET>; > > - label =3D "firmware"; > > - }; > > - > > - partition@u-boot-env { > > - reg =3D ; > > - label =3D "u-boot-env"; > > - }; > > - }; > > -#endif > > - }; > > -}; > > - > > -/* Exported on the micro USB connector CON32 through an FTDI */ > > -&uart0 { > > - pinctrl-names =3D "default"; > > - pinctrl-0 =3D <&uart1_pins>; > > - status =3D "okay"; > > -}; > > - > > -/* CON29 */ > > -&usb2 { > > - status =3D "okay"; > > -}; > > - > > -/* CON31 */ > > -&usb3 { > > - status =3D "okay"; > > -}; > > - > > -&pcie0 { > > - pinctrl-names =3D "default"; > > - pinctrl-0 =3D <&pcie_pins>; > > - reset-gpios =3D <&gpiosb 3 GPIO_ACTIVE_LOW>; > > - status =3D "okay"; > > }; > > diff --git a/arch/arm/dts/armada-3720-espressobin.dtsi b/arch/arm/dts/a= rmada-3720-espressobin.dtsi > > new file mode 100644 > > index 0000000000..cba6139be6 > > --- /dev/null > > +++ b/arch/arm/dts/armada-3720-espressobin.dtsi > > @@ -0,0 +1,210 @@ > > +/* > > + * Device Tree file for Marvell Armada 3720 community board > > + * (ESPRESSOBin) > > + * Copyright (C) 2016 Marvell > > + * > > + * Gregory CLEMENT > > + * Konstantin Porotchkin > > + * > > + * 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 =3D "Globalscale Marvell ESPRESSOBin Board"; > > + compatible =3D "globalscale,espressobin", "marvell,armada3720", "= marvell,armada3710"; > > + > > + chosen { > > + stdout-path =3D "serial0:115200n8"; > > + }; > > + > > + aliases { > > + ethernet0 =3D ð0; > > + i2c0 =3D &i2c0; > > + spi0 =3D &spi0; > > + }; > > + > > + memory { > > + device_type =3D "memory"; > > + reg =3D <0x00000000 0x00000000 0x00000000 0x20000000>; > > + }; > > + > > + vcc_sd_reg0: regulator@0 { > > + compatible =3D "regulator-gpio"; > > + regulator-name =3D "vcc_sd0"; > > + regulator-min-microvolt =3D <1800000>; > > + regulator-max-microvolt =3D <3300000>; > > + regulator-type =3D "voltage"; > > + states =3D <1800000 0x1 > > + 3300000 0x0>; > > + gpios =3D <&gpionb 4 GPIO_ACTIVE_HIGH>; > > + }; > > +}; > > + > > +&comphy { > > + max-lanes =3D <3>; > > + phy0 { > > + phy-type =3D ; > > + phy-speed =3D ; > > + }; > > + > > + phy1 { > > + phy-type =3D ; > > + phy-speed =3D ; > > + }; > > + > > + phy2 { > > + phy-type =3D ; > > + phy-speed =3D ; > > + }; > > +}; > > + > > +ð0 { > > + status =3D "okay"; > > + pinctrl-names =3D "default"; > > + pinctrl-0 =3D <&rgmii_pins>, <&smi_pins>; > > + phy-mode =3D "rgmii"; > > + phy_addr =3D <0x1>; > > + fixed-link { > > + speed =3D <1000>; > > + full-duplex; > > + }; > > +}; > > + > > +&i2c0 { > > + pinctrl-names =3D "default"; > > + pinctrl-0 =3D <&i2c1_pins>; > > + status =3D "okay"; > > +}; > > + > > +/* CON3 */ > > +&sata { > > + status =3D "okay"; > > +}; > > + > > +&sdhci0 { > > + pinctrl-names =3D "default"; > > + pinctrl-0 =3D <&sdio_pins>; > > + bus-width =3D <4>; > > + cd-gpios =3D <&gpionb 3 GPIO_ACTIVE_LOW>; > > + vqmmc-supply =3D <&vcc_sd_reg0>; > > + status =3D "okay"; > > +}; > > + > > +/* U11 */ > > +&sdhci1 { > > + non-removable; > > + bus-width =3D <8>; > > + mmc-ddr-1_8v; > > + mmc-hs400-1_8v; > > + marvell,xenon-emmc; > > + marvell,xenon-tun-count =3D <9>; > > + marvell,pad-type =3D "fixed-1-8v"; > > + > > + pinctrl-names =3D "default"; > > + pinctrl-0 =3D <&mmc_pins>; > > + status =3D "okay"; > > + > > + #address-cells =3D <1>; > > + #size-cells =3D <0>; > > + mmccard: mmccard@0 { > > + compatible =3D "mmc-card"; > > + reg =3D <0>; > > + }; > > +}; > > + > > +&spi0 { > > + status =3D "okay"; > > + pinctrl-names =3D "default"; > > + pinctrl-0 =3D <&spi_quad_pins>; > > + > > + spi-flash@0 { > > + #address-cells =3D <1>; > > + #size-cells =3D <1>; > > + compatible =3D "st,m25p128", "jedec,spi-nor"; > > + reg =3D <0>; /* Chip select 0 */ > > + spi-max-frequency =3D <50000000>; > > + m25p,fast-read; > > + > > +#ifdef CONFIG_ENV_IS_IN_SPI_FLASH > > + partitions { > > + compatible =3D "fixed-partitions"; > > + #address-cells =3D <1>; > > + #size-cells =3D <1>; > > + > > + partition@firmware { > > + reg =3D <0 CONFIG_ENV_OFFSET>; > > + label =3D "firmware"; > > + }; > > + > > + partition@u-boot-env { > > + reg =3D ; > > + label =3D "u-boot-env"; > > + }; > > + }; > > +#endif > > + }; > > +}; > > + > > +/* Exported on the micro USB connector CON32 through an FTDI */ > > +&uart0 { > > + pinctrl-names =3D "default"; > > + pinctrl-0 =3D <&uart1_pins>; > > + status =3D "okay"; > > +}; > > + > > +/* CON29 */ > > +&usb2 { > > + status =3D "okay"; > > +}; > > + > > +/* CON31 */ > > +&usb3 { > > + status =3D "okay"; > > +}; > > + > > +&pcie0 { > > + pinctrl-names =3D "default"; > > + pinctrl-0 =3D <&pcie_pins>; > > + reset-gpios =3D <&gpiosb 3 GPIO_ACTIVE_LOW>; > > + status =3D "okay"; > > +}; > > diff --git a/board/Marvell/mvebu_armada-37xx/MAINTAINERS b/board/Marvel= l/mvebu_armada-37xx/MAINTAINERS > > index f2c0a582d7..d69af832fc 100644 > > --- a/board/Marvell/mvebu_armada-37xx/MAINTAINERS > > +++ b/board/Marvell/mvebu_armada-37xx/MAINTAINERS > > @@ -10,6 +10,14 @@ M: Konstantin Porotchkin > > S: Maintained > > F: configs/mvebu_espressobin-88f3720_defconfig > > > > +ESPRESSOBin-Ultra BOARD > > +M: Luka Kovacic > > +M: Robert Marko > > +M: Luka Perkov > > +S: Maintained > > +F: arch/arm/dts/armada-3720-espressobin-ultra.dts > > +F: configs/mvebu_espressobin-ultra-88f3720_defconfig > > + > > uDPU BOARD > > M: Vladimir Vid > > S: Maintained > > diff --git a/board/Marvell/mvebu_armada-37xx/board.c b/board/Marvell/mv= ebu_armada-37xx/board.c > > index 2de9c2ac17..21c1eb7b22 100644 > > --- a/board/Marvell/mvebu_armada-37xx/board.c > > +++ b/board/Marvell/mvebu_armada-37xx/board.c > > @@ -11,6 +11,7 @@ > > #include > > #include > > #include > > +#include > > #include > > #include > > #include > > @@ -55,6 +56,15 @@ DECLARE_GLOBAL_DATA_PTR; > > #define MVEBU_G2_SMI_PHY_CMD_REG (24) > > #define MVEBU_G2_SMI_PHY_DATA_REG (25) > > > > +/* Marvell 88E1512 */ > > +#define MII_MARVELL_PHY_PAGE 22 > > + > > +#define MV88E1512_GENERAL_CTRL 20 > > +#define MV88E1512_MODE_SGMII 1 > > +#define MV88E1512_RESET_OFFS 15 > > + > > +#define ULTRA_MV88E1512_PHYADDR 0x1 > > + > > /* > > * Memory Controller Registers > > * > > @@ -282,12 +292,68 @@ static int mii_multi_chip_mode_write(struct mii_d= ev *bus, int dev_smi_addr, > > return 0; > > } > > > > -/* Bring-up board-specific network stuff */ > > -int board_network_enable(struct mii_dev *bus) > > +void force_phy_88e1512_sgmii_to_copper(u16 devaddr) > > { > > - if (!of_machine_is_compatible("globalscale,espressobin")) > > - return 0; > > + const char *name; > > + u16 reg; > > + > > + name =3D miiphy_get_current_dev(); > > + if (name) { > > + /* SGMII-to-Copper mode initialization */ > > + > > + /* Select page 18 */ > > + miiphy_write(name, devaddr, MII_MARVELL_PHY_PAGE, 0x12); > > + /* In reg 20, write MODE[2:0] =3D 0x1 (SGMII to Copper) *= / > > + miiphy_read(name, devaddr, MV88E1512_GENERAL_CTRL, ®); > > + reg &=3D ~0x7; > > + reg |=3D MV88E1512_MODE_SGMII; > > + miiphy_write(name, devaddr, MV88E1512_GENERAL_CTRL, reg); > > + /* PHY reset is necessary after changing MODE[2:0] */ > > + miiphy_read(name, devaddr, MV88E1512_GENERAL_CTRL, ®); > > + reg |=3D 1 << MV88E1512_RESET_OFFS; > > + miiphy_write(name, devaddr, MV88E1512_GENERAL_CTRL, reg); > > + /* Reset page selection */ > > + miiphy_write(name, devaddr, MII_MARVELL_PHY_PAGE, 0); > > + udelay(100); > > + } > > +} > > + > > +int board_network_enable_espressobin_ultra(struct mii_dev *bus) > > +{ > > + int i; > > + /* Setup 88E1512 SGMII-to-Copper mode */ > > + force_phy_88e1512_sgmii_to_copper(ULTRA_MV88E1512_PHYADDR); > > > > + /* > > + * FIXME: remove this code once Topaz driver gets available > > + * A3720 ESPRESSObin Ultra Board Only > > + * Configure Topaz switch (88E6341) > > + * Set port 1,2,3,4,5 to forwarding Mode (through Switch Port reg= isters) > > + */ > > + for (i =3D 0; i <=3D 5; i++) { > > + mii_multi_chip_mode_write(bus, 3, MVEBU_PORT_CTRL_SMI_ADD= R(i), > > + MVEBU_SW_PORT_CTRL_REG, > > + i =3D=3D 5 ? 0x7c : 0x7f); > > + } > > + > > + /* RGMII Delay on Port 0 (CPU port), force link to 1000Mbps */ > > + mii_multi_chip_mode_write(bus, 3, MVEBU_PORT_CTRL_SMI_ADDR(0), > > + MVEBU_SW_LINK_CTRL_REG, 0xe002); > > + > > + /* Power up PHY 1, 2, 3, 4, 5 (through Global 2 registers) */ > > + mii_multi_chip_mode_write(bus, 3, MVEBU_SW_G2_SMI_ADDR, > > + MVEBU_G2_SMI_PHY_DATA_REG, 0x1140); > > + for (i =3D 1; i <=3D 5; i++) { > > + mii_multi_chip_mode_write(bus, 3, MVEBU_SW_G2_SMI_ADDR, > > + MVEBU_G2_SMI_PHY_CMD_REG, 0x940= 0 + > > + (MVEBU_PORT_CTRL_SMI_ADDR(i) <<= 5)); > > + } > > + > > + return 0; > > +} > > + > > +int board_network_enable_espressobin(struct mii_dev *bus) > > +{ > > /* > > * FIXME: remove this code once Topaz driver gets available > > * A3720 Community Board Only > > @@ -328,6 +394,16 @@ int board_network_enable(struct mii_dev *bus) > > return 0; > > } > > > > +/* Bring-up the board-specific networking */ > > +int board_network_enable(struct mii_dev *bus) > > +{ > > + if (of_machine_is_compatible("globalscale,espressobin")) > > + return board_network_enable_espressobin(bus); > > + if (of_machine_is_compatible("globalscale,espressobin-ultra")) > > + return board_network_enable_espressobin_ultra(bus); > > + return 0; > > +} > > + > > #if defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_ENV_IS_IN_SPI_FLA= SH) > > int ft_board_setup(void *blob, struct bd_info *bd) > > { > > @@ -336,8 +412,12 @@ int ft_board_setup(void *blob, struct bd_info *bd) > > int parts_off; > > int part_off; > > > > - /* Fill SPI MTD partitions for Linux kernel on Espressobin */ > > - if (!of_machine_is_compatible("globalscale,espressobin")) > > + /* > > + * Fill SPI MTD partitions for the Linux kernel on ESPRESSOBin an= d > > + * ESPRESSOBin Ultra boards. > > + */ > > + if (!of_machine_is_compatible("globalscale,espressobin") && > > + !of_machine_is_compatible("globalscale,espressobin-ultra")) > > return 0; > > > > spi_off =3D fdt_node_offset_by_compatible(blob, -1, "jedec,spi-no= r"); > > diff --git a/configs/mvebu_espressobin-ultra-88f3720_defconfig b/config= s/mvebu_espressobin-ultra-88f3720_defconfig > > new file mode 100644 > > index 0000000000..1bac0a96ad > > --- /dev/null > > +++ b/configs/mvebu_espressobin-ultra-88f3720_defconfig > > @@ -0,0 +1,93 @@ > > +CONFIG_ARM=3Dy > > +CONFIG_ARCH_CPU_INIT=3Dy > > +CONFIG_ARCH_MVEBU=3Dy > > +CONFIG_SYS_TEXT_BASE=3D0x00000000 > > +CONFIG_SYS_MALLOC_F_LEN=3D0x2000 > > +CONFIG_NR_DRAM_BANKS=3D1 > > +CONFIG_TARGET_MVEBU_ARMADA_37XX=3Dy > > +CONFIG_ENV_SIZE=3D0x10000 > > +CONFIG_ENV_OFFSET=3D0x3F0000 > > +CONFIG_ENV_SECT_SIZE=3D0x10000 > > +CONFIG_DM_GPIO=3Dy > > +CONFIG_DEBUG_UART_BASE=3D0xd0012000 > > +CONFIG_DEFAULT_DEVICE_TREE=3D"armada-3720-espressobin-ultra" > > +CONFIG_DEBUG_UART=3Dy > > +CONFIG_AHCI=3Dy > > +CONFIG_DISTRO_DEFAULTS=3Dy > > +# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set > > +CONFIG_OF_BOARD_SETUP=3Dy > > +CONFIG_FIT=3Dy > > +CONFIG_FIT_VERBOSE=3Dy > > +CONFIG_FIT_BEST_MATCH=3Dy > > +CONFIG_AUTOBOOT_KEYED=3Dy > > +CONFIG_AUTOBOOT_PROMPT=3D"Autoboot in %d seconds, to stop use 's' key\= n" > > +CONFIG_AUTOBOOT_STOP_STR=3D"s" > > +CONFIG_AUTOBOOT_KEYED_CTRLC=3Dy > > +CONFIG_HUSH_PARSER=3Dy > > +CONFIG_SYS_CONSOLE_INFO_QUIET=3Dy > > +# CONFIG_DISPLAY_CPUINFO is not set > > +# CONFIG_DISPLAY_BOARDINFO is not set > > +CONFIG_DISPLAY_BOARDINFO_LATE=3Dy > > +CONFIG_ARCH_EARLY_INIT_R=3Dy > > +CONFIG_BOARD_EARLY_INIT_F=3Dy > > +CONFIG_BOARD_LATE_INIT=3Dy > > +# CONFIG_CMD_FLASH is not set > > +CONFIG_CMD_GPIO=3Dy > > +CONFIG_CMD_I2C=3Dy > > +CONFIG_CMD_MMC=3Dy > > +CONFIG_CMD_MTD=3Dy > > +CONFIG_CMD_PCI=3Dy > > +CONFIG_CMD_SPI=3Dy > > +CONFIG_CMD_USB=3Dy > > +CONFIG_CMD_WDT=3Dy > > +# CONFIG_CMD_SETEXPR is not set > > +CONFIG_CMD_TFTPPUT=3Dy > > +CONFIG_CMD_CACHE=3Dy > > +CONFIG_CMD_TIME=3Dy > > +CONFIG_CMD_MVEBU_BUBT=3Dy > > +CONFIG_MVEBU_MAC_HW_INFO=3Dy > > +CONFIG_CMD_EXT4_WRITE=3Dy > > +CONFIG_MAC_PARTITION=3Dy > > +CONFIG_ENV_OVERWRITE=3Dy > > +CONFIG_ENV_IS_IN_SPI_FLASH=3Dy > > +CONFIG_SYS_RELOC_GD_ENV_ADDR=3Dy > > +CONFIG_NET_RANDOM_ETHADDR=3Dy > > +CONFIG_AHCI_MVEBU=3Dy > > +CONFIG_CLK=3Dy > > +CONFIG_CLK_MVEBU=3Dy > > +CONFIG_DM_I2C=3Dy > > +CONFIG_MISC=3Dy > > +CONFIG_MMC_SDHCI=3Dy > > +CONFIG_MMC_SDHCI_SDMA=3Dy > > +CONFIG_MMC_SDHCI_XENON=3Dy > > +CONFIG_MTD=3Dy > > +CONFIG_DM_MTD=3Dy > > +CONFIG_SF_DEFAULT_MODE=3D0 > > +CONFIG_SPI_FLASH_MACRONIX=3Dy > > +CONFIG_SPI_FLASH_MTD=3Dy > > +CONFIG_PHY_MARVELL=3Dy > > +CONFIG_PHY_GIGE=3Dy > > +CONFIG_MVNETA=3Dy > > +CONFIG_PCI=3Dy > > +CONFIG_PCI_AARDVARK=3Dy > > +CONFIG_PHY=3Dy > > +CONFIG_MVEBU_COMPHY_SUPPORT=3Dy > > +CONFIG_PINCTRL=3Dy > > +CONFIG_PINCTRL_ARMADA_37XX=3Dy > > +CONFIG_DM_REGULATOR_GPIO=3Dy > > +CONFIG_DEBUG_UART_SHIFT=3D2 > > +CONFIG_DEBUG_UART_ANNOUNCE=3Dy > > +CONFIG_MVEBU_A3700_UART=3Dy > > +CONFIG_MVEBU_A3700_SPI=3Dy > > +CONFIG_USB=3Dy > > +CONFIG_USB_XHCI_HCD=3Dy > > +CONFIG_USB_EHCI_HCD=3Dy > > +CONFIG_USB_HOST_ETHER=3Dy > > +# CONFIG_WATCHDOG_AUTOSTART is not set > > +CONFIG_WDT=3Dy > > +CONFIG_WDT_ARMADA_37XX=3Dy > > +CONFIG_SHA1=3Dy > > +CONFIG_DM_RTC=3Dy > > +CONFIG_RTC_PCF8563=3Dy > > +CONFIG_LED=3Dy > > +CONFIG_LED_GPIO=3Dy > > -- > > 2.31.1 > > Kind regards, Luka