diff options
author | Zick Wei <zick.wei@quanta.corp-partner.google.com> | 2020-06-18 14:31:04 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-06-20 05:47:22 +0000 |
commit | 36cf95c854f00a6457c85edb97cedf6891cc1f6c (patch) | |
tree | 62457b604491e96439a34cc8f2a7b4f61686de84 /board/morphius | |
parent | dad10f78ae2d127ad3b5471fb580248ee3c87a39 (diff) | |
download | chrome-ec-36cf95c854f00a6457c85edb97cedf6891cc1f6c.tar.gz |
morphius: update gpio's for board version 3
BUG=none
BRANCH=b:150278507
TEST=make buildall
Signed-off-by: Zick Wei <zick.wei@quanta.corp-partner.google.com>
Change-Id: I362e4797e3c59098c2b1b56277ba4771774409e1
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2251136
Reviewed-by: Denis Brockus <dbrockus@chromium.org>
Diffstat (limited to 'board/morphius')
-rw-r--r-- | board/morphius/board.c | 58 | ||||
-rw-r--r-- | board/morphius/gpio.inc | 4 |
2 files changed, 42 insertions, 20 deletions
diff --git a/board/morphius/board.c b/board/morphius/board.c index e78bcc0546..869e86e933 100644 --- a/board/morphius/board.c +++ b/board/morphius/board.c @@ -9,6 +9,7 @@ #include "adc_chip.h" #include "battery_smart.h" #include "button.h" +#include "cros_board_info.h" #include "driver/accelgyro_bmi_common.h" #include "driver/accel_kionix.h" #include "driver/accel_kx022.h" @@ -143,25 +144,6 @@ unsigned int motion_sensor_count = ARRAY_SIZE(motion_sensors); #endif /* HAS_TASK_MOTIONSENSE */ -static void trackpoint_reset_deferred(void) -{ - gpio_set_level(GPIO_EC_PS2_RESET, 1); - msleep(2); - gpio_set_level(GPIO_EC_PS2_RESET, 0); - msleep(10); -} -DECLARE_DEFERRED(trackpoint_reset_deferred); - -void send_aux_data_to_device(uint8_t data) -{ - ps2_transmit_byte(NPCX_PS2_CH0, data); -} - -void ps2_pwr_en_interrupt(enum gpio_signal signal) -{ - hook_call_deferred(&trackpoint_reset_deferred_data, MSEC); -} - const struct pwm_t pwm_channels[] = { [PWM_CH_KBLIGHT] = { .channel = 3, @@ -289,6 +271,24 @@ BUILD_ASSERT(ARRAY_SIZE(usb_muxes) == USBC_PORT_COUNT); /***************************************************************************** * Use FW_CONFIG to set correct configuration. */ + +enum gpio_signal gpio_ec_ps2_reset = GPIO_EC_PS2_RESET_V1; + +static void board_remap_gpio(void) +{ + uint32_t board_ver = 0; + + cbi_get_board_version(&board_ver); + + if (board_ver >= 3) { + gpio_ec_ps2_reset = GPIO_EC_PS2_RESET_V1; + ccprintf("GPIO_EC_PS2_RESET_V1\n"); + } else { + gpio_ec_ps2_reset = GPIO_EC_PS2_RESET_V0; + ccprintf("GPIO_EC_PS2_RESET_V0\n"); + } +} + void setup_fw_config(void) { /* Enable Gyro interrupts */ @@ -306,6 +306,7 @@ void setup_fw_config(void) ppc_chips[USBC_PORT_C1].drv = &aoz1380_drv; } + board_remap_gpio(); } DECLARE_HOOK(HOOK_INIT, setup_fw_config, HOOK_PRIO_INIT_I2C + 2); @@ -557,3 +558,22 @@ __override int board_aoz1380_set_vbus_source_current_limit(int port, return rv; } + +static void trackpoint_reset_deferred(void) +{ + gpio_set_level(gpio_ec_ps2_reset, 1); + msleep(2); + gpio_set_level(gpio_ec_ps2_reset, 0); + msleep(10); +} +DECLARE_DEFERRED(trackpoint_reset_deferred); + +void send_aux_data_to_device(uint8_t data) +{ + ps2_transmit_byte(NPCX_PS2_CH0, data); +} + +void ps2_pwr_en_interrupt(enum gpio_signal signal) +{ + hook_call_deferred(&trackpoint_reset_deferred_data, MSEC); +} diff --git a/board/morphius/gpio.inc b/board/morphius/gpio.inc index e5f21259e1..720565f7bb 100644 --- a/board/morphius/gpio.inc +++ b/board/morphius/gpio.inc @@ -50,9 +50,11 @@ GPIO(USB_C0_HPD, PIN(F, 5), GPIO_OUT_LOW) /* C0 DP Hotplug Detect */ GPIO(USB_C0_IN_HPD, PIN(7, 3), GPIO_OUT_LOW) /* C0 IN Hotplug Detect */ GPIO(DP1_HPD, PIN(F, 4), GPIO_OUT_LOW) /* C1 DP Hotplug Detect */ GPIO(DP2_HPD, PIN(C, 1), GPIO_OUT_LOW) /* C1 DP Hotplug Detect */ -GPIO(EC_PS2_RESET, PIN(3, 2), GPIO_OUT_LOW) /* Trackpoint reset pin */ +GPIO(EC_PS2_RESET_V0, PIN(3, 2), GPIO_OUT_LOW) /* Trackpoint reset pin V0*/ +GPIO(EC_PS2_RESET_V1, PIN(4, 5), GPIO_OUT_LOW) /* Trackpoint reset pin V1 */ GPIO(EC_H1_PACKET_MODE, PIN(8, 6), GPIO_OUT_LOW) /* H1 Packet Mode */ + UNIMPLEMENTED(PCH_SMI_L) GPIO(LED_FULL_L, PIN(6, 0), GPIO_OUT_HIGH) |