Re: [U-Boot] [PATCH] sf:eon: Add support for EN25S64

2013-09-07 Thread Jagan Teki
Hi,

On Thu, Sep 5, 2013 at 12:49 PM, Priyanka Jain
priyanka.j...@freescale.com wrote:
 Add support for EON EN25S64 SPI flash memory
 Features: 64Mb size, 1.8V, 4KB sector

 Signed-off-by: Priyanka Jain priyanka.j...@freescale.com
 ---
  drivers/mtd/spi/eon.c |5 +
  1 files changed, 5 insertions(+), 0 deletions(-)

 diff --git a/drivers/mtd/spi/eon.c b/drivers/mtd/spi/eon.c
 index 25cfc12..45a0052 100644
 --- a/drivers/mtd/spi/eon.c
 +++ b/drivers/mtd/spi/eon.c
 @@ -27,6 +27,11 @@ static const struct eon_spi_flash_params 
 eon_spi_flash_table[] = {
 .nr_sectors = 4096,
 .name = EN25Q128,
 },
 +   {
 +   .idcode1 = 0x3817,
 +   .nr_sectors = 4096,
 +   .name = EN25S64,
 +   },
  };

  struct spi_flash *spi_flash_probe_eon(struct spi_slave *spi, u8 *idcode)
 --
 1.7.4.1

Thanks for you patch.
Can you test your hw with this branch
http://git.denx.de/?p=u-boot/u-boot-spi.git;a=shortlog;h=refs/heads/master-test

Sooner this will merge into master, new updated sf layer.
Let me know for any issues.

-- 
Thanks,
Jagan.

Jagannadha Sutradharudu Teki,
E: jagannadh.t...@gmail.com, P: +91-9676773388
Engineer - System software hacker
U-boot - SPI Custodian and Zynq APSOC
Android - BSP/Kernel
Ln: http://www.linkedin.com/in/jaganteki
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] mxc_i2c: add new i2c subsystem support

2013-09-07 Thread Philippe Reynes
Hi Heiko,

The mxc_i2c driver use the legacy framework. I plan to
move this driver to new i2c subsystem (CONFIG_SYS_I2C).
Is someone already working on this task ?

If no, I propose to only add new i2c subsystem (and not
remove old i2c framework). We could remove the mxc i2c
legacy support when all the board using this driver will
be updated. What do you think about it ?

Regards,
Philippe___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] ppc4xx: Fix GPIO handling in lwmon5 and lcd4_lwmon5 BSP

2013-09-07 Thread Stefan Roese
On 27.08.2013 13:48, Stefan Roese wrote:
 LCD4 needs a slightly different GPIO configuration than the
 original LWMON5 variant. GPIO49 needs to be configured to a
 default output value of 0 (permanent voltage supply).
 
 Additionally lcd4 also needs to enable the LSB transmitter.

Applied to u-boot-ppc4xx/master.

Thanks,
Stefan

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] Please pull u-boot-ppc4xx/master

2013-09-07 Thread Stefan Roese
Hi Tom,

please pull the following fix:

The following changes since commit 1affd4d4a3fe512050e1ad1636d9360c670da531:

  cam_enc_4xx: Move CONFIG_SPL_PAD_TO to a config header (2013-09-06 13:09:08 
-0400)

are available in the git repository at:

  git://www.denx.de/git/u-boot-ppc4xx.git master

for you to fetch changes up to 9055f66c2dfb637d0f30372a7e79cca854e45bae:

  ppc4xx: Fix GPIO handling in lwmon5 and lcd4_lwmon5 BSP (2013-09-07 09:48:06 
+0200)


Stefan Roese (1):
  ppc4xx: Fix GPIO handling in lwmon5 and lcd4_lwmon5 BSP

 board/lwmon5/lwmon5.c|  3 +++
 include/configs/lwmon5.h | 10 +-
 2 files changed, 12 insertions(+), 1 deletion(-)


Thanks,
Stefan
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] ARM: refactor compiler options in config.mk

2013-09-07 Thread Masahiro Yamada
Every ARM cpu config.mk (arch/arm/cpu/{CPUDIR}/config.mk) defines:

PLATFORM_RELFLAGS += -fno-common -ffixed-r8 -msoft-float

So, this patch moves the common compiler options to arch/arm/config.mk.

Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---

Note:
This commit keeps arch/arm/cpu/s3c44b0/config.mk untouched.
because arch/arm/cpu/s3c44b0/* is the remainder of dead board
and is expected to deleted soon.
See 'ARM: s3c44b0: remove remainders of dead board' patch
posted by me, Aug 19, 2013.


 arch/arm/config.mk   |3 ++-
 arch/arm/cpu/arm1136/config.mk   |1 -
 arch/arm/cpu/arm1176/config.mk   |1 -
 arch/arm/cpu/arm720t/config.mk   |2 --
 arch/arm/cpu/arm920t/config.mk   |2 --
 arch/arm/cpu/arm925t/config.mk   |2 --
 arch/arm/cpu/arm926ejs/config.mk |2 --
 arch/arm/cpu/arm946es/config.mk  |2 --
 arch/arm/cpu/arm_intcm/config.mk |2 --
 arch/arm/cpu/armv7/config.mk |1 -
 arch/arm/cpu/armv7/rmobile/config.mk |1 -
 arch/arm/cpu/ixp/config.mk   |2 +-
 arch/arm/cpu/pxa/config.mk   |2 --
 arch/arm/cpu/sa1100/config.mk|2 --
 14 files changed, 3 insertions(+), 22 deletions(-)

diff --git a/arch/arm/config.mk b/arch/arm/config.mk
index 540a119..a2f3261 100644
--- a/arch/arm/config.mk
+++ b/arch/arm/config.mk
@@ -16,7 +16,8 @@ endif
 endif
 
 LDFLAGS_FINAL += --gc-sections
-PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections
+PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections \
+ -fno-common -ffixed-r8 -msoft-float
 
 # Support generic board on ARM
 __HAVE_ARCH_GENERIC_BOARD := y
diff --git a/arch/arm/cpu/arm1136/config.mk b/arch/arm/cpu/arm1136/config.mk
index 1ef6061..b4d396d 100644
--- a/arch/arm/cpu/arm1136/config.mk
+++ b/arch/arm/cpu/arm1136/config.mk
@@ -4,7 +4,6 @@
 #
 # SPDX-License-Identifier: GPL-2.0+
 #
-PLATFORM_RELFLAGS += -fno-common -ffixed-r8 -msoft-float
 
 # Make ARMv5 to allow more compilers to work, even though its v6.
 PLATFORM_CPPFLAGS += -march=armv5
diff --git a/arch/arm/cpu/arm1176/config.mk b/arch/arm/cpu/arm1176/config.mk
index 917da03..f4631cb 100644
--- a/arch/arm/cpu/arm1176/config.mk
+++ b/arch/arm/cpu/arm1176/config.mk
@@ -4,7 +4,6 @@
 #
 # SPDX-License-Identifier: GPL-2.0+
 #
-PLATFORM_RELFLAGS += -fno-common -ffixed-r8 -msoft-float
 
 # Make ARMv5 to allow more compilers to work, even though its v6.
 PLATFORM_CPPFLAGS += -march=armv5t
diff --git a/arch/arm/cpu/arm720t/config.mk b/arch/arm/cpu/arm720t/config.mk
index 56b6280..2581f0a 100644
--- a/arch/arm/cpu/arm720t/config.mk
+++ b/arch/arm/cpu/arm720t/config.mk
@@ -6,8 +6,6 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-PLATFORM_RELFLAGS +=  -fno-common -ffixed-r8 -msoft-float
-
 PLATFORM_CPPFLAGS += -march=armv4 -mtune=arm7tdmi
 # =
 #
diff --git a/arch/arm/cpu/arm920t/config.mk b/arch/arm/cpu/arm920t/config.mk
index 58fd756..67537dc 100644
--- a/arch/arm/cpu/arm920t/config.mk
+++ b/arch/arm/cpu/arm920t/config.mk
@@ -5,8 +5,6 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-PLATFORM_RELFLAGS += -fno-common -ffixed-r8 -msoft-float
-
 PLATFORM_CPPFLAGS += -march=armv4
 # =
 #
diff --git a/arch/arm/cpu/arm925t/config.mk b/arch/arm/cpu/arm925t/config.mk
index 58fd756..67537dc 100644
--- a/arch/arm/cpu/arm925t/config.mk
+++ b/arch/arm/cpu/arm925t/config.mk
@@ -5,8 +5,6 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-PLATFORM_RELFLAGS += -fno-common -ffixed-r8 -msoft-float
-
 PLATFORM_CPPFLAGS += -march=armv4
 # =
 #
diff --git a/arch/arm/cpu/arm926ejs/config.mk b/arch/arm/cpu/arm926ejs/config.mk
index 917ff7e..12b0d09 100644
--- a/arch/arm/cpu/arm926ejs/config.mk
+++ b/arch/arm/cpu/arm926ejs/config.mk
@@ -5,8 +5,6 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-PLATFORM_RELFLAGS += -fno-common -ffixed-r8 -msoft-float
-
 PLATFORM_CPPFLAGS += -march=armv5te
 # =
 #
diff --git a/arch/arm/cpu/arm946es/config.mk b/arch/arm/cpu/arm946es/config.mk
index 1e41c11..eb81a57 100644
--- a/arch/arm/cpu/arm946es/config.mk
+++ b/arch/arm/cpu/arm946es/config.mk
@@ -5,8 +5,6 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-PLATFORM_RELFLAGS += -fno-common -ffixed-r8 -msoft-float
-
 PLATFORM_CPPFLAGS +=  -march=armv4
 # =
 #
diff --git a/arch/arm/cpu/arm_intcm/config.mk b/arch/arm/cpu/arm_intcm/config.mk
index 1e41c11..eb81a57 100644
--- a/arch/arm/cpu/arm_intcm/config.mk
+++ b/arch/arm/cpu/arm_intcm/config.mk
@@ -5,8 +5,6 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-PLATFORM_RELFLAGS += -fno-common -ffixed-r8 -msoft-float
-
 PLATFORM_CPPFLAGS +=  -march=armv4
 # 

Re: [U-Boot] [PATCH v2 0/4] MTD UBI fixes

2013-09-07 Thread Stefan Roese
On 04.09.2013 16:16, Paul Burton wrote:
 This patchset corrects a few issues I've had whilst using UBI with U-boot.
 
 The first 3 are bug fixes, the 4th is an addition I needed in order to write a
 large root filesystem into my NAND device.
 
 Changes since v1:
   - Fixed style issues in cmd_ubi: add write.part command... as per
 Stefan Roese's comments.
   - Expanded upon the condition patch 1 fixes in response to the
 queries from Stefan, see the commit message for further detail.
   - Added patch 3 cmd_ubi: use int64_t volume size for 'ubi create'
 which it seems appropriate to include in this series.
 
 Paul Burton (4):
   mtd: driver _read() returns max_bitflips; mtd_read() returns -EUCLEAN
   cmd_mtdparts: use 64 bits for flash size, partition size  offset
   cmd_ubi: use int64_t volume size for 'ubi create'
   cmd_ubi: add write.part command, to write a volume in multiple parts

All 4 patches:

Acked-by: Stefan Roese s...@denx.de

Scott, these patches are assigned to you in patchwork. If you are okay
with the NAND side (and everything else), then please feel free to push
all 4 patches via your repository.

Thanks,
Stefan

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v5 1/4] core support of arm64

2013-09-07 Thread FengHua

Fisrt, thank scott for checking the patch.

 -原始邮件-
 发件人: Scott Wood scottw...@freescale.com
 发送时间: 2013年9月7日 星期六
 收件人: feng...@phytium.com.cn
 抄送: u-boot@lists.denx.de, tr...@ti.com
 主题: Re: [U-Boot] [PATCH v5 1/4] core support of arm64
 
 On Sat, 2013-08-24 at 09:06 +0800, feng...@phytium.com.cn wrote:
  From: David Feng feng...@phytium.com.cn
  
  Signed-off-by: David Feng feng...@phytium.com.cn
  ---
  Changeds for v4:
- Replace __ARMEB__ with __AARCH64EB__ in byteorder.h and unaligned.h,
  gcc for aarch64 use __AARCH64EB__ and __AARCH64EL__ to identify endian.
- Some modification to README.armv8
  
   arch/arm/config.mk  |4 +
   arch/arm/cpu/armv8/Makefile |   56 ++
   arch/arm/cpu/armv8/cache.S  |  145 +++
   arch/arm/cpu/armv8/cache_v8.c   |  291 
  +++
   arch/arm/cpu/armv8/config.mk|   31 
   arch/arm/cpu/armv8/cpu.c|   68 
   arch/arm/cpu/armv8/crt0.S   |  130 ++
   arch/arm/cpu/armv8/exceptions.S |  182 +++
   arch/arm/cpu/armv8/interrupts.c |  116 
   arch/arm/cpu/armv8/relocate.S   |   71 
   arch/arm/cpu/armv8/start.S  |  200 +
   arch/arm/cpu/armv8/timer.c  |   95 ++
   arch/arm/cpu/armv8/tlb.S|   38 
   arch/arm/cpu/armv8/u-boot.lds   |   83 +
 
 Subject says arm64, files say armv8.
 
 Some of these, such as relocate.S, probably are not going to be
 armv8-specific but just arm64-specific.
 
   arch/arm/include/asm/arch-armv8/armv8.h |   44 +
   arch/arm/include/asm/arch-armv8/gpio.h  |   26 +++
   arch/arm/include/asm/arch-armv8/mmu.h   |  117 +
   arch/arm/include/asm/byteorder.h|   12 ++
   arch/arm/include/asm/config.h   |   10 ++
   arch/arm/include/asm/global_data.h  |6 +-
   arch/arm/include/asm/io.h   |   12 +-
   arch/arm/include/asm/macro.h|   26 +++
   arch/arm/include/asm/posix_types.h  |   31 
   arch/arm/include/asm/proc-armv/ptrace.h |   38 
   arch/arm/include/asm/proc-armv/system.h |   58 +-
   arch/arm/include/asm/types.h|   14 ++
   arch/arm/include/asm/u-boot.h   |4 +
   arch/arm/include/asm/unaligned.h|   14 ++
   arch/arm/lib/Makefile   |8 +
   arch/arm/lib/board.c|   18 ++
   arch/arm/lib/bootm.c|   16 ++
   common/image.c  |1 +
   doc/README.armv8|   14 ++
   examples/standalone/stubs.c |   15 ++
   include/image.h |1 +
   35 files changed, 1987 insertions(+), 8 deletions(-)
   create mode 100644 arch/arm/cpu/armv8/Makefile
   create mode 100644 arch/arm/cpu/armv8/cache.S
   create mode 100644 arch/arm/cpu/armv8/cache_v8.c
   create mode 100644 arch/arm/cpu/armv8/config.mk
   create mode 100644 arch/arm/cpu/armv8/cpu.c
   create mode 100644 arch/arm/cpu/armv8/crt0.S
   create mode 100644 arch/arm/cpu/armv8/exceptions.S
   create mode 100644 arch/arm/cpu/armv8/interrupts.c
   create mode 100644 arch/arm/cpu/armv8/relocate.S
   create mode 100644 arch/arm/cpu/armv8/start.S
   create mode 100644 arch/arm/cpu/armv8/timer.c
   create mode 100644 arch/arm/cpu/armv8/tlb.S
   create mode 100644 arch/arm/cpu/armv8/u-boot.lds
   create mode 100644 arch/arm/include/asm/arch-armv8/armv8.h
   create mode 100644 arch/arm/include/asm/arch-armv8/gpio.h
   create mode 100644 arch/arm/include/asm/arch-armv8/mmu.h
   create mode 100644 doc/README.armv8
  
  diff --git a/arch/arm/config.mk b/arch/arm/config.mk
  index ce3903b..f1c6a7b 100644
  --- a/arch/arm/config.mk
  +++ b/arch/arm/config.mk
  @@ -74,7 +74,9 @@ endif
   endif
   
   # needed for relocation
  +ifndef CONFIG_ARMV8
   LDFLAGS_u-boot += -pie
  +endif
 
 CONFIG_ARM64 (until we fix this, of course)
  
   #
   # FIXME: binutils versions  2.22 have a bug in the assembler where
  @@ -95,6 +97,8 @@ endif
   endif
   
   # check that only R_ARM_RELATIVE relocations are generated
  +ifndef CONFIG_ARMV8
   ifneq ($(CONFIG_SPL_BUILD),y)
   ALL-y  += checkarmreloc
   endif
  +endif
 
 ARM64, though I've got a patch coming that will make the check work with
 arm64.
 
 Likewise elsewhere -- most if not all of the CONFIG_ARMV8 uses should be
 CONFIG_ARM64.

 
Actually, the naming is so confusing. The directory's name is armv8,  
but it only represents aarch64 here. So, whether CONFIG_ARMV8 or CONFIG_ARM64 
should be used
is difficult to make decision.

  +/*
  + * void __asm_flush_dcache_level(level)
  + *
  + * clean and invalidate one level cache.
  + *
  + * x0: cache level
  + * x1~x9: clobbered
  + */
  +ENTRY(__asm_flush_dcache_level)
 
 Why the leading underscores?
 

Is there any convention with underscores?  I just know the underscore 

[U-Boot] [PATCH 10/19] drivers: usb: convert makefiles to Kbuild style

2013-09-07 Thread Masahiro Yamada
Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---
 drivers/usb/eth/Makefile  | 28 ++--
 drivers/usb/gadget/Makefile   | 54 ++-
 drivers/usb/host/Makefile | 74 +++
 drivers/usb/musb-new/Makefile | 36 -
 drivers/usb/musb/Makefile | 36 -
 drivers/usb/phy/Makefile  | 24 +-
 drivers/usb/ulpi/Makefile | 28 ++--
 7 files changed, 62 insertions(+), 218 deletions(-)

diff --git a/drivers/usb/eth/Makefile b/drivers/usb/eth/Makefile
index 04a8b58..03f5474 100644
--- a/drivers/usb/eth/Makefile
+++ b/drivers/usb/eth/Makefile
@@ -3,31 +3,9 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB:= $(obj)libusb_eth.o
-
 # new USB host ethernet layer dependencies
-COBJS-$(CONFIG_USB_HOST_ETHER) += usb_ether.o
+obj-$(CONFIG_USB_HOST_ETHER) += usb_ether.o
 ifdef CONFIG_USB_ETHER_ASIX
-COBJS-y += asix.o
+obj-y += asix.o
 endif
-COBJS-$(CONFIG_USB_ETHER_SMSC95XX) += smsc95xx.o
-
-COBJS  := $(COBJS-y)
-SRCS   := $(COBJS:.o=.c)
-OBJS   := $(addprefix $(obj),$(COBJS))
-
-all:   $(LIB)
-
-$(LIB):$(obj).depend $(OBJS)
-   $(call cmd_link_o_target, $(OBJS))
-
-#
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#
+obj-$(CONFIG_USB_ETHER_SMSC95XX) += smsc95xx.o
diff --git a/drivers/usb/gadget/Makefile b/drivers/usb/gadget/Makefile
index 4c2a39a..276ad6e 100644
--- a/drivers/usb/gadget/Makefile
+++ b/drivers/usb/gadget/Makefile
@@ -5,56 +5,34 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB:= $(obj)libusb_gadget.o
-
 # if defined(CONFIG_USB_GADGET) || defined(CONFIG_USB_ETHER)
 #   Everytime you forget how crufty makefiles can get things like
 #   this remind you...
 ifneq (,$(CONFIG_USB_GADGET)$(CONFIG_USB_ETHER))
-COBJS-y += epautoconf.o config.o usbstring.o
+obj-y += epautoconf.o config.o usbstring.o
 endif
 
 # new USB gadget layer dependencies
 ifdef CONFIG_USB_GADGET
-COBJS-$(CONFIG_USB_GADGET_S3C_UDC_OTG) += s3c_udc_otg.o
-COBJS-$(CONFIG_USB_GADGET_FOTG210) += fotg210.o
-COBJS-$(CONFIG_USBDOWNLOAD_GADGET) += g_dnl.o
-COBJS-$(CONFIG_DFU_FUNCTION) += f_dfu.o
+obj-$(CONFIG_USB_GADGET_S3C_UDC_OTG) += s3c_udc_otg.o
+obj-$(CONFIG_USB_GADGET_FOTG210) += fotg210.o
+obj-$(CONFIG_USBDOWNLOAD_GADGET) += g_dnl.o
+obj-$(CONFIG_DFU_FUNCTION) += f_dfu.o
 endif
 ifdef CONFIG_USB_ETHER
-COBJS-y += ether.o
-COBJS-$(CONFIG_USB_ETH_RNDIS) += rndis.o
-COBJS-$(CONFIG_MV_UDC) += mv_udc.o
-COBJS-$(CONFIG_CPU_PXA25X) += pxa25x_udc.o
+obj-y += ether.o
+obj-$(CONFIG_USB_ETH_RNDIS) += rndis.o
+obj-$(CONFIG_MV_UDC)   += mv_udc.o
+obj-$(CONFIG_CPU_PXA25X) += pxa25x_udc.o
 else
 # Devices not related to the new gadget layer depend on CONFIG_USB_DEVICE
 ifdef CONFIG_USB_DEVICE
-COBJS-y += core.o
-COBJS-y += ep0.o
-COBJS-$(CONFIG_DW_UDC) += designware_udc.o
-COBJS-$(CONFIG_OMAP1510) += omap1510_udc.o
-COBJS-$(CONFIG_OMAP1610) += omap1510_udc.o
-COBJS-$(CONFIG_MPC885_FAMILY) += mpc8xx_udc.o
-COBJS-$(CONFIG_CPU_PXA27X) += pxa27x_udc.o
+obj-y += core.o
+obj-y += ep0.o
+obj-$(CONFIG_DW_UDC) += designware_udc.o
+obj-$(CONFIG_OMAP1510) += omap1510_udc.o
+obj-$(CONFIG_OMAP1610) += omap1510_udc.o
+obj-$(CONFIG_MPC885_FAMILY) += mpc8xx_udc.o
+obj-$(CONFIG_CPU_PXA27X) += pxa27x_udc.o
 endif
 endif
-
-COBJS  := $(COBJS-y)
-SRCS   := $(COBJS:.o=.c)
-OBJS   := $(addprefix $(obj),$(COBJS))
-
-all:   $(LIB)
-
-$(LIB):$(obj).depend $(OBJS)
-   $(call cmd_link_o_target, $(OBJS))
-
-#
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#
diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile
index ff6c80e..674508a 100644
--- a/drivers/usb/host/Makefile
+++ b/drivers/usb/host/Makefile
@@ -5,57 +5,35 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB:= $(obj)libusb_host.o
-
 # ohci
-COBJS-$(CONFIG_USB_OHCI_NEW) += ohci-hcd.o
-COBJS-$(CONFIG_USB_ATMEL) += ohci-at91.o
-COBJS-$(CONFIG_USB_OHCI_DA8XX) += ohci-da8xx.o
-COBJS-$(CONFIG_USB_ISP116X_HCD) += isp116x-hcd.o
-COBJS-$(CONFIG_USB_R8A66597_HCD) += r8a66597-hcd.o
-COBJS-$(CONFIG_USB_SL811HS) += sl811-hcd.o
-COBJS-$(CONFIG_USB_OHCI_S3C24XX) += ohci-s3c24xx.o
+obj-$(CONFIG_USB_OHCI_NEW) += ohci-hcd.o
+obj-$(CONFIG_USB_ATMEL) += ohci-at91.o
+obj-$(CONFIG_USB_OHCI_DA8XX) += ohci-da8xx.o
+obj-$(CONFIG_USB_ISP116X_HCD) += isp116x-hcd.o
+obj-$(CONFIG_USB_R8A66597_HCD) += r8a66597-hcd.o
+obj-$(CONFIG_USB_SL811HS) += sl811-hcd.o
+obj-$(CONFIG_USB_OHCI_S3C24XX) += ohci-s3c24xx.o
 
 # echi
-COBJS-$(CONFIG_USB_EHCI) += ehci-hcd.o

[U-Boot] [PATCH 07/19] ARM: imx-common: convert makefiles to Kbuild style

2013-09-07 Thread Masahiro Yamada
Multiple targets are included in arch/arm/imx-common/Makefile
In order to refactor it,
we need to tweak Makefile and spl/Makefile.

Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---
 Makefile |  8 +---
 arch/arm/imx-common/Makefile | 35 ++-
 spl/Makefile |  4 +++-
 3 files changed, 14 insertions(+), 33 deletions(-)

diff --git a/Makefile b/Makefile
index 852f80b..338bf31 100644
--- a/Makefile
+++ b/Makefile
@@ -413,6 +413,8 @@ ALL-y += $(obj)u-boot-nodtb-tegra.bin
 endif
 endif
 
+build := -f $(TOPDIR)/scripts/Makefile.build -C
+
 all:   $(ALL-y) $(SUBDIR_EXAMPLES)
 
 $(obj)u-boot.dtb:  checkdtc $(obj)u-boot
@@ -460,7 +462,7 @@ $(obj)u-boot.img:   $(obj)u-boot.bin
-d $ $@
 
 $(obj)u-boot.imx: $(obj)u-boot.bin depend
-   $(MAKE) -C $(SRCTREE)/arch/arm/imx-common $(OBJTREE)/u-boot.imx
+   $(MAKE) $(build) $(SRCTREE)/arch/arm/imx-common 
$(OBJTREE)/u-boot.imx
 
 $(obj)u-boot.kwb:   $(obj)u-boot.bin
$(obj)tools/mkimage -n $(CONFIG_SYS_KWD_CONFIG) -T kwbimage \
@@ -498,11 +500,11 @@ $(obj)tpl/u-boot-with-tpl.bin: $(obj)tpl/u-boot-tpl.bin 
$(obj)u-boot.bin
$(call 
SPL_PAD_APPEND,$,$(obj)u-boot.bin,tpl/u-boot-tpl-pad.bin,$(CONFIG_TPL_PAD_TO))
 
 $(obj)u-boot-with-spl.imx: $(obj)spl/u-boot-spl.bin $(obj)u-boot.bin
-   $(MAKE) -C $(SRCTREE)/arch/arm/imx-common \
+   $(MAKE) $(build) $(SRCTREE)/arch/arm/imx-common \
$(OBJTREE)/u-boot-with-spl.imx
 
 $(obj)u-boot-with-nand-spl.imx: $(obj)spl/u-boot-spl.bin $(obj)u-boot.bin
-   $(MAKE) -C $(SRCTREE)/arch/arm/imx-common \
+   $(MAKE) $(build) $(SRCTREE)/arch/arm/imx-common \
$(OBJTREE)/u-boot-with-nand-spl.imx
 
 $(obj)u-boot.ubl:   $(obj)u-boot-with-spl.bin
diff --git a/arch/arm/imx-common/Makefile b/arch/arm/imx-common/Makefile
index 727a052..50873d8 100644
--- a/arch/arm/imx-common/Makefile
+++ b/arch/arm/imx-common/Makefile
@@ -7,31 +7,18 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB = $(obj)libimx-common.o
-
 ifeq ($(SOC),$(filter $(SOC),mx25 mx35 mx5 mx6 vf610))
-COBJS-y= iomux-v3.o
+obj-y  = iomux-v3.o
 endif
 ifeq ($(SOC),$(filter $(SOC),mx5 mx6))
-COBJS-y+= timer.o cpu.o speed.o
-COBJS-$(CONFIG_I2C_MXC) += i2c-mxv7.o
+obj-y  += timer.o cpu.o speed.o
+obj-$(CONFIG_I2C_MXC) += i2c-mxv7.o
 endif
 ifeq ($(SOC),$(filter $(SOC),mx6 mxs))
-COBJS-y+= misc.o
+obj-y  += misc.o
 endif
-COBJS-$(CONFIG_CMD_BMODE) += cmd_bmode.o
-COBJS-$(CONFIG_CMD_HDMIDETECT) += cmd_hdmidet.o
-COBJS  := $(sort $(COBJS-y))
-
-SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
-
-all:   $(obj).depend $(LIB)
-
-$(LIB):$(OBJS)
-   $(call cmd_link_o_target, $(OBJS))
+obj-$(CONFIG_CMD_BMODE) += cmd_bmode.o
+obj-$(CONFIG_CMD_HDMIDETECT) += cmd_hdmidet.o
 
 $(OBJTREE)/$(patsubst %,%,$(CONFIG_IMX_CONFIG)).cfgtmp: $(OBJTREE)/%.cfgtmp 
: $(SRCTREE)/%
mkdir -p $(dir $@)
@@ -67,13 +54,3 @@ $(OBJTREE)/u-boot-with-nand-spl.imx: $(OBJTREE)/SPL 
$(OBJTREE)/u-boot.bin
$(OBJTREE)/u-boot.uim
cat $(OBJTREE)/spl/u-boot-nand-spl-pad.imx $(OBJTREE)/u-boot.uim  $@
rm $(OBJTREE)/spl/u-boot-nand-spl-pad.imx $(OBJTREE)/u-boot.uim
-
-
-#
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#
diff --git a/spl/Makefile b/spl/Makefile
index 7497b5f..5d31a52 100644
--- a/spl/Makefile
+++ b/spl/Makefile
@@ -152,6 +152,8 @@ ifeq ($(wildcard $(LDSCRIPT)),)
 $(error could not find linker script)
 endif
 
+build := -f $(TOPDIR)/scripts/Makefile.build -C
+
 # Special flags for CPP when processing the linker script.
 # Pass the version down so we can handle backwards compatibility
 # on the fly.
@@ -171,7 +173,7 @@ $(OBJTREE)/MLO.byteswap: $(obj)u-boot-spl.bin
-a $(CONFIG_SPL_TEXT_BASE) -d $ $@
 
 $(OBJTREE)/SPL : $(obj)u-boot-spl.bin depend
-   $(MAKE) -C $(SRCTREE)/arch/arm/imx-common $@
+   $(MAKE) $(build) $(SRCTREE)/arch/arm/imx-common $@
 
 ALL-y  += $(obj)$(SPL_BIN).bin
 
-- 
1.8.1.2

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 12/19] fs: convert makefiles to Kbuild style

2013-09-07 Thread Masahiro Yamada
Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---
 fs/Makefile  | 24 +---
 fs/cbfs/Makefile | 24 +---
 fs/cramfs/Makefile   | 29 ++---
 fs/ext4/Makefile | 27 ++-
 fs/fat/Makefile  | 31 +++
 fs/fdos/Makefile | 27 +--
 fs/jffs2/Makefile| 38 ++
 fs/reiserfs/Makefile | 26 +-
 fs/sandbox/Makefile  | 23 +--
 fs/ubifs/Makefile| 29 -
 fs/yaffs2/Makefile   | 33 +
 fs/zfs/Makefile  | 25 +
 12 files changed, 24 insertions(+), 312 deletions(-)

diff --git a/fs/Makefile b/fs/Makefile
index 7e753e9..ea2eb09 100644
--- a/fs/Makefile
+++ b/fs/Makefile
@@ -6,26 +6,4 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB= $(obj)libfs.o
-
-COBJS-y+= fs.o
-
-COBJS  := $(COBJS-y)
-SRCS   := $(COBJS:.o=.c)
-OBJS   := $(addprefix $(obj),$(COBJS))
-
-all:   $(LIB)
-
-$(LIB):$(obj).depend $(OBJS)
-   $(call cmd_link_o_target, $(OBJS))
-
-#
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#
+obj-y  += fs.o
diff --git a/fs/cbfs/Makefile b/fs/cbfs/Makefile
index 190fd8e..6f33d28 100644
--- a/fs/cbfs/Makefile
+++ b/fs/cbfs/Makefile
@@ -3,26 +3,4 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB= $(obj)libcbfs.o
-
-COBJS-$(CONFIG_CMD_CBFS)   := cbfs.o
-
-SRCS   := $(COBJS-y:.o=.c)
-OBJS   := $(addprefix $(obj),$(COBJS-y))
-
-all:   $(LIB)
-
-$(LIB):$(obj).depend $(OBJS)
-   $(call cmd_link_o_target, $(OBJS))
-
-
-#
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#
+obj-$(CONFIG_CMD_CBFS) := cbfs.o
diff --git a/fs/cramfs/Makefile b/fs/cramfs/Makefile
index 9b1a3d7..e2b2c73 100644
--- a/fs/cramfs/Makefile
+++ b/fs/cramfs/Makefile
@@ -5,30 +5,5 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB= $(obj)libcramfs.o
-
-AOBJS  =
-COBJS-$(CONFIG_CMD_CRAMFS) := cramfs.o
-COBJS-$(CONFIG_CMD_CRAMFS) += uncompress.o
-
-SRCS   := $(AOBJS:.o=.S) $(COBJS-y:.o=.c)
-OBJS   := $(addprefix $(obj),$(AOBJS) $(COBJS-y))
-
-#CPPFLAGS +=
-
-all:   $(LIB) $(AOBJS)
-
-$(LIB):$(obj).depend $(OBJS)
-   $(call cmd_link_o_target, $(OBJS))
-
-
-#
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#
+obj-$(CONFIG_CMD_CRAMFS) := cramfs.o
+obj-$(CONFIG_CMD_CRAMFS) += uncompress.o
diff --git a/fs/ext4/Makefile b/fs/ext4/Makefile
index f45bb32..0f5d399 100644
--- a/fs/ext4/Makefile
+++ b/fs/ext4/Makefile
@@ -9,28 +9,5 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB= $(obj)libext4fs.o
-
-AOBJS  =
-COBJS-$(CONFIG_FS_EXT4) := ext4fs.o ext4_common.o dev.o
-COBJS-$(CONFIG_EXT4_WRITE) += ext4_write.o ext4_journal.o crc16.o
-
-SRCS   := $(AOBJS:.o=.S) $(COBJS-y:.o=.c)
-OBJS   := $(addprefix $(obj),$(AOBJS) $(COBJS-y))
-
-
-all:   $(LIB) $(AOBJS)
-
-$(LIB):$(obj).depend $(OBJS)
-   $(call cmd_link_o_target, $(OBJS))
-
-#
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#
+obj-$(CONFIG_FS_EXT4) := ext4fs.o ext4_common.o dev.o
+obj-$(CONFIG_EXT4_WRITE) += ext4_write.o ext4_journal.o crc16.o
diff --git a/fs/fat/Makefile b/fs/fat/Makefile
index c00681f..b60e848 100644
--- a/fs/fat/Makefile
+++ b/fs/fat/Makefile
@@ -3,34 +3,9 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB= $(obj)libfat.o
-
-AOBJS  =
-COBJS-$(CONFIG_FS_FAT) := fat.o
-COBJS-$(CONFIG_FAT_WRITE):= fat_write.o
+obj-$(CONFIG_FS_FAT)   := fat.o
+obj-$(CONFIG_FAT_WRITE):= fat_write.o
 
 ifndef CONFIG_SPL_BUILD
-COBJS-$(CONFIG_FS_FAT) += file.o
+obj-$(CONFIG_FS_FAT)   += file.o
 endif
-
-SRCS   := $(AOBJS:.o=.S) $(COBJS-y:.o=.c)
-OBJS   := $(addprefix $(obj),$(AOBJS) $(COBJS-y))
-
-all:   $(LIB) $(AOBJS)
-
-$(LIB):$(obj).depend $(OBJS)
-   $(call cmd_link_o_target, $(OBJS))
-
-# SEE README.arm-unaligned-accesses
-$(obj)file.o: CFLAGS += $(PLATFORM_NO_UNALIGNED)
-
-#
-

[U-Boot] [PATCH 02/19] armv7: convert makefiles to Kbuild style

2013-09-07 Thread Masahiro Yamada
Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---
 arch/arm/cpu/armv7/Makefile  | 32 
 arch/arm/cpu/armv7/am33xx/Makefile   | 51 
 arch/arm/cpu/armv7/at91/Makefile | 31 ---
 arch/arm/cpu/armv7/exynos/Makefile   | 34 -
 arch/arm/cpu/armv7/highbank/Makefile | 24 +--
 arch/arm/cpu/armv7/mx5/Makefile  | 25 ++--
 arch/arm/cpu/armv7/mx6/Makefile  | 23 +-
 arch/arm/cpu/armv7/omap-common/Makefile  | 43 +++
 arch/arm/cpu/armv7/omap3/Makefile| 41 +++--
 arch/arm/cpu/armv7/omap4/Makefile| 31 ---
 arch/arm/cpu/armv7/omap5/Makefile| 33 -
 arch/arm/cpu/armv7/rmobile/Makefile  | 51 
 arch/arm/cpu/armv7/s5p-common/Makefile   | 29 +++---
 arch/arm/cpu/armv7/s5pc1xx/Makefile  | 27 ++---
 arch/arm/cpu/armv7/socfpga/Makefile  | 29 ++
 arch/arm/cpu/armv7/tegra-common/Makefile | 24 +--
 arch/arm/cpu/armv7/tegra114/Makefile | 22 +-
 arch/arm/cpu/armv7/tegra20/Makefile  | 26 ++--
 arch/arm/cpu/armv7/tegra30/Makefile  | 22 +-
 arch/arm/cpu/armv7/u8500/Makefile| 25 ++--
 arch/arm/cpu/armv7/vf610/Makefile| 25 ++--
 arch/arm/cpu/armv7/zynq/Makefile | 29 ++
 22 files changed, 99 insertions(+), 578 deletions(-)

diff --git a/arch/arm/cpu/armv7/Makefile b/arch/arm/cpu/armv7/Makefile
index b723e22..75fac4b 100644
--- a/arch/arm/cpu/armv7/Makefile
+++ b/arch/arm/cpu/armv7/Makefile
@@ -5,35 +5,13 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
+extra-y:= start.o
 
-LIB= $(obj)lib$(CPU).o
+obj-y  += cache_v7.o
 
-START  := start.o
-
-COBJS  += cache_v7.o
-
-COBJS  += cpu.o
-COBJS  += syslib.o
+obj-y  += cpu.o
+obj-y  += syslib.o
 
 ifneq 
($(CONFIG_AM43XX)$(CONFIG_AM33XX)$(CONFIG_OMAP44XX)$(CONFIG_OMAP54XX)$(CONFIG_TEGRA)$(CONFIG_MX6)$(CONFIG_TI81XX),)
-SOBJS  += lowlevel_init.o
+obj-y  += lowlevel_init.o
 endif
-
-SRCS   := $(START:.o=.S) $(COBJS:.o=.c)
-OBJS   := $(addprefix $(obj),$(COBJS) $(SOBJS))
-START  := $(addprefix $(obj),$(START))
-
-all:   $(obj).depend $(START) $(LIB)
-
-$(LIB):$(OBJS)
-   $(call cmd_link_o_target, $(OBJS))
-
-#
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#
diff --git a/arch/arm/cpu/armv7/am33xx/Makefile 
b/arch/arm/cpu/armv7/am33xx/Makefile
index f6a297c..966fcab 100644
--- a/arch/arm/cpu/armv7/am33xx/Makefile
+++ b/arch/arm/cpu/armv7/am33xx/Makefile
@@ -4,46 +4,19 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB= $(obj)lib$(SOC).o
-
-COBJS-$(CONFIG_AM33XX) += clock_am33xx.o
-COBJS-$(CONFIG_TI814X) += clock_ti814x.o
-COBJS-$(CONFIG_AM43XX) += clock_am43xx.o
+obj-$(CONFIG_AM33XX)   += clock_am33xx.o
+obj-$(CONFIG_TI814X)   += clock_ti814x.o
+obj-$(CONFIG_AM43XX)   += clock_am43xx.o
 
 ifneq ($(CONFIG_AM43XX)$(CONFIG_AM33XX),)
-COBJS  += clock.o
+obj-y  += clock.o
 endif
 
-COBJS-$(CONFIG_TI816X) += clock_ti816x.o
-COBJS  += sys_info.o
-COBJS  += mem.o
-COBJS  += ddr.o
-COBJS  += emif4.o
-COBJS  += board.o
-COBJS  += mux.o
-COBJS-$(CONFIG_NAND_OMAP_GPMC) += elm.o
-
-SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS   := $(addprefix $(obj),$(COBJS) $(COBJS-y) $(SOBJS))
-
-all:   $(obj).depend $(LIB)
-
-$(LIB):$(OBJS)
-   $(call cmd_link_o_target, $(OBJS))
-
-clean:
-   rm -f $(SOBJS) $(OBJS)
-
-distclean: clean
-   rm -f $(LIB) core *.bak .depend
-
-#
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#
+obj-$(CONFIG_TI816X)   += clock_ti816x.o
+obj-y  += sys_info.o
+obj-y  += mem.o
+obj-y  += ddr.o
+obj-y  += emif4.o
+obj-y  += board.o
+obj-y  += mux.o
+obj-$(CONFIG_NAND_OMAP_GPMC)   += elm.o
diff --git a/arch/arm/cpu/armv7/at91/Makefile b/arch/arm/cpu/armv7/at91/Makefile
index 90b9bd6..0a2e48d 100644
--- a/arch/arm/cpu/armv7/at91/Makefile
+++ b/arch/arm/cpu/armv7/at91/Makefile
@@ -8,29 +8,8 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB= $(obj)lib$(SOC).o
-
-COBJS-$(CONFIG_SAMA5D3)+= sama5d3_devices.o
-COBJS-y += clock.o
-COBJS-y += cpu.o
-COBJS-y += reset.o
-COBJS-y += timer.o
-
-SRCS:= $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
-OBJS:= $(addprefix $(obj),$(SOBJS-y) $(COBJS-y))
-
-all:   $(obj).depend $(LIB)
-
-$(LIB):$(OBJS)
-   $(call cmd_link_o_target, $(OBJS))
-

[U-Boot] [PATCH 04/19] arm920t: convert makefiles to Kbuild style

2013-09-07 Thread Masahiro Yamada
Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---
 arch/arm/cpu/arm920t/Makefile | 28 +++-
 arch/arm/cpu/arm920t/a320/Makefile| 25 ++---
 arch/arm/cpu/arm920t/at91/Makefile| 33 ++---
 arch/arm/cpu/arm920t/ep93xx/Makefile  | 24 ++--
 arch/arm/cpu/arm920t/imx/Makefile | 27 +++
 arch/arm/cpu/arm920t/ks8695/Makefile  | 26 ++
 arch/arm/cpu/arm920t/s3c24x0/Makefile | 29 -
 7 files changed, 22 insertions(+), 170 deletions(-)

diff --git a/arch/arm/cpu/arm920t/Makefile b/arch/arm/cpu/arm920t/Makefile
index 4758f02..aac8043 100644
--- a/arch/arm/cpu/arm920t/Makefile
+++ b/arch/arm/cpu/arm920t/Makefile
@@ -5,29 +5,7 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
+extra-y= start.o
 
-LIB= $(obj)lib$(CPU).o
-
-START  = start.o
-
-COBJS-y+= cpu.o
-COBJS-$(CONFIG_USE_IRQ)+= interrupts.o
-
-SRCS   := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
-OBJS   := $(addprefix $(obj),$(COBJS-y) $(SOBJS))
-START  := $(addprefix $(obj),$(START))
-
-all:   $(obj).depend $(START) $(LIB)
-
-$(LIB):$(OBJS)
-   $(call cmd_link_o_target, $(OBJS))
-
-#
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#
+obj-y  += cpu.o
+obj-$(CONFIG_USE_IRQ)  += interrupts.o
diff --git a/arch/arm/cpu/arm920t/a320/Makefile 
b/arch/arm/cpu/arm920t/a320/Makefile
index 88c7d9b..bbdab58 100644
--- a/arch/arm/cpu/arm920t/a320/Makefile
+++ b/arch/arm/cpu/arm920t/a320/Makefile
@@ -5,26 +5,5 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB= $(obj)lib$(SOC).o
-
-SOBJS  += reset.o
-COBJS  += timer.o
-
-SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
-
-all:   $(obj).depend $(LIB)
-
-$(LIB):$(OBJS)
-   $(call cmd_link_o_target, $(OBJS))
-
-#
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#
+obj-y  += reset.o
+obj-y  += timer.o
diff --git a/arch/arm/cpu/arm920t/at91/Makefile 
b/arch/arm/cpu/arm920t/at91/Makefile
index b2b1e56..561b4b4 100644
--- a/arch/arm/cpu/arm920t/at91/Makefile
+++ b/arch/arm/cpu/arm920t/at91/Makefile
@@ -5,30 +5,9 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB= $(obj)lib$(SOC).o
-
-SOBJS  += lowlevel_init.o
-COBJS  += reset.o
-COBJS  += timer.o
-COBJS  += clock.o
-COBJS  += cpu.o
-COBJS  += at91rm9200_devices.o
-
-SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
-
-all:   $(obj).depend $(LIB)
-
-$(LIB):$(OBJS)
-   $(call cmd_link_o_target, $(OBJS))
-
-#
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#
+obj-y  += lowlevel_init.o
+obj-y  += reset.o
+obj-y  += timer.o
+obj-y  += clock.o
+obj-y  += cpu.o
+obj-y  += at91rm9200_devices.o
diff --git a/arch/arm/cpu/arm920t/ep93xx/Makefile 
b/arch/arm/cpu/arm920t/ep93xx/Makefile
index 7a75c86..638333a 100644
--- a/arch/arm/cpu/arm920t/ep93xx/Makefile
+++ b/arch/arm/cpu/arm920t/ep93xx/Makefile
@@ -16,26 +16,6 @@
 #
 # SPDX-License-Identifier: GPL-2.0+
 #
-include $(TOPDIR)/config.mk
 
-LIB = $(obj)lib$(SOC).o
-
-COBJS   = cpu.o led.o speed.o timer.o
-SOBJS   = lowlevel_init.o
-
-SRCS:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS:= $(addprefix $(obj),$(SOBJS) $(COBJS))
-
-all:$(obj).depend $(LIB)
-
-$(LIB): $(OBJS)
-   $(call cmd_link_o_target, $(OBJS))
-
-#
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#
+obj-y   = cpu.o led.o speed.o timer.o
+obj-y   += lowlevel_init.o
diff --git a/arch/arm/cpu/arm920t/imx/Makefile 
b/arch/arm/cpu/arm920t/imx/Makefile
index c9c85b8..54ce646 100644
--- a/arch/arm/cpu/arm920t/imx/Makefile
+++ b/arch/arm/cpu/arm920t/imx/Makefile
@@ -5,27 +5,6 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB= $(obj)lib$(SOC).o
-
-COBJS  += generic.o
-COBJS  += speed.o
-COBJS  += timer.o
-
-SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
-
-all:   $(obj).depend $(LIB)
-
-$(LIB):$(OBJS)
-   $(call cmd_link_o_target, $(OBJS))
-
-#

[U-Boot] [PATCH 01/19] Makefile: prepare for using Kbuild-style Makefile

2013-09-07 Thread Masahiro Yamada
In every sub directory, Makefile is like follows:

include $(TOPDIR)/config.mk

LIB = $(obj)libfoo.o

COBJS := ...
COBJS += ...
SOBJS := ...

SRCS:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
OBJS:= $(addprefix $(obj),$(COBJS) $(SOBJS))

all: $(obj).depend $(LIB)

$(LIB): $(OBJS)
$(call cmd_link_o_target, $(OBJS))

#

include $(SRCTREE)/rules.mk

sinclude $(obj).depend

#

Top and bottom parts are common in almost all sub-makefiles.
This is a big waste.
This commit pushes common parts of makefiles into script/Makefile.build.

Going forward sub-makefiles only need to describe this part:

COBJS := ...
COBJS += ...
SOBJS := ...

But, script/Makefile.build includes the glue code to support obj-y,
the following style (the same as Kbuild) is preferable:

obj-y := ...
obj-$(CONFIG_FOO) += ...
obj-$(CONFIG_BAR) += ...

The conventional U-Boot Makefile style is still supported.
This is achieved by greping the Makefile before entering into it.
U-Boot conventional sub makefiles always include some other makefiles.
So the build system searches a line with beginning with include keyword
in the makefile in order to distinguish which style it is.
If the Makefile include a include line, we assume it is a conventional
U-Boot style. Otherwise, it is treated as a Kbuild-style makefile.

(At first, I tried to grep rules.mk keyword instead,
but I found it does not work.
Almost all sub makefiles include rules.mk, but there exist three exception:
   - board/avnet/fx12mm/Makefile
   - board/avnet/v5fx30teval/Makefile
   - board/xilinx/ml507/Makefile
These three makefiles include rules.mk indirectly.
Anyway, they look weird, so they should be fixed lator.)

With this tweak, we can switch sub-makefiles
from U-Boot style to Kbuild style little by little.

This refactoring of sub makefiles is the first step towards Kbuild,
and makes it easy to import a real Kbuild from Linux Kernel.

Note that this refactoring breaks nothing because it just moves
the common parts into scripts/Makefile.build.

Note one more thing:

obj-y := foo/  # descending into foo sub directory

syntax is not supported yet.
(This feature will be implemented in the upcoming commit series.)

Of course, scripts/Makefile.build added by this commit is temporary.
It shall be replaced with the one of Linux Kernel in future.

Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
Cc: Simon Glass s...@chromium.org
---
 Makefile   | 34 ++
 scripts/Makefile.build | 48 
 spl/Makefile   | 20 ++--
 3 files changed, 96 insertions(+), 6 deletions(-)
 create mode 100644 scripts/Makefile.build

diff --git a/Makefile b/Makefile
index ed48279..852f80b 100644
--- a/Makefile
+++ b/Makefile
@@ -592,14 +592,35 @@ ifeq ($(CONFIG_KALLSYMS),y)
$(GEN_UBOOT) $(obj)common/system_map.o
 endif
 
+# Tentative step for Kbuild-style makefiles coexist with conventional U-Boot 
style makefiles
+#  U-Boot conventional sub makefiles always include some other makefiles.
+#  So, the build system searches a line beginning with include before 
entering into the sub makefile
+#  in order to distinguish which style it is.
+#  If the Makefile include a include line, we assume it is an U-Boot style 
makefile.
+#  Otherwise, it is treated as a Kbuild-style makefile.
+
+# We do not need to build $(OBJS) explicitly.
+# It is built while we are at $(CPUDIR)/lib$(CPU).o build.
 $(OBJS):   depend
-   $(MAKE) -C $(CPUDIR) $(if $(REMOTE_BUILD),$@,$(notdir $@))
+   if grep -q ^include $(CPUDIR)/Makefile; then \
+   $(MAKE) -C $(CPUDIR) $(if $(REMOTE_BUILD),$@,$(notdir $@)); \
+   fi
 
 $(LIBS):   depend $(SUBDIR_TOOLS)
-   $(MAKE) -C $(dir $(subst $(obj),,$@))
+   if grep -q ^include $(dir $(subst $(obj),,$@))Makefile; then \
+   $(MAKE) -C $(dir $(subst $(obj),,$@)); \
+   else \
+   $(MAKE) -C $(dir $(subst $(obj),,$@)) -f 
$(TOPDIR)/scripts/Makefile.build; \
+   mv $(dir $@)built-in.o $@; \
+   fi
 
 $(LIBBOARD):   depend $(LIBS)
-   $(MAKE) -C $(dir $(subst $(obj),,$@))
+   if grep -q ^include $(dir $(subst $(obj),,$@))/Makefile; then 
\
+   $(MAKE) -C $(dir $(subst $(obj),,$@)); \
+   else \
+   $(MAKE) -C $(dir $(subst $(obj),,$@)) -f 
$(TOPDIR)/scripts/Makefile.build; \
+   mv $(dir $@)built-in.o $@; \
+   fi
 
 $(SUBDIRS):depend
$(MAKE) -C $@ all
@@ -636,7 +657,12 @@ depend dep:$(TIMESTAMP_FILE) $(VERSION_FILE) \
$(obj)include/generated/generic-asm-offsets.h \

[U-Boot] [PATCH 03/19] arm926ejs: convert makefiles to Kbuild style

2013-09-07 Thread Masahiro Yamada
Note1:
In arch/arm/cpu/arm926ejs/spear/Makefile
START := start.o
was changed
extra-$(CONFIG_SPL_BUILD) := start.o
because spear/start.o is only used for SPL.

Note2:
START := start.o
was missing from arch/arm/cpu/arm926ejs/mxs/Makefile.
This commit simply adds
extra-$(CONFIG_SPL_BUILD) := start.o

Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---
 arch/arm/cpu/arm926ejs/Makefile   | 28 ++-
 arch/arm/cpu/arm926ejs/armada100/Makefile | 23 +---
 arch/arm/cpu/arm926ejs/at91/Makefile  | 59 ++-
 arch/arm/cpu/arm926ejs/davinci/Makefile   | 48 +++--
 arch/arm/cpu/arm926ejs/kirkwood/Makefile  | 31 +++-
 arch/arm/cpu/arm926ejs/lpc32xx/Makefile   | 23 +---
 arch/arm/cpu/arm926ejs/mb86r0x/Makefile   | 25 +
 arch/arm/cpu/arm926ejs/mx25/Makefile  | 23 +---
 arch/arm/cpu/arm926ejs/mx27/Makefile  | 23 +---
 arch/arm/cpu/arm926ejs/mxs/Makefile   | 26 ++
 arch/arm/cpu/arm926ejs/nomadik/Makefile   | 25 ++---
 arch/arm/cpu/arm926ejs/omap/Makefile  | 26 ++
 arch/arm/cpu/arm926ejs/orion5x/Makefile   | 29 +++
 arch/arm/cpu/arm926ejs/pantheon/Makefile  | 23 +---
 arch/arm/cpu/arm926ejs/spear/Makefile | 36 +--
 arch/arm/cpu/arm926ejs/versatile/Makefile | 26 ++
 16 files changed, 67 insertions(+), 407 deletions(-)

diff --git a/arch/arm/cpu/arm926ejs/Makefile b/arch/arm/cpu/arm926ejs/Makefile
index b4c214c..1252995 100644
--- a/arch/arm/cpu/arm926ejs/Makefile
+++ b/arch/arm/cpu/arm926ejs/Makefile
@@ -5,33 +5,11 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB= $(obj)lib$(CPU).o
-
-START  = start.o
-COBJS  = cpu.o cache.o
+extra-y= start.o
+obj-y  = cpu.o cache.o
 
 ifdef  CONFIG_SPL_BUILD
 ifdef  CONFIG_SPL_NO_CPU_SUPPORT_CODE
-START  :=
+extra-y:=
 endif
 endif
-
-SRCS   := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS   := $(addprefix $(obj),$(COBJS) $(SOBJS))
-START  := $(addprefix $(obj),$(START))
-
-all:   $(obj).depend $(START) $(LIB)
-
-$(LIB):$(OBJS)
-   $(call cmd_link_o_target, $(OBJS))
-
-#
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#
diff --git a/arch/arm/cpu/arm926ejs/armada100/Makefile 
b/arch/arm/cpu/arm926ejs/armada100/Makefile
index a1a6df0..fca98ef 100644
--- a/arch/arm/cpu/arm926ejs/armada100/Makefile
+++ b/arch/arm/cpu/arm926ejs/armada100/Makefile
@@ -6,25 +6,4 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB= $(obj)lib$(SOC).o
-
-COBJS-y= cpu.o timer.o dram.o
-
-SRCS   := $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
-OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS-y))
-
-all:   $(obj).depend $(LIB)
-
-$(LIB):$(OBJS)
-   $(call cmd_link_o_target, $(OBJS))
-
-#
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#
+obj-y  = cpu.o timer.o dram.o
diff --git a/arch/arm/cpu/arm926ejs/at91/Makefile 
b/arch/arm/cpu/arm926ejs/at91/Makefile
index 9faec91..698a28d 100644
--- a/arch/arm/cpu/arm926ejs/at91/Makefile
+++ b/arch/arm/cpu/arm926ejs/at91/Makefile
@@ -5,46 +5,25 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB= $(obj)lib$(SOC).o
-
-COBJS-$(CONFIG_AT91CAP9)   += at91cap9_devices.o
-COBJS-$(CONFIG_AT91SAM9260)+= at91sam9260_devices.o
-COBJS-$(CONFIG_AT91SAM9G20)+= at91sam9260_devices.o
-COBJS-$(CONFIG_AT91SAM9XE) += at91sam9260_devices.o
-COBJS-$(CONFIG_AT91SAM9261)+= at91sam9261_devices.o
-COBJS-$(CONFIG_AT91SAM9G10)+= at91sam9261_devices.o
-COBJS-$(CONFIG_AT91SAM9263)+= at91sam9263_devices.o
-COBJS-$(CONFIG_AT91SAM9RL) += at91sam9rl_devices.o
-COBJS-$(CONFIG_AT91SAM9M10G45) += at91sam9m10g45_devices.o
-COBJS-$(CONFIG_AT91SAM9G45)+= at91sam9m10g45_devices.o
-COBJS-$(CONFIG_AT91SAM9N12)+= at91sam9n12_devices.o
-COBJS-$(CONFIG_AT91SAM9X5) += at91sam9x5_devices.o
-COBJS-$(CONFIG_AT91_EFLASH)+= eflash.o
-COBJS-$(CONFIG_AT91_LED)   += led.o
-COBJS-y += clock.o
-COBJS-y += cpu.o
-COBJS-y+= reset.o
-COBJS-y+= timer.o
+obj-$(CONFIG_AT91CAP9) += at91cap9_devices.o
+obj-$(CONFIG_AT91SAM9260)  += at91sam9260_devices.o
+obj-$(CONFIG_AT91SAM9G20)  += at91sam9260_devices.o
+obj-$(CONFIG_AT91SAM9XE)   += at91sam9260_devices.o
+obj-$(CONFIG_AT91SAM9261)  += at91sam9261_devices.o
+obj-$(CONFIG_AT91SAM9G10)  += at91sam9261_devices.o
+obj-$(CONFIG_AT91SAM9263)  += at91sam9263_devices.o
+obj-$(CONFIG_AT91SAM9RL)   += at91sam9rl_devices.o
+obj-$(CONFIG_AT91SAM9M10G45)   += 

[U-Boot] [PATCH 06/19] ARM: convert makefiles to Kbuild style

2013-09-07 Thread Masahiro Yamada
Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---
 arch/arm/cpu/arm1136/Makefile   | 26 +-
 arch/arm/cpu/arm1136/mx31/Makefile  | 27 ++-
 arch/arm/cpu/arm1136/mx35/Makefile  | 28 ++-
 arch/arm/cpu/arm1176/Makefile   | 26 +-
 arch/arm/cpu/arm1176/bcm2835/Makefile   | 25 +-
 arch/arm/cpu/arm1176/tnetv107x/Makefile | 27 +--
 arch/arm/cpu/arm925t/Makefile   | 30 ++--
 arch/arm/cpu/arm946es/Makefile  | 26 +-
 arch/arm/cpu/arm_intcm/Makefile | 26 +-
 arch/arm/cpu/ixp/Makefile   | 30 ++--
 arch/arm/cpu/pxa/Makefile   | 36 +++---
 arch/arm/cpu/sa1100/Makefile| 28 ++-
 arch/arm/cpu/tegra-common/Makefile  | 25 +-
 arch/arm/cpu/tegra114-common/Makefile   | 23 +
 arch/arm/cpu/tegra20-common/Makefile| 29 ++-
 arch/arm/cpu/tegra30-common/Makefile| 26 +-
 arch/arm/lib/Makefile   | 86 ++---
 17 files changed, 69 insertions(+), 455 deletions(-)

diff --git a/arch/arm/cpu/arm1136/Makefile b/arch/arm/cpu/arm1136/Makefile
index cc516f7..3279f12 100644
--- a/arch/arm/cpu/arm1136/Makefile
+++ b/arch/arm/cpu/arm1136/Makefile
@@ -5,27 +5,5 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB= $(obj)lib$(CPU).o
-
-START  = start.o
-COBJS  = cpu.o
-
-SRCS   := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS   := $(addprefix $(obj),$(COBJS) $(SOBJS))
-START  := $(addprefix $(obj),$(START))
-
-all:   $(obj).depend $(START) $(LIB)
-
-$(LIB):$(OBJS)
-   $(call cmd_link_o_target, $(OBJS))
-
-#
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#
+extra-y= start.o
+obj-y  = cpu.o
diff --git a/arch/arm/cpu/arm1136/mx31/Makefile 
b/arch/arm/cpu/arm1136/mx31/Makefile
index c75adec..9670ed9 100644
--- a/arch/arm/cpu/arm1136/mx31/Makefile
+++ b/arch/arm/cpu/arm1136/mx31/Makefile
@@ -5,27 +5,6 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB= $(obj)lib$(SOC).o
-
-COBJS  += generic.o
-COBJS  += timer.o
-COBJS  += devices.o
-
-SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
-
-all:   $(obj).depend $(LIB)
-
-$(LIB):$(OBJS)
-   $(call cmd_link_o_target, $(OBJS))
-
-#
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#
+obj-y  += generic.o
+obj-y  += timer.o
+obj-y  += devices.o
diff --git a/arch/arm/cpu/arm1136/mx35/Makefile 
b/arch/arm/cpu/arm1136/mx35/Makefile
index ee534a9..c533215 100644
--- a/arch/arm/cpu/arm1136/mx35/Makefile
+++ b/arch/arm/cpu/arm1136/mx35/Makefile
@@ -7,28 +7,6 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB= $(obj)lib$(SOC).o
-
-COBJS  += generic.o
-COBJS  += timer.o
-COBJS  += mx35_sdram.o
-
-SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
-
-all:   $(obj).depend $(LIB)
-
-$(LIB):$(OBJS)
-   $(call cmd_link_o_target, $(OBJS))
-
-
-#
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#
+obj-y  += generic.o
+obj-y  += timer.o
+obj-y  += mx35_sdram.o
diff --git a/arch/arm/cpu/arm1176/Makefile b/arch/arm/cpu/arm1176/Makefile
index 5d451a7..deec427 100644
--- a/arch/arm/cpu/arm1176/Makefile
+++ b/arch/arm/cpu/arm1176/Makefile
@@ -8,27 +8,5 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB= $(obj)lib$(CPU).o
-
-START  = start.o
-COBJS  = cpu.o
-
-SRCS   := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS   := $(addprefix $(obj),$(COBJS) $(SOBJS))
-START  := $(addprefix $(obj),$(START))
-
-all:   $(obj).depend $(START) $(LIB)
-
-$(LIB):$(OBJS)
-   $(call cmd_link_o_target, $(OBJS))
-
-#
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#
+extra-y= start.o
+obj-y  = cpu.o
diff --git a/arch/arm/cpu/arm1176/bcm2835/Makefile 
b/arch/arm/cpu/arm1176/bcm2835/Makefile
index 135de42..0ad3690 100644
--- a/arch/arm/cpu/arm1176/bcm2835/Makefile
+++ b/arch/arm/cpu/arm1176/bcm2835/Makefile
@@ -12,26 +12,5 @@
 # GNU General Public License for more details.
 #
 
-include $(TOPDIR)/config.mk
-
-LIB= $(obj)lib$(SOC).o
-
-SOBJS  := 

[U-Boot] [PATCH 08/19] drivers: net: convert makefiles to Kbuild style

2013-09-07 Thread Masahiro Yamada
Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---
 drivers/net/Makefile | 136 ---
 drivers/net/fm/Makefile  |  59 +++-
 drivers/net/npe/Makefile |  24 +
 drivers/net/phy/Makefile |  60 +++--
 4 files changed, 96 insertions(+), 183 deletions(-)

diff --git a/drivers/net/Makefile b/drivers/net/Makefile
index 18fd54f..7f9ce90 100644
--- a/drivers/net/Makefile
+++ b/drivers/net/Makefile
@@ -5,83 +5,61 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB:= $(obj)libnet.o
-
-COBJS-$(CONFIG_PPC4xx_EMAC) += 4xx_enet.o
-COBJS-$(CONFIG_ALTERA_TSE) += altera_tse.o
-COBJS-$(CONFIG_ARMADA100_FEC) += armada100_fec.o
-COBJS-$(CONFIG_DRIVER_AT91EMAC) += at91_emac.o
-COBJS-$(CONFIG_DRIVER_AX88180) += ax88180.o
-COBJS-$(CONFIG_BFIN_MAC) += bfin_mac.o
-COBJS-$(CONFIG_CALXEDA_XGMAC) += calxedaxgmac.o
-COBJS-$(CONFIG_CS8900) += cs8900.o
-COBJS-$(CONFIG_TULIP) += dc2114x.o
-COBJS-$(CONFIG_DESIGNWARE_ETH) += designware.o
-COBJS-$(CONFIG_DRIVER_DM9000) += dm9000x.o
-COBJS-$(CONFIG_DNET) += dnet.o
-COBJS-$(CONFIG_E1000) += e1000.o
-COBJS-$(CONFIG_E1000_SPI) += e1000_spi.o
-COBJS-$(CONFIG_EEPRO100) += eepro100.o
-COBJS-$(CONFIG_ENC28J60) += enc28j60.o
-COBJS-$(CONFIG_EP93XX) += ep93xx_eth.o
-COBJS-$(CONFIG_ETHOC) += ethoc.o
-COBJS-$(CONFIG_FEC_MXC) += fec_mxc.o
-COBJS-$(CONFIG_FSLDMAFEC) += fsl_mcdmafec.o mcfmii.o
-COBJS-$(CONFIG_FTGMAC100) += ftgmac100.o
-COBJS-$(CONFIG_FTMAC110) += ftmac110.o
-COBJS-$(CONFIG_FTMAC100) += ftmac100.o
-COBJS-$(CONFIG_GRETH) += greth.o
-COBJS-$(CONFIG_INCA_IP_SWITCH) += inca-ip_sw.o
-COBJS-$(CONFIG_DRIVER_KS8695ETH) += ks8695eth.o
-COBJS-$(CONFIG_KS8851_MLL) += ks8851_mll.o
-COBJS-$(CONFIG_LAN91C96) += lan91c96.o
-COBJS-$(CONFIG_MACB) += macb.o
-COBJS-$(CONFIG_MCFFEC) += mcffec.o mcfmii.o
-COBJS-$(CONFIG_MPC5xxx_FEC) += mpc5xxx_fec.o
-COBJS-$(CONFIG_MPC512x_FEC) += mpc512x_fec.o
-COBJS-$(CONFIG_MVGBE) += mvgbe.o
-COBJS-$(CONFIG_NATSEMI) += natsemi.o
-COBJS-$(CONFIG_DRIVER_NE2000) += ne2000.o ne2000_base.o
-COBJS-$(CONFIG_DRIVER_AX88796L) += ax88796.o ne2000_base.o
-COBJS-$(CONFIG_NETCONSOLE) += netconsole.o
-COBJS-$(CONFIG_NS8382X) += ns8382x.o
-COBJS-$(CONFIG_PCNET) += pcnet.o
-COBJS-$(CONFIG_PLB2800_ETHER) += plb2800_eth.o
-COBJS-$(CONFIG_RTL8139) += rtl8139.o
-COBJS-$(CONFIG_RTL8169) += rtl8169.o
-COBJS-$(CONFIG_SH_ETHER) += sh_eth.o
-COBJS-$(CONFIG_SMC9) += smc9.o
-COBJS-$(CONFIG_SMC911X) += smc911x.o
-COBJS-$(CONFIG_SUNXI_WEMAC) += sunxi_wemac.o
-COBJS-$(CONFIG_DRIVER_TI_EMAC) += davinci_emac.o
-COBJS-$(CONFIG_TSEC_ENET) += tsec.o fsl_mdio.o
-COBJS-$(CONFIG_DRIVER_TI_CPSW) += cpsw.o
-COBJS-$(CONFIG_FMAN_ENET) += fsl_mdio.o
-COBJS-$(CONFIG_TSI108_ETH) += tsi108_eth.o
-COBJS-$(CONFIG_ULI526X) += uli526x.o
-COBJS-$(CONFIG_VSC7385_ENET) += vsc7385.o
-COBJS-$(CONFIG_XILINX_AXIEMAC) += xilinx_axi_emac.o
-COBJS-$(CONFIG_XILINX_EMACLITE) += xilinx_emaclite.o
-COBJS-$(CONFIG_XILINX_LL_TEMAC) += xilinx_ll_temac.o xilinx_ll_temac_mdio.o \
+obj-$(CONFIG_PPC4xx_EMAC) += 4xx_enet.o
+obj-$(CONFIG_ALTERA_TSE) += altera_tse.o
+obj-$(CONFIG_ARMADA100_FEC) += armada100_fec.o
+obj-$(CONFIG_DRIVER_AT91EMAC) += at91_emac.o
+obj-$(CONFIG_DRIVER_AX88180) += ax88180.o
+obj-$(CONFIG_BFIN_MAC) += bfin_mac.o
+obj-$(CONFIG_CALXEDA_XGMAC) += calxedaxgmac.o
+obj-$(CONFIG_CS8900) += cs8900.o
+obj-$(CONFIG_TULIP) += dc2114x.o
+obj-$(CONFIG_DESIGNWARE_ETH) += designware.o
+obj-$(CONFIG_DRIVER_DM9000) += dm9000x.o
+obj-$(CONFIG_DNET) += dnet.o
+obj-$(CONFIG_E1000) += e1000.o
+obj-$(CONFIG_E1000_SPI) += e1000_spi.o
+obj-$(CONFIG_EEPRO100) += eepro100.o
+obj-$(CONFIG_ENC28J60) += enc28j60.o
+obj-$(CONFIG_EP93XX) += ep93xx_eth.o
+obj-$(CONFIG_ETHOC) += ethoc.o
+obj-$(CONFIG_FEC_MXC) += fec_mxc.o
+obj-$(CONFIG_FSLDMAFEC) += fsl_mcdmafec.o mcfmii.o
+obj-$(CONFIG_FTGMAC100) += ftgmac100.o
+obj-$(CONFIG_FTMAC110) += ftmac110.o
+obj-$(CONFIG_FTMAC100) += ftmac100.o
+obj-$(CONFIG_GRETH) += greth.o
+obj-$(CONFIG_INCA_IP_SWITCH) += inca-ip_sw.o
+obj-$(CONFIG_DRIVER_KS8695ETH) += ks8695eth.o
+obj-$(CONFIG_KS8851_MLL) += ks8851_mll.o
+obj-$(CONFIG_LAN91C96) += lan91c96.o
+obj-$(CONFIG_MACB) += macb.o
+obj-$(CONFIG_MCFFEC) += mcffec.o mcfmii.o
+obj-$(CONFIG_MPC5xxx_FEC) += mpc5xxx_fec.o
+obj-$(CONFIG_MPC512x_FEC) += mpc512x_fec.o
+obj-$(CONFIG_MVGBE) += mvgbe.o
+obj-$(CONFIG_NATSEMI) += natsemi.o
+obj-$(CONFIG_DRIVER_NE2000) += ne2000.o ne2000_base.o
+obj-$(CONFIG_DRIVER_AX88796L) += ax88796.o ne2000_base.o
+obj-$(CONFIG_NETCONSOLE) += netconsole.o
+obj-$(CONFIG_NS8382X) += ns8382x.o
+obj-$(CONFIG_PCNET) += pcnet.o
+obj-$(CONFIG_PLB2800_ETHER) += plb2800_eth.o
+obj-$(CONFIG_RTL8139) += rtl8139.o
+obj-$(CONFIG_RTL8169) += rtl8169.o
+obj-$(CONFIG_SH_ETHER) += sh_eth.o
+obj-$(CONFIG_SMC9) += smc9.o
+obj-$(CONFIG_SMC911X) += smc911x.o
+obj-$(CONFIG_SUNXI_WEMAC) += sunxi_wemac.o
+obj-$(CONFIG_DRIVER_TI_EMAC) += davinci_emac.o
+obj-$(CONFIG_TSEC_ENET) += tsec.o fsl_mdio.o

[U-Boot] [PATCH 13/19] common: convert makefiles to Kbuild style

2013-09-07 Thread Masahiro Yamada
Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---
 common/Makefile | 389 
 common/spl/Makefile |  36 +
 2 files changed, 189 insertions(+), 236 deletions(-)

diff --git a/common/Makefile b/common/Makefile
index 288690b..745d447 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -5,215 +5,211 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB= $(obj)libcommon.o
-
 # core
 ifndef CONFIG_SPL_BUILD
-COBJS-y += main.o
-COBJS-y += command.o
-COBJS-y += exports.o
-COBJS-y += hash.o
-COBJS-$(CONFIG_SYS_HUSH_PARSER) += hush.o
-COBJS-y += s_record.o
-COBJS-y += xyzModem.o
-COBJS-y += cmd_disk.o
+obj-y += main.o
+obj-y += command.o
+obj-y += exports.o
+obj-y += hash.o
+obj-$(CONFIG_SYS_HUSH_PARSER) += hush.o
+obj-y += s_record.o
+obj-y += xyzModem.o
+obj-y += cmd_disk.o
 
 # boards
-COBJS-$(CONFIG_SYS_GENERIC_BOARD) += board_f.o
-COBJS-$(CONFIG_SYS_GENERIC_BOARD) += board_r.o
+obj-$(CONFIG_SYS_GENERIC_BOARD) += board_f.o
+obj-$(CONFIG_SYS_GENERIC_BOARD) += board_r.o
 
 # core command
-COBJS-y += cmd_boot.o
-COBJS-$(CONFIG_CMD_BOOTM) += cmd_bootm.o
-COBJS-y += cmd_help.o
-COBJS-y += cmd_version.o
+obj-y += cmd_boot.o
+obj-$(CONFIG_CMD_BOOTM) += cmd_bootm.o
+obj-y += cmd_help.o
+obj-y += cmd_version.o
 
 # environment
-COBJS-y += env_attr.o
-COBJS-y += env_callback.o
-COBJS-y += env_flags.o
-COBJS-$(CONFIG_ENV_IS_IN_DATAFLASH) += env_dataflash.o
-COBJS-$(CONFIG_ENV_IS_IN_EEPROM) += env_eeprom.o
-XCOBJS-$(CONFIG_ENV_IS_EMBEDDED) += env_embedded.o
-COBJS-$(CONFIG_ENV_IS_IN_EEPROM) += env_embedded.o
-XCOBJS-$(CONFIG_ENV_IS_IN_FLASH) += env_embedded.o
-COBJS-$(CONFIG_ENV_IS_IN_NVRAM) += env_embedded.o
-COBJS-$(CONFIG_ENV_IS_IN_FLASH) += env_flash.o
-COBJS-$(CONFIG_ENV_IS_IN_MMC) += env_mmc.o
-COBJS-$(CONFIG_ENV_IS_IN_FAT) += env_fat.o
-COBJS-$(CONFIG_ENV_IS_IN_NAND) += env_nand.o
-COBJS-$(CONFIG_ENV_IS_IN_NVRAM) += env_nvram.o
-COBJS-$(CONFIG_ENV_IS_IN_ONENAND) += env_onenand.o
-COBJS-$(CONFIG_ENV_IS_IN_SPI_FLASH) += env_sf.o
-COBJS-$(CONFIG_ENV_IS_IN_REMOTE) += env_remote.o
-COBJS-$(CONFIG_ENV_IS_IN_UBI) += env_ubi.o
-COBJS-$(CONFIG_ENV_IS_NOWHERE) += env_nowhere.o
+obj-y += env_attr.o
+obj-y += env_callback.o
+obj-y += env_flags.o
+obj-$(CONFIG_ENV_IS_IN_DATAFLASH) += env_dataflash.o
+obj-$(CONFIG_ENV_IS_IN_EEPROM) += env_eeprom.o
+extra-$(CONFIG_ENV_IS_EMBEDDED) += env_embedded.o
+obj-$(CONFIG_ENV_IS_IN_EEPROM) += env_embedded.o
+extra-$(CONFIG_ENV_IS_IN_FLASH) += env_embedded.o
+obj-$(CONFIG_ENV_IS_IN_NVRAM) += env_embedded.o
+obj-$(CONFIG_ENV_IS_IN_FLASH) += env_flash.o
+obj-$(CONFIG_ENV_IS_IN_MMC) += env_mmc.o
+obj-$(CONFIG_ENV_IS_IN_FAT) += env_fat.o
+obj-$(CONFIG_ENV_IS_IN_NAND) += env_nand.o
+obj-$(CONFIG_ENV_IS_IN_NVRAM) += env_nvram.o
+obj-$(CONFIG_ENV_IS_IN_ONENAND) += env_onenand.o
+obj-$(CONFIG_ENV_IS_IN_SPI_FLASH) += env_sf.o
+obj-$(CONFIG_ENV_IS_IN_REMOTE) += env_remote.o
+obj-$(CONFIG_ENV_IS_IN_UBI) += env_ubi.o
+obj-$(CONFIG_ENV_IS_NOWHERE) += env_nowhere.o
 
 # command
-COBJS-$(CONFIG_CMD_AMBAPP) += cmd_ambapp.o
-COBJS-$(CONFIG_SOURCE) += cmd_source.o
-COBJS-$(CONFIG_CMD_SOURCE) += cmd_source.o
-COBJS-$(CONFIG_CMD_BDI) += cmd_bdinfo.o
-COBJS-$(CONFIG_CMD_BEDBUG) += bedbug.o cmd_bedbug.o
-COBJS-$(CONFIG_CMD_BMP) += cmd_bmp.o
-COBJS-$(CONFIG_CMD_BOOTMENU) += cmd_bootmenu.o
-COBJS-$(CONFIG_CMD_BOOTLDR) += cmd_bootldr.o
-COBJS-$(CONFIG_CMD_BOOTSTAGE) += cmd_bootstage.o
-COBJS-$(CONFIG_CMD_CACHE) += cmd_cache.o
-COBJS-$(CONFIG_CMD_CBFS) += cmd_cbfs.o
-COBJS-$(CONFIG_CMD_CONSOLE) += cmd_console.o
-COBJS-$(CONFIG_CMD_CPLBINFO) += cmd_cplbinfo.o
-COBJS-$(CONFIG_DATAFLASH_MMC_SELECT) += cmd_dataflash_mmc_mux.o
-COBJS-$(CONFIG_CMD_DATE) += cmd_date.o
-COBJS-$(CONFIG_CMD_SOUND) += cmd_sound.o
+obj-$(CONFIG_CMD_AMBAPP) += cmd_ambapp.o
+obj-$(CONFIG_SOURCE) += cmd_source.o
+obj-$(CONFIG_CMD_SOURCE) += cmd_source.o
+obj-$(CONFIG_CMD_BDI) += cmd_bdinfo.o
+obj-$(CONFIG_CMD_BEDBUG) += bedbug.o cmd_bedbug.o
+obj-$(CONFIG_CMD_BMP) += cmd_bmp.o
+obj-$(CONFIG_CMD_BOOTMENU) += cmd_bootmenu.o
+obj-$(CONFIG_CMD_BOOTLDR) += cmd_bootldr.o
+obj-$(CONFIG_CMD_BOOTSTAGE) += cmd_bootstage.o
+obj-$(CONFIG_CMD_CACHE) += cmd_cache.o
+obj-$(CONFIG_CMD_CBFS) += cmd_cbfs.o
+obj-$(CONFIG_CMD_CONSOLE) += cmd_console.o
+obj-$(CONFIG_CMD_CPLBINFO) += cmd_cplbinfo.o
+obj-$(CONFIG_DATAFLASH_MMC_SELECT) += cmd_dataflash_mmc_mux.o
+obj-$(CONFIG_CMD_DATE) += cmd_date.o
+obj-$(CONFIG_CMD_SOUND) += cmd_sound.o
 ifdef CONFIG_4xx
-COBJS-$(CONFIG_CMD_SETGETDCR) += cmd_dcr.o
+obj-$(CONFIG_CMD_SETGETDCR) += cmd_dcr.o
 endif
 ifdef CONFIG_POST
-COBJS-$(CONFIG_CMD_DIAG) += cmd_diag.o
+obj-$(CONFIG_CMD_DIAG) += cmd_diag.o
 endif
-COBJS-$(CONFIG_CMD_DISPLAY) += cmd_display.o
-COBJS-$(CONFIG_CMD_DTT) += cmd_dtt.o
-COBJS-$(CONFIG_CMD_ECHO) += cmd_echo.o
-COBJS-$(CONFIG_ENV_IS_IN_EEPROM) += cmd_eeprom.o
-COBJS-$(CONFIG_CMD_EEPROM) += cmd_eeprom.o
-COBJS-$(CONFIG_CMD_ELF) += cmd_elf.o
-COBJS-$(CONFIG_SYS_HUSH_PARSER) += cmd_exit.o

[U-Boot] [PATCH 11/19] drivers: convert makefiles to Kbuild style

2013-09-07 Thread Masahiro Yamada
Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---
 drivers/bios_emulator/Makefile|  23 +---
 drivers/block/Makefile|  52 ++
 drivers/bootcount/Makefile|  30 ++-
 drivers/crypto/Makefile   |  25 +
 drivers/dfu/Makefile  |  25 ++---
 drivers/dma/Makefile  |  30 ++-
 drivers/fpga/Makefile |  44 ---
 drivers/gpio/Makefile |  73 +
 drivers/hwmon/Makefile|  40 --
 drivers/i2c/Makefile  |  70 +---
 drivers/input/Makefile|  36 +++--
 drivers/misc/Makefile |  52 ++
 drivers/mmc/Makefile  |  69 
 drivers/pci/Makefile  |  44 ---
 drivers/pcmcia/Makefile   |  34 +++-
 drivers/power/Makefile|  47 +---
 drivers/power/battery/Makefile|  25 +
 drivers/power/fuel_gauge/Makefile |  25 +
 drivers/power/pmic/Makefile   |  31 ++-
 drivers/qe/Makefile   |  25 +
 drivers/rtc/Makefile  | 110 +++---
 drivers/serial/Makefile   |  82 +++-
 drivers/sound/Makefile|  30 ++-
 drivers/spi/Makefile  |  82 +++-
 drivers/tpm/Makefile  |  29 ++
 drivers/twserial/Makefile |  24 +
 drivers/video/Makefile|  84 +++--
 drivers/watchdog/Makefile |  36 +++--
 28 files changed, 331 insertions(+), 946 deletions(-)

diff --git a/drivers/bios_emulator/Makefile b/drivers/bios_emulator/Makefile
index d94a144..dd42e0f 100644
--- a/drivers/bios_emulator/Makefile
+++ b/drivers/bios_emulator/Makefile
@@ -1,12 +1,8 @@
-include $(TOPDIR)/config.mk
-
-LIB := $(obj)libatibiosemu.o
-
 X86DIR  = x86emu
 
 $(shell mkdir -p $(obj)$(X86DIR))
 
-COBJS-$(CONFIG_BIOSEMU)= atibios.o biosemu.o besys.o bios.o \
+obj-$(CONFIG_BIOSEMU)  = atibios.o biosemu.o besys.o bios.o \
$(X86DIR)/decode.o \
$(X86DIR)/ops2.o \
$(X86DIR)/ops.o \
@@ -14,26 +10,9 @@ COBJS-$(CONFIG_BIOSEMU)  = atibios.o biosemu.o besys.o 
bios.o \
$(X86DIR)/sys.o \
$(X86DIR)/debug.o
 
-COBJS  := $(COBJS-y)
-SRCS   := $(COBJS:.o=.c)
-OBJS   := $(addprefix $(obj),$(COBJS))
-
 EXTRA_CFLAGS += -I. -I./include -I$(TOPDIR)/include \
-D__PPC__  -D__BIG_ENDIAN__
 
 CFLAGS += $(EXTRA_CFLAGS)
 HOSTCFLAGS += $(EXTRA_CFLAGS)
 CPPFLAGS += $(EXTRA_CFLAGS)
-
-all:   $(LIB)
-
-$(LIB): $(obj).depend $(OBJS)
-   $(call cmd_link_o_target, $(OBJS))
-
-#
-
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#
diff --git a/drivers/block/Makefile b/drivers/block/Makefile
index 2016e98..4e94378 100644
--- a/drivers/block/Makefile
+++ b/drivers/block/Makefile
@@ -5,40 +5,18 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB:= $(obj)libblock.o
-
-COBJS-$(CONFIG_SCSI_AHCI) += ahci.o
-COBJS-$(CONFIG_ATA_PIIX) += ata_piix.o
-COBJS-$(CONFIG_DWC_AHSATA) += dwc_ahsata.o
-COBJS-$(CONFIG_FSL_SATA) += fsl_sata.o
-COBJS-$(CONFIG_IDE_FTIDE020) += ftide020.o
-COBJS-$(CONFIG_LIBATA) += libata.o
-COBJS-$(CONFIG_MVSATA_IDE) += mvsata_ide.o
-COBJS-$(CONFIG_MX51_PATA) += mxc_ata.o
-COBJS-$(CONFIG_PATA_BFIN) += pata_bfin.o
-COBJS-$(CONFIG_SATA_DWC) += sata_dwc.o
-COBJS-$(CONFIG_SATA_SIL3114) += sata_sil3114.o
-COBJS-$(CONFIG_SATA_SIL) += sata_sil.o
-COBJS-$(CONFIG_IDE_SIL680) += sil680.o
-COBJS-$(CONFIG_SCSI_SYM53C8XX) += sym53c8xx.o
-COBJS-$(CONFIG_SYSTEMACE) += systemace.o
-
-COBJS  := $(COBJS-y)
-SRCS   := $(COBJS:.o=.c)
-OBJS   := $(addprefix $(obj),$(COBJS))
-
-all:   $(LIB)
-
-$(LIB):$(obj).depend $(OBJS)
-   $(call cmd_link_o_target, $(OBJS))
-
-#
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#
+obj-$(CONFIG_SCSI_AHCI) += ahci.o
+obj-$(CONFIG_ATA_PIIX) += ata_piix.o
+obj-$(CONFIG_DWC_AHSATA) += dwc_ahsata.o
+obj-$(CONFIG_FSL_SATA) += fsl_sata.o
+obj-$(CONFIG_IDE_FTIDE020) += ftide020.o
+obj-$(CONFIG_LIBATA) += libata.o
+obj-$(CONFIG_MVSATA_IDE) += mvsata_ide.o
+obj-$(CONFIG_MX51_PATA) += mxc_ata.o
+obj-$(CONFIG_PATA_BFIN) += pata_bfin.o
+obj-$(CONFIG_SATA_DWC) += sata_dwc.o
+obj-$(CONFIG_SATA_SIL3114) += sata_sil3114.o
+obj-$(CONFIG_SATA_SIL) += sata_sil.o
+obj-$(CONFIG_IDE_SIL680) += sil680.o
+obj-$(CONFIG_SCSI_SYM53C8XX) += sym53c8xx.o
+obj-$(CONFIG_SYSTEMACE) += systemace.o
diff --git a/drivers/bootcount/Makefile b/drivers/bootcount/Makefile
index 

[U-Boot] [PATCH 09/19] drivers: mtd: convert makefiles to Kbuild style

2013-09-07 Thread Masahiro Yamada
Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---
 drivers/mtd/Makefile |  44 +--
 drivers/mtd/nand/Makefile| 102 +--
 drivers/mtd/onenand/Makefile |  27 ++--
 drivers/mtd/spi/Makefile |  48 ++--
 drivers/mtd/ubi/Makefile |  28 ++--
 5 files changed, 70 insertions(+), 179 deletions(-)

diff --git a/drivers/mtd/Makefile b/drivers/mtd/Makefile
index d2c3bda..5467a95 100644
--- a/drivers/mtd/Makefile
+++ b/drivers/mtd/Makefile
@@ -5,38 +5,16 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB:= $(obj)libmtd.o
-
 ifneq (,$(findstring 
y,$(CONFIG_MTD_DEVICE)$(CONFIG_CMD_NAND)$(CONFIG_CMD_ONENAND)))
-COBJS-y += mtdcore.o
+obj-y += mtdcore.o
 endif
-COBJS-$(CONFIG_MTD_PARTITIONS) += mtdpart.o
-COBJS-$(CONFIG_MTD_CONCAT) += mtdconcat.o
-COBJS-$(CONFIG_HAS_DATAFLASH) += at45.o
-COBJS-$(CONFIG_FLASH_CFI_DRIVER) += cfi_flash.o
-COBJS-$(CONFIG_FLASH_CFI_MTD) += cfi_mtd.o
-COBJS-$(CONFIG_HAS_DATAFLASH) += dataflash.o
-COBJS-$(CONFIG_FTSMC020) += ftsmc020.o
-COBJS-$(CONFIG_FLASH_CFI_LEGACY) += jedec_flash.o
-COBJS-$(CONFIG_MW_EEPROM) += mw_eeprom.o
-COBJS-$(CONFIG_ST_SMI) += st_smi.o
-
-COBJS  := $(COBJS-y)
-SRCS   := $(COBJS:.o=.c)
-OBJS   := $(addprefix $(obj),$(COBJS))
-
-all:   $(LIB)
-
-$(LIB):$(obj).depend $(OBJS)
-   $(call cmd_link_o_target, $(OBJS))
-
-#
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#
+obj-$(CONFIG_MTD_PARTITIONS) += mtdpart.o
+obj-$(CONFIG_MTD_CONCAT) += mtdconcat.o
+obj-$(CONFIG_HAS_DATAFLASH) += at45.o
+obj-$(CONFIG_FLASH_CFI_DRIVER) += cfi_flash.o
+obj-$(CONFIG_FLASH_CFI_MTD) += cfi_mtd.o
+obj-$(CONFIG_HAS_DATAFLASH) += dataflash.o
+obj-$(CONFIG_FTSMC020) += ftsmc020.o
+obj-$(CONFIG_FLASH_CFI_LEGACY) += jedec_flash.o
+obj-$(CONFIG_MW_EEPROM) += mw_eeprom.o
+obj-$(CONFIG_ST_SMI) += st_smi.o
diff --git a/drivers/mtd/nand/Makefile b/drivers/mtd/nand/Makefile
index 366dee6..eb1eafa 100644
--- a/drivers/mtd/nand/Makefile
+++ b/drivers/mtd/nand/Makefile
@@ -5,10 +5,6 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB:= $(obj)libnand.o
-
 ifdef CONFIG_CMD_NAND
 
 ifdef CONFIG_SPL_BUILD
@@ -17,77 +13,59 @@ ifdef CONFIG_SPL_NAND_DRIVERS
 NORMAL_DRIVERS=y
 endif
 
-COBJS-$(CONFIG_SPL_NAND_AM33XX_BCH) += am335x_spl_bch.o
-COBJS-$(CONFIG_SPL_NAND_DOCG4) += docg4_spl.o
-COBJS-$(CONFIG_SPL_NAND_SIMPLE) += nand_spl_simple.o
-COBJS-$(CONFIG_SPL_NAND_LOAD) += nand_spl_load.o
-COBJS-$(CONFIG_SPL_NAND_ECC) += nand_ecc.o
-COBJS-$(CONFIG_SPL_NAND_BASE) += nand_base.o
-COBJS-$(CONFIG_SPL_NAND_INIT) += nand.o
+obj-$(CONFIG_SPL_NAND_AM33XX_BCH) += am335x_spl_bch.o
+obj-$(CONFIG_SPL_NAND_DOCG4) += docg4_spl.o
+obj-$(CONFIG_SPL_NAND_SIMPLE) += nand_spl_simple.o
+obj-$(CONFIG_SPL_NAND_LOAD) += nand_spl_load.o
+obj-$(CONFIG_SPL_NAND_ECC) += nand_ecc.o
+obj-$(CONFIG_SPL_NAND_BASE) += nand_base.o
+obj-$(CONFIG_SPL_NAND_INIT) += nand.o
 
 else # not spl
 
 NORMAL_DRIVERS=y
 
-COBJS-y += nand.o
-COBJS-y += nand_bbt.o
-COBJS-y += nand_ids.o
-COBJS-y += nand_util.o
-COBJS-y += nand_ecc.o
-COBJS-y += nand_base.o
+obj-y += nand.o
+obj-y += nand_bbt.o
+obj-y += nand_ids.o
+obj-y += nand_util.o
+obj-y += nand_ecc.o
+obj-y += nand_base.o
 
 endif # not spl
 
 ifdef NORMAL_DRIVERS
 
-COBJS-$(CONFIG_NAND_ECC_BCH) += nand_bch.o
-
-COBJS-$(CONFIG_NAND_ATMEL) += atmel_nand.o
-COBJS-$(CONFIG_DRIVER_NAND_BFIN) += bfin_nand.o
-COBJS-$(CONFIG_NAND_DAVINCI) += davinci_nand.o
-COBJS-$(CONFIG_NAND_FSL_ELBC) += fsl_elbc_nand.o
-COBJS-$(CONFIG_NAND_FSL_IFC) += fsl_ifc_nand.o
-COBJS-$(CONFIG_NAND_FSL_UPM) += fsl_upm.o
-COBJS-$(CONFIG_NAND_FSMC) += fsmc_nand.o
-COBJS-$(CONFIG_NAND_JZ4740) += jz4740_nand.o
-COBJS-$(CONFIG_NAND_KB9202) += kb9202_nand.o
-COBJS-$(CONFIG_NAND_KIRKWOOD) += kirkwood_nand.o
-COBJS-$(CONFIG_NAND_KMETER1) += kmeter1_nand.o
-COBJS-$(CONFIG_NAND_MPC5121_NFC) += mpc5121_nfc.o
-COBJS-$(CONFIG_NAND_MXC) += mxc_nand.o
-COBJS-$(CONFIG_NAND_MXS) += mxs_nand.o
-COBJS-$(CONFIG_NAND_NDFC) += ndfc.o
-COBJS-$(CONFIG_NAND_NOMADIK) += nomadik.o
-COBJS-$(CONFIG_NAND_S3C2410) += s3c2410_nand.o
-COBJS-$(CONFIG_NAND_SPEAR) += spr_nand.o
-COBJS-$(CONFIG_TEGRA_NAND) += tegra_nand.o
-COBJS-$(CONFIG_NAND_OMAP_GPMC) += omap_gpmc.o
-COBJS-$(CONFIG_NAND_PLAT) += nand_plat.o
-COBJS-$(CONFIG_NAND_DOCG4) += docg4.o
+obj-$(CONFIG_NAND_ECC_BCH) += nand_bch.o
+
+obj-$(CONFIG_NAND_ATMEL) += atmel_nand.o
+obj-$(CONFIG_DRIVER_NAND_BFIN) += bfin_nand.o
+obj-$(CONFIG_NAND_DAVINCI) += davinci_nand.o
+obj-$(CONFIG_NAND_FSL_ELBC) += fsl_elbc_nand.o
+obj-$(CONFIG_NAND_FSL_IFC) += fsl_ifc_nand.o
+obj-$(CONFIG_NAND_FSL_UPM) += fsl_upm.o
+obj-$(CONFIG_NAND_FSMC) += fsmc_nand.o
+obj-$(CONFIG_NAND_JZ4740) += jz4740_nand.o
+obj-$(CONFIG_NAND_KB9202) += kb9202_nand.o

[U-Boot] [PATCH 05/19] arm720t: convert makefiles to Kbuild style

2013-09-07 Thread Masahiro Yamada
Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---
 arch/arm/cpu/arm720t/Makefile  | 26 ++
 arch/arm/cpu/arm720t/tegra-common/Makefile | 25 ++---
 arch/arm/cpu/arm720t/tegra114/Makefile | 25 ++---
 arch/arm/cpu/arm720t/tegra20/Makefile  | 23 +--
 arch/arm/cpu/arm720t/tegra30/Makefile  | 23 +--
 5 files changed, 8 insertions(+), 114 deletions(-)

diff --git a/arch/arm/cpu/arm720t/Makefile b/arch/arm/cpu/arm720t/Makefile
index 73e1635..243a123 100644
--- a/arch/arm/cpu/arm720t/Makefile
+++ b/arch/arm/cpu/arm720t/Makefile
@@ -5,27 +5,5 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB= $(obj)lib$(CPU).o
-
-START  = start.o
-COBJS  = interrupts.o cpu.o
-
-SRCS   := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS   := $(addprefix $(obj),$(COBJS) $(SOBJS))
-START  := $(addprefix $(obj),$(START))
-
-all:   $(obj).depend $(START) $(LIB)
-
-$(LIB):$(OBJS)
-   $(call cmd_link_o_target, $(OBJS))
-
-#
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#
+extra-y= start.o
+obj-y  = interrupts.o cpu.o
diff --git a/arch/arm/cpu/arm720t/tegra-common/Makefile 
b/arch/arm/cpu/arm720t/tegra-common/Makefile
index 37ec43f..a9c2b67 100644
--- a/arch/arm/cpu/arm720t/tegra-common/Makefile
+++ b/arch/arm/cpu/arm720t/tegra-common/Makefile
@@ -7,26 +7,5 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB= $(obj)libtegra-common.o
-
-COBJS-$(CONFIG_SPL_BUILD) += spl.o
-COBJS-y+= cpu.o
-
-SRCS   := $(COBJS-y:.o=.c)
-OBJS   := $(addprefix $(obj),$(COBJS-y))
-
-all:   $(obj).depend $(LIB)
-
-$(LIB):$(OBJS)
-   $(call cmd_link_o_target, $(OBJS))
-
-#
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#
+obj-$(CONFIG_SPL_BUILD) += spl.o
+obj-y  += cpu.o
diff --git a/arch/arm/cpu/arm720t/tegra114/Makefile 
b/arch/arm/cpu/arm720t/tegra114/Makefile
index 6cf7fe9..ea3e55e 100644
--- a/arch/arm/cpu/arm720t/tegra114/Makefile
+++ b/arch/arm/cpu/arm720t/tegra114/Makefile
@@ -17,26 +17,5 @@
 # along with this program.  If not, see http://www.gnu.org/licenses/.
 #
 
-include $(TOPDIR)/config.mk
-
-LIB= $(obj)lib$(SOC).o
-
-#COBJS-y   += cpu.o t11x.o
-COBJS-y+= cpu.o
-
-SRCS   := $(COBJS-y:.o=.c)
-OBJS   := $(addprefix $(obj),$(COBJS-y))
-
-all:   $(obj).depend $(LIB)
-
-$(LIB):$(OBJS)
-   $(call cmd_link_o_target, $(OBJS))
-
-#
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#
+#obj-y += cpu.o t11x.o
+obj-y  += cpu.o
diff --git a/arch/arm/cpu/arm720t/tegra20/Makefile 
b/arch/arm/cpu/arm720t/tegra20/Makefile
index eef5922..12243fa 100644
--- a/arch/arm/cpu/arm720t/tegra20/Makefile
+++ b/arch/arm/cpu/arm720t/tegra20/Makefile
@@ -7,25 +7,4 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB= $(obj)lib$(SOC).o
-
-COBJS-y+= cpu.o
-
-SRCS   := $(COBJS-y:.o=.c)
-OBJS   := $(addprefix $(obj),$(COBJS-y))
-
-all:   $(obj).depend $(LIB)
-
-$(LIB):$(OBJS)
-   $(call cmd_link_o_target, $(OBJS))
-
-#
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#
+obj-y  += cpu.o
diff --git a/arch/arm/cpu/arm720t/tegra30/Makefile 
b/arch/arm/cpu/arm720t/tegra30/Makefile
index bd96997..6ff4c55 100644
--- a/arch/arm/cpu/arm720t/tegra30/Makefile
+++ b/arch/arm/cpu/arm720t/tegra30/Makefile
@@ -17,25 +17,4 @@
 # along with this program.  If not, see http://www.gnu.org/licenses/.
 #
 
-include $(TOPDIR)/config.mk
-
-LIB= $(obj)lib$(SOC).o
-
-COBJS-y+= cpu.o
-
-SRCS   := $(COBJS-y:.o=.c)
-OBJS   := $(addprefix $(obj),$(COBJS-y))
-
-all:   $(obj).depend $(LIB)
-
-$(LIB):$(OBJS)
-   $(call cmd_link_o_target, $(OBJS))
-
-#
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#
+obj-y  += cpu.o
-- 
1.8.1.2

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 00/19] First step towards Kbuild: Use Kbuild style makefiles

2013-09-07 Thread Masahiro Yamada
Kbuild in U-Boot has been talked for a while
and RFC patches were posted by Simon Glass.

(Refer to RFC: Add Kbuild system to U-Boot
posted by Simon, May 12, 2013)

Simon's effort is a good start point but
varous critical features were missing from his patch series.

I have also been eager to introduce Kbuild to U-Boot.
So I have been working on this task for a while
with a little different migration path from Simon's way.
And I succeeded to build a few boards
with support of SPL build, Out-of-tree build,
correct output file names, which were missing from
Simon's patches.

While I were working on my local branch,
the build system and makefiles in U-Boot master repository
always kept changing, of course.

So, my fruit does not fit with the current master repository anymore.
But if someone is interested in my work,
I can push my local branch to somewhere in my GitHub space.
(RFC quality, but might be helpful for just discussions)

I recognize these patches are so rough that
they support only a few ARM boards.
Perfectly covering all architectures and all boards
without breaking any U-Boot features is a too big task
for a sigle indivisual.

Even if I could do that, the patch series would
be extremely big size and the adjustment for U-Boot
would be complecated.
So the review would probably take very long time.
Along with the review process, as time goes by,
the posted patches would become not appled to the master branch.

So we would need to repeat post, review, fix, rebase on the master
and post again, reviwe, ...
again and again for a very big patch series.

I began to be wondering it is possible to switch to Kbuild
in this way.

So I decided to begin with what I can do, one by one.
By stepping little by litte, we can get close to Kbuild
and finally we will arrive at our goal.
I think this strategy is more realistic rather than
adding a big change at one time.

Before adding a real Kbuild, I'd like to adjust our build system
in a form suitable for Kbuild.

First of all, this series convert makefiles in sub directories
to Kbuild style.

What this series do is quite simple:
 - Moving common lines in sub makefiles to a new file 'scripts/Makefile.build'
 - Renaming COBJS-y and SOBJS-y to obj-y in each sub makefile.
 - A little bit more tweaks

That's all.

0001 creates scripts/Makefile.build and tweaks Makefile and spl/Makefile
to use scripts/Makefile.build.

U-Boot conventional makefiles are like this:

include $(TOPDIR)/config.mk

LIB = $(obj)libfoo.o

COBJS := ...
COBJS += ...
SOBJS := ...

SRCS:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
OBJS:= $(addprefix $(obj),$(COBJS) $(SOBJS))

all: $(obj).depend $(LIB)

$(LIB): $(OBJS)
$(call cmd_link_o_target, $(OBJS))

#

include $(SRCTREE)/rules.mk

sinclude $(obj).depend

#


Top and bottom parts are common in almost all makefiles.
Writing those lines in all makefiles is a big waste.
So common lines have been pushed into scripts/Makefile.build.
In addition, scripts/Makefile.build includes a glue code for supporting 'obj-y'.
Be aware U-Boot conventional makefile sytle is still supported.
So we can change sub makefiles little by little in the following patches.

0002-0019 change sub makefiles into a Kbuild suitable form using obj-y.
In order to avoid creating a big patch file, they are divided
by CPU architectures and categories.

  0002-0007: refactor under arch/arm/
  0008-0016: refactor libraries which are common for all architectures
  0017 : refactor under arch/powerpc/
  0018 : refactor under board/ti/

Note arch/arm/cpu/s3c44b0/Makefile was kept untouched.
It is the remainder of dead board and should be deleted.
(See 'ARM: s3c44b0: remove remainders of dead board' posted by me Aug 19)

(I am not a maintainer of TI boards, but I just wanted to
demonstrate in 0018 for example how easily board maintainers can
do this conversion)

Conversion rule is pretty easy:

  (1) Delete common parts at top and bottom.
  (2) Rename
 COBJS  - obj-y
 SOBJS  - obj-y
 COBJS-$(CONFIG_FOO) - obj-$(CONFIG_FOO)
 SOBJS-$(CONFIG_FOO) - obj-$(CONFIG_FOO)
 START  - extra-y

We can convert almost automatically althogh in some cases
we may need to tweak a little.

I refactored more than 150 makefiles in this series.
But we still have more than 600 makefiles.
(Most of them reside under board/ directory)
We can convert them lator little by little.
Your contribution is welcome! :-)

Note1:
This series breaks _NO_ features in U-Boot.
Beucase it just moves common parts into scripts/Makefile.build

I believe no boards are broken by this refactoring, but
it is humans who can make a mistake.
So, it is very important to do build check before patches are applied.

I tested for ARM and Sandbox like this:

$ 

[U-Boot] [PATCH 14/19] net: convert a makefile to Kbuild style

2013-09-07 Thread Masahiro Yamada
Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---
 net/Makefile | 46 --
 1 file changed, 12 insertions(+), 34 deletions(-)

diff --git a/net/Makefile b/net/Makefile
index 4c9a97f..31aadc2 100644
--- a/net/Makefile
+++ b/net/Makefile
@@ -5,39 +5,17 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
 # CFLAGS += -DDEBUG
 
-LIB= $(obj)libnet.o
-
-COBJS-$(CONFIG_CMD_NET)  += arp.o
-COBJS-$(CONFIG_CMD_NET)  += bootp.o
-COBJS-$(CONFIG_CMD_CDP)  += cdp.o
-COBJS-$(CONFIG_CMD_DNS)  += dns.o
-COBJS-$(CONFIG_CMD_NET)  += eth.o
-COBJS-$(CONFIG_CMD_LINK_LOCAL) += link_local.o
-COBJS-$(CONFIG_CMD_NET)  += net.o
-COBJS-$(CONFIG_CMD_NFS)  += nfs.o
-COBJS-$(CONFIG_CMD_PING) += ping.o
-COBJS-$(CONFIG_CMD_RARP) += rarp.o
-COBJS-$(CONFIG_CMD_SNTP) += sntp.o
-COBJS-$(CONFIG_CMD_NET)  += tftp.o
-
-COBJS  := $(sort $(COBJS-y))
-SRCS   := $(COBJS:.o=.c)
-OBJS   := $(addprefix $(obj),$(COBJS))
-
-all:   $(LIB)
-
-$(LIB):$(obj).depend $(OBJS)
-   $(call cmd_link_o_target, $(OBJS))
-
-#
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#
+obj-$(CONFIG_CMD_NET)  += arp.o
+obj-$(CONFIG_CMD_NET)  += bootp.o
+obj-$(CONFIG_CMD_CDP)  += cdp.o
+obj-$(CONFIG_CMD_DNS)  += dns.o
+obj-$(CONFIG_CMD_NET)  += eth.o
+obj-$(CONFIG_CMD_LINK_LOCAL) += link_local.o
+obj-$(CONFIG_CMD_NET)  += net.o
+obj-$(CONFIG_CMD_NFS)  += nfs.o
+obj-$(CONFIG_CMD_PING) += ping.o
+obj-$(CONFIG_CMD_RARP) += rarp.o
+obj-$(CONFIG_CMD_SNTP) += sntp.o
+obj-$(CONFIG_CMD_NET)  += tftp.o
-- 
1.8.1.2

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 19/19] board: ti: convert makefiles to Kbuild style

2013-09-07 Thread Masahiro Yamada
Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
Cc: Tom Rini tr...@ti.com
---
 board/ti/am335x/Makefile   | 29 ++---
 board/ti/am3517crane/Makefile  | 19 +--
 board/ti/am43xx/Makefile   | 29 ++---
 board/ti/beagle/Makefile   | 24 ++--
 board/ti/dra7xx/Makefile   | 27 +--
 board/ti/evm/Makefile  | 19 +--
 board/ti/omap1510inn/Makefile  | 24 ++--
 board/ti/omap5912osk/Makefile  | 24 ++--
 board/ti/omap5_uevm/Makefile   | 27 +--
 board/ti/omap730p2/Makefile| 24 ++--
 board/ti/panda/Makefile| 21 +
 board/ti/sdp3430/Makefile  | 21 +
 board/ti/sdp4430/Makefile  | 23 ++-
 board/ti/ti814x/Makefile   | 29 ++---
 board/ti/ti816x/Makefile   | 27 +--
 board/ti/tnetv107xevm/Makefile | 25 +
 16 files changed, 24 insertions(+), 368 deletions(-)

diff --git a/board/ti/am335x/Makefile b/board/ti/am335x/Makefile
index 3dbeeda..c8b4f9a 100644
--- a/board/ti/am335x/Makefile
+++ b/board/ti/am335x/Makefile
@@ -6,33 +6,8 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB= $(obj)lib$(BOARD).o
-
 ifeq ($(CONFIG_SPL_BUILD)$(CONFIG_NOR_BOOT),y)
-COBJS  := mux.o
+obj-y  := mux.o
 endif
 
-COBJS  += board.o
-SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS   := $(addprefix $(obj),$(COBJS))
-SOBJS  := $(addprefix $(obj),$(SOBJS))
-
-$(LIB):$(obj).depend $(OBJS) $(SOBJS)
-   $(call cmd_link_o_target, $(OBJS) $(SOBJS))
-
-clean:
-   rm -f $(SOBJS) $(OBJS)
-
-distclean: clean
-   rm -f $(LIB) core *.bak $(obj).depend
-
-#
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#
+obj-y  += board.o
diff --git a/board/ti/am3517crane/Makefile b/board/ti/am3517crane/Makefile
index d9ab72a..9da795d 100644
--- a/board/ti/am3517crane/Makefile
+++ b/board/ti/am3517crane/Makefile
@@ -8,21 +8,4 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB= $(obj)lib$(BOARD).o
-
-COBJS  := am3517crane.o
-
-SRCS   := $(COBJS:.o=.c)
-OBJS   := $(addprefix $(obj),$(COBJS))
-
-$(LIB):$(obj).depend $(OBJS)
-   $(call cmd_link_o_target, $(OBJS))
-
-#
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
+obj-y  := am3517crane.o
diff --git a/board/ti/am43xx/Makefile b/board/ti/am43xx/Makefile
index 4a1bb7c..cb5fe88 100644
--- a/board/ti/am43xx/Makefile
+++ b/board/ti/am43xx/Makefile
@@ -6,33 +6,8 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB= $(obj)lib$(BOARD).o
-
 ifdef CONFIG_SPL_BUILD
-COBJS  := mux.o
+obj-y  := mux.o
 endif
 
-COBJS  += board.o
-SRCS   := $(COBJS:.o=.c)
-OBJS   := $(addprefix $(obj),$(COBJS))
-SOBJS  := $(addprefix $(obj),$(SOBJS))
-
-$(LIB):$(obj).depend $(OBJS) $(SOBJS)
-   $(call cmd_link_o_target, $(OBJS) $(SOBJS))
-
-clean:
-   rm -f $(SOBJS) $(OBJS)
-
-distclean: clean
-   rm -f $(LIB) core *.bak $(obj).depend
-
-#
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#
+obj-y  += board.o
diff --git a/board/ti/beagle/Makefile b/board/ti/beagle/Makefile
index 3018f6c..9f55e8f 100644
--- a/board/ti/beagle/Makefile
+++ b/board/ti/beagle/Makefile
@@ -5,25 +5,5 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB= $(obj)lib$(BOARD).o
-
-COBJS-y:= $(BOARD).o
-COBJS-$(CONFIG_STATUS_LED) += led.o
-
-COBJS  := $(sort $(COBJS-y))
-SRCS   := $(COBJS:.o=.c)
-OBJS   := $(addprefix $(obj),$(COBJS))
-
-$(LIB):$(obj).depend $(OBJS)
-   $(call cmd_link_o_target, $(OBJS))
-
-#
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#
+obj-y  := $(BOARD).o
+obj-$(CONFIG_STATUS_LED) += led.o
diff --git a/board/ti/dra7xx/Makefile b/board/ti/dra7xx/Makefile
index e558f4c..434e8d1 100644
--- a/board/ti/dra7xx/Makefile
+++ b/board/ti/dra7xx/Makefile
@@ -5,29 +5,4 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB= $(obj)lib$(BOARD).o
-
-COBJS  := evm.o
-
-SRCS   := $(COBJS:.o=.c)
-OBJS   := $(addprefix $(obj),$(COBJS))
-
-$(LIB):$(obj).depend $(OBJS)
-   

[U-Boot] [PATCH 15/19] lib: convert makefiles to Kbuild style

2013-09-07 Thread Masahiro Yamada
Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---
 lib/Makefile| 114 ++--
 lib/libfdt/Makefile |  27 +
 lib/lzma/Makefile   |  24 +--
 lib/lzo/Makefile|  24 +--
 lib/rsa/Makefile|  22 +-
 lib/tizen/Makefile  |  24 +--
 lib/zlib/Makefile   |  22 +-
 7 files changed, 54 insertions(+), 203 deletions(-)

diff --git a/lib/Makefile b/lib/Makefile
index df0cdd4..4e3b500 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -5,78 +5,58 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB= $(obj)libgeneric.o
-
 ifndef CONFIG_SPL_BUILD
-COBJS-$(CONFIG_AES) += aes.o
-COBJS-$(CONFIG_BZIP2) += bzlib.o
-COBJS-$(CONFIG_BZIP2) += bzlib_crctable.o
-COBJS-$(CONFIG_BZIP2) += bzlib_decompress.o
-COBJS-$(CONFIG_BZIP2) += bzlib_randtable.o
-COBJS-$(CONFIG_BZIP2) += bzlib_huffman.o
-COBJS-$(CONFIG_USB_TTY) += circbuf.o
-COBJS-y += crc7.o
-COBJS-y += crc16.o
-COBJS-$(CONFIG_OF_CONTROL) += fdtdec.o
-COBJS-$(CONFIG_TEST_FDTDEC) += fdtdec_test.o
-COBJS-$(CONFIG_GZIP) += gunzip.o
-COBJS-$(CONFIG_GZIP_COMPRESSED) += gzip.o
-COBJS-y += initcall.o
-COBJS-$(CONFIG_LMB) += lmb.o
-COBJS-y += ldiv.o
-COBJS-$(CONFIG_MD5) += md5.o
-COBJS-y += net_utils.o
-COBJS-$(CONFIG_PHYSMEM) += physmem.o
-COBJS-y += qsort.o
-COBJS-$(CONFIG_SHA1) += sha1.o
-COBJS-$(CONFIG_SHA256) += sha256.o
-COBJS-y+= strmhz.o
-COBJS-$(CONFIG_TPM) += tpm.o
-COBJS-$(CONFIG_RBTREE) += rbtree.o
-COBJS-$(CONFIG_BITREVERSE) += bitrev.o
+obj-$(CONFIG_AES) += aes.o
+obj-$(CONFIG_BZIP2) += bzlib.o
+obj-$(CONFIG_BZIP2) += bzlib_crctable.o
+obj-$(CONFIG_BZIP2) += bzlib_decompress.o
+obj-$(CONFIG_BZIP2) += bzlib_randtable.o
+obj-$(CONFIG_BZIP2) += bzlib_huffman.o
+obj-$(CONFIG_USB_TTY) += circbuf.o
+obj-y += crc7.o
+obj-y += crc16.o
+obj-$(CONFIG_OF_CONTROL) += fdtdec.o
+obj-$(CONFIG_TEST_FDTDEC) += fdtdec_test.o
+obj-$(CONFIG_GZIP) += gunzip.o
+obj-$(CONFIG_GZIP_COMPRESSED) += gzip.o
+obj-y += initcall.o
+obj-$(CONFIG_LMB) += lmb.o
+obj-y += ldiv.o
+obj-$(CONFIG_MD5) += md5.o
+obj-y += net_utils.o
+obj-$(CONFIG_PHYSMEM) += physmem.o
+obj-y += qsort.o
+obj-$(CONFIG_SHA1) += sha1.o
+obj-$(CONFIG_SHA256) += sha256.o
+obj-y  += strmhz.o
+obj-$(CONFIG_TPM) += tpm.o
+obj-$(CONFIG_RBTREE)   += rbtree.o
+obj-$(CONFIG_BITREVERSE) += bitrev.o
 endif
 
 ifdef CONFIG_SPL_BUILD
-COBJS-$(CONFIG_SPL_YMODEM_SUPPORT) += crc16.o
-COBJS-$(CONFIG_SPL_NET_SUPPORT) += net_utils.o
+obj-$(CONFIG_SPL_YMODEM_SUPPORT) += crc16.o
+obj-$(CONFIG_SPL_NET_SUPPORT) += net_utils.o
 endif
-COBJS-$(CONFIG_ADDR_MAP) += addr_map.o
-COBJS-y += hashtable.o
-COBJS-y += errno.o
-COBJS-y += display_options.o
-COBJS-$(CONFIG_BCH) += bch.o
-COBJS-y += crc32.o
-COBJS-y += ctype.o
-COBJS-y += div64.o
-COBJS-y += hang.o
-COBJS-y += linux_string.o
-COBJS-$(CONFIG_REGEX) += slre.o
-COBJS-y += string.o
-COBJS-y += time.o
-COBJS-$(CONFIG_TRACE) += trace.o
-COBJS-$(CONFIG_BOOTP_PXE) += uuid.o
-COBJS-y += vsprintf.o
-COBJS-$(CONFIG_RANDOM_MACADDR) += rand.o
-COBJS-$(CONFIG_BOOTP_RANDOM_DELAY) += rand.o
-COBJS-$(CONFIG_CMD_LINK_LOCAL) += rand.o
-
-COBJS  := $(sort $(COBJS-y))
-SRCS   := $(COBJS:.o=.c)
-OBJS   := $(addprefix $(obj),$(COBJS))
-
-$(LIB):$(obj).depend $(OBJS)
-   $(call cmd_link_o_target, $(OBJS))
+obj-$(CONFIG_ADDR_MAP) += addr_map.o
+obj-y += hashtable.o
+obj-y += errno.o
+obj-y += display_options.o
+obj-$(CONFIG_BCH) += bch.o
+obj-y += crc32.o
+obj-y += ctype.o
+obj-y += div64.o
+obj-y += hang.o
+obj-y += linux_string.o
+obj-$(CONFIG_REGEX) += slre.o
+obj-y += string.o
+obj-y += time.o
+obj-$(CONFIG_TRACE) += trace.o
+obj-$(CONFIG_BOOTP_PXE) += uuid.o
+obj-y += vsprintf.o
+obj-$(CONFIG_RANDOM_MACADDR) += rand.o
+obj-$(CONFIG_BOOTP_RANDOM_DELAY) += rand.o
+obj-$(CONFIG_CMD_LINK_LOCAL) += rand.o
 
 # SEE README.arm-unaligned-accesses
 $(obj)bzlib.o: CFLAGS += $(PLATFORM_NO_UNALIGNED)
-
-#
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#
diff --git a/lib/libfdt/Makefile b/lib/libfdt/Makefile
index 07373df..a02c9b0 100644
--- a/lib/libfdt/Makefile
+++ b/lib/libfdt/Makefile
@@ -5,30 +5,7 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB= $(obj)libfdt.o
-
-SOBJS  =
-
 COBJS-libfdt += fdt.o fdt_ro.o fdt_rw.o fdt_strerror.o fdt_sw.o fdt_wip.o 
fdt_empty_tree.o
 
-COBJS-$(CONFIG_OF_LIBFDT) += $(COBJS-libfdt)
-COBJS-$(CONFIG_FIT) += $(COBJS-libfdt)
-
-
-COBJS  := $(sort $(COBJS-y))
-SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
-
-$(LIB):$(obj).depend $(OBJS)
-   $(call cmd_link_o_target, $(OBJS))
-
-#
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-

[U-Boot] [PATCH 16/19] disk: convert a makefile to Kbuild style

2013-09-07 Thread Masahiro Yamada
Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---
 disk/Makefile | 34 ++
 1 file changed, 6 insertions(+), 28 deletions(-)

diff --git a/disk/Makefile b/disk/Makefile
index 2b04e03..48abec8 100644
--- a/disk/Makefile
+++ b/disk/Makefile
@@ -5,33 +5,11 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
 #CFLAGS += -DET_DEBUG -DDEBUG
 
-LIB= $(obj)libdisk.o
-
-COBJS-$(CONFIG_PARTITIONS) += part.o
-COBJS-$(CONFIG_MAC_PARTITION)   += part_mac.o
-COBJS-$(CONFIG_DOS_PARTITION)   += part_dos.o
-COBJS-$(CONFIG_ISO_PARTITION)   += part_iso.o
-COBJS-$(CONFIG_AMIGA_PARTITION) += part_amiga.o
-COBJS-$(CONFIG_EFI_PARTITION)   += part_efi.o
-
-COBJS  := $(COBJS-y)
-SRCS   := $(COBJS:.o=.c)
-OBJS   := $(addprefix $(obj),$(COBJS))
-
-all:   $(LIB)
-
-$(LIB):$(obj).depend $(OBJS)
-   $(call cmd_link_o_target, $(OBJS))
-
-#
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#
+obj-$(CONFIG_PARTITIONS)   += part.o
+obj-$(CONFIG_MAC_PARTITION)   += part_mac.o
+obj-$(CONFIG_DOS_PARTITION)   += part_dos.o
+obj-$(CONFIG_ISO_PARTITION)   += part_iso.o
+obj-$(CONFIG_AMIGA_PARTITION) += part_amiga.o
+obj-$(CONFIG_EFI_PARTITION)   += part_efi.o
-- 
1.8.1.2

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 17/19] sandbox: convert makefiles to Kbuild style

2013-09-07 Thread Masahiro Yamada
Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
Cc: Simon Glass s...@chromium.org
---
 arch/sandbox/cpu/Makefile | 23 +--
 arch/sandbox/lib/Makefile | 25 +
 2 files changed, 2 insertions(+), 46 deletions(-)

diff --git a/arch/sandbox/cpu/Makefile b/arch/sandbox/cpu/Makefile
index e386867..404ff67 100644
--- a/arch/sandbox/cpu/Makefile
+++ b/arch/sandbox/cpu/Makefile
@@ -7,29 +7,8 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB= $(obj)lib$(CPU).o
-
-COBJS  := cpu.o os.o start.o state.o
-
-SRCS   := $(COBJS:.o=.c)
-OBJS   := $(addprefix $(obj),$(COBJS))
-
-all:   $(obj).depend $(LIB)
-
-$(LIB):$(OBJS)
-   $(call cmd_link_o_target, $(OBJS))
+obj-y  := cpu.o os.o start.o state.o
 
 # os.c is build in the system environment, so needs standard includes
 $(obj)os.o: ALL_CFLAGS := $(filter-out -nostdinc,$(ALL_CFLAGS))
 $(obj).depend.os: CPPFLAGS := $(filter-out -nostdinc,$(CPPFLAGS))
-
-#
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#
diff --git a/arch/sandbox/lib/Makefile b/arch/sandbox/lib/Makefile
index 993fb4e..4c1a38d 100644
--- a/arch/sandbox/lib/Makefile
+++ b/arch/sandbox/lib/Makefile
@@ -7,28 +7,5 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
 
-LIB= $(obj)lib$(ARCH).o
-
-COBJS-y+= interrupts.o
-
-SRCS   := $(COBJS-y:.o=.c)
-OBJS   := $(addprefix $(obj),$(COBJS-y))
-
-# Always build libsandbox.o
-TARGETS:= $(LIB)
-
-all:   $(TARGETS)
-
-$(LIB):$(obj).depend $(OBJS)
-   $(call cmd_link_o_target, $(OBJS))
-
-#
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#
+obj-y  += interrupts.o
-- 
1.8.1.2

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 18/19] powerpc: convert makefiles to Kbuild style

2013-09-07 Thread Masahiro Yamada
Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
Cc: Wolfgang Denk w...@denx.de
Cc: Stefan Roese s...@denx.de
---
 arch/powerpc/cpu/74xx_7xx/Makefile|  28 +---
 arch/powerpc/cpu/mpc512x/Makefile |  51 ++--
 arch/powerpc/cpu/mpc5xx/Makefile  |  27 +---
 arch/powerpc/cpu/mpc5xxx/Makefile |  54 +++-
 arch/powerpc/cpu/mpc824x/Makefile |  28 +---
 arch/powerpc/cpu/mpc8260/Makefile |  30 +
 arch/powerpc/cpu/mpc83xx/Makefile |  58 +++--
 arch/powerpc/cpu/mpc85xx/Makefile | 233 +++---
 arch/powerpc/cpu/mpc86xx/Makefile |  50 ++--
 arch/powerpc/cpu/mpc8xx/Makefile  |  58 +++--
 arch/powerpc/cpu/mpc8xxx/Makefile |  30 +
 arch/powerpc/cpu/mpc8xxx/ddr/Makefile |  30 +
 arch/powerpc/cpu/ppc4xx/Makefile  |  90 +
 arch/powerpc/lib/Makefile |  78 
 14 files changed, 266 insertions(+), 579 deletions(-)

diff --git a/arch/powerpc/cpu/74xx_7xx/Makefile 
b/arch/powerpc/cpu/74xx_7xx/Makefile
index de9b4a7..f31fe75 100644
--- a/arch/powerpc/cpu/74xx_7xx/Makefile
+++ b/arch/powerpc/cpu/74xx_7xx/Makefile
@@ -8,28 +8,6 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB= $(obj)lib$(CPU).o
-
-START  = start.o
-SOBJS  = cache.o kgdb.o io.o
-COBJS  = traps.o cpu.o cpu_init.o speed.o interrupts.o
-
-SRCS   := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
-START  := $(addprefix $(obj),$(START))
-
-all:   $(obj).depend $(START) $(LIB)
-
-$(LIB):$(OBJS)
-   $(call cmd_link_o_target, $(OBJS))
-
-#
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#
+extra-y= start.o
+obj-y  = cache.o kgdb.o io.o
+obj-y  += traps.o cpu.o cpu_init.o speed.o interrupts.o
diff --git a/arch/powerpc/cpu/mpc512x/Makefile 
b/arch/powerpc/cpu/mpc512x/Makefile
index 1af9ab1..f770350 100644
--- a/arch/powerpc/cpu/mpc512x/Makefile
+++ b/arch/powerpc/cpu/mpc512x/Makefile
@@ -4,44 +4,21 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
 $(shell mkdir -p $(OBJTREE)/board/freescale/common)
 
-LIB= $(obj)lib$(CPU).o
-
-START  = start.o
-COBJS-y:= cpu.o
-COBJS-y+= traps.o
-COBJS-y += cpu_init.o
-COBJS-y += fixed_sdram.o
-COBJS-y += i2c.o
-COBJS-y += interrupts.o
-COBJS-y += iopin.o
-COBJS-y += serial.o
-COBJS-y += speed.o
-COBJS-$(CONFIG_FSL_DIU_FB) += diu.o
-COBJS-$(CONFIG_CMD_IDE) += ide.o
-COBJS-$(CONFIG_PCI) += pci.o
+extra-y= start.o
+obj-y  := cpu.o
+obj-y  += traps.o
+obj-y += cpu_init.o
+obj-y += fixed_sdram.o
+obj-y += i2c.o
+obj-y += interrupts.o
+obj-y += iopin.o
+obj-y += serial.o
+obj-y += speed.o
+obj-$(CONFIG_FSL_DIU_FB) += diu.o
+obj-$(CONFIG_CMD_IDE) += ide.o
+obj-$(CONFIG_PCI) += pci.o
 
 # Stub implementations of cache management functions for USB
-COBJS-$(CONFIG_USB_EHCI) += cache.o
-
-COBJS  := $(COBJS-y)
-SRCS   := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
-START  := $(addprefix $(obj),$(START))
-
-all:   $(obj).depend $(START) $(LIB)
-
-$(LIB):$(OBJS)
-   $(call cmd_link_o_target, $(OBJS))
-
-#
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#
+obj-$(CONFIG_USB_EHCI) += cache.o
diff --git a/arch/powerpc/cpu/mpc5xx/Makefile b/arch/powerpc/cpu/mpc5xx/Makefile
index e3e50af..7b8826a 100644
--- a/arch/powerpc/cpu/mpc5xx/Makefile
+++ b/arch/powerpc/cpu/mpc5xx/Makefile
@@ -16,28 +16,5 @@
 #  uses the definitions made in 
arch/powerpc/cpu/mpc5xx/config.mk
 #
 
-
-include $(TOPDIR)/config.mk
-
-LIB= $(obj)lib$(CPU).o
-
-START  = start.o
-COBJS  = serial.o cpu.o cpu_init.o interrupts.o traps.o speed.o spi.o
-
-SRCS   := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
-START  := $(addprefix $(obj),$(START))
-
-all:   $(obj).depend $(START) $(LIB)
-
-$(LIB):$(OBJS)
-   $(call cmd_link_o_target, $(OBJS))
-
-#
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#
+extra-y= start.o
+obj-y  = serial.o cpu.o cpu_init.o interrupts.o traps.o speed.o spi.o
diff --git a/arch/powerpc/cpu/mpc5xxx/Makefile 
b/arch/powerpc/cpu/mpc5xxx/Makefile
index fc0b7a1..5c67e1d 100644
--- a/arch/powerpc/cpu/mpc5xxx/Makefile
+++ b/arch/powerpc/cpu/mpc5xxx/Makefile
@@ -5,44 +5,22 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-LIB= 

[U-Boot] [PATCH 1/6] Makefile: support descending down to subdirectories

2013-09-07 Thread Masahiro Yamada
This patch tweaks scripts/Makefile.build to allow
the build system to descend into subdirectories like Kbuild.

To use this feature, use obj-y += foo/ syntax.

Example:
obj-$(CONFIG_FOO) += foo/

Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---
 scripts/Makefile.build | 15 +++
 1 file changed, 15 insertions(+)

diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index f969ec5..2ef7341 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -19,6 +19,11 @@ obj-y := $(sort $(obj-y))
 extra-y := $(sort $(extra-y))
 lib-y := $(sort $(lib-y))
 
+subdir-y   := $(patsubst %/,%,$(filter %/, $(obj-y)))
+obj-y  := $(patsubst %/, %/built-in.o, $(obj-y))
+subdir-obj-y   := $(filter %/built-in.o, $(obj-y))
+subdir-obj-y   := $(addprefix $(obj),$(subdir-obj-y))
+
 SRCS   += $(COBJS:.o=.c) $(SOBJS:.o=.S) \
  $(wildcard $(obj-y:.o=.c) $(obj-y:.o=.S) $(lib-y:.o=.c) $(lib-y:.o=.S) 
$(extra-y:.o=.c) $(extra-y:.o=.S))
 OBJS   := $(addprefix $(obj),$(COBJS) $(SOBJS) $(obj-y))
@@ -37,6 +42,14 @@ $(LIBGCC): $(obj).depend $(LGOBJS)
$(call cmd_link_o_target, $(LGOBJS))
 endif
 
+ifneq ($(subdir-obj-y),)
+# Descending
+$(subdir-obj-y): $(subdir-y)
+
+$(subdir-y): FORCE
+   $(MAKE) -C $@ -f $(TOPDIR)/scripts/Makefile.build
+endif
+
 #
 
 # defines $(obj).depend target
@@ -46,3 +59,5 @@ include $(TOPDIR)/rules.mk
 sinclude $(obj).depend
 
 #
+
+.PHONY: FORCE
-- 
1.8.1.2

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 2/6] drivers: move some drivers to drivers/Makefile

2013-09-07 Thread Masahiro Yamada
This commit moves some drivers subdirectory entry
from the toplevel Makefile to drivers/Makefile
using Kbuild descending feature.

Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---
 Makefile | 14 +-
 drivers/Makefile | 13 +
 2 files changed, 14 insertions(+), 13 deletions(-)
 create mode 100644 drivers/Makefile

diff --git a/Makefile b/Makefile
index 338bf31..05bbca2 100644
--- a/Makefile
+++ b/Makefile
@@ -261,17 +261,11 @@ LIBS-y += fs/libfs.o \
fs/zfs/libzfs.o
 LIBS-y += net/libnet.o
 LIBS-y += disk/libdisk.o
-LIBS-y += drivers/bios_emulator/libatibiosemu.o
-LIBS-y += drivers/block/libblock.o
-LIBS-$(CONFIG_BOOTCOUNT_LIMIT) += drivers/bootcount/libbootcount.o
-LIBS-y += drivers/crypto/libcrypto.o
+LIBS-y += drivers/libdrivers.o
 LIBS-y += drivers/dma/libdma.o
-LIBS-y += drivers/fpga/libfpga.o
 LIBS-y += drivers/gpio/libgpio.o
-LIBS-y += drivers/hwmon/libhwmon.o
 LIBS-y += drivers/i2c/libi2c.o
 LIBS-y += drivers/input/libinput.o
-LIBS-y += drivers/misc/libmisc.o
 LIBS-y += drivers/mmc/libmmc.o
 LIBS-y += drivers/mtd/libmtd.o
 LIBS-y += drivers/mtd/nand/libnand.o
@@ -287,7 +281,6 @@ LIBS-y += drivers/power/libpower.o \
drivers/power/pmic/libpmic.o \
drivers/power/battery/libbattery.o
 LIBS-y += drivers/spi/libspi.o
-LIBS-y += drivers/dfu/libdfu.o
 ifeq ($(CPU),mpc83xx)
 LIBS-y += drivers/qe/libqe.o
 LIBS-y += arch/powerpc/cpu/mpc8xxx/ddr/libddr.o
@@ -305,9 +298,6 @@ LIBS-y += arch/powerpc/cpu/mpc8xxx/lib8xxx.o
 endif
 LIBS-y += drivers/rtc/librtc.o
 LIBS-y += drivers/serial/libserial.o
-LIBS-y += drivers/sound/libsound.o
-LIBS-y += drivers/tpm/libtpm.o
-LIBS-y += drivers/twserial/libtws.o
 LIBS-y += drivers/usb/eth/libusb_eth.o
 LIBS-y += drivers/usb/gadget/libusb_gadget.o
 LIBS-y += drivers/usb/host/libusb_host.o
@@ -315,8 +305,6 @@ LIBS-y += drivers/usb/musb/libusb_musb.o
 LIBS-y += drivers/usb/musb-new/libusb_musb-new.o
 LIBS-y += drivers/usb/phy/libusb_phy.o
 LIBS-y += drivers/usb/ulpi/libusb_ulpi.o
-LIBS-y += drivers/video/libvideo.o
-LIBS-y += drivers/watchdog/libwatchdog.o
 LIBS-y += common/libcommon.o
 LIBS-y += lib/libfdt/libfdt.o
 LIBS-y += api/libapi.o
diff --git a/drivers/Makefile b/drivers/Makefile
new file mode 100644
index 000..19a1c49
--- /dev/null
+++ b/drivers/Makefile
@@ -0,0 +1,13 @@
+obj-y += bios_emulator/
+obj-y += block/
+obj-$(CONFIG_BOOTCOUNT_LIMIT) += bootcount/
+obj-y += crypto/
+obj-y += fpga/
+obj-y += hwmon/
+obj-y += misc/
+obj-y += dfu/
+obj-y += sound/
+obj-y += tpm/
+obj-y += twserial/
+obj-y += video/
+obj-y += watchdog/
-- 
1.8.1.2

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 0/6] Second step towards Kbuild: Descend down like Kbuild

2013-09-07 Thread Masahiro Yamada
I have been just wondering why the U-Boot top Makefile is so dirty.

It is sprinkled with SoC-specific code as follows:

ifneq ($(CONFIG_OMAP_COMMON),)
LIBS-y += $(CPUDIR)/omap-common/libomap-common.o
endif

ifneq (,$(filter $(SOC), mx25 mx27 mx5 mx6 mx31 mx35 mxs vf610))
LIBS-y += arch/$(ARCH)/imx-common/libimx-common.o
endif

ifeq ($(SOC),s5pc1xx)
LIBS-y += $(CPUDIR)/s5p-common/libs5p-common.o
endif
ifeq ($(SOC),exynos)
LIBS-y += $(CPUDIR)/s5p-common/libs5p-common.o
endif
ifneq ($(CONFIG_TEGRA),)
LIBS-y += arch/$(ARCH)/cpu/$(SOC)-common/lib$(SOC)-common.o
LIBS-y += arch/$(ARCH)/cpu/tegra-common/libcputegra-common.o
LIBS-y += $(CPUDIR)/tegra-common/libtegra-common.o
endif

And it describes drivers not right under the top directory, which should be 
essentially cared
by drivers/Makefile.

LIBS-y += drivers/bios_emulator/libatibiosemu.o
LIBS-y += drivers/block/libblock.o
LIBS-$(CONFIG_BOOTCOUNT_LIMIT) += drivers/bootcount/libbootcount.o
LIBS-y += drivers/crypto/libcrypto.o
LIBS-y += drivers/dma/libdma.o
 ...

This series adds the directory descending feature like Kbuild.

0001 tweaks scripts/Makefile.build to support 'obj-y += foo/' syntax.
When the build system find 'foo/' (trailed by a slash),
it visits foo directory.

0002-0006 demonstarate how we can refactor makefiles with this syntax.

  0002: Move some drivers LIBS from top Makefile to drivers/Makefile
  0003: Move some fs LIBS from top Makefile to fs/Makefile
  0004: Move Tegra specific lines from top Makefile under arch/arm
  0005: Move OMAP specific lines from top Makefile under arch/arm
  0006: Move Samsung SoC specific lines from top Makefile under arch/arm

Note:
This series can be applies on v2013.10-rc2 +
'First step towards Kbuild: Use Kbuild-style makefiles' (19 patch files).

Please apply 'First step towards Kbuild: Use Kbuild-style makefiles' first.

I believe no boards are broken by this refactoring, but
it is humans who can make a mistake.
So, it is very important to do build check before patches are applied.

I tested for ARM and sandbox:

$ CROSS_COMPILE_ARM=arm-linux-gnueabi- ./MAKEALL -a arm -a sandbox

and I got:

- SUMMARY 
Boards compiled: 336
--

But I can not test other architectures.
I will be grateful for any custodians' help.

Cc: Simon Glass s...@chromium.org
Cc: Tom Rini tr...@ti.com

Masahiro Yamada (6):
  Makefile: support descending down to subdirectories
  drivers: move some drivers to drivers/Makefile
  fs: move some file system to fs/Makefile
  ARM: tegra: delete Tegra specific code from toplevel Makefile
  ARM: omap: delete OMAP specific code from toplevel Makefile
  ARM: s5pc, exynos: delete Samsung ARM SoC specific code from toplevel
Makefile

 Makefile  | 42 +++---
 arch/arm/cpu/Makefile |  2 ++
 arch/arm/cpu/arm720t/Makefile |  2 ++
 arch/arm/cpu/armv7/Makefile   |  9 +
 drivers/Makefile  | 13 +
 fs/Makefile   | 11 +++
 scripts/Makefile.build| 15 +++
 spl/Makefile  | 14 +-
 8 files changed, 56 insertions(+), 52 deletions(-)
 create mode 100644 arch/arm/cpu/Makefile
 create mode 100644 drivers/Makefile

-- 
1.8.1.2

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 3/6] fs: move some file system to fs/Makefile

2013-09-07 Thread Masahiro Yamada
This commit moves some subdirectories of fs
from the toplevel Makefile to fs/Makefile
using Kbuild descending feature.

Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---
 Makefile| 12 +---
 fs/Makefile | 11 +++
 2 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/Makefile b/Makefile
index 05bbca2..53a8a88 100644
--- a/Makefile
+++ b/Makefile
@@ -248,17 +248,7 @@ endif
 LIBS-$(CONFIG_OF_EMBED) += dts/libdts.o
 LIBS-y += arch/$(ARCH)/lib/lib$(ARCH).o
 LIBS-y += fs/libfs.o \
-   fs/cbfs/libcbfs.o \
-   fs/cramfs/libcramfs.o \
-   fs/ext4/libext4fs.o \
-   fs/fat/libfat.o \
-   fs/fdos/libfdos.o \
-   fs/jffs2/libjffs2.o \
-   fs/reiserfs/libreiserfs.o \
-   fs/sandbox/libsandboxfs.o \
-   fs/ubifs/libubifs.o \
-   fs/yaffs2/libyaffs2.o \
-   fs/zfs/libzfs.o
+   fs/fat/libfat.o
 LIBS-y += net/libnet.o
 LIBS-y += disk/libdisk.o
 LIBS-y += drivers/libdrivers.o
diff --git a/fs/Makefile b/fs/Makefile
index ea2eb09..bdcd746 100644
--- a/fs/Makefile
+++ b/fs/Makefile
@@ -7,3 +7,14 @@
 #
 
 obj-y  += fs.o
+
+obj-y += cbfs/
+obj-y += cramfs/
+obj-y += ext4/
+obj-y += fdos/
+obj-y += jffs2/
+obj-y += reiserfs/
+obj-y += sandbox/
+obj-y += ubifs/
+obj-y += yaffs2/
+obj-y += zfs/
-- 
1.8.1.2

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 4/6] ARM: tegra: delete Tegra specific code from toplevel Makefile

2013-09-07 Thread Masahiro Yamada
This patch moves Tegra specific directory entries
from the toplevel Makefile and spl/Makefile
to arch/arm/cpu/*/Makefile using Kbuild descending feature.

Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
Cc: Tom Warren twar...@nvidia.com
---
 Makefile  | 6 +-
 arch/arm/cpu/Makefile | 2 ++
 arch/arm/cpu/arm720t/Makefile | 2 ++
 arch/arm/cpu/armv7/Makefile   | 2 ++
 spl/Makefile  | 6 +-
 5 files changed, 8 insertions(+), 10 deletions(-)
 create mode 100644 arch/arm/cpu/Makefile

diff --git a/Makefile b/Makefile
index 53a8a88..a32fd7f 100644
--- a/Makefile
+++ b/Makefile
@@ -315,11 +315,7 @@ endif
 ifeq ($(SOC),exynos)
 LIBS-y += $(CPUDIR)/s5p-common/libs5p-common.o
 endif
-ifneq ($(CONFIG_TEGRA),)
-LIBS-y += arch/$(ARCH)/cpu/$(SOC)-common/lib$(SOC)-common.o
-LIBS-y += arch/$(ARCH)/cpu/tegra-common/libcputegra-common.o
-LIBS-y += $(CPUDIR)/tegra-common/libtegra-common.o
-endif
+LIBS-$(CONFIG_ARM) += arch/arm/cpu/libcpu.o
 
 LIBS := $(addprefix $(obj),$(sort $(LIBS-y)))
 .PHONY : $(LIBS)
diff --git a/arch/arm/cpu/Makefile b/arch/arm/cpu/Makefile
new file mode 100644
index 000..fd0da53
--- /dev/null
+++ b/arch/arm/cpu/Makefile
@@ -0,0 +1,2 @@
+obj-$(CONFIG_TEGRA) += $(SOC)-common/
+obj-$(CONFIG_TEGRA) += tegra-common/
diff --git a/arch/arm/cpu/arm720t/Makefile b/arch/arm/cpu/arm720t/Makefile
index 243a123..6badb3b 100644
--- a/arch/arm/cpu/arm720t/Makefile
+++ b/arch/arm/cpu/arm720t/Makefile
@@ -7,3 +7,5 @@
 
 extra-y= start.o
 obj-y  = interrupts.o cpu.o
+
+obj-$(CONFIG_TEGRA) += tegra-common/
diff --git a/arch/arm/cpu/armv7/Makefile b/arch/arm/cpu/armv7/Makefile
index 75fac4b..7b260ac 100644
--- a/arch/arm/cpu/armv7/Makefile
+++ b/arch/arm/cpu/armv7/Makefile
@@ -15,3 +15,5 @@ obj-y += syslib.o
 ifneq 
($(CONFIG_AM43XX)$(CONFIG_AM33XX)$(CONFIG_OMAP44XX)$(CONFIG_OMAP54XX)$(CONFIG_TEGRA)$(CONFIG_MX6)$(CONFIG_TI81XX),)
 obj-y  += lowlevel_init.o
 endif
+
+obj-$(CONFIG_TEGRA) += tegra-common/
diff --git a/spl/Makefile b/spl/Makefile
index 5d31a52..9901619 100644
--- a/spl/Makefile
+++ b/spl/Makefile
@@ -107,11 +107,7 @@ ifneq (,$(CONFIG_MX23)$(filter $(SOC), mx25 mx27 mx5 mx6 
mx31 mx35))
 LIBS-y += arch/$(ARCH)/imx-common/libimx-common.o
 endif
 
-ifneq ($(CONFIG_TEGRA),)
-LIBS-y += arch/$(ARCH)/cpu/$(SOC)-common/lib$(SOC)-common.o
-LIBS-y += arch/$(ARCH)/cpu/tegra-common/libcputegra-common.o
-LIBS-y += $(CPUDIR)/tegra-common/libtegra-common.o
-endif
+LIBS-$(CONFIG_ARM) += arch/arm/cpu/libcpu.o
 
 ifneq ($(CONFIG_MX23)$(CONFIG_MX35),)
 LIBS-y += arch/$(ARCH)/imx-common/libimx-common.o
-- 
1.8.1.2

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 5/6] ARM: omap: delete OMAP specific code from toplevel Makefile

2013-09-07 Thread Masahiro Yamada
This patch moves OMAP specific directory entries
from the toplevel Makefile and spl/Makefile
to arch/arm/cpu/armv7/Makefile using Kbuild descending feature.

Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
Cc: Tom Rini tr...@ti.com
---
 Makefile| 4 
 arch/arm/cpu/armv7/Makefile | 3 +++
 spl/Makefile| 4 
 3 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/Makefile b/Makefile
index a32fd7f..da6e657 100644
--- a/Makefile
+++ b/Makefile
@@ -301,10 +301,6 @@ LIBS-y += api/libapi.o
 LIBS-y += post/libpost.o
 LIBS-y += test/libtest.o
 
-ifneq ($(CONFIG_OMAP_COMMON),)
-LIBS-y += $(CPUDIR)/omap-common/libomap-common.o
-endif
-
 ifneq (,$(filter $(SOC), mx25 mx27 mx5 mx6 mx31 mx35 mxs vf610))
 LIBS-y += arch/$(ARCH)/imx-common/libimx-common.o
 endif
diff --git a/arch/arm/cpu/armv7/Makefile b/arch/arm/cpu/armv7/Makefile
index 7b260ac..7443b39 100644
--- a/arch/arm/cpu/armv7/Makefile
+++ b/arch/arm/cpu/armv7/Makefile
@@ -13,7 +13,10 @@ obj-y+= cpu.o
 obj-y  += syslib.o
 
 ifneq 
($(CONFIG_AM43XX)$(CONFIG_AM33XX)$(CONFIG_OMAP44XX)$(CONFIG_OMAP54XX)$(CONFIG_TEGRA)$(CONFIG_MX6)$(CONFIG_TI81XX),)
+ifneq ($(CONFIG_SKIP_LOWLEVEL_INIT),y)
 obj-y  += lowlevel_init.o
 endif
+endif
 
+obj-$(CONFIG_OMAP_COMMON) += omap-common/
 obj-$(CONFIG_TEGRA) += tegra-common/
diff --git a/spl/Makefile b/spl/Makefile
index 9901619..ae40b60 100644
--- a/spl/Makefile
+++ b/spl/Makefile
@@ -99,10 +99,6 @@ LIBS-$(CONFIG_SPL_USBETH_SUPPORT) += drivers/net/phy/libphy.o
 LIBS-$(CONFIG_SPL_MUSB_NEW_SUPPORT) += drivers/usb/musb-new/libusb_musb-new.o
 LIBS-$(CONFIG_SPL_USBETH_SUPPORT) += drivers/usb/gadget/libusb_gadget.o
 
-ifneq ($(CONFIG_OMAP_COMMON),)
-LIBS-y += $(CPUDIR)/omap-common/libomap-common.o
-endif
-
 ifneq (,$(CONFIG_MX23)$(filter $(SOC), mx25 mx27 mx5 mx6 mx31 mx35))
 LIBS-y += arch/$(ARCH)/imx-common/libimx-common.o
 endif
-- 
1.8.1.2

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 6/6] ARM: s5pc, exynos: delete Samsung ARM SoC specific code from toplevel Makefile

2013-09-07 Thread Masahiro Yamada
This patch moves S5PC, EXYNOS specific directory entries
from the toplevel Makefile to arch/arm/cpu/armv7/Makefile
using Kbuild descending feature.

Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
Cc: Minkyu Kang mk7.k...@samsung.com
---
 Makefile| 6 --
 arch/arm/cpu/armv7/Makefile | 4 
 spl/Makefile| 4 
 3 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/Makefile b/Makefile
index da6e657..e43352f 100644
--- a/Makefile
+++ b/Makefile
@@ -305,12 +305,6 @@ ifneq (,$(filter $(SOC), mx25 mx27 mx5 mx6 mx31 mx35 mxs 
vf610))
 LIBS-y += arch/$(ARCH)/imx-common/libimx-common.o
 endif
 
-ifeq ($(SOC),s5pc1xx)
-LIBS-y += $(CPUDIR)/s5p-common/libs5p-common.o
-endif
-ifeq ($(SOC),exynos)
-LIBS-y += $(CPUDIR)/s5p-common/libs5p-common.o
-endif
 LIBS-$(CONFIG_ARM) += arch/arm/cpu/libcpu.o
 
 LIBS := $(addprefix $(obj),$(sort $(LIBS-y)))
diff --git a/arch/arm/cpu/armv7/Makefile b/arch/arm/cpu/armv7/Makefile
index 7443b39..8d5bde9 100644
--- a/arch/arm/cpu/armv7/Makefile
+++ b/arch/arm/cpu/armv7/Makefile
@@ -20,3 +20,7 @@ endif
 
 obj-$(CONFIG_OMAP_COMMON) += omap-common/
 obj-$(CONFIG_TEGRA) += tegra-common/
+
+ifneq (,$(filter s5pc1xx exynos,$(SOC)))
+obj-y += s5p-common/
+endif
diff --git a/spl/Makefile b/spl/Makefile
index ae40b60..0e3b66b 100644
--- a/spl/Makefile
+++ b/spl/Makefile
@@ -109,10 +109,6 @@ ifneq ($(CONFIG_MX23)$(CONFIG_MX35),)
 LIBS-y += arch/$(ARCH)/imx-common/libimx-common.o
 endif
 
-ifeq ($(SOC),exynos)
-LIBS-y += $(CPUDIR)/s5p-common/libs5p-common.o
-endif
-
 # Add GCC lib
 ifeq ($(USE_PRIVATE_LIBGCC), yes)
 PLATFORM_LIBGCC = $(SPLTREE)/arch/$(ARCH)/lib/libgcc.o
-- 
1.8.1.2

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 00/19] First step towards Kbuild: Use Kbuild style makefiles

2013-09-07 Thread Masahiro Yamada

 0002-0019 change sub makefiles into a Kbuild suitable form using obj-y.
 In order to avoid creating a big patch file, they are divided
 by CPU architectures and categories.
 
   0002-0007: refactor under arch/arm/
   0008-0016: refactor libraries which are common for all architectures
   0017 : refactor under arch/powerpc/
   0018 : refactor under board/ti/

Please let me correct this part.

   0017 : refactor under arch/sandbox
   0018 : refactor under arch/powerpc/
   0019 : refactor under board/ti/



Best Regards
Masahiro Yamada

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot