summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabio Baltieri <fabiobaltieri@google.com>2022-11-02 12:17:59 +0000
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-11-09 10:18:08 +0000
commit34780313d94adc7988b7926e03b707c5ec37a0ec (patch)
tree55f29abbce5fed3d579b0ecce4ef2e2a0c2c2498
parent7f7528f4a06ef78a068a8b949d7bd08ae9773b3c (diff)
downloadchrome-ec-34780313d94adc7988b7926e03b707c5ec37a0ec.tar.gz
zephyr: bindings: rename named-cbi-ssfc to cros-ec,cbi-ssfc
Rename the SSFC dts bindings for consistency with the FW_CONFIG ones. BRANCH=none BUG=none TEST=cq dry run Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Change-Id: Ic47e60948ca6cf3face5903ecbfc8d9b3d0b6c7e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3999727 Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
-rw-r--r--docs/zephyr/zephyr_ssfc.md20
-rw-r--r--zephyr/dts/bindings/cbi/cros-ec,cbi-ssfc-value.yaml (renamed from zephyr/dts/bindings/cbi/named-cbi-ssfc-value.yaml)4
-rw-r--r--zephyr/dts/bindings/cbi/cros-ec,cbi-ssfc.yaml (renamed from zephyr/dts/bindings/cbi/named-cbi-ssfc.yaml)10
-rw-r--r--zephyr/program/corsola/cbi_steelix.dts10
-rw-r--r--zephyr/program/nissa/craask/cbi.dtsi10
-rw-r--r--zephyr/program/nissa/pujjo/cbi.dtsi10
-rw-r--r--zephyr/shim/include/cros_cbi.h5
-rw-r--r--zephyr/shim/src/cbi/cros_cbi_fw_config.c12
-rw-r--r--zephyr/shim/src/cbi/cros_cbi_ssfc.c25
-rw-r--r--zephyr/test/drivers/boards/native_posix.overlay6
10 files changed, 55 insertions, 57 deletions
diff --git a/docs/zephyr/zephyr_ssfc.md b/docs/zephyr/zephyr_ssfc.md
index d40fdbc9c4..6a3fe079d3 100644
--- a/docs/zephyr/zephyr_ssfc.md
+++ b/docs/zephyr/zephyr_ssfc.md
@@ -25,11 +25,11 @@ Device tree is used to define and specify the field sizes and values.
## Devicetree Nodes
-The [`SSFC`] device tree nodes are defined via the [`named-cbi-ssfc`] and
-[`named-cbi-ssfc-value`] YAML bindings.
+The [`SSFC`] device tree nodes are defined via the [`cros-ec,cbi-ssfc`] and
+[`cros-ec,cbi-ssfc-value`] YAML bindings.
-The [`named-cbi-ssfc`] bindings define the name and size of each field.
-The [`named-cbi-ssfc-value`] bindings allow names/values to be defined for each
+The [`cros-ec,cbi-ssfc`] bindings define the name and size of each field.
+The [`cros-ec,cbi-ssfc-value`] bindings allow names/values to be defined for each
value that may be stored in the field.
One of the values may be designated as the default, which is used if
the [`CBI`] data cannot be accessed.
@@ -41,12 +41,12 @@ value is used as a default, indicating the default field.
An example definition is:
```
cbi-ssfc {
- compatible = "named-cbi-ssfc";
+ compatible = "cros-ec,cbi-ssfc";
base_sensor {
enum-name = "BASE_SENSOR";
size = <3>;
base_sensor_0: bmi160 {
- compatible = "named-cbi-ssfc-value";
+ compatible = "cros-ec,cbi-ssfc-value";
status = "okay";
value = <1>;
};
@@ -55,7 +55,7 @@ cbi-ssfc {
enum-name = "LID_SENSOR";
size = <3>;
lid_sensor_0: bma255 {
- compatible = "named-cbi-ssfc-value";
+ compatible = "cros-ec,cbi-ssfc-value";
status = "okay";
value = <1>;
};
@@ -64,7 +64,7 @@ cbi-ssfc {
enum-name = "LIGHTBAR";
size = <2>;
lightbar_0: 10_led {
- compatible = "named-cbi-ssfc-value";
+ compatible = "cros-ec,cbi-ssfc-value";
status = "okay";
value = <1>;
};
@@ -99,6 +99,6 @@ The [`ectool cbi`] command can be used to read and set the [`SSFC`].
[`CBI`]: https://chromium.googlesource.com/chromiumos/docs/+/HEAD/design_docs/cros_board_info.md
[`CBI Configuration`]: ./zephyr_cbi.md
[`ectool cbi`]: ./zephyr_cbi.md#testing-and-debugging
-[`named-cbi-ssfc`]: ../../zephyr/dts/bindings/cbi/named-cbi-fw-config.yaml
-[`named-cbi-ssfc-value`]: ../../zephyr/dts/bindings/cbi/named-cbi-fw-config-value.yaml
+[`cros-ec,cbi-ssfc`]: ../../zephyr/dts/bindings/cbi/cros-ec,cbi-fw-config.yaml
+[`cros-ec,cbi-ssfc-value`]: ../../zephyr/dts/bindings/cbi/cros-ec,cbi-fw-config-value.yaml
[`SSFC`]: https://chromium.googlesource.com/chromiumos/docs/+/HEAD/design_docs/firmware_config.md
diff --git a/zephyr/dts/bindings/cbi/named-cbi-ssfc-value.yaml b/zephyr/dts/bindings/cbi/cros-ec,cbi-ssfc-value.yaml
index 7e04afed87..6bbba1bdd7 100644
--- a/zephyr/dts/bindings/cbi/named-cbi-ssfc-value.yaml
+++ b/zephyr/dts/bindings/cbi/cros-ec,cbi-ssfc-value.yaml
@@ -4,9 +4,9 @@
description:
Possible CBI SSFC field values.
- It has to be defied as grandchild on the "named-cbi-ssfc"
+ It has to be defined as grandchild on the "cros-ec,cbi-ssfc"
-compatible: "named-cbi-ssfc-value"
+compatible: "cros-ec,cbi-ssfc-value"
properties:
value:
diff --git a/zephyr/dts/bindings/cbi/named-cbi-ssfc.yaml b/zephyr/dts/bindings/cbi/cros-ec,cbi-ssfc.yaml
index 2db330079d..d1cc4c26e5 100644
--- a/zephyr/dts/bindings/cbi/named-cbi-ssfc.yaml
+++ b/zephyr/dts/bindings/cbi/cros-ec,cbi-ssfc.yaml
@@ -4,7 +4,7 @@
description: CBI Second Source Factory Cache (SSFC)
-compatible: "named-cbi-ssfc"
+compatible: "cros-ec,cbi-ssfc"
child-binding:
description:
@@ -33,24 +33,24 @@ child-binding:
# Example:
#
# cbi-ssfc {
-# compatible = "named-cbi-ssfc";
+# compatible = "cros-ec,cbi-ssfc";
#
# base_sensor {
# enum-name = "BASE_SENSOR";
# size = <3>;
# bmi160 {
-# compatible = "named-cbi-ssfc-value";
+# compatible = "cros-ec,cbi-ssfc-value";
# status = "okay";
#
# value = <1>;
# devices = <&alt_base_accel &alt_base_gyro>;
# };
# kx022 {
-# compatible = "named-cbi-ssfc-value";
+# compatible = "cros-ec,cbi-ssfc-value";
# status = "okay";
#
# value = <3>;
# devices = <&base_accel_kx022>;
# };
# };
-# }; \ No newline at end of file
+# };
diff --git a/zephyr/program/corsola/cbi_steelix.dts b/zephyr/program/corsola/cbi_steelix.dts
index f4918b1577..6636b53a96 100644
--- a/zephyr/program/corsola/cbi_steelix.dts
+++ b/zephyr/program/corsola/cbi_steelix.dts
@@ -54,7 +54,7 @@
/* Steelix-specific ssfc fields. */
steelix-ssfc {
- compatible = "named-cbi-ssfc";
+ compatible = "cros-ec,cbi-ssfc";
/* SSFC field to identify BASE motion sensor. */
base-sensor {
@@ -62,13 +62,13 @@
size = <3>;
base_sensor_0: bmi323 {
- compatible = "named-cbi-ssfc-value";
+ compatible = "cros-ec,cbi-ssfc-value";
status = "okay";
value = <1>;
default;
};
base_sensor_1: lsm6dsm {
- compatible = "named-cbi-ssfc-value";
+ compatible = "cros-ec,cbi-ssfc-value";
status = "okay";
value = <2>;
};
@@ -80,13 +80,13 @@
size = <3>;
lid_sensor_0: bma422 {
- compatible = "named-cbi-ssfc-value";
+ compatible = "cros-ec,cbi-ssfc-value";
status = "okay";
value = <1>;
default;
};
lid_sensor_1: lis2dw12 {
- compatible = "named-cbi-ssfc-value";
+ compatible = "cros-ec,cbi-ssfc-value";
status = "okay";
value = <2>;
};
diff --git a/zephyr/program/nissa/craask/cbi.dtsi b/zephyr/program/nissa/craask/cbi.dtsi
index 4c2e052f4d..ef36a58d9d 100644
--- a/zephyr/program/nissa/craask/cbi.dtsi
+++ b/zephyr/program/nissa/craask/cbi.dtsi
@@ -55,7 +55,7 @@
};
/* Craask-specific ssfc fields. */
cbi-ssfc {
- compatible = "named-cbi-ssfc";
+ compatible = "cros-ec,cbi-ssfc";
/*
* SSFC bit0-1 was defined for AUDIO CODEC.
* 0: ALC5682I_VS
@@ -73,13 +73,13 @@
size = <2>;
lid_sensor_0: lis2dw12 {
- compatible = "named-cbi-ssfc-value";
+ compatible = "cros-ec,cbi-ssfc-value";
status = "okay";
value = <0>;
default;
};
lid_sensor_1: bma422 {
- compatible = "named-cbi-ssfc-value";
+ compatible = "cros-ec,cbi-ssfc-value";
status = "okay";
value = <1>;
};
@@ -92,13 +92,13 @@
size = <2>;
base_sensor_0: lsm6dso {
- compatible = "named-cbi-ssfc-value";
+ compatible = "cros-ec,cbi-ssfc-value";
status = "okay";
value = <0>;
default;
};
base_sensor_1: bmi323 {
- compatible = "named-cbi-ssfc-value";
+ compatible = "cros-ec,cbi-ssfc-value";
status = "okay";
value = <1>;
};
diff --git a/zephyr/program/nissa/pujjo/cbi.dtsi b/zephyr/program/nissa/pujjo/cbi.dtsi
index b5ba92bd9e..02057140a5 100644
--- a/zephyr/program/nissa/pujjo/cbi.dtsi
+++ b/zephyr/program/nissa/pujjo/cbi.dtsi
@@ -146,7 +146,7 @@
/* Pujjo-specific ssfc fields. */
cbi-ssfc {
- compatible = "named-cbi-ssfc";
+ compatible = "cros-ec,cbi-ssfc";
/*
* SSFC field to identify BASE motion sensor.
*/
@@ -155,13 +155,13 @@
size = <2>;
base_sensor_0: bmi323 {
- compatible = "named-cbi-ssfc-value";
+ compatible = "cros-ec,cbi-ssfc-value";
status = "okay";
value = <0>;
default;
};
base_sensor_1: lsm6dsm {
- compatible = "named-cbi-ssfc-value";
+ compatible = "cros-ec,cbi-ssfc-value";
status = "okay";
value = <1>;
};
@@ -175,13 +175,13 @@
size = <2>;
lid_sensor_0: bma422 {
- compatible = "named-cbi-ssfc-value";
+ compatible = "cros-ec,cbi-ssfc-value";
status = "okay";
value = <0>;
default;
};
lid_sensor_1: lis2dw12 {
- compatible = "named-cbi-ssfc-value";
+ compatible = "cros-ec,cbi-ssfc-value";
status = "okay";
value = <1>;
};
diff --git a/zephyr/shim/include/cros_cbi.h b/zephyr/shim/include/cros_cbi.h
index 1f8a1b3dfa..6f5bfd4d70 100644
--- a/zephyr/shim/include/cros_cbi.h
+++ b/zephyr/shim/include/cros_cbi.h
@@ -13,10 +13,9 @@
/*
* Macros are _INST_ types, so require DT_DRV_COMPAT to be defined.
*/
-#define DT_DRV_COMPAT named_cbi_ssfc_value
-#define CROS_CBI_LABEL "cros_cbi"
+#define DT_DRV_COMPAT cros_ec_cbi_ssfc_value
-#define CBI_SSFC_VALUE_COMPAT named_cbi_ssfc_value
+#define CBI_SSFC_VALUE_COMPAT DT_DRV_COMPAT
#define CBI_SSFC_VALUE_ID(id) DT_CAT(CBI_SSFC_VALUE_, id)
#define CBI_SSFC_VALUE_ID_WITH_COMMA(id) CBI_SSFC_VALUE_ID(id),
#define CBI_SSFC_VALUE_INST_ENUM(inst, _) \
diff --git a/zephyr/shim/src/cbi/cros_cbi_fw_config.c b/zephyr/shim/src/cbi/cros_cbi_fw_config.c
index 6710a30726..605c7ca0f7 100644
--- a/zephyr/shim/src/cbi/cros_cbi_fw_config.c
+++ b/zephyr/shim/src/cbi/cros_cbi_fw_config.c
@@ -47,13 +47,13 @@ LOG_MODULE_REGISTER(cros_cbi_fw_config, LOG_LEVEL_ERR);
#define FW_SHIFT_MASK(id) (FW_MASK(id) << FW_START(id))
/*
- * For a child "named-cbi-fw-config-value" node, retrieve the
+ * For a child "cros-ec,cbi-fw-config-value" node, retrieve the
* size of the parent field this value is associated with.
*/
#define FW_PARENT_SIZE(id) DT_PROP(DT_PARENT(id), size)
/*
- * For a child "named-cbi-fw-config-value" node, retrieve the
+ * For a child "cros-ec,cbi-fw-config-value" node, retrieve the
* start of the parent field this value is associated with.
*/
#define FW_PARENT_START(id) DT_PROP(DT_PARENT(id), start)
@@ -115,7 +115,7 @@ DT_FOREACH_STATUS_OKAY(CBI_FW_CONFIG_VALUE_COMPAT, FW_VALUE_BUILD_ASSERT)
/*
* Define bit fields based on the device tree entries. Example:
* cbi-fw-config {
- * compatible = "named-cbi-fw-config";
+ * compatible = "cros-ec,cbi-fw-config";
*
* fan {
* enum-name = "FW_CONFIG_FAN";
@@ -123,7 +123,7 @@ DT_FOREACH_STATUS_OKAY(CBI_FW_CONFIG_VALUE_COMPAT, FW_VALUE_BUILD_ASSERT)
* size = <1>;
* fan_present {
* enum-name = "FW_FAN_PRESENT"
- * compatible = "named-cbi-fw-config-value";
+ * compatible = "cros-ec,cbi-fw-config-value";
* value = <1>;
* };
* };
@@ -148,7 +148,7 @@ DT_FOREACH_STATUS_OKAY(CBI_FW_CONFIG_VALUE_COMPAT, FW_VALUE_BUILD_ASSERT)
break;
/*
- * Create a case for every child of this "named-cbi-fw-config" node.
+ * Create a case for every child of this "cros-ec,cbi-fw-config" node.
*/
#define FW_FIELD_NODES(inst, cached, value) \
DT_FOREACH_CHILD_STATUS_OKAY_VARGS(inst, FW_FIELD_CASE, cached, value)
@@ -177,7 +177,7 @@ static int cros_cbi_fw_config_get_field(uint32_t cached_fw_config,
{
switch (field_id) {
/*
- * Iterate through all the the "named-cbi-fw-config" nodes,
+ * Iterate through all the the "cros-ec,cbi-fw-config" nodes,
* and create cases for all of their child nodes.
*/
DT_FOREACH_STATUS_OKAY_VARGS(CBI_FW_CONFIG_COMPAT,
diff --git a/zephyr/shim/src/cbi/cros_cbi_ssfc.c b/zephyr/shim/src/cbi/cros_cbi_ssfc.c
index eb0f69b1cb..9158e9f215 100644
--- a/zephyr/shim/src/cbi/cros_cbi_ssfc.c
+++ b/zephyr/shim/src/cbi/cros_cbi_ssfc.c
@@ -10,18 +10,17 @@
LOG_MODULE_REGISTER(cros_cbi_ssfc, LOG_LEVEL_ERR);
-/* Actually, two "compatible" values are handle here -
- * named_cbi_ssfc_value and named_cbi_ssfc. named_cbi_ssfc_value nodes are
- * grandchildren of the named_cbi_ssfc node. named_cbi_ssfc_value is introduced
- * to iterate over grandchildren of the named_cbi_ssfc(macro
- * DT_FOREACH_CHILD can not be nested) and it can be pointed by a sensor dts to
- * indicate alternative usage.
+/* Actually, two "compatible" values are handle here - cros_ec_cbi_ssfc_value
+ * and cros_ec_cbi_ssfc. cros_ec_cbi_ssfc_value nodes are grandchildren of the
+ * cros_ec_cbi_ssfc node. cros_ec_cbi_ssfc_value is introduced to iterate over
+ * grandchildren of the cros_ec_cbi_ssfc (macro DT_FOREACH_CHILD can not be
+ * nested) and it can be pointed by a sensor dts to indicate alternative usage.
*/
-#define DT_DRV_COMPAT named_cbi_ssfc_value
+#define DT_DRV_COMPAT cros_ec_cbi_ssfc_value
-BUILD_ASSERT(DT_NUM_INST_STATUS_OKAY(named_cbi_ssfc) < 2,
+BUILD_ASSERT(DT_NUM_INST_STATUS_OKAY(cros_ec_cbi_ssfc) < 2,
"More than 1 CBI SSFS node");
-#define CBI_SSFC_NODE DT_INST(0, named_cbi_ssfc)
+#define CBI_SSFC_NODE DT_INST(0, cros_ec_cbi_ssfc)
#define CBI_SSFC_INIT_DEFAULT_ID(id, ssfc) \
do { \
@@ -73,13 +72,13 @@ BUILD_ASSERT(CBI_SSFC_FIELDS_SIZE <= 32, "CBI SSFS is bigger than 32 bits");
/*
* Define union bit fields based on the device tree entries. Example:
* cbi-ssfc {
- * compatible = "named-cbi-ssfc";
+ * compatible = "cros-ec,cbi-ssfc";
*
* base_sensor {
* enum-name = "BASE_SENSOR";
* size = <3>;
* bmi160 {
- * compatible = "named-cbi-ssfc-value";
+ * compatible = "cros-ec,cbi-ssfc-value";
* status = "okay";
* value = <1>;
* };
@@ -88,7 +87,7 @@ BUILD_ASSERT(CBI_SSFC_FIELDS_SIZE <= 32, "CBI SSFS is bigger than 32 bits");
* enum-name = "LID_SENSOR";
* size = <3>;
* bma255 {
- * compatible = "named-cbi-ssfc-value";
+ * compatible = "cros-ec,cbi-ssfc-value";
* status = "okay";
* value = <1>;
* };
@@ -97,7 +96,7 @@ BUILD_ASSERT(CBI_SSFC_FIELDS_SIZE <= 32, "CBI SSFS is bigger than 32 bits");
* enum-name = "LIGHTBAR";
* size = <2>;
* 10_led {
- * compatible = "named-cbi-ssfc-value";
+ * compatible = "cros-ec,cbi-ssfc-value";
* status = "okay";
* value = <1>;
* };
diff --git a/zephyr/test/drivers/boards/native_posix.overlay b/zephyr/test/drivers/boards/native_posix.overlay
index c194474052..3a0461badd 100644
--- a/zephyr/test/drivers/boards/native_posix.overlay
+++ b/zephyr/test/drivers/boards/native_posix.overlay
@@ -341,18 +341,18 @@
};
cbi-ssfc {
- compatible = "named-cbi-ssfc";
+ compatible = "cros-ec,cbi-ssfc";
cbi_ssfc_base_sensor: base_sensor {
enum-name = "BASE_SENSOR";
size = <2>;
base_sensor_0: base0 {
- compatible = "named-cbi-ssfc-value";
+ compatible = "cros-ec,cbi-ssfc-value";
status = "okay";
value = <1>;
default;
};
base_sensor_1: base1 {
- compatible = "named-cbi-ssfc-value";
+ compatible = "cros-ec,cbi-ssfc-value";
status = "okay";
value = <2>;
};