Received: by 10.223.176.46 with SMTP id f43csp3032177wra; Mon, 22 Jan 2018 07:22:52 -0800 (PST) X-Google-Smtp-Source: AH8x225ZI8UyzQxKd52j092G07jjD2WEGXbH2uKX8nDn996/yw0ICIAOXWD3iNAkm+o6c0ws9jgJ X-Received: by 10.36.85.206 with SMTP id e197mr8503568itb.124.1516634572176; Mon, 22 Jan 2018 07:22:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516634572; cv=none; d=google.com; s=arc-20160816; b=QaQfPoBwBoVh6uQuYnTdNJJ69fjV8VWL0N+AOww3L5ebgib6IVxYRPR3ljd9cjxWnA bn1yxtpajvx6j5GaEox/Ifwjmlc1Q6jQ7Pog/xwdrsj1BJED+5czNmA5ECrzQMs8W+0Q 0CS2qoLQca2aD3kbm4/2E6rUjmPjdnAkNOcGT1wUCqKzkfQOY7Yj/D7d5bhY5CE0KUGJ HQ7BuvKmAq2DDvItCc/XL7qc3GT+aSlULe5QrfsAZQMpqpXnUle3cFEDU3NqDVB7GdfH adnlhoxMRutHag5EqdaJ0K/WnuWW4h8yFrUtlWlWU4g4rcQwJ2nLduDu0np1qHbgQm6k viuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=Ydhbrrmz0XpJix8oVgM4ekmTDDi6vqD/DyluAi8lVH8=; b=HFeP+8OPe3yEzl9oViJlzhI3jC8jITxkTyRe9UTQkEmvS3SzHPN5+/zFOV/310lpM5 YghtGvvLpJNrh0hnuqOHYAvW82qUlJ8DW/WwvH3mf2/2sDIsHUSMGX2dBpSloRp8HMUm EPDLh0lLlX1FxgWN6GN9E9Y/S96VhQriF/yoa/OiFwqzmMJ3/9b0B2Cg9M3woEbLtA2O II7pX0iol0irRA/K6VvPUxsvv1KeNRbBZ6WJe/86iou1XCte8kugSV9Xc5EO9zwao0Sd D46e6l/G0i+aKXMnGLgd9llkJZuHETKWgwr7SmGX0A65TBQ83gogsp6Nc7HY5ltX++/U 266g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=rMYLJImE; 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=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y62si5809918itg.67.2018.01.22.07.22.38; Mon, 22 Jan 2018 07:22:52 -0800 (PST) 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=pass header.i=@gmail.com header.s=20161025 header.b=rMYLJImE; 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=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751167AbeAVPVN (ORCPT + 99 others); Mon, 22 Jan 2018 10:21:13 -0500 Received: from mail-ua0-f194.google.com ([209.85.217.194]:42607 "EHLO mail-ua0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751054AbeAVPVK (ORCPT ); Mon, 22 Jan 2018 10:21:10 -0500 Received: by mail-ua0-f194.google.com with SMTP id n2so6050002uak.9; Mon, 22 Jan 2018 07:21:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Ydhbrrmz0XpJix8oVgM4ekmTDDi6vqD/DyluAi8lVH8=; b=rMYLJImER9BLuqXfRnoFPelAf93Jdp0a10JIQ3VSBlbYlbIkpbi8TLD2gD5t/hpyUS HFskmd7rzR/U/tYbS1BTogG9Vb+CplyQuOlSJvvyFLjWZKsRJlUmrCbomNrj+vYWm+MC V3xEsam2Z+Zx042XaAsHf+4fdTXRRiSuqnZrVkL03qJtafzdeHqDNjd35c5OTJLcebbp Iu49BPjDaGHZTBNpbLR5HNh1GUDE5kQT8mJwaBV04gJpGQh8oYZcrQ+HD+fv/2SmNIBs TDgpIP8hlpSggAM2r4tUQG3FjpbW4013Wb5MIs6xa+a7zQhKDNrK6wer3TvDHSA1bbmQ t/FQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Ydhbrrmz0XpJix8oVgM4ekmTDDi6vqD/DyluAi8lVH8=; b=reoGPm3sIrwaEmbvgUhXTJQ0HEje9TDFAVamfbFiZCcaJYldcpcGPMttxuD7cHwHcH tBr7XG4jNWv3cWKjV2/zC0GHNf0qi7hZJxjC1bn5zR3Hk3T+A4PRdW4h9Z1psW85296M viLrEeAeB3l2ZCeQa/QkQ0OEOuZloVEzoLgYucS3vY6+Jurbz0MGWQ0rOYYU6Z2ZkYs3 Ou7LuJj/qJIKfMidZ581mvh3x8nxUiMrUCYMOMIbuf/H8srPw5xXq+BwD71nuGFAuAUJ nPBPf78DOfKuA0i5dLyVP0+nBtScq3n6Zz3uh3BzS3beafx6O25Acy1ZLTnbTIhbYfKj P9sg== X-Gm-Message-State: AKwxytf6UPTkl4p9vCpydobPJ52QAIIEE3uWY8rPXwvtA8VyaIHv3RQR P8IyK36k1VaSDjDWnW3s2yvo6cRSZzBTbgSNiSw= X-Received: by 10.159.57.111 with SMTP id i47mr6102080uag.79.1516634468869; Mon, 22 Jan 2018 07:21:08 -0800 (PST) MIME-Version: 1.0 Received: by 10.159.42.194 with HTTP; Mon, 22 Jan 2018 07:20:28 -0800 (PST) In-Reply-To: References: From: Greentime Hu Date: Mon, 22 Jan 2018 23:20:28 +0800 Message-ID: Subject: Re: [PATCH v6 29/36] nds32: Build infrastructure To: Arnd Bergmann Cc: Greentime , Linux Kernel Mailing List , linux-arch , Thomas Gleixner , Jason Cooper , Marc Zyngier , Rob Herring , Networking , Vincent Chen , DTML , Al Viro , David Howells , Will Deacon , Daniel Lezcano , linux-serial@vger.kernel.org, Geert Uytterhoeven , Linus Walleij , Mark Rutland , Greg KH , Guo Ren , Randy Dunlap , David Miller , Jonas Bonn , Stefan Kristiansson , Stafford Horne , Vincent Chen Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Arnd: 2018-01-18 19:00 GMT+08:00 Arnd Bergmann : > On Mon, Jan 15, 2018 at 6:53 AM, Greentime Hu wrote: >> From: Greentime Hu >> >> This patch adds Makefile, Kconfig and vmlinux.lds.S files required for building >> an nds32 kernel. >> >> Signed-off-by: Vincent Chen >> Signed-off-by: Greentime Hu > > I find some new details every time I look here ;-) Thank you for revewing so detailedly. :) >> @@ -0,0 +1,107 @@ >> +# >> +# For a description of the syntax of this configuration file, >> +# see Documentation/kbuild/kconfig-language.txt. >> +# >> + >> +config NDS32 >> + def_bool y >> + select ARCH_HAS_RAW_COPY_USER > > I don't think this symbol was ever merged. Do you remember why you added it? I will drop it. It must be added in earlier kernel version. >> + select ARCH_WANT_FRAME_POINTERS if FTRACE >> + select ARCH_WANT_IPC_PARSE_VERSION > > You most certainly don't want IPC_PARSE_VERSION, please drop this > and adapt your glibc. ok. I will drop it. >> + select CLKSRC_MMIO >> + select CLONE_BACKWARDS >> + select COMMON_CLK >> + select FRAME_POINTER > > Do you need both ARCH_WANT_FRAME_POINTERS and FRAME_POINTER here? I will drop FRAME_POINTER. >> + select GENERIC_ATOMIC64 >> + select GENERIC_CPU_DEVICES >> + select GENERIC_CLOCKEVENTS >> + select GENERIC_IRQ_CHIP >> + select GENERIC_IRQ_PROBE > > I think it's better to drop GENERIC_IRQ_PROBE here, no modern driver > should rely on that. I will drop it. >> +choice >> + prompt "CPU type" >> + default CPU_V3 >> +config CPU_N15 >> + bool "AndesCore N15" >> +config CPU_N13 >> + bool "AndesCore N13" >> + select CPU_CACHE_ALIASING if ANDES_PAGE_SIZE_4KB >> +config CPU_N10 >> + bool "AndesCore N10" >> + select CPU_CACHE_ALIASING >> +config CPU_D15 >> + bool "AndesCore D15" >> +config CPU_D10 >> + bool "AndesCore D10" >> + select CPU_CACHE_ALIASING >> +config CPU_V3 >> + bool "AndesCore v3 compatible" >> + select ANDES_PAGE_SIZE_8KB >> +endchoice > > I forget what we discussed here earlier, but at the very least, there should be > some help text here to explain what the implications are. I assume that you > generally want to be able to build one kernel to run on all of the above, right? > > Will selecting 'CPU_V3' result in a kernel binary that can run on all of them? > If so, please explain it here as that is not obvious. > > For the other CPU types, can you list the what backwards-compatiblity > you get? E.g. will a kernel built for N13 run on any of N15, D15 or N10? > Yes, we would like to build a kernel with CPU_V3 to run on all of the above. Not sure if these help texts clear enough? choice prompt "CPU type" default CPU_V3 help The data cache of N15/D15 is implemented as PIPT and it will not cause the cache aliasing issue. The rest cpus(N13, N10 and D10) are implemented as VIPT data cache. It may cause the cache aliasing issue if its cache way size is larger than page size. You can specify the the CPU type direcly or choose CPU_V3 if unsure. A kernel built for N10 is able to run on N15, D15, N13, N10 or D10. A kernel built for N15 is able to run on N15 or D15. A kernel built for D10 is able to run on D10 or D15. A kernel built for D15 is able to run on D15. A kernel built for N13 with CPU_CACHE_ALIASING is able to run on N15, D15, N13, N10 or D10 A kernel built for N13 without CPU_CACHE_ALIASING is able to run on N15, N13 or D15 config CPU_N15 bool "AndesCore N15" config CPU_N13 bool "AndesCore N13" select CPU_CACHE_ALIASING if ANDES_PAGE_SIZE_4KB config CPU_N10 bool "AndesCore N10" select CPU_CACHE_ALIASING config CPU_D15 bool "AndesCore D15" config CPU_D10 bool "AndesCore D10" select CPU_CACHE_ALIASING config CPU_V3 bool "AndesCore v3 compatible" select CPU_CACHE_ALIASING endchoice > I think the 'select ANDES_PAGE_SIZE_8KB' cannot work as expected, > since ANDES_PAGE_SIZE_8KB is inside of a 'choice' statement. Since > there are only two options (4K and 8K), you can address that by making > it a simple bool option and fall back to 4K when ANDES_PAGE_SIZE_8KB > is disabled. After reviewing this config, it seems to make much more sense if we select CPU_CACHE_ALIASING. A kernel with aliasing cache handling should be able to run on aliasing/non-aliasing CPU. config CPU_V3 bool "AndesCore v3 compatible" select CPU_CACHE_ALIASING >> +config CACHE_L2 >> + bool "Support L2 cache" >> + default y >> + help >> + Say Y here to enable L2 cache if your SoC are integrated with L2CC. >> + If unsure, say N. >> + >> +menu "Memory configuration" >> + >> +choice >> + prompt "Memory split" >> + depends on MMU >> + default VMSPLIT_3G > > Why not default to VMSPLIT_3G_OPT? > I will set default to VMSPLIT_3G_OPT and delete CONFIG_VMSPLIT_3G_OPT=y in defconfig.