[U-Boot] Please pull u-boot-staging/s...@denx.de - UPDATE

2012-01-11 Thread Stefan Roese
Hi Wolfgang,

please pull Simon's "Unified command execution in one place" patch series
plus one patch from Eric Miao:

The following changes since commit 9a4209869bd2c37affd931d627b3c3e72952:

  ARM: highbank: enable networking and pxe (2012-01-05 20:10:38 +0100)

are available in the git repository at:
  git://www.denx.de/git/u-boot-staging.git s...@denx.de

Eric Miao (1):
  net/eth.c: fix eth_write_hwaddr() to use dev->enetaddr as fall back

Simon Glass (9):
  Remove CMD_PXE's static on run_command()
  Rename run_command() to builtin_run_command()
  Rename run_command2() to run_command()
  Stop using builtin_run_command()
  Don't include standard parser if hush is used
  Create a single cmd_call() function to handle command execution
  Remove interleave of non-U-Boot code in hush
  Add cmd_process() to process commands in one place
  Convert cmd_usage() calls in common to use a return value

 arch/arm/cpu/arm926ejs/kirkwood/cpu.c |7 +--
 board/esd/common/cmd_loadpci.c|2 +-
 board/esd/du440/du440.c   |2 +-
 common/cmd_bedbug.c   |6 +-
 common/cmd_bmp.c  |6 +-
 common/cmd_boot.c |2 +-
 common/cmd_bootm.c|   10 +---
 common/cmd_cache.c|4 +-
 common/cmd_dataflash_mmc_mux.c|2 +-
 common/cmd_date.c |3 +-
 common/cmd_dcr.c  |8 +-
 common/cmd_df.c   |2 +-
 common/cmd_eeprom.c   |2 +-
 common/cmd_ext2.c |4 +-
 common/cmd_fdc.c  |2 +-
 common/cmd_fdos.c |2 +-
 common/cmd_fdt.c  |   14 ++--
 common/cmd_fitupd.c   |2 +-
 common/cmd_flash.c|   14 ++--
 common/cmd_fpga.c |4 +-
 common/cmd_gpio.c |2 +-
 common/cmd_i2c.c  |   32 +-
 common/cmd_ide.c  |   10 ++--
 common/cmd_irq.c  |2 +-
 common/cmd_itest.c|2 +-
 common/cmd_led.c  |6 +-
 common/cmd_load.c |2 +-
 common/cmd_log.c  |4 +-
 common/cmd_md5sum.c   |2 +-
 common/cmd_mdio.c |2 +-
 common/cmd_mem.c  |   22 
 common/cmd_mfsl.c |   10 ++--
 common/cmd_mgdisk.c   |2 +-
 common/cmd_mii.c  |4 +-
 common/cmd_misc.c |2 +-
 common/cmd_mmc.c  |   14 ++--
 common/cmd_mmc_spi.c  |3 +-
 common/cmd_mp.c   |8 +-
 common/cmd_mtdparts.c |2 +-
 common/cmd_nand.c |6 +-
 common/cmd_net.c  |6 +-
 common/cmd_nvedit.c   |   22 
 common/cmd_onenand.c  |   12 ++--
 common/cmd_otp.c  |2 +-
 common/cmd_pci.c  |2 +-
 common/cmd_portio.c   |4 +-
 common/cmd_pxe.c  |   10 ++--
 common/cmd_reiser.c   |4 +-
 common/cmd_sata.c |8 +-
 common/cmd_scsi.c |   15 +++--
 common/cmd_setexpr.c  |2 +-
 common/cmd_sf.c   |2 +-
 common/cmd_sha1sum.c  |2 +-
 common/cmd_source.c   |2 +-
 common/cmd_strings.c  |2 +-
 common/cmd_time.c |4 +-
 common/cmd_ubi.c  |4 +-
 common/cmd_ubifs.c|   10 ++--
 common/cmd_unzip.c|2 +-
 common/cmd_usb.c  |6 +-
 common/command.c  |   60 
 common/hush.c |   73 +++-
 common/main.c |   98 +++--
 include/command.h |   24 
 include/common.h  |5 +-
 net/eth.c |3 +-
 66 files changed, 312 insertions(+), 307 deletions(-)
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] net/eth.c: fix eth_write_hwaddr() to use dev->enetaddr as fall back

2012-01-11 Thread Stefan Roese
On Wednesday 17 August 2011 07:33:44 Eric Miao wrote:
> Ignore the return value of eth_getenv_enetaddr_by_index(), and if it
> fails, fall back to use dev->enetaddr, which could be filled up by
> the ethernet device driver.
> 
> Actually, this is the original behavior, and was later changed by
> commit 48506a2cde2458fa1f8c5993afc98e5a4617e1d3.

Applied to u-boot-staging/s...@denx.de. 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: off...@denx.de
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] net/eth.c: fix eth_write_hwaddr() to use dev->enetaddr as fall back

2012-01-11 Thread Stefan Roese
On Thursday 12 January 2012 06:12:19 Simon Glass wrote:
> On Wed, Jan 11, 2012 at 4:23 AM, Dirk Behme  wrote:
> > On 17.08.2011 08:22, Simon Glass wrote:
> >> On Tue, Aug 16, 2011 at 10:33 PM, Eric Miao  wrote:
> >>> Ignore the return value of eth_getenv_enetaddr_by_index(), and if it
> >>> fails, fall back to use dev->enetaddr, which could be filled up by
> >>> the ethernet device driver.
> >>> 
> >>> Actually, this is the original behavior, and was later changed by
> >>> commit 48506a2cde2458fa1f8c5993afc98e5a4617e1d3.
> >>> 
> >>> Signed-off-by: Eric Miao 
> >> 
> >> Hi Eric,
> >> 
> >> I found this in u-boot-usb although the commit hash I saw was 7616e7850.
> >> 
> >>> ---
> >>>  net/eth.c |3 +--
> >>>  1 files changed, 1 insertions(+), 2 deletions(-)
> >>> 
> >>> diff --git a/net/eth.c b/net/eth.c
> >>> index a34fe59..c4fbe11 100644
> >>> --- a/net/eth.c
> >>> +++ b/net/eth.c
> >>> @@ -195,8 +195,7 @@ int eth_write_hwaddr(struct eth_device *dev, const
> >>> char *base_name,
> >>>   unsigned char env_enetaddr[6];
> >>>   int ret = 0;
> >>> 
> >>> -   if (!eth_getenv_enetaddr_by_index(base_name, eth_number,
> >>> env_enetaddr))
> >>> -   return -1;
> >>> +   eth_getenv_enetaddr_by_index(base_name, eth_number,
> >>> env_enetaddr);
> >>> 
> >>>   if (memcmp(env_enetaddr, "\0\0\0\0\0\0", 6)) {
> >>>   if (memcmp(dev->enetaddr, "\0\0\0\0\0\0", 6) &&
> >> 
> >> Acked-by: Simon Glass 
> > 
> > Ping.
> > 
> > Anybody likes to apply this? Or any new comments?
> > 
> > Many thanks and best regards
> > 
> > Dirk
> > 
> > P.S.: I add Wolfgang as he seems to have done the last commits to
> > net/eth.c.
> 
> Maybe Stefan might pick it up through the staging tree?

Okay, let's take a look...

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: off...@denx.de
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] Please pull u-boot-staging/s...@denx.de

2012-01-11 Thread Stefan Roese
Hi Wolfgang,

please pull Simon's "Unified command execution in one place" patch series:

The following changes since commit 9a4209869bd2c37affd931d627b3c3e72952:

  ARM: highbank: enable networking and pxe (2012-01-05 20:10:38 +0100)

are available in the git repository at:
  git://www.denx.de/git/u-boot-staging.git s...@denx.de

Simon Glass (9):
  Remove CMD_PXE's static on run_command()
  Rename run_command() to builtin_run_command()
  Rename run_command2() to run_command()
  Stop using builtin_run_command()
  Don't include standard parser if hush is used
  Create a single cmd_call() function to handle command execution
  Remove interleave of non-U-Boot code in hush
  Add cmd_process() to process commands in one place
  Convert cmd_usage() calls in common to use a return value

 arch/arm/cpu/arm926ejs/kirkwood/cpu.c |7 +--
 board/esd/common/cmd_loadpci.c|2 +-
 board/esd/du440/du440.c   |2 +-
 common/cmd_bedbug.c   |6 +-
 common/cmd_bmp.c  |6 +-
 common/cmd_boot.c |2 +-
 common/cmd_bootm.c|   10 +---
 common/cmd_cache.c|4 +-
 common/cmd_dataflash_mmc_mux.c|2 +-
 common/cmd_date.c |3 +-
 common/cmd_dcr.c  |8 +-
 common/cmd_df.c   |2 +-
 common/cmd_eeprom.c   |2 +-
 common/cmd_ext2.c |4 +-
 common/cmd_fdc.c  |2 +-
 common/cmd_fdos.c |2 +-
 common/cmd_fdt.c  |   14 ++--
 common/cmd_fitupd.c   |2 +-
 common/cmd_flash.c|   14 ++--
 common/cmd_fpga.c |4 +-
 common/cmd_gpio.c |2 +-
 common/cmd_i2c.c  |   32 +-
 common/cmd_ide.c  |   10 ++--
 common/cmd_irq.c  |2 +-
 common/cmd_itest.c|2 +-
 common/cmd_led.c  |6 +-
 common/cmd_load.c |2 +-
 common/cmd_log.c  |4 +-
 common/cmd_md5sum.c   |2 +-
 common/cmd_mdio.c |2 +-
 common/cmd_mem.c  |   22 
 common/cmd_mfsl.c |   10 ++--
 common/cmd_mgdisk.c   |2 +-
 common/cmd_mii.c  |4 +-
 common/cmd_misc.c |2 +-
 common/cmd_mmc.c  |   14 ++--
 common/cmd_mmc_spi.c  |3 +-
 common/cmd_mp.c   |8 +-
 common/cmd_mtdparts.c |2 +-
 common/cmd_nand.c |6 +-
 common/cmd_net.c  |6 +-
 common/cmd_nvedit.c   |   22 
 common/cmd_onenand.c  |   12 ++--
 common/cmd_otp.c  |2 +-
 common/cmd_pci.c  |2 +-
 common/cmd_portio.c   |4 +-
 common/cmd_pxe.c  |   10 ++--
 common/cmd_reiser.c   |4 +-
 common/cmd_sata.c |8 +-
 common/cmd_scsi.c |   15 +++--
 common/cmd_setexpr.c  |2 +-
 common/cmd_sf.c   |2 +-
 common/cmd_sha1sum.c  |2 +-
 common/cmd_source.c   |2 +-
 common/cmd_strings.c  |2 +-
 common/cmd_time.c |4 +-
 common/cmd_ubi.c  |4 +-
 common/cmd_ubifs.c|   10 ++--
 common/cmd_unzip.c|2 +-
 common/cmd_usb.c  |6 +-
 common/command.c  |   60 
 common/hush.c |   73 +++-
 common/main.c |   98 +++--
 include/command.h |   24 
 include/common.h  |5 +-
 65 files changed, 311 insertions(+), 305 deletions(-)
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 0/9] Unified command execution in one place

2012-01-11 Thread Stefan Roese
On Saturday 10 December 2011 19:43:52 Simon Glass wrote:
> At present two parsers have similar code to execute commands. Also
> cmd_usage() is called all over the place. This series adds a single
> function which processes commands called cmd_process().
> 
> This new function understands return codes, and in particular
> CMD_RET_USAGE to indicate a usage error. So rather than calling
> cmd_usage() themselves, the command handlers can just return this
> error.
> 
> There appears to be a run_command2() which is used to run commands
> with the selected parser. This series changes this in two separate
> steps to just run_command(), and renames the old run_command() to
> builtin_run_command(). No one should call this outside main.c since
> if the hush parser is being used it is wrong to call it. The
> built-in parser code could move into a separate file perhaps in a
> future patch.
> 
> The overall series reduces code size on ARM by about 1KB on
> my ~160KB U-Boot text region when the hush parser is used, and around
> 60 bytes when it isn't.
> 
> As an aside the only user of parse_line() is fsl_ddr_interactive()
> which seems to have its own command line interface which operates
> before DRAM is set up. Do I have this right? Is there no way this
> could be done later from a normal U-Boot command?

Whole series:

Applied to u-boot-staging/s...@denx.de. 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: off...@denx.de
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/3 v7] arm926ejs: add NXP LPC32x0 cpu series support

2012-01-11 Thread Vladimir Zapolskiy

On 12.01.2012 01:51, Marek Vasut wrote:

This change adds initial support for NXP LPC32x0 SoC series.

Signed-off-by: Vladimir Zapolskiy
Cc: Albert ARIBAUD
Cc: Wolfgang Denk
---
Changes from v6 to v7:
* get use of setbits_le32() and friends
* add arch_cpu_init() routine

Changes from v5 to v6:
* replaced some spaces with tabs in macro declarations
* more rules separating 14-clock and ns16650 UARTs in config.h

Changes from v4 to v5:
* corrected address in GPLv2+ licence header in files

Changes from v3 to v4:
* extended memory controller definitions are introduced
* added print_cpuinfo() function

Changes from v2 to v3:
* checkpatch.pl reports zero errors and warnings

Changes from v1 to v2:
* BIT(n) and SBF(s, v) macro are not used anymore
* removed NS16550 and 14-clock UART definitions from uart.h
* added devices.c file, which contains standard UART preinitialization
routine * added get_serial_clock() function, it returns actual frequency
of UART clock * __udelay() realization is simplified, no need of interrupt
handling

  arch/arm/cpu/arm926ejs/lpc32xx/Makefile   |   45 +++
  arch/arm/cpu/arm926ejs/lpc32xx/clkpwr.c   |  118 +
  arch/arm/cpu/arm926ejs/lpc32xx/cpu.c  |   68 ++
  arch/arm/cpu/arm926ejs/lpc32xx/devices.c  |   52 
  arch/arm/cpu/arm926ejs/lpc32xx/timer.c|   90 +
  arch/arm/include/asm/arch-lpc32xx/clk.h   |  170
+ arch/arm/include/asm/arch-lpc32xx/config.h|
  76 +++
  arch/arm/include/asm/arch-lpc32xx/cpu.h   |   64 +
  arch/arm/include/asm/arch-lpc32xx/emc.h   |   92 +
  arch/arm/include/asm/arch-lpc32xx/sys_proto.h |   25 
  arch/arm/include/asm/arch-lpc32xx/timer.h |   74 +++
  arch/arm/include/asm/arch-lpc32xx/uart.h  |   54 
  arch/arm/include/asm/arch-lpc32xx/wdt.h   |   51 
  13 files changed, 979 insertions(+), 0 deletions(-)
  create mode 100644 arch/arm/cpu/arm926ejs/lpc32xx/Makefile
  create mode 100644 arch/arm/cpu/arm926ejs/lpc32xx/clkpwr.c
  create mode 100644 arch/arm/cpu/arm926ejs/lpc32xx/cpu.c
  create mode 100644 arch/arm/cpu/arm926ejs/lpc32xx/devices.c
  create mode 100644 arch/arm/cpu/arm926ejs/lpc32xx/timer.c
  create mode 100644 arch/arm/include/asm/arch-lpc32xx/clk.h
  create mode 100644 arch/arm/include/asm/arch-lpc32xx/config.h
  create mode 100644 arch/arm/include/asm/arch-lpc32xx/cpu.h
  create mode 100644 arch/arm/include/asm/arch-lpc32xx/emc.h
  create mode 100644 arch/arm/include/asm/arch-lpc32xx/sys_proto.h
  create mode 100644 arch/arm/include/asm/arch-lpc32xx/timer.h
  create mode 100644 arch/arm/include/asm/arch-lpc32xx/uart.h
  create mode 100644 arch/arm/include/asm/arch-lpc32xx/wdt.h

diff --git a/arch/arm/cpu/arm926ejs/lpc32xx/Makefile
b/arch/arm/cpu/arm926ejs/lpc32xx/Makefile new file mode 100644
index 000..e6222e4
--- /dev/null
+++ b/arch/arm/cpu/arm926ejs/lpc32xx/Makefile
@@ -0,0 +1,45 @@
+#
+# (C) Copyright 2000-2006
+# Wolfgang Denk, DENX Software Engineering, w...@denx.de.
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+# MA  02110-1301, USA.
+#
+
+include $(TOPDIR)/config.mk
+
+LIB = $(obj)lib$(SOC).o
+
+COBJS   = cpu.o clkpwr.o devices.o timer.o
+
+SRCS:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS:= $(addprefix $(obj),$(COBJS) $(SOBJS))
+
+all:$(obj).depend $(LIB)
+
+$(LIB): $(OBJS)
+   $(call cmd_link_o_target, $(OBJS))
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/arch/arm/cpu/arm926ejs/lpc32xx/clkpwr.c
b/arch/arm/cpu/arm926ejs/lpc32xx/clkpwr.c new file mode 100644
index 000..103157a
--- /dev/null
+++ b/arch/arm/cpu/arm926ejs/lpc32xx/clkpwr.c
@@ -0,0 +1,118 @@
+/*
+ * Copyright (C) 2011 by Vladimir Zapolskiy
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it

Re: [U-Boot] [PATCH 3/3 v4] devkit3250: add Timll DevKit3250 board initial support

2012-01-11 Thread Vladimir Zapolskiy

On 12.01.2012 01:53, Marek Vasut wrote:

This change adds a basic support for Embest/Timll DevKit3250 board,
NOR and UART are the only supported peripherals for a moment. The board
doesn't require low-level init, because the initial SDRAM and GPIO
configuration is performed during kickstart bootloader execution.

Signed-off-by: Vladimir Zapolskiy
Cc: Albert ARIBAUD
Cc: Wolfgang Denk
---
Changes from v3 to v4:
* removed dcache flushing from board_init()
* tabs instead of spaces in board config file

Changes from v2 to v3:
* updated a relocation address
* combined a record in maintainers file into the patch
* use high speed UART2 by default

Changes from v1 to v2:
* corrected address in GPLv2+ licence header in files
* removed clean and distclean targets from board makefile
* do not set machine id explicitly, if CONFIG_MACH_TYPE is defined
* minor indentation cleanups

  MAINTAINERS |4 +
  board/timll/devkit3250/Makefile |   44 +
  board/timll/devkit3250/devkit3250.c |   65 +++
  boards.cfg  |1 +
  include/configs/devkit3250.h|  121
+++ 5 files changed, 235 insertions(+), 0
deletions(-)
  create mode 100644 board/timll/devkit3250/Makefile
  create mode 100644 board/timll/devkit3250/devkit3250.c
  create mode 100644 include/configs/devkit3250.h

diff --git a/MAINTAINERS b/MAINTAINERS
index 4bf12b5..68dedae 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -914,6 +914,10 @@ Sughosh Ganu

hawkboard   ARM926EJS (OMAP-L138)

+Vladimir Zapolskiy
+
+   devkit3250  lpc32xx
+
  -

  Unknown / orphaned boards:
diff --git a/board/timll/devkit3250/Makefile
b/board/timll/devkit3250/Makefile new file mode 100644
index 000..ea7827c
--- /dev/null
+++ b/board/timll/devkit3250/Makefile
@@ -0,0 +1,44 @@
+#
+# Copyright (C) 2011 by Vladimir Zapolskiy
+# Copyright (C) 2008, Guennadi Liakhovetski
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+# MA  02110-1301, USA.
+#
+
+include $(TOPDIR)/config.mk
+
+LIB= $(obj)lib$(BOARD).o
+
+COBJS  := devkit3250.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):$(obj).depend $(OBJS) $(SOBJS)
+   $(call cmd_link_o_target, $(OBJS) $(SOBJS))
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/board/timll/devkit3250/devkit3250.c
b/board/timll/devkit3250/devkit3250.c new file mode 100644
index 000..877cd60
--- /dev/null
+++ b/board/timll/devkit3250/devkit3250.c
@@ -0,0 +1,65 @@
+/*
+ * Embest/Timll DevKit3250 board support
+ *
+ * Copyright (C) 2011 Vladimir Zapolskiy
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ */
+
+#include
+#include
+#include
+#include
+
+DECLARE_GLOBAL_DATA_PTR;
+
+static struct emc_t *emc = (struct emc_t *)EMC_BASE;
+
+int board_early_init_f(void)
+{
+   lpc32xx_uart_init(CONFIG_SYS_LPC32XX_UART);
+
+   return 0;
+}
+
+int board_init(void)
+{
+   /* adress of boot parameters */
+   gd->bd->bi_boot_params  = CONFIG_ENV_ADDR;


This is LINUX'S BOOTARGS !!


Good point, env is "nowhere", but certainly here is the wrong macro.


+
+#ifdef CONFIG_SYS_FLASH_CFI
+   /* Use 16-bit memory interface for NOR Flash */
+   emc->stat[0].config 

Re: [U-Boot] [PATCH 2/2 V4] Changes to move hawkboard to the new spl infrastructure

2012-01-11 Thread Sughosh Ganu
hi Heiko,

On Thu Jan 12, 2012 at 08:24:03AM +0100, Heiko Schocher wrote:
> Hello Sughosh,
> 
> Sughosh Ganu wrote:
> > This patch moves hawkboard to the new spl infrastructure from the
> > older nand_spl one.
> > 
> > Removed the hawkboard_nand_config build option -- The spl code now
> > gets compiled with hawkboard_config, after building the main u-boot
> > image, using the CONFIG_SPL_TEXT_BASE. Modified the README.hawkboard
> > to reflect the same.
> > 
> > Signed-off-by: Sughosh Ganu 
> > Signed-off-by: Heiko Schocher 
> > Cc: Heiko Schocher 
> > Cc: Christian Riesch 
> > Cc: Sudhakar Rajashekhara 
> > Cc: Tom Rini 
> > ---
> 
> Patch looks good to me, but it doesn't aplly to current TOT
> 
> [hs@pollux u-boot]$ git am index.html
> Applying: Changes to move hawkboard to the new spl infrastructure
> error: patch failed: include/configs/da850evm.h:44
> error: include/configs/da850evm.h: patch does not apply
> Patch failed at 0001 Changes to move hawkboard to the new spl infrastructure
> When you have resolved this problem run "git am --resolved".
> If you would prefer to skip this patch, instead run "git am --skip".
> To restore the original branch and stop patching run "git am --abort".
> [hs@pollux u-boot]$

  I have based this on u-boot-ti, as this would be applied to the ti
  tree.

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


Re: [U-Boot] [PATCH 2/2 V4] Changes to move hawkboard to the new spl infrastructure

2012-01-11 Thread Christian Riesch
Hello Heiko,

On Thu, Jan 12, 2012 at 8:24 AM, Heiko Schocher  wrote:
> Hello Sughosh,
>
> Sughosh Ganu wrote:
>> This patch moves hawkboard to the new spl infrastructure from the
>> older nand_spl one.
>>
>> Removed the hawkboard_nand_config build option -- The spl code now
>> gets compiled with hawkboard_config, after building the main u-boot
>> image, using the CONFIG_SPL_TEXT_BASE. Modified the README.hawkboard
>> to reflect the same.
>>
>> Signed-off-by: Sughosh Ganu 
>> Signed-off-by: Heiko Schocher 
>> Cc: Heiko Schocher 
>> Cc: Christian Riesch 
>> Cc: Sudhakar Rajashekhara 
>> Cc: Tom Rini 
>> ---
>
> Patch looks good to me, but it doesn't aplly to current TOT
>
> [hs@pollux u-boot]$ git am index.html
> Applying: Changes to move hawkboard to the new spl infrastructure
> error: patch failed: include/configs/da850evm.h:44
> error: include/configs/da850evm.h: patch does not apply
> Patch failed at 0001 Changes to move hawkboard to the new spl infrastructure
> When you have resolved this problem run "git am --resolved".
> If you would prefer to skip this patch, instead run "git am --skip".
> To restore the original branch and stop patching run "git am --abort".
> [hs@pollux u-boot]$
>
> My tree is
> commit 9a4209869bd2c37affd931d627b3c3e72952
> Author: Rob Herring 
> Date:   Thu Dec 15 11:15:50 2011 +
>
>ARM: highbank: enable networking and pxe
>
> Do I missing something here? (If I remember right, I had no such
> issue with your v1 patch ...)

It applies only to ti/master due to commit
1091e5a65ad2710f7e53e49dd44f9613e789f9b9 in
git://git.denx.de/u-boot-ti.git

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


Re: [U-Boot] [PATCH 2/2 V4] Changes to move hawkboard to the new spl infrastructure

2012-01-11 Thread Heiko Schocher
Hello Sughosh,

Sughosh Ganu wrote:
> This patch moves hawkboard to the new spl infrastructure from the
> older nand_spl one.
> 
> Removed the hawkboard_nand_config build option -- The spl code now
> gets compiled with hawkboard_config, after building the main u-boot
> image, using the CONFIG_SPL_TEXT_BASE. Modified the README.hawkboard
> to reflect the same.
> 
> Signed-off-by: Sughosh Ganu 
> Signed-off-by: Heiko Schocher 
> Cc: Heiko Schocher 
> Cc: Christian Riesch 
> Cc: Sudhakar Rajashekhara 
> Cc: Tom Rini 
> ---

Patch looks good to me, but it doesn't aplly to current TOT

[hs@pollux u-boot]$ git am index.html
Applying: Changes to move hawkboard to the new spl infrastructure
error: patch failed: include/configs/da850evm.h:44
error: include/configs/da850evm.h: patch does not apply
Patch failed at 0001 Changes to move hawkboard to the new spl infrastructure
When you have resolved this problem run "git am --resolved".
If you would prefer to skip this patch, instead run "git am --skip".
To restore the original branch and stop patching run "git am --abort".
[hs@pollux u-boot]$

My tree is
commit 9a4209869bd2c37affd931d627b3c3e72952
Author: Rob Herring 
Date:   Thu Dec 15 11:15:50 2011 +

ARM: highbank: enable networking and pxe

Do I missing something here? (If I remember right, I had no such
issue with your v1 patch ...)

bye,
Heiko
-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/3 v2] serial: add LPC32X0 high-speed UART devices support

2012-01-11 Thread Vladimir Zapolskiy

On 12.01.2012 01:52, Marek Vasut wrote:

This change adds an implementation of high-speed UART found on NXP
LPC32X0 SoCs. Such UARTs are enumerated as UART1, UART2 and UART7.

Signed-off-by: Vladimir Zapolskiy
Cc: Albert ARIBAUD
Cc: Wolfgang Denk
---
Changes from v1 to v2:
* simplified lpc32xx_hsuart_init() a little
* put SoC specific changes into patch 1/3

  arch/arm/include/asm/arch-lpc32xx/uart.h |   60 
  drivers/serial/Makefile  |1 +
  drivers/serial/lpc32xx_hsuart.c  |  112
++ 3 files changed, 173 insertions(+), 0
deletions(-)
  create mode 100644 drivers/serial/lpc32xx_hsuart.c

diff --git a/arch/arm/include/asm/arch-lpc32xx/uart.h
b/arch/arm/include/asm/arch-lpc32xx/uart.h index 3c7e561..cb4853c 100644
--- a/arch/arm/include/asm/arch-lpc32xx/uart.h
+++ b/arch/arm/include/asm/arch-lpc32xx/uart.h
@@ -22,6 +22,66 @@

  #include

+/* 14-clock UART Registers */
+struct hsuart_t {
+   union {
+   u32 rx; /* Receiver FIFO*/
+   u32 tx; /* Transmitter FIFO */
+   };
+   u32 level;  /* FIFO Level Register  */
+   u32 iir;/* Interrupt ID Register*/
+   u32 ctrl;   /* Control Register */
+   u32 rate;   /* Rate Control Register*/
+};
+
+/* 14-clock UART Receiver FIFO Register bits */
+#define HSUART_RX_BREAK(1<<  10)
+#define HSUART_RX_ERROR(1<<  9)
+#define HSUART_RX_EMPTY(1<<  8)
+#define HSUART_RX_DATA (0xff<<  0)
+
+/* 14-clock UART Level Register bits */
+#define HSUART_LEVEL_TX(0xff<<  8)
+#define HSUART_LEVEL_RX(0xff<<  0)
+
+/* 14-clock UART Interrupt Identification Register bits */
+#define HSUART_IIR_TX_INT_SET  (1<<  6)
+#define HSUART_IIR_RX_OE   (1<<  5)
+#define HSUART_IIR_BRK (1<<  4)
+#define HSUART_IIR_FE  (1<<  3)
+#define HSUART_IIR_RX_TIMEOUT  (1<<  2)
+#define HSUART_IIR_RX_TRIG (1<<  1)
+#define HSUART_IIR_TX  (1<<  0)
+
+/* 14-clock UART Control Register bits */
+#define HSUART_CTRL_HRTS_INV   (1<<  21)
+#define HSUART_CTRL_HRTS_TRIG_48   (0x3<<  19)
+#define HSUART_CTRL_HRTS_TRIG_32   (0x2<<  19)
+#define HSUART_CTRL_HRTS_TRIG_16   (0x1<<  19)
+#define HSUART_CTRL_HRTS_TRIG_8(0x0<<  19)
+#define HSUART_CTRL_HRTS_EN(1<<  18)
+#define HSUART_CTRL_TMO_16 (0x3<<  16)
+#define HSUART_CTRL_TMO_8  (0x2<<  16)
+#define HSUART_CTRL_TMO_4  (0x1<<  16)
+#define HSUART_CTRL_TMO_DISABLED   (0x0<<  16)
+#define HSUART_CTRL_HCTS_INV   (1<<  15)
+#define HSUART_CTRL_HCTS_EN(1<<  14)
+#define HSUART_CTRL_HSU_OFFSET(n)  ((n)<<  9)
+#define HSUART_CTRL_HSU_BREAK  (1<<  8)
+#define HSUART_CTRL_HSU_ERR_INT_EN (1<<  7)
+#define HSUART_CTRL_HSU_RX_INT_EN  (1<<  6)
+#define HSUART_CTRL_HSU_TX_INT_EN  (1<<  5)
+#define HSUART_CTRL_HSU_RX_TRIG_48 (0x5<<  2)
+#define HSUART_CTRL_HSU_RX_TRIG_32 (0x4<<  2)
+#define HSUART_CTRL_HSU_RX_TRIG_16 (0x3<<  2)
+#define HSUART_CTRL_HSU_RX_TRIG_8  (0x2<<  2)
+#define HSUART_CTRL_HSU_RX_TRIG_4  (0x1<<  2)
+#define HSUART_CTRL_HSU_RX_TRIG_1  (0x0<<  2)
+#define HSUART_CTRL_HSU_TX_TRIG_16 (0x3<<  0)
+#define HSUART_CTRL_HSU_TX_TRIG_8  (0x2<<  0)
+#define HSUART_CTRL_HSU_TX_TRIG_4  (0x1<<  0)
+#define HSUART_CTRL_HSU_TX_TRIG_0  (0x0<<  0)
+
  /* UART Control Registers */
  struct uart_ctrl_t {
u32 ctrl;   /* Control Register */
diff --git a/drivers/serial/Makefile b/drivers/serial/Makefile
index 616b857..65d0f23 100644
--- a/drivers/serial/Makefile
+++ b/drivers/serial/Makefile
@@ -29,6 +29,7 @@ COBJS-$(CONFIG_ALTERA_UART) += altera_uart.o
  COBJS-$(CONFIG_ALTERA_JTAG_UART) += altera_jtag_uart.o
  COBJS-$(CONFIG_ARM_DCC) += arm_dcc.o
  COBJS-$(CONFIG_ATMEL_USART) += atmel_usart.o
+COBJS-$(CONFIG_LPC32XX_HSUART) += lpc32xx_hsuart.o
  COBJS-$(CONFIG_MCFUART) += mcfuart.o
  COBJS-$(CONFIG_NS9750_UART) += ns9750_serial.o
  COBJS-$(CONFIG_OPENCORES_YANU) += opencores_yanu.o
diff --git a/drivers/serial/lpc32xx_hsuart.c
b/drivers/serial/lpc32xx_hsuart.c new file mode 100644
index 000..052b0d8
--- /dev/null
+++ b/drivers/serial/lpc32xx_hsuart.c
@@ -0,0 +1,112 @@
+/*
+ * Copyright (C) 2011 Vladimir Zapolskiy
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTAB

Re: [U-Boot] [PATCH v2 0/9] Unified command execution in one place

2012-01-11 Thread Stefan Roese
Hi Simon,

On Thursday 12 January 2012 05:37:00 Simon Glass wrote:
> Hi,
> 
> On Sat, Dec 10, 2011 at 10:43 AM, Simon Glass  wrote:
> > At present two parsers have similar code to execute commands. Also
> > cmd_usage() is called all over the place. This series adds a single
> > function which processes commands called cmd_process().
> > 
> > This new function understands return codes, and in particular
> > CMD_RET_USAGE to indicate a usage error. So rather than calling
> > cmd_usage() themselves, the command handlers can just return this
> > error.
> > 
> > There appears to be a run_command2() which is used to run commands
> > with the selected parser. This series changes this in two separate
> > steps to just run_command(), and renames the old run_command() to
> > builtin_run_command(). No one should call this outside main.c since
> > if the hush parser is being used it is wrong to call it. The
> > built-in parser code could move into a separate file perhaps in a
> > future patch.
> > 
> > The overall series reduces code size on ARM by about 1KB on
> > my ~160KB U-Boot text region when the hush parser is used, and around
> > 60 bytes when it isn't.
> > 
> > As an aside the only user of parse_line() is fsl_ddr_interactive()
> > which seems to have its own command line interface which operates
> > before DRAM is set up. Do I have this right? Is there no way this
> > could be done later from a normal U-Boot command?
> > 
> > (I have run this through MAKEALL and it seems clean)
> > 
> > Changes in v2:
> > - Fix minor errors one of which created a warning
> > - Squash i2c patch into the common/ patch
> > 
> > Simon Glass (9):
> >  Remove CMD_PXE's static on run_command()
> >  Rename run_command() to builtin_run_command()
> >  Rename run_command2() to run_command()
> >  Stop using builtin_run_command()
> >  Don't include standard parser if hush is used
> >  Create a single cmd_call() function to handle command execution
> >  Remove interleave of non-U-Boot code in hush
> >  Add cmd_process() to process commands in one place
> >  Convert cmd_usage() calls in common to use a return value
> 
> Does any of the maintainers feel inclined to pick up these patches? It
> still seems to rebase cleanly against master, so it might be ok as is,
> but happy to resend if needed.

Looking into it right now. Stay tuned...
 
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: off...@denx.de
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2 V2] arm926: Flush the data cache before disabling it.

2012-01-11 Thread Sughosh Ganu
On Wed Jan 11, 2012 at 07:50:50PM +0100, Marek Vasut wrote:
> > On Wed Jan 11, 2012 at 04:01:31PM +0100, Marek Vasut wrote:
> > > >   More so, given the fact that we don't have any control over
> > > >   rbl -- so if rbl changes it's layout for any subsequent board, we'd
> > > >   have to add that as well to the nand driver, and both in u-boot as
> > > >   well as the kernel.
> > > >   
> > > >   I guess the cleanest solution would have been for the rbl to have
> > > >   used the same layout as the one used by u-boot and linux.
> > > 
> > > Yep, why not do that then?
> > 
> >   Because rbl is a proprietary bootloader from TI.
> 
> Don't we actually have replacement bootloader in uboot already ? You don't 
> need 
> xloader with uboot anymore I think.

  No, this rbl resides in the rom area on the SOC and cannot be done
  away with.

> > 
> > > >   Btw, can you please review this change, that this patch
> > > >   fixes. ACK/NAK?
> > > 
> > > I'll think about it. It's ok, but it piles one workaround on top of
> > > another one, I don't like that approach.
> > 
> >   Flushing the data cache before disabling it is not a workaround,
> >   it's a fix. The current code is invalidating the cache instead of
> >   flushing it.
> 
> Ok, but I'd like to see proper solution eventually.

  I think patch holds true irrespective of whether we rbl boots spl,
  or u-boot.

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


Re: [U-Boot] [PATCH] nand_spl: store ecc data on the stack

2012-01-11 Thread Stefan Roese
On Wednesday 11 January 2012 23:34:35 Scott Wood wrote:
> Adapt the following patch from spl to nand_spl:
> 
>   Author: Stefano Babic 
>   Date:   Thu Dec 15 10:55:37 2011 +0100
> 
>   nand_spl_simple: store ecc data on the stack
> 
>   Currently nand_spl_simple puts it's temp data at 0x1 offset in
> SDRAM which is likely to contain already loaded data.
>   The patch saves the oob data and the ecc on the stack replacing
>   the fixed address in RAM.
> 
>   Signed-off-by: Stefano Babic 
>   CC: Ilya Yanok 
>   CC: Scott Wood 
>   CC: Tom Rini 
>   CC: Simon Schwarz 
>   CC: Wolfgang Denk 
>   Signed-off-by: Scott Wood 
> 
> While nand_spl is on its way out, in favor of spl, there are still
> many boards using it, and conversions are gradual.  This allows us
> to get rid of CONFIG_SYS_NAND_ECCSTEPS and CONFIG_SYS_NAND_ECCTOTAL now,
> which would otherwise be likely to linger unreferenced after a conversion.
> 
> It also eliminates a temporary error in the hawkboard_nand build, since
> the spl version of the patch removed ECCSTEPS/TOTAL from hawkboard.h, but
> the spl conversion is pending (and may be merged via a different tree).

Thanks Scott.

Tested on kilauea_nand, so:

Tested-by: Stefan Roese 

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: off...@denx.de
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2 V2] arm926: Flush the data cache before disabling it.

2012-01-11 Thread Sughosh Ganu
On Thu Jan 12, 2012 at 06:56:01AM +0100, Christian Riesch wrote:
> On Wednesday, January 11, 2012, Marek Vasut  wrote:



> >> RBL executes an AIS script. Sughosh, could you please explain what your
> AIS
> >> does or how you create it?
> >
> > So basically, this SPL business can be avoided and this all can be done
> in a
> > standard way?
> 
> I don't know, I never had to deal with booting from NAND. I was just
> wondering what Sughosh's AIS is doing that he gets these SPL problems.
> Christian

  I have checked my ais ini file, and it does the normal pll/ddr
  settings. I think it is the rbl which might be turning the cache
  ON. In any case, this patch holds true irrespective of whether rbl
  boots u-boot or spl.

  As for the question of doing away with spl and booting u-boot
  directly on hawkboard, i would want to stay with spl for now. I
  would check if we can pass the ecc layout to the nand driver in a
  clean elegant way, as Marek has suggested.
  
-sughosh
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2 V2] arm926: Flush the data cache before disabling it.

2012-01-11 Thread Christian Riesch
On Wednesday, January 11, 2012, Marek Vasut  wrote:
>> Hi,
>>
>> On Wednesday, January 11, 2012, Marek Vasut 
wrote:
>> >> On Wed Jan 11, 2012 at 04:01:31PM +0100, Marek Vasut wrote:
>> >> > >   More so, given the fact that we don't have any control over
>> >> > >   rbl -- so if rbl changes it's layout for any subsequent board,
>> >> > >   we'd have to add that as well to the nand driver, and both in
>> >> > >   u-boot as well as the kernel.
>> >> > >
>> >> > >   I guess the cleanest solution would have been for the rbl to
have
>> >> > >   used the same layout as the one used by u-boot and linux.
>> >> >
>> >> > Yep, why not do that then?
>> >> >
>> >>   Because rbl is a proprietary bootloader from TI.
>> >
>> > Don't we actually have replacement bootloader in uboot already ? You
>>
>> don't need
>>
>> > xloader with uboot anymore I think.
>>
>> RBL ist the ROM bootloader in the SoC, it's not only proprietary but also
>> in ROM and hence cannot be changed.
>>
>> RBL executes an AIS script. Sughosh, could you please explain what your
AIS
>> does or how you create it?
>
> So basically, this SPL business can be avoided and this all can be done
in a
> standard way?

I don't know, I never had to deal with booting from NAND. I was just
wondering what Sughosh's AIS is doing that he gets these SPL problems.
Christian
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 1/4] ehci-omap: Clean up added ehci-omap.c

2012-01-11 Thread Govindraj
Hi Igor,

On Wed, Jan 11, 2012 at 8:33 PM, Igor Grinberg  wrote:
> Hi Guys,
>
> On 01/11/12 16:34, Marek Vasut wrote:
>>> On Wed, Jan 11, 2012 at 6:58 PM, Marek Vasut  wrote:
> On Wed, Jan 11, 2012 at 6:16 PM, Marek Vasut  
> wrote:
>>> On Wed, Jan 11, 2012 at 4:22 PM, Marek Vasut 
>> wrote:
> Hi Marek,
>
> Thanks for you review.
>
> On Tue, Jan 10, 2012 at 9:37 PM, Marek Vasut
> 

 wrote:
>>> From: "Govindraj.R" 
>>>
>>> Clean up added ehci-omap.c and make it generic for re-use
>>> across soc having same ehci ip block. Also pass the modes to
>>> be configured and configure the ports accordingly. All usb
>>> layers are not cache aligned till then keep cache off for usb
>>> ops as ehci will use internally dma for all usb ops.
>>>
>>> * Add a generic common header ehci-omap.h having common ip
>>> block data and reg shifts.
>>> * Rename and modify ehci-omap3 to ehci.h retain only
>>> conflicting sysc reg shifts remove others and move to common
>>> header file.
>>
>> Don't reimplement the ulpi stuff ... there's already some ulpi
>> stuff in uboot that needs fixing, so fix it and use it.
>
> I am not implementing any ulpi stuff I am just configuring OMAP on
> soc usb host controller (ehci). All the configuration stuff
> is OMAP specific things which are done in ehci-omap.c file
>
> stuffs done are like soft-reset, port mode to be used and putting
> port in no -idle mode(omap specific pm implementation) etc.

 This stuff:

 +/* ULPI */
 +#define ULPI_SET(a)                                    (a + 1)
 +#define ULPI_CLR(a)                                    (a + 2)
 +#define ULPI_FUNC_CTRL                                 0x04
 +#define ULPI_FUNC_CTRL_RESET                           (1 << 5)

 is just accidentally conforming to ULPI spec?
>>>
>>> These are for configuring INSNREG05_ULPI reg in EHCI reg map
>>> of omap while configuring in ulpi-phy mode.
>>>
>>> looking into struct ulpi_regs {..}
>>> then it doesn't map this configuration.
>>
>> Can you point me to some documentation about this please? It's not
>> that I don't trust you, I'd rather prefer to avoid unnecessary
>> duplication.
>
> Yes that would be fine.
>
> You can download the omap4460 public trm from here:
>
> http://www.ti.com/pdfs/wtbu/OMAP4460_ES.1x_PUBLIC_TRM_vM.zip
>
> Go to chapter 23.11.6.6.1 EHCI Register Summary
> (page number 5171 and 5186/87)

 Sure, but the macro above looks more like 23.11.6.3, doesn't it ? And for
 that purpose, the struct ulpi_regs is fitting ok.

 Actually ... can you check the ulpi_read and ulpi_write stuff that's
 already in u-boot and explain why they can not be used with this port?
>>>
>>> echi-omap.c is no where writing to those registers
>>> and the macro was used only to configure INSNREG05_ULPI reg in EHCI reg map
>>>
>>> reg map in 23.11.6.3 used only for a external ulpi-phy communication.
>>> and debug purpose(to view vid, pid etc) and to hack external phy
>>> configuration through ulpi commands
>>> from omap - usb host controller point of view only needs
>>> INSNREG05_ULPI reg in EHCI reg configuration
>>> rest on soc host controller takes care of it.
>>
>> Can someone else comment on this? I think I don't understand well (as I'm not
>> OMAP guy).
>
> Well, it is on my list, actually,
> but I will be able to get to it only in a couple of days.
> (I'm really busy right now).
>

Could you please let me know what exactly that you will be
updating?

So that I can accordingly post my v3 of this patch fixing comments
from Marek Vasut 

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


Re: [U-Boot] [RFC PATCH v2 13/15] bootstage: Add microsecond boot time measurement

2012-01-11 Thread Simon Glass
Hi Mike,

On Mon, Jan 9, 2012 at 9:33 AM, Mike Frysinger  wrote:
> On Sunday 08 January 2012 12:42:02 Simon Glass wrote:
>> On Sun, Jan 8, 2012 at 12:35 AM, Mike Frysinger wrote:
>> > On Saturday 10 December 2011 16:08:05 Simon Glass wrote:
>> >> --- a/include/bootstage.h
>> >> +++ b/include/bootstage.h
>> >>
>> >> +static inline ulong bootstage_mark(enum bootstage_id id)
>> >>  {
>> >> -     show_boot_progress(-val);
>> >> +#ifdef CONFIG_SHOW_BOOT_PROGRESS
>> >> +     show_boot_progress(id);
>> >> +#endif
>> >> +     return 0;
>> >>  }
>> >>
>> >> +static inline ulong bootstage_error(enum bootstage_id id)
>> >> +{
>> >> +#ifdef CONFIG_SHOW_BOOT_PROGRESS
>> >> +     show_boot_progress(-id);
>> >> +#endif
>> >> +     return 0;
>> >> +}
>> >
>> > why isn't show_boot_progress() just a stub when CONFIG_SHOW_BOOT_PROGRESS
>> > isn't defined ?  then you don't have to protect the call sites.
>>
>> show_boot_progress() has been part of U-Boot for a while. Quite a lot
>> of boards define this function with the expectation that they can turn
>> CONFIG_SHOW_BOOT_PROGRESS on and off independently. So If I do what
>> you suggest I will break that expectation.
>>
>> One fix would be to bracket all show_boot_progress() function
>> implementations in the boards with CONFIG_SHOW_BOOT_PROGRESS, but I
>> haven't done that.
>
> it seemed like part of your clean up series was to merge show_boot_progress()
> into your new bootstage framework.  in which case, we have full control over
> it now, and ifdef bracketing for it should go away ...

Still don't quite get it though. For example, the beagle board defines
show_boot_progress() but does not define CONFIG_SHOW_BOOT_PROGRESS, so
wouldn't that break that board?

The series as is was tested MAKEALL clean.

Regards,
Simon

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


Re: [U-Boot] [RFC PATCH v2 15/15] bootstage: arm: Add bootstage calls in board and bootm

2012-01-11 Thread Simon Glass
Hi Mike,

On Mon, Jan 9, 2012 at 9:31 AM, Mike Frysinger  wrote:
> On Sunday 08 January 2012 18:48:18 Simon Glass wrote:
>> On Sun, Jan 8, 2012 at 11:58 AM, Mike Frysinger wrote:
>> > On Sunday 08 January 2012 12:43:09 Simon Glass wrote:
>> >> On Sun, Jan 8, 2012 at 12:36 AM, Mike Frysinger wrote:
>> >> > On Saturday 10 December 2011 16:08:07 Simon Glass wrote:
>> >> >> --- a/arch/arm/lib/bootm.c
>> >> >> +++ b/arch/arm/lib/bootm.c
>> >> >>
>> >> >>  static void announce_and_cleanup(void)
>> >> >>  {
>> >> >>       printf("\nStarting kernel ...\n\n");
>> >> >> +     bootstage_mark_name(BOOTSTAGE_ID_BOOTM_HANDOFF,
>> >> >> "start_kernel"); +#ifdef CONFIG_BOOTSTAGE_REPORT
>> >> >> +     bootstage_report();
>> >> >> +#endif
>> >> >
>> >> > shouldn't the header make bootstage_report() into a stub when
>> >> > CONFIG_BOOTSTAGE_REPORT isn't defined ?  then you won't need the ifdef
>> >> > protection here.
>> >>
>> >> Well maybe. I am hoping for a link error if someone calls it without
>> >> defining that CONFIG. Otherwise it could be very confusing for people
>> >> that they can't get a report!
>> >
>> > i'm not sure we need worry about that
>>
>> I have had another look at this. The idea is that anyone can call
>> bootstage_report() to get a report, but if they define
>> CONFIG_BOOTSTAGE_REPORT then one is printing automatically by U-Boot
>> just before jumping to the kernel.
>>
>> So I don't want this define to remove the ability to print a report,
>> just to enable printing a report at a time which is hopefully
>> suitable.
>>
>> Does that make sense?
>
> ok, so we have:
> #ifdef CONFIG_BOOTSTAGE
> extern void bootstage_report(void);
> #else
> #define bootstage_report()
> #endif
>
> and CONFIG_BOOTSTAGE_REPORT controls the automatic calls to the report func
>
> is the arm-specific bootm hooks the best place for this ?  wouldn't putting
> this into the common bootm code be better ?

Well the intent is to do this at the last moment. I actually have a
patch which does a 'fake' run through all the bootm code and does the
report after that, so we see everything that is happening before we
settle on and print out our timings.

announce_and_cleanup() is about as close to the end as I can get :-)

Regards,
Simon


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


Re: [U-Boot] bootm not taking dtb

2012-01-11 Thread Wolfgang Denk
Dear JR Rivers,

In message  you wrote:
> 
> The uboot version is... U-Boot 2009.06 (Apr 19 2011 - 12:54:10).  It came 
> with the system and we're loading a new kernel/rootfs on to it.

2.5 years old ==> update

Which board is this?

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
The C-shell doesn't parse. It adhoculates.
- casper@holland.sun.com in <3ol96k$b...@engnews2.eng.sun.com>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] bootm not taking dtb

2012-01-11 Thread Wolfgang Denk
Dear JR Rivers,

In message  you wrote:
> 
> I am working with a powerpc embedded system where u-boot seems to be passing 
> in a constructed fdt (or one embedded in u-boot) as opposed to one that is 
> either passed directly to bootm or as the third image of a multi-file image.

And which exact version of U-Boot is this? Please also provide the
commit ID printed with the version string.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
If the hours are long enough and the pay  is  short  enough,  someone
will say it's women's work.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] net/eth.c: fix eth_write_hwaddr() to use dev->enetaddr as fall back

2012-01-11 Thread Simon Glass
On Wed, Jan 11, 2012 at 4:23 AM, Dirk Behme  wrote:
> On 17.08.2011 08:22, Simon Glass wrote:
>>
>> On Tue, Aug 16, 2011 at 10:33 PM, Eric Miao  wrote:
>>>
>>> Ignore the return value of eth_getenv_enetaddr_by_index(), and if it
>>> fails, fall back to use dev->enetaddr, which could be filled up by
>>> the ethernet device driver.
>>>
>>> Actually, this is the original behavior, and was later changed by
>>> commit 48506a2cde2458fa1f8c5993afc98e5a4617e1d3.
>>>
>>> Signed-off-by: Eric Miao 
>>
>>
>> Hi Eric,
>>
>> I found this in u-boot-usb although the commit hash I saw was 7616e7850.
>>
>>> ---
>>>  net/eth.c |    3 +--
>>>  1 files changed, 1 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/net/eth.c b/net/eth.c
>>> index a34fe59..c4fbe11 100644
>>> --- a/net/eth.c
>>> +++ b/net/eth.c
>>> @@ -195,8 +195,7 @@ int eth_write_hwaddr(struct eth_device *dev, const
>>> char *base_name,
>>>       unsigned char env_enetaddr[6];
>>>       int ret = 0;
>>>
>>> -       if (!eth_getenv_enetaddr_by_index(base_name, eth_number,
>>> env_enetaddr))
>>> -               return -1;
>>> +       eth_getenv_enetaddr_by_index(base_name, eth_number,
>>> env_enetaddr);
>>>
>>>       if (memcmp(env_enetaddr, "\0\0\0\0\0\0", 6)) {
>>>               if (memcmp(dev->enetaddr, "\0\0\0\0\0\0", 6) &&
>>
>>
>> Acked-by: Simon Glass 
>
>
> Ping.
>
> Anybody likes to apply this? Or any new comments?
>
> Many thanks and best regards
>
> Dirk
>
> P.S.: I add Wolfgang as he seems to have done the last commits to net/eth.c.

Maybe Stefan might pick it up through the staging tree?

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


Re: [U-Boot] [PATCH v2 17/17] x86: Convert board_init_f_r to a processing loop

2012-01-11 Thread Simon Glass
On Wed, Jan 4, 2012 at 11:59 AM, Graeme Russ  wrote:
> Create an init function array for board_init_f_r - This finalises the
> migration to a purely array based initialisation mechanism
>
> Also tweak a few comments while we are at it so everything is 'correct'
>
> Signed-off-by: Graeme Russ 

Acked-by: Simon Glass 

> ---
> Changes for v2:
>  - Renamed to a more apt name
>  - Fix bug in set_reloc_flag_r
>  - Re-instate gd->flags = boot_flags; in board_init_f
>  - Added commit message
>
>  arch/x86/include/asm/init_helpers.h |    5 +
>  arch/x86/include/asm/relocate.h     |   33 ++
>  arch/x86/lib/board.c                |  186 
> +--
>  arch/x86/lib/init_helpers.c         |   75 ++
>  arch/x86/lib/relocate.c             |   32 +-
>  5 files changed, 206 insertions(+), 125 deletions(-)
>  create mode 100644 arch/x86/include/asm/relocate.h
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 16/17] x86: Split init functions out of board.c

2012-01-11 Thread Simon Glass
On Wed, Jan 4, 2012 at 11:59 AM, Graeme Russ  wrote:
> This patch moves towards reducing board.c to simply a set of init cores for
> the three initialisation phases (Flash, Flash/RAM, and RAM), a set of three
> init function arrays and a init function array processing function
>
> Signed-off-by: Graeme Russ 

Acked-by: Simon Glass 

> ---
> Changes for v2:
>  - Changes patch title
>  - Tweak commit message
>
>  arch/x86/include/asm/init_helpers.h  |   39 +
>  arch/x86/include/asm/init_wrappers.h |   42 +
>  arch/x86/lib/Makefile                |    2 +
>  arch/x86/lib/board.c                 |  297 
> +-
>  arch/x86/lib/init_helpers.c          |  142 
>  arch/x86/lib/init_wrappers.c         |  137 
>  6 files changed, 438 insertions(+), 221 deletions(-)
>  create mode 100644 arch/x86/include/asm/init_helpers.h
>  create mode 100644 arch/x86/include/asm/init_wrappers.h
>  create mode 100644 arch/x86/lib/init_helpers.c
>  create mode 100644 arch/x86/lib/init_wrappers.c
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 15/17] x86: Move relocation code out of board.c

2012-01-11 Thread Simon Glass
On Wed, Jan 4, 2012 at 11:59 AM, Graeme Russ  wrote:
> Signed-off-by: Graeme Russ 

Acked-by: Simon Glass 

> ---
> Changes for v2:
>  - None
>
>  arch/x86/lib/Makefile   |    1 +
>  arch/x86/lib/board.c    |   69 +---
>  arch/x86/lib/relocate.c |  115 
> +++
>  3 files changed, 118 insertions(+), 67 deletions(-)
>  create mode 100644 arch/x86/lib/relocate.c
>
> diff --git a/arch/x86/lib/Makefile b/arch/x86/lib/Makefile
> index 7820895..57b6896 100644
> --- a/arch/x86/lib/Makefile
> +++ b/arch/x86/lib/Makefile
> @@ -40,6 +40,7 @@ COBJS-$(CONFIG_SYS_GENERIC_TIMER) += pcat_timer.o
>  COBJS-$(CONFIG_PCI) += pci.o
>  COBJS-$(CONFIG_PCI) += pci_type1.o
>  COBJS-$(CONFIG_SYS_X86_REALMODE)       += realmode.o
> +COBJS-y        += relocate.o
>  COBJS-y        += string.o
>  COBJS-$(CONFIG_SYS_X86_ISR_TIMER)      += timer.o
>  COBJS-$(CONFIG_VIDEO)  += video_bios.o
> diff --git a/arch/x86/lib/board.c b/arch/x86/lib/board.c
> index 416aa9e..bebb347 100644
> --- a/arch/x86/lib/board.c
> +++ b/arch/x86/lib/board.c
> @@ -41,7 +41,6 @@
>  #include 
>  #include 
>  #include 
> -#include 
>  #include 
>
>  #ifdef CONFIG_BITBANGMII
> @@ -117,9 +116,6 @@ static void display_flash_config(ulong size)
>  typedef int (init_fnc_t) (void);
>
>  static int calculate_relocation_address(void);
> -static int copy_uboot_to_ram(void);
> -static int clear_bss(void);
> -static int do_elf_reloc_fixups(void);
>  static int copy_gd_to_ram(void);
>
>  init_fnc_t *init_sequence_f[] = {
> @@ -183,59 +179,6 @@ static int calculate_relocation_address(void)
>        return 0;
>  }
>
> -static int copy_uboot_to_ram(void)
> -{
> -       size_t len = (size_t)&__data_end - (size_t)&__text_start;
> -
> -       memcpy((void *)gd->relocaddr, (void *)&__text_start, len);
> -
> -       return 0;
> -}
> -
> -static int clear_bss(void)
> -{
> -       ulong dst_addr = (ulong)&__bss_start + gd->reloc_off;
> -       size_t len = (size_t)&__bss_end - (size_t)&__bss_start;
> -
> -       memset((void *)dst_addr, 0x00, len);
> -
> -       return 0;
> -}
> -
> -static int do_elf_reloc_fixups(void)
> -{
> -       Elf32_Rel *re_src = (Elf32_Rel *)(&__rel_dyn_start);
> -       Elf32_Rel *re_end = (Elf32_Rel *)(&__rel_dyn_end);
> -
> -       Elf32_Addr *offset_ptr_rom;
> -       Elf32_Addr *offset_ptr_ram;
> -
> -       /* The size of the region of u-boot that runs out of RAM. */
> -       uintptr_t size = (uintptr_t)&__bss_end - (uintptr_t)&__text_start;
> -
> -       do {
> -               /* Get the location from the relocation entry */
> -               offset_ptr_rom = (Elf32_Addr *)re_src->r_offset;
> -
> -               /* Check that the location of the relocation is in .text */
> -               if (offset_ptr_rom >= (Elf32_Addr *)CONFIG_SYS_TEXT_BASE) {
> -
> -                       /* Switch to the in-RAM version */
> -                       offset_ptr_ram = (Elf32_Addr *)((ulong)offset_ptr_rom 
> +
> -                                                       gd->reloc_off);
> -
> -                       /* Check that the target points into .text */
> -                       if (*offset_ptr_ram >= CONFIG_SYS_TEXT_BASE &&
> -                                       *offset_ptr_ram <
> -                                       (CONFIG_SYS_TEXT_BASE + size)) {
> -                               *offset_ptr_ram += gd->reloc_off;
> -                       }
> -               }
> -       } while (re_src++ < re_end);
> -
> -       return 0;
> -}
> -
>  /* Load U-Boot into RAM, initialize BSS, perform relocation adjustments */
>  void board_init_f(ulong boot_flags)
>  {
> @@ -270,17 +213,9 @@ void board_init_f_r(void)
>        if (init_cache() != 0)
>                hang();
>
> -       copy_uboot_to_ram();
> -       clear_bss();
> -       do_elf_reloc_fixups();
> -
> -       /*
> -        * Transfer execution from Flash to RAM by calculating the address
> -        * of the in-RAM copy of board_init_r() and calling it
> -        */
> -       (board_init_r + gd->reloc_off)(gd, gd->relocaddr);
> +       relocate_code(0, gd, 0);
>
> -       /* NOTREACHED - board_init_r() does not return */
> +       /* NOTREACHED - relocate_code() does not return */
>        while (1)
>                ;
>  }
> diff --git a/arch/x86/lib/relocate.c b/arch/x86/lib/relocate.c
> new file mode 100644
> index 000..badb5f8
> --- /dev/null
> +++ b/arch/x86/lib/relocate.c
> @@ -0,0 +1,115 @@
> +/*
> + * (C) Copyright 2008-2011
> + * Graeme Russ, 
> + *
> + * (C) Copyright 2002
> + * Daniel Engström, Omicron Ceti AB, 
> + *
> + * (C) Copyright 2002
> + * Wolfgang Denk, DENX Software Engineering, 
> + *
> + * (C) Copyright 2002
> + * Sysgo Real-Time Solutions, GmbH 
> + * Marius Groeger 
> + *
> + * See file CREDITS for list of people who contributed to this
> + * project.
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License as
> + * published by the 

Re: [U-Boot] [PATCH v2 14/17] x86: Move setup_pcat_compatibility() out of board.c

2012-01-11 Thread Simon Glass
On Wed, Jan 4, 2012 at 11:59 AM, Graeme Russ  wrote:
> This function simply does not belong in board.c
>
> Signed-off-by: Graeme Russ 

Acked-by: Simon Glass 

> ---
> Changes for v2:
>  - Added commit message
>
>  arch/x86/lib/board.c  |    7 ---
>  arch/x86/lib/zimage.c |    7 +++
>  2 files changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/arch/x86/lib/board.c b/arch/x86/lib/board.c
> index aaffd1b..416aa9e 100644
> --- a/arch/x86/lib/board.c
> +++ b/arch/x86/lib/board.c
> @@ -486,10 +486,3 @@ void hang(void)
>        for (;;)
>                ;
>  }
> -
> -void setup_pcat_compatibility(void)
> -       __attribute__((weak, alias("__setup_pcat_compatibility")));
> -
> -void __setup_pcat_compatibility(void)
> -{
> -}
> diff --git a/arch/x86/lib/zimage.c b/arch/x86/lib/zimage.c
> index bb40517..2214286 100644
> --- a/arch/x86/lib/zimage.c
> +++ b/arch/x86/lib/zimage.c
> @@ -314,6 +314,13 @@ void boot_zimage(void *setup_base, void *load_address)
>  #endif
>  }
>
> +void setup_pcat_compatibility(void)
> +       __attribute__((weak, alias("__setup_pcat_compatibility")));
> +
> +void __setup_pcat_compatibility(void)
> +{
> +}
> +
>  int do_zboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
>  {
>        struct boot_params *base_ptr;
> --
> 1.7.5.2.317.g391b14
>
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 13/17] x86: Move do_go_exec() out of board.c

2012-01-11 Thread Simon Glass
On Wed, Jan 4, 2012 at 11:59 AM, Graeme Russ  wrote:
> Signed-off-by: Graeme Russ 

Acked-by: Simon Glass 

> ---
> Changes for v2:
>  - None
>
>  arch/x86/lib/Makefile   |    1 +
>  arch/x86/lib/board.c    |   27 ---
>  arch/x86/lib/cmd_boot.c |   64 
> +++
>  3 files changed, 65 insertions(+), 27 deletions(-)
>  create mode 100644 arch/x86/lib/cmd_boot.c
>
> diff --git a/arch/x86/lib/Makefile b/arch/x86/lib/Makefile
> index d584aa4..7820895 100644
> --- a/arch/x86/lib/Makefile
> +++ b/arch/x86/lib/Makefile
> @@ -32,6 +32,7 @@ SOBJS-$(CONFIG_SYS_X86_REALMODE)      += realmode_switch.o
>  COBJS-$(CONFIG_SYS_PC_BIOS)    += bios_setup.o
>  COBJS-y        += board.o
>  COBJS-y        += bootm.o
> +COBJS-y        += cmd_boot.o
>  COBJS-y        += gcc.o
>  COBJS-y        += interrupts.o
>  COBJS-$(CONFIG_SYS_PCAT_INTERRUPTS) += pcat_interrupts.o
> diff --git a/arch/x86/lib/board.c b/arch/x86/lib/board.c
> index a240d26..aaffd1b 100644
> --- a/arch/x86/lib/board.c
> +++ b/arch/x86/lib/board.c
> @@ -487,33 +487,6 @@ void hang(void)
>                ;
>  }
>
> -unsigned long do_go_exec(ulong (*entry)(int, char * const []),
> -                        int argc, char * const argv[])
> -{
> -       unsigned long ret = 0;
> -       char **argv_tmp;
> -
> -       /*
> -        * x86 does not use a dedicated register to pass the pointer to
> -        * the global_data, so it is instead passed as argv[-1]. By using
> -        * argv[-1], the called 'Application' can use the contents of
> -        * argv natively. However, to safely use argv[-1] a new copy of
> -        * argv is needed with the extra element
> -        */
> -       argv_tmp = malloc(sizeof(char *) * (argc + 1));
> -
> -       if (argv_tmp) {
> -               argv_tmp[0] = (char *)gd;
> -
> -               memcpy(&argv_tmp[1], argv, (size_t)(sizeof(char *) * argc));
> -
> -               ret = (entry) (argc, &argv_tmp[1]);
> -               free(argv_tmp);
> -       }
> -
> -       return ret;
> -}
> -
>  void setup_pcat_compatibility(void)
>        __attribute__((weak, alias("__setup_pcat_compatibility")));
>
> diff --git a/arch/x86/lib/cmd_boot.c b/arch/x86/lib/cmd_boot.c
> new file mode 100644
> index 000..a81a9a3
> --- /dev/null
> +++ b/arch/x86/lib/cmd_boot.c
> @@ -0,0 +1,64 @@
> +/*
> + * (C) Copyright 2008-2011
> + * Graeme Russ, 
> + *
> + * (C) Copyright 2002
> + * Daniel Engström, Omicron Ceti AB, 
> + *
> + * (C) Copyright 2002
> + * Wolfgang Denk, DENX Software Engineering, 
> + *
> + * (C) Copyright 2002
> + * Sysgo Real-Time Solutions, GmbH 
> + * Marius Groeger 
> + *
> + * See file CREDITS for list of people who contributed to this
> + * project.
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License as
> + * published by the Free Software Foundation; either version 2 of
> + * the License, or (at your option) any later version.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program; if not, write to the Free Software
> + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
> + * MA 02111-1307 USA
> + */
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +unsigned long do_go_exec(ulong (*entry)(int, char * const []),
> +                        int argc, char * const argv[])
> +{
> +       unsigned long ret = 0;
> +       char **argv_tmp;
> +
> +       /*
> +        * x86 does not use a dedicated register to pass the pointer to
> +        * the global_data, so it is instead passed as argv[-1]. By using
> +        * argv[-1], the called 'Application' can use the contents of
> +        * argv natively. However, to safely use argv[-1] a new copy of
> +        * argv is needed with the extra element
> +        */
> +       argv_tmp = malloc(sizeof(char *) * (argc + 1));
> +
> +       if (argv_tmp) {
> +               argv_tmp[0] = (char *)gd;
> +
> +               memcpy(&argv_tmp[1], argv, (size_t)(sizeof(char *) * argc));
> +
> +               ret = (entry) (argc, &argv_tmp[1]);
> +               free(argv_tmp);
> +       }
> +
> +       return ret;
> +}
> --
> 1.7.5.2.317.g391b14
>
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 12/17] CHECKPATCH: arch/x86/lib/*

2012-01-11 Thread Simon Glass
On Wed, Jan 4, 2012 at 11:59 AM, Graeme Russ  wrote:
> Signed-off-by: Graeme Russ 

Acked-by: Simon Glass 

> ---
> Changes for v2:
>  - None
>
>  arch/x86/lib/bios.S            |  134 +--
>  arch/x86/lib/realmode_switch.S |   61 +++
>  2 files changed, 122 insertions(+), 73 deletions(-)
>
> diff --git a/arch/x86/lib/bios.S b/arch/x86/lib/bios.S
> index ce8deb5..239aaa9 100644
> --- a/arch/x86/lib/bios.S
> +++ b/arch/x86/lib/bios.S
> @@ -246,11 +246,9 @@ rm_int1f:
>  rm_def_int:
>        iret
>
> -
>        /*
> -        * All interrupt jumptable entries jump to here
> -        * after pushing the interrupt vector number onto the
> -        * stack.
> +        * All interrupt jumptable entries jump to here after pushing the
> +        * interrupt vector number onto the stack.
>         */
>  any_interrupt16:
>        MAKE_BIOS_STACK
> @@ -272,7 +270,8 @@ gs  movw    OFFS_VECTOR(%bp), %ax
>        je      Lint_1ah
>        movw    $0x, %ax
>        jmp     Lout
> -Lint_10h:                                      /* VGA BIOS services */
> +Lint_10h:
> +       /* VGA BIOS services */
>        call    bios_10h
>        jmp     Lout
>  Lint_11h:
> @@ -281,35 +280,42 @@ Lint_11h:
>  Lint_12h:
>        call    bios_12h
>        jmp     Lout
> -Lint_13h:                                      /* BIOS disk services */
> +Lint_13h:
> +       /* BIOS disk services */
>        call    bios_13h
>        jmp     Lout
> -Lint_15h:                                      /* Misc. BIOS services */
> +Lint_15h:
> +       /* Misc. BIOS services */
>        call    bios_15h
>        jmp     Lout
> -Lint_16h:                                      /* keyboard services */
> +Lint_16h:
> +       /* keyboard services */
>        call    bios_16h
>        jmp     Lout
> -Lint_1ah:                                      /* PCI bios */
> +Lint_1ah:
> +       /* PCI bios */
>        call    bios_1ah
>        jmp     Lout
>  Lout:
>        cmpw    $0, %ax
>        je      Lhandeled
>
> -       /* Insert code for unhandeled INTs here.
> +       /*
> +        * Insert code for unhandeled INTs here.
>         *
> -        * ROLO prints a message to the console
> -        * (we could do that but then we're in 16bit mode
> -        * so we'll have to get back into 32bit mode
> -        * to use the console I/O routines (if we do this
> -        * we shuls make int 0x10 and int 0x16 work as well))
> +        * ROLO prints a message to the console we could do that but then
> +        * we're in 16bit mode so we'll have to get back into 32bit mode
> +        * to use the console I/O routines (if we do this we should make
> +        * int 0x10 and int 0x16 work as well)
>         */
>  Lhandeled:
>        RESTORE_CALLERS_STACK
> -       addw    $2,%sp                          /* dump vector number */
> -       iret                                    /* return from interrupt */
>
> +       /* dump vector number */
> +       addw    $2,%sp
> +
> +       /* return from interrupt */
> +       iret
>
>  /*
>  
> @@ -327,22 +333,24 @@ gs        movw    OFFS_AX(%bp), %ax
>        je      Lvid_cfg
>        movw    $0x, %ax
>        ret
> -Lcur_pos:                                      /* Read Cursor Position and 
> Size */
> +Lcur_pos:
> +       /* Read Cursor Position and Size */
>  gs     movw    $0, OFFS_CX(%bp)
>  gs     movw    $0, OFFS_DX(%bp)
>        xorw    %ax, %ax
>        ret
> -Lvid_state:                                    /* Get Video State */
> -gs     movw    $(80 << 8|0x03), OFFS_AX(%bp)   /* 80 columns, 80x25, 16 
> colors */
> +Lvid_state:
> +       /* Get Video State - 80 columns, 80x25, 16 colors */
> +gs     movw    $(80 << 8|0x03), OFFS_AX(%bp)
>  gs     movw    $0, OFFS_BX(%bp)
>        xorw    %ax, %ax
>        ret
> -Lvid_cfg:      /* Video Subsystem Configuration (EGA/VGA) */
> -gs     movw    $0x10, OFFS_BX(%bp)             /* indicate CGA/MDA/HGA */
> +Lvid_cfg:
> +       /* Video Subsystem Configuration (EGA/VGA) - indicate CGA/MDA/HGA */
> +gs     movw    $0x10, OFFS_BX(%bp)
>        xorw    %ax, %ax
>        ret
>
> -
>  /*
>  
>  * BIOS interrupt 11h -- Equipment determination
> @@ -355,7 +363,6 @@ gs  movw    %ax, OFFS_AX(%bp)
>        xorw    %ax, %ax
>        ret
>
> -
>  /*
>  
>  * BIOS        interrupt 12h -- Get Memory Size
> @@ -370,16 +377,18 @@ cs        movw    ram_in_64kb_chunks, %ax
>  b12_more_than_640k:
>        movw    $0x280, %ax
>  b12_return:
> -gs     movw    %ax, OFFS_AX(%bp)               /* return number of kilobytes 
> in ax */
> +       /* return number of kilobytes in ax */
> +gs     movw    %ax, OFFS_AX(%bp)
>
>  gs     movw    OFFS_FLAGS(%bp), %ax
> -       andw    $0xfffe, %ax                    /* clear carry -- function 
> succeeded */
> +
> +       /* clear carr

Re: [U-Boot] [PATCH v2 11/17] x86: Tweak IDT and GDT for alignment and readability

2012-01-11 Thread Simon Glass
On Wed, Jan 4, 2012 at 11:59 AM, Graeme Russ  wrote:
> Signed-off-by: Graeme Russ 

Acked-by: Simon Glass 

> ---
> Changes for v2:
>  - Renamed to better reflect nature of changes
>
>  arch/x86/cpu/interrupts.c |    2 +-
>  arch/x86/cpu/start16.S    |   57 +++-
>  2 files changed, 46 insertions(+), 13 deletions(-)
>
> diff --git a/arch/x86/cpu/interrupts.c b/arch/x86/cpu/interrupts.c
> index e0958eb..43ec3f8 100644
> --- a/arch/x86/cpu/interrupts.c
> +++ b/arch/x86/cpu/interrupts.c
> @@ -174,7 +174,7 @@ struct desc_ptr {
>        unsigned short segment;
>  } __packed;
>
> -struct idt_entry idt[256] __attribute__((aligned(16)));
> +struct idt_entry idt[256] __aligned(16);
>
>  struct desc_ptr idt_ptr;
>
> diff --git a/arch/x86/cpu/start16.S b/arch/x86/cpu/start16.S
> index 33e53cd..cc393ff 100644
> --- a/arch/x86/cpu/start16.S
> +++ b/arch/x86/cpu/start16.S
> @@ -86,7 +86,11 @@ gdt_ptr:
>        .word   0x20            /* limit (32 bytes = 4 GDT entries) */
>        .long   BOOT_SEG + gdt  /* base */
>
> -       /* The GDT table ...
> +/* Some CPUs are picky about GDT alignment... */
> +.align 16
> +gdt:
> +       /*
> +        * The GDT table ...
>         *
>         *       Selector       Type
>         *       0x00           NULL
> @@ -94,17 +98,46 @@ gdt_ptr:
>         *       0x10           32bit code
>         *       0x18           32bit data/stack
>         */
> +       /* The NULL Desciptor - Mandatory */
> +       .word   0x          /* limit_low */
> +       .word   0x          /* base_low */
> +       .byte   0x00            /* base_middle */
> +       .byte   0x00            /* access */
> +       .byte   0x00            /* flags + limit_high */
> +       .byte   0x00            /* base_high */
>
> -gdt:
> -       .word   0, 0, 0, 0      /* NULL  */
> -       .word   0, 0, 0, 0      /* unused */
> +       /* Unused Desciptor - (matches Linux) */
> +       .word   0x          /* limit_low */
> +       .word   0x          /* base_low */
> +       .byte   0x00            /* base_middle */
> +       .byte   0x00            /* access */
> +       .byte   0x00            /* flags + limit_high */
> +       .byte   0x00            /* base_high */
>
> -       .word   0x          /* 4Gb - (0x10*0x1000 = 4Gb) */
> -       .word   0               /* base address = 0 */
> -       .word   0x9B00          /* code read/exec */
> -       .word   0x00CF          /* granularity = 4096, 386 (+5th nibble of 
> limit) */
> +       /*
> +        * The Code Segment Descriptor:
> +        * - Base   = 0x
> +        * - Size   = 4GB
> +        * - Access = Present, Ring 0, Exec (Code), Readable
> +        * - Flags  = 4kB Granularity, 32-bit
> +        */
> +       .word   0x          /* limit_low */
> +       .word   0x          /* base_low */
> +       .byte   0x00            /* base_middle */
> +       .byte   0x9b            /* access */
> +       .byte   0xcf            /* flags + limit_high */
> +       .byte   0x00            /* base_high */
>
> -       .word   0x          /* 4Gb - (0x10*0x1000 = 4Gb) */
> -       .word   0x0             /* base address = 0 */
> -       .word   0x9300          /* data read/write */
> -       .word   0x00CF          /* granularity = 4096, 386 (+5th nibble of 
> limit) */
> +       /*
> +        * The Data Segment Descriptor:
> +        * - Base   = 0x
> +        * - Size   = 4GB
> +        * - Access = Present, Ring 0, Non-Exec (Data), Writable
> +        * - Flags  = 4kB Granularity, 32-bit
> +        */
> +       .word   0x          /* limit_low */
> +       .word   0x          /* base_low */
> +       .byte   0x00            /* base_middle */
> +       .byte   0x93            /* access */
> +       .byte   0xcf            /* flags + limit_high */
> +       .byte   0x00            /* base_high */
> --
> 1.7.5.2.317.g391b14
>
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 10/17] x86: Allow cache before copy to RAM

2012-01-11 Thread Simon Glass
On Wed, Jan 4, 2012 at 11:59 AM, Graeme Russ  wrote:
> Signed-off-by: Graeme Russ 

Acked-by: Simon Glass 

> ---
> Changes for v2:
>  - None
>
>  arch/x86/lib/board.c |   15 ++-
>  1 files changed, 10 insertions(+), 5 deletions(-)
>
> diff --git a/arch/x86/lib/board.c b/arch/x86/lib/board.c
> index 56acf35..a240d26 100644
> --- a/arch/x86/lib/board.c
> +++ b/arch/x86/lib/board.c
> @@ -131,16 +131,11 @@ init_fnc_t *init_sequence_f[] = {
>        console_init_f,
>        dram_init_f,
>        calculate_relocation_address,
> -       copy_uboot_to_ram,
> -       clear_bss,
> -       do_elf_reloc_fixups,
>
>        NULL,
>  };
>
>  init_fnc_t *init_sequence_r[] = {
> -       copy_gd_to_ram,
> -       init_cache,
>        cpu_init_r,             /* basic cpu dependent setup */
>        board_early_init_r,     /* basic board dependent setup */
>        dram_init,              /* configure available RAM banks */
> @@ -269,6 +264,16 @@ void board_init_f(ulong boot_flags)
>
>  void board_init_f_r(void)
>  {
> +       if (copy_gd_to_ram() != 0)
> +               hang();
> +
> +       if (init_cache() != 0)
> +               hang();
> +
> +       copy_uboot_to_ram();
> +       clear_bss();
> +       do_elf_reloc_fixups();
> +
>        /*
>         * Transfer execution from Flash to RAM by calculating the address
>         * of the in-RAM copy of board_init_r() and calling it
> --
> 1.7.5.2.317.g391b14
>
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 09/17] x86: Create weak init_cache() and default enable_caches() functions

2012-01-11 Thread Simon Glass
Hi Graeme,

On Wed, Jan 4, 2012 at 11:59 AM, Graeme Russ  wrote:
> Signed-off-by: Graeme Russ 
> ---
> Changes for v2:
>  - Tweaked commit title
>
>  arch/x86/cpu/cpu.c                |   18 +++---
>  arch/x86/include/asm/u-boot-x86.h |    1 +
>  arch/x86/lib/board.c              |    1 +
>  3 files changed, 17 insertions(+), 3 deletions(-)
>
> diff --git a/arch/x86/cpu/cpu.c b/arch/x86/cpu/cpu.c
> index 8c3b92c..e9bb0d7 100644
> --- a/arch/x86/cpu/cpu.c
> +++ b/arch/x86/cpu/cpu.c
> @@ -140,6 +140,14 @@ int cpu_init_f(void) __attribute__((weak, 
> alias("x86_cpu_init_f")));
>
>  int x86_cpu_init_r(void)
>  {
> +       /* Initialize core interrupt and exception functionality of CPU */
> +       cpu_init_interrupts();
> +       return 0;
> +}
> +int cpu_init_r(void) __attribute__((weak, alias("x86_cpu_init_r")));
> +
> +void x86_enable_caches(void)
> +{
>        const u32 nw_cd_rst = ~(X86_CR0_NW | X86_CR0_CD);
>
>        /* turn on the cache and disable write through */
> @@ -147,12 +155,16 @@ int x86_cpu_init_r(void)
>            "andl       %0, %%eax\n"
>            "movl       %%eax, %%cr0\n"
>            "wbinvd\n" : : "i" (nw_cd_rst) : "eax");
> +}
> +void enable_caches(void) __attribute__((weak, alias("x86_enable_caches")));
> +
> +int x86_init_cache(void)
> +{
> +       enable_caches();

One question on this patch - it looks like init_cache() just called
enable_caches(). Both are weak functions. Is there any reason for
having two?

Is it possible to have init_cache() just be the weak function which
defaults to what you have here for x86_enable_caches()?

Regards,
Simon

>
> -       /* Initialize core interrupt and exception functionality of CPU */
> -       cpu_init_interrupts();
>        return 0;
>  }
> -int cpu_init_r(void) __attribute__((weak, alias("x86_cpu_init_r")));
> +int init_cache(void) __attribute__((weak, alias("x86_init_cache")));
>
>  int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
>  {
> diff --git a/arch/x86/include/asm/u-boot-x86.h 
> b/arch/x86/include/asm/u-boot-x86.h
> index 5540d51..878a1ee 100644
> --- a/arch/x86/include/asm/u-boot-x86.h
> +++ b/arch/x86/include/asm/u-boot-x86.h
> @@ -39,6 +39,7 @@ int x86_cpu_init_f(void);
>  int cpu_init_f(void);
>  void init_gd(gd_t *id, u64 *gdt_addr);
>  void setup_gdt(gd_t *id, u64 *gdt_addr);
> +int init_cache(void);
>
>  /* cpu/.../timer.c */
>  void timer_isr(void *);
> diff --git a/arch/x86/lib/board.c b/arch/x86/lib/board.c
> index 3d82165..56acf35 100644
> --- a/arch/x86/lib/board.c
> +++ b/arch/x86/lib/board.c
> @@ -140,6 +140,7 @@ init_fnc_t *init_sequence_f[] = {
>
>  init_fnc_t *init_sequence_r[] = {
>        copy_gd_to_ram,
> +       init_cache,
>        cpu_init_r,             /* basic cpu dependent setup */
>        board_early_init_r,     /* basic board dependent setup */
>        dram_init,              /* configure available RAM banks */
> --
> 1.7.5.2.317.g391b14
>
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 08/17] x86: Set GD_FLG_RELOC after entering in-RAM copy of U-Boot

2012-01-11 Thread Simon Glass
On Wed, Jan 4, 2012 at 11:59 AM, Graeme Russ  wrote:
> Signed-off-by: Graeme Russ 

Acked-by: Simon Glass 

> ---
> Changes for v2:
>  - None
>
>  arch/x86/lib/board.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/x86/lib/board.c b/arch/x86/lib/board.c
> index b64c2d3..3d82165 100644
> --- a/arch/x86/lib/board.c
> +++ b/arch/x86/lib/board.c
> @@ -252,8 +252,6 @@ void board_init_f(ulong boot_flags)
>                        hang();
>        }
>
> -       gd->flags |= GD_FLG_RELOC;
> -
>        /*
>         * SDRAM is now initialised, U-Boot has been copied into SDRAM,
>         * the BSS has been cleared etc. The final stack can now be setup
> @@ -322,6 +320,8 @@ void board_init_r(gd_t *id, ulong dest_addr)
>        /* compiler optimization barrier needed for GCC >= 3.4 */
>        __asm__ __volatile__("" : : : "memory");
>
> +       gd->flags |= GD_FLG_RELOC;
> +
>        gd->bd = &bd_data;
>        memset(gd->bd, 0, sizeof(bd_t));
>        show_boot_progress(0x22);
> --
> 1.7.5.2.317.g391b14
>
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 07/17] x86: Use fs for global data

2012-01-11 Thread Simon Glass
On Wed, Jan 4, 2012 at 11:59 AM, Graeme Russ  wrote:
> Use the base address of the 'F' segment as a pointer to the global data
> structure. By adding the linear address (i.e. the 'D' segment address) as
> the first word of the global data structure, the address of the global data
> relative to the 'D' segment can be found simply, for example, by:
>
>        fs movl 0, %eax
>
> This makes the gd 'pointer' writable prior to relocation (by reloading the
> Global Descriptor Table) which brings x86 into line with all other arches
>
> NOTE: Writing to the gd 'pointer' is expensive (but we only do it
> twice) but using it to access global data members (read and write) is
> still fairly cheap
>
> Signed-off-by: Graeme Russ 

Acked-by: Simon Glass 

> ---
> Changes for v2:
>  - Rebased against changes made to patch #3
>  - Removed extra indent
>  - Tweaked commit message
>
>  arch/x86/cpu/cpu.c                 |   53 --
>  arch/x86/cpu/start.S               |    8 -
>  arch/x86/include/asm/global_data.h |   21 +
>  arch/x86/include/asm/processor.h   |    1 +
>  arch/x86/include/asm/u-boot-x86.h  |    2 +
>  arch/x86/lib/board.c               |   56 
> +---
>  6 files changed, 94 insertions(+), 47 deletions(-)
>
> diff --git a/arch/x86/cpu/cpu.c b/arch/x86/cpu/cpu.c
> index 8102fb9..8c3b92c 100644
> --- a/arch/x86/cpu/cpu.c
> +++ b/arch/x86/cpu/cpu.c
> @@ -90,6 +90,37 @@ static void load_gdt(const u64 *boot_gdt, u16 num_entries)
>        asm volatile("lgdtl %0\n" : : "m" (gdt));
>  }
>
> +void init_gd(gd_t *id, u64 *gdt_addr)
> +{
> +       id->gd_addr = (ulong)id;
> +       setup_gdt(id, gdt_addr);
> +}
> +
> +void setup_gdt(gd_t *id, u64 *gdt_addr)
> +{
> +       /* CS: code, read/execute, 4 GB, base 0 */
> +       gdt_addr[X86_GDT_ENTRY_32BIT_CS] = GDT_ENTRY(0xc09b, 0, 0xf);
> +
> +       /* DS: data, read/write, 4 GB, base 0 */
> +       gdt_addr[X86_GDT_ENTRY_32BIT_DS] = GDT_ENTRY(0xc093, 0, 0xf);
> +
> +       /* FS: data, read/write, 4 GB, base (Global Data Pointer) */
> +       gdt_addr[X86_GDT_ENTRY_32BIT_FS] = GDT_ENTRY(0xc093, (ulong)id, 
> 0xf);
> +
> +       /* 16-bit CS: code, read/execute, 64 kB, base 0 */
> +       gdt_addr[X86_GDT_ENTRY_16BIT_CS] = GDT_ENTRY(0x109b, 0, 0x0);
> +
> +       /* 16-bit DS: data, read/write, 64 kB, base 0 */
> +       gdt_addr[X86_GDT_ENTRY_16BIT_DS] = GDT_ENTRY(0x1093, 0, 0x0);
> +
> +       load_gdt(gdt_addr, X86_GDT_NUM_ENTRIES);
> +       load_ds(X86_GDT_ENTRY_32BIT_DS);
> +       load_es(X86_GDT_ENTRY_32BIT_DS);
> +       load_gs(X86_GDT_ENTRY_32BIT_DS);
> +       load_ss(X86_GDT_ENTRY_32BIT_DS);
> +       load_fs(X86_GDT_ENTRY_32BIT_FS);
> +}
> +
>  int x86_cpu_init_f(void)
>  {
>        const u32 em_rst = ~X86_CR0_EM;
> @@ -117,28 +148,6 @@ int x86_cpu_init_r(void)
>            "movl       %%eax, %%cr0\n"
>            "wbinvd\n" : : "i" (nw_cd_rst) : "eax");
>
> -       /*
> -        * There are machines which are known to not boot with the GDT
> -        * being 8-byte unaligned. Intel recommends 16 byte alignment
> -        */
> -       static const u64 boot_gdt[] __aligned(16) = {
> -               /* CS: code, read/execute, 4 GB, base 0 */
> -               [X86_GDT_ENTRY_32BIT_CS] = GDT_ENTRY(0xc09b, 0, 0xf),
> -               /* DS: data, read/write, 4 GB, base 0 */
> -               [X86_GDT_ENTRY_32BIT_DS] = GDT_ENTRY(0xc093, 0, 0xf),
> -               /* 16-bit CS: code, read/execute, 64 kB, base 0 */
> -               [X86_GDT_ENTRY_16BIT_CS] = GDT_ENTRY(0x109b, 0, 0x0),
> -               /* 16-bit DS: data, read/write, 64 kB, base 0 */
> -               [X86_GDT_ENTRY_16BIT_DS] = GDT_ENTRY(0x1093, 0, 0x0),
> -       };
> -
> -       load_gdt(boot_gdt, X86_GDT_NUM_ENTRIES);
> -       load_ds(X86_GDT_ENTRY_32BIT_DS);
> -       load_es(X86_GDT_ENTRY_32BIT_DS);
> -       load_fs(X86_GDT_ENTRY_32BIT_DS);
> -       load_gs(X86_GDT_ENTRY_32BIT_DS);
> -       load_ss(X86_GDT_ENTRY_32BIT_DS);
> -
>        /* Initialize core interrupt and exception functionality of CPU */
>        cpu_init_interrupts();
>        return 0;
> diff --git a/arch/x86/cpu/start.S b/arch/x86/cpu/start.S
> index 69a9b2c..ee0dabe 100644
> --- a/arch/x86/cpu/start.S
> +++ b/arch/x86/cpu/start.S
> @@ -31,7 +31,7 @@
>  #include 
>  #include 
>  #include 
> -#include 
> +#include 
>
>  .section .text
>  .code32
> @@ -85,6 +85,12 @@ car_init_ret:
>         */
>        movl    $CONFIG_SYS_INIT_SP_ADDR, %esp
>
> +       /* Initialise the Global Data Pointer */
> +       movl    $CONFIG_SYS_INIT_GD_ADDR, %eax
> +       movl    %eax, %edx
> +       addl    $GENERATED_GBL_DATA_SIZE, %edx
> +       call    init_gd;
> +
>        /* Set parameter to board_init_f() to boot flags */
>        xorl    %eax, %eax
>        movw    %bx, %ax
> diff --git a/arch/x86/include/asm/global_data.h 
> b/arch/x86/include/asm/global_data.h
> index 05a2139..908a02c 100644
> --- a/arch/x86/include/asm/globa

Re: [U-Boot] [PATCH v2 06/17] x86: Rework relocation calculations

2012-01-11 Thread Simon Glass
On Wed, Jan 4, 2012 at 11:59 AM, Graeme Russ  wrote:
> This commit introduces no functional changes - It simply re-arranges the
> calculations so that adding to them in future commits will be cleaner
>
> Signed-off-by: Graeme Russ 

Acked-by: Simon Glass 

> ---
> Changes for v2:
>  - Fixed typo in title
>  - Added commit message
>
>  arch/x86/lib/board.c |   23 +++
>  1 files changed, 11 insertions(+), 12 deletions(-)
>
> diff --git a/arch/x86/lib/board.c b/arch/x86/lib/board.c
> index 382ada7..6f075b7 100644
> --- a/arch/x86/lib/board.c
> +++ b/arch/x86/lib/board.c
> @@ -164,24 +164,23 @@ static int calculate_relocation_address(void)
>        ulong text_start = (ulong)&__text_start;
>        ulong bss_end = (ulong)&__bss_end;
>        ulong dest_addr;
> -       ulong rel_offset;
> -
> -       /* Calculate destination RAM Address and relocation offset */
> -       dest_addr = gd->ram_size;
> -       dest_addr -= CONFIG_SYS_STACK_SIZE;
> -       dest_addr -= (bss_end - text_start);
>
>        /*
> -        * Round destination address down to 16-byte boundary to keep
> -        * IDT and GDT 16-byte aligned
> +        * NOTE: All destination address are rounded down to 16-byte
> +        *       boundary to satisfy various worst-case alignment
> +        *       requirements
>         */
> -       dest_addr &= ~15;
>
> -       rel_offset = dest_addr - text_start;
> +       /* Stack is at top of available memory */
> +       dest_addr = gd->ram_size;
> +       gd->start_addr_sp = dest_addr;
>
> -       gd->start_addr_sp = gd->ram_size;
> +       /* U-Boot is below the stack */
> +       dest_addr -= CONFIG_SYS_STACK_SIZE;
> +       dest_addr -= (bss_end - text_start);
> +       dest_addr &= ~15;
>        gd->relocaddr = dest_addr;
> -       gd->reloc_off = rel_offset;
> +       gd->reloc_off = (dest_addr - text_start);
>
>        return 0;
>  }
> --
> 1.7.5.2.317.g391b14
>
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 05/17] x86: Simplify Flash-to-RAM code execution transition

2012-01-11 Thread Simon Glass
Hi Graeme,

On Wed, Jan 4, 2012 at 11:59 AM, Graeme Russ  wrote:
> Move the relocation offset calculation out of assembler and into C. This
> also paves the way for the upcoming init sequence simplification by adding
> the board_init_f_r flash to RAM transitional function
>
> Signed-off-by: Graeme Russ 

Still not thrilled with the name but it's not important.

Acked-by: Simon Glass 

Regards,
Simon

> ---
> Changes for v2:
>  - Added commit message
>  - Minor adjustment to new stack address comment
>
>  arch/x86/cpu/start.S              |   22 ++
>  arch/x86/include/asm/u-boot-x86.h |    2 ++
>  arch/x86/lib/board.c              |   25 ++---
>  3 files changed, 30 insertions(+), 19 deletions(-)
>
> diff --git a/arch/x86/cpu/start.S b/arch/x86/cpu/start.S
> index 6027f54..69a9b2c 100644
> --- a/arch/x86/cpu/start.S
> +++ b/arch/x86/cpu/start.S
> @@ -96,32 +96,22 @@ car_init_ret:
>        movw    $0x85, %ax
>        jmp     die
>
> -.globl relocate_code
> -.type relocate_code, @function
> -relocate_code:
> +.globl board_init_f_r_trampoline
> +.type board_init_f_r_trampoline, @function
> +board_init_f_r_trampoline:
>        /*
>         * SDRAM has been initialised, U-Boot code has been copied into
>         * RAM, BSS has been cleared and relocation adjustments have been
>         * made. It is now time to jump into the in-RAM copy of U-Boot
>         *
> -        * %eax = Address of top of stack
> -        * %edx = Address of Global Data
> -        * %ecx = Base address of in-RAM copy of U-Boot
> +        * %eax = Address of top of new stack
>         */
>
>        /* Setup stack in RAM */
>        movl    %eax, %esp
>
> -       /* Setup call address of in-RAM copy of board_init_r() */
> -       movl    $board_init_r, %ebp
> -       addl    (GENERATED_GD_RELOC_OFF)(%edx), %ebp
> -
> -       /* Setup parameters to board_init_r() */
> -       movl    %edx, %eax
> -       movl    %ecx, %edx
> -
> -       /* Jump to in-RAM copy of board_init_r() */
> -       call    *%ebp
> +       /* Re-enter U-Boot by calling board_init_f_r */
> +       call    board_init_f_r
>
>  die:
>        hlt
> diff --git a/arch/x86/include/asm/u-boot-x86.h 
> b/arch/x86/include/asm/u-boot-x86.h
> index 755f88a..c3d2277 100644
> --- a/arch/x86/include/asm/u-boot-x86.h
> +++ b/arch/x86/include/asm/u-boot-x86.h
> @@ -61,5 +61,7 @@ u32 isa_map_rom(u32 bus_addr, int size);
>  int video_bios_init(void);
>  int video_init(void);
>
> +void   board_init_f_r_trampoline(ulong) __attribute__ ((noreturn));
> +void   board_init_f_r(void) __attribute__ ((noreturn));
>
>  #endif /* _U_BOOT_I386_H_ */
> diff --git a/arch/x86/lib/board.c b/arch/x86/lib/board.c
> index f9eb15b..382ada7 100644
> --- a/arch/x86/lib/board.c
> +++ b/arch/x86/lib/board.c
> @@ -253,10 +253,29 @@ void board_init_f(ulong boot_flags)
>
>        gd->flags |= GD_FLG_RELOC;
>
> -       /* Enter the relocated U-Boot! */
> -       relocate_code(gd->start_addr_sp, gd, gd->relocaddr);
> +       /*
> +        * SDRAM is now initialised, U-Boot has been copied into SDRAM,
> +        * the BSS has been cleared etc. The final stack can now be setup
> +        * in SDRAM. Code execution will continue (momentarily) in Flash,
> +        * but with the stack in SDRAM and Global Data in temporary memory
> +        * (CPU cache)
> +        */
> +       board_init_f_r_trampoline(gd->start_addr_sp);
> +
> +       /* NOTREACHED - board_init_f_r_trampoline() does not return */
> +       while (1)
> +               ;
> +}
> +
> +void board_init_f_r(void)
> +{
> +       /*
> +        * Transfer execution from Flash to RAM by calculating the address
> +        * of the in-RAM copy of board_init_r() and calling it
> +        */
> +       (board_init_r + gd->reloc_off)(gd, gd->relocaddr);
>
> -       /* NOTREACHED - relocate_code() does not return */
> +       /* NOTREACHED - board_init_r() does not return */
>        while (1)
>                ;
>  }
> --
> 1.7.5.2.317.g391b14
>
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 04/17] x86: Rework Global Descriptor Table loading

2012-01-11 Thread Simon Glass
On Wed, Jan 4, 2012 at 11:59 AM, Graeme Russ  wrote:
> The inline assembler is ugly and uses hard coded magic numbers. Make it more
> elegant to allow cleaner implementation of future GDT related patches. The
> compiler seems smart enough to generate the same code anyway
>
> Signed-off-by: Graeme Russ 

Acked-by: Simon Glass 

> ---
> Changes for v2:
>  - Rebased against revised patch #3
>  - Use GDT size define instead of magic number
>  - Added commit message
>
>  arch/x86/cpu/cpu.c |   82 +--
>  1 files changed, 53 insertions(+), 29 deletions(-)
>
> diff --git a/arch/x86/cpu/cpu.c b/arch/x86/cpu/cpu.c
> index 209ff29..8102fb9 100644
> --- a/arch/x86/cpu/cpu.c
> +++ b/arch/x86/cpu/cpu.c
> @@ -55,35 +55,39 @@ struct gdt_ptr {
>        u32 ptr;
>  } __packed;
>
> -static void reload_gdt(void)
> +static void load_ds(u32 segment)
>  {
> -       /*
> -        * There are machines which are known to not boot with the GDT
> -        * being 8-byte unaligned.  Intel recommends 16 byte alignment
> -        */
> -       static const u64 boot_gdt[] __attribute__((aligned(16))) = {
> -               /* CS: code, read/execute, 4 GB, base 0 */
> -               [X86_GDT_ENTRY_32BIT_CS] = GDT_ENTRY(0xc09b, 0, 0xf),
> -               /* DS: data, read/write, 4 GB, base 0 */
> -               [X86_GDT_ENTRY_32BIT_DS] = GDT_ENTRY(0xc093, 0, 0xf),
> -               /* 16-bit CS: code, read/execute, 64 kB, base 0 */
> -               [X86_GDT_ENTRY_16BIT_CS] = GDT_ENTRY(0x109b, 0, 0x0),
> -               /* 16-bit DS: data, read/write, 64 kB, base 0 */
> -               [X86_GDT_ENTRY_16BIT_DS] = GDT_ENTRY(0x1093, 0, 0x0),
> -       };
> -       static struct gdt_ptr gdt;
> -
> -       gdt.len = sizeof(boot_gdt)-1;
> -       gdt.ptr = (u32)&boot_gdt;
> -
> -       asm volatile("lgdtl %0\n" \
> -                    "movl $((2+1)*8), %%ecx\n" \
> -                    "movl %%ecx, %%ds\n" \
> -                    "movl %%ecx, %%es\n" \
> -                    "movl %%ecx, %%fs\n" \
> -                    "movl %%ecx, %%gs\n" \
> -                    "movl %%ecx, %%ss" \
> -                    : : "m" (gdt) : "ecx");
> +       asm volatile("movl %0, %%ds" : : "r" (segment * X86_GDT_ENTRY_SIZE));
> +}
> +
> +static void load_es(u32 segment)
> +{
> +       asm volatile("movl %0, %%es" : : "r" (segment * X86_GDT_ENTRY_SIZE));
> +}
> +
> +static void load_fs(u32 segment)
> +{
> +       asm volatile("movl %0, %%fs" : : "r" (segment * X86_GDT_ENTRY_SIZE));
> +}
> +
> +static void load_gs(u32 segment)
> +{
> +       asm volatile("movl %0, %%gs" : : "r" (segment * X86_GDT_ENTRY_SIZE));
> +}
> +
> +static void load_ss(u32 segment)
> +{
> +       asm volatile("movl %0, %%ss" : : "r" (segment * X86_GDT_ENTRY_SIZE));
> +}
> +
> +static void load_gdt(const u64 *boot_gdt, u16 num_entries)
> +{
> +       struct gdt_ptr gdt;
> +
> +       gdt.len = (num_entries * 8) - 1;
> +       gdt.ptr = (u32)boot_gdt;
> +
> +       asm volatile("lgdtl %0\n" : : "m" (gdt));
>  }
>
>  int x86_cpu_init_f(void)
> @@ -113,7 +117,27 @@ int x86_cpu_init_r(void)
>            "movl       %%eax, %%cr0\n"
>            "wbinvd\n" : : "i" (nw_cd_rst) : "eax");
>
> -       reload_gdt();
> +       /*
> +        * There are machines which are known to not boot with the GDT
> +        * being 8-byte unaligned. Intel recommends 16 byte alignment
> +        */
> +       static const u64 boot_gdt[] __aligned(16) = {
> +               /* CS: code, read/execute, 4 GB, base 0 */
> +               [X86_GDT_ENTRY_32BIT_CS] = GDT_ENTRY(0xc09b, 0, 0xf),
> +               /* DS: data, read/write, 4 GB, base 0 */
> +               [X86_GDT_ENTRY_32BIT_DS] = GDT_ENTRY(0xc093, 0, 0xf),
> +               /* 16-bit CS: code, read/execute, 64 kB, base 0 */
> +               [X86_GDT_ENTRY_16BIT_CS] = GDT_ENTRY(0x109b, 0, 0x0),
> +               /* 16-bit DS: data, read/write, 64 kB, base 0 */
> +               [X86_GDT_ENTRY_16BIT_DS] = GDT_ENTRY(0x1093, 0, 0x0),
> +       };
> +
> +       load_gdt(boot_gdt, X86_GDT_NUM_ENTRIES);
> +       load_ds(X86_GDT_ENTRY_32BIT_DS);
> +       load_es(X86_GDT_ENTRY_32BIT_DS);
> +       load_fs(X86_GDT_ENTRY_32BIT_DS);
> +       load_gs(X86_GDT_ENTRY_32BIT_DS);
> +       load_ss(X86_GDT_ENTRY_32BIT_DS);
>
>        /* Initialize core interrupt and exception functionality of CPU */
>        cpu_init_interrupts();
> --
> 1.7.5.2.317.g391b14
>
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 03/17] x86: Remove GDR related magic numbers

2012-01-11 Thread Simon Glass
On Wed, Jan 4, 2012 at 11:59 AM, Graeme Russ  wrote:
> Signed-off-by: Graeme Russ 

Acked-by: Simon Glass 

> ---
> Changes for v2:
>  - Use an enum
>  - Add defined for GDT size (previously added in patch 7)
>  - Use X86_ namespace (as per Linux headers)
>
>  arch/x86/cpu/cpu.c               |    8 
>  arch/x86/cpu/start.S             |    3 ++-
>  arch/x86/include/asm/processor.h |   23 +++
>  3 files changed, 25 insertions(+), 9 deletions(-)
>
> diff --git a/arch/x86/cpu/cpu.c b/arch/x86/cpu/cpu.c
> index 61d0b69..209ff29 100644
> --- a/arch/x86/cpu/cpu.c
> +++ b/arch/x86/cpu/cpu.c
> @@ -63,13 +63,13 @@ static void reload_gdt(void)
>         */
>        static const u64 boot_gdt[] __attribute__((aligned(16))) = {
>                /* CS: code, read/execute, 4 GB, base 0 */
> -               [GDT_ENTRY_32BIT_CS] = GDT_ENTRY(0xc09b, 0, 0xf),
> +               [X86_GDT_ENTRY_32BIT_CS] = GDT_ENTRY(0xc09b, 0, 0xf),
>                /* DS: data, read/write, 4 GB, base 0 */
> -               [GDT_ENTRY_32BIT_DS] = GDT_ENTRY(0xc093, 0, 0xf),
> +               [X86_GDT_ENTRY_32BIT_DS] = GDT_ENTRY(0xc093, 0, 0xf),
>                /* 16-bit CS: code, read/execute, 64 kB, base 0 */
> -               [GDT_ENTRY_16BIT_CS] = GDT_ENTRY(0x109b, 0, 0x0),
> +               [X86_GDT_ENTRY_16BIT_CS] = GDT_ENTRY(0x109b, 0, 0x0),
>                /* 16-bit DS: data, read/write, 64 kB, base 0 */
> -               [GDT_ENTRY_16BIT_DS] = GDT_ENTRY(0x1093, 0, 0x0),
> +               [X86_GDT_ENTRY_16BIT_DS] = GDT_ENTRY(0x1093, 0, 0x0),
>        };
>        static struct gdt_ptr gdt;
>
> diff --git a/arch/x86/cpu/start.S b/arch/x86/cpu/start.S
> index f87633b..6027f54 100644
> --- a/arch/x86/cpu/start.S
> +++ b/arch/x86/cpu/start.S
> @@ -29,6 +29,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
>  #include 
>
> @@ -58,7 +59,7 @@ _start:
>        /* This is the 32-bit cold-reset entry point */
>
>        /* Load the segement registes to match the gdt loaded in start16.S */
> -       movl    $0x18, %eax
> +       movl    $(X86_GDT_ENTRY_32BIT_DS * X86_GDT_ENTRY_SIZE), %eax
>        movw    %ax, %fs
>        movw    %ax, %ds
>        movw    %ax, %gs
> diff --git a/arch/x86/include/asm/processor.h 
> b/arch/x86/include/asm/processor.h
> index 1e5dccd..aa8188e 100644
> --- a/arch/x86/include/asm/processor.h
> +++ b/arch/x86/include/asm/processor.h
> @@ -24,9 +24,24 @@
>  #ifndef __ASM_PROCESSOR_H_
>  #define __ASM_PROCESSOR_H_ 1
>
> -#define GDT_ENTRY_32BIT_CS     2
> -#define GDT_ENTRY_32BIT_DS     (GDT_ENTRY_32BIT_CS + 1)
> -#define GDT_ENTRY_16BIT_CS     (GDT_ENTRY_32BIT_DS + 1)
> -#define GDT_ENTRY_16BIT_DS     (GDT_ENTRY_16BIT_CS + 1)
> +#define X86_GDT_ENTRY_SIZE     8
> +
> +#ifndef __ASSEMBLY__
> +
> +enum {
> +       X86_GDT_ENTRY_NULL = 0,
> +       X86_GDT_ENTRY_UNUSED,
> +       X86_GDT_ENTRY_32BIT_CS,
> +       X86_GDT_ENTRY_32BIT_DS,
> +       X86_GDT_ENTRY_16BIT_CS,
> +       X86_GDT_ENTRY_16BIT_DS,
> +       X86_GDT_NUM_ENTRIES
> +};
> +#else
> +/* NOTE: If the above enum is modified, this define must be checked */
> +#define X86_GDT_ENTRY_32BIT_DS 3
> +#endif
> +
> +#define X86_GDT_SIZE           (X86_GDT_NUM_ENTRIES * X86_GDT_ENTRY_SIZE)
>
>  #endif
> --
> 1.7.5.2.317.g391b14
>
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 02/17] x86: Speed up copy-to-RAM and clear BSS operations

2012-01-11 Thread Simon Glass
On Wed, Jan 4, 2012 at 11:59 AM, Graeme Russ  wrote:
> The implementations of memcpy and memset are now the optimised versions
> from glibc, so use them instead of simple copy loops
>
> Signed-off-by: Graeme Russ 

Acked-by: Simon Glass 

> ---
> Changes for v2:
>  - Removed unneeded brackets
>
>  arch/x86/lib/board.c |   17 +
>  1 files changed, 5 insertions(+), 12 deletions(-)
>
> diff --git a/arch/x86/lib/board.c b/arch/x86/lib/board.c
> index d742fec..f9eb15b 100644
> --- a/arch/x86/lib/board.c
> +++ b/arch/x86/lib/board.c
> @@ -188,26 +188,19 @@ static int calculate_relocation_address(void)
>
>  static int copy_uboot_to_ram(void)
>  {
> -       ulong *dst_addr = (ulong *)gd->relocaddr;
> -       ulong *src_addr = (ulong *)&__text_start;
> -       ulong *end_addr = (ulong *)&__data_end;
> +       size_t len = (size_t)&__data_end - (size_t)&__text_start;
>
> -       while (src_addr < end_addr)
> -               *dst_addr++ = *src_addr++;
> +       memcpy((void *)gd->relocaddr, (void *)&__text_start, len);
>
>        return 0;
>  }
>
>  static int clear_bss(void)
>  {
> -       void *bss_start = &__bss_start;
> -       void *bss_end = &__bss_end;
> +       ulong dst_addr = (ulong)&__bss_start + gd->reloc_off;
> +       size_t len = (size_t)&__bss_end - (size_t)&__bss_start;
>
> -       ulong *dst_addr = (ulong *)(bss_start + gd->reloc_off);
> -       ulong *end_addr = (ulong *)(bss_end + gd->reloc_off);
> -
> -       while (dst_addr < end_addr)
> -               *dst_addr++ = 0x;
> +       memset((void *)dst_addr, 0x00, len);
>
>        return 0;
>  }
> --
> 1.7.5.2.317.g391b14
>
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 01/17] x86: Import glibc memcpy implementation

2012-01-11 Thread Simon Glass
Hi,

On Wed, Jan 4, 2012 at 11:59 AM, Graeme Russ  wrote:
> Taken from glibc version 2.14.90
>
> Signed-off-by: Graeme Russ 
> ---
> Changes for v2:
>  - None

It feels a bit odd acking x86 patches but I have been through these
and much of the series is generally useful for other archs...

Acked-by: Simon Glass 

>
>  arch/x86/include/asm/string.h |    2 +-
>  arch/x86/lib/string.c         |   61 
> +
>  2 files changed, 62 insertions(+), 1 deletions(-)
>
> diff --git a/arch/x86/include/asm/string.h b/arch/x86/include/asm/string.h
> index 3aa6c11..0ad612f 100644
> --- a/arch/x86/include/asm/string.h
> +++ b/arch/x86/include/asm/string.h
> @@ -14,7 +14,7 @@ extern char * strrchr(const char * s, int c);
>  #undef __HAVE_ARCH_STRCHR
>  extern char * strchr(const char * s, int c);
>
> -#undef __HAVE_ARCH_MEMCPY
> +#define __HAVE_ARCH_MEMCPY
>  extern void * memcpy(void *, const void *, __kernel_size_t);
>
>  #undef __HAVE_ARCH_MEMMOVE
> diff --git a/arch/x86/lib/string.c b/arch/x86/lib/string.c
> index f2ea7e4..1fde81b 100644
> --- a/arch/x86/lib/string.c
> +++ b/arch/x86/lib/string.c
> @@ -85,3 +85,64 @@ void *memset(void *dstpp, int c, size_t len)
>
>        return dstpp;
>  }
> +
> +#define        OP_T_THRES      8
> +#define OPSIZ  (sizeof(op_t))
> +
> +#define BYTE_COPY_FWD(dst_bp, src_bp, nbytes)                            \
> +do {                                                                     \
> +       int __d0;                                                         \
> +       asm volatile(                                                     \
> +               /* Clear the direction flag, so copying goes forward.  */ \
> +               "cld\n"                                                   \
> +               /* Copy bytes.  */                                        \
> +               "rep\n"                                                   \
> +               "movsb" :                                                 \
> +               "=D" (dst_bp), "=S" (src_bp), "=c" (__d0) :               \
> +               "0" (dst_bp), "1" (src_bp), "2" (nbytes) :                \
> +               "memory");                                                \
> +} while (0)
> +
> +#define WORD_COPY_FWD(dst_bp, src_bp, nbytes_left, nbytes)               \
> +do {                                                                     \
> +       int __d0;                                                         \
> +       asm volatile(                                                     \
> +               /* Clear the direction flag, so copying goes forward.  */ \
> +               "cld\n"                                                   \
> +               /* Copy longwords.  */                                    \
> +               "rep\n"                                                   \
> +               "movsl" :                                                 \
> +               "=D" (dst_bp), "=S" (src_bp), "=c" (__d0) :               \
> +               "0" (dst_bp), "1" (src_bp), "2" ((nbytes) / 4) :          \
> +               "memory");                                                \
> +       (nbytes_left) = (nbytes) % 4;                                     \
> +} while (0)
> +
> +void *memcpy(void *dstpp, const void *srcpp, size_t len)
> +{
> +       unsigned long int dstp = (long int)dstpp;
> +       unsigned long int srcp = (long int)srcpp;
> +
> +       /* Copy from the beginning to the end.  */
> +
> +       /* If there not too few bytes to copy, use word copy.  */
> +       if (len >= OP_T_THRES) {
> +               /* Copy just a few bytes to make DSTP aligned.  */
> +               len -= (-dstp) % OPSIZ;
> +               BYTE_COPY_FWD(dstp, srcp, (-dstp) % OPSIZ);
> +
> +               /* Copy from SRCP to DSTP taking advantage of the known
> +                * alignment of DSTP.  Number of bytes remaining is put
> +                * in the third argument, i.e. in LEN.  This number may
> +                * vary from machine to machine.
> +                */
> +               WORD_COPY_FWD(dstp, srcp, len, len);
> +
> +               /* Fall out and copy the tail.  */
> +       }
> +
> +       /* There are just a few bytes to copy. Use byte memory operations. */
> +       BYTE_COPY_FWD(dstp, srcp, len);
> +
> +       return dstpp;
> +}
> --
> 1.7.5.2.317.g391b14
>
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [RFC PATCH 1/2] fdt: Add fdtdec_find_aliases() to deal with alias nodes

2012-01-11 Thread Simon Glass
Hi Stephen,

On Tue, Jan 10, 2012 at 1:41 PM, Stephen Warren  wrote:
> On 01/10/2012 02:22 PM, Simon Glass wrote:
>> Hi Stephen,
>>
>> On Tue, Jan 10, 2012 at 12:27 PM, Stephen Warren  wrote:
>>> On 12/26/2011 03:31 PM, Simon Glass wrote:
 Stephen Warren pointed out that we should use nodes whether or not they
 have an alias in the /aliases section. The aliases section specifies the
 order so far as it can, but is not essential. Operating without alisses
 is useful when the enumerated order of nodes does not matter (admittedly
 rare in U-Boot).
>>> ...
 +/**
 + * Find the nodes for a peripheral and return a list of them in the 
 correct
 + * order. This is used to enumerate all the peripherals of a certain type.
 + *
 + * To use this, optionally set up a /aliases node with alias properties 
 for
 + * a peripheral. For example, for usb you could have:
 + *
 + * aliases {
 + *           usb0 = "/ehci@c5008000";
 + *           usb1 = "/ehci@c500";
 + * };
 + *
 + * Pass "usb" as the name to this function and will return a list of two
 + * nodes offsets: /ehci@c5008000 and ehci@c500.
 + *
 + * All nodes returned will match the compatible ID, as it is assumed that
 + * all peripherals use the same driver.
 + *
 + * If no alias node is found, then the node list will be returned in the
 + * order found in the fdt. If the aliases mention a node which doesn't
 + * exist, then this will be ignored. If nodes are found with no aliases,
 + * they will be added in any order.
 + *
 + * The array returned will not have any gaps.
>>
>> Thanks for the detailed comments - much appreciated.
>>
>>>
>>> You can't make that guarantee without incorrectly parsing the device
>>> tree; I don't believe there's any restriction on the IDs in the aliases
>>> being contiguous. Maybe in practice this restriction will be fine, but
>>> it doesn't seem like a great idea.
>>
>> Well actually I was thinking from a U-Boot POV since if someone uses a
>> device that doesn't exist U-Boot may just crash or hang. So having
>> such a hole would normally be a bug. But since there is no restriction
>> in the fdt format, and since I suppose we have to assume the user
>> knows what he is doing, I will remove this restriction.
>
> Great!
>
 + * If there is a gap in the aliases, then this function will only return 
 up
 + * to the number of nodes it found until the gap. It will also print a 
 warning
 + * in this case. As an example, say you define aliases for usb2 and usb3, 
 and
 + * have 3 nodes. Then in this case the node without an alias will become 
 usb0
 + * and the aliases will be use for usb2 and usb3. But since there is no
 + * usb1, this function will only list one node (usb0), and will print a
 + * warning.
 + *
 + * This function does not check node properties - so it is possible that 
 the
 + * node is marked disabled (status = "disabled"). The caller is expected 
 to
 + * deal with this.
 + * TBD: It might be nicer to handle this here since we don't want a
 + * discontiguous list to result in the caller.
>>>
>>> Yes, I think handling disabled is a requirement; Tegra has quite a few
>>> instances of each HW module, and in many cases, not all of them are used
>>> by a given board design, so they're marked disabled.
>>>
>>> I don't think this has any impact on handling discontiguous device IDs;
>>> I think we need that anyway.
>>
>> Yes ok. In that case I will make the code check for status =
>> "disabled" at the same time. It is convenient.
>
> Thanks.
>
>>> The itself array could always be contiguous if each entry were a pair
>>> (id, node) instead of the ID being implied by the array index.
>>
>> Slightly easier to do it this way I think. Not completely sure yet.
>>
>>>
 + *
 + * Note: the algorithm used is O(maxcount).
 + *
 + * @param blob               FDT blob to use
 + * @param name               Root name of alias to search for
 + * @param id         Compatible ID to look for
>>>
>>> That's a little restrictive. Many drivers will handle multiple
>>> compatible values, e.g. N manufactures each making identical chips but
>>> giving each its own marketing name. These need different compatible
>>> flags in case some bug WAR needs to differentiate between them. Equally,
>>> Tegra30's say I2C controllers will be compatible with both
>>> nvidia,tegra30-i2c and nvidia,tegra20-i2c. While missing out the Tegra20
>>> compatible value would probably technically be a bug in the device tree,
>>> it does seem reasonable to expect the driver to still match on the
>>> Tegra30 compatible value.
>>
>> I think you are asking then for a list of IDs to match on. Is that
>> right? How about I rename this function to
>> fdtdec_find_aliases_for_id() and we then can create a
>> fdtdec_find_aliases() function later when needed for T3

Re: [U-Boot] [PATCH v2 0/9] Unified command execution in one place

2012-01-11 Thread Simon Glass
Hi,

On Sat, Dec 10, 2011 at 10:43 AM, Simon Glass  wrote:
> At present two parsers have similar code to execute commands. Also
> cmd_usage() is called all over the place. This series adds a single
> function which processes commands called cmd_process().
>
> This new function understands return codes, and in particular
> CMD_RET_USAGE to indicate a usage error. So rather than calling
> cmd_usage() themselves, the command handlers can just return this
> error.
>
> There appears to be a run_command2() which is used to run commands
> with the selected parser. This series changes this in two separate
> steps to just run_command(), and renames the old run_command() to
> builtin_run_command(). No one should call this outside main.c since
> if the hush parser is being used it is wrong to call it. The
> built-in parser code could move into a separate file perhaps in a
> future patch.
>
> The overall series reduces code size on ARM by about 1KB on
> my ~160KB U-Boot text region when the hush parser is used, and around
> 60 bytes when it isn't.
>
> As an aside the only user of parse_line() is fsl_ddr_interactive()
> which seems to have its own command line interface which operates
> before DRAM is set up. Do I have this right? Is there no way this
> could be done later from a normal U-Boot command?
>
> (I have run this through MAKEALL and it seems clean)
>
> Changes in v2:
> - Fix minor errors one of which created a warning
> - Squash i2c patch into the common/ patch
>
> Simon Glass (9):
>  Remove CMD_PXE's static on run_command()
>  Rename run_command() to builtin_run_command()
>  Rename run_command2() to run_command()
>  Stop using builtin_run_command()
>  Don't include standard parser if hush is used
>  Create a single cmd_call() function to handle command execution
>  Remove interleave of non-U-Boot code in hush
>  Add cmd_process() to process commands in one place
>  Convert cmd_usage() calls in common to use a return value

Does any of the maintainers feel inclined to pick up these patches? It
still seems to rebase cleanly against master, so it might be ok as is,
but happy to resend if needed.

Regards,
Simon

>
>  arch/arm/cpu/arm926ejs/kirkwood/cpu.c |    7 +--
>  board/esd/common/cmd_loadpci.c        |    2 +-
>  board/esd/du440/du440.c               |    2 +-
>  common/cmd_bedbug.c                   |    6 +-
>  common/cmd_bmp.c                      |    6 +-
>  common/cmd_boot.c                     |    2 +-
>  common/cmd_bootm.c                    |   10 +---
>  common/cmd_cache.c                    |    4 +-
>  common/cmd_dataflash_mmc_mux.c        |    2 +-
>  common/cmd_date.c                     |    3 +-
>  common/cmd_dcr.c                      |    8 +-
>  common/cmd_df.c                       |    2 +-
>  common/cmd_eeprom.c                   |    2 +-
>  common/cmd_ext2.c                     |    4 +-
>  common/cmd_fdc.c                      |    2 +-
>  common/cmd_fdos.c                     |    2 +-
>  common/cmd_fdt.c                      |   14 ++--
>  common/cmd_fitupd.c                   |    2 +-
>  common/cmd_flash.c                    |   14 ++--
>  common/cmd_fpga.c                     |    4 +-
>  common/cmd_gpio.c                     |    2 +-
>  common/cmd_i2c.c                      |   32 +-
>  common/cmd_ide.c                      |   10 ++--
>  common/cmd_irq.c                      |    2 +-
>  common/cmd_itest.c                    |    2 +-
>  common/cmd_led.c                      |    6 +-
>  common/cmd_load.c                     |    2 +-
>  common/cmd_log.c                      |    4 +-
>  common/cmd_md5sum.c                   |    2 +-
>  common/cmd_mdio.c                     |    2 +-
>  common/cmd_mem.c                      |   22 
>  common/cmd_mfsl.c                     |   10 ++--
>  common/cmd_mgdisk.c                   |    2 +-
>  common/cmd_mii.c                      |    4 +-
>  common/cmd_misc.c                     |    2 +-
>  common/cmd_mmc.c                      |   14 ++--
>  common/cmd_mmc_spi.c                  |    3 +-
>  common/cmd_mp.c                       |    8 +-
>  common/cmd_mtdparts.c                 |    2 +-
>  common/cmd_nand.c                     |    6 +-
>  common/cmd_net.c                      |    6 +-
>  common/cmd_nvedit.c                   |   22 
>  common/cmd_onenand.c                  |   12 ++--
>  common/cmd_otp.c                      |    2 +-
>  common/cmd_pci.c                      |    2 +-
>  common/cmd_portio.c                   |    4 +-
>  common/cmd_pxe.c                      |   10 ++--
>  common/cmd_reiser.c                   |    4 +-
>  common/cmd_sata.c                     |    8 +-
>  common/cmd_scsi.c                     |   15 +++--
>  common/cmd_setexpr.c                  |    2 +-
>  common/cmd_sf.c                       |    2 +-
>  common/cmd_sha1sum.c                  |    2 +-
>  common/cmd_source.c                   |    2 +-
>  common/cmd_strings.c                  |    2 +-
>  comm

[U-Boot] [PATCH v4 09/20] fdt: Add tegra-usb bindings file from linux

2012-01-11 Thread Simon Glass
This file is taken from the Linux mailing list.

Signed-off-by: Simon Glass 
---

 doc/device-tree-bindings/usb/tegra-usb.txt |   13 +
 1 files changed, 13 insertions(+), 0 deletions(-)
 create mode 100644 doc/device-tree-bindings/usb/tegra-usb.txt

diff --git a/doc/device-tree-bindings/usb/tegra-usb.txt 
b/doc/device-tree-bindings/usb/tegra-usb.txt
new file mode 100644
index 000..035d63d
--- /dev/null
+++ b/doc/device-tree-bindings/usb/tegra-usb.txt
@@ -0,0 +1,13 @@
+Tegra SOC USB controllers
+
+The device node for a USB controller that is part of a Tegra
+SOC is as described in the document "Open Firmware Recommended
+Practice : Universal Serial Bus" with the following modifications
+and additions :
+
+Required properties :
+ - compatible : Should be "nvidia,tegra20-ehci" for USB controllers
+   used in host mode.
+ - phy_type : Should be one of "ulpi" or "utmi".
+ - nvidia,vbus-gpio : If present, specifies a gpio that needs to be
+   activated for the bus to be powered.
-- 
1.7.7.3

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


[U-Boot] [PATCH v4 12/20] tegra: usb: fdt: Add additional device tree definitions for USB ports

2012-01-11 Thread Simon Glass
This adds clock references to the USB part of the device tree for U-Boot.

The USB timing information may vary between boards sometimes, but for
now we hard-code it in C. This is because all current T2x boards use
the same values, we will deal with T3x later and we first need to agree
on the format for this timing information in the fdt and may in fact
decide that it has no place there.

Signed-off-by: Simon Glass 
---

 arch/arm/dts/tegra20.dtsi |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/arch/arm/dts/tegra20.dtsi b/arch/arm/dts/tegra20.dtsi
index 68eae12..ca7b523 100644
--- a/arch/arm/dts/tegra20.dtsi
+++ b/arch/arm/dts/tegra20.dtsi
@@ -176,6 +176,7 @@
reg = <0xc500 0x4000>;
interrupts = < 52 >;
phy_type = "utmi";
+   clocks = <&periph_clk 22>;  // PERIPH_ID_USBD
};
 
usb@c5004000 {
@@ -183,6 +184,7 @@
reg = <0xc5004000 0x4000>;
interrupts = < 53 >;
phy_type = "ulpi";
+   clocks = <&periph_clk 58>;  // PERIPH_ID_USB2
};
 
usb@c5008000 {
@@ -190,6 +192,7 @@
reg = <0xc5008000 0x4000>;
interrupts = < 129 >;
phy_type = "utmi";
+   clocks = <&periph_clk 59>;  // PERIPH_ID_USB3
};
 
 };
-- 
1.7.7.3

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


[U-Boot] [PATCH v4 13/20] tegra: usb: fdt: Add USB definitions for Tegra2 Seaboard

2012-01-11 Thread Simon Glass
We set up two USB ports, one of which can be host or device.
For some reason the kernel version does enable both ports.

Signed-off-by: Simon Glass 
---
Changes in v2:
- Use "okay" instead of "ok" for fdt node status
- Remove 0x from fdt aliases

Changes in v3:
- Remove "okay" from nodes since this is the default anyway
- Fix device tree indenting with tabs instead of spaces
- Disable USB2 which is not used on Seaboard

 board/nvidia/dts/tegra2-seaboard.dts |   11 +++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/board/nvidia/dts/tegra2-seaboard.dts 
b/board/nvidia/dts/tegra2-seaboard.dts
index dde5d03..7a4ecae 100644
--- a/board/nvidia/dts/tegra2-seaboard.dts
+++ b/board/nvidia/dts/tegra2-seaboard.dts
@@ -11,6 +11,12 @@
bootargs = "vmalloc=192M video=tegrafb console=ttyS0,115200n8 
root=/dev/mmcblk1p3 rw rootwait";
};
 
+   aliases {
+   /* This defines the order of our USB ports */
+   usb0 = "/usb@c5008000";
+   usb1 = "/usb@c500";
+   };
+
memory {
device_type = "memory";
reg = < 0x 0x4000 >;
@@ -32,5 +38,10 @@
 
usb@c500 {
nvidia,vbus-gpio = <&gpio 24 0>; /* PD0 */
+   support-host-mode;
+   };
+
+   usb@c5004000 {
+   status = "disabled";
};
 };
-- 
1.7.7.3

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


[U-Boot] [PATCH v4 16/20] tegra: usb: Add support for Tegra USB peripheral

2012-01-11 Thread Simon Glass
This adds basic support for the Tegra2 USB controller. Board files should
call board_usb_init() to set things up.

Configuration is performed through the FDT, with aliases used to set the
order of the ports, like this fragment:

aliases {
/* This defines the order of our USB ports */
usb0 = "/usb@0xc5008000";
usb1 = "/usb@0xc500";
};

drivers/usb/host files ONLY: Acked-by: Remy Bohmer 
Signed-off-by: Simon Glass 
---
Changes in v2:
- Rename params to timing
- Store entire fdt config in port list, not just register pointer
- Remove non-fdt operation of USB, since it is not needed
- Decode USB VBUS GPIO from the fdt
- Decode phy type differently (to match new kernel fdt)
- Rename tegra20-usb to tegra20-ehcui (to match new kernel fdt)
- Improve debug() printouts in case of failure to init USB

Changes in v3:
- Remove usbparams properties from fdt and moved them to C code

Changes in v4:
- Use updated fdtdec alias functiona to get USB aliases
- Use peripheral clock node to obtain peripheral ID

 arch/arm/cpu/armv7/tegra2/Makefile|4 +-
 arch/arm/cpu/armv7/tegra2/usb.c   |  426 +
 arch/arm/include/asm/arch-tegra2/tegra2.h |2 +
 arch/arm/include/asm/arch-tegra2/usb.h|  255 +
 drivers/usb/host/Makefile |1 +
 drivers/usb/host/ehci-tegra.c |   63 +
 include/fdtdec.h  |1 +
 lib/fdtdec.c  |1 +
 8 files changed, 752 insertions(+), 1 deletions(-)
 create mode 100644 arch/arm/cpu/armv7/tegra2/usb.c
 create mode 100644 arch/arm/include/asm/arch-tegra2/usb.h
 create mode 100644 drivers/usb/host/ehci-tegra.c

diff --git a/arch/arm/cpu/armv7/tegra2/Makefile 
b/arch/arm/cpu/armv7/tegra2/Makefile
index f668a81..e9ac6c9 100644
--- a/arch/arm/cpu/armv7/tegra2/Makefile
+++ b/arch/arm/cpu/armv7/tegra2/Makefile
@@ -33,8 +33,10 @@ include $(TOPDIR)/config.mk
 LIB=  $(obj)lib$(SOC).o
 
 SOBJS  := lowlevel_init.o
-COBJS  := ap20.o board.o clock.o funcmux.o pinmux.o sys_info.o timer.o
+COBJS-y:= ap20.o board.o clock.o funcmux.o pinmux.o sys_info.o timer.o
+COBJS-$(CONFIG_USB_EHCI_TEGRA) += usb.o
 
+COBJS  := $(COBJS-y)
 SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(COBJS) $(SOBJS))
 
diff --git a/arch/arm/cpu/armv7/tegra2/usb.c b/arch/arm/cpu/armv7/tegra2/usb.c
new file mode 100644
index 000..62d32b4
--- /dev/null
+++ b/arch/arm/cpu/armv7/tegra2/usb.c
@@ -0,0 +1,426 @@
+/*
+ * Copyright (c) 2011 The Chromium OS Authors.
+ * (C) Copyright 2010,2011 NVIDIA Corporation 
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+enum {
+   USB_PORTS_MAX   = 4,/* Maximum ports we allow */
+};
+
+/* Parameters we need for USB */
+enum {
+   PARAM_DIVN, /* PLL FEEDBACK DIVIDer */
+   PARAM_DIVM, /* PLL INPUT DIVIDER */
+   PARAM_DIVP, /* POST DIVIDER (2^N) */
+   PARAM_CPCON,/* BASE PLLC CHARGE Pump setup ctrl */
+   PARAM_LFCON,/* BASE PLLC LOOP FILter setup ctrl */
+   PARAM_ENABLE_DELAY_COUNT,   /* PLL-U Enable Delay Count */
+   PARAM_STABLE_COUNT, /* PLL-U STABLE count */
+   PARAM_ACTIVE_DELAY_COUNT,   /* PLL-U Active delay count */
+   PARAM_XTAL_FREQ_COUNT,  /* PLL-U XTAL frequency count */
+   PARAM_DEBOUNCE_A_TIME,  /* 10MS DELAY for BIAS_DEBOUNCE_A */
+   PARAM_BIAS_TIME,/* 20US DELAY AFter bias cell op */
+
+   PARAM_COUNT
+};
+
+/* Information about a USB port */
+struct fdt_usb {
+   struct usb_ctlr *reg;   /* address of registers in physical memory */
+   int host_mode;  /* 1 if port has host mode, else 0 */
+   int utmi;   /* 1 if port has external tranceiver, else 0 */
+   int enabled;/* 1 to enable, 0 to disable */
+   enum periph_id periph_id;/* peripheral id */
+   struct fdt_gpio_state 

[U-Boot] [PATCH v4 14/20] usb: Add support for txfifo threshold

2012-01-11 Thread Simon Glass
CONFIG_USB_EHCI_TXFIFO_THRESH enables setting of the txfilltuning
field in the EHCI controller on reset.

Signed-off-by: Simon Glass 
---

 README  |3 +++
 drivers/usb/host/ehci-hcd.c |7 +++
 drivers/usb/host/ehci.h |6 +-
 3 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/README b/README
index 9d713e8..7adf7c7 100644
--- a/README
+++ b/README
@@ -1135,6 +1135,9 @@ The following options need to be configured:
May be defined to allow interrupt polling
instead of using asynchronous interrupts
 
+   CONFIG_USB_EHCI_TXFIFO_THRESH enables setting of the
+   txfilltuning field in the EHCI controller on reset.
+
 - USB Device:
Define the below if you wish to use the USB console.
Once firmware is rebuilt from a serial console issue the
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index 3f7bc2c..d893b2a 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -259,6 +259,13 @@ static int ehci_reset(void)
 #endif
ehci_writel(reg_ptr, tmp);
}
+
+#ifdef CONFIG_USB_EHCI_TXFIFO_THRESH
+   cmd = ehci_readl(&hcor->or_txfilltuning);
+   cmd &= ~TXFIFO_THRESH(0x3f);
+   cmd |= TXFIFO_THRESH(CONFIG_USB_EHCI_TXFIFO_THRESH);
+   ehci_writel(&hcor->or_txfilltuning, cmd);
+#endif
 out:
return ret;
 }
diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h
index 3d0ad0c..cc00ce4 100644
--- a/drivers/usb/host/ehci.h
+++ b/drivers/usb/host/ehci.h
@@ -80,7 +80,11 @@ struct ehci_hcor {
uint32_t or_ctrldssegment;
uint32_t or_periodiclistbase;
uint32_t or_asynclistaddr;
-   uint32_t _reserved_[9];
+   uint32_t _reserved_0_;
+   uint32_t or_burstsize;
+   uint32_t or_txfilltuning;
+#define TXFIFO_THRESH(p)   ((p & 0x3f) << 16)
+   uint32_t _reserved_1_[6];
uint32_t or_configflag;
 #define FLAG_CF(1 << 0)/* true:  we'll support "high 
speed" */
uint32_t or_portsc[CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS];
-- 
1.7.7.3

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


[U-Boot] [PATCH v4 15/20] fdt: Add function to return peripheral/clock ID

2012-01-11 Thread Simon Glass
A common requirement is to find the clock ID for a peripheral. This is the
second cell of the 'clocks' property (the first being the phandle itself).

Signed-off-by: Simon Glass 
---
Changes in v4:
- Add fdtdec function to return peripheral ID

 include/fdtdec.h |   13 +
 lib/fdtdec.c |   13 +
 2 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/include/fdtdec.h b/include/fdtdec.h
index 6c0a2d1..f3115a6 100644
--- a/include/fdtdec.h
+++ b/include/fdtdec.h
@@ -272,3 +272,16 @@ int fdtdec_decode_gpio(const void *blob, int node, const 
char *prop_name,
  * @return 0 if all ok or gpio was FDT_GPIO_NONE; -1 on error
  */
 int fdtdec_setup_gpio(struct fdt_gpio_state *gpio);
+
+/**
+ * Decode a peripheral ID from a device tree node. This may be a temporary
+ * function depending on what happens with clocks in the Linux fdt.
+ *
+ * This works by looking up the peripheral's 'clocks' node and reading out
+ * the second cell, which is the clock number / peripheral ID.
+ *
+ * @param blob FDT blob to use
+ * @param node Node to look at
+ * @return
+ */
+int fdtdec_decode_periph_id(const void *blob, int node);
diff --git a/lib/fdtdec.c b/lib/fdtdec.c
index f0b2196..780948c 100644
--- a/lib/fdtdec.c
+++ b/lib/fdtdec.c
@@ -414,3 +414,16 @@ int fdtdec_setup_gpio(struct fdt_gpio_state *gpio)
return -1;
return 0;
 }
+
+int fdtdec_decode_periph_id(const void *blob, int node)
+{
+   u32 cell[2];
+   int err;
+
+   err = fdtdec_get_int_array(blob, node, "clocks", cell,
+  ARRAY_SIZE(cell));
+   if (err)
+   return -1;
+
+   return cell[1];
+}
-- 
1.7.7.3

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


[U-Boot] [PATCH v4 17/20] tegra: usb: Add USB support to nvidia boards

2012-01-11 Thread Simon Glass
This adds basic USB support for port 0. The other port is not supported
yet.

Tegra2 (SeaBoard) # usb start
(Re)start USB...
USB:   Register 10011 NbrPorts 1
USB EHCI 1.00
scanning bus for devices... 5 USB Device(s) found
   scanning bus for storage devices... 1 Storage Device(s) found
Tegra2 (SeaBoard) # ext2load usb 0:3 1000 /boot/vmlinuz
Loading file "/boot/vmlinuz" from usb device 0:3 (ROOT-A)
2932976 bytes read

Signed-off-by: Simon Glass 
---
Changes in v2:
- Add setting of pinmux for USB VBUS GPIO

 board/nvidia/common/board.c |8 
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/board/nvidia/common/board.c b/board/nvidia/common/board.c
index e8253a0..a7c566d 100644
--- a/board/nvidia/common/board.c
+++ b/board/nvidia/common/board.c
@@ -33,6 +33,7 @@
 #include 
 #include 
 #include 
+#include 
 #include "board.h"
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -69,6 +70,13 @@ int board_init(void)
/* boot param addr */
gd->bd->bi_boot_params = (NV_PA_SDRAM_BASE + 0x100);
 
+#ifdef CONFIG_USB_EHCI_TEGRA
+   /* For USB GPIO PD0. for now, since we have no pinmux in fdt */
+   pinmux_tristate_disable(PINGRP_SLXK);
+
+   board_usb_init(gd->fdt_blob);
+#endif
+
return 0;
 }
 
-- 
1.7.7.3

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


[U-Boot] [PATCH v4 11/20] tegra: fdt: Add clock bindings

2012-01-11 Thread Simon Glass
This adds a basic binding for the oscillator and peripheral clocks. The
second cell is the clock number, defined as the bit number within the clock
enable register if the peripheral clock.

This uses the RFC clock bindings from Grant Likely so may change later:

https://lkml.org/lkml/2011/12/12/498

Signed-off-by: Simon Glass 
---
Changes in v4:
- Add clock bindings for Tegra2x

 arch/arm/dts/tegra20.dtsi  |   27 
 doc/device-tree-bindings/clock/tegra-periphclk |   51 
 2 files changed, 78 insertions(+), 0 deletions(-)
 create mode 100644 doc/device-tree-bindings/clock/tegra-periphclk

diff --git a/arch/arm/dts/tegra20.dtsi b/arch/arm/dts/tegra20.dtsi
index 6146d24..68eae12 100644
--- a/arch/arm/dts/tegra20.dtsi
+++ b/arch/arm/dts/tegra20.dtsi
@@ -4,6 +4,33 @@
compatible = "nvidia,tegra20";
interrupt-parent = <&intc>;
 
+   clocks = <&osc_clk>;
+   clock-names = "osc_clk";
+   clock-ranges;
+
+   clocks {
+   #address-cells = <1>;
+   #size-cells = <1>;
+
+   /* The frequency of this clock is board-specific */
+   osc_clk: oscclk {
+   compatible = "fixed-clock";
+   #clock-cells = <0>;
+   };
+
+   /*
+* This node provides clocks to all peripherals. We don't
+* enumerate the clock names for now since there are no
+* users of this information.
+*/
+   periph_clk: periphclk {
+   compatible = "tegra,periphclk";
+   #clock-cells = <1>;
+   clocks = <&osc_clk>;
+   reg = <0x60006000 400>;
+   };
+   };
+
intc: interrupt-controller@50041000 {
compatible = "nvidia,tegra20-gic";
interrupt-controller;
diff --git a/doc/device-tree-bindings/clock/tegra-periphclk 
b/doc/device-tree-bindings/clock/tegra-periphclk
new file mode 100644
index 000..8d21e4d
--- /dev/null
+++ b/doc/device-tree-bindings/clock/tegra-periphclk
@@ -0,0 +1,51 @@
+Clock controllers
+
+(there isn't yet a binding in Linux, so this describes what is in U-Boot)
+
+The device node for a clock controller is as described in the document
+"Open Firmware Recommended Practice : Universal Serial Bus" with the
+following modifications and additions :
+
+This is based on Grant Likely's proposed patch for clock bindings.
+
+Required properties :
+ - compatible : Should be "tegra,periphclk" for peripheral clock controller
+ - clocks : Should contain a single phandle pointing to the oscillator clock
+
+Peripherals which refer to a clock should have a property called "clocks" with
+two cells: phandle of the peripheral clock and the clock ID number (which
+is the bit number in the peripheral clock controller enable register numbered
+from 0).
+
+Example:
+
+clocks {
+   #address-cells = <1>;
+   #size-cells = <1>;
+
+   /* The frequency of this clock is board-specific */
+   osc_clk: oscclk {
+   compatible = "fixed-clock";
+   #clock-cells = <0>;
+   };
+
+   /*
+* This node provides clocks to all peripherals. We don't
+* enumerate the clock names for now since there are no
+* users of this information.
+*/
+   periph_clk: periphclk {
+   compatible = "tegra,periphclk";
+   #clock-cells = <1>;
+   clocks = <&osc_clk>;
+   reg = <0x60006000 400>;
+   };
+};
+
+usb@c5004000 {
+   compatible = "nvidia,tegra20-ehci", "usb-ehci";
+   reg = <0xc5004000 0x4000>;
+   interrupts = < 53 >;
+   phy_type = "ulpi";
+   clocks = <&periph_clk 58>;  // PERIPH_ID_USB2
+};
-- 
1.7.7.3

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


[U-Boot] [PATCH v4 18/20] tegra: usb: Add common USB defines for tegra2 boards

2012-01-11 Thread Simon Glass
All Tegra2 boards should include tegra2-common. This adds the required
USB config to that file.

Signed-off-by: Simon Glass 
---

 include/configs/tegra2-common.h |   14 ++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/include/configs/tegra2-common.h b/include/configs/tegra2-common.h
index e6f385f..6549d00 100644
--- a/include/configs/tegra2-common.h
+++ b/include/configs/tegra2-common.h
@@ -84,6 +84,20 @@
 #define CONFIG_SYS_BAUDRATE_TABLE  {4800, 9600, 19200, 38400, 57600,\
115200}
 
+/*
+ * USB Host. Tegra2 requires USB buffers to be aligned to a word boundary
+ */
+#define CONFIG_USB_EHCI_DATA_ALIGN 4
+
+/*
+ * This parameter affects a TXFILLTUNING field that controls how much data is
+ * sent to the latency fifo before it is sent to the wire. Without this
+ * parameter, the default (2) causes occasional Data Buffer Errors in OUT
+ * packets depending on the buffer address and size.
+ */
+#define CONFIG_USB_EHCI_TXFIFO_THRESH  10
+
+#define CONFIG_EHCI_IS_TDI
 /* include default commands */
 #include 
 
-- 
1.7.7.3

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


[U-Boot] [PATCH v4 19/20] tegra: usb: Enable USB on Seaboard

2012-01-11 Thread Simon Glass
Seaboard has a top port which is USB host or device, and a side port which
is host only.

Signed-off-by: Simon Glass 
---
Changes in v2:
- Remove unneeded CONFIG_TEGRA_USBx defines

 include/configs/seaboard.h |7 +++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/include/configs/seaboard.h b/include/configs/seaboard.h
index 261f952..b6d9f7a 100644
--- a/include/configs/seaboard.h
+++ b/include/configs/seaboard.h
@@ -72,4 +72,11 @@
 
 #define CONFIG_ENV_SECT_SIZECONFIG_ENV_SIZE
 #define CONFIG_ENV_OFFSET   (CONFIG_SPI_FLASH_SIZE - CONFIG_ENV_SECT_SIZE)
+
+/* USB Host support */
+#define CONFIG_USB_EHCI
+#define CONFIG_USB_EHCI_TEGRA
+#define CONFIG_USB_STORAGE
+#define CONFIG_CMD_USB
+
 #endif /* __CONFIG_H */
-- 
1.7.7.3

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


[U-Boot] [PATCH v4 20/20] tegra: fdt: Enable FDT support for Seaboard

2012-01-11 Thread Simon Glass
This switches Seaboard over to use FDT for run-time config instead of
CONFIG options. USB is the only user at present.

Signed-off-by: Simon Glass 
---
Changes in v3:
- Drop Tegra USB alignment patch as we will deal with this another way

 include/configs/seaboard.h |5 +
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/include/configs/seaboard.h b/include/configs/seaboard.h
index b6d9f7a..1dc775a 100644
--- a/include/configs/seaboard.h
+++ b/include/configs/seaboard.h
@@ -27,6 +27,11 @@
 #include 
 #include "tegra2-common.h"
 
+/* Enable fdt support for Seaboard. Flash the image in u-boot-dtb.bin */
+#define CONFIG_DEFAULT_DEVICE_TREE tegra2-seaboard
+#define CONFIG_OF_CONTROL
+#define CONFIG_OF_SEPARATE
+
 /* High-level configuration options */
 #define TEGRA2_SYSMEM  "mem=384M@0M nvmem=128M@384M mem=512M@512M"
 #define V_PROMPT   "Tegra2 (SeaBoard) # "
-- 
1.7.7.3

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


[U-Boot] [PATCH v4 06/20] tegra: fdt: Add Tegra2x device tree file from kernel

2012-01-11 Thread Simon Glass
This was taken from commit b48c54e2 at:
git://git.kernel.org/pub/scm/linux/kernel/git/olof/tegra.git

config.mk is updated to provide this file to boards through the
built-in mechanism:

/include/ ARCH_CPU_DTS

Signed-off-by: Simon Glass 
---

 arch/arm/cpu/armv7/tegra2/config.mk |2 +
 arch/arm/dts/tegra20.dtsi   |  169 +++
 2 files changed, 171 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/dts/tegra20.dtsi

diff --git a/arch/arm/cpu/armv7/tegra2/config.mk 
b/arch/arm/cpu/armv7/tegra2/config.mk
index 2303dba..fe9ef5b 100644
--- a/arch/arm/cpu/armv7/tegra2/config.mk
+++ b/arch/arm/cpu/armv7/tegra2/config.mk
@@ -31,3 +31,5 @@ CFLAGS_arch/arm/lib/board.o += -march=armv4t
 endif
 
 USE_PRIVATE_LIBGCC = yes
+
+CONFIG_ARCH_DEVICE_TREE := tegra20
diff --git a/arch/arm/dts/tegra20.dtsi b/arch/arm/dts/tegra20.dtsi
new file mode 100644
index 000..6146d24
--- /dev/null
+++ b/arch/arm/dts/tegra20.dtsi
@@ -0,0 +1,169 @@
+/include/ "skeleton.dtsi"
+
+/ {
+   compatible = "nvidia,tegra20";
+   interrupt-parent = <&intc>;
+
+   intc: interrupt-controller@50041000 {
+   compatible = "nvidia,tegra20-gic";
+   interrupt-controller;
+   #interrupt-cells = <1>;
+   reg = < 0x50041000 0x1000 >,
+ < 0x50040100 0x0100 >;
+   };
+
+   i2c@7000c000 {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   compatible = "nvidia,tegra20-i2c";
+   reg = <0x7000C000 0x100>;
+   interrupts = < 70 >;
+   };
+
+   i2c@7000c400 {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   compatible = "nvidia,tegra20-i2c";
+   reg = <0x7000C400 0x100>;
+   interrupts = < 116 >;
+   };
+
+   i2c@7000c500 {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   compatible = "nvidia,tegra20-i2c";
+   reg = <0x7000C500 0x100>;
+   interrupts = < 124 >;
+   };
+
+   i2c@7000d000 {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   compatible = "nvidia,tegra20-i2c";
+   reg = <0x7000D000 0x200>;
+   interrupts = < 85 >;
+   };
+
+   i2s@70002800 {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   compatible = "nvidia,tegra20-i2s";
+   reg = <0x70002800 0x200>;
+   interrupts = < 45 >;
+   dma-channel = < 2 >;
+   };
+
+   i2s@70002a00 {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   compatible = "nvidia,tegra20-i2s";
+   reg = <0x70002a00 0x200>;
+   interrupts = < 35 >;
+   dma-channel = < 1 >;
+   };
+
+   das@7c00 {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   compatible = "nvidia,tegra20-das";
+   reg = <0x7c00 0x80>;
+   };
+
+   gpio: gpio@6000d000 {
+   compatible = "nvidia,tegra20-gpio";
+   reg = < 0x6000d000 0x1000 >;
+   interrupts = < 64 65 66 67 87 119 121 >;
+   #gpio-cells = <2>;
+   gpio-controller;
+   };
+
+   pinmux: pinmux@7000 {
+   compatible = "nvidia,tegra20-pinmux";
+   reg = < 0x7014 0x10/* Tri-state registers */
+   0x7080 0x20/* Mux registers */
+   0x70a0 0x14/* Pull-up/down registers */
+   0x7868 0xa8 >; /* Pad control registers */
+   };
+
+   serial@70006000 {
+   compatible = "nvidia,tegra20-uart";
+   reg = <0x70006000 0x40>;
+   reg-shift = <2>;
+   interrupts = < 68 >;
+   };
+
+   serial@70006040 {
+   compatible = "nvidia,tegra20-uart";
+   reg = <0x70006040 0x40>;
+   reg-shift = <2>;
+   interrupts = < 69 >;
+   };
+
+   serial@70006200 {
+   compatible = "nvidia,tegra20-uart";
+   reg = <0x70006200 0x100>;
+   reg-shift = <2>;
+   interrupts = < 78 >;
+   };
+
+   serial@70006300 {
+   compatible = "nvidia,tegra20-uart";
+   reg = <0x70006300 0x100>;
+   reg-shift = <2>;
+   interrupts = < 122 >;
+   };
+
+   serial@70006400 {
+   compatible = "nvidia,tegra20-uart";
+   reg = <0x70006400 0x100>;
+   reg-shift = <2>;
+   interrupts = < 123 >;
+   };
+
+   sdhci@c800 {
+   compatible = "nvidia,tegra20-sdhci";
+   reg = <0xc800 0x200>;
+   interrupts = < 46 >;
+   };
+
+   sdhci@c8000200 {
+   compatible = "nvidia,tegra20-sdhci";
+

[U-Boot] [PATCH v4 03/20] fdt: Add basic support for decoding GPIO definitions

2012-01-11 Thread Simon Glass
This adds some support into fdtdec for reading GPIO definitions from
the fdt. We permit up to FDT_GPIO_MAX GPIOs in the system. Each GPIO
is of the form:

gpio-function-name = ;

where:

phandle is a pointer to the GPIO node
gpio_num is the number of the GPIO (0 to 223)
flags is a flag, as follows:

   bitmeaning
   0  0=polarity normal, 1=active low (inverted)

An example is:

gpio-enable-propounder = <&gpio 43 0>;

which means that GPIO 43 is used to enable the propounder (setting the
GPIO high), or that you can detect that the propounder is enabled by
checking if the GPIO is high (the fdt does not indicate input/output).

Two main functions are provided:

fdtdec_decode_gpio() reads a GPIO property from an fdt node and decodes it
into a structure.

fdtdec_setup_gpio() sets up the GPIO by calling gpio_request for you.

Both functions can cope with the property being missing, which is taken to
mean that that GPIO function is not available or is not needed.

Signed-off-by: Simon Glass 
---

 include/fdtdec.h |   45 +++
 lib/fdtdec.c |   78 ++
 2 files changed, 123 insertions(+), 0 deletions(-)

diff --git a/include/fdtdec.h b/include/fdtdec.h
index 047f603..6c0a2d1 100644
--- a/include/fdtdec.h
+++ b/include/fdtdec.h
@@ -61,6 +61,23 @@ enum fdt_compat_id {
COMPAT_COUNT,
 };
 
+/* GPIOs are numbered from 0 */
+enum {
+   FDT_GPIO_NONE = -1U,/* an invalid GPIO used to end our list */
+
+   FDT_GPIO_ACTIVE_LOW = 1 << 0,   /* input is active low (else high) */
+};
+
+/* This is the state of a GPIO pin as defined by the fdt */
+struct fdt_gpio_state {
+   const char *name;   /* name of the fdt property defining this */
+   uint gpio;  /* GPIO number, or FDT_GPIO_NONE if none */
+   u8 flags;   /* FDT_GPIO_... flags */
+};
+
+/* This tells us whether a fdt_gpio_state record is valid or not */
+#define fdt_gpio_isvalid(x) ((x)->gpio != FDT_GPIO_NONE)
+
 /**
  * Find the next numbered alias for a peripheral. This is used to enumerate
  * all the peripherals of a certain type.
@@ -227,3 +244,31 @@ int fdtdec_get_int_array(const void *blob, int node, const 
char *prop_name,
  * @return 1 if the properly is present; 0 if it isn't present
  */
 int fdtdec_get_bool(const void *blob, int node, const char *prop_name);
+
+/**
+ * Decode a single GPIOs from an FDT.
+ *
+ * If the property is not found, then the GPIO structure will still be
+ * initialised, with gpio set to FDT_GPIO_NONE. This makes it easy to
+ * provide optional GPIOs.
+ *
+ * @param blob FDT blob to use
+ * @param node Node to look at
+ * @param prop_nameNode property name
+ * @param gpio gpio elements to fill from FDT
+ * @return 0 if ok, -FDT_ERR_NOTFOUND if the property is missing.
+ */
+int fdtdec_decode_gpio(const void *blob, int node, const char *prop_name,
+   struct fdt_gpio_state *gpio);
+
+/**
+ * Set up a GPIO pin according to the provided gpio information. At present 
this
+ * just requests the GPIO.
+ *
+ * If the gpio is FDT_GPIO_NONE, no action is taken. This makes it easy to
+ * deal with optional GPIOs.
+ *
+ * @param gpio GPIO info to use for set up
+ * @return 0 if all ok or gpio was FDT_GPIO_NONE; -1 on error
+ */
+int fdtdec_setup_gpio(struct fdt_gpio_state *gpio);
diff --git a/lib/fdtdec.c b/lib/fdtdec.c
index 977528b..f0b2196 100644
--- a/lib/fdtdec.c
+++ b/lib/fdtdec.c
@@ -24,6 +24,9 @@
 #include 
 #include 
 
+/* we need the generic GPIO interface here */
+#include 
+
 DECLARE_GLOBAL_DATA_PTR;
 
 /*
@@ -336,3 +339,78 @@ int fdtdec_get_bool(const void *blob, int node, const char 
*prop_name)
cell = fdt_getprop(blob, node, prop_name, &len);
return cell != NULL;
 }
+
+/**
+ * Decode a list of GPIOs from an FDT. This creates a list of GPIOs with no
+ * terminating item.
+ *
+ * @param blob FDT blob to use
+ * @param node Node to look at
+ * @param prop_nameNode property name
+ * @param gpio Array of gpio elements to fill from FDT. This will be
+ * untouched if either 0 or an error is returned
+ * @param max_countMaximum number of elements allowed
+ * @return number of GPIOs read if ok, -FDT_ERR_BADLAYOUT if max_count would
+ * be exceeded, or -FDT_ERR_NOTFOUND if the property is missing.
+ */
+static int fdtdec_decode_gpios(const void *blob, int node,
+   const char *prop_name, struct fdt_gpio_state *gpio,
+   int max_count)
+{
+   const struct fdt_property *prop;
+   const u32 *cell;
+   const char *name;
+   int len, i;
+
+   debug("%s: %s\n", __func__, prop_name);
+   assert(max_count > 0);
+   prop = fdt_get_property(blob, node, prop_name, &len);
+   if (!prop) {
+   debug("FDT: %s: property '%s' missing\n", __func__, prop_name);
+   return -FDT_ERR_NOTFOUND;
+   }
+
+   /* We will

[U-Boot] [PATCH v4 08/20] fdt: Add staging area for device tree binding documentation

2012-01-11 Thread Simon Glass
Add a directory to hold device tree binding files, to permit easy review
of this material in U-Boot patches.

Signed-off-by: Simon Glass 
---
Changes in v4:
- Add staging area for device tree bindings used in U-Boot

 doc/device-tree-bindings/README |   19 +++
 1 files changed, 19 insertions(+), 0 deletions(-)
 create mode 100644 doc/device-tree-bindings/README

diff --git a/doc/device-tree-bindings/README b/doc/device-tree-bindings/README
new file mode 100644
index 000..84e8cba
--- /dev/null
+++ b/doc/device-tree-bindings/README
@@ -0,0 +1,19 @@
+Device Tree Bindings Staging Area
+=
+
+This directory contains device tree bindings for U-Boot.
+
+These follow along with Linux kernel bindings, with a few additions. By
+adding the files here, U-Boot patches can clearly show thees additions.
+This makes it easier for device tree people to review these additions in
+patches sent to the U-Boot mailing list.
+
+The intent is not to commit these files to U-Boot, or at least only
+temporarily, Rather we hope that the files will be stored in another
+repo (shared with Linux) which is brought in as needed. Failing that,
+changes here will be  commited to the Linux
+Documentation/devicetree/bindings/ directory.
+
+
+s...@chromium.org
+11-Jan-12
-- 
1.7.7.3

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


[U-Boot] [PATCH v4 01/20] fdt: Tidy up a few fdtdec problems

2012-01-11 Thread Simon Glass
This fixes five trivial issues in fdtdec.c:
1. fdtdec_get_is_enabled() doesn't really need a default value
2. The fdt must be word-aligned, since otherwise it will fail on ARM
3. The compat_names[] array is missing its first element. This is needed
only because the first fdt_compat_id is defined to be invalid.
4. Added a header prototype for fdtdec_next_compatible()
5. Change fdtdec_next_alias() to only increment its 'upto' parameter
on success, to make the display error messages in the caller easier.

Signed-off-by: Simon Glass 
---

 include/fdtdec.h |   23 +++
 lib/fdtdec.c |   22 --
 2 files changed, 35 insertions(+), 10 deletions(-)

diff --git a/include/fdtdec.h b/include/fdtdec.h
index 3a15f55..01badd4 100644
--- a/include/fdtdec.h
+++ b/include/fdtdec.h
@@ -82,6 +82,21 @@ int fdtdec_next_alias(const void *blob, const char *name,
enum fdt_compat_id id, int *upto);
 
 /**
+ * Find the next compatible node for a peripheral.
+ *
+ * Do the first call with node = 0. This function will return a pointer to
+ * the next compatible node. Next time you call this function, pass the
+ * value returned, and the next node will be provided.
+ *
+ * @param blob FDT blob to use
+ * @param node Start node for search
+ * @param id   Compatible ID to look for (enum fdt_compat_id)
+ * @return offset of next compatible node, or -FDT_ERR_NOTFOUND if no more
+ */
+int fdtdec_next_compatible(const void *blob, int node,
+   enum fdt_compat_id id);
+
+/**
  * Look up an address property in a node and return it as an address.
  * The property must hold either one address with no trailing data or
  * one address with a length. This is only tested on 32-bit machines.
@@ -112,14 +127,14 @@ s32 fdtdec_get_int(const void *blob, int node, const char 
*prop_name,
  * Checks whether a node is enabled.
  * This looks for a 'status' property. If this exists, then returns 1 if
  * the status is 'ok' and 0 otherwise. If there is no status property,
- * it returns the default value.
+ * it returns 1 on the assumption that anything mentioned should be enabled
+ * by default.
  *
  * @param blob FDT blob
  * @param node node to examine
- * @param default_val  default value to return if no 'status' property exists
- * @return integer value 0/1, if found, or default_val if not
+ * @return integer value 0 (not enabled) or 1 (enabled)
  */
-int fdtdec_get_is_enabled(const void *blob, int node, int default_val);
+int fdtdec_get_is_enabled(const void *blob, int node);
 
 /**
  * Checks whether we have a valid fdt available to control U-Boot, and panic
diff --git a/lib/fdtdec.c b/lib/fdtdec.c
index 3852038..846ec3f 100644
--- a/lib/fdtdec.c
+++ b/lib/fdtdec.c
@@ -33,6 +33,7 @@ DECLARE_GLOBAL_DATA_PTR;
  */
 #define COMPAT(id, name) name
 static const char * const compat_names[COMPAT_COUNT] = {
+   COMPAT(UNKNOWN, ""),
 };
 
 const char *fdtdec_get_compatible(enum fdt_compat_id id)
@@ -89,14 +90,21 @@ s32 fdtdec_get_int(const void *blob, int node, const char 
*prop_name,
return default_val;
 }
 
-int fdtdec_get_is_enabled(const void *blob, int node, int default_val)
+int fdtdec_get_is_enabled(const void *blob, int node)
 {
const char *cell;
 
+   /*
+* It should say "okay", so only allow that. Some fdts use "ok" but
+* this is a bug. Please fix your device tree source file. See here
+* for discussion:
+*
+* http://www.mail-archive.com/u-boot@lists.denx.de/msg71598.html
+*/
cell = fdt_getprop(blob, node, "status", NULL);
if (cell)
-   return 0 == strcmp(cell, "ok");
-   return default_val;
+   return 0 == strcmp(cell, "okay");
+   return 1;
 }
 
 enum fdt_compat_id fd_dec_lookup(const void *blob, int node)
@@ -127,14 +135,16 @@ int fdtdec_next_alias(const void *blob, const char *name,
/* snprintf() is not available */
assert(strlen(name) < MAX_STR_LEN);
sprintf(str, "%.*s%d", MAX_STR_LEN, name, *upto);
-   (*upto)++;
node = find_alias_node(blob, str);
if (node < 0)
return node;
err = fdt_node_check_compatible(blob, node, compat_names[id]);
if (err < 0)
return err;
-   return err ? -FDT_ERR_NOTFOUND : node;
+   if (err)
+   return -FDT_ERR_NOTFOUND;
+   (*upto)++;
+   return node;
 }
 
 /* TODO: Can we tighten this code up a little? */
@@ -254,7 +264,7 @@ int fdtdec_find_aliases_for_id(const void *blob, const char 
*name,
 int fdtdec_check_fdt(void)
 {
/* We must have an fdt */
-   if (fdt_check_header(gd->fdt_blob))
+   if (((uintptr_t)gd->fdt_blob & 3) || fdt_check_header(gd->fdt_blob))
panic("No valid fdt found - please append one to U-Boot\n"
"binary or define CONFIG_OF_EMBED\n");
return 0;
-- 
1.7.7.3

___
U-B

[U-Boot] [PATCH v4 07/20] tegra: fdt: Add device tree file for Tegra2 Seaboard from kernel

2012-01-11 Thread Simon Glass
This was taken from commit b48c54e2 at:
git://git.kernel.org/pub/scm/linux/kernel/git/olof/tegra.git

Signed-off-by: Simon Glass 
---

 board/nvidia/dts/tegra2-seaboard.dts |   36 ++
 1 files changed, 36 insertions(+), 0 deletions(-)
 create mode 100644 board/nvidia/dts/tegra2-seaboard.dts

diff --git a/board/nvidia/dts/tegra2-seaboard.dts 
b/board/nvidia/dts/tegra2-seaboard.dts
new file mode 100644
index 000..dde5d03
--- /dev/null
+++ b/board/nvidia/dts/tegra2-seaboard.dts
@@ -0,0 +1,36 @@
+/dts-v1/;
+
+/memreserve/ 0x1c00 0x0400;
+/include/ ARCH_CPU_DTS
+
+/ {
+   model = "NVIDIA Seaboard";
+   compatible = "nvidia,seaboard", "nvidia,tegra20";
+
+   chosen {
+   bootargs = "vmalloc=192M video=tegrafb console=ttyS0,115200n8 
root=/dev/mmcblk1p3 rw rootwait";
+   };
+
+   memory {
+   device_type = "memory";
+   reg = < 0x 0x4000 >;
+   };
+
+   serial@70006300 {
+   clock-frequency = < 21600 >;
+   };
+
+   sdhci@c8000400 {
+   cd-gpios = <&gpio 69 0>; /* gpio PI5 */
+   wp-gpios = <&gpio 57 0>; /* gpio PH1 */
+   power-gpios = <&gpio 70 0>; /* gpio PI6 */
+   };
+
+   sdhci@c8000600 {
+   support-8bit;
+   };
+
+   usb@c500 {
+   nvidia,vbus-gpio = <&gpio 24 0>; /* PD0 */
+   };
+};
-- 
1.7.7.3

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


[U-Boot] [PATCH v4 04/20] arm: fdt: Ensure that an embedded fdt is word-aligned

2012-01-11 Thread Simon Glass
By putting the fdt blob into a distinctive area we can ensure that it appears
at the start of the data section and is word-aligned.

Note: It does not seem to be possible to get objcopy to honour its
--section-alignment flag, which would otherwise provide an easier fix
for this problem.

Signed-off-by: Simon Glass 
---

 arch/arm/cpu/armv7/u-boot.lds |5 +
 dts/Makefile  |2 +-
 2 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/arch/arm/cpu/armv7/u-boot.lds b/arch/arm/cpu/armv7/u-boot.lds
index 40ecf78..793e51b 100644
--- a/arch/arm/cpu/armv7/u-boot.lds
+++ b/arch/arm/cpu/armv7/u-boot.lds
@@ -43,6 +43,11 @@ SECTIONS
 
. = ALIGN(4);
.data : {
+   /*
+* Sadly objcopy seems to ignore --section-alignment.
+* Put any embedded device tree first so it is aligned.
+*/
+   *(.dts.data)
*(.data)
}
 
diff --git a/dts/Makefile b/dts/Makefile
index 5792afd..83547d4 100644
--- a/dts/Makefile
+++ b/dts/Makefile
@@ -79,7 +79,7 @@ $(obj)dt.o: $(DT_BIN)
\
cd $(dir ${DT_BIN}) && \
$(OBJCOPY) -I binary -O $${oformat} -B $${oarch} \
-   $(notdir ${DT_BIN}) $@
+   --prefix-sections=.dts $(notdir ${DT_BIN}) $@
rm $(DT_BIN)
 
 OBJS-$(CONFIG_OF_EMBED):= dt.o
-- 
1.7.7.3

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


[U-Boot] [PATCH v4 10/20] tegra: fdt: Add additional USB binding

2012-01-11 Thread Simon Glass
This adds a property to indicate a port which can switch between host and device
mode.

Signed-off-by: Simon Glass 
---

 doc/device-tree-bindings/usb/tegra-usb.txt |4 
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/doc/device-tree-bindings/usb/tegra-usb.txt 
b/doc/device-tree-bindings/usb/tegra-usb.txt
index 035d63d..96fd022 100644
--- a/doc/device-tree-bindings/usb/tegra-usb.txt
+++ b/doc/device-tree-bindings/usb/tegra-usb.txt
@@ -11,3 +11,7 @@ Required properties :
  - phy_type : Should be one of "ulpi" or "utmi".
  - nvidia,vbus-gpio : If present, specifies a gpio that needs to be
activated for the bus to be powered.
+
+Optional properties:
+ - support-host-mode : If present then this peripheral can switch between
+   host and device mode
-- 
1.7.7.3

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


[U-Boot] [PATCH v4 02/20] fdt: Add functions to access phandles, arrays and bools

2012-01-11 Thread Simon Glass
Add a function to look up a property which is a phandle in a node, and
another to read a fixed-length integer array from an fdt property.
Also add a function to read boolean properties, although there is no
actual boolean type in U-Boot.

Signed-off-by: Simon Glass 
---

 include/fdtdec.h |   39 +++
 lib/fdtdec.c |   67 ++
 2 files changed, 106 insertions(+), 0 deletions(-)

diff --git a/include/fdtdec.h b/include/fdtdec.h
index 01badd4..047f603 100644
--- a/include/fdtdec.h
+++ b/include/fdtdec.h
@@ -188,3 +188,42 @@ int fdtdec_find_aliases_for_id(const void *blob, const 
char *name,
  * @return compatible string for that id
  */
 const char *fdtdec_get_compatible(enum fdt_compat_id id);
+
+/* Look up a phandle and follow it to its node. Then return the offset
+ * of that node.
+ *
+ * @param blob FDT blob
+ * @param node node to examine
+ * @param prop_namename of property to find
+ * @return node offset if found, -ve error code on error
+ */
+int fdtdec_lookup_phandle(const void *blob, int node, const char *prop_name);
+
+/**
+ * Look up a property in a node and return its contents in an integer
+ * array of given length. The property must have at least enough data for
+ * the array (4*count bytes). It may have more, but this will be ignored.
+ *
+ * @param blob FDT blob
+ * @param node node to examine
+ * @param prop_namename of property to find
+ * @param arrayarray to fill with data
+ * @param countnumber of array elements
+ * @return 0 if ok, or -FDT_ERR_NOTFOUND if the property is not found,
+ * or -FDT_ERR_BADLAYOUT if not enough data
+ */
+int fdtdec_get_int_array(const void *blob, int node, const char *prop_name,
+   u32 *array, int count);
+
+/**
+ * Look up a boolean property in a node and return it.
+ *
+ * A boolean properly is true if present in the device tree and false if not
+ * present, regardless of its value.
+ *
+ * @param blob FDT blob
+ * @param node node to examine
+ * @param prop_namename of property to find
+ * @return 1 if the properly is present; 0 if it isn't present
+ */
+int fdtdec_get_bool(const void *blob, int node, const char *prop_name);
diff --git a/lib/fdtdec.c b/lib/fdtdec.c
index 846ec3f..977528b 100644
--- a/lib/fdtdec.c
+++ b/lib/fdtdec.c
@@ -269,3 +269,70 @@ int fdtdec_check_fdt(void)
"binary or define CONFIG_OF_EMBED\n");
return 0;
 }
+
+int fdtdec_lookup_phandle(const void *blob, int node, const char *prop_name)
+{
+   const u32 *phandle;
+   int lookup;
+
+   phandle = fdt_getprop(blob, node, prop_name, NULL);
+   if (!phandle)
+   return -FDT_ERR_NOTFOUND;
+
+   lookup = fdt_node_offset_by_phandle(blob, fdt32_to_cpu(*phandle));
+   return lookup;
+}
+
+/**
+ * Look up a property in a node and check that it has a minimum length.
+ *
+ * @param blob FDT blob
+ * @param node node to examine
+ * @param prop_namename of property to find
+ * @param min_len  minimum property length in bytes
+ * @param err  0 if ok, or -FDT_ERR_NOTFOUND if the property is not
+   found, or -FDT_ERR_BADLAYOUT if not enough data
+ * @return pointer to cell, which is only valid if err == 0
+ */
+static const void *get_prop_check_min_len(const void *blob, int node,
+   const char *prop_name, int min_len, int *err)
+{
+   const void *cell;
+   int len;
+
+   debug("%s: %s\n", __func__, prop_name);
+   cell = fdt_getprop(blob, node, prop_name, &len);
+   if (!cell)
+   *err = -FDT_ERR_NOTFOUND;
+   else if (len < min_len)
+   *err = -FDT_ERR_BADLAYOUT;
+   else
+   *err = 0;
+   return cell;
+}
+
+int fdtdec_get_int_array(const void *blob, int node, const char *prop_name,
+   u32 *array, int count)
+{
+   const u32 *cell;
+   int i, err = 0;
+
+   debug("%s: %s\n", __func__, prop_name);
+   cell = get_prop_check_min_len(blob, node, prop_name,
+ sizeof(u32) * count, &err);
+   if (!err) {
+   for (i = 0; i < count; i++)
+   array[i] = fdt32_to_cpu(cell[i]);
+   }
+   return err;
+}
+
+int fdtdec_get_bool(const void *blob, int node, const char *prop_name)
+{
+   const s32 *cell;
+   int len;
+
+   debug("%s: %s\n", __func__, prop_name);
+   cell = fdt_getprop(blob, node, prop_name, &len);
+   return cell != NULL;
+}
-- 
1.7.7.3

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


[U-Boot] [PATCH v4 05/20] arm: fdt: Add skeleton device tree file from kernel

2012-01-11 Thread Simon Glass
This was taken from commit b48c54e2 at:
git://git.kernel.org/pub/scm/linux/kernel/git/olof/tegra.git

Signed-off-by: Simon Glass 
---

 arch/arm/dts/skeleton.dtsi |   13 +
 1 files changed, 13 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/dts/skeleton.dtsi

diff --git a/arch/arm/dts/skeleton.dtsi b/arch/arm/dts/skeleton.dtsi
new file mode 100644
index 000..b41d241
--- /dev/null
+++ b/arch/arm/dts/skeleton.dtsi
@@ -0,0 +1,13 @@
+/*
+ * Skeleton device tree; the bare minimum needed to boot; just include and
+ * add a compatible value.  The bootloader will typically populate the memory
+ * node.
+ */
+
+/ {
+   #address-cells = <1>;
+   #size-cells = <1>;
+   chosen { };
+   aliases { };
+   memory { device_type = "memory"; reg = <0 0>; };
+};
-- 
1.7.7.3

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


[U-Boot] [PATCH v4 0/20] tegra: Add fdt definitions and USB driver

2012-01-11 Thread Simon Glass
This series brings in the Linux kernel fdt file and provides a working
USB driver for Tegra2 Seaboard.

(I have done this in one series since otherwise most of the fdt additions
will just look like dead code.)

The driver requires CONFIG_OF_CONTROL and a device tree to operate.

Some enhancements to fdtdec are required to make this easier, and these
are included in the series also. I have had to bring in basic GPIO
support due to the request to put the USB VBUS into the fdt.

Since the kernel recently got a very minimal USB binding, I have started
with that and extended it where appropriate.

Tegra likes to have cache-aligned buffers. I have dropped the patch which
implements this since we will solve this problem by making callers align
their buffers (as we did with MMC).

Changes in v2:
- Use "okay" instead of "ok" for fdt node status
- Remove 0x from fdt aliases
- Rename params to timing
- Store entire fdt config in port list, not just register pointer
- Remove non-fdt operation of USB, since it is not needed
- Decode USB VBUS GPIO from the fdt
- Decode phy type differently (to match new kernel fdt)
- Rename tegra20-usb to tegra20-ehcui (to match new kernel fdt)
- Improve debug() printouts in case of failure to init USB
- Add setting of pinmux for USB VBUS GPIO
- Remove unneeded CONFIG_TEGRA_USBx defines

Changes in v3:
- Remove "okay" from nodes since this is the default anyway
- Fix device tree indenting with tabs instead of spaces
- Disable USB2 which is not used on Seaboard
- Remove usbparams properties from fdt and moved them to C code
- Drop Tegra USB alignment patch as we will deal with this another way

Changes in v4:
- Add staging area for device tree bindings used in U-Boot
- Add clock bindings for Tegra2x
- Add fdtdec function to return peripheral ID
- Use updated fdtdec alias functiona to get USB aliases
- Use peripheral clock node to obtain peripheral ID

Simon Glass (20):
  fdt: Tidy up a few fdtdec problems
  fdt: Add functions to access phandles, arrays and bools
  fdt: Add basic support for decoding GPIO definitions
  arm: fdt: Ensure that an embedded fdt is word-aligned
  arm: fdt: Add skeleton device tree file from kernel
  tegra: fdt: Add Tegra2x device tree file from kernel
  tegra: fdt: Add device tree file for Tegra2 Seaboard from kernel
  fdt: Add staging area for device tree binding documentation
  fdt: Add tegra-usb bindings file from linux
  tegra: fdt: Add additional USB binding
  tegra: fdt: Add clock bindings
  tegra: usb: fdt: Add additional device tree definitions for USB ports
  tegra: usb: fdt: Add USB definitions for Tegra2 Seaboard
  usb: Add support for txfifo threshold
  fdt: Add function to return peripheral/clock ID
  tegra: usb: Add support for Tegra USB peripheral
  tegra: usb: Add USB support to nvidia boards
  tegra: usb: Add common USB defines for tegra2 boards
  tegra: usb: Enable USB on Seaboard
  tegra: fdt: Enable FDT support for Seaboard

 README |3 +
 arch/arm/cpu/armv7/tegra2/Makefile |4 +-
 arch/arm/cpu/armv7/tegra2/config.mk|2 +
 arch/arm/cpu/armv7/tegra2/usb.c|  426 
 arch/arm/cpu/armv7/u-boot.lds  |5 +
 arch/arm/dts/skeleton.dtsi |   13 +
 arch/arm/dts/tegra20.dtsi  |  199 +++
 arch/arm/include/asm/arch-tegra2/tegra2.h  |2 +
 arch/arm/include/asm/arch-tegra2/usb.h |  255 ++
 board/nvidia/common/board.c|8 +
 board/nvidia/dts/tegra2-seaboard.dts   |   47 +++
 doc/device-tree-bindings/README|   19 +
 doc/device-tree-bindings/clock/tegra-periphclk |   51 +++
 doc/device-tree-bindings/usb/tegra-usb.txt |   17 +
 drivers/usb/host/Makefile  |1 +
 drivers/usb/host/ehci-hcd.c|7 +
 drivers/usb/host/ehci-tegra.c  |   63 
 drivers/usb/host/ehci.h|6 +-
 dts/Makefile   |2 +-
 include/configs/seaboard.h |   12 +
 include/configs/tegra2-common.h|   14 +
 include/fdtdec.h   |  121 +++-
 lib/fdtdec.c   |  181 ++-
 23 files changed, 1445 insertions(+), 13 deletions(-)
 create mode 100644 arch/arm/cpu/armv7/tegra2/usb.c
 create mode 100644 arch/arm/dts/skeleton.dtsi
 create mode 100644 arch/arm/dts/tegra20.dtsi
 create mode 100644 arch/arm/include/asm/arch-tegra2/usb.h
 create mode 100644 board/nvidia/dts/tegra2-seaboard.dts
 create mode 100644 doc/device-tree-bindings/README
 create mode 100644 doc/device-tree-bindings/clock/tegra-periphclk
 create mode 100644 doc/device-tree-bindings/usb/tegra-usb.txt
 create mode 100644 drivers/usb/host/ehci-tegra.c

-- 
1.7.7.3

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/

Re: [U-Boot] [PATCH 4/7] tegra: Add I2C driver

2012-01-11 Thread Simon Glass
Hi Stephem,

On Mon, Jan 9, 2012 at 2:07 PM, Stephen Warren  wrote:
> On 12/26/2011 11:11 AM, Simon Glass wrote:
>> From: Yen Lin 
>>
>> Add basic i2c driver for Tegra2 with 8- and 16-bit address support.
>> The driver supports building both with and without CONFIG_OF_CONTROL.
>>
>> Without CONFIG_OF_CONTROL a number of CONFIG options must be supplied
>> in the board config header file:
>>
>> I2CSPEED_KHZ - speed to run I2C bus at (typically 10)
>> CONFIG_I2Cx_PIN_MUX - pin mux setting for each port (P, 1, 2, 3)
>>         (typically this will be 0 to bring the port out the common
>>                 pins)
> ...
>> diff --git a/arch/arm/include/asm/arch-tegra2/tegra2_i2c.h 
>> b/arch/arm/include/asm/arch-tegra2/tegra2_i2c.h
> ...
>> +#ifndef CONFIG_OF_CONTROL
>> +enum {
>> +       I2CSPEED_KHZ = 100,             /* in KHz */
>> +};
>> +#endif
>
> The patch description says the board needs to define I2CSPEED_KHZ, yet
> that seems to allow the board to override it, otherwise a default is
> used. The patch description probably needs to be fixed.
>
> The way the optional override is implemented is a little confusing. I'd
> rather see:
>
> #ifndef CONFIG_OF_CONTROL
> #ifndef I2CSPEED_KHZ
> #define I2CSPEED_KHZ 100
> #endif
> #endif
>
> That makes it a lot more obvious it's a default. And actually, why not
> put that within some other ifndef CONFIG_OF_CONTROL where the
> enum/define is used, since it's presumably only used very locally in the
> non-OF initialization code.

I'm removing the non-OF code since we don't use it.

>
> ...
>> diff --git a/drivers/i2c/tegra2_i2c.c b/drivers/i2c/tegra2_i2c.c
> ...
>> +struct i2c_bus i2c_controllers[CONFIG_SYS_MAX_I2C_BUS];
>
> What if there are I2C bus extenders/muxes/... such that there are more
> I2C buses in the system than Tegra I2C controllers? I'd rather see an
> explicit TEGRA_I2C_NUM_CONTROLLERS define used throughout this patch.

We don't actually support CONFIG_I2C_MUX, so I can't see how that
could happen. Can you please explain a bit more?

>
> I didn't really review the I2C driver code itself, since I'm not
> terribly familiar with the I2C HW details.

It had quite a bit of review before it went into our tree, and it
certainly has had a lot of testing.

>
>> +static int i2c_get_config(int *index, struct i2c_bus *i2c_bus)
>> +{
>> +       const void *blob = gd->fdt_blob;
>> +       int node;
>> +
>> +       node = fdtdec_next_alias(blob, "i2c", COMPAT_NVIDIA_TEGRA20_I2C,
>> +                                index);
>> +       if (node < 0)
>> +               return -1;
>
> I assume the I2C patches will also be reworked to enumerate based on
> nodes with a specific compatible flag, and then optionally using aliases
> to number them, just like you said you're rework USB?

Yes, will do. The hard bit of that was creating an fdtdec function to handle it.

>
>> +int i2c_init_board(void)
>> +{
>> +       struct i2c_bus *i2c_bus;
>> +       int index = 0;
>> +       int i;
>> +
>> +       /* build the i2c_controllers[] for each controller */
>> +       for (i = 0; i < CONFIG_SYS_MAX_I2C_BUS; ++i) {
>> +               i2c_bus = &i2c_controllers[i];
>> +               i2c_bus->id = i;
>> +
>> +               if (i2c_get_config(&index, i2c_bus)) {
>> +                       printf("i2c_init_board: failed to find bus %d\n", i);
>> +                       return -1;
>> +               }
>> +
>> +               if (i2c_bus->periph_id == PERIPH_ID_DVC_I2C)
>> +                       i2c_bus->control =
>> +                               &((struct dvc_ctlr *)i2c_bus->regs)->control;
>> +               else
>> +                       i2c_bus->control = &i2c_bus->regs->control;
>
> When instantiating controllers from device tree (as opposed to the
> static !CONFIG_OF_CONTROL case), that conditional should be driven by
> device tree properties. The kernel already represents this using two
> separate compatible values for the different HW: nvidia,tegra20-i2c and
> nvidia,tegra20-i2c-dvc.

Not in the device tree file I got from the kernel...has it changed?

I will make this change. By dropping non-fdt use it will make this
work almost for free.

>
>> +
>> +               i2c_init_controller(i2c_bus);
>> +       }
>> +
>> +       return 0;
>> +}
>
>> +void i2c_init(int speed, int slaveaddr)
>> +{
>> +       debug("i2c_init(speed=%u, slaveaddr=0x%x)\n", speed, slaveaddr);
>> +}
>
> Surely that function needs to actually do something, at least set up the
> clocks so that the (user?) requested rate is honored, or print an error
> message if you're only allowed to use the hard-coded bus rate.

See my other message. I suppose we could reinit, but we really don't
want to honour the speed, since the fdt speed setting is then lost and
irrecoverable. For now it feels like we should ignore it.

If fdt use grows then perhaps U-Boot might accept patches to
understand the concept of initing i2c as a unit, and once at the start
(or first use), rather than the current setup.

>
>> +/* Probe to 

Re: [U-Boot] bootm not taking dtb

2012-01-11 Thread JR Rivers

On Jan 11, 2012, at 6:45 PM, Aggrwal Poonam-B10812 wrote:

> 
> 
>> -Original Message-
>> From: u-boot-boun...@lists.denx.de [mailto:u-boot-boun...@lists.denx.de]
>> On Behalf Of JR Rivers
>> Sent: Thursday, January 12, 2012 6:49 AM
>> To: u-boot@lists.denx.de
>> Subject: Re: [U-Boot] bootm not taking dtb
>> 
>> 
>> Ping
>> 
>> On Jan 11, 2012, at 1:47 PM, JR Rivers wrote:
>> 
>>> 
>>> I am working with a powerpc embedded system where u-boot seems to be
>> passing in a constructed fdt (or one embedded in u-boot) as opposed to
>> one that is either passed directly to bootm or as the third image of a
>> multi-file image.
>>> 
>>> I'm sure sure that the system is NOT using my dtb file because I
>> modified the my linux platform file to print out the "model" and
>> "compatible" properties of root, and they make sense, but are not the
>> values that I pass in with my dtb.
>>> 
>>> I've tried "bootm ${kerneladdr} - ${dtbaddr}" for nfs boot, and I've
>> constructed a multi-file uImage with kernel:initramfs:dtb.  The behavior
>> is the same in all cases.  Is this expected behavior, and if so, is there
>> some way to force u-boot to use my dtb file?
> Did you check that $(dtb_addr) is same as the location where your dtb is 
> there.
> I know this is trivial question I am asking.
> Also can you specify which board and which u-boot version. I am assuming you 
> are talking about Denx top of tree.

In the first case, yes, I'm quite sure... in fact uboot start off indicating 
that it's using my dtb, but it doesn't actually use it (per the evidence above).

## Flattened Device Tree blob at 0900
   Booting using the fdt blob at 0x900
   Uncompressing Kernel Image ... OK
   Loading Device Tree to 007fc000, end 007ffa53 ... OK

The second case (where the DTB is included as the third component of a 
multi-file image) indicates that there isn't an addressing problem.

The uboot version is... U-Boot 2009.06 (Apr 19 2011 - 12:54:10).  It came with 
the system and we're loading a new kernel/rootfs on to it.

>>> 
>>> Thanks,
>>> 
>>> JR
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> ___
>>> 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 mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] bootm not taking dtb

2012-01-11 Thread Aggrwal Poonam-B10812


> -Original Message-
> From: u-boot-boun...@lists.denx.de [mailto:u-boot-boun...@lists.denx.de]
> On Behalf Of JR Rivers
> Sent: Thursday, January 12, 2012 6:49 AM
> To: u-boot@lists.denx.de
> Subject: Re: [U-Boot] bootm not taking dtb
> 
> 
> Ping
> 
> On Jan 11, 2012, at 1:47 PM, JR Rivers wrote:
> 
> >
> > I am working with a powerpc embedded system where u-boot seems to be
> passing in a constructed fdt (or one embedded in u-boot) as opposed to
> one that is either passed directly to bootm or as the third image of a
> multi-file image.
> >
> > I'm sure sure that the system is NOT using my dtb file because I
> modified the my linux platform file to print out the "model" and
> "compatible" properties of root, and they make sense, but are not the
> values that I pass in with my dtb.
> >
> > I've tried "bootm ${kerneladdr} - ${dtbaddr}" for nfs boot, and I've
> constructed a multi-file uImage with kernel:initramfs:dtb.  The behavior
> is the same in all cases.  Is this expected behavior, and if so, is there
> some way to force u-boot to use my dtb file?
Did you check that $(dtb_addr) is same as the location where your dtb is there.
I know this is trivial question I am asking.
Also can you specify which board and which u-boot version. I am assuming you 
are talking about Denx top of tree.
> >
> > Thanks,
> >
> > JR
> >
> >
> >
> >
> >
> >
> > ___
> > 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 mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] bootm not taking dtb

2012-01-11 Thread JR Rivers

Ping

On Jan 11, 2012, at 1:47 PM, JR Rivers wrote:

> 
> I am working with a powerpc embedded system where u-boot seems to be passing 
> in a constructed fdt (or one embedded in u-boot) as opposed to one that is 
> either passed directly to bootm or as the third image of a multi-file image.
> 
> I'm sure sure that the system is NOT using my dtb file because I modified the 
> my linux platform file to print out the "model" and "compatible" properties 
> of root, and they make sense, but are not the values that I pass in with my 
> dtb.
> 
> I've tried "bootm ${kerneladdr} - ${dtbaddr}" for nfs boot, and I've 
> constructed a multi-file uImage with kernel:initramfs:dtb.  The behavior is 
> the same in all cases.  Is this expected behavior, and if so, is there some 
> way to force u-boot to use my dtb file?
> 
> Thanks,
> 
> JR
> 
> 
> 
> 
> 
> 
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot

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


Re: [U-Boot] [PATCH 3/3 v4] devkit3250: add Timll DevKit3250 board initial support

2012-01-11 Thread Marek Vasut
> This change adds a basic support for Embest/Timll DevKit3250 board,
> NOR and UART are the only supported peripherals for a moment. The board
> doesn't require low-level init, because the initial SDRAM and GPIO
> configuration is performed during kickstart bootloader execution.
> 
> Signed-off-by: Vladimir Zapolskiy 
> Cc: Albert ARIBAUD 
> Cc: Wolfgang Denk 
> ---
> Changes from v3 to v4:
> * removed dcache flushing from board_init()
> * tabs instead of spaces in board config file
> 
> Changes from v2 to v3:
> * updated a relocation address
> * combined a record in maintainers file into the patch
> * use high speed UART2 by default
> 
> Changes from v1 to v2:
> * corrected address in GPLv2+ licence header in files
> * removed clean and distclean targets from board makefile
> * do not set machine id explicitly, if CONFIG_MACH_TYPE is defined
> * minor indentation cleanups
> 
>  MAINTAINERS |4 +
>  board/timll/devkit3250/Makefile |   44 +
>  board/timll/devkit3250/devkit3250.c |   65 +++
>  boards.cfg  |1 +
>  include/configs/devkit3250.h|  121
> +++ 5 files changed, 235 insertions(+), 0
> deletions(-)
>  create mode 100644 board/timll/devkit3250/Makefile
>  create mode 100644 board/timll/devkit3250/devkit3250.c
>  create mode 100644 include/configs/devkit3250.h
> 
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 4bf12b5..68dedae 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -914,6 +914,10 @@ Sughosh Ganu 
> 
>   hawkboard   ARM926EJS (OMAP-L138)
> 
> +Vladimir Zapolskiy 
> +
> + devkit3250  lpc32xx
> +
>  -
> 
>  Unknown / orphaned boards:
> diff --git a/board/timll/devkit3250/Makefile
> b/board/timll/devkit3250/Makefile new file mode 100644
> index 000..ea7827c
> --- /dev/null
> +++ b/board/timll/devkit3250/Makefile
> @@ -0,0 +1,44 @@
> +#
> +# Copyright (C) 2011 by Vladimir Zapolskiy 
> +# Copyright (C) 2008, Guennadi Liakhovetski 
> +#
> +# See file CREDITS for list of people who contributed to this
> +# project.
> +#
> +# This program is free software; you can redistribute it and/or
> +# modify it under the terms of the GNU General Public License as
> +# published by the Free Software Foundation; either version 2 of
> +# the License, or (at your option) any later version.
> +#
> +# This program is distributed in the hope that it will be useful,
> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> +# GNU General Public License for more details.
> +#
> +# You should have received a copy of the GNU General Public License
> +# along with this program; if not, write to the Free Software
> +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
> +# MA  02110-1301, USA.
> +#
> +
> +include $(TOPDIR)/config.mk
> +
> +LIB  = $(obj)lib$(BOARD).o
> +
> +COBJS:= devkit3250.o
> +
> +SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
> +OBJS := $(addprefix $(obj),$(COBJS))
> +SOBJS:= $(addprefix $(obj),$(SOBJS))
> +
> +$(LIB):  $(obj).depend $(OBJS) $(SOBJS)
> + $(call cmd_link_o_target, $(OBJS) $(SOBJS))
> +
> +#
> +
> +# defines $(obj).depend target
> +include $(SRCTREE)/rules.mk
> +
> +sinclude $(obj).depend
> +
> +#
> diff --git a/board/timll/devkit3250/devkit3250.c
> b/board/timll/devkit3250/devkit3250.c new file mode 100644
> index 000..877cd60
> --- /dev/null
> +++ b/board/timll/devkit3250/devkit3250.c
> @@ -0,0 +1,65 @@
> +/*
> + * Embest/Timll DevKit3250 board support
> + *
> + * Copyright (C) 2011 Vladimir Zapolskiy 
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License as
> + * published by the Free Software Foundation; either version 2 of
> + * the License, or (at your option) any later version.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program; if not, write to the Free Software
> + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
> + * MA 02110-1301, USA.
> + */
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +DECLARE_GLOBAL_DATA_PTR;
> +
> +static struct emc_t *emc = (struct emc_t *)EMC_BASE;
> +
> +int board_early_init_f(void)
> +{
> + lpc32xx_uart_init(CONFIG_SYS_LPC32XX_UART);
> +
> + return 0;
> +}
> +
> +int board_init(void)
> +{
> + /* adress of boot parameters */
> + gd->bd->bi_boot_p

Re: [U-Boot] [PATCH 2/3 v2] serial: add LPC32X0 high-speed UART devices support

2012-01-11 Thread Marek Vasut
> This change adds an implementation of high-speed UART found on NXP
> LPC32X0 SoCs. Such UARTs are enumerated as UART1, UART2 and UART7.
> 
> Signed-off-by: Vladimir Zapolskiy 
> Cc: Albert ARIBAUD 
> Cc: Wolfgang Denk 
> ---
> Changes from v1 to v2:
> * simplified lpc32xx_hsuart_init() a little
> * put SoC specific changes into patch 1/3
> 
>  arch/arm/include/asm/arch-lpc32xx/uart.h |   60 
>  drivers/serial/Makefile  |1 +
>  drivers/serial/lpc32xx_hsuart.c  |  112
> ++ 3 files changed, 173 insertions(+), 0
> deletions(-)
>  create mode 100644 drivers/serial/lpc32xx_hsuart.c
> 
> diff --git a/arch/arm/include/asm/arch-lpc32xx/uart.h
> b/arch/arm/include/asm/arch-lpc32xx/uart.h index 3c7e561..cb4853c 100644
> --- a/arch/arm/include/asm/arch-lpc32xx/uart.h
> +++ b/arch/arm/include/asm/arch-lpc32xx/uart.h
> @@ -22,6 +22,66 @@
> 
>  #include 
> 
> +/* 14-clock UART Registers */
> +struct hsuart_t {
> + union {
> + u32 rx; /* Receiver FIFO*/
> + u32 tx; /* Transmitter FIFO */
> + };
> + u32 level;  /* FIFO Level Register  */
> + u32 iir;/* Interrupt ID Register*/
> + u32 ctrl;   /* Control Register */
> + u32 rate;   /* Rate Control Register*/
> +};
> +
> +/* 14-clock UART Receiver FIFO Register bits */
> +#define HSUART_RX_BREAK  (1 << 10)
> +#define HSUART_RX_ERROR  (1 << 9)
> +#define HSUART_RX_EMPTY  (1 << 8)
> +#define HSUART_RX_DATA   (0xff << 0)
> +
> +/* 14-clock UART Level Register bits */
> +#define HSUART_LEVEL_TX  (0xff << 8)
> +#define HSUART_LEVEL_RX  (0xff << 0)
> +
> +/* 14-clock UART Interrupt Identification Register bits */
> +#define HSUART_IIR_TX_INT_SET(1 << 6)
> +#define HSUART_IIR_RX_OE (1 << 5)
> +#define HSUART_IIR_BRK   (1 << 4)
> +#define HSUART_IIR_FE(1 << 3)
> +#define HSUART_IIR_RX_TIMEOUT(1 << 2)
> +#define HSUART_IIR_RX_TRIG   (1 << 1)
> +#define HSUART_IIR_TX(1 << 0)
> +
> +/* 14-clock UART Control Register bits */
> +#define HSUART_CTRL_HRTS_INV (1 << 21)
> +#define HSUART_CTRL_HRTS_TRIG_48 (0x3 << 19)
> +#define HSUART_CTRL_HRTS_TRIG_32 (0x2 << 19)
> +#define HSUART_CTRL_HRTS_TRIG_16 (0x1 << 19)
> +#define HSUART_CTRL_HRTS_TRIG_8  (0x0 << 19)
> +#define HSUART_CTRL_HRTS_EN  (1 << 18)
> +#define HSUART_CTRL_TMO_16   (0x3 << 16)
> +#define HSUART_CTRL_TMO_8(0x2 << 16)
> +#define HSUART_CTRL_TMO_4(0x1 << 16)
> +#define HSUART_CTRL_TMO_DISABLED (0x0 << 16)
> +#define HSUART_CTRL_HCTS_INV (1 << 15)
> +#define HSUART_CTRL_HCTS_EN  (1 << 14)
> +#define HSUART_CTRL_HSU_OFFSET(n)((n) << 9)
> +#define HSUART_CTRL_HSU_BREAK(1 << 8)
> +#define HSUART_CTRL_HSU_ERR_INT_EN   (1 << 7)
> +#define HSUART_CTRL_HSU_RX_INT_EN(1 << 6)
> +#define HSUART_CTRL_HSU_TX_INT_EN(1 << 5)
> +#define HSUART_CTRL_HSU_RX_TRIG_48   (0x5 << 2)
> +#define HSUART_CTRL_HSU_RX_TRIG_32   (0x4 << 2)
> +#define HSUART_CTRL_HSU_RX_TRIG_16   (0x3 << 2)
> +#define HSUART_CTRL_HSU_RX_TRIG_8(0x2 << 2)
> +#define HSUART_CTRL_HSU_RX_TRIG_4(0x1 << 2)
> +#define HSUART_CTRL_HSU_RX_TRIG_1(0x0 << 2)
> +#define HSUART_CTRL_HSU_TX_TRIG_16   (0x3 << 0)
> +#define HSUART_CTRL_HSU_TX_TRIG_8(0x2 << 0)
> +#define HSUART_CTRL_HSU_TX_TRIG_4(0x1 << 0)
> +#define HSUART_CTRL_HSU_TX_TRIG_0(0x0 << 0)
> +
>  /* UART Control Registers */
>  struct uart_ctrl_t {
>   u32 ctrl;   /* Control Register */
> diff --git a/drivers/serial/Makefile b/drivers/serial/Makefile
> index 616b857..65d0f23 100644
> --- a/drivers/serial/Makefile
> +++ b/drivers/serial/Makefile
> @@ -29,6 +29,7 @@ COBJS-$(CONFIG_ALTERA_UART) += altera_uart.o
>  COBJS-$(CONFIG_ALTERA_JTAG_UART) += altera_jtag_uart.o
>  COBJS-$(CONFIG_ARM_DCC) += arm_dcc.o
>  COBJS-$(CONFIG_ATMEL_USART) += atmel_usart.o
> +COBJS-$(CONFIG_LPC32XX_HSUART) += lpc32xx_hsuart.o
>  COBJS-$(CONFIG_MCFUART) += mcfuart.o
>  COBJS-$(CONFIG_NS9750_UART) += ns9750_serial.o
>  COBJS-$(CONFIG_OPENCORES_YANU) += opencores_yanu.o
> diff --git a/drivers/serial/lpc32xx_hsuart.c
> b/drivers/serial/lpc32xx_hsuart.c new file mode 100644
> index 000..052b0d8
> --- /dev/null
> +++ b/drivers/serial/lpc32xx_hsuart.c
> @@ -0,0 +1,112 @@
> +/*
> + * Copyright (C) 2011 Vladimir Zapolskiy 
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License
> + * as published by the Free Software Foundation; either version 2
> + * of the License, or (at your option) any later version.
> + *
> + * This 

Re: [U-Boot] [PATCH 1/3 v7] arm926ejs: add NXP LPC32x0 cpu series support

2012-01-11 Thread Marek Vasut
> This change adds initial support for NXP LPC32x0 SoC series.
> 
> Signed-off-by: Vladimir Zapolskiy 
> Cc: Albert ARIBAUD 
> Cc: Wolfgang Denk 
> ---
> Changes from v6 to v7:
> * get use of setbits_le32() and friends
> * add arch_cpu_init() routine
> 
> Changes from v5 to v6:
> * replaced some spaces with tabs in macro declarations
> * more rules separating 14-clock and ns16650 UARTs in config.h
> 
> Changes from v4 to v5:
> * corrected address in GPLv2+ licence header in files
> 
> Changes from v3 to v4:
> * extended memory controller definitions are introduced
> * added print_cpuinfo() function
> 
> Changes from v2 to v3:
> * checkpatch.pl reports zero errors and warnings
> 
> Changes from v1 to v2:
> * BIT(n) and SBF(s, v) macro are not used anymore
> * removed NS16550 and 14-clock UART definitions from uart.h
> * added devices.c file, which contains standard UART preinitialization
> routine * added get_serial_clock() function, it returns actual frequency
> of UART clock * __udelay() realization is simplified, no need of interrupt
> handling
> 
>  arch/arm/cpu/arm926ejs/lpc32xx/Makefile   |   45 +++
>  arch/arm/cpu/arm926ejs/lpc32xx/clkpwr.c   |  118 +
>  arch/arm/cpu/arm926ejs/lpc32xx/cpu.c  |   68 ++
>  arch/arm/cpu/arm926ejs/lpc32xx/devices.c  |   52 
>  arch/arm/cpu/arm926ejs/lpc32xx/timer.c|   90 +
>  arch/arm/include/asm/arch-lpc32xx/clk.h   |  170
> + arch/arm/include/asm/arch-lpc32xx/config.h| 
>  76 +++
>  arch/arm/include/asm/arch-lpc32xx/cpu.h   |   64 +
>  arch/arm/include/asm/arch-lpc32xx/emc.h   |   92 +
>  arch/arm/include/asm/arch-lpc32xx/sys_proto.h |   25 
>  arch/arm/include/asm/arch-lpc32xx/timer.h |   74 +++
>  arch/arm/include/asm/arch-lpc32xx/uart.h  |   54 
>  arch/arm/include/asm/arch-lpc32xx/wdt.h   |   51 
>  13 files changed, 979 insertions(+), 0 deletions(-)
>  create mode 100644 arch/arm/cpu/arm926ejs/lpc32xx/Makefile
>  create mode 100644 arch/arm/cpu/arm926ejs/lpc32xx/clkpwr.c
>  create mode 100644 arch/arm/cpu/arm926ejs/lpc32xx/cpu.c
>  create mode 100644 arch/arm/cpu/arm926ejs/lpc32xx/devices.c
>  create mode 100644 arch/arm/cpu/arm926ejs/lpc32xx/timer.c
>  create mode 100644 arch/arm/include/asm/arch-lpc32xx/clk.h
>  create mode 100644 arch/arm/include/asm/arch-lpc32xx/config.h
>  create mode 100644 arch/arm/include/asm/arch-lpc32xx/cpu.h
>  create mode 100644 arch/arm/include/asm/arch-lpc32xx/emc.h
>  create mode 100644 arch/arm/include/asm/arch-lpc32xx/sys_proto.h
>  create mode 100644 arch/arm/include/asm/arch-lpc32xx/timer.h
>  create mode 100644 arch/arm/include/asm/arch-lpc32xx/uart.h
>  create mode 100644 arch/arm/include/asm/arch-lpc32xx/wdt.h
> 
> diff --git a/arch/arm/cpu/arm926ejs/lpc32xx/Makefile
> b/arch/arm/cpu/arm926ejs/lpc32xx/Makefile new file mode 100644
> index 000..e6222e4
> --- /dev/null
> +++ b/arch/arm/cpu/arm926ejs/lpc32xx/Makefile
> @@ -0,0 +1,45 @@
> +#
> +# (C) Copyright 2000-2006
> +# Wolfgang Denk, DENX Software Engineering, w...@denx.de.
> +#
> +# See file CREDITS for list of people who contributed to this
> +# project.
> +#
> +# This program is free software; you can redistribute it and/or
> +# modify it under the terms of the GNU General Public License
> +# as published by the Free Software Foundation; either version 2
> +# of the License, or (at your option) any later version.
> +#
> +# This program is distributed in the hope that it will be useful,
> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> +# GNU General Public License for more details.
> +#
> +# You should have received a copy of the GNU General Public License
> +# along with this program; if not, write to the Free Software
> +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
> +# MA  02110-1301, USA.
> +#
> +
> +include $(TOPDIR)/config.mk
> +
> +LIB = $(obj)lib$(SOC).o
> +
> +COBJS   = cpu.o clkpwr.o devices.o timer.o
> +
> +SRCS:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
> +OBJS:= $(addprefix $(obj),$(COBJS) $(SOBJS))
> +
> +all:$(obj).depend $(LIB)
> +
> +$(LIB): $(OBJS)
> + $(call cmd_link_o_target, $(OBJS))
> +
> +#
> +
> +# defines $(obj).depend target
> +include $(SRCTREE)/rules.mk
> +
> +sinclude $(obj).depend
> +
> +#
> diff --git a/arch/arm/cpu/arm926ejs/lpc32xx/clkpwr.c
> b/arch/arm/cpu/arm926ejs/lpc32xx/clkpwr.c new file mode 100644
> index 000..103157a
> --- /dev/null
> +++ b/arch/arm/cpu/arm926ejs/lpc32xx/clkpwr.c
> @@ -0,0 +1,118 @@
> +/*
> + * Copyright (C) 2011 by Vladimir Zapolskiy 
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License
>

Re: [U-Boot] [PATCH v2 0/7] tegra: Enhance funcmux to support I2C and MMC

2012-01-11 Thread Stephen Warren
On 01/11/2012 03:42 PM, Simon Glass wrote:
> This series expands funcmux_select() to support configs other than 0, and
> to name each config option.
> 
> This permits introduction of I2C and MMC support in the funcmux.

The series,

Acked-by: Stephen Warren 

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


[U-Boot] [PATCH 3/3 v4] devkit3250: add Timll DevKit3250 board initial support

2012-01-11 Thread Vladimir Zapolskiy
This change adds a basic support for Embest/Timll DevKit3250 board,
NOR and UART are the only supported peripherals for a moment. The board
doesn't require low-level init, because the initial SDRAM and GPIO
configuration is performed during kickstart bootloader execution.

Signed-off-by: Vladimir Zapolskiy 
Cc: Albert ARIBAUD 
Cc: Wolfgang Denk 
---
Changes from v3 to v4:
* removed dcache flushing from board_init()
* tabs instead of spaces in board config file

Changes from v2 to v3:
* updated a relocation address
* combined a record in maintainers file into the patch
* use high speed UART2 by default

Changes from v1 to v2:
* corrected address in GPLv2+ licence header in files
* removed clean and distclean targets from board makefile
* do not set machine id explicitly, if CONFIG_MACH_TYPE is defined
* minor indentation cleanups

 MAINTAINERS |4 +
 board/timll/devkit3250/Makefile |   44 +
 board/timll/devkit3250/devkit3250.c |   65 +++
 boards.cfg  |1 +
 include/configs/devkit3250.h|  121 +++
 5 files changed, 235 insertions(+), 0 deletions(-)
 create mode 100644 board/timll/devkit3250/Makefile
 create mode 100644 board/timll/devkit3250/devkit3250.c
 create mode 100644 include/configs/devkit3250.h

diff --git a/MAINTAINERS b/MAINTAINERS
index 4bf12b5..68dedae 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -914,6 +914,10 @@ Sughosh Ganu 
 
hawkboard   ARM926EJS (OMAP-L138)
 
+Vladimir Zapolskiy 
+
+   devkit3250  lpc32xx
+
 -
 
 Unknown / orphaned boards:
diff --git a/board/timll/devkit3250/Makefile b/board/timll/devkit3250/Makefile
new file mode 100644
index 000..ea7827c
--- /dev/null
+++ b/board/timll/devkit3250/Makefile
@@ -0,0 +1,44 @@
+#
+# Copyright (C) 2011 by Vladimir Zapolskiy 
+# Copyright (C) 2008, Guennadi Liakhovetski 
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+# MA  02110-1301, USA.
+#
+
+include $(TOPDIR)/config.mk
+
+LIB= $(obj)lib$(BOARD).o
+
+COBJS  := devkit3250.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):$(obj).depend $(OBJS) $(SOBJS)
+   $(call cmd_link_o_target, $(OBJS) $(SOBJS))
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/board/timll/devkit3250/devkit3250.c 
b/board/timll/devkit3250/devkit3250.c
new file mode 100644
index 000..877cd60
--- /dev/null
+++ b/board/timll/devkit3250/devkit3250.c
@@ -0,0 +1,65 @@
+/*
+ * Embest/Timll DevKit3250 board support
+ *
+ * Copyright (C) 2011 Vladimir Zapolskiy 
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ */
+
+#include 
+#include 
+#include 
+#include 
+
+DECLARE_GLOBAL_DATA_PTR;
+
+static struct emc_t *emc = (struct emc_t *)EMC_BASE;
+
+int board_early_init_f(void)
+{
+   lpc32xx_uart_init(CONFIG_SYS_LPC32XX_UART);
+
+   return 0;
+}
+
+int board_init(void)
+{
+   /* adress of boot parameters */
+   gd->bd->bi_boot_params  = CONFIG_ENV_ADDR;
+
+#ifdef CONFIG_SYS_FLASH_CFI
+   /* Use 16-bit memory interface for NOR Flash */
+   emc->stat[0].config = EMC_STAT_CONFIG_PB | EMC_STAT_CONFIG_16BIT;
+
+   /* Change the NOR timings to optimum value to get maximum bandwidth */
+  

[U-Boot] [PATCH 2/3 v2] serial: add LPC32X0 high-speed UART devices support

2012-01-11 Thread Vladimir Zapolskiy
This change adds an implementation of high-speed UART found on NXP
LPC32X0 SoCs. Such UARTs are enumerated as UART1, UART2 and UART7.

Signed-off-by: Vladimir Zapolskiy 
Cc: Albert ARIBAUD 
Cc: Wolfgang Denk 
---
Changes from v1 to v2:
* simplified lpc32xx_hsuart_init() a little
* put SoC specific changes into patch 1/3

 arch/arm/include/asm/arch-lpc32xx/uart.h |   60 
 drivers/serial/Makefile  |1 +
 drivers/serial/lpc32xx_hsuart.c  |  112 ++
 3 files changed, 173 insertions(+), 0 deletions(-)
 create mode 100644 drivers/serial/lpc32xx_hsuart.c

diff --git a/arch/arm/include/asm/arch-lpc32xx/uart.h 
b/arch/arm/include/asm/arch-lpc32xx/uart.h
index 3c7e561..cb4853c 100644
--- a/arch/arm/include/asm/arch-lpc32xx/uart.h
+++ b/arch/arm/include/asm/arch-lpc32xx/uart.h
@@ -22,6 +22,66 @@
 
 #include 
 
+/* 14-clock UART Registers */
+struct hsuart_t {
+   union {
+   u32 rx; /* Receiver FIFO*/
+   u32 tx; /* Transmitter FIFO */
+   };
+   u32 level;  /* FIFO Level Register  */
+   u32 iir;/* Interrupt ID Register*/
+   u32 ctrl;   /* Control Register */
+   u32 rate;   /* Rate Control Register*/
+};
+
+/* 14-clock UART Receiver FIFO Register bits */
+#define HSUART_RX_BREAK(1 << 10)
+#define HSUART_RX_ERROR(1 << 9)
+#define HSUART_RX_EMPTY(1 << 8)
+#define HSUART_RX_DATA (0xff << 0)
+
+/* 14-clock UART Level Register bits */
+#define HSUART_LEVEL_TX(0xff << 8)
+#define HSUART_LEVEL_RX(0xff << 0)
+
+/* 14-clock UART Interrupt Identification Register bits */
+#define HSUART_IIR_TX_INT_SET  (1 << 6)
+#define HSUART_IIR_RX_OE   (1 << 5)
+#define HSUART_IIR_BRK (1 << 4)
+#define HSUART_IIR_FE  (1 << 3)
+#define HSUART_IIR_RX_TIMEOUT  (1 << 2)
+#define HSUART_IIR_RX_TRIG (1 << 1)
+#define HSUART_IIR_TX  (1 << 0)
+
+/* 14-clock UART Control Register bits */
+#define HSUART_CTRL_HRTS_INV   (1 << 21)
+#define HSUART_CTRL_HRTS_TRIG_48   (0x3 << 19)
+#define HSUART_CTRL_HRTS_TRIG_32   (0x2 << 19)
+#define HSUART_CTRL_HRTS_TRIG_16   (0x1 << 19)
+#define HSUART_CTRL_HRTS_TRIG_8(0x0 << 19)
+#define HSUART_CTRL_HRTS_EN(1 << 18)
+#define HSUART_CTRL_TMO_16 (0x3 << 16)
+#define HSUART_CTRL_TMO_8  (0x2 << 16)
+#define HSUART_CTRL_TMO_4  (0x1 << 16)
+#define HSUART_CTRL_TMO_DISABLED   (0x0 << 16)
+#define HSUART_CTRL_HCTS_INV   (1 << 15)
+#define HSUART_CTRL_HCTS_EN(1 << 14)
+#define HSUART_CTRL_HSU_OFFSET(n)  ((n) << 9)
+#define HSUART_CTRL_HSU_BREAK  (1 << 8)
+#define HSUART_CTRL_HSU_ERR_INT_EN (1 << 7)
+#define HSUART_CTRL_HSU_RX_INT_EN  (1 << 6)
+#define HSUART_CTRL_HSU_TX_INT_EN  (1 << 5)
+#define HSUART_CTRL_HSU_RX_TRIG_48 (0x5 << 2)
+#define HSUART_CTRL_HSU_RX_TRIG_32 (0x4 << 2)
+#define HSUART_CTRL_HSU_RX_TRIG_16 (0x3 << 2)
+#define HSUART_CTRL_HSU_RX_TRIG_8  (0x2 << 2)
+#define HSUART_CTRL_HSU_RX_TRIG_4  (0x1 << 2)
+#define HSUART_CTRL_HSU_RX_TRIG_1  (0x0 << 2)
+#define HSUART_CTRL_HSU_TX_TRIG_16 (0x3 << 0)
+#define HSUART_CTRL_HSU_TX_TRIG_8  (0x2 << 0)
+#define HSUART_CTRL_HSU_TX_TRIG_4  (0x1 << 0)
+#define HSUART_CTRL_HSU_TX_TRIG_0  (0x0 << 0)
+
 /* UART Control Registers */
 struct uart_ctrl_t {
u32 ctrl;   /* Control Register */
diff --git a/drivers/serial/Makefile b/drivers/serial/Makefile
index 616b857..65d0f23 100644
--- a/drivers/serial/Makefile
+++ b/drivers/serial/Makefile
@@ -29,6 +29,7 @@ COBJS-$(CONFIG_ALTERA_UART) += altera_uart.o
 COBJS-$(CONFIG_ALTERA_JTAG_UART) += altera_jtag_uart.o
 COBJS-$(CONFIG_ARM_DCC) += arm_dcc.o
 COBJS-$(CONFIG_ATMEL_USART) += atmel_usart.o
+COBJS-$(CONFIG_LPC32XX_HSUART) += lpc32xx_hsuart.o
 COBJS-$(CONFIG_MCFUART) += mcfuart.o
 COBJS-$(CONFIG_NS9750_UART) += ns9750_serial.o
 COBJS-$(CONFIG_OPENCORES_YANU) += opencores_yanu.o
diff --git a/drivers/serial/lpc32xx_hsuart.c b/drivers/serial/lpc32xx_hsuart.c
new file mode 100644
index 000..052b0d8
--- /dev/null
+++ b/drivers/serial/lpc32xx_hsuart.c
@@ -0,0 +1,112 @@
+/*
+ * Copyright (C) 2011 Vladimir Zapolskiy 
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  Se

[U-Boot] [PATCH 1/3 v7] arm926ejs: add NXP LPC32x0 cpu series support

2012-01-11 Thread Vladimir Zapolskiy
This change adds initial support for NXP LPC32x0 SoC series.

Signed-off-by: Vladimir Zapolskiy 
Cc: Albert ARIBAUD 
Cc: Wolfgang Denk 
---
Changes from v6 to v7:
* get use of setbits_le32() and friends
* add arch_cpu_init() routine

Changes from v5 to v6:
* replaced some spaces with tabs in macro declarations
* more rules separating 14-clock and ns16650 UARTs in config.h

Changes from v4 to v5:
* corrected address in GPLv2+ licence header in files

Changes from v3 to v4:
* extended memory controller definitions are introduced
* added print_cpuinfo() function

Changes from v2 to v3:
* checkpatch.pl reports zero errors and warnings

Changes from v1 to v2:
* BIT(n) and SBF(s, v) macro are not used anymore
* removed NS16550 and 14-clock UART definitions from uart.h
* added devices.c file, which contains standard UART preinitialization routine
* added get_serial_clock() function, it returns actual frequency of UART clock
* __udelay() realization is simplified, no need of interrupt handling

 arch/arm/cpu/arm926ejs/lpc32xx/Makefile   |   45 +++
 arch/arm/cpu/arm926ejs/lpc32xx/clkpwr.c   |  118 +
 arch/arm/cpu/arm926ejs/lpc32xx/cpu.c  |   68 ++
 arch/arm/cpu/arm926ejs/lpc32xx/devices.c  |   52 
 arch/arm/cpu/arm926ejs/lpc32xx/timer.c|   90 +
 arch/arm/include/asm/arch-lpc32xx/clk.h   |  170 +
 arch/arm/include/asm/arch-lpc32xx/config.h|   76 +++
 arch/arm/include/asm/arch-lpc32xx/cpu.h   |   64 +
 arch/arm/include/asm/arch-lpc32xx/emc.h   |   92 +
 arch/arm/include/asm/arch-lpc32xx/sys_proto.h |   25 
 arch/arm/include/asm/arch-lpc32xx/timer.h |   74 +++
 arch/arm/include/asm/arch-lpc32xx/uart.h  |   54 
 arch/arm/include/asm/arch-lpc32xx/wdt.h   |   51 
 13 files changed, 979 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/cpu/arm926ejs/lpc32xx/Makefile
 create mode 100644 arch/arm/cpu/arm926ejs/lpc32xx/clkpwr.c
 create mode 100644 arch/arm/cpu/arm926ejs/lpc32xx/cpu.c
 create mode 100644 arch/arm/cpu/arm926ejs/lpc32xx/devices.c
 create mode 100644 arch/arm/cpu/arm926ejs/lpc32xx/timer.c
 create mode 100644 arch/arm/include/asm/arch-lpc32xx/clk.h
 create mode 100644 arch/arm/include/asm/arch-lpc32xx/config.h
 create mode 100644 arch/arm/include/asm/arch-lpc32xx/cpu.h
 create mode 100644 arch/arm/include/asm/arch-lpc32xx/emc.h
 create mode 100644 arch/arm/include/asm/arch-lpc32xx/sys_proto.h
 create mode 100644 arch/arm/include/asm/arch-lpc32xx/timer.h
 create mode 100644 arch/arm/include/asm/arch-lpc32xx/uart.h
 create mode 100644 arch/arm/include/asm/arch-lpc32xx/wdt.h

diff --git a/arch/arm/cpu/arm926ejs/lpc32xx/Makefile 
b/arch/arm/cpu/arm926ejs/lpc32xx/Makefile
new file mode 100644
index 000..e6222e4
--- /dev/null
+++ b/arch/arm/cpu/arm926ejs/lpc32xx/Makefile
@@ -0,0 +1,45 @@
+#
+# (C) Copyright 2000-2006
+# Wolfgang Denk, DENX Software Engineering, w...@denx.de.
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+# MA  02110-1301, USA.
+#
+
+include $(TOPDIR)/config.mk
+
+LIB = $(obj)lib$(SOC).o
+
+COBJS   = cpu.o clkpwr.o devices.o timer.o
+
+SRCS:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS:= $(addprefix $(obj),$(COBJS) $(SOBJS))
+
+all:$(obj).depend $(LIB)
+
+$(LIB): $(OBJS)
+   $(call cmd_link_o_target, $(OBJS))
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/arch/arm/cpu/arm926ejs/lpc32xx/clkpwr.c 
b/arch/arm/cpu/arm926ejs/lpc32xx/clkpwr.c
new file mode 100644
index 000..103157a
--- /dev/null
+++ b/arch/arm/cpu/arm926ejs/lpc32xx/clkpwr.c
@@ -0,0 +1,118 @@
+/*
+ * Copyright (C) 2011 by Vladimir Zapolskiy 
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even t

[U-Boot] [PATCH 0/3 v2] devkit3250: add Timll DevKit3250 board initial support

2012-01-11 Thread Vladimir Zapolskiy
This patchset adds generic NXP LPC32XX SoC support and basic support
for Embest/Timll DevKit3250 board, which powered by this SoC.

The patchset is done on top of u-boot/master branch. The general difference
of this resent series from the previous ones is that high speed UART driver
was added into support.

Changes in v2:
* setbits_le32() and similar helpers are used
* added general arch_cpu_init() routine

Vladimir Zapolskiy (3):
  arm926ejs: add NXP LPC32x0 cpu series support
  serial: add LPC32X0 high-speed UART devices support
  devkit3250: add Timll DevKit3250 board initial support

 MAINTAINERS   |4 +
 arch/arm/cpu/arm926ejs/lpc32xx/Makefile   |   45 +++
 arch/arm/cpu/arm926ejs/lpc32xx/clkpwr.c   |  118 +
 arch/arm/cpu/arm926ejs/lpc32xx/cpu.c  |   68 ++
 arch/arm/cpu/arm926ejs/lpc32xx/devices.c  |   52 
 arch/arm/cpu/arm926ejs/lpc32xx/timer.c|   90 +
 arch/arm/include/asm/arch-lpc32xx/clk.h   |  170 +
 arch/arm/include/asm/arch-lpc32xx/config.h|   76 +++
 arch/arm/include/asm/arch-lpc32xx/cpu.h   |   64 +
 arch/arm/include/asm/arch-lpc32xx/emc.h   |   92 +
 arch/arm/include/asm/arch-lpc32xx/sys_proto.h |   25 
 arch/arm/include/asm/arch-lpc32xx/timer.h |   74 +++
 arch/arm/include/asm/arch-lpc32xx/uart.h  |  114 +
 arch/arm/include/asm/arch-lpc32xx/wdt.h   |   51 
 board/timll/devkit3250/Makefile   |   44 +++
 board/timll/devkit3250/devkit3250.c   |   65 ++
 boards.cfg|1 +
 drivers/serial/Makefile   |1 +
 drivers/serial/lpc32xx_hsuart.c   |  112 
 include/configs/devkit3250.h  |  121 ++
 20 files changed, 1387 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/cpu/arm926ejs/lpc32xx/Makefile
 create mode 100644 arch/arm/cpu/arm926ejs/lpc32xx/clkpwr.c
 create mode 100644 arch/arm/cpu/arm926ejs/lpc32xx/cpu.c
 create mode 100644 arch/arm/cpu/arm926ejs/lpc32xx/devices.c
 create mode 100644 arch/arm/cpu/arm926ejs/lpc32xx/timer.c
 create mode 100644 arch/arm/include/asm/arch-lpc32xx/clk.h
 create mode 100644 arch/arm/include/asm/arch-lpc32xx/config.h
 create mode 100644 arch/arm/include/asm/arch-lpc32xx/cpu.h
 create mode 100644 arch/arm/include/asm/arch-lpc32xx/emc.h
 create mode 100644 arch/arm/include/asm/arch-lpc32xx/sys_proto.h
 create mode 100644 arch/arm/include/asm/arch-lpc32xx/timer.h
 create mode 100644 arch/arm/include/asm/arch-lpc32xx/uart.h
 create mode 100644 arch/arm/include/asm/arch-lpc32xx/wdt.h
 create mode 100644 board/timll/devkit3250/Makefile
 create mode 100644 board/timll/devkit3250/devkit3250.c
 create mode 100644 drivers/serial/lpc32xx_hsuart.c
 create mode 100644 include/configs/devkit3250.h

-- 
1.7.5.4

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


[U-Boot] [PATCH v2] skat91: add support for SK-AT91SAM9/SIM508 board

2012-01-11 Thread Vladimir Zapolskiy
This change adds complete support for Starterkit SK-AT91SAM9/SIM508
board.

Signed-off-by: Vladimir Zapolskiy 
Cc: Albert ARIBAUD 
Cc: Wolfgang Denk 
---
Changes from v1 to v2:
* make use of setbits_le32() and similar helpers
* phy address is defined explicitly
* removed CONFIG_EXTRA_ENV_SETTINGS

 MAINTAINERS|4 +
 board/starterkit/skat91_sim508/Makefile|   44 ++
 board/starterkit/skat91_sim508/partition.c |   39 +
 board/starterkit/skat91_sim508/skat91_sim508.c |  122 
 boards.cfg |2 +
 include/configs/skat91_sim508.h|  178 
 6 files changed, 389 insertions(+), 0 deletions(-)
 create mode 100644 board/starterkit/skat91_sim508/Makefile
 create mode 100644 board/starterkit/skat91_sim508/partition.c
 create mode 100644 board/starterkit/skat91_sim508/skat91_sim508.c
 create mode 100644 include/configs/skat91_sim508.h

diff --git a/MAINTAINERS b/MAINTAINERS
index 4bf12b5..bcd330a 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -914,6 +914,10 @@ Sughosh Ganu 
 
hawkboard   ARM926EJS (OMAP-L138)
 
+Vladimir Zapolskiy 
+
+   skat91_sim508   ARM926EJS (AT91SAM9260 SoC)
+
 -
 
 Unknown / orphaned boards:
diff --git a/board/starterkit/skat91_sim508/Makefile 
b/board/starterkit/skat91_sim508/Makefile
new file mode 100644
index 000..77965f8
--- /dev/null
+++ b/board/starterkit/skat91_sim508/Makefile
@@ -0,0 +1,44 @@
+#
+# Copyright (C) 2011 by Vladimir Zapolskiy 
+# Copyright (C) 2008, Guennadi Liakhovetski 
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+# MA  02110-1301, USA.
+#
+
+include $(TOPDIR)/config.mk
+
+LIB= $(obj)lib$(BOARD).o
+
+COBJS  := skat91_sim508.o partition.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):$(obj).depend $(OBJS) $(SOBJS)
+   $(call cmd_link_o_target, $(OBJS) $(SOBJS))
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/board/starterkit/skat91_sim508/partition.c 
b/board/starterkit/skat91_sim508/partition.c
new file mode 100644
index 000..f82046d
--- /dev/null
+++ b/board/starterkit/skat91_sim508/partition.c
@@ -0,0 +1,39 @@
+/*
+ * StarterKit SK-AT91SAM9/SIM508 board support, dataflash partitions
+ *
+ * Copyright (C) 2011 Vladimir Zapolskiy 
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ */
+
+#include 
+#include 
+#include 
+#include 
+
+AT91S_DATAFLASH_INFO dataflash_info[CONFIG_SYS_MAX_DATAFLASH_BANKS];
+
+struct dataflash_addr cs[CONFIG_SYS_MAX_DATAFLASH_BANKS] = {
+   { CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS0, 0 },
+};
+
+/* define the area offsets */
+dataflash_protect_t area_list[NB_DATAFLASH_AREA] = {
+   { 0x, 0x3FFF, FLAG_PROTECT_SET,   0, "Bootstrap" },
+   { 0x4000, 0x7FFF, FLAG_PROTECT_CLEAR, 0, "Environment" },
+   { 0x8000, 0x00037FFF, FLAG_PROTECT_SET,   0, "U-Boot" },
+   { 0x00038000, 0x0041, FLAG_PROTECT_CLEAR, 0, "Kernel" },
+};
diff --git a/board/starterkit/skat91_sim508/skat91_sim508.c 
b/board/starterkit/skat91_sim508/skat91_sim508.c
new file mode 100644
index 000..1ddafab
--- /dev/null
+++ b/board/starterkit/skat91_sim508/skat91_sim508.c
@@ -0,0 +1,122 @@
+/*
+ * Start

[U-Boot] [PATCH v2 2/2] fdt: Add tests for fdtdec

2012-01-11 Thread Simon Glass
The fdtdec_find_aliases_for_id() function is complicated enough that
it really should have some tests. This does not necessarily need to be
committed to U-Boot, but it might be useful.

Signed-off-by: Simon Glass 
---
Changes in v2:
- Add test_fdtdec command to test fdtdec_find_aliases_for_id()

 lib/Makefile  |1 +
 lib/fdtdec-test.c |  228 +
 2 files changed, 229 insertions(+), 0 deletions(-)
 create mode 100644 lib/fdtdec-test.c

diff --git a/lib/Makefile b/lib/Makefile
index 35ba7ff..421b7ac 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -39,6 +39,7 @@ COBJS-y += crc32.o
 COBJS-y += display_options.o
 COBJS-y += errno.o
 COBJS-$(CONFIG_OF_CONTROL) += fdtdec.o
+COBJS-$(CONFIG_TEST_FDTDEC) += fdtdec-test.o
 COBJS-$(CONFIG_GZIP) += gunzip.o
 COBJS-y += hashtable.o
 COBJS-$(CONFIG_LMB) += lmb.o
diff --git a/lib/fdtdec-test.c b/lib/fdtdec-test.c
new file mode 100644
index 000..68c2e3a
--- /dev/null
+++ b/lib/fdtdec-test.c
@@ -0,0 +1,228 @@
+/*
+ * Some very basic tests for fdtdec, accessed through test_fdtdec command.
+ * They are easiest to use with sandbox.
+ *
+ * Copyright (c) 2011 The Chromium OS Authors.
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+/* The size of our test fdt blob */
+#define FDT_SIZE   (16 * 1024)
+
+/**
+ * Check if an operation failed, and if so, print an error
+ *
+ * @param oper_nameName of operation
+ * @param err  Error code to check
+ *
+ * @return 0 if ok, -1 if there was an error
+ */
+static int fdt_checkerr(const char *oper_name, int err)
+{
+   if (err) {
+   printf("%s: %s: %s\n", __func__, oper_name, fdt_strerror(err));
+   return -1;
+   }
+
+   return 0;
+}
+
+/**
+ * Check the result of an operation and if incorrect, print an error
+ *
+ * @param oper_nameName of operation
+ * @param expected Expected value
+ * @param valueActual value
+ *
+ * @return 0 if ok, -1 if there was an error
+ */
+static int checkval(const char *oper_name, int expected, int value)
+{
+   if (expected != value) {
+   printf("%s: %s: expected %d, but returned %d\n", __func__,
+  oper_name, expected, value);
+   return -1;
+   }
+
+   return 0;
+}
+
+#define CHECK(op)  if (fdt_checkerr(#op, op)) return -1
+#define CHECKVAL(op, expected) \
+   if (checkval(#op, expected, op)) \
+   return -1
+#define CHECKOK(op)CHECKVAL(op, 0)
+
+/* maximum number of nodes / aliases to generate */
+#define MAX_NODES  20
+
+/*
+ * Make a test fdt
+ *
+ * @param fdt  Device tree pointer
+ * @param size Size of device tree blob
+ * @param aliases  Specifies alias assignments. Format is a list of items
+ * separated by space. Items are #a where
+ * # is the alias number
+ * a is the node to point to
+ * @param nodesSpecifies nodes to generate (a=0, b=1), upper 
case
+ * means to create a disabled node
+ */
+static int make_fdt(void *fdt, int size, const char *aliases,
+   const char *nodes)
+{
+   char name[20], value[20];
+   const char *s;
+   int fd;
+
+   CHECK(fdt_create(fdt, size));
+   CHECK(fdt_finish_reservemap(fdt));
+   CHECK(fdt_begin_node(fdt, ""));
+
+   CHECK(fdt_begin_node(fdt, "aliases"));
+   for (s = aliases; *s;) {
+   sprintf(name, "i2c%c", *s);
+   sprintf(value, "/i2c%d@0", s[1] - 'a');
+   CHECK(fdt_property_string(fdt, name, value));
+   s += 2 + (s[2] != '\0');
+   }
+   CHECK(fdt_end_node(fdt));
+
+   for (s = nodes; *s; s++) {
+   sprintf(value, "i2c%d@0", (*s & 0xdf) - 'A');
+   CHECK(fdt_begin_node(fdt, value));
+   CHECK(fdt_property_string(fdt, "compatible",
+   fdtdec_get_compatible(COMPAT_NVIDIA_TEGRA20_I2C)));
+   if (*s <= 'Z')
+   CHECK(fdt_property_string(fdt, "status", "disabled"));
+   CHECK(fdt_end_node(fdt))

[U-Boot] [PATCH v2 1/2] fdt: Add fdtdec_find_aliases() to deal with alias nodes

2012-01-11 Thread Simon Glass
Stephen Warren pointed out that we should use nodes whether or not they
have an alias in the /aliases section. The aliases section specifies the
order so far as it can, but is not essential. Operating without alisses
is useful when the enumerated order of nodes does not matter (admittedly
rare in U-Boot).

This is considerably more complex, and it is important to keep this
complexity out of driver code. This patch creates a function
fdtdec_find_aliases() which returns an ordered list of node offsets
for a particular compatible ID, taking account of alias nodes.

Signed-off-by: Simon Glass 
---
Changes in v2:
- Rename function to fdtdec_find_aliases_for_id()
- Improve alias checking algorithm to reduce run time
- Skip nodes marked as disabled
- Allow gaps in the list returned to the caller

 include/fdtdec.h |   47 ++
 lib/fdtdec.c |  114 ++
 2 files changed, 161 insertions(+), 0 deletions(-)

diff --git a/include/fdtdec.h b/include/fdtdec.h
index d871cdd..3a15f55 100644
--- a/include/fdtdec.h
+++ b/include/fdtdec.h
@@ -126,3 +126,50 @@ int fdtdec_get_is_enabled(const void *blob, int node, int 
default_val);
  * if not.
  */
 int fdtdec_check_fdt(void);
+
+/**
+ * Find the nodes for a peripheral and return a list of them in the correct
+ * order. This is used to enumerate all the peripherals of a certain type.
+ *
+ * To use this, optionally set up a /aliases node with alias properties for
+ * a peripheral. For example, for usb you could have:
+ *
+ * aliases {
+ * usb0 = "/ehci@c5008000";
+ * usb1 = "/ehci@c500";
+ * };
+ *
+ * Pass "usb" as the name to this function and will return a list of two
+ * nodes offsets: /ehci@c5008000 and ehci@c500.
+ *
+ * All nodes returned will match the compatible ID, as it is assumed that
+ * all peripherals use the same driver.
+ *
+ * If no alias node is found, then the node list will be returned in the
+ * order found in the fdt. If the aliases mention a node which doesn't
+ * exist, then this will be ignored. If nodes are found with no aliases,
+ * they will be added in any order.
+ *
+ * If there is a gap in the aliases, then this function return a 0 node at
+ * that position. The return value will also count these gaps.
+ *
+ * This function checks node properties and will not return node which are
+ * marked disabled (status = "disabled").
+ *
+ * @param blob FDT blob to use
+ * @param name Root name of alias to search for
+ * @param id   Compatible ID to look for
+ * @param node Place to put list of found nodes
+ * @param maxcount Maximum number of nodes to find
+ * @return number of nodes found on success, FTD_ERR_... on error
+ */
+int fdtdec_find_aliases_for_id(const void *blob, const char *name,
+   enum fdt_compat_id id, int *node_list, int maxcount);
+
+/*
+ * Get the name for a compatible ID
+ *
+ * @param id   Compatible ID to look for
+ * @return compatible string for that id
+ */
+const char *fdtdec_get_compatible(enum fdt_compat_id id);
diff --git a/lib/fdtdec.c b/lib/fdtdec.c
index 0f87163..3852038 100644
--- a/lib/fdtdec.c
+++ b/lib/fdtdec.c
@@ -35,6 +35,11 @@ DECLARE_GLOBAL_DATA_PTR;
 static const char * const compat_names[COMPAT_COUNT] = {
 };
 
+const char *fdtdec_get_compatible(enum fdt_compat_id id)
+{
+   return compat_names[id];
+}
+
 /**
  * Look in the FDT for an alias with the given name and return its node.
  *
@@ -132,6 +137,115 @@ int fdtdec_next_alias(const void *blob, const char *name,
return err ? -FDT_ERR_NOTFOUND : node;
 }
 
+/* TODO: Can we tighten this code up a little? */
+int fdtdec_find_aliases_for_id(const void *blob, const char *name,
+   enum fdt_compat_id id, int *node_list, int maxcount)
+{
+   int name_len = strlen(name);
+   int nodes[maxcount];
+   int num_found = 0;
+   int offset, node;
+   int alias_node;
+   int count;
+   int i, j;
+
+   /* find the alias node if present */
+   alias_node = fdt_path_offset(blob, "/aliases");
+
+   /*
+* start with nothing, and we can assume that the root node can't
+* match
+*/
+   memset(nodes, '\0', sizeof(nodes));
+
+   /* First find all the compatible nodes */
+   node = 0;
+   for (node = count = 0; node >= 0 && count < maxcount;) {
+   node = fdtdec_next_compatible(blob, node, id);
+   if (node >= 0)
+   nodes[count++] = node;
+   }
+   if (node >= 0)
+   debug("%s: warning: maxcount exceeded with alias '%s'\n",
+  __func__, name);
+
+   /* Now find all the aliases */
+   memset(node_list, '\0', sizeof(*node_list) * maxcount);
+
+   for (offset = fdt_first_property_offset(blob, alias_node);
+   offset > 0;
+   offset = fdt_next_property_offset(blob, offset)) {
+   

[U-Boot] [PATCH v2 0/2] fdt: Deal correctly with alias nodes

2012-01-11 Thread Simon Glass
This series proposes a new way to deal with alias nodes and introduces a
function to take care of it.

Drivers can now request an ordered list of compatible nodes in a single
step. This simplifies node discovery for drivers (and keeps this nasty
code in a common place).

If DEBUG is defined the alias function will print messages in the event
of a warning/error.

Changes in v2:
- Rename function to fdtdec_find_aliases_for_id()
- Improve alias checking algorithm to reduce run time
- Skip nodes marked as disabled
- Allow gaps in the list returned to the caller
- Add test_fdtdec command to test fdtdec_find_aliases_for_id()

Simon Glass (2):
  fdt: Add fdtdec_find_aliases() to deal with alias nodes
  fdt: Add tests for fdtdec

 include/fdtdec.h  |   47 +++
 lib/Makefile  |1 +
 lib/fdtdec-test.c |  228 +
 lib/fdtdec.c  |  114 ++
 4 files changed, 390 insertions(+), 0 deletions(-)
 create mode 100644 lib/fdtdec-test.c

-- 
1.7.3.1

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


[U-Boot] [PATCH v2 7/7] tegra: Use funcmux for MMC on seaboard

2012-01-11 Thread Simon Glass
Use the new funcmux_select() feature to set up the MMC pin mux.

Signed-off-by: Simon Glass 
---
Changes in v2:
- Remove funcmux_select() option parameter
- Use config enum to select funcmux

 board/nvidia/seaboard/seaboard.c |   21 -
 1 files changed, 4 insertions(+), 17 deletions(-)

diff --git a/board/nvidia/seaboard/seaboard.c b/board/nvidia/seaboard/seaboard.c
index 56acd61..9ab6825 100644
--- a/board/nvidia/seaboard/seaboard.c
+++ b/board/nvidia/seaboard/seaboard.c
@@ -24,6 +24,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -59,23 +61,8 @@ void gpio_config_uart(void)
  */
 static void pin_mux_mmc(void)
 {
-   /* SDMMC4: config 3, x8 on 2nd set of pins */
-   pinmux_set_func(PINGRP_ATB, PMUX_FUNC_SDIO4);
-   pinmux_set_func(PINGRP_GMA, PMUX_FUNC_SDIO4);
-   pinmux_set_func(PINGRP_GME, PMUX_FUNC_SDIO4);
-
-   pinmux_tristate_disable(PINGRP_ATB);
-   pinmux_tristate_disable(PINGRP_GMA);
-   pinmux_tristate_disable(PINGRP_GME);
-
-   /* SDMMC3: SDIO3_CLK, SDIO3_CMD, SDIO3_DAT[3:0] */
-   pinmux_set_func(PINGRP_SDB, PMUX_FUNC_SDIO3);
-   pinmux_set_func(PINGRP_SDC, PMUX_FUNC_SDIO3);
-   pinmux_set_func(PINGRP_SDD, PMUX_FUNC_SDIO3);
-
-   pinmux_tristate_disable(PINGRP_SDC);
-   pinmux_tristate_disable(PINGRP_SDD);
-   pinmux_tristate_disable(PINGRP_SDB);
+   funcmux_select(PERIPH_ID_SDMMC4, FUNCMUX_SDMMC4_ATB_GMA_GME_8_BIT);
+   funcmux_select(PERIPH_ID_SDMMC3, FUNCMUX_SDMMC3_SDB_4BIT);
 
/* For power GPIO PI6 */
pinmux_tristate_disable(PINGRP_ATA);
-- 
1.7.3.1

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


[U-Boot] [PATCH v2 2/7] tegra: Add enum to select from available funcmux configs

2012-01-11 Thread Simon Glass
We want to give a name to each available funcmux config. For now we just
use the pin group names (even through it is verbose) since there seems
to be nothing better.

Signed-off-by: Simon Glass 
---
Changes in v2:
- Add enum to select from available funcmux configs

 arch/arm/cpu/armv7/tegra2/board.c  |2 +-
 arch/arm/cpu/armv7/tegra2/funcmux.c|9 +
 arch/arm/include/asm/arch-tegra2/funcmux.h |   12 +++-
 3 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/arch/arm/cpu/armv7/tegra2/board.c 
b/arch/arm/cpu/armv7/tegra2/board.c
index ea06570..5f296ab 100644
--- a/arch/arm/cpu/armv7/tegra2/board.c
+++ b/arch/arm/cpu/armv7/tegra2/board.c
@@ -120,7 +120,7 @@ static void setup_uarts(int uart_ids)
if (uart_ids & (1 << i)) {
enum periph_id id = id_for_uart[i];
 
-   funcmux_select(id, 0);
+   funcmux_select(id, FUNCMUX_DEFAULT);
clock_ll_start_uart(id);
}
}
diff --git a/arch/arm/cpu/armv7/tegra2/funcmux.c 
b/arch/arm/cpu/armv7/tegra2/funcmux.c
index 0f03b9f..4706788 100644
--- a/arch/arm/cpu/armv7/tegra2/funcmux.c
+++ b/arch/arm/cpu/armv7/tegra2/funcmux.c
@@ -22,15 +22,16 @@
 /* Tegra2 high-level function multiplexing */
 #include 
 #include 
+#include 
 #include 
 
 int funcmux_select(enum periph_id id, int config)
 {
-   int bad_config = config != 0;
+   int bad_config = config != FUNCMUX_DEFAULT;
 
switch (id) {
case PERIPH_ID_UART1:
-   if (config == 0) {
+   if (config == FUNCMUX_UART1_IRRX_IRTX) {
pinmux_set_func(PINGRP_IRRX, PMUX_FUNC_UARTA);
pinmux_set_func(PINGRP_IRTX, PMUX_FUNC_UARTA);
pinmux_tristate_disable(PINGRP_IRRX);
@@ -39,14 +40,14 @@ int funcmux_select(enum periph_id id, int config)
break;
 
case PERIPH_ID_UART2:
-   if (config == 0) {
+   if (config == FUNCMUX_UART2_IRDA) {
pinmux_set_func(PINGRP_UAD, PMUX_FUNC_IRDA);
pinmux_tristate_disable(PINGRP_UAD);
}
break;
 
case PERIPH_ID_UART4:
-   if (config == 0) {
+   if (config == FUNCMUX_UART4_GMC) {
pinmux_set_func(PINGRP_GMC, PMUX_FUNC_UARTD);
pinmux_tristate_disable(PINGRP_GMC);
}
diff --git a/arch/arm/include/asm/arch-tegra2/funcmux.h 
b/arch/arm/include/asm/arch-tegra2/funcmux.h
index d4f9cfb..791f301 100644
--- a/arch/arm/include/asm/arch-tegra2/funcmux.h
+++ b/arch/arm/include/asm/arch-tegra2/funcmux.h
@@ -24,6 +24,16 @@
 #ifndef __FUNCMUX_H
 #define __FUNCMUX_H
 
+/* Configs supported by the func mux */
+enum {
+   FUNCMUX_DEFAULT = 0,/* default config */
+
+   /* UART configs */
+   FUNCMUX_UART1_IRRX_IRTX = 0,
+   FUNCMUX_UART2_IRDA = 0,
+   FUNCMUX_UART4_GMC = 0,
+};
+
 /**
  * Select a config for a particular peripheral.
  *
@@ -36,7 +46,7 @@
  * so that they operate in normal mode.
  *
  * @param id   Peripheral id
- * @param config   Configuration to use (generally 0)
+ * @param config   Configuration to use (FUNCMUX_...), 0 for default
  * @return 0 if ok, -1 on error (e.g. incorrect id or config)
  */
 int funcmux_select(enum periph_id id, int config);
-- 
1.7.3.1

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


[U-Boot] [PATCH v2 5/7] tegra: Use funcmux for MMC on tamonten

2012-01-11 Thread Simon Glass
Use the new funcmux_select() feature to set up the MMC pin mux.

Signed-off-by: Simon Glass 
---
Changes in v2:
- Remove funcmux_select() option parameter
- Use config enum to select funcmux

 board/avionic-design/common/tamonten.c |   10 ++
 1 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/board/avionic-design/common/tamonten.c 
b/board/avionic-design/common/tamonten.c
index 97e59fb..f23b657 100644
--- a/board/avionic-design/common/tamonten.c
+++ b/board/avionic-design/common/tamonten.c
@@ -32,6 +32,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -63,14 +64,7 @@ int timer_init(void)
  */
 static void pin_mux_mmc(void)
 {
-   /* SDMMC4: config 3, x8 on 2nd set of pins */
-   pinmux_set_func(PINGRP_ATB, PMUX_FUNC_SDIO4);
-   pinmux_set_func(PINGRP_GMA, PMUX_FUNC_SDIO4);
-   pinmux_set_func(PINGRP_GME, PMUX_FUNC_SDIO4);
-
-   pinmux_tristate_disable(PINGRP_ATB);
-   pinmux_tristate_disable(PINGRP_GMA);
-   pinmux_tristate_disable(PINGRP_GME);
+   funcmux_select(PERIPH_ID_SDMMC4, FUNCMUX_SDMMC4_ATB_GMA_GME_8_BIT);
 }
 #endif
 
-- 
1.7.3.1

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


[U-Boot] [PATCH v2 4/7] tegra: Add SDMMC support to funcmux

2012-01-11 Thread Simon Glass
This adds support for SDMMC ports to the funcmux. Only one
option is supported: FUNCMUXO_SDMMC_8BIT which selects an 8-bit
wide SDIO interface where available.

Signed-off-by: Simon Glass 
---
Changes in v2:
- Fix SDMMC4 config 0 to remove unwanted ATB pin group
- Remove funcmux_select() option parameter
- Use config enum to select funcmux

 arch/arm/cpu/armv7/tegra2/funcmux.c|   63 
 arch/arm/include/asm/arch-tegra2/funcmux.h |8 
 2 files changed, 71 insertions(+), 0 deletions(-)

diff --git a/arch/arm/cpu/armv7/tegra2/funcmux.c 
b/arch/arm/cpu/armv7/tegra2/funcmux.c
index 6df9378..73950d0 100644
--- a/arch/arm/cpu/armv7/tegra2/funcmux.c
+++ b/arch/arm/cpu/armv7/tegra2/funcmux.c
@@ -93,6 +93,69 @@ int funcmux_select(enum periph_id id, int config)
}
break;
 
+   case PERIPH_ID_SDMMC2:
+   if (config == FUNCMUX_SDMMC2_DTA_DTD_8BIT) {
+   pinmux_set_func(PINGRP_DTA, PMUX_FUNC_SDIO2);
+   pinmux_set_func(PINGRP_DTD, PMUX_FUNC_SDIO2);
+
+   pinmux_tristate_disable(PINGRP_DTA);
+   pinmux_tristate_disable(PINGRP_DTD);
+   }
+   break;
+
+   case PERIPH_ID_SDMMC3:
+   switch (config) {
+   case FUNCMUX_SDMMC3_SDB_SLXA_8BIT:
+   pinmux_set_func(PINGRP_SLXA, PMUX_FUNC_SDIO3);
+   pinmux_set_func(PINGRP_SLXC, PMUX_FUNC_SDIO3);
+   pinmux_set_func(PINGRP_SLXD, PMUX_FUNC_SDIO3);
+   pinmux_set_func(PINGRP_SLXK, PMUX_FUNC_SDIO3);
+
+   pinmux_tristate_disable(PINGRP_SLXA);
+   pinmux_tristate_disable(PINGRP_SLXC);
+   pinmux_tristate_disable(PINGRP_SLXD);
+   pinmux_tristate_disable(PINGRP_SLXK);
+   /* fall through */
+
+   case FUNCMUX_SDMMC3_SDB_4BIT:
+   pinmux_set_func(PINGRP_SDB, PMUX_FUNC_SDIO3);
+   pinmux_set_func(PINGRP_SDC, PMUX_FUNC_SDIO3);
+   pinmux_set_func(PINGRP_SDD, PMUX_FUNC_SDIO3);
+
+   pinmux_tristate_disable(PINGRP_SDB);
+   pinmux_tristate_disable(PINGRP_SDC);
+   pinmux_tristate_disable(PINGRP_SDD);
+   bad_config = 0;
+   break;
+   }
+   break;
+
+   case PERIPH_ID_SDMMC4:
+   switch (config) {
+   case FUNCMUX_SDMMC4_ATC_ATD_8BIT:
+   pinmux_set_func(PINGRP_ATC, PMUX_FUNC_SDIO4);
+   pinmux_set_func(PINGRP_ATD, PMUX_FUNC_SDIO4);
+
+   pinmux_tristate_disable(PINGRP_ATC);
+   pinmux_tristate_disable(PINGRP_ATD);
+   break;
+
+   case FUNCMUX_SDMMC4_ATB_GMA_GME_8_BIT:
+   pinmux_set_func(PINGRP_GME, PMUX_FUNC_SDIO4);
+   pinmux_tristate_disable(PINGRP_GME);
+   /* fall through */
+
+   case FUNCMUX_SDMMC4_ATB_GMA_4_BIT:
+   pinmux_set_func(PINGRP_ATB, PMUX_FUNC_SDIO4);
+   pinmux_set_func(PINGRP_GMA, PMUX_FUNC_SDIO4);
+
+   pinmux_tristate_disable(PINGRP_ATB);
+   pinmux_tristate_disable(PINGRP_GMA);
+   bad_config = 0;
+   break;
+   }
+   break;
+
default:
debug("%s: invalid periph_id %d", __func__, id);
return -1;
diff --git a/arch/arm/include/asm/arch-tegra2/funcmux.h 
b/arch/arm/include/asm/arch-tegra2/funcmux.h
index d184523..ae73c72 100644
--- a/arch/arm/include/asm/arch-tegra2/funcmux.h
+++ b/arch/arm/include/asm/arch-tegra2/funcmux.h
@@ -39,6 +39,14 @@ enum {
FUNCMUX_I2C2_DDC = 0,
FUNCMUX_I2C2_PTA,
FUNCMUX_I2C3_DTF = 0,
+
+   /* SDMMC configs */
+   FUNCMUX_SDMMC2_DTA_DTD_8BIT = 0,
+   FUNCMUX_SDMMC3_SDB_4BIT = 0,
+   FUNCMUX_SDMMC3_SDB_SLXA_8BIT,
+   FUNCMUX_SDMMC4_ATC_ATD_8BIT = 0,
+   FUNCMUX_SDMMC4_ATB_GMA_4_BIT,
+   FUNCMUX_SDMMC4_ATB_GMA_GME_8_BIT,
 };
 
 /**
-- 
1.7.3.1

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


[U-Boot] [PATCH v2 6/7] tegra: Use funcmux for MMC on harmony

2012-01-11 Thread Simon Glass
Use the new funcmux_select() feature to set up the MMC pin mux.

Signed-off-by: Simon Glass 
---
Changes in v2:
- Remove funcmux_select() option parameter
- Use config enum to select funcmux

 board/nvidia/harmony/harmony.c |   19 ---
 1 files changed, 4 insertions(+), 15 deletions(-)

diff --git a/board/nvidia/harmony/harmony.c b/board/nvidia/harmony/harmony.c
index d5e147d..8f8e7bf 100644
--- a/board/nvidia/harmony/harmony.c
+++ b/board/nvidia/harmony/harmony.c
@@ -24,6 +24,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -46,27 +48,14 @@ void gpio_config_uart(void)
  */
 static void pin_mux_mmc(void)
 {
-   /* SDMMC4: config 3, x8 on 2nd set of pins */
-   pinmux_set_func(PINGRP_ATB, PMUX_FUNC_SDIO4);
-   pinmux_set_func(PINGRP_GMA, PMUX_FUNC_SDIO4);
-   pinmux_set_func(PINGRP_GME, PMUX_FUNC_SDIO4);
-
-   pinmux_tristate_disable(PINGRP_ATB);
-   pinmux_tristate_disable(PINGRP_GMA);
-   pinmux_tristate_disable(PINGRP_GME);
+   funcmux_select(PERIPH_ID_SDMMC4, FUNCMUX_SDMMC4_ATB_GMA_GME_8_BIT);
+   funcmux_select(PERIPH_ID_SDMMC2, FUNCMUX_SDMMC2_DTA_DTD_8BIT);
 
/* For power GPIO PI6 */
pinmux_tristate_disable(PINGRP_ATA);
/* For CD GPIO PH2 */
pinmux_tristate_disable(PINGRP_ATD);
 
-   /* SDMMC2: SDIO2_CLK, SDIO2_CMD, SDIO2_DAT[7:0] */
-   pinmux_set_func(PINGRP_DTA, PMUX_FUNC_SDIO2);
-   pinmux_set_func(PINGRP_DTD, PMUX_FUNC_SDIO2);
-
-   pinmux_tristate_disable(PINGRP_DTA);
-   pinmux_tristate_disable(PINGRP_DTD);
-
/* For power GPIO PT3 */
pinmux_tristate_disable(PINGRP_DTB);
/* For CD GPIO PI5 */
-- 
1.7.3.1

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


[U-Boot] [PATCH v2 3/7] tegra: Add I2C support to funcmux

2012-01-11 Thread Simon Glass
Add support to funcmux for selecting I2C functions and programming
the pinmux appropriately.

Signed-off-by: Simon Glass 
---
Changes in v2:
- Remove funcmux_select() option parameter
- Use config enum to select funcmux

 arch/arm/cpu/armv7/tegra2/funcmux.c|   40 
 arch/arm/include/asm/arch-tegra2/funcmux.h |7 +
 2 files changed, 47 insertions(+), 0 deletions(-)

diff --git a/arch/arm/cpu/armv7/tegra2/funcmux.c 
b/arch/arm/cpu/armv7/tegra2/funcmux.c
index 4706788..6df9378 100644
--- a/arch/arm/cpu/armv7/tegra2/funcmux.c
+++ b/arch/arm/cpu/armv7/tegra2/funcmux.c
@@ -53,6 +53,46 @@ int funcmux_select(enum periph_id id, int config)
}
break;
 
+   case PERIPH_ID_DVC_I2C:
+   /* there is only one selection, pinmux_config is ignored */
+   if (config == FUNCMUX_DVC_I2CP) {
+   pinmux_set_func(PINGRP_I2CP, PMUX_FUNC_I2C);
+   pinmux_tristate_disable(PINGRP_I2CP);
+   }
+   break;
+
+   case PERIPH_ID_I2C1:
+   /* support pinmux_config of 0 for now, */
+   if (config == FUNCMUX_I2C1_RM) {
+   pinmux_set_func(PINGRP_RM, PMUX_FUNC_I2C);
+   pinmux_tristate_disable(PINGRP_RM);
+   }
+   break;
+   case PERIPH_ID_I2C2: /* I2C2 */
+   switch (config) {
+   case FUNCMUX_I2C2_DDC:  /* DDC pin group, select I2C2 */
+   pinmux_set_func(PINGRP_DDC, PMUX_FUNC_I2C2);
+   /* PTA to HDMI */
+   pinmux_set_func(PINGRP_PTA, PMUX_FUNC_HDMI);
+   pinmux_tristate_disable(PINGRP_DDC);
+   break;
+   case FUNCMUX_I2C2_PTA:  /* PTA pin group, select I2C2 */
+   pinmux_set_func(PINGRP_PTA, PMUX_FUNC_I2C2);
+   /* set DDC_SEL to RSVDx (RSVD2 works for now) */
+   pinmux_set_func(PINGRP_DDC, PMUX_FUNC_RSVD2);
+   pinmux_tristate_disable(PINGRP_PTA);
+   bad_config = 0;
+   break;
+   }
+   break;
+   case PERIPH_ID_I2C3: /* I2C3 */
+   /* support pinmux_config of 0 for now */
+   if (config == FUNCMUX_I2C3_DTF) {
+   pinmux_set_func(PINGRP_DTF, PMUX_FUNC_I2C3);
+   pinmux_tristate_disable(PINGRP_DTF);
+   }
+   break;
+
default:
debug("%s: invalid periph_id %d", __func__, id);
return -1;
diff --git a/arch/arm/include/asm/arch-tegra2/funcmux.h 
b/arch/arm/include/asm/arch-tegra2/funcmux.h
index 791f301..d184523 100644
--- a/arch/arm/include/asm/arch-tegra2/funcmux.h
+++ b/arch/arm/include/asm/arch-tegra2/funcmux.h
@@ -32,6 +32,13 @@ enum {
FUNCMUX_UART1_IRRX_IRTX = 0,
FUNCMUX_UART2_IRDA = 0,
FUNCMUX_UART4_GMC = 0,
+
+   /* I2C configs */
+   FUNCMUX_DVC_I2CP = 0,
+   FUNCMUX_I2C1_RM = 0,
+   FUNCMUX_I2C2_DDC = 0,
+   FUNCMUX_I2C2_PTA,
+   FUNCMUX_I2C3_DTF = 0,
 };
 
 /**
-- 
1.7.3.1

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


[U-Boot] [PATCH v2 1/7] tegra: Adjust funcmux config test to permit expansion

2012-01-11 Thread Simon Glass
We want to support config options other than zero, so move the test to the
end to allow intermediate code to OK such a config.

Signed-off-by: Simon Glass 
---

 arch/arm/cpu/armv7/tegra2/funcmux.c|   35 +--
 arch/arm/include/asm/arch-tegra2/funcmux.h |3 ++
 2 files changed, 25 insertions(+), 13 deletions(-)

diff --git a/arch/arm/cpu/armv7/tegra2/funcmux.c 
b/arch/arm/cpu/armv7/tegra2/funcmux.c
index 0878f51..0f03b9f 100644
--- a/arch/arm/cpu/armv7/tegra2/funcmux.c
+++ b/arch/arm/cpu/armv7/tegra2/funcmux.c
@@ -26,27 +26,30 @@
 
 int funcmux_select(enum periph_id id, int config)
 {
-   if (config != 0) {
-   debug("%s: invalid config %d for periph_id %d", __func__,
- config, id);
-   return -1;
-   }
+   int bad_config = config != 0;
+
switch (id) {
case PERIPH_ID_UART1:
-   pinmux_set_func(PINGRP_IRRX, PMUX_FUNC_UARTA);
-   pinmux_set_func(PINGRP_IRTX, PMUX_FUNC_UARTA);
-   pinmux_tristate_disable(PINGRP_IRRX);
-   pinmux_tristate_disable(PINGRP_IRTX);
+   if (config == 0) {
+   pinmux_set_func(PINGRP_IRRX, PMUX_FUNC_UARTA);
+   pinmux_set_func(PINGRP_IRTX, PMUX_FUNC_UARTA);
+   pinmux_tristate_disable(PINGRP_IRRX);
+   pinmux_tristate_disable(PINGRP_IRTX);
+   }
break;
 
case PERIPH_ID_UART2:
-   pinmux_set_func(PINGRP_UAD, PMUX_FUNC_IRDA);
-   pinmux_tristate_disable(PINGRP_UAD);
+   if (config == 0) {
+   pinmux_set_func(PINGRP_UAD, PMUX_FUNC_IRDA);
+   pinmux_tristate_disable(PINGRP_UAD);
+   }
break;
 
case PERIPH_ID_UART4:
-   pinmux_set_func(PINGRP_GMC, PMUX_FUNC_UARTD);
-   pinmux_tristate_disable(PINGRP_GMC);
+   if (config == 0) {
+   pinmux_set_func(PINGRP_GMC, PMUX_FUNC_UARTD);
+   pinmux_tristate_disable(PINGRP_GMC);
+   }
break;
 
default:
@@ -54,5 +57,11 @@ int funcmux_select(enum periph_id id, int config)
return -1;
}
 
+   if (bad_config) {
+   debug("%s: invalid config %d for periph_id %d", __func__,
+ config, id);
+   return -1;
+   }
+
return 0;
 }
diff --git a/arch/arm/include/asm/arch-tegra2/funcmux.h 
b/arch/arm/include/asm/arch-tegra2/funcmux.h
index 2d724a2..d4f9cfb 100644
--- a/arch/arm/include/asm/arch-tegra2/funcmux.h
+++ b/arch/arm/include/asm/arch-tegra2/funcmux.h
@@ -32,6 +32,9 @@
  * The basic config is 0, and higher numbers indicate different
  * pinmux settings to bring the peripheral out on other pins,
  *
+ * This function also disables tristate for the function's pins,
+ * so that they operate in normal mode.
+ *
  * @param id   Peripheral id
  * @param config   Configuration to use (generally 0)
  * @return 0 if ok, -1 on error (e.g. incorrect id or config)
-- 
1.7.3.1

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


Re: [U-Boot] [PATCH 3/3 v3] devkit3250: add Timll DevKit3250 board initial support

2012-01-11 Thread Vladimir Zapolskiy

On 12.01.2012 00:08, Marek Vasut wrote:

On 11.01.2012 22:56, Marek Vasut wrote:

This change adds a basic support for Embest/Timll DevKit3250 board,
NOR and UART are the only supported peripherals for a moment. The board
doesn't require low-level init, because the initial SDRAM and GPIO
configuration is performed during kickstart bootloader execution.

Signed-off-by: Vladimir Zapolskiy
---
Changes from v2 to v3:
* updated a relocation address
* combined a record in maintainers file into the patch
* use high speed UART2 by default

Changes from v1 to v2:
* corrected address in GPLv2+ licence header in files
* removed clean and distclean targets from board makefile
* do not set machine id explicitly, if CONFIG_MACH_TYPE is defined
* minor indentation cleanups

   MAINTAINERS |4 +
   board/timll/devkit3250/Makefile |   44 +
   board/timll/devkit3250/devkit3250.c |   71 
   boards.cfg  |1 +
   include/configs/devkit3250.h|  121

+++ 5 files changed, 241 insertions(+),
0 deletions(-)

   create mode 100644 board/timll/devkit3250/Makefile
   create mode 100644 board/timll/devkit3250/devkit3250.c
   create mode 100644 include/configs/devkit3250.h

diff --git a/MAINTAINERS b/MAINTAINERS
index 4bf12b5..68dedae 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -914,6 +914,10 @@ Sughosh Ganu

hawkboard   ARM926EJS (OMAP-L138)

+Vladimir Zapolskiy
+
+   devkit3250  lpc32xx
+

   --
   ---

   Unknown / orphaned boards:
diff --git a/board/timll/devkit3250/Makefile
b/board/timll/devkit3250/Makefile new file mode 100644
index 000..ea7827c
--- /dev/null
+++ b/board/timll/devkit3250/Makefile
@@ -0,0 +1,44 @@
+#
+# Copyright (C) 2011 by Vladimir Zapolskiy
+# Copyright (C) 2008, Guennadi Liakhovetski
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+# MA  02110-1301, USA.
+#
+
+include $(TOPDIR)/config.mk
+
+LIB= $(obj)lib$(BOARD).o
+
+COBJS  := devkit3250.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):$(obj).depend $(OBJS) $(SOBJS)
+   $(call cmd_link_o_target, $(OBJS) $(SOBJS))
+
+###
## +
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+###
## diff --git a/board/timll/devkit3250/devkit3250.c
b/board/timll/devkit3250/devkit3250.c new file mode 100644
index 000..461012d
--- /dev/null
+++ b/board/timll/devkit3250/devkit3250.c
@@ -0,0 +1,71 @@
+/*
+ * Embest/Timll DevKit3250 board support
+ *
+ * Copyright (C) 2011 Vladimir Zapolskiy
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ */
+
+#include
+#include
+#include
+#include
+
+DECLARE_GLOBAL_DATA_PTR;
+
+static struct emc_t *emc = (struct emc_t *)EMC_BASE;
+
+int board_early_init_f(void)
+{
+   lpc32xx_uart_init(CONFIG_SYS_LPC32XX_UART);
+
+   return 0;
+}
+
+int board_init(void)
+{
+   /*
+* It might be necessary to flush data cache, if U-boot is loaded
+* from kickstart bootloader, e.g. from S1L loader
+*/
+   flush_cache(0, 0);


You're flushing no area here ... also, shouldn't this go to CPU init code
?


That's just a complete cache flush, from arch/arm/lib/cache.c size
argument is actually redundant.

Basically this should go into low le

[U-Boot] [PATCH v2 0/7] tegra: Enhance funcmux to support I2C and MMC

2012-01-11 Thread Simon Glass
This series expands funcmux_select() to support configs other than 0, and
to name each config option.

This permits introduction of I2C and MMC support in the funcmux.

Changes in v2:
- Add enum to select from available funcmux configs
- Remove funcmux_select() option parameter
- Use config enum to select funcmux
- Fix SDMMC4 config 0 to remove unwanted ATB pin group

Simon Glass (7):
  tegra: Adjust funcmux config test to permit expansion
  tegra: Add enum to select from available funcmux configs
  tegra: Add I2C support to funcmux
  tegra: Add SDMMC support to funcmux
  tegra: Use funcmux for MMC on tamonten
  tegra: Use funcmux for MMC on harmony
  tegra: Use funcmux for MMC on seaboard

 arch/arm/cpu/armv7/tegra2/board.c  |2 +-
 arch/arm/cpu/armv7/tegra2/funcmux.c|  139 +---
 arch/arm/include/asm/arch-tegra2/funcmux.h |   30 ++-
 board/avionic-design/common/tamonten.c |   10 +--
 board/nvidia/harmony/harmony.c |   19 +---
 board/nvidia/seaboard/seaboard.c   |   21 +
 6 files changed, 166 insertions(+), 55 deletions(-)

-- 
1.7.3.1

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


Re: [U-Boot] [PATCH 0/7] tegra: Enhance funcmux to support I2C and MMC

2012-01-11 Thread Simon Glass
Hi Stephen,

On Mon, Jan 9, 2012 at 3:46 PM, Stephen Warren  wrote:
> On 01/09/2012 04:36 PM, Simon Glass wrote:
>> Hi Stephen,
>>
>> On Mon, Jan 9, 2012 at 3:11 PM, Stephen Warren  wrote:
>>> On 01/09/2012 03:53 PM, Simon Glass wrote:
 This series expands funcmux_select() to support configs other than 0, and
 to support options associated with a config.

 This permits introduction of I2C support using multiple config options.

 The options parameter is used by MMC to select standard (4-bit) or 8-bit
 operation.
>>>
>>> The unification in this series basically seems fine.
>>>
>>> Why not consider bus width part of the "config" though, rather the
>>> complicating things with an extra parameter? As an example, for SDMMC4,
>>> you'd have say:
>>>
>>> 0: ATC + ATD 8 bit
>>> 1: ATB + GMA 4 bit
>>> 2: ATB + GMA + GME 8 bit
>>>
>>> ... and no option values.
>>
>> I am thinking ahead a little to where we have more peripherals with
>> several options. If we imagine a situation where the SOC has 3
>> different pin configs each of which can be 1-bit, 4-bit or 8-bit, then
>> it is nice to have the options broken out separately.
>
> On Tegra20, the pin mux is controlled in groups, so you're mostly
> picking which groups to use for the function, which then determines the
> bus width. In other words, its often unlikely that you can pick bus
> width as an independent option from the set of pins/groups used.

I wasn't really saying it was independent, just that some configs
offer different variations and it would be nice to make this explicit
rather than flattening the config + options information into a single
value. For now the benefit is marginal so I will remove it,
particularly as you say it will be no use on Tegra30:

>
> On Tegra30, the situation is about the same except that the mux function
> is picked on a per-pin basis instead of in groups of pins, which takes
> the same argument even further; for a 4-bit bus you'd simply remove 4
> pins from the list of pins being used, so it doesn't make sense to refer
> to 4-bit as an option of an 8-bit setup with some pins unused, because
> the unused pins are set to some other mux function.

IMO it does make sense for the user - remember I am trying to simplify
pinmux use for boards. Exposing all the different pins is almost
exactly what I am trying to avoid :-)

>
>> Also, we can also use the options for something else, like Tegra 3's
>> drive strength and slew rate control (and perhaps other things I
>> understand even less).
>
> There are far far too many options for that to be represented by a
> single U32, or even a small number of them. When boards start needing to
> set up drive strengths etc., we'll probably need individual API calls
> for each config option, since each board's characterization will trigger
> a combination of options that's extremely likely to be unique.

My reading of the Tegra30 registers suggested this was possible, but
it seems I assumed too much!

>
>>> Also, we should probably define names for the config values, at least in
>>> the cases where 0 isn't the only option. Hard-coding 0 or 1 at the call
>>> sites isn't very meaningful.
>>
>> I can certainly do that - it was in the back of my mind. But the only
>> thing I could think of was to create an enum with the pingroup
>> assignments, like:
>>
>> enum {
>>     UART1_IRRX_IRTX   = 0,
>>     UART2_UAD             = 0,
>> ...
>> };
>>
>> Seems a bit ugly?
>
> I don't agree. The options are just completely arbitrary IDs for a
> particular set of pins/groups that are being used. Well, arbitrary
> within the set of possibilities given the wiring of Tegra's pinmux HW
> anyway. Hence, giving those IDs names based on which pins/groups are
> being used makes sense to me.

OK ugly long enums are on their way :-) - will send a new series.
Thanks again for the helpful review.

Regards,
Simon

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


[U-Boot] [PATCH] nand_spl: store ecc data on the stack

2012-01-11 Thread Scott Wood
Adapt the following patch from spl to nand_spl:

  Author: Stefano Babic 
  Date:   Thu Dec 15 10:55:37 2011 +0100

  nand_spl_simple: store ecc data on the stack

  Currently nand_spl_simple puts it's temp data at 0x1 offset in SDRAM
  which is likely to contain already loaded data.
  The patch saves the oob data and the ecc on the stack replacing
  the fixed address in RAM.

  Signed-off-by: Stefano Babic 
  CC: Ilya Yanok 
  CC: Scott Wood 
  CC: Tom Rini 
  CC: Simon Schwarz 
  CC: Wolfgang Denk 
  Signed-off-by: Scott Wood 

While nand_spl is on its way out, in favor of spl, there are still
many boards using it, and conversions are gradual.  This allows us
to get rid of CONFIG_SYS_NAND_ECCSTEPS and CONFIG_SYS_NAND_ECCTOTAL now,
which would otherwise be likely to linger unreferenced after a conversion.

It also eliminates a temporary error in the hawkboard_nand build, since
the spl version of the patch removed ECCSTEPS/TOTAL from hawkboard.h, but
the spl conversion is pending (and may be merged via a different tree).

Signed-off-by: Scott Wood 
---
 include/configs/PMC440.h |2 -
 include/configs/acadia.h |2 -
 include/configs/bamboo.h |2 -
 include/configs/cam_enc_4xx.h|3 --
 include/configs/canyonlands.h|2 -
 include/configs/kilauea.h|2 -
 include/configs/qi_lb60.h|4 ---
 include/configs/sequoia.h|2 -
 include/configs/smdk6400.h   |4 ---
 include/configs/tam3517-common.h |5 
 nand_spl/nand_boot.c |   42 ++---
 11 files changed, 16 insertions(+), 54 deletions(-)

diff --git a/include/configs/PMC440.h b/include/configs/PMC440.h
index ed47a87..b820954 100644
--- a/include/configs/PMC440.h
+++ b/include/configs/PMC440.h
@@ -200,9 +200,7 @@
 
 #define CONFIG_SYS_NAND_ECCSIZE256
 #define CONFIG_SYS_NAND_ECCBYTES   3
-#define CONFIG_SYS_NAND_ECCSTEPS   (CONFIG_SYS_NAND_PAGE_SIZE / 
CONFIG_SYS_NAND_ECCSIZE)
 #define CONFIG_SYS_NAND_OOBSIZE16
-#define CONFIG_SYS_NAND_ECCTOTAL   (CONFIG_SYS_NAND_ECCBYTES * 
CONFIG_SYS_NAND_ECCSTEPS)
 #define CONFIG_SYS_NAND_ECCPOS {0, 1, 2, 3, 6, 7}
 #endif
 
diff --git a/include/configs/acadia.h b/include/configs/acadia.h
index 5573dc7..8c447ca 100644
--- a/include/configs/acadia.h
+++ b/include/configs/acadia.h
@@ -185,9 +185,7 @@
 
 #define CONFIG_SYS_NAND_ECCSIZE256
 #define CONFIG_SYS_NAND_ECCBYTES   3
-#define CONFIG_SYS_NAND_ECCSTEPS   (CONFIG_SYS_NAND_PAGE_SIZE / 
CONFIG_SYS_NAND_ECCSIZE)
 #define CONFIG_SYS_NAND_OOBSIZE16
-#define CONFIG_SYS_NAND_ECCTOTAL   (CONFIG_SYS_NAND_ECCBYTES * 
CONFIG_SYS_NAND_ECCSTEPS)
 #define CONFIG_SYS_NAND_ECCPOS {0, 1, 2, 3, 6, 7}
 
 #ifdef CONFIG_ENV_IS_IN_NAND
diff --git a/include/configs/bamboo.h b/include/configs/bamboo.h
index 7b66fc0..506a558 100644
--- a/include/configs/bamboo.h
+++ b/include/configs/bamboo.h
@@ -179,9 +179,7 @@
 
 #define CONFIG_SYS_NAND_ECCSIZE256
 #define CONFIG_SYS_NAND_ECCBYTES   3
-#define CONFIG_SYS_NAND_ECCSTEPS   (CONFIG_SYS_NAND_PAGE_SIZE / 
CONFIG_SYS_NAND_ECCSIZE)
 #define CONFIG_SYS_NAND_OOBSIZE16
-#define CONFIG_SYS_NAND_ECCTOTAL   (CONFIG_SYS_NAND_ECCBYTES * 
CONFIG_SYS_NAND_ECCSTEPS)
 #define CONFIG_SYS_NAND_ECCPOS {0, 1, 2, 3, 6, 7}
 
 #ifdef CONFIG_ENV_IS_IN_NAND
diff --git a/include/configs/cam_enc_4xx.h b/include/configs/cam_enc_4xx.h
index 86f74df..5d9672f 100644
--- a/include/configs/cam_enc_4xx.h
+++ b/include/configs/cam_enc_4xx.h
@@ -235,9 +235,6 @@
 #define CONFIG_SYS_NAND_ECCBYTES   10
 #define CONFIG_SYS_NAND_OOBSIZE64
 #define CONFIG_SYS_NAND_5_ADDR_CYCLE
-#define CONFIG_SYS_NAND_ECCSTEPS   (CONFIG_SYS_NAND_PAGE_SIZE / \
-CONFIG_SYS_NAND_ECCSIZE)
-#define CONFIG_SYS_NAND_ECCTOTAL   (40)
 
 /*
  * RBL searches from Block n (n = 1..24)
diff --git a/include/configs/canyonlands.h b/include/configs/canyonlands.h
index 8c03582..acb127c 100644
--- a/include/configs/canyonlands.h
+++ b/include/configs/canyonlands.h
@@ -197,9 +197,7 @@
 
 #define CONFIG_SYS_NAND_ECCSIZE256
 #define CONFIG_SYS_NAND_ECCBYTES   3
-#define CONFIG_SYS_NAND_ECCSTEPS   (CONFIG_SYS_NAND_PAGE_SIZE / 
CONFIG_SYS_NAND_ECCSIZE)
 #define CONFIG_SYS_NAND_OOBSIZE64
-#define CONFIG_SYS_NAND_ECCTOTAL   (CONFIG_SYS_NAND_ECCBYTES * 
CONFIG_SYS_NAND_ECCSTEPS)
 #define CONFIG_SYS_NAND_ECCPOS {40, 41, 42, 43, 44, 45, 46, 47, \
 48, 49, 50, 51, 52, 53, 54, 55, \
 56, 57, 58, 59, 60, 61, 62, 63}
diff --git a/include/configs/kilauea.h b/include/configs/kilauea.h
index e66aadf..621dbb8 100644
--- a/include/configs/kilauea.h
+++ b/include/configs/kilauea.h
@@ -210,9 +210,7 @@
 
 #define CONFIG_SYS_NAND_ECCSIZE256
 #define CONFIG_SYS_NAND_ECCBYTES   3
-#def

Re: [U-Boot] [PATCH 1/2 V2] arm926: Flush the data cache before disabling it.

2012-01-11 Thread Marek Vasut
> Hi,
> 
> On Wednesday, January 11, 2012, Marek Vasut  wrote:
> >> On Wed Jan 11, 2012 at 04:01:31PM +0100, Marek Vasut wrote:
> >> > >   More so, given the fact that we don't have any control over
> >> > >   rbl -- so if rbl changes it's layout for any subsequent board,
> >> > >   we'd have to add that as well to the nand driver, and both in
> >> > >   u-boot as well as the kernel.
> >> > >   
> >> > >   I guess the cleanest solution would have been for the rbl to have
> >> > >   used the same layout as the one used by u-boot and linux.
> >> > 
> >> > Yep, why not do that then?
> >> > 
> >>   Because rbl is a proprietary bootloader from TI.
> > 
> > Don't we actually have replacement bootloader in uboot already ? You
> 
> don't need
> 
> > xloader with uboot anymore I think.
> 
> RBL ist the ROM bootloader in the SoC, it's not only proprietary but also
> in ROM and hence cannot be changed.
> 
> RBL executes an AIS script. Sughosh, could you please explain what your AIS
> does or how you create it?

So basically, this SPL business can be avoided and this all can be done in a 
standard way?

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


Re: [U-Boot] [PATCH v2 2/4] zipitz2: enable pxa27x_mkp driver

2012-01-11 Thread Marek Vasut
> Signed-off-by: Vasily Khoruzhick 
> ---

Acked-by: Marek Vasut 

> v2: remove usbtty stuff from EXTRA_ENV_SETTINGS
> 
>  include/configs/zipitz2.h |   82
> ++--- 1 files changed, 77
> insertions(+), 5 deletions(-)
> 
> diff --git a/include/configs/zipitz2.h b/include/configs/zipitz2.h
> index 26204af..75de677 100644
> --- a/include/configs/zipitz2.h
> +++ b/include/configs/zipitz2.h
> @@ -80,6 +80,12 @@
>  #define  CONFIG_CMD_MMC
>  #define  CONFIG_CMD_SPI
> 
> +#define  CONFIG_EXTRA_ENV_SETTINGS   
\
> + "stdout=lcd\0"  \
> + "stdin=pxa27x-mkp\0"\
> + "stderr=lcd\0"  \
> + ""
> +#define  CONFIG_KEYBOARD
>  /*
>   * MMC Card Configuration
>   */
> @@ -206,15 +212,81 @@ unsigned char zipitz2_spi_read(void);
>  #define CONFIG_SYS_FLASH_PROTECTION
> 
>  /*
> + * Matrix keypad
> + */
> +#ifdef   CONFIG_KEYBOARD
> +#define  CONFIG_PXA27X_MKP
> +
> +#define  CONFIG_PXA27X_MKP_MKP_COLS  7
> +#define  CONFIG_PXA27X_MKP_MKP_ROWS  6
> +
> +#define  CONFIG_PXA27X_MKP_DEBOUNCE  30
> +#define  CONFIG_PXA27X_MKP_DELAY 3
> +
> +#define  CONFIG_PXA27X_MKP_MOD_SHIFT {5, 3}
> +#define  CONFIG_PXA27X_MKP_MOD_ALT   {5, 2}
> +#define  CONFIG_PXA27X_MKP_MOD_CTRL  {5, 4}
> +
> +#define  CONFIG_PXA27X_MKP_KEYMAP\
> + { 1, 1, 'q', 'Q', '1', 0xff },  \
> + { 2, 1, 'i', 'I', '8', 0xff },  \
> + { 3, 1, 'g', 'G', '\"', 0xff }, \
> + { 4, 1, 'x', 'X', '/', 0xff },  \
> + { 5, 1, '\r', 0xff, 0xff, 0xff },   \
> + { 6, 1, '-', 0xff, 0xff, 0xff },\
> + \
> + { 1, 2, 'w', 'W', '2', 0xff },  \
> + { 2, 2, 'o', 'O', '9', 0xff },  \
> + { 3, 2, 'h', 'H', '\'', 0xff }, \
> + { 4, 2, 'c', 'C', '+', 0xff },  \
> + \
> + { 1, 3, 'e', 'E', '3', 0xff },  \
> + { 2, 3, 'p', 'P', '0', 0xff },  \
> + { 3, 3, 'j', 'J', '[', 0xff },  \
> + { 4, 3, 'v', 'V', '*', 0xff },  \
> + \
> + { 0, 4, '\e', 0xff, '|', 0xff },\
> + { 1, 4, 'r', 'R', '4', 0xff },  \
> + { 2, 4, 'a', 'A', '$', 0xff },  \
> + { 3, 4, 'k', 'K', ']', 0xff },  \
> + { 4, 4, 'b', 'B', '=', 0xff },  \
> + \
> + { 0, 5, '\t', 0xff, 0xff, 0xff },   \
> + { 1, 5, 't', 'T', '5', 0xff },  \
> + { 2, 5, 's', 'S', '#', 0xff },  \
> + { 3, 5, 'l', 'L', '-', 0xff },  \
> + { 4, 5, 'n', 'N', '_', 0xff },  \
> + { 5, 5, ' ', 0xff, 0xff, 0xff },\
> + \
> + { 1, 6, 'y', 'Y', '6', 0xff },  \
> + { 2, 6, 'd', 'D', '&', 0xff },  \
> + { 3, 6, '\b', 0xff, '\\', 0xff },   \
> + { 4, 6, 'm', 'M', '?', 0xff },  \
> + { 5, 6, ',', '(', '<', '{' },   \
> + \
> + { 1, 7, 'u', 'U', '7', 0xff },  \
> + { 2, 7, 'f', 'F', '@', 0xff },  \
> + { 3, 7, 'z', 'Z', '!', 0xff },  \
> + { 4, 7, ';', '~', ':', 0xff },  \
> + { 5, 7, '.', ')', '>', '}' },   \
> + \
> + { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }
> +
> +#define  CONFIG_SYS_CONSOLE_ENV_OVERWRITE
> +#define  CONFIG_SYS_CONSOLE_IS_IN_ENV
> +
> +#endif
> +
> +/*
>   * GPIO settings
>   */
>  #define CONFIG_SYS_GAFR0_L_VAL   0x02000140
> -#define CONFIG_SYS_GAFR0_U_VAL   0x59188000
> -#define CONFIG_SYS_GAFR1_L_VAL   0x6392
> +#define CONFIG_SYS_GAFR0_U_VAL   0x59188005
> +#define CONFIG_SYS_GAFR1_L_VAL   0x639420a2
>  #define CONFIG_SYS_GAFR1_U_VAL   0xaaa03950
>  #define CONFIG_SYS_GAFR2_L_VAL   0x0aaa
>  #define CONFIG_SYS_GAFR2_U_VAL   0x29000308
> -#define CONFIG_SYS_GAFR3_L_VAL   0x5400
> +#define CONFIG_SYS_GAFR3_L_VAL   0x56aa9500
>  #define CONFIG_SYS_GAFR3_U_VAL   0x00d5
>  #define CONFIG_SYS_GPCR0_VAL 0x
>  #define CONFIG_SYS_GPCR1_VAL 0x0020
> @@ -222,7 +294,7 @@ unsigned char zipitz2_spi_read(void);
>  #define CONFIG_SYS_GPCR3_VAL 0x
>  #define CONFIG_SYS_GPDR0_VAL 0xdafcee00
>  #define CONFIG_SYS_GPDR1_VAL 0xffa3aaab
> -#define CONFIG_SYS_GPDR2_VAL 0x8fe9
> +#define CONFIG_SYS_GPDR2_VAL 0x8fe1
>  #define CONFIG_SYS_GPDR3_VAL 0x001b1f8a
>  #define CONFIG_SYS_GPSR0_VAL 0x06080400
>  #define CONFIG_SYS_GPSR1_VAL 0x007f
> @@ -234,7 +306,7 @@ unsigned char zipitz2_spi_read(void);
>  /*
>   * Clock settings
>   */
> -#define CONFIG_SYS_CKEN  0x00511220
> +#define CONFIG_SYS_CKEN  0x00591220
>  #define CONFIG_SYS_CCCR  0x0190
> 
>  /*
_

Re: [U-Boot] [PATCH v2 3/4] zipitz2: use pxa_mmc_gen as MMC driver

2012-01-11 Thread Marek Vasut
> Signed-off-by: Vasily Khoruzhick 
> ---
> v2: mmcinfo is necessary to scan card for partitions
> 
>  board/zipitz2/zipitz2.c   |8 
>  include/configs/zipitz2.h |5 +++--
>  2 files changed, 11 insertions(+), 2 deletions(-)
> 
> diff --git a/board/zipitz2/zipitz2.c b/board/zipitz2/zipitz2.c
> index b093c2f..4075fb6 100644
> --- a/board/zipitz2/zipitz2.c
> +++ b/board/zipitz2/zipitz2.c
> @@ -79,6 +79,14 @@ void dram_init_banksize(void)
>   gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
>  }
> 
> +#ifdef   CONFIG_CMD_MMC
> +int board_mmc_init(bd_t *bis)
> +{
> + pxa_mmc_register(0);
> + return 0;
> +}
> +#endif
> +
>  #ifdef   CONFIG_CMD_SPI
> 
>  struct {
> diff --git a/include/configs/zipitz2.h b/include/configs/zipitz2.h
> index 75de677..1b14cc7 100644
> --- a/include/configs/zipitz2.h
> +++ b/include/configs/zipitz2.h
> @@ -45,7 +45,7 @@
>  #define  CONFIG_ARCH_CPU_INIT
> 
>  #define  CONFIG_BOOTCOMMAND  
\
> - "if mmc init && fatload mmc 0 0xa000 uboot.script ; then "  \
> + "if mmcinfo && ext2load mmc 0 0xa000 boot/uboot.script ; then " 

mmcinfo? WHY?!

> \
>   "source 0xa000; "   \
>   "else " \
>   "bootm 0x6; "   \
> @@ -91,7 +91,8 @@
>   */
>  #ifdef   CONFIG_CMD_MMC
>  #define  CONFIG_MMC
> -#define  CONFIG_PXA_MMC
> +#define  CONFIG_GENERIC_MMC
> +#define  CONFIG_PXA_MMC_GENERIC
>  #define  CONFIG_SYS_MMC_BASE 0xF000
>  #define  CONFIG_CMD_FAT
>  #define CONFIG_CMD_EXT2
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 1/4] PXA: PXA27x Matrix keypad driver

2012-01-11 Thread Marek Vasut
> From: Marek Vasut 
> 
> Signed-off-by: Marek Vasut 
> Signed-off-by: Vasily Khoruzhick 
> [vasily: adapted Marek's old version for newer u-boot]
> ---
> v2: use struct-based access to regs, minor cleanup
> 
>  arch/arm/include/asm/arch-pxa/pxa-regs.h|   52 --
>  arch/arm/include/asm/arch-pxa/regs-keypad.h |   84 +
>  drivers/input/Makefile  |2 +
>  drivers/input/pxa27x-mkp.c  |  245
> +++ 4 files changed, 331 insertions(+), 52
> deletions(-)
>  create mode 100644 arch/arm/include/asm/arch-pxa/regs-keypad.h
>  create mode 100644 drivers/input/pxa27x-mkp.c
> 
> diff --git a/arch/arm/include/asm/arch-pxa/pxa-regs.h
> b/arch/arm/include/asm/arch-pxa/pxa-regs.h index b81b42c..d562658 100644
> --- a/arch/arm/include/asm/arch-pxa/pxa-regs.h
> +++ b/arch/arm/include/asm/arch-pxa/pxa-regs.h
> @@ -2567,58 +2567,6 @@ typedef void   (*ExcpHndlr) (void) ;
>  #define OVL2C1_O2EN  (1<<31) /* Enable bit for Overlay 2 */
>  #define CCR_CEN  (1<<31) /* Enable bit for Cursor */
> 
> -/* Keypad controller */
> -
> -#define KPC  0x4150 /* Keypad Interface Control register */
> -#define KPDK 0x4158 /* Keypad Interface Direct Key register */
> -#define KPREC0x41500010 /* Keypad Intefcace Rotary Encoder 
register */
> -#define KPMK 0x41500018 /* Keypad Intefcace Matrix Key register */
> -#define KPAS 0x41500020 /* Keypad Interface Automatic Scan register 
*/
> -#define KPASMKP0 0x41500028 /* Keypad Interface Automatic Scan Multiple
> Key Presser register 0 */ -#define KPASMKP1   0x41500030 /* Keypad Interface
> Automatic Scan Multiple Key Presser register 1 */ -#define
> KPASMKP2  0x41500038 /* Keypad Interface Automatic Scan Multiple Key
> Presser register 2 */ -#define KPASMKP3   0x41500040 /* Keypad Interface
> Automatic Scan Multiple Key Presser register 3 */ -#define
> KPKDI 0x41500048 /* Keypad Interface Key Debounce Interval register 
> */ 
-
> -#define KPC_AS   (0x1 << 30)  /* Automatic Scan bit */
> -#define KPC_ASACT(0x1 << 29)  /* Automatic Scan on Activity */
> -#define KPC_MI   (0x1 << 22)  /* Matrix interrupt bit */
> -#define KPC_IMKP (0x1 << 21)  /* Ignore Multiple Key Press */
> -#define KPC_MS7  (0x1 << 20)  /* Matrix scan line 7 */
> -#define KPC_MS6  (0x1 << 19)  /* Matrix scan line 6 */
> -#define KPC_MS5  (0x1 << 18)  /* Matrix scan line 5 */
> -#define KPC_MS4  (0x1 << 17)  /* Matrix scan line 4 */
> -#define KPC_MS3  (0x1 << 16)  /* Matrix scan line 3 */
> -#define KPC_MS2  (0x1 << 15)  /* Matrix scan line 2 */
> -#define KPC_MS1  (0x1 << 14)  /* Matrix scan line 1 */
> -#define KPC_MS0  (0x1 << 13)  /* Matrix scan line 0 */
> -#define KPC_ME   (0x1 << 12)  /* Matrix Keypad Enable */
> -#define KPC_MIE  (0x1 << 11)  /* Matrix Interrupt Enable */
> -#define KPC_DK_DEB_SEL   (0x1 <<  9)  /* Direct Key Debounce select */
> -#define KPC_DI   (0x1 <<  5)  /* Direct key interrupt bit */
> -#define KPC_DEE0 (0x1 <<  2)  /* Rotary Encoder 0 Enable */
> -#define KPC_DE   (0x1 <<  1)  /* Direct Keypad Enable */
> -#define KPC_DIE  (0x1 <<  0)  /* Direct Keypad interrupt Enable 
*/
> -
> -#define KPDK_DKP (0x1 << 31)
> -#define KPDK_DK7 (0x1 <<  7)
> -#define KPDK_DK6 (0x1 <<  6)
> -#define KPDK_DK5 (0x1 <<  5)
> -#define KPDK_DK4 (0x1 <<  4)
> -#define KPDK_DK3 (0x1 <<  3)
> -#define KPDK_DK2 (0x1 <<  2)
> -#define KPDK_DK1 (0x1 <<  1)
> -#define KPDK_DK0 (0x1 <<  0)
> -
> -#define KPREC_OF1(0x1 << 31)
> -#define kPREC_UF1(0x1 << 30)
> -#define KPREC_OF0(0x1 << 15)
> -#define KPREC_UF0(0x1 << 14)
> -
> -#define KPMK_MKP (0x1 << 31)
> -#define KPAS_SO  (0x1 << 31)
> -#define KPASMKPx_SO  (0x1 << 31)
> -
>  #define GPIO113_BIT  (1 << 17)/* GPIO113 in GPSR, GPCR, bit 17 */
>  #define PSLR 0x40F00034
>  #define PSTR 0x40F00038  /* Power Manager Standby Configuration Reg 
*/
> diff --git a/arch/arm/include/asm/arch-pxa/regs-keypad.h
> b/arch/arm/include/asm/arch-pxa/regs-keypad.h new file mode 100644
> index 000..f13da56
> --- /dev/null
> +++ b/arch/arm/include/asm/arch-pxa/regs-keypad.h
> @@ -0,0 +1,84 @@
> +/*
> + * Copyright (C) 2012 Vasily Khoruzhick 
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License as
> + * published by the Free Software Foundation; either version 2 of
> + * the License, or (at your option) any later version.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> + * GNU General Public

[U-Boot] [PATCH v2 4/4] zipitz2: fix boot issue introduced by PXA low level init rework

2012-01-11 Thread Vasily Khoruzhick
CONFIG_SYS_INIT_SP_ADDR points to RAM, but it's used before
DRAM controller init. Fix it by setting CONFIG_SYS_INIT_SP_ADDR
to SRAM

Signed-off-by: Vasily Khoruzhick 
---
v2: no changes

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

diff --git a/include/configs/zipitz2.h b/include/configs/zipitz2.h
index 1b14cc7..e7895ab 100644
--- a/include/configs/zipitz2.h
+++ b/include/configs/zipitz2.h
@@ -184,7 +184,7 @@ unsigned char zipitz2_spi_read(void);
 #defineCONFIG_SYS_LOAD_ADDRCONFIG_SYS_DRAM_BASE
 
 #define CONFIG_SYS_SDRAM_BASE  PHYS_SDRAM_1
-#defineCONFIG_SYS_INIT_SP_ADDR (GENERATED_GBL_DATA_SIZE + 
PHYS_SDRAM_1 + 2048)
+#defineCONFIG_SYS_INIT_SP_ADDR 0x5c038000
 
 /*
  * NOR FLASH
-- 
1.7.8.3

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


[U-Boot] [PATCH v2 3/4] zipitz2: use pxa_mmc_gen as MMC driver

2012-01-11 Thread Vasily Khoruzhick
Signed-off-by: Vasily Khoruzhick 
---
v2: mmcinfo is necessary to scan card for partitions

 board/zipitz2/zipitz2.c   |8 
 include/configs/zipitz2.h |5 +++--
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/board/zipitz2/zipitz2.c b/board/zipitz2/zipitz2.c
index b093c2f..4075fb6 100644
--- a/board/zipitz2/zipitz2.c
+++ b/board/zipitz2/zipitz2.c
@@ -79,6 +79,14 @@ void dram_init_banksize(void)
gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
 }
 
+#ifdef CONFIG_CMD_MMC
+int board_mmc_init(bd_t *bis)
+{
+   pxa_mmc_register(0);
+   return 0;
+}
+#endif
+
 #ifdef CONFIG_CMD_SPI
 
 struct {
diff --git a/include/configs/zipitz2.h b/include/configs/zipitz2.h
index 75de677..1b14cc7 100644
--- a/include/configs/zipitz2.h
+++ b/include/configs/zipitz2.h
@@ -45,7 +45,7 @@
 #defineCONFIG_ARCH_CPU_INIT
 
 #defineCONFIG_BOOTCOMMAND  
\
-   "if mmc init && fatload mmc 0 0xa000 uboot.script ; then "  \
+   "if mmcinfo && ext2load mmc 0 0xa000 boot/uboot.script ; then " 
\
"source 0xa000; "   \
"else " \
"bootm 0x6; "   \
@@ -91,7 +91,8 @@
  */
 #ifdef CONFIG_CMD_MMC
 #defineCONFIG_MMC
-#defineCONFIG_PXA_MMC
+#defineCONFIG_GENERIC_MMC
+#defineCONFIG_PXA_MMC_GENERIC
 #defineCONFIG_SYS_MMC_BASE 0xF000
 #defineCONFIG_CMD_FAT
 #define CONFIG_CMD_EXT2
-- 
1.7.8.3

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


[U-Boot] [PATCH v2 2/4] zipitz2: enable pxa27x_mkp driver

2012-01-11 Thread Vasily Khoruzhick
Signed-off-by: Vasily Khoruzhick 
---
v2: remove usbtty stuff from EXTRA_ENV_SETTINGS

 include/configs/zipitz2.h |   82 ++---
 1 files changed, 77 insertions(+), 5 deletions(-)

diff --git a/include/configs/zipitz2.h b/include/configs/zipitz2.h
index 26204af..75de677 100644
--- a/include/configs/zipitz2.h
+++ b/include/configs/zipitz2.h
@@ -80,6 +80,12 @@
 #defineCONFIG_CMD_MMC
 #defineCONFIG_CMD_SPI
 
+#defineCONFIG_EXTRA_ENV_SETTINGS   
\
+   "stdout=lcd\0"  \
+   "stdin=pxa27x-mkp\0"\
+   "stderr=lcd\0"  \
+   ""
+#defineCONFIG_KEYBOARD
 /*
  * MMC Card Configuration
  */
@@ -206,15 +212,81 @@ unsigned char zipitz2_spi_read(void);
 #define CONFIG_SYS_FLASH_PROTECTION
 
 /*
+ * Matrix keypad
+ */
+#ifdef CONFIG_KEYBOARD
+#defineCONFIG_PXA27X_MKP
+
+#defineCONFIG_PXA27X_MKP_MKP_COLS  7
+#defineCONFIG_PXA27X_MKP_MKP_ROWS  6
+
+#defineCONFIG_PXA27X_MKP_DEBOUNCE  30
+#defineCONFIG_PXA27X_MKP_DELAY 3
+
+#defineCONFIG_PXA27X_MKP_MOD_SHIFT {5, 3}
+#defineCONFIG_PXA27X_MKP_MOD_ALT   {5, 2}
+#defineCONFIG_PXA27X_MKP_MOD_CTRL  {5, 4}
+
+#defineCONFIG_PXA27X_MKP_KEYMAP\
+   { 1, 1, 'q', 'Q', '1', 0xff },  \
+   { 2, 1, 'i', 'I', '8', 0xff },  \
+   { 3, 1, 'g', 'G', '\"', 0xff }, \
+   { 4, 1, 'x', 'X', '/', 0xff },  \
+   { 5, 1, '\r', 0xff, 0xff, 0xff },   \
+   { 6, 1, '-', 0xff, 0xff, 0xff },\
+   \
+   { 1, 2, 'w', 'W', '2', 0xff },  \
+   { 2, 2, 'o', 'O', '9', 0xff },  \
+   { 3, 2, 'h', 'H', '\'', 0xff }, \
+   { 4, 2, 'c', 'C', '+', 0xff },  \
+   \
+   { 1, 3, 'e', 'E', '3', 0xff },  \
+   { 2, 3, 'p', 'P', '0', 0xff },  \
+   { 3, 3, 'j', 'J', '[', 0xff },  \
+   { 4, 3, 'v', 'V', '*', 0xff },  \
+   \
+   { 0, 4, '\e', 0xff, '|', 0xff },\
+   { 1, 4, 'r', 'R', '4', 0xff },  \
+   { 2, 4, 'a', 'A', '$', 0xff },  \
+   { 3, 4, 'k', 'K', ']', 0xff },  \
+   { 4, 4, 'b', 'B', '=', 0xff },  \
+   \
+   { 0, 5, '\t', 0xff, 0xff, 0xff },   \
+   { 1, 5, 't', 'T', '5', 0xff },  \
+   { 2, 5, 's', 'S', '#', 0xff },  \
+   { 3, 5, 'l', 'L', '-', 0xff },  \
+   { 4, 5, 'n', 'N', '_', 0xff },  \
+   { 5, 5, ' ', 0xff, 0xff, 0xff },\
+   \
+   { 1, 6, 'y', 'Y', '6', 0xff },  \
+   { 2, 6, 'd', 'D', '&', 0xff },  \
+   { 3, 6, '\b', 0xff, '\\', 0xff },   \
+   { 4, 6, 'm', 'M', '?', 0xff },  \
+   { 5, 6, ',', '(', '<', '{' },   \
+   \
+   { 1, 7, 'u', 'U', '7', 0xff },  \
+   { 2, 7, 'f', 'F', '@', 0xff },  \
+   { 3, 7, 'z', 'Z', '!', 0xff },  \
+   { 4, 7, ';', '~', ':', 0xff },  \
+   { 5, 7, '.', ')', '>', '}' },   \
+   \
+   { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }
+
+#defineCONFIG_SYS_CONSOLE_ENV_OVERWRITE
+#defineCONFIG_SYS_CONSOLE_IS_IN_ENV
+
+#endif
+
+/*
  * GPIO settings
  */
 #define CONFIG_SYS_GAFR0_L_VAL 0x02000140
-#define CONFIG_SYS_GAFR0_U_VAL 0x59188000
-#define CONFIG_SYS_GAFR1_L_VAL 0x6392
+#define CONFIG_SYS_GAFR0_U_VAL 0x59188005
+#define CONFIG_SYS_GAFR1_L_VAL 0x639420a2
 #define CONFIG_SYS_GAFR1_U_VAL 0xaaa03950
 #define CONFIG_SYS_GAFR2_L_VAL 0x0aaa
 #define CONFIG_SYS_GAFR2_U_VAL 0x29000308
-#define CONFIG_SYS_GAFR3_L_VAL 0x5400
+#define CONFIG_SYS_GAFR3_L_VAL 0x56aa9500
 #define CONFIG_SYS_GAFR3_U_VAL 0x00d5
 #define CONFIG_SYS_GPCR0_VAL   0x
 #define CONFIG_SYS_GPCR1_VAL   0x0020
@@ -222,7 +294,7 @@ unsigned char zipitz2_spi_read(void);
 #define CONFIG_SYS_GPCR3_VAL   0x
 #define CONFIG_SYS_GPDR0_VAL   0xdafcee00
 #define CONFIG_SYS_GPDR1_VAL   0xffa3aaab
-#define CONFIG_SYS_GPDR2_VAL   0x8fe9
+#define CONFIG_SYS_GPDR2_VAL   0x8fe1
 #define CONFIG_SYS_GPDR3_VAL   0x001b1f8a
 #define CONFIG_SYS_GPSR0_VAL   0x06080400
 #define CONFIG_SYS_GPSR1_VAL   0x007f
@@ -234,7 +306,7 @@ unsigned char zipitz2_spi_read(void);
 /*
  * Clock settings
  */
-#define CONFIG_SYS_CKEN0x00511220
+#define CONFIG_SYS_CKEN0x00591220
 #define CONFIG_SYS_CCCR0x0190
 
 /*
-- 
1.7.8.3

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


[U-Boot] [PATCH v2 1/4] PXA: PXA27x Matrix keypad driver

2012-01-11 Thread Vasily Khoruzhick
From: Marek Vasut 

Signed-off-by: Marek Vasut 
Signed-off-by: Vasily Khoruzhick 
[vasily: adapted Marek's old version for newer u-boot]
---
v2: use struct-based access to regs, minor cleanup

 arch/arm/include/asm/arch-pxa/pxa-regs.h|   52 --
 arch/arm/include/asm/arch-pxa/regs-keypad.h |   84 +
 drivers/input/Makefile  |2 +
 drivers/input/pxa27x-mkp.c  |  245 +++
 4 files changed, 331 insertions(+), 52 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-pxa/regs-keypad.h
 create mode 100644 drivers/input/pxa27x-mkp.c

diff --git a/arch/arm/include/asm/arch-pxa/pxa-regs.h 
b/arch/arm/include/asm/arch-pxa/pxa-regs.h
index b81b42c..d562658 100644
--- a/arch/arm/include/asm/arch-pxa/pxa-regs.h
+++ b/arch/arm/include/asm/arch-pxa/pxa-regs.h
@@ -2567,58 +2567,6 @@ typedef void (*ExcpHndlr) (void) ;
 #define OVL2C1_O2EN(1<<31) /* Enable bit for Overlay 2 */
 #define CCR_CEN(1<<31) /* Enable bit for Cursor */
 
-/* Keypad controller */
-
-#define KPC0x4150 /* Keypad Interface Control register */
-#define KPDK   0x4158 /* Keypad Interface Direct Key register */
-#define KPREC  0x41500010 /* Keypad Intefcace Rotary Encoder register 
*/
-#define KPMK   0x41500018 /* Keypad Intefcace Matrix Key register */
-#define KPAS   0x41500020 /* Keypad Interface Automatic Scan register 
*/
-#define KPASMKP0   0x41500028 /* Keypad Interface Automatic Scan Multiple 
Key Presser register 0 */
-#define KPASMKP1   0x41500030 /* Keypad Interface Automatic Scan Multiple 
Key Presser register 1 */
-#define KPASMKP2   0x41500038 /* Keypad Interface Automatic Scan Multiple 
Key Presser register 2 */
-#define KPASMKP3   0x41500040 /* Keypad Interface Automatic Scan Multiple 
Key Presser register 3 */
-#define KPKDI  0x41500048 /* Keypad Interface Key Debounce Interval 
register */
-
-#define KPC_AS (0x1 << 30)  /* Automatic Scan bit */
-#define KPC_ASACT  (0x1 << 29)  /* Automatic Scan on Activity */
-#define KPC_MI (0x1 << 22)  /* Matrix interrupt bit */
-#define KPC_IMKP   (0x1 << 21)  /* Ignore Multiple Key Press */
-#define KPC_MS7(0x1 << 20)  /* Matrix scan line 7 */
-#define KPC_MS6(0x1 << 19)  /* Matrix scan line 6 */
-#define KPC_MS5(0x1 << 18)  /* Matrix scan line 5 */
-#define KPC_MS4(0x1 << 17)  /* Matrix scan line 4 */
-#define KPC_MS3(0x1 << 16)  /* Matrix scan line 3 */
-#define KPC_MS2(0x1 << 15)  /* Matrix scan line 2 */
-#define KPC_MS1(0x1 << 14)  /* Matrix scan line 1 */
-#define KPC_MS0(0x1 << 13)  /* Matrix scan line 0 */
-#define KPC_ME (0x1 << 12)  /* Matrix Keypad Enable */
-#define KPC_MIE(0x1 << 11)  /* Matrix Interrupt Enable */
-#define KPC_DK_DEB_SEL (0x1 <<  9)  /* Direct Key Debounce select */
-#define KPC_DI (0x1 <<  5)  /* Direct key interrupt bit */
-#define KPC_DEE0   (0x1 <<  2)  /* Rotary Encoder 0 Enable */
-#define KPC_DE (0x1 <<  1)  /* Direct Keypad Enable */
-#define KPC_DIE(0x1 <<  0)  /* Direct Keypad interrupt Enable 
*/
-
-#define KPDK_DKP   (0x1 << 31)
-#define KPDK_DK7   (0x1 <<  7)
-#define KPDK_DK6   (0x1 <<  6)
-#define KPDK_DK5   (0x1 <<  5)
-#define KPDK_DK4   (0x1 <<  4)
-#define KPDK_DK3   (0x1 <<  3)
-#define KPDK_DK2   (0x1 <<  2)
-#define KPDK_DK1   (0x1 <<  1)
-#define KPDK_DK0   (0x1 <<  0)
-
-#define KPREC_OF1  (0x1 << 31)
-#define kPREC_UF1  (0x1 << 30)
-#define KPREC_OF0  (0x1 << 15)
-#define KPREC_UF0  (0x1 << 14)
-
-#define KPMK_MKP   (0x1 << 31)
-#define KPAS_SO(0x1 << 31)
-#define KPASMKPx_SO(0x1 << 31)
-
 #define GPIO113_BIT(1 << 17)/* GPIO113 in GPSR, GPCR, bit 17 */
 #define PSLR   0x40F00034
 #define PSTR   0x40F00038  /* Power Manager Standby Configuration Reg 
*/
diff --git a/arch/arm/include/asm/arch-pxa/regs-keypad.h 
b/arch/arm/include/asm/arch-pxa/regs-keypad.h
new file mode 100644
index 000..f13da56
--- /dev/null
+++ b/arch/arm/include/asm/arch-pxa/regs-keypad.h
@@ -0,0 +1,84 @@
+/*
+ * Copyright (C) 2012 Vasily Khoruzhick 
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to th

Re: [U-Boot] [PATCH v2 4/4] zipitz2: fix boot issue introduced by PXA low level init rework

2012-01-11 Thread Marek Vasut
> CONFIG_SYS_INIT_SP_ADDR points to RAM, but it's used before
> DRAM controller init. Fix it by setting CONFIG_SYS_INIT_SP_ADDR
> to SRAM
> 
> Signed-off-by: Vasily Khoruzhick 
> ---
> v2: no changes
> 
>  include/configs/zipitz2.h |2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/include/configs/zipitz2.h b/include/configs/zipitz2.h
> index 1b14cc7..e7895ab 100644
> --- a/include/configs/zipitz2.h
> +++ b/include/configs/zipitz2.h
> @@ -184,7 +184,7 @@ unsigned char zipitz2_spi_read(void);
>  #define  CONFIG_SYS_LOAD_ADDRCONFIG_SYS_DRAM_BASE
> 
>  #define CONFIG_SYS_SDRAM_BASEPHYS_SDRAM_1
> -#define  CONFIG_SYS_INIT_SP_ADDR (GENERATED_GBL_DATA_SIZE + 
PHYS_SDRAM_1 +
> 2048) +#defineCONFIG_SYS_INIT_SP_ADDR 0x5c038000

Why do you keep setting the arbitrary location here? Just use 
GENERATED_GBL_DATA_SIZE + PHYS_SRAM + 2048) or something. ... define PHYS_SRAM 
if needed.

M
> 
>  /*
>   * NOR FLASH
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 3/3 v3] devkit3250: add Timll DevKit3250 board initial support

2012-01-11 Thread Marek Vasut
> On 11.01.2012 22:56, Marek Vasut wrote:
> >> This change adds a basic support for Embest/Timll DevKit3250 board,
> >> NOR and UART are the only supported peripherals for a moment. The board
> >> doesn't require low-level init, because the initial SDRAM and GPIO
> >> configuration is performed during kickstart bootloader execution.
> >> 
> >> Signed-off-by: Vladimir Zapolskiy
> >> ---
> >> Changes from v2 to v3:
> >> * updated a relocation address
> >> * combined a record in maintainers file into the patch
> >> * use high speed UART2 by default
> >> 
> >> Changes from v1 to v2:
> >> * corrected address in GPLv2+ licence header in files
> >> * removed clean and distclean targets from board makefile
> >> * do not set machine id explicitly, if CONFIG_MACH_TYPE is defined
> >> * minor indentation cleanups
> >> 
> >>   MAINTAINERS |4 +
> >>   board/timll/devkit3250/Makefile |   44 +
> >>   board/timll/devkit3250/devkit3250.c |   71 
> >>   boards.cfg  |1 +
> >>   include/configs/devkit3250.h|  121
> >> 
> >> +++ 5 files changed, 241 insertions(+),
> >> 0 deletions(-)
> >> 
> >>   create mode 100644 board/timll/devkit3250/Makefile
> >>   create mode 100644 board/timll/devkit3250/devkit3250.c
> >>   create mode 100644 include/configs/devkit3250.h
> >> 
> >> diff --git a/MAINTAINERS b/MAINTAINERS
> >> index 4bf12b5..68dedae 100644
> >> --- a/MAINTAINERS
> >> +++ b/MAINTAINERS
> >> @@ -914,6 +914,10 @@ Sughosh Ganu
> >> 
> >>hawkboard   ARM926EJS (OMAP-L138)
> >> 
> >> +Vladimir Zapolskiy
> >> +
> >> +  devkit3250  lpc32xx
> >> +
> >> 
> >>   --
> >>   ---
> >> 
> >>   Unknown / orphaned boards:
> >> diff --git a/board/timll/devkit3250/Makefile
> >> b/board/timll/devkit3250/Makefile new file mode 100644
> >> index 000..ea7827c
> >> --- /dev/null
> >> +++ b/board/timll/devkit3250/Makefile
> >> @@ -0,0 +1,44 @@
> >> +#
> >> +# Copyright (C) 2011 by Vladimir Zapolskiy
> >> +# Copyright (C) 2008, Guennadi Liakhovetski
> >> +#
> >> +# See file CREDITS for list of people who contributed to this
> >> +# project.
> >> +#
> >> +# This program is free software; you can redistribute it and/or
> >> +# modify it under the terms of the GNU General Public License as
> >> +# published by the Free Software Foundation; either version 2 of
> >> +# the License, or (at your option) any later version.
> >> +#
> >> +# This program is distributed in the hope that it will be useful,
> >> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
> >> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> >> +# GNU General Public License for more details.
> >> +#
> >> +# You should have received a copy of the GNU General Public License
> >> +# along with this program; if not, write to the Free Software
> >> +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
> >> +# MA  02110-1301, USA.
> >> +#
> >> +
> >> +include $(TOPDIR)/config.mk
> >> +
> >> +LIB   = $(obj)lib$(BOARD).o
> >> +
> >> +COBJS := devkit3250.o
> >> +
> >> +SRCS  := $(SOBJS:.o=.S) $(COBJS:.o=.c)
> >> +OBJS  := $(addprefix $(obj),$(COBJS))
> >> +SOBJS := $(addprefix $(obj),$(SOBJS))
> >> +
> >> +$(LIB):   $(obj).depend $(OBJS) $(SOBJS)
> >> +  $(call cmd_link_o_target, $(OBJS) $(SOBJS))
> >> +
> >> +###
> >> ## +
> >> +# defines $(obj).depend target
> >> +include $(SRCTREE)/rules.mk
> >> +
> >> +sinclude $(obj).depend
> >> +
> >> +###
> >> ## diff --git a/board/timll/devkit3250/devkit3250.c
> >> b/board/timll/devkit3250/devkit3250.c new file mode 100644
> >> index 000..461012d
> >> --- /dev/null
> >> +++ b/board/timll/devkit3250/devkit3250.c
> >> @@ -0,0 +1,71 @@
> >> +/*
> >> + * Embest/Timll DevKit3250 board support
> >> + *
> >> + * Copyright (C) 2011 Vladimir Zapolskiy
> >> + *
> >> + * This program is free software; you can redistribute it and/or
> >> + * modify it under the terms of the GNU General Public License as
> >> + * published by the Free Software Foundation; either version 2 of
> >> + * the License, or (at your option) any later version.
> >> + *
> >> + * This program is distributed in the hope that it will be useful,
> >> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> >> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> >> + * GNU General Public License for more details.
> >> + *
> >> + * You should have received a copy of the GNU General Public License
> >> + * along with this program; if not, write to the Free Software
> >> + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
> >> + * MA 02110-1301, USA.
> >> + */
> >> +
> >> +#include
> >> +#include
> >> +#include
> >> +#include
> >> +
> >> +DECLARE_GLOBAL_DATA

[U-Boot] bootm not taking dtb

2012-01-11 Thread JR Rivers

I am working with a powerpc embedded system where u-boot seems to be passing in 
a constructed fdt (or one embedded in u-boot) as opposed to one that is either 
passed directly to bootm or as the third image of a multi-file image.

I'm sure sure that the system is NOT using my dtb file because I modified the 
my linux platform file to print out the "model" and "compatible" properties of 
root, and they make sense, but are not the values that I pass in with my dtb.

I've tried "bootm ${kerneladdr} - ${dtbaddr}" for nfs boot, and I've 
constructed a multi-file uImage with kernel:initramfs:dtb.  The behavior is the 
same in all cases.  Is this expected behavior, and if so, is there some way to 
force u-boot to use my dtb file?

Thanks,

JR






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


  1   2   >