All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: U-Boot Mailing List <u-boot@lists.denx.de>
Cc: Tom Rini <trini@konsulko.com>, Simon Glass <sjg@chromium.org>,
	Dzmitry Sankouski <dsankouski@gmail.com>,
	Michal Suchanek <msuchanek@suse.de>,
	Philippe Reynes <philippe.reynes@softathome.com>,
	Ramon Fried <rfried.dev@gmail.com>,
	Rasmus Villemoes <rasmus.villemoes@prevas.dk>,
	Robert Marko <robimarko@gmail.com>,
	Sean Anderson <sean.anderson@seco.com>,
	Sergei Antonov <saproj@gmail.com>
Subject: [PATCH v5 23/44] sandbox: Tidy up RTC options
Date: Wed, 22 Feb 2023 09:34:04 -0700	[thread overview]
Message-ID: <20230222163425.2043934-24-sjg@chromium.org> (raw)
In-Reply-To: <20230222163425.2043934-1-sjg@chromium.org>

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>
---

(no changes since v3)

Changes in v3:
- Fix a transitory build error with sandbox_spl

 arch/sandbox/dts/sandbox.dts   |  2 +-
 arch/sandbox/dts/sandbox.dtsi  |  6 +++---
 arch/sandbox/include/asm/rtc.h |  2 +-
 drivers/rtc/Kconfig            | 18 ++++++++++++++++++
 drivers/rtc/Makefile           |  4 ++--
 5 files changed, 25 insertions(+), 7 deletions(-)

diff --git a/arch/sandbox/dts/sandbox.dts b/arch/sandbox/dts/sandbox.dts
index a4c1b8f6cb7..e9b6745d2db 100644
--- a/arch/sandbox/dts/sandbox.dts
+++ b/arch/sandbox/dts/sandbox.dts
@@ -76,7 +76,7 @@
 		clock-frequency = <400000>;
 		pinctrl-names = "default";
 		pinctrl-0 = <&pinctrl_i2c0>;
-		bootph-all;
+		bootph-pre-ram;
 	};
 
 	pcic: pci@0 {
diff --git a/arch/sandbox/dts/sandbox.dtsi b/arch/sandbox/dts/sandbox.dtsi
index 1f446e62e16..30a305c4d20 100644
--- a/arch/sandbox/dts/sandbox.dtsi
+++ b/arch/sandbox/dts/sandbox.dtsi
@@ -115,7 +115,7 @@
 			reg = <0x43>;
 			compatible = "sandbox-rtc";
 			sandbox,emul = <&emul0>;
-			bootph-all;
+			bootph-pre-ram;
 		};
 		sandbox_pmic: sandbox_pmic {
 			reg = <0x40>;
@@ -126,7 +126,7 @@
 		};
 
 		i2c_emul: emul {
-			bootph-all;
+			bootph-pre-ram;
 			reg = <0xff>;
 			compatible = "sandbox,i2c-emul-parent";
 			emul_eeprom: emul-eeprom {
@@ -136,7 +136,7 @@
 				#emul-cells = <0>;
 			};
 			emul0: emul0 {
-				bootph-all;
+				bootph-pre-ram;
 				compatible = "sandbox,i2c-rtc-emul";
 				#emul-cells = <0>;
 			};
diff --git a/arch/sandbox/include/asm/rtc.h b/arch/sandbox/include/asm/rtc.h
index 025cd6c67cf..bf3ac5ea1ec 100644
--- a/arch/sandbox/include/asm/rtc.h
+++ b/arch/sandbox/include/asm/rtc.h
@@ -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;
diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig
index 35b6ed4d7c7..fcfda2847c8 100644
--- a/drivers/rtc/Kconfig
+++ b/drivers/rtc/Kconfig
@@ -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
diff --git a/drivers/rtc/Makefile b/drivers/rtc/Makefile
index 447551e15aa..b6c9029c8f0 100644
--- a/drivers/rtc/Makefile
+++ b/drivers/rtc/Makefile
@@ -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
-- 
2.39.2.637.g21b0678d19-goog


  parent reply	other threads:[~2023-02-22 16:49 UTC|newest]

Thread overview: 94+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-22 16:33 [PATCH v5 00/44] More tidy-ups of Kconfig options Simon Glass
2023-02-22 16:33 ` [PATCH v5 01/44] mtd: Drop unused kb9202_nand driver Simon Glass
2023-03-03 23:41   ` Tom Rini
2023-02-22 16:33 ` [PATCH v5 02/44] mtd: Drop unused CONFIG_ONENAND_U_BOOT Simon Glass
2023-03-03 23:41   ` Tom Rini
2023-02-22 16:33 ` [PATCH v5 03/44] sh4: Drop unused twl6030 driver Simon Glass
2023-03-03 23:41   ` Tom Rini
2023-02-22 16:33 ` [PATCH v5 04/44] moveconfig: Update to detect / correct missing SPL Kconfigs Simon Glass
2023-02-22 16:33 ` [PATCH v5 05/44] bootstd: Disable QFW bootmeth in SPL Simon Glass
2023-03-03 23:41   ` Tom Rini
2023-02-22 16:33 ` [PATCH v5 06/44] Correct SPL uses of ARCH_MVEBU Simon Glass
2023-02-22 16:33 ` [PATCH v5 07/44] Correct SPL uses of DISPLAY_AER_FULL Simon Glass
2023-03-03 23:41   ` Tom Rini
2023-02-22 16:33 ` [PATCH v5 08/44] Correct SPL uses of MULTIPLEXER Simon Glass
2023-03-03 23:41   ` Tom Rini
2023-02-22 16:33 ` [PATCH v5 09/44] Correct SPL use of PG_WCOM_UBOOT_UPDATE_SUPPORTED Simon Glass
2023-03-03 23:41   ` Tom Rini
2023-02-22 16:33 ` [PATCH v5 10/44] Correct SPL uses of PHY_FIXED Simon Glass
2023-03-03 23:41   ` Tom Rini
2023-02-22 16:33 ` [PATCH v5 11/44] boot: Add Kconfigs for BOOTMETH_VBE_REQUEST Simon Glass
2023-03-03 23:41   ` Tom Rini
2023-02-22 16:33 ` [PATCH v5 12/44] Correct SPL use of DM_RNG Simon Glass
2023-03-03 23:41   ` Tom Rini
2023-02-22 16:33 ` [PATCH v5 13/44] lib: Add a Kconfig for SPL_BZIP2 Simon Glass
2023-03-03 23:41   ` Tom Rini
2023-02-22 16:33 ` [PATCH v5 14/44] moveconfig: Various minor improvements Simon Glass
2023-02-22 16:33 ` [PATCH v5 15/44] sandbox: Expand size for VPL image Simon Glass
2023-03-03 23:42   ` Tom Rini
2023-02-22 16:33 ` [PATCH v5 16/44] event: Add Kconfig options for SPL Simon Glass
2023-03-03 23:42   ` Tom Rini
2023-02-22 16:33 ` [PATCH v5 17/44] bootstd: Correct 'VPL' typo Simon Glass
2023-03-03 23:42   ` Tom Rini
2023-02-22 16:33 ` [PATCH v5 18/44] env: Avoid checking ENV_IS_IN when env disabled Simon Glass
2023-03-02 17:25   ` Tom Rini
2023-02-22 16:34 ` [PATCH v5 19/44] env: Allow VPL environment to be nowhere Simon Glass
2023-03-03 23:42   ` Tom Rini
2023-02-22 16:34 ` [PATCH v5 20/44] lib: Add VPL options for SHA1 and SHA256 Simon Glass
2023-03-03 23:42   ` Tom Rini
2023-02-22 16:34 ` [PATCH v5 21/44] x86: Use string functions for all 32-bit builds Simon Glass
2023-03-02 20:37   ` Tom Rini
2023-03-15 14:05     ` Simon Glass
2023-02-22 16:34 ` [PATCH v5 22/44] lib: Fix build condition for tiny-printf Simon Glass
2023-03-03 23:42   ` Tom Rini
2023-02-22 16:34 ` Simon Glass [this message]
2023-03-03 23:42   ` [PATCH v5 23/44] sandbox: Tidy up RTC options Tom Rini
2023-02-22 16:34 ` [PATCH v5 24/44] sandbox: Use the generic VPL option to enable VPL Simon Glass
2023-03-03 23:42   ` Tom Rini
2023-02-22 16:34 ` [PATCH v5 25/44] sandbox: Tidy up I2C options Simon Glass
2023-02-23  5:43   ` Heiko Schocher
2023-03-03 23:42   ` Tom Rini
2023-02-22 16:34 ` [PATCH v5 26/44] fixdep: Add support for VPL Simon Glass
2023-02-22 16:34 ` [PATCH v5 27/44] fixdep: Refactor to make testing easier Simon Glass
2023-02-22 16:34 ` [PATCH v5 28/44] fixdep: Add some tests for parse_config_line() Simon Glass
2023-02-22 16:34 ` [PATCH v5 29/44] test: Add SPL versions of the TEST_KCONFIG options Simon Glass
2023-02-22 16:34 ` [PATCH v5 30/44] lib: Add an SPL config for LIB_UUID Simon Glass
2023-02-23  6:14   ` Heinrich Schuchardt
2023-02-23 23:07     ` Simon Glass
2023-03-03 23:42   ` Tom Rini
2023-02-22 16:34 ` [PATCH v5 31/44] test: Tidy up sandbox handling in test-main Simon Glass
2023-03-03 23:42   ` Tom Rini
2023-02-22 16:34 ` [PATCH v5 32/44] x86: Fix up use of X86_32BIT_INIT and X86_64 options Simon Glass
2023-03-03 14:50   ` Tom Rini
2023-03-06 17:53     ` Simon Glass
2023-02-22 16:34 ` [PATCH v5 33/44] Add VPL options for BLOBLIST Simon Glass
2023-03-03 23:42   ` Tom Rini
2023-02-22 16:34 ` [PATCH v5 34/44] rockchip: Avoid checking environment without ENV_SUPPORT Simon Glass
2023-02-23 16:16   ` Quentin Schulz
2023-02-22 16:34 ` [PATCH v5 35/44] freescale: Drop old pre-DM_ETH code Simon Glass
2023-03-03 23:42   ` Tom Rini
2023-02-22 16:34 ` [PATCH v5 36/44] imx: Use SATA instead of CMD_SATA Simon Glass
2023-02-22 16:43   ` Baruch Siach
2023-02-22 19:16     ` Simon Glass
2023-03-03 23:42   ` Tom Rini
2023-02-22 16:34 ` [PATCH v5 37/44] net: Add an SPL config for atheros Simon Glass
2023-03-03 23:42   ` Tom Rini
2023-02-22 16:34 ` [PATCH v5 38/44] freescale: Fix odd use of ESDHCI_QUIRK_BROKEN_TIMEOUT_VALUE Simon Glass
2023-03-02 20:42   ` Tom Rini
2023-02-22 16:34 ` [PATCH v5 39/44] serial: Support ns16550 driver in TPL Simon Glass
2023-03-03 23:42   ` Tom Rini
2023-02-22 16:34 ` [PATCH v5 40/44] dm: Add a TPL symbol for simple-bus Simon Glass
2023-03-03 23:43   ` Tom Rini
2023-02-22 16:34 ` [PATCH v5 41/44] x86: coral: Add missing TPL options Simon Glass
2023-03-03 23:43   ` Tom Rini
2023-02-22 16:34 ` [PATCH v5 42/44] power: wandboard: Add a missing CONFIG Simon Glass
2023-03-03 23:43   ` Tom Rini
2023-02-22 16:34 ` [PATCH v5 43/44] venice: Simplify conditions for network init Simon Glass
2023-03-03 23:43   ` Tom Rini
2023-02-22 16:34 ` [PATCH v5 44/44] command: Don't allow commands in SPL Simon Glass
2023-03-02 20:30   ` Tom Rini
2023-03-03 23:43   ` Tom Rini
2023-03-03 23:43 ` [PATCH v5 00/44] More tidy-ups of Kconfig options Tom Rini
2023-03-06 18:20   ` Simon Glass
2023-03-11 15:28     ` Tom Rini
2023-03-11 19:34       ` Simon Glass

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230222163425.2043934-24-sjg@chromium.org \
    --to=sjg@chromium.org \
    --cc=dsankouski@gmail.com \
    --cc=msuchanek@suse.de \
    --cc=philippe.reynes@softathome.com \
    --cc=rasmus.villemoes@prevas.dk \
    --cc=rfried.dev@gmail.com \
    --cc=robimarko@gmail.com \
    --cc=saproj@gmail.com \
    --cc=sean.anderson@seco.com \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.