From patchwork Wed Nov 28 17:53:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lubomir Rintel X-Patchwork-Id: 10703067 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 3409016B1 for ; Wed, 28 Nov 2018 18:08:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 23E4E2DC4E for ; Wed, 28 Nov 2018 18:08:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 17C4E2DC71; Wed, 28 Nov 2018 18:08:03 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED 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 B18172DC4E for ; Wed, 28 Nov 2018 18:08:02 +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=CBjJjUJ/ov110P o1XzZ9ZvnPuRjgDbrKgEzrNRDFpFAw3B7hfbh1w3XKyM4SW2c6BwpJ061k0EGzKINHGNJPhfTtdmn ETdLNC/fwjohu3nmoymfJr6Zkk2zqY46ozng4wCmCrtN4bNJ8gur1lI9wrRKBKat08dLcRbz43/S6 J8ghDpcvtH1T8vE/FYIYpE4zZEA8ZAPiIIRZXMZ5XCbmDZ5CI6yZfLJLLb1l4HCk//j2SXGw0FTk5 Wa8mN4zdzW+ZGJmzYZSIdzDgtpxlaztepL0Vql1ftM/bpeDLlxoX7ql5AfRnyf7Th1ysFzK3bWMw2 ZtTKoddoEbZyDrXtwCQg==; 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 1gS4Fl-0004Ps-Pg; Wed, 28 Nov 2018 18:08:01 +0000 Received: from casper.infradead.org ([85.118.1.10]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gS4FX-00043d-FF for linux-arm-kernel@bombadil.infradead.org; Wed, 28 Nov 2018 18:07:47 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.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=euy7b01NkaP1oxez5Lf/c20OQi BtkKO0hxs70TzcUO824C8nL8lJnAedLkF7ndDvm4QZYl7iom6VXLtNybZyZtomzvCF7LWh638MAd2 +OywY5pcBDXva3KFpjXw7NWEhaFO68zRRRgFTjbnJii2YdgtgwvEcYTNrRq06r+v/v7PYVLw+zwRh qXmn4UarDaH28dm8M6MakDTM1BOefeqold8tr+MxTfkn9KNVTrSItCbf2MCc+o2nLn0ZgW76yFZYG jrPUt+vaO3CvoX8b7ToNlU43wy/awNKXeyuEvZzEk7/SXroM6c0s3uRaDrDiobJcDzcINervOkWk6 3n9grbPg==; Received: from shell.v3.sk ([90.176.6.54]) by casper.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gS42g-000884-4j for linux-arm-kernel@lists.infradead.org; Wed, 28 Nov 2018 17:54:33 +0000 Received: from localhost (localhost [127.0.0.1]) by zimbra.v3.sk (Postfix) with ESMTP id 70E9B99A51; Wed, 28 Nov 2018 18:54:21 +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 bRXCUJoswf8E; Wed, 28 Nov 2018 18:54:01 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by zimbra.v3.sk (Postfix) with ESMTP id B2EAD99B07; Wed, 28 Nov 2018 18:53:41 +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 dWUQ9O-UcFzV; Wed, 28 Nov 2018 18:53:36 +0100 (CET) Received: from belphegor.brq.redhat.com (nat-pool-brq-t.redhat.com [213.175.37.10]) by zimbra.v3.sk (Postfix) with ESMTPSA id 2757D99B26; Wed, 28 Nov 2018 18:53:32 +0100 (CET) From: Lubomir Rintel To: arm@kernel.org, Olof Johansson , Arnd Bergmann Subject: [PATCH v4 14/20] ARM: mmp/mmp2: use cpu_is_pj4() instead of cpu_is_mmp2() Date: Wed, 28 Nov 2018 18:53:18 +0100 Message-Id: <20181128175324.163202-15-lkundrak@v3.sk> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181128175324.163202-1-lkundrak@v3.sk> References: <20181128175324.163202-1-lkundrak@v3.sk> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181128_175430_383373_BD1977E0 X-CRM114-Status: GOOD ( 14.95 ) 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: Eric Miao , James Cameron , Russell King , Haojian Zhuang , linux-kernel@vger.kernel.org, Lubomir Rintel , Pavel Machek , Robert Jarzmik , linux-arm-kernel@lists.infradead.org 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);