Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp613889pxa; Fri, 21 Aug 2020 16:21:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzJn/xeVF9QKdXiIjFbpVYMxrkQ5EfTwwd5UckCAKOAWJsD/zBISzQQRh+n/MQ0dPbY2Wm5 X-Received: by 2002:a17:906:9399:: with SMTP id l25mr5168936ejx.212.1598052084108; Fri, 21 Aug 2020 16:21:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598052084; cv=none; d=google.com; s=arc-20160816; b=QlFoa2PzEqitV4eGm15pBBBRuAoUtNNkyuGv6A8MtCLeMyiUS53LAms+wv57kEQC4w FxZtXsS6cDBCoMrJ3lEXfMHz8rBAlM2hGA8Wz0hNRshkB8xJ3xf5buMJAK79AVzoCjqF MQbK8rxK03L+vnoa33l1s8uNXzgFl6FPnw4IGMyLtOH/pYxWvcQ2kD73N/paiKeEKr3e qpCq/pN05o+t823IjeX+6CAspm14V0auieEir/is2ypIoR2nkZXtUFjt/dRq5gzIE/4V 2kOV7nQmn2ln4rQPd0lO/cSa9lIDE9TVz4QC/radEj+iQutvAZev3VXX9ARPSELJzroh DNJQ== 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:cc:to:subject:from:date :dkim-signature; bh=0CsTuiMTiEu/xIUOx6Ma+PuIV6t5tONatR3HrhWSYoU=; b=tWawIYbs82bUMKYA7rvUJZFeVmdqjhV3GrJUUhHlqHDDjYJFnLbGObcLDCha6sBPFY 2+WKAR/MVziHx5Oi7d4hzxJrtUHQlsjznKPZKN6uGPhIB33GqwtL0rMLV3AqjW2njIgs oLBF3QVXxl9ZOn+8c+XmSUR45Mtw8QB4rkSFmnihsWU8JoQj4uwF+5EK2LZE4RJ3GeJx lkDNieYL0dmXMh7nR64kh7H3iS7ZFKiI/9TUZsOhJugtqBaEcbSo6kXjt4WjMimlLwuX Ism+z0qD0bSLiYy38OT56pvqgBM2KLe32akU/na40wN2lH3GPJyo685p3vWTuRlHnanu evOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@crapouillou.net header.s=mail header.b=nMOPtEpq; 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 u59si2665699edc.53.2020.08.21.16.21.00; Fri, 21 Aug 2020 16:21:24 -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=nMOPtEpq; 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 S1726753AbgHUXTc (ORCPT + 99 others); Fri, 21 Aug 2020 19:19:32 -0400 Received: from crapouillou.net ([89.234.176.41]:35744 "EHLO crapouillou.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726541AbgHUXTb (ORCPT ); Fri, 21 Aug 2020 19:19:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1598051968; 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=0CsTuiMTiEu/xIUOx6Ma+PuIV6t5tONatR3HrhWSYoU=; b=nMOPtEpqnXusppBfIetJ3PFR8jN8ZSDgO7jM0PyRCv1yqbym/lKM4q9bY51WadT8fLmbRX r+j1u1bX0M6SHUGOeJ+uzSVt34LJbOQA6xstV+26q7VfTfQXf2Th+VDi6qhRZu52w5wJWB c6tYC1zrc/usdPyVnpMuS4PuiQb2aHU= Date: Sat, 22 Aug 2020 01:19:16 +0200 From: Paul Cercueil Subject: Re: [PATCH 00/13] MIPS: Convert Ingenic to a generic board To: "Maciej W. Rozycki" Cc: Zhou Yanjie , Thomas Bogendoerfer , Paul Burton , Krzysztof Kozlowski , od@zcrc.me, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, =?UTF-8?b?5ryG6bmP5oyv?= , dongsheng.qiu@ingenic.com, rick.tyliu@ingenic.com, yanfei.li@ingenic.com, xuwanhao@wanyeetech.com Message-Id: <4SSFFQ.3I498N5I41LP3@crapouillou.net> In-Reply-To: References: <20200803170124.231110-1-paul@crapouillou.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Maciej, Le ven. 21 ao=FBt 2020 =E0 20:23, Maciej W. Rozycki=20 a =E9crit : > On Fri, 7 Aug 2020, Paul Cercueil wrote: >=20 >> > I'm not too sure if remove "cpu-feature-overrides.h" will cause=20 >> some >> > problems for X2000, because according to my current test on=20 >> X2000, I found >> > that it is somewhat different from the SoCs using XBurst1 CPU=20 >> core, with the >> > kernel source code provided by Ingenic, for example, we must=20 >> configure >> > "#define cpu_has_tlbinv 1" in "cpu-feature-overrides.h" to make=20 >> the X2000 >> > work normally, otherwise the kernel will get stuck. And X2000's=20 >> interrupt >> > controller has also been redesigned. If these differences make it=20 >> impossible >> > to share code, should we set a subdirectory of "xburst" and=20 >> "xburst2" in >> > "arch/mips/ingenic"? (I am just worried about this situation, so=20 >> far I have >> > not been able to successfully run the mainline kernel on X2000). >>=20 >> The is kind of a hack, to hardcode=20 >> settings in case >> the CPU is not properly detected. The cpu-probe.c should be able to >> auto-detect these settings, including the inverted TLB that the=20 >> X2000 has, >> reading from the CPU config registers ("TLB INV" info should be in=20 >> config4). >> Right now cpu_probe_ingenic() doesn't read config4 (not present on=20 >> older SoCs) >> but that's trivial to add. >=20 > FAOD is not a hack, but an optimisation=20 > measure > so that features known to be hardwired for a given machine/CPU do not=20 > have > to be dynamically queried every time referred. In some cases that=20 > results > in large portions of code being optimised away by the compiler as=20 > well. Fair enough. Bloat-o-meter reports about ~100 KiB saved when that file=20 is present. But we can't use it in a generic kernel, unfortunately. > The hardcoded value for a feature defined in=20 > > always has to be the same as one in the corresponding bit of the=20 > `options' > member of `struct cpuinfo_mips', in this case MIPS_CPU_TLBINV. In theory yes, in practice the CPU detection code is lagging behind... Cheers, -Paul