From d921605694c3a6e371d081e057aee7d976eb20aa Mon Sep 17 00:00:00 2001 From: Yuval Peress Date: Wed, 6 Oct 2021 12:07:17 -0600 Subject: 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 Change-Id: I86c312c0d7e7dc798833b47df333cb2499062aaf Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3208912 Reviewed-by: Wai-Hong Tam Commit-Queue: Wai-Hong Tam --- zephyr/drivers/cros_flash/cros_flash_npcx.c | 2 +- zephyr/dts/bindings/cros_flash/nuvoton,npcx-cros-flash.yaml | 4 ---- zephyr/include/cros/nuvoton/npcx.dtsi | 3 +-- 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 = <>; }; -- cgit v1.2.1