Where to update regulator register with initial voltage set by HW

From: Waldemar Rymarkiewicz
Date: Thu Jun 29 2017 - 03:19:09 EST


Hi,

I do a power regulator driver and I have faced an issue with an
initial voltage value set (or rather not set) in regulator register.

Initially, on boot, the voltage is set by HW (sensing resistors). When
OS starts and the reg driver registers regulator with the specific
constraints uV_min and uV_max, regulator core will apply uV_min or
uV_max if current (in regulator register) setting is not in the range.
Normally, by default register holds min(voltage_table) which is
different than the value set by HW (sensing resistors).

So, it results in uV_min set by regulator core which is not expected
as I start my board with max cpu freq which needs relevant voltage
(the power reg supplies CPU) in order CPU to be stable.

I believe this issue is not specific just to my HW, so wondering where
in the system the actual voltage set by HW is typically also put into
the register, so probing regulator we can read the real value?
bootloader seems to be a good candidate? platform code?

Will appreciate any hints.

Thanks
/Waldek