Re: [U-Boot] [ppc] qemu-ppce500 howto

2014-05-24 Thread Alon Bar-Lev
On Thu, May 22, 2014 at 12:04 PM, Alexander Graf ag...@suse.de wrote:


 On 22.05.14 09:52, Alon Bar-Lev wrote:

 Hi,

 Trying to run the qemu-ppce500 within qemu. I am using -bios u-boot.bin and 
 no luck, I get live signal.

 I am using latest u-boot master and qemu master.

 Command:
 $ ./qemu-system-ppc -M ppce500 -nographic -bios u-boot.bin

 Tried to load u-boot as well, same.


 Yes, that command should work with the right patches :). Unfortunately they 
 are not in master yet, but instead waiting in my queue:

   https://github.com/agraf/qemu

 Please give things a try with the ppc-next branch in there. That should get 
 things working for you.


WORKING! thanks!

Is there any support for flush and/or mtd for this target (-drive
if=pflash, -mtdblock)?

 If you also want to run this using KVM, please keep in mind that you need a 
 few extra patches that are in my kvm-ppc-queue branch as well.


 Alex

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


[U-Boot] [PATCH] ARC: enable CONFIG_SYS_BOOT_RAMDISK_HIGH

2014-05-24 Thread Alexey Brodkin
This enables relocation of initrd to the end of available DDR before Linux
kernel start-up as it is done in other architectures.

Signed-off-by: Alexey Brodkin abrod...@synopsys.com
---
 arch/arc/include/asm/config.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arc/include/asm/config.h b/arch/arc/include/asm/config.h
index 3d331cc..e5be078 100644
--- a/arch/arc/include/asm/config.h
+++ b/arch/arc/include/asm/config.h
@@ -8,6 +8,7 @@
 #define __ASM_ARC_CONFIG_H_
 
 #define CONFIG_SYS_GENERIC_GLOBAL_DATA
+#define CONFIG_SYS_BOOT_RAMDISK_HIGH
 
 #define CONFIG_LMB
 
-- 
1.9.0

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


Re: [U-Boot] Standalone application issue.

2014-05-24 Thread mazen.e
Dear Wolfgang, 

Thank you very much for pointing out the issue of address conflict. 

I tried loading the standalone app considering your remarks, however, the
app hangs at the following after a bootm command :
-
## Booting kernel from Legacy Image at 43e0 ...
   Image Name:   Hello World
   Image Type:   ARM U-Boot Standalone Program (uncompressed)
   Data Size:594 Bytes = 594 Bytes
   Load Address: c100
   Entry Point:  0c10
   Verifying Checksum ... OK
   Loading Standalone Program ... OK
OK
-

imi command returns the following:


Checking Image at 43e0 ...
   Legacy image found
   Image Name:   Hello World
   Image Type:   ARM U-Boot Standalone Program (uncompressed)
   Data Size:594 Bytes = 594 Bytes
   Load Address: c100
   Entry Point:  0c10
   Verifying Checksum ... OK


md 43e0 command returns:


43e0: 56190527 92e3281e e3fe8053 5202'..V.(..S..R
43e00010: 00c1 100c ef3a4c3c 00010211L:.
43e00020: 6c6c6548 6f57206f 00646c72 Hello World.
43e00030:    
43e00040: e92d40f8 e1a05000 e1a1 e1a06001.@-..P...`..
43e00050: eb62 e3a01006 e59f007c e3a04000b...|@..
43e00060: eb2f e59f7074 eb23 e1a01000/...tp..#...
43e00070: e59f006c eb2a e59f0068 eb28l...*...h...(...
43e00080: e59f0064 e1a01005 eb25 ea06d...%...
43e00090: e7962104 e1a01004 e59f0050 e2844001.!..P@..
43e000a0: e352 01a02007 eb1d e1540005..R.. T.
43e000b0: daf6 e59f0038 eb19 eb128...
43e000c0: e350 0afc eb0d e59f0024..P.$...
43e000d0: eb13 e3a0 e8bd80f8 0c1001cf
43e000e0: 0c1001c8 0c1001ef 0c10020d 0c10021a
43e000f0: 0c100225 0c100236 0c10024f e598c054%...6...O...T..


 Please be advised that i used loadb command and kermit console (send
command) to download the image serially  into the target. 



Thank you very much for your time.





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


Re: [U-Boot] [GIT PULL] Zynq patches

2014-05-24 Thread Albert ARIBAUD
Hi Michal,

On Wed, 14 May 2014 08:09:36 +0200, Michal Simek
michal.si...@xilinx.com wrote:

 Hi Albert,
 
 here is the set of patches I have capture for Xilinx Zynq.
 I am sending it now because this patchset was based on
 fpga changes I have done and which were merged yesterday.
 
 I have also checked your arm custodian repo and you don't have
 pending patches that's why I believe it shouldn't be
 any problem to do a merge with Tom's tree.
 
 Buildman doesn't show any problem around zynq patches I am sending.
 
 Thanks,
 Michal
 
 
 [u-boot]$ ./tools/buildman/buildman -b zynq zynq -sSed
 Summary of 21 commits for 6 boards (4 threads, 1 job per thread)
 01: Merge branch 'master' of git://git.denx.de/u-boot-mpc85xx
 02: ARM: zynq: Fix sparse warnings in slcr.c
 03: ARM: zynq: Fix sparse warning in ddrc.c
 04: ARM: zynq: Remove sparse warnings
arm: (for 6/6 boards)  data -168.0  rodata +168.0
 zynq_zc770_xm010:  data -168  rodata +168
 zynq_zc770_xm013:  data -168  rodata +168
 zynq_zc770_xm012:  data -168  rodata +168
 zynq_zed   :  data -168  rodata +168
 zynq_zc70x :  data -168  rodata +168
 zynq_microzed  :  data -168  rodata +168
 05: ARM: zynq: Added efuse status register base address
 06: ARM: zynq: Do not use half memory size for ECC case
arm: (for 6/6 boards)  all -32.0  text -32.0
 zynq_zc770_xm010:  all -32  text -32
 zynq_zc770_xm013:  all -32  text -32
 zynq_zc770_xm012:  all -32  text -32
 zynq_zed   :  all -32  text -32
 zynq_zc70x :  all -32  text -32
 zynq_microzed  :  all -32  text -32
 07: ARM: zynq: Call zynq board_init() in SPL
arm: (for 6/6 boards)  spl/u-boot-spl:all +16.0  spl/u-boot-spl:text 
 +16.0
 zynq_zc770_xm010:  spl/u-boot-spl:all +16  spl/u-boot-spl:text +16
 zynq_zc770_xm013:  spl/u-boot-spl:all +16  spl/u-boot-spl:text +16
 zynq_zc770_xm012:  spl/u-boot-spl:all +16  spl/u-boot-spl:text +16
 zynq_zed   :  spl/u-boot-spl:all +16  spl/u-boot-spl:text +16
 zynq_zc70x :  spl/u-boot-spl:all +16  spl/u-boot-spl:text +16
 zynq_microzed  :  spl/u-boot-spl:all +16  spl/u-boot-spl:text +16
 08: ARM: zynq: slcr: Fix incorrect commentary
 09: ARM: zynq: Setup correct slcr_lock value
arm: (for 6/6 boards)  all +102.0  bss +2.7  data +4.0  
 spl/u-boot-spl:all +72.0  spl/u-boot-spl:data +4.0  spl/u-boot-spl:text +68.0 
  text +95.3
 zynq_zc770_xm010:  all +112  bss +12  data +4  spl/u-boot-spl:all 
 +72  spl/u-boot-spl:data +4  spl/u-boot-spl:text +68  text +96
 zynq_zed   :  all +112  bss +12  data +4  spl/u-boot-spl:all 
 +72  spl/u-boot-spl:data +4  spl/u-boot-spl:text +68  text +96
 zynq_microzed  :  all +112  bss +12  data +4  spl/u-boot-spl:all 
 +72  spl/u-boot-spl:data +4  spl/u-boot-spl:text +68  text +96
 zynq_zc770_xm013:  all +100  data +4  spl/u-boot-spl:all +72  
 spl/u-boot-spl:data +4  spl/u-boot-spl:text +68  text +96
 zynq_zc770_xm012:  all +96  data +4  spl/u-boot-spl:all +72  
 spl/u-boot-spl:data +4  spl/u-boot-spl:text +68  text +92
 zynq_zc70x :  all +80  bss -20  data +4  spl/u-boot-spl:all 
 +72  spl/u-boot-spl:data +4  spl/u-boot-spl:text +68  text +96
 10: ARM: zynq: Fix bootmode mask
 11: ARM: zynq: Fix building SPL without FPGA support
 12: ARM: zynq: Extend kernel image size to 60MB
 13: ARM: zynq: Add MIO detection code
 14: ARM: zynq: ehci: Added USB host driver support
arm: (for 6/6 boards)  all +9.3  bss -0.7  rodata +10.0  
 spl/u-boot-spl:all +10.0  spl/u-boot-spl:rodata +10.0
 zynq_zc70x :  all +34  bss +24  rodata +10  
 spl/u-boot-spl:all +10  spl/u-boot-spl:rodata +10
 zynq_zc770_xm013:  all +10  rodata +10  spl/u-boot-spl:all +10  
 spl/u-boot-spl:rodata +10
 zynq_zc770_xm012:  all +10  rodata +10  spl/u-boot-spl:all +10  
 spl/u-boot-spl:rodata +10
 zynq_zc770_xm010:  all +2  bss -8  rodata +10  spl/u-boot-spl:all 
 +10  spl/u-boot-spl:rodata +10
 zynq_microzed  :  all +2  bss -8  rodata +10  spl/u-boot-spl:all 
 +10  spl/u-boot-spl:rodata +10
 zynq_zed   :  all -2  bss -12  rodata +10  spl/u-boot-spl:all 
 +10  spl/u-boot-spl:rodata +10
 15: ARM: zynq: Added USB host support for zynq boards
arm: (for 6/6 boards)  all +36453.7  bss +26203.3  data +38.7  rodata 
 +2047.7  spl/u-boot-spl:all +1.3  spl/u-boot-spl:rodata +1.3  text +8164.0
 zynq_zed   :  all +109121  bss +78632  data +116  rodata 
 +5881  spl/u-boot-spl:all +4  spl/u-boot-spl:rodata +4  text +24492
 zynq_zc70x :  all +109085  bss +78596  data +116  rodata 
 +5881  spl/u-boot-spl:all +4  spl/u-boot-spl:rodata +4  text +24492
 zynq_zc770_xm013:  all +131  rodata +131
 zynq_zc770_xm012:  all 

Re: [U-Boot] Pull request: u-boot-sh/rmobile into u-boot-arm/master

2014-05-24 Thread Albert ARIBAUD
Hi Nobuhiro,

On Wed, 21 May 2014 10:20:10 +0900, Nobuhiro Iwamatsu
iwama...@nigauri.org wrote:

 Dear Albert Aribaud,
 
 Please pull u-boot-sh/rmobile into u-boot-arm/master.
 
 The following changes since commit 05d134b084590684bcf4d832c0035952727b7cd9:
 
   Merge remote-tracking branch 'u-boot/master' (2014-05-20 10:05:42 +0200)
 
 are available in the git repository at:
 
 
   git://git.denx.de/u-boot-sh.git rmobile
 
 for you to fetch changes up to 358d6ef32ebddb58f074e1cb2042b910a5738b92:
 
   arm: rmobile: lager: Enable CONFIG_SYS_GENERIC_BOARD (2014-05-21
 10:10:06 +0900)
 
 
 Nobuhiro Iwamatsu (20):
   arm: rmobile: Add define of SCIF register for R8A7790 and R8A7791
   arm: rmobile: koelsch: Remove define of SCIF register
   arm: rmobile: koelsch: Remove CONFIG_USE_ARCH_MEMSET and MEMCPY
   arm: rmobile: koelsch: Enable optimization of thumb
   arm: rmobile: lager: Remove define of SCIF register
   arm: rmobile: lager: Remove CONFIG_USE_ARCH_MEMSET and MEMCPY
   arm: rmobile: lager: Enable optimization of thumb
   gpio: r8a7791-gpio: Fix typo in macro
   gpio: r8a7790-gpio: Fix typo in macro
   arm: rmobile: koelsch: Add support USB controller
   arm: rmobile: koelsch: Add support command and filesystems of VFAT
   arm: rmobile: lager: Add support USB controller
   arm: rmobile: lager: Add support command and filesystems of VFAT
   arm: rmobile: lager: Add support ext4/fat write command
   arm: rmobile: koelsch: Add support ext4/fat write command
   arm: rmobile: r8a7791: Fix MOD_SEL3 function table about FN_SEL_IEB
   arm: rmobile: koelsch: Fix QoS revision 0.240 and 0.320
   arm: rmobile: armadillo800eva: Enable CONFIG_SYS_GENERIC_BOARD
   arm: rmobile: koelsch: Enable CONFIG_SYS_GENERIC_BOARD
   arm: rmobile: lager: Enable CONFIG_SYS_GENERIC_BOARD
 
  arch/arm/cpu/armv7/rmobile/pfc-r8a7791.c |  2 +-
  arch/arm/include/asm/arch-rmobile/r8a7790-gpio.h |  6 +++---
  arch/arm/include/asm/arch-rmobile/r8a7791-gpio.h |  6 +++---
  arch/arm/include/asm/arch-rmobile/r8a7791.h  |  1 +
  arch/arm/include/asm/arch-rmobile/rcar-base.h|  8 
  board/renesas/koelsch/qos.c  |  1 +
  include/configs/armadillo-800eva.h   |  1 +
  include/configs/koelsch.h| 23 +++
  include/configs/lager.h  | 22 ++
  9 files changed, 55 insertions(+), 15 deletions(-)
 
 --
 Nobuhiro Iwamatsu
iwamatsu at {nigauri.org / debian.org}
GPG ID: 40AD1FA6

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

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


Re: [U-Boot] Please pull u-boot-ti/master

2014-05-24 Thread Albert ARIBAUD
Hi Tom,

On Fri, 23 May 2014 19:52:11 -0400, Tom Rini tr...@ti.com wrote:

 Hello,
 
 The following changes since commit 05d134b084590684bcf4d832c0035952727b7cd9:
 
   Merge remote-tracking branch 'u-boot/master' (2014-05-20 10:05:42 +0200)
 
 are available in the git repository at:
 
 
   git://git.denx.de/u-boot-ti.git master
 
 for you to fetch changes up to 39338a30fab2ce7d80dfe0d457071573727f499f:
 
   compulab: eeprom: enable any i2c driver (2014-05-23 19:40:39 -0400)
 
 
 Ash Charles (9):
   omap: overo: allow the use of a plain text env file instead boot scripts
   OMAP3: overo: add command support for mtd and ubi
   OMAP3: overo: eliminate hard-coded partition offsets
   arm: omap3: Fix omap3_overo SPL boot hangup
   Add Board Revision for Wireless chip
   OMAP3: overo: add some Gumstix expansion boards
   Allow overo to boot with device tree
   omap3: overo: Use common configurations for Overo
   omap4: duovero: Add Gumstix DuoVero machine.
 
 Dmitry Lifshitz (3):
   cm-t54: add cm-t54 board support
   cm-t54: add EEPROM support and MAC address handling
   cm-t54: add environment partition runtime detection
 
 Heiko Schocher (1):
   arm, am33xx: Enable CONFIG_SYS_GENERIC_BOARD for siemens boards
 
 Igor Grinberg (1):
   compulab: eeprom: add default eeprom address
 
 Ilya Ledvich (1):
   compulab: eeprom: enable any i2c driver
 
 Keerthy (1):
   ARM: DRA72x: volt: Update the pmic offsets
 
 Lokesh Vutla (5):
   ARM: DRA72x: Add Silicon ID support
   ARM: DRA72x: clocks: Update the hwdata
   ARM: DRA72x: Update EMIF data
   ARM: DRA7xx: ctrl: Fix efuse register addresses
   ARM: OMAP: Fix omap_sdram_size calculation
 
 Peter A. Bigot (1):
   OMAP3: overo: increase linux partition to 8 MiB
 
 Sergey Alyoshin (1):
   am33xx: report silicon revision instead of code
 
 Tom Rini (1):
   armv7:TI: Add asm/ti-common/sys_proto.h and migrate 
 omap_hw_init_context
 
 pekon gupta (3):
   ARM: omap4: add platform specific info for GPMC and ELM controllers
   ARM: omap5: add platform specific info for GPMC and ELM controllers
   ARM: omap: merge GPMC initialization code for all platform
 
  arch/arm/cpu/armv7/am33xx/Makefile |1 -
  arch/arm/cpu/armv7/am33xx/mem.c|   98 
  arch/arm/cpu/armv7/am33xx/sys_info.c   |   41 ++--
  arch/arm/cpu/armv7/omap-common/Makefile|4 -
  arch/arm/cpu/armv7/omap-common/emif-common.c   |6 +-
  arch/arm/cpu/armv7/omap-common/hwinit-common.c |   15 +-
  arch/arm/cpu/armv7/omap-common/mem-common.c|  117 +-
  arch/arm/cpu/armv7/omap3/Makefile  |1 -
  arch/arm/cpu/armv7/omap5/hw_data.c |   40 
  arch/arm/cpu/armv7/omap5/hwinit.c  |3 +
  arch/arm/cpu/armv7/omap5/prcm-regs.c   |8 +-
  arch/arm/cpu/armv7/omap5/sdram.c   |   19 +-
  arch/arm/include/asm/arch-am33xx/sys_proto.h   |1 +
  arch/arm/include/asm/arch-omap3/mem.h  |1 +
  arch/arm/include/asm/arch-omap4/cpu.h  |5 +-
  arch/arm/include/asm/arch-omap4/hardware.h |   26 +++
  arch/arm/include/asm/arch-omap4/mem.h  |   62 +
  arch/arm/include/asm/arch-omap4/omap.h |3 -
  arch/arm/include/asm/arch-omap4/sys_proto.h|   51 +---
  arch/arm/include/asm/arch-omap5/cpu.h  |5 +-
  arch/arm/include/asm/arch-omap5/hardware.h |   26 +++
  arch/arm/include/asm/arch-omap5/mem.h  |   62 +
  arch/arm/include/asm/arch-omap5/omap.h |9 +-
  arch/arm/include/asm/arch-omap5/sys_proto.h|   50 +---
  arch/arm/include/asm/omap_common.h |7 +-
  arch/arm/include/asm/ti-common/sys_proto.h |   72 ++
  board/compulab/cm_t54/Makefile |   10 +
  board/compulab/cm_t54/cm_t54.c |  262 +
  board/compulab/cm_t54/mux.c|   94 
  board/compulab/cm_t54/spl.c|   66 ++
  board/compulab/common/Makefile |2 +-
  board/compulab/common/eeprom.c |5 +
  board/compulab/common/eeprom.h |2 +-
  board/gumstix/duovero/Makefile |8 +
  board/gumstix/duovero/duovero.c|  264 +
  board/gumstix/duovero/duovero_mux_data.h   |  199 
  board/overo/overo.c|   43 +++-
  board/overo/overo.h|   17 ++
  boards.cfg |2 +
  include/configs/cm_t54.h   |  149 
  include/configs/duovero.h  |   62 +
  include/configs/omap3_overo.h  |  296 
 
  include/configs/siemens-am33x-common.h |2 +
  include/configs/ti_omap4_common.h 

Re: [U-Boot] [GIT PULL] Zynq patches v2

2014-05-24 Thread Albert ARIBAUD
Hi Michal,

On Tue, 20 May 2014 15:21:55 +0200, Michal Simek mon...@monstr.eu
wrote:

 Hi Albert,
 
 based on your pull request to Tom here
 http://lists.denx.de/pipermail/u-boot/2014-May/179841.html
 and our IRC last week I am sending updated pull request
 where I have added 5 more patches from Masahiro which
 are bug fixes.
 Please pull them to your tree when you do merge with Tom's tree.
 
 Thanks,
 Michal
 
 [u-boot]$ ./tools/buildman/buildman -b zynq zynq -sSed
 Summary of 26 commits for 6 boards (4 threads, 1 job per thread)
 01: Merge branch 'master' of git://git.denx.de/u-boot-mpc85xx
 02: ARM: zynq: Fix sparse warnings in slcr.c
 03: ARM: zynq: Fix sparse warning in ddrc.c
 04: ARM: zynq: Remove sparse warnings
arm: (for 6/6 boards)  data -168.0  rodata +168.0
 zynq_zc770_xm010:  data -168  rodata +168
 zynq_zc770_xm013:  data -168  rodata +168
 zynq_zc770_xm012:  data -168  rodata +168
 zynq_zed   :  data -168  rodata +168
 zynq_zc70x :  data -168  rodata +168
 zynq_microzed  :  data -168  rodata +168
 05: ARM: zynq: Added efuse status register base address
 06: ARM: zynq: Do not use half memory size for ECC case
arm: (for 6/6 boards)  all -32.0  text -32.0
 zynq_zc770_xm010:  all -32  text -32
 zynq_zc770_xm013:  all -32  text -32
 zynq_zc770_xm012:  all -32  text -32
 zynq_zed   :  all -32  text -32
 zynq_zc70x :  all -32  text -32
 zynq_microzed  :  all -32  text -32
 07: ARM: zynq: Call zynq board_init() in SPL
arm: (for 6/6 boards)  spl/u-boot-spl:all +16.0  spl/u-boot-spl:text 
 +16.0
 zynq_zc770_xm010:  spl/u-boot-spl:all +16  spl/u-boot-spl:text +16
 zynq_zc770_xm013:  spl/u-boot-spl:all +16  spl/u-boot-spl:text +16
 zynq_zc770_xm012:  spl/u-boot-spl:all +16  spl/u-boot-spl:text +16
 zynq_zed   :  spl/u-boot-spl:all +16  spl/u-boot-spl:text +16
 zynq_zc70x :  spl/u-boot-spl:all +16  spl/u-boot-spl:text +16
 zynq_microzed  :  spl/u-boot-spl:all +16  spl/u-boot-spl:text +16
 08: ARM: zynq: slcr: Fix incorrect commentary
 09: ARM: zynq: Setup correct slcr_lock value
arm: (for 6/6 boards)  all +102.0  bss +2.7  data +4.0  
 spl/u-boot-spl:all +72.0  spl/u-boot-spl:data +4.0  spl/u-boot-spl:text +68.0 
  text +95.3
 zynq_zc770_xm010:  all +112  bss +12  data +4  spl/u-boot-spl:all 
 +72  spl/u-boot-spl:data +4  spl/u-boot-spl:text +68  text +96
 zynq_zed   :  all +112  bss +12  data +4  spl/u-boot-spl:all 
 +72  spl/u-boot-spl:data +4  spl/u-boot-spl:text +68  text +96
 zynq_microzed  :  all +112  bss +12  data +4  spl/u-boot-spl:all 
 +72  spl/u-boot-spl:data +4  spl/u-boot-spl:text +68  text +96
 zynq_zc770_xm013:  all +100  data +4  spl/u-boot-spl:all +72  
 spl/u-boot-spl:data +4  spl/u-boot-spl:text +68  text +96
 zynq_zc770_xm012:  all +96  data +4  spl/u-boot-spl:all +72  
 spl/u-boot-spl:data +4  spl/u-boot-spl:text +68  text +92
 zynq_zc70x :  all +80  bss -20  data +4  spl/u-boot-spl:all 
 +72  spl/u-boot-spl:data +4  spl/u-boot-spl:text +68  text +96
 10: ARM: zynq: Fix bootmode mask
 11: ARM: zynq: Fix building SPL without FPGA support
 12: ARM: zynq: Extend kernel image size to 60MB
 13: ARM: zynq: Add MIO detection code
 14: ARM: zynq: ehci: Added USB host driver support
arm: (for 6/6 boards)  all +9.3  bss -0.7  rodata +10.0  
 spl/u-boot-spl:all +10.0  spl/u-boot-spl:rodata +10.0
 zynq_zc70x :  all +34  bss +24  rodata +10  
 spl/u-boot-spl:all +10  spl/u-boot-spl:rodata +10
 zynq_zc770_xm013:  all +10  rodata +10  spl/u-boot-spl:all +10  
 spl/u-boot-spl:rodata +10
 zynq_zc770_xm012:  all +10  rodata +10  spl/u-boot-spl:all +10  
 spl/u-boot-spl:rodata +10
 zynq_zc770_xm010:  all +2  bss -8  rodata +10  spl/u-boot-spl:all 
 +10  spl/u-boot-spl:rodata +10
 zynq_microzed  :  all +2  bss -8  rodata +10  spl/u-boot-spl:all 
 +10  spl/u-boot-spl:rodata +10
 zynq_zed   :  all -2  bss -12  rodata +10  spl/u-boot-spl:all 
 +10  spl/u-boot-spl:rodata +10
 15: ARM: zynq: Added USB host support for zynq boards
arm: (for 6/6 boards)  all +36453.7  bss +26203.3  data +38.7  rodata 
 +2047.7  spl/u-boot-spl:all +1.3  spl/u-boot-spl:rodata +1.3  text +8164.0
 zynq_zed   :  all +109121  bss +78632  data +116  rodata 
 +5881  spl/u-boot-spl:all +4  spl/u-boot-spl:rodata +4  text +24492
 zynq_zc70x :  all +109085  bss +78596  data +116  rodata 
 +5881  spl/u-boot-spl:all +4  spl/u-boot-spl:rodata +4  text +24492
 zynq_zc770_xm013:  all +131  rodata +131
 zynq_zc770_xm012:  all +131  rodata +131
 zynq_zc770_xm010:  all +127  bss -4  rodata +131
 zynq_microzed  :  all +127  bss 

Re: [U-Boot] [GIT PULL] Zynq patches

2014-05-24 Thread Albert ARIBAUD
Hi Michal,

On Sat, 24 May 2014 10:38:37 +0200, Albert ARIBAUD
albert.u.b...@aribaud.net wrote:

 Hi Michal,
≤ [...]
 Applied to u-boot-arm/master, thanks!

Disregard -- V2 was applied, not this V1.

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


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

2014-05-24 Thread Albert ARIBAUD
Hello Tom (and sorry for the duplicate),

The following changes since commit
10dc77716f41979e03baf3b847b97dc7279ef30d:

  esdhc/usdhc: Fix warning when CONFIG_SYS_FSL_ESDHC_USE_PIO is not set
  (2014-05-23 09:19:05 -0400)

are available in the git repository at:

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

for you to fetch changes up to 33144ea443c298ac9d6f04926a02881a5bae91a3:

  Merge branch 'u-boot-ti/master' into 'u-boot-arm/master' (2014-05-24
  09:50:00 +0200)



Albert ARIBAUD (3):
  Merge branch 'u-boot-microblaze/zynq' into 'u-boot-arm/master'
  Merge branch 'u-boot-sh/rmobile' into 'u-boot-arm/master'
  Merge branch 'u-boot-ti/master' into 'u-boot-arm/master'

Ash Charles (9):
  omap: overo: allow the use of a plain text env file instead boot
scripts OMAP3: overo: add command support for mtd and ubi
  OMAP3: overo: eliminate hard-coded partition offsets
  arm: omap3: Fix omap3_overo SPL boot hangup
  Add Board Revision for Wireless chip
  OMAP3: overo: add some Gumstix expansion boards
  Allow overo to boot with device tree
  omap3: overo: Use common configurations for Overo
  omap4: duovero: Add Gumstix DuoVero machine.

Dmitry Lifshitz (3):
  cm-t54: add cm-t54 board support
  cm-t54: add EEPROM support and MAC address handling
  cm-t54: add environment partition runtime detection

Heiko Schocher (1):
  arm, am33xx: Enable CONFIG_SYS_GENERIC_BOARD for siemens boards

Igor Grinberg (1):
  compulab: eeprom: add default eeprom address

Ilya Ledvich (1):
  compulab: eeprom: enable any i2c driver

Keerthy (1):
  ARM: DRA72x: volt: Update the pmic offsets

Lokesh Vutla (5):
  ARM: DRA72x: Add Silicon ID support
  ARM: DRA72x: clocks: Update the hwdata
  ARM: DRA72x: Update EMIF data
  ARM: DRA7xx: ctrl: Fix efuse register addresses
  ARM: OMAP: Fix omap_sdram_size calculation

Masahiro Yamada (7):
  zynq: add empty xil_io.h to avoid compile error
  zynq: treat ps7_init.c/h as external files to ignore them
  build: support a new image u-boot-dtb.img
  zynq: load u-boot-dtb.img if CONFIG_OF_SEPARATE is defined
  zynq: import zynq-7000.dtsi from Linux Kernel
  zynq: add memory nodes to device tree to initialize DRAM with OF
  zynq: add UART nodes to device tree to initialize UART with OF

Michal Simek (12):
  ARM: zynq: Fix sparse warnings in slcr.c
  ARM: zynq: Fix sparse warning in ddrc.c
  ARM: zynq: Remove sparse warnings
  ARM: zynq: Do not use half memory size for ECC case
  ARM: zynq: Call zynq board_init() in SPL
  ARM: zynq: slcr: Fix incorrect commentary
  ARM: zynq: Setup correct slcr_lock value
  ARM: zynq: Fix building SPL without FPGA support
  ARM: zynq: Extend kernel image size to 60MB
  ARM: zynq: Add MIO detection code
  ARM: zynq: ehci: Added USB host driver support
  ARM: zynq: Extend maximum number of command arguments

Mike Looijmans (1):
  ARM: zynq: Fix bootmode mask

Nobuhiro Iwamatsu (20):
  arm: rmobile: Add define of SCIF register for R8A7790 and R8A7791
  arm: rmobile: koelsch: Remove define of SCIF register
  arm: rmobile: koelsch: Remove CONFIG_USE_ARCH_MEMSET and MEMCPY
  arm: rmobile: koelsch: Enable optimization of thumb
  arm: rmobile: lager: Remove define of SCIF register
  arm: rmobile: lager: Remove CONFIG_USE_ARCH_MEMSET and MEMCPY
  arm: rmobile: lager: Enable optimization of thumb
  gpio: r8a7791-gpio: Fix typo in macro
  gpio: r8a7790-gpio: Fix typo in macro
  arm: rmobile: koelsch: Add support USB controller
  arm: rmobile: koelsch: Add support command and filesystems of VFAT
  arm: rmobile: lager: Add support USB controller
  arm: rmobile: lager: Add support command and filesystems of VFAT
  arm: rmobile: lager: Add support ext4/fat write command
  arm: rmobile: koelsch: Add support ext4/fat write command
  arm: rmobile: r8a7791: Fix MOD_SEL3 function table about
FN_SEL_IEB arm: rmobile: koelsch: Fix QoS revision 0.240 and 0.320
  arm: rmobile: armadillo800eva: Enable CONFIG_SYS_GENERIC_BOARD
  arm: rmobile: koelsch: Enable CONFIG_SYS_GENERIC_BOARD
  arm: rmobile: lager: Enable CONFIG_SYS_GENERIC_BOARD

Peter A. Bigot (1):
  OMAP3: overo: increase linux partition to 8 MiB

Sergey Alyoshin (1):
  am33xx: report silicon revision instead of code

Siva Durga Prasad Paladugu (5):
  ARM: zynq: Added efuse status register base address
  ARM: zynq: Added USB host support for zynq boards
  ARM: zynq: Enable the FAT write capability
  ARM: zynq: Move USB/SD/MMC common FAT configs
  ARM: zynq: Enable EXT4 configs

Tom Rini (1):
  armv7:TI: Add asm/ti-common/sys_proto.h and migrate
omap_hw_init_context

pekon gupta (3):
  ARM: omap4: add platform specific info for GPMC and ELM
controllers ARM: omap5: add platform specific info for 

Re: [U-Boot] [RFC] Extend 'bootm' to support Linux kernel generated images

2014-05-24 Thread Tom Rini
On Fri, May 23, 2014 at 03:57:34PM -1000, Simon Glass wrote:
 Hi Tom,
 
 On 21 May 2014 10:46, Tom Rini tr...@ti.com wrote:
  On Wed, May 21, 2014 at 10:10:50PM +0200, Wolfgang Denk wrote:
  Dear Tom Rini,
 
  In message 20140521195824.GE1752@bill-the-cat you wrote:
  
   Something that Rob mentioned to me at ELC, and others have mentioned
   before is that it would be nice if 'bootm' (which says boot application
   image stored in memory in the help, even) would just work with zImage
   or Image or whatever is spit directly out of the kernel.
 
  I don;t think this is a good idea.  application image is supposed to
  mean one of the U-Boot image formats, which means the old legacy
  image format (with the 64 byte header), or FIT images.  To boot a
  zImage file, we have the bootz command.
 
  Yes, it's historically meant something with an essentially (technically
  no, practically, yes) U-Boot centric header on it.  But that's not what
  the help text says.  And yes we have bootz for zImages and I added booti
  for Image images.  That resulted in You mean I have to type different
  things for arm and arm64? *sigh* when explaining this in person.
 
  I also think such a patch is pushing into the wrong direction.  We
  should rather try and improve the kernel support for FIT images.
 
  That's neither here nor there.  You can create and boot FIT images
  today, anywhere it's enabled (including arm64).  You can do the same
  with legacy images (which also resulted in sighs when I mentioned this).
  The kernel doesn't want any of this in the kernel tree.  Developers want
  to have as few steps between build my kernel and now I'm testing my
  kernel.  Adding in create / grab stub FIT file, run mkimage results
  in more unhappy developers.
 
 Unless I'm imagining it, some years ago I could type 'make fit_image'
 or similar for the kernel and get an image ready to boot. Did someone
 remove that feature from Linux and expect the number of steps needed
 to build a kernel to stay the same?

It wasn't in mainline, I'm fairly certain.  Or maybe it was an arch/ppc
thing that got dropped along the way.

 It surprises me the lengths to which people are going to try to
 shoehorn .dtbs, compression, multiple dtbs, multi-arch etc. into the
 kenel zImage format. The decompression header is ugly, plus it is
 slower than doing these things in U-Boot.

Well, with arm64 the kernel is just getting out of the business, hence
booti (or however we add Image support) and not do the zImage dance.

-- 
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 4/4] kirkwood: Shorten DNS-325 IDENT_STRING to match DNS-320

2014-05-24 Thread Stefan Herbrechtsmeier

Am 19.05.2014 11:21, schrieb Prafulla Wadaskar:

-Original Message-
From: Bastien ROUCARIÈS
[mailto:roucaries.bast...@gmail.com]
Sent: 18 May 2014 21:51
To: u-boot@lists.denx.de
Cc: Jamie Lentin; Prafulla Wadaskar; Albert ARIBAUD;
Stefan Herbrechtsmeier
Subject: [PATCH 4/4] kirkwood: Shorten DNS-325
IDENT_STRING to match DNS-320

From: Jamie Lentin j...@lentin.co.uk

You should already know you're using a D-link device.

Signed-off-by: Jamie Lentin j...@lentin.co.uk

Cc: Prafulla Wadaskar prafu...@marvell.com
Cc: Jamie Lentin j...@lentin.co.uk
Cc: Albert ARIBAUD albert.u.b...@aribaud.net
Cc: Stefan Herbrechtsmeier
ste...@code.herbrechtsmeier.net
---
  include/configs/dnskw.h | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/configs/dnskw.h
b/include/configs/dnskw.h
index e55fdc4..7058873 100644
--- a/include/configs/dnskw.h
+++ b/include/configs/dnskw.h
@@ -19,7 +19,7 @@
  #ifdef CONFIG_BOARD_IS_DNS325
  #define MACH_TYPE_DNS325  3800
  #define CONFIG_MACH_TYPE  MACH_TYPE_DNS325
-#define CONFIG_IDENT_STRING\nD-Link DNS-325
+#define CONFIG_IDENT_STRING\nDNS-325

First of all thanks for preferring short names.

Since the file is renamed to dnskw, and there are two or more boards supported 
like 320 and 325,

Does above string makes sense? Or you should better name to some common name? like 
DNSKW?
Because the u-boot.kwb is different for the boards I would prefer 
different names.


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


Re: [U-Boot] [PATCH v3: DNS320 support 0/4] Add a new kirkwook board

2014-05-24 Thread Stefan Herbrechtsmeier

Am 22.05.2014 21:13, schrieb Bastien ROUCARIÈS:

MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Hi,

A rebase of an old patch set from Jamie Lentin.

Source is available here:
http://jamie.lentin.co.uk/devices/dlink-dns325/

Please apply

Changelog:
[V2] Use git option -M
[V3] Fix a mismerge in boards.cfg

Cc: Prafulla Wadaskar prafu...@marvell.com
Cc: Jamie Lentin j...@lentin.co.uk
Cc: Albert ARIBAUD albert.u.b...@aribaud.net
Cc: Stefan Herbrechtsmeier ste...@code.herbrechtsmeier.net

Jamie Lentin (4):
   kirkwood: Rename dns325 to dnskw
   kirkwood: Add support for the D-Link DNS-320
   kirkwood: Set unused SD pins back to GPIO for DNS-320  DNS-325
   kirkwood: Shorten DNS-325 IDENT_STRING to match DNS-320

  board/d-link/dns325/dns325.h   |  32 
  board/d-link/{dns325 = dnskw}/Makefile|   2 +-
  board/d-link/{dns325/dns325.c = dnskw/dnskw.c}|  30 +--
  board/d-link/dnskw/dnskw.h |  42 +
  board/d-link/dnskw/kwbimage.dns320.cfg | 207 +
  .../kwbimage.cfg = dnskw/kwbimage.dns325.cfg} |   0
  boards.cfg |   3 +-
  include/configs/{dns325.h = dnskw.h}  |  23 ++-
  8 files changed, 286 insertions(+), 53 deletions(-)
  delete mode 100644 board/d-link/dns325/dns325.h
  rename board/d-link/{dns325 = dnskw}/Makefile (93%)
  rename board/d-link/{dns325/dns325.c = dnskw/dnskw.c} (84%)
  create mode 100644 board/d-link/dnskw/dnskw.h
  create mode 100644 board/d-link/dnskw/kwbimage.dns320.cfg
  rename board/d-link/{dns325/kwbimage.cfg = dnskw/kwbimage.dns325.cfg} (100%)
  rename include/configs/{dns325.h = dnskw.h} (86%)


Tested-by: Stefan Herbrechtsmeier ste...@herbrechtsmeier.net
Acked-by: Stefan Herbrechtsmeier ste...@herbrechtsmeier.net

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


Re: [U-Boot] Standalone application issue.

2014-05-24 Thread Wolfgang Denk
Dear mazen.e,

In message 1400920322709-180612.p...@n7.nabble.com you wrote:
 
 I tried loading the standalone app considering your remarks, however, the
 app hangs at the following after a bootm command :
 -
 ## Booting kernel from Legacy Image at 43e0 ...
Image Name:   Hello World
Image Type:   ARM U-Boot Standalone Program (uncompressed)
Data Size:594 Bytes = 594 Bytes
Load Address: c100
---
Entry Point:  0c10
---
Verifying Checksum ... OK
Loading Standalone Program ... OK

0xc100 != 0x0c10

1) Please re-check load address and entry point address - I feel they
   should be identical, but they are not.  Actually your entry point
   address seems bogus (missing one 0).

2) Did you verify (using the nm command or by checking the link map)
   that c100 is indeed the entry point address?

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
The use of COBOL cripples the mind; its teaching  should,  therefore,
be regarded as a criminal offence.
  -- Edsger W. Dijkstra, SIGPLAN Notices, Volume 17, Number 5
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] spi_flash_probe returns zero idcodes and hangs

2014-05-24 Thread Amit Mahadik
Hello All,
                I am using a custom ARM based development board running u-boot 
from PNOR memory. However, it does not have support for the Micron SPI flash 
memory (N25Q064A). I have added support for the micron memory in 
drivers/mtd/spi/stmicro.c file and included the flag CONFIG_SPI_FLASH_STMICRO 
in the config file and recompiled the u-boot source source. Then, ran it 
directly through RAM memory.
The new u-boot ran from RAM. Now when I run sf probe 0 command I get the 
following output
Got Idcodes 00: 00 00 00 00  and the code hangs after this. 

Please help me regarding this issue.


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


[U-Boot] spi_flash_probe returns zero idcodes and hangs

2014-05-24 Thread Amit Mahadik
Hello All,
                I am using a custom ARM based development board running u-boot 
from PNOR memory. However, it does not have support for the Micron SPI flash 
memory (N25Q064A). I have added support for the micron memory in 
drivers/mtd/spi/stmicro.c file and included the flag CONFIG_SPI_FLASH_STMICRO 
in the config file and recompiled the u-boot source source. Then, ran it 
directly through RAM memory.
The new u-boot ran from RAM. Now when I run sf probe 0 command I get the 
following output
Got Idcodes 00: 00 00 00 00  and the code hangs after this. 

Please help me regarding this issue.


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


Re: [U-Boot] spi_flash_probe returns zero idcodes and hangs

2014-05-24 Thread Jagan Teki
On Sat, May 24, 2014 at 10:27 PM, Amit Mahadik amitmahadi...@yahoo.com wrote:
 Hello All,
 I am using a custom ARM based development board running 
 u-boot from PNOR memory. However, it does not have support for the Micron SPI 
 flash memory (N25Q064A). I have added support for the micron memory in 
 drivers/mtd/spi/stmicro.c file and included the flag CONFIG_SPI_FLASH_STMICRO 
 in the config file and recompiled the u-boot source source. Then, ran it 
 directly through RAM memory.
 The new u-boot ran from RAM. Now when I run sf probe 0 command I get the 
 following output
 Got Idcodes 00: 00 00 00 00  and the code hangs after this.

Looks like your driver itself is not returning any proper idcode.

What id details you added - I think you're using old u-boot no stmicro.c
in current u-boot, please re-base to master and try.

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


Re: [U-Boot] [RFC, PATCH v2 2/4] lib, rbtree: resync with Linux-3.14

2014-05-24 Thread Marek Vasut
On Thursday, May 22, 2014 at 12:43:06 PM, Heiko Schocher wrote:
 resync with linux:
 
 commit 455c6fdbd219161bd09b1165f11699d6d73de11c
 Author: Linus Torvalds torva...@linux-foundation.org
 Date:   Sun Mar 30 20:40:15 2014 -0700
 
 Linux 3.14
 
 Needed for the MTD/UBI/UBIFS resync
 
 Signed-off-by: Heiko Schocher h...@denx.de
 Cc: Marek Vasut ma...@denx.de
 Cc: Sergey Lapin sla...@ossfans.org
 Cc: Scott Wood scottw...@freescale.com

Did you just copy the files over or did you change anything in them? If you 
changed anything, I'd say that should go into some compat header so there's a 
minimum amount of changes compared to the mainline linux code.

[...]

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


Re: [U-Boot] Uboot-standalone-kernel.

2014-05-24 Thread Marek Vasut
On Friday, May 23, 2014 at 12:05:02 PM, mazen.e wrote:
 Is it possible to load a bare-metal standalone application by using uboot,

Yes

 and let the standalone app load a kernel and FS

If you pass control to it, yes.

 , could you please propose a
 hint on how to it?

As you gave no hints on what you're trying to do, what version of U-Boot you're 
using etc., I can only point you to doc/README.standalone .

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


Re: [U-Boot] [PATCH 3/3 V2] ARM: mxs: Fix NAND FCB flashing

2014-05-24 Thread Marek Vasut
On Wednesday, May 21, 2014 at 04:08:09 PM, jkrause wrote:
 I was wondering about the following warnings while bootings linux
 3.15.0-rc5:
 
 [0.998885] nand: device found, Manufacturer ID: 0x98, Chip ID: 0xd1
 [1.005485] nand: Toshiba NAND 128MiB 3,3V 8-bit
 [1.010165] nand: 128MiB, SLC, page size: 2048, OOB size: 64
 [1.016176] Scanning device for bad blocks
 [1.022444] Bad eraseblock 1 at 0x0002
 [1.027444] Bad eraseblock 2 at 0x0004
 [1.032612] Bad eraseblock 3 at 0x0006
 
 I noticed that these are the FCB pages for the NAND boot. Google found me
 this old thread. Nevertheless, I applied the patch on our custom i.MX28
 board and the warnings disappeared.

Yeah, but sometimes this patch made my board unbootable and I didn't have time 
to investigate further. That is why it was never applied, to prevent that.

 But I still have some questions and remarks:
 
 
 Marek Vasut-3 wrote
 
  Fix the method of flashing FCB blocks into NAND. The new env
  writes all four FCB blocks and also does not scrub such a big
  part of the NAND. This fixed complains about busted NAND blocks
  in Linux.
  
  +   update_nand_write_fcb=\
  +   setenv i ${update_nand_count} ;   \
  +   setenv update_nand_offset 0x0 ;   \
  +   setexpr update_nand_step  \
  +   ${update_nand_stride} * ${nand_writesize} ;   \
  +   while test ${i} -gt 0 ; do\
  +   echo ${update_nand_offset} ;  \
  +   nand scrub -y ${update_nand_offset}   \
  +   ${nand_erasesize} ;   \
  +   nand write.raw ${loadaddr}\
  +   ${update_nand_offset} \
  +   ${update_nand_stride} ;   \
 
 Why not just write a page (which contains the FCB) instead of the whole
 stride?

Feel free to roll V3 of the patch.

 There is also a problem about scrubbing of size 128K (which is the erase
 size) and writing 128K (which is the size of a search area with 64 pages).
 This works for the default settings (fuses not blown) of search stride =
 1*64 and search count = 4. But if the fuses is blown and stride = 2*64 and
 count = 2 it will scrub 128K and write 256K (size of 128 pages). So the
 second half of the search area is not erased before writing.

Yes, we only support the default factory configuration. There are ways to tweak 
the code to use different geometries, but that was to my knowledge never even 
tested.

 Marek Vasut-3 wrote
 
  update_nand_full= /* Update FCB, DBBT and FW */   \
  
  if tftp ${update_nand_full_filename} ; then   \
  run update_nand_get_fcb_size ;\
  
  -   nand scrub -y 0x0 ${filesize} ;   \
  -   nand write.raw ${loadaddr} 0x0 ${fcb_sz} ;\
  +   run update_nand_write_fcb ;   \
  
  setexpr update_off ${loadaddr} + ${update_nand_fcb} ;  \
  setexpr update_sz ${filesize} - ${update_nand_fcb} ;  \
  nand write ${update_off} ${update_nand_fcb} ${update_sz} ;  \
 
 Running update_nand_write_fcb erases and writes the FCB search area. The
 remaining bytes of the u-boot.nand file are writting before erasing the
 corresponding NAND flash bytes. I added something like this before:
 
   setexpr update_off ${loadaddr} + ${update_nand_fcb} ;  \
   setexpr update_sz ${filesize} - ${update_nand_fcb} ;  \
  +nand erase ${update_nand_fcb} ${update_sz};  \
   nand write ${update_off} ${update_nand_fcb} ${update_sz} ;  \
 
 Is there any reason why this patch is not applied to the u-boot-imx repo?

Yes, see above. Feel free to submit V3 with detailed changelog and I can try if 
it still breaks my platforms.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] mxs: fixed battery boot on imx233-olinuxino-micro

2014-05-24 Thread Marek Vasut
On Wednesday, May 21, 2014 at 04:01:55 AM, Peter Schumann wrote:
 This patch makes it possible to boot from battery on olinuxino Boards
 from Olimex.
 
 We should not set DOUBLE_FETS in HW_POWER_MINPWR

Please explain how you arrived to this conclusion.

 , it makes my system
 reset with in seconds while running on battery power.

 Also  mxs_power_enable_4p2() should not be called if running from
 battery. It switches VDDD and VDDA to LinReg mode and than turns off
 the VDDIO DCDC supply. At this point the system resets.

This has been tested on i.MX28 , can you please check what the differences are 
between these two chips and why it works only on one of them ?

 If we run on battery this is no good idea because the LinRegs are
 chained behind VDDIO and battery voltage seems not enough to power
 the system from LinRegs.
 Also is the power system already running on DCDC after BootROM hands
 over to u-boot, so no sense in switching back to LinRegs.

The BootROM never hands over to U-Boot, so this really makes no sense. Can you 
please explain ? The BootROM handles over to U-Boot SPL, which configures the 
power block.

Also, I find it a very bad idea to depend on the BootROM to actually start the 
DCDC converter. I don't think we can universally say the DCDC converter is 
running when entering U-Boot SPL. I also don't think we can even depend on the 
power block configuration when exiting the BootROM -- for example in JTAG Boot 
Mode, the BootROM halts early in the boot process and will likely not configure 
anything with regards to the power block.

[...]

THanks!

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


Re: [U-Boot] [PATCH v2 2/2] lsxl: rework boot scripts

2014-05-24 Thread Michael Walle
Am Samstag, 19. April 2014, 23:52:19 schrieb Michael Walle:
 Am 2014-04-01 20:09, schrieb Michael Walle:
  Move addresses for kernel, ramdisk and fdt blob to own variables. Add
  dtb
  blob loading to all existing boot scripts, dtb filenames were taken
  from
  vanilla kernel. Introduce new boot script bootcmd_legacy, which only
  loads
  a kernel and a ramdisk. Make this the default boot script. This should
  also
  restore the behaviour of the original bootloader.
  
  Cc: Prafulla Wadaskar prafu...@marvell.com
  Cc: Tom Rini tr...@ti.com
  Signed-off-by: Michael Walle mich...@walle.cc
 
 ping 2
 
 albert, could you merge this? prafulla does not seem to answer.


ping 3, anybody alive? :(

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


Re: [U-Boot] spi_flash_probe returns zero idcodes and hangs

2014-05-24 Thread Jagan Teki
+ u-boot ML

On Sat, May 24, 2014 at 11:48 PM, Amit Mahadik amitmahadi...@yahoo.com wrote:
 Hello Sir,
 Please find attached my driver file. The function
 spi_flash_alloc_base declaration was added to include/spi_flash.h and
 definition to drivers/mtd/spi/spi_flash.c.

Yes - It's looks fine but.


 Regards,
 Amit.


 On Saturday, 24 May 2014 10:45 PM, Jagan Teki jagannadh.t...@gmail.com
 wrote:


 On Sat, May 24, 2014 at 10:27 PM, Amit Mahadik amitmahadi...@yahoo.com
 wrote:
 Hello All,
I am using a custom ARM based development board running
 u-boot from PNOR memory. However, it does not have support for the Micron
 SPI flash memory (N25Q064A). I have added support for the micron memory in
 drivers/mtd/spi/stmicro.c file and included the flag
 CONFIG_SPI_FLASH_STMICRO in the config file and recompiled the u-boot source
 source. Then, ran it directly through RAM memory.
 The new u-boot ran from RAM. Now when I run sf probe 0 command I get the
 following output
 Got Idcodes 00: 00 00 00 00  and the code hangs after this.

This log should not be all 0's
#ifdef DEBUG
printf(SF: Got idcodes\n);
print_buffer(0, idcode, 1, sizeof(idcode), 0);
#endif

The idcode details comes from drivers/spi while reading flash ID code.
Check with your driver once and it's good to try to latest u-boot.


 Looks like your driver itself is not returning any proper idcode.

 What id details you added - I think you're using old u-boot no stmicro.c
 in current u-boot, please re-base to master and try.

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


Re: [U-Boot] spi_flash_probe returns zero idcodes and hangs

2014-05-24 Thread Jon Loeliger
Amit,

If you can, place a SPI protocol analyzer on the bus and trace its transactions.

I recently debugged a similar symptom and discovered that I was not driving
the Tx FIFO consistently enough to maintain the appearance of a single
transaction on the ID request to the flash.

How is your SPI device (flash, right?) being selected?  If via a GPIO, are you
sure you are driving it properly?  If it is directly using a
controller's slave-select
line, you may need to ensure a full Tx FIFO for both the write and response.

HTH,
jdl


On Sat, May 24, 2014 at 12:15 PM, Jagan Teki jagannadh.t...@gmail.com wrote:
 On Sat, May 24, 2014 at 10:27 PM, Amit Mahadik amitmahadi...@yahoo.com 
 wrote:
 Hello All,
 I am using a custom ARM based development board running 
 u-boot from PNOR memory. However, it does not have support for the Micron 
 SPI flash memory (N25Q064A). I have added support for the micron memory in 
 drivers/mtd/spi/stmicro.c file and included the flag 
 CONFIG_SPI_FLASH_STMICRO in the config file and recompiled the u-boot source 
 source. Then, ran it directly through RAM memory.
 The new u-boot ran from RAM. Now when I run sf probe 0 command I get the 
 following output
 Got Idcodes 00: 00 00 00 00  and the code hangs after this.

 Looks like your driver itself is not returning any proper idcode.

 What id details you added - I think you're using old u-boot no stmicro.c
 in current u-boot, please re-base to master and try.

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


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

2014-05-24 Thread Tom Rini
On Sat, May 24, 2014 at 11:32:00AM +0200, Albert ARIBAUD wrote:

 Hello Tom (and sorry for the duplicate),
 
 The following changes since commit
 10dc77716f41979e03baf3b847b97dc7279ef30d:
 
   esdhc/usdhc: Fix warning when CONFIG_SYS_FSL_ESDHC_USE_PIO is not set
   (2014-05-23 09:19:05 -0400)
 
 are available in the git repository at:
 
   git://git.denx.de/u-boot-arm master
 
 for you to fetch changes up to 33144ea443c298ac9d6f04926a02881a5bae91a3:
 
   Merge branch 'u-boot-ti/master' into 'u-boot-arm/master' (2014-05-24
   09:50:00 +0200)
 
 
 
 Albert ARIBAUD (3):
   Merge branch 'u-boot-microblaze/zynq' into 'u-boot-arm/master'
   Merge branch 'u-boot-sh/rmobile' into 'u-boot-arm/master'
   Merge branch 'u-boot-ti/master' into 'u-boot-arm/master'
 
 Ash Charles (9):
   omap: overo: allow the use of a plain text env file instead boot
 scripts OMAP3: overo: add command support for mtd and ubi
   OMAP3: overo: eliminate hard-coded partition offsets
   arm: omap3: Fix omap3_overo SPL boot hangup
   Add Board Revision for Wireless chip
   OMAP3: overo: add some Gumstix expansion boards
   Allow overo to boot with device tree
   omap3: overo: Use common configurations for Overo
   omap4: duovero: Add Gumstix DuoVero machine.
 
 Dmitry Lifshitz (3):
   cm-t54: add cm-t54 board support
   cm-t54: add EEPROM support and MAC address handling
   cm-t54: add environment partition runtime detection
 
 Heiko Schocher (1):
   arm, am33xx: Enable CONFIG_SYS_GENERIC_BOARD for siemens boards
 
 Igor Grinberg (1):
   compulab: eeprom: add default eeprom address
 
 Ilya Ledvich (1):
   compulab: eeprom: enable any i2c driver
 
 Keerthy (1):
   ARM: DRA72x: volt: Update the pmic offsets
 
 Lokesh Vutla (5):
   ARM: DRA72x: Add Silicon ID support
   ARM: DRA72x: clocks: Update the hwdata
   ARM: DRA72x: Update EMIF data
   ARM: DRA7xx: ctrl: Fix efuse register addresses
   ARM: OMAP: Fix omap_sdram_size calculation
 
 Masahiro Yamada (7):
   zynq: add empty xil_io.h to avoid compile error
   zynq: treat ps7_init.c/h as external files to ignore them
   build: support a new image u-boot-dtb.img
   zynq: load u-boot-dtb.img if CONFIG_OF_SEPARATE is defined
   zynq: import zynq-7000.dtsi from Linux Kernel
   zynq: add memory nodes to device tree to initialize DRAM with OF
   zynq: add UART nodes to device tree to initialize UART with OF
 
 Michal Simek (12):
   ARM: zynq: Fix sparse warnings in slcr.c
   ARM: zynq: Fix sparse warning in ddrc.c
   ARM: zynq: Remove sparse warnings
   ARM: zynq: Do not use half memory size for ECC case
   ARM: zynq: Call zynq board_init() in SPL
   ARM: zynq: slcr: Fix incorrect commentary
   ARM: zynq: Setup correct slcr_lock value
   ARM: zynq: Fix building SPL without FPGA support
   ARM: zynq: Extend kernel image size to 60MB
   ARM: zynq: Add MIO detection code
   ARM: zynq: ehci: Added USB host driver support
   ARM: zynq: Extend maximum number of command arguments
 
 Mike Looijmans (1):
   ARM: zynq: Fix bootmode mask
 
 Nobuhiro Iwamatsu (20):
   arm: rmobile: Add define of SCIF register for R8A7790 and R8A7791
   arm: rmobile: koelsch: Remove define of SCIF register
   arm: rmobile: koelsch: Remove CONFIG_USE_ARCH_MEMSET and MEMCPY
   arm: rmobile: koelsch: Enable optimization of thumb
   arm: rmobile: lager: Remove define of SCIF register
   arm: rmobile: lager: Remove CONFIG_USE_ARCH_MEMSET and MEMCPY
   arm: rmobile: lager: Enable optimization of thumb
   gpio: r8a7791-gpio: Fix typo in macro
   gpio: r8a7790-gpio: Fix typo in macro
   arm: rmobile: koelsch: Add support USB controller
   arm: rmobile: koelsch: Add support command and filesystems of VFAT
   arm: rmobile: lager: Add support USB controller
   arm: rmobile: lager: Add support command and filesystems of VFAT
   arm: rmobile: lager: Add support ext4/fat write command
   arm: rmobile: koelsch: Add support ext4/fat write command
   arm: rmobile: r8a7791: Fix MOD_SEL3 function table about
 FN_SEL_IEB arm: rmobile: koelsch: Fix QoS revision 0.240 and 0.320
   arm: rmobile: armadillo800eva: Enable CONFIG_SYS_GENERIC_BOARD
   arm: rmobile: koelsch: Enable CONFIG_SYS_GENERIC_BOARD
   arm: rmobile: lager: Enable CONFIG_SYS_GENERIC_BOARD
 
 Peter A. Bigot (1):
   OMAP3: overo: increase linux partition to 8 MiB
 
 Sergey Alyoshin (1):
   am33xx: report silicon revision instead of code
 
 Siva Durga Prasad Paladugu (5):
   ARM: zynq: Added efuse status register base address
   ARM: zynq: Added USB host support for zynq boards
   ARM: zynq: Enable the FAT write capability
   ARM: zynq: Move USB/SD/MMC common FAT configs
   ARM: zynq: Enable EXT4 configs
 
 Tom Rini (1):
   armv7:TI: Add 

Re: [U-Boot] idirafter causes host sha256.h to be included

2014-05-24 Thread Jeroen Hofstee
Hello Simon,

On vr, 2014-05-23 at 15:37 -1000, Simon Glass wrote:

 On 9 May 2014 12:31, Jeroen Hofstee dasub...@myspectrum.nl wrote:
  Hello,
 
  tools/Makefile uses the following substitution
 
  HOST_EXTRACFLAGS += -include $(srctree)/include/libfdt_env.h \
  $(patsubst -I%,-idirafter%, $(UBOOTINCLUDE)) \
  ...
 
  Which adds -idirafterinclude when compiling image-fit.c. Since
  mentioned file includes sha256.h, which is a system include on FreeBSD,
  the system version is included instead of the intended U-boot
  include/sha256.h and building fails. Without the substitution it builds
  successfully.
 
  What is the intention of using idirafter?
 
 I believe this is so that U-Boot headers are available when building.
 You might need to add a work-around like we have for libfdt_env.h. It
 is also possible that there is a more general solution, sorry I'm not
 sure what it might be.
 

Thanks for mentioning the libfdt_env.h. As mentioned in the thread
discussing the patch errno.h is one of the reasons to require the
dirafter, since the tools need the host version of it. A possible
solution could perhaps be to place such standard headers in a separate
directory and only include it for an u-boot build. The tools can then be
compiled without the idirafter and not including this location as an
include path.

Regards,
Jeroen

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


[U-Boot] [RFC PATCH 0/22] Introduce driver model serial uclass

2014-05-24 Thread Simon Glass
This series adds support for a serial uclass, enabling serial drivers to be
converted to use driver model.

Unfortunately this is quite a complicated process for a number of reasons:

- serial is used before relocation, but driver model does not support this
- stdio member functions are not passed a device pointer, but driver model
requires this (so does serial, but it uses an ugly work-around)
- driver model requires malloc() but this is not available before
  relocation
- for sandbox, if something goes wrong with the console, we still need to
  get an error message out through the fallback console

So this series includes quite a few patches to address the above, as well
as the serial uclass and an implementation for sandbox.

The early malloc() implementation uses a very simple region of memory which
it doles out as needed. This means that driver model can start up with very
little memory usage, and no overhead for malloc() itself except for space
wasted due to alignment. With a 32-bit machine and just a serial port set
as a pre-reloc device (plus the mandatory root device), the usage is 176
bytes.

If you have limited time, please take a look at least at the uclass patch
which is 'dm: Add a uclass for serial devices' (see include/serial.h).

The series is based on the Tegra GPIO series v3. You can get this tree in
a rough unfinished form from u-boot-x86.git branch us-gpioe.

Note: This series is for comments only as there are some build errors for
certain boards.


Simon Glass (22):
  stdio: Remove redundant code around stdio_register() calls
  stdio: Pass device pointer to stdio methods
  dm: Make sure that the root device is probed
  dm: Provide a way to shut down driver model
  sandbox: Remove all drivers before exit
  dm: Tidy up four minor code nits
  dm: Allow drivers to be marked 'before relocation'
  dm: Use '*' to indicate a device is activated
  Remove form-feeds from dlmalloc.c
  Add a simple malloc() implementation for pre-relocation
  sandbox: config: Enable pre-relocation malloc()
  dm: Support driver model prior to relocation
  stdio: Provide functions to add/remove devices using stdio_dev
  console: Remove vprintf() optimisation for sandbox
  Add a flag indicating when the serial console is ready
  dm: Add a way to indicate a preferred device within a uclass
  dm: Expand and improve the device lifecycle docs
  dm: Add a uclass for serial devices
  Set up stdio earlier when using driver model
  sandbox: Convert serial driver to use driver model
  sandbox: serial: Support a coloured console
  sandbox: dts: Add a serial console node

 README|  16 +++
 arch/blackfin/cpu/jtag-console.c  |  10 +-
 arch/powerpc/cpu/mpc512x/serial.c |  10 +-
 arch/powerpc/cpu/mpc8xx/video.c   |   6 +-
 arch/sandbox/cpu/cpu.c|   4 +
 arch/sandbox/dts/sandbox.dts  |  11 ++
 arch/x86/lib/video.c  |   8 +-
 board/bf527-ezkit/video.c |  10 --
 board/bf548-ezkit/video.c |  10 --
 board/cm-bf548/video.c|  10 --
 board/mpl/common/kbd.c|   6 +-
 board/mpl/common/kbd.h|   6 +-
 board/mpl/pati/pati.c |   8 +-
 board/netphone/phone_console.c|  16 +--
 board/nokia/rx51/rx51.c   |   6 +-
 board/rbc823/kbd.c|   8 +-
 common/board_f.c  |  42 
 common/board_r.c  |  28 +++--
 common/cmd_log.c  |  11 +-
 common/console.c  |  24 ++---
 common/dlmalloc.c |  81 ++
 common/lcd.c  |  14 ++-
 common/stdio.c|  63 ---
 common/usb_kbd.c  |   6 +-
 doc/driver-model/README.txt   | 220 +++---
 drivers/core/device.c |  11 +-
 drivers/core/lists.c  |   6 +-
 drivers/core/root.c   |  22 +++-
 drivers/core/uclass.c |  15 ++-
 drivers/input/cros_ec_keyb.c  |   6 +-
 drivers/input/i8042.c |   4 +-
 drivers/input/keyboard.c  |   6 +-
 drivers/input/tegra-kbc.c |   6 +-
 drivers/misc/cbmem_console.c  |   6 +-
 drivers/net/netconsole.c  |  10 +-
 drivers/serial/Makefile   |   4 +
 drivers/serial/sandbox.c  | 140 +++-
 drivers/serial/serial-uclass.c| 161 
 drivers/serial/serial.c   |  55 --
 drivers/serial/usbtty.c   |   8 +-
 drivers/video/cfb_console.c   |   8 +-
 include/asm-generic/global_data.h |   7 ++
 include/common.h  |   5 +
 include/configs/ELPPC.h   |   4 +-
 include/configs/MHPC.h|   4 +-
 include/configs/jadecpu.h |   4 +-
 include/configs/nokia_rx51.h  |   5 +-
 include/configs/sandbox.h |   7 ++
 include/dm/device-internal.h  |   6 +-
 include/dm/device.h   |  10 +-
 include/dm/lists.h|  22 +++-
 include/dm/root.h  

[U-Boot] [RFC PATCH 04/22] dm: Provide a way to shut down driver model

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

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

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

diff --git a/drivers/core/root.c b/drivers/core/root.c
index 9fff164..4873e7b 100644
--- a/drivers/core/root.c
+++ b/drivers/core/root.c
@@ -55,6 +55,14 @@ int dm_init(void)
return 0;
 }
 
+int dm_uninit(void)
+{
+   device_remove(dm_root());
+   device_unbind(dm_root());
+
+   return 0;
+}
+
 int dm_scan_platdata(void)
 {
int ret;
diff --git a/include/dm/root.h b/include/dm/root.h
index 0ebccda..069d058 100644
--- a/include/dm/root.h
+++ b/include/dm/root.h
@@ -50,4 +50,12 @@ int dm_scan_fdt(const void *blob);
  */
 int dm_init(void);
 
+/**
+ * dm_uninit - Uninitialise Driver Model structures
+ *
+ * All devices will be removed and unbound
+ * @return 0 if OK, -ve on error
+ */
+int dm_uninit(void);
+
 #endif
-- 
1.9.1.423.g4596e3a

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


[U-Boot] [RFC PATCH 06/22] dm: Tidy up four minor code nits

2014-05-24 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
---

 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 4cd38ed..b048b66 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 device - An instance of a driver
diff --git a/include/dm/lists.h b/include/dm/lists.h
index 0d09f9a..d0b720b 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 device *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 device *parent, const void *blob, int offset);
 
 #endif
diff --git a/include/dm/root.h b/include/dm/root.h
index 069d058..1631d5d 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 cd23cfe..ac5c147 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 device **ucp);
+int uclass_get_device(enum uclass_id id, int index, struct device **devp);
 
 /**
  * uclass_first_device() - Get the first device in a uclass
-- 
1.9.1.423.g4596e3a

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


[U-Boot] [RFC PATCH 09/22] Remove form-feeds from dlmalloc.c

2014-05-24 Thread Simon Glass
These don't really server any purpose in the modern age, IMO. On the
other hand they show up as annoying control characters in my editor, which
then happily removes them.

I believe we can drop these characters from the file.

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

 common/dlmalloc.c | 46 +++---
 1 file changed, 23 insertions(+), 23 deletions(-)

diff --git a/common/dlmalloc.c b/common/dlmalloc.c
index 3c70d5d..d1cd561 100644
--- a/common/dlmalloc.c
+++ b/common/dlmalloc.c
@@ -220,7 +220,7 @@
 
 */
 
-
+
 
 /* Preliminaries */
 
@@ -1132,7 +1132,7 @@ gAllocatedSize))
 
 #endif
 
-
+
 
 /*
   Type declarations
@@ -1272,7 +1272,7 @@ nextchunk- 
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
serviced via calls to mmap, and then later released via munmap.
 
 */
-
+
 /*  sizes, alignments */
 
 #define SIZE_SZ(sizeof(INTERNAL_SIZE_T))
@@ -1297,7 +1297,7 @@ nextchunk- 
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 #define aligned_OK(m)(((unsigned long)((m))  (MALLOC_ALIGN_MASK)) == 0)
 
 
-
+
 
 /*
   Physical chunk operations
@@ -1332,7 +1332,7 @@ nextchunk- 
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 #define chunk_at_offset(p, s)  ((mchunkptr)(((char*)(p)) + (s)))
 
 
-
+
 
 /*
   Dealing with use bits
@@ -1371,7 +1371,7 @@ nextchunk- 
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  (((mchunkptr)(((char*)(p)) + (s)))-size = ~(PREV_INUSE))
 
 
-
+
 
 /*
   Dealing with size fields
@@ -1394,7 +1394,7 @@ nextchunk- 
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 #define set_foot(p, s)   (((mchunkptr)((char*)(p) + (s)))-prev_size = (s))
 
 
-
+
 
 
 /*
@@ -1566,7 +1566,7 @@ void mem_malloc_init(ulong start, ulong size)
 
 #define is_small_request(nb) (nb  MAX_SMALLBIN_SIZE - SMALLBIN_WIDTH)
 
-
+
 
 /*
 To help compensate for the large number of bins, a one-level index
@@ -1590,7 +1590,7 @@ void mem_malloc_init(ulong start, ulong size)
 #define clear_binblock(ii)  (binblocks_w = (mbinptr)(binblocks_r  
~(idx2binblock(ii
 
 
-
+
 
 
 /*  Other static bookkeeping data */
@@ -1628,7 +1628,7 @@ static unsigned int max_n_mmaps = 0;
 static unsigned long max_mmapped_mem = 0;
 #endif
 
-
+
 
 /*
   Debugging support
@@ -1769,7 +1769,7 @@ static void do_check_malloced_chunk(p, s) mchunkptr p; 
INTERNAL_SIZE_T s;
 #define check_malloced_chunk(P,N)
 #endif
 
-
+
 
 /*
   Macro-based internal utilities
@@ -1841,7 +1841,7 @@ static void do_check_malloced_chunk(p, s) mchunkptr p; 
INTERNAL_SIZE_T s;
   (last_remainder-fd = last_remainder-bk = last_remainder)
 
 
-
+
 
 
 /* Routines dealing with mmap(). */
@@ -1972,7 +1972,7 @@ static mchunkptr mremap_chunk(p, new_size) mchunkptr p; 
size_t new_size;
 #endif /* HAVE_MMAP */
 
 
-
+
 
 /*
   Extend the top-most chunk by obtaining memory from system.
@@ -2089,7 +2089,7 @@ static void malloc_extend_top(nb) INTERNAL_SIZE_T nb;
 }
 
 
-
+
 
 /* Main public routines */
 
@@ -2396,7 +2396,7 @@ Void_t* mALLOc(bytes) size_t bytes;
 }
 
 
-
+
 
 /*
 
@@ -2513,7 +2513,7 @@ void fREe(mem) Void_t* mem;
 }
 
 
-
+
 
 
 /*
@@ -2750,7 +2750,7 @@ Void_t* rEALLOc(oldmem, bytes) Void_t* oldmem; size_t 
bytes;
 }
 
 
-
+
 
 /*
 
@@ -2868,7 +2868,7 @@ Void_t* mEMALIGn(alignment, bytes) size_t alignment; 
size_t bytes;
 
 }
 
-
+
 
 
 /*
@@ -2975,7 +2975,7 @@ void cfree(mem) Void_t *mem;
 }
 #endif
 
-
+
 
 /*
 
@@ -3056,7 +3056,7 @@ int malloc_trim(pad) size_t pad;
   }
 }
 
-
+
 
 /*
   malloc_usable_size:
@@ -3092,7 +3092,7 @@ size_t malloc_usable_size(mem) Void_t* mem;
 }
 
 
-
+
 
 /* Utility to update current_mallinfo for malloc_stats and mallinfo() */
 
@@ -3136,7 +3136,7 @@ static void malloc_update_mallinfo()
 }
 #endif /* DEBUG */
 
-
+
 
 /*
 
@@ -3183,7 +3183,7 @@ struct mallinfo mALLINFo()
 #endif /* DEBUG */
 
 
-
+
 
 /*
   mallopt:
-- 
1.9.1.423.g4596e3a

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


[U-Boot] [RFC PATCH 17/22] dm: Expand and improve the device lifecycle docs

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

Thanks for Jon Loeliger j...@jdl.com for helping with the text and
suggesting improvements.

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

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

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

 doc/driver-model/README.txt | 197 ++--
 1 file changed, 191 insertions(+), 6 deletions(-)

diff --git a/doc/driver-model/README.txt b/doc/driver-model/README.txt
index deacfe9..90e0516 100644
--- a/doc/driver-model/README.txt
+++ b/doc/driver-model/README.txt
@@ -95,11 +95,12 @@ are provided in test/dm. To run them, try:
 You should see something like this:
 
 ...U-Boot banner...
-Running 12 driver model tests
+Running 15 driver model tests
 Test: dm_test_autobind
 Test: dm_test_autoprobe
 Test: dm_test_children
 Test: dm_test_fdt
+Test: dm_test_fdt_pre_reloc
 Test: dm_test_gpio
 sandbox_gpio: sb_gpio_get_value: error: offset 4 not reserved
 Test: dm_test_leak
@@ -109,6 +110,8 @@ You should see something like this:
 Test: dm_test_operations
 Test: dm_test_ordering
 Test: dm_test_platdata
+Test: dm_test_pre_reloc
+Test: dm_test_prefer
 Test: dm_test_remove
 Test: dm_test_uclass
 Failures: 0
@@ -222,6 +225,40 @@ device tree) and probe.
 Platform Data
 -
 
+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
+   - Note this can be parsed from the Device Tree (see below)
+
 Where does the platform data come from? 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
@@ -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. The 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.
+method (which the driver writer supplies) should read the information out
+of the device tree and puts 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 

[U-Boot] [RFC PATCH 08/22] dm: Use '*' to indicate a device is activated

2014-05-24 Thread Simon Glass
Make both dm enumeration commands support showing whether a driver is active
or not, and use a consistent indicator (an asterisk).

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

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

diff --git a/test/dm/cmd_dm.c b/test/dm/cmd_dm.c
index c6b2eb8..ee02314 100644
--- a/test/dm/cmd_dm.c
+++ b/test/dm/cmd_dm.c
@@ -23,9 +23,9 @@ static int display_succ(struct device *in, char *buf)
char local[16];
struct device *pos, *n, *prev = NULL;
 
-   printf(%s- %s @ %08x, buf, in-name, (uint)map_to_sysmem(in));
-   if (in-flags  DM_FLAG_ACTIVATED)
-   puts( - activated);
+   printf(%s- %c %s @ %08x, buf,
+  in-flags  DM_FLAG_ACTIVATED ? '*' : ' ',
+  in-name, (uint)map_to_sysmem(in));
puts(\n);
 
if (list_empty(in-child_head))
@@ -84,8 +84,9 @@ 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,
-  (uint)map_to_sysmem(dev));
+   printf(  %c %s @ %08x:\n,
+  dev-flags  DM_FLAG_ACTIVATED ? '*' : ' ',
+  dev-name, (uint)map_to_sysmem(dev));
}
puts(\n);
}
-- 
1.9.1.423.g4596e3a

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


[U-Boot] [RFC PATCH 22/22] sandbox: dts: Add a serial console node

2014-05-24 Thread Simon Glass
If the sandbox device tree is provided to U-Boot (with the -d flag) then it
will use the device tree version in preference to the built-in device. The
only difference is the colour.

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

 arch/sandbox/dts/sandbox.dts | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/arch/sandbox/dts/sandbox.dts b/arch/sandbox/dts/sandbox.dts
index 62d8037..98008de 100644
--- a/arch/sandbox/dts/sandbox.dts
+++ b/arch/sandbox/dts/sandbox.dts
@@ -1,6 +1,17 @@
 /dts-v1/;
 
 / {
+   alias {
+   console = uart0;
+   };
+
+   uart0: serial {
+   compatible = sandbox,serial;
+   dm,pre-reloc;
+   dm,prefer;
+   text-colour = cyan;
+   };
+
triangle {
compatible = demo-shape;
colour = cyan;
-- 
1.9.1.423.g4596e3a

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


[U-Boot] [RFC PATCH 05/22] sandbox: Remove all drivers before exit

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

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

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

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

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

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


[U-Boot] [RFC PATCH 19/22] Set up stdio earlier when using driver model

2014-05-24 Thread Simon Glass
Since driver model registers itself with the stdio subsystem, and we
want to avoid delayed registration and other complexity associated with
the current serial console, move the stdio subsystem init earlier when
driver model is used for serial.

This simplifies the implementation. Should there be any problems with
this approach they can be dealt with as boards are converted over to
use driver model for serial.

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

 common/board_r.c | 17 +++--
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/common/board_r.c b/common/board_r.c
index 13c1bc1..b883d36 100644
--- a/common/board_r.c
+++ b/common/board_r.c
@@ -760,6 +760,15 @@ init_fnc_t init_sequence_r[] = {
set_cpu_clk_info, /* Setup clock information */
 #endif
initr_reloc_global_data,
+   initr_barrier,
+   initr_malloc,
+   bootstage_relocate,
+#ifdef CONFIG_DM_SERIAL
+   stdio_init,
+#endif
+#ifdef CONFIG_DM
+   initr_dm,
+#endif
initr_serial,
initr_announce,
INIT_FUNC_WATCHDOG_RESET
@@ -796,12 +805,6 @@ init_fnc_t init_sequence_r[] = {
 #ifdef CONFIG_WINBOND_83C553
initr_w83c553f,
 #endif
-   initr_barrier,
-   initr_malloc,
-   bootstage_relocate,
-#ifdef CONFIG_DM
-   initr_dm,
-#endif
 #ifdef CONFIG_ARCH_EARLY_INIT_R
arch_early_init_r,
 #endif
@@ -851,7 +854,9 @@ init_fnc_t init_sequence_r[] = {
 */
initr_pci,
 #endif
+#ifndef CONFIG_DM_SERIAL
stdio_init,
+#endif
initr_jumptable,
 #ifdef CONFIG_API
initr_api,
-- 
1.9.1.423.g4596e3a

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


[U-Boot] [RFC PATCH 10/22] Add a simple malloc() implementation for pre-relocation

2014-05-24 Thread Simon Glass
If we are to have driver model before relocation we need to support some
way of calling memory allocation routines.

The standard malloc() is pretty complicated:

1. It uses some BSS memory for its state, and BSS is not available before
relocation

2. It supports algorithms for reducing memory fragmentation and improving
performace of free(). Before relocation we could happily just not support
free().

3. It includes about 4KB of code (Thumb 2) and 1KB of data. However since
this has been loaded anyway this is not really a problem.

The simplest way to support pre-relocation malloc() is to reserve an area
of memory and allocate it in increasing blocks as needed. This
implementation does this.

To enable it, you need to define the address and size of the malloc() pool
as described in the README.

Note that this implementation is only useful on machines which have some
memory available before dram_init() is called - this includes those that
do no DRAM init (like tegra) and those that do it in SPL (quite a few
boards). Enabling driver model preior to relocation for the rest of the
boards is left for a later exercise.

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

 README| 16 
 common/board_f.c  | 12 
 common/board_r.c  |  4 
 common/dlmalloc.c | 35 +++
 include/asm-generic/global_data.h |  5 +
 5 files changed, 72 insertions(+)

diff --git a/README b/README
index 3c93d05..23ec935 100644
--- a/README
+++ b/README
@@ -3703,6 +3703,22 @@ Configuration Settings:
 - CONFIG_SYS_MALLOC_LEN:
Size of DRAM reserved for malloc() use.
 
+- CONFIG_SYS_MALLOC_F_BASE
+- CONFIG_SYS_MALLOC_F_LEN
+   Address and size of the malloc() pool for use before
+   relocation. If these are defined, then a very simple
+   malloc() implementation will become available before
+   relocation. It allocates regions with increasing addresses
+   within the region. calloc() is supported, but realloc()
+   is not available. free() is supported but does nothing.
+   The memory will be free (or in fact just forgotton) when
+   U-Boot relocates itself.
+
+   You should select an address which is available before
+   relocation. This might be on-chip SRAM. Be careful to avoid
+   collision between this region and the stack, which
+   typically grows downwards.
+
 - CONFIG_SYS_BOOTM_LEN:
Normally compressed uImages are limited to an
uncompressed size of 8 MBytes. If this is not enough,
diff --git a/common/board_f.c b/common/board_f.c
index 4ea4cb2..cc040c7 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -776,6 +776,17 @@ static int mark_bootstage(void)
return 0;
 }
 
+static int initf_malloc(void)
+{
+#ifdef CONFIG_SYS_MALLOC_F_BASE
+   gd-malloc_base = CONFIG_SYS_MALLOC_F_BASE;
+   gd-malloc_limit = CONFIG_SYS_MALLOC_F_BASE + CONFIG_SYS_MALLOC_F_LEN;
+   gd-malloc_ptr = 0;
+#endif
+
+   return 0;
+}
+
 static init_fnc_t init_sequence_f[] = {
 #ifdef CONFIG_SANDBOX
setup_ram_buf,
@@ -833,6 +844,7 @@ static init_fnc_t init_sequence_f[] = {
sdram_adjust_866,
init_timebase,
 #endif
+   initf_malloc,
init_baud_rate, /* initialze baudrate settings */
serial_init,/* serial communications setup */
console_init_f, /* stage 1 init of console */
diff --git a/common/board_r.c b/common/board_r.c
index d2a59ee..e16f3ad 100644
--- a/common/board_r.c
+++ b/common/board_r.c
@@ -259,6 +259,10 @@ static int initr_malloc(void)
 {
ulong malloc_start;
 
+#ifdef CONFIG_SYS_MALLOC_F_BASE
+   debug(Pre-reloc malloc() used %#lx bytes (%ld KB)\n, gd-malloc_ptr,
+ gd-malloc_ptr / 1024);
+#endif
/* The malloc area is immediately below the monitor copy in DRAM */
malloc_start = gd-relocaddr - TOTAL_MALLOC_LEN;
mem_malloc_init((ulong)map_sysmem(malloc_start, TOTAL_MALLOC_LEN),
diff --git a/common/dlmalloc.c b/common/dlmalloc.c
index d1cd561..16d85c2 100644
--- a/common/dlmalloc.c
+++ b/common/dlmalloc.c
@@ -930,6 +930,8 @@ struct mallinfo mALLINFo();
 #endif /* 0 */ /* Moved to malloc.h */
 
 #include malloc.h
+#include asm/io.h
+
 #ifdef DEBUG
 #if __STD_C
 static void malloc_update_mallinfo (void);
@@ -2174,6 +2176,20 @@ Void_t* mALLOc(bytes) size_t bytes;
 
   INTERNAL_SIZE_T nb;
 
+#ifdef CONFIG_SYS_MALLOC_F_BASE
+   if (!(gd-flags  GD_FLG_RELOC)) {
+   ulong new_ptr;
+   void *ptr;
+
+   new_ptr = gd-malloc_ptr + bytes;
+   if (new_ptr  gd-malloc_limit)
+   panic(Out of pre-reloc memory);
+   ptr = map_sysmem(gd-malloc_base + gd-malloc_ptr, bytes);
+   gd-malloc_ptr = 

[U-Boot] [RFC PATCH 14/22] console: Remove vprintf() optimisation for sandbox

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

Remove the optimisation for sandbox.

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

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

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

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


[U-Boot] [RFC PATCH 12/22] dm: Support driver model prior to relocation

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

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

 common/board_f.c  | 30 ++
 common/board_r.c  |  3 +++
 include/asm-generic/global_data.h |  1 +
 3 files changed, 34 insertions(+)

diff --git a/common/board_f.c b/common/board_f.c
index cc040c7..0dc745a 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -14,6 +14,7 @@
 #include linux/compiler.h
 #include version.h
 #include environment.h
+#include dm.h
 #include fdtdec.h
 #include fs.h
 #if defined(CONFIG_CMD_IDE)
@@ -52,6 +53,7 @@
 #ifdef CONFIG_SANDBOX
 #include asm/state.h
 #endif
+#include dm/root.h
 #include linux/compiler.h
 
 /*
@@ -787,6 +789,33 @@ static int initf_malloc(void)
return 0;
 }
 
+static int initf_dm(void)
+{
+#if defined(CONFIG_DM)  defined(CONFIG_SYS_MALLOC_F_BASE)
+   int ret;
+
+   ret = dm_init();
+   if (ret) {
+   debug(dm_init() failed: %d\n, ret);
+   return ret;
+   }
+   ret = dm_scan_platdata(true);
+   if (ret) {
+   debug(dm_scan_platdata() failed: %d\n, ret);
+   return ret;
+   }
+#ifdef CONFIG_OF_CONTROL
+   ret = dm_scan_fdt(gd-fdt_blob, true);
+   if (ret) {
+   debug(dm_scan_fdt() failed: %d\n, ret);
+   return ret;
+   }
+#endif
+#endif
+
+   return 0;
+}
+
 static init_fnc_t init_sequence_f[] = {
 #ifdef CONFIG_SANDBOX
setup_ram_buf,
@@ -845,6 +874,7 @@ static init_fnc_t init_sequence_f[] = {
init_timebase,
 #endif
initf_malloc,
+   initf_dm,
init_baud_rate, /* initialze baudrate settings */
serial_init,/* serial communications setup */
console_init_f, /* stage 1 init of console */
diff --git a/common/board_r.c b/common/board_r.c
index e16f3ad..13c1bc1 100644
--- a/common/board_r.c
+++ b/common/board_r.c
@@ -275,6 +275,9 @@ static int initr_dm(void)
 {
int ret;
 
+   /* Save the pre-reloc driver model and start a new one */
+   gd-dm_root_f = gd-dm_root;
+   gd-dm_root = NULL;
ret = dm_init();
if (ret) {
debug(dm_init() failed: %d\n, ret);
diff --git a/include/asm-generic/global_data.h 
b/include/asm-generic/global_data.h
index 1070a75..b3b91d3 100644
--- a/include/asm-generic/global_data.h
+++ b/include/asm-generic/global_data.h
@@ -66,6 +66,7 @@ typedef struct global_data {
 
 #ifdef CONFIG_DM
struct device   *dm_root;   /* Root instance for Driver Model */
+   struct device   *dm_root_f; /* Pre-relocation root instance */
struct list_head uclass_root;   /* Head of core tree */
 #endif
 
-- 
1.9.1.423.g4596e3a

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


[U-Boot] [RFC PATCH 18/22] dm: Add a uclass for serial devices

2014-05-24 Thread Simon Glass
Serial devices support simple byte input/output and a few operations to find
out whether data is available. Add a basic uclass for serial devices to be
used by drivers that are converted to driver model.

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

 drivers/serial/Makefile|   4 +
 drivers/serial/serial-uclass.c | 161 +
 include/dm/uclass-id.h |   1 +
 include/serial.h   |  90 +++
 4 files changed, 256 insertions(+)
 create mode 100644 drivers/serial/serial-uclass.c

diff --git a/drivers/serial/Makefile b/drivers/serial/Makefile
index 571c18f..4720e1d 100644
--- a/drivers/serial/Makefile
+++ b/drivers/serial/Makefile
@@ -5,7 +5,11 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
+ifdef CONFIG_DM_SERIAL
+obj-y += serial-uclass.o
+else
 obj-y += serial.o
+endif
 
 obj-$(CONFIG_ALTERA_UART) += altera_uart.o
 obj-$(CONFIG_ALTERA_JTAG_UART) += altera_jtag_uart.o
diff --git a/drivers/serial/serial-uclass.c b/drivers/serial/serial-uclass.c
new file mode 100644
index 000..22bb1ef
--- /dev/null
+++ b/drivers/serial/serial-uclass.c
@@ -0,0 +1,161 @@
+/*
+ * Copyright (c) 2014 The Chromium OS Authors.
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#include common.h
+#include dm.h
+#include errno.h
+#include os.h
+#include serial.h
+#include stdio_dev.h
+
+DECLARE_GLOBAL_DATA_PTR;
+
+/* The currently selected console serial device */
+struct device *cur_dev __attribute__ ((section(.data)));
+
+/* Called prior to relocation */
+int serial_init(void)
+{
+   if (uclass_get_preferred_device(UCLASS_SERIAL, cur_dev))
+   panic(No serial driver found);
+   gd-flags |= GD_FLG_SERIAL_READY;
+
+   return 0;
+}
+
+/* Called after relocation */
+void serial_initialize(void)
+{
+   if (uclass_get_preferred_device(UCLASS_SERIAL, cur_dev))
+   panic(No serial driver found);
+}
+
+void serial_putc(char ch)
+{
+   struct dm_serial_ops *ops = serial_get_ops(cur_dev);
+
+   ops-putc(cur_dev, ch);
+}
+
+void serial_setbrg(void)
+{
+   struct dm_serial_ops *ops = serial_get_ops(cur_dev);
+
+   if (ops-setbrg)
+   ops-setbrg(cur_dev, gd-baudrate);
+}
+
+void serial_puts(const char *str)
+{
+   while (*str)
+   serial_putc(*str++);
+}
+
+int serial_tstc(void)
+{
+   struct dm_serial_ops *ops = serial_get_ops(cur_dev);
+
+   if (ops-pending)
+   return ops-pending(cur_dev, true);
+
+   return 1;
+}
+
+int serial_getc(void)
+{
+   struct dm_serial_ops *ops = serial_get_ops(cur_dev);
+   int err;
+
+   do {
+   err = ops-getc(cur_dev);
+   } while (err == -EAGAIN);
+
+   return err = 0 ? err : 0;
+}
+
+void serial_stdio_init(void)
+{
+}
+
+void serial_stub_putc(struct stdio_dev *sdev, const char ch)
+{
+   struct device *dev = sdev-priv;
+   struct dm_serial_ops *ops = serial_get_ops(dev);
+
+   ops-putc(dev, ch);
+}
+
+void serial_stub_puts(struct stdio_dev *sdev, const char *str)
+{
+   while (*str)
+   serial_stub_putc(sdev, *str++);
+}
+
+int serial_stub_getc(struct stdio_dev *sdev)
+{
+   struct device *dev = sdev-priv;
+   struct dm_serial_ops *ops = serial_get_ops(dev);
+
+   int err;
+
+   do {
+   err = ops-getc(dev);
+   } while (err == -EAGAIN);
+
+   return err = 0 ? err : 0;
+}
+
+int serial_stub_tstc(struct stdio_dev *sdev)
+{
+   struct device *dev = sdev-priv;
+   struct dm_serial_ops *ops = serial_get_ops(dev);
+
+   if (ops-pending)
+   return ops-pending(dev, true);
+
+   return 1;
+}
+
+static int serial_post_probe(struct device *dev)
+{
+   struct stdio_dev sdev, *new_sdev;
+
+   if (!(gd-flags  GD_FLG_RELOC))
+   return 0;
+
+   memset(sdev, 0, sizeof(dev));
+
+   strncpy(sdev.name, dev-name, sizeof(sdev.name));
+   sdev.flags = DEV_FLAGS_OUTPUT | DEV_FLAGS_INPUT;
+   sdev.priv = dev;
+   sdev.putc = serial_stub_putc;
+   sdev.puts = serial_stub_puts;
+   sdev.getc = serial_stub_getc;
+   sdev.tstc = serial_stub_tstc;
+   stdio_register_dev(sdev, new_sdev);
+   dev-uclass_priv = new_sdev;
+
+   return 0;
+}
+
+static int serial_pre_remove(struct device *dev)
+{
+#ifdef CONFIG_SYS_STDIO_DEREGISTER
+   if (stdio_deregister_dev(dev-uclass_priv))
+   return -EPERM;
+#endif
+   dev-uclass_priv = NULL;
+
+   return 0;
+}
+
+UCLASS_DRIVER(serial) = {
+   .id = UCLASS_SERIAL,
+   .name   = serial,
+   .post_probe = serial_post_probe,
+   .pre_remove = serial_pre_remove,
+   .per_device_auto_alloc_size = sizeof(struct serial_dev_priv),
+};
diff --git a/include/dm/uclass-id.h b/include/dm/uclass-id.h
index f0e691c..e0fb30a 100644
--- a/include/dm/uclass-id.h
+++ b/include/dm/uclass-id.h
@@ -20,6 +20,7 @@ enum uclass_id {
 
/* U-Boot uclasses start here */
  

[U-Boot] [RFC PATCH 01/22] stdio: Remove redundant code around stdio_register() calls

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

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

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

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

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

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

[U-Boot] [RFC PATCH 03/22] dm: Make sure that the root device is probed

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

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

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

diff --git a/drivers/core/root.c b/drivers/core/root.c
index 4427b81..9fff164 100644
--- a/drivers/core/root.c
+++ b/drivers/core/root.c
@@ -48,6 +48,9 @@ int dm_init(void)
ret = device_bind_by_name(NULL, root_info, DM_ROOT());
if (ret)
return ret;
+   ret = device_probe(DM_ROOT());
+   if (ret)
+   return ret;
 
return 0;
 }
diff --git a/test/dm/core.c b/test/dm/core.c
index 14a57c3..a889fad 100644
--- a/test/dm/core.c
+++ b/test/dm/core.c
@@ -106,7 +106,7 @@ static int dm_test_autoprobe(struct dm_test_state *dms)
ut_asserteq(0, dm_testdrv_op_count[DM_TEST_OP_POST_PROBE]);
 
/* The root device should not be activated until needed */
-   ut_assert(!(dms-root-flags  DM_FLAG_ACTIVATED));
+   ut_assert(dms-root-flags  DM_FLAG_ACTIVATED);
 
/*
 * We should be able to find the three test devices, and they should
-- 
1.9.1.423.g4596e3a

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


[U-Boot] [RFC PATCH 16/22] dm: Add a way to indicate a preferred device within a uclass

2014-05-24 Thread Simon Glass
Where there are serveral device options that can be chosen, often one is
preferred. This can normally be handled by aliases in the device tree.

However, when a device can be specified either with platform data or
with a device tree node, which one should dm use? This situation happens
with sandbox, where we want to use the device tree version if we have
a device tree, and fall back to the platform data version if not. We need
this to work because without a console U-Boot will not function.

The original approach was just to take the first device in the uclass and
use that, but this does not work because the ordering is unknown.

The preferred device can be specified with a DM_FLAG_PREFER flag or a
'dm,prefer' property in the device tree node.

It is possible that a better approach will come to light in the future, but
this gets around the problem as it currently stands.

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

 drivers/core/device.c|  5 +
 drivers/core/uclass.c| 15 ++-
 include/dm/device.h  |  3 +++
 include/dm/uclass-internal.h |  3 ++-
 include/dm/uclass.h  | 15 +++
 test/dm/test-fdt.c   | 14 ++
 test/dm/test.dts |  1 +
 7 files changed, 54 insertions(+), 2 deletions(-)

diff --git a/drivers/core/device.c b/drivers/core/device.c
index 2c2634e..6b2c8f9 100644
--- a/drivers/core/device.c
+++ b/drivers/core/device.c
@@ -10,6 +10,7 @@
  */
 
 #include common.h
+#include fdtdec.h
 #include malloc.h
 #include dm/device.h
 #include dm/device-internal.h
@@ -21,6 +22,8 @@
 #include linux/err.h
 #include linux/list.h
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /**
  * device_chld_unbind() - Unbind all device's children from the device
  *
@@ -95,6 +98,8 @@ int device_bind(struct device *parent, struct driver *drv, 
const char *name,
dev-parent = parent;
dev-driver = drv;
dev-uclass = uc;
+   if (fdtdec_get_bool(gd-fdt_blob, of_offset, dm,prefer))
+   dev-flags |= DM_FLAG_PREFER;
if (!dev-platdata  drv-platdata_auto_alloc_size)
dev-flags |= DM_FLAG_ALLOC_PDATA;
 
diff --git a/drivers/core/uclass.c b/drivers/core/uclass.c
index afb5fdc..d02ea5e 100644
--- a/drivers/core/uclass.c
+++ b/drivers/core/uclass.c
@@ -149,7 +149,8 @@ int uclass_find_device(enum uclass_id id, int index, struct 
device **devp)
return ret;
 
list_for_each_entry(dev, uc-dev_head, uclass_node) {
-   if (!index--) {
+   if (index == -1 ? (dev-flags  DM_FLAG_PREFER) :
+   !index--) {
*devp = dev;
return 0;
}
@@ -177,6 +178,18 @@ int uclass_get_device(enum uclass_id id, int index, struct 
device **devp)
return 0;
 }
 
+int uclass_get_preferred_device(enum uclass_id id, struct device **devp)
+{
+   int err;
+
+   err = uclass_get_device(id, -1, devp);
+   if (!err || err != -ENODEV)
+   return err;
+
+   /* Nothing found, just pick the first device */
+   return uclass_get_device(id, 0, devp);
+}
+
 int uclass_first_device(enum uclass_id id, struct device **devp)
 {
struct uclass *uc;
diff --git a/include/dm/device.h b/include/dm/device.h
index 32650fd..d3c04ed 100644
--- a/include/dm/device.h
+++ b/include/dm/device.h
@@ -26,6 +26,9 @@ struct driver_info;
 /* DM should init this device prior to relocation */
 #define DM_FLAG_PRE_RELOC  (1  2)
 
+/* DM should prefer this driver when searching a uclass */
+#define DM_FLAG_PREFER (1  3)
+
 /**
  * struct device - An instance of a driver
  *
diff --git a/include/dm/uclass-internal.h b/include/dm/uclass-internal.h
index cc65d52..79b4d9e 100644
--- a/include/dm/uclass-internal.h
+++ b/include/dm/uclass-internal.h
@@ -13,7 +13,8 @@
 /**
  * uclass_find_device() - Return n-th child of uclass
  * @id:Id number of the uclass
- * @index: Position of the child in uclass's list
+ * @index: Position of the child in uclass's list. If -1 then the
+ * device marked with DM_FLAG_PREFER is returned, if any
  * #devp:  Returns pointer to device, or NULL on error
  *
  * The device is not prepared for use - this is an internal function
diff --git a/include/dm/uclass.h b/include/dm/uclass.h
index ac5c147..2ca87fc 100644
--- a/include/dm/uclass.h
+++ b/include/dm/uclass.h
@@ -106,6 +106,21 @@ int uclass_get(enum uclass_id key, struct uclass **ucp);
 int uclass_get_device(enum uclass_id id, int index, struct device **devp);
 
 /**
+ * uclass_get_preferred_device() - Get the preferred uclass device
+ *
+ * id: ID to look up
+ * @ucp: Returns pointer to device (there is only one per for each ID)
+ *
+ * This returns the device with the DM_FLAG_PREFER flag set, if any.
+ * Otherwise it returns the first device.
+ *
+ * The device is probed to activate it ready for use.
+ *
+ * @return 0 if OK, -ve on error
+ */
+int 

[U-Boot] [RFC PATCH 07/22] dm: Allow drivers to be marked 'before relocation'

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

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

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

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

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

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

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

diff --git a/common/board_r.c b/common/board_r.c
index d1f0aa9..d2a59ee 100644
--- a/common/board_r.c
+++ b/common/board_r.c
@@ -276,13 +276,13 @@ static int initr_dm(void)
debug(dm_init() failed: %d\n, ret);
return ret;
}
-   ret = dm_scan_platdata();
+   ret = dm_scan_platdata(false);
if (ret) {
debug(dm_scan_platdata() failed: %d\n, ret);
return ret;
}
 #ifdef CONFIG_OF_CONTROL
-   ret = dm_scan_fdt(gd-fdt_blob);
+   ret = dm_scan_fdt(gd-fdt_blob, false);
if (ret) {
debug(dm_scan_fdt() failed: %d\n, ret);
return ret;
diff --git a/doc/driver-model/README.txt b/doc/driver-model/README.txt
index e0b395a..deacfe9 100644
--- a/doc/driver-model/README.txt
+++ b/doc/driver-model/README.txt
@@ -332,26 +332,35 @@ dealing with this might not be worth it.
 - Implemented a GPIO system, trying to keep it simple
 
 
+Pre-Relocation Support
+--
+
+For pre-relocation we simply call the driver model init function. Only
+drivers marked with DM_FLAG_PRE_RELOC or the device tree 'dm,pre-reloc'
+flag are initialised prior to relocation. This helps to reduce the driver
+model overhead.
+
+Then post relocation we throw that away and re-init driver model again.
+For drivers which require some sort of continuity between pre- and
+post-relocation devices, we can provide access to the pre-relocation
+device pointers, but this is not currently implemented (the root device
+pointer is saved but not made available).
+
+
 Things to punt for later
 
 
 - SPL support - this will have to be present before many drivers can be
 converted, but it seems like we can add it once we are happy with the
 core implementation.
-- Pre-relocation support - similar story
 
-That is not to say that no thinking has gone into these - in fact there
+That is not to say that no thinking has gone into this - in fact there
 is quite a lot there. However, getting these right is non-trivial and
 there is a high cost associated with going down the wrong path.
 
 For SPL, it may be possible to fit in a simplified driver model with only
 bind and probe methods, to reduce size.
 
-For pre-relocation we can simply call the driver model init function. Then
-post relocation we throw that away and re-init driver model again. For drivers
-which require some sort of continuity between pre- and post-relocation
-devices, we can provide access to the pre-relocation device pointers.
-
 Uclasses are statically numbered at compile time. It would be possible to
 change this to dynamic numbering, but then we would require some sort of
 lookup service, perhaps searching by name. This is slightly less efficient
diff --git a/drivers/core/device.c b/drivers/core/device.c
index 55ba281..2c2634e 100644
--- a/drivers/core/device.c
+++ b/drivers/core/device.c
@@ -129,14 +129,16 @@ fail_bind:
return ret;
 }
 
-int device_bind_by_name(struct device *parent, const struct driver_info *info,
-   struct device **devp)
+int device_bind_by_name(struct device *parent, bool 

[U-Boot] [RFC PATCH 21/22] sandbox: serial: Support a coloured console

2014-05-24 Thread Simon Glass
The current sandbox serial driver is a pretty trivial example and does not
have the featues that might be needed for other board serial drivers. To
help provide a better example, add a text colour property to the device
tree for sandbox. This uses platform data, a device tree node, driver
private data and a remove() method.

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

 drivers/serial/sandbox.c | 83 
 1 file changed, 83 insertions(+)

diff --git a/drivers/serial/sandbox.c b/drivers/serial/sandbox.c
index 3401752..d47f4f4 100644
--- a/drivers/serial/sandbox.c
+++ b/drivers/serial/sandbox.c
@@ -34,19 +34,67 @@ static char serial_buf[16];
 static unsigned int serial_buf_write;
 static unsigned int serial_buf_read;
 
+struct sandbox_serial_platdata {
+   int colour; /* Text colour to use for output, -1 for none */
+};
+
+struct sandbox_serial_priv {
+   bool start_of_line;
+};
+
+/**
+ * output_ansi_colour() - Output an ANSI colour code
+ *
+ * @colour: Colour to output (0-7)
+ */
+static void output_ansi_colour(int colour)
+{
+   char ansi_code[] = \x1b[1;3Xm;
+
+   ansi_code[5] = '0' + colour;
+   os_write(1, ansi_code, sizeof(ansi_code) - 1);
+}
+
+static void output_ansi_reset(void)
+{
+   os_write(1, \x1b[0m, 4);
+}
+
 static int sandbox_serial_probe(struct device *dev)
 {
struct sandbox_state *state = state_get_current();
+   struct sandbox_serial_priv *priv = dev_get_priv(dev);
 
if (state-term_raw != STATE_TERM_COOKED)
os_tty_raw(0, state-term_raw == STATE_TERM_RAW_WITH_SIGS);
+   priv-start_of_line = 0;
+
+   return 0;
+}
+
+static int sandbox_serial_remove(struct device *dev)
+{
+   struct sandbox_serial_platdata *plat = dev-platdata;
+
+   if (plat-colour != -1)
+   output_ansi_reset();
 
return 0;
 }
 
 static int sandbox_serial_putc(struct device *dev, const char ch)
 {
+   struct sandbox_serial_priv *priv = dev_get_priv(dev);
+   struct sandbox_serial_platdata *plat = dev-platdata;
+
+   if (priv-start_of_line  plat-colour != -1) {
+   priv-start_of_line = false;
+   output_ansi_colour(plat-colour);
+   }
+
os_write(1, ch, 1);
+   if (ch == '\n')
+   priv-start_of_line = true;
 
return 0;
 }
@@ -91,6 +139,32 @@ static int sandbox_serial_getc(struct device *dev)
return result;
 }
 
+static const char * const ansi_colour[] = {
+   black, red, green, yellow, blue, megenta, cyan,
+   white,
+};
+
+static int sandbox_serial_ofdata_to_platdata(struct device *dev)
+{
+   struct sandbox_serial_platdata *plat = dev-platdata;
+   const char *colour;
+   int i;
+
+   plat-colour = -1;
+   colour = fdt_getprop(gd-fdt_blob, dev-of_offset, text-colour,
+NULL);
+   if (colour) {
+   for (i = 0; i  ARRAY_SIZE(ansi_colour); i++) {
+   if (!strcmp(colour, ansi_colour[i])) {
+   plat-colour = i;
+   break;
+   }
+   }
+   }
+
+   return 0;
+}
+
 static const struct dm_serial_ops sandbox_serial_ops = {
.putc = sandbox_serial_putc,
.pending = sandbox_serial_pending,
@@ -106,11 +180,20 @@ U_BOOT_DRIVER(serial_sandbox) = {
.name   = serial_sandbox,
.id = UCLASS_SERIAL,
.of_match = sandbox_serial_ids,
+   .ofdata_to_platdata = sandbox_serial_ofdata_to_platdata,
+   .platdata_auto_alloc_size = sizeof(struct sandbox_serial_platdata),
+   .priv_auto_alloc_size = sizeof(struct sandbox_serial_priv),
.probe = sandbox_serial_probe,
+   .remove = sandbox_serial_remove,
.ops= sandbox_serial_ops,
.flags = DM_FLAG_PRE_RELOC,
 };
 
+static const struct sandbox_serial_platdata platdata_non_fdt = {
+   .colour = -1,
+};
+
 U_BOOT_DEVICE(serial_sandbox_non_fdt) = {
.name = serial_sandbox,
+   .platdata = platdata_non_fdt,
 };
-- 
1.9.1.423.g4596e3a

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


[U-Boot] [RFC PATCH 13/22] stdio: Provide functions to add/remove devices using stdio_dev

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

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

 common/stdio.c  | 29 ++---
 include/stdio_dev.h |  2 ++
 2 files changed, 24 insertions(+), 7 deletions(-)

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

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


[U-Boot] [RFC PATCH 02/22] stdio: Pass device pointer to stdio methods

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

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

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

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

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

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

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

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

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

[U-Boot] [RFC PATCH 11/22] sandbox: config: Enable pre-relocation malloc()

2014-05-24 Thread Simon Glass
Enable this for sandbox so that we will be able to use driver model before
relocation.

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

 include/configs/sandbox.h | 4 
 1 file changed, 4 insertions(+)

diff --git a/include/configs/sandbox.h b/include/configs/sandbox.h
index fdc8b75..86ee70f 100644
--- a/include/configs/sandbox.h
+++ b/include/configs/sandbox.h
@@ -115,6 +115,10 @@
 #define CONFIG_SYS_MONITOR_BASE0
 #define CONFIG_NR_DRAM_BANKS   1
 
+#define CONFIG_SYS_MALLOC_F_LEN1024
+#define CONFIG_SYS_MALLOC_F_BASE   (CONFIG_SYS_SDRAM_SIZE - \
+   CONFIG_SYS_MALLOC_F_LEN)
+
 #define CONFIG_BAUDRATE115200
 #define CONFIG_SYS_BAUDRATE_TABLE  {4800, 9600, 19200, 38400, 57600,\
115200}
-- 
1.9.1.423.g4596e3a

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


[U-Boot] [RFC PATCH 20/22] sandbox: Convert serial driver to use driver model

2014-05-24 Thread Simon Glass
Adjust the sandbox serial driver to use the new driver model uclass. The
driver works much as before, but within the new framework.

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

 drivers/serial/sandbox.c  | 67 +--
 include/configs/sandbox.h |  3 +++
 2 files changed, 39 insertions(+), 31 deletions(-)

diff --git a/drivers/serial/sandbox.c b/drivers/serial/sandbox.c
index 51fd871..3401752 100644
--- a/drivers/serial/sandbox.c
+++ b/drivers/serial/sandbox.c
@@ -11,12 +11,16 @@
  */
 
 #include common.h
+#include dm.h
+#include fdtdec.h
 #include lcd.h
 #include os.h
 #include serial.h
 #include linux/compiler.h
 #include asm/state.h
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /*
  *
  *   serial_buf: A buffer that holds keyboard characters for the
@@ -30,27 +34,21 @@ static char serial_buf[16];
 static unsigned int serial_buf_write;
 static unsigned int serial_buf_read;
 
-static int sandbox_serial_init(void)
+static int sandbox_serial_probe(struct device *dev)
 {
struct sandbox_state *state = state_get_current();
 
if (state-term_raw != STATE_TERM_COOKED)
os_tty_raw(0, state-term_raw == STATE_TERM_RAW_WITH_SIGS);
-   return 0;
-}
 
-static void sandbox_serial_setbrg(void)
-{
+   return 0;
 }
 
-static void sandbox_serial_putc(const char ch)
+static int sandbox_serial_putc(struct device *dev, const char ch)
 {
os_write(1, ch, 1);
-}
 
-static void sandbox_serial_puts(const char *str)
-{
-   os_write(1, str, strlen(str));
+   return 0;
 }
 
 static unsigned int increment_buffer_index(unsigned int index)
@@ -58,12 +56,15 @@ static unsigned int increment_buffer_index(unsigned int 
index)
return (index + 1) % ARRAY_SIZE(serial_buf);
 }
 
-static int sandbox_serial_tstc(void)
+static int sandbox_serial_pending(struct device *dev, bool input)
 {
const unsigned int next_index =
increment_buffer_index(serial_buf_write);
ssize_t count;
 
+   if (!input)
+   return 0;
+
os_usleep(100);
 #ifdef CONFIG_LCD
lcd_sync();
@@ -74,38 +75,42 @@ static int sandbox_serial_tstc(void)
count = os_read_no_block(0, serial_buf[serial_buf_write], 1);
if (count == 1)
serial_buf_write = next_index;
+
return serial_buf_write != serial_buf_read;
 }
 
-static int sandbox_serial_getc(void)
+static int sandbox_serial_getc(struct device *dev)
 {
int result;
 
-   while (!sandbox_serial_tstc())
-   ;   /* buffer empty */
+   if (!sandbox_serial_pending(dev, true))
+   return -EAGAIN; /* buffer empty */
 
result = serial_buf[serial_buf_read];
serial_buf_read = increment_buffer_index(serial_buf_read);
return result;
 }
 
-static struct serial_device sandbox_serial_drv = {
-   .name   = sandbox_serial,
-   .start  = sandbox_serial_init,
-   .stop   = NULL,
-   .setbrg = sandbox_serial_setbrg,
-   .putc   = sandbox_serial_putc,
-   .puts   = sandbox_serial_puts,
-   .getc   = sandbox_serial_getc,
-   .tstc   = sandbox_serial_tstc,
+static const struct dm_serial_ops sandbox_serial_ops = {
+   .putc = sandbox_serial_putc,
+   .pending = sandbox_serial_pending,
+   .getc = sandbox_serial_getc,
 };
 
-void sandbox_serial_initialize(void)
-{
-   serial_register(sandbox_serial_drv);
-}
+static const struct device_id sandbox_serial_ids[] = {
+   { .compatible = sandbox,serial },
+   { }
+};
 
-__weak struct serial_device *default_serial_console(void)
-{
-   return sandbox_serial_drv;
-}
+U_BOOT_DRIVER(serial_sandbox) = {
+   .name   = serial_sandbox,
+   .id = UCLASS_SERIAL,
+   .of_match = sandbox_serial_ids,
+   .probe = sandbox_serial_probe,
+   .ops= sandbox_serial_ops,
+   .flags = DM_FLAG_PRE_RELOC,
+};
+
+U_BOOT_DEVICE(serial_sandbox_non_fdt) = {
+   .name = serial_sandbox,
+};
diff --git a/include/configs/sandbox.h b/include/configs/sandbox.h
index 86ee70f..67521a3 100644
--- a/include/configs/sandbox.h
+++ b/include/configs/sandbox.h
@@ -31,6 +31,9 @@
 #define CONFIG_DM_DEMO_SHAPE
 #define CONFIG_DM_GPIO
 #define CONFIG_DM_TEST
+#define CONFIG_DM_SERIAL
+
+#define CONFIG_SYS_STDIO_DEREGISTER
 
 /* Number of bits in a C 'long' on this architecture */
 #define CONFIG_SANDBOX_BITS_PER_LONG   64
-- 
1.9.1.423.g4596e3a

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


[U-Boot] [RFC PATCH 15/22] Add a flag indicating when the serial console is ready

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

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

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

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

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


[U-Boot] [RESEND][PATCH] gpio: spear_gpio: Fix gpio_set_value() implementation

2014-05-24 Thread Axel Lin
In current gpio_set_value() implementation, it always sets the gpio control bit
no matter the value argument is 0 or 1. Thus the GPIOs never set to low.
This patch fixes this bug.

The address bus is used as a mask on read/write operations, so that independent
software drivers can set their GPIO bits without affecting any other pins in a
single write operation. Thus we don't need a read-modify-write to update the
register.

Signed-off-by: Axel Lin axel@ingics.com
Acked-by: Stefan Roese s...@denx.de
Reviewed-by: Vipin Kumar vipin.ku...@st.com
Reviewed-by: Michael Trimarchi mich...@amarulasolutions.com
---
Hi,
This patch was sent a couple months ago.
http://patchwork.ozlabs.org/patch/273076/
Here is a resend with updating commit log.
Regards,
Axel

 drivers/gpio/spear_gpio.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/gpio/spear_gpio.c b/drivers/gpio/spear_gpio.c
index 367b670..6fb4117 100644
--- a/drivers/gpio/spear_gpio.c
+++ b/drivers/gpio/spear_gpio.c
@@ -36,7 +36,10 @@ int gpio_set_value(unsigned gpio, int value)
 {
struct gpio_regs *regs = (struct gpio_regs *)CONFIG_GPIO_BASE;
 
-   writel(1  gpio, regs-gpiodata[DATA_REG_ADDR(gpio)]);
+   if (value)
+   writel(1  gpio, regs-gpiodata[DATA_REG_ADDR(gpio)]);
+   else
+   writel(0, regs-gpiodata[DATA_REG_ADDR(gpio)]);
 
return 0;
 }
-- 
1.8.1.2



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


Re: [U-Boot] spi_flash_probe returns zero idcodes and hangs

2014-05-24 Thread Amit Mahadik

 Hello Sir, 
I will definetely try to trace the transactions.



--
On Sun 25 May, 2014 12:52 AM IST Jon Loeliger wrote:

Amit,

If you can, place a SPI protocol analyzer on the bus and trace its 
transactions.

I recently debugged a similar symptom and discovered that I was not driving
the Tx FIFO consistently enough to maintain the appearance of a single
transaction on the ID request to the flash.

How is your SPI device (flash, right?) being selected?  If via a GPIO, are you
sure you are driving it properly?  If it is directly using a
controller's slave-select
line, you may need to ensure a full Tx FIFO for both the write and response.

HTH,
jdl


On Sat, May 24, 2014 at 12:15 PM, Jagan Teki jagannadh.t...@gmail.com wrote:
 On Sat, May 24, 2014 at 10:27 PM, Amit Mahadik amitmahadi...@yahoo.com 
 wrote:
 Hello All,
 I am using a custom ARM based development board running 
 u-boot from PNOR memory. However, it does not have support for the Micron SPI 
 flash memory (N25Q064A). I have added support for the micron memory in 
 drivers/mtd/spi/stmicro.c file and included the flag CONFIG_SPI_FLASH_STMICRO 
 in the config file and recompiled the u-boot source source. Then, ran it 
 directly through RAM memory.
 The new u-boot ran from RAM. Now when I run sf probe 0 command I get the 
 following output
 Got Idcodes 00: 00 00 00 00  and the code hangs after this.

 Looks like your driver itself is not returning any proper idcode.

 What id details you added - I think you're using old u-boot no stmicro.c
 in current u-boot, please re-base to master and try.

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


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