- LBC supervisor v1..v4 (linux/patches/b10b3-lbc-supervisor-v3.patch + b10/b10b3/lbc-v3-to-v4-fault-clamp.diff): CHARGING 4.20 V/450 mA -> HOLD 4.05 V after 60 min CV -> battery -> new cycle on USB insert; FAULT = VDD_MAX 4.00 V clamp - RAM tests C/B/D/D2/D3/D4 (safety timer only ends fast charge), B10B-4 actuator audit (VDD_MAX works, USB_SUSP does not), B10B-5 FAULT clamp regression, production run, warm reboot via PON reboot reason - cache = B10B-5 c3732515 (HW EDL write, readback + full partition verify), class-A persistent validation - test-only hooks/images are not part of the production kernel; images with the AP PSK are not published
18 lines
1.6 KiB
Bash
18 lines
1.6 KiB
Bash
#!/bin/sh
|
|
# B10B-2 charger observation: N samples, P s apart. Reads only (IIO, power_supply sysfs, regmap debugfs, thermal).
|
|
# Prints ALERT if VADC VBAT > 4.22 V or PMIC die temp > 60 C (operator then removes USB; the script never writes).
|
|
N=${1:-120}; P=${2:-30}
|
|
grep -q " /sys/kernel/debug " /proc/mounts || mount -t debugfs debugfs /sys/kernel/debug
|
|
R=/sys/kernel/debug/regmap/0-00/registers
|
|
rd() { dd if=$R bs=9 skip=$(($1)) count=$2 2>/dev/null | cut -d' ' -f2 | tr '\n' ' '; }
|
|
D=/sys/bus/iio/devices/iio:device0; B=/sys/class/power_supply/pm8916-bms-vm; C=$(ls -d /sys/class/power_supply/*lbc* 2>/dev/null | head -1)
|
|
echo "MON-START charger=$C props: $(ls $C 2>/dev/null | tr '\n' ' ')"
|
|
i=1
|
|
while [ $i -le $N ]; do
|
|
r6=$(cat $D/in_voltage6_raw); r9=$(cat $D/in_voltage9_raw); r10=$(cat $D/in_voltage10_raw); pt=$(cat $D/in_temp8_input)
|
|
vb=$(( (625000 + (r6 - r9) * 625000 / (r10 - r9)) * 3 ))
|
|
a=""; [ $vb -gt 4220000 ] && a="$a ALERT-VBAT"; [ $pt -gt 60000 ] && a="$a ALERT-TEMP"
|
|
echo "M $i $(date -u +%T) up=$(cut -d' ' -f1 /proc/uptime) vbat=$vb r6=$r6 r9=$r9 r10=$r10 vph=$(cat $D/in_voltage7_input) usbin=$(cat $D/in_voltage0_input) bms_v=$(cat $B/voltage_now) bms_st=$(cat $B/status) fifo=$(rd 0x40c0 4) st=$(rd 0x1009 3) crt=$(rd 0x1010 1) brt=$(rd 0x1210 1) urt=$(rd 0x1310 1) usb=$(rd 0x1308 2) vdd=$(rd 0x1040 2) ibat=$(rd 0x1044 2) ctrl=$(rd 0x1049 1) tchg=$(rd 0x1060 2) bd=$(rd 0x1642 1) online=$(cat $C/online 2>&1) ccc=$(cat $C/constant_charge_current 2>&1) ccv=$(cat $C/constant_charge_voltage_max 2>&1) pmt=$pt cpu=$(cat /sys/class/thermal/thermal_zone4/temp)$a"
|
|
i=$((i + 1)); [ $i -le $N ] && sleep $P
|
|
done
|
|
echo MON-END
|