diff options
author | Wai-Hong Tam <waihong@google.com> | 2021-07-19 20:08:22 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-07-20 20:56:57 +0000 |
commit | 4b2bc28799c4641a0ac302fd37171e3fb9080210 (patch) | |
tree | d3af319cb737fac987a35b300cf8360aa9b74f81 /zephyr | |
parent | 87657e7f7cc0a8b356dffb736ac35a076c3ade58 (diff) | |
download | chrome-ec-4b2bc28799c4641a0ac302fd37171e3fb9080210.tar.gz |
zephyr: herobrine: Move I2C related dts from board to project
Make the board dts file simpler and easier to be merged to other boards
which use the same chip.
BRANCH=None
BUG=b:192253134, b:193814903
TEST=Built the Zephyr herobrine_npcx9 image successfully.
Change-Id: I53a15a47511eb875bbfd50906f5a11d3a69d48ea
Signed-off-by: Wai-Hong Tam <waihong@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3039387
Diffstat (limited to 'zephyr')
-rw-r--r-- | zephyr/boards/arm/herobrine_npcx9/herobrine_npcx9.dts | 96 | ||||
-rw-r--r-- | zephyr/projects/herobrine/herobrine_npcx9/i2c.dts | 104 | ||||
-rw-r--r-- | zephyr/projects/herobrine/herobrine_npcx9/zmake.yaml | 1 |
3 files changed, 105 insertions, 96 deletions
diff --git a/zephyr/boards/arm/herobrine_npcx9/herobrine_npcx9.dts b/zephyr/boards/arm/herobrine_npcx9/herobrine_npcx9.dts index 2315522527..ac69400edb 100644 --- a/zephyr/boards/arm/herobrine_npcx9/herobrine_npcx9.dts +++ b/zephyr/boards/arm/herobrine_npcx9/herobrine_npcx9.dts @@ -14,15 +14,6 @@ / { model = "Google Herobrine-NPCX9 Baseboard"; - aliases { - i2c-0 = &i2c0_0; - i2c-1 = &i2c1_0; - i2c-2 = &i2c2_0; - i2c-3 = &i2c3_0; - i2c-5 = &i2c5_0; - i2c-7 = &i2c7_0; - }; - chosen { zephyr,sram = &sram0; zephyr,console = &uart1; @@ -56,57 +47,6 @@ MKBP_EVENT_SENSOR_FIFO)>; }; - named-i2c-ports { - compatible = "named-i2c-ports"; - - power { - i2c-port = <&i2c0_0>; - enum-name = "I2C_PORT_POWER"; - label = "POWER"; - }; - battery { - i2c-port = <&i2c0_0>; - remote-port = <0>; - enum-name = "I2C_PORT_BATTERY"; - label = "BATTERY"; - }; - virtual { - i2c-port = <&i2c0_0>; - enum-name = "I2C_PORT_VIRTUAL"; - label = "VIRTUAL"; - }; - charger { - i2c-port = <&i2c0_0>; - enum-name = "I2C_PORT_CHARGER"; - label = "CHARGER"; - }; - tcpc0 { - i2c-port = <&i2c1_0>; - enum-name = "I2C_PORT_TCPC0"; - label = "TCPC0"; - }; - tcpc1 { - i2c-port = <&i2c2_0>; - enum-name = "I2C_PORT_TCPC1"; - label = "TCPC1"; - }; - eeprom { - i2c-port = <&i2c5_0>; - enum-name = "I2C_PORT_EEPROM"; - label = "EEPROM"; - }; - i2c_sensor: sensor { - i2c-port = <&i2c7_0>; - enum-name = "I2C_PORT_SENSOR"; - label = "SENSOR"; - }; - accel { - i2c-port = <&i2c7_0>; - enum-name = "I2C_PORT_ACCEL"; - label = "ACCEL"; - }; - }; - named-pwms { compatible = "named-pwms"; @@ -163,42 +103,6 @@ pinctrl-0 = <&altj_cr_sin1_sl2 &altj_cr_sout1_sl2>; }; -&i2c0_0 { - status = "okay"; - clock-frequency = <I2C_BITRATE_STANDARD>; - - isl9238: isl9238@9 { - compatible = "intersil,isl9238"; - reg = <0x09>; - label = "ISL9238_CHARGER"; - }; -}; - -&i2c1_0 { - status = "okay"; - clock-frequency = <I2C_BITRATE_FAST_PLUS>; -}; - -&i2c2_0 { - status = "okay"; - clock-frequency = <I2C_BITRATE_FAST_PLUS>; -}; - -&i2c3_0 { - /* Not used as no WLC connected */ - clock-frequency = <I2C_BITRATE_FAST>; -}; - -&i2c5_0 { - status = "okay"; - clock-frequency = <I2C_BITRATE_FAST>; -}; - -&i2c7_0 { - status = "okay"; - clock-frequency = <I2C_BITRATE_FAST>; -}; - /* Keyboard backlight */ &pwm3 { status = "okay"; diff --git a/zephyr/projects/herobrine/herobrine_npcx9/i2c.dts b/zephyr/projects/herobrine/herobrine_npcx9/i2c.dts new file mode 100644 index 0000000000..1caba088c9 --- /dev/null +++ b/zephyr/projects/herobrine/herobrine_npcx9/i2c.dts @@ -0,0 +1,104 @@ +/* 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. + */ + +/ { + aliases { + i2c-0 = &i2c0_0; + i2c-1 = &i2c1_0; + i2c-2 = &i2c2_0; + i2c-3 = &i2c3_0; + i2c-5 = &i2c5_0; + i2c-7 = &i2c7_0; + }; + + named-i2c-ports { + compatible = "named-i2c-ports"; + + power { + i2c-port = <&i2c0_0>; + enum-name = "I2C_PORT_POWER"; + label = "POWER"; + }; + battery { + i2c-port = <&i2c0_0>; + remote-port = <0>; + enum-name = "I2C_PORT_BATTERY"; + label = "BATTERY"; + }; + virtual { + i2c-port = <&i2c0_0>; + enum-name = "I2C_PORT_VIRTUAL"; + label = "VIRTUAL"; + }; + charger { + i2c-port = <&i2c0_0>; + enum-name = "I2C_PORT_CHARGER"; + label = "CHARGER"; + }; + tcpc0 { + i2c-port = <&i2c1_0>; + enum-name = "I2C_PORT_TCPC0"; + label = "TCPC0"; + }; + tcpc1 { + i2c-port = <&i2c2_0>; + enum-name = "I2C_PORT_TCPC1"; + label = "TCPC1"; + }; + eeprom { + i2c-port = <&i2c5_0>; + enum-name = "I2C_PORT_EEPROM"; + label = "EEPROM"; + }; + i2c_sensor: sensor { + i2c-port = <&i2c7_0>; + enum-name = "I2C_PORT_SENSOR"; + label = "SENSOR"; + }; + accel { + i2c-port = <&i2c7_0>; + enum-name = "I2C_PORT_ACCEL"; + label = "ACCEL"; + }; + }; + + +}; + +&i2c0_0 { + status = "okay"; + clock-frequency = <I2C_BITRATE_STANDARD>; + + isl9238: isl9238@9 { + compatible = "intersil,isl9238"; + reg = <0x09>; + label = "ISL9238_CHARGER"; + }; +}; + +&i2c1_0 { + status = "okay"; + clock-frequency = <I2C_BITRATE_FAST_PLUS>; +}; + +&i2c2_0 { + status = "okay"; + clock-frequency = <I2C_BITRATE_FAST_PLUS>; +}; + +&i2c3_0 { + /* Not used as no WLC connected */ + clock-frequency = <I2C_BITRATE_FAST>; +}; + +&i2c5_0 { + status = "okay"; + clock-frequency = <I2C_BITRATE_FAST>; +}; + +&i2c7_0 { + status = "okay"; + clock-frequency = <I2C_BITRATE_FAST>; +}; diff --git a/zephyr/projects/herobrine/herobrine_npcx9/zmake.yaml b/zephyr/projects/herobrine/herobrine_npcx9/zmake.yaml index 7620beedc4..5f93cd9f45 100644 --- a/zephyr/projects/herobrine/herobrine_npcx9/zmake.yaml +++ b/zephyr/projects/herobrine/herobrine_npcx9/zmake.yaml @@ -6,6 +6,7 @@ board: herobrine_npcx9 dts-overlays: - gpio.dts - battery.dts + - i2c.dts - motionsense.dts supported-zephyr-versions: - v2.6 |