diff options
Diffstat (limited to 'zephyr/projects/minimal')
-rw-r--r-- | zephyr/projects/minimal/BUILD.py | 22 | ||||
-rw-r--r-- | zephyr/projects/minimal/CMakeLists.txt | 9 | ||||
-rw-r--r-- | zephyr/projects/minimal/README.md | 32 | ||||
-rw-r--r-- | zephyr/projects/minimal/it8xxx2.dts | 22 | ||||
-rw-r--r-- | zephyr/projects/minimal/npcx9.dts | 28 | ||||
-rw-r--r-- | zephyr/projects/minimal/prj.conf | 18 |
6 files changed, 131 insertions, 0 deletions
diff --git a/zephyr/projects/minimal/BUILD.py b/zephyr/projects/minimal/BUILD.py new file mode 100644 index 0000000000..5e892aa2d7 --- /dev/null +++ b/zephyr/projects/minimal/BUILD.py @@ -0,0 +1,22 @@ +# Copyright 2022 The ChromiumOS Authors +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +"""Minimal example project.""" + +register_host_project( + project_name="minimal-posix", + zephyr_board="native_posix", +) + +register_npcx_project( + project_name="minimal-npcx9", + zephyr_board="npcx9m3f", + dts_overlays=[here / "npcx9.dts"], +) + +register_binman_project( + project_name="minimal-it8xxx2", + zephyr_board="it81302bx", + dts_overlays=[here / "it8xxx2.dts"], +) diff --git a/zephyr/projects/minimal/CMakeLists.txt b/zephyr/projects/minimal/CMakeLists.txt new file mode 100644 index 0000000000..de3bec9428 --- /dev/null +++ b/zephyr/projects/minimal/CMakeLists.txt @@ -0,0 +1,9 @@ +# Copyright 2022 The ChromiumOS Authors +# 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.20.5) +find_package(Zephyr REQUIRED HINTS "${ZEPHYR_BASE}") +project(ec) + +zephyr_include_directories("${CMAKE_CURRENT_SOURCE_DIR}/include") diff --git a/zephyr/projects/minimal/README.md b/zephyr/projects/minimal/README.md new file mode 100644 index 0000000000..72c092dfce --- /dev/null +++ b/zephyr/projects/minimal/README.md @@ -0,0 +1,32 @@ +# Minimal Example Zephyr EC Project + +This directory is intended to be an extremely minimal example of a +project. Should you like, you can use it as a bring up a new program, +or as reference as you require. + +If you're bringing up a new variant of a program, you don't need a +whole project directory with a `BUILD.py` and all, and this example is +likely not of use to you. Check out the [project config +documentation] for instructions on adding a new variant. + +[project config documentation]: ../../../docs/zephyr/project_config.md + +# Building + +To build the `native_posix` example, run: + +``` shellsession +(chroot) $ zmake build minimal-posix +``` + +To build the NPCX9 example, run: + +``` shellsession +(chroot) $ zmake build minimal-npcx9 +``` + +For the IT8XXX2 example, run: + +``` shellsession +(chroot) $ zmake build minimal-it8xxx2 +``` diff --git a/zephyr/projects/minimal/it8xxx2.dts b/zephyr/projects/minimal/it8xxx2.dts new file mode 100644 index 0000000000..3d2028afb2 --- /dev/null +++ b/zephyr/projects/minimal/it8xxx2.dts @@ -0,0 +1,22 @@ +/* Copyright 2022 The ChromiumOS Authors + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/ { + aliases { + gpio-wp = &ec_wp_l; + }; + + named-gpios { + compatible = "named-gpios"; + + ec_wp_l: write-protect { + gpios = <&gpioa 0 GPIO_INPUT>; + }; + /* unimplemented GPIOs */ + entering-rw { + enum-name = "GPIO_ENTERING_RW"; + }; + }; +}; diff --git a/zephyr/projects/minimal/npcx9.dts b/zephyr/projects/minimal/npcx9.dts new file mode 100644 index 0000000000..3a9f3b26e4 --- /dev/null +++ b/zephyr/projects/minimal/npcx9.dts @@ -0,0 +1,28 @@ +/* Copyright 2022 The ChromiumOS Authors + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/ { + aliases { + gpio-wp = &ec_wp_l; + }; + + named-gpios { + compatible = "named-gpios"; + + ec_wp_l: write-protect { + gpios = <&gpioa 0 GPIO_INPUT>; + }; + /* unimplemented GPIOs */ + entering-rw { + enum-name = "GPIO_ENTERING_RW"; + }; + }; +}; + +&cros_kb_raw { + status = "okay"; + pinctrl-0 = <>; + pinctrl-names = "default"; +}; diff --git a/zephyr/projects/minimal/prj.conf b/zephyr/projects/minimal/prj.conf new file mode 100644 index 0000000000..db7cac0cef --- /dev/null +++ b/zephyr/projects/minimal/prj.conf @@ -0,0 +1,18 @@ +# Copyright 2022 The ChromiumOS Authors +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +CONFIG_PLATFORM_EC=y +CONFIG_CROS_EC=y +CONFIG_SHIMMED_TASKS=y +CONFIG_SYSCON=y + +# Disable default features we don't want in a minimal example. +CONFIG_ADC=n +CONFIG_I2C=n +CONFIG_PWM=n +CONFIG_PLATFORM_EC_BACKLIGHT_LID=n +CONFIG_PLATFORM_EC_KEYBOARD=n +CONFIG_PLATFORM_EC_POWER_BUTTON=n +CONFIG_PLATFORM_EC_SWITCH=n +CONFIG_PLATFORM_EC_VBOOT_EFS2=n |