How to control PF100 PMIC in imx6q-cpufreq.c for LDO bypass

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to control PF100 PMIC in imx6q-cpufreq.c for LDO bypass

Jump to solution
3,109 Views
michaelguntli
Contributor IV

In order to take full advantage of the LDO bypass mode (How to Enable LDO Bypass Based on i.MX6 Android ICS), I would like to control the VDD_ARM and VDD_SOC through the PF100 regulator in the cpufreq driver.

The table lists the operation setpoints for LDO bypass mode: 0.925V for up to 396MHz, 1.150V up to 792MHz.

pastedImage_1.png

The current driver only controls the internal LDO, thus only works for "LDO enabled" mode.

This code gets the LDO regulators here:

      linux/imx6q-cpufreq.c at master · torvalds/linux · GitHub 

pastedImage_3.png

Question:

How can I get the actual PF100 voltage regulator in code? regulator_get(cpu_dev, "sw1ab")?

Why does the cpufreq driver use devm_regulator_get_optional() and not regulator_get()?

Where do I find the name of PF0100 SW1AB? The i.MX6 Linux Reference Chapter 23 explains the PF100 Regulator driver, and chapter 23.3.1 describes the regulator APIs. In the code I found the following table:

      linux/pfuze100-regulator.c at master · torvalds/linux · GitHub 

pastedImage_5.png

When I print the regulator names, they are listed in this exact order:

root@h5:/sys/class/regulator # cat regulator.0/name
regulator-dummy
root@h5:/sys/class/regulator # cat regulator.1/name
vdd1p1
root@h5:/sys/class/regulator # cat regulator.2/name
vdd3p0
root@h5:/sys/class/regulator # cat regulator.3/name
vdd2p5
root@h5:/sys/class/regulator # cat regulator.4/name
vddarm
root@h5:/sys/class/regulator # cat regulator.5/name
vddpu
root@h5:/sys/class/regulator # cat regulator.6/name
vddsoc
root@h5:/sys/class/regulator # cat regulator.7/name
usb_otg_vbus
root@h5:/sys/class/regulator # cat regulator.8/name
usb_h1_vbus
root@h5:/sys/class/regulator # cat regulator.9/name
SW1AB
root@h5:/sys/class/regulator # cat regulator.10/name
SW1C
Labels (4)
Tags (2)
1 Solution
1,976 Views
michaelguntli
Contributor IV

Hi Igor

Yes I know that, but I think I understood "the magic" now: In the DTS I can configure which regulator should be used.

As an example, imx6sx-sdb.dts uses sw1a of PFUZE0100 for arm-supply, which in turn the cpufreq driver will use to regulate the voltage of the ARM. Is this assumption correct?

linux-imx.git - i.MX Linux Kernel 

pastedImage_1.png

View solution in original post

2 Replies
1,976 Views
igorpadykov
NXP Employee
NXP Employee

Hi Michael

ldo bypass is used by default in latest nxp bsps, one can look at "ldo-bypass" property in dts files

linux-imx.git - i.MX Linux Kernel 

for using internal LDO special imx6q-sabresd-ldo.dts is used. Cpu freq driver

is described in attached Linux Manual sect.2.3.3 CPU Frequency Scaling (CPUFREQ).

Full documentation can be found in

https://www.nxp.com/webapp/Download?colCode=L4.9.11_1.0.0_LINUX_DOCS 

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

1,977 Views
michaelguntli
Contributor IV

Hi Igor

Yes I know that, but I think I understood "the magic" now: In the DTS I can configure which regulator should be used.

As an example, imx6sx-sdb.dts uses sw1a of PFUZE0100 for arm-supply, which in turn the cpufreq driver will use to regulate the voltage of the ARM. Is this assumption correct?

linux-imx.git - i.MX Linux Kernel 

pastedImage_1.png