IMX8mp Battery Charging Issue with Bq25790

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

IMX8mp Battery Charging Issue with Bq25790

527 Views
MJD
Contributor II

Hi 
I am facing issue when i give power supply to my custom board which connected with battery charger Bq25790 with 1s Cell, i don't  see this issue when running over battery.

[ 274.978746] cpu cpu0: Failed to set regulator voltages: -11
[ 274.984343] cpufreq: __target_index: Failed to change cpu frequency: -11
[ 274.991899] cpu cpu0: _set_opp_voltage: failed to set voltage (1000000 1000000 1000000 mV): -11
[ 275.000637] cpu cpu0: Failed to set regulator voltages: -11
[ 275.006231] cpufreq: __target_index: Failed to change cpu frequency: -11
[ 275.013960] cpu cpu0: _set_opp_voltage: failed to set voltage (1000000 1000000 1000000 mV): -11
[ 275.022720] cpu cpu0: Failed to set regulator voltages: -11
[ 275.028317] cpufreq: __target_index: Failed to change cpu frequency: -11
[ 275.035910] cpu cpu0: _set_opp_voltage: failed to set voltage (1000000 1000000 1000000 mV): -11
[ 275.044643] cpu cpu0: Failed to set regulator voltages: -11
[ 275.050246] cpufreq: __target_index: Failed to change cpu frequency: -11

Bellow or the logs when connected over power supply 
root@imx8mp-lpddr4-evk:~# dmesg | grep "bq257*"
[ 7.896842] bq25790-charger 0-006b: Line 998: Watchdog timer: 2000
[ 7.913245] bq25790-charger 0-006b: Line 1007: Input voltage limit: 4500000
[ 7.921967] bq25790-charger 0-006b: Line 1015: Input current limit: 1500000
[ 8.163239] bq25790-charger 0-006b: Line 907: Starting hardware initialization
[ 8.174665] bq25790-charger 0-006b: Line 922: Watchdog timer value: 0
[ 8.182063] bq25790-charger 0-006b: Line 941: Setting charge current: 2000000
[ 8.208616] bq25790-charger 0-006b: Line 948: Setting precharge current: 160000
[ 8.219543] bq25790-charger 0-006b: Line 956: Setting charge voltage: 4200000
[ 8.233371] bq25790-charger 0-006b: Line 963: Setting termination current: 200000
[ 8.245792] bq25790-charger 0-006b: Line 285: bq25790_set_term_curr: term_current = 200000
[ 8.259198] bq25790-charger 0-006b: Line 294: bq25790_set_term_curr: reg_val = 5
[ 8.269509] bq25790-charger 0-006b: Line 982: Hardware initialization completed successfully
root@imx8mp-lpddr4-evk:~# i2cdump -y -f 0 0x6b
No size specified (using byte-data access)
0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
00: 04 XX a4 00 c8 2c 00 8f d7 XX XX XX XX XX XX XX ?X?.?,.??XXXXXXX
10: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XXXXXXXXXXXXXXXX
20: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XXXXXXXXXXXXXXXX
30: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XXXXXXXXXXXXXXXX
40: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XXXXXXXXXXXXXXXX
50: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XXXXXXXXXXXXXXXX
60: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XXXXXXXXXXXXXXXX
70: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XXXXXXXXXXXXXXXX
80: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XXXXXXXXXXXXXXXX
90: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XXXXXXXXXXXXXXXX
a0: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XXXXXXXXXXXXXXXX
b0: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XXXXXXXXXXXXXXXX
c0: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XXXXXXXXXXXXXXXX
d0: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XXXXXXXXXXXXXXXX
e0: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XXXXXXXXXXXXXXXX
f0: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XXXXXXXXXXXXXXXX
root@imx8mp-lpddr4-evk:~#

Bellow or the inputs when running only with battery 
root@imx8mp-lpddr4-evk:~# dmesg | grep "bq257*"
[ 7.896842] bq25790-charger 0-006b: Line 998: Watchdog timer: 2000
[ 7.913245] bq25790-charger 0-006b: Line 1007: Input voltage limit: 4500000
[ 7.921967] bq25790-charger 0-006b: Line 1015: Input current limit: 1500000
[ 8.163239] bq25790-charger 0-006b: Line 907: Starting hardware initialization
[ 8.174665] bq25790-charger 0-006b: Line 922: Watchdog timer value: 0
[ 8.182063] bq25790-charger 0-006b: Line 941: Setting charge current: 2000000
[ 8.208616] bq25790-charger 0-006b: Line 948: Setting precharge current: 160000
[ 8.219543] bq25790-charger 0-006b: Line 956: Setting charge voltage: 4200000
[ 8.233371] bq25790-charger 0-006b: Line 963: Setting termination current: 200000
[ 8.245792] bq25790-charger 0-006b: Line 285: bq25790_set_term_curr: term_current = 200000
[ 8.259198] bq25790-charger 0-006b: Line 294: bq25790_set_term_curr: reg_val = 5
[ 8.269509] bq25790-charger 0-006b: Line 982: Hardware initialization completed successfully
root@imx8mp-lpddr4-evk:~# i2cdump -y -f 0 0x6b
No size specified (using byte-data access)
0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
00: 04 01 a4 00 c8 2c 00 8f c4 05 23 00 dc 4b 3d a2 ???.?,.???#.?K=?
10: 80 40 00 01 16 aa c0 7a d4 00 8f 0f 0a 01 00 08 ?@.????z?.????.?
20: 00 00 8f 10 40 08 00 00 00 00 00 00 00 00 b0 00 ..??@?........?.
30: 00 02 24 00 00 14 66 14 4e 14 60 0e 58 0f 46 03 .?$..?f?N?`?X?F?
40: 5d 00 3f 00 00 00 00 00 08 ff ff ff ff ff ff ff ].?.....?.......
50: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
60: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
70: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
90: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
a0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
b0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
c0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
d0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
e0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
f0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
root@imx8mp-lpddr4-evk:~#

I am attaching my DTS for verification 

&i2c1 {
clock-frequency = <400000>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_i2c1>;
status = "okay";
 
bat: battery {
  compatible = "simple-battery";
  constant-charge-current-max-microamp = <2000000>;
  constant-charge-voltage-max-microvolt = <4200000>;
precharge-current-microamp = <160000>;
charge-term-current-microamp = <200000>;
};
 
  bq25790: charger@6b {
compatible = "ti,bq25790";
reg = <0x6b>;
interrupt-parent = <&gpio1>;
interrupts = <8 IRQ_TYPE_EDGE_FALLING>;
ti,watchdog-timeout-ms = <2000>;
input-current-limit-microamp = <1500000>;
input-voltage-limit-microvolt = <4500000>;
monitored-battery = <&bat>;
};
 
pmic@25 {
compatible = "nxp,pca9450c";
reg = <0x25>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_pmic>;
interrupt-parent = <&gpio1>;
interrupts = IRQ_TYPE_LEVEL_LOW>;
 
regulators {
buck1: BUCK1 {
regulator-name = "BUCK1";
regulator-min-microvolt = <600000>;
regulator-max-microvolt = <2187500>;
regulator-boot-on;
regulator-always-on;
regulator-ramp-delay = <3125>;
};
 
buck2: BUCK2 {
regulator-name = "BUCK2";
regulator-min-microvolt = <600000>;
regulator-max-microvolt = <2187500>;
regulator-boot-on;
regulator-always-on;
regulator-ramp-delay = <3125>;
nxp,dvs-run-voltage = <950000>;
nxp,dvs-standby-voltage = <850000>;
};
 
buck4: BUCK4{
regulator-name = "BUCK4";
regulator-min-microvolt = <600000>;
regulator-max-microvolt = <3400000>;
regulator-boot-on;
regulator-always-on;
};
 
buck5: BUCK5{
regulator-name = "BUCK5";
regulator-min-microvolt = <600000>;
regulator-max-microvolt = <3400000>;
regulator-boot-on;
regulator-always-on;
};
 
buck6: BUCK6 {
regulator-name = "BUCK6";
regulator-min-microvolt = <600000>;
regulator-max-microvolt = <3400000>;
regulator-boot-on;
regulator-always-on;
};
 
ldo1: LDO1 {
regulator-name = "LDO1";
regulator-min-microvolt = <1600000>;
regulator-max-microvolt = <3300000>;
regulator-boot-on;
regulator-always-on;
};
 
ldo2: LDO2 {
regulator-name = "LDO2";
regulator-min-microvolt = <800000>;
regulator-max-microvolt = <1150000>;
regulator-boot-on;
regulator-always-on;
};
 
ldo3: LDO3 {
regulator-name = "LDO3";
regulator-min-microvolt = <800000>;
regulator-max-microvolt = <3300000>;
regulator-boot-on;
regulator-always-on;
};
 
ldo4: LDO4 {
regulator-name = "LDO4";
regulator-min-microvolt = <800000>;
regulator-max-microvolt = <3300000>;
regulator-boot-on;
regulator-always-on;
};
 
ldo5: LDO5 {
regulator-name = "LDO5";
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <3300000>;
regulator-boot-on;
regulator-always-on;
};
};
};
};



Is there any changes need to be done with DTS?
As i have communicated with TI Guys, they are saying there is no issue with driver or register settings.


0 Kudos
Reply
5 Replies

492 Views
JorgeCas
NXP TechSupport
NXP TechSupport

Hello,

Do you get a kernel panic, or the board does not boot?

Best regards.

0 Kudos
Reply

474 Views
MJD
Contributor II

Hi @JorgeCas

Board is able to boot, There is no kernel panic, but I get this log again and again at that time I can’t read bq25792 driver registor values 

0 Kudos
Reply

406 Views
JorgeCas
NXP TechSupport
NXP TechSupport

Hello,

Got it, thank you for the information. As is mentioned in logs, the device is not able to set the frequency because the voltage of the necessary power supplies are not changed to the voltage value defined in device tree scripts (DTS).

Please make sure that your maximum frequency is 1.3GHz.

2.5.3 CPU Frequency Scaling (CPUFREQ)

Best regards.

0 Kudos
Reply

357 Views
MJD
Contributor II

Hi jorgecas

Can you guide me where i can set this, to resolve this issue.

0 Kudos
Reply

354 Views
JorgeCas
NXP TechSupport
NXP TechSupport

Hello,

Please take a look in the next post:

How to reduce the CPU Frequency on iMX8M - NXP Community

Best regards.

0 Kudos
Reply