Re: [U-Boot] [PATCH 3/3] ARM: kwimage: fix v0 format

2014-10-30 Thread Stefan Roese

On 31.10.2014 01:03, Gerald Kerma wrote:

This patch fix the kwimage tools for version 0 fileformat used for kirkwood
Tested on sheevaplug

Signed-off-by: Gerald Kerma 


I tested this on AXP (version 1 instead of version 0) and found no 
problems here. So:


Tested-by: Stefan Roese 
Reviewed-by: Stefan Roese 

Thanks,
Stefan

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


Re: [U-Boot] [BUG] kwimage v0 broken

2014-10-30 Thread Stefan Roese

Hi Gerald!

On 31.10.2014 01:06, drEagle wrote:

I have compared the latest kwimage and the oldest one.

I have found some minor differences that make my sheevaplugs flashing and 
u-booting again.


Thanks for your effort here. Really appreciated! And sorry for breaking 
things for you.


Thanks,
Stefan

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


[U-Boot] DECLARE_GLOBAL_DATA_PTR : move from source to Makefile

2014-10-30 Thread Kevin Du Huanpeng
Hi, all,
I find this macro is found anywhere in the source, nearly one thousand
in the source, looks odd sometime.
I have a idea about this:

1. remove DECLARE_GLOBAL_DATA_PTR from source
about one thousand DECLARE_GLOBAL_DATA_PTR in the source

2. add a file like, same as other archs.
arch/arm/include/asm/declare_global_data_ptr.h
- - - -
#ifndef __DECLARE_GLOBAL_DATA_PTR_H
#define __DECLARE_GLOBAL_DATA_PTR_H

#ifdef CONFIG_ARM64
#define DECLARE_GLOBAL_DATA_PTR register volatile gd_t *gd asm ("x18")
#else
#define DECLARE_GLOBAL_DATA_PTR register volatile gd_t *gd asm ("r9")
#endif

#endif
- - - -

3. modify top level Makefile
- - - -
UBOOTINCLUDE:= \
-Iinclude \
$(if $(KBUILD_SRC), -I$(srctree)/include) \
-I$(srctree)/arch/$(ARCH)/include \
-include $(srctree)/include/linux/kconfig.h \
+  -include $(srctree)/arch/$(ARCH)/include/asm/global_data.h
- - - -

...
Du Huanpeng
(+86)13719074147
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] verified boot of beaglebone black

2014-10-30 Thread Srinivasan S
Hi Simon


Once again thanks a lot for your confirmation


As you suggested, I have downloaded 
u-boot-2014.07.tar.bz2 & 
when I was trying to build the same , I was facing the below errors


srinivasan@tata-HP-Elite-7100-Microtower-PC:~/TUNSTALL/board-support/u-boot-2014.07$
 make O=b/am335x_boneblack_vboot CROSS_COMPILE=arm-linux-gnueabihf- ARCH=arm 
am335x_boneblack_vboot_config all




/home/srinivasan/TUNSTALL/board-support/u-boot-2014.07/scripts/dtc-version.sh: 
line 17: dtc: command not found
/home/srinivasan/TUNSTALL/board-support/u-boot-2014.07/scripts/dtc-version.sh: 
line 18: dtc: command not found
*** Your dtc is too old, please upgrade to dtc 1.4 or newer
make[2]: *** [checkdtc] Error 1
make[1]: *** [build-one-by-one] Error 2
make: *** [sub-make] Error 2



Please do the needful in resolving this issue



Thanks in advance,

srinivasan S



From: s...@google.com  on behalf of Simon Glass 

Sent: Friday, October 31, 2014 9:57 AM
To: Srinivasan S
Cc: U-Boot Mailing List
Subject: Re: verified boot of beaglebone black


Hi,

On 30 Oct 2014 21:50, "Srinivasan S" 
mailto:srinivasa...@tataelxsi.co.in>> wrote:
>
> Thanks a lot for your replies Simon,
>
> 1. Could you please confirm whether the beaglebone black support exists in 
> that  U-Boot 2014.07 & can I use  linux-3.12.10-ti2013.12.01 kernel (provided 
>  by ti-sdk-am335x-evm-07.00.00.00 )on top of this U-Boot 2014.07
>

That should work ok.

> 2. Could you please provide me the link for syncing U-Boot 2014.07 for 
> beaglebone black

See here:

ftp://ftp.denx.de/pub/u-boot/

Regards,
Simon

> Many Thanks in Advance,
> Srinivasan S
> 
> From: s...@google.com 
> mailto:s...@google.com>> on behalf of Simon Glass 
> mailto:s...@chromium.org>>
> Sent: Thursday, October 30, 2014 8:30 PM
> To: Srinivasan S
> Cc: U-Boot Mailing List
> Subject: Re: verified boot of beaglebone black
>
> Hi,
>
> On 30 October 2014 01:15, Srinivasan S 
> mailto:srinivasa...@tataelxsi.co.in>> wrote:
> > Hi Simon,
> >
> > Extremely Sorry to push you Hard, Could you please provide any updates 
> > w.r.t the below issue
>
> I think you missed my reply, am removing context...
>
> >
> Please use the latest mainline, or at least U-Boot 2014.07. That board
> does not exist in older versions.
>
>
> Regards,
> Simon
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] verified boot of beaglebone black

2014-10-30 Thread Srinivasan S
Thanks a lot for your replies Simon,

1. Could you please confirm whether the beaglebone black support exists in that 
 U-Boot 2014.07 & can I use  linux-3.12.10-ti2013.12.01 kernel (provided  by 
ti-sdk-am335x-evm-07.00.00.00 )on top of this U-Boot 2014.07 

2. Could you please provide me the link for syncing U-Boot 2014.07 for 
beaglebone black

Many Thanks in Advance,
Srinivasan S

From: s...@google.com  on behalf of Simon Glass 

Sent: Thursday, October 30, 2014 8:30 PM
To: Srinivasan S
Cc: U-Boot Mailing List
Subject: Re: verified boot of beaglebone black

Hi,

On 30 October 2014 01:15, Srinivasan S  wrote:
> Hi Simon,
>
> Extremely Sorry to push you Hard, Could you please provide any updates w.r.t 
> the below issue

I think you missed my reply, am removing context...

>
Please use the latest mainline, or at least U-Boot 2014.07. That board
does not exist in older versions.


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


Re: [U-Boot] [PATCH v5] fs: fat/ext4/sandbox - Deal with files greater than 2GB

2014-10-30 Thread Simon Glass
Hi Suriyan,

On 28 October 2014 17:00, Suriyan Ramasami  wrote:
> The commands fatls/ext4ls give negative values when dealing with files
> greater than 2GB.
> The commands fatsize/ext4size do not update the variable filesize for
> these files.
>
> To deal with this, the fs functions have been modified to take an additional
> parameter of type "* loff_t" which is then populated. The return value of the
> fs functions are used only for error conditions.
>
> Signed-off-by: Suriyan Ramasami 
>
> ---
>
> Changes in v5:
> * Simon - update fs.h with comments for fs_read/fs_write/fs_size
> * Simon - test/fs/fs-test.sh. Many changes as listed under
> *   Add README file to document how to run it
> *   Generate output in a sandbox environment
> *   Add one line comments on shell variables used
> *   Avoid camel case through out
> *   Path to UBOOT is variable at top
> *   Print PASSED or FAILED at end, and set return code, 0 if OK, 1 otherwise
>
> Changes in v4:
> * Support generic fs write commands
> * Sync up behavior of fs load vs fatload and ext4load
> * Albert - change -ve to negative in commit message
>
> Changes in v3:
> * Added testcase to test writes
> * Correct function set_contents() in fs/fat/fat_write.c
>
> Changes in v2:
> * Added test case for fat/ext4 in test/fs/testfs.sh
> * md5sum: call map_sysmem() for buffer that md5_wd will work on
>
> Changes in v1:
> * First try.
>
>  arch/sandbox/cpu/os.c |  11 +-
>  arch/sandbox/cpu/state.c  |   6 +-
>  common/board_f.c  |   6 +-
>  common/cmd_ext4.c |  61 +-
>  common/cmd_fat.c  |   9 +-
>  common/cmd_fs.c   |  17 ++
>  common/cmd_md5sum.c   |  12 +-
>  common/env_fat.c  |   4 +-
>  fs/ext4/ext4_common.c |  24 +--
>  fs/ext4/ext4_common.h |   4 +-
>  fs/ext4/ext4_write.c  |  32 
>  fs/ext4/ext4fs.c  |  37 ++--
>  fs/fat/fat.c  | 124 +++--
>  fs/fat/fat_write.c|  59 +++---
>  fs/fat/file.c |   7 +-
>  fs/fs.c   |  77 
>  fs/sandbox/sandboxfs.c|  25 ++-
>  include/configs/sandbox.h |   2 +
>  include/ext4fs.h  |  13 +-
>  include/fat.h |  19 +-
>  include/fs.h  |  41 ++--
>  include/os.h  |   2 +-
>  include/sandboxfs.h   |   8 +-
>  test/fs/README|   4 +
>  test/fs/fs-test.sh| 462 
> ++
>  25 files changed, 807 insertions(+), 259 deletions(-)
>  create mode 100644 test/fs/README
>  create mode 100755 test/fs/fs-test.sh

I think you close with this patch. So please can you break it up into
several patches? It's too had for people to review as is. My thoughts
are you could have these patches:

- cmd_ms5sum.c is a change to enable md5 for sandbox
- change fs layer to return size in a paramter and fix up return value
- if not too much trouble, put the business of returning the number of
bytes read/written into a separate patch. Otherwise, just leave it in
the one above
- any other changes that remain if any (could be first patch in series)
- patch to add add the test

So that would be 3 to 5 patches depending on how you go.

I've made some comments below anyway. Hopefully this is everything but
it's hard to tell with so much changing!

Thanks again for your efforts.

>
> diff --git a/arch/sandbox/cpu/os.c b/arch/sandbox/cpu/os.c
> index 1c4aa3f..43872e8 100644
> --- a/arch/sandbox/cpu/os.c
> +++ b/arch/sandbox/cpu/os.c
> @@ -385,7 +385,7 @@ const char *os_dirent_get_typename(enum os_dirent_t type)
> return os_dirent_typename[OS_FILET_UNKNOWN];
>  }
>
> -ssize_t os_get_filesize(const char *fname)
> +int os_get_filesize(const char *fname, loff_t *size)
>  {
> struct stat buf;
> int ret;
> @@ -393,7 +393,8 @@ ssize_t os_get_filesize(const char *fname)
> ret = stat(fname, &buf);
> if (ret)
> return ret;
> -   return buf.st_size;
> +   *size = buf.st_size;
> +   return 0;
>  }
>
>  void os_putc(int ch)
> @@ -427,10 +428,10 @@ int os_read_ram_buf(const char *fname)
>  {
> struct sandbox_state *state = state_get_current();
> int fd, ret;
> -   int size;
> +   loff_t size;
>
> -   size = os_get_filesize(fname);
> -   if (size < 0)
> +   ret = os_get_filesize(fname, &size);
> +   if (ret < 0)
> return -ENOENT;

return ret here I think, since you actually have the proper error.

> if (size != state->ram_size)
> return -ENOSPC;
> diff --git a/arch/sandbox/cpu/state.c b/arch/sandbox/cpu/state.c
> index 59adad6..07d2aea 100644
> --- a/arch/sandbox/cpu/state.c
> +++ b/arch/sandbox/cpu/state.c
> @@ -49,12 +49,12 @@ static int state_ensure_space(int extra_size)
>
>  static int state_read_file(struct sandbox_state *state, const char *fname)
>  {
> -   int size;
> +   loff_t size;
> int ret;
> int fd;
>
> -   size = os_get_filesize(fname);
> -   if (si

Re: [U-Boot] [PATCH] blackfin: rename blackfin i2c driver to adi

2014-10-30 Thread Heiko Schocher

Hello Scott,

Am 01.11.2014 07:08, schrieb Scott Jiang:

something is wrong with your clock ... patch is not yet
in patchwork ...


This driver is not only used on blackfin. So it's better to
rename it and access i2c registers by standard io functions.
Fix coding style as well.

Signed-off-by: Scott Jiang
---
  drivers/i2c/Makefile  |2 +-
  drivers/i2c/{bfin-twi_i2c.c =>  adi_i2c.c} |  154 
+++--
  include/configs/bct-brettl2.h |2 +-
  include/configs/bf518f-ezbrd.h|2 +-
  include/configs/bf526-ezbrd.h |2 +-
  include/configs/bf527-ad7160-eval.h   |2 +-
  include/configs/bf527-ezkit.h |2 +-
  include/configs/bf527-sdp.h   |2 +-
  include/configs/bf537-minotaur.h  |2 +-
  include/configs/bf537-pnav.h  |2 +-
  include/configs/bf537-srv1.h  |2 +-
  include/configs/bf537-stamp.h |2 +-
  include/configs/bf538f-ezkit.h|2 +-
  include/configs/bf548-ezkit.h |2 +-
  include/configs/bf609-ezkit.h |2 +-
  include/configs/br4.h |2 +-
  include/configs/cm-bf527.h|2 +-
  include/configs/cm-bf537e.h   |2 +-
  include/configs/cm-bf537u.h   |2 +-
  include/configs/cm-bf548.h|2 +-
  include/configs/pr1.h |2 +-
  include/configs/tcm-bf518.h   |2 +-
  include/configs/tcm-bf537.h   |2 +-
  23 files changed, 103 insertions(+), 95 deletions(-)
  rename drivers/i2c/{bfin-twi_i2c.c =>  adi_i2c.c} (72%)


Thanks for this work ... some "nitpicks" ...


diff --git a/drivers/i2c/Makefile b/drivers/i2c/Makefile
index d067897..b7f0098 100644
--- a/drivers/i2c/Makefile
+++ b/drivers/i2c/Makefile
@@ -5,7 +5,7 @@
  # SPDX-License-Identifier:GPL-2.0+
  #

-obj-$(CONFIG_BFIN_TWI_I2C) += bfin-twi_i2c.o
+obj-$(CONFIG_ADI_I2C) += adi_i2c.o


please use something like "CONFIG_SYS_I2C_ADI" and please
convert this driver to CONFIG_SYS_I2C framework ...


  obj-$(CONFIG_I2C_MV) += mv_i2c.o
  obj-$(CONFIG_PCA9564_I2C) += pca9564_i2c.o
  obj-$(CONFIG_TSI108_I2C) += tsi108_i2c.o
diff --git a/drivers/i2c/bfin-twi_i2c.c b/drivers/i2c/adi_i2c.c
similarity index 72%
rename from drivers/i2c/bfin-twi_i2c.c
rename to drivers/i2c/adi_i2c.c
index cfab064..c971f03 100644
--- a/drivers/i2c/bfin-twi_i2c.c
+++ b/drivers/i2c/adi_i2c.c
@@ -1,7 +1,7 @@
  /*
- * i2c.c - driver for Blackfin on-chip TWI/I2C
+ * i2c.c - driver for ADI TWI/I2C
   *
- * Copyright (c) 2006-2010 Analog Devices Inc.
+ * Copyright (c) 2006-2014 Analog Devices Inc.
   *
   * Licensed under the GPL-2 or later.
   */
@@ -9,9 +9,9 @@
  #include
  #include

-#include
  #include
-#include
+#include
+#include

  /* Every register is 32bit aligned, but only 16bits in size */
  #define ureg(name) u16 name; u16 __pad_##name;
@@ -40,7 +40,7 @@ struct twi_regs {
  #ifdef TWI_CLKDIV
  #define TWI0_CLKDIV TWI_CLKDIV
  #endif
-static volatile struct twi_regs *twi = (void *)TWI0_CLKDIV;
+static struct twi_regs *twi = (void *)TWI0_CLKDIV;

  #ifdef DEBUG
  # define dmemset(s, c, n) memset(s, c, n)
@@ -94,53 +94,54 @@ struct i2c_msg {
   */
  static int wait_for_completion(struct i2c_msg *msg)
  {
-   uint16_t int_stat;
+   u16 int_stat, ctl;


This change is not related to the subject of the patch,
please split this into seperate patches ...


ulong timebase = get_timer(0);

do {
-   int_stat = twi->int_stat;
+   int_stat = readw(&twi->int_stat);


Here too... please fix globally.



if (int_stat&  XMTSERV) {
debugi("processing XMTSERV");
-   twi->int_stat = XMTSERV;
-   SSYNC();
+   writew(XMTSERV,&twi->int_stat);


Here too...


if (msg->alen) {
-   twi->xmt_data8 = *(msg->abuf++);
+   writew(*(msg->abuf++),&twi->xmt_data8);
--msg->alen;
} else if (!(msg->flags&  I2C_M_COMBO)&&  msg->len) {
-   twi->xmt_data8 = *(msg->buf++);
+   writew(*(msg->buf++),&twi->xmt_data8);
--msg->len;
} else {
-   twi->master_ctl |= (msg->flags&  I2C_M_COMBO) ? 
RSTART | MDIR : STOP;
-   SSYNC();
+   ctl = readw(&twi->master_ctl);
+   if (msg->flags&  I2C_M_COMBO)
+   writew(ctl | RSTART | MDIR,
+   &twi->master_ctl);
+   else
+   writew(ctl | STOP,&twi->master_ctl);
  

[U-Boot] [PATCH] blackfin: rename blackfin i2c driver to adi

2014-10-30 Thread Scott Jiang
This driver is not only used on blackfin. So it's better to
rename it and access i2c registers by standard io functions.
Fix coding style as well.

Signed-off-by: Scott Jiang 
---
 drivers/i2c/Makefile  |2 +-
 drivers/i2c/{bfin-twi_i2c.c => adi_i2c.c} |  154 +++--
 include/configs/bct-brettl2.h |2 +-
 include/configs/bf518f-ezbrd.h|2 +-
 include/configs/bf526-ezbrd.h |2 +-
 include/configs/bf527-ad7160-eval.h   |2 +-
 include/configs/bf527-ezkit.h |2 +-
 include/configs/bf527-sdp.h   |2 +-
 include/configs/bf537-minotaur.h  |2 +-
 include/configs/bf537-pnav.h  |2 +-
 include/configs/bf537-srv1.h  |2 +-
 include/configs/bf537-stamp.h |2 +-
 include/configs/bf538f-ezkit.h|2 +-
 include/configs/bf548-ezkit.h |2 +-
 include/configs/bf609-ezkit.h |2 +-
 include/configs/br4.h |2 +-
 include/configs/cm-bf527.h|2 +-
 include/configs/cm-bf537e.h   |2 +-
 include/configs/cm-bf537u.h   |2 +-
 include/configs/cm-bf548.h|2 +-
 include/configs/pr1.h |2 +-
 include/configs/tcm-bf518.h   |2 +-
 include/configs/tcm-bf537.h   |2 +-
 23 files changed, 103 insertions(+), 95 deletions(-)
 rename drivers/i2c/{bfin-twi_i2c.c => adi_i2c.c} (72%)

diff --git a/drivers/i2c/Makefile b/drivers/i2c/Makefile
index d067897..b7f0098 100644
--- a/drivers/i2c/Makefile
+++ b/drivers/i2c/Makefile
@@ -5,7 +5,7 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-obj-$(CONFIG_BFIN_TWI_I2C) += bfin-twi_i2c.o
+obj-$(CONFIG_ADI_I2C) += adi_i2c.o
 obj-$(CONFIG_I2C_MV) += mv_i2c.o
 obj-$(CONFIG_PCA9564_I2C) += pca9564_i2c.o
 obj-$(CONFIG_TSI108_I2C) += tsi108_i2c.o
diff --git a/drivers/i2c/bfin-twi_i2c.c b/drivers/i2c/adi_i2c.c
similarity index 72%
rename from drivers/i2c/bfin-twi_i2c.c
rename to drivers/i2c/adi_i2c.c
index cfab064..c971f03 100644
--- a/drivers/i2c/bfin-twi_i2c.c
+++ b/drivers/i2c/adi_i2c.c
@@ -1,7 +1,7 @@
 /*
- * i2c.c - driver for Blackfin on-chip TWI/I2C
+ * i2c.c - driver for ADI TWI/I2C
  *
- * Copyright (c) 2006-2010 Analog Devices Inc.
+ * Copyright (c) 2006-2014 Analog Devices Inc.
  *
  * Licensed under the GPL-2 or later.
  */
@@ -9,9 +9,9 @@
 #include 
 #include 
 
-#include 
 #include 
-#include 
+#include 
+#include 
 
 /* Every register is 32bit aligned, but only 16bits in size */
 #define ureg(name) u16 name; u16 __pad_##name;
@@ -40,7 +40,7 @@ struct twi_regs {
 #ifdef TWI_CLKDIV
 #define TWI0_CLKDIV TWI_CLKDIV
 #endif
-static volatile struct twi_regs *twi = (void *)TWI0_CLKDIV;
+static struct twi_regs *twi = (void *)TWI0_CLKDIV;
 
 #ifdef DEBUG
 # define dmemset(s, c, n) memset(s, c, n)
@@ -94,53 +94,54 @@ struct i2c_msg {
  */
 static int wait_for_completion(struct i2c_msg *msg)
 {
-   uint16_t int_stat;
+   u16 int_stat, ctl;
ulong timebase = get_timer(0);
 
do {
-   int_stat = twi->int_stat;
+   int_stat = readw(&twi->int_stat);
 
if (int_stat & XMTSERV) {
debugi("processing XMTSERV");
-   twi->int_stat = XMTSERV;
-   SSYNC();
+   writew(XMTSERV, &twi->int_stat);
if (msg->alen) {
-   twi->xmt_data8 = *(msg->abuf++);
+   writew(*(msg->abuf++), &twi->xmt_data8);
--msg->alen;
} else if (!(msg->flags & I2C_M_COMBO) && msg->len) {
-   twi->xmt_data8 = *(msg->buf++);
+   writew(*(msg->buf++), &twi->xmt_data8);
--msg->len;
} else {
-   twi->master_ctl |= (msg->flags & I2C_M_COMBO) ? 
RSTART | MDIR : STOP;
-   SSYNC();
+   ctl = readw(&twi->master_ctl);
+   if (msg->flags & I2C_M_COMBO)
+   writew(ctl | RSTART | MDIR,
+   &twi->master_ctl);
+   else
+   writew(ctl | STOP, &twi->master_ctl);
}
}
if (int_stat & RCVSERV) {
debugi("processing RCVSERV");
-   twi->int_stat = RCVSERV;
-   SSYNC();
+   writew(RCVSERV, &twi->int_stat);
if (msg->len) {
-   *(msg->buf++) = twi->rcv_data8;
+   *(msg->buf++) = readw(&twi->rcv_data8);
--msg->len;
   

[U-Boot] [PATCH] arm: ls102xa: Update PCIe dts node status

2014-10-30 Thread Minghuan Lian
The patch changes PCIe dts node status to 'disabled' if the
corresponding controller is disabled according to serdes protocol.

Signed-off-by: Minghuan Lian 
---
 arch/arm/include/asm/arch-ls102xa/config.h |  3 ++
 arch/arm/include/asm/pcie_layerscape.h | 13 
 board/freescale/ls1021aqds/ls1021aqds.c|  5 +++
 board/freescale/ls1021atwr/ls1021atwr.c|  5 +++
 drivers/pci/Makefile   |  1 +
 drivers/pci/pcie_layerscape.c  | 51 ++
 include/configs/ls1021aqds.h   |  8 +
 include/configs/ls1021atwr.h   |  7 
 8 files changed, 93 insertions(+)
 create mode 100644 arch/arm/include/asm/pcie_layerscape.h
 create mode 100644 drivers/pci/pcie_layerscape.c

diff --git a/arch/arm/include/asm/arch-ls102xa/config.h 
b/arch/arm/include/asm/arch-ls102xa/config.h
index f2c9687..9fd0b2c 100644
--- a/arch/arm/include/asm/arch-ls102xa/config.h
+++ b/arch/arm/include/asm/arch-ls102xa/config.h
@@ -49,6 +49,9 @@
 
 #define LPUART_BASE(CONFIG_SYS_IMMR + 0x0195)
 
+#define CONFIG_SYS_PCIE1_ADDR  (CONFIG_SYS_IMMR + 0x240)
+#define CONFIG_SYS_PCIE2_ADDR  (CONFIG_SYS_IMMR + 0x250)
+
 #ifdef CONFIG_DDR_SPD
 #define CONFIG_SYS_FSL_DDR_BE
 #define CONFIG_VERY_BIG_RAM
diff --git a/arch/arm/include/asm/pcie_layerscape.h 
b/arch/arm/include/asm/pcie_layerscape.h
new file mode 100644
index 000..fb08578
--- /dev/null
+++ b/arch/arm/include/asm/pcie_layerscape.h
@@ -0,0 +1,13 @@
+/*
+ * Copyright 2014 Freescale Semiconductor, Inc.
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#ifndef __PCIE_LAYERSCAPE_H_
+#define __PCIE_LAYERSCAPE_H_
+
+void pci_init_board(void);
+void ft_pcie_setup(void *blob, bd_t *bd);
+
+#endif
diff --git a/board/freescale/ls1021aqds/ls1021aqds.c 
b/board/freescale/ls1021aqds/ls1021aqds.c
index 5fafc85..fccf6b6 100644
--- a/board/freescale/ls1021aqds/ls1021aqds.c
+++ b/board/freescale/ls1021aqds/ls1021aqds.c
@@ -10,6 +10,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -243,6 +244,10 @@ int board_init(void)
 void ft_board_setup(void *blob, bd_t *bd)
 {
ft_cpu_setup(blob, bd);
+
+#ifdef CONFIG_PCIE_LAYERSCAPE
+   ft_pcie_setup(blob, bd);
+#endif
 }
 
 u8 flash_read8(void *addr)
diff --git a/board/freescale/ls1021atwr/ls1021atwr.c 
b/board/freescale/ls1021atwr/ls1021atwr.c
index 50d5640..0b548eb 100644
--- a/board/freescale/ls1021atwr/ls1021atwr.c
+++ b/board/freescale/ls1021atwr/ls1021atwr.c
@@ -10,6 +10,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -293,6 +294,10 @@ int misc_init_r(void)
 void ft_board_setup(void *blob, bd_t *bd)
 {
ft_cpu_setup(blob, bd);
+
+#ifdef CONFIG_PCIE_LAYERSCAPE
+   ft_pcie_setup(blob, bd);
+#endif
 }
 
 u8 flash_read8(void *addr)
diff --git a/drivers/pci/Makefile b/drivers/pci/Makefile
index e73a498..e525ceb 100644
--- a/drivers/pci/Makefile
+++ b/drivers/pci/Makefile
@@ -17,3 +17,4 @@ obj-$(CONFIG_SH7751_PCI) +=pci_sh7751.o
 obj-$(CONFIG_SH7780_PCI) +=pci_sh7780.o
 obj-$(CONFIG_TSI108_PCI) += tsi108_pci.o
 obj-$(CONFIG_WINBOND_83C553) += w83c553f.o
+obj-$(CONFIG_PCIE_LAYERSCAPE) += pcie_layerscape.o
diff --git a/drivers/pci/pcie_layerscape.c b/drivers/pci/pcie_layerscape.c
new file mode 100644
index 000..291c249
--- /dev/null
+++ b/drivers/pci/pcie_layerscape.c
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2014 Freescale Semiconductor, Inc.
+ * Layerscape PCIe driver
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#ifdef CONFIG_OF_BOARD_SETUP
+#include 
+#include 
+
+static void ft_pcie_ls_setup(void *blob, const char *pci_compat,
+unsigned long ctrl_addr, enum srds_prtcl dev)
+{
+   int off;
+
+   off = fdt_node_offset_by_compat_reg(blob, pci_compat,
+   (phys_addr_t)ctrl_addr);
+   if (off < 0)
+   return;
+
+   if (!is_serdes_configured(dev))
+   fdt_set_node_status(blob, off, FDT_STATUS_DISABLED, 0);
+}
+
+void ft_pcie_setup(void *blob, bd_t *bd)
+{
+   #ifdef CONFIG_PCIE1
+   ft_pcie_ls_setup(blob, FSL_PCIE_COMPAT, CONFIG_SYS_PCIE1_ADDR, PCIE1);
+   #endif
+
+   #ifdef CONFIG_PCIE2
+   ft_pcie_ls_setup(blob, FSL_PCIE_COMPAT, CONFIG_SYS_PCIE2_ADDR, PCIE2);
+   #endif
+}
+
+#else
+void ft_pcie_setup(void *blob, bd_t *bd)
+{
+}
+#endif
+
+void pci_init_board(void)
+{
+}
diff --git a/include/configs/ls1021aqds.h b/include/configs/ls1021aqds.h
index d1f6ea7..5544b81 100644
--- a/include/configs/ls1021aqds.h
+++ b/include/configs/ls1021aqds.h
@@ -318,6 +318,14 @@ unsigned long get_board_ddr_clk(void);
 #endif
 
 #endif
+
+/* PCIe */
+#define CONFIG_PCI /* Enable PCI/PCIE */
+#define CONFIG_PCIE1   /* PCIE controler 1 */
+#define CONFIG_PCIE2   /* PCIE controler 2 */
+#define CONFIG_PCIE_LAYERSCAPE /

Re: [U-Boot] [v2 PATCH 10/12] arm, spl, at91: add at91sam9260 and at91sam9g45 spl support

2014-10-30 Thread Wolfgang Denk
Dear Bo Shen,

In message <5452ead4.7080...@atmel.com> you wrote:
> 
> I am thinking, whether it be better to keep this file as two copy? This 
> will remove #ifdef, although a little code duplication.

I agree that we should try and minimize #ifdef's, but code duplication
is even worse.


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 explanation requiring the fewest assumptions is the  most  likely
to be correct.-- William of Occam
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [v2 PATCH 10/12] arm, spl, at91: add at91sam9260 and at91sam9g45 spl support

2014-10-30 Thread Heiko Schocher

Hello Bo,

Am 31.10.2014 02:50, schrieb Bo Shen:

Hi Heiko,

On 10/30/2014 04:15 PM, Heiko Schocher wrote:

diff --git a/arch/arm/cpu/at91-common/spl.c b/arch/arm/cpu/at91-common/spl.c
index 674a470..5c9a3ad 100644
--- a/arch/arm/cpu/at91-common/spl.c
+++ b/arch/arm/cpu/at91-common/spl.c


I am thinking, whether it be better to keep this file as two copy? This will 
remove #ifdef, although a little code duplication.

If this solution acceptable, some suggestion as following:
- for armv5 (arm926ejs, now at91 series), named it spl_at91.c,
- for armv7 (cortex-a5, now, sama5d3), named it spl_atmel.c?
(As for arm9 series, we have at91 prefix for SoC name, and for armv7 SoC, we 
don't have at91 prefix, and it now changed to Atmel Smart)


Ok, I look into this.

[...]

@@ -57,77 +91,134 @@ static void switch_to_main_crystal_osc(void)

[...]

- /* disable watchdog */
+void spl_board_init(void)
+{
+ struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC;
+
+ lowlevel_clock_init();
at91_disable_wdt();

- /* PMC configuration */
- at91_pmc_init();
+ /*
+ * At this stage the main oscillator is supposed to be enabled
+ * PCK = MCK = MOSC
+ */
+ writel(0x00, &pmc->pllicpr);

- at91_clock_init(CONFIG_SYS_AT91_MAIN_CLOCK);
+ /* Configure PLLA = MOSC * (PLL_MULA + 1) / PLL_DIVA */
+ at91_plla_init(CONFIG_SYS_AT91_PLLA);

- timer_init();
+ /* PCK = PLLA = 2 * MCK */
+ at91_mck_init(CONFIG_SYS_MCKR);

- board_early_init_f();
+ /* Switch MCK on PLLA output */
+ at91_mck_init(CONFIG_SYS_MCKR_CSS);
+
+#if defined(CONFIG_SYS_AT91_PLLB)
+ /* Configure PLLB */
+ at91_pllb_init(CONFIG_SYS_AT91_PLLB);
+#endif
+
+ /* Enable External Reset */
+ enable_ext_reset();

+#if defined(CONFIG_ATMEL_MATRIX_INIT)
+ /* Initialize matrix */
+ matrix_init();
+#endif


Can this also be weak function? And put matrix_init() code to SoC/board related 
file.


Changed.

Thanks!

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] [v2 PATCH 03/12] arm, at91, mpddrc: fix typo in ddr2_init()

2014-10-30 Thread Heiko Schocher

Hello Bo,

Am 31.10.2014 02:55, schrieb Bo Shen:

Hi Heiko,

On 10/30/2014 04:14 PM, Heiko Schocher wrote:

use the configure value for computing the ba_off value
not the value from the cr register. This leaded in a
wrong ram configuration on the upcoming corvus spl board
support.

Signed-off-by: Heiko Schocher 
Reviewed-by: Andreas Bießmann 

---

Changes in v2:
add Reviewed-by: Andreas Bießmann 

arch/arm/cpu/at91-common/mpddrc.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm/cpu/at91-common/mpddrc.c 
b/arch/arm/cpu/at91-common/mpddrc.c
index 8136396..76668d2 100644
--- a/arch/arm/cpu/at91-common/mpddrc.c
+++ b/arch/arm/cpu/at91-common/mpddrc.c
@@ -26,7 +26,8 @@ int ddr2_init(const unsigned int ram_address,
/* Compute bank offset according to NC in configuration register */
ba_off = (mpddr_value->cr & ATMEL_MPDDRC_CR_NC_MASK) + 9;
if (!(mpddr_value->cr & ATMEL_MPDDRC_CR_DECOD_INTERLEAVED))
- ba_off += ((mpddr->cr & ATMEL_MPDDRC_CR_NR_MASK) >> 2) + 11;
+ ba_off += ((mpddr_value->cr & ATMEL_MPDDRC_CR_NR_MASK) >> 2)
+ + 11;


As Andreas suggested, can we ignore the 80 character's warning here?


Ok, changes this ... so I send a v3.

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


[U-Boot] [PATCH 0/2] Follow-up patches for commit 2e07c249a67e (kconfig: arm: introduce symbol for ARM CPUs)

2014-10-30 Thread Masahiro Yamada



Masahiro Yamada (2):
  kconfig: arm: select CPU_V7 for some new boards
  kconfig: arm: move "armv8" define to arch/arm/Kconfig

 arch/arm/Kconfig| 5 +++--
 arch/arm/cpu/armv7/tegra-common/Kconfig | 4 
 arch/arm/cpu/armv8/Kconfig  | 6 --
 board/Marvell/db-mv784mp-gp/Kconfig | 8 
 board/maxbcm/Kconfig| 7 ---
 board/sunxi/Kconfig | 1 -
 board/ti/ks2_evm/Kconfig| 3 ---
 7 files changed, 3 insertions(+), 31 deletions(-)
 delete mode 100644 arch/arm/cpu/armv8/Kconfig

-- 
1.9.1

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


[U-Boot] [PATCH 1/2] kconfig: arm: select CPU_V7 for some new boards

2014-10-30 Thread Masahiro Yamada
Marvell DB-MV784MP-GP and maxBCM are pretty new boards and were missed
by commit 2e07c249a67e (kconfig: arm: introduce symbol for ARM CPUs).

This commit adds "select CPU_V7" for them and remove redundant
"config SYS_CPU" and "string" directives.

Signed-off-by: Masahiro Yamada 
Cc: Savoundararadj 
---

 arch/arm/Kconfig| 2 ++
 arch/arm/cpu/armv7/tegra-common/Kconfig | 4 
 board/Marvell/db-mv784mp-gp/Kconfig | 8 
 board/maxbcm/Kconfig| 7 ---
 board/sunxi/Kconfig | 1 -
 board/ti/ks2_evm/Kconfig| 3 ---
 6 files changed, 2 insertions(+), 23 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 1bad202..76ac2b6 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -229,9 +229,11 @@ config KIRKWOOD
 
 config TARGET_DB_MV784MP_GP
bool "Support db-mv784mp-gp"
+   select CPU_V7
 
 config TARGET_MAXBCM
bool "Support maxbcm"
+   select CPU_V7
 
 config TARGET_DEVKIT3250
bool "Support devkit3250"
diff --git a/arch/arm/cpu/armv7/tegra-common/Kconfig 
b/arch/arm/cpu/armv7/tegra-common/Kconfig
index 3ea6d76..1446452 100644
--- a/arch/arm/cpu/armv7/tegra-common/Kconfig
+++ b/arch/arm/cpu/armv7/tegra-common/Kconfig
@@ -20,10 +20,6 @@ endchoice
 config USE_PRIVATE_LIBGCC
default y if SPL_BUILD
 
-config SYS_CPU
-   default "arm720t" if SPL_BUILD
-   default "armv7" if !SPL_BUILD
-
 source "arch/arm/cpu/armv7/tegra20/Kconfig"
 source "arch/arm/cpu/armv7/tegra30/Kconfig"
 source "arch/arm/cpu/armv7/tegra114/Kconfig"
diff --git a/board/Marvell/db-mv784mp-gp/Kconfig 
b/board/Marvell/db-mv784mp-gp/Kconfig
index f94a444..98aa10a 100644
--- a/board/Marvell/db-mv784mp-gp/Kconfig
+++ b/board/Marvell/db-mv784mp-gp/Kconfig
@@ -1,23 +1,15 @@
 if TARGET_DB_MV784MP_GP
 
-config SYS_CPU
-   string
-   default "armv7"
-
 config SYS_BOARD
-   string
default "db-mv784mp-gp"
 
 config SYS_VENDOR
-   string
default "Marvell"
 
 config SYS_SOC
-   string
default "armada-xp"
 
 config SYS_CONFIG_NAME
-   string
default "db-mv784mp-gp"
 
 endif
diff --git a/board/maxbcm/Kconfig b/board/maxbcm/Kconfig
index d34e2ab..d833ca0 100644
--- a/board/maxbcm/Kconfig
+++ b/board/maxbcm/Kconfig
@@ -1,19 +1,12 @@
 if TARGET_MAXBCM
 
-config SYS_CPU
-   string
-   default "armv7"
-
 config SYS_BOARD
-   string
default "maxbcm"
 
 config SYS_SOC
-   string
default "armada-xp"
 
 config SYS_CONFIG_NAME
-   string
default "maxbcm"
 
 endif
diff --git a/board/sunxi/Kconfig b/board/sunxi/Kconfig
index 28df187..4aea0ee 100644
--- a/board/sunxi/Kconfig
+++ b/board/sunxi/Kconfig
@@ -1,7 +1,6 @@
 if TARGET_SUN4I || TARGET_SUN5I || TARGET_SUN6I || TARGET_SUN7I || TARGET_SUN8I
 
 config SYS_CONFIG_NAME
-   string
default "sun4i" if TARGET_SUN4I
default "sun5i" if TARGET_SUN5I
default "sun6i" if TARGET_SUN6I
diff --git a/board/ti/ks2_evm/Kconfig b/board/ti/ks2_evm/Kconfig
index 96c5f22..384b175 100644
--- a/board/ti/ks2_evm/Kconfig
+++ b/board/ti/ks2_evm/Kconfig
@@ -27,15 +27,12 @@ endif
 if TARGET_K2L_EVM
 
 config SYS_BOARD
-   string
default "ks2_evm"
 
 config SYS_VENDOR
-   string
default "ti"
 
 config SYS_CONFIG_NAME
-   string
default "k2l_evm"
 
 endif
-- 
1.9.1

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


[U-Boot] [PATCH 2/2] kconfig: arm: move "armv8" define to arch/arm/Kconfig

2014-10-30 Thread Masahiro Yamada
Commit 2e07c249a67e (kconfig: arm: introduce symbol for ARM CPUs)
collected the default values of CONFIG_SYS_CPU into arch/arm/Kconfig.

This commit moves "armv8" to there for consistency.

Signed-off-by: Masahiro Yamada 
Cc: Savoundararadj 
---

 arch/arm/Kconfig   | 3 +--
 arch/arm/cpu/armv8/Kconfig | 6 --
 2 files changed, 1 insertion(+), 8 deletions(-)
 delete mode 100644 arch/arm/cpu/armv8/Kconfig

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 76ac2b6..3db3257 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -49,6 +49,7 @@ config SYS_CPU
 default "armv7" if CPU_V7
 default "pxa" if CPU_PXA
 default "sa1100" if CPU_SA1100
+   default "armv8" if ARM64
 
 choice
prompt "Target select"
@@ -800,8 +801,6 @@ config ARCH_UNIPHIER
 
 endchoice
 
-source "arch/arm/cpu/armv8/Kconfig"
-
 source "arch/arm/cpu/arm926ejs/davinci/Kconfig"
 
 source "arch/arm/cpu/armv7/exynos/Kconfig"
diff --git a/arch/arm/cpu/armv8/Kconfig b/arch/arm/cpu/armv8/Kconfig
deleted file mode 100644
index 3d1655b..000
--- a/arch/arm/cpu/armv8/Kconfig
+++ /dev/null
@@ -1,6 +0,0 @@
-if ARM64
-
-config SYS_CPU
-   default "armv8"
-
-endif
-- 
1.9.1

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


[U-Boot] [PATCH] powerpc/t208xqds: VID support

2014-10-30 Thread ying.zhang
From: Ying Zhang 

The fuse status register provides the values from on-chip
voltage ID efuses programmed at the factory.
These values define the voltage requirements for
the chip. u-boot reads FUSESR and translates the values
into the appropriate commands to set the voltage output
value of an external voltage regulator.

Signed-off-by: Ying Zhang 
---
 board/freescale/common/Makefile |   1 +
 board/freescale/common/vid.c| 491 
 board/freescale/common/vid.h|  19 ++
 board/freescale/t208xqds/t208xqds.c |   5 +
 include/configs/T208xQDS.h  |  17 ++
 5 files changed, 533 insertions(+)
 create mode 100644 board/freescale/common/vid.c
 create mode 100644 board/freescale/common/vid.h

diff --git a/board/freescale/common/Makefile b/board/freescale/common/Makefile
index 32b5a3b..1556433 100644
--- a/board/freescale/common/Makefile
+++ b/board/freescale/common/Makefile
@@ -23,6 +23,7 @@ obj-$(CONFIG_FMAN_ENET)   += fman.o
 obj-$(CONFIG_FSL_PIXIS)+= pixis.o
 ifndef CONFIG_SPL_BUILD
 obj-$(CONFIG_FSL_NGPIXIS)  += ngpixis.o
+obj-$(CONFIG_VID)  += vid.o
 endif
 obj-$(CONFIG_FSL_QIXIS)+= qixis.o
 obj-$(CONFIG_PQ_MDS_PIB)   += pq-mds-pib.o
diff --git a/board/freescale/common/vid.c b/board/freescale/common/vid.c
new file mode 100644
index 000..cca5151
--- /dev/null
+++ b/board/freescale/common/vid.c
@@ -0,0 +1,491 @@
+/*
+ * Copyright 2014 Freescale Semiconductor, Inc.
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include "vid.h"
+
+DECLARE_GLOBAL_DATA_PTR;
+
+int __weak i2c_multiplexer_select_vid_channel(u8 channel)
+{
+   return 0;
+}
+
+/*
+ * Compensate for a board specific voltage drop between regulator and SoC
+ * return a value in mV
+ */
+int __weak board_vdd_drop_compensation(void)
+{
+   return 0;
+}
+
+/*
+ * Get the i2c address configuration for the IR regulator chip
+ *
+ * There are some variance in the RDB HW regarding the I2C address 
configuration
+ * for the IR regulator chip, which is likely a problem of external resistor
+ * accuracy. So we just check each address in a hopefully non-intrusive mode
+ * and use the first one that seems to work
+ *
+ * The IR chip can show up under the following addresses:
+ * 0x08 (Verified on T1040RDB-PA,T4240RDB-PB,X-T4240RDB-16GPA)
+ * 0x09 (Verified on T1040RDB-PA)
+ * 0x38 (Verified on T2080QDS, T2081QDS)
+ */
+static int find_ir_chip_on_i2c(void)
+{
+   int i2caddress;
+   int ret;
+   u8 byte;
+   int i;
+   const int ir_i2c_addr[] = {0x38, 0x08, 0x09};
+
+   /* Check all the address */
+   for (i = 0; i < (sizeof(ir_i2c_addr)/sizeof(ir_i2c_addr[0])); i++) {
+   i2caddress = ir_i2c_addr[i];
+   ret = i2c_read(i2caddress,
+  IR36021_MFR_ID_OFFSET, 1, (void *)&byte,
+  sizeof(byte));
+   if ((ret >= 0) && (byte == IR36021_MFR_ID))
+   return i2caddress;
+   }
+   return -1;
+}
+
+/* Maximum loop count waiting for new voltage to take effect */
+#define MAX_LOOP_WAIT_NEW_VOL  100
+/* Maximum loop count waiting for the voltage to be stable */
+#define MAX_LOOP_WAIT_VOL_STABLE   100
+/*
+ * read_voltage from sensor on I2C bus
+ * We use average of 4 readings, waiting for WAIT_FOR_ADC before
+ * another reading
+ */
+#define NUM_READINGS4   /* prefer to be power of 2 for efficiency */
+
+/* If an INA220 chip is available, we can use it to read back the voltage
+ * as it may have a higher accuracy than the IR chip for the same purpose
+ */
+#ifdef CONFIG_VOL_MONITOR_INA220
+#define WAIT_FOR_ADC   532 /* wait for 532 microseconds for ADC */
+#define ADC_MIN_ACCURACY   4
+#else
+#define WAIT_FOR_ADC   138 /* wait for 138 microseconds for ADC */
+#define ADC_MIN_ACCURACY   4
+#endif
+
+#ifdef CONFIG_VOL_MONITOR_INA220
+static int read_voltage_from_INA220(int i2caddress)
+{
+   int i, ret, voltage_read = 0;
+   u16 vol_mon;
+   u8 buf[2];
+
+   for (i = 0; i < NUM_READINGS; i++) {
+   ret = i2c_read(I2C_VOL_MONITOR_ADDR,
+  I2C_VOL_MONITOR_BUS_V_OFFSET, 1,
+  (void *)&buf, 2);
+   if (ret) {
+   printf("VID: failed to read core voltage\n");
+   return ret;
+   }
+   vol_mon = (buf[0] << 8) | buf[1];
+   if (vol_mon & I2C_VOL_MONITOR_BUS_V_OVF) {
+   printf("VID: Core voltage sensor error\n");
+   return -1;
+   }
+   debug("VID: bus voltage reads 0x%04x\n", vol_mon);
+   /* LSB = 4mv */
+   voltage_read += (vol_mon >> I2C_VOL_MONITOR_BUS_V_SHIFT) * 4;
+   udelay(WAIT_FOR_ADC);
+   }
+   /* calculate the average */
+   voltage_read /= NUM_READINGS;
+
+

Re: [U-Boot] [PATCH 3/3] ARM: kwimage: fix v0 format

2014-10-30 Thread Prafulla Wadaskar


> -Original Message-
> From: Gerald Kerma [mailto:drea...@doukki.net]
> Sent: 31 October 2014 05:33
> To: u-boot@lists.denx.de; Prafulla Wadaskar; s...@denx.de
> Cc: albert.u.b...@aribaud.net; l...@openwrt.org; Gerald
> Kerma
> Subject: [PATCH 3/3] ARM: kwimage: fix v0 format
> 
> This patch fix the kwimage tools for version 0
> fileformat used for kirkwood
> Tested on sheevaplug
> 
> Signed-off-by: Gerald Kerma 
> ---
>  tools/kwbimage.c | 10 ++
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/tools/kwbimage.c b/tools/kwbimage.c
> index 1120e9b..7e2fb5e 100644
> --- a/tools/kwbimage.c
> +++ b/tools/kwbimage.c
> @@ -324,7 +324,7 @@ static void *image_create_v0(size_t
> *imagesz, struct image_tool_params *params,
>   main_hdr = image;
> 
>   /* Fill in the main header */
> - main_hdr->blocksize = payloadsz + sizeof(uint32_t);
> + main_hdr->blocksize = payloadsz + sizeof(uint32_t)
> - headersz;
>   main_hdr->srcaddr   = headersz;
>   main_hdr->ext   = has_ext;
>   main_hdr->destaddr  = params->addr;
> @@ -792,8 +792,8 @@ static void
> kwbimage_print_header(const void *ptr)
> 
>   printf("Image Type:   MVEBU Boot from %s Image\n",
>  image_boot_mode_name(mhdr->blockid));
> - printf("Data Size:");
>   printf("Image version:%d\n", image_version((void
> *)ptr));
> + printf("Data Size:");
>   genimg_print_size(mhdr->blocksize -
> sizeof(uint32_t));
>   printf("Load Address: %08x\n", mhdr->destaddr);
>   printf("Entry Point:  %08x\n", mhdr->execaddr);
> @@ -816,7 +816,8 @@ static int
> kwbimage_verify_header(unsigned char *ptr, int
> image_size,
> 
>   main_hdr = (void *)ptr;
>   checksum = image_checksum8(ptr,
> -sizeof(struct main_hdr_v0));
> +sizeof(struct main_hdr_v0)
> +- sizeof(uint8_t));
>   if (checksum != main_hdr->checksum)
>   return -FDT_ERR_BADSTRUCTURE;
> 
> @@ -824,7 +825,8 @@ static int
> kwbimage_verify_header(unsigned char *ptr, int
> image_size,
>   if (image_version((void *)ptr) == 0) {
>   ext_hdr = (void *)ptr + sizeof(struct
> main_hdr_v0);
>   checksum = image_checksum8(ext_hdr,
> -sizeof(struct ext_hdr_v0));
> +sizeof(struct ext_hdr_v0)
> +- sizeof(uint8_t));
>   if (checksum != ext_hdr->checksum)
>   return -FDT_ERR_BADSTRUCTURE;
>   }
> --

Thanks Gerald.

Regards...
Prafulla . . .

> 1.9.1

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


Re: [U-Boot] verified boot of beaglebone black

2014-10-30 Thread Simon Glass
Hi,

On 30 Oct 2014 21:50, "Srinivasan S"  wrote:
>
> Thanks a lot for your replies Simon,
>
> 1. Could you please confirm whether the beaglebone black support exists
in that  U-Boot 2014.07 & can I use  linux-3.12.10-ti2013.12.01 kernel
(provided  by ti-sdk-am335x-evm-07.00.00.00 )on top of this U-Boot 2014.07
>

That should work ok.

> 2. Could you please provide me the link for syncing U-Boot 2014.07 for
beaglebone black

See here:

ftp://ftp.denx.de/pub/u-boot/

Regards,
Simon

> Many Thanks in Advance,
> Srinivasan S
> 
> From: s...@google.com  on behalf of Simon Glass <
s...@chromium.org>
> Sent: Thursday, October 30, 2014 8:30 PM
> To: Srinivasan S
> Cc: U-Boot Mailing List
> Subject: Re: verified boot of beaglebone black
>
> Hi,
>
> On 30 October 2014 01:15, Srinivasan S 
wrote:
> > Hi Simon,
> >
> > Extremely Sorry to push you Hard, Could you please provide any updates
w.r.t the below issue
>
> I think you missed my reply, am removing context...
>
> >
> Please use the latest mainline, or at least U-Boot 2014.07. That board
> does not exist in older versions.
>
>
> Regards,
> Simon
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] imx:mx6sxsabresd fix pfuz probe failed

2014-10-30 Thread Peng Fan
The PFUZ probe failed with the following msg:
" wait_for_sr_state: failed sr=81 cr=a0 state=2020
  i2c_init_transfer: failed for chip 0x8 retry=0
  wait_for_sr_state: failed sr=81 cr=a0 state=2020
  i2c_init_transfer: failed for chip 0x8 retry=1
  wait_for_sr_state: failed sr=81 cr=a0 state=2020
  i2c_init_transfer: failed for chip 0x8 retry=2
  i2c_init_transfer: give up i2c_regs=021a
  Can't find PMIC:PFUZE100 "

board_early_init_f is too early to call i2c related setting, because
init_func_i2c is called after board_early_init_f being invoked. Thus
move setup_i2c into board_init.

Also PFUZ is connected to I2C bus 0, so change "1" -> "0".

Using this patch PFUZ can be correctly probed:
"PMIC:  PFUZE100 ID=0x11"

Signed-off-by: Peng Fan 
---
 board/freescale/mx6sxsabresd/mx6sxsabresd.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/board/freescale/mx6sxsabresd/mx6sxsabresd.c 
b/board/freescale/mx6sxsabresd/mx6sxsabresd.c
index 68d3718..256ea29 100644
--- a/board/freescale/mx6sxsabresd/mx6sxsabresd.c
+++ b/board/freescale/mx6sxsabresd/mx6sxsabresd.c
@@ -243,7 +243,6 @@ int board_phy_config(struct phy_device *phydev)
 int board_early_init_f(void)
 {
setup_iomux_uart();
-   setup_i2c(1, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info1);
 
/* Enable PERI_3V3, which is used by SD2, ENET, LVDS, BT */
imx_iomux_v3_setup_multiple_pads(peri_3v3_pads,
@@ -277,6 +276,10 @@ int board_init(void)
/* Address of boot parameters */
gd->bd->bi_boot_params = PHYS_SDRAM + 0x100;
 
+#ifdef CONFIG_SYS_I2C_MXC
+   setup_i2c(0, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info1);
+#endif
+
return 0;
 }
 
-- 
1.8.4


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


Re: [U-Boot] [PATCH v2 6/6] dm: sunxi: Add support for serial using driver model

2014-10-30 Thread Simon Glass
Hi Ian,

On 30 October 2014 04:14, Ian Campbell  wrote:
> On Thu, 2014-10-30 at 10:36 +0100, Hans de Goede wrote:
>> Hi,
>>
>> On 10/30/2014 10:08 AM, Ian Campbell wrote:
>> > On Wed, 2014-10-29 at 13:28 -0600, Simon Glass wrote:
>> >>> In the meantime could we somehow replace/augment the #ifdef chain in
>> >>> gpio_init with something keyed off the stdout alias perhaps?
>> >>
>> >> Tegra has code to convert a device interrupt number (which uniquely
>> >> identifies a peripheral in that SoC) to an internal peripheral ID,
>> >> then these is a function which can enable a peripheral given the ID
>> >> (funcmux). In some cases you could have multiple options for the
>> >> funcmux, but there is no easy way to support this.
>> >
>> > I think that although there are multiple options for some functions
>> > (UARTs come to mind) we haven't yet found the need to make any dynamic
>> > choices, so it's all static right now.
>> >
>> >>  But this approach
>> >> might be good enough for sunxi. We can easily write the function to
>> >> enable the pins for a particular port, and this could go in
>> >> arch/arm/...sunxi/ perhaps.
>> >
>> > I'm ok with it so long as it isn't going to stand in the way of proper
>> > dt based pinmux in the future.
>> >
>> > One way to help with that might be to use the allwinner,function
>> > property in DT as the funcmux name.
>> >
>> > Hans, what do you think?
>>
>> I'm not 100% sure what you're suggesting here, are you suggesting to
>> have a 1:1 mapping between function names as stored in allwinner,function
>> in dts and the value to pass to sunxi_gpio_set_cfgpin ?
>
> I was imagining a function which would take the string "uart0" and would
> call sunxi_gpio_set_cfgpin with whatever values that would entail in
> order to make uart0 work, not one which would try and return something
> that the caller would then use.

If you only have a few pins that uart0 can appear on, then you could
pass a parameter telling the function which combination to use. I'm
not sure about passing a string for the uart0 - would not an enum
defined globally for sunix not be better?

>
>> This is not going to fly very far, e.g. the "uart0" function has cfg value
>> of 2 on portb while it has a value of 4 on portf.
>
> I believe we currently statically use either portb or portf (I've not
> looked up which, IIRC it changed recently, but I don't recall which
> way), so my proposed function would just DTRT. Of course if we ever find
> we need something more dynamic then we would have to do a proper pinmux
> implementation (or at least something closer to a proper one)

SGTM.

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


Re: [U-Boot] [PATCH 02/10] Add some standard headers external code might need

2014-10-30 Thread Simon Glass
Hi Masahiro,

On 30 October 2014 01:53, Masahiro Yamada  wrote:
> Hi Simon,
>
>
>
> On Wed, 29 Oct 2014 19:43:26 -0600
> Simon Glass  wrote:
>
>> Hi Masahiro,
>>
>> On 29 October 2014 08:06, Masahiro YAMADA  wrote:
>> > Hi Simon,
>> >
>> > 2014-10-29 3:24 GMT+09:00 Simon Glass :
>> >> Hi,
>> >>
>> >> On 28 October 2014 11:46, Jeroen Hofstee  wrote:
>> >>> Hello Simon,
>> >>>
>> >>>
>> >>> On 28-10-14 18:33, Simon Glass wrote:
>> 
>>  Hi Masahiro,
>> 
>>  On 28 October 2014 10:38, Masahiro YAMADA 
>>  wrote:
>> >
>> > Hi Simon,
>> >
>> >
>> > 2014-10-29 1:29 GMT+09:00 Simon Glass :
>> >>
>> >> Hi Masahiro,
>> >>
>> >> On 28 October 2014 10:25, Masahiro YAMADA 
>> >> wrote:
>> >>>
>> >>> Hi Gabe, Simon,
>> >>>
>> >>>
>> >>> 2014-10-15 19:38 GMT+09:00 Simon Glass :
>> 
>>  From: Gabe Black 
>> 
>>  inttypes.h defines format specifiers for printf which work with data
>>  types of
>>  particular sizes. stdlib.h is currently just a passthrough to 
>>  malloc.h
>>  which
>>  has declarations of the various *alloc functions.
>> 
>>  Add the required #define to common.h so that these printf format
>>  specifiers
>>  will be made available.
>> 
>>  Signed-off-by: Gabe Black 
>>  Reviewed-by: Gabe Black 
>>  Tested-by: Gabe Black 
>>  Reviewed-by: Bill Richardson 
>>  Signed-off-by: Simon Glass 
>>  (Replaced with a GPL version from glibc)
>> 
>> >>> [snip]
>> 
>>  diff --git a/include/stdlib.h b/include/stdlib.h
>>  new file mode 100644
>>  index 000..6bc7fbb
>>  --- /dev/null
>>  +++ b/include/stdlib.h
>>  @@ -0,0 +1,12 @@
>>  +/*
>>  + *  Copyright (C) 2013 Google Inc.
>>  + *
>>  + * SPDX-License-Identifier:GPL-2.0+
>>  + */
>>  +
>>  +#ifndef __STDLIB_H_
>>  +#define __STDLIB_H_
>>  +
>>  +#include 
>>  +
>>  +#endif /* __STDLIB_H_ */
>>  --
>>  2.1.0.rc2.206.gedb03e5
>> >>>
>> >>>
>> >>> This patch is not clear to me.
>> >>>
>> >>> Why do we need include/stdlib.h ?
>> >>
>> >> This makes the U-Boot environment more similar to that used by other
>> >> software, so we can more easily build it without lots of glue files.
>> >> Normally stdlib.h defines malloc() and friends.
>> >
>> > I am not happy about this.
>> >
>> > Our right direction is to make U-Boot environment more similar to the
>> > Kernel, I think.
>> >
>> > stdlib.h shouldn't appear in bare metal code.
>> 
>>  That's right, we don't want to include this in U-Boot itself. But if
>>  you look at things in tools/ they include stdlib.h. With this header
>>  available, we can more easily compile external code into U-Boot.
>> >>>
>> >>>
>> >>> So is it intended as fallback if the host doesn't have a stdlib.h?
>> >>
>> >> Not really, more that for things that expect that header (and
>> >> inttypes.h which was also added) they can get it without needing
>> >> special #ifdefs for U-Boot.
>> >>
>> >
>> >
>> > Sorry, I still don't get it.
>> > Could you explain user cases?
>>
>> If you have a C file which has '#include  in it, because it
>> builds in another project as well as U-Boot, and needs mallloc(), then
>> you want to build it with U-Boot and include , etc. then you
>> need U-Boot to have stdlib.h, or add a dummy stdlib.h in that project.
>> I am trying to make is easier for this case. This is a minor point,
>> but little fish-hooks can be frustrating.
>>
>
> I understand what you want to do,
> but I am not sure if this is a right decision.
>
> Mixing the same header name sometimes causes a mess.

That's true although I don't really see a big issue here.

IMO image.c and the like suffer from having two sets of headers - one
for building in U-Boot and one for building outside. I thought maybe
the solution was do have a section in common.h to deal with the
differences, but then when I looked more I wasn't sure it was an
improvement...

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


[U-Boot] [PATCH v3 5/6] dm: sunxi: Modify the GPIO driver to support driver model

2014-10-30 Thread Simon Glass
This adds driver model support to the sunxi GPIO driver, using the device
tree to trigger binding of the driver. The driver will still operate
without driver model too.

Signed-off-by: Simon Glass 
---

Changes in v3:
- Put enabling of DM GPIO into sunxi-common.h

Changes in v2:
- Remove references to exynos and tegra
- Use the word 'bank' instead of 'port'

 drivers/gpio/sunxi_gpio.c  | 170 +
 include/configs/sunxi-common.h |   1 +
 2 files changed, 171 insertions(+)

diff --git a/drivers/gpio/sunxi_gpio.c b/drivers/gpio/sunxi_gpio.c
index 0c50a8f..44135e5 100644
--- a/drivers/gpio/sunxi_gpio.c
+++ b/drivers/gpio/sunxi_gpio.c
@@ -11,9 +11,25 @@
  */
 
 #include 
+#include 
+#include 
+#include 
+#include 
 #include 
 #include 
+#include 
 
+DECLARE_GLOBAL_DATA_PTR;
+
+#define SUNXI_GPIOS_PER_BANK   SUNXI_GPIO_A_NR
+
+struct sunxi_gpio_platdata {
+   struct sunxi_gpio *regs;
+   const char *bank_name;  /* Name of bank, e.g. "B" */
+   int gpio_count;
+};
+
+#ifndef CONFIG_DM_GPIO
 static int sunxi_gpio_output(u32 pin, u32 val)
 {
u32 dat;
@@ -100,3 +116,157 @@ int sunxi_name_to_gpio(const char *name)
return -1;
return group * 32 + pin;
 }
+#endif
+
+#ifdef CONFIG_DM_GPIO
+static int sunxi_gpio_direction_input(struct udevice *dev, unsigned offset)
+{
+   struct sunxi_gpio_platdata *plat = dev_get_platdata(dev);
+
+   sunxi_gpio_set_cfgbank(plat->regs, offset, SUNXI_GPIO_INPUT);
+
+   return 0;
+}
+
+static int sunxi_gpio_direction_output(struct udevice *dev, unsigned offset,
+  int value)
+{
+   struct sunxi_gpio_platdata *plat = dev_get_platdata(dev);
+   u32 num = GPIO_NUM(offset);
+
+   sunxi_gpio_set_cfgbank(plat->regs, offset, SUNXI_GPIO_OUTPUT);
+   clrsetbits_le32(&plat->regs->dat, 1 << num, value ? (1 << num) : 0);
+
+   return 0;
+}
+
+static int sunxi_gpio_get_value(struct udevice *dev, unsigned offset)
+{
+   struct sunxi_gpio_platdata *plat = dev_get_platdata(dev);
+   u32 num = GPIO_NUM(offset);
+   unsigned dat;
+
+   dat = readl(&plat->regs->dat);
+   dat >>= num;
+
+   return dat & 0x1;
+}
+
+static int sunxi_gpio_set_value(struct udevice *dev, unsigned offset,
+   int value)
+{
+   struct sunxi_gpio_platdata *plat = dev_get_platdata(dev);
+   u32 num = GPIO_NUM(offset);
+
+   clrsetbits_le32(&plat->regs->dat, 1 << num, value ? (1 << num) : 0);
+   return 0;
+}
+
+static int sunxi_gpio_get_function(struct udevice *dev, unsigned offset)
+{
+   struct sunxi_gpio_platdata *plat = dev_get_platdata(dev);
+   int func;
+
+   func = sunxi_gpio_get_cfgbank(plat->regs, offset);
+   if (func == SUNXI_GPIO_OUTPUT)
+   return GPIOF_OUTPUT;
+   else if (func == SUNXI_GPIO_INPUT)
+   return GPIOF_INPUT;
+   else
+   return GPIOF_FUNC;
+}
+
+static const struct dm_gpio_ops gpio_sunxi_ops = {
+   .direction_input= sunxi_gpio_direction_input,
+   .direction_output   = sunxi_gpio_direction_output,
+   .get_value  = sunxi_gpio_get_value,
+   .set_value  = sunxi_gpio_set_value,
+   .get_function   = sunxi_gpio_get_function,
+};
+
+/**
+ * Returns the name of a GPIO bank
+ *
+ * GPIO banks are named A, B, C, ...
+ *
+ * @bank:  Bank number (0, 1..n-1)
+ * @return allocated string containing the name
+ */
+static char *gpio_bank_name(int bank)
+{
+   char *name;
+
+   name = malloc(2);
+   if (name) {
+   name[0] = 'A' + bank;
+   name[1] = '\0';
+   }
+
+   return name;
+}
+
+static int gpio_sunxi_probe(struct udevice *dev)
+{
+   struct sunxi_gpio_platdata *plat = dev_get_platdata(dev);
+   struct gpio_dev_priv *uc_priv = dev->uclass_priv;
+
+   /* Tell the uclass how many GPIOs we have */
+   if (plat) {
+   uc_priv->gpio_count = plat->gpio_count;
+   uc_priv->bank_name = plat->bank_name;
+   }
+
+   return 0;
+}
+/**
+ * We have a top-level GPIO device with no actual GPIOs. It has a child
+ * device for each Sunxi bank.
+ */
+static int gpio_sunxi_bind(struct udevice *parent)
+{
+   struct sunxi_gpio_platdata *plat = parent->platdata;
+   struct sunxi_gpio_reg *ctlr;
+   int bank;
+   int ret;
+
+   /* If this is a child device, there is nothing to do here */
+   if (plat)
+   return 0;
+
+   ctlr = (struct sunxi_gpio_reg *)fdtdec_get_addr(gd->fdt_blob,
+  parent->of_offset, "reg");
+   for (bank = 0; bank < SUNXI_GPIO_BANKS; bank++) {
+   struct sunxi_gpio_platdata *plat;
+   struct udevice *dev;
+
+   plat = calloc(1, sizeof(*plat));
+   if (!plat)
+   return -ENOMEM;
+   plat->regs = &ctlr->gpio_bank[b

[U-Boot] [PATCH v3 2/6] dm: sunxi: Add a new config for an FDT-based pcDuino3

2014-10-30 Thread Simon Glass
For now we won't want to mess with the existing configurations. Create a
new one which will enable device tree and driver model. Note that this
brings the device tree binary into u-boot-sunxi-with-spl.bin.

Signed-off-by: Simon Glass 
---

Changes in v3:
- Move enabling of 'dm' command to sunxi-common.h

Changes in v2: None

 Makefile  | 3 ++-
 arch/arm/dts/Makefile | 1 +
 board/sunxi/MAINTAINERS   | 1 +
 configs/Linksprite_pcDuino3_fdt_defconfig | 8 
 include/configs/sunxi-common.h| 4 
 5 files changed, 16 insertions(+), 1 deletion(-)
 create mode 100644 configs/Linksprite_pcDuino3_fdt_defconfig

diff --git a/Makefile b/Makefile
index 26dacee..9c8a580 100644
--- a/Makefile
+++ b/Makefile
@@ -946,7 +946,8 @@ u-boot-nand.gph: u-boot.bin FORCE
 ifneq ($(CONFIG_SUNXI),)
 OBJCOPYFLAGS_u-boot-sunxi-with-spl.bin = -I binary -O binary \
   --pad-to=$(CONFIG_SPL_PAD_TO) --gap-fill=0xff
-u-boot-sunxi-with-spl.bin: spl/sunxi-spl.bin u-boot.img FORCE
+u-boot-sunxi-with-spl.bin: spl/sunxi-spl.bin \
+   u-boot$(if $(CONFIG_OF_CONTROL),-dtb,).img FORCE
$(call if_changed,pad_cat)
 endif
 
diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index c346063..7c7f7d8 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -1,3 +1,4 @@
+dtb-$(CONFIG_SUN7I) +=  sun7i-a20-pcduino3.dtb
 dtb-$(CONFIG_S5PC100) += s5pc1xx-smdkc100.dtb
 dtb-$(CONFIG_S5PC110) += s5pc1xx-goni.dtb
 dtb-$(CONFIG_EXYNOS4) += exynos4210-origen.dtb \
diff --git a/board/sunxi/MAINTAINERS b/board/sunxi/MAINTAINERS
index febd126..d624f52 100644
--- a/board/sunxi/MAINTAINERS
+++ b/board/sunxi/MAINTAINERS
@@ -22,6 +22,7 @@ F:configs/A20-OLinuXino_MICRO_defconfig
 F: configs/Bananapi_defconfig
 F: configs/i12-tvbox_defconfig
 F: configs/Linksprite_pcDuino3_defconfig
+F: configs/Linksprite_pcDuino3_fdt_defconfig
 F: configs/qt840a_defconfig
 
 CUBIEBOARD2 BOARD
diff --git a/configs/Linksprite_pcDuino3_fdt_defconfig 
b/configs/Linksprite_pcDuino3_fdt_defconfig
new file mode 100644
index 000..e5f6236
--- /dev/null
+++ b/configs/Linksprite_pcDuino3_fdt_defconfig
@@ -0,0 +1,8 @@
+CONFIG_SPL=y
+CONFIG_SYS_EXTRA_OPTIONS="PCDUINO3,AXP209_POWER,SUNXI_GMAC,AHCI,SATAPWR=SUNXI_GPH(2),USB_EHCI,DM"
+CONFIG_FDTFILE="sun7i-a20-pcduino3.dtb"
+CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-pcduino3"
+CONFIG_OF_CONTROL=y
+CONFIG_OF_SEPARATE=y
++S:CONFIG_ARM=y
++S:CONFIG_TARGET_SUN7I=y
diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h
index cc450e0..4d88991 100644
--- a/include/configs/sunxi-common.h
+++ b/include/configs/sunxi-common.h
@@ -27,6 +27,10 @@
 
 #define CONFIG_SYS_TEXT_BASE   0x4a00
 
+#if !defined(CONFIG_SPL_BUILD) && defined(CONFIG_DM)
+# define CONFIG_CMD_DM
+#endif
+
 /*
  * Display CPU information
  */
-- 
2.1.0.rc2.206.gedb03e5

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


[U-Boot] [PATCH v3 6/6] dm: sunxi: Add support for serial using driver model

2014-10-30 Thread Simon Glass
Add a driver for the designware serial UART used on sunxi. This just
redirects to the normal ns16550 driver.

Add a stdout-path to the device tree so that the correct UART is chosen.

Signed-off-by: Simon Glass 
---

Changes in v3:
- Rebase to master
- Move DM enable options to sunxi-common

Changes in v2:
- Split non-sunxi patches into a separate dependent series

 arch/arm/dts/sun7i-a20-pcduino3.dts |  4 
 drivers/serial/Makefile |  1 +
 drivers/serial/serial_dw.c  | 39 +
 include/configs/sunxi-common.h  | 17 ++--
 4 files changed, 55 insertions(+), 6 deletions(-)
 create mode 100644 drivers/serial/serial_dw.c

diff --git a/arch/arm/dts/sun7i-a20-pcduino3.dts 
b/arch/arm/dts/sun7i-a20-pcduino3.dts
index 046dfc0..f7cc8e7 100644
--- a/arch/arm/dts/sun7i-a20-pcduino3.dts
+++ b/arch/arm/dts/sun7i-a20-pcduino3.dts
@@ -20,6 +20,10 @@
model = "LinkSprite pcDuino3";
compatible = "linksprite,pcduino3", "allwinner,sun7i-a20";
 
+   chosen {
+   stdout-path = &uart0;
+   };
+
soc@01c0 {
mmc0: mmc@01c0f000 {
pinctrl-names = "default";
diff --git a/drivers/serial/Makefile b/drivers/serial/Makefile
index 2c19ebc..8c84942 100644
--- a/drivers/serial/Makefile
+++ b/drivers/serial/Makefile
@@ -19,6 +19,7 @@ obj-$(CONFIG_ALTERA_UART) += altera_uart.o
 obj-$(CONFIG_ALTERA_JTAG_UART) += altera_jtag_uart.o
 obj-$(CONFIG_ARM_DCC) += arm_dcc.o
 obj-$(CONFIG_ATMEL_USART) += atmel_usart.o
+obj-$(CONFIG_DW_SERIAL) += serial_dw.o
 obj-$(CONFIG_LPC32XX_HSUART) += lpc32xx_hsuart.o
 obj-$(CONFIG_MCFUART) += mcfuart.o
 obj-$(CONFIG_OPENCORES_YANU) += opencores_yanu.o
diff --git a/drivers/serial/serial_dw.c b/drivers/serial/serial_dw.c
new file mode 100644
index 000..a348f29
--- /dev/null
+++ b/drivers/serial/serial_dw.c
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2014 Google, Inc
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#include 
+#include 
+#include 
+#include 
+
+static const struct udevice_id dw_serial_ids[] = {
+   { .compatible = "snps,dw-apb-uart" },
+   { }
+};
+
+static int dw_serial_ofdata_to_platdata(struct udevice *dev)
+{
+   struct ns16550_platdata *plat = dev_get_platdata(dev);
+   int ret;
+
+   ret = ns16550_serial_ofdata_to_platdata(dev);
+   if (ret)
+   return ret;
+   plat->clock = CONFIG_SYS_NS16550_CLK;
+
+   return 0;
+}
+
+U_BOOT_DRIVER(serial_ns16550) = {
+   .name   = "serial_dw",
+   .id = UCLASS_SERIAL,
+   .of_match = dw_serial_ids,
+   .ofdata_to_platdata = dw_serial_ofdata_to_platdata,
+   .platdata_auto_alloc_size = sizeof(struct ns16550_platdata),
+   .priv_auto_alloc_size = sizeof(struct NS16550),
+   .probe = ns16550_serial_probe,
+   .ops= &ns16550_serial_ops,
+};
diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h
index 316e7d9..ce038ed 100644
--- a/include/configs/sunxi-common.h
+++ b/include/configs/sunxi-common.h
@@ -30,6 +30,9 @@
 #if !defined(CONFIG_SPL_BUILD) && defined(CONFIG_DM)
 # define CONFIG_CMD_DM
 # define CONFIG_DM_GPIO
+# define CONFIG_DM_SERIAL
+# define CONFIG_DW_SERIAL
+# define CONFIG_SYS_MALLOC_F_LEN   (1 << 10)
 #endif
 
 /*
@@ -41,13 +44,15 @@
 #define CONFIG_SYS_NS16550
 #define CONFIG_SYS_NS16550_SERIAL
 /* ns16550 reg in the low bits of cpu reg */
-#define CONFIG_SYS_NS16550_REG_SIZE-4
 #define CONFIG_SYS_NS16550_CLK 2400
-#define CONFIG_SYS_NS16550_COM1SUNXI_UART0_BASE
-#define CONFIG_SYS_NS16550_COM2SUNXI_UART1_BASE
-#define CONFIG_SYS_NS16550_COM3SUNXI_UART2_BASE
-#define CONFIG_SYS_NS16550_COM4SUNXI_UART3_BASE
-#define CONFIG_SYS_NS16550_COM5SUNXI_R_UART_BASE
+#ifndef CONFIG_DM_SERIAL
+# define CONFIG_SYS_NS16550_REG_SIZE   -4
+# define CONFIG_SYS_NS16550_COM1   SUNXI_UART0_BASE
+# define CONFIG_SYS_NS16550_COM2   SUNXI_UART1_BASE
+# define CONFIG_SYS_NS16550_COM3   SUNXI_UART2_BASE
+# define CONFIG_SYS_NS16550_COM4   SUNXI_UART3_BASE
+# define CONFIG_SYS_NS16550_COM5   SUNXI_R_UART_BASE
+#endif
 
 /* DRAM Base */
 #define CONFIG_SYS_SDRAM_BASE  0x4000
-- 
2.1.0.rc2.206.gedb03e5

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


[U-Boot] [PATCH v3 1/6] dm: sunxi: dts: Add sun7i device tree files

2014-10-30 Thread Simon Glass
These are from Linux 3.17-rc7 (commit fe82dcec). U-Boot only uses a small
portion of these, but we may as well have something to look forward to.

The total compiled size is about 25KB.

Acked-by: Hans de Goede 
Signed-off-by: Simon Glass 
---

Changes in v3: None
Changes in v2: None

 arch/arm/dts/sun7i-a20-pcduino3.dts   | 173 ++
 arch/arm/dts/sun7i-a20.dtsi   | 988 ++
 arch/arm/dts/sunxi-common-regulators.dtsi |  89 +++
 include/dt-bindings/input/input.h | 525 
 4 files changed, 1775 insertions(+)
 create mode 100644 arch/arm/dts/sun7i-a20-pcduino3.dts
 create mode 100644 arch/arm/dts/sun7i-a20.dtsi
 create mode 100644 arch/arm/dts/sunxi-common-regulators.dtsi
 create mode 100644 include/dt-bindings/input/input.h

diff --git a/arch/arm/dts/sun7i-a20-pcduino3.dts 
b/arch/arm/dts/sun7i-a20-pcduino3.dts
new file mode 100644
index 000..046dfc0
--- /dev/null
+++ b/arch/arm/dts/sun7i-a20-pcduino3.dts
@@ -0,0 +1,173 @@
+/*
+ * Copyright 2014 Zoltan HERPAI
+ * Zoltan HERPAI 
+ *
+ * The code contained herein is licensed under the GNU General Public
+ * License. You may obtain a copy of the GNU General Public License
+ * Version 2 or later at the following locations:
+ *
+ * http://www.opensource.org/licenses/gpl-license.html
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+
+/dts-v1/;
+/include/ "sun7i-a20.dtsi"
+/include/ "sunxi-common-regulators.dtsi"
+#include 
+#include 
+
+/ {
+   model = "LinkSprite pcDuino3";
+   compatible = "linksprite,pcduino3", "allwinner,sun7i-a20";
+
+   soc@01c0 {
+   mmc0: mmc@01c0f000 {
+   pinctrl-names = "default";
+   pinctrl-0 = <&mmc0_pins_a>, 
<&mmc0_cd_pin_reference_design>;
+   vmmc-supply = <®_vcc3v3>;
+   bus-width = <4>;
+   cd-gpios = <&pio 7 1 0>; /* PH1 */
+   cd-inverted;
+   status = "okay";
+   };
+
+   usbphy: phy@01c13400 {
+   usb1_vbus-supply = <®_usb1_vbus>;
+   usb2_vbus-supply = <®_usb2_vbus>;
+   status = "okay";
+   };
+
+   ehci0: usb@01c14000 {
+   status = "okay";
+   };
+
+   ohci0: usb@01c14400 {
+   status = "okay";
+   };
+
+   ahci: sata@01c18000 {
+   target-supply = <®_ahci_5v>;
+   status = "okay";
+   };
+
+   ehci1: usb@01c1c000 {
+   status = "okay";
+   };
+
+   ohci1: usb@01c1c400 {
+   status = "okay";
+   };
+
+   pinctrl@01c20800 {
+   ahci_pwr_pin_a: ahci_pwr_pin@0 {
+   allwinner,pins = "PH2";
+   };
+
+   led_pins_pcduino3: led_pins@0 {
+   allwinner,pins = "PH15", "PH16";
+   allwinner,function = "gpio_out";
+   allwinner,drive = <0>;
+   allwinner,pull = <0>;
+   };
+
+   key_pins_pcduino3: key_pins@0 {
+   allwinner,pins = "PH17", "PH18", "PH19";
+   allwinner,function = "gpio_in";
+   allwinner,drive = <0>;
+   allwinner,pull = <0>;
+   };
+   };
+
+   ir0: ir@01c21800 {
+   pinctrl-names = "default";
+   pinctrl-0 = <&ir0_pins_a>;
+   status = "okay";
+   };
+
+   uart0: serial@01c28000 {
+   pinctrl-names = "default";
+   pinctrl-0 = <&uart0_pins_a>;
+   status = "okay";
+   };
+
+   i2c0: i2c@01c2ac00 {
+   pinctrl-names = "default";
+   pinctrl-0 = <&i2c0_pins_a>;
+   status = "okay";
+
+   axp209: pmic@34 {
+   compatible = "x-powers,axp209";
+   reg = <0x34>;
+   interrupt-parent = <&nmi_intc>;
+   interrupts = <0 8>;
+
+   interrupt-controller;
+   #interrupt-cells = <1>;
+   };
+   };
+
+   gmac: ethernet@01c5 {
+   pinctrl-names = "default";
+   pinctrl-0 = <&gmac_pins_mii_a>;
+   phy = <&phy1>;
+   phy-mode = "mii";
+   status = "okay";
+
+   phy1: ethernet-phy@1 {
+

[U-Boot] [PATCH v3 3/6] dm: sunxi: Add pinmux functions which take a bank parameter

2014-10-30 Thread Simon Glass
With driver model we will have access to a bank pointer, so we want to
use it rather than converting back to a number, and then back to a
bank pointer. Add functions to provide this feature.

Signed-off-by: Simon Glass 
Acked-by: Hans de Goede 
---

Changes in v3: None
Changes in v2: None

 arch/arm/cpu/armv7/sunxi/pinmux.c  | 32 +---
 arch/arm/include/asm/arch-sunxi/gpio.h |  4 +++-
 2 files changed, 24 insertions(+), 12 deletions(-)

diff --git a/arch/arm/cpu/armv7/sunxi/pinmux.c 
b/arch/arm/cpu/armv7/sunxi/pinmux.c
index 1f2843f..b026f78 100644
--- a/arch/arm/cpu/armv7/sunxi/pinmux.c
+++ b/arch/arm/cpu/armv7/sunxi/pinmux.c
@@ -10,32 +10,42 @@
 #include 
 #include 
 
-int sunxi_gpio_set_cfgpin(u32 pin, u32 val)
+void sunxi_gpio_set_cfgbank(struct sunxi_gpio *pio, int bank_offset, u32 val)
 {
-   u32 bank = GPIO_BANK(pin);
-   u32 index = GPIO_CFG_INDEX(pin);
-   u32 offset = GPIO_CFG_OFFSET(pin);
-   struct sunxi_gpio *pio = BANK_TO_GPIO(bank);
+   u32 index = GPIO_CFG_INDEX(bank_offset);
+   u32 offset = GPIO_CFG_OFFSET(bank_offset);
 
clrsetbits_le32(&pio->cfg[0] + index, 0xf << offset, val << offset);
-
-   return 0;
 }
 
-int sunxi_gpio_get_cfgpin(u32 pin)
+void sunxi_gpio_set_cfgpin(u32 pin, u32 val)
 {
-   u32 cfg;
u32 bank = GPIO_BANK(pin);
-   u32 index = GPIO_CFG_INDEX(pin);
-   u32 offset = GPIO_CFG_OFFSET(pin);
struct sunxi_gpio *pio = BANK_TO_GPIO(bank);
 
+   sunxi_gpio_set_cfgbank(pio, pin, val);
+}
+
+int sunxi_gpio_get_cfgbank(struct sunxi_gpio *pio, int bank_offset)
+{
+   u32 index = GPIO_CFG_INDEX(bank_offset);
+   u32 offset = GPIO_CFG_OFFSET(bank_offset);
+   u32 cfg;
+
cfg = readl(&pio->cfg[0] + index);
cfg >>= offset;
 
return cfg & 0xf;
 }
 
+int sunxi_gpio_get_cfgpin(u32 pin)
+{
+   u32 bank = GPIO_BANK(pin);
+   struct sunxi_gpio *pio = BANK_TO_GPIO(bank);
+
+   return sunxi_gpio_get_cfgbank(pio, pin);
+}
+
 int sunxi_gpio_set_drv(u32 pin, u32 val)
 {
u32 bank = GPIO_BANK(pin);
diff --git a/arch/arm/include/asm/arch-sunxi/gpio.h 
b/arch/arm/include/asm/arch-sunxi/gpio.h
index 7bb6499..989ad80 100644
--- a/arch/arm/include/asm/arch-sunxi/gpio.h
+++ b/arch/arm/include/asm/arch-sunxi/gpio.h
@@ -180,7 +180,9 @@ enum sunxi_gpio_number {
 #define SUNXI_GPIO_PULL_UP 1
 #define SUNXI_GPIO_PULL_DOWN   2
 
-int sunxi_gpio_set_cfgpin(u32 pin, u32 val);
+void sunxi_gpio_set_cfgbank(struct sunxi_gpio *pio, int bank_offset, u32 val);
+void sunxi_gpio_set_cfgpin(u32 pin, u32 val);
+int sunxi_gpio_get_cfgbank(struct sunxi_gpio *pio, int bank_offset);
 int sunxi_gpio_get_cfgpin(u32 pin);
 int sunxi_gpio_set_drv(u32 pin, u32 val);
 int sunxi_gpio_set_pull(u32 pin, u32 val);
-- 
2.1.0.rc2.206.gedb03e5

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


[U-Boot] [PATCH v3 4/6] dm: sunxi: Make sure that GPIOs are requested

2014-10-30 Thread Simon Glass
The scsi_init() function uses a GPIO so should request it. There is no
way to return an error here, and the request may be made multiple times,
so just ignore errors for now.

Signed-off-by: Simon Glass 
Acked-by: Hans de Goede 
---

Changes in v3: None
Changes in v2: None

 board/sunxi/ahci.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/board/sunxi/ahci.c b/board/sunxi/ahci.c
index 0c262ea..5e12328 100644
--- a/board/sunxi/ahci.c
+++ b/board/sunxi/ahci.c
@@ -74,6 +74,7 @@ void scsi_init(void)
 {
printf("SUNXI SCSI INIT\n");
 #ifdef CONFIG_SATAPWR
+   gpio_request(CONFIG_SATAPWR, "satapwr");
gpio_direction_output(CONFIG_SATAPWR, 1);
 #endif
 
-- 
2.1.0.rc2.206.gedb03e5

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


[U-Boot] [PATCH v3 0/6] dm: Introduce driver model for sunxi

2014-10-30 Thread Simon Glass
This series adds driver model support for serial and GPIO for sunxi. Since
I only have a sun7i board to test with, I have added a new config for the
pcDuino3, which uses device tree and driver model. This should make it
fairly easy to enable for the other boards at some point.

This series is available at u-boot-dm/sunix-working.

Changes in v3:
- Move enabling of 'dm' command to sunxi-common.h
- Put enabling of DM GPIO into sunxi-common.h
- Rebase to master
- Move DM enable options to sunxi-common

Changes in v2:
- Remove references to exynos and tegra
- Use the word 'bank' instead of 'port'
- Split non-sunxi patches into a separate dependent series

Simon Glass (6):
  dm: sunxi: dts: Add sun7i device tree files
  dm: sunxi: Add a new config for an FDT-based pcDuino3
  dm: sunxi: Add pinmux functions which take a bank parameter
  dm: sunxi: Make sure that GPIOs are requested
  dm: sunxi: Modify the GPIO driver to support driver model
  dm: sunxi: Add support for serial using driver model

 Makefile  |   3 +-
 arch/arm/cpu/armv7/sunxi/pinmux.c |  32 +-
 arch/arm/dts/Makefile |   1 +
 arch/arm/dts/sun7i-a20-pcduino3.dts   | 177 ++
 arch/arm/dts/sun7i-a20.dtsi   | 988 ++
 arch/arm/dts/sunxi-common-regulators.dtsi |  89 +++
 arch/arm/include/asm/arch-sunxi/gpio.h|   4 +-
 board/sunxi/MAINTAINERS   |   1 +
 board/sunxi/ahci.c|   1 +
 configs/Linksprite_pcDuino3_fdt_defconfig |   8 +
 drivers/gpio/sunxi_gpio.c | 170 +
 drivers/serial/Makefile   |   1 +
 drivers/serial/serial_dw.c|  39 ++
 include/configs/sunxi-common.h|  22 +-
 include/dt-bindings/input/input.h | 525 
 15 files changed, 2042 insertions(+), 19 deletions(-)
 create mode 100644 arch/arm/dts/sun7i-a20-pcduino3.dts
 create mode 100644 arch/arm/dts/sun7i-a20.dtsi
 create mode 100644 arch/arm/dts/sunxi-common-regulators.dtsi
 create mode 100644 configs/Linksprite_pcDuino3_fdt_defconfig
 create mode 100644 drivers/serial/serial_dw.c
 create mode 100644 include/dt-bindings/input/input.h

-- 
2.1.0.rc2.206.gedb03e5

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


[U-Boot] [PATCH v2] kbuild: do not hide clang warnings during build with W=1

2014-10-30 Thread Masahiro Yamada
These lines originate in Linux;  it looks like Linux folks chose to
hide bunch of warnings reported by clang rather than fixing C code.

In U-boot, warnings are being fixed thanks to Jeroen's great efforts.
Let's stop suppressing clang warnings.

Signed-off-by: Masahiro Yamada 
Cc: Jeroen Hofstee 
---

Changes in v2:
  - Rephrase commit summary and description for clarification

 scripts/Makefile.extrawarn | 10 --
 1 file changed, 10 deletions(-)

diff --git a/scripts/Makefile.extrawarn b/scripts/Makefile.extrawarn
index 6564350..0ec0d24 100644
--- a/scripts/Makefile.extrawarn
+++ b/scripts/Makefile.extrawarn
@@ -26,16 +26,6 @@ warning-1 += $(call cc-option, -Wmissing-include-dirs)
 warning-1 += $(call cc-option, -Wunused-but-set-variable)
 warning-1 += $(call cc-disable-warning, missing-field-initializers)
 
-# Clang
-warning-1 += $(call cc-disable-warning, initializer-overrides)
-warning-1 += $(call cc-disable-warning, unused-value)
-warning-1 += $(call cc-disable-warning, format)
-warning-1 += $(call cc-disable-warning, unknown-warning-option)
-warning-1 += $(call cc-disable-warning, sign-compare)
-warning-1 += $(call cc-disable-warning, format-zero-length)
-warning-1 += $(call cc-disable-warning, uninitialized)
-warning-1 += $(call cc-option, -fcatch-undefined-behavior)
-
 warning-2 := -Waggregate-return
 warning-2 += -Wcast-align
 warning-2 += -Wdisabled-optimization
-- 
1.9.1

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


Re: [U-Boot] [v2 PATCH 10/12] arm, spl, at91: add at91sam9260 and at91sam9g45 spl support

2014-10-30 Thread Bo Shen

Hi Heiko,

On 10/30/2014 07:41 PM, Heiko Schocher wrote:

Hello Bo,

Am 30.10.2014 11:17, schrieb Bo Shen:

Hi Heiko,

On 10/30/2014 04:15 PM, Heiko Schocher wrote:

diff --git a/arch/arm/include/asm/arch-at91/at91_pmc.h
b/arch/arm/include/asm/arch-at91/at91_pmc.h
index 27331ff..5f64583 100644
--- a/arch/arm/include/asm/arch-at91/at91_pmc.h
+++ b/arch/arm/include/asm/arch-at91/at91_pmc.h
@@ -95,7 +95,7 @@ typedef struct at91_pmc {
#define AT91_PMC_MCKR_CSS_MAIN 0x0001
#define AT91_PMC_MCKR_CSS_PLLA 0x0002
#define AT91_PMC_MCKR_CSS_PLLB 0x0003
-#define AT91_PMC_MCKR_CSS_MASK 0x0003
+#define AT91_PMC_MCKR_CSS_MASK 0x0007


Where this come from, CSS only two bits.


Good question ... looked again into the doc, it is only two bits.




#ifdef CONFIG_SAMA5D3
#define AT91_PMC_MCKR_PRES_1 0x
@@ -114,7 +114,7 @@ typedef struct at91_pmc {
#define AT91_PMC_MCKR_PRES_16 0x0010
#define AT91_PMC_MCKR_PRES_32 0x0014
#define AT91_PMC_MCKR_PRES_64 0x0018
-#define AT91_PMC_MCKR_PRES_MASK 0x001C
+#define AT91_PMC_MCKR_PRES_MASK 0x003C


Ditto


Hmm... no idea, why I changed this ... good catch!

Is the rest of the patch (and the patchserie OK) ?


Except one suggestion and nitpick sent just now, the rest patch seems good.
For this whole series:
Reviewed-by: Bo Shen 


Then I can send a v3 ...

bye,
Heiko


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


Re: [U-Boot] [v2 PATCH 03/12] arm, at91, mpddrc: fix typo in ddr2_init()

2014-10-30 Thread Bo Shen

Hi Heiko,

On 10/30/2014 04:14 PM, Heiko Schocher wrote:

use the configure value for computing the ba_off value
not the value from the cr register. This leaded in a
wrong ram configuration on the upcoming corvus spl board
support.

Signed-off-by: Heiko Schocher 
Reviewed-by: Andreas Bießmann 

---

Changes in v2:
   add Reviewed-by: Andreas Bießmann 

  arch/arm/cpu/at91-common/mpddrc.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm/cpu/at91-common/mpddrc.c 
b/arch/arm/cpu/at91-common/mpddrc.c
index 8136396..76668d2 100644
--- a/arch/arm/cpu/at91-common/mpddrc.c
+++ b/arch/arm/cpu/at91-common/mpddrc.c
@@ -26,7 +26,8 @@ int ddr2_init(const unsigned int ram_address,
/* Compute bank offset according to NC in configuration register */
ba_off = (mpddr_value->cr & ATMEL_MPDDRC_CR_NC_MASK) + 9;
if (!(mpddr_value->cr & ATMEL_MPDDRC_CR_DECOD_INTERLEAVED))
-   ba_off += ((mpddr->cr & ATMEL_MPDDRC_CR_NR_MASK) >> 2) + 11;
+   ba_off += ((mpddr_value->cr & ATMEL_MPDDRC_CR_NR_MASK) >> 2)
+  + 11;


As Andreas suggested, can we ignore the 80 character's warning here?


ba_off += (mpddr_value->md & ATMEL_MPDDRC_MD_DBW_MASK) ? 1 : 2;




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


Re: [U-Boot] [v2 PATCH 10/12] arm, spl, at91: add at91sam9260 and at91sam9g45 spl support

2014-10-30 Thread Bo Shen

Hi Heiko,

On 10/30/2014 04:15 PM, Heiko Schocher wrote:

diff --git a/arch/arm/cpu/at91-common/spl.c b/arch/arm/cpu/at91-common/spl.c
index 674a470..5c9a3ad 100644
--- a/arch/arm/cpu/at91-common/spl.c
+++ b/arch/arm/cpu/at91-common/spl.c


I am thinking, whether it be better to keep this file as two copy? This 
will remove #ifdef, although a little code duplication.


If this solution acceptable, some suggestion as following:
  - for armv5 (arm926ejs, now at91 series), named it spl_at91.c,
  - for armv7 (cortex-a5, now, sama5d3), named it spl_atmel.c?
(As for arm9 series, we have at91 prefix for SoC name, and for armv7 
SoC, we don't have at91 prefix, and it now changed to Atmel Smart)



@@ -8,11 +8,18 @@
  #include 
  #include 
  #include 
+#if !defined(CONFIG_SAMA5D3)
+#include 
+#endif
+#include 
  #include 
+#include 
  #include 
  #include 
  #include 

+DECLARE_GLOBAL_DATA_PTR;
+
  static void at91_disable_wdt(void)
  {
struct at91_wdt *wdt = (struct at91_wdt *)ATMEL_BASE_WDT;
@@ -20,6 +27,33 @@ static void at91_disable_wdt(void)
writel(AT91_WDT_MR_WDDIS, &wdt->mr);
  }

+u32 spl_boot_device(void)
+{
+#ifdef CONFIG_SYS_USE_MMC
+   return BOOT_DEVICE_MMC1;
+#elif CONFIG_SYS_USE_NANDFLASH
+   return BOOT_DEVICE_NAND;
+#elif CONFIG_SYS_USE_SERIALFLASH
+   return BOOT_DEVICE_SPI;
+#endif
+   return BOOT_DEVICE_NONE;
+}
+
+u32 spl_boot_mode(void)
+{
+   switch (spl_boot_device()) {
+#ifdef CONFIG_SYS_USE_MMC
+   case BOOT_DEVICE_MMC1:
+   return MMCSD_MODE_FS;
+   break;
+#endif
+   case BOOT_DEVICE_NONE:
+   default:
+   hang();
+   }
+}
+
+#if defined(CONFIG_SAMA5D3)
  static void switch_to_main_crystal_osc(void)
  {
struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC;
@@ -57,77 +91,134 @@ static void switch_to_main_crystal_osc(void)
writel(tmp, &pmc->mor);
  }

-void at91_plla_init(u32 pllar)
+void s_init(void)
  {
-   struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC;
+   switch_to_main_crystal_osc();

-   writel(pllar, &pmc->pllar);
-   while (!(readl(&pmc->sr) & (AT91_PMC_LOCKA | AT91_PMC_MCKRDY)))
-   ;
-}
+   /* disable watchdog */
+   at91_disable_wdt();

-void at91_mck_init(u32 mckr)
-{
-   struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC;
-   u32 tmp;
+   /* PMC configuration */
+   at91_pmc_init();

-   tmp = readl(&pmc->mckr);
-   tmp &= ~(AT91_PMC_MCKR_PRES_MASK |
-AT91_PMC_MCKR_MDIV_MASK |
-AT91_PMC_MCKR_PLLADIV_2);
-   tmp |= mckr & (AT91_PMC_MCKR_PRES_MASK |
-  AT91_PMC_MCKR_MDIV_MASK |
-  AT91_PMC_MCKR_PLLADIV_2);
-   writel(tmp, &pmc->mckr);
+   at91_clock_init(CONFIG_SYS_AT91_MAIN_CLOCK);

-   while (!(readl(&pmc->sr) & AT91_PMC_MCKRDY))
-   ;
-}
+   timer_init();

+   board_early_init_f();

-u32 spl_boot_device(void)
+   preloader_console_init();
+
+   mem_init();
+}
+#else
+static void enable_ext_reset(void)
  {
-#ifdef CONFIG_SYS_USE_MMC
-   return BOOT_DEVICE_MMC1;
-#elif CONFIG_SYS_USE_NANDFLASH
-   return BOOT_DEVICE_NAND;
-#elif CONFIG_SYS_USE_SERIALFLASH
-   return BOOT_DEVICE_SPI;
-#endif
-   return BOOT_DEVICE_NONE;
+   struct at91_rstc *rstc = (struct at91_rstc *)ATMEL_BASE_RSTC;
+
+   writel(AT91_RSTC_KEY | AT91_RSTC_MR_URSTEN, &rstc->mr);
  }

-u32 spl_boot_mode(void)
+#if defined(CONFIG_ATMEL_MATRIX_INIT)
+static void matrix_init(void)
  {
-   switch (spl_boot_device()) {
-#ifdef CONFIG_SYS_USE_MMC
-   case BOOT_DEVICE_MMC1:
-   return MMCSD_MODE_FS;
-   break;
+   struct at91_matrix *mat = (struct at91_matrix *)ATMEL_BASE_MATRIX;
+
+   writel((readl(&mat->scfg[3]) & (~AT91_MATRIX_SLOT_CYCLE))
+   | AT91_MATRIX_SLOT_CYCLE_(0x40),
+   &mat->scfg[3]);
+}
  #endif
-   case BOOT_DEVICE_NONE:
-   default:
-   hang();
+
+void lowlevel_clock_init(void)
+{
+   struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC;
+
+   if (!(readl(&pmc->sr) & AT91_PMC_MOSCS)) {
+   /* Enable Main Oscillator */
+   writel(AT91_PMC_MOSCS | (0x40 << 8), &pmc->mor);
+
+   /* Wait until Main Oscillator is stable */
+   while (!(readl(&pmc->sr) & AT91_PMC_MOSCS))
+   ;
}
+
+   /* After stabilization, switch to Main Oscillator */
+   if ((readl(&pmc->mckr) & AT91_PMC_CSS) == AT91_PMC_CSS_SLOW) {
+   unsigned long tmp;
+
+   tmp = readl(&pmc->mckr);
+   tmp &= ~AT91_PMC_CSS;
+   tmp |= AT91_PMC_CSS_MAIN;
+   writel(tmp, &pmc->mckr);
+   while (!(readl(&pmc->sr) & AT91_PMC_MCKRDY))
+   ;
+
+   tmp &= ~AT91_PMC_PRES;
+   tmp |= AT91_PMC_PRES_1;
+   writel(tmp, &pmc->m

Re: [U-Boot] [PATCH v4] powerpc/mpc85xx: modify erratum A007186

2014-10-30 Thread qiang.z...@freescale.com
Got it!

Best Regards
Zhao Qiang


> -Original Message-
> From: Sun York-R58495
> Sent: Friday, October 31, 2014 12:16 AM
> To: Zhao Qiang-B45475; u-boot@lists.denx.de
> Cc: Xie Xiaobo-R63061
> Subject: Re: [PATCH v4] powerpc/mpc85xx: modify erratum A007186
> 
> On 10/29/2014 11:07 PM, Zhao Qiang wrote:
> > T2080 v1.0 has this errata while v1.1 has fixed this errata by
> > hardware, add a new function has_errata_a007186 to check the
> > SVR_SOC_VER, SVR_MAJ and SVR_MIN first, if the sil has errata a007186,
> > then run the errata code, if not, doesn't run the code.
> >
> > Signed-off-by: Zhao Qiang 
> > Change-Id: I19d794283229a86d04d8f22d44b860a5c3940cdc
> > Reviewed-on: http://git.am.freescale.net:8181/19850
> > Tested-by: Review Code-CDREVIEW 
> > Reviewed-by: Yusong Sun 
> > ---
> 
> For future patches, please remove internal review information. It's not
> accessible for folks outside of Freescale.
> 
> York

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


Re: [U-Boot] [PATCH v4 05/29] dm: spi: Add a uclass for SPI

2014-10-30 Thread Simon Glass
Hi Stefan,

On 29 October 2014 22:38, Stefan Roese  wrote:
> Hi Simon,
>
> On 30.10.2014 02:43, Simon Glass wrote:
>>>
>>> In my case I'm implementing the Designware master SPI driver for the
>>> SoCFPGA. And since its a new driver it really makes sense to use DM
>>> directly. I'm starting to get an overview now. One thing though that I
>>> noticed is, that the SPI DM implementation seems to be a bit FDT centric.
>>> Please see below.
>>>
>>> 
>>>
 diff --git a/drivers/spi/spi-uclass.c b/drivers/spi/spi-uclass.c
>>>
>>>
>>> 
>>>
 +int spi_post_bind(struct udevice *dev)
 +{
 +   /* Scan the bus for devices */
 +   return dm_scan_fdt_node(dev, gd->fdt_blob, dev->of_offset,
 false);
 +}
>>>
>>>
>>>
>>> SoCFPGA currently does not support CONFIG_OF_CONTROL (no dtb supplied).
>>> So
>>
>>
>> In the kernel I see these files - are you sure it is not supported?
>>
>> arch/arm/boot/dts/socfpga_arria5.dtsi
>> arch/arm/boot/dts/socfpga_arria5_socdk.dts
>> arch/arm/boot/dts/socfpga_cyclone5.dtsi
>> arch/arm/boot/dts/socfpga_cyclone5_socdk.dts
>> arch/arm/boot/dts/socfpga_cyclone5_sockit.dts
>> arch/arm/boot/dts/socfpga_cyclone5_socrates.dts
>> arch/arm/boot/dts/socfpga.dtsi
>> arch/arm/boot/dts/socfpga_vt.dts
>
>
> Sure. In the kernel dts is supported. Only U-Boot for SoCFPGA has no DT
> support (right now).
>
>>> I'm planning to use platform_data to instantiate the device. Something
>>> like
>>> this in the board file:
>>>
>>> static const struct dw_spi_platdata spi_platdata = {
>>>  .base = SOCFPGA_SPIM0_ADDRESS,
>>> };
>>>
>>> U_BOOT_DEVICE(dw_spi) = {
>>>  .name = "dw_spi",
>>>  .platdata = &spi_platdata,
>>> };
>>>
>>> What would the non-fdt method have to be to bind the device in
>>> spi_post_bind() above?
>>
>>
>> We would have to create a new platform data structure that holds the
>> bus number, CS number and any other information. Then it will need to
>> cause spi_get_bus_and_cs() to locate it and do the right.
>>
>> But first let's make sure that you really do have the platform that
>> doesn't use device tree... If it is ARM my understanding is that it
>> should.
>
>
> It does. In the kernel. I think I'll dive into adding DT support for SoCFPGA
> for a few hours. Perhaps thats even easier than adding platform-data support
> to the SPI DM. Lets see how this goes...

Good luck. If you use CONFIG_OF_SEPARATE you will get u-boot-dtb.bin
and hopefully it will just work. For CONFIG_OF_EMBED I see a bug was
introduced so I need to do a patch for that.

>
>> Also see the SPI driver spi-howto.txt.
>
>
> Thanks,
> Stefan
>

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


Re: [U-Boot] [BUG] kwimage v0 broken

2014-10-30 Thread drEagle
On 30/10/2014 20:46, Prafulla Wadaskar wrote:

Hi all,

I have compared the latest kwimage and the oldest one.

I have found some minor differences that make my sheevaplugs flashing and 
u-booting again.

>> -Original Message-
>> From: u-boot-boun...@lists.denx.de [mailto:u-boot-
>> boun...@lists.denx.de] On Behalf Of drEagle
>> Sent: 30 October 2014 20:15
>> To: Stefan Roese; Luka Perkov
>> Cc: u-boot@lists.denx.de
>> Subject: Re: [U-Boot] [BUG] kwimage v0 broken
>>
>> On 27/10/2014 08:18, Stefan Roese wrote:
>>> Hi!
>>>
>>> On 25.10.2014 07:59, drEagle wrote:
 With the latest u-boot mainline from denx git, the
>> kirkwood image old version/format are broken;
 Sheevaplug u-boot.kwb is no more flahsable and brick
>> the plug.

 Using an older mkimage version still work with the
>> same u-boot binary.

 u-boot (in elf loading mode) still work well also.

 If I can help by some tests, please feel free to
>> ask.

 PS: I'm not on the list, thans to cc me.
>>>
>>> Hmmm. I have no access to a mainlined Kirkwood board
>> right now. So I can't really test right now. I added
>> Luka to Cc, as he did some testing on this patch series
>> a few weeks ago. And IIRC, he didn't experience any
>> such problems with the kwimage tool.
> 
> Hmm... We must fix this asap.
> Can someone post the patch?

A quick patch was sent to the list.

Enjoy,
Gérald




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


[U-Boot] [PATCH 3/3] ARM: kwimage: fix v0 format

2014-10-30 Thread Gerald Kerma
This patch fix the kwimage tools for version 0 fileformat used for kirkwood
Tested on sheevaplug

Signed-off-by: Gerald Kerma 
---
 tools/kwbimage.c | 10 ++
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/tools/kwbimage.c b/tools/kwbimage.c
index 1120e9b..7e2fb5e 100644
--- a/tools/kwbimage.c
+++ b/tools/kwbimage.c
@@ -324,7 +324,7 @@ static void *image_create_v0(size_t *imagesz, struct 
image_tool_params *params,
main_hdr = image;
 
/* Fill in the main header */
-   main_hdr->blocksize = payloadsz + sizeof(uint32_t);
+   main_hdr->blocksize = payloadsz + sizeof(uint32_t) - headersz;
main_hdr->srcaddr   = headersz;
main_hdr->ext   = has_ext;
main_hdr->destaddr  = params->addr;
@@ -792,8 +792,8 @@ static void kwbimage_print_header(const void *ptr)
 
printf("Image Type:   MVEBU Boot from %s Image\n",
   image_boot_mode_name(mhdr->blockid));
-   printf("Data Size:");
printf("Image version:%d\n", image_version((void *)ptr));
+   printf("Data Size:");
genimg_print_size(mhdr->blocksize - sizeof(uint32_t));
printf("Load Address: %08x\n", mhdr->destaddr);
printf("Entry Point:  %08x\n", mhdr->execaddr);
@@ -816,7 +816,8 @@ static int kwbimage_verify_header(unsigned char *ptr, int 
image_size,
 
main_hdr = (void *)ptr;
checksum = image_checksum8(ptr,
-  sizeof(struct main_hdr_v0));
+  sizeof(struct main_hdr_v0)
+  - sizeof(uint8_t));
if (checksum != main_hdr->checksum)
return -FDT_ERR_BADSTRUCTURE;
 
@@ -824,7 +825,8 @@ static int kwbimage_verify_header(unsigned char *ptr, int 
image_size,
if (image_version((void *)ptr) == 0) {
ext_hdr = (void *)ptr + sizeof(struct main_hdr_v0);
checksum = image_checksum8(ext_hdr,
-  sizeof(struct ext_hdr_v0));
+  sizeof(struct ext_hdr_v0)
+  - sizeof(uint8_t));
if (checksum != ext_hdr->checksum)
return -FDT_ERR_BADSTRUCTURE;
}
-- 
1.9.1

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


[U-Boot] Pull request: u-boot-staging

2014-10-30 Thread Anatolij Gustschin
Hey Tom,

The following changes since commit 571bdf16a78e9e116a93d46f4809c4f8a3f2adb6:

  arm: interrupt_init: set sp in IRQ/FIQ modes (2014-10-29 09:03:28 -0400)

are available in the git repository at:

  git://git.denx.de/u-boot-staging.git ag...@denx.de

for you to fetch changes up to 548b310c68ac99a0330d8b56c797c09ff0742d1e:

  Remove the CREDITS file (2014-10-31 00:50:51 +0100)


Andreas Bießmann (1):
  tools/kwbimage.c: fix build on darwin

Fabio Estevam (1):
  novena: Add MAINTAINERS file

Masahiro Yamada (3):
  Remove unused files
  ppc/arm: remove remainders of dead boards in Kconfig
  Remove the CREDITS file

Paul Kocialkowski (1):
  twl4030: VMMC2 3.2V enable on MMC init

Stefan Roese (1):
  tools/kwbimage: Fix compilation warning

 CREDITS |  536 ---
 arch/arm/Kconfig|4 -
 arch/arm/include/asm/arch-at91/at91_shdwn.h |   35 --
 arch/powerpc/cpu/mpc5xxx/Kconfig|3 -
 arch/powerpc/cpu/mpc8xx/Kconfig |3 -
 board/kosagi/novena/MAINTAINERS |6 +
 board/matrix_vision/common/Makefile |8 -
 board/matrix_vision/common/mv_common.c  |  112 --
 board/matrix_vision/common/mv_common.h  |9 -
 drivers/power/twl4030.c |6 +
 include/twl4030.h   |2 +
 include/usb/omap1510_udc.h  |  174 -
 tools/kwbimage.c|   37 +-
 13 files changed, 42 insertions(+), 893 deletions(-)
 delete mode 100644 CREDITS
 delete mode 100644 arch/arm/include/asm/arch-at91/at91_shdwn.h
 create mode 100644 board/kosagi/novena/MAINTAINERS
 delete mode 100644 board/matrix_vision/common/Makefile
 delete mode 100644 board/matrix_vision/common/mv_common.c
 delete mode 100644 board/matrix_vision/common/mv_common.h
 delete mode 100644 include/usb/omap1510_udc.h

Please pull. Thanks!

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


Re: [U-Boot] [PATCH] Remove the CREDITS file

2014-10-30 Thread Anatolij Gustschin
On Thu, 30 Oct 2014 15:50:15 +0900
Masahiro Yamada  wrote:

> This file is not maintained these days.
> 
> We use MAINTAINERS for the maintainership of the supported boards.
> For dead boards, we have some clues in doc/README.scrapyard and
> also imperishable history in git-log.
> 
> Signed-off-by: Masahiro Yamada 
> Cc: Wolfgang Denk 
> ---
> 
>  CREDITS | 536 
> 
>  1 file changed, 536 deletions(-)
>  delete mode 100644 CREDITS

applied to u-boot-staging. Thanks!

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


Re: [U-Boot] [PATCH] novena: Add MAINTAINERS file

2014-10-30 Thread Anatolij Gustschin
On Thu, 30 Oct 2014 18:46:37 -0200
Fabio Estevam  wrote:

> From: Fabio Estevam 
> 
> Commit f91c09acf5c58c ("ARM: mx6: Add support for Kosagi Novena") missed to
> add a MAINTAINERS file, so add Marek as the maintainer.
> 
> Signed-off-by: Fabio Estevam 
> ---
>  board/kosagi/novena/MAINTAINERS | 6 ++
>  1 file changed, 6 insertions(+)
>  create mode 100644 board/kosagi/novena/MAINTAINERS

applied to u-boot-staging. Thanks!

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


Re: [U-Boot] [PATCH] ppc/arm: remove remainders of dead boards in Kconfig

2014-10-30 Thread Anatolij Gustschin
On Thu, 30 Oct 2014 18:29:15 +0900
Masahiro Yamada  wrote:

> Commit d58a9451e733 (ppc/arm: zap EMK boards) removed
> TOP* boards support but missed to remove entries in Kconfig.
> 
> Signed-off-by: Masahiro Yamada 
> Cc: Wolfgang Denk 
> ---
> 
>  arch/arm/Kconfig | 4 
>  arch/powerpc/cpu/mpc5xxx/Kconfig | 3 ---
>  arch/powerpc/cpu/mpc8xx/Kconfig  | 3 ---
>  3 files changed, 10 deletions(-)

applied to u-boot-staging. Thanks!

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


Re: [U-Boot] [PATCH] Remove unused files

2014-10-30 Thread Anatolij Gustschin
On Thu, 30 Oct 2014 18:28:01 +0900
Masahiro Yamada  wrote:

> [1] arch/arm/include/asm/arch-at91/at91_shdwn.h
>  The top9000 was the last board to use this header file.
>  It was removed by commit d58a9451e733 (ppc/arm: zap EMK boards).
> 
> [2] board/matrix_vision/common/*
>  Some Matrix Vision boards were dropped by commit e7a565638a7a
>  (powerpc: mpc83xx: remove board support for MERGERBOX and MVBLM7)
>  and commit af55e35d3389
>  (powerpc: mpc5xxx: remove board support for MVBC_P and MVSMR).
>  Since then these files have been unused.
> 
> [3] include/usb/omap1510_udc.h
>   The omap5912osk was the last board to use this header file.
>   It was removed by commit 62d636aa2ac2
>   (omap: remove omap5912osk board support).
> 
> Signed-off-by: Masahiro Yamada 
> ---
> 
>  arch/arm/include/asm/arch-at91/at91_shdwn.h |  35 --
>  board/matrix_vision/common/Makefile |   8 --
>  board/matrix_vision/common/mv_common.c  | 112 --
>  board/matrix_vision/common/mv_common.h  |   9 --
>  include/usb/omap1510_udc.h  | 174 
> 
>  5 files changed, 338 deletions(-)
>  delete mode 100644 arch/arm/include/asm/arch-at91/at91_shdwn.h
>  delete mode 100644 board/matrix_vision/common/Makefile
>  delete mode 100644 board/matrix_vision/common/mv_common.c
>  delete mode 100644 board/matrix_vision/common/mv_common.h
>  delete mode 100644 include/usb/omap1510_udc.h

applied to u-boot-staging. Thanks!

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


Re: [U-Boot] [PATCH v2] twl4030: VMMC2 3.2V enable on MMC init

2014-10-30 Thread Anatolij Gustschin
On Tue, 28 Oct 2014 18:14:23 +0100
Paul Kocialkowski  wrote:

> This enables the VMMC2 LDO, which powers the MMC2 device.
> When the device starts from MMC2, this has already been enabled by the 
> BootROM,
> but when starting from peripheral boot (USB, UART), it is not the case.
> 
> Signed-off-by: Paul Kocialkowski 
> ---
>  drivers/power/twl4030.c |6 ++
>  include/twl4030.h   |2 ++
>  2 files changed, 8 insertions(+)

applied to u-boot-staging. Thanks!

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


Re: [U-Boot] [PATCH 2/2] tools/kwbimage.c: fix build on darwin

2014-10-30 Thread Anatolij Gustschin
On Thu, 30 Oct 2014 23:11:03 +0100
Anatolij Gustschin  wrote:

> On Fri, 24 Oct 2014 23:39:11 +0200
> andreas.de...@googlemail.com wrote:
> 
> > From: Andreas Bießmann 
> > 
> > kwbimage uses get_current_dir_name(3) which is a gnu extension and not
> > available on darwin host. Fix this by converting to portable getcwd(3)
> > function.
> > 
> > This patch fixes the following error:
> > ---8<---
> >   HOSTCC  tools/kwbimage.o
> > tools/kwbimage.c:399:16: warning: implicit declaration of function 
> > 'get_current_dir_name' is invalid in C99 [-Wimplicit-function-declaration]
> > char *cwd = get_current_dir_name();
> > ^
> > tools/kwbimage.c:399:10: warning: incompatible integer to pointer 
> > conversion initializing 'char *' with an expression of type 'int' 
> > [-Wint-conversion]
> > char *cwd = get_current_dir_name();
> >   ^ ~~
> > 2 warnings generated.
> > ...
> > Undefined symbols for architecture x86_64:
> >   "_get_current_dir_name", referenced from:
> >   _image_headersz_v1 in kwbimage.o
> > ld: symbol(s) not found for architecture x86_64
> > --->8---
> > 
> > Signed-off-by: Andreas Bießmann 
> > Cc: Stefan Roese 
> > 
> > ---
> > 
> >  tools/kwbimage.c | 6 --
> >  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> Applied to u-boot-staging. Thanks!

Now I see

tools/kwbimage.c:402:4: warning: ignoring return value of ‘getcwd’,
declared with attribute warn_unused_result [-Wunused-result]

So, additionally applied:

diff --git a/tools/kwbimage.c b/tools/kwbimage.c
index 0a388c8..ec52f9e 100644
--- a/tools/kwbimage.c
+++ b/tools/kwbimage.c
@@ -398,13 +398,19 @@ static size_t image_headersz_v1(struct image_tool_params 
*params,
ret = stat(binarye->binary.file, &s);
if (ret < 0) {
char cwd[PATH_MAX];
+   char *dir = cwd;
+
memset(cwd, 0, sizeof(cwd));
-   getcwd(cwd, sizeof(cwd));
+   if (!getcwd(cwd, sizeof(cwd))) {
+   dir = "current working directory";
+   perror("getcwd() failed");
+   }
+
fprintf(stderr,
"Didn't find the file '%s' in '%s' which is 
mandatory to generate the image\n"
"This file generally contains the DDR3 training 
code, and should be extracted from an existing bootable\n"
"image for your board. See 'kwbimage -x' to 
extract it from an existing image.\n",
-   binarye->binary.file, cwd);
+   binarye->binary.file, dir);
return 0;
}
 
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [v2 PATCH 09/12] spl, mtd, nand, atmel_nand: invert device ready pin logic

2014-10-30 Thread Scott Wood
On Thu, 2014-10-30 at 09:15 +0100, Heiko Schocher wrote:
> device ready pin is signalling that the device is ready on state 1
> not on 0. Simmiliar as it is in drivers/mtd/nand/nand_spl_simple.c
> 
> Signed-off-by: Heiko Schocher 
> Reviewed-by: Andreas Bießmann 
> 
> ---
> 
> Changes in v2:
> add Reviewed-by: Andreas Bießmann 
> 
>  drivers/mtd/nand/atmel_nand.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)

Acked-by: Scott Wood 

-Scott


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


Re: [U-Boot] [v2 PATCH 08/12] spl, nand, atmel_nand: add erase one block function

2014-10-30 Thread Scott Wood
On Thu, 2014-10-30 at 09:15 +0100, Heiko Schocher wrote:
> erase one nand block in spl code. keep it simple, as size matters
> This is used on the upcoming taurus spl support.
> 
> Signed-off-by: Heiko Schocher 
> 
> ---
> 
> Changes in v2:
> add comment from scott wood:
> - move nand_erase_one into "include/nand.h" and rename it
>   to spl_nand_erase_one
> 
>  drivers/mtd/nand/atmel_nand.c | 33 +
>  include/nand.h|  1 +
>  2 files changed, 34 insertions(+)

Acked-by: Scott Wood 

-Scott


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


Re: [U-Boot] [PATCH v2] tools/kwbimage: Fix compilation warning

2014-10-30 Thread Anatolij Gustschin
On Tue, 28 Oct 2014 11:32:24 +0100
Stefan Roese  wrote:

> This patch fixes a compilation warning of kwbimage.c:
> 
> tools/kwbimage.c: In function ‘kwbimage_set_header’:
> tools/kwbimage.c:784:8: warning: ‘headersz’ may be used uninitialized in this 
> function [-Wmaybe-uninitialized]
>   memcpy(ptr, image, headersz);
> ^
> Instead of using multiple if statements, use a switch statement with
> a default entry. And return with error if an unsupported version
> is configured in the cfg file.
> 
> Signed-off-by: Stefan Roese 
> ---
> v2:
> - Change error message so that it really makes sense (unsupported
>   version instead of no version)
> - Change this also in the commit text
> - Small change (s/is/if)
> 
>  tools/kwbimage.c | 23 +--
>  1 file changed, 17 insertions(+), 6 deletions(-)

Applied to u-boot-staging. Thanks!

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


Re: [U-Boot] [PATCH 2/2] tools/kwbimage.c: fix build on darwin

2014-10-30 Thread Anatolij Gustschin
On Fri, 24 Oct 2014 23:39:11 +0200
andreas.de...@googlemail.com wrote:

> From: Andreas Bießmann 
> 
> kwbimage uses get_current_dir_name(3) which is a gnu extension and not
> available on darwin host. Fix this by converting to portable getcwd(3)
> function.
> 
> This patch fixes the following error:
> ---8<---
>   HOSTCC  tools/kwbimage.o
> tools/kwbimage.c:399:16: warning: implicit declaration of function 
> 'get_current_dir_name' is invalid in C99 [-Wimplicit-function-declaration]
> char *cwd = get_current_dir_name();
> ^
> tools/kwbimage.c:399:10: warning: incompatible integer to pointer conversion 
> initializing 'char *' with an expression of type 'int' [-Wint-conversion]
> char *cwd = get_current_dir_name();
>   ^ ~~
> 2 warnings generated.
> ...
> Undefined symbols for architecture x86_64:
>   "_get_current_dir_name", referenced from:
>   _image_headersz_v1 in kwbimage.o
> ld: symbol(s) not found for architecture x86_64
> --->8---
> 
> Signed-off-by: Andreas Bießmann 
> Cc: Stefan Roese 
> 
> ---
> 
>  tools/kwbimage.c | 6 --
>  1 file changed, 4 insertions(+), 2 deletions(-)

Applied to u-boot-staging. Thanks!

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


Re: [U-Boot] [PATCH v2 3/3] video: speedup writing strings to fb console

2014-10-30 Thread Anatolij Gustschin
On Fri, 24 Oct 2014 16:33:30 +0200
Soeren Moch  wrote:

> With enabled framebuffer console the printenv command can take several
> seconds to complete. This patch temporarily disables cache flush when
> writing strings to fb console. Then there is no noticable delay anymore.
> 
> Tested with imx6 hdmi framebuffer.
> 
> Signed-off-by: Soeren Moch 
> ---
> Cc: Stefano Babic 
> ---
>  drivers/video/cfb_console.c | 9 +
>  1 file changed, 9 insertions(+)

Applied to u-boot-video/master. Thanks!

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


Re: [U-Boot] [PATCH] novena: Add MAINTAINERS file

2014-10-30 Thread Marek Vasut
On Thursday, October 30, 2014 at 09:46:37 PM, Fabio Estevam wrote:
> From: Fabio Estevam 
> 
> Commit f91c09acf5c58c ("ARM: mx6: Add support for Kosagi Novena") missed to
> add a MAINTAINERS file, so add Marek as the maintainer.
> 
> Signed-off-by: Fabio Estevam 

Acked-by: Marek Vasut 

Thanks!

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] arm: socfpga: Add example config entry for EPCS/EPCQ SPI

2014-10-30 Thread Marek Vasut
On Thursday, October 30, 2014 at 03:38:40 PM, Jagan Teki wrote:
> On 30 October 2014 15:00, Marek Vasut  wrote:
> > Add example config file entry for the Altera SPI controller. This SPI
> > controller can also, under special conditions, be used to operate the
> > EPCS/EPCQ SPI NOR.
> > 
> > Signed-off-by: Marek Vasut 
> > Cc: Chin Liang See 
> > Cc: Dinh Nguyen 
> > Cc: Vince Bridgers 
> > Cc: Pavel Machek 
> > Cc: Stefan Roese 
> > ---
> > 
> >  include/configs/socfpga_common.h | 19 +++
> >  1 file changed, 19 insertions(+)
> > 
> > diff --git a/include/configs/socfpga_common.h
> > b/include/configs/socfpga_common.h index 83a1bcd..1df886b 100644
> > --- a/include/configs/socfpga_common.h
> > +++ b/include/configs/socfpga_common.h
> > @@ -79,6 +79,25 @@
> > 
> >  #define CONFIG_SYS_PL310_BASE  SOCFPGA_MPUL2_ADDRESS
> >  
> >  /*
> > 
> > + * EPCS/EPCQx1 Serial Flash Controller
> > + */
> > +#ifdef CONFIG_ALTERA_SPI
> > +#define CONFIG_CMD_SPI
> > +#define CONFIG_CMD_SF
> > +#define CONFIG_SF_DEFAULT_SPEED3000
> > +#define CONFIG_SPI_FLASH
> > +#define CONFIG_SPI_FLASH_STMICRO
> > +#define CONFIG_SPI_FLASH_BAR
> > +/*
> > + * The base address is configurable in QSys, each board must specify the
> > + * base address based on it's particular FPGA configuration. Please note
> > + * that the address here is incremented by  0x400  from the Base address
> > + * selected in QSys, since the SPI registers are at offset +0x400.
> > + * #define CONFIG_SYS_SPI_BASE 0xff240400
> 
> So each board-specific config header will define CONFIG_SYS_SPI_BASE is it?
> for using ALTERA_SPI

Yes, the address is not fixed, since this is FPGA IP.

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] arm: socfpga: Add example config entry for EPCS/EPCQ SPI

2014-10-30 Thread Marek Vasut
On Thursday, October 30, 2014 at 12:22:57 PM, Pavel Machek wrote:
> On Thu 2014-10-30 10:30:25, Marek Vasut wrote:
> > Add example config file entry for the Altera SPI controller. This SPI
> > controller can also, under special conditions, be used to operate the
> > EPCS/EPCQ SPI NOR.
> > 
> > Signed-off-by: Marek Vasut 
> > Cc: Chin Liang See 
> > Cc: Dinh Nguyen 
> > Cc: Vince Bridgers 
> 
> Acked-by: Pavel Machek 
> 
> > --- a/include/configs/socfpga_common.h
> > +++ b/include/configs/socfpga_common.h
> > @@ -79,6 +79,25 @@
> > 
> >  #define CONFIG_SYS_PL310_BASE  SOCFPGA_MPUL2_ADDRESS
> >  
> >  /*
> > 
> > + * EPCS/EPCQx1 Serial Flash Controller
> > + */
> > +#ifdef CONFIG_ALTERA_SPI
> > +#define CONFIG_CMD_SPI
> > +#define CONFIG_CMD_SF
> > +#define CONFIG_SF_DEFAULT_SPEED3000
> > +#define CONFIG_SPI_FLASH
> > +#define CONFIG_SPI_FLASH_STMICRO
> > +#define CONFIG_SPI_FLASH_BAR
> > +/*
> > + * The base address is configurable in QSys, each board must specify the
> > + * base address based on it's particular FPGA configuration. Please note
> > + * that the address here is incremented by  0x400  from the Base address
> 
> Are the double spaces around 0x400 intentional?

Yes, to stress it out and align the text to a nice block ;-)

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


Re: [U-Boot] buildman: using wrong libgcc.a

2014-10-30 Thread Jeroen Hofstee

Hello Steve,

On 30-10-14 21:42, Steve Rae wrote:
H -- maybe it would be better to specify the entire path for the 
CROSS_COMPILE, and not rely on the PATH to find the cross compile tools:


diff --git a/tools/buildman/toolchain.py b/tools/buildman/toolchain.py
index 27dc318..58c7b1f 100644
--- a/tools/buildman/toolchain.py
+++ b/tools/buildman/toolchain.py
@@ -33,6 +33,7 @@ class Toolchain:
 self.cross = os.path.basename(fname)[:-3]
 pos = self.cross.find('-')
 self.arch = self.cross[:pos] if pos != -1 else 'sandbox'
+self.cross = fname[:-3]



A bit off topic, but is it possible to stop adding these magic 3
constants. strlen("clang") != 3. strlen("cc") isn't either. Anyway
I am aware buildman is already full with it, so I am fine with
one more (for now).

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


[U-Boot] [PATCH] novena: Add MAINTAINERS file

2014-10-30 Thread Fabio Estevam
From: Fabio Estevam 

Commit f91c09acf5c58c ("ARM: mx6: Add support for Kosagi Novena") missed to
add a MAINTAINERS file, so add Marek as the maintainer.

Signed-off-by: Fabio Estevam 
---
 board/kosagi/novena/MAINTAINERS | 6 ++
 1 file changed, 6 insertions(+)
 create mode 100644 board/kosagi/novena/MAINTAINERS

diff --git a/board/kosagi/novena/MAINTAINERS b/board/kosagi/novena/MAINTAINERS
new file mode 100644
index 000..d3471c2
--- /dev/null
+++ b/board/kosagi/novena/MAINTAINERS
@@ -0,0 +1,6 @@
+NOVENA BOARD
+M: Marek Vasut 
+S: Maintained
+F: board/kosagi/novena/
+F: include/configs/novena.h
+F: configs/novena_defconfig
-- 
1.9.1

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


Re: [U-Boot] buildman: using wrong libgcc.a

2014-10-30 Thread Steve Rae
H -- maybe it would be better to specify the entire path for the 
CROSS_COMPILE, and not rely on the PATH to find the cross compile tools:


diff --git a/tools/buildman/toolchain.py b/tools/buildman/toolchain.py
index 27dc318..58c7b1f 100644
--- a/tools/buildman/toolchain.py
+++ b/tools/buildman/toolchain.py
@@ -33,6 +33,7 @@ class Toolchain:
 self.cross = os.path.basename(fname)[:-3]
 pos = self.cross.find('-')
 self.arch = self.cross[:pos] if pos != -1 else 'sandbox'
+self.cross = fname[:-3]

 env = self.MakeEnvironment()

@@ -82,7 +83,6 @@ class Toolchain:
 """
 env = dict(os.environ)
 env['CROSS_COMPILE'] = self.cross
-env['PATH'] += (':' + self.path)
 return env



On 14-10-30 09:57 AM, Steve Rae wrote:

Hi Simon,

In my environment, buildman and MAKEALL are not producing the same results.

It seems that buildman is accidentally picking up the wrong libgcc.a ...


*** buildman ***

$ cat ~/.buildman
[toolchain]
eldk:
/opt/eldk-5.4/armv7a/sysroots/i686-eldk-linux/usr/bin/armv7a-vfp-neon-linux-gnueabi


[toolchain-alias]
$


$ tools/buildman/buildman --list-tool-chains
No section: 'make-flags'
Scanning for tool chains
- scanning path
'/opt/eldk-5.4/armv7a/sysroots/i686-eldk-linux/usr/bin/armv7a-vfp-neon-linux-gnueabi'

   - looking in
'/opt/eldk-5.4/armv7a/sysroots/i686-eldk-linux/usr/bin/armv7a-vfp-neon-linux-gnueabi/.'

  - found
'/opt/eldk-5.4/armv7a/sysroots/i686-eldk-linux/usr/bin/armv7a-vfp-neon-linux-gnueabi/./armv7a-gcc'

Tool chain test:  OK
  - found
'/opt/eldk-5.4/armv7a/sysroots/i686-eldk-linux/usr/bin/armv7a-vfp-neon-linux-gnueabi/./arm-linux-gnueabi-gcc'

Tool chain test:  OK
   - looking in
'/opt/eldk-5.4/armv7a/sysroots/i686-eldk-linux/usr/bin/armv7a-vfp-neon-linux-gnueabi/bin'

   - looking in
'/opt/eldk-5.4/armv7a/sysroots/i686-eldk-linux/usr/bin/armv7a-vfp-neon-linux-gnueabi/usr/bin'

List of available toolchains (2):
arm   :
/opt/eldk-5.4/armv7a/sysroots/i686-eldk-linux/usr/bin/armv7a-vfp-neon-linux-gnueabi/./arm-linux-gnueabi-gcc

armv7a:
/opt/eldk-5.4/armv7a/sysroots/i686-eldk-linux/usr/bin/armv7a-vfp-neon-linux-gnueabi/./armv7a-gcc

$


$ tools/buildman/buildman bcm28155_ap -x bcm28155_w1d -fk
No section: 'make-flags'
WARNING: no status info for 'Ippo_q8h'
WARNING: no maintainers for 'Ippo_q8h'
Building current source for 1 boards (1 thread, 8 jobs per thread)
 100 /1  bcm28155_ap
$


$ head -14 ../current/current/bcm28155_ap/u-boot.map
Archive member included because of file (symbol)

/usr/lib/gcc/arm-linux-gnueabi/4.6/libgcc.a(_udivsi3.o)
   arch/arm/cpu/armv7/bcm281xx/built-in.o
(__aeabi_uidiv)
/usr/lib/gcc/arm-linux-gnueabi/4.6/libgcc.a(_divsi3.o)
   common/built-in.o (__aeabi_idiv)
/usr/lib/gcc/arm-linux-gnueabi/4.6/libgcc.a(_lshrdi3.o)
   lib/built-in.o (__aeabi_llsr)
/usr/lib/gcc/arm-linux-gnueabi/4.6/libgcc.a(_ashldi3.o)
   drivers/mmc/built-in.o (__aeabi_llsl)
/usr/lib/gcc/arm-linux-gnueabi/4.6/libgcc.a(_dvmd_lnx.o)

/usr/lib/gcc/arm-linux-gnueabi/4.6/libgcc.a(_udivsi3.o) (__aeabi_idiv0)

Discarded input sections
$


*** MAKEALL ***

$
CROSS_COMPILE_ARM=/opt/eldk-5.4/armv7a/sysroots/i686-eldk-linux/usr/bin/armv7a-vfp-neon-linux-gnueabi/arm-linux-gnueabi-
./MAKEALL -b bcm28155_ap
$


$ head -14 u-boot.map
Archive member included because of file (symbol)

/opt/eldk-5.4/armv7a/sysroots/armv7a-vfp-neon-linux-gnueabi/usr/lib/arm-linux-gnueabi/4.7.2/libgcc.a(_udivsi3.o)

   arch/arm/cpu/armv7/bcm281xx/built-in.o
(__aeabi_uidiv)
/opt/eldk-5.4/armv7a/sysroots/armv7a-vfp-neon-linux-gnueabi/usr/lib/arm-linux-gnueabi/4.7.2/libgcc.a(_divsi3.o)

   common/built-in.o (__aeabi_idiv)
/opt/eldk-5.4/armv7a/sysroots/armv7a-vfp-neon-linux-gnueabi/usr/lib/arm-linux-gnueabi/4.7.2/libgcc.a(_lshrdi3.o)

   lib/built-in.o (__aeabi_llsr)
/opt/eldk-5.4/armv7a/sysroots/armv7a-vfp-neon-linux-gnueabi/usr/lib/arm-linux-gnueabi/4.7.2/libgcc.a(_ashldi3.o)

   drivers/mmc/built-in.o (__aeabi_llsl)
/opt/eldk-5.4/armv7a/sysroots/armv7a-vfp-neon-linux-gnueabi/usr/lib/arm-linux-gnueabi/4.7.2/libgcc.a(_dvmd_lnx.o)


/opt/eldk-5.4/armv7a/sysroots/armv7a-vfp-neon-linux-gnueabi/usr/lib/arm-linux-gnueabi/4.7.2/libgcc.a(_udivsi3.o)
(__aeabi_idiv0)

Discarded input sections
$

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


Re: [U-Boot] [BUG] kwimage v0 broken

2014-10-30 Thread Prafulla Wadaskar


> -Original Message-
> From: u-boot-boun...@lists.denx.de [mailto:u-boot-
> boun...@lists.denx.de] On Behalf Of drEagle
> Sent: 30 October 2014 20:15
> To: Stefan Roese; Luka Perkov
> Cc: u-boot@lists.denx.de
> Subject: Re: [U-Boot] [BUG] kwimage v0 broken
> 
> On 27/10/2014 08:18, Stefan Roese wrote:
> > Hi!
> >
> > On 25.10.2014 07:59, drEagle wrote:
> >> With the latest u-boot mainline from denx git, the
> kirkwood image old version/format are broken;
> >> Sheevaplug u-boot.kwb is no more flahsable and brick
> the plug.
> >>
> >> Using an older mkimage version still work with the
> same u-boot binary.
> >>
> >> u-boot (in elf loading mode) still work well also.
> >>
> >> If I can help by some tests, please feel free to
> ask.
> >>
> >> PS: I'm not on the list, thans to cc me.
> >
> > Hmmm. I have no access to a mainlined Kirkwood board
> right now. So I can't really test right now. I added
> Luka to Cc, as he did some testing on this patch series
> a few weeks ago. And IIRC, he didn't experience any
> such problems with the kwimage tool.

Hmm... We must fix this asap.
Can someone post the patch?

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


[U-Boot] [PATCH v4] zynq: Use GPLed files for SPL

2014-10-30 Thread Soren Brinkmann
The latest Xilinx tools generate ps7_init files that are explicitly
available under GPL. Change the makefile to allow drop in of those files
for building the SPL.

Signed-off-by: Soren Brinkmann 
Acked-by: Jagannadha Sutradharudu Teki 
Reviewed-and-tested-by: Masahiro Yamada 
---
v4:
 - add ps7_init_gpl.[ch] to gitignore
v3:
 - handle the case with ps7_init and ps7_init_gpl files being present
v2:
 - keep support for legacy file names
 - issue compiler warning when legacy files are used
---
 board/xilinx/zynq/.gitignore | 1 +
 board/xilinx/zynq/Makefile   | 6 --
 board/xilinx/zynq/legacy.c   | 2 ++
 board/xilinx/zynq/xil_io.h   | 2 +-
 4 files changed, 8 insertions(+), 3 deletions(-)
 create mode 100644 board/xilinx/zynq/legacy.c

diff --git a/board/xilinx/zynq/.gitignore b/board/xilinx/zynq/.gitignore
index 68b8edd260d0..7c36bc963f7a 100644
--- a/board/xilinx/zynq/.gitignore
+++ b/board/xilinx/zynq/.gitignore
@@ -1 +1,2 @@
 ps7_init.[ch]
+ps7_init_gpl.[ch]
diff --git a/board/xilinx/zynq/Makefile b/board/xilinx/zynq/Makefile
index 71c0c351f929..3b1eb4f74ad1 100644
--- a/board/xilinx/zynq/Makefile
+++ b/board/xilinx/zynq/Makefile
@@ -7,9 +7,11 @@
 
 obj-y  := board.o
 
-# Please copy ps7_init.c/h from hw project to this directory
+# Please copy ps7_init_gpl.c/h from hw project to this directory
 obj-$(CONFIG_SPL_BUILD) += \
-   $(if $(wildcard $(srctree)/$(src)/ps7_init.c), ps7_init.o)
+   $(if $(wildcard $(srctree)/$(src)/ps7_init_gpl.c), 
ps7_init_gpl.o, \
+   $(if $(wildcard $(srctree)/$(src)/ps7_init.c), 
ps7_init.o legacy.o))
 
 # Suppress "warning: function declaration isn't a prototype"
+CFLAGS_REMOVE_ps7_init_gpl.o := -Wstrict-prototypes
 CFLAGS_REMOVE_ps7_init.o := -Wstrict-prototypes
diff --git a/board/xilinx/zynq/legacy.c b/board/xilinx/zynq/legacy.c
new file mode 100644
index ..4ae913eefeb3
--- /dev/null
+++ b/board/xilinx/zynq/legacy.c
@@ -0,0 +1,2 @@
+
+#warning usage of ps7_init files is deprecated please use ps7_init_gpl
diff --git a/board/xilinx/zynq/xil_io.h b/board/xilinx/zynq/xil_io.h
index e59a977eb174..1eccf8d91d09 100644
--- a/board/xilinx/zynq/xil_io.h
+++ b/board/xilinx/zynq/xil_io.h
@@ -6,7 +6,7 @@
 #define XIL_IO_H
 
 /*
- * This empty file is here because ps7_init.c exported by hw project
+ * This empty file is here because ps7_init_gpl.c exported by hw project
  * has #include "xil_io.h" line.
  */
 
-- 
2.1.2.1.g5e69ed6

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


Re: [U-Boot] [U-boot] [Patch v2] net: phy: marvell: add errata w/a for 88E151* chips

2014-10-30 Thread Stefan Roese

On 30.10.2014 17:59, Ivan Khoronzhuk wrote:

From: Hao Zhang 

As per Marvell Release Notes - Alaska 88E1510/88E1518/88E1512/88E1514
Rev A0, Errata Section 3.1 Marvell PHY has an errata which requires
that certain registers get written in order to restart
autonegotiation.

Signed-off-by: Hao Zhang 
Signed-off-by: Ivan Khoronzhuk 


Reviewed-by: Stefan Roese 

Thanks,
Stefan

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


[U-Boot] [U-boot] [Patch v2] net: phy: marvell: add errata w/a for 88E151* chips

2014-10-30 Thread Ivan Khoronzhuk
From: Hao Zhang 

As per Marvell Release Notes - Alaska 88E1510/88E1518/88E1512/88E1514
Rev A0, Errata Section 3.1 Marvell PHY has an errata which requires
that certain registers get written in order to restart
autonegotiation.

Signed-off-by: Hao Zhang 
Signed-off-by: Ivan Khoronzhuk 
---

v2..v1
use only for SGMII interface.

 drivers/net/phy/marvell.c | 53 ++-
 1 file changed, 52 insertions(+), 1 deletion(-)

diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c
index d2ecadc..9437c3b 100644
--- a/drivers/net/phy/marvell.c
+++ b/drivers/net/phy/marvell.c
@@ -276,6 +276,57 @@ static int m88es_config(struct phy_device *phydev)
return 0;
 }
 
+/**
+ * m88e1518_phy_writebits - write bits to a register
+ */
+void m88e1518_phy_writebits(struct phy_device *phydev,
+  u8 reg_num, u16 offset, u16 len, u16 data)
+{
+   u16 reg, mask;
+
+   if ((len + offset) >= 16)
+   mask = 0 - (1 << offset);
+   else
+   mask = (1 << (len + offset)) - (1 << offset);
+
+   reg = phy_read(phydev, MDIO_DEVAD_NONE, reg_num);
+
+   reg &= ~mask;
+   reg |= data << offset;
+
+   phy_write(phydev, MDIO_DEVAD_NONE, reg_num, reg);
+}
+
+static int m88e1518_config(struct phy_device *phydev)
+{
+   /*
+* As per Marvell Release Notes - Alaska 88E1510/88E1518/88E1512
+* /88E1514 Rev A0, Errata Section 3.1
+*/
+   if (phydev->interface == PHY_INTERFACE_MODE_SGMII) {
+   phy_write(phydev, MDIO_DEVAD_NONE, 22, 0x00ff); /* page 0xff */
+   phy_write(phydev, MDIO_DEVAD_NONE, 17, 0x214B);
+   phy_write(phydev, MDIO_DEVAD_NONE, 16, 0x2144);
+   phy_write(phydev, MDIO_DEVAD_NONE, 17, 0x0C28);
+   phy_write(phydev, MDIO_DEVAD_NONE, 16, 0x2146);
+   phy_write(phydev, MDIO_DEVAD_NONE, 17, 0xB233);
+   phy_write(phydev, MDIO_DEVAD_NONE, 16, 0x214D);
+   phy_write(phydev, MDIO_DEVAD_NONE, 17, 0xCC0C);
+   phy_write(phydev, MDIO_DEVAD_NONE, 16, 0x2159);
+   phy_write(phydev, MDIO_DEVAD_NONE, 22, 0x); /* reg page 0 */
+   phy_write(phydev, MDIO_DEVAD_NONE, 22, 18);/* reg page 18 */
+   /* Write HWCFG_MODE = SGMII to Copper */
+   m88e1518_phy_writebits(phydev, 20, 0, 3, 1);
+
+   /* Phy reset */
+   m88e1518_phy_writebits(phydev, 20, 15, 1, 1);
+   phy_write(phydev, MDIO_DEVAD_NONE, 22, 0); /* reg page 18 */
+   udelay(100);
+   }
+
+   return m88es_config(phydev);
+}
+
 /* Marvell 88E1118 */
 static int m88e1118_config(struct phy_device *phydev)
 {
@@ -493,7 +544,7 @@ static struct phy_driver M88E1518_driver = {
.uid = 0x1410dd1,
.mask = 0xff0,
.features = PHY_GBIT_FEATURES,
-   .config = &m88es_config,
+   .config = &m88e1518_config,
.startup = &m88e1011s_startup,
.shutdown = &genphy_shutdown,
 };
-- 
1.8.3.2

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


Re: [U-Boot] [PATCH] arm: fix a typo of instruction operand

2014-10-30 Thread Albert ARIBAUD
Hello Jethro,

On Thu, 30 Oct 2014 19:27:41 +0800, Jethro Hsu 
wrote:
> From 79344f479bad75b47477dcc9768e564e02f72f59 Mon Sep 17 00:00:00 2001
> From: Jethro Hsu 
> Date: Thu, 30 Oct 2014 17:26:00 +0800
> Subject: [PATCH] arm: fix a typo of instruction operand
> 
> To fix compile error caused by incorrect data format,
> add "0x" to specify the operand value in hex mode.
> 
> error message:
> 
> arch/arm/lib/gic_64.S: Assembler messages:
> arch/arm/lib/gic_64.S:187: Error: unexpected characters
> following instruction at operand 3 -- `and w9,w9,#3ff'
> 
> Change-Id: Ifef22c6d9a0f6a4255b3f2daf96bef08db6731dc
> Signed-off-by: Jethro Hsu 
> Cc: Albert Aribaud 
> Cc: Arnab Basu 
> Cc: David Feng 
> Cc: York Sun 
> Cc: Scott Wood 
> ---
>  arch/arm/include/asm/macro.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm/include/asm/macro.h b/arch/arm/include/asm/macro.h
> index 541b443..1c8c425 100644
> --- a/arch/arm/include/asm/macro.h
> +++ b/arch/arm/include/asm/macro.h
> @@ -193,7 +193,7 @@ lr  .reqx30
>  0 :wfi
> ldr \wreg2, [\xreg1, GICC_AIAR]
> str \wreg2, [\xreg1, GICC_AEOIR]
> -   and \wreg2, \wreg2, #3ff
> +   and \wreg2, \wreg2, #0x3ff
> cbnz\wreg2, 0b
>  .endm
>  #endif
> --
> 1.8.3.1

This was fixed already in u-boot-arm/master (currently top of tree,
soon to merge into u-boot/master.

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


[U-Boot] buildman: using wrong libgcc.a

2014-10-30 Thread Steve Rae

Hi Simon,

In my environment, buildman and MAKEALL are not producing the same results.

It seems that buildman is accidentally picking up the wrong libgcc.a ...


*** buildman ***

$ cat ~/.buildman
[toolchain]
eldk: 
/opt/eldk-5.4/armv7a/sysroots/i686-eldk-linux/usr/bin/armv7a-vfp-neon-linux-gnueabi


[toolchain-alias]
$


$ tools/buildman/buildman --list-tool-chains
No section: 'make-flags'
Scanning for tool chains
   - scanning path 
'/opt/eldk-5.4/armv7a/sysroots/i686-eldk-linux/usr/bin/armv7a-vfp-neon-linux-gnueabi'
  - looking in 
'/opt/eldk-5.4/armv7a/sysroots/i686-eldk-linux/usr/bin/armv7a-vfp-neon-linux-gnueabi/.'
 - found 
'/opt/eldk-5.4/armv7a/sysroots/i686-eldk-linux/usr/bin/armv7a-vfp-neon-linux-gnueabi/./armv7a-gcc'

Tool chain test:  OK
 - found 
'/opt/eldk-5.4/armv7a/sysroots/i686-eldk-linux/usr/bin/armv7a-vfp-neon-linux-gnueabi/./arm-linux-gnueabi-gcc'

Tool chain test:  OK
  - looking in 
'/opt/eldk-5.4/armv7a/sysroots/i686-eldk-linux/usr/bin/armv7a-vfp-neon-linux-gnueabi/bin'
  - looking in 
'/opt/eldk-5.4/armv7a/sysroots/i686-eldk-linux/usr/bin/armv7a-vfp-neon-linux-gnueabi/usr/bin'

List of available toolchains (2):
arm   : 
/opt/eldk-5.4/armv7a/sysroots/i686-eldk-linux/usr/bin/armv7a-vfp-neon-linux-gnueabi/./arm-linux-gnueabi-gcc
armv7a: 
/opt/eldk-5.4/armv7a/sysroots/i686-eldk-linux/usr/bin/armv7a-vfp-neon-linux-gnueabi/./armv7a-gcc

$


$ tools/buildman/buildman bcm28155_ap -x bcm28155_w1d -fk
No section: 'make-flags'
WARNING: no status info for 'Ippo_q8h'
WARNING: no maintainers for 'Ippo_q8h'
Building current source for 1 boards (1 thread, 8 jobs per thread)
100 /1  bcm28155_ap
$


$ head -14 ../current/current/bcm28155_ap/u-boot.map
Archive member included because of file (symbol)

/usr/lib/gcc/arm-linux-gnueabi/4.6/libgcc.a(_udivsi3.o)
  arch/arm/cpu/armv7/bcm281xx/built-in.o 
(__aeabi_uidiv)

/usr/lib/gcc/arm-linux-gnueabi/4.6/libgcc.a(_divsi3.o)
  common/built-in.o (__aeabi_idiv)
/usr/lib/gcc/arm-linux-gnueabi/4.6/libgcc.a(_lshrdi3.o)
  lib/built-in.o (__aeabi_llsr)
/usr/lib/gcc/arm-linux-gnueabi/4.6/libgcc.a(_ashldi3.o)
  drivers/mmc/built-in.o (__aeabi_llsl)
/usr/lib/gcc/arm-linux-gnueabi/4.6/libgcc.a(_dvmd_lnx.o)

/usr/lib/gcc/arm-linux-gnueabi/4.6/libgcc.a(_udivsi3.o) (__aeabi_idiv0)

Discarded input sections
$


*** MAKEALL ***

$ 
CROSS_COMPILE_ARM=/opt/eldk-5.4/armv7a/sysroots/i686-eldk-linux/usr/bin/armv7a-vfp-neon-linux-gnueabi/arm-linux-gnueabi- 
./MAKEALL -b bcm28155_ap

$


$ head -14 u-boot.map
Archive member included because of file (symbol)

/opt/eldk-5.4/armv7a/sysroots/armv7a-vfp-neon-linux-gnueabi/usr/lib/arm-linux-gnueabi/4.7.2/libgcc.a(_udivsi3.o)
  arch/arm/cpu/armv7/bcm281xx/built-in.o 
(__aeabi_uidiv)

/opt/eldk-5.4/armv7a/sysroots/armv7a-vfp-neon-linux-gnueabi/usr/lib/arm-linux-gnueabi/4.7.2/libgcc.a(_divsi3.o)
  common/built-in.o (__aeabi_idiv)
/opt/eldk-5.4/armv7a/sysroots/armv7a-vfp-neon-linux-gnueabi/usr/lib/arm-linux-gnueabi/4.7.2/libgcc.a(_lshrdi3.o)
  lib/built-in.o (__aeabi_llsr)
/opt/eldk-5.4/armv7a/sysroots/armv7a-vfp-neon-linux-gnueabi/usr/lib/arm-linux-gnueabi/4.7.2/libgcc.a(_ashldi3.o)
  drivers/mmc/built-in.o (__aeabi_llsl)
/opt/eldk-5.4/armv7a/sysroots/armv7a-vfp-neon-linux-gnueabi/usr/lib/arm-linux-gnueabi/4.7.2/libgcc.a(_dvmd_lnx.o)

/opt/eldk-5.4/armv7a/sysroots/armv7a-vfp-neon-linux-gnueabi/usr/lib/arm-linux-gnueabi/4.7.2/libgcc.a(_udivsi3.o) 
(__aeabi_idiv0)


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


Re: [U-Boot] [PATCH v4] powerpc/mpc85xx: modify erratum A007186

2014-10-30 Thread York Sun
On 10/29/2014 11:07 PM, Zhao Qiang wrote:
> T2080 v1.0 has this errata while v1.1 has fixed
> this errata by hardware, add a new function has_errata_a007186
> to check the SVR_SOC_VER, SVR_MAJ and SVR_MIN first,
> if the sil has errata a007186, then run the errata code,
> if not, doesn't run the code.
> 
> Signed-off-by: Zhao Qiang 
> Change-Id: I19d794283229a86d04d8f22d44b860a5c3940cdc
> Reviewed-on: http://git.am.freescale.net:8181/19850
> Tested-by: Review Code-CDREVIEW 
> Reviewed-by: Yusong Sun 
> ---

For future patches, please remove internal review information. It's not
accessible for folks outside of Freescale.

York

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


Re: [U-Boot] Inconsistency between $filesize and commands which accept numeric params.

2014-10-30 Thread Ian Campbell
On Thu, 2014-10-30 at 16:21 +0100, Wolfgang Denk wrote:
> Dear Ian,
> 
> In message <1414677435.2064.34.ca...@hellion.org.uk> you wrote:
> > It seems there is some inconsistency wrt number base between commands
> > which set $filesize in the env and the commands which might consume
> > them.
> 
> That would be bugs, then.
> 
> > 
> > sun7i# load scsi 0 $fdt_addr_r dtbs/$fdtfile
> > 21639 bytes read in 191 ms (110.4 KiB/s)
> > sun7i# printenv filesize
> > filesize=5487
> > 
> > So filesize is in hex, but without an 0x prefix. But:
> 
> This is normal.  U-Boot uses hex input base by default.  All commands
> should take hex input; the only inglorious exception is the "sleep"
> command which takes decimal; numbers as arguments.
> 
> > sun7i# fdt addr $fdt_addr_r 0x1 
> > sun7i# fdt set /chosen foo <$filesize>
> > sun7i# fdt print /chosen foo  
> > foo = <0x156f>
> > 
> > IOW the parameter to fdt set has been interpreted as a decimal.
> 
> That's a bug.
> 
> > So I'm not sure if the bug is that setenv_hex doesn't include the 0x, or
> 
> No 0x prefix should be needed anywhere.
> 
> > that fdt set interprets things as decimal by default instead of hex. Or
> > maybe there is no bug at all?
> 
> The bug is in fdt set, then.
> 
> 
> Thanks for pointing out!

Thanks for pointing me in the right direction. CCing the folks who
get_maintainers.pl tells me might be involved with common/cmd_fdt.c

Looks like the function which does this is fdt_parse_prop, which is
documented with:
/*
 * Parse the user's input, partially heuristic.  Valid formats:
 * <0x00112233 4 05>- an array of cells.  Numbers follow standard
 *  C conventions.
 * [00 11 22 .. nn] - byte stream
 * "string" - If the the value doesn't start with "<" or "[", it is
 *  treated as a string.  Note that the quotes are
 *  stripped by the parser before we get the string.

which is inconsistent with the "U-Boot uses hex input base by default"
mantra.

Ian.

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


Re: [U-Boot] [PATCH] omap_hsmmc: Allow for board-specific MMC power init

2014-10-30 Thread Pantelis Antoniou
Hi Paul,

> On Oct 28, 2014, at 19:25 , Paul Kocialkowski  wrote:
> 
> Some devices may use non-standard combinations of regulators to power MMC:
> this allows these devices to provide a board-specific MMC power init function
> to set everything up in their own way.
> 
> Signed-off-by: Paul Kocialkowski 
> ---
> arch/arm/include/asm/omap_mmc.h |4 +++-
> drivers/mmc/omap_hsmmc.c|4 +++-
> 2 files changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm/include/asm/omap_mmc.h b/arch/arm/include/asm/omap_mmc.h
> index 617e22f..b6a8325 100644
> --- a/arch/arm/include/asm/omap_mmc.h
> +++ b/arch/arm/include/asm/omap_mmc.h
> @@ -164,5 +164,7 @@ struct hsmmc {
> int omap_mmc_init(int dev_index, uint host_caps_mask, uint f_max, int cd_gpio,
>   int wp_gpio);
> 
> -
> +#ifdef CONFIG_OMAP_HSMMC_BOARD_POWER_INIT
> +void omap_hsmmc_board_power_init(void);
> +#endif
> #endif /* OMAP_MMC_H_ */
> diff --git a/drivers/mmc/omap_hsmmc.c b/drivers/mmc/omap_hsmmc.c
> index ef2cbf9..ef4c5cf 100644
> --- a/drivers/mmc/omap_hsmmc.c
> +++ b/drivers/mmc/omap_hsmmc.c
> @@ -136,7 +136,9 @@ static unsigned char mmc_board_init(struct mmc *mmc)
>   pbias_lite &= ~(PBIASLITEPWRDNZ1 | PBIASLITEPWRDNZ0);
>   writel(pbias_lite, &t2_base->pbias_lite);
> #endif
> -#if defined(CONFIG_TWL4030_POWER)
> +#if defined(CONFIG_OMAP_HSMMC_BOARD_POWER_INIT)
> + omap_hsmmc_board_power_init();
> +#elif defined(CONFIG_TWL4030_POWER)
>   twl4030_power_mmc_init();
>   mdelay(100);/* ramp-up delay from Linux code */
> #endif
> -- 
> 1.7.9.5
> 

Igor covered most of what I was going to whine about.

I’m not a big fun of the define maze here, let’s not add to it, shall we?

A common board_mmc_power_init() function would be fine in this occasion.

Regards

— Pantelis

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


Re: [U-Boot] [PATCH v2] twl4030: VMMC2 3.2V enable on MMC init

2014-10-30 Thread Pantelis Antoniou
Hi Paul,

> On Oct 28, 2014, at 19:14 , Paul Kocialkowski  wrote:
> 
> This enables the VMMC2 LDO, which powers the MMC2 device.
> When the device starts from MMC2, this has already been enabled by the 
> BootROM,
> but when starting from peripheral boot (USB, UART), it is not the case.
> 
> Signed-off-by: Paul Kocialkowski 
> ---
> drivers/power/twl4030.c |6 ++
> include/twl4030.h   |2 ++
> 2 files changed, 8 insertions(+)
> 
> diff --git a/drivers/power/twl4030.c b/drivers/power/twl4030.c
> index 3e50310..e578ae6 100644
> --- a/drivers/power/twl4030.c
> +++ b/drivers/power/twl4030.c
> @@ -98,4 +98,10 @@ void twl4030_power_mmc_init(void)
>   TWL4030_PM_RECEIVER_VMMC1_VSEL_32,
>   TWL4030_PM_RECEIVER_VMMC1_DEV_GRP,
>   TWL4030_PM_RECEIVER_DEV_GRP_P1);
> +
> + /* Set VMMC2 to 3.15 Volts */
> + twl4030_pmrecv_vsel_cfg(TWL4030_PM_RECEIVER_VMMC2_DEDICATED,
> + TWL4030_PM_RECEIVER_VMMC2_VSEL_32,
> + TWL4030_PM_RECEIVER_VMMC2_DEV_GRP,
> + TWL4030_PM_RECEIVER_DEV_GRP_P1);
> }
> diff --git a/include/twl4030.h b/include/twl4030.h
> index 093c61d..18795a6 100644
> --- a/include/twl4030.h
> +++ b/include/twl4030.h
> @@ -395,6 +395,8 @@
> #define TWL4030_PM_RECEIVER_VDAC_VSEL_18  0x03
> #define TWL4030_PM_RECEIVER_VMMC1_VSEL_30 0x02
> #define TWL4030_PM_RECEIVER_VMMC1_VSEL_32 0x03
> +#define TWL4030_PM_RECEIVER_VMMC2_VSEL_300x0B
> +#define TWL4030_PM_RECEIVER_VMMC2_VSEL_320x0C
> #define TWL4030_PM_RECEIVER_VSIM_VSEL_18  0x03
> 
> /* Device Selection in PM Receiver Module */
> -- 
> 1.7.9.5

Acked-by: Pantelis Antoniou 

Thanks, applied.

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


Re: [U-Boot] Inconsistency between $filesize and commands which accept numeric params.

2014-10-30 Thread Wolfgang Denk
Dear Ian,

In message <1414677435.2064.34.ca...@hellion.org.uk> you wrote:
> It seems there is some inconsistency wrt number base between commands
> which set $filesize in the env and the commands which might consume
> them.

That would be bugs, then.

> 
> sun7i# load scsi 0 $fdt_addr_r dtbs/$fdtfile
> 21639 bytes read in 191 ms (110.4 KiB/s)
> sun7i# printenv filesize
> filesize=5487
> 
> So filesize is in hex, but without an 0x prefix. But:

This is normal.  U-Boot uses hex input base by default.  All commands
should take hex input; the only inglorious exception is the "sleep"
command which takes decimal; numbers as arguments.

> sun7i# fdt addr $fdt_addr_r 0x1 
> sun7i# fdt set /chosen foo <$filesize>
> sun7i# fdt print /chosen foo  
> foo = <0x156f>
> 
> IOW the parameter to fdt set has been interpreted as a decimal.

That's a bug.

> So I'm not sure if the bug is that setenv_hex doesn't include the 0x, or

No 0x prefix should be needed anywhere.

> that fdt set interprets things as decimal by default instead of hex. Or
> maybe there is no bug at all?

The bug is in fdt set, then.


Thanks for pointing out!

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
Prediction is very difficult, especially of the future.  - Niels Bohr
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Need FTP client support in U-Boot

2014-10-30 Thread Wolfgang Denk
Dear Madhukar,

In message 
 
you wrote:
>
> Authentication mechanism support available in U-boot, What is that and how(
> any Doc's or Links) ?

See for example doc/uImage.FIT/verified-boot.txt

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
A secure program has to be robust: it  must  be  able  to  deal  with
conditions  that "can't happen", whether user input, program error or
library/etc. This is basic damage  control.  Buffer  overflow  errors
have nothing to do with security, but everything with stupidity.
 -- Wietse Venema in <5cnqm3$8...@spike.porcupine.org>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] verified boot of beaglebone black

2014-10-30 Thread Simon Glass
Hi,

On 30 October 2014 01:15, Srinivasan S  wrote:
> Hi Simon,
>
> Extremely Sorry to push you Hard, Could you please provide any updates w.r.t 
> the below issue

I think you missed my reply, am removing context...

>
Please use the latest mainline, or at least U-Boot 2014.07. That board
does not exist in older versions.


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


Re: [U-Boot] [BUG] kwimage v0 broken

2014-10-30 Thread drEagle
On 27/10/2014 08:18, Stefan Roese wrote:
> Hi!
> 
> On 25.10.2014 07:59, drEagle wrote:
>> With the latest u-boot mainline from denx git, the kirkwood image old 
>> version/format are broken;
>> Sheevaplug u-boot.kwb is no more flahsable and brick the plug.
>>
>> Using an older mkimage version still work with the same u-boot binary.
>>
>> u-boot (in elf loading mode) still work well also.
>>
>> If I can help by some tests, please feel free to ask.
>>
>> PS: I'm not on the list, thans to cc me.
> 
> Hmmm. I have no access to a mainlined Kirkwood board right now. So I can't 
> really test right now. I added Luka to Cc, as he did some testing on this 
> patch series a few weeks ago. And IIRC, he didn't experience any such 
> problems with the kwimage tool.
> 
> Luka, could you perhaps take another look at it? And give the current 
> mainline version a try on your board?

I can give some tests if you want, with sheevaplugs and guruplugs.

I also have a Mirabox for testing purpose.

Ask if you need more feedbacks with some notes.

Feel free to ask.

Regards,
Gérald



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 0/2] arm: marvell: sheevaplug: add FDT and fixes MTDPARTS

2014-10-30 Thread drEagle
Hi Prafulla,

Can anyone review these patches ?

Regards,

On 25/10/2014 07:54, Gerald Kerma wrote:
> These series of patch :
>  - fixes ENV and MTDPARTS for sheevaplug
>  - add FDT support for sheevaplug
>  - add the possibility to use a bootstrap from nand (bootscript)
> 
> Gerald Kerma (2):
>   arm: marvell: add LIBFDT support to sheevaplug
>   arm: marvell: fix ENV and MTDPARTS for sheevaplug
> 
>  include/configs/sheevaplug.h | 62 
> ++--
>  1 file changed, 42 insertions(+), 20 deletions(-)
> 




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] arm: socfpga: Add example config entry for EPCS/EPCQ SPI

2014-10-30 Thread Jagan Teki
On 30 October 2014 15:00, Marek Vasut  wrote:
> Add example config file entry for the Altera SPI controller. This SPI
> controller can also, under special conditions, be used to operate the
> EPCS/EPCQ SPI NOR.
>
> Signed-off-by: Marek Vasut 
> Cc: Chin Liang See 
> Cc: Dinh Nguyen 
> Cc: Vince Bridgers 
> Cc: Pavel Machek 
> Cc: Stefan Roese 
> ---
>  include/configs/socfpga_common.h | 19 +++
>  1 file changed, 19 insertions(+)
>
> diff --git a/include/configs/socfpga_common.h 
> b/include/configs/socfpga_common.h
> index 83a1bcd..1df886b 100644
> --- a/include/configs/socfpga_common.h
> +++ b/include/configs/socfpga_common.h
> @@ -79,6 +79,25 @@
>  #define CONFIG_SYS_PL310_BASE  SOCFPGA_MPUL2_ADDRESS
>
>  /*
> + * EPCS/EPCQx1 Serial Flash Controller
> + */
> +#ifdef CONFIG_ALTERA_SPI
> +#define CONFIG_CMD_SPI
> +#define CONFIG_CMD_SF
> +#define CONFIG_SF_DEFAULT_SPEED3000
> +#define CONFIG_SPI_FLASH
> +#define CONFIG_SPI_FLASH_STMICRO
> +#define CONFIG_SPI_FLASH_BAR
> +/*
> + * The base address is configurable in QSys, each board must specify the
> + * base address based on it's particular FPGA configuration. Please note
> + * that the address here is incremented by  0x400  from the Base address
> + * selected in QSys, since the SPI registers are at offset +0x400.
> + * #define CONFIG_SYS_SPI_BASE 0xff240400

So each board-specific config header will define CONFIG_SYS_SPI_BASE is it?
for using ALTERA_SPI

> + */
> +#endif
> +
> +/*
>   * Ethernet on SoC (EMAC)
>   */
>  #if defined(CONFIG_CMD_NET) && !defined(CONFIG_SOCFPGA_VIRTUAL_TARGET)
> --
> 2.0.0

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


Re: [U-Boot] [PATCH] arm: mxs: Define bootscript env variable on m28evk

2014-10-30 Thread Stefano Babic
On 12/10/2014 00:00, Marek Vasut wrote:
> The patch below failed to define the variable, so define it
> to make it consistent with M53EVK.
> 
> commit a428ac914b2b6db851c1feac98622f2d9844db45
> Author: Lothar Rubusch 
> Date:   Thu Jun 26 11:01:29 2014 +0200
> 
> ARM: m28evk: Update default environment
> 
> Signed-off-by: Marek Vasut 
> Cc: Tom Rini 
> Cc: Wolfgang Denk 
> Cc: Stefano Babic 
> ---

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 0/6] Addition of new board Peach-Pi

2014-10-30 Thread Akshay Saraswat
Hi Simon,

Apologies for the delay in reply. I was out of office.

>Hi Akshay,
>
>
>On 17 October 2014 11:52, Simon Glass wrote:
>>
>> Hi Akshay,
>>
>> On 15 October 2014 18:38, Akshay Saraswat wrote:
>> > Now we are adding a new Peach-Pi board which is a variant of Peach-Pit
>> > and is based on Exynos5800. Exynos5800 itself is a variant of Exynos5420,
>> > hence, most of the hardware config and settings are reused for this board.
>> >
>> > Changes since v1:
>> > - Rebased all the patches.
>>
>> Sadly this still doesn't work for me. I'll try to debug it.
>
>Here's what I found. I am using Pi MP dated in April.
>
>1. It won't boot at all with the patches, but if I change ARM
>frequency in the device tree from 1700 MHz to 900 MHz then it will
>boot into SPL OK. This is the same issue as I have on Pit. I'm not
>sure why this is. See U-Boot mainline commit e4d7610 for what I did.
>

I don't know why this is happening because, as far as I know, right
now we are running both 5420 and 5800 at 900 MHz. We are not using
dmc node to extract and scale to the max freq value. I will check
again and fix any side effects due to this.

>2. USB boot hangs in the IROM - it gets as far as calling the IROM to
>load from USB, but dies in the IROM and does not return. So USB loads
>BL1, BL2 but will not load U-Boot. I wonder if the IROM USB entry
>point has changed for this chip?

No, as far as I know, IROM USB entry points are same because we are
using same entry point in firmware-pit-4482.B branch, which works fine.

>
>3. SD boot works OK and gets as far as U-Boot, but it dies inside
>initcall_run_list() called from board_init_f(). It seems to crash on
>the first function call. I can't really explain that at all. The first
>call is to setup_mon_len() and if I call that explicitly then it works
>fine.

On my board SD boot works fine and I see U-Boot prompt everytime I boot.

>
>So I wonder if the SDRAM init is broken in some way, and there is some
>other problem with USB.
>

I compared and found SDRAM init same as the one in firmware-pit-4482.B
branch. It should not be the cause.

>In terms of testing with USB download, you should be able to use a
>simple script that calls smdk_usbdl three times, once each with BL1,
>BL2 and U-Boot. You might need a short sleep before the first one. I
>can help you debug cros_bundle_firmware but at present there is not
>much point since there seems to be some other problem.
>

I changed download_list in ExynosFlashImage of write_firmware.py
script to load my bins instead of the ones residing in firmware
directory. It works fine for Pit but for Pi, it fails while loading
u-boot-dtb.bin and EC log shows "XPSHOLD not seen in time" which is
very strange because if SPL was not executed who was trying to download
u-boot binary. 
I will now try to fix this download failure.

>Regards,
>Simon

I couldn't find any MP board here.
Tested these patches over PV1 and PV2.

Steps I followed for testing -

$ make peach-pi_config
$ make -j32
$ sudo dd if=u-boot.bl1.bin of=/dev/sdc bs=512 seek=1
$ sudo dd if=spl/smdk5420-spl.bin of=/dev/sdc bs=512 seek=17
$ sudo dd if=u-boot-dtb.bin of=/dev/sdc bs=512 seek=49

Console Log -

U-Boot 2014.10-rc2-17295-g8ecd390-dirty (Oct 30 2014 - 17:23:07) for Peach-Pi
CPU:Exynos5800@900MHz
Board: Samsung/Google Peach Pi board based on Exynos5800
I2C:   ready
DRAM:  3.5 GiB
trace: copying 0008bb3c bytes of early data from 5000 to febfb000
trace: enabled
MMC:   EXYNOS DWMMC: 0, EXYNOS DWMMC: 1
SF: Detected W25Q32DW with page size 256 Bytes, erase size 4 KiB, total 4 MiB
TPS65090 PMIC EC init
exynos_lcd_power_on: ps8625_init() failed
DP Change lane bw to 1.62Gbps
DP dp_sw_link_traning() failed
DP link training fail
In:serial
Out:   lcd
Err:   lcd
Net:   No ethernet found.
Hit any key to stop autoboot:  0 
Peach-Pi # 
Peach-Pi # 

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


[U-Boot] [PATCH] arm: fix a typo of instruction operand

2014-10-30 Thread Jethro Hsu
>From 79344f479bad75b47477dcc9768e564e02f72f59 Mon Sep 17 00:00:00 2001
From: Jethro Hsu 
Date: Thu, 30 Oct 2014 17:26:00 +0800
Subject: [PATCH] arm: fix a typo of instruction operand

To fix compile error caused by incorrect data format,
add "0x" to specify the operand value in hex mode.

error message:

arch/arm/lib/gic_64.S: Assembler messages:
arch/arm/lib/gic_64.S:187: Error: unexpected characters
following instruction at operand 3 -- `and w9,w9,#3ff'

Change-Id: Ifef22c6d9a0f6a4255b3f2daf96bef08db6731dc
Signed-off-by: Jethro Hsu 
Cc: Albert Aribaud 
Cc: Arnab Basu 
Cc: David Feng 
Cc: York Sun 
Cc: Scott Wood 
---
 arch/arm/include/asm/macro.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/include/asm/macro.h b/arch/arm/include/asm/macro.h
index 541b443..1c8c425 100644
--- a/arch/arm/include/asm/macro.h
+++ b/arch/arm/include/asm/macro.h
@@ -193,7 +193,7 @@ lr  .reqx30
 0 :wfi
ldr \wreg2, [\xreg1, GICC_AIAR]
str \wreg2, [\xreg1, GICC_AEOIR]
-   and \wreg2, \wreg2, #3ff
+   and \wreg2, \wreg2, #0x3ff
cbnz\wreg2, 0b
 .endm
 #endif
--
1.8.3.1
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] Inconsistency between $filesize and commands which accept numeric params.

2014-10-30 Thread Ian Campbell
It seems there is some inconsistency wrt number base between commands
which set $filesize in the env and the commands which might consume
them.

e.g.

sun7i# load scsi 0 $fdt_addr_r dtbs/$fdtfile
21639 bytes read in 191 ms (110.4 KiB/s)
sun7i# printenv filesize
filesize=5487

So filesize is in hex, but without an 0x prefix. But:

sun7i# fdt addr $fdt_addr_r 0x1 
sun7i# fdt set /chosen foo <$filesize>
sun7i# fdt print /chosen foo  
foo = <0x156f>

IOW the parameter to fdt set has been interpreted as a decimal.

If $filesize happens to contains digits [a-f] then:

sun7i# load scsi 0 $fdt_addr_r dtbs/sun6i-a31-app4-evb1.dtb
16563 bytes read in 478 ms (33.2 KiB/s)
sun7i# printenv filesize
filesize=40b3
sun7i# fdt set /chosen foo <$filesize> 
Sorry, I could not convert "b3>"

Obviously I can hack around this with:
sun7i# fdt set /chosen foo <0x$filesize>

But that seems a bit of an odd thing to have to do (not to mention
potentially fragile).

There seem to be other commands, e.g. mmc write which interpret their
parameters as hex by default, although in that case it does also DTRT
with an 0x prefix.

So I'm not sure if the bug is that setenv_hex doesn't include the 0x, or
that fdt set interprets things as decimal by default instead of hex. Or
maybe there is no bug at all?

Just changing the setenv_hex to include the 0x seemed at first glance
like a good idea, but I'm not really sure.

Thanks,
Ian.

PS my usecase is to implement the fdt based multiboot protocol which Xen
uses in order to load boot-modules, see e.g.
http://wiki.xen.org/wiki/Xen_ARM_with_Virtualization_Extensions/Allwinner#Boot_script
http://wiki.xen.org/wiki/Xen_ARM_with_Virtualization_Extensions/Multiboot
(we use something like this on all u-boot based platforms, Allwinner is
just an example).

Ian.

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


Re: [U-Boot] [PATCH 3/3] odroid: adjust gpio calls to dm gpio api

2014-10-30 Thread Minkyu Kang
On 29/10/14 01:31, Przemyslaw Marczak wrote:
> Setting gpio value before dm gpio init has no effect,
> so now, odroid gpio settings are moved after the gpio uclass init.
> 
> Using non-requested gpio pin cases printing error messages.
> To avoid this, gpio_request() is added for those gpios.
> 
> Signed-off-by: Przemyslaw Marczak 
> ---
>  board/samsung/odroid/odroid.c | 11 ++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
> 


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 1/3] exynos4/4x12: cpu: add extra gpio base addresses

2014-10-30 Thread Minkyu Kang
On 29/10/14 01:31, Przemyslaw Marczak wrote:
> After remove the offsets in Exynos4/4x12 gpio enums,
> an additional gpio base addresses are required.
> 
> Signed-off-by: Przemyslaw Marczak 
> ---
>  arch/arm/include/asm/arch-exynos/cpu.h | 9 +
>  1 file changed, 9 insertions(+)
> 

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 2/3] exynos4/4x12: gpio: use gpio extra base addresses

2014-10-30 Thread Minkyu Kang
On 29/10/14 01:31, Przemyslaw Marczak wrote:
> This patch adds extra gpio part addresses to exynos4
> and exynos4x12_gpio_data arrays, which are required
> since the gpio enum lists are linear
> 
> Signed-off-by: Przemyslaw Marczak 
> ---
>  arch/arm/include/asm/arch-exynos/gpio.h | 59 
> ++---
>  1 file changed, 39 insertions(+), 20 deletions(-)
> 

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 v2 2/2] exynos5: Use config_distro_bootcmd.h

2014-10-30 Thread Minkyu Kang
On 16/10/14 22:44, Ian Campbell wrote:
> From: Ian Campbell 
> 
> This replaces the existing CONFIG_BOOTCOMMAND for exynos5250 and 5420.
> 
> exynos4 platforms seem to have existing complex extra env configuration for
> booting and so are excluded here. Hence the bootcmd.h is added to
> exynos5-common.h.
> 
> I have build tested on all exynos platforms (MAKEALL -s exynos), but only boot
> tested on arndale.
> 
> Signed-off-by: Ian Campbell 
> ---
> v2: This was previously "arndale: Use config_distro_bootcmd.h" but required
> significant rebasing.
> 
> Is replacing the existing bootcommand in this way acceptable? The
> distro_bootcmd.h infrastructure does not seem to provide a way to integrate 
> the
> "raw" style of booting.
> ---
>  include/configs/arndale.h   |  3 +++
>  include/configs/exynos5-common.h| 45 
> ++---
>  include/configs/exynos5-dt-common.h | 17 ++
>  include/configs/exynos5250-common.h |  2 --
>  include/configs/exynos5420-common.h |  2 --
>  5 files changed, 47 insertions(+), 22 deletions(-)
> 

please rebase this patch.

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


Re: [U-Boot] [PATCH v2 1/2] exynos: Enable config_distro_defaults.h

2014-10-30 Thread Minkyu Kang
On 16/10/14 22:44, Ian Campbell wrote:
> From: Ian Campbell 
> 
> ...and remove explicit setting of things which this implies. This is done for
> all exynos platforms (4 & 5) so it is added to exynos-common.h
> 
> I'm mainly interested in CONFIG_CMD_BOOTZ and CONFIG_SUPPORT_RAW_INITRD
> 
> I have build tested on all exynos platforms (MAKEALL -s exynos), but only boot
> tested on arndale.
> 
> Signed-off-by: Ian Campbell 
> ---
> v2: This patch was previously "arndale: Enable config_distro_defaults.h". It
> required significant rebasing.
> ---
>  include/configs/arndale.h|  2 --
>  include/configs/exynos-common.h  | 13 ++---
>  include/configs/exynos5-common.h | 11 ---
>  3 files changed, 2 insertions(+), 24 deletions(-)
> 

please rebase this patch.

patching file include/configs/arndale.h
patching file include/configs/exynos-common.h
Hunk #1 succeeded at 30 (offset 7 lines).
Hunk #2 succeeded at 39 (offset 7 lines).
Hunk #3 succeeded at 57 (offset 7 lines).
Hunk #4 FAILED at 59.
Hunk #5 succeeded at 91 (offset 8 lines).

Thanks,
Minkyu Kang.

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


[U-Boot] [PATCH v3] arm: mx6: add support for TBS2910 Matrix ARM miniPC

2014-10-30 Thread Soeren Moch
Add initial support for TBS2910 Matrix ARM miniPC.
Support includes MMC, Ethernet, UARTs, HDMI, USB, SATA, PCI, I2C, RTC.

Signed-off-by: Soeren Moch 
---
Cc: Stefano Babic 
Cc: Fabio Estevam 

Changes in v2:
- board_phy_config() removed, not needed
- VESA compliant HDMI video timing
- setup_display() moved from board_early_init_f() to board_init()
- add_board_boot_modes() moved from board_late_init() to board_init()
- board_late_init() removed

Changes in v3:
- fix checkpatch errors
---
 arch/arm/Kconfig|   4 +
 board/tbs/tbs2910/Kconfig   |  23 +++
 board/tbs/tbs2910/Makefile  |   7 +
 board/tbs/tbs2910/tbs2910.c | 398 
 configs/tbs2910_defconfig   |   3 +
 include/configs/tbs2910.h   | 242 +++
 6 files changed, 677 insertions(+)
 create mode 100644 board/tbs/tbs2910/Kconfig
 create mode 100644 board/tbs/tbs2910/Makefile
 create mode 100644 board/tbs/tbs2910/tbs2910.c
 create mode 100644 configs/tbs2910_defconfig
 create mode 100644 include/configs/tbs2910.h

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 72558b8..cb72381 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -414,6 +414,9 @@ config TARGET_GW_VENTANA
 config TARGET_HUMMINGBOARD
bool "Support hummingboard"
 
+config TARGET_TBS2910
+   bool "Support tbs2910"
+
 config TARGET_TQMA6
bool "TQ Systems TQMa6 board"
 
@@ -682,6 +685,7 @@ source "board/sunxi/Kconfig"
 source "board/syteco/jadecpu/Kconfig"
 source "board/syteco/zmx25/Kconfig"
 source "board/taskit/stamp9g20/Kconfig"
+source "board/tbs/tbs2910/Kconfig"
 source "board/ti/am335x/Kconfig"
 source "board/ti/am43xx/Kconfig"
 source "board/ti/ti814x/Kconfig"
diff --git a/board/tbs/tbs2910/Kconfig b/board/tbs/tbs2910/Kconfig
new file mode 100644
index 000..c514e24
--- /dev/null
+++ b/board/tbs/tbs2910/Kconfig
@@ -0,0 +1,23 @@
+if TARGET_TBS2910
+
+config SYS_CPU
+   string
+   default "armv7"
+
+config SYS_BOARD
+   string
+   default "tbs2910"
+
+config SYS_VENDOR
+   string
+   default "tbs"
+
+config SYS_SOC
+   string
+   default "mx6"
+
+config SYS_CONFIG_NAME
+   string
+   default "tbs2910"
+
+endif
diff --git a/board/tbs/tbs2910/Makefile b/board/tbs/tbs2910/Makefile
new file mode 100644
index 000..9d9eb87
--- /dev/null
+++ b/board/tbs/tbs2910/Makefile
@@ -0,0 +1,7 @@
+#
+# Copyright (C) 2014 Soeren Moch 
+#
+# SPDX-License-Identifier: GPL-2.0+
+#
+
+obj-y  := tbs2910.o
diff --git a/board/tbs/tbs2910/tbs2910.c b/board/tbs/tbs2910/tbs2910.c
new file mode 100644
index 000..daf8ff4
--- /dev/null
+++ b/board/tbs/tbs2910/tbs2910.c
@@ -0,0 +1,398 @@
+/*
+ * Copyright (C) 2014 Soeren Moch 
+ *
+ * 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 
+#include 
+DECLARE_GLOBAL_DATA_PTR;
+
+#define WEAK_PULLUP(PAD_CTL_PUS_47K_UP |   \
+   PAD_CTL_SPEED_LOW | PAD_CTL_DSE_40ohm | PAD_CTL_HYS |   \
+   PAD_CTL_SRE_SLOW)
+
+#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 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 I2C_PAD MUX_PAD_CTRL(I2C_PAD_CTRL)
+
+#ifdef CONFIG_SYS_I2C
+/* I2C1, SGTL5000 */
+static struct i2c_pads_info i2c_pad_info0 = {
+   .scl = {
+   .i2c_mode = MX6_PAD_CSI0_DAT9__I2C1_SCL | I2C_PAD,
+   .gpio_mode = MX6_PAD_CSI0_DAT9__GPIO5_IO27 | I2C_PAD,
+   .gp = IMX_GPIO_NR(5, 27)
+   },
+   .sda = {
+   .i2c_mode = MX6_PAD_CSI0_DAT8__I2C1_SDA | I2C_PAD,
+   .gpio_mode = MX6_PAD_CSI0_DAT8__GPIO5_IO26 | I2C_PAD,
+   .gp = IMX_GPIO_NR(5, 26)
+   }
+};
+
+/* I2C2 HDMI */
+static struct i2c_pads_info i2c_pad_info1 = {
+   .scl = {
+   .i2c_mode = MX6_PAD_KEY_COL3__I2C2_SCL | I2C_PAD,
+   .gpio_mode = MX6_PAD_KEY_COL3__GPIO4_IO12 | I2C_PAD,
+   .gp = IMX_GPIO_NR(4, 12)
+   },
+   .sda = {
+   .i2c_mode = MX6_PAD_KEY_ROW3__I2C2_SDA | I2C_PAD,
+   .gpio_mode = MX6_PAD_KEY_ROW3__GPIO4_IO13 | I2C_PAD,
+   .gp = IMX_GPIO_NR(4, 13)
+   }
+};
+
+/* I2C3, CON11, DS1307, PCIe_SMB */
+static struct i2c_pads_info i2c_pad_info2 = {
+   .scl = {
+   .i2c_mode = MX6_PAD

Re: [U-Boot] Need FTP client support in U-Boot

2014-10-30 Thread Mythri, Madhukar (Artesyn)
Hi Wolfgang,

>> If not, we are looking for any "Authenticated" file transfer over
>> network in existing U_boot.

>This probably makes more sense - especially, as it's already supported in 
>mainline U-Boot - assuming you have good ways to manage your keys on your 
>device.

Authentication mechanism support available in U-boot, What is that and how(any 
Doc's or Links) ?

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


Re: [U-Boot] [PATCH v2 2/3] arm: mx6: add support for TBS2910 Matrix ARM miniPC

2014-10-30 Thread Fabio Estevam
Hi Soeren,

On Fri, Oct 24, 2014 at 12:33 PM, Soeren Moch  wrote:
> Add initial support for TBS2910 Matrix ARM miniPC.
> Support includes MMC, Ethernet, UARTs, HDMI, USB, SATA, PCI, I2C, RTC.
>
> Signed-off-by: Soeren Moch 
> ---
> Cc: Stefano Babic 
>
> Changes in v2:
> - board_phy_config() removed, not needed
> - VESA compliant HDMI video timing

I tested your HDMI changes on a mx6qsabresd and now I see an accurate
60Hz signal instead of the original 69Hz.

Good job!

Thanks,

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


Re: [U-Boot] [PATCH v3 0/3] spi, sf: add mtdparts feature to spi and sf commands

2014-10-30 Thread Heiko Schocher

Hello Jagan,

Am 09.10.2014 12:38, schrieb Jagan Teki:

On 8 October 2014 11:01, Heiko Schocher  wrote:

Hello Jagannadha Sutradharudu Teki,

Am 05.09.2014 07:38, schrieb Heiko Schocher:


This patchserie add the popssibility to define mtd partitions on
spi nor flash, and use this settings with the sf commands.

steps:

- add MTD layer driver for spi, original patch from:

http://git.denx.de/?p=u-boot/u-boot-mips.git;a=commitdiff;h=bb246819cdc90493dd7089eaa51b9e639765cced

and addapted it to current mainline.

- move common functions to get offset and size from
cmdline nand command to extract offset and size from
a mtd partition to common place "drivers/mtd/mtd_uboot.c"
maybe another place is better?

- add to the sf command the possibility to use offset and size from
the settings in mtdparts

With this patchset, the sf command looks now:

=>   sf
sf - SPI flash sub-system

Usage:
sf probe [[bus:]cs] [hz] [mode] - init flash device on given SPI bus
and chip select
sf read addr offset|partition len   - read `len' bytes starting at
`offset' to memory at `addr'
sf write addr offset|partition len  - write `len' bytes from memory
at `addr' to flash at `offset'
sf erase offset|partition [+]len- erase `len' bytes from `offset'
`+len' round up `len' to block
size
sf update addr offset|partition len - erase and write `len' bytes from
memory
at `addr' to flash at `offset'
=>
for example "env" is defined in mtdparts:

=>   sf read 1300 env
device 0 offset 0xd, size 0x1
SF: 65536 bytes @ 0xd Read: OK
=>






There are the followings checkpatch warnings:

CHECK: Alignment should match open parenthesis
#153: FILE: common/cmd_nand.c:217:
+   if (arg_off(argv[2],&idx,&addr,&maxsize,&maxsize,
+   MTD_DEV_TYPE_NAND, nand_info[idx].size)) {

CHECK: Alignment should match open parenthesis
#179: FILE: common/cmd_nand.c:557:
+   if (arg_off(argv[3],&dev,&off,&size,&maxsize,
+   MTD_DEV_TYPE_NAND, nand_info[dev].size))

CHECK: Alignment should match open parenthesis
#193: FILE: common/cmd_nand.c:576:
+   if (arg_off_size(argc - 3, argv +
3,&dev,&off,&size,
+&maxsize, MTD_DEV_TYPE_NAND,

total: 0 errors, 0 warnings, 3 checks, 361 lines checked

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


20140714_ml_mtdparts/0002-mtd-nand-move-common-functions-from-cmd_nand.c-to-co.patch
has style problems, please review.

I see not, why this warning pops up ...

- changes for v2:
- mtd-spi-add-MTD-layer-driver.patch
  - add comment from Daniel Schwierzeck:
fix compile error from original patch with
"static inline" rather than "static __maybe_unused"
- changes for v3:
- rebase with d6c1ffc7d23f4fe4ae8c91101861055b8e1501b6
- add comments from scott wood:
  - align MTD_DEV_TYPE_NAND correct
  - remove unnecessary inline
  - rework "jffs2 header" problem later

Cc: Scott Wood
Cc: Tom Rini
Cc: Daniel Schwierzeck
Cc: Jagannadha Sutradharudu Teki



ping? Do you have any objections against this patchseries, or do you
think it is ok?


Please wait for dm-spi to be happen first, so-that we sync again this mtd on top
of that.


I did just a rebase for this patchset with current ML ... but I lost
track of the patches, for which we are waiting ... Are this patches
now in ML (so I can resend a next version)?

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] u-boot 1.1.6 binary file

2014-10-30 Thread Wolfgang Denk
Dear Roar,

In message  
you wrote:
> 
> I have a MPC8641 board which have corrupt flash and I have to restore
> the bootloader on the card.

What is the exact board name - who is the vendor?  I'm asking because
you really have to make sure that you are running unmodified mainline
U-Boot on that board.

> The card had version 1.1.6, but I have no access to a powerpc so I can't 
> compile
> the source code.

U-Boot can be cross compiled on any x86 PC.

> Is there a place where I can fine a bin file ?
> Or could someone who have access to a powerpc with gcc compiler
> compile version 1.1.6 for me ?
> 
> Or is it possible to get the bootloader file from a card that works ?
> 
> 
> The command to install the bootloader is this :
> 
> => fload tftp fc00 bootromF64.bin

This is not U-Boot syntax.  Mainline U-Boot does not support something
as a "fload" command.  What sort of softewaare is running at this
point of time?

Do you have access to the original source code of the boot loader
running on your system?

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
Perl already has an IDE.  It's called Unix.
  -- Tom Christiansen in 375bd...@cs.colorado.edu
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] Remove unused files

2014-10-30 Thread Wolfgang Denk
Dear Masahiro Yamada,

In message <1414661281-4633-1-git-send-email-yamad...@jp.panasonic.com> you 
wrote:
> [1] arch/arm/include/asm/arch-at91/at91_shdwn.h
>  The top9000 was the last board to use this header file.
>  It was removed by commit d58a9451e733 (ppc/arm: zap EMK boards).

Mea culpa.  Sorry for missing that.

> Signed-off-by: Masahiro Yamada 
> ---
> 
>  arch/arm/include/asm/arch-at91/at91_shdwn.h |  35 --
>  board/matrix_vision/common/Makefile |   8 --
>  board/matrix_vision/common/mv_common.c  | 112 --
>  board/matrix_vision/common/mv_common.h  |   9 --
>  include/usb/omap1510_udc.h  | 174 
> 
>  5 files changed, 338 deletions(-)
>  delete mode 100644 arch/arm/include/asm/arch-at91/at91_shdwn.h
>  delete mode 100644 board/matrix_vision/common/Makefile
>  delete mode 100644 board/matrix_vision/common/mv_common.c
>  delete mode 100644 board/matrix_vision/common/mv_common.h
>  delete mode 100644 include/usb/omap1510_udc.h

Acked-By: Wolfgang Denk 

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
For those who like this sort of thing, this is the sort of thing they
like.   - Abraham Lincoln
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Need FTP client support in U-Boot

2014-10-30 Thread Wolfgang Denk
Dear Madhu,

In message 
<8f2265d4f62b409f83f6bdd21953d...@sg2pr01mb0394.apcprd01.prod.exchangelabs.com> 
you wrote:
> 
> Our motivation is to boot the OS over the network using FTP (
> because it is going to be more secure with login/passwd credentials,
> before file-transfer), instead of TFTP. Hence we are exploring the
> option of FTP client in U-Boot..

If you are concerned about security you should NOT use FTP, as FTP
authentication is based on a clear-text protocol, i. e. it will
transmit your password in plain text over the network.  Anyone able
to run a sniffer anywhere on this net will be able to see it.

> If not, we are looking for any "Authenticated" file transfer over
> network in existing U_boot.

This probably makes more sense - especially, as it's already supported
in mainline U-Boot - assuming you have good ways to manage your keys
on your device.

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
He who hesitates is not only lost, but miles from the next exit.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] Remove the CREDITS file

2014-10-30 Thread Wolfgang Denk
Dear Masahiro Yamada,

In message <1414651815-23671-1-git-send-email-yamad...@jp.panasonic.com> you 
wrote:
> This file is not maintained these days.
> 
> We use MAINTAINERS for the maintainership of the supported boards.
> For dead boards, we have some clues in doc/README.scrapyard and
> also imperishable history in git-log.
> 
> Signed-off-by: Masahiro Yamada 
> Cc: Wolfgang Denk 
> ---
> 
>  CREDITS | 536 
> 
>  1 file changed, 536 deletions(-)
>  delete mode 100644 CREDITS

Acked-By: Wolfgang Denk 

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
Always borrow money from a pessimist; they don't expect  to  be  paid
back.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2] arm, imx, spi: detect spi flash again on aristainetos board

2014-10-30 Thread Heiko Schocher
155fa9af95a "spi: mxc: fix sf probe when using mxc_spi" break
spi flash detection on the aristainetos board. Fix this.

Signed-off-by: Heiko Schocher 

---

Changes in v2:
- fix bus number

 board/aristainetos/aristainetos.c | 6 ++
 include/configs/aristainetos.h| 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/board/aristainetos/aristainetos.c 
b/board/aristainetos/aristainetos.c
index 3bfcf5b..06922c0 100644
--- a/board/aristainetos/aristainetos.c
+++ b/board/aristainetos/aristainetos.c
@@ -230,6 +230,12 @@ static iomux_v3_cfg_t const backlight_pads[] = {
MX6_PAD_GPIO_2__GPIO1_IO02 | MUX_PAD_CTRL(NO_PAD_CTRL),
 };
 
+int board_spi_cs_gpio(unsigned bus, unsigned cs)
+{
+   return (bus == CONFIG_SF_DEFAULT_BUS && cs == CONFIG_SF_DEFAULT_CS)
+   ? (IMX_GPIO_NR(3, 20)) : -1;
+}
+
 static void setup_spi(void)
 {
int i;
diff --git a/include/configs/aristainetos.h b/include/configs/aristainetos.h
index 20aea85..e6a08df 100644
--- a/include/configs/aristainetos.h
+++ b/include/configs/aristainetos.h
@@ -77,7 +77,7 @@
 #define CONFIG_SPI_FLASH_STMICRO
 #define CONFIG_MXC_SPI
 #define CONFIG_SF_DEFAULT_BUS  3
-#define CONFIG_SF_DEFAULT_CS   (0|(IMX_GPIO_NR(3, 20)<<8))
+#define CONFIG_SF_DEFAULT_CS   0
 #define CONFIG_SF_DEFAULT_SPEED2000
 #define CONFIG_SF_DEFAULT_MODE SPI_MODE_0
 #define CONFIG_SYS_SPI_ST_ENABLE_WP_PIN
-- 
1.8.3.1

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


Re: [U-Boot] [v2 PATCH 10/12] arm, spl, at91: add at91sam9260 and at91sam9g45 spl support

2014-10-30 Thread Heiko Schocher

Hello Bo,

Am 30.10.2014 11:17, schrieb Bo Shen:

Hi Heiko,

On 10/30/2014 04:15 PM, Heiko Schocher wrote:

diff --git a/arch/arm/include/asm/arch-at91/at91_pmc.h 
b/arch/arm/include/asm/arch-at91/at91_pmc.h
index 27331ff..5f64583 100644
--- a/arch/arm/include/asm/arch-at91/at91_pmc.h
+++ b/arch/arm/include/asm/arch-at91/at91_pmc.h
@@ -95,7 +95,7 @@ typedef struct at91_pmc {
#define AT91_PMC_MCKR_CSS_MAIN 0x0001
#define AT91_PMC_MCKR_CSS_PLLA 0x0002
#define AT91_PMC_MCKR_CSS_PLLB 0x0003
-#define AT91_PMC_MCKR_CSS_MASK 0x0003
+#define AT91_PMC_MCKR_CSS_MASK 0x0007


Where this come from, CSS only two bits.


Good question ... looked again into the doc, it is only two bits.




#ifdef CONFIG_SAMA5D3
#define AT91_PMC_MCKR_PRES_1 0x
@@ -114,7 +114,7 @@ typedef struct at91_pmc {
#define AT91_PMC_MCKR_PRES_16 0x0010
#define AT91_PMC_MCKR_PRES_32 0x0014
#define AT91_PMC_MCKR_PRES_64 0x0018
-#define AT91_PMC_MCKR_PRES_MASK 0x001C
+#define AT91_PMC_MCKR_PRES_MASK 0x003C


Ditto


Hmm... no idea, why I changed this ... good catch!

Is the rest of the patch (and the patchserie OK) ?

Then I can send a v3 ...

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] arm: socfpga: Add example config entry for EPCS/EPCQ SPI

2014-10-30 Thread Stefan Roese

On 30.10.2014 10:30, Marek Vasut wrote:

Add example config file entry for the Altera SPI controller. This SPI
controller can also, under special conditions, be used to operate the
EPCS/EPCQ SPI NOR.

Signed-off-by: Marek Vasut 
Cc: Chin Liang See 
Cc: Dinh Nguyen 
Cc: Vince Bridgers 
Cc: Pavel Machek 
Cc: Stefan Roese 


Reviewed-by: Stefan Roese 

Thanks,
Stefan

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


Re: [U-Boot] [U-boot] [Patch] net: phy: marvell: add errata w/a for 88E151* chips

2014-10-30 Thread Stefan Roese

On 30.10.2014 10:52, Ivan Khoronzhuk wrote:

+static int m88e1518_config(struct phy_device *phydev)
+{
+/*
+ * As per Marvell Release Notes - Alaska
88E1510/88E1518/88E1512/88E1514
+ * Rev A0, Errata Section 3.1
+ */
+phy_write(phydev, MDIO_DEVAD_NONE, 22, 0x00ff);/* reg page
0xff */
+phy_write(phydev, MDIO_DEVAD_NONE, 17, 0x214B);
+phy_write(phydev, MDIO_DEVAD_NONE, 16, 0x2144);
+phy_write(phydev, MDIO_DEVAD_NONE, 17, 0x0C28);
+phy_write(phydev, MDIO_DEVAD_NONE, 16, 0x2146);
+phy_write(phydev, MDIO_DEVAD_NONE, 17, 0xB233);
+phy_write(phydev, MDIO_DEVAD_NONE, 16, 0x214D);
+phy_write(phydev, MDIO_DEVAD_NONE, 17, 0xCC0C);
+phy_write(phydev, MDIO_DEVAD_NONE, 16, 0x2159);
+phy_write(phydev, MDIO_DEVAD_NONE, 22, 0x);/* reg page 0 */
+phy_write(phydev, MDIO_DEVAD_NONE, 22, 18);/* reg page 18 */
+/* Write HWCFG_MODE = SGMII to Copper */
+m88e1518_phy_writebits(phydev, 20, 0, 3, 1);


Won't this set the mode to SGMII for all users of this code? I know of
at least one board that uses this driver and uses RGMII. So you
shouldn't set this mode here to SGMII unconditionally.

Thanks,
Stefan



Yes.
I will put whole errata w/o under:
if (phydev->interface == PHY_INTERFACE_MODE_SGMII) {

}

as I can face it only for SGMII


Yes. If this errata is really only for SGMII, then putting this code 
under this if() statement makes sense.


Thanks,
Stefan

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


Re: [U-Boot] [PATCH] arm: socfpga: Add example config entry for EPCS/EPCQ SPI

2014-10-30 Thread Pavel Machek
On Thu 2014-10-30 10:30:25, Marek Vasut wrote:
> Add example config file entry for the Altera SPI controller. This SPI
> controller can also, under special conditions, be used to operate the
> EPCS/EPCQ SPI NOR.
> 
> Signed-off-by: Marek Vasut 
> Cc: Chin Liang See 
> Cc: Dinh Nguyen 
> Cc: Vince Bridgers 

Acked-by: Pavel Machek 

> --- a/include/configs/socfpga_common.h
> +++ b/include/configs/socfpga_common.h
> @@ -79,6 +79,25 @@
>  #define CONFIG_SYS_PL310_BASESOCFPGA_MPUL2_ADDRESS
>  
>  /*
> + * EPCS/EPCQx1 Serial Flash Controller
> + */
> +#ifdef CONFIG_ALTERA_SPI
> +#define CONFIG_CMD_SPI
> +#define CONFIG_CMD_SF
> +#define CONFIG_SF_DEFAULT_SPEED  3000
> +#define CONFIG_SPI_FLASH
> +#define CONFIG_SPI_FLASH_STMICRO
> +#define CONFIG_SPI_FLASH_BAR
> +/*
> + * The base address is configurable in QSys, each board must specify the
> + * base address based on it's particular FPGA configuration. Please note
> + * that the address here is incremented by  0x400  from the Base address

Are the double spaces around 0x400 intentional?

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


[U-Boot] [v2 PATCH 0/12] arm, at91, spl: add spl support for the taurus and corvus boards

2014-10-30 Thread Heiko Schocher

This patchset add SPL support for the AT91SAM9G20 based taurus board,
and the AT91SAM9M10G45 based corvus board from siemens, and replaces
the at91bootstrap code.

The boot.bin which replaces the at91bootstrap image can created with
mkimage:

./tools/mkimage -T atmelimage -d spl/u-boot-spl.bin spl/boot.bin

For other SoC this step is done in one step ... should we add this
also for AT91 based boards?

For example add a "u-boot.at91" target in the Makefile?

This patchset is based on the common updates for the taurus
and corvus board:

Patchwork [U-Boot] arm, at91: add generic board support for the taurus and 
corvus board
http://patchwork.ozlabs.org/patch/395398/
(now in mainline)

Patchwork [U-Boot] arm, at91: add spi dataflash support for the taurus board
http://patchwork.ozlabs.org/patch/395400/


Changes in v2:
  - rebased against d58a9451e7339ed4cf2b2627e534611f427fb791
  - spi, atmel: move CONFIG_SYS_SPI_WRITE_TOUT into common header
new in v2
  - add comment from Jagan Teki:
- remove spi_init_f() from board file
- remove CONFIG_SYS_SPI_WRITE_TOUT from board config file
  instead define a default in the spi driver -> new patch for v2
  - add Reviewed-by: Andreas Bießmann 
  - add comment from Andreas Biessmann:
rename "MPDDRC_CR_EBISHARE" to "MPDDRC_CR_DQMS_SHARED"
  - add comment from scott wood:
move nand_erase_one into "include/nand.h" and rename it
to spl_nand_erase_one

Heiko Schocher (12):
  spi, atmel: move CONFIG_SYS_SPI_WRITE_TOUT into common header
  arm, at91: add spi dataflash support for the taurus board
  arm, at91, mpddrc: fix typo in ddr2_init()
  arm, at91: compile mpddrc ram init code also for AT91SAM9M10G45
  arm, at91: add missing ddr2 cr register MPDDRC_CR_EBISHARE define
  spl, nand: add option to boot raw u-boot.bin image only
  mtd: atmel_nand: add missign include
  spl, nand, atmel_nand: add erase one block function
  spl, mtd, nand, atmel_nand: invert device ready pin logic
  arm, spl, at91: add at91sam9260 and at91sam9g45 spl support
  arm, at91, spl: add spl support for the taurus board
  arm, spl, at91: add spl support for the corvus board

 README |   4 +
 arch/arm/Kconfig   |   2 +
 arch/arm/cpu/arm926ejs/at91/at91sam9260_devices.c  |  22 +++
 arch/arm/cpu/arm926ejs/at91/clock.c|  60 +++
 arch/arm/cpu/armv7/at91/clock.c|  27 +++
 arch/arm/cpu/at91-common/Makefile  |   7 +-
 arch/arm/cpu/at91-common/mpddrc.c  |  14 +-
 arch/arm/cpu/at91-common/sdram.c   |  77 +
 arch/arm/cpu/at91-common/spl.c | 185 +++--
 arch/arm/include/asm/arch-at91/at91_common.h   |   4 +
 arch/arm/include/asm/arch-at91/at91_pmc.h  |   5 +-
 arch/arm/include/asm/arch-at91/at91sam9260.h   |   1 +
 .../arm/include/asm/arch-at91/at91sam9260_matrix.h |   5 +
 arch/arm/include/asm/arch-at91/at91sam9_sdramc.h   |  22 ++-
 arch/arm/include/asm/arch-at91/atmel_mpddrc.h  |   1 +
 board/siemens/corvus/board.c   | 109 ++--
 board/siemens/taurus/taurus.c  |  91 --
 common/spl/spl.c   |  15 +-
 common/spl/spl_nand.c  |  13 ++
 configs/corvus_defconfig   |   5 +-
 configs/taurus_defconfig   |   5 +-
 drivers/mtd/nand/atmel_nand.c  |  40 -
 drivers/spi/atmel_spi.h|   4 +
 include/configs/afeb9260.h |   1 -
 include/configs/at91sam9260ek.h|   1 -
 include/configs/at91sam9261ek.h|   1 -
 include/configs/at91sam9263ek.h|   1 -
 include/configs/at91sam9rlek.h |   1 -
 include/configs/corvus.h   |  54 +-
 include/configs/ethernut5.h|   1 -
 include/configs/meesc.h|   1 -
 include/configs/otc570.h   |   1 -
 include/configs/pm9261.h   |   1 -
 include/configs/pm9263.h   |   1 -
 include/configs/sbc35_a9g20.h  |   1 -
 include/configs/taurus.h   |  64 ++-
 include/configs/tny_a9260.h|   1 -
 include/configs/usb_a9263.h|   1 -
 include/nand.h |   1 +
 include/spl.h  |   1 +
 40 files changed, 746 insertions(+), 105 deletions(-)
 create mode 100644 arch/arm/cpu/at91-common/sdram.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] verified boot of beaglebone black

2014-10-30 Thread Srinivasan S
Hi Simon,

Extremely Sorry to push you Hard, Could you please provide any updates w.r.t 
the below issue


Thanks in advance
Srinivasan S

From: s...@google.com  on behalf of Simon Glass 

Sent: Thursday, October 30, 2014 9:46 AM
To: Srinivasan S
Cc: U-Boot Mailing List
Subject: Re: verified boot of beaglebone black

+U-Boot ML

On 29 October 2014 21:09, Srinivasan S  wrote:
> Hi Simon
>
>
> I am trying to implement verified boot process as mentioned in the below
> link
>
> http://lists.denx.de/pipermail/u-boot/2014-June/180845.html
>
>
> And am using the
> /opt/ti-sdk-am335x-evm-07.00.00.00/board-support/u-boot-2013.10-ti2013.12.01/
>
>
> When I was executing step 1 provided in the above link ie., while
>
> Configure and build U-Boot with verified boot enabled
>
> I am facing the below error, could you please help me in resolving this
> issue as early as possible, beacuse am stuck up this issue from past two
> days,
>
>
> srinivasan@tata-HP-Elite-7100-Microtower-PC:~/TUNSTALL/board-support/u-boot-2013.10-ti2013.12.01$
> make O=b/am335x_boneblack_vboot CROSS_COMPILE=arm-linux-gnueabihf- ARCH=arm
> am335x_boneblack_vboot_config all
> Generating
> /home/srinivasan/TUNSTALL/board-support/u-boot-2013.10-ti2013.12.01/b/am335x_boneblack_vboot/include/autoconf.mk
> Generating
> /home/srinivasan/TUNSTALL/board-support/u-boot-2013.10-ti2013.12.01/b/am335x_boneblack_vboot/include/autoconf.mk.dep
> make: *** No rule to make target `am335x_boneblack_vboot_config'.  Stop.
> make: *** [am335x_boneblack_vboot_config] Error 1
> srinivasan@tata-HP-Elite-7100-Microtower-PC:~/TUNSTALL/board-support/u-boot-2013.10-ti2013.12.01$
>
>

Please use the latest mainline, or at least U-Boot 2014.07. That board
does not exist in older versions.

>
> kindly do the needful
>
>
> Awaiting for your replies
>
>
> Many Thanks in Advance
>
>
>
> Srinivasan S
>
>

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


[U-Boot] u-boot 1.1.6 binary file

2014-10-30 Thread Roar Pettersen
Hi !

I have a MPC8641 board which have corrupt flash and I have to restore
the bootloader on the card.

The card had version 1.1.6, but I have no access to a powerpc so I can't compile
the source code.

Is there a place where I can fine a bin file ?
Or could someone who have access to a powerpc with gcc compiler
compile version 1.1.6 for me ?

Or is it possible to get the bootloader file from a card that works ?


The command to install the bootloader is this :

=> fload tftp fc00 bootromF64.bin


Regards

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


[U-Boot] [PATCH] arm, imx, spi: detect spi flash again on aristainetos board

2014-10-30 Thread Heiko Schocher
155fa9af95a "spi: mxc: fix sf probe when using mxc_spi" break
spi flash detection on the aristainetos board. Fix this.

Signed-off-by: Heiko Schocher 
Patch-cc: Stefano Babic 
Patch-cc: Jagannadha Sutradharudu Teki 
---
 board/aristainetos/aristainetos.c | 5 +
 include/configs/aristainetos.h| 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/board/aristainetos/aristainetos.c 
b/board/aristainetos/aristainetos.c
index 3bfcf5b..3c8a0a7 100644
--- a/board/aristainetos/aristainetos.c
+++ b/board/aristainetos/aristainetos.c
@@ -230,6 +230,11 @@ static iomux_v3_cfg_t const backlight_pads[] = {
MX6_PAD_GPIO_2__GPIO1_IO02 | MUX_PAD_CTRL(NO_PAD_CTRL),
 };
 
+int board_spi_cs_gpio(unsigned bus, unsigned cs)
+{
+   return (bus == 0 && cs == 0) ? (IMX_GPIO_NR(3, 20)) : -1;
+}
+
 static void setup_spi(void)
 {
int i;
diff --git a/include/configs/aristainetos.h b/include/configs/aristainetos.h
index 20aea85..e6a08df 100644
--- a/include/configs/aristainetos.h
+++ b/include/configs/aristainetos.h
@@ -77,7 +77,7 @@
 #define CONFIG_SPI_FLASH_STMICRO
 #define CONFIG_MXC_SPI
 #define CONFIG_SF_DEFAULT_BUS  3
-#define CONFIG_SF_DEFAULT_CS   (0|(IMX_GPIO_NR(3, 20)<<8))
+#define CONFIG_SF_DEFAULT_CS   0
 #define CONFIG_SF_DEFAULT_SPEED2000
 #define CONFIG_SF_DEFAULT_MODE SPI_MODE_0
 #define CONFIG_SYS_SPI_ST_ENABLE_WP_PIN
-- 
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 2/3] arm: mx6: add support for TBS2910 Matrix ARM miniPC

2014-10-30 Thread Stefano Babic
Hi Soeren,

On 24/10/2014 16:33, Soeren Moch wrote:
> Add initial support for TBS2910 Matrix ARM miniPC.
> Support includes MMC, Ethernet, UARTs, HDMI, USB, SATA, PCI, I2C, RTC.
> 
> Signed-off-by: Soeren Moch 
> ---

checkpatch reports several issues with this patch. Can you fix it and
repost it ? 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] arm: arch-mx6: typo fixes in crm_regs.h

2014-10-30 Thread Stefano Babic
Hi Soeren,

On 24/10/2014 16:33, Soeren Moch wrote:
> fix typos in video pll related register names and bit defines
> 
> Signed-off-by: Soeren Moch 
> ---
> Cc: Stefano Babic 
> ---
>  arch/arm/include/asm/arch-mx6/crm_regs.h | 10 +-
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/arch/arm/include/asm/arch-mx6/crm_regs.h 
> b/arch/arm/include/asm/arch-mx6/crm_regs.h
> index e67b5b9..92f9b21 100644
> --- a/arch/arm/include/asm/arch-mx6/crm_regs.h
> +++ b/arch/arm/include/asm/arch-mx6/crm_regs.h
> @@ -89,7 +89,7 @@ struct mxc_ccm_reg {
>   u32 analog_pll_video_tog;
>   u32 analog_pll_video_num;   /* 0x40b0 */
>   u32 analog_reserved6[3];
> - u32 analog_pll_vedio_denon; /* 0x40c0 */
> + u32 analog_pll_video_denom; /* 0x40c0 */

This was fixed by another patch - I drop it here.

>   u32 analog_reserved7[7];
>   u32 analog_pll_enet;/* 0x40e0 */
>   u32 analog_pll_enet_set;
> @@ -931,10 +931,10 @@ struct mxc_ccm_reg {
>  #define BF_ANADIG_PLL_VIDEO_RSVD0(v)  \
>   (((v) << 22) & BM_ANADIG_PLL_VIDEO_RSVD0)
>  #define BM_ANADIG_PLL_VIDEO_SSC_EN 0x0020
> -#define BP_ANADIG_PLL_VIDEO_TEST_DIV_SELECT  19
> -#define BM_ANADIG_PLL_VIDEO_TEST_DIV_SELECT 0x0018
> -#define BF_ANADIG_PLL_VIDEO_TEST_DIV_SELECT(v)  \
> - (((v) << 19) & BM_ANADIG_PLL_VIDEO_TEST_DIV_SELECT)
> +#define BP_ANADIG_PLL_VIDEO_POST_DIV_SELECT  19
> +#define BM_ANADIG_PLL_VIDEO_POST_DIV_SELECT 0x0018
> +#define BF_ANADIG_PLL_VIDEO_POST_DIV_SELECT(v)  \
> + (((v) << 19) & BM_ANADIG_PLL_VIDEO_POST_DIV_SELECT)
>  #define BM_ANADIG_PLL_VIDEO_PFD_OFFSET_EN 0x0004
>  #define BM_ANADIG_PLL_VIDEO_DITHER_ENABLE 0x0002
>  #define BM_ANADIG_PLL_VIDEO_BYPASS 0x0001
> 


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] [PATCH v3] imx: mx6 sabreauto: Add board support for USB EHCI

2014-10-30 Thread Ye . Li
On mx6 sabreauto board, there are two USB ports:
0: OTG
1: HOST
The EHCI driver is enabled for this board, but the IOMUX and VBUS power
control is not implemented, which cause both USB port failed to work.
This patch fix the problem by adding the board support codes.

Since the power control uses the GPIO pin from port expander MAX7310,
the PCA953X driver is enabled for accessing the MAX7310.

The ID pin of OTG Port needs to configure the GPR1 bit 13 for selecting
its daisy chain. Add a new function "imx_iomux_set_gpr_register" to
handle GPR register setting.

Signed-off-by: Ye.Li 
---
Changes since v2:
- Resolve syntax error and checkpatch warning

Changes since v1:
- Modify codes and patch message according with Fabio's comments.

 arch/arm/imx-common/iomux-v3.c|   15 
 arch/arm/include/asm/imx-common/iomux-v3.h|5 ++
 board/freescale/mx6qsabreauto/mx6qsabreauto.c |   93 +
 include/configs/mx6qsabreauto.h   |3 +
 4 files changed, 116 insertions(+), 0 deletions(-)

diff --git a/arch/arm/imx-common/iomux-v3.c b/arch/arm/imx-common/iomux-v3.c
index 22cd11a..e88e6e2 100644
--- a/arch/arm/imx-common/iomux-v3.c
+++ b/arch/arm/imx-common/iomux-v3.c
@@ -77,3 +77,18 @@ void imx_iomux_v3_setup_multiple_pads(iomux_v3_cfg_t const 
*pad_list,
p += stride;
}
 }
+
+void imx_iomux_set_gpr_register(int group, int start_bit,
+   int num_bits, int value)
+{
+   int i = 0;
+   u32 reg;
+   reg = readl(base + group * 4);
+   while (num_bits) {
+   reg &= ~(1<<(start_bit + i));
+   i++;
+   num_bits--;
+   }
+   reg |= (value << start_bit);
+   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 a8ca49c..e0a49be 100644
--- a/arch/arm/include/asm/imx-common/iomux-v3.h
+++ b/arch/arm/include/asm/imx-common/iomux-v3.h
@@ -182,6 +182,11 @@ 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);
+/*
+* Set bits for general purpose registers
+*/
+void imx_iomux_set_gpr_register(int group, int start_bit,
+int num_bits, int value);
 
 /* macros for declaring and using pinmux array */
 #if defined(CONFIG_MX6QDL)
diff --git a/board/freescale/mx6qsabreauto/mx6qsabreauto.c 
b/board/freescale/mx6qsabreauto/mx6qsabreauto.c
index 0dc0160..42ae6fa 100644
--- a/board/freescale/mx6qsabreauto/mx6qsabreauto.c
+++ b/board/freescale/mx6qsabreauto/mx6qsabreauto.c
@@ -27,6 +27,7 @@
 #include 
 #include 
 #include 
+#include 
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -116,6 +117,44 @@ static iomux_v3_cfg_t const port_exp[] = {
MX6_PAD_SD2_DAT0__GPIO1_IO15| MUX_PAD_CTRL(NO_PAD_CTRL),
 };
 
+/*Define for building port exp gpio, pin starts from 0*/
+#define PORTEXP_IO_NR(chip, pin) \
+   ((chip << 5) + pin)
+
+/*Get the chip addr from a ioexp gpio*/
+#define PORTEXP_IO_TO_CHIP(gpio_nr) \
+   (gpio_nr >> 5)
+
+/*Get the pin number from a ioexp gpio*/
+#define PORTEXP_IO_TO_PIN(gpio_nr) \
+   (gpio_nr & 0x1f)
+
+static int port_exp_direction_output(unsigned gpio, int value)
+{
+   int ret;
+
+   i2c_set_bus_num(2);
+   ret = i2c_probe(PORTEXP_IO_TO_CHIP(gpio));
+   if (ret)
+   return ret;
+
+   ret = pca953x_set_dir(PORTEXP_IO_TO_CHIP(gpio),
+   (1 << PORTEXP_IO_TO_PIN(gpio)),
+   (PCA953X_DIR_OUT << PORTEXP_IO_TO_PIN(gpio)));
+
+   if (ret)
+   return ret;
+
+   ret = pca953x_set_val(PORTEXP_IO_TO_CHIP(gpio),
+   (1 << PORTEXP_IO_TO_PIN(gpio)),
+   (value << PORTEXP_IO_TO_PIN(gpio)));
+
+   if (ret)
+   return ret;
+
+   return 0;
+}
+
 static void setup_iomux_enet(void)
 {
imx_iomux_v3_setup_multiple_pads(enet_pads, ARRAY_SIZE(enet_pads));
@@ -361,3 +400,57 @@ int checkboard(void)
 
return 0;
 }
+
+#ifdef CONFIG_USB_EHCI_MX6
+#define USB_HOST1_PWR PORTEXP_IO_NR(0x32, 7)
+#define USB_OTG_PWR   PORTEXP_IO_NR(0x34, 1)
+
+iomux_v3_cfg_t const usb_otg_pads[] = {
+   MX6_PAD_ENET_RX_ER__USB_OTG_ID | MUX_PAD_CTRL(NO_PAD_CTRL),
+};
+
+int board_ehci_hcd_init(int port)
+{
+   switch (port) {
+   case 0:
+   imx_iomux_v3_setup_multiple_pads(usb_otg_pads,
+   ARRAY_SIZE(usb_otg_pads));
+
+   /*
+ * Set daisy chain for otg_pin_id on 6q.
+*  For 6dl, this bit is reserved.
+*/
+   imx_iomux_set_gpr_register(1, 13, 1, 0);
+   break;
+   case 1:
+   break;
+   default:
+   printf("MXC USB port %d not yet supported\n", port);
+   return -EINVAL;
+   }
+   return 0;
+}
+

Re: [U-Boot] [PATCH v2 3/3] video: speedup writing strings to fb console

2014-10-30 Thread Stefano Babic
Hi,

On 24/10/2014 16:33, Soeren Moch wrote:
> With enabled framebuffer console the printenv command can take several
> seconds to complete. This patch temporarily disables cache flush when
> writing strings to fb console. Then there is no noticable delay anymore.
> 
> Tested with imx6 hdmi framebuffer.
> 
> Signed-off-by: Soeren Moch 
> ---
> Cc: Stefano Babic 
> ---
>  drivers/video/cfb_console.c | 9 +
>  1 file changed, 9 insertions(+)
> 
> diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c
> index 9231927..e7548e1 100644
> --- a/drivers/video/cfb_console.c
> +++ b/drivers/video/cfb_console.c
> @@ -1160,10 +1160,19 @@ void video_putc(struct stdio_dev *dev, const char c)
>  
>  void video_puts(struct stdio_dev *dev, const char *s)
>  {
> + int flush = cfb_do_flush_cache;
>   int count = strlen(s);
>  
> + /* temporarily disable cache flush */
> + cfb_do_flush_cache = 0;
> +
>   while (count--)
>   video_putc(dev, *s++);
> +
> + if (flush) {
> + cfb_do_flush_cache = flush;
> + flush_cache(VIDEO_FB_ADRS, VIDEO_SIZE);
> + }
>  }

Sure it makes sense that the video is updated only once.

Acked-by: Stefano Babic 

Best regards,
Stefano Babic


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


  1   2   >