From patchwork Fri May 7 04:15:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 1475343 X-Patchwork-Delegate: lokeshvutla@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=libero.it header.i=@libero.it header.a=rsa-sha256 header.s=s2021 header.b=A1ZPXSks; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FbxvH18sLz9sPf for ; Fri, 7 May 2021 14:15:39 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id BAB8E82E22; Fri, 7 May 2021 06:15:27 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=libero.it Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=libero.it header.i=@libero.it header.b="A1ZPXSks"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C589782E30; Fri, 7 May 2021 06:15:25 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FORGED_SPF_HELO,FREEMAIL_FROM,SPF_HELO_PASS autolearn=no autolearn_force=no version=3.4.2 Received: from libero.it (smtp-35.italiaonline.it [213.209.10.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 2102982E23 for ; Fri, 7 May 2021 06:15:21 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=libero.it Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=dariobin@libero.it Received: from passgat-Modern-14-A10M.homenet.telecomitalia.it ([95.244.94.151]) by smtp-35.iol.local with ESMTPA id ertQlaHiGpK9wertYldZMc; Fri, 07 May 2021 06:15:20 +0200 x-libjamoibt: 1601 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=libero.it; s=s2021; t=1620360920; bh=htPBPr+NkGbUzrOh4ThahXw3eSXnPsxwoX2dxKxbC8E=; h=From; b=A1ZPXSksUE8I4sWn944XQB4jWPgFHlr77VKtjGjbKyo0QYx5dtSS7TNdQ4KqkQ4xL yefmFrRiTmBLzZTYV0LC1xjVFcgktZSrr0aOTqORxjoHbK31v322MtGEdUX6F4rgFq tEuM7AeyLJg2gEUudgso2rBVeRxTCpaiITCB1l7XL7PHsb9e5DP5fRMvSM7sRmdEqm +8/lIvlUOXm7/m21XqQ/z9XleJ9WVWOCS80dcKnfG+lu32/MyKoa2nE5Ii3JXk3M+v PmFoajbDvzbBLHIIGvStZuZJCalGuYSd/TSYrCzY840seYPjOnZFy07KZ6R7Ik4uQA PiXCx4KgDHrGA== X-CNFS-Analysis: v=2.4 cv=A9ipg4aG c=1 sm=1 tr=0 ts=6094bed8 cx=a_exe a=ugxisoNCKEotYwafST++Mw==:117 a=ugxisoNCKEotYwafST++Mw==:17 a=Tci6CQpCD_bukzXGx2cA:9 From: Dario Binacchi To: u-boot@lists.denx.de Cc: Dario Binacchi , Heiko Schocher , Heinrich Schuchardt , Lokesh Vutla , =?utf-8?q?Marek_Beh=C3=BAn?= , =?utf-8?q?Pali_Roh=C3=A1?= =?utf-8?q?r?= , Stefan Roese , "Ying-Chun Liu (PaulLiu)" Subject: [PATCH 1/7] rtc: davinci: enable compilation for omap architectures Date: Fri, 7 May 2021 06:15:02 +0200 Message-Id: <20210507041509.4928-2-dariobin@libero.it> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210507041509.4928-1-dariobin@libero.it> References: <20210507041509.4928-1-dariobin@libero.it> X-CMAE-Envelope: MS4xfPOftqpebCluqoB3VAzIdSeDbW3uln+jwbqxxfAnBvD8GHl6hqgVXkmnqrVALGqsg8AUPB+SyBdzpWvhVx8vuBpZeZvNa2NJneK1T2jCu+xx2ucOvIAJ yLMoJ0cjTH/2oxte8n4x/5Bck/ct/t1CAnpn51vXS6E3TOTwJ7IjACyEf4dz4wMo76dTYruB9mWnNE2xFfy3WWfkeTWLZBnMbTFjIV/fAf9nVxfeee5eGC4O Ik0pGU35qxJxiilX5E5QYpNVbdjSFEzmplXzXuLN4GFnPHqEMGoSU9OEXkzeNzRj5dkeOz8+PBWURugINCIgt0ppiIqiZHeiQ/fRC+1dEFroAjrR8ETmRysj uquG8neQGpKCS0KeZXkuOv4JpiQ+CQhgZvOwBDCHj2yFlPDXZYWOJi+C6xRP7dP0AVqBGPBeyUxAxdcXafIqxb/Pfy5N2A== X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.4 at phobos.denx.de X-Virus-Status: Clean The Davinci's onchip RTC is also present on TI OMAP1, AM33XX, AM43XX and DRA7XX SOCs. So, let's enable compilation for these architectures too. Signed-off-by: Dario Binacchi --- drivers/rtc/Kconfig | 7 +++++++ drivers/rtc/davinci.c | 11 ++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig index c84a9d2b27..cbdfddb80f 100644 --- a/drivers/rtc/Kconfig +++ b/drivers/rtc/Kconfig @@ -188,4 +188,11 @@ config RTC_ABX80X families of ultra-low-power battery- and capacitor-backed real-time clock chips. +config RTC_DAVINCI + bool "Enable TI OMAP RTC driver" + depends on ARCH_DAVINCI || ARCH_OMAP2PLUS + help + Say "yes" here to support the on chip real time clock + present on TI OMAP1, AM33xx, DA8xx/OMAP-L13x, AM43xx and DRA7xx. + endmenu diff --git a/drivers/rtc/davinci.c b/drivers/rtc/davinci.c index c446e7a735..8f5f76c9d6 100644 --- a/drivers/rtc/davinci.c +++ b/drivers/rtc/davinci.c @@ -9,11 +9,16 @@ #include #include #include +#include #include +#if !defined(RTC_BASE) && defined(DAVINCI_RTC_BASE) +#define RTC_BASE DAVINCI_RTC_BASE +#endif + int rtc_get(struct rtc_time *tmp) { - struct davinci_rtc *rtc = (struct davinci_rtc *)DAVINCI_RTC_BASE; + struct davinci_rtc *rtc = (struct davinci_rtc *)RTC_BASE; unsigned long sec, min, hour, mday, wday, mon_cent, year; unsigned long status; @@ -57,7 +62,7 @@ int rtc_get(struct rtc_time *tmp) int rtc_set(struct rtc_time *tmp) { - struct davinci_rtc *rtc = (struct davinci_rtc *)DAVINCI_RTC_BASE; + struct davinci_rtc *rtc = (struct davinci_rtc *)RTC_BASE; debug("Set DATE: %4d-%02d-%02d (wday=%d) TIME: %2d:%02d:%02d\n", tmp->tm_year, tmp->tm_mon, tmp->tm_mday, tmp->tm_wday, @@ -75,7 +80,7 @@ int rtc_set(struct rtc_time *tmp) void rtc_reset(void) { - struct davinci_rtc *rtc = (struct davinci_rtc *)DAVINCI_RTC_BASE; + struct davinci_rtc *rtc = (struct davinci_rtc *)RTC_BASE; /* run RTC counter */ writel(0x01, &rtc->ctrl);