From mboxrd@z Thu Jan 1 00:00:00 1970 From: Heinrich Schuchardt Date: Thu, 11 Oct 2018 21:21:52 +0200 Subject: [U-Boot] [U-Boot,11/45] rtc: Allow use of RTC in SPL and TPL In-Reply-To: <20181001182249.129565-12-sjg@chromium.org> References: <20181001182249.129565-12-sjg@chromium.org> Message-ID: <6bfaaf8c-ec3f-c12e-4d23-1387228113e6@gmx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 10/01/2018 08:22 PM, Simon Glass wrote: > Add Kconfig options so that the RTC can be used in SPL and TPL. This is > helpful for accessing the contents of CMOS RAM, for example. > > Signed-off-by: Simon Glass > Signed-off-by: Simon Glass > --- Hello Simon, with this patch x86_64 does not boot anymore: $ qemu-system-x86_64 -bios u-boot.rom -nographic --enable-kvm --cpu host ### ERROR ### Please RESET the board ### I am currently testing Bin's patch series: https://patchwork.ozlabs.org/project/uboot/list/?series=70127 [U-Boot,1/4] x86: Specify -march=core2 to build 64-bit U-Boot proper > > drivers/rtc/Kconfig | 18 ++++++++++++++++++ > drivers/rtc/Makefile | 2 +- > drivers/rtc/rtc-uclass.c | 1 + > 3 files changed, 20 insertions(+), 1 deletion(-) > > diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig > index 97cf7d84dfa..bcc01b135e5 100644 > --- a/drivers/rtc/Kconfig > +++ b/drivers/rtc/Kconfig > @@ -13,6 +13,24 @@ config DM_RTC > drivers to perform the actual functions. See rtc.h for a > description of the API. > > +config SPL_DM_RTC > + bool "Enable Driver Model for RTC drivers in SPL" > + depends on SPL_DM > + help > + Enable drver model for real-time-clock drivers. The RTC uclass > + then provides the rtc_get()/rtc_set() interface, delegating to > + drivers to perform the actual functions. See rtc.h for a > + description of the API. > + > +config TPL_DM_RTC > + bool "Enable Driver Model for RTC drivers in TPL" > + depends on TPL_DM > + help > + Enable drver model for real-time-clock drivers. The RTC uclass > + then provides the rtc_get()/rtc_set() interface, delegating to > + drivers to perform the actual functions. See rtc.h for a > + description of the API. > + > config RTC_PCF2127 > bool "Enable PCF2127 driver" > depends on DM_RTC > diff --git a/drivers/rtc/Makefile b/drivers/rtc/Makefile > index 513e3ffc079..1724602f1cb 100644 > --- a/drivers/rtc/Makefile > +++ b/drivers/rtc/Makefile > @@ -4,7 +4,7 @@ > # Wolfgang Denk, DENX Software Engineering, wd at denx.de. > #ccflags-y += -DDEBUG > > -obj-$(CONFIG_DM_RTC) += rtc-uclass.o > +obj-$(CONFIG_$(SPL_TPL_)DM_RTC) += rtc-uclass.o This is the line to be reverted. Best regards Heinrich > > obj-$(CONFIG_RTC_AT91SAM9_RTT) += at91sam9_rtt.o > obj-y += date.o > diff --git a/drivers/rtc/rtc-uclass.c b/drivers/rtc/rtc-uclass.c > index c676f0ff359..a0a238aedda 100644 > --- a/drivers/rtc/rtc-uclass.c > +++ b/drivers/rtc/rtc-uclass.c > @@ -122,4 +122,5 @@ int rtc_write32(struct udevice *dev, unsigned int reg, u32 value) > UCLASS_DRIVER(rtc) = { > .name = "rtc", > .id = UCLASS_RTC, > + .post_bind = dm_scan_fdt_dev, > }; >