Re: [U-Boot] [PATCH v1 0/2] Add CONFIG_SYS_GENERIC_BOARD to all gdsys boards

2014-07-23 Thread Dirk Eibach
Ping.

2014-06-30 13:05 GMT+02:00  dirk.eib...@gdsys.cc:
 From: Dirk Eibach dirk.eib...@gdsys.cc




 Dirk Eibach (2):
   ppc: Make ppc4xx ready for CONFIG_SYS_GENERIC_BOARD
   board: Add CONFIG_SYS_GENERIC_BOARD to all gdsys boards

  arch/powerpc/cpu/ppc4xx/cpu_init.c | 2 ++
  include/configs/controlcenterd.h   | 2 ++
  include/configs/dlvision-10g.h | 1 +
  include/configs/dlvision.h | 1 +
  include/configs/gdppc440etx.h  | 1 +
  include/configs/intip.h| 1 +
  include/configs/io.h   | 1 +
  include/configs/io64.h | 1 +
  include/configs/iocon.h| 1 +
  include/configs/neo.h  | 1 +
  10 files changed, 12 insertions(+)

 --
 1.8.3

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


Re: [U-Boot] [PATCH 3/3] ahci: provide sunxi SATA driver using AHCI platform framework

2014-07-23 Thread Ian Campbell
On Tue, 2014-07-22 at 18:01 -0400, Tom Rini wrote:
 On Fri, Jul 18, 2014 at 08:38:41PM +0100, Ian Campbell wrote:
 
  This enables the necessary clocks, in AHB0 and in PLL6_CFG. This is done
  for sun7i only since I don't have access to any other sunxi platforms
  with sata included.
  
  The PHY setup is derived from the Alwinner releases and Linux, but is mostly
  undocumented.
  
  The Allwinner AHCI controller also requires some magic (and, again,
  undocumented) DMA initialisation when starting a port.  This is added under 
  a
  suitable ifdef.
  
  This option is enabled for Cubieboard, Cubieboard2 and Cubietruck based on
  contents of Linux DTS files, including SATA power pin config taken from the
  DTS. All build tested, but runtime tested on Cubieboard2 and Cubietruck 
  only.
  
  Signed-off-by: Ian Campbell i...@hellion.org.uk
 
 Note that this may need rebasing as I was just going to grab it as part
 of the rest of the series but it did not apply cleanly.

Sorry, it applies on top of the outstanding u-boot-arm PR from
http://patchwork.ozlabs.org/patch/371704/.

Shall we take care of it in another PR from u-boot-sunxi once Albert is
back and caught up?

Ian.

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


Re: [U-Boot] enabling ecc on P2041 and QoreIQ familly not valid for memory = 4GB

2014-07-23 Thread Benoit Sansoni
Hi York,

That what I saw in the code.

Also to test it you need to have the hardware, but the evaluation board 
P2041rdb for example does not have some ECC signals rooted for DIMM slot.
I validated the patch that I sent on a board based on P2041 with 8GB of 
memory. Obviously it works with 2GB and 4GB.

If you need help, you are welcome.

Thanks for your help
Benoit

On 07/23/2014 12:53 AM, York Sun wrote:
 On 07/18/2014 06:11 AM, Benoit Sansoni wrote:
 Hi ,

 I found out an issue when enabling ECC for P2041 platform with an amount
 of memory of 8GB.
 The routine void dma_meminit(uint val, uint size) is not adapted to
 manage memory size greater or equal to 4GB due to the 'uint' type.
 With this typing the dma_meminit sees 0 as size when memory is for
 example at 8GB. So the ECC part of the memory is not initialized and
 when going in memory the code crash.
 To correct it you need to use phys_size_t type instead of uint.
 It is the same thing for all routines that are called by dma_meminit.
 I attached a patch that able to correct it easily.
 This patch should be integrated in the main branch I think so.

 Regards,
 Benoit

 This is a valid concern. Some code started when we had far less memory. We 
 need
 to comb through the code to fix more of them.

 York




-- 
Benoit SANSONI
Kontron Modular Computers S.A.S
150 rue Marcelin Berthelot - ZI Toulon Est - BP 244
83078 TOULON Cedex 9 - FRANCE
E-mail: benoit.sans...@kontron.com
TEL: +33 (0)4 98 16 33 68
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] A way to change the status of the whole series on Patchwork ?

2014-07-23 Thread Ian Campbell
On Tue, 2014-07-22 at 12:45 -0700, Brian Norris wrote:

 Then some sort of grepping/regex/etc. can get you the patchwork ID from
 the Message-ID. e.g.:
 
   pwclient list -m $MESSAGEID | awk '{print $1;}' | grep '[0-9][0-9]*'

Which version of pwclient do you use? The one from
http://patchwork.ozlabs.org/help/pwclient/ doesn't support -m. It's also
incompatible with the example .pwclientrc from
http://patchwork.ozlabs.org/project/uboot/pwclientrc/

I did find an updated one (not sure where from now) which understands
the newer pwclientrc syntax and seems to know the -m but neither of them
seem to work fully. e.ge list -d doesn't work so
pwclient list -d 'Ian Campbell'
returns an empty list for each of the 3 email addresses of mine it seems
to know about, despite me currently having 3 patches delegated
(including 371710 for example).

Things like pwclient list -p uboot -s New do work though, and includes
the patches which are delegated to me in the list.

Investigating a bit more it seems like only filter by delegate which is
broken.

Ian.

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


Re: [U-Boot] [PATCH 3/3] ahci: provide sunxi SATA driver using AHCI platform framework

2014-07-23 Thread Ian Campbell
On Wed, 2014-07-23 at 07:59 +0100, Ian Campbell wrote:
 On Tue, 2014-07-22 at 18:01 -0400, Tom Rini wrote:
  On Fri, Jul 18, 2014 at 08:38:41PM +0100, Ian Campbell wrote:
  
   This enables the necessary clocks, in AHB0 and in PLL6_CFG. This is done
   for sun7i only since I don't have access to any other sunxi platforms
   with sata included.
   
   The PHY setup is derived from the Alwinner releases and Linux, but is 
   mostly
   undocumented.
   
   The Allwinner AHCI controller also requires some magic (and, again,
   undocumented) DMA initialisation when starting a port.  This is added 
   under a
   suitable ifdef.
   
   This option is enabled for Cubieboard, Cubieboard2 and Cubietruck based on
   contents of Linux DTS files, including SATA power pin config taken from 
   the
   DTS. All build tested, but runtime tested on Cubieboard2 and Cubietruck 
   only.
   
   Signed-off-by: Ian Campbell i...@hellion.org.uk
  
  Note that this may need rebasing as I was just going to grab it as part
  of the rest of the series but it did not apply cleanly.
 
 Sorry, it applies on top of the outstanding u-boot-arm PR from
 http://patchwork.ozlabs.org/patch/371704/.
 
 Shall we take care of it in another PR from u-boot-sunxi once Albert is
 back and caught up?

In the meantime I've merged u-boot#master into what is on
u-boot-sunxi#master, applied this patch and pushed the result to
u-boot-sunxi#next.

Hans, you were looking for a basis for your next round of sunxi board
additions -- this is probably what you want. Nothing else which is ready
to go touches boards.cfg.

Ian.

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


[U-Boot] [PATCH] board/freescale: use generic board architecture for t2080qds and t2080rdb

2014-07-23 Thread Shengzhou Liu
Tested with NOR boot and NAND boot on T2080QDS and T2080RDB.

Signed-off-by: Shengzhou Liu shengzhou@freescale.com
---
based on 'next' branch.

 include/configs/T208xQDS.h | 2 ++
 include/configs/T208xRDB.h | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/include/configs/T208xQDS.h b/include/configs/T208xQDS.h
index 9b81ff7..784310a 100644
--- a/include/configs/T208xQDS.h
+++ b/include/configs/T208xQDS.h
@@ -11,6 +11,8 @@
 #ifndef __T208xQDS_H
 #define __T208xQDS_H
 
+#define CONFIG_SYS_GENERIC_BOARD
+#define CONFIG_DISPLAY_BOARDINFO
 #define CONFIG_ICS307_REFCLK_HZ 2500  /* ICS307 ref clk freq */
 #define CONFIG_MMC
 #define CONFIG_SPI_FLASH
diff --git a/include/configs/T208xRDB.h b/include/configs/T208xRDB.h
index 5d10ad2..deeabae 100644
--- a/include/configs/T208xRDB.h
+++ b/include/configs/T208xRDB.h
@@ -11,6 +11,8 @@
 #ifndef __T2080RDB_H
 #define __T2080RDB_H
 
+#define CONFIG_SYS_GENERIC_BOARD
+#define CONFIG_DISPLAY_BOARDINFO
 #define CONFIG_T2080RDB
 #define CONFIG_ICS307_REFCLK_HZ 2500  /* ICS307 ref clk freq */
 #define CONFIG_MMC
-- 
1.8.0

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


[U-Boot] [PATCH 1/2] powerpc/mpc85xx: Make boot flag effective

2014-07-23 Thread Yuantian.Tang
From: Tang Yuantian yuantian.t...@freescale.com

bootflag as a parameter is passed to board_init_f().
But it is not actually used in this function.
Make it effective by assigned it to gd-flags.

Signed-off-by: Tang Yuantian yuantian.t...@freescale.com
---
 arch/powerpc/lib/board.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/powerpc/lib/board.c b/arch/powerpc/lib/board.c
index 50eb820..62a97a8 100644
--- a/arch/powerpc/lib/board.c
+++ b/arch/powerpc/lib/board.c
@@ -363,6 +363,8 @@ void board_init_f(ulong bootflag)
memset((void *) gd, 0, sizeof(gd_t));
 #endif
 
+   gd-flags = bootflag;
+
for (init_fnc_ptr = init_sequence; *init_fnc_ptr; ++init_fnc_ptr)
if ((*init_fnc_ptr) () != 0)
hang();
-- 
1.8.5

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


Re: [U-Boot] Hi, Problem about verify uboot

2014-07-23 Thread Simon Glass
(copying the mailing list - but please do this yourself from now on -
note you will need to join it first if you have not already)

Hi,

On 23 July 2014 03:20, Duxiaoqiang duxiaoqi...@huawei.com wrote:
 Hi Simon



  When I verified secure UBOOT with FIT image, I found a problem about
 it, and maybe need your help. Details about the problem please see below.



 Ø  Use mkimage tool to generate a fit.img file which contains a Linux image
 and a fdt file.

 Ø  Boot fit.img with bootm command: bootm 0x

 Ø  Verify hash value about the image and fdt was success. But after verify
 step, there was a synchronous abort exception(data alignment problem)

 Ø  I trace the source code, and found that the error occurred in function
 boot_fdt_add_mem_rsv_regions-fdt_num_mem_rsv-(_fdt_mem_rsv)-size;

 _fdt_mem_rsv function will return a pointer point to the reserve memory
 space about fdt section in image, and in my environment the value is
 0x985a051c, but the type of size is unsigned long long.

 This is the reason why the synchronous abort exception happened.

  And I I trace the address value of fdt_blob, it is 0x985a04f4, also
 un-alignment to 8 bytes.

  I guess the layout space of fdt was decided by mkimage tool.



  My question is:

 1)   I think it is a common problem, is there any precedent, and what is
 the solution.

I'm not quite sure of the problem.


 2)   Is there any solutions to force the start address of fdt_blob be
 align with 8 bytes?

Yes this is set by setup_fdt() in board_f.c, assuming you are using
CONFIG_SYS_GENERIC_BOARD.

For the CONFIG_OF_SEPARATE case you probably need to make sure that
u-boot.bin is a multiple of 8 bytes long. You can do this by adding
alignment into the .lds file for your board before the _end or
_image_end symbol.

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


[U-Boot] [PATCH 2/2] powerpc/t104xrdb: support deep sleep in SPI/SD boot

2014-07-23 Thread Yuantian.Tang
From: Tang Yuantian yuantian.t...@freescale.com

Add deep sleep support in SPI/SD boot. The destination address
second stage uboot image is loaded to is changed because
currently this address will be used by kernel which means
we can't reserve it for resume.

Entry point to kernel is still placed in second stage uboot.

Signed-off-by: Tang Yuantian yuantian.t...@freescale.com
---
- deep sleep for nand boot is not supported right now due to
  the hardware limitation
- based on 'next' branch.

 arch/powerpc/cpu/mpc85xx/fdt.c | 15 +++
 board/freescale/t104xrdb/spl.c | 19 +++
 include/configs/T104xRDB.h | 18 +-
 3 files changed, 43 insertions(+), 9 deletions(-)

diff --git a/arch/powerpc/cpu/mpc85xx/fdt.c b/arch/powerpc/cpu/mpc85xx/fdt.c
index 3665ec6..3222e26 100644
--- a/arch/powerpc/cpu/mpc85xx/fdt.c
+++ b/arch/powerpc/cpu/mpc85xx/fdt.c
@@ -134,6 +134,21 @@ void ft_fixup_cpu(void *blob, u64 memory_limit)
printf(Failed to reserve memory for spin table: %s\n,
fdt_strerror(off));
}
+#ifdef CONFIG_DEEP_SLEEP
+#ifdef CONFIG_SPL_MMC_BOOT
+   off = fdt_add_mem_rsv(blob, CONFIG_SYS_MMC_U_BOOT_START,
+   CONFIG_SYS_MMC_U_BOOT_SIZE);
+   if (off  0)
+   printf(Failed to reserve memory for SD deep sleep: %s\n,
+  fdt_strerror(off));
+#elif defined(CONFIG_SPL_SPI_BOOT)
+   off = fdt_add_mem_rsv(blob, CONFIG_SYS_SPI_FLASH_U_BOOT_START,
+   CONFIG_SYS_SPI_FLASH_U_BOOT_SIZE);
+   if (off  0)
+   printf(Failed to reserve memory for SPI deep sleep: %s\n,
+  fdt_strerror(off));
+#endif
+#endif
 }
 #endif
 
diff --git a/board/freescale/t104xrdb/spl.c b/board/freescale/t104xrdb/spl.c
index c628c95..3822a37 100644
--- a/board/freescale/t104xrdb/spl.c
+++ b/board/freescale/t104xrdb/spl.c
@@ -11,6 +11,7 @@
 #include mmc.h
 #include fsl_esdhc.h
 #include spi_flash.h
+#include asm/mpc85xx_gpio.h
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -55,6 +56,11 @@ void board_init_f(ulong bootflag)
/* Update GD pointer */
gd = (gd_t *)(CONFIG_SPL_GD_ADDR);
 
+#ifdef CONFIG_DEEP_SLEEP
+   /* disable the console if boot from deep sleep */
+   if (in_be32(gur-scrtsr[0])  (1  3))
+   gd-flags |= GD_FLG_SILENT | GD_FLG_DISABLE_CONSOLE;
+#endif
/* compiler optimization barrier needed for GCC = 3.4 */
__asm__ __volatile__( : : : memory);
 
@@ -120,3 +126,16 @@ void board_init_r(gd_t *gd, ulong dest_addr)
nand_boot();
 #endif
 }
+
+#ifdef CONFIG_DEEP_SLEEP
+void board_mem_sleep_setup(void)
+{
+   void __iomem *cpld_base = (void *)CONFIG_SYS_CPLD_BASE;
+
+   /* does not provide HW signals for power management */
+   clrbits_8(cpld_base + 0x17, 0x40);
+   /* Disable MCKE isolation */
+   gpio_set_value(2, 0);
+   udelay(1);
+}
+#endif
diff --git a/include/configs/T104xRDB.h b/include/configs/T104xRDB.h
index c96f03c..fe42935 100644
--- a/include/configs/T104xRDB.h
+++ b/include/configs/T104xRDB.h
@@ -33,7 +33,7 @@
 #define CONFIG_SPL_I2C_SUPPORT
 #define CONFIG_SPL_DRIVERS_MISC_SUPPORT
 #define CONFIG_FSL_LAW /* Use common FSL init code */
-#define CONFIG_SYS_TEXT_BASE   0x00201000
+#define CONFIG_SYS_TEXT_BASE   0x30001000
 #define CONFIG_SPL_TEXT_BASE   0xFFFD8000
 #define CONFIG_SPL_PAD_TO  0x4
 #define CONFIG_SPL_MAX_SIZE0x28000
@@ -49,21 +49,21 @@
 #ifdef CONFIG_NAND
 #define CONFIG_SPL_NAND_SUPPORT
 #define CONFIG_SYS_NAND_U_BOOT_SIZE(768  10)
-#define CONFIG_SYS_NAND_U_BOOT_DST 0x0020
-#define CONFIG_SYS_NAND_U_BOOT_START   0x0020
+#define CONFIG_SYS_NAND_U_BOOT_DST 0x3000
+#define CONFIG_SYS_NAND_U_BOOT_START   0x3000
 #define CONFIG_SYS_NAND_U_BOOT_OFFS(256  10)
 #define CONFIG_SYS_LDSCRIPTarch/powerpc/cpu/mpc85xx/u-boot-nand.lds
 #define CONFIG_SPL_NAND_BOOT
 #endif
 
 #ifdef CONFIG_SPIFLASH
-#defineCONFIG_RESET_VECTOR_ADDRESS 0x200FFC
+#defineCONFIG_RESET_VECTOR_ADDRESS 0x3FFC
 #define CONFIG_SPL_SPI_SUPPORT
 #define CONFIG_SPL_SPI_FLASH_SUPPORT
 #define CONFIG_SPL_SPI_FLASH_MINIMAL
 #define CONFIG_SYS_SPI_FLASH_U_BOOT_SIZE   (768  10)
-#define CONFIG_SYS_SPI_FLASH_U_BOOT_DST(0x0020)
-#define CONFIG_SYS_SPI_FLASH_U_BOOT_START  (0x0020)
+#define CONFIG_SYS_SPI_FLASH_U_BOOT_DST(0x3000)
+#define CONFIG_SYS_SPI_FLASH_U_BOOT_START  (0x3000)
 #define CONFIG_SYS_SPI_FLASH_U_BOOT_OFFS   (256  10)
 #define CONFIG_SYS_LDSCRIPTarch/powerpc/cpu/mpc85xx/u-boot.lds
 #ifndef CONFIG_SPL_BUILD
@@ -73,12 +73,12 @@
 #endif
 
 #ifdef CONFIG_SDCARD
-#defineCONFIG_RESET_VECTOR_ADDRESS 0x200FFC
+#defineCONFIG_RESET_VECTOR_ADDRESS 0x3FFC
 #define CONFIG_SPL_MMC_SUPPORT
 #define CONFIG_SPL_MMC_MINIMAL
 #define 

Re: [U-Boot] [PATCH] Makefile: use $(shell ...) for determining file_size

2014-07-23 Thread Simon Glass
On 22 July 2014 18:08, Chris Packham judge.pack...@gmail.com wrote:
 file_size was being calculated using back-ticks but map_size uses
 $(shell ...). Update the file_size calculation to use $(shell ...).

 Signed-off-by: Chris Packham judge.pack...@gmail.com

Acked-by: Simon Glass s...@chromium.org

But you might want to look at this.

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

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


Re: [U-Boot] [PATCH] board_r: Add missing return to initr_doc

2014-07-23 Thread Simon Glass
On 21 July 2014 12:21, Ian Campbell i...@hellion.org.uk wrote:
 I happened to spot this while working in the area.

 Signed-off-by: Ian Campbell i...@hellion.org.uk
 Cc: Simon Glass s...@chromium.org

Acked-by: Simon Glass s...@chromium.org

(we normally add a blank line before return but I don't think it is universal)
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] embestmx6boards: convert to generic board

2014-07-23 Thread Stefano Babic
Hi Iain,

On 10/06/2014 00:09, Iain Paton wrote:
 Enable CONFIG_SYS_GENERIC_BOARD to remove warning on boot.
 
 Signed-off-by: Iain Paton ipat...@gmail.com
 ---

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 1/2] mx6: soc: Do not apply the PFD erratum for mx6solox

2014-07-23 Thread Stefano Babic
On 09/07/2014 21:13, Fabio Estevam wrote:
 From: Fabio Estevam fabio.este...@freescale.com
 
 The PFD issue is not present on mx6solox, so skip it in this case.
 
 Signed-off-by: Fabio Estevam fabio.este...@freescale.com
 ---


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 2/2] mx6sxsabresd: Add PFUZE100 PMIC support

2014-07-23 Thread Stefano Babic
On 09/07/2014 21:13, Fabio Estevam wrote:
 From: Fabio Estevam fabio.este...@freescale.com
 
 Signed-off-by: Fabio Estevam fabio.este...@freescale.com
 ---

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 1/2] mx6: Remove duplication of iomuxc structure

2014-07-23 Thread Stefano Babic
On 09/07/2014 22:59, Fabio Estevam wrote:
 From: Fabio Estevam fabio.este...@freescale.com
 
 There is no need to keep iomuxc_base_regs structure as it serves the exact 
 same
 purpose of the iomuxc structure, which is to provide access to the GPR 
 registers.
 
 The additional fields of iomuxc_base_regs are not used. Other advantage of
 'iomuxc' is that it has a shorter name and the variable declarations can fit
 into a single line.
 
 So remove iomuxc_base_regs structure and use iomuxc instead.
 
 Signed-off-by: Fabio Estevam fabio.este...@freescale.com
 ---


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 2/2] mx6: Adjust the GPR offset for mx6solox

2014-07-23 Thread Stefano Babic
On 09/07/2014 22:59, Fabio Estevam wrote:
 From: Fabio Estevam fabio.este...@freescale.com
 
 On mx6solox there is an additional 0x4000 offset for the GPR registers.
 
 Signed-off-by: Fabio Estevam fabio.este...@freescale.com
 ---


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] arm: mxs: Scrub useless ifdef

2014-07-23 Thread Stefano Babic
On 12/07/2014 15:39, Marek Vasut wrote:
 As a result of 0defddc851edfc34bcf3c3379fe74b11dc01a493 , which did
 a consolidation of the prompt string, this ifdef became empty. Remove
 it.
 
 Signed-off-by: Marek Vasut ma...@denx.de
 Cc: Tom Rini tr...@ti.com
 Cc: Stefano Babic sba...@denx.de
 ---
  include/configs/mxs.h | 2 --

Applied to u-boot-imx, thanks !

Best regards,
Stefano Babic


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


Re: [U-Boot] [PATCH v4 0/6] arm, imx6: add aristainetos board support

2014-07-23 Thread Stefano Babic
Hi Heiko,

On 18/07/2014 06:07, Heiko Schocher wrote:

All series applied with the following change due to inclusion Fabios's
cleanup for iomuxc register (http://patchwork.ozlabs.org/patch/368335/)

 int board_eth_init(bd_t *bis)
 {
-   struct iomuxc_base_regs *iomuxc_regs =
-   (struct iomuxc_base_regs *)IOMUXC_BASE_ADDR;
+   struct iomuxc *iomuxc_regs =
+   (struct iomuxc *)IOMUXC_BASE_ADDR;

Applied to u-boot-imx, thanks !

Best regards,
Stefano Babic

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


Re: [U-Boot] [PATCH v4] Add TQ Systems TQMa6 board support

2014-07-23 Thread Stefano Babic
On 18/07/2014 16:52, Markus Niebel wrote:
 From: Markus Niebel markus.nie...@tq-group.com
 
 This patch adds the changes to boards.cfg and the board directory
 under board/tqc.
 
 TQMa6 is a family of modules based on Freescale i.MX6. It consists of
 TQMa6Q (i.MX6 Quad), TQMa6D (i.MX6 Dual) featuring eMMC, and 1 GiB DDR3
 TQMa6S (i.MX6 Solo)  featuring eMMC and 512 MiB DDR3
 
 The modules need a baseboard. Initially the MBa6x starterkit mainboard is
 supported. To easy support for other mainboards the functionality is splitted
 in one file for the module (tqma6.c) and one file for the baseboard (tqma6_
 mba6).
 
 The modules can be boot from eMMC (on USDHC3) and SPI flash.
 
 The following features are supported:
 - MMC: eMMC on module (on USDHC3) and SD-card (on MBa6x mainboard)
 - Ethernet: RGMII using micrel KSZ9031 phy on MBa6x mainboard for TQMa6x 
 module.
   The phy needs special configurations for the pad skew registers to adjust 
 for
   the signal routing.
   Also support for standard ethernet commands and uppdate via tftp.
 - SPI: ECSPI1 with bootable serial flash on module and two additional
   chip selects on MBa6x
 - I2C: This patch adds support for the I2C busses on the TQMa6x modules 
 (I2C3)
   and MBa6x baseboards (I2C1). The LM75 temperature sensors on TQMa6x and 
 MBa6x
   are also configured.
 - USB: high speed host 1 on MBa6x and support for USB storage
 - PMIC: support for pfuze 100 on TQMa6x
 
 Signed-off-by: Markus Niebel markus.nie...@tq-group.com
 ---

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] WIP for SPI

2014-07-23 Thread Simon Glass
Hi Jon,


On 21 July 2014 07:11, Jon Loeliger loeli...@gmail.com wrote:
 And I think I am saying that we already *have* it generalized for
 the GPIOs but only if we remove that renumbering function!

 Consider again that the U_CLASS lookup of a GPIO simply matches
 versus the range in each uclass data (gpio base and count).  That search
 doesn't care about their order within the UCLASS_GPIO list.

 (Never mind that the renumbering breaks the association of the device
 base register and pin ranges as set up by the bind/probe code!)

 I wonder if we could do something similar then, where there is a
 default numbering if none is provided, but the GPIO devices are able
 to 'request' particular number ranges?

 I think we are talking past each other now.  Isn't that already in place?
 One can already register a device with a range in the UCLASS so
 that the lookup happens and matches to a particular device instance.
 (But only assuming they are NOT renumbered.)

 What am I missing here?

For GPIOs at present, we don't use the sequence numbering side - the
GPIO uclass numbers everything itself and does not permit boards to
specify numbering (other than by ordering in the device tree /
platform data).

For sequences we support specifying number by alias as well. I'm just
saying that for GPIOs we could (in future) enhance it to make the
numbering more flexible. If we can do this in a way that is general to
all devices (e.g. using sequenced) then that might be nice.

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


[U-Boot] [PATCH v2] powerpc/t104xrdb: Add T1042RDB board support

2014-07-23 Thread Vijay Rai
T1042RDB is a Freescale reference board that hosts the T1042 SoC
(and variants). The board is similar to T1040RDB, It is a reduced
personality of T1040 SoC without Integrated 8-port Gigabit(L2 Switch).

T1042RDB is configured with serdes protocol 0x86 which can support
following interfaces
- 2 RGMIIS on DTSEC4, DTSEC5
- 1 SGMII on DTSEC3

This Patch also updates README file(added T1042RDB details and updated commands
for switching to alternate banks from vBank0 to vBank4 and vice versa)

This patch also does minor clean ups for fdt defines for T1042RDB and 
T1042RDB_PI board

Signed-off-by: Vijay Rai vijay@freescale.com
Signed-off-by: Priyanka Jain priyanka.j...@freescale.com
---
 board/freescale/t104xrdb/README |   17 +++--
 boards.cfg  |1 +
 include/configs/T104xRDB.h  |   15 +--
 3 files changed, 25 insertions(+), 8 deletions(-)

diff --git a/board/freescale/t104xrdb/README b/board/freescale/t104xrdb/README
index cdbe1fa..ad0f75c 100644
--- a/board/freescale/t104xrdb/README
+++ b/board/freescale/t104xrdb/README
@@ -4,10 +4,23 @@ The T1040RDB is a Freescale reference board that hosts the 
T1040 SoC
 (and variants). Variants inclued T1042 presonality of T1040, in which
 case T1040RDB can also be called T1042RDB.
 
+The T1042RDB is a Freescale reference board that hosts the T1042 SoC
+(and variants). The board is similar to T1040RDB, It is a reduced
+personality of T1040 SoC without Integrated 8-port Gigabit(L2 Switch).
+
 The T1042RDB_PI is a Freescale reference board that hosts the T1042 SoC.
 (a personality of T1040 SoC). The board is similar to T1040RDB but is
 designed specially with low power features targeted for Printing Image Market.
 
+Basic difference's among T1040RDB, T1042RDB_PI, T1042RDB
+-
+Board  Si  ProtocolTargeted Market
+-
+T1040RDB   T1040   0x66Networking
+T1040RDB   T1042   0x86Networking
+T1042RDB_PIT1042   0x06Printing  Imaging
+
+
 T1040 SoC Overview
 --
 The QorIQ T1040/T1042 processor support four integrated 64-bit e5500 PA
@@ -194,10 +207,10 @@ The below commands apply to the board
Commands for switching to alternate bank.
 
1. To change from vbank0 to vbank4
-   = qixis_reset altbank (it will boot using vbank4)
+   = cpld reset altbank (it will boot using vbank4)
 
2.To change from vbank4 to vbank0
-   = qixis reset (it will boot using vbank0)
+   = cpld reset (it will boot using vbank0)
 
 NAND boot with 2 Stage boot loader
 --
diff --git a/boards.cfg b/boards.cfg
index 1ba2081..d36f852 100644
--- a/boards.cfg
+++ b/boards.cfg
@@ -928,6 +928,7 @@ Active  powerpc mpc85xx-   freescale
   t104xrdb
 Active  powerpc mpc85xx-   freescale   t104xrdb
T1040RDB_SDCARD   
T104xRDB:PPC_T1040,T1040RDB,RAMBOOT_PBL,SPL_FSL_PBL,SDCARD  
  -
 Active  powerpc mpc85xx-   freescale   t104xrdb
T1040RDB_SECURE_BOOT  
T104xRDB:PPC_T1040,SECURE_BOOT,T1040RDB 
  Aneesh Bansal  
aneesh.ban...@freescale.com
 Active  powerpc mpc85xx-   freescale   t104xrdb
T1040RDB_SPIFLASH 
T104xRDB:PPC_T1040,T1040RDB,RAMBOOT_PBL,SPL_FSL_PBL,SPIFLASH
  Priyanka Jain  
priyanka.j...@freescale.com
+Active  powerpc mpc85xx-   freescale   t104xrdb
T1042RDB  T104xRDB:PPC_T1042,T1042RDB   

Priyanka Jain  priyanka.j...@freescale.com
 Active  powerpc mpc85xx-   freescale   t104xrdb
T1042RDB_PI   T104xRDB:PPC_T1042,T1042RDB_PI

Priyanka Jain  priyanka.j...@freescale.com
 Active  powerpc mpc85xx-   freescale   t104xrdb
T1042RDB_PI_NAND  
T104xRDB:PPC_T1042,T1042RDB_PI,RAMBOOT_PBL,SPL_FSL_PBL,NAND 
  Priyanka Jain  
priyanka.j...@freescale.com
 Active  powerpc mpc85xx-   freescale   t104xrdb
T1042RDB_PI_SDCARD
T104xRDB:PPC_T1042,T1042RDB_PI,RAMBOOT_PBL,SPL_FSL_PBL,SDCARD   
 

[U-Boot] FSL eSPI driver is a mess, hack attached.

2014-07-23 Thread Eliot Dudley
We're bringing up a board that boots from SPI flash, so we had to re-work
fsl_espi.c for to get it to work at all and for speed.

Been working from 2009.11 because that's what came with a P1022DS box that
Freescale so generously provided.  There has been a tremendous amount
divergence since 2009.11 and it will be a long time if ever before I get a
chance to start over with the trunk, plus I am not up to speed with
patches, git, and so forth.

So I'm just going to past in some code fragments here in case anyone wants
to re-work the trunk with a know-good implemntation.  From the looks of it
it should be straightforward to revise the current fsl_espi.c

First, a fragment for computing Hz so it is not more than max_hz:

   /* Set eSPI BRG clock source */
   get_sys_info(sysinfo);
   eSPI_baud_rate_generator = sysinfo.freqSystemBus / 2;

   for (prescale = 0; prescale  2; ++prescale) {
  for (pm = 0; pm  16; ++pm) {
 if (
  (
   (eSPI_baud_rate_generator) /
   ((prescale ? 16 : 1) * 2 * (pm + 1))
  ) =
  (max_hz)
 ) {
goto csmode_DONE;
 }
  }
   }
   debug(
fls_espi: spi_setup_slave: Requested %d Hz is too low, using %d Hz
,max_hz
,eSPI_baud_rate_generator / ((prescale ? 16 : 1) * 2 * (pm + 1))
   );
   prescale = 1;
   pm = 15;
   csmode_DONE:
   (prescale)  (espi-csmode[cs] |= ESPI_CSMODE_DIV16);
   espi-csmode[cs] |= ESPI_CSMODE_PM(pm);

And here is the xfer code.  It is 850 times faster than 2009.11.  (Love my
new Saleae Logic 16.)

int espi_xfer(struct spi_slave *slave)
{
   volatile ccsr_espi_t *espi = (void *)(CONFIG_SYS_MPC85xx_ESPI_ADDR);
   struct espi_transfer *t = slave-transfer;

   /* Tx logic. */
   #define FIFO_BYTES 32
   #define TX_IDLE 0x
   unsigned int tx_len = t-cmd_len + t-data_len;
   unsigned int cmd_len = t-cmd_len;
   u8 *cmd_ptr = (u8*)t-tx_buf;
   int tx_fifo_bytes;
   int tx_fifo_words;
   int tx_bytes;
   int cmd_bytes;
   unsigned long tx;

   /* Rx logic. */
   unsigned int rx_len = t-cmd_len + t-data_len;
   int rx_bytes;
   int rx_words;
   u8 *data_dst = (u8*)t-rx_buf;
   int data_idx = -((int)cmd_len);
   int data_bytes;
   unsigned long rx;

   /* Variables for computing a non-forever timeout. */
   int spin = 0;
   int spin_per_timeout;
   /* WAG.  Using factor of twenty for timeout below so mox nix.*/
   unsigned int cpu_clock_per_spin = 60;
   unsigned int cpu_clock_per_word;

   /*
* This controller automatically asserts and negates CS,
*  so we will not pretend that it does not.
* If board has other means for gating CS to the device then
*  that is something to be dealt with higher up the stack.
   */
   if (
(t-flags  (SPI_XFER_BEGIN | SPI_XFER_END)) !=
(SPI_XFER_BEGIN | SPI_XFER_END)
   ) {
  printf(
   fsl_espi: espi_xfer(): Unsupported mode: flags=0x%08x\n
   ,(unsigned int)t-flags
  );
  return -1;
   }

   cpu_clock_per_word =
(32) *
(2) *
((espi-csmode[slave-cs]  ESPI_CSMODE_DIV16) ? 16 : 1) *
(2 * (((espi-csmode[slave-cs]  24)  0x0f) + 1))
   ;
   spin_per_timeout = 20 * (cpu_clock_per_word / cpu_clock_per_spin);

   spi_cs_activate(slave);

   /* Clear all eSPI events. */
   espi-event = 0x;

   /* Fill xmt FIFO with as many as FIFO_BYTES (32) bytes. */
   tx_fifo_bytes = FIFO_BYTES;
   (tx_fifo_bytes  tx_len)  (tx_fifo_bytes = tx_len);
   tx_fifo_words = (tx_fifo_bytes + 3) / 4;
   while (tx_fifo_words--) {
  tx = TX_IDLE;
  ((tx_bytes = 4)  tx_len)  (tx_bytes = tx_len);
  if (cmd_len) {
 ((cmd_bytes = tx_bytes)  cmd_len)  (cmd_bytes = cmd_len);
 memcpy(tx, cmd_ptr, cmd_bytes);
 cmd_len -= cmd_bytes;
 cmd_ptr += cmd_bytes;
  }
  espi-tx = tx;
  tx_len -= tx_bytes;
   }

   for (rx_words = (rx_len + 3) / 4; rx_words--;) {

  /* Wait for rx or timeout. */
  ((rx_bytes = 4)  rx_len)  (rx_bytes = rx_len);
  spin = spin_per_timeout;
  while espi-event  0x3f00)  24)  rx_bytes)  (--spin)) {
 ;
  }

  /* Timed out? */
  if (!spin) {
 break;
  }

  /* Read from rx FIFO. */
  rx = espi-rx;
  /* Copy to espi_transfer-rx_buf when xmt is done with cmd. */
  if (data_dst) {
 if (data_idx = 0) {
memcpy(data_dst, rx, rx_bytes);
data_dst += rx_bytes;
 } else {
if ((data_idx += 4)  0) {
   ((data_bytes = data_idx)  rx_len)  (data_bytes = rx_len);
   memcpy(data_dst, ((u8 *)rx) + (4 - data_idx), data_bytes);
   data_dst += data_bytes;
}
 }
  }
  rx_len -= rx_bytes;

  /* Previous rx is complete so there is room in FIFO for the next tx.
*/
  if (tx_len) {
 tx = TX_IDLE;
 ((tx_bytes = 4)  tx_len)  (tx_bytes = tx_len);
 if (cmd_len) {
((cmd_bytes = tx_bytes)  cmd_len)  (cmd_bytes = cmd_len);
memcpy(tx, cmd_ptr, 

[U-Boot] [PATCH] powerpc/t104xrdb: Add Support of rcw for T1042RDB in u-boot

2014-07-23 Thread Vijay Rai
This patch adds support of rcw for T1042RDB, it does following:
- Add t1042_rcw.cfg file for serdes protocol 0x86 for T1042RDB
- Renames t1042_pi_rcw.cfg file from t1042_rcw.cfg and also updates
  comments for valid serdes protocol
- Also updates CONFIG_SYS_FSL_PBL_RCW for T1042RDB

Signed-off-by: Vijay Rai vijay@freescale.com
Signed-off-by: Priyanka Jain priyanka.j...@freescale.com
---
 include/configs/T104xRDB.h |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/configs/T104xRDB.h b/include/configs/T104xRDB.h
index c3eb019..eeac104 100644
--- a/include/configs/T104xRDB.h
+++ b/include/configs/T104xRDB.h
@@ -19,7 +19,7 @@
 #define CONFIG_SYS_FSL_PBL_RCW 
$(SRCTREE)/board/freescale/t104xrdb/t1040_rcw.cfg
 #endif
 #ifdef CONFIG_T1042RDB_PI
-#define CONFIG_SYS_FSL_PBL_RCW 
$(SRCTREE)/board/freescale/t104xrdb/t1042_pi_rcw.cfg.cfg
+#define CONFIG_SYS_FSL_PBL_RCW 
$(SRCTREE)/board/freescale/t104xrdb/t1042_pi_rcw.cfg
 #endif
 #ifdef CONFIG_T1042RDB
 #define CONFIG_SYS_FSL_PBL_RCW 
$(SRCTREE)/board/freescale/t104xrdb/t1042_rcw.cfg
-- 
1.7.9.5

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


[U-Boot] [PATCH 0/8] samsung: Use common config files with Samsung boards (help wanted)

2014-07-23 Thread Simon Glass
This series tries to unify the Samsung board configs into a few header
files for exynos5 and exynos5.

The purpose is to make it easier to move to driver model. In that case
I would like things like the GPIO drivers and serial drivers to work in
a standard way, and not need to support device tree and platform data at
the same time. That would be quite painful.

Another reason is that the Chrome OS EC drivers are currently included in
boards that don't have a Chrome OS EC. This concern was raised by the
Samsung maintainer (Minkyu) a while back.

There are still a few boards that don't use CONFIG_OF_CONTROL so I have
updated these with the most rudimentary of device tree files.

Unfortunately I don't have boards for most of these (for testing) and I
am hoping that the maintainers can come to the rescue and fix up any
patches that have problems. I am also worried that I have used a common
exynos file for things like smdkv310, when in fact they have some other
chip in common.

So maintainers, please can you test this and re-issue the patch, or make
comments on my attempts?


Simon Glass (8):
  exynos: Rename -dt config files to -common
  exynos: Move common exynos settings into a common file
  exynos: Move common smdk5420 things to common file
  exynos: config: Move cros_ec and tps65090 out of smdk boards
  config: Move arndale to use common exynos5250 file
  config: Move smdkv310 to use common exynos4 file
  samsung: Move s5p_goni to use exynos-common config
  samsung: Move smdkc100 to use exynos-common config

 arch/arm/dts/Makefile  |   3 +
 arch/arm/dts/exynos4210-smdkv310.dts   |  21 ++
 arch/arm/dts/s5pc1xx-goni.dts  |  21 ++
 arch/arm/dts/s5pc1xx-smdkc100.dts  |  21 ++
 arch/arm/include/asm/arch-s5pc1xx/periph.h |  61 ++
 arch/arm/include/asm/arch-s5pc1xx/pinmux.h |  50 +
 drivers/mmc/s5p_sdhci.c|   2 -
 include/configs/arndale.h  | 212 ++---
 include/configs/{exynos4-dt.h = exynos-common.h}  | 104 +++---
 include/configs/exynos4-common.h   |  64 +++
 include/configs/{exynos5-dt.h = exynos5-common.h} | 110 ++-
 include/configs/exynos5-dt-common.h|  35 
 .../{exynos5250-dt.h = exynos5250-common.h}   |   5 +-
 .../configs/{exynos5420.h = exynos5420-common.h}  |  11 +-
 include/configs/origen.h   |   5 +-
 include/configs/peach-pit.h|   8 +-
 include/configs/s5p_goni.h |  55 +-
 include/configs/s5pc210_universal.h|   5 +-
 include/configs/smdk5250.h |   6 +-
 include/configs/smdk5420.h |   7 +-
 include/configs/smdkc100.h |  57 ++
 include/configs/smdkv310.h |  65 ++-
 include/configs/snow.h |   8 +-
 include/configs/trats.h|   6 +-
 include/configs/trats2.h   |   6 +-
 25 files changed, 390 insertions(+), 558 deletions(-)
 create mode 100644 arch/arm/dts/exynos4210-smdkv310.dts
 create mode 100644 arch/arm/dts/s5pc1xx-goni.dts
 create mode 100644 arch/arm/dts/s5pc1xx-smdkc100.dts
 create mode 100644 arch/arm/include/asm/arch-s5pc1xx/periph.h
 create mode 100644 arch/arm/include/asm/arch-s5pc1xx/pinmux.h
 rename include/configs/{exynos4-dt.h = exynos-common.h} (54%)
 create mode 100644 include/configs/exynos4-common.h
 rename include/configs/{exynos5-dt.h = exynos5-common.h} (70%)
 create mode 100644 include/configs/exynos5-dt-common.h
 rename include/configs/{exynos5250-dt.h = exynos5250-common.h} (92%)
 rename include/configs/{exynos5420.h = exynos5420-common.h} (88%)

-- 
2.0.0.526.g5318336

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


[U-Boot] [PATCH 2/8] exynos: Move common exynos settings into a common file

2014-07-23 Thread Simon Glass
Since exynos4 and exyno5 share many settings, we should move these into
a common file to avoid duplication.

Effective changes are:
- All exynos boards now have EXT4 and FAT write support - this affects
exynos5250 and exynos5420 which previously did not. This also disables
the ext2 commands which are equivalent to ext4 anyway.

Signed-off-by: Simon Glass s...@chromium.org
---

 include/configs/exynos-common.h | 93 +
 include/configs/exynos4-common.h| 81 +---
 include/configs/exynos5-common.h| 90 +--
 include/configs/origen.h|  3 --
 include/configs/s5pc210_universal.h |  3 --
 include/configs/smdk5250.h  |  4 --
 include/configs/snow.h  |  4 --
 include/configs/trats.h |  4 --
 include/configs/trats2.h|  4 --
 9 files changed, 107 insertions(+), 179 deletions(-)
 create mode 100644 include/configs/exynos-common.h

diff --git a/include/configs/exynos-common.h b/include/configs/exynos-common.h
new file mode 100644
index 000..0308b88
--- /dev/null
+++ b/include/configs/exynos-common.h
@@ -0,0 +1,93 @@
+/*
+ * Copyright (C) 2013 Samsung Electronics
+ *
+ * Common configuration settings for the SAMSUNG EXYNOS boards.
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#ifndef __EXYNOS_COMMON_H
+#define __EXYNOS_COMMON_H
+
+/* High Level Configuration Options */
+#define CONFIG_SAMSUNG /* in a SAMSUNG core */
+#define CONFIG_S5P /* S5P Family */
+
+#include asm/arch/cpu.h  /* get chip and board defs */
+#include linux/sizes.h
+
+#define CONFIG_SYS_GENERIC_BOARD
+#define CONFIG_ARCH_CPU_INIT
+#define CONFIG_DISPLAY_CPUINFO
+#define CONFIG_DISPLAY_BOARDINFO
+#define CONFIG_BOARD_COMMON
+#define CONFIG_SKIP_LOWLEVEL_INIT
+#define CONFIG_BOARD_EARLY_INIT_F
+
+/* Enable fdt support */
+#define CONFIG_OF_CONTROL
+#define CONFIG_OF_SEPARATE
+#define CONFIG_OF_LIBFDT
+
+/* Keep L2 Cache Disabled */
+#define CONFIG_CMD_CACHE
+
+/* input clock of PLL: 24MHz input clock */
+#define CONFIG_SYS_CLK_FREQ2400
+
+#define CONFIG_SETUP_MEMORY_TAGS
+#define CONFIG_CMDLINE_TAG
+#define CONFIG_INITRD_TAG
+#define CONFIG_CMDLINE_EDITING
+#define CONFIG_ENV_OVERWRITE
+
+/* Size of malloc() pool */
+#define CONFIG_SYS_MALLOC_LEN  (CONFIG_ENV_SIZE + (80 * SZ_1M))
+
+/* select serial console configuration */
+#define CONFIG_BAUDRATE115200
+
+/* SD/MMC configuration */
+#define CONFIG_GENERIC_MMC
+#define CONFIG_MMC
+#define CONFIG_S5P_SDHCI
+#define CONFIG_SDHCI
+#define CONFIG_DWMMC
+#define CONFIG_EXYNOS_DWMMC
+#define CONFIG_BOUNCE_BUFFER
+
+#define CONFIG_BOOTDELAY   3
+#define CONFIG_ZERO_BOOTDELAY_CHECK
+
+/* PWM */
+#define CONFIG_PWM
+
+/* Command definition*/
+#include config_cmd_default.h
+
+#define CONFIG_CMD_MMC
+#define CONFIG_CMD_EXT4
+#define CONFIG_CMD_EXT4_WRITE
+#define CONFIG_CMD_FAT
+#define CONFIG_FAT_WRITE
+
+#define CONFIG_DOS_PARTITION
+#define CONFIG_EFI_PARTITION
+#define CONFIG_CMD_PART
+#define CONFIG_PARTITION_UUIDS
+
+/* Miscellaneous configurable options */
+#define CONFIG_SYS_LONGHELP/* undef to save memory */
+#define CONFIG_SYS_HUSH_PARSER /* use hush command parser*/
+#define CONFIG_SYS_CBSIZE  256 /* Console I/O Buffer Size */
+#define CONFIG_SYS_PBSIZE  384 /* Print Buffer Size */
+#define CONFIG_SYS_MAXARGS 16  /* max number of command args */
+
+/* Boot Argument Buffer Size */
+#define CONFIG_SYS_BARGSIZECONFIG_SYS_CBSIZE
+
+/* FLASH and environment organization */
+#define CONFIG_SYS_NO_FLASH
+#undef CONFIG_CMD_IMLS
+
+#endif /* __CONFIG_H */
diff --git a/include/configs/exynos4-common.h b/include/configs/exynos4-common.h
index 24ee2d5..dc91e0e 100644
--- a/include/configs/exynos4-common.h
+++ b/include/configs/exynos4-common.h
@@ -9,85 +9,29 @@
 #ifndef __CONFIG_EXYNOS4_COMMON_H
 #define __CONFIG_EXYNOS4_COMMON_H
 
-/* High Level Configuration Options */
-#define CONFIG_SAMSUNG /* in a SAMSUNG core */
-#define CONFIG_S5P /* S5P Family */
-#define CONFIG_EXYNOS4 /* which is in a Exynos4 Family */
+#define CONFIG_EXYNOS4 /* Exynos4 Family */
 
-#include asm/arch/cpu.h  /* get chip and board defs */
-
-#define CONFIG_ARCH_CPU_INIT
-#define CONFIG_DISPLAY_CPUINFO
-#define CONFIG_DISPLAY_BOARDINFO
-#define CONFIG_BOARD_COMMON
-#define CONFIG_SYS_GENERIC_BOARD
-
-/* Enable fdt support */
-#define CONFIG_OF_CONTROL
-#define CONFIG_OF_SEPARATE
+#include exynos-common.h
 
 #define CONFIG_SYS_CACHELINE_SIZE  32
-
-/* input clock of PLL: EXYNOS4 boards have 24MHz input clock */
-#define CONFIG_SYS_CLK_FREQ2400
-
-#define CONFIG_SETUP_MEMORY_TAGS
-#define CONFIG_CMDLINE_TAG
 #define CONFIG_REVISION_TAG
-#define CONFIG_INITRD_TAG
-#define 

[U-Boot] [PATCH 1/8] exynos: Rename -dt config files to -common

2014-07-23 Thread Simon Glass
We want exynos5250-dt.h to be a board which can support any exynos5250
device. This matches the naming used by Linux. As a first step, rename
the existing -dt files to -common to make it clear they are common files,
and not specific boards.

Signed-off-by: Simon Glass s...@chromium.org
---

 include/configs/{exynos4-dt.h = exynos4-common.h}   | 6 +++---
 include/configs/{exynos5-dt.h = exynos5-common.h}   | 6 +++---
 include/configs/{exynos5250-dt.h = exynos5250-common.h} | 2 +-
 include/configs/origen.h | 2 +-
 include/configs/peach-pit.h  | 2 +-
 include/configs/s5pc210_universal.h  | 2 +-
 include/configs/smdk5250.h   | 2 +-
 include/configs/smdk5420.h   | 2 +-
 include/configs/snow.h   | 2 +-
 include/configs/trats.h  | 2 +-
 include/configs/trats2.h | 2 +-
 11 files changed, 15 insertions(+), 15 deletions(-)
 rename include/configs/{exynos4-dt.h = exynos4-common.h} (97%)
 rename include/configs/{exynos5-dt.h = exynos5-common.h} (98%)
 rename include/configs/{exynos5250-dt.h = exynos5250-common.h} (97%)

diff --git a/include/configs/exynos4-dt.h b/include/configs/exynos4-common.h
similarity index 97%
rename from include/configs/exynos4-dt.h
rename to include/configs/exynos4-common.h
index 44e6ab4..24ee2d5 100644
--- a/include/configs/exynos4-dt.h
+++ b/include/configs/exynos4-common.h
@@ -6,8 +6,8 @@
  * SPDX-License-Identifier:GPL-2.0+
  */
 
-#ifndef __CONFIG_H
-#define __CONFIG_H
+#ifndef __CONFIG_EXYNOS4_COMMON_H
+#define __CONFIG_EXYNOS4_COMMON_H
 
 /* High Level Configuration Options */
 #define CONFIG_SAMSUNG /* in a SAMSUNG core */
@@ -138,4 +138,4 @@
 /* Enable devicetree support */
 #define CONFIG_OF_LIBFDT
 
-#endif /* __CONFIG_H */
+#endif /* __CONFIG_EXYNOS4_COMMON_H */
diff --git a/include/configs/exynos5-dt.h b/include/configs/exynos5-common.h
similarity index 98%
rename from include/configs/exynos5-dt.h
rename to include/configs/exynos5-common.h
index 3c2036e..7f66a46 100644
--- a/include/configs/exynos5-dt.h
+++ b/include/configs/exynos5-common.h
@@ -6,8 +6,8 @@
  * SPDX-License-Identifier:GPL-2.0+
  */
 
-#ifndef __CONFIG_H
-#define __CONFIG_H
+#ifndef __CONFIG_EXYNOS5_COMMON_H
+#define __CONFIG_EXYNOS5_COMMON_H
 
 /* High Level Configuration Options */
 #define CONFIG_SAMSUNG /* in a SAMSUNG core */
@@ -294,4 +294,4 @@
 #define EXYNOS_USB_SECONDARY_BOOT  0xfeed0002
 #define EXYNOS_IRAM_SECONDARY_BASE 0x02020018
 
-#endif /* __CONFIG_H */
+#endif /* __CONFIG_EXYNOS5_COMMON_H */
diff --git a/include/configs/exynos5250-dt.h 
b/include/configs/exynos5250-common.h
similarity index 97%
rename from include/configs/exynos5250-dt.h
rename to include/configs/exynos5250-common.h
index 05d33a7..b4c1ccf 100644
--- a/include/configs/exynos5250-dt.h
+++ b/include/configs/exynos5250-common.h
@@ -10,7 +10,7 @@
 #ifndef __CONFIG_5250_H
 #define __CONFIG_5250_H
 
-#include configs/exynos5-dt.h
+#include configs/exynos5-common.h
 #define CONFIG_EXYNOS5250
 
 #define CONFIG_SYS_SDRAM_BASE  0x4000
diff --git a/include/configs/origen.h b/include/configs/origen.h
index 8258338..cd22723 100644
--- a/include/configs/origen.h
+++ b/include/configs/origen.h
@@ -9,7 +9,7 @@
 #ifndef __CONFIG_ORIGEN_H
 #define __CONFIG_ORIGEN_H
 
-#include configs/exynos4-dt.h
+#include configs/exynos4-common.h
 
 #define CONFIG_SYS_PROMPT  ORIGEN # 
 
diff --git a/include/configs/peach-pit.h b/include/configs/peach-pit.h
index cfd4d5c..59192e1 100644
--- a/include/configs/peach-pit.h
+++ b/include/configs/peach-pit.h
@@ -9,7 +9,7 @@
 #ifndef __CONFIG_PEACH_PIT_H
 #define __CONFIG_PEACH_PIT_H
 
-#include configs/exynos5-dt.h
+#include configs/exynos5-common.h
 
 #include configs/exynos5420.h
 
diff --git a/include/configs/s5pc210_universal.h 
b/include/configs/s5pc210_universal.h
index 20985da..066fc02 100644
--- a/include/configs/s5pc210_universal.h
+++ b/include/configs/s5pc210_universal.h
@@ -10,7 +10,7 @@
 #ifndef __CONFIG_UNIVERSAL_H
 #define __CONFIG_UNIVERSAL_H
 
-#include configs/exynos4-dt.h
+#include configs/exynos4-common.h
 
 #define CONFIG_SYS_PROMPT  Universal #   /* Monitor Command Prompt */
 
diff --git a/include/configs/smdk5250.h b/include/configs/smdk5250.h
index 66fa179..751b5eb 100644
--- a/include/configs/smdk5250.h
+++ b/include/configs/smdk5250.h
@@ -9,7 +9,7 @@
 #ifndef __CONFIG_SMDK_H
 #define __CONFIG_SMDK_H
 
-#include configs/exynos5250-dt.h
+#include configs/exynos5250-common.h
 
 #undef CONFIG_DEFAULT_DEVICE_TREE
 #define CONFIG_DEFAULT_DEVICE_TREE exynos5250-smdk5250
diff --git a/include/configs/smdk5420.h b/include/configs/smdk5420.h
index 606739b..43c9808 100644
--- a/include/configs/smdk5420.h
+++ b/include/configs/smdk5420.h
@@ -9,7 +9,7 @@
 #ifndef __CONFIG_SMDK5420_H
 #define 

[U-Boot] [PATCH 8/8] samsung: Move smdkc100 to use exynos-common config

2014-07-23 Thread Simon Glass
Change this board to use the exynos common config and add a device tree.

Signed-off-by: Simon Glass s...@chromium.org
---

 arch/arm/dts/Makefile |  1 +
 arch/arm/dts/s5pc1xx-smdkc100.dts | 21 +++
 include/configs/smdkc100.h| 57 +--
 3 files changed, 35 insertions(+), 44 deletions(-)
 create mode 100644 arch/arm/dts/s5pc1xx-smdkc100.dts

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 6a6e664..ed67844 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -1,3 +1,4 @@
+dtb-$(CONFIG_S5PC100) += s5pc1xx-smdkc100.dtb
 dtb-$(CONFIG_S5PC110) += s5pc1xx-goni.dtb
 dtb-$(CONFIG_EXYNOS4) += exynos4210-origen.dtb \
exynos4210-smdkv310.dtb \
diff --git a/arch/arm/dts/s5pc1xx-smdkc100.dts 
b/arch/arm/dts/s5pc1xx-smdkc100.dts
new file mode 100644
index 000..409812d
--- /dev/null
+++ b/arch/arm/dts/s5pc1xx-smdkc100.dts
@@ -0,0 +1,21 @@
+/*
+ * Samsung's Exynos4210-based SMDKV310 board device tree source
+ *
+ * Copyright (c) 2014 Google, Inc
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+/dts-v1/;
+/include/ exynos4.dtsi
+
+/ {
+   model = Samsung SMDKC100;
+   compatible = samsung,smdkc100;
+
+   aliases {
+   serial0 = /serial@1380;
+   console = /serial@1382;
+   };
+
+};
diff --git a/include/configs/smdkc100.h b/include/configs/smdkc100.h
index c9a2e15..4fd288c 100644
--- a/include/configs/smdkc100.h
+++ b/include/configs/smdkc100.h
@@ -12,73 +12,51 @@
 #ifndef __CONFIG_H
 #define __CONFIG_H
 
+#include exynos-common.h
+
+#undef CONFIG_BOARD_COMMON
+#undef CONFIG_ARCH_EARLY_INIT_R
+#undef CONFIG_BOARD_EARLY_INIT_F
+#undef CONFIG_GENERIC_MMC
+#undef CONFIG_CMD_MMC
+#undef CONFIG_MMC
+#undef CONFIG_S5P_SDHCI
+#undef CONFIG_EXYNOS_DWMMC
+
 /*
  * High Level Configuration Options
  * (easy to change)
  */
-#define CONFIG_SAMSUNG 1   /* in a SAMSUNG core */
-#define CONFIG_S5P 1   /* which is in a S5P Family */
 #define CONFIG_S5PC100 1   /* which is in a S5PC100 */
 #define CONFIG_SMDKC1001   /* working with SMDKC100 */
 
-#include asm/arch/cpu.h  /* get chip and board defs */
-
-#define CONFIG_ARCH_CPU_INIT
-
-#define CONFIG_DISPLAY_CPUINFO
-#define CONFIG_DISPLAY_BOARDINFO
-
-/* input clock of PLL: SMDKC100 has 12MHz input clock */
-#define CONFIG_SYS_CLK_FREQ1200
-
 /* DRAM Base */
 #define CONFIG_SYS_SDRAM_BASE  0x3000
 
 /* Text Base */
 #define CONFIG_SYS_TEXT_BASE   0x3480
 
-#define CONFIG_SETUP_MEMORY_TAGS
-#define CONFIG_CMDLINE_TAG
-#define CONFIG_INITRD_TAG
-#define CONFIG_CMDLINE_EDITING
-
-/*
- * Size of malloc() pool
- * 1MB = 0x10, 0x10 = 1024 * 1024
- */
-#define CONFIG_SYS_MALLOC_LEN  (CONFIG_ENV_SIZE + (1  20))
 /*
  * select serial console configuration
  */
 #define CONFIG_SERIAL0 1   /* use SERIAL 0 on SMDKC100 */
 
-/* PWM */
-#define CONFIG_PWM 1
-
 /* allow to overwrite serial and ethaddr */
 #define CONFIG_ENV_OVERWRITE
-#define CONFIG_BAUDRATE115200
 
 /***
  * Command definition
  ***/
-#include config_cmd_default.h
 
 #undef CONFIG_CMD_FLASH
 #undef CONFIG_CMD_IMLS
 #undef CONFIG_CMD_NAND
 
-#define CONFIG_CMD_CACHE
 #define CONFIG_CMD_REGINFO
 #define CONFIG_CMD_ONENAND
 #define CONFIG_CMD_ELF
-#define CONFIG_CMD_FAT
 #define CONFIG_CMD_MTDPARTS
 
-#define CONFIG_BOOTDELAY   3
-
-#define CONFIG_ZERO_BOOTDELAY_CHECK
-
 #define CONFIG_MTD_DEVICE
 #define CONFIG_MTD_PARTITIONS
 
@@ -153,14 +131,7 @@
 /*
  * Miscellaneous configurable options
  */
-#define CONFIG_SYS_LONGHELP/* undef to save memory */
-#define CONFIG_SYS_HUSH_PARSER /* use hush command parser*/
 #define CONFIG_SYS_PROMPT  SMDKC100 # 
-#define CONFIG_SYS_CBSIZE  256 /* Console I/O Buffer Size */
-#define CONFIG_SYS_PBSIZE  384 /* Print Buffer Size */
-#define CONFIG_SYS_MAXARGS 16  /* max number of command args */
-/* Boot Argument Buffer Size */
-#define CONFIG_SYS_BARGSIZECONFIG_SYS_CBSIZE
 /* memtest works on */
 #define CONFIG_SYS_MEMTEST_START   CONFIG_SYS_SDRAM_BASE
 #define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_SDRAM_BASE + 0x5e0)
@@ -176,8 +147,6 @@
 /*---
  * FLASH and environment organization
  */
-#define CONFIG_SYS_NO_FLASH1
-
 #define CONFIG_SYS_MONITOR_LEN (256  10) /* 256 KiB */
 #define CONFIG_IDENT_STRING for SMDKC100
 
@@ -203,8 +172,6 @@
 #define CONFIG_SAMSUNG_ONENAND 1
 #define CONFIG_SYS_ONENAND_BASE0xE710
 
-#define CONFIG_DOS_PARTITION   1
-
 #define CONFIG_SYS_INIT_SP_ADDR(CONFIG_SYS_LOAD_ADDR - 0x100)
 
 /*

[U-Boot] [PATCH 6/8] config: Move smdkv310 to use common exynos4 file

2014-07-23 Thread Simon Glass
Most of the smdkv310 features are common with other exynos4 boards. To
permit easier addition of driver model support, use the common file and
add a device tree file.

Signed-off-by: Simon Glass s...@chromium.org
---

 arch/arm/dts/Makefile|  1 +
 arch/arm/dts/exynos4210-smdkv310.dts | 21 
 include/configs/smdkv310.h   | 65 
 3 files changed, 36 insertions(+), 51 deletions(-)
 create mode 100644 arch/arm/dts/exynos4210-smdkv310.dts

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 6e2e313..3b760ff 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -1,4 +1,5 @@
 dtb-$(CONFIG_EXYNOS4) += exynos4210-origen.dtb \
+   exynos4210-smdkv310.dtb \
exynos4210-universal_c210.dtb \
exynos4210-trats.dtb \
exynos4412-trats2.dtb
diff --git a/arch/arm/dts/exynos4210-smdkv310.dts 
b/arch/arm/dts/exynos4210-smdkv310.dts
new file mode 100644
index 000..c390c8f
--- /dev/null
+++ b/arch/arm/dts/exynos4210-smdkv310.dts
@@ -0,0 +1,21 @@
+/*
+ * Samsung's Exynos4210-based SMDKV310 board device tree source
+ *
+ * Copyright (c) 2014 Google, Inc
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+/dts-v1/;
+/include/ exynos4.dtsi
+
+/ {
+   model = Samsung SMDKV310 on Exynos4210;
+   compatible = samsung,smdkv310, samsung,exynos4210;
+
+   aliases {
+   serial0 = /serial@1380;
+   console = /serial@1382;
+   };
+
+};
diff --git a/include/configs/smdkv310.h b/include/configs/smdkv310.h
index 34adfaf..7c1bb33 100644
--- a/include/configs/smdkv310.h
+++ b/include/configs/smdkv310.h
@@ -9,71 +9,43 @@
 #ifndef __CONFIG_H
 #define __CONFIG_H
 
+#include exynos4-common.h
+
+#undef CONFIG_BOARD_COMMON
+#undef CONFIG_ARCH_EARLY_INIT_R
+#undef CONFIG_USB_GADGET
+#undef CONFIG_USB_GADGET_S3C_UDC_OTG
+#undef CONFIG_CMD_USB_MASS_STORAGE
+#undef CONFIG_REVISION_TAG
+#undef CONFIG_CMD_THOR_DOWNLOAD
+#undef CONFIG_CMD_DFU
+
 /* High Level Configuration Options */
-#define CONFIG_SAMSUNG 1   /* in a SAMSUNG core */
-#define CONFIG_S5P 1   /* S5P Family */
-#define CONFIG_EXYNOS4 /* EXYNOS4 Family */
 #define CONFIG_EXYNOS4210  1   /* which is a EXYNOS4210 SoC */
 #define CONFIG_SMDKV3101   /* working with 
SMDKV310*/
 
-#include asm/arch/cpu.h  /* get chip and board defs */
-
-#define CONFIG_ARCH_CPU_INIT
-#define CONFIG_DISPLAY_CPUINFO
-#define CONFIG_DISPLAY_BOARDINFO
-#define CONFIG_BOARD_EARLY_INIT_F
-
 /* Mach Type */
 #define CONFIG_MACH_TYPE   MACH_TYPE_SMDKV310
 
 #define CONFIG_SYS_SDRAM_BASE  0x4000
 #define CONFIG_SYS_TEXT_BASE   0x43E0
 
-/* input clock of PLL: SMDKV310 has 24MHz input clock */
-#define CONFIG_SYS_CLK_FREQ2400
-
-#define CONFIG_SETUP_MEMORY_TAGS
-#define CONFIG_CMDLINE_TAG
-#define CONFIG_INITRD_TAG
-#define CONFIG_CMDLINE_EDITING
-
 /* Handling Sleep Mode*/
 #define S5P_CHECK_SLEEP0x0BAD
 #define S5P_CHECK_DIDLE0xBAD0
 #define S5P_CHECK_LPA  0xABAD
 
-/* Size of malloc() pool */
-#define CONFIG_SYS_MALLOC_LEN  (CONFIG_ENV_SIZE + (1  20))
-
 /* select serial console configuration */
 #define CONFIG_SERIAL1 1   /* use SERIAL 1 */
-#define CONFIG_BAUDRATE115200
 #define EXYNOS4_DEFAULT_UART_OFFSET0x01
 
-/* SD/MMC configuration */
-#define CONFIG_GENERIC_MMC
-#define CONFIG_MMC
-#define CONFIG_SDHCI
-#define CONFIG_S5P_SDHCI
-
-/* PWM */
-#define CONFIG_PWM 1
-
 /* allow to overwrite serial and ethaddr */
 #define CONFIG_ENV_OVERWRITE
 
-/* Command definition*/
-#include config_cmd_default.h
-
 #define CONFIG_CMD_PING
 #define CONFIG_CMD_ELF
 #define CONFIG_CMD_DHCP
-#define CONFIG_CMD_MMC
 #define CONFIG_CMD_NET
-#define CONFIG_CMD_FAT
-
-#define CONFIG_BOOTDELAY   3
-#define CONFIG_ZERO_BOOTDELAY_CHECK
 
 /* MMC SPL */
 #define CONFIG_SPL
@@ -85,15 +57,8 @@
 #define CONFIG_BOOTCOMMAND fatload mmc 0 40007000 uImage; bootm 40007000
 
 /* Miscellaneous configurable options */
-#define CONFIG_SYS_LONGHELP/* undef to save memory */
-#define CONFIG_SYS_HUSH_PARSER /* use hush command parser*/
 #define CONFIG_SYS_PROMPT  SMDKV310 # 
-#define CONFIG_SYS_CBSIZE  256 /* Console I/O Buffer Size*/
-#define CONFIG_SYS_PBSIZE  384 /* Print Buffer Size */
-#define CONFIG_SYS_MAXARGS 16  /* max number of command args */
 #define CONFIG_DEFAULT_CONSOLE console=ttySAC2,115200n8\0
-/* Boot Argument Buffer Size */
-#define CONFIG_SYS_BARGSIZECONFIG_SYS_CBSIZE
 /* memtest works on */
 #define CONFIG_SYS_MEMTEST_START   CONFIG_SYS_SDRAM_BASE
 #define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_SDRAM_BASE + 

[U-Boot] [PATCH 5/8] config: Move arndale to use common exynos5250 file

2014-07-23 Thread Simon Glass
Most of the arndale features are common with other exynos5250 boards. To
permit easier addition of driver model support, use the common file.

Signed-off-by: Simon Glass s...@chromium.org
---

 include/configs/arndale.h | 212 +++---
 1 file changed, 14 insertions(+), 198 deletions(-)

diff --git a/include/configs/arndale.h b/include/configs/arndale.h
index 370db82..1f0bec9 100644
--- a/include/configs/arndale.h
+++ b/include/configs/arndale.h
@@ -9,219 +9,55 @@
 #ifndef __CONFIG_ARNDALE_H
 #define __CONFIG_ARNDALE_H
 
-/* High Level Configuration Options */
-#define CONFIG_SAMSUNG /* in a SAMSUNG core */
-#define CONFIG_S5P /* S5P Family */
-#define CONFIG_EXYNOS5 /* which is in a Exynos5 Family */
-#define CONFIG_EXYNOS5250
-
-#include asm/arch/cpu.h  /* get chip and board defs */
-
-#define CONFIG_SYS_GENERIC_BOARD
-#define CONFIG_ARCH_CPU_INIT
-#define CONFIG_DISPLAY_CPUINFO
-#define CONFIG_DISPLAY_BOARDINFO
-
-#define CONFIG_OF_CONTROL
-#define CONFIG_OF_SEPARATE
-
-/* Allow tracing to be enabled */
-#define CONFIG_TRACE
-#define CONFIG_CMD_TRACE
-#define CONFIG_TRACE_BUFFER_SIZE   (16  20)
-#define CONFIG_TRACE_EARLY_SIZE(8  20)
-#define CONFIG_TRACE_EARLY
-#define CONFIG_TRACE_EARLY_ADDR0x5000
-
-/* Keep L2 Cache Disabled */
-#define CONFIG_SYS_DCACHE_OFF
-
-#define CONFIG_SYS_SDRAM_BASE  0x4000
-#define CONFIG_SYS_TEXT_BASE   0x43E0
-
-/* input clock of PLL: SMDK5250 has 24MHz input clock */
-#define CONFIG_SYS_CLK_FREQ2400
-
-#define CONFIG_SETUP_MEMORY_TAGS
-#define CONFIG_CMDLINE_TAG
-#define CONFIG_INITRD_TAG
-#define CONFIG_CMDLINE_EDITING
-
-/* Power Down Modes */
-#define S5P_CHECK_SLEEP0x0BAD
-#define S5P_CHECK_DIDLE0xBAD0
-#define S5P_CHECK_LPA  0xABAD
-
-/* Offset for inform registers */
-#define INFORM0_OFFSET 0x800
-#define INFORM1_OFFSET 0x804
-
-/* Size of malloc() pool */
-#define CONFIG_SYS_MALLOC_LEN  (CONFIG_ENV_SIZE + (4  20))
-
-/* select serial console configuration */
-#define CONFIG_BAUDRATE115200
-#define EXYNOS5_DEFAULT_UART_OFFSET0x01
-#define CONFIG_SILENT_CONSOLE
-
-/* Console configuration */
-#define CONFIG_CONSOLE_MUX
-#define CONFIG_SYS_CONSOLE_IS_IN_ENV
-#define EXYNOS_DEVICE_SETTINGS \
-   stdin=serial\0 \
-   stdout=serial\0 \
-   stderr=serial\0
-
-#define CONFIG_EXTRA_ENV_SETTINGS \
-   EXYNOS_DEVICE_SETTINGS
+#include exynos5250-common.h
+
+#undef CONFIG_BOARD_COMMON
+#undef CONFIG_ARCH_EARLY_INIT_R
 
 /* SD/MMC configuration */
-#define CONFIG_GENERIC_MMC
-#define CONFIG_MMC
-#define CONFIG_SDHCI
-#define CONFIG_S5P_SDHCI
-#define CONFIG_DWMMC
-#define CONFIG_EXYNOS_DWMMC
 #define CONFIG_SUPPORT_EMMC_BOOT
-#define CONFIG_BOUNCE_BUFFER
-
-
-#define CONFIG_BOARD_EARLY_INIT_F
-#define CONFIG_SKIP_LOWLEVEL_INIT
-
-/* PWM */
-#define CONFIG_PWM
 
 /* allow to overwrite serial and ethaddr */
 #define CONFIG_ENV_OVERWRITE
 
-/* Command definition*/
-#include config_cmd_default.h
-
-#define CONFIG_CMD_PING
-#define CONFIG_CMD_ELF
-#define CONFIG_CMD_MMC
 #define CONFIG_CMD_EXT2
-#define CONFIG_CMD_FAT
-#define CONFIG_CMD_NET
-#define CONFIG_CMD_HASH
-
-#define CONFIG_BOOTDELAY   3
-#define CONFIG_ZERO_BOOTDELAY_CHECK
 
 /* USB */
-#define CONFIG_CMD_USB
+#undef CONFIG_USB_XHCI
+#undef CONFIG_USB_XHCI_EXYNOS
 #define CONFIG_USB_EHCI
 #define CONFIG_USB_EHCI_EXYNOS
-#define CONFIG_USB_STORAGE
 
+#undef CONFIG_SYS_USB_XHCI_MAX_ROOT_PORTS
 #define CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS 3
 #define CONFIG_USB_HOST_ETHER
 #define CONFIG_USB_ETHER_ASIX
 
 /* MMC SPL */
 #define CONFIG_EXYNOS_SPL
-#define CONFIG_SPL
-#define COPY_BL2_FNPTR_ADDR0x02020030
-
-#define CONFIG_SPL_LIBCOMMON_SUPPORT
-
-/* specific .lds file */
-#define CONFIG_SPL_LDSCRIPTboard/samsung/common/exynos-uboot-spl.lds
-#define CONFIG_SPL_TEXT_BASE   0x02023400
-#define CONFIG_SPL_MAX_FOOTPRINT   (14 * 1024)
-
-#define CONFIG_BOOTCOMMAND mmc read 40007000 451 2000; bootm 40007000
 
 /* Miscellaneous configurable options */
-#define CONFIG_SYS_LONGHELP/* undef to save memory */
-#define CONFIG_SYS_HUSH_PARSER /* use hush command parser*/
+#undef CONFIG_SYS_PROMPT
 #define CONFIG_SYS_PROMPT  ARNDALE # 
-#define CONFIG_SYS_CBSIZE  256 /* Console I/O Buffer Size */
-#define CONFIG_SYS_PBSIZE  384 /* Print Buffer Size */
-#define CONFIG_SYS_MAXARGS 16  /* max number of command args */
+#undef CONFIG_DEFAULT_CONSOLE
 #define CONFIG_DEFAULT_CONSOLE console=ttySAC2,115200n8\0
-/* Boot Argument Buffer Size */
-#define CONFIG_SYS_BARGSIZECONFIG_SYS_CBSIZE
-/* memtest works on */
-#define CONFIG_SYS_MEMTEST_START   

[U-Boot] [PATCH 4/8] exynos: config: Move cros_ec and tps65090 out of smdk boards

2014-07-23 Thread Simon Glass
These boards do not in fact have a Chrome OS EC, nor a TPS565090 PMIC, so
move the settings into a separate common file to be used by those that need
it.

Signed-off-by: Simon Glass s...@chromium.org
---

 include/configs/exynos5-common.h| 18 +++---
 include/configs/exynos5-dt-common.h | 35 +++
 include/configs/exynos5250-common.h |  3 ---
 include/configs/peach-pit.h |  1 +
 include/configs/snow.h  |  4 
 5 files changed, 43 insertions(+), 18 deletions(-)
 create mode 100644 include/configs/exynos5-dt-common.h

diff --git a/include/configs/exynos5-common.h b/include/configs/exynos5-common.h
index b745f6a..8f7c4b7 100644
--- a/include/configs/exynos5-common.h
+++ b/include/configs/exynos5-common.h
@@ -48,17 +48,10 @@
 #define CONFIG_SYS_CONSOLE_IS_IN_ENV
 #define CONFIG_CONSOLE_MUX
 
-/* Enable keyboard */
-#define CONFIG_CROS_EC /* CROS_EC protocol */
-#define CONFIG_CROS_EC_KEYB/* CROS_EC keyboard input */
-#define CONFIG_CMD_CROS_EC
-#define CONFIG_KEYBOARD
-
-/* Console configuration */
 #define EXYNOS_DEVICE_SETTINGS \
-   stdin=serial,cros-ec-keyb\0 \
-   stdout=serial,lcd\0 \
-   stderr=serial,lcd\0
+   stdin=serial\0 \
+   stdout=serial\0 \
+   stderr=serial\0
 
 #define CONFIG_EXTRA_ENV_SETTINGS \
EXYNOS_DEVICE_SETTINGS
@@ -186,11 +179,6 @@
 #define CONFIG_ENV_SPI_MAX_HZ  5000
 #endif
 
-/* PMIC */
-#define CONFIG_POWER
-#define CONFIG_POWER_I2C
-#define CONFIG_POWER_TPS65090
-
 /* Ethernet Controllor Driver */
 #ifdef CONFIG_CMD_NET
 #define CONFIG_SMC911X
diff --git a/include/configs/exynos5-dt-common.h 
b/include/configs/exynos5-dt-common.h
new file mode 100644
index 000..66547fa
--- /dev/null
+++ b/include/configs/exynos5-dt-common.h
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2014 Google, Inc
+ *
+ * Configuration settings for generic Exynos 5 board
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#ifndef __CONFIG_EXYNOS5_DT_COMMON_H
+#define __CONFIG_EXYNOS5_DT_COMMON_H
+
+#include exynos5-common.h
+
+/* PMIC */
+#define CONFIG_POWER
+#define CONFIG_POWER_I2C
+#define CONFIG_POWER_TPS65090
+
+/* Enable keyboard */
+#define CONFIG_CROS_EC /* CROS_EC protocol */
+#define CONFIG_CROS_EC_KEYB/* CROS_EC keyboard input */
+#define CONFIG_CMD_CROS_EC
+#define CONFIG_KEYBOARD
+
+/* Console configuration */
+#undef EXYNOS_DEVICE_SETTINGS
+#define EXYNOS_DEVICE_SETTINGS \
+   stdin=serial,cros-ec-keyb\0 \
+   stdout=serial,lcd\0 \
+   stderr=serial,lcd\0
+
+#define CONFIG_EXTRA_ENV_SETTINGS \
+   EXYNOS_DEVICE_SETTINGS
+
+#endif
diff --git a/include/configs/exynos5250-common.h 
b/include/configs/exynos5250-common.h
index b4c1ccf..987eb15 100644
--- a/include/configs/exynos5250-common.h
+++ b/include/configs/exynos5250-common.h
@@ -22,8 +22,6 @@
 
 #define CONFIG_SPL_MAX_FOOTPRINT   (14 * 1024)
 
-#define CONFIG_CROS_EC_I2C /* Support CROS_EC over I2C */
-
 /* USB */
 #define CONFIG_CMD_USB
 #define CONFIG_USB_XHCI
@@ -44,7 +42,6 @@
 
 /* PMIC */
 #define CONFIG_POWER_MAX77686
-#define CONFIG_POWER_TPS65090_I2C
 
 /* Sound */
 #define CONFIG_CMD_SOUND
diff --git a/include/configs/peach-pit.h b/include/configs/peach-pit.h
index 407f10f..6a41a6e 100644
--- a/include/configs/peach-pit.h
+++ b/include/configs/peach-pit.h
@@ -10,6 +10,7 @@
 #define __CONFIG_PEACH_PIT_H
 
 #include configs/exynos5420-common.h
+#include configs/exynos5-dt-common.h
 
 #undef CONFIG_DEFAULT_DEVICE_TREE
 #define CONFIG_DEFAULT_DEVICE_TREE exynos5420-peach-pit
diff --git a/include/configs/snow.h b/include/configs/snow.h
index 58b011d..93a03b1 100644
--- a/include/configs/snow.h
+++ b/include/configs/snow.h
@@ -10,8 +10,12 @@
 #define __CONFIG_SNOW_H
 
 #include configs/exynos5250-common.h
+#include configs/exynos5-dt-common.h
 
 #undef CONFIG_DEFAULT_DEVICE_TREE
 #define CONFIG_DEFAULT_DEVICE_TREE exynos5250-snow
 
+#define CONFIG_CROS_EC_I2C /* Support CROS_EC over I2C */
+#define CONFIG_POWER_TPS65090_I2C
+
 #endif /* __CONFIG_SNOW_H */
-- 
2.0.0.526.g5318336

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


[U-Boot] [PATCH 7/8] samsung: Move s5p_goni to use exynos-common config

2014-07-23 Thread Simon Glass
Change this board to use the exynos common config and add a device tree.

This also adds a pinmux header file - but it is just a copy of the exynos
one so may be incorrect.

Signed-off-by: Simon Glass s...@chromium.org
---

 arch/arm/dts/Makefile  |  1 +
 arch/arm/dts/s5pc1xx-goni.dts  | 21 ++
 arch/arm/include/asm/arch-s5pc1xx/periph.h | 61 ++
 arch/arm/include/asm/arch-s5pc1xx/pinmux.h | 50 
 drivers/mmc/s5p_sdhci.c|  2 -
 include/configs/s5p_goni.h | 55 +--
 6 files changed, 143 insertions(+), 47 deletions(-)
 create mode 100644 arch/arm/dts/s5pc1xx-goni.dts
 create mode 100644 arch/arm/include/asm/arch-s5pc1xx/periph.h
 create mode 100644 arch/arm/include/asm/arch-s5pc1xx/pinmux.h

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 3b760ff..6a6e664 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -1,3 +1,4 @@
+dtb-$(CONFIG_S5PC110) += s5pc1xx-goni.dtb
 dtb-$(CONFIG_EXYNOS4) += exynos4210-origen.dtb \
exynos4210-smdkv310.dtb \
exynos4210-universal_c210.dtb \
diff --git a/arch/arm/dts/s5pc1xx-goni.dts b/arch/arm/dts/s5pc1xx-goni.dts
new file mode 100644
index 000..c390c8f
--- /dev/null
+++ b/arch/arm/dts/s5pc1xx-goni.dts
@@ -0,0 +1,21 @@
+/*
+ * Samsung's Exynos4210-based SMDKV310 board device tree source
+ *
+ * Copyright (c) 2014 Google, Inc
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+/dts-v1/;
+/include/ exynos4.dtsi
+
+/ {
+   model = Samsung SMDKV310 on Exynos4210;
+   compatible = samsung,smdkv310, samsung,exynos4210;
+
+   aliases {
+   serial0 = /serial@1380;
+   console = /serial@1382;
+   };
+
+};
diff --git a/arch/arm/include/asm/arch-s5pc1xx/periph.h 
b/arch/arm/include/asm/arch-s5pc1xx/periph.h
new file mode 100644
index 000..5c1c3d4
--- /dev/null
+++ b/arch/arm/include/asm/arch-s5pc1xx/periph.h
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2012 Samsung Electronics
+ * Rajeshwari Shinde rajeshwar...@samsung.com
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#ifndef __ASM_ARM_ARCH_PERIPH_H
+#define __ASM_ARM_ARCH_PERIPH_H
+
+/*
+ * Peripherals required for pinmux configuration. List will
+ * grow with support for more devices getting added.
+ * Numbering based on interrupt table.
+ *
+ */
+enum periph_id {
+   PERIPH_ID_UART0 = 51,
+   PERIPH_ID_UART1,
+   PERIPH_ID_UART2,
+   PERIPH_ID_UART3,
+   PERIPH_ID_I2C0 = 56,
+   PERIPH_ID_I2C1,
+   PERIPH_ID_I2C2,
+   PERIPH_ID_I2C3,
+   PERIPH_ID_I2C4,
+   PERIPH_ID_I2C5,
+   PERIPH_ID_I2C6,
+   PERIPH_ID_I2C7,
+   PERIPH_ID_SPI0 = 68,
+   PERIPH_ID_SPI1,
+   PERIPH_ID_SPI2,
+   PERIPH_ID_SDMMC0 = 75,
+   PERIPH_ID_SDMMC1,
+   PERIPH_ID_SDMMC2,
+   PERIPH_ID_SDMMC3,
+   PERIPH_ID_I2C8 = 87,
+   PERIPH_ID_I2C9,
+   PERIPH_ID_I2S0 = 98,
+   PERIPH_ID_I2S1 = 99,
+
+   /* Since following peripherals do
+* not have shared peripheral interrupts (SPIs)
+* they are numbered arbitiraly after the maximum
+* SPIs Exynos has (128)
+*/
+   PERIPH_ID_SROMC = 128,
+   PERIPH_ID_SPI3,
+   PERIPH_ID_SPI4,
+   PERIPH_ID_SDMMC4,
+   PERIPH_ID_PWM0,
+   PERIPH_ID_PWM1,
+   PERIPH_ID_PWM2,
+   PERIPH_ID_PWM3,
+   PERIPH_ID_PWM4,
+   PERIPH_ID_I2C10 = 203,
+
+   PERIPH_ID_NONE = -1,
+};
+
+#endif /* __ASM_ARM_ARCH_PERIPH_H */
diff --git a/arch/arm/include/asm/arch-s5pc1xx/pinmux.h 
b/arch/arm/include/asm/arch-s5pc1xx/pinmux.h
new file mode 100644
index 000..0b91ef6
--- /dev/null
+++ b/arch/arm/include/asm/arch-s5pc1xx/pinmux.h
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2012 Samsung Electronics
+ * Abhilash Kesavan a.kesa...@samsung.com
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#ifndef __ASM_ARM_ARCH_PINMUX_H
+#define __ASM_ARM_ARCH_PINMUX_H
+
+#include periph.h
+
+/*
+ * Flags for setting specific configarations of peripherals.
+ * List will grow with support for more devices getting added.
+ */
+enum {
+   PINMUX_FLAG_NONE= 0x,
+
+   /* Flags for eMMC */
+   PINMUX_FLAG_8BIT_MODE   = 1  0,   /* SDMMC 8-bit mode */
+
+   /* Flags for SROM controller */
+   PINMUX_FLAG_BANK= 3  0,   /* bank number (0-3) */
+   PINMUX_FLAG_16BIT   = 1  2,   /* 16-bit width */
+};
+
+/**
+ * Configures the pinmux for a particular peripheral.
+ *
+ * Each gpio can be configured in many different ways (4 bits on exynos)
+ * such as input, output, special function, external interrupt
+ * etc. This function will configure the peripheral pinmux along with
+ * pull-up/down and drive strength.
+ *
+ * @param peripheral   peripheral to be configured
+ * @param flagsconfigure flags
+ * @return 0 if ok, -1 on error (e.g. unsupported peripheral)
+ */
+int exynos_pinmux_config(int 

Re: [U-Boot] [PATCH v3 2/9] arm: Set up global data before board_init_f()

2014-07-23 Thread Simon Glass
+Albert, Tom

Hi Albert,

On 11 July 2014 11:44, Jeroen Hofstee dasub...@myspectrum.nl wrote:
 Hello Simon,


 On 11-07-14 06:23, Simon Glass wrote:

 At present arm defines CONFIG_SYS_GENERIC_GLOBAL_DATA, meaning that
 the global_data pointer is set up in board_init_f(). However it is
 actually set up before this, it just isn't zeroed.

 If we zero the global data before calling board_init_f() then we
 don't need to define CONFIG_SYS_GENERIC_GLOBAL_DATA.

 Make this change (on arm32 only) to simplify the init process. I
 don't have the ability to test aarch64 yet.

 Signed-off-by: Simon Glass s...@chromium.org
 ---

 Changes in v3:
 - Fix assembler code comment in crt0.S to say GD, not BSS
 - Ensure that aarch64 stays as it was
 - Add newline after clr_gd label
 - Remove redundant mov r0, #0

Are you happy with this patch? I would like to apply to to the dm
repo, but would quite like to get an ack first.


 Changes in v2: None

   arch/arm/include/asm/config.h | 2 ++
   arch/arm/lib/crt0.S   | 9 +
   2 files changed, 11 insertions(+)

 Looks good to me. I picked up this one instead
 of my memset version.


 Thanks, Jeroen

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


[U-Boot] [PATCH 3/8] exynos: Move common smdk5420 things to common file

2014-07-23 Thread Simon Glass
A few things are common but are not in the common file. Fix this and
rename the file to fit with the other exynos*-common files.

Signed-off-by: Simon Glass s...@chromium.org
---

 include/configs/{exynos5420.h = exynos5420-common.h} | 11 ++-
 include/configs/peach-pit.h   |  7 +--
 include/configs/smdk5420.h|  7 +--
 3 files changed, 8 insertions(+), 17 deletions(-)
 rename include/configs/{exynos5420.h = exynos5420-common.h} (88%)

diff --git a/include/configs/exynos5420.h b/include/configs/exynos5420-common.h
similarity index 88%
rename from include/configs/exynos5420.h
rename to include/configs/exynos5420-common.h
index d2a9556..685f9c1 100644
--- a/include/configs/exynos5420.h
+++ b/include/configs/exynos5420-common.h
@@ -9,7 +9,9 @@
 #ifndef __CONFIG_EXYNOS5420_H
 #define __CONFIG_EXYNOS5420_H
 
-#define CONFIG_EXYNOS5420  /* which is in a Exynos5 Family */
+#define CONFIG_EXYNOS5420
+
+#include configs/exynos5-common.h
 
 #define MACH_TYPE_SMDK5420 8002
 #define CONFIG_MACH_TYPE   MACH_TYPE_SMDK5420
@@ -31,10 +33,6 @@
 
 #define CONFIG_MAX_I2C_NUM 11
 
-/* Enable FIT support and comparison */
-#define CONFIG_FIT
-#define CONFIG_FIT_BEST_MATCH
-
 #define CONFIG_BOARD_REV_GPIO_COUNT2
 
 #define CONFIG_BOOTCOMMAND mmc read 20007000 451 2000; bootm 20007000
@@ -49,4 +47,7 @@
 #define CONFIG_NR_DRAM_BANKS   7
 #define SDRAM_BANK_SIZE(512UL  20UL) /* 512 MB */
 
+/* select serial console configuration */
+#define CONFIG_SERIAL3 /* use SERIAL 3 */
+
 #endif /* __CONFIG_EXYNOS5420_H */
diff --git a/include/configs/peach-pit.h b/include/configs/peach-pit.h
index 59192e1..407f10f 100644
--- a/include/configs/peach-pit.h
+++ b/include/configs/peach-pit.h
@@ -9,16 +9,11 @@
 #ifndef __CONFIG_PEACH_PIT_H
 #define __CONFIG_PEACH_PIT_H
 
-#include configs/exynos5-common.h
-
-#include configs/exynos5420.h
+#include configs/exynos5420-common.h
 
 #undef CONFIG_DEFAULT_DEVICE_TREE
 #define CONFIG_DEFAULT_DEVICE_TREE exynos5420-peach-pit
 
-/* select serial console configuration */
-#define CONFIG_SERIAL3 /* use SERIAL 3 */
-
 #define CONFIG_SYS_PROMPT  Peach # 
 #define CONFIG_IDENT_STRING for Peach
 
diff --git a/include/configs/smdk5420.h b/include/configs/smdk5420.h
index 43c9808..83abc13 100644
--- a/include/configs/smdk5420.h
+++ b/include/configs/smdk5420.h
@@ -9,18 +9,13 @@
 #ifndef __CONFIG_SMDK5420_H
 #define __CONFIG_SMDK5420_H
 
-#include configs/exynos5-common.h
-
-#include configs/exynos5420.h
+#include configs/exynos5420-common.h
 
 #define CONFIG_SMDK5420/* which is in a SMDK5420 */
 
 #undef CONFIG_DEFAULT_DEVICE_TREE
 #define CONFIG_DEFAULT_DEVICE_TREE exynos5420-smdk5420
 
-/* select serial console configuration */
-#define CONFIG_SERIAL3 /* use SERIAL 3 */
-
 #define CONFIG_SYS_PROMPT  SMDK5420 # 
 #define CONFIG_IDENT_STRING for SMDK5420
 
-- 
2.0.0.526.g5318336

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


Re: [U-Boot] [PATCH v3 5/9] arm: Support pre-relocation malloc()

2014-07-23 Thread Simon Glass
+Tom

Hi Albert,

On 10 July 2014 22:23, Simon Glass s...@chromium.org wrote:
 Add support for re-relocation malloc() in arm's start-up code.

 Signed-off-by: Simon Glass s...@chromium.org
 ---

 Changes in v3:
 - Rebase on earlier patch

Can you please take a look at this patch? I would like to apply it to
the dm repo.


 Changes in v2: None

  README  | 3 +++
  arch/arm/lib/crt0.S | 5 -
  2 files changed, 7 insertions(+), 1 deletion(-)

 diff --git a/README b/README
 index 11e9d31..73abbf0 100644
 --- a/README
 +++ b/README
 @@ -3749,6 +3749,9 @@ Configuration Settings:
 The memory will be freed (or in fact just forgotton) when
 U-Boot relocates itself.

 +   Pre-relocation malloc() is only supported on ARM at present
 +   but is fairly easy to enable for other archs.
 +
  - CONFIG_SYS_BOOTM_LEN:
 Normally compressed uImages are limited to an
 uncompressed size of 8 MBytes. If this is not enough,
 diff --git a/arch/arm/lib/crt0.S b/arch/arm/lib/crt0.S
 index 43aa212..29cdad0 100644
 --- a/arch/arm/lib/crt0.S
 +++ b/arch/arm/lib/crt0.S
 @@ -78,7 +78,10 @@ clr_gd:
 strlo   r0, [r1]/* clear 32-bit GD word */
 addlo   r1, r1, #4  /* move to next */
 blo clr_gd
 -
 +#if defined(CONFIG_SYS_MALLOC_F_LEN)  !defined(CONFIG_SPL_BUILD)
 +   sub sp, sp, #CONFIG_SYS_MALLOC_F_LEN
 +   str sp, [r9, #GD_MALLOC_BASE]
 +#endif
 /* mov r0, #0 not needed due to above code */
 bl  board_init_f

 --
 2.0.0.526.g5318336


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


[U-Boot] [PATCH v2] powerpc/t104xrdb: Add Support of rcw for T1042RDB in u-boot

2014-07-23 Thread Vijay Rai
This patch adds support of rcw for T1042RDB, it makes following changes :
- Adds t1042_rcw.cfg file for serdes protocol 0x86 for T1042RDB
- Renames t1042_pi_rcw.cfg file from t1042_rcw.cfg and also updates
  comments for valid serdes protocol which is 0x06
- Also updates CONFIG_SYS_FSL_PBL_RCW for T1042RDB

Signed-off-by: Vijay Rai vijay@freescale.com
Signed-off-by: Priyanka Jain priyanka.j...@freescale.com
---
 board/freescale/t104xrdb/t1042_pi_rcw.cfg |7 +++
 board/freescale/t104xrdb/t1042_rcw.cfg|8 
 include/configs/T104xRDB.h|3 +++
 3 files changed, 14 insertions(+), 4 deletions(-)
 create mode 100644 board/freescale/t104xrdb/t1042_pi_rcw.cfg

diff --git a/board/freescale/t104xrdb/t1042_pi_rcw.cfg 
b/board/freescale/t104xrdb/t1042_pi_rcw.cfg
new file mode 100644
index 000..57de89a
--- /dev/null
+++ b/board/freescale/t104xrdb/t1042_pi_rcw.cfg
@@ -0,0 +1,7 @@
+#PBL preamble and RCW header
+aa55aa55 010e0100
+# serdes protocol 0x06
+0c18000e 0e00  
+0602 0042 e8106000 0100
+   00030810
+ 01fe0a06  
diff --git a/board/freescale/t104xrdb/t1042_rcw.cfg 
b/board/freescale/t104xrdb/t1042_rcw.cfg
index a3ea8ad..db4d52f 100644
--- a/board/freescale/t104xrdb/t1042_rcw.cfg
+++ b/board/freescale/t104xrdb/t1042_rcw.cfg
@@ -1,7 +1,7 @@
 #PBL preamble and RCW header
 aa55aa55 010e0100
-# serdes protocol 0x66
+# serdes protocol 0x86
 0c18000e 0e00  
-0602 0042 e8106000 0100
-   00030810
- 01fe0a06  
+8602 8002 ec027000 0100
+   00032810
+ 0342500f  
diff --git a/include/configs/T104xRDB.h b/include/configs/T104xRDB.h
index 1e6c79a..eeac104 100644
--- a/include/configs/T104xRDB.h
+++ b/include/configs/T104xRDB.h
@@ -19,6 +19,9 @@
 #define CONFIG_SYS_FSL_PBL_RCW 
$(SRCTREE)/board/freescale/t104xrdb/t1040_rcw.cfg
 #endif
 #ifdef CONFIG_T1042RDB_PI
+#define CONFIG_SYS_FSL_PBL_RCW 
$(SRCTREE)/board/freescale/t104xrdb/t1042_pi_rcw.cfg
+#endif
+#ifdef CONFIG_T1042RDB
 #define CONFIG_SYS_FSL_PBL_RCW 
$(SRCTREE)/board/freescale/t104xrdb/t1042_rcw.cfg
 #endif
 
-- 
1.7.9.5

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


Re: [U-Boot] [PATCH v3 0/9] Add a pre-relocation malloc() implementation

2014-07-23 Thread Simon Glass
Hi,

On 14 July 2014 18:16, Simon Glass s...@chromium.org wrote:
 Hi Tom,

 On 14 July 2014 16:28, Tom Rini tr...@ti.com wrote:

 On Thu, Jul 10, 2014 at 10:23:24PM -0600, Simon Glass wrote:

  There has been talk on and off of a pre-relocation malloc() implementation.
  Driver model needs this so that it can work before relocation.
 
  A previous implementation was sent in a v1 series.
 
  This implementation works by allocating space on the stack. The benefit is
  that boards do not need to specify the address of the malloc() area, only
  the size. The down-side is that due to the way board_init_f() is called,
  architecture-specific code needs to be used to allocate the space.
 
  No clever algorithms are used to allocate space, free() is a nop and
  realloc() is not supported. This fits well with the desire to avoid wasting
  space on bucket tables and the hassle of supporting BSS data before
  relocation. We don't expect 'churn' in the pre-relocation case - we just
  want to allocate small amounts of memory temporarily.
 
  After relocation a new malloc() pool is created and the old one is lost,
  although pointers into it will survive the immediate process of relocation.
 
  Implementations are provided for sandbox and arm (32-bit only).
 
  A related change is made to the early init for each arch to make this work.

 My concern without a fix right now is how to make use of this in SPL,
 when we're able to move SPL over to using still more generic code rather
 than re-inventing the board_init_{f,r} wheels, in the case where we init
 DRAM.

 One option would be to split this new code out into a separate file,
 and have two malloc() implementations:

 - big one - falls back to small one pre-relocation
 - small one - used for SPL

I'm thinking of applying this to the dm repo now, except for the arm
patches where I would like to get Albert's ack (so I'll wait a few
more days).

Any objections?

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


Re: [U-Boot] ODROID dynamic memory initialization

2014-07-23 Thread Daniel Drake
On Tue, Jul 22, 2014 at 2:08 PM, Daniel Drake dr...@endlessm.com wrote:
 While looking at the old uboot from hardkernel, I'm curious about
 CONFIG_CLK_BUS_DMC_220_440, which is set by default. This appears to
 run the memory at a high speed, by writing certain registers in the
 Dynamic Memory Controller (e.g. TIMINGROW), and clocking MPLL to
 880MHz.

 Your uboot patches don't seem to touch DMC regs like TIMINGROW, and
 also clock the MPLL at 800MHz.

I looked in more detail, and now understand better the SPL vs uboot division.

The vendor code I was referring to above is SPL code.

Since we are still using the same SPL as before, it means that MPLL
and memory is already set up by the time the real/new uboot loads.

So I think there should be no need to modify MPLL, and I wonder if
most of the other clock configuration code in your patches is also
unnecessary.

Thoughts?

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


[U-Boot] [PATCH] driver/qe: update status of QE microcode

2014-07-23 Thread Vijay Rai
This Patch updates error print for QE which should be easily understood

Signed-off-by: Vijay Rai vijay@freescale.com
---
 drivers/qe/qe.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/qe/qe.c b/drivers/qe/qe.c
index 9c5fbd1..df468d4 100644
--- a/drivers/qe/qe.c
+++ b/drivers/qe/qe.c
@@ -333,7 +333,7 @@ int qe_upload_firmware(const struct qe_firmware *firmware)
/* Check the magic */
if ((hdr-magic[0] != 'Q') || (hdr-magic[1] != 'E') ||
(hdr-magic[2] != 'F')) {
-   printf(Not a microcode\n);
+   printf(QE microcode not found\n);
 #ifdef CONFIG_DEEP_SLEEP
setbits_be32(gur-devdisr, MPC85xx_DEVDISR_QE_DISABLE);
 #endif
-- 
1.7.9.5

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


[U-Boot] [PATCH v3 0/29] Add additional core driver model features

2014-07-23 Thread Simon Glass
This series includes a number of base driver model enhancements, mostly
targeted at pre-relocation and to enable buses to be easily implemented.

With the device tree, child nodes for buses can now be scanned to create
child devices, and bus-related information about each child can be
stored. Children can be numbered as a core driver model feature in U-Boot
(e.g. SPI bus 0 chip select 3).

Driver model now supports operation prior to relocation, assuming a
suitable malloc() implementation is available.

Several changes are added to permit driver model to be available early
after relocation, since we are unable to access any device until driver
model is ready.

This series is available at u-boot-dm.git branch 'working'.

Changes in v3:
- Change pre-reloc fdt property to 'u-boot,dm-pre-reloc'

Changes in v2:
- Expand series to include all driver-model-required changes
- Improve wording in commit message
- Minor reword to comment for dm_init_and_scan()
- Reformat commit message slightly
- Remove change to board/rbc823/kbd.c, since it has been deleted
- Remove changes to deleted board/netphone/phone_console.c board/rbc823/kbd.c
- Rename struct device to struct udevice
- Return -ENODEV instead of -1 on error
- Update test output in doc/driver-model/README.txt

Simon Glass (29):
  dm: gpio: Don't use the driver model uclass for SPL
  dm: Use an explicit expect value in core tests
  stdio: Remove redundant code around stdio_register() calls
  stdio: Pass device pointer to stdio methods
  dm: Make sure that the root device is probed
  dm: Provide a way to shut down driver model
  sandbox: Remove all drivers before exit
  dm: Allow drivers to be marked 'before relocation'
  dm: Support driver model prior to relocation
  stdio: Provide functions to add/remove devices using stdio_dev
  console: Remove vprintf() optimisation for sandbox
  Add a flag indicating when the serial console is ready
  dm: Move uclass error checking/probing into a function
  fdt: Add a function to get the alias sequence of a node
  dm: Move device display into its own function
  dm: Avoid activating devices in 'dm uclass' command
  dm: Introduce device sequence numbering
  dm: Display the sequence number for each device
  dm: Allow a device to be found by its FDT offset
  dm: Avoid accessing uclasses before they are ready
  fdt: Add a function to get the node offset of an alias
  dm: Tidy up some header file comments
  dm: Provide a function to scan child FDT nodes
  dm: Add functions to access a device's children
  dm: Introduce per-child data for devices
  dm: Add child_pre_probe() and child_post_remove() methods
  dm: Improve errors and warnings in lists_bind_fdt()
  dm: Add dm_scan_other() to locate board-specific devices
  dm: Give the demo uclass a name

 arch/blackfin/cpu/jtag-console.c  |  10 +-
 arch/powerpc/cpu/mpc512x/serial.c |  10 +-
 arch/powerpc/cpu/mpc8xx/video.c   |   6 +-
 arch/sandbox/cpu/cpu.c|   4 +
 arch/x86/lib/video.c  |   8 +-
 board/bf527-ezkit/video.c |  10 --
 board/bf548-ezkit/video.c |  10 --
 board/cm-bf548/video.c|  10 --
 board/mpl/common/kbd.c|   6 +-
 board/mpl/common/kbd.h|   6 +-
 board/mpl/pati/pati.c |   8 +-
 board/nokia/rx51/rx51.c   |   6 +-
 common/board_f.c  |  16 +++
 common/board_r.c  |  25 +---
 common/cmd_log.c  |  11 +-
 common/console.c  |  24 ++--
 common/lcd.c  |  14 ++-
 common/stdio.c|  66 ---
 common/usb_kbd.c  |   6 +-
 doc/driver-model/README.txt   | 216 +++---
 drivers/core/device.c | 169 +-
 drivers/core/lists.c  |  22 +++-
 drivers/core/root.c   |  79 ++---
 drivers/core/uclass.c | 135 -
 drivers/demo/demo-uclass.c|   1 +
 drivers/gpio/Makefile |   2 +
 drivers/input/cros_ec_keyb.c  |   6 +-
 drivers/input/i8042.c |   4 +-
 drivers/input/keyboard.c  |   6 +-
 drivers/input/tegra-kbc.c |   6 +-
 drivers/misc/cbmem_console.c  |   6 +-
 drivers/net/netconsole.c  |  10 +-
 drivers/serial/serial.c   |  55 -
 drivers/serial/usbtty.c   |   8 +-
 drivers/video/cfb_console.c   |   8 +-
 include/asm-generic/global_data.h |   4 +-
 include/common.h  |   5 +
 include/configs/ELPPC.h   |   4 +-
 include/configs/MHPC.h|   4 +-
 include/configs/jadecpu.h |   4 +-
 include/configs/nokia_rx51.h  |   5 +-
 include/dm/device-internal.h  |   6 +-
 include/dm/device.h   | 120 ++-
 include/dm/lists.h|   2 +-
 include/dm/platdata.h |  10 +-
 include/dm/root.h |  61 +-
 include/dm/test.h |  22 
 include/dm/uclass-id.h 

[U-Boot] [PATCH v3 27/29] dm: Improve errors and warnings in lists_bind_fdt()

2014-07-23 Thread Simon Glass
Add a debug message for when a device tree node has no driver. Also reword
the warning when a device fails to bind, which was misleading.

Signed-off-by: Simon Glass s...@chromium.org
---

Changes in v3: None
Changes in v2: None

 drivers/core/lists.c | 16 +---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/drivers/core/lists.c b/drivers/core/lists.c
index a8d3aa1..8c0a548 100644
--- a/drivers/core/lists.c
+++ b/drivers/core/lists.c
@@ -123,16 +123,19 @@ int lists_bind_fdt(struct udevice *parent, const void 
*blob, int offset)
const int n_ents = ll_entry_count(struct driver, driver);
struct driver *entry;
struct udevice *dev;
+   bool found = false;
const char *name;
int result = 0;
-   int ret;
+   int ret = 0;
 
dm_dbg(bind node %s\n, fdt_get_name(blob, offset, NULL));
for (entry = driver; entry != driver + n_ents; entry++) {
ret = driver_check_compatible(blob, offset, entry-of_match);
+   name = fdt_get_name(blob, offset, NULL);
if (ret == -ENOENT) {
continue;
} else if (ret == -ENODEV) {
+   dm_dbg(Device '%s' has no compatible string\n, name);
break;
} else if (ret) {
dm_warn(Device tree error at offset %d\n, offset);
@@ -141,14 +144,21 @@ int lists_bind_fdt(struct udevice *parent, const void 
*blob, int offset)
break;
}
 
-   name = fdt_get_name(blob, offset, NULL);
dm_dbg(   - found match at '%s'\n, entry-name);
ret = device_bind(parent, entry, name, NULL, offset, dev);
if (ret) {
-   dm_warn(No match for driver '%s'\n, entry-name);
+   dm_warn(Error binding driver '%s'\n, entry-name);
if (!result || ret != -ENOENT)
result = ret;
+   } else {
+   found = true;
}
+   break;
+   }
+
+   if (!found  !result  ret != -ENODEV) {
+   dm_dbg(No match for node '%s'\n,
+  fdt_get_name(blob, offset, NULL));
}
 
return result;
-- 
2.0.0.526.g5318336

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


[U-Boot] [PATCH v3 13/29] dm: Move uclass error checking/probing into a function

2014-07-23 Thread Simon Glass
Several functions will use this same pattern, so bring it into a function.

Signed-off-by: Simon Glass s...@chromium.org
---

Changes in v3: None
Changes in v2: None

 drivers/core/uclass.c | 28 ++--
 1 file changed, 22 insertions(+), 6 deletions(-)

diff --git a/drivers/core/uclass.c b/drivers/core/uclass.c
index 34723ec..db91526 100644
--- a/drivers/core/uclass.c
+++ b/drivers/core/uclass.c
@@ -158,13 +158,19 @@ int uclass_find_device(enum uclass_id id, int index, 
struct udevice **devp)
return -ENODEV;
 }
 
-int uclass_get_device(enum uclass_id id, int index, struct udevice **devp)
+/**
+ * uclass_get_device_tail() - handle the end of a get_device call
+ *
+ * This handles returning an error or probing a device as needed.
+ *
+ * @dev: Device that needs to be probed
+ * @ret: Error to return. If non-zero then the device is not probed
+ * @devp: Returns the value of 'dev' if there is no error
+ * @return ret, if non-zero, else the result of the device_probe() call
+ */
+static int uclass_get_device_tail(struct udevice *dev, int ret,
+ struct udevice **devp)
 {
-   struct udevice *dev;
-   int ret;
-
-   *devp = NULL;
-   ret = uclass_find_device(id, index, dev);
if (ret)
return ret;
 
@@ -177,6 +183,16 @@ int uclass_get_device(enum uclass_id id, int index, struct 
udevice **devp)
return 0;
 }
 
+int uclass_get_device(enum uclass_id id, int index, struct udevice **devp)
+{
+   struct udevice *dev;
+   int ret;
+
+   *devp = NULL;
+   ret = uclass_find_device(id, index, dev);
+   return uclass_get_device_tail(dev, ret, devp);
+}
+
 int uclass_first_device(enum uclass_id id, struct udevice **devp)
 {
struct uclass *uc;
-- 
2.0.0.526.g5318336

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


[U-Boot] [PATCH v3 05/29] dm: Make sure that the root device is probed

2014-07-23 Thread Simon Glass
The root device should be probed just like any other device. The effect of
this is to mark the device as activated, so that it can be removed (along
with its children) if required.

Signed-off-by: Simon Glass s...@chromium.org
Acked-by: Marek Vasut ma...@denx.de
---

Changes in v3: None
Changes in v2: None

 drivers/core/root.c | 3 +++
 test/dm/core.c  | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/core/root.c b/drivers/core/root.c
index 1cbb096..bc76370 100644
--- a/drivers/core/root.c
+++ b/drivers/core/root.c
@@ -48,6 +48,9 @@ int dm_init(void)
ret = device_bind_by_name(NULL, root_info, DM_ROOT_NON_CONST);
if (ret)
return ret;
+   ret = device_probe(DM_ROOT_NON_CONST);
+   if (ret)
+   return ret;
 
return 0;
 }
diff --git a/test/dm/core.c b/test/dm/core.c
index be3646b..8c18780 100644
--- a/test/dm/core.c
+++ b/test/dm/core.c
@@ -106,7 +106,7 @@ static int dm_test_autoprobe(struct dm_test_state *dms)
ut_asserteq(0, dm_testdrv_op_count[DM_TEST_OP_POST_PROBE]);
 
/* The root device should not be activated until needed */
-   ut_assert(!(dms-root-flags  DM_FLAG_ACTIVATED));
+   ut_assert(dms-root-flags  DM_FLAG_ACTIVATED);
 
/*
 * We should be able to find the three test devices, and they should
-- 
2.0.0.526.g5318336

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


[U-Boot] [PATCH v3 06/29] dm: Provide a way to shut down driver model

2014-07-23 Thread Simon Glass
Add a new method which removes and unbinds all drivers.

Signed-off-by: Simon Glass s...@chromium.org
Acked-by: Marek Vasut ma...@denx.de
---

Changes in v3: None
Changes in v2: None

 drivers/core/root.c | 8 
 include/dm/root.h   | 8 
 2 files changed, 16 insertions(+)

diff --git a/drivers/core/root.c b/drivers/core/root.c
index bc76370..1fa24c4 100644
--- a/drivers/core/root.c
+++ b/drivers/core/root.c
@@ -55,6 +55,14 @@ int dm_init(void)
return 0;
 }
 
+int dm_uninit(void)
+{
+   device_remove(dm_root());
+   device_unbind(dm_root());
+
+   return 0;
+}
+
 int dm_scan_platdata(void)
 {
int ret;
diff --git a/include/dm/root.h b/include/dm/root.h
index a4826a6..35818b1 100644
--- a/include/dm/root.h
+++ b/include/dm/root.h
@@ -50,4 +50,12 @@ int dm_scan_fdt(const void *blob);
  */
 int dm_init(void);
 
+/**
+ * dm_uninit - Uninitialise Driver Model structures
+ *
+ * All devices will be removed and unbound
+ * @return 0 if OK, -ve on error
+ */
+int dm_uninit(void);
+
 #endif
-- 
2.0.0.526.g5318336

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


[U-Boot] [PATCH v3 10/29] stdio: Provide functions to add/remove devices using stdio_dev

2014-07-23 Thread Simon Glass
The current functions for adding and removing devices require a device name.
This is not convenient for driver model, which wants to store a pointer to
the relevant device. Add new functions which provide this feature and adjust
the old ones to call these.

Signed-off-by: Simon Glass s...@chromium.org
---

Changes in v3: None
Changes in v2:
- Return -ENODEV instead of -1 on error

 common/stdio.c  | 32 
 include/stdio_dev.h |  2 ++
 2 files changed, 26 insertions(+), 8 deletions(-)

diff --git a/common/stdio.c b/common/stdio.c
index dd402cc..692ca7f 100644
--- a/common/stdio.c
+++ b/common/stdio.c
@@ -11,6 +11,7 @@
 
 #include config.h
 #include common.h
+#include errno.h
 #include stdarg.h
 #include malloc.h
 #include stdio_dev.h
@@ -148,32 +149,35 @@ struct stdio_dev* stdio_clone(struct stdio_dev *dev)
return _dev;
 }
 
-int stdio_register (struct stdio_dev * dev)
+int stdio_register_dev(struct stdio_dev *dev, struct stdio_dev **devp)
 {
struct stdio_dev *_dev;
 
_dev = stdio_clone(dev);
if(!_dev)
-   return -1;
+   return -ENODEV;
list_add_tail((_dev-list), (devs.list));
+   if (devp)
+   *devp = _dev;
+
return 0;
 }
 
+int stdio_register(struct stdio_dev *dev)
+{
+   return stdio_register_dev(dev, NULL);
+}
+
 /* deregister the device devname.
  * returns 0 if success, -1 if device is assigned and 1 if devname not found
  */
 #ifdef CONFIG_SYS_STDIO_DEREGISTER
-int stdio_deregister(const char *devname)
+int stdio_deregister_dev(struct stdio_dev *dev)
 {
int l;
struct list_head *pos;
-   struct stdio_dev *dev;
char temp_names[3][16];
 
-   dev = stdio_get_by_name(devname);
-
-   if(!dev) /* device not found */
-   return -1;
/* get stdio devices (ListRemoveItem changes the dev list) */
for (l=0 ; l MAX_FILES; l++) {
if (stdio_devices[l] == dev) {
@@ -197,6 +201,18 @@ int stdio_deregister(const char *devname)
}
return 0;
 }
+
+int stdio_deregister(const char *devname)
+{
+   struct stdio_dev *dev;
+
+   dev = stdio_get_by_name(devname);
+
+   if (!dev) /* device not found */
+   return -ENODEV;
+
+   return stdio_deregister_dev(dev);
+}
 #endif /* CONFIG_SYS_STDIO_DEREGISTER */
 
 int stdio_init (void)
diff --git a/include/stdio_dev.h b/include/stdio_dev.h
index 4587005..a7d0825 100644
--- a/include/stdio_dev.h
+++ b/include/stdio_dev.h
@@ -77,10 +77,12 @@ extern char *stdio_names[MAX_FILES];
  * PROTOTYPES
  */
 intstdio_register (struct stdio_dev * dev);
+int stdio_register_dev(struct stdio_dev *dev, struct stdio_dev **devp);
 intstdio_init (void);
 void   stdio_print_current_devices(void);
 #ifdef CONFIG_SYS_STDIO_DEREGISTER
 intstdio_deregister(const char *devname);
+int stdio_deregister_dev(struct stdio_dev *dev);
 #endif
 struct list_head* stdio_get_list(void);
 struct stdio_dev* stdio_get_by_name(const char* name);
-- 
2.0.0.526.g5318336

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


[U-Boot] [PATCH v3 07/29] sandbox: Remove all drivers before exit

2014-07-23 Thread Simon Glass
Drivers are supposed to be able to close down cleanly. To set a good example,
make sandbox shut down its driver model drivers and remove them before exit.

It may be desirable to do the same more generally once driver model is more
widely-used. This could be done during bootm, before U-Boot jumps to the OS.
It seems far too early to make this change.

Signed-off-by: Simon Glass s...@chromium.org
---

Changes in v3: None
Changes in v2: None

 arch/sandbox/cpu/cpu.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/arch/sandbox/cpu/cpu.c b/arch/sandbox/cpu/cpu.c
index 3f4005b..1aa397c 100644
--- a/arch/sandbox/cpu/cpu.c
+++ b/arch/sandbox/cpu/cpu.c
@@ -4,6 +4,7 @@
  */
 
 #include common.h
+#include dm/root.h
 #include os.h
 #include asm/state.h
 
@@ -14,6 +15,9 @@ void reset_cpu(ulong ignored)
if (state_uninit())
os_exit(2);
 
+   if (dm_uninit())
+   os_exit(2);
+
/* This is considered normal termination for now */
os_exit(0);
 }
-- 
2.0.0.526.g5318336

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


[U-Boot] [PATCH v3 12/29] Add a flag indicating when the serial console is ready

2014-07-23 Thread Simon Glass
For sandbox we have a fallback console which is used very early in
U-Boot, before serial drivers are available. Rather than try to guess
when to switch to the real console, add a flag so we can be sure. This
makes sure that sandbox can always output a panic() message, for example,
and avoids silent failure (which is very annoying in sandbox).

Signed-off-by: Simon Glass s...@chromium.org
---

Changes in v3: None
Changes in v2:
- Improve wording in commit message

 common/console.c  | 4 ++--
 drivers/serial/serial.c   | 1 +
 include/asm-generic/global_data.h | 1 +
 3 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/common/console.c b/common/console.c
index 5576dfd..898da39 100644
--- a/common/console.c
+++ b/common/console.c
@@ -417,7 +417,7 @@ static inline void print_pre_console_buffer(void) {}
 void putc(const char c)
 {
 #ifdef CONFIG_SANDBOX
-   if (!gd) {
+   if (!gd || !(gd-flags  GD_FLG_SERIAL_READY)) {
os_putc(c);
return;
}
@@ -447,7 +447,7 @@ void putc(const char c)
 void puts(const char *s)
 {
 #ifdef CONFIG_SANDBOX
-   if (!gd) {
+   if (!gd || !(gd-flags  GD_FLG_SERIAL_READY)) {
os_puts(s);
return;
}
diff --git a/drivers/serial/serial.c b/drivers/serial/serial.c
index 803d850..d2eb752 100644
--- a/drivers/serial/serial.c
+++ b/drivers/serial/serial.c
@@ -418,6 +418,7 @@ static struct serial_device *get_current(void)
  */
 int serial_init(void)
 {
+   gd-flags |= GD_FLG_SERIAL_READY;
return get_current()-start();
 }
 
diff --git a/include/asm-generic/global_data.h 
b/include/asm-generic/global_data.h
index edde9d7..74df210 100644
--- a/include/asm-generic/global_data.h
+++ b/include/asm-generic/global_data.h
@@ -106,5 +106,6 @@ typedef struct global_data {
 #define GD_FLG_LOGINIT 0x00020 /* Log Buffer has been initialized */
 #define GD_FLG_DISABLE_CONSOLE 0x00040 /* Disable console (in  out)  */
 #define GD_FLG_ENV_READY   0x00080 /* Env. imported into hash table   */
+#define GD_FLG_SERIAL_READY0x00100 /* Pre-reloc serial console ready  */
 
 #endif /* __ASM_GENERIC_GBL_DATA_H */
-- 
2.0.0.526.g5318336

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


[U-Boot] [PATCH v3 09/29] dm: Support driver model prior to relocation

2014-07-23 Thread Simon Glass
Initialise devices marked 'pre-reloc' and make them available prior to
relocation. Note that this requires pre-reloc malloc() to be available.

Signed-off-by: Simon Glass s...@chromium.org
---

Changes in v3: None
Changes in v2:
- Minor reword to comment for dm_init_and_scan()

 common/board_f.c  | 16 
 common/board_r.c  | 25 -
 drivers/core/root.c   | 25 +
 include/asm-generic/global_data.h |  3 ++-
 include/dm/root.h | 13 +
 5 files changed, 60 insertions(+), 22 deletions(-)

diff --git a/common/board_f.c b/common/board_f.c
index b5e2031..8782c43 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -14,6 +14,7 @@
 #include linux/compiler.h
 #include version.h
 #include environment.h
+#include dm.h
 #include fdtdec.h
 #include fs.h
 #if defined(CONFIG_CMD_IDE)
@@ -52,6 +53,7 @@
 #ifdef CONFIG_SANDBOX
 #include asm/state.h
 #endif
+#include dm/root.h
 #include linux/compiler.h
 
 /*
@@ -787,6 +789,19 @@ static int initf_malloc(void)
return 0;
 }
 
+static int initf_dm(void)
+{
+#if defined(CONFIG_DM)  defined(CONFIG_SYS_MALLOC_F_LEN)
+   int ret;
+
+   ret = dm_init_and_scan(true);
+   if (ret)
+   return ret;
+#endif
+
+   return 0;
+}
+
 static init_fnc_t init_sequence_f[] = {
 #ifdef CONFIG_SANDBOX
setup_ram_buf,
@@ -845,6 +860,7 @@ static init_fnc_t init_sequence_f[] = {
init_timebase,
 #endif
initf_malloc,
+   initf_dm,
init_baud_rate, /* initialze baudrate settings */
serial_init,/* serial communications setup */
console_init_f, /* stage 1 init of console */
diff --git a/common/board_r.c b/common/board_r.c
index e43a318..a35ffa5 100644
--- a/common/board_r.c
+++ b/common/board_r.c
@@ -273,27 +273,10 @@ static int initr_malloc(void)
 #ifdef CONFIG_DM
 static int initr_dm(void)
 {
-   int ret;
-
-   ret = dm_init();
-   if (ret) {
-   debug(dm_init() failed: %d\n, ret);
-   return ret;
-   }
-   ret = dm_scan_platdata(false);
-   if (ret) {
-   debug(dm_scan_platdata() failed: %d\n, ret);
-   return ret;
-   }
-#ifdef CONFIG_OF_CONTROL
-   ret = dm_scan_fdt(gd-fdt_blob, false);
-   if (ret) {
-   debug(dm_scan_fdt() failed: %d\n, ret);
-   return ret;
-   }
-#endif
-
-   return 0;
+   /* Save the pre-reloc driver model and start a new one */
+   gd-dm_root_f = gd-dm_root;
+   gd-dm_root = NULL;
+   return dm_init_and_scan(false);
 }
 #endif
 
diff --git a/drivers/core/root.c b/drivers/core/root.c
index b76c10d..c37d666 100644
--- a/drivers/core/root.c
+++ b/drivers/core/root.c
@@ -104,6 +104,31 @@ int dm_scan_fdt(const void *blob, bool pre_reloc_only)
 }
 #endif
 
+int dm_init_and_scan(bool pre_reloc_only)
+{
+   int ret;
+
+   ret = dm_init();
+   if (ret) {
+   debug(dm_init() failed: %d\n, ret);
+   return ret;
+   }
+   ret = dm_scan_platdata(pre_reloc_only);
+   if (ret) {
+   debug(dm_scan_platdata() failed: %d\n, ret);
+   return ret;
+   }
+#ifdef CONFIG_OF_CONTROL
+   ret = dm_scan_fdt(gd-fdt_blob, pre_reloc_only);
+   if (ret) {
+   debug(dm_scan_fdt() failed: %d\n, ret);
+   return ret;
+   }
+#endif
+
+   return 0;
+}
+
 /* This is the root driver - all drivers are children of this */
 U_BOOT_DRIVER(root_driver) = {
.name   = root_driver,
diff --git a/include/asm-generic/global_data.h 
b/include/asm-generic/global_data.h
index f6a2a20..edde9d7 100644
--- a/include/asm-generic/global_data.h
+++ b/include/asm-generic/global_data.h
@@ -65,7 +65,8 @@ typedef struct global_data {
struct global_data *new_gd; /* relocated global data */
 
 #ifdef CONFIG_DM
-   struct udevice  *dm_root;/* Root instance for Driver Model */
+   struct udevice  *dm_root;   /* Root instance for Driver Model */
+   struct udevice  *dm_root_f; /* Pre-relocation root instance */
struct list_head uclass_root;   /* Head of core tree */
 #endif
 
diff --git a/include/dm/root.h b/include/dm/root.h
index d37b452..09f9303 100644
--- a/include/dm/root.h
+++ b/include/dm/root.h
@@ -45,6 +45,19 @@ int dm_scan_platdata(bool pre_reloc_only);
 int dm_scan_fdt(const void *blob, bool pre_reloc_only);
 
 /**
+ * dm_init_and_scan() - Initialise Driver Model structures and scan for devices
+ *
+ * This function initialises the roots of the driver tree and uclass trees,
+ * then scans and binds available devices from platform data and the FDT.
+ * This calls dm_init() to set up Driver Model structures.
+ *
+ * @pre_reloc_only: If true, bind only drivers with the DM_FLAG_PRE_RELOC
+ * flag. If false bind all drivers.
+ * @return 0 if OK, -ve on error
+ */
+int dm_init_and_scan(bool pre_reloc_only);

[U-Boot] [PATCH v3 01/29] dm: gpio: Don't use the driver model uclass for SPL

2014-07-23 Thread Simon Glass
Driver model does not support SPL yet, so we should not use the GPIO
uclass for SPL.

Signed-off-by: Simon Glass s...@chromium.org
---

Changes in v3: None
Changes in v2: None

 drivers/gpio/Makefile | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpio/Makefile b/drivers/gpio/Makefile
index 4e001e1..fb8dcd9 100644
--- a/drivers/gpio/Makefile
+++ b/drivers/gpio/Makefile
@@ -5,7 +5,9 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
+ifndef CONFIG_SPL_BUILD
 obj-$(CONFIG_DM_GPIO)  += gpio-uclass.o
+endif
 
 obj-$(CONFIG_AT91_GPIO)+= at91_gpio.o
 obj-$(CONFIG_INTEL_ICH6_GPIO)  += intel_ich6_gpio.o
-- 
2.0.0.526.g5318336

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


[U-Boot] [PATCH v3 02/29] dm: Use an explicit expect value in core tests

2014-07-23 Thread Simon Glass
Rather than reusing the 'reg' property, use an explicit property for the
expected ping value used in testing.

Signed-off-by: Simon Glass s...@chromium.org
---

Changes in v3: None
Changes in v2: None

 test/dm/test-fdt.c | 13 -
 test/dm/test.dts   |  5 -
 2 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/test/dm/test-fdt.c b/test/dm/test-fdt.c
index 98e3936..0f50537 100644
--- a/test/dm/test-fdt.c
+++ b/test/dm/test-fdt.c
@@ -39,7 +39,8 @@ static int testfdt_ofdata_to_platdata(struct udevice *dev)
 
pdata-ping_add = fdtdec_get_int(gd-fdt_blob, dev-of_offset,
ping-add, -1);
-   pdata-base = fdtdec_get_addr(gd-fdt_blob, dev-of_offset, reg);
+   pdata-base = fdtdec_get_addr(gd-fdt_blob, dev-of_offset,
+ ping-expect);
 
return 0;
 }
@@ -127,11 +128,13 @@ static int dm_test_fdt(struct dm_test_state *dms)
ut_assert(!ret);
 
/*
-* Get the 'reg' property, which tells us what the ping add
-* should be. We don't use the platdata because we want
-* to test the code that sets that up (testfdt_drv_probe()).
+* Get the 'ping-expect' property, which tells us what the
+* ping add should be. We don't use the platdata because we
+* want to test the code that sets that up
+* (testfdt_drv_probe()).
 */
-   base = fdtdec_get_addr(gd-fdt_blob, dev-of_offset, reg);
+   base = fdtdec_get_addr(gd-fdt_blob, dev-of_offset,
+  ping-expect);
debug(dev=%d, base=%d: %s\n, i, base,
  fdt_get_name(gd-fdt_blob, dev-of_offset, NULL));
 
diff --git a/test/dm/test.dts b/test/dm/test.dts
index ec5364f..74d236b 100644
--- a/test/dm/test.dts
+++ b/test/dm/test.dts
@@ -9,6 +9,7 @@
a-test {
reg = 0;
compatible = denx,u-boot-fdt-test;
+   ping-expect = 0;
ping-add = 0;
};
 
@@ -24,13 +25,14 @@
b-test {
reg = 3;
compatible = denx,u-boot-fdt-test;
+   ping-expect = 3;
ping-add = 3;
};
 
some-bus {
#address-cells = 1;
#size-cells = 0;
-   reg = 4;
+   ping-expect = 4;
ping-add = 4;
c-test {
compatible = denx,u-boot-fdt-test;
@@ -41,6 +43,7 @@
 
d-test {
reg = 6;
+   ping-expect = 6;
ping-add = 6;
compatible = google,another-fdt-test;
};
-- 
2.0.0.526.g5318336

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


[U-Boot] [PATCH v3 28/29] dm: Add dm_scan_other() to locate board-specific devices

2014-07-23 Thread Simon Glass
Some boards will have devices which are not in the device tree and do not
have platform data. They may be programnatically created, for example.
Add a hook which boards can use to bind those devices early in boot.

Signed-off-by: Simon Glass s...@chromium.org
---

Changes in v3: None
Changes in v2: None

 drivers/core/root.c |  8 
 include/dm/root.h   | 13 +
 2 files changed, 21 insertions(+)

diff --git a/drivers/core/root.c b/drivers/core/root.c
index 4f9c7e7..393dd98 100644
--- a/drivers/core/root.c
+++ b/drivers/core/root.c
@@ -108,6 +108,11 @@ int dm_scan_fdt(const void *blob, bool pre_reloc_only)
 }
 #endif
 
+__weak int dm_scan_other(bool pre_reloc_only)
+{
+   return 0;
+}
+
 int dm_init_and_scan(bool pre_reloc_only)
 {
int ret;
@@ -129,6 +134,9 @@ int dm_init_and_scan(bool pre_reloc_only)
return ret;
}
 #endif
+   ret = dm_scan_other(pre_reloc_only);
+   if (ret)
+   return ret;
 
return 0;
 }
diff --git a/include/dm/root.h b/include/dm/root.h
index 33f951b..c7f0c1d 100644
--- a/include/dm/root.h
+++ b/include/dm/root.h
@@ -62,6 +62,19 @@ int dm_scan_fdt_node(struct udevice *parent, const void 
*blob, int offset,
 bool pre_reloc_only);
 
 /**
+ * dm_scan_other() - Scan for other devices
+ *
+ * Some devices may not be visible to Driver Model. This weak function can
+ * be provided by boards which wish to create their own devices
+ * programmaticaly. They should do this by calling device_bind() on each
+ * device.
+ *
+ * @pre_reloc_only: If true, bind only drivers with the DM_FLAG_PRE_RELOC
+ * flag. If false bind all drivers.
+ */
+int dm_scan_other(bool pre_reloc_only);
+
+/**
  * dm_init_and_scan() - Initialise Driver Model structures and scan for devices
  *
  * This function initialises the roots of the driver tree and uclass trees,
-- 
2.0.0.526.g5318336

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


[U-Boot] [PATCH v3 08/29] dm: Allow drivers to be marked 'before relocation'

2014-07-23 Thread Simon Glass
Driver model currently only operates after relocation is complete. In this
state U-Boot typically has a small amount of memory available. In adding
support for driver model prior to relocation we must try to use as little
memory as possible.

In addition, on some machines the memory has not be inited and/or the CPU
is not running at full speed or the data cache is off. These can reduce
execution performance, so the less initialisation that is done before
relocation the better.

An immediately-obvious improvement is to only initialise drivers which are
actually going to be used before relocation. On many boards the only such
driver is a serial UART, so this provides a very large potential benefit.

Allow drivers to mark themselves as 'pre-reloc' which means that they will
be initialised prior to relocation. This can be done either with a driver
flag or with a 'dm,pre-reloc' device tree property.

To support this, the various dm scanning function now take a 'pre_reloc_only'
parameter which indicates that only drivers marked pre-reloc should be
bound.

Signed-off-by: Simon Glass s...@chromium.org
---

Changes in v3:
- Change pre-reloc fdt property to 'u-boot,dm-pre-reloc'

Changes in v2:
- Rename struct device to struct udevice
- Update test output in doc/driver-model/README.txt

 common/board_r.c |  4 ++--
 doc/driver-model/README.txt  | 31 +---
 drivers/core/device.c|  6 --
 drivers/core/lists.c |  6 +++---
 drivers/core/root.c  | 11 ++
 include/dm/device-internal.h |  6 --
 include/dm/device.h  |  5 +
 include/dm/lists.h   |  2 +-
 include/dm/root.h|  8 ++--
 test/dm/core.c   | 48 +++-
 test/dm/test-driver.c| 11 ++
 test/dm/test-fdt.c   | 20 +-
 test/dm/test-main.c  |  4 ++--
 test/dm/test.dts | 10 +
 14 files changed, 131 insertions(+), 41 deletions(-)

diff --git a/common/board_r.c b/common/board_r.c
index 86424a0..e43a318 100644
--- a/common/board_r.c
+++ b/common/board_r.c
@@ -280,13 +280,13 @@ static int initr_dm(void)
debug(dm_init() failed: %d\n, ret);
return ret;
}
-   ret = dm_scan_platdata();
+   ret = dm_scan_platdata(false);
if (ret) {
debug(dm_scan_platdata() failed: %d\n, ret);
return ret;
}
 #ifdef CONFIG_OF_CONTROL
-   ret = dm_scan_fdt(gd-fdt_blob);
+   ret = dm_scan_fdt(gd-fdt_blob, false);
if (ret) {
debug(dm_scan_fdt() failed: %d\n, ret);
return ret;
diff --git a/doc/driver-model/README.txt b/doc/driver-model/README.txt
index 22c3fcb..907ff67 100644
--- a/doc/driver-model/README.txt
+++ b/doc/driver-model/README.txt
@@ -95,26 +95,24 @@ are provided in test/dm. To run them, try:
 You should see something like this:
 
 ...U-Boot banner...
-Running 12 driver model tests
+Running 14 driver model tests
 Test: dm_test_autobind
 Test: dm_test_autoprobe
 Test: dm_test_children
 Test: dm_test_fdt
+Test: dm_test_fdt_pre_reloc
 Test: dm_test_gpio
 sandbox_gpio: sb_gpio_get_value: error: offset 4 not reserved
 Test: dm_test_leak
-Warning: Please add '#define DEBUG' to the top of common/dlmalloc.c
-Warning: Please add '#define DEBUG' to the top of common/dlmalloc.c
 Test: dm_test_lifecycle
 Test: dm_test_operations
 Test: dm_test_ordering
 Test: dm_test_platdata
+Test: dm_test_pre_reloc
 Test: dm_test_remove
 Test: dm_test_uclass
 Failures: 0
 
-(You can add '#define DEBUG' as suggested to check for memory leaks)
-
 
 What is going on?
 -
@@ -538,26 +536,35 @@ dealing with this might not be worth it.
 - Implemented a GPIO system, trying to keep it simple
 
 
+Pre-Relocation Support
+--
+
+For pre-relocation we simply call the driver model init function. Only
+drivers marked with DM_FLAG_PRE_RELOC or the device tree
+'u-boot,dm-pre-reloc' flag are initialised prior to relocation. This helps
+to reduce the driver model overhead.
+
+Then post relocation we throw that away and re-init driver model again.
+For drivers which require some sort of continuity between pre- and
+post-relocation devices, we can provide access to the pre-relocation
+device pointers, but this is not currently implemented (the root device
+pointer is saved but not made available through the driver model API).
+
+
 Things to punt for later
 
 
 - SPL support - this will have to be present before many drivers can be
 converted, but it seems like we can add it once we are happy with the
 core implementation.
-- Pre-relocation support - similar story
 
-That is not to say that no thinking has gone into these - in fact there
+That is not to say that no thinking has gone into this - in fact there
 is quite a lot there. 

[U-Boot] [PATCH v3 04/29] stdio: Pass device pointer to stdio methods

2014-07-23 Thread Simon Glass
At present stdio device functions do not get any clue as to which stdio
device is being acted on. Some implementations go to great lengths to work
around this, such as defining a whole separate set of functions for each
possible device.

For driver model we need to associate a stdio_dev with a device. It doesn't
seem possible to continue with this work-around approach.

Instead, add a stdio_dev pointer to each of the stdio member functions.

Note: The serial drivers have the same problem, but it is not strictly
necessary to fix that to get driver model running. Also, if we convert
serial over to driver model the problem will go away.

Code size increases by 244 bytes for Thumb2 and 428 for PowerPC.

22: stdio: Pass device pointer to stdio methods
   arm: (for 2/2 boards)  all +244.0  bss -4.0  text +248.0
   powerpc: (for 1/1 boards)  all +428.0  text +428.0

Signed-off-by: Simon Glass s...@chromium.org
Acked-by: Marek Vasut ma...@denx.de
Reviewed-by: Marek Vasut ma...@denx.de
---

Changes in v3: None
Changes in v2:
- Remove changes to deleted board/netphone/phone_console.c board/rbc823/kbd.c

 arch/blackfin/cpu/jtag-console.c  | 10 
 arch/powerpc/cpu/mpc512x/serial.c | 10 
 arch/powerpc/cpu/mpc8xx/video.c   |  6 ++---
 arch/x86/lib/video.c  |  4 +--
 board/mpl/common/kbd.c|  4 +--
 board/mpl/common/kbd.h|  6 +++--
 board/mpl/pati/pati.c |  8 +++---
 board/nokia/rx51/rx51.c   |  6 ++---
 common/cmd_log.c  | 11 
 common/console.c  | 18 ++---
 common/lcd.c  | 14 --
 common/stdio.c| 34 +++-
 common/usb_kbd.c  |  4 +--
 drivers/input/cros_ec_keyb.c  |  6 ++---
 drivers/input/i8042.c |  4 +--
 drivers/input/keyboard.c  |  4 +--
 drivers/input/tegra-kbc.c |  6 ++---
 drivers/misc/cbmem_console.c  |  6 ++---
 drivers/net/netconsole.c  | 10 
 drivers/serial/serial.c   | 54 ++-
 drivers/serial/usbtty.c   |  8 +++---
 drivers/video/cfb_console.c   |  6 ++---
 include/common.h  |  5 
 include/configs/ELPPC.h   |  4 +--
 include/configs/MHPC.h|  4 +--
 include/configs/jadecpu.h |  4 +--
 include/configs/nokia_rx51.h  |  5 ++--
 include/i8042.h   |  6 +++--
 include/stdio_dev.h   | 15 ++-
 include/video.h   |  8 +++---
 30 files changed, 189 insertions(+), 101 deletions(-)

diff --git a/arch/blackfin/cpu/jtag-console.c b/arch/blackfin/cpu/jtag-console.c
index 7cddb85..b8be318 100644
--- a/arch/blackfin/cpu/jtag-console.c
+++ b/arch/blackfin/cpu/jtag-console.c
@@ -112,11 +112,11 @@ static void jtag_send(const char *raw_str, uint32_t len)
if (cooked_str != raw_str)
free((char *)cooked_str);
 }
-static void jtag_putc(const char c)
+static void jtag_putc(struct stdio_dev *dev, const char c)
 {
jtag_send(c, 1);
 }
-static void jtag_puts(const char *s)
+static void jtag_puts(struct stdio_dev *dev, const char *s)
 {
jtag_send(s, strlen(s));
 }
@@ -133,7 +133,7 @@ static int jtag_tstc_dbg(void)
 }
 
 /* Higher layers want to know when any data is available */
-static int jtag_tstc(void)
+static int jtag_tstc(struct stdio_dev *dev)
 {
return jtag_tstc_dbg() || leftovers_len;
 }
@@ -142,7 +142,7 @@ static int jtag_tstc(void)
  * [32bit length][actual data]
  */
 static uint32_t leftovers;
-static int jtag_getc(void)
+static int jtag_getc(struct stdio_dev *dev)
 {
int ret;
uint32_t emudat;
@@ -173,7 +173,7 @@ static int jtag_getc(void)
leftovers = emudat;
}
 
-   return jtag_getc();
+   return jtag_getc(dev);
 }
 
 int drv_jtag_console_init(void)
diff --git a/arch/powerpc/cpu/mpc512x/serial.c 
b/arch/powerpc/cpu/mpc512x/serial.c
index 42e0dc9..4105a28 100644
--- a/arch/powerpc/cpu/mpc512x/serial.c
+++ b/arch/powerpc/cpu/mpc512x/serial.c
@@ -384,7 +384,7 @@ struct stdio_dev *open_port(int num, int baudrate)
sprintf(env_val, %d, baudrate);
setenv(env_var, env_val);
 
-   if (port-start())
+   if (port-start(port))
return NULL;
 
set_bit(num, initialized);
@@ -407,7 +407,7 @@ int close_port(int num)
if (!port)
return -1;
 
-   ret = port-stop();
+   ret = port-stop(port);
clear_bit(num, initialized);
 
return ret;
@@ -418,7 +418,7 @@ int write_port(struct stdio_dev *port, char *buf)
if (!port || !buf)
return -1;
 
-   port-puts(buf);
+   port-puts(port, buf);
 
return 0;
 }
@@ -433,8 +433,8 @@ int read_port(struct stdio_dev *port, char *buf, int size)
if (!size)
return 0;
 
-   while (port-tstc()) {
-   

[U-Boot] [PATCH v3 17/29] dm: Introduce device sequence numbering

2014-07-23 Thread Simon Glass
In U-Boot it is pretty common to number devices from 0 and access them
on the command line using this numbering. While it may come to pass that
we will move away from this numbering, the possibility seems remote at
present.

Given that devices within a uclass will have an implied numbering, it
makes sense to build this into driver model as a core feature. The cost
is fairly small in terms of code and data space.

With each uclass having numbered devices we can ask for SPI port 0 or
serial port 1 and receive a single device.

Devices typically request a sequence number using aliases in the device
tree. These are resolved when the device is probed, to deal with conflicts.
Sequence numbers need not be sequential and holes are permitted.

At present there is no support for sequence numbers using static platform
data. It could easily be added to 'struct driver_info' if needed, but it
seems better to add features as we find a use for them, and the use of -1
to mean 'no sequence' makes the default value somewhat painful.

Signed-off-by: Simon Glass s...@chromium.org
---

Changes in v3: None
Changes in v2: None

 doc/driver-model/README.txt  | 101 ---
 drivers/core/device.c|  28 
 drivers/core/uclass.c|  78 +
 include/dm/device.h  |  29 +
 include/dm/uclass-internal.h |  23 ++
 include/dm/uclass.h  |  31 +
 test/dm/test-fdt.c   |  54 ++-
 test/dm/test.dts |  11 -
 8 files changed, 347 insertions(+), 8 deletions(-)

diff --git a/doc/driver-model/README.txt b/doc/driver-model/README.txt
index 907ff67..84d21cf 100644
--- a/doc/driver-model/README.txt
+++ b/doc/driver-model/README.txt
@@ -95,12 +95,16 @@ are provided in test/dm. To run them, try:
 You should see something like this:
 
 ...U-Boot banner...
-Running 14 driver model tests
+Running 15 driver model tests
 Test: dm_test_autobind
 Test: dm_test_autoprobe
 Test: dm_test_children
 Test: dm_test_fdt
+Device 'd-test': seq 3 is in use by 'b-test'
 Test: dm_test_fdt_pre_reloc
+Test: dm_test_fdt_uclass_seq
+Device 'd-test': seq 3 is in use by 'b-test'
+Device 'a-test': seq 0 is in use by 'd-test'
 Test: dm_test_gpio
 sandbox_gpio: sb_gpio_get_value: error: offset 4 not reserved
 Test: dm_test_leak
@@ -339,6 +343,80 @@ numbering comes from include/dm/uclass.h. To add a new 
uclass, add to the
 end of the enum there, then declare your uclass as above.
 
 
+Device Sequence Numbers
+---
+
+U-Boot numbers devices from 0 in many situations, such as in the command
+line for I2C and SPI buses, and the device names for serial ports (serial0,
+serial1, ...). Driver model supports this numbering and permits devices
+to be locating by their 'sequence'.
+
+Sequence numbers start from 0 but gaps are permitted. For example, a board
+may have I2C buses 0, 1, 4, 5 but no 2 or 3. The choice of how devices are
+numbered is up to a particular board, and may be set by the SoC in some
+cases. While it might be tempting to automatically renumber the devices
+where there are gaps in the sequence, this can lead to confusion and is
+not the way that U-Boot works.
+
+Each device can request a sequence number. If none is required then the
+device will be automatically allocated the next available sequence number.
+
+To specify the sequence number in the device tree an alias is typically
+used.
+
+aliases {
+   serial2 = /serial@2223;
+};
+
+This indicates that in the uclass called serial, the named node
+(/serial@2223) will be given sequence number 2. Any command or driver
+which requests serial device 2 will obtain this device.
+
+Some devices represent buses where the devices on the bus are numbered or
+addressed. For example, SPI typically numbers its slaves from 0, and I2C
+uses a 7-bit address. In these cases the 'reg' property of the subnode is
+used, for example:
+
+{
+   aliases {
+   spi2 = /spi@2230;
+   };
+
+   spi@2230 {
+   #address-cells = 1;
+   #size-cells = 1;
+   spi-flash@0 {
+   reg = 0;
+   ...
+   }
+   eeprom@1 {
+   reg = 1;
+   };
+   };
+
+In this case we have a SPI bus with two slaves at 0 and 1. The SPI bus
+itself is numbered 2. So we might access the SPI flash with:
+
+   sf probe 2:0
+
+and the eeprom with
+
+   sspi 2:1 32 ef
+
+These commands simply need to look up the 2nd device in the SPI uclass to
+find the right SPI bus. Then, they look at the children of that bus for the
+right sequence number (0 or 1 in this case).
+
+Typically the alias method is used for top-level nodes and the 'reg' method
+is used only for buses.
+
+Device sequence numbers are resolved when a device is probed. Before then
+the 

[U-Boot] [PATCH v3 21/29] fdt: Add a function to get the node offset of an alias

2014-07-23 Thread Simon Glass
This simple function returns the node offset of a named alias.

Signed-off-by: Simon Glass s...@chromium.org
---

Changes in v3: None
Changes in v2: None

 include/fdtdec.h | 11 +++
 lib/fdtdec.c | 15 +++
 2 files changed, 26 insertions(+)

diff --git a/include/fdtdec.h b/include/fdtdec.h
index f96b0d3..5f88938 100644
--- a/include/fdtdec.h
+++ b/include/fdtdec.h
@@ -365,6 +365,17 @@ int fdtdec_add_aliases_for_id(const void *blob, const char 
*name,
 int fdtdec_get_alias_seq(const void *blob, const char *base, int node,
 int *seqp);
 
+/**
+ * Get the offset of the given alias node
+ *
+ * This looks up an alias in /aliases then finds the offset of that node.
+ *
+ * @param blob Device tree blob (if NULL, then error is returned)
+ * @param name Alias name, e.g. console
+ * @return Node offset referred to by that alias, or -ve FDT_ERR_...
+ */
+int fdtdec_get_alias_node(const void *blob, const char *name);
+
 /*
  * Get the name for a compatible ID
  *
diff --git a/lib/fdtdec.c b/lib/fdtdec.c
index 3f3ed4e..c2f3645 100644
--- a/lib/fdtdec.c
+++ b/lib/fdtdec.c
@@ -367,6 +367,21 @@ int fdtdec_get_alias_seq(const void *blob, const char 
*base, int offset,
return -ENOENT;
 }
 
+int fdtdec_get_alias_node(const void *blob, const char *name)
+{
+   const char *prop;
+   int alias_node;
+   int len;
+
+   if (!blob)
+   return -FDT_ERR_NOTFOUND;
+   alias_node = fdt_path_offset(blob, /aliases);
+   prop = fdt_getprop(blob, alias_node, name, len);
+   if (!prop)
+   return -FDT_ERR_NOTFOUND;
+   return fdt_path_offset(blob, prop);
+}
+
 int fdtdec_check_fdt(void)
 {
/*
-- 
2.0.0.526.g5318336

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


[U-Boot] [PATCH v3 22/29] dm: Tidy up some header file comments

2014-07-23 Thread Simon Glass
Fix up the style of a few comments and add/clarify a few others.

Signed-off-by: Simon Glass s...@chromium.org
---

Changes in v3: None
Changes in v2: None

 include/dm/device.h|  2 +-
 include/dm/platdata.h  | 10 --
 include/dm/root.h  |  3 ++-
 include/dm/uclass-id.h |  2 +-
 include/dm/uclass.h|  2 +-
 5 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/include/dm/device.h b/include/dm/device.h
index 6005e7e..9077490 100644
--- a/include/dm/device.h
+++ b/include/dm/device.h
@@ -124,7 +124,7 @@ struct udevice_id {
  * This is typically only useful for device-tree-aware drivers (those with
  * an of_match), since drivers which use platdata will have the data
  * provided in the U_BOOT_DEVICE() instantiation.
- * ops: Driver-specific operations. This is typically a list of function
+ * @ops: Driver-specific operations. This is typically a list of function
  * pointers defined by the driver, to implement driver functions required by
  * the uclass.
  * @flags: driver flags - see DM_FLAGS_...
diff --git a/include/dm/platdata.h b/include/dm/platdata.h
index 0ef3353..2bc8b14 100644
--- a/include/dm/platdata.h
+++ b/include/dm/platdata.h
@@ -11,9 +11,15 @@
 #ifndef _DM_PLATDATA_H
 #define _DM_PLATDATA_H
 
+/**
+ * struct driver_info - Information required to instantiate a device
+ *
+ * @name:  Device name
+ * @platdata:  Driver-specific platform data
+ */
 struct driver_info {
-   const char  *name;
-   const void  *platdata;
+   const char *name;
+   const void *platdata;
 };
 
 #define U_BOOT_DEVICE(__name)  \
diff --git a/include/dm/root.h b/include/dm/root.h
index 09f9303..02c7788 100644
--- a/include/dm/root.h
+++ b/include/dm/root.h
@@ -35,7 +35,8 @@ int dm_scan_platdata(bool pre_reloc_only);
 /**
  * dm_scan_fdt() - Scan the device tree and bind drivers
  *
- * This scans the device tree and creates a driver for each node
+ * This scans the device tree and creates a driver for each node. Only
+ * the top-level subnodes are examined.
  *
  * @blob: Pointer to device tree blob
  * @pre_reloc_only: If true, bind only drivers with the DM_FLAG_PRE_RELOC
diff --git a/include/dm/uclass-id.h b/include/dm/uclass-id.h
index f0e691c..77ff9ea 100644
--- a/include/dm/uclass-id.h
+++ b/include/dm/uclass-id.h
@@ -19,7 +19,7 @@ enum uclass_id {
UCLASS_TEST_FDT,
 
/* U-Boot uclasses start here */
-   UCLASS_GPIO,
+   UCLASS_GPIO,/* Bank of general-purpose I/O pins */
 
UCLASS_COUNT,
UCLASS_INVALID = -1,
diff --git a/include/dm/uclass.h b/include/dm/uclass.h
index 0b5ade6..8d09ecf 100644
--- a/include/dm/uclass.h
+++ b/include/dm/uclass.h
@@ -98,7 +98,7 @@ int uclass_get(enum uclass_id key, struct uclass **ucp);
  *
  * The device is probed to activate it ready for use.
  *
- * id: ID to look up
+ * @id: ID to look up
  * @index: Device number within that uclass (0=first)
  * @devp: Returns pointer to device (there is only one per for each ID)
  * @return 0 if OK, -ve on error
-- 
2.0.0.526.g5318336

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


[U-Boot] [PATCH v3 18/29] dm: Display the sequence number for each device

2014-07-23 Thread Simon Glass
Add this information to 'dm tree' and 'dm uclass' commands.

Signed-off-by: Simon Glass s...@chromium.org
---

Changes in v3: None
Changes in v2: None

 test/dm/cmd_dm.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/test/dm/cmd_dm.c b/test/dm/cmd_dm.c
index 93e5255..26980d2 100644
--- a/test/dm/cmd_dm.c
+++ b/test/dm/cmd_dm.c
@@ -29,6 +29,8 @@ static void dm_display_line(struct udevice *dev, char *buf)
printf(%s- %c %s @ %08lx, buf,
   dev-flags  DM_FLAG_ACTIVATED ? '*' : ' ',
   dev-name, (ulong)map_to_sysmem(dev));
+   if (dev-req_seq != -1)
+   printf(, %d, dev-req_seq);
puts(\n);
 }
 
-- 
2.0.0.526.g5318336

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


[U-Boot] [PATCH v3 14/29] fdt: Add a function to get the alias sequence of a node

2014-07-23 Thread Simon Glass
Aliases are used to provide U-Boot's numbering of devices, such as:

aliases {
spi0 = /spi@1233;
}

spi@1233 {
...
}

This tells us that the SPI controller at 1233 is considered to be the
first SPI controller (SPI 0). So we have a numbering for the SPI node.

Add a function that returns the numbering for a node assume that it exists
in the list of aliases.

Signed-off-by: Simon Glass s...@chromium.org
---

Changes in v3: None
Changes in v2: None

 include/fdtdec.h | 18 ++
 lib/fdtdec.c | 46 ++
 2 files changed, 64 insertions(+)

diff --git a/include/fdtdec.h b/include/fdtdec.h
index d4284bb..f96b0d3 100644
--- a/include/fdtdec.h
+++ b/include/fdtdec.h
@@ -347,6 +347,24 @@ int fdtdec_find_aliases_for_id(const void *blob, const 
char *name,
 int fdtdec_add_aliases_for_id(const void *blob, const char *name,
enum fdt_compat_id id, int *node_list, int maxcount);
 
+/**
+ * Get the alias sequence number of a node
+ *
+ * This works out whether a node is pointed to by an alias, and if so, the
+ * sequence number of that alias. Aliases are of the form basenum where
+ * num is the sequence number. For example spi2 would be sequence number
+ * 2.
+ *
+ * @param blob Device tree blob (if NULL, then error is returned)
+ * @param base Base name for alias (before the underscore)
+ * @param node Node to look up
+ * @param seqp This is set to the sequence number if one is found,
+ * but otherwise the value is left alone
+ * @return 0 if a sequence was found, -ve if not
+ */
+int fdtdec_get_alias_seq(const void *blob, const char *base, int node,
+int *seqp);
+
 /*
  * Get the name for a compatible ID
  *
diff --git a/lib/fdtdec.c b/lib/fdtdec.c
index 17d7969..3f3ed4e 100644
--- a/lib/fdtdec.c
+++ b/lib/fdtdec.c
@@ -5,9 +5,11 @@
 
 #ifndef USE_HOSTCC
 #include common.h
+#include errno.h
 #include serial.h
 #include libfdt.h
 #include fdtdec.h
+#include linux/ctype.h
 
 #include asm/gpio.h
 
@@ -321,6 +323,50 @@ int fdtdec_add_aliases_for_id(const void *blob, const char 
*name,
return num_found;
 }
 
+int fdtdec_get_alias_seq(const void *blob, const char *base, int offset,
+int *seqp)
+{
+   int base_len = strlen(base);
+   const char *find_name;
+   int find_namelen;
+   int prop_offset;
+   int aliases;
+
+   find_name = fdt_get_name(blob, offset, find_namelen);
+   debug(Looking for '%s' at %d, name %s\n, base, offset, find_name);
+
+   aliases = fdt_path_offset(blob, /aliases);
+   for (prop_offset = fdt_first_property_offset(blob, aliases);
+prop_offset  0;
+prop_offset = fdt_next_property_offset(blob, prop_offset)) {
+   const char *prop;
+   const char *name;
+   const char *slash;
+   const char *p;
+   int len;
+
+   prop = fdt_getprop_by_offset(blob, prop_offset, name, len);
+   debug(   - %s, %s\n, name, prop);
+   if (len  find_namelen || *prop != '/' || prop[len - 1] ||
+   strncmp(name, base, base_len))
+   continue;
+
+   slash = strrchr(prop, '/');
+   if (strcmp(slash + 1, find_name))
+   continue;
+   for (p = name; *p; p++) {
+   if (isdigit(*p)) {
+   *seqp = simple_strtoul(p, NULL, 10);
+   debug(Found seq %d\n, *seqp);
+   return 0;
+   }
+   }
+   }
+
+   debug(Not found\n);
+   return -ENOENT;
+}
+
 int fdtdec_check_fdt(void)
 {
/*
-- 
2.0.0.526.g5318336

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


[U-Boot] [PATCH v3 20/29] dm: Avoid accessing uclasses before they are ready

2014-07-23 Thread Simon Glass
Don't allow access to uclasses before they have been initialised.

Signed-off-by: Simon Glass s...@chromium.org
---

Changes in v3: None
Changes in v2: None

 doc/driver-model/README.txt |  3 ++-
 drivers/core/uclass.c   |  2 ++
 test/dm/core.c  | 14 ++
 3 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/doc/driver-model/README.txt b/doc/driver-model/README.txt
index 346cf08..672497d 100644
--- a/doc/driver-model/README.txt
+++ b/doc/driver-model/README.txt
@@ -95,7 +95,7 @@ are provided in test/dm. To run them, try:
 You should see something like this:
 
 ...U-Boot banner...
-Running 16 driver model tests
+Running 17 driver model tests
 Test: dm_test_autobind
 Test: dm_test_autoprobe
 Test: dm_test_children
@@ -116,6 +116,7 @@ You should see something like this:
 Test: dm_test_pre_reloc
 Test: dm_test_remove
 Test: dm_test_uclass
+Test: dm_test_uclass_before_ready
 Failures: 0
 
 
diff --git a/drivers/core/uclass.c b/drivers/core/uclass.c
index a27f3d5..61ca17e 100644
--- a/drivers/core/uclass.c
+++ b/drivers/core/uclass.c
@@ -23,6 +23,8 @@ struct uclass *uclass_find(enum uclass_id key)
 {
struct uclass *uc;
 
+   if (!gd-dm_root)
+   return NULL;
/*
 * TODO(s...@chromium.org): Optimise this, perhaps moving the found
 * node to the start of the list, or creating a linear array mapping
diff --git a/test/dm/core.c b/test/dm/core.c
index 24e0b6b..b0cfb42 100644
--- a/test/dm/core.c
+++ b/test/dm/core.c
@@ -570,3 +570,17 @@ static int dm_test_pre_reloc(struct dm_test_state *dms)
return 0;
 }
 DM_TEST(dm_test_pre_reloc, 0);
+
+static int dm_test_uclass_before_ready(struct dm_test_state *dms)
+{
+   struct uclass *uc;
+
+   ut_assertok(uclass_get(UCLASS_TEST, uc));
+
+   memset(gd, '\0', sizeof(*gd));
+   ut_asserteq_ptr(NULL, uclass_find(UCLASS_TEST));
+
+   return 0;
+}
+
+DM_TEST(dm_test_uclass_before_ready, 0);
-- 
2.0.0.526.g5318336

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


[U-Boot] [PATCH v3 29/29] dm: Give the demo uclass a name

2014-07-23 Thread Simon Glass
Uclasses should be named, so add a name for the demo uclass.

Signed-off-by: Simon Glass s...@chromium.org
---

Changes in v3: None
Changes in v2:
- Expand series to include all driver-model-required changes

 drivers/demo/demo-uclass.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/demo/demo-uclass.c b/drivers/demo/demo-uclass.c
index 636fd88..f6510d6 100644
--- a/drivers/demo/demo-uclass.c
+++ b/drivers/demo/demo-uclass.c
@@ -19,6 +19,7 @@
 DECLARE_GLOBAL_DATA_PTR;
 
 UCLASS_DRIVER(demo) = {
+   .name   = demo,
.id = UCLASS_DEMO,
 };
 
-- 
2.0.0.526.g5318336

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


[U-Boot] [PATCH v3 26/29] dm: Add child_pre_probe() and child_post_remove() methods

2014-07-23 Thread Simon Glass
Some devices (particularly bus devices) must track their children, knowing
when a new child is added so that it can be set up for communication on the
bus.

Add a child_pre_probe() method to provide this feature, and a corresponding
child_post_remove() method.

Signed-off-by: Simon Glass s...@chromium.org
---

Changes in v3: None
Changes in v2: None

 doc/driver-model/README.txt | 68 -
 drivers/core/device.c   | 16 ++-
 include/dm/device.h |  6 
 include/dm/test.h   |  4 +++
 test/dm/bus.c   | 68 +
 5 files changed, 160 insertions(+), 2 deletions(-)

diff --git a/doc/driver-model/README.txt b/doc/driver-model/README.txt
index 11af35d..f9b68be 100644
--- a/doc/driver-model/README.txt
+++ b/doc/driver-model/README.txt
@@ -95,7 +95,7 @@ are provided in test/dm. To run them, try:
 You should see something like this:
 
 ...U-Boot banner...
-Running 20 driver model tests
+Running 21 driver model tests
 Test: dm_test_autobind
 Test: dm_test_autoprobe
 Test: dm_test_bus_children
@@ -104,6 +104,7 @@ You should see something like this:
 Device 'c-test@1': seq 1 is in use by 'd-test'
 Test: dm_test_bus_children_funcs
 Test: dm_test_bus_parent_data
+Test: dm_test_bus_parent_ops
 Test: dm_test_children
 Test: dm_test_fdt
 Device 'd-test': seq 3 is in use by 'b-test'
@@ -425,6 +426,71 @@ entirely under the control of the board author so a 
conflict is generally
 an error.
 
 
+Bus Drivers
+---
+
+A common use of driver model is to implement a bus, a device which provides
+access to other devices. Example of buses include SPI and I2C. Typically
+the bus provides some sort of transport or translation that makes it
+possible to talk to the devices on the bus.
+
+Driver model provides a few useful features to help with implementing
+buses. Firstly, a bus can request that its children store some 'parent
+data' which can be used to keep track of child state. Secondly, the bus can
+define methods which are called when a child is probed or removed. This is
+similar to the methods the uclass driver provides.
+
+Here an explanation of how a bus fits with a uclass may be useful. Consider
+a USB bus with several devices attached to it, each from a different (made
+up) uclass:
+
+   xhci_usb (UCLASS_USB)
+  eth (UCLASS_ETHERNET)
+  camera (UCLASS_CAMERA)
+  flash (UCLASS_FLASH_STORAGE)
+
+Each of the devices is connected to a different address on the USB bus.
+The bus device wants to store this address and some other information such
+as the bus speed for each device.
+
+To achieve this, the bus device can use dev-parent_priv in each of its
+three children. This can be auto-allocated if the bus driver has a non-zero
+value for per_child_auto_alloc_size. If not, then the bus device can
+allocate the space itself before the child device is probed.
+
+Also the bus driver can define the child_pre_probe() and child_post_remove()
+methods to allow it to do some processing before the child is activated or
+after it is deactivated.
+
+Note that the information that controls this behaviour is in the bus's
+driver, not the child's. In fact it is possible that child has no knowledge
+that it is connected to a bus. The same child device may even be used on two
+different bus types. As an example. the 'flash' device shown above may also
+be connected on a SATA bus or standalone with no bus:
+
+   xhci_usb (UCLASS_USB)
+  flash (UCLASS_FLASH_STORAGE)  - parent data/methods defined by USB bus
+
+   sata (UCLASS_SATA)
+  flash (UCLASS_FLASH_STORAGE)  - parent data/methods defined by SATA bus
+
+   flash (UCLASS_FLASH_STORAGE)  - no parent data/methods (not on a bus)
+
+Above you can see that the driver for xhci_usb/sata controls the child's
+bus methods. In the third example the device is not on a bus, and therefore
+will not have these methods at all. Consider the case where the flash
+device defines child methods. These would be used for *its* children, and
+would be quite separate from the methods defined by the driver for the bus
+that the flash device is connetced to. The act of attaching a device to a
+parent device which is a bus, causes the device to start behaving like a
+bus device, regardless of its own views on the matter.
+
+The uclass for the device can also contain data private to that uclass.
+But note that each device on the bus may be a memeber of a different
+uclass, and this data has nothing to do with the child data for each child
+on the bus.
+
+
 Driver Lifecycle
 
 
diff --git a/drivers/core/device.c b/drivers/core/device.c
index 42d250f..166b073 100644
--- a/drivers/core/device.c
+++ b/drivers/core/device.c
@@ -291,6 +291,12 @@ int device_probe(struct udevice *dev)
}
dev-seq = seq;
 
+   if (dev-parent  dev-parent-driver-child_pre_probe) {
+   ret = 

[U-Boot] [PATCH v3 15/29] dm: Move device display into its own function

2014-07-23 Thread Simon Glass
The device display for 'dm tree' and 'dm uclass' is mostly the same, so
move it into a common function.

Signed-off-by: Simon Glass s...@chromium.org
---

Changes in v3: None
Changes in v2: None

 test/dm/cmd_dm.c | 27 +++
 1 file changed, 19 insertions(+), 8 deletions(-)

diff --git a/test/dm/cmd_dm.c b/test/dm/cmd_dm.c
index 96f10f3..9b77a7f 100644
--- a/test/dm/cmd_dm.c
+++ b/test/dm/cmd_dm.c
@@ -16,6 +16,22 @@
 #include dm/test.h
 #include dm/uclass-internal.h
 
+/**
+ * dm_display_line() - Display information about a single device
+ *
+ * Displays a single line of information with an option prefix
+ *
+ * @dev:   Device to display
+ * @buf:   Prefix to display at the start of the line
+ */
+static void dm_display_line(struct udevice *dev, char *buf)
+{
+   printf(%s- %c %s @ %08lx, buf,
+  dev-flags  DM_FLAG_ACTIVATED ? '*' : ' ',
+  dev-name, (ulong)map_to_sysmem(dev));
+   puts(\n);
+}
+
 static int display_succ(struct udevice *in, char *buf)
 {
int len;
@@ -23,10 +39,7 @@ static int display_succ(struct udevice *in, char *buf)
char local[16];
struct udevice *pos, *n, *prev = NULL;
 
-   printf(%s- %c %s @ %08lx, buf,
-  in-flags  DM_FLAG_ACTIVATED ? '*' : ' ',
-  in-name, (ulong)map_to_sysmem(in));
-   puts(\n);
+   dm_display_line(in, buf);
 
if (list_empty(in-child_head))
return 0;
@@ -84,9 +97,7 @@ static int do_dm_dump_uclass(cmd_tbl_t *cmdtp, int flag, int 
argc,
for (ret = uclass_first_device(id, dev);
 dev;
 ret = uclass_next_device(dev)) {
-   printf(  %c %s @ %08lx:\n,
-  dev-flags  DM_FLAG_ACTIVATED ? '*' : ' ',
-  dev-name, (ulong)map_to_sysmem(dev));
+   dm_display_line(dev, );
}
puts(\n);
}
@@ -135,7 +146,7 @@ static int do_dm(cmd_tbl_t *cmdtp, int flag, int argc, char 
* const argv[])
 U_BOOT_CMD(
dm, 2,  1,  do_dm,
Driver model low level access,
-   tree Dump driver model tree\n
+   tree Dump driver model tree ('*' = activated)\n
dm uclassDump list of instances for each uclass
TEST_HELP
 );
-- 
2.0.0.526.g5318336

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


[U-Boot] [PATCH v3 24/29] dm: Add functions to access a device's children

2014-07-23 Thread Simon Glass
Devices can have childen that can be addressed by a simple index, the
sequence number or a device tree offset. Add functions to access a child
in each of these ways.

The index is typically used as a fallback when the sequence number is not
available. For example we may use a serial UART with sequence number 0 as
the console, but if no UART has sequence number 0, then we can fall back
to just using the first UART (index 0).

The device tree offset function is useful for buses, where they want to
locate one of their children. The device tree can be scanned to find the
offset of each child, and that offset can then find the device.

Signed-off-by: Simon Glass s...@chromium.org
---

Changes in v3: None
Changes in v2: None

 doc/driver-model/README.txt |  3 +-
 drivers/core/device.c   | 93 +
 include/dm/device.h | 58 
 test/dm/bus.c   | 46 ++
 4 files changed, 199 insertions(+), 1 deletion(-)

diff --git a/doc/driver-model/README.txt b/doc/driver-model/README.txt
index a2b6122..59ef05c 100644
--- a/doc/driver-model/README.txt
+++ b/doc/driver-model/README.txt
@@ -95,13 +95,14 @@ are provided in test/dm. To run them, try:
 You should see something like this:
 
 ...U-Boot banner...
-Running 18 driver model tests
+Running 19 driver model tests
 Test: dm_test_autobind
 Test: dm_test_autoprobe
 Test: dm_test_bus_children
 Device 'd-test': seq 3 is in use by 'b-test'
 Device 'c-test@0': seq 0 is in use by 'a-test'
 Device 'c-test@1': seq 1 is in use by 'd-test'
+Test: dm_test_bus_children_funcs
 Test: dm_test_children
 Test: dm_test_fdt
 Device 'd-test': seq 3 is in use by 'b-test'
diff --git a/drivers/core/device.c b/drivers/core/device.c
index 848ce3b..74bb5f0 100644
--- a/drivers/core/device.c
+++ b/drivers/core/device.c
@@ -376,3 +376,96 @@ void *dev_get_priv(struct udevice *dev)
 
return dev-priv;
 }
+
+static int device_get_device_tail(struct udevice *dev, int ret,
+ struct udevice **devp)
+{
+   if (ret)
+   return ret;
+
+   ret = device_probe(dev);
+   if (ret)
+   return ret;
+
+   *devp = dev;
+
+   return 0;
+}
+
+int device_get_child(struct udevice *parent, int index, struct udevice **devp)
+{
+   struct udevice *dev;
+
+   list_for_each_entry(dev, parent-child_head, sibling_node) {
+   if (!index--)
+   return device_get_device_tail(dev, 0, devp);
+   }
+
+   return -ENODEV;
+}
+
+int device_find_child_by_seq(struct udevice *parent, int seq_or_req_seq,
+bool find_req_seq, struct udevice **devp)
+{
+   struct udevice *dev;
+
+   *devp = NULL;
+   if (seq_or_req_seq == -1)
+   return -ENODEV;
+
+   list_for_each_entry(dev, parent-child_head, sibling_node) {
+   if ((find_req_seq ? dev-req_seq : dev-seq) ==
+   seq_or_req_seq) {
+   *devp = dev;
+   return 0;
+   }
+   }
+
+   return -ENODEV;
+}
+
+int device_get_child_by_seq(struct udevice *parent, int seq,
+   struct udevice **devp)
+{
+   struct udevice *dev;
+   int ret;
+
+   *devp = NULL;
+   ret = device_find_child_by_seq(parent, seq, false, dev);
+   if (ret == -ENODEV) {
+   /*
+* We didn't find it in probed devices. See if there is one
+* that will request this seq if probed.
+*/
+   ret = device_find_child_by_seq(parent, seq, true, dev);
+   }
+   return device_get_device_tail(dev, ret, devp);
+}
+
+int device_find_child_by_of_offset(struct udevice *parent, int of_offset,
+  struct udevice **devp)
+{
+   struct udevice *dev;
+
+   *devp = NULL;
+
+   list_for_each_entry(dev, parent-child_head, sibling_node) {
+   if (dev-of_offset == of_offset) {
+   *devp = dev;
+   return 0;
+   }
+   }
+
+   return -ENODEV;
+}
+
+int device_get_child_by_of_offset(struct udevice *parent, int seq,
+ struct udevice **devp)
+{
+   struct udevice *dev;
+   int ret;
+
+   *devp = NULL;
+   ret = device_find_child_by_of_offset(parent, seq, dev);
+   return device_get_device_tail(dev, ret, devp);
+}
diff --git a/include/dm/device.h b/include/dm/device.h
index 9077490..3f0f711 100644
--- a/include/dm/device.h
+++ b/include/dm/device.h
@@ -169,6 +169,18 @@ void *dev_get_platdata(struct udevice *dev);
 void *dev_get_priv(struct udevice *dev);
 
 /**
+ * device_get_child() - Get the child of a device by index
+ *
+ * Returns the numbered child, 0 being the first. This does not use
+ * sequence numbers, only the natural order.
+ *
+ * 

[U-Boot] [PATCH v3 11/29] console: Remove vprintf() optimisation for sandbox

2014-07-23 Thread Simon Glass
If the console is not present, we try to reduce overhead by stopping any
output in vprintf(), before it gets to putc(). This is of dubious merit
in general, but in the case of sandbox it is incorrect since we have a
fallback console which reports errors very early in U-Boot. If this is
defeated U-Boot can hang or exit with no indication of what is wrong.

Remove the optimisation for sandbox.

Signed-off-by: Simon Glass s...@chromium.org
---

Changes in v3: None
Changes in v2:
- Improve wording in commit message

 common/console.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/console.c b/common/console.c
index 11c102a..5576dfd 100644
--- a/common/console.c
+++ b/common/console.c
@@ -504,7 +504,7 @@ int vprintf(const char *fmt, va_list args)
uint i;
char printbuffer[CONFIG_SYS_PBSIZE];
 
-#ifndef CONFIG_PRE_CONSOLE_BUFFER
+#if defined(CONFIG_PRE_CONSOLE_BUFFER)  !defined(CONFIG_SANDBOX)
if (!gd-have_console)
return 0;
 #endif
-- 
2.0.0.526.g5318336

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


[U-Boot] [PATCH v3 16/29] dm: Avoid activating devices in 'dm uclass' command

2014-07-23 Thread Simon Glass
This command currently activates devices as it lists them. This is not
desirable since it changes the system state. Fix it and avoid printing
a newline if there are no devices in a uclass.

Signed-off-by: Simon Glass s...@chromium.org
---

Changes in v3: None
Changes in v2: None

 test/dm/cmd_dm.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/test/dm/cmd_dm.c b/test/dm/cmd_dm.c
index 9b77a7f..93e5255 100644
--- a/test/dm/cmd_dm.c
+++ b/test/dm/cmd_dm.c
@@ -94,9 +94,9 @@ static int do_dm_dump_uclass(cmd_tbl_t *cmdtp, int flag, int 
argc,
continue;
 
printf(uclass %d: %s\n, id, uc-uc_drv-name);
-   for (ret = uclass_first_device(id, dev);
-dev;
-ret = uclass_next_device(dev)) {
+   if (list_empty(uc-dev_head))
+   continue;
+   list_for_each_entry(dev, uc-dev_head, uclass_node) {
dm_display_line(dev, );
}
puts(\n);
-- 
2.0.0.526.g5318336

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


[U-Boot] [PATCH v3 25/29] dm: Introduce per-child data for devices

2014-07-23 Thread Simon Glass
Some device types can have child devices and want to store information
about them. For example a USB flash stick attached to a USB host
controller would likely use this space. The controller can hold
information about the USB state of each of its children.

The data is stored attached to the child device in the 'parent_priv'
member. It can be auto-allocated by dm when the child is probed. To
do this, add a per_child_auto_alloc_size value to the parent driver.

Signed-off-by: Simon Glass s...@chromium.org
---

Changes in v3: None
Changes in v2: None

 doc/driver-model/README.txt | 25 +++--
 drivers/core/device.c   | 26 ++
 include/dm/device.h | 20 ++
 include/dm/test.h   |  9 +++
 test/dm/bus.c   | 65 +
 5 files changed, 137 insertions(+), 8 deletions(-)

diff --git a/doc/driver-model/README.txt b/doc/driver-model/README.txt
index 59ef05c..11af35d 100644
--- a/doc/driver-model/README.txt
+++ b/doc/driver-model/README.txt
@@ -95,7 +95,7 @@ are provided in test/dm. To run them, try:
 You should see something like this:
 
 ...U-Boot banner...
-Running 19 driver model tests
+Running 20 driver model tests
 Test: dm_test_autobind
 Test: dm_test_autoprobe
 Test: dm_test_bus_children
@@ -103,6 +103,7 @@ You should see something like this:
 Device 'c-test@0': seq 0 is in use by 'a-test'
 Device 'c-test@1': seq 1 is in use by 'd-test'
 Test: dm_test_bus_children_funcs
+Test: dm_test_bus_parent_data
 Test: dm_test_children
 Test: dm_test_fdt
 Device 'd-test': seq 3 is in use by 'b-test'
@@ -489,16 +490,23 @@ steps (see device_probe()):
stored in the device, but it is uclass data. owned by the uclass driver.
It is possible for the device to access it.
 
-   d. All parent devices are probed. It is not possible to activate a device
+   d. If the device's immediate parent specifies a per_child_auto_alloc_size
+   then this space is allocated. This is intended for use by the parent
+   device to keep track of things related to the child. For example a USB
+   flash stick attached to a USB host controller would likely use this
+   space. The controller can hold information about the USB state of each
+   of its children.
+
+   e. All parent devices are probed. It is not possible to activate a device
unless its predecessors (all the way up to the root device) are activated.
This means (for example) that an I2C driver will require that its bus
be activated.
 
-   e. The device's sequence number is assigned, either the requested one
+   f. The device's sequence number is assigned, either the requested one
(assuming no conflicts) or the next available one if there is a conflict
or nothing particular is requested.
 
-   f. If the driver provides an ofdata_to_platdata() method, then this is
+   g. If the driver provides an ofdata_to_platdata() method, then this is
called to convert the device tree data into platform data. This should
do various calls like fdtdec_get_int(gd-fdt_blob, dev-of_offset, ...)
to access the node and store the resulting information into dev-platdata.
@@ -514,7 +522,7 @@ steps (see device_probe()):
data, one day it is possible that U-Boot will cache platformat data for
devices which are regularly de/activated).
 
-   g. The device's probe() method is called. This should do anything that
+   h. The device's probe() method is called. This should do anything that
is required by the device to get it going. This could include checking
that the hardware is actually present, setting up clocks for the
hardware and setting up hardware registers to initial values. The code
@@ -529,9 +537,9 @@ steps (see device_probe()):
allocate the priv space here yourself. The same applies also to
platdata_auto_alloc_size. Remember to free them in the remove() method.
 
-   h. The device is marked 'activated'
+   i. The device is marked 'activated'
 
-   i. The uclass's post_probe() method is called, if one exists. This may
+   j. The uclass's post_probe() method is called, if one exists. This may
cause the uclass to do some housekeeping to record the device as
activated and 'known' by the uclass.
 
@@ -562,7 +570,8 @@ remove it. This performs the probe steps in reverse:
to be sure that no hardware is running, it should be enough to remove
all devices.
 
-   d. The device memory is freed (platform data, private data, uclass data).
+   d. The device memory is freed (platform data, private data, uclass data,
+   parent data).
 
Note: Because the platform data for a U_BOOT_DEVICE() is defined with a
static pointer, it is not de-allocated during the remove() method. For
diff --git a/drivers/core/device.c b/drivers/core/device.c
index 74bb5f0..42d250f 100644
--- a/drivers/core/device.c
+++ b/drivers/core/device.c
@@ -218,6 +218,13 @@ static void device_free(struct udevice 

[U-Boot] [PATCH v3 03/29] stdio: Remove redundant code around stdio_register() calls

2014-07-23 Thread Simon Glass
There is no point in setting a structure's memory to NULL when it has
already been zeroed with memset().

Also, there is no need to create a stub function for stdio to call - if the
function is NULL it will not be called.

This is a clean-up, with no change in functionality.

Signed-off-by: Simon Glass s...@chromium.org
Acked-by: Marek Vasut ma...@denx.de
---

Changes in v3: None
Changes in v2:
- Reformat commit message slightly
- Remove change to board/rbc823/kbd.c, since it has been deleted

 arch/x86/lib/video.c|  4 
 board/bf527-ezkit/video.c   | 10 --
 board/bf548-ezkit/video.c   | 10 --
 board/cm-bf548/video.c  | 10 --
 board/mpl/common/kbd.c  |  2 --
 common/usb_kbd.c|  2 --
 drivers/input/keyboard.c|  2 --
 drivers/video/cfb_console.c |  2 --
 8 files changed, 42 deletions(-)

diff --git a/arch/x86/lib/video.c b/arch/x86/lib/video.c
index dfd2a84..eb9c595 100644
--- a/arch/x86/lib/video.c
+++ b/arch/x86/lib/video.c
@@ -178,8 +178,6 @@ int video_init(void)
vga_dev.flags = DEV_FLAGS_OUTPUT | DEV_FLAGS_SYSTEM;
vga_dev.putc  = video_putc;/* 'putc' function */
vga_dev.puts  = video_puts;/* 'puts' function */
-   vga_dev.tstc  = NULL;  /* 'tstc' function */
-   vga_dev.getc  = NULL;  /* 'getc' function */
 
if (stdio_register(vga_dev) == 0)
return 1;
@@ -191,8 +189,6 @@ int video_init(void)
strcpy(kbd_dev.name, kbd);
kbd_dev.ext   = 0;
kbd_dev.flags = DEV_FLAGS_INPUT | DEV_FLAGS_SYSTEM;
-   kbd_dev.putc  = NULL;/* 'putc' function */
-   kbd_dev.puts  = NULL;/* 'puts' function */
kbd_dev.tstc  = i8042_tstc;  /* 'tstc' function */
kbd_dev.getc  = i8042_getc;  /* 'getc' function */
 
diff --git a/board/bf527-ezkit/video.c b/board/bf527-ezkit/video.c
index 5d8a091..c2bf145 100644
--- a/board/bf527-ezkit/video.c
+++ b/board/bf527-ezkit/video.c
@@ -391,14 +391,6 @@ void video_stop(void)
 #endif
 }
 
-void video_putc(const char c)
-{
-}
-
-void video_puts(const char *s)
-{
-}
-
 int drv_video_init(void)
 {
int error, devices = 1;
@@ -448,8 +440,6 @@ int drv_video_init(void)
strcpy(videodev.name, video);
videodev.ext = DEV_EXT_VIDEO;   /* Video extensions */
videodev.flags = DEV_FLAGS_SYSTEM;  /* No Output */
-   videodev.putc = video_putc; /* 'putc' function */
-   videodev.puts = video_puts; /* 'puts' function */
 
error = stdio_register(videodev);
 
diff --git a/board/bf548-ezkit/video.c b/board/bf548-ezkit/video.c
index 6737ac1..47e68c6 100644
--- a/board/bf548-ezkit/video.c
+++ b/board/bf548-ezkit/video.c
@@ -281,14 +281,6 @@ static void dma_bitblit(void *dst, fastimage_t *logo, int 
x, int y)
 
 }
 
-void video_putc(const char c)
-{
-}
-
-void video_puts(const char *s)
-{
-}
-
 int drv_video_init(void)
 {
int error, devices = 1;
@@ -338,8 +330,6 @@ int drv_video_init(void)
strcpy(videodev.name, video);
videodev.ext = DEV_EXT_VIDEO;   /* Video extensions */
videodev.flags = DEV_FLAGS_SYSTEM;  /* No Output */
-   videodev.putc = video_putc; /* 'putc' function */
-   videodev.puts = video_puts; /* 'puts' function */
 
error = stdio_register(videodev);
 
diff --git a/board/cm-bf548/video.c b/board/cm-bf548/video.c
index c35d285..b098615 100644
--- a/board/cm-bf548/video.c
+++ b/board/cm-bf548/video.c
@@ -283,14 +283,6 @@ static void dma_bitblit(void *dst, fastimage_t *logo, int 
x, int y)
 
 }
 
-void video_putc(const char c)
-{
-}
-
-void video_puts(const char *s)
-{
-}
-
 int drv_video_init(void)
 {
int error, devices = 1;
@@ -342,8 +334,6 @@ int drv_video_init(void)
strcpy(videodev.name, video);
videodev.ext = DEV_EXT_VIDEO;   /* Video extensions */
videodev.flags = DEV_FLAGS_SYSTEM;  /* No Output */
-   videodev.putc = video_putc; /* 'putc' function */
-   videodev.puts = video_puts; /* 'puts' function */
 
error = stdio_register(videodev);
 
diff --git a/board/mpl/common/kbd.c b/board/mpl/common/kbd.c
index 1b5487b..f56545e 100644
--- a/board/mpl/common/kbd.c
+++ b/board/mpl/common/kbd.c
@@ -204,8 +204,6 @@ int drv_isa_kbd_init (void)
memset (kbddev, 0, sizeof(kbddev));
strcpy(kbddev.name, DEVNAME);
kbddev.flags =  DEV_FLAGS_INPUT | DEV_FLAGS_SYSTEM;
-   kbddev.putc = NULL ;
-   kbddev.puts = NULL ;
kbddev.getc = kbd_getc ;
kbddev.tstc = kbd_testc ;
 
diff --git a/common/usb_kbd.c b/common/usb_kbd.c
index 0b77c16..371e5bc 100644
--- a/common/usb_kbd.c
+++ b/common/usb_kbd.c
@@ -522,8 +522,6 @@ int drv_usb_kbd_init(void)
memset(usb_kbd_dev, 0, sizeof(struct stdio_dev));
strcpy(usb_kbd_dev.name, DEVNAME);
usb_kbd_dev.flags =  DEV_FLAGS_INPUT | DEV_FLAGS_SYSTEM;
-   usb_kbd_dev.putc = NULL;
-   

[U-Boot] [PATCH v3 23/29] dm: Provide a function to scan child FDT nodes

2014-07-23 Thread Simon Glass
At present only root nodes in the device tree are scanned for devices.
But some devices can have children. For example a SPI bus may have
several children for each of its chip selects.

Add a function which scans subnodes and binds devices for each one. This
can be used for the root node scan also, so change it.

A device can call this function in its bind() or probe() methods to bind
its children.

Signed-off-by: Simon Glass s...@chromium.org
---

Changes in v3:
- Change pre-reloc fdt property to 'u-boot,dm-pre-reloc'

Changes in v2: None

 doc/driver-model/README.txt |  6 -
 drivers/core/root.c | 34 +---
 include/dm/root.h   | 16 
 include/dm/test.h   |  9 +++
 include/dm/uclass-id.h  |  1 +
 test/dm/Makefile|  1 +
 test/dm/bus.c   | 63 +
 test/dm/test-fdt.c  | 63 +++--
 test/dm/test.dts| 16 +++-
 9 files changed, 167 insertions(+), 42 deletions(-)
 create mode 100644 test/dm/bus.c

diff --git a/doc/driver-model/README.txt b/doc/driver-model/README.txt
index 672497d..a2b6122 100644
--- a/doc/driver-model/README.txt
+++ b/doc/driver-model/README.txt
@@ -95,9 +95,13 @@ are provided in test/dm. To run them, try:
 You should see something like this:
 
 ...U-Boot banner...
-Running 17 driver model tests
+Running 18 driver model tests
 Test: dm_test_autobind
 Test: dm_test_autoprobe
+Test: dm_test_bus_children
+Device 'd-test': seq 3 is in use by 'b-test'
+Device 'c-test@0': seq 0 is in use by 'a-test'
+Device 'c-test@1': seq 1 is in use by 'd-test'
 Test: dm_test_children
 Test: dm_test_fdt
 Device 'd-test': seq 3 is in use by 'b-test'
diff --git a/drivers/core/root.c b/drivers/core/root.c
index c37d666..4f9c7e7 100644
--- a/drivers/core/root.c
+++ b/drivers/core/root.c
@@ -15,6 +15,7 @@
 #include dm/device-internal.h
 #include dm/lists.h
 #include dm/platdata.h
+#include dm/root.h
 #include dm/uclass.h
 #include dm/util.h
 #include linux/list.h
@@ -79,29 +80,32 @@ int dm_scan_platdata(bool pre_reloc_only)
 }
 
 #ifdef CONFIG_OF_CONTROL
-int dm_scan_fdt(const void *blob, bool pre_reloc_only)
+int dm_scan_fdt_node(struct udevice *parent, const void *blob, int offset,
+bool pre_reloc_only)
 {
-   int offset = 0;
int ret = 0, err;
-   int depth = 0;
-
-   do {
-   offset = fdt_next_node(blob, offset, depth);
-   if (offset  0  depth == 1) {
-   if (pre_reloc_only 
-   !fdt_getprop(blob, offset, u-boot,dm-pre-reloc, 
NULL))
-   continue;
-   err = lists_bind_fdt(gd-dm_root, blob, offset);
-   if (err  !ret)
-   ret = err;
-   }
-   } while (offset  0);
+
+   for (offset = fdt_first_subnode(blob, offset);
+offset  0;
+offset = fdt_next_subnode(blob, offset)) {
+   if (pre_reloc_only 
+   !fdt_getprop(blob, offset, u-boot,dm-pre-reloc, NULL))
+   continue;
+   err = lists_bind_fdt(parent, blob, offset);
+   if (err  !ret)
+   ret = err;
+   }
 
if (ret)
dm_warn(Some drivers failed to bind\n);
 
return ret;
 }
+
+int dm_scan_fdt(const void *blob, bool pre_reloc_only)
+{
+   return dm_scan_fdt_node(gd-dm_root, blob, 0, pre_reloc_only);
+}
 #endif
 
 int dm_init_and_scan(bool pre_reloc_only)
diff --git a/include/dm/root.h b/include/dm/root.h
index 02c7788..33f951b 100644
--- a/include/dm/root.h
+++ b/include/dm/root.h
@@ -46,6 +46,22 @@ int dm_scan_platdata(bool pre_reloc_only);
 int dm_scan_fdt(const void *blob, bool pre_reloc_only);
 
 /**
+ * dm_scan_fdt_node() - Scan the device tree and bind drivers for a node
+ *
+ * This scans the subnodes of a device tree node and and creates a driver
+ * for each one.
+ *
+ * @parent: Parent device for the devices that will be created
+ * @blob: Pointer to device tree blob
+ * @offset: Offset of node to scan
+ * @pre_reloc_only: If true, bind only drivers with the DM_FLAG_PRE_RELOC
+ * flag. If false bind all drivers.
+ * @return 0 if OK, -ve on error
+ */
+int dm_scan_fdt_node(struct udevice *parent, const void *blob, int offset,
+bool pre_reloc_only);
+
+/**
  * dm_init_and_scan() - Initialise Driver Model structures and scan for devices
  *
  * This function initialises the roots of the driver tree and uclass trees,
diff --git a/include/dm/test.h b/include/dm/test.h
index 409f1a3..e8e1c0b 100644
--- a/include/dm/test.h
+++ b/include/dm/test.h
@@ -156,6 +156,15 @@ int dm_check_operations(struct dm_test_state *dms, struct 
udevice *dev,
uint32_t base, struct dm_test_priv *priv);
 
 /**
+ * dm_check_devices() - 

[U-Boot] [PATCH v3 19/29] dm: Allow a device to be found by its FDT offset

2014-07-23 Thread Simon Glass
Each device that was bound from a device tree has an node that caused it to
be bound. Add functions that find and return a device based on a device tree
offset.

Signed-off-by: Simon Glass s...@chromium.org
---

Changes in v3: None
Changes in v2: None

 doc/driver-model/README.txt |  3 ++-
 drivers/core/uclass.c   | 35 +++
 include/dm/uclass.h | 16 
 test/dm/test-fdt.c  | 30 ++
 4 files changed, 83 insertions(+), 1 deletion(-)

diff --git a/doc/driver-model/README.txt b/doc/driver-model/README.txt
index 84d21cf..346cf08 100644
--- a/doc/driver-model/README.txt
+++ b/doc/driver-model/README.txt
@@ -95,12 +95,13 @@ are provided in test/dm. To run them, try:
 You should see something like this:
 
 ...U-Boot banner...
-Running 15 driver model tests
+Running 16 driver model tests
 Test: dm_test_autobind
 Test: dm_test_autoprobe
 Test: dm_test_children
 Test: dm_test_fdt
 Device 'd-test': seq 3 is in use by 'b-test'
+Test: dm_test_fdt_offset
 Test: dm_test_fdt_pre_reloc
 Test: dm_test_fdt_uclass_seq
 Device 'd-test': seq 3 is in use by 'b-test'
diff --git a/drivers/core/uclass.c b/drivers/core/uclass.c
index c28cf67..a27f3d5 100644
--- a/drivers/core/uclass.c
+++ b/drivers/core/uclass.c
@@ -187,6 +187,30 @@ int uclass_find_device_by_seq(enum uclass_id id, int 
seq_or_req_seq,
return -ENODEV;
 }
 
+static int uclass_find_device_by_of_offset(enum uclass_id id, int node,
+  struct udevice **devp)
+{
+   struct uclass *uc;
+   struct udevice *dev;
+   int ret;
+
+   *devp = NULL;
+   if (node  0)
+   return -ENODEV;
+   ret = uclass_get(id, uc);
+   if (ret)
+   return ret;
+
+   list_for_each_entry(dev, uc-dev_head, uclass_node) {
+   if (dev-of_offset == node) {
+   *devp = dev;
+   return 0;
+   }
+   }
+
+   return -ENODEV;
+}
+
 /**
  * uclass_get_device_tail() - handle the end of a get_device call
  *
@@ -239,6 +263,17 @@ int uclass_get_device_by_seq(enum uclass_id id, int seq, 
struct udevice **devp)
return uclass_get_device_tail(dev, ret, devp);
 }
 
+int uclass_get_device_by_of_offset(enum uclass_id id, int node,
+  struct udevice **devp)
+{
+   struct udevice *dev;
+   int ret;
+
+   *devp = NULL;
+   ret = uclass_find_device_by_of_offset(id, node, dev);
+   return uclass_get_device_tail(dev, ret, devp);
+}
+
 int uclass_first_device(enum uclass_id id, struct udevice **devp)
 {
struct uclass *uc;
diff --git a/include/dm/uclass.h b/include/dm/uclass.h
index 48ae242..0b5ade6 100644
--- a/include/dm/uclass.h
+++ b/include/dm/uclass.h
@@ -122,6 +122,22 @@ int uclass_get_device(enum uclass_id id, int index, struct 
udevice **devp);
 int uclass_get_device_by_seq(enum uclass_id id, int seq, struct udevice 
**devp);
 
 /**
+ * uclass_get_device_by_of_offset() - Get a uclass device by device tree node
+ *
+ * This searches the devices in the uclass for one attached to the given
+ * device tree node.
+ *
+ * The device is probed to activate it ready for use.
+ *
+ * @id: ID to look up
+ * @node: Device tree offset to search for (if -ve then -ENODEV is returned)
+ * @devp: Returns pointer to device (there is only one for each node)
+ * @return 0 if OK, -ve on error
+ */
+int uclass_get_device_by_of_offset(enum uclass_id id, int node,
+  struct udevice **devp);
+
+/**
  * uclass_first_device() - Get the first device in a uclass
  *
  * @id: Uclass ID to look up
diff --git a/test/dm/test-fdt.c b/test/dm/test-fdt.c
index d8e94d8..7980a68 100644
--- a/test/dm/test-fdt.c
+++ b/test/dm/test-fdt.c
@@ -215,3 +215,33 @@ static int dm_test_fdt_uclass_seq(struct dm_test_state 
*dms)
return 0;
 }
 DM_TEST(dm_test_fdt_uclass_seq, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
+
+/* Test that we can find a device by device tree offset */
+static int dm_test_fdt_offset(struct dm_test_state *dms)
+{
+   const void *blob = gd-fdt_blob;
+   struct udevice *dev;
+   int node;
+
+   node = fdt_path_offset(blob, /e-test);
+   ut_assert(node  0);
+   ut_assertok(uclass_get_device_by_of_offset(UCLASS_TEST_FDT, node,
+  dev));
+   ut_asserteq_str(e-test, dev-name);
+
+   /* This node should not be bound */
+   node = fdt_path_offset(blob, /junk);
+   ut_assert(node  0);
+   ut_asserteq(-ENODEV, uclass_get_device_by_of_offset(UCLASS_TEST_FDT,
+   node, dev));
+
+   /* This is not a top level node so should not be probed */
+   node = fdt_path_offset(blob, /some-bus/c-test);
+   ut_assert(node  0);
+   ut_asserteq(-ENODEV, 

Re: [U-Boot] [PATCH 3/3] ahci: provide sunxi SATA driver using AHCI platform framework

2014-07-23 Thread Tom Rini
On Wed, Jul 23, 2014 at 07:59:17AM +0100, Ian Campbell wrote:
 On Tue, 2014-07-22 at 18:01 -0400, Tom Rini wrote:
  On Fri, Jul 18, 2014 at 08:38:41PM +0100, Ian Campbell wrote:
  
   This enables the necessary clocks, in AHB0 and in PLL6_CFG. This is done
   for sun7i only since I don't have access to any other sunxi platforms
   with sata included.
   
   The PHY setup is derived from the Alwinner releases and Linux, but is 
   mostly
   undocumented.
   
   The Allwinner AHCI controller also requires some magic (and, again,
   undocumented) DMA initialisation when starting a port.  This is added 
   under a
   suitable ifdef.
   
   This option is enabled for Cubieboard, Cubieboard2 and Cubietruck based on
   contents of Linux DTS files, including SATA power pin config taken from 
   the
   DTS. All build tested, but runtime tested on Cubieboard2 and Cubietruck 
   only.
   
   Signed-off-by: Ian Campbell i...@hellion.org.uk
  
  Note that this may need rebasing as I was just going to grab it as part
  of the rest of the series but it did not apply cleanly.
 
 Sorry, it applies on top of the outstanding u-boot-arm PR from
 http://patchwork.ozlabs.org/patch/371704/.
 
 Shall we take care of it in another PR from u-boot-sunxi once Albert is
 back and caught up?

Or just supersed your current PR for him.

-- 
Tom


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


Re: [U-Boot] [linux-sunxi] Re: [PATCH 3/3] ahci: provide sunxi SATA driver using AHCI platform framework

2014-07-23 Thread Ian Campbell
On Wed, 2014-07-23 at 09:04 -0400, Tom Rini wrote:
 On Wed, Jul 23, 2014 at 07:59:17AM +0100, Ian Campbell wrote:
  On Tue, 2014-07-22 at 18:01 -0400, Tom Rini wrote:
   On Fri, Jul 18, 2014 at 08:38:41PM +0100, Ian Campbell wrote:
   
This enables the necessary clocks, in AHB0 and in PLL6_CFG. This is done
for sun7i only since I don't have access to any other sunxi platforms
with sata included.

The PHY setup is derived from the Alwinner releases and Linux, but is 
mostly
undocumented.

The Allwinner AHCI controller also requires some magic (and, again,
undocumented) DMA initialisation when starting a port.  This is added 
under a
suitable ifdef.

This option is enabled for Cubieboard, Cubieboard2 and Cubietruck based 
on
contents of Linux DTS files, including SATA power pin config taken from 
the
DTS. All build tested, but runtime tested on Cubieboard2 and Cubietruck 
only.

Signed-off-by: Ian Campbell i...@hellion.org.uk
   
   Note that this may need rebasing as I was just going to grab it as part
   of the rest of the series but it did not apply cleanly.
  
  Sorry, it applies on top of the outstanding u-boot-arm PR from
  http://patchwork.ozlabs.org/patch/371704/.
  
  Shall we take care of it in another PR from u-boot-sunxi once Albert is
  back and caught up?
 
 Or just supersed your current PR for him.

The reason I wasn't doing that was that I was thinking that
u-boot-sunxi.git PRs are supposed to be based on u-boot-arm.git not
u-boot.git, so until Albert gets back and updates there is nothing I can
base it on.

I suppose there is only minimal harm in basing a PR on u-boot.git
though.

Ian.

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


Re: [U-Boot] [PATCH v3 2/9] arm: Set up global data before board_init_f()

2014-07-23 Thread Tom Rini
On Wed, Jul 23, 2014 at 06:16:52AM -0600, Simon Glass wrote:
 +Albert, Tom
 
 Hi Albert,
 
 On 11 July 2014 11:44, Jeroen Hofstee dasub...@myspectrum.nl wrote:
  Hello Simon,
 
 
  On 11-07-14 06:23, Simon Glass wrote:
 
  At present arm defines CONFIG_SYS_GENERIC_GLOBAL_DATA, meaning that
  the global_data pointer is set up in board_init_f(). However it is
  actually set up before this, it just isn't zeroed.
 
  If we zero the global data before calling board_init_f() then we
  don't need to define CONFIG_SYS_GENERIC_GLOBAL_DATA.
 
  Make this change (on arm32 only) to simplify the init process. I
  don't have the ability to test aarch64 yet.
 
  Signed-off-by: Simon Glass s...@chromium.org
  ---
 
  Changes in v3:
  - Fix assembler code comment in crt0.S to say GD, not BSS
  - Ensure that aarch64 stays as it was
  - Add newline after clr_gd label
  - Remove redundant mov r0, #0
 
 Are you happy with this patch? I would like to apply to to the dm
 repo, but would quite like to get an ack first.

Acked-by: Tom Rini tr...@ti.com

But still want Albert to chime in too.  He should be back now :)

 
 
  Changes in v2: None
 
arch/arm/include/asm/config.h | 2 ++
arch/arm/lib/crt0.S   | 9 +
2 files changed, 11 insertions(+)
 
  Looks good to me. I picked up this one instead
  of my memset version.
 
 
  Thanks, Jeroen
 
 Regards,
 Simon
 ___
 U-Boot mailing list
 U-Boot@lists.denx.de
 http://lists.denx.de/mailman/listinfo/u-boot

-- 
Tom


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


Re: [U-Boot] [PATCH] ARM: zynq: Show ECC status on the same line as DRAM size

2014-07-23 Thread Michal Simek
On 07/23/2014 05:35 AM, Masahiro Yamada wrote:
 Hi Michal,
 
 On Thu, 15 May 2014 09:46:02 +0200
 Michal Simek michal.si...@xilinx.com wrote:
 
 Without this patch is DRAM size one line below DRAM:
 which is not nice

 Origin:
 I2C:   ready
 DRAM:  ECC disabled
 1 GiB
 Now running in RAM - U-Boot at: 3ff59000
 MMC:   zynq_sdhci: 0
 
 
 Strange. Memory:  is missing.
 
 
 As far as I tested, Origin should look like:
 
 
 DRAM:  Memory: ECC disabled
 1 GiB

you are right. Not sure why it is not here.

 
 The other parts look good!
 
 
 Tested-by: Masahiro Yamada yamad...@jp.panasonic.com

I have fixed commit message and applied.

Thanks,
Michal



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




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


Re: [U-Boot] [PATCH v3 0/9] Add a pre-relocation malloc() implementation

2014-07-23 Thread Tom Rini
On Wed, Jul 23, 2014 at 06:24:08AM -0600, Simon Glass wrote:
 Hi,
 
 On 14 July 2014 18:16, Simon Glass s...@chromium.org wrote:
  Hi Tom,
 
  On 14 July 2014 16:28, Tom Rini tr...@ti.com wrote:
 
  On Thu, Jul 10, 2014 at 10:23:24PM -0600, Simon Glass wrote:
 
   There has been talk on and off of a pre-relocation malloc() 
   implementation.
   Driver model needs this so that it can work before relocation.
  
   A previous implementation was sent in a v1 series.
  
   This implementation works by allocating space on the stack. The benefit 
   is
   that boards do not need to specify the address of the malloc() area, only
   the size. The down-side is that due to the way board_init_f() is called,
   architecture-specific code needs to be used to allocate the space.
  
   No clever algorithms are used to allocate space, free() is a nop and
   realloc() is not supported. This fits well with the desire to avoid 
   wasting
   space on bucket tables and the hassle of supporting BSS data before
   relocation. We don't expect 'churn' in the pre-relocation case - we just
   want to allocate small amounts of memory temporarily.
  
   After relocation a new malloc() pool is created and the old one is lost,
   although pointers into it will survive the immediate process of 
   relocation.
  
   Implementations are provided for sandbox and arm (32-bit only).
  
   A related change is made to the early init for each arch to make this 
   work.
 
  My concern without a fix right now is how to make use of this in SPL,
  when we're able to move SPL over to using still more generic code rather
  than re-inventing the board_init_{f,r} wheels, in the case where we init
  DRAM.
 
  One option would be to split this new code out into a separate file,
  and have two malloc() implementations:
 
  - big one - falls back to small one pre-relocation
  - small one - used for SPL
 
 I'm thinking of applying this to the dm repo now, except for the arm
 patches where I would like to get Albert's ack (so I'll wait a few
 more days).
 
 Any objections?

I think we'll be OK.  I checked over the callpath again on OMAP parts
and we setup DDR prior to _main (in SPL) so we'll be fine.

-- 
Tom


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


[U-Boot] [GIT PULL] Zynq patches

2014-07-23 Thread Michal Simek
Hi Albert,

please pull these three patches to your tree.
2 of them are for moving to generic board and the last
one is about suppressing warning from out of tree files.

Thanks,
Michal

[u-boot]$ ./tools/buildman/buildman -b zynq zynq -sSed
Summary of 4 commits for 6 boards (6 threads, 2 jobs per thread)
01: Merge branch 'master' of git://git.denx.de/u-boot-i2c
02: ARM: zynq: Enable generic board for Xilinx Zynq
   arm: (for 6/6 boards)  all +1073.7  bss +2.0  data +188.7  rodata -236.3 
 spl/u-boot-spl:all +94.7  spl/u-boot-spl:data +52.0  spl/u-boot-spl:text +42.7 
 text +1119.3
zynq_zc70x :  all +1114  bss +20  data +192  rodata -242  
spl/u-boot-spl:all +116  spl/u-boot-spl:data +52  spl/u-boot-spl:text +64  text 
+1144
zynq_zed   :  all +1086  bss -8  data +192  rodata -242  
spl/u-boot-spl:all +116  spl/u-boot-spl:data +52  spl/u-boot-spl:text +64  text 
+1144
zynq_zc770_xm010:  all +1070  data +188  rodata -242  
spl/u-boot-spl:all +116  spl/u-boot-spl:data +52  spl/u-boot-spl:text +64  text 
+1124
zynq_microzed  :  all +1070  data +188  rodata -242  
spl/u-boot-spl:all +116  spl/u-boot-spl:data +52  spl/u-boot-spl:text +64  text 
+1124
zynq_zc770_xm012:  all +1120  data +188  rodata -208  
spl/u-boot-spl:all +52  spl/u-boot-spl:data +52  text +1140
zynq_zc770_xm013:  all +982  data +184  rodata -242  
spl/u-boot-spl:all +52  spl/u-boot-spl:data +52  text +1040
03: ARM: zynq: Show ECC status on the same line as DRAM size
   arm: (for 6/6 boards)  all -21.3  bss -5.3  rodata -16.0  
spl/u-boot-spl:all -16.7  spl/u-boot-spl:rodata -16.7
zynq_microzed  :  bss +16  rodata -16  spl/u-boot-spl:all -16  
spl/u-boot-spl:rodata -16
zynq_zc770_xm013:  all -16  rodata -16  spl/u-boot-spl:all -18  
spl/u-boot-spl:rodata -18
zynq_zc770_xm012:  all -16  rodata -16  spl/u-boot-spl:all -18  
spl/u-boot-spl:rodata -18
zynq_zc770_xm010:  all -32  bss -16  rodata -16  spl/u-boot-spl:all 
-16  spl/u-boot-spl:rodata -16
zynq_zed   :  all -32  bss -16  rodata -16  spl/u-boot-spl:all 
-16  spl/u-boot-spl:rodata -16
zynq_zc70x :  all -32  bss -16  rodata -16  spl/u-boot-spl:all 
-16  spl/u-boot-spl:rodata -16
04: zynq: disable -Wstrict-prototypes option for ps7_init.c



The following changes since commit 524123a70761110c5cf3ccc5f52f6d4da071b959:

  Prepare v2014.07 (2014-07-14 13:16:45 -0400)

are available in the git repository at:

  git://www.denx.de/git/u-boot-microblaze.git zynq

for you to fetch changes up to 327474915a413be98950deeeba27c3d17e5134bc:

  zynq: disable -Wstrict-prototypes option for ps7_init.c (2014-07-23 15:38:34 
+0200)


Masahiro Yamada (1):
  zynq: disable -Wstrict-prototypes option for ps7_init.c

Michal Simek (2):
  ARM: zynq: Enable generic board for Xilinx Zynq
  ARM: zynq: Show ECC status on the same line as DRAM size

 arch/arm/cpu/armv7/zynq/ddrc.c | 4 ++--
 board/xilinx/zynq/Makefile | 3 +++
 include/configs/zynq-common.h  | 2 ++
 3 files changed, 7 insertions(+), 2 deletions(-)

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




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


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

2014-07-23 Thread Michal Simek
Hi Masahiro,

On 07/23/2014 05:40 AM, Masahiro Yamada wrote:
 Hi Michal,
 
 
 Could you apply this one along with your other zynq patches ?
 
 
 
 And please clean-up noise on patchwork.
 http://patchwork.ozlabs.org/patch/347047/
 http://patchwork.ozlabs.org/patch/355816/

I have clean status on these one + fpga patches which have been
applied.

Thanks,
Michal


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




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


Re: [U-Boot] ODROID dynamic memory initialization

2014-07-23 Thread Przemyslaw Marczak

Hi Daniel,

On 07/23/2014 02:27 PM, Daniel Drake wrote:

On Tue, Jul 22, 2014 at 2:08 PM, Daniel Drake dr...@endlessm.com wrote:

While looking at the old uboot from hardkernel, I'm curious about
CONFIG_CLK_BUS_DMC_220_440, which is set by default. This appears to
run the memory at a high speed, by writing certain registers in the
Dynamic Memory Controller (e.g. TIMINGROW), and clocking MPLL to
880MHz.

Your uboot patches don't seem to touch DMC regs like TIMINGROW, and
also clock the MPLL at 800MHz.


I used my private config from trats2 device, but there is Exynos4412 
rev. 1.1 - DMC freq is 400MHz.

I need to check the 880Mhz value for the MPLL and I will give you an info.



I looked in more detail, and now understand better the SPL vs uboot division.

The vendor code I was referring to above is SPL code.

Since we are still using the same SPL as before, it means that MPLL
and memory is already set up by the time the real/new uboot loads.

So I think there should be no need to modify MPLL, and I wonder if
most of the other clock configuration code in your patches is also
unnecessary.

Thoughts?

Thanks
Daniel



The BL2 is not a part of this patches, then maybe better is to configure 
the clocks for proper values by u-boot, moreover when I
disable the clock configuration in u-boot then it can't boot - probably 
because of bad uart config and maybe some more.


Thank you for testing this code, but I don't have too much time for play 
with this config now.


I will test the MPLL with 880MHz tomorrow and it should be good enough, 
but next if dev freq will be enabled in the kernel - then probably DMC 
dividers will change without TIMINGROW change.


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


Re: [U-Boot] enabling ecc on P2041 and QoreIQ familly not valid for memory = 4GB

2014-07-23 Thread York Sun
Benoit,

If your interest is in initializing DDR for ECC, you don't have use
dma_meminit(). There is a better and faster way to do so. All Freescale modern
DDR controllers support this feature. All you have to do is to define these 
macros

CONFIG_DDR_ECC
CONFIG_ECC_INIT_VIA_DDRCONTROLLER
CONFIG_MEM_INIT_VALUE

There are plenty of example for you to follow.

But again, we should fix the DMA function anyway.

York


On 07/23/2014 12:21 AM, Benoit Sansoni wrote:
 Hi York,
 
 That what I saw in the code.
 
 Also to test it you need to have the hardware, but the evaluation board 
 P2041rdb for example does not have some ECC signals rooted for DIMM slot.
 I validated the patch that I sent on a board based on P2041 with 8GB of 
 memory. Obviously it works with 2GB and 4GB.
 
 If you need help, you are welcome.
 
 Thanks for your help
 Benoit
 
 On 07/23/2014 12:53 AM, York Sun wrote:
 On 07/18/2014 06:11 AM, Benoit Sansoni wrote:
 Hi ,

 I found out an issue when enabling ECC for P2041 platform with an amount
 of memory of 8GB.
 The routine void dma_meminit(uint val, uint size) is not adapted to
 manage memory size greater or equal to 4GB due to the 'uint' type.
 With this typing the dma_meminit sees 0 as size when memory is for
 example at 8GB. So the ECC part of the memory is not initialized and
 when going in memory the code crash.
 To correct it you need to use phys_size_t type instead of uint.
 It is the same thing for all routines that are called by dma_meminit.
 I attached a patch that able to correct it easily.
 This patch should be integrated in the main branch I think so.

 Regards,
 Benoit

 This is a valid concern. Some code started when we had far less memory. We 
 need
 to comb through the code to fix more of them.

 York


 
 

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


[U-Boot] dfu download issue with ci_udc

2014-07-23 Thread S Durga Prasad Paladugu
Hi,

I am trying to download the file from dfu-utilities(version 0.7) and using
the ci_udc at device side. After all the data was sent from the host, the
dfu utilities sent the zpl packet but at the device side the dfu_write is
not getting invoked for zero packet length and hence causing the data not
to be copied to actual interface(ram/mmc/nand). I pasted here the debug log
for the zpl for reference.


*handle setup CLEAR_FEATURE, 21, 1 index 0 value 3 length 0*
*handle_setup: Set ep0 to OUT for Data Stage*
*handle_setup: 0 length: flip ep0 dir for Status Stage*
*flip_ep0_direction: Flipping ep0 to IN*
*non-core control req21.01 v0003 i l0*
*w_value: 0x3 len: 0x0*
*req_type: 0x20 ctrl-bRequest: 0x1 f_dfu-dfu_state: 0x5*
*ept0 in pre-queue req 3f5284a8, buffer 3f528580*
*ept0 in queue len 0, req 3f5284a8, buffer 3f528580*
*ept0 in req 3f5284a8, complete 0*


 My question here is does any one has tested the dfu download using ci_udc
and what could be reason for this behavior?

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


Re: [U-Boot] [PATCH 01/12] sunxi: mksunxiboot: Fix loading of files with a size which is not a multiple of 4

2014-07-23 Thread Siarhei Siamashka
On Fri, 30 May 2014 10:19:16 +0100
Ian Campbell i...@hellion.org.uk wrote:

 On Fri, 2014-05-30 at 11:06 +0200, Hans de Goede wrote:
  We should not be aligning the amount of bytes which we try to read from the
  disk, this leads to trying to read more bytes then there are which fails.
  
  file_size is already aligned to BLOCK_SIZE before being stored in
  img.header.length, so there is no need for load_size at all.
  
  Signed-off-by: Hans de Goede hdego...@redhat.com
 
 Acked-by: Ian Campbell i...@hellion.org.uk

Acked-by: Siarhei Siamashka siarhei.siamas...@gmail.com

Was there any valid reason why this important bugfix has not been
nominated for v2014.07?

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


Re: [U-Boot] [PATCH v3 03/10] sunxi: Remove mmc DMA support

2014-07-23 Thread Siarhei Siamashka
On Mon,  9 Jun 2014 11:36:55 +0200
Hans de Goede hdego...@redhat.com wrote:

 The DMA code in sunxi_mmc.c is broken. mmc_trans_data_by_dma() allocates the
 dma descriptors on the stack, and then exits while the dma transfer is in
 progress, so the dma engine is reading stack memory which at that point may
 be re-used. So far we've gotten away with this by luck, but recent u-boot
 changes have shifted the stack start address by 16 bytes, which combined
 with dma alignment now exposes this problem.
 
 Since we end up just busy waiting for the dma engine anyway, this commit
 fixes things by simply removing the dma code, resulting in smaller bug-free
 code.
 
 Signed-off-by: Hans de Goede hdego...@redhat.com
 Acked-by: Ian Campbell i...@hellion.org.uk

Acked-by: Siarhei Siamashka siarhei.siamas...@gmail.com

Was it a good idea to keep v2014.07 release relying on luck without
this patch?

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


Re: [U-Boot] [PATCH 01/12] sunxi: mksunxiboot: Fix loading of files with a size which is not a multiple of 4

2014-07-23 Thread Ian Campbell
On Wed, 2014-07-23 at 20:29 +0300, Siarhei Siamashka wrote:
 On Fri, 30 May 2014 10:19:16 +0100
 Ian Campbell i...@hellion.org.uk wrote:
 
  On Fri, 2014-05-30 at 11:06 +0200, Hans de Goede wrote:
   We should not be aligning the amount of bytes which we try to read from 
   the
   disk, this leads to trying to read more bytes then there are which fails.
   
   file_size is already aligned to BLOCK_SIZE before being stored in
   img.header.length, so there is no need for load_size at all.
   
   Signed-off-by: Hans de Goede hdego...@redhat.com
  
  Acked-by: Ian Campbell i...@hellion.org.uk
 
 Acked-by: Siarhei Siamashka siarhei.siamas...@gmail.com
 
 Was there any valid reason why this important bugfix has not been
 nominated for v2014.07?

Not sure what you mean, it is part of the PR at
http://patchwork.ozlabs.org/patch/371704/

Ian.


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


Re: [U-Boot] [PATCH v3 04/10] sunxi: Implement reset_cpu

2014-07-23 Thread Siarhei Siamashka
On Mon,  9 Jun 2014 11:36:56 +0200
Hans de Goede hdego...@redhat.com wrote:

 There is no way to reset the cpu, so use the watchdog for this.
 
 Signed-off-by: Hans de Goede hdego...@redhat.com
 Acked-by: Ian Campbell i...@hellion.org.uk

Acked-by: Siarhei Siamashka siarhei.siamas...@gmail.com

However shouldn't this be squashed with
   http://patchwork.ozlabs.org/patch/359692/ ?

Otherwise there is a range of commits, where reset is
broken on sun5i hardware in the middle of the patch set.

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


Re: [U-Boot] [PATCH v3 05/10] sunxi: Add sun4i support

2014-07-23 Thread Siarhei Siamashka
On Mon,  9 Jun 2014 11:36:57 +0200
Hans de Goede hdego...@redhat.com wrote:

 Add support for the Allwinner A10 SoC also known as the Allwinner sun4i 
 family,
 and add the Cubieboard board which uses the A10 SoC.
 
 Compared to sun7 only the DRAM controller is a bit different:
 -Controller reset bits are inverted, but only for Rev. A
 -Different hpcr values
 -No MBUS on sun4i
 -Various other initialization changes
 
 Signed-off-by: Henrik Nordstrom hen...@henriknordstrom.net
 Signed-off-by: Stefan Roese s...@denx.de
 Signed-off-by: Oliver Schinagl oli...@schinagl.nl
 Signed-off-by: Hans de Goede hdego...@redhat.com
 Acked-by: Ian Campbell i...@hellion.org.uk

 ---
  arch/arm/cpu/armv7/sunxi/Makefile   |  2 +
  arch/arm/cpu/armv7/sunxi/cpu_info.c |  7 
  arch/arm/cpu/armv7/sunxi/dram.c | 81 
 +++--
  board/sunxi/Makefile|  1 +
  board/sunxi/dram_cubieboard.c   | 31 ++
  boards.cfg  |  1 +
  include/configs/sun4i.h | 23 +++
  7 files changed, 143 insertions(+), 3 deletions(-)
  create mode 100644 board/sunxi/dram_cubieboard.c
  create mode 100644 include/configs/sun4i.h

This patch is piling up a lot of various loosely related changes.
Isn't the addition of Cubieboard to boards.cfg kind of orthogonal
to the sun4i SoC variant support? This makes cherry picking or
reverting the patch unnecessarily difficult.

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


Re: [U-Boot] [PATCH v3 06/10] sunxi: Add sun5i support

2014-07-23 Thread Siarhei Siamashka
On Mon,  9 Jun 2014 11:36:58 +0200
Hans de Goede hdego...@redhat.com wrote:

 Add support for the Allwinner A13 and A10s SoCs also know as the Allwinner
 sun5i family, and the A13-OLinuXinoM A13 based and r7-tv-dongle A10s based
 boards.
 
 The only differences compared to the already supported sun4i and sun7i
 families are all in the DRAM controller initialization:
 
 -Different hcpr values
 -Different MBUS settings
 -Some other small initialization changes
 
 Signed-off-by: Henrik Nordstrom hen...@henriknordstrom.net
 Signed-off-by: Stefan Roese s...@denx.de
 Signed-off-by: Oliver Schinagl oli...@schinagl.nl
 Signed-off-by: Hans de Goede hdego...@redhat.com
 Acked-by: Ian Campbell i...@hellion.org.uk
 ---
  arch/arm/cpu/armv7/sunxi/Makefile   |  2 ++
  arch/arm/cpu/armv7/sunxi/board.c| 12 
  arch/arm/cpu/armv7/sunxi/cpu_info.c |  8 
  arch/arm/cpu/armv7/sunxi/dram.c | 21 +
  board/sunxi/Makefile|  2 ++
  board/sunxi/dram_a13_oli_micro.c| 32 
  board/sunxi/dram_r7dongle.c | 31 +++
  boards.cfg  |  2 ++
  include/configs/sun5i.h | 23 +++
  include/configs/sunxi-common.h  |  2 ++
  10 files changed, 135 insertions(+)
  create mode 100644 board/sunxi/dram_a13_oli_micro.c
  create mode 100644 board/sunxi/dram_r7dongle.c
  create mode 100644 include/configs/sun5i.h

Even if there is a valid reason to bundle the addition of some example
sun5i based board to boards.cfg with the changes needed for sun5i SoC
variant, why is it *two* boards this time?

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


Re: [U-Boot] [PATCH] Makefile: use $(shell ...) for determining file_size

2014-07-23 Thread Tom Rini
On Wed, Jul 23, 2014 at 04:27:36AM -0600, Simon Glass wrote:
 On 22 July 2014 18:08, Chris Packham judge.pack...@gmail.com wrote:
  file_size was being calculated using back-ticks but map_size uses
  $(shell ...). Update the file_size calculation to use $(shell ...).
 
  Signed-off-by: Chris Packham judge.pack...@gmail.com
 
 Acked-by: Simon Glass s...@chromium.org
 
 But you might want to look at this.
 
 http://patchwork.ozlabs.org/patch/371936/

Yeah, Jeroen, can we get a v2 of your patch that uses $(shell ... )?
Thanks!

-- 
Tom


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


Re: [U-Boot] [PATCH v3 07/10] net: Rename and cleanup sunxi (Allwinner) emac driver

2014-07-23 Thread Siarhei Siamashka
On Mon,  9 Jun 2014 11:36:59 +0200
Hans de Goede hdego...@redhat.com wrote:

 From: Stefan Roese s...@denx.de
 
 There have been 3 versions of the sunxi_emac support patch during its
 development. Somehow version 2 ended up in upstream u-boot where as
 the u-boot-sunxi git repo got version 3.
 
 This bumps the version in upstream u-boot to version 3 of the patch:
 - Initialize MII clock earlier so mii access to allow independent use
 - Name change from WEMAC to EMAC to match mainline kernel  chip manual
 - Cosmetic code cleanup
 
 Signed-off-by: Stefan Roese s...@denx.de
 Signed-off-by: Henrik Nordstrom hen...@henriknordstrom.net
 Signed-off-by: Oliver Schinagl oli...@schinagl.nl
 Signed-off-by: Hans de Goede hdego...@redhat.com
 Acked-by: Ian Campbell i...@hellion.org.uk

Shouldn't the cosmetic and functional changes be normally split into
separate patches? Indeed, it looks like the move of

+   /* Set MII clock */
+   clrsetbits_le32(regs-mac_mcfg, 0xf  2, 0xd  2);

is the only functional change in this rather large patch.

And could you please elaborate on

 - Initialize MII clock earlier so mii access to allow independent use

was this causing any user visible problems?

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


Re: [U-Boot] [GIT] Pull request: u-boot-dfu

2014-07-23 Thread Marek Vasut
On Wednesday, July 16, 2014 at 09:18:56 AM, Lukasz Majewski wrote:
 Dear Marek,
 
 The following changes since commit
 5ba95541b700d2edecb4d97d4b905f51ed8551b3:
 
   usb: phy: omap_usb_phy: implement usb_phy_power() for AM437x
   (2014-07-09 22:11:51 +0200)
 
 are available in the git repository at:
 
   ssh://gu-...@git.denx.de/u-boot-dfu/master
 
 for you to fetch changes up to 24b109300c6e6a35792bc804846d7753baba7a69:
 
   dfu: fix readback buffer overflow test (2014-07-16 08:47:01 +0200)

Fixed up one merge conflict and applied, 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 v3 08/10] sunxi: Add emac glue, enable emac on the cubieboard

2014-07-23 Thread Siarhei Siamashka
On Mon,  9 Jun 2014 11:37:00 +0200
Hans de Goede hdego...@redhat.com wrote:

 Signed-off-by: Hans de Goede hdego...@redhat.com
 Acked-by: Ian Campbell i...@hellion.org.uk
 ---
  arch/arm/cpu/armv7/sunxi/board.c | 8 
  boards.cfg   | 2 +-
  include/configs/sunxi-common.h   | 5 +
  3 files changed, 14 insertions(+), 1 deletion(-)

Again, this may be not a valid reason to complain (sorry if this is
the case), but combining generic sunxi code changes in sunxi/board.c
with the individual board support tweaks in boards.cfg is rather
cherry-pick/revert unfriendly.

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


Re: [U-Boot] [PATCH v3 09/10] sunxi: Add support for using MII phy-s with the GMAC nic

2014-07-23 Thread Siarhei Siamashka
On Mon,  9 Jun 2014 11:37:01 +0200
Hans de Goede hdego...@redhat.com wrote:

 From: Chen-Yu Tsai w...@csie.org
 
 Many A20 boards (ie Cubieboard2, A20-OLinuXino_MICRO) use an 100 Mbit MII
 phy together with the GMAC nic found in the A20 SoC, add support for this
 (this will get used when we add these boards in a later patch).
 
 Signed-off-by: Chen-Yu Tsai w...@csie.org
 Signed-off-by: Hans de Goede hdego...@redhat.com
 Acked-by: Ian Campbell i...@hellion.org.uk

Acked-by: Siarhei Siamashka siarhei.siamas...@gmail.com

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


Re: [U-Boot] [PATCH 01/12] sunxi: mksunxiboot: Fix loading of files with a size which is not a multiple of 4

2014-07-23 Thread Ian Campbell
On Wed, 2014-07-23 at 18:40 +0100, Ian Campbell wrote:
 On Wed, 2014-07-23 at 20:29 +0300, Siarhei Siamashka wrote:
  On Fri, 30 May 2014 10:19:16 +0100
  Ian Campbell i...@hellion.org.uk wrote:
  
   On Fri, 2014-05-30 at 11:06 +0200, Hans de Goede wrote:
We should not be aligning the amount of bytes which we try to read from 
the
disk, this leads to trying to read more bytes then there are which 
fails.

file_size is already aligned to BLOCK_SIZE before being stored in
img.header.length, so there is no need for load_size at all.

Signed-off-by: Hans de Goede hdego...@redhat.com
   
   Acked-by: Ian Campbell i...@hellion.org.uk
  
  Acked-by: Siarhei Siamashka siarhei.siamas...@gmail.com
  
  Was there any valid reason why this important bugfix has not been
  nominated for v2014.07?
 
 Not sure what you mean, it is part of the PR at
 http://patchwork.ozlabs.org/patch/371704/

Oh, you said .07 which was the last one.

There was no particular reason, it just didn't make it. We were still
figuring out the upstream work flow at the time.

Ian.

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


Re: [U-Boot] [PATCH v2 3/5] sunxi: Add axp209 pmic support

2014-07-23 Thread Siarhei Siamashka
On Fri, 13 Jun 2014 22:55:50 +0200
Hans de Goede hdego...@redhat.com wrote:

 From: Henrik Nordstrom hen...@henriknordstrom.net
 
 Add support for the x-powers axp209 pmic which is found on most A10, A13 and
 A20 boards.
 
 And enable AXP209 support for the Cubietruck and Cubieboard boards.
 
 While changing the boards.cfg lines for the Cubietruck, add Ian and me as 
 board
 maintainers for the Cubietruck.
 
 Signed-off-by: Henrik Nordstrom hen...@henriknordstrom.net
 Signed-off-by: Hans de Goede hdego...@redhat.com
 Acked-by: Ian Campbell i...@hellion.org.uk
 ---
  board/sunxi/board.c|  22 ++
  boards.cfg |   6 +-
  drivers/power/Makefile |   1 +
  drivers/power/axp209.c | 167 
 +
  include/axp209.h   |  14 
  include/configs/sun4i.h|   1 +
  include/configs/sun5i.h|   1 +
  include/configs/sun7i.h|   1 +
  include/configs/sunxi-common.h |   5 ++
  9 files changed, 215 insertions(+), 3 deletions(-)
  create mode 100644 drivers/power/axp209.c
  create mode 100644 include/axp209.h

The support for AXP209 is needed to provide sufficient dcdc3 voltage
at least for the DRAM controller. The default voltage after reset
(1.2V on the Cubietruck) is too low for operating the DRAM controller
at reasonably high clock speeds. In this sense, the initial Cubietruck
support in u-boot v2014.07 is already buggy, because of the missing
PMIC configuration code. And this explanation in the commit message
would be very nice to have (otherwise one may wonder, why do we even
need the PMIC code in u-boot in the first place?).

The addition of the AXP PMIC support should be perhaps moved to the
beginning of the patch series instead of fixing the voltage problems
after the fact.

And again, this patch is currently rather cherry-picking unfriendly.
So even if I wanted to reorder the patches to trivially address the
problem, the interdependencies via the dreaded 'boards.cfg' get in the
way.

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


Re: [U-Boot] [PATCH v2 5/5] sunxi: Fix reset hang on sun5i

2014-07-23 Thread Siarhei Siamashka
On Fri, 13 Jun 2014 22:55:52 +0200
Hans de Goede hdego...@redhat.com wrote:

 Do the same as the Linux kernel does, this fixes the SoC hanging on reset
 about 50% of the time.
 
 Signed-off-by: Hans de Goede hdego...@redhat.com
 Acked-by: Ian Campbell i...@hellion.org.uk
 ---
  arch/arm/cpu/armv7/sunxi/board.c | 6 +-
  1 file changed, 5 insertions(+), 1 deletion(-)
 
 diff --git a/arch/arm/cpu/armv7/sunxi/board.c 
 b/arch/arm/cpu/armv7/sunxi/board.c
 index 024c8c1..2898833 100644
 --- a/arch/arm/cpu/armv7/sunxi/board.c
 +++ b/arch/arm/cpu/armv7/sunxi/board.c
 @@ -75,7 +75,11 @@ void reset_cpu(ulong addr)
   /* Set the watchdog for its shortest interval (.5s) and wait */
   writel(WDT_MODE_RESET_EN | WDT_MODE_EN, wdog-mode);
   writel(WDT_CTRL_KEY | WDT_CTRL_RESTART, wdog-ctl);
 - while (1);
 +
 + while (1) {
 + /* sun5i sometimes gets stuck without this */
 + writel(WDT_MODE_RESET_EN | WDT_MODE_EN, wdog-mode);
 + }
  }
  
  /* do some early init */

This should be perhaps combined with
   http://patchwork.ozlabs.org/patch/357363/ (probably the best place)
or
   http://patchwork.ozlabs.org/patch/357365/ (ugh, too much code there)

in order to have bug free code after every commit instead of fixing
the problem after the fact.

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


Re: [U-Boot] [PATCH] sunxi: use random parts of SID to set ethaddr

2014-07-23 Thread Siarhei Siamashka
On Sat, 14 Jun 2014 10:46:37 +0100
Ian Campbell i...@hellion.org.uk wrote:

 On Sat, 2014-06-14 at 08:59 +0200, Hans de Goede wrote:
  From: Jonathan Liu net...@gmail.com
  
  Similar to the USB NIC found on OMAP5uEVM, PandaBoard and BeagleBoard-XM
  boards, the sunxi SoCs have a NIC onboard without an embedded MAC address.
  
  Just like the omap used on these boards, the sunxi SoCs do have a unique 
  chip
  id, in the form of the 128 bit SID register:
  http://linux-sunxi.org/SID_Register_Guide
  
  So mimick the BeagleBoard-XM board code (commit 548a64d8) and use the chip 
  id
  to generate a unique fixed MAC address.
  
  We check for the SID not being all 0, since some early A20 batches
  shipped without having there SID programmed.
  
  Note we use specific parts of the 128 bits, since some parts indicate the
  SoC family / revision, and thus are fixed. The algorithm for this was taken
  from the linux-sunxi.org kernels.
  
  Signed-off-by: Jonathan Liu net...@gmail.com
  [hdego...@redhat.com: Expanded the commit message with some more info]
  Signed-off-by: Hans de Goede hdego...@redhat.com
 
 Acked-by: Ian Campbell i...@hellion.org.uk

Acked-by: Siarhei Siamashka siarhei.siamas...@gmail.com

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


Re: [U-Boot] [PATCH] Makefile: use $(shell ...) for determining file_size

2014-07-23 Thread Jeroen Hofstee

Hi,

On 23-07-14 20:03, Tom Rini wrote:

On Wed, Jul 23, 2014 at 04:27:36AM -0600, Simon Glass wrote:

On 22 July 2014 18:08, Chris Packham judge.pack...@gmail.com wrote:

file_size was being calculated using back-ticks but map_size uses
$(shell ...). Update the file_size calculation to use $(shell ...).

Signed-off-by: Chris Packham judge.pack...@gmail.com

Acked-by: Simon Glass s...@chromium.org

But you might want to look at this.

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

Yeah, Jeroen, can we get a v2 of your patch that uses $(shell ... )?
Thanks!



no problem. For the record I have not seen any issues with
mentioned gmake version. But using $(shell .. ) seem like a sane
thing to do. v2 is on its way, running MAKEALL for arm (can we keep it?).

Chris: blackfin targets seem to rely on the same construct btw...

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


[U-Boot] [PATCH v2] Makefile: fix binary_size_check target

2014-07-23 Thread Jeroen Hofstee
first issue replace stat -c %s with wc:
The binary_size_check target relies on stat -c %s to return the size
of u-boot.bin. This only works with GNU stat though. Use wc instead.

Second issue as reported by chris Packham:
file_size was being calculated using back-ticks but map_size uses
$(shell ...). Update the file_size calculation to use $(shell ...).

cc: Simon Glass s...@chromium.org
Signed-off-by: Jeroen Hofstee jer...@myspectrum.nl
Signed-off-by: Chris Packham judge.pack...@gmail.com
---
Chris Packham:
The back ticks didn't work in my environment (GNU Make 3.81). Updating
to use $(shell ...) makes sense from a consistency view even if the
problem is my environment.

changes since v1:
use $(shell ...) as submitted by Chris Packham
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index ca212b5..1156133 100644
--- a/Makefile
+++ b/Makefile
@@ -786,7 +786,7 @@ u-boot.hex u-boot.srec: u-boot FORCE
 OBJCOPYFLAGS_u-boot.bin := -O binary
 
 binary_size_check: u-boot.bin System.map FORCE
-   @file_size=`stat -c %s u-boot.bin` ; \
+   file_size=$(shell wc -c u-boot.bin | awk '{print $$1}') ; \
map_size=$(shell cat System.map | \
awk '/_image_copy_start/ {start = $$1} /_image_binary_end/ {end 
= $$1} END {if (start !=   end != ) print ibase=16;  toupper(end)  -  
toupper(start)}' \
| bc); \
-- 
1.9.1

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


Re: [U-Boot] [PATCH] Makefile: use $(shell ...) for determining file_size

2014-07-23 Thread Tom Rini
On Wed, Jul 23, 2014 at 09:24:00PM +0200, Jeroen Hofstee wrote:
 Hi,
 
 On 23-07-14 20:03, Tom Rini wrote:
 On Wed, Jul 23, 2014 at 04:27:36AM -0600, Simon Glass wrote:
 On 22 July 2014 18:08, Chris Packham judge.pack...@gmail.com wrote:
 file_size was being calculated using back-ticks but map_size uses
 $(shell ...). Update the file_size calculation to use $(shell ...).
 
 Signed-off-by: Chris Packham judge.pack...@gmail.com
 Acked-by: Simon Glass s...@chromium.org
 
 But you might want to look at this.
 
 http://patchwork.ozlabs.org/patch/371936/
 Yeah, Jeroen, can we get a v2 of your patch that uses $(shell ... )?
 Thanks!
 
 
 no problem. For the record I have not seen any issues with
 mentioned gmake version. But using $(shell .. ) seem like a sane
 thing to do. v2 is on its way, running MAKEALL for arm (can we keep it?).

MAKEALL isn't going away for v2014.10 but please reply to Simon's RFC
about it.  I do have to admit that switching all of my stuff to buildman
is still on my TODO list.

-- 
Tom


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


[U-Boot] Please pull u-boot-mpc85xx master

2014-07-23 Thread York Sun
Tom,

The following changes since commit fbe79a17fddb7f0b11aa15b9c93e9a4a26165ed8:

  m68k: define __kernel_size_t as unsinged int again (2014-07-22 09:46:50 -0400)

are available in the git repository at:

  git://git.denx.de/u-boot-mpc85xx.git master

for you to fetch changes up to fb5368789a45ca5ee4396cbbf563a8f16ab24f9c:

  board/freescale: use generic board architecture for t2080qds and t2080rdb
(2014-07-23 12:40:30 -0700)


Lijun Pan (1):
  powerpc/mpc85xx: Remove P1023 RDS support

Prabhakar Kushwaha (3):
  driver/nand:Define MAX_BANKS same as SoC defined for IFC
  driver/nand: Update SRAM initialize logic for IFC.
  driver/nand: Add support of 16K SRAM for IFC 2.0

Rotariu Marian-Cristian (1):
  net/fm: call fm_port_to_index() with proper checks

Sandeep Singh (1):
  powerpc/mpc85xx: Removed support for G4060

Shaohui Xie (2):
  powerpc/ifc: fix invalid CSn FTIM2.TCH setting
  powerpc/t4240qds: fix offset of serdes when checking reference clock

Shaveta Leekha (1):
  powerpc/chassis2: Configure and enable L2 cache for PPC clusters only

Shengzhou Liu (4):
  powerpc/85xx: add fdt_fixup_dma3
  board/t2080qds: enable sst and eon spi flash for nor boot
  powerpc/t1040: update i2c for t1040qds and t104xrdb
  board/freescale: use generic board architecture for t2080qds and t2080rdb

Tang Yuantian (1):
  mpc85xx/t104x: Enable L2 and CPC cache when resume

York Sun (3):
  driver/ddr: Fix DDR4 driver for ARM
  powerpc/mpc85xx: Check return value of find_tlb_idx
  driver/ddr: Fix DDR register timing_cfg_8

Zang Roy-R61911 (1):
  fsl/pcie: Change 'no link' to 'undetermined' for pcie endpoint

Zhao Qiang (1):
  qe: move immap_qe.h from arch directory into common directory

vijay rai (1):
  powerpc/t1040qds: Initialize EPHY2 clock to RGMII only

 arch/arm/include/asm/arch-fsl-lsch3/config.h   |4 +
 arch/arm/include/asm/io.h  |1 +
 arch/powerpc/cpu/mpc83xx/cpu.c |2 +-
 arch/powerpc/cpu/mpc83xx/fdt.c |2 +-
 arch/powerpc/cpu/mpc85xx/cpu_init.c|  166 +++
 arch/powerpc/cpu/mpc85xx/fdt.c |   47 ++
 arch/powerpc/cpu/mpc8xxx/cpu.c |1 -
 arch/powerpc/include/asm/cache.h   |6 +
 arch/powerpc/include/asm/immap_85xx.h  |6 +
 arch/powerpc/include/asm/io.h  |3 +
 arch/powerpc/include/asm/processor.h   |1 -
 arch/powerpc/lib/board.c   |5 +
 board/exmeritus/hww1u1a/hww1u1a.c  |   12 +-
 board/freescale/b4860qds/b4860qds.c|   12 +-
 board/freescale/bsc9132qds/bsc9132qds.c|   12 +-
 board/freescale/c29xpcie/c29xpcie.c|   12 +-
 board/freescale/corenet_ds/corenet_ds.c|   12 +-
 board/freescale/mpc8536ds/mpc8536ds.c  |   12 +-
 board/freescale/mpc8572ds/mpc8572ds.c  |   12 +-
 board/freescale/p1010rdb/p1010rdb.c|   12 +-
 board/freescale/p1022ds/p1022ds.c  |   12 +-
 board/freescale/p1023rdb/p1023rdb.c|   12 +-
 board/freescale/p1023rds/Makefile  |9 -
 board/freescale/p1023rds/README|  101 -
 board/freescale/p1023rds/bcsr.h|   49 --
 board/freescale/p1023rds/law.c |   19 -
 board/freescale/p1023rds/p1023rds.c|  191 
 board/freescale/p1023rds/tlb.c |  100 
 board/freescale/p1_p2_rdb/p1_p2_rdb.c  |   12 +-
 board/freescale/p1_p2_rdb_pc/p1_p2_rdb_pc.c|   12 +-
 board/freescale/p1_twr/p1_twr.c|   12 +-
 board/freescale/p2020ds/p2020ds.c  |   12 +-
 board/freescale/p2041rdb/p2041rdb.c|   12 +-
 board/freescale/t1040qds/eth.c |4 +-
 board/freescale/t1040qds/t1040qds.c|   12 +-
 board/freescale/t1040qds/t1040qds_qixis.h  |4 +
 board/freescale/t104xrdb/t104xrdb.c|   12 +-
 board/freescale/t208xqds/t208xqds.c|   12 +-
 board/freescale/t208xrdb/t208xrdb.c|   13 +-
 board/freescale/t4qds/t4240emu.c   |   12 +-
 board/freescale/t4qds/t4240qds.c   |   22 +-
 board/freescale/t4rdb/t4240rdb.c   |   12 +-
 boards.cfg |1 -
 drivers/bootcount/bootcount.c  |2 +-
 drivers/ddr/fsl/ctrl_regs.c|3 +
 drivers/ddr/fsl/fsl_ddr_gen4.c |7 +-
 drivers/mtd/nand/fsl_ifc_nand.c|   45 +-
 drivers/mtd/nand/fsl_ifc_spl.c |6 +-
 drivers/net/fm/fm.h|3 +-
 drivers/net/fm/init.c 

Re: [U-Boot] dfu download issue with ci_udc

2014-07-23 Thread Wolfgang Denk
Dear S Durga Prasad Paladugu,

In message 
CAAhU36hRQ_AgOR6bodRz-8pcLb2hkVW-ztrKVX48yFkcEWS=h...@mail.gmail.com you 
wrote:

 I am trying to download the file from dfu-utilities(version 0.7) and using
 the ci_udc at device side. After all the data was sent from the host, the
...

What is your exact U-Boot verosion (git commit ID), and which exact
board are you testing on?

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 day without sunshine is like night.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 5/9] kmp204x: CPU watchdog enabled

2014-07-23 Thread York Sun
Rainer,

Did you get a chance to fix your patch?

York


On 07/18/2014 03:21 PM, York Sun wrote:
 Rainer,
 
 Once this patch is enabled, we have
 
 warning: implicit declaration of function 'init_85xx_watchdog'
 [-Wimplicit-function-declaration]
 
 Please fix.
 
 York
 
 
 On 06/03/2014 12:05 AM, Rainer Boschung wrote:
 The booting of the board is now protected by the CPU watchdog.
 A failure during the boot phase will end up in board reset.

 Signed-off-by: Rainer Boschung rainer.bosch...@keymile.com
 ---
  include/configs/km/kmp204x-common.h | 8 
  1 file changed, 8 insertions(+)

 diff --git a/include/configs/km/kmp204x-common.h 
 b/include/configs/km/kmp204x-common.h
 index efd9635..a0f9d29 100644
 --- a/include/configs/km/kmp204x-common.h
 +++ b/include/configs/km/kmp204x-common.h
 @@ -377,6 +377,14 @@ int get_scl(void);
  #define CONFIG_SYS_LOADS_BAUD_CHANGE/* allow baudrate change */
  
  /*
 + * Hardware Watchdog
 + */
 +#define CONFIG_WATCHDOG /* enable CPU watchdog */
 +#define CONFIG_WATCHDOG_PRESC 34/* wdog prescaler 2^(64-34) (~10min) */
 +#define CONFIG_WATCHDOG_RC WRC_CHIP /* reset chip on watchdog event */
 +
 +
 +/*
   * additionnal command line configuration.
   */
  #define CONFIG_CMD_PCI

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

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


Re: [U-Boot] [PATCH] pxe: clear Bootfile before returning

2014-07-23 Thread Joe Hershberger
On Tue, Jul 22, 2014 at 7:06 PM, Stephen Warren swar...@wwwdotorg.org
wrote:

 From: Stephen Warren swar...@nvidia.com

 When pxe boot downloads the initrd/kernel/DTB, netboot_common() saves
 the downloaded filename to global variable BootFile. If the boot
 operation is aborted, this global state is not cleared. If dhcp is
 executed later without any arguments, BootFile is not cleared, and when
 the DHCP response is received, BootpCopyNetParams() writes the value into
 environment variable bootfile.

 This causes the following scenario:

 * Boot script executes dhcp; pxe get; pxe boot

 * User CTRL-C's the PXE menu, which causes the first menu item to be
   booted, which causes some file to be downloaded.

   (This boot-on-CTRL-C behaviour is arguably a bug too, but it's a
   separate bug and the bug this patch fixes would still exist if the user
   simply waited to press CTRL-C until pxe boot started downloading
   files)

 * User CTRL-C's the file downloads, but the filename is still written to
   the bootfile environment variable.

 * User re-runs the boot command, which in my case executes dhcp; pxe get;
   pxe boot again, and dhcp picks up the saved bootfile environment
   variable and proceeds to download a file that it shouldn't.

 To solve this, modify the implementation of pxe get to clear BootFile
 if the whole boot operation fails, which avoids this whole mess.

 An alternative would be to modify netboot_common() such that the no-
 arguments case explicitly clears the global variable BootFile. However,
 that would prevent the following command sequences from working:

 $ dhcp filename # downloads filename
 $ dhcp  # downloads $bootfile, i.e. filename

 or:
 $ setenv bootfile filename
 $ dhcp  # downloads $bootfile, i.e. filename

 ... and I assume someone relies on U-Boot working that way.

 Signed-off-by: Stephen Warren swar...@nvidia.com

Acked-by: Joe Hershberger joe.hershber...@ni.com
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


  1   2   >