Message ID | 20230413182345.92557-3-sebastian.reichel@collabora.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1244177vqo; Thu, 13 Apr 2023 11:41:23 -0700 (PDT) X-Google-Smtp-Source: AKy350aD83zY3WCvVaAykTvwwIijTCg36vqiYv5C6sWjuFla/N50EdAP4FdtTuf0pwXe7xElHnJF X-Received: by 2002:a17:90b:c15:b0:246:85ec:d816 with SMTP id bp21-20020a17090b0c1500b0024685ecd816mr2954740pjb.3.1681411283568; Thu, 13 Apr 2023 11:41:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681411283; cv=none; d=google.com; s=arc-20160816; b=reC765yw3V2Fm3vtiE5xNMIcGdykITM5T4c8vu7LFFz/ahHJC/QM73IKQk33Uqf+1e RLsf2nowCiKUh33jnEXZYMFZzuIf/exM6N4lvy9JSqPd96079Q7JHNUe4YCOgkkPVNgc wlczy3L45CDOOijkdoT3i6ldUGpyjbU3J/VBb10o7Q8URW+jpqJt/0FPE7iU91LrgIcu kpnwR1YBaFrHsyl4TpdVFfKi3lmflTxe0mH23aOUZZS+S8KnjCVXmxbijNZYke0t1uQO Vo2gVsiEJ3PwuEndpZMk2eM2yOcckiDxJH6pzdZyhN1z9iHheRX8huwN1CMMkymEBDbo JLwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ommqNHLCt9kjT3gX5Fwx7F4cPu1jqcszROCbSFMhIz0=; b=aaSTvw/d5/gb9JCvBNt7m12ggE093l7os81CGG1vq+1OAuz5A5zc8hknryYddTTcTH 046sGRVLcR0kDtWp2A/iQJIyT10gBtaxtUtUsYxMPBzmbNJUZ7icAv1kC8G0/Bqmwpnd lOAc6uGOPxYQZZ5pc2jRzueJ3e3xCmkQWcm0e7XjhDh8Aaf0AEPLExHOwIU4Z0jE/aKd OmSd4QqIQ3klP7nMsYUW4phX5l0gh2hZZvt5McB97sFVpyo+zbuX9MFuy//cFuXImbYX tuvBKk/DfnpxyebFPDAadyvgOUA21ub4dg3ybJ/KtNIzamSBljsJrMLqOFJPMOq9rWnj /7+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=BLL+poNl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q15-20020a170902dacf00b001a179169d6bsi2909744plx.610.2023.04.13.11.41.10; Thu, 13 Apr 2023 11:41:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=BLL+poNl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229815AbjDMSXz (ORCPT <rfc822;peter110.wang@gmail.com> + 99 others); Thu, 13 Apr 2023 14:23:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49326 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229479AbjDMSXx (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 13 Apr 2023 14:23:53 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E45BD59FF; Thu, 13 Apr 2023 11:23:52 -0700 (PDT) Received: from jupiter.universe (dyndsl-091-248-212-251.ewe-ip-backbone.de [91.248.212.251]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: sre) by madras.collabora.co.uk (Postfix) with ESMTPSA id 57910660321D; Thu, 13 Apr 2023 19:23:51 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1681410231; bh=KE/Qh2dz/391cip/CPeIBTyPxaiySIGR7XU//jF9HQ0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BLL+poNly6f3IBlk3AcHxjpOJ8gIQE2cGE4I6Xg1ZFICMpx1DyZUTlpHA+IUtO4hJ kCZbWdMjfXNjAgcx/JbDOatnmGbyWSZXPW5qG54p7HUJHRqE4deVIBld/FouDB2Ki0 M0uO0E06O/+8f+ROutsz3y42AeShpdj/HORVnBWjn/5K9k91zRQ/TC//tvP8w11COD HKG7PivvGp93lzC9lqw6xk+mIOIX7gaIG1/yBJQ3XVUWflmgBdxsASaN2clW4zfaq3 sxyPYMDcFM80u21UXU2UzLqLucuLRXRoCz2siDHI/1q5EvtMuOCp9dd4xROp6dRgGK 68pN6ewd0rHMA== Received: by jupiter.universe (Postfix, from userid 1000) id 8CA424807EF; Thu, 13 Apr 2023 20:23:48 +0200 (CEST) From: Sebastian Reichel <sebastian.reichel@collabora.com> To: Heiko Stuebner <heiko@sntech.de> Cc: Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Damien Le Moal <damien.lemoal@opensource.wdc.com>, Serge Semin <fancer.lancer@gmail.com>, Vinod Koul <vkoul@kernel.org>, Kishon Vijay Abraham I <kishon@kernel.org>, linux-ide@vger.kernel.org, linux-phy@lists.infradead.org, linux-rockchip@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Sebastian Reichel <sebastian.reichel@collabora.com>, kernel@collabora.com Subject: [PATCHv1 2/5] dt-bindings: ata: ahci: add RK3588 AHCI controller Date: Thu, 13 Apr 2023 20:23:42 +0200 Message-Id: <20230413182345.92557-3-sebastian.reichel@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230413182345.92557-1-sebastian.reichel@collabora.com> References: <20230413182345.92557-1-sebastian.reichel@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763087517972850821?= X-GMAIL-MSGID: =?utf-8?q?1763087517972850821?= |
Series |
Add RK3588 SATA support
|
|
Commit Message
Sebastian Reichel
April 13, 2023, 6:23 p.m. UTC
Just like RK3568, the RK3588 has a DWC based AHCI controller.
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
---
FWIW IDK what exactly the ASIC clock is. The TRM does not provide any
details unfortunately. It is required for functional SATA, though.
---
.../devicetree/bindings/ata/snps,dwc-ahci-common.yaml | 6 ++++--
Documentation/devicetree/bindings/ata/snps,dwc-ahci.yaml | 6 ++++--
2 files changed, 8 insertions(+), 4 deletions(-)
Comments
On 4/14/23 03:23, Sebastian Reichel wrote: > Just like RK3568, the RK3588 has a DWC based AHCI controller. > > Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com> > --- > FWIW IDK what exactly the ASIC clock is. The TRM does not provide any > details unfortunately. It is required for functional SATA, though. > --- > .../devicetree/bindings/ata/snps,dwc-ahci-common.yaml | 6 ++++-- > Documentation/devicetree/bindings/ata/snps,dwc-ahci.yaml | 6 ++++-- > 2 files changed, 8 insertions(+), 4 deletions(-) > > diff --git a/Documentation/devicetree/bindings/ata/snps,dwc-ahci-common.yaml b/Documentation/devicetree/bindings/ata/snps,dwc-ahci-common.yaml > index c1457910520b..0df8f49431eb 100644 > --- a/Documentation/devicetree/bindings/ata/snps,dwc-ahci-common.yaml > +++ b/Documentation/devicetree/bindings/ata/snps,dwc-ahci-common.yaml > @@ -31,11 +31,11 @@ properties: > PM-alive clock, RxOOB detection clock, embedded PHYs reference (Rx/Tx) > clock, etc. > minItems: 1 > - maxItems: 4 > + maxItems: 5 > > clock-names: > minItems: 1 > - maxItems: 4 > + maxItems: 5 > items: > oneOf: > - description: Application APB/AHB/AXI BIU clock > @@ -50,6 +50,8 @@ properties: > const: rxoob > - description: SATA Ports reference clock > const: ref > + - description: Rockchip ASIC clock Shouldn't this mention that this clock is for the 3588 only ? Or is it also necessary for the 3568 ? That is not super clear. > + const: asic > > resets: > description: > diff --git a/Documentation/devicetree/bindings/ata/snps,dwc-ahci.yaml b/Documentation/devicetree/bindings/ata/snps,dwc-ahci.yaml > index 5afa4b57ce20..c6a0d6c8b62c 100644 > --- a/Documentation/devicetree/bindings/ata/snps,dwc-ahci.yaml > +++ b/Documentation/devicetree/bindings/ata/snps,dwc-ahci.yaml > @@ -23,9 +23,11 @@ properties: > const: snps,dwc-ahci > - description: SPEAr1340 AHCI SATA device > const: snps,spear-ahci > - - description: Rockhip RK3568 AHCI controller > + - description: Rockhip AHCI controller > items: > - - const: rockchip,rk3568-dwc-ahci > + - enum: > + - rockchip,rk3568-dwc-ahci > + - rockchip,rk3588-dwc-ahci > - const: snps,dwc-ahci > > patternProperties:
Hi Sebastian On Thu, Apr 13, 2023 at 08:23:42PM +0200, Sebastian Reichel wrote: > Just like RK3568, the RK3588 has a DWC based AHCI controller. > > Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com> > --- > FWIW IDK what exactly the ASIC clock is. The TRM does not provide any > details unfortunately. It is required for functional SATA, though. > --- > .../devicetree/bindings/ata/snps,dwc-ahci-common.yaml | 6 ++++-- > Documentation/devicetree/bindings/ata/snps,dwc-ahci.yaml | 6 ++++-- > 2 files changed, 8 insertions(+), 4 deletions(-) > > diff --git a/Documentation/devicetree/bindings/ata/snps,dwc-ahci-common.yaml b/Documentation/devicetree/bindings/ata/snps,dwc-ahci-common.yaml > index c1457910520b..0df8f49431eb 100644 > --- a/Documentation/devicetree/bindings/ata/snps,dwc-ahci-common.yaml > +++ b/Documentation/devicetree/bindings/ata/snps,dwc-ahci-common.yaml > @@ -31,11 +31,11 @@ properties: > PM-alive clock, RxOOB detection clock, embedded PHYs reference (Rx/Tx) > clock, etc. > minItems: 1 > - maxItems: 4 > + maxItems: 5 > > clock-names: > minItems: 1 > - maxItems: 4 > + maxItems: 5 > items: > oneOf: > - description: Application APB/AHB/AXI BIU clock > @@ -50,6 +50,8 @@ properties: > const: rxoob > - description: SATA Ports reference clock > const: ref > + - description: Rockchip ASIC clock > + const: asic Actually it's a standard DW SATA AHCI PHY-interface clock (named as clk_asicN in the DW SATA AHCI HW manual). So feel free to add it to the clock-names array with the description (taken from the manual): "PHY Transmit Clock". The manual also says that the clock is generated by the PHY0 for clocking Port0 Link and Transport Layers (TX clock domain): 37.5 MHz, 75 MHz, 150 MHz, 300 MHz, or 600 MHz. Similarly there is another clocks source "clk_rbcN". It's "PHY Receive Clock" which is used to receive data from the PHYn. It can be also added to the clock-names property under the name "rbc". Note 1. Please add the suggested names to the property constraint above the "ref" name definition. The later clock is mainly relevant to the attached PHY rather than to the SATA AHCI controller itself. Note 2. "rxoob", "asic" and "rbc" clocks are defined as "clk_rxoobN", "clk_asicN" and "clk_rbcN" which means they are supposed to be defined (if relevant) for each available SATA port. So in general they should have been defined in the port sub-nodes clocks/clock-names properties. Note 3. Note natively DW SATA AHCI doesn't have any PIPE interface (or anything being called as PIPE). Instead it provides a PMA-interface which is directly connected to a Synopsys SATA xG PHY with no intermediate coders (PCS). Like this: +---------+ +--------+ | | PMA | Snps DW| SATA | DW SATA |<--->| SATA xG|<----> | AHCI | I/F | PHY | | | | | +---------+ +--------+ In that case the DW SATA AHCI IP-core is supposed to be synthesized with the particular Synopsys PHY type specified in the parameter PHY_INTERFACE_TYPE. If a non-standard PHY is connected (like in your case) PHY_INTERFACE_TYPE is supposed to be set to zero thus providing a wide set of the PMA-interface configs which otherwise would have been pre-defined with the Synopsys PHY-specific values. So judging by the clock names in your patches and the way the DT-nodes are designed Rockchip SATA AHCI controller diagram must be looking like this: +---------+ +-------+ +--------+ | | PIPE | some | Rx/Tx | PMA/PMD| SATA | DW SATA |<---->| PCS |<----->| NANEng |<----> | AHCI |former| | | PHY | | |DW PMA| | | | +---------+ +-------+ +--------+ In the former case (DW SATA AHCI with Synopsys SATA xG PHY attached) all the clocks "pmalive", "rbc", "asic" and "rxoob" are generated by the Synopsys PHYs itself so there is no need in having them explicitly defined in the system. In your case AFAICS a non-standard PCS+PHY setup is utilized and the clocks are generated by a system-wide unit - CRU. > > resets: > description: > diff --git a/Documentation/devicetree/bindings/ata/snps,dwc-ahci.yaml b/Documentation/devicetree/bindings/ata/snps,dwc-ahci.yaml > index 5afa4b57ce20..c6a0d6c8b62c 100644 > --- a/Documentation/devicetree/bindings/ata/snps,dwc-ahci.yaml > +++ b/Documentation/devicetree/bindings/ata/snps,dwc-ahci.yaml > @@ -23,9 +23,11 @@ properties: > const: snps,dwc-ahci > - description: SPEAr1340 AHCI SATA device > const: snps,spear-ahci > - - description: Rockhip RK3568 AHCI controller > + - description: Rockhip AHCI controller > items: > - - const: rockchip,rk3568-dwc-ahci > + - enum: > + - rockchip,rk3568-dwc-ahci > + - rockchip,rk3588-dwc-ahci > - const: snps,dwc-ahci What about moving all that in a dedicated YAML-file in order to define a more comprehensive schema with actual "clocks", "clock-names", ports-specific properties constraints? (see the way it's done for Baikal-T1 SATA AHCI in ata/baikal,bt1-ahci.yaml). Please note in that case you'll either need to drop the generic fallback compatible (it's not like it would have been much useful anyway) from your and RK3568 SATA DT-nodes, or define the "select: properties: compatible: ..." property in the generic DW SATA AHCI DT-schema, in order to prevent the generic schema being automatically applied to the your SATA DT-nodes. -Serge(y) > > patternProperties: > -- > 2.39.2 >
diff --git a/Documentation/devicetree/bindings/ata/snps,dwc-ahci-common.yaml b/Documentation/devicetree/bindings/ata/snps,dwc-ahci-common.yaml index c1457910520b..0df8f49431eb 100644 --- a/Documentation/devicetree/bindings/ata/snps,dwc-ahci-common.yaml +++ b/Documentation/devicetree/bindings/ata/snps,dwc-ahci-common.yaml @@ -31,11 +31,11 @@ properties: PM-alive clock, RxOOB detection clock, embedded PHYs reference (Rx/Tx) clock, etc. minItems: 1 - maxItems: 4 + maxItems: 5 clock-names: minItems: 1 - maxItems: 4 + maxItems: 5 items: oneOf: - description: Application APB/AHB/AXI BIU clock @@ -50,6 +50,8 @@ properties: const: rxoob - description: SATA Ports reference clock const: ref + - description: Rockchip ASIC clock + const: asic resets: description: diff --git a/Documentation/devicetree/bindings/ata/snps,dwc-ahci.yaml b/Documentation/devicetree/bindings/ata/snps,dwc-ahci.yaml index 5afa4b57ce20..c6a0d6c8b62c 100644 --- a/Documentation/devicetree/bindings/ata/snps,dwc-ahci.yaml +++ b/Documentation/devicetree/bindings/ata/snps,dwc-ahci.yaml @@ -23,9 +23,11 @@ properties: const: snps,dwc-ahci - description: SPEAr1340 AHCI SATA device const: snps,spear-ahci - - description: Rockhip RK3568 AHCI controller + - description: Rockhip AHCI controller items: - - const: rockchip,rk3568-dwc-ahci + - enum: + - rockchip,rk3568-dwc-ahci + - rockchip,rk3588-dwc-ahci - const: snps,dwc-ahci patternProperties: