Commit 03f1076f authored by Serge Semin's avatar Serge Semin Committed by Damien Le Moal

dt-bindings: ata: ahci: Add platform capability properties

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: default avatarSerge Semin <Sergey.Semin@baikalelectronics.ru>
Reviewed-by: default avatarRob Herring <robh@kernel.org>
Signed-off-by: default avatarDamien Le Moal <damien.lemoal@opensource.wdc.com>
parent f67f12ff
...@@ -58,6 +58,14 @@ properties: ...@@ -58,6 +58,14 @@ properties:
phy-names: phy-names:
const: sata-phy 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: ports-implemented:
$ref: '/schemas/types.yaml#/definitions/uint32' $ref: '/schemas/types.yaml#/definitions/uint32'
description: description:
...@@ -101,6 +109,14 @@ $defs: ...@@ -101,6 +109,14 @@ $defs:
target-supply: target-supply:
description: Power regulator for SATA port target device 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: required:
- reg - reg
......
...@@ -111,6 +111,8 @@ examples: ...@@ -111,6 +111,8 @@ examples:
- | - |
#include <dt-bindings/interrupt-controller/arm-gic.h> #include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/clock/berlin2q.h> #include <dt-bindings/clock/berlin2q.h>
#include <dt-bindings/ata/ahci.h>
sata@f7e90000 { sata@f7e90000 {
compatible = "marvell,berlin2q-ahci", "generic-ahci"; compatible = "marvell,berlin2q-ahci", "generic-ahci";
reg = <0xf7e90000 0x1000>; reg = <0xf7e90000 0x1000>;
...@@ -119,15 +121,23 @@ examples: ...@@ -119,15 +121,23 @@ examples:
#address-cells = <1>; #address-cells = <1>;
#size-cells = <0>; #size-cells = <0>;
hba-cap = <HBA_SMPS>;
sata0: sata-port@0 { sata0: sata-port@0 {
reg = <0>; reg = <0>;
phys = <&sata_phy 0>; phys = <&sata_phy 0>;
target-supply = <&reg_sata0>; target-supply = <&reg_sata0>;
hba-port-cap = <(HBA_PORT_FBSCP | HBA_PORT_ESP)>;
}; };
sata1: sata-port@1 { sata1: sata-port@1 {
reg = <1>; reg = <1>;
phys = <&sata_phy 1>; phys = <&sata_phy 1>;
target-supply = <&reg_sata1>; target-supply = <&reg_sata1>;
hba-port-cap = <(HBA_PORT_HPCP | HBA_PORT_MPSP | HBA_PORT_FBSCP)>;
}; };
}; };
/* SPDX-License-Identifier: GPL-2.0-only or BSD-2-Clause */
/*
* 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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment