diff options
author | Diana Z <dzigterman@chromium.org> | 2021-10-01 15:09:09 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-10-01 22:40:27 +0000 |
commit | 77d1122fd763f2d25662d45f276e9125adb658f7 (patch) | |
tree | b15f45e16c79736f7c0df42b727608b4dea6dab9 | |
parent | b3278987e1f12943818984870627d8faa6d14b69 (diff) | |
download | chrome-ec-77d1122fd763f2d25662d45f276e9125adb658f7.tar.gz |
Guybrush: Add AEC battery
Add the AEC battery for guybrush to use.
BRANCH=None
BUG=b:195137794
TEST=on guybrush, boot and view battery information
Signed-off-by: Diana Z <dzigterman@chromium.org>
Change-Id: I16540c045e37c8213de367afab1452160b11cbe7
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3200068
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Commit-Queue: Jack Rosenthal <jrosenth@chromium.org>
Tested-by: Jack Rosenthal <jrosenth@chromium.org>
-rw-r--r-- | zephyr/projects/guybrush/battery.dts | 12 | ||||
-rw-r--r-- | zephyr/projects/guybrush/gpio.dts | 1 | ||||
-rw-r--r-- | zephyr/projects/guybrush/i2c.dts | 38 | ||||
-rw-r--r-- | zephyr/projects/guybrush/prj.conf | 10 | ||||
-rw-r--r-- | zephyr/projects/guybrush/zmake.yaml | 2 |
5 files changed, 63 insertions, 0 deletions
diff --git a/zephyr/projects/guybrush/battery.dts b/zephyr/projects/guybrush/battery.dts new file mode 100644 index 0000000000..02a6d0d3b9 --- /dev/null +++ b/zephyr/projects/guybrush/battery.dts @@ -0,0 +1,12 @@ +/* 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. + */ + +/ { + batteries { + default_battery: aec_5477109 { + compatible = "aec,5477109"; + }; + }; +}; diff --git a/zephyr/projects/guybrush/gpio.dts b/zephyr/projects/guybrush/gpio.dts index 221b5f7182..638e95c9fb 100644 --- a/zephyr/projects/guybrush/gpio.dts +++ b/zephyr/projects/guybrush/gpio.dts @@ -206,6 +206,7 @@ ec_batt_pres_odl { gpios = <&gpio9 4 GPIO_INPUT>; label = "EC_BATT_PRES_ODL"; + enum-name = "GPIO_BATT_PRES_ODL"; }; ec_disable_disp_bl { gpios = <&gpioa 6 GPIO_OUT_HIGH>; diff --git a/zephyr/projects/guybrush/i2c.dts b/zephyr/projects/guybrush/i2c.dts new file mode 100644 index 0000000000..699c4b9b7b --- /dev/null +++ b/zephyr/projects/guybrush/i2c.dts @@ -0,0 +1,38 @@ +/* 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-4 = &i2c4_1; + i2c-5 = &i2c5_0; + i2c-7 = &i2c7_0; + }; + + named-i2c-ports { + compatible = "named-i2c-ports"; + + battery { + i2c-port = <&i2c2_0>; + remote-port = <0>; + enum-name = "I2C_PORT_BATTERY"; + label = "BATTERY"; + }; + }; + + +}; + +&i2c2_0 { + status = "okay"; + clock-frequency = <I2C_BITRATE_STANDARD>; +}; + +&i2c_ctrl2 { + status = "okay"; +}; diff --git a/zephyr/projects/guybrush/prj.conf b/zephyr/projects/guybrush/prj.conf index d9f2b31d2f..ab42781282 100644 --- a/zephyr/projects/guybrush/prj.conf +++ b/zephyr/projects/guybrush/prj.conf @@ -41,6 +41,16 @@ CONFIG_PLATFORM_EC_VOLUME_BUTTONS=y CONFIG_SYSCON=y +# Battery +CONFIG_PLATFORM_EC_BATTERY=y +CONFIG_PLATFORM_EC_BATTERY_SMART=y +CONFIG_PLATFORM_EC_BATTERY_FUEL_GAUGE=y +CONFIG_PLATFORM_EC_BATTERY_CUT_OFF=n +CONFIG_PLATFORM_EC_BATTERY_PRESENT_GPIO=y + +CONFIG_PLATFORM_EC_CHARGER=n +CONFIG_PLATFORM_EC_USBC=n + # This is not yet supported CONFIG_PLATFORM_EC_ADC=n CONFIG_PLATFORM_EC_BOARD_VERSION_CBI=n diff --git a/zephyr/projects/guybrush/zmake.yaml b/zephyr/projects/guybrush/zmake.yaml index 8ba8ff2fac..581cc87521 100644 --- a/zephyr/projects/guybrush/zmake.yaml +++ b/zephyr/projects/guybrush/zmake.yaml @@ -4,7 +4,9 @@ board: npcx9 dts-overlays: + - battery.dts - gpio.dts + - i2c.dts supported-toolchains: - coreboot-sdk - zephyr |