From patchwork Thu Jan 13 05:37:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Evgeny Boger X-Patchwork-Id: 12712307 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D0957C433FE for ; Thu, 13 Jan 2022 05:39:19 +0000 (UTC) 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:References:In-Reply-To: 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: List-Owner; bh=dykPlaOK3yHRUIePJrSD8YMUAXycS1vU58dv6wv0/Wk=; b=DuxAFgNXDFwkry lFhQrcKuDnqT1WTnfz0r0YzOgHBos6GTkOmMYXNxK8JubYkW7g/KlTpfjnGEvN3ZiVsTv+uu5Zvn2 5v837D3vM//YzxMHd8Ehh63l7PrVMGhlrz7nBhXIva1BjzGVMvblP4aM1QGb/BH2K5of+FtO6fnqT RaQBmjb2GFqAi9MTA1KyPZDz9FchSPxAMzjQoavLiLbNyur+E+s+Z7ZbpW/M6D8eL3CllqtTskMsQ lEmCuDm9e6z1TVNDfdWOwRPbWvQe/HHI8g/N8Yg947j/hAmYhOb5Og3pzoNt/Ra+piJ0ovB4P6TJW bc4C7CGxVQMLJkHVSMCQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n7soQ-004iAr-3S; Thu, 13 Jan 2022 05:38:14 +0000 Received: from mail-lf1-x131.google.com ([2a00:1450:4864:20::131]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n7so3-004i71-3J for linux-arm-kernel@lists.infradead.org; Thu, 13 Jan 2022 05:37:54 +0000 Received: by mail-lf1-x131.google.com with SMTP id e3so12951904lfc.9 for ; Wed, 12 Jan 2022 21:37:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wirenboard-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=vIhVOFoEFO3ge9QX7EEmaWp+M7MlXRkxdj6Ox9QmAu4=; b=bs5njQm/d7lRUNLXwg+jL7bjAJsuyx82JmChSb3YKsmIG7tQc0srQdbl6ga+Q2LPnO ld9HhOOwtBQ3kzmSNeelAFtRv1OfaGnd4BOcEPuJl9Sw4S4n7Ciq68EuiWmVmu+ZXw/7 TsLjZi+jKF9kEfSnE0x75x8D9eeUHu56OYA+4LD1htPw7gM63Y4xGPb85i+dZavV8b8O iYbuBoYoUhnkqpKvWLaxW70JbjcmnpN82ODPDkI66FP9o20fl/KZ7ApKOBiPLNAFBlZD pO5EyJONm9l5L8FYQW70bj1QhdCSrh7aYkvmDcUDED51BOjKtPfzIE4y0B+/sZxrrlwC EIBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=vIhVOFoEFO3ge9QX7EEmaWp+M7MlXRkxdj6Ox9QmAu4=; b=HqQmzZ5IoYAPPUzJZFDiLd8qE+isvj7MmfrLIvV2ofB15kcSGxMojkZW6iAqqqMOU1 I/Ln0frCzGEtJ7+M5UbMvGDCxrnQyUXzgiOydd4auj9K112I07p/OZDiz/3FtQAqEsUr ZSI0J0ysKvZe2HVnPD9Q5b9Haj51QPy1MEjRFO2BXaqnX9xZ7HAUzw3wnDVG4pJscaAz UIOGYXfBuV9mtQdK4qT0yXug/lOsp+1/cVtY0biyThz3MyKws1XgawA9yh8seIgslnY0 CSLsmmhyKEvyBkNa8oy4mAp/FJxN2haXt+sCCXqz3L4CulWUvxnhBAUT2c1ZXEu97B6E Fnxg== X-Gm-Message-State: AOAM532uNPNgKOqW7X7i7Z5xVXLear8NE+4YMNK4bk0hcFSDheiiopa6 Rq3X91CfUErmerW5PapDh4lj8FSLk/cxxw== X-Google-Smtp-Source: ABdhPJyVV0NrO6DO+IvlzUdJgBUhS30P0tshAoYYNF1cPgGBE0bBQQt+qKLDR4dI3UMvJgGkR3jo9Q== X-Received: by 2002:a2e:a88a:: with SMTP id m10mr1989969ljq.506.1642052268785; Wed, 12 Jan 2022 21:37:48 -0800 (PST) Received: from boger-laptop.lan (81.5.110.253.dhcp.mipt-telecom.ru. [81.5.110.253]) by smtp.gmail.com with ESMTPSA id x21sm180212lfa.296.2022.01.12.21.37.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jan 2022 21:37:48 -0800 (PST) From: Evgeny Boger To: Maxime Ripard , Chen-Yu Tsai , linux-arm-kernel@lists.infradead.org Cc: Evgeny Boger , devicetree@vger.kernel.org, Rob Herring , linux-sunxi@lists.linux.dev Subject: [PATCH v5 3/3] ARM: dts: sun8i: r40: add second ethernet support Date: Thu, 13 Jan 2022 08:37:34 +0300 Message-Id: <20220113053734.105813-4-boger@wirenboard.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220113053734.105813-1-boger@wirenboard.com> References: <20220113053734.105813-1-boger@wirenboard.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220112_213751_192300_5A1CCA73 X-CRM114-Status: GOOD ( 12.73 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org R40 (aka V40, A40i, T3) has two different Ethernet IPs called EMAC and GMAC. EMAC only support 10/100 Mbit in MII mode, while GMAC support both 10/100 (MII) and 10/100/1000 (RGMII). In contrast to A10/A20 where GMAC and EMAC share the same pins making EMAC somewhat pointless, on R40 EMAC can be routed to port H. Both EMAC (on port H) and GMAC (on port A) can be then enabled at the same time, allowing for two ethernet ports. Signed-off-by: Evgeny Boger --- arch/arm/boot/dts/sun8i-r40.dtsi | 49 ++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/arch/arm/boot/dts/sun8i-r40.dtsi b/arch/arm/boot/dts/sun8i-r40.dtsi index 03d3e5f45a09..8770b105f86e 100644 --- a/arch/arm/boot/dts/sun8i-r40.dtsi +++ b/arch/arm/boot/dts/sun8i-r40.dtsi @@ -217,6 +217,19 @@ syscon: system-control@1c00000 { #size-cells = <1>; ranges; + sram_a: sram@0 { + compatible = "mmio-sram"; + reg = <0x00000000 0xc000>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0 0x00000000 0xc000>; + + emac_sram: sram-section@8000 { + compatible = "allwinner,sun4i-a10-sram-a3-a4"; + reg = <0x8000 0x4000>; + }; + }; + sram_c: sram@1d00000 { compatible = "mmio-sram"; reg = <0x01d00000 0xd0000>; @@ -553,6 +566,24 @@ gmac_rgmii_pins: gmac-rgmii-pins { drive-strength = <40>; }; + emac_pa_pins: emac-pa-pins { + pins = "PA0", "PA1", "PA2", + "PA3", "PA4", "PA5", "PA6", + "PA7", "PA8", "PA9", "PA10", + "PA11", "PA12", "PA13", "PA14", + "PA15", "PA16"; + function = "emac"; + }; + + emac_ph_pins: emac-ph-pins { + pins = "PH8", "PH9", "PH10", "PH11", + "PH14", "PH15", "PH16", "PH17", + "PH18","PH19", "PH20", "PH21", + "PH22", "PH23", "PH24", "PH25", + "PH26", "PH27"; + function = "emac"; + }; + i2c0_pins: i2c0-pins { pins = "PB0", "PB1"; function = "i2c0"; @@ -999,6 +1030,24 @@ gmac_mdio: mdio { }; }; + emac: ethernet@1c0b000 { + compatible = "allwinner,sun8i-r40-emac"; + reg = <0x01c0b000 0x1000>; + interrupts = ; + clocks = <&ccu CLK_BUS_EMAC>; + resets = <&ccu RST_BUS_EMAC>; + allwinner,sram = <&emac_sram 1>; + status = "disabled"; + }; + + emac_mdio: mdio@1c0b080 { + compatible = "allwinner,sun4i-a10-mdio"; + reg = <0x01c0b080 0x14>; + status = "disabled"; + #address-cells = <1>; + #size-cells = <0>; + }; + mbus: dram-controller@1c62000 { compatible = "allwinner,sun8i-r40-mbus"; reg = <0x01c62000 0x1000>;