All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Hogan <james.hogan@imgtec.com>
To: Sam Ravnborg <sam@ravnborg.org>
Cc: linux-arch@vger.kernel.org
Subject: Re: [RFC PATCH v1 12/40] metag: Build infrastructure
Date: Wed, 31 Oct 2012 21:34:34 +0000	[thread overview]
Message-ID: <5091996A.2030401@imgtec.com> (raw)
In-Reply-To: <20121031193503.GA4640@merkur.ravnborg.org>

Hi Sam,

Thanks for taking a look.

On 31/10/12 19:35, Sam Ravnborg wrote:
> 1) This patch should be the last one - as this enables build of this architecture.

Okay, makes sense

> 2) this patch should not contain changes to files outside metag

Okay, I'll split those changes into a separate patch

> 3) there seems to be confusion if the shorthand is meta or metag.
>    Please fix it up so metag is used everywhere.
> 
> 	Sam
> 
>> +config METAG
>> +	def_bool y
>> +	select EMBEDDED
>> +	select HAVE_64BIT_ALIGNED_STRUCT
>> +	select HAVE_MEMBLOCK
>> +	select HAVE_MEMBLOCK_NODE_MAP
>> +	select HAVE_ARCH_TRACEHOOK
>> +	select HAVE_IRQ_WORK
>> +	select HAVE_KERNEL_GZIP
>> +	select HAVE_KERNEL_BZIP2
>> +	select HAVE_KERNEL_LZMA
>> +	select HAVE_KERNEL_XZ
>> +	select HAVE_KERNEL_LZO
>> +	select HAVE_SYSCALL_TRACEPOINTS
>> +	select HAVE_GENERIC_HARDIRQS
>> +	select GENERIC_ATOMIC64
>> +	select GENERIC_CLOCKEVENTS
>> +	select GENERIC_IRQ_SHOW
>> +	select GENERIC_SMP_IDLE_THREAD
>> +	select IRQ_DOMAIN
>> +	select OF
>> +	select OF_EARLY_FLATTREE
> Sorting these in alphabetic order avoid merge issues later.

Good idea

> 
>> +	help
>> +	  Imagination Technologies Meta processors are a family of multi-
>> +	  threaded DSPs designed for embedded systems.
> This help entry is not visible in KConfig - just add it as a comment above the config symbol.

Okay

> 
>> +config IRQ_PER_CPU
>> +	def_bool y
> This looks obsolete / unused in mainline kernel.

True. It appears to have been removed by
6a58fb3bad099076f36f0f30f44507bc3275cdb6 but not from any of the
architectures that selected it. I'll add that to the list.

>> +config HOTPLUG_CPU
>> +	bool "Enable CPU hotplug support"
>> +	depends on SMP && HOTPLUG
> Today HOTPLUG is always y so the HOTPLUG dependency is not needed.

Okay

>> +config HIGHMEM
>> +	bool "High Memory Support"
>> +	depends on MMU
> 
> MMU is always y as per above - so the MMU dependeny is not neeeded.

Okay

>> +config META12
>> +	bool
>> +	---help---
>> +	  Select this from the SoC config symbol to indicate that it contains a
>> +	  Meta 1.2 core.
> It would be good to have all METAG (or is it META) symbol perfixed with
> the same text. Such as METAG_META12 etc.
> General comment!

Yep, makes sense.

>> +config META21
>> +	bool
>> +	---help---
>> +	  Select this from the SoC config symbol to indicate that it contains a
>> +	  Meta 2.1 core.
> Today we have larely moved away from ---help--- and uses the shorter help
> ---help--- has 2290 hits
> help       has 7841 hits

Okay, I think I remember doing the same grep and not really being sure
which to unify towards.

>> +menu "Boot options"
> 
> 
> Can we use the common config symbols here?
> CMDLINE, CMDLINE_OVERWRITE, CMDLINE_BOOL etc.

This was intentional, as they're used in drivers/of/fdt.c, which
interferes a bit with allowing appending of a builtin command line. I'm
happy to make it more uniform with other arches though.

>> +menu "Board support"
>> +
>> +endmenu
> No point having an empty menu!?

Oops, I'll remove until we submit something to put in it.

>> +LDFLAGS		:=
>> +OBJCOPYFLAGS	:= -O binary -R .note -R .comment -S
>> +
>> +CHECKFLAGS-$(CONFIG_META12) += -DMETAC_1_2
>> +CHECKFLAGS-$(CONFIG_META21) += -DMETAC_2_1
> 
> As a rule of thumb UPPERCASE is for exported stuff.
> lower-case for local variables.
> 
> I would do it like this:
> checkflags-$(CONFIG_META12) := -DMETAC_1_2
> checkflags-$(CONFIG_META21) := -DMETAC_2_1
> CHECKFLAGS   += -D__metag__ $(checkflags-y)

Okay, thanks. I'll give all our stuff a scan over to check for this kind
of thing.

>> +core-y					+= arch/metag/kernel/ \
>> +					   arch/metag/mm/
> 
> The abuse of \ in makefile in bad practice IMO.
> The following is much more readable:
> 
> core-y += arch/metag/kernel/
> core-y += arch/metag/mm/
> 
> Please fix this in all Makefile - if I can convince you.

Agreed (it definitely makes merges etc easier)

> 
>> +
>> +ifneq ($(score-y),)
>> +core-y                                  += arch/metag/$(score-y)/
>> +endif
> 
> How can score-y ever be non-empty?

Individual SoCs would set that. I'll remove it until SoC support is
submitted.

> 
>> +
>> +ifneq ($(machdir-y),)
>> +core-y  += $(addprefix arch/metag/boards/, \
>> +             $(filter-out ., $(patsubst %,%/,$(machdir-y))))
>> +endif
> 
> 
> Or like this:
> machdirs := $(filter-out ., $(patsubst %,%/,$(machdir-y)))
> core-y += $(addprefix arch/metag/boards/, $(machdirs))
> 
> I see no need to test if machdir-y is non-empty.

Agreed.


>> +$(obj)/vmlinux.bin: $(VMLINUX)
>> +	$(Q)$(OBJCOPY) -O binary $(strip-flags) $(VMLINUX) $(obj)/vmlinux.bin
> 
> Can you use:
> OBJCOPYFLAGS_vmlinux.bin := $(strip-flags)
> $(obj)/vmlinux.bin: $(VMLINUX)
> 	$(call if_changed,objcopy)
> 
> It will use the definition of OBJCOPYFLAGS from arch/metag/Makefile

Neat, thanks

> where does strip-flags come from?

Nowhere apparently. I suspect it was copied from mips. I'll remove it.

>> +export suffix-y
> lower-case is not exported.
> And why this export anyway?

I think this was derived from sh, but that seems to use it in
arch/sh/boot/compressed/Makefile which we don't have, so I'll remove the
export.

>> diff --git a/arch/metag/kernel/Makefile b/arch/metag/kernel/Makefile
>> new file mode 100644
>> index 0000000..0391546
>> --- /dev/null
>> +++ b/arch/metag/kernel/Makefile
>> @@ -0,0 +1,37 @@

> No use of "\" - good!

:-) the "\"'s were bugging me here when splitting up the patches

>> +/* ld script to make Meta Linux kernel */

>> +  _text = .;
> I doubt this symbol is used anywhere - as meta adds '_'.

It appears to be used by .tmp_kallsyms1.o

>> +  __text = .;
>> +  __stext = .;
>> +  HEAD_TEXT_SECTION
>> +  .text : {
>> +	TEXT_TEXT
>> +	SCHED_TEXT
>> +	LOCK_TEXT
>> +	KPROBES_TEXT
>> +	IRQENTRY_TEXT
>> +	*(.text.*)
>> +	*(.gnu.warning)
>> +	}
>> +
>> +  __etext = .;			/* End of text section */
>> +
>> +  __sdata = .;
>> +  RO_DATA_SECTION(PAGE_SIZE)
>> +  RW_DATA_SECTION(L1_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE)
>> +  __edata = .;			/* End of data section */
>> +
>> +  EXCEPTION_TABLE(16)
> Do you have a more descriptive constant than 16?
> What does 16 imply here?

A bunch of other architectures also set this alignment. A couple though
use a cache line size definition, suggesting it's for cache efficiency.
If so we should probably set it to 64 (metag's cache line size).

> 
> 
>> +  NOTES
>> +
>> +  . = ALIGN(PAGE_SIZE);		/* Init code and data */
>> +  ___init_begin = .;
>> +  INIT_TEXT_SECTION(PAGE_SIZE)
>> +  INIT_DATA_SECTION(16)
> 
> Same here - what does 16 imply here?

Almost every other architecture also sets this alignment to 16 (except
frv=8, hexagon=pagesize).

Thanks for all the comments,

Cheers
James

  reply	other threads:[~2012-10-31 21:34 UTC|newest]

Thread overview: 116+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-31 16:13 [RFC PATCH v1 00/40] Meta Linux Kernel Port James Hogan
2012-10-31 16:13 ` [RFC PATCH v1 01/40] asm-generic/io.h: remove asm/cacheflush.h include James Hogan
2012-10-31 16:13 ` [RFC PATCH v1 02/40] asm-generic/unistd.h: handle symbol prefixes in cond_syscall James Hogan
2012-10-31 16:13 ` [RFC PATCH v1 03/40] Add CONFIG_HAVE_64BIT_ALIGNED_STRUCT for taskstats James Hogan
2012-10-31 16:13 ` [RFC PATCH v1 04/40] trace/ring_buffer: handle 64bit aligned structs James Hogan
2012-10-31 17:59   ` Steven Rostedt
2012-10-31 18:19     ` James Hogan
2012-11-01 17:32     ` Will Newton
2012-11-01 19:30       ` Steven Rostedt
2012-10-31 16:13 ` [RFC PATCH v1 05/40] Revert some of "binfmt_elf: cleanups" James Hogan
2012-10-31 16:13   ` James Hogan
2012-11-01 13:25   ` Mikael Pettersson
2012-11-01 13:25     ` Mikael Pettersson
2012-11-01 13:52     ` James Hogan
2012-11-01 13:52       ` James Hogan
2012-10-31 16:13 ` [RFC PATCH v1 06/40] of/vendor-prefixes: add Imagination Technologies James Hogan
2012-11-01  1:38   ` Rob Herring
2012-11-01  9:20     ` James Hogan
2012-10-31 16:13 ` [RFC PATCH v1 07/40] metag: Add MAINTAINERS entry James Hogan
2012-10-31 16:13 ` [RFC PATCH v1 08/40] metag: Boot James Hogan
2012-10-31 16:13 ` [RFC PATCH v1 11/40] metag: Signal handling James Hogan
2012-10-31 16:13 ` [RFC PATCH v1 12/40] metag: Build infrastructure James Hogan
2012-10-31 19:35   ` Sam Ravnborg
2012-10-31 21:34     ` James Hogan [this message]
2012-11-02  9:40     ` James Hogan
2012-11-02 17:01       ` Sam Ravnborg
2012-11-09 14:46   ` Arnd Bergmann
2012-11-09 14:55     ` James Hogan
2012-11-20 15:06     ` James Hogan
2012-11-20 15:43       ` Arnd Bergmann
2012-11-20 16:01         ` James Hogan
2012-10-31 16:13 ` [RFC PATCH v1 13/40] metag: Device tree James Hogan
2012-10-31 16:13 ` [RFC PATCH v1 14/40] metag: Ptrace James Hogan
2012-11-08  7:17   ` Jonas Bonn
2012-11-09  9:26     ` James Hogan
2012-10-31 16:13 ` [RFC PATCH v1 15/40] metag: Time keeping James Hogan
2012-10-31 16:13 ` [RFC PATCH v1 16/40] metag: Traps James Hogan
2012-10-31 16:13 ` [RFC PATCH v1 17/40] metag: IRQ handling James Hogan
2012-11-09 14:12   ` Arnd Bergmann
2012-11-20 16:08     ` James Hogan
2012-11-20 16:15       ` Arnd Bergmann
2012-12-18 13:25         ` James Hogan
2012-12-19 15:58           ` Arnd Bergmann
2012-12-20 10:14             ` James Hogan
2012-10-31 16:13 ` [RFC PATCH v1 18/40] metag: System Calls James Hogan
2012-11-09 14:20   ` Arnd Bergmann
2012-11-22 12:01     ` James Hogan
2012-10-31 16:14 ` [RFC PATCH v1 19/40] metag: Scheduling/Process management James Hogan
2012-10-31 16:14 ` [RFC PATCH v1 20/40] metag: Module support James Hogan
2012-10-31 16:14 ` [RFC PATCH v1 21/40] metag: Atomics, locks and bitops James Hogan
2012-10-31 16:14 ` [RFC PATCH v1 22/40] metag: Basic documentation James Hogan
2012-10-31 16:14 ` [RFC PATCH v1 23/40] metag: SMP support James Hogan
2012-10-31 16:14 ` [RFC PATCH v1 24/40] metag: DMA James Hogan
2012-11-09 14:25   ` Arnd Bergmann
2012-11-23 15:53     ` James Hogan
2012-11-23 16:20       ` James Hogan
2012-11-23 16:20         ` James Hogan
2012-11-23 16:47         ` Arnd Bergmann
2013-01-09 16:04           ` James Hogan
2013-01-09 16:04             ` James Hogan
2013-01-09 16:08             ` Arnd Bergmann
2012-11-23 16:47       ` Arnd Bergmann
2012-10-31 16:14 ` [RFC PATCH v1 25/40] metag: optimised library functions James Hogan
2012-10-31 16:14 ` [RFC PATCH v1 26/40] metag: Stack unwinding James Hogan
2012-10-31 16:14 ` [RFC PATCH v1 27/40] metag: various other headers James Hogan
2012-10-31 16:14 ` [RFC PATCH v1 28/40] metag: Perf James Hogan
2012-10-31 16:14 ` [RFC PATCH v1 29/40] metag: ftrace support James Hogan
2012-10-31 16:14 ` [RFC PATCH v1 30/40] scripts/checkstack.pl: Add metag support James Hogan
2012-10-31 16:14 ` [RFC PATCH v1 31/40] char: don't build rtc or genrtc on METAG James Hogan
2012-11-01 15:39   ` Greg KH
2012-11-01 17:33     ` James Hogan
2012-11-09 14:38       ` Arnd Bergmann
2012-10-31 16:14 ` [RFC PATCH v1 32/40] i8042: don't build " James Hogan
2012-11-09 14:28   ` Arnd Bergmann
2012-11-16 11:06     ` James Hogan
2012-11-16 15:20       ` Arnd Bergmann
2012-11-16 16:19         ` Geert Uytterhoeven
2012-11-16 16:43           ` Arnd Bergmann
2012-11-16 16:50         ` James Hogan
2012-11-16 17:20           ` Arnd Bergmann
2012-10-31 16:14 ` [RFC PATCH v1 33/40] parport: " James Hogan
2012-10-31 16:14 ` [RFC PATCH v1 34/40] musb: don't redefine {read,write}s{l,w,b} on metag James Hogan
2012-10-31 16:14 ` [RFC PATCH v1 35/40] vga console: don't build on METAG James Hogan
2012-10-31 16:14 ` [RFC PATCH v1 36/40] metag: OProfile James Hogan
2012-10-31 16:14 ` [RFC PATCH v1 37/40] metag: Various sysfs drivers James Hogan
2012-10-31 19:30   ` Greg KH
2012-10-31 19:41     ` James Hogan
2012-11-09 14:32       ` Arnd Bergmann
2012-11-09 14:35         ` James Hogan
2012-10-31 16:14 ` [RFC PATCH v1 38/40] metag: add JTAG Debug Adapter (DA) support James Hogan
2012-10-31 16:14 ` [RFC PATCH v1 39/40] tty/metag_da: add metag DA TTY driver James Hogan
2012-10-31 16:14 ` [RFC PATCH v1 40/40] fs: dafs: Add DAFS filesystem for metag James Hogan
2012-10-31 16:14   ` James Hogan
2012-10-31 16:42   ` Al Viro
2012-10-31 19:39     ` James Hogan
2012-10-31 19:39       ` James Hogan
2012-10-31 19:55   ` Myklebust, Trond
2012-10-31 21:39     ` James Hogan
2012-11-02  9:33     ` James Hogan
2012-10-31 16:26 ` [RFC PATCH v1 00/40] Meta Linux Kernel Port James Hogan
2012-11-09 15:06   ` Arnd Bergmann
2012-11-09 15:21     ` James Hogan
2012-11-09 15:58       ` Arnd Bergmann
2012-11-09 16:20         ` James Hogan
2012-11-09 21:55           ` Arnd Bergmann
2012-11-09 23:28             ` James Hogan
2012-11-12 16:59           ` James Hogan
2012-11-12 19:10             ` Arnd Bergmann
2012-11-13  9:43               ` James Hogan
2012-11-13  9:55                 ` Arnd Bergmann
2012-10-31 22:33 ` Tony Breeds
2012-11-01 11:42   ` James Hogan
2012-11-01 23:28     ` Tony Breeds
2012-11-09 16:52     ` James Hogan
2012-11-09 15:16 ` Arnd Bergmann
2012-11-09 16:06   ` James Hogan

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=5091996A.2030401@imgtec.com \
    --to=james.hogan@imgtec.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=sam@ravnborg.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.