Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp6209016rwi; Tue, 18 Oct 2022 09:22:18 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7LTbDs3AwTcb5sKV1tngluvYU4W5lHHCpVHHMkPIIOuoDG87tSORlr98Hcxz35PRrpPXuR X-Received: by 2002:a17:907:6d29:b0:78d:d12d:15af with SMTP id sa41-20020a1709076d2900b0078dd12d15afmr3129671ejc.53.1666110137885; Tue, 18 Oct 2022 09:22:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666110137; cv=none; d=google.com; s=arc-20160816; b=oSPxG5YcaG/0GoIMvHctClCiVMGjOwhIUpkBcGb36db7VW+Dcr9mh+aU0bQjNkK5A8 Xl94YUOm7vJDEASqO+UcCyuzl8CASCJjWcjA7+PppcA88bFszw4C55hxngkSoL6EiC9o /RnJn6X/1x+uMEXnZvOrfaJGWjN4qb9rocizI09lgCw3HQXTnbXIGUL+ywIGu8LGFedc yqYTAnoVgc4X+JGTlzemHiN2s1wzedcsg0t4LnqXvoHVSVCjaTXFL5ArthrtZFvI9tqp kU0Eu+BeMAbH4NzR/SGPss6xRT8DFhofgNzL0vNmDHInv10Vw7Yh3XzmryoPy9jafCws S8hQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=y6hCJkFqagNxMfW9SDbCFBpsm7z3HVXT6Fjd2UYXEv4=; b=QqQtohj5jW1z/CoqtdFTOPGMYboG3jd4NP829UU+qPhFfRj+O1DN3MoLkUPbsBNcq6 GfK7jbrUfgdHxexgOLZEqUmIqZbohWdz5D6ETtNuEJjgI4TRxAu/8CzS2P+r0t9vu/Qu eaQyVfN34hsf6S6R0Y+zTE5lOvqI1NQSTtKqu5djQvvzJ104047A40m+vxfT/icZjdDR LEwfkZujgRzUvtSAof33wAZ0VSHruR8DgctdTuGfVEwJ8S4F+YCpvJ3/QIqb3NjZRByv pN5SDXP8FhjVkzidjx8qkWv4knwUgDkC6y71nu0ZWxA6+n8OclMcdzW1BE9ffk3uHScv 0YxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Ne/MjDOG"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qf38-20020a1709077f2600b007823754ecd5si13198047ejc.43.2022.10.18.09.21.50; Tue, 18 Oct 2022 09:22:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Ne/MjDOG"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230230AbiJRPi4 (ORCPT + 99 others); Tue, 18 Oct 2022 11:38:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60922 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229807AbiJRPiz (ORCPT ); Tue, 18 Oct 2022 11:38:55 -0400 Received: from mail-qk1-x736.google.com (mail-qk1-x736.google.com [IPv6:2607:f8b0:4864:20::736]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A2376BE51E for ; Tue, 18 Oct 2022 08:38:53 -0700 (PDT) Received: by mail-qk1-x736.google.com with SMTP id j21so8857898qkk.9 for ; Tue, 18 Oct 2022 08:38:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=y6hCJkFqagNxMfW9SDbCFBpsm7z3HVXT6Fjd2UYXEv4=; b=Ne/MjDOGNroy+zY/MyDh4x9b4cUAtHXC3Rm/aJyvKhXjbC/tyGcNEPVVgFHPPcKwma TKIUjPHHuaMnNg893nblJ9gtPaaoEmQ+1Pz4mWg1V1IoxKKiB0YxSs4ko/Bj7ria4e1w VSRdItIayeT7oo91BgVScj5mPAGGwIWE9J7HcCUSgyRNZlWO+3V1S+g6+UMfsqpMNmil 9teAO4pdFzJ7d2tsjW8DD5x0Wk7li2NWrOTpMdXam/ifK1q7jcYSYTbPcdqk6k9r3zWL gMvgi+8Dcj7Iiy3Dtd7uZuOxaXYwLCEii5mzglfB+YA7rCyc57id1xYfXlI8Evn9KRAZ VBHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=y6hCJkFqagNxMfW9SDbCFBpsm7z3HVXT6Fjd2UYXEv4=; b=nSa0xJtvw2a0ikivN3YEDZpKlpAnz9p7zwnExC0fgtkugS7HSkWcb4ZosWyoy16NlI OscKYrKqCsOU4yq/IymR2PkRBvhSud2UnQa/fgrmpp6pqRcbhBxey68E1oX2IkKhNoU/ af+uURBbOR6p+0Y3w3/zEMMWLxE0CibRQIVlYkyH954mA0E/31sOyAvNM4ybr48he4xT weqxrAXGFbrXJbjtzupM+gVvZyVhodHdWV7iS2zzn+odVrW8TzzvucPhTv0qoxBrafS5 4EMqIORk9yoIeTT8NA6zFDxAzNLwpNAE8C0gfBD4wma6velH8+lCOI9cWfpqkUnMg6qQ bbnQ== X-Gm-Message-State: ACrzQf2sy5ac/rwbJ1rI0ygIr9UAIXNJ2P/VFaPMqAj6UbWjnaIT1vxY pZ5Y9xOAn0RaYFcagr6ucCu59A== X-Received: by 2002:a05:620a:1709:b0:6ed:4817:1d02 with SMTP id az9-20020a05620a170900b006ed48171d02mr2275958qkb.73.1666107532699; Tue, 18 Oct 2022 08:38:52 -0700 (PDT) Received: from [192.168.10.124] (pool-72-83-177-149.washdc.east.verizon.net. [72.83.177.149]) by smtp.gmail.com with ESMTPSA id ci19-20020a05622a261300b0035badb499c7sm2157359qtb.21.2022.10.18.08.38.51 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 18 Oct 2022 08:38:52 -0700 (PDT) Message-ID: Date: Tue, 18 Oct 2022 11:38:51 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.0 Subject: Re: [RFC v1 12/12] arm64: dts: mt7986: add Bananapi R3 Content-Language: en-US To: Frank Wunderlich , linux-mediatek@lists.infradead.org Cc: Frank Wunderlich , Rob Herring , Krzysztof Kozlowski , Matthias Brugger , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <20221017104141.7338-1-linux@fw-web.de> <20221017104141.7338-13-linux@fw-web.de> From: Krzysztof Kozlowski In-Reply-To: <20221017104141.7338-13-linux@fw-web.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 17/10/2022 06:41, Frank Wunderlich wrote: > From: Frank Wunderlich > > Add support for Bananapi R3 SBC. > > - SD/eMMC support (switching first 4 bits of data-bus with sw6/D) > - all rj45 ports and both SFP working (eth1/lan4) > - PCIe and all USB-Ports + SIM-Slot tested > - i2c and all uarts tested > - wifi tested Thank you for your patch. There is something to discuss/improve. > > Signed-off-by: Frank Wunderlich > --- > SPI-NAND/NOR switched (CS by sw5/C) not yet included > this is done with DT-Overlays in my tree, but i have no idea yet, > how to upstream > > break some lines in wifi-eeprom-data because of checkpatch warnings. > originally there were 8 x int32 per line > --- > arch/arm64/boot/dts/mediatek/Makefile | 2 + > .../mediatek/mt7986a-bananapi-bpi-r3-emmc.dts | 34 + > .../mediatek/mt7986a-bananapi-bpi-r3-sd.dts | 29 + > .../dts/mediatek/mt7986a-bananapi-bpi-r3.dtsi | 609 ++++++++++++++++++ > 4 files changed, 674 insertions(+) > create mode 100644 arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3-emmc.dts > create mode 100644 arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3-sd.dts > create mode 100644 arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dtsi > > diff --git a/arch/arm64/boot/dts/mediatek/Makefile b/arch/arm64/boot/dts/mediatek/Makefile > index 0ec90cb3ef28..c22cd3e6b98f 100644 > --- a/arch/arm64/boot/dts/mediatek/Makefile > +++ b/arch/arm64/boot/dts/mediatek/Makefile > @@ -8,6 +8,8 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += mt6797-x20-dev.dtb > dtb-$(CONFIG_ARCH_MEDIATEK) += mt7622-rfb1.dtb > dtb-$(CONFIG_ARCH_MEDIATEK) += mt7622-bananapi-bpi-r64.dtb > dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-rfb.dtb > +dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-sd.dtb> +dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-emmc.dtb Alphabetical order > dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986b-rfb.dtb > dtb-$(CONFIG_ARCH_MEDIATEK) += mt8167-pumpkin.dtb > dtb-$(CONFIG_ARCH_MEDIATEK) += mt8173-elm.dtb > diff --git a/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3-emmc.dts b/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3-emmc.dts > new file mode 100644 > index 000000000000..859b4180ca11 > --- /dev/null > +++ b/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3-emmc.dts > @@ -0,0 +1,34 @@ > +// SPDX-License-Identifier: (GPL-2.0 OR MIT) > +/* > + * Copyright (C) 2021 MediaTek Inc. > + * Author: Sam.Shih > + */ > + > +/dts-v1/; > +#include > +#include > + > +#include "mt7986a-bananapi-bpi-r3.dtsi" > + > +/ { > + model = "Bananapi BPI-R3 (emmc)"; > +}; > + > +&mmc0 { > + pinctrl-names = "default", "state_uhs"; > + pinctrl-0 = <&mmc0_pins_default>; > + pinctrl-1 = <&mmc0_pins_uhs>; > + bus-width = <8>; > + max-frequency = <200000000>; > + cap-mmc-highspeed; > + mmc-hs200-1_8v; > + mmc-hs400-1_8v; > + hs400-ds-delay = <0x14014>; > + vmmc-supply = <®_3p3v>; > + vqmmc-supply = <®_1p8v>; > + non-removable; > + no-sd; > + no-sdio; > + status = "okay"; > +}; > + > diff --git a/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3-sd.dts b/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3-sd.dts > new file mode 100644 > index 000000000000..57200407ab86 > --- /dev/null > +++ b/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3-sd.dts > @@ -0,0 +1,29 @@ > +// SPDX-License-Identifier: (GPL-2.0 OR MIT) > +/* > + * Copyright (C) 2021 MediaTek Inc. > + * Author: Sam.Shih > + */ > + > +/dts-v1/; > +#include > +#include > + > +#include "mt7986a-bananapi-bpi-r3.dtsi" > + > +/ { > + model = "Bananapi BPI-R3 (sdmmc)"; > +}; > + > +&mmc0 { > + //sdcard > + pinctrl-names = "default", "state_uhs"; > + pinctrl-0 = <&mmc0_pins_default>; > + pinctrl-1 = <&mmc0_pins_uhs>; > + bus-width = <4>; > + max-frequency = <52000000>; > + cap-sd-highspeed; > + vmmc-supply = <®_3p3v>; > + vqmmc-supply = <®_1p8v>; > + status = "okay"; > +}; > + > diff --git a/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dtsi b/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dtsi > new file mode 100644 > index 000000000000..b2317e894855 > --- /dev/null > +++ b/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dtsi > @@ -0,0 +1,609 @@ > +// SPDX-License-Identifier: (GPL-2.0 OR MIT) > +/* > + * Copyright (C) 2021 MediaTek Inc. > + * Authors: Sam.Shih > + * Frank Wunderlich > + * Daniel Golle > + */ > + > +/dts-v1/; > +#include > +#include > +#include > + > +#include "mt7986a.dtsi" > + > +/ { > + model = "Bananapi BPI-R3"; > + compatible = "bananapi,bpi-r3", "mediatek,mt7986a"; > + > + aliases { > + serial0 = &uart0; > + ethernet0 = &gmac0; > + ethernet1 = &gmac1; > + }; > + > + chosen { > + stdout-path = "serial0:115200n8"; > + }; > + > + gpio-keys { > + compatible = "gpio-keys"; > + > + factory { key/button prefix Does not look like you tested the DTS against bindings. Please run `make dtbs_check` (see Documentation/devicetree/bindings/writing-schema.rst for instructions). > + label = "reset"; > + linux,code = ; > + gpios = <&pio 9 GPIO_ACTIVE_LOW>; > + }; > + > + wps { > + label = "wps"; > + linux,code = ; > + gpios = <&pio 10 GPIO_ACTIVE_LOW>; > + }; > + }; > + > + /* i2c of the left SFP cage (wan) */ > + i2c_sfp1: i2c-gpio-0 { > + compatible = "i2c-gpio"; > + sda-gpios = <&pio 16 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; > + scl-gpios = <&pio 17 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; > + i2c-gpio,delay-us = <2>; > + #address-cells = <1>; > + #size-cells = <0>; > + }; > + > + /* i2c of the right SFP cage (lan) */ > + i2c_sfp2: i2c-gpio-1 { > + compatible = "i2c-gpio"; > + sda-gpios = <&pio 18 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; > + scl-gpios = <&pio 19 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; > + i2c-gpio,delay-us = <2>; > + #address-cells = <1>; > + #size-cells = <0>; > + }; > + > + leds { > + compatible = "gpio-leds"; > + > + green_led: led-0 { > + color = ; > + function = LED_FUNCTION_POWER; > + gpios = <&pio 69 GPIO_ACTIVE_HIGH>; > + default-state = "on"; > + }; > + > + blue_led: led-1 { > + color = ; > + function = LED_FUNCTION_STATUS; > + gpios = <&pio 86 GPIO_ACTIVE_HIGH>; > + default-state = "off"; > + }; > + }; Blank line > + memory@40000000 { > + device_type = "memory"; > + reg = <0 0x40000000 0 0x40000000>; > + }; > + > + reg_1p8v: regulator-1p8v { > + compatible = "regulator-fixed"; > + regulator-name = "fixed-1.8V"; > + regulator-min-microvolt = <1800000>; > + regulator-max-microvolt = <1800000>; > + regulator-boot-on; > + regulator-always-on; > + }; > + > + reg_3p3v: regulator-3p3v { > + compatible = "regulator-fixed"; > + regulator-name = "fixed-3.3V"; > + regulator-min-microvolt = <3300000>; > + regulator-max-microvolt = <3300000>; > + regulator-boot-on; > + regulator-always-on; > + }; > + > + reg_5v: regulator-5v { > + compatible = "regulator-fixed"; > + regulator-name = "fixed-5V"; > + regulator-min-microvolt = <5000000>; > + regulator-max-microvolt = <5000000>; > + regulator-boot-on; > + regulator-always-on; > + }; > + > + /* left SFP cage (wan) */ > + sfp1: sfp1 { sfp-1 > + compatible = "sff,sfp"; > + i2c-bus = <&i2c_sfp1>; > + los-gpio = <&pio 46 GPIO_ACTIVE_HIGH>; > + moddef0-gpio = <&pio 49 GPIO_ACTIVE_LOW>; > + tx-disable-gpio = <&pio 20 GPIO_ACTIVE_HIGH>; > + tx-fault-gpio = <&pio 7 GPIO_ACTIVE_HIGH>; > + }; > + > + /* right SFP cage (lan) */ > + sfp2: sfp2 { sfp-2 > + compatible = "sff,sfp"; > + i2c-bus = <&i2c_sfp2>; > + los-gpios = <&pio 31 GPIO_ACTIVE_HIGH>; > + mod-def0-gpios = <&pio 47 GPIO_ACTIVE_LOW>; > + tx-disable-gpios = <&pio 15 GPIO_ACTIVE_HIGH>; > + tx-fault-gpios = <&pio 48 GPIO_ACTIVE_HIGH>; > + }; > +}; > + > +&crypto { > + status = "okay"; > +}; > + > +ð { > + status = "okay"; > + > + gmac0: mac@0 { > + compatible = "mediatek,eth-mac"; > + reg = <0>; > + phy-mode = "2500base-x"; > + > + fixed-link { > + speed = <2500>; > + full-duplex; > + pause; > + }; > + }; > + > + gmac1: mac@1 { > + compatible = "mediatek,eth-mac"; > + reg = <1>; > + phy-mode = "2500base-x"; > + sfp = <&sfp1>; > + managed = "in-band-status"; > + }; > + > + mdio: mdio-bus { > + #address-cells = <1>; > + #size-cells = <0>; > + }; > +}; > + > +&mdio { > + switch: switch@0 { > + compatible = "mediatek,mt7531"; > + reg = <31>; This does not match your unit address. > + reset-gpios = <&pio 5 GPIO_ACTIVE_HIGH>; > + }; > +}; > + > +&i2c0 { > + pinctrl-names = "default"; > + pinctrl-0 = <&i2c_pins>; > + status = "okay"; > +}; > + > +&pcie { > + pinctrl-names = "default"; > + pinctrl-0 = <&pcie_pins>; > + status = "okay"; > +}; > + > +&pcie_phy { > + status = "okay"; > +}; > + > +&pio { > + i2c_pins: i2c-pins-3-4 { Usually bindings expect certain suffix or prefix. Are you sure this passes dtbs_check? Best regards, Krzysztof