Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2762817pxk; Sun, 6 Sep 2020 12:31:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwdmAW7E3Rf/X0aeNDhSg36L07YJnRqymt9sbPvmrd3fmx7Tf2gVDGVjKYWQU2s4OfET+/y X-Received: by 2002:a17:906:4c58:: with SMTP id d24mr18553185ejw.108.1599420686490; Sun, 06 Sep 2020 12:31:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599420686; cv=none; d=google.com; s=arc-20160816; b=ETOZ5PcQlnp4KJYA997dWbYI74MjyH9GaEMVmaDwQZHQNlpgJ8Hxd6ze0pjNjvxK+L C3SUoCfGj9VL36YM5rRJSung27R5UIu/rK4eqC09yR6FFLEfG6wfo0KmKRvT1r/J6zFT bC5XE7KLyVTqJ5tUBck9TQTxDu2YeN0rrepBGJxxpitOeZtFHvg8cdpr9Rt+zeZqxfUd SYaN5eLMshTjWpQjcMm8lW93yestev+756bj0umrN4Iw4v6/UKM4ZMGVomYE/797InPT yXigCvIpriN8n/G98hAhw2IYAW2sRKj6z4zQiW5nYRqMYOUuFEwJ/Rn+0dwu93HQXsxS 3vjQ== 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=T+mA6CdIialbdEw/Jj1NoajCxjCDwcIsx8+EvoIPNT8=; b=rNC1ngbsyKZF7Ctyqg5Za79olkNMOyWO+OnfFeMKvkHfB/JFiB7HGJHvyO8NOxQoIk pL19oBibpoG31rqXmrUG5i2oEW3frGs60+6SVjv7Pc5blr5ZN2u6ZlYcaXBvTmD7WUhX ofa0RraC/2idY1FDvo2jAfTGFCQ/IEgVvHCFAw/1hep7345fzNzH+augkWS90Z3he3ef m9mMxi4D8BRJYGkBNzpux5WyO9aq0MCe+Jihul1tHHUBJgmN5u2mJnvgSjPk4s/g+I6P QXZ0mPdx+b6r+IU3uGW4IJMCnoLJdfVbBPQ1lI1SgptY4/8E582PQ4vj1aw85asXdnL1 b22w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@crapouillou.net header.s=mail header.b="Dk/I2dnR"; 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 jr1si8693777ejb.164.2020.09.06.12.31.04; Sun, 06 Sep 2020 12:31:26 -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="Dk/I2dnR"; 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 S1726443AbgIFTaG (ORCPT + 99 others); Sun, 6 Sep 2020 15:30:06 -0400 Received: from crapouillou.net ([89.234.176.41]:35696 "EHLO crapouillou.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725773AbgIFTaB (ORCPT ); Sun, 6 Sep 2020 15:30:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1599420585; 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=T+mA6CdIialbdEw/Jj1NoajCxjCDwcIsx8+EvoIPNT8=; b=Dk/I2dnRZZeARyAHmtKYj5EyfP1IxJjePqFmFiZA042nOblAuTxSqAveU6zA60pPNryYJH lHnL2Z0muH62dnWgAS1AejFrUmeshA581tCOEvugZiDTrAoO9fbivM5miY70yM6nRTPv8O lVwjn/rPfejovTWFIMhytpkb4av/j6A= From: Paul Cercueil To: Thomas Bogendoerfer Cc: "Maciej W . Rozycki" , Paul Burton , Zhou Yanjie , od@zcrc.me, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, Paul Cercueil Subject: [PATCH v3 02/15] MIPS: cpu-probe: Set Ingenic's writecombine to _CACHE_CACHABLE_WA Date: Sun, 6 Sep 2020 21:29:22 +0200 Message-Id: <20200906192935.107086-3-paul@crapouillou.net> In-Reply-To: <20200906192935.107086-1-paul@crapouillou.net> References: <20200906192935.107086-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-v3: 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