From patchwork Mon Dec 18 21:44:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 180657 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp1551763dyi; Mon, 18 Dec 2023 13:46:17 -0800 (PST) X-Google-Smtp-Source: AGHT+IGqtgpXfFksO2rBEOOkpWOYa/WxK26mCjxJEdR14mtmdE+aCYzqJ+RMW9xla6q2bTAwhO0C X-Received: by 2002:a17:902:7c8c:b0:1d0:6ffd:f230 with SMTP id y12-20020a1709027c8c00b001d06ffdf230mr8528538pll.134.1702935976895; Mon, 18 Dec 2023 13:46:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702935976; cv=none; d=google.com; s=arc-20160816; b=b6cjQWPeMbD74MGTGRg/53/VhVu+i1d8bQPGjCa0lksognbFVpupHyXBkSYgCPXXnV k+NE/hE55C5tf00Pf5V4hFu2YFbxYAZwhr5ExCeb2S0LDfYm8LsCrQ0nGqZUl4p1EJ0V fXsepQqN4sZUXbvreoZ7q76Pz2U/nXN+4puQD+9kOk5rnfu6DlRW5Rsxlyu0UFpCPgau zejWxHCvqzQrWvjVXRAwDYPJepTLHk7Z+n1H3CMqJtM2UeAihMTuyNiahUCCPv3kNP5m wJjTGrTpTd3xSQHGQlgu7+0rbmO/fKRXgJqdJGvoxDps1RSCIyDc70F2gesV1BL0/dTU aFxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=N7rX2azjC5/uSPgdggeOA3hvkvekvdN9+FSb/zVYoSk=; fh=syaDh/WjooBXvAaul+2O0Q827rHRcsPrAm5I86d1V5c=; b=YvTJEN9JQJVQVvlbnYWb7bY35f7YR1PEQcxMipMoGTLAiCE2TCvhHCpJ6a6ZddDWfD oQiwM1s03BC4o43YdmRpiRs8wRUz7L9tOc2DDl3khlBzXrmL+AkS0h+C58qejklot61c i7zwvjV67dhlSibBy3rmIeX4k/+IIOx0xqXQfawXG5jzo52TxlWYNGBKqDq4GakN92br 4dzusq+U365mT3PTH2x4St0UpaTaDl+Od6w/CDG3GjQLf1xfnVc/ej6WdXPB5B+mffVL gV/0KgZQUCrF197l8HjXoPZOf87YIsZo2I+2UEfAhYx4Ov7p8q/U+NNacxyQAI2cm66K Cgkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=QiF1Pkq5; spf=pass (google.com: domain of linux-kernel+bounces-4415-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4415-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id j3-20020a170902c08300b001cfd24c7b73si18221876pld.2.2023.12.18.13.46.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Dec 2023 13:46:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-4415-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=QiF1Pkq5; spf=pass (google.com: domain of linux-kernel+bounces-4415-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4415-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id EBE49B237DE for ; Mon, 18 Dec 2023 21:46:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9396C768FC; Mon, 18 Dec 2023 21:45:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="QiF1Pkq5" X-Original-To: linux-kernel@vger.kernel.org Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6A0AD74E11; Mon, 18 Dec 2023 21:44:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1702935894; bh=gbMqiSFoR5LPx4Im1XNHPktHQYnQ4AzMO0qHDjq0wBQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QiF1Pkq59BiNjuwKLlI7G2SvuPu8d4HdABH7OIv9txKZMtcYO/Zi/SHD/0pV9S0+N xhJeBZ0un9Aw/uqrDtuaX3Lc2PG9rdJ2EBQWi5p9Q9MaFN20yTQbR9Jm4NnJoQZfFp kurNhVjvnlmQW00/QPItqeRNj+b/YYI9xZ6tAW/oajoAbR8inwEsmR6SzgXCOa1xl2 oFPYUWCs6Nvl9r3+LRVSWpk4rHZjfGanUDjjQwtPjWv9rvd5fDEGiHWVigZQ0Di5+t fa+Z0NAUDrT0kVeFjmHw9TVEHiq9qQauxcfy7IzWrMwEEC7NtWo06GYjnbR00+Rme7 GPekFWKakAH3Q== Received: from localhost (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 4C57D3781476; Mon, 18 Dec 2023 21:44:54 +0000 (UTC) From: Cristian Ciocaltea To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Emil Renner Berthing , Samin Guo , Paul Walmsley , Palmer Dabbelt , Albert Ou , Hal Feng , Michael Turquette , Stephen Boyd , Alexandre Torgue , Jose Abreu , Maxime Coquelin , Richard Cochran , Giuseppe Cavallaro Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, linux-clk@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, kernel@collabora.com Subject: [PATCH v4 1/9] dt-bindings: net: starfive,jh7110-dwmac: Drop redundant reset description Date: Mon, 18 Dec 2023 23:44:41 +0200 Message-ID: <20231218214451.2345691-2-cristian.ciocaltea@collabora.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231218214451.2345691-1-cristian.ciocaltea@collabora.com> References: <20231218214451.2345691-1-cristian.ciocaltea@collabora.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785657794646916049 X-GMAIL-MSGID: 1785657794646916049 The reset description items are already provided by the referenced snps,dwmac.yaml schema, hence replace them with the necessary {min,max}Items. Signed-off-by: Cristian Ciocaltea --- .../devicetree/bindings/net/starfive,jh7110-dwmac.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Documentation/devicetree/bindings/net/starfive,jh7110-dwmac.yaml b/Documentation/devicetree/bindings/net/starfive,jh7110-dwmac.yaml index 5e7cfbbebce6..d90cb82c1424 100644 --- a/Documentation/devicetree/bindings/net/starfive,jh7110-dwmac.yaml +++ b/Documentation/devicetree/bindings/net/starfive,jh7110-dwmac.yaml @@ -55,9 +55,8 @@ properties: maxItems: 3 resets: - items: - - description: MAC Reset signal. - - description: AHB Reset signal. + minItems: 2 + maxItems: 2 reset-names: items: From patchwork Mon Dec 18 21:44:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 180665 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp1555687dyi; Mon, 18 Dec 2023 13:56:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IFVz9uEAQbbeemSaBs/QkEfOBZUrizETsF0wV7pnrou48uNhtF5ON7wLvbH+4lVbvIAWCel X-Received: by 2002:a17:907:94c9:b0:a19:7144:6bf4 with SMTP id dn9-20020a17090794c900b00a1971446bf4mr9082344ejc.59.1702936565230; Mon, 18 Dec 2023 13:56:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702936565; cv=none; d=google.com; s=arc-20160816; b=fRQYuSHMKkDs/3ZA7sOisg8Rvv2MeNqoQmUAgE13fRhFeJhKqYF/cwDSZ+MFW4TFpO PZAeb0o4dkyBTig+OHvuIduthSctjQgXhWbcjwYd7m2c5H7VNgQvGyqyKU7rRwrhLThc Hs/0Pwm2z9b+QQC15gqUyzcWYZ7fbx9Avqkb0h/i047MuX21jwzZmtlrJoB2eumz3xi1 U/41S+uitUkzCXvfg+T/TqhIOSK4n+nnqfiqxFA6qwxa9/c30TQbd2cA2Kh6iaFd0L85 lYGu9AUtpkCTYQvo9amXjS7/njspz01DgS4Oju6ESS+8NXQN4y6+uV6eolnY1w3KtuFb ZrRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=FOLLFoICATNfW0aMFO7behe5XyvxF8U6iDNLU1niUjk=; fh=syaDh/WjooBXvAaul+2O0Q827rHRcsPrAm5I86d1V5c=; b=K7PuMFhZnvJdNITHx9QqBb/yJ8Kh11k0fqAmgPnGaH+baYUsNz7gHtqqW6adqCSAkO EhfR+ZFkouFzksiboUUiuRkhKg9v36k6PJLiw/VhKVSWwV6Vzc8ezbCjZhAr+oKRdJHL BmXeNa3pKwTSeyJ+xK5lf2MuR9815OI1olKBCvrhji37QmuQKrbYgxBkvHG1svdekFTh eHP/7PM8AIGG0LD7hI3VOC5jE2o2y7pREltXfdVXaQGO/mgwo+H7UCzmyZ4sbE6wEDXz Kk5uyfCYF4X8ko3TMxVGTfAUa59enCNlymaGGQq7vpbnlaHvETvwkR/kllQLEdpdvroB blyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=rkPqxC5J; spf=pass (google.com: domain of linux-kernel+bounces-4416-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4416-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id l12-20020a170906078c00b00a23338363bfsi2031792ejc.479.2023.12.18.13.56.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Dec 2023 13:56:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-4416-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=rkPqxC5J; spf=pass (google.com: domain of linux-kernel+bounces-4416-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4416-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id EDCB01F25D27 for ; Mon, 18 Dec 2023 21:46:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B0BD47995F; Mon, 18 Dec 2023 21:45:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="rkPqxC5J" X-Original-To: linux-kernel@vger.kernel.org Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 86EB5740B7; Mon, 18 Dec 2023 21:44:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1702935895; bh=agDjhGF4r+wlJ4Ho8Ax12MQJEIDMW5BPM20q8+toTBg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rkPqxC5JwnDEi9S3VJG+pcvbgMyWuKcxh4wyx/QrDicoqFCCfl2q/ociszT7uOPWV Dj10liFUokZLioJrCg0G5JiALLA8vRb0MLznE7SqM7dFaTsJWUVTE3+wHtZOv47o66 U1dShChLnhuEnPyTJYpX/QHxUIs8AZrllKbKyncAdAO/TEiQD7dNgZfrULb8P3Xgwx rVIB9uYU3rghBRclxj+UQbPl6YDsreTjh2cK2EpzGqNLbG5ux6zbFFkeyi84Sk7376 xZ3wSCtjYYh8uueODgBdSBn8nyL3/G+Lrl4Ya/BQRWp80SYFP2MwQUhNnjbx5h2oBM R8KtQ1yYWE5Pg== Received: from localhost (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 640D53781478; Mon, 18 Dec 2023 21:44:55 +0000 (UTC) From: Cristian Ciocaltea To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Emil Renner Berthing , Samin Guo , Paul Walmsley , Palmer Dabbelt , Albert Ou , Hal Feng , Michael Turquette , Stephen Boyd , Alexandre Torgue , Jose Abreu , Maxime Coquelin , Richard Cochran , Giuseppe Cavallaro Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, linux-clk@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, kernel@collabora.com Subject: [PATCH v4 2/9] dt-bindings: net: starfive,jh7110-dwmac: Add JH7100 SoC compatible Date: Mon, 18 Dec 2023 23:44:42 +0200 Message-ID: <20231218214451.2345691-3-cristian.ciocaltea@collabora.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231218214451.2345691-1-cristian.ciocaltea@collabora.com> References: <20231218214451.2345691-1-cristian.ciocaltea@collabora.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785658411505333359 X-GMAIL-MSGID: 1785658411505333359 The Synopsys DesignWare MAC found on StarFive JH7100 SoC is mostly similar to the newer JH7110, but it requires only two interrupts and a single reset line, which is 'ahb' instead of the commonly used 'stmmaceth'. Since the common binding 'snps,dwmac' allows selecting 'ahb' only in conjunction with 'stmmaceth', extend the logic to also permit exclusive usage of the 'ahb' reset name. This ensures the following use cases are supported: JH7110: reset-names = "stmmaceth", "ahb"; JH7100: reset-names = "ahb"; other: reset-names = "stmmaceth"; Also note the need to use a different dwmac fallback, as v5.20 applies to JH7110 only, while JH7100 relies on v3.7x. Signed-off-by: Cristian Ciocaltea --- .../devicetree/bindings/net/snps,dwmac.yaml | 11 ++- .../bindings/net/starfive,jh7110-dwmac.yaml | 74 +++++++++++++------ 2 files changed, 61 insertions(+), 24 deletions(-) diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml index 5c2769dc689a..4052b355ec2c 100644 --- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml +++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml @@ -95,6 +95,7 @@ properties: - snps,dwmac-5.20 - snps,dwxgmac - snps,dwxgmac-2.10 + - starfive,jh7100-dwmac - starfive,jh7110-dwmac reg: @@ -145,9 +146,13 @@ properties: reset-names: minItems: 1 - items: - - const: stmmaceth - - const: ahb + maxItems: 2 + oneOf: + - items: + - enum: [stmmaceth, ahb] + - items: + - const: stmmaceth + - const: ahb power-domains: maxItems: 1 diff --git a/Documentation/devicetree/bindings/net/starfive,jh7110-dwmac.yaml b/Documentation/devicetree/bindings/net/starfive,jh7110-dwmac.yaml index d90cb82c1424..f5f0bff5be0f 100644 --- a/Documentation/devicetree/bindings/net/starfive,jh7110-dwmac.yaml +++ b/Documentation/devicetree/bindings/net/starfive,jh7110-dwmac.yaml @@ -16,16 +16,20 @@ select: compatible: contains: enum: + - starfive,jh7100-dwmac - starfive,jh7110-dwmac required: - compatible properties: compatible: - items: - - enum: - - starfive,jh7110-dwmac - - const: snps,dwmac-5.20 + oneOf: + - items: + - const: starfive,jh7100-dwmac + - const: snps,dwmac + - items: + - const: starfive,jh7110-dwmac + - const: snps,dwmac-5.20 reg: maxItems: 1 @@ -46,23 +50,6 @@ properties: - const: tx - const: gtx - interrupts: - minItems: 3 - maxItems: 3 - - interrupt-names: - minItems: 3 - maxItems: 3 - - resets: - minItems: 2 - maxItems: 2 - - reset-names: - items: - - const: stmmaceth - - const: ahb - starfive,tx-use-rgmii-clk: description: Tx clock is provided by external rgmii clock. @@ -93,6 +80,51 @@ required: allOf: - $ref: snps,dwmac.yaml# + - if: + properties: + compatible: + contains: + const: starfive,jh7100-dwmac + then: + properties: + interrupts: + minItems: 2 + maxItems: 2 + + interrupt-names: + minItems: 2 + maxItems: 2 + + resets: + maxItems: 1 + + reset-names: + const: ahb + + - if: + properties: + compatible: + contains: + const: starfive,jh7110-dwmac + then: + properties: + interrupts: + minItems: 3 + maxItems: 3 + + interrupt-names: + minItems: 3 + maxItems: 3 + + resets: + minItems: 2 + maxItems: 2 + + reset-names: + items: + - const: stmmaceth + - const: ahb + unevaluatedProperties: false examples: From patchwork Mon Dec 18 21:44:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 180659 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp1552174dyi; Mon, 18 Dec 2023 13:47:22 -0800 (PST) X-Google-Smtp-Source: AGHT+IH/anjiT6AEgxQoAtyXq2eODctSg+i1yg88oPMRzK2wMFc80ptvTv4xKvnVwEKTagEZ+usM X-Received: by 2002:a05:600c:46d2:b0:40c:6b55:2c33 with SMTP id q18-20020a05600c46d200b0040c6b552c33mr1632202wmo.264.1702936042223; Mon, 18 Dec 2023 13:47:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702936042; cv=none; d=google.com; s=arc-20160816; b=KsDKFA6gUZljHkJIlsYG7ix5yVi+LQbMK3/li49ZSMBWFz8Jswie0x3pJdlS8CUjhI 2ym3ZO2q/EJhopIW9+uGVnp1ZMHstInnzJGCtI0TaYZSPQPU72XMPGQcSZzLRbx9bH/F ZUhXpfISGJdICwUkcZLKlAFl1x7FdbYDLwJEPyPA2veAnAr6S9KQ8IEn2fdk4vCskbYq thWxTMKamI9YieDJcHRnjSvAmZ4Ep0T2mFCAvuYBSKyFLcC4kNhvU07089h0nzzDVCq/ pCCB0waKt3M5ONwOEnBHXt4AHpe8vHju8sKF2zzcOGfK9KcAEQ9O+v7qb0QSQVmOPlny tegA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=0+gM9HYCy4+j0zgpRS43J/rf+C8/FjuFuZRbF3TGlws=; fh=syaDh/WjooBXvAaul+2O0Q827rHRcsPrAm5I86d1V5c=; b=DPc48YWH5roQh5l8h+bvB/TAX3yJxT4fWZ30Z2ef06dtAmFQNNSleNqx0KtehPcMvp WhBa5nvdEHiuHHR5bOHDFGDk7Zdkz/t8WnkABHfeuokoozHvxOm82jObRXkMmd0OvASU +ZWkymsY2m5y8Sr4Hg1eB2tN377bifRuzME4ui+BZAkS8upeusCNoY8ni07Pxz9OMsYP JmEeLePfrTT/XnyXMIJOtdvwD4QhaM/0tcp2PtqvE2notQXYs4Yj8HGwj8QjQjzw40/x k0/+Ycv0Q3arondBAYJ2VFZq3GCf4fDMjyFgsqE1pItzIKb/Pp4TvIQuhQ+5F9KyB3ai HRGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=SYhMTmsP; spf=pass (google.com: domain of linux-kernel+bounces-4418-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4418-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id d24-20020a170906305800b00a235e4d4385si909556ejd.51.2023.12.18.13.47.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Dec 2023 13:47:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-4418-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=SYhMTmsP; spf=pass (google.com: domain of linux-kernel+bounces-4418-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4418-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id D1C4E1F26011 for ; Mon, 18 Dec 2023 21:47:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A83BD7690D; Mon, 18 Dec 2023 21:45:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="SYhMTmsP" X-Original-To: linux-kernel@vger.kernel.org Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 73750760B6; Mon, 18 Dec 2023 21:44:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1702935896; bh=nB8fK2mag7xxaIPXY2D2kiffvAUioRug+1aDDBZv2DY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SYhMTmsP82d5NEbOhySuFcekbsYWdatq9dKwBWpvZ4w567X9fpsJC/qIEqP8Ns2o5 O3bE5bKZjNqgfRRXlGt01ktevH2A65wP6zgdoIAYgx4/B/VRUHm4N67cIRAQGLk4n7 cgJXDNZb2G2Oaxl+ZAVOSRHKJGyVkC8I5wfsyxQCfYtBPZFaiUkrpS7RB2EOmaxyrm b6alqdAxAsINWAANjWH+4u0EiNB3cJaVOHeOgtOkUH1e5yPxFp214uS5FRXROPs5yr tX1cUZdvM7YbdxxpYAl+dAVKUpESe6upCipBAMEx9kBPrJyI9gNB+0PZhG8EyXBAzg rOiuI6he5oCJw== Received: from localhost (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 8D5B73781493; Mon, 18 Dec 2023 21:44:56 +0000 (UTC) From: Cristian Ciocaltea To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Emil Renner Berthing , Samin Guo , Paul Walmsley , Palmer Dabbelt , Albert Ou , Hal Feng , Michael Turquette , Stephen Boyd , Alexandre Torgue , Jose Abreu , Maxime Coquelin , Richard Cochran , Giuseppe Cavallaro Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, linux-clk@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, kernel@collabora.com Subject: [PATCH v4 3/9] net: stmmac: dwmac-starfive: Add support for JH7100 SoC Date: Mon, 18 Dec 2023 23:44:43 +0200 Message-ID: <20231218214451.2345691-4-cristian.ciocaltea@collabora.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231218214451.2345691-1-cristian.ciocaltea@collabora.com> References: <20231218214451.2345691-1-cristian.ciocaltea@collabora.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785657863493400848 X-GMAIL-MSGID: 1785657863493400848 Add a missing quirk to enable support for the StarFive JH7100 SoC. Additionally, for greater flexibility in operation, allow using the rgmii-rxid and rgmii-txid phy modes. Co-developed-by: Emil Renner Berthing Signed-off-by: Emil Renner Berthing Signed-off-by: Cristian Ciocaltea Reviewed-by: Andrew Lunn --- drivers/net/ethernet/stmicro/stmmac/Kconfig | 6 ++-- .../ethernet/stmicro/stmmac/dwmac-starfive.c | 32 ++++++++++++++++--- 2 files changed, 31 insertions(+), 7 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/Kconfig b/drivers/net/ethernet/stmicro/stmmac/Kconfig index 85dcda51df05..4ec61f1ee71a 100644 --- a/drivers/net/ethernet/stmicro/stmmac/Kconfig +++ b/drivers/net/ethernet/stmicro/stmmac/Kconfig @@ -165,9 +165,9 @@ config DWMAC_STARFIVE help Support for ethernet controllers on StarFive RISC-V SoCs - This selects the StarFive platform specific glue layer support for - the stmmac device driver. This driver is used for StarFive JH7110 - ethernet controller. + This selects the StarFive platform specific glue layer support + for the stmmac device driver. This driver is used for the + StarFive JH7100 and JH7110 ethernet controllers. config DWMAC_STI tristate "STi GMAC support" diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-starfive.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-starfive.c index 5d630affb4d1..4e1076faee0c 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-starfive.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-starfive.c @@ -15,13 +15,20 @@ #include "stmmac_platform.h" -#define STARFIVE_DWMAC_PHY_INFT_RGMII 0x1 -#define STARFIVE_DWMAC_PHY_INFT_RMII 0x4 -#define STARFIVE_DWMAC_PHY_INFT_FIELD 0x7U +#define STARFIVE_DWMAC_PHY_INFT_RGMII 0x1 +#define STARFIVE_DWMAC_PHY_INFT_RMII 0x4 +#define STARFIVE_DWMAC_PHY_INFT_FIELD 0x7U + +#define JH7100_SYSMAIN_REGISTER49_DLYCHAIN 0xc8 + +struct starfive_dwmac_data { + unsigned int gtxclk_dlychain; +}; struct starfive_dwmac { struct device *dev; struct clk *clk_tx; + const struct starfive_dwmac_data *data; }; static void starfive_dwmac_fix_mac_speed(void *priv, unsigned int speed, unsigned int mode) @@ -67,6 +74,8 @@ static int starfive_dwmac_set_mode(struct plat_stmmacenet_data *plat_dat) case PHY_INTERFACE_MODE_RGMII: case PHY_INTERFACE_MODE_RGMII_ID: + case PHY_INTERFACE_MODE_RGMII_RXID: + case PHY_INTERFACE_MODE_RGMII_TXID: mode = STARFIVE_DWMAC_PHY_INFT_RGMII; break; @@ -89,6 +98,14 @@ static int starfive_dwmac_set_mode(struct plat_stmmacenet_data *plat_dat) if (err) return dev_err_probe(dwmac->dev, err, "error setting phy mode\n"); + if (dwmac->data) { + err = regmap_write(regmap, JH7100_SYSMAIN_REGISTER49_DLYCHAIN, + dwmac->data->gtxclk_dlychain); + if (err) + return dev_err_probe(dwmac->dev, err, + "error selecting gtxclk delay chain\n"); + } + return 0; } @@ -114,6 +131,8 @@ static int starfive_dwmac_probe(struct platform_device *pdev) if (!dwmac) return -ENOMEM; + dwmac->data = device_get_match_data(&pdev->dev); + dwmac->clk_tx = devm_clk_get_enabled(&pdev->dev, "tx"); if (IS_ERR(dwmac->clk_tx)) return dev_err_probe(&pdev->dev, PTR_ERR(dwmac->clk_tx), @@ -144,8 +163,13 @@ static int starfive_dwmac_probe(struct platform_device *pdev) return stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res); } +static const struct starfive_dwmac_data jh7100_data = { + .gtxclk_dlychain = 4, +}; + static const struct of_device_id starfive_dwmac_match[] = { - { .compatible = "starfive,jh7110-dwmac" }, + { .compatible = "starfive,jh7100-dwmac", .data = &jh7100_data }, + { .compatible = "starfive,jh7110-dwmac" }, { /* sentinel */ } }; MODULE_DEVICE_TABLE(of, starfive_dwmac_match); From patchwork Mon Dec 18 21:44:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 180658 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp1552172dyi; Mon, 18 Dec 2023 13:47:21 -0800 (PST) X-Google-Smtp-Source: AGHT+IEx2epjE+5s0g6uLQzT2mw3eVF6BsEohTROefHSkzJrRHr0L1X9YPdYgzp1LHsk5c6KDHRj X-Received: by 2002:a17:906:2216:b0:a23:4a4e:dd47 with SMTP id s22-20020a170906221600b00a234a4edd47mr1560464ejs.149.1702936041673; Mon, 18 Dec 2023 13:47:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702936041; cv=none; d=google.com; s=arc-20160816; b=0rIQpp0Y8FS1jyEr/B0m9lFj11HPVUHOmUW/b6T+EUnqdlP1p4VS0iT27AhsuNtjr1 PAdwn67tmkohlrJf4ARKp0MGaqnQa8NgAEhKsU0TobOF0XuQ+ozZvor07gNpr2xiMmmz zE4PYhENSGvFgA+cGg22U9Wm28o0k1NpTevYENWhE8GEBdDUbNZM3AEGqYxGcPVhmT99 sJy9niviE1nEwgx+o7J5A/Vi3N7NLsFbqAb65++6mcit3zvw7YKPWs2EM7YGz8Zjq7bE TM2ljRI1gJ+ofUvpfrxBcCIQO9GOqCA9tsaq/xgqasmSUWG0Wto9jECGFt8pPb3riVU4 HLaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=Dfc9xNdID0cHfX9uRzMWHsAnP8t9ykKt6yh2vhCad5M=; fh=MOJyzNMsFAJQqEQehvdnrwT/huG78rLnZqS8spAjFqo=; b=ezJ/T5z/jKFvdFsFJNrxGnCEIbXqujJB5IXrUWzQpEaZWjoauYDEgPHfYuixPqawUm xE2KuQ7MAH20/nWw4m+SpfWvf1UEarPqGtyw8cl/tHS6CXl36wg5APYMNgGETYSZtZip 0SiaKULdpkI5VcZ29YKIYva9N4HDRiM6QpfV7gpvTIAKdDuEtet2cj9jhJR/r1+C0+wB i8YBJpTispVFZk+kkXhAoU2wuEy4LaipKf5CKrhXoqqJ8xWppc4LxaloaSUlp0gGHP6C MAmS1H3o4XQhR07pY7dAlBD2h3Kvp4N1Llf2BaGiZLWpnmr5CBw8UWM+RMK/iecVYJlV C1XQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=PVCpFCl8; spf=pass (google.com: domain of linux-kernel+bounces-4417-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4417-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id l9-20020a170906230900b00a2361a6dea8si799493eja.353.2023.12.18.13.47.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Dec 2023 13:47:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-4417-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=PVCpFCl8; spf=pass (google.com: domain of linux-kernel+bounces-4417-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4417-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 4BCB91F25FAB for ; Mon, 18 Dec 2023 21:47:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9E5797BEE2; Mon, 18 Dec 2023 21:45:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="PVCpFCl8" X-Original-To: linux-kernel@vger.kernel.org Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 737A8760B7; Mon, 18 Dec 2023 21:44:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1702935897; bh=nwoZSeh1Kp6U1IUyUeb5W4P20NSggurGdjJI6k4fjo8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PVCpFCl8gkuWIT5cdjPAf0qmxh2DkMbJ5B037q75D7hmejM87S92KQjaD2Wv8SuL6 fz+hoBPM2lUW9ePjB8koMFfQbTqq37Q5o8QS4Qtn5RQw39/uSDj+SlmWb9Fu5y0wJY hTUpcrpU+XibOQpsVOgWnkuHQxwezCrZ/nrs4C7hkvAg136MdLbc/8+/php0Txw7NC s9S1xIsYQzg+qt3TkZhmuh9cKIi5dv8h/O3uVPy9vw49crXXleC2dYuCx6RkbC4VbT CJeJp0PW0jKoRwSWXLJJbgpEDdmTZU00rSvhmMBfLfxfkxvRSy8deYv0297Dr2ZKtX sWnQC/cvCbpNw== Received: from localhost (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by madrid.collaboradmins.com (Postfix) with ESMTPSA id A96BB3781492; Mon, 18 Dec 2023 21:44:57 +0000 (UTC) From: Cristian Ciocaltea To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Emil Renner Berthing , Samin Guo , Paul Walmsley , Palmer Dabbelt , Albert Ou , Hal Feng , Michael Turquette , Stephen Boyd , Alexandre Torgue , Jose Abreu , Maxime Coquelin , Richard Cochran , Giuseppe Cavallaro Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, linux-clk@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, kernel@collabora.com, Emil Renner Berthing Subject: [PATCH v4 4/9] riscv: dts: starfive: jh7100: Add sysmain and gmac DT nodes Date: Mon, 18 Dec 2023 23:44:44 +0200 Message-ID: <20231218214451.2345691-5-cristian.ciocaltea@collabora.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231218214451.2345691-1-cristian.ciocaltea@collabora.com> References: <20231218214451.2345691-1-cristian.ciocaltea@collabora.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785657862985403840 X-GMAIL-MSGID: 1785657862985403840 Provide the sysmain and gmac DT nodes supporting the DWMAC found on the StarFive JH7100 SoC. Co-developed-by: Emil Renner Berthing Signed-off-by: Emil Renner Berthing Signed-off-by: Cristian Ciocaltea --- arch/riscv/boot/dts/starfive/jh7100.dtsi | 36 ++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/arch/riscv/boot/dts/starfive/jh7100.dtsi b/arch/riscv/boot/dts/starfive/jh7100.dtsi index c216aaecac53..2ebdebe6a81c 100644 --- a/arch/riscv/boot/dts/starfive/jh7100.dtsi +++ b/arch/riscv/boot/dts/starfive/jh7100.dtsi @@ -204,6 +204,37 @@ sdio1: mmc@10010000 { status = "disabled"; }; + gmac: ethernet@10020000 { + compatible = "starfive,jh7100-dwmac", "snps,dwmac"; + reg = <0x0 0x10020000 0x0 0x10000>; + clocks = <&clkgen JH7100_CLK_GMAC_ROOT_DIV>, + <&clkgen JH7100_CLK_GMAC_AHB>, + <&clkgen JH7100_CLK_GMAC_PTP_REF>, + <&clkgen JH7100_CLK_GMAC_TX_INV>, + <&clkgen JH7100_CLK_GMAC_GTX>; + clock-names = "stmmaceth", "pclk", "ptp_ref", "tx", "gtx"; + resets = <&rstgen JH7100_RSTN_GMAC_AHB>; + reset-names = "ahb"; + interrupts = <6>, <7>; + interrupt-names = "macirq", "eth_wake_irq"; + max-frame-size = <9000>; + snps,multicast-filter-bins = <32>; + snps,perfect-filter-entries = <128>; + starfive,syscon = <&sysmain 0x70 0>; + rx-fifo-depth = <32768>; + tx-fifo-depth = <16384>; + snps,axi-config = <&stmmac_axi_setup>; + snps,fixed-burst; + snps,force_thresh_dma_mode; + status = "disabled"; + + stmmac_axi_setup: stmmac-axi-config { + snps,wr_osr_lmt = <16>; + snps,rd_osr_lmt = <16>; + snps,blen = <256 128 64 32 0 0 0>; + }; + }; + clkgen: clock-controller@11800000 { compatible = "starfive,jh7100-clkgen"; reg = <0x0 0x11800000 0x0 0x10000>; @@ -218,6 +249,11 @@ rstgen: reset-controller@11840000 { #reset-cells = <1>; }; + sysmain: syscon@11850000 { + compatible = "starfive,jh7100-sysmain", "syscon"; + reg = <0x0 0x11850000 0x0 0x10000>; + }; + i2c0: i2c@118b0000 { compatible = "snps,designware-i2c"; reg = <0x0 0x118b0000 0x0 0x10000>; From patchwork Mon Dec 18 21:44:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 180660 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp1552358dyi; Mon, 18 Dec 2023 13:47:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IFuTKg/q7RIUbqu4EW7WOXs1lNKt/zMD4LRXfGCRPwuZSk5XUo1nl+ek2secxgpW9xJd8KV X-Received: by 2002:a05:6512:3743:b0:50c:be5:ffc with SMTP id a3-20020a056512374300b0050c0be50ffcmr8053137lfs.113.1702936065329; Mon, 18 Dec 2023 13:47:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702936065; cv=none; d=google.com; s=arc-20160816; b=POcx8hQ0u1FaUP7E/R0bw+6fcviK4dnqfNgdwt37kjqzLHM2UPXx32o42RmbodTVi3 xXPiFbZ5UTAK976mphj7046ShZXMv/XyxYOcpPfMQDwMQCMCyVkYEYui6EBJNIHy+EBU WG2sTTTisXfGPe+cxrXpmRK8TcHMyrZER2RVA8TWWKIWzFYqTJzJhSHtdjH4uBTE9rXO K75yz+U84iK3hr9TT4rmQVJDoDcZEMBYY+fqyzGBRF9o80G/0UIIEbaguUjElewd8uEI 5rgxBkycUwjiEpnSB+IkeZ3t7F5Vb1Wd3UUCYYOCgIdap3HEvU6bsyGok19ORNCEoNm+ DOMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=ao8g5u/I0Tpll1iRVzsBd0C6My70Cl4hknViEQ6emOw=; fh=MOJyzNMsFAJQqEQehvdnrwT/huG78rLnZqS8spAjFqo=; b=pGWCyO379bKekqet0OCEKOSIlWZuK4XdzxBiyV/TkOZx7fncIbDhNSnfc4xkja0Tpt gXHJe2sUR+JuAfXyA4ty2WwmxI37gIiINDmU8s7XN8FdQu6TURc3t8rl7l7/R0pmH8f8 nOFsXSVIKMUy80/o4DXC4WWWLrx2hSqLzzWUDb371/g21o/lsnVGYMH5lFvH1HjYPfcl B6mdZ/TQAOrc2kCnKh0W9fwy76NmtLsGmhPD9d4UITjDQwRfTJGKXxIc02dBPNrgde8H l+oimC0fOBmwRrAcKmKeiF4LNXaMJK38POnit7sVkKbdsvPxnQkH3bpS3/Ubl4gTRj+r 5dnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=iKP7mOpN; spf=pass (google.com: domain of linux-kernel+bounces-4419-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4419-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id qh25-20020a170906ecb900b00a235fc5744esi853665ejb.481.2023.12.18.13.47.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Dec 2023 13:47:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-4419-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=iKP7mOpN; spf=pass (google.com: domain of linux-kernel+bounces-4419-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4419-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id D3AAD1F260CA for ; Mon, 18 Dec 2023 21:47:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DC59C7C641; Mon, 18 Dec 2023 21:45:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="iKP7mOpN" X-Original-To: linux-kernel@vger.kernel.org Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A1E4E768FF; Mon, 18 Dec 2023 21:45:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1702935899; bh=SJhrES2WZXMt1XZYIJ5pjNI/hRHLW0ufwMjJJWnIkpY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iKP7mOpNdfoZLsrB/YV6tWG9GnqkThGRMrIAasyMprdmD7IrGyI5aL4Sp/vlcwGWI XOKcUb+84AroG9XH1p+Dy8risKvVWquBbWlg0F92ejFGd2Oq4b+MExzvSVlcWf3Qiq +QdwGbAqUznEUIa2lrQW0B2u2RsySf8kSUl/HQyTYDRkjLiV4cEIi0CXex22OFea8d 1gd4S/3Ypu+h06QPOKQ0Qw7LLns+L3oAQI0G6DX3mYEZOHdBoI1xpSRgaYxzotiIZw D5unpsiCDyL487s7UDZb2wfWOXSsTPwQHt/PefW/ZJCCU0VixbCE1VZjokMdfHJ9Yw HjBTyHk3XvKvg== Received: from localhost (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by madrid.collaboradmins.com (Postfix) with ESMTPSA id C3BF037814AA; Mon, 18 Dec 2023 21:44:58 +0000 (UTC) From: Cristian Ciocaltea To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Emil Renner Berthing , Samin Guo , Paul Walmsley , Palmer Dabbelt , Albert Ou , Hal Feng , Michael Turquette , Stephen Boyd , Alexandre Torgue , Jose Abreu , Maxime Coquelin , Richard Cochran , Giuseppe Cavallaro Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, linux-clk@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, kernel@collabora.com, Emil Renner Berthing Subject: [PATCH v4 5/9] riscv: dts: starfive: jh7100-common: Setup pinmux and enable gmac Date: Mon, 18 Dec 2023 23:44:45 +0200 Message-ID: <20231218214451.2345691-6-cristian.ciocaltea@collabora.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231218214451.2345691-1-cristian.ciocaltea@collabora.com> References: <20231218214451.2345691-1-cristian.ciocaltea@collabora.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785657887736796291 X-GMAIL-MSGID: 1785657887736796291 Add pinmux configuration for DWMAC found on the JH7100 based boards and enable the related DT node, providing a basic PHY configuration. Co-developed-by: Emil Renner Berthing Signed-off-by: Emil Renner Berthing Signed-off-by: Cristian Ciocaltea --- .../boot/dts/starfive/jh7100-common.dtsi | 84 +++++++++++++++++++ 1 file changed, 84 insertions(+) diff --git a/arch/riscv/boot/dts/starfive/jh7100-common.dtsi b/arch/riscv/boot/dts/starfive/jh7100-common.dtsi index 42fb61c36068..bcba08e5bdf2 100644 --- a/arch/riscv/boot/dts/starfive/jh7100-common.dtsi +++ b/arch/riscv/boot/dts/starfive/jh7100-common.dtsi @@ -72,7 +72,91 @@ wifi_pwrseq: wifi-pwrseq { }; }; +&gmac { + pinctrl-names = "default"; + pinctrl-0 = <&gmac_pins>; + phy-mode = "rgmii-id"; + status = "okay"; + + mdio: mdio { + #address-cells = <1>; + #size-cells = <0>; + compatible = "snps,dwmac-mdio"; + }; +}; + &gpio { + gmac_pins: gmac-0 { + gtxclk-pins { + pins = ; + bias-pull-up; + drive-strength = <35>; + input-enable; + input-schmitt-enable; + slew-rate = <0>; + }; + miitxclk-pins { + pins = ; + bias-pull-up; + drive-strength = <14>; + input-enable; + input-schmitt-disable; + slew-rate = <0>; + }; + tx-pins { + pins = , + , + , + , + , + , + , + , + ; + bias-pull-up; + drive-strength = <35>; + input-disable; + input-schmitt-disable; + slew-rate = <0>; + }; + rxclk-pins { + pins = ; + bias-pull-up; + drive-strength = <14>; + input-enable; + input-schmitt-disable; + slew-rate = <6>; + }; + rxer-pins { + pins = ; + bias-pull-up; + drive-strength = <14>; + input-enable; + input-schmitt-disable; + slew-rate = <0>; + }; + rx-pins { + pins = , + , + , + , + , + , + , + , + , + , + , + , + ; + bias-pull-up; + drive-strength = <14>; + input-enable; + input-schmitt-enable; + slew-rate = <0>; + }; + }; + i2c0_pins: i2c0-0 { i2c-pins { pinmux = X-Patchwork-Id: 180661 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp1552452dyi; Mon, 18 Dec 2023 13:47:58 -0800 (PST) X-Google-Smtp-Source: AGHT+IGx34tQshL6SdLGRpPtfzsls5vQujx0T5i6AWAitsFUs99DFbZMCGiC48BuluDl3hGE+tF1 X-Received: by 2002:ac2:5e99:0:b0:50e:4444:f2a4 with SMTP id b25-20020ac25e99000000b0050e4444f2a4mr269372lfq.109.1702936078282; Mon, 18 Dec 2023 13:47:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702936078; cv=none; d=google.com; s=arc-20160816; b=idsJI7v6l2/aigKqp8jXuQGLZWUePf4GQGP+VSPimbO9lNG8nPi+8ZsFEZOUFtLCkC l/coYSWRI9i7a3NSPHjbZzzXM8Un9XasqDhcwiaw89t59l362MEEnz3Mi3iGBuKdGeGg FJj4j4pwfe5OAYwQdwMzJqMPyqrBn2TAFg42GJb5Iz1UvEZaypPrnND9Z15Z1ky9XWf7 KkLWIXnb/G+/kQAqQ0zfkbBvEtGBoEW5Bv2KBa1dwXDxA1YBOMnuv3vowGoGtMN4c7m8 FOqU5ux99E661i9sBMklu9ggRFbBf8nRcRZ1WSIGwTacQP6FvHMq2gEqiDUB3q6CszUo VHLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=dtyktrD7g18YdUT/SV48Nf6MPUu8IoeErrF4Rif8gR0=; fh=MOJyzNMsFAJQqEQehvdnrwT/huG78rLnZqS8spAjFqo=; b=nwDGeCuXWmDAxffmV8FSQ0Dek70Hyua6aoJRVFhgUOufeQJmb2zbQ67WE2sLzz0Vyh gs971JI4fGV6qk4wv5z0+6MznlRmbB93iXiJzFDDEDeSdZ31zIvH5ZqVpv5b2H603wsn 0EFh9dBkI/i9myPGqyrnK2Jl7fvwFnY8FfbOk6daRmEw1ReuZ4dXj2df5npCf3w2cHZK k4Gre7y3AqsbVns0PxBaKTkyLJoC9D96pEXbZVmF9WeLfuBlXb67+0D3L74pQMT0B2DS p11OxDOPLanWU4IuzV75r9e6LzENbkN/IzlLETbKr0+bHhmC3CqPJAI81CT3BOaX9ffC ZRTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=xMRMTnkW; spf=pass (google.com: domain of linux-kernel+bounces-4420-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4420-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id dc25-20020a056402311900b005535017368dsi1108263edb.73.2023.12.18.13.47.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Dec 2023 13:47:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-4420-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=xMRMTnkW; spf=pass (google.com: domain of linux-kernel+bounces-4420-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4420-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id AA0B81F2611F for ; Mon, 18 Dec 2023 21:47:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B4D087C65C; Mon, 18 Dec 2023 21:45:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="xMRMTnkW" X-Original-To: linux-kernel@vger.kernel.org Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8935479956; Mon, 18 Dec 2023 21:45:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1702935900; bh=HuOM7ECyvIemfEAWs07YUa5GDYXFtppCMkeuXbHE3H8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xMRMTnkWmjm5My4aEyYxW2P25j5XCxD36o4zB4JmSkNduJ7Fynp9bbcMP8KQ8iCXR 3YzK8ubA/jcfwOIXRBxgdLb2FjxEEVdpess4KdwQyFN/BymURC/BiFryKL/+z7IGsy cRpq5UTqONLl8aXg37G0lyk9l8q5yvQUYt9N502yeLT8e17Tuw+LYu9z7FbP4tatJr bdtCTd9VjsCMc7K/CMDNgIFALdbTsEQ47nx1Eg5bF+UmSMyYZQLTnNZ46tEowi6Efh xpiW0LgL5v+HNgbkvbqqQ6HgmxAC7l9lG21r+HOMf7THqPEEwMUhTJywRpYBu6Pr9n wouRy+uMbBwig== Received: from localhost (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by madrid.collaboradmins.com (Postfix) with ESMTPSA id D81DD37814AF; Mon, 18 Dec 2023 21:44:59 +0000 (UTC) From: Cristian Ciocaltea To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Emil Renner Berthing , Samin Guo , Paul Walmsley , Palmer Dabbelt , Albert Ou , Hal Feng , Michael Turquette , Stephen Boyd , Alexandre Torgue , Jose Abreu , Maxime Coquelin , Richard Cochran , Giuseppe Cavallaro Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, linux-clk@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, kernel@collabora.com, Emil Renner Berthing Subject: [PATCH v4 6/9] riscv: dts: starfive: visionfive-v1: Setup ethernet phy Date: Mon, 18 Dec 2023 23:44:46 +0200 Message-ID: <20231218214451.2345691-7-cristian.ciocaltea@collabora.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231218214451.2345691-1-cristian.ciocaltea@collabora.com> References: <20231218214451.2345691-1-cristian.ciocaltea@collabora.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785657901083637303 X-GMAIL-MSGID: 1785657901083637303 The StarFive VisionFive V1 SBC uses a Motorcomm YT8521 PHY supporting RGMII-ID, but requires manual adjustment of the RX internal delay to work properly. The default RX delay provided by the driver is 1.95 ns, which proves to be too high. Applying a 50% reduction seems to mitigate the issue. Also note this adjustment is not necessary on BeagleV Starlight SBC, which uses a Microchip PHY. Hence, there is no indication of a misbehaviour on the GMAC side, but most likely the issue stems from the Motorcomm PHY. While at it, drop the redundant gpio include, which is already provided by jh7100-common.dtsi. Co-developed-by: Emil Renner Berthing Signed-off-by: Emil Renner Berthing Signed-off-by: Cristian Ciocaltea Reviewed-by: Andrew Lunn --- .../jh7100-starfive-visionfive-v1.dts | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/arch/riscv/boot/dts/starfive/jh7100-starfive-visionfive-v1.dts b/arch/riscv/boot/dts/starfive/jh7100-starfive-visionfive-v1.dts index e82af72f1aaf..4e396f820660 100644 --- a/arch/riscv/boot/dts/starfive/jh7100-starfive-visionfive-v1.dts +++ b/arch/riscv/boot/dts/starfive/jh7100-starfive-visionfive-v1.dts @@ -6,7 +6,6 @@ /dts-v1/; #include "jh7100-common.dtsi" -#include / { model = "StarFive VisionFive V1"; @@ -18,3 +17,24 @@ gpio-restart { priority = <224>; }; }; + +/* + * The board uses a Motorcomm YT8521 PHY supporting RGMII-ID, but requires + * manual adjustment of the RX internal delay to work properly. The default + * RX delay provided by the driver (1.95ns) is too high, but applying a 50% + * reduction seems to mitigate the issue. + * + * It is worth noting the adjustment is not necessary on BeagleV Starlight SBC, + * which uses a Microchip PHY. Hence, most likely the Motorcomm PHY is the one + * responsible for the misbehaviour, not the GMAC. + */ +&mdio { + phy: ethernet-phy@0 { + reg = <0>; + rx-internal-delay-ps = <900>; + }; +}; + +&gmac { + phy-handle = <&phy>; +}; From patchwork Mon Dec 18 21:44:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 180662 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp1552621dyi; Mon, 18 Dec 2023 13:48:21 -0800 (PST) X-Google-Smtp-Source: AGHT+IEb4oFRx78egWmo5oxHUCT8ywJm/74Eml2VuiqQSooAgJj6pzG9QWn64rkp7vLZmlzHcUMm X-Received: by 2002:a17:902:f7d5:b0:1d3:ac23:b50f with SMTP id h21-20020a170902f7d500b001d3ac23b50fmr1286298plw.96.1702936100799; Mon, 18 Dec 2023 13:48:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702936100; cv=none; d=google.com; s=arc-20160816; b=kC5uiWaJU3K5G6Ou51pqIBqARXNN3HQtwWbqfcwuX2l2FUkjMz0VYKBFEjIIApIJGU SRVL5CJ5AGvtWRTZdTjxc/4oQLHVEw3AvSe1d671Q9X62Ceg5b7MuecexSrNrOzLkWEH MDd1+7VYDSG5pVJ3ql+Cn5SYZ/RDHlqZ8J2QhYn9siIJZTiu/sneYzjty9IdFZOiIQZj /vXHqKRPOxaasBezfvrhLAQQJaPgL14Nl3jYZkxBMNOYPIbbU0PKx+28lxPyzJq0eGe/ ffTE1RrJ1FfOvmiWvGejbDC+Cp2QyFFckcDPO9qAubV+94ZcGzhqQ4hOZUpz9O0Y2FfZ E9Aw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=Ki/pMRLTukgDMMBXCdaxCNXzP760N4SMmcP7ymRUTsA=; fh=MOJyzNMsFAJQqEQehvdnrwT/huG78rLnZqS8spAjFqo=; b=wJeutsgz5tgpIH+du95Ja8a+y+agYZLD/9UIk+LL3L3ghbZbHoqpoypoBo+/Vttt9W 1Lqynu3Lx5QvBs6SkR+XI0w3iStI5tGMNpCl616RDwCPtlnYZok9xtL0qokaBvNxJTqx xazcKTsCmGLJdTH8hJBNaDslzThsomnYfD24o1oxbxHMVWdLwyW/9Kv1D/tvRLSEAQ8F Mj+Ym4TCv50bJPdr/AApP2jAdT4JftxUcJpaq66AALQUDPL9CqT3BwGr5NX3NduwWXmx eeh8mCygjpniZcWU0uxRyDyiXfCQKHS6v3eODu/60rxSIilzdGCxNrpyWiDPiLAaDNra oOqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=xvBHSpbI; spf=pass (google.com: domain of linux-kernel+bounces-4421-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4421-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id v12-20020a1709028d8c00b001cf9e86314dsi7440446plo.637.2023.12.18.13.48.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Dec 2023 13:48:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-4421-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=xvBHSpbI; spf=pass (google.com: domain of linux-kernel+bounces-4421-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4421-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 8F2E92863F7 for ; Mon, 18 Dec 2023 21:48:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 11E8C7CCFA; Mon, 18 Dec 2023 21:45:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="xvBHSpbI" X-Original-To: linux-kernel@vger.kernel.org Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0C2857AE79; Mon, 18 Dec 2023 21:45:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1702935901; bh=l+eWaUkr0QWL7sDgPsO2uU1ihAKDwVmDeuD26D7VS5M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xvBHSpbIGeINNhcUZF4yZ4Au6Jp+FlBHac8FRRgRFQjOSdqggtFkjilcTU6IoW1ET wlMZfXEII8Lh5npVJ/ssGW9OkURbQ5U5x29RgsJCfLyJbGaKz21CXm4n1xNInwEqB9 T4SQXyIyl+IBoyAD2VXIye/egruOGMrCCX3U6GvemAmknA5fe26MXDJMFqp6Z1/aZ2 UEdjEv2kg8ZFIBRfO1ZBm+FkE8eSh9VtGz4PTgIAQoqXFNrVdayBGofkseoLDYzoa0 sd5nty0KQlnQwgjpi0Yb/L4zbsE37EN1JrITw4KajtLiqgPN9Vuf8QlR+neczF5AdD CAgKIWngoNOJA== Received: from localhost (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 1ABEF37814B0; Mon, 18 Dec 2023 21:45:01 +0000 (UTC) From: Cristian Ciocaltea To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Emil Renner Berthing , Samin Guo , Paul Walmsley , Palmer Dabbelt , Albert Ou , Hal Feng , Michael Turquette , Stephen Boyd , Alexandre Torgue , Jose Abreu , Maxime Coquelin , Richard Cochran , Giuseppe Cavallaro Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, linux-clk@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, kernel@collabora.com, Emil Renner Berthing Subject: [PATCH v4 7/9] riscv: dts: starfive: beaglev-starlight: Setup phy reset gpio Date: Mon, 18 Dec 2023 23:44:47 +0200 Message-ID: <20231218214451.2345691-8-cristian.ciocaltea@collabora.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231218214451.2345691-1-cristian.ciocaltea@collabora.com> References: <20231218214451.2345691-1-cristian.ciocaltea@collabora.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785657924845529684 X-GMAIL-MSGID: 1785657924845529684 The BeagleV Starlight SBC uses a Microchip KSZ9031RNXCA PHY supporting RGMII-ID which doesn't require any particular setup, other than defining a reset gpio, as opposed to VisionFive V1 for which the RX internal delay had to be adjusted. Co-developed-by: Emil Renner Berthing Signed-off-by: Emil Renner Berthing Signed-off-by: Cristian Ciocaltea --- .../boot/dts/starfive/jh7100-beaglev-starlight.dts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/arch/riscv/boot/dts/starfive/jh7100-beaglev-starlight.dts b/arch/riscv/boot/dts/starfive/jh7100-beaglev-starlight.dts index 7cda3a89020a..b79426935bfd 100644 --- a/arch/riscv/boot/dts/starfive/jh7100-beaglev-starlight.dts +++ b/arch/riscv/boot/dts/starfive/jh7100-beaglev-starlight.dts @@ -11,3 +11,14 @@ / { model = "BeagleV Starlight Beta"; compatible = "beagle,beaglev-starlight-jh7100-r0", "starfive,jh7100"; }; + +&mdio { + phy: ethernet-phy@7 { + reg = <7>; + reset-gpios = <&gpio 63 GPIO_ACTIVE_LOW>; + }; +}; + +&gmac { + phy-handle = <&phy>; +}; From patchwork Mon Dec 18 21:44:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 180663 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp1552800dyi; Mon, 18 Dec 2023 13:48:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IGfW3uCVnuXTgLxgS4E8h5eTX2SpvOlCu0w65jydhw8OqVZTDU4OIXHTfToooSdLm1TLx3h X-Received: by 2002:a05:6a00:a23:b0:6d0:99da:3d32 with SMTP id p35-20020a056a000a2300b006d099da3d32mr17818468pfh.41.1702936124634; Mon, 18 Dec 2023 13:48:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702936124; cv=none; d=google.com; s=arc-20160816; b=K6vcXovbCwj6jMeW8OS0zwPyYMyLayz97qUmZBpp/lvKfJKObqUMqSh2OnXzLEnLZh In8mMquPnaXkMG4GMUYoeSsloK448jYKKfIiKBhDk4jolEY0+Bvj2OmrmUJ8B2f9uXg3 62FtBKHYvWsB+1/Ix9IFBkZPaxj6uDnPunJXIgZrc7n7z2fIxnhnmVAIT07GBeQYuLHO E5zhxHTHWBmvbQYMo53nw81Ungy6UpjV5OMiJazLc29S3SI0Tdhc+Vx1CBmxe1vj6maP gTb8GIj6dHL3vxbP3e4zuZv4F+j4wIgGke3ExskpWdu0BI5naSg0xUts08/T3WJHYPXR DVEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=wFjndiVNAjSwascnmysAiCTYD1y9o1A7ReuxzhWOqsM=; fh=MOJyzNMsFAJQqEQehvdnrwT/huG78rLnZqS8spAjFqo=; b=NaR57KmpDe6lRhevmt9s0i98OnZTSIo0mVzMTAecS/knAxD480o2E4/7zOR6SzVzIl ie81TNlJxNEJAmfbk4m2/FCVFas2H+J8PJNZk4W9kTTsRiU4OtV1GC5K0B4oGl0DgKoW r/mQRIIY+EnMLaitQqOHUeNWrQzAqi4QKhOnUJrjjXnIpLYTDL08FywDS6sHCU/V29Nh mWvedLAJ5P90m5fPSH5kXImoSpYptcSR3dyrm22qQPJG7IlJy6ToRY6t5z90YYbNwmzg xDaY1wfvtu/TPZmDgfjpGHLyYScg9cOZeHfdEdP0yeGt1kjlyttQPlZtzMwZOo8DRy6A OQOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=2KTYKdpo; spf=pass (google.com: domain of linux-kernel+bounces-4422-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4422-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id y13-20020a63e24d000000b005c606792120si18133661pgj.107.2023.12.18.13.48.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Dec 2023 13:48:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-4422-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=2KTYKdpo; spf=pass (google.com: domain of linux-kernel+bounces-4422-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4422-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 70919B23D9F for ; Mon, 18 Dec 2023 21:48:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C9EA87D61B; Mon, 18 Dec 2023 21:45:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="2KTYKdpo" X-Original-To: linux-kernel@vger.kernel.org Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 237E97BEFE; Mon, 18 Dec 2023 21:45:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1702935902; bh=a4O7NVH7+Hn7aLxcG8hLOtd4cBwqPDJuwZLZUBFFqj8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2KTYKdpox1ZsjBRe5OttPB+xxzm1t/SuWm7+6LdvUS/j3zew8OzyBf0GKmiS0OpOe hzolbaU/aXT1g1jTDeqECtkhfZAGJvn9HZFlxLswreUP+w3RWAI17SF2OmUpJK7/oB 9HyFY5ZmE3qO6YdSAGyEDcCGRtbidU6hYyoUYBvWoyynuxJkJCBsO3yM52tO5HOncX aaLog7pLKfz3hItWar2KAsruYcjgO+kLNXSeOB0VZA/o2Bejgv45gVR+vSD5/XROAk J7i8mWMDliuFUpvavAqtY+45P8eimXsjIWlTEoHlaFi1vR4NFcbtoehcSzVBU0+R/F ET6eBUGpxYuLA== Received: from localhost (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 3A1303781F7C; Mon, 18 Dec 2023 21:45:02 +0000 (UTC) From: Cristian Ciocaltea To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Emil Renner Berthing , Samin Guo , Paul Walmsley , Palmer Dabbelt , Albert Ou , Hal Feng , Michael Turquette , Stephen Boyd , Alexandre Torgue , Jose Abreu , Maxime Coquelin , Richard Cochran , Giuseppe Cavallaro Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, linux-clk@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, kernel@collabora.com, Emil Renner Berthing Subject: [PATCH v4 8/9] clk: starfive: Add flags argument to JH71X0__MUX macro Date: Mon, 18 Dec 2023 23:44:48 +0200 Message-ID: <20231218214451.2345691-9-cristian.ciocaltea@collabora.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231218214451.2345691-1-cristian.ciocaltea@collabora.com> References: <20231218214451.2345691-1-cristian.ciocaltea@collabora.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785657949772350267 X-GMAIL-MSGID: 1785657949772350267 From: Emil Renner Berthing This flag is needed to add the CLK_SET_RATE_PARENT flag on the gmac_tx clock on the JH7100, which in turn is needed by the dwmac-starfive driver to set the clock properly for 1000, 100 and 10 Mbps links. This change was mostly made using coccinelle: @ match @ expression idx, name, nparents; @@ JH71X0__MUX( -idx, name, nparents, +idx, name, 0, nparents, ...) Signed-off-by: Emil Renner Berthing Signed-off-by: Cristian Ciocaltea --- .../clk/starfive/clk-starfive-jh7100-audio.c | 2 +- drivers/clk/starfive/clk-starfive-jh7100.c | 32 +++++++++---------- .../clk/starfive/clk-starfive-jh7110-aon.c | 6 ++-- .../clk/starfive/clk-starfive-jh7110-isp.c | 2 +- .../clk/starfive/clk-starfive-jh7110-sys.c | 26 +++++++-------- drivers/clk/starfive/clk-starfive-jh71x0.h | 4 +-- 6 files changed, 36 insertions(+), 36 deletions(-) diff --git a/drivers/clk/starfive/clk-starfive-jh7100-audio.c b/drivers/clk/starfive/clk-starfive-jh7100-audio.c index ee4bda14a40e..1fcf4e62f347 100644 --- a/drivers/clk/starfive/clk-starfive-jh7100-audio.c +++ b/drivers/clk/starfive/clk-starfive-jh7100-audio.c @@ -79,7 +79,7 @@ static const struct jh71x0_clk_data jh7100_audclk_data[] = { JH71X0_GDIV(JH7100_AUDCLK_USB_LPM, "usb_lpm", CLK_IGNORE_UNUSED, 4, JH7100_AUDCLK_USB_APB), JH71X0_GDIV(JH7100_AUDCLK_USB_STB, "usb_stb", CLK_IGNORE_UNUSED, 3, JH7100_AUDCLK_USB_APB), JH71X0__DIV(JH7100_AUDCLK_APB_EN, "apb_en", 8, JH7100_AUDCLK_DOM7AHB_BUS), - JH71X0__MUX(JH7100_AUDCLK_VAD_MEM, "vad_mem", 2, + JH71X0__MUX(JH7100_AUDCLK_VAD_MEM, "vad_mem", 0, 2, JH7100_AUDCLK_VAD_INTMEM, JH7100_AUDCLK_AUDIO_12288), }; diff --git a/drivers/clk/starfive/clk-starfive-jh7100.c b/drivers/clk/starfive/clk-starfive-jh7100.c index 69cc11ea7e33..d3b260c01d5c 100644 --- a/drivers/clk/starfive/clk-starfive-jh7100.c +++ b/drivers/clk/starfive/clk-starfive-jh7100.c @@ -24,48 +24,48 @@ #define JH7100_CLK_GMAC_GR_MII_RX (JH7100_CLK_END + 3) static const struct jh71x0_clk_data jh7100_clk_data[] __initconst = { - JH71X0__MUX(JH7100_CLK_CPUNDBUS_ROOT, "cpundbus_root", 4, + JH71X0__MUX(JH7100_CLK_CPUNDBUS_ROOT, "cpundbus_root", 0, 4, JH7100_CLK_OSC_SYS, JH7100_CLK_PLL0_OUT, JH7100_CLK_PLL1_OUT, JH7100_CLK_PLL2_OUT), - JH71X0__MUX(JH7100_CLK_DLA_ROOT, "dla_root", 3, + JH71X0__MUX(JH7100_CLK_DLA_ROOT, "dla_root", 0, 3, JH7100_CLK_OSC_SYS, JH7100_CLK_PLL1_OUT, JH7100_CLK_PLL2_OUT), - JH71X0__MUX(JH7100_CLK_DSP_ROOT, "dsp_root", 4, + JH71X0__MUX(JH7100_CLK_DSP_ROOT, "dsp_root", 0, 4, JH7100_CLK_OSC_SYS, JH7100_CLK_PLL0_OUT, JH7100_CLK_PLL1_OUT, JH7100_CLK_PLL2_OUT), - JH71X0__MUX(JH7100_CLK_GMACUSB_ROOT, "gmacusb_root", 3, + JH71X0__MUX(JH7100_CLK_GMACUSB_ROOT, "gmacusb_root", 0, 3, JH7100_CLK_OSC_SYS, JH7100_CLK_PLL0_OUT, JH7100_CLK_PLL2_OUT), - JH71X0__MUX(JH7100_CLK_PERH0_ROOT, "perh0_root", 2, + JH71X0__MUX(JH7100_CLK_PERH0_ROOT, "perh0_root", 0, 2, JH7100_CLK_OSC_SYS, JH7100_CLK_PLL0_OUT), - JH71X0__MUX(JH7100_CLK_PERH1_ROOT, "perh1_root", 2, + JH71X0__MUX(JH7100_CLK_PERH1_ROOT, "perh1_root", 0, 2, JH7100_CLK_OSC_SYS, JH7100_CLK_PLL2_OUT), - JH71X0__MUX(JH7100_CLK_VIN_ROOT, "vin_root", 3, + JH71X0__MUX(JH7100_CLK_VIN_ROOT, "vin_root", 0, 3, JH7100_CLK_OSC_SYS, JH7100_CLK_PLL1_OUT, JH7100_CLK_PLL2_OUT), - JH71X0__MUX(JH7100_CLK_VOUT_ROOT, "vout_root", 3, + JH71X0__MUX(JH7100_CLK_VOUT_ROOT, "vout_root", 0, 3, JH7100_CLK_OSC_AUD, JH7100_CLK_PLL0_OUT, JH7100_CLK_PLL2_OUT), JH71X0_GDIV(JH7100_CLK_AUDIO_ROOT, "audio_root", 0, 8, JH7100_CLK_PLL0_OUT), - JH71X0__MUX(JH7100_CLK_CDECHIFI4_ROOT, "cdechifi4_root", 3, + JH71X0__MUX(JH7100_CLK_CDECHIFI4_ROOT, "cdechifi4_root", 0, 3, JH7100_CLK_OSC_SYS, JH7100_CLK_PLL1_OUT, JH7100_CLK_PLL2_OUT), - JH71X0__MUX(JH7100_CLK_CDEC_ROOT, "cdec_root", 3, + JH71X0__MUX(JH7100_CLK_CDEC_ROOT, "cdec_root", 0, 3, JH7100_CLK_OSC_SYS, JH7100_CLK_PLL0_OUT, JH7100_CLK_PLL1_OUT), - JH71X0__MUX(JH7100_CLK_VOUTBUS_ROOT, "voutbus_root", 3, + JH71X0__MUX(JH7100_CLK_VOUTBUS_ROOT, "voutbus_root", 0, 3, JH7100_CLK_OSC_AUD, JH7100_CLK_PLL0_OUT, JH7100_CLK_PLL2_OUT), @@ -76,7 +76,7 @@ static const struct jh71x0_clk_data jh7100_clk_data[] __initconst = { JH71X0_GDIV(JH7100_CLK_PLL0_TESTOUT, "pll0_testout", 0, 31, JH7100_CLK_PERH0_SRC), JH71X0_GDIV(JH7100_CLK_PLL1_TESTOUT, "pll1_testout", 0, 31, JH7100_CLK_DLA_ROOT), JH71X0_GDIV(JH7100_CLK_PLL2_TESTOUT, "pll2_testout", 0, 31, JH7100_CLK_PERH1_SRC), - JH71X0__MUX(JH7100_CLK_PLL2_REF, "pll2_refclk", 2, + JH71X0__MUX(JH7100_CLK_PLL2_REF, "pll2_refclk", 0, 2, JH7100_CLK_OSC_SYS, JH7100_CLK_OSC_AUD), JH71X0__DIV(JH7100_CLK_CPU_CORE, "cpu_core", 8, JH7100_CLK_CPUNBUS_ROOT_DIV), @@ -142,7 +142,7 @@ static const struct jh71x0_clk_data jh7100_clk_data[] __initconst = { JH71X0__DIV(JH7100_CLK_NOC_COG, "noc_cog", 8, JH7100_CLK_DLA_ROOT), JH71X0_GATE(JH7100_CLK_NNE_AHB, "nne_ahb", 0, JH7100_CLK_AHB_BUS), JH71X0__DIV(JH7100_CLK_NNEBUS_SRC1, "nnebus_src1", 4, JH7100_CLK_DSP_ROOT), - JH71X0__MUX(JH7100_CLK_NNE_BUS, "nne_bus", 2, + JH71X0__MUX(JH7100_CLK_NNE_BUS, "nne_bus", 0, 2, JH7100_CLK_CPU_AXI, JH7100_CLK_NNEBUS_SRC1), JH71X0_GATE(JH7100_CLK_NNE_AXI, "nne_axi", 0, JH7100_CLK_NNE_BUS), @@ -166,7 +166,7 @@ static const struct jh71x0_clk_data jh7100_clk_data[] __initconst = { JH71X0_GDIV(JH7100_CLK_USBPHY_125M, "usbphy_125m", 0, 8, JH7100_CLK_USBPHY_ROOTDIV), JH71X0_GDIV(JH7100_CLK_USBPHY_PLLDIV25M, "usbphy_plldiv25m", 0, 32, JH7100_CLK_USBPHY_ROOTDIV), - JH71X0__MUX(JH7100_CLK_USBPHY_25M, "usbphy_25m", 2, + JH71X0__MUX(JH7100_CLK_USBPHY_25M, "usbphy_25m", 0, 2, JH7100_CLK_OSC_SYS, JH7100_CLK_USBPHY_PLLDIV25M), JH71X0_FDIV(JH7100_CLK_AUDIO_DIV, "audio_div", JH7100_CLK_AUDIO_ROOT), @@ -200,12 +200,12 @@ static const struct jh71x0_clk_data jh7100_clk_data[] __initconst = { JH71X0_GDIV(JH7100_CLK_GMAC_GTX, "gmac_gtxclk", 0, 255, JH7100_CLK_GMAC_ROOT_DIV), JH71X0_GDIV(JH7100_CLK_GMAC_RMII_TX, "gmac_rmii_txclk", 0, 8, JH7100_CLK_GMAC_RMII_REF), JH71X0_GDIV(JH7100_CLK_GMAC_RMII_RX, "gmac_rmii_rxclk", 0, 8, JH7100_CLK_GMAC_RMII_REF), - JH71X0__MUX(JH7100_CLK_GMAC_TX, "gmac_tx", 3, + JH71X0__MUX(JH7100_CLK_GMAC_TX, "gmac_tx", 0, 3, JH7100_CLK_GMAC_GTX, JH7100_CLK_GMAC_TX_INV, JH7100_CLK_GMAC_RMII_TX), JH71X0__INV(JH7100_CLK_GMAC_TX_INV, "gmac_tx_inv", JH7100_CLK_GMAC_TX), - JH71X0__MUX(JH7100_CLK_GMAC_RX_PRE, "gmac_rx_pre", 2, + JH71X0__MUX(JH7100_CLK_GMAC_RX_PRE, "gmac_rx_pre", 0, 2, JH7100_CLK_GMAC_GR_MII_RX, JH7100_CLK_GMAC_RMII_RX), JH71X0__INV(JH7100_CLK_GMAC_RX_INV, "gmac_rx_inv", JH7100_CLK_GMAC_RX_PRE), diff --git a/drivers/clk/starfive/clk-starfive-jh7110-aon.c b/drivers/clk/starfive/clk-starfive-jh7110-aon.c index 62954eb7b50a..418efdad719b 100644 --- a/drivers/clk/starfive/clk-starfive-jh7110-aon.c +++ b/drivers/clk/starfive/clk-starfive-jh7110-aon.c @@ -26,7 +26,7 @@ static const struct jh71x0_clk_data jh7110_aonclk_data[] = { /* source */ JH71X0__DIV(JH7110_AONCLK_OSC_DIV4, "osc_div4", 4, JH7110_AONCLK_OSC), - JH71X0__MUX(JH7110_AONCLK_APB_FUNC, "apb_func", 2, + JH71X0__MUX(JH7110_AONCLK_APB_FUNC, "apb_func", 0, 2, JH7110_AONCLK_OSC_DIV4, JH7110_AONCLK_OSC), /* gmac0 */ @@ -39,7 +39,7 @@ static const struct jh71x0_clk_data jh7110_aonclk_data[] = { JH7110_AONCLK_GMAC0_GTXCLK, JH7110_AONCLK_GMAC0_RMII_RTX), JH71X0__INV(JH7110_AONCLK_GMAC0_TX_INV, "gmac0_tx_inv", JH7110_AONCLK_GMAC0_TX), - JH71X0__MUX(JH7110_AONCLK_GMAC0_RX, "gmac0_rx", 2, + JH71X0__MUX(JH7110_AONCLK_GMAC0_RX, "gmac0_rx", 0, 2, JH7110_AONCLK_GMAC0_RGMII_RXIN, JH7110_AONCLK_GMAC0_RMII_RTX), JH71X0__INV(JH7110_AONCLK_GMAC0_RX_INV, "gmac0_rx_inv", JH7110_AONCLK_GMAC0_RX), @@ -48,7 +48,7 @@ static const struct jh71x0_clk_data jh7110_aonclk_data[] = { /* rtc */ JH71X0_GATE(JH7110_AONCLK_RTC_APB, "rtc_apb", 0, JH7110_AONCLK_APB_BUS), JH71X0__DIV(JH7110_AONCLK_RTC_INTERNAL, "rtc_internal", 1022, JH7110_AONCLK_OSC), - JH71X0__MUX(JH7110_AONCLK_RTC_32K, "rtc_32k", 2, + JH71X0__MUX(JH7110_AONCLK_RTC_32K, "rtc_32k", 0, 2, JH7110_AONCLK_RTC_OSC, JH7110_AONCLK_RTC_INTERNAL), JH71X0_GATE(JH7110_AONCLK_RTC_CAL, "rtc_cal", 0, JH7110_AONCLK_OSC), diff --git a/drivers/clk/starfive/clk-starfive-jh7110-isp.c b/drivers/clk/starfive/clk-starfive-jh7110-isp.c index ce034ed28532..929b8788279e 100644 --- a/drivers/clk/starfive/clk-starfive-jh7110-isp.c +++ b/drivers/clk/starfive/clk-starfive-jh7110-isp.c @@ -53,7 +53,7 @@ static const struct jh71x0_clk_data jh7110_ispclk_data[] = { JH7110_ISPCLK_MIPI_RX0_PXL), JH71X0_GATE(JH7110_ISPCLK_VIN_PIXEL_IF3, "vin_pixel_if3", 0, JH7110_ISPCLK_MIPI_RX0_PXL), - JH71X0__MUX(JH7110_ISPCLK_VIN_P_AXI_WR, "vin_p_axi_wr", 2, + JH71X0__MUX(JH7110_ISPCLK_VIN_P_AXI_WR, "vin_p_axi_wr", 0, 2, JH7110_ISPCLK_MIPI_RX0_PXL, JH7110_ISPCLK_DVP_INV), /* ispv2_top_wrapper */ diff --git a/drivers/clk/starfive/clk-starfive-jh7110-sys.c b/drivers/clk/starfive/clk-starfive-jh7110-sys.c index 3884eff9fe93..8f5e5abfa178 100644 --- a/drivers/clk/starfive/clk-starfive-jh7110-sys.c +++ b/drivers/clk/starfive/clk-starfive-jh7110-sys.c @@ -36,18 +36,18 @@ static const struct jh71x0_clk_data jh7110_sysclk_data[] __initconst = { /* root */ - JH71X0__MUX(JH7110_SYSCLK_CPU_ROOT, "cpu_root", 2, + JH71X0__MUX(JH7110_SYSCLK_CPU_ROOT, "cpu_root", 0, 2, JH7110_SYSCLK_OSC, JH7110_SYSCLK_PLL0_OUT), JH71X0__DIV(JH7110_SYSCLK_CPU_CORE, "cpu_core", 7, JH7110_SYSCLK_CPU_ROOT), JH71X0__DIV(JH7110_SYSCLK_CPU_BUS, "cpu_bus", 2, JH7110_SYSCLK_CPU_CORE), - JH71X0__MUX(JH7110_SYSCLK_GPU_ROOT, "gpu_root", 2, + JH71X0__MUX(JH7110_SYSCLK_GPU_ROOT, "gpu_root", 0, 2, JH7110_SYSCLK_PLL2_OUT, JH7110_SYSCLK_PLL1_OUT), JH71X0_MDIV(JH7110_SYSCLK_PERH_ROOT, "perh_root", 2, 2, JH7110_SYSCLK_PLL0_OUT, JH7110_SYSCLK_PLL2_OUT), - JH71X0__MUX(JH7110_SYSCLK_BUS_ROOT, "bus_root", 2, + JH71X0__MUX(JH7110_SYSCLK_BUS_ROOT, "bus_root", 0, 2, JH7110_SYSCLK_OSC, JH7110_SYSCLK_PLL2_OUT), JH71X0__DIV(JH7110_SYSCLK_NOCSTG_BUS, "nocstg_bus", 3, JH7110_SYSCLK_BUS_ROOT), @@ -62,7 +62,7 @@ static const struct jh71x0_clk_data jh7110_sysclk_data[] __initconst = { JH71X0__DIV(JH7110_SYSCLK_PLL2_DIV2, "pll2_div2", 2, JH7110_SYSCLK_PLL2_OUT), JH71X0__DIV(JH7110_SYSCLK_AUDIO_ROOT, "audio_root", 8, JH7110_SYSCLK_PLL2_OUT), JH71X0__DIV(JH7110_SYSCLK_MCLK_INNER, "mclk_inner", 64, JH7110_SYSCLK_AUDIO_ROOT), - JH71X0__MUX(JH7110_SYSCLK_MCLK, "mclk", 2, + JH71X0__MUX(JH7110_SYSCLK_MCLK, "mclk", 0, 2, JH7110_SYSCLK_MCLK_INNER, JH7110_SYSCLK_MCLK_EXT), JH71X0_GATE(JH7110_SYSCLK_MCLK_OUT, "mclk_out", 0, JH7110_SYSCLK_MCLK_INNER), @@ -96,7 +96,7 @@ static const struct jh71x0_clk_data jh7110_sysclk_data[] __initconst = { JH71X0__DIV(JH7110_SYSCLK_OSC_DIV2, "osc_div2", 2, JH7110_SYSCLK_OSC), JH71X0__DIV(JH7110_SYSCLK_PLL1_DIV4, "pll1_div4", 2, JH7110_SYSCLK_PLL1_DIV2), JH71X0__DIV(JH7110_SYSCLK_PLL1_DIV8, "pll1_div8", 2, JH7110_SYSCLK_PLL1_DIV4), - JH71X0__MUX(JH7110_SYSCLK_DDR_BUS, "ddr_bus", 4, + JH71X0__MUX(JH7110_SYSCLK_DDR_BUS, "ddr_bus", 0, 4, JH7110_SYSCLK_OSC_DIV2, JH7110_SYSCLK_PLL1_DIV2, JH7110_SYSCLK_PLL1_DIV4, @@ -186,7 +186,7 @@ static const struct jh71x0_clk_data jh7110_sysclk_data[] __initconst = { JH71X0__DIV(JH7110_SYSCLK_GMAC1_RMII_RTX, "gmac1_rmii_rtx", 30, JH7110_SYSCLK_GMAC1_RMII_REFIN), JH71X0_GDIV(JH7110_SYSCLK_GMAC1_PTP, "gmac1_ptp", 0, 31, JH7110_SYSCLK_GMAC_SRC), - JH71X0__MUX(JH7110_SYSCLK_GMAC1_RX, "gmac1_rx", 2, + JH71X0__MUX(JH7110_SYSCLK_GMAC1_RX, "gmac1_rx", 0, 2, JH7110_SYSCLK_GMAC1_RGMII_RXIN, JH7110_SYSCLK_GMAC1_RMII_RTX), JH71X0__INV(JH7110_SYSCLK_GMAC1_RX_INV, "gmac1_rx_inv", JH7110_SYSCLK_GMAC1_RX), @@ -270,11 +270,11 @@ static const struct jh71x0_clk_data jh7110_sysclk_data[] __initconst = { JH71X0_MDIV(JH7110_SYSCLK_I2STX0_LRCK_MST, "i2stx0_lrck_mst", 64, 2, JH7110_SYSCLK_I2STX0_BCLK_MST_INV, JH7110_SYSCLK_I2STX0_BCLK_MST), - JH71X0__MUX(JH7110_SYSCLK_I2STX0_BCLK, "i2stx0_bclk", 2, + JH71X0__MUX(JH7110_SYSCLK_I2STX0_BCLK, "i2stx0_bclk", 0, 2, JH7110_SYSCLK_I2STX0_BCLK_MST, JH7110_SYSCLK_I2STX_BCLK_EXT), JH71X0__INV(JH7110_SYSCLK_I2STX0_BCLK_INV, "i2stx0_bclk_inv", JH7110_SYSCLK_I2STX0_BCLK), - JH71X0__MUX(JH7110_SYSCLK_I2STX0_LRCK, "i2stx0_lrck", 2, + JH71X0__MUX(JH7110_SYSCLK_I2STX0_LRCK, "i2stx0_lrck", 0, 2, JH7110_SYSCLK_I2STX0_LRCK_MST, JH7110_SYSCLK_I2STX_LRCK_EXT), /* i2stx1 */ @@ -285,11 +285,11 @@ static const struct jh71x0_clk_data jh7110_sysclk_data[] __initconst = { JH71X0_MDIV(JH7110_SYSCLK_I2STX1_LRCK_MST, "i2stx1_lrck_mst", 64, 2, JH7110_SYSCLK_I2STX1_BCLK_MST_INV, JH7110_SYSCLK_I2STX1_BCLK_MST), - JH71X0__MUX(JH7110_SYSCLK_I2STX1_BCLK, "i2stx1_bclk", 2, + JH71X0__MUX(JH7110_SYSCLK_I2STX1_BCLK, "i2stx1_bclk", 0, 2, JH7110_SYSCLK_I2STX1_BCLK_MST, JH7110_SYSCLK_I2STX_BCLK_EXT), JH71X0__INV(JH7110_SYSCLK_I2STX1_BCLK_INV, "i2stx1_bclk_inv", JH7110_SYSCLK_I2STX1_BCLK), - JH71X0__MUX(JH7110_SYSCLK_I2STX1_LRCK, "i2stx1_lrck", 2, + JH71X0__MUX(JH7110_SYSCLK_I2STX1_LRCK, "i2stx1_lrck", 0, 2, JH7110_SYSCLK_I2STX1_LRCK_MST, JH7110_SYSCLK_I2STX_LRCK_EXT), /* i2srx */ @@ -300,11 +300,11 @@ static const struct jh71x0_clk_data jh7110_sysclk_data[] __initconst = { JH71X0_MDIV(JH7110_SYSCLK_I2SRX_LRCK_MST, "i2srx_lrck_mst", 64, 2, JH7110_SYSCLK_I2SRX_BCLK_MST_INV, JH7110_SYSCLK_I2SRX_BCLK_MST), - JH71X0__MUX(JH7110_SYSCLK_I2SRX_BCLK, "i2srx_bclk", 2, + JH71X0__MUX(JH7110_SYSCLK_I2SRX_BCLK, "i2srx_bclk", 0, 2, JH7110_SYSCLK_I2SRX_BCLK_MST, JH7110_SYSCLK_I2SRX_BCLK_EXT), JH71X0__INV(JH7110_SYSCLK_I2SRX_BCLK_INV, "i2srx_bclk_inv", JH7110_SYSCLK_I2SRX_BCLK), - JH71X0__MUX(JH7110_SYSCLK_I2SRX_LRCK, "i2srx_lrck", 2, + JH71X0__MUX(JH7110_SYSCLK_I2SRX_LRCK, "i2srx_lrck", 0, 2, JH7110_SYSCLK_I2SRX_LRCK_MST, JH7110_SYSCLK_I2SRX_LRCK_EXT), /* pdm */ @@ -314,7 +314,7 @@ static const struct jh71x0_clk_data jh7110_sysclk_data[] __initconst = { JH71X0_GATE(JH7110_SYSCLK_TDM_AHB, "tdm_ahb", 0, JH7110_SYSCLK_AHB0), JH71X0_GATE(JH7110_SYSCLK_TDM_APB, "tdm_apb", 0, JH7110_SYSCLK_APB0), JH71X0_GDIV(JH7110_SYSCLK_TDM_INTERNAL, "tdm_internal", 0, 64, JH7110_SYSCLK_MCLK), - JH71X0__MUX(JH7110_SYSCLK_TDM_TDM, "tdm_tdm", 2, + JH71X0__MUX(JH7110_SYSCLK_TDM_TDM, "tdm_tdm", 0, 2, JH7110_SYSCLK_TDM_INTERNAL, JH7110_SYSCLK_TDM_EXT), JH71X0__INV(JH7110_SYSCLK_TDM_TDM_INV, "tdm_tdm_inv", JH7110_SYSCLK_TDM_TDM), diff --git a/drivers/clk/starfive/clk-starfive-jh71x0.h b/drivers/clk/starfive/clk-starfive-jh71x0.h index 34bb11c72eb7..23e052fc1549 100644 --- a/drivers/clk/starfive/clk-starfive-jh71x0.h +++ b/drivers/clk/starfive/clk-starfive-jh71x0.h @@ -61,10 +61,10 @@ struct jh71x0_clk_data { .parents = { [0] = _parent }, \ } -#define JH71X0__MUX(_idx, _name, _nparents, ...) \ +#define JH71X0__MUX(_idx, _name, _flags, _nparents, ...) \ [_idx] = { \ .name = _name, \ - .flags = 0, \ + .flags = _flags, \ .max = ((_nparents) - 1) << JH71X0_CLK_MUX_SHIFT, \ .parents = { __VA_ARGS__ }, \ } From patchwork Mon Dec 18 21:44:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 180664 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp1552823dyi; Mon, 18 Dec 2023 13:48:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IH62N5hD0k0aHs3MBkaTnHgA4ndJKXNLV4bSMnajnjJFw50PBJfb9kK3stSekHvaXDvl2Dc X-Received: by 2002:a17:907:3f22:b0:9fe:ebb:b2b8 with SMTP id hq34-20020a1709073f2200b009fe0ebbb2b8mr9244199ejc.68.1702936126722; Mon, 18 Dec 2023 13:48:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702936126; cv=none; d=google.com; s=arc-20160816; b=kQoWEIIU1QGMKzxqGmMz9aBgh4bJvkjOY//va0DGewOD8Mzt/fo1fq8ksYC47ANluq /mcVZIxeZBUSPOqMOTqM66H4b34aBEzsKzGq8OnpNOXpKDcLvBOCQbSsqgYsfC8OBHZl ju14j0tRIVlmuS3RPDdIyzoyQ/u8ZLh4tdRjoOChjH/1QKPLi3XaBi8pIfHZaxMjFNH3 5Hwx9rc8XvCfXmAJRdodb0a+2dyXWmNtjQlN9RGwQvjJ210TdgbQ+Lbpizugu7y0I4hR QOhywPAAxSJlPwV1rnEAN1mvLmaX1lEFRIq8P1mSBdjhvxqR0G88D+tkr5BWjMugnatT 22+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=LGxa/WoR79fxWz3vCy29mzDJ5NYaASn4F70rKhT5UBU=; fh=MOJyzNMsFAJQqEQehvdnrwT/huG78rLnZqS8spAjFqo=; b=iNtXTnPLJVrG4QjNGOIf8ikTkWVA7pHyMVDZhSDogfqiDV8c+P4lTdgnm2K2HL0CTy NB3650GKkXqwfvd6nQej+pG7cfZUf8GShwAc0QdRPwGnvjsoXKRnEas2yFh5ksHdehYN IqYZMJm/tbogAPYKHZB5ekYu6NPVs5rrpGbhNNZJ84N2JrdZKK1YuIW5KFsF9KBE1MdQ wNZenLTpHF6fh2lkPIbxolKMtu2StkXATsIx2Wcc3JwdEKlSb+ORkt/QGrGv/S/8fGZl qE4g0EesQ2nIwP+4xrFj01KjyF/ppnY3qx3BFnd2RWRlcD3oVmaBGt+Js/xcWweNpQbK WjaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=o2FDqXiN; spf=pass (google.com: domain of linux-kernel+bounces-4423-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4423-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id qh25-20020a170906ecb900b00a235fc5744esi853665ejb.481.2023.12.18.13.48.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Dec 2023 13:48:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-4423-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=o2FDqXiN; spf=pass (google.com: domain of linux-kernel+bounces-4423-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4423-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 583851F26181 for ; Mon, 18 Dec 2023 21:48:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2A1547E57D; Mon, 18 Dec 2023 21:45:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="o2FDqXiN" X-Original-To: linux-kernel@vger.kernel.org Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 006DA7C645; Mon, 18 Dec 2023 21:45:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1702935903; bh=PX9WR1wsK5Wtdc1EF8E/KGnEO4lLD+GneTrUOqNm76c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=o2FDqXiNcCLgRFLH5qXcvMq2L1svg6g+4RfB6S3dIApGqILH0GwNj0NiXlz8iPutr geetWUt63bwQm91x8TyEmvlUh0T/PaqEddJRgiJYx5sbplzUT1T1za7+AGId3t2qKt V1gA9RmLAJ8S+OBauEmtxJBVuKgi1ddHCEjSwN4mNF84mBQx9LJAq3JVIi3eYLZh0j IoyY+9+Z7Zh37qJXhYZuOxKBl64KAsR++zRBXOf/8bDh6/O8/1llN5K3QU01Awdg/V TO4Kvjp1DcCxG2+q3yRTSufKxsDmLzB4I1HiHcI9lPtrLnQ80x0Za4EUiVCm8bdK9R 6zDcFd2WpG5hA== Received: from localhost (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 5A6753781495; Mon, 18 Dec 2023 21:45:03 +0000 (UTC) From: Cristian Ciocaltea To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Emil Renner Berthing , Samin Guo , Paul Walmsley , Palmer Dabbelt , Albert Ou , Hal Feng , Michael Turquette , Stephen Boyd , Alexandre Torgue , Jose Abreu , Maxime Coquelin , Richard Cochran , Giuseppe Cavallaro Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, linux-clk@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, kernel@collabora.com, Emil Renner Berthing Subject: [PATCH v4 9/9] clk: starfive: jh7100: Add CLK_SET_RATE_PARENT to gmac_tx Date: Mon, 18 Dec 2023 23:44:49 +0200 Message-ID: <20231218214451.2345691-10-cristian.ciocaltea@collabora.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231218214451.2345691-1-cristian.ciocaltea@collabora.com> References: <20231218214451.2345691-1-cristian.ciocaltea@collabora.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785657952254703657 X-GMAIL-MSGID: 1785657952254703657 From: Emil Renner Berthing This is needed by the dwmac-starfive ethernet driver to set the clock for 1000, 100 and 10 Mbps links properly. Signed-off-by: Emil Renner Berthing Signed-off-by: Cristian Ciocaltea --- drivers/clk/starfive/clk-starfive-jh7100.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clk/starfive/clk-starfive-jh7100.c b/drivers/clk/starfive/clk-starfive-jh7100.c index d3b260c01d5c..03f6f26a15d8 100644 --- a/drivers/clk/starfive/clk-starfive-jh7100.c +++ b/drivers/clk/starfive/clk-starfive-jh7100.c @@ -200,7 +200,7 @@ static const struct jh71x0_clk_data jh7100_clk_data[] __initconst = { JH71X0_GDIV(JH7100_CLK_GMAC_GTX, "gmac_gtxclk", 0, 255, JH7100_CLK_GMAC_ROOT_DIV), JH71X0_GDIV(JH7100_CLK_GMAC_RMII_TX, "gmac_rmii_txclk", 0, 8, JH7100_CLK_GMAC_RMII_REF), JH71X0_GDIV(JH7100_CLK_GMAC_RMII_RX, "gmac_rmii_rxclk", 0, 8, JH7100_CLK_GMAC_RMII_REF), - JH71X0__MUX(JH7100_CLK_GMAC_TX, "gmac_tx", 0, 3, + JH71X0__MUX(JH7100_CLK_GMAC_TX, "gmac_tx", CLK_SET_RATE_PARENT | CLK_SET_RATE_NO_REPARENT, 3, JH7100_CLK_GMAC_GTX, JH7100_CLK_GMAC_TX_INV, JH7100_CLK_GMAC_RMII_TX),