diff options
author | Caveh Jalali <caveh@chromium.org> | 2021-02-04 18:14:46 -0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-02-06 00:59:22 +0000 |
commit | 4eb7ace3ff728091862f400a26b569b2fb681b4c (patch) | |
tree | 83e30d0de8861838e774bf23ef7f1247b6144ef9 | |
parent | cd30f7d73129fe4868187f0ab47f8bce71711dc9 (diff) | |
download | chrome-ec-4eb7ace3ff728091862f400a26b569b2fb681b4c.tar.gz |
brya: Update minimal bootable EC config
This provides a bare minimum bootable configuration for the brya EC
using the latest GPIO definitions. The resulting image boots on the EVB
and allows us to explore GPIOs.
BRANCH=none
BUG=b:173575131
TEST=booted on EVB and examined GPIOs
Change-Id: I4eb95ec44d2400834630132334f52497dacc5691
Signed-off-by: Caveh Jalali <caveh@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2677424
-rw-r--r-- | baseboard/brya/baseboard.h | 20 | ||||
-rw-r--r-- | baseboard/brya/baseboard_usbc_config.h | 19 | ||||
-rw-r--r-- | board/brya/board.c | 37 | ||||
-rw-r--r-- | board/brya/board.h | 47 | ||||
-rw-r--r-- | board/brya/build.mk | 1 | ||||
-rw-r--r-- | board/brya/usbc_config.c | 26 |
6 files changed, 139 insertions, 11 deletions
diff --git a/baseboard/brya/baseboard.h b/baseboard/brya/baseboard.h index 9d3b1c653a..0b64063932 100644 --- a/baseboard/brya/baseboard.h +++ b/baseboard/brya/baseboard.h @@ -8,4 +8,24 @@ #ifndef __CROS_EC_BASEBOARD_H #define __CROS_EC_BASEBOARD_H +/* + * By default, enable all console messages excepted HC + */ +#define CC_DEFAULT (CC_ALL & ~(BIT(CC_HOSTCMD))) + +/* NPCX9 config */ +#define NPCX9_PWM1_SEL 1 /* GPIO C2 is used as PWM1. */ +/* + * This defines which pads (GPIO10/11 or GPIO64/65) are connected to + * the "UART1" (NPCX_UART_PORT0) controller when used for + * CONSOLE_UART. + */ +#define NPCX_UART_MODULE2 1 /* 1:GPIO64/65 for UART1 */ + +#ifndef __ASSEMBLER__ + +#include "baseboard_usbc_config.h" + +#endif /* !__ASSEMBLER__ */ + #endif /* __CROS_EC_BASEBOARD_H */ diff --git a/baseboard/brya/baseboard_usbc_config.h b/baseboard/brya/baseboard_usbc_config.h new file mode 100644 index 0000000000..f8b9fab35c --- /dev/null +++ b/baseboard/brya/baseboard_usbc_config.h @@ -0,0 +1,19 @@ +/* Copyright 2021 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. + */ + +/* brya family-specific USB-C configuration */ + +#ifndef __CROS_EC_BASEBOARD_USBC_CONFIG_H +#define __CROS_EC_BASEBOARD_USBC_CONFIG_H + +#include "gpio_signal.h" + +/* Common definition for the USB PD interrupt handlers. */ +void bc12_interrupt(enum gpio_signal signal); +void ppc_interrupt(enum gpio_signal signal); +void retimer_interrupt(enum gpio_signal signal); +void tcpc_alert_event(enum gpio_signal signal); + +#endif /* __CROS_EC_BASEBOARD_USBC_CONFIG_H */ diff --git a/board/brya/board.c b/board/brya/board.c index 6e945463ee..a065b6e241 100644 --- a/board/brya/board.c +++ b/board/brya/board.c @@ -3,10 +3,41 @@ * found in the LICENSE file. */ -#include "registers.h" +#include "common.h" -static void fake_gpio_interrupt(enum gpio_signal signal) +#include "power.h" +#include "switch.h" + +#include "gpio_list.h" /* Must come after other header files. */ + +/* + * remove when we enable CONFIG_POWER_BUTTON + */ + +void power_button_interrupt(enum gpio_signal signal) +{ +} + +/* + * remove when we enable CONFIG_THROTTLE_AP + */ + +void throttle_ap_prochot_input_interrupt(enum gpio_signal signal) { } -#include "gpio_list.h" +/* + * remove when we enable CONFIG_EXTPOWER_GPIO + */ + +void extpower_interrupt(enum gpio_signal signal) +{ +} + +/* + * remove when we enable CONFIG_VOLUME_BUTTONS + */ + +void button_interrupt(enum gpio_signal signal) +{ +} diff --git a/board/brya/board.h b/board/brya/board.h index 2c178f80e6..c474dda994 100644 --- a/board/brya/board.h +++ b/board/brya/board.h @@ -11,12 +11,6 @@ /* Baseboard features */ #include "baseboard.h" -#ifndef __ASSEMBLER__ - -#include "gpio_signal.h" /* must precede gpio.h */ - -#endif /* !__ASSEMBLER__ */ - /* * Disable features enabled by default. */ @@ -26,17 +20,54 @@ #undef CONFIG_SPI_FLASH #undef CONFIG_SWITCH -#define GPIO_WP_L GPIO_FAKE_IRQ_00 -#define GPIO_ENTERING_RW GPIO_FAKE_OUT_01 +/* USB Type C and USB PD defines */ +#define CONFIG_IO_EXPANDER_PORT_COUNT 2 + +#define GPIO_ENTERING_RW GPIO_EC_ENTERING_RW +#define GPIO_WP_L GPIO_EC_WP_ODL + #ifndef __ASSEMBLER__ +#include "gpio_signal.h" /* needed by registers.h */ +#include "registers.h" + +enum ioex_port { + IOEX_C0_NCT38XX = 0, + IOEX_C2_NCT38XX, + IOEX_PORT_COUNT +}; + enum battery_type { BATTERY_POWER_TECH, BATTERY_LGC011, BATTERY_TYPE_COUNT }; +/* + * remove when we enable CONFIG_POWER_BUTTON + */ + +void power_button_interrupt(enum gpio_signal signal); + +/* + * remove when we enable CONFIG_THROTTLE_AP + */ + +void throttle_ap_prochot_input_interrupt(enum gpio_signal signal); + +/* + * remove when we enable CONFIG_EXTPOWER_GPIO + */ + +void extpower_interrupt(enum gpio_signal signal); + +/* + * remove when we enable CONFIG_VOLUME_BUTTONS + */ + +void button_interrupt(enum gpio_signal signal); + #endif /* !__ASSEMBLER__ */ #endif /* __CROS_EC_BOARD_H */ diff --git a/board/brya/build.mk b/board/brya/build.mk index a9a9f563f1..eb738fd7b5 100644 --- a/board/brya/build.mk +++ b/board/brya/build.mk @@ -13,3 +13,4 @@ BASEBOARD:=brya board-y=board.o board-y+=battery.o +board-y+=usbc_config.o diff --git a/board/brya/usbc_config.c b/board/brya/usbc_config.c new file mode 100644 index 0000000000..6f08711bcb --- /dev/null +++ b/board/brya/usbc_config.c @@ -0,0 +1,26 @@ +/* Copyright 2021 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. + */ + +#include "common.h" + +/* + * TODO(b/179513527): add USB-C support + */ + +void tcpc_alert_event(enum gpio_signal signal) +{ +} + +void bc12_interrupt(enum gpio_signal signal) +{ +} + +void ppc_interrupt(enum gpio_signal signal) +{ +} + +void retimer_interrupt(enum gpio_signal signal) +{ +} |