summaryrefslogtreecommitdiff
path: root/zephyr
diff options
context:
space:
mode:
authorSam Hurst <shurst@google.com>2021-08-24 11:52:27 -0700
committerCommit Bot <commit-bot@chromium.org>2021-09-04 17:20:27 +0000
commit4e8b71c2a9b18d7d73a5f47d66cbc6e3fc0976ac (patch)
tree8d7a2197ca6a77e0bca69e032c04d5c4a875e8e7 /zephyr
parentfa066d703434a79887b1cc38d545e42a6ee874d7 (diff)
downloadchrome-ec-4e8b71c2a9b18d7d73a5f47d66cbc6e3fc0976ac.tar.gz
herorbrine_npcx9: Use PCF85063A RTC Zephyr driver
Change the RTC driver from the Zephyr MTC driver to the Zephyr PCF85063A driver. BRANCH=none BUG=b:194710429 TEST=ectool rtcset 30000 ectool rtcget Current time: 0x0000753d (30013) ectool rtcsetalarm 10 after ~10 (measured with a timer) printed on ec console: [160.248900 event set 0x0000000002000000] I tested the alarm up to one hour. Signed-off-by: Sam Hurst <shurst@google.com> Change-Id: I6e6f8bb65cb515e0997687ff4beef7620506a57d herorbrine_npcx9: Configure PCF85063A RTC Alert Configure the PCF85063A RTC Alert pin so that it can interrupt the EC on an alarm event. BRANCH=none BUG=b:194710429 TEST=ectool rtcset 30000 ectool rtcget Current time: 0x0000753d (30013) ectool rtcsetalarm 10 after ~10 (measured with a timer) printed on ec console: [160.248900 event set 0x0000000002000000] I tested the alarm up to one hour. Signed-off-by: Sam Hurst <shurst@google.com> Change-Id: I58ac585c2d566d306625dd8034377925eba36293 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3140328 Reviewed-by: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'zephyr')
-rw-r--r--zephyr/boards/arm/herobrine_npcx9/herobrine_npcx9.dts2
-rw-r--r--zephyr/projects/herobrine/herobrine_npcx9/gpio.dts1
-rw-r--r--zephyr/projects/herobrine/herobrine_npcx9/i2c.dts7
-rw-r--r--zephyr/projects/herobrine/herobrine_npcx9/prj.conf1
4 files changed, 10 insertions, 1 deletions
diff --git a/zephyr/boards/arm/herobrine_npcx9/herobrine_npcx9.dts b/zephyr/boards/arm/herobrine_npcx9/herobrine_npcx9.dts
index ac69400edb..34884a8275 100644
--- a/zephyr/boards/arm/herobrine_npcx9/herobrine_npcx9.dts
+++ b/zephyr/boards/arm/herobrine_npcx9/herobrine_npcx9.dts
@@ -19,7 +19,7 @@
zephyr,console = &uart1;
zephyr,shell-uart = &uart1;
zephyr,flash = &flash0;
- cros,rtc = &mtc;
+ cros,rtc = &pcf85063a;
};
ec-console {
diff --git a/zephyr/projects/herobrine/herobrine_npcx9/gpio.dts b/zephyr/projects/herobrine/herobrine_npcx9/gpio.dts
index 1c63f3875c..639fe30a3b 100644
--- a/zephyr/projects/herobrine/herobrine_npcx9/gpio.dts
+++ b/zephyr/projects/herobrine/herobrine_npcx9/gpio.dts
@@ -112,6 +112,7 @@
label = "ACCEL_GYRO_INT_L";
};
gpio_rtc_ec_wake_odl: rtc_ec_wake_odl {
+ #gpio-cells = <0>;
gpios = <&gpio0 2 GPIO_INPUT>;
enum-name = "GPIO_EC_RST_ODL";
label = "EC_RST_ODL";
diff --git a/zephyr/projects/herobrine/herobrine_npcx9/i2c.dts b/zephyr/projects/herobrine/herobrine_npcx9/i2c.dts
index 983f5af1f8..97b6f0661d 100644
--- a/zephyr/projects/herobrine/herobrine_npcx9/i2c.dts
+++ b/zephyr/projects/herobrine/herobrine_npcx9/i2c.dts
@@ -102,6 +102,13 @@
&i2c4_1 {
status = "okay";
clock-frequency = <I2C_BITRATE_FAST>;
+
+ pcf85063a: pcf85063a@51 {
+ compatible = "nxp,rtc-pcf85063a";
+ reg = <0x51>;
+ label = "RTC_PCF85063A";
+ int-gpios = <&gpio_rtc_ec_wake_odl>;
+ };
};
&i2c5_0 {
diff --git a/zephyr/projects/herobrine/herobrine_npcx9/prj.conf b/zephyr/projects/herobrine/herobrine_npcx9/prj.conf
index bcaa22fad0..16e6bd5be6 100644
--- a/zephyr/projects/herobrine/herobrine_npcx9/prj.conf
+++ b/zephyr/projects/herobrine/herobrine_npcx9/prj.conf
@@ -130,6 +130,7 @@ CONFIG_PLATFORM_EC_USB_PID=0x5055
# RTC
CONFIG_PLATFORM_EC_RTC=y
+CONFIG_CROS_RTC_NXP_PCF85063A=y
CONFIG_PLATFORM_EC_HOSTCMD_RTC=y
CONFIG_PLATFORM_EC_CONSOLE_CMD_RTC=y