From patchwork Wed Jul 28 23:45:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 1511008 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.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=bombadil.20210309 header.b=JJqO4yrK; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=in41xYqr; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (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 4GZr5G726Lz9sT6 for ; Thu, 29 Jul 2021 09:50:42 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=w1i5SNhyc72AjpEOoSayC2Qzr7g8KPfw70lCN4Xc+dU=; b=JJqO4yrK7sP2eJ Nt4W3nK34p/9GFnMW5cIBtukAlyPMkg8AYXC0jdMuQJ6BOGJuamCxCp00LNiFqexltmXlE77M8S7t Y3PYUPfFEK6/4jQaIAhiFT/Zh+VjMxq8wI66bPlIo3NZz8oInQw2iiyWz+hNTVGLmaK4CJg8V/pDj Sd1Erq6C3mHo20VNkKxTth9PDLev0/74Bg5XnAls0cQo4il8PYdH8GcD8xc8uzzJlNuo4RDB6hM47 5cCsqy3WpCnLcewQ+gbEFckhzvxppMXf3ZOKOQh+p+GXemXLTVSAL+q7rwXYqLQTq3rfqYo61iFkH FMBxszRT7gRIuDxufODA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m8tH5-002bzu-4e; Wed, 28 Jul 2021 23:47:43 +0000 Received: from mail-lf1-x134.google.com ([2a00:1450:4864:20::134]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1m8tGp-002bxR-J2 for openwrt-devel@lists.openwrt.org; Wed, 28 Jul 2021 23:47:29 +0000 Received: by mail-lf1-x134.google.com with SMTP id g13so7149072lfj.12 for ; Wed, 28 Jul 2021 16:47:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=3kXeK4Drpwwvzx3QuTuc3i4D3WBCdzs20yU1EncpYBY=; b=in41xYqrRNUibCd2YTZ4EQf9utouH9Uwfq+DKiiP9HwfWHCrt7DE5OsMzLYDb8Ek0b uFlc/sDjSp21w9BjBY1Ui+A/+E19ElHZTa7l4uYJS7Q+oqwt6n6dcvAKzXhirBFIG0Uf dM1msFWnuXbjmAu6Sx2bLMAq7lIQcEoFmCVXVauRJJk0nLA87PHU/kYnwycKFAllThB0 cSE/Jc4iRBQPwoHWeoH9cqiDprFu406gUguFHDfOiutlK92Yhi2qa830thLtXIihwF1b bjKYZ5mXprPdROu5Yllj7txW+DmQUa2l3hHzonzEkp+QCWqe5BIrvneutzWO5uTON7ap qhvg== 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:mime-version :content-transfer-encoding; bh=3kXeK4Drpwwvzx3QuTuc3i4D3WBCdzs20yU1EncpYBY=; b=T1r+2xlASy64k0DPrLm5GeDxMv50jupiMxbhT1pZNP23US/0xywKXxxu48hHRlrbY7 aAV8I8TB0bUFyHaayqCK3kG/c0e4wAhes41UthPIERESC/LFpBPAo7j9SDqF9E0ueuSY pjp38+tdh0NbPZsrEIWf7DS4fGrBS5FsL4A5nJAU3f7SgziIjcVuOk2koYX/+NrJtxo6 jeVemnOCYmzVFwXzuPMQFFMLdaHIVlC0ghBjpIHGe6XgzMwVLHMuAZXkSh8PV9r1JWon ARyPsqKHSfuhtF1iwsRIDP95Xhtd/vts8Vmk0bVYWsWRcZ2LjSzq6GOkA3P0rEgfTctB HFLA== X-Gm-Message-State: AOAM5330F/ahXFo6/qR/3ZB0Z0XtG7f2YrJimT48Y8D/VwOdfX66lgCk 2e4ZBid6TkXownZCytxusFXb+A== X-Google-Smtp-Source: ABdhPJzakFTg/uszwEx+d10xAaStoZtKzT1Hf57X2yfqhpOLkSAha8/hZoY+ounkOgCkEjrzvORHpQ== X-Received: by 2002:a05:6512:3237:: with SMTP id f23mr1470752lfe.524.1627516045462; Wed, 28 Jul 2021 16:47:25 -0700 (PDT) Received: from localhost.localdomain (c-fdcc225c.014-348-6c756e10.bbcust.telenor.se. [92.34.204.253]) by smtp.gmail.com with ESMTPSA id f14sm62777ljj.116.2021.07.28.16.47.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Jul 2021 16:47:24 -0700 (PDT) From: Linus Walleij To: linux-arm-kernel@lists.infradead.org, Imre Kaloz , Krzysztof Halasa Cc: Linus Walleij , openwrt-devel@lists.openwrt.org Subject: [PATCH] RFC: ARM: dts: Proposed Goramo MultiLink device tree Date: Thu, 29 Jul 2021 01:45:20 +0200 Message-Id: <20210728234520.2799053-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210728_164727_762343_1444A5FF X-CRM114-Status: GOOD ( 27.30 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: This is an example of how I think the Goramo MultiLink device can be supported in the device tree. It requires writing a new 74hc4094 GPIO driver and moving a bunch of the boardfile code into the HSS driver as it is anyways the only user of this facility. If there are other boards supporting HSS th [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:134 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org This is an example of how I think the Goramo MultiLink device can be supported in the device tree. It requires writing a new 74hc4094 GPIO driver and moving a bunch of the boardfile code into the HSS driver as it is anyways the only user of this facility. If there are other boards supporting HSS they can be added too. To proceed with this I need to be sure someone is willing to test and help develop this and has interest in supporting the Goramo MultiLink with recent kernels on e.g. OpenWrt. I am happy to dry-code most of the code and DT bindings but it needs to be tested and debugged on target. I am also willing to write just the device tree bindings so the device tree can be merged and the implementation be filled in later. As long as I know there is active interest I'm willing to do at least this even if it cannot be tested just to have the base in place. So is someone up for it? Krysztof? If not, the boardfile will be deleted as part of the IXP4xx migration to device tree, yet this shows how to bring it back. Cc: openwrt-devel@lists.openwrt.org Signed-off-by: Linus Walleij Acked-by: Krzysztof HaƂasa --- arch/arm/boot/dts/Makefile | 1 + .../dts/intel-ixp42x-goramo-multilink.dts | 201 ++++++++++++++++++ arch/arm/boot/dts/intel-ixp4xx.dtsi | 17 ++ 3 files changed, 219 insertions(+) create mode 100644 arch/arm/boot/dts/intel-ixp42x-goramo-multilink.dts diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile index ac8a4a77584d..2dfb073b31a7 100644 --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile @@ -247,6 +247,7 @@ dtb-$(CONFIG_ARCH_IXP4XX) += \ intel-ixp46x-ixdp465.dtb \ intel-ixp42x-adi-coyote.dtb \ intel-ixp42x-ixdpg425.dtb \ + intel-ixp42x-goramo-multilink.dtb \ intel-ixp42x-iomega-nas100d.dtb \ intel-ixp42x-dlink-dsm-g600.dtb \ intel-ixp42x-gateworks-gw2348.dtb \ diff --git a/arch/arm/boot/dts/intel-ixp42x-goramo-multilink.dts b/arch/arm/boot/dts/intel-ixp42x-goramo-multilink.dts new file mode 100644 index 000000000000..bd9a17fb2837 --- /dev/null +++ b/arch/arm/boot/dts/intel-ixp42x-goramo-multilink.dts @@ -0,0 +1,201 @@ +// SPDX-License-Identifier: ISC +/* + * Device Tree file for the Goramo MultiLink Router + * There are two variants: + * - MultiLink Basic (a box) + * - MultiLink Max (19" rack mount) + * This device tree supports MultiLink Basic. + * This machine is based on IXP425. + * This is one of the few devices supporting the IXP4xx High-Speed Serial + * (HSS) link for a V.35 WAN interface. + * The hardware seems to originate in Poland. + */ + +/dts-v1/; + +#include "intel-ixp42x.dtsi" +#include + +/ { + model = "Goramo MultiLink Router"; + compatible = "goramo,multilink-router", "intel,ixp42x"; + #address-cells = <1>; + #size-cells = <1>; + + memory@0 { + /* + * 64 MB of RAM according to the manual. The MultiLink + * Max has 128 MB. + */ + device_type = "memory"; + reg = <0x00000000 0x4000000>; + }; + + chosen { + bootargs = "console=ttyS0,115200n8"; + stdout-path = "uart0:115200n8"; + }; + + aliases { + serial0 = &uart0; + serial1 = &uart1; + }; + + /* + * 74HC4094 which is used as a rudimentary GPIO expander + * FIXME: + * - Create device tree bindings for this as GPIO expander + * - Write a pure DT GPIO driver using these bindings + * - Support cascading in the style of gpio-74x164.c (cannot be reused, very different) + */ + gpio_74: gpio-74hc4094 { + compatible = "nxp,74hc4094"; + cp-gpios = <&gpio0 0 GPIO_ACTIVE_HIGH>; + d-gpios = <&gpio0 1 GPIO_ACTIVE_HIGH>; + str-gpios = <&gpio0 2 GPIO_ACTIVE_HIGH>; + /* oe-gpios is optional */ + gpio-controller; + #gpio-cells = <2>; + /* We are not cascaded */ + registers-number = <1>; + gpio-line-names = "CONTROL_HSS0_CLK_INT", "CONTROL_HSS1_CLK_INT", "CONTROL_HSS0_DTR_N", + "CONTROL_HSS1_DTR_N", "CONTROL_EXT", "CONTROL_AUTO_RESET", + "CONTROL_PCI_RESET_N", "CONTROL_EEPROM_WC_N"; + }; + + soc { + bus@c4000000 { + flash@0,0 { + compatible = "intel,ixp4xx-flash", "cfi-flash"; + bank-width = <2>; + /* Enable writes on the expansion bus */ + intel,ixp4xx-eb-write-enable = <1>; + /* 16 MB of Flash mapped in at CS0 */ + reg = <0 0x00000000 0x1000000>; + + partitions { + compatible = "redboot-fis"; + /* Eraseblock at 0x0fe0000 */ + fis-index-block = <0x7f>; + }; + }; + }; + + pci@c0000000 { + status = "ok"; + + /* + * The device has 4 slots (IDSEL) with one dedicated IRQ per slot. + * The slots have Ethernet, Ethernet, NEC and MPCI. + * The IDSELs are 11, 12, 13, 14. + */ + interrupt-map = + /* IDSEL 11 - Ethernet A */ + <0x5800 0 0 1 &gpio0 4 IRQ_TYPE_LEVEL_LOW>, /* INT A on slot 11 is irq 4 */ + <0x5800 0 0 2 &gpio0 4 IRQ_TYPE_LEVEL_LOW>, /* INT B on slot 11 is irq 4 */ + <0x5800 0 0 3 &gpio0 4 IRQ_TYPE_LEVEL_LOW>, /* INT C on slot 11 is irq 4 */ + <0x5800 0 0 4 &gpio0 4 IRQ_TYPE_LEVEL_LOW>, /* INT D on slot 11 is irq 4 */ + /* IDSEL 12 - Ethernet B */ + <0x6000 0 0 1 &gpio0 5 IRQ_TYPE_LEVEL_LOW>, /* INT A on slot 12 is irq 5 */ + <0x6000 0 0 2 &gpio0 5 IRQ_TYPE_LEVEL_LOW>, /* INT B on slot 12 is irq 5 */ + <0x6000 0 0 3 &gpio0 5 IRQ_TYPE_LEVEL_LOW>, /* INT C on slot 12 is irq 5 */ + <0x6000 0 0 4 &gpio0 5 IRQ_TYPE_LEVEL_LOW>, /* INT D on slot 12 is irq 5 */ + /* IDSEL 13 - MPCI */ + <0x6800 0 0 1 &gpio0 12 IRQ_TYPE_LEVEL_LOW>, /* INT A on slot 13 is irq 12 */ + <0x6800 0 0 2 &gpio0 12 IRQ_TYPE_LEVEL_LOW>, /* INT B on slot 13 is irq 12 */ + <0x6800 0 0 3 &gpio0 12 IRQ_TYPE_LEVEL_LOW>, /* INT C on slot 13 is irq 12 */ + <0x6800 0 0 4 &gpio0 12 IRQ_TYPE_LEVEL_LOW>, /* INT D on slot 13 is irq 12 */ + /* IDSEL 14 - NEC */ + <0x7000 0 0 1 &gpio0 3 IRQ_TYPE_LEVEL_LOW>, /* INT A on slot 14 is irq 3 */ + <0x7000 0 0 2 &gpio0 3 IRQ_TYPE_LEVEL_LOW>, /* INT B on slot 14 is irq 3 */ + <0x7000 0 0 3 &gpio0 3 IRQ_TYPE_LEVEL_LOW>, /* INT C on slot 14 is irq 3 */ + <0x7000 0 0 4 &gpio0 3 IRQ_TYPE_LEVEL_LOW>; /* INT D on slot 14 is irq 3 */ + }; + + /* + * The Goramo MultiLink Router uses different txready queues than any other router, + * which makes it likely that it uses non-default firmware for the NPE units. + */ + + /* + * HSS links + * FIXME: + * - Device tree bindings + * - Code to probe the HSS from device tree and get all queues and NPE from DT + * - Put the boardfile code handling the GPIOs into the HSS driver + */ + npe@c8006000 { + hss@0 { + status = "okay"; + queue-chl-rxtrig = <&qmgr 12>; + queue-pkt-rx = <&qmgr 13>; + queue-pkt-tx0 = <&qmgr 14>; + queue-pkt-tx1 = <&qmgr 15>; + queue-pkt-tx2 = <&qmgr 16>; + queue-pkt-tx3 = <&qmgr 17>; + queue-pkt-rxfree0 = <&qmgr 18>; + queue-pkt-rxfree1 = <&qmgr 19>; + queue-pkt-rxfree2 = <&qmgr 20>; + queue-pkt-rxfree3 = <&qmgr 21>; + queue-pkt-txdone = <&qmgr 22>; + /* The Goramo GPIO-based clock etc control */ + cts-gpios = <&gpio0 10 GPIO_ACTIVE_LOW>; + rts-gpios = <&gpio0 14 GPIO_ACTIVE_LOW>; + dcd-gpios = <&gpio0 6 GPIO_ACTIVE_LOW>; + dtr-gpios = <&gpio_74 2 GPIO_ACTIVE_LOW>; + clk-int-gpios = <&gpio_74 0 GPIO_ACTIVE_HIGH>; + }; + hss@1 { + status = "okay"; + queue-chl-rxtrig = <&qmgr 10>; + queue-pkt-rx = <&qmgr 0>; + queue-pkt-tx0 = <&qmgr 5>; + queue-pkt-tx1 = <&qmgr 6>; + queue-pkt-tx2 = <&qmgr 7>; + queue-pkt-tx3 = <&qmgr 8>; + queue-pkt-rxfree0 = <&qmgr 1>; + queue-pkt-rxfree1 = <&qmgr 2>; + queue-pkt-rxfree2 = <&qmgr 3>; + queue-pkt-rxfree3 = <&qmgr 4>; + queue-pkt-txdone = <&qmgr 9>; + /* The Goramo GPIO-based clock etc control */ + cts-gpios = <&gpio0 11 GPIO_ACTIVE_LOW>; + rts-gpios = <&gpio0 13 GPIO_ACTIVE_LOW>; + dcd-gpios = <&gpio0 7 GPIO_ACTIVE_LOW>; + dtr-gpios = <&gpio_74 3 GPIO_ACTIVE_LOW>; + clk-int-gpios = <&gpio_74 1 GPIO_ACTIVE_HIGH>; + }; + }; + + /* EthB */ + ethernet@c8009000 { + status = "ok"; + queue-rx = <&qmgr 3>; + queue-txready = <&qmgr 32>; + phy-mode = "rgmii"; + phy-handle = <&phy0>; + + mdio { + #address-cells = <1>; + #size-cells = <0>; + + phy0: ethernet-phy@0 { + reg = <0>; + }; + + phy1: ethernet-phy@1 { + reg = <1>; + }; + }; + }; + + /* EthC */ + ethernet@c800a000 { + status = "ok"; + queue-rx = <&qmgr 4>; + queue-txready = <&qmgr 33>; + phy-mode = "rgmii"; + phy-handle = <&phy1>; + }; + }; +}; diff --git a/arch/arm/boot/dts/intel-ixp4xx.dtsi b/arch/arm/boot/dts/intel-ixp4xx.dtsi index e5af2d463074..a490b70b8d93 100644 --- a/arch/arm/boot/dts/intel-ixp4xx.dtsi +++ b/arch/arm/boot/dts/intel-ixp4xx.dtsi @@ -141,6 +141,23 @@ timer@c8005000 { npe: npe@c8006000 { compatible = "intel,ixp4xx-network-processing-engine"; reg = <0xc8006000 0x1000>, <0xc8007000 0x1000>, <0xc8008000 0x1000>; + #address-cells = <1>; + #size-cells = <0>; + + /* NPE-A contains two high-speed serial links */ + hss@0 { + compatible = "intel,ixp4xx-hss"; + reg = <0>; + intel,npe-handle = <&npe 0>; + status = "disabled"; + }; + + hss@1 { + compatible = "intel,ixp4xx-hss"; + reg = <1>; + intel,npe-handle = <&npe 0>; + status = "disabled"; + }; /* NPE-C contains a crypto accelerator */ crypto {