diff options
author | Martin Roth <martinroth@chromium.org> | 2020-02-09 19:16:49 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-02-10 18:24:47 +0000 |
commit | 16e8184204311556dfcc3149270f437ae4cf1198 (patch) | |
tree | 6406bb72cab329b824ca72ab89d6f02b9454e1be /board/ezkinil/board.c | |
parent | 495146176d87c0f05a326571731e32dfd2602a4d (diff) | |
download | chrome-ec-16e8184204311556dfcc3149270f437ae4cf1198.tar.gz |
ezkinil: Initial EC image
Create the initial EC image for the ezkinil variant of the
trembyle baseboard by copying the baseboard EC files into a new
directory named for the variant.
(Auto-Generated by create_initial_ec_image.sh version 1.0.1).
BUG=b:148649274
BRANCH=none
TEST=make BOARD=ezkinil
Change-Id: I1dd16dd483d04d77a2ff053a67997d2d5933a49c
Signed-off-by: Martin Roth <martinroth@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2046448
Tested-by: Martin Roth <martinroth@google.com>
Auto-Submit: Martin Roth <martinroth@google.com>
Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
Commit-Queue: Paul Fagerburg <pfagerburg@chromium.org>
Diffstat (limited to 'board/ezkinil/board.c')
-rw-r--r-- | board/ezkinil/board.c | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/board/ezkinil/board.c b/board/ezkinil/board.c new file mode 100644 index 0000000000..a519a0010e --- /dev/null +++ b/board/ezkinil/board.c @@ -0,0 +1,43 @@ +/* Copyright 2020 The Chromium OS Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/* Trembyle board configuration */ + +#include "button.h" +#include "driver/accelgyro_bmi160.h" +#include "extpower.h" +#include "gpio.h" +#include "lid_switch.h" +#include "power.h" +#include "power_button.h" +#include "switch.h" +#include "system.h" +#include "usb_charge.h" + +#include "gpio_list.h" + +/* These GPIOs moved. Temporarily detect and support the V0 HW. */ +enum gpio_signal GPIO_PCH_PWRBTN_L = GPIO_EC_FCH_PWR_BTN_L; +enum gpio_signal GPIO_PCH_SYS_PWROK = GPIO_EC_FCH_PWROK; + +void board_update_sensor_config_from_sku(void) +{ + int data; + + /* + * If the CBI EEPROM is found on the battery I2C port then we are + * running on V0 HW so re-map the GPIOs that moved. + */ + if ((system_get_sku_id() == 0x7fffffff) + && (i2c_read8(I2C_PORT_BATTERY, I2C_ADDR_EEPROM_FLAGS, 0, &data) + == EC_SUCCESS)) { + ccprints("V0 HW detected"); + GPIO_PCH_PWRBTN_L = GPIO_EC_FCH_PWR_BTN_L_V0; + GPIO_PCH_SYS_PWROK = GPIO_EC_FCH_PWROK_V0; + } + + /* Enable Gyro interrupts */ + gpio_enable_interrupt(GPIO_6AXIS_INT_L); +} |