diff options
author | Keith Short <keithshort@chromium.org> | 2019-08-15 13:04:43 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-08-20 15:32:39 +0000 |
commit | 6fe0f643a1012d6aff2fe9874619238aa2e2284b (patch) | |
tree | 9890f9553e67cc2e3fd4193baa345371ad7b7934 | |
parent | d7bb1b0e0a24571f01ca048185bd8b9d882c4f8f (diff) | |
download | chrome-ec-6fe0f643a1012d6aff2fe9874619238aa2e2284b.tar.gz |
Volteer: initial EC board setup
Create Volteer skeleton build. Only includes base NPCX7 configuration
required to build.
BUG=none
BRANCH=none
TEST=make BOARD=volteer, make buildall
TEST=Booted skeleton volteer EC image on careena board.
Change-Id: I07769edfac9818320f18bbc9d0ebcd8f345fb8bb
Signed-off-by: Keith Short <keithshort@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1758532
Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
Reviewed-by: Jett Rink <jettrink@chromium.org>
-rw-r--r-- | baseboard/volteer/baseboard.c | 14 | ||||
-rw-r--r-- | baseboard/volteer/baseboard.h | 50 | ||||
-rw-r--r-- | baseboard/volteer/build.mk | 9 | ||||
-rw-r--r-- | board/volteer/board.c | 25 | ||||
-rw-r--r-- | board/volteer/board.h | 58 | ||||
-rw-r--r-- | board/volteer/build.mk | 14 | ||||
-rw-r--r-- | board/volteer/ec.tasklist | 13 | ||||
-rw-r--r-- | board/volteer/gpio.inc | 34 |
8 files changed, 217 insertions, 0 deletions
diff --git a/baseboard/volteer/baseboard.c b/baseboard/volteer/baseboard.c new file mode 100644 index 0000000000..e10e892566 --- /dev/null +++ b/baseboard/volteer/baseboard.c @@ -0,0 +1,14 @@ +/* Copyright 2019 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. + */ + +/* Volteer family-specific configuration */ +#include "gpio.h" + +/******************************************************************************/ +/* Wake up pins */ +const enum gpio_signal hibernate_wake_pins[] = { +}; +const int hibernate_wake_pins_used = ARRAY_SIZE(hibernate_wake_pins); + diff --git a/baseboard/volteer/baseboard.h b/baseboard/volteer/baseboard.h new file mode 100644 index 0000000000..543a42bdb8 --- /dev/null +++ b/baseboard/volteer/baseboard.h @@ -0,0 +1,50 @@ +/* Copyright 2019 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. + */ + +/* Volteer baseboard configuration */ + +#ifndef __CROS_EC_BASEBOARD_H +#define __CROS_EC_BASEBOARD_H + + +/* NPCX7 config */ +#define NPCX7_PWM1_SEL 0 /* GPIO C2 is not used as PWM1. */ +#define NPCX_UART_MODULE2 1 /* GPIO64/65 are used as UART pins. */ +/* Internal SPI flash on NPCX796FC is 512 kB */ +#define CONFIG_FLASH_SIZE (512 * 1024) +#define CONFIG_SPI_FLASH_REGS +#define CONFIG_SPI_FLASH_W25Q80 /* Internal SPI flash type. */ + +/* EC Defines */ +#define CONFIG_CRC8 +#define CONFIG_HIBERNATE_PSL +#define CONFIG_VBOOT_HASH +#define CONFIG_VSTORE +#define CONFIG_VSTORE_SLOT_COUNT 1 + +/* Host communication */ + +/* Chipset config */ + +/* Common Keyboard Defines */ + +/* Sensors */ + +/* Common charger defines */ + +/* Common battery defines */ + +/* USB Type C and USB PD defines */ + +/* BC 1.2 */ + +/* I2C Bus Configuration */ + + +#ifndef __ASSEMBLER__ + +#endif /* !__ASSEMBLER__ */ + +#endif /* __CROS_EC_BASEBOARD_H */ diff --git a/baseboard/volteer/build.mk b/baseboard/volteer/build.mk new file mode 100644 index 0000000000..03a91ceda7 --- /dev/null +++ b/baseboard/volteer/build.mk @@ -0,0 +1,9 @@ +# -*- makefile -*- +# Copyright 2019 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. +# +# Volteer baseboard specific files build +# + +baseboard-y=baseboard.o diff --git a/board/volteer/board.c b/board/volteer/board.c new file mode 100644 index 0000000000..295ecd696b --- /dev/null +++ b/board/volteer/board.c @@ -0,0 +1,25 @@ +/* Copyright 2019 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. + */ + +/* Volteer board-specific configuration */ + +#include "common.h" +#include "gpio.h" +#include "hooks.h" +#include "lid_switch.h" +#include "switch.h" +#include "system.h" +#include "task.h" +#include "uart.h" +#include "util.h" + +#include "gpio_list.h" /* Must come after other header files. */ + +static void board_init(void) +{ + /* TODO */ +} +DECLARE_HOOK(HOOK_INIT, board_init, HOOK_PRIO_DEFAULT); + diff --git a/board/volteer/board.h b/board/volteer/board.h new file mode 100644 index 0000000000..f8d899c8b4 --- /dev/null +++ b/board/volteer/board.h @@ -0,0 +1,58 @@ +/* Copyright 2019 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. + */ + +/* Volteer board configuration */ + +#ifndef __CROS_EC_BOARD_H +#define __CROS_EC_BOARD_H + +/* Baseboard features */ +#include "baseboard.h" + +/* Optional features */ +#define CONFIG_SYSTEM_UNLOCKED /* Allow dangerous commands while in dev. */ + +/* Config options automatically enabled by NPCX, re-enable once support added */ +#undef CONFIG_ADC +#undef CONFIG_SWITCH + +#undef CONFIG_UART_TX_BUF_SIZE +#define CONFIG_UART_TX_BUF_SIZE 4096 + +/* Keyboard features */ + +/* Sensors */ + +/* USB Type C and USB PD defines */ + +/* USB Type A Features */ + +/* BC 1.2 */ + +/* Volume Button feature */ + +/* Fan features */ + +/* + * Macros for GPIO signals used in common code that don't match the + * schematic names. Signal names in gpio.inc match the schematic and are + * then redefined here to so it's more clear which signal is being used for + * which purpose. + */ +#define GPIO_ENTERING_RW GPIO_EC_ENTERING_RW +#define GPIO_LID_OPEN GPIO_EC_LID_OPEN +#define GPIO_WP_L GPIO_EC_WP_L + + + +#ifndef __ASSEMBLER__ + +#include "gpio_signal.h" +#include "registers.h" + + +#endif /* !__ASSEMBLER__ */ + +#endif /* __CROS_EC_BOARD_H */ diff --git a/board/volteer/build.mk b/board/volteer/build.mk new file mode 100644 index 0000000000..72645a86cd --- /dev/null +++ b/board/volteer/build.mk @@ -0,0 +1,14 @@ +# -*- makefile -*- +# Copyright 2019 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. +# +# Board specific files build +# + +CHIP:=npcx +CHIP_FAMILY:=npcx7 +CHIP_VARIANT:=npcx7m6fc +BASEBOARD:=volteer + +board-y=board.o diff --git a/board/volteer/ec.tasklist b/board/volteer/ec.tasklist new file mode 100644 index 0000000000..6e1791520d --- /dev/null +++ b/board/volteer/ec.tasklist @@ -0,0 +1,13 @@ +/* Copyright 2019 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. + */ + +/* + * See CONFIG_TASK_LIST in config.h for details. + */ + +#define CONFIG_TASK_LIST \ + TASK_ALWAYS(HOOKS, hook_task, NULL, LARGER_TASK_STACK_SIZE) \ + TASK_ALWAYS(HOSTCMD, host_command_task, NULL, LARGER_TASK_STACK_SIZE) \ + TASK_ALWAYS(CONSOLE, console_task, NULL, VENTI_TASK_STACK_SIZE) diff --git a/board/volteer/gpio.inc b/board/volteer/gpio.inc new file mode 100644 index 0000000000..7b9ee14a04 --- /dev/null +++ b/board/volteer/gpio.inc @@ -0,0 +1,34 @@ +/* -*- mode:c -*- + * + * Copyright 2019 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. + */ + +/* Declare symbolic names for all the GPIOs that we care about. + * Note: Those with interrupt handlers must be declared first. */ + +/* Wake Source interrupts */ +GPIO_INT(EC_LID_OPEN, PIN(D, 2), GPIO_INT_BOTH | GPIO_HIB_WAKE_HIGH, lid_interrupt) +GPIO_INT(EC_WP_L, PIN(A, 1), GPIO_INT_BOTH, switch_interrupt) + +/* Power sequencing interrupts */ + +/* Sensor Interrupts */ + +/* USB-C interrupts */ + +/* HDMI interrupts */ + +/* Volume button interrupts */ + +/* AP Signals */ +GPIO(EC_ENTERING_RW, PIN(E, 3), GPIO_OUT_LOW) + +/* USB and USBC Signals */ + +/* Misc Signals */ + +/* UART */ +ALTERNATE(PIN_MASK(6, BIT(5) | BIT(4)), 0, MODULE_UART, 0) /* UART from EC to Servo */ + |