From f7d94e0c3e6d5c2f0a5424c9563ea33038e7a0a4 Mon Sep 17 00:00:00 2001 From: Scott Collyer Date: Tue, 26 Jun 2018 18:10:04 -0700 Subject: DragonEgg: Initial skeleton for DragonEgg This CL adds DragonEgg in /board and /baseboard. Only minimal gpio signals are defined to allow successful build. The /baseboard files are currently empty, but the plan is to use baseboard for functions that will be common for ite EC and ILK. BRANCH=none BUG=b:110880394 TEST=make buildall Change-Id: Ia018692f277efaceef85a060b6585accc82fddfd Signed-off-by: Scott Collyer Reviewed-on: https://chromium-review.googlesource.com/1117133 Commit-Ready: Scott Collyer Tested-by: Scott Collyer Reviewed-by: Jett Rink --- baseboard/dragonegg/baseboard.c | 6 ++++++ baseboard/dragonegg/baseboard.h | 11 +++++++++++ baseboard/dragonegg/build.mk | 9 +++++++++ board/dragonegg/board.c | 34 ++++++++++++++++++++++++++++++++++ board/dragonegg/board.h | 40 ++++++++++++++++++++++++++++++++++++++++ board/dragonegg/build.mk | 12 ++++++++++++ board/dragonegg/ec.tasklist | 28 ++++++++++++++++++++++++++++ board/dragonegg/gpio.inc | 30 ++++++++++++++++++++++++++++++ util/flash_ec | 1 + 9 files changed, 171 insertions(+) create mode 100644 baseboard/dragonegg/baseboard.c create mode 100644 baseboard/dragonegg/baseboard.h create mode 100644 baseboard/dragonegg/build.mk create mode 100644 board/dragonegg/board.c create mode 100644 board/dragonegg/board.h create mode 100644 board/dragonegg/build.mk create mode 100644 board/dragonegg/ec.tasklist create mode 100644 board/dragonegg/gpio.inc diff --git a/baseboard/dragonegg/baseboard.c b/baseboard/dragonegg/baseboard.c new file mode 100644 index 0000000000..a38c724559 --- /dev/null +++ b/baseboard/dragonegg/baseboard.c @@ -0,0 +1,6 @@ +/* Copyright 2018 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. + */ + +/* DragonEgg family-specific configuration */ diff --git a/baseboard/dragonegg/baseboard.h b/baseboard/dragonegg/baseboard.h new file mode 100644 index 0000000000..3335d38f1a --- /dev/null +++ b/baseboard/dragonegg/baseboard.h @@ -0,0 +1,11 @@ +/* Copyright 2018 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. + */ + +/* Octopus board configuration */ + +#ifndef __CROS_EC_BASEBOARD_H +#define __CROS_EC_BASEBOARD_H + +#endif /* __CROS_EC_BASEBOARD_H */ diff --git a/baseboard/dragonegg/build.mk b/baseboard/dragonegg/build.mk new file mode 100644 index 0000000000..ff9ef6728f --- /dev/null +++ b/baseboard/dragonegg/build.mk @@ -0,0 +1,9 @@ +# -*- makefile -*- +# Copyright 2018 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. +# +# DragonEgg baseboard specific files build +# + +baseboard-y=baseboard.o diff --git a/board/dragonegg/board.c b/board/dragonegg/board.c new file mode 100644 index 0000000000..11bbb7b78e --- /dev/null +++ b/board/dragonegg/board.c @@ -0,0 +1,34 @@ +/* Copyright 2018 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. + */ + +/* DragonEgg board-specific configuration */ + +#include "common.h" +#include "extpower.h" +#include "gpio.h" +#include "intc.h" +#include "lid_switch.h" +#include "power_button.h" +#include "spi.h" +#include "switch.h" +#include "system.h" +#include "uart.h" +#include "util.h" + +#include "gpio_list.h" /* Must come after other header files. */ + +/******************************************************************************/ +/* Wake up pins */ +const enum gpio_signal hibernate_wake_pins[] = { + GPIO_LID_OPEN +}; +const int hibernate_wake_pins_used = ARRAY_SIZE(hibernate_wake_pins); + +/******************************************************************************/ +/* SPI devices */ +/* TODO(b/110880394): Fill out correctly (SPI FLASH) */ +const struct spi_device_t spi_devices[] = { +}; +const unsigned int spi_devices_used = ARRAY_SIZE(spi_devices); diff --git a/board/dragonegg/board.h b/board/dragonegg/board.h new file mode 100644 index 0000000000..5c207d0fb0 --- /dev/null +++ b/board/dragonegg/board.h @@ -0,0 +1,40 @@ +/* Copyright 2018 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. + */ + +/* DragonEgg board configuration */ + +#ifndef __CROS_EC_BOARD_H +#define __CROS_EC_BOARD_H + +/* Optional features */ +#define CONFIG_SYSTEM_UNLOCKED /* Allow dangerous commands while in dev. */ + +#define CONFIG_POWER_BUTTON +#define CONFIG_KEYBOARD_BOARD_CONFIG +#define CONFIG_KEYBOARD_PROTOCOL_8042 +#define CONFIG_LOW_POWER_IDLE + +#define CONFIG_HOSTCMD_ESPI +#define CONFIG_HOSTCMD_ESPI_VW_SIGNALS + +#undef CONFIG_UART_TX_BUF_SIZE +#define CONFIG_UART_TX_BUF_SIZE 4096 + +#ifndef __ASSEMBLER__ + +#include "gpio_signal.h" +#include "registers.h" + +enum adc_channel { + ADC_CH_COUNT +}; + +enum pwm_channel { + PWM_CH_COUNT +}; + +#endif /* !__ASSEMBLER__ */ + +#endif /* __CROS_EC_BOARD_H */ diff --git a/board/dragonegg/build.mk b/board/dragonegg/build.mk new file mode 100644 index 0000000000..a210ca235a --- /dev/null +++ b/board/dragonegg/build.mk @@ -0,0 +1,12 @@ +# -*- makefile -*- +# Copyright 2018 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:=it83xx +BASEBOARD:=dragonegg + +board-y=board.o diff --git a/board/dragonegg/ec.tasklist b/board/dragonegg/ec.tasklist new file mode 100644 index 0000000000..2075316904 --- /dev/null +++ b/board/dragonegg/ec.tasklist @@ -0,0 +1,28 @@ +/* Copyright 2018 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. + */ + +/* + * List of enabled tasks in the priority order + * + * The first one has the lowest priority. + * + * For each task, use the macro TASK_ALWAYS(n, r, d, s) for base tasks and + * TASK_NOTEST(n, r, d, s) for tasks that can be excluded in test binaries, + * where : + * 'n' in the name of the task + * 'r' in the main routine of the task + * 'd' in an opaque parameter passed to the routine at startup + * 's' is the stack size in bytes; must be a multiple of 8 + * + * For USB PD tasks, IDs must be in consecutive order and correspond to + * the port which they are for. See TASK_ID_TO_PD_PORT() macro. + */ + +#define CONFIG_TASK_LIST \ + TASK_ALWAYS(HOOKS, hook_task, NULL, LARGER_TASK_STACK_SIZE) \ + TASK_NOTEST(KEYPROTO, keyboard_protocol_task, NULL, 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/dragonegg/gpio.inc b/board/dragonegg/gpio.inc new file mode 100644 index 0000000000..d730fe5beb --- /dev/null +++ b/board/dragonegg/gpio.inc @@ -0,0 +1,30 @@ +/* -*- mode:c -*- + * + * Copyright 2018 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(LID_OPEN, PIN(F, 3), GPIO_INT_BOTH, lid_interrupt) +GPIO_INT(WP_L, PIN(F, 1), GPIO_INT_BOTH, switch_interrupt) /* EC_WP_ODL */ +GPIO_INT(POWER_BUTTON_L, PIN(E, 2), GPIO_INT_BOTH, power_button_interrupt) /* MECH_PWR_BTN_ODL */ +#ifdef CONFIG_LOW_POWER_IDLE +/* Used to wake up the EC from Deep Doze mode when writing to console */ +GPIO_INT(UART1_RX, PIN(B, 0), GPIO_INT_BOTH, uart_deepsleep_interrupt) /* UART_SERVO_TX_EC_RX */ +#endif + + + +#ifdef CONFIG_HOSTCMD_ESPI +/* enable 1.8v input of EC's espi_reset pin, and then this pin takes effect. */ +GPIO_INT(ESPI_RESET_L, PIN(D, 2), GPIO_INT_FALLING | GPIO_SEL_1P8V, espi_reset_pin_asserted_interrupt) /* eSPI_reset# */ +#endif + +GPIO(SYS_RESET_L, PIN(D, 1), GPIO_ODR_HIGH) /* SYS_RST_ODL */ +GPIO(ENTERING_RW, PIN(G, 0), GPIO_OUT_LOW) /* EC_ENTERING_RW */ +GPIO(PCH_WAKE_L, PIN(D, 5), GPIO_ODR_HIGH) /* EC_PCH_WAKE_ODL */ +GPIO(PCH_PWRBTN_L, PIN(B, 6), GPIO_ODR_HIGH) /* EC_PCH_PWR_BTN_ODL */ diff --git a/util/flash_ec b/util/flash_ec index bb84b4b058..aec4c90ff7 100755 --- a/util/flash_ec +++ b/util/flash_ec @@ -47,6 +47,7 @@ die() { BOARDS_IT83XX=( bip + dragonegg glkrvp_ite it83xx_evb reef_it8320 -- cgit v1.2.1