summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--zephyr/projects/it8xxx2_evb/CMakeLists.txt11
-rw-r--r--zephyr/projects/it8xxx2_evb/boards/riscv/it8xxx2_evb/Kconfig.board7
-rw-r--r--zephyr/projects/it8xxx2_evb/boards/riscv/it8xxx2_evb/Kconfig.defconfig10
-rw-r--r--zephyr/projects/it8xxx2_evb/boards/riscv/it8xxx2_evb/it8xxx2_evb.dts33
-rw-r--r--zephyr/projects/it8xxx2_evb/boards/riscv/it8xxx2_evb/it8xxx2_evb_defconfig53
-rw-r--r--zephyr/projects/it8xxx2_evb/include/gpio_map.h31
-rw-r--r--zephyr/projects/it8xxx2_evb/include/i2c_map.h16
-rw-r--r--zephyr/projects/it8xxx2_evb/include/pwm_map.h15
-rw-r--r--zephyr/projects/it8xxx2_evb/prj.conf31
-rw-r--r--zephyr/projects/it8xxx2_evb/zmake.yaml9
10 files changed, 216 insertions, 0 deletions
diff --git a/zephyr/projects/it8xxx2_evb/CMakeLists.txt b/zephyr/projects/it8xxx2_evb/CMakeLists.txt
new file mode 100644
index 0000000000..dc2eb449b0
--- /dev/null
+++ b/zephyr/projects/it8xxx2_evb/CMakeLists.txt
@@ -0,0 +1,11 @@
+# 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.
+
+cmake_minimum_required(VERSION 3.13.1)
+
+find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
+project(it8xxx2_evb)
+
+# Include board specific header files
+zephyr_include_directories(include)
diff --git a/zephyr/projects/it8xxx2_evb/boards/riscv/it8xxx2_evb/Kconfig.board b/zephyr/projects/it8xxx2_evb/boards/riscv/it8xxx2_evb/Kconfig.board
new file mode 100644
index 0000000000..86bcede4cd
--- /dev/null
+++ b/zephyr/projects/it8xxx2_evb/boards/riscv/it8xxx2_evb/Kconfig.board
@@ -0,0 +1,7 @@
+# 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.
+
+config BOARD_IT8XXX2_EVB
+ bool "IT8XXX2 EV-board"
+ depends on SOC_IT8XXX2
diff --git a/zephyr/projects/it8xxx2_evb/boards/riscv/it8xxx2_evb/Kconfig.defconfig b/zephyr/projects/it8xxx2_evb/boards/riscv/it8xxx2_evb/Kconfig.defconfig
new file mode 100644
index 0000000000..de08d278de
--- /dev/null
+++ b/zephyr/projects/it8xxx2_evb/boards/riscv/it8xxx2_evb/Kconfig.defconfig
@@ -0,0 +1,10 @@
+# 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.
+
+if BOARD_IT8XXX2_EVB
+
+config BOARD
+ default "it8xxx2_evb"
+
+endif # BOARD_IT8XXX2_EVB
diff --git a/zephyr/projects/it8xxx2_evb/boards/riscv/it8xxx2_evb/it8xxx2_evb.dts b/zephyr/projects/it8xxx2_evb/boards/riscv/it8xxx2_evb/it8xxx2_evb.dts
new file mode 100644
index 0000000000..160e9fb124
--- /dev/null
+++ b/zephyr/projects/it8xxx2_evb/boards/riscv/it8xxx2_evb/it8xxx2_evb.dts
@@ -0,0 +1,33 @@
+/* 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.
+ */
+
+/dts-v1/;
+
+#include <cros/ite/it8xxx2.dtsi>
+#include <dt-bindings/gpio_defines.h>
+#include <it8xxx2.dtsi>
+
+/ {
+ model = "IT8XXX2 EV-Board";
+
+ chosen {
+ zephyr,sram = &sram0;
+ zephyr,console = &uart1;
+ zephyr,shell-uart = &uart1;
+ zephyr,flash = &flash0;
+ };
+
+ named-gpios {
+ compatible = "named-gpios";
+
+ };
+
+};
+
+&uart1 {
+ status = "okay";
+ current-speed = <115200>;
+ clock-frequency = <1804800>;
+};
diff --git a/zephyr/projects/it8xxx2_evb/boards/riscv/it8xxx2_evb/it8xxx2_evb_defconfig b/zephyr/projects/it8xxx2_evb/boards/riscv/it8xxx2_evb/it8xxx2_evb_defconfig
new file mode 100644
index 0000000000..38a9195104
--- /dev/null
+++ b/zephyr/projects/it8xxx2_evb/boards/riscv/it8xxx2_evb/it8xxx2_evb_defconfig
@@ -0,0 +1,53 @@
+# 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.
+
+# Zephyr Kernel Configuration
+CONFIG_SOC_SERIES_RISCV32_IT8XXX2=y
+
+# Platform Configuration
+CONFIG_SOC_IT8XXX2=y
+CONFIG_BOARD_IT8XXX2_EVB=y
+
+# Serial Drivers
+CONFIG_SERIAL=y
+CONFIG_UART_INTERRUPT_DRIVEN=y
+
+# Enable console
+CONFIG_CONSOLE=y
+CONFIG_UART_CONSOLE=y
+CONFIG_UART_NS16550=y
+
+# Pinmux Driver
+CONFIG_PINMUX=y
+CONFIG_PINMUX_ITE_IT8XXX2=y
+
+# GPIO Controller
+CONFIG_GPIO=y
+CONFIG_GPIO_ITE_IT8XXX2=y
+
+# Clock configuration
+CONFIG_CLOCK_CONTROL=y
+
+# WATCHDOG configuration
+CONFIG_WATCHDOG=n
+
+# I2C Controller
+CONFIG_I2C_ITE_IT8XXX2=n
+
+CONFIG_ITE_IT8XXX2_TIMER=y
+
+CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=32768
+CONFIG_SYS_CLOCK_TICKS_PER_SEC=1000
+
+# Code RAM base for IT8XXX2
+CONFIG_CROS_EC_PROGRAM_MEMORY_BASE=0x80000000
+CONFIG_CROS_EC_RAM_BASE=0x80100000
+CONFIG_CROS_EC_DATA_RAM_SIZE=0x00100000
+CONFIG_CROS_EC_RAM_SIZE=0x0000f000
+
+
+CONFIG_CROS_EC_RO_MEM_OFF=0x0
+CONFIG_CROS_EC_RO_SIZE=0x80000
+CONFIG_CROS_EC_RW_MEM_OFF=0x0
+CONFIG_CROS_EC_RW_SIZE=0x80000
diff --git a/zephyr/projects/it8xxx2_evb/include/gpio_map.h b/zephyr/projects/it8xxx2_evb/include/gpio_map.h
new file mode 100644
index 0000000000..1305e59e71
--- /dev/null
+++ b/zephyr/projects/it8xxx2_evb/include/gpio_map.h
@@ -0,0 +1,31 @@
+/* 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.
+ */
+
+#ifndef __ZEPHYR_GPIO_MAP_H
+#define __ZEPHYR_GPIO_MAP_H
+
+#include <devicetree.h>
+#include <gpio_signal.h>
+
+#define GPIO_ENTERING_RW GPIO_UNIMPLEMENTED
+#define GPIO_WP_L GPIO_UNIMPLEMENTED
+
+/*
+ * Set EC_CROS_GPIO_INTERRUPTS to a space-separated list of GPIO_INT items.
+ *
+ * Each GPIO_INT requires three parameters:
+ * gpio_signal - The enum gpio_signal for the interrupt gpio
+ * interrupt_flags - The interrupt-related flags (e.g. GPIO_INT_EDGE_BOTH)
+ * handler - The platform/ec interrupt handler.
+ *
+ * Ensure that this files includes all necessary headers to declare all
+ * referenced handler functions.
+ *
+ * For example, one could use the follow definition:
+ * #define EC_CROS_GPIO_INTERRUPTS \
+ * GPIO_INT(NAMED_GPIO(h1_ec_pwr_btn_odl), GPIO_INT_EDGE_BOTH, button_print)
+ */
+
+#endif /* __ZEPHYR_GPIO_MAP_H */
diff --git a/zephyr/projects/it8xxx2_evb/include/i2c_map.h b/zephyr/projects/it8xxx2_evb/include/i2c_map.h
new file mode 100644
index 0000000000..9d1fc1ca36
--- /dev/null
+++ b/zephyr/projects/it8xxx2_evb/include/i2c_map.h
@@ -0,0 +1,16 @@
+/* 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.
+ */
+
+#ifndef __ZEPHYR_CHROME_I2C_MAP_H
+#define __ZEPHYR_CHROME_I2C_MAP_H
+
+#include <devicetree.h>
+
+#include "config.h"
+
+/* We need registers.h to get the chip specific defines for now */
+#include "i2c/i2c.h"
+
+#endif /* __ZEPHYR_CHROME_I2C_MAP_H */
diff --git a/zephyr/projects/it8xxx2_evb/include/pwm_map.h b/zephyr/projects/it8xxx2_evb/include/pwm_map.h
new file mode 100644
index 0000000000..5cf7377f52
--- /dev/null
+++ b/zephyr/projects/it8xxx2_evb/include/pwm_map.h
@@ -0,0 +1,15 @@
+/* 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.
+ */
+
+#ifndef __ZEPHYR_CHROME_PWM_MAP_H
+#define __ZEPHYR_CHROME_PWM_MAP_H
+
+#include <devicetree.h>
+
+#include "config.h"
+
+#include "pwm/pwm.h"
+
+#endif /* __ZEPHYR_CHROME_PWM_MAP_H */
diff --git a/zephyr/projects/it8xxx2_evb/prj.conf b/zephyr/projects/it8xxx2_evb/prj.conf
new file mode 100644
index 0000000000..df177e8f11
--- /dev/null
+++ b/zephyr/projects/it8xxx2_evb/prj.conf
@@ -0,0 +1,31 @@
+# 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.
+
+CONFIG_CROS_EC=y
+CONFIG_PLATFORM_EC=y
+CONFIG_SHIMMED_TASKS=y
+
+# SoC configuration
+CONFIG_PLATFORM_EC_VBOOT=n
+
+# ADC
+CONFIG_PLATFORM_EC_ADC=n
+
+# Flash
+CONFIG_PLATFORM_EC_FLASH=y
+
+# I2C master
+CONFIG_PLATFORM_EC_I2C=n
+
+# Keyboard
+CONFIG_PLATFORM_EC_KEYBOARD=n
+
+# Board version
+CONFIG_PLATFORM_EC_BOARD_VERSION=n
+
+# Host command
+CONFIG_PLATFORM_EC_HOSTCMD=n
+
+# Logging
+CONFIG_LOG=y
diff --git a/zephyr/projects/it8xxx2_evb/zmake.yaml b/zephyr/projects/it8xxx2_evb/zmake.yaml
new file mode 100644
index 0000000000..4cec35bde8
--- /dev/null
+++ b/zephyr/projects/it8xxx2_evb/zmake.yaml
@@ -0,0 +1,9 @@
+# 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.
+
+board: it8xxx2_evb
+supported-zephyr-versions:
+ - v2.5
+toolchain: coreboot-sdk
+output-type: raw