IDAC USER GUIDE¶
REVISION HISTORY¶
| Revision No. | Description |
Date |
|---|---|---|
| 1.0 | 05/08/2025 |
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¶
There are two voltage regulation methods: VID and IDAC. VID 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¶
Using the set command in uboot to modify the power scheme. The command usage description is as follows:
Usage:
set overdrive 0 - change power scheme to 'Low Drive - LD'
set overdrive 1 - change power scheme to 'None Overdrive - NOD'
set overdrive 2 - change power scheme to 'Over Drive - OD'
set overdrive 3 - change power scheme to 'Turn Off'
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 IFORD 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 ---> [*] Sstar SoC platform drivers ---> [*] Sstar Voltage IDAC Control
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 = "sstar,voltage-idac-ctrl";
3. vid_gpio = <PAD_PM_GPIO5>;
4. base_voltage = <900>;
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 | "sstar,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 |
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