diff options
author | Yuval Peress <peress@chromium.org> | 2020-12-10 00:56:10 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-12-10 17:32:09 +0000 |
commit | e200d3747d694c8137f254ac1000169d541f2822 (patch) | |
tree | 5321c2eeaad845ac20d36b176d78bf1189d302b6 /zephyr/shim/chip | |
parent | 6217fefb2ca861eae3dc764885a317a420ae9761 (diff) | |
download | chrome-ec-e200d3747d694c8137f254ac1000169d541f2822.tar.gz |
zephyr: remove dependency on chip specific code for npcx
BRANCH=none
BUG=b:175249000
TEST=zmake testall
Cq-Depend: chromium:2583272
Signed-off-by: Yuval Peress <peress@chromium.org>
Change-Id: Ie50e56df60e060c3741013912ab46d807fc5e417
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2582819
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Commit-Queue: Jack Rosenthal <jrosenth@chromium.org>
Diffstat (limited to 'zephyr/shim/chip')
-rw-r--r-- | zephyr/shim/chip/CMakeLists.txt | 13 | ||||
-rw-r--r-- | zephyr/shim/chip/npcx/CMakeLists.txt | 2 | ||||
-rw-r--r-- | zephyr/shim/chip/npcx/i2c-npcx7.c | 44 |
3 files changed, 0 insertions, 59 deletions
diff --git a/zephyr/shim/chip/CMakeLists.txt b/zephyr/shim/chip/CMakeLists.txt index 7a77febaa1..f9e714d93e 100644 --- a/zephyr/shim/chip/CMakeLists.txt +++ b/zephyr/shim/chip/CMakeLists.txt @@ -18,18 +18,5 @@ zephyr_compile_definitions("CHIP_VARIANT_${CHIP_VARIANT}") if ("${CHIP_FAMILY}" MATCHES "^NPCX[0-9]$") add_subdirectory(npcx) - zephyr_include_directories("${PLATFORM_EC}/chip/npcx") - string(TOLOWER "npcx/i2c-${CHIP_FAMILY}.c" chip_specific_i2c_impl) -endif() - -# Adding chip specific i2c implementation here. These contain the specific -# code used to implement generic information about platform/ec -# port numbers and their properties. As such they're basically the -# platform/ec's abstraction of devicetree and aren't worth replacing -# quite yet until a cleaner picture of how the full migration for i2c -# will be done. -if (DEFINED chip_specific_i2c_impl) - zephyr_sources_ifdef(CONFIG_PLATFORM_EC_I2C - "${PLATFORM_EC}/chip/${chip_specific_i2c_impl}") endif() diff --git a/zephyr/shim/chip/npcx/CMakeLists.txt b/zephyr/shim/chip/npcx/CMakeLists.txt index 0c08b9cedd..06725d3e89 100644 --- a/zephyr/shim/chip/npcx/CMakeLists.txt +++ b/zephyr/shim/chip/npcx/CMakeLists.txt @@ -2,7 +2,5 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -string(TOLOWER "i2c-${CHIP_FAMILY}.c" chip_specific_i2c_shim) -zephyr_sources(${chip_specific_i2c_shim}) zephyr_sources(clock.c) zephyr_sources(keyboard_raw.c) diff --git a/zephyr/shim/chip/npcx/i2c-npcx7.c b/zephyr/shim/chip/npcx/i2c-npcx7.c deleted file mode 100644 index 1f6fe6336d..0000000000 --- a/zephyr/shim/chip/npcx/i2c-npcx7.c +++ /dev/null @@ -1,44 +0,0 @@ -/* 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. - */ - -#include <sys/util.h> - -#include "registers.h" -#include "i2c/i2c.h" - -/* Shorthand for getting the device binding for a given devicetree label. */ -#define BINDING_FOR(label) \ - device_get_binding( \ - COND_CODE_1(DT_NODE_HAS_STATUS(DT_NODELABEL(label), okay), \ - (DT_LABEL(DT_NODELABEL(label))), (""))) - -static const struct device *i2c_devices[NPCX_I2C_COUNT]; - -static int init_device_bindings(const struct device *device) -{ - ARG_UNUSED(device); - i2c_devices[NPCX_I2C_PORT0_0] = BINDING_FOR(i2c0_0); - i2c_devices[NPCX_I2C_PORT1_0] = BINDING_FOR(i2c1_0); - i2c_devices[NPCX_I2C_PORT2_0] = BINDING_FOR(i2c2_0); - i2c_devices[NPCX_I2C_PORT3_0] = BINDING_FOR(i2c3_0); -#ifdef CHIP_VARIANT_NPCX7M6G - i2c_devices[NPCX_I2C_PORT4_0] = BINDING_FOR(i2c4_0); -#endif - i2c_devices[NPCX_I2C_PORT4_1] = BINDING_FOR(i2c4_1); - i2c_devices[NPCX_I2C_PORT5_0] = BINDING_FOR(i2c5_0); - i2c_devices[NPCX_I2C_PORT5_1] = BINDING_FOR(i2c5_1); - i2c_devices[NPCX_I2C_PORT6_0] = BINDING_FOR(i2c6_0); - i2c_devices[NPCX_I2C_PORT6_1] = BINDING_FOR(i2c6_1); - i2c_devices[NPCX_I2C_PORT7_0] = BINDING_FOR(i2c7_0); - return 0; -} -SYS_INIT(init_device_bindings, POST_KERNEL, 51); - -const struct device *i2c_get_device_for_port(const int port) -{ - if (port < 0 || port >= NPCX_I2C_COUNT) - return NULL; - return i2c_devices[port]; -} |