Repository navigation
Conversation
…y dtsi tools/gen-gauge-overlay.py now reads dts/zuma-husky-battery-data.dtsi from Google's shusky device tree repository (GPL-2.0-only, branch android-gs-shusky-6.1-android16), where the model table and the parameters are already u16 words, instead of a decompiled stock dtbo. The decompiled form (u32 cells and a byte list) still parses. The overlays generated from a fresh fetch of the public file matched gauge-model-atl.dtso and gauge-model.dtso byte for byte (cmp and diff, 2026-11-01); both are then regenerated so their header names the public file, and with comments stripped they are identical to the files that booted. A --compare mode reads every model node of the maxim,config block (// and /* */ comments stripped) and prints each node's DesignCap and table ends, then per overlay how many of the 48 table words and 27 parameter words differ, naming the parameters and the equal table words; a length mismatch, wrong lengths and an odd byte list are reported as such. BATTERY-NOTES.md points at the public file instead of the dtbo and gets a section 5.7 with the result: the file has default-a1-0k, atl-a1-1k and cos-a1-2k (no default-fake-batt, which husky's ov8 has, and no lsn-a1-3k, which only other boards' entries of the stock dtbo have); ATL is identical to gauge-model-atl.dtso, COS differs from it in 30 table words and 7 parameters, the generic model in all 48 and 16. Asked for by the review of derekross#249. Tested: tests/device-overlays (dtc compile skipped, no dtc here), tools/pr-check origin/main, the script's own regeneration and compare runs. Nothing booted on a phone: the overlays' properties did not change.
|
@Somnius thank you, this is exactly what I hoped for after #249. I checked it here against my own copy of
Thanks also for dropping the third-party image from section 2. Now anyone can regenerate the overlays from a public file under a clear licence. One small addition I'll make when I merge, unless you'd rather push it: the overlays now carry data from a file whose header says "Copyright 2022 Google LLC", so I'll add a line with that notice to the generator's header template and to both overlays. It's the same line in all three, so regenerating stays byte-identical (I've checked that too). This touches the same part of |
|
Landed on main as 549e3c9 (squashed, authored by you), with the edits I described in my last comment. Thank you. |
…y dtsi (derekross#279) The husky gauge overlays (gauge-model.dtso, gauge-model-atl.dtso) are now generated from Google's GPL-2.0 zuma-husky-battery-data.dtsi by gen-gauge-overlay.py, instead of from a decompiled factory image. The regenerated overlays are property-for-property identical to the previous ones, and --compare matches the published table. BATTERY-NOTES cites the public source. Maintainer edit at merge: Google's copyright line travels with the data, in the generator's template and in both overlays (regenerating stays byte-identical). Closes derekross#279 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@derekross this is the follow-up you asked for on #249.
tools/gen-gauge-overlay.pynow reads Google's publicdts/zuma-husky-battery-data.dtsi(GPL-2.0-only,kernel/devices/google/shusky, branchandroid-gs-shusky-6.1-android16) directly, where the table and the parameters are already u16 words. The old decompiled-dtbo form still parses. BATTERY-NOTES.md points at the public file now, and the generated overlays' header comment cites it.A new
--comparemode reads every model node in the file and says, per overlay, how many of the 48 table words and 27 parameter words differ, and names the parameters. The file has three nodes:default-a1-0k,atl-a1-1kandcos-a1-2k. ATL is identical togauge-model-atl.dtso. COS differs from it in 30 table words and 7 parameters, the generic model in all 48 and 16. The table is section 5.7 of BATTERY-NOTES.md.lsn-a1-3k, which my notes mentioned, isn't in this file: it is in other boards' overlays of the stock dtbo (ov9 to ov18 here), and the notes now say so.What I ran: regenerating both overlays from a fresh download of the file gives the same properties as the files in the tree (I regenerated them with the new header comment, so the two
.dtsofiles change in comments only; I checked with the comments stripped).tests/device-overlayspasses, but its dtc part skipped because I have no dtc here, andtools/pr-check origin/mainis all ok. Nothing booted on a phone, since no overlay property changed.I didn't put the #250 wrap in here, as you said it goes into the next husky package change.