summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabio Baltieri <fabiobaltieri@google.com>2021-04-08 15:08:55 +0000
committerCommit Bot <commit-bot@chromium.org>2021-04-09 08:29:58 +0000
commit459bd6251a6791cfe0561f38e0224a05c41ebfcd (patch)
treed4194ee66b54a0c2f48017df5438475b7f7da71c
parent6285ab4648cd52a5c289c6671087a5a08cae12f3 (diff)
downloadchrome-ec-459bd6251a6791cfe0561f38e0224a05c41ebfcd.tar.gz
zephyr: config: add a dts node for the CBI EEPROM
This makes a separate dts node for the CBI EEPROM. The node uses the existing at24 dts binding and defines all the required properties, even though right now only the address is used. BUG=b:184739382 BRANCH=none TEST=build and flash on volteer TEST=cbi shell command Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Change-Id: I8a3ed6f3dc504118fa6d61bc78e2b4c46d6c4840 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2814621 Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Yuval Peress <peress@chromium.org>
-rw-r--r--zephyr/dts/bindings/i2c/cros-ec,i2c-port-eeprom.yaml14
-rw-r--r--zephyr/projects/volteer/boards/arm/volteer/volteer.dts2
-rw-r--r--zephyr/projects/volteer/volteer/cbi_eeprom.dts17
-rw-r--r--zephyr/projects/volteer/volteer/gpio.dts3
-rw-r--r--zephyr/projects/volteer/volteer/zmake.yaml1
-rw-r--r--zephyr/shim/include/config_chip.h1
-rw-r--r--zephyr/shim/include/i2c/i2c.h5
7 files changed, 21 insertions, 22 deletions
diff --git a/zephyr/dts/bindings/i2c/cros-ec,i2c-port-eeprom.yaml b/zephyr/dts/bindings/i2c/cros-ec,i2c-port-eeprom.yaml
deleted file mode 100644
index e8e206cfb8..0000000000
--- a/zephyr/dts/bindings/i2c/cros-ec,i2c-port-eeprom.yaml
+++ /dev/null
@@ -1,14 +0,0 @@
-# Copyright (c) 2021 The Chromium OS Authors
-# SPDX-License-Identifier: Apache-2.0
-
-description: I2C port properties for the EEPROM node
-
-compatible: "cros-ec,i2c-port-eeprom"
-
-include: [cros-ec-i2c-port-base.yaml]
-
-properties:
- addr-flags:
- type: int
- description:
- EEPROM flags.
diff --git a/zephyr/projects/volteer/boards/arm/volteer/volteer.dts b/zephyr/projects/volteer/boards/arm/volteer/volteer.dts
index 5a28c0c1c2..65972313ae 100644
--- a/zephyr/projects/volteer/boards/arm/volteer/volteer.dts
+++ b/zephyr/projects/volteer/boards/arm/volteer/volteer.dts
@@ -129,10 +129,8 @@
label = "BATTERY";
};
eeprom {
- compatible = "cros-ec,i2c-port-eeprom";
i2c-port = <&i2c7_0>;
enum-name = "I2C_PORT_EEPROM";
- addr-flags = <0x50>;
label = "EEPROM";
config {
frequency = <100>;
diff --git a/zephyr/projects/volteer/volteer/cbi_eeprom.dts b/zephyr/projects/volteer/volteer/cbi_eeprom.dts
new file mode 100644
index 0000000000..f584c56afd
--- /dev/null
+++ b/zephyr/projects/volteer/volteer/cbi_eeprom.dts
@@ -0,0 +1,17 @@
+/* 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.
+ */
+
+&i2c7_0 {
+ cbi_eeprom: eeprom@50 {
+ compatible = "atmel,at24";
+ reg = <0x50>;
+ label = "EEPROM_CBI";
+ size = <2048>;
+ pagesize = <16>;
+ address-width = <8>;
+ timeout = <5>;
+ wp-gpios = <&gpio_ec_wp_l>;
+ };
+};
diff --git a/zephyr/projects/volteer/volteer/gpio.dts b/zephyr/projects/volteer/volteer/gpio.dts
index 901657e2fa..8a40c409cc 100644
--- a/zephyr/projects/volteer/volteer/gpio.dts
+++ b/zephyr/projects/volteer/volteer/gpio.dts
@@ -12,7 +12,8 @@
enum-name = "GPIO_LID_OPEN";
label = "EC_LID_OPEN";
};
- ec_wp_l {
+ gpio_ec_wp_l: ec_wp_l {
+ #gpio-cells = <0>;
gpios = <&gpioa 1 GPIO_INPUT>;
enum-name = "GPIO_EC_WP_L";
label = "EC_WP_L";
diff --git a/zephyr/projects/volteer/volteer/zmake.yaml b/zephyr/projects/volteer/volteer/zmake.yaml
index f93ad5c553..c64813a95e 100644
--- a/zephyr/projects/volteer/volteer/zmake.yaml
+++ b/zephyr/projects/volteer/volteer/zmake.yaml
@@ -5,6 +5,7 @@
board: volteer
dts-overlays:
- bb_retimer.dts
+ - cbi_eeprom.dts
- gpio.dts
- fan.dts
- motionsense.dts
diff --git a/zephyr/shim/include/config_chip.h b/zephyr/shim/include/config_chip.h
index a5a57abf13..1a02395459 100644
--- a/zephyr/shim/include/config_chip.h
+++ b/zephyr/shim/include/config_chip.h
@@ -1239,6 +1239,7 @@
#undef CONFIG_CROS_BOARD_INFO
#ifdef CONFIG_PLATFORM_EC_CBI
#define CONFIG_CROS_BOARD_INFO
+#define I2C_ADDR_EEPROM_FLAGS DT_REG_ADDR(DT_NODELABEL(cbi_eeprom))
#endif
#undef CONFIG_VBOOT_HASH
diff --git a/zephyr/shim/include/i2c/i2c.h b/zephyr/shim/include/i2c/i2c.h
index 4130ba2037..4d3186b4d5 100644
--- a/zephyr/shim/include/i2c/i2c.h
+++ b/zephyr/shim/include/i2c/i2c.h
@@ -12,11 +12,6 @@
#ifdef CONFIG_PLATFORM_EC_I2C
#if DT_NODE_EXISTS(DT_PATH(named_i2c_ports))
-/* EEPROM flags */
-#if DT_HAS_COMPAT_STATUS_OKAY(cros_ec_i2c_port_eeprom)
-#define I2C_ADDR_EEPROM_FLAGS \
- DT_PROP(DT_INST(0, cros_ec_i2c_port_eeprom), addr_flags)
-#endif
#define I2C_PORT(id) DT_ENUM_UPPER_TOKEN(id, enum_name)
#define I2C_PORT_WITH_COMMA(id) I2C_PORT(id),