Re: [U-Boot] [PATCH 3/4 v4] powerpc: keymile: Add a check for the PIGGY debug board

2008-11-24 Thread Ben Warren
Heiko Schocher wrote:
> Check the presence of the PIGGY on the keymile boards mgcoge,
> mgsuvd and kmeter1. If the PIGGY is not present, dont register
> this Ethernet device.
>
> Signed-off-by: Heiko Schocher <[EMAIL PROTECTED]>
>   
Acked-by: Ben Warren <[EMAIL PROTECTED]>
> ---
>
> changes since v3 patch:
>  - add comment from Gary Jeenejohn
>calling keymile_hdlc_enet_initialize () in board_eth_init ()
>
>  board/keymile/common/common.c   |   23 +--
>  board/keymile/common/common.h   |   20 
>  board/keymile/kmeter1/Makefile  |6 --
>  board/keymile/kmeter1/kmeter1.c |7 ++-
>  board/keymile/mgcoge/mgcoge.c   |   10 +++---
>  board/keymile/mgsuvd/mgsuvd.c   |8 ++--
>  include/configs/kmeter1.h   |9 +
>  include/configs/mgcoge.h|   10 ++
>  include/configs/mgsuvd.h|9 +
>  9 files changed, 92 insertions(+), 10 deletions(-)
>  create mode 100644 board/keymile/common/common.h
>
> diff --git a/board/keymile/common/common.c b/board/keymile/common/common.c
> index a4cf24c..1338950 100644
> --- a/board/keymile/common/common.c
> +++ b/board/keymile/common/common.c
> @@ -22,10 +22,14 @@
>   */
>
>  #include 
> +#if defined(CONFIG_MGCOGE)
>  #include 
> +#endif
>  #include 
>  #include 
>  #include 
> +#include 
> +#include 
>
>  #if defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT)
>  #include 
> @@ -33,8 +37,6 @@
>
>  #if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C)
>  #include 
> -#endif
> -#include 
>
>  extern int i2c_soft_read_pin (void);
>
> @@ -495,6 +497,7 @@ void i2c_init_board(void)
>  #endif
>  }
>  #endif
> +#endif
>
>  #if defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT)
>  int fdt_set_node_and_value (void *blob,
> @@ -521,3 +524,19 @@ int fdt_set_node_and_value (void *blob,
>   return ret;
>  }
>  #endif
> +
> +int ethernet_present (void)
> +{
> + return (in_8((u8 *)CONFIG_SYS_PIGGY_BASE + CONFIG_SYS_SLOT_ID_OFF) & 
> 0x80);
> +}
> +
> +int board_eth_init (bd_t *bis)
> +{
> +#ifdef CONFIG_KEYMILE_HDLC_ENET
> + (void)keymile_hdlc_enet_initialize (bis);
> +#endif
> + if (ethernet_present ()) {
> + return -1;
> + }
> + return 0;
> +}
> diff --git a/board/keymile/common/common.h b/board/keymile/common/common.h
> new file mode 100644
> index 000..d3d6814
> --- /dev/null
> +++ b/board/keymile/common/common.h
> @@ -0,0 +1,20 @@
> +/*
> + * (C) Copyright 2008
> + * Heiko Schocher, DENX Software Engineering, [EMAIL PROTECTED]
> + *
> + * 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.
> + */
> +
> +#ifndef __KEYMILE_COMMON_H
> +#define __KEYMILE_COMMON_H
> +
> +int ethernet_present (void);
> +int ivm_read_eeprom (void);
> +
> +#ifdef CONFIG_KEYMILE_HDLC_ENET
> +int keymile_hdlc_enet_initialize (bd_t *bis);
> +#endif
> +#endif /* __KEYMILE_COMMON_H */
> diff --git a/board/keymile/kmeter1/Makefile b/board/keymile/kmeter1/Makefile
> index 88b79f3..12a1518 100644
> --- a/board/keymile/kmeter1/Makefile
> +++ b/board/keymile/kmeter1/Makefile
> @@ -22,12 +22,14 @@
>  #
>
>  include $(TOPDIR)/config.mk
> +ifneq ($(OBJTREE),$(SRCTREE))
> +$(shell mkdir -p $(obj)../common)
> +endif
>
>  LIB  = $(obj)lib$(BOARD).a
>
> -COBJS-y += $(BOARD).o
> +COBJS+= $(BOARD).o ../common/common.o
>
> -COBJS:= $(COBJS-y)
>  SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
>  OBJS := $(addprefix $(obj),$(COBJS))
>  SOBJS:= $(addprefix $(obj),$(SOBJS))
> diff --git a/board/keymile/kmeter1/kmeter1.c b/board/keymile/kmeter1/kmeter1.c
> index f9a59a6..f04a57a 100644
> --- a/board/keymile/kmeter1/kmeter1.c
> +++ b/board/keymile/kmeter1/kmeter1.c
> @@ -27,6 +27,8 @@
>  #include 
>  #include 
>
> +#include "../common/common.h"
> +
>  const qe_iop_conf_t qe_iop_conf_tab[] = {
>   /* port pin dir open_drain assign */
>
> @@ -141,7 +143,10 @@ phys_size_t initdram (int board_type)
>
>  int checkboard (void)
>  {
> - puts ("Board: Keymile kmeter1\n");
> + puts ("Board: Keymile kmeter1");
> + if (ethernet_present ())
> + puts (" with PIGGY.");
> + puts ("\n");
>   return 0;
>  }
>
> diff --git a/board/keymile/mgcoge/mgcoge.c b/board/keymile/mgcoge/mgcoge.c
> index 3683417..5c50739 100644
> --- a/board/keymile/mgcoge/mgcoge.c
> +++ b/board/keymile/mgcoge/mgcoge.c
> @@ -25,6 +25,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
>
>  #if defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT)
> @@ -35,7 +36,8 @@
>  #include 
>  #endif
>
> -extern int ivm_read_eeprom (void);
> +#include "../common/common.h"
> +
>  /*
>   * I/O Port configuration table
>   *
> @@ -285,8 +287,10 @@ phys_size_t initdram (int board_type)
>
>  int checkboard(void)
>  {
> - puts ("Board: mgcoge\n");
> -
> + 

Re: [U-Boot] [PATCH] sh: sh7763rdp: Update sh7763rdp config

2008-11-24 Thread Ben Warren
Hi Nobuhiro,

Nobuhiro Iwamatsu wrote:
> Add CONFIG_NET_MULTI in config file, because sh_eth changed new newwork API.
>
> Signed-off-by: Nobuhiro Iwamatsu <[EMAIL PROTECTED]>
> ---
>  include/configs/sh7763rdp.h |1 +
>  2 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/include/configs/sh7763rdp.h b/include/configs/sh7763rdp.h
> index 8a76dad..4ea79cf 100644
> --- a/include/configs/sh7763rdp.h
> +++ b/include/configs/sh7763rdp.h
> @@ -118,6 +118,7 @@
>  #define CONFIG_SYS_HZ(CONFIG_SYS_CLK_FREQ / 
> TMU_CLK_DIVIDER)
>
>  /* Ether */
> +#define CONFIG_NET_MULTI 1
>  #define CONFIG_SH_ETHER 1
>  #define CONFIG_SH_ETHER_USE_PORT (1)
>  #define CONFIG_SH_ETHER_PHY_ADDR (0x01)
>   
I added this to net/next, although it's not strictly a network patch.  I 
figured that it really needs to stick with the other patch that you sent 
changing the API for your SH ethernet controller.  Hopefully that's OK.

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


Re: [U-Boot] [PATCH] sh: sh_eth: Change new network API

2008-11-24 Thread Ben Warren
Hi Nobuhiro,

Nobuhiro Iwamatsu wrote:
> sh_eth used old network API. This patch changed new API.
>
> Signed-off-by: Nobuhiro Iwamatsu <[EMAIL PROTECTED]>
> ---
Added to net/next.

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


Re: [U-Boot] [PATCH v3] mgcoge make ether_scc.c work with CONFIG_NET_MULTI

2008-11-24 Thread Ben Warren
Hi Gary,

Gary Jennejohn wrote:
> This change is needed for mgcoge because it uses two ethernet drivers.
>
> Add a check for the presence of the PIGGY board on mgcoge.  Without this
> board networking cannot work and the initialization must be aborted.
>
> Only allocate rtx once to prevent DPRAM exhaustion.
>
> Initialize ether_scc.c and the keymile-specific HDLC driver (to be added
> soon) in eth.c.
>
> Signed-off-by: Gary Jennejohn <[EMAIL PROTECTED]>
> ---
>   
Added to net/next.

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


Re: [U-Boot] [PATCH 1/4 v3] powerpc: net: support for the SMSC LAN8700 PHY

2008-11-24 Thread Ben Warren
Hi Heiko,

Heiko Schocher wrote:
> Signed-off-by: Heiko Schocher <[EMAIL PROTECTED]>
> ---
>
> changes since v2:
>
>   added comments from Kim Philips
>   added Ben Warren to CC, because he is the net maintainer
>
>  drivers/qe/uec_phy.c |   59 
> ++
>  1 files changed, 59 insertions(+), 0 deletions(-)
>   
Added to net/next

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


Re: [U-Boot] [PATCH] net: smc911x: Make register read/write functions weak

2008-11-24 Thread Ben Warren
Hi Stefan,

Stefan Roese wrote:
> This patch changes the reg_read/_write to smc911x_reg_read/_write
> and defines then as weak so that they can be overridden by board
> specific version.
>
> This will be used by the upcoming VCTH board support.
>
> Signed-off-by: Stefan Roese <[EMAIL PROTECTED]>
> ---
>  drivers/net/smc911x.c |   77 +---
>  1 files changed, 40 insertions(+), 37 deletions(-)
>   
Applied to net/next

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


[U-Boot] [PATCH] sh: Changed value of CACHE_OC_NUM_ENTRIES and CACHE_OC_WAY_SHIFT

2008-11-24 Thread Nobuhiro Iwamatsu
SH4 is different a value of CACHE_OC_NUM_ENTRIES and
CACHE_OC_WAY_SHIFT every CPU.
This patch corrects these values.

Signed-off-by: Nobuhiro Iwamatsu <[EMAIL PROTECTED]>
---
 include/asm-sh/cpu_sh4.h |7 +++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/include/asm-sh/cpu_sh4.h b/include/asm-sh/cpu_sh4.h
index b6cc6cf..d2dbfcd 100644
--- a/include/asm-sh/cpu_sh4.h
+++ b/include/asm-sh/cpu_sh4.h
@@ -26,8 +26,15 @@
 #define CCR_CACHE_ICI0x0800

 #define CACHE_OC_ADDRESS_ARRAY 0xf400
+
+#if defined (CONFIG_CPU_SH7750) || \
+   defined(CONFIG_CPU_SH7751)
 #define CACHE_OC_WAY_SHIFT 14
 #define CACHE_OC_NUM_ENTRIES   512
+#else
+#define CACHE_OC_WAY_SHIFT 13
+#define CACHE_OC_NUM_ENTRIES   256
+#endif
 #define CACHE_OC_ENTRY_SHIFT   5

 #if defined (CONFIG_CPU_SH7750) || \
-- 
1.5.6.5

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


Re: [U-Boot] [PATCH-OMAP3] OMAP3: Convert readl/writel and replace hardcoded values

2008-11-24 Thread Kim Phillips
On Mon, 24 Nov 2008 10:53:46 +1100
"Graeme Russ" <[EMAIL PROTECTED]> wrote:

> On Mon, Nov 24, 2008 at 10:47 AM, Wolfgang Denk <[EMAIL PROTECTED]> wrote:
> 
> > Linux/Documentation/
> 
> Hmmm, thats a big mouthful to chew for such a small bootloader

I believe he meant linux/Documentation/CodingStyle

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


Re: [U-Boot] [PATCH 0/4 v3] powerpc: 83xx: add support for the 8360 based kmeter1 board.

2008-11-24 Thread Kim Phillips
On Thu, 20 Nov 2008 09:56:25 +0100
Heiko Schocher <[EMAIL PROTECTED]> wrote:

> This patch series adds support for the keymile board kmeter1
> based on a MPC8360 CPU from freescale.
> 
> The patches 1/4 - 2/4 are adding the basic support for this
> board. The patches 3/4 and 4/4 do some cleanups for the
> keymile boards.
> 
> changes since v2:
> 
> - [PATCH 1/4 v3] powerpc:  net: support for the SMSC LAN8700 PHY
>   added comments from Kim Philips

applied 2, v4 of 3, and 4/4 to u-boot-mpc83xx.git next branch.

left 1/4 for Ben.

Thanks everyone,

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


[U-Boot] Please pull u-boot-mpc83xx

2008-11-24 Thread Kim Phillips
Dear Wolfgang Denk,

please pull a couple of minor fixes for 83xx:

The following changes since commit 9b827cf1720acda2473afa516956eab6f7cca9a1:
  Selvamuthukumar (1):
Align end of bss by 4 bytes

are available in the git repository at:

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

Heiko Schocher (1):
  powerpc: 83xx: add missing TIMING_CFG1_CASLAT_* defines

Howard Gregory (1):
  mpc83xx: Improve the performance of DDR memory

 include/configs/MPC8315ERDB.h |   12 ++--
 include/mpc83xx.h |4 +++-
 2 files changed, 9 insertions(+), 7 deletions(-)

Thanks,

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


Re: [U-Boot] [PATCH v3] mpc83xx: New board support SIMPC8313

2008-11-24 Thread Kim Phillips
On Fri, 21 Nov 2008 16:44:18 -0800 (PST)
Ron Madrid <[EMAIL PROTECTED]> wrote:

> In response to my own email:
> 
> > I did not see this when I built before submitting my patch.  It seems to 
> > build
> > fine using ELDK version 4.1.  I just tried building with 4.2 and am
> > seeing the errors that you described.  For some reason, the 4.2 build has
> > about 48 extra bytes to it, and is once again putting me over the 4K
> > bootstrap limit.  I'm going to look into getting the size down, but that's a
> > decent number of bytes to try to optimize out.
> 
> 
> I've been trying to trim down my nand_spl bootstrap so that it
> will be below the 4K limit allowed by the processor.  However
> this is proving to be very challenging.  I have noticed that there
> is a little over 100 (decimal) bytes that are being unused at the
> beginning of the resulting binary (after the HRCW and version
>  string).  Would it be possible to move some functions in start.S
> (mpc83xx) in front of this (see below) part of the code?
> 
> . = EXC_OFF_SYS_RESET
> 
> .globl_start
> 
> This would allow for more board specific nand_spl boot code.
> Would something like this be allowed or am I barking up the
> wrong tree?

I'd rather we find stuff that can be ifdeffed out or moved elsewhere -
the moment we move something in there, someone will find the need to
enhance and grow whatever moved there.

what was the 4.2 toolchain doing differently than the 4.1 toolchain?
maybe that's an area worth looking into.

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


Re: [U-Boot] [PATCH] at91rm9200: fix broken boot from nor flash

2008-11-24 Thread Pink Boy

Wolkgang Denk sez,

> Jens Scharsig claims,

>> I think my patch only don't work on AT91RM9200DK,
>> AT91RM9200EK or AT91RM9200DF board. Blame it on this 
>> solution is the #ifdef construct in /cpu/arm920t/start.s 
>> at line 264. There are no low_level_init run for DK, 
>> EK andDF board.
 
> I agree. That code looks pretty bogus to me, too.

I've had the problem where trying to run u-boot directly
from rom fails, and read various bits about the defines in
start.s being goofed.
 
> I can confirm that removing the "defined(CONFIG_AT91RM9200DK) ||" 
> part there makes the code work on the AT91RM9200DK board (j24:
> patch following ASAP).
> 
> Any AT91RM9200EK and AT91RM9200DF users out there to test
> this?

I'll be happy to do that, I have an AT91RM9200-EK board that
I'm doing dev on right now.  I assume that I can download the
current tree and get the patched version?

Matt
---
Beating my head against the AT91RM9200 for too long.

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


Re: [U-Boot] [PATCH] at91rm9200: fix broken boot from nor flash

2008-11-24 Thread Jean-Christophe PLAGNIOL-VILLARD
On 10:48 Tue 18 Nov , Jens Scharsig wrote:
> This patch fix the broken boot from NOR Flash on AT91RM9200 boards, if
> CONFIG_AT91RM9200 is defined and nor preloader is used.
> 
> Please see 
> 
> for reason
> 
> Signed-off-by: Jens Scharsig <[EMAIL PROTECTED]>
> ---
apply to u-boot-at91

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


Re: [U-Boot] [PATCH] AT91RM9200DK: fix broken boot from NOR flash

2008-11-24 Thread Jean-Christophe PLAGNIOL-VILLARD
On 21:50 Mon 24 Nov , Wolfgang Denk wrote:
> From: Wolfgang Denk <[EMAIL PROTECTED]>
> 
> Signed-off-by: Wolfgang Denk <[EMAIL PROTECTED]>
> ---
>  cpu/arm920t/start.S |2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
apply to u-boot-at91

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


[U-Boot] [PATCH] AT91RM9200DK: fix broken boot from NOR flash

2008-11-24 Thread Wolfgang Denk
From: Wolfgang Denk <[EMAIL PROTECTED]>

Signed-off-by: Wolfgang Denk <[EMAIL PROTECTED]>
---
 cpu/arm920t/start.S |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/cpu/arm920t/start.S b/cpu/arm920t/start.S
index f99d129..5143cfc 100644
--- a/cpu/arm920t/start.S
+++ b/cpu/arm920t/start.S
@@ -258,7 +258,7 @@ cpu_init_crit:
 * find a lowlevel_init.S in your board directory.
 */
mov ip, lr
-#ifdefined(CONFIG_AT91RM9200DK) || defined(CONFIG_AT91RM9200EK) || 
defined(CONFIG_AT91RM9200DF)
+#ifdefined(CONFIG_AT91RM9200EK) || defined(CONFIG_AT91RM9200DF)
 
 #else
bl  lowlevel_init
-- 
1.5.4.rc1.23.g3a969

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


Re: [U-Boot] [PATCH] at91rm9200: fix broken boot from nor flash

2008-11-24 Thread Wolfgang Denk
Dear Jens Scharsig,

In message <[EMAIL PROTECTED]> you wrote:
> 
> > I  testedm  the  patch,  but  it  doesn't  fix  the  problem  on  the
> > AT91RM9200DK  board  (that's  the  one  I  could  easily  test at the
> > moment).
> 
> I think my patch only don't work on AT91RM9200DK, AT91RM9200EK or
> AT91RM9200DF board. Blame it on this solution is the #ifdef construct in
> /cpu/arm920t/start.s at line 264. There are no low_level_init run for
> DK, EK andDF board.

I agree. That code looks pretty bogus to me, too.

I can confirm that removing the "defined(CONFIG_AT91RM9200DK) ||" part
there makes the code work on the AT91RM9200DK board (j24: patch
following ASAP).

Any AT91RM9200EK and AT91RM9200DF users out there to test this?

> It's only effect on Atmel Boards. I can't test is it truth.
> So the question goes to DK users and arm custodian.

For DK, the situation looks clear now.

Thanks for the patch!

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: [EMAIL PROTECTED]
"Ja, mach' nur einen Plan,sei nur ein grosses Licht
und mach' dann noch 'nen zweiten Plan,geh'n tun sie beide nicht."
 -- Bert Brecht, Dreigroschenoper
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH-OMAP3] OMAP3: Convert readl/writel and replace hardcoded values

2008-11-24 Thread Dirk Behme
Dear Jean-Christophe,

> In message <[EMAIL PROTECTED]> you wrote:
> 
>>Convert readl/writel to base + offset style. Replace hardcoded values with
>>macros.

It would be quite nice if you could apply this patch to 
u-boot-arm/omap3 branch independent of read/write discussion. As this 
is the last clean up patch, after applying this patch we would have 
the omap3 branch at least in a consistent style for the moment.

Many thanks

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


[U-Boot] [PATCH] cmd_mem: Remove unused variable

2008-11-24 Thread Peter Tyser
Signed-off-by: Peter Tyser <[EMAIL PROTECTED]>
---
 common/cmd_mem.c |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/common/cmd_mem.c b/common/cmd_mem.c
index d7666c2..400cfd7 100644
--- a/common/cmd_mem.c
+++ b/common/cmd_mem.c
@@ -1175,7 +1175,6 @@ int do_unzip ( cmd_tbl_t *cmdtp, int flag, int argc, char 
*argv[])
 {
unsigned long src, dst;
unsigned long src_len = ~0UL, dst_len = ~0UL;
-   int err;
 
switch (argc) {
case 4:
-- 
1.6.0.2.GIT

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


Re: [U-Boot] [PATCH 1/3] Introduce addr_map library

2008-11-24 Thread Scott Wood
On Mon, Nov 24, 2008 at 10:47:38AM -0600, Kumar Gala wrote:
> +static struct {
> + phys_addr_t paddr;
> + unsigned int vaddr;
> + unsigned int size;

vaddr/size should be unsigned long (or uintptr_t/size_t).

> +phys_addr_t addrmap_virt_to_phys(unsigned int vaddr)
> +{
> + int i;
> +
> + for (i = 0; i < CONFIG_SYS_NUM_ADDR_MAP; i++) {
> + u64 base, upper, addr;
> +
> + if (address_map[i].size == 0)
> + continue;
> +
> + addr = (u64)vaddr;
> + base = (u64)(address_map[i].vaddr);
> + upper = (u64)(address_map[i].size) + base;
> +
> + if (addr >= base && addr < upper) {
> + return vaddr - address_map[i].vaddr + 
> address_map[i].paddr;
> + }

upper should be base + size - 1, and addr <= upper.  Otherwise, this will
fail for a mapping at the end of a 64-bit address space.

> +void addrmap_set_entry(unsigned int vaddr, phys_addr_t paddr,
> + unsigned int size, int idx)
> +{
> + if (idx > CONFIG_SYS_NUM_ADDR_MAP)
> + return ;

No space before ;

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


[U-Boot] [PATCH v2 1/3] Introduce addr_map library

2008-11-24 Thread Kumar Gala
Add a library that helps in translating between virtual and physical
addresses.  This library can be useful as a simple means to implement
map_physmem() and virt_to_phys() for platforms that need functionality
beyond the simple 1:1 mapping.

Signed-off-by: Kumar Gala <[EMAIL PROTECTED]>
---
* Use unsigned long
* changed virt_to_phys to take void *
* changed comparision

 include/addr_map.h |   29 +
 lib_generic/Makefile   |1 +
 lib_generic/addr_map.c |   81 
 3 files changed, 111 insertions(+), 0 deletions(-)
 create mode 100644 include/addr_map.h
 create mode 100644 lib_generic/addr_map.c

diff --git a/include/addr_map.h b/include/addr_map.h
new file mode 100644
index 000..234487a
--- /dev/null
+++ b/include/addr_map.h
@@ -0,0 +1,29 @@
+#ifndef __ADDR_MAP_H
+#define __ADDR_MAP_H
+
+/*
+ * Copyright 2008 Freescale Semiconductor, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * Version 2 as published by the Free Software Foundation.
+ *
+ * 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 
+
+extern phys_addr_t addrmap_virt_to_phys(void *vaddr);
+extern unsigned long addrmap_phys_to_virt(phys_addr_t paddr);
+extern void addrmap_set_entry(unsigned long vaddr, phys_addr_t paddr,
+   unsigned long size, int idx);
+
+#endif
diff --git a/lib_generic/Makefile b/lib_generic/Makefile
index d62c39b..3f04022 100644
--- a/lib_generic/Makefile
+++ b/lib_generic/Makefile
@@ -25,6 +25,7 @@ include $(TOPDIR)/config.mk
 
 LIB= $(obj)libgeneric.a
 
+COBJS-$(CONFIG_ADDR_MAP) += addr_map.o
 COBJS-y += bzlib.o
 COBJS-y += bzlib_crctable.o
 COBJS-y += bzlib_decompress.o
diff --git a/lib_generic/addr_map.c b/lib_generic/addr_map.c
new file mode 100644
index 000..18c0c5a
--- /dev/null
+++ b/lib_generic/addr_map.c
@@ -0,0 +1,81 @@
+/*
+ * Copyright 2008 Freescale Semiconductor, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * Version 2 as published by the Free Software Foundation.
+ *
+ * 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 
+#include 
+
+static struct {
+   phys_addr_t paddr;
+   unsigned long vaddr;
+   unsigned long size;
+} address_map[CONFIG_SYS_NUM_ADDR_MAP];
+
+phys_addr_t addrmap_virt_to_phys(void * vaddr)
+{
+   int i;
+
+   for (i = 0; i < CONFIG_SYS_NUM_ADDR_MAP; i++) {
+   u64 base, upper, addr;
+
+   if (address_map[i].size == 0)
+   continue;
+
+   addr = (u64)vaddr;
+   base = (u64)(address_map[i].vaddr);
+   upper = (u64)(address_map[i].size) + base - 1;
+
+   if (addr >= base && addr <= upper) {
+   return addr - address_map[i].vaddr + 
address_map[i].paddr;
+   }
+   }
+
+   return (phys_addr_t)(~0);
+}
+
+unsigned long addrmap_phys_to_virt(phys_addr_t paddr)
+{
+   int i;
+
+   for (i = 0; i < CONFIG_SYS_NUM_ADDR_MAP; i++) {
+   u64 base, upper, addr;
+
+   if (address_map[i].size == 0)
+   continue;
+
+   addr = (u64)paddr;
+   base = (u64)(address_map[i].paddr);
+   upper = (u64)(address_map[i].size) + base - 1;
+
+   if (addr >= base && addr <= upper) {
+   return paddr - address_map[i].paddr + 
address_map[i].paddr;
+   }
+   }
+
+   return (unsigned long)(~0);
+}
+
+void addrmap_set_entry(unsigned long vaddr, phys_addr_t paddr,
+   unsigned long size, int idx)
+{
+   if (idx > CONFIG_SYS_NUM_ADDR_MAP)
+   return;
+
+   address_map[idx].vaddr = vaddr;
+   address_map[idx].paddr = paddr;
+   address_map[idx].size  = size;
+}
-- 
1.5.6.5

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


[U-Boot] [PATCH v2 3/3] ppc: Use addrmap in virt_to_phys and map_physmem.

2008-11-24 Thread Kumar Gala
If we have addr map support enabled use the mapping functions to
implement virt_to_phys() and map_physmem().

Signed-off-by: Kumar Gala <[EMAIL PROTECTED]>
---
* fixed virt_to_phys to call right addrmap function
* updates based on addrmap api changes

 include/asm-ppc/io.h |   12 
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/include/asm-ppc/io.h b/include/asm-ppc/io.h
index c00de45..a8003ef 100644
--- a/include/asm-ppc/io.h
+++ b/include/asm-ppc/io.h
@@ -10,6 +10,10 @@
 #include 
 #include 
 
+#ifdef CONFIG_ADDR_MAP
+#include 
+#endif
+
 #define SIO_CONFIG_RA   0x398
 #define SIO_CONFIG_RD   0x399
 
@@ -287,7 +291,11 @@ extern inline void out_be32(volatile unsigned __iomem 
*addr, int val)
 static inline void *
 map_physmem(phys_addr_t paddr, unsigned long len, unsigned long flags)
 {
+#ifdef CONFIG_ADDR_MAP
+   return (void *)(addrmap_phys_to_virt(paddr));
+#else
return (void *)((unsigned long)paddr);
+#endif
 }
 
 /*
@@ -300,7 +308,11 @@ static inline void unmap_physmem(void *vaddr, unsigned 
long flags)
 
 static inline phys_addr_t virt_to_phys(void * vaddr)
 {
+#ifdef CONFIG_ADDR_MAP
+   return addrmap_virt_to_phys(vaddr);
+#else
return (phys_addr_t)(vaddr);
+#endif
 }
 
 #endif
-- 
1.5.6.5

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


[U-Boot] [PATCH v2 2/3] 85xx: Add support to populate addr map based on TLB settings

2008-11-24 Thread Kumar Gala
Signed-off-by: Kumar Gala <[EMAIL PROTECTED]>
---
 cpu/mpc85xx/tlb.c |   34 ++
 include/asm-ppc/mmu.h |3 +++
 lib_ppc/board.c   |8 
 3 files changed, 45 insertions(+), 0 deletions(-)

diff --git a/cpu/mpc85xx/tlb.c b/cpu/mpc85xx/tlb.c
index a2d16ae..f80d8b2 100644
--- a/cpu/mpc85xx/tlb.c
+++ b/cpu/mpc85xx/tlb.c
@@ -26,6 +26,11 @@
 #include 
 #include 
 #include 
+#ifdef CONFIG_ADDR_MAP
+#include 
+#endif
+
+DECLARE_GLOBAL_DATA_PTR;
 
 void set_tlb(u8 tlb, u32 epn, u64 rpn,
 u8 perms, u8 wimge,
@@ -47,6 +52,11 @@ void set_tlb(u8 tlb, u32 epn, u64 rpn,
mtspr(MAS7, _mas7);
 #endif
asm volatile("isync;msync;tlbwe;isync");
+
+#ifdef CONFIG_ADDR_MAP
+   if ((tlb == 1) && (gd->flags & GD_FLG_RELOC))
+   addrmap_set_entry(epn, rpn, (1 << ((tsize * 2) + 10)), esel);
+#endif
 }
 
 void disable_tlb(u8 esel)
@@ -67,6 +77,11 @@ void disable_tlb(u8 esel)
mtspr(MAS7, _mas7);
 #endif
asm volatile("isync;msync;tlbwe;isync");
+
+#ifdef CONFIG_ADDR_MAP
+   if (gd->flags & GD_FLG_RELOC)
+   addrmap_set_entry(0, 0, 0, esel);
+#endif
 }
 
 void invalidate_tlb(u8 tlb)
@@ -91,6 +106,25 @@ void init_tlbs(void)
return ;
 }
 
+#ifdef CONFIG_ADDR_MAP
+void init_addr_map(void)
+{
+   int i;
+
+   for (i = 0; i < num_tlb_entries; i++) {
+   if (tlb_table[i].tlb == 0)
+   continue;
+
+   addrmap_set_entry(tlb_table[i].epn,
+   tlb_table[i].rpn,
+   (1 << ((tlb_table[i].tsize * 2) + 10)),
+   tlb_table[i].esel);
+   }
+
+   return ;
+}
+#endif
+
 unsigned int setup_ddr_tlbs(unsigned int memsize_in_meg)
 {
unsigned int tlb_size;
diff --git a/include/asm-ppc/mmu.h b/include/asm-ppc/mmu.h
index 8975e6c..6d942d0 100644
--- a/include/asm-ppc/mmu.h
+++ b/include/asm-ppc/mmu.h
@@ -431,6 +431,9 @@ extern void set_tlb(u8 tlb, u32 epn, u64 rpn,
 extern void disable_tlb(u8 esel);
 extern void invalidate_tlb(u8 tlb);
 extern void init_tlbs(void);
+#ifdef CONFIG_ADDR_MAP
+extern void init_addr_map(void);
+#endif
 extern unsigned int setup_ddr_tlbs(unsigned int memsize_in_meg);
 
 #define SET_TLB_ENTRY(_tlb, _epn, _rpn, _perms, _wimge, _ts, _esel, _sz, 
_iprot) \
diff --git a/lib_ppc/board.c b/lib_ppc/board.c
index 289a32a..61c29b5 100644
--- a/lib_ppc/board.c
+++ b/lib_ppc/board.c
@@ -75,6 +75,10 @@
 #include 
 #endif
 
+#ifdef CONFIG_ADDR_MAP
+#include 
+#endif
+
 #ifdef CONFIG_SYS_UPDATE_FLASH_SIZE
 extern int update_flash_size (int flash_size);
 #endif
@@ -694,6 +698,10 @@ void board_init_r (gd_t *id, ulong dest_addr)
 */
trap_init (dest_addr);
 
+#if defined(CONFIG_ADDR_MAP) && defined(CONFIG_E500)
+   init_addr_map();
+#endif
+
 #if defined(CONFIG_BOARD_EARLY_INIT_R)
board_early_init_r ();
 #endif
-- 
1.5.6.5

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


[U-Boot] [PATCH 2/3] 85xx: Add support to populate addr map based on TLB settings

2008-11-24 Thread Kumar Gala
Signed-off-by: Kumar Gala <[EMAIL PROTECTED]>
---
 cpu/mpc85xx/tlb.c |   34 ++
 include/asm-ppc/mmu.h |3 +++
 lib_ppc/board.c   |8 
 3 files changed, 45 insertions(+), 0 deletions(-)

diff --git a/cpu/mpc85xx/tlb.c b/cpu/mpc85xx/tlb.c
index a2d16ae..f80d8b2 100644
--- a/cpu/mpc85xx/tlb.c
+++ b/cpu/mpc85xx/tlb.c
@@ -26,6 +26,11 @@
 #include 
 #include 
 #include 
+#ifdef CONFIG_ADDR_MAP
+#include 
+#endif
+
+DECLARE_GLOBAL_DATA_PTR;
 
 void set_tlb(u8 tlb, u32 epn, u64 rpn,
 u8 perms, u8 wimge,
@@ -47,6 +52,11 @@ void set_tlb(u8 tlb, u32 epn, u64 rpn,
mtspr(MAS7, _mas7);
 #endif
asm volatile("isync;msync;tlbwe;isync");
+
+#ifdef CONFIG_ADDR_MAP
+   if ((tlb == 1) && (gd->flags & GD_FLG_RELOC))
+   addrmap_set_entry(epn, rpn, (1 << ((tsize * 2) + 10)), esel);
+#endif
 }
 
 void disable_tlb(u8 esel)
@@ -67,6 +77,11 @@ void disable_tlb(u8 esel)
mtspr(MAS7, _mas7);
 #endif
asm volatile("isync;msync;tlbwe;isync");
+
+#ifdef CONFIG_ADDR_MAP
+   if (gd->flags & GD_FLG_RELOC)
+   addrmap_set_entry(0, 0, 0, esel);
+#endif
 }
 
 void invalidate_tlb(u8 tlb)
@@ -91,6 +106,25 @@ void init_tlbs(void)
return ;
 }
 
+#ifdef CONFIG_ADDR_MAP
+void init_addr_map(void)
+{
+   int i;
+
+   for (i = 0; i < num_tlb_entries; i++) {
+   if (tlb_table[i].tlb == 0)
+   continue;
+
+   addrmap_set_entry(tlb_table[i].epn,
+   tlb_table[i].rpn,
+   (1 << ((tlb_table[i].tsize * 2) + 10)),
+   tlb_table[i].esel);
+   }
+
+   return ;
+}
+#endif
+
 unsigned int setup_ddr_tlbs(unsigned int memsize_in_meg)
 {
unsigned int tlb_size;
diff --git a/include/asm-ppc/mmu.h b/include/asm-ppc/mmu.h
index 8975e6c..6d942d0 100644
--- a/include/asm-ppc/mmu.h
+++ b/include/asm-ppc/mmu.h
@@ -431,6 +431,9 @@ extern void set_tlb(u8 tlb, u32 epn, u64 rpn,
 extern void disable_tlb(u8 esel);
 extern void invalidate_tlb(u8 tlb);
 extern void init_tlbs(void);
+#ifdef CONFIG_ADDR_MAP
+extern void init_addr_map(void);
+#endif
 extern unsigned int setup_ddr_tlbs(unsigned int memsize_in_meg);
 
 #define SET_TLB_ENTRY(_tlb, _epn, _rpn, _perms, _wimge, _ts, _esel, _sz, 
_iprot) \
diff --git a/lib_ppc/board.c b/lib_ppc/board.c
index 289a32a..61c29b5 100644
--- a/lib_ppc/board.c
+++ b/lib_ppc/board.c
@@ -75,6 +75,10 @@
 #include 
 #endif
 
+#ifdef CONFIG_ADDR_MAP
+#include 
+#endif
+
 #ifdef CONFIG_SYS_UPDATE_FLASH_SIZE
 extern int update_flash_size (int flash_size);
 #endif
@@ -694,6 +698,10 @@ void board_init_r (gd_t *id, ulong dest_addr)
 */
trap_init (dest_addr);
 
+#if defined(CONFIG_ADDR_MAP) && defined(CONFIG_E500)
+   init_addr_map();
+#endif
+
 #if defined(CONFIG_BOARD_EARLY_INIT_R)
board_early_init_r ();
 #endif
-- 
1.5.6.5

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


Re: [U-Boot] [PATCH 3/3] ppc: Use addrmap in virt_to_phys and map_physmem.

2008-11-24 Thread Scott Wood
On Mon, Nov 24, 2008 at 10:47:40AM -0600, Kumar Gala wrote:
> @@ -287,7 +291,11 @@ extern inline void out_be32(volatile unsigned __iomem 
> *addr, int val)
>  static inline void *
>  map_physmem(phys_addr_t paddr, unsigned long len, unsigned long flags)
>  {
> +#ifdef CONFIG_ADDR_MAP
> + return (void *)(addrmap_phys_to_virt(paddr));
> +#else
>   return (void *)((unsigned long)paddr);
> +#endif
>  }
>  
>  /*
> @@ -300,7 +308,11 @@ static inline void unmap_physmem(void *vaddr, unsigned 
> long flags)
>  
>  static inline phys_addr_t virt_to_phys(void * vaddr)
>  {
> +#ifdef CONFIG_ADDR_MAP
> + return addrmap_phys_to_virt((unsigned int)vaddr);
> +#else
>   return (phys_addr_t)(vaddr);
> +#endif
>  }

Shouldn't phys_to_virt return, and virt_to_phys accept, a virtual address
without needing the caller to cast?

Also, don't treat virtual addresses as "unsigned int".  Use unsigned long
or uintptr_t.

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


[U-Boot] [PATCH 3/3] ppc: Use addrmap in virt_to_phys and map_physmem.

2008-11-24 Thread Kumar Gala
If we have addr map support enabled use the mapping functions to
implement virt_to_phys() and map_physmem().

Signed-off-by: Kumar Gala <[EMAIL PROTECTED]>
---
 include/asm-ppc/io.h |   12 
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/include/asm-ppc/io.h b/include/asm-ppc/io.h
index c00de45..57ff32c 100644
--- a/include/asm-ppc/io.h
+++ b/include/asm-ppc/io.h
@@ -10,6 +10,10 @@
 #include 
 #include 
 
+#ifdef CONFIG_ADDR_MAP
+#include 
+#endif
+
 #define SIO_CONFIG_RA   0x398
 #define SIO_CONFIG_RD   0x399
 
@@ -287,7 +291,11 @@ extern inline void out_be32(volatile unsigned __iomem 
*addr, int val)
 static inline void *
 map_physmem(phys_addr_t paddr, unsigned long len, unsigned long flags)
 {
+#ifdef CONFIG_ADDR_MAP
+   return (void *)(addrmap_phys_to_virt(paddr));
+#else
return (void *)((unsigned long)paddr);
+#endif
 }
 
 /*
@@ -300,7 +308,11 @@ static inline void unmap_physmem(void *vaddr, unsigned 
long flags)
 
 static inline phys_addr_t virt_to_phys(void * vaddr)
 {
+#ifdef CONFIG_ADDR_MAP
+   return addrmap_phys_to_virt((unsigned int)vaddr);
+#else
return (phys_addr_t)(vaddr);
+#endif
 }
 
 #endif
-- 
1.5.6.5

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


[U-Boot] [PATCH 1/3] Introduce addr_map library

2008-11-24 Thread Kumar Gala
Add a library that helps in translating between virtual and physical
addresses.  This library can be useful as a simple means to implement
map_physmem() and virt_to_phys() for platforms that need functionality
beyond the simple 1:1 mapping.

Signed-off-by: Kumar Gala <[EMAIL PROTECTED]>
---
 include/addr_map.h |   29 +
 lib_generic/Makefile   |1 +
 lib_generic/addr_map.c |   81 
 3 files changed, 111 insertions(+), 0 deletions(-)
 create mode 100644 include/addr_map.h
 create mode 100644 lib_generic/addr_map.c

diff --git a/include/addr_map.h b/include/addr_map.h
new file mode 100644
index 000..c87c3a8
--- /dev/null
+++ b/include/addr_map.h
@@ -0,0 +1,29 @@
+#ifndef __ADDR_MAP_H
+#define __ADDR_MAP_H
+
+/*
+ * Copyright 2008 Freescale Semiconductor, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * Version 2 as published by the Free Software Foundation.
+ *
+ * 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 
+
+extern phys_addr_t addrmap_virt_to_phys(unsigned int vaddr);
+extern unsigned int addrmap_phys_to_virt(phys_addr_t paddr);
+extern void addrmap_set_entry(unsigned int vaddr, phys_addr_t paddr,
+   unsigned int size, int idx);
+
+#endif
diff --git a/lib_generic/Makefile b/lib_generic/Makefile
index d62c39b..3f04022 100644
--- a/lib_generic/Makefile
+++ b/lib_generic/Makefile
@@ -25,6 +25,7 @@ include $(TOPDIR)/config.mk
 
 LIB= $(obj)libgeneric.a
 
+COBJS-$(CONFIG_ADDR_MAP) += addr_map.o
 COBJS-y += bzlib.o
 COBJS-y += bzlib_crctable.o
 COBJS-y += bzlib_decompress.o
diff --git a/lib_generic/addr_map.c b/lib_generic/addr_map.c
new file mode 100644
index 000..9f6596a
--- /dev/null
+++ b/lib_generic/addr_map.c
@@ -0,0 +1,81 @@
+/*
+ * Copyright 2008 Freescale Semiconductor, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * Version 2 as published by the Free Software Foundation.
+ *
+ * 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 
+#include 
+
+static struct {
+   phys_addr_t paddr;
+   unsigned int vaddr;
+   unsigned int size;
+} address_map[CONFIG_SYS_NUM_ADDR_MAP];
+
+phys_addr_t addrmap_virt_to_phys(unsigned int vaddr)
+{
+   int i;
+
+   for (i = 0; i < CONFIG_SYS_NUM_ADDR_MAP; i++) {
+   u64 base, upper, addr;
+
+   if (address_map[i].size == 0)
+   continue;
+
+   addr = (u64)vaddr;
+   base = (u64)(address_map[i].vaddr);
+   upper = (u64)(address_map[i].size) + base;
+
+   if (addr >= base && addr < upper) {
+   return vaddr - address_map[i].vaddr + 
address_map[i].paddr;
+   }
+   }
+
+   return (phys_addr_t)(~0);
+}
+
+unsigned int addrmap_phys_to_virt(phys_addr_t paddr)
+{
+   int i;
+
+   for (i = 0; i < CONFIG_SYS_NUM_ADDR_MAP; i++) {
+   u64 base, upper, addr;
+
+   if (address_map[i].size == 0)
+   continue;
+
+   addr = (u64)paddr;
+   base = (u64)(address_map[i].paddr);
+   upper = (u64)(address_map[i].size) + base;
+
+   if (addr >= base && addr < upper) {
+   return paddr - address_map[i].paddr + 
address_map[i].paddr;
+   }
+   }
+
+   return (unsigned int)(~0);
+}
+
+void addrmap_set_entry(unsigned int vaddr, phys_addr_t paddr,
+   unsigned int size, int idx)
+{
+   if (idx > CONFIG_SYS_NUM_ADDR_MAP)
+   return ;
+
+   address_map[idx].vaddr = vaddr;
+   address_map[idx].paddr = paddr;
+   address_map[idx].size  = size;
+}
-- 
1.5.6.5

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


Re: [U-Boot] [PATCH 3/3] NAND FSL elbc: Use virt_to_phys to determine which bank is in use

2008-11-24 Thread Kumar Gala

On Nov 24, 2008, at 10:34 AM, Scott Wood wrote:

> Kumar Gala wrote:
>> diff --git a/drivers/mtd/nand/fsl_elbc_nand.c b/drivers/mtd/nand/ 
>> fsl_elbc_nand.c
>> index 367c7d7..3f318e0 100644
>> --- a/drivers/mtd/nand/fsl_elbc_nand.c
>> +++ b/drivers/mtd/nand/fsl_elbc_nand.c
>> @@ -718,7 +718,7 @@ static void fsl_elbc_ctrl_init(void)
>> int board_nand_init(struct nand_chip *nand)
>> {
>>  struct fsl_elbc_mtd *priv;
>> -uint32_t br, or;
>> +uint32_t br = 0, or = 0;
>
> Which GCC version complains about this?  Seems like it's getting  
> worse about false positives.

Yeah, I was annoyed by this.  gcc-4.3

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


Re: [U-Boot] [PATCH 3/3] NAND FSL elbc: Use virt_to_phys to determine which bank is in use

2008-11-24 Thread Scott Wood
Kumar Gala wrote:
> diff --git a/drivers/mtd/nand/fsl_elbc_nand.c 
> b/drivers/mtd/nand/fsl_elbc_nand.c
> index 367c7d7..3f318e0 100644
> --- a/drivers/mtd/nand/fsl_elbc_nand.c
> +++ b/drivers/mtd/nand/fsl_elbc_nand.c
> @@ -718,7 +718,7 @@ static void fsl_elbc_ctrl_init(void)
>  int board_nand_init(struct nand_chip *nand)
>  {
>   struct fsl_elbc_mtd *priv;
> - uint32_t br, or;
> + uint32_t br = 0, or = 0;

Which GCC version complains about this?  Seems like it's getting worse 
about false positives.

> @@ -737,11 +737,13 @@ int board_nand_init(struct nand_chip *nand)
>* if we could pass more than one datum to the NAND driver...
>*/
>   for (priv->bank = 0; priv->bank < MAX_BANKS; priv->bank++) {
> + phys_addr_t base_addr = virt_to_phys(nand->IO_ADDR_R);
> +
>   br = in_be32(&elbc_ctrl->regs->bank[priv->bank].br);
>   or = in_be32(&elbc_ctrl->regs->bank[priv->bank].or);
>  
>   if ((br & BR_V) && (br & BR_MSEL) == BR_MS_FCM &&
> - (br & or & BR_BA) == (phys_addr_t)nand->IO_ADDR_R)
> + (br & or & BR_BA) == BR_PHYS_ADDR(base_addr))

ACK to go via whichever tree the BR_PHYS_ADDR patch goes through.

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


[U-Boot] [PATCH 2/2] 85xx: init gd as early as possible

2008-11-24 Thread Kumar Gala
Moved up the initialization of GD so C code like set_tlb() can use
gd->flags to determine if we've relocated or not in the future.

Signed-off-by: Kumar Gala <[EMAIL PROTECTED]>
---
 cpu/mpc85xx/cpu_init.c |   12 ++--
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/cpu/mpc85xx/cpu_init.c b/cpu/mpc85xx/cpu_init.c
index 1cb9ed9..ce3d855 100644
--- a/cpu/mpc85xx/cpu_init.c
+++ b/cpu/mpc85xx/cpu_init.c
@@ -132,6 +132,12 @@ void config_8560_ioports (volatile ccsr_cpm_t * cpm)
 /* We run cpu_init_early_f in AS = 1 */
 void cpu_init_early_f(void)
 {
+   /* Pointer is writable since we allocated a register for it */
+   gd = (gd_t *) (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_GBL_DATA_OFFSET);
+
+   /* Clear initial global data */
+   memset ((void *) gd, 0, sizeof (gd_t));
+
set_tlb(0, CONFIG_SYS_CCSRBAR, CONFIG_SYS_CCSRBAR_PHYS,
MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
1, 0, BOOKE_PAGESZ_4K, 0);
@@ -153,12 +159,6 @@ void cpu_init_early_f(void)
}
 #endif
 
-   /* Pointer is writable since we allocated a register for it */
-   gd = (gd_t *) (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_GBL_DATA_OFFSET);
-
-   /* Clear initial global data */
-   memset ((void *) gd, 0, sizeof (gd_t));
-
init_laws();
invalidate_tlb(0);
init_tlbs();
-- 
1.5.6.5

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


[U-Boot] [PATCH 1/2] 85xx: Fix relocation of CCSRBAR

2008-11-24 Thread Kumar Gala
If the virtual address for CCSRBAR is the same after relocation but
the physical address is changing we'd end up having two TLB entries with
the same VA.  Instead we new us the new CCSRBAR virt address + 4k as a
temp virt address to access the old CCSRBAR to relocate it.

Signed-off-by: Kumar Gala <[EMAIL PROTECTED]>
---
 cpu/mpc85xx/cpu_init.c |9 +
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/cpu/mpc85xx/cpu_init.c b/cpu/mpc85xx/cpu_init.c
index 3a8aef2..1cb9ed9 100644
--- a/cpu/mpc85xx/cpu_init.c
+++ b/cpu/mpc85xx/cpu_init.c
@@ -140,14 +140,15 @@ void cpu_init_early_f(void)
 #if (CONFIG_SYS_CCSRBAR_DEFAULT != CONFIG_SYS_CCSRBAR_PHYS)
{
u32 temp;
+   volatile u32 *ccsr_virt =
+   (volatile u32 *)(CONFIG_SYS_CCSRBAR + 0x1000);
 
-   set_tlb(0, CONFIG_SYS_CCSRBAR_DEFAULT, 
CONFIG_SYS_CCSRBAR_DEFAULT,
+   set_tlb(0, (u32)ccsr_virt, CONFIG_SYS_CCSRBAR_DEFAULT,
MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
1, 1, BOOKE_PAGESZ_4K, 0);
 
-   temp = in_be32((volatile u32 *)CONFIG_SYS_CCSRBAR_DEFAULT);
-   out_be32((volatile u32 *)CONFIG_SYS_CCSRBAR_DEFAULT, 
CONFIG_SYS_CCSRBAR_PHYS >> 12);
-
+   temp = in_be32(ccsr_virt);
+   out_be32(ccsr_virt, CONFIG_SYS_CCSRBAR_PHYS >> 12);
temp = in_be32((volatile u32 *)CONFIG_SYS_CCSRBAR);
}
 #endif
-- 
1.5.6.5

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


[U-Boot] [PATCH 3/3] NAND FSL elbc: Use virt_to_phys to determine which bank is in use

2008-11-24 Thread Kumar Gala
The current code that determines which bank/chipselect is used for a
given NAND instance only worked for 32-bit addresses and assumed
a 1:1 mapping.  This breaks in 36-bit physical configs.

The proper way to handle this is to use the virt_to_phys() and
BR_PHYS_ADDR() routinues to match the 34-bit lbc bus address
with the the virtual address the NAND code uses.

Signed-off-by: Kumar Gala <[EMAIL PROTECTED]>
---
 drivers/mtd/nand/fsl_elbc_nand.c |6 --
 1 files changed, 4 insertions(+), 2 deletions(-)

This patch puts the plumbing in place to work properly for 36-bit phys
support in the future.  This requires a proper version of virt_to_phys().

- k

diff --git a/drivers/mtd/nand/fsl_elbc_nand.c b/drivers/mtd/nand/fsl_elbc_nand.c
index 367c7d7..3f318e0 100644
--- a/drivers/mtd/nand/fsl_elbc_nand.c
+++ b/drivers/mtd/nand/fsl_elbc_nand.c
@@ -718,7 +718,7 @@ static void fsl_elbc_ctrl_init(void)
 int board_nand_init(struct nand_chip *nand)
 {
struct fsl_elbc_mtd *priv;
-   uint32_t br, or;
+   uint32_t br = 0, or = 0;
 
if (!elbc_ctrl) {
fsl_elbc_ctrl_init();
@@ -737,11 +737,13 @@ int board_nand_init(struct nand_chip *nand)
 * if we could pass more than one datum to the NAND driver...
 */
for (priv->bank = 0; priv->bank < MAX_BANKS; priv->bank++) {
+   phys_addr_t base_addr = virt_to_phys(nand->IO_ADDR_R);
+
br = in_be32(&elbc_ctrl->regs->bank[priv->bank].br);
or = in_be32(&elbc_ctrl->regs->bank[priv->bank].or);
 
if ((br & BR_V) && (br & BR_MSEL) == BR_MS_FCM &&
-   (br & or & BR_BA) == (phys_addr_t)nand->IO_ADDR_R)
+   (br & or & BR_BA) == BR_PHYS_ADDR(base_addr))
break;
}
 
-- 
1.5.6.5

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


[U-Boot] [PATCH 2/3] FSL: Moved BR_PHYS_ADDR for localbus to common header

2008-11-24 Thread Kumar Gala
The BR_PHYS_ADDR macro is useful on all machines that have local bus
which is pretty much all 83xx/85xx/86xx chips.

Additionally most 85xx & 86xx will need it if they want to support
36-bit physical addresses.

Signed-off-by: Kumar Gala <[EMAIL PROTECTED]>
---
 include/asm-ppc/fsl_lbc.h |8 
 include/configs/MPC8641HPCN.h |9 -
 2 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/include/asm-ppc/fsl_lbc.h b/include/asm-ppc/fsl_lbc.h
index cac7bf6..51fc5c1 100644
--- a/include/asm-ppc/fsl_lbc.h
+++ b/include/asm-ppc/fsl_lbc.h
@@ -69,6 +69,14 @@
 #define BR_RES ~(BR_BA | BR_PS | BR_DECC | BR_WP | 
BR_MSEL | BR_ATOM | BR_V)
 #endif
 
+/* Convert an address into the right format for the BR registers */
+#ifdef CONFIG_PHYS_64BIT
+#define BR_PHYS_ADDR(x)((unsigned long)((x & 0x08000ULL) | \
+((x & 0x3ULL) >> 19)))
+#else
+#define BR_PHYS_ADDR(x) (x & 0x8000)
+#endif
+
 /* OR - Option Registers
  */
 #define OR00x5004  /* Register offset to 
immr */
diff --git a/include/configs/MPC8641HPCN.h b/include/configs/MPC8641HPCN.h
index 69b4c44..08a88b0 100644
--- a/include/configs/MPC8641HPCN.h
+++ b/include/configs/MPC8641HPCN.h
@@ -186,17 +186,8 @@ extern unsigned long get_board_sys_clk(unsigned long 
dummy);
 #define CONFIG_SYS_FLASH_BASE_PHYS (CONFIG_SYS_FLASH_BASE \
 | CONFIG_SYS_PHYS_ADDR_HIGH)
 
-
 #define CONFIG_SYS_FLASH_BANKS_LIST {CONFIG_SYS_FLASH_BASE}
 
-/* Convert an address into the right format for the BR registers */
-#ifdef CONFIG_PHYS_64BIT
-#define BR_PHYS_ADDR(x)((unsigned long)((x & 0x08000ULL) | \
-((x & 0x3ULL) >> 19)))
-#else
-#define BR_PHYS_ADDR(x) (x & 0x8000)
-#endif
-
 #define CONFIG_SYS_BR0_PRELIM  (BR_PHYS_ADDR(CONFIG_SYS_FLASH_BASE_PHYS) \
 | 0x1001)  /* port size 16bit */
 #define CONFIG_SYS_OR0_PRELIM  0xff806ff7  /* 8MB Boot Flash area*/
-- 
1.5.6.5

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


[U-Boot] [PATCH 1/3] Introduce virt_to_phys()

2008-11-24 Thread Kumar Gala
virt_to_phys() returns the physical address given a virtual.  In most cases
this will just the input value as the vast majority of systems run in a 1:1
mode.

However in systems that are not running this way it should report the
physical address or ~0 if no mapping exists for the given virtual address.

Signed-off-by: Kumar Gala <[EMAIL PROTECTED]>
---
 include/asm-arm/io.h|5 +
 include/asm-avr32/io.h  |5 +
 include/asm-blackfin/io.h   |5 +
 include/asm-i386/io.h   |5 +
 include/asm-m68k/io.h   |5 +
 include/asm-microblaze/io.h |5 +
 include/asm-mips/io.h   |2 +-
 include/asm-nios/io.h   |5 +
 include/asm-nios2/io.h  |5 +
 include/asm-ppc/io.h|5 +
 include/asm-sh/io.h |5 +
 include/asm-sparc/io.h  |5 +
 12 files changed, 56 insertions(+), 1 deletions(-)

diff --git a/include/asm-arm/io.h b/include/asm-arm/io.h
index f4ae307..fec3a7e 100644
--- a/include/asm-arm/io.h
+++ b/include/asm-arm/io.h
@@ -57,6 +57,11 @@ static inline void unmap_physmem(void *vaddr, unsigned long 
flags)
 
 }
 
+static inline phys_addr_t virt_to_phys(void * vaddr)
+{
+   return (phys_addr_t)(vaddr);
+}
+
 /*
  * Generic virtual read/write.  Note that we don't support half-word
  * read/writes.  We define __arch_*[bl] here, and leave __arch_*w
diff --git a/include/asm-avr32/io.h b/include/asm-avr32/io.h
index 06e52b1..d22cd35 100644
--- a/include/asm-avr32/io.h
+++ b/include/asm-avr32/io.h
@@ -125,4 +125,9 @@ static inline void unmap_physmem(void *vaddr, unsigned long 
len)
 
 }
 
+static inline phys_addr_t virt_to_phys(void * vaddr)
+{
+   return (phys_addr_t)(vaddr);
+}
+
 #endif /* __ASM_AVR32_IO_H */
diff --git a/include/asm-blackfin/io.h b/include/asm-blackfin/io.h
index da58914..6806494 100644
--- a/include/asm-blackfin/io.h
+++ b/include/asm-blackfin/io.h
@@ -64,6 +64,11 @@ static inline void unmap_physmem(void *vaddr, unsigned long 
flags)
 
 }
 
+static inline phys_addr_t virt_to_phys(void * vaddr)
+{
+   return (phys_addr_t)(vaddr);
+}
+
 /*
  * These are for ISA/PCI shared memory _only_ and should never be used
  * on any other type of memory, including Zorro memory. They are meant to
diff --git a/include/asm-i386/io.h b/include/asm-i386/io.h
index 2c57140..9b757d4 100644
--- a/include/asm-i386/io.h
+++ b/include/asm-i386/io.h
@@ -229,4 +229,9 @@ static inline void unmap_physmem(void *vaddr, unsigned long 
flags)
 
 }
 
+static inline phys_addr_t virt_to_phys(void * vaddr)
+{
+   return (phys_addr_t)(vaddr);
+}
+
 #endif
diff --git a/include/asm-m68k/io.h b/include/asm-m68k/io.h
index 1fccc12..50ea087 100644
--- a/include/asm-m68k/io.h
+++ b/include/asm-m68k/io.h
@@ -251,4 +251,9 @@ static inline void unmap_physmem(void *vaddr, unsigned long 
flags)
 
 }
 
+static inline phys_addr_t virt_to_phys(void * vaddr)
+{
+   return (phys_addr_t)(vaddr);
+}
+
 #endif /* __ASM_M68K_IO_H__ */
diff --git a/include/asm-microblaze/io.h b/include/asm-microblaze/io.h
index 8804724..7e190d1 100644
--- a/include/asm-microblaze/io.h
+++ b/include/asm-microblaze/io.h
@@ -155,4 +155,9 @@ static inline void unmap_physmem(void *vaddr, unsigned long 
flags)
 
 }
 
+static inline phys_addr_t virt_to_phys(void * vaddr)
+{
+   return (phys_addr_t)(vaddr);
+}
+
 #endif /* __MICROBLAZE_IO_H__ */
diff --git a/include/asm-mips/io.h b/include/asm-mips/io.h
index 3a0f33f..031186d 100644
--- a/include/asm-mips/io.h
+++ b/include/asm-mips/io.h
@@ -118,7 +118,7 @@ static inline void set_io_port_base(unsigned long base)
  * Change virtual addresses to physical addresses and vv.
  * These are trivial on the 1:1 Linux/MIPS mapping
  */
-extern inline unsigned long virt_to_phys(volatile void * address)
+extern inline phys_addr_t virt_to_phys(void * address)
 {
return CPHYSADDR(address);
 }
diff --git a/include/asm-nios/io.h b/include/asm-nios/io.h
index 8b78806..899682c 100644
--- a/include/asm-nios/io.h
+++ b/include/asm-nios/io.h
@@ -133,4 +133,9 @@ static inline void unmap_physmem(void *vaddr, unsigned long 
flags)
 
 }
 
+static inline phys_addr_t virt_to_phys(void * vaddr)
+{
+   return (phys_addr_t)(vaddr);
+}
+
 #endif /* __ASM_NIOS_IO_H_ */
diff --git a/include/asm-nios2/io.h b/include/asm-nios2/io.h
index 2f1ec26..01d11ef 100644
--- a/include/asm-nios2/io.h
+++ b/include/asm-nios2/io.h
@@ -53,6 +53,11 @@ static inline void unmap_physmem(void *vaddr, unsigned long 
flags)
 
 }
 
+static inline phys_addr_t virt_to_phys(void * vaddr)
+{
+   return (phys_addr_t)(vaddr);
+}
+
 extern unsigned char inb (unsigned char *port);
 extern unsigned short inw (unsigned short *port);
 extern unsigned inl (unsigned port);
diff --git a/include/asm-ppc/io.h b/include/asm-ppc/io.h
index c349681..c00de45 100644
--- a/include/asm-ppc/io.h
+++ b/include/asm-ppc/io.h
@@ -298,4 +298,9 @@ static inline void unmap_physmem(void *vaddr, unsigned long 
flags)
 
 }
 
+static inli

Re: [U-Boot] Can I have a backup boot option ?

2008-11-24 Thread Mark Jackson
Wolfgang Denk wrote:
> Dear Mark,
> 
> In message <[EMAIL PROTECTED]> you wrote:
>> If an end-user inserts an MMC card containing some "magic marker" ...
> ...
>> I've done a quick check of the README and the source code, but ...
> 
> Note: please restrict your line lenght to some 70 or so characters.

Hmmm ... I'm sure I'd already done that ... Thunderbird must have reset 
itself ??

> There are several  auto-update  /  recovery  solutions  available  in
> current  source  code.  Just look around - search for file names that
> contain auto_update or fwupdate, and/or read doc/README.update

Ah, excellent.  Thanks for the pointers.

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


[U-Boot] [PATCH 2/3] ppc4xx: Use correct io accessors for PCI405

2008-11-24 Thread matthias . fuchs
From: Matthias Fuchs <[EMAIL PROTECTED]>

Signed-off-by: Matthias Fuchs <[EMAIL PROTECTED]>
---
 board/esd/pci405/pci405.c |   51 ++--
 1 files changed, 16 insertions(+), 35 deletions(-)

diff --git a/board/esd/pci405/pci405.c b/board/esd/pci405/pci405.c
index 9112788..42774ad 100644
--- a/board/esd/pci405/pci405.c
+++ b/board/esd/pci405/pci405.c
@@ -27,6 +27,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "pci405.h"
 
@@ -34,7 +35,7 @@ DECLARE_GLOBAL_DATA_PTR;
 
 /* Prototypes */
 int gunzip(void *, int, unsigned char *, unsigned long *);
-int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char 
*argv[]);/*cmd_boot.c*/
+int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
 unsigned long fpga_done_state(void);
 unsigned long fpga_init_state(void);
 
@@ -57,11 +58,11 @@ const unsigned char fpgadata[] =
  */
 #include "../common/fpga.c"
 
-#define FPGA_DONE_STATE_V11 (in32(GPIO0_IR) & CONFIG_SYS_FPGA_DONE)
-#define FPGA_DONE_STATE_V12 (in32(GPIO0_IR) & CONFIG_SYS_FPGA_DONE_V12)
+#define FPGA_DONE_STATE_V11 (in_be32((void*)GPIO0_IR) & CONFIG_SYS_FPGA_DONE)
+#define FPGA_DONE_STATE_V12 (in_be32((void*)GPIO0_IR) & 
CONFIG_SYS_FPGA_DONE_V12)
 
-#define FPGA_INIT_STATE_V11 (in32(GPIO0_IR) & CONFIG_SYS_FPGA_INIT)
-#define FPGA_INIT_STATE_V12 (in32(GPIO0_IR) & CONFIG_SYS_FPGA_INIT_V12)
+#define FPGA_INIT_STATE_V11 (in_be32((void*)GPIO0_IR) & CONFIG_SYS_FPGA_INIT)
+#define FPGA_INIT_STATE_V12 (in_be32((void*)GPIO0_IR) & 
CONFIG_SYS_FPGA_INIT_V12)
 
 
 int board_revision(void)
@@ -78,10 +79,10 @@ int board_revision(void)
 */
cntrl0Reg = mfdcr(cntrl0);
mtdcr(cntrl0, cntrl0Reg | 0x0300);
-   out32(GPIO0_ODR, in32(GPIO0_ODR) & ~0x00100200);
-   out32(GPIO0_TCR, in32(GPIO0_TCR) & ~0x00100200);
+   out_be32((void*)GPIO0_ODR, in_be32((void*)GPIO0_ODR) & ~0x00100200);
+   out_be32((void*)GPIO0_TCR, in_be32((void*)GPIO0_TCR) & ~0x00100200);
udelay(1000);   /* wait some time before reading input 
*/
-   value = in32(GPIO0_IR) & 0x00100200;   /* get config bits */
+   value = in_be32((void*)GPIO0_IR) & 0x00100200;   /* get config bits 
*/
 
/*
 * Restore GPIO settings
@@ -137,10 +138,10 @@ int board_early_init_f (void)
/*
 * First pull fpga-prg pin low, to disable fpga logic (on version 1.2 
board)
 */
-   out32(GPIO0_ODR, 0x);/* no open drain pins  */
-   out32(GPIO0_TCR, CONFIG_SYS_FPGA_PRG);  /* setup for output
*/
-   out32(GPIO0_OR,  CONFIG_SYS_FPGA_PRG);  /* set output pins to high 
*/
-   out32(GPIO0_OR, 0);  /* pull prg low*/
+   out_be32((void*)GPIO0_ODR, 0x);/* no open drain pins
  */
+   out_be32((void*)GPIO0_TCR, CONFIG_SYS_FPGA_PRG);  /* setup for 
output*/
+   out_be32((void*)GPIO0_OR,  CONFIG_SYS_FPGA_PRG);  /* set output 
pins to high */
+   out_be32((void*)GPIO0_OR, 0);  /* pull prg low  
  */
 
/*
 * IRQ 0-15  405GP internally generated; active high; level sensitive
@@ -181,15 +182,6 @@ int board_early_init_f (void)
return 0;
 }
 
-
-/* - */
-
-int misc_init_f (void)
-{
-   return 0;  /* dummy implementation */
-}
-
-
 int misc_init_r (void)
 {
unsigned char *dst;
@@ -284,13 +276,11 @@ int misc_init_r (void)
*magic = 0;  /* clear pci reconfig magic again */
}
 
-#if 1 /* test-only */
/*
 * Decrease PLB latency timeout and reduce priority of the PCI bridge 
master
 */
 #define PCI0_BRDGOPT1 0x4a
pci_write_config_word(PCIDEVID_405GP, PCI0_BRDGOPT1, 0x3f20);
-/* pci_write_config_word(PCIDEVID_405GP, PCI0_BRDGOPT1, 0x3f60);   */
 
 #define plb0_acr  0x87
/*
@@ -298,14 +288,6 @@ int misc_init_r (void)
 */
mtdcr(plb0_acr, 0x9800);
 
-#if 0 /* test-only */
-   printf("CCR0=%08x\n", mfspr(ccr0)); /* test-only */
-/* mtspr(ccr0, (mfspr(ccr0) & 0xff8f) | 0x0010);   */
-   mtspr(ccr0, (mfspr(ccr0) & 0xff8f) | 0x);
-#endif
-/* printf("CCR0=%08x\n", mfspr(ccr0)); */ /* test-only */
-#endif
-
free(dst);
return (0);
 }
@@ -314,7 +296,6 @@ int misc_init_r (void)
 /*
  * Check Board Identity:
  */
-
 int checkboard (void)
 {
char str[64];
@@ -340,10 +321,10 @@ int checkboard (void)
 */
cntrl0Reg = mfdcr(cntrl0);
mtdcr(cntrl0, cntrl0Reg & ~0x0800);
-   out32(GPIO0_ODR, in32(GPIO0_ODR) & ~0x4000);
-   out32(GPIO0_TCR, in32(GPIO0_TCR) & ~0x4000);
+   out_be32((void*)GPIO0_ODR, in_be32((void*)GPIO0_ODR) & 
~0x4000);
+   out_be32((void*)GPIO0_TCR, in_be32((void*)GPIO0_TCR) & 
~0x4000);
udelay(1000);  

[U-Boot] [PATCH 3/3] ppc4xx: Remove unused features

2008-11-24 Thread matthias . fuchs
From: Matthias Fuchs <[EMAIL PROTECTED]>

This patch disables some unused features from the PCI405 configuration
to keep U-Boot image size below 192k.

Signed-off-by: Matthias Fuchs <[EMAIL PROTECTED]>
---
 include/configs/PCI405.h |   57 +
 1 files changed, 7 insertions(+), 50 deletions(-)

diff --git a/include/configs/PCI405.h b/include/configs/PCI405.h
index 0393366..d0a37d7 100644
--- a/include/configs/PCI405.h
+++ b/include/configs/PCI405.h
@@ -60,39 +60,24 @@
 
 #define CONFIG_PREBOOT  /* enable preboot variable  */
 
-#define CONFIG_LOADS_ECHO  1   /* echo on for serial download  */
-#define CONFIG_SYS_LOADS_BAUD_CHANGE   1   /* allow baudrate change
*/
-
-#define CONFIG_PPC4xx_EMAC
-#define CONFIG_MII 1   /* MII PHY management   */
-#define CONFIG_PHY_ADDR0   /* PHY address  
*/
-
-#define CONFIG_RTC_M48T35A 1   /* ST Electronics M48 
timekeeper */
-
-
-/*
- * BOOTP options
- */
-#define CONFIG_BOOTP_BOOTFILESIZE
-#define CONFIG_BOOTP_BOOTPATH
-#define CONFIG_BOOTP_GATEWAY
-#define CONFIG_BOOTP_HOSTNAME
-
-
 /*
  * Command line configuration.
  */
 #include 
 
+#undef CONFIG_CMD_IMLS
+#undef CONFIG_CMD_ITEST
+#undef CONFIG_CMD_LOADB
+#undef CONFIG_CMD_LOADS
+#undef CONFIG_CMD_NET
+#undef CONFIG_CMD_NFS
+
 #define CONFIG_CMD_PCI
-#define CONFIG_CMD_IRQ
 #define CONFIG_CMD_ELF
-#define CONFIG_CMD_DATE
 #define CONFIG_CMD_I2C
 #define CONFIG_CMD_BSP
 #define CONFIG_CMD_EEPROM
 
-
 #undef CONFIG_WATCHDOG /* watchdog disabled*/
 
 #define CONFIG_SDRAM_BANK0 1   /* init onboard SDRAM bank 0*/
@@ -102,7 +87,6 @@
 /*
  * Miscellaneous configurable options
  */
-#define CONFIG_SYS_LONGHELP/* undef to save memory 
*/
 #define CONFIG_SYS_PROMPT  "=> "   /* Monitor Command Prompt   
*/
 
 #define CONFIG_SYS_HUSH_PARSER /* use "hush" command parser
*/
@@ -166,15 +150,9 @@
 #define CONFIG_SYS_PCI_PTM1MS  0xff01  /* 16MB, enable hard-wired to 1 
*/
 #define CONFIG_SYS_PCI_PTM1PCI 0x  /* Host: use this pci address   
*/
 
-#if 0 /* test-only */
-#define CONFIG_SYS_PCI_PTM2LA  0xffc0  /* point to flash   
*/
-#define CONFIG_SYS_PCI_PTM2MS  0xffc1  /* 4MB, enable  
*/
-#define CONFIG_SYS_PCI_PTM2PCI 0x0400  /* Host: use this pci address   
*/
-#else
 #define CONFIG_SYS_PCI_PTM2LA  0xef60  /* point to internal regs   
*/
 #define CONFIG_SYS_PCI_PTM2MS  0xffe1  /* 2MB, enable  
*/
 #define CONFIG_SYS_PCI_PTM2PCI 0x  /* Host: use this pci address   
*/
-#endif
 
 /*---
  * Start addresses for the final memory configuration
@@ -215,22 +193,10 @@
 
 #define CONFIG_SYS_FLASH_EMPTY_INFO/* print 'E' for empty sector 
on flinfo */
 
-#if 0 /* Use NVRAM for environment variables */
-/*---
- * NVRAM organization
- */
-#define CONFIG_ENV_IS_IN_NVRAM 1   /* use NVRAM for environment vars   
*/
-#define CONFIG_ENV_SIZE0x0ff8  /* Size of Environment 
vars */
-#define CONFIG_ENV_ADDR\
-   (CONFIG_SYS_NVRAM_BASE_ADDR+CONFIG_SYS_NVRAM_SIZE-(CONFIG_ENV_SIZE+8))  
/* Env  */
-
-#else /* Use EEPROM for environment variables */
-
 #define CONFIG_ENV_IS_IN_EEPROM1   /* use EEPROM for environment 
vars */
 #define CONFIG_ENV_OFFSET  0x000   /* environment starts at the 
beginning of the EEPROM */
 #define CONFIG_ENV_SIZE0x400   /* 1024 bytes may be used for 
env vars*/
   /* total size of a CAT24WC08 is 1024 bytes */
-#endif
 
 #define CONFIG_SYS_NVRAM_BASE_ADDR 0xf020  /* NVRAM base 
address   */
 #define CONFIG_SYS_NVRAM_SIZE  (32*1024)   /* NVRAM size   
*/
@@ -327,14 +293,6 @@
 /*---
  * Definitions for initial stack pointer and data area (in data cache)
  */
-#if 0 /* test-only */
-#define CONFIG_SYS_INIT_DCACHE_CS  7   /* use cs # 7 for data cache 
memory*/
-#define CONFIG_SYS_INIT_RAM_ADDR   0x4000  /* use data cache   
   */
-#define CONFIG_SYS_INIT_RAM_END0x2000  /* End of used area in RAM  
   */
-#define CONFIG_SYS_GBL_DATA_SIZE  128  /* size in bytes reserved for 
initial data */
-#define CONFIG_SYS_GBL_DATA_OFFSET(CONFIG_SYS_INIT_RAM_END - 
CONFIG_SYS_GBL_DATA_SIZE)
-#define CONFIG_SYS_INIT_SP_OFFSET  CONFIG_SYS_GBL_DATA_OFFSET
-#else
 /* use on chip memory ( OCM ) for temperary stack until sdram is tested */
 #define CONFIG_SYS_TEMP_STACK_OCM1
 /* On Chip Memory location */
@@ -346,7 +304,6 @@
 #de

[U-Boot] [PATCH 1/3] ppc4xx: Remove unused code from PCI405 code

2008-11-24 Thread matthias . fuchs
From: Matthias Fuchs <[EMAIL PROTECTED]>

Signed-off-by: Matthias Fuchs <[EMAIL PROTECTED]>
---
 board/esd/pci405/cmd_pci405.c |  871 -
 1 files changed, 0 insertions(+), 871 deletions(-)

diff --git a/board/esd/pci405/cmd_pci405.c b/board/esd/pci405/cmd_pci405.c
index 5c717e2..f558a2b 100644
--- a/board/esd/pci405/cmd_pci405.c
+++ b/board/esd/pci405/cmd_pci405.c
@@ -32,13 +32,9 @@
 
 #include "pci405.h"
 
-
 #if defined(CONFIG_CMD_BSP)
 
 extern int do_bootm (cmd_tbl_t *, int, int, char *[]);
-extern int do_bootvx (cmd_tbl_t *, int, int, char *[]);
-unsigned long get_dcr(unsigned short);
-
 
 /*
  * Command loadpci: wait for signal from host and boot image.
@@ -97,33 +93,6 @@ int do_loadpci(cmd_tbl_t *cmdtp, int flag, int argc, char 
*argv[])
} else {
sprintf(addr, "%08x", *ptr);
 
-#if 0
-   /*
-* Boot image
-*/
-   if (*ptr & 0x0001) {
-   /*
-* Boot VxWorks image via bootvx
-*/
-   addr[strlen(addr)-1] = '0';
-   printf("\nBooting VxWorks-Image at addr 0x%s ...\n", 
addr);
-   setenv("loadaddr", addr);
-
-   local_args[0] = argv[0];
-   local_args[1] = NULL;
-   status = do_bootvx (cmdtp, 0, 1, local_args);
-   } else {
-   /*
-* Boot image via bootm (normally Linux)
-*/
-   printf("\nBooting Image at addr 0x%s ...\n", addr);
-   setenv("loadaddr", addr);
-
-   local_args[0] = argv[0];
-   local_args[1] = NULL;
-   status = do_bootm (cmdtp, 0, 1, local_args);
-   }
-#else
/*
 * Boot image via bootm
 */
@@ -133,7 +102,6 @@ int do_loadpci(cmd_tbl_t *cmdtp, int flag, int argc, char 
*argv[])
local_args[0] = argv[0];
local_args[1] = NULL;
status = do_bootm (cmdtp, 0, 1, local_args);
-#endif
}
 
return 0;
@@ -143,843 +111,4 @@ U_BOOT_CMD(
"loadpci - Wait for pci-image and boot it\n",
NULL
 );
-
-#endif
-
-#if 1 /* test-only */
-int do_getpci(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
-{
-   unsigned int val;
-   int i;
-
-   printf("\nPCI Configuration Regs for PPC405GP:");
-   for (i=0; i<0x64; i+=4) {
-   pci_read_config_dword(PCIDEVID_405GP, i, &val);
-   if (!(i % 0x10)) {
-   printf("\n%02x: ", i);
-   }
-   printf("%08x ", val);
-   }
-   printf("\n");
-
-   return 0;
-}
-U_BOOT_CMD(
-   getpci, 1,  1,  do_getpci,
-   "getpci  - Print own pci configuration registers\n",
-   NULL
-);
-
-int do_setpci(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
-{
-   unsigned int addr;
-   unsigned int val;
-
-   addr = simple_strtol (argv[1], NULL, 16);
-   val = simple_strtol (argv[2], NULL, 16);
-
-   printf("\nWriting %08x to PCI reg %08x.\n", val, addr);
-   pci_write_config_dword(PCIDEVID_405GP, addr, val);
-
-   return 0;
-}
-U_BOOT_CMD(
-   setpci, 3,  1,  do_setpci,
-   "setpci  - Set one pci configuration lword\n",
-   " \n"
-   "- Write pci configuration lword  to .\n"
-);
-
-int do_dumpdcr(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
-{
-   int i;
-
-   printf("\nDevice Configuration Registers (DCR's) for PPC405GP:");
-   for (i=0; i<=0x1e0; i++) {
-   if (!(i % 0x8)) {
-   printf("\n%04x ", i);
-   }
-   printf("%08lx ", get_dcr(i));
-   }
-   printf("\n");
-
-   return 0;
-}
-U_BOOT_CMD(
-   dumpdcr,1,  1,  do_dumpdcr,
-   "dumpdcr - Dump all DCR registers\n",
-   NULL
-);
-
-
-int do_dumpspr(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
-{
-   printf("\nSpecial Purpose Registers (SPR's) for PPC405GP:");
-   printf("\n%04x %08x ", 947, mfspr(947));
-   printf("\n%04x %08x ", 9, mfspr(9));
-   printf("\n%04x %08x ", 1014, mfspr(1014));
-   printf("\n%04x %08x ", 1015, mfspr(1015));
-   printf("\n%04x %08x ", 1010, mfspr(1010));
-   printf("\n%04x %08x ", 957, mfspr(957));
-   printf("\n%04x %08x ", 1008, mfspr(1008));
-   printf("\n%04x %08x ", 1018, mfspr(1018));
-   printf("\n%04x %08x ", 954, mfspr(954));
-   printf("\n%04x %08x ", 950, mfspr(950));
-   printf("\n%04x %08x ", 951, mfspr(951));
-   printf("\n%04x %08x ", 981, mfspr(981));
-   printf("\n%04x %08x ", 980, mfspr(980));
-   printf("\n%04x %08x ", 982, mfspr(982));
-   printf("\n%04x %08x ", 1012, mfspr(1012));
-   printf("\n%04x %08x ", 1013, mfsp

Re: [U-Boot] [PATCH 2/4] FDT: Enable microblaze cpu in image.c

2008-11-24 Thread Michal Simek
Hi Jean-Christophe,

>> Hi Wolfgang,
>>
>>> Dear Michal,
>>>
  
 -#if defined(CONFIG_PPC) || defined(CONFIG_M68K) || defined(CONFIG_SPARC)
 +#if defined(CONFIG_M68K) || defined(CONFIG_MICROBLAZE) || 
 defined(CONFIG_PPC) \
 + || defined(CONFIG_SPARC)
  /**
   * boot_ramdisk_high - relocate init ramdisk
   * @lmb: pointer to lmb handle, will be used for memory mgmt
>>> I reject this patch.
>>>
>>> I know this is not your fault - you just add to existing code. But the
>>> existing code is wrong, and we should not add even more bad code (and
>>> rather fix the current, incorrect one).
>>>
>>> The thing is that the code  we  are  #ifdef'ing  here  depends  on  a
>>> *feature*  (FDT  boot  support),  and thus can be selected on a board
>>> level. It is *not* an architecture  thing,  so  it  is  incorrect  to
>>> enable or disable it depending on the current arch settings.
>> I understand.
>> When will be remove this part of code?
>> Because without any fix all Microblaze boards can't be successfully compiled.
>>
> try my patch
> 
>  [PATCH V3] Fix FIT and fdt blob support to have CONFIG_OF_LIBFDT and
>  CONFIG_FIT independant


I'll disable FDT support in all MB boards. This is straight forward to me.
Microblaze FDT support for bootm command is not there yet. I have it in my
internal repo.

Thanks,
Michal

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


[U-Boot] [PATCH] libfdt: Fix redefined uintptr_t warning for USE_HOSTCC

2008-11-24 Thread Jerry Van Baren
Compiling U-Boot in an old OS environment (RedHat-7.3  :-)  gives the
following warnings from FDT:

include/libfdt_env.h:50: warning: redefinition of 'uintptr_t'
/usr/include/stdint.h:129: warning: 'uintptr_t' previously declared here

Fix: Protect the definition of uintptr_t when compiling on the host
system.

Signed-off-by: Gerald Van Baren <[EMAIL PROTECTED]>
---

On Mon, Nov 24, 2008 at 09:35:14AM +0100, Wolfgang Denk wrote:
> Dear Jerry,
> 
> compiling U-Boot in an old OS environment (RedHat-7.3 :-) gives the
> following warnigns from FDT:
> 
> include/libfdt_env.h:50: warning: redefinition of `uintptr_t'
> /usr/include/stdint.h:129: warning: `uintptr_t' previously declared here
> 
> 
> Could you please have a look?  Thanks.
> 
> Best regards,
> 
> Wolfgang Denk

Dear Wolfgang,

Try this, it looks like a simple oversight.  I'm not sure why we don't
see it on a "modern" ;-) linux.

Best regards,
gvb

 include/libfdt_env.h |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/include/libfdt_env.h b/include/libfdt_env.h
index 355ebf2..ea474a5 100644
--- a/include/libfdt_env.h
+++ b/include/libfdt_env.h
@@ -47,6 +47,7 @@ extern struct fdt_header *working_fdt;  /* Pointer to the 
working fdt */
 #define cpu_to_fdt64(x)(x)
 #endif
 
+#ifndef USE_HOSTCC
 /*
  * Types for `void *' pointers.
  *
@@ -58,5 +59,6 @@ typedef unsigned long int   uintptr_t;
 #else
 typedef unsigned intuintptr_t;
 #endif
+#endif /* not USE_HOSTCC */
 
 #endif /* _LIBFDT_ENV_H */
-- 
1.5.6.5

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


Re: [U-Boot] [PATCH 2/4] FDT: Enable microblaze cpu in image.c

2008-11-24 Thread Jean-Christophe PLAGNIOL-VILLARD
On 13:57 Mon 24 Nov , Michal Simek wrote:
> Hi Wolfgang,
> 
> > Dear Michal,
> > 
> >>  
> >> -#if defined(CONFIG_PPC) || defined(CONFIG_M68K) || defined(CONFIG_SPARC)
> >> +#if defined(CONFIG_M68K) || defined(CONFIG_MICROBLAZE) || 
> >> defined(CONFIG_PPC) \
> >> + || defined(CONFIG_SPARC)
> >>  /**
> >>   * boot_ramdisk_high - relocate init ramdisk
> >>   * @lmb: pointer to lmb handle, will be used for memory mgmt
> > 
> > I reject this patch.
> > 
> > I know this is not your fault - you just add to existing code. But the
> > existing code is wrong, and we should not add even more bad code (and
> > rather fix the current, incorrect one).
> > 
> > The thing is that the code  we  are  #ifdef'ing  here  depends  on  a
> > *feature*  (FDT  boot  support),  and thus can be selected on a board
> > level. It is *not* an architecture  thing,  so  it  is  incorrect  to
> > enable or disable it depending on the current arch settings.
> 
> I understand.
> When will be remove this part of code?
> Because without any fix all Microblaze boards can't be successfully compiled.
> 
try my patch

 [PATCH V3] Fix FIT and fdt blob support to have CONFIG_OF_LIBFDT and
 CONFIG_FIT independant

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


Re: [U-Boot] [PATCH 2/4] FDT: Enable microblaze cpu in image.c

2008-11-24 Thread Michal Simek
Hi Wolfgang,

> Dear Michal,
> 
>>  
>> -#if defined(CONFIG_PPC) || defined(CONFIG_M68K) || defined(CONFIG_SPARC)
>> +#if defined(CONFIG_M68K) || defined(CONFIG_MICROBLAZE) || 
>> defined(CONFIG_PPC) \
>> + || defined(CONFIG_SPARC)
>>  /**
>>   * boot_ramdisk_high - relocate init ramdisk
>>   * @lmb: pointer to lmb handle, will be used for memory mgmt
> 
> I reject this patch.
> 
> I know this is not your fault - you just add to existing code. But the
> existing code is wrong, and we should not add even more bad code (and
> rather fix the current, incorrect one).
> 
> The thing is that the code  we  are  #ifdef'ing  here  depends  on  a
> *feature*  (FDT  boot  support),  and thus can be selected on a board
> level. It is *not* an architecture  thing,  so  it  is  incorrect  to
> enable or disable it depending on the current arch settings.

I understand.
When will be remove this part of code?
Because without any fix all Microblaze boards can't be successfully compiled.

Thanks,
Michal


> Best regards,
> 
> Wolfgang Denk
> 


-- 
Michal Simek, Ing. (M.Eng)
w: www.monstr.eu p: +42-0-721842854
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Can I have a backup boot option ?

2008-11-24 Thread Wolfgang Denk
Dear Mark,

In message <[EMAIL PROTECTED]> you wrote:
> 
> If an end-user inserts an MMC card containing some "magic marker" files, the 
> target will detect these and boot from the MMC card instead of using the 
> standard boot option.
...
> I've done a quick check of the README and the source code, but nothing else 
> seems to stand out as a possible solution.

Note: please restrict your line lenght to some 70 or so characters.

There are several  auto-update  /  recovery  solutions  available  in
current  source  code.  Just look around - search for file names that
contain auto_update or fwupdate, and/or read doc/README.update

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: [EMAIL PROTECTED]
Sorry, but my karma just ran over your dogma.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/4] FDT: Enable microblaze cpu in image.c

2008-11-24 Thread Wolfgang Denk
Dear Michal,

In message <[EMAIL PROTECTED]> you wrote:
> From: Michal Simek <[EMAIL PROTECTED]>
> 
> 
> Signed-off-by: Michal Simek <[EMAIL PROTECTED]>
> ---
>  common/image.c |3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/common/image.c b/common/image.c
> index 866edf6..1459024 100644
> --- a/common/image.c
> +++ b/common/image.c
> @@ -982,7 +982,8 @@ int boot_get_ramdisk (int argc, char *argv[], 
> bootm_headers_t *images,
>   return 0;
>  }
>  
> -#if defined(CONFIG_PPC) || defined(CONFIG_M68K) || defined(CONFIG_SPARC)
> +#if defined(CONFIG_M68K) || defined(CONFIG_MICROBLAZE) || 
> defined(CONFIG_PPC) \
> + || defined(CONFIG_SPARC)
>  /**
>   * boot_ramdisk_high - relocate init ramdisk
>   * @lmb: pointer to lmb handle, will be used for memory mgmt

I reject this patch.

I know this is not your fault - you just add to existing code. But the
existing code is wrong, and we should not add even more bad code (and
rather fix the current, incorrect one).

The thing is that the code  we  are  #ifdef'ing  here  depends  on  a
*feature*  (FDT  boot  support),  and thus can be selected on a board
level. It is *not* an architecture  thing,  so  it  is  incorrect  to
enable or disable it depending on the current arch settings.

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: [EMAIL PROTECTED]
Time is a drug. Too much of it kills you.
  - Terry Pratchett, _Small Gods_
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] Can I have a backup boot option ?

2008-11-24 Thread Mark Jackson
Our current system works fine (booting from flash or nfs), but I'd also like to 
add a "recovery" feature.

If an end-user inserts an MMC card containing some "magic marker" files, the 
target will detect these and boot from the MMC card instead of using the 
standard boot option.

For portability, I guess I could use the Hush option and construct some big 
if..else..fi statement to check for the MMC card files and boot accordingly. Is 
this a simple-ish task ?

An easier, but less portable, way would be to hard-code the checks in the 
startup code before the standard boot process.

I've done a quick check of the README and the source code, but nothing else 
seems to stand out as a possible solution.

Anyone got any ideas ?

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


[U-Boot] [PATCH V3] Fix FIT and fdt blob support to have CONFIG_OF_LIBFDT and CONFIG_FIT independant

2008-11-24 Thread Jean-Christophe PLAGNIOL-VILLARD
FDT support is used for both FIT style images and architectures (ppc, m68k, 
sparc)
that can pass a fdt blob to an OS..

For other arch and board which do not pass a fdt blob to an OS but want to use
the new uImage format, we just need FIT support (ex : ARM).

Now we can have the 4 following configurations :

1) FIT only CONFIG_FIT
2) fdt blob onlyCONFIG_OF_LIBFDT
3) both CONFIG_OF_LIBFDT & CONFIG_FIT
4) none none

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <[EMAIL PROTECTED]>
---
actually not clean integration have been found to avoid
defined(CONFIG_PPC) || defined(CONFIG_M68K) || defined(CONFIG_SPARC)
by replacing it with the 2 news macro.

removing arch macro ifdef and use 2 new config for the functionnality to enable
so we introduce these :
CONFIG_BOOT_INIT_RAMDISK

Define this if you want support for relocating init ramdisk

CONFIG_BOOT_INIT_RAMDISK

Define this if you want support for allocate and initialize kernel
information for booting

if someone have a good idea please send a patch

Best Regards,
J.
 common/image.c  |2 ++
 include/image.h |4 
 libfdt/Makefile |8 ++--
 3 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/common/image.c b/common/image.c
index 866edf6..daa68bc 100644
--- a/common/image.c
+++ b/common/image.c
@@ -1071,6 +1071,7 @@ int boot_ramdisk_high (struct lmb *lmb, ulong rd_data, 
ulong rd_len,
 error:
return -1;
 }
+#endif /* defined(CONFIG_PPC) || defined(CONFIG_M68K) || defined(CONFIG_SPARC) 
*/
 
 #ifdef CONFIG_OF_LIBFDT
 static void fdt_error (const char *msg)
@@ -1575,6 +1576,7 @@ error:
 }
 #endif /* CONFIG_OF_LIBFDT */
 
+#if defined(CONFIG_PPC) || defined(CONFIG_M68K)
 /**
  * boot_get_cmdline - allocate and initialize kernel cmdline
  * @lmb: pointer to lmb handle, will be used for memory mgmt
diff --git a/include/image.h b/include/image.h
index 5433555..4609200 100644
--- a/include/image.h
+++ b/include/image.h
@@ -50,10 +50,6 @@
 
 #endif /* USE_HOSTCC */
 
-#if defined(CONFIG_FIT) && !defined(CONFIG_OF_LIBFDT)
-#error "CONFIG_OF_LIBFDT not enabled, required by CONFIG_FIT!"
-#endif
-
 #include 
 
 #if defined(CONFIG_FIT)
diff --git a/libfdt/Makefile b/libfdt/Makefile
index ca2ad76..d6e2830 100644
--- a/libfdt/Makefile
+++ b/libfdt/Makefile
@@ -27,9 +27,13 @@ LIB  = $(obj)libfdt.a
 
 SOBJS  =
 
-COBJS-$(CONFIG_OF_LIBFDT) += fdt.o fdt_ro.o fdt_rw.o fdt_strerror.o fdt_sw.o 
fdt_wip.o
+COBJS-libfdt += fdt.o fdt_ro.o fdt_rw.o fdt_strerror.o fdt_sw.o fdt_wip.o
 
-COBJS  := $(COBJS-y)
+COBJS-$(CONFIG_OF_LIBFDT) += $(COBJS-libfdt)
+COBJS-$(CONFIG_FIT) += $(COBJS-libfdt)
+
+
+COBJS  := $(sort $(COBJS-y))
 SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
 
-- 
1.5.6.5

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


Re: [U-Boot] [PATCH] at91rm9200: fix broken boot from nor flash

2008-11-24 Thread Jens Scharsig
Dear Wolfgang,
Hello at all,

>
> I  testedm  the  patch,  but  it  doesn't  fix  the  problem  on  the
> AT91RM9200DK  board  (that's  the  one  I  could  easily  test at the
> moment).
>

I think my patch only don't work on AT91RM9200DK, AT91RM9200EK or
AT91RM9200DF board. Blame it on this solution is the #ifdef construct in
/cpu/arm920t/start.s at line 264. There are no low_level_init run for
DK, EK andDF board.

It's only effect on Atmel Boards. I can't test is it truth.
So the question goes to DK users and arm custodian.


Best regards

Jens Scharsig

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


[U-Boot] Removing suzaku board from U-BOOT

2008-11-24 Thread Michal Simek
Hi Yasushi and others,

I am going to redesign microblaze u-boot branch to similar style as is
xilinx ppc platform and I would like to remove suzaku board too because I don't
have any info if someone use it.

Is someone who use this board?

Thanks,
Michal



-- 
Michal Simek, Ing. (M.Eng)
w: www.monstr.eu p: +42-0-721842854
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 1/1] MIMC200: tidy GCLK init code

2008-11-24 Thread Mark Jackson
Change the MIMC200 startup code to use the built-in (rather than
hard-coded) funtions for setting up gclk outputs.

We'll also move the code to the new, more-appropriate
board_postclk_init() routine.

Signed-off-by: Mark Jackson <[EMAIL PROTECTED]>

--- 

 board/mimc/mimc200/mimc200.c |   14 --
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/board/mimc/mimc200/mimc200.c b/board/mimc/mimc200/mimc200.c
index ec83b9d..62c0943 100644
--- a/board/mimc/mimc200/mimc200.c
+++ b/board/mimc/mimc200/mimc200.c
@@ -30,8 +30,6 @@
 #include 
 #include 
 
-#define SM_PM_GCCTRL   0x0060
-
 DECLARE_GLOBAL_DATA_PTR;
 
 static const struct sdram_config sdram_config = {
@@ -83,10 +81,6 @@ int board_early_init_f(void)
portmux_select_gpio(PORTMUX_PORT_C, 1 << 18,
PORTMUX_DIR_OUTPUT | PORTMUX_INIT_HIGH);
 
-   /* GCLK0 - 10MHz clock */
-   writel(0x0004, (void *)SM_BASE + SM_PM_GCCTRL);
-   portmux_select_peripheral(PORTMUX_PORT_A, 1 << 30, PORTMUX_FUNC_A, 0);
-
udelay(5000);
 
/* release phys reset */
@@ -132,6 +126,14 @@ int board_early_init_r(void)
return 0;
 }
 
+int board_postclk_init(void)
+{
+   /* Use GCLK0 as 10MHz output */
+   gclk_enable_output(0, PORTMUX_DRIVE_LOW);
+   gclk_set_rate(0, GCLK_PARENT_OSC0, 1000);
+   return 0;
+}
+
 /* SPI chip select control */
 #ifdef CONFIG_ATMEL_SPI
 #include 
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] Microblaze patches

2008-11-24 Thread Michal Simek
Hi All,

here are 4 microblaze patches. All patches are in microblaze custodian
repository - master branch.

Thanks for your review,
Michal

-- 
Michal Simek, Ing. (M.Eng)
w: www.monstr.eu p: +42-0-721842854
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 1/1] ppc4xx: ml300 remove Xilinx BSP from ml300 folder

2008-11-24 Thread monstr
From: Michal Simek <[EMAIL PROTECTED]>

---
This BSP should be outside u-boot source tree.
The second reason is that xilinx ppc405 was moved to generic platform.

Signed-off-by: Michal Simek <[EMAIL PROTECTED]>
---
 .../ml300/sw_services/uboot_v1_00_a/data/Ltypes|   55 
 .../uboot_v1_00_a/data/uboot_v2_1_0.mld|   52 ---
 .../uboot_v1_00_a/data/uboot_v2_1_0.tcl|  325 
 3 files changed, 0 insertions(+), 432 deletions(-)
 delete mode 100644 board/xilinx/ml300/sw_services/uboot_v1_00_a/data/Ltypes
 delete mode 100644 
board/xilinx/ml300/sw_services/uboot_v1_00_a/data/uboot_v2_1_0.mld
 delete mode 100644 
board/xilinx/ml300/sw_services/uboot_v1_00_a/data/uboot_v2_1_0.tcl

diff --git a/board/xilinx/ml300/sw_services/uboot_v1_00_a/data/Ltypes 
b/board/xilinx/ml300/sw_services/uboot_v1_00_a/data/Ltypes
deleted file mode 100644
index 9daf147..000
--- a/board/xilinx/ml300/sw_services/uboot_v1_00_a/data/Ltypes
+++ /dev/null
@@ -1,55 +0,0 @@
-#!/bin/bash
-
-if [ $# -ne 1 ]
-then
-echo "usage: Ltypes filename" >&2
-exit 2
-fi
-
-FILE="$1"
-#TMPFILE='mktemp "${FILE}.XX"' || exit 1
-TMPFILE=${FILE}.`date "+%s"`
-touch $TMPFILE || exit 1
-
-# Change all the Xilinx types to Linux types and put the result into a temp 
file
-sed\
-   -e 's/\bXTRUE\b/TRUE/g' \
-   -e 's/\bXFALSE\b/FALSE/g' \
-   -e 's/\bXNULL\b/NULL/g' \
-   -e 's/"xenv.h"//g' \
-   -e 's/\bXENV_USLEEP\b/udelay/g' \
-   -e 's/\bXuint8\b/u8/g' \
-   -e 's/\bXuint16\b/u16/g' \
-   -e 's/\bXuint32\b/u32/g' \
-   -e 's/\bXint8\b/s8/g' \
-   -e 's/\bXint16\b/s16/g' \
-   -e 's/\bXint32\b/s32/g' \
-   -e 's/\bXboolean\b/u32/g' \
-   "${FILE}" > "${TMPFILE}"
-
-# Overlay the original file with the temp file
-mv "${TMPFILE}" "${FILE}"
-
-# Are we doing xbasic_types.h?
-if [ "${FILE##*/}" = xbasic_types.h ]
-then
-# Remember as you're reading this that we've already gone through the prior
-# sed script.  We need to do some other things to xbasic_types.h:
-#   1) Add ifndefs around TRUE and FALSE defines
-#   2) Remove definition of NULL as NULL
-#   3) Replace most of the primitive types section with a #include
-sed \
-   -e '/u32 true/,/#define false/Ic\
-#ifndef TRUE\
-#define TRUE 1\
-#endif\
-#ifndef FALSE\
-#define FALSE 0\
-#endif' \
-   -e '/#define[[:space:]][[:space:]]*NULL[[:space:]][[:space:]]*NULL/d' \
-   -e 
'/typedef[[:space:]][[:space:]]*unsigned[[:space:]][[:space:]]*char[[:space:]][[:space:]]*u8/,/typedef[[:space:]][[:space:]]*unsigned[[:space:]][[:space:]]*long[[:space:]][[:space:]]*u32.*boolean/c\
-#include ' \
-   "${FILE}" > "${TMPFILE}"
-
-mv "${TMPFILE}" "${FILE}"
-fi
diff --git a/board/xilinx/ml300/sw_services/uboot_v1_00_a/data/uboot_v2_1_0.mld 
b/board/xilinx/ml300/sw_services/uboot_v1_00_a/data/uboot_v2_1_0.mld
deleted file mode 100644
index 5169241..000
--- a/board/xilinx/ml300/sw_services/uboot_v1_00_a/data/uboot_v2_1_0.mld
+++ /dev/null
@@ -1,52 +0,0 @@
-# (c) Copyright 2004 Xilinx Inc.
-# Author: Xilinx, 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.
-#
-#
-# XILINX IS PROVIDING THIS DESIGN, CODE, OR INFORMATION "AS IS" AS A
-# COURTESY TO YOU. BY PROVIDING THIS DESIGN, CODE, OR INFORMATION AS
-# ONE POSSIBLE IMPLEMENTATION OF THIS FEATURE, APPLICATION OR STANDARD,
-# XILINX IS MAKING NO REPRESENTATION THAT THIS IMPLEMENTATION IS FREE
-# FROM ANY CLAIMS OF INFRINGEMENT, AND YOU ARE RESPONSIBLE FOR OBTAINING
-# ANY THIRD PARTY RIGHTS YOU MAY REQUIRE FOR YOUR IMPLEMENTATION.
-# XILINX EXPRESSLY DISCLAIMS ANY WARRANTY WHATSOEVER WITH RESPECT TO
-# THE ADEQUACY OF THE IMPLEMENTATION, INCLUDING BUT NOT LIMITED TO ANY
-# WARRANTIES OR REPRESENTATIONS THAT THIS IMPLEMENTATION IS FREE FROM
-# CLAIMS OF INFRINGEMENT, IMPLIED WARRANTIES OF MERCHANTABILITY AND
-# FITNESS FOR A PARTICULAR PURPOSE.
-#
-#
-# Xilinx hardware products are not intended for use in life support
-# appliances, devices, or systems. Use in such applications is
-# expressly prohibited.
-#
-#
-# (c) Copyright 2002-2004 Xilinx Inc.
-# All rights reserved.
-#
-#
-# 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.,
-# 675 Mass Ave, Cambridge, MA 02139, USA.
-
-OPTION psf_version = 2.1;
-
-BEGIN LIBRARY uboot OPTION DRC = uboot_drc;
-
-BEGIN ARRAY connected_periphs PROPERTY desc = "Peripherals connected to 
U-Boot";
-PROPERTY size = 0;
-PARAM name = periph_name, desc = "Name of Peripheral connected", type = string;
-END ARRAY
-PARAMETER name = TARGET_DIR, desc = "Target Directory for U-Boot BSP", 
type = st

[U-Boot] [PATCH 4/4] microblaze: ml401, xupv2p, suzaku - add CONFIG_SYS_BOOTMAPSZ and

2008-11-24 Thread monstr
From: Michal Simek <[EMAIL PROTECTED]>


Signed-off-by: Michal Simek <[EMAIL PROTECTED]>
---
 include/configs/ml401.h  |8 
 include/configs/suzaku.h |9 +
 include/configs/xupv2p.h |8 
 3 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/include/configs/ml401.h b/include/configs/ml401.h
index b31c4b5..f4dbf5d 100644
--- a/include/configs/ml401.h
+++ b/include/configs/ml401.h
@@ -279,4 +279,12 @@
 #define CONFIG_CMDLINE_EDITING
 #define CONFIG_OF_LIBFDT   1
 
+/*---
+ * For booting Linux, the board info and command line data
+ * have to be in the first 8 MB of memory, since this is
+ * the maximum mapped by the Linux kernel during initialization.
+ */
+#define CONFIG_SYS_BOOTMAPSZ   (8 << 20)   /* Initial Memory map for Linux 
*/
+#define CONFIG_SYS_BARGSIZE256 /* Boot Argument Buffer Size
*/
+
 #endif /* __CONFIG_H */
diff --git a/include/configs/suzaku.h b/include/configs/suzaku.h
index b702de0..b7e5515 100644
--- a/include/configs/suzaku.h
+++ b/include/configs/suzaku.h
@@ -107,4 +107,13 @@
 #define XILINX_CLOCK_FREQ  5000
 #define CONFIG_XILINX_CLOCK_FREQ   XILINX_CLOCK_FREQ
 
+/*---
+ * For booting Linux, the board info and command line data
+ * have to be in the first 8 MB of memory, since this is
+ * the maximum mapped by the Linux kernel during initialization.
+ */
+#define CONFIG_SYS_BOOTMAPSZ   (8 << 20)   /* Initial Memory map for Linux 
*/
+#define CONFIG_SYS_BARGSIZE256 /* Boot Argument Buffer Size
*/
+
+
 #endif /* __CONFIG_H */
diff --git a/include/configs/xupv2p.h b/include/configs/xupv2p.h
index 6a92703..4e406fb 100644
--- a/include/configs/xupv2p.h
+++ b/include/configs/xupv2p.h
@@ -224,4 +224,12 @@
 #define CONFIG_CMDLINE_EDITING
 #define CONFIG_OF_LIBFDT   1 /* flat device tree */
 
+/*---
+ * For booting Linux, the board info and command line data
+ * have to be in the first 8 MB of memory, since this is
+ * the maximum mapped by the Linux kernel during initialization.
+ */
+#define CONFIG_SYS_BOOTMAPSZ   (8 << 20)   /* Initial Memory map for Linux 
*/
+#define CONFIG_SYS_BARGSIZE256 /* Boot Argument Buffer Size
*/
+
 #endif /* __CONFIG_H */
-- 
1.5.5.1

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


[U-Boot] [PATCH 3/4] microblaze: Fix ml401 uart16550 setting

2008-11-24 Thread monstr
From: Michal Simek <[EMAIL PROTECTED]>


Signed-off-by: Michal Simek <[EMAIL PROTECTED]>
---
 include/configs/ml401.h |   17 ++---
 1 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/include/configs/ml401.h b/include/configs/ml401.h
index 63d07ff..b31c4b5 100644
--- a/include/configs/ml401.h
+++ b/include/configs/ml401.h
@@ -37,17 +37,20 @@
 #defineCONFIG_SERIAL_BASE  XILINX_UARTLITE_BASEADDR
 #defineCONFIG_BAUDRATE XILINX_UARTLITE_BAUDRATE
 #defineCONFIG_SYS_BAUDRATE_TABLE   { CONFIG_BAUDRATE }
-#else
-#ifdef XILINX_UART16550_BASEADDR
-#define CONFIG_SYS_NS16550
+#elif XILINX_UART16550_BASEADDR
+#define CONFIG_SYS_NS16550 1
 #define CONFIG_SYS_NS16550_SERIAL
-#define CONFIG_SYS_NS16550_REG_SIZE4
+#define CONFIG_SYS_NS16550_REG_SIZE-4
 #define CONFIG_CONS_INDEX  1
-#define CONFIG_SYS_NS16550_COM1XILINX_UART16550_BASEADDR
+#define CONFIG_SYS_NS16550_COM1(XILINX_UART16550_BASEADDR + 0x1000 + 
0x3)
 #define CONFIG_SYS_NS16550_CLK XILINX_UART16550_CLOCK_HZ
 #defineCONFIG_BAUDRATE 115200
-#defineCONFIG_SYS_BAUDRATE_TABLE   { 9600, 115200 }
-#endif
+
+/* The following table includes the supported baudrates */
+#define CONFIG_SYS_BAUDRATE_TABLE  \
+   {300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200, 230400}
+#else
+#error Undefined uart
 #endif
 
 /* setting reset address */
-- 
1.5.5.1

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


[U-Boot] [PATCH 2/4] FDT: Enable microblaze cpu in image.c

2008-11-24 Thread monstr
From: Michal Simek <[EMAIL PROTECTED]>


Signed-off-by: Michal Simek <[EMAIL PROTECTED]>
---
 common/image.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/common/image.c b/common/image.c
index 866edf6..1459024 100644
--- a/common/image.c
+++ b/common/image.c
@@ -982,7 +982,8 @@ int boot_get_ramdisk (int argc, char *argv[], 
bootm_headers_t *images,
return 0;
 }
 
-#if defined(CONFIG_PPC) || defined(CONFIG_M68K) || defined(CONFIG_SPARC)
+#if defined(CONFIG_M68K) || defined(CONFIG_MICROBLAZE) || defined(CONFIG_PPC) \
+ || defined(CONFIG_SPARC)
 /**
  * boot_ramdisk_high - relocate init ramdisk
  * @lmb: pointer to lmb handle, will be used for memory mgmt
-- 
1.5.5.1

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


[U-Boot] [PATCH 1/4] microblaze: Set up relocation is done

2008-11-24 Thread monstr
From: Michal Simek <[EMAIL PROTECTED]>


Signed-off-by: Michal Simek <[EMAIL PROTECTED]>
---
 lib_microblaze/board.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/lib_microblaze/board.c b/lib_microblaze/board.c
index cd61918..0e35734 100644
--- a/lib_microblaze/board.c
+++ b/lib_microblaze/board.c
@@ -119,6 +119,7 @@ void board_init (void)
bd->bi_baudrate = CONFIG_BAUDRATE;
bd->bi_memstart = CONFIG_SYS_SDRAM_BASE;
bd->bi_memsize = CONFIG_SYS_SDRAM_SIZE;
+   gd->flags |= GD_FLG_RELOC;  /* tell others: relocation done */
 
/* Initialise malloc() area */
mem_malloc_init ();
-- 
1.5.5.1

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


[U-Boot] [PATCH 1/1] Setup extra MIMC200 chip selects

2008-11-24 Thread Mark Jackson
Added code to setup the extra Flash and FRAM chip selects
as used on the MIMC200 board.

Signed-off-by: Mark Jackson <[EMAIL PROTECTED]>

---
 cpu/at32ap/cpu.c |   14 ++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/cpu/at32ap/cpu.c b/cpu/at32ap/cpu.c
index 1a13702..3902efe 100644
--- a/cpu/at32ap/cpu.c
+++ b/cpu/at32ap/cpu.c
@@ -56,6 +56,20 @@ int cpu_init(void)
hsmc3_writel(PULSE0, 0x0b0a0906);
hsmc3_writel(SETUP0, 0x00010002);
 
+#ifdef CONFIG_MIMC200
+   /* setup Data Flash chip select (NCS2) */
+   hsmc3_writel(MODE2, 0x20121003);
+   hsmc3_writel(CYCLE2, 0x000a0009);
+   hsmc3_writel(PULSE2, 0x0a060806);
+   hsmc3_writel(SETUP2, 0x00030102);
+
+   /* setup FRAM chip select (NCS3) */
+   hsmc3_writel(MODE3, 0x10120001);
+   hsmc3_writel(CYCLE3, 0x001e001d);
+   hsmc3_writel(PULSE3, 0x08040704);
+   hsmc3_writel(SETUP3, 0x02050204);
+#endif
+ 
clk_init();
 
/* Update the CPU speed according to the PLL configuration */
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [ubi] Please pull git://www.denx.de/git/u-boot-ubi.git

2008-11-24 Thread Stefan Roese
Hi Wolfgang,

I pushed the 2 small patches to support UBI on NOR FLASH into the ubi 
repository. 
Here the updated pull request:

The following changes since commit 9b827cf1720acda2473afa516956eab6f7cca9a1:
  Selvamuthukumar (1):
Align end of bss by 4 bytes

are available in the git repository at:

  git://www.denx.de/git/u-boot-ubi.git master

Kyungmin Park (11):
  MTD: Add MTD paritioning infrastructure
  UBI: Add basic UBI support to U-Boot (Part 1/8)
  UBI: Add basic UBI support to U-Boot (Part 2/8)
  UBI: Add basic UBI support to U-Boot (Part 3/8)
  UBI: Add basic UBI support to U-Boot (Part 4/8)
  UBI: Add basic UBI support to U-Boot (Part 5/8)
  UBI: Add basic UBI support to U-Boot (Part 6/8)
  UBI: Add basic UBI support to U-Boot (Part 7/8)
  UBI: Add basic UBI support to U-Boot (Part 8/8)
  UBI: Add UBI command support
  ARM: Add Apollon UBI support

Piotr Ziecik (2):
  mtd: Remove a printf() from add_mtd_device().
  UBI: Add proof-of-concept CFI flash support

Stefan Roese (1):
  UBI: Change parsing of size in commands to default to hex

 Makefile   |1 +
 board/apollon/Makefile |3 +-
 common/Makefile|1 +
 common/cmd_ubi.c   |  608 +++
 drivers/mtd/Makefile   |1 +
 drivers/mtd/mtdcore.c  |  144 ++
 drivers/mtd/mtdpart.c  |  532 +++
 drivers/mtd/ubi/Makefile   |   51 +
 drivers/mtd/ubi/build.c| 1186 ++
 drivers/mtd/ubi/crc32.c|  518 ++
 drivers/mtd/ubi/crc32defs.h|   32 +
 drivers/mtd/ubi/crc32table.h   |  136 ++
 drivers/mtd/ubi/debug.c|  192 +++
 drivers/mtd/ubi/debug.h|  152 ++
 drivers/mtd/ubi/eba.c  | 1256 +++
 drivers/mtd/ubi/io.c   | 1274 +++
 drivers/mtd/ubi/kapi.c |  638 
 drivers/mtd/ubi/misc.c |  106 ++
 drivers/mtd/ubi/scan.c | 1360 
 drivers/mtd/ubi/scan.h |  165 ++
 .../ubi-header.h => drivers/mtd/ubi/ubi-media.h|  154 +-
 drivers/mtd/ubi/ubi.h  |  641 
 drivers/mtd/ubi/upd.c  |  441 ++
 drivers/mtd/ubi/vmt.c  |  862 ++
 drivers/mtd/ubi/vtbl.c |  837 ++
 drivers/mtd/ubi/wl.c   | 1670 
 include/configs/apollon.h  |   74 +-
 include/exports.h  |1 +
 include/jffs2/load_kernel.h|5 +
 include/linux/crc32.h  |   27 +
 include/linux/mtd/partitions.h |   84 +
 include/linux/mtd/ubi-user.h   |  161 --
 include/linux/mtd/ubi.h|  186 +++
 include/linux/types.h  |   24 +
 include/mtd/ubi-user.h |  268 
 include/ubi_uboot.h|  217 +++
 lib_generic/vsprintf.c |   23 +
 37 files changed, 13781 insertions(+), 250 deletions(-)
 create mode 100644 common/cmd_ubi.c
 create mode 100644 drivers/mtd/mtdcore.c
 create mode 100644 drivers/mtd/mtdpart.c
 create mode 100644 drivers/mtd/ubi/Makefile
 create mode 100644 drivers/mtd/ubi/build.c
 create mode 100644 drivers/mtd/ubi/crc32.c
 create mode 100644 drivers/mtd/ubi/crc32defs.h
 create mode 100644 drivers/mtd/ubi/crc32table.h
 create mode 100644 drivers/mtd/ubi/debug.c
 create mode 100644 drivers/mtd/ubi/debug.h
 create mode 100644 drivers/mtd/ubi/eba.c
 create mode 100644 drivers/mtd/ubi/io.c
 create mode 100644 drivers/mtd/ubi/kapi.c
 create mode 100644 drivers/mtd/ubi/misc.c
 create mode 100644 drivers/mtd/ubi/scan.c
 create mode 100644 drivers/mtd/ubi/scan.h
 rename include/linux/mtd/ubi-header.h => drivers/mtd/ubi/ubi-media.h (80%)
 create mode 100644 drivers/mtd/ubi/ubi.h
 create mode 100644 drivers/mtd/ubi/upd.c
 create mode 100644 drivers/mtd/ubi/vmt.c
 create mode 100644 drivers/mtd/ubi/vtbl.c
 create mode 100644 drivers/mtd/ubi/wl.c
 create mode 100644 include/linux/crc32.h
 create mode 100644 include/linux/mtd/partitions.h
 delete mode 100644 include/linux/mtd/ubi-user.h
 create mode 100644 include/linux/mtd/ubi.h
 create mode 100644 include/mtd/ubi-user.h
 create mode 100644 include/ubi_uboot.h
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 3/3] ubi: Add proof-of-concept CFI flash support

2008-11-24 Thread Stefan Roese
On Monday 17 November 2008, Piotr Ziecik wrote:
> With this patch UBI can be used on CFI flash chips.
>
> Signed-off-by: Piotr Ziecik <[EMAIL PROTECTED]>

Applied to ubi. Thanks.

Best regards,
Stefan

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


Re: [U-Boot] [PATCH 2/3] mtd: Remove a printf() from add_mtd_device().

2008-11-24 Thread Stefan Roese
On Monday 17 November 2008, Piotr Ziecik wrote:
> Remove a printf() from add_mtd_device(), which produces spurious output.
>
> Signed-off-by: Piotr Ziecik <[EMAIL PROTECTED]>

Applied to ubi. Thanks.

Best regards,
Stefan

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


Re: [U-Boot] U-boot resets when booting Linux kernel

2008-11-24 Thread Simon Boman
2008/11/21 Simon Boman <[EMAIL PROTECTED]>:
> 2008/11/21 Jerry Van Baren <[EMAIL PROTECTED]>:
>> Simon Boman wrote:
>>>
>>> 2008/11/20 Wolfgang Denk <[EMAIL PROTECTED]>:

 Dear "Simon Boman",
>>
>> [snip]
>>
>>>
>>> Thank you for your help, I find your example at your site
>>> http://www.denx.de/wiki/DULG/DecodingUBootCrashDumps which was great!
>>>
>>> Now I have got find where the U-boot goes wrong:
>>>
>>> FDT_ERR_NOSPACE in the file: /libfdt/fdt_rw.c
>>>
>>> where the values is:
>>> end: 007faff2 oldlen: 0 newlen: 16, fdt: 007fa000, totsize: 4096
>>>
>>> Before fdt_splice is called the values is:
>>> end: 007faff2 oldlen: 8 newlen: 8, fdt: 007fa000, totsize: 22219
>>>
>>> Do you have any clue why it's missing 2 bytes for the fdt??
>>>
>>> TIA
>>> Simon
>>
>> Hi Simon,
>>
>> You probably need to use the dtc -p (pad) option when you build your fdt
>> blob so that there is more space.  The error message is indicating you are
>> running out of space to add/modify the blob you are currently using.
>>
>> HTH,
>> gvb
>>
>
> Hi Jerry!
>
> I have tried that, but after have used 6000 bytes padding of 3900
> bytes code i don't think that is the solution.
> and at the example above the fdt is 22219 bytes (19000 padding) = 0x56CB
> and then the totalsize is changed to 4096 = 0x1000 which give an end
> of the fdt to 007fb000 and the comparing is false when the "real end"
> is 007faff2 + 10 = 007fb002
> So what is going wrong?
> /Simon
>

I can add that this occur after "Delete the old LMB reservation" in
bootm.c and the function fdt_resize(of_flat_tree) is executing. The
problem as I have understood it, is that the blob is resized so its
fits one block 0x1000. But the boundary is two bytes too small..
007faff2 + 10 = 007fb002
/Simon
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [cfi-flash] Please pull git://www.denx.de/git/u-boot-cfi-flash.git

2008-11-24 Thread Stefan Roese
Hi Wolfgang,

please pull the following updates from the cfi-flash repository. I am aware 
that 
the merge-window was closed when some of those patches have been published, and 
it's not really bug fixing. But the feature added with those patches (UBI 
possible 
over NOR) is very interesting. Additionally the impact to non CFI-MTD users are 
minimal. I tested those patches on different boards using the CFI driver 
without 
any problems so far. So please pull:

The following changes since commit 9b827cf1720acda2473afa516956eab6f7cca9a1:
  Selvamuthukumar (1):
Align end of bss by 4 bytes

are available in the git repository at:

  git://www.denx.de/git/u-boot-cfi-flash.git master

Piotr Ziecik (3):
  cfi_flash: Export flash_sector_size() function.
  cfi_flash: Add interface for flash verbosity control
  cfi-mtd: Add cfi-mtd driver.

Stefan Roese (1):
  cfi_flash: Make all flash access functions weak

 README  |5 +
 drivers/mtd/Makefile|1 +
 drivers/mtd/cfi_flash.c |   72 -
 drivers/mtd/cfi_mtd.c   |  202 +++
 include/flash.h |   12 +++
 5 files changed, 272 insertions(+), 20 deletions(-)
 create mode 100644 drivers/mtd/cfi_mtd.c
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/3] cfi-mtd: Add cfi-mtd driver.

2008-11-24 Thread Stefan Roese
On Monday 17 November 2008, Piotr Ziecik wrote:
> Add cfi-mtd driver, which exports CFI flash to MTD layer.
> This allows CFI flash devices to be used from MTD layer.
>
> Building of the new driver is controlled by CONFIG_FLASH_CFI_MTD
> option. Initialization is done by calling cfi_mtd_init() from
> flash_init().
>
> Signed-off-by: Piotr Ziecik <[EMAIL PROTECTED]>

Applied to u-boot-cfi-flash. Thanks.

Best regards,
Stefan

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


Re: [U-Boot] [PATCH] flash: Add interface for flash verbosity control

2008-11-24 Thread Stefan Roese
On Monday 17 November 2008, Piotr Ziecik wrote:
> Add interface for flash verbosity control. It allows
> to disable output from low-level flash API. It is useful
> when calling these low-level functions from context other
> than flash commands (for example the MTD/CFI interface
> implmentation).
>
> Signed-off-by: Piotr Ziecik <[EMAIL PROTECTED]>

Applied to u-boot-cfi-flash. Thanks.

Best regards,
Stefan

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


Re: [U-Boot] [PATCH V2] flash: Export flash_sector_size() function.

2008-11-24 Thread Stefan Roese
On Thursday 20 November 2008, Piotr Ziecik wrote:
> Export flash_sector_size() function from drivers/mtd/cfi_flash.c,
> so that it can be used in the upcoming cfi-mtd driver.
>
> Signed-off-by: Piotr Ziecik <[EMAIL PROTECTED]>
> ---
> V2: Added patch rationale in the description.

Applied to u-boot-cfi-flash. Thanks.

Best regards,
Stefan

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


Re: [U-Boot] Info on different Versions of U-Boot.

2008-11-24 Thread Wolfgang Denk
Dear Pithan,

In message <[EMAIL PROTECTED]> you wrote:
> 
> I need some information for my upgradation work.
> What are bugs in  U-Boot 1.1.4.?

Too many to list here...

> Difference between U-Boot 1.1.4 and 1.3.1

Clone the git repository, then run

git-diff U-Boot-1_1_4  v1.3.1

Be prepared to read some 855,000 lines (= close to 27 MB) of
differences.

> or where can I get the details/comparision between the different version of
> U-Boot.

See above. Use git-log to get an overview, and git-diff if you want to
know exactly.

Note: you are talking about an upgrade, but then you  mention  v1.3.1
which is pretty obsolete, too. You should really use current code for
any such work.

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: [EMAIL PROTECTED]
"The whole problem with the world is  that  fools  and  fanatics  are
always so certain of themselves, but wiser people so full of doubts."
- Bertrand Russell
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] Info on different Versions of U-Boot.

2008-11-24 Thread Pithan Prathap
Hi ,
Greetings..

I need some information for my upgradation work.
What are bugs in  U-Boot 1.1.4.?
Difference between U-Boot 1.1.4 and 1.3.1
or where can I get the details/comparision between the different version of
U-Boot.

Thanks ..

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


[U-Boot] [ubi] Please pull git://www.denx.de/git/u-boot-ubi.git

2008-11-24 Thread Stefan Roese
Hi Wolfgang,

please pull from u-boot-ubi to include UBI support into U-Boot. Kyungmin asked 
me 
to organize the pull request this time since he only has limited access to the 
denx git server.

Thanks.

The following changes since commit 9b827cf1720acda2473afa516956eab6f7cca9a1:
  Selvamuthukumar (1):
Align end of bss by 4 bytes

are available in the git repository at:

  git://www.denx.de/git/u-boot-ubi.git master

Kyungmin Park (11):
  MTD: Add MTD paritioning infrastructure
  UBI: Add basic UBI support to U-Boot (Part 1/8)
  UBI: Add basic UBI support to U-Boot (Part 2/8)
  UBI: Add basic UBI support to U-Boot (Part 3/8)
  UBI: Add basic UBI support to U-Boot (Part 4/8)
  UBI: Add basic UBI support to U-Boot (Part 5/8)
  UBI: Add basic UBI support to U-Boot (Part 6/8)
  UBI: Add basic UBI support to U-Boot (Part 7/8)
  UBI: Add basic UBI support to U-Boot (Part 8/8)
  UBI: Add UBI command support
  ARM: Add Apollon UBI support

Stefan Roese (1):
  UBI: Change parsing of size in commands to default to hex

 Makefile   |1 +
 board/apollon/Makefile |3 +-
 common/Makefile|1 +
 common/cmd_ubi.c   |  600 +++
 drivers/mtd/Makefile   |1 +
 drivers/mtd/mtdcore.c  |  146 ++
 drivers/mtd/mtdpart.c  |  532 +++
 drivers/mtd/ubi/Makefile   |   51 +
 drivers/mtd/ubi/build.c| 1186 ++
 drivers/mtd/ubi/crc32.c|  518 ++
 drivers/mtd/ubi/crc32defs.h|   32 +
 drivers/mtd/ubi/crc32table.h   |  136 ++
 drivers/mtd/ubi/debug.c|  192 +++
 drivers/mtd/ubi/debug.h|  152 ++
 drivers/mtd/ubi/eba.c  | 1256 +++
 drivers/mtd/ubi/io.c   | 1274 +++
 drivers/mtd/ubi/kapi.c |  638 
 drivers/mtd/ubi/misc.c |  106 ++
 drivers/mtd/ubi/scan.c | 1360 
 drivers/mtd/ubi/scan.h |  165 ++
 .../ubi-header.h => drivers/mtd/ubi/ubi-media.h|  154 +-
 drivers/mtd/ubi/ubi.h  |  641 
 drivers/mtd/ubi/upd.c  |  441 ++
 drivers/mtd/ubi/vmt.c  |  862 ++
 drivers/mtd/ubi/vtbl.c |  837 ++
 drivers/mtd/ubi/wl.c   | 1670 
 include/configs/apollon.h  |   74 +-
 include/exports.h  |1 +
 include/jffs2/load_kernel.h|5 +
 include/linux/crc32.h  |   27 +
 include/linux/mtd/partitions.h |   84 +
 include/linux/mtd/ubi-user.h   |  161 --
 include/linux/mtd/ubi.h|  186 +++
 include/linux/types.h  |   24 +
 include/mtd/ubi-user.h |  268 
 include/ubi_uboot.h|  217 +++
 lib_generic/vsprintf.c |   23 +
 37 files changed, 13775 insertions(+), 250 deletions(-)
 create mode 100644 common/cmd_ubi.c
 create mode 100644 drivers/mtd/mtdcore.c
 create mode 100644 drivers/mtd/mtdpart.c
 create mode 100644 drivers/mtd/ubi/Makefile
 create mode 100644 drivers/mtd/ubi/build.c
 create mode 100644 drivers/mtd/ubi/crc32.c
 create mode 100644 drivers/mtd/ubi/crc32defs.h
 create mode 100644 drivers/mtd/ubi/crc32table.h
 create mode 100644 drivers/mtd/ubi/debug.c
 create mode 100644 drivers/mtd/ubi/debug.h
 create mode 100644 drivers/mtd/ubi/eba.c
 create mode 100644 drivers/mtd/ubi/io.c
 create mode 100644 drivers/mtd/ubi/kapi.c
 create mode 100644 drivers/mtd/ubi/misc.c
 create mode 100644 drivers/mtd/ubi/scan.c
 create mode 100644 drivers/mtd/ubi/scan.h
 rename include/linux/mtd/ubi-header.h => drivers/mtd/ubi/ubi-media.h (80%)
 create mode 100644 drivers/mtd/ubi/ubi.h
 create mode 100644 drivers/mtd/ubi/upd.c
 create mode 100644 drivers/mtd/ubi/vmt.c
 create mode 100644 drivers/mtd/ubi/vtbl.c
 create mode 100644 drivers/mtd/ubi/wl.c
 create mode 100644 include/linux/crc32.h
 create mode 100644 include/linux/mtd/partitions.h
 delete mode 100644 include/linux/mtd/ubi-user.h
 create mode 100644 include/linux/mtd/ubi.h
 create mode 100644 include/mtd/ubi-user.h
 create mode 100644 include/ubi_uboot.h
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] mkimage warning: ISO C99 requires ...

2008-11-24 Thread Wolfgang Denk
Dear Bartek,

compiling U-Boot in an old OS environment (RedHat-7.3 :-) gives the
following warnigns from mkimage.[ch]:

In file included from image.c:71:
mkimage.h:41:23: warning: ISO C does not permit named variadic macros
image.c:2422:54: warning: ISO C99 requires rest arguments to be used
image.c:2840:60: warning: ISO C99 requires rest arguments to be used
image.c:2847:60: warning: ISO C99 requires rest arguments to be used
image.c:2854:67: warning: ISO C99 requires rest arguments to be used
image.c:2892:73: warning: ISO C99 requires rest arguments to be used
In file included from mkimage.c:25:
mkimage.h:41:23: warning: ISO C does not permit named variadic macros
mkimage.c:243:47: warning: ISO C99 requires rest arguments to be used
mkimage.c:622:48: warning: ISO C99 requires rest arguments to be used


Could you please have a look?  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: [EMAIL PROTECTED]
Any sufficiently advanced bug is indistinguishable from a feature.
  - Rich Kulawiec
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] FDT warning: redefinition of `uintptr_t'

2008-11-24 Thread Wolfgang Denk
Dear Jerry,

compiling U-Boot in an old OS environment (RedHat-7.3 :-) gives the
following warnigns from FDT:

include/libfdt_env.h:50: warning: redefinition of `uintptr_t'
/usr/include/stdint.h:129: warning: `uintptr_t' previously declared here


Could you please have a look?  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: [EMAIL PROTECTED]
Genitiv ins Wasser, weil's Dativ ist!
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot