diff options
-rw-r--r-- | include/link_defs.h | 4 | ||||
-rw-r--r-- | zephyr/CMakeLists.txt | 3 | ||||
-rw-r--r-- | zephyr/Kconfig | 9 | ||||
-rw-r--r-- | zephyr/shim/include/config_chip.h | 5 | ||||
-rw-r--r-- | zephyr/shim/include/linker.h | 12 |
5 files changed, 32 insertions, 1 deletions
diff --git a/include/link_defs.h b/include/link_defs.h index 5b04b857bb..4dc71d5f4f 100644 --- a/include/link_defs.h +++ b/include/link_defs.h @@ -15,6 +15,10 @@ #include "task.h" #include "test_util.h" +#ifdef CONFIG_ZEPHYR +#include <linker.h> +#endif + /* Console commands */ extern const struct console_command __cmds[]; extern const struct console_command __cmds_end[]; diff --git a/zephyr/CMakeLists.txt b/zephyr/CMakeLists.txt index 05710985f0..514d1eb754 100644 --- a/zephyr/CMakeLists.txt +++ b/zephyr/CMakeLists.txt @@ -40,7 +40,8 @@ add_subdirectory_ifdef(CONFIG_PLATFORM_EC "shim") # supported by all boards and emulators (including unit tests) using the shim # layer. zephyr_sources_ifdef(CONFIG_PLATFORM_EC "${PLATFORM_EC}/common/base32.c" - "${PLATFORM_EC}/common/queue.c") + "${PLATFORM_EC}/common/queue.c" + "${PLATFORM_EC}/common/shared_mem.c") # Now include files that depend on or relate to other CONFIG options, sorted by # CONFIG diff --git a/zephyr/Kconfig b/zephyr/Kconfig index e05d47a688..fb50ac9c31 100644 --- a/zephyr/Kconfig +++ b/zephyr/Kconfig @@ -203,6 +203,15 @@ config PLATFORM_EC_POWER_BUTTON commands in platform/ec. This requires a GPIO named GPIO_POWER_BUTTON_L in gpio_map.h. +config PLATFORM_EC_CONSOLE_CMD_SHMEM + bool "Enable the 'shmem' command" + default y + help + This command prints basic information about the EC shared memory, + located at the top of RAM, above all RAM symbols: total size, bytes + used and the maximum number of bytes that have been used since + the EC started running. + menuconfig PLATFORM_EC_TIMER bool "Enable the EC timer module" default y diff --git a/zephyr/shim/include/config_chip.h b/zephyr/shim/include/config_chip.h index 1dacf839a5..1eb5e17cb8 100644 --- a/zephyr/shim/include/config_chip.h +++ b/zephyr/shim/include/config_chip.h @@ -129,6 +129,11 @@ enum battery_type { #define CONFIG_POWER_PP5000_CONTROL #endif +#undef CONFIG_CMD_SHMEM +#ifdef CONFIG_PLATFORM_EC_CONSOLE_CMD_SHMEM +#define CONFIG_CMD_SHMEM +#endif + #ifdef CONFIG_PLATFORM_EC_TIMER #define CONFIG_HWTIMER_64BIT #define CONFIG_HW_SPECIFIC_UDELAY diff --git a/zephyr/shim/include/linker.h b/zephyr/shim/include/linker.h new file mode 100644 index 0000000000..335f4f0f19 --- /dev/null +++ b/zephyr/shim/include/linker.h @@ -0,0 +1,12 @@ +/* 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. + */ + +#ifndef __CROS_EC_LINKER_H +#define __CROS_EC_LINKER_H + +/* Put the start of shared memory after all allocated RAM symbols */ +#define __shared_mem_buf _image_ram_end + +#endif |