Received: by 10.213.65.68 with SMTP id h4csp1614655imn; Mon, 19 Mar 2018 08:47:58 -0700 (PDT) X-Google-Smtp-Source: AG47ELto2C9LKM9tGavjl7pbetPu980ucv6b3tgew5pp7lR0dn1tqpgF21pKTLu0egwVskkF3fOc X-Received: by 10.99.113.25 with SMTP id m25mr9636018pgc.164.1521474478325; Mon, 19 Mar 2018 08:47:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521474478; cv=none; d=google.com; s=arc-20160816; b=UDDp1ujQbbjS6rIPwl8nJlq4WKbee5Foh2CwicZXl3keCNEMXQSgXORqm81xrNXBJ0 OVPP4UtjByO3UT81U//lkBuXQ/+DmCXPciSfZtL/v5jrlnj7dLdmZuMQhp/Hy/to0O+D dKXOa7+8eGkx4GbThf4p2zAifavHm66PveMq15Gsjbfeo2HE8YrOfKQZxtp+0oQMAuHp mzB316j3Z74tyt00FyEr5lMjpg/zAFiWt1hEfQ+dydSnrdBqIps5BtNgOUG5mru/D4Z3 rZphY8gSqM07LY4DByxqgO7TKkA9Clk8J+Jgz9sTMRSRcpN17Y9lV5Am9DvVBXBtrQJn s7XQ== 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=rgfZH5KMvohXTZRHO0bCiahSjo164iw5JNr+nH0qE4g=; b=LTUKAWGugiAUEUKSTJ+RzZW5n43OA8GMVbv8p98eDfcIT4WdS7Qv9VEuTDc2sKaeXT HHYZDfu2Aka5oLtr2W0GZ48Osg34UWZ15Xbshb9BoCiLkxrOrsJULKAEJsh6DAdPJvX6 3FruvXbk7vDNNskhDDAgyiZINi/vkyUKH4mkaTwU2C+D+rMMr7GVNd6QQb3UozlLrUWB JHDBRuBknJUnQgfjxaJuPhuhcyAPL7RvayCxgaVlE+hC4gkerNgu8CSZhpSHLLCKoIzA /9B206veKd2ssva1102RH+WL40b1TnrDeHX97Y611UYo2h9vJ6Fdb6Yw4enhxzJzj+Dy 1KRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=IaRX9lCZ; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z62si133638pgd.819.2018.03.19.08.47.43; Mon, 19 Mar 2018 08:47:58 -0700 (PDT) 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=fail header.i=@gmail.com header.s=20161025 header.b=IaRX9lCZ; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755950AbeCSPpa (ORCPT + 99 others); Mon, 19 Mar 2018 11:45:30 -0400 Received: from mail-io0-f194.google.com ([209.85.223.194]:34077 "EHLO mail-io0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755539AbeCSPpZ (ORCPT ); Mon, 19 Mar 2018 11:45:25 -0400 Received: by mail-io0-f194.google.com with SMTP id r18so2532605ioa.1; Mon, 19 Mar 2018 08:45:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=rgfZH5KMvohXTZRHO0bCiahSjo164iw5JNr+nH0qE4g=; b=IaRX9lCZ2ADGaCDimYOU8ClANCxBgPqcC/SanP13v4/xqYrrJ14AXP0HRYkQsI39NR tDyWhMY4eY1acrr8DZ0mnWxnBYzkyEKIn1y7CYE5/9Ms8mwTUJXpZOD6QIeE5LmrP3BZ V51kjujBgP/NUzSwzfd8tR3zbGchIxucz+CFQiBf/9inTbHtwEEdzx2CuAHVYwLHP2gN pu9C/PRWSyroXj+emKBq3kl7Y7vnbKjtaO9tys/LwccOUpMZs/rugSxo8aCLI6SHPrVf SJDD3LG2jE4udiLyNiOSa+RiZWjfpBENxAcLtYXg4S16Avq1q8ZfJILjoC7cVmu1AjLW 6cFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=rgfZH5KMvohXTZRHO0bCiahSjo164iw5JNr+nH0qE4g=; b=i3dwWgVMIE/fLdPhyvPBM5uc6uY8f3C+a+Wk9Sw5PX/ryJU4DBy22QMrX6yq/o1XFt jhY/iV92keA2xuGvuqxslmR3aCqxzLqVCUaHa9HTjioC+wO0OLD6jLpOFgltleDCbkmb stZtFokO4gK4ywrtqEn+xoZiGrvVAHecxfnUnyzBxzdVPl4JwUd1q+/+TG+2Zrs2rjFp y4Ll5zPlLkg9Qrz4AYVrgILi0E8eL0F8ll0mpEYeJbBABlYlUyrgES9WW5sfDYdfcsLe RGx/LhbxFCn+L86goZRWZZGto4h+w0hJO6x9Pm6FjhPLNsm1l/KHBsUPiaZfNi23Rzl9 m5Kw== X-Gm-Message-State: AElRT7FTyOtfKqWWWj7FFJZb7Huf5AggHT+bIDEFzPmoMbPCibtfYYMC QkLAkTlRvbWNN5wIHGkoMf/NYkmitc0ZuUc6fYmAgA== X-Received: by 10.107.184.198 with SMTP id i189mr11827691iof.228.1521474324886; Mon, 19 Mar 2018 08:45:24 -0700 (PDT) MIME-Version: 1.0 Received: by 10.79.34.71 with HTTP; Mon, 19 Mar 2018 08:45:23 -0700 (PDT) In-Reply-To: References: From: Arnd Bergmann Date: Mon, 19 Mar 2018 23:45:23 +0800 X-Google-Sender-Auth: TzPRCNM0_R2WFRg-X-b67c5AlmI Message-ID: Subject: Re: [PATCH 15/19] csky: Build infrastructure To: Guo Ren Cc: linux-arch , Linux Kernel Mailing List , Thomas Gleixner , Daniel Lezcano , Jason Cooper , c-sky_gcc_upstream@c-sky.com, gnu-csky@mentor.com, thomas.petazzoni@bootlin.com, wbx@uclibc-ng.org 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 On Mon, Mar 19, 2018 at 3:51 AM, Guo Ren wrote: > diff --git a/arch/csky/Kconfig b/arch/csky/Kconfig > new file mode 100644 > index 0000000..694c1f8 > --- /dev/null > +++ b/arch/csky/Kconfig > @@ -0,0 +1,203 @@ > +config CSKY > + bool > + default y > + select ARCH_USE_BUILTIN_BSWAP > + select ARCH_WANT_IPC_PARSE_VERSION Drop ipc_parse_version here, it's only for old architectures. > + select HAVE_OPROFILE > + select HAVE_PERF_EVENTS Do you still need oprofile when you have perf? > + select MODULES_USE_ELF_REL if MODULES > + select MODULES_USE_ELF_RELA if MODULES You should only need one of these two. > + select OLD_SIGACTION > + select OLD_SIGSUSPEND3 These should not be needed. > +config CPU_HAS_CACHEV2 > + bool > + default n > + > +config CPU_HAS_HILO > + bool > + default n > + > +config CPU_HAS_TLBI > + bool > + default n 'default n' is redundant and can be dropped. > +config GENERIC_CALIBRATE_DELAY > + bool > + default y Does your architecture provide a reliable high-reslution clocksource? If yes, you could use that for the delay, rather than a calibrated loop. > +choice > + prompt "CPU MODEL" > + default CPU_CK610 > + > +config CPU_CK610 > + bool "CSKY CPU ck610" > + select CPU_NEED_TLBSYNC > + select CPU_NEED_SOFTALIGN > + > +config CPU_CK810 > + bool "CSKY CPU ck810" > + select HIGHMEM > + select CPU_HAS_HILO > + select CPU_NEED_TLBSYNC > + > +config CPU_CK807 > + bool "CSKY CPU ck807" > + select HIGHMEM > + select CPU_HAS_HILO > + > +config CPU_CK860 > + bool "CSKY CPU ck860" > + select HIGHMEM > + select CPU_HAS_TLBI > + select CPU_HAS_CACHEV2 > +endchoice Why select 'HIGHMEM' based on the CPU type? You should only need it when you have more than 1GB of RAM, and it can be a performance problem when it's enabled without need. Usually the kernel should allow multiple CPU types to be selected together, or ask for a "minimum architecture" level to be selected by allow newer cores to be used as a superset. > +config CPU_TLB_SIZE > + int > + default "128" if(CPU_CK610 || CPU_CK807 || CPU_CK810) > + default "1024" if(CPU_CK860) > + > +config L1_CACHE_SHIFT > + int > + default "4" if(CPU_CK610) > + default "5" if(CPU_CK807 || CPU_CK810) > + default "6" if(CPU_CK860) I think you then need to reverse the order of the list here: When e.g. CK860 and CK810 are both enabled, L1_CACHE_SHIFT should be the largest possible size. > +config SSEG0_BASE > + hex "Direct mapping physical address" > + default 0x0 > + help > + There are MSAx regs can be used to change the base physical address > + of direct mapping. The default base physical address is 0x0. > + > +config RAM_BASE > + hex "DRAM base address offset from SSEG0_BASE, it must be the same with dts memory." > + default 0x08000000 To allow one kernel to run on multiple boards, it's better to detect these two at runtime. > +config CSKY_NR_IRQS > + int "NR_IRQS to max virtual interrupt numbers of the whole system" > + range 64 8192 > + default "128" > +endmenu This should no longer be needed, with the IRQ domain code, any number of interrupts can be used without noticeable overhead. > +menu "Power management options" > + > +source "kernel/power/Kconfig" > + > +config ARCH_SUSPEND_POSSIBLE > + bool y > + default y Make it either def_bool y or bool default y > +config CSKY_BUILTIN_DTB > + bool "Use kernel builtin dtb" > + default n > + > +config CSKY_BUILTIN_DTB_NAME > + string "kernel builtin dtb name" > + depends on CSKY_BUILTIN_DTB It's generally better not to use a builtin dtb, but use the bootloader to pass a dtb. If you need to support existing bootloaders, the best way is to allow appending the dtb to the kernel. > +ifeq ($(VERSION)_$(PATCHLEVEL), 4_9) > +COMPAT_KERNEL_4_9 = -DCOMPAT_KERNEL_4_9 > +endif Should not be needed > +KBUILD_CFLAGS += -ffreestanding \ -ffreestanding usually results in worse code and should not be needed > + -fno-tree-dse \ > + -pipe \ > + -Wno-uninitialized \ For -Wno-uninitialized, better fix the bugs properly. Can you explain why you want -fno-tree-dse? > +++ b/arch/csky/abiv1/Makefile > @@ -0,0 +1,8 @@ > +obj-y += src/bswapdi.o > +obj-y += src/bswapsi.o > +obj-y += src/cacheflush.o > +obj-y += src/memcpy.o > +obj-y += src/mmap.o > + > +obj-$(CONFIG_CPU_NEED_SOFTALIGN) += src/alignment.o Better not use subdirectories like that. Can you explain why you need the alignement fixups? Arnd