From: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [RFC PATCH] Kbuild: introduce Makefile in arch/$ARCH/
Date: Fri, 21 Nov 2014 22:06:21 +0100 [thread overview]
Message-ID: <546FA94D.3010306@gmail.com> (raw)
In-Reply-To: <20141121124816.2F60.AA925319@jp.panasonic.com>
Hi Masahiro,
On 21.11.2014 04:48, Masahiro Yamada wrote:
> Hi Daniel,
>
>
> On Wed, 19 Nov 2014 21:12:14 +0100
> Daniel Schwierzeck <daniel.schwierzeck@gmail.com> wrote:
>
>> Introduce a Makefile under arch/$ARCH/ and include it in the
>> top Makefile (similar to Linux kernel). This allows further
>> refactoringi like moving architecture-specific code out of global
>> makefiles, deprecating config variables (CPU, CPUDIR, SOC) or
>> deprecating arch/$ARCH/config.mk.
>>
>> In contrary to Linux kernel, U-Boot defines the ARCH variable by
>> Kconfig, thus the arch Makefile can only included conditionally
>> after the top config.mk.
>>
>> Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
>
>
> I guess this patch is the one you mentioned on the way to the station
> after the u-boot mini summit.
yes
>
> I think basically this is a good step forward
> although we need more efforts if we want to deprecate
> arch/$ARCH/cpu/$CPU/config.mk, board/$BOARD/config.mk as well.
>
>
> Some comments below.
>
> I will probably ack it if you send v2.
>
>
>
>
>
>> This patch should not cause any functional changes. It is compile-tested
>> on sandbox, aarch64, arm, mips, powerpc and x86.
>
> This patch looks good for the other architecture, too.
>
>
>
>> diff --git a/Makefile b/Makefile
>> index 590fec8..a2783ca 100644
>> --- a/Makefile
>> +++ b/Makefile
>> @@ -359,7 +359,7 @@ UBOOTRELEASE = $(shell cat include/config/uboot.release 2> /dev/null)
>> UBOOTVERSION = $(VERSION)$(if $(PATCHLEVEL),.$(PATCHLEVEL)$(if $(SUBLEVEL),.$(SUBLEVEL)))$(EXTRAVERSION)
>>
>> export VERSION PATCHLEVEL SUBLEVEL UBOOTRELEASE UBOOTVERSION
>> -export ARCH CPU BOARD VENDOR SOC CPUDIR BOARDDIR
>> +export ARCH CPU BOARD VENDOR SOC CPUDIR BOARDDIR SPL_START_S_PATH
>> export CONFIG_SHELL HOSTCC HOSTCFLAGS HOSTLDFLAGS CROSS_COMPILE AS LD CC
>> export CPP AR NM LDR STRIP OBJCOPY OBJDUMP
>> export MAKE AWK PERL PYTHON
>
>
> Why do you need to export SPL_START_S_PATH?
> It is unnecessary, I think.
>
boards form ARM and PowerPC defined CONFIG_SPL_START_S_PATH so I moved
it to config.mk and made it consistent with the other variables. But if
only some ARM boards really use it, it is unnecessary.
>
>
>
>> index 0000000..117ed30
>> --- /dev/null
>> +++ b/arch/arm/Makefile
>> @@ -0,0 +1,29 @@
>> +#
>> +# SPDX-License-Identifier: GPL-2.0+
>> +#
>> +
>> +head-y := arch/arm/cpu/$(CPU)/start.o
>> +
>> +ifeq ($(CONFIG_SPL_BUILD),y)
>> +ifneq ($(SPL_START_S_PATH),)
>> +head-y := $(SPL_START_S_PATH)/start.o
>> +endif
>> +endif
>
>
> Because only some ARM boards are using CONFIG_SPL_START_S_PATH,
> perhaps we can directly handle it in arch/arm/Makefile and remove it from config.mk
>
> ifeq ($(CONFIG_SPL_BUILD),y)
> ifneq ($(CONFIG_SPL_START_S_PATH),)
> head-y := $(CONFIG_SPL_START_S_PATH:"%"=%)/start.o
> endif
> endif
>
>
>
>
>> diff --git a/config.mk b/config.mk
>> index 64c2951..b957c1d 100644
>> --- a/config.mk
>> +++ b/config.mk
>> @@ -31,6 +31,9 @@ endif
>> ifneq ($(CONFIG_SYS_SOC),)
>> SOC := $(CONFIG_SYS_SOC:"%"=%)
>> endif
>> +ifneq ($(CONFIG_SPL_START_S_PATH),)
>> +SPL_START_S_PATH := $(CONFIG_SPL_START_S_PATH:"%"=%)
>> +endif
>
>
> Can we remove this?
Yes, I will move it to arch/arm/Makefile
--
- Daniel
next prev parent reply other threads:[~2014-11-21 21:06 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-19 20:12 [U-Boot] [RFC PATCH] Kbuild: introduce Makefile in arch/$ARCH/ Daniel Schwierzeck
2014-11-21 3:48 ` Masahiro Yamada
2014-11-21 21:06 ` Daniel Schwierzeck [this message]
2014-11-21 22:51 ` [U-Boot] [PATCH v2] " Daniel Schwierzeck
2014-11-25 3:51 ` Masahiro Yamada
2014-12-08 21:43 ` [U-Boot] [U-Boot,v2] " Tom Rini
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=546FA94D.3010306@gmail.com \
--to=daniel.schwierzeck@gmail.com \
--cc=u-boot@lists.denx.de \
/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.