arm64: dts: rockchip: Enable HDD power on helios64
authorFlorian Klink <flokli@flokli.de>
Wed, 20 Oct 2021 09:59:22 +0000 (11:59 +0200)
committerHeiko Stuebner <heiko@sntech.de>
Sun, 21 Nov 2021 17:57:14 +0000 (18:57 +0100)
This adds the hdd_{a,b}_power blocks present in the armbian helios64
dts. [1]

Without those powered up, no HDDs will appear (except one connected via
the m.2 slot).

>From https://wiki.kobol.io/helios64/sata/#hdd-power:

> The power delivery of the HDDs is divided into two group:
>
>     HDD Rail A (Max. 3x Drives)
>     HDD Rail B (Max. 2x Drives)
>
> Helios64 implements a power staggering approach where HDD Rail A will be
> powered up first, then few seconds later HDD Rail B will be powered up.
> This power control scenario is performed to reduce the inrush current
> during disk spin-up.

In practice, this power staggering approach will be included in the
bootloader (not in the kernel), as we might want to boot from a SATA
drive.

>From my experiments, if the bootloader doesn't implement the power
staggering, only one HDD will get recognized (probably cause the others
didn't boot due to few power).

Still, it makes sense to expose this block in the device-tree, so the
kernel can ensure both rails are on (and this can be shared with
u-boot).

[1] https://github.com/armbian/build/blob/744ea89a589d62cb6f409baab60fc6664520bc39/patch/kernel/archive/rockchip64-5.14/add-board-helios64.patch

Signed-off-by: Florian Klink <flokli@flokli.de>
Tested-by: Dennis Gilmore <dgilmore@redhat.com>
Link: https://lore.kernel.org/r/20211020095926.735938-1-flokli@flokli.de
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
arch/arm64/boot/dts/rockchip/rk3399-kobol-helios64.dts

index ac193e5a22952676ffbe19cf67ffe8b640bfd1ee..627ee88e9dc219779c5a2aedcbacdbe5a78f9d0c 100644 (file)
                };
        };
 
+       hdd_a_power: hdd-a-power {
+               compatible = "regulator-fixed";
+               enable-active-high;
+               gpio = <&gpio1 RK_PA0 GPIO_ACTIVE_HIGH>;
+               pinctrl-0 = <&hdd_a_power_en>;
+               pinctrl-names = "default";
+               regulator-always-on;
+               regulator-boot-on;
+               regulator-name = "hdd_a_power";
+               startup-delay-us = <2000000>;
+       };
+
+       hdd_b_power: hdd-b-power {
+               compatible = "regulator-fixed";
+               enable-active-high;
+               gpio = <&gpio1 RK_PA1 GPIO_ACTIVE_HIGH>;
+               pinctrl-0 = <&hdd_b_power_en>;
+               pinctrl-names = "default";
+               regulator-always-on;
+               regulator-boot-on;
+               regulator-name = "hdd_b_power";
+               startup-delay-us = <2000000>;
+       };
+
        pcie_power: pcie-power {
                compatible = "regulator-fixed";
                enable-active-high;
        };
 
        power {
+               hdd_a_power_en: hdd-a-power-en {
+                       rockchip,pins = <1 RK_PA0 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+
+               hdd_b_power_en: hdd-b-power-en {
+                       rockchip,pins = <1 RK_PA1 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+
                vcc5v0_usb_en: vcc5v0-usb-en {
                        rockchip,pins = <1 RK_PC6 RK_FUNC_GPIO &pcfg_pull_none>;
                };