summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJett Rink <jettrink@chromium.org>2020-09-22 17:07:42 -0600
committerCommit Bot <commit-bot@chromium.org>2021-01-15 03:54:21 +0000
commitbca9bc430210c287b23fc222188062843c7adada (patch)
tree7178a0653d59b5038ecdf05d66155914ee3b3fa0
parent55265594901758eca2a33fdafa037f7fc0e98fd5 (diff)
downloadchrome-ec-bca9bc430210c287b23fc222188062843c7adada.tar.gz
volteer: initial project for volteer
This prints hello world. Make sure to flash zephyr_volteer.bin instead of zephyr.bin to the device with flash_ec script. BUG=b:169182500 TEST=flash zephyr_volteer.bin with flash_ec using servo micro and view UART output on EC console. Change-Id: I5094cd06824d29a7abc5526e9dbc921253854f40 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/zephyr-chrome/+/2427408 Commit-Queue: Jett Rink <jettrink@chromium.org> Tested-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2630127 Tested-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org> Commit-Queue: Jack Rosenthal <jrosenth@chromium.org>
-rw-r--r--zephyr/projects/volteer/CMakeLists.txt11
-rw-r--r--zephyr/projects/volteer/boards/arm/volteer/CMakeLists.txt13
-rw-r--r--zephyr/projects/volteer/boards/arm/volteer/Kconfig.board8
-rw-r--r--zephyr/projects/volteer/boards/arm/volteer/Kconfig.defconfig11
-rw-r--r--zephyr/projects/volteer/boards/arm/volteer/board.cmake4
-rw-r--r--zephyr/projects/volteer/boards/arm/volteer/volteer.dts30
-rw-r--r--zephyr/projects/volteer/boards/arm/volteer/volteer.yaml19
-rw-r--r--zephyr/projects/volteer/boards/arm/volteer/volteer_defconfig36
-rw-r--r--zephyr/projects/volteer/prj.conf4
9 files changed, 136 insertions, 0 deletions
diff --git a/zephyr/projects/volteer/CMakeLists.txt b/zephyr/projects/volteer/CMakeLists.txt
new file mode 100644
index 0000000000..54ab8a7479
--- /dev/null
+++ b/zephyr/projects/volteer/CMakeLists.txt
@@ -0,0 +1,11 @@
+# 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.
+# SPDX-License-Identifier: Apache-2.0
+
+cmake_minimum_required(VERSION 3.13.1)
+set(BOARD_ROOT ${CMAKE_CURRENT_LIST_DIR})
+set(BOARD volteer)
+
+find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
+project(volteer)
diff --git a/zephyr/projects/volteer/boards/arm/volteer/CMakeLists.txt b/zephyr/projects/volteer/boards/arm/volteer/CMakeLists.txt
new file mode 100644
index 0000000000..acf50524d1
--- /dev/null
+++ b/zephyr/projects/volteer/boards/arm/volteer/CMakeLists.txt
@@ -0,0 +1,13 @@
+# SPDX-License-Identifier: Apache-2.0
+
+# find ECST tool for generating npcx header used by ROM code
+
+# This calls into a helper script in the npcx eval board directory; this script
+# should be moved into a better location (e.g. chip series directory)
+
+set_property(GLOBAL APPEND PROPERTY extra_post_build_commands
+ COMMAND ${PYTHON_EXECUTABLE} ${ZEPHYR_BASE}/boards/arm/npcx7m6fb_evb/support/ecst.py
+ -i ${PROJECT_BINARY_DIR}/${CONFIG_KERNEL_BIN_NAME}.bin
+ -o ${TARGET_IMAGE_FILE} -nohcrc -nofcrc
+ -chip npcx7m6 -flashsize 8 -spimaxclk 50 -spireadmode dual
+)
diff --git a/zephyr/projects/volteer/boards/arm/volteer/Kconfig.board b/zephyr/projects/volteer/boards/arm/volteer/Kconfig.board
new file mode 100644
index 0000000000..8cd06feb38
--- /dev/null
+++ b/zephyr/projects/volteer/boards/arm/volteer/Kconfig.board
@@ -0,0 +1,8 @@
+# Google Volteer EC
+
+# Copyright 2020 The Chromium OS Authors
+# SPDX-License-Identifier: Apache-2.0
+
+config BOARD_VOLTEER
+ bool "Google Volteer EC"
+ depends on SOC_NPCX7M6FB # Actually NPCX7M6FC; C has 512K Flash
diff --git a/zephyr/projects/volteer/boards/arm/volteer/Kconfig.defconfig b/zephyr/projects/volteer/boards/arm/volteer/Kconfig.defconfig
new file mode 100644
index 0000000000..05361962d9
--- /dev/null
+++ b/zephyr/projects/volteer/boards/arm/volteer/Kconfig.defconfig
@@ -0,0 +1,11 @@
+# Google Volteer EC
+
+# Copyright 2020 The Chromium OS Authors
+# SPDX-License-Identifier: Apache-2.0
+
+if BOARD_VOLTEER
+
+config BOARD
+ default "volteer"
+
+endif # BOARD_VOLTEER
diff --git a/zephyr/projects/volteer/boards/arm/volteer/board.cmake b/zephyr/projects/volteer/boards/arm/volteer/board.cmake
new file mode 100644
index 0000000000..ba5ade3aaf
--- /dev/null
+++ b/zephyr/projects/volteer/boards/arm/volteer/board.cmake
@@ -0,0 +1,4 @@
+# SPDX-License-Identifier: Apache-2.0
+
+# This is file path you actually flash to the target (e.g. zephyr_volteer.bin)
+set(TARGET_IMAGE_FILE ${PROJECT_BINARY_DIR}/zephyr_volteer.bin) \ No newline at end of file
diff --git a/zephyr/projects/volteer/boards/arm/volteer/volteer.dts b/zephyr/projects/volteer/boards/arm/volteer/volteer.dts
new file mode 100644
index 0000000000..d531b6c3ca
--- /dev/null
+++ b/zephyr/projects/volteer/boards/arm/volteer/volteer.dts
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2020 The Chromium OS Authors
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+/dts-v1/;
+
+#include <nuvoton/npcx7m6fb.dtsi>
+
+/ {
+ model = "Google Volteer EC";
+
+ chosen {
+ zephyr,sram = &sram0;
+ zephyr,console = &uart1;
+ zephyr,flash = &flash0;
+ };
+};
+
+/* Update flash size to 512KB from 196KB since we are using C variant */
+&flash0 {
+ reg = <0x10090000 0x80000>;
+};
+
+&uart1 {
+ status = "okay";
+ current-speed = <115200>;
+ pinctrl = <&altc_uart1_sl2>; /* Use UART1_SL2 ie. PIN64.65 */
+};
diff --git a/zephyr/projects/volteer/boards/arm/volteer/volteer.yaml b/zephyr/projects/volteer/boards/arm/volteer/volteer.yaml
new file mode 100644
index 0000000000..923a2765b5
--- /dev/null
+++ b/zephyr/projects/volteer/boards/arm/volteer/volteer.yaml
@@ -0,0 +1,19 @@
+#
+# Copyright (c) 2020 Google LLC.
+#
+# SPDX-License-Identifier: Apache-2.0
+#
+
+identifier: volteer
+name: "Google Volteer Embedded Controller"
+type: mcu
+arch: arm
+toolchain:
+ - zephyr
+ - gnuarmemb
+ram: 64
+flash: 512
+testing:
+ ignore_tags:
+ - net
+ - bluetooth
diff --git a/zephyr/projects/volteer/boards/arm/volteer/volteer_defconfig b/zephyr/projects/volteer/boards/arm/volteer/volteer_defconfig
new file mode 100644
index 0000000000..5c033a2893
--- /dev/null
+++ b/zephyr/projects/volteer/boards/arm/volteer/volteer_defconfig
@@ -0,0 +1,36 @@
+# SPDX-License-Identifier: Apache-2.0
+
+# Zephyr Kernel Configuration
+CONFIG_SOC_SERIES_NPCX7=y
+
+# Platform Configuration
+CONFIG_SOC_NPCX7M6FB=y # Actually NPCX7M6FC; C just has 512K Flash
+CONFIG_BOARD_VOLTEER=y
+
+# Serial Drivers
+CONFIG_SERIAL=y
+CONFIG_UART_INTERRUPT_DRIVEN=y
+
+# Enable console
+CONFIG_CONSOLE=y
+CONFIG_UART_CONSOLE=y
+
+# Pinmux Driver
+CONFIG_PINMUX=y
+
+# GPIO Controller
+CONFIG_GPIO=y
+
+# Clock configuration
+CONFIG_CLOCK_CONTROL=y
+
+# PLL configuration
+CONFIG_CLOCK_NPCX_OSC_CYCLES_PER_SEC=90000000
+CONFIG_CLOCK_NPCX_APB1_PRESCALER=6
+CONFIG_CLOCK_NPCX_APB2_PRESCALER=6
+CONFIG_CLOCK_NPCX_APB3_PRESCALER=6
+
+# Ideally, we would use HSI48, but this is not supported in
+# Zephyr. Use "basic" HSI (8 MHz).
+CONFIG_CORTEX_M_SYSTICK=y
+CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=15000000
diff --git a/zephyr/projects/volteer/prj.conf b/zephyr/projects/volteer/prj.conf
new file mode 100644
index 0000000000..54cdb1fccc
--- /dev/null
+++ b/zephyr/projects/volteer/prj.conf
@@ -0,0 +1,4 @@
+CONFIG_CHROME_EC=y
+
+# TODO(b/161470456): can we remove the below when zmake generates it?
+CONFIG_CHROME_EC_RO=y