uzbek-plus/b10/b10b3/b10b3t-discharge.sh
q 58dcb3d121 B10: battery charging — PM8916 LBC supervisor v4 (CHARGE/HOLD, FAULT safe clamp to 4.00 V) and persistent B10B-5 cache
- 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
2026-10-04 19:00:27 +03:00

18 lines
1.1 KiB
Bash

#!/bin/sh
# Pre-t1 discharge (board on battery): N x `yes`, stop when VADC VBAT <= VMIN uV (3 samples in a row), PMIC > 55 C, or after MAX s. Writes /tmp only.
N=${1:-4}; MAX=${2:-5400}; VMIN=${3:-3880000}; L=/tmp/b10b3t-dis.log; low=0; D=/sys/bus/iio/devices/iio:device0
trap '' HUP
C=/sys/class/power_supply/pm8916-lbc-chgr/online; echo "WAIT-USB-OFF up=$(cut -d" " -f1 /proc/uptime)" >> $L; while [ "$(cat $C)" != 0 ]; do sleep 2; done; echo "USB-OFF up=$(cut -d" " -f1 /proc/uptime)" >> $L
t0=$(cut -d. -f1 /proc/uptime); P=""
for i in $(seq 1 $N); do yes > /dev/null & P="$P $!"; done
echo "LOAD-START up=$t0 n=$N pids=$P" >> $L
why=timeout
while :; do
t=$(cut -d. -f1 /proc/uptime); vb=$(cat $D/in_voltage6_input); pt=$(cat $D/in_temp8_input)
echo "L up=$t vbat6=$vb pmt=$pt" >> $L
[ "$pt" -gt 55000 ] && { why=pmic-55C; break; }
if [ "$vb" -le $VMIN ]; then low=$((low + 1)); else low=0; fi; [ $low -ge 3 ] && { why=vbat-reached-VMIN; break; }
[ $((t - t0)) -ge $MAX ] && break
sleep 10
done
kill $P; echo "LOAD-STOP up=$(cut -d' ' -f1 /proc/uptime) reason=$why" >> $L