Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp61473pxa; Tue, 11 Aug 2020 17:21:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwhItLkRIHRAJEOvxWS7ycpXH1A+9BgTu3pUBOZ1J/ULTZWhgOVDeRyhELZ6REWv8ErPBSS X-Received: by 2002:a05:6402:415:: with SMTP id q21mr14993826edv.71.1597191668192; Tue, 11 Aug 2020 17:21:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597191668; cv=none; d=google.com; s=arc-20160816; b=kgzNhyTE59+JvJGx9tF1X1BAw0qp78sv9zSxxTFobMz/ngDoxID5j/8i3Vbwoa5YJV UQhYQlVtX2hNWxj38J05HpA6qX7dWDzXdiggQ//EIaiTJdwKxIZsP320wqZmCKibx94v VAGtFJ73WCXy6kZ3BUt8/BjLmUcboddlGetwqgPAJmWn4NuCtjF8cOWdRy0grvSgPlfr Hi7Fr8qF5/S6N1tKfkquuPq8p/kX43pnaZovcoGCRNWihCQzxp31YefxmEzGkITwUnbR Fv5eW6pAEg5x6ToIDL8WbjjxMr/sxtTcmfy8HNLqD9xV1DW3oTf5DjGNTFDi2wjMUuYS jcDA== 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 :dkim-signature; bh=zkDwWdldFZhVbQT1HD0sorsYql4xiMVLvScvfrZUipM=; b=RTRbq7Ck6nO9iReXdMUEnZONI8pEx3M1CgRe1Lj4gaU5VQc/9hKCXhSVgZ5iYpRTiK oGeKvEzIZV2btpd0FGoSI8SgBPgQZ2kiGPd3+CJjpVVpHEaA0gbzw6YZdmjl2P8Dghdq umLaoNot3f0Pd2UzoUq3TbtVxZRuRzIokaKRHrjg5sQfFOOLJ9zSFJ5+46pwseUmjsZl YfFBvZY7UF90Aqm50yT+tKuwBcq0JIpontamaidK7BMIDUAO1God1RPG76eBQZOnrEFt hfla59427E4/NJSCLZ8XbsxAz/ipK+Oxx+iixwgxRVOu9rZyVsGwCNEdDNTnUTd2vgUl w5UQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@crapouillou.net header.s=mail header.b=ZQqZ+2xx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id b1si122341ejb.515.2020.08.11.17.20.44; Tue, 11 Aug 2020 17:21:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@crapouillou.net header.s=mail header.b=ZQqZ+2xx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1726573AbgHLAP3 (ORCPT + 99 others); Tue, 11 Aug 2020 20:15:29 -0400 Received: from crapouillou.net ([89.234.176.41]:52080 "EHLO crapouillou.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726271AbgHLAP3 (ORCPT ); Tue, 11 Aug 2020 20:15:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1597191319; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zkDwWdldFZhVbQT1HD0sorsYql4xiMVLvScvfrZUipM=; b=ZQqZ+2xxhg43yQ9CBD8smrRj1Effcfhqf9SxXXpT6fcIOa+u43/exghNUbin2asxo4TkFs 2xsXLwR1CEZA266fhgh2c7A7FB6tKZoZOQIh7plVyFl2FWD346i3pR9DfXWzLH7Rk5DOSy jhag4xgvyrZFYGIJ2Dsl6tBf4zMdLU0= From: Paul Cercueil To: Thomas Bogendoerfer Cc: Paul Burton , Krzysztof Kozlowski , =?UTF-8?q?=E5=91=A8=E7=90=B0=E6=9D=B0?= , od@zcrc.me, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, Paul Cercueil Subject: [PATCH v2 01/13] MIPS: cpu-probe: Set Ingenic's writecombine to _CACHE_CACHABLE_WA Date: Wed, 12 Aug 2020 02:14:58 +0200 Message-Id: <20200812001510.460382-2-paul@crapouillou.net> In-Reply-To: <20200812001510.460382-1-paul@crapouillou.net> References: <20200812001510.460382-1-paul@crapouillou.net> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Previously, in cpu_probe_ingenic(), c->writecombine was set to _CACHE_UNCACHED_ACCELERATED, but this macro was defined differently when CONFIG_MACH_INGENIC was set. This made it impossible to support multiple CPUs. Address this issue by setting c->writecombine to _CACHE_CACHABLE_WA directly and removing the dependency on CONFIG_MACH_INGENIC. Signed-off-by: Paul Cercueil --- Notes: v2: No change arch/mips/include/asm/pgtable-bits.h | 5 ----- arch/mips/kernel/cpu-probe.c | 3 ++- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/arch/mips/include/asm/pgtable-bits.h b/arch/mips/include/asm/pgtable-bits.h index e26dc41a8a68..2362842ee2b5 100644 --- a/arch/mips/include/asm/pgtable-bits.h +++ b/arch/mips/include/asm/pgtable-bits.h @@ -249,11 +249,6 @@ static inline uint64_t pte_to_entrylo(unsigned long pte_val) #define _CACHE_CACHABLE_NONCOHERENT (5<<_CACHE_SHIFT) -#elif defined(CONFIG_MACH_INGENIC) - -/* Ingenic uses the WA bit to achieve write-combine memory writes */ -#define _CACHE_UNCACHED_ACCELERATED (1<<_CACHE_SHIFT) - #endif #ifndef _CACHE_CACHABLE_NO_WA diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c index e2955f1f6316..a18f3611fa5e 100644 --- a/arch/mips/kernel/cpu-probe.c +++ b/arch/mips/kernel/cpu-probe.c @@ -2169,8 +2169,9 @@ static inline void cpu_probe_ingenic(struct cpuinfo_mips *c, unsigned int cpu) /* XBurst®1 with MXU2.0 SIMD ISA */ case PRID_IMP_XBURST_REV2: + /* Ingenic uses the WA bit to achieve write-combine memory writes */ + c->writecombine = _CACHE_CACHABLE_WA; c->cputype = CPU_XBURST; - c->writecombine = _CACHE_UNCACHED_ACCELERATED; __cpu_name[cpu] = "Ingenic XBurst"; break; -- 2.28.0