summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuval Peress <peress@google.com>2021-10-06 12:07:17 -0600
committerCommit Bot <commit-bot@chromium.org>2021-10-06 21:21:40 +0000
commitd921605694c3a6e371d081e057aee7d976eb20aa (patch)
tree9ee265212c8d3cb153ae40d02257f91951d89fef
parente88b7ee9aedbcf84dcb220db7244d6411e7f7318 (diff)
downloadchrome-ec-d921605694c3a6e371d081e057aee7d976eb20aa.tar.gz
zephyr: npcx: Update flash driver to use reg size
The `size` field of the cros flash driver was from the days of old where we weren't too familiar with DT_ options. Consolidate the binding to make use of the register's size. BRANCH=none BUG=b:202295086 TEST=zmake testall Signed-off-by: Yuval Peress <peress@google.com> Change-Id: I86c312c0d7e7dc798833b47df333cb2499062aaf Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3208912 Reviewed-by: Wai-Hong Tam <waihong@google.com> Commit-Queue: Wai-Hong Tam <waihong@google.com>
-rw-r--r--zephyr/drivers/cros_flash/cros_flash_npcx.c2
-rw-r--r--zephyr/dts/bindings/cros_flash/nuvoton,npcx-cros-flash.yaml4
-rw-r--r--zephyr/include/cros/nuvoton/npcx.dtsi3
3 files changed, 2 insertions, 7 deletions
diff --git a/zephyr/drivers/cros_flash/cros_flash_npcx.c b/zephyr/drivers/cros_flash/cros_flash_npcx.c
index cd9b491fe3..abeabcbf3d 100644
--- a/zephyr/drivers/cros_flash/cros_flash_npcx.c
+++ b/zephyr/drivers/cros_flash/cros_flash_npcx.c
@@ -842,7 +842,7 @@ static const struct npcx_alt cros_flash_alts[] = NPCX_DT_ALT_ITEMS_LIST(0);
static const struct cros_flash_npcx_config cros_flash_cfg = {
.base = DT_INST_REG_ADDR(0),
.clk_cfg = NPCX_DT_CLK_CFG_ITEM(0),
- .size = DT_INST_PROP(0, size),
+ .size = DT_INST_REG_SIZE(0),
.alts_size = ARRAY_SIZE(cros_flash_alts),
.alts_list = cros_flash_alts,
};
diff --git a/zephyr/dts/bindings/cros_flash/nuvoton,npcx-cros-flash.yaml b/zephyr/dts/bindings/cros_flash/nuvoton,npcx-cros-flash.yaml
index 23c0f92c9c..139a6c6a9b 100644
--- a/zephyr/dts/bindings/cros_flash/nuvoton,npcx-cros-flash.yaml
+++ b/zephyr/dts/bindings/cros_flash/nuvoton,npcx-cros-flash.yaml
@@ -14,10 +14,6 @@ properties:
clocks:
required: true
- size:
- type: int
- required: true
-
pinctrl-0:
type: phandles
required: true
diff --git a/zephyr/include/cros/nuvoton/npcx.dtsi b/zephyr/include/cros/nuvoton/npcx.dtsi
index 9c84d5712d..1f8d0c6546 100644
--- a/zephyr/include/cros/nuvoton/npcx.dtsi
+++ b/zephyr/include/cros/nuvoton/npcx.dtsi
@@ -111,9 +111,8 @@
fiu0: cros-flash@40020000 {
compatible = "nuvoton,npcx-cros-flash";
- reg = <0x40020000 0x2000>;
+ reg = <0x40020000 0x80000>;
clocks = <&pcc NPCX_CLOCK_BUS_APB3 NPCX_PWDWN_CTL1 2>;
- size = <0x80000>;
label = "FLASH_INTERFACE_UNIT0";
pinctrl-0 = <>;
};