Re: [U-Boot] [PATCH 6/8] config: don't define CONFIG_ARCH_DEVICE_TREE

2013-06-11 Thread Jagan Teki
Hi,

I think we can wait some more time to mature the fdt support on
u-boot, as not many boards were using this future.
may be I am also incorrect.

And need to remove the CONFIG_ARCH_DEVICE_TREE references in
dts/Makefile to for working this.

--
Thanks,
Jagan.

On Tue, Jun 11, 2013 at 4:47 AM, Stephen Warren swar...@wwwdotorg.org wrote:
 From: Stephen Warren swar...@nvidia.com

 Now that nothing uses CONFIG_ARCH_DEVICE_TREE, stop defining it.

 Signed-off-by: Stephen Warren swar...@nvidia.com
 ---
  arch/arm/cpu/armv7/tegra114/config.mk | 19 ---
  arch/arm/cpu/armv7/tegra20/config.mk  | 26 --
  arch/arm/cpu/armv7/tegra30/config.mk  | 19 ---
  arch/microblaze/config.mk |  2 --
  arch/x86/cpu/coreboot/config.mk   | 23 ---
  doc/README.fdt-control|  3 +--
  include/configs/exynos5250-dt.h   |  1 -
  7 files changed, 1 insertion(+), 92 deletions(-)
  delete mode 100644 arch/arm/cpu/armv7/tegra114/config.mk
  delete mode 100644 arch/arm/cpu/armv7/tegra20/config.mk
  delete mode 100644 arch/arm/cpu/armv7/tegra30/config.mk
  delete mode 100644 arch/x86/cpu/coreboot/config.mk

 diff --git a/arch/arm/cpu/armv7/tegra114/config.mk 
 b/arch/arm/cpu/armv7/tegra114/config.mk
 deleted file mode 100644
 index cb1a19d..000
 --- a/arch/arm/cpu/armv7/tegra114/config.mk
 +++ /dev/null
 @@ -1,19 +0,0 @@
 -#
 -# Copyright (c) 2010-2013, NVIDIA CORPORATION.  All rights reserved.
 -#
 -# (C) Copyright 2002
 -# Gary Jennejohn, DENX Software Engineering, ga...@denx.de
 -#
 -# This program is free software; you can redistribute it and/or modify it
 -# under the terms and conditions of the GNU General Public License,
 -# version 2, as published by the Free Software Foundation.
 -#
 -# This program is distributed in the hope it will be useful, but WITHOUT
 -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 -# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 -# more details.
 -#
 -# You should have received a copy of the GNU General Public License
 -# along with this program.  If not, see http://www.gnu.org/licenses/.
 -#
 -CONFIG_ARCH_DEVICE_TREE := tegra114
 diff --git a/arch/arm/cpu/armv7/tegra20/config.mk 
 b/arch/arm/cpu/armv7/tegra20/config.mk
 deleted file mode 100644
 index 6432e75..000
 --- a/arch/arm/cpu/armv7/tegra20/config.mk
 +++ /dev/null
 @@ -1,26 +0,0 @@
 -#
 -# (C) Copyright 2010,2011
 -# NVIDIA Corporation www.nvidia.com
 -#
 -# (C) Copyright 2002
 -# Gary Jennejohn, DENX Software Engineering, ga...@denx.de
 -#
 -# See file CREDITS for list of people who contributed to this
 -# project.
 -#
 -# This program is free software; you can redistribute it and/or
 -# modify it under the terms of the GNU General Public License as
 -# published by the Free Software Foundation; either version 2 of
 -# the License, or (at your option) any later version.
 -#
 -# This program is distributed in the hope that it will be useful,
 -# but WITHOUT ANY WARRANTY; without even the implied warranty of
 -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 -# GNU General Public License for more details.
 -#
 -# You should have received a copy of the GNU General Public License
 -# along with this program; if not, write to the Free Software
 -# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 -# MA 02111-1307 USA
 -#
 -CONFIG_ARCH_DEVICE_TREE := tegra20
 diff --git a/arch/arm/cpu/armv7/tegra30/config.mk 
 b/arch/arm/cpu/armv7/tegra30/config.mk
 deleted file mode 100644
 index 719ca81..000
 --- a/arch/arm/cpu/armv7/tegra30/config.mk
 +++ /dev/null
 @@ -1,19 +0,0 @@
 -#
 -# Copyright (c) 2010-2012, NVIDIA CORPORATION.  All rights reserved.
 -#
 -# (C) Copyright 2002
 -# Gary Jennejohn, DENX Software Engineering, ga...@denx.de
 -#
 -# This program is free software; you can redistribute it and/or modify it
 -# under the terms and conditions of the GNU General Public License,
 -# version 2, as published by the Free Software Foundation.
 -#
 -# This program is distributed in the hope it will be useful, but WITHOUT
 -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 -# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 -# more details.
 -#
 -# You should have received a copy of the GNU General Public License
 -# along with this program.  If not, see http://www.gnu.org/licenses/.
 -#
 -CONFIG_ARCH_DEVICE_TREE := tegra30
 diff --git a/arch/microblaze/config.mk b/arch/microblaze/config.mk
 index b4935f0..aca79e2 100644
 --- a/arch/microblaze/config.mk
 +++ b/arch/microblaze/config.mk
 @@ -31,5 +31,3 @@ CONFIG_STANDALONE_LOAD_ADDR ?= 0x80F0
  PLATFORM_CPPFLAGS += -ffixed-r31 -D__microblaze__

  LDSCRIPT ?= $(SRCTREE)/$(CPUDIR)/u-boot.lds
 -
 -CONFIG_ARCH_DEVICE_TREE := microblaze
 diff --git a/arch/x86/cpu/coreboot/config.mk b/arch/x86/cpu/coreboot/config.mk
 deleted file mode 100644
 index 4858fc3..000
 --- 

Re: [U-Boot] bootm does not work if netconsole is enabled

2013-06-11 Thread Michael Walle

Am 2013-04-10 18:13, schrieb Joe Hershberger:

Hi Michael,

On Wed, Apr 10, 2013 at 5:07 AM, Michael Walle mich...@walle.cc 
wrote:

On Wed, April 10, 2013 03:51, Joe Hershberger wrote:

Hi Michael,

I just tested this on my Zynq target and it worked.  However, you 
make
a good point that it is possible for there to be more traces after 
the

eth_halt call.  I can't imagine the stack would like that in all
situations (since eth_init() will not be called again by 
netconsole).
I think the solution to this is probably to disable netconsole 
somehow

before the eth_halt command, so subsequent prints do not try to use
Ethernet again.  However, most of the things you might switch to 
are

conditional, such as a nulldev or silent.  Any thoughts on how you
would like to see it solved?


Hi Joe,

disabling the network console before control is handed over to an
operating system sounds reasonable.

If i understand you correctly, the network will only be halted once 
the
bootloader starts an operating system. Then what do you think about 
making
either the nc_send_packet() or nc_putc()/nc_puts() function a noop 
when

the network is halted?


It's not quite that simple since the state does not really reflect 
the

hardware (I know... that's my fault).  I can try to fix this for next
release, but it is probably too risky to put into the April release.


Ping :)

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


Re: [U-Boot] [Patch] fsl_esdhc: Fix DMA transfer completion waiting loop

2013-06-11 Thread Dirk Behme

On 10.06.2013 16:51, Gabbasov, Andrew wrote:

Hi Dirk,


From: Behme, Dirk - Bosch
Sent: Monday, June 10, 2013 16:06
To: Gabbasov, Andrew
Cc: u-boot@lists.denx.de; Stefano Babic; Fleming Andy-AFLEMING
Subject: Re: [U-Boot] [Patch] fsl_esdhc: Fix DMA transfer completion waiting 
loop

On 08.04.2013 11:06, Andrew Gabbasov wrote:

Rework the waiting for transfer completion loop condition
to continue waiting until both Transfer Complete and DMA End
interrupts occur. Checking of DLA bit in Present State register
looks not needed in addition to interrupts status checking,
so it can be removed from the condition. Also, DMA Error
condition is added to the list of data errors, checked in the loop.

Signed-off-by: Andrew Gabbasov andrew_gabba...@mentor.com
---
   drivers/mmc/fsl_esdhc.c |3 +--
   include/fsl_esdhc.h |4 +++-
   2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c
index 54b5363..814bba4 100644
--- a/drivers/mmc/fsl_esdhc.c
+++ b/drivers/mmc/fsl_esdhc.c
@@ -400,8 +400,7 @@ esdhc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, struct 
mmc_data *data)

   if (irqstat  DATA_ERR)
   return COMM_ERR;
- } while (!(irqstat  IRQSTAT_TC) 
- (esdhc_read32(regs-prsstat)  PRSSTAT_DLA));
+ } while ((irqstat  DATA_COMPLETE) != DATA_COMPLETE);
   #endif
   }

diff --git a/include/fsl_esdhc.h b/include/fsl_esdhc.h
index 47d2fe4..ea0880b 100644
--- a/include/fsl_esdhc.h
+++ b/include/fsl_esdhc.h
@@ -63,7 +63,9 @@
   #define IRQSTAT_CC  (0x0001)

   #define CMD_ERR (IRQSTAT_CIE | IRQSTAT_CEBE | IRQSTAT_CCE)
-#define DATA_ERR (IRQSTAT_DEBE | IRQSTAT_DCE | IRQSTAT_DTOE)
+#define DATA_ERR (IRQSTAT_DEBE | IRQSTAT_DCE | IRQSTAT_DTOE | \
+ IRQSTAT_DMAE)
+#define DATA_COMPLETE(IRQSTAT_TC | IRQSTAT_DINT)

   #define IRQSTATEN   0x0002e034
   #define IRQSTATEN_DMAE  (0x1000)


I haven't tested this myself, but I got the following issue report
regarding this patch:

Using a SANDISK ULTRA II 8GB card (or alternatively Transcend 16GB or
32GB cards) and trying an mmc write [1] into the upper area of the 8GB
card makes the write hang in 9 of 10 cases. Sometimes even more.
Reverting this patch make these writes work again.

mmc read does work fine, though. Even newer SANDISK Extreme III or
several micro SD cards are working fine.

Any idea?

Best regards

Dirk


So far the only idea that comes into my mind is that DMA for some reason 
completes
its part of work too early so that the corresponding interrupt status bit 
appears and
has already been cleared even before entering this loop.

I will be trying to reproduce the issue.

Meanwhile, is it possible to ask the reporter (who obviously can reproduce it)
to try to add the debug print from the diff below and show what it prints when
the write command hangs and when it succeeds?

Thanks.

Best regards,
Andrew

diff -u fsl_esdhc.c.orig fsl_esdhc.c
--- fsl_esdhc.c.orig2013-05-30 03:48:26.0 -0500
+++ fsl_esdhc.c 2013-06-10 09:38:30.071905119 -0500
@@ -329,6 +329,7 @@

irqstat = esdhc_read32(regs-irqstat);
esdhc_write32(regs-irqstat, irqstat);
+   printf(fsl_esdhc: irqstat = 0x%08x\n, irqstat);

/* Reset CMD and DATA portions on error */
if (irqstat  (CMD_ERR | IRQSTAT_CTOE)) {


1. Sandisk 8GB Ultra 2 class 4 SDHC

[   23.967081] MMC write: dev # 0, block # 740, count 1 ... 
fsl_esdhc: irqstat = 0x0001

[   23.977473] fsl_esdhc: irqstat = 0x0009
 = hang

With fsl_esdhc: Fix DMA transfer completion waiting loop reverted:
[   41.769231] MMC write: dev # 0, block # 740, count 1 ... 
fsl_esdhc: irqstat = 0x0001

[   41.779622] fsl_esdhc: irqstat = 0x0009
[   41.798490] fsl_esdhc: irqstat = 0x0001
[   41.802593] 1 blocks write: OK
= work


2. Sandisk 16GB Extreme class 10 (30MB/s)

[   45.871140] MMC write: dev # 0, block # 740, count 1 ... 
fsl_esdhc: irqstat = 0x0001

[   45.881528] fsl_esdhc: irqstat = 0x0001
[   46.054409] fsl_esdhc: irqstat = 0x0001
[   46.058513] 1 blocks write: OK
= work

With fsl_esdhc: Fix DMA transfer completion waiting loop reverted:
[   17.901514] MMC write: dev # 0, block # 740, count 1 ... 
fsl_esdhc: irqstat = 0x0001

[   17.911901] fsl_esdhc: irqstat = 0x0001
[   18.081153] fsl_esdhc: irqstat = 0x0001
[   18.085256] 1 blocks write: OK
= work

Best regards

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


Re: [U-Boot] [PATCH v2] ARM: highbank: compile misc_init_r only if CONFIG_MISC_INIT_R

2013-06-11 Thread Albert ARIBAUD
Hi Rob,

On Tue, 21 May 2013 16:33:44 -0500, Rob Herring robherri...@gmail.com
wrote:

 From: Rob Herring rob.herr...@calxeda.com
 
 Compile misc_init_r only if CONFIG_MISC_INIT_R is enabled.
 
 Signed-off-by: Rob Herring rob.herr...@calxeda.com
 ---
  board/highbank/highbank.c | 2 ++
  1 file changed, 2 insertions(+)
 
 diff --git a/board/highbank/highbank.c b/board/highbank/highbank.c
 index b224aae..b0c20fe 100644
 --- a/board/highbank/highbank.c
 +++ b/board/highbank/highbank.c
 @@ -62,6 +62,7 @@ int board_eth_init(bd_t *bis)
   return rc;
  }
  
 +#ifdef CONFIG_MISC_INIT_R
  int misc_init_r(void)
  {
   char envbuffer[16];
 @@ -83,6 +84,7 @@ int misc_init_r(void)
  
   return 0;
  }
 +#endif
  
  int dram_init(void)
  {

This patch probably beloings to a series, only it lacks history and the
post subject lacks nn/NN indications as well.

Ditto for:

http://patchwork.ozlabs.org/patch/245407/
http://patchwork.ozlabs.org/patch/245411/
http://patchwork.ozlabs.org/patch/245412/

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


Re: [U-Boot] [PATCH] OpenRD: relocate environment to 640kB

2013-06-11 Thread Albert ARIBAUD
Hi Sascha,

On Mon, 27 May 2013 11:42:26 +0200, Sascha Silbe
t-ub...@infra-silbe.de wrote:

 U-Boot has become slightly larger than where the environment sector
 was previously located. Saving the environment would brick the device.
 
 Relocate the environment to where it is with the stock (i.e. Marvell
 USP) U-Boot version. That should give plenty of room for U-Boot to
 grow, including local customisations.
 
 This obviously breaks compatibility with previous mainline versions of
 U-Boot. Users will need to back up the environment before an update
 and restore it afterwards, or manually copy it to the new address
 before the update.
 
 Signed-off-by: Sascha Silbe t-ub...@infra-silbe.de
 ---
  include/configs/openrd.h | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
 
 diff --git a/include/configs/openrd.h b/include/configs/openrd.h
 index 53bafe1..ea7f9aa 100644
 --- a/include/configs/openrd.h
 +++ b/include/configs/openrd.h
 @@ -90,8 +90,8 @@
   * it has to be rounded to sector size
   */
  #define CONFIG_ENV_SIZE  0x2 /* 128k */
 -#define CONFIG_ENV_ADDR  0x6
 -#define CONFIG_ENV_OFFSET0x6 /* env starts here */
 +#define CONFIG_ENV_ADDR  0xa
 +#define CONFIG_ENV_OFFSET0xa /* env starts here */
  
  /*
   * Default environment variables

CC:ing Tom.

This patch is for 2013.10, not 2013.07, but I prefer raising the issue
as early as possible.

If there is no way to make things smoother, then I think the 2013.10
release notes should contain a red, blinking, paragraph about this. I
would *hate* it if people were not warned and given a method to port
their current environment setting over.

Possibly even, the 2013.07 could have a warning about the change to
come, so that people have a better chance yet to prepare for the change.

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


[U-Boot] [PATCH v3 1/6] arm: ensure u-boot only uses relative relocations

2013-06-11 Thread Albert ARIBAUD
Add a Makefile target ('checkarmreloc') which
fails if the ELF binary contains relocation records
of types other than R_ARM_RELATIVE.

Signed-off-by: Albert ARIBAUD albert.u.b...@aribaud.net
---
Changes in v3:
- fix commit message typo (of - if)

Changes in v2:
- use $ instead of $(obj)u-boot

 Makefile   |7 +++
 arch/arm/config.mk |5 +
 2 files changed, 12 insertions(+)

diff --git a/Makefile b/Makefile
index af4c3c0..b1e5d5f 100644
--- a/Makefile
+++ b/Makefile
@@ -743,6 +743,13 @@ tools: $(VERSION_FILE) $(TIMESTAMP_FILE)
$(MAKE) -C $@ all
 endif  # config.mk
 
+# ARM relocations should all be R_ARM_RELATIVE.
+checkarmreloc: $(obj)u-boot
+   @if test R_ARM_RELATIVE != \
+   `readelf -r $ | cut -d ' ' -f 4 | grep R_ARM | sort -u`; \
+   then echo $ contains relocations other than \
+   R_ARM_RELATIVE; false; fi
+
 $(VERSION_FILE):
@mkdir -p $(dir $(VERSION_FILE))
@( localvers='$(shell $(TOPDIR)/tools/setlocalversion 
$(TOPDIR))' ; \
diff --git a/arch/arm/config.mk b/arch/arm/config.mk
index dc64160..e80e1ed 100644
--- a/arch/arm/config.mk
+++ b/arch/arm/config.mk
@@ -109,3 +109,8 @@ ifeq ($(GAS_BUG_12532),y)
 PLATFORM_RELFLAGS += -fno-optimize-sibling-calls
 endif
 endif
+
+# check that only R_ARM_RELATIVE relocations are generated
+ifneq ($(CONFIG_SPL_BUILD),y)
+ALL-y  += checkarmreloc
+endif
-- 
1.7.10.4

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


[U-Boot] [PATCH v3 0/6] Optimize ARM relocation

2013-06-11 Thread Albert ARIBAUD
This series optimizes relocation by ensuring ARM
binaries only use one type of relocation record,
R_ARM_RELATIVE., then optimizing relocation code
accordingly.

1. A Makefile rule is added that checks that no
other relocation record types are generated except
R_ARM_RELATIVE; build fails if this is the case.

2. All references to dymsym are removed, as this
table is not used for R_ARM_RELATIVE relocations.

3. arch/arm/lib/bss.c is replaced by a more generic
arch/arm/lib/sections.c where all section symbols will
be defined.

4. __image_copy_start and __image_copy_end symbols
are moved from linker scripts to arch/arm/lib/sections.c

5. __rel_dyn_start and __rel_dyn_end are moved from
linker scripts into arch/arm/lib/sections.c

6. relocate_code is optimized based on the fact that
symbol references are now always valid even before
relcation, and that only R_ARM_RELATIVE relocations
will be met.

Changes in v3:
- fix commit message typo (of - if)
- fix commit message typo (breaks - break)

Changes in v2:
- use $ instead of $(obj)u-boot
- new in V2: remove all dynsym references
- various comment fixes

Albert ARIBAUD (6):
  arm: ensure u-boot only uses relative relocations
  remove all references to .dynsym
  arm: generalize lib/bss.c into lib/sections.c
  arm: make __image_copy_{start,end} compiler-generated
  arm: make __rel_dyn_{start,end} compiler-generated
  arm: optimize relocate_code routine

 Makefile   |7 +++
 arch/arm/config.mk |5 ++
 arch/arm/cpu/arm920t/ep93xx/u-boot.lds |6 ++-
 arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds  |5 --
 arch/arm/cpu/arm926ejs/spear/u-boot-spl.lds|5 --
 arch/arm/cpu/ixp/u-boot.lds|   20 +---
 arch/arm/cpu/u-boot-spl.lds|6 +--
 arch/arm/cpu/u-boot.lds|   21 +---
 arch/arm/lib/Makefile  |2 +-
 arch/arm/lib/relocate.S|   61 ++--
 arch/arm/lib/{bss.c = sections.c} |8 +++-
 board/actux1/u-boot.lds|   20 +---
 board/actux2/u-boot.lds|   20 +---
 board/actux3/u-boot.lds|   20 +---
 board/ait/cam_enc_4xx/u-boot-spl.lds   |5 --
 board/davinci/da8xxevm/u-boot-spl-da850evm.lds |5 --
 board/davinci/da8xxevm/u-boot-spl-hawk.lds |1 -
 board/dvlhost/u-boot.lds   |   20 +---
 board/freescale/mx31ads/u-boot.lds |   20 +---
 board/vpac270/u-boot-spl.lds   |6 +--
 include/asm-generic/sections.h |3 --
 21 files changed, 139 insertions(+), 127 deletions(-)
 rename arch/arm/lib/{bss.c = sections.c} (79%)

-- 
1.7.10.4

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


[U-Boot] [PATCH v3 3/6] arm: generalize lib/bss.c into lib/sections.c

2013-06-11 Thread Albert ARIBAUD
File arch/arm/lib/bss.c was initially defined for BSS only,
but is now going to also contain definitions for other
section-boundary-related symbols, so rename it for better
accuracy.

Also, remove useless 'used' attributes.

Signed-off-by: Albert ARIBAUD albert.u.b...@aribaud.net
---
Changes in v3: None
Changes in v2: None

 arch/arm/lib/Makefile  |2 +-
 arch/arm/lib/{bss.c = sections.c} |4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
 rename arch/arm/lib/{bss.c = sections.c} (92%)

diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile
index 8ad9f66..9ecafb2 100644
--- a/arch/arm/lib/Makefile
+++ b/arch/arm/lib/Makefile
@@ -43,7 +43,7 @@ SOBJS-y += relocate.o
 ifndef CONFIG_SYS_GENERIC_BOARD
 COBJS-y+= board.o
 endif
-COBJS-y += bss.o
+COBJS-y += sections.o
 
 COBJS-y+= bootm.o
 COBJS-$(CONFIG_OF_LIBFDT) += bootm-fdt.o
diff --git a/arch/arm/lib/bss.c b/arch/arm/lib/sections.c
similarity index 92%
rename from arch/arm/lib/bss.c
rename to arch/arm/lib/sections.c
index 99eda59..e52fec9 100644
--- a/arch/arm/lib/bss.c
+++ b/arch/arm/lib/sections.c
@@ -35,5 +35,5 @@
  * aliasing warnings.
  */
 
-char __bss_start[0] __attribute__((used, section(.__bss_start)));
-char __bss_end[0] __attribute__((used, section(.__bss_end)));
+char __bss_start[0] __attribute__((section(.__bss_start)));
+char __bss_end[0] __attribute__((section(.__bss_end)));
-- 
1.7.10.4

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


[U-Boot] [PATCH v3 6/6] arm: optimize relocate_code routine

2013-06-11 Thread Albert ARIBAUD
Use section symbols directly
Drop support for R_ARM_ABS32 record types
Eliminate unneeded intermediate registers
Optimize relocation table iteration

Signed-off-by: Albert ARIBAUD albert.u.b...@aribaud.net
---
Changes in v3: None
Changes in v2: None

 arch/arm/lib/relocate.S |   32 
 1 file changed, 12 insertions(+), 20 deletions(-)

diff --git a/arch/arm/lib/relocate.S b/arch/arm/lib/relocate.S
index 3f444c1..949b9e8 100644
--- a/arch/arm/lib/relocate.S
+++ b/arch/arm/lib/relocate.S
@@ -37,19 +37,15 @@
  */
 
 ENTRY(relocate_code)
-   mov r6, r0  /* save addr of destination */
-
-   ldr r0, =__image_copy_start /* r0 - SRC __image_copy_start */
-   subsr9, r6, r0  /* r9 - relocation offset */
+   ldr r1, =__image_copy_start /* r1 - SRC __image_copy_start */
+   subsr9, r0, r1  /* r9 - relocation offset */
beq relocate_done   /* skip relocation */
-   mov r1, r6  /* r1 - scratch for copy loop */
-   adr r7, relocate_code   /* r7 - SRC relocate_code */
ldr r2, =__image_copy_end   /* r2 - SRC __image_copy_end */
 
 copy_loop:
-   ldmia   r0!, {r10-r11}  /* copy from source address [r0]*/
-   stmia   r1!, {r10-r11}  /* copy to   target address [r1]*/
-   cmp r0, r2  /* until source end address [r2]*/
+   ldmia   r1!, {r10-r11}  /* copy from source address [r1]*/
+   stmia   r0!, {r10-r11}  /* copy to   target address [r0]*/
+   cmp r1, r2  /* until source end address [r2]*/
blo copy_loop
 
/*
@@ -58,21 +54,17 @@ copy_loop:
ldr r2, =__rel_dyn_start/* r2 - SRC __rel_dyn_start */
ldr r3, =__rel_dyn_end  /* r3 - SRC __rel_dyn_end */
 fixloop:
-   ldr r0, [r2]/* r0 - SRC location to fix up */
-   add r0, r0, r9  /* r0 - DST location to fix up */
-   ldr r1, [r2, #4]
-   and r7, r1, #0xff
-   cmp r7, #23 /* relative fixup? */
-   beq fixrel
-   /* ignore unknown type of fixup */
-   b   fixnext
-fixrel:
+   ldmia   r2!, {r0-r1}/* (r0,r1) - (SRC location,fixup) */
+   and r1, r1, #0xff
+   cmp r1, #23 /* relative fixup? */
+   bne fixnext
+
/* relative fix: increase location by offset */
+   add r0, r0, r9
ldr r1, [r0]
add r1, r1, r9
-fixnext:
str r1, [r0]
-   add r2, r2, #8  /* each rel.dyn entry is 8 bytes */
+fixnext:
cmp r2, r3
blo fixloop
 
-- 
1.7.10.4

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


[U-Boot] [PATCH v3 2/6] remove all references to .dynsym

2013-06-11 Thread Albert ARIBAUD
Discard all .dynsym sections from linker scripts
Remove all __dynsym_start definitions from linker scripts
Remove all __dynsym_start references from the codebase

Note: this touches include/asm-generic/sections.h, which
is not ARM-specific, but actual uses of __dynsym_start
are only in ARM, so this patch can safely go through
the ARM repository.

Signed-off-by: Albert ARIBAUD albert.u.b...@aribaud.net
---
Changes in v3: None
Changes in v2:
- new in V2: remove all dynsym references

 arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds  |5 -
 arch/arm/cpu/arm926ejs/spear/u-boot-spl.lds|5 -
 arch/arm/cpu/ixp/u-boot.lds|6 +-
 arch/arm/cpu/u-boot-spl.lds|6 +-
 arch/arm/cpu/u-boot.lds|6 +-
 arch/arm/lib/relocate.S|   13 -
 board/actux1/u-boot.lds|6 +-
 board/actux2/u-boot.lds|6 +-
 board/actux3/u-boot.lds|6 +-
 board/ait/cam_enc_4xx/u-boot-spl.lds   |5 -
 board/davinci/da8xxevm/u-boot-spl-da850evm.lds |5 -
 board/davinci/da8xxevm/u-boot-spl-hawk.lds |1 -
 board/dvlhost/u-boot.lds   |6 +-
 board/freescale/mx31ads/u-boot.lds |6 +-
 board/vpac270/u-boot-spl.lds   |6 +-
 include/asm-generic/sections.h |3 ---
 16 files changed, 9 insertions(+), 82 deletions(-)

diff --git a/arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds 
b/arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds
index 673c725..f4e7525 100644
--- a/arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds
+++ b/arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds
@@ -57,11 +57,6 @@ SECTIONS
__rel_dyn_end = .;
}
 
-   .dynsym : {
-   __dynsym_start = .;
-   *(.dynsym)
-   }
-
.bss : {
. = ALIGN(4);
__bss_start = .;
diff --git a/arch/arm/cpu/arm926ejs/spear/u-boot-spl.lds 
b/arch/arm/cpu/arm926ejs/spear/u-boot-spl.lds
index 967a135..446d095 100644
--- a/arch/arm/cpu/arm926ejs/spear/u-boot-spl.lds
+++ b/arch/arm/cpu/arm926ejs/spear/u-boot-spl.lds
@@ -57,11 +57,6 @@ SECTIONS
__rel_dyn_end = .;
}
 
-   .dynsym : {
-   __dynsym_start = .;
-   *(.dynsym)
-   }
-
.bss : {
. = ALIGN(4);
__bss_start = .;
diff --git a/arch/arm/cpu/ixp/u-boot.lds b/arch/arm/cpu/ixp/u-boot.lds
index 553589c..5cfff68 100644
--- a/arch/arm/cpu/ixp/u-boot.lds
+++ b/arch/arm/cpu/ixp/u-boot.lds
@@ -62,11 +62,6 @@ SECTIONS
__rel_dyn_end = .;
}
 
-   .dynsym : {
-   __dynsym_start = .;
-   *(.dynsym)
-   }
-
_end = .;
 
 /*
@@ -88,6 +83,7 @@ SECTIONS
KEEP(*(.__bss_end));
}
 
+   /DISCARD/ : { *(.dynsym) }
/DISCARD/ : { *(.dynstr*) }
/DISCARD/ : { *(.dynamic*) }
/DISCARD/ : { *(.plt*) }
diff --git a/arch/arm/cpu/u-boot-spl.lds b/arch/arm/cpu/u-boot-spl.lds
index 1408f03..b6ed25f 100644
--- a/arch/arm/cpu/u-boot-spl.lds
+++ b/arch/arm/cpu/u-boot-spl.lds
@@ -58,11 +58,6 @@ SECTIONS
__rel_dyn_end = .;
}
 
-   .dynsym : {
-   __dynsym_start = .;
-   *(.dynsym)
-   }
-
_end = .;
 
.bss __rel_dyn_start (OVERLAY) : {
@@ -72,6 +67,7 @@ SECTIONS
__bss_end = .;
}
 
+   /DISCARD/ : { *(.dynsym) }
/DISCARD/ : { *(.dynstr*) }
/DISCARD/ : { *(.dynamic*) }
/DISCARD/ : { *(.plt*) }
diff --git a/arch/arm/cpu/u-boot.lds b/arch/arm/cpu/u-boot.lds
index d9bbee3..fe2ca98 100644
--- a/arch/arm/cpu/u-boot.lds
+++ b/arch/arm/cpu/u-boot.lds
@@ -65,11 +65,6 @@ SECTIONS
__rel_dyn_end = .;
}
 
-   .dynsym : {
-   __dynsym_start = .;
-   *(.dynsym)
-   }
-
_end = .;
 
/*
@@ -101,6 +96,7 @@ SECTIONS
KEEP(*(.__bss_end));
}
 
+   /DISCARD/ : { *(.dynsym) }
/DISCARD/ : { *(.dynstr*) }
/DISCARD/ : { *(.dynamic*) }
/DISCARD/ : { *(.plt*) }
diff --git a/arch/arm/lib/relocate.S b/arch/arm/lib/relocate.S
index 4446da9..7a7c4c0 100644
--- a/arch/arm/lib/relocate.S
+++ b/arch/arm/lib/relocate.S
@@ -56,8 +56,6 @@ copy_loop:
/*
 * fix .rel.dyn relocations
 */
-   ldr r10, _dynsym_start_ofs  /* r10 - __dynsym_start local ofs */
-   add r10, r10, r7/* r10 - SRC __dynsym_start */
ldr r2, _rel_dyn_start_ofs  /* r2 - __rel_dyn_start local ofs */
add r2, r2, r7  /* r2 - SRC __rel_dyn_start */
ldr r3, _rel_dyn_end_ofs/* r3 - __rel_dyn_end local ofs */
@@ -69,17 +67,8 @@ fixloop:
and r7, r1, #0xff
cmp r7, #23 /* relative fixup? */
beq

[U-Boot] [PATCH v3 5/6] arm: make __rel_dyn_{start, end} compiler-generated

2013-06-11 Thread Albert ARIBAUD
This change is only done where needed: some linker
scripts may contain relocation symbols yet remain
unchanged.

__rel_dyn_start and __rel_dyn_end each requires
its own output section; putting them in relocation
sections changes their flags and breaks relocation.

Signed-off-by: Albert ARIBAUD albert.u.b...@aribaud.net
---
Changes in v3: None
Changes in v2:
- various comment fixes

 arch/arm/cpu/ixp/u-boot.lds|   12 ++--
 arch/arm/cpu/u-boot.lds|   12 ++--
 arch/arm/lib/relocate.S|   11 ++-
 arch/arm/lib/sections.c|2 ++
 board/actux1/u-boot.lds|   12 ++--
 board/actux2/u-boot.lds|   12 ++--
 board/actux3/u-boot.lds|   12 ++--
 board/dvlhost/u-boot.lds   |   12 ++--
 board/freescale/mx31ads/u-boot.lds |   12 ++--
 9 files changed, 74 insertions(+), 23 deletions(-)

diff --git a/arch/arm/cpu/ixp/u-boot.lds b/arch/arm/cpu/ixp/u-boot.lds
index 9141199..54bafda 100644
--- a/arch/arm/cpu/ixp/u-boot.lds
+++ b/arch/arm/cpu/ixp/u-boot.lds
@@ -60,10 +60,18 @@ SECTIONS
*(.__image_copy_end)
}
 
+   .rel_dyn_start :
+   {
+   *(.__rel_dyn_start)
+   }
+
.rel.dyn : {
-   __rel_dyn_start = .;
*(.rel*)
-   __rel_dyn_end = .;
+   }
+
+   .rel_dyn_end :
+   {
+   *(.__rel_dyn_end)
}
 
_end = .;
diff --git a/arch/arm/cpu/u-boot.lds b/arch/arm/cpu/u-boot.lds
index d7adf90..3037885 100644
--- a/arch/arm/cpu/u-boot.lds
+++ b/arch/arm/cpu/u-boot.lds
@@ -62,10 +62,18 @@ SECTIONS
*(.__image_copy_end)
}
 
+   .rel_dyn_start :
+   {
+   *(.__rel_dyn_start)
+   }
+
.rel.dyn : {
-   __rel_dyn_start = .;
*(.rel*)
-   __rel_dyn_end = .;
+   }
+
+   .rel_dyn_end :
+   {
+   *(.__rel_dyn_end)
}
 
_end = .;
diff --git a/arch/arm/lib/relocate.S b/arch/arm/lib/relocate.S
index 3767a95..3f444c1 100644
--- a/arch/arm/lib/relocate.S
+++ b/arch/arm/lib/relocate.S
@@ -55,10 +55,8 @@ copy_loop:
/*
 * fix .rel.dyn relocations
 */
-   ldr r2, _rel_dyn_start_ofs  /* r2 - __rel_dyn_start local ofs */
-   add r2, r2, r7  /* r2 - SRC __rel_dyn_start */
-   ldr r3, _rel_dyn_end_ofs/* r3 - __rel_dyn_end local ofs */
-   add r3, r3, r7  /* r3 - SRC __rel_dyn_end */
+   ldr r2, =__rel_dyn_start/* r2 - SRC __rel_dyn_start */
+   ldr r3, =__rel_dyn_end  /* r3 - SRC __rel_dyn_end */
 fixloop:
ldr r0, [r2]/* r0 - SRC location to fix up */
add r0, r0, r9  /* r0 - DST location to fix up */
@@ -88,9 +86,4 @@ relocate_done:
 bxlr
 #endif
 
-_rel_dyn_start_ofs:
-   .word __rel_dyn_start - relocate_code
-_rel_dyn_end_ofs:
-   .word __rel_dyn_end - relocate_code
-
 ENDPROC(relocate_code)
diff --git a/arch/arm/lib/sections.c b/arch/arm/lib/sections.c
index 03e846f..5921dd8 100644
--- a/arch/arm/lib/sections.c
+++ b/arch/arm/lib/sections.c
@@ -39,3 +39,5 @@ char __bss_start[0] __attribute__((section(.__bss_start)));
 char __bss_end[0] __attribute__((section(.__bss_end)));
 char __image_copy_start[0] __attribute__((section(.__image_copy_start)));
 char __image_copy_end[0] __attribute__((section(.__image_copy_end)));
+char __rel_dyn_start[0] __attribute__((section(.__rel_dyn_start)));
+char __rel_dyn_end[0] __attribute__((section(.__rel_dyn_end)));
diff --git a/board/actux1/u-boot.lds b/board/actux1/u-boot.lds
index 531e598..74aec5f 100644
--- a/board/actux1/u-boot.lds
+++ b/board/actux1/u-boot.lds
@@ -68,10 +68,18 @@ SECTIONS
*(.__image_copy_end)
}
 
+   .rel_dyn_start :
+   {
+   *(.__rel_dyn_start)
+   }
+
.rel.dyn : {
-   __rel_dyn_start = .;
*(.rel*)
-   __rel_dyn_end = .;
+   }
+
+   .rel_dyn_end :
+   {
+   *(.__rel_dyn_end)
}
 
_end = .;
diff --git a/board/actux2/u-boot.lds b/board/actux2/u-boot.lds
index aff773c..c276501 100644
--- a/board/actux2/u-boot.lds
+++ b/board/actux2/u-boot.lds
@@ -68,10 +68,18 @@ SECTIONS
*(.__image_copy_end)
}
 
+   .rel_dyn_start :
+   {
+   *(.__rel_dyn_start)
+   }
+
.rel.dyn : {
-   __rel_dyn_start = .;
*(.rel*)
-   __rel_dyn_end = .;
+   }
+
+   .rel_dyn_end :
+   {
+   *(.__rel_dyn_end)
}
 
_end = .;
diff --git a/board/actux3/u-boot.lds b/board/actux3/u-boot.lds
index 9d43e95..5610644 100644
--- a/board/actux3/u-boot.lds
+++ b/board/actux3/u-boot.lds
@@ -68,10 +68,18 @@ SECTIONS
*(.__image_copy_end)
}
 
+   .rel_dyn_start :
+   {

[U-Boot] [PATCH v3 4/6] arm: make __image_copy_{start, end} compiler-generated

2013-06-11 Thread Albert ARIBAUD
This change is only done where needed: some linker
scripts may contain __image_copy_{start,end} yet
remain unchanged.

Also, __image_copy_end needs its own section; putting
it in relocation sections changes their flags and makes
relocation break.

Signed-off-by: Albert ARIBAUD albert.u.b...@aribaud.net
---
Changes in v3:
- fix commit message typo (breaks - break)

Changes in v2: None

 arch/arm/cpu/arm920t/ep93xx/u-boot.lds |6 +-
 arch/arm/cpu/ixp/u-boot.lds|6 +-
 arch/arm/cpu/u-boot.lds|7 +--
 arch/arm/lib/relocate.S|7 ++-
 arch/arm/lib/sections.c|2 ++
 board/actux1/u-boot.lds|6 +-
 board/actux2/u-boot.lds|6 +-
 board/actux3/u-boot.lds|6 +-
 board/dvlhost/u-boot.lds   |6 +-
 board/freescale/mx31ads/u-boot.lds |6 +-
 10 files changed, 44 insertions(+), 14 deletions(-)

diff --git a/arch/arm/cpu/arm920t/ep93xx/u-boot.lds 
b/arch/arm/cpu/arm920t/ep93xx/u-boot.lds
index cf55bf7..367c805 100644
--- a/arch/arm/cpu/arm920t/ep93xx/u-boot.lds
+++ b/arch/arm/cpu/arm920t/ep93xx/u-boot.lds
@@ -31,6 +31,7 @@ SECTIONS
. = ALIGN(4);
.text  :
{
+   *(.__image_copy_start)
  arch/arm/cpu/arm920t/start.o  (.text*)
/* the EP93xx expects to find the pattern 'CRUS' at 0x1000 */
  . = 0x1000;
@@ -56,7 +57,10 @@ SECTIONS
 
. = ALIGN(4);
 
-   __image_copy_end = .;
+   .image_copy_end :
+   {
+   *(.__image_copy_end)
+   }
 
__bss_start = .;
.bss : { *(.bss*) }
diff --git a/arch/arm/cpu/ixp/u-boot.lds b/arch/arm/cpu/ixp/u-boot.lds
index 5cfff68..9141199 100644
--- a/arch/arm/cpu/ixp/u-boot.lds
+++ b/arch/arm/cpu/ixp/u-boot.lds
@@ -31,6 +31,7 @@ SECTIONS
. = ALIGN(4);
.text :
{
+   *(.__image_copy_start)
arch/arm/cpu/ixp/start.o(.text*)
*(.text*)
}
@@ -54,7 +55,10 @@ SECTIONS
 
. = ALIGN(4);
 
-   __image_copy_end = .;
+   .image_copy_end :
+   {
+   *(.__image_copy_end)
+   }
 
.rel.dyn : {
__rel_dyn_start = .;
diff --git a/arch/arm/cpu/u-boot.lds b/arch/arm/cpu/u-boot.lds
index fe2ca98..d7adf90 100644
--- a/arch/arm/cpu/u-boot.lds
+++ b/arch/arm/cpu/u-boot.lds
@@ -33,7 +33,7 @@ SECTIONS
. = ALIGN(4);
.text :
{
-   __image_copy_start = .;
+   *(.__image_copy_start)
CPUDIR/start.o (.text*)
*(.text*)
}
@@ -57,7 +57,10 @@ SECTIONS
 
. = ALIGN(4);
 
-   __image_copy_end = .;
+   .image_copy_end :
+   {
+   *(.__image_copy_end)
+   }
 
.rel.dyn : {
__rel_dyn_start = .;
diff --git a/arch/arm/lib/relocate.S b/arch/arm/lib/relocate.S
index 7a7c4c0..3767a95 100644
--- a/arch/arm/lib/relocate.S
+++ b/arch/arm/lib/relocate.S
@@ -39,13 +39,12 @@
 ENTRY(relocate_code)
mov r6, r0  /* save addr of destination */
 
-   ldr r0, =_start /* r0 - SRC _start */
+   ldr r0, =__image_copy_start /* r0 - SRC __image_copy_start */
subsr9, r6, r0  /* r9 - relocation offset */
beq relocate_done   /* skip relocation */
mov r1, r6  /* r1 - scratch for copy loop */
adr r7, relocate_code   /* r7 - SRC relocate_code */
-   ldr r3, _image_copy_end_ofs /* r3 - __image_copy_end local ofs */
-   add r2, r7, r3  /* r2 - SRC __image_copy_end */
+   ldr r2, =__image_copy_end   /* r2 - SRC __image_copy_end */
 
 copy_loop:
ldmia   r0!, {r10-r11}  /* copy from source address [r0]*/
@@ -89,8 +88,6 @@ relocate_done:
 bxlr
 #endif
 
-_image_copy_end_ofs:
-   .word __image_copy_end - relocate_code
 _rel_dyn_start_ofs:
.word __rel_dyn_start - relocate_code
 _rel_dyn_end_ofs:
diff --git a/arch/arm/lib/sections.c b/arch/arm/lib/sections.c
index e52fec9..03e846f 100644
--- a/arch/arm/lib/sections.c
+++ b/arch/arm/lib/sections.c
@@ -37,3 +37,5 @@
 
 char __bss_start[0] __attribute__((section(.__bss_start)));
 char __bss_end[0] __attribute__((section(.__bss_end)));
+char __image_copy_start[0] __attribute__((section(.__image_copy_start)));
+char __image_copy_end[0] __attribute__((section(.__image_copy_end)));
diff --git a/board/actux1/u-boot.lds b/board/actux1/u-boot.lds
index 989ad71..531e598 100644
--- a/board/actux1/u-boot.lds
+++ b/board/actux1/u-boot.lds
@@ -30,6 +30,7 @@ SECTIONS
 
. = ALIGN (4);
.text : {
+   *(.__image_copy_start)
arch/arm/cpu/ixp/start.o(.text*)
net/libnet.o(.text*)
board/actux1/libactux1.o(.text*)
@@ -62,7 +63,10 @@ SECTIONS
 
. = ALIGN (4);
 
-   __image_copy_end 

Re: [U-Boot] [PATCH v3 0/6] Optimize ARM relocation

2013-06-11 Thread Albert ARIBAUD
Hi Albert,

On Tue, 11 Jun 2013 14:17:29 +0200, Albert ARIBAUD
albert.u.b...@aribaud.net wrote:

 This series optimizes relocation by ensuring ARM
 binaries only use one type of relocation record,
 R_ARM_RELATIVE., then optimizing relocation code
 accordingly.

This is a cosmetic version only; if no one complains loudly, this
will be the final version too.

So people, as this touches ARM relocation, I would appreciate it if a
few people could test it on their own ARM HW target and see if they
still get a prompt, if command completion still works, etc.

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


[U-Boot] [PATCH v3 6/6] powerpc/ppc4xx: Remove CONFIG_SYS_FLASH_PROTECTION from gdsys boards

2013-06-11 Thread dirk . eibach
From: Dirk Eibach eib...@gdsys.de

CONFIG_SYS_FLASH_PROTECTION was active on most gdsys boards by default,
while hardware flash protection was not implemented.
Hardware support was added recently and we get into trouble because backward
compatibility is broken (u-boot can't unprotect the protected flash after a
downgrade). So we decided to disable hardware flash protection for all our 
boards.

Signed-off-by: Dirk Eibach dirk.eib...@gdsys.cc

Signed-off-by: Dirk Eibach dirk.eib...@gdsys.cc
---
Changes in v3: None
Changes in v2: None

 include/configs/dlvision-10g.h | 3 +--
 include/configs/dlvision.h | 3 +--
 include/configs/io.h   | 3 +--
 include/configs/iocon.h| 3 +--
 include/configs/neo.h  | 3 +--
 5 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/include/configs/dlvision-10g.h b/include/configs/dlvision-10g.h
index f2832d1..29bdbcb 100644
--- a/include/configs/dlvision-10g.h
+++ b/include/configs/dlvision-10g.h
@@ -34,7 +34,7 @@
  * Include common defines/options for all AMCC eval boards
  */
 #define CONFIG_HOSTNAMEdlvsion-10g
-#define CONFIG_IDENT_STRING dlvision-10g 0.03
+#define CONFIG_IDENT_STRING dlvision-10g 0.04
 #include amcc-common.h
 
 #define CONFIG_BOARD_EARLY_INIT_F
@@ -165,7 +165,6 @@
 #define CONFIG_SYS_FLASH_WRITE_TOUT500 /* Timeout for Flash Write/ms */
 
 #define CONFIG_SYS_FLASH_USE_BUFFER_WRITE 1/* use buff'd writes */
-#define CONFIG_SYS_FLASH_PROTECTION1   /* use hardware flash protect */
 
 #define CONFIG_SYS_FLASH_EMPTY_INFO/* 'E' for empty sector on flinfo */
 #define CONFIG_SYS_FLASH_QUIET_TEST1   /* no warn upon unknown flash */
diff --git a/include/configs/dlvision.h b/include/configs/dlvision.h
index 24c9fa4..948930e 100644
--- a/include/configs/dlvision.h
+++ b/include/configs/dlvision.h
@@ -34,7 +34,7 @@
  * Include common defines/options for all AMCC eval boards
  */
 #define CONFIG_HOSTNAMEdlvision
-#define CONFIG_IDENT_STRING dlvision 0.01
+#define CONFIG_IDENT_STRING dlvision 0.02
 #include amcc-common.h
 
 #define CONFIG_BOARD_EARLY_INIT_F  /* call board_early_init_f */
@@ -125,7 +125,6 @@
 #define CONFIG_SYS_FLASH_WRITE_TOUT500 /* Timeout for Flash Write/ms */
 
 #define CONFIG_SYS_FLASH_USE_BUFFER_WRITE 1/* use buff'd writes */
-#define CONFIG_SYS_FLASH_PROTECTION1   /* use hardware flash protect */
 
 #define CONFIG_SYS_FLASH_EMPTY_INFO/* 'E' for empty sector on flinfo */
 #define CONFIG_SYS_FLASH_QUIET_TEST1   /* no warn upon unknown flash */
diff --git a/include/configs/io.h b/include/configs/io.h
index 6693cba..6764cde 100644
--- a/include/configs/io.h
+++ b/include/configs/io.h
@@ -34,7 +34,7 @@
  * Include common defines/options for all AMCC eval boards
  */
 #define CONFIG_HOSTNAMEio
-#define CONFIG_IDENT_STRING io 0.05
+#define CONFIG_IDENT_STRING io 0.06
 #include amcc-common.h
 
 #define CONFIG_BOARD_EARLY_INIT_F
@@ -139,7 +139,6 @@
 #define CONFIG_SYS_FLASH_WRITE_TOUT500 /* Timeout for Flash Write/ms */
 
 #define CONFIG_SYS_FLASH_USE_BUFFER_WRITE 1/* use buff'd writes */
-#define CONFIG_SYS_FLASH_PROTECTION1   /* use hardware flash protect */
 
 #define CONFIG_SYS_FLASH_EMPTY_INFO/* 'E' for empty sector on flinfo */
 #define CONFIG_SYS_FLASH_QUIET_TEST1   /* no warn upon unknown flash */
diff --git a/include/configs/iocon.h b/include/configs/iocon.h
index 561837c..fd93e9f 100644
--- a/include/configs/iocon.h
+++ b/include/configs/iocon.h
@@ -34,7 +34,7 @@
  * Include common defines/options for all AMCC eval boards
  */
 #define CONFIG_HOSTNAMEiocon
-#define CONFIG_IDENT_STRING iocon 0.04
+#define CONFIG_IDENT_STRING iocon 0.05
 #include amcc-common.h
 
 #define CONFIG_BOARD_EARLY_INIT_F
@@ -188,7 +188,6 @@ int fpga_gpio_get(unsigned int bus, int pin);
 #define CONFIG_SYS_FLASH_WRITE_TOUT500 /* Timeout for Flash Write/ms */
 
 #define CONFIG_SYS_FLASH_USE_BUFFER_WRITE 1/* use buff'd writes */
-#define CONFIG_SYS_FLASH_PROTECTION1   /* use hardware flash protect */
 
 #define CONFIG_SYS_FLASH_EMPTY_INFO/* 'E' for empty sector on flinfo */
 #define CONFIG_SYS_FLASH_QUIET_TEST1   /* no warn upon unknown flash */
diff --git a/include/configs/neo.h b/include/configs/neo.h
index 328b745..2b63dee 100644
--- a/include/configs/neo.h
+++ b/include/configs/neo.h
@@ -35,7 +35,7 @@
  * Include common defines/options for all AMCC eval boards
  */
 #define CONFIG_HOSTNAMEneo
-#define CONFIG_IDENT_STRING neo 0.01
+#define CONFIG_IDENT_STRING neo 0.02
 #include amcc-common.h
 
 #define CONFIG_BOARD_EARLY_INIT_F
@@ -146,7 +146,6 @@
 #define CONFIG_SYS_FLASH_WRITE_TOUT500 /* Timeout for Flash Write (in 
ms)  */
 
 #define CONFIG_SYS_FLASH_USE_BUFFER_WRITE 1/* use buffered writes (20x 
faster) */
-#define CONFIG_SYS_FLASH_PROTECTION1   /* use hardware 

[U-Boot] [PATCH v3 4/6] powerpc/ppc4xx: Support gdsys multichannel iocon hardware

2013-06-11 Thread dirk . eibach
From: Dirk Eibach dirk.eib...@gdsys.cc

Signed-off-by: Dirk Eibach dirk.eib...@gdsys.cc

Signed-off-by: Dirk Eibach dirk.eib...@gdsys.cc
---
Changes in v3:
- adapt to powerpc/ppc4xx: Use generic accessor functions for gdsys FPGA
- squashed with powerpc/ppc4xx: Fixup phy erratum on gdsys iocon hardware

Changes in v2:
- fpga_state has been moved to arch_global_data
- include cmd_fpgad in iocon
- use multibus soft-i2c in iocon

 board/gdsys/405ep/iocon.c   | 458 
 board/gdsys/common/Makefile |   2 +-
 board/gdsys/common/osd.c|  12 +-
 include/configs/iocon.h |  56 +-
 include/gdsys_fpga.h|  15 +-
 5 files changed, 492 insertions(+), 51 deletions(-)

diff --git a/board/gdsys/405ep/iocon.c b/board/gdsys/405ep/iocon.c
index a531e5d..6e799e7 100644
--- a/board/gdsys/405ep/iocon.c
+++ b/board/gdsys/405ep/iocon.c
@@ -23,6 +23,7 @@
 
 #include common.h
 #include command.h
+#include errno.h
 #include asm/processor.h
 #include asm/io.h
 #include asm/ppc4xx-gpio.h
@@ -31,6 +32,15 @@
 #include gdsys_fpga.h
 
 #include ../common/osd.h
+#include ../common/mclink.h
+
+#include i2c.h
+#include pca953x.h
+#include pca9698.h
+
+#include miiphy.h
+
+DECLARE_GLOBAL_DATA_PTR;
 
 #define LATCH0_BASE (CONFIG_SYS_LATCH_BASE)
 #define LATCH1_BASE (CONFIG_SYS_LATCH_BASE + 0x100)
@@ -47,11 +57,20 @@ enum {
HWVER_100 = 0,
HWVER_104 = 1,
HWVER_110 = 2,
+   HWVER_120 = 3,
+   HWVER_200 = 4,
+   HWVER_210 = 5,
+};
+
+enum {
+   FPGA_HWVER_200 = 0,
+   FPGA_HWVER_210 = 1,
 };
 
 enum {
COMPRESSION_NONE = 0,
-   COMPRESSION_TYPE1_DELTA,
+   COMPRESSION_TYPE1_DELTA = 1,
+   COMPRESSION_TYPE1_TYPE2_DELTA = 3,
 };
 
 enum {
@@ -67,20 +86,67 @@ enum {
 
 enum {
RAM_DDR2_32 = 0,
+   RAM_DDR3_32 = 1,
 };
 
+enum {
+   MCFPGA_DONE = 1  0,
+   MCFPGA_INIT_N = 1  1,
+   MCFPGA_PROGRAM_N = 1  2,
+   MCFPGA_UPDATE_ENABLE_N = 1  3,
+   MCFPGA_RESET_N = 1  4,
+};
+
+enum {
+   GPIO_MDC = 1  14,
+   GPIO_MDIO = 1  15,
+};
+
+unsigned int mclink_fpgacount;
 struct ihs_fpga *fpga_ptr[] = CONFIG_SYS_FPGA_PTR;
 
+static int setup_88e1518(const char *bus, unsigned char addr);
+static int verify_88e1518(const char *bus, unsigned char addr);
+
 int fpga_set_reg(u32 fpga, u16 *reg, off_t regoff, u16 data)
 {
-   out_le16(reg, data);
+   int res;
+
+   switch (fpga) {
+   case 0:
+   out_le16(reg, data);
+   break;
+   default:
+   res = mclink_send(fpga - 1, regoff, data);
+   if (res  0) {
+   printf(mclink_send reg %02lx data %04x returned %d\n,
+  regoff, data, res);
+   return res;
+   }
+   break;
+   }
 
return 0;
 }
 
 int fpga_get_reg(u32 fpga, u16 *reg, off_t regoff, u16 *data)
 {
-   *data = in_le16(reg);
+   int res;
+
+   switch (fpga) {
+   case 0:
+   *data = in_le16(reg);
+   break;
+   default:
+   if (fpga  mclink_fpgacount)
+   return -EINVAL;
+   res = mclink_receive(fpga - 1, regoff, data);
+   if (res  0) {
+   printf(mclink_receive reg %02lx returned %d\n,
+  regoff, res);
+   return res;
+   }
+   }
 
return 0;
 }
@@ -106,7 +172,7 @@ int checkboard(void)
return 0;
 }
 
-static void print_fpga_info(void)
+static void print_fpga_info(unsigned int fpga)
 {
u16 versions;
u16 fpga_version;
@@ -120,13 +186,13 @@ static void print_fpga_info(void)
unsigned feature_ramconfig;
unsigned feature_carriers;
unsigned feature_video_channels;
+   int legacy = get_fpga_state(0)  FPGA_STATE_PLATFORM;
 
FPGA_GET_REG(0, versions, versions);
FPGA_GET_REG(0, fpga_version, fpga_version);
FPGA_GET_REG(0, fpga_features, fpga_features);
 
unit_type = (versions  0xf000)  12;
-   hardware_version = versions  0x000f;
feature_compression = (fpga_features  0xe000)  13;
feature_osd = fpga_features  (111);
feature_audio = (fpga_features  0x0600)  9;
@@ -135,6 +201,9 @@ static void print_fpga_info(void)
feature_carriers = (fpga_features  0x000c)  2;
feature_video_channels = fpga_features  0x0003;
 
+   if (legacy)
+   printf(legacy );
+
switch (unit_type) {
case UNITTYPE_MAIN_USER:
printf(Mainchannel);
@@ -149,27 +218,68 @@ static void print_fpga_info(void)
break;
}
 
-   switch (hardware_version) {
-   case HWVER_100:
-   printf( HW-Ver 1.00\n);
-   break;
-
-   case HWVER_104:
-   printf( HW-Ver 1.04\n);
-   break;
-
-   case HWVER_110:
-   printf( HW-Ver 1.10\n);
- 

[U-Boot] [PATCH v3 3/6] powerpc/ppc4xx: Add fpgad command for dumping gdsys fpga registers

2013-06-11 Thread dirk . eibach
From: Dirk Eibach dirk.eib...@gdsys.cc

Signed-off-by: Dirk Eibach dirk.eib...@gdsys.cc

Signed-off-by: Dirk Eibach dirk.eib...@gdsys.cc
---
Changes in v3:
- adapt to powerpc/ppc4xx: Use generic accessor functions for gdsys FPGA

Changes in v2:
- move cmd_fpgad to common and fix whitespace issues
- update email account

 common/Makefile|   1 +
 common/cmd_fpgad.c | 100 +
 2 files changed, 101 insertions(+)
 create mode 100644 common/cmd_fpgad.c

diff --git a/common/Makefile b/common/Makefile
index 0e0fff1..edabbad 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -110,6 +110,7 @@ COBJS-$(CONFIG_CMD_FLASH) += cmd_flash.o
 ifdef CONFIG_FPGA
 COBJS-$(CONFIG_CMD_FPGA) += cmd_fpga.o
 endif
+COBJS-$(CONFIG_CMD_FPGAD) += cmd_fpgad.o
 COBJS-$(CONFIG_CMD_FS_GENERIC) += cmd_fs.o
 COBJS-$(CONFIG_CMD_GETTIME) += cmd_gettime.o
 COBJS-$(CONFIG_CMD_GPIO) += cmd_gpio.o
diff --git a/common/cmd_fpgad.c b/common/cmd_fpgad.c
new file mode 100644
index 000..07536ff
--- /dev/null
+++ b/common/cmd_fpgad.c
@@ -0,0 +1,100 @@
+/*
+ * (C) Copyright 2013
+ * Dirk Eibach,  Guntermann  Drunck GmbH, dirk.eib...@gdsys.cc
+ *
+ * based on cmd_mem.c
+ * (C) Copyright 2000
+ * Wolfgang Denk, DENX Software Engineering, w...@denx.de.
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include common.h
+#include command.h
+
+#include gdsys_fpga.h
+
+static uintdp_last_fpga;
+static uintdp_last_addr;
+static uintdp_last_length = 0x40;
+
+/*
+ * FPGA Memory Display
+ *
+ * Syntax:
+ * fpgad {fpga} {addr} {len}
+ */
+#define DISP_LINE_LEN  16
+int do_fpga_md(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+{
+   unsigned int k;
+   unsigned int fpga;
+   ulong   addr, length;
+   int rc = 0;
+   u16 linebuf[DISP_LINE_LEN/sizeof(u16)];
+
+   /*
+* We use the last specified parameters, unless new ones are
+* entered.
+*/
+   fpga = dp_last_fpga;
+   addr = dp_last_addr;
+   length = dp_last_length;
+
+   if (argc  3)
+   return CMD_RET_USAGE;
+
+   if ((flag  CMD_FLAG_REPEAT) == 0) {
+   /*
+* FPGA is specified since argc  2
+*/
+   fpga = simple_strtoul(argv[1], NULL, 16);
+
+   /*
+* Address is specified since argc  2
+*/
+   addr = simple_strtoul(argv[2], NULL, 16);
+
+   /*
+* If another parameter, it is the length to display.
+* Length is the number of objects, not number of bytes.
+*/
+   if (argc  3)
+   length = simple_strtoul(argv[3], NULL, 16);
+   }
+
+   /* Print the lines. */
+   for (k = 0; k  DISP_LINE_LEN / sizeof(u16); ++k)
+   fpga_get_reg(fpga, (u16 *)fpga_ptr[fpga] + k, k * sizeof(u16),
+linebuf[k]);
+   print_buffer(addr, (void *)linebuf, sizeof(u16),
+length, DISP_LINE_LEN / sizeof(u16));
+   addr += sizeof(u16)*length;
+
+   dp_last_fpga = fpga;
+   dp_last_addr = addr;
+   dp_last_length = length;
+   return rc;
+}
+
+U_BOOT_CMD(
+   fpgad,  4,  1,  do_fpga_md,
+   fpga register display,
+   fpga address [# of objects]
+);
-- 
1.8.3

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


[U-Boot] [PATCH v3 5/6] powerpc/ppc4xx: Consider gdsys FPGA OSD size

2013-06-11 Thread dirk . eibach
From: Dirk Eibach eib...@gdsys.de

OSD size was constant 32x16 characters.
Now the size is set as announced by the FPGA.

Signed-off-by: Dirk Eibach dirk.eib...@gdsys.cc
---
Changes in v3: None
Changes in v2: None

 board/gdsys/common/osd.c | 34 ++
 1 file changed, 18 insertions(+), 16 deletions(-)

diff --git a/board/gdsys/common/osd.c b/board/gdsys/common/osd.c
index 5ddd098..ba8c6e1 100644
--- a/board/gdsys/common/osd.c
+++ b/board/gdsys/common/osd.c
@@ -42,10 +42,6 @@
 
 #define PIXCLK_640_480_60 2518
 
-#define BASE_WIDTH 32
-#define BASE_HEIGHT 16
-#define BUFSIZE (BASE_WIDTH * BASE_HEIGHT)
-
 enum {
CH7301_CM = 0x1c,   /* Clock Mode Register */
CH7301_IC = 0x1d,   /* Input Clock Register */
@@ -67,6 +63,11 @@ enum {
CH7301_DSP = 0x56,  /* DVI Sync polarity Register */
 };
 
+unsigned int base_width;
+unsigned int base_height;
+size_t bufsize;
+u16 *buf;
+
 unsigned int max_osd_screen = CONFIG_SYS_OSD_SCREENS - 1;
 
 #ifdef CONFIG_SYS_CH7301
@@ -280,7 +281,7 @@ static int osd_write_videomem(unsigned screen, unsigned 
offset,
unsigned int k;
 
for (k = 0; k  charcount; ++k) {
-   if (offset + k = BUFSIZE)
+   if (offset + k = bufsize)
return -1;
FPGA_SET_REG(screen, videomem[offset + k], data[k]);
}
@@ -299,7 +300,6 @@ static int osd_print(cmd_tbl_t *cmdtp, int flag, int argc, 
char * const argv[])
unsigned len;
u8 color;
unsigned int k;
-   u16 buf[BUFSIZE];
char *text;
int res;
 
@@ -313,12 +313,12 @@ static int osd_print(cmd_tbl_t *cmdtp, int flag, int 
argc, char * const argv[])
color = simple_strtoul(argv[3], NULL, 16);
text = argv[4];
charcount = strlen(text);
-   len = (charcount  BUFSIZE) ? BUFSIZE : charcount;
+   len = (charcount  bufsize) ? bufsize : charcount;
 
for (k = 0; k  len; ++k)
buf[k] = (text[k]  8) | color;
 
-   res = osd_write_videomem(screen, y * BASE_WIDTH + x, buf, len);
+   res = osd_write_videomem(screen, y * base_width + x, buf, len);
if (res  0)
return res;
}
@@ -330,8 +330,6 @@ int osd_probe(unsigned screen)
 {
u16 version;
u16 features;
-   unsigned width;
-   unsigned height;
u8 value;
 #ifdef CONFIG_SYS_CH7301
int old_bus = i2c_get_bus_num();
@@ -340,11 +338,15 @@ int osd_probe(unsigned screen)
FPGA_GET_REG(0, osd.version, version);
FPGA_GET_REG(0, osd.features, features);
 
-   width = ((features  0x3f00)  8) + 1;
-   height = (features  0x001f) + 1;
+   base_width = ((features  0x3f00)  8) + 1;
+   base_height = (features  0x001f) + 1;
+   bufsize = base_width * base_height;
+   buf = malloc(sizeof(u16) * bufsize);
+   if (!buf)
+   return -1;
 
printf(OSD%d:  Digital-OSD version %01d.%02d, %d x%d characters\n,
-   screen, version/100, version%100, width, height);
+   screen, version/100, version%100, base_width, base_height);
 
 #ifdef CONFIG_SYS_CH7301
i2c_set_bus_num(ch7301_i2c[screen]);
@@ -410,7 +412,7 @@ int osd_write(cmd_tbl_t *cmdtp, int flag, int argc, char * 
const argv[])
unsigned x;
unsigned y;
unsigned k;
-   u16 buffer[BASE_WIDTH];
+   u16 buffer[base_width];
char *rp;
u16 *wp = buffer;
unsigned count = (argc  4) ?
@@ -435,13 +437,13 @@ int osd_write(cmd_tbl_t *cmdtp, int flag, int argc, char 
* const argv[])
 
rp += 4;
wp++;
-   if (wp - buffer  BASE_WIDTH)
+   if (wp - buffer  base_width)
break;
}
 
for (k = 0; k  count; ++k) {
unsigned offset =
-   y * BASE_WIDTH + x + k * (wp - buffer);
+   y * base_width + x + k * (wp - buffer);
osd_write_videomem(screen, offset, buffer,
wp - buffer);
}
-- 
1.8.3

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


[U-Boot] [PATCH v3 1/6] powerpc/ppc4xx: Use generic accessor functions for gdsys FPGA

2013-06-11 Thread dirk . eibach
From: Dirk Eibach eib...@gdsys.de

A set of accessor functions was added to be able to access not only
memory mapped FPGA in a generic way.

Thanks to Wolfgang Denk for getting this sorted properly.

Signed-off-by: Dirk Eibach dirk.eib...@gdsys.cc

Signed-off-by: Dirk Eibach dirk.eib...@gdsys.cc
---
Changes in v3:
- squashed with Add generic accessor functions for gdsys FPGA
- strictly replace base address plus offset with  proper C structs

Changes in v2: None

 board/gdsys/405ep/405ep.c| 20 +--
 board/gdsys/405ep/dlvision-10g.c | 32 +
 board/gdsys/405ep/io.c   | 30 
 board/gdsys/405ep/iocon.c| 37 
 board/gdsys/405ep/neo.c  | 27 ---
 board/gdsys/405ex/405ex.c| 20 +--
 board/gdsys/405ex/io64.c | 48 +-
 board/gdsys/common/osd.c | 74 +++-
 include/configs/dlvision-10g.h   |  4 +++
 include/configs/io.h |  3 ++
 include/configs/io64.h   |  4 +++
 include/configs/iocon.h  |  3 ++
 include/configs/neo.h|  3 ++
 include/gdsys_fpga.h | 43 ++-
 14 files changed, 247 insertions(+), 101 deletions(-)

diff --git a/board/gdsys/405ep/405ep.c b/board/gdsys/405ep/405ep.c
index 6221171..4553a39 100644
--- a/board/gdsys/405ep/405ep.c
+++ b/board/gdsys/405ep/405ep.c
@@ -106,23 +106,21 @@ int board_early_init_r(void)
gd405ep_set_fpga_reset(0);
 
for (k = 0; k  CONFIG_SYS_FPGA_COUNT; ++k) {
-   struct ihs_fpga *fpga =
-   (struct ihs_fpga *)CONFIG_SYS_FPGA_BASE(k);
-#ifdef CONFIG_SYS_FPGA_NO_RFL_HI
-   u16 *reflection_target = fpga-reflection_low;
-#else
-   u16 *reflection_target = fpga-reflection_high;
-#endif
/*
 * wait for fpga out of reset
 */
ctr = 0;
while (1) {
-   out_le16(fpga-reflection_low,
-   REFLECTION_TESTPATTERN);
+   u16 val;
+
+   FPGA_SET_REG(k, reflection_low, REFLECTION_TESTPATTERN);
 
-   if (in_le16(reflection_target) ==
-   REFLECTION_TESTPATTERN_INV)
+#ifdef CONFIG_SYS_FPGA_NO_RFL_HI
+   FPGA_GET_REG(k, reflection_low, val);
+#else
+   FPGA_GET_REG(k, reflection_high, val);
+#endif
+   if (val == REFLECTION_TESTPATTERN_INV)
break;
 
udelay(10);
diff --git a/board/gdsys/405ep/dlvision-10g.c b/board/gdsys/405ep/dlvision-10g.c
index 644493b..332d82f 100644
--- a/board/gdsys/405ep/dlvision-10g.c
+++ b/board/gdsys/405ep/dlvision-10g.c
@@ -71,6 +71,22 @@ enum {
RAM_DDR2_64 = 2,
 };
 
+struct ihs_fpga *fpga_ptr[] = CONFIG_SYS_FPGA_PTR;
+
+int fpga_set_reg(u32 fpga, u16 *reg, off_t regoff, u16 data)
+{
+   out_le16(reg, data);
+
+   return 0;
+}
+
+int fpga_get_reg(u32 fpga, u16 *reg, off_t regoff, u16 *data)
+{
+   *data = in_le16(reg);
+
+   return 0;
+}
+
 int misc_init_r(void)
 {
/* startup fans */
@@ -95,10 +111,9 @@ static unsigned int get_mc2_present(void)
 
 static void print_fpga_info(unsigned dev)
 {
-   struct ihs_fpga *fpga = (struct ihs_fpga *) CONFIG_SYS_FPGA_BASE(dev);
-   u16 versions = in_le16(fpga-versions);
-   u16 fpga_version = in_le16(fpga-fpga_version);
-   u16 fpga_features = in_le16(fpga-fpga_features);
+   u16 versions;
+   u16 fpga_version;
+   u16 fpga_features;
unsigned unit_type;
unsigned hardware_version;
unsigned feature_rs232;
@@ -112,6 +127,10 @@ static void print_fpga_info(unsigned dev)
 
printf(FPGA%d: , dev);
 
+   FPGA_GET_REG(dev, versions, versions);
+   FPGA_GET_REG(dev, fpga_version, fpga_version);
+   FPGA_GET_REG(dev, fpga_features, fpga_features);
+
hardware_version = versions  0x000f;
 
if (fpga_state
@@ -263,8 +282,9 @@ int checkboard(void)
 
 int last_stage_init(void)
 {
-   struct ihs_fpga *fpga = (struct ihs_fpga *) CONFIG_SYS_FPGA_BASE(0);
-   u16 versions = in_le16(fpga-versions);
+   u16 versions;
+
+   FPGA_GET_REG(0, versions, versions);
 
print_fpga_info(0);
if (get_mc2_present())
diff --git a/board/gdsys/405ep/io.c b/board/gdsys/405ep/io.c
index 070dcbb..05707c4 100644
--- a/board/gdsys/405ep/io.c
+++ b/board/gdsys/405ep/io.c
@@ -53,6 +53,22 @@ enum {
HWVER_122 = 3,
 };
 
+struct ihs_fpga *fpga_ptr[] = CONFIG_SYS_FPGA_PTR;
+
+int fpga_set_reg(u32 fpga, u16 *reg, off_t regoff, u16 data)
+{
+   out_le16(reg, data);
+
+   return 0;
+}
+
+int fpga_get_reg(u32 fpga, u16 *reg, off_t regoff, u16 *data)
+{
+   *data = in_le16(reg);
+
+   return 0;
+}
+
 int misc_init_r(void)
 {
/* startup fans */
@@ -117,15 +133,18 

[U-Boot] [PATCH v3 2/6] powerpc/ppc4xx: Add gdsys mclink interface

2013-06-11 Thread dirk . eibach
From: Dirk Eibach eib...@gdsys.de

mclink is a serial interface for communication between gdsys FPGA.

Signed-off-by: Dirk Eibach dirk.eib...@gdsys.cc

Signed-off-by: Dirk Eibach dirk.eib...@gdsys.cc
---
Changes in v3:
- adapt to powerpc/ppc4xx: Use generic accessor functions for gdsys FPGA
- squashed with powerpc/ppc4xx: Increase timeout for gdsys mclink bus startup

Changes in v2:
- update email account

 board/gdsys/common/mclink.c | 153 
 board/gdsys/common/mclink.h |  31 +
 2 files changed, 184 insertions(+)
 create mode 100644 board/gdsys/common/mclink.c
 create mode 100644 board/gdsys/common/mclink.h

diff --git a/board/gdsys/common/mclink.c b/board/gdsys/common/mclink.c
new file mode 100644
index 000..e0382a3
--- /dev/null
+++ b/board/gdsys/common/mclink.c
@@ -0,0 +1,153 @@
+/*
+ * (C) Copyright 2012
+ * Dirk Eibach,  Guntermann  Drunck GmbH, dirk.eib...@gdsys.cc
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include common.h
+#include asm/io.h
+#include errno.h
+
+#include gdsys_fpga.h
+
+enum {
+   MCINT_SLAVE_LINK_CHANGED_EV = 1  7,
+   MCINT_TX_ERROR_EV = 1  9,
+   MCINT_TX_BUFFER_FREE = 1  10,
+   MCINT_TX_PACKET_TRANSMITTED_EV = 1  11,
+   MCINT_RX_ERROR_EV = 1  13,
+   MCINT_RX_CONTENT_AVAILABLE = 1  14,
+   MCINT_RX_PACKET_RECEIVED_EV = 1  15,
+};
+
+int mclink_probe(void)
+{
+   unsigned int k;
+   int slaves = 0;
+
+   for (k = 0; k  CONFIG_SYS_MCLINK_MAX; ++k) {
+   int timeout = 0;
+   unsigned int ctr = 0;
+   u16 mc_status;
+
+   FPGA_GET_REG(k, mc_status, mc_status);
+
+   if (!(mc_status  (1  15)))
+   break;
+
+   FPGA_SET_REG(k, mc_control, 0x8000);
+
+   FPGA_GET_REG(k, mc_status, mc_status);
+   while (!(mc_status  (1  14))) {
+   udelay(100);
+   if (ctr++  500) {
+   timeout = 1;
+   break;
+   }
+   FPGA_GET_REG(k, mc_status, mc_status);
+   }
+   if (timeout)
+   break;
+
+   printf(waited %d us for mclink %d to come up\n, ctr * 100, k);
+
+   slaves++;
+   }
+
+   return slaves;
+}
+
+int mclink_send(u8 slave, u16 addr, u16 data)
+{
+   unsigned int ctr = 0;
+   u16 int_status;
+   u16 rx_cmd_status;
+   u16 rx_cmd;
+
+   /* reset interrupt status */
+   FPGA_GET_REG(0, mc_int, int_status);
+   FPGA_SET_REG(0, mc_int, int_status);
+
+   /* send */
+   FPGA_SET_REG(0, mc_tx_address, addr);
+   FPGA_SET_REG(0, mc_tx_data, data);
+   FPGA_SET_REG(0, mc_tx_cmd, (slave  0x03)  14);
+   FPGA_SET_REG(0, mc_control, 0x8001);
+
+   /* wait for reply */
+   FPGA_GET_REG(0, mc_int, int_status);
+   while (!(int_status  MCINT_RX_PACKET_RECEIVED_EV)) {
+   udelay(100);
+   if (ctr++  3)
+   return -ETIMEDOUT;
+   FPGA_GET_REG(0, mc_int, int_status);
+   }
+
+   FPGA_GET_REG(0, mc_rx_cmd_status, rx_cmd_status);
+   rx_cmd = (rx_cmd_status  12)  0x03;
+   if (rx_cmd != 0)
+   printf(mclink_send: received cmd %d, expected %d\n, rx_cmd,
+  0);
+
+   return 0;
+}
+
+int mclink_receive(u8 slave, u16 addr, u16 *data)
+{
+   u16 rx_cmd_status;
+   u16 rx_cmd;
+   u16 int_status;
+   unsigned int ctr = 0;
+
+   /* send read request */
+   FPGA_SET_REG(0, mc_tx_address, addr);
+   FPGA_SET_REG(0, mc_tx_cmd,
+((slave  0x03)  14) | (1  12) | (1  0));
+   FPGA_SET_REG(0, mc_control, 0x8001);
+
+
+   /* wait for reply */
+   FPGA_GET_REG(0, mc_int, int_status);
+   while (!(int_status  MCINT_RX_CONTENT_AVAILABLE)) {
+   udelay(100);
+   if (ctr++  3)
+   return -ETIMEDOUT;
+   FPGA_GET_REG(0, mc_int, int_status);
+   }
+
+   /* check reply */
+   FPGA_GET_REG(0, mc_rx_cmd_status, rx_cmd_status);
+   if ((rx_cmd_status  14) != 

[U-Boot] [PATCH v3 0/6] Update gdsys ppc4xx-based boards

2013-06-11 Thread dirk . eibach
From: Dirk Eibach dirk.eib...@gdsys.cc


This series depends on the Bring in new I2C framework series by Heiko 
Schocher.
Patch powerpc/ppc4xx: Add bitbang i2c interface for gdsys boards was dropped 
in
favor of using the new framework.

Changes in v3:
- adapt to powerpc/ppc4xx: Use generic accessor functions for gdsys FPGA
- squashed with Add generic accessor functions for gdsys FPGA
- squashed with powerpc/ppc4xx: Increase timeout for gdsys mclink bus startup
- squashed with powerpc/ppc4xx: Fixup phy erratum on gdsys iocon hardware
- strictly replace base address plus offset with  proper C structs

Changes in v2:
- fpga_state has been moved to arch_global_data
- include cmd_fpgad in iocon
- move cmd_fpgad to common and fix whitespace issues
- update email account
- use multibus soft-i2c in iocon

Dirk Eibach (6):
  powerpc/ppc4xx: Use generic accessor functions for gdsys FPGA
  powerpc/ppc4xx: Add gdsys mclink interface
  powerpc/ppc4xx: Add fpgad command for dumping gdsys fpga registers
  powerpc/ppc4xx: Support gdsys multichannel iocon hardware
  powerpc/ppc4xx: Consider gdsys FPGA OSD size
  powerpc/ppc4xx: Remove CONFIG_SYS_FLASH_PROTECTION from gdsys boards

 board/gdsys/405ep/405ep.c|  20 +-
 board/gdsys/405ep/dlvision-10g.c |  32 ++-
 board/gdsys/405ep/io.c   |  30 ++-
 board/gdsys/405ep/iocon.c| 485 +++
 board/gdsys/405ep/neo.c  |  27 ++-
 board/gdsys/405ex/405ex.c|  20 +-
 board/gdsys/405ex/io64.c |  48 ++--
 board/gdsys/common/Makefile  |   2 +-
 board/gdsys/common/mclink.c  | 153 
 board/gdsys/common/mclink.h  |  31 +++
 board/gdsys/common/osd.c | 118 ++
 common/Makefile  |   1 +
 common/cmd_fpgad.c   | 100 
 include/configs/dlvision-10g.h   |   7 +-
 include/configs/dlvision.h   |   3 +-
 include/configs/io.h |   6 +-
 include/configs/io64.h   |   4 +
 include/configs/iocon.h  |  60 -
 include/configs/neo.h|   6 +-
 include/gdsys_fpga.h |  58 -
 20 files changed, 1040 insertions(+), 171 deletions(-)
 create mode 100644 board/gdsys/common/mclink.c
 create mode 100644 board/gdsys/common/mclink.h
 create mode 100644 common/cmd_fpgad.c

-- 
1.8.3

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


Re: [U-Boot] [PATCH v3 0/6] Optimize ARM relocation

2013-06-11 Thread Lubomir Popov
Hi Albert,

On 11/06/13 15:47, Albert ARIBAUD wrote:
 Hi Albert,
 
 On Tue, 11 Jun 2013 14:17:29 +0200, Albert ARIBAUD
 albert.u.b...@aribaud.net wrote:
 
 This series optimizes relocation by ensuring ARM
 binaries only use one type of relocation record,
 R_ARM_RELATIVE., then optimizing relocation code
 accordingly.
 
 This is a cosmetic version only; if no one complains loudly, this
 will be the final version too.
 
 So people, as this touches ARM relocation, I would appreciate it if a
 few people could test it on their own ARM HW target and see if they
 still get a prompt, if command completion still works, etc.

Applied the series to a relatively fresh (yesterday's) u-boot-ti/master
and tested on a custom OMAP5430 board. Boots normally. USB storage and
Ethernet (dhcp  ping), SD/MMC, I2C are all working.

Tested-by: Lubomir Popov lpo...@mm-sol.com

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


Re: [U-Boot] [PATCH v2] exynos5250: move board specific configs to board specific config file

2013-06-11 Thread Simon Glass
Hi,

On Fri, Jun 7, 2013 at 4:56 AM, Inderpal Singh inderpal.si...@linaro.orgwrote:

 Not all boards based on exynos5250 have SPI flash, same serial port and
 might
 not require display and the same lds script. Hence move them to board
 specific
 config file.


At least for the serial port this should be controlled by the device tree.
There are quite a lot of pending patches for exynos, one of which enables
this and removes the need for the CONFIG_SERIAL3 define.

If you want to have a look, I pushed them to:

http://git.denx.de/u-boot-x86.git in branch 'snow'



 Signed-off-by: Inderpal Singh inderpal.si...@linaro.org
 ---
 v1 was posted as the second patch of [1]

 Changes in v2:
 - split from the patchset at [1]
 - moved CONFIG_LCD and CONFIG_SPI_FLASH
 - rebased to latest u-boot-samsung master branch

 [1] http://comments.gmane.org/gmane.comp.boot-loaders.u-boot/157101

  include/configs/exynos5250-dt.h |   11 +--
  include/configs/smdk5250.h  |   16 ++--
  include/configs/snow.h  |   16 ++--
  3 files changed, 29 insertions(+), 14 deletions(-)

 diff --git a/include/configs/exynos5250-dt.h
 b/include/configs/exynos5250-dt.h
 index 03b07b2..22e47eb 100644
 --- a/include/configs/exynos5250-dt.h
 +++ b/include/configs/exynos5250-dt.h
 @@ -29,7 +29,6 @@
  #define CONFIG_SAMSUNG /* in a SAMSUNG core */
  #define CONFIG_S5P /* S5P Family */
  #define CONFIG_EXYNOS5 /* which is in a Exynos5 Family */
 -#define CONFIG_SMDK5250/* which is in a SMDK5250
 */


This is a misnomer - it actually means Exynos 5250 I think. The only thing
it controls is the generation of the SPL packaging tool. So for now it
should be defined for all Exynos5250 boards.



  #include asm/arch/cpu.h  /* get chip and board defs */

 @@ -78,7 +77,6 @@
  #define CONFIG_SYS_MALLOC_LEN  (CONFIG_ENV_SIZE + (4  20))

  /* select serial console configuration */
 -#define CONFIG_SERIAL3 /* use SERIAL 3 */
  #define CONFIG_BAUDRATE115200
  #define EXYNOS5_DEFAULT_UART_OFFSET0x01

 @@ -148,8 +146,6 @@
  #define CONFIG_SPL
  #define COPY_BL2_FNPTR_ADDR0x02020030

 -/* specific .lds file */
 -#define CONFIG_SPL_LDSCRIPT
  board/samsung/smdk5250/smdk5250-uboot-spl.lds


Again I suspect this is a misnomer.


  #define CONFIG_SPL_TEXT_BASE   0x02023400
  #define CONFIG_SPL_MAX_FOOTPRINT   (14 * 1024)

 @@ -158,7 +154,7 @@
  /* Miscellaneous configurable options */
  #define CONFIG_SYS_LONGHELP/* undef to save memory */
  #define CONFIG_SYS_HUSH_PARSER /* use hush command parser*/
 -#define CONFIG_SYS_PROMPT  SMDK5250 # 
 +#define CONFIG_SYS_PROMPT  EXYNOS5250 # 
  #define CONFIG_SYS_CBSIZE  256 /* Console I/O Buffer Size
 */
  #define CONFIG_SYS_PBSIZE  384 /* Print Buffer Size */
  #define CONFIG_SYS_MAXARGS 16  /* max number of command
 args */
 @@ -198,7 +194,6 @@
  /* FLASH and environment organization */
  #define CONFIG_SYS_NO_FLASH
  #undef CONFIG_CMD_IMLS
 -#define CONFIG_IDENT_STRING for SMDK5250

  #define CONFIG_SYS_MMC_ENV_DEV 0

 @@ -247,9 +242,6 @@
  #define CONFIG_I2C_EDID

  /* SPI */
 -#define CONFIG_ENV_IS_IN_SPI_FLASH
 -#define CONFIG_SPI_FLASH
 -
  #ifdef CONFIG_SPI_FLASH
  #define CONFIG_EXYNOS_SPI
  #define CONFIG_CMD_SF
 @@ -306,7 +298,6 @@
  #define CONFIG_SHA256

  /* Display */
 -#define CONFIG_LCD
  #ifdef CONFIG_LCD
  #define CONFIG_EXYNOS_FB
  #define CONFIG_EXYNOS_DP
 diff --git a/include/configs/smdk5250.h b/include/configs/smdk5250.h
 index 81f83a8..4af1909 100644
 --- a/include/configs/smdk5250.h
 +++ b/include/configs/smdk5250.h
 @@ -25,9 +25,21 @@
  #ifndef __CONFIG_SMDK_H
  #define __CONFIG_SMDK_H

 -#include configs/exynos5250-dt.h
 -
  #undef CONFIG_DEFAULT_DEVICE_TREE
  #define CONFIG_DEFAULT_DEVICE_TREE exynos5250-smdk5250

 +#define CONFIG_SMDK5250/* which is in a SMDK5250
 */
 +#define CONFIG_SERIAL3 /* use SERIAL 3 */
 +
 +/* specific .lds file */
 +#define CONFIG_SPL_LDSCRIPT
  board/samsung/smdk5250/smdk5250-uboot-spl.lds
 +#define CONFIG_IDENT_STRING for SMDK5250
 +#define CONFIG_SPI_FLASH
 +#define CONFIG_ENV_IS_IN_SPI_FLASH
 +
 +/* Display */
 +#define CONFIG_LCD
 +
 +#include configs/exynos5250-dt.h
 +
  #endif /* __CONFIG_SMDK_H */
 diff --git a/include/configs/snow.h b/include/configs/snow.h
 index b8460fd..e940c69 100644
 --- a/include/configs/snow.h
 +++ b/include/configs/snow.h
 @@ -25,9 +25,21 @@
  #ifndef __CONFIG_SNOW_H
  #define __CONFIG_SNOW_H

 -#include configs/exynos5250-dt.h
 -
  #undef CONFIG_DEFAULT_DEVICE_TREE
  #define CONFIG_DEFAULT_DEVICE_TREE exynos5250-snow

 +#define CONFIG_SMDK5250/* which is in a SMDK5250
 */
 +#define CONFIG_SERIAL3 /* use SERIAL 3 

Re: [U-Boot] [GIT PULL] u-boot-mips/fixes

2013-06-11 Thread Tom Rini
On Sat, Jun 08, 2013 at 11:21:19PM +0200, Daniel Schwierzeck wrote:

 Hi Tom,
 
 please pull two fixes for MIPS. These patches and [1] are required to
 cleanly run 'MAKEALL -a mips' again on master.
 
 [1] http://patchwork.ozlabs.org/patch/249980/
 
 
 The following changes since commit 842033e6964e9e5d34aca893c1845416dd8ac2cc:
 
   pci: introduce CONFIG_PCI_INDIRECT_BRIDGE option (2013-06-07 14:17:01 -0400)
 
 are available in the git repository at:
 
   git://git.denx.de/u-boot-mips.git fixes
 
 for you to fetch changes up to e1208c2fe5e07f9a248cfbf9bbb212aa34ad2806:
 
   MIPS: asm/errno.h: switch to asm-generic/errno.h (2013-06-08 23:10:10 +0200)
 
 
 Daniel Schwierzeck (1):
   MIPS: asm/errno.h: switch to asm-generic/errno.h
 
 Gabor Juhos (1):
   MIPS: fix __raw_* IO accessors
 
  arch/mips/include/asm/errno.h | 144
 +--
  arch/mips/include/asm/io.h|  26 -
  2 files changed, 14 insertions(+), 156 deletions(-)

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [PATCH] spi: armada100_spi: Remove unnecessary NULL test for dout and din

2013-06-11 Thread Simon Glass
On Tue, Jun 11, 2013 at 6:57 AM, Axel Lin axel@ingics.com wrote:

 Signed-off-by: Axel Lin axel@ingics.com


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


 ---
  drivers/spi/armada100_spi.c | 11 ++-
  1 file changed, 2 insertions(+), 9 deletions(-)

 diff --git a/drivers/spi/armada100_spi.c b/drivers/spi/armada100_spi.c
 index afdbe05..b237c7c 100644
 --- a/drivers/spi/armada100_spi.c
 +++ b/drivers/spi/armada100_spi.c
 @@ -182,15 +182,8 @@ int spi_xfer(struct spi_slave *slave, unsigned int
 bitlen, const void *dout,
 goto done;
 }

 -   if (dout)
 -   pss-tx = dout;
 -   else
 -   pss-tx = NULL;
 -
 -   if (din)
 -   pss-rx = din;
 -   else
 -   pss-rx = NULL;
 +   pss-tx = dout;
 +   pss-rx = din;

 if (flags  SPI_XFER_BEGIN) {
 spi_cs_activate(slave);
 --
 1.8.1.2




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


[U-Boot] [PATCH] spi: armada100_spi: Remove unnecessary NULL test for dout and din

2013-06-11 Thread Axel Lin
Signed-off-by: Axel Lin axel@ingics.com
---
 drivers/spi/armada100_spi.c | 11 ++-
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/drivers/spi/armada100_spi.c b/drivers/spi/armada100_spi.c
index afdbe05..b237c7c 100644
--- a/drivers/spi/armada100_spi.c
+++ b/drivers/spi/armada100_spi.c
@@ -182,15 +182,8 @@ int spi_xfer(struct spi_slave *slave, unsigned int bitlen, 
const void *dout,
goto done;
}
 
-   if (dout)
-   pss-tx = dout;
-   else
-   pss-tx = NULL;
-
-   if (din)
-   pss-rx = din;
-   else
-   pss-rx = NULL;
+   pss-tx = dout;
+   pss-rx = din;
 
if (flags  SPI_XFER_BEGIN) {
spi_cs_activate(slave);
-- 
1.8.1.2



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


Re: [U-Boot] [Patch] fsl_esdhc: Fix DMA transfer completion waiting loop

2013-06-11 Thread Gabbasov, Andrew
Hi Dirk,

 From: Behme, Dirk - Bosch
 Sent: Tuesday, June 11, 2013 12:16
 To: Gabbasov, Andrew
 Cc: u-boot@lists.denx.de; Stefano Babic; Fleming Andy-AFLEMING
 Subject: Re: [U-Boot] [Patch] fsl_esdhc: Fix DMA transfer completion waiting 
 loop
 
 On 10.06.2013 16:51, Gabbasov, Andrew wrote:
  Hi Dirk,

[ skipped ]

 
  I haven't tested this myself, but I got the following issue report
  regarding this patch:
 
  Using a SANDISK ULTRA II 8GB card (or alternatively Transcend 16GB or
  32GB cards) and trying an mmc write [1] into the upper area of the 8GB
  card makes the write hang in 9 of 10 cases. Sometimes even more.
  Reverting this patch make these writes work again.
 
  mmc read does work fine, though. Even newer SANDISK Extreme III or
  several micro SD cards are working fine.
 
  Any idea?
 
  Best regards
 
  Dirk
 
  So far the only idea that comes into my mind is that DMA for some reason 
  completes
  its part of work too early so that the corresponding interrupt status bit 
  appears and
  has already been cleared even before entering this loop.
 
  I will be trying to reproduce the issue.
 
  Meanwhile, is it possible to ask the reporter (who obviously can reproduce 
  it)
  to try to add the debug print from the diff below and show what it prints 
  when
  the write command hangs and when it succeeds?
 
  Thanks.
 
  Best regards,
  Andrew
 
  diff -u fsl_esdhc.c.orig fsl_esdhc.c
  --- fsl_esdhc.c.orig  2013-05-30 03:48:26.0 -0500
  +++ fsl_esdhc.c   2013-06-10 09:38:30.071905119 -0500
  @@ -329,6 +329,7 @@
 
irqstat = esdhc_read32(regs-irqstat);
esdhc_write32(regs-irqstat, irqstat);
  + printf(fsl_esdhc: irqstat = 0x%08x\n, irqstat);
 
/* Reset CMD and DATA portions on error */
if (irqstat  (CMD_ERR | IRQSTAT_CTOE)) {
 
 1. Sandisk 8GB Ultra 2 class 4 SDHC
 
 [   23.967081] MMC write: dev # 0, block # 740, count 1 ...
 fsl_esdhc: irqstat = 0x0001
 [   23.977473] fsl_esdhc: irqstat = 0x0009
   = hang
 
 With fsl_esdhc: Fix DMA transfer completion waiting loop reverted:
 [   41.769231] MMC write: dev # 0, block # 740, count 1 ...
 fsl_esdhc: irqstat = 0x0001
 [   41.779622] fsl_esdhc: irqstat = 0x0009
 [   41.798490] fsl_esdhc: irqstat = 0x0001
 [   41.802593] 1 blocks write: OK
 = work
 
 
 2. Sandisk 16GB Extreme class 10 (30MB/s)
 
 [   45.871140] MMC write: dev # 0, block # 740, count 1 ...
 fsl_esdhc: irqstat = 0x0001
 [   45.881528] fsl_esdhc: irqstat = 0x0001
 [   46.054409] fsl_esdhc: irqstat = 0x0001
 [   46.058513] 1 blocks write: OK
 = work
 
 With fsl_esdhc: Fix DMA transfer completion waiting loop reverted:
 [   17.901514] MMC write: dev # 0, block # 740, count 1 ...
 fsl_esdhc: irqstat = 0x0001
 [   17.911901] fsl_esdhc: irqstat = 0x0001
 [   18.081153] fsl_esdhc: irqstat = 0x0001
 [   18.085256] 1 blocks write: OK
 = work
 
 Best regards
 
 Dirk

Indeed, the DMA End interrupt bit appears in the register already by the time
of Command Complete event. Then, it gets cleared together with command-related
bits. So, the data completion waiting loop, that starts later, never gets it 
and waits forever.

One of solutions could be to explicitly clear only the command related bits 
(command complete
and may be command errors). However, it is easier just not clear the bits at 
all,
leave them all until the data part processing completes too, and clear the whole
register at once at the very end (which is being done anyway).

I'm submitting the patch removing clearing of interrupt status bits at that 
point. See Subject line
fsl_esdhc: Do not clear interrupt status bits until data processed.

Thanks.

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


Re: [U-Boot] [PATCH v3 0/6] Optimize ARM relocation

2013-06-11 Thread Albert ARIBAUD
Hi Lubomir,

On Tue, 11 Jun 2013 17:22:17 +0300, Lubomir Popov lpo...@mm-sol.com
wrote:

 Hi Albert,

 Applied the series to a relatively fresh (yesterday's) u-boot-ti/master
 and tested on a custom OMAP5430 board. Boots normally. USB storage and
 Ethernet (dhcp  ping), SD/MMC, I2C are all working.
 
 Tested-by: Lubomir Popov lpo...@mm-sol.com

Thanks a lot!

 Regards,
 Lubo

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


Re: [U-Boot] [PATCH v2 06/16] sf: Update sf to support all sizes of flashes

2013-06-11 Thread Jagan Teki
Hi Simon,

On Tue, Jun 11, 2013 at 3:19 AM, Simon Glass s...@chromium.org wrote:
 On Mon, Jun 10, 2013 at 9:05 AM, Jagan Teki jagannadh.t...@gmail.com
 wrote:

 Hi Tom,

 On Sat, Jun 8, 2013 at 8:24 PM, Jagan Teki jagannadh.t...@gmail.com
 wrote:
  Hi Simon,
 
  On Sat, Jun 8, 2013 at 8:11 PM, Simon Glass s...@chromium.org wrote:
  Hi,
 
  On Sat, Jun 8, 2013 at 1:22 AM, Jagan Teki jagannadh.t...@gmail.com
  wrote:
 
  Hi Simon,
 
  On Sat, Jun 8, 2013 at 4:44 AM, Simon Glass s...@chromium.org wrote:
   Hi Jagan,
  
   On Fri, May 31, 2013 at 5:52 AM, Jagannadha Sutradharudu Teki
   jagannadha.sutradharudu-t...@xilinx.com wrote:
  
   Updated the spi_flash framework to handle all sizes of flashes
   using bank/extd addr reg facility
  
   The current implementation in spi_flash supports 3-byte address
   mode
   due to this up to 16Mbytes amount of flash is able to access for
   those
   flashes which has an actual size of  16MB.
  
   As most of the flashes introduces a bank/extd address registers
   for accessing the flashes in 16Mbytes of banks if the flash size
   is  16Mbytes, this new scheme will add the bank selection feature
   for performing write/erase operations on all flashes.
  
   Signed-off-by: Jagannadha Sutradharudu Teki jaga...@xilinx.com
  
  
   I have a few comments on this series, but it mostly looks fine. I
   think
   the
   new code is correct.
  
   The patches did not apply cleanly for me. Perhaps I am missing
   something. My
   tree looks like this after I did a bit of merging:
 
  Which patches you had an issues while applying,we have few patches on
  u-boot-spi.git i created these on top of it.
 
 
  I am not sure now - sorry I did not keep a record. But the bundle I
  used is
  here, and it doesn't apply cleanly.
 
  http://patchwork.ozlabs.org/bundle/sjg/jagan/
 
  git am ~/Downloads/bundle-4407-jagan.mbox
  Applying: sf: Add bank address register writing support
  Applying: sf: Add bank address register reading support
  Applying: sf: Add extended addr write support for winbond|stmicro
  Applying: sf: Add extended addr read support for winbond|stmicro
  Applying: sf: read flash bank addr register at probe time
  Applying: sf: Update sf to support all sizes of flashes
  error: patch failed: drivers/mtd/spi/spi_flash.c:117
  error: drivers/mtd/spi/spi_flash.c: patch does not apply
  Patch failed at 0006 sf: Update sf to support all sizes of flashes
  The copy of the patch that failed is found in:
 /home/sjg/u/.git/rebase-apply/patch
  When you have resolved this problem, run git am --resolved.
  If you prefer to skip this patch, run git am --skip instead.
  To restore the original branch and stop patching, run git am --abort
 
 
 
  
   5864e87 (HEAD, try-spi) cfi_flash: Fix detection of 8-bit bus flash
   devices
   via address shift
   f700095 sf: Add Flag status register polling support
   42f4b70 sf: Remove spi_flash_cmd_poll_bit()
   fc31387 sf: Use spi_flash_read_common() in write status poll
   923e40e sf: spansion: Add support for S25FL512S_256K
   c72e52a sf: stmicro: Add support for N25Q1024A
   4066f71 sf: stmicro: Add support for N25Q1024
   0efaf86 sf: stmicro: Add support for N25Q512A
   8fd962f sf: stmicro: Add support for N25Q512
   f1a2080 sf: Use spi_flash_addr() in write call
   31ed498 sf: Update sf read to support all sizes of flashes
   0f77642 sf: Update sf to support all sizes of flashes
   9e57220 sf: read flash bank addr register at probe time
   e99a43d sf: Add extended addr read support for winbond|stmicro
   2f06d56 sf: Add extended addr write support for winbond|stmicro
   f02ecf1 sf: Add bank address register reading support
   02ba27c sf: Add bank address register writing support
  
   Also do you think spi_flash_cmd_bankaddr_write() and related stuff
   should be
   behind a flag like CONFIG_SPI_BANK_ADDR or similar? How much code
   space
   does
   this add?
 
  Initially i thought of the same, but I just updated sf which is
  generic to all sizes of flashes.
  due to this i haven't included the bank read/write on macros, and the
  flash ops will call these
  bank write call irrespective of flash sizes.
 
  As flashes which has below 16Mbytes will have a bank_curr value 0
  so-that even bank write will exit for
  bank 0 operations.
 
 
  Yes this is fine.
 
 
 
  +   if (flash-bank_curr == bank_sel) {
  +   debug(SF: not require to enable bank%d\n, bank_sel);
  +   return 0;
  +   }
  +
 
  And due to these framework changes bank+flash ops addition, bin size
  increases appr' ~600bytes
  by enabling stmicro, winbond and spansion flash drivers.(please check
  the size from your end also if required)
 
 
  I suggest you make that function a nop (perhaps using an #ifdef
  CONFIG_SPI_BANK_ADDR inside it or some other name) so that your patches
  don't increase U-Boot code size for those boards that don't need
  support
  larger devices (which I guess is almost all of them, right now). U-Boot
  is
  quite 

[U-Boot] [PATCH] fsl_esdhc: Do not clear interrupt status bits until data processed

2013-06-11 Thread Andrew Gabbasov
After waiting for the command completion event, the interrupt status
bits, that occured to be set by that time, are cleared by writing them
back. It is supposed, that it should be command related bits (command
complete and may be command errors).

However, in some cases the DMA already completes by that time before
the full transaction completes. The corresponding DINT bit gets set
and then cleared before even entering the loop, waiting for data part
completion. That waiting loop never gets this bit set, causing the
operation to hang. This is reported to happen, for example, for write
operation of 1 sector to upper area (block #740) of SanDisk Ultra II
8GB card.

The solution could be to explicitly clear only command related interrupt
status bits. However, since subsequent processing does not rely on
any command bits state, it could be easier just to remove clearing
of any bits at that point, leaving them all until all data processing
completes. After that the whole register will be cleared at once.

Also, on occasion, interrupts masking moved to before writing the command,
just for the case there should be no chance of interrupt between the first
command and interrupts masking.

Reported-by: Dirk Behme dirk.be...@de.bosch.com
Signed-off-by: Andrew Gabbasov andrew_gabba...@mentor.com
---
 drivers/mmc/fsl_esdhc.c |7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c
index 861f4b9..b501b4d 100644
--- a/drivers/mmc/fsl_esdhc.c
+++ b/drivers/mmc/fsl_esdhc.c
@@ -310,6 +310,9 @@ esdhc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, struct 
mmc_data *data)
/* Figure out the transfer arguments */
xfertyp = esdhc_xfertyp(cmd, data);
 
+   /* Mask all irqs */
+   esdhc_write32(regs-irqsigen, 0);
+
/* Send the command */
esdhc_write32(regs-cmdarg, cmd-cmdarg);
 #if defined(CONFIG_FSL_USDHC)
@@ -320,15 +323,11 @@ esdhc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, 
struct mmc_data *data)
esdhc_write32(regs-xfertyp, xfertyp);
 #endif
 
-   /* Mask all irqs */
-   esdhc_write32(regs-irqsigen, 0);
-
/* Wait for the command to complete */
while (!(esdhc_read32(regs-irqstat)  (IRQSTAT_CC | IRQSTAT_CTOE)))
;
 
irqstat = esdhc_read32(regs-irqstat);
-   esdhc_write32(regs-irqstat, irqstat);
 
/* Reset CMD and DATA portions on error */
if (irqstat  (CMD_ERR | IRQSTAT_CTOE)) {
-- 
1.7.10.4

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


Re: [U-Boot] [PATCH v4 1/7] arm: add MMU/D-Cache support for Faraday cores

2013-06-11 Thread Albert ARIBAUD
Hi Kuo-Jung,

On Tue, 11 Jun 2013 11:09:57 +0800, Kuo-Jung Su dant...@gmail.com
wrote:

 2013/6/11 Albert ARIBAUD albert.u.b...@aribaud.net:
  Hi Kuo-Jung,
 
  On Tue,  7 May 2013 14:25:07 +0800, Kuo-Jung Su dant...@gmail.com
  wrote:
 
  diff --git a/arch/arm/include/asm/dma-mapping.h 
  b/arch/arm/include/asm/dma-mapping.h
  index 5bbb0a0..5a13af5 100644
  --- a/arch/arm/include/asm/dma-mapping.h
  +++ b/arch/arm/include/asm/dma-mapping.h
  @@ -3,6 +3,9 @@
* Stelian Pop stel...@popies.net
* Lead Tech Design www.leadtechdesign.com
*
  + * (C) Copyright 2010
  + * Dante Su dant...@faraday-tech.com
 
  Fix Copyright notices (dates) throughout the patch (and series as
  needed).
 
 
 Got it, thanks.
 
* See file CREDITS for list of people who contributed to this
* project.
*
  @@ -24,22 +27,76 @@
   #ifndef __ASM_ARM_DMA_MAPPING_H
   #define __ASM_ARM_DMA_MAPPING_H
 
  +#if defined(CONFIG_FARADAY)  !defined(CONFIG_SYS_DCACHE_OFF)
  +#include asm/u-boot.h
  +#include asm/global_data.h
  +#include asm/io.h
  +#include malloc.h
  +
  +DECLARE_GLOBAL_DATA_PTR;
  +#endif /* CONFIG_FARADAY  !CONFIG_SYS_DCACHE_OFF */
  +
   enum dma_data_direction {
DMA_BIDIRECTIONAL   = 0,
DMA_TO_DEVICE   = 1,
DMA_FROM_DEVICE = 2,
   };
 
  -static void *dma_alloc_coherent(size_t len, unsigned long *handle)
  +static inline void *dma_alloc_coherent(size_t len, unsigned long *handle)
   {
  - *handle = (unsigned long)malloc(len);
  +#if defined(CONFIG_FARADAY)  !defined(CONFIG_SYS_DCACHE_OFF)
  + void *map, *va = memalign(ARCH_DMA_MINALIGN, len);
  +
  + if (va  gd-arch.cpu_mmu) {
  + invalidate_dcache_range((ulong)va, (ulong)va + len);
  + map = map_physmem((phys_addr_t)va, len, MAP_NOCACHE);
  + if (!map)
  + free(va);
  + va = map;
  + }
  +
  + if (handle)
  + *handle = virt_to_phys(va);
  +
  + return va;
  +#else  /* CONFIG_FARADAY  !CONFIG_SYS_DCACHE_OFF */
  + *handle = (unsigned long)memalign(ARCH_DMA_MINALIGN, len);
return (void *)*handle;
 
  This is not identical to what the code was before the patch. Why the
  difference?
 
 
 Yes, it's not identical to what the code was.
 
 It was:
 *handle = (unsigned long)malloc(len);
 But I think it should be
 *handle = (unsigned long)memalign(ARCH_DMA_MINALIGN, len);
 
 Because even though the MMU/D-cache is off, some DMA engines still
 requires strict address alignment.
 
 For example, the Faraday FTMAC110  FTGMAC100 ether-net controllers
 expect the descriptors are always aligned to 16-bytes boundary.

Unless there exists an actual case where the current form causes an
issue, please leave it unchanged. And if it is needed, then please make
it a separate patch.

 Best wishes,
 Kuo-Jung Su

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


Re: [U-Boot] [PATCH v4] arm: dra7xx: Update the EXTRA_ENV_SETTINGS

2013-06-11 Thread Tom Rini
On Thu, Jun 06, 2013 at 01:30:05PM -0500, Dan Murphy wrote:

 Update the EXTRA_ENV_SETTING for the dra7xx.
 The console needs to be set to ttyO0 and the
 findfdt needs to be updated to load the
 dra7xx-evm.dtb file.
 
 Signed-off-by: Dan Murphy dmur...@ti.com
[snip]
 - setenv fdtfile omap5-uevm.dtb; fi;\0  \
 + setenv fdtfile omap5-uevm.dtb; fi;  \
 + if test $board_name = dra7xx; then  \
 + setenv fdtfile dra7-evm.dtb; fi;  \

Missing trailing \0 here to terminate the variable.

-- 
Tom


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


Re: [U-Boot] [PATCH] arm: omap: Add check for fdtfile in the findfdt macro

2013-06-11 Thread Tom Rini
On Thu, Jun 06, 2013 at 01:27:06PM -0500, Dan Murphy wrote:

 In the omap4, omap5 and am335x common files add a check to ensure that
 the fdtfile is defined after the findfdt macro has run.  If the file
 is not defined then warn the user that the dtb file is not defined.
 
 Signed-off-by: Dan Murphy dmur...@ti.com

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

-- 
Tom


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


Re: [U-Boot] [PATCH] arm: omap5_uevm: Correct the console sys prompt for 5432

2013-06-11 Thread Tom Rini
On Thu, Jun 06, 2013 at 04:30:38PM -0500, Dan Murphy wrote:

 Correct the console sys prompt to display the correct processor
 and the corrent board
 
 Signed-off-by: Dan Murphy dmur...@ti.com
 Reported-by: Lubomir Popov lpo...@mm-sol.com

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

But personally, this is why I'm a fan of 'U-Boot # ' as the prompt :)

-- 
Tom


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


Re: [U-Boot] [PATCH v2 06/16] sf: Update sf to support all sizes of flashes

2013-06-11 Thread Simon Glass
Hi Jagan,

On Tue, Jun 11, 2013 at 8:31 AM, Jagan Teki jagannadh.t...@gmail.comwrote:

 Hi Simon,

 On Tue, Jun 11, 2013 at 3:19 AM, Simon Glass s...@chromium.org wrote:
  On Mon, Jun 10, 2013 at 9:05 AM, Jagan Teki jagannadh.t...@gmail.com
  wrote:
 
  Hi Tom,
 
  On Sat, Jun 8, 2013 at 8:24 PM, Jagan Teki jagannadh.t...@gmail.com
  wrote:
   Hi Simon,
  
   On Sat, Jun 8, 2013 at 8:11 PM, Simon Glass s...@chromium.org wrote:
   Hi,
  
   On Sat, Jun 8, 2013 at 1:22 AM, Jagan Teki jagannadh.t...@gmail.com
 
   wrote:
  
   Hi Simon,
  
   On Sat, Jun 8, 2013 at 4:44 AM, Simon Glass s...@chromium.org
 wrote:
Hi Jagan,
   
On Fri, May 31, 2013 at 5:52 AM, Jagannadha Sutradharudu Teki
jagannadha.sutradharudu-t...@xilinx.com wrote:
   
Updated the spi_flash framework to handle all sizes of flashes
using bank/extd addr reg facility
   
The current implementation in spi_flash supports 3-byte address
mode
due to this up to 16Mbytes amount of flash is able to access for
those
flashes which has an actual size of  16MB.
   
As most of the flashes introduces a bank/extd address registers
for accessing the flashes in 16Mbytes of banks if the flash size
is  16Mbytes, this new scheme will add the bank selection
 feature
for performing write/erase operations on all flashes.
   
Signed-off-by: Jagannadha Sutradharudu Teki jaga...@xilinx.com
   
   
I have a few comments on this series, but it mostly looks fine. I
think
the
new code is correct.
   
The patches did not apply cleanly for me. Perhaps I am missing
something. My
tree looks like this after I did a bit of merging:
  
   Which patches you had an issues while applying,we have few patches
 on
   u-boot-spi.git i created these on top of it.
  
  
   I am not sure now - sorry I did not keep a record. But the bundle I
   used is
   here, and it doesn't apply cleanly.
  
   http://patchwork.ozlabs.org/bundle/sjg/jagan/
  
   git am ~/Downloads/bundle-4407-jagan.mbox
   Applying: sf: Add bank address register writing support
   Applying: sf: Add bank address register reading support
   Applying: sf: Add extended addr write support for winbond|stmicro
   Applying: sf: Add extended addr read support for winbond|stmicro
   Applying: sf: read flash bank addr register at probe time
   Applying: sf: Update sf to support all sizes of flashes
   error: patch failed: drivers/mtd/spi/spi_flash.c:117
   error: drivers/mtd/spi/spi_flash.c: patch does not apply
   Patch failed at 0006 sf: Update sf to support all sizes of flashes
   The copy of the patch that failed is found in:
  /home/sjg/u/.git/rebase-apply/patch
   When you have resolved this problem, run git am --resolved.
   If you prefer to skip this patch, run git am --skip instead.
   To restore the original branch and stop patching, run git am
 --abort
  
  
  
   
5864e87 (HEAD, try-spi) cfi_flash: Fix detection of 8-bit bus
 flash
devices
via address shift
f700095 sf: Add Flag status register polling support
42f4b70 sf: Remove spi_flash_cmd_poll_bit()
fc31387 sf: Use spi_flash_read_common() in write status poll
923e40e sf: spansion: Add support for S25FL512S_256K
c72e52a sf: stmicro: Add support for N25Q1024A
4066f71 sf: stmicro: Add support for N25Q1024
0efaf86 sf: stmicro: Add support for N25Q512A
8fd962f sf: stmicro: Add support for N25Q512
f1a2080 sf: Use spi_flash_addr() in write call
31ed498 sf: Update sf read to support all sizes of flashes
0f77642 sf: Update sf to support all sizes of flashes
9e57220 sf: read flash bank addr register at probe time
e99a43d sf: Add extended addr read support for winbond|stmicro
2f06d56 sf: Add extended addr write support for winbond|stmicro
f02ecf1 sf: Add bank address register reading support
02ba27c sf: Add bank address register writing support
   
Also do you think spi_flash_cmd_bankaddr_write() and related stuff
should be
behind a flag like CONFIG_SPI_BANK_ADDR or similar? How much code
space
does
this add?
  
   Initially i thought of the same, but I just updated sf which is
   generic to all sizes of flashes.
   due to this i haven't included the bank read/write on macros, and
 the
   flash ops will call these
   bank write call irrespective of flash sizes.
  
   As flashes which has below 16Mbytes will have a bank_curr value 0
   so-that even bank write will exit for
   bank 0 operations.
  
  
   Yes this is fine.
  
  
  
   +   if (flash-bank_curr == bank_sel) {
   +   debug(SF: not require to enable bank%d\n,
 bank_sel);
   +   return 0;
   +   }
   +
  
   And due to these framework changes bank+flash ops addition, bin size
   increases appr' ~600bytes
   by enabling stmicro, winbond and spansion flash drivers.(please
 check
   the size from your end also if required)
  
  
   I suggest you make that function a nop (perhaps using an #ifdef
   

Re: [U-Boot] [PATCH 6/8] config: don't define CONFIG_ARCH_DEVICE_TREE

2013-06-11 Thread Stephen Warren
On 06/11/2013 12:52 AM, Jagan Teki wrote:
 Hi,
 
 I think we can wait some more time to mature the fdt support on
 u-boot, as not many boards were using this future.
 may be I am also incorrect.

Sorry, I don't understand what this means.

 And need to remove the CONFIG_ARCH_DEVICE_TREE references in
 dts/Makefile to for working this.

That's what patch 5/8 does.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] MIPS: mips64: fix typos in copyright text of start.S

2013-06-11 Thread Gabor Juhos
Signed-off-by: Gabor Juhos juh...@openwrt.org
Cc: Daniel Schwierzeck daniel.schwierz...@gmail.com
---
 arch/mips/cpu/mips64/start.S |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/mips/cpu/mips64/start.S b/arch/mips/cpu/mips64/start.S
index dc7ce07..1ece6c2 100644
--- a/arch/mips/cpu/mips64/start.S
+++ b/arch/mips/cpu/mips64/start.S
@@ -9,16 +9,16 @@
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
  * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any dlater version.
+ * the License, or (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICUdlaR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Pdlace, Suite 330, Boston,
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  * MA 02111-1307 USA
  */
 
-- 
1.7.10

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


Re: [U-Boot] [PATCH v2 06/16] sf: Update sf to support all sizes of flashes

2013-06-11 Thread Tom Rini
On Mon, Jun 10, 2013 at 02:49:35PM -0700, Simon Glass wrote:
 On Mon, Jun 10, 2013 at 9:05 AM, Jagan Teki jagannadh.t...@gmail.comwrote:
 
  Hi Tom,
 
  On Sat, Jun 8, 2013 at 8:24 PM, Jagan Teki jagannadh.t...@gmail.com
  wrote:
   Hi Simon,
  
   On Sat, Jun 8, 2013 at 8:11 PM, Simon Glass s...@chromium.org wrote:
   Hi,
  
   On Sat, Jun 8, 2013 at 1:22 AM, Jagan Teki jagannadh.t...@gmail.com
  wrote:
  
   Hi Simon,
  
   On Sat, Jun 8, 2013 at 4:44 AM, Simon Glass s...@chromium.org wrote:
Hi Jagan,
   
On Fri, May 31, 2013 at 5:52 AM, Jagannadha Sutradharudu Teki
jagannadha.sutradharudu-t...@xilinx.com wrote:
   
Updated the spi_flash framework to handle all sizes of flashes
using bank/extd addr reg facility
   
The current implementation in spi_flash supports 3-byte address mode
due to this up to 16Mbytes amount of flash is able to access for
  those
flashes which has an actual size of  16MB.
   
As most of the flashes introduces a bank/extd address registers
for accessing the flashes in 16Mbytes of banks if the flash size
is  16Mbytes, this new scheme will add the bank selection feature
for performing write/erase operations on all flashes.
   
Signed-off-by: Jagannadha Sutradharudu Teki jaga...@xilinx.com
   
   
I have a few comments on this series, but it mostly looks fine. I
  think
the
new code is correct.
   
The patches did not apply cleanly for me. Perhaps I am missing
something. My
tree looks like this after I did a bit of merging:
  
   Which patches you had an issues while applying,we have few patches on
   u-boot-spi.git i created these on top of it.
  
  
   I am not sure now - sorry I did not keep a record. But the bundle I
  used is
   here, and it doesn't apply cleanly.
  
   http://patchwork.ozlabs.org/bundle/sjg/jagan/
  
   git am ~/Downloads/bundle-4407-jagan.mbox
   Applying: sf: Add bank address register writing support
   Applying: sf: Add bank address register reading support
   Applying: sf: Add extended addr write support for winbond|stmicro
   Applying: sf: Add extended addr read support for winbond|stmicro
   Applying: sf: read flash bank addr register at probe time
   Applying: sf: Update sf to support all sizes of flashes
   error: patch failed: drivers/mtd/spi/spi_flash.c:117
   error: drivers/mtd/spi/spi_flash.c: patch does not apply
   Patch failed at 0006 sf: Update sf to support all sizes of flashes
   The copy of the patch that failed is found in:
  /home/sjg/u/.git/rebase-apply/patch
   When you have resolved this problem, run git am --resolved.
   If you prefer to skip this patch, run git am --skip instead.
   To restore the original branch and stop patching, run git am --abort
  
  
  
   
5864e87 (HEAD, try-spi) cfi_flash: Fix detection of 8-bit bus flash
devices
via address shift
f700095 sf: Add Flag status register polling support
42f4b70 sf: Remove spi_flash_cmd_poll_bit()
fc31387 sf: Use spi_flash_read_common() in write status poll
923e40e sf: spansion: Add support for S25FL512S_256K
c72e52a sf: stmicro: Add support for N25Q1024A
4066f71 sf: stmicro: Add support for N25Q1024
0efaf86 sf: stmicro: Add support for N25Q512A
8fd962f sf: stmicro: Add support for N25Q512
f1a2080 sf: Use spi_flash_addr() in write call
31ed498 sf: Update sf read to support all sizes of flashes
0f77642 sf: Update sf to support all sizes of flashes
9e57220 sf: read flash bank addr register at probe time
e99a43d sf: Add extended addr read support for winbond|stmicro
2f06d56 sf: Add extended addr write support for winbond|stmicro
f02ecf1 sf: Add bank address register reading support
02ba27c sf: Add bank address register writing support
   
Also do you think spi_flash_cmd_bankaddr_write() and related stuff
should be
behind a flag like CONFIG_SPI_BANK_ADDR or similar? How much code
  space
does
this add?
  
   Initially i thought of the same, but I just updated sf which is
   generic to all sizes of flashes.
   due to this i haven't included the bank read/write on macros, and the
   flash ops will call these
   bank write call irrespective of flash sizes.
  
   As flashes which has below 16Mbytes will have a bank_curr value 0
   so-that even bank write will exit for
   bank 0 operations.
  
  
   Yes this is fine.
  
  
  
   +   if (flash-bank_curr == bank_sel) {
   +   debug(SF: not require to enable bank%d\n, bank_sel);
   +   return 0;
   +   }
   +
  
   And due to these framework changes bank+flash ops addition, bin size
   increases appr' ~600bytes
   by enabling stmicro, winbond and spansion flash drivers.(please check
   the size from your end also if required)
  
  
   I suggest you make that function a nop (perhaps using an #ifdef
   CONFIG_SPI_BANK_ADDR inside it or some other name) so that your patches
   don't increase U-Boot code size for those boards that don't need 

Re: [U-Boot] [PATCH v4] arm: dra7xx: Update the EXTRA_ENV_SETTINGS

2013-06-11 Thread Dan Murphy
On 06/11/2013 10:50 AM, Tom Rini wrote:
 On Thu, Jun 06, 2013 at 01:30:05PM -0500, Dan Murphy wrote:

 Update the EXTRA_ENV_SETTING for the dra7xx.
 The console needs to be set to ttyO0 and the
 findfdt needs to be updated to load the
 dra7xx-evm.dtb file.

 Signed-off-by: Dan Murphy dmur...@ti.com
 [snip]
 -setenv fdtfile omap5-uevm.dtb; fi;\0  \
 +setenv fdtfile omap5-uevm.dtb; fi;  \
 +if test $board_name = dra7xx; then  \
 +setenv fdtfile dra7-evm.dtb; fi;  \
 Missing trailing \0 here to terminate the variable.

Fixed in next patch

-- 
--
Dan Murphy

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


Re: [U-Boot] [PATCH v2 06/16] sf: Update sf to support all sizes of flashes

2013-06-11 Thread Jagan Teki
Hi Simon,

On Tue, Jun 11, 2013 at 9:26 PM, Simon Glass s...@chromium.org wrote:
 Hi Jagan,

 On Tue, Jun 11, 2013 at 8:31 AM, Jagan Teki jagannadh.t...@gmail.com
 wrote:

 Hi Simon,

 On Tue, Jun 11, 2013 at 3:19 AM, Simon Glass s...@chromium.org wrote:
  On Mon, Jun 10, 2013 at 9:05 AM, Jagan Teki jagannadh.t...@gmail.com
  wrote:
 
  Hi Tom,
 
  On Sat, Jun 8, 2013 at 8:24 PM, Jagan Teki jagannadh.t...@gmail.com
  wrote:
   Hi Simon,
  
   On Sat, Jun 8, 2013 at 8:11 PM, Simon Glass s...@chromium.org wrote:
   Hi,
  
   On Sat, Jun 8, 2013 at 1:22 AM, Jagan Teki
   jagannadh.t...@gmail.com
   wrote:
  
   Hi Simon,
  
   On Sat, Jun 8, 2013 at 4:44 AM, Simon Glass s...@chromium.org
   wrote:
Hi Jagan,
   
On Fri, May 31, 2013 at 5:52 AM, Jagannadha Sutradharudu Teki
jagannadha.sutradharudu-t...@xilinx.com wrote:
   
Updated the spi_flash framework to handle all sizes of flashes
using bank/extd addr reg facility
   
The current implementation in spi_flash supports 3-byte address
mode
due to this up to 16Mbytes amount of flash is able to access for
those
flashes which has an actual size of  16MB.
   
As most of the flashes introduces a bank/extd address registers
for accessing the flashes in 16Mbytes of banks if the flash size
is  16Mbytes, this new scheme will add the bank selection
feature
for performing write/erase operations on all flashes.
   
Signed-off-by: Jagannadha Sutradharudu Teki jaga...@xilinx.com
   
   
I have a few comments on this series, but it mostly looks fine. I
think
the
new code is correct.
   
The patches did not apply cleanly for me. Perhaps I am missing
something. My
tree looks like this after I did a bit of merging:
  
   Which patches you had an issues while applying,we have few patches
   on
   u-boot-spi.git i created these on top of it.
  
  
   I am not sure now - sorry I did not keep a record. But the bundle I
   used is
   here, and it doesn't apply cleanly.
  
   http://patchwork.ozlabs.org/bundle/sjg/jagan/
  
   git am ~/Downloads/bundle-4407-jagan.mbox
   Applying: sf: Add bank address register writing support
   Applying: sf: Add bank address register reading support
   Applying: sf: Add extended addr write support for winbond|stmicro
   Applying: sf: Add extended addr read support for winbond|stmicro
   Applying: sf: read flash bank addr register at probe time
   Applying: sf: Update sf to support all sizes of flashes
   error: patch failed: drivers/mtd/spi/spi_flash.c:117
   error: drivers/mtd/spi/spi_flash.c: patch does not apply
   Patch failed at 0006 sf: Update sf to support all sizes of flashes
   The copy of the patch that failed is found in:
  /home/sjg/u/.git/rebase-apply/patch
   When you have resolved this problem, run git am --resolved.
   If you prefer to skip this patch, run git am --skip instead.
   To restore the original branch and stop patching, run git am
   --abort
  
  
  
   
5864e87 (HEAD, try-spi) cfi_flash: Fix detection of 8-bit bus
flash
devices
via address shift
f700095 sf: Add Flag status register polling support
42f4b70 sf: Remove spi_flash_cmd_poll_bit()
fc31387 sf: Use spi_flash_read_common() in write status poll
923e40e sf: spansion: Add support for S25FL512S_256K
c72e52a sf: stmicro: Add support for N25Q1024A
4066f71 sf: stmicro: Add support for N25Q1024
0efaf86 sf: stmicro: Add support for N25Q512A
8fd962f sf: stmicro: Add support for N25Q512
f1a2080 sf: Use spi_flash_addr() in write call
31ed498 sf: Update sf read to support all sizes of flashes
0f77642 sf: Update sf to support all sizes of flashes
9e57220 sf: read flash bank addr register at probe time
e99a43d sf: Add extended addr read support for winbond|stmicro
2f06d56 sf: Add extended addr write support for winbond|stmicro
f02ecf1 sf: Add bank address register reading support
02ba27c sf: Add bank address register writing support
   
Also do you think spi_flash_cmd_bankaddr_write() and related
stuff
should be
behind a flag like CONFIG_SPI_BANK_ADDR or similar? How much code
space
does
this add?
  
   Initially i thought of the same, but I just updated sf which is
   generic to all sizes of flashes.
   due to this i haven't included the bank read/write on macros, and
   the
   flash ops will call these
   bank write call irrespective of flash sizes.
  
   As flashes which has below 16Mbytes will have a bank_curr value 0
   so-that even bank write will exit for
   bank 0 operations.
  
  
   Yes this is fine.
  
  
  
   +   if (flash-bank_curr == bank_sel) {
   +   debug(SF: not require to enable bank%d\n,
   bank_sel);
   +   return 0;
   +   }
   +
  
   And due to these framework changes bank+flash ops addition, bin
   size
   increases appr' ~600bytes
   by enabling stmicro, winbond and spansion flash drivers.(please
   check
   the size 

Re: [U-Boot] [PATCH 0/8] rely on latest dtc, simplify

2013-06-11 Thread Tom Rini
On Mon, Jun 10, 2013 at 05:16:56PM -0600, Stephen Warren wrote:

 From: Stephen Warren swar...@nvidia.com
 
 This is a series of patches which simplifies the rules to build *.dts in
 U-Boot by relying on features in the latest dtc. The include rules are
 made more consistent between cpp (when processing *.dts) and dtc. The cpp
 flags are made more consistent with the way the kernel processes *.dts to
 allow better portability of *.dts between the two.

Please add a dtc-version Makefile variable and corresponding
tools/dtc-version.sh script, ala gcc/binutils so that we can error out
gracefully if dtc isn't supporting the options we need.

-- 
Tom


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


[U-Boot] [PATCH v5] arm: dra7xx: Update the EXTRA_ENV_SETTINGS

2013-06-11 Thread Dan Murphy
Update the EXTRA_ENV_SETTING for the dra7xx.
The console needs to be set to ttyO0 and the
findfdt needs to be updated to load the
dra7xx-evm.dtb file.

Signed-off-by: Dan Murphy dmur...@ti.com
---
v5 - Fixed by adding the \0 to terminate the macro - 
http://patchwork.ozlabs.org/patch/249528/
v4 - Remove check for undefined fdtfile and save for another patch - 
http://patchwork.ozlabs.org/patch/249084/
v3 - Updated based on comments - http://patchwork.ozlabs.org/patch/248687/
v2 - Updated with side bar maintainer comments.

 include/configs/dra7xx_evm.h   |2 ++
 include/configs/omap5_common.h |6 --
 include/configs/omap5_uevm.h   |1 +
 3 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/include/configs/dra7xx_evm.h b/include/configs/dra7xx_evm.h
index 28a306b..2db0fbd 100644
--- a/include/configs/dra7xx_evm.h
+++ b/include/configs/dra7xx_evm.h
@@ -35,4 +35,6 @@
 #define CONFIG_DRA7XX  /* in a TI DRA7XX core */
 #define CONFIG_SYS_PROMPT  DRA752 EVM # 
 
+#define CONSOLEDEV ttyO0
+
 #endif /* __CONFIG_DRA7XX_EVM_H */
diff --git a/include/configs/omap5_common.h b/include/configs/omap5_common.h
index deb5e9f..7ae546d 100644
--- a/include/configs/omap5_common.h
+++ b/include/configs/omap5_common.h
@@ -144,7 +144,7 @@
 
 #define CONFIG_EXTRA_ENV_SETTINGS \
loadaddr=0x8200\0 \
-   console=ttyO2,115200n8\0 \
+   console= CONSOLEDEV ,115200n8\0 \
fdt_high=0x\0 \
fdtaddr=0x80f8\0 \
bootpart=0:2\0 \
@@ -174,7 +174,9 @@
bootz ${loadaddr} - ${fdtaddr}\0 \
findfdt=\
if test $board_name = omap5_uevm; then  \
-   setenv fdtfile omap5-uevm.dtb; fi;\0  \
+   setenv fdtfile omap5-uevm.dtb; fi;  \
+   if test $board_name = dra7xx; then  \
+   setenv fdtfile dra7-evm.dtb; fi;\0 \
loadfdt=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile};\0 \
 
 #define CONFIG_BOOTCOMMAND \
diff --git a/include/configs/omap5_uevm.h b/include/configs/omap5_uevm.h
index 9e0339b..f2cbb02 100644
--- a/include/configs/omap5_uevm.h
+++ b/include/configs/omap5_uevm.h
@@ -55,6 +55,7 @@
 #define CONFIG_CMD_PART
 
 #define CONFIG_SYS_PROMPT  OMAP5430 EVM # 
+#define CONSOLEDEV ttyO2
 
 #define CONFIG_OMAP_PLATFORM_RESET_TIME_MAX_USEC   16296
 #endif /* __CONFIG_OMAP5_EVM_H */
-- 
1.7.5.4

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


Re: [U-Boot] [PATCH 0/8] rely on latest dtc, simplify

2013-06-11 Thread Stephen Warren
On 06/11/2013 10:19 AM, Tom Rini wrote:
 On Mon, Jun 10, 2013 at 05:16:56PM -0600, Stephen Warren wrote:
 
 From: Stephen Warren swar...@nvidia.com
 
 This is a series of patches which simplifies the rules to build
 *.dts in U-Boot by relying on features in the latest dtc. The
 include rules are made more consistent between cpp (when
 processing *.dts) and dtc. The cpp flags are made more consistent
 with the way the kernel processes *.dts to allow better
 portability of *.dts between the two.
 
 Please add a dtc-version Makefile variable and corresponding 
 tools/dtc-version.sh script, ala gcc/binutils so that we can error
 out gracefully if dtc isn't supporting the options we need.

Hmm. dtc doesn't really seem to do releases. Hence, there's no version
number available to check for here:-( (i.e. the features this series
rely on were added after 1.3.0, which is the most recent, but quite
old, tagged release).

I suppose I could ping them yet again on tagging a release...
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 06/16] sf: Update sf to support all sizes of flashes

2013-06-11 Thread Simon Glass
Hi,

On Tue, Jun 11, 2013 at 9:19 AM, Jagan Teki jagannadh.t...@gmail.comwrote:

 Hi Simon,

 On Tue, Jun 11, 2013 at 9:26 PM, Simon Glass s...@chromium.org wrote:
  Hi Jagan,
 
  On Tue, Jun 11, 2013 at 8:31 AM, Jagan Teki jagannadh.t...@gmail.com
  wrote:
 
  Hi Simon,
 
  On Tue, Jun 11, 2013 at 3:19 AM, Simon Glass s...@chromium.org wrote:
   On Mon, Jun 10, 2013 at 9:05 AM, Jagan Teki jagannadh.t...@gmail.com
 
   wrote:
  
   Hi Tom,
  
   On Sat, Jun 8, 2013 at 8:24 PM, Jagan Teki jagannadh.t...@gmail.com
 
   wrote:
Hi Simon,
   
On Sat, Jun 8, 2013 at 8:11 PM, Simon Glass s...@chromium.org
 wrote:
Hi,
   
On Sat, Jun 8, 2013 at 1:22 AM, Jagan Teki
jagannadh.t...@gmail.com
wrote:
   
Hi Simon,
   
On Sat, Jun 8, 2013 at 4:44 AM, Simon Glass s...@chromium.org
wrote:
 Hi Jagan,

 On Fri, May 31, 2013 at 5:52 AM, Jagannadha Sutradharudu Teki
 jagannadha.sutradharudu-t...@xilinx.com wrote:

 Updated the spi_flash framework to handle all sizes of flashes
 using bank/extd addr reg facility

 The current implementation in spi_flash supports 3-byte
 address
 mode
 due to this up to 16Mbytes amount of flash is able to access
 for
 those
 flashes which has an actual size of  16MB.

 As most of the flashes introduces a bank/extd address
 registers
 for accessing the flashes in 16Mbytes of banks if the flash
 size
 is  16Mbytes, this new scheme will add the bank selection
 feature
 for performing write/erase operations on all flashes.

 Signed-off-by: Jagannadha Sutradharudu Teki 
 jaga...@xilinx.com


 I have a few comments on this series, but it mostly looks
 fine. I
 think
 the
 new code is correct.

 The patches did not apply cleanly for me. Perhaps I am missing
 something. My
 tree looks like this after I did a bit of merging:
   
Which patches you had an issues while applying,we have few
 patches
on
u-boot-spi.git i created these on top of it.
   
   
I am not sure now - sorry I did not keep a record. But the bundle
 I
used is
here, and it doesn't apply cleanly.
   
http://patchwork.ozlabs.org/bundle/sjg/jagan/
   
git am ~/Downloads/bundle-4407-jagan.mbox
Applying: sf: Add bank address register writing support
Applying: sf: Add bank address register reading support
Applying: sf: Add extended addr write support for winbond|stmicro
Applying: sf: Add extended addr read support for winbond|stmicro
Applying: sf: read flash bank addr register at probe time
Applying: sf: Update sf to support all sizes of flashes
error: patch failed: drivers/mtd/spi/spi_flash.c:117
error: drivers/mtd/spi/spi_flash.c: patch does not apply
Patch failed at 0006 sf: Update sf to support all sizes of flashes
The copy of the patch that failed is found in:
   /home/sjg/u/.git/rebase-apply/patch
When you have resolved this problem, run git am --resolved.
If you prefer to skip this patch, run git am --skip instead.
To restore the original branch and stop patching, run git am
--abort
   
   
   

 5864e87 (HEAD, try-spi) cfi_flash: Fix detection of 8-bit bus
 flash
 devices
 via address shift
 f700095 sf: Add Flag status register polling support
 42f4b70 sf: Remove spi_flash_cmd_poll_bit()
 fc31387 sf: Use spi_flash_read_common() in write status poll
 923e40e sf: spansion: Add support for S25FL512S_256K
 c72e52a sf: stmicro: Add support for N25Q1024A
 4066f71 sf: stmicro: Add support for N25Q1024
 0efaf86 sf: stmicro: Add support for N25Q512A
 8fd962f sf: stmicro: Add support for N25Q512
 f1a2080 sf: Use spi_flash_addr() in write call
 31ed498 sf: Update sf read to support all sizes of flashes
 0f77642 sf: Update sf to support all sizes of flashes
 9e57220 sf: read flash bank addr register at probe time
 e99a43d sf: Add extended addr read support for winbond|stmicro
 2f06d56 sf: Add extended addr write support for winbond|stmicro
 f02ecf1 sf: Add bank address register reading support
 02ba27c sf: Add bank address register writing support

 Also do you think spi_flash_cmd_bankaddr_write() and related
 stuff
 should be
 behind a flag like CONFIG_SPI_BANK_ADDR or similar? How much
 code
 space
 does
 this add?
   
Initially i thought of the same, but I just updated sf which is
generic to all sizes of flashes.
due to this i haven't included the bank read/write on macros, and
the
flash ops will call these
bank write call irrespective of flash sizes.
   
As flashes which has below 16Mbytes will have a bank_curr value 0
so-that even bank write will exit for
bank 0 operations.
   
   
Yes this is fine.
   
   
   
+   if (flash-bank_curr == bank_sel) {
+   debug(SF: not require to enable bank%d\n,
bank_sel);
+

Re: [U-Boot] [PATCH] MIPS: mips64: fix typos in copyright text of start.S

2013-06-11 Thread Daniel Schwierzeck
2013/6/11 Gabor Juhos juh...@openwrt.org:
 Signed-off-by: Gabor Juhos juh...@openwrt.org
 Cc: Daniel Schwierzeck daniel.schwierz...@gmail.com
 ---
  arch/mips/cpu/mips64/start.S |6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)

 diff --git a/arch/mips/cpu/mips64/start.S b/arch/mips/cpu/mips64/start.S
 index dc7ce07..1ece6c2 100644
 --- a/arch/mips/cpu/mips64/start.S
 +++ b/arch/mips/cpu/mips64/start.S
 @@ -9,16 +9,16 @@
   * This program is free software; you can redistribute it and/or
   * modify it under the terms of the GNU General Public License as
   * published by the Free Software Foundation; either version 2 of
 - * the License, or (at your option) any dlater version.
 + * the License, or (at your option) any later version.
   *
   * This program is distributed in the hope that it will be useful,
   * but WITHOUT ANY WARRANTY; without even the implied warranty of
 - * MERCHANTABILITY or FITNESS FOR A PARTICUdlaR PURPOSE.  See the
 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   * GNU General Public License for more details.
   *
   * You should have received a copy of the GNU General Public License
   * along with this program; if not, write to the Free Software
 - * Foundation, Inc., 59 Temple Pdlace, Suite 330, Boston,
 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
   * MA 02111-1307 USA
   */

 --
 1.7.10


applied to u-boot-mips/next, thanks.

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


Re: [U-Boot] [PATCH v2 06/16] sf: Update sf to support all sizes of flashes

2013-06-11 Thread Jagan Teki
Hi Tom,

On Tue, Jun 11, 2013 at 9:46 PM, Tom Rini tr...@ti.com wrote:
 On Mon, Jun 10, 2013 at 02:49:35PM -0700, Simon Glass wrote:
 On Mon, Jun 10, 2013 at 9:05 AM, Jagan Teki jagannadh.t...@gmail.comwrote:

  Hi Tom,
 
  On Sat, Jun 8, 2013 at 8:24 PM, Jagan Teki jagannadh.t...@gmail.com
  wrote:
   Hi Simon,
  
   On Sat, Jun 8, 2013 at 8:11 PM, Simon Glass s...@chromium.org wrote:
   Hi,
  
   On Sat, Jun 8, 2013 at 1:22 AM, Jagan Teki jagannadh.t...@gmail.com
  wrote:
  
   Hi Simon,
  
   On Sat, Jun 8, 2013 at 4:44 AM, Simon Glass s...@chromium.org wrote:
Hi Jagan,
   
On Fri, May 31, 2013 at 5:52 AM, Jagannadha Sutradharudu Teki
jagannadha.sutradharudu-t...@xilinx.com wrote:
   
Updated the spi_flash framework to handle all sizes of flashes
using bank/extd addr reg facility
   
The current implementation in spi_flash supports 3-byte address mode
due to this up to 16Mbytes amount of flash is able to access for
  those
flashes which has an actual size of  16MB.
   
As most of the flashes introduces a bank/extd address registers
for accessing the flashes in 16Mbytes of banks if the flash size
is  16Mbytes, this new scheme will add the bank selection feature
for performing write/erase operations on all flashes.
   
Signed-off-by: Jagannadha Sutradharudu Teki jaga...@xilinx.com
   
   
I have a few comments on this series, but it mostly looks fine. I
  think
the
new code is correct.
   
The patches did not apply cleanly for me. Perhaps I am missing
something. My
tree looks like this after I did a bit of merging:
  
   Which patches you had an issues while applying,we have few patches on
   u-boot-spi.git i created these on top of it.
  
  
   I am not sure now - sorry I did not keep a record. But the bundle I
  used is
   here, and it doesn't apply cleanly.
  
   http://patchwork.ozlabs.org/bundle/sjg/jagan/
  
   git am ~/Downloads/bundle-4407-jagan.mbox
   Applying: sf: Add bank address register writing support
   Applying: sf: Add bank address register reading support
   Applying: sf: Add extended addr write support for winbond|stmicro
   Applying: sf: Add extended addr read support for winbond|stmicro
   Applying: sf: read flash bank addr register at probe time
   Applying: sf: Update sf to support all sizes of flashes
   error: patch failed: drivers/mtd/spi/spi_flash.c:117
   error: drivers/mtd/spi/spi_flash.c: patch does not apply
   Patch failed at 0006 sf: Update sf to support all sizes of flashes
   The copy of the patch that failed is found in:
  /home/sjg/u/.git/rebase-apply/patch
   When you have resolved this problem, run git am --resolved.
   If you prefer to skip this patch, run git am --skip instead.
   To restore the original branch and stop patching, run git am --abort
  
  
  
   
5864e87 (HEAD, try-spi) cfi_flash: Fix detection of 8-bit bus flash
devices
via address shift
f700095 sf: Add Flag status register polling support
42f4b70 sf: Remove spi_flash_cmd_poll_bit()
fc31387 sf: Use spi_flash_read_common() in write status poll
923e40e sf: spansion: Add support for S25FL512S_256K
c72e52a sf: stmicro: Add support for N25Q1024A
4066f71 sf: stmicro: Add support for N25Q1024
0efaf86 sf: stmicro: Add support for N25Q512A
8fd962f sf: stmicro: Add support for N25Q512
f1a2080 sf: Use spi_flash_addr() in write call
31ed498 sf: Update sf read to support all sizes of flashes
0f77642 sf: Update sf to support all sizes of flashes
9e57220 sf: read flash bank addr register at probe time
e99a43d sf: Add extended addr read support for winbond|stmicro
2f06d56 sf: Add extended addr write support for winbond|stmicro
f02ecf1 sf: Add bank address register reading support
02ba27c sf: Add bank address register writing support
   
Also do you think spi_flash_cmd_bankaddr_write() and related stuff
should be
behind a flag like CONFIG_SPI_BANK_ADDR or similar? How much code
  space
does
this add?
  
   Initially i thought of the same, but I just updated sf which is
   generic to all sizes of flashes.
   due to this i haven't included the bank read/write on macros, and the
   flash ops will call these
   bank write call irrespective of flash sizes.
  
   As flashes which has below 16Mbytes will have a bank_curr value 0
   so-that even bank write will exit for
   bank 0 operations.
  
  
   Yes this is fine.
  
  
  
   +   if (flash-bank_curr == bank_sel) {
   +   debug(SF: not require to enable bank%d\n, bank_sel);
   +   return 0;
   +   }
   +
  
   And due to these framework changes bank+flash ops addition, bin size
   increases appr' ~600bytes
   by enabling stmicro, winbond and spansion flash drivers.(please check
   the size from your end also if required)
  
  
   I suggest you make that function a nop (perhaps using an #ifdef
   CONFIG_SPI_BANK_ADDR inside it or some other name) so that your 

Re: [U-Boot] [PATCH v2] powerpc/85xx: Add P1023RDB board support

2013-06-11 Thread Scott Wood

On 06/09/2013 05:24:05 AM, Chunhe Lan wrote:

+   /* W**G* - Flash, localbus */
+   /* This will be changed to *I*G* after relocation to RAM. */
+	SET_TLB_ENTRY(1, CONFIG_SYS_FLASH_BASE,  
CONFIG_SYS_FLASH_BASE_PHYS,

+ MAS3_SX|MAS3_SW|MAS3_SR, MAS2_W|MAS2_G,
+ 0, 2, BOOKE_PAGESZ_256M, 1),


Do not set MAS3_SX on I/O regions.


+   /* Bman/Qman */
+	SET_TLB_ENTRY(1, CONFIG_SYS_BMAN_MEM_BASE,  
CONFIG_SYS_BMAN_MEM_PHYS,

+ MAS3_SX|MAS3_SW|MAS3_SR, 0,
+ 0, 7, BOOKE_PAGESZ_1M, 1),
+   SET_TLB_ENTRY(1, CONFIG_SYS_BMAN_MEM_BASE + 0x0010,
+ CONFIG_SYS_BMAN_MEM_PHYS + 0x0010,
+ MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
+ 0, 8, BOOKE_PAGESZ_1M, 1),
+	SET_TLB_ENTRY(1, CONFIG_SYS_QMAN_MEM_BASE,  
CONFIG_SYS_QMAN_MEM_PHYS,

+ MAS3_SX|MAS3_SW|MAS3_SR, MAS2_M,
+ 0, 9, BOOKE_PAGESZ_1M, 1),
+   SET_TLB_ENTRY(1, CONFIG_SYS_QMAN_MEM_BASE + 0x0010,
+ CONFIG_SYS_QMAN_MEM_PHYS + 0x0010,
+ MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
+ 0, 10, BOOKE_PAGESZ_1M, 1),


Likewise.


+/*
+ * Memory map
+ *
+ * 0x_	0x1fff_	DDR			500M  
Cacheable


500M?  Are you sure?

+ * 0x8000_	0xbfff_	PCI Express Mem		1G  
non-cacheable
+ * 0xc000_	0xdfff_	PCI			512M  
non-cacheable
+ * 0xe100_	0xe3ff_	PCI IO range		4M  
non-cacheable

+ * 0xff00_ 0xff3f_ DPAA_QBMAN  4M
+ *
+ * Localbus non-cacheable
+ *
+ * 0xec00_	0xefff_	NOR flash		64M NOR  
flash
+ * 0xff60_	0xff7f_	CCSR			2M  
non-cacheable
+ * 0xffa0_	0xffaf_	NAND			1M  
non-cacheable
+ * 0xffd0_	0xffd0_3fff	init ram		16K  
Cacheable TLB0

+ */


The init ram is neither non-cacheable nor on the localbus.  CCSR is  
also not on the localbus.



+/*
+ * For booting Linux, the board info and command line data
+ * have to be in the first 16 MB of memory, since this is
+ * the maximum mapped by the Linux kernel during initialization.
+ */
+#define CONFIG_SYS_BOOTMAPSZ	(16  20) /* Initial Memory map for  
Linux*/
+#define CONFIG_SYS_BOOTM_LEN	(16  20) /* Increase max gunzip size  
*/


It's 64 MiB on 85xx.  Please watch the blind copy-and-paste.   
Especially, why are you blindly copying from a non-85xx config file?



+#if defined(CONFIG_CMD_KGDB)
+#define CONFIG_KGDB_BAUDRATE	230400	/* speed to run kgdb serial  
port */
+#define CONFIG_KGDB_SER_INDEX	2	/* which serial port to  
use */

+#endif


Get rid of this.


+#define CONFIG_BOOTDELAY 10/* -1 disables auto-boot */


The out-of-the-box environment is not going to work unmodified (I don't  
even see a CONFIG_BOOTCOMMAND), so let's just default this to -1 now  
that it no longer has the affect of disabling the code at compile-time.


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


[U-Boot] [PATCH v2 0/21] Add tracing functionality to U-Boot

2013-06-11 Thread Simon Glass
This series adds a tracing feature to U-Boot which is useful for
profiling boot time and other purposes.

The core trace library relies on standard gcc function instrumentation
and a microsecond timer which should work correctly on almost any
architecture. Generic board is used to avoid the need to add the same
code in multiple places (CONFIG_SYS_GENERIC_BOARD).

Tracing must be built into the U-Boot image at build time, but can be
paused and resumed while running. A trace buffer is used to collect
trace information. This buffer can then be transmitted to a host for
processing. A host-based processing tool is provided which converts the
data to the same format used by Linux, and that can be read by the
pytimechart GUI tool.

A U-Boot 'trace' command provides access to the trace information,
including support for writing it to memory in a few forms.

Support is provided for stopping tracing at the last possible moment in
the bootm process (just before U-Boot jumps to the OS). This is done with
a new 'fake go' command, which allows bootm to go through the motions of
an OS boot without actually committing to it. Once the 'fake go' is
complete, U-Boot can stop tracing and continue execution to transmit the
trace information to the host, before jumping to the OS for real.

The system is tested on sandbox, x86 and smdk5250/snow. It may work
correctly on Tegra and other machines but unfortunately has not been
tested. A simple test script is provided for sandbox, along with
documentation on how to use the feature.

This feature has been successfully used alongside bootstage to locate
bottlenecks and reduce overall boot time.

Changes in v2:
- Add cast to clarfy argument type on sandbox and x86
- Add new patch to convert PCI inline functions to static inline
- Add new patch to enable tracing on Exynos5
- Add new patch to enable tracing on coreboot
- Add new patch to fix FIT compile error for x86
- Add new patch to fix compiler warning in do_mem_loop()
- Add new patch to support tracing on x86
- Add notification that the trace test has passed
- Adjust printf() type to avoid warning on x86
- Change init sequence so that mon_len is set up before trace
- Fix bracket typo
- Fix missing BOOTM_STATE_OS_PREP in do_bootm()
- Fix tag to use : instead of ;
- Rebase on top of mainline
- Remove unneeded debug printf()s for non RFC version
- Update board_f support for new mainline relocaddr use

Simon Glass (21):
  pci: Convert extern inline functions to static inline
  x86: Correct missing local variable in bootm
  Fix missing return in do_mem_loop()
  Show stdout on error in fit-test
  bootstage: Correct printf types
  Add function to print a number with grouped digits
  Add trace library
  Add a trace command
  Support tracing in config.mk when enabled
  Add trace support to generic board
  Add proftool to decode profile data
  sandbox: Support trace feature
  Add a simple test for sandbox trace
  Clarify bootm OS arguments
  Refactor the bootm command to reduce code duplication
  Add a 'fake' go command to the bootm command
  arm: Implement the 'fake' go command
  exynos: Avoid function instrumentation for microsecond timer
  exynos: config: Add tracing options
  x86: Support tracing function
  x86: config: Add tracing options

 Makefile   |   3 +-
 arch/arm/cpu/armv7/s5p-common/timer.c  |   2 +-
 arch/arm/include/asm/arch-exynos/cpu.h |  10 +-
 arch/arm/lib/bootm.c   |  33 +-
 arch/microblaze/lib/bootm.c|   4 +-
 arch/nios2/lib/bootm.c |   4 +-
 arch/openrisc/lib/bootm.c  |   4 +-
 arch/sandbox/cpu/cpu.c |   2 +-
 arch/sandbox/cpu/os.c  |   2 +-
 arch/x86/include/asm/global_data.h |   2 +-
 arch/x86/include/asm/msr.h |   3 +-
 arch/x86/include/asm/u-boot-x86.h  |   2 +-
 arch/x86/lib/bootm.c   |   2 +
 arch/x86/lib/gcc.c |   4 +-
 arch/x86/lib/tsc_timer.c   |   6 +-
 common/Makefile|   1 +
 common/board_f.c   |  17 +-
 common/board_r.c   |  11 +
 common/bootstage.c |  26 +-
 common/cmd_bootm.c | 514 ++-
 common/cmd_mem.c   |   2 +
 common/cmd_trace.c | 133 +++
 common/image-fdt.c |  13 +-
 common/image.c |  22 +-
 config.mk  |  11 +-
 doc/README.trace   | 361 +++
 include/asm-generic/global_data.h  |   3 +
 include/common.h   |   4 +
 include/configs/coreboot.h |   7 +
 include/configs/exynos5250-dt.h|   8 +
 include/configs/sandbox.h  |  13 +
 include/image.h|  17 +-
 include/pci.h  |   4 +-
 include/trace.h| 125 +++
 include/vsprintf.h  

[U-Boot] [PATCH v2 02/21] x86: Correct missing local variable in bootm

2013-06-11 Thread Simon Glass
Enabling FIT produces a compile error. Fix this.

Signed-off-by: Simon Glass s...@chromium.org
---
Changes in v2:
- Add new patch to fix FIT compile error for x86

 arch/x86/lib/bootm.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/x86/lib/bootm.c b/arch/x86/lib/bootm.c
index 2520228..0d3250c 100644
--- a/arch/x86/lib/bootm.c
+++ b/arch/x86/lib/bootm.c
@@ -63,6 +63,8 @@ int do_bootm_linux(int flag, int argc, char * const argv[],
}
 #if defined(CONFIG_FIT)
} else if (images-fit_uname_os) {
+   int ret;
+
ret = fit_image_get_data(images-fit_hdr_os,
images-fit_noffset_os, data, len);
if (ret) {
-- 
1.8.3

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


[U-Boot] [PATCH v2 13/21] Add a simple test for sandbox trace

2013-06-11 Thread Simon Glass
It is difficult to automatically test tracing on most architectures, but
with sandbox it is easy enough to do a simple sanity check.

Signed-off-by: Simon Glass s...@chromium.org
---
Changes in v2:
- Add notification that the trace test has passed

 test/trace/test-trace.sh | 89 
 1 file changed, 89 insertions(+)
 create mode 100755 test/trace/test-trace.sh

diff --git a/test/trace/test-trace.sh b/test/trace/test-trace.sh
new file mode 100755
index 000..696a396
--- /dev/null
+++ b/test/trace/test-trace.sh
@@ -0,0 +1,89 @@
+# Copyright (c) 2013 The Chromium OS Authors.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+# Simple test script for tracing with sandbox
+
+OUTPUT_DIR=sandbox
+TRACE_OPT=FTRACE=1
+
+fail() {
+   echo Test failed: $1
+   if [ -n ${tmp} ]; then
+   rm ${tmp}
+   fi
+   exit 1
+}
+
+build_uboot() {
+   echo Build sandbox
+   OPTS=O=${OUTPUT_DIR} ${TRACE_OPT}
+   NUM_CPUS=$(grep -c processor /proc/cpuinfo)
+   make ${OPTS} sandbox_config
+   make ${OPTS} -s -j${NUM_CPUS}
+}
+
+run_trace() {
+   echo Run trace
+   ./${OUTPUT_DIR}/u-boot END
+   trace stats
+   hash sha256 0 1
+   trace pause
+   trace stats
+   hash sha256 0 1
+   trace stats
+   trace resume
+   hash sha256 0 1
+   trace pause
+   trace stats
+   reset
+END
+}
+
+check_results() {
+   echo Check results
+
+   # Expect sha256 to run 3 times, so we see the string 6 times
+   if [ $(grep -c sha256 ${tmp}) -ne 6 ]; then
+   fail sha256 error
+   fi
+
+   # 4 sets of results (output of 'trace stats')
+   if [ $(grep -c traced function calls ${tmp}) -ne 4 ]; then
+   fail trace output error
+   fi
+
+   # Check trace counts. We expect to see an increase in the number of
+   # traced function calls between each 'trace stats' command, except
+   # between calls 2 and 3, where tracing is paused.
+   # This code gets the sign of the difference between each number and
+   # its predecessor.
+   counts=$(tr -d , ${tmp} | awk '/traced function calls/ { diff = $1 - 
upto; upto = $1; printf %d , diff  0 ? -1 : (diff  0 ? 1 : 0)}')
+
+   if [ ${counts} != 1 1 0 1  ]; then
+   fail trace collection error: ${counts}
+   fi
+}
+
+echo Simple trace test / sanity check using sandbox
+echo
+tmp=$(tempfile)
+build_uboot
+run_trace ${tmp}
+check_results ${tmp}
+rm ${tmp}
+echo Test passed
-- 
1.8.3

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


[U-Boot] [PATCH v2 01/21] pci: Convert extern inline functions to static inline

2013-06-11 Thread Simon Glass
I am not sure of the meaning of extern inline, but this gives errors
when building with function instrumenting enabled. Change these functions
to static inline.

Signed-off-by: Simon Glass s...@chromium.org
---
Changes in v2:
- Add new patch to convert PCI inline functions to static inline

 include/pci.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/pci.h b/include/pci.h
index f9c5148..98ba151 100644
--- a/include/pci.h
+++ b/include/pci.h
@@ -462,7 +462,7 @@ struct pci_region {
 #define PCI_REGION_SYS_MEMORY  0x0100  /* System memory */
 #define PCI_REGION_RO  0x0200  /* Read-only memory */
 
-extern __inline__ void pci_set_region(struct pci_region *reg,
+static inline void pci_set_region(struct pci_region *reg,
  pci_addr_t bus_start,
  phys_addr_t phys_start,
  pci_size_t size,
@@ -548,7 +548,7 @@ struct pci_controller {
void *priv_data;
 };
 
-extern __inline__ void pci_set_ops(struct pci_controller *hose,
+static inline void pci_set_ops(struct pci_controller *hose,
   int (*read_byte)(struct pci_controller*,
pci_dev_t, int where, u8 *),
   int (*read_word)(struct pci_controller*,
-- 
1.8.3

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


[U-Boot] [PATCH v2 07/21] Add trace library

2013-06-11 Thread Simon Glass
Add a library which supports tracing of execution using built-in gcc
features and a microsecond timer. This can be used to record a list of
function which are executed, along with a timestamp for each. Later
this information can be sent to the host for processing.

Signed-off-by: Simon Glass s...@chromium.org
---
Changes in v2:
- Adjust printf() type to avoid warning on x86

 doc/README.trace | 361 
 include/common.h |   4 +
 include/trace.h  | 125 ++
 lib/Makefile |   1 +
 lib/trace.c  | 379 +++
 5 files changed, 870 insertions(+)
 create mode 100644 doc/README.trace
 create mode 100644 include/trace.h
 create mode 100644 lib/trace.c

diff --git a/doc/README.trace b/doc/README.trace
new file mode 100644
index 000..b535c06
--- /dev/null
+++ b/doc/README.trace
@@ -0,0 +1,361 @@
+#
+# Copyright (c) 2013 The Chromium OS Authors.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundatio; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+Tracing in U-Boot
+=
+
+U-Boot supports a simple tracing feature which allows a record of excecution
+to be collected and sent to a host machine for analysis. At present the
+main use for this is to profile boot time.
+
+
+Overview
+
+
+The trace feature uses GCC's instrument-functions feature to trace all
+function entry/exit points. These are then recorded in a memory buffer.
+The memory buffer can be saved to the host over a network link using
+tftpput or by writing to an attached memory device such as MMC.
+
+On the host, the file is first converted with a tool called 'proftool',
+which extracts useful information from it. The resulting trace output
+resembles that emitted by Linux's ftrace feature, so can be visually
+displayed by pytimechart.
+
+
+Quick-start using Sandbox
+-
+
+Sandbox is a build of U-Boot that can run under Linux so it is a convenient
+way of trying out tracing before you use it on your actual board. To do
+this, follow these steps:
+
+Add the following to include/configs/sandbox.h (if not already there)
+
+#define CONFIG_TRACE
+#define CONFIG_CMD_TRACE
+#define CONFIG_TRACE_BUFFER_SIZE   (16  20)
+#define CONFIG_TRACE_EARLY_SIZE(8  20)
+#define CONFIG_TRACE_EARLY
+#define CONFIG_TRACE_EARLY_ADDR0x0010
+
+Build sandbox U-Boot with tracing enabled:
+
+$ make FTRACE=1 O=sandbox sandbox_config
+$ make FTRACE=1 O=sandbox
+
+Run sandbox, wait for a bit of trace information to appear, and then capture
+a trace:
+
+$ ./sandbox/u-boot
+
+
+U-Boot 2013.04-rc2-00100-ga72fcef (Apr 17 2013 - 19:25:24)
+
+DRAM:  128 MiB
+trace: enabled
+Using default environment
+
+In:serial
+Out:   serial
+Err:   serial
+=trace stats
+671,406 function sites
+ 69,712 function calls
+  0 untracked function calls
+ 73,373 traced function calls
+ 16 maximum observed call depth
+ 15 call depth limit
+ 66,491 calls not traced due to depth
+=trace stats
+671,406 function sites
+  1,279,450 function calls
+  0 untracked function calls
+950,490 traced function calls (333217 dropped due to overflow)
+ 16 maximum observed call depth
+ 15 call depth limit
+  1,275,767 calls not traced due to depth
+=trace calls 0 e0
+Call list dumped to , size 0xae0a40
+=print
+baudrate=115200
+profbase=0
+profoffset=ae0a40
+profsize=e0
+stderr=serial
+stdin=serial
+stdout=serial
+
+Environment size: 117/8188 bytes
+=sb save host 0 trace 0 ${profoffset}
+11405888 bytes written in 10 ms (1.1 GiB/s)
+=reset
+
+
+Then run proftool to convert the trace information to ftrace format.
+
+$ ./sandbox/tools/proftool -m sandbox/System.map -p trace dump-ftrace 
trace.txt
+
+Finally run pytimechart to display it:
+
+$ pytimechart trace.txt
+
+Using this tool you can zoom and pan across the trace, with the function
+calls on the left and little marks representing the start and end of each
+function.
+
+
+CONFIG Options
+--
+
+- CONFIG_TRACE
+   Enables the trace feature in U-Boot.
+
+- CONFIG_CMD_TRACE
+   Enables the trace command.
+
+- CONFIG_TRACE_BUFFER_SIZE
+   Size of trace buffer to allocate for 

[U-Boot] [PATCH v2 03/21] Fix missing return in do_mem_loop()

2013-06-11 Thread Simon Glass
For some reason this does not normally cause a compiler warning, but the code
seems to be incorrect. Add the missing return.

Signed-off-by: Simon Glass s...@chromium.org
---
Changes in v2:
- Add new patch to fix compiler warning in do_mem_loop()

 common/cmd_mem.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/common/cmd_mem.c b/common/cmd_mem.c
index 6df00b1..77eafa0 100644
--- a/common/cmd_mem.c
+++ b/common/cmd_mem.c
@@ -551,6 +551,8 @@ static int do_mem_loop(cmd_tbl_t *cmdtp, int flag, int argc,
*cp++;
}
unmap_sysmem(buf);
+
+   return 0;
 }
 
 #ifdef CONFIG_LOOPW
-- 
1.8.3

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


[U-Boot] [PATCH v2 08/21] Add a trace command

2013-06-11 Thread Simon Glass
Add a trace command with sub-commands to start/stop tracing, print out
statistics and dump trace information to memory for later upload to a host.

Signed-off-by: Simon Glass s...@chromium.org
---
Changes in v2:
- Add cast to clarfy argument type on sandbox and x86

 common/Makefile|   1 +
 common/cmd_trace.c | 133 +
 2 files changed, 134 insertions(+)
 create mode 100644 common/cmd_trace.c

diff --git a/common/Makefile b/common/Makefile
index 3ba4316..d40fb1f 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -171,6 +171,7 @@ COBJS-$(CONFIG_CMD_SPIBOOTLDR) += cmd_spibootldr.o
 COBJS-$(CONFIG_CMD_STRINGS) += cmd_strings.o
 COBJS-$(CONFIG_CMD_TERMINAL) += cmd_terminal.o
 COBJS-$(CONFIG_CMD_TIME) += cmd_time.o
+COBJS-$(CONFIG_CMD_TRACE) += cmd_trace.o
 COBJS-$(CONFIG_SYS_HUSH_PARSER) += cmd_test.o
 COBJS-$(CONFIG_CMD_TPM) += cmd_tpm.o
 COBJS-$(CONFIG_CMD_TSI148) += cmd_tsi148.o
diff --git a/common/cmd_trace.c b/common/cmd_trace.c
new file mode 100644
index 000..ec3137a
--- /dev/null
+++ b/common/cmd_trace.c
@@ -0,0 +1,133 @@
+/*
+ * Copyright (c) 2011 The Chromium OS Authors.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include common.h
+#include command.h
+#include trace.h
+#include asm/io.h
+
+static int get_args(int argc, char * const argv[], char **buff,
+   size_t *buff_ptr, size_t *buff_size)
+{
+   if (argc  2)
+   return -1;
+   if (argc  4) {
+   *buff_size = getenv_ulong(profsize, 16, 0);
+   *buff = map_sysmem(getenv_ulong(profbase, 16, 0),
+  *buff_size);
+   *buff_ptr = getenv_ulong(profoffset, 16, 0);
+   } else {
+   *buff_size = simple_strtoul(argv[3], NULL, 16);
+   *buff = map_sysmem(simple_strtoul(argv[2], NULL, 16),
+  *buff_size);
+   *buff_ptr = 0;
+   };
+   return 0;
+}
+
+static int create_func_list(int argc, char * const argv[])
+{
+   size_t buff_size, avail, buff_ptr, used;
+   unsigned int needed;
+   char *buff;
+   int err;
+
+   if (get_args(argc, argv, buff, buff_ptr, buff_size))
+   return -1;
+
+   avail = buff_size - buff_ptr;
+   err = trace_list_functions(buff + buff_ptr, avail, needed);
+   if (err)
+   printf(Error: truncated (%#x bytes needed)\n, needed);
+   used = min(avail, needed);
+   printf(Function trace dumped to %08lx, size %#zx\n,
+  (ulong)map_to_sysmem(buff + buff_ptr), used);
+   setenv_hex(profbase, map_to_sysmem(buff));
+   setenv_hex(profsize, buff_size);
+   setenv_hex(profoffset, buff_ptr + used);
+
+   return 0;
+}
+
+static int create_call_list(int argc, char * const argv[])
+{
+   size_t buff_size, avail, buff_ptr, used;
+   unsigned int needed;
+   char *buff;
+   int err;
+
+   if (get_args(argc, argv, buff, buff_ptr, buff_size))
+   return -1;
+
+   avail = buff_size - buff_ptr;
+   err = trace_list_calls(buff + buff_ptr, avail, needed);
+   if (err)
+   printf(Error: truncated (%#x bytes needed)\n, needed);
+   used = min(avail, needed);
+   printf(Call list dumped to %08lx, size %#zx\n,
+  (ulong)map_to_sysmem(buff + buff_ptr), used);
+
+   setenv_hex(profbase, map_to_sysmem(buff));
+   setenv_hex(profsize, buff_size);
+   setenv_hex(profoffset, buff_ptr + used);
+
+   return 0;
+}
+
+int do_trace(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+{
+   const char *cmd = argc  2 ? NULL : argv[1];
+
+   if (!cmd)
+   return cmd_usage(cmdtp);
+   switch (*cmd) {
+   case 'p':
+   trace_set_enabled(0);
+   break;
+   case 'c':
+   if (create_call_list(argc, argv))
+   return cmd_usage(cmdtp);
+   break;
+   case 'r':
+   trace_set_enabled(1);
+   break;
+   case 'f':
+   if (create_func_list(argc, argv))
+   return cmd_usage(cmdtp);
+   break;
+   case 's':
+   trace_print_stats();
+   break;
+   default:
+   

[U-Boot] [PATCH v2 21/21] x86: config: Add tracing options

2013-06-11 Thread Simon Glass
Add configs to enable tracing when it is needed.

Signed-off-by: Simon Glass s...@chromium.org
---
Changes in v2:
- Add new patch to enable tracing on coreboot

 include/configs/coreboot.h | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/include/configs/coreboot.h b/include/configs/coreboot.h
index 2fefdc8..288ef8d 100644
--- a/include/configs/coreboot.h
+++ b/include/configs/coreboot.h
@@ -168,6 +168,13 @@
  */
 #include config_cmd_default.h
 
+#define CONFIG_TRACE
+#define CONFIG_CMD_TRACE
+#define CONFIG_TRACE_BUFFER_SIZE   (16  20)
+#define CONFIG_TRACE_EARLY_SIZE(8  20)
+#define CONFIG_TRACE_EARLY
+#define CONFIG_TRACE_EARLY_ADDR0x0140
+
 #define CONFIG_CMD_BDI
 #define CONFIG_CMD_BOOTD
 #define CONFIG_CMD_CONSOLE
-- 
1.8.3

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


[U-Boot] [PATCH v2 04/21] Show stdout on error in fit-test

2013-06-11 Thread Simon Glass
When this test fails it is useful to see the output from U-Boot. Add
printing of this information on failure.

Signed-off-by: Simon Glass s...@chromium.org
---
Changes in v2: None

 test/image/test-fit.py | 19 ++-
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/test/image/test-fit.py b/test/image/test-fit.py
index c4e8211..aad9f59 100755
--- a/test/image/test-fit.py
+++ b/test/image/test-fit.py
@@ -272,12 +272,13 @@ def set_test(name):
 test_name = name
 print name
 
-def fail(msg):
+def fail(msg, stdout):
 Raise an error with a helpful failure message
 
 Args:
 msg: Message to display
 
+print stdout
 raise ValueError(Test '%s' failed: %s % (test_name, msg))
 
 def run_fit_test(mkimage, u_boot):
@@ -341,11 +342,11 @@ def run_fit_test(mkimage, u_boot):
 set_test('Kernel load')
 stdout = command.Output(u_boot, '-d', control_dtb, '-c', cmd)
 if read_file(kernel) != read_file(kernel_out):
-fail('Kernel not loaded')
+fail('Kernel not loaded', stdout)
 if read_file(control_dtb) == read_file(fdt_out):
-fail('FDT loaded but should be ignored')
+fail('FDT loaded but should be ignored', stdout)
 if read_file(ramdisk) == read_file(ramdisk_out):
-fail('Ramdisk loaded but should not be')
+fail('Ramdisk loaded but should not be', stdout)
 
 # Find out the offset in the FIT where U-Boot has found the FDT
 line = find_matching(stdout, 'Booting using the fdt blob at ')
@@ -357,7 +358,7 @@ def run_fit_test(mkimage, u_boot):
 real_fit_offset = data.find(fdt_magic, 4)
 if fit_offset != real_fit_offset:
 fail('U-Boot loaded FDT from offset %#x, FDT is actually at %#x' %
-(fit_offset, real_fit_offset))
+(fit_offset, real_fit_offset), stdout)
 
 # Now a kernel and an FDT
 set_test('Kernel + FDT load')
@@ -365,11 +366,11 @@ def run_fit_test(mkimage, u_boot):
 fit = make_fit(mkimage, params)
 stdout = command.Output(u_boot, '-d', control_dtb, '-c', cmd)
 if read_file(kernel) != read_file(kernel_out):
-fail('Kernel not loaded')
+fail('Kernel not loaded', stdout)
 if read_file(control_dtb) != read_file(fdt_out):
-fail('FDT not loaded')
+fail('FDT not loaded', stdout)
 if read_file(ramdisk) == read_file(ramdisk_out):
-fail('Ramdisk loaded but should not be')
+fail('Ramdisk loaded but should not be', stdout)
 
 # Try a ramdisk
 set_test('Kernel + FDT + Ramdisk load')
@@ -378,7 +379,7 @@ def run_fit_test(mkimage, u_boot):
 fit = make_fit(mkimage, params)
 stdout = command.Output(u_boot, '-d', control_dtb, '-c', cmd)
 if read_file(ramdisk) != read_file(ramdisk_out):
-fail('Ramdisk not loaded')
+fail('Ramdisk not loaded', stdout)
 
 def run_tests():
 Parse options, run the FIT tests and print the result
-- 
1.8.3

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


[U-Boot] [PATCH v2 05/21] bootstage: Correct printf types

2013-06-11 Thread Simon Glass
The unstash code is a bit loose with its printf() types, which gives
warnings on sandbox. Correct this.

Signed-off-by: Simon Glass s...@chromium.org
---
Changes in v2:
- Fix tag to use : instead of ;

 common/bootstage.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/common/bootstage.c b/common/bootstage.c
index c5c6996..f5027ef 100644
--- a/common/bootstage.c
+++ b/common/bootstage.c
@@ -445,9 +445,9 @@ int bootstage_unstash(void *base, int size)
}
 
if (hdr-count * sizeof(*rec)  hdr-size) {
-   debug(%s: Bootstage has %d records needing %d bytes, but 
+   debug(%s: Bootstage has %d records needing %lu bytes, but 
only %d bytes is available\n, __func__, hdr-count,
- hdr-count * sizeof(*rec), hdr-size);
+ (ulong)hdr-count * sizeof(*rec), hdr-size);
return -1;
}
 
-- 
1.8.3

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


[U-Boot] [PATCH v2 15/21] Refactor the bootm command to reduce code duplication

2013-06-11 Thread Simon Glass
At present the bootm code is mostly duplicated for the plain 'bootm'
command and its sub-command variant. This makes the code harder to
maintain and means that changes must be made to several places.

Introduce do_bootm_states() which performs selected portions of the bootm
work, so that both plain 'bootm' and 'bootm sub_command' can use the
same code.

Additional duplication exists in bootz, so tidy that up as well. This
is not intended to change behaviour, apart from minor fixes where the
previously-duplicated code missed some chunks of code.

Signed-off-by: Simon Glass s...@chromium.org
---
Changes in v2:
- Fix missing BOOTM_STATE_OS_PREP in do_bootm()
- Rebase on top of mainline
- Remove unneeded debug printf()s for non RFC version

 common/cmd_bootm.c | 457 +
 include/image.h|  16 +-
 2 files changed, 225 insertions(+), 248 deletions(-)

diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c
index 0e8a221..821c702 100644
--- a/common/cmd_bootm.c
+++ b/common/cmd_bootm.c
@@ -105,7 +105,7 @@ static const void *boot_get_kernel(cmd_tbl_t *cmdtp, int 
flag, int argc,
  *  - loaded (first part of) image to header load address,
  *  - disabled interrupts.
  *
- * @flag: Command flags (CMD_FLAG_...)
+ * @flag: Flags indicating what to do (BOOTM_STATE_...)
  * @argc: Number of arguments. Note that the arguments are shifted down
  *  so that 0 is the first argument not processed by U-Boot, and
  *  argc is adjusted accordingly. This avoids confusion as to how
@@ -208,15 +208,21 @@ static inline void boot_start_lmb(bootm_headers_t 
*images) { }
 
 static int bootm_start(cmd_tbl_t *cmdtp, int flag, int argc, char * const 
argv[])
 {
-   const void *os_hdr;
-   int ret;
-
memset((void *)images, 0, sizeof(images));
images.verify = getenv_yesno(verify);
 
boot_start_lmb(images);
 
bootstage_mark_name(BOOTSTAGE_ID_BOOTM_START, bootm_start);
+   images.state = BOOTM_STATE_START;
+
+   return 0;
+}
+
+static int bootm_find_os(cmd_tbl_t *cmdtp, int flag, int argc,
+char * const argv[])
+{
+   const void *os_hdr;
 
/* get kernel image header, start address and length */
os_hdr = boot_get_kernel(cmdtp, flag, argc, argv,
@@ -279,6 +285,8 @@ static int bootm_start(cmd_tbl_t *cmdtp, int flag, int 
argc, char * const argv[]
images.ep = image_get_ep(images.legacy_hdr_os_copy);
 #if defined(CONFIG_FIT)
} else if (images.fit_uname_os) {
+   int ret;
+
ret = fit_image_get_entry(images.fit_hdr_os,
  images.fit_noffset_os, images.ep);
if (ret) {
@@ -296,6 +304,16 @@ static int bootm_start(cmd_tbl_t *cmdtp, int flag, int 
argc, char * const argv[]
images.ep += images.os.load;
}
 
+   images.os.start = (ulong)os_hdr;
+
+   return 0;
+}
+
+static int bootm_find_other(cmd_tbl_t *cmdtp, int flag, int argc,
+   char * const argv[])
+{
+   int ret;
+
if (((images.os.type == IH_TYPE_KERNEL) ||
 (images.os.type == IH_TYPE_KERNEL_NOLOAD) ||
 (images.os.type == IH_TYPE_MULTI)) 
@@ -321,9 +339,6 @@ static int bootm_start(cmd_tbl_t *cmdtp, int flag, int 
argc, char * const argv[]
 #endif
}
 
-   images.os.start = (ulong)os_hdr;
-   images.state = BOOTM_STATE_START;
-
return 0;
 }
 
@@ -455,7 +470,7 @@ static int bootm_load_os(image_info_t os, ulong *load_end, 
int boot_progress)
return 0;
 }
 
-static int bootm_start_standalone(ulong iflag, int argc, char * const argv[])
+static int bootm_start_standalone(int argc, char * const argv[])
 {
char  *s;
int   (*appl)(int, char * const []);
@@ -487,103 +502,208 @@ static cmd_tbl_t cmd_bootm_sub[] = {
U_BOOT_CMD_MKENT(go, 0, 1, (void *)BOOTM_STATE_OS_GO, , ),
 };
 
+static int boot_selected_os(int argc, char * const argv[], int state,
+   bootm_headers_t *images, boot_os_fn *boot_fn, ulong *iflag)
+{
+   if (images-os.type == IH_TYPE_STANDALONE) {
+   /* This may return when 'autostart' is 'no' */
+   bootm_start_standalone(argc, argv);
+   return 0;
+   }
+   /*
+* We have reached the point of no return: we are going to
+* overwrite all exception vector code, so we cannot easily
+* recover from any failures any more...
+*/
+   *iflag = disable_interrupts();
+#ifdef CONFIG_NETCONSOLE
+   /* Stop the ethernet stack if NetConsole could have left it up */
+   eth_halt();
+#endif
+
+#if defined(CONFIG_CMD_USB)
+   /*
+* turn off USB to prevent the host controller from writing to the
+* SDRAM while Linux is booting. This could happen (at least for OHCI
+* controller), because the HCCA (Host Controller Communication Area)
+* lies within the SDRAM and the host 

[U-Boot] [PATCH v2 17/21] arm: Implement the 'fake' go command

2013-06-11 Thread Simon Glass
Implement this feature on ARM for tracing.

It would be nice to have generic bootm support so that it is easily
implemented on any arch.

Signed-off-by: Simon Glass s...@chromium.org
---
Changes in v2: None

 arch/arm/lib/bootm.c | 33 +
 1 file changed, 21 insertions(+), 12 deletions(-)

diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c
index 1b6e0ac..28fba19 100644
--- a/arch/arm/lib/bootm.c
+++ b/arch/arm/lib/bootm.c
@@ -68,12 +68,19 @@ void arch_lmb_reserve(struct lmb *lmb)
gd-bd-bi_dram[0].start + gd-bd-bi_dram[0].size - sp);
 }
 
-static void announce_and_cleanup(void)
+/**
+ * announce_and_cleanup() - Print message and prepare for kernel boot
+ *
+ * @fake: non-zero to do everything except actually boot
+ */
+static void announce_and_cleanup(int fake)
 {
-   printf(\nStarting kernel ...\n\n);
+   printf(\nStarting kernel ...%s\n\n, fake ?
+   (fake run for tracing) : );
bootstage_mark_name(BOOTSTAGE_ID_BOOTM_HANDOFF, start_kernel);
 #ifdef CONFIG_BOOTSTAGE_FDT
-   bootstage_fdt_add_report();
+   if (flag == BOOTM_STATE_OS_FAKE_GO)
+   bootstage_fdt_add_report();
 #endif
 #ifdef CONFIG_BOOTSTAGE_REPORT
bootstage_report();
@@ -225,14 +232,15 @@ static void boot_prep_linux(bootm_headers_t *images)
 }
 
 /* Subcommand: GO */
-static void boot_jump_linux(bootm_headers_t *images)
+static void boot_jump_linux(bootm_headers_t *image, int flag)
 {
unsigned long machid = gd-bd-bi_arch_number;
char *s;
void (*kernel_entry)(int zero, int arch, uint params);
unsigned long r2;
+   int fake = (flag  BOOTM_STATE_OS_FAKE_GO);
 
-   kernel_entry = (void (*)(int, int, uint))images-ep;
+   kernel_entry = (void (*)(int, int, uint))image-ep;
 
s = getenv(machid);
if (s) {
@@ -243,14 +251,15 @@ static void boot_jump_linux(bootm_headers_t *images)
debug(## Transferring control to Linux (at address %08lx) \
...\n, (ulong) kernel_entry);
bootstage_mark(BOOTSTAGE_ID_RUN_OS);
-   announce_and_cleanup();
+   announce_and_cleanup(fake);
 
-   if (IMAGE_ENABLE_OF_LIBFDT  images-ft_len)
-   r2 = (unsigned long)images-ft_addr;
+   if (IMAGE_ENABLE_OF_LIBFDT  image-ft_len)
+   r2 = (unsigned long)image-ft_addr;
else
r2 = gd-bd-bi_boot_params;
 
-   kernel_entry(0, machid, r2);
+   if (!fake)
+   kernel_entry(0, machid, r2);
 }
 
 /* Main Entry point for arm bootm implementation
@@ -270,13 +279,13 @@ int do_bootm_linux(int flag, int argc, char *argv[], 
bootm_headers_t *images)
return 0;
}
 
-   if (flag  BOOTM_STATE_OS_GO) {
-   boot_jump_linux(images);
+   if (flag  (BOOTM_STATE_OS_GO | BOOTM_STATE_OS_FAKE_GO)) {
+   boot_jump_linux(images, flag);
return 0;
}
 
boot_prep_linux(images);
-   boot_jump_linux(images);
+   boot_jump_linux(images, flag);
return 0;
 }
 
-- 
1.8.3

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


[U-Boot] [PATCH v2 18/21] exynos: Avoid function instrumentation for microsecond timer

2013-06-11 Thread Simon Glass
For tracing to work it has to be able to access the microsecond timer
without causing a recursive call to the function entry/exit handlers.
Add attributes to the relevant functions to support this.

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

Signed-off-by: Simon Glass s...@chromium.org
---
Changes in v2: None

 arch/arm/cpu/armv7/s5p-common/timer.c  |  2 +-
 arch/arm/include/asm/arch-exynos/cpu.h | 10 ++
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/arch/arm/cpu/armv7/s5p-common/timer.c 
b/arch/arm/cpu/armv7/s5p-common/timer.c
index 4adfaae..637593c 100644
--- a/arch/arm/cpu/armv7/s5p-common/timer.c
+++ b/arch/arm/cpu/armv7/s5p-common/timer.c
@@ -95,7 +95,7 @@ unsigned long get_timer(unsigned long base)
return time_ms - base;
 }
 
-unsigned long timer_get_us(void)
+unsigned long __attribute__((no_instrument_function)) timer_get_us(void)
 {
static unsigned long base_time_us;
 
diff --git a/arch/arm/include/asm/arch-exynos/cpu.h 
b/arch/arm/include/asm/arch-exynos/cpu.h
index f76e489..6b1b54f 100644
--- a/arch/arm/include/asm/arch-exynos/cpu.h
+++ b/arch/arm/include/asm/arch-exynos/cpu.h
@@ -175,7 +175,7 @@ static inline char *s5p_get_cpu_name(void)
 }
 
 #define IS_SAMSUNG_TYPE(type, id)  \
-static inline int cpu_is_##type(void)  \
+static inline int __attribute__((no_instrument_function)) cpu_is_##type(void) \
 {  \
return (s5p_cpu_id  12) == id;\
 }
@@ -184,7 +184,8 @@ IS_SAMSUNG_TYPE(exynos4, 0x4)
 IS_SAMSUNG_TYPE(exynos5, 0x5)
 
 #define IS_EXYNOS_TYPE(type, id)   \
-static inline int proid_is_##type(void)\
+static inline int __attribute__((no_instrument_function)) \
+   proid_is_##type(void)   \
 {  \
return s5p_cpu_id == id;\
 }
@@ -194,9 +195,10 @@ IS_EXYNOS_TYPE(exynos4412, 0x4412)
 IS_EXYNOS_TYPE(exynos5250, 0x5250)
 
 #define SAMSUNG_BASE(device, base) \
-static inline unsigned int samsung_get_base_##device(void) \
+static inline unsigned int __attribute__((no_instrument_function)) \
+   samsung_get_base_##device(void) \
 {  \
-   if (cpu_is_exynos4()) { \
+   if (cpu_is_exynos4()) { \
if (proid_is_exynos4412())  \
return EXYNOS4X12_##base;   \
return EXYNOS4_##base;  \
-- 
1.8.3

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


[U-Boot] [PATCH v2 06/21] Add function to print a number with grouped digits

2013-06-11 Thread Simon Glass
Move bootstage's numbering printing code into a generic place so that it can
be used by tracing also.

Signed-off-by: Simon Glass s...@chromium.org
---
Changes in v2: None

 common/bootstage.c | 22 --
 include/vsprintf.h | 11 +++
 lib/vsprintf.c | 16 
 3 files changed, 31 insertions(+), 18 deletions(-)

diff --git a/common/bootstage.c b/common/bootstage.c
index f5027ef..94a32a9 100644
--- a/common/bootstage.c
+++ b/common/bootstage.c
@@ -49,6 +49,7 @@ static int next_id = BOOTSTAGE_ID_USER;
 enum {
BOOTSTAGE_VERSION   = 0,
BOOTSTAGE_MAGIC = 0xb00757a3,
+   BOOTSTAGE_DIGITS= 9,
 };
 
 struct bootstage_hdr {
@@ -165,21 +166,6 @@ uint32_t bootstage_accum(enum bootstage_id id)
return duration;
 }
 
-static void print_time(unsigned long us_time)
-{
-   char str[15], *s;
-   int grab = 3;
-
-   /* We don't seem to have %'d in U-Boot */
-   sprintf(str, %12lu, us_time);
-   for (s = str + 3; *s; s += grab) {
-   if (s != str + 3)
-   putc(s[-1] != ' ' ? ',' : ' ');
-   printf(%.*s, grab, s);
-   grab = 3;
-   }
-}
-
 /**
  * Get a record name as a printable string
  *
@@ -208,10 +194,10 @@ static uint32_t print_time_record(enum bootstage_id id,
 
if (prev == -1U) {
printf(%11s, );
-   print_time(rec-time_us);
+   print_grouped_ull(rec-time_us, BOOTSTAGE_DIGITS);
} else {
-   print_time(rec-time_us);
-   print_time(rec-time_us - prev);
+   print_grouped_ull(rec-time_us, BOOTSTAGE_DIGITS);
+   print_grouped_ull(rec-time_us - prev, BOOTSTAGE_DIGITS);
}
printf(  %s\n, get_record_name(buf, sizeof(buf), rec));
 
diff --git a/include/vsprintf.h b/include/vsprintf.h
index 651077c..6568854 100644
--- a/include/vsprintf.h
+++ b/include/vsprintf.h
@@ -178,4 +178,15 @@ int vscnprintf(char *buf, size_t size, const char *fmt, 
va_list args);
 #define vscnprintf(buf, size, fmt, args...) vsprintf(buf, fmt, ##args)
 #endif /* CONFIG_SYS_VSNPRINTF */
 
+/**
+ * print_grouped_ull() - print a value with digits grouped by ','
+ *
+ * This prints a value with grouped digits, like 12,345,678 to make it easier
+ * to read.
+ *
+ * @val:   Value to print
+ * @digits:Number of digiits to print
+ */
+void print_grouped_ull(unsigned long long int_val, int digits);
+
 #endif
diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index 533a96b..82e5c13 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -870,3 +870,19 @@ char *simple_itoa(ulong i)
} while (i  0);
return p + 1;
 }
+
+/* We don't seem to have %'d in U-Boot */
+void print_grouped_ull(unsigned long long int_val, int digits)
+{
+   char str[21], *s;
+   int grab = 3;
+
+   digits = (digits + 2) / 3;
+   sprintf(str, %*llu, digits * 3, int_val);
+   for (s = str; *s; s += grab) {
+   if (s != str)
+   putc(s[-1] != ' ' ? ',' : ' ');
+   printf(%.*s, grab, s);
+   grab = 3;
+   }
+}
-- 
1.8.3

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


[U-Boot] [PATCH v2 12/21] sandbox: Support trace feature

2013-06-11 Thread Simon Glass
Support tracing on sandbox by adding suitable CONFIG options. To enable it,
compile U-Boot with FTRACE=1.

The timer functions are marked to skip tracing, since these are called from
the tracing code itself, and we want to avoid an infinite loop.

Signed-off-by: Simon Glass s...@chromium.org
---
Changes in v2: None

 arch/sandbox/cpu/cpu.c|  2 +-
 arch/sandbox/cpu/os.c |  2 +-
 include/configs/sandbox.h | 13 +
 3 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/arch/sandbox/cpu/cpu.c b/arch/sandbox/cpu/cpu.c
index dd8d495..e9385de 100644
--- a/arch/sandbox/cpu/cpu.c
+++ b/arch/sandbox/cpu/cpu.c
@@ -37,7 +37,7 @@ void __udelay(unsigned long usec)
os_usleep(usec);
 }
 
-unsigned long timer_get_us(void)
+unsigned long __attribute__((no_instrument_function)) timer_get_us(void)
 {
return os_get_nsec() / 1000;
 }
diff --git a/arch/sandbox/cpu/os.c b/arch/sandbox/cpu/os.c
index d075407..541e450 100644
--- a/arch/sandbox/cpu/os.c
+++ b/arch/sandbox/cpu/os.c
@@ -152,7 +152,7 @@ void os_usleep(unsigned long usec)
usleep(usec);
 }
 
-u64 os_get_nsec(void)
+u64 __attribute__((no_instrument_function)) os_get_nsec(void)
 {
 #if defined(CLOCK_MONOTONIC)  defined(_POSIX_MONOTONIC_CLOCK)
struct timespec tp;
diff --git a/include/configs/sandbox.h b/include/configs/sandbox.h
index 788207d..d704329 100644
--- a/include/configs/sandbox.h
+++ b/include/configs/sandbox.h
@@ -22,6 +22,19 @@
 #ifndef __CONFIG_H
 #define __CONFIG_H
 
+#ifdef FTRACE
+#define CONFIG_TRACE
+#define CONFIG_CMD_TRACE
+#define CONFIG_TRACE_BUFFER_SIZE   (16  20)
+#define CONFIG_TRACE_EARLY_SIZE(8  20)
+#define CONFIG_TRACE_EARLY
+#define CONFIG_TRACE_EARLY_ADDR0x0010
+
+#endif
+
+#define CONFIG_BOOTSTAGE
+#define CONFIG_BOOTSTAGE_REPORT
+
 /* Number of bits in a C 'long' on this architecture */
 #define CONFIG_SANDBOX_BITS_PER_LONG   64
 
-- 
1.8.3

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


[U-Boot] [PATCH v2 11/21] Add proftool to decode profile data

2013-06-11 Thread Simon Glass
This tool provides the facility to decode U-Boot trace data and write out
a text file in Linux ftrace format for use with pytimechart.

Signed-off-by: Simon Glass s...@chromium.org
---
Changes in v2: None

 Makefile |   3 +-
 tools/.gitignore |   1 +
 tools/Makefile   |   6 +
 tools/proftool.c | 611 +++
 4 files changed, 620 insertions(+), 1 deletion(-)
 create mode 100644 tools/proftool.c

diff --git a/Makefile b/Makefile
index ef154aa..29af07a 100644
--- a/Makefile
+++ b/Makefile
@@ -824,7 +824,8 @@ clean:
   $(obj)tools/mk{smdk5250,}spl   \
   $(obj)tools/mxsboot\
   $(obj)tools/ncb $(obj)tools/ubsha1 \
-  $(obj)tools/kernel-doc/docproc
+  $(obj)tools/kernel-doc/docproc \
+  $(obj)tools/proftool
@rm -f $(obj)board/cray/L1/{bootscript.c,bootscript.image}\
   $(obj)board/matrix_vision/*/bootscript.img \
   $(obj)board/voiceblue/eeprom   \
diff --git a/tools/.gitignore b/tools/.gitignore
index 9bce719..a7fee26 100644
--- a/tools/.gitignore
+++ b/tools/.gitignore
@@ -9,6 +9,7 @@
 /mxsboot
 /ncb
 /ncp
+/proftool
 /ubsha1
 /xway-swap-bytes
 /*.exe
diff --git a/tools/Makefile b/tools/Makefile
index 26eb500..569dc77 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -74,6 +74,7 @@ BIN_FILES-$(CONFIG_MX28) += mxsboot$(SFX)
 BIN_FILES-$(CONFIG_NETCONSOLE) += ncb$(SFX)
 BIN_FILES-$(CONFIG_SHA1_CHECK_UB_IMG) += ubsha1$(SFX)
 BIN_FILES-$(CONFIG_KIRKWOOD) += kwboot$(SFX)
+BIN_FILES-y += proftool(SFX)
 
 # Source files which exist outside the tools directory
 EXT_OBJ_FILES-$(CONFIG_BUILD_ENVCRC) += common/env_embedded.o
@@ -87,6 +88,7 @@ EXT_OBJ_FILES-y += lib/sha1.o
 OBJ_FILES-$(CONFIG_LCD_LOGO) += bmp_logo.o
 OBJ_FILES-$(CONFIG_VIDEO_LOGO) += bmp_logo.o
 NOPED_OBJ_FILES-y += default_image.o
+NOPED_OBJ_FILES-y += proftool.o
 OBJ_FILES-$(CONFIG_BUILD_ENVCRC) += envcrc.o
 NOPED_OBJ_FILES-y += fit_image.o
 OBJ_FILES-$(CONFIG_CMD_NET) += gen_eth_addr.o
@@ -187,6 +189,10 @@ $(obj)bmp_logo$(SFX):  $(obj)bmp_logo.o
$(HOSTCC) $(HOSTCFLAGS) $(HOSTLDFLAGS) -o $@ $^
$(HOSTSTRIP) $@
 
+$(obj)proftool(SFX):   $(obj)proftool.o
+   $(HOSTCC) $(HOSTCFLAGS) $(HOSTLDFLAGS) -o $@ $^
+   $(HOSTSTRIP) $@
+
 $(obj)envcrc$(SFX):$(obj)crc32.o $(obj)env_embedded.o $(obj)envcrc.o 
$(obj)sha1.o
$(HOSTCC) $(HOSTCFLAGS) $(HOSTLDFLAGS) -o $@ $^
 
diff --git a/tools/proftool.c b/tools/proftool.c
new file mode 100644
index 000..a48ed28
--- /dev/null
+++ b/tools/proftool.c
@@ -0,0 +1,611 @@
+/*
+ * Copyright (c) 2013 Google, Inc
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+/* Decode and dump U-Boot profiling information */
+
+#include assert.h
+#include ctype.h
+#include limits.h
+#include regex.h
+#include stdarg.h
+#include stdio.h
+#include stdlib.h
+#include string.h
+#include unistd.h
+#include sys/param.h
+
+#include compiler.h
+#include trace.h
+
+#define MAX_LINE_LEN 500
+
+enum {
+   FUNCF_TRACE = 1  0,   /* Include this function in trace */
+};
+
+struct func_info {
+   unsigned long offset;
+   const char *name;
+   unsigned long code_size;
+   unsigned long call_count;
+   unsigned flags;
+   /* the section this function is in */
+   struct objsection_info *objsection;
+};
+
+enum trace_line_type {
+   TRACE_LINE_INCLUDE,
+   TRACE_LINE_EXCLUDE,
+};
+
+struct trace_configline_info {
+   struct trace_configline_info *next;
+   enum trace_line_type type;
+   const char *name;   /* identifier name / wildcard */
+   regex_t regex;  /* Regex to use if name starts with / */
+};
+
+/* The contents of the trace config file */
+struct trace_configline_info *trace_config_head;
+
+struct func_info *func_list;
+int func_count;
+struct trace_call *call_list;
+int call_count;
+int verbose;   /* Verbosity level 0=none, 1=warn, 2=notice, 3=info, 4=debug */
+unsigned long text_offset; /* text address of first function */
+
+static void outf(int level, const char *fmt, ...)
+   __attribute__ ((format 

[U-Boot] [PATCH v2 16/21] Add a 'fake' go command to the bootm command

2013-06-11 Thread Simon Glass
For tracing it is useful to run as much of U-Boot as possible so as to get
a complete picture. Quite a bit of work happens in bootm, and we don't want
to have to stop tracing before bootm starts.

Add a way of doing a 'fake' boot of the OS - which does everything up to
the point where U-Boot is about to jump to the OS image. This allows
tracing to record right until the end.

This requires arch support to work.

Signed-off-by: Simon Glass s...@chromium.org
---
Changes in v2:
- Rebase on top of mainline

 common/cmd_bootm.c | 19 +--
 include/image.h|  3 ++-
 2 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c
index 821c702..3c4be8a 100644
--- a/common/cmd_bootm.c
+++ b/common/cmd_bootm.c
@@ -499,6 +499,7 @@ static cmd_tbl_t cmd_bootm_sub[] = {
U_BOOT_CMD_MKENT(cmdline, 0, 1, (void *)BOOTM_STATE_OS_CMDLINE, , ),
U_BOOT_CMD_MKENT(bdt, 0, 1, (void *)BOOTM_STATE_OS_BD_T, , ),
U_BOOT_CMD_MKENT(prep, 0, 1, (void *)BOOTM_STATE_OS_PREP, , ),
+   U_BOOT_CMD_MKENT(fake, 0, 1, (void *)BOOTM_STATE_OS_FAKE_GO, , ),
U_BOOT_CMD_MKENT(go, 0, 1, (void *)BOOTM_STATE_OS_GO, , ),
 };
 
@@ -539,6 +540,8 @@ static int boot_selected_os(int argc, char * const argv[], 
int state,
 #endif
arch_preboot_os();
boot_fn(state, argc, argv, images);
+   if (state == BOOTM_STATE_OS_FAKE_GO) /* We expect to return */
+   return 0;
bootstage_error(BOOTSTAGE_ID_BOOT_OS_RETURNED);
 #ifdef DEBUG
puts(\n## Control returned to monitor - resetting...\n);
@@ -645,6 +648,17 @@ static int do_bootm_states(cmd_tbl_t *cmdtp, int flag, int 
argc,
if (!ret  (states  BOOTM_STATE_OS_PREP))
ret = boot_fn(BOOTM_STATE_OS_PREP, argc, argv, images);
 
+#ifdef CONFIG_TRACE
+   /* Pretend to run the OS, then run a user command */
+   if (!ret  (states  BOOTM_STATE_OS_FAKE_GO)) {
+   char *cmd_list = getenv(fakegocmd);
+
+   ret = boot_selected_os(argc, argv, BOOTM_STATE_OS_FAKE_GO,
+   images, boot_fn, iflag);
+   if (!ret  cmd_list)
+   ret = run_command_list(cmd_list, -1, flag);
+   }
+#endif
/* Now run the OS! We hope this doesn't return */
if (!ret  (states  BOOTM_STATE_OS_GO))
ret = boot_selected_os(argc, argv, BOOTM_STATE_OS_GO,
@@ -754,7 +768,7 @@ int do_bootm(cmd_tbl_t *cmdtp, int flag, int argc, char * 
const argv[])
return do_bootm_states(cmdtp, flag, argc, argv, BOOTM_STATE_START |
BOOTM_STATE_FINDOS | BOOTM_STATE_FINDOTHER |
BOOTM_STATE_LOADOS | BOOTM_STATE_OS_PREP |
-   BOOTM_STATE_OS_GO, images, 1);
+   BOOTM_STATE_OS_FAKE_GO | BOOTM_STATE_OS_GO, images, 1);
 }
 
 int bootm_maybe_autostart(cmd_tbl_t *cmdtp, const char *cmd)
@@ -1731,7 +1745,8 @@ static int do_bootz(cmd_tbl_t *cmdtp, int flag, int argc, 
char * const argv[])
return 1;
 
ret = do_bootm_states(cmdtp, flag, argc, argv,
- BOOTM_STATE_OS_GO, images, 1);
+ BOOTM_STATE_OS_FAKE_GO | BOOTM_STATE_OS_GO,
+ images, 1);
 
return ret;
 }
diff --git a/include/image.h b/include/image.h
index 8675a82..4415bcf 100644
--- a/include/image.h
+++ b/include/image.h
@@ -328,7 +328,8 @@ typedef struct bootm_headers {
 #defineBOOTM_STATE_OS_CMDLINE  (0x0040)
 #defineBOOTM_STATE_OS_BD_T (0x0080)
 #defineBOOTM_STATE_OS_PREP (0x0100)
-#defineBOOTM_STATE_OS_GO   (0x0200)
+#defineBOOTM_STATE_OS_FAKE_GO  (0x0200)/* 'Almost' run the OS 
*/
+#defineBOOTM_STATE_OS_GO   (0x0400)
int state;
 
 #ifdef CONFIG_LMB
-- 
1.8.3

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


[U-Boot] [PATCH v2 19/21] exynos: config: Add tracing options

2013-06-11 Thread Simon Glass
Add tracing to Exynos5 boards, so that tracing can be enabled when building
with 'make FTRACE=1'. We use a 16MB trace buffer.

Signed-off-by: Simon Glass s...@chromium.org
---
Changes in v2:
- Add new patch to enable tracing on Exynos5

 include/configs/exynos5250-dt.h | 8 
 1 file changed, 8 insertions(+)

diff --git a/include/configs/exynos5250-dt.h b/include/configs/exynos5250-dt.h
index 41d6cf9..111b47d 100644
--- a/include/configs/exynos5250-dt.h
+++ b/include/configs/exynos5250-dt.h
@@ -43,6 +43,14 @@
 #define CONFIG_OF_CONTROL
 #define CONFIG_OF_SEPARATE
 
+/* Allow tracing to be enabled */
+#define CONFIG_TRACE
+#define CONFIG_CMD_TRACE
+#define CONFIG_TRACE_BUFFER_SIZE   (16  20)
+#define CONFIG_TRACE_EARLY_SIZE(8  20)
+#define CONFIG_TRACE_EARLY
+#define CONFIG_TRACE_EARLY_ADDR0x5000
+
 /* Keep L2 Cache Disabled */
 #define CONFIG_SYS_DCACHE_OFF
 
-- 
1.8.3

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


[U-Boot] [PATCH v2 20/21] x86: Support tracing function

2013-06-11 Thread Simon Glass
Some changes are needed to x86 timer functions to support tracing. Add
these so that the feature works correctly.

Signed-off-by: Simon Glass s...@chromium.org
---
Changes in v2:
- Add new patch to support tracing on x86

 arch/x86/include/asm/global_data.h | 2 +-
 arch/x86/include/asm/msr.h | 3 ++-
 arch/x86/include/asm/u-boot-x86.h  | 2 +-
 arch/x86/lib/gcc.c | 4 +++-
 arch/x86/lib/tsc_timer.c   | 6 +++---
 5 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/arch/x86/include/asm/global_data.h 
b/arch/x86/include/asm/global_data.h
index 4fdb080..9a2056a 100644
--- a/arch/x86/include/asm/global_data.h
+++ b/arch/x86/include/asm/global_data.h
@@ -40,7 +40,7 @@ struct arch_global_data {
 #include asm-generic/global_data.h
 
 #ifndef __ASSEMBLY__
-static inline gd_t *get_fs_gd_ptr(void)
+static inline __attribute__((no_instrument_function)) gd_t *get_fs_gd_ptr(void)
 {
gd_t *gd_ptr;
 
diff --git a/arch/x86/include/asm/msr.h b/arch/x86/include/asm/msr.h
index 6030633..b459a63 100644
--- a/arch/x86/include/asm/msr.h
+++ b/arch/x86/include/asm/msr.h
@@ -85,7 +85,8 @@ static inline unsigned long long native_read_tscp(unsigned 
int *aux)
 #define EAX_EDX_RET(val, low, high)=A (val)
 #endif
 
-static inline unsigned long long native_read_msr(unsigned int msr)
+static inline __attribute__((no_instrument_function))
+   unsigned long long native_read_msr(unsigned int msr)
 {
DECLARE_ARGS(val, low, high);
 
diff --git a/arch/x86/include/asm/u-boot-x86.h 
b/arch/x86/include/asm/u-boot-x86.h
index 22e0934..709dc84 100644
--- a/arch/x86/include/asm/u-boot-x86.h
+++ b/arch/x86/include/asm/u-boot-x86.h
@@ -64,7 +64,7 @@ void  board_init_f_r_trampoline(ulong) __attribute__ 
((noreturn));
 void   board_init_f_r(void) __attribute__ ((noreturn));
 
 /* Read the time stamp counter */
-static inline uint64_t rdtsc(void)
+static inline __attribute__((no_instrument_function)) uint64_t rdtsc(void)
 {
uint32_t high, low;
__asm__ __volatile__(rdtsc : =a (low), =d (high));
diff --git a/arch/x86/lib/gcc.c b/arch/x86/lib/gcc.c
index 4043431..497ad75 100644
--- a/arch/x86/lib/gcc.c
+++ b/arch/x86/lib/gcc.c
@@ -28,7 +28,9 @@
 #define WRAP_LIBGCC_CALL(type, name) \
type __normal_##name(type a, type b) __attribute__((regparm(0))); \
type __wrap_##name(type a, type b); \
-   type __wrap_##name(type a, type b) { return __normal_##name(a, b); }
+   type __attribute__((no_instrument_function)) \
+   __wrap_##name(type a, type b) \
+{ return __normal_##name(a, b); }
 
 WRAP_LIBGCC_CALL(long long, __divdi3)
 WRAP_LIBGCC_CALL(unsigned long long, __udivdi3)
diff --git a/arch/x86/lib/tsc_timer.c b/arch/x86/lib/tsc_timer.c
index c509801..0688973 100644
--- a/arch/x86/lib/tsc_timer.c
+++ b/arch/x86/lib/tsc_timer.c
@@ -37,7 +37,7 @@ void timer_set_base(u64 base)
  * restart. This yields a free running counter guaranteed to take almost 6
  * years to wrap around even at 100GHz clock rate.
  */
-u64 get_ticks(void)
+u64 __attribute__((no_instrument_function)) get_ticks(void)
 {
u64 now_tick = rdtsc();
 
@@ -50,7 +50,7 @@ u64 get_ticks(void)
 #define PLATFORM_INFO_MSR 0xce
 
 /* Get the speed of the TSC timer in MHz */
-unsigned long get_tbclk_mhz(void)
+unsigned __attribute__((no_instrument_function)) long get_tbclk_mhz(void)
 {
u32 ratio;
u64 platform_info = native_read_msr(PLATFORM_INFO_MSR);
@@ -75,7 +75,7 @@ ulong get_timer(ulong base)
return get_ms_timer() - base;
 }
 
-ulong timer_get_us(void)
+ulong __attribute__((no_instrument_function)) timer_get_us(void)
 {
return get_ticks() / get_tbclk_mhz();
 }
-- 
1.8.3

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


[U-Boot] [PATCH v2 10/21] Add trace support to generic board

2013-06-11 Thread Simon Glass
Add hooks for tracing to generic board, including:

- allow early tracing to start early as possible in U-Boot
- reserve memory for trace buffer
- copy early trace buffer to main trace buffer after relocation
- setup full tracing support after relocation

Signed-off-by: Simon Glass s...@chromium.org
---
Changes in v2:
- Change init sequence so that mon_len is set up before trace
- Update board_f support for new mainline relocaddr use

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

diff --git a/common/board_f.c b/common/board_f.c
index 8efdb63..ab4242a 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -53,6 +53,7 @@
 #include os.h
 #include post.h
 #include spi.h
+#include trace.h
 #include watchdog.h
 #include asm/errno.h
 #include asm/io.h
@@ -500,6 +501,18 @@ static int reserve_lcd(void)
 }
 #endif /* CONFIG_LCD */
 
+static int reserve_trace(void)
+{
+#ifdef CONFIG_TRACE
+   gd-relocaddr -= CONFIG_TRACE_BUFFER_SIZE;
+   gd-trace_buff = map_sysmem(gd-relocaddr, CONFIG_TRACE_BUFFER_SIZE);
+   debug(Reserving %dk for trace data at: %08lx\n,
+ CONFIG_TRACE_BUFFER_SIZE  10, gd-relocaddr);
+#endif
+
+   return 0;
+}
+
 #if defined(CONFIG_VIDEO)  (!defined(CONFIG_PPC) || defined(CONFIG_8xx)) \
 !defined(CONFIG_ARM)  !defined(CONFIG_X86)
 static int reserve_video(void)
@@ -818,8 +831,9 @@ static init_fnc_t init_sequence_f[] = {
 #ifdef CONFIG_SANDBOX
setup_ram_buf,
 #endif
-   setup_fdt,
setup_mon_len,
+   setup_fdt,
+   trace_early_init,
 #if defined(CONFIG_MPC85xx) || defined(CONFIG_MPC86xx)
/* TODO: can this go into arch_cpu_init()? */
probecpu,
@@ -963,6 +977,7 @@ static init_fnc_t init_sequence_f[] = {
 #ifdef CONFIG_LCD
reserve_lcd,
 #endif
+   reserve_trace,
/* TODO: Why the dependency on CONFIG_8xx? */
 #if defined(CONFIG_VIDEO)  (!defined(CONFIG_PPC) || defined(CONFIG_8xx)) \
 !defined(CONFIG_ARM)  !defined(CONFIG_X86)
diff --git a/common/board_r.c b/common/board_r.c
index f5649c9..f7a036e 100644
--- a/common/board_r.c
+++ b/common/board_r.c
@@ -58,6 +58,7 @@
 #include serial.h
 #include spi.h
 #include stdio_dev.h
+#include trace.h
 #include watchdog.h
 #ifdef CONFIG_ADDR_MAP
 #include asm/mmu.h
@@ -106,6 +107,15 @@ static int initr_secondary_cpu(void)
return 0;
 }
 
+static int initr_trace(void)
+{
+#ifdef CONFIG_TRACE
+   trace_init(gd-trace_buff, CONFIG_TRACE_BUFFER_SIZE);
+#endif
+
+   return 0;
+}
+
 static int initr_reloc(void)
 {
gd-flags |= GD_FLG_RELOC;  /* tell others: relocation done */
@@ -711,6 +721,7 @@ static int run_main_loop(void)
  * TODO: perhaps reset the watchdog in the initcall function after each call?
  */
 init_fnc_t init_sequence_r[] = {
+   initr_trace,
initr_reloc,
/* TODO: could x86/PPC have this also perhaps? */
 #ifdef CONFIG_ARM
diff --git a/include/asm-generic/global_data.h 
b/include/asm-generic/global_data.h
index 3e9ca11..8cfc3fa 100644
--- a/include/asm-generic/global_data.h
+++ b/include/asm-generic/global_data.h
@@ -82,6 +82,9 @@ typedef struct global_data {
unsigned long fdt_size; /* Space reserved for relocated FDT */
void **jt;  /* jump table */
char env_buf[32];   /* buffer for getenv() before reloc. */
+#ifdef CONFIG_TRACE
+   void*trace_buff;/* The trace buffer */
+#endif
struct arch_global_data arch;   /* architecture-specific data */
 } gd_t;
 #endif
-- 
1.8.3

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


[U-Boot] [PATCH v2 09/21] Support tracing in config.mk when enabled

2013-06-11 Thread Simon Glass
Use -finstrument-functions when tracing is enabled (make FTRACE=1).
Tracing is not currently supported by SPL even if sufficient memory is
available.

When tracing is enabled, we #define FTRACE. This can be used by
board config files to conditionally enable the tracing options.

Signed-off-by: Simon Glass s...@chromium.org
---
Changes in v2: None

 config.mk | 11 ++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/config.mk b/config.mk
index ddf350e..63d25ac 100644
--- a/config.mk
+++ b/config.mk
@@ -268,6 +268,16 @@ CFLAGS += $(CFLAGS_WARN)
 CFLAGS_STACK := $(call cc-option,-fstack-usage)
 CFLAGS += $(CFLAGS_STACK)
 
+BCURDIR = $(subst $(SRCTREE)/,,$(CURDIR:$(obj)%=%))
+
+ifeq ($(findstring examples/,$(BCURDIR)),)
+ifeq ($(CONFIG_SPL_BUILD),)
+ifdef FTRACE
+CFLAGS += -finstrument-functions -DFTRACE
+endif
+endif
+endif
+
 # $(CPPFLAGS) sets -g, which causes gcc to pass a suitable -gformat
 # option to the assembler.
 AFLAGS_DEBUG :=
@@ -330,7 +340,6 @@ export  CONFIG_SYS_TEXT_BASE PLATFORM_CPPFLAGS 
PLATFORM_RELFLAGS CPPFLAGS CFLAGS
 #
 
 # Allow boards to use custom optimize flags on a per dir/file basis
-BCURDIR = $(subst $(SRCTREE)/,,$(CURDIR:$(obj)%=%))
 ALL_AFLAGS = $(AFLAGS) $(AFLAGS_$(BCURDIR)/$(@F)) $(AFLAGS_$(BCURDIR))
 ALL_CFLAGS = $(CFLAGS) $(CFLAGS_$(BCURDIR)/$(@F)) $(CFLAGS_$(BCURDIR))
 EXTRA_CPPFLAGS = $(CPPFLAGS_$(BCURDIR)/$(@F)) $(CPPFLAGS_$(BCURDIR))
-- 
1.8.3

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


[U-Boot] [PATCH v2 14/21] Clarify bootm OS arguments

2013-06-11 Thread Simon Glass
At present the arguments to bootm are processed in a somewhat confusing
way. Sub-functions must know how many arguments their calling functions
have processed, and the OS boot function must also have this information.
Also it isn't obvious that 'bootm' and 'bootm start' provide arguments in
the same way.

Adjust the code so that arguments are removed from the list before calling
a sub-function. This means that all functions can know that argv[0] is the
first argument of which they need to take notice.

Signed-off-by: Simon Glass s...@chromium.org
---
Changes in v2:
- Fix bracket typo

 arch/microblaze/lib/bootm.c |  4 ++--
 arch/nios2/lib/bootm.c  |  4 ++--
 arch/openrisc/lib/bootm.c   |  4 ++--
 common/cmd_bootm.c  | 44 ++--
 common/image-fdt.c  | 13 -
 common/image.c  | 22 ++
 6 files changed, 54 insertions(+), 37 deletions(-)

diff --git a/arch/microblaze/lib/bootm.c b/arch/microblaze/lib/bootm.c
index 3842709..b328f94 100644
--- a/arch/microblaze/lib/bootm.c
+++ b/arch/microblaze/lib/bootm.c
@@ -62,8 +62,8 @@ int do_bootm_linux(int flag, int argc, char * const argv[],
 
bootstage_mark(BOOTSTAGE_ID_RUN_OS);
 
-   if (!of_flat_tree  argc  3)
-   of_flat_tree = (char *)simple_strtoul(argv[3], NULL, 16);
+   if (!of_flat_tree  argc  1)
+   of_flat_tree = (char *)simple_strtoul(argv[1], NULL, 16);
 
/* fixup the initrd now that we know where it should be */
if (images-rd_start  images-rd_end  of_flat_tree)
diff --git a/arch/nios2/lib/bootm.c b/arch/nios2/lib/bootm.c
index f32be52..114e146 100644
--- a/arch/nios2/lib/bootm.c
+++ b/arch/nios2/lib/bootm.c
@@ -40,8 +40,8 @@ int do_bootm_linux(int flag, int argc, char * const argv[], 
bootm_headers_t *ima
if (images-ft_len)
of_flat_tree = images-ft_addr;
 #endif
-   if (!of_flat_tree  argc  3)
-   of_flat_tree = (char *)simple_strtoul(argv[3], NULL, 16);
+   if (!of_flat_tree  argc  1)
+   of_flat_tree = (char *)simple_strtoul(argv[1], NULL, 16);
if (of_flat_tree)
initrd_end = (ulong)of_flat_tree;
 
diff --git a/arch/openrisc/lib/bootm.c b/arch/openrisc/lib/bootm.c
index 2c5d9ae..7f716b8 100644
--- a/arch/openrisc/lib/bootm.c
+++ b/arch/openrisc/lib/bootm.c
@@ -63,8 +63,8 @@ int do_bootm_linux(int flag, int argc, char * const argv[],
 
show_boot_progress(15);
 
-   if (!of_flat_tree  argc  3)
-   of_flat_tree = (char *)simple_strtoul(argv[3], NULL, 16);
+   if (!of_flat_tree  argc  1)
+   of_flat_tree = (char *)simple_strtoul(argv[1], NULL, 16);
 #ifdef DEBUG
printf(## Transferring control to Linux (at address 0x%08lx)  \
ramdisk 0x%08lx, FDT 0x%08lx...\n,
diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c
index 05130b6..0e8a221 100644
--- a/common/cmd_bootm.c
+++ b/common/cmd_bootm.c
@@ -104,9 +104,18 @@ static const void *boot_get_kernel(cmd_tbl_t *cmdtp, int 
flag, int argc,
  *  - verified image architecture (PPC) and type (KERNEL or MULTI),
  *  - loaded (first part of) image to header load address,
  *  - disabled interrupts.
+ *
+ * @flag: Command flags (CMD_FLAG_...)
+ * @argc: Number of arguments. Note that the arguments are shifted down
+ *  so that 0 is the first argument not processed by U-Boot, and
+ *  argc is adjusted accordingly. This avoids confusion as to how
+ *  many arguments are available for the OS.
+ * @images: Pointers to os/initrd/fdt
+ * @return 1 on error. On success the OS boots so this function does
+ * not return.
  */
 typedef int boot_os_fn(int flag, int argc, char * const argv[],
-   bootm_headers_t *images); /* pointers to os/initrd/fdt 
*/
+   bootm_headers_t *images);
 
 #ifdef CONFIG_BOOTM_LINUX
 extern boot_os_fn do_bootm_linux;
@@ -457,7 +466,7 @@ static int bootm_start_standalone(ulong iflag, int argc, 
char * const argv[])
return 0;
}
appl = (int (*)(int, char * const []))(ulong)ntohl(images.ep);
-   (*appl)(argc-1, argv[1]);
+   (*appl)(argc, argv);
return 0;
 }
 
@@ -486,17 +495,15 @@ static int do_bootm_subcommand(cmd_tbl_t *cmdtp, int 
flag, int argc,
cmd_tbl_t *c;
boot_os_fn *boot_fn;
 
-   c = find_cmd_tbl(argv[1], cmd_bootm_sub[0], ARRAY_SIZE(cmd_bootm_sub));
+   c = find_cmd_tbl(argv[0], cmd_bootm_sub[0], ARRAY_SIZE(cmd_bootm_sub));
+   argc--; argv++;
 
if (c) {
state = (long)c-cmd;
 
/* treat start special since it resets the state machine */
-   if (state == BOOTM_STATE_START) {
-   argc--;
-   argv++;
+   if (state == BOOTM_STATE_START)
return bootm_start(cmdtp, flag, argc, argv);
-   }
} else {
/* 

[U-Boot] [PATCH v3 14/17] sf: stmicro: Add support for N25Q1024A

2013-06-11 Thread Jagannadha Sutradharudu Teki
Add support for Numonyx N25Q1024A SPI flash.

Signed-off-by: Jagannadha Sutradharudu Teki jaga...@xilinx.com
---
Changes for v3:
- none
Changes for v2:
- none

 drivers/mtd/spi/stmicro.c | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/drivers/mtd/spi/stmicro.c b/drivers/mtd/spi/stmicro.c
index cac1013..ef4b911 100644
--- a/drivers/mtd/spi/stmicro.c
+++ b/drivers/mtd/spi/stmicro.c
@@ -158,6 +158,12 @@ static const struct stmicro_spi_flash_params 
stmicro_spi_flash_table[] = {
.nr_sectors = 2048,
.name = N25Q1024,
},
+   {
+   .id = 0xbb21,
+   .pages_per_sector = 256,
+   .nr_sectors = 2048,
+   .name = N25Q1024A,
+   },
 };
 
 struct spi_flash *spi_flash_probe_stmicro(struct spi_slave *spi, u8 * idcode)
-- 
1.8.3


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


[U-Boot] [PATCH v3 08/17] sf: Add bank addr code in CONFIG_SPI_FLASH_BAR

2013-06-11 Thread Jagannadha Sutradharudu Teki
Defined bank addr code on CONFIG_SPI_FLASH_BAR macro, to reduce the
size for existing boards which has  16Mbytes SPI flashes.

It's upto user which has provision to use the bank addr code for
flashes which has  16Mbytes.

Signed-off-by: Jagannadha Sutradharudu Teki jaga...@xilinx.com
---
Changes for v3:
- none
Changes for v2:
- none

 README   |  5 +
 drivers/mtd/spi/spi_flash.c  | 41 ++--
 drivers/mtd/spi/spi_flash_internal.h | 14 ++--
 include/spi_flash.h  |  3 ++-
 4 files changed, 40 insertions(+), 23 deletions(-)

diff --git a/README b/README
index 3d81092..a2b956e 100644
--- a/README
+++ b/README
@@ -2489,6 +2489,11 @@ CBFS (Coreboot Filesystem) support
Define this option to include a destructive SPI flash
test ('sf test').
 
+   CONFIG_SPI_FLASH_BARBan/Extended Addr Reg
+
+   Define this option to use the Bank addr/Extended addr
+   support on SPI flashes which has size  16Mbytes.
+
 - SystemACE Support:
CONFIG_SYSTEMACE
 
diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c
index 40c0389..ee959fc 100644
--- a/drivers/mtd/spi/spi_flash.c
+++ b/drivers/mtd/spi/spi_flash.c
@@ -74,7 +74,7 @@ int spi_flash_cmd_write_multi(struct spi_flash *flash, u32 
offset,
unsigned long page_addr, byte_addr, page_size;
size_t chunk_len, actual;
int ret;
-   u8 cmd[4], bank_sel;
+   u8 cmd[4];
 
page_size = flash-page_size;
 
@@ -86,6 +86,9 @@ int spi_flash_cmd_write_multi(struct spi_flash *flash, u32 
offset,
 
cmd[0] = CMD_PAGE_PROGRAM;
for (actual = 0; actual  len; actual += chunk_len) {
+#ifdef CONFIG_SPI_FLASH_BAR
+   u8 bank_sel;
+
bank_sel = offset / SPI_FLASH_16MB_BOUN;
 
ret = spi_flash_cmd_bankaddr_write(flash, bank_sel);
@@ -93,7 +96,7 @@ int spi_flash_cmd_write_multi(struct spi_flash *flash, u32 
offset,
debug(SF: fail to set bank%d\n, bank_sel);
return ret;
}
-
+#endif
page_addr = offset / page_size;
byte_addr = offset % page_size;
chunk_len = min(len - actual, page_size - byte_addr);
@@ -162,6 +165,7 @@ int spi_flash_cmd_read_fast(struct spi_flash *flash, u32 
offset,
cmd[4] = 0x00;
 
while (len) {
+#ifdef CONFIG_SPI_FLASH_BAR
bank_sel = offset / SPI_FLASH_16MB_BOUN;
 
ret = spi_flash_cmd_bankaddr_write(flash, bank_sel);
@@ -169,7 +173,7 @@ int spi_flash_cmd_read_fast(struct spi_flash *flash, u32 
offset,
debug(SF: fail to set bank%d\n, bank_sel);
return ret;
}
-
+#endif
remain_len = (SPI_FLASH_16MB_BOUN * (bank_sel + 1) - offset);
if (len  remain_len)
read_len = len;
@@ -240,7 +244,7 @@ int spi_flash_cmd_erase(struct spi_flash *flash, u32 
offset, size_t len)
 {
u32 erase_size;
int ret;
-   u8 cmd[4], bank_sel;
+   u8 cmd[4];
 
erase_size = flash-sector_size;
if (offset % erase_size || len % erase_size) {
@@ -260,6 +264,9 @@ int spi_flash_cmd_erase(struct spi_flash *flash, u32 
offset, size_t len)
cmd[0] = CMD_ERASE_64K;
 
while (len) {
+#ifdef CONFIG_SPI_FLASH_BAR
+   u8 bank_sel;
+
bank_sel = offset / SPI_FLASH_16MB_BOUN;
 
ret = spi_flash_cmd_bankaddr_write(flash, bank_sel);
@@ -267,7 +274,7 @@ int spi_flash_cmd_erase(struct spi_flash *flash, u32 
offset, size_t len)
debug(SF: fail to set bank%d\n, bank_sel);
return ret;
}
-
+#endif
spi_flash_addr(offset, cmd);
 
debug(SF: erase %2x %2x %2x %2x (%x)\n, cmd[0], cmd[1],
@@ -321,6 +328,7 @@ int spi_flash_cmd_write_status(struct spi_flash *flash, u8 
sr)
return 0;
 }
 
+#ifdef CONFIG_SPI_FLASH_BAR
 int spi_flash_cmd_bankaddr_write(struct spi_flash *flash, u8 bank_sel)
 {
u8 cmd, idcode0;
@@ -379,6 +387,7 @@ int spi_flash_cmd_bankaddr_read(struct spi_flash *flash, 
void *data)
 
return spi_flash_read_common(flash, cmd, 1, data, 1);
 }
+#endif
 
 #ifdef CONFIG_OF_CONTROL
 int spi_flash_decode_fdt(const void *blob, struct spi_flash *flash)
@@ -481,7 +490,6 @@ struct spi_flash *spi_flash_probe(unsigned int bus, 
unsigned int cs,
struct spi_flash *flash = NULL;
int ret, i, shift;
u8 idcode[IDCODE_LEN], *idp;
-   u8 curr_bank = 0;
 
spi = spi_setup_slave(bus, cs, max_hz, spi_mode);
if (!spi) {
@@ -525,9 +533,20 @@ struct spi_flash *spi_flash_probe(unsigned int bus, 
unsigned int cs,
goto err_manufacturer_probe;
}
 
+#ifdef CONFIG_SPI_FLASH_BAR
+   u8 curr_bank;
+

[U-Boot] [PATCH v3 05/17] sf: read flash bank addr register at probe time

2013-06-11 Thread Jagannadha Sutradharudu Teki
Read the flash bank addr register to get the state of bank in
a perticular flash. and also bank write happens only when there is
a change in bank selection from user.

bank read only valid for flashes which has  16Mbytes those are
opearted in 3-byte addr mode, each bank occupies 16Mytes.

Suppose if the flash has 64Mbytes size consists of 4 banks like
bank0, bank1, bank2 and bank3.

Signed-off-by: Jagannadha Sutradharudu Teki jaga...@xilinx.com
---
Changes for v3:
- none
Changes for v2:
- none

 drivers/mtd/spi/spi_flash.c  | 17 +
 drivers/mtd/spi/spi_flash_internal.h |  2 ++
 include/spi_flash.h  |  2 ++
 3 files changed, 21 insertions(+)

diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c
index 66b6b14..4576a16 100644
--- a/drivers/mtd/spi/spi_flash.c
+++ b/drivers/mtd/spi/spi_flash.c
@@ -283,6 +283,11 @@ int spi_flash_cmd_bankaddr_write(struct spi_flash *flash, 
u8 bank_sel)
u8 cmd, idcode0;
int ret;
 
+   if (flash-bank_curr == bank_sel) {
+   debug(SF: not require to enable bank%d\n, bank_sel);
+   return 0;
+   }
+
idcode0 = flash-idcode0;
if (idcode0 == 0x01) {
cmd = CMD_BANKADDR_BRWR;
@@ -304,6 +309,7 @@ int spi_flash_cmd_bankaddr_write(struct spi_flash *flash, 
u8 bank_sel)
debug(SF: fail to write bank addr register\n);
return ret;
}
+   flash-bank_curr = bank_sel;
 
ret = spi_flash_cmd_wait_ready(flash, SPI_FLASH_PROG_TIMEOUT);
if (ret  0) {
@@ -432,6 +438,7 @@ struct spi_flash *spi_flash_probe(unsigned int bus, 
unsigned int cs,
struct spi_flash *flash = NULL;
int ret, i, shift;
u8 idcode[IDCODE_LEN], *idp;
+   u8 curr_bank = 0;
 
spi = spi_setup_slave(bus, cs, max_hz, spi_mode);
if (!spi) {
@@ -491,6 +498,16 @@ struct spi_flash *spi_flash_probe(unsigned int bus, 
unsigned int cs,
printf(, mapped at %p, flash-memory_map);
puts(\n);
 
+   if (flash-size  SPI_FLASH_16MB_BOUN) {
+   if (spi_flash_cmd_bankaddr_read(flash, curr_bank)) {
+   debug(SF: fail to read bank addr register\n);
+   goto err_manufacturer_probe;
+   }
+   flash-bank_curr = curr_bank;
+   } else {
+   flash-bank_curr = curr_bank;
+   }
+
spi_release_bus(spi);
 
return flash;
diff --git a/drivers/mtd/spi/spi_flash_internal.h 
b/drivers/mtd/spi/spi_flash_internal.h
index 1b29e2d..455dc02 100644
--- a/drivers/mtd/spi/spi_flash_internal.h
+++ b/drivers/mtd/spi/spi_flash_internal.h
@@ -12,6 +12,8 @@
 #define SPI_FLASH_PAGE_ERASE_TIMEOUT   (5 * CONFIG_SYS_HZ)
 #define SPI_FLASH_SECTOR_ERASE_TIMEOUT (10 * CONFIG_SYS_HZ)
 
+#define SPI_FLASH_16MB_BOUN0x100
+
 /* Common commands */
 #define CMD_READ_ID0x9f
 
diff --git a/include/spi_flash.h b/include/spi_flash.h
index 5ea42e1..acac17a 100644
--- a/include/spi_flash.h
+++ b/include/spi_flash.h
@@ -40,6 +40,8 @@ struct spi_flash {
u32 sector_size;
/* ID code0 */
u8  idcode0;
+   /* Current flash bank */
+   u8  bank_curr;
 
void *memory_map;   /* Address of read-only SPI flash access */
int (*read)(struct spi_flash *flash, u32 offset,
-- 
1.8.3


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


[U-Boot] [PATCH v3 04/17] sf: Add extended addr read support for winbond|stmicro

2013-06-11 Thread Jagannadha Sutradharudu Teki
This patch provides support to read a flash extended address
register for winbond and stmicro SPI flashes.

Signed-off-by: Jagannadha Sutradharudu Teki jaga...@xilinx.com
---
Changes for v3:
- none
Changes for v2:
- none

 drivers/mtd/spi/spi_flash.c  | 2 ++
 drivers/mtd/spi/spi_flash_internal.h | 1 +
 2 files changed, 3 insertions(+)

diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c
index 05d1792..66b6b14 100644
--- a/drivers/mtd/spi/spi_flash.c
+++ b/drivers/mtd/spi/spi_flash.c
@@ -321,6 +321,8 @@ int spi_flash_cmd_bankaddr_read(struct spi_flash *flash, 
void *data)
 
if (idcode0 == 0x01) {
cmd = CMD_BANKADDR_BRRD;
+   } else if ((idcode0 == 0xef) || (idcode0 == 0x20)) {
+   cmd = CMD_EXTNADDR_RDEAR;
} else {
printf(SF: Unsupported bank addr read %02x\n, idcode0);
return -1;
diff --git a/drivers/mtd/spi/spi_flash_internal.h 
b/drivers/mtd/spi/spi_flash_internal.h
index de1a0df..1b29e2d 100644
--- a/drivers/mtd/spi/spi_flash_internal.h
+++ b/drivers/mtd/spi/spi_flash_internal.h
@@ -32,6 +32,7 @@
 #define CMD_BANKADDR_BRWR  0x17
 #define CMD_BANKADDR_BRRD  0x16
 #define CMD_EXTNADDR_WREAR 0xC5
+#define CMD_EXTNADDR_RDEAR 0xC8
 
 /* Common status */
 #define STATUS_WIP 0x01
-- 
1.8.3


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


[U-Boot] [PATCH v3 07/17] sf: Update sf read to support all sizes of flashes

2013-06-11 Thread Jagannadha Sutradharudu Teki
This patch updated the spi_flash read func to support all
sizes of flashes using bank reg addr facility.

The same support has been added in below patch for erase/write
spi_flash functions:
sf: Support all sizes of flashes using bank addr reg facility
(sha1: c956f600cbb0943d0afe1004cdb503f4fcd8f415)

With these new updates on sf framework, the flashes which has  16MB
are not effected as per as performance is concern and but the
u-boot.bin size incrased ~600 bytes.

sf update(for first 16MBytes), Changes before:
U-Boot sf update 0x100 0x0 0x100
- N25Q256
  16777216 bytes written, 0 bytes skipped in 199.72s, speed 86480 B/s
- W25Q128BV
  16777216 bytes written, 0 bytes skipped in 351.739s, speed 48913 B/s
- S25FL256S_64K
  16777216 bytes written, 0 bytes skipped in 65.659s, speed 262144 B/s

sf update(for first 16MBytes), Changes before:
U-Boot sf update 0x100 0x0 0x100
- N25Q256
  16777216 bytes written, 0 bytes skipped in 198.953s, speed 86480 B/s
- W25Q128BV
  16777216 bytes written, 0 bytes skipped in 350.90s, speed 49200 B/s
- S25FL256S_64K
  16777216 bytes written, 0 bytes skipped in 66.521s, speed 262144 B/s

Signed-off-by: Jagannadha Sutradharudu Teki jaga...@xilinx.com
---
Changes for v3:
- none
Changes for v2:
- none

 drivers/mtd/spi/spi_flash.c | 36 +---
 1 file changed, 33 insertions(+), 3 deletions(-)

diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c
index 5386884..40c0389 100644
--- a/drivers/mtd/spi/spi_flash.c
+++ b/drivers/mtd/spi/spi_flash.c
@@ -148,7 +148,9 @@ int spi_flash_read_common(struct spi_flash *flash, const u8 
*cmd,
 int spi_flash_cmd_read_fast(struct spi_flash *flash, u32 offset,
size_t len, void *data)
 {
-   u8 cmd[5];
+   u8 cmd[5], bank_sel;
+   u32 remain_len, read_len;
+   int ret = -1;
 
/* Handle memory-mapped SPI */
if (flash-memory_map) {
@@ -157,10 +159,38 @@ int spi_flash_cmd_read_fast(struct spi_flash *flash, u32 
offset,
}
 
cmd[0] = CMD_READ_ARRAY_FAST;
-   spi_flash_addr(offset, cmd);
cmd[4] = 0x00;
 
-   return spi_flash_read_common(flash, cmd, sizeof(cmd), data, len);
+   while (len) {
+   bank_sel = offset / SPI_FLASH_16MB_BOUN;
+
+   ret = spi_flash_cmd_bankaddr_write(flash, bank_sel);
+   if (ret) {
+   debug(SF: fail to set bank%d\n, bank_sel);
+   return ret;
+   }
+
+   remain_len = (SPI_FLASH_16MB_BOUN * (bank_sel + 1) - offset);
+   if (len  remain_len)
+   read_len = len;
+   else
+   read_len = remain_len;
+
+   spi_flash_addr(offset, cmd);
+
+   ret = spi_flash_read_common(flash, cmd, sizeof(cmd),
+   data, read_len);
+   if (ret  0) {
+   debug(SF: read failed\n);
+   break;
+   }
+
+   offset += read_len;
+   len -= read_len;
+   data += read_len;
+   }
+
+   return ret;
 }
 
 int spi_flash_cmd_poll_bit(struct spi_flash *flash, unsigned long timeout,
-- 
1.8.3


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


[U-Boot] [PATCH v3 02/17] sf: Add bank address register reading support

2013-06-11 Thread Jagannadha Sutradharudu Teki
This patch provides support to read a flash bank address register.

reading extended/bank address register will give whether the flash
is operated on extended/bank addressing or normal addressing in
3-byte address mode.

Currently added an extended/bank address register reading support
for spansion flashes.

reff' the spec for more details about bank addr register
in Page-63, Table 8.16
http://www.spansion.com/Support/Datasheets/S25FL128S_256S_00.pdf

Signed-off-by: Jagannadha Sutradharudu Teki jaga...@xilinx.com
---
Changes for v3:
- none
Changes for v2:
- none

 drivers/mtd/spi/spi_flash.c  | 15 +++
 drivers/mtd/spi/spi_flash_internal.h |  4 
 2 files changed, 19 insertions(+)

diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c
index 7aba520..193de42 100644
--- a/drivers/mtd/spi/spi_flash.c
+++ b/drivers/mtd/spi/spi_flash.c
@@ -312,6 +312,21 @@ int spi_flash_cmd_bankaddr_write(struct spi_flash *flash, 
u8 bank_sel)
return 0;
 }
 
+int spi_flash_cmd_bankaddr_read(struct spi_flash *flash, void *data)
+{
+   u8 cmd;
+   u8 idcode0 = flash-idcode0;
+
+   if (idcode0 == 0x01) {
+   cmd = CMD_BANKADDR_BRRD;
+   } else {
+   printf(SF: Unsupported bank addr read %02x\n, idcode0);
+   return -1;
+   }
+
+   return spi_flash_read_common(flash, cmd, 1, data, 1);
+}
+
 #ifdef CONFIG_OF_CONTROL
 int spi_flash_decode_fdt(const void *blob, struct spi_flash *flash)
 {
diff --git a/drivers/mtd/spi/spi_flash_internal.h 
b/drivers/mtd/spi/spi_flash_internal.h
index 6e38494..2567bbc 100644
--- a/drivers/mtd/spi/spi_flash_internal.h
+++ b/drivers/mtd/spi/spi_flash_internal.h
@@ -30,6 +30,7 @@
 
 /* Bank addr acess commands */
 #define CMD_BANKADDR_BRWR  0x17
+#define CMD_BANKADDR_BRRD  0x16
 
 /* Common status */
 #define STATUS_WIP 0x01
@@ -83,6 +84,9 @@ int spi_flash_cmd_write_status(struct spi_flash *flash, u8 
sr);
 /* Program the bank address register */
 int spi_flash_cmd_bankaddr_write(struct spi_flash *flash, u8 bank_sel);
 
+/* Read the bank address register */
+int spi_flash_cmd_bankaddr_read(struct spi_flash *flash, void *data);
+
 /*
  * Same as spi_flash_cmd_read() except it also claims/releases the SPI
  * bus. Used as common part of the -read() operation.
-- 
1.8.3


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


[U-Boot] [PATCH v3 06/17] sf: Update sf to support all sizes of flashes

2013-06-11 Thread Jagannadha Sutradharudu Teki
Updated the spi_flash framework to handle all sizes of flashes
using bank/extd addr reg facility

The current implementation in spi_flash supports 3-byte address mode
due to this up to 16Mbytes amount of flash is able to access for those
flashes which has an actual size of  16MB.

As most of the flashes introduces a bank/extd address registers
for accessing the flashes in 16Mbytes of banks if the flash size
is  16Mbytes, this new scheme will add the bank selection feature
for performing write/erase operations on all flashes.

Signed-off-by: Jagannadha Sutradharudu Teki jaga...@xilinx.com
---
Changes for v3:
- none
Changes for v2:
- none

 drivers/mtd/spi/spi_flash.c | 39 ++-
 1 file changed, 26 insertions(+), 13 deletions(-)

diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c
index 4576a16..5386884 100644
--- a/drivers/mtd/spi/spi_flash.c
+++ b/drivers/mtd/spi/spi_flash.c
@@ -74,11 +74,9 @@ int spi_flash_cmd_write_multi(struct spi_flash *flash, u32 
offset,
unsigned long page_addr, byte_addr, page_size;
size_t chunk_len, actual;
int ret;
-   u8 cmd[4];
+   u8 cmd[4], bank_sel;
 
page_size = flash-page_size;
-   page_addr = offset / page_size;
-   byte_addr = offset % page_size;
 
ret = spi_claim_bus(flash-spi);
if (ret) {
@@ -88,6 +86,16 @@ int spi_flash_cmd_write_multi(struct spi_flash *flash, u32 
offset,
 
cmd[0] = CMD_PAGE_PROGRAM;
for (actual = 0; actual  len; actual += chunk_len) {
+   bank_sel = offset / SPI_FLASH_16MB_BOUN;
+
+   ret = spi_flash_cmd_bankaddr_write(flash, bank_sel);
+   if (ret) {
+   debug(SF: fail to set bank%d\n, bank_sel);
+   return ret;
+   }
+
+   page_addr = offset / page_size;
+   byte_addr = offset % page_size;
chunk_len = min(len - actual, page_size - byte_addr);
 
if (flash-spi-max_write_size)
@@ -117,11 +125,7 @@ int spi_flash_cmd_write_multi(struct spi_flash *flash, u32 
offset,
if (ret)
break;
 
-   byte_addr += chunk_len;
-   if (byte_addr == page_size) {
-   page_addr++;
-   byte_addr = 0;
-   }
+   offset += chunk_len;
}
 
spi_release_bus(flash-spi);
@@ -204,9 +208,9 @@ int spi_flash_cmd_wait_ready(struct spi_flash *flash, 
unsigned long timeout)
 
 int spi_flash_cmd_erase(struct spi_flash *flash, u32 offset, size_t len)
 {
-   u32 end, erase_size;
+   u32 erase_size;
int ret;
-   u8 cmd[4];
+   u8 cmd[4], bank_sel;
 
erase_size = flash-sector_size;
if (offset % erase_size || len % erase_size) {
@@ -224,11 +228,17 @@ int spi_flash_cmd_erase(struct spi_flash *flash, u32 
offset, size_t len)
cmd[0] = CMD_ERASE_4K;
else
cmd[0] = CMD_ERASE_64K;
-   end = offset + len;
 
-   while (offset  end) {
+   while (len) {
+   bank_sel = offset / SPI_FLASH_16MB_BOUN;
+
+   ret = spi_flash_cmd_bankaddr_write(flash, bank_sel);
+   if (ret) {
+   debug(SF: fail to set bank%d\n, bank_sel);
+   return ret;
+   }
+
spi_flash_addr(offset, cmd);
-   offset += erase_size;
 
debug(SF: erase %2x %2x %2x %2x (%x)\n, cmd[0], cmd[1],
  cmd[2], cmd[3], offset);
@@ -244,6 +254,9 @@ int spi_flash_cmd_erase(struct spi_flash *flash, u32 
offset, size_t len)
ret = spi_flash_cmd_wait_ready(flash, 
SPI_FLASH_PAGE_ERASE_TIMEOUT);
if (ret)
goto out;
+
+   offset += erase_size;
+   len -= erase_size;
}
 
  out:
-- 
1.8.3


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


[U-Boot] [PATCH v3 13/17] sf: stmicro: Add support for N25Q1024

2013-06-11 Thread Jagannadha Sutradharudu Teki
Add support for Numonyx N25Q1024 SPI flash.

Signed-off-by: Jagannadha Sutradharudu Teki jaga...@xilinx.com
---
Changes for v3:
- none
Changes for v2:
- none

 drivers/mtd/spi/stmicro.c | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/drivers/mtd/spi/stmicro.c b/drivers/mtd/spi/stmicro.c
index bf61a37..cac1013 100644
--- a/drivers/mtd/spi/stmicro.c
+++ b/drivers/mtd/spi/stmicro.c
@@ -152,6 +152,12 @@ static const struct stmicro_spi_flash_params 
stmicro_spi_flash_table[] = {
.nr_sectors = 1024,
.name = N25Q512A,
},
+   {
+   .id = 0xba21,
+   .pages_per_sector = 256,
+   .nr_sectors = 2048,
+   .name = N25Q1024,
+   },
 };
 
 struct spi_flash *spi_flash_probe_stmicro(struct spi_slave *spi, u8 * idcode)
-- 
1.8.3


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


[U-Boot] [PATCH v3 01/17] sf: Add bank address register writing support

2013-06-11 Thread Jagannadha Sutradharudu Teki
This patch provides support to program a flash bank address
register.

extended/bank address register contains an information to access
the 4th byte addressing in 3-byte address mode.

Currently added an bank address register writing support for
spansion flashes.

reff' the spec for more details about bank addr register
in Page-63, Table 8.16
http://www.spansion.com/Support/Datasheets/S25FL128S_256S_00.pdf

Signed-off-by: Jagannadha Sutradharudu Teki jaga...@xilinx.com
---
Changes for v3:
- none
Changes for v2:
- none

 drivers/mtd/spi/spi_flash.c  | 37 
 drivers/mtd/spi/spi_flash_internal.h |  6 ++
 include/spi_flash.h  |  2 ++
 3 files changed, 45 insertions(+)

diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c
index 0e38f59..7aba520 100644
--- a/drivers/mtd/spi/spi_flash.c
+++ b/drivers/mtd/spi/spi_flash.c
@@ -278,6 +278,40 @@ int spi_flash_cmd_write_status(struct spi_flash *flash, u8 
sr)
return 0;
 }
 
+int spi_flash_cmd_bankaddr_write(struct spi_flash *flash, u8 bank_sel)
+{
+   u8 cmd, idcode0;
+   int ret;
+
+   idcode0 = flash-idcode0;
+   if (idcode0 == 0x01) {
+   cmd = CMD_BANKADDR_BRWR;
+   } else {
+   printf(SF: Unsupported bank addr write %02x\n, idcode0);
+   return -1;
+   }
+
+   ret = spi_flash_cmd_write_enable(flash);
+   if (ret  0) {
+   debug(SF: enabling write failed\n);
+   return ret;
+   }
+
+   ret = spi_flash_cmd_write(flash-spi, cmd, 1, bank_sel, 1);
+   if (ret) {
+   debug(SF: fail to write bank addr register\n);
+   return ret;
+   }
+
+   ret = spi_flash_cmd_wait_ready(flash, SPI_FLASH_PROG_TIMEOUT);
+   if (ret  0) {
+   debug(SF: write bank addr register timed out\n);
+   return ret;
+   }
+
+   return 0;
+}
+
 #ifdef CONFIG_OF_CONTROL
 int spi_flash_decode_fdt(const void *blob, struct spi_flash *flash)
 {
@@ -422,6 +456,9 @@ struct spi_flash *spi_flash_probe(unsigned int bus, 
unsigned int cs,
goto err_manufacturer_probe;
}
 
+   /* store the manuf id, for performing specific flash ops */
+   flash-idcode0 = *idp;
+
 #ifdef CONFIG_OF_CONTROL
if (spi_flash_decode_fdt(gd-fdt_blob, flash)) {
debug(SF: FDT decode error\n);
diff --git a/drivers/mtd/spi/spi_flash_internal.h 
b/drivers/mtd/spi/spi_flash_internal.h
index 141cfa8..6e38494 100644
--- a/drivers/mtd/spi/spi_flash_internal.h
+++ b/drivers/mtd/spi/spi_flash_internal.h
@@ -28,6 +28,9 @@
 #define CMD_ERASE_64K  0xd8
 #define CMD_ERASE_CHIP 0xc7
 
+/* Bank addr acess commands */
+#define CMD_BANKADDR_BRWR  0x17
+
 /* Common status */
 #define STATUS_WIP 0x01
 
@@ -77,6 +80,9 @@ static inline int spi_flash_cmd_write_disable(struct 
spi_flash *flash)
 /* Program the status register. */
 int spi_flash_cmd_write_status(struct spi_flash *flash, u8 sr);
 
+/* Program the bank address register */
+int spi_flash_cmd_bankaddr_write(struct spi_flash *flash, u8 bank_sel);
+
 /*
  * Same as spi_flash_cmd_read() except it also claims/releases the SPI
  * bus. Used as common part of the -read() operation.
diff --git a/include/spi_flash.h b/include/spi_flash.h
index 3b6a44e..5ea42e1 100644
--- a/include/spi_flash.h
+++ b/include/spi_flash.h
@@ -38,6 +38,8 @@ struct spi_flash {
u32 page_size;
/* Erase (sector) size */
u32 sector_size;
+   /* ID code0 */
+   u8  idcode0;
 
void *memory_map;   /* Address of read-only SPI flash access */
int (*read)(struct spi_flash *flash, u32 offset,
-- 
1.8.3


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


[U-Boot] [PATCH v3 16/17] sf: Remove spi_flash_cmd_poll_bit()

2013-06-11 Thread Jagannadha Sutradharudu Teki
There is no other call other than spi_flash_cmd_wait_ready(),
hence removed spi_flash_cmd_poll_bit and use the poll status code
spi_flash_cmd_wait_ready() itself.

Signed-off-by: Jagannadha Sutradharudu Teki jaga...@xilinx.com
---
Changes for v3:
- none
Changes for v2:
- none

 drivers/mtd/spi/spi_flash.c  | 11 +++
 drivers/mtd/spi/spi_flash_internal.h |  4 
 2 files changed, 3 insertions(+), 12 deletions(-)

diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c
index 57a695a..bb37f54 100644
--- a/drivers/mtd/spi/spi_flash.c
+++ b/drivers/mtd/spi/spi_flash.c
@@ -194,13 +194,14 @@ int spi_flash_cmd_read_fast(struct spi_flash *flash, u32 
offset,
return ret;
 }
 
-int spi_flash_cmd_poll_bit(struct spi_flash *flash, unsigned long timeout,
-  u8 cmd, u8 poll_bit)
+int spi_flash_cmd_wait_ready(struct spi_flash *flash, unsigned long timeout)
 {
struct spi_slave *spi = flash-spi;
unsigned long timebase;
int ret;
u8 status;
+   u8 poll_bit = STATUS_WIP;
+   u8 cmd = CMD_READ_STATUS;
 
ret = spi_xfer(spi, 8, cmd, NULL, SPI_XFER_BEGIN);
if (ret) {
@@ -231,12 +232,6 @@ int spi_flash_cmd_poll_bit(struct spi_flash *flash, 
unsigned long timeout,
return -1;
 }
 
-int spi_flash_cmd_wait_ready(struct spi_flash *flash, unsigned long timeout)
-{
-   return spi_flash_cmd_poll_bit(flash, timeout,
-   CMD_READ_STATUS, STATUS_WIP);
-}
-
 int spi_flash_cmd_erase(struct spi_flash *flash, u32 offset, size_t len)
 {
u32 erase_size;
diff --git a/drivers/mtd/spi/spi_flash_internal.h 
b/drivers/mtd/spi/spi_flash_internal.h
index 12d49a8..cf6aaf3 100644
--- a/drivers/mtd/spi/spi_flash_internal.h
+++ b/drivers/mtd/spi/spi_flash_internal.h
@@ -100,10 +100,6 @@ int spi_flash_cmd_bankaddr_read(struct spi_flash *flash, 
void *data);
 int spi_flash_read_common(struct spi_flash *flash, const u8 *cmd,
size_t cmd_len, void *data, size_t data_len);
 
-/* Send a command to the device and wait for some bit to clear itself. */
-int spi_flash_cmd_poll_bit(struct spi_flash *flash, unsigned long timeout,
-  u8 cmd, u8 poll_bit);
-
 /*
  * Send the read status command to the device and wait for the wip
  * (write-in-progress) bit to clear itself.
-- 
1.8.3


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


[U-Boot] [PATCH v3 12/17] sf: stmicro: Add support for N25Q512A

2013-06-11 Thread Jagannadha Sutradharudu Teki
Add support for Numonyx N25Q512A SPI flash.

Signed-off-by: Jagannadha Sutradharudu Teki jaga...@xilinx.com
---
Changes for v3:
- none
Changes for v2:
- none

 drivers/mtd/spi/stmicro.c | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/drivers/mtd/spi/stmicro.c b/drivers/mtd/spi/stmicro.c
index e9adfa5..bf61a37 100644
--- a/drivers/mtd/spi/stmicro.c
+++ b/drivers/mtd/spi/stmicro.c
@@ -146,6 +146,12 @@ static const struct stmicro_spi_flash_params 
stmicro_spi_flash_table[] = {
.nr_sectors = 1024,
.name = N25Q512,
},
+   {
+   .id = 0xbb20,
+   .pages_per_sector = 256,
+   .nr_sectors = 1024,
+   .name = N25Q512A,
+   },
 };
 
 struct spi_flash *spi_flash_probe_stmicro(struct spi_slave *spi, u8 * idcode)
-- 
1.8.3


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


[U-Boot] [PATCH v3 00/17] sf: Update sf framework to support all sizes of flashes

2013-06-11 Thread Jagannadha Sutradharudu Teki
This series is v3 for the patch series sent few weeks back with a head
sf: Update sf framework to support all sizes of flashes

All patch are looks same for v2 and v3 but placed the bank addr code
on CONFIG_SPI_FLASH_BAR to reduce the sizes.

The current implementation in sf supports 3-byte address mode due
to this up to 16MB amount of flash is able to access for those
flashes which has an actual size of  16MB.

This series of patches is more detailed/meatured changes w.r.t the current
sf framework in addition to changes related to support all sizes using
bank/exnt register addr accessing support.

With these new updates on sf framework, the flashes which has  16MB
are not effected as per as performance is concern and but the
u-boot.bin size incrased ~600 bytes.

sf update(for first 16MBytes), Changes before:
U-Boot sf update 0x100 0x0 0x100
- N25Q256
  16777216 bytes written, 0 bytes skipped in 199.72s, speed 86480 B/s
- W25Q128BV
  16777216 bytes written, 0 bytes skipped in 351.739s, speed 48913 B/s
- S25FL256S_64K
  16777216 bytes written, 0 bytes skipped in 65.659s, speed 262144 B/s

sf update(for first 16MBytes), Changes after:
U-Boot sf update 0x100 0x0 0x100
- N25Q256
  16777216 bytes written, 0 bytes skipped in 198.953s, speed 86480 B/s
- W25Q128BV
  16777216 bytes written, 0 bytes skipped in 350.90s, speed 49200 B/s
- S25FL256S_64K
  16777216 bytes written, 0 bytes skipped in 66.521s, speed 262144 B/s

The main aim of these changes is to not effect the current framework
and at the same time to support the  16Mbyte flashes, becuase of this
I involved few flash vendor people in CC [thought that they may/mayn't
be a mailing list members] to know their views.

REQUEST FOR ALL SPI CODE CONTRIBUTORS/USERS, PLEASE TEST
THESE CHANGES W.R.T YOUR HW IF POSSIBLE.

Please let me know for any issues/concerns/questions.

Jagannadha Sutradharudu Teki (17):
  sf: Add bank address register writing support
  sf: Add bank address register reading support
  sf: Add extended addr write support for winbond|stmicro
  sf: Add extended addr read support for winbond|stmicro
  sf: read flash bank addr register at probe time
  sf: Update sf to support all sizes of flashes
  sf: Update sf read to support all sizes of flashes
  sf: Add bank addr code in CONFIG_SPI_FLASH_BAR
  sf: Initialize bank_sel to zero for read ops
  sf: Use spi_flash_addr() in write call
  sf: stmicro: Add support for N25Q512
  sf: stmicro: Add support for N25Q512A
  sf: stmicro: Add support for N25Q1024
  sf: stmicro: Add support for N25Q1024A
  sf: spansion: Add support for S25FL512S_64K
  sf: Remove spi_flash_cmd_poll_bit()
  sf: Add Flag status register polling support

 README   |   5 +
 drivers/mtd/spi/spansion.c   |   7 ++
 drivers/mtd/spi/spi_flash.c  | 185 +--
 drivers/mtd/spi/spi_flash_internal.h |  21 +++-
 drivers/mtd/spi/stmicro.c|  24 +
 include/spi_flash.h  |   7 +-
 6 files changed, 215 insertions(+), 34 deletions(-)

-- 
1.8.3


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


[U-Boot] [PATCH v3 09/17] sf: Initialize bank_sel to zero for read ops

2013-06-11 Thread Jagannadha Sutradharudu Teki
Initialized bank_sel variable to 0 to support the updated read
ops for flashes which has  16Mbytes.

Signed-off-by: Jagannadha Sutradharudu Teki jaga...@xilinx.com
---
Changes for v3:
- none
Changes for v2:
- none

 drivers/mtd/spi/spi_flash.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c
index ee959fc..96b8733 100644
--- a/drivers/mtd/spi/spi_flash.c
+++ b/drivers/mtd/spi/spi_flash.c
@@ -151,7 +151,7 @@ int spi_flash_read_common(struct spi_flash *flash, const u8 
*cmd,
 int spi_flash_cmd_read_fast(struct spi_flash *flash, u32 offset,
size_t len, void *data)
 {
-   u8 cmd[5], bank_sel;
+   u8 cmd[5], bank_sel = 0;
u32 remain_len, read_len;
int ret = -1;
 
-- 
1.8.3


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


[U-Boot] [PATCH v3 10/17] sf: Use spi_flash_addr() in write call

2013-06-11 Thread Jagannadha Sutradharudu Teki
Use the existing spi_flash_addr() for 3-byte addressing
cmd filling in write call.

Signed-off-by: Jagannadha Sutradharudu Teki jaga...@xilinx.com
---
Changes for v3:
- none
Changes for v2:
- none

 drivers/mtd/spi/spi_flash.c | 7 ++-
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c
index 96b8733..57a695a 100644
--- a/drivers/mtd/spi/spi_flash.c
+++ b/drivers/mtd/spi/spi_flash.c
@@ -71,7 +71,7 @@ int spi_flash_cmd_write(struct spi_slave *spi, const u8 *cmd, 
size_t cmd_len,
 int spi_flash_cmd_write_multi(struct spi_flash *flash, u32 offset,
size_t len, const void *buf)
 {
-   unsigned long page_addr, byte_addr, page_size;
+   unsigned long byte_addr, page_size;
size_t chunk_len, actual;
int ret;
u8 cmd[4];
@@ -97,16 +97,13 @@ int spi_flash_cmd_write_multi(struct spi_flash *flash, u32 
offset,
return ret;
}
 #endif
-   page_addr = offset / page_size;
byte_addr = offset % page_size;
chunk_len = min(len - actual, page_size - byte_addr);
 
if (flash-spi-max_write_size)
chunk_len = min(chunk_len, flash-spi-max_write_size);
 
-   cmd[1] = page_addr  8;
-   cmd[2] = page_addr;
-   cmd[3] = byte_addr;
+   spi_flash_addr(offset, cmd);
 
debug(PP: 0x%p = cmd = { 0x%02x 0x%02x%02x%02x } chunk_len = 
%zu\n,
  buf + actual, cmd[0], cmd[1], cmd[2], cmd[3], chunk_len);
-- 
1.8.3


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


[U-Boot] [PATCH v3 15/17] sf: spansion: Add support for S25FL512S_64K

2013-06-11 Thread Jagannadha Sutradharudu Teki
Add support for Spansion S25FL512S_64K SPI flash.

Signed-off-by: Jagannadha Sutradharudu Teki jaga...@xilinx.com
---
Changes for v3:
- Added 64K sector part
Changes for v2:
- none

 drivers/mtd/spi/spansion.c | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/drivers/mtd/spi/spansion.c b/drivers/mtd/spi/spansion.c
index 2218e2f..b4ee442 100644
--- a/drivers/mtd/spi/spansion.c
+++ b/drivers/mtd/spi/spansion.c
@@ -110,6 +110,13 @@ static const struct spansion_spi_flash_params 
spansion_spi_flash_table[] = {
.nr_sectors = 512,
.name = S25FL256S_64K,
},
+   {
+   .idcode1 = 0x0220,
+   .idcode2 = 0x4d01,
+   .pages_per_sector = 256,
+   .nr_sectors = 1024,
+   .name = S25FL512S_64K,
+   },
 };
 
 struct spi_flash *spi_flash_probe_spansion(struct spi_slave *spi, u8 *idcode)
-- 
1.8.3


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


[U-Boot] [PATCH v3 11/17] sf: stmicro: Add support for N25Q512

2013-06-11 Thread Jagannadha Sutradharudu Teki
Add support for Numonyx N25Q512 SPI flash.

Signed-off-by: Jagannadha Sutradharudu Teki jaga...@xilinx.com
---
Changes for v3:
- none
Changes for v2:
- none

 drivers/mtd/spi/stmicro.c | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/drivers/mtd/spi/stmicro.c b/drivers/mtd/spi/stmicro.c
index 2a9972b..e9adfa5 100644
--- a/drivers/mtd/spi/stmicro.c
+++ b/drivers/mtd/spi/stmicro.c
@@ -140,6 +140,12 @@ static const struct stmicro_spi_flash_params 
stmicro_spi_flash_table[] = {
.nr_sectors = 512,
.name = N25Q256A,
},
+   {
+   .id = 0xba20,
+   .pages_per_sector = 256,
+   .nr_sectors = 1024,
+   .name = N25Q512,
+   },
 };
 
 struct spi_flash *spi_flash_probe_stmicro(struct spi_slave *spi, u8 * idcode)
-- 
1.8.3


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


[U-Boot] [PATCH v3 03/17] sf: Add extended addr write support for winbond|stmicro

2013-06-11 Thread Jagannadha Sutradharudu Teki
This patch provides support to program a flash extended address
register for winbond and stmicro SPI flashes.

Signed-off-by: Jagannadha Sutradharudu Teki jaga...@xilinx.com
---
Changes for v3:
- none
Changes for v2:
- none

 drivers/mtd/spi/spi_flash.c  | 2 ++
 drivers/mtd/spi/spi_flash_internal.h | 1 +
 2 files changed, 3 insertions(+)

diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c
index 193de42..05d1792 100644
--- a/drivers/mtd/spi/spi_flash.c
+++ b/drivers/mtd/spi/spi_flash.c
@@ -286,6 +286,8 @@ int spi_flash_cmd_bankaddr_write(struct spi_flash *flash, 
u8 bank_sel)
idcode0 = flash-idcode0;
if (idcode0 == 0x01) {
cmd = CMD_BANKADDR_BRWR;
+   } else if ((idcode0 == 0xef) || (idcode0 == 0x20)) {
+   cmd = CMD_EXTNADDR_WREAR;
} else {
printf(SF: Unsupported bank addr write %02x\n, idcode0);
return -1;
diff --git a/drivers/mtd/spi/spi_flash_internal.h 
b/drivers/mtd/spi/spi_flash_internal.h
index 2567bbc..de1a0df 100644
--- a/drivers/mtd/spi/spi_flash_internal.h
+++ b/drivers/mtd/spi/spi_flash_internal.h
@@ -31,6 +31,7 @@
 /* Bank addr acess commands */
 #define CMD_BANKADDR_BRWR  0x17
 #define CMD_BANKADDR_BRRD  0x16
+#define CMD_EXTNADDR_WREAR 0xC5
 
 /* Common status */
 #define STATUS_WIP 0x01
-- 
1.8.3


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


[U-Boot] [PATCH v3 17/17] sf: Add Flag status register polling support

2013-06-11 Thread Jagannadha Sutradharudu Teki
Flag status register polling is required for micron 512Mb flash
devices onwards, for performing erase/program operations.

Like polling for WIP(Write-In-Progress) bit in read status register,
spi_flash_cmd_wait_ready will poll for PEC(Program-Erase-Control)
bit in flag status register.

Signed-off-by: Jagannadha Sutradharudu Teki jaga...@xilinx.com
---
Changes for v3:
- define the flag status code on CONFIG_SPI_FLASH_STMICRO
Changes for v2:
- none

 drivers/mtd/spi/spi_flash.c  | 16 +---
 drivers/mtd/spi/spi_flash_internal.h |  2 ++
 2 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c
index bb37f54..4f97fab0 100644
--- a/drivers/mtd/spi/spi_flash.c
+++ b/drivers/mtd/spi/spi_flash.c
@@ -200,12 +200,22 @@ int spi_flash_cmd_wait_ready(struct spi_flash *flash, 
unsigned long timeout)
unsigned long timebase;
int ret;
u8 status;
+   u8 check_status = 0x0;
u8 poll_bit = STATUS_WIP;
u8 cmd = CMD_READ_STATUS;
 
+#ifdef CONFIG_SPI_FLASH_STMICRO
+   if (flash-size = 0x400) {
+   poll_bit = STATUS_PEC;
+   check_status = poll_bit;
+   cmd = CMD_FLAG_STATUS;
+   }
+#endif
+
ret = spi_xfer(spi, 8, cmd, NULL, SPI_XFER_BEGIN);
if (ret) {
-   debug(SF: Failed to send command %02x: %d\n, cmd, ret);
+   debug(SF: fail to read %s status register\n,
+   cmd == CMD_READ_STATUS ? read : flag);
return ret;
}
 
@@ -217,14 +227,14 @@ int spi_flash_cmd_wait_ready(struct spi_flash *flash, 
unsigned long timeout)
if (ret)
return -1;
 
-   if ((status  poll_bit) == 0)
+   if ((status  poll_bit) == check_status)
break;
 
} while (get_timer(timebase)  timeout);
 
spi_xfer(spi, 0, NULL, NULL, SPI_XFER_END);
 
-   if ((status  poll_bit) == 0)
+   if ((status  poll_bit) == check_status)
return 0;
 
/* Timed out */
diff --git a/drivers/mtd/spi/spi_flash_internal.h 
b/drivers/mtd/spi/spi_flash_internal.h
index cf6aaf3..1d4fb23 100644
--- a/drivers/mtd/spi/spi_flash_internal.h
+++ b/drivers/mtd/spi/spi_flash_internal.h
@@ -22,6 +22,7 @@
 #define CMD_PAGE_PROGRAM   0x02
 #define CMD_WRITE_DISABLE  0x04
 #define CMD_READ_STATUS0x05
+#define CMD_FLAG_STATUS0x70
 #define CMD_WRITE_ENABLE   0x06
 #define CMD_ERASE_4K   0x20
 #define CMD_ERASE_32K  0x52
@@ -40,6 +41,7 @@
 
 /* Common status */
 #define STATUS_WIP 0x01
+#define STATUS_PEC 0x80
 
 /* Send a single-byte command to the device and read the response */
 int spi_flash_cmd(struct spi_slave *spi, u8 cmd, void *response, size_t len);
-- 
1.8.3


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


Re: [U-Boot] [PATCH v3 1/6] powerpc/ppc4xx: Use generic accessor functions for gdsys FPGA

2013-06-11 Thread Wolfgang Denk
Dear dirk.eib...@gdsys.cc,

In message 1370959364-28943-2-git-send-email-dirk.eib...@gdsys.cc you wrote:
 From: Dirk Eibach eib...@gdsys.de
 
 A set of accessor functions was added to be able to access not only
 memory mapped FPGA in a generic way.
 
 Thanks to Wolfgang Denk for getting this sorted properly.

Sorry, I still have comments...


 +#ifdef CONFIG_SYS_FPGA_NO_RFL_HI
 + FPGA_GET_REG(k, reflection_low, val);
 +#else
 + FPGA_GET_REG(k, reflection_high, val);
 +#endif

Can this #ifdef here (and similar below) not be avoided by defining a
proper value to some macro and using this as function argument instead?

 diff --git a/board/gdsys/405ep/dlvision-10g.c 
 b/board/gdsys/405ep/dlvision-10g.c
 index 644493b..332d82f 100644
 --- a/board/gdsys/405ep/dlvision-10g.c
 +++ b/board/gdsys/405ep/dlvision-10g.c
...
 +struct ihs_fpga *fpga_ptr[] = CONFIG_SYS_FPGA_PTR;
 +
 +int fpga_set_reg(u32 fpga, u16 *reg, off_t regoff, u16 data)
 +{
 + out_le16(reg, data);
 +
 + return 0;
 +}
 +
 +int fpga_get_reg(u32 fpga, u16 *reg, off_t regoff, u16 *data)
 +{
 + *data = in_le16(reg);
 +
 + return 0;
 +}
...
 diff --git a/board/gdsys/405ep/io.c b/board/gdsys/405ep/io.c
 index 070dcbb..05707c4 100644
 --- a/board/gdsys/405ep/io.c
 +++ b/board/gdsys/405ep/io.c
 @@ -53,6 +53,22 @@ enum {
   HWVER_122 = 3,
  };
  
 +struct ihs_fpga *fpga_ptr[] = CONFIG_SYS_FPGA_PTR;
 +
 +int fpga_set_reg(u32 fpga, u16 *reg, off_t regoff, u16 data)
 +{
 + out_le16(reg, data);
 +
 + return 0;
 +}
 +
 +int fpga_get_reg(u32 fpga, u16 *reg, off_t regoff, u16 *data)
 +{
 + *data = in_le16(reg);
 +
 + return 0;
 +}
...
 diff --git a/board/gdsys/405ep/iocon.c b/board/gdsys/405ep/iocon.c
 index 0fc7db2..a531e5d 100644
 --- a/board/gdsys/405ep/iocon.c
 +++ b/board/gdsys/405ep/iocon.c
 @@ -69,6 +69,22 @@ enum {
   RAM_DDR2_32 = 0,
  };
  
 +struct ihs_fpga *fpga_ptr[] = CONFIG_SYS_FPGA_PTR;
 +
 +int fpga_set_reg(u32 fpga, u16 *reg, off_t regoff, u16 data)
 +{
 + out_le16(reg, data);
 +
 + return 0;
 +}
 +
 +int fpga_get_reg(u32 fpga, u16 *reg, off_t regoff, u16 *data)
 +{
 + *data = in_le16(reg);
 +
 + return 0;
 +}

We have the very same code repeated 3 times aready here, and two more
times follow further down.  Please factor out this common code so we
have a single copy only.

Also, this does not handle the non-memory-mapped case (for fpga == 0) ?

 @@ -230,17 +249,21 @@ int last_stage_init(void)
   */
  void fpga_gpio_set(int pin)
  {
 - out_le16((void *)(CONFIG_SYS_FPGA0_BASE + 0x18), pin);
 + FPGA_SET_REG(0, gpio.set, pin);
  }
  
  void fpga_gpio_clear(int pin)
  {
 - out_le16((void *)(CONFIG_SYS_FPGA0_BASE + 0x16), pin);
 + FPGA_SET_REG(0, gpio.clear, pin);
  }
  
  int fpga_gpio_get(int pin)
  {
 - return in_le16((void *)(CONFIG_SYS_FPGA0_BASE + 0x14))  pin;
 + u16 val;
 +
 + FPGA_GET_REG(0, gpio.read, val);
 +
 + return val  pin;
  }

Do you really have to keep these fpga_gpio_set() / fpga_gpio_clear() /
fpga_gpio_get() functions?  Can you not fix the related code to use
FPGA_GET_REG() directly?


 @@ -282,7 +288,7 @@ static int osd_print(cmd_tbl_t *cmdtp, int flag, int 
 argc, char * const argv[])
  {
   unsigned screen;
  
 - for (screen = 0; screen  CONFIG_SYS_OSD_SCREENS; ++screen) {
 + for (screen = 0; screen = max_osd_screen; ++screen) {

This looks like an unrelated change.  Is it intentionally included
here?

...
 - out_le16(osd-xy_size, ((32 - 1)  8) | (16 - 1));
 - out_le16(osd-x_pos, 0x007f);
 - out_le16(osd-y_pos, 0x005f);
 + if (screen  max_osd_screen)
 + max_osd_screen = screen;

Ditto here?

 @@ -386,7 +396,7 @@ int osd_write(cmd_tbl_t *cmdtp, int flag, int argc, char 
 * const argv[])
  {
   unsigned screen;
  
 - for (screen = 0; screen  CONFIG_SYS_OSD_SCREENS; ++screen) {
 + for (screen = 0; screen = max_osd_screen; ++screen) {

And here?

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
Do not simplify the design of a program if a way can be found to make
it complex and wonderful.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 17/21] arm: Implement the 'fake' go command

2013-06-11 Thread Albert ARIBAUD
Hi Simon,

On Tue, 11 Jun 2013 11:14:49 -0700, Simon Glass s...@chromium.org
wrote:

 Implement this feature on ARM for tracing.
 
 It would be nice to have generic bootm support so that it is easily
 implemented on any arch.
 
 Signed-off-by: Simon Glass s...@chromium.org
 ---
 Changes in v2: None
 
  arch/arm/lib/bootm.c | 33 +
  1 file changed, 21 insertions(+), 12 deletions(-)
 
 diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c
 index 1b6e0ac..28fba19 100644
 --- a/arch/arm/lib/bootm.c
 +++ b/arch/arm/lib/bootm.c

 @@ -225,14 +232,15 @@ static void boot_prep_linux(bootm_headers_t *images)
  }
  
  /* Subcommand: GO */
 -static void boot_jump_linux(bootm_headers_t *images)
 +static void boot_jump_linux(bootm_headers_t *image, int flag)

What's the rationale of the s/images/image/ ?

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


Re: [U-Boot] [PATCH v2 17/21] arm: Implement the 'fake' go command

2013-06-11 Thread Simon Glass
Hi Albert,

On Tue, Jun 11, 2013 at 12:59 PM, Albert ARIBAUD
albert.u.b...@aribaud.netwrote:

 Hi Simon,

 On Tue, 11 Jun 2013 11:14:49 -0700, Simon Glass s...@chromium.org
 wrote:

  Implement this feature on ARM for tracing.
 
  It would be nice to have generic bootm support so that it is easily
  implemented on any arch.
 
  Signed-off-by: Simon Glass s...@chromium.org
  ---
  Changes in v2: None
 
   arch/arm/lib/bootm.c | 33 +
   1 file changed, 21 insertions(+), 12 deletions(-)
 
  diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c
  index 1b6e0ac..28fba19 100644
  --- a/arch/arm/lib/bootm.c
  +++ b/arch/arm/lib/bootm.c

  @@ -225,14 +232,15 @@ static void boot_prep_linux(bootm_headers_t
 *images)
   }
 
   /* Subcommand: GO */
  -static void boot_jump_linux(bootm_headers_t *images)
  +static void boot_jump_linux(bootm_headers_t *image, int flag)

 What's the rationale of the s/images/image/ ?


Just that the function only accesses a single image, so I felt it was a
misnomer.

Regards,
Simon



 Amicalement,
 --
 Albert.

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


Re: [U-Boot] [PATCH] ppc: ppmc7xx: Fix possible out-of-bound access

2013-06-11 Thread Wolfgang Denk
Dear Marek Vasut,

In message 1369018900-11198-1-git-send-email-ma...@denx.de you wrote:
 The flash_info_t-start[] field is limited in size by 
 CONFIG_SYS_MAX_FLASH_SECT
 macro, which is set to 19 for this board in the board config file. If we 
 inspect
 the board/ppmc7xx/flash.c closely, especially the flash_get_size() function, 
 we
 can notice the switch ((long)flashtest) at around line 80 having a few 
 results
 which will set flash_info_t-sector_count to value higher than 19, for example
 case AMD_ID_LV640U will set it to 128. Notice that right underneath, 
 iteration
 over flash_info_t-start[] happens and the upper bound for the interation is
 flash_info_t-sector_count. Now if the sector_count is 128 as it is for the
 AMD_ID_LV640U case, but the CONFIG_SYS_MAX_FLASH_SECT limiting the start[] is
 only 19, an access past the start[] array much happen. Moreover, during this
 iteration, the field is written to, so memory corruption is inevitable.
 
 Signed-off-by: Marek Vasut ma...@denx.de
 Cc: Wolfgang Denk w...@denx.de
 Cc: Tom Rini tr...@ti.com
 Cc: Richard Danter richard.dan...@windriver.com
 ---
  include/configs/ppmc7xx.h |2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks.

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
You could end up being oddly sad and full of a strange, diffuse  com-
passion  which would lead you to believe that it might be a good idea
to wipe out the whole human race and start again with amoebas.
 - Terry Pratchett, _Guards! Guards!_
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 17/21] arm: Implement the 'fake' go command

2013-06-11 Thread Albert ARIBAUD
Hi Simon,

On Tue, 11 Jun 2013 13:02:56 -0700, Simon Glass s...@chromium.org
wrote:

 Hi Albert,
 
 On Tue, Jun 11, 2013 at 12:59 PM, Albert ARIBAUD
 albert.u.b...@aribaud.netwrote:
 
  Hi Simon,
 
  On Tue, 11 Jun 2013 11:14:49 -0700, Simon Glass s...@chromium.org
  wrote:
 
   Implement this feature on ARM for tracing.
  
   It would be nice to have generic bootm support so that it is easily
   implemented on any arch.
  
   Signed-off-by: Simon Glass s...@chromium.org
   ---
   Changes in v2: None
  
arch/arm/lib/bootm.c | 33 +
1 file changed, 21 insertions(+), 12 deletions(-)
  
   diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c
   index 1b6e0ac..28fba19 100644
   --- a/arch/arm/lib/bootm.c
   +++ b/arch/arm/lib/bootm.c
 
   @@ -225,14 +232,15 @@ static void boot_prep_linux(bootm_headers_t
  *images)
}
  
/* Subcommand: GO */
   -static void boot_jump_linux(bootm_headers_t *images)
   +static void boot_jump_linux(bootm_headers_t *image, int flag)
 
  What's the rationale of the s/images/image/ ?
 
 
 Just that the function only accesses a single image, so I felt it was a
 misnomer.

I wonder if the naming was not initially chosen to remind readers that
this single image file may actually contain several images
(kernel+initrd, for instance.

 Regards,
 Simon

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


[U-Boot] [PATCH V3 REPOST 2/4] mmc: report capacity for the selected partition

2013-06-11 Thread Stephen Warren
From: Stephen Warren swar...@nvidia.com

Enhance the MMC core to calculate the size of each MMC partition, and
update mmc-capacity whenever a partition is selected. This causes:

mmc dev 0 1 ; mmcinfo

... to report the size of the currently selected partition, rather than
always reporting the size of the user partition.

Signed-off-by: Stephen Warren swar...@nvidia.com
---
v3: No change.
v2: No change.
---
 drivers/mmc/mmc.c | 68 +--
 include/mmc.h |  7 ++
 2 files changed, 68 insertions(+), 7 deletions(-)

diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index 0a2f535..31036f7 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -700,16 +700,49 @@ static int mmc_change_freq(struct mmc *mmc)
return 0;
 }
 
+static int mmc_set_capacity(struct mmc *mmc, int part_num)
+{
+   switch (part_num) {
+   case 0:
+   mmc-capacity = mmc-capacity_user;
+   break;
+   case 1:
+   case 2:
+   mmc-capacity = mmc-capacity_boot;
+   break;
+   case 3:
+   mmc-capacity = mmc-capacity_rpmb;
+   break;
+   case 4:
+   case 5:
+   case 6:
+   case 7:
+   mmc-capacity = mmc-capacity_gp[part_num - 4];
+   break;
+   default:
+   return -1;
+   }
+
+   mmc-block_dev.lba = lldiv(mmc-capacity, mmc-read_bl_len);
+
+   return 0;
+}
+
 int mmc_switch_part(int dev_num, unsigned int part_num)
 {
struct mmc *mmc = find_mmc_device(dev_num);
+   int ret;
 
if (!mmc)
return -1;
 
-   return mmc_switch(mmc, EXT_CSD_CMD_SET_NORMAL, EXT_CSD_PART_CONF,
- (mmc-part_config  ~PART_ACCESS_MASK)
- | (part_num  PART_ACCESS_MASK));
+   ret = mmc_switch(mmc, EXT_CSD_CMD_SET_NORMAL, EXT_CSD_PART_CONF,
+(mmc-part_config  ~PART_ACCESS_MASK)
+| (part_num  PART_ACCESS_MASK));
+   if (ret)
+   return ret;
+
+   return mmc_set_capacity(mmc, part_num);
 }
 
 int mmc_getcd(struct mmc *mmc)
@@ -917,7 +950,7 @@ static void mmc_set_bus_width(struct mmc *mmc, uint width)
 
 static int mmc_startup(struct mmc *mmc)
 {
-   int err;
+   int err, i;
uint mult, freq;
u64 cmult, csize, capacity;
struct mmc_cmd cmd;
@@ -1035,8 +1068,12 @@ static int mmc_startup(struct mmc *mmc)
cmult = (mmc-csd[2]  0x00038000)  15;
}
 
-   mmc-capacity = (csize + 1)  (cmult + 2);
-   mmc-capacity *= mmc-read_bl_len;
+   mmc-capacity_user = (csize + 1)  (cmult + 2);
+   mmc-capacity_user *= mmc-read_bl_len;
+   mmc-capacity_boot = 0;
+   mmc-capacity_rpmb = 0;
+   for (i = 0; i  4; i++)
+   mmc-capacity_gp[i] = 0;
 
if (mmc-read_bl_len  MMC_MAX_BLOCK_LEN)
mmc-read_bl_len = MMC_MAX_BLOCK_LEN;
@@ -1075,7 +1112,7 @@ static int mmc_startup(struct mmc *mmc)
| ext_csd[EXT_CSD_SEC_CNT + 3]  24;
capacity *= MMC_MAX_BLOCK_LEN;
if ((capacity  20)  2 * 1024)
-   mmc-capacity = capacity;
+   mmc-capacity_user = capacity;
}
 
switch (ext_csd[EXT_CSD_REV]) {
@@ -1117,8 +1154,25 @@ static int mmc_startup(struct mmc *mmc)
if ((ext_csd[EXT_CSD_PARTITIONING_SUPPORT]  PART_SUPPORT) ||
ext_csd[EXT_CSD_BOOT_MULT])
mmc-part_config = ext_csd[EXT_CSD_PART_CONF];
+
+   mmc-capacity_boot = ext_csd[EXT_CSD_BOOT_MULT]  17;
+
+   mmc-capacity_rpmb = ext_csd[EXT_CSD_RPMB_MULT]  17;
+
+   for (i = 0; i  4; i++) {
+   int idx = EXT_CSD_GP_SIZE_MULT + i * 3;
+   mmc-capacity_gp[i] = (ext_csd[idx + 2]  16) +
+   (ext_csd[idx + 1]  8) + ext_csd[idx];
+   mmc-capacity_gp[i] *=
+   ext_csd[EXT_CSD_HC_ERASE_GRP_SIZE];
+   mmc-capacity_gp[i] *= ext_csd[EXT_CSD_HC_WP_GRP_SIZE];
+   }
}
 
+   err = mmc_set_capacity(mmc, mmc-part_num);
+   if (err)
+   return err;
+
if (IS_SD(mmc))
err = sd_change_freq(mmc);
else
diff --git a/include/mmc.h b/include/mmc.h
index 566db59..ea198d8 100644
--- a/include/mmc.h
+++ b/include/mmc.h
@@ -158,7 +158,9 @@
 /*
  * EXT_CSD fields
  */
+#define EXT_CSD_GP_SIZE_MULT   143 /* R/W */
 #define EXT_CSD_PARTITIONING_SUPPORT   160 /* RO */
+#define EXT_CSD_RPMB_MULT  168 /* RO */
 #define EXT_CSD_ERASE_GROUP_DEF175 /* R/W */
 #define EXT_CSD_PART_CONF  179 /* R/W */
 #define EXT_CSD_BUS_WIDTH  183 /* R/W */
@@ -166,6 +168,7 @@
 #define 

[U-Boot] [PATCH V3 REPOST 1/4] README: document CONFIG_ENV_IS_IN_MMC

2013-06-11 Thread Stephen Warren
From: Stephen Warren swar...@nvidia.com

Describe the meaning of CONFIG_ENV_IS_IN_MMC, and all related defines that
must or can be set when using that option.

Signed-off-by: Stephen Warren swar...@nvidia.com
Reviewed-by: Peter Korsgaard jac...@sunsite.dk
Acked-by: Tom Rini tr...@ti.com
---
v3:
* Mention that env size/offset are in bytes.
* Fix typo; s/CONFIG_ENV_OFFSET/CONFIG_ENV_SIZE/ in one place.
v2: New patch.
---
 README | 40 
 1 file changed, 40 insertions(+)

diff --git a/README b/README
index 3012dcd..e7fedb8 100644
--- a/README
+++ b/README
@@ -3606,6 +3606,46 @@ but it can not erase, write this NOR flash by SRIO or 
PCIE interface.
  You will probably want to define these to avoid a really noisy system
  when storing the env in UBI.
 
+- CONFIG_ENV_IS_IN_MMC:
+
+   Define this if you have an MMC device which you want to use for the
+   environment.
+
+   - CONFIG_SYS_MMC_ENV_DEV:
+
+ Specifies which MMC device the environment is stored in.
+
+   - CONFIG_SYS_MMC_ENV_PART (optional):
+
+ Specifies which MMC partition the environment is stored in. If not
+ set, defaults to partition 0, the user area. Common values might be
+ 1 (first MMC boot partition), 2 (second MMC boot partition).
+
+   - CONFIG_ENV_OFFSET:
+   - CONFIG_ENV_SIZE:
+
+ These two #defines specify the offset and size of the environment
+ area within the specified MMC device.
+
+ These two values are in units of bytes, but must be aligned to an
+ MMC sector boundary.
+
+   - CONFIG_ENV_OFFSET_REDUND (optional):
+
+ Specifies a second storage area, of CONFIG_ENV_SIZE size, used to
+ hold a redundant copy of the environment data. This provides a
+ valid backup copy in case the other copy is corrupted, e.g. due
+ to a power failure during a saveenv operation.
+
+ This value is also in units of bytes, but must also be aligned to
+ an MMC sector boundary.
+
+   - CONFIG_ENV_SIZE_REDUND (optional):
+
+ This value need not be set, even when CONFIG_ENV_OFFSET_REDUND is
+ set. If this value is set, it must be set to the same value as
+ CONFIG_ENV_SIZE.
+
 - CONFIG_SYS_SPI_INIT_OFFSET
 
Defines offset to the initial SPI buffer area in DPRAM. The
-- 
1.8.1.5

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


[U-Boot] [PATCH V3 REPOST 3/4] env_mmc: allow negative CONFIG_ENV_OFFSET

2013-06-11 Thread Stephen Warren
From: Stephen Warren swar...@nvidia.com

A negative value of CONFIG_ENV_OFFSET is treated as a backwards offset
from the end of the eMMC device/partition, rather than a forwards offset
from the start.

This is useful when a single board may be stuffed with different eMMC
devices, each of which has a different capacity, and you always want the
environment to be stored at the very end of the device (or eMMC boot
partition for example).

One example of this case is NVIDIA's Ventana reference board.

Signed-off-by: Stephen Warren swar...@nvidia.com
---
v3: No change.
v2: Also update README to describe the change.
---
 README   | 11 +++
 common/env_mmc.c | 12 ++--
 2 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/README b/README
index e7fedb8..56d5e91 100644
--- a/README
+++ b/README
@@ -3627,6 +3627,14 @@ but it can not erase, write this NOR flash by SRIO or 
PCIE interface.
  These two #defines specify the offset and size of the environment
  area within the specified MMC device.
 
+ If offset is positive (the usual case), it is treated as relative to
+ the start of the MMC partition. If offset is negative, it is treated
+ as relative to the end of the MMC partition. This can be useful if
+ your board may be fitted with different MMC devices, which have
+ different sizes for the MMC partitions, and you always want the
+ environment placed at the very end of the partition, to leave the
+ maximum possible space before it, to store other data.
+
  These two values are in units of bytes, but must be aligned to an
  MMC sector boundary.
 
@@ -3637,6 +3645,9 @@ but it can not erase, write this NOR flash by SRIO or 
PCIE interface.
  valid backup copy in case the other copy is corrupted, e.g. due
  to a power failure during a saveenv operation.
 
+ This value may also be positive or negative; this is handled in the
+ same way as CONFIG_ENV_OFFSET.
+
  This value is also in units of bytes, but must also be aligned to
  an MMC sector boundary.
 
diff --git a/common/env_mmc.c b/common/env_mmc.c
index 9ca098f..5d3a769 100644
--- a/common/env_mmc.c
+++ b/common/env_mmc.c
@@ -53,11 +53,19 @@ DECLARE_GLOBAL_DATA_PTR;
 
 __weak int mmc_get_env_addr(struct mmc *mmc, int copy, u32 *env_addr)
 {
-   *env_addr = CONFIG_ENV_OFFSET;
+   s64 offset;
+
+   offset = CONFIG_ENV_OFFSET;
 #ifdef CONFIG_ENV_OFFSET_REDUND
if (copy)
-   *env_addr = CONFIG_ENV_OFFSET_REDUND;
+   offset = CONFIG_ENV_OFFSET_REDUND;
 #endif
+
+   if (offset  0)
+   offset += mmc-capacity;
+
+   *env_addr = offset;
+
return 0;
 }
 
-- 
1.8.1.5

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


[U-Boot] [PATCH V3 REPOST 4/4] ARM: tegra: make use of negative ENV_OFFSET on NVIDIA boards

2013-06-11 Thread Stephen Warren
From: Stephen Warren swar...@nvidia.com

Use a negative value of CONFIG_ENV_OFFSET for all NVIDIA reference boards
that store the U-Boot environment in the 2nd eMMC boot partition. This
makes U-Boot agnostic to the size of the eMMC boot partition, which can
vary depending on which eMMC device was actually stuffed into the board.

Signed-off-by: Stephen Warren swar...@nvidia.com
Acked-by: Tom Warren twar...@nvidia.com
---
v3: No change.
v2: No change.
---
 include/configs/beaver.h   | 2 +-
 include/configs/cardhu.h   | 2 +-
 include/configs/dalmore.h  | 2 +-
 include/configs/paz00.h| 2 +-
 include/configs/seaboard.h | 2 +-
 include/configs/ventana.h  | 2 +-
 include/configs/whistler.h | 4 ++--
 7 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/include/configs/beaver.h b/include/configs/beaver.h
index 058da4f..d51f5f8 100644
--- a/include/configs/beaver.h
+++ b/include/configs/beaver.h
@@ -56,7 +56,7 @@
 
 /* Environment in eMMC, at the end of 2nd boot sector */
 #define CONFIG_ENV_IS_IN_MMC
-#define CONFIG_ENV_OFFSET  ((1024 * 1024) - CONFIG_ENV_SIZE)
+#define CONFIG_ENV_OFFSET  (-CONFIG_ENV_SIZE)
 #define CONFIG_SYS_MMC_ENV_DEV 0
 #define CONFIG_SYS_MMC_ENV_PART2
 
diff --git a/include/configs/cardhu.h b/include/configs/cardhu.h
index fd46083..142d20b 100644
--- a/include/configs/cardhu.h
+++ b/include/configs/cardhu.h
@@ -55,7 +55,7 @@
 
 /* Environment in eMMC, at the end of 2nd boot sector */
 #define CONFIG_ENV_IS_IN_MMC
-#define CONFIG_ENV_OFFSET  ((512 * 1024) - CONFIG_ENV_SIZE)
+#define CONFIG_ENV_OFFSET  (-CONFIG_ENV_SIZE)
 #define CONFIG_SYS_MMC_ENV_DEV 0
 #define CONFIG_SYS_MMC_ENV_PART2
 
diff --git a/include/configs/dalmore.h b/include/configs/dalmore.h
index 2723843..b6e0161 100644
--- a/include/configs/dalmore.h
+++ b/include/configs/dalmore.h
@@ -60,7 +60,7 @@
 #define CONFIG_ENV_IS_IN_MMC
 #define CONFIG_SYS_MMC_ENV_DEV 0
 #define CONFIG_SYS_MMC_ENV_PART2
-#define CONFIG_ENV_OFFSET  ((4096 * 1024) - CONFIG_ENV_SIZE)
+#define CONFIG_ENV_OFFSET  (-CONFIG_ENV_SIZE)
 
 #define MACH_TYPE_DALMORE  4304/* not yet in mach-types.h */
 
diff --git a/include/configs/paz00.h b/include/configs/paz00.h
index eac1ef9..9e2686a 100644
--- a/include/configs/paz00.h
+++ b/include/configs/paz00.h
@@ -46,7 +46,7 @@
 
 /* Environment in eMMC, at the end of 2nd boot sector */
 #define CONFIG_ENV_IS_IN_MMC
-#define CONFIG_ENV_OFFSET ((1024 * 1024) - CONFIG_ENV_SIZE)
+#define CONFIG_ENV_OFFSET (-CONFIG_ENV_SIZE)
 #define CONFIG_SYS_MMC_ENV_DEV 0
 #define CONFIG_SYS_MMC_ENV_PART 2
 
diff --git a/include/configs/seaboard.h b/include/configs/seaboard.h
index f66173e..f0da1fc 100644
--- a/include/configs/seaboard.h
+++ b/include/configs/seaboard.h
@@ -72,7 +72,7 @@
 
 /* Environment in eMMC, at the end of 2nd boot sector */
 #define CONFIG_ENV_IS_IN_MMC
-#define CONFIG_ENV_OFFSET ((512 * 1024) - CONFIG_ENV_SIZE)
+#define CONFIG_ENV_OFFSET (-CONFIG_ENV_SIZE)
 #define CONFIG_SYS_MMC_ENV_DEV 0
 #define CONFIG_SYS_MMC_ENV_PART 2
 
diff --git a/include/configs/ventana.h b/include/configs/ventana.h
index 5755f11..41a7176 100644
--- a/include/configs/ventana.h
+++ b/include/configs/ventana.h
@@ -52,7 +52,7 @@
 
 /* Environment in eMMC, at the end of 2nd boot sector */
 #define CONFIG_ENV_IS_IN_MMC
-#define CONFIG_ENV_OFFSET ((1024 * 1024) - CONFIG_ENV_SIZE)
+#define CONFIG_ENV_OFFSET (-CONFIG_ENV_SIZE)
 #define CONFIG_SYS_MMC_ENV_DEV 0
 #define CONFIG_SYS_MMC_ENV_PART 2
 
diff --git a/include/configs/whistler.h b/include/configs/whistler.h
index 9542c7e..994edec 100644
--- a/include/configs/whistler.h
+++ b/include/configs/whistler.h
@@ -61,12 +61,12 @@
 
 /*
  * Environment in eMMC, at the end of 2nd boot sector. Note: This assumes
- * the user plugged the standard 8MB MoviNAND card into J29/HSMMC/POP. If
+ * the user plugged the standard 8GB MoviNAND card into J29/HSMMC/POP. If
  * they didn't, the boot sector layout may be different. However, use of that
  * particular card is standard practice as far as I know.
  */
 #define CONFIG_ENV_IS_IN_MMC
-#define CONFIG_ENV_OFFSET ((512 * 1024) - CONFIG_ENV_SIZE)
+#define CONFIG_ENV_OFFSET (-CONFIG_ENV_SIZE)
 #define CONFIG_SYS_MMC_ENV_DEV 0
 #define CONFIG_SYS_MMC_ENV_PART 2
 
-- 
1.8.1.5

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


Re: [U-Boot] [PATCH v2 17/21] arm: Implement the 'fake' go command

2013-06-11 Thread Simon Glass
Hi Albert,


On Tue, Jun 11, 2013 at 1:21 PM, Albert ARIBAUD
albert.u.b...@aribaud.netwrote:

 Hi Simon,

 On Tue, 11 Jun 2013 13:02:56 -0700, Simon Glass s...@chromium.org
 wrote:

  Hi Albert,
 
  On Tue, Jun 11, 2013 at 12:59 PM, Albert ARIBAUD
  albert.u.b...@aribaud.netwrote:
 
   Hi Simon,
  
   On Tue, 11 Jun 2013 11:14:49 -0700, Simon Glass s...@chromium.org
   wrote:
  
Implement this feature on ARM for tracing.
   
It would be nice to have generic bootm support so that it is easily
implemented on any arch.
   
Signed-off-by: Simon Glass s...@chromium.org
---
Changes in v2: None
   
 arch/arm/lib/bootm.c | 33 +
 1 file changed, 21 insertions(+), 12 deletions(-)
   
diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c
index 1b6e0ac..28fba19 100644
--- a/arch/arm/lib/bootm.c
+++ b/arch/arm/lib/bootm.c
  
@@ -225,14 +232,15 @@ static void boot_prep_linux(bootm_headers_t
   *images)
 }
   
 /* Subcommand: GO */
-static void boot_jump_linux(bootm_headers_t *images)
+static void boot_jump_linux(bootm_headers_t *image, int flag)
  
   What's the rationale of the s/images/image/ ?
  
 
  Just that the function only accesses a single image, so I felt it was a
  misnomer.

 I wonder if the naming was not initially chosen to remind readers that
 this single image file may actually contain several images
 (kernel+initrd, for instance.


Ah yes, that could be it :-) Shall I change it back?

Regards,
Simon



  Regards,
  Simon

 Amicalement,
 --
 Albert.

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


[U-Boot] PPC: 74xx/7xx: Pull request

2013-06-11 Thread Wolfgang Denk
Dear Tom,

The following changes since commit e1208c2fe5e07f9a248cfbf9bbb212aa34ad2806:

  MIPS: asm/errno.h: switch to asm-generic/errno.h (2013-06-08 23:10:10 +0200)

are available in the git repository at:

  git://git.denx.de/u-boot-74xx-7xx master

for you to fetch changes up to 8cf695537f55f6574d2a85ae4ddc5b9c9f0d26b3:

  ppc: ppmc7xx: Fix possible out-of-bound access (2013-06-11 22:11:38 +0200)


Marek Vasut (1):
  ppc: ppmc7xx: Fix possible out-of-bound access

 include/configs/ppmc7xx.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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
After a time, you may find that having is not so pleasing a thing,
after all, as wanting.  It is not logical, but it is often true.
-- Spock, Amok Time, stardate 3372.7
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] PPC: MPC8xx / MPC82xx: Pull request

2013-06-11 Thread Wolfgang Denk
Dear Tom,

The following changes since commit e1208c2fe5e07f9a248cfbf9bbb212aa34ad2806:

  MIPS: asm/errno.h: switch to asm-generic/errno.h (2013-06-08 23:10:10 +0200)

are available in the git repository at:

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

for you to fetch changes up to a166fbca20e40937bf37cc18c389f68e995c1821:

  powerpc: fix 8xx and 82xx type-punning warnings with GCC 4.7 (2013-06-11 
22:01:45 +0200)


Scott Wood (1):
  powerpc: fix 8xx and 82xx type-punning warnings with GCC 4.7

 arch/powerpc/cpu/mpc8260/commproc.c|  2 +-
 arch/powerpc/cpu/mpc8260/cpu.c |  2 +-
 arch/powerpc/cpu/mpc8260/i2c.c |  8 
 arch/powerpc/cpu/mpc8260/serial_smc.c  |  4 ++--
 arch/powerpc/cpu/mpc8260/spi.c |  2 +-
 arch/powerpc/cpu/mpc8xx/cpu.c  | 12 
 arch/powerpc/include/asm/8xx_immap.h   |  7 ++-
 arch/powerpc/include/asm/immap_8260.h  | 19 ---
 common/cmd_immap.c |  2 +-
 examples/standalone/mem_to_mem_idma2intr.c |  3 ++-
 include/commproc.h |  1 +
 11 files changed, 39 insertions(+), 23 deletions(-)

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
But it's real. And if it's real it can be affected ... we may not  be
able  to break it, but, I'll bet you credits to Navy Beans we can put
a dent in it.
-- deSalle, Catspaw, stardate 3018.2
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 17/21] arm: Implement the 'fake' go command

2013-06-11 Thread Albert ARIBAUD
Hi Simon,

On Tue, 11 Jun 2013 14:17:42 -0700, Simon Glass s...@chromium.org
wrote:

 Hi Albert,
 
 
 On Tue, Jun 11, 2013 at 1:21 PM, Albert ARIBAUD
 albert.u.b...@aribaud.netwrote:
 
  Hi Simon,
 
  On Tue, 11 Jun 2013 13:02:56 -0700, Simon Glass s...@chromium.org
  wrote:
 
   Hi Albert,
  
   On Tue, Jun 11, 2013 at 12:59 PM, Albert ARIBAUD
   albert.u.b...@aribaud.netwrote:
  
Hi Simon,
   
On Tue, 11 Jun 2013 11:14:49 -0700, Simon Glass s...@chromium.org
wrote:
   
 Implement this feature on ARM for tracing.

 It would be nice to have generic bootm support so that it is easily
 implemented on any arch.

 Signed-off-by: Simon Glass s...@chromium.org
 ---
 Changes in v2: None

  arch/arm/lib/bootm.c | 33 +
  1 file changed, 21 insertions(+), 12 deletions(-)

 diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c
 index 1b6e0ac..28fba19 100644
 --- a/arch/arm/lib/bootm.c
 +++ b/arch/arm/lib/bootm.c
   
 @@ -225,14 +232,15 @@ static void boot_prep_linux(bootm_headers_t
*images)
  }

  /* Subcommand: GO */
 -static void boot_jump_linux(bootm_headers_t *images)
 +static void boot_jump_linux(bootm_headers_t *image, int flag)
   
What's the rationale of the s/images/image/ ?
   
  
   Just that the function only accesses a single image, so I felt it was a
   misnomer.
 
  I wonder if the naming was not initially chosen to remind readers that
  this single image file may actually contain several images
  (kernel+initrd, for instance.
 
 
 Ah yes, that could be it :-) Shall I change it back?

I'd personally prefer that you keep it plural as it was, yes.

 Regards,
 Simon

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


Re: [U-Boot] [PATCH 0/8] rely on latest dtc, simplify

2013-06-11 Thread Tom Rini
On Tue, Jun 11, 2013 at 10:36:14AM -0600, Stephen Warren wrote:
 On 06/11/2013 10:19 AM, Tom Rini wrote:
  On Mon, Jun 10, 2013 at 05:16:56PM -0600, Stephen Warren wrote:
  
  From: Stephen Warren swar...@nvidia.com
  
  This is a series of patches which simplifies the rules to build
  *.dts in U-Boot by relying on features in the latest dtc. The
  include rules are made more consistent between cpp (when
  processing *.dts) and dtc. The cpp flags are made more consistent
  with the way the kernel processes *.dts to allow better
  portability of *.dts between the two.
  
  Please add a dtc-version Makefile variable and corresponding 
  tools/dtc-version.sh script, ala gcc/binutils so that we can error
  out gracefully if dtc isn't supporting the options we need.
 
 Hmm. dtc doesn't really seem to do releases. Hence, there's no version
 number available to check for here:-( (i.e. the features this series
 rely on were added after 1.3.0, which is the most recent, but quite
 old, tagged release).
 
 I suppose I could ping them yet again on tagging a release...

Yeah, I can imagine a release might also help encourage distributions to
update...

-- 
Tom


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


  1   2   >