Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp903614iog; Wed, 15 Jun 2022 15:14:50 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tCFdMaBxTIDGmaoDjVzjjWeVmxQHPLj7nYYq+a3et7piDS51JPhNlmqerIatNPfvl3Bq5K X-Received: by 2002:a17:902:eac6:b0:168:da4b:61e8 with SMTP id p6-20020a170902eac600b00168da4b61e8mr1621819pld.109.1655331289833; Wed, 15 Jun 2022 15:14:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655331289; cv=none; d=google.com; s=arc-20160816; b=Hw7z69/ZNbrpUCq1vqA36RLsFlpAPOE9s/kBEW0vWkszLKzaRr9GBkMSUijcLulxS1 z9BO0Av0Pi80AL9ugZHFJ5Xps3I+7tTrrkFpI3ngkuVjAlmlJHr6ZX+FtNHsMg9ciRyC vkUkwauFe+D/8RwkPIHpkkoBl8nYr874Hv3inxMFUvcz0B3fdMkU28odZ/njT4oEui6z W7K0yWS5qXafm2CpXwCCOvfLxNc8augZ66IWleHxWqBLlg7VZvsEy5/dSa2GmDaPvp5u V8kIp3GC5zyDmo4GH020KRPusiCOA78wNP+Dwz/FRAzgiY6AdCrmQKzQWi0wW+PUFgGi Ujqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=fj3idR9ITxtyBkLb8C2yMHLKLG7IMAyqge6auz8Xoso=; b=q8cj3XVCPvuwb4liYEMhlxXDBsPrlEq0SN9xhf0MIMETfw1unsAfwQVyhwoWGaX+Mf Kk/lEakE1pnSTKnfkz0tUnu08ZhSXlJztdv9KCv7VPyqkauCbts0L6qEKl9nR+lyi0fH k13al9kkJkZhevgLys8yewN0wdEe6T5bHg1BWYCGRcbbvNEf08+2kgQilzwbc3UgyFBJ n4shTIW6X9JvzySNfOQtuVzFm0EOHhbX09nNLGm4FzfByfDsMAi3BHqH0lriBZWF0pk2 8Jz5yAgOPW9FGqRBlaalmmku57Z9X2ajXIpnv/f7i2LFUeo7gggvlJxzGe+2nvrDhGSg f3pA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=geZQgQBf; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z22-20020a656116000000b00401afc354e7si207495pgu.606.2022.06.15.15.14.37; Wed, 15 Jun 2022 15:14:49 -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=@gmail.com header.s=20210112 header.b=geZQgQBf; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348865AbiFOV4j (ORCPT + 99 others); Wed, 15 Jun 2022 17:56:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47290 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346441AbiFOV4g (ORCPT ); Wed, 15 Jun 2022 17:56:36 -0400 Received: from mail-lj1-x22f.google.com (mail-lj1-x22f.google.com [IPv6:2a00:1450:4864:20::22f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 755A244A3A; Wed, 15 Jun 2022 14:56:32 -0700 (PDT) Received: by mail-lj1-x22f.google.com with SMTP id h23so14780985ljl.3; Wed, 15 Jun 2022 14:56:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=fj3idR9ITxtyBkLb8C2yMHLKLG7IMAyqge6auz8Xoso=; b=geZQgQBfPs0gt1EhAThZmGnVf/B3qlss07EEfs+bWEivxL+jVVax1x5tGlhx01mFYw DbKXjki82pi2wpCiZI+fzhyvX/0mfO7O01D1Qo0d30opmIYIiyRlN3lD4YEz/2wKN4N2 g6nCcz1iKJXIMmgAazAi8u7IQZaZi3Fd8hbp8n0C2QnAcdXxPHdVpd4+Tw3P1HCyN8NK 4hgwx6/fkgc3JYyTW6RuaxBsZET5mbscooRHtEIfkEuLppcEdcSRcaJ9OeKoW8kkAW3v 3xhbgd39xeFzTnlX5YN5eonge/RAqdoy4ToKN+fiJfs06Hi+kAhg84bFRnHnuE2zwfW1 4J6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=fj3idR9ITxtyBkLb8C2yMHLKLG7IMAyqge6auz8Xoso=; b=eXSn6lx13dW59tiWuYkqg1GB5Wzq2msQj5GU0fATLfyHIuqOIYpb21BjqAtEbWg6w3 zv94r64VxEPoK+DZPcVdEsbrjEMSSxwC1bgkGq5Ilf2KrxXIS+m+rerwm5BCGfTXcnuX dCTg450gLrxNmUM5XQT82NfLtCXz1cJXz5yJgyyrCVEb6IbNM+DM2Jsa3A8RCD1a7BPa wCHXoGcUIfhLcN6QeFF8uaoeZ0kdaPfGZp59yDryzXDLhdN+Rlr1qxARyAdTJ8///3sG 0pK+bgQZTZGn5tDO1hu2GMX0cR3IU0zoMIZ1Bb7iUK/gDI/LUyZtnfvYrSbvPCJi7/mZ cQCQ== X-Gm-Message-State: AJIora8bpLUVNoOlqB678vRcA7l9wn7QcWEQRsaKVimoVZb68gxJp4v3 jOyvuQABxz2oejKfzeUs2fQ= X-Received: by 2002:a2e:508:0:b0:255:66fb:9fce with SMTP id 8-20020a2e0508000000b0025566fb9fcemr950322ljf.171.1655330190775; Wed, 15 Jun 2022 14:56:30 -0700 (PDT) Received: from mobilestation ([95.79.189.214]) by smtp.gmail.com with ESMTPSA id b13-20020a2eb90d000000b0025587b872cesm2516ljb.70.2022.06.15.14.56.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jun 2022 14:56:30 -0700 (PDT) Date: Thu, 16 Jun 2022 00:56:28 +0300 From: Serge Semin To: Rob Herring Cc: Serge Semin , Damien Le Moal , Hans de Goede , Jens Axboe , Hannes Reinecke , Krzysztof Kozlowski , Alexey Malahov , Pavel Parkhomenko , linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Subject: Re: [PATCH v4 11/23] dt-bindings: ata: ahci: Add platform capability properties Message-ID: <20220615215628.m5pgnys7acmkhslg@mobilestation> References: <20220610081801.11854-1-Sergey.Semin@baikalelectronics.ru> <20220610081801.11854-12-Sergey.Semin@baikalelectronics.ru> <20220614221917.GA2824584-robh@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220614221917.GA2824584-robh@kernel.org> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 14, 2022 at 04:19:17PM -0600, Rob Herring wrote: > On Fri, Jun 10, 2022 at 11:17:49AM +0300, Serge Semin wrote: > > In case if the platform doesn't have BIOS or a comprehensive firmware > > installed then the HBA capability flags will be left uninitialized. As a > > good alternative we suggest to define the DT-properties with the AHCI > > platform capabilities describing all the HW-init flags of the > > corresponding capability register. Luckily there aren't too many of them. > > SSS - Staggered Spin-up support and MPS - Mechanical Presence Switch > > support determine the corresponding feature availability for the whole HBA > > by means of the "hba-cap" property. Each port can have the "hba-port-cap" > > property initialized indicating that the port supports some of the next > > functionalities: HPCP - HotPlug capable port, MPSP - Mechanical Presence > > Switch attached to a port, CPD - Cold Plug detection, ESP - External SATA > > Port (eSATA), FBSCP - FIS-based switching capable port. > > > > Signed-off-by: Serge Semin > > > > --- > > > > Changelog v4: > > - Fix some misspelling in the patch log. > > - Convert the boolean properties to the bitfield properties. (@Rob) > > - Remove Hannes' rb tag due to the patch content change. > > --- > > .../devicetree/bindings/ata/ahci-common.yaml | 16 +++++++++++++++ > > .../bindings/ata/ahci-platform.yaml | 10 ++++++++++ > > include/dt-bindings/ata/ahci.h | 20 +++++++++++++++++++ > > 3 files changed, 46 insertions(+) > > create mode 100644 include/dt-bindings/ata/ahci.h > > > > diff --git a/Documentation/devicetree/bindings/ata/ahci-common.yaml b/Documentation/devicetree/bindings/ata/ahci-common.yaml > > index 12a97b56226f..94d72aeaad0f 100644 > > --- a/Documentation/devicetree/bindings/ata/ahci-common.yaml > > +++ b/Documentation/devicetree/bindings/ata/ahci-common.yaml > > @@ -58,6 +58,14 @@ properties: > > phy-names: > > const: sata-phy > > > > + hba-cap: > > + $ref: '/schemas/types.yaml#/definitions/uint32' > > + description: > > + Bitfield of the HBA generic platform capabilities like Staggered > > + Spin-up or Mechanical Presence Switch support. It can be used to > > + appropriately initialize the HWinit fields of the HBA CAP register > > + in case if the system firmware hasn't done it. > > + > > ports-implemented: > > $ref: '/schemas/types.yaml#/definitions/uint32' > > description: > > @@ -101,6 +109,14 @@ $defs: > > target-supply: > > description: Power regulator for SATA port target device > > > > + hba-port-cap: > > + $ref: '/schemas/types.yaml#/definitions/uint32' > > + description: > > + Bitfield of the HBA port-specific platform capabilities like Hot > > + plugging, eSATA, FIS-based Switching, etc (see AHCI specification > > + for details). It can be used to initialize the HWinit fields of > > + the PxCMD register in case if the system firmware hasn't done it. > > + > > required: > > - reg > > > > diff --git a/Documentation/devicetree/bindings/ata/ahci-platform.yaml b/Documentation/devicetree/bindings/ata/ahci-platform.yaml > > index 15be98e0385b..e19cf9828e68 100644 > > --- a/Documentation/devicetree/bindings/ata/ahci-platform.yaml > > +++ b/Documentation/devicetree/bindings/ata/ahci-platform.yaml > > @@ -111,6 +111,8 @@ examples: > > - | > > #include > > #include > > + #include > > + > > sata@f7e90000 { > > compatible = "marvell,berlin2q-ahci", "generic-ahci"; > > reg = <0xf7e90000 0x1000>; > > @@ -119,15 +121,23 @@ examples: > > #address-cells = <1>; > > #size-cells = <0>; > > > > + hba-cap = ; > > + > > sata0: sata-port@0 { > > reg = <0>; > > + > > phys = <&sata_phy 0>; > > target-supply = <®_sata0>; > > + > > + hba-port-cap = <(HBA_PORT_FBSCP | HBA_PORT_ESP)>; > > }; > > > > sata1: sata-port@1 { > > reg = <1>; > > + > > phys = <&sata_phy 1>; > > target-supply = <®_sata1>; > > + > > + hba-port-cap = <(HBA_PORT_HPCP | HBA_PORT_MPSP | HBA_PORT_FBSCP)>; > > }; > > }; > > diff --git a/include/dt-bindings/ata/ahci.h b/include/dt-bindings/ata/ahci.h > > new file mode 100644 > > index 000000000000..6841caebcedf > > --- /dev/null > > +++ b/include/dt-bindings/ata/ahci.h > > @@ -0,0 +1,20 @@ > > +/* SPDX-License-Identifier: GPL-2.0 */ > > Dual license. Ok. > > With that, > > Reviewed-by: Rob Herring Thanks. -Sergey > > > +/* > > + * This header provides constants for most AHCI bindings. > > + */ > > + > > +#ifndef _DT_BINDINGS_ATA_AHCI_H > > +#define _DT_BINDINGS_ATA_AHCI_H > > + > > +/* Host Bus Adapter generic platform capabilities */ > > +#define HBA_SSS (1 << 27) > > +#define HBA_SMPS (1 << 28) > > + > > +/* Host Bus Adapter port-specific platform capabilities */ > > +#define HBA_PORT_HPCP (1 << 18) > > +#define HBA_PORT_MPSP (1 << 19) > > +#define HBA_PORT_CPD (1 << 20) > > +#define HBA_PORT_ESP (1 << 21) > > +#define HBA_PORT_FBSCP (1 << 22) > > + > > +#endif > > -- > > 2.35.1 > > > >