From patchwork Sat Feb 20 11:53:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rui Salvaterra X-Patchwork-Id: 1442610 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=QV4E22LX; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=H9S/s/WA; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DjRjf4M29z9sW2 for ; Sat, 20 Feb 2021 22:56:06 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=T4TB+QXZil31Y1FgzROPnkZgYKlC/ZUSp2v87p3lJt8=; b=QV4E22LX+pdX2ThIl2cfV8+2a 3vxqT/Mt7AhQ2pBVad6JbpEVQdVV5c0D2dH/Ur5oQ+tqW8bApkQdsT0xjWY+JHX69+vqrOhOa2Rcc 2OMu1mfq03yevoVDzFQ9z2rfSiOwH5ZfKzyYX8qyqfIo4fb9iXrXdPwYK1tXkDljaWNyNBmcUAGD2 DA67cwZcPK0DajfmItO/MA5e1/3xeeRFVy2doEu4G8/pzCw/j2lT+z6JRyoSSvIG/VeqHdvYO4q2J HmiWU6gVGKZ99SdYUCJenbo1lxXtT+dN+40C9gB4VvzUT4en3dYs2JJldgKEhTFXqRpQMca4ZsNBY 5k6o46nFA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1lDQpz-00040L-J6; Sat, 20 Feb 2021 11:54:15 +0000 Received: from mail-qt1-x835.google.com ([2607:f8b0:4864:20::835]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1lDQpo-0003xg-G9 for openwrt-devel@lists.openwrt.org; Sat, 20 Feb 2021 11:54:09 +0000 Received: by mail-qt1-x835.google.com with SMTP id g24so5967801qts.2 for ; Sat, 20 Feb 2021 03:54:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=W5lmTEC6uryrxwhA32YMVNsuBpa7Eh62ypDXLfskoUQ=; b=H9S/s/WABI2GYdnLxYjb4LoKvZF8fU910Iaz2oK91Ar/Hd2UiiF/VKIM+nSt2nbV34 nnc2omLfWgyaKTSvxqcR8Mw9AFZ/UYxu4XdVWHMPysvbCfnq5NhvEotkLvDxCWBqJKQP c86T2l4QdKyr53M5ngzcuirLZy6g7nET2UxtEOE2E1L3iabLbmsQxRFq8rpuJic4mRsb mE37UzguYqch2cnXM2nSSn+eai3Zh/QfT4eYaev040AnfzoM7AhSzRVBGiU3xVbq5iDy 231gCNpeueyL7vDiKmk8D8+68toC/WoX5HLpeViiNu2SF2z9T8yelzUjTfrnTP2NMuwC awRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=W5lmTEC6uryrxwhA32YMVNsuBpa7Eh62ypDXLfskoUQ=; b=Gh/fjImWY6zxeEzzFocoMppDeuazDsxOL1mMFKZuyz38rF6TFbeIqHuACj2mBvFHcK DUa/dnhUkx8DxEIn1SHaCVFc7iE9agEeZ/B2dc8eNjvpIittwVfkf1CUTAtRwzkauyJ5 FlhW0KMVg2XYMMYTWXmpXwyiO9oTid0ARBxykwNjlCdtVx/1mUgVZMcBW3LDEWSRL1VA Z5cASQ3Hrj615Syg9ufs+vvyac9DocDDgrNoh4o6MokzZbIMrWPPXM9Q5v8DNdcJySYu EsfZmlbEZQckpuk2Jp4p/L80xukCSC+C7ZsMlfpBubYg51LIT2oqT/s4JpYn/dw/uH0+ e4mg== X-Gm-Message-State: AOAM533xYa1HgWDzOWccNKgmSQ9w+SfIhLz09CTe5pnusHhXFwLwhtS9 q3tAMmXYyXOuQA3vPORdmfeGl05AeJyV X-Google-Smtp-Source: ABdhPJxewLwMAyShHliYxaLkN0lr4FU7ff8JL4KlETS7tUZSlGobHf2kZszGaSqZBCNQ2FgPOGkPBQ== X-Received: by 2002:ac8:6b10:: with SMTP id w16mr12777624qts.180.1613822042735; Sat, 20 Feb 2021 03:54:02 -0800 (PST) Received: from presler.lan (a109-49-10-113.cpe.netcabo.pt. [109.49.10.113]) by smtp.gmail.com with ESMTPSA id p16sm7302701qtq.24.2021.02.20.03.54.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 20 Feb 2021 03:54:02 -0800 (PST) From: Rui Salvaterra To: openwrt-devel@lists.openwrt.org Subject: [PATCH v2 3/5] mvebu: update the Turris Omnia device tree Date: Sat, 20 Feb 2021 11:53:48 +0000 Message-Id: <20210220115350.241468-4-rsalvaterra@gmail.com> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210220115350.241468-1-rsalvaterra@gmail.com> References: <20210220115350.241468-1-rsalvaterra@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210220_065404_565311_66F324A4 X-CRM114-Status: GOOD ( 19.37 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:835 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [rsalvaterra[at]gmail.com] -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: nitroshift@yahoo.com, freifunk@adrianschmutzler.de, Rui Salvaterra , daniel@makrotopia.org, hauke@hauke-m.de Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Include support for the multicolor LEDs (software controlled, for now) and fix the hardware buffer management support, due to a missing mbus window. Signed-off-by: Rui Salvaterra --- ...-dts-turris-omnia-update-device-tree.patch | 276 ++++++++++++++++++ 1 file changed, 276 insertions(+) create mode 100644 target/linux/mvebu/patches-5.10/317-ARM-dts-turris-omnia-update-device-tree.patch diff --git a/target/linux/mvebu/patches-5.10/317-ARM-dts-turris-omnia-update-device-tree.patch b/target/linux/mvebu/patches-5.10/317-ARM-dts-turris-omnia-update-device-tree.patch new file mode 100644 index 0000000000..76f52b2c70 --- /dev/null +++ b/target/linux/mvebu/patches-5.10/317-ARM-dts-turris-omnia-update-device-tree.patch @@ -0,0 +1,276 @@ +--- a/arch/arm/boot/dts/armada-385-turris-omnia.dts ++++ b/arch/arm/boot/dts/armada-385-turris-omnia.dts +@@ -12,6 +12,7 @@ + + #include + #include ++#include + #include "armada-385.dtsi" + + / { +@@ -31,7 +32,8 @@ + ranges = ; ++ MBUS_ID(0x09, 0x15) 0 0xf1110000 0x10000 ++ MBUS_ID(0x0c, 0x04) 0 0xf1200000 0x100000>; + + internal-regs { + +@@ -82,6 +84,32 @@ + }; + }; + }; ++ ++ sfp: sfp { ++ compatible = "sff,sfp"; ++ i2c-bus = <&sfp_i2c>; ++ tx-fault-gpios = <&pcawan 0 GPIO_ACTIVE_HIGH>; ++ tx-disable-gpios = <&pcawan 1 GPIO_ACTIVE_HIGH>; ++ rate-select0-gpios = <&pcawan 2 GPIO_ACTIVE_HIGH>; ++ los-gpios = <&pcawan 3 GPIO_ACTIVE_HIGH>; ++ mod-def0-gpios = <&pcawan 4 GPIO_ACTIVE_LOW>; ++ maximum-power-milliwatt = <3000>; ++ ++ /* ++ * For now this has to be enabled at boot time by U-Boot when ++ * a SFP module is present. Read more in the comment in the ++ * eth2 node below. ++ */ ++ status = "disabled"; ++ }; ++}; ++ ++&bm { ++ status = "okay"; ++}; ++ ++&bm_bppi { ++ status = "okay"; + }; + + /* Connected to 88E6176 switch, port 6 */ +@@ -90,6 +118,9 @@ + pinctrl-0 = <&ge0_rgmii_pins>; + status = "okay"; + phy-mode = "rgmii"; ++ buffer-manager = <&bm>; ++ bm,pool-long = <0>; ++ bm,pool-short = <3>; + + fixed-link { + speed = <1000>; +@@ -103,6 +134,9 @@ + pinctrl-0 = <&ge1_rgmii_pins>; + status = "okay"; + phy-mode = "rgmii"; ++ buffer-manager = <&bm>; ++ bm,pool-long = <1>; ++ bm,pool-short = <3>; + + fixed-link { + speed = <1000>; +@@ -112,9 +146,23 @@ + + /* WAN port */ + ð2 { ++ /* ++ * eth2 is connected via a multiplexor to both the SFP cage and to ++ * ethernet-phy@1. The multiplexor switches the signal to SFP cage when ++ * a SFP module is present, as determined by the mode-def0 GPIO. ++ * ++ * Until kernel supports this configuration properly, in case SFP module ++ * is present, U-Boot has to enable the sfp node above, remove phy ++ * handle and add managed = "in-band-status" property. ++ */ + status = "okay"; + phy-mode = "sgmii"; +- phy = <&phy1>; ++ phy-handle = <&phy1>; ++ phys = <&comphy5 2>; ++ sfp = <&sfp>; ++ buffer-manager = <&bm>; ++ bm,pool-long = <2>; ++ bm,pool-short = <3>; + }; + + &i2c0 { +@@ -127,7 +175,6 @@ + #address-cells = <1>; + #size-cells = <0>; + reg = <0x70>; +- status = "okay"; + + i2c@0 { + #address-cells = <1>; +@@ -135,7 +182,115 @@ + reg = <0>; + + /* STM32F0 command interface at address 0x2a */ +- /* leds device (in STM32F0) at address 0x2b */ ++ ++ led-controller@2b { ++ compatible = "cznic,turris-omnia-leds"; ++ reg = <0x2b>; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ /* ++ * LEDs are controlled by MCU (STM32F0) at ++ * address 0x2b. ++ * ++ * The driver does not support HW control mode ++ * for the LEDs yet. Disable the LEDs for now. ++ * ++ * Also LED functions are not stable yet: ++ * - there are 3 LEDs connected via MCU to PCIe ++ * ports. One of these ports supports mSATA. ++ * There is no mSATA nor PCIe function. ++ * For now we use LED_FUNCTION_WLAN, since ++ * in most cases users have wifi cards in ++ * these slots ++ * - there are 2 LEDs dedicated for user: A and ++ * B. Again there is no such function defined. ++ * For now we use LED_FUNCTION_INDICATOR ++ */ ++ status = "disabled"; ++ ++ multi-led@0 { ++ reg = <0x0>; ++ color = ; ++ function = LED_FUNCTION_INDICATOR; ++ function-enumerator = <2>; ++ }; ++ ++ multi-led@1 { ++ reg = <0x1>; ++ color = ; ++ function = LED_FUNCTION_INDICATOR; ++ function-enumerator = <1>; ++ }; ++ ++ multi-led@2 { ++ reg = <0x2>; ++ color = ; ++ function = LED_FUNCTION_WLAN; ++ function-enumerator = <3>; ++ }; ++ ++ multi-led@3 { ++ reg = <0x3>; ++ color = ; ++ function = LED_FUNCTION_WLAN; ++ function-enumerator = <2>; ++ }; ++ ++ multi-led@4 { ++ reg = <0x4>; ++ color = ; ++ function = LED_FUNCTION_WLAN; ++ function-enumerator = <1>; ++ }; ++ ++ multi-led@5 { ++ reg = <0x5>; ++ color = ; ++ function = LED_FUNCTION_WAN; ++ }; ++ ++ multi-led@6 { ++ reg = <0x6>; ++ color = ; ++ function = LED_FUNCTION_LAN; ++ function-enumerator = <4>; ++ }; ++ ++ multi-led@7 { ++ reg = <0x7>; ++ color = ; ++ function = LED_FUNCTION_LAN; ++ function-enumerator = <3>; ++ }; ++ ++ multi-led@8 { ++ reg = <0x8>; ++ color = ; ++ function = LED_FUNCTION_LAN; ++ function-enumerator = <2>; ++ }; ++ ++ multi-led@9 { ++ reg = <0x9>; ++ color = ; ++ function = LED_FUNCTION_LAN; ++ function-enumerator = <1>; ++ }; ++ ++ multi-led@a { ++ reg = <0xa>; ++ color = ; ++ function = LED_FUNCTION_LAN; ++ function-enumerator = <0>; ++ }; ++ ++ multi-led@b { ++ reg = <0xb>; ++ color = ; ++ function = LED_FUNCTION_POWER; ++ }; ++ }; + + eeprom@54 { + compatible = "atmel,24c64"; +@@ -177,7 +332,7 @@ + /* routed to PCIe2 connector (CN62A) */ + }; + +- i2c@4 { ++ sfp_i2c: i2c@4 { + #address-cells = <1>; + #size-cells = <0>; + reg = <4>; +@@ -232,9 +387,8 @@ + pinctrl-0 = <&mdio_pins>; + status = "okay"; + +- phy1: phy@1 { +- status = "okay"; +- compatible = "ethernet-phy-id0141.0DD1", "ethernet-phy-ieee802.3-c22"; ++ phy1: ethernet-phy@1 { ++ compatible = "ethernet-phy-ieee802.3-c22"; + reg = <1>; + + /* irq is connected to &pcawan pin 7 */ +@@ -242,13 +396,18 @@ + + /* Switch MV88E6176 at address 0x10 */ + switch@10 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&swint_pins>; + compatible = "marvell,mv88e6085"; + #address-cells = <1>; + #size-cells = <0>; +- dsa,member = <0 0>; + ++ dsa,member = <0 0>; + reg = <0x10>; + ++ interrupt-parent = <&gpio1>; ++ interrupts = <13 IRQ_TYPE_LEVEL_LOW>; ++ + ports { + #address-cells = <1>; + #size-cells = <0>; +@@ -301,6 +460,11 @@ + marvell,function = "gpio"; + }; + ++ swint_pins: swint-pins { ++ marvell,pins = "mpp45"; ++ marvell,function = "gpio"; ++ }; ++ + spi0cs0_pins: spi0cs0-pins { + marvell,pins = "mpp25"; + marvell,function = "spi0";