18c2ecf20Sopenharmony_ciRockchip SRAM for IO Voltage Domains: 28c2ecf20Sopenharmony_ci------------------------------------- 38c2ecf20Sopenharmony_ci 48c2ecf20Sopenharmony_ciIO domain voltages on some Rockchip SoCs are variable but need to be 58c2ecf20Sopenharmony_cikept in sync between the regulators and the SoC using a special 68c2ecf20Sopenharmony_ciregister. 78c2ecf20Sopenharmony_ci 88c2ecf20Sopenharmony_ciA specific example using rk3288: 98c2ecf20Sopenharmony_ci- If the regulator hooked up to a pin like SDMMC0_VDD is 3.3V then 108c2ecf20Sopenharmony_ci bit 7 of GRF_IO_VSEL needs to be 0. If the regulator hooked up to 118c2ecf20Sopenharmony_ci that same pin is 1.8V then bit 7 of GRF_IO_VSEL needs to be 1. 128c2ecf20Sopenharmony_ci 138c2ecf20Sopenharmony_ciSaid another way, this driver simply handles keeping bits in the SoC's 148c2ecf20Sopenharmony_cigeneral register file (GRF) in sync with the actual value of a voltage 158c2ecf20Sopenharmony_cihooked up to the pins. 168c2ecf20Sopenharmony_ci 178c2ecf20Sopenharmony_ciNote that this driver specifically doesn't include: 188c2ecf20Sopenharmony_ci- any logic for deciding what voltage we should set regulators to 198c2ecf20Sopenharmony_ci- any logic for deciding whether regulators (or internal SoC blocks) 208c2ecf20Sopenharmony_ci should have power or not have power 218c2ecf20Sopenharmony_ci 228c2ecf20Sopenharmony_ciIf there were some other software that had the smarts of making 238c2ecf20Sopenharmony_cidecisions about regulators, it would work in conjunction with this 248c2ecf20Sopenharmony_cidriver. When that other software adjusted a regulator's voltage then 258c2ecf20Sopenharmony_cithis driver would handle telling the SoC about it. A good example is 268c2ecf20Sopenharmony_civqmmc for SD. In that case the dw_mmc driver simply is told about a 278c2ecf20Sopenharmony_ciregulator. It changes the regulator between 3.3V and 1.8V at the 288c2ecf20Sopenharmony_ciright time. This driver notices the change and makes sure that the 298c2ecf20Sopenharmony_ciSoC is on the same page. 308c2ecf20Sopenharmony_ci 318c2ecf20Sopenharmony_ci 328c2ecf20Sopenharmony_ciRequired properties: 338c2ecf20Sopenharmony_ci- compatible: should be one of: 348c2ecf20Sopenharmony_ci - "rockchip,px30-io-voltage-domain" for px30 358c2ecf20Sopenharmony_ci - "rockchip,px30-pmu-io-voltage-domain" for px30 pmu-domains 368c2ecf20Sopenharmony_ci - "rockchip,rk3188-io-voltage-domain" for rk3188 378c2ecf20Sopenharmony_ci - "rockchip,rk3228-io-voltage-domain" for rk3228 388c2ecf20Sopenharmony_ci - "rockchip,rk3288-io-voltage-domain" for rk3288 398c2ecf20Sopenharmony_ci - "rockchip,rk3328-io-voltage-domain" for rk3328 408c2ecf20Sopenharmony_ci - "rockchip,rk3368-io-voltage-domain" for rk3368 418c2ecf20Sopenharmony_ci - "rockchip,rk3368-pmu-io-voltage-domain" for rk3368 pmu-domains 428c2ecf20Sopenharmony_ci - "rockchip,rk3399-io-voltage-domain" for rk3399 438c2ecf20Sopenharmony_ci - "rockchip,rk3399-pmu-io-voltage-domain" for rk3399 pmu-domains 448c2ecf20Sopenharmony_ci - "rockchip,rv1108-io-voltage-domain" for rv1108 458c2ecf20Sopenharmony_ci - "rockchip,rv1108-pmu-io-voltage-domain" for rv1108 pmu-domains 468c2ecf20Sopenharmony_ci 478c2ecf20Sopenharmony_ciDeprecated properties: 488c2ecf20Sopenharmony_ci- rockchip,grf: phandle to the syscon managing the "general register files" 498c2ecf20Sopenharmony_ci Systems should move the io-domains to a sub-node of the grf simple-mfd. 508c2ecf20Sopenharmony_ci 518c2ecf20Sopenharmony_ciYou specify supplies using the standard regulator bindings by including 528c2ecf20Sopenharmony_cia phandle the relevant regulator. All specified supplies must be able 538c2ecf20Sopenharmony_cito report their voltage. The IO Voltage Domain for any non-specified 548c2ecf20Sopenharmony_cisupplies will be not be touched. 558c2ecf20Sopenharmony_ci 568c2ecf20Sopenharmony_ciPossible supplies for PX30: 578c2ecf20Sopenharmony_ci- vccio6-supply: The supply connected to VCCIO6. 588c2ecf20Sopenharmony_ci- vccio1-supply: The supply connected to VCCIO1. 598c2ecf20Sopenharmony_ci- vccio2-supply: The supply connected to VCCIO2. 608c2ecf20Sopenharmony_ci- vccio3-supply: The supply connected to VCCIO3. 618c2ecf20Sopenharmony_ci- vccio4-supply: The supply connected to VCCIO4. 628c2ecf20Sopenharmony_ci- vccio5-supply: The supply connected to VCCIO5. 638c2ecf20Sopenharmony_ci- vccio-oscgpi-supply: The supply connected to VCCIO_OSCGPI. 648c2ecf20Sopenharmony_ci 658c2ecf20Sopenharmony_ciPossible supplies for PX30 pmu-domains: 668c2ecf20Sopenharmony_ci- pmuio1-supply: The supply connected to PMUIO1. 678c2ecf20Sopenharmony_ci- pmuio2-supply: The supply connected to PMUIO2. 688c2ecf20Sopenharmony_ci 698c2ecf20Sopenharmony_ciPossible supplies for rk3188: 708c2ecf20Sopenharmony_ci- ap0-supply: The supply connected to AP0_VCC. 718c2ecf20Sopenharmony_ci- ap1-supply: The supply connected to AP1_VCC. 728c2ecf20Sopenharmony_ci- cif-supply: The supply connected to CIF_VCC. 738c2ecf20Sopenharmony_ci- flash-supply: The supply connected to FLASH_VCC. 748c2ecf20Sopenharmony_ci- lcdc0-supply: The supply connected to LCD0_VCC. 758c2ecf20Sopenharmony_ci- lcdc1-supply: The supply connected to LCD1_VCC. 768c2ecf20Sopenharmony_ci- vccio0-supply: The supply connected to VCCIO0. 778c2ecf20Sopenharmony_ci- vccio1-supply: The supply connected to VCCIO1. 788c2ecf20Sopenharmony_ci Sometimes also labeled VCCIO1 and VCCIO2. 798c2ecf20Sopenharmony_ci 808c2ecf20Sopenharmony_ciPossible supplies for rk3228: 818c2ecf20Sopenharmony_ci- vccio1-supply: The supply connected to VCCIO1. 828c2ecf20Sopenharmony_ci- vccio2-supply: The supply connected to VCCIO2. 838c2ecf20Sopenharmony_ci- vccio3-supply: The supply connected to VCCIO3. 848c2ecf20Sopenharmony_ci- vccio4-supply: The supply connected to VCCIO4. 858c2ecf20Sopenharmony_ci 868c2ecf20Sopenharmony_ciPossible supplies for rk3288: 878c2ecf20Sopenharmony_ci- audio-supply: The supply connected to APIO4_VDD. 888c2ecf20Sopenharmony_ci- bb-supply: The supply connected to APIO5_VDD. 898c2ecf20Sopenharmony_ci- dvp-supply: The supply connected to DVPIO_VDD. 908c2ecf20Sopenharmony_ci- flash0-supply: The supply connected to FLASH0_VDD. Typically for eMMC 918c2ecf20Sopenharmony_ci- flash1-supply: The supply connected to FLASH1_VDD. Also known as SDIO1. 928c2ecf20Sopenharmony_ci- gpio30-supply: The supply connected to APIO1_VDD. 938c2ecf20Sopenharmony_ci- gpio1830 The supply connected to APIO2_VDD. 948c2ecf20Sopenharmony_ci- lcdc-supply: The supply connected to LCDC_VDD. 958c2ecf20Sopenharmony_ci- sdcard-supply: The supply connected to SDMMC0_VDD. 968c2ecf20Sopenharmony_ci- wifi-supply: The supply connected to APIO3_VDD. Also known as SDIO0. 978c2ecf20Sopenharmony_ci 988c2ecf20Sopenharmony_ciPossible supplies for rk3368: 998c2ecf20Sopenharmony_ci- audio-supply: The supply connected to APIO3_VDD. 1008c2ecf20Sopenharmony_ci- dvp-supply: The supply connected to DVPIO_VDD. 1018c2ecf20Sopenharmony_ci- flash0-supply: The supply connected to FLASH0_VDD. Typically for eMMC 1028c2ecf20Sopenharmony_ci- gpio30-supply: The supply connected to APIO1_VDD. 1038c2ecf20Sopenharmony_ci- gpio1830 The supply connected to APIO4_VDD. 1048c2ecf20Sopenharmony_ci- sdcard-supply: The supply connected to SDMMC0_VDD. 1058c2ecf20Sopenharmony_ci- wifi-supply: The supply connected to APIO2_VDD. Also known as SDIO0. 1068c2ecf20Sopenharmony_ci 1078c2ecf20Sopenharmony_ciPossible supplies for rk3368 pmu-domains: 1088c2ecf20Sopenharmony_ci- pmu-supply: The supply connected to PMUIO_VDD. 1098c2ecf20Sopenharmony_ci- vop-supply: The supply connected to LCDC_VDD. 1108c2ecf20Sopenharmony_ci 1118c2ecf20Sopenharmony_ciPossible supplies for rk3399: 1128c2ecf20Sopenharmony_ci- bt656-supply: The supply connected to APIO2_VDD. 1138c2ecf20Sopenharmony_ci- audio-supply: The supply connected to APIO5_VDD. 1148c2ecf20Sopenharmony_ci- sdmmc-supply: The supply connected to SDMMC0_VDD. 1158c2ecf20Sopenharmony_ci- gpio1830 The supply connected to APIO4_VDD. 1168c2ecf20Sopenharmony_ci 1178c2ecf20Sopenharmony_ciPossible supplies for rk3399 pmu-domains: 1188c2ecf20Sopenharmony_ci- pmu1830-supply:The supply connected to PMUIO2_VDD. 1198c2ecf20Sopenharmony_ci 1208c2ecf20Sopenharmony_ciExample: 1218c2ecf20Sopenharmony_ci 1228c2ecf20Sopenharmony_ci io-domains { 1238c2ecf20Sopenharmony_ci compatible = "rockchip,rk3288-io-voltage-domain"; 1248c2ecf20Sopenharmony_ci rockchip,grf = <&grf>; 1258c2ecf20Sopenharmony_ci 1268c2ecf20Sopenharmony_ci audio-supply = <&vcc18_codec>; 1278c2ecf20Sopenharmony_ci bb-supply = <&vcc33_io>; 1288c2ecf20Sopenharmony_ci dvp-supply = <&vcc_18>; 1298c2ecf20Sopenharmony_ci flash0-supply = <&vcc18_flashio>; 1308c2ecf20Sopenharmony_ci gpio1830-supply = <&vcc33_io>; 1318c2ecf20Sopenharmony_ci gpio30-supply = <&vcc33_pmuio>; 1328c2ecf20Sopenharmony_ci lcdc-supply = <&vcc33_lcd>; 1338c2ecf20Sopenharmony_ci sdcard-supply = <&vccio_sd>; 1348c2ecf20Sopenharmony_ci wifi-supply = <&vcc18_wl>; 1358c2ecf20Sopenharmony_ci }; 136