Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Serge Semin <Sergey.Semin@baikalelectronics.ru>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>

authored by

Serge Semin and committed by
Damien Le Moal
03f1076f f67f12ff

+46
+16
Documentation/devicetree/bindings/ata/ahci-common.yaml
··· 58 58 phy-names: 59 59 const: sata-phy 60 60 61 + hba-cap: 62 + $ref: '/schemas/types.yaml#/definitions/uint32' 63 + description: 64 + Bitfield of the HBA generic platform capabilities like Staggered 65 + Spin-up or Mechanical Presence Switch support. It can be used to 66 + appropriately initialize the HWinit fields of the HBA CAP register 67 + in case if the system firmware hasn't done it. 68 + 61 69 ports-implemented: 62 70 $ref: '/schemas/types.yaml#/definitions/uint32' 63 71 description: ··· 108 100 109 101 target-supply: 110 102 description: Power regulator for SATA port target device 103 + 104 + hba-port-cap: 105 + $ref: '/schemas/types.yaml#/definitions/uint32' 106 + description: 107 + Bitfield of the HBA port-specific platform capabilities like Hot 108 + plugging, eSATA, FIS-based Switching, etc (see AHCI specification 109 + for details). It can be used to initialize the HWinit fields of 110 + the PxCMD register in case if the system firmware hasn't done it. 111 111 112 112 required: 113 113 - reg
+10
Documentation/devicetree/bindings/ata/ahci-platform.yaml
··· 111 111 - | 112 112 #include <dt-bindings/interrupt-controller/arm-gic.h> 113 113 #include <dt-bindings/clock/berlin2q.h> 114 + #include <dt-bindings/ata/ahci.h> 115 + 114 116 sata@f7e90000 { 115 117 compatible = "marvell,berlin2q-ahci", "generic-ahci"; 116 118 reg = <0xf7e90000 0x1000>; ··· 121 119 #address-cells = <1>; 122 120 #size-cells = <0>; 123 121 122 + hba-cap = <HBA_SMPS>; 123 + 124 124 sata0: sata-port@0 { 125 125 reg = <0>; 126 + 126 127 phys = <&sata_phy 0>; 127 128 target-supply = <&reg_sata0>; 129 + 130 + hba-port-cap = <(HBA_PORT_FBSCP | HBA_PORT_ESP)>; 128 131 }; 129 132 130 133 sata1: sata-port@1 { 131 134 reg = <1>; 135 + 132 136 phys = <&sata_phy 1>; 133 137 target-supply = <&reg_sata1>; 138 + 139 + hba-port-cap = <(HBA_PORT_HPCP | HBA_PORT_MPSP | HBA_PORT_FBSCP)>; 134 140 }; 135 141 };
+20
include/dt-bindings/ata/ahci.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0-only or BSD-2-Clause */ 2 + /* 3 + * This header provides constants for most AHCI bindings. 4 + */ 5 + 6 + #ifndef _DT_BINDINGS_ATA_AHCI_H 7 + #define _DT_BINDINGS_ATA_AHCI_H 8 + 9 + /* Host Bus Adapter generic platform capabilities */ 10 + #define HBA_SSS (1 << 27) 11 + #define HBA_SMPS (1 << 28) 12 + 13 + /* Host Bus Adapter port-specific platform capabilities */ 14 + #define HBA_PORT_HPCP (1 << 18) 15 + #define HBA_PORT_MPSP (1 << 19) 16 + #define HBA_PORT_CPD (1 << 20) 17 + #define HBA_PORT_ESP (1 << 21) 18 + #define HBA_PORT_FBSCP (1 << 22) 19 + 20 + #endif