Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp493021pxa; Fri, 21 Aug 2020 12:34:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzO/h2+7+YZQ2JA8GzsnPPUa19/dSaetzQluRaWfpUPeGYJ0YXrH0855Wgjm8rPAQanrgvP X-Received: by 2002:a05:6402:1606:: with SMTP id f6mr4253940edv.328.1598038445660; Fri, 21 Aug 2020 12:34:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598038445; cv=none; d=google.com; s=arc-20160816; b=mIUzR0/mSyDMjMnKNQZDjaXpKaUXe1usRA47eokBnkSm/WMkaWuuws6N9ffVWRzbtn M/3AP80c1ejfTO+HbrR77Ch5w9QmOckRI7fB4QHsZxVf4nyaZGn/npTxwlI+0y/9VkWJ uz6AE016lIzmnMt+pdzdozf89U+uh4rjAL5887gGkUhx74Y86iVP+eMsaQ6f8Vr52XLZ 2ThBHj/6iFY3OF70XmRIwb/3nP13dCg6BkX+/9LGwZ8/x972aCrDnJ+txPr3qg3kG986 N5JxfibGE9gVzEjgcjl3QTOW+/HBoScHnIoI8QdBz8cRJSJtHoTCc/rDd7lIeCOnymyE VKeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:message-id :in-reply-to:subject:cc:to:from:date; bh=OcV7sR1FuuO42rmp+4fnc0iV8w9WZjAPsYJvgOUBUkU=; b=pQQg7SL0i8lXlMArthSz82p1BgYD5t0JqeBzRMScMyI0tietdWiew/1RXwEYpi87V8 XqwBD3BAnBl/XMJsjxcoV+MibjoC+ABUL1iSbH7wz90rcQ+2ixEbTKayscwWrE8iOdZz 4LkA3qDGfLIjSMIh8RSixhTPhw9qWEpP6KMms8izPw2s64LYXS5l6JLhChY+POEKDGep WYRVlYtN8b9eSXiWwTOlvTZVJZ6pTpYcice79gGQymRx6inCREJR6guUxbipfHTKlk0S zVbLQ1e/2VQaBQeIdiPD7qYAuMy49uVjLEqodGCKUl7M1z2GKU9roSGl0YngqG9ah7Mw Cv1A== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g17si1801724edq.44.2020.08.21.12.33.42; Fri, 21 Aug 2020 12:34:05 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726673AbgHUTb1 (ORCPT + 99 others); Fri, 21 Aug 2020 15:31:27 -0400 Received: from orcam.me.uk ([81.187.245.177]:40872 "EHLO orcam.me.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725801AbgHUTb1 (ORCPT ); Fri, 21 Aug 2020 15:31:27 -0400 X-Greylist: delayed 478 seconds by postgrey-1.27 at vger.kernel.org; Fri, 21 Aug 2020 15:31:26 EDT Received: from bugs.linux-mips.org (eddie.linux-mips.org [IPv6:2a01:4f8:201:92aa::3]) by orcam.me.uk (Postfix) with ESMTPS id 688F72BE086; Fri, 21 Aug 2020 20:23:17 +0100 (BST) Date: Fri, 21 Aug 2020 20:23:16 +0100 (BST) From: "Maciej W. Rozycki" To: Paul Cercueil 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 Subject: Re: [PATCH 00/13] MIPS: Convert Ingenic to a generic board In-Reply-To: Message-ID: References: <20200803170124.231110-1-paul@crapouillou.net> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 7 Aug 2020, Paul Cercueil wrote: > > I'm not too sure if remove "cpu-feature-overrides.h" will cause some > > problems for X2000, because according to my current test on X2000, I found > > that it is somewhat different from the SoCs using XBurst1 CPU core, with the > > kernel source code provided by Ingenic, for example, we must configure > > "#define cpu_has_tlbinv 1" in "cpu-feature-overrides.h" to make the X2000 > > work normally, otherwise the kernel will get stuck. And X2000's interrupt > > controller has also been redesigned. If these differences make it impossible > > to share code, should we set a subdirectory of "xburst" and "xburst2" in > > "arch/mips/ingenic"? (I am just worried about this situation, so far I have > > not been able to successfully run the mainline kernel on X2000). > > The is kind of a hack, to hardcode 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 X2000 has, > reading from the CPU config registers ("TLB INV" info should be in config4). > Right now cpu_probe_ingenic() doesn't read config4 (not present on older SoCs) > but that's trivial to add. FAOD is not a hack, but an optimisation measure so that features known to be hardwired for a given machine/CPU do not have to be dynamically queried every time referred. In some cases that results in large portions of code being optimised away by the compiler as well. The hardcoded value for a feature defined in always has to be the same as one in the corresponding bit of the `options' member of `struct cpuinfo_mips', in this case MIPS_CPU_TLBINV. Maciej