[U-Boot] [PATCH v2] zynq: disable -Wstrict-prototypes option for ps7_init.c

2014-05-28 Thread Masahiro Yamada
The files ps7_init.c and ps7_init.h are supposed to be generated by
hw projects such as Vivado, PlanAhead and then to be copied into
board/xilinx/zynq directory.

But some prototypes in them cause annoying warning messages:

  CC  spl/board/xilinx/zynq/ps7_init.o
In file included from board/xilinx/zynq/ps7_init.c:50:0:
board/xilinx/zynq/ps7_init.h:137:1: warning: function declaration isn't a 
prototype [-Wstrict-prototypes]
board/xilinx/zynq/ps7_init.h:138:1: warning: function declaration isn't a 
prototype [-Wstrict-prototypes]
board/xilinx/zynq/ps7_init.h:139:1: warning: function declaration isn't a 
prototype [-Wstrict-prototypes]
board/xilinx/zynq/ps7_init.h:145:1: warning: function declaration isn't a 
prototype [-Wstrict-prototypes]
board/xilinx/zynq/ps7_init.c:12602:1: warning: function declaration isn't a 
prototype [-Wstrict-prototypes]
board/xilinx/zynq/ps7_init.c:12723:1: warning: function declaration isn't a 
prototype [-Wstrict-prototypes]
board/xilinx/zynq/ps7_init.c:12742:1: warning: function declaration isn't a 
prototype [-Wstrict-prototypes]
board/xilinx/zynq/ps7_init.c:12761:1: warning: function declaration isn't a 
prototype [-Wstrict-prototypes]
board/xilinx/zynq/ps7_init.c:12854:6: warning: function declaration isn't a 
prototype [-Wstrict-prototypes]

The prototypes should be

  int ps7_init(void);
  int ps7_post_config(void);
  int ps7_debug(void);

rather than

  int ps7_init();
  int ps7_post_config();
  int ps7_debug();

We do not want to be bothered because of automatically generated files.
But we cannot touch the external projects for now.
What we can do is to disable -Wstrict-prototypes for ps7_init.c

Signed-off-by: Masahiro Yamada 
Cc: Michal Simek 
Tested-by: Michal Simek 
---

Changes in v2:
   No change in code. Some changes in git-log
  - Fix a typo:  s/causes/cause/
  - Add Tested-by credit

 board/xilinx/zynq/Makefile | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/board/xilinx/zynq/Makefile b/board/xilinx/zynq/Makefile
index fd93f63..71c0c35 100644
--- a/board/xilinx/zynq/Makefile
+++ b/board/xilinx/zynq/Makefile
@@ -10,3 +10,6 @@ obj-y := board.o
 # Please copy ps7_init.c/h from hw project to this directory
 obj-$(CONFIG_SPL_BUILD) += \
$(if $(wildcard $(srctree)/$(src)/ps7_init.c), ps7_init.o)
+
+# Suppress "warning: function declaration isn't a prototype"
+CFLAGS_REMOVE_ps7_init.o := -Wstrict-prototypes
-- 
1.9.1

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


Re: [U-Boot] NAND custodian (was Re: [PATCH v5 0/5] enable support for x16 NAND devices)

2014-05-28 Thread Heiko Schocher

Hello Tom,

Am 28.05.2014 23:00, schrieb Tom Rini:

On Tue, May 27, 2014 at 12:21:21PM -0500, Scott Wood wrote:

On Tue, 2014-05-27 at 11:48 +, Gupta, Pekon wrote:

Hello Scott, Tom,



From: Gupta, Pekon

*changes v4 ->  v5*
[PATCH 1/5]
[PATCH 2/5] fixed compilation error for OMAP3 platforms
[PATCH 3/5]
[PATCH 4/5] dropped old [PATCH] mtd: nand: omap: add 
CONFIG_SYS_NAND_BUSWIDTH_16BIT to
indicate NAND device bus-width
instead new [PATCH] mtd: nand: omap: add 
CONFIG_SYS_NAND_BUSWIDTH_16BIT to indicate
NAND device bus-width
[PATCH 5/5] additional cleanup in include/configs/cm_t35.h
Build tested for:  MAKEALL -s am33xx -s omap3 -s omap4 -s omap5
Rebased above series:  
http://lists.denx.de/pipermail/u-boot/2014-April/177323.html



This series few other patch series are awaiting response from
long time.


Sorry for the delay -- I've been fairly busy, and don't usually get
around to processing U-Boot patches until after the merge window closes.
The IRC channel topic has been lying and saying the merge window is
still open (also, http://www.denx.de/wiki/U-Boot/ReleaseCycle says that
the merge window is open and will close in negative 24 days).


Bah, I always forget to update those parts as well, beyond the actual
releases...


Given that I don't do much with NAND myself these days, that the patch
volume is higher than when I started as NAND custodian, and that I now
have maintainership duties in Linux competing for my time, I'm wondering
if someone else (maybe you or Heiko?) wants to step into the NAND
custodian role.


It's been a pleasure working with you.  Pekon? Heiko?  Either of you
interested in this particular role?  Thanks!


I am not a NAND expert and I am little bit under water currently...
(but if nobody else volunteers I can try it ...)

Pekon?

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 v1 2/4] spi, spi_mxc: do not hang in spi_xchg_single

2014-05-28 Thread Heiko Schocher

Hello Dirk,

Am 29.05.2014 07:12, schrieb Dirk Behme:

Am 28.05.2014 12:16, schrieb Heiko Schocher:

if status register do never set MXC_CSPICTRL_TC, spi_xchg_single
endless loops. Add a timeout here to prevent endless hang.


As I've never seen this, yet: Any idea what goes wrong if this happens?


I had a wrong pinmux (IIRC) and I saw this hang, so I thought
it would be good to not hang here ... but with correct pinmux
settings, I didn;t saw this anymore ... maybe unneeded patch?

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 v1 2/4] spi, spi_mxc: do not hang in spi_xchg_single

2014-05-28 Thread Dirk Behme

Am 28.05.2014 12:16, schrieb Heiko Schocher:

if status register do never set MXC_CSPICTRL_TC, spi_xchg_single
endless loops. Add a timeout here to prevent endless hang.


As I've never seen this, yet: Any idea what goes wrong if this happens?

Thanks

Dirk


Signed-off-by: Heiko Schocher 
Cc: Dirk Behme 
Cc: Jagannadha Sutradharudu Teki 
---
  drivers/spi/mxc_spi.c | 8 ++--
  1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/mxc_spi.c b/drivers/spi/mxc_spi.c
index f3f029d..3cd93cf 100644
--- a/drivers/spi/mxc_spi.c
+++ b/drivers/spi/mxc_spi.c
@@ -212,6 +212,7 @@ int spi_xchg_single(struct spi_slave *slave, unsigned int 
bitlen,
int nbytes = DIV_ROUND_UP(bitlen, 8);
u32 data, cnt, i;
struct cspi_regs *regs = (struct cspi_regs *)mxcs->base;
+   int timeout;

debug("%s: bitlen %d dout 0x%x din 0x%x\n",
__func__, bitlen, (u32)dout, (u32)din);
@@ -272,9 +273,12 @@ int spi_xchg_single(struct spi_slave *slave, unsigned int 
bitlen,
reg_write(®s->ctrl, mxcs->ctrl_reg |
MXC_CSPICTRL_EN | MXC_CSPICTRL_XCH);

+   timeout = 1;
/* Wait until the TC (Transfer completed) bit is set */
-   while ((reg_read(®s->stat) & MXC_CSPICTRL_TC) == 0)
-   ;
+   while (timeout && ((reg_read(®s->stat) & MXC_CSPICTRL_TC) == 0)) {
+   timeout--;
+   udelay(10);
+   }

/* Transfer completed, clear any pending request */
reg_write(®s->stat, MXC_CSPICTRL_TC | MXC_CSPICTRL_RXOVF);



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


Re: [U-Boot] [PATCH] zynq: disable -Wstrict-prototypes option for ps7_init.c

2014-05-28 Thread Michal Simek
On 05/29/2014 03:42 AM, Masahiro Yamada wrote:
> The files ps7_init.c and ps7_init.h are supposed to be generated by
> hw projects such as Vivado, PlanAhead and then to be copied into
> board/xilinx/zynq directory.
> 
> But some prototypes in them causes annoying warning messages:
> 
>   CC  spl/board/xilinx/zynq/ps7_init.o
> In file included from board/xilinx/zynq/ps7_init.c:50:0:
> board/xilinx/zynq/ps7_init.h:137:1: warning: function declaration isn't a 
> prototype [-Wstrict-prototypes]
> board/xilinx/zynq/ps7_init.h:138:1: warning: function declaration isn't a 
> prototype [-Wstrict-prototypes]
> board/xilinx/zynq/ps7_init.h:139:1: warning: function declaration isn't a 
> prototype [-Wstrict-prototypes]
> board/xilinx/zynq/ps7_init.h:145:1: warning: function declaration isn't a 
> prototype [-Wstrict-prototypes]
> board/xilinx/zynq/ps7_init.c:12602:1: warning: function declaration isn't a 
> prototype [-Wstrict-prototypes]
> board/xilinx/zynq/ps7_init.c:12723:1: warning: function declaration isn't a 
> prototype [-Wstrict-prototypes]
> board/xilinx/zynq/ps7_init.c:12742:1: warning: function declaration isn't a 
> prototype [-Wstrict-prototypes]
> board/xilinx/zynq/ps7_init.c:12761:1: warning: function declaration isn't a 
> prototype [-Wstrict-prototypes]
> board/xilinx/zynq/ps7_init.c:12854:6: warning: function declaration isn't a 
> prototype [-Wstrict-prototypes]
> 
> The prototypes should be
> 
>   int ps7_init(void);
>   int ps7_post_config(void);
>   int ps7_debug(void);
> 
> rather than
> 
>   int ps7_init();
>   int ps7_post_config();
>   int ps7_debug();
> 
> We do not want to be bothered because of automatically generated files.
> But we cannot touch the external projects for now.
> What we can do is to disable -Wstrict-prototypes for ps7_init.c
> 
> Signed-off-by: Masahiro Yamada 
> Cc: Michal Simek 
> ---
>  board/xilinx/zynq/Makefile | 3 +++
>  1 file changed, 3 insertions(+)

Tested-by: Michal Simek 

Thanks,
Michal

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




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


Re: [U-Boot] [PATCH v3 04/11] mx6: add boot device support for SPL

2014-05-28 Thread Tim Harvey
On Wed, May 28, 2014 at 9:38 AM, Nikita Kiryanov  wrote:
> Hi Tim,
> Sorry for the late reply.

no worries - your the only review of this revision thus far ;)

>
>
> On 08/05/14 08:16, Tim Harvey wrote:
>>
>> Add a common spl.c file to support boot device functions needed for SPL
>> such as detecting the boot device.
>>
>> Signed-off-by: Tim Harvey 
>> ---
>> v3:
>>   - added Freescale copyright
>>
>> v2:
>>   - re-base on top of Masahiro Yamada's consolidation patch:
>> http://patchwork.ozlabs.org/patch/341817/
>>   - moved spl_boot_device() and get_boot_mode() into own common imx spl.c
>> file
>>   - use mem-mapped structure for smbr reg access
>> ---
>
>
> [..snip..]
>
>
>> +   }
>> +   break;
>> +   /* SD/eSD: 8.5.3, Table 8-15  */
>> +   case 0x4:
>> +   case 0x5:
>> +   return BOOT_DEVICE_MMC1;
>> +   /* MMC/eMMC: 8.5.3 */
>> +   case 0x6:
>> +   case 0x7:
>> +   return BOOT_DEVICE_MMC1;
>> +   /* NAND Flash: 8.5.2 */
>> +   case 0x8 ... 0xf:
>> +   return BOOT_DEVICE_NAND;
>> +   }
>> +   return BOOT_DEVICE_NONE;
>> +}
>> +#endif
>> +
>> +#if defined(CONFIG_SPL_MMC_SUPPORT)
>> +/* called from spl_mmc to see type of boot mode for storage (RAW or FAT)
>> */
>> +u32 spl_boot_mode(void)
>> +{
>> +   switch (spl_boot_device()) {
>> +   /* for MMC return either RAW or FAT mode */
>> +   case BOOT_DEVICE_MMC1:
>> +   case BOOT_DEVICE_MMC2:
>
>
> spl_boot_device() returns only BOOT_DEVICE_MMC1. Was the MMC/eMMC case
> supposed to return a BOOT_DEVICE_MMC2?

Its hard to say - I think the use of BOOT_DEVICE_* is very
implementation specific. I don't quite understand why there is a
BOOT_DEVICE_MMC{1,2,2_2} defined in arch/arm/include/asm/spl.h - the
BOOT_DEVICE_MMC2_2 is certainly quite odd. In uboot/common/spl/spl.c
they are all treated the same and spl_mmc_load_image() always assumes
the 'first' mmc device anyway.

In the IMX6 case I'm not sure an SD/uSD card would be treated any
different than an MMC card so it would come down to which specific
device is flagged as the boot device, of which there are 4 sdhc's. So
eventually, one might need to add more BOOT_DEVICE_MMC enums if that
is to be supported. For now, I'm keeping it simple and there is an
issue with IMX6 spl_mmc_load_image() anyway which I plan on addressing
later.

Tim

>
> Aside from this nitpick,
> Acked-by: Nikita Kiryanov 
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3 06/11] mx6: add structs for mmdc and ddr iomux registers

2014-05-28 Thread Tim Harvey
On Wed, May 28, 2014 at 10:06 AM, Nikita Kiryanov  wrote:
> Hi Tim,
>
>
> On 08/05/14 08:16, Tim Harvey wrote:
>>
>> Add memory-mapped structures for MMDC iomux and configuration. Note that
>> the MMDC configuration registers are common between the IMX6DQ
>> (IMX6DUAL/IMX6QUAD) and IMX6SDL (IMX6SOLO/IMX6DUALLITE) the iomux
>> register addresses differ. This requires two sets of structures.
>>
>> Add structures to describe DDR3 device information, system information
>> (memory layout, etc), and MMDC calibration regitsers that can be used to
>> configure the MMDC dynamically.
>
>
> s/regitsers/registers

thanks - will address in the next revision or in a following the
commit if we can ever get this series committed.

>
>
>>
>> We define these structures for SPL builds instead of including mx6q-ddr.h
>> an
>> mx6dl-ddr.h which use the same namespace and are only useful for imximage
>> cf
>> files.
>
>
> What about the usefulness of the structs for U-Boot code? For example,
> it might be necessary for U-Boot code to query the MMDC registers to
> setup memory related variables like gd->ram_size and
> gd->bd->bi_dram[i].size. Sure this can be done using the #defines
> in the header files, but we lose nothing by making the structs
> available to U-Boot as well.
>

perhaps, but I would assume if anyone needs these in u-boot they can
broaden the scope when needed. There is an imx_ddr_size() function in
spl/arch/arm/imx-common/cpu.c that returns dram size based on MMDC
configuration already, yet it uses a subset of this structure that is
common to imx in general.

Regards,

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


[U-Boot] Please pick up the maintainership on orphan boards

2014-05-28 Thread Masahiro Yamada
Hi,

When I see boards.cfg file, I notice some email addresses are invalid.



Tom,
  Chan-Taek Park  is invalid address.
Can anybody in TI take over the maintainership of  "tnetv107x_evm" board?



Wolfgang,
Gary Jennejohn  is not working any more.
Is it possible to assign a new maintainer for "quad100hd" board?


Minkyu,
Inderpal Singh  is invalid.
Could you assign another enginner resposible for "arndale" board?



Linus,
Matt Waddel  is unreachable addres.
Can anybody pick up the maintainership on "vexpress_ca5x2"
and "vexpress_ca9x4" boards?



If nobody takes an action,
I will move those boards to Orphan.


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


[U-Boot] [PATCH] zynq: disable -Wstrict-prototypes option for ps7_init.c

2014-05-28 Thread Masahiro Yamada
The files ps7_init.c and ps7_init.h are supposed to be generated by
hw projects such as Vivado, PlanAhead and then to be copied into
board/xilinx/zynq directory.

But some prototypes in them causes annoying warning messages:

  CC  spl/board/xilinx/zynq/ps7_init.o
In file included from board/xilinx/zynq/ps7_init.c:50:0:
board/xilinx/zynq/ps7_init.h:137:1: warning: function declaration isn't a 
prototype [-Wstrict-prototypes]
board/xilinx/zynq/ps7_init.h:138:1: warning: function declaration isn't a 
prototype [-Wstrict-prototypes]
board/xilinx/zynq/ps7_init.h:139:1: warning: function declaration isn't a 
prototype [-Wstrict-prototypes]
board/xilinx/zynq/ps7_init.h:145:1: warning: function declaration isn't a 
prototype [-Wstrict-prototypes]
board/xilinx/zynq/ps7_init.c:12602:1: warning: function declaration isn't a 
prototype [-Wstrict-prototypes]
board/xilinx/zynq/ps7_init.c:12723:1: warning: function declaration isn't a 
prototype [-Wstrict-prototypes]
board/xilinx/zynq/ps7_init.c:12742:1: warning: function declaration isn't a 
prototype [-Wstrict-prototypes]
board/xilinx/zynq/ps7_init.c:12761:1: warning: function declaration isn't a 
prototype [-Wstrict-prototypes]
board/xilinx/zynq/ps7_init.c:12854:6: warning: function declaration isn't a 
prototype [-Wstrict-prototypes]

The prototypes should be

  int ps7_init(void);
  int ps7_post_config(void);
  int ps7_debug(void);

rather than

  int ps7_init();
  int ps7_post_config();
  int ps7_debug();

We do not want to be bothered because of automatically generated files.
But we cannot touch the external projects for now.
What we can do is to disable -Wstrict-prototypes for ps7_init.c

Signed-off-by: Masahiro Yamada 
Cc: Michal Simek 
---
 board/xilinx/zynq/Makefile | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/board/xilinx/zynq/Makefile b/board/xilinx/zynq/Makefile
index fd93f63..71c0c35 100644
--- a/board/xilinx/zynq/Makefile
+++ b/board/xilinx/zynq/Makefile
@@ -10,3 +10,6 @@ obj-y := board.o
 # Please copy ps7_init.c/h from hw project to this directory
 obj-$(CONFIG_SPL_BUILD) += \
$(if $(wildcard $(srctree)/$(src)/ps7_init.c), ps7_init.o)
+
+# Suppress "warning: function declaration isn't a prototype"
+CFLAGS_REMOVE_ps7_init.o := -Wstrict-prototypes
-- 
1.9.1

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


Re: [U-Boot] [PATCH v2] Exynos: Make sure ps_hold gets set in the SPL

2014-05-28 Thread Minkyu Kang
Dear Akshay Saraswat,

On 26/05/14 22:51, Akshay Saraswat wrote:
> From: Doug Anderson 
> 
> Setting ps_hold ought to be one of the first things we do when we
> first boot up. If we wait until the main u-boot runs we won't set it
> in time and the PMIC may power us back off.
> 
> Moving ps_hold setup into the generic power_init() which
> should contain code that's currently duplicated in the
> board_power_init() of several boards.
> 
> Signed-off-by: Doug Anderson 
> Signed-off-by: Akshay Saraswat 
> Acked-by: Simon Glass 
> ---
> Changes since v1:
>   - Added "Acked-by".
> 
>  arch/arm/cpu/armv7/exynos/lowlevel_init.c |6 +-
>  arch/arm/cpu/armv7/exynos/power.c |   14 ++
>  arch/arm/include/asm/arch-exynos/power.h  |8 
>  3 files changed, 27 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/cpu/armv7/exynos/lowlevel_init.c 
> b/arch/arm/cpu/armv7/exynos/lowlevel_init.c
> index 11fe5b8..ed966bc 100644
> --- a/arch/arm/cpu/armv7/exynos/lowlevel_init.c
> +++ b/arch/arm/cpu/armv7/exynos/lowlevel_init.c
> @@ -39,6 +39,7 @@ enum {
>   DO_CLOCKS   = 1 << 1,
>   DO_MEM_RESET= 1 << 2,
>   DO_UART = 1 << 3,
> + DO_POWER= 1 << 4,
>  };
>  
>  int do_lowlevel_init(void)
> @@ -60,9 +61,12 @@ int do_lowlevel_init(void)
>   break;
>   default:
>   /* This is a normal boot (not a wake from sleep) */
> - actions = DO_CLOCKS | DO_MEM_RESET;
> + actions = DO_CLOCKS | DO_MEM_RESET | DO_POWER;
>   }
>  
> + if (actions & DO_POWER)
> + power_init();

I think we don't have to make new function.
Please call set_ps_hold_ctrl directly.

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


Re: [U-Boot] [PATCH] arm:board:exynos4: add CONFIG_SYS_GENERIC_BOARD

2014-05-28 Thread Minkyu Kang
On 22/05/14 15:45, Piotr Wilczek wrote:
> Add CONFIG_SYS_GENERIC_BOARD for all Exynos4 boards.
> 
> Signed-off-by: Piotr Wilczek 
> 
> Cc: Przemyslaw Marczak 
> Cc: Lukasz Majewski 
> Cc: Minkyu Kang 
> ---
>  include/configs/exynos4-dt.h | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/include/configs/exynos4-dt.h b/include/configs/exynos4-dt.h
> index 0c560ae..44e6ab4 100644
> --- a/include/configs/exynos4-dt.h
> +++ b/include/configs/exynos4-dt.h
> @@ -20,6 +20,7 @@
>  #define CONFIG_DISPLAY_CPUINFO
>  #define CONFIG_DISPLAY_BOARDINFO
>  #define CONFIG_BOARD_COMMON
> +#define CONFIG_SYS_GENERIC_BOARD
>  
>  /* Enable fdt support */
>  #define CONFIG_OF_CONTROL
> 

applied to u-boot-samsung

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


Re: [U-Boot] [PATCH v3 0/12] Enable LCD display on snow

2014-05-28 Thread Minkyu Kang
On 20/05/14 21:01, Simon Glass wrote:
> This series adds a driver for TPS65090 and plumbs it in to get the LCD
> working correctly on snow.
> 
> The display driver is already present, but needs information about the
> display to be provided in the device tree.
> 
> The backlight also needs to be enabled - it is controlled by a FET on
> the TPS65090. Note that the TPS65090 is controlled by the device tree
> so will only be present if the board's device tree file specifies it.
> At present this is only the case for snow, but other exynos5 boards will
> use it (e.g. pit).
> 
> Note: the TPS65090 driver was sent to the list around the middle of last
> year but was never applied.
> 
> Changes in v3:
> - Add new patch to correct EC interrupt GPIO
> - Rebase on samsung/master
> - Remove extra blank lines in two places
> - Use !! style instead ternary operator
> - Change the ptn3460 comment to indicate a TODO for device tree GPIOs
> - Rename MAX_TRIES to lower case
> - Rename onoff to on
> - Use generic GPIO API
> - Drop patch "exynos: dts: Disable cros_ec interrupts due to broken GPIOs"
> 
> Changes in v2:
> - Add new patch to drop smdk5250.c file
> - Add new patch to rename CHARGER_EN/DISABLE
> - Removed non-device-tree operation
> - Use errno.h for error return codes everywhere
> - Plumb into pmic charging framework
> - Fix style nit
> - Use correct license header
> - Use new Linux device tree bindings
> - Add partial battery charging support
> - Update patch name to exynos5-dt instead of smdk5250
> - Move code to exynos5-dt.c
> - Fix comment style
> - Add #ifdef around tps65090 code
> - Add a device tree node for the snow EDP bridge chip
> - Only set up the EDP bridge for snow
> - Add a device tree compatibility string for the EDP bridge
> - Check for EDP failure and print an error in that case
> - Return immediately in exynos_backlight_on() if needed
> - Rebase to samsung/master
> 
> Aaron Durbin (3):
>   exynos5: Enable tps65090 on exynos5-dt
>   power: Explicitly select pmic device's bus
>   exynos5: support tps65090 pmic
> 
> Simon Glass (8):
>   exynos: dts: Correct EC interrupt GPIO
>   exynos: Drop old smdk5250.c file
>   power: Rename CONFIG_PMIC_... to CONFIG_POWER_...
>   power: Add PMIC_ prefix to CHARGER_EN/DISABLE
>   exynos: Enable PSHOLD in SPL
>   exynos: dts: Enable LCD for snow
>   exynos: Enable the LCD backlight for snow
>   initcall: Improve debugging support
> 
> Tom Wai-Hong Tam (1):
>   power: Add support for TPS65090 PMU chip.
> 
>  arch/arm/cpu/armv7/exynos/lowlevel_init.c   |   2 +
>  arch/arm/dts/exynos5250-snow.dts|  61 +++-
>  board/samsung/smdk5250/Makefile |   4 -
>  board/samsung/smdk5250/exynos5-dt.c | 238 +++-
>  board/samsung/smdk5250/smdk5250.c   | 363 
> 
>  doc/device-tree-bindings/power/tps65090.txt |  17 ++
>  doc/device-tree-bindings/regulator/tps65090.txt | 122 
>  drivers/power/battery/bat_trats.c   |   4 +-
>  drivers/power/battery/bat_trats2.c  |   2 +-
>  drivers/power/mfd/pmic_max77693.c   |   2 +-
>  drivers/power/pmic/Makefile |   1 +
>  drivers/power/pmic/pmic_max8997.c   |   2 +-
>  drivers/power/pmic/pmic_tps65090.c  | 310 
>  drivers/power/power_fsl.c   |   6 +-
>  drivers/power/power_i2c.c   |   4 +
>  include/configs/arndale.h   |   4 +-
>  include/configs/exynos5-dt.h|   1 +
>  include/configs/exynos5250-dt.h |   2 +-
>  include/configs/mx25pdk.h   |   2 +-
>  include/configs/mx35pdk.h   |   2 +-
>  include/configs/mx53evk.h   |   2 +-
>  include/configs/mx53loco.h  |   2 +-
>  include/configs/woodburn_common.h   |   2 +-
>  include/fdtdec.h|   2 +
>  include/initcall.h  |   2 +-
>  include/power/max77693_pmic.h   |   2 -
>  include/power/max8997_pmic.h|   1 -
>  include/power/pmic.h|   5 +
>  include/power/tps65090_pmic.h   |  73 +
>  lib/fdtdec.c|   2 +
>  lib/initcall.c  |  17 +-
>  31 files changed, 864 insertions(+), 395 deletions(-)
>  delete mode 100644 board/samsung/smdk5250/smdk5250.c
>  create mode 100644 doc/device-tree-bindings/power/tps65090.txt
>  create mode 100644 doc/device-tree-bindings/regulator/tps65090.txt
>  create mode 100644 drivers/power/pmic/pmic_tps65090.c
>  create mode 100644 include/power/tps65090_pmic.h
> 

applied to u-boot-samsung

Thanks,
Minkyu Kang.

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


[U-Boot] [Patch v3 2/4] ARMv8/FSL_LSCH3: Add FSL_LSCH3 SoC

2014-05-28 Thread York Sun
Freescale LayerScape with Chassis Generation 3 is a set of SoCs with
ARMv8 cores and 3rd generation of Chassis. We use different MMU setup
to support memory map and cache attribute for these SoCs. MMU and cache
are enabled very early to bootst performance, especially for early
development on emulators. After u-boot relocates to DDR, a new MMU
table with QBMan cache access is created in DDR. SMMU pagesize is set
in SMMU_sACR register. Both DDR3 and DDR4 are supported.

Signed-off-by: York Sun 
Signed-off-by: Varun Sethi 
Signed-off-by: Arnab Basu 
---
Change log:
 v3: Remove blank lines at the of files
 Fix cluster PLL GSR register for accessing beyond array size
 Update final MMU table to support QBMan memory with cache
 Set SMMU pagesize in SMMU_sACR register in lowlevel init.
 Add DDR4 support
 Remove forcing L3 cache flusing
 Update GICv3 redistributor base address

 Some of these changes are caused by model change.

 arch/arm/cpu/armv8/cache_v8.c |7 +-
 arch/arm/cpu/armv8/fsl-lsch3/Makefile |   10 +
 arch/arm/cpu/armv8/fsl-lsch3/README   |   10 +
 arch/arm/cpu/armv8/fsl-lsch3/cpu.c|  474 +
 arch/arm/cpu/armv8/fsl-lsch3/cpu.h|7 +
 arch/arm/cpu/armv8/fsl-lsch3/lowlevel.S   |   65 +++
 arch/arm/cpu/armv8/fsl-lsch3/speed.c  |  176 
 arch/arm/cpu/armv8/fsl-lsch3/speed.h  |7 +
 arch/arm/cpu/armv8/fsl-lsch3/timer.c  |   62 +++
 arch/arm/include/asm/arch-fsl-lsch3/clock.h   |   23 +
 arch/arm/include/asm/arch-fsl-lsch3/config.h  |   65 +++
 arch/arm/include/asm/arch-fsl-lsch3/gpio.h|9 +
 arch/arm/include/asm/arch-fsl-lsch3/immap_lsch3.h |  116 +
 arch/arm/include/asm/arch-fsl-lsch3/imx-regs.h|   13 +
 arch/arm/include/asm/arch-fsl-lsch3/mmu.h |   10 +
 arch/arm/include/asm/config.h |4 +
 arch/arm/include/asm/system.h |2 +
 drivers/i2c/mxc_i2c.c |5 +
 include/common.h  |5 +-
 19 files changed, 1066 insertions(+), 4 deletions(-)
 create mode 100644 arch/arm/cpu/armv8/fsl-lsch3/Makefile
 create mode 100644 arch/arm/cpu/armv8/fsl-lsch3/README
 create mode 100644 arch/arm/cpu/armv8/fsl-lsch3/cpu.c
 create mode 100644 arch/arm/cpu/armv8/fsl-lsch3/cpu.h
 create mode 100644 arch/arm/cpu/armv8/fsl-lsch3/lowlevel.S
 create mode 100644 arch/arm/cpu/armv8/fsl-lsch3/speed.c
 create mode 100644 arch/arm/cpu/armv8/fsl-lsch3/speed.h
 create mode 100644 arch/arm/cpu/armv8/fsl-lsch3/timer.c
 create mode 100644 arch/arm/include/asm/arch-fsl-lsch3/clock.h
 create mode 100644 arch/arm/include/asm/arch-fsl-lsch3/config.h
 create mode 100644 arch/arm/include/asm/arch-fsl-lsch3/gpio.h
 create mode 100644 arch/arm/include/asm/arch-fsl-lsch3/immap_lsch3.h
 create mode 100644 arch/arm/include/asm/arch-fsl-lsch3/imx-regs.h
 create mode 100644 arch/arm/include/asm/arch-fsl-lsch3/mmu.h

diff --git a/arch/arm/cpu/armv8/cache_v8.c b/arch/arm/cpu/armv8/cache_v8.c
index a96ecda..c47acba 100644
--- a/arch/arm/cpu/armv8/cache_v8.c
+++ b/arch/arm/cpu/armv8/cache_v8.c
@@ -83,12 +83,17 @@ void invalidate_dcache_all(void)
__asm_invalidate_dcache_all();
 }
 
+void __weak flush_l3_cache(void)
+{
+}
+
 /*
  * Performs a clean & invalidation of the entire data cache at all levels
  */
 void flush_dcache_all(void)
 {
__asm_flush_dcache_all();
+   flush_l3_cache();
 }
 
 /*
@@ -221,7 +226,7 @@ void invalidate_icache_all(void)
  * Enable dCache & iCache, whether cache is actually enabled
  * depend on CONFIG_SYS_DCACHE_OFF and CONFIG_SYS_ICACHE_OFF
  */
-void enable_caches(void)
+void __weak enable_caches(void)
 {
icache_enable();
dcache_enable();
diff --git a/arch/arm/cpu/armv8/fsl-lsch3/Makefile 
b/arch/arm/cpu/armv8/fsl-lsch3/Makefile
new file mode 100644
index 000..4b859cf
--- /dev/null
+++ b/arch/arm/cpu/armv8/fsl-lsch3/Makefile
@@ -0,0 +1,10 @@
+#
+# Copyright 2014, Freescale Semiconductor
+#
+# SPDX-License-Identifier: GPL-2.0+
+#
+
+obj-y += cpu.o
+obj-y += timer.o
+obj-y += lowlevel.o
+obj-y += speed.o
diff --git a/arch/arm/cpu/armv8/fsl-lsch3/README 
b/arch/arm/cpu/armv8/fsl-lsch3/README
new file mode 100644
index 000..de34a91
--- /dev/null
+++ b/arch/arm/cpu/armv8/fsl-lsch3/README
@@ -0,0 +1,10 @@
+#
+# Copyright 2014 Freescale Semiconductor
+#
+# SPDX-License-Identifier:  GPL-2.0+
+#
+
+Freescale LayerScape with Chassis Generation 3
+
+This architecture supports Freescale ARMv8 SoCs with Chassis generation 3,
+for example LS2100A.
diff --git a/arch/arm/cpu/armv8/fsl-lsch3/cpu.c 
b/arch/arm/cpu/armv8/fsl-lsch3/cpu.c
new file mode 100644
index 000..2780390
--- /dev/null
+++ b/arch/arm/cpu/armv8/fsl-lsch3/cpu.c
@@ -0,0 +1,474 @@
+/*
+ * Copyright 2014 Freescale Semiconductor, Inc.
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#include 
+#include 
+#include

[U-Boot] [Patch v3 4/4] ARMv8/ls2100a_emu: Add LS2100A emulator and simulator board support

2014-05-28 Thread York Sun
LS2100A is an ARMv8 implementation. This adds board support for emulator
and simulator:
  Two DDR controllers
  UART2 is used as the console
  IFC timing is tightened for speedy booting
  Support DDR3 and DDR4 as separated targets
  Management Complex (MC) is enabled

Signed-off-by: York Sun 
Signed-off-by: Arnab Basu 
Signed-off-by: J. German Rivera 
Signed-off-by: Bhupesh Sharma 
---
Change log:
 v3: Add support for DDR4 target and simulator target
 Squash Manage complex patch (previous 5/5) into this
 Reserve last 512MB memory for MC use
 Change MC firmware location in NOR flash
 Fix UART clock source speed
 Update IFC address mux
 Use generic board
 Disable DDR memory beyound 39 physical address space due to Linux 
limitation

 Some of these changes are caused by model changing.


 board/freescale/ls2100a/Makefile  |8 ++
 board/freescale/ls2100a/README|   16 +++
 board/freescale/ls2100a/ddr.c |  175 
 board/freescale/ls2100a/ddr.h |   57 ++
 board/freescale/ls2100a/ls2100a.c |  100 
 boards.cfg|3 +
 include/configs/ls2100a_common.h  |  226 +
 include/configs/ls2100a_emu.h |   19 
 include/configs/ls2100a_simu.h|   16 +++
 9 files changed, 620 insertions(+)
 create mode 100644 board/freescale/ls2100a/Makefile
 create mode 100644 board/freescale/ls2100a/README
 create mode 100644 board/freescale/ls2100a/ddr.c
 create mode 100644 board/freescale/ls2100a/ddr.h
 create mode 100644 board/freescale/ls2100a/ls2100a.c
 create mode 100644 include/configs/ls2100a_common.h
 create mode 100644 include/configs/ls2100a_emu.h
 create mode 100644 include/configs/ls2100a_simu.h

diff --git a/board/freescale/ls2100a/Makefile b/board/freescale/ls2100a/Makefile
new file mode 100644
index 000..c8da338
--- /dev/null
+++ b/board/freescale/ls2100a/Makefile
@@ -0,0 +1,8 @@
+#
+# Copyright 2014 Freescale Semiconductor
+#
+# SPDX-License-Identifier: GPL-2.0+
+#
+
+obj-y += ls2100a.o
+obj-y += ddr.o
diff --git a/board/freescale/ls2100a/README b/board/freescale/ls2100a/README
new file mode 100644
index 000..9a8a618
--- /dev/null
+++ b/board/freescale/ls2100a/README
@@ -0,0 +1,16 @@
+Freescale ls2100a_emu
+
+This is a emulator target with limited peripherals.
+
+Memory map from core's view
+
+0x00__ .. 0x00_000F_   Boot Rom
+0x00_0100_ .. 0x00_0FFF_   CCSR
+0x00_1800_ .. 0x00_181F_   OCRAM
+0x00_3000_ .. 0x00_3FFF_   IFC region #1
+0x00_8000_ .. 0x00__   DDR region #1
+0x05_1000_ .. 0x05__   IFC region #2
+0x80_8000_ .. 0xFF__   DDR region #2
+
+Other addresses are either reserved, or not used directly by u-boot.
+This list should be updated when more addresses are used.
diff --git a/board/freescale/ls2100a/ddr.c b/board/freescale/ls2100a/ddr.c
new file mode 100644
index 000..257bc16
--- /dev/null
+++ b/board/freescale/ls2100a/ddr.c
@@ -0,0 +1,175 @@
+/*
+ * Copyright 2014 Freescale Semiconductor, Inc.
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#include 
+#include 
+#include 
+#include "ddr.h"
+
+DECLARE_GLOBAL_DATA_PTR;
+
+void fsl_ddr_board_options(memctl_options_t *popts,
+   dimm_params_t *pdimm,
+   unsigned int ctrl_num)
+{
+   const struct board_specific_parameters *pbsp, *pbsp_highest = NULL;
+   ulong ddr_freq;
+
+   if (ctrl_num > 3) {
+   printf("Not supported controller number %d\n", ctrl_num);
+   return;
+   }
+   if (!pdimm->n_ranks)
+   return;
+
+   /*
+* we use identical timing for all slots. If needed, change the code
+* to  pbsp = rdimms[ctrl_num] or pbsp = udimms[ctrl_num];
+*/
+   if (popts->registered_dimm_en)
+   pbsp = rdimms[0];
+   else
+   pbsp = udimms[0];
+
+
+   /* Get clk_adjust, wrlvl_start, wrlvl_ctl, according to the board ddr
+* freqency and n_banks specified in board_specific_parameters table.
+*/
+   ddr_freq = get_ddr_freq(0) / 100;
+   while (pbsp->datarate_mhz_high) {
+   if (pbsp->n_ranks == pdimm->n_ranks &&
+   (pdimm->rank_density >> 30) >= pbsp->rank_gb) {
+   if (ddr_freq <= pbsp->datarate_mhz_high) {
+   popts->clk_adjust = pbsp->clk_adjust;
+   popts->wrlvl_start = pbsp->wrlvl_start;
+   popts->wrlvl_ctl_2 = pbsp->wrlvl_ctl_2;
+   popts->wrlvl_ctl_3 = pbsp->wrlvl_ctl_3;
+   goto found;
+   }
+   pbsp_highest = pbsp;
+   }
+   pbsp++;
+   }
+
+   if (pbsp_highest) {
+   printf("Error: board specific timing not found for data r

[U-Boot] [Patch v3 3/4] armv8/fsl-lsch3: Add support to load and start MC Firmware

2014-05-28 Thread York Sun
From: "J. German Rivera" 

Adding supoort to load and start the Layerscape Management Complex (MC)
firmware. First, the MC GCR register is set to 0 to reset all cores. MC
firmware and DPL images are copied from their location in NOR flash to
DDR. MC registers are updated with the location of these images.
Deasserting the reset bit of MC GCR register releases core 0 to run.
Core 1 will be released by MC firmware. Stop bits are not touched for
this step. U-boot waits for MC until it boots up. In case of a failure,
device tree is updated accordingly. The MC firmware image uses FIT format.

Signed-off-by: J. German Rivera 
Signed-off-by: York Sun 
Signed-off-by: Lijun Pan 
Signed-off-by: Shruti Kanetkar 
---
Change log:
 v3: Add error detection and update device tree if failure
 Revise loading address to avoid overlap
 Use FIT image for the firmware
 Remove blank lines at the end of files

 README |   27 
 arch/arm/cpu/armv8/fsl-lsch3/cpu.c |   11 ++
 drivers/net/Makefile   |1 +
 drivers/net/fsl_mc/Makefile|8 ++
 drivers/net/fsl_mc/mc.c|  274 
 include/fdt_support.h  |   14 +-
 include/fsl_mc.h   |   59 
 7 files changed, 391 insertions(+), 3 deletions(-)
 create mode 100644 drivers/net/fsl_mc/Makefile
 create mode 100644 drivers/net/fsl_mc/mc.c
 create mode 100644 include/fsl_mc.h

diff --git a/README b/README
index a280435..95a0282 100644
--- a/README
+++ b/README
@@ -4640,6 +4640,33 @@ within that device.
window->master inbound window->master LAW->the ucode address in
master's memory space.
 
+Freescale Layerscape Management Complex Firmware Support:
+-
+The Freescale Layerscape Management Complex (MC) supports the loading of
+"firmware".
+This firmware often needs to be loaded during U-Boot booting, so macros
+are used to identify the storage device (NOR flash, SPI, etc) and the address
+within that device.
+
+- CONFIG_FSL_MC_ENET
+   Enable the MC driver for Layerscape SoCs.
+
+- CONFIG_SYS_LS_MC_FW_ADDR
+   The address in the storage device where the firmware is located.  The
+   meaning of this address depends on which CONFIG_SYS_LS_MC_FW_IN_xxx 
macro
+   is also specified.
+
+- CONFIG_SYS_LS_MC_FW_LENGTH
+   The maximum possible size of the firmware.  The firmware binary format
+   has a field that specifies the actual size of the firmware, but it
+   might not be possible to read any part of the firmware unless some
+   local storage is allocated to hold the entire firmware first.
+
+- CONFIG_SYS_LS_MC_FW_IN_NOR
+   Specifies that MC firmware is located in NOR flash, mapped as
+   normal addressable memory via the LBC. CONFIG_SYS_LS_MC_FW_ADDR is the
+   virtual address in NOR flash.
+
 Building the Software:
 ==
 
diff --git a/arch/arm/cpu/armv8/fsl-lsch3/cpu.c 
b/arch/arm/cpu/armv8/fsl-lsch3/cpu.c
index 2780390..42fbbdb 100644
--- a/arch/arm/cpu/armv8/fsl-lsch3/cpu.c
+++ b/arch/arm/cpu/armv8/fsl-lsch3/cpu.c
@@ -12,6 +12,7 @@
 #include 
 #include "cpu.h"
 #include "speed.h"
+#include 
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -472,3 +473,13 @@ int print_cpuinfo(void)
return 0;
 }
 #endif
+
+int cpu_eth_init(bd_t *bis)
+{
+   int error = 0;
+
+#ifdef CONFIG_FSL_MC_ENET
+   error = mc_init(bis);
+#endif
+   return error;
+}
diff --git a/drivers/net/Makefile b/drivers/net/Makefile
index 6005f7e..6226cb2 100644
--- a/drivers/net/Makefile
+++ b/drivers/net/Makefile
@@ -64,3 +64,4 @@ obj-$(CONFIG_XILINX_EMACLITE) += xilinx_emaclite.o
 obj-$(CONFIG_XILINX_LL_TEMAC) += xilinx_ll_temac.o xilinx_ll_temac_mdio.o \
xilinx_ll_temac_fifo.o xilinx_ll_temac_sdma.o
 obj-$(CONFIG_ZYNQ_GEM) += zynq_gem.o
+obj-$(CONFIG_FSL_MC_ENET) += fsl_mc/
diff --git a/drivers/net/fsl_mc/Makefile b/drivers/net/fsl_mc/Makefile
new file mode 100644
index 000..4834086
--- /dev/null
+++ b/drivers/net/fsl_mc/Makefile
@@ -0,0 +1,8 @@
+#
+# Copyright 2014 Freescale Semiconductor, Inc.
+#
+# SPDX-License-Identifier: GPL-2.0+
+#
+
+# Layerscape MC driver
+obj-y += mc.o
diff --git a/drivers/net/fsl_mc/mc.c b/drivers/net/fsl_mc/mc.c
new file mode 100644
index 000..58fd674
--- /dev/null
+++ b/drivers/net/fsl_mc/mc.c
@@ -0,0 +1,274 @@
+/*
+ * Copyright (C) 2014 Freescale Semiconductor
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+#include 
+#include 
+#include 
+
+DECLARE_GLOBAL_DATA_PTR;
+static int mc_boot_status;
+
+/**
+ * Copying MC firmware or DPL image to DDR
+ */
+static int mc_copy_image(const char *title,
+   u64 image_addr, u32 image_size, u64 mc_ram_addr)
+{
+   debug("%s copied to address %p\n", title, (void *)mc_ram_addr);
+   memcpy((void *)mc_ram_addr, (void *)image_addr, image_size);
+   return 0;
+}
+
+/**
+ * MC firmware FIT image parser checks if the image is in FIT
+ 

[U-Boot] [Patch v3 1/4] Added 64-bit MMIO accessors for ARMv8

2014-05-28 Thread York Sun
From: "J. German Rivera" 

This is needed for accessing peripherals with 64-bit MMIO registers,
from ARMv8 processors.

Signed-off-by: J. German Rivera 
---
Change log:
 v3: No change. The blank line mentioned in review is in the other patch.

 arch/arm/include/asm/io.h |8 
 1 file changed, 8 insertions(+)

diff --git a/arch/arm/include/asm/io.h b/arch/arm/include/asm/io.h
index 6a1f05a..95528dd 100644
--- a/arch/arm/include/asm/io.h
+++ b/arch/arm/include/asm/io.h
@@ -70,10 +70,12 @@ static inline phys_addr_t virt_to_phys(void * vaddr)
 #define __arch_getb(a) (*(volatile unsigned char *)(a))
 #define __arch_getw(a) (*(volatile unsigned short *)(a))
 #define __arch_getl(a) (*(volatile unsigned int *)(a))
+#define __arch_getq(a) (*(volatile unsigned long long *)(a))
 
 #define __arch_putb(v,a)   (*(volatile unsigned char *)(a) = (v))
 #define __arch_putw(v,a)   (*(volatile unsigned short *)(a) = (v))
 #define __arch_putl(v,a)   (*(volatile unsigned int *)(a) = (v))
+#define __arch_putq(v,a)   (*(volatile unsigned long long *)(a) = 
(v))
 
 extern inline void __raw_writesb(unsigned long addr, const void *data,
 int bytelen)
@@ -123,10 +125,12 @@ extern inline void __raw_readsl(unsigned long addr, void 
*data, int longlen)
 #define __raw_writeb(v,a)  __arch_putb(v,a)
 #define __raw_writew(v,a)  __arch_putw(v,a)
 #define __raw_writel(v,a)  __arch_putl(v,a)
+#define __raw_writeq(v,a)  __arch_putq(v,a)
 
 #define __raw_readb(a) __arch_getb(a)
 #define __raw_readw(a) __arch_getw(a)
 #define __raw_readl(a) __arch_getl(a)
+#define __raw_readq(a) __arch_getq(a)
 
 /*
  * TODO: The kernel offers some more advanced versions of barriers, it might
@@ -139,10 +143,12 @@ extern inline void __raw_readsl(unsigned long addr, void 
*data, int longlen)
 #define writeb(v,c)({ u8  __v = v; __iowmb(); __arch_putb(__v,c); __v; })
 #define writew(v,c)({ u16 __v = v; __iowmb(); __arch_putw(__v,c); __v; })
 #define writel(v,c)({ u32 __v = v; __iowmb(); __arch_putl(__v,c); __v; })
+#define writeq(v,c)({ u64 __v = v; __iowmb(); __arch_putq(__v,c); __v; })
 
 #define readb(c)   ({ u8  __v = __arch_getb(c); __iormb(); __v; })
 #define readw(c)   ({ u16 __v = __arch_getw(c); __iormb(); __v; })
 #define readl(c)   ({ u32 __v = __arch_getl(c); __iormb(); __v; })
+#define readq(c)   ({ u64 __v = __arch_getq(c); __iormb(); __v; })
 
 /*
  * The compiler seems to be incapable of optimising constants
@@ -168,9 +174,11 @@ extern inline void __raw_readsl(unsigned long addr, void 
*data, int longlen)
 #define out_arch(type,endian,a,v)  __raw_write##type(cpu_to_##endian(v),a)
 #define in_arch(type,endian,a) endian##_to_cpu(__raw_read##type(a))
 
+#define out_le64(a,v)  out_arch(q,le64,a,v)
 #define out_le32(a,v)  out_arch(l,le32,a,v)
 #define out_le16(a,v)  out_arch(w,le16,a,v)
 
+#define in_le64(a) in_arch(q,le64,a)
 #define in_le32(a) in_arch(l,le32,a)
 #define in_le16(a) in_arch(w,le16,a)
 
-- 
1.7.9.5

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


[U-Boot] [PATCH 2/2] arm: rmobile: koelsch: Remove NOR-Flash support from boards.cfg

2014-05-28 Thread Nobuhiro Iwamatsu
Koelsch board has NOR-Flash support of koelsch board has been removed.
But this remains in the boards.cfg.
This removed config of NOR-Flash from boards.cfg.

Signed-off-by: Nobuhiro Iwamatsu 
---
 boards.cfg | 1 -
 1 file changed, 1 deletion(-)

diff --git a/boards.cfg b/boards.cfg
index 245a6d3..80fcd23 100644
--- a/boards.cfg
+++ b/boards.cfg
@@ -373,7 +373,6 @@ Active  arm armv7  omap5   ti   
   omap5_uevm
 Active  arm armv7  rmobile atmark-techno   
armadillo-800evaarmadillo-800eva  - 

Nobuhiro Iwamatsu 
 Active  arm armv7  rmobile kmc kzm9g   
kzm9g - 

Nobuhiro Iwamatsu :Tetsuyuki 
Kobayashi 
 Active  arm armv7  rmobile renesas koelsch 
koelsch   - 

Nobuhiro Iwamatsu 
-Active  arm armv7  rmobile renesas koelsch 
koelsch_nor   koelsch:NORFLASH  

Nobuhiro Iwamatsu 
 Active  arm armv7  rmobile renesas lager   
lager - 

Nobuhiro Iwamatsu 
 Active  arm armv7  s5pc1xx samsung goni
s5p_goni  - 

Przemyslaw Marczak 
 Active  arm armv7  s5pc1xx samsung smdkc100
smdkc100  - 

Minkyu Kang 
-- 
1.9.2

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


[U-Boot] [PATCH 1/2] arm: rmobile: lager: Remove NOR-Flash support from boards.cfg

2014-05-28 Thread Nobuhiro Iwamatsu
Lager board has NOR-Flash support of koelsch board has been removed.
But this remains in the boards.cfg.
This removed config of NOR-Flash from boards.cfg.

Signed-off-by: Nobuhiro Iwamatsu 
---
 boards.cfg | 1 -
 1 file changed, 1 deletion(-)

diff --git a/boards.cfg b/boards.cfg
index 8b1177c..245a6d3 100644
--- a/boards.cfg
+++ b/boards.cfg
@@ -375,7 +375,6 @@ Active  arm armv7  rmobile kmc  
   kzm9g
 Active  arm armv7  rmobile renesas koelsch 
koelsch   - 

Nobuhiro Iwamatsu 
 Active  arm armv7  rmobile renesas koelsch 
koelsch_nor   koelsch:NORFLASH  

Nobuhiro Iwamatsu 
 Active  arm armv7  rmobile renesas lager   
lager - 

Nobuhiro Iwamatsu 
-Active  arm armv7  rmobile renesas lager   
lager_nor lager:NORFLASH

Nobuhiro Iwamatsu 
 Active  arm armv7  s5pc1xx samsung goni
s5p_goni  - 

Przemyslaw Marczak 
 Active  arm armv7  s5pc1xx samsung smdkc100
smdkc100  - 

Minkyu Kang 
 Active  arm armv7  socfpga altera  socfpga 
socfpga_cyclone5  - 

-
-- 
1.9.2

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


[U-Boot] [PATCH] mmc: add wrappers for MMC block_{read, write, erase}

2014-05-28 Thread Steve Rae
Each wrapper function:
- switches to the specified physical partition, then
- performs the original function, and then
- switches back to the original physical partition
where the physical partition (aka HW partition) is
  0=User, 1=Boot1, 2=Boot2, etc.

Signed-off-by: Steve Rae 
---
based on a discussion: 
http://lists.denx.de/pipermail/u-boot/2014-April/178171.html
The original calling code is (for example):
  mmc->block_dev.block_read(dev_num, start, blkcnt, buffer)
Therefore, these wrappers use the following naming convention:
  mmc_block_read_hwpart(dev_num, part_num, start, blkcnt, buffer)
"hwpart" comes from: Stephen Warren 

 drivers/mmc/Makefile |  1 +
 drivers/mmc/mmc_hwpart.c | 75 
 include/mmc.h| 10 +++
 3 files changed, 86 insertions(+)
 create mode 100644 drivers/mmc/mmc_hwpart.c

diff --git a/drivers/mmc/Makefile b/drivers/mmc/Makefile
index 4c6ab9e..04f87f9 100644
--- a/drivers/mmc/Makefile
+++ b/drivers/mmc/Makefile
@@ -11,6 +11,7 @@ obj-$(CONFIG_FSL_ESDHC) += fsl_esdhc.o
 obj-$(CONFIG_FTSDC010) += ftsdc010_mci.o
 obj-$(CONFIG_FTSDC021) += ftsdc021_sdhci.o
 obj-$(CONFIG_GENERIC_MMC) += mmc.o
+obj-$(CONFIG_GENERIC_MMC) += mmc_hwpart.o
 obj-$(CONFIG_GENERIC_ATMEL_MCI) += gen_atmel_mci.o
 obj-$(CONFIG_MMC_SPI) += mmc_spi.o
 obj-$(CONFIG_ARM_PL180_MMCI) += arm_pl180_mmci.o
diff --git a/drivers/mmc/mmc_hwpart.c b/drivers/mmc/mmc_hwpart.c
new file mode 100644
index 000..1c29f8f
--- /dev/null
+++ b/drivers/mmc/mmc_hwpart.c
@@ -0,0 +1,75 @@
+/*
+ * Copyright 2014 Broadcom Corporation.
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#include 
+
+static int switch_part(struct mmc *mmc,
+  int dev,
+  unsigned int chk_part_num,
+  unsigned int part_num)
+{
+   if (!mmc)
+   return -1;
+
+   if (mmc->part_num != chk_part_num) {
+   if (mmc_switch_part(dev, part_num)) {
+   printf("MMC partition switch to %d failed [dev=%d]\n",
+  part_num, dev);
+   return -1;
+   }
+   }
+   return 0;
+}
+
+unsigned long mmc_block_read_hwpart(int dev,
+   unsigned int part_num,
+   lbaint_t start,
+   lbaint_t blkcnt,
+   void *buffer)
+{
+   unsigned long rc = 0;
+   struct mmc *mmc = find_mmc_device(dev);
+
+   if (switch_part(mmc, dev, part_num, part_num))
+   return 0;
+   rc = mmc->block_dev.block_read(dev, start, blkcnt, buffer);
+   switch_part(mmc, dev, part_num, mmc->part_num);
+
+   return rc;
+}
+
+unsigned long mmc_block_write_hwpart(int dev,
+unsigned int part_num,
+lbaint_t start,
+lbaint_t blkcnt,
+const void *buffer)
+{
+   unsigned long rc = 0;
+   struct mmc *mmc = find_mmc_device(dev);
+
+   if (switch_part(mmc, dev, part_num, part_num))
+   return 0;
+   rc = mmc->block_dev.block_write(dev, start, blkcnt, buffer);
+   switch_part(mmc, dev, part_num, mmc->part_num);
+
+   return rc;
+}
+
+unsigned long mmc_block_erase_hwpart(int dev,
+unsigned int part_num,
+lbaint_t start,
+lbaint_t blkcnt)
+{
+   unsigned long rc = -1;
+   struct mmc *mmc = find_mmc_device(dev);
+
+   if (switch_part(mmc, dev, part_num, part_num))
+   return -1;
+   rc = mmc->block_dev.block_erase(dev, start, blkcnt);
+   switch_part(mmc, dev, part_num, mmc->part_num);
+
+   return rc;
+}
diff --git a/include/mmc.h b/include/mmc.h
index a3a100b..4871c08 100644
--- a/include/mmc.h
+++ b/include/mmc.h
@@ -347,6 +347,16 @@ int mmc_rpmb_read(struct mmc *mmc, void *addr, unsigned 
short blk,
  unsigned short cnt, unsigned char *key);
 int mmc_rpmb_write(struct mmc *mmc, void *addr, unsigned short blk,
   unsigned short cnt, unsigned char *key);
+/* Functions to read/write/erase from the specified HW partition */
+unsigned long mmc_block_read_hwpart(int dev, unsigned int part_num,
+   lbaint_t start, lbaint_t blkcnt,
+   void *buffer);
+unsigned long mmc_block_write_hwpart(int dev, unsigned int part_num,
+lbaint_t start, lbaint_t blkcnt,
+const void *buffer);
+
+unsigned long mmc_block_erase_hwpart(int dev, unsigned int part_num,
+lbaint_t start, lbaint_t blkcnt);
 /**
  * Start device initialization and return immediately; it does not block on
  * polling OCR (operation condition register) status.  Then 

Re: [U-Boot] NAND custodian (was Re: [PATCH v5 0/5] enable support for x16 NAND devices)

2014-05-28 Thread Tom Rini
On Tue, May 27, 2014 at 12:21:21PM -0500, Scott Wood wrote:
> On Tue, 2014-05-27 at 11:48 +, Gupta, Pekon wrote:
> > Hello Scott, Tom,
> > 
> > 
> > >From: Gupta, Pekon
> > >
> > >*changes v4 -> v5*
> > >[PATCH 1/5] 
> > >[PATCH 2/5] fixed compilation error for OMAP3 platforms
> > >[PATCH 3/5] 
> > >[PATCH 4/5] dropped old [PATCH] mtd: nand: omap: add 
> > >CONFIG_SYS_NAND_BUSWIDTH_16BIT to
> > >indicate NAND device bus-width
> > >instead new [PATCH] mtd: nand: omap: add 
> > > CONFIG_SYS_NAND_BUSWIDTH_16BIT to indicate
> > >NAND device bus-width
> > >[PATCH 5/5] additional cleanup in include/configs/cm_t35.h
> > >Build tested for:  MAKEALL -s am33xx -s omap3 -s omap4 -s omap5
> > >Rebased above series:  
> > >http://lists.denx.de/pipermail/u-boot/2014-April/177323.html
> > >
> > 
> > This series few other patch series are awaiting response from
> > long time.
> 
> Sorry for the delay -- I've been fairly busy, and don't usually get
> around to processing U-Boot patches until after the merge window closes.
> The IRC channel topic has been lying and saying the merge window is
> still open (also, http://www.denx.de/wiki/U-Boot/ReleaseCycle says that
> the merge window is open and will close in negative 24 days).

Bah, I always forget to update those parts as well, beyond the actual
releases...

> Given that I don't do much with NAND myself these days, that the patch
> volume is higher than when I started as NAND custodian, and that I now
> have maintainership duties in Linux competing for my time, I'm wondering
> if someone else (maybe you or Heiko?) wants to step into the NAND
> custodian role.

It's been a pleasure working with you.  Pekon? Heiko?  Either of you
interested in this particular role?  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 hangs on imx6 pci driver

2014-05-28 Thread Marek Vasut
On Wednesday, May 28, 2014 at 06:42:41 PM, Fabio Estevam wrote:
> On Tue, May 27, 2014 at 9:30 AM, Fabio Estevam  wrote:
> > Hi,
> > 
> > Working on a mx6solo board with PCIe driver enabled in U-boot, I
> > notice that after doing several reboots a hang is seen on the PCIe
> 
> > driver:
> Just an update: we are able now to run overnight tests without PCI hangs.
> 
> Sorry for the noise, but the hang was caused by a debug code.
> 
> We still get "link never came up" issue on some boots, but this is a
> different one.

Does that mean FSL is unable to reliably bring PCIe link up on every boot on 
their platform please?

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 v2] Separate EBV Socrates board from Altera Cyclone 5 board and from Virtual Target

2014-05-28 Thread Pavel Machek
Hi!

On Wed 2014-05-28 16:29:50, Wolfgang Denk wrote:
> In message <20140528124910.ga24...@amd.pavel.ucw.cz> you wrote:
> > 
> > There are no differences between EBV socrates and socfpga boards,
> > currently.
> 
> Well, for one thing, the board vendor and the board name differ...

I meant from current code in u-boot point of view...

> > > > AFAICT, one solution would be to put "-" in that column, and do "git
> > > > mv board/altera/ board/socfpga/".
> > > 
> > > Putting "-" in the vendor column just doesn't feel right.  
> > 
> > That's what mx6 did, AFAICT.
> 
> I think Detlev is right here.  We do have specific board vendors
> directories, and there are a number of reasons to keep this used
> (just to give one example: say a vendor wants to use a similar look
> and feel for the default environment settings etc. for all boards).

> If there is code which is identical for several (or all?) boards we
> should ask ourself if it really belongs into the board/ directory at
> all?

That might be the case. It seems that current code in board/altera is
SoC-specific, as it works on both Altera and EBV boards. 

> > Actually.. there's nothing Altera specific in board/altera (it works
> > on ebv just fine), so board/socfpga sounds like a better name. But I
> > don't think such rename should be done lightly, so I still believe the
> > patch as submitted is the best way to go.
> 
> I think board/altera as such makes sense, with Altera being the vendor
> of that specific board.  However, if there is common code there, this
> code should be moved out of board/ .

It seems there's currently 99.99% of SoC-specific code there.

What would be the right place for that code?
arch/arm/cpu/armv7/socfpga/ ? But it is not really armv7-specific.
drivers/misc ? Do we need to make a soc/ directory?

And then... who does the move? It is not going to make merging between
rocketboards.org and mainline even trickier than it already is :-(.

Best regards,
Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) 
http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [ANN] U-Boot v2014.07-rc2 released

2014-05-28 Thread Simon Glass
Hi Tom,

On 27 May 2014 04:22, Tom Rini  wrote:
> Hey all,
>
> I've pushed v2014.07-rc2 out to the repository and tarballs should exist
> soon.
>
> Looking over the log, we've gotten some of the re-syncing that needed
> doing done, but there's still more on my end that needs to be picked up,
> so I'll be getting on that shortly.
>
> As always, if anything is broken please speak up.

What would you like to do with the command processor refactor? "Split
out code from the enormous main.c"

My intent is that one day we can have both hush and built-in with
sandbox to make it easier to run tests. I don't think it got a lot of
attention.

I also have the BBB verified boot series - I have been pinged off-list
several times for this so would like to get it all working and merged.
There seem to be various changes floating around, so I'll make the
time to try it out and retest. Do you want a separate config for
enabling verified boot?

Also I'd like to pull in some of the driver model and command
processor fixes. I suppose I can do a few pull requests for those.

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


Re: [U-Boot] [PATCH v3 06/11] mx6: add structs for mmdc and ddr iomux registers

2014-05-28 Thread Nikita Kiryanov

Hi Tim,

On 08/05/14 08:16, Tim Harvey wrote:

Add memory-mapped structures for MMDC iomux and configuration. Note that
the MMDC configuration registers are common between the IMX6DQ
(IMX6DUAL/IMX6QUAD) and IMX6SDL (IMX6SOLO/IMX6DUALLITE) the iomux
register addresses differ. This requires two sets of structures.

Add structures to describe DDR3 device information, system information
(memory layout, etc), and MMDC calibration regitsers that can be used to
configure the MMDC dynamically.


s/regitsers/registers



We define these structures for SPL builds instead of including mx6q-ddr.h an
mx6dl-ddr.h which use the same namespace and are only useful for imximage cf
files.


What about the usefulness of the structs for U-Boot code? For example,
it might be necessary for U-Boot code to query the MMDC registers to
setup memory related variables like gd->ram_size and
gd->bd->bi_dram[i].size. Sure this can be done using the #defines
in the header files, but we lose nothing by making the structs
available to U-Boot as well.

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


Re: [U-Boot] U-boot hangs on imx6 pci driver

2014-05-28 Thread Fabio Estevam
Hi David,

On Wed, May 28, 2014 at 4:40 AM, "David Müller (ELSOFT AG)"
 wrote:
> Marek Vasut wrote:
>> Observed Results: After some hundreds of the soft-reboot cycles, the
>> i210 is not recognized. This is caused by the PCI express link
>> failing to come up. We see "link never came up" message in the kernel
>> log.
>
> Just a guest but maybe this is "errata #18" of the i210.
>
> A little bit off-topic but i'm facing the problem that Linux (kernel
> 3.14 + some patches) hangs regularly during PCIe initialisation on our
> custom iMX6 / i210 board.
>
> I use an additional delay in imx6_add_pcie_port() as a workaround so far.

How much of additional delay? Could you please share your patch?
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] U-boot hangs on imx6 pci driver

2014-05-28 Thread Fabio Estevam
On Tue, May 27, 2014 at 9:30 AM, Fabio Estevam  wrote:
> Hi,
>
> Working on a mx6solo board with PCIe driver enabled in U-boot, I
> notice that after doing several reboots a hang is seen on the PCIe
> driver:

Just an update: we are able now to run overnight tests without PCI hangs.

Sorry for the noise, but the hang was caused by a debug code.

We still get "link never came up" issue on some boots, but this is a
different one.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3 04/11] mx6: add boot device support for SPL

2014-05-28 Thread Nikita Kiryanov

Hi Tim,
Sorry for the late reply.

On 08/05/14 08:16, Tim Harvey wrote:

Add a common spl.c file to support boot device functions needed for SPL
such as detecting the boot device.

Signed-off-by: Tim Harvey 
---
v3:
  - added Freescale copyright

v2:
  - re-base on top of Masahiro Yamada's consolidation patch:
http://patchwork.ozlabs.org/patch/341817/
  - moved spl_boot_device() and get_boot_mode() into own common imx spl.c file
  - use mem-mapped structure for smbr reg access
---


[..snip..]


+   }
+   break;
+   /* SD/eSD: 8.5.3, Table 8-15  */
+   case 0x4:
+   case 0x5:
+   return BOOT_DEVICE_MMC1;
+   /* MMC/eMMC: 8.5.3 */
+   case 0x6:
+   case 0x7:
+   return BOOT_DEVICE_MMC1;
+   /* NAND Flash: 8.5.2 */
+   case 0x8 ... 0xf:
+   return BOOT_DEVICE_NAND;
+   }
+   return BOOT_DEVICE_NONE;
+}
+#endif
+
+#if defined(CONFIG_SPL_MMC_SUPPORT)
+/* called from spl_mmc to see type of boot mode for storage (RAW or FAT) */
+u32 spl_boot_mode(void)
+{
+   switch (spl_boot_device()) {
+   /* for MMC return either RAW or FAT mode */
+   case BOOT_DEVICE_MMC1:
+   case BOOT_DEVICE_MMC2:


spl_boot_device() returns only BOOT_DEVICE_MMC1. Was the MMC/eMMC case
supposed to return a BOOT_DEVICE_MMC2?

Aside from this nitpick,
Acked-by: Nikita Kiryanov 
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3 05/11] imx: add comments and remove unused struct fields

2014-05-28 Thread Nikita Kiryanov



On 08/05/14 08:16, Tim Harvey wrote:

Add comment block for the imx_ddr_size function and remove the extra unused
fields from struct esd_mmdc_regs which are also not common between IMX53 and
IMX6.

Signed-off-by: Tim Harvey 
Acked-by: Stefano Babic 
---
v3:
  - fixed doxygen-style comment block
  - added Stefano's Ack

v2:
  - new patch in series
---



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


Re: [U-Boot] [PATCH] serial_mxc: disable new features of autobaud detection

2014-05-28 Thread Stefano Babic
On 15/05/2014 01:58, Eric Nelson wrote:
> Bit 7 of UCR3 is described in the i.MX3x/i.MX5x/i.MX6x
> reference manuals as follows:
> 
>   Autobaud Detection Not Improved-. Disables new features of
>   autobaud detection (See Baud Rate Automatic Detection
> Protocol, for more details).
> 
>   0 Autobaud detection new features selected
>   1 Keep old autobaud detection mechanism
> 
> On at least i.MX6DQ, i.MX6DLS and i.MX53, the "new features"
> occasionally cause the receiver to get out of sync and
> continuously produce received characters of '\xff'.
> 
> This patch disables the "new feature" on all boards, since
> there's no support for auto-baud in U-Boot on any of them.
> 
> More details are available in this post on i.MX Community:
>   https://community.freescale.com/message/403254
> 
> Signed-off-by: Eric Nelson 
> Tested-by: Fabio Estevam 
> ---


Applied to u-boot-imx, thanks !

Best regards,
Stefano Babic


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


Re: [U-Boot] [PATCH v4] mx6sabred: Add PFUZE100 PMIC support

2014-05-28 Thread Stefano Babic
On 09/05/2014 18:15, Fabio Estevam wrote:
> From: Fabio Estevam 
> 
> mx6sabresd boards have a PFUZE100 PMIC connected to I2C2 bus.
> 
> Add support for it
> 
> Signed-off-by: Fabio Estevam 
> ---


Applied to u-boot-imx, thanks !

Best regards,
Stefano Babic


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


Re: [U-Boot] [PATCH v2 1/3] mx28evk: Remove extra CONFIG_ENV_SIZE

2014-05-28 Thread Stefano Babic
Hi Fabio,

On 09/05/2014 01:35, Fabio Estevam wrote:
> From: Fabio Estevam 
> 
> When building a target with CONFIG_ENV_IS_IN_SPI_FLASH the following build
> warning is seen:
> 
> include/configs/mx28evk.h:73:0: warning: "CONFIG_ENV_SIZE" redefined [enabled 
> by default]
> 
> Each target has its own CONFIG_ENV_SIZE definition, so remove the one that
> does not belong to any target.
> 
> While at it, fix a typo.
> 
> Signed-off-by: Fabio Estevam 
> ---

Sorry for the noise. I have not applied it. In fact, this breaks the
other mx28evk setup.

./MAKEALL mx28evk_nand
Configuring for mx28evk_nand - Board: mx28evk, Options: ENV_IS_IN_NAND
include/environment.h:85:4: error: #error "Need to define
CONFIG_ENV_SIZE when using CONFIG_ENV_IS_IN_NAND"
include/environment.h:85:4: error: #error "Need to define
CONFIG_ENV_SIZE when using CONFIG_ENV_IS_IN_NAND"
include/environment.h:85:4: error: #error "Need to define
CONFIG_ENV_SIZE when using CONFIG_ENV_IS_IN_NAND"

The only one without errors is the SPI version.

Can you take a look at it ?

Best regards,
Stefano Babic

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


Re: [U-Boot] [PATCH v2 1/3] mx28evk: Remove extra CONFIG_ENV_SIZE

2014-05-28 Thread Stefano Babic
On 09/05/2014 01:35, Fabio Estevam wrote:
> From: Fabio Estevam 
> 
> When building a target with CONFIG_ENV_IS_IN_SPI_FLASH the following build
> warning is seen:
> 
> include/configs/mx28evk.h:73:0: warning: "CONFIG_ENV_SIZE" redefined [enabled 
> by default]
> 
> Each target has its own CONFIG_ENV_SIZE definition, so remove the one that
> does not belong to any target.
> 
> While at it, fix a typo.
> 
> Signed-off-by: Fabio Estevam 
> ---

Applied all patchset to u-boot-imx, thanks !

Best regards,
Stefano Babic

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


Re: [U-Boot] [PATCH] mx6sabreauto: Add the mx6dual-lite variant

2014-05-28 Thread Stefano Babic
On 08/05/2014 19:25, Fabio Estevam wrote:
> Tested by booting a mainline kernel via TFTP.
> 
> Signed-off-by: Fabio Estevam 
> ---

Applied to u-boot-imx, thanks !

Best regards,
Stefano Babic

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


[U-Boot] Some Driver Model Ponderings

2014-05-28 Thread Jon Loeliger
Hi U-Booters,

Over the past few days, I had an off-line conversation with Simon Glass
on the topic of the Driver Model.  At his request, I've edited that
conversation into this piece of email for the U-Boot List in the
hopes that others in the community might also benefit.

Already, some documentation patches have been offered as a result.

http://patchwork.ozlabs.org/patch/352165/

But try to follow along.  This is a conversation that occured over
several back-and-forth pieces of email.  I've edited and spliced.
Hopefully, all the important pieces and parts are present without
offense or malice.

I start with the plea:

Hi Simon,

I write to you directly in an effort to

A) Get a new GPIO driver into U-Boot using the new Driver Model
B) Hopefully answer many lingering questions rapidly

the background:

Backing up a half step now...  I need a PL061 ARM GPIO driver.
I have exactly one GPIO I need to drive.  But I have 7 GPIO blocks
of 8 bits each.  Rather than just hacking in yet another GPIO
hackery into the general U-Boot fray, I thought I'd try the new
driver model approach.

So I think I want, and have written, a simple PL061 driver that
fits these standard operations:

static const struct dm_gpio_ops gpio_pl061_ops = {
.request= pl061_gpio_request,
.free   = pl061_gpio_free,
.direction_input= pl061_gpio_direction_input,
.direction_output   = pl061_gpio_direction_output,
.get_value  = pl061_gpio_get_value,
.set_value  = pl061_gpio_set_value,
.get_state  = pl061_gpio_get_state,
};

Each of those routines takes a struct device that is mapped into an
instance of the struct pl061_priv like so:

struct pl061_priv *priv = dev_get_priv(dev);

My priv structure is this:

struct pl061_priv {
u32 regs;   /* GPIO bit-masked I/O space, controller */
u32 pad_regs;   /* Pad control */
u32 gpio_base;  /* GPIO range implemented by this device. */
u32 gpio_count;
};

Now, I want to build up 7 of these with different bases for the
'regs', and different segments of the global linear GPIO space,
8-bits apiece.

I am resonably convinced that the UCLASS_GPIO is going to help me do
this.  And is supposed to.  It is some combination of the probe,
bind, setup that I am not quite understanding yet.

At this point, Simon states that another reference implementation
has been pushed:

I just pushed us-gpioc to

http://git.denx.de/u-boot-x86.git

which includes another conversion - drivers/gpio/s5p_gpio.c.
It might be a bit closer to what you need.


So, my UCLASS related questions haven't all been answered yet,
but I also had questions about the relationships between the
various bits of data along the way: uc_priv, platdata, priv:

I'm not quite understanding the relationship of my "pl061_priv"
data to the so-called platdata.

Simon clarifies that:

priv is your device's private data, used while the device is running
(i.e. it is set up when the device is probed, and deleted when the
device is removed)

platdata is like Linux platform data. It provides the information
needed to start up the device - like its register addresses or
configuration options.

I make two observations about those two paragraphs that then
go on to cause a new documentation patch to be submitted.
My first observation is that nowhere in the as-yet-written
documentation abou the Driver Model is there any statement
about the lifetime of the data pieces.  Until that first paragraph.
So I ask for more complete data-lifetime documentation.

Secondly, I also observe that there is no data-flow documented.
What is the sequence of data as it transitions through the
various bind, probe, use, and release phases?

Simon offers to document some data-lifetime, but quotes some
existing platdata documentation too:

" platdata (data which tells the driver how
to operate on a particular platform)"

Which just sets me off:

This is *exactly* the wording I am arguing against. :-)
That uses the same word to define the word.  We need
*other* words to describe what is meant by "platform data"
in this context.  Something like what you wrote in the
mail to me:

Examples of platform data might include:
- the base address of the IP blocks register space
- configuration options
- board-level physical switch settings
- something else obvious
- when using DTS, data parsed out of the device node

And perhaps a description of why it is needed in the first place:

The device driver needs instance data for about a device's
running state but may not be able to determine it.  The
pla

Re: [U-Boot] [PATCH v2] spl: consolidate arch/arm/include/asm/arch-*/spl.h

2014-05-28 Thread Stefano Babic
On 23/04/2014 14:20, Masahiro Yamada wrote:
> arch/arm/include/asm/spl.h requires all SoCs to have
> arch/arm/include/asm/arch-*/spl.h.
> 
> But many of them just define BOOT_DEVICE_* macros.
> 
> Those macros are used in the "switch (boot_device) { ... }"
> statement in common/spl/spl.c.
> 
> So they should not be archtecture specific, but be described as
> a simpile enumeration.
> 
> This commit merges most of arch/arm/include/asm/arch-*/spl.h
> into arch/arm/include/asm/spl.h.
> 
> With a little more effort, arch-zynq/spl.h and arch-socfpga/spl.h
> will be merged, while I am not sure about OMAP and Exynos.
> 
> Signed-off-by: Masahiro Yamada 
> Cc: Tom Rini 
> Cc: Michal Simek 
> Cc: Andreas Bießmann 
> Cc: Stephen Warren 
> Cc: Tom Warren 
> CC: Stefano Babic 
> CC: Minkyu Kang 
> Cc: Dinh Nguyen 
> Acked-by: Andreas Bießmann 
> Acked-by: Michal Simek 
> Acked-by: Stefano Babic 
> Acked-by: Stephen Warren 
> Acked-by: Tim Harvey 
> Tested-by: Bo Shen  [on sama5d3xek board for at91 part]
> ---

Tested-by: Stefano Babic  [applying Tim's i.MX6 patches]

Tom, what about this patch ? Tim's patchset for SPL on i.MX6 depends on
this. Is it appliable ?

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


Re: [U-Boot] [PATCH v2] Separate EBV Socrates board from Altera Cyclone 5 board and from Virtual Target

2014-05-28 Thread Wolfgang Denk
Dear Pavel,

In message <20140528124910.ga24...@amd.pavel.ucw.cz> you wrote:
> 
> There are no differences between EBV socrates and socfpga boards,
> currently.

Well, for one thing, the board vendor and the board name differ...

> > > AFAICT, one solution would be to put "-" in that column, and do "git
> > > mv board/altera/ board/socfpga/".
> > 
> > Putting "-" in the vendor column just doesn't feel right.  
> 
> That's what mx6 did, AFAICT.

I think Detlev is right here.  We do have specific board vendors
directories, and there are a number of reasons to keep this used
(just to give one example: say a vendor wants to use a similar look
and feel for the default environment settings etc. for all boards).

If there is code which is identical for several (or all?) boards we
should ask ourself if it really belongs into the board/ directory at
all?

> Actually.. there's nothing Altera specific in board/altera (it works
> on ebv just fine), so board/socfpga sounds like a better name. But I
> don't think such rename should be done lightly, so I still believe the
> patch as submitted is the best way to go.

I think board/altera as such makes sense, with Altera being the vendor
of that specific board.  However, if there is common code there, this
code should be moved out of board/ .

[Note that I'm just commenting from an outside point of view; I did
not check to what extent the "common" code under discussion here is
truely common to all possible board configs.]

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
 The software required `Windows 95 or better', so I installed Linux.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 06/11] kconfig: switch to Kconfig

2014-05-28 Thread Masahiro Yamada
This commit enables Kconfig.
Going forward, we use Kconfig for board configuration.
mkconfig will never be used. Nor will include/config.mk be generated.

Kconfig must be adjusted for U-Boot because our situation is
a little more complicated than Linux Kernel.
We have to generate multiple binary images (Full U-Boot, SPL, TPL)
from one source tree.
Each image needs its own configuration input.

In order to keep this scheme in Kconfig, some files must be modified.
But the modification should be minimum.

The location of Kconfig related files is as follows:

 [1] Full U-Boot image
   - configs/_defconfig(default configuration)
   - .config  (saved config list)
   - include/config/auto.conf (for use in makefiles)
   - include/generated/autoconf.h (for use in C sources)
   - include/config/* (for if_changed_dep)

 [2] SPL
   - configs/spl/_defconfig(default configuration)
   - spl/.config  (saved config list)
   - spl/include/config/auto.conf (for use in makefiles)
   - spl/include/generated/autoconf.h (for use in C sources)
   - spl/include/config/* (for if_changed_dep)

 [3] TPL
   - configs/tpl/_defconfig(default configuration)
   - tpl/.config  (saved config list)
   - tpl/include/config/auto.conf (for use in makefiles)
   - tpl/include/generated/autoconf.h (for use in C sources)
   - tpl/include/config/* (for if_changed_dep)

Usage:

Execute "make _defconfig" to configure board and then run "make".
Or "make _defconfig all" to configure and build in one time.

You can use "make config", "make menuconfig" etc. to create
a new .config or modify the existing one.

In Kconfig for U-boot, the configuration is done on three levels at most.

By the way, there is another item worth remarking here:
coexistence of Kconfig and board herder files.

Prior to Kconfig, we used C headers to define a set of configs.

We expect a very long term to migrate from C headers to Kconfig.
Two different infractructure must coexist in the interim.

In our former configuration scheme, include/autoconf.mk was generated
for use in makefiles.
It is still generated under include/, spl/include/, tpl/include/ directory
for the full, SPL, TPL image, respectively.

Signed-off-by: Masahiro Yamada 
---

Changes in v2:
  - Put dirty build rule into scripts/multiple_config.sh and
scripts/Makefile.autoconf
  - Fix dependency tracking.
In v1, any change to Kconfig triggered re-complile of all objects.
In this version, re-compile is kept at a minimum.
  - Fix a clean-source check
In v1, clean source tree check did not work correctly for
out-of-tree build.

 .gitignore|   2 -
 Makefile  | 119 ++
 arch/m68k/cpu/mcf52x2/config.mk   |  16 ++---
 arch/m68k/cpu/mcf532x/config.mk   |   6 +-
 arch/m68k/cpu/mcf5445x/config.mk  |   4 +-
 arch/powerpc/cpu/ppc4xx/config.mk |   4 +-
 config.mk |  10 
 include/.gitignore|   1 -
 scripts/Makefile  |   2 +-
 scripts/Makefile.autoconf | 100 
 scripts/Makefile.build|  31 --
 scripts/basic/fixdep.c|   6 +-
 scripts/kconfig/Makefile  |  11 +++-
 scripts/kconfig/confdata.c|   8 +++
 scripts/multiple_config.sh|  57 ++
 scripts/silentoldconfig.sh|  71 +++
 spl/Makefile  |  31 +-
 tools/Makefile|   2 +-
 tools/env/Makefile|   2 +-
 19 files changed, 349 insertions(+), 134 deletions(-)
 create mode 100644 scripts/Makefile.autoconf
 create mode 100644 scripts/multiple_config.sh
 create mode 100644 scripts/silentoldconfig.sh

diff --git a/.gitignore b/.gitignore
index a6b2d1c..abb92cd 100644
--- a/.gitignore
+++ b/.gitignore
@@ -56,8 +56,6 @@
 #
 /include/config/
 /include/generated/
-/include/spl-autoconf.mk
-/include/tpl-autoconf.mk
 
 # stgit generated dirs
 patches-*
diff --git a/Makefile b/Makefile
index e38fd2f..d5488d2 100644
--- a/Makefile
+++ b/Makefile
@@ -166,9 +166,6 @@ VPATH   := $(srctree)$(if 
$(KBUILD_EXTMOD),:$(KBUILD_EXTMOD))
 
 export srctree objtree VPATH
 
-MKCONFIG   := $(srctree)/mkconfig
-export MKCONFIG
-
 # Make sure CDPATH settings don't interfere
 unexport CDPATH
 
@@ -189,9 +186,6 @@ HOSTOS := $(shell uname -s | tr '[:upper:]' '[:lower:]' | \
 
 export HOSTARCH HOSTOS
 
-# Deal with colliding definitions from tcsh etc.
-VENDOR=
-
 #
 
 # set default to nothing for native builds
@@ -199,6 +193,9 @@ ifeq ($(HOSTARCH),$(ARCH))
 CROSS_COMPILE ?=
 endif
 
+KCONFIG_CONFIG ?= .config
+export KCONFIG_CONFIG
+
 # SHELL used by kbuild
 CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
  else if [ -x /

[U-Boot] [PATCH v2 09/11] kconfig: delete redundant CONFIG_${ARCH} definition

2014-05-28 Thread Masahiro Yamada
CONFIG_${ARCH} is defined by Kconfig.

Signed-off-by: Masahiro Yamada 
Reviewed-by: Simon Glass 
---

Changes in v2: None

 arch/arc/config.mk   | 2 +-
 arch/arm/config.mk   | 2 +-
 arch/avr32/config.mk | 1 -
 arch/blackfin/config.mk  | 1 -
 arch/m68k/config.mk  | 2 +-
 arch/mips/config.mk  | 2 +-
 arch/nds32/config.mk | 2 +-
 arch/nios2/config.mk | 2 +-
 arch/openrisc/config.mk  | 2 +-
 arch/powerpc/config.mk   | 2 +-
 arch/sandbox/config.mk   | 2 +-
 arch/sparc/config.mk | 2 +-
 arch/x86/cpu/config.mk   | 2 +-
 include/configs/microblaze-generic.h | 1 -
 14 files changed, 11 insertions(+), 14 deletions(-)

diff --git a/arch/arc/config.mk b/arch/arc/config.mk
index a3b8df7..e408800 100644
--- a/arch/arc/config.mk
+++ b/arch/arc/config.mk
@@ -21,7 +21,7 @@ ifeq ($(CROSS_COMPILE),)
 CROSS_COMPILE := $(ARC_CROSS_COMPILE)
 endif
 
-PLATFORM_CPPFLAGS += -ffixed-r25 -D__ARC__ -DCONFIG_ARC -gdwarf-2
+PLATFORM_CPPFLAGS += -ffixed-r25 -D__ARC__ -gdwarf-2
 
 # Needed for relocation
 LDFLAGS_FINAL += -pie
diff --git a/arch/arm/config.mk b/arch/arm/config.mk
index 66ecc2e..31e042a 100644
--- a/arch/arm/config.mk
+++ b/arch/arm/config.mk
@@ -22,7 +22,7 @@ PLATFORM_RELFLAGS += $(call cc-option, -msoft-float) \
 # Support generic board on ARM
 __HAVE_ARCH_GENERIC_BOARD := y
 
-PLATFORM_CPPFLAGS += -DCONFIG_ARM -D__ARM__
+PLATFORM_CPPFLAGS += -D__ARM__
 
 # Choose between ARM/Thumb instruction sets
 ifeq ($(CONFIG_SYS_THUMB_BUILD),y)
diff --git a/arch/avr32/config.mk b/arch/avr32/config.mk
index 28a371c..469185e 100644
--- a/arch/avr32/config.mk
+++ b/arch/avr32/config.mk
@@ -9,7 +9,6 @@ ifeq ($(CROSS_COMPILE),)
 CROSS_COMPILE := avr32-linux-
 endif
 
-PLATFORM_CPPFLAGS += -DCONFIG_AVR32
 CONFIG_STANDALONE_LOAD_ADDR ?= 0x
 
 PLATFORM_RELFLAGS  += -ffixed-r5 -fPIC -mno-init-got -mrelax
diff --git a/arch/blackfin/config.mk b/arch/blackfin/config.mk
index fcaa44f..7b17b75 100644
--- a/arch/blackfin/config.mk
+++ b/arch/blackfin/config.mk
@@ -21,7 +21,6 @@ endif
 CONFIG_BFIN_BOOT_MODE := $(strip $(CONFIG_BFIN_BOOT_MODE:"%"=%))
 
 PLATFORM_RELFLAGS += -ffixed-P3 -fomit-frame-pointer -mno-fdpic
-PLATFORM_CPPFLAGS += -DCONFIG_BLACKFIN
 
 LDFLAGS_FINAL += --gc-sections
 LDFLAGS += -m elf32bfin
diff --git a/arch/m68k/config.mk b/arch/m68k/config.mk
index 33b3d51..3b3a7e8 100644
--- a/arch/m68k/config.mk
+++ b/arch/m68k/config.mk
@@ -11,7 +11,7 @@ endif
 
 CONFIG_STANDALONE_LOAD_ADDR ?= 0x2
 
-PLATFORM_CPPFLAGS += -DCONFIG_M68K -D__M68K__
+PLATFORM_CPPFLAGS += -D__M68K__
 PLATFORM_LDFLAGS  += -n
 PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections
 PLATFORM_RELFLAGS += -ffixed-d7 -msep-data
diff --git a/arch/mips/config.mk b/arch/mips/config.mk
index f4a234a..a2d07af 100644
--- a/arch/mips/config.mk
+++ b/arch/mips/config.mk
@@ -25,7 +25,7 @@ endif
 # Default to EB if no endianess is configured
 ENDIANNESS ?= -EB
 
-PLATFORM_CPPFLAGS += -DCONFIG_MIPS -D__MIPS__
+PLATFORM_CPPFLAGS += -D__MIPS__
 
 __HAVE_ARCH_GENERIC_BOARD := y
 
diff --git a/arch/nds32/config.mk b/arch/nds32/config.mk
index 1024852..5ac9f90 100644
--- a/arch/nds32/config.mk
+++ b/arch/nds32/config.mk
@@ -17,6 +17,6 @@ CONFIG_STANDALONE_LOAD_ADDR = 0x30 \
 
 PLATFORM_RELFLAGS  += -fno-strict-aliasing -fno-common -mrelax
 PLATFORM_RELFLAGS  += -gdwarf-2
-PLATFORM_CPPFLAGS  += -DCONFIG_NDS32 -D__nds32__ -G0 -ffixed-10 -fpie
+PLATFORM_CPPFLAGS  += -D__nds32__ -G0 -ffixed-10 -fpie
 
 LDFLAGS_u-boot = --gc-sections --relax
diff --git a/arch/nios2/config.mk b/arch/nios2/config.mk
index 65a5a40..82bd887 100644
--- a/arch/nios2/config.mk
+++ b/arch/nios2/config.mk
@@ -12,7 +12,7 @@ endif
 
 CONFIG_STANDALONE_LOAD_ADDR ?= 0x0200
 
-PLATFORM_CPPFLAGS += -DCONFIG_NIOS2 -D__NIOS2__
+PLATFORM_CPPFLAGS += -D__NIOS2__
 PLATFORM_CPPFLAGS += -G0
 
 LDFLAGS_FINAL += --gc-sections
diff --git a/arch/openrisc/config.mk b/arch/openrisc/config.mk
index 9902b9a..cd95f24 100644
--- a/arch/openrisc/config.mk
+++ b/arch/openrisc/config.mk
@@ -11,6 +11,6 @@ endif
 
 # r10 used for global object pointer, already set in OR32 GCC but just to be
 # clear
-PLATFORM_CPPFLAGS += -DCONFIG_OPENRISC -D__OR1K__ -ffixed-r10
+PLATFORM_CPPFLAGS += -D__OR1K__ -ffixed-r10
 
 CONFIG_STANDALONE_LOAD_ADDR ?= 0x4
diff --git a/arch/powerpc/config.mk b/arch/powerpc/config.mk
index fb7096e..6329b6c 100644
--- a/arch/powerpc/config.mk
+++ b/arch/powerpc/config.mk
@@ -13,7 +13,7 @@ CONFIG_STANDALONE_LOAD_ADDR ?= 0x4
 LDFLAGS_FINAL += --gc-sections
 PLATFORM_RELFLAGS += -fpic -mrelocatable -ffunction-sections -fdata-sections \
-meabi
-PLATFORM_CPPFLAGS += -DCONFIG_PPC -D__powerpc__ -ffixed-r2
+PLATFORM_CPPFLAGS += -D__powerpc__ -ffixed-r2
 PLATFORM_LDFLAGS  += -n
 
 # Support generic board on PPC
diff --git a/a

[U-Boot] [PATCH v2 10/11] kbuild: remove CONFIG_SPL/CONFIG_TPL definition in config headers

2014-05-28 Thread Masahiro Yamada
Now CONFIG_SPL and CONFIG_TPL are defined in Kconfig.

Remove the redundant definition in config headers.

Signed-off-by: Masahiro Yamada 
Reviewed-by: Simon Glass 
---

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

 include/configs/B4860QDS.h | 1 -
 include/configs/BSC9131RDB.h   | 1 -
 include/configs/BSC9132QDS.h   | 1 -
 include/configs/C29XPCIE.h | 2 --
 include/configs/MPC8313ERDB.h  | 1 -
 include/configs/P1010RDB.h | 4 
 include/configs/P1022DS.h  | 4 
 include/configs/P1_P2_RDB.h| 4 
 include/configs/T104xRDB.h | 1 -
 include/configs/T208xQDS.h | 1 -
 include/configs/T208xRDB.h | 1 -
 include/configs/T4240QDS.h | 1 -
 include/configs/a3m071.h   | 1 -
 include/configs/am335x_igep0033.h  | 1 -
 include/configs/am3517_crane.h | 1 -
 include/configs/am3517_evm.h   | 1 -
 include/configs/apf27.h| 1 -
 include/configs/arndale.h  | 1 -
 include/configs/bur_am335x_common.h| 1 -
 include/configs/cam_enc_4xx.h  | 1 -
 include/configs/cm_t35.h   | 1 -
 include/configs/da850evm.h | 1 -
 include/configs/devkit8000.h   | 1 -
 include/configs/exynos5-dt.h   | 1 -
 include/configs/hawkboard.h| 1 -
 include/configs/ipam390.h  | 1 -
 include/configs/lwmon5.h   | 1 -
 include/configs/m53evk.h   | 1 -
 include/configs/mcx.h  | 1 -
 include/configs/microblaze-generic.h   | 1 -
 include/configs/mx31pdk.h  | 1 -
 include/configs/mxs.h  | 1 -
 include/configs/omap3_evm_common.h | 1 -
 include/configs/origen.h   | 1 -
 include/configs/p1_p2_rdb_pc.h | 4 
 include/configs/palmtreo680.h  | 1 -
 include/configs/pcm051.h   | 1 -
 include/configs/sama5d3xek.h   | 1 -
 include/configs/siemens-am33x-common.h | 1 -
 include/configs/smdkv310.h | 1 -
 include/configs/socfpga_cyclone5.h | 1 -
 include/configs/tam3517-common.h   | 1 -
 include/configs/tao3530.h  | 1 -
 include/configs/tegra-common.h | 1 -
 include/configs/ti814x_evm.h   | 1 -
 include/configs/ti816x_evm.h   | 1 -
 include/configs/ti_armv7_common.h  | 1 -
 include/configs/tricorder.h| 1 -
 include/configs/tx25.h | 1 -
 include/configs/vpac270.h  | 1 -
 include/configs/woodburn_sd.h  | 1 -
 include/configs/x600.h | 1 -
 include/configs/zynq-common.h  | 1 -
 53 files changed, 66 deletions(-)

diff --git a/include/configs/B4860QDS.h b/include/configs/B4860QDS.h
index cb35116..c4eb50d 100644
--- a/include/configs/B4860QDS.h
+++ b/include/configs/B4860QDS.h
@@ -23,7 +23,6 @@
 #define CONFIG_RAMBOOT_TEXT_BASE   CONFIG_SYS_TEXT_BASE
 #define CONFIG_RESET_VECTOR_ADDRESS0xfffc
 #else
-#define CONFIG_SPL 1
 #define CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT
 #define CONFIG_SPL_ENV_SUPPORT
 #define CONFIG_SPL_SERIAL_SUPPORT
diff --git a/include/configs/BSC9131RDB.h b/include/configs/BSC9131RDB.h
index e6b46e4..56a3e94 100644
--- a/include/configs/BSC9131RDB.h
+++ b/include/configs/BSC9131RDB.h
@@ -25,7 +25,6 @@
 #endif
 
 #ifdef CONFIG_NAND
-#define CONFIG_SPL 1
 #define CONFIG_SPL_INIT_MINIMAL
 #define CONFIG_SPL_SERIAL_SUPPORT
 #define CONFIG_SPL_NAND_SUPPORT
diff --git a/include/configs/BSC9132QDS.h b/include/configs/BSC9132QDS.h
index fc45e45..4089b33 100644
--- a/include/configs/BSC9132QDS.h
+++ b/include/configs/BSC9132QDS.h
@@ -41,7 +41,6 @@
 #endif
 
 #ifdef CONFIG_NAND
-#define CONFIG_SPL 1
 #define CONFIG_SPL_INIT_MINIMAL
 #define CONFIG_SPL_SERIAL_SUPPORT
 #define CONFIG_SPL_NAND_SUPPORT
diff --git a/include/configs/C29XPCIE.h b/include/configs/C29XPCIE.h
index f382b48..8ae33a5 100644
--- a/include/configs/C29XPCIE.h
+++ b/include/configs/C29XPCIE.h
@@ -24,8 +24,6 @@
 #endif
 
 #ifdef CONFIG_NAND
-#define CONFIG_SPL 1
-#define CONFIG_TPL 1
 #ifdef CONFIG_TPL_BUILD
 #define CONFIG_SPL_NAND_BOOT
 #define CONFIG_SPL_FLUSH_IMAGE
diff --git a/include/configs/MPC8313ERDB.h b/include/configs/MPC8313ERDB.h
index 7f5aa59..dd81229 100644
--- a/include/configs/MPC8313ERDB.h
+++ b/include/configs/MPC8313ERDB.h
@@ -19,7 +19,6 @@
 #define CONFIG_MPC8313ERDB 1
 
 #ifdef CONFIG_NAND
-#define CONFIG_SPL 1
 #define CONFIG_SPL_INIT_MINIMAL
 #define CONFIG_SPL_SERIAL_SUPPORT
 #define CONFIG_SPL_NAND_SUPPORT
diff --git a/include/configs/P1010RDB.h b/include/configs/P1010RDB.h
index 86d62e1..c491b50 100644
--- a/include/configs/P1010RDB.h
+++ b/include/configs/P1010RDB.h
@@ -21,7 +21,6 @@
 #define CONFIG_NAND_FSL_IFC
 
 #ifdef CONFIG_SDCARD
-#define CONFIG_SPL 1
 #define CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT
 #define CONFIG_SPL_DRIVERS_MISC_SUPPORT
 #define CONFIG_SPL_ENV_SUPPORT
@@ -56,7 +55,6 @@
 #define CONFIG_SYS_TEXT_BASE   0x1100

[U-Boot] [PATCH v2 05/11] include: define CONFIG_SPL and CONFIG_TPL as 1

2014-05-28 Thread Masahiro Yamada
We are about to switch to Kconfig in the next commit.
But there are something to get done beforehand.

In Kconfig, include/generated/autoconf.h defines boolean
CONFIG macros as 1.

CONFIG_SPL and CONFIG_TPL, if defined, must be set to 1.
Otherwise, when switching to Kconfig, the build log
would be sprinkled with warning messages like this:
  warning: "CONFIG_SPL" redefined [enabled by default]

Signed-off-by: Masahiro Yamada 
Reviewed-by: Simon Glass 
---

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

 doc/README.SPL | 2 +-
 include/configs/B4860QDS.h | 2 +-
 include/configs/BSC9131RDB.h   | 2 +-
 include/configs/BSC9132QDS.h   | 2 +-
 include/configs/C29XPCIE.h | 4 ++--
 include/configs/MPC8313ERDB.h  | 2 +-
 include/configs/P1010RDB.h | 8 
 include/configs/P1022DS.h  | 8 
 include/configs/P1_P2_RDB.h| 8 
 include/configs/T104xRDB.h | 2 +-
 include/configs/T208xQDS.h | 2 +-
 include/configs/T208xRDB.h | 2 +-
 include/configs/T4240QDS.h | 2 +-
 include/configs/a3m071.h   | 2 +-
 include/configs/am335x_igep0033.h  | 2 +-
 include/configs/am3517_crane.h | 2 +-
 include/configs/am3517_evm.h   | 2 +-
 include/configs/apf27.h| 2 +-
 include/configs/arndale.h  | 2 +-
 include/configs/bur_am335x_common.h| 2 +-
 include/configs/cam_enc_4xx.h  | 2 +-
 include/configs/cm_t35.h   | 2 +-
 include/configs/da850evm.h | 2 +-
 include/configs/devkit8000.h   | 2 +-
 include/configs/exynos5-dt.h   | 2 +-
 include/configs/hawkboard.h| 2 +-
 include/configs/ipam390.h  | 2 +-
 include/configs/lwmon5.h   | 2 +-
 include/configs/m53evk.h   | 2 +-
 include/configs/mcx.h  | 2 +-
 include/configs/microblaze-generic.h   | 2 +-
 include/configs/mx31pdk.h  | 2 +-
 include/configs/mxs.h  | 2 +-
 include/configs/omap3_evm_common.h | 2 +-
 include/configs/origen.h   | 2 +-
 include/configs/p1_p2_rdb_pc.h | 8 
 include/configs/palmtreo680.h  | 2 +-
 include/configs/pcm051.h   | 2 +-
 include/configs/sama5d3xek.h   | 2 +-
 include/configs/siemens-am33x-common.h | 2 +-
 include/configs/smdkv310.h | 2 +-
 include/configs/socfpga_cyclone5.h | 2 +-
 include/configs/tam3517-common.h   | 2 +-
 include/configs/tao3530.h  | 2 +-
 include/configs/tegra-common.h | 2 +-
 include/configs/ti814x_evm.h   | 2 +-
 include/configs/ti816x_evm.h   | 2 +-
 include/configs/ti_armv7_common.h  | 2 +-
 include/configs/tricorder.h| 2 +-
 include/configs/tx25.h | 2 +-
 include/configs/vpac270.h  | 2 +-
 include/configs/woodburn_sd.h  | 2 +-
 include/configs/x600.h | 2 +-
 include/configs/zynq-common.h  | 2 +-
 54 files changed, 67 insertions(+), 67 deletions(-)

diff --git a/doc/README.SPL b/doc/README.SPL
index 57a39a4..2b4b0b8 100644
--- a/doc/README.SPL
+++ b/doc/README.SPL
@@ -40,7 +40,7 @@ COBJS-$(CONFIG_SPL_BUILD) += foo.o
 
 The building of SPL images can be with:
 
-#define CONFIG_SPL
+#define CONFIG_SPL 1
 
 Because SPL images normally have a different text base, one has to be
 configured by defining CONFIG_SPL_TEXT_BASE. The linker script has to be
diff --git a/include/configs/B4860QDS.h b/include/configs/B4860QDS.h
index 1af9ba6..cb35116 100644
--- a/include/configs/B4860QDS.h
+++ b/include/configs/B4860QDS.h
@@ -23,7 +23,7 @@
 #define CONFIG_RAMBOOT_TEXT_BASE   CONFIG_SYS_TEXT_BASE
 #define CONFIG_RESET_VECTOR_ADDRESS0xfffc
 #else
-#define CONFIG_SPL
+#define CONFIG_SPL 1
 #define CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT
 #define CONFIG_SPL_ENV_SUPPORT
 #define CONFIG_SPL_SERIAL_SUPPORT
diff --git a/include/configs/BSC9131RDB.h b/include/configs/BSC9131RDB.h
index 5a316c8..e6b46e4 100644
--- a/include/configs/BSC9131RDB.h
+++ b/include/configs/BSC9131RDB.h
@@ -25,7 +25,7 @@
 #endif
 
 #ifdef CONFIG_NAND
-#define CONFIG_SPL
+#define CONFIG_SPL 1
 #define CONFIG_SPL_INIT_MINIMAL
 #define CONFIG_SPL_SERIAL_SUPPORT
 #define CONFIG_SPL_NAND_SUPPORT
diff --git a/include/configs/BSC9132QDS.h b/include/configs/BSC9132QDS.h
index 7bb5d33..fc45e45 100644
--- a/include/configs/BSC9132QDS.h
+++ b/include/configs/BSC9132QDS.h
@@ -41,7 +41,7 @@
 #endif
 
 #ifdef CONFIG_NAND
-#define CONFIG_SPL
+#define CONFIG_SPL 1
 #define CONFIG_SPL_INIT_MINIMAL
 #define CONFIG_SPL_SERIAL_SUPPORT
 #define CONFIG_SPL_NAND_SUPPORT
diff --git a/include/configs/C29XPCIE.h b/include/configs/C29XPCIE.h
index 9e12fac..f382b48 100644
--- a/include/configs/C29XPCIE.h
+++ b/include/configs/C29XPCIE.h
@@ -24,8 +24,8 @@
 #endif
 
 #ifdef CONFIG_NAND
-#define CONFIG_SPL
-#define CONFIG_TPL
+#define CONFIG_SPL 1
+

[U-Boot] [PATCH v2 07/11] MAKEALL: adjust for Kconfig

2014-05-28 Thread Masahiro Yamada
Use "make _defconfig" instead of "make _config".

FIXME!
This fixup is bad because it still depends on boards.cfg
to support options such as -a , -c  etc.
We want to delete it when switching to Kconfig.

We have to invent another method without using boards.cfg.

Signed-off-by: Masahiro Yamada 
---

Changes in v2: None

 MAKEALL | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/MAKEALL b/MAKEALL
index 020e65f..45b28f4 100755
--- a/MAKEALL
+++ b/MAKEALL
@@ -506,9 +506,9 @@ get_target_location() {
 
set ${line}
 
-   CONFIG_NAME="${7%_config}"
+   CONFIG_NAME="${7%_defconfig}"
 
-   [ "${BOARD_NAME}" ] || BOARD_NAME="${7%_config}"
+   [ "${BOARD_NAME}" ] || BOARD_NAME="${7%_defconfig}"
 
if [ $# -gt 5 ]; then
if [ "$6" = "-" ] ; then
@@ -645,7 +645,7 @@ build_target() {
fi
 
${MAKE} distclean >/dev/null
-   ${MAKE} -s ${target}_config
+   ${MAKE} -s ${target}_defconfig
 
${MAKE} ${JOBS} ${CHECK} all \
>${LOG_DIR}/$target.MAKELOG 2> ${LOG_DIR}/$target.ERR
-- 
1.9.1

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


[U-Boot] [PATCH v2 04/11] kconfig: add basic Kconfig files

2014-05-28 Thread Masahiro Yamada
This commit adds more Kconfig files, which were written by hand.

Signed-off-by: Masahiro Yamada 
---

Changes in v2:
  - Do not include "board/Kconfig"
  - Drop CONFIG_BUILD_MODE

 Kconfig  | 41 +
 arch/Kconfig | 66 
 2 files changed, 107 insertions(+)
 create mode 100644 Kconfig
 create mode 100644 arch/Kconfig

diff --git a/Kconfig b/Kconfig
new file mode 100644
index 000..4ddb425
--- /dev/null
+++ b/Kconfig
@@ -0,0 +1,41 @@
+#
+# For a description of the syntax of this configuration file,
+# see Documentation/kbuild/kconfig-language.txt.
+#
+mainmenu "U-Boot $UBOOTVERSION Configuration"
+
+config UBOOTVERSION
+   string
+   option env="UBOOTVERSION"
+
+config KCONFIG_OBJDIR
+   string
+   option env="KCONFIG_OBJDIR"
+
+menu "General setup"
+
+config SPL_BUILD
+   bool
+   depends on $KCONFIG_OBJDIR="spl/" || $KCONFIG_OBJDIR="tpl/"
+   default y
+
+config TPL_BUILD
+   bool
+   depends on $KCONFIG_OBJDIR="tpl/"
+   default y
+
+config SPL
+   bool
+   prompt "Build SPL image" if !SPL_BUILD
+   default y if SPL_BUILD
+
+config TPL
+   bool
+   depends on SPL
+   prompt "Build TPL image" if !SPL_BUILD
+   default y if TPL_BUILD
+   default n
+
+endmenu# General setup
+
+source "arch/Kconfig"
diff --git a/arch/Kconfig b/arch/Kconfig
new file mode 100644
index 000..8620a4f
--- /dev/null
+++ b/arch/Kconfig
@@ -0,0 +1,66 @@
+choice
+   prompt "Architecture select"
+   default SANDBOX
+
+config ARC
+   bool "ARC architecture"
+
+config ARM
+   bool "ARM architecture"
+
+config AVR32
+   bool "AVR32 architecture"
+
+config BLACKFIN
+   bool "Blackfin architecture"
+
+config M68K
+   bool "M68000 architecture"
+
+config MICROBLAZE
+   bool "MicroBlaze architecture"
+
+config MIPS
+   bool "MIPS architecture"
+
+config NDS32
+   bool "NDS32 architecture"
+
+config NIOS2
+   bool "Nios II architecture"
+
+config OPENRISC
+   bool "OpenRISC architecture"
+
+config PPC
+   bool "PowerPC architecture"
+
+config SANDBOX
+   bool "Sandbox"
+
+config SH
+   bool "SuperH architecture"
+
+config SPARC
+   bool "SPARC architecture"
+
+config X86
+   bool "x86 architecture"
+
+endchoice
+
+source "arch/arc/Kconfig"
+source "arch/arm/Kconfig"
+source "arch/avr32/Kconfig"
+source "arch/blackfin/Kconfig"
+source "arch/m68k/Kconfig"
+source "arch/microblaze/Kconfig"
+source "arch/mips/Kconfig"
+source "arch/nds32/Kconfig"
+source "arch/nios2/Kconfig"
+source "arch/openrisc/Kconfig"
+source "arch/powerpc/Kconfig"
+source "arch/sandbox/Kconfig"
+source "arch/sh/Kconfig"
+source "arch/sparc/Kconfig"
+source "arch/x86/Kconfig"
-- 
1.9.1

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


[U-Boot] [PATCH v2 08/11] buildman: adjust for Kconfig

2014-05-28 Thread Masahiro Yamada
Use "make _defconfig" instead of "make _config".

FIXME!
This fixup is bad because it still depends on boards.cfg
to support options such as -a , -c  etc.
We want to delete it when switching to Kconfig.

We have to invent another method without using boards.cfg.

Signed-off-by: Masahiro Yamada 
---

Changes in v2: None

 tools/buildman/board.py   | 2 +-
 tools/buildman/builder.py | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/buildman/board.py b/tools/buildman/board.py
index 5172a47..7bcc932 100644
--- a/tools/buildman/board.py
+++ b/tools/buildman/board.py
@@ -17,7 +17,7 @@ class Board:
 soc: Name of SOC, or '' if none (e.g. mx31)
 vendor: Name of vendor (e.g. armltd)
 board_name: Name of board (e.g. integrator)
-target: Target name (use make _config to configure)
+target: Target name (use make _defconfig to configure)
 options: board-specific options (e.g. integratorcp:CM1136)
 """
 self.target = target
diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py
index 4a2d753..6ccb5f6 100644
--- a/tools/buildman/builder.py
+++ b/tools/buildman/builder.py
@@ -198,7 +198,7 @@ class BuilderThread(threading.Thread):
 commit_upto: Commit number to build (0...n-1)
 brd: Board object to build
 work_dir: Directory to which the source will be checked out
-do_config: True to run a make _config on the source
+do_config: True to run a make _defconfig on the source
 force_build: Force a build even if one was previously done
 
 Returns:
@@ -251,7 +251,7 @@ class BuilderThread(threading.Thread):
 args = ['O=build', '-s']
 if self.builder.num_jobs is not None:
 args.extend(['-j', str(self.builder.num_jobs)])
-config_args = ['%s_config' % brd.target]
+config_args = ['%s_defconfig' % brd.target]
 config_out = ''
 args.extend(self.builder.toolchains.GetMakeArguments(brd))
 
@@ -404,7 +404,7 @@ class BuilderThread(threading.Thread):
 work_dir = self.builder.GetThreadDir(self.thread_num)
 self.toolchain = None
 if job.commits:
-# Run 'make board_config' on the first commit
+# Run 'make board_defconfig' on the first commit
 do_config = True
 commit_upto  = 0
 force_build = False
-- 
1.9.1

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


[U-Boot] [PATCH v2 11/11] kconfig: remove old script

2014-05-28 Thread Masahiro Yamada
mkconfig is no longer used in Kconfig.

Signed-off-by: Masahiro Yamada 
---

Changes in v2: None

 mkconfig | 192 ---
 1 file changed, 192 deletions(-)
 delete mode 100755 mkconfig

diff --git a/mkconfig b/mkconfig
deleted file mode 100755
index cd911a9..000
--- a/mkconfig
+++ /dev/null
@@ -1,192 +0,0 @@
-#!/bin/sh -e
-
-# Script to create header files and links to configure
-# U-Boot for a specific board.
-#
-# Parameters:  Target  Architecture  CPU  Board [VENDOR] [SOC]
-#
-# (C) 2002-2013 DENX Software Engineering, Wolfgang Denk 
-#
-# SPDX-License-Identifier: GPL-2.0+
-#
-
-APPEND=no  # Default: Create new config file
-BOARD_NAME=""  # Name to print in make output
-TARGETS=""
-
-arch=""
-cpu=""
-board=""
-vendor=""
-soc=""
-options=""
-
-if [ \( $# -eq 2 \) -a \( "$1" = "-A" \) ] ; then
-   # Automatic mode
-   line=`awk '($0 !~ /^#/ && $7 ~ /^'"$2"'$/) { print $1, $2, $3, $4, $5, 
$6, $7, $8 }' $srctree/boards.cfg`
-   if [ -z "$line" ] ; then
-   echo "make: *** No rule to make target \`$2_config'.  Stop." >&2
-   exit 1
-   fi
-
-   set ${line}
-   # add default board name if needed
-   [ $# = 3 ] && set ${line} ${1}
-fi
-
-while [ $# -gt 0 ] ; do
-   case "$1" in
-   --) shift ; break ;;
-   -a) shift ; APPEND=yes ;;
-   -n) shift ; BOARD_NAME="${7%_config}" ; shift ;;
-   -t) shift ; TARGETS="`echo $1 | sed 's:_: :g'` ${TARGETS}" ; shift ;;
-   *)  break ;;
-   esac
-done
-
-[ $# -lt 7 ] && exit 1
-[ $# -gt 8 ] && exit 1
-
-# Strip all options and/or _config suffixes
-CONFIG_NAME="${7%_config}"
-
-[ "${BOARD_NAME}" ] || BOARD_NAME="${7%_config}"
-
-arch="$2"
-cpu=`echo $3 | awk 'BEGIN {FS = ":"} ; {print $1}'`
-spl_cpu=`echo $3 | awk 'BEGIN {FS = ":"} ; {print $2}'`
-if [ "$6" = "" ] ; then
-   board=
-elif [ "$6" = "-" ] ; then
-   board=${BOARD_NAME}
-else
-   board="$6"
-fi
-[ "$5" != "-" ] && vendor="$5"
-[ "$4" != "-" ] && soc="$4"
-[ $# -gt 7 ] && [ "$8" != "-" ] && {
-   # check if we have a board config name in the options field
-   # the options field mave have a board config name and a list
-   # of options, both separated by a colon (':'); the options are
-   # separated by commas (',').
-   #
-   # Check for board name
-   tmp="${8%:*}"
-   if [ "$tmp" ] ; then
-   CONFIG_NAME="$tmp"
-   fi
-   # Check if we only have a colon...
-   if [ "${tmp}" != "$8" ] ; then
-   options=${8#*:}
-   TARGETS="`echo ${options} | sed 's:,: :g'` ${TARGETS}"
-   fi
-}
-
-if [ "${ARCH}" -a "${ARCH}" != "${arch}" ]; then
-   echo "Failed: \$ARCH=${ARCH}, should be '${arch}' for ${BOARD_NAME}" 
1>&2
-   exit 1
-fi
-
-#
-# Test above needed aarch64, now we need arm
-#
-if [ "${arch}" = "aarch64" ]; then
-   arch="arm"
-fi
-
-if [ "$options" ] ; then
-   echo "Configuring for ${BOARD_NAME} - Board: ${CONFIG_NAME}, Options: 
${options}"
-else
-   echo "Configuring for ${BOARD_NAME} board..."
-fi
-
-#
-# Create link to architecture specific headers
-#
-if [ -n "$KBUILD_SRC" ] ; then
-   mkdir -p ${objtree}/include
-   LNPREFIX=${srctree}/arch/${arch}/include/asm/
-   cd ${objtree}/include
-   mkdir -p asm
-else
-   cd arch/${arch}/include
-fi
-
-rm -f asm/arch
-
-if [ -z "${soc}" ] ; then
-   ln -s ${LNPREFIX}arch-${cpu} asm/arch
-else
-   ln -s ${LNPREFIX}arch-${soc} asm/arch
-fi
-
-if [ "${arch}" = "arm" ] ; then
-   rm -f asm/proc
-   ln -s ${LNPREFIX}proc-armv asm/proc
-fi
-
-if [ -z "$KBUILD_SRC" ] ; then
-   cd ${srctree}/include
-fi
-
-#
-# Create include file for Make
-#
-( echo "ARCH   = ${arch}"
-if [ ! -z "$spl_cpu" ] ; then
-   echo 'ifeq ($(CONFIG_SPL_BUILD),y)'
-   echo "CPU= ${spl_cpu}"
-   echo "else"
-   echo "CPU= ${cpu}"
-   echo "endif"
-else
-   echo "CPU= ${cpu}"
-fi
-echo "BOARD  = ${board}"
-
-[ "${vendor}" ] && echo "VENDOR = ${vendor}"
-[ "${soc}"] && echo "SOC= ${soc}"
-exit 0 ) > config.mk
-
-# Assign board directory to BOARDIR variable
-if [ -z "${vendor}" ] ; then
-BOARDDIR=${board}
-else
-BOARDDIR=${vendor}/${board}
-fi
-
-#
-# Create board specific header file
-#
-if [ "$APPEND" = "yes" ]   # Append to existing config file
-then
-   echo >> config.h
-else
-   > config.h  # Create new config file
-fi
-echo "/* Automatically generated - do not edit */" >>config.h
-
-for i in ${TARGETS} ; do
-   i="`echo ${i} | sed '/=/ {s/=/  /;q; } ; { s/$/ 1/; }'`"
-   echo "#define CONFIG_${i}" >>config.h ;
-done
-
-echo "#define CONFIG_SYS_ARCH  \"${arch}\""  >> config.h
-echo "#define CONFIG_SYS_CPU   \"${cpu}\""   >> config.h
-echo "#define CONFIG_SYS_BOARD \"${board}\"" >> config.h
-
-[ "${vendor}" ] && echo "#define CONFIG_SYS_VENDOR \"${vendor}\"" >> config.h
-
-[ "${soc}"

[U-Boot] [PATCH v2 02/11] Do not apply: tools: add genkconfig

2014-05-28 Thread Masahiro Yamada
 
 Do not apply this patch to the main line
 

 What is this tool?
 --

This tool converts boards.cfg to defconfig and Kconfig files.

It automatically generates
 - arch/${ARCH}/Kconfig
 - board/${VENDOR}/${BOARD}/Kconfig
 - board/${BOARD}/Kconfig
 - configs/${TARGET_BOARD}_defconfig

 How to use?
 ---

Open tools/print_allconfigs with an editor.

Adjust cross compilers part for your environment.

  # Specify your favoriate cross tools
  CROSS_COMPILE_ARC=arc-linux-
  CROSS_COMPILE_AARCH64=aarch64-linux-gnu-
  CROSS_COMPILE_ARM=arm-unknown-linux-gnueabi-
   [snip]
  CROSS_COMPILE_X86=i386-linux-

And then, run "tools/genkconfig".

 Why is this patch here?
 ---

The file boards.cfg is touched very frequently.
All the time, new/old boards are being added/removed.

The next commit was generated based on the u-boot/master at the time
I posted it.
It will become out-dated soon.

You can update it with this tool.

Signed-off-by: Masahiro Yamada 
---

Changes in v2:
 - Do not output CONFIG_BOARD_MAINTAINERS and CONFIG_BOARD_STATUS
 - Delete board/Kconfig and move "source board/*/*/Kconfig"
   statements to arch/*/Kconfig.

 tools/genkconfig   | 258 +
 tools/print_allconfigs |  77 +++
 2 files changed, 335 insertions(+)
 create mode 100755 tools/genkconfig
 create mode 100755 tools/print_allconfigs

diff --git a/tools/genkconfig b/tools/genkconfig
new file mode 100755
index 000..5d94d7d
--- /dev/null
+++ b/tools/genkconfig
@@ -0,0 +1,258 @@
+#!/bin/bash
+
+set -e
+
+rm -rf configs
+mkdir -p configs/spl configs/tpl
+find board -name Kconfig | xargs rm -f
+
+get_arch()
+{
+   case "$arch" in
+   powerpc) echo PPC;;
+   *)   echo ${1^^};;
+   esac
+}
+
+arch_list="arc arm avr32 blackfin m68k microblaze mips nds32 nios2 openrisc 
powerpc sandbox sh sparc x86"
+
+for arch in $arch_list
+do
+   ARCH=$(get_arch $arch)
+
+   case "$arch" in
+   blackfin) menu="Blackfin";;
+   m68k) menu="M68000";;
+   microblaze) menu="MicroBlaze";;
+   nios2) menu="Nios II";;
+   openrisc) menu="OpenRISC";;
+   powerpc) menu="PowerPC";;
+   sandbox) menu="Sandbox";;
+   sh) menu="SuperH";;
+   x86) menu="x86";;
+   *) menu=${arch^^};;
+   esac
+
+cat < arch/$arch/Kconfig
+menu "$menu architecture"
+   depends on $ARCH
+
+config SYS_ARCH
+   string
+   default "$arch"
+
+EOF
+
+if [ "$arch" = "sandbox" ]; then
+cat <> arch/$arch/Kconfig
+config SYS_CPU
+   string
+   default "$arch"
+
+config SYS_BOARD
+   string
+   default "$arch"
+
+config SYS_CONFIG_NAME
+   string
+   default "$arch"
+EOF
+else
+cat <> arch/$arch/Kconfig
+choice
+   prompt "Target select"
+
+EOF
+fi
+
+done
+
+write_defconfig ()
+{
+   echo >> $defconfig "CONFIG_$ARCH=y"
+   if [ "$arch" != sandbox ]; then
+   echo >> $defconfig "CONFIG_$TARGET=y"
+   fi
+}
+
+write_main_defconfig ()
+{
+   if [ "$spl_enable" = "y" ]; then
+   echo >> $defconfig "CONFIG_SPL=y"
+   fi
+
+   if [ "$tpl_enable" = "y" ]; then
+   echo >> $defconfig "CONFIG_TPL=y"
+   fi
+
+   write_defconfig
+}
+
+write_kconfig ()
+{
+   echo >> $kconfig
+   echo >> $kconfig "if $TARGET"
+   echo >> $kconfig
+
+   echo >> $kconfig "config SYS_CPU"
+   echo >> $kconfig "  string"
+   if [ "$spl_cpu" != "$cpu" ]; then
+   echo >> $kconfig "  default \"$spl_cpu\" if SPL_BUILD"
+   echo >> $kconfig "  default \"$cpu\" if !SPL_BUILD"
+   else
+   echo >> $kconfig "  default \"$cpu\""
+   fi
+   echo >> $kconfig
+
+   echo >> $kconfig "config SYS_BOARD"
+   echo >> $kconfig "  string"
+   echo >> $kconfig "  default \"$board\""
+   echo >> $kconfig
+
+   if [ "$vendor" != "-" ]; then
+   echo >> $kconfig "config SYS_VENDOR"
+   echo >> $kconfig "  string"
+   echo >> $kconfig "  default \"$vendor\""
+   echo >> $kconfig
+   fi
+
+   if [ "$soc" != "-" ]; then
+   echo >> $kconfig "config SYS_SOC"
+   echo >> $kconfig "  string"
+   echo >> $kconfig "  default \"$soc\""
+   echo >> $kconfig
+   fi
+
+   echo >> $kconfig "config SYS_CONFIG_NAME"
+   echo >> $kconfig "  string"
+   echo >> $kconfig "  default \"$config_name\""
+   echo >> $kconfig
+
+   if [ "$extra_options" ]; then
+   # O2MNT_O2M110, O2MNT_O2M112, O2MNT_O2M113 boards include
+   # double-quotations in the extra option field.
+   # We must escape them.
+   echo >> $kconfig "co

Re: [U-Boot] [PATCH v2 07/12] exynos5: support tps65090 pmic

2014-05-28 Thread Minkyu Kang
Dear Simon Glass,

On 27/05/14 09:01, Simon Glass wrote:
> Hi Minkyu,
> 
> On 25 May 2014 21:15, Minkyu Kang  wrote:
>> Dear Simon,
>>
>> On 23/05/14 02:27, Simon Glass wrote:
>>> Hi Minkyu,
>>>
>>> On 21 May 2014 15:20, Minkyu Kang  wrote:
 On 22/05/14 03:58, Simon Glass wrote:
> Hi Minkyu,
>
> On 21 May 2014 00:05, Minkyu Kang  wrote:
>> On 20/05/14 20:47, Simon Glass wrote:
>>> Hi Minkyu,
>>>
>>> On 15 May 2014 00:51, Minkyu Kang  wrote:
 On 03/04/14 08:24, Simon Glass wrote:
> From: Aaron Durbin 
>
> The TSP65090 is a PMIC on some exynos5 boards. The init function is
> called for the TPS65090 pmic. If that device is not a part of the 
> device
> tree (returns -ENODEV) then continue. Otherwise return a failure.
>
> Signed-off-by: Aaron Durbin 
> Signed-off-by: Simon Glass 
> Reviewed-by: Simon Glass 
> ---
>
> Changes in v2:
> - Move code to exynos5-dt.c
> - Fix comment style
> - Add #ifdef around tps65090 code
>
>  board/samsung/smdk5250/exynos5-dt.c | 13 +
>  1 file changed, 13 insertions(+)
>
> diff --git a/board/samsung/smdk5250/exynos5-dt.c 
> b/board/samsung/smdk5250/exynos5-dt.c
> index 1a64b9b..2c1cf8a 100644
> --- a/board/samsung/smdk5250/exynos5-dt.c
> +++ b/board/samsung/smdk5250/exynos5-dt.c
> @@ -20,6 +20,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
>
>  DECLARE_GLOBAL_DATA_PTR;
> @@ -164,7 +165,19 @@ int exynos_power_init(void)
>
>  #ifdef CONFIG_POWER_MAX77686
>   ret = max77686_init();
> + if (ret)
> + return ret;
>  #endif
> +#ifdef CONFIG_POWER_TPS65090
> + /*
> +  * The TPS65090 may not be in the device tree. If so, it is not
> +  * an error.

 Then, how we can initialise the tps65090?
>>>
>>> It is initialised if a suitable node is found in the device tree. If
>>> the device tree does not have it, then the hardware is assumed to not
>>> have this chip.
>>
>> then I think, it's an error.
>> Why you said, it is not an error?
>
> I may be misunderstanding your question, but I'll try to answer what I
> think you are asking.
>
> The device tree contains nodes for hardware in the machine that you
> want to initialise, and information about each one. Devices can be
> enabled or disabled by including or removing this information from the
> device tree (or marking a device disabled with a status = "disabled"
> property in the node).
>
> The tps65090 chip is not used in all exynos5-dt boards, but is used in
> some. For example smdk5250 does not have it, but snow does. So we use
> the device tree to specify the difference, including (on snow) things
> like the tps65090, the display bridge chip, etc.
>

 Hm, it doesn't make sense.
 Then it(#define CONFIG_POWER_TPS65090) should go into each config files.
 Not in exynos5-dt.h.
 Please modify it and patch 6/12 also.
>>>
>>> The way it works at present is that there is a single exynos5-dt.h
>>> file which is used by all exynos5 boards. To the extent possible we
>>> have avoided putting particular features in things like snow.h and
>>> smdk5250.h - they just include exynos5-dt.h without changes.
>>>
>>> The idea is that we can have one U-Boot binary that runs on any
>>> exynos5 device, rather than lots of different options. This makes it
>>> much easier to test changes sine we only need to build it once. If
>>> every exynos5 board has different #defines then there are more
>>> combinations to build and test. This is similar to what the kernel
>>> does with arch/arm/mach-exynos/mach-exynos5-dt.c.
>>>
>>> Using this approach the only differences between smdk5250, daisy,
>>> snow, spring, etc. are in the device tree. I'd really like to avoid
>>> changing this now. It is easy enough for people to add their own
>>> private variants of these locally if they want to, but for mainline I
>>> believe it is better to be more generic.
>>
>> I totally understood what you assert.
>> But I can't agree with you.
>> Do you think if we collect all features at exynos5-dt.h then
>> it can be generic? even if some boards doesn't have the device?
>> I think no. It just wrong definition.
>> We should separate exynos5 generic features and board specific features.
> 
> Yes my intent is that we have an exynos5 build which (given the right
> device tree) can support any board. That has been the intent of the
> device tree effort for a while, and similar to the kernel approach.
> 
> What is the objection of having the driver compiled in for a board
> that doesn't have the device? Is it the extra 1KB of c

Re: [U-Boot] [PATCH v2] Separate EBV Socrates board from Altera Cyclone 5 board and from Virtual Target

2014-05-28 Thread Pavel Machek
Hi!

> > Well, OTOH it is orthogonal problem to the "board name is shared
> > between socrates and altera" and "config is shared between altera and
> > virtual target". And this patch is going to go stale rather quickly.
> 
> I admit, I do not understand that fully.

There are no differences between EBV socrates and socfpga boards,
currently.

> >> to have our own configuration for our MCV module and this will certainly
> >> be sold by DENX.  I think we need an infrastructure to allow for boards
> >> sold by arbitrary manufacturers all using the Altera chip.
> >> 
> >> The situation as such is not uncommon, so maybe you can follow examples
> >> from different CPUs?  I.e. how is the imx6 handled on the different base
> >> boards?
> >
> > The examples I seen were different: there different board vendors
> > actually needed different code.
> >
> > AFAICT, one solution would be to put "-" in that column, and do "git
> > mv board/altera/ board/socfpga/".
> 
> Putting "-" in the vendor column just doesn't feel right.  

That's what mx6 did, AFAICT.

> How about
> using a minimal board C file for socrates under ebv/socrates that only
> implements checkboard and shares the rest?

That does not feel right, either. (Too much changes for too little gain.)

Actually.. there's nothing Altera specific in board/altera (it works
on ebv just fine), so board/socfpga sounds like a better name. But I
don't think such rename should be done lightly, so I still believe the
patch as submitted is the best way to go.

> > But if we decide to go that way, it should really be separate patch.
> 
> I still like to see a solution that scales to things we already know
> will happen ;)  Looking at the original patch, with this in mind even
> the #define ALTERA_BOARD_NAME doesn't look right any longer.

I don't know what will happen next. Albert asked me to resubmit patch
updated to newer code, which I did.

Best regards,
Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) 
http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] env_eeprom: Assign default environment during board_init_f

2014-05-28 Thread Michal Simek
On 05/26/2014 04:21 PM, Siva Durga Prasad Paladugu wrote:
> Assign default environment and set env valid during board_init_f
> before relocation as the actual environment will be read from eeprom
> later.
> 
> Signed-off-by: Siva Durga Prasad Paladugu 
> ---
> 
> Changes in v2:
> -Handled the same in redundant env case also
> as per review comment.
> 
>  common/env_eeprom.c |   12 ++--
>  1 files changed, 10 insertions(+), 2 deletions(-)
> 
> diff --git a/common/env_eeprom.c b/common/env_eeprom.c
> index 490ac73..905d39a 100644
> --- a/common/env_eeprom.c
> +++ b/common/env_eeprom.c
> @@ -147,6 +147,7 @@ int saveenv(void)
>  #ifdef CONFIG_ENV_OFFSET_REDUND
>  int env_init(void)
>  {
> +#ifdef ENV_IS_EMBEDDED
>   ulong len, crc[2], crc_tmp;
>   unsigned int off, off_env[2];
>   uchar buf[64], flags[2];
> @@ -212,12 +213,16 @@ int env_init(void)
>   gd->env_addr = off_env[1] + offsetof(env_t, data);
>   else if (gd->env_valid == 1)
>   gd->env_addr = off_env[0] + offsetof(env_t, data);
> -
> +#else
> + gd->env_addr = (ulong)&default_environment[0];
> + gd->env_valid = 1;
> +#endif
>   return 0;
>  }
>  #else
>  int env_init(void)
>  {
> +#ifdef ENV_IS_EMBEDDED
>   ulong crc, len, new;
>   unsigned off;
>   uchar buf[64];
> @@ -250,7 +255,10 @@ int env_init(void)
>   gd->env_addr= 0;
>   gd->env_valid   = 0;
>   }
> -
> +#else
> + gd->env_addr = (ulong)&default_environment[0];
> + gd->env_valid = 1;
> +#endif
>   return 0;
>  }
>  #endif

Acked-by: Michal Simek 

Thanks,
Michal

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




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


Re: [U-Boot] [PATCH v3] fat: Define MAX_CLUSTSIZE using CONFIG_FS_FAT_MAX_CLUSTSIZE

2014-05-28 Thread Michal Simek
On 05/26/2014 03:48 PM, Siva Durga Prasad Paladugu wrote:
> Define the MAX_CLUSTSIZE to default of 65536 only if
> CONFIG_FS_FAT_MAX_CLUSTSIZE is not defined.
> This option has been provided to save memory in some
> memory constrained cases.
> 
> Signed-off-by: Siva Durga Prasad Paladugu 
> ---
> 
> Changes in v3:
> -Used CONFIG_FS_FAT_MAX_CLUSTSIZE to define MAX_CLUSTSIZE
> as per review comment.
> 
> Changes in v2:
> -Defined CONFIG_FS_FAT_MAX_CLUSTSIZE and documented as
> per review comment.
> 
>  README|6 ++
>  include/fat.h |6 +-
>  2 files changed, 11 insertions(+), 1 deletions(-)
> 
> diff --git a/README b/README
> index 5f89552..2f2aba3 100644
> --- a/README
> +++ b/README
> @@ -1613,6 +1613,12 @@ CBFS (Coreboot Filesystem) support
>   filesystem. Available commands are cbfsinit, cbfsinfo, cbfsls
>   and cbfsload.
>  
> +- FAT(File Allocation Table) filesystem cluster size:
> + CONFIG_FS_FAT_MAX_CLUSTSIZE
> +
> + Define the max cluster size for fat operations else
> + a default value of 65536 will be defined.
> +
>  - Keyboard Support:
>   CONFIG_ISA_KEYBOARD
>  
> diff --git a/include/fat.h b/include/fat.h
> index 81d9790..63cf787 100644
> --- a/include/fat.h
> +++ b/include/fat.h
> @@ -18,7 +18,11 @@
>  #define VFAT_MAXSEQ  9   /* Up to 9 of 13 2-byte UTF-16 entries */
>  #define PREFETCH_BLOCKS  2
>  
> -#define MAX_CLUSTSIZE65536
> +#ifndef CONFIG_FS_FAT_MAX_CLUSTSIZE
> +#define CONFIG_FS_FAT_MAX_CLUSTSIZE 65536
> +#endif
> +#define MAX_CLUSTSIZECONFIG_FS_FAT_MAX_CLUSTSIZE
> +
>  #define DIRENTSPERBLOCK  (mydata->sect_size / sizeof(dir_entry))
>  #define DIRENTSPERCLUST  ((mydata->clust_size * mydata->sect_size) / \
>sizeof(dir_entry))
> 

Acked-by: Michal Simek 

Thanks,
Michal

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




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


Re: [U-Boot] [PATCH v1 2/4] spi, spi_mxc: do not hang in spi_xchg_single

2014-05-28 Thread Jagan Teki
On Wed, May 28, 2014 at 3:46 PM, Heiko Schocher  wrote:
> if status register do never set MXC_CSPICTRL_TC, spi_xchg_single
> endless loops. Add a timeout here to prevent endless hang.
>
> Signed-off-by: Heiko Schocher 
> Cc: Dirk Behme 
> Cc: Jagannadha Sutradharudu Teki 
> ---
>  drivers/spi/mxc_spi.c | 8 ++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/spi/mxc_spi.c b/drivers/spi/mxc_spi.c
> index f3f029d..3cd93cf 100644
> --- a/drivers/spi/mxc_spi.c
> +++ b/drivers/spi/mxc_spi.c
> @@ -212,6 +212,7 @@ int spi_xchg_single(struct spi_slave *slave, unsigned int 
> bitlen,
> int nbytes = DIV_ROUND_UP(bitlen, 8);
> u32 data, cnt, i;
> struct cspi_regs *regs = (struct cspi_regs *)mxcs->base;
> +   int timeout;
>
> debug("%s: bitlen %d dout 0x%x din 0x%x\n",
> __func__, bitlen, (u32)dout, (u32)din);
> @@ -272,9 +273,12 @@ int spi_xchg_single(struct spi_slave *slave, unsigned 
> int bitlen,
> reg_write(®s->ctrl, mxcs->ctrl_reg |
> MXC_CSPICTRL_EN | MXC_CSPICTRL_XCH);
>
> +   timeout = 1;
> /* Wait until the TC (Transfer completed) bit is set */
> -   while ((reg_read(®s->stat) & MXC_CSPICTRL_TC) == 0)
> -   ;
> +   while (timeout && ((reg_read(®s->stat) & MXC_CSPICTRL_TC) == 0)) {
> +   timeout--;
> +   udelay(10);
> +   }

Advice:
Not to use fixed time timeouts, instead go for timer api's to poll
till TC bit is set.

Sample: from zynq_spi.c
  /* Check TX FIFO completion */
ts = get_timer(0);
status = readl(&zslave->base->isr);
while (!(status & ZYNQ_SPI_IXR_TXOW_MASK)) {
if (get_timer(ts) > CONFIG_SYS_ZYNQ_SPI_WAIT) {
printf("spi_xfer: Timeout! TX FIFO not full\n");
return -1;
}
status = readl(&zslave->base->isr);
}

May be you can try similarly like above if possible - comments.

>
> /* Transfer completed, clear any pending request */
> reg_write(®s->stat, MXC_CSPICTRL_TC | MXC_CSPICTRL_RXOVF);
> --
> 1.8.3.1
>

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


Re: [U-Boot] [PATCH v2] Separate EBV Socrates board from Altera Cyclone 5 board and from Virtual Target

2014-05-28 Thread Detlev Zundel
Hi Pavel,

> Hi!
>
>> > /home/pavel/wagabuibui/u-boot/board/ebv/socfpga/Makefile: No such file
>> > or directory
>> > make[2]: *** No rule to make target
>> > `/home/pavel/wagabuibui/u-boot/board/ebv/socfpga/Makefile'.  Stop.
>> 
>> I feared as much, so thats why I asked ;)
>> 
>> > ...and I don't think we want to do board/{altera,ebv} symlink. Are
>> > there any other options? Or is "altera" in the boards file simply
>> > acceptable?
>> 
>> This is a problem that will turn up in the future even more, so I
>> propose to solve it correctly now.  It will not be long before we
>  > want
>
> Well, OTOH it is orthogonal problem to the "board name is shared
> between socrates and altera" and "config is shared between altera and
> virtual target". And this patch is going to go stale rather quickly.

I admit, I do not understand that fully.

>> to have our own configuration for our MCV module and this will certainly
>> be sold by DENX.  I think we need an infrastructure to allow for boards
>> sold by arbitrary manufacturers all using the Altera chip.
>> 
>> The situation as such is not uncommon, so maybe you can follow examples
>> from different CPUs?  I.e. how is the imx6 handled on the different base
>> boards?
>
> The examples I seen were different: there different board vendors
> actually needed different code.
>
> AFAICT, one solution would be to put "-" in that column, and do "git
> mv board/altera/ board/socfpga/".

Putting "-" in the vendor column just doesn't feel right.  How about
using a minimal board C file for socrates under ebv/socrates that only
implements checkboard and shares the rest?

> But if we decide to go that way, it should really be separate patch.

I still like to see a solution that scales to things we already know
will happen ;)  Looking at the original patch, with this in mind even
the #define ALTERA_BOARD_NAME doesn't look right any longer.

Thanks
  Detlev

-- 
We have a live-manual.  It's called emacs-de...@gnu.org.
You can stick to just reading it, but you can skip to a specific chapter
by simply sending an email asking for it ;-)
-- Stefan Monnier
--
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] Protected variable 'ethaddr' can be reset to default value (or deleted)

2014-05-28 Thread Hector Palacios

Hello,

I have enabled environment flags and have protected "ethaddr" variable in write-once 
mode: "ethaddr:mo".


As expected, once set, I cannot overwrite this variable with standard setenv 
command.
Also as expected, I can overwrite it at any time by passing the -f (forced) option to 
setenv:

setenv -f ethaddr XX:XX:XX:XX:XX:XX

The 'env default' command is supposed to reset the environment to the default values. 
Its help is:


env default [-f] -a - [forcibly] reset default environment
env default [-f] var [...] - [forcibly] reset variable(s) to their default 
values

So I expect that 'env default ethaddr' does not change the value of 'ethaddr' (which 
actually occurs) because the variable is protected, but that adding the -f option does 
change the value to the default (which doesn't occur). In other words:


  env default ethaddr   Does not change 'ethaddr' (OK)
  env default -f ethaddrDoes not change 'ethaddr' (Problem #1)

Similarly, I was also expecting that 'env default -a', which resets the whole 
environment to its default values, does not modify protected 'ethaddr' (like it 
happens when you specify the variable) and that 'env default -f -a' resets it. 
However, both commands do reset the protected variables. In other words:


  env default -aChanges/deletes 'ethaddr' (Problem #2)
  env default -f -a Changes/deletes 'ethaddr' (OK)

Actually the '-f' option, despite being in the help text is not taken into 
consideration at the 'default' subcommand. This can easily be checked in function 
do_env_default() in common/cmd_nvedit.c, where the local variable 'flag' is not 
propagated anywhere in the function.


I can easily fix Problem #1 by propagating local variable 'flag' in do_env_default() 
to set_default_vars().


Problem #2 is more difficult because U-Boot is creating a new env table from scratch, 
disregarding previous existing entries, and calling env_flags_validate() in 
'env_op_create' mode, which only checks for ENV_FLAGS_VARACCESS_PREVENT_CREATE permission.

Any ideas on how to properly fix this?

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


[U-Boot] [PATCH v1 4/4] arm, imx6: add aristainetos board

2014-05-28 Thread Heiko Schocher
CPU:   Freescale i.MX6DL rev1.1 at 792 MHz
Board: aristaitenos
I2C:   ready
DRAM:  1 GiB
NAND:  512 MiB
MMC:   FSL_SDHC: 0, FSL_SDHC: 1
SF: Detected N25Q128 with page size 256 Bytes, erase size 64 KiB, total 16 MiB

- UART5 is console
- MMC 0 and 1
- USB 0 and 1
- boot from mmc0 and spi nor flash

Signed-off-by: Heiko Schocher 
Cc: Stefano Babic 
---
 board/aristainetos/Makefile |   9 +
 board/aristainetos/aristainetos.c   | 527 
 board/aristainetos/aristainetos.cfg |  33 +++
 board/aristainetos/clocks.cfg   |  24 ++
 board/aristainetos/ddr-setup.cfg|  61 +
 board/aristainetos/mt41j128M.cfg|  70 +
 boards.cfg  |   1 +
 include/configs/aristainetos.h  | 310 +
 8 files changed, 1035 insertions(+)
 create mode 100644 board/aristainetos/Makefile
 create mode 100644 board/aristainetos/aristainetos.c
 create mode 100644 board/aristainetos/aristainetos.cfg
 create mode 100644 board/aristainetos/clocks.cfg
 create mode 100644 board/aristainetos/ddr-setup.cfg
 create mode 100644 board/aristainetos/mt41j128M.cfg
 create mode 100644 include/configs/aristainetos.h

diff --git a/board/aristainetos/Makefile b/board/aristainetos/Makefile
new file mode 100644
index 000..5de48bc
--- /dev/null
+++ b/board/aristainetos/Makefile
@@ -0,0 +1,9 @@
+#
+# Copyright (C) 2007, Guennadi Liakhovetski 
+#
+# (C) Copyright 2011 Freescale Semiconductor, Inc.
+#
+# SPDX-License-Identifier: GPL-2.0+
+#
+
+obj-y  := aristainetos.o
diff --git a/board/aristainetos/aristainetos.c 
b/board/aristainetos/aristainetos.c
new file mode 100644
index 000..56232e2
--- /dev/null
+++ b/board/aristainetos/aristainetos.c
@@ -0,0 +1,527 @@
+/*
+ * (C) Copyright 2014
+ * Heiko Schocher, DENX Software Engineering, h...@denx.de.
+ *
+ * Based on:
+ * Copyright (C) 2012 Freescale Semiconductor, Inc.
+ *
+ * Author: Fabio Estevam 
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+DECLARE_GLOBAL_DATA_PTR;
+
+#define UART_PAD_CTRL  (PAD_CTL_PUS_100K_UP |  \
+   PAD_CTL_SPEED_MED | PAD_CTL_DSE_40ohm | \
+   PAD_CTL_SRE_FAST  | PAD_CTL_HYS)
+
+#define USDHC_PAD_CTRL (PAD_CTL_PUS_47K_UP |   \
+   PAD_CTL_SPEED_LOW | PAD_CTL_DSE_80ohm | \
+   PAD_CTL_SRE_FAST  | PAD_CTL_HYS)
+
+#define ENET_PAD_CTRL  (PAD_CTL_PUS_100K_UP |  \
+   PAD_CTL_SPEED_MED | PAD_CTL_DSE_40ohm | PAD_CTL_HYS)
+
+#define SPI_PAD_CTRL (PAD_CTL_HYS | PAD_CTL_SPEED_MED | \
+ PAD_CTL_DSE_40ohm | PAD_CTL_SRE_FAST)
+
+#define I2C_PAD_CTRL   (PAD_CTL_PUS_100K_UP |  \
+   PAD_CTL_SPEED_MED | PAD_CTL_DSE_40ohm | PAD_CTL_HYS |   \
+   PAD_CTL_ODE | PAD_CTL_SRE_FAST)
+
+#define PC MUX_PAD_CTRL(I2C_PAD_CTRL)
+
+struct i2c_pads_info i2c_pad_info1 = {
+   .scl = {
+   .i2c_mode = MX6_PAD_CSI0_DAT9__I2C1_SCL | PC,
+   .gpio_mode = MX6_PAD_CSI0_DAT9__GPIO5_IO27 | PC,
+   .gp = IMX_GPIO_NR(5, 27)
+   },
+   .sda = {
+   .i2c_mode = MX6_PAD_CSI0_DAT8__I2C1_SDA | PC,
+   .gpio_mode = MX6_PAD_CSI0_DAT8__GPIO5_IO26 | PC,
+   .gp = IMX_GPIO_NR(5, 26)
+   }
+};
+
+struct i2c_pads_info i2c_pad_info2 = {
+   .scl = {
+   .i2c_mode = MX6_PAD_KEY_COL3__I2C2_SCL | PC,
+   .gpio_mode = MX6_PAD_KEY_COL3__GPIO4_IO12 | PC,
+   .gp = IMX_GPIO_NR(4, 12)
+   },
+   .sda = {
+   .i2c_mode = MX6_PAD_KEY_ROW3__I2C2_SDA | PC,
+   .gpio_mode = MX6_PAD_KEY_ROW3__GPIO4_IO13 | PC,
+   .gp = IMX_GPIO_NR(4, 13)
+   }
+};
+
+struct i2c_pads_info i2c_pad_info3 = {
+   .scl = {
+   .i2c_mode = MX6_PAD_EIM_D17__I2C3_SCL | PC,
+   .gpio_mode = MX6_PAD_EIM_D17__GPIO3_IO17 | PC,
+   .gp = IMX_GPIO_NR(3, 17)
+   },
+   .sda = {
+   .i2c_mode = MX6_PAD_EIM_D18__I2C3_SDA | PC,
+   .gpio_mode = MX6_PAD_EIM_D18__GPIO3_IO18 | PC,
+   .gp = IMX_GPIO_NR(3, 18)
+   }
+};
+
+int dram_init(void)
+{
+   gd->ram_size = get_ram_size((void *)PHYS_SDRAM, PHYS_SDRAM_SIZE);
+
+   return 0;
+}
+
+iomux_v3_cfg_t const uart1_pads[] = {
+   MX6_PAD_CSI0_DAT10__UART1_TX_DATA | MUX_PAD_CTRL(UART_PAD_CTRL),
+   MX6_PAD_CSI0_DAT11__UART1_RX_DATA | MUX_PAD_CTRL(UART_PAD_CTRL),
+};
+
+iomux_v3_cfg_t const uart5_pads[] = {
+   MX6_PAD_CSI0_DAT14__UART5_TX_DATA | MUX_PAD_CTRL(UART_PAD_CTRL),
+   MX6_PAD_CSI0_DAT15__UART5_RX_DATA | MUX_PAD_CTRL(UART_PAD_CTRL),
+};
+
+iomux_v3_cfg_t const gpio_pads[] = {
+   /* LED enable */
+   MX6_PAD_SD4_DAT5__GPIO2_IO13 | MUX_PAD_CTRL(NO_PAD_CTRL),
+   /* spi flash WP protect 

[U-Boot] [PATCH v1 2/4] spi, spi_mxc: do not hang in spi_xchg_single

2014-05-28 Thread Heiko Schocher
if status register do never set MXC_CSPICTRL_TC, spi_xchg_single
endless loops. Add a timeout here to prevent endless hang.

Signed-off-by: Heiko Schocher 
Cc: Dirk Behme 
Cc: Jagannadha Sutradharudu Teki 
---
 drivers/spi/mxc_spi.c | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/mxc_spi.c b/drivers/spi/mxc_spi.c
index f3f029d..3cd93cf 100644
--- a/drivers/spi/mxc_spi.c
+++ b/drivers/spi/mxc_spi.c
@@ -212,6 +212,7 @@ int spi_xchg_single(struct spi_slave *slave, unsigned int 
bitlen,
int nbytes = DIV_ROUND_UP(bitlen, 8);
u32 data, cnt, i;
struct cspi_regs *regs = (struct cspi_regs *)mxcs->base;
+   int timeout;
 
debug("%s: bitlen %d dout 0x%x din 0x%x\n",
__func__, bitlen, (u32)dout, (u32)din);
@@ -272,9 +273,12 @@ int spi_xchg_single(struct spi_slave *slave, unsigned int 
bitlen,
reg_write(®s->ctrl, mxcs->ctrl_reg |
MXC_CSPICTRL_EN | MXC_CSPICTRL_XCH);
 
+   timeout = 1;
/* Wait until the TC (Transfer completed) bit is set */
-   while ((reg_read(®s->stat) & MXC_CSPICTRL_TC) == 0)
-   ;
+   while (timeout && ((reg_read(®s->stat) & MXC_CSPICTRL_TC) == 0)) {
+   timeout--;
+   udelay(10);
+   }
 
/* Transfer completed, clear any pending request */
reg_write(®s->stat, MXC_CSPICTRL_TC | MXC_CSPICTRL_RXOVF);
-- 
1.8.3.1

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


[U-Boot] [PATCH v1 0/4] arm, imx6: add aristainetos board support

2014-05-28 Thread Heiko Schocher
add support for the imx6 based aristainetos board.

Heiko Schocher (4):
  arm, imx6: add mxc_iomux_set_gpr_register function
  spi, spi_mxc: do not hang in spi_xchg_single
  i.MX6: add enable_spi_clk()
  arm, imx6: add aristainetos board

 arch/arm/cpu/armv7/mx6/clock.c |  17 +
 arch/arm/imx-common/iomux-v3.c |  15 +
 arch/arm/include/asm/arch-mx6/clock.h  |   1 +
 arch/arm/include/asm/imx-common/iomux-v3.h |   2 +
 board/aristainetos/Makefile|   9 +
 board/aristainetos/aristainetos.c  | 527 +
 board/aristainetos/aristainetos.cfg|  33 ++
 board/aristainetos/clocks.cfg  |  24 ++
 board/aristainetos/ddr-setup.cfg   |  61 
 board/aristainetos/mt41j128M.cfg   |  70 
 boards.cfg |   1 +
 drivers/spi/mxc_spi.c  |   8 +-
 include/configs/aristainetos.h | 310 +
 13 files changed, 1076 insertions(+), 2 deletions(-)
 create mode 100644 board/aristainetos/Makefile
 create mode 100644 board/aristainetos/aristainetos.c
 create mode 100644 board/aristainetos/aristainetos.cfg
 create mode 100644 board/aristainetos/clocks.cfg
 create mode 100644 board/aristainetos/ddr-setup.cfg
 create mode 100644 board/aristainetos/mt41j128M.cfg
 create mode 100644 include/configs/aristainetos.h

-- 
1.8.3.1

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


[U-Boot] [PATCH v1 1/4] arm, imx6: add mxc_iomux_set_gpr_register function

2014-05-28 Thread Heiko Schocher
add mxc_iomux_set_gpr_register fucntion

Signed-off-by: Heiko Schocher 
Cc: Stefano Babic 
---
 arch/arm/imx-common/iomux-v3.c | 15 +++
 arch/arm/include/asm/imx-common/iomux-v3.h |  2 ++
 2 files changed, 17 insertions(+)

diff --git a/arch/arm/imx-common/iomux-v3.c b/arch/arm/imx-common/iomux-v3.c
index 6e46ea8..8739b4c 100644
--- a/arch/arm/imx-common/iomux-v3.c
+++ b/arch/arm/imx-common/iomux-v3.c
@@ -63,3 +63,18 @@ void imx_iomux_v3_setup_multiple_pads(iomux_v3_cfg_t const 
*pad_list,
for (i = 0; i < count; i++)
imx_iomux_v3_setup_pad(*p++);
 }
+
+void mxc_iomux_set_gpr_register(int group, int start_bit, int num_bits,
+   int value)
+{
+   int i = 0;
+   u32 reg;
+   reg = __raw_readl(base + group * 4);
+   while (num_bits) {
+   reg &= ~(1<<(start_bit + i));
+   i++;
+   num_bits--;
+   }
+   reg |= (value << start_bit);
+   __raw_writel(reg, base + group * 4);
+}
diff --git a/arch/arm/include/asm/imx-common/iomux-v3.h 
b/arch/arm/include/asm/imx-common/iomux-v3.h
index cca920b..4c83617 100644
--- a/arch/arm/include/asm/imx-common/iomux-v3.h
+++ b/arch/arm/include/asm/imx-common/iomux-v3.h
@@ -174,5 +174,7 @@ typedef u64 iomux_v3_cfg_t;
 void imx_iomux_v3_setup_pad(iomux_v3_cfg_t pad);
 void imx_iomux_v3_setup_multiple_pads(iomux_v3_cfg_t const *pad_list,
 unsigned count);
+void mxc_iomux_set_gpr_register(int group, int start_bit, int num_bits,
+   int value);
 
 #endif /* __MACH_IOMUX_V3_H__*/
-- 
1.8.3.1

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


[U-Boot] [PATCH v1 3/4] i.MX6: add enable_spi_clk()

2014-05-28 Thread Heiko Schocher
add enable_spi_clk(), so board code can enable spi clocks.

Signed-off-by: Heiko Schocher 
Cc: Eric Nelson 
Cc: Stefano Babic 
---
 arch/arm/cpu/armv7/mx6/clock.c| 17 +
 arch/arm/include/asm/arch-mx6/clock.h |  1 +
 2 files changed, 18 insertions(+)

diff --git a/arch/arm/cpu/armv7/mx6/clock.c b/arch/arm/cpu/armv7/mx6/clock.c
index bd65a08..4735368 100644
--- a/arch/arm/cpu/armv7/mx6/clock.c
+++ b/arch/arm/cpu/armv7/mx6/clock.c
@@ -71,6 +71,23 @@ int enable_i2c_clk(unsigned char enable, unsigned i2c_num)
 }
 #endif
 
+int enable_spi_clk(unsigned char enable, unsigned spi_num)
+{
+   u32 reg;
+   u32 mask;
+
+   if (spi_num > 3)
+   return -EINVAL;
+
+   mask = MXC_CCM_CCGR_CG_MASK << (spi_num << 1);
+   reg = __raw_readl(&imx_ccm->CCGR1);
+   if (enable)
+   reg |= mask;
+   else
+   reg &= ~mask;
+   __raw_writel(reg, &imx_ccm->CCGR1);
+   return 0;
+}
 static u32 decode_pll(enum pll_clocks pll, u32 infreq)
 {
u32 div;
diff --git a/arch/arm/include/asm/arch-mx6/clock.h 
b/arch/arm/include/asm/arch-mx6/clock.h
index 1b4ded7..339c789 100644
--- a/arch/arm/include/asm/arch-mx6/clock.h
+++ b/arch/arm/include/asm/arch-mx6/clock.h
@@ -57,6 +57,7 @@ void enable_usboh3_clk(unsigned char enable);
 int enable_sata_clock(void);
 int enable_pcie_clock(void);
 int enable_i2c_clk(unsigned char enable, unsigned i2c_num);
+int enable_spi_clk(unsigned char enable, unsigned spi_num);
 void enable_ipu_clock(void);
 int enable_fec_anatop_clock(enum enet_freq freq);
 #endif /* __ASM_ARCH_CLOCK_H */
-- 
1.8.3.1

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


Re: [U-Boot] [PATCH v2] Separate EBV Socrates board from Altera Cyclone 5 board and from Virtual Target

2014-05-28 Thread Pavel Machek
Hi!

> > /home/pavel/wagabuibui/u-boot/board/ebv/socfpga/Makefile: No such file
> > or directory
> > make[2]: *** No rule to make target
> > `/home/pavel/wagabuibui/u-boot/board/ebv/socfpga/Makefile'.  Stop.
> 
> I feared as much, so thats why I asked ;)
> 
> > ...and I don't think we want to do board/{altera,ebv} symlink. Are
> > there any other options? Or is "altera" in the boards file simply
> > acceptable?
> 
> This is a problem that will turn up in the future even more, so I
> propose to solve it correctly now.  It will not be long before we
 > want

Well, OTOH it is orthogonal problem to the "board name is shared
between socrates and altera" and "config is shared between altera and
virtual target". And this patch is going to go stale rather quickly.

> to have our own configuration for our MCV module and this will certainly
> be sold by DENX.  I think we need an infrastructure to allow for boards
> sold by arbitrary manufacturers all using the Altera chip.
> 
> The situation as such is not uncommon, so maybe you can follow examples
> from different CPUs?  I.e. how is the imx6 handled on the different base
> boards?

The examples I seen were different: there different board vendors
actually needed different code.

AFAICT, one solution would be to put "-" in that column, and do "git
mv board/altera/ board/socfpga/".

But if we decide to go that way, it should really be separate patch.

Best regards,
Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) 
http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] mtd: nand: Fix address cycle problem with NAND_CMD_RNDOUT

2014-05-28 Thread Gupta, Pekon
Hi Stefan, Marek,

>>From: Stefan Roese [mailto:s...@denx.de]
>>
>>From: Marek Belisko 
>>
>>On some NAND devices (e.g. Hynix H27U2G8F2CTR-BI on Siemens DXR2 /
>>Draco boards) the NAND subsystem (SPL & U-Boot drivers) issues the following
>>bit-flip error messages:
>>
>>nand: bit-flip corrected @oob=0
>>...
>>
>>NAND_CMD_RNDOUT (05h-E0h) needs only two cycles of column address to access 
>>data
>>from different column within the same page. So expected sequence on NAND 
>>data-bus is
>> <05h>   
>>

[...]

>>
>>diff --git a/drivers/mtd/nand/am335x_spl_bch.c 
>>b/drivers/mtd/nand/am335x_spl_bch.c
>>index c84851b..9b547ce 100644
>>--- a/drivers/mtd/nand/am335x_spl_bch.c
>>+++ b/drivers/mtd/nand/am335x_spl_bch.c
>>@@ -63,15 +63,19 @@ static int nand_command(int block, int page, uint32_t 
>>offs,
>>  hwctrl(&mtd, offs & 0xff,
>> NAND_CTRL_ALE | NAND_CTRL_CHANGE); /* A[7:0] */
>>  hwctrl(&mtd, (offs >> 8) & 0xff, NAND_CTRL_ALE); /* A[11:9] */
>>+
>>  /* Row address */
>>- hwctrl(&mtd, (page_addr & 0xff), NAND_CTRL_ALE); /* A[19:12] */
>>- hwctrl(&mtd, ((page_addr >> 8) & 0xff),

I see the conflict here with following commit. Is this patch on latest u-boot 
tree?

commit 6dd3b566893a99629771e076dca1ce8db7b77dc1
mtd: Add a CONFIG_SPL_MTD_SUPPORT for a more full NAND subsystem in SPL

May be you need to resend rebased on latest tree..


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


[U-Boot] [PATCH v5 1/4] bootm: make use of legacy image format configurable

2014-05-28 Thread Heiko Schocher
make the use of legacy image format configurable through
the config define CONFIG_IMAGE_FORMAT_LEGACY.

When relying on signed FIT images with required signature check
the legacy image format should be disabled. Therefore introduce
this new define and enable legacy image format if CONFIG_FIT_SIGNATURE
is not set. If CONFIG_FIT_SIGNATURE is set disable per default
the legacy image format.

Signed-off-by: Heiko Schocher 
Cc: Simon Glass 
Cc: Lars Steubesand 
Cc: Mike Pearce 
Cc: Wolfgang Denk 
Cc: Tom Rini 
Cc: Michal Simek 

---
- changes for v2:
  - make the legacy image format configurable through
the define CONFIG_IMAGE_FORMAT_LEGACY.

Default:
if not CONFIG_FIT_SIGNATURE is defined it is enabled,
else disabled.

Disable it with CONFIG_DISABLE_IMAGE_LEGACY if
CONFIG_FIT_SIGNATURE is not defined.
- changes for v3:
  - enable legacy image format for zync as default, as Michak
suggested.

- changes for v4:
  move changes for default settings in include/config_defaults.h
  to include/config_fallbacks.h, so board settings are considered
  as Lars Steubesand suggested.

- changes for v5:
  - rebased against current master
  - fix build error in common_cmd_ximg.c for sandbox as Simon Glass detected
---
 README| 18 ++
 common/cmd_bootm.c| 14 ++
 common/cmd_disk.c |  4 
 common/cmd_fdc.c  |  4 
 common/cmd_fpga.c |  2 ++
 common/cmd_nand.c |  4 
 common/cmd_source.c   |  4 
 common/cmd_ximg.c |  9 +++--
 common/image-fdt.c| 10 --
 common/image.c| 25 ++---
 doc/uImage.FIT/signature.txt  |  3 +++
 include/config_fallbacks.h|  8 
 include/configs/zynq-common.h |  1 +
 include/image.h   |  2 ++
 14 files changed, 97 insertions(+), 11 deletions(-)

diff --git a/README b/README
index a280435..10fd961 100644
--- a/README
+++ b/README
@@ -3202,6 +3202,19 @@ FIT uImage format:
  -150  common/cmd_nand.c   Incorrect FIT image format
   151  common/cmd_nand.c   FIT image format OK
 
+- legacy image format:
+   CONFIG_IMAGE_FORMAT_LEGACY
+   enables the legacy image format support in U-Boot.
+
+   Default:
+   enabled if CONFIG_FIT_SIGNATURE is not defined.
+
+   CONFIG_DISABLE_IMAGE_LEGACY
+   disable the legacy image format
+
+   This define is introduced, as the legacy image format is
+   enabled per default for backward compatibility.
+
 - FIT image support:
CONFIG_FIT
Enable support for the FIT uImage format.
@@ -3218,6 +3231,11 @@ FIT uImage format:
using a hash signed and verified using RSA. See
doc/uImage.FIT/signature.txt for more details.
 
+   WARNING: When relying on signed FIT images with required
+   signature check the legacy image format is default
+   disabled. If a board need legacy image format support
+   enable this through CONFIG_IMAGE_FORMAT_LEGACY
+
 - Standalone program support:
CONFIG_STANDALONE_LOAD_ADDR
 
diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c
index 34b4b58..9c608c3 100644
--- a/common/cmd_bootm.c
+++ b/common/cmd_bootm.c
@@ -234,6 +234,7 @@ static int bootm_find_os(cmd_tbl_t *cmdtp, int flag, int 
argc,
 
/* get image parameters */
switch (genimg_get_format(os_hdr)) {
+#if defined(CONFIG_IMAGE_FORMAT_LEGACY)
case IMAGE_FORMAT_LEGACY:
images.os.type = image_get_type(os_hdr);
images.os.comp = image_get_comp(os_hdr);
@@ -242,6 +243,7 @@ static int bootm_find_os(cmd_tbl_t *cmdtp, int flag, int 
argc,
images.os.end = image_get_image_end(os_hdr);
images.os.load = image_get_load(os_hdr);
break;
+#endif
 #if defined(CONFIG_FIT)
case IMAGE_FORMAT_FIT:
if (fit_image_get_type(images.fit_hdr_os,
@@ -851,6 +853,7 @@ int bootm_maybe_autostart(cmd_tbl_t *cmdtp, const char *cmd)
return 0;
 }
 
+#if defined(CONFIG_IMAGE_FORMAT_LEGACY)
 /**
  * image_get_kernel - verify legacy format kernel image
  * @img_addr: in RAM address of the legacy format image to be verified
@@ -901,6 +904,7 @@ static image_header_t *image_get_kernel(ulong img_addr, int 
verify)
}
return hdr;
 }
+#endif
 
 /**
  * boot_get_kernel - find kernel image
@@ -918,7 +922,9 @@ static const void *boot_get_kernel(cmd_tbl_t *cmdtp, int 
flag, int argc,
char * const argv[], bootm_headers_t *images, ulong *os_data,
ulong *os_len)
 {
+#if defined(CONFIG_IMAGE_FORMAT_LEGACY)
image_header_t  *hdr;
+#endif
ulong   img_addr;
const void *buf;
 #if defined(CONFIG_FIT)
@@ -956,6 +962,7 @@ static const void *boot_get_kernel(cmd_tbl_t *cmdtp, int 
flag, 

[U-Boot] [PATCH v5 2/4] mpc8313, signed fit: enable legacy image format on ids8313 board

2014-05-28 Thread Heiko Schocher
Enable legacy image format with CONFIG_IMAGE_FORMAT_LEGACY
on the ids8313 board, as it uses signed FIT images for booting
Linux and need the legacy image format.

Signed-off-by: Heiko Schocher 
Cc: Simon Glass 
Cc: Kim Phillips 
Cc: Michael Conrad 

---
- changes for v2:
  - enable (not disable) the legacy image format for this board
- changes for v3:
  none
- changes for v4:
  none
- changes for v5:
  none
---
 include/configs/ids8313.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/configs/ids8313.h b/include/configs/ids8313.h
index c1b3b63..1de5750 100644
--- a/include/configs/ids8313.h
+++ b/include/configs/ids8313.h
@@ -576,6 +576,7 @@
 
 #define CONFIG_FIT
 #define CONFIG_FIT_SIGNATURE
+#define CONFIG_IMAGE_FORMAT_LEGACY
 #define CONFIG_CMD_FDT
 #define CONFIG_CMD_HASH
 #define CONFIG_RSA
-- 
1.8.3.1

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


[U-Boot] [PATCH v5 3/4] lib, fdt: move fdtdec_get_int() out of lib/fdtdec.c

2014-05-28 Thread Heiko Schocher
move fdtdec_get_int() out of lib/fdtdec.c into lib/fdtdec_common.c
as this function is also used, if CONFIG_OF_CONTROL is not
used. Poped up on the ids8313 board using signed FIT images,
and activating CONFIG_SYS_GENERIC_BOARD. Without this patch
it shows on boot:

No valid FDT found - please append one to U-Boot binary, use u-boot-dtb.bin or 
define CONFIG_OF_EMBED. For sandbox, use -d 

With this patch, it boots again with CONFIG_SYS_GENERIC_BOARD
enabled.

Signed-off-by: Heiko Schocher 
Acked-by: Simon Glass 
Cc: Tom Rini 

---
- changes for v2:
  - remove fdtdec_get_int() in lib/fdtdec.c
  - only one fdtdec_get_int() implementation
 Tested on the ids8313 board (on host and target side)
- changes for v3:
  use fdt_getprop() instead fdt_getprop_w() so we avoid a cast
  as Simon suggested.
- changes for v4:
  none
- changes for v5:
  - keep debug for non host side as Simon Glass suggested.
  - add Acked-by from Simon Glass
---
 lib/Makefile|  1 +
 lib/fdtdec.c| 36 
 lib/fdtdec_common.c | 38 ++
 tools/fdtdec.c  |  1 +
 4 files changed, 40 insertions(+), 36 deletions(-)
 create mode 100644 lib/fdtdec_common.c

diff --git a/lib/Makefile b/lib/Makefile
index 377ab13..fbe7d93 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -23,6 +23,7 @@ obj-$(CONFIG_USB_TTY) += circbuf.o
 obj-y += crc7.o
 obj-y += crc8.o
 obj-y += crc16.o
+obj-y += fdtdec_common.o
 obj-$(CONFIG_OF_CONTROL) += fdtdec.o
 obj-$(CONFIG_TEST_FDTDEC) += fdtdec_test.o
 obj-$(CONFIG_GZIP) += gunzip.o
diff --git a/lib/fdtdec.c b/lib/fdtdec.c
index 8ecb80f..21d5e85 100644
--- a/lib/fdtdec.c
+++ b/lib/fdtdec.c
@@ -109,24 +109,6 @@ fdt_addr_t fdtdec_get_addr(const void *blob, int node,
return fdtdec_get_addr_size(blob, node, prop_name, NULL);
 }
 
-s32 fdtdec_get_int(const void *blob, int node, const char *prop_name,
-   s32 default_val)
-{
-   const s32 *cell;
-   int len;
-
-   debug("%s: %s: ", __func__, prop_name);
-   cell = fdt_getprop(blob, node, prop_name, &len);
-   if (cell && len >= sizeof(s32)) {
-   s32 val = fdt32_to_cpu(cell[0]);
-
-   debug("%#x (%d)\n", val, val);
-   return val;
-   }
-   debug("(not found)\n");
-   return default_val;
-}
-
 uint64_t fdtdec_get_uint64(const void *blob, int node, const char *prop_name,
uint64_t default_val)
 {
@@ -646,22 +628,4 @@ int fdtdec_read_fmap_entry(const void *blob, int node, 
const char *name,
 
return 0;
 }
-#else
-#include "libfdt.h"
-#include "fdt_support.h"
-
-int fdtdec_get_int(const void *blob, int node, const char *prop_name,
-   int default_val)
-{
-   const int *cell;
-   int len;
-
-   cell = fdt_getprop_w((void *)blob, node, prop_name, &len);
-   if (cell && len >= sizeof(int)) {
-   int val = fdt32_to_cpu(cell[0]);
-
-   return val;
-   }
-   return default_val;
-}
 #endif
diff --git a/lib/fdtdec_common.c b/lib/fdtdec_common.c
new file mode 100644
index 000..757931a
--- /dev/null
+++ b/lib/fdtdec_common.c
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2014
+ * Heiko Schocher, DENX Software Engineering, h...@denx.de.
+ *
+ * Based on lib/fdtdec.c:
+ * Copyright (c) 2011 The Chromium OS Authors.
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#ifndef USE_HOSTCC
+#include 
+#include 
+#include 
+#else
+#include "libfdt.h"
+#include "fdt_support.h"
+
+#define debug(...)
+#endif
+
+int fdtdec_get_int(const void *blob, int node, const char *prop_name,
+   int default_val)
+{
+   const int *cell;
+   int len;
+
+   debug("%s: %s: ", __func__, prop_name);
+   cell = fdt_getprop(blob, node, prop_name, &len);
+   if (cell && len >= sizeof(int)) {
+   int val = fdt32_to_cpu(cell[0]);
+
+   debug("%#x (%d)\n", val, val);
+   return val;
+   }
+   debug("(not found)\n");
+   return default_val;
+}
diff --git a/tools/fdtdec.c b/tools/fdtdec.c
index f1c2256..9987f83 100644
--- a/tools/fdtdec.c
+++ b/tools/fdtdec.c
@@ -1 +1,2 @@
+#include "../lib/fdtdec_common.c"
 #include "../lib/fdtdec.c"
-- 
1.8.3.1

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


[U-Boot] [PATCH v5 4/4] mpc8313: add CONFIG_SYS_GENERIC_BOARD to ids8313 board

2014-05-28 Thread Heiko Schocher
- add CONFIG_SYS_GENERIC_BOARD
- remove CONFIG_OF_CONTROL to boot again

Signed-off-by: Heiko Schocher 
Acked-by: Kim Phillips 
Cc: Simon Glass 

---
- changes for v2:
  - added acked-by from Kim
- changes for v3:
  none
- changes for v4:
  none
- changes for v5:
  none
---
 include/configs/ids8313.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/configs/ids8313.h b/include/configs/ids8313.h
index 1de5750..3e55247 100644
--- a/include/configs/ids8313.h
+++ b/include/configs/ids8313.h
@@ -19,6 +19,8 @@
 #define CONFIG_MPC8313
 #define CONFIG_IDS8313
 
+#define CONFIG_SYS_GENERIC_BOARD
+
 #define CONFIG_FSL_ELBC
 
 #define CONFIG_MISC_INIT_R
@@ -582,6 +584,5 @@
 #define CONFIG_RSA
 #define CONFIG_SHA1
 #define CONFIG_SHA256
-#define CONFIG_OF_CONTROL
 
 #endif /* __CONFIG_H */
-- 
1.8.3.1

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


[U-Boot] [PATCH v5 0/4] mpc8313: ids8313 board updates

2014-05-28 Thread Heiko Schocher
- introduce CONFIG_IMAGE_FORMAT_LEGACY for enabling
  booting legacy image format. Disable this per default if
  CONFIG_FIT_SIGNATURE is defined.
  As the ids8313 board needs legacy image format and uses
  CONFIG_FIT_SIGNATURE, enable legacy image format for the
  ids8313 board

- add CONFIG_SYS_GENERIC_BOARD to the ids8313 board,
  therefore fdtdec_get_int() is moved out of lib/fdtdec.c
  as lib/fdtdec.c is only compiled if CONFIG_OF_CONTROL
  is defined, but defining this for the ids8313 board
  leads in conjunction with CONFIG_SYS_GENERIC_BOARD
  in booting error:

No valid FDT found - please append one to U-Boot binary, use u-boot-dtb.bin or 
define CONFIG_OF_EMBED. For sandbox, use -d 

  So move the common used function fdtdec_get_int()
  out of lib/fdtdec.c into lib/fdtdec_common.c

Cc: Simon Glass 
Cc: Kim Phillips 
Cc: Wolfgang Denk 
Cc: Tom Rini 
Cc: Michael Conrad 

Tested this patchset on the ids8313 board, MAKEALL for powerpc
and arm adds no compiler errors/warnings.

While testing this patchset on the ids8313 board, I found, that
current U-Boot compiles fine with eldk 5.5, but if erasing the
sectors where U-Boot resists in the NOR flash, u-boot commands
are not longer working :-(

$ powerpc-linux-gcc -v
Using built-in specs.
COLLECT_GCC=powerpc-linux-gcc
COLLECT_LTO_WRAPPER=/opt/eldk-5.5/powerpc/sysroots/i686-eldk-linux/usr/libexec/powerpc-linux/gcc/powerpc-linux/4.8.1/lto-wrapper
Target: powerpc-linux
[...]
Thread model: posix
gcc version 4.8.1 (GCC) 
$

This problem does not pop up with eldk 5.4 or 5.3 !

Digged a little bit in it, and found that some (not all!) fmt
strings are loaded from flash addresses not from ram addresses ...

gdb shows:
Program received signal SIGTRAP, Trace/breakpoint trap.
printf (fmt=0xfff5ad34 '\377' ..., fmt@entry=0x7fdad34 
"parse_stream, end_trigger=%d\n") at /home/hs/ids/u-boot/common/console.c:479
^^
addr in nor flash not in ram
479 {
(gdb) bt
#0  printf (fmt=0xfff5ad34 '\377' ..., fmt@entry=0x7fdad34 
"parse_stream, end_trigger=%d\n") at /home/hs/ids/u-boot/common/console.c:479
#1  0x07f88c4c in parse_stream (end_trigger=10, input=0x775fe00, ctx=0x775fd60, 
dest=0x775fd7c) at /home/hs/ids/u-boot/common/hush.c:2942
 
this leads, if flash is erased, in a crash ... try to find out
more ...

This problem seems a toolchain problem, as I tried older
U-Boot versions with eldk 5.5 on this board, and all versions
break ... I have no other mpc83xx board handy ... can somebody
try this scenario on a mpc83xx based board? Kim?

Current U-Boot does work fine on a mpc52xx based board compiled
with eldk 5.5, so it seems a mpc83xx specific problem?

Heiko Schocher (4):
  bootm: make use of legacy image format configurable
  mpc8313, signed fit: enable legacy image format on ids8313 board
  lib, fdt: move fdtdec_get_int() out of lib/fdtdec.c
  mpc8313: add CONFIG_SYS_GENERIC_BOARD to ids8313 board

 README| 18 ++
 common/cmd_bootm.c| 14 ++
 common/cmd_disk.c |  4 
 common/cmd_fdc.c  |  4 
 common/cmd_fpga.c |  2 ++
 common/cmd_nand.c |  4 
 common/cmd_source.c   |  4 
 common/cmd_ximg.c |  9 +++--
 common/image-fdt.c| 10 --
 common/image.c| 25 ++---
 doc/uImage.FIT/signature.txt  |  3 +++
 include/config_fallbacks.h|  8 
 include/configs/ids8313.h |  4 +++-
 include/configs/zynq-common.h |  1 +
 include/image.h   |  2 ++
 lib/Makefile  |  1 +
 lib/fdtdec.c  | 36 
 lib/fdtdec_common.c   | 38 ++
 tools/fdtdec.c|  1 +
 19 files changed, 140 insertions(+), 48 deletions(-)
 create mode 100644 lib/fdtdec_common.c

-- 
1.8.3.1

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


Re: [U-Boot] Howto u-boot an evk1100 ?

2014-05-28 Thread Andreas Bießmann
Dear Sril,

On 05/28/2014 02:20 AM, Sril wrote:
>> AFAIK is there no support for avr32 uc3 devices currently. There where
>> some patches but mainline only the ap700x devices are supported.
> Currently Yes, there is not.
> 
> ap700x and uc3 are not so nearby procs. There is no cache and no mmu in many 
> uc3. In more general way to think, each at32 is far from another, IMHO.
> 
> Let's start with :
> http://lists.denx.de/pipermail/u-boot/2009-January/thread.html#45925
> 
> So, none worked in evk1100 since that time.

that's true.

> I've been surprised and I tried to find some people here and avrfreaks.

I'm afraid there is no other user than me working with avr32 in u-boot
... and I just have some ap700x devices.

> I'm not in the habit to re-invent the wheel.
> In this case, my purpose is to integrate patches from a worked version of 
> u-boot evk1100.

I'm willing to apply uc3 patches if you send them to the list. So pick
them up and get it working ;)

>> Which docs do you mean? UC3 spec is @atmel.com ;)
> A README.evk1100 in doc directory for instance.

Sorry no such file available. It would be your task to add such a file,
if you provide avr32-uc3 suppport. But I'd rather like to see some
README.avr32-uc3 or something like this than a pure board centric file.

Best regards

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


Re: [U-Boot] [PATCH v2] Separate EBV Socrates board from Altera Cyclone 5 board and from Virtual Target

2014-05-28 Thread Detlev Zundel
Hi Pavel,

> Hi, Detlev!
>
>> > Altera Cyclone 5 board is very different board (big, rectangular,
>> > expensive) than EBV Socrates (small, circular, cheap) board. Different
>> > parts are used there, too, but same configuration of u-boot works on
>> > both. Nevertheless, printing wrong name confuses users. Virtual target
>> > is completely different, and board configured for it will not boot on
>> > physical targets.
>> 
>> Thanks for the initiative again.
>
> I'm celebrating mainline u-boot on my target :-).

Yay!

>> > --- a/boards.cfg
>> > +++ b/boards.cfg
>> > @@ -379,6 +379,8 @@ Active arm armv7 rmobile renesas lager
>> >  Active arm armv7 s5pc1xx samsung goni s5p_goni - Przemyslaw
>> > Marczak 
>> >  Active arm armv7 s5pc1xx samsung smdkc100 smdkc100 - Minkyu Kang
>> > 
>> >  Active arm armv7 socfpga altera socfpga socfpga_cyclone5 - -
>> > +Active arm armv7 socfpga altera socfpga socfpga_virtual - -
>> > +Active arm armv7 socfpga altera socfpga socfpga_socrates
>> 
>> As you correctly note, the socrates is sold by EBV and not Altera so I
>> guess the 5th column needs to be changed.  Will this still work?
>
> That will result in:
>
>   CC  arch/arm/lib/eabi_compat.o
> scripts/Makefile.build:64:
> /home/pavel/wagabuibui/u-boot/board/ebv/socfpga/Makefile: No such file
> or directory
> make[2]: *** No rule to make target
> `/home/pavel/wagabuibui/u-boot/board/ebv/socfpga/Makefile'.  Stop.

I feared as much, so thats why I asked ;)

> ...and I don't think we want to do board/{altera,ebv} symlink. Are
> there any other options? Or is "altera" in the boards file simply
> acceptable?

This is a problem that will turn up in the future even more, so I
propose to solve it correctly now.  It will not be long before we want
to have our own configuration for our MCV module and this will certainly
be sold by DENX.  I think we need an infrastructure to allow for boards
sold by arbitrary manufacturers all using the Altera chip.

The situation as such is not uncommon, so maybe you can follow examples
from different CPUs?  I.e. how is the imx6 handled on the different base
boards?

Cheers
  Detlev
  
-- 
LISP has survived for 21 years because it is an approximate local
optimum in the space of programming languages.
   -- John McCarthy (1980)
--
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] powerpc/serdes: Add the workaround for erratum A-007186

2014-05-28 Thread Shaveta Leekha
SerDes PLL is calibrated at reset. When the junction temperature
delta from the time the PLL is calibrated exceeds +56C/-66C,
jitter may increase and can cause PLL to unlock.

This workaround overwrite the SerDes registers with new values,
to calibrate SerDes registers.
These values are known to work fine for all temperature ranges.

This workaround is valid for B4, T4 and T2 platforms, so
added in their config.

Signed-off-by: Shaveta Leekha 
Signed-off-by: Poonam Aggrwal 
---
 arch/powerpc/cpu/mpc85xx/cmd_errata.c  |3 +
 arch/powerpc/cpu/mpc85xx/fsl_corenet2_serdes.c |  147 
 arch/powerpc/include/asm/config_mpc85xx.h  |6 +
 arch/powerpc/include/asm/immap_85xx.h  |   33 +-
 4 files changed, 187 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/cpu/mpc85xx/cmd_errata.c 
b/arch/powerpc/cpu/mpc85xx/cmd_errata.c
index 3d37a76..0859151 100644
--- a/arch/powerpc/cpu/mpc85xx/cmd_errata.c
+++ b/arch/powerpc/cpu/mpc85xx/cmd_errata.c
@@ -266,6 +266,9 @@ static int do_errata(cmd_tbl_t *cmdtp, int flag, int argc, 
char * const argv[])
 #ifdef CONFIG_SYS_FSL_ERRATUM_USB14
puts("Work-around for Erratum USB14 enabled\n");
 #endif
+#ifdef CONFIG_SYS_FSL_ERRATUM_A007186
+   puts("Work-around for Erratum A007186 enabled\n");
+#endif
 #ifdef CONFIG_SYS_FSL_ERRATUM_A006593
puts("Work-around for Erratum A006593 enabled\n");
 #endif
diff --git a/arch/powerpc/cpu/mpc85xx/fsl_corenet2_serdes.c 
b/arch/powerpc/cpu/mpc85xx/fsl_corenet2_serdes.c
index 70e09ea..add2cac 100644
--- a/arch/powerpc/cpu/mpc85xx/fsl_corenet2_serdes.c
+++ b/arch/powerpc/cpu/mpc85xx/fsl_corenet2_serdes.c
@@ -147,12 +147,42 @@ int serdes_get_first_lane(u32 sd, enum srds_prtcl device)
return -ENODEV;
 }
 
+#define BC3_SHIFT  9
+#define DC3_SHIFT  6
+#define FC3_SHIFT  0
+#define BC2_SHIFT  19
+#define DC2_SHIFT  16
+#define FC2_SHIFT  10
+#define BC1_SHIFT  29
+#define DC1_SHIFT  26
+#define FC1_SHIFT  20
+#define BC_MASK0x1
+#define DC_MASK0x7
+#define FC_MASK0x3F
+
+#define FUSE_VAL_MASK  0x0003
+#define FUSE_VAL_SHIFT 30
+#define CR0_DCBIAS_SHIFT   5
+#define CR1_FCAP_SHIFT 15
+#define CR1_BCAP_SHIFT 29
+#define FCAP_MASK  0x001F8000
+#define BCAP_MASK  0x2000
+#define BCAP_OVD_MASK  0x1000
+#define BYP_CAL_MASK   0x0200
+
 u64 serdes_init(u32 sd, u32 sd_addr, u32 sd_prctl_mask, u32 sd_prctl_shift)
 {
ccsr_gur_t *gur = (void __iomem *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
u64 serdes_prtcl_map = 0;
u32 cfg;
int lane;
+#ifdef CONFIG_SYS_FSL_ERRATUM_A007186
+   ccsr_sfp_regs_t  __iomem *sfp_regs = (void *)(CONFIG_SYS_SFP_ADDR);
+   u32 pll_num, pll_status, bc, dc, fc, pll_cr_upd, pll_cr0, pll_cr1;
+   u32 bc_status, fc_status, dc_status, pll_sr2;
+   serdes_corenet_t  __iomem *srds_regs = (void *)sd_addr;
+   u32 sfp_spfr0, sel;
+#endif
 
cfg = in_be32(&gur->rcwsr[4]) & sd_prctl_mask;
/* Is serdes enabled at all? */
@@ -161,6 +191,123 @@ u64 serdes_init(u32 sd, u32 sd_addr, u32 sd_prctl_mask, 
u32 sd_prctl_shift)
return 0;
}
 
+/* Erratum A-007186
+ * Freescale Scratch Pad Fuse Register n (SFP_FSPFR0)
+ * The workaround requires factory pre-set SerDes calibration values to be
+ * read from a fuse block(Freescale Scratch Pad Fuse Register SFP_FSPFR0)
+ * These values have been shown to work across the
+ * entire temperature range for all SerDes. These values are then written into
+ * the SerDes registers to calibrate the SerDes PLL.
+ *
+ * This workaround for the protocols and rates that only have the Ring VCO.
+ */
+#ifdef CONFIG_SYS_FSL_ERRATUM_A007186
+   sfp_spfr0 = in_be32(&sfp_regs->fsl_spfr0);
+   debug("A007186: sfp_spfr0= %x\n", sfp_spfr0);
+
+   sel = (sfp_spfr0 >> FUSE_VAL_SHIFT) & FUSE_VAL_MASK;
+
+   if (sel == 0x01 || sel == 0x02) {
+   for (pll_num = 0; pll_num < SRDS_MAX_BANK; pll_num++) {
+   pll_status = in_be32(&srds_regs->bank[pll_num].pllcr0);
+   debug("A007186: pll_num=%x pllcr0=%x\n",
+ pll_num, pll_status);
+   /* STEP 1 */
+   /* Read factory pre-set SerDes calibration values
+* from fuse block(SFP scratch register-sfp_spfr0)
+*/
+   switch (pll_status & SRDS_PLLCR0_FRATE_SEL_MASK) {
+   case SRDS_PLLCR0_FRATE_SEL_3_0:
+   case SRDS_PLLCR0_FRATE_SEL_3_072:
+   debug("A007186: 3.0/3.072 protocol rate\n");
+   bc = (sfp_spfr0 >> BC1_SHIFT) & BC_MASK;
+   dc = (sfp_spfr0 >> DC1_SHIFT) & DC_MASK;
+   fc = (sfp_spfr0 >> FC1_SHIFT) & FC_MASK;
+

Re: [U-Boot] [PATCH v4] arm: Add support for semihosting for armv8 fastmodel targets.

2014-05-28 Thread sakar.ar...@freescale.com
Hi Darwin

Thanks for the patch.

> -Original Message-
> From: Darwin Rambo [mailto:dra...@broadcom.com]
> Sent: Saturday, May 24, 2014 5:08 AM
> To: u-boot@lists.denx.de
> Cc: Darwin Rambo; tr...@ti.com; feng...@phytium.com.cn; Sharma 
> Bhupesh- B45370; Albert Aribaud
> Subject: [PATCH v4] arm: Add support for semihosting for armv8 
> fastmodel targets.
> 
> The reason for this change is to be able to use the ARM Trusted 
> Firmware
> (ATF) to load the various ATF images, plus u-boot, which can then load 
> the kernel/ramdisk/dtb with calls to an external host from a standard 
> fastmodel armv8 board file using semihosting, and then launch the 
> kernel without a bootwrapper. This gives us a more realistic boot sequence.
> 
> There are two main ARM virtual Fixed Virtual Platform (FVP) models, 
> Versatile Express (VE) FVP and BASE FVP (See
> http://www.arm.com/products/tools/models/fast-models/foundation-
> model.php)
> The initial vexpress64 u-boot board created here runs on the VE 
> virtual platform using the license-free Foundation_v8 simulator. 
> Fortunately, the
> Foundation_v8 simulator also supports the BASE_FVP model which 
> companies can purchase licenses for and contain much more functionality.
> So we can, in u-boot, run either model by either using the VE FVP 
> (default), or turning on CONFIG_BASE_FVP for the more full featured 
> model.
> 
> Rather than create a new armv8 board similar to armltd/vexpress64, add 
> semihosting calls to the existing one, enabled with CONFIG_SEMIHOSTING 
> and CONFIG_BASE_FVP both set. Also reuse the existing board config 
> file vexpress_aemv8a.h but differentiate the two models by the 
> presence or absence of CONFIG_BASE_FVP. This change is tested and 
> works on both the Foundation and Base fastmodel simulators.
> 
> Support for armv7 in fastmodel is less useful due to the wide range of 
> available silicon and the lack of a free armv7 fastmodel, so this 
> change contains an untested armv7 placeholder for the service trap opcode.
> 
> The level of semihosting support is minimal, restricted to just what 
> it takes to load images to memory. If more semihosting functionality 
> is required, such as file seek, outputting strings, reading 
> characters, etc, then it can be easily added later.
> 
> Signed-off-by: Darwin Rambo 
> Cc: tr...@ti.com
> Cc: feng...@phytium.com.cn
> Cc: bhupesh.sha...@freescale.com
> 

Tested with latest ATF, u-boot(master) with this patch, and ARMv8 Foundation 
model 52rel06.

Tested-by: Sakar Arora 

Regards,
Sakar

> ---
> 
> Changes in v4:
> - refreshed patch and retested
> - fix boards.cfg conflict
> - fix GICV3 conflict
> - minor documentation cleanup - semihosting.c, README.semihosting
> - change maintainer of semihosting target
> - tested with vexpress_aemv8a_semi target (BASE_FVP) against
>   e75e73dd5f280b91f5bfc0a76a0fd09b6eba1c66 (May 16, 2014)
> 
> Changes in v3:
> - minor format fixup in board file
> 
> Changes in v2:
> - use kernel_addr_r, fdt_addr_r, initrd_addr_r convention.
> - Use env variables for kernel/fdt/initrd file names.
> - Add CONFIG_BASE_FVP to differentiate VE and BASE FVP models.
> - CONFIG_SEMIHOSTING only refers to bringing in semihosting code now.
> - Remove unnecessary CONFIG_SYS_BAUDRATE_TABLE,
> CONFIG_SYS_PROMPT_HUSH_PS2
> - Remove vexpress_aemv8a_semi.h and replace with CONFIG_BASE_FVP
> - Update boards.cfg with option SEMIHOSTING and BASE_FVP
> - Add doc/README.semihosting
> 
> Changes in v1:
> - Initial code
> - Remove empty timer_init() function.
> 
>  arch/arm/include/asm/semihosting.h   |   21 +++
>  arch/arm/lib/Makefile|1 +
>  arch/arm/lib/semihosting.c   |  233
> ++
>  board/armltd/vexpress64/vexpress64.c |  101 ++-
>  boards.cfg   |1 +
>  doc/README.semihosting   |   35 +
>  include/configs/vexpress_aemv8a.h|   63 -
>  7 files changed, 443 insertions(+), 12 deletions(-)  create mode 
> 100644 arch/arm/include/asm/semihosting.h
>  create mode 100644 arch/arm/lib/semihosting.c  create mode 100644 
> doc/README.semihosting
> 
> diff --git a/arch/arm/include/asm/semihosting.h
> b/arch/arm/include/asm/semihosting.h
> new file mode 100644
> index 000..74111dc
> --- /dev/null
> +++ b/arch/arm/include/asm/semihosting.h
> @@ -0,0 +1,21 @@
> +/*
> + * Copyright 2014 Broadcom Corporation
> + *
> + * SPDX-License-Identifier:  GPL-2.0+
> + */
> +
> +#ifndef __SEMIHOSTING_H__
> +#define __SEMIHOSTING_H__
> +
> +/*
> + * ARM semihosting functions for loading images to memory. See the 
> +source
> + * code for more information.
> + */
> +int smh_load(const char *fname, void *memp, int avail, int verbose); 
> +int smh_read(int fd, void *memp, int len); int smh_open(const char 
> +*fname, char *modestr); int smh_close(int fd); int smh_len_fd(int 
> +fd); int smh_len(const char *fname);
> +
> +#endif /* __SEMIHOSTING_H__ */
> diff --git a/arch/arm/lib/Makefile b/ar

Re: [U-Boot] [PATCH v4] arm: Add support for semihosting for armv8 fastmodel targets.

2014-05-28 Thread sakar.ar...@freescale.com
Correcting Darwin's email id. Sorry for the typo :).

-Original Message-
From: Arora Sakar-B45205 
Sent: Wednesday, May 28, 2014 1:16 PM
To: 'da...@broadcom.com'; 'u-boot@lists.denx.de'
Cc: Sharma Bhupesh-B45370; 'tr...@ti.com'; 'feng...@phytium.com.cn'; 
'albert.u.b...@aribaud.net'
Subject: RE: [PATCH v4] arm: Add support for semihosting for armv8 fastmodel 
targets.

Hi Darwin

Thanks for the patch.

> -Original Message-
> From: Darwin Rambo [mailto:dra...@broadcom.com]
> Sent: Saturday, May 24, 2014 5:08 AM
> To: u-boot@lists.denx.de
> Cc: Darwin Rambo; tr...@ti.com; feng...@phytium.com.cn; Sharma
> Bhupesh- B45370; Albert Aribaud
> Subject: [PATCH v4] arm: Add support for semihosting for armv8 
> fastmodel targets.
> 
> The reason for this change is to be able to use the ARM Trusted 
> Firmware
> (ATF) to load the various ATF images, plus u-boot, which can then load 
> the kernel/ramdisk/dtb with calls to an external host from a standard 
> fastmodel armv8 board file using semihosting, and then launch the 
> kernel without a bootwrapper. This gives us a more realistic boot sequence.
> 
> There are two main ARM virtual Fixed Virtual Platform (FVP) models, 
> Versatile Express (VE) FVP and BASE FVP (See
> http://www.arm.com/products/tools/models/fast-models/foundation-
> model.php)
> The initial vexpress64 u-boot board created here runs on the VE 
> virtual platform using the license-free Foundation_v8 simulator.
> Fortunately, the
> Foundation_v8 simulator also supports the BASE_FVP model which 
> companies can purchase licenses for and contain much more functionality.
> So we can, in u-boot, run either model by either using the VE FVP 
> (default), or turning on CONFIG_BASE_FVP for the more full featured 
> model.
> 
> Rather than create a new armv8 board similar to armltd/vexpress64, add 
> semihosting calls to the existing one, enabled with CONFIG_SEMIHOSTING 
> and CONFIG_BASE_FVP both set. Also reuse the existing board config 
> file vexpress_aemv8a.h but differentiate the two models by the 
> presence or absence of CONFIG_BASE_FVP. This change is tested and 
> works on both the Foundation and Base fastmodel simulators.
> 
> Support for armv7 in fastmodel is less useful due to the wide range of 
> available silicon and the lack of a free armv7 fastmodel, so this 
> change contains an untested armv7 placeholder for the service trap opcode.
> 
> The level of semihosting support is minimal, restricted to just what 
> it takes to load images to memory. If more semihosting functionality 
> is required, such as file seek, outputting strings, reading 
> characters, etc, then it can be easily added later.
> 
> Signed-off-by: Darwin Rambo 
> Cc: tr...@ti.com
> Cc: feng...@phytium.com.cn
> Cc: bhupesh.sha...@freescale.com
> 

Tested with latest ATF, u-boot(master) with this patch, and ARMv8 Foundation 
model 52rel06.

Tested-by: Sakar Arora 

Regards,
Sakar

> ---
> 
> Changes in v4:
> - refreshed patch and retested
> - fix boards.cfg conflict
> - fix GICV3 conflict
> - minor documentation cleanup - semihosting.c, README.semihosting
> - change maintainer of semihosting target
> - tested with vexpress_aemv8a_semi target (BASE_FVP) against
>   e75e73dd5f280b91f5bfc0a76a0fd09b6eba1c66 (May 16, 2014)
> 
> Changes in v3:
> - minor format fixup in board file
> 
> Changes in v2:
> - use kernel_addr_r, fdt_addr_r, initrd_addr_r convention.
> - Use env variables for kernel/fdt/initrd file names.
> - Add CONFIG_BASE_FVP to differentiate VE and BASE FVP models.
> - CONFIG_SEMIHOSTING only refers to bringing in semihosting code now.
> - Remove unnecessary CONFIG_SYS_BAUDRATE_TABLE,
> CONFIG_SYS_PROMPT_HUSH_PS2
> - Remove vexpress_aemv8a_semi.h and replace with CONFIG_BASE_FVP
> - Update boards.cfg with option SEMIHOSTING and BASE_FVP
> - Add doc/README.semihosting
> 
> Changes in v1:
> - Initial code
> - Remove empty timer_init() function.
> 
>  arch/arm/include/asm/semihosting.h   |   21 +++
>  arch/arm/lib/Makefile|1 +
>  arch/arm/lib/semihosting.c   |  233
> ++
>  board/armltd/vexpress64/vexpress64.c |  101 ++-
>  boards.cfg   |1 +
>  doc/README.semihosting   |   35 +
>  include/configs/vexpress_aemv8a.h|   63 -
>  7 files changed, 443 insertions(+), 12 deletions(-)  create mode
> 100644 arch/arm/include/asm/semihosting.h
>  create mode 100644 arch/arm/lib/semihosting.c  create mode 100644 
> doc/README.semihosting
> 
> diff --git a/arch/arm/include/asm/semihosting.h
> b/arch/arm/include/asm/semihosting.h
> new file mode 100644
> index 000..74111dc
> --- /dev/null
> +++ b/arch/arm/include/asm/semihosting.h
> @@ -0,0 +1,21 @@
> +/*
> + * Copyright 2014 Broadcom Corporation
> + *
> + * SPDX-License-Identifier:  GPL-2.0+
> + */
> +
> +#ifndef __SEMIHOSTING_H__
> +#define __SEMIHOSTING_H__
> +
> +/*
> + * ARM semihosting functions for loading images to memory. See the 
> +sou

Re: [U-Boot] U-boot hangs on imx6 pci driver

2014-05-28 Thread David Müller (ELSOFT AG)
Marek Vasut wrote:
> Observed Results: After some hundreds of the soft-reboot cycles, the
> i210 is not recognized. This is caused by the PCI express link
> failing to come up. We see "link never came up" message in the kernel
> log.

Just a guest but maybe this is "errata #18" of the i210.

A little bit off-topic but i'm facing the problem that Linux (kernel
3.14 + some patches) hangs regularly during PCIe initialisation on our
custom iMX6 / i210 board.

I use an additional delay in imx6_add_pcie_port() as a workaround so far.


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