summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabio Baltieri <fabiobaltieri@google.com>2022-11-03 12:24:54 +0000
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-11-09 10:19:20 +0000
commit49e7bf91d1e474d82a4918cab1da56290cb41124 (patch)
treee59ed7f7b8e5d6cd7b03ca5995730206173571d5
parenta4ca8b234ff5d77b6c935756cc76eaca1b7cb4b7 (diff)
downloadchrome-ec-49e7bf91d1e474d82a4918cab1da56290cb41124.tar.gz
zephyr: rtc: select CROS_RTC_TYPE automatically
Use DT_HAS_* config to select the correct RTC TYPE automatically. BRANCH=none BUG=none TEST=cq dry run Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Change-Id: I7895d7a1cae339f168c063e225222222ff434cbd Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4003278 Reviewed-by: Sam Hurst <shurst@google.com> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
-rw-r--r--zephyr/drivers/cros_rtc/Kconfig7
-rw-r--r--zephyr/program/herobrine/program.conf1
-rw-r--r--zephyr/program/trogdor/lazor/prj.conf1
3 files changed, 6 insertions, 3 deletions
diff --git a/zephyr/drivers/cros_rtc/Kconfig b/zephyr/drivers/cros_rtc/Kconfig
index 2839b03c62..fb84416d70 100644
--- a/zephyr/drivers/cros_rtc/Kconfig
+++ b/zephyr/drivers/cros_rtc/Kconfig
@@ -6,7 +6,12 @@ if PLATFORM_EC_RTC && !ARCH_POSIX
choice CROS_RTC_TYPE
prompt "Select the RTC to use"
- default CROS_RTC_NPCX if SOC_FAMILY_NPCX
+ # List standalone controllers before embedded once so that they get
+ # higher priority.
+ default CROS_RTC_NXP_PCF85063A if DT_HAS_NXP_RTC_PCF85063A_ENABLED
+ default CROS_RTC_RENESAS_IDT1337AG if DT_HAS_RENESAS_RTC_IDT1337AG_ENABLED
+ default CROS_RTC_NPCX if DT_HAS_NUVOTON_NPCX_CROS_MTC_ENABLED
+ default CROS_RTC_XEC if DT_HAS_MICROCHIP_XEC_CROS_RTC_ENABLED
help
Select the RTC used on the board.
diff --git a/zephyr/program/herobrine/program.conf b/zephyr/program/herobrine/program.conf
index 18ebb67471..961a47dcb0 100644
--- a/zephyr/program/herobrine/program.conf
+++ b/zephyr/program/herobrine/program.conf
@@ -126,7 +126,6 @@ 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
CONFIG_PLATFORM_EC_CONSOLE_CMD_RTC_ALARM=y
diff --git a/zephyr/program/trogdor/lazor/prj.conf b/zephyr/program/trogdor/lazor/prj.conf
index 60822404ce..2674945090 100644
--- a/zephyr/program/trogdor/lazor/prj.conf
+++ b/zephyr/program/trogdor/lazor/prj.conf
@@ -121,7 +121,6 @@ CONFIG_PLATFORM_EC_USB_PID=0x5043
# RTC
CONFIG_PLATFORM_EC_RTC=y
-CONFIG_CROS_RTC_NPCX=y
CONFIG_PLATFORM_EC_HOSTCMD_RTC=y
CONFIG_PLATFORM_EC_CONSOLE_CMD_RTC=y