From patchwork Wed Feb 1 20:19:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1735884 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=ekvM61ga; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4P6YVk5RCmz23hh for ; Thu, 2 Feb 2023 07:31:58 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id BD5A085D43; Wed, 1 Feb 2023 21:31:54 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="ekvM61ga"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id F3BF585D3E; Wed, 1 Feb 2023 21:22:17 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd35.google.com (mail-io1-xd35.google.com [IPv6:2607:f8b0:4864:20::d35]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 029A085D17 for ; Wed, 1 Feb 2023 21:21:43 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd35.google.com with SMTP id r6so4872324ioj.5 for ; Wed, 01 Feb 2023 12:21:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=6QCLms4xgTPJ8Jbjj3VHKcF3hyGeOI1y2KMwptXsWS0=; b=ekvM61gayn4CWAx9N6F0if2H51Y2ckrJjXqrDeNtp6/n/dcWJHKhW3qmdL9H/5HUCn T1oKVS1O1my/oPfC6gUfs8ezyq2Ejeq/Xg4gqB+C3hjda5dhxWc+eLuQ3k18tD6Keb46 +/dBRWswIjemVT0bmKjFJWaLpSfXhsfU/ZjGM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6QCLms4xgTPJ8Jbjj3VHKcF3hyGeOI1y2KMwptXsWS0=; b=sIXC/VMRZxhnPmLrvdQHPwbncCNXYUihUaJXgwWp4/OQ97rO+EJZtYM6scM7Dj5A0c TbfdWWdVwabn1/ne0p3UQ3awrCOfFzBbYBcgPRTyCqU+hejoLaW5vUoJAGYjt/OfcGRq rjqvcj2zLpdMEmp2infhSPZKJta7dq7KPZymfi28glyNttUWpQ3kYOYv6Uhdisy/JAHa zSLRaQWYbwrRCsUax046+QvXOSMys/2ZIvg63ti7kH5VrYZY/Q1AD0+4U1snDrbXYTMy dlGB5BJi0t/WT0H8dMuctL+GcBOQMR557OmaaNT853MxlXQIPAZwP8G60T1Nl3fYqEO2 W8Dg== X-Gm-Message-State: AO0yUKUgvYIIPipETv8bS3Tf76wg/ipkqM6cUAKB5u9uML4ZwfQFTbAB bPrc/TNhf5FoMccGnQqQs+Hz54cU8iYwXBcg X-Google-Smtp-Source: AK7set/aoOtVqQDimF2aPHJZRqLehds2TfhSsAVV3RhpwzlbwO7ThlLxLinS2BiMWsqaTq/ejR+q7Q== X-Received: by 2002:a6b:6f13:0:b0:71a:1b72:5afc with SMTP id k19-20020a6b6f13000000b0071a1b725afcmr2598580ioc.19.1675282902550; Wed, 01 Feb 2023 12:21:42 -0800 (PST) Received: from kea.bld.corp.google.com ([2620:15c:183:200:1fda:cca0:9a42:148c]) by smtp.gmail.com with ESMTPSA id i1-20020a6bf401000000b00704608527d1sm6166498iog.37.2023.02.01.12.21.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Feb 2023 12:21:42 -0800 (PST) From: Simon Glass To: u-boot@lists.denx.de Cc: Tom Rini , Simon Glass Subject: [PATCH v3 26/76] rcar: Drop timer Date: Wed, 1 Feb 2023 13:19:37 -0700 Message-Id: <20230201202027.1943031-27-sjg@chromium.org> X-Mailer: git-send-email 2.39.1.456.gfc5497dd1b-goog In-Reply-To: <20230201202027.1943031-1-sjg@chromium.org> References: <20230201202027.1943031-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.103.6 at phobos.denx.de X-Virus-Status: Clean Drop this unused driver. Signed-off-by: Simon Glass --- (no changes since v1) arch/arm/mach-rmobile/Makefile | 1 - arch/arm/mach-rmobile/timer.c | 87 ---------------------------------- 2 files changed, 88 deletions(-) delete mode 100644 arch/arm/mach-rmobile/timer.c diff --git a/arch/arm/mach-rmobile/Makefile b/arch/arm/mach-rmobile/Makefile index 195bbeb5c88..3f77760e50d 100644 --- a/arch/arm/mach-rmobile/Makefile +++ b/arch/arm/mach-rmobile/Makefile @@ -7,7 +7,6 @@ obj-y = cpu_info.o obj-y += emac.o obj-$(CONFIG_DISPLAY_BOARDINFO) += board.o -obj-$(CONFIG_GLOBAL_TIMER) += timer.o obj-$(CONFIG_TMU_TIMER) += ../../sh/lib/time.o obj-$(CONFIG_SH73A0) += lowlevel_init.o cpu_info-sh73a0.o pfc-sh73a0.o obj-$(CONFIG_R8A7740) += lowlevel_init.o cpu_info-r8a7740.o pfc-r8a7740.o diff --git a/arch/arm/mach-rmobile/timer.c b/arch/arm/mach-rmobile/timer.c deleted file mode 100644 index 293c23b5e25..00000000000 --- a/arch/arm/mach-rmobile/timer.c +++ /dev/null @@ -1,87 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0+ -/* - * (C) Copyright 2012 Nobuhiro Iwamatsu - * (C) Copyright 2012 Renesas Solutions Corp. - */ - -#include -#include -#include -#include -#include -#include -#include -#include - -static struct globaltimer *global_timer = \ - (struct globaltimer *)GLOBAL_TIMER_BASE_ADDR; - -#define CLK2MHZ(clk) (clk / 1000 / 1000) -static u64 get_cpu_global_timer(void) -{ - u32 low, high; - u64 timer; - - u32 old = readl(&global_timer->cnt_h); - while (1) { - low = readl(&global_timer->cnt_l); - high = readl(&global_timer->cnt_h); - if (old == high) - break; - else - old = high; - } - - timer = high; - return (u64)((timer << 32) | low); -} - -static u64 get_time_us(void) -{ - u64 timer = get_cpu_global_timer(); - - timer = ((timer << 2) + (CLK2MHZ(CFG_SYS_CPU_CLK) >> 1)); - do_div(timer, CLK2MHZ(CFG_SYS_CPU_CLK)); - return timer; -} - -static ulong get_time_ms(void) -{ - u64 us = get_time_us(); - - do_div(us, 1000); - return us; -} - -int timer_init(void) -{ - writel(0x01, &global_timer->ctl); - return 0; -} - -void __udelay(unsigned long usec) -{ - u64 start, current; - u64 wait; - - start = get_cpu_global_timer(); - wait = (u64)((usec * CLK2MHZ(CFG_SYS_CPU_CLK)) >> 2); - do { - current = get_cpu_global_timer(); - } while ((current - start) < wait); -} - -ulong get_timer(ulong base) -{ - return get_time_ms() - base; -} - -unsigned long long get_ticks(void) -{ - return get_cpu_global_timer(); -} - -ulong get_tbclk(void) -{ - return (ulong)(CFG_SYS_CPU_CLK >> 2); -}