From patchwork Sat Dec 2 12:41:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 13476912 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 8D298C4167B for ; Sat, 2 Dec 2023 12:42:48 +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=a2a6dITxOhbqknrfk3yG5XZhRedZe7Qj/uB/BZ89r1A=; b=aJrSa4U5f+7CS0 ynEno0eCka/cJuC1odSph9zGb6d8xcj11vEeibU2u0nXYWyIeU74BA9slPBnc51OI5jtDJ/lwK59h XkVbndfZrsxLY/TH6CMqlMexjcith1yMQIR3PAERTzAGWif+jWarZ1Tdr9d+r6TxkzkAMSA5l5H9N AM/1O1CztlXfcmFNva8kxDjP2SkiqDRq55JYXcIgb5MLxlO/sBZsdf3kK2np+W/L7B+a0Kz+9MK83 Hk4cn2aRLDfBRXK1VslGF0AW28hCZaj4p5BcnLUe7JEgWKk3wXsBmAz0MkFYRmNuEUscSr1ItnzgH d0qThi04p6VAfV9pXYcg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r9PK9-00FhHm-0B; Sat, 02 Dec 2023 12:42:21 +0000 Received: from mail-ej1-x62c.google.com ([2a00:1450:4864:20::62c]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r9PK5-00FhEC-0y; Sat, 02 Dec 2023 12:42:19 +0000 Received: by mail-ej1-x62c.google.com with SMTP id a640c23a62f3a-a1882023bbfso392229666b.3; Sat, 02 Dec 2023 04:42:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701520927; x=1702125727; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=GT6U/Jm1kE8iHTek1ibUnucOypK2mgUYlFeO1cXQKVs=; b=jw9GMbcYFxpEIG84WOmI8Jx7Ln1UHBF1AH+6WPl2H9ihmYTDtOpvr7VwELYVWCrjrJ +8p4sEfLg4OD3IJwP1X5kuCmkxncbO6ZeXY4deQVP31rBVX0cDJnGgxiIxD+wWhB0RJX gWOHqL11cYOdHpb46qbLgxkGXNkDttnc1EWeuyfFRFUm4jX9pREHEW+selT6b43froC/ 9E8lJywy9qyJrqEPV7Vqhp3k7kdgCsjcP/8teJ/3mQ5HEK6kx0IZN/1SvzDWyemlR3g8 2hhIOA6TCxJS0HroQbWNcbdLvDYjwfDpNT67fopak1yxY8SMXzj1YKbz+oewW6AMJofJ K32g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701520927; x=1702125727; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GT6U/Jm1kE8iHTek1ibUnucOypK2mgUYlFeO1cXQKVs=; b=Ubs+80YbFtu73AvSkiDeHB7naLbSfhhJjhB4pfSrek2QIeKsWYXKNrLf76sDhvbOzn 3CGD3cy5uHO1iQl/g6mL1stkl6vowb0jgM0e0OQJPentwbm+Dr/k7KsOEyJrKNGKUOVu VZVBWgZ4QzWxvPUWE7kni0h0KeK43vDUhKLuOCjQu5n0Yi+tXn/IJteR+vWlUrcTOnzJ +vppzk6VAl1hPNSiQUCJWNCyT4iAdVAKyYxMpLzn7grwbL967KIJw4lwU0njR12GevJw /WweaWVnmwD8ap+mG3zqiUk6XDRYkHEHSPNVtNL7xdsU0IODv+9S6DNzDB/Hx8yLFhhw dwPQ== X-Gm-Message-State: AOJu0YyODOUa3sdfL5dlJeSe5j1ZeYnS5j6HH4TEqTkcOdehCWOM58ZM 1cC1uZmVtWrV9oFdifKzsA== X-Google-Smtp-Source: AGHT+IFChGLYoqEgdEQJLZDJTHMTrQhqKoKtU5gV9YLdkn2cOl7wagJhu5UWTR7yjlabiTPJeZkH9w== X-Received: by 2002:a17:906:24e:b0:a19:a19b:55d9 with SMTP id 14-20020a170906024e00b00a19a19b55d9mr2085815ejl.105.1701520927185; Sat, 02 Dec 2023 04:42:07 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:908e:b829:354b:f8ee]) by smtp.gmail.com with ESMTPSA id q19-20020a1709060e5300b009a19701e7b5sm3009602eji.96.2023.12.02.04.42.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Dec 2023 04:42:06 -0800 (PST) From: Alex Bee To: Heiko Stuebner , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee Subject: [PATCH v2 1/2] ARM: dts: rockchip: Add gmac node for RK3128 Date: Sat, 2 Dec 2023 13:41:58 +0100 Message-ID: <20231202124158.65615-3-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231202124158.65615-2-knaerzche@gmail.com> References: <20231202124158.65615-2-knaerzche@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231202_044217_337061_F3E859CF X-CRM114-Status: GOOD ( 12.12 ) 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 RK3128's gmac is based on Synopsys Ethernet GMAC IP core. Add it to the devicetree. Signed-off-by: Alex Bee --- arch/arm/boot/dts/rockchip/rk3128.dtsi | 28 ++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/arch/arm/boot/dts/rockchip/rk3128.dtsi b/arch/arm/boot/dts/rockchip/rk3128.dtsi index 4e8b38604ecd..c0c9f0eaffa3 100644 --- a/arch/arm/boot/dts/rockchip/rk3128.dtsi +++ b/arch/arm/boot/dts/rockchip/rk3128.dtsi @@ -525,6 +525,34 @@ pdma: dma-controller@20078000 { #dma-cells = <1>; }; + gmac: ethernet@2008c000 { + compatible = "rockchip,rk3128-gmac"; + reg = <0x2008c000 0x4000>; + interrupts = , + ; + interrupt-names = "macirq", "eth_wake_irq"; + clocks = <&cru SCLK_MAC>, + <&cru SCLK_MAC_RX>, <&cru SCLK_MAC_TX>, + <&cru SCLK_MAC_REF>, <&cru SCLK_MAC_REFOUT>, + <&cru ACLK_GMAC>, <&cru PCLK_GMAC>; + clock-names = "stmmaceth", + "mac_clk_rx", "mac_clk_tx", + "clk_mac_ref", "clk_mac_refout", + "aclk_mac", "pclk_mac"; + resets = <&cru SRST_GMAC>; + reset-names = "stmmaceth"; + rockchip,grf = <&grf>; + rx-fifo-depth = <4096>; + tx-fifo-depth = <2048>; + status = "disabled"; + + mdio: mdio { + compatible = "snps,dwmac-mdio"; + #address-cells = <0x1>; + #size-cells = <0x0>; + }; + }; + pinctrl: pinctrl { compatible = "rockchip,rk3128-pinctrl"; rockchip,grf = <&grf>; From patchwork Sat Dec 2 12:41:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 13476911 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 E5DFAC4167B for ; Sat, 2 Dec 2023 12:42:45 +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=XfXXH3RmXOSKn7/VEkGl1mfbrbqJJnJqAXJht2ApGF4=; b=trXK+qyfet13XH X4vIvrVB1WSEg1VCrXKacdeJ1etYr3oZVDyHYjwxUKyhDz3aQdVpBnRJa0tah4coGaN99YS5EtBiC gRirYBz4LSE0ylvJtuXTzA2EWIKDQb3nQtnMYkU+jqYLVL1mjf4fieBDTsgcY8V3p12TosR1pxULX pyp4ZYeHeH6gZvTkyGu8I3kWTO2trybwu/W9WonspZh7kePifSh6S4iJqXdA40rq7w857PrSE46ms ocFRpq7H8KEIk1pJa0TgNtggjreNvHU34NLgP4AdaQ4NcHv6l+82Oo/yVqmzqeRyxWhIiOV2+hSMy 9ybTNlPRoaNk1JBfPMLw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r9PK9-00FhID-21; Sat, 02 Dec 2023 12:42:21 +0000 Received: from mail-ed1-x530.google.com ([2a00:1450:4864:20::530]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r9PK5-00FhEE-2M; Sat, 02 Dec 2023 12:42:19 +0000 Received: by mail-ed1-x530.google.com with SMTP id 4fb4d7f45d1cf-54c1cd8d239so3228739a12.0; Sat, 02 Dec 2023 04:42:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701520928; x=1702125728; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Mp5m4S58xFYf/pPupXKRpoAWOKmXYjV8KokdiBbVmdU=; b=ZHgQ+/A9AdDyQgqtWfpkeT2ytYgQfRFWWEI19s+gVo1ZyadXnw5aiRo0+9j+P1exen DojcHg/QzZ2LWPbphfy6t65b9OF3Jpm/N3pjxjPxD2HNy9CqvMXrTT00L9lhmqHa1hy0 bsqWE9QHZVLCZhvAF5gjl01gcZhiAw4PSN1i37bmgeoIDVN7+zLOKjYU23LT1TYQVtQl qay5hRFeTGLXN30wO/EoVjbhCmb/2eXibNf/FJP2NsbuKrM+FnLXDv5Jo3z7TGSyHPUl SFANDlVgBgUJAllHmXAuxUyvNTI/+sfrb9yOiJ+Vd4S63glawLWiqhZ4yGK5xWx4+ul9 UBfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701520928; x=1702125728; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Mp5m4S58xFYf/pPupXKRpoAWOKmXYjV8KokdiBbVmdU=; b=eFtIED44xPL8mFOoHsAl9efT7i5mzAWDM038BMdeK8t9T86ZwC6lsLe/2wwy/g0YUL gaUrklFVZYbsjFaEYJ4Atu6SFCe47pC5chUYF9qBjla9DygJjbPK0QgNgxko1kv7R98j SkBv7M9AGyJ2fRA5eftjqkmvb7mznVN5cSwGH+kaaDS0tfcX6Iahxx43UniiAbZGHW+L b7a84LNXmGErUaF/2Eq2tD1xX209G8zB078iXT/boyKuYMaaiDNxbnc64+rPW/vL59o5 vluDiv9HcO8Le7SjQofgAjlB1DcZucS4XrroN0bP8QV2r4EfdEHzj6lRBzmnM6Ttlk4P uEow== X-Gm-Message-State: AOJu0Yz9+nrVJNtF7lOjsZnRpdVPY4LWEN29sI27jJkp26ATCQ+UVHG7 X2VXq54J86F0DJJHIl7AWQ== X-Google-Smtp-Source: AGHT+IFCBdPcJSe8T9O23Y89jCIHxaJaMUXndtVnA4rBtUOnvJCImr6VCsKo/XMoFtC8T+88bYhlPQ== X-Received: by 2002:a17:906:51d0:b0:a19:a1ba:baba with SMTP id v16-20020a17090651d000b00a19a1bababamr1018772ejk.96.1701520928353; Sat, 02 Dec 2023 04:42:08 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:908e:b829:354b:f8ee]) by smtp.gmail.com with ESMTPSA id q19-20020a1709060e5300b009a19701e7b5sm3009602eji.96.2023.12.02.04.42.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Dec 2023 04:42:08 -0800 (PST) From: Alex Bee To: Heiko Stuebner , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee Subject: [PATCH v2 2/2] ARM: dts: rockchip: Enable gmac for XPI-3128 Date: Sat, 2 Dec 2023 13:41:59 +0100 Message-ID: <20231202124158.65615-4-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231202124158.65615-2-knaerzche@gmail.com> References: <20231202124158.65615-2-knaerzche@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231202_044217_771728_C649C013 X-CRM114-Status: GOOD ( 11.62 ) 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 Add the required properties and enable the gmac node for XPI-3128 board. The minimum reset timing requirements for the phy have been taken from DP83848J's datasheet [0] [0] https://www.ti.com/lit/ds/symlink/dp83848j.pdf Signed-off-by: Alex Bee --- .../arm/boot/dts/rockchip/rk3128-xpi-3128.dts | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/arch/arm/boot/dts/rockchip/rk3128-xpi-3128.dts b/arch/arm/boot/dts/rockchip/rk3128-xpi-3128.dts index 61b9f069c8a2..e979425f11a0 100644 --- a/arch/arm/boot/dts/rockchip/rk3128-xpi-3128.dts +++ b/arch/arm/boot/dts/rockchip/rk3128-xpi-3128.dts @@ -11,6 +11,7 @@ / { compatible = "geniatech,xpi-3128", "rockchip,rk3128"; aliases { + ethernet0 = &gmac; gpio0 = &gpio0; gpio1 = &gpio1; gpio2 = &gpio2; @@ -255,6 +256,18 @@ &emmc { status = "okay"; }; +&gmac { + clock_in_out = "output"; + phy-supply = <&vcc_lan>; + phy-mode = "rmii"; + phy-handle = <&phy0>; + assigned-clocks = <&cru SCLK_MAC_SRC>; + assigned-clock-rates= <50000000>; + pinctrl-names = "default"; + pinctrl-0 = <&rmii_pins>; + status = "okay"; +}; + &gpio0 { gpio-line-names = /* GPIO0 A0-A7 */ "", "", "HEADER_5", "HEADER_3", @@ -315,6 +328,21 @@ &gpio3 { "", "", "", ""; }; +&mdio { + phy0: ethernet-phy@1 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <1>; + max-speed = <100>; + /* T2.2.4 min. 1 us */ + reset-assert-us = <10>; + /* T2.2.1 + T2.2.2 + T2.2.3 min. 6.05 us */ + reset-deassert-us = <20>; + reset-gpios = <&gpio2 RK_PD0 GPIO_ACTIVE_LOW>; + pinctrl-names = "default"; + pinctrl-0 = <&dp83848c_rst>; + }; +}; + &pinctrl { dp83848c { dp83848c_rst: dp83848c-rst {