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

2013-09-26 Thread Masahiro Yamada

I posted v2 for this series.


Best Regards
Masahiro Yamada

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


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

2013-09-26 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 
Cc: Minkyu Kang 
---

Changes for v2:
  - No change

 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 24e0161..5a10361 100644
--- a/Makefile
+++ b/Makefile
@@ -303,12 +303,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 d2b999e..ab43b5c 100644
--- a/spl/Makefile
+++ b/spl/Makefile
@@ -110,10 +110,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


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

2013-09-26 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 
Cc: Tom Warren 
---

Changes for v2:
  - No change

 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 42616e3..92dc088 100644
--- a/Makefile
+++ b/Makefile
@@ -313,11 +313,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 3197d61..3f1a1da 100644
--- a/spl/Makefile
+++ b/spl/Makefile
@@ -108,11 +108,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 v2 0/6] Second step towards Kbuild: Descend down like Kbuild

2013-09-26 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.

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

2/6-6/6 demonstarate how we can refactor makefiles with this syntax.

  2/6: Move some drivers LIBS from top Makefile to drivers/Makefile
  3/6: Move some fs LIBS from top Makefile to fs/Makefile
  4/6: Move Tegra specific lines from top Makefile under arch/arm/
  5/6: Move OMAP specific lines from top Makefile under arch/arm/
  6/6: Move Samsung SoC specific lines from top Makefile under arch/arm/

Note:
This series uses
[PATCH v2]First step towards Kbuild: Use Kbuild-style makefiles (19 patch 
files).
as a prerequisite. Please apply those patches first.

I believe no boards are broken by this refactoring.
In order to confirm my claim, I compiled all boards except
nds32 and nios2 architrecutures.
(I could not get an appropriate prebuilt cross compilers for those two arch.)

For arm, avr32, sandbox, x86, I could perfectly compile all boards
without any warnings.

For the other architectures, I could compile some boards and I could not
the others.
But the SUMMARY result is still the same after applying this series.
In addition I compared all the error messages and the warning messages
for all boards and they are the same.
This which means these patches do not introduce any additional errors, warnings.

Cc: Simon Glass 
Cc: Tom Rini 

Changes for v2:
   1/6: No change
   2/6: additionally refactor drivers/pcmcia drivers/rtc too
   3/6, 4/6: No change
   5/6: rebase on the master
   6/6: No change

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  | 44 +++
 arch/arm/cpu/Makefile |  2 ++
 arch/arm/cpu/arm720t/Makefile |  2 ++
 arch/arm/cpu/armv7/Makefile   |  9 +
 board/LEOX/elpt860/u-boot.lds |  1 -
 board/tqc/tqm8xx/u-boot.lds   |  4 ++--
 drivers/Makefile  | 15 +++
 fs/Makefile   | 11 +++
 scripts/Makefile.build| 15 +++
 spl/Makefile  | 14 +-
 10 files changed, 60 insertions(+), 57 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 v2 2/6] drivers: move some drivers to drivers/Makefile

2013-09-26 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 
---

Changes for v2:
  - refactor also drivers/pcmcia and drivers/rtc


 Makefile  | 16 +---
 board/LEOX/elpt860/u-boot.lds |  1 -
 board/tqc/tqm8xx/u-boot.lds   |  4 ++--
 drivers/Makefile  | 15 +++
 4 files changed, 18 insertions(+), 18 deletions(-)
 create mode 100644 drivers/Makefile

diff --git a/Makefile b/Makefile
index 1a9445d..90cd554 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
@@ -281,13 +275,11 @@ LIBS-y += drivers/mtd/spi/libspi_flash.o
 LIBS-y += drivers/net/libnet.o
 LIBS-y += drivers/net/phy/libphy.o
 LIBS-y += drivers/pci/libpci.o
-LIBS-y += drivers/pcmcia/libpcmcia.o
 LIBS-y += drivers/power/libpower.o \
drivers/power/fuel_gauge/libfuel_gauge.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
@@ -303,11 +295,7 @@ ifeq ($(CPU),mpc86xx)
 LIBS-y += arch/powerpc/cpu/mpc8xxx/ddr/libddr.o
 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 +303,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/board/LEOX/elpt860/u-boot.lds b/board/LEOX/elpt860/u-boot.lds
index f9c2beb..b30b667 100644
--- a/board/LEOX/elpt860/u-boot.lds
+++ b/board/LEOX/elpt860/u-boot.lds
@@ -34,7 +34,6 @@ SECTIONS
 arch/powerpc/cpu/mpc8xx/libmpc8xx.o(.text*)
 board/LEOX/elpt860/libelpt860.o(.text*)
 arch/powerpc/lib/libpowerpc.o  (.text*)
-/*drivers/rtc/librtc.o (.text*)*/
 
 . = env_offset;
 common/env_embedded.o  (.text*)
diff --git a/board/tqc/tqm8xx/u-boot.lds b/board/tqc/tqm8xx/u-boot.lds
index 1d905e9..cbfc94f 100644
--- a/board/tqc/tqm8xx/u-boot.lds
+++ b/board/tqc/tqm8xx/u-boot.lds
@@ -23,8 +23,8 @@ SECTIONS
 board/tqc/tqm8xx/libtqm8xx.o   (.text*)
 disk/libdisk.o (.text*)
 drivers/net/libnet.o   (.text*)
-drivers/pcmcia/libpcmcia.o (.text.pcmcia_on)
-drivers/pcmcia/libpcmcia.o (.text.pcmcia_hardware_enable)
+drivers/libdrivers.o   (.text.pcmcia_on)
+drivers/libdrivers.o   (.text.pcmcia_hardware_enable)
 
 . = DEFINED(env_offset) ? env_offset : .;
 common/env_embedded.o  (.ppcenv*)
diff --git a/drivers/Makefile b/drivers/Makefile
new file mode 100644
index 000..9cec2ba
--- /dev/null
+++ b/drivers/Makefile
@@ -0,0 +1,15 @@
+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 += pcmcia/
+obj-y += dfu/
+obj-y += rtc/
+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 v2 3/6] fs: move some file system to fs/Makefile

2013-09-26 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 
---

Changes for v2:
  - No change


 Makefile| 12 +---
 fs/Makefile | 11 +++
 2 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/Makefile b/Makefile
index 90cd554..42616e3 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 v2 5/6] ARM: omap: delete OMAP specific code from toplevel Makefile

2013-09-26 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 
Cc: Tom Rini 
---

Changes for v2:
  - rebase on the master

 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 92dc088..24e0161 100644
--- a/Makefile
+++ b/Makefile
@@ -299,10 +299,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 3f1a1da..d2b999e 100644
--- a/spl/Makefile
+++ b/spl/Makefile
@@ -100,10 +100,6 @@ 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
 LIBS-$(CONFIG_SPL_WATCHDOG_SUPPORT) += drivers/watchdog/libwatchdog.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 v2 1/6] Makefile: support descending down to subdirectories

2013-09-26 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 
Cc: Simon Glass 

---

Changes for v2:
  - No change

 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


Re: [U-Boot] [PATCH] MMC: DWMMC: Correct the CLKDIV register value

2013-09-26 Thread Rajeshwari Birje
Hi Pantelis,

If Jaehoon Chung has no comments we can go with the same patch.
@Jaehoon: do let me know if any better suggestions.

Regards,
Rajeshwari


On Tue, Sep 17, 2013 at 8:57 PM, Pantelis Antoniou
 wrote:
> Hi Rajesh,
>
> I guess we wait for an updated patch here?
>
> Regards
>
> -- Pantelis
>
> On Sep 11, 2013, at 4:25 PM, Rajeshwari Birje wrote:
>
>> Hi Jaehoon Chung,
>>
>> Thank you for comments,
>>
>>
>>
>> On Wed, Sep 11, 2013 at 11:31 AM, Jaehoon Chung  
>> wrote:
>>> On 09/11/2013 02:28 PM, Rajeshwari Birje wrote:
 Hi All,

 Please do let me know if any comments on the same.

 Regards,
 Rajeshwari Shinde.

 On Thu, Aug 29, 2013 at 4:34 PM, Rajeshwari Birje
  wrote:
> CCing the MMC Maintainer.
>
> On Thu, Aug 29, 2013 at 4:22 PM, Rajeshwari S Shinde
>  wrote:
>> This patch corrects the divider value written to CLKDIV register.
>> Since SDCLKIN is divided inside controller by the DIVRATIO value set
>> in the CLKSEL register, we need to use the same output clock value to
>> calculate the CLKDIV value.
>> as per user manual: cclk_in = SDCLKIN / (DIVRATIO + 1)
>>
>> Input parameter to mmc_clk is changed to dwmci_host, since
>> we need the same to read DWMCI_CLKSEL register.
>>
>> This improves the read timing values for channel 0 on SMDK5250
>> from 0.288sec to 0.144sec
>>
>> Signed-off-by: Rajeshwari S Shinde 
>> ---
>> arch/arm/include/asm/arch-exynos/dwmmc.h |  4 
>> drivers/mmc/dw_mmc.c |  2 +-
>> drivers/mmc/exynos_dw_mmc.c  | 17 +++--
>> include/dwmmc.h  |  2 +-
>> 4 files changed, 21 insertions(+), 4 deletions(-)
>>
>> diff --git a/arch/arm/include/asm/arch-exynos/dwmmc.h 
>> b/arch/arm/include/asm/arch-exynos/dwmmc.h
>> index b9eca76..f1c8d8a 100644
>> --- a/arch/arm/include/asm/arch-exynos/dwmmc.h
>> +++ b/arch/arm/include/asm/arch-exynos/dwmmc.h
>> @@ -14,6 +14,10 @@
>> #define DWMCI_SET_DRV_CLK(x)   ((x) << 16)
>> #define DWMCI_SET_DIV_RATIO(x) ((x) << 24)
>>
>> +/* CLKSEL Register */
>> +#define DWMCI_DIVRATIO_BIT 24
>> +#define DWMCI_DIVRATIO_MASK0x7
>> +
>> #ifdef CONFIG_OF_CONTROL
>> int exynos_dwmmc_init(const void *blob);
>> #endif
>> diff --git a/drivers/mmc/dw_mmc.c b/drivers/mmc/dw_mmc.c
>> index a82ee17..3406bdd 100644
>> --- a/drivers/mmc/dw_mmc.c
>> +++ b/drivers/mmc/dw_mmc.c
>> @@ -224,7 +224,7 @@ static int dwmci_setup_bus(struct dwmci_host *host, 
>> u32 freq)
>> * host->bus_hz should be set from user.
>> */
>>if (host->mmc_clk)
>> -   sclk = host->mmc_clk(host->dev_index);
>> +   sclk = host->mmc_clk(host);
>>else if (host->bus_hz)
>>sclk = host->bus_hz;
>>else {
>> diff --git a/drivers/mmc/exynos_dw_mmc.c b/drivers/mmc/exynos_dw_mmc.c
>> index 4ef9fec..1ed4afe 100644
>> --- a/drivers/mmc/exynos_dw_mmc.c
>> +++ b/drivers/mmc/exynos_dw_mmc.c
>> @@ -29,9 +29,22 @@ static void exynos_dwmci_clksel(struct dwmci_host 
>> *host)
>>dwmci_writel(host, DWMCI_CLKSEL, host->clksel_val);
>> }
>>
>> -unsigned int exynos_dwmci_get_clk(int dev_index)
>> +unsigned int exynos_dwmci_get_clk(struct dwmci_host *host)
>> {
>> -   return get_mmc_clk(dev_index);
>> +   unsigned long sclk;
>> +   int8_t clk_div;
>> +
>> +   /*
>> +* Since SDCLKIN is divided inside controller by the DIVRATIO
>> +* value set in the CLKSEL register, we need to use the same 
>> output
>> +* clock value to calculate the CLKDIV value.
>> +* as per user manual:cclk_in = SDCLKIN / (DIVRATIO + 1)
>> +*/
>> +   clk_div = ((dwmci_readl(host, DWMCI_CLKSEL) >> 
>> DWMCI_DIVRATIO_BIT)
>> +   & DWMCI_DIVRATIO_MASK) + 1;
>>> I known DIVRATIO is only exynos5 feature..
>>> And If clk_div is set to 0, then clk_phase/clk_strength is also set to 0.
>>>
>>> And I think we can fixed this problem into exynos_dwmci_add_port.
>>>
>>> Best Regards,
>>> Jaehoon Chung
>>
>> during the dwmci_setup_bus we call for mmc_clk,  this is where the
>> get_mmc_clk(host->dev_index)  retruns you the parent clock but since
>> we need the output of mux " cclk_in",
>> added in the exynos_dwmci_get_clk.
>> --
>> Regards,
>> Rajeshwari Shinde
>>>
>> +   sclk = get_mmc_clk(host->dev_index);
>> +
>> +   return sclk / clk_div;
>> }
>>
>> /*
>> diff --git a/include/dwmmc.h b/include/dwmmc.h
>> index 08ced0b..26b53af 100644
>> --- a/include/dwmmc.h
>> +++ b/include/dwmmc.h
>> @@ -138,7 +138,7 @@ struct dwmci_host {
>>struct mmc *mmc;
>>
>>void (*clksel)(struct dwmci_host *hos

Re: [U-Boot] [PATCH] i2c: Add support for Renesas rcar

2013-09-26 Thread Nobuhiro Iwamatsu

Hi, Heiko.

Thank you for your review.

(2013/09/27 12:37), Heiko Schocher wrote:

Hello Nobuhiro,

Am 27.09.2013 01:21, schrieb Nobuhiro Iwamatsu:

This supports i2c controller for Renesas rcar.

Signed-off-by: Hisashi Nakamura
Signed-off-by: Nobuhiro Iwamatsu
---
drivers/i2c/Makefile | 1 +
drivers/i2c/rcar_i2c.c | 289 +
2 files changed, 290 insertions(+)
create mode 100644 drivers/i2c/rcar_i2c.c


Thanks! Patch looks good to me, just some nitpicking comments:


diff --git a/drivers/i2c/Makefile b/drivers/i2c/Makefile
index 37ccbd1..f7cbd62 100644
--- a/drivers/i2c/Makefile
+++ b/drivers/i2c/Makefile
@@ -26,6 +26,7 @@ COBJS-$(CONFIG_TSI108_I2C) += tsi108_i2c.o
COBJS-$(CONFIG_U8500_I2C) += u8500_i2c.o
COBJS-$(CONFIG_SH_I2C) += sh_i2c.o
COBJS-$(CONFIG_SH_SH7734_I2C) += sh_sh7734_i2c.o
+COBJS-$(CONFIG_SYS_I2C_RCAR) += rcar_i2c.o


Please keep this list sorted ...



OK, I will fix.


COBJS-$(CONFIG_SYS_I2C) += i2c_core.o
COBJS-$(CONFIG_SYS_I2C_FSL) += fsl_i2c.o
COBJS-$(CONFIG_SYS_I2C_FTI2C010) += fti2c010.o
diff --git a/drivers/i2c/rcar_i2c.c b/drivers/i2c/rcar_i2c.c
new file mode 100644
index 000..92f0700
--- /dev/null
+++ b/drivers/i2c/rcar_i2c.c
@@ -0,0 +1,289 @@

[...]

+static u8
+rcar_i2c_raw_read(struct rcar_i2c *dev, u8 chip, uint addr)
+{
+ u8 ret;
+
+ rcar_i2c_raw_rw_common(dev, chip, addr);
+
+ /* set slave address, receive */
+ writel((chip<< 1) | 1,&dev->icmar);

^ ^
space please, please fix globally

Hmm.. checkpatch says for your patch:

total: 0 errors, 0 warnings, 0 checks, 296 lines checked

NOTE: Ignored message types: COMPLEX_MACRO CONSIDER_KSTRTO MINMAX 
MULTISTATEMENT_MACRO_USE_DO_WHILE NETWORKING_BLOCK_COMMENT_STYLE USLEEP_RANGE

mbox has no obvious style problems and is ready for submission.

Seems checpatch did not check this ...



this is my mistake. I will fix and recheck.

+ /* start master receive */
+ writel(MCR_MDBS | MCR_MIE | MCR_ESG,&dev->icmcr);
+
+ while ((readl(&dev->icmsr)& (MSR_MAT | MSR_MDE))
+ != (MSR_MAT | MSR_MDE))
+ udelay(10);
+
+ /* clear ESG */
+ writel(MCR_MDBS | MCR_MIE,&dev->icmcr);
+ /* prepare stop condition */
+ writel(MCR_MDBS | MCR_MIE | MCR_FSB,&dev->icmcr);
+ /* start SCLclk */
+ writel(~(MSR_MAT | MSR_MDR),&dev->icmsr);
+
+ while (!(readl(&dev->icmsr)& MSR_MDR))
+ udelay(10);
+
+ /* get receive data */
+ ret = (u8)readl(&dev->icrxdtxd);
+ /* start SCLclk */
+ writel(~MSR_MDR,&dev->icmsr);
+
+ rcar_i2c_raw_rw_finish(dev);
+
+ return ret;
+}
+
+


Please only one empty line.

[...]


OK, I will remove this line.



bye,
Heiko


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


Re: [U-Boot] [PATCH 1/1] am33xx: add CONFIG_SYS_NAND_DEVICE_WIDTH to determine NAND device bus-width

2013-09-26 Thread Gupta, Pekon
> From: Scott Wood [mailto:scottw...@freescale.com]
> 
> On Thu, 2013-09-26 at 13:14 +, Gupta, Pekon wrote:
> > > > From: Gupta, Pekon 
> > > >
> > > > NAND driver needs to know bus-width of the connected NAND device,
> in
> > > order to perform proper I/O and initialize itself. Currently there is no
> CONFIG
> > > option to provide this information to NAND driver.
> > > > - SPL NAND driver does not have framework to parse ONFI parameter
> > > page.
> > >
> > > Is this about SPL?  It looks like a more general change.
> > >
> > Yes, actually I would have loved to see a generic SPL driver for all 
> > platforms,
> 
> How could that possibly work?
> 
NAND SPL (as in drivers/mtd/nand/am335x_spl_bch.c) had following limitation
(a) depends on CONFIG_SYS_NAND_xx (for NAND device parameters like
 erasesize, pagesize, oobsize, etc).
(b) can only do NAND read access.
(c) calls nand_chip->ecc.hwctl() for doing controller specific
 configurations, which is populated while doing board_nand_init().

Above (a), (b), and (c) do not have any SoC specific dependency. And can be
put into a generic framework which can be used for all SPL drivers.

All SoC specific configurations are done in either:
- board_nand_init(): initializations based on device.
- nand_chip->ecc.hwctl(): configurations for ECC scheme.
which is *shared* code between SPL & u-boot driver, and is present in
u-boot driver file (like drivers/mtd/nand/omap_gpmc.c), not in SPL driver file.

The missing piece was device bus-width detection which I addresses in
this patch by adding CONFIG_SYS_NAND_DEVICE_WIDTH.


> > because SPL is mostly statically configured, and it just does plain NAND 
> > read
> > (it doesn’t even support NAND write, etc).
> > But I do not know the hardware configurations tweaks of other SoC,
> > So at-least have common CONFIG_SYS_NAND_xx which all SPL drivers can
> use.
> 
> Again, are you introducing this symbol for use only in SPL? 
Apart from SPL, CONFIG_SYS_NAND_DEVICE_WIDTH also be useful for
(1) drivers which do not use CONFIG_SYS_NAND_ONFI_DETECTION, where
 code for reading on-chip ONFI parameters is not enabled in nand_base.c
(2) non ONFI compatible NAND devices.


> It looked
> like you were removing the code that does dynamic detection, which would
> also affect non-SPL.
> 
>  > -  /* If we are 16 bit dev, our gpmc config tells us that */
> >  -  if ((readl(&gpmc_cfg->cs[cs].config1) & 0x3000) == 0x1000)

omap_gpmc.c never had dynamic detection support. Above gpmc_config bit
which is used to tell whether device is x16 or x8, gets actually hard-coded in
gpmc_init(). Thus it was actually a mechanism to pass hard-coded bus-width
information to nand driver.
Refer: arch/arm/cpu/armv7/am33xx/mem.c : gpmc_init()

So, instead of hacking the gpmc_init() everytime for different devices,
this patch introduces a generic CONFIG which can be used everywhere.

I have sent this patch separately to see the acceptance of new generic
CONFIG_SYS_NAND_DEVICE_WIDTH. If this gets accepted, then I'll 
resend the patch-series which actually does dynamic detection..
http://lists.denx.de/pipermail/u-boot/2013-September/162295.html
http://lists.denx.de/pipermail/u-boot/2013-September/162296.html

(dropping others in CC list as u-boot maillist rejects the mail saying
too many recipients. !! )

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


Re: [U-Boot] [PATCH] i2c: Add support for Renesas rcar

2013-09-26 Thread Heiko Schocher

Hello Nobuhiro,

Am 27.09.2013 01:21, schrieb Nobuhiro Iwamatsu:

This supports i2c controller for Renesas rcar.

Signed-off-by: Hisashi Nakamura
Signed-off-by: Nobuhiro Iwamatsu
---
  drivers/i2c/Makefile   |   1 +
  drivers/i2c/rcar_i2c.c | 289 +
  2 files changed, 290 insertions(+)
  create mode 100644 drivers/i2c/rcar_i2c.c


Thanks! Patch looks good to me, just some nitpicking comments:


diff --git a/drivers/i2c/Makefile b/drivers/i2c/Makefile
index 37ccbd1..f7cbd62 100644
--- a/drivers/i2c/Makefile
+++ b/drivers/i2c/Makefile
@@ -26,6 +26,7 @@ COBJS-$(CONFIG_TSI108_I2C) += tsi108_i2c.o
  COBJS-$(CONFIG_U8500_I2C) += u8500_i2c.o
  COBJS-$(CONFIG_SH_I2C) += sh_i2c.o
  COBJS-$(CONFIG_SH_SH7734_I2C) += sh_sh7734_i2c.o
+COBJS-$(CONFIG_SYS_I2C_RCAR) += rcar_i2c.o


Please keep this list sorted ...


  COBJS-$(CONFIG_SYS_I2C) += i2c_core.o
  COBJS-$(CONFIG_SYS_I2C_FSL) += fsl_i2c.o
  COBJS-$(CONFIG_SYS_I2C_FTI2C010) += fti2c010.o
diff --git a/drivers/i2c/rcar_i2c.c b/drivers/i2c/rcar_i2c.c
new file mode 100644
index 000..92f0700
--- /dev/null
+++ b/drivers/i2c/rcar_i2c.c
@@ -0,0 +1,289 @@

[...]

+static u8
+rcar_i2c_raw_read(struct rcar_i2c *dev, u8 chip, uint addr)
+{
+   u8 ret;
+
+   rcar_i2c_raw_rw_common(dev, chip, addr);
+
+   /* set slave address, receive */
+   writel((chip<<  1) | 1,&dev->icmar);

^  ^
space please, please fix globally

Hmm.. checkpatch says for your patch:

total: 0 errors, 0 warnings, 0 checks, 296 lines checked

NOTE: Ignored message types: COMPLEX_MACRO CONSIDER_KSTRTO MINMAX 
MULTISTATEMENT_MACRO_USE_DO_WHILE NETWORKING_BLOCK_COMMENT_STYLE USLEEP_RANGE

mbox has no obvious style problems and is ready for submission.

Seems checpatch did not check this ...


+   /* start master receive */
+   writel(MCR_MDBS | MCR_MIE | MCR_ESG,&dev->icmcr);
+
+   while ((readl(&dev->icmsr)&  (MSR_MAT | MSR_MDE))
+   != (MSR_MAT | MSR_MDE))
+   udelay(10);
+
+   /* clear ESG */
+   writel(MCR_MDBS | MCR_MIE,&dev->icmcr);
+   /* prepare stop condition */
+   writel(MCR_MDBS | MCR_MIE | MCR_FSB,&dev->icmcr);
+   /* start SCLclk */
+   writel(~(MSR_MAT | MSR_MDR),&dev->icmsr);
+
+   while (!(readl(&dev->icmsr)&  MSR_MDR))
+   udelay(10);
+
+   /* get receive data */
+   ret = (u8)readl(&dev->icrxdtxd);
+   /* start SCLclk */
+   writel(~MSR_MDR,&dev->icmsr);
+
+   rcar_i2c_raw_rw_finish(dev);
+
+   return ret;
+}
+
+


Please only one empty line.

[...]

bye,
Heiko
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] config.mk: enable -fstack-usage only when it is desired

2013-09-26 Thread Masahiro Yamada
Hello Michal

> Please remove microblaze from this list.
> Our gcc support fstack-usage.

I will. Thanks for helpful information!


> If your microblaze gcc doesn't support this flag
> then upgrade gcc version.

I tested microblaze-linux-gcc 4.8.0
I downloaded from ftp://ftp.kernel.org/pub/tools/crosstool/index.html

Can I get the prebuilt newer version at some download sites
or need to build from source code?


Best Regards
Masahiro Yamada

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


[U-Boot] [PATCH] wandboard: README: Include the quad version

2013-09-26 Thread Fabio Estevam
From: Fabio Estevam 

Wandboard quad was not ported into U-boot at the time of writing the README.

Add it to the list of Wandboard variants.

Signed-off-by: Fabio Estevam 
---
 board/wandboard/README | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/board/wandboard/README b/board/wandboard/README
index 498db2f..1f678e1 100644
--- a/board/wandboard/README
+++ b/board/wandboard/README
@@ -3,8 +3,8 @@ U-Boot for Wandboard
 
 This file contains information for the port of U-Boot to the Wandboard.
 
-Wandboard is a development board that has two variants: one version based
-on mx6 dual lite and another one based on mx6 solo.
+Wandboard is a development board that has three variants based on the following
+SoCs: mx6 quad, mx6 dual lite and mx6 solo.
 
 For more details about Wandboard, please refer to:
 http://www.wandboard.org/
-- 
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] config.mk: enable -fstack-usage only when it is desired

2013-09-26 Thread Masahiro Yamada
Hello Tom.

> The problem here is that except for whatever arches don't support
> - -fstack-usage, we always want to generate this information, to assist in
> debugging stack usage problems (which can be a real problem within SPL
> for example).  How about ifneq($(CONFIG_M68K)$(CONFIG_...),y) ... endif
> around it?

OK. This works.

But I'm kind of afraid ifneq($(CONFIG_M68K)$(CONFIG_...),y) ... endif
might be too arch-specific to be written in the top config.mk.

Instead, we can add
CONFIG_CC_STACKUSAGE=y
to arch/{arm, powerpc, x86, microblaze ...}/config.mk



Best Regards
Masahiro Yamada

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


[U-Boot] [PATCH] udoo: Add initial support for mx6q udoo board

2013-09-26 Thread Fabio Estevam
From: Fabio Estevam 

Add basic support for mx6q udoo board.

For further information about Udoo board:
http://www.udoo.org/

Tested booting a mainline device tree kernel and a Yocto rootfs from mmc.

Signed-off-by: Fabio Estevam 
---
 board/udoo/Makefile|  26 +++
 board/udoo/udoo.c  | 110 ++
 boards.cfg |   1 +
 include/configs/udoo.h | 206 +
 4 files changed, 343 insertions(+)
 create mode 100644 board/udoo/Makefile
 create mode 100644 board/udoo/udoo.c
 create mode 100644 include/configs/udoo.h

diff --git a/board/udoo/Makefile b/board/udoo/Makefile
new file mode 100644
index 000..1f0f6c7
--- /dev/null
+++ b/board/udoo/Makefile
@@ -0,0 +1,26 @@
+#
+# (C) Copyright 2013 Freescale Semiconductor, Inc.
+#
+# SPDX-License-Identifier: GPL-2.0+
+#
+
+include $(TOPDIR)/config.mk
+
+LIB= $(obj)lib$(BOARD).o
+
+COBJS  := udoo.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
+
+#
diff --git a/board/udoo/udoo.c b/board/udoo/udoo.c
new file mode 100644
index 000..180d0c9
--- /dev/null
+++ b/board/udoo/udoo.c
@@ -0,0 +1,110 @@
+/*
+ * Copyright (C) 2013 Freescale Semiconductor, Inc.
+ *
+ * Author: Fabio Estevam 
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+DECLARE_GLOBAL_DATA_PTR;
+
+#define UART_PAD_CTRL  (PAD_CTL_PUS_100K_UP |  \
+   PAD_CTL_SPEED_MED | PAD_CTL_DSE_40ohm | \
+   PAD_CTL_SRE_FAST  | PAD_CTL_HYS)
+
+#define USDHC_PAD_CTRL (PAD_CTL_PUS_47K_UP |   \
+   PAD_CTL_SPEED_LOW | PAD_CTL_DSE_80ohm | \
+   PAD_CTL_SRE_FAST  | PAD_CTL_HYS)
+
+#define WDT_EN IMX_GPIO_NR(5, 4)
+#define WDT_TRGIMX_GPIO_NR(3, 19)
+
+int dram_init(void)
+{
+   gd->ram_size = (phys_size_t)CONFIG_DDR_MB * 1024 * 1024;
+
+   return 0;
+}
+
+static iomux_v3_cfg_t const uart2_pads[] = {
+   MX6_PAD_EIM_D26__UART2_TXD | MUX_PAD_CTRL(UART_PAD_CTRL),
+   MX6_PAD_EIM_D27__UART2_RXD | MUX_PAD_CTRL(UART_PAD_CTRL),
+};
+
+static iomux_v3_cfg_t const usdhc3_pads[] = {
+   MX6_PAD_SD3_CLK__USDHC3_CLK   | MUX_PAD_CTRL(USDHC_PAD_CTRL),
+   MX6_PAD_SD3_CMD__USDHC3_CMD   | MUX_PAD_CTRL(USDHC_PAD_CTRL),
+   MX6_PAD_SD3_DAT0__USDHC3_DAT0 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
+   MX6_PAD_SD3_DAT1__USDHC3_DAT1 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
+   MX6_PAD_SD3_DAT2__USDHC3_DAT2 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
+   MX6_PAD_SD3_DAT3__USDHC3_DAT3 | MUX_PAD_CTRL(USDHC_PAD_CTRL),
+};
+
+static iomux_v3_cfg_t const wdog_pads[] = {
+   MX6_PAD_EIM_A24__GPIO_5_4 | MUX_PAD_CTRL(NO_PAD_CTRL),
+   MX6_PAD_EIM_D19__GPIO_3_19,
+};
+
+static void setup_iomux_uart(void)
+{
+   imx_iomux_v3_setup_multiple_pads(uart2_pads, ARRAY_SIZE(uart2_pads));
+}
+
+static void setup_iomux_wdog(void)
+{
+   imx_iomux_v3_setup_multiple_pads(wdog_pads, ARRAY_SIZE(wdog_pads));
+   gpio_direction_output(WDT_TRG, 0);
+   gpio_direction_output(WDT_EN, 1);
+}
+
+static struct fsl_esdhc_cfg usdhc_cfg = { USDHC3_BASE_ADDR };
+
+int board_mmc_getcd(struct mmc *mmc)
+{
+   return 1; /* Always present */
+}
+
+int board_mmc_init(bd_t *bis)
+{
+   imx_iomux_v3_setup_multiple_pads(usdhc3_pads, ARRAY_SIZE(usdhc3_pads));
+   usdhc_cfg.sdhc_clk = mxc_get_clock(MXC_ESDHC3_CLK);
+   usdhc_cfg.max_bus_width = 4;
+
+   return fsl_esdhc_initialize(bis, &usdhc_cfg);
+}
+
+int board_early_init_f(void)
+{
+   setup_iomux_wdog();
+   setup_iomux_uart();
+
+   return 0;
+}
+
+int board_init(void)
+{
+   /* address of boot parameters */
+   gd->bd->bi_boot_params = PHYS_SDRAM + 0x100;
+
+   return 0;
+}
+
+int checkboard(void)
+{
+   puts("Board: Udoo\n");
+
+   return 0;
+}
diff --git a/boards.cfg b/boards.cfg
index 9fc77fb..66c998a 100644
--- a/boards.cfg
+++ b/boards.cfg
@@ -283,6 +283,7 @@ Active  arm armv7  mx5 freescale
   mx53smd
 Active  arm armv7  mx5 genesi  mx51_efikamx
mx51_efikamx 
mx51_efikamx:MACH_TYPE=MACH_TYPE_MX51_EFIKAMX,IMX_CONFIG=board/genesi/mx51_efikamx/imximage_mx.cfg
-
 Active  arm armv7  mx5 genesi  mx51_efikamx
mx51_efikasb 
mx51_efikamx:MACH_TYPE=MACH_TYPE_MX51_EFIKASB,IMX_CONFIG=board/genesi/mx51_efikamx/imximage_sb.cfg
-
 Active  arm armv7  mx5 ttcont

Re: [U-Boot] [PATCH v2] usb: ehci: Fix test mode for connected ports

2013-09-26 Thread Simon Glass
On Tue, Sep 24, 2013 at 11:53 AM, Julius Werner  wrote:
> The EHCI controller has some very specific requirements for the USB 2.0
> port test modes, which were not closely followed in the initial test
> mode commit. It demands that the host controller is completely shut down
> (all ports suspended, Run/Stop bit unset) when activating test mode, and
> will not work on an already enumerated port.
>
> This patch fixes that by introducing a new ehci_shutdown() function that
> closely follows the procedure listed in EHCI 4.14. Also, when we have
> such a function anyway, we might as well also use it in
> usb_lowlevel_stop() to make the normal host controller shutdown cleaner.
>
> Signed-off-by: Julius Werner 

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


[U-Boot] [PATCH] i2c: Add support for Renesas rcar

2013-09-26 Thread Nobuhiro Iwamatsu
This supports i2c controller for Renesas rcar.

Signed-off-by: Hisashi Nakamura 
Signed-off-by: Nobuhiro Iwamatsu 
---
 drivers/i2c/Makefile   |   1 +
 drivers/i2c/rcar_i2c.c | 289 +
 2 files changed, 290 insertions(+)
 create mode 100644 drivers/i2c/rcar_i2c.c

diff --git a/drivers/i2c/Makefile b/drivers/i2c/Makefile
index 37ccbd1..f7cbd62 100644
--- a/drivers/i2c/Makefile
+++ b/drivers/i2c/Makefile
@@ -26,6 +26,7 @@ COBJS-$(CONFIG_TSI108_I2C) += tsi108_i2c.o
 COBJS-$(CONFIG_U8500_I2C) += u8500_i2c.o
 COBJS-$(CONFIG_SH_I2C) += sh_i2c.o
 COBJS-$(CONFIG_SH_SH7734_I2C) += sh_sh7734_i2c.o
+COBJS-$(CONFIG_SYS_I2C_RCAR) += rcar_i2c.o
 COBJS-$(CONFIG_SYS_I2C) += i2c_core.o
 COBJS-$(CONFIG_SYS_I2C_FSL) += fsl_i2c.o
 COBJS-$(CONFIG_SYS_I2C_FTI2C010) += fti2c010.o
diff --git a/drivers/i2c/rcar_i2c.c b/drivers/i2c/rcar_i2c.c
new file mode 100644
index 000..92f0700
--- /dev/null
+++ b/drivers/i2c/rcar_i2c.c
@@ -0,0 +1,289 @@
+/*
+ * drivers/i2c/rcar_i2c.c
+ *
+ * Copyright (C) 2013 Renesas Electronics Corporation
+ * Copyright (C) 2013 Nobuhiro Iwamatsu 
+ *
+ * SPDX-License-Identifier: GPL-2.0
+ */
+
+#include 
+#include 
+#include 
+
+DECLARE_GLOBAL_DATA_PTR;
+
+struct rcar_i2c {
+   u32 icscr;
+   u32 icmcr;
+   u32 icssr;
+   u32 icmsr;
+   u32 icsier;
+   u32 icmier;
+   u32 icccr;
+   u32 icsar;
+   u32 icmar;
+   u32 icrxdtxd;
+   u32 icccr2;
+   u32 icmpr;
+   u32 ichpr;
+   u32 iclpr;
+};
+
+#define MCR_MDBS   0x80/* non-fifo mode switch */
+#define MCR_FSCL   0x40/* override SCL pin */
+#define MCR_FSDA   0x20/* override SDA pin */
+#define MCR_OBPC   0x10/* override pins*/
+#define MCR_MIE0x08/* master if enable */
+#define MCR_TSBE   0x04
+#define MCR_FSB0x02/* force stop bit   */
+#define MCR_ESG0x01/* en startbit gen. */
+
+#define MSR_MASK   0x7f
+#define MSR_MNR0x40/* nack received*/
+#define MSR_MAL0x20/* arbitration lost */
+#define MSR_MST0x10/* sent a stop  */
+#define MSR_MDE0x08
+#define MSR_MDT0x04
+#define MSR_MDR0x02
+#define MSR_MAT0x01/* slave addr xfer done */
+
+static const struct rcar_i2c *i2c_dev[CONFIF_SYS_RCAR_I2C_NUM_CONTROLLERS] = {
+   (struct rcar_i2c *)CONFIG_SYS_RCAR_I2C0_BASE,
+   (struct rcar_i2c *)CONFIG_SYS_RCAR_I2C1_BASE,
+   (struct rcar_i2c *)CONFIG_SYS_RCAR_I2C2_BASE,
+   (struct rcar_i2c *)CONFIG_SYS_RCAR_I2C3_BASE,
+};
+
+static void rcar_i2c_raw_rw_common(struct rcar_i2c *dev, u8 chip, uint addr)
+{
+   /* set slave address */
+   writel(chip << 1, &dev->icmar);
+   /* set register address */
+   writel(addr, &dev->icrxdtxd);
+   /* clear status */
+   writel(0, &dev->icmsr);
+   /* start master send */
+   writel(MCR_MDBS | MCR_MIE | MCR_ESG, &dev->icmcr);
+
+   while ((readl(&dev->icmsr) & (MSR_MAT | MSR_MDE))
+   != (MSR_MAT | MSR_MDE))
+   udelay(10);
+
+   /* clear ESG */
+   writel(MCR_MDBS | MCR_MIE, &dev->icmcr);
+   /* start SCLclk */
+   writel(~(MSR_MAT | MSR_MDE), &dev->icmsr);
+
+   while (!(readl(&dev->icmsr) & MSR_MDE))
+   udelay(10);
+}
+
+static void rcar_i2c_raw_rw_finish(struct rcar_i2c *dev)
+{
+   while (!(readl(&dev->icmsr) & MSR_MST))
+   udelay(10);
+
+   writel(0, &dev->icmcr);
+}
+
+static int
+rcar_i2c_raw_write(struct rcar_i2c *dev, u8 chip, uint addr, u8 *val, int size)
+{
+   rcar_i2c_raw_rw_common(dev, chip, addr);
+
+   /* set send date */
+   writel(*val, &dev->icrxdtxd);
+   /* start SCLclk */
+   writel(~MSR_MDE, &dev->icmsr);
+
+   while (!(readl(&dev->icmsr) & MSR_MDE))
+   udelay(10);
+
+   /* set stop condition */
+   writel(MCR_MDBS | MCR_MIE | MCR_FSB, &dev->icmcr);
+   /* start SCLclk */
+   writel(~MSR_MDE, &dev->icmsr);
+
+   rcar_i2c_raw_rw_finish(dev);
+
+   return 0;
+}
+
+static u8
+rcar_i2c_raw_read(struct rcar_i2c *dev, u8 chip, uint addr)
+{
+   u8 ret;
+
+   rcar_i2c_raw_rw_common(dev, chip, addr);
+
+   /* set slave address, receive */
+   writel((chip << 1) | 1, &dev->icmar);
+   /* start master receive */
+   writel(MCR_MDBS | MCR_MIE | MCR_ESG, &dev->icmcr);
+
+   while ((readl(&dev->icmsr) & (MSR_MAT | MSR_MDE))
+   != (MSR_MAT | MSR_MDE))
+   udelay(10);
+
+   /* clear ESG */
+   writel(MCR_MDBS | MCR_MIE, &dev->icmcr);
+   /* prepare stop condition */
+   writel(MCR_MDBS | MCR_MIE | MCR_FSB, &dev->icmcr);
+   /* start SCLclk */
+   writel(~(MSR_MAT | MSR_MDR), &dev->icmsr);
+
+   while (!(readl(&dev->icmsr) & MSR_MDR))
+   udelay(10);
+
+   /* get recei

Re: [U-Boot] [PATCH v4] sf: probe: Add support for S25FL* flash parts

2013-09-26 Thread Simon Glass
Hi Jagan,

On Tue, Sep 24, 2013 at 12:19 PM, Jagannadha Sutradharudu Teki
 wrote:
> Added S25FL* parts are which are avilable in spi_flash_probe_legacy.c.
>
> Updated the sector_size attributes as per the flash parts.
> Looks fine for with this sector_size for computing the size
> of flash.
>
> Signed-off-by: Jagannadha Sutradharudu Teki 

For some reason this patch (only) is missing the version number in the
subject, and also has a 'dump' file. Is this a bug in patman maybe?

> ---
> Changes for v4:
> - Update the ext_jedec detection
> Changes for v3:
> - none
> Changes for v2:
> - Enable CONFIG_SPI_FLASH_SPANSION
>
>  drivers/mtd/spi/spi_flash_probe.c |   31 +-
>  dump  | 1182 
> +
>  2 files changed, 1207 insertions(+), 6 deletions(-)
>  create mode 100644 dump
>

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


Re: [U-Boot] [PATCH v4 17/36] sf: Add proper comment style on spi_flash structure

2013-09-26 Thread Simon Glass
Hi Jagan,

On Tue, Sep 24, 2013 at 12:19 PM, Jagannadha Sutradharudu Teki
 wrote:
> Added proper comment style on spi_flash structure to make
> more readable.
>
> Signed-off-by: Jagannadha Sutradharudu Teki 
> ---
> Changes for v4:
> - none
> Changes for v3:
> - none
> Changes for v2:
> - none
>
>  include/spi_flash.h | 63 
> +
>  1 file changed, 35 insertions(+), 28 deletions(-)
>
> diff --git a/include/spi_flash.h b/include/spi_flash.h
> index 14e4ae2..34a167b 100644
> --- a/include/spi_flash.h
> +++ b/include/spi_flash.h
> @@ -37,39 +37,46 @@
>  # define CMD_SST_AAI_WP0xAD/* Auto Address Incr Word 
> Program */
>  #endif
>
> +/**
> + * struct spi_flash - SPI flash structure
> + *
> + * @spi:   SPI slave
> + * @name:  Name of SPI flash
> + * @size:  Total flash size
> + * @page_size: Write (page) size
> + * @sector_size:   Sector size
> + * @erase_size:Erase size
> + * @bank_read_cmd: Bank read cmd
> + * @bank_write_cmd:Bank write cmd
> + * @bank_curr: Current flash bank
> + * @poll_cmd:  Poll cmd - for flash erase/program
> + * @erase_cmd: Erase cmd 4K, 32K, 64K
> + * @memory_map:Address of read-only SPI flash access
> + * @read:  Flash read ops
> + * @write: Flash write ops
> + * @erase: Flash erase ops

Should probably add full documentation for these functions (arguments
and return value)

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


Re: [U-Boot] [PATCH v4 00/36] sf: Add common probe and extended/quad read/write cmds support

2013-09-26 Thread Simon Glass
Hi Jagan,

On Tue, Sep 24, 2013 at 12:19 PM, Jagannadha Sutradharudu Teki
 wrote:
> This patch series is a combination of
> "sf: Add common probe support"
> "sf: Add support for extended/quad read and write commands"
> http://www.mail-archive.com/u-boot@lists.denx.de/msg121668.html
> http://u-boot.10912.n7.nabble.com/PATCH-v2-00-10-sf-Add-support-for-extended-quad-read-and-write-commands-td160964.html
>
> This patch series adds common probe support for all flash vendors except 
> ramtron.
>
> spi_flash_probe is a new addition where all flash driver
> probing is combined into a common file, this means spi_flash_probe.c
> adds a new probing style common to all flashes.
>
>
> Apart from common probing, this series also adds support for
> extended read commands and quad read/write commands.
>
> http://comments.gmane.org/gmane.comp.boot-loaders.u-boot/150148
> http://permalink.gmane.org/gmane.comp.boot-loaders.u-boot/167026
>
> There is a bit discussion going on for supporting this:
> http://u-boot.10912.n7.nabble.com/PATCH-00-12-cmd-sf-Add-support-for-read-and-write-instructions-td143749.html
>
> Concept:
> Initially I tried to add individual sf write/read commands to respective
> flash read/write commands, but later some discussion to mainline about this 
> and
> changed the implementation.
>
> As Michal and me were trying to change this as like the
> "implementation will discover the fastest command by taking the supported
> commands from flash and a controller. Controller supported commands will 
> always been a priority."
>
> Means I have added rd_cmd and wr_cmd params on spi_flash_id_params table.
> So the flash user may fill these with flash supported commands, and also spi 
> controller
> use is also have rd_cmd and wr_cmd from spi.h, so the spi user will fill 
> these with
> controller supported commands. and the resultent command is calculated based 
> fastest
> commands by taking inputs from spi and flash, but spi(controller) has always 
> a priority.
>
> Supported commands:
> - CMD_READ_ARRAY_SLOW
> - CMD_READ_ARRAY_FAST
> - CMD_READ_DUAL_OUTPUT_FAST
> - CMD_READ_DUAL_IO_FAST
> - CMD_READ_QUAD_OUTPUT_FAST
> - CMD_PAGE_PROGRAM
> - CMD_QUAD_PAGE_PROGRAM
>
> Testing repo branch:
> ---
> $ git clone git://git.denx.de/u-boot-spi.git
> $ cd u-boot-spi
> $ git checkout -b master-next-test origin/master-next-test
>
> REQUEST FOR ALL SPI CODE CONTRIBUTORS/USERS, PLEASE TEST THESE CHANGES
> W.R.T YOUR HW IF POSSIBLE.
>
> Please let me know for any issues/concerns/questions.
>
> --
> Thanks,
> Jagan.
>
> Jagannadha Sutradharudu Teki (36):
>   sf: Divide spi_flash into multiple parts
>   sf: probe: Add new spi_flash_probe support
>   sf: probe: Add support for M25P* flash parts
>   sf: probe: Add support for EN25Q* flash parts
>   sf: probe: Add support for GD25* flash parts
>   sf: probe: Add support for MX25L* flash parts
>   sf: probe: Add support for W25* flash parts
>   sf: probe: Add support for S25FL* flash parts
>   sf: probe: Add support for SST25* flash parts
>   sf: probe: Add support for AT45DB* flash parts
>   sf: probe: Give proper spacing on flash table params
>   sf: probe: Add support for SST_WP
>   sf: probe: Add support to clear flash BP# bits
>   sf: probe: Add support for erase sector selection flag
>   sf: probe: Add support for flag status polling
>   sf: probe: Move BAR config to spi_flash_validate_ids
>   sf: Add proper comment style on spi_flash structure
>   sf: ramtron: Add support for separate flash driver
>   sf: Remove unneeded flash drivers files
>   sf: probe: Add support for EN25Q64
>   sf: probe: Add support for S25FL256S_256K
>   sf: probe: Add support for S25FL512S_256K
>   sf: probe: Use print_size arg as page_size
>   sf: probe: Print erase_size while printing flash details
>   sf: probe: Simply the BAR configuration logic
>   sf: ops: Add static qualifier to spi_flash_cmd_bankaddr_write
>   sf: probe: Add support for MX25L25635F
>   sf: probe: Add support for MX25L51235F
>   sf: Remove spi_flash_do_alloc references
>   doc: SPI: Add status.txt for tracking SPI subsys status
>   sf: Add extended read commands support
>   sf: Add quad read/write commands support
>   sf: ops: Add configuration register writing support
>   sf: Set quad enable bit support
>   sf: spi_flash cleanups
>   spi: spi cleanups
>
>  doc/SPI/status.txt   |  28 ++
>  drivers/mtd/spi/Makefile |  15 +-
>  drivers/mtd/spi/atmel.c  | 544 -
>  drivers/mtd/spi/eon.c|  60 
>  drivers/mtd/spi/gigadevice.c |  65 
>  drivers/mtd/spi/macronix.c   |  98 --
>  drivers/mtd/spi/ramtron.c| 123 +++-
>  drivers/mtd/spi/spansion.c   | 141 -
>  drivers/mtd/spi/spi_flash.c  | 571 
> +--
>  drivers/mtd/spi/spi_flash_internal.h | 151 -
>  drivers/mtd/spi/spi_flash_ops.c  | 451 +++
>  driver

Re: [U-Boot] [PATCH v4 34/36] sf: Set quad enable bit support

2013-09-26 Thread Simon Glass
Hi Jagan,

On Tue, Sep 24, 2013 at 12:20 PM, Jagannadha Sutradharudu Teki
 wrote:
> This patch provides support to set the quad enable bit on flash.
>
> quad enable bit needs to set before performing any quad IO
> operations on respective SPI flashes.
>
> Signed-off-by: Jagannadha Sutradharudu Teki 
> ---
> Changes for v4:
> - none
> Changes for v3:
> - none
> Changes for v2:
> - none
>
>  drivers/mtd/spi/spi_flash_internal.h |  5 +
>  drivers/mtd/spi/spi_flash_ops.c  | 24 
>  drivers/mtd/spi/spi_flash_probe.c|  9 +
>  3 files changed, 38 insertions(+)

This patch introduces a warning for snow, fixed on the next commit.

34: sf: ops: Add configuration register writing support
   arm: +   snow
+spi_flash_ops.c:41:12: warning: ‘spi_flash_cmd_write_config’ defined
but not used [-Wunused-function]

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


Re: [U-Boot] When to create a SoC directory for ARM

2013-09-26 Thread Tom Rini
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 09/26/2013 05:32 PM, York Sun wrote:
> On 09/26/2013 02:26 PM, Scott Wood wrote:
>> On Thu, 2013-09-26 at 14:07 -0700, York Sun wrote:
>>> On 09/26/2013 02:03 PM, Tom Rini wrote:
 On 09/26/2013 04:59 PM, Scott Wood wrote:
> On Thu, 2013-09-26 at 16:49 -0400, Tom Rini wrote:
>> On 09/26/2013 04:44 PM, Scott Wood wrote:
>>> On Thu, 2013-09-26 at 12:57 -0700, York Sun wrote:
 On 09/26/2013 12:55 PM, Scott Wood wrote:
> On Thu, 2013-09-26 at 12:48 -0700, York Sun wrote:
>> On 09/26/2013 12:46 PM, Sharma Bhupesh-B45370
>> wrote:
>>> 
 -Original Message- From: 
 u-boot-boun...@lists.denx.de 
 [mailto:u-boot-boun...@lists.denx.de] On
 Behalf Of Scott Wood Sent: Friday, September
 27, 2013 12:53 AM To: FengHua Cc: trini; sun
 york-R58495; u-boot Subject: Re: [U-Boot]
 When to create a SoC directory for ARM
 
 On Thu, 2013-09-26 at 13:23 +0800, FengHua
 wrote:
> all SOC specific include file should be in
>  arch/arm/include/asm/arch-SOC/ or some
> common directory(like
> include/asm/imx-common). Currently, u-boot
> only link SOC specific(arch-SOC) include 
> directory. You could touch a mmu.h file in
>  arch/arm/include/asm/arch-ls2/ and include
>  arch/arm/include/asm/arch-armv8/mmu.h. or
> move arch-armv8/mmu.h to
> arch/arm/include/asm/ to make it as a
> generic file. Maybe we should distinguish 
> architecture specific include directory and
> SOC specific include directory.
 
 Is the XXX arch-XXX supposed to be an SoC
 family or a CPU family/architectutre?
 
>>> 
>>> Usually in 'arch/arm/include/asm' we have both:
>>> - arch-armv7 (Arch specific. Houses stuff
>>> common to ARMv7 CPU, e.g. Global timer, SP805
>>> WDT..) - arch-mx6 (SoC family specific. Houses
>>> stuff like SoC specific IOMUX pads..)
> 
> Which one does "#inculde " refer
> to?
> 
 
 arm/arch is a symbolic link created at compiling
 time. It points to arm/arch-$(soc), if $(soc) is not
 defined, then it points to asm/arch-$(arch). That's
 my understanding.
>>> 
>>> How is that supposed to work when both arch-$(soc) and 
>>> arch-$(arch) are present?  Why are SoC and CPU arch
>>> confused in this way?
>> 
>> Primarily because it hasn't been an issue until now
>> really. What's wrong with just saying
>>  as needed ?
 
> Hmm, the only relevant  are in
> armv8-specific files, so I suppose we could do that.  Why
> not just rename it asm/armv[78], though?  There are only a
> handful of files in both armv7 and armv8, so it shouldn't
> be too much of a problem.  Then there's no question of
> where the symlink points.
 
 That should also be fine, after a quick git grep around..
 
>>> How about arch/arm/include/asm/gpio.h? it includes
>>> .
>> 
>> gpio.h doesn't belong in the armv8 directory.
>> 
> 
> No, it doesn't. But oddly we have a lot of them. And since it is 
> including , we have to make it happy.

No, we have to move it from asm/arch-armv8/gpio.h to
asm/arch-soc/gpio.h for that family.

- -- 
Tom
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBAgAGBQJSRKmaAAoJENk4IS6UOR1WHWsQAJFfQLT7zDAQ/QODxKFecwZH
yJyXQaENoHtyF3Rvbzxt6mbupjJ3gviVJrhFQUSZ9jmTokbeLRC+26g7FPqtGeWh
EfpfcRHaEJ5hMkZxa/V97357DOrfitX68uCXpBMmzQcj2l1DF6SPJ3CcV8+XjoCO
5ZjKQpahBC2Pxd++cH3oPEGvy00DH55giOpVxwdBHKZGP3X/ySqoY5C54Nojg6+P
r7d33vceIKLBVh4kln8bZPjFNR3BqoYfRBphgNRP6AyhEBDvuTbF0JjT107Ym1yX
awo3wcmm+oGl3/ptUZh9nk8rsIbLkirhx84UZJUrb812QZnO5ORwxgExp5IRgO9T
Y0ofH9bLFy2jBZwyNVzp0QPi5bhBPe8ehYTW0aFIK9eydhbNTIuxMjDXdp8TaSjC
w3pq+iE13clfoFL51iI/gm09RDH4/vpb2G5VRO9tCwVCzPIxO5hG3NJ0FE3S0sJR
SItirnxs+ekH/vCCC5elJRrI89kAK8OJwe0KyhQAZJYfY9R6jwmrwJxcFEvw6qwU
rRrc3u6yiHUgbgnuNwUZQKoGLmVh4/5TFpE8h12zzMlI7XZmq5QnEPbSfOeiR1Np
vCZZKbyMbsdc/+UNiQYABGvpOJV8OIO7fkGhhS3+LChehWYsYnff23E522QPnKn6
Kcnvd4U5EP3erixNFWc7
=A+o+
-END PGP SIGNATURE-
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] When to create a SoC directory for ARM

2013-09-26 Thread York Sun
On 09/26/2013 02:26 PM, Scott Wood wrote:
> On Thu, 2013-09-26 at 14:07 -0700, York Sun wrote:
>> On 09/26/2013 02:03 PM, Tom Rini wrote:
>>> On 09/26/2013 04:59 PM, Scott Wood wrote:
 On Thu, 2013-09-26 at 16:49 -0400, Tom Rini wrote:
> On 09/26/2013 04:44 PM, Scott Wood wrote:
>> On Thu, 2013-09-26 at 12:57 -0700, York Sun wrote:
>>> On 09/26/2013 12:55 PM, Scott Wood wrote:
 On Thu, 2013-09-26 at 12:48 -0700, York Sun wrote:
> On 09/26/2013 12:46 PM, Sharma Bhupesh-B45370 wrote:
>>
>>> -Original Message- From: 
>>> u-boot-boun...@lists.denx.de 
>>> [mailto:u-boot-boun...@lists.denx.de] On Behalf Of
>>> Scott Wood Sent: Friday, September 27, 2013 12:53 AM
>>> To: FengHua Cc: trini; sun york-R58495; u-boot
>>> Subject: Re: [U-Boot] When to create a SoC directory
>>> for ARM
>>>
>>> On Thu, 2013-09-26 at 13:23 +0800, FengHua wrote:
 all SOC specific include file should be in 
 arch/arm/include/asm/arch-SOC/ or some common 
 directory(like include/asm/imx-common). Currently, 
 u-boot only link SOC specific(arch-SOC) include 
 directory. You could touch a mmu.h file in 
 arch/arm/include/asm/arch-ls2/ and include 
 arch/arm/include/asm/arch-armv8/mmu.h. or move 
 arch-armv8/mmu.h to arch/arm/include/asm/ to make
 it as a generic file. Maybe we should distinguish 
 architecture specific include directory and SOC 
 specific include directory.
>>>
>>> Is the XXX arch-XXX supposed to be an SoC family or
>>> a CPU family/architectutre?
>>>
>>
>> Usually in 'arch/arm/include/asm' we have both: - 
>> arch-armv7 (Arch specific. Houses stuff common to
>> ARMv7 CPU, e.g. Global timer, SP805 WDT..) - arch-mx6
>> (SoC family specific. Houses stuff like SoC specific
>> IOMUX pads..)

 Which one does "#inculde " refer to?

>>>
>>> arm/arch is a symbolic link created at compiling time. It
>>> points to arm/arch-$(soc), if $(soc) is not defined, then it
>>> points to asm/arch-$(arch). That's my understanding.
>>
>> How is that supposed to work when both arch-$(soc) and
>> arch-$(arch) are present?  Why are SoC and CPU arch confused in
>> this way?
>
> Primarily because it hasn't been an issue until now really.
> What's wrong with just saying  as needed
> ?
>>>
 Hmm, the only relevant  are in armv8-specific
 files, so I suppose we could do that.  Why not just rename it
 asm/armv[78], though?  There are only a handful of files in both
 armv7 and armv8, so it shouldn't be too much of a problem.  Then
 there's no question of where the symlink points.
>>>
>>> That should also be fine, after a quick git grep around..
>>>
>> How about arch/arm/include/asm/gpio.h? it includes .
> 
> gpio.h doesn't belong in the armv8 directory.
> 

No, it doesn't. But oddly we have a lot of them. And since it is
including , we have to make it happy.

$ find arch/arm/include/ -name gpio.h
arch/arm/include/asm/arch-spear/gpio.h
arch/arm/include/asm/arch-am33xx/gpio.h
arch/arm/include/asm/arch-omap3/gpio.h
arch/arm/include/asm/imx-common/gpio.h
arch/arm/include/asm/arch-mx5/gpio.h
arch/arm/include/asm/arch-tegra20/gpio.h
arch/arm/include/asm/arch-rmobile/gpio.h
arch/arm/include/asm/arch-tegra/gpio.h
arch/arm/include/asm/gpio.h
arch/arm/include/asm/arch-bcm2835/gpio.h
arch/arm/include/asm/arch-mxs/gpio.h
arch/arm/include/asm/arch-s3c24x0/gpio.h
arch/arm/include/asm/arch-davinci/gpio.h
arch/arm/include/asm/arch-nomadik/gpio.h
arch/arm/include/asm/arch-armada100/gpio.h
arch/arm/include/asm/arch-tegra114/gpio.h
arch/arm/include/asm/arch-armv8/gpio.h
arch/arm/include/asm/arch-mx6/gpio.h
arch/arm/include/asm/arch-exynos/gpio.h
arch/arm/include/asm/arch-omap4/gpio.h
arch/arm/include/asm/arch-mx27/gpio.h
arch/arm/include/asm/arch-mx35/gpio.h
arch/arm/include/asm/arch-u8500/gpio.h
arch/arm/include/asm/arch-mx25/gpio.h
arch/arm/include/asm/arch-kirkwood/gpio.h
arch/arm/include/asm/arch-omap5/gpio.h
arch/arm/include/asm/arch-tegra30/gpio.h
arch/arm/include/asm/arch-at91/gpio.h
arch/arm/include/asm/arch-s5pc1xx/gpio.h
arch/arm/include/asm/arch-mx31/gpio.h

York



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


Re: [U-Boot] When to create a SoC directory for ARM

2013-09-26 Thread Scott Wood
On Thu, 2013-09-26 at 14:07 -0700, York Sun wrote:
> On 09/26/2013 02:03 PM, Tom Rini wrote:
> > On 09/26/2013 04:59 PM, Scott Wood wrote:
> >> On Thu, 2013-09-26 at 16:49 -0400, Tom Rini wrote:
> >>> On 09/26/2013 04:44 PM, Scott Wood wrote:
>  On Thu, 2013-09-26 at 12:57 -0700, York Sun wrote:
> > On 09/26/2013 12:55 PM, Scott Wood wrote:
> >> On Thu, 2013-09-26 at 12:48 -0700, York Sun wrote:
> >>> On 09/26/2013 12:46 PM, Sharma Bhupesh-B45370 wrote:
> 
> > -Original Message- From: 
> > u-boot-boun...@lists.denx.de 
> > [mailto:u-boot-boun...@lists.denx.de] On Behalf Of
> > Scott Wood Sent: Friday, September 27, 2013 12:53 AM
> > To: FengHua Cc: trini; sun york-R58495; u-boot
> > Subject: Re: [U-Boot] When to create a SoC directory
> > for ARM
> >
> > On Thu, 2013-09-26 at 13:23 +0800, FengHua wrote:
> >> all SOC specific include file should be in 
> >> arch/arm/include/asm/arch-SOC/ or some common 
> >> directory(like include/asm/imx-common). Currently, 
> >> u-boot only link SOC specific(arch-SOC) include 
> >> directory. You could touch a mmu.h file in 
> >> arch/arm/include/asm/arch-ls2/ and include 
> >> arch/arm/include/asm/arch-armv8/mmu.h. or move 
> >> arch-armv8/mmu.h to arch/arm/include/asm/ to make
> >> it as a generic file. Maybe we should distinguish 
> >> architecture specific include directory and SOC 
> >> specific include directory.
> >
> > Is the XXX arch-XXX supposed to be an SoC family or
> > a CPU family/architectutre?
> >
> 
>  Usually in 'arch/arm/include/asm' we have both: - 
>  arch-armv7 (Arch specific. Houses stuff common to
>  ARMv7 CPU, e.g. Global timer, SP805 WDT..) - arch-mx6
>  (SoC family specific. Houses stuff like SoC specific
>  IOMUX pads..)
> >>
> >> Which one does "#inculde " refer to?
> >>
> >
> > arm/arch is a symbolic link created at compiling time. It
> > points to arm/arch-$(soc), if $(soc) is not defined, then it
> > points to asm/arch-$(arch). That's my understanding.
> 
>  How is that supposed to work when both arch-$(soc) and
>  arch-$(arch) are present?  Why are SoC and CPU arch confused in
>  this way?
> >>>
> >>> Primarily because it hasn't been an issue until now really.
> >>> What's wrong with just saying  as needed
> >>> ?
> > 
> >> Hmm, the only relevant  are in armv8-specific
> >> files, so I suppose we could do that.  Why not just rename it
> >> asm/armv[78], though?  There are only a handful of files in both
> >> armv7 and armv8, so it shouldn't be too much of a problem.  Then
> >> there's no question of where the symlink points.
> > 
> > That should also be fine, after a quick git grep around..
> > 
> How about arch/arm/include/asm/gpio.h? it includes .

gpio.h doesn't belong in the armv8 directory.

-Scott



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


Re: [U-Boot] [PATCH 05/11] mtd: Build nand_util.o for CONFIG_ENV_IS_IN_NAND in SPL

2013-09-26 Thread Tom Rini
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 09/26/2013 04:51 PM, Scott Wood wrote:
> On Thu, 2013-09-26 at 16:45 -0400, Tom Rini wrote:
>> On 09/26/2013 04:42 PM, Scott Wood wrote:
>>> On Thu, 2013-09-26 at 16:28 -0400, Tom Rini wrote:
 Cc: Scott Wood 
 Signed-off-by: Tom Rini 
 ---
  drivers/mtd/nand/Makefile |1 +
  1 file changed, 1 insertion(+)

 diff --git a/drivers/mtd/nand/Makefile b/drivers/mtd/nand/Makefile
 index 366dee6..bb5b29d 100644
 --- a/drivers/mtd/nand/Makefile
 +++ b/drivers/mtd/nand/Makefile
 @@ -24,6 +24,7 @@ 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
 +COBJS-$(CONFIG_ENV_IS_IN_NAND) += nand_util.o
>>>
>>> Not all NAND SPLs will want this.  Define a new CONFIG_SPL_* symbol, or
>>> perhaps it could just use CONFIG_SPL_NAND_BASE.
>>
>> Then they won't get it.  Without CONFIG_SPL_ENV_SUPPORT that all gets
>> discarded. 
> 
> Anonymous strings won't.

Ah that's right, curses...

>> And talked about before adding CONFIG_SPL_ENV_... and I
>> didn't want to go down that path.  If you feel strongly about not
>> building the object we can guard this with CONFIG_SPL_ENV_SUPPORT checks
>> perhaps?
> 
> And then we get a bigger mess if something wants nand_util for some
> other reason...
> 
> I think the entire way SPL has been structured is a mistake, and it
> should have been viewed as just multiple U-Boot configs that happen to
> be automatically built and concatenated together under one user-visible
> target name.  Then, if existing config mechanisms are not fine grained
> enough, make them finer grained.  Bring in kconfig to sort out the
> dependency mess.

Mid-term, yes.  I would like to talk about Kconfig more at ELC-E and get
a feel from the community on how much time people have to devote to such
big efforts.

- -- 
Tom
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBAgAGBQJSRKO+AAoJENk4IS6UOR1WMW8QAKUU8ZT2/W8EefntM4lQJ/iY
/2PjdCPOA+KotWGPPCGyg6EjFFeNw03ruhnsDmtNduw2tWU6sq9WXZZoR3sw4kVP
ZOax+kqxBrd8XBiqGzM5+3CD2W3KAiEYBwCbF2q9weG1U/Pl14rQEfAZ7RaXt7da
Hz0mAhIKP+IyTJ94/SOvRCVziwJPNUYc1FL4hKnvA5knqkfmd36Jael1++1UxK15
eYp6o2Xdliz28mPL+It1UVUK9gn+3SDTOuG+KNNkCW+NSmB8hFMnVVTipZWc4u0H
hQXquHVDGIUieZ7d1zbpcOkz5OVWcd+CjwvvbKPrMwvOHDNq9UbZo8QDtFFsnqZJ
eSOOG6CVMdJ0t9TB6R1CKQaphtb6XQvKO6fStlQI07nXmDzdx9qHZjPeX8rH2aV0
xX7dAkIUpc5knpnb1r8SFVdawXqlveNgzYOEHCNVMk6kpsO1U0F53d7nzBXSOz6h
d1zTR4xV91rWr1n9bp1YC9HML7c1InNo1gelKMNSjlUMWkg6mKEc+r9X70P0Qgx3
1kZ5GmR0HkvV1NnlYpgq09UvI+tWXIYcH4alEPge88JHEcEQHVhqzp9j5ErWt0ei
1VcIEA/s1Vj0RyBDolPeomnWv+liOm9RQaghBMwF7rDkd9pGbEytIfoyOb56cf3E
WDs/54voOqB61z9+5c5f
=ODSN
-END PGP SIGNATURE-
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] When to create a SoC directory for ARM

2013-09-26 Thread York Sun
On 09/26/2013 02:03 PM, Tom Rini wrote:
> On 09/26/2013 04:59 PM, Scott Wood wrote:
>> On Thu, 2013-09-26 at 16:49 -0400, Tom Rini wrote:
>>> On 09/26/2013 04:44 PM, Scott Wood wrote:
 On Thu, 2013-09-26 at 12:57 -0700, York Sun wrote:
> On 09/26/2013 12:55 PM, Scott Wood wrote:
>> On Thu, 2013-09-26 at 12:48 -0700, York Sun wrote:
>>> On 09/26/2013 12:46 PM, Sharma Bhupesh-B45370 wrote:

> -Original Message- From: 
> u-boot-boun...@lists.denx.de 
> [mailto:u-boot-boun...@lists.denx.de] On Behalf Of
> Scott Wood Sent: Friday, September 27, 2013 12:53 AM
> To: FengHua Cc: trini; sun york-R58495; u-boot
> Subject: Re: [U-Boot] When to create a SoC directory
> for ARM
>
> On Thu, 2013-09-26 at 13:23 +0800, FengHua wrote:
>> all SOC specific include file should be in 
>> arch/arm/include/asm/arch-SOC/ or some common 
>> directory(like include/asm/imx-common). Currently, 
>> u-boot only link SOC specific(arch-SOC) include 
>> directory. You could touch a mmu.h file in 
>> arch/arm/include/asm/arch-ls2/ and include 
>> arch/arm/include/asm/arch-armv8/mmu.h. or move 
>> arch-armv8/mmu.h to arch/arm/include/asm/ to make
>> it as a generic file. Maybe we should distinguish 
>> architecture specific include directory and SOC 
>> specific include directory.
>
> Is the XXX arch-XXX supposed to be an SoC family or
> a CPU family/architectutre?
>

 Usually in 'arch/arm/include/asm' we have both: - 
 arch-armv7 (Arch specific. Houses stuff common to
 ARMv7 CPU, e.g. Global timer, SP805 WDT..) - arch-mx6
 (SoC family specific. Houses stuff like SoC specific
 IOMUX pads..)
>>
>> Which one does "#inculde " refer to?
>>
>
> arm/arch is a symbolic link created at compiling time. It
> points to arm/arch-$(soc), if $(soc) is not defined, then it
> points to asm/arch-$(arch). That's my understanding.

 How is that supposed to work when both arch-$(soc) and
 arch-$(arch) are present?  Why are SoC and CPU arch confused in
 this way?
>>>
>>> Primarily because it hasn't been an issue until now really.
>>> What's wrong with just saying  as needed
>>> ?
> 
>> Hmm, the only relevant  are in armv8-specific
>> files, so I suppose we could do that.  Why not just rename it
>> asm/armv[78], though?  There are only a handful of files in both
>> armv7 and armv8, so it shouldn't be too much of a problem.  Then
>> there's no question of where the symlink points.
> 
> That should also be fine, after a quick git grep around..
> 
How about arch/arm/include/asm/gpio.h? it includes .

York



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


Re: [U-Boot] When to create a SoC directory for ARM

2013-09-26 Thread Tom Rini
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 09/26/2013 04:59 PM, Scott Wood wrote:
> On Thu, 2013-09-26 at 16:49 -0400, Tom Rini wrote:
>> On 09/26/2013 04:44 PM, Scott Wood wrote:
>>> On Thu, 2013-09-26 at 12:57 -0700, York Sun wrote:
 On 09/26/2013 12:55 PM, Scott Wood wrote:
> On Thu, 2013-09-26 at 12:48 -0700, York Sun wrote:
>> On 09/26/2013 12:46 PM, Sharma Bhupesh-B45370 wrote:
>>> 
 -Original Message- From: 
 u-boot-boun...@lists.denx.de 
 [mailto:u-boot-boun...@lists.denx.de] On Behalf Of
 Scott Wood Sent: Friday, September 27, 2013 12:53 AM
 To: FengHua Cc: trini; sun york-R58495; u-boot
 Subject: Re: [U-Boot] When to create a SoC directory
 for ARM
 
 On Thu, 2013-09-26 at 13:23 +0800, FengHua wrote:
> all SOC specific include file should be in 
> arch/arm/include/asm/arch-SOC/ or some common 
> directory(like include/asm/imx-common). Currently, 
> u-boot only link SOC specific(arch-SOC) include 
> directory. You could touch a mmu.h file in 
> arch/arm/include/asm/arch-ls2/ and include 
> arch/arm/include/asm/arch-armv8/mmu.h. or move 
> arch-armv8/mmu.h to arch/arm/include/asm/ to make
> it as a generic file. Maybe we should distinguish 
> architecture specific include directory and SOC 
> specific include directory.
 
 Is the XXX arch-XXX supposed to be an SoC family or
 a CPU family/architectutre?
 
>>> 
>>> Usually in 'arch/arm/include/asm' we have both: - 
>>> arch-armv7 (Arch specific. Houses stuff common to
>>> ARMv7 CPU, e.g. Global timer, SP805 WDT..) - arch-mx6
>>> (SoC family specific. Houses stuff like SoC specific
>>> IOMUX pads..)
> 
> Which one does "#inculde " refer to?
> 
 
 arm/arch is a symbolic link created at compiling time. It
 points to arm/arch-$(soc), if $(soc) is not defined, then it
 points to asm/arch-$(arch). That's my understanding.
>>> 
>>> How is that supposed to work when both arch-$(soc) and
>>> arch-$(arch) are present?  Why are SoC and CPU arch confused in
>>> this way?
>> 
>> Primarily because it hasn't been an issue until now really.
>> What's wrong with just saying  as needed
>> ?
> 
> Hmm, the only relevant  are in armv8-specific
> files, so I suppose we could do that.  Why not just rename it
> asm/armv[78], though?  There are only a handful of files in both
> armv7 and armv8, so it shouldn't be too much of a problem.  Then
> there's no question of where the symlink points.

That should also be fine, after a quick git grep around..

- -- 
Tom
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBAgAGBQJSRKEdAAoJENk4IS6UOR1WPEQP/1FtxXn3AgEFS/Sz0MCRb6ZK
YCm1gum5DUHY7kHZfF1+jFYdUP5sFSD4mzH/V90UVPqW8atubA5jggbwC8vk4E+j
HWZuv+fZJRDfMZQjs4b47EdgYh1ErTe3Xq8I5rnrgz+9+EuL5wo8Q88+7Lk9ftBd
9dIxHIRzPqixiZZy3rAbqvzrsGHzpnA1Qk9qyZwVow8PcW7bJ9B4yfOkZdxPvXVQ
MEAbxhph7Z8O9E5LqI7gjjr3mCQAFNhChKBDxBxF07SurDyyf1bjnzI39HFdZJAy
hWL6p+dBRVG3Jxhew6E9pEKHqvlvd5A76qaP7R9FssvaxRO777peLiP2JSHpPJoi
WwwZT6p8i8+xr92PQkDYCoOrO4gAVrco1e5cOC/0Qw3eaOMyFl8HqPnPGud6t66z
wgDjmsc3gBrX9rfXEMMBDk1Ef+rajJGYBcxOLhHqTM5iFhAJVNYgKPu70f/JioVW
4XpjV9r4x9pKF00ULM9Qh0bk63P0eS8oIwPjnKNS80mpBAD/awZu6wYclTgsdik6
hT0+TY/nNyu9Mr4zvUJMHAclZ+wwYmGrVaqkfREIrO9FBuiGP2Z0Pq/a5T+1KIWw
0gZx9S+vG9RquVcvkJSo0w3ieh+cBHgKLPtOOpKE726zvTNmXDodstBARQB3TauA
uG8hvetIlDgJabGhu2Xk
=zmTf
-END PGP SIGNATURE-
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] When to create a SoC directory for ARM

2013-09-26 Thread Scott Wood
On Thu, 2013-09-26 at 16:49 -0400, Tom Rini wrote:
> On 09/26/2013 04:44 PM, Scott Wood wrote:
> > On Thu, 2013-09-26 at 12:57 -0700, York Sun wrote:
> >> On 09/26/2013 12:55 PM, Scott Wood wrote:
> >>> On Thu, 2013-09-26 at 12:48 -0700, York Sun wrote:
>  On 09/26/2013 12:46 PM, Sharma Bhupesh-B45370 wrote:
> > 
> >> -Original Message- From:
> >> u-boot-boun...@lists.denx.de
> >> [mailto:u-boot-boun...@lists.denx.de] On Behalf Of Scott
> >> Wood Sent: Friday, September 27, 2013 12:53 AM To:
> >> FengHua Cc: trini; sun york-R58495; u-boot Subject: Re:
> >> [U-Boot] When to create a SoC directory for ARM
> >> 
> >> On Thu, 2013-09-26 at 13:23 +0800, FengHua wrote:
> >>> all SOC specific include file should be in 
> >>> arch/arm/include/asm/arch-SOC/ or some common
> >>> directory(like include/asm/imx-common). Currently,
> >>> u-boot only link SOC specific(arch-SOC) include
> >>> directory. You could touch a mmu.h file in
> >>> arch/arm/include/asm/arch-ls2/ and include
> >>> arch/arm/include/asm/arch-armv8/mmu.h. or move
> >>> arch-armv8/mmu.h to arch/arm/include/asm/ to make it as
> >>> a generic file. Maybe we should distinguish
> >>> architecture specific include directory and SOC
> >>> specific include directory.
> >> 
> >> Is the XXX arch-XXX supposed to be an SoC family or a
> >> CPU family/architectutre?
> >> 
> > 
> > Usually in 'arch/arm/include/asm' we have both: -
> > arch-armv7 (Arch specific. Houses stuff common to ARMv7
> > CPU, e.g. Global timer, SP805 WDT..) - arch-mx6 (SoC family
> > specific. Houses stuff like SoC specific IOMUX pads..)
> >>> 
> >>> Which one does "#inculde " refer to?
> >>> 
> >> 
> >> arm/arch is a symbolic link created at compiling time. It points
> >> to arm/arch-$(soc), if $(soc) is not defined, then it points to 
> >> asm/arch-$(arch). That's my understanding.
> > 
> > How is that supposed to work when both arch-$(soc) and arch-$(arch)
> > are present?  Why are SoC and CPU arch confused in this way?
> 
> Primarily because it hasn't been an issue until now really.  What's
> wrong with just saying  as needed ?

Hmm, the only relevant  are in armv8-specific files, so
I suppose we could do that.  Why not just rename it asm/armv[78],
though?  There are only a handful of files in both armv7 and armv8, so
it shouldn't be too much of a problem.  Then there's no question of
where the symlink points.

-Scott



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


Re: [U-Boot] [PATCH 05/11] mtd: Build nand_util.o for CONFIG_ENV_IS_IN_NAND in SPL

2013-09-26 Thread Scott Wood
On Thu, 2013-09-26 at 16:45 -0400, Tom Rini wrote:
> On 09/26/2013 04:42 PM, Scott Wood wrote:
> > On Thu, 2013-09-26 at 16:28 -0400, Tom Rini wrote:
> >> Cc: Scott Wood 
> >> Signed-off-by: Tom Rini 
> >> ---
> >>  drivers/mtd/nand/Makefile |1 +
> >>  1 file changed, 1 insertion(+)
> >>
> >> diff --git a/drivers/mtd/nand/Makefile b/drivers/mtd/nand/Makefile
> >> index 366dee6..bb5b29d 100644
> >> --- a/drivers/mtd/nand/Makefile
> >> +++ b/drivers/mtd/nand/Makefile
> >> @@ -24,6 +24,7 @@ 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
> >> +COBJS-$(CONFIG_ENV_IS_IN_NAND) += nand_util.o
> > 
> > Not all NAND SPLs will want this.  Define a new CONFIG_SPL_* symbol, or
> > perhaps it could just use CONFIG_SPL_NAND_BASE.
> 
> Then they won't get it.  Without CONFIG_SPL_ENV_SUPPORT that all gets
> discarded. 

Anonymous strings won't.

> And talked about before adding CONFIG_SPL_ENV_... and I
> didn't want to go down that path.  If you feel strongly about not
> building the object we can guard this with CONFIG_SPL_ENV_SUPPORT checks
> perhaps?

And then we get a bigger mess if something wants nand_util for some
other reason...

I think the entire way SPL has been structured is a mistake, and it
should have been viewed as just multiple U-Boot configs that happen to
be automatically built and concatenated together under one user-visible
target name.  Then, if existing config mechanisms are not fine grained
enough, make them finer grained.  Bring in kconfig to sort out the
dependency mess.

-Scott



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


Re: [U-Boot] Getting U-Boot running on Toradex Colibri T20 on Iris board

2013-09-26 Thread Stefan Agner
Am 2013-08-07 10:15, schrieb Andrzej Telszewski:
> Hi,
> 
> I'm trying to get the U-Boot running on the Iris board with the
> Toradex Colibri T20 module. I was able to flash the U-Boot and it
> starts but then immediately stops with the only message being:
> 
> U-Boot 2013.07 (Aug 06 2013 - 17:47:43)
> 
> TEGRA20
> Board: Toradex Colibri T20 on Iris
> DRAM:
> 
> 
> The Colibri T20 board used is:
> 256MB RAM
> V1.2A
> 
> Could you please give me any idea what I might be doing wrong?
Latest U-Boot worked on my Setup (Colibri T20 on the Evaluation Board).
Although, I use the 512MiB variant:

TEGRA20
Board: Toradex Colibri T20 on Iris
DRAM:  512 MiB

So it must be DRAM related. RAM will be initialized according to ODM
data, see query_sdram_size in ./arch/arm/cpu/tegra-common/board.c. How
do you flash u-boot? Using tegrarcm or nvflash? Can you verify your ODM
data?

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


Re: [U-Boot] When to create a SoC directory for ARM

2013-09-26 Thread Tom Rini
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 09/26/2013 04:44 PM, Scott Wood wrote:
> On Thu, 2013-09-26 at 12:57 -0700, York Sun wrote:
>> On 09/26/2013 12:55 PM, Scott Wood wrote:
>>> On Thu, 2013-09-26 at 12:48 -0700, York Sun wrote:
 On 09/26/2013 12:46 PM, Sharma Bhupesh-B45370 wrote:
> 
>> -Original Message- From:
>> u-boot-boun...@lists.denx.de
>> [mailto:u-boot-boun...@lists.denx.de] On Behalf Of Scott
>> Wood Sent: Friday, September 27, 2013 12:53 AM To:
>> FengHua Cc: trini; sun york-R58495; u-boot Subject: Re:
>> [U-Boot] When to create a SoC directory for ARM
>> 
>> On Thu, 2013-09-26 at 13:23 +0800, FengHua wrote:
>>> all SOC specific include file should be in 
>>> arch/arm/include/asm/arch-SOC/ or some common
>>> directory(like include/asm/imx-common). Currently,
>>> u-boot only link SOC specific(arch-SOC) include
>>> directory. You could touch a mmu.h file in
>>> arch/arm/include/asm/arch-ls2/ and include
>>> arch/arm/include/asm/arch-armv8/mmu.h. or move
>>> arch-armv8/mmu.h to arch/arm/include/asm/ to make it as
>>> a generic file. Maybe we should distinguish
>>> architecture specific include directory and SOC
>>> specific include directory.
>> 
>> Is the XXX arch-XXX supposed to be an SoC family or a
>> CPU family/architectutre?
>> 
> 
> Usually in 'arch/arm/include/asm' we have both: -
> arch-armv7 (Arch specific. Houses stuff common to ARMv7
> CPU, e.g. Global timer, SP805 WDT..) - arch-mx6 (SoC family
> specific. Houses stuff like SoC specific IOMUX pads..)
>>> 
>>> Which one does "#inculde " refer to?
>>> 
>> 
>> arm/arch is a symbolic link created at compiling time. It points
>> to arm/arch-$(soc), if $(soc) is not defined, then it points to 
>> asm/arch-$(arch). That's my understanding.
> 
> How is that supposed to work when both arch-$(soc) and arch-$(arch)
> are present?  Why are SoC and CPU arch confused in this way?

Primarily because it hasn't been an issue until now really.  What's
wrong with just saying  as needed ?  Or do we
have a volunteer for a big re-jiggering of includes?  Adding a 
like the kernel has would be helpful in some cases, like this.

- -- 
Tom
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBAgAGBQJSRJ3CAAoJENk4IS6UOR1WA7UQALKfEQBWv6KC9poxU5FWy0fF
zcoT8i1YB1jsPsEnSa/QZPZJ0XLeJmJicPbctNImj1WuljMVO8cu50RTfcXgEKuX
g7fLczioupYCV+2fd7FMKsG3JXG0vbLkkDTzSuFNdd4uE2awcoiKCK9LO6XK56gs
/a8oS5fsPJlVPaKnvxy0xI1h2w56FtKScqUOxb4l8JpCBo/5B3FzNQ1tL1ZcG/hn
Lfg09WYNUJOe0axuHE1VGIQOM8KN1d/qwZXwsPcZ8wYH+pF4kwAcg/A9TwWmvJHu
VS+jz0I9wDAXyYPJEcvlDXNWOUKHjRfWLTnh4BKGPVa6jXmuq1UL1KnLBnhntxik
OOsAt45mKru1VTihjqk1+1K2W7zNl100/bX1d3R902mQz/5n4t/H47DRhUa+uLOz
CEdjglOASmZjnLkk8PLKOM3ZoKgJtrrePQO7xX5LPOkFytQ2AphBd1hrFLE3DG2S
r3Bskj5g+FWt+c+jU+pw+P6Ct2tZFAk4uZHjnYI2sE5j0cd7P9OnR2hvEpILDUXo
/Tz5sGuyBaERKKNW3965SrydetMiZZuPfQzxYczIF0ZpQaoOuHaAApyfq8VJbU4q
b7frLpyvO8G/yoh4Wid6i7dQNm8FDnGWz+z+lNub9EIqSAIavIb9otFl2O6T4MvF
b2sHtCcEIdjZH8SIoe/v
=ETM5
-END PGP SIGNATURE-
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] When to create a SoC directory for ARM

2013-09-26 Thread Scott Wood
On Thu, 2013-09-26 at 13:46 -0700, York Sun wrote:
> On 09/26/2013 01:44 PM, Scott Wood wrote:
> > On Thu, 2013-09-26 at 12:57 -0700, York Sun wrote:
> >> On 09/26/2013 12:55 PM, Scott Wood wrote:
> >>> On Thu, 2013-09-26 at 12:48 -0700, York Sun wrote:
>  On 09/26/2013 12:46 PM, Sharma Bhupesh-B45370 wrote:
> >
> >> -Original Message-
> >> From: u-boot-boun...@lists.denx.de 
> >> [mailto:u-boot-boun...@lists.denx.de]
> >> On Behalf Of Scott Wood
> >> Sent: Friday, September 27, 2013 12:53 AM
> >> To: FengHua
> >> Cc: trini; sun york-R58495; u-boot
> >> Subject: Re: [U-Boot] When to create a SoC directory for ARM
> >>
> >> On Thu, 2013-09-26 at 13:23 +0800, FengHua wrote:
> >>> all SOC specific include file should be in
> >>> arch/arm/include/asm/arch-SOC/ or some common directory(like
> >>> include/asm/imx-common). Currently, u-boot only link SOC
> >>> specific(arch-SOC) include directory.
> >>> You could touch a mmu.h file in arch/arm/include/asm/arch-ls2/ and
> >>> include arch/arm/include/asm/arch-armv8/mmu.h.
> >>> or move arch-armv8/mmu.h to arch/arm/include/asm/ to make it as a
> >>> generic file.
> >>> Maybe we should distinguish architecture specific include directory
> >>> and SOC  specific include directory.
> >>
> >> Is the XXX arch-XXX supposed to be an SoC family or a CPU
> >> family/architectutre?
> >>
> >
> > Usually in 'arch/arm/include/asm' we have both:
> > - arch-armv7 (Arch specific. Houses stuff common to ARMv7 CPU, e.g. 
> > Global timer, SP805 WDT..)
> > - arch-mx6 (SoC family specific. Houses stuff like SoC specific IOMUX 
> > pads..)
> >>>
> >>> Which one does "#inculde " refer to?
> >>>
> >>
> >> arm/arch is a symbolic link created at compiling time. It points to
> >> arm/arch-$(soc), if $(soc) is not defined, then it points to
> >> asm/arch-$(arch). That's my understanding.
> > 
> > How is that supposed to work when both arch-$(soc) and arch-$(arch) are
> > present?  Why are SoC and CPU arch confused in this way?
> > 
> 
> It can't. That's why I am struggling. My temporary workaround is to
> include those headers in sub-arch headers.

My question is, more specifically, what is happening today on armv7
relative to this problem?

-Scott



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


Re: [U-Boot] When to create a SoC directory for ARM

2013-09-26 Thread York Sun
On 09/26/2013 01:44 PM, Scott Wood wrote:
> On Thu, 2013-09-26 at 12:57 -0700, York Sun wrote:
>> On 09/26/2013 12:55 PM, Scott Wood wrote:
>>> On Thu, 2013-09-26 at 12:48 -0700, York Sun wrote:
 On 09/26/2013 12:46 PM, Sharma Bhupesh-B45370 wrote:
>
>> -Original Message-
>> From: u-boot-boun...@lists.denx.de [mailto:u-boot-boun...@lists.denx.de]
>> On Behalf Of Scott Wood
>> Sent: Friday, September 27, 2013 12:53 AM
>> To: FengHua
>> Cc: trini; sun york-R58495; u-boot
>> Subject: Re: [U-Boot] When to create a SoC directory for ARM
>>
>> On Thu, 2013-09-26 at 13:23 +0800, FengHua wrote:
>>> all SOC specific include file should be in
>>> arch/arm/include/asm/arch-SOC/ or some common directory(like
>>> include/asm/imx-common). Currently, u-boot only link SOC
>>> specific(arch-SOC) include directory.
>>> You could touch a mmu.h file in arch/arm/include/asm/arch-ls2/ and
>>> include arch/arm/include/asm/arch-armv8/mmu.h.
>>> or move arch-armv8/mmu.h to arch/arm/include/asm/ to make it as a
>>> generic file.
>>> Maybe we should distinguish architecture specific include directory
>>> and SOC  specific include directory.
>>
>> Is the XXX arch-XXX supposed to be an SoC family or a CPU
>> family/architectutre?
>>
>
> Usually in 'arch/arm/include/asm' we have both:
> - arch-armv7 (Arch specific. Houses stuff common to ARMv7 CPU, e.g. 
> Global timer, SP805 WDT..)
> - arch-mx6 (SoC family specific. Houses stuff like SoC specific IOMUX 
> pads..)
>>>
>>> Which one does "#inculde " refer to?
>>>
>>
>> arm/arch is a symbolic link created at compiling time. It points to
>> arm/arch-$(soc), if $(soc) is not defined, then it points to
>> asm/arch-$(arch). That's my understanding.
> 
> How is that supposed to work when both arch-$(soc) and arch-$(arch) are
> present?  Why are SoC and CPU arch confused in this way?
> 

It can't. That's why I am struggling. My temporary workaround is to
include those headers in sub-arch headers.

York



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


Re: [U-Boot] [PATCH 05/11] mtd: Build nand_util.o for CONFIG_ENV_IS_IN_NAND in SPL

2013-09-26 Thread Tom Rini
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 09/26/2013 04:42 PM, Scott Wood wrote:
> On Thu, 2013-09-26 at 16:28 -0400, Tom Rini wrote:
>> Cc: Scott Wood 
>> Signed-off-by: Tom Rini 
>> ---
>>  drivers/mtd/nand/Makefile |1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/mtd/nand/Makefile b/drivers/mtd/nand/Makefile
>> index 366dee6..bb5b29d 100644
>> --- a/drivers/mtd/nand/Makefile
>> +++ b/drivers/mtd/nand/Makefile
>> @@ -24,6 +24,7 @@ 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
>> +COBJS-$(CONFIG_ENV_IS_IN_NAND) += nand_util.o
> 
> Not all NAND SPLs will want this.  Define a new CONFIG_SPL_* symbol, or
> perhaps it could just use CONFIG_SPL_NAND_BASE.

Then they won't get it.  Without CONFIG_SPL_ENV_SUPPORT that all gets
discarded.  And talked about before adding CONFIG_SPL_ENV_... and I
didn't want to go down that path.  If you feel strongly about not
building the object we can guard this with CONFIG_SPL_ENV_SUPPORT checks
perhaps?

- -- 
Tom
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBAgAGBQJSRJz4AAoJENk4IS6UOR1WMfAP/RkD0fqs0QMaS+rXwrFtVSuk
D3wH9KmvehSgY8AL1rq/gpNxFSj/t3/yqdMP6uE1RIJQjlcMsAhXalsy9+QSzDeq
TInAA3gebJVOIJzvJlPEkaR4ybEdQOgtMzcWXqV0mrV626SXfNo6PQ8ZtGxBxAm3
oDBbJw0xkmkqnVgOy+jNDgoPoR8aNl1bbpB0UTb2Iz5rRghf0GYPVeR3J88+Fgtq
cm0sQdklkl28ZnbJFU9uhL7Sdws23QuZBihIwiEwmMqwT1pI17nF/YGm3WaayGd3
Pb4wb+FyesDHIcTwl4fDDN+QMNFQ6oz/3lden6X7a/rPHJWxxxUFQtKFykIfExk3
YnPMud20TDlEHeRvoI4vqqvtBd2/nCjyw/R2UhMgyc0Uk+43lJUbXhiq9XbLk88t
m5RZjsfLGTUl12Uxe5OIh+s8O1BkrmY+knyZSwy8uw0JZcnuuV11A15vNoCMNQzc
vzzXCke8r0rS5Ci3ai2R6XGJX8Thh3QD3+ZYED899B2TwPxHH6wo6saLnNNf4nYt
s41rExlhzCMDRSl3Kd1pnFIFu7butiRZWuRldTY/ASwAZKtvvUOibq9U23HtWwKY
JSLlkkTjIOEsJPZcvPgooMHdJA1Kyt5Lb9SHpgkozqd1Dy0WPA/JOSfgoGoSRhKh
tM0XMWkMuUYt1oNToTkl
=n9Vw
-END PGP SIGNATURE-
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] When to create a SoC directory for ARM

2013-09-26 Thread Scott Wood
On Thu, 2013-09-26 at 12:57 -0700, York Sun wrote:
> On 09/26/2013 12:55 PM, Scott Wood wrote:
> > On Thu, 2013-09-26 at 12:48 -0700, York Sun wrote:
> >> On 09/26/2013 12:46 PM, Sharma Bhupesh-B45370 wrote:
> >>>
>  -Original Message-
>  From: u-boot-boun...@lists.denx.de [mailto:u-boot-boun...@lists.denx.de]
>  On Behalf Of Scott Wood
>  Sent: Friday, September 27, 2013 12:53 AM
>  To: FengHua
>  Cc: trini; sun york-R58495; u-boot
>  Subject: Re: [U-Boot] When to create a SoC directory for ARM
> 
>  On Thu, 2013-09-26 at 13:23 +0800, FengHua wrote:
> > all SOC specific include file should be in
> > arch/arm/include/asm/arch-SOC/ or some common directory(like
> > include/asm/imx-common). Currently, u-boot only link SOC
> > specific(arch-SOC) include directory.
> > You could touch a mmu.h file in arch/arm/include/asm/arch-ls2/ and
> > include arch/arm/include/asm/arch-armv8/mmu.h.
> > or move arch-armv8/mmu.h to arch/arm/include/asm/ to make it as a
> > generic file.
> > Maybe we should distinguish architecture specific include directory
> > and SOC  specific include directory.
> 
>  Is the XXX arch-XXX supposed to be an SoC family or a CPU
>  family/architectutre?
> 
> >>>
> >>> Usually in 'arch/arm/include/asm' we have both:
> >>> - arch-armv7 (Arch specific. Houses stuff common to ARMv7 CPU, e.g. 
> >>> Global timer, SP805 WDT..)
> >>> - arch-mx6 (SoC family specific. Houses stuff like SoC specific IOMUX 
> >>> pads..)
> > 
> > Which one does "#inculde " refer to?
> > 
> 
> arm/arch is a symbolic link created at compiling time. It points to
> arm/arch-$(soc), if $(soc) is not defined, then it points to
> asm/arch-$(arch). That's my understanding.

How is that supposed to work when both arch-$(soc) and arch-$(arch) are
present?  Why are SoC and CPU arch confused in this way?

-Scott



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


Re: [U-Boot] [PATCH 05/11] mtd: Build nand_util.o for CONFIG_ENV_IS_IN_NAND in SPL

2013-09-26 Thread Scott Wood
On Thu, 2013-09-26 at 16:28 -0400, Tom Rini wrote:
> Cc: Scott Wood 
> Signed-off-by: Tom Rini 
> ---
>  drivers/mtd/nand/Makefile |1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/mtd/nand/Makefile b/drivers/mtd/nand/Makefile
> index 366dee6..bb5b29d 100644
> --- a/drivers/mtd/nand/Makefile
> +++ b/drivers/mtd/nand/Makefile
> @@ -24,6 +24,7 @@ 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
> +COBJS-$(CONFIG_ENV_IS_IN_NAND) += nand_util.o

Not all NAND SPLs will want this.  Define a new CONFIG_SPL_* symbol, or
perhaps it could just use CONFIG_SPL_NAND_BASE.

-Scott



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


Re: [U-Boot] [PATCH 04/11] mtd: Add a CONFIG_SPL_MTD_SUPPORT for a more full NAND subsystem in SPL

2013-09-26 Thread Scott Wood
On Thu, 2013-09-26 at 16:28 -0400, Tom Rini wrote:
> This mainly converts the am335x_spl_bch driver to the "normal" format
> which means a slight change to nand_info within the driver.
> 
> Cc: Scott Wood 
> Signed-off-by: Tom Rini 
> ---
>  drivers/mtd/nand/am335x_spl_bch.c |   54 
> ++---
>  include/configs/ti_armv7_common.h |1 +
>  spl/Makefile  |1 +
>  3 files changed, 29 insertions(+), 27 deletions(-)

Acked-by: Scott Wood 

with one caveat:

> diff --git a/include/configs/ti_armv7_common.h 
> b/include/configs/ti_armv7_common.h
> index e89e874..32110f6 100644
> --- a/include/configs/ti_armv7_common.h
> +++ b/include/configs/ti_armv7_common.h
> @@ -244,6 +244,7 @@
>  #define CONFIG_SPL_NAND_BASE
>  #define CONFIG_SPL_NAND_DRIVERS
>  #define CONFIG_SPL_NAND_ECC
> +#define CONFIG_SPL_MTD_SUPPORT
>  #define CONFIG_SYS_NAND_U_BOOT_START CONFIG_SYS_TEXT_BASE
>  #define CONFIG_SYS_NAND_U_BOOT_OFFS  0x8
>  #endif
> diff --git a/spl/Makefile b/spl/Makefile
> index 174d0a7..fa642ec 100644
> --- a/spl/Makefile
> +++ b/spl/Makefile
> @@ -89,6 +89,7 @@ LIBS-$(CONFIG_SPL_FAT_SUPPORT) += fs/fat/libfat.o
>  LIBS-$(CONFIG_SPL_LIBGENERIC_SUPPORT) += lib/libgeneric.o
>  LIBS-$(CONFIG_SPL_POWER_SUPPORT) += drivers/power/libpower.o
>  LIBS-$(CONFIG_SPL_NAND_SUPPORT) += drivers/mtd/nand/libnand.o
> +LIBS-$(CONFIG_SPL_MTD_SUPPORT) += drivers/mtd/libmtd.o
>  LIBS-$(CONFIG_SPL_ONENAND_SUPPORT) += drivers/mtd/onenand/libonenand.o
>  LIBS-$(CONFIG_SPL_DMA_SUPPORT) += drivers/dma/libdma.o
>  LIBS-$(CONFIG_SPL_POST_MEM_SUPPORT) += post/drivers/memory.o

This needs to be documented in the README.

-Scott



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


Re: [U-Boot] MAKEALL build error on usb/master branch

2013-09-26 Thread Troy Kisky

On 9/26/2013 1:22 PM, Marek Vasut wrote:

Dear Troy Kisky,


Hi Marek

I thought you might like to be aware of this error, if not already known.

Known, when building for MXS (mx23 and mx28), you need libssl-dev installed
(openssl development libs and headers). Same rule applies when you use signed
FIT images.

So, solution is to install libssl-dev (for debian-based distro) or whatever your
favorite distro has.

Best regards,
Marek Vasut


Thanks Marek

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


[U-Boot] [PATCH 10/11] a3m071: Make spl_start_uboot test like getenv_yesno does

2013-09-26 Thread Tom Rini
This change makes the behaviour slightly more rebust and will match
other implementations which can use getenv_yesno directly.

Cc: Stefan Roese 
Signed-off-by: Tom Rini 
---
 board/a3m071/a3m071.c |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/board/a3m071/a3m071.c b/board/a3m071/a3m071.c
index 7aeefb2..b96ba81 100644
--- a/board/a3m071/a3m071.c
+++ b/board/a3m071/a3m071.c
@@ -412,7 +412,8 @@ int spl_start_uboot(void)
 
env_init();
getenv_f("boot_os", s, sizeof(s));
-   if ((s != NULL) && (strcmp(s, "yes") == 0))
+   if ((s != NULL) && (*s == '1' || *s == 'y' || *s == 'Y' ||
+   *s == 't' || *s == 'T'))
return 0;
 
return 1;
-- 
1.7.9.5

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


[U-Boot] [PATCH 08/11] README: Add CONFIG_SPL_OS_BOOT to README

2013-09-26 Thread Tom Rini
Signed-off-by: Tom Rini 
---
 README |4 
 1 file changed, 4 insertions(+)

diff --git a/README b/README
index 20ba650..ce8fb37 100644
--- a/README
+++ b/README
@@ -3031,6 +3031,10 @@ FIT uImage format:
supports MMC, NAND and YMODEM loading of U-Boot and NAND
NAND loading of the Linux Kernel.
 
+   CONFIG_SPL_OS_BOOT
+   Enable booting directly to an OS from SPL.
+   See also: doc/README.falcon
+
CONFIG_SPL_DISPLAY_PRINT
For ARM, enable an optional function to print more information
about the running system.
-- 
1.7.9.5

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


[U-Boot] [PATCH 09/11] README.falcon: Document environment variables for falcon mode

2013-09-26 Thread Tom Rini
Signed-off-by: Tom Rini 
---
 doc/README.falcon |9 +
 1 file changed, 9 insertions(+)

diff --git a/doc/README.falcon b/doc/README.falcon
index 6357b1e..bccf6c9 100644
--- a/doc/README.falcon
+++ b/doc/README.falcon
@@ -80,6 +80,15 @@ spl_start_uboot() : required
Returns "0" if SPL should start the kernel, "1" if U-Boot
must be started.
 
+Environment variables
+-
+
+A board may chose to look at the environment for decisions about falcon
+mode.  In this case the following variables may be supported:
+
+boot_os :  Set to yes/Yes/true/True/1 to enable booting to OS,
+   any other value to fall back to U-Boot (including
+   unset)
 
 Using spl command
 -
-- 
1.7.9.5

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


[U-Boot] [PATCH 11/11] spl_mmc/CONFIG_SPL_OS_BOOT: Allow environment to determine what to boot

2013-09-26 Thread Tom Rini
We add two new environment variables, falcon_args_file and
falcon_image_file, which when set will override the compiled in default
values for falcon mode.

Signed-off-by: Tom Rini 
---
 common/spl/spl_mmc.c |   28 +++-
 doc/README.falcon|4 
 2 files changed, 31 insertions(+), 1 deletion(-)

diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c
index fc2f226..5405bbc 100644
--- a/common/spl/spl_mmc.c
+++ b/common/spl/spl_mmc.c
@@ -100,7 +100,33 @@ end:
 static int mmc_load_image_fat_os(struct mmc *mmc)
 {
int err;
-
+#if defined(CONFIG_SPL_ENV_SUPPORT) && defined(CONFIG_SPL_OS_BOOT)
+   char *file;
+
+   file = getenv("falcon_args_file");
+   if (file) {
+   err = file_fat_read(file, (void *)CONFIG_SYS_SPL_ARGS_ADDR, 0);
+   if (err <= 0) {
+   printf("spl: error reading image %s, err - %d, falling 
back to default\n",
+  file, err);
+   goto defaults;
+   }
+   file = getenv("falcon_image_file");
+   if (file) {
+   err = mmc_load_image_fat(mmc, file);
+   if (err != 0) {
+   puts("spl: falling back to default\n");
+   goto defaults;
+   }
+
+   return 0;
+   } else
+   puts("spl: falcon_image_file not set in environment, 
falling back to default\n");
+   } else
+   puts("spl: falcon_args_file not set in environment, falling 
back to default\n");
+
+defaults:
+#endif
err = file_fat_read(CONFIG_SPL_FAT_LOAD_ARGS_NAME,
(void *)CONFIG_SYS_SPL_ARGS_ADDR, 0);
if (err <= 0) {
diff --git a/doc/README.falcon b/doc/README.falcon
index bccf6c9..82a254b 100644
--- a/doc/README.falcon
+++ b/doc/README.falcon
@@ -89,6 +89,10 @@ mode.  In this case the following variables may be supported:
 boot_os :  Set to yes/Yes/true/True/1 to enable booting to OS,
any other value to fall back to U-Boot (including
unset)
+falcon_args_file : Filename to load as the 'args' portion of falcon mode
+   rather than the hard-coded value.
+falcon_image_file :Filename to load as the OS image portion of falcon
+   mode rather than the hard-coded value.
 
 Using spl command
 -
-- 
1.7.9.5

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


[U-Boot] [PATCH 05/11] mtd: Build nand_util.o for CONFIG_ENV_IS_IN_NAND in SPL

2013-09-26 Thread Tom Rini
Cc: Scott Wood 
Signed-off-by: Tom Rini 
---
 drivers/mtd/nand/Makefile |1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mtd/nand/Makefile b/drivers/mtd/nand/Makefile
index 366dee6..bb5b29d 100644
--- a/drivers/mtd/nand/Makefile
+++ b/drivers/mtd/nand/Makefile
@@ -24,6 +24,7 @@ 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
+COBJS-$(CONFIG_ENV_IS_IN_NAND) += nand_util.o
 
 else # not spl
 
-- 
1.7.9.5

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


[U-Boot] [PATCH 04/11] mtd: Add a CONFIG_SPL_MTD_SUPPORT for a more full NAND subsystem in SPL

2013-09-26 Thread Tom Rini
This mainly converts the am335x_spl_bch driver to the "normal" format
which means a slight change to nand_info within the driver.

Cc: Scott Wood 
Signed-off-by: Tom Rini 
---
 drivers/mtd/nand/am335x_spl_bch.c |   54 ++---
 include/configs/ti_armv7_common.h |1 +
 spl/Makefile  |1 +
 3 files changed, 29 insertions(+), 27 deletions(-)

diff --git a/drivers/mtd/nand/am335x_spl_bch.c 
b/drivers/mtd/nand/am335x_spl_bch.c
index c84851b..bd89b06 100644
--- a/drivers/mtd/nand/am335x_spl_bch.c
+++ b/drivers/mtd/nand/am335x_spl_bch.c
@@ -16,7 +16,7 @@
 #include 
 
 static int nand_ecc_pos[] = CONFIG_SYS_NAND_ECCPOS;
-static nand_info_t mtd;
+nand_info_t nand_info[1];
 static struct nand_chip nand_chip;
 
 #define ECCSTEPS   (CONFIG_SYS_NAND_PAGE_SIZE / \
@@ -30,12 +30,12 @@ static struct nand_chip nand_chip;
 static int nand_command(int block, int page, uint32_t offs,
u8 cmd)
 {
-   struct nand_chip *this = mtd.priv;
+   struct nand_chip *this = nand_info[0].priv;
int page_addr = page + block * CONFIG_SYS_NAND_PAGE_COUNT;
void (*hwctrl)(struct mtd_info *mtd, int cmd,
unsigned int ctrl) = this->cmd_ctrl;
 
-   while (!this->dev_ready(&mtd))
+   while (!this->dev_ready(&nand_info[0]))
;
 
/* Emulate NAND_CMD_READOOB */
@@ -45,11 +45,11 @@ static int nand_command(int block, int page, uint32_t offs,
}
 
/* Begin command latch cycle */
-   hwctrl(&mtd, cmd, NAND_CTRL_CLE | NAND_CTRL_CHANGE);
+   hwctrl(&nand_info[0], cmd, NAND_CTRL_CLE | NAND_CTRL_CHANGE);
 
if (cmd == NAND_CMD_RESET) {
-   hwctrl(&mtd, NAND_CMD_NONE, NAND_NCE | NAND_CTRL_CHANGE);
-   while (!this->dev_ready(&mtd))
+   hwctrl(&nand_info[0], NAND_CMD_NONE, NAND_NCE | 
NAND_CTRL_CHANGE);
+   while (!this->dev_ready(&nand_info[0]))
;
return 0;
}
@@ -60,35 +60,35 @@ static int nand_command(int block, int page, uint32_t offs,
 
/* Set ALE and clear CLE to start address cycle */
/* Column address */
-   hwctrl(&mtd, offs & 0xff,
+   hwctrl(&nand_info[0], offs & 0xff,
   NAND_CTRL_ALE | NAND_CTRL_CHANGE); /* A[7:0] */
-   hwctrl(&mtd, (offs >> 8) & 0xff, NAND_CTRL_ALE); /* A[11:9] */
+   hwctrl(&nand_info[0], (offs >> 8) & 0xff, NAND_CTRL_ALE); /* A[11:9] */
/* Row address */
-   hwctrl(&mtd, (page_addr & 0xff), NAND_CTRL_ALE); /* A[19:12] */
-   hwctrl(&mtd, ((page_addr >> 8) & 0xff),
+   hwctrl(&nand_info[0], (page_addr & 0xff), NAND_CTRL_ALE); /* A[19:12] */
+   hwctrl(&nand_info[0], ((page_addr >> 8) & 0xff),
   NAND_CTRL_ALE); /* A[27:20] */
 #ifdef CONFIG_SYS_NAND_5_ADDR_CYCLE
/* One more address cycle for devices > 128MiB */
-   hwctrl(&mtd, (page_addr >> 16) & 0x0f,
+   hwctrl(&nand_info[0], (page_addr >> 16) & 0x0f,
   NAND_CTRL_ALE); /* A[31:28] */
 #endif
-   hwctrl(&mtd, NAND_CMD_NONE, NAND_NCE | NAND_CTRL_CHANGE);
+   hwctrl(&nand_info[0], NAND_CMD_NONE, NAND_NCE | NAND_CTRL_CHANGE);
 
if (cmd == NAND_CMD_READ0) {
/* Latch in address */
-   hwctrl(&mtd, NAND_CMD_READSTART,
+   hwctrl(&nand_info[0], NAND_CMD_READSTART,
   NAND_CTRL_CLE | NAND_CTRL_CHANGE);
-   hwctrl(&mtd, NAND_CMD_NONE, NAND_NCE | NAND_CTRL_CHANGE);
+   hwctrl(&nand_info[0], NAND_CMD_NONE, NAND_NCE | 
NAND_CTRL_CHANGE);
 
/*
 * Wait a while for the data to be ready
 */
-   while (!this->dev_ready(&mtd))
+   while (!this->dev_ready(&nand_info[0]))
;
} else if (cmd == NAND_CMD_RNDOUT) {
-   hwctrl(&mtd, NAND_CMD_RNDOUTSTART, NAND_CTRL_CLE |
+   hwctrl(&nand_info[0], NAND_CMD_RNDOUTSTART, NAND_CTRL_CLE |
NAND_CTRL_CHANGE);
-   hwctrl(&mtd, NAND_CMD_NONE, NAND_NCE | NAND_CTRL_CHANGE);
+   hwctrl(&nand_info[0], NAND_CMD_NONE, NAND_NCE | 
NAND_CTRL_CHANGE);
}
 
return 0;
@@ -96,7 +96,7 @@ static int nand_command(int block, int page, uint32_t offs,
 
 static int nand_is_bad_block(int block)
 {
-   struct nand_chip *this = mtd.priv;
+   struct nand_chip *this = nand_info[0].priv;
 
nand_command(block, 0, CONFIG_SYS_NAND_BAD_BLOCK_POS,
NAND_CMD_READOOB);
@@ -117,7 +117,7 @@ static int nand_is_bad_block(int block)
 
 static int nand_read_page(int block, int page, void *dst)
 {
-   struct nand_chip *this = mtd.priv;
+   struct nand_chip *this = nand_info[0].priv;
u_char ecc_calc[ECCTOTAL];
u_char ecc_code[ECCTOTAL];
u_char oob_data[CONFIG_SYS_NAND_OOBSIZE];
@@ -133,15 +133,15 @@ static int nand_read_page(int block, int

[U-Boot] [PATCH 07/11] am335x_evm: Make SPL_OS also check the boot_os variable for falcon mode

2013-09-26 Thread Tom Rini
We use the same variable as a3m071 in the environment to determine if we
should boot into Linux or U-Boot.  This is useful on boards like
Beaglebone Black or AM335x GP EVM where we have persistent storage for
the environment.

Signed-off-by: Tom Rini 
---
 board/ti/am335x/board.c |   13 -
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/board/ti/am335x/board.c b/board/ti/am335x/board.c
index cc04426..0cfd048 100644
--- a/board/ti/am335x/board.c
+++ b/board/ti/am335x/board.c
@@ -26,6 +26,7 @@
 #include 
 #include 
 #include 
+#include 
 #include "board.h"
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -232,7 +233,17 @@ static struct emif_regs ddr3_evm_emif_reg_data = {
 int spl_start_uboot(void)
 {
/* break into full u-boot on 'c' */
-   return (serial_tstc() && serial_getc() == 'c');
+   if (serial_tstc() && serial_getc() == 'c')
+   return 1;
+
+#ifdef CONFIG_SPL_ENV_SUPPORT
+   env_init();
+   env_relocate_spec();
+   if (getenv_yesno("boot_os") != 1)
+   return 1;
+#endif
+
+   return 0;
 }
 #endif
 
-- 
1.7.9.5

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


[U-Boot] [PATCH 06/11] spl: Make CONFIG_SPL_ENV_SUPPORT have to be set by all users of env in SPL

2013-09-26 Thread Tom Rini
Previously, we forced a "no environment" choice on network using SPL.
Now we allow all users to set where they want to look for their
environment.  This means we have to set CONFIG_SPL_ENV_SUPPORT now for
ti_armv7_common.h.

Signed-off-by: Tom Rini 
---
 common/Makefile   |4 +---
 include/configs/ti_armv7_common.h |1 +
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/common/Makefile b/common/Makefile
index 288690b..4568388 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -197,17 +197,15 @@ COBJS-$(CONFIG_ENV_IS_IN_FLASH) += env_flash.o
 COBJS-$(CONFIG_SPL_YMODEM_SUPPORT) += xyzModem.o
 COBJS-$(CONFIG_SPL_NET_SUPPORT) += miiphyutil.o
 # environment
+ifeq ($(CONFIG_SPL_ENV_SUPPORT),y)
 COBJS-$(CONFIG_SPL_ENV_SUPPORT) += env_attr.o
 COBJS-$(CONFIG_SPL_ENV_SUPPORT) += env_flags.o
 COBJS-$(CONFIG_SPL_ENV_SUPPORT) += env_callback.o
-ifneq ($(CONFIG_SPL_NET_SUPPORT),y)
 COBJS-$(CONFIG_ENV_IS_NOWHERE) += env_nowhere.o
 COBJS-$(CONFIG_ENV_IS_IN_MMC) += env_mmc.o
 COBJS-$(CONFIG_ENV_IS_IN_NAND) += env_nand.o
 COBJS-$(CONFIG_ENV_IS_IN_SPI_FLASH) += env_sf.o
 COBJS-$(CONFIG_ENV_IS_IN_FLASH) += env_flash.o
-else
-COBJS-y += env_nowhere.o
 endif
 endif
 # core command
diff --git a/include/configs/ti_armv7_common.h 
b/include/configs/ti_armv7_common.h
index 32110f6..d15850b 100644
--- a/include/configs/ti_armv7_common.h
+++ b/include/configs/ti_armv7_common.h
@@ -202,6 +202,7 @@
 #define CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME   "u-boot.img"
 
 #ifdef CONFIG_SPL_OS_BOOT
+#define CONFIG_SPL_ENV_SUPPORT /* For 'boot_os' and similar */
 #define CONFIG_SYS_SPL_ARGS_ADDR   (CONFIG_SYS_SDRAM_BASE + 0x100)
 
 /* FAT */
-- 
1.7.9.5

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


[U-Boot] [PATCH 03/11] env_mmc.c: Allow environment to be used within SPL

2013-09-26 Thread Tom Rini
Inside of SPL we only concern ourself with one MMC device, so instead of
being able to use CONFIG_SYS_MMC_ENV_DEV we need to use 0 in SPL.
Switch the code to use a 'dev' variable to facilitate this.

Signed-off-by: Tom Rini 
---
 common/env_mmc.c |   37 ++---
 1 file changed, 30 insertions(+), 7 deletions(-)

diff --git a/common/env_mmc.c b/common/env_mmc.c
index 0ab11d3..ad3ff45 100644
--- a/common/env_mmc.c
+++ b/common/env_mmc.c
@@ -64,6 +64,13 @@ int env_init(void)
 
 static int init_mmc_for_env(struct mmc *mmc)
 {
+#ifdef CONFIG_SYS_MMC_ENV_PART
+   int dev = CONFIG_SYS_MMC_ENV_DEV;
+#ifdef CONFIG_SPL_BUILD
+   dev = 0;
+#endif
+#endif
+
if (!mmc) {
puts("No MMC card found\n");
return -1;
@@ -76,8 +83,7 @@ static int init_mmc_for_env(struct mmc *mmc)
 
 #ifdef CONFIG_SYS_MMC_ENV_PART
if (CONFIG_SYS_MMC_ENV_PART != mmc->part_num) {
-   if (mmc_switch_part(CONFIG_SYS_MMC_ENV_DEV,
-   CONFIG_SYS_MMC_ENV_PART)) {
+   if (mmc_switch_part(dev, CONFIG_SYS_MMC_ENV_PART)) {
puts("MMC partition switch failed\n");
return -1;
}
@@ -90,9 +96,12 @@ static int init_mmc_for_env(struct mmc *mmc)
 static void fini_mmc_for_env(struct mmc *mmc)
 {
 #ifdef CONFIG_SYS_MMC_ENV_PART
+   int dev = CONFIG_SYS_MMC_ENV_DEV;
+#ifdef CONFIG_SPL_BUILD
+   dev = 0;
+#endif
if (CONFIG_SYS_MMC_ENV_PART != mmc->part_num)
-   mmc_switch_part(CONFIG_SYS_MMC_ENV_DEV,
-   mmc->part_num);
+   mmc_switch_part(dev, mmc->part_num);
 #endif
 }
 
@@ -174,11 +183,15 @@ static inline int read_env(struct mmc *mmc, unsigned long 
size,
   unsigned long offset, const void *buffer)
 {
uint blk_start, blk_cnt, n;
+   int dev = CONFIG_SYS_MMC_ENV_DEV;
+#ifdef CONFIG_SPL_BUILD
+   dev = 0;
+#endif
 
blk_start   = ALIGN(offset, mmc->read_bl_len) / mmc->read_bl_len;
blk_cnt = ALIGN(size, mmc->read_bl_len) / mmc->read_bl_len;
 
-   n = mmc->block_dev.block_read(CONFIG_SYS_MMC_ENV_DEV, blk_start,
+   n = mmc->block_dev.block_read(dev, blk_start,
blk_cnt, (uchar *)buffer);
 
return (n == blk_cnt) ? 0 : -1;
@@ -188,13 +201,18 @@ static inline int read_env(struct mmc *mmc, unsigned long 
size,
 void env_relocate_spec(void)
 {
 #if !defined(ENV_IS_EMBEDDED)
-   struct mmc *mmc = find_mmc_device(CONFIG_SYS_MMC_ENV_DEV);
+   struct mmc *mmc;
u32 offset1, offset2;
int read1_fail = 0, read2_fail = 0;
int crc1_ok = 0, crc2_ok = 0;
env_t *ep, *tmp_env1, *tmp_env2;
int ret;
+   int dev = CONFIG_SYS_MMC_ENV_DEV;
+#ifdef CONFIG_SPL_BUILD
+   dev = 0;
+#endif
 
+   mmc = find_mmc_device(dev);
tmp_env1 = (env_t *)malloc(CONFIG_ENV_SIZE);
tmp_env2 = (env_t *)malloc(CONFIG_ENV_SIZE);
if (tmp_env1 == NULL || tmp_env2 == NULL) {
@@ -274,11 +292,16 @@ err:
 void env_relocate_spec(void)
 {
 #if !defined(ENV_IS_EMBEDDED)
-   struct mmc *mmc = find_mmc_device(CONFIG_SYS_MMC_ENV_DEV);
+   struct mmc *mmc;
env_t *ep;
u32 offset;
int ret;
+   int dev = CONFIG_SYS_MMC_ENV_DEV;
+#ifdef CONFIG_SPL_BUILD
+   dev = 0;
+#endif
 
+   mmc = find_mmc_device(dev);
ep = (env_t *)malloc(CONFIG_ENV_SIZE);
if (ep == NULL) {
puts("Can't allocate buffers for environment\n");
-- 
1.7.9.5

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


[U-Boot] [PATCH 01/11] fw_env.c: Increase max dev path to 32

2013-09-26 Thread Tom Rini
Currently our limit is too small to allow for /dev/mmcblk0boot0 to work,
for example.  Expand to 32 for future needs.

Signed-off-by: Tom Rini 
---
 tools/env/fw_env.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c
index 577ce2d..bf5c552 100644
--- a/tools/env/fw_env.c
+++ b/tools/env/fw_env.c
@@ -40,7 +40,7 @@
_min1 < _min2 ? _min1 : _min2; })
 
 struct envdev_s {
-   char devname[16];   /* Device name */
+   char devname[32];   /* Device name */
ulong devoff;   /* Device offset */
ulong env_size; /* environment size */
ulong erase_size;   /* device erase size */
-- 
1.7.9.5

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


[U-Boot] [PATCH 00/11] NAND/MMC environment in SPL, Falcon Mode enhancements

2013-09-26 Thread Tom Rini
Hey all,

This series fixes a few bugs / issues, and then sets things up so that
we can use MMC (or NAND) for environment in SPL, in addition to NOR
flash or simply built-in.  The end result is that Falcon Mode becomes
much more configurable via the environment, and thus from within Linux.

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


[U-Boot] [PATCH 02/11] env_mmc.c: Make the non-redundant env_relocate_spec use malloc not stack

2013-09-26 Thread Tom Rini
Switch the case of non-redundant non-embedded environment to use malloc
to allocate buffers, rather than place them on the stack, like the
redundant case does.

Signed-off-by: Tom Rini 
---
 common/env_mmc.c |   15 ---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/common/env_mmc.c b/common/env_mmc.c
index 65aafa9..0ab11d3 100644
--- a/common/env_mmc.c
+++ b/common/env_mmc.c
@@ -274,11 +274,18 @@ err:
 void env_relocate_spec(void)
 {
 #if !defined(ENV_IS_EMBEDDED)
-   ALLOC_CACHE_ALIGN_BUFFER(char, buf, CONFIG_ENV_SIZE);
struct mmc *mmc = find_mmc_device(CONFIG_SYS_MMC_ENV_DEV);
+   env_t *ep;
u32 offset;
int ret;
 
+   ep = (env_t *)malloc(CONFIG_ENV_SIZE);
+   if (ep == NULL) {
+   puts("Can't allocate buffers for environment\n");
+   ret = 1;
+   goto err;
+   }
+
if (init_mmc_for_env(mmc)) {
ret = 1;
goto err;
@@ -289,12 +296,12 @@ void env_relocate_spec(void)
goto fini;
}
 
-   if (read_env(mmc, CONFIG_ENV_SIZE, offset, buf)) {
+   if (read_env(mmc, CONFIG_ENV_SIZE, offset, ep)) {
ret = 1;
goto fini;
}
 
-   env_import(buf, 1);
+   env_import((char *)ep, 1);
ret = 0;
 
 fini:
@@ -302,6 +309,8 @@ fini:
 err:
if (ret)
set_default_env(NULL);
+
+   free(ep);
 #endif
 }
 #endif /* CONFIG_ENV_OFFSET_REDUND */
-- 
1.7.9.5

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


Re: [U-Boot] [PATCH V5 00/18] Make mv_udc work for i.mx6

2013-09-26 Thread Marek Vasut
Dear Troy Kisky,

> On 9/26/2013 9:18 AM, Stefano Babic wrote:
> > Hi Troy, Marek,
> > 
> > On 26/09/2013 03:41, Troy Kisky wrote:
> >> Stefano, if you would you like to take the last 3 patches,
> >> you should apply "i.MX6Q/DLS: Add MX6_PAD_GPIO_1__USB_OTG_ID"
> >> from Eric Nelson first.
> > 
> > Eric's patch is already in my queue, I will apply it.
> > 
> >> The patches are mostly independent, so if a patch has
> >> an issue, please feel free to skip it.
> >> An exception is 1/17 should be before 2/17 if Stefano's branch merges
> >> upstream first, otherwise nitrogen6x will get a build error.
> > 
> > Maybe it is better if we agree who merge the patchset to avoid breaking
> > the boards (Nitrogen). Mostly the patchset is Marek's stuff, and I have
> > nothing again if Marek will apply also the i.MX relevant parts. It is
> > better to merge this patchset at whole in the same tree as to split it.
> > 
> > Marek, do you agree ?
> > 
> > Regards,
> > Stefano
> 
> Then Marek would need Eric's patch, unless a temporary build error is
> acceptable.

This will go to -next anyway, so if Stefano can pick this OTG_ID mux patch into 
master and push it out into current MW, there will be no problem at all.

I'll pick the whole thing otherwise but only AFTER I reviewed it properly.

Best regards,
Marek Vasut
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] MAKEALL build error on usb/master branch

2013-09-26 Thread Marek Vasut
Dear Troy Kisky,

> Hi Marek
> 
> I thought you might like to be aware of this error, if not already known.

Known, when building for MXS (mx23 and mx28), you need libssl-dev installed 
(openssl development libs and headers). Same rule applies when you use signed 
FIT images.

So, solution is to install libssl-dev (for debian-based distro) or whatever 
your 
favorite distro has.

Best regards,
Marek Vasut
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/1] am33xx: add CONFIG_SYS_NAND_DEVICE_WIDTH to determine NAND device bus-width

2013-09-26 Thread Gupta, Pekon
> From: Scott Wood [mailto:scottw...@freescale.com]
> 
> > On Wed, 2013-09-25 at 22:08 +, Woodruff, Richard wrote:
> > Short comment.  Apologies for top posting:
> >
> > The first incarnations of SPL and loader mainly cared about the boot flash
> device.
> 
> Is there an SPL that cares about something other than the boot device
> now?
> 
AFAIK about SPL driver in drivers/mtd/nand/am335x_spl_bch.c
This driver depends on CONFIG_SYS_NAND_xx  for deriving all device parameter
- CONFIG_SYS_NAND_BLOCK_SIZE
- CONFIG_SYS_NAND_PAGE_SIZE
- CONFIG_SYS_NAND_ECCSIZE
- CONFIG_SYS_NAND_ECCBYTES

Thus, IMO SPL drivers are written for following two uses:
(1) load secondary boot-loader, which can further do dynamic device probing
   And based on that enables some device specific features.
(2) load linux kernel image directly (in falcon-mode SPL_OS_BOOT), which
  will reduce the boot-time as all configurations are static.

So, in either usage SPL drivers need to be statically configured to keep
 their foot-print small and boot them fast.


> > OMAPs require a resistor strap to specify the width of the boot device.  The
> values is latched for SW to read.
> >
> > As such always a run time check of width was sufficient for boot device.
> >
> > On dev board we would have many devices and use DIP switch to select
> which one was in use.  A run time not compile time was way to support this.
> >
> > If information is dynamically available it is better to use this if focus 
> > is boot
> device management.
> >
Agree, This was done on TI814x EVM boards which are development boards.
but if you refer actual production board (custom boards of end-user), having
even a single extra resistor means adding BOM cost.
Also in production boards everything is known, (like NAND bus-width,
page-size, etc), so dynamic detection becomes redundant because linux
would anyways re-do the device probing when it boots.

And if anyone really wants to do dynamic device probing in u-boot. Then
go till u-boot second stage which has most of device probing capabilities
same as linux kernel. (atleast in case of NAND driver).

> > Other tricks writing patterns and reading results is also possible but
> simplicity of compile vs. that is debatable.
> >
> > Regards,
> > Richard W.
> 
> I agree.  Outside of SPL (where hardcoding can be useful due to size
> constraints, and you only care about the boot device), it's best to let
> drivers determine the best way to learn about such configuration.
> 


> > From: Gupta, Pekon 
> >
> > NAND driver needs to know bus-width of the connected NAND device, in
> order to perform proper I/O and initialize itself. Currently there is no 
> CONFIG
> option to provide this information to NAND driver.
> > - SPL NAND driver does not have framework to parse ONFI parameter
> page.
> 
> Is this about SPL?  It looks like a more general change.
> 
Yes, actually I would have loved to see a generic SPL driver for all platforms,
because SPL is mostly statically configured, and it just does plain NAND read
(it doesn’t even support NAND write, etc).
But I do not know the hardware configurations tweaks of other SoC,
So at-least have common CONFIG_SYS_NAND_xx which all SPL drivers can use.

> > - NAND drivers which cannot self initialize
> !defined(CONFIG_SYS_NAND_SELF_INIT)
> >   do not have any information about device bus-width during
> board_nand_init(),
> >   So, any device-width specific configurations are not possible there.
> 
> Convert to self-init.  That's what it's for.
> 
I read it in doc/README.nand: CONFIG_SYS_NAND_SELF_INIT
And this path is applicable only for second-stage u-boot loader.
But today not many drivers are using this model. So just mentioned it here.


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


Re: [U-Boot] [PATCH 1/1] am33xx: add CONFIG_SYS_NAND_DEVICE_WIDTH to determine NAND device bus-width

2013-09-26 Thread Scott Wood
On Thu, 2013-09-26 at 13:14 +, Gupta, Pekon wrote:
> > > From: Gupta, Pekon 
> > >
> > > NAND driver needs to know bus-width of the connected NAND device, in
> > order to perform proper I/O and initialize itself. Currently there is no 
> > CONFIG
> > option to provide this information to NAND driver.
> > > - SPL NAND driver does not have framework to parse ONFI parameter
> > page.
> > 
> > Is this about SPL?  It looks like a more general change.
> > 
> Yes, actually I would have loved to see a generic SPL driver for all 
> platforms,

How could that possibly work?

> because SPL is mostly statically configured, and it just does plain NAND read
> (it doesn’t even support NAND write, etc).
> But I do not know the hardware configurations tweaks of other SoC,
> So at-least have common CONFIG_SYS_NAND_xx which all SPL drivers can use.

Again, are you introducing this symbol for use only in SPL?  It looked
like you were removing the code that does dynamic detection, which would
also affect non-SPL.

-Scott



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


Re: [U-Boot] When to create a SoC directory for ARM

2013-09-26 Thread York Sun
On 09/26/2013 12:55 PM, Scott Wood wrote:
> On Thu, 2013-09-26 at 12:48 -0700, York Sun wrote:
>> On 09/26/2013 12:46 PM, Sharma Bhupesh-B45370 wrote:
>>>
 -Original Message-
 From: u-boot-boun...@lists.denx.de [mailto:u-boot-boun...@lists.denx.de]
 On Behalf Of Scott Wood
 Sent: Friday, September 27, 2013 12:53 AM
 To: FengHua
 Cc: trini; sun york-R58495; u-boot
 Subject: Re: [U-Boot] When to create a SoC directory for ARM

 On Thu, 2013-09-26 at 13:23 +0800, FengHua wrote:
>> Date: Wed, 25 Sep 2013 20:10:13 -0500
>> From: Scott Wood 
>> Subject: Re: [U-Boot] When to create a SoC directory for ARM
>> To: sun york-R58495 
>> Cc: Rini , Wood Scott-B07421 ,
>>  "u-boot@lists.denx.de" , Tom
>> Message-ID: <1380157813.24959.237.ca...@snotra.buserror.net>
>> Content-Type: text/plain; charset="UTF-8"
>> On Wed, 2013-09-25 at 20:04 -0500, sun york-R58495 wrote:
>>> On Sep 25, 2013, at 4:52 PM, Scott Wood wrote:
>>>
 On Wed, 2013-09-25 at 16:30 -0700, York Sun wrote:
> Dear Wolfgang,
>
> I failed to find the guideline, here is my question. Pardon me
> if this is a dump question as I am still new to ARM.
>
> As David Feng post his patch set to add ARMv8 support, I am
> trying to enable it for Freescale implementation. Let's name it
> as LS2 for this discussion. I am thinking to reuse as much as
> possible for existing codes, which include copying some header
> files from powerpc partially. I noticed the SoC field in
> boards.cfg file and I am wondering how to use it effectively. I
> want to put LS2 specific headers to
> arch/arm/include/asm/arch-ls2. Do I need to copy all files from
> arch/arm/include/asm/arch-armv8/? There aren't many but I see
> mmu.h is included in start.S. I have been searching case like
 this in ARMv7 but didn't see shared header file (maybe I missed it).
 Please advise.

 LS2 is (or perhaps more accurately, contains) an implementation
 of ARMv8, so you should be using arch-armv8 rather than copying
 it.
>>>
>>> True. But I guess LS2 won't be the only "LS" Freescale is going to
>>> make. Where is the best place to put the header file for chassis
>>> related registers, like CCSR we have for mpc8xxx.
>> Anything that isn't deeply tied to the ARM architecture should
>> probably just go in include/.
>>>  I am thinking the
>>> best place is arch/arm/include/asm/ls2 (or a better name). Like
>>> other
>>> ARMv7 variants, I am thinking to put ls2 under arch/arm/cpu/armv8/
>>> as well, to host LS-specific code.
>
>> Likewise, if it's specifically tied to armv8 it should go in
>> arch/arm/include/asm/arch-armv8, but I'm not sure what would be tied
>> to both armv8 and ls2.  Most likely anything LS-specific that needs
>> to go under arch/arm/ should go somewhere like
>> arch/arm/include/asm/ls/ (similar to arch/arm/include/asm/imx-
 common).
>
>> -Scott
> all SOC specific include file should be in
> arch/arm/include/asm/arch-SOC/ or some common directory(like
> include/asm/imx-common). Currently, u-boot only link SOC
> specific(arch-SOC) include directory.
> You could touch a mmu.h file in arch/arm/include/asm/arch-ls2/ and
> include arch/arm/include/asm/arch-armv8/mmu.h.
> or move arch-armv8/mmu.h to arch/arm/include/asm/ to make it as a
> generic file.
> Maybe we should distinguish architecture specific include directory
> and SOC  specific include directory.

 Is the XXX arch-XXX supposed to be an SoC family or a CPU
 family/architectutre?

>>>
>>> Usually in 'arch/arm/include/asm' we have both:
>>> - arch-armv7 (Arch specific. Houses stuff common to ARMv7 CPU, e.g. Global 
>>> timer, SP805 WDT..)
>>> - arch-mx6 (SoC family specific. Houses stuff like SoC specific IOMUX 
>>> pads..)
> 
> Which one does "#inculde " refer to?
> 

arm/arch is a symbolic link created at compiling time. It points to
arm/arch-$(soc), if $(soc) is not defined, then it points to
asm/arch-$(arch). That's my understanding.

York


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


Re: [U-Boot] When to create a SoC directory for ARM

2013-09-26 Thread Scott Wood
On Thu, 2013-09-26 at 12:48 -0700, York Sun wrote:
> On 09/26/2013 12:46 PM, Sharma Bhupesh-B45370 wrote:
> > 
> >> -Original Message-
> >> From: u-boot-boun...@lists.denx.de [mailto:u-boot-boun...@lists.denx.de]
> >> On Behalf Of Scott Wood
> >> Sent: Friday, September 27, 2013 12:53 AM
> >> To: FengHua
> >> Cc: trini; sun york-R58495; u-boot
> >> Subject: Re: [U-Boot] When to create a SoC directory for ARM
> >>
> >> On Thu, 2013-09-26 at 13:23 +0800, FengHua wrote:
>  Date: Wed, 25 Sep 2013 20:10:13 -0500
>  From: Scott Wood 
>  Subject: Re: [U-Boot] When to create a SoC directory for ARM
>  To: sun york-R58495 
>  Cc: Rini , Wood Scott-B07421 ,
>   "u-boot@lists.denx.de" , Tom
>  Message-ID: <1380157813.24959.237.ca...@snotra.buserror.net>
>  Content-Type: text/plain; charset="UTF-8"
>  On Wed, 2013-09-25 at 20:04 -0500, sun york-R58495 wrote:
> > On Sep 25, 2013, at 4:52 PM, Scott Wood wrote:
> >
> >> On Wed, 2013-09-25 at 16:30 -0700, York Sun wrote:
> >>> Dear Wolfgang,
> >>>
> >>> I failed to find the guideline, here is my question. Pardon me
> >>> if this is a dump question as I am still new to ARM.
> >>>
> >>> As David Feng post his patch set to add ARMv8 support, I am
> >>> trying to enable it for Freescale implementation. Let's name it
> >>> as LS2 for this discussion. I am thinking to reuse as much as
> >>> possible for existing codes, which include copying some header
> >>> files from powerpc partially. I noticed the SoC field in
> >>> boards.cfg file and I am wondering how to use it effectively. I
> >>> want to put LS2 specific headers to
> >>> arch/arm/include/asm/arch-ls2. Do I need to copy all files from
> >>> arch/arm/include/asm/arch-armv8/? There aren't many but I see
> >>> mmu.h is included in start.S. I have been searching case like
> >> this in ARMv7 but didn't see shared header file (maybe I missed it).
> >> Please advise.
> >>
> >> LS2 is (or perhaps more accurately, contains) an implementation
> >> of ARMv8, so you should be using arch-armv8 rather than copying
> >> it.
> >
> > True. But I guess LS2 won't be the only "LS" Freescale is going to
> > make. Where is the best place to put the header file for chassis
> > related registers, like CCSR we have for mpc8xxx.
>  Anything that isn't deeply tied to the ARM architecture should
>  probably just go in include/.
> >  I am thinking the
> > best place is arch/arm/include/asm/ls2 (or a better name). Like
> > other
> > ARMv7 variants, I am thinking to put ls2 under arch/arm/cpu/armv8/
> > as well, to host LS-specific code.
> >>>
>  Likewise, if it's specifically tied to armv8 it should go in
>  arch/arm/include/asm/arch-armv8, but I'm not sure what would be tied
>  to both armv8 and ls2.  Most likely anything LS-specific that needs
>  to go under arch/arm/ should go somewhere like
>  arch/arm/include/asm/ls/ (similar to arch/arm/include/asm/imx-
> >> common).
> >>>
>  -Scott
> >>> all SOC specific include file should be in
> >>> arch/arm/include/asm/arch-SOC/ or some common directory(like
> >>> include/asm/imx-common). Currently, u-boot only link SOC
> >>> specific(arch-SOC) include directory.
> >>> You could touch a mmu.h file in arch/arm/include/asm/arch-ls2/ and
> >>> include arch/arm/include/asm/arch-armv8/mmu.h.
> >>> or move arch-armv8/mmu.h to arch/arm/include/asm/ to make it as a
> >>> generic file.
> >>> Maybe we should distinguish architecture specific include directory
> >>> and SOC  specific include directory.
> >>
> >> Is the XXX arch-XXX supposed to be an SoC family or a CPU
> >> family/architectutre?
> >>
> > 
> > Usually in 'arch/arm/include/asm' we have both:
> > - arch-armv7 (Arch specific. Houses stuff common to ARMv7 CPU, e.g. Global 
> > timer, SP805 WDT..)
> > - arch-mx6 (SoC family specific. Houses stuff like SoC specific IOMUX 
> > pads..)

Which one does "#inculde " refer to?

-Scott



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


Re: [U-Boot] When to create a SoC directory for ARM

2013-09-26 Thread Sharma Bhupesh-B45370

> -Original Message-
> From: sun york-R58495
> Sent: Friday, September 27, 2013 1:19 AM
> To: Sharma Bhupesh-B45370; Wood Scott-B07421; 'FengHua'
> Cc: 'trini'; sun york-R58495; 'u-boot'
> Subject: Re: [U-Boot] When to create a SoC directory for ARM
> 
> On 09/26/2013 12:46 PM, Sharma Bhupesh-B45370 wrote:
> >
> >> -Original Message-
> >> From: u-boot-boun...@lists.denx.de
> >> [mailto:u-boot-boun...@lists.denx.de]
> >> On Behalf Of Scott Wood
> >> Sent: Friday, September 27, 2013 12:53 AM
> >> To: FengHua
> >> Cc: trini; sun york-R58495; u-boot
> >> Subject: Re: [U-Boot] When to create a SoC directory for ARM
> >>
> >> On Thu, 2013-09-26 at 13:23 +0800, FengHua wrote:
>  Date: Wed, 25 Sep 2013 20:10:13 -0500
>  From: Scott Wood 
>  Subject: Re: [U-Boot] When to create a SoC directory for ARM
>  To: sun york-R58495 
>  Cc: Rini , Wood Scott-B07421 ,
>   "u-boot@lists.denx.de" , Tom
>  Message-ID: <1380157813.24959.237.ca...@snotra.buserror.net>
>  Content-Type: text/plain; charset="UTF-8"
>  On Wed, 2013-09-25 at 20:04 -0500, sun york-R58495 wrote:
> > On Sep 25, 2013, at 4:52 PM, Scott Wood wrote:
> >
> >> On Wed, 2013-09-25 at 16:30 -0700, York Sun wrote:
> >>> Dear Wolfgang,
> >>>
> >>> I failed to find the guideline, here is my question. Pardon me
> >>> if this is a dump question as I am still new to ARM.
> >>>
> >>> As David Feng post his patch set to add ARMv8 support, I am
> >>> trying to enable it for Freescale implementation. Let's name it
> >>> as LS2 for this discussion. I am thinking to reuse as much as
> >>> possible for existing codes, which include copying some header
> >>> files from powerpc partially. I noticed the SoC field in
> >>> boards.cfg file and I am wondering how to use it effectively. I
> >>> want to put LS2 specific headers to
> >>> arch/arm/include/asm/arch-ls2. Do I need to copy all files from
> >>> arch/arm/include/asm/arch-armv8/? There aren't many but I see
> >>> mmu.h is included in start.S. I have been searching case like
> >> this in ARMv7 but didn't see shared header file (maybe I missed it).
> >> Please advise.
> >>
> >> LS2 is (or perhaps more accurately, contains) an implementation
> >> of ARMv8, so you should be using arch-armv8 rather than copying
> >> it.
> >
> > True. But I guess LS2 won't be the only "LS" Freescale is going to
> > make. Where is the best place to put the header file for chassis
> > related registers, like CCSR we have for mpc8xxx.
>  Anything that isn't deeply tied to the ARM architecture should
>  probably just go in include/.
> >  I am thinking the
> > best place is arch/arm/include/asm/ls2 (or a better name). Like
> > other
> > ARMv7 variants, I am thinking to put ls2 under arch/arm/cpu/armv8/
> > as well, to host LS-specific code.
> >>>
>  Likewise, if it's specifically tied to armv8 it should go in
>  arch/arm/include/asm/arch-armv8, but I'm not sure what would be
>  tied to both armv8 and ls2.  Most likely anything LS-specific that
>  needs to go under arch/arm/ should go somewhere like
>  arch/arm/include/asm/ls/ (similar to arch/arm/include/asm/imx-
> >> common).
> >>>
>  -Scott
> >>> all SOC specific include file should be in
> >>> arch/arm/include/asm/arch-SOC/ or some common directory(like
> >>> include/asm/imx-common). Currently, u-boot only link SOC
> >>> specific(arch-SOC) include directory.
> >>> You could touch a mmu.h file in arch/arm/include/asm/arch-ls2/ and
> >>> include arch/arm/include/asm/arch-armv8/mmu.h.
> >>> or move arch-armv8/mmu.h to arch/arm/include/asm/ to make it as a
> >>> generic file.
> >>> Maybe we should distinguish architecture specific include directory
> >>> and SOC  specific include directory.
> >>
> >> Is the XXX arch-XXX supposed to be an SoC family or a CPU
> >> family/architectutre?
> >>
> >
> > Usually in 'arch/arm/include/asm' we have both:
> > - arch-armv7 (Arch specific. Houses stuff common to ARMv7 CPU, e.g.
> > Global timer, SP805 WDT..)
> > - arch-mx6 (SoC family specific. Houses stuff like SoC specific IOMUX
> > pads..)
> >
> > We should have something similar for LayerScape.
> >
> >
> If you look closely, you will find arch-armv7 and its sub-arch including
> am33xx, at91, exynos, etc.
> 

I cannot find any sub-arch inside 'arch/arm/include/asm/arch-armv7' (I am 
referring to reference [1])
I think you are talking about 'arch/arm/cpu/arch-armv7'. That's not what I was 
referring to my original
mail.

I believe David was mentioning the same in his mail (mmu.h inside 
'arch/arm/include/asm/arch-armv8') .

References:
[1] 
http://git.denx.de/?p=u-boot.git;a=tree;f=arch/arm/include/asm/arch-armv7;h=cc9d1ccedcba6881922b12ae8377627cb8632c46;hb=HEAD

Regards,
Bhupesh


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

Re: [U-Boot] When to create a SoC directory for ARM

2013-09-26 Thread York Sun
On 09/26/2013 12:46 PM, Sharma Bhupesh-B45370 wrote:
> 
>> -Original Message-
>> From: u-boot-boun...@lists.denx.de [mailto:u-boot-boun...@lists.denx.de]
>> On Behalf Of Scott Wood
>> Sent: Friday, September 27, 2013 12:53 AM
>> To: FengHua
>> Cc: trini; sun york-R58495; u-boot
>> Subject: Re: [U-Boot] When to create a SoC directory for ARM
>>
>> On Thu, 2013-09-26 at 13:23 +0800, FengHua wrote:
 Date: Wed, 25 Sep 2013 20:10:13 -0500
 From: Scott Wood 
 Subject: Re: [U-Boot] When to create a SoC directory for ARM
 To: sun york-R58495 
 Cc: Rini , Wood Scott-B07421 ,
"u-boot@lists.denx.de" , Tom
 Message-ID: <1380157813.24959.237.ca...@snotra.buserror.net>
 Content-Type: text/plain; charset="UTF-8"
 On Wed, 2013-09-25 at 20:04 -0500, sun york-R58495 wrote:
> On Sep 25, 2013, at 4:52 PM, Scott Wood wrote:
>
>> On Wed, 2013-09-25 at 16:30 -0700, York Sun wrote:
>>> Dear Wolfgang,
>>>
>>> I failed to find the guideline, here is my question. Pardon me
>>> if this is a dump question as I am still new to ARM.
>>>
>>> As David Feng post his patch set to add ARMv8 support, I am
>>> trying to enable it for Freescale implementation. Let's name it
>>> as LS2 for this discussion. I am thinking to reuse as much as
>>> possible for existing codes, which include copying some header
>>> files from powerpc partially. I noticed the SoC field in
>>> boards.cfg file and I am wondering how to use it effectively. I
>>> want to put LS2 specific headers to
>>> arch/arm/include/asm/arch-ls2. Do I need to copy all files from
>>> arch/arm/include/asm/arch-armv8/? There aren't many but I see
>>> mmu.h is included in start.S. I have been searching case like
>> this in ARMv7 but didn't see shared header file (maybe I missed it).
>> Please advise.
>>
>> LS2 is (or perhaps more accurately, contains) an implementation
>> of ARMv8, so you should be using arch-armv8 rather than copying
>> it.
>
> True. But I guess LS2 won't be the only "LS" Freescale is going to
> make. Where is the best place to put the header file for chassis
> related registers, like CCSR we have for mpc8xxx.
 Anything that isn't deeply tied to the ARM architecture should
 probably just go in include/.
>  I am thinking the
> best place is arch/arm/include/asm/ls2 (or a better name). Like
> other
> ARMv7 variants, I am thinking to put ls2 under arch/arm/cpu/armv8/
> as well, to host LS-specific code.
>>>
 Likewise, if it's specifically tied to armv8 it should go in
 arch/arm/include/asm/arch-armv8, but I'm not sure what would be tied
 to both armv8 and ls2.  Most likely anything LS-specific that needs
 to go under arch/arm/ should go somewhere like
 arch/arm/include/asm/ls/ (similar to arch/arm/include/asm/imx-
>> common).
>>>
 -Scott
>>> all SOC specific include file should be in
>>> arch/arm/include/asm/arch-SOC/ or some common directory(like
>>> include/asm/imx-common). Currently, u-boot only link SOC
>>> specific(arch-SOC) include directory.
>>> You could touch a mmu.h file in arch/arm/include/asm/arch-ls2/ and
>>> include arch/arm/include/asm/arch-armv8/mmu.h.
>>> or move arch-armv8/mmu.h to arch/arm/include/asm/ to make it as a
>>> generic file.
>>> Maybe we should distinguish architecture specific include directory
>>> and SOC  specific include directory.
>>
>> Is the XXX arch-XXX supposed to be an SoC family or a CPU
>> family/architectutre?
>>
> 
> Usually in 'arch/arm/include/asm' we have both:
> - arch-armv7 (Arch specific. Houses stuff common to ARMv7 CPU, e.g. Global 
> timer, SP805 WDT..)
> - arch-mx6 (SoC family specific. Houses stuff like SoC specific IOMUX pads..)
> 
> We should have something similar for LayerScape.
> 
>
If you look closely, you will find arch-armv7 and its sub-arch including
am33xx, at91, exynos, etc.

York



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


Re: [U-Boot] When to create a SoC directory for ARM

2013-09-26 Thread Sharma Bhupesh-B45370

> -Original Message-
> From: u-boot-boun...@lists.denx.de [mailto:u-boot-boun...@lists.denx.de]
> On Behalf Of Scott Wood
> Sent: Friday, September 27, 2013 12:53 AM
> To: FengHua
> Cc: trini; sun york-R58495; u-boot
> Subject: Re: [U-Boot] When to create a SoC directory for ARM
> 
> On Thu, 2013-09-26 at 13:23 +0800, FengHua wrote:
> > > Date: Wed, 25 Sep 2013 20:10:13 -0500
> > > From: Scott Wood 
> > > Subject: Re: [U-Boot] When to create a SoC directory for ARM
> > > To: sun york-R58495 
> > > Cc: Rini , Wood Scott-B07421 ,
> > >   "u-boot@lists.denx.de" , Tom
> > > Message-ID: <1380157813.24959.237.ca...@snotra.buserror.net>
> > > Content-Type: text/plain; charset="UTF-8"
> > > On Wed, 2013-09-25 at 20:04 -0500, sun york-R58495 wrote:
> > > > On Sep 25, 2013, at 4:52 PM, Scott Wood wrote:
> > > >
> > > > > On Wed, 2013-09-25 at 16:30 -0700, York Sun wrote:
> > > > >> Dear Wolfgang,
> > > > >>
> > > > >> I failed to find the guideline, here is my question. Pardon me
> > > > >> if this is a dump question as I am still new to ARM.
> > > > >>
> > > > >> As David Feng post his patch set to add ARMv8 support, I am
> > > > >> trying to enable it for Freescale implementation. Let's name it
> > > > >> as LS2 for this discussion. I am thinking to reuse as much as
> > > > >> possible for existing codes, which include copying some header
> > > > >> files from powerpc partially. I noticed the SoC field in
> > > > >> boards.cfg file and I am wondering how to use it effectively. I
> > > > >> want to put LS2 specific headers to
> > > > >> arch/arm/include/asm/arch-ls2. Do I need to copy all files from
> > > > >> arch/arm/include/asm/arch-armv8/? There aren't many but I see
> > > > >> mmu.h is included in start.S. I have been searching case like
> this in ARMv7 but didn't see shared header file (maybe I missed it).
> Please advise.
> > > > >
> > > > > LS2 is (or perhaps more accurately, contains) an implementation
> > > > > of ARMv8, so you should be using arch-armv8 rather than copying
> it.
> > > >
> > > > True. But I guess LS2 won't be the only "LS" Freescale is going to
> > > > make. Where is the best place to put the header file for chassis
> > > > related registers, like CCSR we have for mpc8xxx.
> > > Anything that isn't deeply tied to the ARM architecture should
> > > probably just go in include/.
> > > >  I am thinking the
> > > > best place is arch/arm/include/asm/ls2 (or a better name). Like
> > > > other
> > > > ARMv7 variants, I am thinking to put ls2 under arch/arm/cpu/armv8/
> > > > as well, to host LS-specific code.
> >
> > > Likewise, if it's specifically tied to armv8 it should go in
> > > arch/arm/include/asm/arch-armv8, but I'm not sure what would be tied
> > > to both armv8 and ls2.  Most likely anything LS-specific that needs
> > > to go under arch/arm/ should go somewhere like
> > > arch/arm/include/asm/ls/ (similar to arch/arm/include/asm/imx-
> common).
> >
> > > -Scott
> > all SOC specific include file should be in
> > arch/arm/include/asm/arch-SOC/ or some common directory(like
> > include/asm/imx-common). Currently, u-boot only link SOC
> > specific(arch-SOC) include directory.
> > You could touch a mmu.h file in arch/arm/include/asm/arch-ls2/ and
> > include arch/arm/include/asm/arch-armv8/mmu.h.
> > or move arch-armv8/mmu.h to arch/arm/include/asm/ to make it as a
> > generic file.
> > Maybe we should distinguish architecture specific include directory
> > and SOC  specific include directory.
> 
> Is the XXX arch-XXX supposed to be an SoC family or a CPU
> family/architectutre?
> 

Usually in 'arch/arm/include/asm' we have both:
- arch-armv7 (Arch specific. Houses stuff common to ARMv7 CPU, e.g. Global 
timer, SP805 WDT..)
- arch-mx6 (SoC family specific. Houses stuff like SoC specific IOMUX pads..)

We should have something similar for LayerScape.

Regards,
Bhupesh

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


Re: [U-Boot] [PATCH v10 1/6] core support of arm64

2013-09-26 Thread Scott Wood
Sigh.  It wasn't.  It's a hypothetical possibility to help guide the
decision of whether to classify a piece of code as "arm64" or "armv8".

-Scott

On Thu, 2013-09-26 at 10:30 +0530, Mj Embd wrote:
> When "64-bit ARMv9" was announced ? 
> 
> 
> On Thu, Sep 26, 2013 at 4:46 AM, Scott Wood 
> wrote:
> On Tue, 2013-09-17 at 16:37 +0800, FengHua wrote:
> >
> >
> > > -原始邮件-
> > > 发件人: "Scott Wood" 
> > > 发送时间: 2013年9月17日 星期二
> > > 收件人: feng...@phytium.com.cn
> > > 抄送: u-boot@lists.denx.de, tr...@ti.com,
> albert.u.b...@aribaud.net, w...@denx.de, b45...@freescale.com
> > > 主题: Re: [PATCH v10 1/6] core support of arm64
> > >
> > > On Mon, 2013-09-16 at 16:08 +0800, feng...@phytium.com.cn
> wrote:
> > > > From: David Feng 
> > > >
> > > > Signed-off-by: David Feng 
> > > > ---
> > >
> > > You've still got CONFIG_ARMV8 in places that should be
> CONFIG_ARM64
> >
> > I am hesitate to use CONFIG_ARM64 instead of CONFIG _ARMV8.
> > I am not sure whether all the CONFIG_ARMV8 could be replaced
> with CONFIG_ARM64
> > or CONFIG_ARMV8 and CONFIG_ARMV64 are both needed.
> > I will take this into account in the next.
> 
> 
> If it inherently relates to being 64-bit (including ABI
> issues), use
> CONFIG_ARM64.  If it's something that is new in ARMv8 but
> isn't
> specifically due to 64-bitness (e.g. cache stuff, if it's
> different from
> ARMv7), and could reasonably be different in a 64-bit ARMv9,
> then use
> CONFIG_ARMV8.
> 
> -Scott
> 
> 
> 
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
> 
> 
> 
> 
> 
> -- 
> -mj



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


[U-Boot] MAKEALL build error on usb/master branch

2013-09-26 Thread Troy Kisky

Hi Marek

I thought you might like to be aware of this error, if not already known.

Thanks
Troy


/u-boot-imx6/LOG$ cat mx28evk.ERR
mxsimage.c:18:25: fatal error: openssl/evp.h: No such file or directory
compilation terminated.
make[1]: *** [mxsimage.o] Error 1
make[1]: *** Waiting for unfinished jobs
make[1]: *** wait: No child processes.  Stop.
make: *** [tools] Error 2

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


Re: [U-Boot] When to create a SoC directory for ARM

2013-09-26 Thread Scott Wood
On Thu, 2013-09-26 at 13:23 +0800, FengHua wrote:
> > Date: Wed, 25 Sep 2013 20:10:13 -0500
> > From: Scott Wood 
> > Subject: Re: [U-Boot] When to create a SoC directory for ARM
> > To: sun york-R58495 
> > Cc: Rini , Wood Scott-B07421 ,
> > "u-boot@lists.denx.de" , Tom
> > Message-ID: <1380157813.24959.237.ca...@snotra.buserror.net>
> > Content-Type: text/plain; charset="UTF-8"
> > On Wed, 2013-09-25 at 20:04 -0500, sun york-R58495 wrote:
> > > On Sep 25, 2013, at 4:52 PM, Scott Wood wrote:
> > > 
> > > > On Wed, 2013-09-25 at 16:30 -0700, York Sun wrote:
> > > >> Dear Wolfgang,
> > > >> 
> > > >> I failed to find the guideline, here is my question. Pardon me if this
> > > >> is a dump question as I am still new to ARM.
> > > >> 
> > > >> As David Feng post his patch set to add ARMv8 support, I am trying to
> > > >> enable it for Freescale implementation. Let's name it as LS2 for this
> > > >> discussion. I am thinking to reuse as much as possible for existing
> > > >> codes, which include copying some header files from powerpc partially. 
> > > >> I
> > > >> noticed the SoC field in boards.cfg file and I am wondering how to use
> > > >> it effectively. I want to put LS2 specific headers to
> > > >> arch/arm/include/asm/arch-ls2. Do I need to copy all files from
> > > >> arch/arm/include/asm/arch-armv8/? There aren't many but I see mmu.h is
> > > >> included in start.S. I have been searching case like this in ARMv7 but
> > > >> didn't see shared header file (maybe I missed it). Please advise.
> > > > 
> > > > LS2 is (or perhaps more accurately, contains) an implementation of
> > > > ARMv8, so you should be using arch-armv8 rather than copying it.
> > > 
> > > True. But I guess LS2 won't be the only "LS" Freescale is going to
> > > make. Where is the best place to put the header file for chassis
> > > related registers, like CCSR we have for mpc8xxx.
> > Anything that isn't deeply tied to the ARM architecture should probably
> > just go in include/.
> > >  I am thinking the
> > > best place is arch/arm/include/asm/ls2 (or a better name). Like other
> > > ARMv7 variants, I am thinking to put ls2 under arch/arm/cpu/armv8/ as
> > > well, to host LS-specific code.
> 
> > Likewise, if it's specifically tied to armv8 it should go in
> > arch/arm/include/asm/arch-armv8, but I'm not sure what would be tied to
> > both armv8 and ls2.  Most likely anything LS-specific that needs to go
> > under arch/arm/ should go somewhere like arch/arm/include/asm/ls/
> > (similar to arch/arm/include/asm/imx-common).
> 
> > -Scott
> all SOC specific include file should be
> in arch/arm/include/asm/arch-SOC/ or
> some common directory(like include/asm/imx-common). Currently, u-boot
> only link SOC specific(arch-SOC) include directory.
> You could touch a mmu.h file in arch/arm/include/asm/arch-ls2/ and
> include
> arch/arm/include/asm/arch-armv8/mmu.h.
> or move arch-armv8/mmu.h to arch/arm/include/asm/ to make it as a
> generic file.
> Maybe we should distinguish architecture specific include directory
> and SOC
>  specific include directory.

Is the XXX arch-XXX supposed to be an SoC family or a CPU
family/architectutre?

-Scott




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


Re: [U-Boot] When to create a SoC directory for ARM

2013-09-26 Thread York Sun
On 09/26/2013 03:49 AM, FengHua wrote:
> 
> 
> 
>> -原始邮件-
>> 发件人: "sun york-R58495" 
>> 发送时间: 2013年9月26日 星期四
>> 收件人: FengHua 
>> 抄送: "albert.u.boot" , trini , "Wood
>>  Scott-B07421" , u-boot 
>> 主题: Re: [U-Boot] When to create a SoC directory for ARM
>>
>>
>> On Sep 25, 2013, at 10:23 PM, FengHua wrote:
>>
 Date: Wed, 25 Sep 2013 20:10:13 -0500
 From: Scott Wood 
 Subject: Re: [U-Boot] When to create a SoC directory for ARM
 To: sun york-R58495 
 Cc: Rini , Wood Scott-B07421 ,
"u-boot@lists.denx.de" , Tom
 Message-ID: <1380157813.24959.237.ca...@snotra.buserror.net>
 Content-Type: text/plain; charset="UTF-8"
>>>
 On Wed, 2013-09-25 at 20:04 -0500, sun york-R58495 wrote:
> On Sep 25, 2013, at 4:52 PM, Scott Wood wrote:
>
>> On Wed, 2013-09-25 at 16:30 -0700, York Sun wrote:
>>> Dear Wolfgang,
>>>
>>> I failed to find the guideline, here is my question. Pardon me if this
>>> is a dump question as I am still new to ARM.
>>>
>>> As David Feng post his patch set to add ARMv8 support, I am trying to
>>> enable it for Freescale implementation. Let's name it as LS2 for this
>>> discussion. I am thinking to reuse as much as possible for existing
>>> codes, which include copying some header files from powerpc partially. I
>>> noticed the SoC field in boards.cfg file and I am wondering how to use
>>> it effectively. I want to put LS2 specific headers to
>>> arch/arm/include/asm/arch-ls2. Do I need to copy all files from
>>> arch/arm/include/asm/arch-armv8/? There aren't many but I see mmu.h is
>>> included in start.S. I have been searching case like this in ARMv7 but
>>> didn't see shared header file (maybe I missed it). Please advise.
>>
>> LS2 is (or perhaps more accurately, contains) an implementation of
>> ARMv8, so you should be using arch-armv8 rather than copying it.
>
> True. But I guess LS2 won't be the only "LS" Freescale is going to
> make. Where is the best place to put the header file for chassis
> related registers, like CCSR we have for mpc8xxx.
>>>
 Anything that isn't deeply tied to the ARM architecture should probably
 just go in include/.
>  I am thinking the
> best place is arch/arm/include/asm/ls2 (or a better name). Like other
> ARMv7 variants, I am thinking to put ls2 under arch/arm/cpu/armv8/ as
> well, to host LS-specific code.
>>>
 Likewise, if it's specifically tied to armv8 it should go in
 arch/arm/include/asm/arch-armv8, but I'm not sure what would be tied to
 both armv8 and ls2.  Most likely anything LS-specific that needs to go
 under arch/arm/ should go somewhere like arch/arm/include/asm/ls/
 (similar to arch/arm/include/asm/imx-common).
>>>
 -Scott
>>>
>>> all SOC specific include file should be in arch/arm/include/asm/arch-SOC/ or
>>> some common directory(like include/asm/imx-common). Currently, u-boot only 
>>> link SOC specific(arch-SOC) include directory.
>>> You could touch a mmu.h file in arch/arm/include/asm/arch-ls2/ and include
>>> arch/arm/include/asm/arch-armv8/mmu.h.
>>> or move arch-armv8/mmu.h to arch/arm/include/asm/ to make it as a generic 
>>> file.
>>> Maybe we should distinguish architecture specific include directory and SOC
>>>  specific include directory.
>>
>>
>> I was thinking to change the include in start.S to
>>
>> #include 
>>
> 
> The current arch-armv8/mum.h is based on armv8 architecture.
> Maybe just maybe some armv8 processor will not implement some features of it
> for example 64K page size, then it do not works.
> So, maybe it's better to touch a mmu.h file in include/asm/arch_SOC and 
> include arch-armv8/mmu.h or make different implementation.

How does the arch-xxx work in general? I found no example to use header
files from both asm/arch-xxx and asm/arch directories.

York



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


Re: [U-Boot] [PATCH V5 00/18] Make mv_udc work for i.mx6

2013-09-26 Thread Troy Kisky

On 9/26/2013 9:18 AM, Stefano Babic wrote:

Hi Troy, Marek,

On 26/09/2013 03:41, Troy Kisky wrote:


Stefano, if you would you like to take the last 3 patches,
you should apply "i.MX6Q/DLS: Add MX6_PAD_GPIO_1__USB_OTG_ID"
from Eric Nelson first.

Eric's patch is already in my queue, I will apply it.


The patches are mostly independent, so if a patch has
an issue, please feel free to skip it.
An exception is 1/17 should be before 2/17 if Stefano's branch merges upstream 
first,
otherwise nitrogen6x will get a build error.

Maybe it is better if we agree who merge the patchset to avoid breaking
the boards (Nitrogen). Mostly the patchset is Marek's stuff, and I have
nothing again if Marek will apply also the i.MX relevant parts. It is
better to merge this patchset at whole in the same tree as to split it.

Marek, do you agree ?

Regards,
Stefano




Then Marek would need Eric's patch, unless a temporary build error is 
acceptable.


Thanks
Troy

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


Re: [U-Boot] [PATCH 0/1] Fix ethernet regression on pcm051

2013-09-26 Thread Mugunthan V N
On 9/25/2013 5:21 AM, Lars Poeschel wrote:
> From: Lars Poeschel 
>
> I compiled and tried v2013.10-rc2 on pcm051 and it fails booting over
> tftp. I could bisect 2bf36ac638ab2db9f0295aa47064976eeebf80c1 as the
> cause of the problem. It moves bd_ram_ofs from the cpsw driver to the
> board files. Adding the bd_ram_ofs to the board file of pcm051 fixes
> the problem. That is what the patch does.
> A quick grep reveals, that igep0033 MAY also be affected.
> As the patch is simple and obivous and fixes a regression I'd like to
> get this in before the v2013.10 release.
>
> Thanks
>
> Lars Poeschel (1):
>   pcm051: Supply a bd_ram_ofs for the cpsw driver
>
>  board/phytec/pcm051/board.c | 1 +
>  1 file changed, 1 insertion(+)
>
Acked-by: Mugunthan V N 

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


Re: [U-Boot] [PATCH V5 00/18] Make mv_udc work for i.mx6

2013-09-26 Thread Stefano Babic
Hi Troy, Marek,

On 26/09/2013 03:41, Troy Kisky wrote:

> Stefano, if you would you like to take the last 3 patches,
> you should apply "i.MX6Q/DLS: Add MX6_PAD_GPIO_1__USB_OTG_ID"
> from Eric Nelson first.

Eric's patch is already in my queue, I will apply it.

> 
> The patches are mostly independent, so if a patch has
> an issue, please feel free to skip it.
> An exception is 1/17 should be before 2/17 if Stefano's branch merges 
> upstream first,
> otherwise nitrogen6x will get a build error.

Maybe it is better if we agree who merge the patchset to avoid breaking
the boards (Nitrogen). Mostly the patchset is Marek's stuff, and I have
nothing again if Marek will apply also the i.MX relevant parts. It is
better to merge this patchset at whole in the same tree as to split it.

Marek, do you agree ?

Regards,
Stefano


-- 
=
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] I2C:Zynq: Adapt this driver to the new model

2013-09-26 Thread Michael Burr
Signed-off-by: Michael Burr 
Cc: Heiko Schocher 
Cc: Michal Simek 
---
=== Note: this patch depends on the previous patch titled
=== "[PATCH] I2C: Zynq: Support for 0-length register address"
=== submitted 24 Sep. 2013.

Tested on Xilinx ZC702 eval board:
Select various I2C chips using TI PCA9548 bus multiplexer.
Write and read registers with addresses of length 0 and 1.

 drivers/i2c/zynq_i2c.c |  108 ++--
 1 file changed, 67 insertions(+), 41 deletions(-)

diff --git a/drivers/i2c/zynq_i2c.c b/drivers/i2c/zynq_i2c.c
index 9cbd3e4..7972a59 100644
--- a/drivers/i2c/zynq_i2c.c
+++ b/drivers/i2c/zynq_i2c.c
@@ -7,6 +7,8 @@
  *
  * Copyright (c) 2012-2013 Xilinx, Michal Simek
  *
+ * Copyright (c) 2013 Logic PD, Michael Burr
+ *
  * SPDX-License-Identifier:GPL-2.0+
  */
 
@@ -64,18 +66,28 @@ struct zynq_i2c_registers {
 #define ZYNQ_I2C_FIFO_DEPTH16
 #define ZYNQ_I2C_TRANSFERT_SIZE_MAX255 /* Controller transfer limit */
 
-#if defined(CONFIG_ZYNQ_I2C0)
-# define ZYNQ_I2C_BASE ZYNQ_I2C_BASEADDR0
-#else
-# define ZYNQ_I2C_BASE ZYNQ_I2C_BASEADDR1
-#endif
-
-static struct zynq_i2c_registers *zynq_i2c =
-   (struct zynq_i2c_registers *)ZYNQ_I2C_BASE;
+static struct zynq_i2c_registers *i2c_select(struct i2c_adapter *adap)
+{
+   return adap->hwadapnr ?
+  /* Zynq PS I2C1 */
+  (struct zynq_i2c_registers *)ZYNQ_I2C_BASEADDR1 :
+  /* Zynq PS I2C0 */
+  (struct zynq_i2c_registers *)ZYNQ_I2C_BASEADDR0;
+}
 
 /* I2C init called by cmd_i2c when doing 'i2c reset'. */
-void i2c_init(int requested_speed, int slaveadd)
+static void zynq_i2c_init(struct i2c_adapter *adap, int speed, int slaveaddr)
 {
+   struct zynq_i2c_registers *zynq_i2c = i2c_select(adap);
+
+   if (speed != 10)
+   debug("Warning: requested speed not supported.\n");
+   if (slaveaddr)
+   debug("Warning: slave mode not supported.\n");
+
+   /* The following _assumes_ clock rate cpu_1x = 111 MHz */
+   /* This could use improvement! Also see 'i2c_set_bus_speed' below */
+
/* 111MHz / ( (3 * 17) * 22 ) = ~100KHz */
writel((16 << ZYNQ_I2C_CONTROL_DIV_B_SHIFT) |
(2 << ZYNQ_I2C_CONTROL_DIV_A_SHIFT), &zynq_i2c->control);
@@ -86,7 +98,7 @@ void i2c_init(int requested_speed, int slaveadd)
 }
 
 #ifdef DEBUG
-static void zynq_i2c_debug_status(void)
+static void zynq_i2c_debug_status(struct zynq_i2c_registers *zynq_i2c)
 {
int int_status;
int status;
@@ -128,7 +140,7 @@ static void zynq_i2c_debug_status(void)
 #endif
 
 /* Wait for an interrupt */
-static u32 zynq_i2c_wait(u32 mask)
+static u32 zynq_i2c_wait(struct zynq_i2c_registers *zynq_i2c, u32 mask)
 {
int timeout, int_status;
 
@@ -139,7 +151,7 @@ static u32 zynq_i2c_wait(u32 mask)
break;
}
 #ifdef DEBUG
-   zynq_i2c_debug_status();
+   zynq_i2c_debug_status(zynq_i2c);
 #endif
/* Clear interrupt status flags */
writel(int_status & mask, &zynq_i2c->interrupt_status);
@@ -151,17 +163,19 @@ static u32 zynq_i2c_wait(u32 mask)
  * I2C probe called by cmd_i2c when doing 'i2c probe'.
  * Begin read, nak data byte, end.
  */
-int i2c_probe(u8 dev)
+static int zynq_i2c_probe(struct i2c_adapter *adap, uint8_t chip)
 {
+   struct zynq_i2c_registers *zynq_i2c = i2c_select(adap);
+
/* Attempt to read a byte */
setbits_le32(&zynq_i2c->control, ZYNQ_I2C_CONTROL_CLR_FIFO |
ZYNQ_I2C_CONTROL_RW);
clrbits_le32(&zynq_i2c->control, ZYNQ_I2C_CONTROL_HOLD);
writel(0xFF, &zynq_i2c->interrupt_status);
-   writel(dev, &zynq_i2c->address);
+   writel(chip, &zynq_i2c->address);
writel(1, &zynq_i2c->transfer_size);
 
-   return (zynq_i2c_wait(ZYNQ_I2C_INTERRUPT_COMP |
+   return (zynq_i2c_wait(zynq_i2c, ZYNQ_I2C_INTERRUPT_COMP |
ZYNQ_I2C_INTERRUPT_NACK) &
ZYNQ_I2C_INTERRUPT_COMP) ? 0 : -ETIMEDOUT;
 }
@@ -170,14 +184,18 @@ int i2c_probe(u8 dev)
  * I2C read called by cmd_i2c when doing 'i2c read' and by cmd_eeprom.c
  * Begin write, send address byte(s), begin read, receive data bytes, end.
  */
-int i2c_read(u8 dev, uint addr, int alen, u8 *data, int length)
+static int zynq_i2c_read(struct i2c_adapter *adap, uint8_t chip, uint addr,
+int alen, uint8_t *buffer, int len)
 {
+   struct zynq_i2c_registers *zynq_i2c;
u32 status;
u32 i = 0;
-   u8 *cur_data = data;
+   u8 *cur_data = buffer;
+
+   zynq_i2c = i2c_select(adap);
 
/* Check the hardware can handle the requested bytes */
-   if ((length < 0) || (length > ZYNQ_I2C_TRANSFERT_SIZE_MAX))
+   if ((len < 0) || (len > ZYNQ_I2C_TRANSFERT_SIZE_MAX))
return -EINVAL;
 
/* Write the register address */
@@ -191,12 +209,12 @@ int i2c_read(u8 dev, uint addr, int alen, u8 *data, int 
length)
writel(0xFF, &zynq_i2c-

Re: [U-Boot] [PATCH] I2C: Zynq: Support for 0-length register address

2013-09-26 Thread Michael Burr
Michael,

Again, sorry. I will continue to work on improving my style
for commit messages in the future.

Michael Burr  //  Software Engineer II

Logic PD
T // 612.436.7273
NOTICE: Important disclaimers and limitations apply to this email.
Please see this web page for our disclaimers and limitations:
http://logicpd.com/email-disclaimer/

-Original Message-
From: Michal Simek [mailto:mon...@monstr.eu] 
Sent: Wednesday, September 25, 2013 1:10 AM
To: Michael Burr
Cc: u-boot@lists.denx.de; Heiko Schocher
Subject: Re: [PATCH] I2C: Zynq: Support for 0-length register address

On 09/24/2013 06:32 PM, Michael Burr wrote:
>> Fixed bug with alen == 0 in 'i2c_write', 'i2c_read'
> Further minor corrections:
>> Write 'address' register before 'data' register.
>> Write 'transfer_size' register before 'address' register.

This is still not acceptable format (I mean reply in commit message).

>From minor correction create separate small patches.
It can be just one line patch but it worth to have it
in connection to bisecting.

> 
> Tested:
> Xilinx ZC702 eval board.
> Write and read registers with addresses of length 0 and 1.

This could go below "---"

Thanks,
Michal

-- 
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Microblaze cpu - http://www.monstr.eu/fdt/
Maintainer of Linux kernel - Xilinx Zynq ARM architecture
Microblaze U-BOOT custodian and responsible for u-boot arm zynq platform


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


Re: [U-Boot] [PATCH] tools/imximage.c: Fix compiling warning

2013-09-26 Thread Stefano Babic
Hi York,

On 20/09/2013 21:24, York Sun wrote:
> Convert set_hdr_func(struct imx_header *imxhdr) to set_hdr_func(void)
> to get rid of the warning
> 
> warning: ‘imxhdr’ is used uninitialized in this function
> 
> Signed-off-by: York Sun 
> ---
>  tools/imximage.c |8 
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/tools/imximage.c b/tools/imximage.c
> index c87669b..32e4efe 100644
> --- a/tools/imximage.c
> +++ b/tools/imximage.c
> @@ -259,7 +259,7 @@ static void set_imx_hdr_v2(struct imx_header *imxhdr, 
> uint32_t dcd_len,
>   csf_ptr = &fhdr_v2->csf;
>  }
>  
> -static void set_hdr_func(struct imx_header *imxhdr)
> +static void set_hdr_func(void)
>  {
>   switch (imximage_version) {
>   case IMXIMAGE_V1:
> @@ -358,7 +358,7 @@ static void parse_cfg_cmd(struct imx_header *imxhdr, 
> int32_t cmd, char *token,
>   exit(EXIT_FAILURE);
>   }
>   cmd_ver_first = 1;
> - set_hdr_func(imxhdr);
> + set_hdr_func();
>   break;
>   case CMD_BOOT_FROM:
>   imximage_ivt_offset = get_table_entry_id(imximage_boot_offset,
> @@ -563,7 +563,7 @@ static void imximage_set_header(void *ptr, struct stat 
> *sbuf, int ifd,
>   /* Be able to detect if the cfg file has no BOOT_FROM tag */
>   imximage_ivt_offset = FLASH_OFFSET_UNDEFINED;
>   imximage_csf_size = 0;
> - set_hdr_func(imxhdr);
> + set_hdr_func();
>  
>   /* Parse dcd configuration file */
>   dcd_len = parse_cfg_file(imxhdr, params->imagename);
> @@ -631,7 +631,7 @@ static int imximage_generate(struct mkimage_params 
> *params,
>   /* Be able to detect if the cfg file has no BOOT_FROM tag */
>   imximage_ivt_offset = FLASH_OFFSET_UNDEFINED;
>   imximage_csf_size = 0;
> - set_hdr_func(imxhdr);
> + set_hdr_func();
>  
>   /* Parse dcd configuration file */
>   parse_cfg_file(&imximage_header, params->imagename);
> 

Thanks for fixing this !

Acked-by: Stefano Babic 

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] When to create a SoC directory for ARM

2013-09-26 Thread York Sun
On 09/26/2013 03:49 AM, FengHua wrote:
> 
> 
> 
>> -原始邮件-
>> 发件人: "sun york-R58495" 
>> 发送时间: 2013年9月26日 星期四
>> 收件人: FengHua 
>> 抄送: "albert.u.boot" , trini , "Wood
>>  Scott-B07421" , u-boot 
>> 主题: Re: [U-Boot] When to create a SoC directory for ARM
>>
>>
>> On Sep 25, 2013, at 10:23 PM, FengHua wrote:
>>
 Date: Wed, 25 Sep 2013 20:10:13 -0500
 From: Scott Wood 
 Subject: Re: [U-Boot] When to create a SoC directory for ARM
 To: sun york-R58495 
 Cc: Rini , Wood Scott-B07421 ,
"u-boot@lists.denx.de" , Tom
 Message-ID: <1380157813.24959.237.ca...@snotra.buserror.net>
 Content-Type: text/plain; charset="UTF-8"
>>>
 On Wed, 2013-09-25 at 20:04 -0500, sun york-R58495 wrote:
> On Sep 25, 2013, at 4:52 PM, Scott Wood wrote:
>
>> On Wed, 2013-09-25 at 16:30 -0700, York Sun wrote:
>>> Dear Wolfgang,
>>>
>>> I failed to find the guideline, here is my question. Pardon me if this
>>> is a dump question as I am still new to ARM.
>>>
>>> As David Feng post his patch set to add ARMv8 support, I am trying to
>>> enable it for Freescale implementation. Let's name it as LS2 for this
>>> discussion. I am thinking to reuse as much as possible for existing
>>> codes, which include copying some header files from powerpc partially. I
>>> noticed the SoC field in boards.cfg file and I am wondering how to use
>>> it effectively. I want to put LS2 specific headers to
>>> arch/arm/include/asm/arch-ls2. Do I need to copy all files from
>>> arch/arm/include/asm/arch-armv8/? There aren't many but I see mmu.h is
>>> included in start.S. I have been searching case like this in ARMv7 but
>>> didn't see shared header file (maybe I missed it). Please advise.
>>
>> LS2 is (or perhaps more accurately, contains) an implementation of
>> ARMv8, so you should be using arch-armv8 rather than copying it.
>
> True. But I guess LS2 won't be the only "LS" Freescale is going to
> make. Where is the best place to put the header file for chassis
> related registers, like CCSR we have for mpc8xxx.
>>>
 Anything that isn't deeply tied to the ARM architecture should probably
 just go in include/.
>  I am thinking the
> best place is arch/arm/include/asm/ls2 (or a better name). Like other
> ARMv7 variants, I am thinking to put ls2 under arch/arm/cpu/armv8/ as
> well, to host LS-specific code.
>>>
 Likewise, if it's specifically tied to armv8 it should go in
 arch/arm/include/asm/arch-armv8, but I'm not sure what would be tied to
 both armv8 and ls2.  Most likely anything LS-specific that needs to go
 under arch/arm/ should go somewhere like arch/arm/include/asm/ls/
 (similar to arch/arm/include/asm/imx-common).
>>>
 -Scott
>>>
>>> all SOC specific include file should be in arch/arm/include/asm/arch-SOC/ or
>>> some common directory(like include/asm/imx-common). Currently, u-boot only 
>>> link SOC specific(arch-SOC) include directory.
>>> You could touch a mmu.h file in arch/arm/include/asm/arch-ls2/ and include
>>> arch/arm/include/asm/arch-armv8/mmu.h.
>>> or move arch-armv8/mmu.h to arch/arm/include/asm/ to make it as a generic 
>>> file.
>>> Maybe we should distinguish architecture specific include directory and SOC
>>>  specific include directory.
>>
>>
>> I was thinking to change the include in start.S to
>>
>> #include 
>>
> 
> The current arch-armv8/mum.h is based on armv8 architecture.
> Maybe just maybe some armv8 processor will not implement some features of it
> for example 64K page size, then it do not works.
> So, maybe it's better to touch a mmu.h file in include/asm/arch_SOC and 
> include arch-armv8/mmu.h or make different implementation.
> 
I think it is OK right now. It can be a subset or superset, as far as
there is no conflict. We will see when we have more SoCs.

York



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


Re: [U-Boot] [PATCH] config.mk: enable -fstack-usage only when it is desired

2013-09-26 Thread Michal Simek
On 09/26/2013 01:52 PM, Tom Rini wrote:
> On 09/25/2013 10:17 PM, Masahiro Yamada wrote:
>> As far as I know, gcc does not support -fstack-usage
>> for some targets such as blackfin, m68k, microblaze, etc.

Please remove microblaze from this list.
Our gcc support fstack-usage.

If your microblaze gcc doesn't support this flag
then upgrade gcc version.

Thanks,
Michal

-- 
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Microblaze cpu - http://www.monstr.eu/fdt/
Maintainer of Linux kernel - Xilinx Zynq ARM architecture
Microblaze U-BOOT custodian and responsible for u-boot arm zynq platform




signature.asc
Description: OpenPGP digital signature
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v13 4/6] 64bit initrd start address support

2013-09-26 Thread fenghua
From: David Feng 

Signed-off-by: David Feng 
---
 common/fdt_support.c |   66 ++
 1 file changed, 34 insertions(+), 32 deletions(-)

diff --git a/common/fdt_support.c b/common/fdt_support.c
index b034c98..9bc5821 100644
--- a/common/fdt_support.c
+++ b/common/fdt_support.c
@@ -21,6 +21,34 @@
  */
 DECLARE_GLOBAL_DATA_PTR;
 
+/*
+ * Get cells len in bytes
+ * if #-cells property is 2 then len is 8
+ * otherwise len is 4
+ */
+static int get_cells_len(void *blob, char *nr_cells_name)
+{
+   const fdt32_t *cell;
+
+   cell = fdt_getprop(blob, 0, nr_cells_name, NULL);
+   if (cell && fdt32_to_cpu(*cell) == 2)
+   return 8;
+
+   return 4;
+}
+
+/*
+ * Write a 4 or 8 byte big endian cell
+ */
+static void write_cell(u8 *addr, u64 val, int size)
+{
+   int shift = (size - 1) * 8;
+   while (size-- > 0) {
+   *addr++ = (val >> shift) & 0xff;
+   shift -= 8;
+   }
+}
+
 /**
  * fdt_getprop_u32_default - Find a node and return it's property or a default
  *
@@ -131,9 +159,9 @@ static int fdt_fixup_stdout(void *fdt, int chosenoff)
 
 int fdt_initrd(void *fdt, ulong initrd_start, ulong initrd_end, int force)
 {
-   int   nodeoffset;
+   int   nodeoffset, addr_cell_len;
int   err, j, total;
-   fdt32_t  tmp;
+   fdt64_t  tmp;
const char *path;
uint64_t addr, size;
 
@@ -170,9 +198,11 @@ int fdt_initrd(void *fdt, ulong initrd_start, ulong 
initrd_end, int force)
return err;
}
 
+   addr_cell_len = get_cells_len(fdt, "#address-cells");
+
path = fdt_getprop(fdt, nodeoffset, "linux,initrd-start", NULL);
if ((path == NULL) || force) {
-   tmp = cpu_to_fdt32(initrd_start);
+   write_cell((u8 *)&tmp, initrd_start, addr_cell_len);
err = fdt_setprop(fdt, nodeoffset,
"linux,initrd-start", &tmp, sizeof(tmp));
if (err < 0) {
@@ -181,7 +211,7 @@ int fdt_initrd(void *fdt, ulong initrd_start, ulong 
initrd_end, int force)
fdt_strerror(err));
return err;
}
-   tmp = cpu_to_fdt32(initrd_end);
+   write_cell((u8 *)&tmp, initrd_end, addr_cell_len);
err = fdt_setprop(fdt, nodeoffset,
"linux,initrd-end", &tmp, sizeof(tmp));
if (err < 0) {
@@ -343,34 +373,6 @@ void do_fixup_by_compat_u32(void *fdt, const char *compat,
do_fixup_by_compat(fdt, compat, prop, &tmp, 4, create);
 }
 
-/*
- * Get cells len in bytes
- * if #-cells property is 2 then len is 8
- * otherwise len is 4
- */
-static int get_cells_len(void *blob, char *nr_cells_name)
-{
-   const fdt32_t *cell;
-
-   cell = fdt_getprop(blob, 0, nr_cells_name, NULL);
-   if (cell && fdt32_to_cpu(*cell) == 2)
-   return 8;
-
-   return 4;
-}
-
-/*
- * Write a 4 or 8 byte big endian cell
- */
-static void write_cell(u8 *addr, u64 val, int size)
-{
-   int shift = (size - 1) * 8;
-   while (size-- > 0) {
-   *addr++ = (val >> shift) & 0xff;
-   shift -= 8;
-   }
-}
-
 #ifdef CONFIG_NR_DRAM_BANKS
 #define MEMORY_BANKS_MAX CONFIG_NR_DRAM_BANKS
 #else
-- 
1.7.9.5


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


[U-Boot] [PATCH v13 5/6] remove compiling warnings

2013-09-26 Thread fenghua
From: David Feng 

Signed-off-by: David Feng 
---
 common/cmd_pxe.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/common/cmd_pxe.c b/common/cmd_pxe.c
index a2fb50a..df58522 100644
--- a/common/cmd_pxe.c
+++ b/common/cmd_pxe.c
@@ -57,7 +57,7 @@ static int format_mac_pxe(char *outbuf, size_t outbuf_len)
uchar ethaddr[6];
 
if (outbuf_len < 21) {
-   printf("outbuf is too small (%d < 21)\n", outbuf_len);
+   printf("outbuf is too small (%zd < 21)\n", outbuf_len);
 
return -EINVAL;
}
@@ -100,7 +100,7 @@ static int get_bootfile_path(const char *file_path, char 
*bootfile_path,
path_len = (last_slash - bootfile) + 1;
 
if (bootfile_path_size < path_len) {
-   printf("bootfile_path too small. (%d < %d)\n",
+   printf("bootfile_path too small. (%zd < %zd)\n",
bootfile_path_size, path_len);
 
return -1;
-- 
1.7.9.5


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


[U-Boot] [PATCH v13 0/6] arm64 patch

2013-09-26 Thread fenghua
From: David Feng 

Changes for v13:
  - fix the bug of board_r.c and arm/lib/board.c due to
CONFIG_NEED_MANUAL_RELOC. adjust initr_serial() in board_r.c
to the first entry of init_sequence_r[] and relocate
serial_initialize() in arm/lib/board.c, routines of serial_device
should be relocated firstly by serial_initialize(), so that printf
access the correct puts function, otherwise uninitialized
serial_current will be selected as the output device.
  - fix the bug of dcache_enable(). after mmu_setup the sctrl
register value should be fetched again because it has been
modifed by mmu_seup() function. This bug is find by York Sun 
.
  - add macro branch_if_slave to macro.h, it choose processor
with all zero affinity value as the master and is used in start.S.

Changes for v12:
  - custom the patches to new format boards.cfg.

Changes for v11:
  - Replace CONFIG_ARMV8 with CONFIG_ARM64. Currently,
it's hard to distinguish what is armv8 specific and
what is aarch64 specific, so we use CONFIG_ARM64
only, no CONFIG_ARMV8 used.
  - rename README.armv8 with README.arm64 and make some modification.

Changes for v10:
  - add weak definition to include/linux/linkage.h and make
setup_el2/setup_el3/lowlevel_init weak routines,
so them can be easily overridden by processor specific code.
  - modify s-o-f of 0002-board-support-of-vexpress_aemv8a which
use wrong mail address of Bhupesh Sharma.

Changes for v9:
  - add Signed-off-by information to patch "board support of
vexpress_aemv8a" which SMC9 support is integrated
from Sharma Bhupesh's patch.
  - adjust pt_regs struct and add exception state
preservation in exception.S.

Changes for v8:
  - Integrate SMC9 patch of sharma bhupesh.
  - remove v8_outer_cache* which is not need currently.
  - Change license tag.
  - Mov crt0.S/relocate.S/interrupts.c to arm/lib and
rename them with _64 suffix.
  - Make el3/el2 initializing process of start.S as
two separate routines. It could be easier to be
replaced with processor specific codes.
  - Remove exception stack save and restore routine,
it is unnecessary now.
  - simplify __weak function declaration.

Changes for v7:
  - Check the patches with checkpatch.pl and get rid of
almost all warnings. There are a few warnings still,
but I think it should be that.
  - change printf format in cmd_pxe.c, use %zd indtead
of %ld to format size_t type variable.
  - add macro PGTABLE_SIZE to identify tlb table size.

Changes for v6:
  - Make modification to inappropriate licensed file
and bugs according to ScottWood's advice.
Thanks Scott for his checking to these patches.
  - Enable u-boot's running at EL1.
  - Get rid of compiling warnings originated from cmd_pxe.c.

Changes for v5:
  - fix the generic board_f.c, remove zero_global_data
from init_sequence_f array and move it to board_init_f()
function with CONFIG_X86 switch. The previous fixup is
inaccurate.
  - 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

Changes for v4:
  - merge arm64 to arm architecture.

David Feng (6):
  core support of arm64
  board support of vexpress_aemv8a
  generic board patch of manual reloc and zero gd_t
  64bit initrd start address support
  remove compiling warnings
  add weak entry definition

 arch/arm/config.mk  |4 +
 arch/arm/cpu/armv8/Makefile |   38 +++
 arch/arm/cpu/armv8/cache.S  |  130 +
 arch/arm/cpu/armv8/cache_v8.c   |  218 +++
 arch/arm/cpu/armv8/config.mk|   16 ++
 arch/arm/cpu/armv8/cpu.c|   67 +
 arch/arm/cpu/armv8/exceptions.S |  115 
 arch/arm/cpu/armv8/start.S  |  234 
 arch/arm/cpu/armv8/timer.c  |   80 ++
 arch/arm/cpu/armv8/tlb.S|   30 +++
 arch/arm/cpu/armv8/u-boot.lds   |   71 +
 arch/arm/include/asm/arch-armv8/gpio.h  |   11 +
 arch/arm/include/asm/arch-armv8/mmu.h   |  110 
 arch/arm/include/asm/byteorder.h|   12 +
 arch/arm/include/asm/cache.h|5 +
 arch/arm/include/asm/config.h   |   10 +
 arch/arm/include/asm/global_data.h  |6 +-
 arch/arm/include/asm/io.h   |   15 +-
 arch/arm/include/asm/macro.h|   39 +++
 arch/arm/include/asm/posix_types.h  |   10 +
 arch/arm/include/asm/proc-armv/ptrace.h |   21 ++
 arch/arm/include/asm/proc-armv/system.h |   59 -
 arch/arm/include/asm/system.h   |   77 ++
 arch/arm/include/asm/types.h|4 +
 arch/arm/include/asm/u-boot.h   |4 +
 arch/arm/include/asm/unaligned.h|2 +-
 arch/arm/lib/Makefile   |   14 +
 arch/arm/lib/board.c|   25 +-
 arch/arm/lib/bootm.c|  

[U-Boot] [PATCH v13 2/6] board support of vexpress_aemv8a

2013-09-26 Thread fenghua
From: David Feng 

Signed-off-by: David Feng 
Signed-off-by: Bhupesh Sharma 
---
 board/armltd/dts/vexpress64.dts  |  439 ++
 board/armltd/vexpress64/Makefile |   27 +++
 board/armltd/vexpress64/vexpress64.c |   70 ++
 boards.cfg   |1 +
 include/configs/vexpress_aemv8a.h|  191 +++
 5 files changed, 728 insertions(+)
 create mode 100644 board/armltd/dts/vexpress64.dts
 create mode 100644 board/armltd/vexpress64/Makefile
 create mode 100644 board/armltd/vexpress64/vexpress64.c
 create mode 100644 include/configs/vexpress_aemv8a.h

diff --git a/board/armltd/dts/vexpress64.dts b/board/armltd/dts/vexpress64.dts
new file mode 100644
index 000..067fea7
--- /dev/null
+++ b/board/armltd/dts/vexpress64.dts
@@ -0,0 +1,439 @@
+/*
+ * ARM Ltd. Fast Models
+ *
+ * Architecture Envelope Model (AEM) ARMv8-A
+ * ARMAEMv8AMPCT
+ *
+ * RTSM_VE_AEMv8A.lisa
+ */
+
+/dts-v1/;
+
+/memreserve/ 0x8000 0x0001;
+
+/ {
+   /* boot configurations for u-boot */
+   config {
+   /*bootdelay = <1>;*/
+   kernel-offset = <0x10>;
+   rootdisk-offset = <0x80>;
+   bootcmd = "bootm 0x10 0x80:0x200";
+   };
+};
+
+/ {
+   model = "RTSM_VE_AEMv8A";
+   compatible = "arm,rtsm_ve,aemv8a", "arm,vexpress";
+   interrupt-parent = <&gic>;
+   #address-cells = <2>;
+   #size-cells = <2>;
+
+   /* chosen */
+   /* generated by u-boot */
+
+
+   aliases {
+   serial0 = &v2m_serial0;
+   serial1 = &v2m_serial1;
+   serial2 = &v2m_serial2;
+   serial3 = &v2m_serial3;
+   };
+
+   cpus {
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   cpu@0 {
+   device_type = "cpu";
+   compatible = "arm,armv8";
+   reg = <0>;
+   enable-method = "spin-table";
+   cpu-release-addr = <0x0 0x8000fff8>;
+   };
+   cpu@1 {
+   device_type = "cpu";
+   compatible = "arm,armv8";
+   reg = <1>;
+   enable-method = "spin-table";
+   cpu-release-addr = <0x0 0x8000fff8>;
+   };
+   cpu@2 {
+   device_type = "cpu";
+   compatible = "arm,armv8";
+   reg = <2>;
+   enable-method = "spin-table";
+   cpu-release-addr = <0x0 0x8000fff8>;
+   };
+   cpu@3 {
+   device_type = "cpu";
+   compatible = "arm,armv8";
+   reg = <3>;
+   enable-method = "spin-table";
+   cpu-release-addr = <0x0 0x8000fff8>;
+   };
+   };
+
+   memory@8000 {
+   device_type = "memory";
+   reg = <0x 0x8000 0 0x8000>,
+ <0x0008 0x8000 0 0x8000>;
+   };
+
+   gic: interrupt-controller@2c001000 {
+   compatible = "arm,cortex-a15-gic", "arm,cortex-a9-gic";
+   #interrupt-cells = <3>;
+   #address-cells = <0>;
+   interrupt-controller;
+   reg = <0x0 0x2c001000 0 0x1000>,
+ <0x0 0x2c002000 0 0x1000>,
+ <0x0 0x2c004000 0 0x2000>,
+ <0x0 0x2c006000 0 0x2000>;
+   interrupts = <1 9 0xf04>;
+   };
+
+   timer {
+   compatible = "arm,armv8-timer";
+   interrupts = <1 13 0xff01>,
+<1 14 0xff01>,
+<1 11 0xff01>,
+<1 10 0xff01>;
+   clock-frequency = <1>;
+   };
+
+   pmu {
+   compatible = "arm,armv8-pmuv3";
+   interrupts = <0 60 4>,
+<0 61 4>,
+<0 62 4>,
+<0 63 4>;
+   };
+
+   smb {
+   compatible = "simple-bus";
+
+   #address-cells = <2>;
+   #size-cells = <1>;
+   ranges = <0 0 0 0x0800 0x0400>,
+<1 0 0 0x1400 0x0400>,
+<2 0 0 0x1800 0x0400>,
+<3 0 0 0x1c00 0x0400>,
+<4 0 0 0x0c00 0x0400>,
+<5 0 0 0x1000 0x0400>;
+
+   #interrupt-cells = <1>;
+   interrupt-map-mask = <0 0 63>;
+   interrupt-map = <0 0  0 &gic 0  0 4>,
+   <0 0  1 &gic 0  1 4>,
+   <0 0  2 &gic 0  2 4>,
+   <0 0  3 &gic 0  3 4>,
+   <0 0  4 &

[U-Boot] [PATCH v13 3/6] generic board patch of manual reloc and zero gd_t

2013-09-26 Thread fenghua
From: David Feng 

Signed-off-by: David Feng 
---
 common/board_f.c |   18 +++---
 common/board_r.c |   20 +++-
 2 files changed, 30 insertions(+), 8 deletions(-)

diff --git a/common/board_f.c b/common/board_f.c
index 0ada1af..5891ad2 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -458,7 +458,7 @@ static int reserve_round_4k(void)
 static int reserve_mmu(void)
 {
/* reserve TLB table */
-   gd->arch.tlb_size = 4096 * 4;
+   gd->arch.tlb_size = PGTABLE_SIZE;
gd->relocaddr -= gd->arch.tlb_size;
 
/* round down to next 64 kB limit */
@@ -610,7 +610,7 @@ static int reserve_stacks(void)
 * TODO(s...@chromium.org): Perhaps create arch_reserve_stack()
 * to handle this and put in arch/xxx/lib/stack.c
 */
-# ifdef CONFIG_ARM
+# if defined(CONFIG_ARM) && !defined(CONFIG_ARM64)
 #  ifdef CONFIG_USE_IRQ
gd->start_addr_sp -= (CONFIG_STACKSIZE_IRQ + CONFIG_STACKSIZE_FIQ);
debug("Reserving %zu Bytes for IRQ stack at: %08lx\n",
@@ -807,11 +807,6 @@ static int mark_bootstage(void)
 }
 
 static init_fnc_t init_sequence_f[] = {
-#if !defined(CONFIG_CPM2) && !defined(CONFIG_MPC512X) && \
-   !defined(CONFIG_MPC83xx) && !defined(CONFIG_MPC85xx) && \
-   !defined(CONFIG_MPC86xx) && !defined(CONFIG_X86)
-   zero_global_data,
-#endif
 #ifdef CONFIG_SANDBOX
setup_ram_buf,
 #endif
@@ -1005,6 +1000,15 @@ void board_init_f(ulong boot_flags)
gd = &data;
 #endif
 
+   /*
+* Zero gd_t first, otherwise the debug print(if DEBUG defined)
+* in initcall_run_list function before zero_global_data is called
+* will go wrong.
+*/
+#ifndef CONFIG_X86
+   zero_global_data();
+#endif
+
gd->flags = boot_flags;
 
if (initcall_run_list(init_sequence_f))
diff --git a/common/board_r.c b/common/board_r.c
index 86ca1cb..8984cf3 100644
--- a/common/board_r.c
+++ b/common/board_r.c
@@ -157,6 +157,13 @@ static int initr_reloc_global_data(void)
 */
gd->env_addr += gd->relocaddr - CONFIG_SYS_MONITOR_BASE;
 #endif
+#ifdef CONFIG_NEEDS_MANUAL_RELOC
+   /*
+* We have to relocate the command table manually
+*/
+   fixup_cmdtable(ll_entry_start(cmd_tbl_t, cmd),
+   ll_entry_count(cmd_tbl_t, cmd));
+#endif /* CONFIG_NEEDS_MANUAL_RELOC */
return 0;
 }
 
@@ -705,6 +712,7 @@ static int run_main_loop(void)
  * TODO: perhaps reset the watchdog in the initcall function after each call?
  */
 init_fnc_t init_sequence_r[] = {
+   initr_serial,
initr_trace,
initr_reloc,
/* TODO: could x86/PPC have this also perhaps? */
@@ -722,7 +730,6 @@ init_fnc_t init_sequence_r[] = {
set_cpu_clk_info, /* Setup clock information */
 #endif
initr_reloc_global_data,
-   initr_serial,
initr_announce,
INIT_FUNC_WATCHDOG_RESET
 #ifdef CONFIG_PPC
@@ -899,6 +906,7 @@ init_fnc_t init_sequence_r[] = {
initr_modem,
 #endif
run_main_loop,
+   NULL,
 };
 
 void board_init_r(gd_t *new_gd, ulong dest_addr)
@@ -906,6 +914,16 @@ void board_init_r(gd_t *new_gd, ulong dest_addr)
 #ifndef CONFIG_X86
gd = new_gd;
 #endif
+#ifdef CONFIG_NEEDS_MANUAL_RELOC
+   /*
+* We have to relocate the init_sequence_r table manually
+*/
+   init_fnc_t  *init_fnc_ptr;
+   for (init_fnc_ptr = init_sequence_r; *init_fnc_ptr; ++init_fnc_ptr)
+   *(unsigned long *)init_fnc_ptr =
+   (unsigned long)(*init_fnc_ptr) + gd->reloc_off;
+#endif /* CONFIG_NEEDS_MANUAL_RELOC */
+
if (initcall_run_list(init_sequence_r))
hang();
 
-- 
1.7.9.5


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


[U-Boot] [PATCH v13 6/6] add weak entry definition

2013-09-26 Thread fenghua
From: David Feng 

Signed-off-by: David Feng 
---
 include/linux/linkage.h |4 
 1 file changed, 4 insertions(+)

diff --git a/include/linux/linkage.h b/include/linux/linkage.h
index 9ddf830..2a2848a 100644
--- a/include/linux/linkage.h
+++ b/include/linux/linkage.h
@@ -49,6 +49,10 @@
.globl SYMBOL_NAME(name); \
LENTRY(name)
 
+#define WEAK(name) \
+   .weak SYMBOL_NAME(name); \
+   LENTRY(name)
+
 #ifndef END
 #define END(name) \
.size name, .-name
-- 
1.7.9.5


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


Re: [U-Boot] [PATCH 1/1] am33xx: add CONFIG_SYS_NAND_DEVICE_WIDTH to determine NAND device bus-width

2013-09-26 Thread Gupta, Pekon
(re-sending by dropping cc-list, as u-boot maillist moderated earlier mail 
saying
  "Too many recipients to the message" :-) )


> From: Scott Wood [mailto:scottw...@freescale.com]
>
> > On Wed, 2013-09-25 at 22:08 +, Woodruff, Richard wrote:
> > Short comment.  Apologies for top posting:
> >
> > The first incarnations of SPL and loader mainly cared about the boot flash
> device.
>
> Is there an SPL that cares about something other than the boot device
> now?
>
AFAIK about SPL driver in drivers/mtd/nand/am335x_spl_bch.c
This driver depends on CONFIG_SYS_NAND_xx  for deriving all device parameter
- CONFIG_SYS_NAND_BLOCK_SIZE
- CONFIG_SYS_NAND_PAGE_SIZE
- CONFIG_SYS_NAND_ECCSIZE
- CONFIG_SYS_NAND_ECCBYTES

Thus, IMO SPL drivers are written for following two uses:
(1) load secondary boot-loader, which can further do dynamic device probing
   And based on that enables some device specific features.
(2) load linux kernel image directly (in falcon-mode SPL_OS_BOOT), which
  will reduce the boot-time as all configurations are static.

So, in either usage SPL drivers need to be statically configured to keep
 their foot-print small and boot them fast.


> > OMAPs require a resistor strap to specify the width of the boot device.  The
> values is latched for SW to read.
> >
> > As such always a run time check of width was sufficient for boot device.
> >
> > On dev board we would have many devices and use DIP switch to select
> which one was in use.  A run time not compile time was way to support this.
> >
> > If information is dynamically available it is better to use this if focus 
> > is boot
> device management.
> >
Agree, This was done on TI814x EVM boards which are development boards.
but if you refer actual production board (custom boards of end-user), having
even a single extra resistor means adding BOM cost.
Also in production boards everything is known, (like NAND bus-width,
page-size, etc), so dynamic detection becomes redundant because linux
would anyways re-do the device probing when it boots.

And if anyone really wants to do dynamic device probing in u-boot. Then
go till u-boot second stage which has most of device probing capabilities
same as linux kernel. (atleast in case of NAND driver).

> > Other tricks writing patterns and reading results is also possible but
> simplicity of compile vs. that is debatable.
> >
> > Regards,
> > Richard W.
>
> I agree.  Outside of SPL (where hardcoding can be useful due to size
> constraints, and you only care about the boot device), it's best to let
> drivers determine the best way to learn about such configuration.
>


> > From: Gupta, Pekon 
> >
> > NAND driver needs to know bus-width of the connected NAND device, in
> order to perform proper I/O and initialize itself. Currently there is no 
> CONFIG
> option to provide this information to NAND driver.
> > - SPL NAND driver does not have framework to parse ONFI parameter
> page.
>
> Is this about SPL?  It looks like a more general change.
>
Yes, actually I would have loved to see a generic SPL driver for all platforms,
because SPL is mostly statically configured, and it just does plain NAND read
(it doesn’t even support NAND write, etc).
But I do not know the hardware configurations tweaks of other SoC,
So at-least have common CONFIG_SYS_NAND_xx which all SPL drivers can use.

> > - NAND drivers which cannot self initialize
> !defined(CONFIG_SYS_NAND_SELF_INIT)
> >   do not have any information about device bus-width during
> board_nand_init(),
> >   So, any device-width specific configurations are not possible there.
>
> Convert to self-init.  That's what it's for.
>
I read it in doc/README.nand: CONFIG_SYS_NAND_SELF_INIT
And this path is applicable only for second-stage u-boot loader.
But today not many drivers are using this model. So just mentioned it here.


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


[U-Boot] [PATCH] power:pmic: prevent data abort for pmic bat command

2013-09-26 Thread Piotr Wilczek
This patch prevents data abort when pmic bat command is called
on non-batery pmic device.

Signed-off-by: Piotr Wilczek 
Signed-off-by: Kyungmin Park 
CC: Lukasz Majewski 
CC: Minkyu Kang 
---
 drivers/power/power_core.c |   19 +++
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/drivers/power/power_core.c b/drivers/power/power_core.c
index 583e56b..d9bc05f 100644
--- a/drivers/power/power_core.c
+++ b/drivers/power/power_core.c
@@ -188,18 +188,21 @@ int do_pmic(cmd_tbl_t *cmdtp, int flag, int argc, char * 
const argv[])
if (argc < 4)
return CMD_RET_USAGE;
 
+   if (!p->pbat) {
+   printf("%s is not a battery\n", p->name);
+   return CMD_RET_FAILURE;
+   }
+
if (strcmp(argv[3], "state") == 0)
p->fg->fg_battery_check(p->pbat->fg, p);
 
if (strcmp(argv[3], "charge") == 0) {
-   if (p->pbat) {
-   printf("BAT: %s charging (ctrl+c to break)\n",
-  p->name);
-   if (p->low_power_mode)
-   p->low_power_mode();
-   if (p->pbat->battery_charge)
-   p->pbat->battery_charge(p);
-   }
+   printf("BAT: %s charging (ctrl+c to break)\n",
+  p->name);
+   if (p->low_power_mode)
+   p->low_power_mode();
+   if (p->pbat->battery_charge)
+   p->pbat->battery_charge(p);
}
 
return CMD_RET_SUCCESS;
-- 
1.7.9.5

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


Re: [U-Boot] [PATCH v4 31/36] sf: Add extended read commands support

2013-09-26 Thread thomas.langer
Hello Jagan,

it seems an almost ready patch for m25p80 driver in the kernel was posted today:
"[PATCHv2] drivers: mtd: devices: Add quad read support."
http://thread.gmane.org/gmane.linux.drivers.mtd/48552/focus=48557

Please see how there in the function "m25p80_quad_read"
the "rx_nbits" in the transfer structure is set.

Best Regards,
Thomas

___
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-26 Thread Masahiro Yamada
I posted v2 for this series.

Best Regards
Masahiro Yamada

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


Re: [U-Boot] [PATCH] config.mk: enable -fstack-usage only when it is desired

2013-09-26 Thread Tom Rini
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 09/25/2013 10:17 PM, Masahiro Yamada wrote:
> As far as I know, gcc does not support -fstack-usage
> for some targets such as blackfin, m68k, microblaze, etc.
> 
> If -fstack-usage option is given for those targets,
> gcc displays a warning message as follows:
> 
> warning: -fstack-usage not supported for this target [enabled by default]
> 
> But it still exits with status 0.
> 
> So,
> 
> # Report stack usage if supported
> CFLAGS_STACK := $(call cc-option,-fstack-usage)
> CFLAGS += $(CFLAGS_STACK)
> 
> does not work as we expect because cc-option sees exit status
> to judge whether the given option is supported or not.
> 
> To suppress warnings for such targets that -fstack-usage is not supported,
> this commit surrounds the concerned lines with
> ifdef CONFIG_CC_STACKUSAGE .. endif.
> 
> Signed-off-by: Masahiro Yamada 
> Cc: Tom Rini 

The problem here is that except for whatever arches don't support
- -fstack-usage, we always want to generate this information, to assist in
debugging stack usage problems (which can be a real problem within SPL
for example).  How about ifneq($(CONFIG_M68K)$(CONFIG_...),y) ... endif
around it?

- -- 
Tom
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBAgAGBQJSRCAOAAoJENk4IS6UOR1WQ3AP/2kWJVnQqpMXUvX5XJ/jXzsW
tNx0Rj+JZcXgH8Nl4EAPj/oBQEA6H5Qnic0pEE9G8HpkrgEsCfqn9wAsbvN/8pCw
ZaU7zkORh4ieAz1w+ZJeJgx8rksxWNbVqFzttwDrOtvOK2s1WMLi7zfypw7DPoc/
ZPuvZJRHbbEFMqf9Y6Mo2smnM9uo+z+JnsNBio2Fau5A8VoZIaAI8Z2rob352oQ7
1MM2J1ncrmxEOO178CEbLD0dAJWqNZFNfpSZpfb/V+vYMaAMmCgYALXuBbue+JDy
PfeRxPD8iXiv5G40dQce0mjoUVDujnuOAlralaQBv0okegnGgF6ghf+bWt+sxTuT
h9/nY3i0ToRplsk2GKNAMVDNzonKBgk9BAz78ZVc6qMaLi6g9d8XVfXhoLLbWLPC
XEEZOYlflt6pnsybQjhux0UOm6hyy1moqll6GukEVmUWtYrMjimPLy2uKmeTdPbU
vnHOCcRHUD8SPBAyA9voOlwDJteusVH6FAsNoXLSSjnLI+vrBLhXTlUH/kRXMuA3
JRSLLBcwRi/VDxe0gWjSGbmTnOiWVKkg9nLNBdqMnqJI8vTYZjwDxJ50RLUQJWSq
N+kB3yZ/+ElhPi7vjJc8hy+sHUNfoVN1z6TyfY1fRxJfXXccDyBUE8eqEOWxBGg7
YldF9zwHiqjs2m/WuiIY
=YRCk
-END PGP SIGNATURE-
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


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

2013-09-26 Thread Masahiro Yamada
Note:
arch/powerpc/cpu/mpc8260/Makefile is originally like follows:

--
START   = start.o kgdb.o
COBJS   = traps.o serial_smc.o serial_scc.o cpu.o cpu_init.o speed.o \
--
COBJS-$(CONFIG_ETHER_ON_SCC) = ether_scc.o
--
$(LIB): $(OBJS)
$(call cmd_link_o_target, $(OBJS) $(obj)kgdb.o)

The link rule `$(call cmd_link_o_target, $(OBJS) $(obj)kgdb.o)'
is weird.
kbdg.o is not included in $(OBJS) but linked into $(LIB)
and $(LIB) is not dependent on kgdb.o.
(Broken dependency tracking)

So,
START   = start.o kgdb.o
shoud have been
START   = start.o
SOBJS   = kgdb.o

That is why this commit adds kgdb.o to obj-y, not to extra-y.

Signed-off-by: Masahiro Yamada 
Cc: Wolfgang Denk 
Cc: Stefan Roese 
---

Changed v2:
  - fix arch/powerpc/cpu/mpc8260/Makefile as shown above

 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 |  32 +
 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, 267 insertions(+), 580 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

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

2013-09-26 Thread Masahiro Yamada
Signed-off-by: Masahiro Yamada 
---

Changes for v2
  - No change

 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  := l

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

2013-09-26 Thread Masahiro Yamada
Signed-off-by: Masahiro Yamada 
Cc: Tom Rini 
---

Changes for v2
  - No change

 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)
-   $(call cm

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

2013-09-26 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.
At last 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.

Now my fruit got too old to fit with the current u-boot/master 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 those patches are so rough that
they could 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, review, ...
again and again for a very big patch series.

I began to be wondering whether it is really 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 importing a real Kbuild, I'd like to adjust our makefiles
in the form suitable for Kbuild.

First of all, this series converts 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.

01/19 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 (non-Kbuild) makefile sytle is still supported.
So we can change sub makefiles little by little in the following patches.

02/19-19/19 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.

  02/19-07/19: refactor under arch/arm/
  08/19-16/19: refactor libraries which are commonly used for all architectures
  17/19  : refactor under arch/sandbox
  18/19  : refactor under arch/powerpc/
  19/19  : refactor under board/ti/


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

In order to prove this series does no harm,
I compiled all boards excepts nds32 and nios2 architectures
and checked md5sum matching for ./u-boot (and spl/u-boot-spl if it exists).

I tried md5sum for version 1 and I did the same thing again for version 2.
I confirmed md5sum perfectly matched.

For the detailed steps how to compare md5sum,
please refer to the discussion in version 1:
[U-Boot] [PATCH 00/19] First step towards Kbuild: Use Kbuild style makefiles


Note2:
This series is 

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

2013-09-26 Thread Masahiro Yamada
Signed-off-by: Masahiro Yamada 
---

Changes for v2
  - No change

 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
+obj-$

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

2013-09-26 Thread Masahiro Yamada
Signed-off-by: Masahiro Yamada 
---

Changes for v2
  - No change

 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
-COBJS-$(CONFIG_USB_EHCI_AR

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

2013-09-26 Thread Masahiro Yamada
Signed-off-by: Masahiro Yamada 
Cc: Simon Glass 
---

Changes for v2
  - No change

 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 v2 08/19] drivers: net: convert makefiles to Kbuild style

2013-09-26 Thread Masahiro Yamada
Signed-off-by: Masahiro Yamada 
---

Changes for v2
  - No change

 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
+obj-$(CONFIG_DRIVER_TI

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

2013-09-26 Thread Masahiro Yamada
Signed-off-by: Masahiro Yamada 
---

Changes for v2:
  -2/19: updated 3 files to rebase on the master
  arch/arm/cpu/armv7/mx6/Makefile
  arch/arm/cpu/armv7/socfpga/Makefile
  arch/arm/cpu/armv7/zynq/Makefile

 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  | 25 ++--
 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 | 31 +++
 22 files changed, 101 insertions(+), 580 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=

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

2013-09-26 Thread Masahiro Yamada
Signed-off-by: Masahiro Yamada 
---

Changes for v2
  - No change

 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 v2 15/19] lib: convert makefiles to Kbuild style

2013-09-26 Thread Masahiro Yamada
Signed-off-by: Masahiro Yamada 
---

Changes for v2
  - No change

 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 v2 05/19] arm720t: convert makefiles to Kbuild style

2013-09-26 Thread Masahiro Yamada
Signed-off-by: Masahiro Yamada 
---

Changes for v2
  - No change

 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 .
 #
 
-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 .
 #
 
-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 v2 03/19] arm926ejs: convert makefiles to Kbuild style

2013-09-26 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 
---

Changes for v2
  - No change

 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)   += at9

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

2013-09-26 Thread Masahiro Yamada
Signed-off-by: Masahiro Yamada 
---

Changes for v2
  - No change

 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 v2 11/19] drivers: convert makefiles to Kbuild style

2013-09-26 Thread Masahiro Yamada
Signed-off-by: Masahiro Yamada 
---

Changed for v2:

  - updated 6 files to rebase on the master
drivers/serial/Makefile
drivers/mmc/Makefile
drivers/video/Makefile
drivers/watchdog/Makefile
drivers/rtc/Makefile
drivers/i2c/Makefile

 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  |  68 
 drivers/input/Makefile|  36 +++--
 drivers/misc/Makefile |  52 ++
 drivers/mmc/Makefile  |  71 +
 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  | 108 +++---
 drivers/serial/Makefile   |  82 +++--
 drivers/sound/Makefile|  30 ++-
 drivers/spi/Makefile  |  82 +++--
 drivers/tpm/Makefile  |  29 ++
 drivers/twserial/Makefile |  24 +
 drivers/video/Makefile|  86 +++---
 drivers/watchdog/Makefile |  38 +++---
 28 files changed, 332 insertions(+), 947 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_S

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

2013-09-26 Thread Masahiro Yamada
Signed-off-by: Masahiro Yamada 
---

Changes for v2
  - No change

 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
-COBJS-$(CONFIG_C

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

2013-09-26 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 (non-Kbuild) 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 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.)

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 
Cc: Simon Glass 
Cc: Tom Rini 
---

Changes for v2:
  - fix commit log (purely cosmetic)

 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 07abef4..36bbd09 100644
--- a/Makefile
+++ b/Makefile
@@ -593,14 +593,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
@@ -637,7 +658,12 @@ depend dep:$(TIMESTAMP_FILE) $(VERSION_FILE) \
$(obj)include/generated/gen

  1   2   >