This patchset add support for allwinner R40 AHCI controller.
The whole patchset is tested on sun8i-r40-bananapi-m2-ultra and
on sun7i-a20-cubieboard2 which doesnt have any of the ressources added
by this serie, so no regression should come with it.
Patchs 1-7 should go via the ata tree
Patchs 8,9 should go via the sunxi tree
Changes since v4:
- dropped PHY dedicated driver
- added the optionnal phy-supply
Changes since v3:
- Moved PHY code to a new sun4i-a10-phy-sata driver
- Removed reset code since ahci_platform support now reset controller.
Changes since V2
- Moved all ressources management to ahci_platform
Corentin Labbe (9):
dt-bindings: ata: ahci-platform: fix indentation of target-supply
ata: ahci_platform: add support for AHCI controller regulator
dt-bindings: ata: ahci-platform: document ahci-supply
ata: ahci_platform: add support for PHY controller regulator
dt-bindings: ata: ahci-platform: document phy-supply
ata: ahci_sunxi: add support for r40
dt-bindings: ata: update ahci_sunxi bindings
ARM: dts: sun8i: r40: add sata node
ARM: dts: sun8i: sun8i-r40-bananapi-m2-ultra: enable AHCI
.../devicetree/bindings/ata/ahci-platform.txt | 6 ++-
arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts | 18 +++++++++
arch/arm/boot/dts/sun8i-r40.dtsi | 13 ++++++
drivers/ata/ahci.h | 2 +
drivers/ata/ahci_sunxi.c | 3 +-
drivers/ata/libahci_platform.c | 46 +++++++++++++++++++++-
6 files changed, 84 insertions(+), 4 deletions(-)
--
2.16.4
@@ -47,7 +47,7 @@ Sub-nodes required properties: - reg : the port number And at least one of the following properties: - phys : reference to the SATA PHY node-- target-supply : regulator for SATA target power+- target-supply : regulator for SATA target power Examples: sata at ffe08000 {
@@ -33,6 +33,7 @@ Optional properties: - target-supply : regulator for SATA target power - phys : reference to the SATA PHY node - phy-names : must be "sata-phy"+- ahci-supply : regulator for AHCI controller - ports-implemented : Mask that indicates which ports that the HBA supports are available for software to use. Useful if PORTS_IMPL is not programmed by the BIOS, which is true with
The SoC R40 AHCI controller need a PHY regulator to work.
But since the PHY is embedded in the controller, we cannot do a DT node for it,
since phy-supply works only in node with a PHY compatible.
So this patch adds a way to add an optional phy-supply regulator on AHCI controller node.
Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
---
drivers/ata/ahci.h | 1 +
drivers/ata/libahci_platform.c | 20 ++++++++++++++++++++
2 files changed, 21 insertions(+)
@@ -31,6 +31,7 @@ Optional properties: - clocks : a list of phandle + clock specifier pairs - resets : a list of phandle + reset specifier pairs - target-supply : regulator for SATA target power+- phy-supply : regulator for PHY power - phys : reference to the SATA PHY node - phy-names : must be "sata-phy" - ahci-supply : regulator for AHCI controller
@@ -31,6 +31,7 @@ Optional properties: - clocks : a list of phandle + clock specifier pairs - resets : a list of phandle + reset specifier pairs - target-supply : regulator for SATA target power+- phy-supply : regulator for PHY power
This should be mutually exclusive with the phys property. If you have a
phy node, then its supply belongs there.
- phys : reference to the SATA PHY node
- phy-names : must be "sata-phy"
- ahci-supply : regulator for AHCI controller
--
2.16.4
This patch add the r40 compatible to the ahci_sunxi's supported list of
compatible.
Since R40 need ahci_platform to handle the reset controller, we also add
the new AHCI_PLATFORM_GET_RESETS flag for ahci_platform_get_resources().
This has no consequence for older platform (a10, a20) since the reset is
optional.
Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
---
drivers/ata/ahci_sunxi.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
@@ -44,6 +45,7 @@ Required properties when using sub-nodes: - #address-cells : number of cells to encode an address - #size-cells : number of cells representing the size of an address+For allwinner,sun8i-r40-ahci, the reset propertie must be present. Sub-nodes required properties: - reg : the port number
R40 have a sata controller which is the same as A20.
This patch adds a DT node for it.
Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
---
arch/arm/boot/dts/sun8i-r40.dtsi | 13 +++++++++++++
1 file changed, 13 insertions(+)
This patch enable the AHCI controller.
Since this controller need two regulator, this patch add them.
Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
---
arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
The SoC R40 AHCI controller need a regulator to work.
So this patch add a way to add an optional regulator on AHCI controller.
Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
---
drivers/ata/ahci.h | 1 +
drivers/ata/libahci_platform.c | 26 ++++++++++++++++++++++++--
2 files changed, 25 insertions(+), 2 deletions(-)
From: Maxime Ripard <hidden> Date: 2018-09-03 12:42:34
On Mon, Sep 03, 2018 at 12:01:52PM +0200, Corentin Labbe wrote:
This patchset add support for allwinner R40 AHCI controller.
The whole patchset is tested on sun8i-r40-bananapi-m2-ultra and
on sun7i-a20-cubieboard2 which doesnt have any of the ressources added
by this serie, so no regression should come with it.
Patchs 1-7 should go via the ata tree
Patchs 8,9 should go via the sunxi tree
From: Hans de Goede <hidden> Date: 2018-09-03 12:58:57
Hi,
On 03-09-18 14:42, Maxime Ripard wrote:
On Mon, Sep 03, 2018 at 12:01:52PM +0200, Corentin Labbe wrote:
quoted
This patchset add support for allwinner R40 AHCI controller.
The whole patchset is tested on sun8i-r40-bananapi-m2-ultra and
on sun7i-a20-cubieboard2 which doesnt have any of the ressources added
by this serie, so no regression should come with it.
Patchs 1-7 should go via the ata tree
Patchs 8,9 should go via the sunxi tree
Acked-by: Maxime Ripard <redacted>
The entire series looks good to me too:
Reviewed-by: Hans de Goede <redacted>
Regards,
Hans
This patchset add support for allwinner R40 AHCI controller.
The whole patchset is tested on sun8i-r40-bananapi-m2-ultra and
on sun7i-a20-cubieboard2 which doesnt have any of the ressources added
by this serie, so no regression should come with it.
Patchs 1-7 should go via the ata tree
Patchs 8,9 should go via the sunxi tree
Applied 1-7 for 4.20, thanks everyone.
--
Jens Axboe
From: Maxime Ripard <hidden> Date: 2018-09-05 07:25:35
On Mon, Sep 03, 2018 at 08:26:22AM -0600, Jens Axboe wrote:
On 9/3/18 4:01 AM, Corentin Labbe wrote:
quoted
This patchset add support for allwinner R40 AHCI controller.
The whole patchset is tested on sun8i-r40-bananapi-m2-ultra and
on sun7i-a20-cubieboard2 which doesnt have any of the ressources added
by this serie, so no regression should come with it.
Patchs 1-7 should go via the ata tree
Patchs 8,9 should go via the sunxi tree