From patchwork Wed Jul 11 09:06:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 141695 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp39559ljj; Wed, 11 Jul 2018 02:05:41 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdHIhRSlJv42GIRI2WQtjMnALq6YWBR+3aXt8dIJbiUBqexLG1TNKhCcM7LgvlWmusaMEO6 X-Received: by 2002:a50:8561:: with SMTP id 88-v6mr31061827edr.181.1531299941455; Wed, 11 Jul 2018 02:05:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531299941; cv=none; d=google.com; s=arc-20160816; b=IDB4GGDTZqPYR+uAAR0kyo5vVJ/oukYVCLp3e++vhDMcigws8yYzBP7kM2dDOtjUO4 I+2Tm3LF7m9LPjBYzg6NFWoYog7FEl53adLORsj2VbkISQQTMeQkyNx0azlw4xk3hylW P4ypN1k7DNZRZCtiwXcpGAvtZOd9ht2EdR1ihhs0ojMAPNlJCYuE7xOyJf4X4tO3imzr +9pIIRxrD79ameufQJ3jSh9Bd/ep1ExVjIv7NOfj+bJLhYvoeB2wD/sZbcOvllBDPUd1 9hcJqXKmk7yhlbbMRIEBhJsb+Gsctadq1xnXQ1DmU6EHrzuCHEEy/yjo44krVPQ4bePQ 0flw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:references:in-reply-to:message-id :date:to:from:dkim-signature:arc-authentication-results; bh=Iq/xyXMrLqZthlv1JZdceEuyfyF2K/0ySXt349cA/ps=; b=Po/7nYA88622C3ppRYcIBFJW3p09veKOVmbfvwb7QsLP6euTTQ+WFYmSpc7xyOGwsG trc1UL9mE8dFrmyPAuFnvHN2V/S7hhdrxWfYLv5SjikjPp0l7YvPBsQpowIFLDg+uFsp FjuTTEcFyAHLtmr1zhLZgwPJW5FdK8yOGrVVdJ+mXbRuNOI5WZXegG/oE1FPWAK94E4U q3KkGeEkog3CrBPPsnz/qDp9oEnBfc552FIF9GPtKZVyqSfcjyjUvBW5hIQSrha3INfm Bf5l3I2aeST9FVfWmGMugHgXt2jZwi4tykVlLea1f8U1QXRfwGf98peuWyELSNz1B6Fj IAfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=Sm4GwtXL; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id v3-v6si3693735edl.190.2018.07.11.02.05.41; Wed, 11 Jul 2018 02:05:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=Sm4GwtXL; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.denx.de (Postfix, from userid 105) id 016F7C21E60; Wed, 11 Jul 2018 09:05:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 31D9CC21E02; Wed, 11 Jul 2018 09:05:32 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id C53EFC21E02; Wed, 11 Jul 2018 09:05:12 +0000 (UTC) Received: from mail-pg1-f173.google.com (mail-pg1-f173.google.com [209.85.215.173]) by lists.denx.de (Postfix) with ESMTPS id 8D67FC21E2F for ; Wed, 11 Jul 2018 09:05:08 +0000 (UTC) Received: by mail-pg1-f173.google.com with SMTP id r5-v6so2699361pgv.0 for ; Wed, 11 Jul 2018 02:05:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=o1hDtEgwFaa/8a8PvhyrsU98G4DSTfgpf2EjOcX9+rQ=; b=Sm4GwtXL0ujGYD1OUdulyO9chujuBRZZ7aa3K47JDRUVQWPTJLg0DZx2x58qbNLOwx DjyHq83rKpo7kYSD066ST2D6D8Lxa2GkrWvu4BRVUKSpwh+NZ19z6o5tz28XWzSdrQNu E65Gb5KCuLvF0f4AI3krcHEQbYs2XKEc3nyyQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=o1hDtEgwFaa/8a8PvhyrsU98G4DSTfgpf2EjOcX9+rQ=; b=Vk0EJcNGDXDw/VvKa69K+1bcxwxEqPe9i1PIGJ+leBiKqr9v6fcEtnC7xTzFZFxRpX o6Awbq3IQOKM4v2ivz/EVi5Voq5eWMnlbdAfhGmoA+AXRR0F6pcR2X85ffti4kNlXaV6 YI59TmhawK9IHc3CVxZfiuP14jgU/A050ZI/+KMiiUzQ6URacqg8tUjG2xiOhHC2DR1u vC7j82SwNwkB/U7OiLYYwkayEcjlObQd0iQxYTKYzYC+Ts/GhnGehSFO5uUPg0jlOJen TjrpVXfhncWlx+oXdFuaVt5zIBseAjCxUsUKy2aWU7DRRJrmw9ttETanqSRM9WC8zB95 9hOQ== X-Gm-Message-State: APt69E3PQpcZv+4lr7IIk+5Bib4OQjFmSINqnass0jiuBYg9wV6s+kwu 3+fPFxpTIPTvhFtm3nBKzZpDrw== X-Received: by 2002:a63:e914:: with SMTP id i20-v6mr19551984pgh.10.1531299907253; Wed, 11 Jul 2018 02:05:07 -0700 (PDT) Received: from linaro.org ([121.95.100.191]) by smtp.googlemail.com with ESMTPSA id y9-v6sm26805169pgv.31.2018.07.11.02.05.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Jul 2018 02:05:06 -0700 (PDT) From: AKASHI Takahiro To: trini@konsulko.com, sjg@chromium.org, tuomas.tynkkynen@iki.fi Date: Wed, 11 Jul 2018 18:06:06 +0900 Message-Id: <20180711090608.11526-2-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180711090608.11526-1-takahiro.akashi@linaro.org> References: <20180711090608.11526-1-takahiro.akashi@linaro.org> Cc: xypron.glpk@gmx.de, agraf@suse.de, u-boot@lists.denx.de Subject: [U-Boot] [PATCH v3 1/3] rtc: compile date.c if DM_RTC X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" rtc_to_tm() and rtc_mktime() are required for some RTC drivers, at least PL031. Without this patch, we also need to enable CONFIG_CMD_DATE even if we don't want or need this command. Signed-off-by: AKASHI Takahiro Reviewed-by: Heinrich Schuchardt --- drivers/rtc/date.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/rtc/date.c b/drivers/rtc/date.c index 1256ffe374..f1ac738a8a 100644 --- a/drivers/rtc/date.c +++ b/drivers/rtc/date.c @@ -9,7 +9,8 @@ #include #include -#if defined(CONFIG_CMD_DATE) || defined(CONFIG_TIMESTAMP) +#if defined(CONFIG_CMD_DATE) || defined(CONFIG_DM_RTC) || \ + defined(CONFIG_TIMESTAMP) #define FEBRUARY 2 #define STARTOFTIME 1970 From patchwork Wed Jul 11 09:06:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 141696 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp40185ljj; Wed, 11 Jul 2018 02:06:22 -0700 (PDT) X-Google-Smtp-Source: AAOMgpe03PxhDcuhiWs5hBSUIa8rH//oOlhXgHR7HkcHMVkGU7qvD/0TAs96r8849t1WELEE/L2a X-Received: by 2002:a50:f390:: with SMTP id g16-v6mr3744031edm.226.1531299982563; Wed, 11 Jul 2018 02:06:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531299982; cv=none; d=google.com; s=arc-20160816; b=Y3icrTQ9ygDhdZJpoeV6Ma6C9AnYG5ngnfuyVT+acCDTihmWdVQFMAaeiSvvQAhQzW R8v5ckQ8CCqxUEeowXAsID3hBb3OdQEAwIPfOiL5cHIqWD6DBK0UkYvuB47ftiyFLeT9 OlIq+z3FpkSfDLibYm0UfZ6FD/yfdwUE0g9QDi5bxd0gkuS5ueH75VQ5OlP/9z1/Ux1E /ZjOebIlA681n0Oba5m7/OX8RQMy/0JJ1S9+v6knp46OEODZ6gQ/bP2aZyPfsMWXI1Q4 i7bCr3LlrjnW5rBMXNh9b4qfoX0LOxqGWegc/UVgX1guj4ekI4R/tnglNfEp+/3b/8VF FCdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:references:in-reply-to:message-id :date:to:from:dkim-signature:arc-authentication-results; bh=jnUQp0fG4ok0qWZcQWCo8EMIfFARQubqgncS5oj080M=; b=fSBXdYVE6dLqpUPE7cC3pZWoPXKLRsNENda7mzQtDO4O+F8JrawKo+jgX1pdnbwz1d jboIuMtmku0sN76uPWGEzo4VwX53ic6/yzdE8uPUR0dInVxfzWf62PsM4AH7BtGOa/Sx iHQRQULcvXkWDE+1WJixKzOvSWtUzQL1duxfUTqlwyxEUnFhhJJ8DOmkUHQ5QTpZjRtn IpgcZpxx//c6ehfjyBp0MG6hIdKxMrkaplDBqY9kMP9NQWz50hm8S4DrdBiWl1JOdYjV u8vDXGHDeRHSj7IlAEn1cNw9Zy6Pm1x9u1YDuNwx/gtvvw+9S33P4ug6EFJ1DzTaMnEU 3ZvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=V+9WWIIX; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id i88-v6si1403926edc.106.2018.07.11.02.06.22; Wed, 11 Jul 2018 02:06:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=V+9WWIIX; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.denx.de (Postfix, from userid 105) id 18E01C21E3A; Wed, 11 Jul 2018 09:05:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H2, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 32414C21E2C; Wed, 11 Jul 2018 09:05:33 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id E4547C21E1B; Wed, 11 Jul 2018 09:05:17 +0000 (UTC) Received: from mail-pf0-f196.google.com (mail-pf0-f196.google.com [209.85.192.196]) by lists.denx.de (Postfix) with ESMTPS id AF08FC21DF3 for ; Wed, 11 Jul 2018 09:05:16 +0000 (UTC) Received: by mail-pf0-f196.google.com with SMTP id u16-v6so17992507pfh.3 for ; Wed, 11 Jul 2018 02:05:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=t1ZAK+IdIn4mP8z0VznDYoxXDfkBnzWc9lPgZbzfU48=; b=V+9WWIIXlPc068b5ZZRkJglgiOJ3aCH9lw9+iAe2LbaTTTSdih8pgjgX+Sl+45wCpt sxwPamLd2PIylhQh/gTQ16fACO7H1yIU5G7asbYf07tCSdCcFGKT6F2wRRR4Rl6LK9Ru kjyT8eC3HlGLZH1qQNtuTkYKmbHuVmgbWB5I8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=t1ZAK+IdIn4mP8z0VznDYoxXDfkBnzWc9lPgZbzfU48=; b=ghH618MJg6KkDe5W+vouA76Aak2mD8w7iUzQ+KUlk45gnDVJV6Qa9lTyImWdO0s5T0 BBze8S4vJMBKHaA7WGqbEAaawms1MMccC27Q/kcxJJ4+coFTO5qtX9iz+1mlngRy8ejA YtNkg8TW+rexUzL9WKcfp5+OIdM238VdJkYMMXM+E+OdeqbYsRXBdwP7z9kWalMsiscv 2q6qT5//OG9OrTTG49Tp28lJ+oz7hUso2GyaVZvXYerU0M2mF+ALrcA16tRDydsa/F5C rdlXq8I2rEDgv18suPDNtHyEgTd3emahTHGMIj97EbJ+Rkwrvxpu2+yM9pW/dMhJVQc6 7/5w== X-Gm-Message-State: APt69E37VIW9pHY6ABiO8USdHPUu3jW3HGtTsZmuZaS8Y16p57161lcn CGU7C+ZDVQQUde/EoVnoW9b/MA== X-Received: by 2002:a63:b74a:: with SMTP id w10-v6mr25558564pgt.266.1531299915210; Wed, 11 Jul 2018 02:05:15 -0700 (PDT) Received: from linaro.org ([121.95.100.191]) by smtp.googlemail.com with ESMTPSA id 87-v6sm35333731pfn.103.2018.07.11.02.05.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Jul 2018 02:05:14 -0700 (PDT) From: AKASHI Takahiro To: trini@konsulko.com, sjg@chromium.org, tuomas.tynkkynen@iki.fi Date: Wed, 11 Jul 2018 18:06:07 +0900 Message-Id: <20180711090608.11526-3-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180711090608.11526-1-takahiro.akashi@linaro.org> References: <20180711090608.11526-1-takahiro.akashi@linaro.org> Cc: xypron.glpk@gmx.de, agraf@suse.de, u-boot@lists.denx.de Subject: [U-Boot] [PATCH v3 2/3] rtc: pl031: convert the driver to driver model X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" With this patch, PL031 driver is converted to driver-model-compliant driver. In addition, CONFIG_SYS_RTC_PL031_BASE is no longer valid. Signed-off-by: AKASHI Takahiro Tested-by: Heinrich Schuchardt --- drivers/rtc/Kconfig | 6 ++ drivers/rtc/pl031.c | 126 ++++++++++++++++++++++------------- scripts/config_whitelist.txt | 1 - 3 files changed, 86 insertions(+), 47 deletions(-) diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig index a3f8c8aecc..96c4cce410 100644 --- a/drivers/rtc/Kconfig +++ b/drivers/rtc/Kconfig @@ -55,6 +55,12 @@ config RTC_MV Enable Marvell RTC driver. This driver supports the rtc that is present on some Marvell SoCs. +config RTC_PL031 + bool "Enable ARM PL031 driver" + depends on DM_RTC + help + Enable ARM PL031 driver. + config RTC_S35392A bool "Enable S35392A driver" select BITREVERSE diff --git a/drivers/rtc/pl031.c b/drivers/rtc/pl031.c index 8955805e3b..b8fd944e44 100644 --- a/drivers/rtc/pl031.c +++ b/drivers/rtc/pl031.c @@ -8,13 +8,11 @@ #include #include +#include +#include #include - -#if defined(CONFIG_CMD_DATE) - -#ifndef CONFIG_SYS_RTC_PL031_BASE -#error CONFIG_SYS_RTC_PL031_BASE is not defined! -#endif +#include +#include /* * Register definitions @@ -30,78 +28,114 @@ #define RTC_CR_START (1 << 0) -#define RTC_WRITE_REG(addr, val) \ - (*(volatile unsigned int *)(CONFIG_SYS_RTC_PL031_BASE + (addr)) = (val)) -#define RTC_READ_REG(addr) \ - (*(volatile unsigned int *)(CONFIG_SYS_RTC_PL031_BASE + (addr))) +struct pl031_platdata { + phys_addr_t base; +}; -static int pl031_initted = 0; +static inline u32 pl031_read_reg(struct udevice *dev, int reg) +{ + struct pl031_platdata *pdata = dev_get_platdata(dev); -/* Enable RTC Start in Control register*/ -void rtc_init(void) + return readl(pdata->base + reg); +} + +static inline u32 pl031_write_reg(struct udevice *dev, int reg, u32 value) { - RTC_WRITE_REG(RTC_CR, RTC_CR_START); + struct pl031_platdata *pdata = dev_get_platdata(dev); - pl031_initted = 1; + return writel(value, pdata->base + reg); } /* - * Reset the RTC. We set the date back to 1970-01-01. + * Probe RTC device + */ +static int pl031_probe(struct udevice *dev) +{ + /* Enable RTC Start in Control register*/ + pl031_write_reg(dev, RTC_CR, RTC_CR_START); + + return 0; +} + +/* + * Get the current time from the RTC */ -void rtc_reset(void) +static int pl031_get(struct udevice *dev, struct rtc_time *tm) { - RTC_WRITE_REG(RTC_LR, 0x00); - if(!pl031_initted) - rtc_init(); + unsigned long tim; + + if (!tm) + return -EINVAL; + + tim = pl031_read_reg(dev, RTC_DR); + + rtc_to_tm(tim, tm); + + debug("Get DATE: %4d-%02d-%02d (wday=%d) TIME: %2d:%02d:%02d\n", + tm->tm_year, tm->tm_mon, tm->tm_mday, tm->tm_wday, + tm->tm_hour, tm->tm_min, tm->tm_sec); + + return 0; } /* * Set the RTC -*/ -int rtc_set(struct rtc_time *tmp) + */ +static int pl031_set(struct udevice *dev, const struct rtc_time *tm) { unsigned long tim; - if(!pl031_initted) - rtc_init(); + if (!tm) + return -EINVAL; - if (tmp == NULL) { - puts("Error setting the date/time\n"); - return -1; - } + debug("Set DATE: %4d-%02d-%02d (wday=%d) TIME: %2d:%02d:%02d\n", + tm->tm_year, tm->tm_mon, tm->tm_mday, tm->tm_wday, + tm->tm_hour, tm->tm_min, tm->tm_sec); /* Calculate number of seconds this incoming time represents */ - tim = rtc_mktime(tmp); + tim = rtc_mktime(tm); - RTC_WRITE_REG(RTC_LR, tim); + pl031_write_reg(dev, RTC_LR, tim); - return -1; + return 0; } /* - * Get the current time from the RTC + * Reset the RTC. We set the date back to 1970-01-01. */ -int rtc_get(struct rtc_time *tmp) +static int pl031_reset(struct udevice *dev) { - ulong tim; + pl031_write_reg(dev, RTC_LR, 0); - if(!pl031_initted) - rtc_init(); + return 0; +} - if (tmp == NULL) { - puts("Error getting the date/time\n"); - return -1; - } +static const struct rtc_ops pl031_ops = { + .get = pl031_get, + .set = pl031_set, + .reset = pl031_reset, +}; - tim = RTC_READ_REG(RTC_DR); +static const struct udevice_id pl031_ids[] = { + { .compatible = "arm,pl031" }, + { } +}; - rtc_to_tm(tim, tmp); +static int pl031_ofdata_to_platdata(struct udevice *dev) +{ + struct pl031_platdata *pdata = dev_get_platdata(dev); - debug ( "Get DATE: %4d-%02d-%02d (wday=%d) TIME: %2d:%02d:%02d\n", - tmp->tm_year, tmp->tm_mon, tmp->tm_mday, tmp->tm_wday, - tmp->tm_hour, tmp->tm_min, tmp->tm_sec); + pdata->base = dev_read_addr(dev); return 0; } -#endif +U_BOOT_DRIVER(rtc_pl031) = { + .name = "rtc-pl031", + .id = UCLASS_RTC, + .of_match = pl031_ids, + .probe = pl031_probe, + .ofdata_to_platdata = pl031_ofdata_to_platdata, + .platdata_auto_alloc_size = sizeof(struct pl031_platdata), + .ops = &pl031_ops, +}; diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt index 1219dcc3be..17bd2d681c 100644 --- a/scripts/config_whitelist.txt +++ b/scripts/config_whitelist.txt @@ -4115,7 +4115,6 @@ CONFIG_SYS_RSTC_RMR_VAL CONFIG_SYS_RTC_BUS_NUM CONFIG_SYS_RTC_CNT CONFIG_SYS_RTC_OSCILLATOR -CONFIG_SYS_RTC_PL031_BASE CONFIG_SYS_RTC_REG_BASE_ADDR CONFIG_SYS_RTC_SETUP CONFIG_SYS_RV3029_TCR From patchwork Wed Jul 11 09:06:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 141697 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp41075ljj; Wed, 11 Jul 2018 02:07:19 -0700 (PDT) X-Google-Smtp-Source: AAOMgpe4G4L0ih0+NkfvsBMxrihLb1yNeBHhtBPC5sBzw1UPGKPaOwCPk5IN2vKlYNyS/8pJLFG/ X-Received: by 2002:a50:ad55:: with SMTP id z21-v6mr29482560edc.142.1531300039516; Wed, 11 Jul 2018 02:07:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531300039; cv=none; d=google.com; s=arc-20160816; b=knfsBhKA+uB2kwbMeUbDP0WvdfiTKPv5PXPIltozZmKtF69nG0U70B7ROcSMEK9Gsh pyoEsNpZd0SI6r70kJj8X3eunVe4LYHQlpei4m3WU6FuGqbFaMpppyk3NHvjoETjSqfb uW6oEPXIkF43T+wySMOSC6kIfXCbXxYVg6IeaEdhK0sqazrnSWarcvIFByCzY2jCEMPr VscjkHNkE+IDEKbWB6GREuII2D+w+YrTH94IB9q5QlTc6nDTvvFSmLKco4Mrlq5Hqw2i e9BTMBASKzMRGFS2QfgXTf3Yn0Ta3DvNXA53YYANrlaIQU8SDAxFjSHczJWn+bgCi5Et rwzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:references:in-reply-to:message-id :date:to:from:dkim-signature:arc-authentication-results; bh=iE7vNoNHEm9bxzFuzpAppaa7fzRYGXT/lSpamtitJbA=; b=BcTmocI5BgcPvGDYs0QDasRPtrdt8hheaFwU5M2xi+5ZGO6OLh0Fdzwrjg2HyPt6JV pd304k33/WMtJO7EGLgFKDwZ/FjdyYlkzBUxcY2cdXYpu/QGj1+zsyUYlEOWCpg2eV8N ld9cxcIupYUiI3j800NdEtCE2mu/l0uQVf8lbi86TAT3lSE2gzymaVaAz5RyCSKgZVBg bDetThpLv+Iad6KYcW6tUXQsFQo997YIoBy4txziuce2ZMdXntOb//Soa2yykB49yHip H2c/jb3jyqGG4Rk8MAa/9MeH2ezUGP2QEyfgP2aF6fbLrjOqk81uF4SBlRoUVmHbPcAJ BAzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=PNiLX1Q1; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id z14-v6si14372511edd.127.2018.07.11.02.07.19; Wed, 11 Jul 2018 02:07:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=PNiLX1Q1; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.denx.de (Postfix, from userid 105) id EE3BCC21E2F; Wed, 11 Jul 2018 09:06:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H2, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 0E09CC21E0B; Wed, 11 Jul 2018 09:05:34 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 1725AC21E02; Wed, 11 Jul 2018 09:05:27 +0000 (UTC) Received: from mail-pf0-f195.google.com (mail-pf0-f195.google.com [209.85.192.195]) by lists.denx.de (Postfix) with ESMTPS id 8F86FC21E45 for ; Wed, 11 Jul 2018 09:05:26 +0000 (UTC) Received: by mail-pf0-f195.google.com with SMTP id y8-v6so17998819pfm.10 for ; Wed, 11 Jul 2018 02:05:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=PBAk4BF+cSrPYngAyTegwtZGEYjsYEB1NuE1vAQZ2SM=; b=PNiLX1Q162KiVhVLT8+52XB0tP8glpUxVLZCP/qqzvbQ+0qHP9D9+Ex/XMckAIGSuC Nmyv6mIHd3G6CRp7+EZUjblopWZtRFOQYpJCyunh4y/bccEJdc3anvlFvqB+1KBkMh7h SPqj1RaQBZ3aL5WL+6ntX2OtlhuUIHDeaGyJU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=PBAk4BF+cSrPYngAyTegwtZGEYjsYEB1NuE1vAQZ2SM=; b=jjyPKRwSl/+dvwg9PBG0rXdM1W0Wb9zhTW0APAa1IcTCL75aAeoPUs8+ZuVdNcdIih WaQG8WulWdQ8+tn8TjScCbEH3U484Uz63aHJgJvk8Uc4oJc/ZNcoabwDLie2BjNHlvoJ mFOyWswg0v05fOV7TNHU9zva15BG3BYK31SVpkbDIZgLN0ZGPVfxCufk3rVxQ1vwZCS5 AyGyYYOnGEKeuaCktC4BvQtbbLo7z3kzXTlQyoj7vjtQz4xFT5/n6TexsRPPOOVdu88u nbnz6k6SmRWpSkpedLmXPRieoJRSvFUSi2rAvf6hGUhJyuCHjJWnWdQNwoGPPEUpYDH0 pAlA== X-Gm-Message-State: APt69E1yKTrIFFrEnwIKnBKcbPXoPaPDNQxX+WTfQGQS8LpGtA9ZlDa0 PtbvGixcICkCAltUWQke1EnxqA== X-Received: by 2002:a63:f18:: with SMTP id e24-v6mr26166396pgl.320.1531299925275; Wed, 11 Jul 2018 02:05:25 -0700 (PDT) Received: from linaro.org ([121.95.100.191]) by smtp.googlemail.com with ESMTPSA id u9-v6sm1799631pfi.4.2018.07.11.02.05.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Jul 2018 02:05:24 -0700 (PDT) From: AKASHI Takahiro To: trini@konsulko.com, sjg@chromium.org, tuomas.tynkkynen@iki.fi Date: Wed, 11 Jul 2018 18:06:08 +0900 Message-Id: <20180711090608.11526-4-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180711090608.11526-1-takahiro.akashi@linaro.org> References: <20180711090608.11526-1-takahiro.akashi@linaro.org> Cc: xypron.glpk@gmx.de, agraf@suse.de, u-boot@lists.denx.de Subject: [U-Boot] [PATCH v3 3/3] arm: qemu-arm: enable RTC (PL031) by default X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Virtual machine provided by qemu-arm has a ARM PL031 Real Time Clock device. With this patch, the driver is enabled by default. Signed-off-by: AKASHI Takahiro Reviewed-by: Heinrich Schuchardt --- arch/arm/Kconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 00b28480b4..b7b1dca289 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -714,6 +714,8 @@ config ARCH_QEMU select DM_SERIAL select OF_CONTROL select PL01X_SERIAL + imply DM_RTC + imply RTC_PL031 config ARCH_RMOBILE bool "Renesas ARM SoCs"