Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4135015yba; Tue, 7 May 2019 12:42:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqwPIR6+5lkCWV7waKpoMrB1NX01SOvx5GnE8s26zmrGlOMUl0mYnlzSvJuGXca0VIPjvpUR X-Received: by 2002:a17:902:5983:: with SMTP id p3mr10292033pli.224.1557258149316; Tue, 07 May 2019 12:42:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557258149; cv=none; d=google.com; s=arc-20160816; b=gxOpeJal3zjPn/f7fmEvDrPxg+OQZtgDMy1HPZOoAhQLaqkjGaGPZ6GcKT9NNuR4IR zgXPnMDurwzvl5hkJBASGjWD/M3gz4GGFCPqCXYlzEiNlm//RWHuX4UHXCBZc6R4U1B/ IC+82OuZxGmuJ6Od/SxVajPT6qlCKEYPaJ30VsNIKFZ3Kj3KkKKAH2Cx5nVr5Q5N8s/l iGymioiFj25Z3a3ZOgKaCMVtTMzNCpZsi3WU02UYccbijywmSHQWofpXqoQb69bH8gbQ NdhrdjJ4+FAqjWyfb+IKMlC7gHRMMCYWj+Y8KyvPV48A7W3F6GR592BYR8ch3qqtcq04 TV4Q== 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:dkim-signature; bh=dDlIc1LhGttw6Zm+8qHMSGAIbRm2qsIU1NXuMH8CFM8=; b=GkNXEcBYUOHFi30Hvg+o+3AyFyovMtejbW8Y3YgOM9xVsi01+JQsN8oLnY0NLP0oay uEZ89Khtazt+JnguZKN8UmMYQc5atZ5WGONjuyV6XDCFOPiiubnpu1xnhgejKYM+xP+G E+dmztIQjrLep0PyDG+8qKS8G+Mxp82aKehFIA3KY40mb0RtfFwcLXUQN7yFe3SOmyE0 gPfKqxXdcDaQNWWxrovcIZ4lrMRmtk+qX4HSK8MPrIpSzVVLcfPg2pvvfwProfBdhG4q BwAs2fi531TGPJSqYW36Li6Zk2P4gPMyBnDWueGJWH3szFh3tgY46WukEOX+CjFoMv3j ZReA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@crapouillou.net header.s=mail header.b=Ll7Xf50N; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n2si18850108pgp.564.2019.05.07.12.42.12; Tue, 07 May 2019 12:42:29 -0700 (PDT) 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; dkim=fail header.i=@crapouillou.net header.s=mail header.b=Ll7Xf50N; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726420AbfEGTlQ (ORCPT + 99 others); Tue, 7 May 2019 15:41:16 -0400 Received: from outils.crapouillou.net ([89.234.176.41]:33744 "EHLO crapouillou.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725843AbfEGTlP (ORCPT ); Tue, 7 May 2019 15:41:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1557258074; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references; bh=dDlIc1LhGttw6Zm+8qHMSGAIbRm2qsIU1NXuMH8CFM8=; b=Ll7Xf50N170tFv4iwPKFMDCMEvSrdJBTziEShjQek9JJ5vyLNn6R+PtjKhIhgp2RWsiJg8 ito6YErP6gmhtMf1/1oLbXjJdom1NYo8h8mh937FflTbC5wX5cAbnkW2sMEAB+3bF53VIa hXJHMsuvpDanOR92PwkW+e2kyschFEM= From: Paul Cercueil To: Ralf Baechle , Paul Burton , James Hogan Cc: od@zcrc.me, linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, Paul Cercueil Subject: [PATCH] MIPS: jz4740: Fix Ingenic SoCs sometimes reporting wrong ISA Date: Tue, 7 May 2019 21:41:01 +0200 Message-Id: <20190507194101.17112-1-paul@crapouillou.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The config0 register in the Xburst always reports a MIPS32r2 ISA, but not all of them support it. Signed-off-by: Paul Cercueil --- arch/mips/jz4740/setup.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/arch/mips/jz4740/setup.c b/arch/mips/jz4740/setup.c index 7e63c54eb8d2..2508c026bdfa 100644 --- a/arch/mips/jz4740/setup.c +++ b/arch/mips/jz4740/setup.c @@ -64,6 +64,7 @@ static unsigned long __init get_board_mach_type(const void *fdt) void __init plat_mem_setup(void) { + struct cpuinfo_mips *c = ¤t_cpu_data; int offset; void *dtb; @@ -81,6 +82,18 @@ void __init plat_mem_setup(void) jz4740_detect_mem(); mips_machtype = get_board_mach_type(dtb); + + switch (mips_machtype) { + case MACH_INGENIC_JZ4740: + /* + * The config0 register in the Xburst always reports a MIPS32r2 + * ISA, but not all of them support it. + */ + c->isa_level &= ~MIPS_CPU_ISA_M32R2; + break; + default: + break; + } } void __init device_tree_init(void) -- 2.21.0.593.g511ec345e18