]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
sandbox: Tidy up RTC options
authorSimon Glass <sjg@chromium.org>
Wed, 22 Feb 2023 16:34:04 +0000 (09:34 -0700)
committerTom Rini <trini@konsulko.com>
Thu, 2 Mar 2023 22:45:58 +0000 (17:45 -0500)
At present we enable the sandbox RTC driver for all builds. Add a separate
Kconfig option to control this, so that it can be disabled in TPL, where
it is not needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
arch/sandbox/dts/sandbox.dts
arch/sandbox/dts/sandbox.dtsi
arch/sandbox/include/asm/rtc.h
drivers/rtc/Kconfig
drivers/rtc/Makefile

index a4c1b8f6cb7d96378c6cfa7891c94ecc0a65a21a..e9b6745d2db7b73f1e36183c829cee2373a799a3 100644 (file)
@@ -76,7 +76,7 @@
                clock-frequency = <400000>;
                pinctrl-names = "default";
                pinctrl-0 = <&pinctrl_i2c0>;
-               bootph-all;
+               bootph-pre-ram;
        };
 
        pcic: pci@0 {
index 1f446e62e16ebee7de4a8e77939cb7defcc15937..30a305c4d208bf4ed90a0dab44b0e75ee8e0838e 100644 (file)
                        reg = <0x43>;
                        compatible = "sandbox-rtc";
                        sandbox,emul = <&emul0>;
-                       bootph-all;
+                       bootph-pre-ram;
                };
                sandbox_pmic: sandbox_pmic {
                        reg = <0x40>;
                };
 
                i2c_emul: emul {
-                       bootph-all;
+                       bootph-pre-ram;
                        reg = <0xff>;
                        compatible = "sandbox,i2c-emul-parent";
                        emul_eeprom: emul-eeprom {
                                #emul-cells = <0>;
                        };
                        emul0: emul0 {
-                               bootph-all;
+                               bootph-pre-ram;
                                compatible = "sandbox,i2c-rtc-emul";
                                #emul-cells = <0>;
                        };
index 025cd6c67cf02e7a345260f771c5d2f61184468a..bf3ac5ea1ec9f45c69c32513f4cfa7a2225512d9 100644 (file)
@@ -40,7 +40,7 @@ enum {
  * @reg:               Register values
  */
 struct sandbox_i2c_rtc_plat_data {
-#if CONFIG_IS_ENABLED(OF_PLATDATA)
+#if CONFIG_IS_ENABLED(OF_PLATDATA) && IS_ENABLED(CONFIG_RTC_SANDBOX)
        struct dtd_sandbox_i2c_rtc_emul dtplat;
 #endif
        long base_time;
index 35b6ed4d7c726c5df0620c21e5a066929fcc660d..fcfda2847c8228d4c20cf2ab4b47f4270f884f33 100644 (file)
@@ -231,6 +231,24 @@ config RTC_M41T62
          Enable driver for ST's M41T62 compatible RTC devices (like RV-4162).
          It is a serial (I2C) real-time clock (RTC) with alarm.
 
+config RTC_SANDBOX
+       bool "Enable sandbox RTC driver"
+       depends on SANDBOX && DM_RTC
+       default y
+       help
+         Enable the sandbox RTC driver. This driver connects to the RTC
+         emulator and is used to test the RTC uclasses and associated code,
+         as well as the I2C subsystem.
+
+config SPL_RTC_SANDBOX
+       bool "Enable sandbox RTC driver (SPL)"
+       depends on SANDBOX && SPL_DM_RTC
+       default y
+       help
+         Enable the sandbox RTC driver. This driver connects to the RTC
+         emulator and is used to test the RTC uclasses and associated code,
+         as well as the I2C subsystem.
+
 config RTC_STM32
        bool "Enable STM32 RTC driver"
        depends on DM_RTC
index 447551e15aa20b098c76eb1d9f4e2b9b1ac6979b..b6c9029c8f09ce55f71cb1c3d366e5302f77896e 100644 (file)
@@ -16,7 +16,7 @@ obj-$(CONFIG_RTC_DS3231) += ds3231.o
 obj-$(CONFIG_RTC_DS3232) += ds3232.o
 obj-$(CONFIG_RTC_EMULATION) += emul_rtc.o
 obj-$(CONFIG_RTC_HT1380) += ht1380.o
-obj-$(CONFIG_SANDBOX) += i2c_rtc_emul.o
+obj-$(CONFIG_$(SPL_TPL_)RTC_SANDBOX) += i2c_rtc_emul.o
 obj-$(CONFIG_RTC_ISL1208) += isl1208.o
 obj-$(CONFIG_RTC_M41T62) += m41t62.o
 obj-$(CONFIG_RTC_MC13XXX) += mc13xxx-rtc.o
@@ -35,6 +35,6 @@ obj-$(CONFIG_RTC_RX8025) += rx8025.o
 obj-$(CONFIG_RTC_RX8010SJ) += rx8010sj.o
 obj-$(CONFIG_RTC_S35392A) += s35392a.o
 obj-$(CONFIG_RTC_STM32) += stm32_rtc.o
-obj-$(CONFIG_SANDBOX) += sandbox_rtc.o
+obj-$(CONFIG_$(SPL_TPL_)RTC_SANDBOX) += sandbox_rtc.o
 obj-$(CONFIG_RTC_ABX80X) += abx80x.o
 obj-$(CONFIG_RTC_ZYNQMP) += zynqmp_rtc.o