Skip to content

Commit 662a958

Browse files
mmindKevin Hilman
authored andcommitted
PM / AVS: rockchip-io: add driver handling Rockchip io domains
IO domain voltages on some Rockchip SoCs are variable but need to be kept in sync between the regulators and the SoC using a special register. A specific example using rk3288: - If the regulator hooked up to a pin like SDMMC0_VDD is 3.3V then bit 7 of GRF_IO_VSEL needs to be 0. If the regulator hooked up to that same pin is 1.8V then bit 7 of GRF_IO_VSEL needs to be 1. Said another way, this driver simply handles keeping bits in the SoC's general register file (GRF) in sync with the actual value of a voltage hooked up to the pins. Note that this driver specifically doesn't include: - any logic for deciding what voltage we should set regulators to - any logic for deciding whether regulators (or internal SoC blocks) should have power or not have power If there were some other software that had the smarts of making decisions about regulators, it would work in conjunction with this driver. When that other software adjusted a regulator's voltage then this driver would handle telling the SoC about it. A good example is vqmmc for SD. In that case the dw_mmc driver simply is told about a regulator. It changes the regulator between 3.3V and 1.8V at the right time. This driver notices the change and makes sure that the SoC is on the same page. Signed-off-by: Heiko Stübner <heiko@sntech.de> Signed-off-by: Doug Anderson <dianders@chromium.org> Reviewed-by: Santosh Shilimkar <santosh.shilimkar@ti.com> [khilman: fix compiler warnings] Signed-off-by: Kevin Hilman <khilman@linaro.org>
1 parent 7d1311b commit 662a958

4 files changed

Lines changed: 443 additions & 0 deletions

File tree

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
Rockchip SRAM for IO Voltage Domains:
2+
-------------------------------------
3+
4+
IO domain voltages on some Rockchip SoCs are variable but need to be
5+
kept in sync between the regulators and the SoC using a special
6+
register.
7+
8+
A specific example using rk3288:
9+
- If the regulator hooked up to a pin like SDMMC0_VDD is 3.3V then
10+
bit 7 of GRF_IO_VSEL needs to be 0. If the regulator hooked up to
11+
that same pin is 1.8V then bit 7 of GRF_IO_VSEL needs to be 1.
12+
13+
Said another way, this driver simply handles keeping bits in the SoC's
14+
general register file (GRF) in sync with the actual value of a voltage
15+
hooked up to the pins.
16+
17+
Note that this driver specifically doesn't include:
18+
- any logic for deciding what voltage we should set regulators to
19+
- any logic for deciding whether regulators (or internal SoC blocks)
20+
should have power or not have power
21+
22+
If there were some other software that had the smarts of making
23+
decisions about regulators, it would work in conjunction with this
24+
driver. When that other software adjusted a regulator's voltage then
25+
this driver would handle telling the SoC about it. A good example is
26+
vqmmc for SD. In that case the dw_mmc driver simply is told about a
27+
regulator. It changes the regulator between 3.3V and 1.8V at the
28+
right time. This driver notices the change and makes sure that the
29+
SoC is on the same page.
30+
31+
32+
Required properties:
33+
- compatible: should be one of:
34+
- "rockchip,rk3188-io-voltage-domain" for rk3188
35+
- "rockchip,rk3288-io-voltage-domain" for rk3288
36+
- rockchip,grf: phandle to the syscon managing the "general register files"
37+
38+
39+
You specify supplies using the standard regulator bindings by including
40+
a phandle the the relevant regulator. All specified supplies must be able
41+
to report their voltage. The IO Voltage Domain for any non-specified
42+
supplies will be not be touched.
43+
44+
Possible supplies for rk3188:
45+
- ap0-supply: The supply connected to AP0_VCC.
46+
- ap1-supply: The supply connected to AP1_VCC.
47+
- cif-supply: The supply connected to CIF_VCC.
48+
- flash-supply: The supply connected to FLASH_VCC.
49+
- lcdc0-supply: The supply connected to LCD0_VCC.
50+
- lcdc1-supply: The supply connected to LCD1_VCC.
51+
- vccio0-supply: The supply connected to VCCIO0.
52+
- vccio1-supply: The supply connected to VCCIO1.
53+
Sometimes also labeled VCCIO1 and VCCIO2.
54+
55+
Possible supplies for rk3288:
56+
- audio-supply: The supply connected to APIO4_VDD.
57+
- bb-supply: The supply connected to APIO5_VDD.
58+
- dvp-supply: The supply connected to DVPIO_VDD.
59+
- flash0-supply: The supply connected to FLASH0_VDD. Typically for eMMC
60+
- flash1-supply: The supply connected to FLASH1_VDD. Also known as SDIO1.
61+
- gpio30-supply: The supply connected to APIO1_VDD.
62+
- gpio1830 The supply connected to APIO2_VDD.
63+
- lcdc-supply: The supply connected to LCDC_VDD.
64+
- sdcard-supply: The supply connected to SDMMC0_VDD.
65+
- wifi-supply: The supply connected to APIO3_VDD. Also known as SDIO0.
66+
67+
68+
Example:
69+
70+
io-domains {
71+
compatible = "rockchip,rk3288-io-voltage-domain";
72+
rockchip,grf = <&grf>;
73+
74+
audio-supply = <&vcc18_codec>;
75+
bb-supply = <&vcc33_io>;
76+
dvp-supply = <&vcc_18>;
77+
flash0-supply = <&vcc18_flashio>;
78+
gpio1830-supply = <&vcc33_io>;
79+
gpio30-supply = <&vcc33_pmuio>;
80+
lcdc-supply = <&vcc33_lcd>;
81+
sdcard-supply = <&vccio_sd>;
82+
wifi-supply = <&vcc18_wl>;
83+
};

‎drivers/power/avs/Kconfig‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,11 @@ menuconfig POWER_AVS
1010
AVS is also called SmartReflex on OMAP devices.
1111

1212
Say Y here to enable Adaptive Voltage Scaling class support.
13+
14+
config ROCKCHIP_IODOMAIN
15+
tristate "Rockchip IO domain support"
16+
depends on ARCH_ROCKCHIP && OF
17+
help
18+
Say y here to enable support io domains on Rockchip SoCs. It is
19+
necessary for the io domain setting of the SoC to match the
20+
voltage supplied by the regulators.

‎drivers/power/avs/Makefile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
obj-$(CONFIG_POWER_AVS_OMAP) += smartreflex.o
2+
obj-$(CONFIG_ROCKCHIP_IODOMAIN) += rockchip-io-domain.o

0 commit comments

Comments
 (0)