Harry Pan has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39850 )
Change subject: [WIP]/mb/google/hatch/vr/puff: Add psys_pmax calculation ......................................................................
Patch Set 4: Code-Review+1
Verified on BJ90W, TC65W, and TC45W, they all works well (mostly likely).
That said, I noticed there is a corner case in cold boot (1st plug or ectool reboot_ec cold) that the API (google_chromeec_get_usb_pd_power_info) returns type in 9 (USB_CHG_TYPE_UNKNOWN) [1]; this is happening in all adapters I tested (BJ90W/TC65W/TC45W); when we hit such case, the psys from MSR would incorrectly increasing against the external gauge.
[1] firmware log: HP: rv=0 type=9 psys_pmax=182