Skip to content

Commit bfeb504

Browse files
akanisetticarlescufi
authored andcommitted
drivers: rtc: rtc_mc146818: Added RTC driver for Motorola MC146818B
Added RTC driver that supports Motorola MC146818B Enabled RTC set/get time and alarm, alarm callback and update callback. Counter and RTC uses same hardware in case of Motorola MC146818, so they can't be used at a time. Updated stand-alone mc146818 counter dts instances to support rtc and counter with same compatible string of "motorola,mc146818" on ia32, atom, apollo_lake, elhart_lake and raptor_lake platforms. Signed-off-by: Anisetti Avinash Krishna <[email protected]>
1 parent 5076476 commit bfeb504

16 files changed

+642
-12
lines changed

boards/x86/ehl_crb/ehl_crb.dts

+4
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,8 @@
2121
zephyr,console = &uart2;
2222
zephyr,shell-uart = &uart2;
2323
};
24+
25+
aliases {
26+
rtc = &rtc;
27+
};
2428
};

boards/x86/ehl_crb/ehl_crb.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ ram: 2048
99
supported:
1010
- gpio
1111
- smbus
12+
- rtc
1213
testing:
1314
ignore_tags:
1415
- net

boards/x86/qemu_x86/qemu_x86.dts

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
uart-1 = &uart1;
3030
eeprom-0 = &eeprom0;
3131
eeprom-1 = &eeprom1;
32+
rtc = &rtc;
3233
};
3334

3435
chosen {

boards/x86/rpl_crb/rpl_crb.dts

+1
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,6 @@
2323

2424
aliases {
2525
watchdog0 = &tco_wdt;
26+
rtc = &rtc;
2627
};
2728
};

boards/x86/rpl_crb/rpl_crb.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ ram: 2048
88
supported:
99
- smbus
1010
- watchdog
11+
- rtc
1112
testing:
1213
ignore_tags:
1314
- net

drivers/counter/Kconfig.cmos

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55

66
config COUNTER_CMOS
77
bool "Counter driver for x86 CMOS/RTC clock"
8-
default y
8+
default y if !RTC
99
depends on DT_HAS_MOTOROLA_MC146818_ENABLED

drivers/rtc/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ zephyr_library()
66
zephyr_library_sources_ifdef(CONFIG_USERSPACE rtc_handlers.c)
77
zephyr_library_sources_ifdef(CONFIG_RTC_EMUL rtc_emul.c)
88
zephyr_library_sources_ifdef(CONFIG_RTC_PCF8523 rtc_pcf8523.c)
9+
zephyr_library_sources_ifdef(CONFIG_RTC_MOTOROLA_MC146818 rtc_mc146818.c)

drivers/rtc/Kconfig

+1
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,6 @@ config RTC_CALIBRATION
3737

3838
source "drivers/rtc/Kconfig.emul"
3939
source "drivers/rtc/Kconfig.pcf8523"
40+
source "drivers/rtc/Kconfig.mc146818"
4041

4142
endif # RTC

drivers/rtc/Kconfig.mc146818

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Intel SoC RTC configuration options
2+
3+
# Copyright (c) 2023 Intel Corporation
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
config RTC_MOTOROLA_MC146818
7+
bool "RTC driver for x86 CMOS/RTC clock"
8+
default y if !COUNTER
9+
depends on DT_HAS_MOTOROLA_MC146818_ENABLED

0 commit comments

Comments
 (0)