Fizz: Remove BJ adapter configuration

This patch removes BJ adapter configuration, which has been moved
to the EC.

BUG=b:109762580
CQ-DEPEND=CL:1089328
BRANCH=none
TEST=Verify BJ adapter is set expectedly on Teemo.

Change-Id: I3041b984e7f02624b94ba2713b084d001fa155f9
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1089370
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Commit-Queue: Daisuke Nojiri <dnojiri@chromium.org>
Tested-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-on: https://review.coreboot.org/26965
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Daisuke Nojiri 2018-06-06 11:13:09 -07:00 committed by Patrick Georgi
parent 575f1d7784
commit abe73975f0
1 changed files with 0 additions and 74 deletions

View File

@ -47,47 +47,6 @@
*/
#define SET_PSYSPL2(w) (9 * (w) / 10)
#define OEM_ID_COUNT 3
#define SKU_ID_COUNT 7
/* List of BJ adapters shipped with Fizz or its variants */
enum bj_adapter {
BJ_UNKNOWN,
BJ_65W_19V,
BJ_90W_19V,
BJ_65W_19P5V,
BJ_90W_19P5V,
BJ_COUNT,
};
/* BJ adapter specs */
static const struct {
uint16_t current_lim; /* in mA */
uint16_t voltage_lim; /* in mV */
} bj_adapters[] = {
[BJ_65W_19V] = { .current_lim = 3420, .voltage_lim = 19000 },
[BJ_90W_19V] = { .current_lim = 4740, .voltage_lim = 19000 },
[BJ_65W_19P5V] = { .current_lim = 3330, .voltage_lim = 19500 },
[BJ_90W_19P5V] = { .current_lim = 4620, .voltage_lim = 19500 },
};
/*
* The table showing which device is shipped with which BJ adapter.
*
* | SKU0 SKU1 ...
* OEM0 | AdapterX AdapterZ ...
* OEM1 | AdapterY ...
* ... |
*/
static const enum bj_adapter bj_adapter_table[OEM_ID_COUNT][SKU_ID_COUNT] = {
{ BJ_65W_19P5V, BJ_65W_19P5V, BJ_90W_19P5V, BJ_90W_19P5V,
BJ_90W_19P5V, BJ_90W_19P5V, BJ_65W_19P5V },
{ BJ_65W_19V, BJ_65W_19V, BJ_UNKNOWN, BJ_UNKNOWN,
BJ_90W_19V, BJ_90W_19V, BJ_UNKNOWN },
{ BJ_65W_19V, BJ_65W_19V, BJ_90W_19V, BJ_90W_19V,
BJ_90W_19V, BJ_90W_19V, BJ_65W_19V },
};
static uint8_t read_sku_id_from_gpio(void)
{
const gpio_t sku_id_gpios[] = {
@ -260,37 +219,6 @@ static unsigned long mainboard_write_acpi_tables(
return end_addr;
}
/*
* Set max current and voltage for a barrel jack adapter based on {OEM, SKU}.
* If this fails, the limit will remain unchanged = default values, which make
* the system run under safe but under-rated power.
* If a BJ adapter isn't plugged, this is a no-op.
*/
static void set_bj_adapter_limit(void)
{
uint8_t oem = board_oem_id();
uint8_t sku = board_sku_id();
enum bj_adapter bj;
printk(BIOS_INFO, "OEM:%u(0x%x) SKU:%u(0x%x)\n", oem, oem, sku, sku);
if (oem >= OEM_ID_COUNT || sku >= SKU_ID_COUNT) {
printk(BIOS_ERR, "Unrecognized OEM or SKU\n");
return;
}
bj = bj_adapter_table[oem][sku];
if (bj <= BJ_UNKNOWN || BJ_COUNT <= bj) {
printk(BIOS_ERR, "Invalid BJ adapter ID: %d\n", bj);
return;
}
printk(BIOS_INFO, "Setting BJ limit: %dmA/%dmV\n",
bj_adapters[bj].current_lim, bj_adapters[bj].voltage_lim);
if (google_chromeec_override_dedicated_charger_limit(
bj_adapters[bj].current_lim,
bj_adapters[bj].voltage_lim))
printk(BIOS_ERR, "Failed to set BJ limit\n");
}
static void mainboard_enable(struct device *dev)
{
struct device *root = SA_DEV_ROOT;
@ -298,8 +226,6 @@ static void mainboard_enable(struct device *dev)
mainboard_set_power_limits(conf);
set_bj_adapter_limit();
dev->ops->init = mainboard_init;
dev->ops->acpi_inject_dsdt_generator = chromeos_dsdt_generator;
dev->ops->write_acpi_tables = mainboard_write_acpi_tables;