Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5774279imu; Sun, 2 Dec 2018 03:14:58 -0800 (PST) X-Google-Smtp-Source: AFSGD/Xzsa/JXuQrZXpyWnP9KGMnRusAp22M6nzp/5HS5tCqv+J1xIqIjrx/QPTpK02bonShbKAO X-Received: by 2002:a17:902:6a4:: with SMTP id 33mr4021012plh.99.1543749298598; Sun, 02 Dec 2018 03:14:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543749298; cv=none; d=google.com; s=arc-20160816; b=HrEzE10hckQ5pM1LVWS9CbE4BxkQarl++o8LPP++vBUuTu6vhCMUF0bQ/UfIeGQowK +7ds1jI1jIEjKKB0PvFSh69uuGobwh7ezFnk91ptcdV114dcnF9Fb3iLojavUqV0vHeM rXijWDovamEWsTlKQLu8qfG3oXG5L9QQTgLde2y+ZQsCR5SJgnWdVaiWU6qnqIYY2mxf MXNmadoxOxBVrhvXhoutrXbfaKxlhQMoDAfg9rL+1hZLkICvvjKDGpDsBVf2OKIb0s0r Q0OCCuYapg360371oyp/FjZJVAoGuFDMSp1wkIGN0oYcKiOiUBiT1saCtrEtkKVwpcvO LJ9A== 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 :message-id:date:subject:cc:to:from; bh=oU9puwC/lmDmb7QFTw9p49gg5AhO2yzC6db4vGycLs0=; b=fkq8Rau0fOC1QC5HaIIVGjP7iPsPIXyubKsfxmo9J5yLe0F02N08n0BA26z5WJGGEq 9x6k8Bcqpu7NUK1Yj3wSslEKS8Crdt75BhhKWElwm/VYqlRKY2H1svBnxd5FLNuvhTvh npRRqNMKCOmAaVxnf90/pxjtn+3BXTerdeccrXj3mhsY/vbaXaBAkzavUHbHOtFuC6um 4gHtsWqAdI1bQqitYbkMbiJVoAHKoQlqp0PU8tuVSgrkIHNOoBwft5EXJIE7abWW3UCw T6PtrF/cRMPf9qfO8SmB2SJaPF4IdveBuwFRoPWzBqKuGZlbmCXstZHCOqZe2WDoQ63S 979g== 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 x32-v6si10939120pld.70.2018.12.02.03.14.12; Sun, 02 Dec 2018 03:14:58 -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 S1725818AbeLBLMg (ORCPT + 99 others); Sun, 2 Dec 2018 06:12:36 -0500 Received: from shell.v3.sk ([90.176.6.54]:60575 "EHLO shell.v3.sk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725776AbeLBLMg (ORCPT ); Sun, 2 Dec 2018 06:12:36 -0500 Received: from localhost (localhost [127.0.0.1]) by zimbra.v3.sk (Postfix) with ESMTP id F2853C7E34; Sun, 2 Dec 2018 12:12:30 +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 2K7_tONg8Rcx; Sun, 2 Dec 2018 12:12:28 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by zimbra.v3.sk (Postfix) with ESMTP id 429D7C7E35; Sun, 2 Dec 2018 12:12:28 +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 mCZKP6n99bWm; Sun, 2 Dec 2018 12:12:27 +0100 (CET) Received: from odvarok.lan (ip-89-102-31-34.net.upcbroadband.cz [89.102.31.34]) by zimbra.v3.sk (Postfix) with ESMTPSA id 5D627C7E34; Sun, 2 Dec 2018 12:12:27 +0100 (CET) From: Lubomir Rintel To: arm-soc , Arnd Bergmann , Olof Johansson Cc: Eric Miao , Haojian Zhuang , Pavel Machek , James Cameron , Linux ARM , Linux Kernel Mailing List , Lubomir Rintel Subject: [PATCH] ARM: mmp/mmp2: fix cpu_is_mmp2() on mmp2-dt Date: Sun, 2 Dec 2018 12:12:24 +0100 Message-Id: <20181202111224.1450-1-lkundrak@v3.sk> X-Mailer: git-send-email 2.19.1 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 cpu_is_mmp2() was equivalent to cpu_is_pj4(), wouldn't be correct for multiplatform kernels. Fix it by also considering mmp_chip_id, as is done for cpu_is_pxa168() and cpu_is_pxa910() above. Moreover, it is only available with CONFIG_CPU_MMP2 and thus doesn't work on DT-based MMP2 machines. Enable it on CONFIG_MACH_MMP2_DT too. Note: CONFIG_CPU_MMP2 is only used for machines that use board files instead of DT. It should perhaps be renamed. I'm not doing it now, becaus= e I don't have a better idea. Signed-off-by: Lubomir Rintel --- arch/arm/mach-mmp/cputype.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-mmp/cputype.h b/arch/arm/mach-mmp/cputype.h index 446edaeb78a7..a96abcf521b4 100644 --- a/arch/arm/mach-mmp/cputype.h +++ b/arch/arm/mach-mmp/cputype.h @@ -44,10 +44,12 @@ static inline int cpu_is_pxa910(void) #define cpu_is_pxa910() (0) #endif =20 -#ifdef CONFIG_CPU_MMP2 +#if defined(CONFIG_CPU_MMP2) || defined(CONFIG_MACH_MMP2_DT) static inline int cpu_is_mmp2(void) { - return (((read_cpuid_id() >> 8) & 0xff) =3D=3D 0x58); + return (((read_cpuid_id() >> 8) & 0xff) =3D=3D 0x58) && + (((mmp_chip_id & 0xfff) =3D=3D 0x410) || + ((mmp_chip_id & 0xfff) =3D=3D 0x610)); } #else #define cpu_is_mmp2() (0) --=20 2.19.1