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

ARM: dts: sun8i: a83t: bananapi-m3: describe SATA disk regulator

The Bananapi-M3 has a SATA connector, driven by a USB-to-SATA bridge
soldered on the board. The power for the SATA device is provided by a
GPIO controlled regulator. Since the SATA device is behind USB, it has
no DT node, so we never described this regulator. Instead U-Boot was
turning this on in a rather hackish way, which we now want to get rid of.
On top of that it seems fragile to leave this GPIO undescribed, as
userland could claim it and turn the disk off.

Add a fixed regulator, controlled by the PD25 GPIO, and mark it as
always-on. This would mimic the current situation, but in a safer way,
and would allow U-Boot to drop the CONFIG_SATAPWR enable hack.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Acked-by: Samuel Holland <samuel@sholland.org>
Link: https://lore.kernel.org/r/20230120012616.30960-1-andre.przywara@arm.com
Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>

authored by

Andre Przywara and committed by
Jernej Skrabec
beabd511 2177d4ae

+15
+15
arch/arm/boot/dts/sun8i-a83t-bananapi-m3.dts
··· 105 105 /* enables internal regulator and de-asserts reset */ 106 106 reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 WL-PMU-EN */ 107 107 }; 108 + 109 + /* 110 + * Power supply for the SATA disk, behind a USB-SATA bridge. 111 + * Since it is a USB device, there is no consumer in the DT, so we 112 + * have to keep this always on. 113 + */ 114 + regulator-sata-disk-pwr { 115 + compatible = "regulator-fixed"; 116 + regulator-name = "sata-disk-pwr"; 117 + regulator-min-microvolt = <5000000>; 118 + regulator-max-microvolt = <5000000>; 119 + regulator-always-on; 120 + enable-active-high; 121 + gpio = <&pio 3 25 GPIO_ACTIVE_HIGH>; /* PD25 */ 122 + }; 108 123 }; 109 124 110 125 &cpu0 {