Re: [U-Boot] [PATCH] drivers/designware_i2c - add suppor of CONFIG_SYS_I2C_EEPROM_ADDR_OVERFLOW

2014-01-17 Thread Alexey Brodkin
On Fri, 2014-01-17 at 07:42 +0100, Heiko Schocher wrote:
 Hello Alexey,
 I picked it up, see:
 
 http://git.denx.de/?p=u-boot/u-boot-i2c.git;a=summary
 http://git.denx.de/?p=u-boot/u-boot-i2c.git;a=commit;h=32d041e218c6a22e92d91629902fd03a90934b6a
 
  Note this is not an enhancement - this is a required fix due to
  roll-back (http://patchwork.ozlabs.org/patch/295825/) of my previous fix
  in http://patchwork.ozlabs.org/patch/289346/
 
 Waiting for a testreport for another patch ... If I get no response,
 I send a pull request for this patch tomorrow ...

Oops, sorry I didn't look at your tree before reminding.
Thanks so much for your time.

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


[U-Boot] U-boot memory test results

2014-01-17 Thread aryanlak
Hi all,

I want to perform memory test (FLASH) during U-boot and read the results
after the operating system (Linux) is booted up. 
Is it possible? If so, can anyone guide me to do so?

Regards
Lakshmi



--
View this message in context: 
http://u-boot.10912.n7.nabble.com/U-boot-memory-test-results-tp171691.html
Sent from the U-Boot mailing list archive at Nabble.com.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v5 03/12] samsung: common: Add misc file and common function misc_init_r().

2014-01-17 Thread Przemyslaw Marczak

On 01/17/2014 07:26 AM, Minkyu Kang wrote:

On 15/01/14 17:18, Przemyslaw Marczak wrote:

Hello Piotr,

On 01/15/2014 09:08 AM, Piotr Wilczek wrote:

Dear Przemyslaw,


-Original Message-
From: Przemyslaw Marczak [mailto:p.marc...@samsung.com]
Sent: Wednesday, January 15, 2014 8:51 AM
To: Minkyu Kang
Cc: u-boot@lists.denx.de; jh80.ch...@samsung.com;
human.hw...@samsung.com; dh09@samsung.com; ideal.s...@samsung.com;
Piotr Wilczek; Lukasz Majewski
Subject: Re: [PATCH v5 03/12] samsung: common: Add misc file and common
function misc_init_r().

Hello,

On 01/15/2014 08:35 AM, Minkyu Kang wrote:

On 14/01/14 22:55, Przemyslaw Marczak wrote:

Hello,
In case of discussion with Piotr Wilczek maybe it is better to make

some changes in this patch.


On 01/10/2014 03:31 PM, Przemyslaw Marczak wrote:

Config: CONFIG_MISC_INIT_R enables implementation of misc_init_r()
in common file::
- board/samsung/common/misc.c

Signed-off-by: Przemyslaw Marczak p.marc...@samsung.com
Acked-by: Jaehoon Chung jh80.ch...@samsung.com
---
Changes v2:
- change CONFIG_SAMSUNG to CONFIG_MISC_INIT_R

Changes v3:
- fix merge conflict in board/samsung/common/Makefile

Changes v4:
- none

Changes v5:
- add acked-by

 board/samsung/common/Makefile |1 +
 board/samsung/common/misc.c   |   14 ++
 2 files changed, 15 insertions(+)
 create mode 100644 board/samsung/common/misc.c

diff --git a/board/samsung/common/Makefile
b/board/samsung/common/Makefile index 22bd6b1..79547a3 100644
--- a/board/samsung/common/Makefile
+++ b/board/samsung/common/Makefile
@@ -8,6 +8,7 @@
 obj-$(CONFIG_SOFT_I2C_MULTI_BUS) += multi_i2c.o
 obj-$(CONFIG_THOR_FUNCTION) += thor.o
 obj-$(CONFIG_CMD_USB_MASS_STORAGE) += ums.o
+obj-$(CONFIG_MISC_INIT_R) += misc.o

here change to:
obj-y += misc.o



 ifndef CONFIG_SPL_BUILD
 obj-$(CONFIG_BOARD_COMMON)+= board.o
diff --git a/board/samsung/common/misc.c
b/board/samsung/common/misc.c new file mode 100644 index
000..3764d12
--- /dev/null
+++ b/board/samsung/common/misc.c
@@ -0,0 +1,14 @@
+/*
+ * Copyright (C) 2013 Samsung Electronics
+ * Przemyslaw Marczak p.marc...@samsung.com
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#include common.h
+


and here:
#ifdef CONFIG_MISC_INIT_R


+/* Common for Samsung boards */
+int misc_init_r(void)
+{
+return 0;
+}


#endif

In this way we can add other functions in the future even without

CONFIG_MISC_INIT_R.


partly agree.
But, I doubt what is the role of misc.c file.
because of the meaning of miscellaneous is ambiguous, this file have
possibility to be messy.
So, please let me know what is your plan to this file.



I first planned put there only implementation of misc_init_r() and it's
subfunctions - as the easy way to display logo and menu for Samsung
boards.
Piotr has suggested to change the purpose of this file as misc not only
for misc_init_r implementation...

Przemyslaw, I asked you question: what is the misc.c file for?
If for misc_init_r only then I think the file name misc.c is confusing.
If also other common functions can be put there, then the define MISC_INIT_R
to compile this file is wrong.



Yes, and next I said that maybe I will change this config dependency, and now I 
try to do it.



Actually, I feel negative to this changes.
Because misc_init_r is a board specific.
How you can support if someone want to do something (board specific things) on 
misc_init_r?
I totally understand why you add misc_init_r to common directory. - It means 
you don't have to explain why you added it :)
but it looks little weird.
So we will discuss that misc_init_r should go to each boards or stay here? 
(misc_init_r function only, not including key, menu, logo.. etc)

Please let me know your opinions.

Thanks,
Minkyu Kang.




The reason why I used misc_init_r for a common purposes is that it is 
called after all hardware initialization and before u-boot main_loop(), 
then I don't need to introduce another generic function just to check 
buttons - this is the only reason.


Moreover at this time misc_init_r() is implemented only in Trats2, and 
there are easy to move things.


You're right - misc_init_r is board specific, but if we make it as a 
common function, then we also can add board specific code, called here 
but implemented in board files.


If this is wrong, then where is the better place for check keys, display 
logo and any more vendor common things?


Or maybe the better solution is just add new function callback to 
board_init_r() for some vendor specific purposes - and then it can be 
used for other vendors platforms too.


Thank you,
--
Przemyslaw Marczak
Samsung RD Institute Poland
Samsung Electronics
p.marc...@samsung.com
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 2/2] env_mmc: default to 0 if CONFIG_SYS_MMC_ENV_DEV not defined

2014-01-17 Thread Hector Palacios
Since function mmc_get_env_devno is __weak and can be overridden by
board code, boards do not need to mandatory define
CONFIG_SYS_MMC_ENV_DEV.
If the constant is not defined, define it to 0 by default.

Signed-off-by: Hector Palacios hector.palac...@digi.com
---

Notes:
Changes since v1:
- Use default define if not set

 common/env_mmc.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/common/env_mmc.c b/common/env_mmc.c
index 570caf63aeae..c9df4c49e2b8 100644
--- a/common/env_mmc.c
+++ b/common/env_mmc.c
@@ -61,9 +61,14 @@ __weak int mmc_get_env_addr(struct mmc *mmc, int copy, u32 
*env_addr)
return 0;
 }
 
+#if !defined(CONFIG_SYS_MMC_ENV_DEV)
+#define CONFIG_SYS_MMC_ENV_DEV 0
+#endif
+
 __weak int mmc_get_env_devno(void)
 {
return CONFIG_SYS_MMC_ENV_DEV;
+}
 
 #if !defined(CONFIG_SYS_MMC_ENV_PART)
 #define CONFIG_SYS_MMC_ENV_PART 0
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 1/2] env_mmc: make board configurable the partition for the environment

2014-01-17 Thread Hector Palacios
This complements commit 9404a5fc7cb58 env_mmc: allow environment to be
in an eMMC partition by allowing boards to accommodate the partition
to use for the environment in different scenarios (similarly to what is
done with the mmc dev number). Depending on the detected boot media,
boards may decide to store the environment in a different partition.

The __weak function also allows to remove some ifdefs from the code.
If CONFIG_SYS_MMC_ENV_PART is not defined, partition 0 is assumed
(default value for U-Boot when a partition is not provided).

Signed-off-by: Hector Palacios hector.palac...@digi.com
---

Notes:
Changes since v1:
- Use default define if not set

 common/env_mmc.c | 28 
 1 file changed, 16 insertions(+), 12 deletions(-)

diff --git a/common/env_mmc.c b/common/env_mmc.c
index 78c2bc7a1f08..570caf63aeae 100644
--- a/common/env_mmc.c
+++ b/common/env_mmc.c
@@ -64,6 +64,14 @@ __weak int mmc_get_env_addr(struct mmc *mmc, int copy, u32 
*env_addr)
 __weak int mmc_get_env_devno(void)
 {
return CONFIG_SYS_MMC_ENV_DEV;
+
+#if !defined(CONFIG_SYS_MMC_ENV_PART)
+#define CONFIG_SYS_MMC_ENV_PART 0
+#endif
+
+__weak int mmc_get_env_partno(void)
+{
+   return CONFIG_SYS_MMC_ENV_PART;
 }
 
 int env_init(void)
@@ -77,6 +85,9 @@ int env_init(void)
 
 static int init_mmc_for_env(struct mmc *mmc)
 {
+   int mmc_env_devno = mmc_get_env_devno();
+   int mmc_env_partno = mmc_get_env_partno();
+
if (!mmc) {
puts(No MMC card found\n);
return -1;
@@ -87,30 +98,23 @@ static int init_mmc_for_env(struct mmc *mmc)
return -1;
}
 
-#ifdef CONFIG_SYS_MMC_ENV_PART
-   if (CONFIG_SYS_MMC_ENV_PART != mmc-part_num) {
-   int mmc_env_devno = mmc_get_env_devno();
-
-   if (mmc_switch_part(mmc_env_devno,
-   CONFIG_SYS_MMC_ENV_PART)) {
+   if (mmc_env_partno != mmc-part_num) {
+   if (mmc_switch_part(mmc_env_devno, mmc_env_partno)) {
puts(MMC partition switch failed\n);
return -1;
}
}
-#endif
 
return 0;
 }
 
 static void fini_mmc_for_env(struct mmc *mmc)
 {
-#ifdef CONFIG_SYS_MMC_ENV_PART
int mmc_env_devno = mmc_get_env_devno();
+   int mmc_env_partno = mmc_get_env_partno();
 
-   if (CONFIG_SYS_MMC_ENV_PART != mmc-part_num)
-   mmc_switch_part(mmc_env_devno,
-   mmc-part_num);
-#endif
+   if (mmc_env_partno != mmc-part_num)
+   mmc_switch_part(mmc_env_devno, mmc-part_num);
 }
 
 #ifdef CONFIG_CMD_SAVEENV
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PULL] : Please pull u-boot-imx

2014-01-17 Thread Stefano Babic
Hi Albert,

Commit 022298278 (mx6: soc: Disable VDDPU regulator) does not let boot
kernel with enabled GPU (i.MX6). It is unclear at the moment if the fix
should be done in U-Boot or in kernel, so it is better to revert it for
the release. Please pull from u-boot-imx, thanks !

The following changes since commit 3a21773129f6ef218f1978d05a1a5d5cf6801ab6:

  mx6: Add initial support for the Hummingboard solo (2014-01-15
10:33:25 +0100)

are available in the git repository at:

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

for you to fetch changes up to be2a3bb39adf1fdd274fc427e30ef62eb86441a1:

  mx6: Revert mx6: soc: Disable VDDPU regulator (2014-01-17 10:16:48
+0100)


Fabio Estevam (1):
  mx6: Revert mx6: soc: Disable VDDPU regulator

 arch/arm/cpu/armv7/mx6/soc.c |   41
--
 arch/arm/include/asm/arch-mx6/crm_regs.h |1 -
 arch/arm/include/asm/arch-mx6/imx-regs.h |   23 -
 3 files changed, 65 deletions(-)

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] Fwd: Re: Boot Linux kernel with initramfs fails

2014-01-17 Thread Jean-baptiste DURONEA

Dear Wolfgang Denk,

I forgot some explanations, sorry about that.

I refer to this problem :
http://lists.denx.de/pipermail/u-boot/2013-July/159055.html

First, I tried to boot linux with initramfs through u-boot, but I had
the same problem explained in my first post.

Here is a part of the config file used by my -boot :

 /* High Level Configuration Options */
#define CONFIG_ARMV7/* This is armv7 Cortex-A9 CPU core */
#define CONFIG_MXC
#define CONFIG_MX6DL
#define CONFIG_MX6DL_DDR3
#define CONFIG_MX6DL_SABRESD
#define CONFIG_DDR_32BIT
#define CONFIG_FLASH_HEADER
#define CONFIG_FLASH_HEADER_OFFSET 0x400
#define CONFIG_MX6_CLK32   32768

/* Disable secure boot feature in default, if you want to enable this
 * feature, please carefully read related documents, you may needs to
 * change u-boot.lds */
#undef CONFIG_SECURE_BOOT

#define CONFIG_SKIP_RELOCATE_UBOOT

#define CONFIG_ARCH_CPU_INIT
#undef CONFIG_ARCH_MMU /* disable MMU first */
#define CONFIG_L2_OFF  /* disable L2 cache first*/

#define CONFIG_MX6_HCLK_FREQ2400

#define CONFIG_DISPLAY_CPUINFO
#define CONFIG_DISPLAY_BOARDINFO

#define CONFIG_SYS_64BIT_VSPRINTF

#define BOARD_LATE_INIT

#define CONFIG_CMDLINE_TAG/* enable passing of ATAGs */
#define CONFIG_SERIAL_TAG
#define CONFIG_REVISION_TAG
#define CONFIG_SETUP_MEMORY_TAGS
#define CONFIG_INITRD_TAG
#define CONFIG_MXC_GPIO

initramfs is loaded in ram at 0x10C0 by mfgtools, which is the
freescales's manufacturing tool.

I don't know which configuration I need to set on u-boot to tell him
initramfs is at address 0x10C0, and consequently it hands on linux.

 I am really bloqued on this problem.
Can you give me some hints ?


Tanks a lot !

Regards,


Le 17/01/2014 07:16, Wolfgang Denk a écrit :

Dear Jean-baptiste DURONEA,

In message 52d7d2f7.2050...@gmail.com you wrote:

We made a custom board based on imx6solo.
I have the same problem !

The same problem as what or who?  I cannot even guess...


I have some trouble booting linux kernel with initramfs. I built linux
kernel with CONFIG_BLK_DEV_INITRD, so Kbuild generates
usr/initramfs_data.cpio which is integrated into the kernel.

...
...

My kernel hangs after the last line, instead of doing Freeing init
memory: ... but I don't know if it comes from the same problem or not...

Sorry, but I cannot see anything in your posting which might even
remotely be related to U-Boot.  This is the U-Boot mailing list - your
question is off topic here.

Best regards,

Wolfgang Denk





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


Re: [U-Boot] [PATCH 0/3] fix: Trats/Trats2 default envs adjustement for 2014.01 release

2014-01-17 Thread Lukasz Majewski
Hi Tom,

 Adjust default envs for Trats and Trats2 boards. Those changes are
 supposed to cleanup and improve things for v2014.01 u-boot release.
 
 Lukasz Majewski (3):
   config: Update envs for trats and trats2 - new entries for new
 partitions
   ARM: trats2: dfu: Enable default Poll Timeout for Trats2 board
   config: Update envs for trats and trats2 - Disable L2 cache
 
  include/configs/trats.h  |6 +-
  include/configs/trats2.h |7 ++-
  2 files changed, 11 insertions(+), 2 deletions(-)
 

Could you apply those patches to v2014.01?

Minkyu has already ACKed them.

-- 
Best regards,

Lukasz Majewski

Samsung RD Institute Poland (SRPOL) | Linux Platform Group
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 1/2] env_mmc: make board configurable the partition for the environment

2014-01-17 Thread Otavio Salvador
Hello Hector,

On Fri, Jan 17, 2014 at 7:14 AM, Hector Palacios
hector.palac...@digi.comwrote:

 This complements commit 9404a5fc7cb58 env_mmc: allow environment to be
 in an eMMC partition by allowing boards to accommodate the partition
 to use for the environment in different scenarios (similarly to what is
 done with the mmc dev number). Depending on the detected boot media,
 boards may decide to store the environment in a different partition.

 The __weak function also allows to remove some ifdefs from the code.
 If CONFIG_SYS_MMC_ENV_PART is not defined, partition 0 is assumed
 (default value for U-Boot when a partition is not provided).

 Signed-off-by: Hector Palacios hector.palac...@digi.com
 ---

 Notes:
 Changes since v1:
 - Use default define if not set

  common/env_mmc.c | 28 
  1 file changed, 16 insertions(+), 12 deletions(-)

 diff --git a/common/env_mmc.c b/common/env_mmc.c
 index 78c2bc7a1f08..570caf63aeae 100644
 --- a/common/env_mmc.c
 +++ b/common/env_mmc.c
 @@ -64,6 +64,14 @@ __weak int mmc_get_env_addr(struct mmc *mmc, int copy,
 u32 *env_addr)
  __weak int mmc_get_env_devno(void)
  {
 return CONFIG_SYS_MMC_ENV_DEV;
 +
 +#if !defined(CONFIG_SYS_MMC_ENV_PART)
 +#define CONFIG_SYS_MMC_ENV_PART 0
 +#endif


This should be in include/config_fallbacks.h

-- 
Otavio Salvador O.S. Systems
http://www.ossystems.com.brhttp://code.ossystems.com.br
Mobile: +55 (53) 9981-7854Mobile: +1 (347) 903-9750
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 2/2] env_mmc: default to 0 if CONFIG_SYS_MMC_ENV_DEV not defined

2014-01-17 Thread Otavio Salvador
Hello Hector,

On Fri, Jan 17, 2014 at 7:14 AM, Hector Palacios
hector.palac...@digi.comwrote:

 Since function mmc_get_env_devno is __weak and can be overridden by
 board code, boards do not need to mandatory define
 CONFIG_SYS_MMC_ENV_DEV.
 If the constant is not defined, define it to 0 by default.

 Signed-off-by: Hector Palacios hector.palac...@digi.com
 ---

 Notes:
 Changes since v1:
 - Use default define if not set

  common/env_mmc.c | 5 +
  1 file changed, 5 insertions(+)

 diff --git a/common/env_mmc.c b/common/env_mmc.c
 index 570caf63aeae..c9df4c49e2b8 100644
 --- a/common/env_mmc.c
 +++ b/common/env_mmc.c
 @@ -61,9 +61,14 @@ __weak int mmc_get_env_addr(struct mmc *mmc, int copy,
 u32 *env_addr)
 return 0;
  }

 +#if !defined(CONFIG_SYS_MMC_ENV_DEV)
 +#define CONFIG_SYS_MMC_ENV_DEV 0
 +#endif
 +


Please move this to include/config_fallbacks.h


  __weak int mmc_get_env_devno(void)
  {
 return CONFIG_SYS_MMC_ENV_DEV;
 +}

  #if !defined(CONFIG_SYS_MMC_ENV_PART)
  #define CONFIG_SYS_MMC_ENV_PART 0




-- 
Otavio Salvador O.S. Systems
http://www.ossystems.com.brhttp://code.ossystems.com.br
Mobile: +55 (53) 9981-7854Mobile: +1 (347) 903-9750
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] booting os 'Unknown OS' (1) is not supported

2014-01-17 Thread Alexander Khryukin
Hello guys!
I faced with a strange behaviour of u-boot.
Few months ago i bought an ARM development board from yicsystem
it's based on exynos 5250 and very similar to arndale
http://www.yicsystem.com/products/low-cost-board/yse5250/

And i can boot Android ICS
but when i try to boot any linux
i always see


Checking Boot Mode ... SDMMC
Now running in RAM - U-Boot at: c3e0
REVISION: 1.0
REVISION: 1.0
MMC Device 0: 3839 MB
NAME: S5P_MSHC0
MMC Device 1: 7348 MB
MMC Device 2 not found
Destroy Hash Table: c3f80f78 table = (null)
Create Hash Table: N=512
INSERT: table c3f80f78, filled 1/521 rv c3d047a0 == name=baudrate
value=115200
INSERT: table c3f80f78, filled 2/521 rv c3d0582c == name=bootargs
value=root=/dev/mmcblk0p1
INSERT: table c3f80f78, filled 3/521 rv c3d04a1c == name=bootcmd
value=movi read kernel 0 40008000;movi read rootfs 0 4100 10;bootm
40008000 4100
INSERT: table c3f80f78, filled 4/521 rv c3d04f20 == name=bootdelay
value=3
INSERT: table c3f80f78, filled 5/521 rv c3d04bfc == name=bootfile
value=/tftpboot/revoboot/bin/revoboot.pxe
INSERT: table c3f80f78, filled 6/521 rv c3d040a4 ==
name=emmcbootrecovery value=mmc erase boot 1 0 0;emmc open 1;movi read
fwbl1 0 4000;movi write zero fwbl1 1 4000;movi read bl2 0
40004000;movi write zero bl2 1 40004000;movi read u-boot 0 4200;movi
write zero u-boot 1 4200;movi read tzsw 0 4210;movi write zero tzsw
1 4210;emmc close 1
INSERT: table c3f80f78, filled 7/521 rv c3d04998 == name=ethact
value=smc911x-0
INSERT: table c3f80f78, filled 8/521 rv c3d0462c == name=ethaddr
value=00:40:5c:26:0a:5b
INSERT: table c3f80f78, filled 9/521 rv c3d057a8 == name=gatewayip
value=192.168.0.1
INSERT: table c3f80f78, filled 10/521 rv c3d05874 == name=ipaddr
value=192.168.0.28
INSERT: table c3f80f78, filled 11/521 rv c3d048c0 == name=netmask
value=255.255.255.0
INSERT: table c3f80f78, filled 12/521 rv c3d05214 == name=rootfslen
value= 10
INSERT: table c3f80f78, filled 13/521 rv c3d048e4 == name=serverip
value=192.168.0.13
INSERT: free(data = c3d00010)
INSERT: done
Net:   smc911x-0
### main_loop entered: bootdelay=3

### main_loop: bootcmd=movi read kernel 0 40008000;movi read rootfs 0
4100 10;bootm 40008000 4100
Hit any key to stop autoboot:  0
reading kernel..device 0 Start 1063, Count 16384
MMC read: dev # 0, block # 1063, count 16384 ... 16384 blocks read: OK
completed
reading RFS..device 0 Count 17447, Start 2048
MMC read: dev # 0, block # 17447, count 2048 ... 2048 blocks read: OK
completed
## Current stack ends at 0xc3cfbd98 *  kernel: cmdline image address =
0x40008000
## Booting kernel from Legacy Image at 40008000 ...
   Image Name:   Linux-3.12.0-rc1-armv7-x0.6-0012
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:3243400 Bytes = 3167 KiB
   Load Address: 40008000
   Entry Point:  40008000
   Verifying Checksum ... OK
   kernel data at 0x40008040, len = 0x00317d88 (3243400)
*  ramdisk: cmdline image address = 0x4100
Wrong Ramdisk Image Format
   ramdisk start = 0x4100, ramdisk end = 0x4100
   XIP Kernel Image ... OK
OK
   kernel loaded at 0x40008000, end = 0x4031fd88
images.os.start = 0x40008000, images.os.end = 0x4031fdc8
images.os.load = 0x40008000, load_end = 0x4031fd88
*ERROR: booting os 'Unknown OS' (1) is not supported*





Unknown OS.
But i do not understand what i should change to proceed.
Any suggestions?
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Fwd: Re: Boot Linux kernel with initramfs fails

2014-01-17 Thread Wolfgang Denk
Dear Jean-Baptiste,

In message 52d8fbf8.2060...@gmail.com you wrote:
 
 I forgot some explanations, sorry about that.
 
 I refer to this problem :
 http://lists.denx.de/pipermail/u-boot/2013-July/159055.html

And there you wrote:

| When I boot Linux kernel with FIT Image, the kernel does not unpacking 
initramfs.
| ( The root cause is initrd_start is NULL.)
| 
| The initramfs is built-in with kernel, so I don't specify ramdisk in my
| kernel.its file.

initramfs handling is internal to Linux.  This is not a problem with
U-Boot.

Check how you build your kernel image and make sure the initramfs
image (and a working one) gets processed there.


Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Good morning. This is the telephone company. Due  to  repairs,  we're
giving  you  advance notice that your service will be cut off indefi-
nitely at ten o'clock. That's two minutes from now.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v5 05/38] examples: Use scripts/Makefile.build

2014-01-17 Thread Masahiro Yamada
Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---

Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None

 Makefile |  5 +
 examples/api/Makefile| 21 +---
 examples/standalone/Makefile | 46 ++--
 scripts/Makefile.build   |  7 ---
 4 files changed, 24 insertions(+), 55 deletions(-)

diff --git a/Makefile b/Makefile
index beb58a1..6d3f2ce 100644
--- a/Makefile
+++ b/Makefile
@@ -558,12 +558,9 @@ $(OBJS):
 $(LIBS):   depend $(SUBDIR_TOOLS)
$(MAKE) $(build) $(dir $(subst $(obj),,$@))
 
-tools: depend
+$(SUBDIRS):depend
$(MAKE) $(build) $@ all
 
-$(filter-out tools,$(SUBDIRS)):depend
-   $(MAKE) -C $@ all
-
 $(SUBDIR_EXAMPLES-y): $(obj)u-boot
 
 $(obj)u-boot.lds: $(LDSCRIPT) depend
diff --git a/examples/api/Makefile b/examples/api/Makefile
index cad10a3..f770859 100644
--- a/examples/api/Makefile
+++ b/examples/api/Makefile
@@ -11,10 +11,8 @@ ifeq ($(ARCH),arm)
 LOAD_ADDR = 0x100
 endif
 
-include $(TOPDIR)/config.mk
-
 # Resulting ELF and binary exectuables will be named demo and demo.bin
-OUTPUT = $(obj)demo
+extra-y = demo
 
 # Source files located in the examples/api directory
 SOBJ_FILES-y += crt0.o
@@ -43,13 +41,13 @@ OBJS+= $(addprefix $(obj),$(COBJ_FILES-y))
 OBJS   += $(addprefix $(obj),$(notdir $(EXT_COBJ_FILES-y)))
 OBJS   += $(addprefix $(obj),$(notdir $(EXT_SOBJ_FILES-y)))
 
-all:   $(obj).depend $(OUTPUT)
-
 #
 
-$(OUTPUT): $(OBJS)
+$(obj)demo:$(OBJS)
$(LD) --gc-sections -Ttext $(LOAD_ADDR) -o $@ $^ 
$(PLATFORM_LIBS)
-   $(OBJCOPY) -O binary $@ $(OUTPUT).bin 2/dev/null
+
+$(obj)demo.bin: $(obj)demo
+   $(OBJCOPY) -O binary $ $@ 2/dev/null
 
 # Rule to build generic library C files
 $(obj)%.o: $(SRCTREE)/lib/%.c
@@ -58,12 +56,3 @@ $(obj)%.o: $(SRCTREE)/lib/%.c
 # Rule to build architecture-specific library assembly files
 $(obj)%.o: $(SRCTREE)/arch/$(ARCH)/lib/%.S
$(CC) -g $(CFLAGS) -c -o $@ $
-
-#
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#
diff --git a/examples/standalone/Makefile b/examples/standalone/Makefile
index 0841c75..cad4409 100644
--- a/examples/standalone/Makefile
+++ b/examples/standalone/Makefile
@@ -5,27 +5,25 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
-
-ELF-y:= hello_world
-
-ELF-$(CONFIG_SMC9)   += smc9_eeprom
-ELF-$(CONFIG_SMC911X)+= smc911x_eeprom
-ELF-$(CONFIG_SPI_FLASH_ATMEL)+= atmel_df_pow2
-ELF-$(CONFIG_MPC5xxx)+= interrupt
-ELF-$(CONFIG_8xx)+= test_burst timer
-ELF-$(CONFIG_8260)   += mem_to_mem_idma2intr
-ELF-$(CONFIG_PPC)+= sched
+extra-y:= hello_world
+extra-$(CONFIG_SMC9)   += smc9_eeprom
+extra-$(CONFIG_SMC911X)+= smc911x_eeprom
+extra-$(CONFIG_SPI_FLASH_ATMEL)+= atmel_df_pow2
+extra-$(CONFIG_MPC5xxx)+= interrupt
+extra-$(CONFIG_8xx)+= test_burst timer
+extra-$(CONFIG_8260)   += mem_to_mem_idma2intr
+extra-$(CONFIG_PPC)+= sched
 
 #
 # Some versions of make do not handle trailing white spaces properly;
 # leading to build failures. The problem was found with GNU Make 3.80.
 # Using 'strip' as a workaround for the problem.
 #
-ELF := $(strip $(ELF-y))
+ELF := $(strip $(extra-y))
+
+extra-y += $(addsuffix .srec,$(extra-y)) $(addsuffix .bin,$(extra-y))
+clean-files  := $(extra-) $(addsuffix .srec,$(extra-)) $(addsuffix 
.bin,$(extra-))
 
-SREC := $(addsuffix .srec,$(ELF))
-BIN  := $(addsuffix .bin,$(ELF))
 
 COBJS  := $(ELF:=.o)
 
@@ -42,8 +40,6 @@ LIBOBJS   = $(addprefix $(obj),$(LIBAOBJS) $(LIBCOBJS))
 SRCS   := $(COBJS:.o=.c) $(LIBCOBJS:.o=.c) $(LIBAOBJS:.o=.S)
 OBJS   := $(addprefix $(obj),$(COBJS))
 ELF:= $(addprefix $(obj),$(ELF))
-BIN:= $(addprefix $(obj),$(BIN))
-SREC   := $(addprefix $(obj),$(SREC))
 
 gcclibdir := $(shell dirname `$(CC) -print-libgcc-file-name`)
 
@@ -60,13 +56,10 @@ endif
 # We don't want gcc reordering functions if possible.  This ensures that an
 # application's entry point will be the first function in the application's
 # source file.
-CFLAGS_NTR := $(call cc-option,-fno-toplevel-reorder)
-CFLAGS += $(CFLAGS_NTR)
-
-all:   $(obj).depend $(OBJS) $(LIB) $(SREC) $(BIN) $(ELF)
+CFLAGS += $(call cc-option,-fno-toplevel-reorder)
 
 #
-$(LIB):$(obj).depend $(LIBOBJS)
+$(LIB):$(LIBOBJS)
$(call cmd_link_o_target, $(LIBOBJS))
 
 $(ELF):
@@ -75,19 +68,8 @@ $(obj)%: $(obj)%.o $(LIB)
   

[U-Boot] [PATCH v5 35/38] kbuild: check clean source and generate Makefile for out-of-tree build

2014-01-17 Thread Masahiro Yamada
For out-of-tree build
  - Check if the source tree is clean
  - Create a Makefile in the output directory

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

Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2:
  - Newly added

 Makefile | 63 +--
 1 file changed, 57 insertions(+), 6 deletions(-)

diff --git a/Makefile b/Makefile
index d5ca04e..528269d 100644
--- a/Makefile
+++ b/Makefile
@@ -391,6 +391,17 @@ scripts_basic:
 # To avoid any implicit rule to kick in, define an empty command.
 scripts/basic/%: scripts_basic ;
 
+PHONY += outputmakefile
+# outputmakefile generates a Makefile in the output directory, if using a
+# separate output directory. This allows convenient use of make in the
+# output directory.
+outputmakefile:
+ifneq ($(KBUILD_SRC),)
+   $(Q)ln -fsn $(srctree) source
+   $(Q)$(CONFIG_SHELL) $(srctree)/scripts/mkmakefile \
+   $(srctree) $(objtree) $(VERSION) $(PATCHLEVEL)
+endif
+
 # To make sure we do not include .config for any of the *config targets
 # catch them early, and hand them over to scripts/kconfig/Makefile
 # It is allowed to specify more targets when calling make, including
@@ -448,7 +459,7 @@ ifeq ($(config-targets),1)
 # KBUILD_DEFCONFIG may point out an alternative default configuration
 # used for 'make defconfig'
 
-%_config::
+%_config:: outputmakefile
@$(MKCONFIG) -A $(@:_config=)
 
 else
@@ -951,7 +962,7 @@ $(sort $(u-boot-init) $(u-boot-main)): $(u-boot-dirs) ;
 # Error messages still appears in the original language
 
 PHONY += $(u-boot-dirs)
-$(u-boot-dirs): depend scripts_basic
+$(u-boot-dirs): depend prepare
$(Q)$(MAKE) $(build)=$@
 
 tools: $(TIMESTAMP_FILE) $(VERSION_FILE)
@@ -962,19 +973,56 @@ $(filter-out tools, $(u-boot-dirs)): tools
 examples: $(filter-out examples, $(u-boot-dirs))
 
 
+# Things we need to do before we recursively start building the kernel
+# or the modules are listed in prepare.
+# A multi level approach is used. prepareN is processed before prepareN-1.
+# archprepare is used in arch Makefiles and when processed asm symlink,
+# version.h and scripts_basic is processed / created.
+
+# Listed in dependency order
+PHONY += prepare archprepare prepare0 prepare1 prepare2 prepare3
+
+# prepare3 is used to check if we are building in a separate output directory,
+# and if so do:
+# 1) Check that make has not been executed in the kernel src $(srctree)
+prepare3:
+ifneq ($(KBUILD_SRC),)
+   @$(kecho) '  Using $(srctree) as source for u-boot'
+   $(Q)if [ -f $(srctree)/include/config.mk ]; then \
+   echo 2   $(srctree) is not clean, please run 'make 
mrproper'; \
+   echo 2   in the '$(srctree)' directory.;\
+   /bin/false; \
+   fi;
+endif
+
+# prepare2 creates a makefile if using a separate output directory
+prepare2: prepare3 outputmakefile
+
+prepare1: prepare2
+   @:
+
+archprepare: prepare1 scripts_basic
+
+prepare0: archprepare FORCE
+   @:
+
+# All the preparing..
+prepare: prepare0
+
+
 u-boot.lds: $(LDSCRIPT) depend
$(CPP) $(cpp_flags) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - $ 
$@
 
-nand_spl:  $(TIMESTAMP_FILE) $(VERSION_FILE) depend scripts_basic
+nand_spl:  $(TIMESTAMP_FILE) $(VERSION_FILE) depend prepare
$(MAKE) $(build)=nand_spl/board/$(BOARDDIR) all
 
 u-boot-nand.bin:   nand_spl u-boot.bin
cat nand_spl/u-boot-spl-16k.bin u-boot.bin  u-boot-nand.bin
 
-spl/u-boot-spl.bin: tools depend scripts_basic
+spl/u-boot-spl.bin: tools depend prepare
$(MAKE) obj=spl -f $(srctree)/spl/Makefile all
 
-tpl/u-boot-tpl.bin: tools depend scripts_basic
+tpl/u-boot-tpl.bin: tools depend prepare
$(MAKE) obj=tpl -f $(srctree)/spl/Makefile all 
CONFIG_TPL_BUILD=y
 
 # Explicitly make _depend in subdirs containing multiple targets to prevent
@@ -1224,7 +1272,10 @@ backup:
F=`basename $(TOPDIR)` ; cd .. ; \
gtar --force-local -zcvf `LC_ALL=C date +$$F-%Y-%m-%d-%T.tar.gz` $$F
 
-#
+# Dummies...
+PHONY += prepare scripts
+prepare: ;
+scripts: ;
 
 endif #ifeq ($(config-targets),1)
 endif #ifeq ($(mixed-targets),1)
-- 
1.8.3.2

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


[U-Boot] [PATCH v5 37/38] kbuild: Do not generate .*.su files at the top directory

2014-01-17 Thread Masahiro Yamada
Without this workaround, you will see a lot of .*.su files
at the top directory after building with a compiler
which supports -fstack-usage option.

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

Changes in v5: None
Changes in v4:
  - Newly added

Changes in v3: None
Changes in v2: None

 scripts/Kbuild.include | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include
index 6113c13..6504571 100644
--- a/scripts/Kbuild.include
+++ b/scripts/Kbuild.include
@@ -85,14 +85,16 @@ TMPOUT := $(if $(KBUILD_EXTMOD),$(firstword 
$(KBUILD_EXTMOD))/)
 # Usage: option = $(call try-run, $(CC)...-o $$TMP,option-ok,otherwise)
 # Exit code chooses option. $$TMP is can be used as temporary file and
 # is automatically cleaned up.
+# modifed for U-Boot: prevent cc-option from leaving .*.su files
 try-run = $(shell set -e;  \
TMP=$(TMPOUT)..tmp;   \
TMPO=$(TMPOUT)..o;\
+   TMPSU=$(TMPOUT)..su;  \
if ($(1)) /dev/null 21;  \
then echo $(2);   \
else echo $(3);   \
fi; \
-   rm -f $$TMP $$TMPO)
+   rm -f $$TMP $$TMPO $$TMPSU)
 
 # as-option
 # Usage: cflags-y += $(call as-option,-Wa$(comma)-isa=foo,)
-- 
1.8.3.2

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


[U-Boot] [PATCH v5 29/38] examples: move api/ and standalone/ to examples/Makefile

2014-01-17 Thread Masahiro Yamada
Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---

Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None

 Makefile | 5 +
 examples/Makefile| 9 +
 examples/api/Makefile| 4 
 examples/standalone/Makefile | 4 
 4 files changed, 10 insertions(+), 12 deletions(-)
 create mode 100644 examples/Makefile

diff --git a/Makefile b/Makefile
index 112b515..9927343 100644
--- a/Makefile
+++ b/Makefile
@@ -593,11 +593,8 @@ SUBDIRS = $(SUBDIR_TOOLS)
 
 .PHONY : $(SUBDIRS) $(VERSION_FILE) $(TIMESTAMP_FILE)
 
-SUBDIR_EXAMPLES-y := examples/standalone
-SUBDIR_EXAMPLES-$(CONFIG_API) += examples/api
-ifndef CONFIG_SANDBOX
+SUBDIR_EXAMPLES-y := examples
 SUBDIRS += $(SUBDIR_EXAMPLES-y)
-endif
 
 #
 # U-Boot objectsorder is important (i.e. start must be first)
diff --git a/examples/Makefile b/examples/Makefile
new file mode 100644
index 000..18d008e
--- /dev/null
+++ b/examples/Makefile
@@ -0,0 +1,9 @@
+ifndef CONFIG_SANDBOX
+
+ifdef FTRACE
+subdir-ccflags-y += -finstrument-functions -DFTRACE
+endif
+
+subdir-y += standalone
+subdir-$(CONFIG_API) += api
+endif
diff --git a/examples/api/Makefile b/examples/api/Makefile
index 8b79886..09475f8 100644
--- a/examples/api/Makefile
+++ b/examples/api/Makefile
@@ -4,10 +4,6 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-ifdef FTRACE
-ccflags-y += -finstrument-functions -DFTRACE
-endif
-
 ifeq ($(ARCH),powerpc)
 LOAD_ADDR = 0x4
 endif
diff --git a/examples/standalone/Makefile b/examples/standalone/Makefile
index ca62e2a..6a5f1ff 100644
--- a/examples/standalone/Makefile
+++ b/examples/standalone/Makefile
@@ -5,10 +5,6 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-ifdef FTRACE
-ccflags-y += -finstrument-functions -DFTRACE
-endif
-
 extra-y:= hello_world
 extra-$(CONFIG_SMC9)   += smc9_eeprom
 extra-$(CONFIG_SMC911X)+= smc911x_eeprom
-- 
1.8.3.2

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


[U-Boot] [PATCH v5 38/38] tools/env: cross-compile fw_printenv without setting HOSTCC

2014-01-17 Thread Masahiro Yamada
fw_printenv is a program which mostly runs on the target Linux.

Before switching to Kbuild, we needed to set HOSTCC at the
command line like this:
make HOSTCC=your CC cross-compiler env

Going forward we can cross compile it by specifying CROSS_COMPILE:
make CROSS_COMPILE=your cross-compiler prefix env
This looks more natural.

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

Changes in v5:
  - Newly added

Changes in v4: None
Changes in v3: None
Changes in v2: None

 tools/.gitignore |  1 -
 tools/env/.gitignore |  2 ++
 tools/env/Makefile   | 17 ++---
 tools/env/README |  5 ++---
 4 files changed, 18 insertions(+), 7 deletions(-)
 create mode 100644 tools/env/.gitignore

diff --git a/tools/.gitignore b/tools/.gitignore
index 13283b7..6e4a287 100644
--- a/tools/.gitignore
+++ b/tools/.gitignore
@@ -16,7 +16,6 @@
 /xway-swap-bytes
 /*.exe
 /easylogo/easylogo
-/env/fw_printenv
 /gdb/gdbcont
 /gdb/gdbsend
 /kernel-doc/docproc
diff --git a/tools/env/.gitignore b/tools/env/.gitignore
new file mode 100644
index 000..804abac
--- /dev/null
+++ b/tools/env/.gitignore
@@ -0,0 +1,2 @@
+fw_printenv
+fw_printenv_unstripped
diff --git a/tools/env/Makefile b/tools/env/Makefile
index d47fe16..10993c9 100644
--- a/tools/env/Makefile
+++ b/tools/env/Makefile
@@ -5,6 +5,11 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
+# fw_printenv is supposed to run on the target system, which means it should be
+# built with cross tools. We only replace HOSTCC with CC for the maximum
+# code reuse of scripts/Makefile.host.
+HOSTCC = $(CC)
+
 # Compile for a hosted environment on the target
 HOST_EXTRACFLAGS  = $(patsubst -I%,-idirafter%, $(UBOOTINCLUDE)) \
-idirafter $(SRCTREE)/tools/env \
@@ -15,9 +20,15 @@ ifeq ($(MTD_VERSION),old)
 HOST_EXTRACFLAGS += -DMTD_OLD
 endif
 
-hostprogs-y := fw_printenv
-always := $(hostprogs-y)
+always := fw_printenv
+hostprogs-y := fw_printenv_unstripped
 
-fw_printenv-objs := fw_env.o fw_env_main.o \
+fw_printenv_unstripped-objs := fw_env.o fw_env_main.o \
crc32.o ctype.o linux_string.o \
env_attr.o env_flags.o
+
+quiet_cmd_strip = STRIP   $@
+  cmd_strip = $(STRIP) -o $@ $
+
+$(obj)/fw_printenv: $(obj)/fw_printenv_unstripped FORCE
+   $(call if_changed,strip)
diff --git a/tools/env/README b/tools/env/README
index 1020b57..24e31bc 100644
--- a/tools/env/README
+++ b/tools/env/README
@@ -2,11 +2,10 @@
 This is a demo implementation of a Linux command line tool to access
 the U-Boot's environment variables.
 
-In the current version, there is an issue in cross-compilation.
 In order to cross-compile fw_printenv, run
-make HOSTCC=your CC cross-compiler env
+make CROSS_COMPILE=your cross-compiler prefix env
 in the root directory of the U-Boot distribution. For example,
-make HOSTCC=arm-linux-gcc env
+make CROSS_COMPILE=arm-linux- env
 
 For the run-time utility configuration uncomment the line
 #define CONFIG_FILE  /etc/fw_env.config
-- 
1.8.3.2

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


[U-Boot] [PATCH v5 30/38] kbuild: refactor Makefile and spl/Makefile more

2014-01-17 Thread Masahiro Yamada
This commit refactors rules of directory descending
and defines u-boot-dirs and u-boot-all-dirs.
(We will need u-boot-all-dirs when using
scripts/Makefile.clean)

Additionally, rename LIBS-y to libs-y.

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

Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None

 Makefile | 163 ++-
 spl/Makefile | 108 ---
 2 files changed, 140 insertions(+), 131 deletions(-)

diff --git a/Makefile b/Makefile
index 9927343..f520fa2 100644
--- a/Makefile
+++ b/Makefile
@@ -584,17 +584,7 @@ CHECKFLAGS += $(NOSTDINC_FLAGS)
 cpp_flags := $(KBUILD_CPPFLAGS) $(CPPFLAGS) $(UBOOTINCLUDE) $(NOSTDINC_FLAGS)
 c_flags := $(KBUILD_CFLAGS) $(cpp_flags)
 
-# The tools are needed early, so put this first
-# Don't include stuff already done in $(LIBS)
-# The examples conditionally depend on U-Boot (say, when USE_PRIVATE_LIBGCC
-# is yes), so compile examples after U-Boot is compiled.
-SUBDIR_TOOLS = tools
-SUBDIRS = $(SUBDIR_TOOLS)
-
-.PHONY : $(SUBDIRS) $(VERSION_FILE) $(TIMESTAMP_FILE)
-
-SUBDIR_EXAMPLES-y := examples
-SUBDIRS += $(SUBDIR_EXAMPLES-y)
+.PHONY : $(VERSION_FILE) $(TIMESTAMP_FILE)
 
 #
 # U-Boot objectsorder is important (i.e. start must be first)
@@ -603,70 +593,76 @@ head-y := $(CPUDIR)/start.o
 head-$(CONFIG_4xx) += arch/powerpc/cpu/ppc4xx/resetvec.o
 head-$(CONFIG_MPC85xx) += arch/powerpc/cpu/mpc85xx/resetvec.o
 
-OBJS := $(head-y)
-
 HAVE_VENDOR_COMMON_LIB = $(if $(wildcard 
$(srctree)/board/$(VENDOR)/common/Makefile),y,n)
 
-LIBS-y += lib/
-LIBS-$(HAVE_VENDOR_COMMON_LIB) += board/$(VENDOR)/common/
-LIBS-y += $(CPUDIR)/
+libs-y += lib/
+libs-$(HAVE_VENDOR_COMMON_LIB) += board/$(VENDOR)/common/
+libs-y += $(CPUDIR)/
 ifdef SOC
-LIBS-y += $(CPUDIR)/$(SOC)/
+libs-y += $(CPUDIR)/$(SOC)/
 endif
-LIBS-$(CONFIG_IXP4XX_NPE) += drivers/net/npe/
-LIBS-$(CONFIG_OF_EMBED) += dts/
-LIBS-y += arch/$(ARCH)/lib/
-LIBS-y += fs/
-LIBS-y += net/
-LIBS-y += disk/
-LIBS-y += drivers/
-LIBS-y += drivers/dma/
-LIBS-y += drivers/gpio/
-LIBS-y += drivers/i2c/
-LIBS-y += drivers/input/
-LIBS-y += drivers/mmc/
-LIBS-y += drivers/mtd/
-LIBS-$(CONFIG_CMD_NAND) += drivers/mtd/nand/
-LIBS-y += drivers/mtd/onenand/
-LIBS-$(CONFIG_CMD_UBI) += drivers/mtd/ubi/
-LIBS-y += drivers/mtd/spi/
-LIBS-y += drivers/net/
-LIBS-y += drivers/net/phy/
-LIBS-y += drivers/pci/
-LIBS-y += drivers/power/ \
+libs-$(CONFIG_IXP4XX_NPE) += drivers/net/npe/
+libs-$(CONFIG_OF_EMBED) += dts/
+libs-y += arch/$(ARCH)/lib/
+libs-y += fs/
+libs-y += net/
+libs-y += disk/
+libs-y += drivers/
+libs-y += drivers/dma/
+libs-y += drivers/gpio/
+libs-y += drivers/i2c/
+libs-y += drivers/input/
+libs-y += drivers/mmc/
+libs-y += drivers/mtd/
+libs-$(CONFIG_CMD_NAND) += drivers/mtd/nand/
+libs-y += drivers/mtd/onenand/
+libs-$(CONFIG_CMD_UBI) += drivers/mtd/ubi/
+libs-y += drivers/mtd/spi/
+libs-y += drivers/net/
+libs-y += drivers/net/phy/
+libs-y += drivers/pci/
+libs-y += drivers/power/ \
drivers/power/fuel_gauge/ \
drivers/power/mfd/ \
drivers/power/pmic/ \
drivers/power/battery/
-LIBS-y += drivers/spi/
-LIBS-$(CONFIG_FMAN_ENET) += drivers/net/fm/
-LIBS-$(CONFIG_SYS_FSL_DDR) += drivers/ddr/fsl/
-LIBS-y += drivers/serial/
-LIBS-y += drivers/usb/eth/
-LIBS-y += drivers/usb/gadget/
-LIBS-y += drivers/usb/host/
-LIBS-y += drivers/usb/musb/
-LIBS-y += drivers/usb/musb-new/
-LIBS-y += drivers/usb/phy/
-LIBS-y += drivers/usb/ulpi/
-LIBS-y += common/
-LIBS-y += lib/libfdt/
-LIBS-$(CONFIG_API) += api/
-LIBS-$(CONFIG_HAS_POST) += post/
-LIBS-y += test/
+libs-y += drivers/spi/
+libs-$(CONFIG_FMAN_ENET) += drivers/net/fm/
+libs-$(CONFIG_SYS_FSL_DDR) += drivers/ddr/fsl/
+libs-y += drivers/serial/
+libs-y += drivers/usb/eth/
+libs-y += drivers/usb/gadget/
+libs-y += drivers/usb/host/
+libs-y += drivers/usb/musb/
+libs-y += drivers/usb/musb-new/
+libs-y += drivers/usb/phy/
+libs-y += drivers/usb/ulpi/
+libs-y += common/
+libs-y += lib/libfdt/
+libs-$(CONFIG_API) += api/
+libs-$(CONFIG_HAS_POST) += post/
+libs-y += test/
 
 ifneq (,$(filter $(SOC), mx25 mx27 mx5 mx6 mx31 mx35 mxs vf610))
-LIBS-y += arch/$(ARCH)/imx-common/
+libs-y += arch/$(ARCH)/imx-common/
 endif
 
-LIBS-$(CONFIG_ARM) += arch/arm/cpu/
-LIBS-$(CONFIG_PPC) += arch/powerpc/cpu/
+libs-$(CONFIG_ARM) += arch/arm/cpu/
+libs-$(CONFIG_PPC) += arch/powerpc/cpu/
+
+libs-y += board/$(BOARDDIR)/
+
+libs-y := $(sort $(libs-y))
 
-LIBS-y += board/$(BOARDDIR)/
+u-boot-dirs:= $(patsubst %/,%,$(filter %/, $(libs-y))) tools examples
+
+u-boot-alldirs := $(sort $(u-boot-dirs) $(patsubst %/,%,$(filter %/, 
$(libs-
+
+libs-y := $(patsubst %/, %/built-in.o, $(libs-y))
+
+u-boot-init := $(head-y)
+u-boot-main := $(libs-y)
 
-LIBS-y := $(patsubst %/, %/built-in.o, $(LIBS-y))
-LIBS := $(sort $(LIBS-y))
-.PHONY : $(LIBS)
 
 # Add GCC lib
 ifdef 

[U-Boot] [PATCH v5 26/38] kbuild: generate {spl, tpl}-autoconf.mk only when it is necessary

2014-01-17 Thread Masahiro Yamada
Before this commit, {spl,tpl}-autoconf.mk was always generated
at the top Makefile even if SPL(TPL) build was not selected.

This commit moves the build rule of {spl,tpl}-autoconf.mk
from the top Makefile to spl/Makefile.
It prevents unnecessary {spl,tpl}-autoconf.mk from being
generated.

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

Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None

 Makefile | 23 ---
 spl/Makefile | 16 
 2 files changed, 16 insertions(+), 23 deletions(-)

diff --git a/Makefile b/Makefile
index 0551e6e..9d684e9 100644
--- a/Makefile
+++ b/Makefile
@@ -889,9 +889,6 @@ tpl/u-boot-tpl.bin: $(SUBDIR_TOOLS) depend scripts_basic
 # Explicitly make _depend in subdirs containing multiple targets to prevent
 # parallel sub-makes creating .depend files simultaneously.
 depend dep:$(TIMESTAMP_FILE) $(VERSION_FILE) \
-   include/spl-autoconf.mk \
-   include/tpl-autoconf.mk \
-   include/autoconf.mk \
include/generated/generic-asm-offsets.h \
include/generated/asm-offsets.h
 
@@ -973,26 +970,6 @@ quiet_cmd_autoconf = GEN $@
 include/autoconf.mk: include/config.h
$(call cmd,autoconf)
 
-# Auto-generate the spl-autoconf.mk file (which is included by all makefiles 
for SPL)
-quiet_cmd_tpl-autoconf = GEN $@
-  cmd_tpl-autoconf = \
-   $(CPP) $(c_flags) -DCONFIG_TPL_BUILD  -DCONFIG_SPL_BUILD\
-   -DDO_DEPS_ONLY -dM $(srctree)/include/common.h  $@.tmp 
 \
-   sed -n -f $(srctree)/tools/scripts/define2mk.sed $@.tmp  $@; \
-   rm $@.tmp
-
-include/tpl-autoconf.mk: include/config.h
-   $(call cmd,tpl-autoconf)
-
-quiet_cmd_spl-autoconf = GEN $@
-  cmd_spl-autoconf = \
-   $(CPP) $(c_flags) -DCONFIG_SPL_BUILD -DDO_DEPS_ONLY -dM 
$(srctree)/include/common.h  $@.tmp  \
-   sed -n -f $(srctree)/tools/scripts/define2mk.sed $@.tmp  $@; \
-   rm $@.tmp
-
-include/spl-autoconf.mk: include/config.h
-   $(call cmd,spl-autoconf)
-
 quiet_cmd_offsets = GEN $@
   cmd_offsets = $(srctree)/tools/scripts/make-asm-offsets $ $@
 
diff --git a/spl/Makefile b/spl/Makefile
index a795cb6..07a12a9 100644
--- a/spl/Makefile
+++ b/spl/Makefile
@@ -50,6 +50,22 @@ include $(srctree)/scripts/Kbuild.include
 
 include $(TOPDIR)/config.mk
 
+# FIX ME
+c_flags := $(KBUILD_CFLAGS) $(KBUILD_CPPFLAGS) $(CPPFLAGS) $(UBOOTINCLUDE) 
$(NOSTDINC_FLAGS)
+
+# Auto-generate the spl-autoconf.mk file (which is included by all makefiles 
for SPL)
+quiet_cmd_autoconf = GEN $@
+  cmd_autoconf = \
+   $(CPP) $(c_flags) -DDO_DEPS_ONLY -dM $(srctree)/include/common.h  
$@.tmp  \
+   sed -n -f $(srctree)/tools/scripts/define2mk.sed $@.tmp  $@; \
+   rm $@.tmp
+
+include/tpl-autoconf.mk: include/config.h
+   $(call cmd,autoconf)
+
+include/spl-autoconf.mk: include/config.h
+   $(call cmd,autoconf)
+
 HAVE_VENDOR_COMMON_LIB = $(if $(wildcard 
$(SRCTREE)/board/$(VENDOR)/common/Makefile),y,n)
 
 ifdef  CONFIG_SPL_START_S_PATH
-- 
1.8.3.2

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


[U-Boot] [PATCH v5 32/38] Makefile: refactor tools-all targets

2014-01-17 Thread Masahiro Yamada
 - Move easylogo, gdb tagets to tools/Makefile
 - Delete gdbtools target (same as gdb)

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

Changes in v5:
 - Revive env target

Changes in v4: None
Changes in v3: None
Changes in v2: None

 Makefile   | 8 +++-
 tools/Makefile | 8 +++-
 2 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/Makefile b/Makefile
index 0b63a27..92a0a4b 100644
--- a/Makefile
+++ b/Makefile
@@ -1093,16 +1093,14 @@ $(TIMESTAMP_FILE):
@LC_ALL=C date +'#define U_BOOT_TIME %T'  $@.tmp
@cmp -s $@ $@.tmp  rm -f $@.tmp || mv -f $@.tmp $@
 
-easylogo env gdb:
+env: depend scripts_basic
$(Q)$(MAKE) $(build)=tools/$@
 
-gdbtools: gdb
-
 xmldocs pdfdocs psdocs htmldocs mandocs: tools/kernel-doc/docproc
$(Q)$(MAKE) U_BOOT_VERSION=$(U_BOOT_VERSION) $(build)=doc/DocBook $@
 
-tools-all: easylogo env gdb $(VERSION_FILE) $(TIMESTAMP_FILE)
-   $(Q)$(MAKE) $(build)=tools HOST_TOOLS_ALL=y
+tools-all: HOST_TOOLS_ALL=y
+tools-all: env tools ;
 
 .PHONY : CHANGELOG
 CHANGELOG:
diff --git a/tools/Makefile b/tools/Makefile
index 70a3fc2..783e643 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -24,6 +24,9 @@ CONFIG_NETCONSOLE = y
 CONFIG_SHA1_CHECK_UB_IMG = y
 endif
 
+subdir-$(HOST_TOOLS_ALL) += easylogo
+subdir-$(HOST_TOOLS_ALL) += gdb
+
 # Merge all the different vars for envcrc into one
 ENVCRC-$(CONFIG_ENV_IS_EMBEDDED) = y
 ENVCRC-$(CONFIG_ENV_IS_IN_DATAFLASH) = y
@@ -180,10 +183,13 @@ HOST_EXTRACFLAGS += -include 
$(SRCTREE)/include/libfdt_env.h \
 
 __build:   $(LOGO-y)
 
-subdir-y := kernel-doc
+subdir-y += kernel-doc
 
 $(LOGO_H): $(obj)/bmp_logo $(LOGO_BMP)
$(obj)/bmp_logo --gen-info $(LOGO_BMP)  $@
 
 $(LOGO_DATA_H):$(obj)/bmp_logo $(LOGO_BMP)
$(obj)/bmp_logo --gen-data $(LOGO_BMP)  $@
+
+# Let clean descend into subdirs
+subdir- += env
-- 
1.8.3.2

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


[U-Boot] [PATCH v5 08/38] Makefile: move some variable definitions to the top Makefile

2014-01-17 Thread Masahiro Yamada
This commit moves some variable definitions from config.mk
to the top Makefile:

  - HOSTCC, HOSTCFLAGS, HOSTLDFLAGS
  - AS, LD, CC, CPP, etc.
  - SHELL (renamed to CONFIG_SHELL)

I'd like to slim down config.mk file
because it is included from all recursive make.
It is redundant to re-define the variables
every time descending into sub directories.
We should rather define them at the top Makefile
and export them.

U-Boot makefiles has been used SHELL variable to store shell
chosen for the user, whereas Linux Kernel uses CONFIG_SHELL.

We should never use SHELL variable because it is
a special variable for GNU Make.
Changing SHELL may cause unpredictable side effects
whose root cause is usually difficult to find.
We should use a generic variable name CONFIG_SHELL.

We should not use the syntax as follows either:

rm -f $(obj)tools/env/{fw_printenv,fw_setenv}

This depends on bash although GNU Make generally
invokes sh to run the each rule.

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

O'REILLY GNU Make says like follows about SHELL variable:

By default, /bin/sh is used for the shell.
This shell is controlled by the make variable SHELL
but it is not inherited from the environment.
When make starts, it imports all the variables
from the user’s environment as make variables, except SHELL.
This is because the user’s choice of shell should not cause a
makefile (possibly included in some downloaded software package) to fail.
If a user really wants to change the default shell used by make,
he can set the SHELL variable explicitly in the makefile.

Please refer to the first page of the following PDF file:
http://oreilly.com/catalog/make3/book/ch05.pdf


Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2:
  - Do not use bash-dependent clean rules:
 For example,
 rm -f $(obj)tools/env/{fw_printenv,fw_setenv}
   should be converted to
 rm -f $(addprefix $(obj)tools/env/, fw_printenv fw_setenv)
  - Add more comments in commit log
  - Rebase on v2014.01-rc2 tag

 Makefile  | 94 ++-
 config.mk | 78 ++--
 2 files changed, 84 insertions(+), 88 deletions(-)

diff --git a/Makefile b/Makefile
index 37dfebb..ef820e6 100644
--- a/Makefile
+++ b/Makefile
@@ -161,6 +161,73 @@ ifeq ($(HOSTARCH),$(ARCH))
 CROSS_COMPILE ?=
 endif
 
+# SHELL used by kbuild
+CONFIG_SHELL := $(shell if [ -x $$BASH ]; then echo $$BASH; \
+ else if [ -x /bin/bash ]; then echo /bin/bash; \
+ else echo sh; fi ; fi)
+
+HOSTCC   = gcc
+HOSTCFLAGS   = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer
+
+ifeq ($(HOSTOS),cygwin)
+HOSTCFLAGS += -ansi
+endif
+
+# Mac OS X / Darwin's C preprocessor is Apple specific.  It
+# generates numerous errors and warnings.  We want to bypass it
+# and use GNU C's cpp. To do this we pass the -traditional-cpp
+# option to the compiler.  Note that the -traditional-cpp flag
+# DOES NOT have the same semantics as GNU C's flag, all it does
+# is invoke the GNU preprocessor in stock ANSI/ISO C fashion.
+#
+# Apple's linker is similar, thanks to the new 2 stage linking
+# multiple symbol definitions are treated as errors, hence the
+# -multiply_defined suppress option to turn off this error.
+#
+ifeq ($(HOSTOS),darwin)
+# get major and minor product version (e.g. '10' and '6' for Snow Leopard)
+DARWIN_MAJOR_VERSION   = $(shell sw_vers -productVersion | cut -f 1 -d '.')
+DARWIN_MINOR_VERSION   = $(shell sw_vers -productVersion | cut -f 2 -d '.')
+
+os_x_before= $(shell if [ $(DARWIN_MAJOR_VERSION) -le $(1) -a \
+   $(DARWIN_MINOR_VERSION) -le $(2) ] ; then echo $(3); else echo 
$(4); fi ;)
+
+# Snow Leopards build environment has no longer restrictions as described above
+HOSTCC   = $(call os_x_before, 10, 5, cc, gcc)
+HOSTCFLAGS  += $(call os_x_before, 10, 4, -traditional-cpp)
+HOSTLDFLAGS += $(call os_x_before, 10, 5, -multiply_defined suppress)
+endif
+
+# Make variables (CC, etc...)
+
+AS = $(CROSS_COMPILE)as
+# Always use GNU ld
+ifneq ($(shell $(CROSS_COMPILE)ld.bfd -v 2 /dev/null),)
+LD = $(CROSS_COMPILE)ld.bfd
+else
+LD = $(CROSS_COMPILE)ld
+endif
+CC = $(CROSS_COMPILE)gcc
+CPP= $(CC) -E
+AR = $(CROSS_COMPILE)ar
+NM = $(CROSS_COMPILE)nm
+LDR= $(CROSS_COMPILE)ldr
+STRIP  = $(CROSS_COMPILE)strip
+OBJCOPY= $(CROSS_COMPILE)objcopy
+OBJDUMP= $(CROSS_COMPILE)objdump
+AWK= awk
+RANLIB = $(CROSS_COMPILE)RANLIB
+DTC= dtc
+CHECK  = sparse
+
+CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \
+ -Wbitwise -Wno-return-void -D__CHECK_ENDIAN__ $(CF)
+
+export CONFIG_SHELL HOSTCC HOSTCFLAGS HOSTLDFLAGS CROSS_COMPILE AS LD CC
+export CPP AR NM LDR STRIP OBJCOPY OBJDUMP
+export MAKE AWK
+export DTC CHECK CHECKFLAGS
+
 # load 

[U-Boot] [PATCH v5 04/38] board: samsung: refactor host programs

2014-01-17 Thread Masahiro Yamada
Some Samsung boards have their own tools under board/samsung/board/tools/.
This commit refactor more makefiles with hostprogs-y.

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

Note1:
Samsung boards have tools under board/samsung/board/tools/
and have tools/mkexynosspl.c too.
It is inconsistent, so we should choose the appropriate
directory in which Samsung-specific tools are stored.

Note2:

I marded TODO item in board/samsung/origen/Makefile.

Samsung engineers, I hope you will fix the root cause of the warning.

 # omit -O2 option to suppress
 #   warning: dereferencing type-punned pointer will break strict-aliasing rules
 #
 # TODO:
 # Fix the root cause in tools/mkorigenspl.c and delete the following 
work-around
 $(obj)/tools/mkorigenspl: HOSTCFLAGS:=$(filter-out -O2,$(HOSTCFLAGS))


Changes in v5:
  - Rebase on the current u-boot/master

Changes in v4: None
Changes in v3: None
Changes in v2: None

 Makefile |  1 +
 board/samsung/origen/Makefile| 20 ++--
 .../origen/tools/{mkv310_image.c = mkorigenspl.c}   |  0
 board/samsung/smdkv310/Makefile  | 15 ---
 .../tools/{mkv310_image.c = mksmdkv310spl.c}|  0
 spl/Makefile |  4 ++--
 6 files changed, 17 insertions(+), 23 deletions(-)
 rename board/samsung/origen/tools/{mkv310_image.c = mkorigenspl.c} (100%)
 rename board/samsung/smdkv310/tools/{mkv310_image.c = mksmdkv310spl.c} (100%)

diff --git a/Makefile b/Makefile
index 31ad4dc..beb58a1 100644
--- a/Makefile
+++ b/Makefile
@@ -809,6 +809,7 @@ clean:
   $(obj)tools/proftool
@rm -f $(obj)board/cray/L1/{bootscript.c,bootscript.image}\
   $(obj)board/matrix_vision/*/bootscript.img \
+  $(obj)spl/board/samsung/$(BOARD)/tools/mk$(BOARD)spl   \
   $(obj)u-boot.lds   \
   $(obj)arch/blackfin/cpu/init.{lds,elf}
@rm -f $(obj)include/bmp_logo.h
diff --git a/board/samsung/origen/Makefile b/board/samsung/origen/Makefile
index e8818bf..31e88f4 100644
--- a/board/samsung/origen/Makefile
+++ b/board/samsung/origen/Makefile
@@ -4,16 +4,16 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-ifndef CONFIG_SPL_BUILD
-obj-y  += origen.o
-endif
-
 ifdef CONFIG_SPL_BUILD
-all: $(OBJTREE)/tools/mk$(BOARD)spl
-endif
+hostprogs-y := tools/mkorigenspl
+always := $(hostprogs-y)
 
-# Fix ME after we implement hostprogs-y.
-ifdef CONFIG_SPL_BUILD
-$(OBJTREE)/tools/mk$(BOARD)spl:tools/mkv310_image.c
-   $(HOSTCC) tools/mkv310_image.c -o $(OBJTREE)/tools/mk$(BOARD)spl
+# omit -O2 option to suppress
+#   warning: dereferencing type-punned pointer will break strict-aliasing rules
+#
+# TODO:
+# Fix the root cause in tools/mkorigenspl.c and delete the following 
work-around
+$(obj)tools/mkorigenspl: HOSTCFLAGS:=$(filter-out -O2,$(HOSTCFLAGS))
+else
+obj-y  += origen.o
 endif
diff --git a/board/samsung/origen/tools/mkv310_image.c 
b/board/samsung/origen/tools/mkorigenspl.c
similarity index 100%
rename from board/samsung/origen/tools/mkv310_image.c
rename to board/samsung/origen/tools/mkorigenspl.c
diff --git a/board/samsung/smdkv310/Makefile b/board/samsung/smdkv310/Makefile
index dbc621b..9e37b4e 100644
--- a/board/samsung/smdkv310/Makefile
+++ b/board/samsung/smdkv310/Makefile
@@ -4,16 +4,9 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-ifndef CONFIG_SPL_BUILD
-obj-y  += smdkv310.o
-endif
-
 ifdef CONFIG_SPL_BUILD
-all: $(OBJTREE)/tools/mk$(BOARD)spl
-endif
-
-# Fix ME after we implement hostprogs-y.
-ifdef CONFIG_SPL_BUILD
-$(OBJTREE)/tools/mk$(BOARD)spl:tools/mkv310_image.c
-   $(HOSTCC) tools/mkv310_image.c -o $(OBJTREE)/tools/mk$(BOARD)spl
+hostprogs-y := tools/mksmdkv310spl
+always := $(hostprogs-y)
+else
+obj-y  += smdkv310.o
 endif
diff --git a/board/samsung/smdkv310/tools/mkv310_image.c 
b/board/samsung/smdkv310/tools/mksmdkv310spl.c
similarity index 100%
rename from board/samsung/smdkv310/tools/mkv310_image.c
rename to board/samsung/smdkv310/tools/mksmdkv310spl.c
diff --git a/spl/Makefile b/spl/Makefile
index 1ce0577..bd31d40 100644
--- a/spl/Makefile
+++ b/spl/Makefile
@@ -161,8 +161,8 @@ else
 VAR_SIZE_PARAM =
 endif
 $(obj)$(BOARD)-spl.bin: $(obj)u-boot-spl.bin
-   $(if $(wildcard $(OBJTREE)/tools/mk$(BOARD)spl),\
-   $(OBJTREE)/tools/mk$(BOARD)spl,\
+   $(if $(wildcard 
$(OBJTREE)/spl/board/samsung/$(BOARD)/tools/mk$(BOARD)spl),\
+   $(OBJTREE)/spl/board/samsung/$(BOARD)/tools/mk$(BOARD)spl,\
$(OBJTREE)/tools/mkexynosspl) $(VAR_SIZE_PARAM) $ $@
 endif
 
-- 
1.8.3.2

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


[U-Boot] [PATCH v5 25/38] kbuild: move include directives of board configuration files

2014-01-17 Thread Masahiro Yamada
This commit changes the location of include directives
of board configuration files.

The purpose of this change is:
 - Slim down $(TOPDIR)/config.mk
 - Prevent $(TOPDIR)/Makefile from including the same
configuration file twice
 - Do not include include/config.mk multiple times
because ARCH, CPU, BOARD, VENDOR, SOC are exported

Before this commit:

 - include/autoconf.mk was included from $(TOPDIR)/Makefile
   and $(TOPDIR)/config.mk
   (This means $(TOPDIR)/Makefile included include/autoconf.mk twice)

 - include/{spl,tpl}-autoconf.mk was included from $(TOPDIR)/config.mk

 - include/config.mk was included from $(TOPDIR)/Makefile
   and $(TOPDIR)/config.mk
   (This means $(TOPDIR)/Makefile included include/config.mk twice)

After this commit:

 - include/autoconf.mk is included from $(TOPDIR)/Makefile
   and $(TOPDIR)/scripts/Makefile.build

 - include/{spl,tpl}-autoconf.mk is included from $(TOPDIR)/spl/Makefile
   and $(TOPDIR)/scripts/Makefile.build

 - include/config.mk is included from $(TOPDIR)/config.mk and
   $(TOPDIR)/spl/Makefile

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

Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None

 config.mk  | 15 ---
 scripts/Makefile.build | 11 +++
 spl/Makefile   |  8 
 3 files changed, 19 insertions(+), 15 deletions(-)

diff --git a/config.mk b/config.mk
index 1336ef8..5b886aa 100644
--- a/config.mk
+++ b/config.mk
@@ -13,21 +13,6 @@ PLATFORM_LDFLAGS =
 
 #
 
-# Load generated board configuration
-ifeq ($(CONFIG_TPL_BUILD),y)
-# Include TPL autoconf
-sinclude include/tpl-autoconf.mk
-else
-ifeq ($(CONFIG_SPL_BUILD),y)
-# Include SPL autoconf
-sinclude include/spl-autoconf.mk
-else
-# Include normal autoconf
-sinclude include/autoconf.mk
-endif
-endif
-sinclude $(OBJTREE)/include/config.mk
-
 # Some architecture config.mk files need to know what CPUDIR is set to,
 # so calculate CPUDIR before including ARCH/SOC/CPU config.mk files.
 # Check if arch/$ARCH/cpu/$CPU exists, otherwise assume arch/$ARCH/cpu contains
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index 921fbbf..f37957f 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -42,6 +42,17 @@ subdir-ccflags-y :=
 # Read auto.conf if it exists, otherwise ignore
 -include include/config/auto.conf
 
+# Added for U-Boot: Load U-Boot configuration
+ifeq ($(CONFIG_TPL_BUILD),y)
+  -include include/tpl-autoconf.mk
+else
+  ifeq ($(CONFIG_SPL_BUILD),y)
+-include include/spl-autoconf.mk
+  else
+-include include/autoconf.mk
+  endif
+endif
+
 include scripts/Kbuild.include
 # Modified for U-Boot
 #  We must include config.mk after Kbuild.include:
diff --git a/spl/Makefile b/spl/Makefile
index 659060e..a795cb6 100644
--- a/spl/Makefile
+++ b/spl/Makefile
@@ -38,6 +38,14 @@ else
 SPL_BIN := u-boot-spl
 endif
 
+include include/config.mk
+
+ifeq ($(CONFIG_TPL_BUILD),y)
+  -include include/tpl-autoconf.mk
+else
+  -include include/spl-autoconf.mk
+endif
+
 include $(srctree)/scripts/Kbuild.include
 
 include $(TOPDIR)/config.mk
-- 
1.8.3.2

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


[U-Boot] [PATCH v5 09/38] Makefile: move BFD_ROOT_DIR to tools/gdb/Makefile

2014-01-17 Thread Masahiro Yamada
BFD_ROOT_DIR is used only in tools/gdb/Makefile

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

Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None

 config.mk  | 23 ---
 tools/gdb/Makefile | 21 +
 2 files changed, 21 insertions(+), 23 deletions(-)

diff --git a/config.mk b/config.mk
index 74617d3..dfe81fa 100644
--- a/config.mk
+++ b/config.mk
@@ -220,29 +220,6 @@ ifneq ($(CONFIG_SPL_TEXT_BASE),)
 LDFLAGS_$(SPL_BIN) += -Ttext $(CONFIG_SPL_TEXT_BASE)
 endif
 
-# Location of a usable BFD library, where we define usable as
-# built for ${HOST}, supports ${TARGET}.  Sensible values are
-# - When cross-compiling: the root of the cross-environment
-# - Linux/ppc (native): /usr
-# - NetBSD/ppc (native): you lose ... (must extract these from the
-#   binutils build directory, plus the native and U-Boot include
-#   files don't like each other)
-#
-# So far, this is used only by tools/gdb/Makefile.
-
-ifeq ($(HOSTOS),darwin)
-BFD_ROOT_DIR = /usr/local/tools
-else
-ifeq ($(HOSTARCH),$(ARCH))
-# native
-BFD_ROOT_DIR = /usr
-else
-#BFD_ROOT_DIR =/LinuxPPC/CDK   # Linux/i386
-#BFD_ROOT_DIR =/usr/pkg/cross  # NetBSD/i386
-BFD_ROOT_DIR = /opt/powerpc
-endif
-endif
-
 #
 
 export CONFIG_SYS_TEXT_BASE PLATFORM_CPPFLAGS PLATFORM_RELFLAGS CPPFLAGS 
CFLAGS AFLAGS
diff --git a/tools/gdb/Makefile b/tools/gdb/Makefile
index 850bb9b..4513320 100644
--- a/tools/gdb/Makefile
+++ b/tools/gdb/Makefile
@@ -10,6 +10,27 @@
 
 ifneq ($(HOSTOS),cygwin)
 
+# Location of a usable BFD library, where we define usable as
+# built for ${HOST}, supports ${TARGET}.  Sensible values are
+# - When cross-compiling: the root of the cross-environment
+# - Linux/ppc (native): /usr
+# - NetBSD/ppc (native): you lose ... (must extract these from the
+#   binutils build directory, plus the native and U-Boot include
+#   files don't like each other)
+
+ifeq ($(HOSTOS),darwin)
+BFD_ROOT_DIR = /usr/local/tools
+else
+ifeq ($(HOSTARCH),$(ARCH))
+# native
+BFD_ROOT_DIR = /usr
+else
+#BFD_ROOT_DIR =/LinuxPPC/CDK   # Linux/i386
+#BFD_ROOT_DIR =/usr/pkg/cross  # NetBSD/i386
+BFD_ROOT_DIR = /opt/powerpc
+endif
+endif
+
 #
 # Use native tools and options
 #
-- 
1.8.3.2

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


[U-Boot] [PATCH v5 11/38] kbuild: Use Kbuild.include

2014-01-17 Thread Masahiro Yamada
This commit adjusts some files to use Kbuild.include.

 - Use cc-option defined in Kbuild.include
(Delete cc-option in config.mk)
 - Use cc-version defined in
(Delete cc-version in config.mk)
 - Move binutils-version and dtc-version to Kbuild.include
 by analogy to cc-version

This commit also adds srctree (same as SRCTREE)
to use Kbuild scripts.

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

Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None

 Makefile   |  9 ++---
 config.mk  | 29 -
 scripts/Kbuild.include |  8 +++-
 scripts/Makefile.build |  1 +
 spl/Makefile   |  4 ++--
 5 files changed, 16 insertions(+), 35 deletions(-)

diff --git a/Makefile b/Makefile
index ef820e6..57718f7 100644
--- a/Makefile
+++ b/Makefile
@@ -102,9 +102,10 @@ OBJTREE:= $(if 
$(BUILD_DIR),$(BUILD_DIR),$(CURDIR))
 SPLTREE:= $(OBJTREE)/spl
 TPLTREE:= $(OBJTREE)/tpl
 SRCTREE:= $(CURDIR)
+srctree:= $(SRCTREE)
 TOPDIR := $(SRCTREE)
 LNDIR  := $(OBJTREE)
-export TOPDIR SRCTREE OBJTREE SPLTREE TPLTREE
+export TOPDIR SRCTREE srctree OBJTREE SPLTREE TPLTREE
 
 MKCONFIG   := $(SRCTREE)/mkconfig
 export MKCONFIG
@@ -126,8 +127,6 @@ unexport CDPATH
 
 #
 
-build := -f $(TOPDIR)/scripts/Makefile.build -C
-
 # The tools are needed early, so put this first
 # Don't include stuff already done in $(LIBS)
 # The examples conditionally depend on U-Boot (say, when USE_PRIVATE_LIBGCC
@@ -198,6 +197,10 @@ HOSTCFLAGS  += $(call os_x_before, 10, 4, 
-traditional-cpp)
 HOSTLDFLAGS += $(call os_x_before, 10, 5, -multiply_defined suppress)
 endif
 
+# We need some generic definitions (do not try to remake the file).
+$(srctree)/scripts/Kbuild.include: ;
+include $(srctree)/scripts/Kbuild.include
+
 # Make variables (CC, etc...)
 
 AS = $(CROSS_COMPILE)as
diff --git a/config.mk b/config.mk
index dfe81fa..ba42641 100644
--- a/config.mk
+++ b/config.mk
@@ -48,35 +48,6 @@ PLATFORM_CPPFLAGS =
 PLATFORM_LDFLAGS =
 
 #
-#
-# Option checker, gcc version (courtesy linux kernel) to ensure
-# only supported compiler options are used
-#
-CC_OPTIONS_CACHE_FILE := $(OBJTREE)/include/generated/cc_options.mk
-CC_TEST_OFILE := $(OBJTREE)/include/generated/cc_test_file.o
-
--include $(CC_OPTIONS_CACHE_FILE)
-
-cc-option-sys = $(shell mkdir -p $(dir $(CC_TEST_OFILE)); \
-   if $(CC) $(CFLAGS) $(1) -S -xc /dev/null -o $(CC_TEST_OFILE) \
-/dev/null 21; then \
-   echo 'CC_OPTIONS += $(strip $1)'  $(CC_OPTIONS_CACHE_FILE); \
-   echo $(1); fi)
-
-ifeq ($(CONFIG_CC_OPT_CACHE_DISABLE),y)
-cc-option = $(strip $(if $(call cc-option-sys,$1),$1,$2))
-else
-cc-option = $(strip $(if $(findstring $1,$(CC_OPTIONS)),$1,\
-   $(if $(call cc-option-sys,$1),$1,$2)))
-endif
-
-# cc-version
-# Usage gcc-ver := $(call cc-version)
-cc-version = $(shell $(CONFIG_SHELL) $(SRCTREE)/scripts/gcc-version.sh $(CC))
-binutils-version = $(shell $(CONFIG_SHELL) 
$(SRCTREE)/scripts/binutils-version.sh $(AS))
-dtc-version = $(shell $(CONFIG_SHELL) $(SRCTREE)/scripts/dtc-version.sh $(DTC))
-
-#
 
 # Load generated board configuration
 ifeq ($(CONFIG_TPL_BUILD),y)
diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include
index 547e15d..ca5fd56 100644
--- a/scripts/Kbuild.include
+++ b/scripts/Kbuild.include
@@ -140,6 +140,10 @@ cc-fullversion = $(shell $(CONFIG_SHELL) \
 # Usage:  EXTRA_CFLAGS += $(call cc-ifversion, -lt, 0402, -O1)
 cc-ifversion = $(shell [ $(call cc-version, $(CC)) $(1) $(2) ]  echo $(3))
 
+# added for U-Boot
+binutils-version = $(shell $(CONFIG_SHELL) 
$(srctree)/scripts/binutils-version.sh $(AS))
+dtc-version = $(shell $(CONFIG_SHELL) $(srctree)/scripts/dtc-version.sh $(DTC))
+
 # cc-ldoption
 # Usage: ldflags += $(call cc-ldoption, -Wl$(comma)--hash-style=both)
 cc-ldoption = $(call try-run,\
@@ -161,7 +165,9 @@ ar-option = $(call try-run, $(AR) rc$(1) $$TMP,$(1),$(2))
 # Shorthand for $(Q)$(MAKE) -f scripts/Makefile.build obj=
 # Usage:
 # $(Q)$(MAKE) $(build)=dir
-build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj
+#build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj
+# temporary
+build := -f $(srctree)/scripts/Makefile.build -C
 
 ###
 # Shorthand for $(Q)$(MAKE) -f scripts/Makefile.modbuiltin obj=
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index 1b3d77f..7789efa 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -2,6 +2,7 @@
 .PHONY: all
 all:
 
+include $(srctree)/scripts/Kbuild.include
 include $(TOPDIR)/config.mk
 
 # variable LIB is used in examples/standalone/Makefile
diff --git a/spl/Makefile 

[U-Boot] [PATCH v5 14/38] Makefile: move more stuff to top Makefile

2014-01-17 Thread Masahiro Yamada
Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---

Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None

 Makefile  | 20 +---
 config.mk | 19 +--
 2 files changed, 18 insertions(+), 21 deletions(-)

diff --git a/Makefile b/Makefile
index d7c71f0..3945040 100644
--- a/Makefile
+++ b/Makefile
@@ -281,13 +281,27 @@ endif
 # load other configuration
 include $(TOPDIR)/config.mk
 
+ifneq ($(CONFIG_SYS_TEXT_BASE),)
+KBUILD_CPPFLAGS += -DCONFIG_SYS_TEXT_BASE=$(CONFIG_SYS_TEXT_BASE)
+endif
+
+export CONFIG_SYS_TEXT_BASE
+
+LDFLAGS_u-boot += -T $(obj)u-boot.lds $(LDFLAGS_FINAL)
+ifneq ($(CONFIG_SYS_TEXT_BASE),)
+LDFLAGS_u-boot += -Ttext $(CONFIG_SYS_TEXT_BASE)
+endif
+
 # Targets which don't build the source code
-NON_BUILD_TARGETS = backup clean clobber distclean mrproper tidy unconfig
+NON_BUILD_TARGETS = backup clean clobber distclean mrproper tidy unconfig 
%_config
 
 # Only do the generic board check when actually building, not configuring
 ifeq ($(filter $(NON_BUILD_TARGETS),$(MAKECMDGOALS)),)
-ifeq ($(findstring _config,$(MAKECMDGOALS)),)
-$(CHECK_GENERIC_BOARD)
+ifeq ($(__HAVE_ARCH_GENERIC_BOARD),)
+ifneq ($(CONFIG_SYS_GENERIC_BOARD),)
+CHECK_GENERIC_BOARD = $(error Your architecture does not support generic 
board. \
+Please undefined CONFIG_SYS_GENERIC_BOARD in your board config file)
+endif
 endif
 endif
 
diff --git a/config.mk b/config.mk
index f700ee1..54d1d8b 100644
--- a/config.mk
+++ b/config.mk
@@ -102,10 +102,6 @@ CPPFLAGS += -ffunction-sections -fdata-sections
 LDFLAGS_FINAL += --gc-sections
 endif
 
-ifneq ($(CONFIG_SYS_TEXT_BASE),)
-CPPFLAGS += -DCONFIG_SYS_TEXT_BASE=$(CONFIG_SYS_TEXT_BASE)
-endif
-
 ifeq ($(CONFIG_SPL_BUILD),y)
 CPPFLAGS += -DCONFIG_SPL_BUILD
 ifeq ($(CONFIG_TPL_BUILD),y)
@@ -113,14 +109,6 @@ CPPFLAGS += -DCONFIG_TPL_BUILD
 endif
 endif
 
-# Does this architecture support generic board init?
-ifeq ($(__HAVE_ARCH_GENERIC_BOARD),)
-ifneq ($(CONFIG_SYS_GENERIC_BOARD),)
-CHECK_GENERIC_BOARD = $(error Your architecture does not support generic 
board. \
-Please undefined CONFIG_SYS_GENERIC_BOARD in your board config file)
-endif
-endif
-
 CPPFLAGS += $(UBOOTINCLUDE)
 CPPFLAGS += $(NOSTDINC_FLAGS) -pipe $(PLATFORM_CPPFLAGS)
 
@@ -141,11 +129,6 @@ AFLAGS := $(KBUILD_AFLAGS) $(CPPFLAGS)
 LDFLAGS += $(PLATFORM_LDFLAGS)
 LDFLAGS_FINAL += -Bstatic
 
-LDFLAGS_u-boot += -T $(obj)u-boot.lds $(LDFLAGS_FINAL)
-ifneq ($(CONFIG_SYS_TEXT_BASE),)
-LDFLAGS_u-boot += -Ttext $(CONFIG_SYS_TEXT_BASE)
-endif
-
 LDFLAGS_$(SPL_BIN) += -T $(obj)u-boot-spl.lds $(LDFLAGS_FINAL)
 ifneq ($(CONFIG_SPL_TEXT_BASE),)
 LDFLAGS_$(SPL_BIN) += -Ttext $(CONFIG_SPL_TEXT_BASE)
@@ -153,4 +136,4 @@ endif
 
 #
 
-export CONFIG_SYS_TEXT_BASE PLATFORM_CPPFLAGS PLATFORM_RELFLAGS CPPFLAGS 
CFLAGS AFLAGS
+export PLATFORM_CPPFLAGS PLATFORM_RELFLAGS CPPFLAGS CFLAGS AFLAGS
-- 
1.8.3.2

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


[U-Boot] [PATCH v5 19/38] Makefile: rename scripts/Makefile.build to scripts/Makefile.build.tmp

2014-01-17 Thread Masahiro Yamada
Some build scripts including scripts/Makefile.build
will be imported from Linux Kernel in the next commit.
We need to adjust them for U-Boot in the following commits.

To make it easier for reviewers to track the modification,
this commit renames scripts/Makefile.build to
scripts/Makefile.build.tmp beforehand.

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

Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None

 scripts/Kbuild.include | 2 +-
 scripts/{Makefile.build = Makefile.build.tmp} | 0
 2 files changed, 1 insertion(+), 1 deletion(-)
 rename scripts/{Makefile.build = Makefile.build.tmp} (100%)

diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include
index 6113c13..30a5551 100644
--- a/scripts/Kbuild.include
+++ b/scripts/Kbuild.include
@@ -165,7 +165,7 @@ ar-option = $(call try-run, $(AR) rc$(1) $$TMP,$(1),$(2))
 # Shorthand for $(Q)$(MAKE) -f scripts/Makefile.build obj=
 # Usage:
 # $(Q)$(MAKE) $(build)=dir
-build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj
+build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build.tmp obj
 
 ###
 # Shorthand for $(Q)$(MAKE) -f scripts/Makefile.modbuiltin obj=
diff --git a/scripts/Makefile.build b/scripts/Makefile.build.tmp
similarity index 100%
rename from scripts/Makefile.build
rename to scripts/Makefile.build.tmp
-- 
1.8.3.2

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


[U-Boot] [PATCH v5 20/38] kbuild: import more build scripts from Linux v3.12 tag

2014-01-17 Thread Masahiro Yamada
This commit imports build scripts from Linux Kernel v3.12
as they are.

I know they include some trailing spaces
but I keep intentionally them untouched.

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

Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None

 scripts/Makefile.build   | 479 +++
 scripts/Makefile.clean   | 104 ++
 scripts/Makefile.host| 170 +
 scripts/Makefile.lib | 373 
 scripts/basic/.gitignore |   1 +
 scripts/basic/Makefile   |  15 ++
 scripts/basic/fixdep.c   | 462 +
 scripts/mkmakefile   |  59 ++
 8 files changed, 1663 insertions(+)
 create mode 100644 scripts/Makefile.build
 create mode 100644 scripts/Makefile.clean
 create mode 100644 scripts/Makefile.host
 create mode 100644 scripts/Makefile.lib
 create mode 100644 scripts/basic/.gitignore
 create mode 100644 scripts/basic/Makefile
 create mode 100644 scripts/basic/fixdep.c
 create mode 100644 scripts/mkmakefile

diff --git a/scripts/Makefile.build b/scripts/Makefile.build
new file mode 100644
index 000..d5d859c
--- /dev/null
+++ b/scripts/Makefile.build
@@ -0,0 +1,479 @@
+# ==
+# Building
+# ==
+
+src := $(obj)
+
+PHONY := __build
+__build:
+
+# Init all relevant variables used in kbuild files so
+# 1) they have correct type
+# 2) they do not inherit any value from the environment
+obj-y :=
+obj-m :=
+lib-y :=
+lib-m :=
+always :=
+targets :=
+subdir-y :=
+subdir-m :=
+EXTRA_AFLAGS   :=
+EXTRA_CFLAGS   :=
+EXTRA_CPPFLAGS :=
+EXTRA_LDFLAGS  :=
+asflags-y  :=
+ccflags-y  :=
+cppflags-y :=
+ldflags-y  :=
+
+subdir-asflags-y :=
+subdir-ccflags-y :=
+
+# Read auto.conf if it exists, otherwise ignore
+-include include/config/auto.conf
+
+include scripts/Kbuild.include
+
+# For backward compatibility check that these variables do not change
+save-cflags := $(CFLAGS)
+
+# The filename Kbuild has precedence over Makefile
+kbuild-dir := $(if $(filter /%,$(src)),$(src),$(srctree)/$(src))
+kbuild-file := $(if $(wildcard 
$(kbuild-dir)/Kbuild),$(kbuild-dir)/Kbuild,$(kbuild-dir)/Makefile)
+include $(kbuild-file)
+
+# If the save-* variables changed error out
+ifeq ($(KBUILD_NOPEDANTIC),)
+ifneq ($(save-cflags),$(CFLAGS))
+$(error CFLAGS was changed in $(kbuild-file). Fix it to use 
ccflags-y)
+endif
+endif
+
+#
+# make W=... settings
+#
+# W=1 - warnings that may be relevant and does not occur too often
+# W=2 - warnings that occur quite often but may still be relevant
+# W=3 - the more obscure warnings, can most likely be ignored
+#
+# $(call cc-option, -W...) handles gcc -W.. options which
+# are not supported by all versions of the compiler
+ifdef KBUILD_ENABLE_EXTRA_GCC_CHECKS
+warning-  := $(empty)
+
+warning-1 := -Wextra -Wunused -Wno-unused-parameter
+warning-1 += -Wmissing-declarations
+warning-1 += -Wmissing-format-attribute
+warning-1 += -Wmissing-prototypes
+warning-1 += -Wold-style-definition
+warning-1 += $(call cc-option, -Wmissing-include-dirs)
+warning-1 += $(call cc-option, -Wunused-but-set-variable)
+warning-1 += $(call cc-disable-warning, missing-field-initializers)
+
+warning-2 := -Waggregate-return
+warning-2 += -Wcast-align
+warning-2 += -Wdisabled-optimization
+warning-2 += -Wnested-externs
+warning-2 += -Wshadow
+warning-2 += $(call cc-option, -Wlogical-op)
+warning-2 += $(call cc-option, -Wmissing-field-initializers)
+
+warning-3 := -Wbad-function-cast
+warning-3 += -Wcast-qual
+warning-3 += -Wconversion
+warning-3 += -Wpacked
+warning-3 += -Wpadded
+warning-3 += -Wpointer-arith
+warning-3 += -Wredundant-decls
+warning-3 += -Wswitch-default
+warning-3 += $(call cc-option, -Wpacked-bitfield-compat)
+warning-3 += $(call cc-option, -Wvla)
+
+warning := $(warning-$(findstring 1, $(KBUILD_ENABLE_EXTRA_GCC_CHECKS)))
+warning += $(warning-$(findstring 2, $(KBUILD_ENABLE_EXTRA_GCC_CHECKS)))
+warning += $(warning-$(findstring 3, $(KBUILD_ENABLE_EXTRA_GCC_CHECKS)))
+
+ifeq ($(strip $(warning)),)
+$(error W=$(KBUILD_ENABLE_EXTRA_GCC_CHECKS) is unknown)
+endif
+
+KBUILD_CFLAGS += $(warning)
+endif
+
+include scripts/Makefile.lib
+
+ifdef host-progs
+ifneq ($(hostprogs-y),$(host-progs))
+$(warning kbuild: $(obj)/Makefile - Usage of host-progs is deprecated. Please 
replace with hostprogs-y!)
+hostprogs-y += $(host-progs)
+endif
+endif
+
+# Do not include host rules unless needed
+ifneq ($(hostprogs-y)$(hostprogs-m),)
+include scripts/Makefile.host
+endif
+
+ifneq ($(KBUILD_SRC),)
+# Create output directory if not already present
+_dummy := $(shell [ -d $(obj) ] || mkdir -p $(obj))
+
+# Create directories for object files if directory does not exist
+# Needed when obj-y := dir/file.o syntax is used
+_dummy := $(foreach d,$(obj-dirs), $(shell [ -d 

[U-Boot] [PATCH v5 34/38] kbuild: support simultaneous board configuration and make all

2014-01-17 Thread Masahiro Yamada
This commit fixes two problems:

[1] We could not do board configuration and make all
in one command line.

For example, the following did not work as we expect:
  $ make sandbox_config all
  Configuring for sandbox board...
  make: Nothing to be done for `all'.

[2] mixed-target build did not work with -j option

For example, the following did not work:
  $ make -j8 sandbox_config u-boot
  Makefile:481: *** System not configured - see README.  Stop.
  make: *** [u-boot] Error 2
  make: *** Waiting for unfinished jobs
  Configuring for sandbox board...

Going forward, we can do
  $ make -j8 sandbox_config all

This is the same as
  $ make sandbox_config
  $ make -j8

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

Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None

 Makefile | 12 ++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 04368cf..d5ca04e 100644
--- a/Makefile
+++ b/Makefile
@@ -427,8 +427,16 @@ ifeq ($(mixed-targets),1)
 # We're called with mixed targets (*config and build targets).
 # Handle them one by one.
 
-%:: FORCE
-   $(Q)$(MAKE) -C $(srctree) KBUILD_SRC= $@
+PHONY += $(MAKECMDGOALS) build-one-by-one
+
+$(MAKECMDGOALS): build-one-by-one
+   @:
+
+build-one-by-one:
+   $(Q)set -e; \
+   for i in $(MAKECMDGOALS); do \
+   $(MAKE) -f $(srctree)/Makefile $$i; \
+   done
 
 else
 ifeq ($(config-targets),1)
-- 
1.8.3.2

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


[U-Boot] [PATCH v5 31/38] Makefile: Do not pass MTD_VERSION from the top Makefile

2014-01-17 Thread Masahiro Yamada
$(MTD_VERSION) is used in tools/env/Makefile

If you specify a variable at a command line like:
  $ make MTD_VERSION=old env
or specify it thru an envrionment variable like:
  $ export MTD_VERSION=old
  $ make env
it is inherited to the sub-make too.
We do not need to pass it from the top Makefile explicitely.

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

Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None

 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index f520fa2..0b63a27 100644
--- a/Makefile
+++ b/Makefile
@@ -1094,7 +1094,7 @@ $(TIMESTAMP_FILE):
@cmp -s $@ $@.tmp  rm -f $@.tmp || mv -f $@.tmp $@
 
 easylogo env gdb:
-   $(Q)$(MAKE) $(build)=tools/$@ MTD_VERSION=${MTD_VERSION}
+   $(Q)$(MAKE) $(build)=tools/$@
 
 gdbtools: gdb
 
-- 
1.8.3.2

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


[U-Boot] [PATCH v5 36/38] board: sandburst: delete FORCEBUILD

2014-01-17 Thread Masahiro Yamada
We had switched to Kbuild, so we do not need to
delete sandburst board files at every build.

U-Boot conventional build system did not check the
update of command line option, -DBUILDUSER.

Kbuild can handle it nicely and re-builds object files
when command line options are changed.
(The file .*.cmd stores the information how the file
was generated at the previous build.)

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

Changes in v5: None
Changes in v4: None
Changes in v3:
  - Newly added

Changes in v2: None

 board/sandburst/karef/Makefile| 6 +-
 board/sandburst/metrobox/Makefile | 6 +-
 2 files changed, 2 insertions(+), 10 deletions(-)

diff --git a/board/sandburst/karef/Makefile b/board/sandburst/karef/Makefile
index d5a9b34..ce29b41 100644
--- a/board/sandburst/karef/Makefile
+++ b/board/sandburst/karef/Makefile
@@ -10,11 +10,7 @@
 #
 
 # TBS: add for debugging purposes
-BUILDUSER := $(shell whoami)
-FORCEBUILD := $(shell rm -f karef.o)
-
-ccflags-y += -DBUILDUSER='$(BUILDUSER)'
-# TBS: end debugging
+ccflags-y += -DBUILDUSER='$(shell whoami)'
 
 obj-y  = karef.o ../common/flash.o ../common/sb_common.o
 extra-y+= init.o
diff --git a/board/sandburst/metrobox/Makefile 
b/board/sandburst/metrobox/Makefile
index 8121cce..2c1028b 100644
--- a/board/sandburst/metrobox/Makefile
+++ b/board/sandburst/metrobox/Makefile
@@ -9,11 +9,7 @@
 #
 
 # TBS: add for debugging purposes
-BUILDUSER := $(shell whoami)
-FORCEBUILD := $(shell rm -f metrobox.o)
-
-ccflags-y += -DBUILDUSER='$(BUILDUSER)'
-# TBS: end debugging
+ccflags-y += -DBUILDUSER='$(shell whoami)'
 
 obj-y  = metrobox.o ../common/flash.o ../common/sb_common.o
 extra-y+= init.o
-- 
1.8.3.2

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


[U-Boot] [PATCH v5 22/38] kbuild: delete temporary build scripts

2014-01-17 Thread Masahiro Yamada
We had switched to Kbuild.
We do not need old build scripts any more.

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

Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None

 rules.mk   |  47 -
 scripts/Makefile.build.tmp | 127 -
 scripts/Makefile.host.tmp  |  61 --
 3 files changed, 235 deletions(-)
 delete mode 100644 rules.mk
 delete mode 100644 scripts/Makefile.build.tmp
 delete mode 100644 scripts/Makefile.host.tmp

diff --git a/rules.mk b/rules.mk
deleted file mode 100644
index e4fd337..000
--- a/rules.mk
+++ /dev/null
@@ -1,47 +0,0 @@
-#
-# (C) Copyright 2006-2013
-# Wolfgang Denk, DENX Software Engineering, w...@denx.de.
-#
-# SPDX-License-Identifier: GPL-2.0+
-#
-#
-
-_depend:   $(obj)/.depend
-
-# Split the source files into two camps: those in the current directory, and
-# those somewhere else. For the first camp we want to support CPPFLAGS_fname
-# and for the second we don't / can't.
-PWD_SRCS := $(foreach f,$(SRCS), $(if \
-   $(filter $(if $(KBUILD_SRC),$(srctree)/)$(src)/$(notdir $f),$f), $f))
-OTHER_SRCS := $(filter-out $(PWD_SRCS),$(SRCS))
-
-# This is a list of dependency files to generate
-DEPS := $(basename $(addprefix $(obj)/.depend., $(notdir $(PWD_SRCS
-
-# Join all the dependencies into a single file, in three parts
-#  1 .Concatenate all the generated depend files together
-#  2. Add in the deps from OTHER_SRCS which we couldn't process
-#  3. Add in the HOSTSRCS
-$(obj)/.depend:$(TOPDIR)/config.mk $(DEPS) $(OTHER_SRCS) \
-   $(HOSTSRCS)
-   cat /dev/null $(DEPS) $@
-   @for f in $(OTHER_SRCS); do \
-   g=`basename $$f | sed -e 's/\(.*\)\.[[:alnum:]_]/\1.o/'`; \
-   $(CC) -M $(CPPFLAGS) -MQ $(obj)/$$g $$f  $@ ; \
-   done
-   @for f in $(HOSTSRCS); do \
-   g=`basename $$f | sed -e 's/\(.*\)\.[[:alnum:]_]/\1.o/'`; \
-   $(HOSTCC) -M $(HOSTCPPFLAGS) -MQ $(obj)/$$g $$f  $@ ; \
-   done
-
-MAKE_DEPEND = $(CC) -M $(CPPFLAGS) $(EXTRA_CPPFLAGS_DEP) \
-   -MQ $(addsuffix .o,$(obj)$(basename $)) $ $@
-
-
-$(obj)/.depend.%:  $(src)/%.c
-   $(MAKE_DEPEND)
-
-$(obj)/.depend.%:  $(src)/%.S
-   $(MAKE_DEPEND)
-
-#
diff --git a/scripts/Makefile.build.tmp b/scripts/Makefile.build.tmp
deleted file mode 100644
index 52a44ff..000
--- a/scripts/Makefile.build.tmp
+++ /dev/null
@@ -1,127 +0,0 @@
-# our default target
-.PHONY: all
-all:
-
-ifeq ($(CONFIG_TPL_BUILD),y)
-  src := $(patsubst tpl/%,%,$(obj))
-else
-  ifeq ($(CONFIG_SPL_BUILD),y)
-src := $(patsubst spl/%,%,$(obj))
-  else
-src := $(obj)
-  endif
-endif
-
-include $(srctree)/scripts/Kbuild.include
-include $(srctree)/config.mk
-
-# variable LIB is used in examples/standalone/Makefile
-__LIB := $(obj)/built-in.o
-LIBGCC = $(obj)/libgcc.o
-SRCS :=
-subdir-y :=
-obj-dirs :=
-
-kbuild-dir := $(if $(filter /%,$(src)),$(src),$(srctree)/$(src))
-include $(kbuild-dir)/Makefile
-
-# Do not include host rules unless needed
-ifneq ($(hostprogs-y)$(hostprogs-m),)
-include $(SRCTREE)/scripts/Makefile.host.tmp
-endif
-
-# Going forward use the following
-obj-y := $(sort $(obj-y))
-extra-y := $(sort $(extra-y))
-always := $(sort $(always))
-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   += $(obj-y:.o=.c) $(obj-y:.o=.S) $(lib-y:.o=.c) \
-   $(lib-y:.o=.S) $(extra-y:.o=.c) $(extra-y:.o=.S)
-
-SRCS := $(addprefix $(if $(KBUILD_SRC),$(srctree)/$(src)/,$(src)/),$(SRCS))
-SRCS := $(wildcard $(SRCS))
-
-OBJS   := $(addprefix $(obj)/,$(obj-y))
-
-# $(obj-dirs) is a list of directories that contain object files
-
-obj-dirs += $(dir $(OBJS))
-
-_dummy := $(shell [ -d $(obj) ] || mkdir -p $(obj))
-
-# Create directories for object files if directory does not exist
-# Needed when obj-y := dir/file.o syntax is used
-_dummy := $(foreach d,$(obj-dirs), $(shell [ -d $(d) ] || mkdir -p $(d)))
-
-LGOBJS := $(addprefix $(obj)/,$(sort $(lib-y)))
-
-all: $(__LIB) $(addprefix $(obj)/,$(extra-y) $(always)) $(subdir-y)
-
-$(__LIB):  $(obj)/.depend $(OBJS)
-   $(call cmd_link_o_target, $(OBJS))
-
-ifneq ($(strip $(lib-y)),)
-all: $(LIBGCC)
-
-$(LIBGCC): $(obj)/.depend $(LGOBJS)
-   $(call cmd_link_o_target, $(LGOBJS))
-endif
-
-ifneq ($(subdir-obj-y),)
-# Descending
-$(subdir-obj-y): $(subdir-y)
-endif
-
-ifneq ($(subdir-y),)
-$(subdir-y): FORCE
-   $(MAKE) $(build)=$(obj)/$@
-endif
-
-#
-
-# Allow boards to use custom optimize flags on a per 

[U-Boot] [PATCH v5 0/38] Switch over to real Kbuild

2014-01-17 Thread Masahiro Yamada

We switched to Kbuild style makefiles at v2014.01-rc1 release.
With that modification, we can write makefiles simpler.
But it is NOT real Kbuild. We need more progress.

As the next step, this series imports (+ adjusts) build scripts
from Linux Kernel under scripts/ directory.
By applying this series, we can get more advantages:
  - short log
  - perfect dependency tracking
  - preparation to the next step, Kconfig
  - other things...

 Kbuild without Kconfig
 --

First of all, to make things clearer, let me explain
the difference between Kbuild and Kconfig.
They are, I think, sometimes confusing.

 Kbuild - build system used for Linux Kernel.
Some features of Kbuild are:

   (a) We can describe makefiles simply.
  Just add objects to obj-y like this:
  obj-$(CONFIG_FOO) += foo.o

   (b) We can describe directory descending nicely.
  Add directories with a slash to obj-y like this:
  obj-$(CONFIG_BAR) += bar/

   (c) Short log like follows:
  CC  common/foo.o
  CC  common/bar.o
  LD  common/built-in.o

   (d) Perfect dependency tracking
  I think this is the biggest advantage.
  To be honest, the dependency tracing of U-Boot build system
  was not reliable.

 Kconfig - A tool to manage CONFIG macros.
  We can handle the dependency among CONFIG macros.
  Kconfig allows us to modify CONFIG settings easily
  by make config.
  GUI interface are also available by make menuconfig
  All defined CONFIG macros are stored into .config file

I think most of U-boot developers are already familiar with above.
(In most cases, they are Linux Kernel developers too.)

I definitely want to port both of these, but I want to do them separately: 
Kbuild first.
(If we do Kbuild and Kconfig at the same time, it might be messed up.)

So, I want to do Kbuild without Kconfig in this series.
The conventional tool (mkconfig + boards.cfg file)
is used for board configuration.

 Prerequisite
 

You need to apply the followings beforehand to use this series.

[1] sandbox: Use system headers first for sandbox's os.c in a different way
http://patchwork.ozlabs.org/patch/294233/

[2] board: tec-ng: Do not make directories in a board Makefile
http://patchwork.ozlabs.org/patch/310825/

 How to Build ?
 --

We can build the same as before.
Do board configuraton first and then run make.

  $ make  omap4_panda_config
  Configuring for omap4_panda board...
  $ make  CROSS_COMPILE=arm-linux-gnueabi-
  GEN include/autoconf.mk.dep
  GEN include/autoconf.mk
  CC  lib/asm-offsets.s
  GEN include/generated/generic-asm-offsets.h
  CC  arch/arm/cpu/armv7/omap4/asm-offsets.s
  GEN include/generated/asm-offsets.h
  HOSTCC  scripts/basic/fixdep
   ...

You will find a difference at a glance, short log
If you need detail log message, please add V=1.
(You can also use V=2)

Please note we can no longer use
  $ make omap4_panda CROSS_COMPILE=arm-linux-gnueabi-
to do board configuration and make at the same time.

Instead, we can use Kbuild-ish way for that purpose:
  $ make omap4_panda_config all CROSS_COMPILE=arm-linux-gnuabi-

This series keeps the other features:

  - Support out-of-tree build
 You can use O=dir_name like this
 $ mkdir build_dir
 $ make omap4_panda_config all O=build_dir CROSS_COMPILE=arm-linux-gnueabi-

  - Works with parallel make option
 Add -j option for this. Compiling will get faster.

  - Of cource, SPL, TPL build are supported
(nand_spl also works. But nand_spl is obsolete and we should switch to 
spl.
 Until when should we continue to maintain nand_spl?)

  - Breaks no boards (except some boards which are already broken)
 I built all target boards to prove correctness of this series
 at least for compile test.

 My Next Plan
 

  - Import Kconfig
  Use make config, make menuconfig, make defconfig, etc. in U-Boot.

  - More refactoring
  Some parts of makefiles are still dirty.
  I want to refactor more makefiles in follow-up patches.

  - Use obj-m for standalone program?? Loadable module??
  I have not deceided about this yet.

 Note
 

 - I marked dirty parts with FIX ME.

   In some board-specific config.mk files.
 # FIX ME
 ifneq ($(filter lib lib/lzma lib/zlib, $(obj)),)
 ccflags-y := -O2
 endif

   In the top Makefile
 # FIX ME
 cpp_flags := $(KBUILD_CPPFLAGS) $(CPPFLAGS) $(UBOOTINCLUDE) 
$(NOSTDINC_FLAGS)
 c_flags := $(KBUILD_CFLAGS) $(cpp_flags)

   I will re-write them more nicely after other parts are prepared.

Changes for v5:
   - Fix a bug reported by Gerhard Sittig:
 make tools before running make failed at v4.
   - Revive env target so that we can build only under tools/env/.
   - Add a new patch at the tail:
   38/38 tools/env: cross-compile fw_printenv without setting HOSTCC
   - Describe 

[U-Boot] [PATCH v5 06/38] nand-spl: Use scripts/Makefile.build

2014-01-17 Thread Masahiro Yamada
Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---

Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None

 Makefile  |  2 +-
 nand_spl/board/amcc/acadia/Makefile   |  8 
 nand_spl/board/amcc/bamboo/Makefile   |  8 
 nand_spl/board/amcc/canyonlands/Makefile  |  8 
 nand_spl/board/amcc/kilauea/Makefile  |  8 
 nand_spl/board/amcc/sequoia/Makefile  |  8 
 nand_spl/board/freescale/mpc8315erdb/Makefile | 10 --
 nand_spl/board/freescale/mpc8536ds/Makefile   | 10 --
 nand_spl/board/freescale/mpc8569mds/Makefile  | 10 --
 nand_spl/board/freescale/mpc8572ds/Makefile   | 10 --
 nand_spl/board/freescale/p1023rds/Makefile| 11 +--
 nand_spl/board/freescale/p1_p2_rdb/Makefile   | 10 --
 nand_spl/board/sheldon/simpc8313/Makefile | 11 ---
 13 files changed, 2 insertions(+), 112 deletions(-)

diff --git a/Makefile b/Makefile
index 6d3f2ce..37dfebb 100644
--- a/Makefile
+++ b/Makefile
@@ -567,7 +567,7 @@ $(obj)u-boot.lds: $(LDSCRIPT) depend
$(CPP) $(CPPFLAGS) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - $ 
$@
 
 nand_spl:  $(TIMESTAMP_FILE) $(VERSION_FILE) depend
-   $(MAKE) -C nand_spl/board/$(BOARDDIR) all
+   $(MAKE) $(build) nand_spl/board/$(BOARDDIR) all
 
 $(obj)u-boot-nand.bin: nand_spl $(obj)u-boot.bin
cat $(obj)nand_spl/u-boot-spl-16k.bin $(obj)u-boot.bin  
$(obj)u-boot-nand.bin
diff --git a/nand_spl/board/amcc/acadia/Makefile 
b/nand_spl/board/amcc/acadia/Makefile
index 022a205..3b00d49 100644
--- a/nand_spl/board/amcc/acadia/Makefile
+++ b/nand_spl/board/amcc/acadia/Makefile
@@ -5,7 +5,6 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
 include $(TOPDIR)/nand_spl/board/$(BOARDDIR)/config.mk
 
 nandobj:= $(OBJTREE)/nand_spl/
@@ -94,10 +93,3 @@ $(obj)%.o:   $(obj)%.S
 
 $(obj)%.o: $(obj)%.c
$(CC) $(CFLAGS) -c -o $@ $
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#
diff --git a/nand_spl/board/amcc/bamboo/Makefile 
b/nand_spl/board/amcc/bamboo/Makefile
index d413a48..4063274 100644
--- a/nand_spl/board/amcc/bamboo/Makefile
+++ b/nand_spl/board/amcc/bamboo/Makefile
@@ -5,7 +5,6 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
 include $(TOPDIR)/nand_spl/board/$(BOARDDIR)/config.mk
 
 nandobj:= $(OBJTREE)/nand_spl/
@@ -82,10 +81,3 @@ $(obj)%.o:   $(obj)%.S
 
 $(obj)%.o: $(obj)%.c
$(CC) $(CFLAGS) -c -o $@ $
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#
diff --git a/nand_spl/board/amcc/canyonlands/Makefile 
b/nand_spl/board/amcc/canyonlands/Makefile
index b2ef03f..13c8b36 100644
--- a/nand_spl/board/amcc/canyonlands/Makefile
+++ b/nand_spl/board/amcc/canyonlands/Makefile
@@ -5,7 +5,6 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
 include $(TOPDIR)/nand_spl/board/$(BOARDDIR)/config.mk
 
 nandobj:= $(OBJTREE)/nand_spl/
@@ -87,10 +86,3 @@ $(obj)%.o:   $(obj)%.S
 
 $(obj)%.o: $(obj)%.c
$(CC) $(CFLAGS) -c -o $@ $
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#
diff --git a/nand_spl/board/amcc/kilauea/Makefile 
b/nand_spl/board/amcc/kilauea/Makefile
index 5899b9e..9d07147 100644
--- a/nand_spl/board/amcc/kilauea/Makefile
+++ b/nand_spl/board/amcc/kilauea/Makefile
@@ -5,7 +5,6 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
 include $(TOPDIR)/nand_spl/board/$(BOARDDIR)/config.mk
 
 nandobj:= $(OBJTREE)/nand_spl/
@@ -83,10 +82,3 @@ $(obj)%.o:   $(obj)%.S
 
 $(obj)%.o: $(obj)%.c
$(CC) $(CFLAGS) -c -o $@ $
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#
diff --git a/nand_spl/board/amcc/sequoia/Makefile 
b/nand_spl/board/amcc/sequoia/Makefile
index fea6c4e..111bb0d 100644
--- a/nand_spl/board/amcc/sequoia/Makefile
+++ b/nand_spl/board/amcc/sequoia/Makefile
@@ -5,7 +5,6 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-include $(TOPDIR)/config.mk
 include $(TOPDIR)/nand_spl/board/$(BOARDDIR)/config.mk
 
 nandobj:= $(OBJTREE)/nand_spl/
@@ -86,10 +85,3 @@ $(obj)%.o:   $(obj)%.S
 
 $(obj)%.o: $(obj)%.c
$(CC) $(CFLAGS) -c -o $@ $
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#
diff --git a/nand_spl/board/freescale/mpc8315erdb/Makefile 

[U-Boot] [PATCH v5 23/38] kbuild: move some lines to more suitable place

2014-01-17 Thread Masahiro Yamada
Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---

Changes in v5: None
Changes in v4:
  - Move the line where U_BOOT_VERSION is defined

Changes in v3: None
Changes in v2: None

 Makefile | 65 
 1 file changed, 32 insertions(+), 33 deletions(-)

diff --git a/Makefile b/Makefile
index 72803f2..ed431dd 100644
--- a/Makefile
+++ b/Makefile
@@ -9,39 +9,6 @@ VERSION = 2014
 PATCHLEVEL = 01
 SUBLEVEL =
 EXTRAVERSION = -rc3
-ifneq $(SUBLEVEL) 
-U_BOOT_VERSION = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
-else
-U_BOOT_VERSION = $(VERSION).$(PATCHLEVEL)$(EXTRAVERSION)
-endif
-TIMESTAMP_FILE = include/generated/timestamp_autogenerated.h
-VERSION_FILE = include/generated/version_autogenerated.h
-
-HOSTARCH := $(shell uname -m | \
-   sed -e s/i.86/x86/ \
-   -e s/sun4u/sparc64/ \
-   -e s/arm.*/arm/ \
-   -e s/sa110/arm/ \
-   -e s/ppc64/powerpc/ \
-   -e s/ppc/powerpc/ \
-   -e s/macppc/powerpc/\
-   -e s/sh.*/sh/)
-
-HOSTOS := $(shell uname -s | tr '[:upper:]' '[:lower:]' | \
-   sed -e 's/\(cygwin\).*/cygwin/')
-
-export HOSTARCH HOSTOS
-
-# Deal with colliding definitions from tcsh etc.
-VENDOR=
-
-#
-# Allow for silent builds
-ifeq (,$(findstring s,$(MAKEFLAGS)))
-XECHO = echo
-else
-XECHO = :
-endif
 
 # *DOCUMENTATION*
 # To see a list of typical targets execute make help
@@ -212,6 +179,35 @@ unexport CDPATH
 
 #
 
+TIMESTAMP_FILE = include/generated/timestamp_autogenerated.h
+VERSION_FILE = include/generated/version_autogenerated.h
+
+HOSTARCH := $(shell uname -m | \
+   sed -e s/i.86/x86/ \
+   -e s/sun4u/sparc64/ \
+   -e s/arm.*/arm/ \
+   -e s/sa110/arm/ \
+   -e s/ppc64/powerpc/ \
+   -e s/ppc/powerpc/ \
+   -e s/macppc/powerpc/\
+   -e s/sh.*/sh/)
+
+HOSTOS := $(shell uname -s | tr '[:upper:]' '[:lower:]' | \
+   sed -e 's/\(cygwin\).*/cygwin/')
+
+export HOSTARCH HOSTOS
+
+# Deal with colliding definitions from tcsh etc.
+VENDOR=
+
+#
+# Allow for silent builds
+ifeq (,$(findstring s,$(MAKEFLAGS)))
+XECHO = echo
+else
+XECHO = :
+endif
+
 # The tools are needed early, so put this first
 # Don't include stuff already done in $(LIBS)
 # The examples conditionally depend on U-Boot (say, when USE_PRIVATE_LIBGCC
@@ -402,6 +398,9 @@ KBUILD_CFLAGS   := -Wall -Wstrict-prototypes \
   -fno-builtin -ffreestanding
 KBUILD_AFLAGS   := -D__ASSEMBLY__
 
+U_BOOT_VERSION = $(VERSION)$(if $(PATCHLEVEL),.$(PATCHLEVEL)$(if 
$(SUBLEVEL),.$(SUBLEVEL)))$(EXTRAVERSION)
+
+export VERSION PATCHLEVEL SUBLEVEL U_BOOT_VERSION
 export CONFIG_SHELL HOSTCC HOSTCFLAGS HOSTLDFLAGS CROSS_COMPILE AS LD CC
 export CPP AR NM LDR STRIP OBJCOPY OBJDUMP
 export MAKE AWK
-- 
1.8.3.2

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


[U-Boot] [PATCH v5 12/38] Makefile: move more flags to the top Makefile

2014-01-17 Thread Masahiro Yamada
Before this commit, most of compiler flags were defined in config.mk.
But it is redundant because config.mk is included from all recursive make.

This commit moves many complier flags to the top Makefile
and export them.
And we use new vaiarables to store them:
KBUILD_CPPFLAGS, KBUILD_CFLAGS, KBUILD_AFLAGS.
This will allow us to switch more smoothly to Kbuild.

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

Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2:
  - At version 1, nand_spl boards got broken by this commit
(and fixed again in the lator commit.)
Fix this problem

 Makefile  | 35 +++
 config.mk | 41 -
 2 files changed, 39 insertions(+), 37 deletions(-)

diff --git a/Makefile b/Makefile
index 57718f7..7f950c5 100644
--- a/Makefile
+++ b/Makefile
@@ -226,11 +226,46 @@ CHECK = sparse
 CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \
  -Wbitwise -Wno-return-void -D__CHECK_ENDIAN__ $(CF)
 
+KBUILD_CPPFLAGS := -D__KERNEL__
+
+KBUILD_CFLAGS   := -Wall -Wstrict-prototypes \
+  -Wno-format-security \
+  -fno-builtin -ffreestanding
+KBUILD_AFLAGS   := -D__ASSEMBLY__
+
 export CONFIG_SHELL HOSTCC HOSTCFLAGS HOSTLDFLAGS CROSS_COMPILE AS LD CC
 export CPP AR NM LDR STRIP OBJCOPY OBJDUMP
 export MAKE AWK
 export DTC CHECK CHECKFLAGS
 
+export KBUILD_CPPFLAGS
+export KBUILD_CFLAGS KBUILD_AFLAGS
+
+KBUILD_CFLAGS += -Os #-fomit-frame-pointer
+
+ifdef BUILD_TAG
+KBUILD_CFLAGS += -DBUILD_TAG='$(BUILD_TAG)'
+endif
+
+KBUILD_CFLAGS += $(call cc-option,-fno-stack-protector)
+
+KBUILD_CFLAGS  += -g
+# $(KBUILD_AFLAGS) sets -g, which causes gcc to pass a suitable -gformat
+# option to the assembler.
+KBUILD_AFLAGS  += -g
+
+# Report stack usage if supported
+KBUILD_CFLAGS += $(call cc-option,-fstack-usage)
+
+KBUILD_CFLAGS += $(call cc-option,-Wno-format-nonliteral)
+
+# turn jbsr into jsr for m68k
+ifeq ($(ARCH),m68k)
+ifeq ($(findstring 3.4,$(shell $(CC) --version)),3.4)
+KBUILD_AFLAGS += -Wa,-gstabs,-S
+endif
+endif
+
 # load other configuration
 include $(TOPDIR)/config.mk
 
diff --git a/config.mk b/config.mk
index ba42641..04b63f6 100644
--- a/config.mk
+++ b/config.mk
@@ -90,19 +90,13 @@ endif
 
 #
 
-# We don't actually use $(ARFLAGS) anywhere anymore, so catch people
-# who are porting old code to latest mainline but not updating $(AR).
-ARFLAGS = $(error update your Makefile to use cmd_link_o_target and not AR)
 RELFLAGS= $(PLATFORM_RELFLAGS)
-DBGFLAGS= -g # -DDEBUG
-OPTFLAGS= -Os #-fomit-frame-pointer
 
 OBJCFLAGS += --gap-fill=0xff
 
 gccincdir := $(shell $(CC) -print-file-name=include)
 
-CPPFLAGS := $(DBGFLAGS) $(OPTFLAGS) $(RELFLAGS)\
-   -D__KERNEL__
+CPPFLAGS = $(KBUILD_CPPFLAGS) $(RELFLAGS)
 
 # Enable garbage collection of un-used sections for SPL
 ifeq ($(CONFIG_SPL_BUILD),y)
@@ -134,26 +128,10 @@ CPPFLAGS += -I$(OBJTREE)/include
 endif
 
 CPPFLAGS += -I$(TOPDIR)/include -I$(SRCTREE)/arch/$(ARCH)/include
-CPPFLAGS += -fno-builtin -ffreestanding -nostdinc  \
+CPPFLAGS += -nostdinc  \
-isystem $(gccincdir) -pipe $(PLATFORM_CPPFLAGS)
 
-CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes
-
-ifdef BUILD_TAG
-CFLAGS += -DBUILD_TAG='$(BUILD_TAG)'
-endif
-
-CFLAGS_SSP := $(call cc-option,-fno-stack-protector)
-CFLAGS += $(CFLAGS_SSP)
-# Some toolchains enable security related warning flags by default,
-# but they don't make much sense in the u-boot world, so disable them.
-CFLAGS_WARN := $(call cc-option,-Wno-format-nonliteral) \
-  $(call cc-option,-Wno-format-security)
-CFLAGS += $(CFLAGS_WARN)
-
-# Report stack usage if supported
-CFLAGS_STACK := $(call cc-option,-fstack-usage)
-CFLAGS += $(CFLAGS_STACK)
+CFLAGS := $(KBUILD_CFLAGS) $(CPPFLAGS)
 
 BCURDIR = $(subst $(SRCTREE)/,,$(CURDIR:$(obj)%=%))
 
@@ -165,18 +143,7 @@ endif
 endif
 endif
 
-# $(CPPFLAGS) sets -g, which causes gcc to pass a suitable -gformat
-# option to the assembler.
-AFLAGS_DEBUG :=
-
-# turn jbsr into jsr for m68k
-ifeq ($(ARCH),m68k)
-ifeq ($(findstring 3.4,$(shell $(CC) --version)),3.4)
-AFLAGS_DEBUG := -Wa,-gstabs,-S
-endif
-endif
-
-AFLAGS := $(AFLAGS_DEBUG) -D__ASSEMBLY__ $(CPPFLAGS)
+AFLAGS := $(KBUILD_AFLAGS) $(CPPFLAGS)
 
 LDFLAGS += $(PLATFORM_LDFLAGS)
 LDFLAGS_FINAL += -Bstatic
-- 
1.8.3.2

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


[U-Boot] [PATCH v5 01/38] .gitignore: ingore files generated by Kbuild

2014-01-17 Thread Masahiro Yamada
Ignore generated files by Kbuild such as .*.cmd, *.order, etc.

Besides above,
 - Ignore *.s files
   We do not need to ignore with file name, asm-offsets.s
 - Do not ignore *.rej (for quilt)
 - Ignore backup files, \#*#

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

Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2:
 - Do not double *~
 - Ignore more patterns

 .gitignore | 27 +++
 1 file changed, 19 insertions(+), 8 deletions(-)

diff --git a/.gitignore b/.gitignore
index 97f7db0..fc40a08 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,16 +5,19 @@
 #
 # Normal rules
 #
-
-*.rej
-*.orig
-*.a
+.*
 *.o
+*.o.*
+*.a
+*.s
 *.su
-*~
+*.mod.c
+*.i
+*.lst
+*.order
 *.swp
-*.patch
 *.bin
+*.patch
 *.cfgtmp
 *.dts.tmp
 
@@ -24,7 +27,6 @@
 #
 # Top-level generic files
 #
-
 /MLO*
 /SPL
 /System.map
@@ -50,6 +52,12 @@
 /u-boot.sb
 
 #
+# git files that we don't want to ignore even it they are dot-files
+#
+!.gitignore
+!.mailmap
+
+#
 # Generated files
 #
 
@@ -65,7 +73,6 @@
 /include/generated/
 /include/spl-autoconf.mk
 /include/tpl-autoconf.mk
-asm-offsets.s
 
 # stgit generated dirs
 patches-*
@@ -91,3 +98,7 @@ GPATH
 GRTAGS
 GSYMS
 GTAGS
+
+*.orig
+*~
+\#*#
-- 
1.8.3.2

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


[U-Boot] [PATCH v5 28/38] kbuild: change the top Makefile to more Kbuild-ish structure

2014-01-17 Thread Masahiro Yamada
This commit changes the top Makefile to handle various targets
nicely.
Make targets are divided into four categories:

 - mixed-targets
 We can call a configuration target and build targets
 at one command line like follows:
 $ make board_name_config u-boot

 They are handled one by one.

 - config targets
 board_name_config

 - no-dot-config-targets
 Targets we can run without board configuration such as
   clean, mrproper, distclean, TAGS, %docs, etc.

 - build targets
 The other target which need board configuration.

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

Changes in v5:
  - Rebase on the current u-boot/master
  - Fix a bug:
make board; make tools
  failed at version 4.

Changes in v4: None
Changes in v3: None
Changes in v2:
  - Rebase on v2014.01-rc2 tag

 Makefile | 288 ---
 1 file changed, 167 insertions(+), 121 deletions(-)

diff --git a/Makefile b/Makefile
index 633f1bb..112b515 100644
--- a/Makefile
+++ b/Makefile
@@ -202,34 +202,6 @@ VENDOR=
 
 #
 
-# The tools are needed early, so put this first
-# Don't include stuff already done in $(LIBS)
-# The examples conditionally depend on U-Boot (say, when USE_PRIVATE_LIBGCC
-# is yes), so compile examples after U-Boot is compiled.
-SUBDIR_TOOLS = tools
-SUBDIRS = $(SUBDIR_TOOLS)
-
-.PHONY : $(SUBDIRS) $(VERSION_FILE) $(TIMESTAMP_FILE)
-
-ifeq (include/config.mk,$(wildcard include/config.mk))
-
-# Include autoconf.mk before config.mk so that the config options are available
-# to all top level build files.  We need the dummy all: target to prevent the
-# dependency target in autoconf.mk.dep from being the default.
-all:
-sinclude include/autoconf.mk.dep
-sinclude include/autoconf.mk
-
-SUBDIR_EXAMPLES-y := examples/standalone
-SUBDIR_EXAMPLES-$(CONFIG_API) += examples/api
-ifndef CONFIG_SANDBOX
-SUBDIRS += $(SUBDIR_EXAMPLES-y)
-endif
-
-# load ARCH, BOARD, and CPU configuration
-include include/config.mk
-export ARCH CPU BOARD VENDOR SOC
-
 # set default to nothing for native builds
 ifeq ($(HOSTARCH),$(ARCH))
 CROSS_COMPILE ?=
@@ -376,15 +348,6 @@ CHECK  = sparse
 CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \
  -Wbitwise -Wno-return-void -D__CHECK_ENDIAN__ $(CF)
 
-# Use UBOOTINCLUDE when you must reference the include/ directory.
-# Needed to be compatible with the O= option
-UBOOTINCLUDE:=
-ifneq ($(OBJTREE),$(SRCTREE))
-UBOOTINCLUDE   += -I$(OBJTREE)/include
-endif
-UBOOTINCLUDE   += -I$(srctree)/include \
-   -I$(srctree)/arch/$(ARCH)/include
-
 KBUILD_CPPFLAGS := -D__KERNEL__
 
 KBUILD_CFLAGS   := -Wall -Wstrict-prototypes \
@@ -395,6 +358,7 @@ KBUILD_AFLAGS   := -D__ASSEMBLY__
 U_BOOT_VERSION = $(VERSION)$(if $(PATCHLEVEL),.$(PATCHLEVEL)$(if 
$(SUBLEVEL),.$(SUBLEVEL)))$(EXTRAVERSION)
 
 export VERSION PATCHLEVEL SUBLEVEL U_BOOT_VERSION
+export ARCH CPU BOARD VENDOR SOC
 export CONFIG_SHELL HOSTCC HOSTCFLAGS HOSTLDFLAGS CROSS_COMPILE AS LD CC
 export CPP AR NM LDR STRIP OBJCOPY OBJDUMP
 export MAKE AWK
@@ -427,65 +391,108 @@ scripts_basic:
 # To avoid any implicit rule to kick in, define an empty command.
 scripts/basic/%: scripts_basic ;
 
+# To make sure we do not include .config for any of the *config targets
+# catch them early, and hand them over to scripts/kconfig/Makefile
+# It is allowed to specify more targets when calling make, including
+# mixing *config targets and build targets.
+# For example 'make oldconfig all'.
+# Detect when mixed targets is specified, and make a second invocation
+# of make so .config is not included in this case either (for *config).
+
+no-dot-config-targets := clean clobber mrproper distclean \
+cscope TAGS %tags help %docs check% coccicheck \
+backup
+
+config-targets := 0
+mixed-targets  := 0
+dot-config := 1
+
+ifneq ($(filter $(no-dot-config-targets), $(MAKECMDGOALS)),)
+   ifeq ($(filter-out $(no-dot-config-targets), $(MAKECMDGOALS)),)
+   dot-config := 0
+   endif
+endif
 
-KBUILD_CFLAGS += -Os #-fomit-frame-pointer
-
-ifdef BUILD_TAG
-KBUILD_CFLAGS += -DBUILD_TAG='$(BUILD_TAG)'
+ifeq ($(KBUILD_EXTMOD),)
+ifneq ($(filter config %config,$(MAKECMDGOALS)),)
+config-targets := 1
+ifneq ($(filter-out config %config,$(MAKECMDGOALS)),)
+mixed-targets := 1
+endif
+endif
 endif
 
-KBUILD_CFLAGS += $(call cc-option,-fno-stack-protector)
+ifeq ($(mixed-targets),1)
+# ===
+# We're called with mixed targets (*config and build targets).
+# Handle them one by one.
 
-KBUILD_CFLAGS  += -g
-# $(KBUILD_AFLAGS) sets -g, which causes gcc to pass a suitable -gformat
-# option to the assembler.
-KBUILD_AFLAGS  += -g
+%:: FORCE
+   

[U-Boot] [PATCH v5 15/38] Makefile: move some flags to spl/Makefile

2014-01-17 Thread Masahiro Yamada
Some flags are used for SPL (and TPL) build only.
This commit moves them from config.mk to spl/Makefile.

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

Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None

 config.mk| 19 ---
 spl/Makefile | 14 ++
 2 files changed, 14 insertions(+), 19 deletions(-)

diff --git a/config.mk b/config.mk
index 54d1d8b..597a566 100644
--- a/config.mk
+++ b/config.mk
@@ -95,20 +95,6 @@ RELFLAGS= $(PLATFORM_RELFLAGS)
 OBJCFLAGS += --gap-fill=0xff
 
 CPPFLAGS = $(KBUILD_CPPFLAGS) $(RELFLAGS)
-
-# Enable garbage collection of un-used sections for SPL
-ifeq ($(CONFIG_SPL_BUILD),y)
-CPPFLAGS += -ffunction-sections -fdata-sections
-LDFLAGS_FINAL += --gc-sections
-endif
-
-ifeq ($(CONFIG_SPL_BUILD),y)
-CPPFLAGS += -DCONFIG_SPL_BUILD
-ifeq ($(CONFIG_TPL_BUILD),y)
-CPPFLAGS += -DCONFIG_TPL_BUILD
-endif
-endif
-
 CPPFLAGS += $(UBOOTINCLUDE)
 CPPFLAGS += $(NOSTDINC_FLAGS) -pipe $(PLATFORM_CPPFLAGS)
 
@@ -129,11 +115,6 @@ AFLAGS := $(KBUILD_AFLAGS) $(CPPFLAGS)
 LDFLAGS += $(PLATFORM_LDFLAGS)
 LDFLAGS_FINAL += -Bstatic
 
-LDFLAGS_$(SPL_BIN) += -T $(obj)u-boot-spl.lds $(LDFLAGS_FINAL)
-ifneq ($(CONFIG_SPL_TEXT_BASE),)
-LDFLAGS_$(SPL_BIN) += -Ttext $(CONFIG_SPL_TEXT_BASE)
-endif
-
 #
 
 export PLATFORM_CPPFLAGS PLATFORM_RELFLAGS CPPFLAGS CFLAGS AFLAGS
diff --git a/spl/Makefile b/spl/Makefile
index 2529849..164ae61 100644
--- a/spl/Makefile
+++ b/spl/Makefile
@@ -17,6 +17,15 @@
 CONFIG_SPL_BUILD := y
 export CONFIG_SPL_BUILD
 
+KBUILD_CPPFLAGS += -DCONFIG_SPL_BUILD
+ifeq ($(CONFIG_TPL_BUILD),y)
+KBUILD_CPPFLAGS += -DCONFIG_TPL_BUILD
+endif
+
+# Enable garbage collection of un-used sections for SPL
+KBUILD_CFLAGS += -ffunction-sections -fdata-sections
+LDFLAGS_FINAL += --gc-sections
+
 ifeq ($(CONFIG_TPL_BUILD),y)
 export CONFIG_TPL_BUILD
 SPL_BIN := u-boot-tpl
@@ -169,6 +178,11 @@ endif
 $(obj)$(SPL_BIN).bin:  $(obj)$(SPL_BIN)
$(OBJCOPY) $(OBJCFLAGS) $(SPL_OBJCFLAGS) -O binary $ $@
 
+LDFLAGS_$(SPL_BIN) += -T $(obj)u-boot-spl.lds $(LDFLAGS_FINAL)
+ifneq ($(CONFIG_SPL_TEXT_BASE),)
+LDFLAGS_$(SPL_BIN) += -Ttext $(CONFIG_SPL_TEXT_BASE)
+endif
+
 GEN_UBOOT = \
cd $(obj)  $(LD) $(LDFLAGS) $(LDFLAGS_$(@F)) $(__START) \
--start-group $(__LIBS) --end-group $(PLATFORM_LIBS) \
-- 
1.8.3.2

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


[U-Boot] [PATCH v5 16/38] Makefile: move some flags to examples makefiles

2014-01-17 Thread Masahiro Yamada
This commit moves some flags which are used
under examples/ directory only.

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

Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None

 config.mk| 8 
 examples/api/Makefile| 4 
 examples/standalone/Makefile | 4 
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/config.mk b/config.mk
index 597a566..ed1a519 100644
--- a/config.mk
+++ b/config.mk
@@ -102,14 +102,6 @@ CFLAGS := $(KBUILD_CFLAGS) $(CPPFLAGS)
 
 BCURDIR = $(subst $(SRCTREE)/,,$(CURDIR:$(obj)%=%))
 
-ifeq ($(findstring examples/,$(BCURDIR)),)
-ifeq ($(CONFIG_SPL_BUILD),)
-ifdef FTRACE
-CFLAGS += -finstrument-functions -DFTRACE
-endif
-endif
-endif
-
 AFLAGS := $(KBUILD_AFLAGS) $(CPPFLAGS)
 
 LDFLAGS += $(PLATFORM_LDFLAGS)
diff --git a/examples/api/Makefile b/examples/api/Makefile
index 52f4368..ee3c487 100644
--- a/examples/api/Makefile
+++ b/examples/api/Makefile
@@ -4,6 +4,10 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
+ifdef FTRACE
+CFLAGS += -finstrument-functions -DFTRACE
+endif
+
 ifeq ($(ARCH),powerpc)
 LOAD_ADDR = 0x4
 endif
diff --git a/examples/standalone/Makefile b/examples/standalone/Makefile
index cad4409..1f8d70c 100644
--- a/examples/standalone/Makefile
+++ b/examples/standalone/Makefile
@@ -5,6 +5,10 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
+ifdef FTRACE
+CFLAGS += -finstrument-functions -DFTRACE
+endif
+
 extra-y:= hello_world
 extra-$(CONFIG_SMC9)   += smc9_eeprom
 extra-$(CONFIG_SMC911X)+= smc911x_eeprom
-- 
1.8.3.2

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


[U-Boot] [PATCH v5 27/38] Makefile: remove a cleaning target tidy

2014-01-17 Thread Masahiro Yamada
Before this commit, make tidy did
make clean + delete *.depend* files.

But, we do not have *.depend* files any more,
which means make tidy is the same as make clean.

This commit removes the redandant target tidy.

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

Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2:
  - Rebase on v2014.01-rc2 tag
  - Omit *.depend* from .gitignore

 .gitignore | 1 -
 MAKEALL| 2 +-
 Makefile   | 8 ++--
 3 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/.gitignore b/.gitignore
index fc40a08..906f0d7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -61,7 +61,6 @@
 # Generated files
 #
 
-*.depend*
 /LOG
 /errlog
 /reloc_off
diff --git a/MAKEALL b/MAKEALL
index 01d0598..27147ff 100755
--- a/MAKEALL
+++ b/MAKEALL
@@ -696,7 +696,7 @@ build_target() {
if [ $BUILD_MANY == 1 ] ; then
trap - TERM
 
-   ${MAKE} -s tidy
+   ${MAKE} -s clean
 
if [ -s ${LOG_DIR}/${target}.ERR ] ; then
cp ${LOG_DIR}/${target}.ERR 
${OUTPUT_PREFIX}/ERR/${target}
diff --git a/Makefile b/Makefile
index 9d684e9..633f1bb 100644
--- a/Makefile
+++ b/Makefile
@@ -471,7 +471,7 @@ LDFLAGS_u-boot += -Ttext $(CONFIG_SYS_TEXT_BASE)
 endif
 
 # Targets which don't build the source code
-NON_BUILD_TARGETS = backup clean clobber distclean mrproper tidy unconfig 
%_config
+NON_BUILD_TARGETS = backup clean clobber distclean mrproper unconfig %_config
 
 # Only do the generic board check when actually building, not configuring
 ifeq ($(filter $(NON_BUILD_TARGETS),$(MAKECMDGOALS)),)
@@ -1118,11 +1118,7 @@ clean:
-o -name '*.cfgtmp' \) -print \
| xargs rm -f
 
-# Removes everything not needed for testing u-boot
-tidy:  clean
-   @find $(OBJTREE) -type f \( -name '*.depend*' \) -print | xargs rm -f
-
-clobber:   tidy
+clobber: clean
@find $(OBJTREE) -type f \( -name '*.srec' \
-o -name '*.bin' -o -name u-boot.img \) \
-print0 | xargs -0 rm -f
-- 
1.8.3.2

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


[U-Boot] [PATCH v5 02/38] Makefile.host.tmp: add a new script to refactor tools

2014-01-17 Thread Masahiro Yamada
This commit adds scripts/Makefile.host.tmp which will
be used in the next commit to convert makefiles
under tools/ directory to Kbuild style.

Notice this script, scripts/Makefile.host.tmp
is temporary.

When switching over to real Kbuild,
it will be replaced with scripts/Makefile.host of Linux Kernel.

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

Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None

 scripts/Makefile.build| 17 ++---
 scripts/Makefile.host.tmp | 61 +++
 2 files changed, 75 insertions(+), 3 deletions(-)
 create mode 100644 scripts/Makefile.host.tmp

diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index e3354aa..c451fbf 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -7,15 +7,23 @@ include $(TOPDIR)/config.mk
 LIB := $(obj)built-in.o
 LIBGCC = $(obj)libgcc.o
 SRCS :=
+subdir-y :=
+obj-dirs :=
 
 include Makefile
 
+# Do not include host rules unless needed
+ifneq ($(hostprogs-y)$(hostprogs-m),)
+include $(SRCTREE)/scripts/Makefile.host.tmp
+endif
+
 # Going forward use the following
 obj-y := $(sort $(obj-y))
 extra-y := $(sort $(extra-y))
+always := $(sort $(always))
 lib-y := $(sort $(lib-y))
 
-subdir-y   := $(patsubst %/,%,$(filter %/, $(obj-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))
@@ -25,7 +33,8 @@ SRCS  += $(wildcard $(obj-y:.o=.c) $(obj-y:.o=.S) 
$(lib-y:.o=.c) \
 OBJS   := $(addprefix $(obj),$(obj-y))
 
 # $(obj-dirs) is a list of directories that contain object files
-obj-dirs := $(dir $(OBJS))
+
+obj-dirs += $(dir $(OBJS))
 
 # Create directories for object files if directory does not exist
 # Needed when obj-y := dir/file.o syntax is used
@@ -33,7 +42,7 @@ _dummy := $(foreach d,$(obj-dirs), $(shell [ -d $(d) ] || 
mkdir -p $(d)))
 
 LGOBJS := $(addprefix $(obj),$(sort $(lib-y)))
 
-all: $(LIB) $(addprefix $(obj),$(extra-y))
+all: $(LIB) $(addprefix $(obj),$(extra-y) $(always)) $(subdir-y)
 
 $(LIB):$(obj).depend $(OBJS)
$(call cmd_link_o_target, $(OBJS))
@@ -48,7 +57,9 @@ endif
 ifneq ($(subdir-obj-y),)
 # Descending
 $(subdir-obj-y): $(subdir-y)
+endif
 
+ifneq ($(subdir-y),)
 $(subdir-y): FORCE
$(MAKE) -C $@ -f $(TOPDIR)/scripts/Makefile.build
 endif
diff --git a/scripts/Makefile.host.tmp b/scripts/Makefile.host.tmp
new file mode 100644
index 000..4b57846
--- /dev/null
+++ b/scripts/Makefile.host.tmp
@@ -0,0 +1,61 @@
+
+__hostprogs := $(sort $(hostprogs-y) $(hostprogs-m))
+
+# C code
+# Executables compiled from a single .c file
+host-csingle   := $(foreach m,$(__hostprogs),$(if $($(m)-objs),,$(m)))
+
+# C executables linked based on several .o files
+host-cmulti:= $(foreach m,$(__hostprogs),$(if $($(m)-objs),$(m)))
+
+# Object (.o) files compiled from .c files
+host-cobjs := $(sort $(foreach m,$(__hostprogs),$($(m)-objs)))
+
+# output directory for programs/.o files
+# hostprogs-y := tools/build may have been specified. Retrieve directory
+host-objdirs := $(foreach f,$(__hostprogs), $(if $(dir $(f)),$(dir $(f
+# directory of .o files from prog-objs notation
+host-objdirs += $(foreach f,$(host-cmulti),  \
+$(foreach m,$($(f)-objs),\
+$(if $(dir $(m)),$(dir $(m)
+
+host-objdirs := $(strip $(sort $(filter-out ./,$(host-objdirs
+
+__hostprogs := $(addprefix $(obj),$(__hostprogs))
+host-csingle   := $(addprefix $(obj),$(host-csingle))
+host-cmulti:= $(addprefix $(obj),$(host-cmulti))
+host-cobjs := $(addprefix $(obj),$(host-cobjs))
+host-objdirs:= $(addprefix $(obj),$(host-objdirs))
+
+obj-dirs += $(host-objdirs)
+
+#
+# Handle options to gcc. Support building with separate output directory
+
+_hostc_flags   = $(HOSTCFLAGS)   $(HOST_EXTRACFLAGS)   \
+ $(HOSTCFLAGS_$(basetarget).o)
+
+# Find all -I options and call addtree
+flags = $(foreach o,$($(1)),$(if $(filter -I%,$(o)),$(call addtree,$(o)),$(o)))
+
+ifeq ($(OBJTREE),$(SRCTREE))
+__hostc_flags  = $(_hostc_flags)
+else
+__hostc_flags  = -I$(obj) $(call flags,_hostc_flags)
+endif
+
+hostc_flags= $(__hostc_flags)
+
+#
+# Compile programs on the host
+
+$(host-csingle): $(obj)%: %.c
+   $(HOSTCC) $(HOSTCFLAGS) $(HOST_EXTRACFLAGS) $(HOSTLDFLAGS) 
$(HOSTCFLAGS_$(@F)) $(HOSTCFLAGS_$(BCURDIR)) -o $@ $
+
+$(host-cmulti): $(obj)%: $(host-cobjs)
+   $(HOSTCC) $(HOSTLDFLAGS) -o $@ $(addprefix $(obj),$($(@F)-objs)) 
$(HOSTLOADLIBES_$(@F))
+
+$(host-cobjs): $(obj)%.o: %.c
+   $(HOSTCC) $(HOSTCFLAGS) $(HOST_EXTRACFLAGS) $(HOSTCFLAGS_$(@F)) 
$(HOSTCFLAGS_$(BCURDIR)) -o $@ $ -c
+
+targets += $(host-csingle)  $(host-cmulti) $(host-cobjs)
-- 
1.8.3.2

___
U-Boot mailing list
U-Boot@lists.denx.de

[U-Boot] [PATCH v5 03/38] tools: convert makefiles to kbuild style

2014-01-17 Thread Masahiro Yamada
Before this commit, makefiles under tools/ directory
were implemented with their own way.

This commit refactors them by using hostprogs-y variable.

Several C sources have been added to wrap other C sources
to simplify Makefile.
For example, tools/crc32.c includes lib/crc32.c

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

Changes in v5:
  - Rebase on the current u-boot/master

Changes in v4: None
Changes in v3: None
Changes in v2:
  - Rebase on v2014.01-rc2 tag

 Makefile  |  18 ++-
 config.mk |  28 +---
 rules.mk  |   5 -
 spl/Makefile  |   4 +-
 tools/.gitignore  |   2 +-
 tools/Makefile| 338 ++
 tools/crc32.c |   1 +
 tools/easylogo/Makefile   |  12 +-
 tools/env/Makefile|  32 +
 tools/env/crc32.c |   1 +
 tools/env/ctype.c |   1 +
 tools/env/env_attr.c  |   1 +
 tools/env/env_flags.c |   1 +
 tools/env/linux_string.c  |   1 +
 tools/env_embedded.c  |   1 +
 tools/fdt.c   |   1 +
 tools/fdt_ro.c|   1 +
 tools/fdt_rw.c|   1 +
 tools/fdt_strerror.c  |   1 +
 tools/fdt_wip.c   |   1 +
 tools/gdb/Makefile|  43 +-
 tools/image-fit.c |   1 +
 tools/image-sig.c |   1 +
 tools/image.c |   1 +
 tools/kernel-doc/Makefile |  21 +--
 tools/md5.c   |   1 +
 tools/rsa-sign.c  |   1 +
 tools/sha1.c  |   1 +
 28 files changed, 156 insertions(+), 365 deletions(-)
 create mode 100644 tools/crc32.c
 create mode 100644 tools/env/crc32.c
 create mode 100644 tools/env/ctype.c
 create mode 100644 tools/env/env_attr.c
 create mode 100644 tools/env/env_flags.c
 create mode 100644 tools/env/linux_string.c
 create mode 100644 tools/env_embedded.c
 create mode 100644 tools/fdt.c
 create mode 100644 tools/fdt_ro.c
 create mode 100644 tools/fdt_rw.c
 create mode 100644 tools/fdt_strerror.c
 create mode 100644 tools/fdt_wip.c
 create mode 100644 tools/image-fit.c
 create mode 100644 tools/image-sig.c
 create mode 100644 tools/image.c
 create mode 100644 tools/md5.c
 create mode 100644 tools/rsa-sign.c
 create mode 100644 tools/sha1.c

diff --git a/Makefile b/Makefile
index 8b1b364..31ad4dc 100644
--- a/Makefile
+++ b/Makefile
@@ -126,6 +126,8 @@ unexport CDPATH
 
 #
 
+build := -f $(TOPDIR)/scripts/Makefile.build -C
+
 # The tools are needed early, so put this first
 # Don't include stuff already done in $(LIBS)
 # The examples conditionally depend on U-Boot (say, when USE_PRIVATE_LIBGCC
@@ -362,8 +364,6 @@ endif
 endif
 endif
 
-build := -f $(TOPDIR)/scripts/Makefile.build -C
-
 all:   $(ALL-y) $(SUBDIR_EXAMPLES-y)
 
 $(obj)u-boot.dtb:  checkdtc $(obj)u-boot
@@ -558,7 +558,10 @@ $(OBJS):
 $(LIBS):   depend $(SUBDIR_TOOLS)
$(MAKE) $(build) $(dir $(subst $(obj),,$@))
 
-$(SUBDIRS):depend
+tools: depend
+   $(MAKE) $(build) $@ all
+
+$(filter-out tools,$(SUBDIRS)):depend
$(MAKE) -C $@ all
 
 $(SUBDIR_EXAMPLES-y): $(obj)u-boot
@@ -711,7 +714,7 @@ depend dep tags ctags etags cscope $(obj)System.map:
@ exit 1
 
 tools: $(VERSION_FILE) $(TIMESTAMP_FILE)
-   $(MAKE) -C $@ all
+   $(MAKE) $(build) $@ all
 endif  # config.mk
 
 # ARM relocations should all be R_ARM_RELATIVE (32-bit) or
@@ -746,14 +749,15 @@ $(TIMESTAMP_FILE):
@cmp -s $@ $@.tmp  rm -f $@.tmp || mv -f $@.tmp $@
 
 easylogo env gdb:
-   $(MAKE) -C tools/$@ all MTD_VERSION=${MTD_VERSION}
+   $(MAKE) $(build) tools/$@ MTD_VERSION=${MTD_VERSION}
+
 gdbtools: gdb
 
 xmldocs pdfdocs psdocs htmldocs mandocs: tools/kernel-doc/docproc
$(MAKE) U_BOOT_VERSION=$(U_BOOT_VERSION) -C doc/DocBook/ $@
 
 tools-all: easylogo env gdb $(VERSION_FILE) $(TIMESTAMP_FILE)
-   $(MAKE) -C tools HOST_TOOLS_ALL=y
+   $(MAKE) $(build) tools HOST_TOOLS_ALL=y
 
 .PHONY : CHANGELOG
 CHANGELOG:
@@ -798,7 +802,7 @@ clean:
   $(obj)tools/gen_eth_addr$(obj)tools/img2srec   \
   $(obj)tools/dump{env,}image\
   $(obj)tools/mk{env,}image   $(obj)tools/mpc86x_clk \
-  $(obj)tools/mk{$(BOARD),}spl   \
+  $(obj)tools/mk{$(BOARD),exynos}spl \
   $(obj)tools/mxsboot\
   $(obj)tools/ncb $(obj)tools/ubsha1 \
   $(obj)tools/kernel-doc/docproc \
diff --git a/config.mk b/config.mk
index 60e297a..07afb35 100644
--- a/config.mk
+++ b/config.mk
@@ -58,7 +58,6 @@ PLATFORM_LDFLAGS =
 
 HOSTCFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer \
  $(HOSTCPPFLAGS)
-HOSTSTRIP  = strip
 
 #
 # Mac OS X / Darwin's C preprocessor is 

[U-Boot] [PATCH v5 10/38] kbuild: import Kbuild.include from linux v3.12 tag

2014-01-17 Thread Masahiro Yamada
Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---

Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None

 scripts/Kbuild.include | 278 +
 1 file changed, 278 insertions(+)
 create mode 100644 scripts/Kbuild.include

diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include
new file mode 100644
index 000..547e15d
--- /dev/null
+++ b/scripts/Kbuild.include
@@ -0,0 +1,278 @@
+
+# kbuild: Generic definitions
+
+# Convenient variables
+comma   := ,
+squote  := '
+empty   :=
+space   := $(empty) $(empty)
+
+###
+# Name of target with a '.' as filename prefix. foo/bar.o = foo/.bar.o
+dot-target = $(dir $@).$(notdir $@)
+
+###
+# The temporary file to save gcc -MD generated dependencies must not
+# contain a comma
+depfile = $(subst $(comma),_,$(dot-target).d)
+
+###
+# filename of target with directory and extension stripped
+basetarget = $(basename $(notdir $@))
+
+###
+# filename of first prerequisite with directory and extension stripped
+baseprereq = $(basename $(notdir $))
+
+###
+# Escape single quote for use in echo statements
+escsq = $(subst $(squote),'\$(squote)',$1)
+
+###
+# Easy method for doing a status message
+   kecho := :
+ quiet_kecho := echo
+silent_kecho := :
+kecho := $($(quiet)kecho)
+
+###
+# filechk is used to check if the content of a generated file is updated.
+# Sample usage:
+# define filechk_sample
+#  echo $KERNELRELEASE
+# endef
+# version.h : Makefile
+#  $(call filechk,sample)
+# The rule defined shall write to stdout the content of the new file.
+# The existing file will be compared with the new one.
+# - If no file exist it is created
+# - If the content differ the new file is used
+# - If they are equal no change, and no timestamp update
+# - stdin is piped in from the first prerequisite ($) so one has
+#   to specify a valid file as first prerequisite (often the kbuild file)
+define filechk
+   $(Q)set -e; \
+   $(kecho) '  CHK $@';\
+   mkdir -p $(dir $@); \
+   $(filechk_$(1))  $  $@.tmp;  \
+   if [ -r $@ ]  cmp -s $@ $@.tmp; then  \
+   rm -f $@.tmp;   \
+   else\
+   $(kecho) '  UPD $@';\
+   mv -f $@.tmp $@;\
+   fi
+endef
+
+##
+# gcc support functions
+# See documentation in Documentation/kbuild/makefiles.txt
+
+# cc-cross-prefix
+# Usage: CROSS_COMPILE := $(call cc-cross-prefix, m68k-linux-gnu- m68k-linux-)
+# Return first prefix where a prefix$(CC) is found in PATH.
+# If no $(CC) found in PATH with listed prefixes return nothing
+cc-cross-prefix =  \
+   $(word 1, $(foreach c,$(1),   \
+   $(shell set -e;   \
+   if (which $(strip $(c))$(CC))  /dev/null 21 ; then \
+   echo $(c);\
+   fi)))
+
+# output directory for tests below
+TMPOUT := $(if $(KBUILD_EXTMOD),$(firstword $(KBUILD_EXTMOD))/)
+
+# try-run
+# Usage: option = $(call try-run, $(CC)...-o $$TMP,option-ok,otherwise)
+# Exit code chooses option. $$TMP is can be used as temporary file and
+# is automatically cleaned up.
+try-run = $(shell set -e;  \
+   TMP=$(TMPOUT)..tmp;   \
+   TMPO=$(TMPOUT)..o;\
+   if ($(1)) /dev/null 21;  \
+   then echo $(2);   \
+   else echo $(3);   \
+   fi; \
+   rm -f $$TMP $$TMPO)
+
+# as-option
+# Usage: cflags-y += $(call as-option,-Wa$(comma)-isa=foo,)
+
+as-option = $(call try-run,\
+   $(CC) $(KBUILD_CFLAGS) $(1) -c -x assembler /dev/null -o 
$$TMP,$(1),$(2))
+
+# as-instr
+# Usage: cflags-y += $(call as-instr,instr,option1,option2)
+
+as-instr = $(call try-run,\
+   printf %b\n $(1) | $(CC) $(KBUILD_AFLAGS) -c -x assembler -o 
$$TMP -,$(2),$(3))
+
+# cc-option
+# Usage: cflags-y += $(call cc-option,-march=winchip-c6,-march=i586)
+
+cc-option = $(call try-run,\
+   $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) $(1) -c -x c /dev/null -o 
$$TMP,$(1),$(2))
+
+# cc-option-yn
+# Usage: flag := $(call cc-option-yn,-march=winchip-c6)
+cc-option-yn = $(call try-run,\
+   $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) $(1) -c -x c /dev/null -o 
$$TMP,y,n)
+
+# cc-option-align
+# Prefix align with either -falign or -malign
+cc-option-align = $(subst -functions=0,,\
+   $(call cc-option,-falign-functions=0,-malign-functions=0))
+
+# cc-disable-warning
+# Usage: cflags-y += $(call cc-disable-warning,unused-but-set-variable)
+cc-disable-warning = $(call try-run,\
+   $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) -W$(strip $(1)) -c -x c 
/dev/null -o $$TMP,-Wno-$(strip $(1)))
+
+# cc-version
+# Usage gcc-ver := $(call cc-version)
+cc-version = $(shell $(CONFIG_SHELL) 

[U-Boot] [PATCH v5 24/38] kbuild: convert some make rules to Kbuild style

2014-01-17 Thread Masahiro Yamada
We can get Kbuild-ish log style like this:
  GEN include/autoconf.mk
  GEN include/autoconf.mk.dep

We do not need XECHO any more.

And also change checkstack target like Linux Kernel.

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

Changes in v5: None
Changes in v4:
  - Change checkstack target

Changes in v3: None
Changes in v2: None

 Makefile | 77 
 1 file changed, 43 insertions(+), 34 deletions(-)

diff --git a/Makefile b/Makefile
index ed431dd..0551e6e 100644
--- a/Makefile
+++ b/Makefile
@@ -201,12 +201,6 @@ export HOSTARCH HOSTOS
 VENDOR=
 
 #
-# Allow for silent builds
-ifeq (,$(findstring s,$(MAKEFLAGS)))
-XECHO = echo
-else
-XECHO = :
-endif
 
 # The tools are needed early, so put this first
 # Don't include stuff already done in $(LIBS)
@@ -908,10 +902,11 @@ TAG_SUBDIRS += include
 FIND := find
 FINDFLAGS := -L
 
+PHONY += checkstack
+
 checkstack:
-   $(CROSS_COMPILE)objdump -d u-boot \
-   `$(FIND) . -name u-boot-spl -print` | \
-   perl $(src)/scripts/checkstack.pl $(ARCH)
+   $(OBJDUMP) -d u-boot $$(find . -name u-boot-spl) | \
+   $(PERL) $(src)/scripts/checkstack.pl $(ARCH)
 
 tags ctags:
ctags -w -o ctags `$(FIND) $(FINDFLAGS) $(TAG_SUBDIRS) \
@@ -961,52 +956,63 @@ checkdtc:
 # This target actually generates 2 files; autoconf.mk and autoconf.mk.dep.
 # the dep file is only include in this top level makefile to determine when
 # to regenerate the autoconf.mk file.
+
+quiet_cmd_autoconf_dep = GEN $@
+  cmd_autoconf_dep = $(CC) -x c -DDO_DEPS_ONLY -M $(c_flags) \
+   -MQ include/autoconf.mk $(srctree)/include/common.h  $@ || rm $@
+
 include/autoconf.mk.dep: include/config.h include/common.h
-   @$(XECHO) Generating $@ ; \
-   : Generate the dependancies ; \
-   $(CC) -x c -DDO_DEPS_ONLY -M $(c_flags) \
-   -MQ include/autoconf.mk $(srctree)/include/common.h  $@ || \
-   rm $@
+   $(call cmd,autoconf_dep)
 
-include/autoconf.mk: include/config.h
-   @$(XECHO) Generating $@ ; \
-   : Extract the config macros ; \
+quiet_cmd_autoconf = GEN $@
+  cmd_autoconf = \
$(CPP) $(c_flags) -DDO_DEPS_ONLY -dM $(srctree)/include/common.h  
$@.tmp  \
-   sed -n -f $(srctree)/tools/scripts/define2mk.sed $@.tmp  $@; \
+   sed -n -f $(srctree)/tools/scripts/define2mk.sed $@.tmp  $@; \
rm $@.tmp
 
+include/autoconf.mk: include/config.h
+   $(call cmd,autoconf)
+
 # Auto-generate the spl-autoconf.mk file (which is included by all makefiles 
for SPL)
-include/tpl-autoconf.mk: include/config.h
-   @$(XECHO) Generating $@ ; \
-   : Extract the config macros ; \
+quiet_cmd_tpl-autoconf = GEN $@
+  cmd_tpl-autoconf = \
$(CPP) $(c_flags) -DCONFIG_TPL_BUILD  -DCONFIG_SPL_BUILD\
-DDO_DEPS_ONLY -dM $(srctree)/include/common.h  $@.tmp 
 \
sed -n -f $(srctree)/tools/scripts/define2mk.sed $@.tmp  $@; \
rm $@.tmp
 
-include/spl-autoconf.mk: include/config.h
-   @$(XECHO) Generating $@ ; \
-   : Extract the config macros ; \
+include/tpl-autoconf.mk: include/config.h
+   $(call cmd,tpl-autoconf)
+
+quiet_cmd_spl-autoconf = GEN $@
+  cmd_spl-autoconf = \
$(CPP) $(c_flags) -DCONFIG_SPL_BUILD -DDO_DEPS_ONLY -dM 
$(srctree)/include/common.h  $@.tmp  \
sed -n -f $(srctree)/tools/scripts/define2mk.sed $@.tmp  $@; \
rm $@.tmp
 
+include/spl-autoconf.mk: include/config.h
+   $(call cmd,spl-autoconf)
+
+quiet_cmd_offsets = GEN $@
+  cmd_offsets = $(srctree)/tools/scripts/make-asm-offsets $ $@
+
 include/generated/generic-asm-offsets.h: lib/asm-offsets.s
-   @$(XECHO) Generating $@
-   $(srctree)/tools/scripts/make-asm-offsets lib/asm-offsets.s $@
+   $(call cmd,offsets)
 
-lib/asm-offsets.s: include/config.h $(srctree)/lib/asm-offsets.c
-   @mkdir -p lib
-   $(CC) -DDO_DEPS_ONLY \
+quiet_cmd_asm-offsets.s = CC  $@
+  cmd_asm-offsets.s = mkdir -p lib; \
+   $(CC) -DDO_DEPS_ONLY \
$(c_flags) $(CFLAGS_$(BCURDIR)/$(@F)) $(CFLAGS_$(BCURDIR)) \
-   -o $@ $(srctree)/lib/asm-offsets.c -c -S
+   -o $@ $ -c -S
+
+lib/asm-offsets.s: $(srctree)/lib/asm-offsets.c include/config.h
+   $(call cmd,asm-offsets.s)
 
 include/generated/asm-offsets.h: $(CPUDIR)/$(SOC)/asm-offsets.s
-   @$(XECHO) Generating $@
-   $(srctree)/tools/scripts/make-asm-offsets 
$(CPUDIR)/$(SOC)/asm-offsets.s $@
+   $(call cmd,offsets)
 
-$(CPUDIR)/$(SOC)/asm-offsets.s:include/config.h
-   @mkdir -p $(CPUDIR)/$(SOC)
+quiet_cmd_soc_asm-offsets.s = CC  $@
+  cmd_soc_asm-offsets.s = mkdir -p $(CPUDIR)/$(SOC); \
if [ -f $(srctree)/$(CPUDIR)/$(SOC)/asm-offsets.c ];then \

[U-Boot] [PATCH v5 18/38] kbuild: add dummy obj-y to create built-in.o

2014-01-17 Thread Masahiro Yamada
We are going to switch over to Kbuild in upcoming commits.

Each makefile must have non-empty obj- or obj-y
to generate built-in.o on Kbuild.

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

Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None

 arch/arm/cpu/armv7/tegra114/Makefile | 3 ++-
 arch/arm/cpu/armv7/tegra30/Makefile  | 3 ++-
 arch/nds32/cpu/n1213/Makefile| 3 +++
 board/freescale/common/Makefile  | 5 -
 board/samsung/origen/Makefile| 3 +++
 board/samsung/smdkv310/Makefile  | 3 +++
 board/spear/common/Makefile  | 5 -
 board/spear/x600/Makefile| 5 -
 8 files changed, 25 insertions(+), 5 deletions(-)

diff --git a/arch/arm/cpu/armv7/tegra114/Makefile 
b/arch/arm/cpu/armv7/tegra114/Makefile
index 886b509..77e2319 100644
--- a/arch/arm/cpu/armv7/tegra114/Makefile
+++ b/arch/arm/cpu/armv7/tegra114/Makefile
@@ -17,4 +17,5 @@
 # along with this program.  If not, see http://www.gnu.org/licenses/.
 #
 
-obj- :=
+# necessary to create built-in.o
+obj- := __dummy__.o
diff --git a/arch/arm/cpu/armv7/tegra30/Makefile 
b/arch/arm/cpu/armv7/tegra30/Makefile
index 518d6d1..413eba1 100644
--- a/arch/arm/cpu/armv7/tegra30/Makefile
+++ b/arch/arm/cpu/armv7/tegra30/Makefile
@@ -17,4 +17,5 @@
 # along with this program.  If not, see http://www.gnu.org/licenses/.
 #
 
-obj- :=
+# necessary to create built-in.o
+obj- := __dummy__.o
diff --git a/arch/nds32/cpu/n1213/Makefile b/arch/nds32/cpu/n1213/Makefile
index bb3550e..206d304 100644
--- a/arch/nds32/cpu/n1213/Makefile
+++ b/arch/nds32/cpu/n1213/Makefile
@@ -9,4 +9,7 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
+# necessary to create built-in.o
+obj- := __dummy__.o
+
 extra-y= start.o
diff --git a/board/freescale/common/Makefile b/board/freescale/common/Makefile
index 25f063d..f6a0879 100644
--- a/board/freescale/common/Makefile
+++ b/board/freescale/common/Makefile
@@ -13,7 +13,10 @@ MINIMAL=y
 endif
 endif
 
-ifndef MINIMAL
+ifdef MINIMAL
+# necessary to create built-in.o
+obj- := __dummy__.o
+else
 obj-$(CONFIG_FSL_CADMUS)   += cadmus.o
 obj-$(CONFIG_FSL_VIA)  += cds_via.o
 obj-$(CONFIG_FMAN_ENET)+= fman.o
diff --git a/board/samsung/origen/Makefile b/board/samsung/origen/Makefile
index 37acba7..1add9fe 100644
--- a/board/samsung/origen/Makefile
+++ b/board/samsung/origen/Makefile
@@ -5,6 +5,9 @@
 #
 
 ifdef CONFIG_SPL_BUILD
+# necessary to create built-in.o
+obj- := __dummy__.o
+
 hostprogs-y := tools/mkorigenspl
 always := $(hostprogs-y)
 
diff --git a/board/samsung/smdkv310/Makefile b/board/samsung/smdkv310/Makefile
index 9e37b4e..de0da16 100644
--- a/board/samsung/smdkv310/Makefile
+++ b/board/samsung/smdkv310/Makefile
@@ -5,6 +5,9 @@
 #
 
 ifdef CONFIG_SPL_BUILD
+# necessary to create built-in.o
+obj- := __dummy__.o
+
 hostprogs-y := tools/mksmdkv310spl
 always := $(hostprogs-y)
 else
diff --git a/board/spear/common/Makefile b/board/spear/common/Makefile
index 08dc09f..b0ba320 100644
--- a/board/spear/common/Makefile
+++ b/board/spear/common/Makefile
@@ -5,7 +5,10 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-ifndef CONFIG_SPL_BUILD
+ifdef CONFIG_SPL_BUILD
+# necessary to create built-in.o
+obj- := __dummy__.o
+else
 obj-y  := spr_misc.o
 obj-y  += spr_lowlevel_init.o
 endif
diff --git a/board/spear/x600/Makefile b/board/spear/x600/Makefile
index f9053fe..18d3dd2 100644
--- a/board/spear/x600/Makefile
+++ b/board/spear/x600/Makefile
@@ -5,6 +5,9 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-ifndef CONFIG_SPL_BUILD
+ifdef CONFIG_SPL_BUILD
+# necessary to create built-in.o
+obj- := __dummy__.o
+else
 obj-y  := fpga.o x600.o
 endif
-- 
1.8.3.2

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


[U-Boot] [PATCH v5 07/38] Makfile: move suffix rules to Makefile.build

2014-01-17 Thread Masahiro Yamada
This commit moves suffix rules from config.mk
to scripts/Makefile.build, which will allow us
to switch smoothly to real Kbuild.

Note1:
post/lib_powerpc/fpu/Makefile has
its own rule to compile C sources.
We need to tweak it to keep the same behavior.

Note2:
There are two file2 with the same name:
arch/arm/lib/crt0.S and eamples/api/crt0.S.
To keep the same build behavior,
examples/api/Makefile also has to be treaked.

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

Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None

 config.mk | 35 ---
 examples/api/Makefile |  4 ++--
 post/lib_powerpc/fpu/Makefile |  2 +-
 scripts/Makefile.build| 31 +++
 4 files changed, 34 insertions(+), 38 deletions(-)

diff --git a/config.mk b/config.mk
index 07afb35..b08be7a 100644
--- a/config.mk
+++ b/config.mk
@@ -318,38 +318,3 @@ endif
 export HOSTCC HOSTCFLAGS HOSTLDFLAGS CROSS_COMPILE \
AS LD CC CPP AR NM STRIP OBJCOPY OBJDUMP MAKE
 export CONFIG_SYS_TEXT_BASE PLATFORM_CPPFLAGS PLATFORM_RELFLAGS CPPFLAGS 
CFLAGS AFLAGS
-
-#
-
-# Allow boards to use custom optimize flags on a per dir/file basis
-ALL_AFLAGS = $(AFLAGS) $(AFLAGS_$(BCURDIR)/$(@F)) $(AFLAGS_$(BCURDIR))
-ALL_CFLAGS = $(CFLAGS) $(CFLAGS_$(BCURDIR)/$(@F)) $(CFLAGS_$(BCURDIR))
-EXTRA_CPPFLAGS = $(CPPFLAGS_$(BCURDIR)/$(@F)) $(CPPFLAGS_$(BCURDIR))
-ALL_CFLAGS += $(EXTRA_CPPFLAGS)
-
-# The _DEP version uses the $ file target (for dependency generation)
-# See rules.mk
-EXTRA_CPPFLAGS_DEP = $(CPPFLAGS_$(BCURDIR)/$(addsuffix .o,$(basename $))) \
-   $(CPPFLAGS_$(BCURDIR))
-$(obj)%.s: %.S
-   $(CPP) $(ALL_AFLAGS) -o $@ $
-$(obj)%.o: %.S
-   $(CC)  $(ALL_AFLAGS) -o $@ $ -c
-$(obj)%.o: %.c
-ifneq ($(CHECKSRC),0)
-   $(CHECK) $(CHECKFLAGS) $(ALL_CFLAGS) $
-endif
-   $(CC)  $(ALL_CFLAGS) -o $@ $ -c
-$(obj)%.i: %.c
-   $(CPP) $(ALL_CFLAGS) -o $@ $ -c
-$(obj)%.s: %.c
-   $(CC)  $(ALL_CFLAGS) -o $@ $ -c -S
-
-#
-
-# If the list of objects to link is empty, just create an empty built-in.o
-cmd_link_o_target = $(if $(strip $1),\
- $(LD) $(LDFLAGS) -r -o $@ $1,\
- rm -f $@; $(AR) rcs $@ )
-
-#
diff --git a/examples/api/Makefile b/examples/api/Makefile
index f770859..52f4368 100644
--- a/examples/api/Makefile
+++ b/examples/api/Makefile
@@ -50,9 +50,9 @@ $(obj)demo.bin: $(obj)demo
$(OBJCOPY) -O binary $ $@ 2/dev/null
 
 # Rule to build generic library C files
-$(obj)%.o: $(SRCTREE)/lib/%.c
+$(addprefix $(obj),$(notdir $(EXT_COBJ_FILES-y))): $(obj)%.o: 
$(SRCTREE)/lib/%.c
$(CC) -g $(CFLAGS) -c -o $@ $
 
 # Rule to build architecture-specific library assembly files
-$(obj)%.o: $(SRCTREE)/arch/$(ARCH)/lib/%.S
+$(addprefix $(obj),$(notdir $(EXT_SOBJ_FILES-y))): $(obj)%.o: 
$(SRCTREE)/arch/$(ARCH)/lib/%.S
$(CC) -g $(CFLAGS) -c -o $@ $
diff --git a/post/lib_powerpc/fpu/Makefile b/post/lib_powerpc/fpu/Makefile
index ae56a82..a7aa5bc 100644
--- a/post/lib_powerpc/fpu/Makefile
+++ b/post/lib_powerpc/fpu/Makefile
@@ -18,7 +18,7 @@ obj-y += darwin-ldouble.o
 CFLAGS := $(shell echo $(CFLAGS) | sed s/-msoft-float//)
 CFLAGS += -mhard-float -fkeep-inline-functions
 
-$(obj)%.o: %.c
+$(addprefix $(obj),$(obj-y)): $(obj)%.o:   %.c
$(CC)  $(ALL_CFLAGS) -o $@.fp $ -c
$(OBJCOPY) -R .gnu.attributes $@.fp $@
rm -f $@.fp
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index 50c0394..1b3d77f 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -67,6 +67,37 @@ endif
 
 #
 
+# Allow boards to use custom optimize flags on a per dir/file basis
+ALL_AFLAGS = $(AFLAGS) $(AFLAGS_$(BCURDIR)/$(@F)) $(AFLAGS_$(BCURDIR))
+ALL_CFLAGS = $(CFLAGS) $(CFLAGS_$(BCURDIR)/$(@F)) $(CFLAGS_$(BCURDIR))
+EXTRA_CPPFLAGS = $(CPPFLAGS_$(BCURDIR)/$(@F)) $(CPPFLAGS_$(BCURDIR))
+ALL_CFLAGS += $(EXTRA_CPPFLAGS)
+
+# The _DEP version uses the $ file target (for dependency generation)
+# See rules.mk
+EXTRA_CPPFLAGS_DEP = $(CPPFLAGS_$(BCURDIR)/$(addsuffix .o,$(basename $))) \
+   $(CPPFLAGS_$(BCURDIR))
+$(obj)%.s: %.S
+   $(CPP) $(ALL_AFLAGS) -o $@ $
+$(obj)%.o: %.S
+   $(CC)  $(ALL_AFLAGS) -o $@ $ -c
+$(obj)%.o: %.c
+ifneq ($(CHECKSRC),0)
+   $(CHECK) $(CHECKFLAGS) $(ALL_CFLAGS) $
+endif
+   $(CC)  $(ALL_CFLAGS) -o $@ $ -c
+$(obj)%.i: %.c
+   $(CPP) $(ALL_CFLAGS) -o $@ $ -c
+$(obj)%.s: %.c
+   $(CC)  $(ALL_CFLAGS) -o $@ $ -c -S
+
+# If the list of objects to link is empty, just create an empty built-in.o
+cmd_link_o_target = $(if $(strip $1),\
+ $(LD) 

[U-Boot] [PATCH v5 33/38] kbuild: use scripts/Makefile.clean

2014-01-17 Thread Masahiro Yamada
This commit refactors cleaning targets such as
clean, clobber, mrpropper, distclean
with scripts/Makefile.clean.

By using scripts/Makefile.clean, we can recursively descend
into subdirectories and delete generated files there.

We do not need add a big list of generated files
to the clean target.

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

We can delete ugly stuff like follows:

  clean:
@rm -f examples/standalone/atmel_df_pow2  \
   examples/standalone/hello_world\
   examples/standalone/interrupt  \
   examples/standalone/mem_to_mem_idma2intr   \
   examples/standalone/sched  \
   $(addprefix examples/standalone/, smc9_eeprom 
smc911x_eeprom) \
   examples/standalone/test_burst \
   examples/standalone/timer
@rm -f $(addprefix examples/api/, demo demo.bin)
@rm -f tools/bmp_logo  tools/easylogo/easylogo\
   tools/env/fw_printenv  \
   tools/envcrc   \
   $(addprefix tools/gdb/, gdbcont gdbsend)   \
   tools/gen_eth_addrtools/img2srec   \
   tools/dumpimage\
   $(addprefix tools/, mkenvimage mkimage)\
   tools/mpc86x_clk   \
   $(addprefix tools/, mk$(BOARD)spl mkexynosspl) \
   tools/mxsboot  \
   tools/ncb   tools/ubsha1   \
   tools/kernel-doc/docproc   \
   tools/proftool
@rm -f $(addprefix board/cray/L1/, bootscript.c bootscript.image) \
   board/matrix_vision/*/bootscript.img   \
   spl/board/samsung/$(BOARD)/tools/mk$(BOARD)spl \
   u-boot.lds \
   $(addprefix arch/blackfin/cpu/, init.lds init.elf)
   $(obj)arch/blackfin/cpu/init.{lds,elf}

By the way, I am keeping make clobber for now.
Do we need make clobber?
If we like 3-level cleaning targets, clean, mrproper, distclean,
like Linux Kernel, we can squash clobber to clean.


Changes in v5:
  - Remove *.imx and *.map files by pattern matching.
  - Remove u-boot.elf

Changes in v4: None
Changes in v3: None
Changes in v2:
  - Rebase on v2014.01-rc2 tag

 Makefile   | 188 +
 arch/blackfin/cpu/Makefile |   1 +
 board/cray/L1/Makefile |   2 +
 dts/Makefile   |  12 +--
 scripts/Makefile   |   2 +
 scripts/Makefile.clean |   4 +
 6 files changed, 121 insertions(+), 88 deletions(-)
 create mode 100644 scripts/Makefile

diff --git a/Makefile b/Makefile
index 92a0a4b..04368cf 100644
--- a/Makefile
+++ b/Makefile
@@ -,93 +,106 @@ include/license.h: tools/bin2header COPYING
cat COPYING | gzip -9 -c | ./tools/bin2header license_gzip  
include/license.h
 #
 
+###
+# Cleaning is done on three levels.
+# make clean Delete most generated files
+#Leave enough to build external modules
+# make mrproper  Delete the current configuration, and all generated files
+# make distclean Remove editor backup files, patch leftover files and the like
+
+# Directories  files removed with 'make clean'
+CLEAN_DIRS  += $(MODVERDIR)
+CLEAN_FILES += u-boot.lds include/bmp_logo.h include/bmp_logo_data.h \
+   board/*/config.tmp board/*/*/config.tmp dts/*.tmp \
+   include/autoconf.mk include/autoconf.mk.dep \
+   include/spl-autoconf.mk include/tpl-autoconf.mk
+
+# Directories  files removed with 'make clobber'
+CLOBBER_DIRS  += tpl \
+$(patsubst %/,spl/%, $(filter-out Makefile, $(filter %/, \
+   $(shell ls -1 --file-type spl 2/dev/null
+CLOBBER_FILES += u-boot u-boot.elf u-boot.hex u-boot.img  \
+u-boot.kwb u-boot.pbl u-boot.ldr \
+u-boot.ubl u-boot.ais u-boot.dtb \
+u-boot.sb u-boot.spr MLO MLO.byteswap SPL \
+$(patsubst %,spl/%, $(filter-out Makefile %/, \
+   $(shell ls -1 --file-type spl 2/dev/null))) \
+$(addprefix nand_spl/, u-boot.lds u-boot.lst \
+u-boot-nand_spl.lds u-boot-spl)
+
+# Directories  files removed with 'make mrproper'
+MRPROPER_DIRS  += include/config include/generated
+MRPROPER_FILES += .config .config.old \
+ tags TAGS cscope* GPATH GTAGS 

[U-Boot] [PATCH v5 13/38] Makefile: refactor include path settings

2014-01-17 Thread Masahiro Yamada
This commit merges commonly-used header include paths
to UBOOTINCLUDE and NOSTDINC_FLAGS variables, which are placed
at the top Makefile.

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

Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None

 Makefile   | 14 +-
 config.mk  | 11 ++-
 tools/Makefile |  8 +++-
 tools/env/Makefile |  4 +---
 4 files changed, 19 insertions(+), 18 deletions(-)

diff --git a/Makefile b/Makefile
index 7f950c5..d7c71f0 100644
--- a/Makefile
+++ b/Makefile
@@ -226,6 +226,15 @@ CHECK  = sparse
 CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \
  -Wbitwise -Wno-return-void -D__CHECK_ENDIAN__ $(CF)
 
+# Use UBOOTINCLUDE when you must reference the include/ directory.
+# Needed to be compatible with the O= option
+UBOOTINCLUDE:=
+ifneq ($(OBJTREE),$(SRCTREE))
+UBOOTINCLUDE   += -I$(OBJTREE)/include
+endif
+UBOOTINCLUDE   += -I$(srctree)/include \
+   -I$(srctree)/arch/$(ARCH)/include
+
 KBUILD_CPPFLAGS := -D__KERNEL__
 
 KBUILD_CFLAGS   := -Wall -Wstrict-prototypes \
@@ -238,7 +247,7 @@ export CPP AR NM LDR STRIP OBJCOPY OBJDUMP
 export MAKE AWK
 export DTC CHECK CHECKFLAGS
 
-export KBUILD_CPPFLAGS
+export KBUILD_CPPFLAGS NOSTDINC_FLAGS UBOOTINCLUDE
 export KBUILD_CFLAGS KBUILD_AFLAGS
 
 KBUILD_CFLAGS += -Os #-fomit-frame-pointer
@@ -254,6 +263,9 @@ KBUILD_CFLAGS   += -g
 # option to the assembler.
 KBUILD_AFLAGS  += -g
 
+NOSTDINC_FLAGS += -nostdinc -isystem $(shell $(CC) -print-file-name=include)
+CHECKFLAGS += $(NOSTDINC_FLAGS)
+
 # Report stack usage if supported
 KBUILD_CFLAGS += $(call cc-option,-fstack-usage)
 
diff --git a/config.mk b/config.mk
index 04b63f6..f700ee1 100644
--- a/config.mk
+++ b/config.mk
@@ -94,8 +94,6 @@ RELFLAGS= $(PLATFORM_RELFLAGS)
 
 OBJCFLAGS += --gap-fill=0xff
 
-gccincdir := $(shell $(CC) -print-file-name=include)
-
 CPPFLAGS = $(KBUILD_CPPFLAGS) $(RELFLAGS)
 
 # Enable garbage collection of un-used sections for SPL
@@ -123,13 +121,8 @@ Please undefined CONFIG_SYS_GENERIC_BOARD in your board 
config file)
 endif
 endif
 
-ifneq ($(OBJTREE),$(SRCTREE))
-CPPFLAGS += -I$(OBJTREE)/include
-endif
-
-CPPFLAGS += -I$(TOPDIR)/include -I$(SRCTREE)/arch/$(ARCH)/include
-CPPFLAGS += -nostdinc  \
-   -isystem $(gccincdir) -pipe $(PLATFORM_CPPFLAGS)
+CPPFLAGS += $(UBOOTINCLUDE)
+CPPFLAGS += $(NOSTDINC_FLAGS) -pipe $(PLATFORM_CPPFLAGS)
 
 CFLAGS := $(KBUILD_CFLAGS) $(CPPFLAGS)
 
diff --git a/tools/Makefile b/tools/Makefile
index c3cdaf0..21341b7 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -175,11 +175,9 @@ HOSTSRCS += $(addprefix 
$(SRCTREE)/lib/libfdt/,$(LIBFDT_OBJ_FILES-y:.o=.c))
 # Define _GNU_SOURCE to obtain the getline prototype from stdio.h
 #
 HOST_EXTRACFLAGS += -include $(SRCTREE)/include/libfdt_env.h \
-   -idirafter $(SRCTREE)/include \
-   -idirafter $(SRCTREE)/arch/$(ARCH)/include \
-   -idirafter $(OBJTREE)/include \
-   -I $(SRCTREE)/lib/libfdt \
-   -I $(SRCTREE)/tools \
+   $(patsubst -I%,-idirafter%, $(UBOOTINCLUDE)) \
+   -I$(SRCTREE)/lib/libfdt \
+   -I$(SRCTREE)/tools \
-DCONFIG_SYS_TEXT_BASE=$(CONFIG_SYS_TEXT_BASE) \
-DUSE_HOSTCC \
-D__KERNEL_STRICT_NAMES \
diff --git a/tools/env/Makefile b/tools/env/Makefile
index c303815..d47fe16 100644
--- a/tools/env/Makefile
+++ b/tools/env/Makefile
@@ -6,9 +6,7 @@
 #
 
 # Compile for a hosted environment on the target
-HOST_EXTRACFLAGS  = -idirafter $(SRCTREE)/include \
-   -idirafter $(SRCTREE)/arch/$(ARCH)/include \
-   -idirafter $(OBJTREE)/include \
+HOST_EXTRACFLAGS  = $(patsubst -I%,-idirafter%, $(UBOOTINCLUDE)) \
-idirafter $(SRCTREE)/tools/env \
-DUSE_HOSTCC \
-DTEXT_BASE=$(TEXT_BASE)
-- 
1.8.3.2

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


Re: [U-Boot] Fwd: Re: Boot Linux kernel with initramfs fails

2014-01-17 Thread Jean-baptiste DURONEA

I'll try to have linux support so.

Thank you.

Regards,


Le 17/01/2014 12:07, Wolfgang Denk a écrit :

Dear Jean-Baptiste,

In message 52d8fbf8.2060...@gmail.com you wrote:

I forgot some explanations, sorry about that.

I refer to this problem :
http://lists.denx.de/pipermail/u-boot/2013-July/159055.html

And there you wrote:

| When I boot Linux kernel with FIT Image, the kernel does not unpacking 
initramfs.
| ( The root cause is initrd_start is NULL.)
|
| The initramfs is built-in with kernel, so I don't specify ramdisk in my
| kernel.its file.

initramfs handling is internal to Linux.  This is not a problem with
U-Boot.

Check how you build your kernel image and make sure the initramfs
image (and a working one) gets processed there.


Best regards,

Wolfgang Denk



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


Re: [U-Boot] U-boot memory test results

2014-01-17 Thread Heiko Schocher

Hello aryanlak,

Am 17.01.2014 09:11, schrieb aryanlak:

Hi all,

I want to perform memory test (FLASH) during U-boot and read the results
after the operating system (Linux) is booted up.
Is it possible? If so, can anyone guide me to do so?


On which plattform do you want to try this?

You can activate CONFIG_LOGBUFFER in your board config file, and
try it, grep for CONFIG_LOGBUFFER for examples. The enbw_cmc is
a good example for an arm plattform, but you need also adaptions in
your Linux kernel, as this is not supported in mainline kernel! See
here a try to bring it into mainline

http://lwn.net/Articles/501425/

But this patch does not longer works for newer kernels, as logbuffer
handling had changed ... so maybe, you have to do a complete rework ...

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] board_r - fixup functions table after relocation

2014-01-17 Thread Tom Rini
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 01/16/2014 07:06 PM, Alexey Brodkin wrote:
 On Fri, 2014-01-17 at 00:40 +0400, Alexey Brodkin wrote:
 On Thu, 2014-01-16 at 21:27 +0100, Albert ARIBAUD wrote:
 
 Well, I've just realized that very similar thing is done in 
 fixup_cmdtable.
 
 So I believe with addition of CONFIG_NEEDS_MANUAL_RELOC wrapper my 
 change may make some sense.
 
 Any comments/thoughts?

Yes, with a wrapper on CONFIG_NEEDS_MANUAL_RELOC this patch sounds
right.  Thanks!

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

iQIcBAEBAgAGBQJS2Sf1AAoJENk4IS6UOR1WYRMP/1SYow+7k5RITcITfPcd7eOR
2dkduJhxGh02vz50/9oWsN2jBIOJq8CddtT+N77+PVCbJf96Tgm4bVju/TcmMwwr
9xFBr7cZmHtVkgB2bb3iZN/KkMwRF9d26QMDr3hiPKYVCN7appHDe3TCwWuQopbp
BjcKhOF+IWDb7qzzsRdgghaWz5hFqnNFMBBtszhdOLGkdEF3be7MwqPqcOsUN59p
J6BnI8C7q/A/uQC22kHIhaofQaYel+mEgMOqzdqrUopM1NzFZ7eX36kyQYoZn5Hl
DVVmeskj9OqOrGPMMU9DrJqWdD8gQ35cgScrkIhy0x0gtN2DX0YF49CDBu95MEHX
5oMDB/eIARNtrL5gwAiNGKug7TXvnqwIYpXedH1vMXLkafAyIiOD6aDik+DB+CTl
Jd1OfzrtzhMxy/vLkyxNReh6CTJj0zsAmjeksiaYl+WFJ1HNdmoThwZU2s6KG00n
pYaeQUgDaysHG1x2HPcx88zGkPlHLpRP5jy75PSJG9dsIBpVL29O9oj1sqKqoGl1
7sdSbfA7YFBSAlNjO5j4zsKDl5WxUx0kgWnPRhLJ+oU1SloFN6i5x9vn8cVXz8Bq
3u8pPsb9iyVDfUgXHzkNy7VwLiWToMtSSGhuuzttzFEe/2IkyG+vgnAFf/J4qHQj
J0UdIk4Ha52fkLM5Q4uu
=CWdX
-END PGP SIGNATURE-
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 0/11] Change some boards to use zImage in default environment

2014-01-17 Thread Marek Vasut
On Thursday, January 16, 2014 at 11:14:44 PM, Wolfgang Denk wrote:
 Dear Otavio Salvador,
 
 In message 1389909486-12880-1-git-send-email-ota...@ossystems.com.br you 
wrote:
  This patchset does as stated in the subject. It has been build tested
 
  as can be seen below:
 What is the motivation for this change?  Using zImage is - from the
 technical point of view - the poorest of the available choices.  If
 you are not happy with using uImages, then why do you not move forward
 and use FIT images?

I am with you here. zImage is not a good format, since it's inflexible and not 
protected by anything (no checksum etc) at all. For deployment, it's even more 
poor choice.

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


Re: [U-Boot] Pull request: u-boot-arm/master - UPDATED

2014-01-17 Thread Tom Rini
On Thu, Jan 16, 2014 at 10:47:18AM +0100, Albert ARIBAUD wrote:

 Hello Tom,
 
 This is an update which replaces the previous PR which had only imx
 stuff.
 
 The following changes since commit
 6ba2bc8fa9be4bd09ec43e39cb8e666480ef010c:
 
   arm: use canonical sub mnemonic (2014-01-14 12:38:47 +0100)
 
 are available in the git repository at:
 
   git://git.denx.de/u-boot-arm master
 
 for you to fetch changes up to c71b4dd2da0dcddabd7c29e6c3dc8a495d4bd928:
 
   arm: koelsch: Add support QSPI device and enable boot from SPI flash
   (2014-01-16 08:07:20 +0900)
 
 
 Albert ARIBAUD (1):
   Merge branch 'u-boot-imx/master' into 'u-boot-arm/master'
 
 Fabio Estevam (2):
   mx6: clock: Pass the frequency as argument of
 enable_fec_anatop_clock() mx6: Add initial support for the Hummingboard
 solo
 
 Nobuhiro Iwamatsu (6):
   arm: koelsch: Disable TMU0 before OS boot
   arm: lager: Disable TMU0 before OS boot
   arm: rmobile: Add SH QSPI base register address
   spi: sh_qspi: Add header file that defines the address of
 registers arm: lager: Add support QSPI device and enable boot from SPI
 flash arm: koelsch: Add support QSPI device and enable boot from SPI
 flash
 
  arch/arm/cpu/armv7/mx6/clock.c |   8 +-
  arch/arm/include/asm/arch-mx6/clock.h  |   9 +-
  arch/arm/include/asm/arch-mx6/imx-regs.h   |   4 +
  arch/arm/include/asm/arch-rmobile/r8a7790.h|   1 +
  arch/arm/include/asm/arch-rmobile/r8a7791.h|   1 +
  board/freescale/mx6slevk/mx6slevk.c|   2 +-
  board/renesas/koelsch/koelsch.c|   6 +
  board/renesas/lager/lager.c|   6 +
  board/solidrun/hummingboard/Makefile   |   9 +
  board/solidrun/hummingboard/README |  40 
  board/solidrun/hummingboard/hummingboard.c | 187
  + board/solidrun/hummingboard/solo.cfg
  |  25 +++ board/solidrun/mx6-microsom/800mhz_2x128mx16.cfg   |  74
  +++ board/solidrun/mx6-microsom/clocks.cfg |  33 +++
  .../mx6-microsom/ddr-800mhz-32bit-setup.cfg|  76 +++
  boards.cfg |   1 +
  drivers/spi/sh_qspi.c  |   3 +-
  include/configs/hummingboard.h | 226
  +
  include/configs/koelsch.h  |  32 ++-
  include/configs/lager.h|  33 ++- 20 files
  changed, 764 insertions(+), 12 deletions(-) create mode 100644
  board/solidrun/hummingboard/Makefile create mode 100644
  board/solidrun/hummingboard/README create mode 100644
  board/solidrun/hummingboard/hummingboard.c create mode 100644
  board/solidrun/hummingboard/solo.cfg create mode 100644
  board/solidrun/mx6-microsom/800mhz_2x128mx16.cfg create mode 100644
  board/solidrun/mx6-microsom/clocks.cfg create mode 100644
  board/solidrun/mx6-microsom/ddr-800mhz-32bit-setup.cfg create mode
  100644 include/configs/hummingboard.h

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [U-Boot, 1/3] config: Update envs for trats and trats2 - new entries for new partitions

2014-01-17 Thread Tom Rini
On Tue, Jan 14, 2014 at 08:02:24AM +0100, Łukasz Majewski wrote:

 This patch adds extra dfu_alt_info entries to support storing the whole BOOT
 , DATA and UMS partitions.
 This allows upgrade of uImage and device tree blob (dtb) files at once.
 
 Now it is also possible to store ext4 rootfs prepared with well established
 linux tools (like mkfs.ext4).
 
 Signed-off-by: Lukasz Majewski l.majew...@samsung.com
 Acked-by: Minkyu Kang mk7.k...@samsung.com

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [U-Boot, 2/3] ARM: trats2: dfu: Enable default Poll Timeout for Trats2 board

2014-01-17 Thread Tom Rini
On Tue, Jan 14, 2014 at 08:02:25AM +0100, Łukasz Majewski wrote:

 Provide default Poll Timeout value for Trats2 board.
 
 Signed-off-by: Lukasz Majewski l.majew...@samsung.com
 Acked-by: Minkyu Kang mk7.k...@samsung.com

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [U-Boot, v2] nand, gpmc: fix reading after switching ecc

2014-01-17 Thread Tom Rini
On Wed, Jan 15, 2014 at 05:58:54PM +0100, Jeroen Hofstee wrote:

 The omap_gpmc allows switching ecc at runtime. Since
 the NAND_SUBPAGE_READ flag is only set, it is kept when
 switching to hw ecc, which is not correct. This leads to
 calling chip-ecc.read_subpage which is not a valid
 pointer. Therefore clear the flag when switching ecc so
 reading in hw mode works again.
 
 Cc: Scott Wood scottw...@freescale.com
 Cc: Pekon Gupta pe...@ti.com
 Cc: Nikita Kiryanov nik...@compulab.co.il
 Signed-off-by: Jeroen Hofstee jer...@myspectrum.nl

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [U-Boot, 3/3] config: Update envs for trats and trats2 - Disable L2 cache

2014-01-17 Thread Tom Rini
On Tue, Jan 14, 2014 at 08:02:26AM +0100, Łukasz Majewski wrote:
 Disable L2 caches for Trats and Trats2 devices.
 
 It turns out that for data downloading with thordown command L2 cache
 disablement brings a significant speed improvement.
 
 rootfs - 400 MiB:
 - L2 cache enabled:   2.69 MiB/s
 - L2 cache disabled:  5.56 MiB/s
 
 Such improvement is possible due to reduction of the need to invalidate
 redundant data, which resides in L2 cache.
 
 Since the sent USB request size at once is 512B (L1 - 32 KiB in total) -
 one can be quite confident that it is already available in L1 and L2 can
 be disabled.
 
 Change-Id: I911ea18075526f7e8295c30dfcf7a658ebc4e53b
 Signed-off-by: Lukasz Majewski l.majew...@samsung.com
 Acked-by: Minkyu Kang mk7.k...@samsung.com

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] vexpress/armv8: Fix incorrect ethernet controller

2014-01-17 Thread Tom Rini
On Thu, Jan 16, 2014 at 09:47:40AM -0600, Bhupesh Sharma wrote:

 This patch enables ethernet support in ARMv8 foundation model. The ARMv8
 foundation model supports a SMSC91C111 integrated MAC and PHY module
 which is present at base address 0x01A00.
 
 The previous implementation had enabled SMSC9115 ethernet controller
 which is not present on the ARMv8 foundation model.
 
 Tested on ARMv8 foundation model v1 and v2 by running ping/tftp
 between the foundation model and the host PC via a bridged network.
 
 Signed-off-by: Bhupesh Sharma bhupesh.sha...@freescale.com

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] cosmetic: uImage.FIT: fix documents

2014-01-17 Thread Tom Rini
On Thu, Jan 16, 2014 at 11:05:23AM +0900, Masahiro Yamada wrote:

 - Fix the path to source_file_format.txt
   - Fix a minor typo
   - Fix the type for FIT blob: it must be flat_dt
 
 Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com

Applied to u-boot/master, thanks!

-- 
Tom


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


[U-Boot] Help with USB keyboards: EHCI timeout error

2014-01-17 Thread John Donnelly
HI ,
I am investigating an issue where some keyboards fail to enumerate  in
u-boot but they are available when Linux enumerates them .

USB0:   USB EHCI 1.00
scanning bus 0 for devices... EHCI timed out on TD - token=0x80008c80.


Any advice welcome .

-- 

*Regards,*
* John.*

*--*

*o* Energy-efficiency is #1 reason data centers look to expand.  -- Digital
Realty Trust
*o* Green Data Centers spending to increase 300% worldwide by 2016.  --
Pike Research
*o *Data Centers have become as vital to the functioni
ng of society as power stations.  -- The Economist
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Help with USB keyboards: EHCI timeout error

2014-01-17 Thread Wolfgang Denk
Dear John Donnelly,

In message cagtoqbsq3yzpvqcb1bowr8unyfowwopxpx-epnremamgu58...@mail.gmail.com 
you wrote:

 I am investigating an issue where some keyboards fail to enumerate  in
 u-boot but they are available when Linux enumerates them .

Hardware (which exact board/  configuration) ?

Software (which exact version of U-Boot) ?

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Today is the yesterday you worried about tomorrow.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/3] config: Update envs for trats and trats2 - new entries for new partitions

2014-01-17 Thread Gerhard Sittig
On Thu, Jan 16, 2014 at 23:12 +0100, Wolfgang Denk wrote:
 
 Dear Gerhard Sittig,
 
 In message 20140116161026.gx20...@book.gsilab.sittig.org you wrote:
 
  write something more portable (and more readable?) like
  
 PARTS_BOOT  part 0 5\0
 
 What would the  be needed for anyway?

It wouldn't.  It just was there before, and could remain there
since it does nothing (concatenates an empty string, like
adding zero, or multiplying by one -- sometimes it's nice for a
uniform layout, sometimes it's more confusing than helping).
Removing this neutral element is an option, yet not strictly
necessary.  I was more concerned about potential build breakage
than (function wise neutral) style issues.


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


Re: [U-Boot] booting os 'Unknown OS' (1) is not supported

2014-01-17 Thread Detlev Zundel
Hi Alexander,

 I faced with a strange behaviour of u-boot.

Expected behaviour for some people may seem strange to others ;)

 Few months ago i bought an ARM development board from yicsystem
 it's based on exynos 5250 and very similar to arndale
 http://www.yicsystem.com/products/low-cost-board/yse5250/

 And i can boot Android ICS
 but when i try to boot any linux
 i always see


 Checking Boot Mode ... SDMMC
 Now running in RAM - U-Boot at: c3e0
 REVISION: 1.0
 REVISION: 1.0
 MMC Device 0: 3839 MB
 NAME: S5P_MSHC0
 MMC Device 1: 7348 MB
 MMC Device 2 not found
 Destroy Hash Table: c3f80f78 table = (null)
 Create Hash Table: N=512
 INSERT: table c3f80f78, filled 1/521 rv c3d047a0 == name=baudrate
 value=115200
 INSERT: table c3f80f78, filled 2/521 rv c3d0582c == name=bootargs
 value=root=/dev/mmcblk0p1
 INSERT: table c3f80f78, filled 3/521 rv c3d04a1c == name=bootcmd
 value=movi read kernel 0 40008000;movi read rootfs 0 4100 10;bootm
 40008000 4100
 INSERT: table c3f80f78, filled 4/521 rv c3d04f20 == name=bootdelay
 value=3
 INSERT: table c3f80f78, filled 5/521 rv c3d04bfc == name=bootfile
 value=/tftpboot/revoboot/bin/revoboot.pxe
 INSERT: table c3f80f78, filled 6/521 rv c3d040a4 ==
 name=emmcbootrecovery value=mmc erase boot 1 0 0;emmc open 1;movi read
 fwbl1 0 4000;movi write zero fwbl1 1 4000;movi read bl2 0
 40004000;movi write zero bl2 1 40004000;movi read u-boot 0 4200;movi
 write zero u-boot 1 4200;movi read tzsw 0 4210;movi write zero tzsw
 1 4210;emmc close 1
 INSERT: table c3f80f78, filled 7/521 rv c3d04998 == name=ethact
 value=smc911x-0
 INSERT: table c3f80f78, filled 8/521 rv c3d0462c == name=ethaddr
 value=00:40:5c:26:0a:5b
 INSERT: table c3f80f78, filled 9/521 rv c3d057a8 == name=gatewayip
 value=192.168.0.1
 INSERT: table c3f80f78, filled 10/521 rv c3d05874 == name=ipaddr
 value=192.168.0.28
 INSERT: table c3f80f78, filled 11/521 rv c3d048c0 == name=netmask
 value=255.255.255.0
 INSERT: table c3f80f78, filled 12/521 rv c3d05214 == name=rootfslen
 value= 10
 INSERT: table c3f80f78, filled 13/521 rv c3d048e4 == name=serverip
 value=192.168.0.13
 INSERT: free(data = c3d00010)
 INSERT: done
 Net:   smc911x-0
 ### main_loop entered: bootdelay=3

 ### main_loop: bootcmd=movi read kernel 0 40008000;movi read rootfs 0
 4100 10;bootm 40008000 4100
 Hit any key to stop autoboot:  0
 reading kernel..device 0 Start 1063, Count 16384
 MMC read: dev # 0, block # 1063, count 16384 ... 16384 blocks read: OK
 completed
 reading RFS..device 0 Count 17447, Start 2048
 MMC read: dev # 0, block # 17447, count 2048 ... 2048 blocks read: OK
 completed
 ## Current stack ends at 0xc3cfbd98 *  kernel: cmdline image address =
 0x40008000
 ## Booting kernel from Legacy Image at 40008000 ...
Image Name:   Linux-3.12.0-rc1-armv7-x0.6-0012
Image Type:   ARM Linux Kernel Image (uncompressed)
Data Size:3243400 Bytes = 3167 KiB
Load Address: 40008000
Entry Point:  40008000
Verifying Checksum ... OK
kernel data at 0x40008040, len = 0x00317d88 (3243400)
 *  ramdisk: cmdline image address = 0x4100
 Wrong Ramdisk Image Format
ramdisk start = 0x4100, ramdisk end = 0x4100
XIP Kernel Image ... OK

This XIP points to a problem.  In essence I think you should try to
load your image to any address in RAM but _not_ to the load address
specified in the uImage.  The intention of this field is to tell U-Boot
where the uImage file - that could reside on nor flash for exmple -
should be loaded to in RAM before it is executed.  You have specified
4008000 at image creation time but already load uImage that has a
64-byte header prepended to that location.  U-Boot in term finds that
the image is alreday where it should be, does nothing and switches to
XIP mode and then gets pretty confused.

So again, try loading the image somewhere else in RAM and let U-Boot do
the copying to the correct place.

And even better, we consider uImages to be legacy for quite a while, so
please plan to switch to using FIT images sometime soon.

Cheers
  Detlev

-- 
This is  not the first  time my views  on some topic have  inspired in
someone the  desire to psychoanalyze me. Previous  experience leads me
to ask  about your couch. Is  it comfortable? Are its  springs in good
shape? -- Jonh McCarthy
--
DENX Software Engineering GmbH,  MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: d...@denx.de
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Compiling fw_printenv tool

2014-01-17 Thread Detlev Zundel
Hi Alexey,

[...]

 I've googled it and sorted it out. The problem was that executable was
 dynamically linked and the *.so was not found on the embedded
 system. I compiled it with -static and it runs.

I'm glad you solved the problem.  I only like for such answers to show
up in archives so that other people can profit from the answer in
DuckDuckGo searches yet to come ;)

Cheers
  Detlev

-- 
Our choice isn't between a digital world where the NSA can eavesdrop and one
where the NSA is prevented from eavesdropping; it's between a digital world
that is vulnerable to allattackers, and one that is secure for all users.
  -- Bruce Schneier
--
DENX Software Engineering GmbH,  MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: d...@denx.de
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Compiling fw_printenv tool

2014-01-17 Thread Detlev Zundel
Hi Masahiro-san,

  How do I cross compile it for my embedded system? Do I just set the
  HOSTCC environment variable in the Makefile?
 
 No changes in any makefiles are needed, just do
 
 make HOSTCC=arm-none-linuex-gnueabi-gcc env

 It looks weird to me.

You're not alone actually :) In a land far away in time, we used to
always cross-compile this tool.  But at a certain stage IIRC Mike
Frysinger convinced us that this tool should be compiled with the host
toolchain instead (honestly, I can't remember why).  So we accepted this
and documented it a later commit log:

commit 02bd475e343582b3c915b94ef4016d5876d4a4f1
Author: Daniel Hobi daniel.h...@schmid-telecom.ch
Date:   Wed Nov 10 14:11:21 2010 +0100

tools/env: cleanup host build flags

This patch makes tools/env/Makefile more similar to tools/imls:
- define HOSTSRCS and HOSTCPPFLAGS, so that .depend generation works.
- include U-Boot headers using -idirafter to prevent picking up
  u-boot/include/errno.h.
- use HOSTCFLAGS_NOPED (fw_env.c does not conform to -pedantic).

In order to cross-compile tools/env, override the HOSTCC variable
as in this example:

  make tools env HOSTCC=bfin-uclinux-gcc

Signed-off-by: Daniel Hobi daniel.h...@schmid-telecom.ch
Tested-by: Detlev Zundel d...@denx.de
Tested-by: Steve Sakoman steve.sako...@linaro.org

I for myself only saved the magic invocation needed and forgot the
reasoning...

 I think HOSTCC should be always gcc.

Correct.  One should only switch this for one specific build target.

 In my understanding,  tools/env/fw_printenv is not a host program
 but a one for the target embedded Linux.

Correct.

 Is there any reason that we don't fix tools/env/Makefile?

   $(obj)fw_printenv:  $(HOSTSRCS) $(HEADERS)
   $(HOSTCC) $(HOSTCFLAGS_NOPED) $(HOSTLDFLAGS) -o $@ $(HOSTSRCS)
   $(HOSTSTRIP) $@

 to

   $(obj)fw_printenv:  $(HOSTSRCS) $(HEADERS)
   $(CC) $(HOSTCFLAGS_NOPED) $(HOSTLDFLAGS) -o $@ $(HOSTSRCS)
   $(STRIP) $@

Personally I think I can now remember that the change was mostly done to
get the makefile somehow more similar to other makefiles.  So
considering your massive (and most welcome!) work on the build
infrastructure, I think you have become kind of an unspoken authority on
these issues ;) So if it helps in your cleanup and nobody objects, I'll
ack your changes.

Best wishes
  Detlev

-- 
Our choice isn't between a digital world where the NSA can eavesdrop and one
where the NSA is prevented from eavesdropping; it's between a digital world
that is vulnerable to allattackers, and one that is secure for all users.
  -- Bruce Schneier
--
DENX Software Engineering GmbH,  MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: d...@denx.de
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Compiling fw_printenv tool

2014-01-17 Thread Detlev Zundel
Hi Gerhard,

[...]

Ok, thinking about your answer it kind of makes sense that fw_printenv
can easily be used _out of tree_ without much hassle.  On the other
hand, as part of the build process, it is surely something to run on
the target and thus something to compile with CC and not HOSTCC.

Bu tmaybe we can get the best of both worlds, but I admit that I'm not
that deep into the build infrastructure.  Even more so considering that
it is currently changing ;)

Cheers
  Detlev

-- 
Algebraists do it in a ring, in fields, in groups.
--
DENX Software Engineering GmbH,  MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: d...@denx.de
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 3/3] sf: Use shortcut names

2014-01-17 Thread Jagannadha Sutradharudu Teki
- SPI_FLASH - SF
- ARRAY_SLOW - AS
- ARRAY_FAST - AF
- DUAL_OUTPUT_FAST - DOF
- DUAL_IO_FAST - DIOF
- QUAD_OUTPUT_FAST - QOF
- QUAD_IO_FAST - QIOF

Signed-off-by: Jagannadha Sutradharudu Teki jaga...@xilinx.com
Cc: Marek Vasut ma...@denx.de
---
 drivers/mtd/spi/sf_internal.h | 44 +--
 drivers/mtd/spi/sf_ops.c  | 25 
 drivers/mtd/spi/sf_probe.c| 44 +--
 include/spi_flash.h   | 14 +++---
 4 files changed, 63 insertions(+), 64 deletions(-)

diff --git a/drivers/mtd/spi/sf_internal.h b/drivers/mtd/spi/sf_internal.h
index 6bcd522..f959262 100644
--- a/drivers/mtd/spi/sf_internal.h
+++ b/drivers/mtd/spi/sf_internal.h
@@ -10,15 +10,15 @@
 #ifndef _SF_INTERNAL_H_
 #define _SF_INTERNAL_H_
 
-#define SPI_FLASH_3B_ADDR_LEN  3
-#define SPI_FLASH_CMD_LEN  (1 + SPI_FLASH_3B_ADDR_LEN)
-#define SPI_FLASH_16MB_BOUN0x100
+#define SF_INST_3BADDR 3
+#define SF_CMD_LEN (1 + SF_INST_3BADDR)
+#define SF_16MB_BOUN   0x100
 
 /* CFI Manufacture ID's */
-#define SPI_FLASH_CFI_MFR_SPANSION 0x01
-#define SPI_FLASH_CFI_MFR_STMICRO  0x20
-#define SPI_FLASH_CFI_MFR_MACRONIX 0xc2
-#define SPI_FLASH_CFI_MFR_WINBOND  0xef
+#define SF_CFI_MFR_SPANSION0x01
+#define SF_CFI_MFR_STMICRO 0x20
+#define SF_CFI_MFR_MACRONIX0xc2
+#define SF_CFI_MFR_WINBOND 0xef
 
 /* Erase commands */
 #define CMD_ERASE_4K   0x20
@@ -28,22 +28,22 @@
 
 /* Write commands */
 #define CMD_WRITE_STATUS   0x01
-#define CMD_PAGE_PROGRAM   0x02
+#define CMD_WRITE_PP   0x02
 #define CMD_WRITE_DISABLE  0x04
 #define CMD_READ_STATUS0x05
-#define CMD_QUAD_PAGE_PROGRAM  0x32
+#define CMD_WRITE_QPP  0x32
 #define CMD_READ_STATUS1   0x35
 #define CMD_WRITE_ENABLE   0x06
 #define CMD_READ_CONFIG0x35
 #define CMD_FLAG_STATUS0x70
 
 /* Read commands */
-#define CMD_READ_ARRAY_SLOW0x03
-#define CMD_READ_ARRAY_FAST0x0b
-#define CMD_READ_DUAL_OUTPUT_FAST  0x3b
-#define CMD_READ_DUAL_IO_FAST  0xbb
-#define CMD_READ_QUAD_OUTPUT_FAST  0x6b
-#define CMD_READ_QUAD_IO_FAST  0xeb
+#define CMD_READ_AS0x03
+#define CMD_READ_AF0x0b
+#define CMD_READ_DOF   0x3b
+#define CMD_READ_DIOF  0xbb
+#define CMD_READ_QOF   0x6b
+#define CMD_READ_QIOF  0xeb
 #define CMD_READ_ID0x9f
 
 /* Bank addr access commands */
@@ -55,15 +55,15 @@
 #endif
 
 /* Common status */
-#define STATUS_WIP (1  0)
-#define STATUS_QEB_WINSPAN (1  1)
-#define STATUS_QEB_MXIC(1  6)
-#define STATUS_PEC (1  7)
+#define STATUS_WIP 1  0
+#define STATUS_QEB_WINSPAN 1  1
+#define STATUS_QEB_MXIC1  6
+#define STATUS_PEC 1  7
 
 /* Flash timeout values */
-#define SPI_FLASH_PROG_TIMEOUT (2 * CONFIG_SYS_HZ)
-#define SPI_FLASH_PAGE_ERASE_TIMEOUT   (5 * CONFIG_SYS_HZ)
-#define SPI_FLASH_SECTOR_ERASE_TIMEOUT (10 * CONFIG_SYS_HZ)
+#define SF_PROG_TIMEOUT(2 * CONFIG_SYS_HZ)
+#define SF_PAGE_ERASE_TIMEOUT  (5 * CONFIG_SYS_HZ)
+#define SF_SECTOR_ERASE_TIMEOUT(10 * CONFIG_SYS_HZ)
 
 /* SST specific */
 #ifdef CONFIG_SPI_FLASH_SST
diff --git a/drivers/mtd/spi/sf_ops.c b/drivers/mtd/spi/sf_ops.c
index 0d87e1b..e8e70bb 100644
--- a/drivers/mtd/spi/sf_ops.c
+++ b/drivers/mtd/spi/sf_ops.c
@@ -119,7 +119,7 @@ static int spi_flash_bank(struct spi_flash *flash, u32 
offset)
u8 bank_sel;
int ret;
 
-   bank_sel = offset / (SPI_FLASH_16MB_BOUN  flash-shift);
+   bank_sel = offset / (SF_16MB_BOUN  flash-shift);
 
ret = spi_flash_cmd_bankaddr_write(flash, bank_sel);
if (ret) {
@@ -207,11 +207,11 @@ int spi_flash_write_common(struct spi_flash *flash, const 
u8 *cmd,
size_t cmd_len, const void *buf, size_t buf_len)
 {
struct spi_slave *spi = flash-spi;
-   unsigned long timeout = SPI_FLASH_PROG_TIMEOUT;
+   unsigned long timeout = SF_PROG_TIMEOUT;
int ret;
 
if (buf == NULL)
-   timeout = SPI_FLASH_PAGE_ERASE_TIMEOUT;
+   timeout = SF_PAGE_ERASE_TIMEOUT;
 
ret = spi_claim_bus(flash-spi);
if (ret) {
@@ -233,9 +233,8 @@ int spi_flash_write_common(struct spi_flash *flash, const 
u8 *cmd,
 
ret = spi_flash_cmd_wait_ready(flash, timeout);
if (ret  0) {
-   debug(SF: write %s timed out\n,
- timeout == SPI_FLASH_PROG_TIMEOUT ?
-   program : 

[U-Boot] [PATCH 2/3] sf: Shrink spi_slave {}

2014-01-17 Thread Jagannadha Sutradharudu Teki
Combined spi flash stuff as minimum as possible.

Signed-off-by: Jagannadha Sutradharudu Teki jaga...@xilinx.com
Cc: Marek Vasut ma...@denx.de
---
 drivers/mtd/spi/sf.c   |  4 ++--
 drivers/mtd/spi/sf_ops.c   | 18 +-
 drivers/mtd/spi/sf_probe.c | 19 ---
 include/spi.h  | 45 +++--
 include/spi_flash.h|  6 +++---
 5 files changed, 45 insertions(+), 47 deletions(-)

diff --git a/drivers/mtd/spi/sf.c b/drivers/mtd/spi/sf.c
index 664e860..fb91ac6 100644
--- a/drivers/mtd/spi/sf.c
+++ b/drivers/mtd/spi/sf.c
@@ -19,8 +19,8 @@ static int spi_flash_read_write(struct spi_slave *spi,
int ret;
 
 #ifdef CONFIG_SF_DUAL_FLASH
-   if (spi-flags  SPI_XFER_U_PAGE)
-   flags |= SPI_XFER_U_PAGE;
+   if (spi-mode_bits  SPI_U_PAGE)
+   flags |= SPI_U_PAGE;
 #endif
if (data_len == 0)
flags |= SPI_XFER_END;
diff --git a/drivers/mtd/spi/sf_ops.c b/drivers/mtd/spi/sf_ops.c
index 9650486..0d87e1b 100644
--- a/drivers/mtd/spi/sf_ops.c
+++ b/drivers/mtd/spi/sf_ops.c
@@ -135,15 +135,15 @@ static int spi_flash_bank(struct spi_flash *flash, u32 
offset)
 static void spi_flash_dual_flash(struct spi_flash *flash, u32 *addr)
 {
switch (flash-dual_flash) {
-   case SF_DUAL_STACKED_FLASH:
+   case SF_STACKED:
if (*addr = (flash-size  1)) {
*addr -= flash-size  1;
-   flash-spi-flags |= SPI_XFER_U_PAGE;
+   flash-spi-mode_bits |= SPI_U_PAGE;
} else {
-   flash-spi-flags = ~SPI_XFER_U_PAGE;
+   flash-spi-mode_bits = ~SPI_U_PAGE;
}
break;
-   case SF_DUAL_PARALLEL_FLASH:
+   case SF_PARALLEL:
*addr = flash-shift;
break;
default:
@@ -170,8 +170,8 @@ int spi_flash_cmd_wait_ready(struct spi_flash *flash, 
unsigned long timeout)
}
 
 #ifdef CONFIG_SF_DUAL_FLASH
-   if (spi-flags  SPI_XFER_U_PAGE)
-   flags |= SPI_XFER_U_PAGE;
+   if (spi-mode_bits  SPI_U_PAGE)
+   flags |= SPI_U_PAGE;
 #endif
ret = spi_xfer(spi, 8, cmd, NULL, flags);
if (ret) {
@@ -261,7 +261,7 @@ int spi_flash_cmd_erase_ops(struct spi_flash *flash, u32 
offset, size_t len)
erase_addr = offset;
 
 #ifdef CONFIG_SF_DUAL_FLASH
-   if (flash-dual_flash  SF_SINGLE_FLASH)
+   if (flash-dual_flash  SF_SINGLE)
spi_flash_dual_flash(flash, erase_addr);
 #endif
 #ifdef CONFIG_SPI_FLASH_BAR
@@ -303,7 +303,7 @@ int spi_flash_cmd_write_ops(struct spi_flash *flash, u32 
offset,
write_addr = offset;
 
 #ifdef CONFIG_SF_DUAL_FLASH
-   if (flash-dual_flash  SF_SINGLE_FLASH)
+   if (flash-dual_flash  SF_SINGLE)
spi_flash_dual_flash(flash, write_addr);
 #endif
 #ifdef CONFIG_SPI_FLASH_BAR
@@ -388,7 +388,7 @@ int spi_flash_cmd_read_ops(struct spi_flash *flash, u32 
offset,
read_addr = offset;
 
 #ifdef CONFIG_SF_DUAL_FLASH
-   if (flash-dual_flash  SF_SINGLE_FLASH)
+   if (flash-dual_flash  SF_SINGLE)
spi_flash_dual_flash(flash, read_addr);
 #endif
 #ifdef CONFIG_SPI_FLASH_BAR
diff --git a/drivers/mtd/spi/sf_probe.c b/drivers/mtd/spi/sf_probe.c
index e84ab13..003f635 100644
--- a/drivers/mtd/spi/sf_probe.c
+++ b/drivers/mtd/spi/sf_probe.c
@@ -133,8 +133,13 @@ static struct spi_flash *spi_flash_validate_params(struct 
spi_slave *spi,
flash-spi = spi;
flash-name = params-name;
flash-memory_map = spi-memory_map;
-   flash-dual_flash = flash-spi-option;
 
+#ifdef CONFIG_SF_DUAL_FLASH
+   if (flash-spi-mode_bits  SPI_SHARED)
+   flash-dual_flash = SF_STACKED;
+   else if (flash-spi-mode_bits  SPI_SEPARATED)
+   flash-dual_flash = SF_PARALLEL;
+#endif
/* Assign spi_flash ops */
flash-write = spi_flash_cmd_write_ops;
 #ifdef CONFIG_SPI_FLASH_SST
@@ -145,12 +150,12 @@ static struct spi_flash *spi_flash_validate_params(struct 
spi_slave *spi,
flash-read = spi_flash_cmd_read_ops;
 
/* Compute the flash size */
-   flash-shift = (flash-dual_flash  SF_DUAL_PARALLEL_FLASH) ? 1 : 0;
+   flash-shift = (flash-dual_flash  SF_PARALLEL) ? 1 : 0;
flash-page_size = ((ext_jedec == 0x4d00) ? 512 : 256)  flash-shift;
flash-sector_size = params-sector_size  flash-shift;
flash-size = flash-sector_size * params-nr_sectors  flash-shift;
 #ifdef CONFIG_SF_DUAL_FLASH
-   if (flash-dual_flash  SF_DUAL_STACKED_FLASH)
+   if (flash-dual_flash  SF_STACKED)
flash-size = 1;
 #endif
 
@@ -167,7 +172,7 @@ static struct spi_flash *spi_flash_validate_params(struct 
spi_slave *spi,
}
 
/* Look for the fastest read cmd */
-   cmd = 

[U-Boot] [PATCH 1/3] sf: ops: Squash the malloc+memset combo

2014-01-17 Thread Jagannadha Sutradharudu Teki
Squash the malloc()+memset() combo in favor of calloc().

Signed-off-by: Jagannadha Sutradharudu Teki jaga...@xilinx.com
Cc: Marek Vasut ma...@denx.de
---
 drivers/mtd/spi/sf_ops.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/mtd/spi/sf_ops.c b/drivers/mtd/spi/sf_ops.c
index 1f1bb36..9650486 100644
--- a/drivers/mtd/spi/sf_ops.c
+++ b/drivers/mtd/spi/sf_ops.c
@@ -381,8 +381,7 @@ int spi_flash_cmd_read_ops(struct spi_flash *flash, u32 
offset,
}
 
cmdsz = SPI_FLASH_CMD_LEN + flash-dummy_byte;
-   cmd = malloc(cmdsz);
-   memset(cmd, 0, cmdsz);
+   cmd = calloc(1, cmdsz);
 
cmd[0] = flash-read_cmd;
while (len) {
-- 
1.8.3


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


Re: [U-Boot] [PATCH 1/3] sf: ops: Squash the malloc+memset combo

2014-01-17 Thread Marek Vasut
On Friday, January 17, 2014 at 03:41:45 PM, Jagannadha Sutradharudu Teki wrote:
 Squash the malloc()+memset() combo in favor of calloc().
 
 Signed-off-by: Jagannadha Sutradharudu Teki jaga...@xilinx.com
 Cc: Marek Vasut ma...@denx.de
 ---
  drivers/mtd/spi/sf_ops.c | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)
 
 diff --git a/drivers/mtd/spi/sf_ops.c b/drivers/mtd/spi/sf_ops.c
 index 1f1bb36..9650486 100644
 --- a/drivers/mtd/spi/sf_ops.c
 +++ b/drivers/mtd/spi/sf_ops.c
 @@ -381,8 +381,7 @@ int spi_flash_cmd_read_ops(struct spi_flash *flash, u32
 offset, }
 
   cmdsz = SPI_FLASH_CMD_LEN + flash-dummy_byte;
 - cmd = malloc(cmdsz);
 - memset(cmd, 0, cmdsz);
 + cmd = calloc(1, cmdsz);
 
   cmd[0] = flash-read_cmd;

What exactly will happen here when calloc() fails ? :-)

(that means, please check the return value ;-) )

   while (len) {

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


Re: [U-Boot] A list of dead email addresses of board maintainers

2014-01-17 Thread Detlev Zundel
Hello Masahiro-san,

 When I CC board maintainers, it sometimes results in bounce mails.

 How should we modify boards.cfg?
 Delete the email? Or just mark as dead address ?

This hooks into the recent discussion about when we can remove
unsupported boards.  The concensus there was to mark those boards as
unmaintained and keep the e-mail as last working e-mail address.
Deleting the e-mail means loosing important information.  Even though
the accounts do not work anymore, they carry information.

Cheers
  Detlev

[1] article.gmane.org/gmane.comp.boot-loaders.u-boot/173305

-- 
Now that it's been pointed out, we should just rename Emacs as CTHULHU:
CTHULHU's Top Hacks Using Lisp, Horrifying Users
For CTHULHU 25, M-x doctor should be replaced by M-x cthulhu, which no
one should ever call. -- Jay Belanger 87bnznxlj6@gmail.com
--
DENX Software Engineering GmbH,  MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: d...@denx.de
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] booting os 'Unknown OS' (1) is not supported

2014-01-17 Thread Alexander Khryukin
Thanks for your answer!

So again, try loading the image somewhere else in RAM and let U-Boot do
the copying to the correct place.

It's not obvious for me how to do it.
Might you have any guide or faq?




2014/1/17 Detlev Zundel d...@denx.de

 Hi Alexander,

  I faced with a strange behaviour of u-boot.

 Expected behaviour for some people may seem strange to others ;)

  Few months ago i bought an ARM development board from yicsystem
  it's based on exynos 5250 and very similar to arndale
  http://www.yicsystem.com/products/low-cost-board/yse5250/
 
  And i can boot Android ICS
  but when i try to boot any linux
  i always see
 
 
  Checking Boot Mode ... SDMMC
  Now running in RAM - U-Boot at: c3e0
  REVISION: 1.0
  REVISION: 1.0
  MMC Device 0: 3839 MB
  NAME: S5P_MSHC0
  MMC Device 1: 7348 MB
  MMC Device 2 not found
  Destroy Hash Table: c3f80f78 table = (null)
  Create Hash Table: N=512
  INSERT: table c3f80f78, filled 1/521 rv c3d047a0 == name=baudrate
  value=115200
  INSERT: table c3f80f78, filled 2/521 rv c3d0582c == name=bootargs
  value=root=/dev/mmcblk0p1
  INSERT: table c3f80f78, filled 3/521 rv c3d04a1c == name=bootcmd
  value=movi read kernel 0 40008000;movi read rootfs 0 4100
 10;bootm
  40008000 4100
  INSERT: table c3f80f78, filled 4/521 rv c3d04f20 == name=bootdelay
  value=3
  INSERT: table c3f80f78, filled 5/521 rv c3d04bfc == name=bootfile
  value=/tftpboot/revoboot/bin/revoboot.pxe
  INSERT: table c3f80f78, filled 6/521 rv c3d040a4 ==
  name=emmcbootrecovery value=mmc erase boot 1 0 0;emmc open 1;movi read
  fwbl1 0 4000;movi write zero fwbl1 1 4000;movi read bl2 0
  40004000;movi write zero bl2 1 40004000;movi read u-boot 0 4200;movi
  write zero u-boot 1 4200;movi read tzsw 0 4210;movi write zero
 tzsw
  1 4210;emmc close 1
  INSERT: table c3f80f78, filled 7/521 rv c3d04998 == name=ethact
  value=smc911x-0
  INSERT: table c3f80f78, filled 8/521 rv c3d0462c == name=ethaddr
  value=00:40:5c:26:0a:5b
  INSERT: table c3f80f78, filled 9/521 rv c3d057a8 == name=gatewayip
  value=192.168.0.1
  INSERT: table c3f80f78, filled 10/521 rv c3d05874 == name=ipaddr
  value=192.168.0.28
  INSERT: table c3f80f78, filled 11/521 rv c3d048c0 == name=netmask
  value=255.255.255.0
  INSERT: table c3f80f78, filled 12/521 rv c3d05214 == name=rootfslen
  value= 10
  INSERT: table c3f80f78, filled 13/521 rv c3d048e4 == name=serverip
  value=192.168.0.13
  INSERT: free(data = c3d00010)
  INSERT: done
  Net:   smc911x-0
  ### main_loop entered: bootdelay=3
 
  ### main_loop: bootcmd=movi read kernel 0 40008000;movi read rootfs 0
  4100 10;bootm 40008000 4100
  Hit any key to stop autoboot:  0
  reading kernel..device 0 Start 1063, Count 16384
  MMC read: dev # 0, block # 1063, count 16384 ... 16384 blocks read: OK
  completed
  reading RFS..device 0 Count 17447, Start 2048
  MMC read: dev # 0, block # 17447, count 2048 ... 2048 blocks read: OK
  completed
  ## Current stack ends at 0xc3cfbd98 *  kernel: cmdline image address =
  0x40008000
  ## Booting kernel from Legacy Image at 40008000 ...
 Image Name:   Linux-3.12.0-rc1-armv7-x0.6-0012
 Image Type:   ARM Linux Kernel Image (uncompressed)
 Data Size:3243400 Bytes = 3167 KiB
 Load Address: 40008000
 Entry Point:  40008000
 Verifying Checksum ... OK
 kernel data at 0x40008040, len = 0x00317d88 (3243400)
  *  ramdisk: cmdline image address = 0x4100
  Wrong Ramdisk Image Format
 ramdisk start = 0x4100, ramdisk end = 0x4100
 XIP Kernel Image ... OK

 This XIP points to a problem.  In essence I think you should try to
 load your image to any address in RAM but _not_ to the load address
 specified in the uImage.  The intention of this field is to tell U-Boot
 where the uImage file - that could reside on nor flash for exmple -
 should be loaded to in RAM before it is executed.  You have specified
 4008000 at image creation time but already load uImage that has a
 64-byte header prepended to that location.  U-Boot in term finds that
 the image is alreday where it should be, does nothing and switches to
 XIP mode and then gets pretty confused.

 So again, try loading the image somewhere else in RAM and let U-Boot do
 the copying to the correct place.

 And even better, we consider uImages to be legacy for quite a while, so
 please plan to switch to using FIT images sometime soon.

 Cheers
   Detlev

 --
 This is  not the first  time my views  on some topic have  inspired in
 someone the  desire to psychoanalyze me. Previous  experience leads me
 to ask  about your couch. Is  it comfortable? Are its  springs in good
 shape? -- Jonh McCarthy
 --
 DENX Software Engineering GmbH,  MD: Wolfgang Denk  Detlev Zundel
 HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
 Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: d...@denx.de

___
U-Boot mailing 

Re: [U-Boot] [PATCH 1/3] sf: ops: Squash the malloc+memset combo

2014-01-17 Thread Jagan Teki
On Fri, Jan 17, 2014 at 8:13 PM, Marek Vasut ma...@denx.de wrote:
 On Friday, January 17, 2014 at 03:41:45 PM, Jagannadha Sutradharudu Teki 
 wrote:
 Squash the malloc()+memset() combo in favor of calloc().

 Signed-off-by: Jagannadha Sutradharudu Teki jaga...@xilinx.com
 Cc: Marek Vasut ma...@denx.de
 ---
  drivers/mtd/spi/sf_ops.c | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)

 diff --git a/drivers/mtd/spi/sf_ops.c b/drivers/mtd/spi/sf_ops.c
 index 1f1bb36..9650486 100644
 --- a/drivers/mtd/spi/sf_ops.c
 +++ b/drivers/mtd/spi/sf_ops.c
 @@ -381,8 +381,7 @@ int spi_flash_cmd_read_ops(struct spi_flash *flash, u32
 offset, }

   cmdsz = SPI_FLASH_CMD_LEN + flash-dummy_byte;
 - cmd = malloc(cmdsz);
 - memset(cmd, 0, cmdsz);
 + cmd = calloc(1, cmdsz);

   cmd[0] = flash-read_cmd;

 What exactly will happen here when calloc() fails ? :-)

 (that means, please check the return value ;-) )

Yes - will take care that. thanks!

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


Re: [U-Boot] Fat write problem

2014-01-17 Thread Detlev Zundel
Hi Ruud,

 This week I decided to do some further research and testing regarding
 this problem.
 With the image I had from the previous time, I could immediately
 reproduce it and
 by adding more and more debug prints, I tried to find the cause. Sofar,
 I have not
 succeeded in this yet.

 However: later on I started testing with a freshly formatted drive (32
 MB FAT partition)
 and kept repeating the fatwrite command:

 fatwrite mmc 0:1 4200 test-x 200

 where x runs from 1, 2,3 and further. And this way I could reproduce it
 quite easily.
 Writing always fails for the 32nd file. This is with the partition
 formatted with a 512 byte
 sector size and a cluster size of 4. If the cluster size is 1 (formatted
 by Windows),
 it already fails at the 8th file.

 If I create a subdirectory (from Linux) with already 24 files in it, I
 can still write 29 files
 and it fails at number 30. Also, if earlier files were deleted from the
 root-directory, they
 still count in the total number of files here.

 If I take out the card where u-boot fails to write new files, I can
 still add new files from
 my PC with Linux or Windows.

 I tested with both long and short filenames (same result), VFAT is
 enabled.

 I hope this gives you all some more information about this problem and
 perhaps it is even a
 known problem (limited number of files in the root directory?). I know
 it is voor FAT16, but
 that was 512 entries if I am correct.

Thanks for the extensive research into this problem.  For people to
help, I think the barrier of reproducing the problem is somewhat
high, so it occurred to me if you can help setup a very easy test for
people to work on.  Would you be able to generate a small image that one
can dd to a mmc card and then immediately provoke the error?  If you
don't have any hosting space, as a last resort I'd be fine for you to
put it on our wiki [1].

Cheers
  Detlev

[1] http://www.denx.de/wiki/view/U-Boot/TooBigPatches

-- 
Golden rule #12:   When the comments do not match the code, they probably are
both wrong. -- Steven Rostedt 1300126962.9910.128.ca...@gandalf.stny.rr.com
--
DENX Software Engineering GmbH,  MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: d...@denx.de
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v4 0/8] Provide a mechanism to avoid using #ifdef everywhere

2014-01-17 Thread Detlev Zundel
Hi Simon,

[...]

 I think the Linux code has two big advantages - for one, we increase the
 overlap with Linux kernel proper and secondly we keep the 'grep'ability
 of the names which I really missed in your proposal.

 Yes that seems reasonable.

Ok, I'm glad we are in agreement.

 Many of U-Boot's options are not just yes/no, so I'm not sure what will
 happen with those. Perhaps they just can't be used with this macro? Part of
 my intent was to allow any option to be used.

 In those cases the defines then are a shortcut to using a boolean + a
 value and we can make it work by introducing this boolean?  I have no
 idea of how much work this would be, but it might be worthwhile getting
 some real numbers to that.

 So for example you can do this:

 struct {
 const char *str;
 u_int len;
 int retry;
 const char *conf; /* Configuration value */
 }
 delaykey [] = {
 { str: getenv(bootdelaykey),  retry: 1,
 conf: autoconf_autoboot_delay_str() },
 { str: getenv(bootdelaykey2), retry: 1,
 conf: autoconf_autoboot_delay_str2() },
 { str: getenv(bootstopkey),   retry: 0,
 conf: autoconf_autoboot_stop_str() },
 { str: getenv(bootstopkey2),  retry: 0,
 conf: autoconf_autoboot_stop_str2() },
 };



 or this:

 /* don't retry auto boot? */
 if (autoconf_boot_retry_time() 
 !delaykey[i].retry)
 retry_time = -1;


 Note that autoconf_boot_retry_time() will return 0 if the CONFIG is not
 defined, or if its value is 0.

 I'm having real trouble figuring out what this would do on first sight.
 Of course you could call me lazy, but by experience I tend to favour
 solutions that do not need geniuses to understand ;)

 Well it is simply that we currently have options which may or may not
 be defined. If they are not defined, then it is an error to refer to
 them, so they must be guarded by an #ifdef. By defining them to 0 when
 not defined, we can avoid that guard.

Ok, I see.  But in this way we are actually shutting up the compiler on
code paths that we did not have before.  This in effect is a rather be
quiet than error strategy and I'm not sure that I want to use that
when doing such changes.  Call me old-fashioned, but I'd prefer to throw
an error and fix it after thinking it through from todays perspective

(I can say this easily if I'm not the one who has to do the fixes ;)

 It seems to me we should provide the Linux feature in U-Boot as part of the
 Kconfig stuff, and see where it takes us. Combined with a bit more
 rationalisation of things like main.c it might be enough.

 Why not reimplement your patch set along those lines?  I still really
 would _love_ to see us using the compiler more to check for errors and
 reduce the number of potential source code combination that we have.

 Well certainly I could, but I did not want to do this while
 Kbuild/Kconfig is in progress, and we are not quite clear on what to
 do. I think Kbuild is done - we will probably get the Linux autoconf
 stuff for free with Kconfig which I understand is coming very soon.

This makes a lot of sense yes.  Actually I'm pretty excited about this
excellent and continuous work from Masahiro-san on that topic!

 After that I can certainly take another look at main.c and see how it
 can be improved.

Sure, its only that I wanted to keep the ball rolling as I really
believe the wins to be had from such a change are substantial for our
codebase.

Cheers
  Detlev

-- 
Golden rule #12:   When the comments do not match the code, they probably are
both wrong. -- Steven Rostedt 1300126962.9910.128.ca...@gandalf.stny.rr.com
--
DENX Software Engineering GmbH,  MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: d...@denx.de
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] booting os 'Unknown OS' (1) is not supported

2014-01-17 Thread Detlev Zundel
Hello Alexander,

 Thanks for your answer!

So again, try loading the image somewhere else in RAM and let U-Boot do
the copying to the correct place.

 It's not obvious for me how to do it.
 Might you have any guide or faq?

[...]

  ### main_loop: bootcmd=movi read kernel 0 40008000;movi read rootfs 0
 ^^^
  4100 10;bootm 40008000 4100
 ^^

Your bootmcd reads the kernel to 40008000 and then calls bootm to that
address.  Simple change those two places to, say, 4080 by editing
bootcmd.  (Not knowing your system, I presume RAM starts at 4000,
and 4080, then would be 8MiB after the beginning.  U-Boot will copy
the kernel to 4008000 so the kernel should not be bigger than 7.5MiB but
the other snippets from your log say the kernel is ~3.2MiB, so this
should be fine.

Cheers
  Detlev

-- 
The only thing that interferes with my learning is my education.
  -- Albert Einstein
--
DENX Software Engineering GmbH,  MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: d...@denx.de
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Compiling fw_printenv tool

2014-01-17 Thread Alexey Smishlayev

On 2014.01.17. 16:30, Detlev Zundel wrote:

Hi Alexey,

[...]


I've googled it and sorted it out. The problem was that executable was
dynamically linked and the *.so was not found on the embedded
system. I compiled it with -static and it runs.

I'm glad you solved the problem.  I only like for such answers to show
up in archives so that other people can profit from the answer in
DuckDuckGo searches yet to come ;)

Cheers
   Detlev



In case someone needs that (before the Makefile changes are accepted), I 
used the


make HOSTCC='arm-none-linuex-gnueabi-gcc -static' env
command to get it working.

Best regards,
Alexey


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


Re: [U-Boot] booting os 'Unknown OS' (1) is not supported

2014-01-17 Thread Alexander Khryukin
Also if flashed 3.12_zImage (same kernel, same sources, just zImage)
i see this



reading kernel..device 0 Start 1063, Count 16384
MMC read: dev # 0, block # 1063, count 16384 ... 16384 blocks read: OK
completed
reading RFS..device 0 Count 17447, Start 2048
MMC read: dev # 0, block # 17447, count 2048 ... 2048 blocks read: OK
completed
Boot with zImage
Wrong Ramdisk Image Format

Starting kernel ...


And it's stucked at Starting kernel ...


2014/1/17 Alexander Khryukin alexan...@mezon.ru

 Thanks.
 I changed env to

 baudrate=115200
 *bootcmd=movi read kernel 0 4080;movi read rootfs 0 4100
 10;bootm 4080 4100*
 bootdelay=3
 emmcbootrecovery=mmc erase boot 1 0 0;emmc open 1;movi read fwbl1 0
 4000;movi write zero fwbl1 1 4000;movi read bl2 0 40004000;movi
 write zero bl2 1 40004000;movi read u-boot 0 4200;movi write zero
 u-boot 1 4200;movi read tzsw 0 4210;movi write zero tzsw 1
 4210;emmc close 1
 ethact=smc911x-0
 ethaddr=00:40:5c:26:0a:5b
 gatewayip=192.168.0.1
 ipaddr=192.168.0.28
 netmask=255.255.255.0
 rootfslen= 10
 serverip=192.168.0.13



 And now trying to boot
 U-Boot 2012.12-0-g503cd8d-dirty (Jan 15 2014 - 12:58:49) for YICSYSTEM
 YSE5250-scp


 CPU: S5PC520 Rev1.0 [Samsung SOC on SMP Platform Base on ARM CortexA15]
 APLL = 800MHz, MPLL = 800MHz
 Board:  YSE5250-scp
 DRAM:  2047 MiB

 TrustZone Enabled BSP
 BL1 version: 20130404
 PMIC: S5M8767


 Checking Boot Mode ... SDMMC
 REVISION: 1.0
 REVISION: 1.0
 MMC Device 0: 3839 MB
 NAME: S5P_MSHC0
 MMC Device 1: 7348 MB
 MMC Device 2 not found
 Net:   smc911x-0

 Hit any key to stop autoboot:  0
 reading kernel..device 0 Start 1063, Count 16384
 MMC read: dev # 0, block # 1063, count 16384 ... 16384 blocks read: OK
 completed
 reading RFS..device 0 Count 17447, Start 2048
 MMC read: dev # 0, block # 17447, count 2048 ... 2048 blocks read: OK
 completed
 ## Booting kernel from Legacy Image at 4080 ...
Image Name:   Linux-3.13.0-rc8

Image Type:   ARM Linux Kernel Image (uncompressed)
Data Size:4754992 Bytes = 4643 KiB

Load Address: 40008000
Entry Point:  40008000
Verifying Checksum ... OK
 Wrong Ramdisk Image Format
Loading Kernel Image ... OK
 OK

 *ERROR: booting os 'Unknown OS' (1) is not supported*


 No changes.
 But XIP is gone.



 2014/1/17 Detlev Zundel d...@denx.de

 Hello Alexander,

  Thanks for your answer!
 
 So again, try loading the image somewhere else in RAM and let U-Boot do
 the copying to the correct place.
 
  It's not obvious for me how to do it.
  Might you have any guide or faq?

 [...]

   ### main_loop: bootcmd=movi read kernel 0 40008000;movi read rootfs
 0
  ^^^
   4100 10;bootm 40008000 4100
  ^^

 Your bootmcd reads the kernel to 40008000 and then calls bootm to that
 address.  Simple change those two places to, say, 4080 by editing
 bootcmd.  (Not knowing your system, I presume RAM starts at 4000,
 and 4080, then would be 8MiB after the beginning.  U-Boot will copy
 the kernel to 4008000 so the kernel should not be bigger than 7.5MiB but
 the other snippets from your log say the kernel is ~3.2MiB, so this
 should be fine.

 Cheers
   Detlev

 --
 The only thing that interferes with my learning is my education.
   -- Albert Einstein
 --
 DENX Software Engineering GmbH,  MD: Wolfgang Denk  Detlev Zundel
 HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
 Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: d...@denx.de



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


Re: [U-Boot] Fat write problem

2014-01-17 Thread Ruud Commandeur
 

 -Oorspronkelijk bericht-
 Van: Detlev Zundel [mailto:d...@denx.de] 
 Verzonden: vrijdag 17 januari 2014 15:59
 Aan: Ruud Commandeur
 CC: U-Boot list
 Onderwerp: Re: [U-Boot] Fat write problem
 
 Hi Ruud,
 
  This week I decided to do some further research and testing 
 regarding
  this problem.
  With the image I had from the previous time, I could immediately
  reproduce it and
  by adding more and more debug prints, I tried to find the 
 cause. Sofar,
  I have not
  succeeded in this yet.
 
  However: later on I started testing with a freshly 
 formatted drive (32
  MB FAT partition)
  and kept repeating the fatwrite command:
 
  fatwrite mmc 0:1 4200 test-x 200
 
  where x runs from 1, 2,3 and further. And this way I could 
 reproduce it
  quite easily.
  Writing always fails for the 32nd file. This is with the partition
  formatted with a 512 byte
  sector size and a cluster size of 4. If the cluster size is 
 1 (formatted
  by Windows),
  it already fails at the 8th file.
 
  If I create a subdirectory (from Linux) with already 24 
 files in it, I
  can still write 29 files
  and it fails at number 30. Also, if earlier files were 
 deleted from the
  root-directory, they
  still count in the total number of files here.
 
  If I take out the card where u-boot fails to write new files, I can
  still add new files from
  my PC with Linux or Windows.
 
  I tested with both long and short filenames (same result), VFAT is
  enabled.
 
  I hope this gives you all some more information about this 
 problem and
  perhaps it is even a
  known problem (limited number of files in the root 
 directory?). I know
  it is voor FAT16, but
  that was 512 entries if I am correct.
 
 Thanks for the extensive research into this problem.  For people to
 help, I think the barrier of reproducing the problem is somewhat
 high, so it occurred to me if you can help setup a very easy test for
 people to work on.  Would you be able to generate a small 
 image that one
 can dd to a mmc card and then immediately provoke the error?  If you
 don't have any hosting space, as a last resort I'd be fine for you to
 put it on our wiki [1].
 
Hi Detlev,

Thanks for your response. Finally I get some ;-)

I can look for creating some image, but I don't think it is that hard to
reproduce (now I think to know what causes it). Either use 32 times the
fatwrite command (using the cmd history and increment the x-nr each
time)
or just copy up to 31 files to the root of the FAT partition by using
the host
machine and place the SD-card back on the targe device running u-boot.

Hope this makes it easy enough, otherwise I will be glad to hear from
you.

N.B. All this was with a FAT16 partition. If I use FAT32, I have no such
problem! At least not for 45 files up till now...

Regards,

Ruud

 Cheers
   Detlev
 
 [1] http://www.denx.de/wiki/view/U-Boot/TooBigPatches
 
 -- 
 Golden rule #12:   When the comments do not match the code, 
 they probably are
 both wrong. -- Steven Rostedt 
 1300126962.9910.128.ca...@gandalf.stny.rr.com
 --
 DENX Software Engineering GmbH,  MD: Wolfgang Denk  Detlev Zundel
 HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
 Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: d...@denx.de
 
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] omap3_beagle: use omap3-beagle.dtb for the C4 revision

2014-01-17 Thread Robert Nelson
findftd is currently setting fdtfile to undefined for the beagle c4, select 
omap3-beagle.dtb instead

Signed-off-by: Robert Nelson robertcnel...@gmail.com
---
 include/configs/omap3_beagle.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h
index 1b566c0..c58bc91 100644
--- a/include/configs/omap3_beagle.h
+++ b/include/configs/omap3_beagle.h
@@ -241,6 +241,8 @@
setenv fdtfile omap3-beagle.dtb; fi;  \
if test $beaglerev = Cx; then  \
setenv fdtfile omap3-beagle.dtb; fi;  \
+   if test $beaglerev = C4; then  \
+   setenv fdtfile omap3-beagle.dtb; fi;  \
if test $beaglerev = xMAB; then  \
setenv fdtfile omap3-beagle-xm.dtb; fi;  \
if test $beaglerev = xMC; then  \
-- 
1.8.5.2

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


Re: [U-Boot] booting os 'Unknown OS' (1) is not supported

2014-01-17 Thread Alexander Khryukin
Thanks.
I changed env to

baudrate=115200
*bootcmd=movi read kernel 0 4080;movi read rootfs 0 4100
10;bootm 4080 4100*
bootdelay=3
emmcbootrecovery=mmc erase boot 1 0 0;emmc open 1;movi read fwbl1 0
4000;movi write zero fwbl1 1 4000;movi read bl2 0 40004000;movi
write zero bl2 1 40004000;movi read u-boot 0 4200;movi write zero
u-boot 1 4200;movi read tzsw 0 4210;movi write zero tzsw 1
4210;emmc close 1
ethact=smc911x-0
ethaddr=00:40:5c:26:0a:5b
gatewayip=192.168.0.1
ipaddr=192.168.0.28
netmask=255.255.255.0
rootfslen= 10
serverip=192.168.0.13



And now trying to boot
U-Boot 2012.12-0-g503cd8d-dirty (Jan 15 2014 - 12:58:49) for YICSYSTEM
YSE5250-scp


CPU: S5PC520 Rev1.0 [Samsung SOC on SMP Platform Base on ARM CortexA15]
APLL = 800MHz, MPLL = 800MHz
Board:  YSE5250-scp
DRAM:  2047 MiB

TrustZone Enabled BSP
BL1 version: 20130404
PMIC: S5M8767

Checking Boot Mode ... SDMMC
REVISION: 1.0
REVISION: 1.0
MMC Device 0: 3839 MB
NAME: S5P_MSHC0
MMC Device 1: 7348 MB
MMC Device 2 not found
Net:   smc911x-0
Hit any key to stop autoboot:  0
reading kernel..device 0 Start 1063, Count 16384
MMC read: dev # 0, block # 1063, count 16384 ... 16384 blocks read: OK
completed
reading RFS..device 0 Count 17447, Start 2048
MMC read: dev # 0, block # 17447, count 2048 ... 2048 blocks read: OK
completed
## Booting kernel from Legacy Image at 4080 ...
   Image Name:   Linux-3.13.0-rc8
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:4754992 Bytes = 4643 KiB
   Load Address: 40008000
   Entry Point:  40008000
   Verifying Checksum ... OK
Wrong Ramdisk Image Format
   Loading Kernel Image ... OK
OK
*ERROR: booting os 'Unknown OS' (1) is not supported*


No changes.
But XIP is gone.



2014/1/17 Detlev Zundel d...@denx.de

 Hello Alexander,

  Thanks for your answer!
 
 So again, try loading the image somewhere else in RAM and let U-Boot do
 the copying to the correct place.
 
  It's not obvious for me how to do it.
  Might you have any guide or faq?

 [...]

   ### main_loop: bootcmd=movi read kernel 0 40008000;movi read rootfs 0
  ^^^
   4100 10;bootm 40008000 4100
  ^^

 Your bootmcd reads the kernel to 40008000 and then calls bootm to that
 address.  Simple change those two places to, say, 4080 by editing
 bootcmd.  (Not knowing your system, I presume RAM starts at 4000,
 and 4080, then would be 8MiB after the beginning.  U-Boot will copy
 the kernel to 4008000 so the kernel should not be bigger than 7.5MiB but
 the other snippets from your log say the kernel is ~3.2MiB, so this
 should be fine.

 Cheers
   Detlev

 --
 The only thing that interferes with my learning is my education.
   -- Albert Einstein
 --
 DENX Software Engineering GmbH,  MD: Wolfgang Denk  Detlev Zundel
 HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
 Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: d...@denx.de

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


Re: [U-Boot] Compiling fw_printenv tool

2014-01-17 Thread Detlev Zundel
Hi Alexey,

[...]

 In case someone needs that (before the Makefile changes are accepted),
 I used the

 make HOSTCC='arm-none-linuex-gnueabi-gcc -static' env
 command to get it working.

We usually do put options into the HOSTCC variable.  Of course one can
argue about that, but the make documentation says about CC:

`CC'
 Program for compiling C programs; default `cc'.

and about

`CFLAGS'
 Extra flags to give to the C compiler.

So maybe you can do the same in a cleaner way like

make HOSTCC='arm-none-linux-gnueabi-gcc' HOSTCFLAGS='-static' env

Don't get me wrong, I don't want to win a beauty contest, but my
experience tells me that such oh this works for me quick and dirty
solutions tend to build up debt that can be hard to pay later on ;)

Cheers
  Detlev

-- 
The best way to predict the future is to invent it.
   -- Alan Kay
--
DENX Software Engineering GmbH,  MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: d...@denx.de
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] omap3_beagle: use omap3-beagle.dtb for the C4 revision

2014-01-17 Thread Tom Rini
On Fri, Jan 17, 2014 at 09:51:28AM -0600, Robert Nelson wrote:

 findftd is currently setting fdtfile to undefined for the beagle c4, select 
 omap3-beagle.dtb instead
 
 Signed-off-by: Robert Nelson robertcnel...@gmail.com

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] booting os 'Unknown OS' (1) is not supported

2014-01-17 Thread Detlev Zundel
Hi Alexander,

[...]

 *ERROR: booting os 'Unknown OS' (1) is not supported*

Hm, very strange.  Looking up the code, the '1' is the image type
contained in the uImage header.  It is defined to be OpenBSD in
include/image.h and if your U-Boot doesn't have support for that, you
will get that message.  This however doesn't make sense to have an
uImage with this type.

Can you do an 'mkimage -l image' on your development host to check the
contents of the header?  If this looks good, then somehow the image
seems to be overwritten before trying to boot, but I don't see where.

Cheers
  Detlev

-- 
I object to doing things that computers can do.   -- Olin Shivers
--
DENX Software Engineering GmbH,  MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: d...@denx.de
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] booting os 'Unknown OS' (1) is not supported

2014-01-17 Thread Alexander Khryukin
Can you do an 'mkimage -l image


[fedya@discordy linux-linaro-tracking]$ mkimage -l arch/arm/boot/uImage
Image Name:   Linux-3.13.0-rc8
Created:  Fri Jan 17 15:47:36 2014
Image Type:   ARM Linux Kernel Image (uncompressed)
Data Size:4737032 Bytes = 4626.01 kB = 4.52 MB
Load Address: 40008000
Entry Point:  40008000

source code: https://github.com/fedya/u-boot-yse5250



2014/1/17 Detlev Zundel d...@denx.de

 Hi Alexander,

 [...]

  *ERROR: booting os 'Unknown OS' (1) is not supported*

 Hm, very strange.  Looking up the code, the '1' is the image type
 contained in the uImage header.  It is defined to be OpenBSD in
 include/image.h and if your U-Boot doesn't have support for that, you
 will get that message.  This however doesn't make sense to have an
 uImage with this type.

 Can you do an 'mkimage -l image' on your development host to check the
 contents of the header?  If this looks good, then somehow the image
 seems to be overwritten before trying to boot, but I don't see where.

 Cheers
   Detlev

 --
 I object to doing things that computers can do.   -- Olin Shivers
 --
 DENX Software Engineering GmbH,  MD: Wolfgang Denk  Detlev Zundel
 HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
 Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: d...@denx.de

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


Re: [U-Boot] booting os 'Unknown OS' (1) is not supported

2014-01-17 Thread Detlev Zundel
Hi Alexander,

 Also if flashed 3.12_zImage (same kernel, same sources, just zImage)

Ok, zImage doesn't have the uImage header, so we will not see any
information nor will U-Boot be able to verify a checksum there.

 reading kernel..device 0 Start 1063, Count 16384
 MMC read: dev # 0, block # 1063, count 16384 ... 16384 blocks read: OK
 completed
 reading RFS..device 0 Count 17447, Start 2048
 MMC read: dev # 0, block # 17447, count 2048 ... 2048 blocks read: OK
 completed
 Boot with zImage
 Wrong Ramdisk Image Format

Note that you also have a problem with your ramdisk, even if the kernel
starts, it will likely not do much if it needs the ramdisk.

 Starting kernel ...


 And it's stucked at Starting kernel ...

Let's say we don't see anything after Starting kernel .  This is
also a common case when the kernel cannot open an initial console.  It
may well be that the kernel runs but without a console you will see
nothing.  To diagnose this you'd need to be sure that bootargs is
setup properly before booting the kernel.

Let's step back a bit.  Do you have a kernel and ramdisk and kernel
command line that works on your board?  I.e. do we have a working case
that we can retreat to for further tests?  Also is U-Boot and the kernel
mainline?

Cheers
  Detlev

-- 
The management question  ...  is not  _whether_  to build a pilot system
and throw it away.  You _will_ do that.  The only question is whether to
plan  in advance  to build  a throwaway,  or  to promise  to deliver the
throwaway to customers.  - Fred Brooks, The Mythical Man Month
--
DENX Software Engineering GmbH,  MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: d...@denx.de
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] booting os 'Unknown OS' (1) is not supported

2014-01-17 Thread Alexander Khryukin
Might i need a special arguments for mkimage
to set up OS in headers of uImage?


2014/1/17 Alexander Khryukin alexan...@mezon.ru

 Can you do an 'mkimage -l image


 [fedya@discordy linux-linaro-tracking]$ mkimage -l arch/arm/boot/uImage
 Image Name:   Linux-3.13.0-rc8
 Created:  Fri Jan 17 15:47:36 2014

 Image Type:   ARM Linux Kernel Image (uncompressed)
 Data Size:4737032 Bytes = 4626.01 kB = 4.52 MB

 Load Address: 40008000
 Entry Point:  40008000

 source code: https://github.com/fedya/u-boot-yse5250



 2014/1/17 Detlev Zundel d...@denx.de

 Hi Alexander,

 [...]

  *ERROR: booting os 'Unknown OS' (1) is not supported*

 Hm, very strange.  Looking up the code, the '1' is the image type
 contained in the uImage header.  It is defined to be OpenBSD in
 include/image.h and if your U-Boot doesn't have support for that, you
 will get that message.  This however doesn't make sense to have an
 uImage with this type.

 Can you do an 'mkimage -l image' on your development host to check the
 contents of the header?  If this looks good, then somehow the image
 seems to be overwritten before trying to boot, but I don't see where.

 Cheers
   Detlev

 --
 I object to doing things that computers can do.   -- Olin Shivers
 --
 DENX Software Engineering GmbH,  MD: Wolfgang Denk  Detlev Zundel
 HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
 Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: d...@denx.de



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


Re: [U-Boot] booting os 'Unknown OS' (1) is not supported

2014-01-17 Thread Alexander Khryukin
 Do you have a kernel and ramdisk and kernel
 command line that works on your board?

Yes, i have a working 3.0. kernel and ramdisk.img
it is an android image.

Linux version 3.0.15 (root@yicsystem) (gcc version 4.4.3 (GCC) ) #1 SMP
PREEMPT Thu Apr 25 14:28:59 KST 2013

 kernel command line

# cat /proc/cmdline
console=ttySAC1,115200n8 vmalloc=512M androidboot.console=ttySAC1

i built a kernel with same string.

 Also is U-Boot and the kernel
 mainline?
u-boot based on U-Boot 2012.12-0-g462762b-dirty with yse5250 platform
changes


And i tried a mainline u-boot and it's does not working.
Just an empty screen on terminal window.


2014/1/17 Detlev Zundel d...@denx.de

 Hi Alexander,

  Also if flashed 3.12_zImage (same kernel, same sources, just zImage)

 Ok, zImage doesn't have the uImage header, so we will not see any
 information nor will U-Boot be able to verify a checksum there.

  reading kernel..device 0 Start 1063, Count 16384
  MMC read: dev # 0, block # 1063, count 16384 ... 16384 blocks read: OK
  completed
  reading RFS..device 0 Count 17447, Start 2048
  MMC read: dev # 0, block # 17447, count 2048 ... 2048 blocks read: OK
  completed
  Boot with zImage
  Wrong Ramdisk Image Format

 Note that you also have a problem with your ramdisk, even if the kernel
 starts, it will likely not do much if it needs the ramdisk.

  Starting kernel ...
 
 
  And it's stucked at Starting kernel ...

 Let's say we don't see anything after Starting kernel .  This is
 also a common case when the kernel cannot open an initial console.  It
 may well be that the kernel runs but without a console you will see
 nothing.  To diagnose this you'd need to be sure that bootargs is
 setup properly before booting the kernel.

 Let's step back a bit.  Do you have a kernel and ramdisk and kernel
 command line that works on your board?  I.e. do we have a working case
 that we can retreat to for further tests?  Also is U-Boot and the kernel
 mainline?

 Cheers
   Detlev

 --
 The management question  ...  is not  _whether_  to build a pilot system
 and throw it away.  You _will_ do that.  The only question is whether to
 plan  in advance  to build  a throwaway,  or  to promise  to deliver the
 throwaway to customers.  - Fred Brooks, The Mythical Man Month
 --
 DENX Software Engineering GmbH,  MD: Wolfgang Denk  Detlev Zundel
 HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
 Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: d...@denx.de

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


Re: [U-Boot] booting os 'Unknown OS' (1) is not supported

2014-01-17 Thread Detlev Zundel
Hi Alexander,

 Might i need a special arguments for mkimage
 to set up OS in headers of uImage?

One needs parameters for that, but the information looks ok:

[...]

 [fedya@discordy linux-linaro-tracking]$ mkimage -l arch/arm/boot/uImage
 Image Name:   Linux-3.13.0-rc8
 Created:  Fri Jan 17 15:47:36 2014

 Image Type:   ARM Linux Kernel Image (uncompressed)
 ^

If you check common/image.c:261 (image_print_type), you'll see that this
is correctly decoded from the image, so the image seems perfectly fine.
It just makes no sense that U-Boot then complains about an unknown OS.
This means that between the time the header is printed and between the
time the code wants to boot it, the memory does not contain what it
should anymore.

Cheers
  Detlev

-- 
ike|abel - Eine Partnerschaft erweist sich als ikeabel, wenn ein samstäglicher
Besuch bei Ikea  weder zur sofortigen Trennung noch zu tagelangen Diskussionen
führt.  In einigen urbanen Subkulturen hat der gemeinsame Ikea-Besuch die Ver-
lobung vollständig ersetzt.-- Wortschatz v. Sascha Lobo
--
DENX Software Engineering GmbH,  MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: d...@denx.de
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] booting os 'Unknown OS' (1) is not supported

2014-01-17 Thread Alexander Khryukin
You have any suggestion how i can fix or hack it?
I really have no clue what's wrong and why it's working with android kernel
and not with mainline.


2014/1/17 Detlev Zundel d...@denx.de

 Hi Alexander,

  Might i need a special arguments for mkimage
  to set up OS in headers of uImage?

 One needs parameters for that, but the information looks ok:

 [...]

  [fedya@discordy linux-linaro-tracking]$ mkimage -l arch/arm/boot/uImage
  Image Name:   Linux-3.13.0-rc8
  Created:  Fri Jan 17 15:47:36 2014
 
  Image Type:   ARM Linux Kernel Image (uncompressed)
  ^

 If you check common/image.c:261 (image_print_type), you'll see that this
 is correctly decoded from the image, so the image seems perfectly fine.
 It just makes no sense that U-Boot then complains about an unknown OS.
 This means that between the time the header is printed and between the
 time the code wants to boot it, the memory does not contain what it
 should anymore.

 Cheers
   Detlev

 --
 ike|abel - Eine Partnerschaft erweist sich als ikeabel, wenn ein
 samstäglicher
 Besuch bei Ikea  weder zur sofortigen Trennung noch zu tagelangen
 Diskussionen
 führt.  In einigen urbanen Subkulturen hat der gemeinsame Ikea-Besuch die
 Ver-
 lobung vollständig ersetzt.-- Wortschatz v. Sascha Lobo
 --
 DENX Software Engineering GmbH,  MD: Wolfgang Denk  Detlev Zundel
 HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
 Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: d...@denx.de

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


Re: [U-Boot] [PATCH 2/3] sf: Shrink spi_slave {}

2014-01-17 Thread Marek Vasut
On Friday, January 17, 2014 at 03:41:46 PM, Jagannadha Sutradharudu Teki wrote:
 Combined spi flash stuff as minimum as possible.

Squashing the names of the flags only makes it unreadable :-(

 Signed-off-by: Jagannadha Sutradharudu Teki jaga...@xilinx.com
 Cc: Marek Vasut ma...@denx.de
 ---
  drivers/mtd/spi/sf.c   |  4 ++--
  drivers/mtd/spi/sf_ops.c   | 18 +-
  drivers/mtd/spi/sf_probe.c | 19 ---
  include/spi.h  | 45
 +++-- include/spi_flash.h|
  6 +++---
  5 files changed, 45 insertions(+), 47 deletions(-)
 
 diff --git a/drivers/mtd/spi/sf.c b/drivers/mtd/spi/sf.c
 index 664e860..fb91ac6 100644
 --- a/drivers/mtd/spi/sf.c
 +++ b/drivers/mtd/spi/sf.c
 @@ -19,8 +19,8 @@ static int spi_flash_read_write(struct spi_slave *spi,
   int ret;
 
  #ifdef CONFIG_SF_DUAL_FLASH
 - if (spi-flags  SPI_XFER_U_PAGE)
 - flags |= SPI_XFER_U_PAGE;
 + if (spi-mode_bits  SPI_U_PAGE)
 + flags |= SPI_U_PAGE;
  #endif
   if (data_len == 0)
   flags |= SPI_XFER_END;
 diff --git a/drivers/mtd/spi/sf_ops.c b/drivers/mtd/spi/sf_ops.c
 index 9650486..0d87e1b 100644
 --- a/drivers/mtd/spi/sf_ops.c
 +++ b/drivers/mtd/spi/sf_ops.c
 @@ -135,15 +135,15 @@ static int spi_flash_bank(struct spi_flash *flash,
 u32 offset) static void spi_flash_dual_flash(struct spi_flash *flash, u32
 *addr) {
   switch (flash-dual_flash) {
 - case SF_DUAL_STACKED_FLASH:
 + case SF_STACKED:
   if (*addr = (flash-size  1)) {
   *addr -= flash-size  1;
 - flash-spi-flags |= SPI_XFER_U_PAGE;
 + flash-spi-mode_bits |= SPI_U_PAGE;
   } else {
 - flash-spi-flags = ~SPI_XFER_U_PAGE;
 + flash-spi-mode_bits = ~SPI_U_PAGE;
   }
   break;
 - case SF_DUAL_PARALLEL_FLASH:
 + case SF_PARALLEL:
   *addr = flash-shift;
   break;
   default:
 @@ -170,8 +170,8 @@ int spi_flash_cmd_wait_ready(struct spi_flash *flash,
 unsigned long timeout) }
 
  #ifdef CONFIG_SF_DUAL_FLASH
 - if (spi-flags  SPI_XFER_U_PAGE)
 - flags |= SPI_XFER_U_PAGE;
 + if (spi-mode_bits  SPI_U_PAGE)
 + flags |= SPI_U_PAGE;
  #endif
   ret = spi_xfer(spi, 8, cmd, NULL, flags);
   if (ret) {
 @@ -261,7 +261,7 @@ int spi_flash_cmd_erase_ops(struct spi_flash *flash,
 u32 offset, size_t len) erase_addr = offset;
 
  #ifdef CONFIG_SF_DUAL_FLASH
 - if (flash-dual_flash  SF_SINGLE_FLASH)
 + if (flash-dual_flash  SF_SINGLE)
   spi_flash_dual_flash(flash, erase_addr);
  #endif
  #ifdef CONFIG_SPI_FLASH_BAR
 @@ -303,7 +303,7 @@ int spi_flash_cmd_write_ops(struct spi_flash *flash,
 u32 offset, write_addr = offset;
 
  #ifdef CONFIG_SF_DUAL_FLASH
 - if (flash-dual_flash  SF_SINGLE_FLASH)
 + if (flash-dual_flash  SF_SINGLE)
   spi_flash_dual_flash(flash, write_addr);
  #endif
  #ifdef CONFIG_SPI_FLASH_BAR
 @@ -388,7 +388,7 @@ int spi_flash_cmd_read_ops(struct spi_flash *flash, u32
 offset, read_addr = offset;
 
  #ifdef CONFIG_SF_DUAL_FLASH
 - if (flash-dual_flash  SF_SINGLE_FLASH)
 + if (flash-dual_flash  SF_SINGLE)
   spi_flash_dual_flash(flash, read_addr);
  #endif
  #ifdef CONFIG_SPI_FLASH_BAR
 diff --git a/drivers/mtd/spi/sf_probe.c b/drivers/mtd/spi/sf_probe.c
 index e84ab13..003f635 100644
 --- a/drivers/mtd/spi/sf_probe.c
 +++ b/drivers/mtd/spi/sf_probe.c
 @@ -133,8 +133,13 @@ static struct spi_flash
 *spi_flash_validate_params(struct spi_slave *spi, flash-spi = spi;
   flash-name = params-name;
   flash-memory_map = spi-memory_map;
 - flash-dual_flash = flash-spi-option;
 
 +#ifdef CONFIG_SF_DUAL_FLASH

Looks new and unrelated.

 + if (flash-spi-mode_bits  SPI_SHARED)
 + flash-dual_flash = SF_STACKED;
 + else if (flash-spi-mode_bits  SPI_SEPARATED)
 + flash-dual_flash = SF_PARALLEL;
 +#endif
   /* Assign spi_flash ops */
   flash-write = spi_flash_cmd_write_ops;
  #ifdef CONFIG_SPI_FLASH_SST
 @@ -145,12 +150,12 @@ static struct spi_flash
 *spi_flash_validate_params(struct spi_slave *spi, flash-read =
 spi_flash_cmd_read_ops;
 
   /* Compute the flash size */
 - flash-shift = (flash-dual_flash  SF_DUAL_PARALLEL_FLASH) ? 1 : 0;
 + flash-shift = (flash-dual_flash  SF_PARALLEL) ? 1 : 0;
   flash-page_size = ((ext_jedec == 0x4d00) ? 512 : 256)  flash-shift;
   flash-sector_size = params-sector_size  flash-shift;
   flash-size = flash-sector_size * params-nr_sectors  flash-shift;
  #ifdef CONFIG_SF_DUAL_FLASH
 - if (flash-dual_flash  SF_DUAL_STACKED_FLASH)
 + if (flash-dual_flash  SF_STACKED)
   flash-size = 1;
  #endif
 
 @@ -167,7 +172,7 @@ static struct spi_flash
 *spi_flash_validate_params(struct spi_slave 

Re: [U-Boot] [PATCH 3/3] sf: Use shortcut names

2014-01-17 Thread Marek Vasut
On Friday, January 17, 2014 at 03:41:47 PM, Jagannadha Sutradharudu Teki wrote:
 - SPI_FLASH - SF
 - ARRAY_SLOW - AS
 - ARRAY_FAST - AF
 - DUAL_OUTPUT_FAST - DOF
 - DUAL_IO_FAST - DIOF
 - QUAD_OUTPUT_FAST - QOF
 - QUAD_IO_FAST - QIOF

Now this really makes the code impossible to understand :-(

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 5/5] ext4: implement exists for ext4fs

2014-01-17 Thread Stephen Warren
On 01/16/2014 10:54 PM, Stefan Roese wrote:
 Hi Stephen,
 
 On 16.01.2014 22:53, Stephen Warren wrote:
 From: Stephen Warren swar...@nvidia.com

 This hooks into the generic file exists support added in an earlier
 patch, and provides an implementation for the ext4 filesystem.

 Signed-off-by: Stephen Warren swar...@nvidia.com
 ---
   fs/fat/fat.c  | 18 ++
   fs/fs.c   |  2 +-
   include/fat.h |  1 +
   3 files changed, 16 insertions(+), 5 deletions(-)
 
 Nitpicking, but the subject and the description mention ext4fs (copy
 and paste mistake). Please change it to fat to match the patch.

Thanks for pointing that out. I've fixed it locally. Once the series is
reviewed/... I can repost with the fix.

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


Re: [U-Boot] [PATCH 2/3] sf: Shrink spi_slave {}

2014-01-17 Thread Jagan Teki
On Fri, Jan 17, 2014 at 10:01 PM, Marek Vasut ma...@denx.de wrote:
 On Friday, January 17, 2014 at 03:41:46 PM, Jagannadha Sutradharudu Teki 
 wrote:
 Combined spi flash stuff as minimum as possible.

 Squashing the names of the flags only makes it unreadable :-(

 Signed-off-by: Jagannadha Sutradharudu Teki jaga...@xilinx.com
 Cc: Marek Vasut ma...@denx.de
 ---
  drivers/mtd/spi/sf.c   |  4 ++--
  drivers/mtd/spi/sf_ops.c   | 18 +-
  drivers/mtd/spi/sf_probe.c | 19 ---
  include/spi.h  | 45
 +++-- include/spi_flash.h|
  6 +++---
  5 files changed, 45 insertions(+), 47 deletions(-)

 diff --git a/drivers/mtd/spi/sf.c b/drivers/mtd/spi/sf.c
 index 664e860..fb91ac6 100644
 --- a/drivers/mtd/spi/sf.c
 +++ b/drivers/mtd/spi/sf.c
 @@ -19,8 +19,8 @@ static int spi_flash_read_write(struct spi_slave *spi,
   int ret;

  #ifdef CONFIG_SF_DUAL_FLASH
 - if (spi-flags  SPI_XFER_U_PAGE)
 - flags |= SPI_XFER_U_PAGE;
 + if (spi-mode_bits  SPI_U_PAGE)
 + flags |= SPI_U_PAGE;
  #endif
   if (data_len == 0)
   flags |= SPI_XFER_END;
 diff --git a/drivers/mtd/spi/sf_ops.c b/drivers/mtd/spi/sf_ops.c
 index 9650486..0d87e1b 100644
 --- a/drivers/mtd/spi/sf_ops.c
 +++ b/drivers/mtd/spi/sf_ops.c
 @@ -135,15 +135,15 @@ static int spi_flash_bank(struct spi_flash *flash,
 u32 offset) static void spi_flash_dual_flash(struct spi_flash *flash, u32
 *addr) {
   switch (flash-dual_flash) {
 - case SF_DUAL_STACKED_FLASH:
 + case SF_STACKED:
   if (*addr = (flash-size  1)) {
   *addr -= flash-size  1;
 - flash-spi-flags |= SPI_XFER_U_PAGE;
 + flash-spi-mode_bits |= SPI_U_PAGE;
   } else {
 - flash-spi-flags = ~SPI_XFER_U_PAGE;
 + flash-spi-mode_bits = ~SPI_U_PAGE;
   }
   break;
 - case SF_DUAL_PARALLEL_FLASH:
 + case SF_PARALLEL:
   *addr = flash-shift;
   break;
   default:
 @@ -170,8 +170,8 @@ int spi_flash_cmd_wait_ready(struct spi_flash *flash,
 unsigned long timeout) }

  #ifdef CONFIG_SF_DUAL_FLASH
 - if (spi-flags  SPI_XFER_U_PAGE)
 - flags |= SPI_XFER_U_PAGE;
 + if (spi-mode_bits  SPI_U_PAGE)
 + flags |= SPI_U_PAGE;
  #endif
   ret = spi_xfer(spi, 8, cmd, NULL, flags);
   if (ret) {
 @@ -261,7 +261,7 @@ int spi_flash_cmd_erase_ops(struct spi_flash *flash,
 u32 offset, size_t len) erase_addr = offset;

  #ifdef CONFIG_SF_DUAL_FLASH
 - if (flash-dual_flash  SF_SINGLE_FLASH)
 + if (flash-dual_flash  SF_SINGLE)
   spi_flash_dual_flash(flash, erase_addr);
  #endif
  #ifdef CONFIG_SPI_FLASH_BAR
 @@ -303,7 +303,7 @@ int spi_flash_cmd_write_ops(struct spi_flash *flash,
 u32 offset, write_addr = offset;

  #ifdef CONFIG_SF_DUAL_FLASH
 - if (flash-dual_flash  SF_SINGLE_FLASH)
 + if (flash-dual_flash  SF_SINGLE)
   spi_flash_dual_flash(flash, write_addr);
  #endif
  #ifdef CONFIG_SPI_FLASH_BAR
 @@ -388,7 +388,7 @@ int spi_flash_cmd_read_ops(struct spi_flash *flash, u32
 offset, read_addr = offset;

  #ifdef CONFIG_SF_DUAL_FLASH
 - if (flash-dual_flash  SF_SINGLE_FLASH)
 + if (flash-dual_flash  SF_SINGLE)
   spi_flash_dual_flash(flash, read_addr);
  #endif
  #ifdef CONFIG_SPI_FLASH_BAR
 diff --git a/drivers/mtd/spi/sf_probe.c b/drivers/mtd/spi/sf_probe.c
 index e84ab13..003f635 100644
 --- a/drivers/mtd/spi/sf_probe.c
 +++ b/drivers/mtd/spi/sf_probe.c
 @@ -133,8 +133,13 @@ static struct spi_flash
 *spi_flash_validate_params(struct spi_slave *spi, flash-spi = spi;
   flash-name = params-name;
   flash-memory_map = spi-memory_map;
 - flash-dual_flash = flash-spi-option;

 +#ifdef CONFIG_SF_DUAL_FLASH

 Looks new and unrelated.

 + if (flash-spi-mode_bits  SPI_SHARED)
 + flash-dual_flash = SF_STACKED;
 + else if (flash-spi-mode_bits  SPI_SEPARATED)
 + flash-dual_flash = SF_PARALLEL;
 +#endif
   /* Assign spi_flash ops */
   flash-write = spi_flash_cmd_write_ops;
  #ifdef CONFIG_SPI_FLASH_SST
 @@ -145,12 +150,12 @@ static struct spi_flash
 *spi_flash_validate_params(struct spi_slave *spi, flash-read =
 spi_flash_cmd_read_ops;

   /* Compute the flash size */
 - flash-shift = (flash-dual_flash  SF_DUAL_PARALLEL_FLASH) ? 1 : 0;
 + flash-shift = (flash-dual_flash  SF_PARALLEL) ? 1 : 0;
   flash-page_size = ((ext_jedec == 0x4d00) ? 512 : 256)  flash-shift;
   flash-sector_size = params-sector_size  flash-shift;
   flash-size = flash-sector_size * params-nr_sectors  flash-shift;
  #ifdef CONFIG_SF_DUAL_FLASH
 - if (flash-dual_flash  SF_DUAL_STACKED_FLASH)
 + if (flash-dual_flash  SF_STACKED)
   flash-size = 1;
  #endif

 @@ -167,7 +172,7 @@ static 

Re: [U-Boot] [PULL] : Please pull u-boot-imx

2014-01-17 Thread Fabio Estevam
Hi Tom,

On Fri, Jan 17, 2014 at 7:26 AM, Stefano Babic sba...@denx.de wrote:
 Hi Albert,

 Commit 022298278 (mx6: soc: Disable VDDPU regulator) does not let boot
 kernel with enabled GPU (i.MX6). It is unclear at the moment if the fix
 should be done in U-Boot or in kernel, so it is better to revert it for
 the release. Please pull from u-boot-imx, thanks !

In case Albert does not have time to send you his pull request, could
you please apply this one?

Thanks,

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


Re: [U-Boot] U-boot memory test results

2014-01-17 Thread Joe Kulikauskas
Hello aryanlak,

Am 17.01.2014 09:11, schrieb aryanlak:
 Hi all,

 I want to perform memory test (FLASH) during U-boot and read the results
 after the operating system (Linux) is booted up.
 Is it possible? If so, can anyone guide me to do so?

This could work by setting a u-boot environment variable with the POST
result. It would probably require adding some u-boot code, the baseline
puts POST results just into console output and maybe a memory loc IIRC.

If you had the environment variable, then you could get result from Linux
with fw_printenv.

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


Re: [U-Boot] booting os 'Unknown OS' (1) is not supported

2014-01-17 Thread Detlev Zundel
Hi Alexander,

 Do you have a kernel and ramdisk and kernel
 command line that works on your board?

 Yes, i have a working 3.0. kernel and ramdisk.img
 it is an android image.

 Linux version 3.0.15 (root@yicsystem) (gcc version 4.4.3 (GCC) ) #1 SMP
 PREEMPT Thu Apr 25 14:28:59 KST 2013

 kernel command line

 # cat /proc/cmdline
 console=ttySAC1,115200n8 vmalloc=512M androidboot.console=ttySAC1

 i built a kernel with same string.

Ok, good.

 Also is U-Boot and the kernel
 mainline?
 u-boot based on U-Boot 2012.12-0-g462762b-dirty with yse5250 platform
 changes


 And i tried a mainline u-boot and it's does not working.
 Just an empty screen on terminal window.

This is of course unfortunate as we are then not able to _really_ infer
what is going on on your board.  Potentially, there can be a lot of
changes in such modified versions.

Cheers
  Detlev

-- 
#!/usr/bin/perl
$c=print\\#\!\/usr\/bin\/perl\
\\\$c\=\.quotemeta\(\$c\)\.\;\\n\$c;\;
print#!/usr/bin/perl\n\$c=\.quotemeta($c).\;\n$c;;
--
DENX Software Engineering GmbH,  MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: d...@denx.de
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] booting os 'Unknown OS' (1) is not supported

2014-01-17 Thread Detlev Zundel
Hi Alexander,

 You have any suggestion how i can fix or hack it?
 I really have no clue what's wrong and why it's working with android kernel
 and not with mainline.

Well, potentially, there can be worlds of differences between such
kernels.  I don't know your platform at all, but is it expected to work
with a mainline kernel?

The only thing that I can think of to get more information is to edit
your bootcmd to only boot the kernel without any ramdisk and see if the
loading of the latter is the problem, i.e. something like that:

bootcmd=movi read kernel 0 4080;bootm 4080

Even though this cannot fully work, it may give us new input.

Cheers
  Detlev

-- 
;; Self-replicator in ELisp
((lambda (l) (prin1-to-string (list l (list (quote quote) l
 (quote (lambda (l) (prin1-to-string (list l (list (quote quote) l))
--
DENX Software Engineering GmbH,  MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: d...@denx.de
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/3] sf: Shrink spi_slave {}

2014-01-17 Thread Gerhard Sittig
On Fri, Jan 17, 2014 at 22:42 +0530, Jagan Teki wrote:
 
 On Fri, Jan 17, 2014 at 10:01 PM, Marek Vasut ma...@denx.de wrote:
 
  Anyway, I feel we're sinking deeper and deeper into this
  sh*t, we should instead take a step back and re-think the
  whole approach until we break it even more.
 
 Yes - will shrink once we plan for new approach.  But I'm
 unclear with new SPI-NOR.

Regarding this specific patch:  I assume what Marek suggested was
to restrict the SPI slave information to what's specific to an
SPI slave.  It's just not true that every SPI slave is a flash
chip (an assumption which QSPI developers appear to fall for
rather easily).

I was about to make a similar comment, that trimming the
identifiers so rigorously leads to code that only initiated
people can read.  Even those who want to learn have no chance,
there would not be a legend of any kind (except for the commit
message, which soon is buried and not obvious to look up).  And
even with the legend, it's tedious to train the casual
co-developer to those specific abbreviations, which may not even
be in wide spread use outside of the U-Boot code base.

So I agree with Marek that we should take a deep breath, and be
aware of the consequences before taking a specific direction (and
having a clear direction would also be beneficial).

A more involved answer I will send to the quad SPI thread.


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


  1   2   >