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

2014-06-06 Thread Lukasz Majewski
Hi Marek,

 On Monday, May 26, 2014 at 07:46:27 AM, Lukasz Majewski wrote:
  Hi Marek
  
  The following changes since commit
  fc25fa27e5f439705e9ca42182014e2d75d9f0ae:
  
dfu, nand: add medium specific polltimeout function (2014-05-08
10:38:30 +0200)
  
  are available in the git repository at:
  
ssh://gu-...@git.denx.de/u-boot-dfu master
  
  for you to fetch changes up to
  03bc75c206e25e8aeb8070b86424f7860453:
  
dfu: Introduction of the dfu_hash_algo env variable for checksum
method setting (2014-05-26 07:31:54 +0200)
  
  
  Lukasz Majewski (1):
dfu: Introduction of the dfu_hash_algo env variable for
  checksum method setting
 
 I had merge conflict here, so I picked the one patch by hand.

I see. Thanks Marek!

 
 Thanks!
 
 Best regards,
 Marek Vasut



-- 
Best regards,

Lukasz Majewski

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


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

2014-06-06 Thread Stefano Babic
Hi Masahiro,

On 23/04/2014 14:20, Masahiro Yamada wrote:
 arch/arm/include/asm/spl.h requires all SoCs to have
 arch/arm/include/asm/arch-*/spl.h.
 
 But many of them just define BOOT_DEVICE_* macros.
 
 Those macros are used in the switch (boot_device) { ... }
 statement in common/spl/spl.c.
 
 So they should not be archtecture specific, but be described as
 a simpile enumeration.
 
 This commit merges most of arch/arm/include/asm/arch-*/spl.h
 into arch/arm/include/asm/spl.h.
 
 With a little more effort, arch-zynq/spl.h and arch-socfpga/spl.h
 will be merged, while I am not sure about OMAP and Exynos.
 
 Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
 Cc: Tom Rini tr...@ti.com
 Cc: Michal Simek michal.si...@xilinx.com
 Cc: Andreas Bießmann andreas.de...@googlemail.com
 Cc: Stephen Warren swar...@nvidia.com
 Cc: Tom Warren twar...@nvidia.com
 CC: Stefano Babic sba...@denx.de
 CC: Minkyu Kang mk7.k...@samsung.com
 Cc: Dinh Nguyen dingu...@altera.com
 Acked-by: Andreas Bießmann andreas.de...@googlemail.com
 Acked-by: Michal Simek mon...@monstr.eu
 Acked-by: Stefano Babic sba...@denx.de
 Acked-by: Stephen Warren swar...@nvidia.com
 Acked-by: Tim Harvey thar...@gateworks.com
 Tested-by: Bo Shen voice.s...@atmel.com [on sama5d3xek board for at91 part]
 ---

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 00/10] mx6: SPL NAND support

2014-06-06 Thread Stefano Babic
Hi Tim,

On 03/06/2014 01:13, Tim Harvey wrote:
 This series adds some necessary framework for IMX6 SPL support. The series
 includes support for NAND SPL and has been tested with MMC as well. I have
 tested this on five differing Ventana baseboards with a variety of memory
 (32bit 512MB, 32bit 1024MB, 64bit 1024MB) and CPU configurations (IMX6Q,
 IMX6DL, IMX6S).
 

Whole series applied to u-boot-imx. Many thanks again to have taken the
work to add SPL support for the i.MX6 processor !

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] imx: sata: return failure if not IMX6Q/IMX6D

2014-06-06 Thread Stefano Babic
Hi Tim,

On 05/06/2014 12:44, Tim Harvey wrote:
 On Wed, May 7, 2014 at 10:24 PM, Tim Harvey thar...@gateworks.com wrote:
 The IMX6QUAD/DUAL have SATA, but the IMX6SOLO/DL do not. Return
 instead of configuring the SATA clock and GPR13 registers.

 Signed-off-by: Tim Harvey thar...@gateworks.com
 ---
  arch/arm/imx-common/sata.c | 7 ++-
  1 file changed, 6 insertions(+), 1 deletion(-)

 diff --git a/arch/arm/imx-common/sata.c b/arch/arm/imx-common/sata.c
 index 2e69486..c10dd28 100644
 --- a/arch/arm/imx-common/sata.c
 +++ b/arch/arm/imx-common/sata.c
 @@ -8,13 +8,18 @@
  #include asm/arch/iomux.h
  #include asm/io.h
  #include asm/arch/clock.h
 +#include asm/arch/sys_proto.h

  int setup_sata(void)
  {
 struct iomuxc_base_regs *const iomuxc_regs
 = (struct iomuxc_base_regs *)IOMUXC_BASE_ADDR;
 +   int ret;

 -   int ret = enable_sata_clock();
 +   if (!is_cpu_type(MXC_CPU_MX6Q)  !is_cpu_type(MXC_CPU_MX6D))
 +   return 1;
 +
 +   ret = enable_sata_clock();
 if (ret)
 return ret;

 --
 1.8.3.2

 
 Stefano,
 
 Any comments?
 

Yes: applied to u-boot-imx, thanks !

Regards,
Stefano

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


Re: [U-Boot] [PATCH v2] dwc_ahsata: return failure for MX6 if not IMX6Q/IMX6D

2014-06-06 Thread Stefano Babic
On 08/05/2014 07:23, Tim Harvey wrote:
 The IMX6QUAD/DUAL have SATA, but the IMX6SOLO/DL do not. Return failure
 instead of attempting a memory access that results in a data abort and reset.
 
 Signed-off-by: Tim Harvey thar...@gateworks.com
 ---
 v2:
  - remove print as this condition isn't really an error just something not
possible
 ---


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] mx6sabre_common: Avoid console hang due to small CONFIG_SYS_PBSIZE

2014-06-06 Thread Stefano Babic
Hi Fabio,

On 19/05/2014 04:02, Fabio Estevam wrote:
 From: Fabio Estevam fabio.este...@freescale.com
 
 Entering the maximum number of characters defined by CONFIG_SYS_CBSIZE into 
 the console and hitting enter afterwards, causes a hang in the system because
 CONFIG_SYS_PBSIZE is not capable of storing the characters of the error 
 message:
 Unknown command '' - try 'help'
 
 Increase the size of CONFIG_SYS_PBSIZE so that it can store the error message 
 and allows the error message to be printed correctly with no hang.
 
 Signed-off-by: Fabio Estevam fabio.este...@freescale.com
 ---
 This problem affects many boards.
 
 Maybe a global fix is to add a CONFIG_SYS_PBSIZE entry into config_fallbacks
 and remove its definition from the board config files when it is defined as:
 #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
 

IMHO this is much better as fixing each single board.

 or even when it is equal to CONFIG_SYS_CBSIZE.

I would not add any further check : if a board maintainer add
CONFIG_SYS_PBSIZE to each own config file, he must know what he is
doing. If it is not set, config_fallbacks defines CONFIG_SYS_PBSIZE

Regards,
Stefano

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


Re: [U-Boot] [RESEND PATCH 1/3] Check run_command() return code properly

2014-06-06 Thread Thomas . Betker
Hello Simon:

  run_command() returns 0 for success, 1 for failure. Fix places which
  assume that failure is indicated by a negative return code.
 
  Signed-off-by: Thomas Betker thomas.bet...@rohde-schwarz.com
 
 This has come through fine to patchwork - it may have been your
 missing name that was the problem.

Yes, I checked that the patches made it to Patchwork last night. Thanks 
for the hint; you were right, it was the missing name in my .gitconfig.

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


Re: [U-Boot] [PATCH] mx25pdk: Add generic board support

2014-06-06 Thread Stefano Babic
On 13/05/2014 19:40, Fabio Estevam wrote:
 Signed-off-by: Fabio Estevam fabio.este...@freescale.com
 ---
  include/configs/mx25pdk.h | 2 ++
  1 file changed, 2 insertions(+)
 
 diff --git a/include/configs/mx25pdk.h b/include/configs/mx25pdk.h
 index aff2419..cfaf6ca 100644
 --- a/include/configs/mx25pdk.h

Applied to u-boot-imx, thanks !

Best regards,
Stefano Babic

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


[U-Boot] [PATCH] MX25: fix build due to missing sys_proto.h

2014-06-06 Thread Stefano Babic
THe mx25 arch does not have a sys_proto.h file.
Instead of creating a dummy file, the file
is not included for this SOC.

Signed-off-by: Stefano Babic sba...@denx.de
---
 arch/arm/imx-common/iomux-v3.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/imx-common/iomux-v3.c b/arch/arm/imx-common/iomux-v3.c
index 306183a..c090b30 100644
--- a/arch/arm/imx-common/iomux-v3.c
+++ b/arch/arm/imx-common/iomux-v3.c
@@ -11,7 +11,9 @@
 #include common.h
 #include asm/io.h
 #include asm/arch/imx-regs.h
+#ifndef CONFIG_MX25
 #include asm/arch/sys_proto.h
+#endif
 #include asm/imx-common/iomux-v3.h
 
 static void *base = (void *)IOMUXC_BASE_ADDR;
-- 
1.9.1

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


Re: [U-Boot] [ANNOUNCE] U-Boot driver model repo

2014-06-06 Thread TigerLiu
Hi, Simon:
I git cloned http://git.denx.de/u-boot-dm.git .
And followed these steps to compile it:
   make sandbox_config
   make

but failed:
arch/sandbox/cpu/sdl.c:10:21: error: sdl/sdl.h: No such file or directory

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


Re: [U-Boot] [PATCH] mx6: Fix definition of IOMUXC_GPR12_DEVICE_TYPE_RC

2014-06-06 Thread Stefano Babic
Hi Fabio,

On 06/06/2014 00:31, Fabio Estevam wrote:
 From: Fabio Estevam fabio.este...@freescale.com
 
 mx6 reference manual incorrectly states that the DEVICE_TYPE field of 
 IOMUXC_GPR12 register should be configured as '0010' for setting the PCI 
 controller in RC mode. The correct value should be '0100' instead.
 
 This also aligns with the same value used in the mx6 pci kernel driver.
 
 Signed-off-by: Fabio Estevam fabio.este...@freescale.com
 ---
  arch/arm/include/asm/arch-mx6/iomux.h | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/arch/arm/include/asm/arch-mx6/iomux.h 
 b/arch/arm/include/asm/arch-mx6/iomux.h
 index f9ee0d9..6a4a632 100644
 --- a/arch/arm/include/asm/arch-mx6/iomux.h
 +++ b/arch/arm/include/asm/arch-mx6/iomux.h
 @@ -39,7 +39,7 @@
  #define IOMUXC_GPR12_LOS_LEVEL_MASK  (0x1f  4)
  #define IOMUXC_GPR12_APPS_LTSSM_ENABLE   (1  10)
  #define IOMUXC_GPR12_DEVICE_TYPE_EP  (0x0  12)
 -#define IOMUXC_GPR12_DEVICE_TYPE_RC  (0x2  12)
 +#define IOMUXC_GPR12_DEVICE_TYPE_RC  (0x4  12)
  #define IOMUXC_GPR12_DEVICE_TYPE_MASK(0xf  12)
  

Acked-by: Stefano Babic sba...@denx.de

I will merge it for the release.

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] Building under Cygwin - -ansi flag?

2014-06-06 Thread Masahiro Yamada
Hi.

 
 
 Let's suppose there is an application in tools directory that requires
 both libfdt_env.h (from uboot tree) and errno.h (from host
 environment). However, as both headers exist at both places, in the
 uboot tree and on the host environment, there is no way to solve this
 just by altering the include paths order. For any reshuffling both
 headers will be taken either from uboot or from host - which is
 undesired.

True.
What we should do is not to tweak the inclusion order.


I guess we should follow what happended in Linux Kernel world:

They split out the user-space API content in separated headers
and put them into  new   include/uapi/  and  arch/$(ARCH)/include/uapi/
directories.


So, the right direction we should go is:

- Define the exact tools-API  which should be exported to
  host program space. (For ex.  image structure)

- Put the tool-API headers into a new directory.
(I have no idea about a good dir name.   include/host-api/ ? )
 This directory is added to include-path for  both U-Boot and host programs.


   include  include
 U-Boot  --   include/host-api/   Host programs


U-boot  includes:  include/host-api/  +  include/   + arch/$ARCH/include/

Host programs include:  include/host-api/ + headers provided by environments





Comments are welcome !


Best Regards
Masahiro Yamada

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


Re: [U-Boot] Building under Cygwin - -ansi flag?

2014-06-06 Thread Masahiro Yamada
Hi.


 
 I've finally found time to look deeper into this problem. Let me outline
 the situation:
 1. The problems with Cygwin build arise in code built for the host
architecture i.e. stuff in tools sub-directory.
 2. Along the years, there were several commits targeting the problems.
All were related to include search paths/their order:
 a. e1a3f6b (July 2004): U-Boot include paths for tools build were
changed to -idirafter, i.e. host headers were given higher
priority than headers in U-Boot tree.
 b. 883e392 (Jan 2008): The above patch caused asm/types.h shipped
with Cygwin to be included. Turned out Cygwin does not define
__u64, so this patch tried to workaround it by adding the -ansi
flag. This flag dropped some include search paths effectively
returning the use of asm/types.h from U-Boot tree.

So, with Sandbox configuration,  host-tools include 
arch/sandbox/include/asm/types.h
With beagle bone configuration,  they include arch/arm/include/asm/type.h

How amazing!



 c. 669dfc2 (March 2013): Yet another header was included from the
host paths and caused problems: libfdt_env.h. This time it was
worked around by adding the following flag to override it:
-include $(SRCTREE)/include/libfdt_env.h

Seems people are only adding new features with ridiculous workarounds,
without refactrong the code,
without thinking what the proper implementing is.
Sadly.


Best Regards
Masahiro Yamada

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


Re: [U-Boot] [ANNOUNCE] U-Boot driver model repo

2014-06-06 Thread Masahiro Yamada
Hi TigerLiu,

On Fri, 6 Jun 2014 17:14:25 +0800
tiger...@via-alliance.com wrote:

 Hi, Simon:
 I git cloned http://git.denx.de/u-boot-dm.git .
 And followed these steps to compile it:
make sandbox_config
make
 
 but failed:
 arch/sandbox/cpu/sdl.c:10:21: error: sdl/sdl.h: No such file or directory


You might need to install some packages. 

Or try building without SDL, like this:

make sandbox_config
make NO_SDL=1



Best Regards
Masahiro Yamada

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


Re: [U-Boot] Building under Cygwin - -ansi flag?

2014-06-06 Thread Masahiro Yamada
Hi.


On Thu, 8 May 2014 14:49:35 +0300
Vasili Galka vvv...@gmail.com wrote:

 Hi,
 
 I'm building u-boot (am335x_evm config) using arm-none-eabi toolchain
 under Cygwin. When trying to build unmodified v2014.04 tag I get some
 errors. However, if I remove the -ansi flag from the Makefile,
 everything builds fine:
 
 -ifeq ($(HOSTOS),cygwin)
 -HOSTCFLAGS+= -ansi
 -endif
 
 I tried tracking down where those lines came from and why building
 under Cygwin requires separate treatment. I found our this originates
 from the following commit (dated Jan 2008):
 
   SHA-1: 883e3925d99a8dd69c5b0201cba5b1887f88f95c
 
   * Fix build problems under Cygwin
 
   This patch allows u-boot to build without error in a cygwin
   environment.  Cygwin does not define __u64 in it's
   include/asm/types.h file.  The -idirafter flag in the u-boot
   build causes the inclusion of the cygwin types.h file as opposed
   to u-bot/include/asm/types.h file which does define __u64.
   Subsequently, sha1.c compile fails due to unknown symbol.
 
   Signed-off-by: Brian Miller raptorbr...@netscape.net
 
 This comment does not really explain why -ansi flag is required.
 Personally, I don't see any reason for it.
 
 Maybe it should be removed at all?
 


As far as I tested,  missing __u64 error occurred
when I tried to build host tools on Cygwin,
regardless  with/without  -ansi option.


This is my build log:


  GEN include/autoconf.mk.dep
  GEN include/autoconf.mk
  CHK include/config/uboot.release
  CHK include/generated/version_autogenerated.h
  CHK include/generated/timestamp_autogenerated.h
  UPD include/generated/timestamp_autogenerated.h
  HOSTCC  scripts/basic/fixdep
scripts/basic/fixdep.c: In function 'parse_config_file':
scripts/basic/fixdep.c:255:4: warning: array subscript has type 'char' 
[-Wchar-subscripts]
if (!(isalnum(*q) || *q == '_'))
^
  CC  lib/asm-offsets.s
  GEN include/generated/generic-asm-offsets.h
  HOSTCC  tools/img2srec
In file included from /home/yamada/workspace/u-boot/include/libfdt_env.h:13:0,
 from command-line:0:
/home/yamada/workspace/u-boot/include/linux/types.h:135:1: error: unknown type 
name '__u64'
 typedef __u64 __bitwise __le64;
 ^
/home/yamada/workspace/u-boot/include/linux/types.h:136:1: error: unknown type 
name '__u64'
 typedef __u64 __bitwise __be64;
 ^
scripts/Makefile.host:118: recipe for target 'tools/img2srec' failed
make[1]: *** [tools/img2srec] Error 1
Makefile:1022: recipe for target 'tools' failed
make: *** [tools] Error 2







/usr/include/asm/types.h  on my Cygwin is like this:

---8--
/* asm/types.h

   Copyright 1998, 2000, 2001 Red Hat, Inc.

This file is part of Cygwin.

This software is a copyrighted work licensed under the terms of the
Cygwin license.  Please consult the file CYGWIN_LICENSE for
details. */

#ifndef _ASM_TYPES_H
#define _ASM_TYPES_H

typedef __signed__ char __s8;
typedef unsigned char __u8;

typedef __signed__ short __s16;
typedef unsigned short __u16;

typedef __signed__ int __s32;
typedef unsigned int __u32;

#endif /* _ASM_TYPES_H */
-8-


Best Regards
Masahiro Yamada

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


[U-Boot] [PATCH] .gitignore: drop *.dts.tmp pattern

2014-06-06 Thread Masahiro Yamada
This pattern was added by commit cc4f427b to ignore the intermidiate
file for generating DTB.

When Kbuild was introduced, dts/Makefile was totally re-written.
This ignore pattern is already useless.

Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---
 .gitignore | 1 -
 1 file changed, 1 deletion(-)

diff --git a/.gitignore b/.gitignore
index a6b2d1c..c2f53fc 100644
--- a/.gitignore
+++ b/.gitignore
@@ -20,7 +20,6 @@
 *.bin
 *.patch
 *.cfgtmp
-*.dts.tmp
 
 # Build tree
 /build-*
-- 
1.9.1

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


Re: [U-Boot] [ANNOUNCE] U-Boot driver model repo

2014-06-06 Thread Marek Vasut
On Friday, June 06, 2014 at 12:51:43 PM, Masahiro Yamada wrote:
 Hi TigerLiu,
 
 On Fri, 6 Jun 2014 17:14:25 +0800
 
 tiger...@via-alliance.com wrote:
  Hi, Simon:
  I git cloned http://git.denx.de/u-boot-dm.git .
  
  And followed these steps to compile it:
 make sandbox_config
 make
  
  but failed:
  arch/sandbox/cpu/sdl.c:10:21: error: sdl/sdl.h: No such file or directory
 
 You might need to install some packages.
 
 Or try building without SDL, like this:
 
 make sandbox_config
 make NO_SDL=1

Or just install SDL development libs ;-)

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


[U-Boot] [PATCH 0/2] Some Cygwin-related changes

2014-06-06 Thread Masahiro Yamada



Masahiro Yamada (2):
  kbuild: remove unnecessary adjustment for Cygwin
  .gitignore: move *.exe pattern to the top gitignore for Cygwin

 .gitignore   |  3 ++
 tools/.gitignore |  1 -
 tools/Makefile   | 89 +---
 3 files changed, 43 insertions(+), 50 deletions(-)

-- 
1.9.1

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


[U-Boot] [PATCH 1/2] kbuild: remove unnecessary adjustment for Cygwin

2014-06-06 Thread Masahiro Yamada
SFX = .exe was originally added for Cygwin environment.

It is true that GCC on Cygwin spits executables with .exe extention.

For example,

  gcc -o foo foo.c

will generate foo.exe, not foo.

But GNU make is also nicely adjusted for Cygwin.

For example,

  foo: foo.c
  gcc -o $@ $

will compare the timestamp between foo.exe and foo.c.

You do not have to tweak Makefiles like this:

  foo$(SFX): foo.c
  gcc -o $@ $

And make clean works as well without adjustment for Cygwin because
the command rm foo on Cygwin will delete both foo and foo.exe.

In conclusion, makefiles do not need special care for Cygwin.

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

I tested this patch on the following environment.

$ uname -a
CYGWIN_NT-6.1 yamada-win7 1.7.30(0.272/5/3) 2014-05-23 10:36 i686 Cygwin

$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-pc-cygwin/4.8.3/lto-wrapper.exe
Target: i686-pc-cygwin
Configured with: /cygdrive/i/szsz/tmpp/gcc4/gcc-4.8.3-1/src/gcc-4.8.3/configure
 --srcdir=/cygdrive/i/szsz/tmpp/gcc4/gcc-4.8.3-1/src/gcc-4.8.3
 --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin
 --libexecdir=/usr/libexec --datadir=/usr/share --localstatedir=/var
 --sysconfdir=/etc --libdir=/usr/lib --datarootdir=/usr/share
 --docdir=/usr/share/doc/gcc --htmldir=/usr/share/doc/gcc/html -C
 --build=i686-pc-cygwin --host=i686-pc-cygwin --target=i686-pc-cygwin
 --without-libiconv-prefix --without-libintl-prefix --enable-shared
 --enable-shared-libgcc --enable-static
 --enable-version-specific-runtime-libs --enable-bootstrap
 --disable-__cxa_atexit --with-dwarf2 --with-arch=i686
 --with-tune=generic --disable-sjlj-exceptions
 --enable-languages=ada,c,c++,fortran,java,lto,objc,obj-c++
 --enable-graphite --enable-threads=posix --enable-libatomic
 --enable-libgomp --disable-libitm --enable-libquadmath
 --enable-libquadmath-support --enable-libssp --enable-libada
 --enable-libjava --enable-libgcj-sublibs --disable-java-awt
 --disable-symvers --with-ecj-jar=/usr/share/java/ecj.jar
 --with-gnu-ld --with-gnu-as
 --with-cloog-include=/usr/include/cloog-isl
 --without-libiconv-prefix --without-libintl-prefix
 --with-system-zlib --libexecdir=/usr/lib
Thread model: posix
gcc version 4.8.3 (GCC)

$ make -v
GNU Make 4.0
Built for i686-pc-cygwin
Copyright (C) 1988-2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.


 tools/Makefile | 89 ++
 1 file changed, 40 insertions(+), 49 deletions(-)

diff --git a/tools/Makefile b/tools/Makefile
index 09ac3bb..5235539 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -5,15 +5,6 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-#
-# toolchains targeting win32 generate .exe files
-#
-ifneq (,$(findstring WIN32 ,$(shell $(HOSTCC) -E -dM -xc /dev/null)))
-SFX = .exe
-else
-SFX =
-endif
-
 # Enable all the config-independent tools
 ifneq ($(HOST_TOOLS_ALL),)
 CONFIG_LCD_LOGO = y
@@ -38,31 +29,31 @@ ENVCRC-$(CONFIG_ENV_IS_IN_NVRAM) = y
 ENVCRC-$(CONFIG_ENV_IS_IN_SPI_FLASH) = y
 CONFIG_BUILD_ENVCRC ?= $(ENVCRC-y)
 
-hostprogs-$(CONFIG_SPL_GENERATE_ATMEL_PMECC_HEADER) += atmel_pmecc_params$(SFX)
+hostprogs-$(CONFIG_SPL_GENERATE_ATMEL_PMECC_HEADER) += atmel_pmecc_params
 
 # TODO: CONFIG_CMD_LICENSE does not work
-hostprogs-$(CONFIG_CMD_LICENSE) += bin2header$(SFX)
-hostprogs-$(CONFIG_LCD_LOGO) += bmp_logo$(SFX)
-hostprogs-$(CONFIG_VIDEO_LOGO) += bmp_logo$(SFX)
-HOSTCFLAGS_bmp_logo$(SFX).o := -pedantic
+hostprogs-$(CONFIG_CMD_LICENSE) += bin2header
+hostprogs-$(CONFIG_LCD_LOGO) += bmp_logo
+hostprogs-$(CONFIG_VIDEO_LOGO) += bmp_logo
+HOSTCFLAGS_bmp_logo.o := -pedantic
 
-hostprogs-$(CONFIG_BUILD_ENVCRC) += envcrc$(SFX)
-envcrc$(SFX)-objs := envcrc.o lib/crc32.o common/env_embedded.o lib/sha1.o
+hostprogs-$(CONFIG_BUILD_ENVCRC) += envcrc
+envcrc-objs := envcrc.o lib/crc32.o common/env_embedded.o lib/sha1.o
 
-hostprogs-$(CONFIG_CMD_NET) += gen_eth_addr$(SFX)
-HOSTCFLAGS_gen_eth_addr$(SFX).o := -pedantic
+hostprogs-$(CONFIG_CMD_NET) += gen_eth_addr
+HOSTCFLAGS_gen_eth_addr.o := -pedantic
 
-hostprogs-$(CONFIG_CMD_LOADS) += img2srec$(SFX)
-HOSTCFLAGS_img2srec$(SFX).o := -pedantic
+hostprogs-$(CONFIG_CMD_LOADS) += img2srec
+HOSTCFLAGS_img2srec.o := -pedantic
 
-hostprogs-$(CONFIG_XWAY_SWAP_BYTES) += xway-swap-bytes$(SFX)
-HOSTCFLAGS_xway-swap-bytes$(SFX).o := -pedantic
+hostprogs-$(CONFIG_XWAY_SWAP_BYTES) += xway-swap-bytes
+HOSTCFLAGS_xway-swap-bytes.o := -pedantic
 
-hostprogs-y += mkenvimage$(SFX)
-mkenvimage$(SFX)-objs := mkenvimage.o os_support.o lib/crc32.o
+hostprogs-y += mkenvimage
+mkenvimage-objs := mkenvimage.o os_support.o lib/crc32.o
 
-hostprogs-y += dumpimage$(SFX) mkimage$(SFX)
-hostprogs-$(CONFIG_FIT_SIGNATURE) += fit_info$(SFX) fit_check_sign$(SFX)
+hostprogs-y += 

[U-Boot] [PATCH 2/2] .gitignore: move *.exe pattern to the top gitignore for Cygwin

2014-06-06 Thread Masahiro Yamada
GCC on Cygwin generates executables with .exe extension,
for example:
 scripts/basic/fixdep.exe
 scripts/docproc.exe

To ignore them, *.exe pattern should be moved
from tools/.gitignore to ./.gitignore

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

 .gitignore   | 3 +++
 tools/.gitignore | 1 -
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/.gitignore b/.gitignore
index c2f53fc..4e4fd00 100644
--- a/.gitignore
+++ b/.gitignore
@@ -21,6 +21,9 @@
 *.patch
 *.cfgtmp
 
+# host programs on Cygwin
+*.exe
+
 # Build tree
 /build-*
 
diff --git a/tools/.gitignore b/tools/.gitignore
index 0eb9068..cefe923 100644
--- a/tools/.gitignore
+++ b/tools/.gitignore
@@ -17,7 +17,6 @@
 /relocate-rela
 /ubsha1
 /xway-swap-bytes
-/*.exe
 /easylogo/easylogo
 /gdb/gdbcont
 /gdb/gdbsend
-- 
1.9.1

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


Re: [U-Boot] Building under Cygwin - -ansi flag?

2014-06-06 Thread Vasili Galka
Hi Masahiro,

 Let's suppose there is an application in tools directory that requires
 both libfdt_env.h (from uboot tree) and errno.h (from host
 environment). However, as both headers exist at both places, in the
 uboot tree and on the host environment, there is no way to solve this
 just by altering the include paths order. For any reshuffling both
 headers will be taken either from uboot or from host - which is
 undesired.

 True.
 What we should do is not to tweak the inclusion order.


 I guess we should follow what happended in Linux Kernel world:

 They split out the user-space API content in separated headers
 and put them into  new   include/uapi/  and  arch/$(ARCH)/include/uapi/
 directories.


 So, the right direction we should go is:

 - Define the exact tools-API  which should be exported to
   host program space. (For ex.  image structure)

 - Put the tool-API headers into a new directory.
 (I have no idea about a good dir name.   include/host-api/ ? )
  This directory is added to include-path for  both U-Boot and host programs.


include  include
  U-Boot  --   include/host-api/   Host programs


 U-boot  includes:  include/host-api/  +  include/   + arch/$ARCH/include/

 Host programs include:  include/host-api/ + headers provided by environments

What you propose sounds good. But are you sure that no tools require a
really deep details of U-Boot internals? In such case separating the
details into an interface won't be possible. If (hopefully) that's not
the case, interfaces seem to be the right direction. Although
implementing them requires great work.
In any case, as a new comer, I don't think I know U-Boot enough for
such design decision. I would be glad to hear the opinion of other
major developers.

As about the solution I initially thought of, here is a more detailed design:
https://docs.google.com/document/d/1D86EedRrViJHsTZrf9bEQB-DYsEweHDKaJyZYI2Yr3I/edit?usp=sharing
It does not contradict what you propose and these two can be used
together. My proposal does not target only the specific compilation
issues descussed here but the general ease of code understanding and
navigation. I think it is much easier to implement and can provide a
good short term solution. Since re-factoring host-api requires much
effort and deep understanding of existing code. The only drawback of
my proposal I see is the large patch footprint. But maybe you see
other weaknesses. I'll be glad for your opinion.

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


[U-Boot] [RFC PATCH] IMX: Rename IMX image SPL to something else for Cygwin

2014-06-06 Thread Masahiro Yamada
I am not sure how much effort we should make
for building U-Boot on Cygwin.

Anyway, other than host programs, I notice file name problem.

Unlike Unix or Linux, on Windows upper/lower cases for file names
are not distinguished.

On Cygwin, for example, we cannot do this:

  $ mkdir abc
  $ mkdir ABC
  mkdir: cannot create directory `ABC': File exists

It causes some problems in U-Boot too.

For example,

  $ make mrproper
CLEAN   SPL
  rm: cannot remove `SPL': Is a directory
  Makefile:1278: recipe for target 'clobber' failed
  make: *** [clobber] Error 1

  $ make qong_config
  Configuring for qong board...

  $ make clean
CLEAN   arch/arm/imx-common
  rm: cannot remove `arch/arm/imx-common/../../../SPL': Is a directory
  scripts/Makefile.clean:79: recipe for target '__clean' failed
  make[1]: *** [__clean] Error 1
  Makefile:1256: recipe for target '_clean_arch/arm/imx-common' failed
  make: *** [_clean_arch/arm/imx-common] Error 2

I notice at least one file name conflict at the top directory.

  SPL - image for IMX
  spl - directory where SPL is built

This commit renames the former to a temporary name.

I guess there is few developers testing U-Boot on Cygwin.
If Cygwin support is mandatory, please consider to rename IMX image.

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

 .gitignore   | 2 +-
 Makefile | 6 +++---
 arch/arm/config.mk   | 2 +-
 arch/arm/imx-common/Makefile | 8 
 4 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/.gitignore b/.gitignore
index 4e4fd00..b68e4f9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -31,7 +31,7 @@
 # Top-level generic files
 #
 /MLO*
-/SPL
+/SPL__PLEASE_RENAME
 /System.map
 /u-boot*
 
diff --git a/Makefile b/Makefile
index aebee55..a6fe5d8 100644
--- a/Makefile
+++ b/Makefile
@@ -866,10 +866,10 @@ OBJCOPYFLAGS_u-boot-with-tpl.bin = -I binary -O binary \
 tpl/u-boot-with-tpl.bin: tpl/u-boot-tpl.bin u-boot.bin FORCE
$(call if_changed,pad_cat)
 
-SPL: spl/u-boot-spl.bin FORCE
+SPL__PLEASE_RENAME: spl/u-boot-spl.bin FORCE
$(Q)$(MAKE) $(build)=arch/arm/imx-common $@
 
-u-boot-with-spl.imx u-boot-with-nand-spl.imx: SPL u-boot.bin FORCE
+u-boot-with-spl.imx u-boot-with-nand-spl.imx: SPL__PLEASE_RENAME u-boot.bin 
FORCE
$(Q)$(MAKE) $(build)=arch/arm/imx-common $@
 
 MKIMAGEFLAGS_u-boot.ubl = -n $(UBL_CONFIG) -T ublimage -e 
$(CONFIG_SYS_TEXT_BASE)
@@ -1221,7 +1221,7 @@ CLEAN_FILES += u-boot.lds include/bmp_logo.h 
include/bmp_logo_data.h \
 CLOBBER_DIRS  += $(patsubst %,spl/%, $(filter-out Makefile, \
 $(shell ls -1 spl 2/dev/null))) \
 tpl
-CLOBBER_FILES += u-boot* MLO* SPL System.map
+CLOBBER_FILES += u-boot* MLO* SPL__PLEASE_RENAME System.map
 
 # Directories  files removed with 'make mrproper'
 MRPROPER_DIRS  += include/config include/generated  \
diff --git a/arch/arm/config.mk b/arch/arm/config.mk
index 66ecc2e..e5bf171 100644
--- a/arch/arm/config.mk
+++ b/arch/arm/config.mk
@@ -119,7 +119,7 @@ endif
 ifneq ($(CONFIG_IMX_CONFIG),)
 ifdef CONFIG_SPL
 ifndef CONFIG_SPL_BUILD
-ALL-y += SPL
+ALL-y += SPL__PLEASE_RENAME
 endif
 else
 ifeq ($(CONFIG_OF_SEPARATE),y)
diff --git a/arch/arm/imx-common/Makefile b/arch/arm/imx-common/Makefile
index 016fb98..8bf4d20 100644
--- a/arch/arm/imx-common/Makefile
+++ b/arch/arm/imx-common/Makefile
@@ -50,7 +50,7 @@ endif
 MKIMAGEFLAGS_SPL = -n $(filter-out $ $(PHONY),$^) -T imximage \
-e $(CONFIG_SPL_TEXT_BASE)
 
-SPL: spl/u-boot-spl.bin $(IMX_CONFIG) FORCE
+SPL__PLEASE_RENAME: spl/u-boot-spl.bin $(IMX_CONFIG) FORCE
$(call if_changed,mkimage)
 
 MKIMAGEFLAGS_u-boot.uim = -A arm -O U-Boot -a $(CONFIG_SYS_TEXT_BASE) \
@@ -61,7 +61,7 @@ u-boot.uim: u-boot.bin FORCE
 
 OBJCOPYFLAGS += -I binary -O binary --pad-to=$(CONFIG_SPL_PAD_TO)
 
-u-boot-with-spl.imx: SPL u-boot.uim FORCE
+u-boot-with-spl.imx: SPL__PLEASE_RENAME u-boot.uim FORCE
$(call if_changed,pad_cat)
 
 u-boot-with-nand-spl.imx: spl/u-boot-nand-spl.imx u-boot.uim FORCE
@@ -71,7 +71,7 @@ quiet_cmd_u-boot-nand-spl_imx = GEN $@
 cmd_u-boot-nand-spl_imx = (echo -ne '\x00\x00\x00\x00\x46\x43\x42\x20\x01'  \
dd bs=1015 count=1 if=/dev/zero 2/dev/null) | cat - $  $@
 
-spl/u-boot-nand-spl.imx: SPL FORCE
+spl/u-boot-nand-spl.imx: SPL__PLEASE_RENAME FORCE
$(call if_changed,u-boot-nand-spl_imx)
 
-targets += $(addprefix ../../../,$(IMX_CONFIG) SPL u-boot.uim 
spl/u-boot-nand-spl.imx)
+targets += $(addprefix ../../../,$(IMX_CONFIG) SPL__PLEASE_RENAME u-boot.uim 
spl/u-boot-nand-spl.imx)
-- 
1.9.1

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


Re: [U-Boot] [Patch v4 2/5] ARMv8: Adjust MMU setup

2014-06-06 Thread Mark Rutland
[...]

  What you need to do to replace the active set of tables (assuming that
  the new mapping has the instruction stream mapped in an identical way)
  is:
 
  - Write the tables.
 
  - DSB to make them visible to the MMU.
 
  - Write to the appropriate TTBR_*.
 
  - ISB to complete the write to the TTBR_*.
 
  - TLBI to invalidate the old mappings the the TLBs.
 
  - DSB to complete the TLBI.
 
  - If you've changed the instruction stream or system state that will
affect the instruction stream, ISB to flush the CPU pipeline.
 
 
  Here is the flow I have (as of v5 patch)
 
  Write the tables
 
  (I removed dsb here in v5, need to add back)
 
  Write TTBR
 
  (I missed isb here, need to add)
 
  Flush dcache (otherwise the table will not be in DDR. Yes, I verified)
 
  This looks odd -- why do we need the tables to be in DDR? Why would we
  flush them here, when the address is partially visible to the MMU?
 
 This sounds odd but it actually makes sense. Let's say we have new tables
 created by u-boot. The new tables are in the address of DDR with D-cache
 enabled. If we don't flush the cache, the moment TLBs are invalidated, MMU 
 will
 fetch the tables from TTBR which points to DDR. Without a valid TLB, MMU 
 cannot
 get the table from D-cache, it has to fetch from the DDR directly. I have
 verified this by checking waveforms of the SoC and exercised code in both 
 ways.

How is TCR_EL2.SH0 (or TCR_EL1.SH*) configured?

You'll only need to flush the cache if they're configured non shareable.

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


Re: [U-Boot] [RFC PATCH] IMX: Rename IMX image SPL to something else for Cygwin

2014-06-06 Thread Stefano Babic
Hi Masahiro,

On 06/06/2014 14:31, Masahiro Yamada wrote:
 I am not sure how much effort we should make
 for building U-Boot on Cygwin.
 
 Anyway, other than host programs, I notice file name problem.
 
 Unlike Unix or Linux, on Windows upper/lower cases for file names
 are not distinguished.
 
 On Cygwin, for example, we cannot do this:
 
   $ mkdir abc
   $ mkdir ABC
   mkdir: cannot create directory `ABC': File exists
 

Right, this is a well know issue.

 It causes some problems in U-Boot too.
 
 For example,
 
   $ make mrproper
 CLEAN   SPL
   rm: cannot remove `SPL': Is a directory
   Makefile:1278: recipe for target 'clobber' failed
   make: *** [clobber] Error 1
 
   $ make qong_config
   Configuring for qong board...
 
   $ make clean
 CLEAN   arch/arm/imx-common
   rm: cannot remove `arch/arm/imx-common/../../../SPL': Is a directory
   scripts/Makefile.clean:79: recipe for target '__clean' failed
   make[1]: *** [__clean] Error 1
   Makefile:1256: recipe for target '_clean_arch/arm/imx-common' failed
   make: *** [_clean_arch/arm/imx-common] Error 2
 
 I notice at least one file name conflict at the top directory.
 
   SPL - image for IMX
   spl - directory where SPL is built
 
 This commit renames the former to a temporary name.
 
 I guess there is few developers testing U-Boot on Cygwin.
 If Cygwin support is mandatory, please consider to rename IMX image.

IMHO we have to consider if there will be a high request to build on
Cygwin and I prefer to defer this issue. Some developers working before
on Cygwin are used to set up a VM on their OS nowadays, reducing the
number of people who need a Cygwin environment.

Regards,
Stefano

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


Re: [U-Boot] [Patch v4 2/5] ARMv8: Adjust MMU setup

2014-06-06 Thread Rob Herring
On Thu, Jun 5, 2014 at 1:34 PM, York Sun york...@freescale.com wrote:
 On 06/05/2014 10:41 AM, Mark Rutland wrote:
 On Thu, Jun 05, 2014 at 04:07:17PM +0100, York Sun wrote:
 On 06/05/2014 03:09 AM, Mark Rutland wrote:

[...]

 No objection here on the idea. But again this is not the case. My first MMU
 table is in SRAM, which is small and will be used for other purpose. The 
 2nd MMU
 table is in DDR. I could copy the table and do the maintenance as you said. 
 For
 now, I want to stick with the static table and only create the API when I 
 have to.

 Sure, if your tables are in SRAM then trying to do a load of dynamic
 allocation isn't going to work.

Why do you need to turn on the MMU early using SRAM in the first
place? Can't you delay that until after DDR setup?

 My fear is that while that sounds OK with a single user to do a quick
 havk and poke the tables directly, we'll end up with everyone doing
 that, and no-one will try to unify things. It is very diffifcult to
 unify such variation after the fact.

 That's a good reason. Let me start to code the API. It will take a while to
 cover the complexity of the multilevel tables and sizes. It will be a 
 separated
 patch for later review. I don't want that to delay this patch set. I am hoping
 to get this set in for 2014.07 release.

If I was maintainer I would say no because few people come back later
to clean-up their mess. If you want to get platform support in now,
perhaps you should just add the base platform first and add mmu setup
later. Surely you don't need the MMU to just boot to u-boot shell.

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


Re: [U-Boot] [PATCH 1/3] net: sh-eth: Add support R7S72100 of rmobile

2014-06-06 Thread Tom Rini
On Fri, Jun 06, 2014 at 11:44:20AM +0900, Nobuhiro Iwamatsu wrote:

 ping.
 
 2014-01-23 7:52 GMT+09:00 Nobuhiro Iwamatsu 
 nobuhiro.iwamatsu...@renesas.com:
  The R7S72100 of ARM SoC that Renesas manufactured has one Ether port.
  This has the same IP SH-Ether. This patch adds support of the R7S72100
  in SH-Ether.
 
  Signed-off-by: Nobuhiro Iwamatsu nobuhiro.iwamatsu...@renesas.com

I'm fine with this series coming via the sh tree.

-- 
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 v4 2/5] ARMv8: Adjust MMU setup

2014-06-06 Thread York Sun
On 06/06/2014 05:33 AM, Mark Rutland wrote:
 [...]
 
 What you need to do to replace the active set of tables (assuming that
 the new mapping has the instruction stream mapped in an identical way)
 is:

 - Write the tables.

 - DSB to make them visible to the MMU.

 - Write to the appropriate TTBR_*.

 - ISB to complete the write to the TTBR_*.

 - TLBI to invalidate the old mappings the the TLBs.

 - DSB to complete the TLBI.

 - If you've changed the instruction stream or system state that will
   affect the instruction stream, ISB to flush the CPU pipeline.


 Here is the flow I have (as of v5 patch)

 Write the tables

 (I removed dsb here in v5, need to add back)

 Write TTBR

 (I missed isb here, need to add)

 Flush dcache (otherwise the table will not be in DDR. Yes, I verified)

 This looks odd -- why do we need the tables to be in DDR? Why would we
 flush them here, when the address is partially visible to the MMU?

 This sounds odd but it actually makes sense. Let's say we have new tables
 created by u-boot. The new tables are in the address of DDR with D-cache
 enabled. If we don't flush the cache, the moment TLBs are invalidated, MMU 
 will
 fetch the tables from TTBR which points to DDR. Without a valid TLB, MMU 
 cannot
 get the table from D-cache, it has to fetch from the DDR directly. I have
 verified this by checking waveforms of the SoC and exercised code in both 
 ways.
 
 How is TCR_EL2.SH0 (or TCR_EL1.SH*) configured?
 
 You'll only need to flush the cache if they're configured non shareable.

It is configured as non shareable.

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


Re: [U-Boot] [Patch v4 2/5] ARMv8: Adjust MMU setup

2014-06-06 Thread York Sun
On 06/06/2014 06:34 AM, Rob Herring wrote:
 On Thu, Jun 5, 2014 at 1:34 PM, York Sun york...@freescale.com wrote:
 On 06/05/2014 10:41 AM, Mark Rutland wrote:
 On Thu, Jun 05, 2014 at 04:07:17PM +0100, York Sun wrote:
 On 06/05/2014 03:09 AM, Mark Rutland wrote:
 
 [...]
 
 No objection here on the idea. But again this is not the case. My first MMU
 table is in SRAM, which is small and will be used for other purpose. The 
 2nd MMU
 table is in DDR. I could copy the table and do the maintenance as you 
 said. For
 now, I want to stick with the static table and only create the API when I 
 have to.

 Sure, if your tables are in SRAM then trying to do a load of dynamic
 allocation isn't going to work.
 
 Why do you need to turn on the MMU early using SRAM in the first
 place? Can't you delay that until after DDR setup?

Logically yes. But it runs too slow without cache on emulator.

 
 My fear is that while that sounds OK with a single user to do a quick
 havk and poke the tables directly, we'll end up with everyone doing
 that, and no-one will try to unify things. It is very diffifcult to
 unify such variation after the fact.

 That's a good reason. Let me start to code the API. It will take a while to
 cover the complexity of the multilevel tables and sizes. It will be a 
 separated
 patch for later review. I don't want that to delay this patch set. I am 
 hoping
 to get this set in for 2014.07 release.
 
 If I was maintainer I would say no because few people come back later
 to clean-up their mess. If you want to get platform support in now,
 perhaps you should just add the base platform first and add mmu setup
 later. Surely you don't need the MMU to just boot to u-boot shell.
 

My plan is to get the first platform in, then I will maintain Freescale stuff.
So you can be sure I will continue to improve it. One reason to get these code
in early is to enable our partners and early adopters to use u-boot. After all,
this is the second ARMv8 platform. The first one vexpress_aemv8a doesn't even
support cache.

York


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


[U-Boot] pull request for u-boot-tegra/master into ARM/master

2014-06-06 Thread Tom Warren
Albert,

Please pull u-boot-tegra/master into ARM/master. Thanks!

./MAKEALL -s tegra AOK, checkpatch.pl is OK, and ./MAKEALL -a arm only
shows failures that were already present in ARM/master.

The following changes since commit cc49da249cf2f380d2fed5571fad65ce6494fc95:

  Merge branch 'u-boot-samsung/master' into 'u-boot-arm/master' (2014-06-02
08:43:48 +0200)

are available in the git repository at:

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

for you to fetch changes up to e6607cffef965011ef0ddc0fbe6f4b7c0d53aeec:

  ARM: tegra: enable USB device mode and UMS on some boards (2014-06-05
11:25:54 -0700)


Stephen Warren (1):
  ARM: tegra: enable USB device mode and UMS on some boards

 arch/arm/dts/tegra124-jetson-tk1.dts |  9 -
 arch/arm/dts/tegra124-venice2.dts|  9 -
 arch/arm/dts/tegra30-beaver.dts  |  9 -
 include/configs/beaver.h |  2 ++
 include/configs/jetson-tk1.h |  2 ++
 include/configs/tegra-common-ums.h   | 26 ++
 include/configs/venice2.h|  2 ++
 7 files changed, 56 insertions(+), 3 deletions(-)
 create mode 100644 include/configs/tegra-common-ums.h
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [Patch v4 2/5] ARMv8: Adjust MMU setup

2014-06-06 Thread Tom Rini
On Fri, Jun 06, 2014 at 07:52:44AM -0700, York Sun wrote:
 On 06/06/2014 06:34 AM, Rob Herring wrote:
  On Thu, Jun 5, 2014 at 1:34 PM, York Sun york...@freescale.com wrote:
  On 06/05/2014 10:41 AM, Mark Rutland wrote:
  On Thu, Jun 05, 2014 at 04:07:17PM +0100, York Sun wrote:
  On 06/05/2014 03:09 AM, Mark Rutland wrote:
  
  [...]
  
  No objection here on the idea. But again this is not the case. My first 
  MMU
  table is in SRAM, which is small and will be used for other purpose. The 
  2nd MMU
  table is in DDR. I could copy the table and do the maintenance as you 
  said. For
  now, I want to stick with the static table and only create the API when 
  I have to.
 
  Sure, if your tables are in SRAM then trying to do a load of dynamic
  allocation isn't going to work.
  
  Why do you need to turn on the MMU early using SRAM in the first
  place? Can't you delay that until after DDR setup?
 
 Logically yes. But it runs too slow without cache on emulator.
 
  
  My fear is that while that sounds OK with a single user to do a quick
  havk and poke the tables directly, we'll end up with everyone doing
  that, and no-one will try to unify things. It is very diffifcult to
  unify such variation after the fact.
 
  That's a good reason. Let me start to code the API. It will take a while to
  cover the complexity of the multilevel tables and sizes. It will be a 
  separated
  patch for later review. I don't want that to delay this patch set. I am 
  hoping
  to get this set in for 2014.07 release.
  
  If I was maintainer I would say no because few people come back later
  to clean-up their mess. If you want to get platform support in now,
  perhaps you should just add the base platform first and add mmu setup
  later. Surely you don't need the MMU to just boot to u-boot shell.
  
 
 My plan is to get the first platform in, then I will maintain
 Freescale stuff.  So you can be sure I will continue to improve it.
 One reason to get these code in early is to enable our partners and
 early adopters to use u-boot. After all, this is the second ARMv8
 platform. The first one vexpress_aemv8a doesn't even support cache.

For the record, I'm OK with this plan given York's track record in the
U-Boot community.

-- 
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 v4 2/5] ARMv8: Adjust MMU setup

2014-06-06 Thread Mark Rutland
On Fri, Jun 06, 2014 at 03:54:49PM +0100, York Sun wrote:
 On 06/06/2014 05:33 AM, Mark Rutland wrote:
  [...]
  
  What you need to do to replace the active set of tables (assuming that
  the new mapping has the instruction stream mapped in an identical way)
  is:
 
  - Write the tables.
 
  - DSB to make them visible to the MMU.
 
  - Write to the appropriate TTBR_*.
 
  - ISB to complete the write to the TTBR_*.
 
  - TLBI to invalidate the old mappings the the TLBs.
 
  - DSB to complete the TLBI.
 
  - If you've changed the instruction stream or system state that will
affect the instruction stream, ISB to flush the CPU pipeline.
 
 
  Here is the flow I have (as of v5 patch)
 
  Write the tables
 
  (I removed dsb here in v5, need to add back)
 
  Write TTBR
 
  (I missed isb here, need to add)
 
  Flush dcache (otherwise the table will not be in DDR. Yes, I verified)
 
  This looks odd -- why do we need the tables to be in DDR? Why would we
  flush them here, when the address is partially visible to the MMU?
 
  This sounds odd but it actually makes sense. Let's say we have new tables
  created by u-boot. The new tables are in the address of DDR with D-cache
  enabled. If we don't flush the cache, the moment TLBs are invalidated, MMU 
  will
  fetch the tables from TTBR which points to DDR. Without a valid TLB, MMU 
  cannot
  get the table from D-cache, it has to fetch from the DDR directly. I have
  verified this by checking waveforms of the SoC and exercised code in both 
  ways.
  
  How is TCR_EL2.SH0 (or TCR_EL1.SH*) configured?
  
  You'll only need to flush the cache if they're configured non shareable.
 
 It is configured as non shareable.

Is there any reason not to configure them as inner shareable? That way
the MMU will look in the D-cache, and you won't have to spend time
flushing them.

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


Re: [U-Boot] [Patch v4 2/5] ARMv8: Adjust MMU setup

2014-06-06 Thread York Sun
On 06/06/2014 10:32 AM, Mark Rutland wrote:
 On Fri, Jun 06, 2014 at 03:54:49PM +0100, York Sun wrote:
 On 06/06/2014 05:33 AM, Mark Rutland wrote:
 [...]

 What you need to do to replace the active set of tables (assuming that
 the new mapping has the instruction stream mapped in an identical way)
 is:

 - Write the tables.

 - DSB to make them visible to the MMU.

 - Write to the appropriate TTBR_*.

 - ISB to complete the write to the TTBR_*.

 - TLBI to invalidate the old mappings the the TLBs.

 - DSB to complete the TLBI.

 - If you've changed the instruction stream or system state that will
   affect the instruction stream, ISB to flush the CPU pipeline.


 Here is the flow I have (as of v5 patch)

 Write the tables

 (I removed dsb here in v5, need to add back)

 Write TTBR

 (I missed isb here, need to add)

 Flush dcache (otherwise the table will not be in DDR. Yes, I verified)

 This looks odd -- why do we need the tables to be in DDR? Why would we
 flush them here, when the address is partially visible to the MMU?

 This sounds odd but it actually makes sense. Let's say we have new tables
 created by u-boot. The new tables are in the address of DDR with D-cache
 enabled. If we don't flush the cache, the moment TLBs are invalidated, MMU 
 will
 fetch the tables from TTBR which points to DDR. Without a valid TLB, MMU 
 cannot
 get the table from D-cache, it has to fetch from the DDR directly. I have
 verified this by checking waveforms of the SoC and exercised code in both 
 ways.

 How is TCR_EL2.SH0 (or TCR_EL1.SH*) configured?

 You'll only need to flush the cache if they're configured non shareable.

 It is configured as non shareable.
 
 Is there any reason not to configure them as inner shareable? That way
 the MMU will look in the D-cache, and you won't have to spend time
 flushing them.
 

You may be right. I need to test it. It will take me a little while. In the
meantime, would you comment on v6 patches please? If flushing is the only
question left, I can address it after testing.

York

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


[U-Boot] [PATCH] omap: Don't enable GPMC CS0 with nothing attached

2014-06-06 Thread Ash Charles
If CONFIG_(NAND|NOR|ONENAND) is not defined, no configuration is set
for GPMC on chip select #0---size is 0.  In this case, the GPMC
configuration should be reset but not enabled.  Enabling causes the
Gumstix DuoVero board to hang when entering Linux.

Signed-off-by: Ash Charles ashchar...@gmail.com
---
 arch/arm/cpu/armv7/omap-common/mem-common.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm/cpu/armv7/omap-common/mem-common.c 
b/arch/arm/cpu/armv7/omap-common/mem-common.c
index 944ef84..f3aa268 100644
--- a/arch/arm/cpu/armv7/omap-common/mem-common.c
+++ b/arch/arm/cpu/armv7/omap-common/mem-common.c
@@ -133,5 +133,6 @@ void gpmc_init(void)
writel(0, gpmc_cfg-cs[0].config7);
sdelay(1000);
/* enable chip-select specific configurations */
-   enable_gpmc_cs_config(gpmc_regs, gpmc_cfg-cs[0], base, size);
+   if (size != 0)
+   enable_gpmc_cs_config(gpmc_regs, gpmc_cfg-cs[0], base, size);
 }
-- 
1.8.3.2

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


[U-Boot] [PATCH] omap4: duovero: Correct name of default device tree

2014-06-06 Thread Ash Charles
Signed-off-by: Ash Charles ashchar...@gmail.com
---
 include/configs/ti_omap4_common.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/configs/ti_omap4_common.h 
b/include/configs/ti_omap4_common.h
index 44b3718..30b02f6 100644
--- a/include/configs/ti_omap4_common.h
+++ b/include/configs/ti_omap4_common.h
@@ -126,7 +126,7 @@
if test $board_name = panda-es; then  \
setenv fdtfile omap4-panda-es.dtb; fi; \
if test $board_name = duovero; then  \
-   setenv fdtfile omap4-duovero.dtb; fi; \
+   setenv fdtfile omap4-duovero-parlor.dtb; fi; \
if test $fdtfile = undefined; then  \
echo WARNING: Could not determine device tree to use; 
fi; \0 \
loadfdt=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0 \
-- 
1.8.3.2

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


[U-Boot] [PATCH] omap3: overo: Select fdtfile for expansion board

2014-06-06 Thread Ash Charles
The u-boot Overo board actually supports both Overo (OMAP35xx)
and Overo Storm (AM/DM37xx) COMs with a range of different expansion
boards.  This provides a mechanism to select the an appropriate device
tree file based on the processor version and, if available, the
expansion board ID written on the expansion board EEPROM. To match the
3.15+ kernels, fdtfile names have this format:
 omap3-overo[-storm]-expansion board name.dtb

By default, we use omap3-overo-storm-tobi.dtb.

Signed-off-by: Ash Charles ashchar...@gmail.com

Conflicts:
include/configs/omap3_overo.h
---
 board/overo/overo.c   | 48 +++
 include/configs/omap3_overo.h |  2 +-
 2 files changed, 49 insertions(+), 1 deletion(-)

diff --git a/board/overo/overo.c b/board/overo/overo.c
index 62b50a8..6a0a655 100644
--- a/board/overo/overo.c
+++ b/board/overo/overo.c
@@ -230,6 +230,52 @@ unsigned int get_expansion_id(void)
return expansion_config.device_vendor;
 }
 
+#ifdef CONFIG_OF_LIBFDT
+void set_fdt(void)
+{
+   int is_storm = 0;
+   char fdtname[64];
+   char expansion_name[32];
+
+if (get_cpu_family() != CPU_OMAP34XX)
+   is_storm = 1;
+
+switch (expansion_config.device_vendor) {
+case GUMSTIX_SUMMIT:
+   snprintf(expansion_name, ARRAY_SIZE(expansion_name), %s,
+   summit);
+   break;
+   case GUMSTIX_CHESTNUT43:
+   snprintf(expansion_name, ARRAY_SIZE(expansion_name), %s,
+   chestnut43);
+   break;
+   case GUMSTIX_PALO43:
+   snprintf(expansion_name, ARRAY_SIZE(expansion_name), %s,
+   palo43);
+   break;
+   case GUMSTIX_GALLOP43:
+   snprintf(expansion_name, ARRAY_SIZE(expansion_name), %s,
+   gallop43);
+   break;
+   case GUMSTIX_ALTO35:
+   snprintf(expansion_name, ARRAY_SIZE(expansion_name), %s,
+   alto35);
+   break;
+   case GUMSTIX_TOBI:
+   case GUMSTIX_NO_EEPROM:
+   default:
+   snprintf(expansion_name, ARRAY_SIZE(expansion_name), %s,
+   tobi);
+   }
+
+snprintf(fdtname, ARRAY_SIZE(fdtname),  omap3-overo%s-%s.dtb,
+ is_storm ? -storm : , expansion_name);
+setenv(fdtfile, fdtname);
+}
+#else
+void set_fdt(void) { return; }
+#endif
+
 /*
  * Routine: misc_init_r
  * Description: Configure board specific parts
@@ -360,6 +406,8 @@ int misc_init_r(void)
 
dieid_num_r();
 
+   set_fdt();
+
return 0;
 }
 
diff --git a/include/configs/omap3_overo.h b/include/configs/omap3_overo.h
index 7b97be9..f79a528 100644
--- a/include/configs/omap3_overo.h
+++ b/include/configs/omap3_overo.h
@@ -83,7 +83,7 @@
 /* Environment information */
 #define CONFIG_EXTRA_ENV_SETTINGS \
DEFAULT_LINUX_BOOT_ENV \
-   fdtfile=overo.dtb\0 \
+   fdtfile=omap3-overo-storm-tobi.dtb\0 \
bootdir=/boot\0 \
bootfile=zImage\0 \
usbtty=cdc_acm\0 \
-- 
1.8.3.2

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


[U-Boot] [PATCH v4 0/15] Collected driver model bug-fixes and docs

2014-06-06 Thread Simon Glass
This series collects some of the patches from the Tegra GPIO conversion
to driver model. That work is still in progress, but the bug fixes and
iotracing feature should go into this release I think. Also the
documentation improvements may as well follow since the existings docs
are proven inadequate.

Changes in v4:
- Correct typo in CONFIG_CMD_IOTRACE
- Remove 64-bit addresses which are not used in U-Boot
- Minor spelling fixes

Changes in v3:
- Remove use of bool in header file to avoid exynos5 build failure
- Create a symlink for each arch to dt-bindings
- Fix typo in commit subject
- Bring in GPIO bindings for tegra{30,114,124} also
- Enable dm command in this patch instead of the next

Changes in v2:
- Add a new patch for an I/O tracing feature
- Add a new patch to enable iotrace for arm
- Add a new patch to enable iotrace for sandbox
- Add new patch to support include files for .dts files
- Update README to encourage conversion to driver model
- Add new patch to use case-insensitive comparison for GPIO banks
- Add new patch to add missing header files in lists and root
- Add new patch to deal with const-ness of the global_data pointer
- Add new patch to allow driver model tests only for sandbox
- Add new patch to fix printf() strings in the 'dm' command
- Add new patch to bring in Tegra device tree files from linux
- Split out a separate patch to enable driver model for tegra
- Rename struct device to struct udevice
- Adjust docs as per Jon's review

Simon Glass (15):
  Add an I/O tracing feature
  arm: Support iotrace feature
  sandbox: Support iotrace feature
  Makefile: Support include files for .dts files
  dm: Rename struct device_id to udevice_id
  dm: Update README to encourage conversion to driver model
  dm: Use case-insensitive comparison for GPIO banks
  dm: Add missing header files in lists and root
  dm: Cast away the const-ness of the global_data pointer
  dm: Allow driver model tests only for sandbox
  dm: Fix printf() strings in the 'dm' command
  tegra: dts: Bring in GPIO bindings from linux
  tegra: Enable driver model
  dm: Tidy up four minor code nits
  dm: Expand and improve the device lifecycle docs

 README |  28 +++
 arch/arm/dts/include/dt-bindings   |   1 +
 arch/arm/dts/tegra114.dtsi |  21 +-
 arch/arm/dts/tegra124.dtsi |  19 +-
 arch/arm/dts/tegra20.dtsi  |  15 +-
 arch/arm/dts/tegra30.dtsi  |  21 +-
 arch/arm/include/asm/io.h  |   3 +
 arch/microblaze/dts/include/dt-bindings|   1 +
 arch/sandbox/dts/include/dt-bindings   |   1 +
 arch/sandbox/include/asm/io.h  |  10 +
 arch/x86/dts/include/dt-bindings   |   1 +
 common/Makefile|   2 +
 common/cmd_iotrace.c   |  73 +++
 common/iotrace.c   | 169 
 doc/driver-model/README.txt| 217 -
 drivers/core/lists.c   |   3 +-
 drivers/core/root.c|   7 +-
 drivers/core/uclass.c  |   2 +-
 drivers/demo/demo-shape.c  |   2 +-
 drivers/demo/demo-simple.c |   2 +-
 drivers/gpio/gpio-uclass.c |   2 +-
 drivers/gpio/sandbox.c |   2 +-
 include/configs/sandbox.h  |   3 +
 include/configs/tegra-common.h |   3 +
 include/dm/device-internal.h   |   4 +
 include/dm/device.h|   8 +-
 include/dm/lists.h |  20 ++
 include/dm/root.h  |   2 +-
 include/dm/uclass.h|   6 +-
 include/dt-bindings/gpio/gpio.h|  15 ++
 include/dt-bindings/gpio/tegra-gpio.h  |  51 +
 include/dt-bindings/interrupt-controller/arm-gic.h |  22 +++
 include/dt-bindings/interrupt-controller/irq.h |  19 ++
 include/iotrace.h  | 104 ++
 scripts/Makefile.lib   |   1 +
 test/dm/Makefile   |   2 +
 test/dm/cmd_dm.c   |  19 +-
 test/dm/test-fdt.c |   2 +-
 38 files changed, 824 insertions(+), 59 deletions(-)
 create mode 12 arch/arm/dts/include/dt-bindings
 create mode 12 arch/microblaze/dts/include/dt-bindings
 create mode 12 arch/sandbox/dts/include/dt-bindings
 create mode 12 arch/x86/dts/include/dt-bindings
 create mode 100644 common/cmd_iotrace.c
 create mode 100644 common/iotrace.c
 create mode 100644 include/dt-bindings/gpio/gpio.h
 create mode 100644 include/dt-bindings/gpio/tegra-gpio.h
 create 

[U-Boot] [PATCH v4 08/15] dm: Add missing header files in lists and root

2014-06-06 Thread Simon Glass
These files don't compile in some architectures. Fix it by adding the
missing headers.

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

Changes in v4: None
Changes in v3: None
Changes in v2:
- Add new patch to add missing header files in lists and root

 drivers/core/lists.c | 1 +
 drivers/core/root.c  | 1 +
 2 files changed, 2 insertions(+)

diff --git a/drivers/core/lists.c b/drivers/core/lists.c
index 9f2917f..afb59d1 100644
--- a/drivers/core/lists.c
+++ b/drivers/core/lists.c
@@ -14,6 +14,7 @@
 #include dm/platdata.h
 #include dm/uclass.h
 #include dm/util.h
+#include fdtdec.h
 #include linux/compiler.h
 
 struct driver *lists_driver_lookup_name(const char *name)
diff --git a/drivers/core/root.c b/drivers/core/root.c
index 4977875..f31be72 100644
--- a/drivers/core/root.c
+++ b/drivers/core/root.c
@@ -10,6 +10,7 @@
 #include common.h
 #include errno.h
 #include malloc.h
+#include libfdt.h
 #include dm/device.h
 #include dm/device-internal.h
 #include dm/lists.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 v4 03/15] sandbox: Support iotrace feature

2014-06-06 Thread Simon Glass
Support the iotrace feature for sandbox, and enable it, using some dummy
I/O access methods.

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

Changes in v4:
- Correct typo in CONFIG_CMD_IOTRACE

Changes in v3: None
Changes in v2:
- Add a new patch to enable iotrace for sandbox

 arch/sandbox/include/asm/io.h | 10 ++
 include/configs/sandbox.h |  3 +++
 2 files changed, 13 insertions(+)

diff --git a/arch/sandbox/include/asm/io.h b/arch/sandbox/include/asm/io.h
index 7956041..895fcb8 100644
--- a/arch/sandbox/include/asm/io.h
+++ b/arch/sandbox/include/asm/io.h
@@ -40,4 +40,14 @@ static inline void unmap_sysmem(const void *vaddr)
 /* Map from a pointer to our RAM buffer */
 phys_addr_t map_to_sysmem(const void *ptr);
 
+/* Define nops for sandbox I/O access */
+#define readb(addr) 0
+#define readw(addr) 0
+#define readl(addr) 0
+#define writeb(v, addr)
+#define writew(v, addr)
+#define writel(v, addr)
+
+#include iotrace.h
+
 #endif
diff --git a/include/configs/sandbox.h b/include/configs/sandbox.h
index 6bb2546..fdc8b75 100644
--- a/include/configs/sandbox.h
+++ b/include/configs/sandbox.h
@@ -16,6 +16,9 @@
 
 #endif
 
+#define CONFIG_IO_TRACE
+#define CONFIG_CMD_IOTRACE
+
 #define CONFIG_SYS_TIMER_RATE  100
 
 #define CONFIG_BOOTSTAGE
-- 
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 v4 05/15] dm: Rename struct device_id to udevice_id

2014-06-06 Thread Simon Glass
It is best to avoid having any occurence of 'struct device' in driver
model, so rename to achieve this.

- Add new patch to rename struct device_id to udevice_id

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

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

 doc/driver-model/README.txt | 2 +-
 drivers/core/lists.c| 2 +-
 drivers/demo/demo-shape.c   | 2 +-
 drivers/demo/demo-simple.c  | 2 +-
 drivers/gpio/sandbox.c  | 2 +-
 include/dm/device.h | 6 +++---
 test/dm/test-fdt.c  | 2 +-
 7 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/doc/driver-model/README.txt b/doc/driver-model/README.txt
index dcecb9a..4af89b0 100644
--- a/doc/driver-model/README.txt
+++ b/doc/driver-model/README.txt
@@ -315,7 +315,7 @@ is little or no 'driver model' code to write.
 - Moved some data from code into data structure - e.g. store a pointer to
 the driver operations structure in the driver, rather than passing it
 to the driver bind function.
-- Rename some structures to make them more similar to Linux (struct device
+- Rename some structures to make them more similar to Linux (struct udevice
 instead of struct instance, struct platdata, etc.)
 - Change the name 'core' to 'uclass', meaning U-Boot class. It seems that
 this concept relates to a class of drivers (or a subsystem). We shouldn't
diff --git a/drivers/core/lists.c b/drivers/core/lists.c
index 205b140..9f2917f 100644
--- a/drivers/core/lists.c
+++ b/drivers/core/lists.c
@@ -94,7 +94,7 @@ int lists_bind_drivers(struct udevice *parent)
  * tree error
  */
 static int driver_check_compatible(const void *blob, int offset,
-  const struct device_id *of_match)
+  const struct udevice_id *of_match)
 {
int ret;
 
diff --git a/drivers/demo/demo-shape.c b/drivers/demo/demo-shape.c
index a68cc10..3fa9c59 100644
--- a/drivers/demo/demo-shape.c
+++ b/drivers/demo/demo-shape.c
@@ -111,7 +111,7 @@ static int shape_ofdata_to_platdata(struct udevice *dev)
return 0;
 }
 
-static const struct device_id demo_shape_id[] = {
+static const struct udevice_id demo_shape_id[] = {
{ demo-shape, 0 },
{ },
 };
diff --git a/drivers/demo/demo-simple.c b/drivers/demo/demo-simple.c
index 11def86..2bcb7df 100644
--- a/drivers/demo/demo-simple.c
+++ b/drivers/demo/demo-simple.c
@@ -32,7 +32,7 @@ static int demo_shape_ofdata_to_platdata(struct udevice *dev)
return demo_parse_dt(dev);
 }
 
-static const struct device_id demo_shape_id[] = {
+static const struct udevice_id demo_shape_id[] = {
{ demo-simple, 0 },
{ },
 };
diff --git a/drivers/gpio/sandbox.c b/drivers/gpio/sandbox.c
index 09cebe2..75ada5d 100644
--- a/drivers/gpio/sandbox.c
+++ b/drivers/gpio/sandbox.c
@@ -239,7 +239,7 @@ static int gpio_sandbox_probe(struct udevice *dev)
return 0;
 }
 
-static const struct device_id sandbox_gpio_ids[] = {
+static const struct udevice_id sandbox_gpio_ids[] = {
{ .compatible = sandbox,gpio },
{ }
 };
diff --git a/include/dm/device.h b/include/dm/device.h
index ec04982..19f2039 100644
--- a/include/dm/device.h
+++ b/include/dm/device.h
@@ -75,11 +75,11 @@ struct udevice {
 #define device_active(dev) ((dev)-flags  DM_FLAG_ACTIVATED)
 
 /**
- * struct device_id - Lists the compatible strings supported by a driver
+ * struct udevice_id - Lists the compatible strings supported by a driver
  * @compatible: Compatible string
  * @data: Data for this compatible string
  */
-struct device_id {
+struct udevice_id {
const char *compatible;
ulong data;
 };
@@ -121,7 +121,7 @@ struct device_id {
 struct driver {
char *name;
enum uclass_id id;
-   const struct device_id *of_match;
+   const struct udevice_id *of_match;
int (*bind)(struct udevice *dev);
int (*probe)(struct udevice *dev);
int (*remove)(struct udevice *dev);
diff --git a/test/dm/test-fdt.c b/test/dm/test-fdt.c
index 6eccf11..98e3936 100644
--- a/test/dm/test-fdt.c
+++ b/test/dm/test-fdt.c
@@ -53,7 +53,7 @@ static int testfdt_drv_probe(struct udevice *dev)
return 0;
 }
 
-static const struct device_id testfdt_ids[] = {
+static const struct udevice_id testfdt_ids[] = {
{
.compatible = denx,u-boot-fdt-test,
.data = DM_TEST_TYPE_FIRST },
-- 
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 v4 01/15] Add an I/O tracing feature

2014-06-06 Thread Simon Glass
When debugging drivers it is useful to see what I/O accesses were done
and in what order.

Even if the individual accesses are of little interest it can be useful to
verify that the access pattern is consistent each time an operation is
performed. In this case a checksum can be used to characterise the operation
of a driver. The checksum can be compared across different runs of the
operation to verify that the driver is working properly.

In particular, when performing major refactoring of the driver, where the
access pattern should not change, the checksum provides assurance that the
refactoring work has not broken the driver.

Add an I/O tracing feature and associated commands to provide this facility.
It works by sneaking into the io.h heder for an architecture and redirecting
I/O accesses through its tracing mechanism.

For now no commands are provided to examine the trace buffer. The format is
fairly simple, so 'md' is a reasonable substitute.

Note: The checksum feature is only useful for I/O regions where the contents
do not change outside of software control. Where this is not suitable you can
fall back to manually comparing the addresses. It might be useful to enhance
tracing to only checksum the accesses and not the data read/written.

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

Changes in v4: None
Changes in v3:
- Remove use of bool in header file to avoid exynos5 build failure

Changes in v2:
- Add a new patch for an I/O tracing feature

 README   |  23 +++
 common/Makefile  |   2 +
 common/cmd_iotrace.c |  73 ++
 common/iotrace.c | 169 +++
 include/iotrace.h| 104 +++
 5 files changed, 371 insertions(+)
 create mode 100644 common/cmd_iotrace.c
 create mode 100644 common/iotrace.c
 create mode 100644 include/iotrace.h

diff --git a/README b/README
index 6edb2e7..a53f69a 100644
--- a/README
+++ b/README
@@ -1000,6 +1000,7 @@ The following options need to be configured:
CONFIG_CMD_IMLS   List all images found in NOR flash
CONFIG_CMD_IMLS_NAND* List all images found in NAND flash
CONFIG_CMD_IMMAP* IMMR dump support
+   CONFIG_CMD_IOTRACE  * I/O tracing for debugging
CONFIG_CMD_IMPORTENV* import an environment
CONFIG_CMD_INI  * import data from an ini file into the 
env
CONFIG_CMD_IRQ  * irqinfo
@@ -1171,6 +1172,28 @@ The following options need to be configured:
Note that if the GPIO device uses I2C, then the I2C interface
must also be configured. See I2C Support, below.
 
+- I/O tracing:
+   When CONFIG_IO_TRACE is selected, U-Boot intercepts all I/O
+   accesses and can checksum them or write a list of them out
+   to memory. See the 'iotrace' command for details. This is
+   useful for testing device drivers since it can confirm that
+   the driver behaves the same way before and after a code
+   change. Currently this is supported on sandbox and arm. To
+   add support for your architecture, add '#include iotrace.h'
+   to the bottom of arch/arch/include/asm/io.h and test.
+
+   Example output from the 'iotrace stats' command is below.
+   Note that if the trace buffer is exhausted, the checksum will
+   still continue to operate.
+
+   iotrace is enabled
+   Start:  1000(buffer start address)
+   Size:   0001(buffer size)
+   Offset: 0120(current buffer offset)
+   Output: 1120(start + offset)
+   Count:  0018(number of trace records)
+   CRC32:  9526fb66(CRC32 of all trace records)
+
 - Timestamp Support:
 
When CONFIG_TIMESTAMP is selected, the timestamp
diff --git a/common/Makefile b/common/Makefile
index 391a8d6..7e192c7 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -114,6 +114,7 @@ obj-$(CONFIG_CMD_FUSE) += cmd_fuse.o
 obj-$(CONFIG_CMD_GETTIME) += cmd_gettime.o
 obj-$(CONFIG_CMD_GPIO) += cmd_gpio.o
 obj-$(CONFIG_CMD_I2C) += cmd_i2c.o
+obj-$(CONFIG_CMD_IOTRACE) += cmd_iotrace.o
 obj-$(CONFIG_CMD_HASH) += cmd_hash.o
 obj-$(CONFIG_CMD_IDE) += cmd_ide.o
 obj-$(CONFIG_CMD_IMMAP) += cmd_immap.o
@@ -261,6 +262,7 @@ obj-$(CONFIG_ANDROID_BOOT_IMAGE) += image-android.o
 obj-$(CONFIG_OF_LIBFDT) += image-fdt.o
 obj-$(CONFIG_FIT) += image-fit.o
 obj-$(CONFIG_FIT_SIGNATURE) += image-sig.o
+obj-$(CONFIG_IO_TRACE) += iotrace.o
 obj-y += memsize.o
 obj-y += stdio.o
 
diff --git a/common/cmd_iotrace.c b/common/cmd_iotrace.c
new file mode 100644
index 000..f54276d
--- /dev/null
+++ b/common/cmd_iotrace.c
@@ -0,0 +1,73 @@
+/*
+ * Copyright 

[U-Boot] [PATCH v4 07/15] dm: Use case-insensitive comparison for GPIO banks

2014-06-06 Thread Simon Glass
We want 'N0' and 'n0' to mean the same thing, so ensure that case is not
considered when naming GPIO banks.

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

Changes in v4: None
Changes in v3: None
Changes in v2:
- Add new patch to use case-insensitive comparison for GPIO banks

 drivers/gpio/gpio-uclass.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpio/gpio-uclass.c b/drivers/gpio/gpio-uclass.c
index fa2c2fb..f1bbc58 100644
--- a/drivers/gpio/gpio-uclass.c
+++ b/drivers/gpio/gpio-uclass.c
@@ -58,7 +58,7 @@ int gpio_lookup_name(const char *name, struct udevice **devp,
uc_priv = dev-uclass_priv;
len = uc_priv-bank_name ? strlen(uc_priv-bank_name) : 0;
 
-   if (!strncmp(name, uc_priv-bank_name, len)) {
+   if (!strncasecmp(name, uc_priv-bank_name, len)) {
if (strict_strtoul(name + len, 10, offset))
continue;
if (devp)
-- 
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 v4 02/15] arm: Support iotrace feature

2014-06-06 Thread Simon Glass
Support the iotrace feature for ARM, when enabled.

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

Changes in v4: None
Changes in v3: None
Changes in v2:
- Add a new patch to enable iotrace for arm

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

diff --git a/arch/arm/include/asm/io.h b/arch/arm/include/asm/io.h
index 6a1f05a..9f35fd6 100644
--- a/arch/arm/include/asm/io.h
+++ b/arch/arm/include/asm/io.h
@@ -437,4 +437,7 @@ out:
 
 #endif /* __mem_isa */
 #endif /* __KERNEL__ */
+
+#include iotrace.h
+
 #endif /* __ASM_ARM_IO_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 v4 04/15] Makefile: Support include files for .dts files

2014-06-06 Thread Simon Glass
Linux supports this, and if we are to have compatible device tree files,
U-Boot should also.

Avoid giving the device tree files access to U-Boot's include/ directory.
Only include/dt-bindings is accessible.


Signed-off-by: Simon Glass s...@chromium.org
Acked-by: Stephen Warren swar...@nvidia.com
Reviewed-by: Masahiro Yamada yamad...@jp.panasonic.com
---

Changes in v4: None
Changes in v3:
- Create a symlink for each arch to dt-bindings

Changes in v2:
- Add new patch to support include files for .dts files

 arch/arm/dts/include/dt-bindings| 1 +
 arch/microblaze/dts/include/dt-bindings | 1 +
 arch/sandbox/dts/include/dt-bindings| 1 +
 arch/x86/dts/include/dt-bindings| 1 +
 scripts/Makefile.lib| 1 +
 5 files changed, 5 insertions(+)
 create mode 12 arch/arm/dts/include/dt-bindings
 create mode 12 arch/microblaze/dts/include/dt-bindings
 create mode 12 arch/sandbox/dts/include/dt-bindings
 create mode 12 arch/x86/dts/include/dt-bindings

diff --git a/arch/arm/dts/include/dt-bindings b/arch/arm/dts/include/dt-bindings
new file mode 12
index 000..0cecb3d
--- /dev/null
+++ b/arch/arm/dts/include/dt-bindings
@@ -0,0 +1 @@
+../../../../include/dt-bindings
\ No newline at end of file
diff --git a/arch/microblaze/dts/include/dt-bindings 
b/arch/microblaze/dts/include/dt-bindings
new file mode 12
index 000..0cecb3d
--- /dev/null
+++ b/arch/microblaze/dts/include/dt-bindings
@@ -0,0 +1 @@
+../../../../include/dt-bindings
\ No newline at end of file
diff --git a/arch/sandbox/dts/include/dt-bindings 
b/arch/sandbox/dts/include/dt-bindings
new file mode 12
index 000..0cecb3d
--- /dev/null
+++ b/arch/sandbox/dts/include/dt-bindings
@@ -0,0 +1 @@
+../../../../include/dt-bindings
\ No newline at end of file
diff --git a/arch/x86/dts/include/dt-bindings b/arch/x86/dts/include/dt-bindings
new file mode 12
index 000..0cecb3d
--- /dev/null
+++ b/arch/x86/dts/include/dt-bindings
@@ -0,0 +1 @@
+../../../../include/dt-bindings
\ No newline at end of file
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index a04439d..722afed 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -153,6 +153,7 @@ ld_flags   = $(LDFLAGS) $(ldflags-y)
 # Modified for U-Boot
 dtc_cpp_flags  = -Wp,-MD,$(depfile).pre.tmp -nostdinc\
 -I$(srctree)/arch/$(ARCH)/dts   \
+-I$(srctree)/arch/$(ARCH)/dts/include   \
 -undef -D__DTS__
 
 # Finds the multi-part object the current object will be linked into
-- 
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 v4 14/15] dm: Tidy up four minor code nits

2014-06-06 Thread Simon Glass
There is a spelling mistake and two functions are missing comments
altogether. Also the flags declaration is correct, but doesn't follow
style. Finally, the uclass_get_device() function has some errors in
its documentation.

Fix these problems.


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

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

 include/dm/device.h |  2 +-
 include/dm/lists.h  | 20 
 include/dm/root.h   |  2 +-
 include/dm/uclass.h |  6 --
 4 files changed, 26 insertions(+), 4 deletions(-)

diff --git a/include/dm/device.h b/include/dm/device.h
index 19f2039..ae75a3f 100644
--- a/include/dm/device.h
+++ b/include/dm/device.h
@@ -21,7 +21,7 @@ struct driver_info;
 #define DM_FLAG_ACTIVATED  (1  0)
 
 /* DM is responsible for allocating and freeing platdata */
-#define DM_FLAG_ALLOC_PDATA(2  0)
+#define DM_FLAG_ALLOC_PDATA(1  1)
 
 /**
  * struct udevice - An instance of a driver
diff --git a/include/dm/lists.h b/include/dm/lists.h
index 7feba4b..49d87e6 100644
--- a/include/dm/lists.h
+++ b/include/dm/lists.h
@@ -32,8 +32,28 @@ struct driver *lists_driver_lookup_name(const char *name);
  */
 struct uclass_driver *lists_uclass_lookup(enum uclass_id id);
 
+/**
+ * lists_bind_drivers() - search for and bind all drivers to parent
+ *
+ * This searches the U_BOOT_DEVICE() structures and creates new devices for
+ * each one. The devices will have @parent as their parent.
+ *
+ * @parent: parent driver (root)
+ * @early_only: If true, bind only drivers with the DM_INIT_F flag. If false
+ * bind all drivers.
+ */
 int lists_bind_drivers(struct udevice *parent);
 
+/**
+ * lists_bind_fdt() - bind a device tree node
+ *
+ * This creates a new device bound to the given device tree node, with
+ * @parent as its parent.
+ *
+ * @parent: parent driver (root)
+ * @blob: device tree blob
+ * @offset: offset of this device tree node
+ */
 int lists_bind_fdt(struct udevice *parent, const void *blob, int offset);
 
 #endif
diff --git a/include/dm/root.h b/include/dm/root.h
index 3018bc8..a4826a6 100644
--- a/include/dm/root.h
+++ b/include/dm/root.h
@@ -41,7 +41,7 @@ int dm_scan_platdata(void);
 int dm_scan_fdt(const void *blob);
 
 /**
- * dm_init() - Initialize Driver Model structures
+ * dm_init() - Initialise Driver Model structures
  *
  * This function will initialize roots of driver tree and class tree.
  * This needs to be called before anything uses the DM
diff --git a/include/dm/uclass.h b/include/dm/uclass.h
index 931d9c0..0df2e5e 100644
--- a/include/dm/uclass.h
+++ b/include/dm/uclass.h
@@ -96,12 +96,14 @@ int uclass_get(enum uclass_id key, struct uclass **ucp);
 /**
  * uclass_get_device() - Get a uclass device based on an ID and index
  *
+ * The device is probed to activate it ready for use.
+ *
  * id: ID to look up
  * @index: Device number within that uclass (0=first)
- * @ucp: Returns pointer to uclass (there is only one per for each ID)
+ * devp: Returns pointer to device (there is only one per for each ID)
  * @return 0 if OK, -ve on error
  */
-int uclass_get_device(enum uclass_id id, int index, struct udevice **ucp);
+int uclass_get_device(enum uclass_id id, int index, struct udevice **devp);
 
 /**
  * uclass_first_device() - Get the first device in a uclass
-- 
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 v4 11/15] dm: Fix printf() strings in the 'dm' command

2014-06-06 Thread Simon Glass
The values here are int, but the map_to_sysmem() call can return a long.
Add a cast to deal with this.

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

Changes in v4: None
Changes in v3: None
Changes in v2:
- Add new patch to fix printf() strings in the 'dm' command

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

diff --git a/test/dm/cmd_dm.c b/test/dm/cmd_dm.c
index 180661b..8019407 100644
--- a/test/dm/cmd_dm.c
+++ b/test/dm/cmd_dm.c
@@ -23,7 +23,7 @@ static int display_succ(struct udevice *in, char *buf)
char local[16];
struct udevice *pos, *n, *prev = NULL;
 
-   printf(%s- %s @ %08x, buf, in-name, map_to_sysmem(in));
+   printf(%s- %s @ %08x, buf, in-name, (uint)map_to_sysmem(in));
if (in-flags  DM_FLAG_ACTIVATED)
puts( - activated);
puts(\n);
@@ -62,7 +62,7 @@ static int do_dm_dump_all(cmd_tbl_t *cmdtp, int flag, int 
argc,
struct udevice *root;
 
root = dm_root();
-   printf(ROOT %08x\n, map_to_sysmem(root));
+   printf(ROOT %08x\n, (uint)map_to_sysmem(root));
return dm_dump(root);
 }
 
@@ -84,8 +84,8 @@ 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(  %s @  %08x:\n, dev-name,
-  map_to_sysmem(dev));
+   printf(  %s @ %08x:\n, dev-name,
+  (uint)map_to_sysmem(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 v4 15/15] dm: Expand and improve the device lifecycle docs

2014-06-06 Thread Simon Glass
The lifecycle of a device is an important part of driver model. Add to the
existing documentation and clarify it.

Reported-by: Jon Loeliger j...@jdl.com

Signed-off-by: Simon Glass s...@chromium.org
---
Thanks for Jon Loeliger j...@jdl.com for helping with the text and
suggesting improvements.

(Jon please comment/adjust to help clarify things further)

Changes in v4:
- Minor spelling fixes

Changes in v3: None
Changes in v2:
- Rename struct device to struct udevice
- Adjust docs as per Jon's review

 doc/driver-model/README.txt | 215 ++--
 1 file changed, 208 insertions(+), 7 deletions(-)

diff --git a/doc/driver-model/README.txt b/doc/driver-model/README.txt
index 4af89b0..884acef 100644
--- a/doc/driver-model/README.txt
+++ b/doc/driver-model/README.txt
@@ -222,7 +222,44 @@ device tree) and probe.
 Platform Data
 -
 
-Where does the platform data come from? See demo-pdata.c which
+Platform data is like Linux platform data, if you are familiar with that.
+It provides the board-specific information to start up a device.
+
+Why is this information not just stored in the device driver itself? The
+idea is that the device driver is generic, and can in principle operate on
+any board that has that type of device. For example, with modern
+highly-complex SoCs it is common for the IP to come from an IP vendor, and
+therefore (for example) the MMC controller may be the same on chips from
+different vendors. It makes no sense to write independent drivers for the
+MMC controller on each vendor's SoC, when they are all almost the same.
+Similarly, we may have 6 UARTs in an SoC, all of which are mostly the same,
+but lie at different addresses in the address space.
+
+Using the UART example, we have a single driver and it is instantiated 6
+times by supplying 6 lots of platform data. Each lot of platform data
+gives the driver name and a pointer to a structure containing information
+about this instance - e.g. the address of the register space. It may be that
+one of the UARTS supports RS-485 operation - this can be added as a flag in
+the platform data, which is set for this one port and clear for the rest.
+
+Think of your driver as a generic piece of code which knows how to talk to
+a device, but needs to know where it is, any variant/option information and
+so on. Platform data provides this link between the generic piece of code
+and the specific way it is bound on a particular board.
+
+Examples of platform data include:
+
+   - The base address of the IP block's register space
+   - Configuration options, like:
+ - the SPI polarity and maximum speed for a SPI controller
+ - the I2C speed to use for an I2C device
+ - the number of GPIOs available in a GPIO device
+
+Where does the platform data come from? It is either held in a structure
+which is compiled into U-Boot, or it can be parsed from the Device Tree
+(see 'Device Tree' below).
+
+For an example of how it can be compiled in, see demo-pdata.c which
 sets up a table of driver names and their associated platform data.
 The data can be interpreted by the drivers however they like - it is
 basically a communication scheme between the board-specific code and
@@ -259,21 +296,30 @@ following device tree fragment:
sides = 4;
};
 
+This means that instead of having lots of U_BOOT_DEVICE() declarations in
+the board file, we put these in the device tree. This approach allows a lot
+more generality, since the same board file can support many types of boards
+(e,g. with the same SoC) just by using different device trees. An added
+benefit is that the Linux device tree can be used, thus further simplifying
+the task of board-bring up either for U-Boot or Linux devs (whoever gets to
+the baord first!).
 
 The easiest way to make this work it to add a few members to the driver:
 
.platdata_auto_alloc_size = sizeof(struct dm_test_pdata),
.ofdata_to_platdata = testfdt_ofdata_to_platdata,
-   .probe  = testfdt_drv_probe,
 
 The 'auto_alloc' feature allowed space for the platdata to be allocated
-and zeroed before the driver's ofdata_to_platdata method is called. This
-method reads the information out of the device tree and puts it in
-dev-platdata. Then the probe method is called to set up the device.
+and zeroed before the driver's ofdata_to_platdata() method is called. The
+ofdata_to_platdata() method, which the driver write supplies, should parse
+the device tree node for this device and place it in dev-platdata. Thus
+when the probe method is called later (to set up the device ready for use)
+the platform data will be present.
 
 Note that both methods are optional. If you provide an ofdata_to_platdata
-method then it wlil be called first (after bind). If you provide a probe
-method it will be called next.
+method then it wlil be called first (during activation). If you provide a
+probe method it will be called next. See Driver Lifecycle below 

[U-Boot] [PATCH v4 06/15] dm: Update README to encourage conversion to driver model

2014-06-06 Thread Simon Glass
Add a note to encourage people to convert drivers to use driver model.

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

Changes in v4: None
Changes in v3: None
Changes in v2:
- Update README to encourage conversion to driver model

 README | 5 +
 1 file changed, 5 insertions(+)

diff --git a/README b/README
index a53f69a..c7b911b 100644
--- a/README
+++ b/README
@@ -5310,6 +5310,11 @@ Information structure as we define in 
include/asm-arch/u-boot.h,
 and make sure that your definition of IMAP_ADDR uses the same value
 as your U-Boot configuration in CONFIG_SYS_IMMR.
 
+Note that U-Boot now has a driver model, a unified model for drivers.
+If you are adding a new driver, plumb it into driver model. If there
+is no uclass available, you are encouraged to create one. See
+doc/driver-model.
+
 
 Configuring the Linux kernel:
 -
-- 
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 v4 09/15] dm: Cast away the const-ness of the global_data pointer

2014-06-06 Thread Simon Glass
In a very few cases we need to adjust the driver model root device, such as
when setting it up at initialisation. Add a macro to make this easier.

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

Changes in v4: None
Changes in v3:
- Fix typo in commit subject

Changes in v2:
- Add new patch to deal with const-ness of the global_data pointer

 drivers/core/root.c  | 6 +++---
 drivers/core/uclass.c| 2 +-
 include/dm/device-internal.h | 4 
 3 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/core/root.c b/drivers/core/root.c
index f31be72..70ea97f 100644
--- a/drivers/core/root.c
+++ b/drivers/core/root.c
@@ -43,9 +43,9 @@ int dm_init(void)
dm_warn(Virtual root driver already exists!\n);
return -EINVAL;
}
-   INIT_LIST_HEAD(gd-uclass_root);
+   INIT_LIST_HEAD(DM_UCLASS_ROOT());
 
-   ret = device_bind_by_name(NULL, root_info, gd-dm_root);
+   ret = device_bind_by_name(NULL, root_info, DM_ROOT());
if (ret)
return ret;
 
@@ -56,7 +56,7 @@ int dm_scan_platdata(void)
 {
int ret;
 
-   ret = lists_bind_drivers(gd-dm_root);
+   ret = lists_bind_drivers(DM_ROOT());
if (ret == -ENOENT) {
dm_warn(Some drivers were not found\n);
ret = 0;
diff --git a/drivers/core/uclass.c b/drivers/core/uclass.c
index f6867e4..d16d6fc 100644
--- a/drivers/core/uclass.c
+++ b/drivers/core/uclass.c
@@ -75,7 +75,7 @@ static int uclass_add(enum uclass_id id, struct uclass **ucp)
uc-uc_drv = uc_drv;
INIT_LIST_HEAD(uc-sibling_node);
INIT_LIST_HEAD(uc-dev_head);
-   list_add(uc-sibling_node, gd-uclass_root);
+   list_add(uc-sibling_node, DM_UCLASS_ROOT());
 
if (uc_drv-init) {
ret = uc_drv-init(uc);
diff --git a/include/dm/device-internal.h b/include/dm/device-internal.h
index ea3df36..67318fa 100644
--- a/include/dm/device-internal.h
+++ b/include/dm/device-internal.h
@@ -84,4 +84,8 @@ int device_remove(struct udevice *dev);
  */
 int device_unbind(struct udevice *dev);
 
+/* Cast away any volatile pointer */
+#define DM_ROOT()  (((gd_t *)gd)-dm_root)
+#define DM_UCLASS_ROOT()   (((gd_t *)gd)-uclass_root)
+
 #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 v4 12/15] tegra: dts: Bring in GPIO bindings from linux

2014-06-06 Thread Simon Glass
These files are taken from Linux 3.14.


Signed-off-by: Simon Glass s...@chromium.org
Acked-by: Stephen Warren swar...@nvidia.com
---

Changes in v4:
- Remove 64-bit addresses which are not used in U-Boot

Changes in v3:
- Bring in GPIO bindings for tegra{30,114,124} also

Changes in v2:
- Add new patch to bring in Tegra device tree files from linux

 arch/arm/dts/tegra114.dtsi | 21 +
 arch/arm/dts/tegra124.dtsi | 19 
 arch/arm/dts/tegra20.dtsi  | 15 ++-
 arch/arm/dts/tegra30.dtsi  | 21 +
 include/dt-bindings/gpio/gpio.h| 15 +++
 include/dt-bindings/gpio/tegra-gpio.h  | 51 ++
 include/dt-bindings/interrupt-controller/arm-gic.h | 22 ++
 include/dt-bindings/interrupt-controller/irq.h | 19 
 8 files changed, 155 insertions(+), 28 deletions(-)
 create mode 100644 include/dt-bindings/gpio/gpio.h
 create mode 100644 include/dt-bindings/gpio/tegra-gpio.h
 create mode 100644 include/dt-bindings/interrupt-controller/arm-gic.h
 create mode 100644 include/dt-bindings/interrupt-controller/irq.h

diff --git a/arch/arm/dts/tegra114.dtsi b/arch/arm/dts/tegra114.dtsi
index f52fcf1..59434e0 100644
--- a/arch/arm/dts/tegra114.dtsi
+++ b/arch/arm/dts/tegra114.dtsi
@@ -1,3 +1,6 @@
+#include dt-bindings/gpio/tegra-gpio.h
+#include dt-bindings/interrupt-controller/arm-gic.h
+
 #include skeleton.dtsi
 
 / {
@@ -46,17 +49,17 @@
  0 143 0x04;
};
 
-   gpio: gpio {
+   gpio: gpio@6000d000 {
compatible = nvidia,tegra114-gpio, nvidia,tegra30-gpio;
reg = 0x6000d000 0x1000;
-   interrupts = 0 32 0x04
- 0 33 0x04
- 0 34 0x04
- 0 35 0x04
- 0 55 0x04
- 0 87 0x04
- 0 89 0x04
- 0 125 0x04;
+   interrupts = GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH,
+GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH,
+GIC_SPI 34 IRQ_TYPE_LEVEL_HIGH,
+GIC_SPI 35 IRQ_TYPE_LEVEL_HIGH,
+GIC_SPI 55 IRQ_TYPE_LEVEL_HIGH,
+GIC_SPI 87 IRQ_TYPE_LEVEL_HIGH,
+GIC_SPI 89 IRQ_TYPE_LEVEL_HIGH,
+GIC_SPI 125 IRQ_TYPE_LEVEL_HIGH;
#gpio-cells = 2;
gpio-controller;
#interrupt-cells = 2;
diff --git a/arch/arm/dts/tegra124.dtsi b/arch/arm/dts/tegra124.dtsi
index 18a8b24..4561c5f 100644
--- a/arch/arm/dts/tegra124.dtsi
+++ b/arch/arm/dts/tegra124.dtsi
@@ -1,3 +1,6 @@
+#include dt-bindings/gpio/tegra-gpio.h
+#include dt-bindings/interrupt-controller/arm-gic.h
+
 #include skeleton.dtsi
 
 / {
@@ -49,14 +52,14 @@
gpio: gpio@6000d000 {
compatible = nvidia,tegra124-gpio, nvidia,tegra30-gpio;
reg = 0x6000d000 0x1000;
-   interrupts = 0 32 0x04
- 0 33 0x04
- 0 34 0x04
- 0 35 0x04
- 0 55 0x04
- 0 87 0x04
- 0 89 0x04
- 0 125 0x04;
+   interrupts = GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH,
+GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH,
+GIC_SPI 34 IRQ_TYPE_LEVEL_HIGH,
+GIC_SPI 35 IRQ_TYPE_LEVEL_HIGH,
+GIC_SPI 55 IRQ_TYPE_LEVEL_HIGH,
+GIC_SPI 87 IRQ_TYPE_LEVEL_HIGH,
+GIC_SPI 89 IRQ_TYPE_LEVEL_HIGH,
+GIC_SPI 125 IRQ_TYPE_LEVEL_HIGH;
#gpio-cells = 2;
gpio-controller;
#interrupt-cells = 2;
diff --git a/arch/arm/dts/tegra20.dtsi b/arch/arm/dts/tegra20.dtsi
index 3805750..a524f6e 100644
--- a/arch/arm/dts/tegra20.dtsi
+++ b/arch/arm/dts/tegra20.dtsi
@@ -1,3 +1,6 @@
+#include dt-bindings/gpio/tegra-gpio.h
+#include dt-bindings/interrupt-controller/arm-gic.h
+
 #include skeleton.dtsi
 
 / {
@@ -139,10 +142,18 @@
 
gpio: gpio@6000d000 {
compatible = nvidia,tegra20-gpio;
-   reg =  0x6000d000 0x1000 ;
-   interrupts =  64 65 66 67 87 119 121 ;
+   reg = 0x6000d000 0x1000;
+   interrupts = GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH,
+GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH,
+GIC_SPI 34 IRQ_TYPE_LEVEL_HIGH,
+GIC_SPI 35 IRQ_TYPE_LEVEL_HIGH,
+GIC_SPI 55 IRQ_TYPE_LEVEL_HIGH,
+GIC_SPI 87 IRQ_TYPE_LEVEL_HIGH,
+GIC_SPI 89 

[U-Boot] [PATCH v4 13/15] tegra: Enable driver model

2014-06-06 Thread Simon Glass
Enable driver model for Tegra boards.


Signed-off-by: Simon Glass s...@chromium.org
Acked-by: Stephen Warren swar...@nvidia.com
---

Changes in v4: None
Changes in v3:
- Enable dm command in this patch instead of the next

Changes in v2:
- Split out a separate patch to enable driver model for tegra

 include/configs/tegra-common.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/include/configs/tegra-common.h b/include/configs/tegra-common.h
index 129acf2..3b88a83 100644
--- a/include/configs/tegra-common.h
+++ b/include/configs/tegra-common.h
@@ -19,6 +19,9 @@
 
 #include asm/arch/tegra.h/* get chip and board defs */
 
+#define CONFIG_DM
+#define CONFIG_CMD_DM
+
 #define CONFIG_SYS_TIMER_RATE  100
 #define CONFIG_SYS_TIMER_COUNTER   NV_PA_TMRUS_BASE
 
-- 
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 v4 10/15] dm: Allow driver model tests only for sandbox

2014-06-06 Thread Simon Glass
The GPIO tests require the sandbox GPIO driver, so cannot be run on other
platforms. Similarly for the 'dm test' command.

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

Changes in v4: None
Changes in v3: None
Changes in v2:
- Add new patch to allow driver model tests only for sandbox

 test/dm/Makefile |  2 ++
 test/dm/cmd_dm.c | 11 +--
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/test/dm/Makefile b/test/dm/Makefile
index 4e9afe6..c0f2135 100644
--- a/test/dm/Makefile
+++ b/test/dm/Makefile
@@ -15,4 +15,6 @@ obj-$(CONFIG_DM_TEST) += ut.o
 # subsystem you must add sandbox tests here.
 obj-$(CONFIG_DM_TEST) += core.o
 obj-$(CONFIG_DM_TEST) += ut.o
+ifneq ($(CONFIG_SANDBOX),)
 obj-$(CONFIG_DM_GPIO) += gpio.o
+endif
diff --git a/test/dm/cmd_dm.c b/test/dm/cmd_dm.c
index 083f15c..180661b 100644
--- a/test/dm/cmd_dm.c
+++ b/test/dm/cmd_dm.c
@@ -93,16 +93,23 @@ static int do_dm_dump_uclass(cmd_tbl_t *cmdtp, int flag, 
int argc,
return 0;
 }
 
+#ifdef CONFIG_DM_TEST
 static int do_dm_test(cmd_tbl_t *cmdtp, int flag, int argc,
  char * const argv[])
 {
return dm_test_main();
 }
+#define TEST_HELP \ndm test Run tests
+#else
+#define TEST_HELP
+#endif
 
 static cmd_tbl_t test_commands[] = {
U_BOOT_CMD_MKENT(tree, 0, 1, do_dm_dump_all, , ),
U_BOOT_CMD_MKENT(uclass, 1, 1, do_dm_dump_uclass, , ),
+#ifdef CONFIG_DM_TEST
U_BOOT_CMD_MKENT(test, 1, 1, do_dm_test, , ),
+#endif
 };
 
 static int do_dm(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
@@ -128,6 +135,6 @@ U_BOOT_CMD(
dm, 2,  1,  do_dm,
Driver model low level access,
tree Dump driver model tree\n
-   dm uclassDump list of instances for each uclass\n
-   dm test Run tests
+   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


Re: [U-Boot] Unable to boot the new FIT image

2014-06-06 Thread Simon Glass
Hi Harsha,

On 3 June 2014 22:40, Harsha Kiran harshakiran...@gmail.com wrote:

 Hi Simon,

 On Tue, Jun 3, 2014 at 9:58 PM, Simon Glass s...@chromium.org wrote:

 Hi Harsha,

 On 3 June 2014 20:29, Harsha Kiran harshakiran...@gmail.com wrote:
  Hi Simon,
 
  I was able to succesfully test the Secure u-boot on the beaglebone black
  from the u-boot-x86 Bone git.
  Thanks for all the help and it was a great beaglebone_vboot.txt file !

 Good!

 
  I have some of minor things i would like to mention when i followed the
  procedure.
 
  1) in the 7th step
 
  7. Put U-Boot and the kernel onto the board
  ---
  The MLO information is missing..

 In my case I already had this on the card. Do you have instructions
 for what you followed?


 Harsha: I have formated my SD card into 2 partitions(boot and rootfs). in my
 boot partition, i have MLO,u-boot.img,image.fit,uEnv.txt and in the other
 partition i have the root filesystem.

OK - in the instructions I talk about copying the Angstrom image to
the SD card and it has these. Do you think I should add instructions
on how to do this yourself from scratch, instead of using the image?

 Instructions: I just copied them directly
 harsha@harshakiran_kasha:/abb/Verified-uboot/u-boot-x86$ sudo cp MLO
 /media/harsha/boot/
 harsha@harshakiran_kasha:/abb/Verified-uboot/u-boot-x86$ sudo cp u-boot.img
 /media/harsha/boot/
 harsha@harshakiran_kasha:/abb/Verified-uboot/u-boot-x86/doc/uImage.FIT$ sudo
 cp image.fit /media/harsha/boot/

 i used fatload command. i have to modify my uEnv.txt to load it without
 stoping in u-boot prompt.
 U-Boot# fatload mmc 0 0x8200 image.fit
 reading image.fit
 8580350 bytes read in 474 ms (17.3 MiB/s)

 U-Boot# bootm 0x8200
 ## Loading kernel from FIT Image at 8200 ...
Using 'conf@1' configuration



 
 
  2)
 
  I was not able to boot with kernel (image.lzo) in the FIT. it gave me
  the
  following error
  U-Boot# bootm 0x8200
 
  ## Loading kernel from FIT Image at 8200 ...
 Using 'conf@1' configuration
 Verifying Hash Integrity ... OK
 Trying 'kernel@1' kernel subimage
   Description:  unavailable
   Created:  2014-06-04   1:28:38 UTC
   Type: Kernel Image
   Compression:  lzo compressed
   Data Start:   0x82a8
   Data Size:8543704 Bytes = 8.1 MiB
 
   Architecture: ARM
   OS:   Linux
   Load Address: 0x80008000
   Entry Point:  0x80008000
   Hash algo:sha1
   Hash value:   9504d8fefcec81c054e2d0fb4e9d9b6bcfb9b4b7
 Verifying Hash Integrity ... sha1+ OK
 
  ## Loading fdt from FIT Image at 8200 ...
 Using 'conf@1' configuration
 Trying 'fdt@1' fdt subimage
   Description:  beaglebone-black
   Created:  2014-06-04   1:28:38 UTC
 
   Type: Flat Device Tree
   Compression:  uncompressed
   Data Start:   0x82825f68
   Data Size:34352 Bytes = 33.5 KiB
 
   Architecture: ARM
   Hash algo:sha1
   Hash value:   4b14973cf0fe4a40dc420ed55d2441c6f51f586b
 Verifying Hash Integrity ... sha1+ OK
 Booting using the fdt blob at 0x82825f68
 Uncompressing Kernel Image ... LZO: uncompress or overwrite error -1
  -
  must RESET board to recover
  resetting ...
 
  U-Boot SPL 2014.07-rc2 (Jun 03 2014 - 20:09:15)
  reading u-boot.img
  reading u-boot.img
 
  But when i switch it back to the zImage it worked good. I will check
  again
  on this.

 It might be the maximum image size:

 #define CONFIG_SYS_BOOTM_LEN (16  20)

 Is it possible that your kernel is larger than 16MB? Or that you
 forgot to compress it with lzop?

  Harsha: I am working on the TI SDK7 and took tisdk_am335x-evm_defconfig as
 my config file.  The default kernel compression mode is Gzip. My Image is 8
 MB and zImage is 4.1MB. Which compression mode is the best? I usually use
 the XZ mode as it gives me smallest binary (uImage 2.9 MB).

Yes XZ is good, but does U-Boot support it? It looks to be like you
didn't compress your kernel 'Image' file with lzop?




 Regards,
 Simon


 I have modified my signed image.fit in a HEX editor and loaded the image and
 it fails to load with the correct error..
 

 Entry Point:  0x80008000
  Hash algo:sha1
  Hash value:   3d72bc90b8afb5464cb03de2952d1bba90cd542e
Verifying Hash Integrity ... sha1 error!
 Bad hash value for 'hash@1' hash node in 'kernel@1' image node
 Bad Data Hash
 ERROR: can't get kernel image!
 U-Boot#
 U-Boot SPL 2014.07-rc2 (Jun 03 2014 - 20:09:15)

 But, this time i did not sign my image.fit. i just converted my
 kernel_fdt.its to image.fit file (To test the unsigned images)
 harsha@harshakiran_kasha:/abb/Verified-uboot/u-boot-x86/doc/uImage.FIT$ sudo
 ../../b/am335x_boneblack_vboot/tools/mkimage -f  kernel_fdt.its image.fit
 I am still able to load the image.fit successfully.! Should the singed
 u-boot.img allow the unsigned images to load??

 To sign my u-boot i used the following 

Re: [U-Boot] [PATCH 2/4] Add ctrlc_ignore environment variable to ignore Ctrl-C

2014-06-06 Thread Simon Glass
Hi Wolfgang,

On 5 June 2014 15:43, Wolfgang Denk w...@denx.de wrote:
 Dear Simon Glass,

 In message 1401992872-31985-3-git-send-email-...@chromium.org you wrote:
 Sometimes it is useful to ignore Ctrl-C, because checking for it causes the
 CLI to drop characters. In particular for tests involving sandbox, where
 input commands are piped in, some commands will call ctrlc() which will
 drop characters from the test script.

 Why would that be the case?

 If this happens, I consider it a bug that should be fixed, and not
 papered over.

If you look at the code for the 'md' command it calls ctrlc() every
now and then. Each call results in a getc() which reads a character
from the console. So we lose characters.


 Add a CONFIG_SYS_CTRLC_IGNORE option which enables this variable. If the
 variable is present (e.g. setenv ctrlc_ignore ignore) then no checking
 for Ctrl-C will be performed.

 I dislike this idea. It looks wrong to me.  Can we not fix the problem
 at the root cause?

I certainly thought about this. I even though maybe we might change
the serial module to scan ahead and buffer characters, in case there
is a Ctrl-C in the future. But that itself seems like something for
the future.

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


Re: [U-Boot] [Patch v4 2/5] ARMv8: Adjust MMU setup

2014-06-06 Thread York Sun
On 06/06/2014 10:32 AM, Mark Rutland wrote:
 How is TCR_EL2.SH0 (or TCR_EL1.SH*) configured?

 You'll only need to flush the cache if they're configured non shareable.

 It is configured as non shareable.
 
 Is there any reason not to configure them as inner shareable? That way
 the MMU will look in the D-cache, and you won't have to spend time
 flushing them.
 

Mark,

I appreciate the reminder. I tried on our emulator. With inner share set for TCR
SH0 bits, u-boot works with the flushing, but doesn't work without flushing. It
went to exception.

Can you share more information about the inner share? I need to follow up with
our designer to confirm.

York



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


Re: [U-Boot] [PATCH v4 15/15] dm: Expand and improve the device lifecycle docs

2014-06-06 Thread Pavel Herrmann
Hi,

I found some typos in this

On Friday 06 of June 2014 13:13:32 Simon Glass wrote:
 The lifecycle of a device is an important part of driver model. Add to the
 existing documentation and clarify it.

...snip...

 +This means that instead of having lots of U_BOOT_DEVICE() declarations in
 +the board file, we put these in the device tree. This approach allows a lot
 +more generality, since the same board file can support many types of
 boards +(e,g. with the same SoC) just by using different device trees. An
 added +benefit is that the Linux device tree can be used, thus further
 simplifying +the task of board-bring up either for U-Boot or Linux devs
 (whoever gets to +the baord first!).

s/baord/board/

...snip...

 +Note that compared to Linux, U-Boot's driver model has a separate step of
 +probe/remove which is independent of bind/unbind. This is partly because in
 +U-Boot it may be expensive to prove devices and we don't want to do it
 until +they are needed, or perhaps until after relocation.

s/prove/probe/

...snip...

 +   d. All parent devices are probed. It is not possible to activate a
 device +   unless its parents (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.
s/parents/predecessors/
in a tree, a node can have up to one parent. parent of a parent (recursively) 
is a predecessor.

...snip...

 +   e. The device is marked inactive. Note that it is still bound, so the
 +   device structure itself is not freed at this point. Should the device be
 +   activated again, then the cycle starts again at step 4 above.

if there were no drastic changes since I last checked, this would go to 
activation/probe(), which is described in step 2


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


Re: [U-Boot] [PATCH v4 05/15] dm: Rename struct device_id to udevice_id

2014-06-06 Thread Jon Loeliger
Didn't this hit upstream master already?
54c5d08a09e631f88738db54c75395c6457c2157

Or is this subsequent cleanup for straglers in this branch?

Thanks,
jdl

On Fri, Jun 6, 2014 at 2:13 PM, Simon Glass s...@chromium.org wrote:
 It is best to avoid having any occurence of 'struct device' in driver
 model, so rename to achieve this.

 - Add new patch to rename struct device_id to udevice_id

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

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

  doc/driver-model/README.txt | 2 +-
  drivers/core/lists.c| 2 +-
  drivers/demo/demo-shape.c   | 2 +-
  drivers/demo/demo-simple.c  | 2 +-
  drivers/gpio/sandbox.c  | 2 +-
  include/dm/device.h | 6 +++---
  test/dm/test-fdt.c  | 2 +-
  7 files changed, 9 insertions(+), 9 deletions(-)

 diff --git a/doc/driver-model/README.txt b/doc/driver-model/README.txt
 index dcecb9a..4af89b0 100644
 --- a/doc/driver-model/README.txt
 +++ b/doc/driver-model/README.txt
 @@ -315,7 +315,7 @@ is little or no 'driver model' code to write.
  - Moved some data from code into data structure - e.g. store a pointer to
  the driver operations structure in the driver, rather than passing it
  to the driver bind function.
 -- Rename some structures to make them more similar to Linux (struct device
 +- Rename some structures to make them more similar to Linux (struct udevice
  instead of struct instance, struct platdata, etc.)
  - Change the name 'core' to 'uclass', meaning U-Boot class. It seems that
  this concept relates to a class of drivers (or a subsystem). We shouldn't
 diff --git a/drivers/core/lists.c b/drivers/core/lists.c
 index 205b140..9f2917f 100644
 --- a/drivers/core/lists.c
 +++ b/drivers/core/lists.c
 @@ -94,7 +94,7 @@ int lists_bind_drivers(struct udevice *parent)
   * tree error
   */
  static int driver_check_compatible(const void *blob, int offset,
 -  const struct device_id *of_match)
 +  const struct udevice_id *of_match)
  {
 int ret;

 diff --git a/drivers/demo/demo-shape.c b/drivers/demo/demo-shape.c
 index a68cc10..3fa9c59 100644
 --- a/drivers/demo/demo-shape.c
 +++ b/drivers/demo/demo-shape.c
 @@ -111,7 +111,7 @@ static int shape_ofdata_to_platdata(struct udevice *dev)
 return 0;
  }

 -static const struct device_id demo_shape_id[] = {
 +static const struct udevice_id demo_shape_id[] = {
 { demo-shape, 0 },
 { },
  };
 diff --git a/drivers/demo/demo-simple.c b/drivers/demo/demo-simple.c
 index 11def86..2bcb7df 100644
 --- a/drivers/demo/demo-simple.c
 +++ b/drivers/demo/demo-simple.c
 @@ -32,7 +32,7 @@ static int demo_shape_ofdata_to_platdata(struct udevice 
 *dev)
 return demo_parse_dt(dev);
  }

 -static const struct device_id demo_shape_id[] = {
 +static const struct udevice_id demo_shape_id[] = {
 { demo-simple, 0 },
 { },
  };
 diff --git a/drivers/gpio/sandbox.c b/drivers/gpio/sandbox.c
 index 09cebe2..75ada5d 100644
 --- a/drivers/gpio/sandbox.c
 +++ b/drivers/gpio/sandbox.c
 @@ -239,7 +239,7 @@ static int gpio_sandbox_probe(struct udevice *dev)
 return 0;
  }

 -static const struct device_id sandbox_gpio_ids[] = {
 +static const struct udevice_id sandbox_gpio_ids[] = {
 { .compatible = sandbox,gpio },
 { }
  };
 diff --git a/include/dm/device.h b/include/dm/device.h
 index ec04982..19f2039 100644
 --- a/include/dm/device.h
 +++ b/include/dm/device.h
 @@ -75,11 +75,11 @@ struct udevice {
  #define device_active(dev) ((dev)-flags  DM_FLAG_ACTIVATED)

  /**
 - * struct device_id - Lists the compatible strings supported by a driver
 + * struct udevice_id - Lists the compatible strings supported by a driver
   * @compatible: Compatible string
   * @data: Data for this compatible string
   */
 -struct device_id {
 +struct udevice_id {
 const char *compatible;
 ulong data;
  };
 @@ -121,7 +121,7 @@ struct device_id {
  struct driver {
 char *name;
 enum uclass_id id;
 -   const struct device_id *of_match;
 +   const struct udevice_id *of_match;
 int (*bind)(struct udevice *dev);
 int (*probe)(struct udevice *dev);
 int (*remove)(struct udevice *dev);
 diff --git a/test/dm/test-fdt.c b/test/dm/test-fdt.c
 index 6eccf11..98e3936 100644
 --- a/test/dm/test-fdt.c
 +++ b/test/dm/test-fdt.c
 @@ -53,7 +53,7 @@ static int testfdt_drv_probe(struct udevice *dev)
 return 0;
  }

 -static const struct device_id testfdt_ids[] = {
 +static const struct udevice_id testfdt_ids[] = {
 {
 .compatible = denx,u-boot-fdt-test,
 .data = DM_TEST_TYPE_FIRST },
 --
 2.0.0.526.g5318336

 ___
 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

Re: [U-Boot] [PATCH v4 04/15] Makefile: Support include files for .dts files

2014-06-06 Thread Jon Loeliger
 diff --git a/arch/arm/dts/include/dt-bindings 
 b/arch/arm/dts/include/dt-bindings
 new file mode 12
 index 000..0cecb3d
 --- /dev/null
 +++ b/arch/arm/dts/include/dt-bindings
 @@ -0,0 +1 @@
 +../../../../include/dt-bindings
 \ No newline at end of file

Hmmm... is this right?

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


Re: [U-Boot] [PATCH v4 05/15] dm: Rename struct device_id to udevice_id

2014-06-06 Thread Jon Loeliger
Gah.  Sorry about that top-post.

I hate gmail's collapsed stupid-shit representation.

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


Re: [U-Boot] [U-boot] [Patch v2] mtd: nand: davinci: add header file for driver definitions

2014-06-06 Thread Tom Rini
On Thu, May 29, 2014 at 08:46:22PM +0300, Ivan Khoronzhuk wrote:

 The definitions inside emif_defs.h concern davinci nand driver and
 should be in it's header. So create header file for davinci nand
 driver and move definitions from emif_defs.h to it.
 
 Acked-by: Vitaly Andrianov vita...@ti.com
 Signed-off-by: Ivan Khoronzhuk ivan.khoronz...@ti.com
 ---
  arch/arm/cpu/armv7/keystone/aemif.c|  2 +-
  arch/arm/include/asm/arch-keystone/emif_defs.h | 73 
 --
  arch/arm/include/asm/arch-keystone/nand_defs.h | 23 
  board/ti/k2hk_evm/board.c  |  1 -
  drivers/mtd/nand/davinci_nand.c|  3 +-
  drivers/mtd/nand/davinci_nand.h| 66 +++
  6 files changed, 68 insertions(+), 100 deletions(-)
  delete mode 100644 arch/arm/include/asm/arch-keystone/emif_defs.h
  delete mode 100644 arch/arm/include/asm/arch-keystone/nand_defs.h
  create mode 100644 drivers/mtd/nand/davinci_nand.h

This breaks building a bunch of davinci platforms.  Further, we should
put the new header file under arch/arm/include/asm/ti-common/ not
drivers/mtd/nand/.  Can you please update things and reconcile
arch/arm/include/asm/arch-davinci/emif_defs.h with these new changes?
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 v4 05/15] dm: Rename struct device_id to udevice_id

2014-06-06 Thread Simon Glass
Hi Jon,

On 6 June 2014 14:26, Jon Loeliger loeli...@gmail.com wrote:
 Didn't this hit upstream master already?
 54c5d08a09e631f88738db54c75395c6457c2157

 Or is this subsequent cleanup for straglers in this branch?

 Thanks,
 jdl

This is a subsequent clean-up, just to keep things consistent.

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


[U-Boot] [PATCH] linux/compat.h: port lower_32_bits and upper_32_bits from Linux

2014-06-06 Thread Lijun Pan
lower_32_bits and upper_32_bits are very useful while programming.
Port these two functions here from Linux:include/linux/kernel.h,
also remove the definition in drivers/usb/host/xhci.h.
Later on, developers could include linux/compat.h if they want to
use these two functions.

Signed-off-by: Lijun Pan lijun@freescale.com
---
 drivers/usb/host/xhci.h |  4 +---
 include/linux/compat.h  | 17 +
 2 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h
index ceb1573..6381596 100644
--- a/drivers/usb/host/xhci.h
+++ b/drivers/usb/host/xhci.h
@@ -20,9 +20,7 @@
 #include asm/cache.h
 #include asm/io.h
 #include linux/list.h
-
-#define upper_32_bits(n) (u32)((n)  32)
-#define lower_32_bits(n) (u32)(n)
+#include linux/compat.h
 
 #define MAX_EP_CTX_NUM 31
 #define XHCI_ALIGNMENT 64
diff --git a/include/linux/compat.h b/include/linux/compat.h
index 3fdfb39..bc51dd1 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -57,4 +57,21 @@
  , __FILE__, __LINE__); }
 
 #define PAGE_SIZE  4096
+
+/**
+ * upper_32_bits - return bits 32-63 of a number
+ * @n: the number we're accessing
+ *
+ * A basic shift-right of a 64- or 32-bit quantity.  Use this to suppress
+ * the right shift count = width of type warning when that quantity is
+ * 32-bits.
+ */
+#define upper_32_bits(n) ((u32)(((n)  16)  16))
+
+/**
+ * lower_32_bits - return bits 0-31 of a number
+ * @n: the number we're accessing
+ */
+#define lower_32_bits(n) ((u32)(n))
+
 #endif
-- 
1.9.0

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


[U-Boot] [PATCH] linux/compat.h: port lower_32_bits and upper_32_bits from Linux

2014-06-06 Thread Lijun Pan
lower_32_bits and upper_32_bits are very useful while programming.
Port these two functions here from Linux:include/linux/kernel.h,
also remove the definition in drivers/usb/host/xhci.h.
Later on, developers could include linux/compat.h if they want to
use these two functions.

Signed-off-by: Lijun Pan lijun@freescale.com
---
 drivers/usb/host/xhci.h |  4 +---
 include/linux/compat.h  | 17 +
 2 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h
index ceb1573..6381596 100644
--- a/drivers/usb/host/xhci.h
+++ b/drivers/usb/host/xhci.h
@@ -20,9 +20,7 @@
 #include asm/cache.h
 #include asm/io.h
 #include linux/list.h
-
-#define upper_32_bits(n) (u32)((n)  32)
-#define lower_32_bits(n) (u32)(n)
+#include linux/compat.h
 
 #define MAX_EP_CTX_NUM 31
 #define XHCI_ALIGNMENT 64
diff --git a/include/linux/compat.h b/include/linux/compat.h
index 3fdfb39..bc51dd1 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -57,4 +57,21 @@
  , __FILE__, __LINE__); }
 
 #define PAGE_SIZE  4096
+
+/**
+ * upper_32_bits - return bits 32-63 of a number
+ * @n: the number we're accessing
+ *
+ * A basic shift-right of a 64- or 32-bit quantity.  Use this to suppress
+ * the right shift count = width of type warning when that quantity is
+ * 32-bits.
+ */
+#define upper_32_bits(n) ((u32)(((n)  16)  16))
+
+/**
+ * lower_32_bits - return bits 0-31 of a number
+ * @n: the number we're accessing
+ */
+#define lower_32_bits(n) ((u32)(n))
+
 #endif
-- 
1.9.0

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


Re: [U-Boot] [PATCH v4 15/15] dm: Expand and improve the device lifecycle docs

2014-06-06 Thread Simon Glass
Hi Pawel,

On 6 June 2014 13:52, Pavel Herrmann morpheus.i...@gmail.com wrote:
 Hi,

 I found some typos in this

Thanks very much for that, will add these.

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


[U-Boot] [PATCH] powerpc/mpc85xx: Remove P1023 RDS support

2014-06-06 Thread Lijun Pan
Since P1023RDS is no longer supported/manufactured by Freescale,
we clean up P1023RDS related code.
Since P1023RDB is still supported by Freescale,
we keep P1023RDB releated code.

Signed-off-by: Lijun Pan lijun@freescale.com
---
 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   | 196 --
 board/freescale/p1023rds/tlb.c| 102 -
 boards.cfg|   2 -
 include/configs/P1023RDS.h| 523 --
 nand_spl/board/freescale/p1023rds/Makefile|  87 -
 nand_spl/board/freescale/p1023rds/nand_boot.c |  96 -
 10 files changed, 1184 deletions(-)
 delete mode 100644 board/freescale/p1023rds/Makefile
 delete mode 100644 board/freescale/p1023rds/README
 delete mode 100644 board/freescale/p1023rds/bcsr.h
 delete mode 100644 board/freescale/p1023rds/law.c
 delete mode 100644 board/freescale/p1023rds/p1023rds.c
 delete mode 100644 board/freescale/p1023rds/tlb.c
 delete mode 100644 include/configs/P1023RDS.h
 delete mode 100644 nand_spl/board/freescale/p1023rds/Makefile
 delete mode 100644 nand_spl/board/freescale/p1023rds/nand_boot.c

diff --git a/board/freescale/p1023rds/Makefile 
b/board/freescale/p1023rds/Makefile
deleted file mode 100644
index fdbf365..000
--- a/board/freescale/p1023rds/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
-#
-# Copyright 2010-2011 Freescale Semiconductor, Inc.
-#
-# SPDX-License-Identifier: GPL-2.0+
-#
-
-obj-y  += p1023rds.o
-obj-y  += law.o
-obj-y  += tlb.o
diff --git a/board/freescale/p1023rds/README b/board/freescale/p1023rds/README
deleted file mode 100644
index d382551..000
--- a/board/freescale/p1023rds/README
+++ /dev/null
@@ -1,101 +0,0 @@
-Overview
-
-The P1023 process includes a performance optimized implementation of the
-QorIQ data Path Acceleration Architecture (DPAA).  This architecture
-provides the infrastructure to support simplified sharing of networking
-interfaces and accelerators by multiple CPU cores. P1023 is an e500 based
-dual core SOC.
-
-P1023RDS board is a Low End Dual core platform supporting the P1023
-processor of QorIQ series.
-
-Building U-boot

-To build the u-boot for P1023RDS:
-Configure to NOR boot:
-   make P1023RDS_config
-Configure to NAND boot:
-   make P1023RDS_NAND_config
-Build:
-   make
-
-Board Switches
---
-Most switches on the board should not be changed.  The most frequent
-user-settable switches on the board are used to configure
-the flash banks.
-
-J4: all open
-
-Default NOR flash boot switch setting:
- Sw3[1:8]: off on on off on on off off
- Sw4[1:8]: off off off on off off off off
- Sw6[1:8]: off on off on off on on off
- Sw7[1:8]: off on off off on off off off
- Sw8[1:8]: on off off off off off off off
-
-For NAND flash boot,set
-Sw4[1:4]: off on on on
-
-The default native ethernet setting is for RGMII mode.
-To use SGMII mode, set
-SW8[1:2]: OFF OFF
-SW7[6:7]: ON ON
-
-Memory Map
---
-0x_0x7fff_ DDR 2G Cacheable
-0x8000_0xbfff_ PCI Express Mem 1G non-cacheable
-0xc000_0xdfff_ PCI 512M non-cacheable
-0xe100_0xe3ff_ PCI IO range4M non-cacheable
-
-0xe000_0xe003_ BCSR256K BCSR
-0xee00_0xefff_ NOR flash   32M NOR flash
-0xff00_0xff3f_ DPAA_QBMAN  4M
-0xff60_0xff7f_ CCSR2M non-cacheable
-0xffa0_0xffaf_ NAND FLASH  1M non-cacheable
-0xffd0_0xffd0_3fff L1 for stack16K Cacheable TLB0
-
-Flashing u-boot Images

-To program the image in the boot flash bank:
-NOR flash boot:
-   = tftp 100 u-boot.bin
-   = protect off all
-   = erase eff4 efff
-   = cp.b 100 eff4 c
-
-NAND flash boot:
-   = tftp 100 u-boot-nand.bin
-   = nand erase 0 8
-   = nand write 100 0 8
-
-Firmware ucode location
--
-Microcode(ucode) to FMAN's IRAM is needed to make FMAN Ethernet work.
-u-boot loads ucode FLASH. The location for ucode:
-NOR Flash: 0xfe00
-NAND Flash: 0x1f0
-
-Using the Device Tree Source File
--
-To create the DTB (Device Tree Binary) image file,
-use a command similar to this:
-
-   dtc -b 0 -f -I dts -O dtb p1023rds.dts  p1023rds.dtb
-
-Likely, that .dts file will come from here;
-
-   linux-2.6/arch/powerpc/boot/dts/p1023rds.dts
-or
-   make p1023rds.dtb ARCH=powerpc
-in linux-2.6 directory.
-
-Booting Linux
--
-Place a linux uImage in the TFTP disk area.
-
-   tftp 100 uImage
-  

Re: [U-Boot] [PATCH v4 04/15] Makefile: Support include files for .dts files

2014-06-06 Thread Simon Glass
Hi Jon,

On 6 June 2014 14:29, Jon Loeliger loeli...@gmail.com wrote:
 diff --git a/arch/arm/dts/include/dt-bindings 
 b/arch/arm/dts/include/dt-bindings
 new file mode 12
 index 000..0cecb3d
 --- /dev/null
 +++ b/arch/arm/dts/include/dt-bindings
 @@ -0,0 +1 @@
 +../../../../include/dt-bindings
 \ No newline at end of file

 Hmmm... is this right?

It is supposed to come through as a symlink.

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


Re: [U-Boot] Any interest in support for BCM5718 (a.k.a Tigon3) PCIe Ethernet chipset?

2014-06-06 Thread Simon Glass
Hi Chris,

On 5 June 2014 21:24, Chris Packham judge.pack...@gmail.com wrote:
 Hi,

 (Joe, Simon, I'm not sure if this counts as networking or driver
 model but figured it was close enough to warrant an Cc).

 We're looking at a new board design and are planning on using a
 BCM5718 to provide a couple of Ethernet ports. The chipset is
 supported in Linux using the tg3.c driver. I was planning on creating
 an equivalent driver in u-boot using e1000.c as a guide and probably
 borrowing heavily from the Linux driver.

 Is anyone else actively looking at Broadcom based chipset/NICs? Any
 tips as for where to start or pitfalls to expect?

I'm not aware of anything myself, but it sounds like a good idea. If
you feel able to convert 'eth' over to driver model that would be
great too. There are only a small number of operations.

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


Re: [U-Boot] [PATCH] linux/compat.h: port lower_32_bits and upper_32_bits from Linux

2014-06-06 Thread Tom Rini
On Fri, Jun 06, 2014 at 03:05:08PM -0500, Lijun Pan wrote:

 lower_32_bits and upper_32_bits are very useful while programming.
 Port these two functions here from Linux:include/linux/kernel.h,
 also remove the definition in drivers/usb/host/xhci.h.
 Later on, developers could include linux/compat.h if they want to
 use these two functions.
 
 Signed-off-by: Lijun Pan lijun@freescale.com

Per
http://www.denx.de/wiki/view/U-Boot/Patches#Attributing_Code_Copyrights_Sign
you need to say what git hash or tag this comes from in the kernel.

-- 
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 v2] test:dfu: Add test scripts for testing DFU regression

2014-06-06 Thread Simon Glass
Hi Lukasz,

On 3 June 2014 03:54, Lukasz Majewski l.majew...@samsung.com wrote:
 This commit adds test scripts for testing if any commit has introduced
 regression to the DFU subsystem.

 It uses md5 to test if sent and received file is correct.
 The test detailed description is available at README file.

 Signed-off-by: Lukasz Majewski l.majew...@samsung.com
 ---
 Changes for v2:
 - Rename DESCRIPTION.TXT to README
 - Introduction of COLOUR_* variables to hold code necessary to change
   console color
 - File to create initial setup - dfu_gadget_test_init.sh has been added
 - Test files are now automatically generated with the above script

Looks good, but a few comments below.

 ---
  test/dfu/README  |   27 
  test/dfu/dfu_gadget_test.sh  |   88 
 ++
  test/dfu/dfu_gadget_test_init.sh |   34 +++
  3 files changed, 149 insertions(+)
  create mode 100644 test/dfu/README
  create mode 100755 test/dfu/dfu_gadget_test.sh
  create mode 100755 test/dfu/dfu_gadget_test_init.sh

 diff --git a/test/dfu/README b/test/dfu/README
 new file mode 100644
 index 000..f8f5a43
 --- /dev/null
 +++ b/test/dfu/README
 @@ -0,0 +1,27 @@
 +DFU TEST CASE DESCRIPTION:
 +
 +The prerequisites for running this script are assured by
 +dfu_gadget_test_init.sh script.
 +In this file user is able to generate their own set of test files by altering
 +the default set of TEST_FILES_SIZES variable
 +
 +Moreover, on a target device the dfu_alt_info env variable should be 
 extended
 +to have dfu_test.bin fat 0 6; \ entry ([1]). For reference please consult 
 the
 +config file for TRATS/TRATS2 devices (./include/configs/trats{2}.h)
 +
 +One can use fat, ext4 or any other supported file system, which can be
 +created in a convenient way with exporting partitions via UMS (ums 0 mmc 0)
 +and using standard tools on host (like mkfs.ext4).
 +
 +Example usage:
 +1. On the target:
 +   env default -a
 +   dfu 0 mmc 0
 +2. On the host:
 +   ./dfu_gadget_test.sh 11
 +
 +where 11 is the mumber of alt setting corresponding to entry [1].
 +
 +The number of the alt setting entry can be obtained with dfu-util -l command.
 +In its output one should look for the 'name=dfu_test1.bin' and 
 corresponding
 +alt=11.
 diff --git a/test/dfu/dfu_gadget_test.sh b/test/dfu/dfu_gadget_test.sh
 new file mode 100755
 index 000..8abd8e7
 --- /dev/null
 +++ b/test/dfu/dfu_gadget_test.sh
 @@ -0,0 +1,88 @@
 +#! /bin/bash
 +set -e # any command return if not equal to zero
 +clear
 +
 +COLOR_RED=\33[31m
 +COLOR_GREEN=\33[32m
 +COLOR_DEFAULT=\33[0m

Which side of the pond are you? :-) I think it should be COLOUR in U-Boot.

 +
 +DIR=./
 +SUFFIX=img
 +RCV_DIR=rcv/
 +LOG_FILE=./log/log-`date +%d-%m-%Y_%H-%M-%S`
 +
 +./dfu_gadget_test_init.sh
 +
 +cleanup () {
 +rm -rf $RCV_DIR
 +}
 +
 +die () {
 +   printf$COLOR_RED FAILED $COLOR_DEFAULT \n
 +   cleanup
 +   exit 1
 +}
 +
 +calculate_md5sum () {
 +MD5SUM=`md5sum $1`
 +MD5SUM=`echo $MD5SUM | cut -d ' ' -f1`
 +echo md5sum:$MD5SUM
 +}
 +
 +dfu_test_file () {
 +printf $COLOR_GREEN 
 =
  $COLOR_DEFAULT\n
 +printf File:$COLOR_GREEN %s $COLOR_DEFAULT\n $1
 +
 +dfu-util -D $1 -a $TARGET_ALT_SETTING  $LOG_FILE 21 || die $?
 +
 +echo -n TX: 
 +calculate_md5sum $1
 +
 +MD5_TX=$MD5SUM
 +
 +N_FILE=$DIR$RCV_DIR${1:2}_rcv
 +
 +dfu-util -U $N_FILE -a $TARGET_ALT_SETTING  $LOG_FILE 21 || die $?
 +
 +echo -n RX: 
 +calculate_md5sum $N_FILE
 +MD5_RX=$MD5SUM
 +
 +if [ $MD5_TX == $MD5_RX ]; then
 +   printf$COLOR_GREEN --- OK $COLOR_DEFAULT \n
 +else
 +   printf$COLOR_RED --- FAILED $COLOR_DEFAULT \n
 +   cleanup
 +   exit 1
 +fi
 +
 +}
 +
 +printf 
 $COLOR_GREEN=
  $COLOR_DEFAULT\n
 +echo DFU EP0 transmission test program
 +echo Trouble shoot - disable DBG (even the KERN_DEBUG) in the UDC driver
 +echo @ - TRATS2 # dfu 0 mmc 0
 +mkdir -p $RCV_DIR
 +touch $LOG_FILE
 +
 +if [ $# -eq 0 ]
 +then
 +   printf$COLOR_RED Please pass alt setting number!!  
 $COLOR_DEFAULT \n
 +   exit 0
 +fi
 +
 +TARGET_ALT_SETTING=$1
 +
 +if [ -n $2 ]
 +then
 +   dfu_test_file $2

Where is $2 mentioned? in your example usage?

 +else
 +   for file in $DIR*.$SUFFIX
 +   do
 +   dfu_test_file $file
 +   done
 +fi
 +
 +cleanup
 +
 +exit 0
 diff --git a/test/dfu/dfu_gadget_test_init.sh 
 b/test/dfu/dfu_gadget_test_init.sh
 new file mode 100755
 index 000..ea2f715
 --- /dev/null
 +++ b/test/dfu/dfu_gadget_test_init.sh

Should this script be run by the main script in the default case? You
could have a flag to force it to use existing files.

 @@ -0,0 +1,34 @@
 +#! /bin/bash
 +set -e # any command return if not equal to zero
 +clear
 +
 +COLOR_RED=\33[31m
 

Re: [U-Boot] [U-boot] [Patch v2] mtd: nand: davinci: add header file for driver definitions

2014-06-06 Thread Ivan Khoronzhuk


On 06/06/2014 11:34 PM, Tom Rini wrote:

On Thu, May 29, 2014 at 08:46:22PM +0300, Ivan Khoronzhuk wrote:


The definitions inside emif_defs.h concern davinci nand driver and
should be in it's header. So create header file for davinci nand
driver and move definitions from emif_defs.h to it.

Acked-by: Vitaly Andrianov vita...@ti.com
Signed-off-by: Ivan Khoronzhuk ivan.khoronz...@ti.com
---
  arch/arm/cpu/armv7/keystone/aemif.c|  2 +-
  arch/arm/include/asm/arch-keystone/emif_defs.h | 73 --
  arch/arm/include/asm/arch-keystone/nand_defs.h | 23 
  board/ti/k2hk_evm/board.c  |  1 -
  drivers/mtd/nand/davinci_nand.c|  3 +-
  drivers/mtd/nand/davinci_nand.h| 66 +++
  6 files changed, 68 insertions(+), 100 deletions(-)
  delete mode 100644 arch/arm/include/asm/arch-keystone/emif_defs.h
  delete mode 100644 arch/arm/include/asm/arch-keystone/nand_defs.h
  create mode 100644 drivers/mtd/nand/davinci_nand.h

This breaks building a bunch of davinci platforms.  Further, we should
put the new header file under arch/arm/include/asm/ti-common/ not
drivers/mtd/nand/.  Can you please update things and reconcile
arch/arm/include/asm/arch-davinci/emif_defs.h with these new changes?
Thanks.



Yes..I will repost new patch.
Thanks!

--
Regards,
Ivan Khoronzhuk

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


[U-Boot] [PATCH v2] linux/compat.h: port lower_32_bits and upper_32_bits from Linux

2014-06-06 Thread Lijun Pan
[backport from linux commit 204b885e and 218e180e7]
lower_32_bits and upper_32_bits are very useful while programming.
Port these two functions here from Linux:include/linux/kernel.h,
also remove the definition in drivers/usb/host/xhci.h.
Later on, developers could include linux/compat.h if they want to
use these two functions.

Signed-off-by: Lijun Pan lijun@freescale.com
---
Change log
v2: add git SHA of linux kernel tree.

 drivers/usb/host/xhci.h |  4 +---
 include/linux/compat.h  | 17 +
 2 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h
index ceb1573..6381596 100644
--- a/drivers/usb/host/xhci.h
+++ b/drivers/usb/host/xhci.h
@@ -20,9 +20,7 @@
 #include asm/cache.h
 #include asm/io.h
 #include linux/list.h
-
-#define upper_32_bits(n) (u32)((n)  32)
-#define lower_32_bits(n) (u32)(n)
+#include linux/compat.h
 
 #define MAX_EP_CTX_NUM 31
 #define XHCI_ALIGNMENT 64
diff --git a/include/linux/compat.h b/include/linux/compat.h
index 3fdfb39..bc51dd1 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -57,4 +57,21 @@
  , __FILE__, __LINE__); }
 
 #define PAGE_SIZE  4096
+
+/**
+ * upper_32_bits - return bits 32-63 of a number
+ * @n: the number we're accessing
+ *
+ * A basic shift-right of a 64- or 32-bit quantity.  Use this to suppress
+ * the right shift count = width of type warning when that quantity is
+ * 32-bits.
+ */
+#define upper_32_bits(n) ((u32)(((n)  16)  16))
+
+/**
+ * lower_32_bits - return bits 0-31 of a number
+ * @n: the number we're accessing
+ */
+#define lower_32_bits(n) ((u32)(n))
+
 #endif
-- 
1.9.0

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


Re: [U-Boot] [U-Boot, v2, 1/7] mtd: nand: omap_elm: remove #include omap_gpmc.h

2014-06-06 Thread Tom Rini
On Fri, Apr 11, 2014 at 12:55:29PM +0530, pekon gupta wrote:

 There is no dependency of omap_elm.c on omap_gpmc.h
 
 Signed-off-by: Pekon Gupta pe...@ti.com
 Reviewed-by: Stefan Roese s...@denx.de

Applied to u-boot-ti/master, thanks!

-- 
Tom


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


Re: [U-Boot] [U-Boot, v2, 4/7] mtd: nand: omap_gpmc: remove unused members of 'struct nand_bch_priv'

2014-06-06 Thread Tom Rini
On Fri, Apr 11, 2014 at 12:55:32PM +0530, pekon gupta wrote:

 This patch prepares to refactor 'struct nand_bch_priv' - 'struct 
 omap_nand_info'
 And thus performs following clean-ups:
  - remove nand_bch_priv.type: use nand_bch_priv.ecc_scheme instead
  - remove nand_bch_priv.mode: unused
 
 Signed-off-by: Pekon Gupta pe...@ti.com
 Reviewed-by: Stefan Roese s...@denx.de
 Reviewed-by: Stefan Roese s...@denx.de
 

Applied to u-boot-ti/master, thanks!

-- 
Tom


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


Re: [U-Boot] [U-Boot, v2, 6/7] mtd: nand: omap_gpmc: minor cleanup of omap_correct_data_bch

2014-06-06 Thread Tom Rini
On Fri, Apr 11, 2014 at 12:55:34PM +0530, pekon gupta wrote:

 This patch tries to avoid some local pointer dereferences, by using common
 local variables in omap_correct_data_bch()
 
 Signed-off-by: Pekon Gupta pe...@ti.com
 Reviewed-by: Stefan Roese s...@denx.de
 Reviewed-by: Stefan Roese s...@denx.de

Applied to u-boot-ti/master, thanks!

-- 
Tom


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


Re: [U-Boot] [U-Boot, v2, 2/7] mtd: nand: omap_elm: use bch_type instead of nibble count to differentiate between BCH4/BCH8/BCH16

2014-06-06 Thread Tom Rini
On Fri, Apr 11, 2014 at 12:55:30PM +0530, pekon gupta wrote:

 ELM hardware engine support ECC error detection for multiple ECC strengths 
 like
  +--++
  |Type  | ECC syndrome length|
  +--++
  |BCH4  | 6.5 bytes = 13 nibbles |
  |BCH8  | 13 byte = 26 nibbles   |
  |BCH16 | 26 bytes = 52 nibbles  |
  +--++
 
 Current implementation of omap_elm driver uses ECC syndrom length (in 
 'nibbles')
 to differentiate between BCH4/BCH8/BCH16. This patch replaces it with 
 'bch_type'
 
 Signed-off-by: Pekon Gupta pe...@ti.com
 Reviewed-by: Stefan Roese s...@denx.de

Applied to u-boot-ti/master, thanks!

-- 
Tom


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


Re: [U-Boot] [U-Boot, v2, 3/7] mtd: nand: omap_elm: use macros for register definitions

2014-06-06 Thread Tom Rini
On Fri, Apr 11, 2014 at 12:55:31PM +0530, pekon gupta wrote:

 This patch adds macros for following parameters of ELM Hardware engine
  - ELM_MAX_CHANNELS: ELM can process 8 data streams simultaneously
  - ELM_MAX_ERRORS: ELM can detect upto 16 ECC error when using BCH16 scheme
 
 Signed-off-by: Pekon Gupta pe...@ti.com
 Reviewed-by: Stefan Roese s...@denx.de

Applied to u-boot-ti/master, thanks!

-- 
Tom


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


Re: [U-Boot] [U-Boot, v2, 7/7] mtd: nand: omap: fix error-codes returned from omap-elm driver

2014-06-06 Thread Tom Rini
On Fri, Apr 11, 2014 at 12:55:35PM +0530, pekon gupta wrote:

 This patch
  omap-elm.c: replaces -ve integer value returned during errorneous condition,
  with proper error-codes.
  omap-gpmc.c: updates omap-gpmc driver to pass error-codes returned from
  omap-elm driver to upper layers
 
 Signed-off-by: Pekon Gupta pe...@ti.com
 Reviewed-by: Stefan Roese s...@denx.de
 Reviewed-by: Stefan Roese s...@denx.de

Applied to u-boot-ti/master, thanks!

-- 
Tom


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


Re: [U-Boot] [U-Boot, v2, 5/7] mtd: nand: omap_gpmc: rename struct nand_bch_priv to struct omap_nand_info

2014-06-06 Thread Tom Rini
On Fri, Apr 11, 2014 at 12:55:33PM +0530, pekon gupta wrote:

 This patch renames 'struct nand_bch_priv' which currently holds private data 
 only
 for BCH ECC schemes, into 'struct omap_nand_info' so that same can be used for
 all ECC schemes
 
 Signed-off-by: Pekon Gupta pe...@ti.com
 Reviewed-by: Stefan Roese s...@denx.de

Applied to u-boot-ti/master, thanks!

-- 
Tom


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


Re: [U-Boot] [U-Boot,v2,1/2] am43xx_evm: Add qspiboot target

2014-06-06 Thread Tom Rini
On Mon, May 19, 2014 at 04:53:37PM -0400, Tom Rini wrote:

 From: Sourav Poddar sourav.pod...@ti.com
 
 The ePOS EVM and EVM SK have QSPI as an option to boot.  Add a qspiboot
 target that utilizes QSPI for env and so forth as an example of best
 practices.  As QSPI is booted from directly we need to chang
 CONFIG_SYS_TEXT_BASE.
 
 Note that on ePOS EVM the QSPI and NAND are mutually exclusive choices
 we need to handle that elsewhere, once NAND support is also added.
 
 Signed-off-by: Sourav Poddar sourav.pod...@ti.com
 Signed-off-by: Tom Rini tr...@ti.com

Applied to u-boot-ti/master, thanks!

-- 
Tom


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


Re: [U-Boot] [U-Boot, v5, 2/5] mtd: nand: force NAND_CMD_READID onto 8-bit bus

2014-06-06 Thread Tom Rini
On Tue, May 06, 2014 at 12:46:17AM +0530, pekon gupta wrote:

 From: Brian Norris computersforpe...@gmail.com
 
 As per following Sections in ONFI Spec, NAND_CMD_READID should use only
 lower 8-bit for transfering command, address and data even on x16 NAND device.
 
 *Section: Target Initialization
 The Read ID and Read Parameter Page commands only use the lower 8-bits of the
  data bus. The host shall not issue commands that use a word data width on x16
  devices until the host determines the device supports a 16-bit data bus width
  in the parameter page.
 
 *Section: Bus Width Requirements*
 When the host supports a 16-bit bus width, only data is transferred at the
  16-bit width. All address and command line transfers shall use only the lower
  8-bits of the data bus. During command transfers, the host may place any 
 value
  on the upper 8-bits of the data bus. During address transfers, the host shall
  set the upper 8-bits of the data bus to 00h.
 
 Thus porting  following commit from linux-kernel to ensure that column address
 is not altered to align to x16 bus when issuing NAND_CMD_READID command.
 
 commit 3dad2344e92c6e1aeae42df1c4824f307c51bcc7
 mtd: nand: force NAND_CMD_READID onto 8-bit bus
 Author: Brian Norris computersforpe...@gmail.com (preserving authorship)
 
 The NAND command helpers tend to automatically shift the column address
 for x16 bus devices, since most commands expect a word address, not a
 byte address. The Read ID command, however, expects an 8-bit address
 (i.e., 0x00, 0x20, or 0x40 should not be translated to 0x00, 0x10, or
 0x20).
 
 This fixes the column address for a few drivers which imitate the
 nand_base defaults.
 
 Signed-off-by: Pekon Gupta pe...@ti.com

Applied to u-boot-ti/master, thanks!

-- 
Tom


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


Re: [U-Boot] [U-Boot, v5, 1/5] mtd: nand: don't use read_buf for 8-bit ONFI transfers

2014-06-06 Thread Tom Rini
On Tue, May 06, 2014 at 12:46:16AM +0530, pekon gupta wrote:

 From: Brian Norris computersforpe...@gmail.com
 
 Porting below commit from linux-tree, preserving original authorship  commit 
 log
 commit bd9c6e99b58255b9de1982711ac9487c9a2f18be
 Author: Brian Norris computersforpe...@gmail.com
 mtd: nand: don't use read_buf for 8-bit ONFI transfers
 
   Use a repeated read_byte() instead of read_buf(), since for x16 buswidth
   devices, we need to avoid the upper I/O[16:9] bits. See the following
   commit for reference:
 
   commit 05f7835975dad6b3b517f9e23415985e648fb875 (from linux-tree)
   Author: Uwe Kleine-König u.kleine-koe...@pengutronix.de
   Date:   Thu Dec 5 22:22:04 2013 +0100
 
   mtd: nand: don't use {read,write}_buf for 8-bit transfers
 
   Now, I think that all barriers to probing ONFI on x16 devices are
   removed, so remove the check from nand_flash_detect_onfi().
 
 Signed-off-by: Pekon Gupta pe...@ti.com

Applied to u-boot-ti/master, thanks!

-- 
Tom


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


Re: [U-Boot] [U-Boot, v5, 3/5] mtd: nand: fix GET/SET_FEATURES address on 16-bit devices

2014-06-06 Thread Tom Rini
On Tue, May 06, 2014 at 12:46:18AM +0530, pekon gupta wrote:

 From: David Mosberger dav...@egauge.net
 
 As per following Sections in ONFI Spec, GET_FEATURES and SET_FEATURES also 
 need
 byte-addressing on 16-bit devices.
 
 *Section: Target Initialization
 The Read ID and Read Parameter Page commands only use the lower 8-bits of the
  data bus. The host shall not issue commands that use a word data width on x16
  devices until the host determines the device supports a 16-bit data bus width
  in the parameter page.
 
 *Section: Bus Width Requirements*
 When the host supports a 16-bit bus width, only data is transferred at the
  16-bit width. All address and command line transfers shall use only the lower
  8-bits of the data bus. During command transfers, the host may place any 
 value
  on the upper 8-bits of the data bus. During address transfers, the host shall
  set the upper 8-bits of the data bus to 00h.
 
 So porting following commit from linux kernel
 commit e34fcb07a6d57411de6e15a47724fbe92c5caa42
 Author: David Mosberger dav...@egauge.net  (preserving authorship)
 mtd: nand: fix GET/SET_FEATURES address on 16-bit devices
 
 Signed-off-by: Pekon Gupta pe...@ti.com

Applied to u-boot-ti/master, thanks!

-- 
Tom


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


Re: [U-Boot] [U-Boot, v5, 5/5] omap3: remove remnant macros GPMC_NAND_ECC_LP_x8_LAYOUT and GPMC_NAND_ECC_LP_x16_LAYOUT

2014-06-06 Thread Tom Rini
On Tue, May 06, 2014 at 12:46:20AM +0530, pekon gupta wrote:

 OMAP3 used GPMC_NAND_ECC_LP_x8_LAYOUT and GPMC_NAND_ECC_LP_x16_LAYOUT macros
 to configure GPMC controller for x7 or x8 bit device connected to its 
 interface.
 Now this information is encoded in CONFIG_SYS_NAND_DEVICE_WIDTH macro, so 
 above
 macros can be completely removed.
 
 Signed-off-by: Pekon Gupta pe...@ti.com

Applied to u-boot-ti/master, thanks!

-- 
Tom


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


Re: [U-Boot] [U-Boot, v5, 4/5] mtd: nand: omap: add CONFIG_SYS_NAND_BUSWIDTH_16BIT to indicate NAND device bus-width

2014-06-06 Thread Tom Rini
On Tue, May 06, 2014 at 12:46:19AM +0530, pekon gupta wrote:

 GPMC controller needs to be configured based on bus-width of the NAND device
 connected to it. Also, dynamic detection of NAND bus-width from on-chip ONFI
 parameters is not possible in following situations:
 SPL:SPL NAND drivers does not support ONFI parameter reading.
 U-boot: GPMC controller iniitalization is done in 
 omap_gpmc.c:board_nand_init()
 which is called before probing for devices, hence any ONFI parameter
 information is not available during GPMC initialization.
 
 Thus, OMAP NAND driver expected board developers to explicitely write GPMC
 configurations specific to NAND device attached on board in board files 
 itself.
 But this was troublesome for board manufacturers as they need to dive into
 lengthy platform  SoC documents to find details of GPMC registers and
 appropriate configurations to get NAND device working.
 
 This patch instead adds existing CONFIG_SYS_NAND_BUSWIDTH_16BIT to board 
 config
 hich indicates that connected NAND device has x16 bus-width. And then based on
 this config GPMC driver itself initializes itself based on NAND bus-width. 
 This
 keeps board developers free from knowing GPMC controller specific internals.
 
 Signed-off-by: Pekon Gupta pe...@ti.com

Applied to u-boot-ti/master, thanks!

-- 
Tom


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


Re: [U-Boot] [U-Boot, 1/2] arm:am33xx: Make dram_init call sdram_init() in some contexts

2014-06-06 Thread Tom Rini
On Wed, May 21, 2014 at 12:57:21PM -0400, Tom Rini wrote:

 We have two contexts for booting these platforms.  One is SPL which is
 roughly: reset, cpu_init_crit, lowlevel_init, s_init, sdram_init, _main,
 board_init_f from SPL, ... then U-Boot loads.  The other is a
 memory-mapped XIP case (NOR or QSPI) where we do not run an SPL.  In
 this case we go, roughly: reset, cpu_init_crit, lowlevel_init, s_init,
 _main, regular board_init_f.
 
 In the first case s_init will set a valid gd and then be able to call
 sdram_init which in many cases will need i2c (which needs a valid gd for
 gd-cur_i2c_bus).  In this second case we must (and are able to and
 should) defer sdram_init() into dram_init() called by board_init_f as gd
 will have been set in _main and cleared in board_init_f.
 
 Signed-off-by: Tom Rini tr...@ti.com

Applied to u-boot-ti/master, thanks!

-- 
Tom


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


Re: [U-Boot] [U-Boot, 2/2] arm:am33xx: Rework s_init and add board_early_init_f

2014-06-06 Thread Tom Rini
On Wed, May 21, 2014 at 12:57:22PM -0400, Tom Rini wrote:

 With the changes to the i2c framework (and adopting the omap24xx_i2c
 driver to them) we can no longer call i2c functions prior to gd having
 been set and cleared.  When SPL booting, this is handled by setting gd
 to point to SRAM in s_init.  However in the cases where we are loaded
 directly by ROM (memory mapped NOR or QSPI) we need to make use of the
 normal hooks to slightly delay these calls.
 
 Signed-off-by: Tom Rini tr...@ti.com

Applied to u-boot-ti/master, thanks!

-- 
Tom


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


Re: [U-Boot] [U-Boot, v2, 2/2] ti: qspi: populate slave device to set flash quad bit.

2014-06-06 Thread Tom Rini
On Mon, May 19, 2014 at 04:53:38PM -0400, Tom Rini wrote:

 From: Sourav Poddar sourav.pod...@ti.com
 
 The patch populates the slave data which will be used by flash driver to
 set the  flash quad enable bit.
 
 Signed-off-by: Sourav Poddar sourav.pod...@ti.com

Applied to u-boot-ti/master, thanks!

-- 
Tom


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


Re: [U-Boot] [U-Boot, U-boot] keystone: init: enable UART1 to be able use it from kernel

2014-06-06 Thread Tom Rini
On Thu, May 29, 2014 at 06:57:12PM +0300, Khoronzhuk, Ivan wrote:

 From: Murali Karicheri m-kariche...@ti.com
 
 Currently PWREMU_MGMT is not configured in the Linux generic UART
 driver as this register seems to be specific TI UART IP. So this
 needs to be enabled in u-boot to use UART1 from kernel space.
 
 Acked-By: Vitaly Andrianov vita...@ti.com
 Signed-off-by: Murali Karicheri m-kariche...@ti.com
 Signed-off-by: Ivan Khoronzhuk ivan.khoronz...@ti.com

Applied to u-boot-ti/master, thanks!

-- 
Tom


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


Re: [U-Boot] [U-Boot, U-boot] keystone: k2hk: enable support of nand ecclayout command

2014-06-06 Thread Tom Rini
On Thu, May 29, 2014 at 06:58:16PM +0300, Khoronzhuk, Ivan wrote:

 From: WingMan Kwok w-kw...@ti.com
 
 Enable support of nand ecclayout command.
 
 Acked-By: Murali Karicheri m-kariche...@ti.com
 Acked-by: Vitaly Andrianov vita...@ti.com
 Signed-off-by: WingMan Kwok w-kw...@ti.com
 Signed-off-by: Ivan Khoronzhuk ivan.khoronz...@ti.com

Applied to u-boot-ti/master, thanks!

-- 
Tom


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


Re: [U-Boot] tam3517: fix NAND detection

2014-06-06 Thread Tom Rini
On Sat, May 31, 2014 at 05:08:30PM +0200, Jeroen Hofstee wrote:

 commit a0a37183bd7 ARM: omap: merge GPMC initialization code for
 all platform needs CONFIG_NOR, CONFIG_NAND or CONFIG_CMD_ONENAND
 to be set to access flash. Add CONFIG_NAND for tam3517 derived
 boards to prevent the following error: nand: error: Unable to
 find NAND settings in GPMC Configuration - quitting
 
 cc: Stefano Babic sba...@denx.de
 Signed-off-by: Jeroen Hofstee jer...@myspectrum.nl

Applied to u-boot-ti/master, thanks!

-- 
Tom


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


Re: [U-Boot] ARM: AM43xx: Fix UART clocks enabling

2014-06-06 Thread Tom Rini
On Mon, Jun 02, 2014 at 10:49:03AM +0530, Lokesh Vutla wrote:

 After enabling a module, SW has to wait on IDLEST bit
 until it is Fully functional. This wait is missing for UART module
 and there is a immediate access of UART registers after this. So there
 is a chance of hang on this module( This can happen when we are running
 from MPU SRAM). So waiting for IDLEST bit.
 
 Signed-off-by: Lokesh Vutla lokeshvu...@ti.com

Applied to u-boot-ti/master, thanks!

-- 
Tom


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


Re: [U-Boot] [U-Boot,v4,3/3] am335x: update README for BCH16

2014-06-06 Thread Tom Rini
On Mon, Jun 02, 2014 at 05:14:43PM +0530, pekon gupta wrote:

 updates documentation with explanation on how to select ECC schemes.
 
 Signed-off-by: Pekon Gupta pe...@ti.com

Applied to u-boot-ti/master, thanks!

-- 
Tom


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


Re: [U-Boot] [U-Boot, v4, 1/3] mtd: nand: omap_gpmc: use macro for register definitions

2014-06-06 Thread Tom Rini
On Mon, Jun 02, 2014 at 05:14:41PM +0530, pekon gupta wrote:

 GPMC can support simultaneous processing of 8 512Byte data chunks, in parallel
 
 Signed-off-by: Pekon Gupta pe...@ti.com

Applied to u-boot-ti/master, thanks!

-- 
Tom


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


Re: [U-Boot] ARM: AM43xx: Fix mmcboot command in EXTRA_ENV_SETTINGS

2014-06-06 Thread Tom Rini
On Mon, Jun 02, 2014 at 10:45:38AM +0530, Lokesh Vutla wrote:

 loadbootenv expects devtype variable to be set. This is missing in
 mmcboot command. With this the following error comes:
 U-Boot# run mmcboot
 mmc0 is current device
 SD/MMC found on device 0
 ** Bad device usb 0 **
 ** Bad device usb 0 **
 Fixing this by setting devtype as mmc.
 
 Reported-by: Tony Lindgren t...@atomide.com
 Signed-off-by: Lokesh Vutla lokeshvu...@ti.com

Applied to u-boot-ti/master, thanks!

-- 
Tom


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


Re: [U-Boot] [U-Boot, v4, 2/3] mtd: nand: omap: add support for BCH16_ECC - NAND driver updates

2014-06-06 Thread Tom Rini
On Mon, Jun 02, 2014 at 05:14:42PM +0530, pekon gupta wrote:

 This patch add support for BCH16_ECC to omap_gpmc driver.
 
 *need to BCH16 ECC scheme*
 With newer SLC Flash technologies and MLC NAND, and large densities, pagesizes
 Flash devices have become more suspectible to bit-flips. Thus stronger
 ECC schemes are required for protecting the data.
 But stronger ECC schemes have come with larger-sized ECC syndromes which 
 require
 more space in OOB/Spare. This puts constrains like;
 (a) BCH16_ECC can correct 16 bit-flips per 512Bytes of data.
 (b) BCH16_ECC generates 26-bytes of ECC syndrome / 512B.
 Due to (b) this scheme can only be used with NAND devices which have enough
 OOB to satisfy following equation:
 OOBsize per page = 26 * (page-size / 512)
 
 Signed-off-by: Pekon Gupta pe...@ti.com

Applied to u-boot-ti/master, thanks!

-- 
Tom


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


Re: [U-Boot] arch-am33xx: Add defines for timer0-7

2014-06-06 Thread Tom Rini
On Wed, Jun 04, 2014 at 10:19:26AM +0200, Hannes Petermaier wrote:

 For usage of timer6 within BR we need this defines to enable clock
 modules and clk-source.
 
 Also the 'Timer register bits' are expanded.
 
 By the way we add defines for all timers within AM335x SoC.
 
 Cc: tr...@ti.com
 Signed-off-by: Hannes Petermaier oe5...@oevsv.at

Applied to u-boot-ti/master, thanks!

-- 
Tom


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


Re: [U-Boot] board/BuR/common: introduce usage of CONFIG_SYS_GENERIC_BOARD

2014-06-06 Thread Tom Rini
On Wed, Jun 04, 2014 at 10:22:07AM +0200, Hannes Petermaier wrote:

 Signed-off-by: Hannes Petermaier oe5...@oevsv.at

Applied to u-boot-ti/master, thanks!

-- 
Tom


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


Re: [U-Boot] board/BuR/common: Add CONFIG_CMD_I2C

2014-06-06 Thread Tom Rini
On Wed, Jun 04, 2014 at 10:28:39AM +0200, Hannes Petermaier wrote:

 in almost all cases we need the i2c commands within the u-boot shell.
 So we enable them within the common section.
 
 Cc: tr...@ti.com
 Signed-off-by: Hannes Petermaier oe5...@oevsv.at

Applied to u-boot-ti/master, thanks!

-- 
Tom


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


Re: [U-Boot] [U-Boot, 1/4] am43xx: Only read the MPU frequency bits of CTRL_DEV_ATTR

2014-06-06 Thread Tom Rini
On Thu, Jun 05, 2014 at 11:15:27AM -0400, Tom Rini wrote:

 Signed-off-by: Tom Rini tr...@ti.com

Applied to u-boot-ti/master, thanks!

-- 
Tom


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


Re: [U-Boot] board/BuR/tseries: cosmetic changes

2014-06-06 Thread Tom Rini
On Wed, Jun 04, 2014 at 10:37:12AM +0200, Hannes Petermaier wrote:

 Cc: tr...@ti.com
 Signed-off-by: Hannes Petermaier oe5...@oevsv.at

Applied to u-boot-ti/master, thanks!

-- 
Tom


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


Re: [U-Boot] board/BuR/tseries: only run gpmc_init(...) in NAND-build

2014-06-06 Thread Tom Rini
On Wed, Jun 04, 2014 at 10:26:29AM +0200, Hannes Petermaier wrote:

 if we have no NAND-Chip, we don't need the gpmc-controller and therefore
 is no need to init it.
 
 Cc: tr...@ti.com
 Signed-off-by: Hannes Petermaier oe5...@oevsv.at

Applied to u-boot-ti/master, thanks!

-- 
Tom


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


  1   2   >