linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vineet Gupta <Vineet.Gupta1@synopsys.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Gilad Ben Yossef <giladb@ezchip.com>,
	Noam Camus <noamc@ezchip.com>, <linux-kernel@vger.kernel.org>
Subject: Re: [RFC PATCH v1 26/31] ARC: Build system: Makefiles, Kconfig, Linker script
Date: Wed, 2 Jan 2013 20:00:50 +0530	[thread overview]
Message-ID: <50E4449A.7010606@synopsys.com> (raw)
In-Reply-To: <201211071413.49178.arnd@arndb.de>

On Wednesday 07 November 2012 07:43 PM, Arnd Bergmann wrote:
> On Wednesday 07 November 2012, Vineet Gupta wrote:
> 
>> +
>> +config ARC
>> +	def_bool y
>> +	select ARCH_WANT_IPC_PARSE_VERSION
>> +	# ARC Busybox based initramfs absolutely relies on DEVTMPFS for /dev
>> +	# DEVTMPS in turn needs HOTPLUG
>> +	select DEVTMPFS if !INITRAMFS_SOURCE=""
>> +	select GENERIC_ATOMIC64
>> +	select GENERIC_CLOCKEVENTS
>> +	select GENERIC_FIND_FIRST_BIT
>> +	# for now, we don't need GENERIC_IRQ_PROBE, CONFIG_GENERIC_IRQ_CHIP
>> +	select GENERIC_IRQ_SHOW
>> +	select GENERIC_PENDING_IRQ if SMP
>> +	select GENERIC_SMP_IDLE_THREAD
>> +	select HAVE_GENERIC_HARDIRQS
>> +	select HOTPLUG if !INITRAMFS_SOURCE=""
>> +	select MODULES_USE_ELF_RELA
> 
> You should not need ARCH_WANT_IPC_PARSE_VERSION

Done !

>> +# for old_[ug]id_t - do we need this ?
>> +config UID16
>> +	def_bool y
> 
> No, not needed either.

Done !

> 
>> +menu "ARC Architecture Configuration"
>> +
>> +choice
>> +	prompt "ARC Platform"
>> +	default ARC_PLAT_FPGA_LEGACY
>> +
>> +config ARC_PLAT_FPGA_LEGACY
>> +	bool "\"Legacy\" ARC FPGA dev platform"
>> +	help
>> +	  Support for ARC development platforms, provided by Synopsys.
>> +	  These are based on FPGA or ISS. e.g.
>> +	  - ARCAngel4
>> +	  - ML509
>> +	  - MetaWare ISS
>> +
>> +#New platform adds here
>> +endchoice
> 
> Platform selection should generally be non-exclusive. Just remove the
> "choice" statement here, and make sure that any platforms can be enabled
> together to build a single kernel.

So technically this is not in same league as usage of devicetree. Although it
seems to have it's own merits (single image, code coverage,..) but is this a hard
requirement for all arches. Here's my problem.

We have default implementations of clocksource using in-core local TIMER1. This
however might not suffice for some SMP ARC SoCs which need cross-core synchronized
timers. Obviously they want to use their own versions. In orig code (not v1 - but
in my new v2) I have a platform specific hook local_counter_setup() called from
time_init(). With #def PLAT1 and #def PLAT2, there could be 2 mutually exclusive
versions of those. With the "all-platform-build-together" paradigm, this simple
design is not possible - not to mention the needless code bloat for a simple run
in simulator. So now using devicetree, I first need to find what platform we are
on and then need to setup a platform specific function pointer (and same applies
to several other platform specific stuff). Is there a better way of doing this -
maybe the long dy has taken toll on me :-(


>> +menu "ARC CPU Configuration"
>> +
>> +choice
>> +	prompt "ARC Core"
>> +	default ARC_CPU_770
>> +
>> +config ARC_CPU_750D
>> +	bool "ARC750D"
>> +	help
>> +	  Support for ARC750 core
>> +
>> +config ARC_CPU_770
>> +	bool "ARC770"
>> +	select ARC_CPU_REL_4_10
>> +	help
>> +	  Support for ARC770 core introduced with Rel 4.10 (Summer 2011)
>> +	  This core has a bunch of cool new features:
>> +	  -MMU-v3: Variable Page Sz (4k, 8k, 16k), bigger J-TLB (128x4)
>> +                   Shared Address Spaces (for sharing TLB entires in MMU)
>> +	  -Caches: New Prog Model, Region Flush
>> +	  -Insns: endian swap, load-locked/store-conditional, time-stamp-ctr
>> +
>> +endchoice
> 
> Same thing here: If the different CPUs can in theory run the same kernel
> code, they should allow that. It doesn't stop you from making the default
> to enable only one of them and optimize for that case.

Background: ARC770 supports newer instructions (LOCK/SCOND) + MMUv3 which are not
available on ARC750. So code needs to be built differently for each. Having said
that above config items don't have any code under them - they are just high level
selectors for correct MMU versions and e.g. whether we allow the usage of new insns.

> 
>> +
>> +choice
>> +	prompt "ARC700 MMU Version"
>> +	default ARC_MMU_V3 if ARC_CPU_770
>> +	default ARC_MMU_V2 if ARC_CPU_750D
>> +
> 
>> +endchoice
> 
>> +choice
>> +	prompt "MMU Page Size"
>> +	default ARC_PAGE_SIZE_8K
>> +
>>
>> +
>> +endchoice
> 
> For MMU, page size and endianess, I would not expect that to work though,
> so they probably need to remain mutually exclusive.

Ofcourse - given that PAGE_SIZE needs to be a compile time constant.

> 
>> +menu "Platform Board Configuration"
>> +
>> +source "arch/arc/plat-arcfpga/Kconfig"
>> +#New platform adds here
>> +
>> +config ARC_PLAT_CLK
>> +	int "Clk speed in Hz"
>> +	default "80000000"
>> +
>> +config LINUX_LINK_BASE
>> +	hex "Linux Link Address"
>> +	default "0x80000000"
>> +	help
>> +	  ARC700 divides the 32 bit phy address space into two equal halves
>> +	  -Lower 2G (0 - 0x7FFF_FFFF ) is user virtual, translated by MMU
>> +	  -Upper 2G (0x8000_0000 onwards) is untranslated, for kernel
>> +	  Typically Linux kernel is linked at the start of untransalted addr,
>> +	  hence the default value of 0x8zs.
>> +	  However some customers have peripherals mapped at this addr, so
>> +	  Linux needs to be scooted a bit.
>> +	  If you don't know what the above means, leave this setting alone.
>> +
>> +config ARC_PLAT_SDRAM_SIZE
>> +	hex "SD RAM Size"
>> +	default "0x10000000"
>> +	help
>> +	  Implies the amount of SDRAM/DRAM Linux is going to claim/own.
>> +	  The actual memory itself could be larger than this number. But for
>> +	  all software purposes, this is the amt of memory.
>> +
>> +endmenu # "Platform Board Configuration"
> 
> Clock speed and memory size are things that the kernel should normally
> be able to find out itself, if not from the hardware then from looking
> at the device tree binary that gets passed from the boot loader, or
> some other boot protocol that is already established.


Sure - both will come from devicetree. LINUX_LINK_BASE however is a fundamental
constant, used in linker script for final layout so it will have to be a .config item.

> 
>> +if ARC_PLAT_FPGA_LEGACY
>> +
>> +choice
>> +	prompt "FPGA Board"
>> +
>> +config ARC_BOARD_ANGEL4
>> +	bool "ARC Angel4"
>> +	help
>> +	  ARC Angel4 FPGA Ref Platform (Xilinx Virtex Based)
>> +
>> +config ARC_BOARD_ML509
>> +	bool "ML509"
>> +	help
>> +	  ARC ML509 FPGA Ref Platform (Xilinx Virtex-5 Based)
>> +
>> +endchoice
> 
> Board files again should not be mutually exclusive.

OK ! Actually this hunk should not be present in initial upstream submission as
these only differ in a peripheral which is not yet submitted. This will be dropped.

> 
> 	Arnd
> 


  reply	other threads:[~2013-01-02 14:31 UTC|newest]

Thread overview: 107+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-07  9:47 [RFC Patch v1 00/31] Synopsys ARC Linux kernel Port Vineet Gupta
2012-11-07  9:47 ` [RFC PATCH v1 01/31] ARC: Generic Headers Vineet Gupta
2012-11-07  9:47 ` [RFC PATCH v1 02/31] ARC: irqflags Vineet Gupta
2012-11-12 19:50   ` Thomas Gleixner
2013-01-01  7:44     ` Vineet Gupta
2012-11-07  9:47 ` [RFC PATCH v1 03/31] ARC: atomic/bitops/cmpxchg/barriers Vineet Gupta
2012-11-07  9:47 ` [RFC PATCH v1 04/31] asm-generic headers: uaccess.h to conditionally define segment_eq() Vineet Gupta
2012-11-07  9:47 ` [RFC PATCH v1 05/31] ARC: uaccess friends Vineet Gupta
2012-11-07  9:47 ` [RFC PATCH v1 06/31] asm-generic headers: Allow yet more arch overrides in checksum.h Vineet Gupta
2012-11-07  9:47 ` [RFC PATCH v1 07/31] ARC: checksum/byteorder/swab routines Vineet Gupta
2012-11-07  9:47 ` [RFC PATCH v1 08/31] ARC: Fundamental ARCH data-types/defines Vineet Gupta
2012-11-08  7:10   ` Jonas Bonn
2012-11-08 18:52     ` Vineet Gupta
2012-11-08 20:36       ` Jonas Bonn
2012-11-12 13:58         ` Vineet Gupta
2012-11-12 14:12           ` Arnd Bergmann
2012-11-07  9:47 ` [RFC PATCH v1 09/31] ARC: spinlock/rwlock/mutex primitives Vineet Gupta
2012-11-07  9:47 ` [RFC PATCH v1 10/31] ARC: string library Vineet Gupta
2012-11-07  9:47 ` [RFC PATCH v1 11/31] ARC: Low level IRQ/Trap/Exception(non-MMU) Handling Vineet Gupta
2012-11-16  4:58   ` Al Viro
2012-12-27  9:00     ` Vineet Gupta
2012-12-27 13:29       ` Vineet Gupta
2012-11-07  9:47 ` [RFC PATCH v1 12/31] ARC: Interrupt Handling Vineet Gupta
2012-11-12 20:08   ` Thomas Gleixner
2013-01-01 10:46     ` Vineet Gupta
2012-11-07  9:47 ` [RFC PATCH v1 13/31] ARC: Non-MMU Exception Handling Vineet Gupta
2012-11-07  9:47 ` [RFC PATCH v1 14/31] ARC: syscall support Vineet Gupta
2012-11-07 14:21   ` Arnd Bergmann
2012-11-09  9:50     ` James Hogan
2012-11-13 11:41       ` James Hogan
2012-11-13 12:01         ` Jonas Bonn
2012-11-13 12:11           ` James Hogan
2012-11-14 12:23             ` Arnd Bergmann
2012-11-14 12:31               ` James Hogan
2012-11-13 10:13     ` Gilad Ben-Yossef
2012-11-13 10:37       ` Arnd Bergmann
2012-11-15  6:15         ` Vineet Gupta
2012-11-15 12:35           ` Arnd Bergmann
2013-01-17  5:13             ` Vineet Gupta
2012-11-07  9:47 ` [RFC PATCH v1 15/31] ARC: Process/scheduling/clock/Timers/Delay Management Vineet Gupta
2012-11-12 20:29   ` Thomas Gleixner
2013-01-02  7:13     ` Vineet Gupta
2013-01-02  8:45       ` Vineet Gupta
2013-01-04 13:01       ` Frederic Weisbecker
2012-11-07  9:47 ` [RFC PATCH v1 16/31] ARC: Signal handling Vineet Gupta
2012-11-16  5:26   ` Al Viro
2012-12-28 12:34     ` Vineet Gupta
2012-12-28 12:42       ` [PATCH 1/2] ARC: [Review] Preparing to fix incorrect syscall restarts due to signals Vineet Gupta
2012-12-28 12:42         ` [PATCH 2/2] ARC: [Review] Prevent incorrect syscall restarts Vineet Gupta
2012-11-07  9:47 ` [RFC PATCH v1 17/31] ARC: Cache Flush Management Vineet Gupta
2012-11-07  9:47 ` [RFC PATCH v1 18/31] ARC: Page Table Management Vineet Gupta
2012-11-07  9:47 ` [RFC PATCH v1 19/31] ARC: MMU Context Management Vineet Gupta
2012-11-07  9:47 ` [RFC PATCH v1 20/31] ARC: MMU Exception Handling Vineet Gupta
2012-11-07  9:47 ` [RFC PATCH v1 21/31] ARC: TLB flush Handling Vineet Gupta
2012-11-07  9:47 ` [RFC PATCH v1 22/31] ARC: Page Fault handling (incl uaccess fixup) Vineet Gupta
2012-11-07  9:47 ` [RFC PATCH v1 23/31] ARC: I/O and DMA Mappings Vineet Gupta
2012-11-07  9:47 ` [RFC PATCH v1 24/31] ARC: startup #1: low-level, setup_arch(), /proc/cpuinfo, mem init Vineet Gupta
2012-11-07  9:47 ` [RFC PATCH v1 25/31] ARC: [plat-arcfpga] Hooking up platform to ARC UART Vineet Gupta
2012-11-07 14:16   ` Arnd Bergmann
2013-01-07 13:10     ` Vineet Gupta
2013-01-07 13:46       ` Arnd Bergmann
2013-01-07 14:04         ` Vineet Gupta
2013-01-07 14:36           ` Arnd Bergmann
2013-01-14  7:35     ` early init dt for earlyprintk (was Re: [RFC PATCH v1 25/31] ARC: [plat-arcfpga] Hooking up platform to ARC UART) Vineet Gupta
2013-01-14  9:48       ` James Hogan
2013-01-14 10:09         ` Vineet Gupta
2013-01-14 10:54       ` Arnd Bergmann
2013-01-17  7:29     ` [RFC PATCH v1 25/31] ARC: [plat-arcfpga] Hooking up platform to ARC UART Vineet Gupta
2013-01-17 10:52       ` Arnd Bergmann
2012-11-07  9:47 ` [RFC PATCH v1 26/31] ARC: Build system: Makefiles, Kconfig, Linker script Vineet Gupta
2012-11-07 14:13   ` Arnd Bergmann
2013-01-02 14:30     ` Vineet Gupta [this message]
2013-01-02 14:48       ` Arnd Bergmann
2013-01-03  7:58         ` Vineet Gupta
2013-01-03  8:25           ` Arnd Bergmann
2013-03-11 12:29     ` SYSV IPC broken for no-legacy syscall kernels (was Re: [RFC PATCH v1 26/31] ARC: Build system: Makefiles, Kconfig, Linker script) Vineet Gupta
2013-03-11 12:44       ` James Hogan
2013-03-11 12:56         ` Vineet Gupta
2013-03-11 13:07           ` James Hogan
2013-03-11 13:30             ` Arnd Bergmann
2013-03-11 13:48               ` Vineet Gupta
2013-03-11 14:50                 ` Arnd Bergmann
2012-11-15 17:49   ` [RFC PATCH v1 26/31] ARC: Build system: Makefiles, Kconfig, Linker script James Hogan
2012-11-15 19:30     ` Ralf Baechle
2012-11-16  6:36       ` Vineet Gupta
2012-11-07  9:47 ` [RFC PATCH v1 27/31] ARC: Last bits (stubs) to get to a running kernel with UART Vineet Gupta
2012-11-07  9:47 ` [RFC PATCH v1 28/31] ARC: split ret_from_fork, simplify kernel_thread() Vineet Gupta
2012-11-07  9:47 ` [RFC PATCH v1 29/31] ARC: switch to generic kernel_thread() Vineet Gupta
2012-11-07  9:47 ` [RFC PATCH v1 30/31] ARC: switch to generic kernel_execve() and sys_execve() Vineet Gupta
2012-11-16  4:08   ` Al Viro
2012-11-17 14:01     ` Vineet Gupta
2012-11-07  9:47 ` [RFC PATCH v1 31/31] ARC: [plat-arcfpga] defconfig Vineet Gupta
2012-11-07 14:06   ` Arnd Bergmann
2012-11-12 14:18     ` James Hogan
2012-11-12 14:21       ` Arnd Bergmann
2012-11-07 14:36 ` [RFC Patch v1 00/31] Synopsys ARC Linux kernel Port Arnd Bergmann
2012-11-08 19:09   ` Vineet Gupta
2012-11-07 20:46 ` Gilad Ben-Yossef
2012-11-20 13:47 ` Pavel Machek
2012-11-20 13:49   ` Vineet Gupta
2012-11-20 13:59   ` Pavel Machek
2012-11-20 14:17     ` Vineet Gupta
2013-01-18 19:46       ` Pavel Machek
2013-01-18 22:17         ` Arnd Bergmann
2013-01-19 10:15           ` Pavel Machek
2013-01-19 12:32         ` Vineet Gupta
2013-01-19 17:02           ` Pavel Machek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50E4449A.7010606@synopsys.com \
    --to=vineet.gupta1@synopsys.com \
    --cc=arnd@arndb.de \
    --cc=giladb@ezchip.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=noamc@ezchip.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).