google/fizz: Adjust PL2 and PsysPl2 values for power loss
Set PsysPl2 values to 90% of max adapter power for all types of adapters (typeC and barrel jack) to account for a 10% power loss from the adapter to the soc. BUG=b:71594855 BRANCH=None TEST=reboot device and make sure Pl2 and PsysPl2 MSRs are properly set with iotools rdmsr command on both U42 and U22 skus with both typeC and barrel jack power adapters. Change-Id: I8425c6d4d669449eccb9324ff58ff6d1662c5c43 Signed-off-by: Shelley Chen <shchen@chromium.org> Reviewed-on: https://review.coreboot.org/23457 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-by: Furquan Shaikh <furquan@google.com>
This commit is contained in:
parent
339e771055
commit
e87d3cdf59
|
@ -43,7 +43,7 @@
|
||||||
* For type-C chargers, set PL2 to 90% of max power to account for
|
* For type-C chargers, set PL2 to 90% of max power to account for
|
||||||
* cable loss and FET Rdson loss in the path from the source.
|
* cable loss and FET Rdson loss in the path from the source.
|
||||||
*/
|
*/
|
||||||
#define GET_TYPEC_PL2(w) (9 * (w) / 10)
|
#define SET_PSYSPL2(w) (9 * (w) / 10)
|
||||||
|
|
||||||
#define OEM_ID_COUNT 3
|
#define OEM_ID_COUNT 3
|
||||||
#define SKU_ID_COUNT 7
|
#define SKU_ID_COUNT 7
|
||||||
|
@ -108,17 +108,26 @@ static uint8_t board_sku_id(void)
|
||||||
*
|
*
|
||||||
* Set Pl2 and SysPl2 values based on detected charger.
|
* Set Pl2 and SysPl2 values based on detected charger.
|
||||||
* If detected barrel jack, use values below based on SKU.
|
* If detected barrel jack, use values below based on SKU.
|
||||||
* +-------------+-----+---------+-------------------+
|
* +-------------+-----+---------+-----+------+------+
|
||||||
* | sku_id | PL2 | PsysPL2 | Pmax (Prop = 48W) |
|
* | sku_id | PL2 | PsysPL2 | PL4 | Pmax | Prop |
|
||||||
* +-------------+-----+---------+-------------------+
|
* +-------------+-----+---------+-----+------+------+
|
||||||
* | i7 U42 | 44 | 90 | 119 |
|
* | i7 U42 | 44 | 81 | 71 | 120 | 48 |
|
||||||
* | i5 U42 | 44 | 90 | 119 |
|
* | i5 U42 | 44 | 81 | 71 | 120 | 48 |
|
||||||
* | i3 U42 | 44 | 90 | 119 |
|
* | i3 U42 | 44 | 81 | 71 | 120 | 48 |
|
||||||
* | i7 U22 | 29 | 65 | 91 |
|
* | i7 U22 | 29 | 58 | 43 | 91 | 48 |
|
||||||
* | i5 U22 | 29 | 65 | 91 |
|
* | i5 U22 | 29 | 58 | 43 | 91 | 48 |
|
||||||
* | i3 U22 | 29 | 65 | 91 |
|
* | i3 U22 | 29 | 58 | 43 | 91 | 48 |
|
||||||
* | celeron U22 | 29 | 65 | 91 |
|
* | celeron U22 | 29 | 58 | 43 | 91 | 48 |
|
||||||
* +-------------+-----+---------+-------------------+
|
* +-------------+-----+---------+-----+------+------+
|
||||||
|
* For USB C charger:
|
||||||
|
* +-------------+-----+---------+-----+------+------+
|
||||||
|
* | Max Power(W)| PL2 | PsysPL2 | PL4 | Pmax | Prop |
|
||||||
|
* +-------------+-----+---------+-----+------+------+
|
||||||
|
* | 60 (U42) | 44 | 54 | 54 | 120 | 48 |
|
||||||
|
* | 60 (U22) | 29 | 54 | 43 | 91 | 48 |
|
||||||
|
* | X (U42) | 44 | .9X | .9X | 120 | 48 |
|
||||||
|
* | X (U22) | 29 | .9X | .9X | 91 | 48 |
|
||||||
|
* +-------------+-----+---------+-----+------+------+
|
||||||
*/
|
*/
|
||||||
static void mainboard_set_power_limits(u32 *pl2_val, u32 *psyspl2_val)
|
static void mainboard_set_power_limits(u32 *pl2_val, u32 *psyspl2_val)
|
||||||
{
|
{
|
||||||
|
@ -131,25 +140,26 @@ static void mainboard_set_power_limits(u32 *pl2_val, u32 *psyspl2_val)
|
||||||
(1 << FIZZ_SKU_ID_I5_U42) |
|
(1 << FIZZ_SKU_ID_I5_U42) |
|
||||||
(1 << FIZZ_SKU_ID_I3_U42);
|
(1 << FIZZ_SKU_ID_I3_U42);
|
||||||
|
|
||||||
|
/* PL2 value is sku-based, no matter what charger we are using */
|
||||||
|
pl2 = FIZZ_PL2_U22;
|
||||||
|
if ((1 << sku) & u42_mask)
|
||||||
|
pl2 = FIZZ_PL2_U42;
|
||||||
|
|
||||||
/* If we can't get charger info or not PD charger, assume barrel jack */
|
/* If we can't get charger info or not PD charger, assume barrel jack */
|
||||||
if (rv != 0 || type != USB_CHG_TYPE_PD) {
|
if (rv != 0 || type != USB_CHG_TYPE_PD) {
|
||||||
/* using the barrel jack, get PL2 based on sku id */
|
/* using the barrel jack, get PsysPL2 based on sku id */
|
||||||
pl2 = FIZZ_PL2_U22;
|
|
||||||
psyspl2 = FIZZ_PSYSPL2_U22;
|
psyspl2 = FIZZ_PSYSPL2_U22;
|
||||||
/* Running a U42 SKU */
|
/* Running a U42 SKU */
|
||||||
if ((1 << sku) & u42_mask) {
|
if ((1 << sku) & u42_mask)
|
||||||
pl2 = FIZZ_PL2_U42;
|
|
||||||
psyspl2 = FIZZ_PSYSPL2_U42;
|
psyspl2 = FIZZ_PSYSPL2_U42;
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
/* Base on max value of adapter */
|
/* Base on max value of adapter */
|
||||||
pl2 = GET_TYPEC_PL2(watts);
|
|
||||||
psyspl2 = watts;
|
psyspl2 = watts;
|
||||||
}
|
}
|
||||||
|
|
||||||
*pl2_val = pl2;
|
*pl2_val = pl2;
|
||||||
*psyspl2_val = psyspl2;
|
/* set psyspl2 to 90% of max adapter power */
|
||||||
|
*psyspl2_val = SET_PSYSPL2(psyspl2);
|
||||||
}
|
}
|
||||||
|
|
||||||
static uint8_t board_oem_id(void)
|
static uint8_t board_oem_id(void)
|
||||||
|
|
Loading…
Reference in New Issue