Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1464073imu; Wed, 28 Nov 2018 09:55:48 -0800 (PST) X-Google-Smtp-Source: AFSGD/XLJ65dFBMyJPnKUhE7dV2a+u7DzKpkxGySsgVNb8USuGMUcGxGKbrOPBQXlniW1t0fVXFj X-Received: by 2002:a63:6704:: with SMTP id b4mr34206637pgc.100.1543427748251; Wed, 28 Nov 2018 09:55:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543427748; cv=none; d=google.com; s=arc-20160816; b=p9bKVTWlfGTwJlY9MK3gR3E7yYcVQcZkY6Mde6V/h15EvErou1gpq6zbjyrVSJs/FN SjorrtcfGNMM9u9chUCtU1V/p4vNe400l1W/TnBwNkqFCJ2KcjkdOwTIEQ0rbhleikRz RyytOMB+QtTppSSckh2s4TVZAeYchsn6Iia13jf3Kz2OhPCPYTHXJ9dTpkSbzycaJ4X4 RASi6562DUuY/7KXwp/zGV4qzxBgbOaCbWztSAC3B7i/pBhlWVnD8y0V3M4QoYUV3f7g F1py2xvCRE5zeKi9ctM7ZpWn7fZGCXLb83CcJLpmwYEsrMCwPhRMlM/rh9pf2nadKF6y Pw9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=PkkYeuYC49AsYmo6gnufd03KvW3/Aco2+RctAp43r74=; b=EPuJS+k7bfns5i07qH5VbueC3RLWjr0nHqxB1dwuTZGNtFdJCX+i6TLv/D3vAHjkG1 z1ouFiOeYhvtZIIw2sjTuAwjuC3lFyiwbAmjKKzEcOtb0MNw1CgXjR34zuG0rtCrz2yU jRJA1N6L4+H1rx4nv6odfTbMdh3W458+rwVLAWgxVX0k4k0j46OQsyYH/vbeNMOmfG2b b8tzg0Fa8z2hhAf1ANS6QE8sewJC2nE+q8HyZLLgN7Xxz+DtsOhkyeAUsMvTvsZKW3yN FyG7lqweGOaX+/jXi2zXZSb6UdHCHSl3X0JLhAZtdAMStgugz9WRfkNyCa4SV2Wk3jvT zu/g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 3si8556710plo.217.2018.11.28.09.55.32; Wed, 28 Nov 2018 09:55:48 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729604AbeK2E4w (ORCPT + 99 others); Wed, 28 Nov 2018 23:56:52 -0500 Received: from shell.v3.sk ([90.176.6.54]:39518 "EHLO shell.v3.sk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729537AbeK2E4v (ORCPT ); Wed, 28 Nov 2018 23:56:51 -0500 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 Cc: Eric Miao , Haojian Zhuang , Russell King , Robert Jarzmik , Pavel Machek , James Cameron , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Lubomir Rintel 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 Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 =20 -#ifdef CONFIG_CPU_MMP2 -static inline int cpu_is_mmp2(void) -{ - return (((read_cpuid_id() >> 8) & 0xff) =3D=3D 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) =20 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; =20 - if (!cpu_is_mmp2()) + if (!cpu_is_pj4()) return -EIO; =20 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) =20 __raw_writel(0x0, mmp_timer_base + TMR_CER); /* disable */ =20 - ccr &=3D (cpu_is_mmp2()) ? (TMR_CCR_CS_0(0) | TMR_CCR_CS_1(0)) : + ccr &=3D (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); =20 --=20 2.19.1