IDAC USER GUIDE¶
REVISION HISTORY¶
| Revision No. | Description |
Date |
|---|---|---|
| 1.0 | 05/08/2025 | |
| 1.1 | 08/19/2026 |
1. Overview¶
DAC (Digital to Analog Converter) is an electronic device that converts digital signals into analog signals. We usually use DAC to refer to voltage output type DAC (i.e. the output analog signal is voltage), and IDAC to refer to current output type DAC (i.e. the output analog signal is current).
2. Keyword¶
-
DAC
(Digital-to-Analog Converter) A digital to analog converter is an electronic device that converts digital signals into analog signals.
-
IDAC
(Current Digital-to-Analog Converter) Current Digital to Analog Converter is a type of digital to analog converter that uses current as the output analog signal.
3. FUNCTION DESCRIPTION¶
SGS has two voltage regulation methods: DIV and IDAC. DIV voltage regulation is achieved by controlling 1-2 GPIO to adjust the voltage, with only 2-4 voltage levels available for adjustment. The accuracy between different levels is around 50mV. IDAC voltage regulation can more finely adjust the voltage (with a precision of 10mV or 20mV), and only requires a dedicated GPIO to control up to 30 voltage levels.
4. HARDWARE CONNECTION INTRODUCTION¶
The IDAC hardware module is integrated within the SoC. It is necessary to switch the corresponding jump cap on the development board to IDAC mode to enable IDAC voltage regulation function.
5. Uboot USAGE INTRODUCTION¶
Currently, IDAC driver is not implemented under uboot.
6. Kernel USAGE INTRODUCTION¶
The objects of IDAC voltage regulation include Core Power(VDD_CORE),CPU Power(VDD_CPU),IPU Power(VDD_IPU),DSP Power(VDD_DSP) Wait. The voltage regulation objects supported by different platforms may vary. Taking the example of adjusting CPU Power with IDAC on the PCUPID platform, the following will illustrate.
6.1. Configure Kennel Config¶
-
Enable corresponding driver module:
The following configurations need to be selected when compiling the kernel:
Device Drivers ---> [*] Sgs SoC platform drivers ---> [*] SGS Voltage Controller Driver Voltage Regulator Type (IDAC) --->
6.2. Configure DTS¶
The relevant settings for IDAC to control CPU Power are in the cpu_power node in dts. The parameters in the node are as follows:
1. cpu_power {
2. compatible = "sgs,voltage-idac-ctrl";
3. vid_gpio = <PAD_PM_GPIO5>;
4. base_voltage = <1000>;
5. status = "okay";
6. };
The meanings of the attributes in the cpu_power node are as follows:
| Attribute | Desciiption | Set Value | Notes |
|---|---|---|---|
| compatible | Match driver for driver registration | "sgs,voltage-idac-ctrl" | Prohibit modification |
| vid_gpio | GPIO used for configuration | Hardware decision | Prohibit modification |
| base_voltage | Reference voltage (in mV) | Hardware decision | Prohibit modification |
| status | Select whether to enable the node | "okay" or "disabled" | Modify as needed |
The core_power node supports selecting the boot voltage from OPP entries via init-voltage. The parameters in the node are as follows:
1. core_power {
2. regulator-name = "core_power";
3. regulator-min-microvolt = <700000>;
4. regulator-max-microvolt = <1300000>;
5. regulator-ramp-delay = <10>;
6. regulator-always-on;
7. compatible = "sgs,regulator-idac";
8. gpio = <PAD_PM_GPIO4>;
9. base-voltage = <1000000>; // uV
10. sample-resistor = <20000>; // ohm
11. opp0 = <920000 860000 0x0>;
12. opp1 = <970000 900000 0x1>;
13. init-voltage = "opp1";
14. status = "okay";
15. };
The meanings of the attributes in the core_power node are as follows:
| Attribute | Description | Set Value | Notes |
|---|---|---|---|
| compatible | Match driver for driver registration | "sgs,regulator-idac" | Prohibit modification |
| regulator-* | Standard regulator properties (name, voltage range, ramp delay, etc.) | Hardware decision | Refer to kernel regulator documentation |
| gpio | GPIO used for IDAC control | Hardware decision | Prohibit modification |
| base-voltage | Reference voltage (in uV) | Hardware decision | Prohibit modification |
| sample-resistor | Sample resistor value (in ohm) | Hardware decision | Prohibit modification |
opp<name> |
OPP entries for the boot voltage | Provided by SGS | Prohibit modification |
| init-voltage | Initial voltage applied at boot | OPP property name string (e.g. "opp1"), or a fixed u32 value (in uV) | Selects the OPP entry applied at boot |
| status | Select whether to enable the node | "okay" or "disabled" | Modify as needed |
When init-voltage is an OPP property name, the driver applies the voltage of that OPP entry at boot; when it is a u32 value, that fixed voltage (in uV) is applied at boot. If init-voltage is not configured, the driver does not apply any initial voltage at boot.
6.3. Configure Padmux¶
NA
6.4. Module Usage Introduction¶
6.4.1. SYSFS Usage method¶
Using sysfs to query/modify CPU power in the kernel, the instructions are as follows:
-
CPU Power
Dump current CPU power
cat /sys/devices/system/voltage/cpu_power/voltage_current 1070 VOLTAGE_DEMANDER_INIT - VOLTAGE_DEMANDER_CPUFREQ 1070 VOLTAGE_DEMANDER_TEMPERATURE - VOLTAGE_DEMANDER_USER -Query available cpu power
cat /sys/devices/system/voltage/cpu_power/voltage_available Vmin(mV) Vmax(mV) 700 1300Set cpu power to 900mV
echo 900 > /sys/devices/system/voltage/cpu_power/voltage_current
6.4.2. ioctl Usage method¶
N/A
6.5. Sample Code¶
N/A
7. API Reference¶
This functional module provides the following interfaces:
| Parameter Name | Description |
|---|---|
| set_core_voltage | set voltage |
| get_core_voltage | get voltage |
7.1. set_core_voltage¶
-
Function
Set voltage
-
Grammar
int set_core_voltage(const char *name, VOLTAGE_DEMANDER_E demander, u32 mV) -
Parameter
Parameter Name Description name The name of the object that needs to be setting,such as ore_power,cpu_power,ipu_power demander Requester mV Voltage value (unit: mv) -
Return value
Return value Description 0 Successful other Fail
7.2. get_core_voltage¶
-
Function
Get voltage
-
Grammar
int get_core_voltage(const char *name, u32 *mV) -
Parameter
Parameter Name Description name The name of the object to be queried, such as core_power,cpu_power,ipu_power mV The voltage value retrieved is retained in this variable -
Return value
Return value Description 0 Successful other Fail
8. FAQ¶
NA