From patchwork Mon Nov 12 03:20:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lubomir Rintel X-Patchwork-Id: 10678081 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 51FA613BF for ; Mon, 12 Nov 2018 03:25:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 40DAD2A108 for ; Mon, 12 Nov 2018 03:25:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 347D42A15A; Mon, 12 Nov 2018 03:25:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6B2D72A108 for ; Mon, 12 Nov 2018 03:25:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=J91kGcTGiOPoexN2NrGkrb7she3555v0MhUy0vKP4GA=; b=OtE9jJuexj/6Zj GO5Nc3U9dKobfBKSFe/M1FJWNeaereNcVkIQ0NLAI/eaqIw56f+RdP6wwEtIsT0tycPy9oUTqotEx it0s2GiHMLHLHDn+wRHIzHg4Ztg4Z1An52YNps1XyKw8pJtycFA2AJzVLlFB3dTJgAetGe0xr/JdY 6PDUixlRJMQUM1JrIeyYSfVv4UVcUErU0m33BhNh1/4Mxr/zdr4Ga2SBXymLURpyobJJY+k/V8F8N +3gLSA0h3JFc4cDCTYNKIWh4shs13tzeySrALkRIpFD9iqn3bOtMJvnE5hsks+BFrBhPz4+FuLi4U IV7y9bp3xymO+rboYR6w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gM2qh-0002VI-34; Mon, 12 Nov 2018 03:25:15 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gM2nI-00076Z-AV for linux-arm-kernel@bombadil.infradead.org; Mon, 12 Nov 2018 03:21:44 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=PkkYeuYC49AsYmo6gnufd03KvW3/Aco2+RctAp43r74=; b=NeeBsuu0Nz6GhhEhAXJbI6mhh+ /0+yoHVub63ceOKyF9haPoAp1k/Oa/S87WUZgILTJBtup3sLRHFWZak4Yh0uyCp6nq/jC0umPUh5h fPv6hYiyQ+ddFMyvPbGsjHJLG4WqbtxgROfupradHqHbHLRIvRUDpHrKxxQa+xnGxCIkSqUB31wkG DX2QeZ7VF9YXdPXrCsMN3x3Jo7qlrVMy1TOODdKYmisoWgFsI27hk7yG0RvOChrdXNavqDne4Adxc vevb+OUOnoBHDJFcOL3eSvLVBcUnPAkPwtL7q5+rImU/l7oM3g/sSjQ8BFfNy+hVR438Twb30H3Eo caUp9ABg==; Received: from shell.v3.sk ([90.176.6.54]) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gM2nD-00058D-FM for linux-arm-kernel@lists.infradead.org; Mon, 12 Nov 2018 03:21:42 +0000 Received: from localhost (localhost [127.0.0.1]) by zimbra.v3.sk (Postfix) with ESMTP id 865EFC6A25; Mon, 12 Nov 2018 04:21:32 +0100 (CET) Received: from shell.v3.sk ([127.0.0.1]) by localhost (zimbra.v3.sk [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id td-HEiEWCdsD; Mon, 12 Nov 2018 04:21:08 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by zimbra.v3.sk (Postfix) with ESMTP id 93245C6A30; Mon, 12 Nov 2018 04:20:47 +0100 (CET) X-Virus-Scanned: amavisd-new at zimbra.v3.sk Received: from shell.v3.sk ([127.0.0.1]) by localhost (zimbra.v3.sk [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 7HFOb2YEm9Md; Mon, 12 Nov 2018 04:20:42 +0100 (CET) Received: from belphegor.lan (ip-89-102-31-34.net.upcbroadband.cz [89.102.31.34]) by zimbra.v3.sk (Postfix) with ESMTPSA id EEDC4C6A2F; Mon, 12 Nov 2018 04:20:38 +0100 (CET) From: Lubomir Rintel To: Eric Miao , Haojian Zhuang Subject: [PATCH v3 12/18] ARM: mmp/mmp2: use cpu_is_pj4() instead of cpu_is_mmp2() Date: Mon, 12 Nov 2018 04:20:21 +0100 Message-Id: <20181112032027.653931-13-lkundrak@v3.sk> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181112032027.653931-1-lkundrak@v3.sk> References: <20181112032027.653931-1-lkundrak@v3.sk> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181111_222139_729475_67034890 X-CRM114-Status: GOOD ( 13.62 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lubomir Rintel , Robert Jarzmik , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Russell King Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The MMP2 platform uses the PJ4 CPU. The cpu_is_mmp2() macro is thus actually not useful at all and moreover gives the wrong result on MACH_MMP2_DT. The actual problem I aim to fix is that on a device-tree enabled system, the timer ends up being initialized incorrectly. In fact, it ticks like at rate that's 1/100 slower or so. Perhaps the other cpu_is_mmp2() uses are more benign, but still useless. Signed-off-by: Lubomir Rintel Acked-by: Pavel Machek --- arch/arm/mach-mmp/cputype.h | 9 --------- arch/arm/mach-mmp/mmp2.c | 2 +- arch/arm/mach-mmp/pm-mmp2.c | 2 +- arch/arm/mach-mmp/time.c | 2 +- 4 files changed, 3 insertions(+), 12 deletions(-) diff --git a/arch/arm/mach-mmp/cputype.h b/arch/arm/mach-mmp/cputype.h index 446edaeb78a7..405dbbbbbcdd 100644 --- a/arch/arm/mach-mmp/cputype.h +++ b/arch/arm/mach-mmp/cputype.h @@ -44,13 +44,4 @@ static inline int cpu_is_pxa910(void) #define cpu_is_pxa910() (0) #endif -#ifdef CONFIG_CPU_MMP2 -static inline int cpu_is_mmp2(void) -{ - return (((read_cpuid_id() >> 8) & 0xff) == 0x58); -} -#else -#define cpu_is_mmp2() (0) -#endif - #endif /* __ASM_MACH_CPUTYPE_H */ diff --git a/arch/arm/mach-mmp/mmp2.c b/arch/arm/mach-mmp/mmp2.c index afba5460cdaf..b670fafedeac 100644 --- a/arch/arm/mach-mmp/mmp2.c +++ b/arch/arm/mach-mmp/mmp2.c @@ -104,7 +104,7 @@ void __init mmp2_init_irq(void) static int __init mmp2_init(void) { - if (cpu_is_mmp2()) { + if (cpu_is_pj4()) { #ifdef CONFIG_CACHE_TAUROS2 tauros2_init(0); #endif diff --git a/arch/arm/mach-mmp/pm-mmp2.c b/arch/arm/mach-mmp/pm-mmp2.c index 17699be3bc3d..bcd5111ffb37 100644 --- a/arch/arm/mach-mmp/pm-mmp2.c +++ b/arch/arm/mach-mmp/pm-mmp2.c @@ -220,7 +220,7 @@ static int __init mmp2_pm_init(void) { uint32_t apcr; - if (!cpu_is_mmp2()) + if (!cpu_is_pj4()) return -EIO; suspend_set_ops(&mmp2_pm_ops); diff --git a/arch/arm/mach-mmp/time.c b/arch/arm/mach-mmp/time.c index 96ad1db0b04b..0f49ac579a17 100644 --- a/arch/arm/mach-mmp/time.c +++ b/arch/arm/mach-mmp/time.c @@ -163,7 +163,7 @@ static void __init timer_config(void) __raw_writel(0x0, mmp_timer_base + TMR_CER); /* disable */ - ccr &= (cpu_is_mmp2()) ? (TMR_CCR_CS_0(0) | TMR_CCR_CS_1(0)) : + ccr &= (cpu_is_pj4()) ? (TMR_CCR_CS_0(0) | TMR_CCR_CS_1(0)) : (TMR_CCR_CS_0(3) | TMR_CCR_CS_1(3)); __raw_writel(ccr, mmp_timer_base + TMR_CCR);