[U-Boot] [PATCH] OMAP3: TAM3517: update ehci interface

2012-02-04 Thread Stefano Babic
Changed the EHCI interface using the ulpi framework.

Signed-off-by: Stefano Babic sba...@denx.de
CC: Tom Rini tom.r...@gmail.com
---

This patch is based and tested on top of  Govindraj's patches for EHCI omap:
http://patchwork.ozlabs.org/patch/139377/

 board/technexion/twister/twister.c |   32 
 include/configs/tam3517-common.h   |2 ++
 2 files changed, 34 insertions(+), 0 deletions(-)

diff --git a/board/technexion/twister/twister.c 
b/board/technexion/twister/twister.c
index 4d34d24..831fb4c 100644
--- a/board/technexion/twister/twister.c
+++ b/board/technexion/twister/twister.c
@@ -33,6 +33,10 @@
 #include asm/arch/mmc_host_def.h
 #include i2c.h
 #include asm/gpio.h
+#ifdef CONFIG_USB_EHCI
+#include usb.h
+#include asm/ehci-omap.h
+#endif
 #include twister.h
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -56,6 +60,34 @@ static const u32 gpmc_XR16L2751[] = {
XR16L2751_GPMC_CONFIG6,
 };
 
+#ifdef CONFIG_USB_EHCI
+
+static struct omap_usbhs_board_data usbhs_bdata = {
+   .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
+   .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
+   .port_mode[2] = OMAP_EHCI_PORT_MODE_PHY,
+};
+
+int ehci_hcd_init(void)
+{
+   int ret;
+
+   ret = omap_ehci_hcd_init(usbhs_bdata);
+   if (ret  0)
+   return ret;
+
+   return 0;
+}
+
+int ehci_hcd_stop(void)
+{
+   int ret;
+
+   ret = omap_ehci_hcd_stop();
+   return ret;
+}
+#endif
+
 int board_init(void)
 {
gpmc_init(); /* in SRAM or SDRAM, finish GPMC */
diff --git a/include/configs/tam3517-common.h b/include/configs/tam3517-common.h
index 817d468..13eeadb 100644
--- a/include/configs/tam3517-common.h
+++ b/include/configs/tam3517-common.h
@@ -100,6 +100,8 @@
 #define CONFIG_OMAP3_GPIO_5
 #define CONFIG_USB_EHCI
 #define CONFIG_USB_EHCI_OMAP
+#define CONFIG_USB_ULPI
+#define CONFIG_USB_ULPI_VIEWPORT_OMAP
 #define CONFIG_OMAP_EHCI_PHY1_RESET_GPIO   25
 #define CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS 3
 #define CONFIG_USB_STORAGE
-- 
1.7.5.4

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


[U-Boot] [PATCH V4] ARM: omap3: Added Teejet mt_ventoux

2012-02-04 Thread Stefano Babic
The mt_ventoux board is a custom board using
the Technexion TAM3517 module.

The patch fixes also the mtdparts variable in the
TAM3517 common configuration file.

Signed-off-by: Stefano Babic sba...@denx.de
CC: Ilya Yanok ya...@emcraft.com
CC: Igor Grinberg grinb...@compulab.co.il
CC: Tom Rini tom.r...@gmail.com
Cc: Detlev Zundel d...@denx.de
---
Changes since V3:
- rebased on current u-boot-ti
- rebased on EHCI patches and add EHCI support
- fix mtdparts default value in common file

Changes since V2:
- CONFIG_OMAP_HSMMC requires CONFIG_GENERIC_MMC, do not check both (T. Rini)

Changes since V1:

- CONFIG_FPGA must be enabled (S. Babic)
- reworking fpga functions (Igor Grinberg)
- drop clean / distclean from Makefile (Igor Grinberg)
- TAB / Spaces issue (Igor Grinberg)

 MAINTAINERS  |1 +
 board/teejet/mt_ventoux/Makefile |   38 +++
 board/teejet/mt_ventoux/mt_ventoux.c |  242 +++
 board/teejet/mt_ventoux/mt_ventoux.h |  429 ++
 boards.cfg   |1 +
 include/configs/mt_ventoux.h |   58 +
 include/configs/tam3517-common.h |4 +-
 7 files changed, 771 insertions(+), 2 deletions(-)
 create mode 100644 board/teejet/mt_ventoux/Makefile
 create mode 100644 board/teejet/mt_ventoux/mt_ventoux.c
 create mode 100644 board/teejet/mt_ventoux/mt_ventoux.h
 create mode 100644 include/configs/mt_ventoux.h

diff --git a/MAINTAINERS b/MAINTAINERS
index 0a3b39d..a8e56bb 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -574,6 +574,7 @@ Stefano Babic sba...@denx.de
 
ea20davinci
flea3   i.MX35
+   mt_ventoux  omap3
mx35pdk i.MX35
mx51evk i.MX51
polaris xscale/pxa
diff --git a/board/teejet/mt_ventoux/Makefile b/board/teejet/mt_ventoux/Makefile
new file mode 100644
index 000..4c8db10
--- /dev/null
+++ b/board/teejet/mt_ventoux/Makefile
@@ -0,0 +1,38 @@
+#
+# Copyright (C) 2011 Ilya Yanok, Emcraft Systems
+#
+# Based on ti/evm/Makefile
+#
+# 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.
+#
+
+include $(TOPDIR)/config.mk
+
+LIB= $(obj)lib$(BOARD).o
+
+COBJS  := $(BOARD).o
+
+SRCS   := $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+
+$(LIB):$(obj).depend $(OBJS)
+   $(call cmd_link_o_target, $(OBJS))
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
diff --git a/board/teejet/mt_ventoux/mt_ventoux.c 
b/board/teejet/mt_ventoux/mt_ventoux.c
new file mode 100644
index 000..d3b5f06
--- /dev/null
+++ b/board/teejet/mt_ventoux/mt_ventoux.c
@@ -0,0 +1,242 @@
+/*
+ * Copyright (C) 2011
+ * Stefano Babic, DENX Software Engineering, sba...@denx.de.
+ *
+ * Copyright (C) 2009 TechNexion Ltd.
+ *
+ * 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.
+ */
+
+#include common.h
+#include netdev.h
+#include fpga.h
+#include asm/io.h
+#include asm/arch/mem.h
+#include asm/arch/mux.h
+#include asm/arch/sys_proto.h
+#include asm/omap_gpio.h
+#include asm/arch/mmc_host_def.h
+#include i2c.h
+#include spartan3.h
+#include asm/gpio.h
+#ifdef CONFIG_USB_EHCI
+#include usb.h
+#include asm/ehci-omap.h
+#endif
+#include mt_ventoux.h
+
+DECLARE_GLOBAL_DATA_PTR;
+
+#ifndef CONFIG_FPGA
+#error The Teejet mt_ventoux must have CONFIG_FPGA enabled
+#endif
+
+#define FPGA_RESET 62
+#define FPGA_PROG  116
+#define FPGA_CCLK  117
+#define FPGA_DIN   118
+#define FPGA_INIT  119
+#define FPGA_DONE  154
+
+/* Timing definitions for FPGA */
+static const u32 gpmc_fpga[] = {
+   FPGA_GPMC_CONFIG1,
+   FPGA_GPMC_CONFIG2,
+   FPGA_GPMC_CONFIG3,
+   FPGA_GPMC_CONFIG4,
+   

[U-Boot] i.MX5/6 U-Boot: Cache enabling (was: Re: Skipping relocation RAM to RAM, esp. on i.MX6?)

2012-02-04 Thread Dirk Behme


Let's discuss how to enable the i.MX5/6 caches in U-Boot:

On 03.02.2012 12:00, Stefano Babic wrote:

On 03/02/2012 11:18, Dirk Behme wrote:

...

As your concerns are surely related to speed up the boot process, IMHO
we can focus efforts to add cache support for MX5 / MX6.


Ok, sounds good. Any idea what has to be done for this? Or what would be
the steps for this?


As armv7 architecture, the MX can profit of the work already done for
other SOCs. Functions for enabling / disabling / invalidate caches are
already provided, in arch/arm/lib and arch/arm/cpu/armv7/cache_v7.c. So
at least for MX5/MX6.

But we should change MXC drivers to be cache-aware. At least the FEC
driver and MMC driver are known to not work when dcache is on.


Marek, Troy, Fabio: What do you think is needed to make the i.MX5/6 
FEC driver cache-aware?


Jason, Stefano: And what do you think would be needed for the MMC driver?

Best regards

Dirk




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


Re: [U-Boot] Skipping relocation RAM to RAM, esp. on i.MX6?

2012-02-04 Thread Aneesh V

Hi Dirk,

On Friday 03 February 2012 12:55 PM, Dirk Behme wrote:

Hi,

on i.MX6 devices, e.g. ARM2 or SabreLite, the ROM boot loader copies the
U-Boot image from the boot device, e.g. the SD card, to the main memory.
This does mean that U-Boot is started in RAM.

With this, one might wonder why any relocation RAM - RAM is done anyway
and if this could be skipped?

Looking into the details shows that board_init_f() in
arch/arm/lib/board.c and relocate_code() in arch/arm/cpu/armv7/start.S
[1] are involved in this.

In board_init_f() the relocation destination address 'addr' is
calculated. This is basically at the end of the available RAM (- some
space for various stuff like TLB tables etc.). At SabreLite this results
in 0x4FF8D000.

By the boot loader, the U-Boot is loaded to

CONFIG_SYS_TEXT_BASE 0x1780

This results in relocate_code() copying U-Boot from RAM 0x1780 to
RAM 0x4FF8D000.

Setting CONFIG_SYS_TEXT_BASE to the relocation destination address
0x4FF8D000 does avoid the (unnecessary?) copy by

cmp r0, r6
moveq r9, #0 /* no relocation. relocation offset(r9) = 0 */
beq clear_bss /* skip relocation */

in relocate_code().

But:

1) The resulting image still runs without the relocation
(CONFIG_SYS_TEXT_BASE 0x4FF8D000). But e.g. the U-Boot command line
doesn't work properly any more. Most probably this is because not only
the copy is skipped by the 'beq clear_bss', but the whole 'fix .rel.dyn
relocations' is skipped too.

2) It's hard to set CONFIG_SYS_TEXT_BASE at compile time to the
relocation address calculated at runtime in board_init_f() due to the
amount of #ifdef and runtime calculation done there. So finding a
generic approach which could easily defined in the config files to avoid
the relocation seems difficult.


I haven't really completely read your mail. But here is an
implementation I had provided long time back for ARM. But Wolfgang
didn't want to take it. You can see the patch and the following
discussion in this thread:

http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/96352

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


Re: [U-Boot] i.MX5/6 U-Boot: Cache enabling (was: Re: Skipping relocation RAM to RAM, esp. on i.MX6?)

2012-02-04 Thread Marek Vasut
 Let's discuss how to enable the i.MX5/6 caches in U-Boot:
 
 On 03.02.2012 12:00, Stefano Babic wrote:
  On 03/02/2012 11:18, Dirk Behme wrote:
 ...
 
  As your concerns are surely related to speed up the boot process, IMHO
  we can focus efforts to add cache support for MX5 / MX6.
  
  Ok, sounds good. Any idea what has to be done for this? Or what would be
  the steps for this?
  
  As armv7 architecture, the MX can profit of the work already done for
  other SOCs. Functions for enabling / disabling / invalidate caches are
  already provided, in arch/arm/lib and arch/arm/cpu/armv7/cache_v7.c. So
  at least for MX5/MX6.
  
  But we should change MXC drivers to be cache-aware. At least the FEC
  driver and MMC driver are known to not work when dcache is on.
 
 Marek, Troy, Fabio: What do you think is needed to make the i.MX5/6
 FEC driver cache-aware?

I already have a partly finished implementation of FEC ethernet with cache 
support somewhere on my drive.

M
 
 Jason, Stefano: And what do you think would be needed for the MMC driver?
 
 Best regards
 
 Dirk
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] SPL Linux Boot V13

2012-02-04 Thread Stefano Babic
Rebased patchset to add Linux booting from SPL. As discussed
in the ML, this patchset does not make SPL common to all SOCs
to avoid breaking some architecture - this job will be done later
with a different patchset.

For this reason, a couple of patches moving files in the common/ 
directory are dropped - the other patches are not changed 
from V12.
(exception due only to rebase on current u-boot-ti)

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


[U-Boot] [PATCH V13 01/12] Add cmd_spl command

2012-02-04 Thread Stefano Babic
From: Simon Schwarz simonschwarz...@googlemail.com

This adds a spl command to the u-boot.

Related config:
CONFIG_CMD_CPL
activate/deactivate the command
CONFIG_CMD_SPL_NAND_OFS
Offset in NAND to use

Signed-off-by: Simon Schwarz simonschwarz...@gmail.com
CC: Tom Rini tom.r...@gmail.com
CC: Stefano Babic sba...@denx.de
CC: Wolfgang Denk w...@denx.de
---
 common/Makefile |1 +
 common/cmd_spl.c|  229 +++
 doc/README.commands.spl |   31 +++
 include/cmd_spl.h   |   30 ++
 include/image.h |2 +
 5 files changed, 293 insertions(+), 0 deletions(-)
 create mode 100644 common/cmd_spl.c
 create mode 100644 doc/README.commands.spl
 create mode 100644 include/cmd_spl.h

diff --git a/common/Makefile b/common/Makefile
index 2d9ae8c..910c056 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -162,6 +162,7 @@ COBJS-$(CONFIG_USB_STORAGE) += usb_storage.o
 endif
 COBJS-$(CONFIG_CMD_XIMG) += cmd_ximg.o
 COBJS-$(CONFIG_YAFFS2) += cmd_yaffs2.o
+COBJS-$(CONFIG_CMD_SPL) += cmd_spl.o
 
 # others
 ifdef CONFIG_DDR_SPD
diff --git a/common/cmd_spl.c b/common/cmd_spl.c
new file mode 100644
index 000..deab8e9
--- /dev/null
+++ b/common/cmd_spl.c
@@ -0,0 +1,229 @@
+/*
+ * Copyright (C) 2011
+ * Corscience GmbH  Co. KG - Simon Schwarz schw...@corscience.de
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include common.h
+#include command.h
+#include cmd_spl.h
+
+DECLARE_GLOBAL_DATA_PTR;
+
+/* Calls bootm with the parameters given */
+static int call_bootm(int argc, char * const argv[], char *subcommand[])
+{
+   char *bootm_argv[5];
+   char command[] = do_bootm;
+
+   int i = 0;
+   int ret = 0;
+
+   /* create paramter array */
+   bootm_argv[0] = command;
+   switch (argc) {
+   case 3:
+   bootm_argv[4] = argv[2]; /* fdt addr */
+   case 2:
+   bootm_argv[3] = argv[1]; /* initrd addr */
+   case 1:
+   bootm_argv[2] = argv[0]; /* kernel addr */
+   }
+
+
+   /*
+* - do the work -
+* exec subcommands of do_bootm to init the images
+* data structure
+*/
+   while (subcommand[i] != NULL) {
+   bootm_argv[1] = subcommand[i];
+   debug(args: %s, %s, %s, %s, %s, %d\n, bootm_argv[0],
+   bootm_argv[1], bootm_argv[2], bootm_argv[3],
+   bootm_argv[4], argc);
+   ret = do_bootm(find_cmd(do_bootm), 0, argc+2,
+   bootm_argv);
+   debug(Subcommand retcode: %d\n, ret);
+   i++;
+   }
+
+   if (ret) {
+   printf(ERROR prep subcommand failed!\n);
+   return -1;
+   }
+
+   return 0;
+}
+
+/* assemble the bootm paramteres for fdt creation */
+static int spl_export_fdt(int argc, char * const argv[])
+{
+#ifdef CONFIG_OF_LIBFDT
+   /* Create subcommand string */
+   char *subcommand[] = {
+   start,
+   loados,
+#ifdef CONFIG_SYS_BOOT_RAMDISK_HIGH
+   ramdisk,
+#endif
+   fdt,
+   cmdline,
+   bdt,
+   prep,
+   NULL};
+
+   /* inspect paramters and execute bootm */
+   argc--;
+   argv++;
+   if (call_bootm(argc, argv, subcommand))
+   return -1;
+
+   printf(Argument image is now in RAM: 0x%p\n,
+   (void *)images.ft_addr);
+   return 0;
+#else
+   printf(Das U-Boot was build without fdt support - aborting\n);
+   return -1;
+#endif
+}
+
+/* assemble the bootm patameters for atags creation */
+static int spl_export_atags(int argc, char * const argv[])
+{
+#if defined(CONFIG_SETUP_MEMORY_TAGS) || \
+   defined(CONFIG_CMDLINE_TAG) || \
+   defined(CONFIG_INITRD_TAG) || \
+   defined(CONFIG_SERIAL_TAG) || \
+   defined(CONFIG_REVISION_TAG)
+   /* Create subcommand string */
+   char *subcommand[] = {
+   start,
+   loados,
+#ifdef CONFIG_SYS_BOOT_RAMDISK_HIGH
+   ramdisk,
+#endif
+   cmdline,
+   bdt,
+   prep,
+   NULL};
+
+   /* inspect parameters and execute bootm */
+   argc--;
+   argv++;

[U-Boot] [PATCH V13 02/12] devkit8000: add config for spl command

2012-02-04 Thread Stefano Babic
From: Simon Schwarz simonschwarz...@googlemail.com

This adds some configs for devkit8000 to use the new spl command

Signed-off-by: Simon Schwarz simonschwarz...@gmail.com
CC: Tom Rini tom.r...@gmail.com
CC: Stefano Babic sba...@denx.de
CC: Wolfgang Denk w...@denx.de
---
 include/configs/devkit8000.h |8 
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/include/configs/devkit8000.h b/include/configs/devkit8000.h
index 758326b..d3ca0dd 100644
--- a/include/configs/devkit8000.h
+++ b/include/configs/devkit8000.h
@@ -356,4 +356,12 @@
 #define CONFIG_SYS_SPL_MALLOC_START0x80208000
 #define CONFIG_SYS_SPL_MALLOC_SIZE 0x10/* 1 MB */
 
+/* SPL OS boot options */
+#define CONFIG_CMD_SPL
+#define CONFIG_CMD_SPL_WRITE_SIZE   0x400 /* 1024 byte */
+#define CONFIG_CMD_SPL_NAND_OFS (CONFIG_SYS_NAND_SPL_KERNEL_OFFS+\
+   0x40)
+#define CONFIG_SYS_NAND_SPL_KERNEL_OFFS 0x28
+#define CONFIG_SYS_SPL_ARGS_ADDR(PHYS_SDRAM_1 + 0x100)
+
 #endif /* __CONFIG_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 V13 04/12] devkit8000/spl: init GPMC for dm9000 in SPL

2012-02-04 Thread Stefano Babic
From: Simon Schwarz simonschwarz...@googlemail.com

Linux crashes if the GPMC isn't configured for the dm9000.

Signed-off-by: Simon Schwarz simonschwarz...@gmail.com
CC: Tom Rini tom.r...@gmail.com
CC: Stefano Babic sba...@denx.de
CC: Wolfgang Denk w...@denx.de
---
 arch/arm/include/asm/omap_common.h  |2 ++
 board/timll/devkit8000/devkit8000.c |   19 +++
 2 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/arch/arm/include/asm/omap_common.h 
b/arch/arm/include/asm/omap_common.h
index 34bec45..92aa4f9 100644
--- a/arch/arm/include/asm/omap_common.h
+++ b/arch/arm/include/asm/omap_common.h
@@ -92,6 +92,8 @@ u32 omap_boot_mode(void);
 /* SPL common function s*/
 void spl_parse_image_header(const struct image_header *header);
 void omap_rev_string(void);
+int spl_uboot_key(void);
+void spl_board_prepare_for_linux(void);
 
 /* NAND SPL functions */
 void spl_nand_load_image(void);
diff --git a/board/timll/devkit8000/devkit8000.c 
b/board/timll/devkit8000/devkit8000.c
index 10f189e..dded697 100644
--- a/board/timll/devkit8000/devkit8000.c
+++ b/board/timll/devkit8000/devkit8000.c
@@ -73,6 +73,13 @@ int board_init(void)
return 0;
 }
 
+/* Configure GPMC registers for DM9000 */
+static void gpmc_dm9000_config(void)
+{
+   enable_gpmc_cs_config(gpmc_net_config, gpmc_cfg-cs[6],
+   CONFIG_DM9000_BASE, GPMC_SIZE_16M);
+}
+
 /*
  * Routine: misc_init_r
  * Description: Configure board specific parts
@@ -144,6 +151,18 @@ int board_eth_init(bd_t *bis)
 }
 #endif
 
+#ifdef CONFIG_SPL_OS_BOOT
+/*
+ * Do board specific preperation before SPL
+ * Linux boot
+ */
+void spl_board_prepare_for_linux(void)
+{
+   gpmc_dm9000_config();
+}
+
+#endif
+
 /*
  * Routine: get_board_mem_timings
  * Description: If we use SPL then there is no x-loader nor config header
-- 
1.7.5.4

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


[U-Boot] [PATCH V13 05/12] omap-common/spl: Add linux boot to SPL

2012-02-04 Thread Stefano Babic
From: Simon Schwarz simonschwarz...@googlemail.com

This adds Linux booting to the SPL

This depends on CONFIG_MACH_TYPE patch by Igor Grinberg
(http://article.gmane.org/gmane.comp.boot-loaders.u-boot/105809)

Related CONFIGs:
CONFIG_SPL_OS_BOOT
Activates/Deactivates the OS booting feature
CONFIG_SPL_OS_BOOT_KEY
defines the IO-pin number u-boot switch - if pressed u-boot is
booted
CONFIG_SYS_NAND_SPL_KERNEL_OFFS
Offset in NAND of direct boot kernel image to use in SPL
CONFIG_SYS_SPL_ARGS_ADDR
Address where the kernel boot arguments are expected - this is
normaly RAM-begin + 0x100

Signed-off-by: Simon Schwarz simonschwarz...@gmail.com
CC: Tom Rini tom.r...@gmail.com
CC: Stefano Babic sba...@denx.de
CC: Wolfgang Denk w...@denx.de
---
 arch/arm/cpu/armv7/omap-common/spl.c  |   48 +-
 arch/arm/cpu/armv7/omap-common/spl_nand.c |   53 
 arch/arm/include/asm/omap_common.h|1 +
 3 files changed, 77 insertions(+), 25 deletions(-)

diff --git a/arch/arm/cpu/armv7/omap-common/spl.c 
b/arch/arm/cpu/armv7/omap-common/spl.c
index 9c1f7e3..f99c0e5 100644
--- a/arch/arm/cpu/armv7/omap-common/spl.c
+++ b/arch/arm/cpu/armv7/omap-common/spl.c
@@ -65,6 +65,25 @@ void board_init_f(ulong dummy)
relocate_code(CONFIG_SPL_STACK, gdata, CONFIG_SPL_TEXT_BASE);
 }
 
+/*
+ * Default function to determine if u-boot or the OS should
+ * be started. This implementation always returns 1.
+ *
+ * Please implement your own board specific funcion to do this.
+ *
+ * RETURN
+ * 0 to not start u-boot
+ * positive if u-boot should start
+ */
+#ifdef CONFIG_SPL_OS_BOOT
+__weak int spl_start_uboot(void)
+{
+   printf(SPL: Please implement spl_start_uboot() for your board\n);
+   printf(SPL: Direct Linux boot not active!\n);
+   return 1;
+}
+#endif
+
 void spl_parse_image_header(const struct image_header *header)
 {
u32 header_size = sizeof(struct image_header);
@@ -92,7 +111,25 @@ void spl_parse_image_header(const struct image_header 
*header)
}
 }
 
-static void jump_to_image_no_args(void)
+/*
+ * This function jumps to an image with argument. Normally an FDT or ATAGS
+ * image.
+ * arg: Pointer to paramter image in RAM
+ */
+#ifdef CONFIG_SPL_OS_BOOT
+__noreturn void jump_to_image_linux(void *arg)
+{
+   debug(Entering kernel arg pointer: 0x%p\n, arg);
+   typedef void (*image_entry_arg_t)(int, int, void *)
+   __attribute__ ((noreturn));
+   image_entry_arg_t image_entry =
+   (image_entry_arg_t) spl_image.entry_point;
+   /* cleanup_before_linux(); */ /*write SPL function for that*/
+   image_entry(0, CONFIG_MACH_TYPE, arg);
+}
+#endif
+
+void jump_to_image_no_args(void)
 {
typedef void (*image_entry_noargs_t)(u32 *)__attribute__ ((noreturn));
image_entry_noargs_t image_entry =
@@ -106,8 +143,8 @@ static void jump_to_image_no_args(void)
u32 boot_params_ptr_addr = (u32)boot_params_ptr;
image_entry((u32 *)boot_params_ptr_addr);
 }
-
 void jump_to_image_no_args(void) __attribute__ ((noreturn));
+
 void board_init_r(gd_t *id, ulong dummy)
 {
u32 boot_device;
@@ -145,6 +182,13 @@ void board_init_r(gd_t *id, ulong dummy)
debug(Jumping to U-Boot\n);
jump_to_image_no_args();
break;
+#ifdef CONFIG_SPL_OS_BOOT
+   case IH_OS_LINUX:
+   debug(Jumping to Linux\n);
+   spl_board_prepare_for_linux();
+   jump_to_image_linux((void *)CONFIG_SYS_SPL_ARGS_ADDR);
+   break;
+#endif
default:
puts(Unsupported OS image.. Jumping nevertheless..\n);
jump_to_image_no_args();
diff --git a/arch/arm/cpu/armv7/omap-common/spl_nand.c 
b/arch/arm/cpu/armv7/omap-common/spl_nand.c
index 2a66214..1295e88 100644
--- a/arch/arm/cpu/armv7/omap-common/spl_nand.c
+++ b/arch/arm/cpu/armv7/omap-common/spl_nand.c
@@ -29,7 +29,6 @@
 #include version.h
 #include asm/omap_common.h
 
-
 void spl_nand_load_image(void)
 {
struct image_header *header;
@@ -50,7 +49,7 @@ void spl_nand_load_image(void)
/*use CONFIG_SYS_TEXT_BASE as temporary storage area */
header = (struct image_header *)(CONFIG_SYS_TEXT_BASE);
 #ifdef CONFIG_SPL_OS_BOOT
-   if (!spl_uboot_key()) {
+   if (!spl_start_uboot()) {
/*
 * load parameter image
 * load to temp position since nand_spl_load_image reads
@@ -74,31 +73,39 @@ void spl_nand_load_image(void)
nand_spl_load_image(CONFIG_SYS_NAND_SPL_KERNEL_OFFS,
CONFIG_SYS_NAND_PAGE_SIZE, (void *)header);
spl_parse_image_header(header);
-   nand_spl_load_image(CONFIG_SYS_NAND_SPL_KERNEL_OFFS,
-   spl_image.size, (void *)spl_image.load_addr);
-   } else
+   if (header-ih_os == IH_OS_LINUX) {
+   /* happy - 

[U-Boot] [PATCH V13 03/12] omap-common: Add NAND SPL linux booting

2012-02-04 Thread Stefano Babic
From: Simon Schwarz simonschwarz...@googlemail.com

This implements booting of Linux from NAND in SPL

Related config parameters:
CONFIG_SYS_NAND_SPL_KERNEL_OFFS
Offset in NAND of direct boot kernel image to use in SPL
CONFIG_SYS_SPL_ARGS_ADDR
Address where the kernel boot arguments are expected - this is
normally RAM-start + 0x100 (on ARM)

Signed-off-by: Simon Schwarz simonschwarz...@gmail.com
CC: Tom Rini tom.r...@gmail.com
CC: Stefano Babic sba...@denx.de
CC: Wolfgang Denk w...@denx.de
---
 arch/arm/cpu/armv7/omap-common/spl_nand.c |   66 ++---
 1 files changed, 50 insertions(+), 16 deletions(-)

diff --git a/arch/arm/cpu/armv7/omap-common/spl_nand.c 
b/arch/arm/cpu/armv7/omap-common/spl_nand.c
index 38d06b1..2a66214 100644
--- a/arch/arm/cpu/armv7/omap-common/spl_nand.c
+++ b/arch/arm/cpu/armv7/omap-common/spl_nand.c
@@ -24,6 +24,7 @@
 #include asm/u-boot.h
 #include asm/utils.h
 #include asm/arch/sys_proto.h
+#include asm/io.h
 #include nand.h
 #include version.h
 #include asm/omap_common.h
@@ -32,6 +33,9 @@
 void spl_nand_load_image(void)
 {
struct image_header *header;
+   int *src __attribute__((unused));
+   int *dst __attribute__((unused));
+
switch (omap_boot_mode()) {
case NAND_MODE_HW_ECC:
debug(spl: nand - using hw ecc\n);
@@ -45,26 +49,56 @@ void spl_nand_load_image(void)
 
/*use CONFIG_SYS_TEXT_BASE as temporary storage area */
header = (struct image_header *)(CONFIG_SYS_TEXT_BASE);
+#ifdef CONFIG_SPL_OS_BOOT
+   if (!spl_uboot_key()) {
+   /*
+* load parameter image
+* load to temp position since nand_spl_load_image reads
+* a whole block which is typically larger than
+* CONFIG_CMD_SAVEBP_WRITE_SIZE therefore may overwrite
+* following sections like BSS
+*/
+   nand_spl_load_image(CONFIG_CMD_SPL_NAND_OFS,
+   CONFIG_CMD_SPL_WRITE_SIZE,
+   (void *)CONFIG_SYS_TEXT_BASE);
+   /* copy to destintion */
+   for (dst = (int *)CONFIG_SYS_SPL_ARGS_ADDR,
+   src = (int *)CONFIG_SYS_TEXT_BASE;
+   src  (int *)(CONFIG_SYS_TEXT_BASE +
+   CONFIG_CMD_SPL_WRITE_SIZE);
+   src++, dst++) {
+   writel(readl(src), dst);
+   }
 
+   /* load linux */
+   nand_spl_load_image(CONFIG_SYS_NAND_SPL_KERNEL_OFFS,
+   CONFIG_SYS_NAND_PAGE_SIZE, (void *)header);
+   spl_parse_image_header(header);
+   nand_spl_load_image(CONFIG_SYS_NAND_SPL_KERNEL_OFFS,
+   spl_image.size, (void *)spl_image.load_addr);
+   } else
+#endif
+   {
 #ifdef CONFIG_NAND_ENV_DST
-   nand_spl_load_image(CONFIG_ENV_OFFSET,
-   CONFIG_SYS_NAND_PAGE_SIZE, (void *)header);
-   spl_parse_image_header(header);
-   nand_spl_load_image(CONFIG_ENV_OFFSET, spl_image.size,
-   (void *)image_load_addr);
+   nand_spl_load_image(CONFIG_ENV_OFFSET,
+   CONFIG_SYS_NAND_PAGE_SIZE, (void *)header);
+   spl_parse_image_header(header);
+   nand_spl_load_image(CONFIG_ENV_OFFSET, spl_image.size,
+   (void *)spl_image.load_addr);
 #ifdef CONFIG_ENV_OFFSET_REDUND
-   nand_spl_load_image(CONFIG_ENV_OFFSET_REDUND,
-   CONFIG_SYS_NAND_PAGE_SIZE, (void *)header);
-   spl_parse_image_header(header);
-   nand_spl_load_image(CONFIG_ENV_OFFSET_REDUND, spl_image.size,
-   (void *)image_load_addr);
+   nand_spl_load_image(CONFIG_ENV_OFFSET_REDUND,
+   CONFIG_SYS_NAND_PAGE_SIZE, (void *)header);
+   spl_parse_image_header(header);
+   nand_spl_load_image(CONFIG_ENV_OFFSET_REDUND, spl_image.size,
+   (void *)spl_image.load_addr);
 #endif
 #endif
-   /* Load u-boot */
-   nand_spl_load_image(CONFIG_SYS_NAND_U_BOOT_OFFS,
-   CONFIG_SYS_NAND_PAGE_SIZE, (void *)header);
-   spl_parse_image_header(header);
-   nand_spl_load_image(CONFIG_SYS_NAND_U_BOOT_OFFS,
-   spl_image.size, (void *)spl_image.load_addr);
+   /* Load u-boot */
+   nand_spl_load_image(CONFIG_SYS_NAND_U_BOOT_OFFS,
+   CONFIG_SYS_NAND_PAGE_SIZE, (void *)header);
+   spl_parse_image_header(header);
+   nand_spl_load_image(CONFIG_SYS_NAND_U_BOOT_OFFS,
+   spl_image.size, (void *)spl_image.load_addr);
+   }
nand_deselect();
 }
-- 
1.7.5.4

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


[U-Boot] [PATCH V13 06/12] omap/spl: change output of spl_parse_image_header

2012-02-04 Thread Stefano Babic
From: Simon Schwarz simonschwarz...@googlemail.com

This only outputs Assuming u-boot.bin... if debug is active.

Signed-off-by: Simon Schwarz simonschwarz...@gmail.com
CC: Tom Rini tom.r...@gmail.com
CC: Stefano Babic sba...@denx.de
CC: Wolfgang Denk w...@denx.de
---
 arch/arm/cpu/armv7/omap-common/spl.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/cpu/armv7/omap-common/spl.c 
b/arch/arm/cpu/armv7/omap-common/spl.c
index f99c0e5..5f7ba2c 100644
--- a/arch/arm/cpu/armv7/omap-common/spl.c
+++ b/arch/arm/cpu/armv7/omap-common/spl.c
@@ -101,7 +101,7 @@ void spl_parse_image_header(const struct image_header 
*header)
/* Signature not found - assume u-boot.bin */
printf(mkimage signature not found - ih_magic = %x\n,
header-ih_magic);
-   puts(Assuming u-boot.bin ..\n);
+   debug(Assuming u-boot.bin ..\n);
/* Let's assume U-Boot will not be more than 200 KB */
spl_image.size = 200 * 1024;
spl_image.entry_point = CONFIG_SYS_TEXT_BASE;
-- 
1.7.5.4

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


[U-Boot] [PATCH V13 07/12] devkit8000: Implement and activate direct OS boot

2012-02-04 Thread Stefano Babic
From: Simon Schwarz simonschwarz...@googlemail.com

- Implements spl_start_uboot() for devkit8000
- Add configs to activate direct OS boot from SPL

Signed-off-by: Simon Schwarz simonschwarz...@gmail.com
CC: Tom Rini tom.r...@gmail.com
CC: Stefano Babic sba...@denx.de
CC: Wolfgang Denk w...@denx.de
---
 board/timll/devkit8000/devkit8000.c |   18 ++
 include/configs/devkit8000.h|7 +--
 2 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/board/timll/devkit8000/devkit8000.c 
b/board/timll/devkit8000/devkit8000.c
index dded697..d75e86b 100644
--- a/board/timll/devkit8000/devkit8000.c
+++ b/board/timll/devkit8000/devkit8000.c
@@ -41,6 +41,7 @@
 #include asm/arch/mem.h
 #include asm/mach-types.h
 #include devkit8000.h
+#include asm/gpio.h
 #ifdef CONFIG_DRIVER_DM9000
 #include net.h
 #include netdev.h
@@ -161,6 +162,23 @@ void spl_board_prepare_for_linux(void)
gpmc_dm9000_config();
 }
 
+/*
+ * devkit8000 specific implementation of spl_start_uboot()
+ *
+ * RETURN
+ * 0 if the button is not pressed
+ * 1 if the button is pressed
+ */
+int spl_start_uboot(void)
+{
+   int val = 0;
+   if (!gpio_request(CONFIG_SPL_OS_BOOT_KEY, U-Boot key)) {
+   gpio_direction_input(CONFIG_SPL_OS_BOOT_KEY);
+   val = gpio_get_value(CONFIG_SPL_OS_BOOT_KEY);
+   gpio_free(CONFIG_SPL_OS_BOOT_KEY);
+   }
+   return !val;
+}
 #endif
 
 /*
diff --git a/include/configs/devkit8000.h b/include/configs/devkit8000.h
index d3ca0dd..2bcab72 100644
--- a/include/configs/devkit8000.h
+++ b/include/configs/devkit8000.h
@@ -35,7 +35,7 @@
 #define CONFIG_OMAP1   /* in a TI OMAP core */
 #define CONFIG_OMAP34XX1   /* which is a 34XX */
 #define CONFIG_OMAP3_DEVKIT80001   /* working with DevKit8000 */
-
+#define CONFIG_MACH_TYPE   MACH_TYPE_DEVKIT8000
 /*
  * 1MB into the SDRAM to allow for SPL's bss at the beginning of SDRAM
  * 64 bytes before this address should be set aside for u-boot.img's
@@ -327,7 +327,7 @@
 #define CONFIG_SPL_MAX_SIZE0xB400  /* 45 K */
 #define CONFIG_SPL_STACK   LOW_LEVEL_SRAM_STACK
 
-#define CONFIG_SPL_BSS_START_ADDR  0x8000 /*CONFIG_SYS_SDRAM_BASE*/
+#define CONFIG_SPL_BSS_START_ADDR   0x8500 /* leave space for 
bootargs*/
 #define CONFIG_SPL_BSS_MAX_SIZE0x8
 
 /* NAND boot config */
@@ -357,6 +357,9 @@
 #define CONFIG_SYS_SPL_MALLOC_SIZE 0x10/* 1 MB */
 
 /* SPL OS boot options */
+#define CONFIG_SPL_OS_BOOT
+#define CONFIG_SPL_OS_BOOT_KEY 26
+
 #define CONFIG_CMD_SPL
 #define CONFIG_CMD_SPL_WRITE_SIZE   0x400 /* 1024 byte */
 #define CONFIG_CMD_SPL_NAND_OFS (CONFIG_SYS_NAND_SPL_KERNEL_OFFS+\
-- 
1.7.5.4

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


[U-Boot] [PATCH V13 08/12] Add cache functions to SPL for armv7

2012-02-04 Thread Stefano Babic
Signed-off-by: Stefano Babic sba...@denx.de
CC: Tom Rini tom.r...@gmail.com
CC: Wolfgang Denk w...@denx.de
CC: Simon Schwarz simonschwarz...@gmail.com
---
 arch/arm/cpu/armv7/Makefile |2 --
 arch/arm/cpu/armv7/cpu.c|2 ++
 arch/arm/lib/Makefile   |5 +++--
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/arch/arm/cpu/armv7/Makefile b/arch/arm/cpu/armv7/Makefile
index f97fa3d..6b2addc 100644
--- a/arch/arm/cpu/armv7/Makefile
+++ b/arch/arm/cpu/armv7/Makefile
@@ -27,9 +27,7 @@ LIB   = $(obj)lib$(CPU).o
 
 START  := start.o
 
-ifndef CONFIG_SPL_BUILD
 COBJS  += cache_v7.o
-endif
 
 COBJS  += cpu.o
 COBJS  += syslib.o
diff --git a/arch/arm/cpu/armv7/cpu.c b/arch/arm/cpu/armv7/cpu.c
index 662c496..c6fa8ef 100644
--- a/arch/arm/cpu/armv7/cpu.c
+++ b/arch/arm/cpu/armv7/cpu.c
@@ -52,7 +52,9 @@ int cleanup_before_linux(void)
 *
 * we turn off caches etc ...
 */
+#ifndef CONFIG_SPL_BUILD
disable_interrupts();
+#endif
 
/*
 * Turn off I-cache and invalidate it
diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile
index 300c8fa..39a9550 100644
--- a/arch/arm/lib/Makefile
+++ b/arch/arm/lib/Makefile
@@ -39,8 +39,6 @@ GLCOBJS   += div0.o
 
 COBJS-y+= board.o
 COBJS-y+= bootm.o
-COBJS-y+= cache.o
-COBJS-y+= cache-cp15.o
 COBJS-$(CONFIG_SYS_L2_PL310) += cache-pl310.o
 COBJS-y+= interrupts.o
 COBJS-y+= reset.o
@@ -48,6 +46,9 @@ SOBJS-$(CONFIG_USE_ARCH_MEMSET) += memset.o
 SOBJS-$(CONFIG_USE_ARCH_MEMCPY) += memcpy.o
 endif
 
+COBJS-y+= cache.o
+COBJS-y+= cache-cp15.o
+
 SRCS   := $(GLSOBJS:.o=.S) $(GLCOBJS:.o=.c) \
   $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
 OBJS   := $(addprefix $(obj),$(SOBJS-y) $(COBJS-y))
-- 
1.7.5.4

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


[U-Boot] [PATCH V13 10/12] SPL: call cleanup_before_linux() before booting Linux

2012-02-04 Thread Stefano Babic
Signed-off-by: Stefano Babic sba...@denx.de
CC: Tom Rini tom.r...@gmail.com
CC: Wolfgang Denk w...@denx.de
CC: Simon Schwarz simonschwarz...@gmail.com
---
 arch/arm/cpu/armv7/omap-common/spl.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/cpu/armv7/omap-common/spl.c 
b/arch/arm/cpu/armv7/omap-common/spl.c
index 5f7ba2c..d9dd864 100644
--- a/arch/arm/cpu/armv7/omap-common/spl.c
+++ b/arch/arm/cpu/armv7/omap-common/spl.c
@@ -124,7 +124,7 @@ __noreturn void jump_to_image_linux(void *arg)
__attribute__ ((noreturn));
image_entry_arg_t image_entry =
(image_entry_arg_t) spl_image.entry_point;
-   /* cleanup_before_linux(); */ /*write SPL function for that*/
+   cleanup_before_linux();
image_entry(0, CONFIG_MACH_TYPE, arg);
 }
 #endif
-- 
1.7.5.4

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


[U-Boot] [PATCH V13 09/12] OMAP3: SPL: do not call I2C init if no I2C is set.

2012-02-04 Thread Stefano Babic
Call i2c initialization in spl_board_init only if I2C
is configured for the board.

Signed-off-by: Stefano Babic sba...@denx.de
CC: Tom Rini tom.r...@gmail.com
CC: Wolfgang Denk w...@denx.de
CC: Simon Schwarz simonschwarz...@gmail.com
---
 arch/arm/cpu/armv7/omap3/board.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/arch/arm/cpu/armv7/omap3/board.c b/arch/arm/cpu/armv7/omap3/board.c
index 871aa37..d942bfe 100644
--- a/arch/arm/cpu/armv7/omap3/board.c
+++ b/arch/arm/cpu/armv7/omap3/board.c
@@ -92,7 +92,9 @@ u32 omap_boot_device(void)
 
 void spl_board_init(void)
 {
+#ifdef CONFIG_SPL_I2C_SUPPORT
i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
+#endif
 }
 #endif /* CONFIG_SPL_BUILD */
 
-- 
1.7.5.4

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


[U-Boot] [PATCH V13 11/12] OMAP3: twister: add support to boot Linux from SPL

2012-02-04 Thread Stefano Babic
Signed-off-by: Stefano Babic sba...@denx.de
CC: Tom Rini tom.r...@gmail.com
CC: Wolfgang Denk w...@denx.de
CC: Simon Schwarz simonschwarz...@gmail.com
---
 board/technexion/twister/twister.c |   23 +++
 include/configs/twister.h  |   12 
 2 files changed, 35 insertions(+), 0 deletions(-)

diff --git a/board/technexion/twister/twister.c 
b/board/technexion/twister/twister.c
index 06fac7b..4d34d24 100644
--- a/board/technexion/twister/twister.c
+++ b/board/technexion/twister/twister.c
@@ -114,3 +114,26 @@ int board_mmc_init(bd_t *bis)
return omap_mmc_init(0);
 }
 #endif
+
+#ifdef CONFIG_SPL_OS_BOOT
+/*
+ * Do board specific preperation before SPL
+ * Linux boot
+ */
+void spl_board_prepare_for_linux(void)
+{
+   /* init cs for extern lan */
+   enable_gpmc_cs_config(gpmc_smc911, gpmc_cfg-cs[5],
+   CONFIG_SMC911X_BASE, GPMC_SIZE_16M);
+}
+int spl_start_uboot(void)
+{
+   int val = 0;
+   if (!gpio_request(CONFIG_SPL_OS_BOOT_KEY, U-Boot key)) {
+   gpio_direction_input(CONFIG_SPL_OS_BOOT_KEY);
+   val = gpio_get_value(CONFIG_SPL_OS_BOOT_KEY);
+   gpio_free(CONFIG_SPL_OS_BOOT_KEY);
+   }
+   return val;
+}
+#endif
diff --git a/include/configs/twister.h b/include/configs/twister.h
index 64a886d..a852481 100644
--- a/include/configs/twister.h
+++ b/include/configs/twister.h
@@ -51,4 +51,16 @@
 #defineCONFIG_EXTRA_ENV_SETTINGS   CONFIG_TAM3517_SETTINGS \
bootcmd=run nandboot\0
 
+/* SPL OS boot options */
+#define CONFIG_CMD_SPL
+#define CONFIG_CMD_SPL_WRITE_SIZE  0x400 /* 1024 byte */
+#define CONFIG_SYS_NAND_SPL_KERNEL_OFFS0x0020
+#define CONFIG_CMD_SPL_NAND_OFS(CONFIG_SYS_NAND_SPL_KERNEL_OFFS+\
+   0x60)
+#define CONFIG_SPL_OS_BOOT
+#define CONFIG_SPL_OS_BOOT_KEY 55
+
+#define CONFIG_SYS_SPL_ARGS_ADDR   (PHYS_SDRAM_1 + 0x100)
+#define CONFIG_SPL_BOARD_INIT
+
 #endif /* __CONFIG_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 V13 12/12] arm: Add Prep subcommand support to bootm

2012-02-04 Thread Stefano Babic
From: Simon Schwarz simonschwarz...@googlemail.com

Adds prep subcommand to bootm implementation of ARM. When bootm is called
with the subcommand prep the function stops right after ATAGS creation and
before announce_and_cleanup.

This is used in command cmd_spl export

Signed-off-by: Simon Schwarz simonschwarz...@gmail.com
Acked-by: Stefano Babic sba...@denx.de
Tested-by: Stefano Babic sba...@denx.de
---
 arch/arm/include/asm/bootm.h |   26 
 arch/arm/lib/bootm.c |  341 ++
 2 files changed, 202 insertions(+), 165 deletions(-)
 create mode 100644 arch/arm/include/asm/bootm.h

diff --git a/arch/arm/include/asm/bootm.h b/arch/arm/include/asm/bootm.h
new file mode 100644
index 000..db2ff94
--- /dev/null
+++ b/arch/arm/include/asm/bootm.h
@@ -0,0 +1,26 @@
+/* Copyright (C) 2011
+ * Corscience GmbH  Co. KG - Simon Schwarz schw...@corscience.de
+ *
+ * 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
+ *
+ */
+#ifndef ARM_BOOTM_H
+#define ARM_BOOTM_H
+
+#ifdef CONFIG_USB_DEVICE
+extern void udc_disconnect(void);
+#endif
+
+#endif
diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c
index afa0093..03c25e9 100644
--- a/arch/arm/lib/bootm.c
+++ b/arch/arm/lib/bootm.c
@@ -1,4 +1,8 @@
-/*
+/* Copyright (C) 2011
+ * Corscience GmbH  Co. KG - Simon Schwarz schw...@corscience.de
+ *  - Added prep subcommand support
+ *  - Reorganized source - modeled after powerpc version
+ *
  * (C) Copyright 2002
  * Sysgo Real-Time Solutions, GmbH www.elinos.com
  * Marius Groeger mgroe...@sysgo.de
@@ -29,35 +33,26 @@
 #include fdt.h
 #include libfdt.h
 #include fdt_support.h
+#include asm/bootm.h
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#if defined (CONFIG_SETUP_MEMORY_TAGS) || \
-defined (CONFIG_CMDLINE_TAG) || \
-defined (CONFIG_INITRD_TAG) || \
-defined (CONFIG_SERIAL_TAG) || \
-defined (CONFIG_REVISION_TAG)
-static void setup_start_tag (bd_t *bd);
-
-# ifdef CONFIG_SETUP_MEMORY_TAGS
-static void setup_memory_tags (bd_t *bd);
-# endif
-static void setup_commandline_tag (bd_t *bd, char *commandline);
-
-# ifdef CONFIG_INITRD_TAG
-static void setup_initrd_tag (bd_t *bd, ulong initrd_start,
- ulong initrd_end);
-# endif
-static void setup_end_tag (bd_t *bd);
-
+#if defined(CONFIG_SETUP_MEMORY_TAGS) || \
+   defined(CONFIG_CMDLINE_TAG) || \
+   defined(CONFIG_INITRD_TAG) || \
+   defined(CONFIG_SERIAL_TAG) || \
+   defined(CONFIG_REVISION_TAG)
 static struct tag *params;
-#endif /* CONFIG_SETUP_MEMORY_TAGS || CONFIG_CMDLINE_TAG || CONFIG_INITRD_TAG 
*/
-
-static ulong get_sp(void);
-#if defined(CONFIG_OF_LIBFDT)
-static int bootm_linux_fdt(int machid, bootm_headers_t *images);
 #endif
 
+static ulong get_sp(void)
+{
+   ulong ret;
+
+   asm(mov %0, sp : =r(ret) : );
+   return ret;
+}
+
 void arch_lmb_reserve(struct lmb *lmb)
 {
ulong sp;
@@ -80,85 +75,7 @@ void arch_lmb_reserve(struct lmb *lmb)
gd-bd-bi_dram[0].start + gd-bd-bi_dram[0].size - sp);
 }
 
-static void announce_and_cleanup(void)
-{
-   printf(\nStarting kernel ...\n\n);
-
-#ifdef CONFIG_USB_DEVICE
-   {
-   extern void udc_disconnect(void);
-   udc_disconnect();
-   }
-#endif
-   cleanup_before_linux();
-}
-
-int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images)
-{
-   bd_t*bd = gd-bd;
-   char*s;
-   int machid = bd-bi_arch_number;
-   void(*kernel_entry)(int zero, int arch, uint params);
-
-#ifdef CONFIG_CMDLINE_TAG
-   char *commandline = getenv (bootargs);
-#endif
-
-   if ((flag != 0)  (flag != BOOTM_STATE_OS_GO))
-   return 1;
-
-   s = getenv (machid);
-   if (s) {
-   machid = simple_strtoul (s, NULL, 16);
-   printf (Using machid 0x%x from environment\n, machid);
-   }
-
-   show_boot_progress (15);
-
 #ifdef CONFIG_OF_LIBFDT
-   if (images-ft_len)
-   return bootm_linux_fdt(machid, images);
-#endif
-
-   kernel_entry = (void (*)(int, int, uint))images-ep;
-
-   debug (## Transferring control to Linux (at address %08lx) ...\n,
-  (ulong) kernel_entry);
-
-#if defined (CONFIG_SETUP_MEMORY_TAGS) || \
-defined (CONFIG_CMDLINE_TAG) || \
-defined 

Re: [U-Boot] Skipping relocation RAM to RAM, esp. on i.MX6?

2012-02-04 Thread Aneesh V

On Saturday 04 February 2012 04:30 PM, Albert ARIBAUD wrote:

Le 04/02/2012 10:15, Aneesh V a écrit :

Hi Dirk,

On Friday 03 February 2012 12:55 PM, Dirk Behme wrote:

Hi,

on i.MX6 devices, e.g. ARM2 or SabreLite, the ROM boot loader copies the
U-Boot image from the boot device, e.g. the SD card, to the main memory.
This does mean that U-Boot is started in RAM.

With this, one might wonder why any relocation RAM - RAM is done anyway
and if this could be skipped?

Looking into the details shows that board_init_f() in
arch/arm/lib/board.c and relocate_code() in arch/arm/cpu/armv7/start.S
[1] are involved in this.

In board_init_f() the relocation destination address 'addr' is
calculated. This is basically at the end of the available RAM (- some
space for various stuff like TLB tables etc.). At SabreLite this results
in 0x4FF8D000.

By the boot loader, the U-Boot is loaded to

CONFIG_SYS_TEXT_BASE 0x1780

This results in relocate_code() copying U-Boot from RAM 0x1780 to
RAM 0x4FF8D000.

Setting CONFIG_SYS_TEXT_BASE to the relocation destination address
0x4FF8D000 does avoid the (unnecessary?) copy by

cmp r0, r6
moveq r9, #0 /* no relocation. relocation offset(r9) = 0 */
beq clear_bss /* skip relocation */

in relocate_code().

But:

1) The resulting image still runs without the relocation
(CONFIG_SYS_TEXT_BASE 0x4FF8D000). But e.g. the U-Boot command line
doesn't work properly any more. Most probably this is because not only
the copy is skipped by the 'beq clear_bss', but the whole 'fix .rel.dyn
relocations' is skipped too.

2) It's hard to set CONFIG_SYS_TEXT_BASE at compile time to the
relocation address calculated at runtime in board_init_f() due to the
amount of #ifdef and runtime calculation done there. So finding a
generic approach which could easily defined in the config files to avoid
the relocation seems difficult.


I haven't really completely read your mail. But here is an
implementation I had provided long time back for ARM. But Wolfgang
didn't want to take it. You can see the patch and the following
discussion in this thread:

http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/96352


Recently there was an reminder by Wolfgang that debugging can be done
even with relocation, provided the symbols are dropped and reloaded in
gdb upon hitting the end of the relocate loop where the jump to (the new
location of) board_init_f happens --see
http://www.denx.de/wiki/view/DULG/WrongDebugSymbolsAfterRelocation.

I am not a specialist of gdb but I think it might be automated, too, so
that if you want to debug u-boot past relocation then you would just
have to enter a single command in gdb, or a script name when invoking
gdb, to load u-boot in low RAM , set a breakpoint at the pivot point
after relocation, run to that breakpoint, drop current symbols and
reload symbols with the adequate offset, possibly computed from some
accessible global.

Anyone itching enough to do some research and experiments on this?


I employ a different method using my JTAG debugger.

1. Look at the content of gd using the address from r8. Lauterbach
allows you to cast that address to a (structglobal_data *) and view
the contents.

2. Get reloc_off from gd and use that to relocate the symbols in
Trace32.

The advantage is that I can do all this after booting completely. No
breakpoint needed.

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


Re: [U-Boot] Skipping relocation RAM to RAM, esp. on i.MX6?

2012-02-04 Thread Albert ARIBAUD

Le 04/02/2012 12:14, Aneesh V a écrit :

On Saturday 04 February 2012 04:30 PM, Albert ARIBAUD wrote:

Le 04/02/2012 10:15, Aneesh V a écrit :

Hi Dirk,

On Friday 03 February 2012 12:55 PM, Dirk Behme wrote:

Hi,

on i.MX6 devices, e.g. ARM2 or SabreLite, the ROM boot loader copies
the
U-Boot image from the boot device, e.g. the SD card, to the main
memory.
This does mean that U-Boot is started in RAM.

With this, one might wonder why any relocation RAM - RAM is done
anyway
and if this could be skipped?

Looking into the details shows that board_init_f() in
arch/arm/lib/board.c and relocate_code() in arch/arm/cpu/armv7/start.S
[1] are involved in this.

In board_init_f() the relocation destination address 'addr' is
calculated. This is basically at the end of the available RAM (- some
space for various stuff like TLB tables etc.). At SabreLite this
results
in 0x4FF8D000.

By the boot loader, the U-Boot is loaded to

CONFIG_SYS_TEXT_BASE 0x1780

This results in relocate_code() copying U-Boot from RAM 0x1780 to
RAM 0x4FF8D000.

Setting CONFIG_SYS_TEXT_BASE to the relocation destination address
0x4FF8D000 does avoid the (unnecessary?) copy by

cmp r0, r6
moveq r9, #0 /* no relocation. relocation offset(r9) = 0 */
beq clear_bss /* skip relocation */

in relocate_code().

But:

1) The resulting image still runs without the relocation
(CONFIG_SYS_TEXT_BASE 0x4FF8D000). But e.g. the U-Boot command line
doesn't work properly any more. Most probably this is because not only
the copy is skipped by the 'beq clear_bss', but the whole 'fix .rel.dyn
relocations' is skipped too.

2) It's hard to set CONFIG_SYS_TEXT_BASE at compile time to the
relocation address calculated at runtime in board_init_f() due to the
amount of #ifdef and runtime calculation done there. So finding a
generic approach which could easily defined in the config files to
avoid
the relocation seems difficult.


I haven't really completely read your mail. But here is an
implementation I had provided long time back for ARM. But Wolfgang
didn't want to take it. You can see the patch and the following
discussion in this thread:

http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/96352


Recently there was an reminder by Wolfgang that debugging can be done
even with relocation, provided the symbols are dropped and reloaded in
gdb upon hitting the end of the relocate loop where the jump to (the new
location of) board_init_f happens --see
http://www.denx.de/wiki/view/DULG/WrongDebugSymbolsAfterRelocation.

I am not a specialist of gdb but I think it might be automated, too, so
that if you want to debug u-boot past relocation then you would just
have to enter a single command in gdb, or a script name when invoking
gdb, to load u-boot in low RAM , set a breakpoint at the pivot point
after relocation, run to that breakpoint, drop current symbols and
reload symbols with the adequate offset, possibly computed from some
accessible global.

Anyone itching enough to do some research and experiments on this?


I employ a different method using my JTAG debugger.

1. Look at the content of gd using the address from r8. Lauterbach
allows you to cast that address to a (struct global_data *) and view
the contents.

2. Get reloc_off from gd and use that to relocate the symbols in
Trace32.

The advantage is that I can do all this after booting completely. No
breakpoint needed.


Indeed, assuming you only want to debug post-relocation you can use this 
technique -- I guess it is applicable to GDB as well.



br,
Aneesh


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


Re: [U-Boot] [PATCH 00/14] Nokia RX-51 support

2012-02-04 Thread Pali Rohár
On Tuesday 24 January 2012 15:27:57 you wrote:
 This patch series add support for new board Nokia RX-51 (aka N900).
 Last two patches adding on screen bootmenu support.

 This series supersedes the last sent version.

 Pali Rohár (14):
   arm,omap3: Define save_boot_params in lowlevel_init.S for SPL only
   arm: Optionally use existing atags in bootm.c
   Add power bus message definitions in twl4030.h
   Fix function readline in main.c
   cfb_console: Fix function console_scrollup
   cfb_console: Add function console_clear and console_clear_line
   cfb_console: Add functions for moving with cursor
   cfb_console: Add support for some ANSI terminal escape codes
   New command clear: Clear the ANSI terminal
   New config variable CONFIG_MENUCMD
   New config variable CONFIG_PREMONITOR
   New board support: Nokia RX-51 aka N900
   New command bootmenu: ANSI terminal Boot Menu support
   RX-51: Add support for bootmenu

  README   |2 +
  arch/arm/cpu/armv7/omap3/lowlevel_init.S |4 +-
  arch/arm/lib/bootm.c |   39 +++-
  board/nokia/rx51/Makefile|   46 
  board/nokia/rx51/lowlevel_init.S |   79 ++
  board/nokia/rx51/rx51.c  |  381
 ++ board/nokia/rx51/rx51.h  |
 378 + boards.cfg
 |1 +
  common/Makefile  |2 +
  common/cmd_bootmenu.c|  366
  common/cmd_clear.c   |
 42 
  common/env_common.c  |3 +
  common/main.c|   89 ++-
  drivers/video/cfb_console.c  |  346 +--
 include/common.h |   20 ++
  include/config_cmd_all.h |2 +
  include/configs/nokia_rx51.h |  375
 + include/twl4030.h|
 98 
  18 files changed, 2233 insertions(+), 40 deletions(-)
  create mode 100644 board/nokia/rx51/Makefile
  create mode 100644 board/nokia/rx51/lowlevel_init.S
  create mode 100644 board/nokia/rx51/rx51.c
  create mode 100644 board/nokia/rx51/rx51.h
  create mode 100644 common/cmd_bootmenu.c
  create mode 100644 common/cmd_clear.c
  create mode 100644 include/configs/nokia_rx51.h

Please look at my post:
http://lists.denx.de/pipermail/u-boot/2012-January/115778.html

After that commit, framebuffer output on Nokia RX51 not working...

--
Pali Rohár
pali.ro...@gmail.com

signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] mx28: fix SPL code to make USB booting work

2012-02-04 Thread Marek Vasut
  On 03.02.2012 14:22, Marek Vasut wrote:
   This patch fixes booting i.MX28 CPUs via USB download.
   In this mode the CPU's bootrom implements a USB HID device that
   accepts a bootstream.
   
   When downloading the bootstream via USB, first the SPL code is
   received and executed. Then the u-boot image is received and
   called.
   
   The USB bootmode is interrupt driven.
   
   This patch fixes two things:
   
   1) The ARM's fast interrupt mode is disabled when the SPL code
   has been run. This is the default state when called by the bootrom.
   
   2) The exception vector location is set back to bootrom space to
   make the USB interrupts work again. The SPL code needs to change this
   option for the ram size probing.
   
   Signed-off-by: Matthias Fuchs matthias.fu...@esd.eu
   ---
   
arch/arm/cpu/arm926ejs/mx28/start.S |   17 +
1 files changed, 17 insertions(+), 0 deletions(-)
   
   diff --git a/arch/arm/cpu/arm926ejs/mx28/start.S
   b/arch/arm/cpu/arm926ejs/mx28/start.S index 2cd4d73..4116bb1 100644
   --- a/arch/arm/cpu/arm926ejs/mx28/start.S
   +++ b/arch/arm/cpu/arm926ejs/mx28/start.S
   
   @@ -185,6 +185,23 @@ _reset:
bl  board_init_ll
   
   +/*
   + * turn of fast interrupt mode (required by bootrom for USB 
boot)
   + */
   +mrs r0,cpsr
   +bic r0,r0,#0x80
   +msr cpsr,r0
   
   Add this section just past _reset into:
   
   170 /*
   171  * set the cpu to SVC32 mode
   172  */
   173 mrs r0,cpsr
   174 bic r0,r0,#0x1f
   175 orr r0,r0,#0xd3
   176 msr cpsr,r0
   
   And only if you really need this. Why do you need to disable FIQ?
  
  First: my commit message was not very clear in ths concern.
  When the SPL is called from the bootrom FIQ is turned off. When the SPL
  has run and control is passed back to the bootrom (!), the bootrom
  crashes, stalls or stops when FIQ is on. So we need to turn FIQ
  off when the SPL has done it's job. So that's why I added the code after
  board_init_ll(). I also noticed that the SPL runs fine when FIQ is never
  turned on. So I could think of never turning it on at all in SPL:
  170 /*
  171  * set the cpu to SVC32 mode
  172  */
  173 mrs r0,cpsr
  174 bic r0,r0,#0x1f
  - 175 orr r0,r0,#0xd3
  + 175 orr r0,r0,#0x53
  176 msr cpsr,r0
  
  This will result in CPSR = 0x53 which is the register content when
  the SPL is called (setup by bootrom). So we could completely get rid of
  this sequence.
  
  And yes, for USB boot the FIQ must be turned off when SPL has done it's
  work. Other boot modes do not care as far as I noticed.
  
   +
   +#ifndef CONFIG_SKIP_LOWLEVEL_INIT
   +/*
   + * set exception vector location back to bootrom space.
   + * (required by bootrom for USB boot)
   + */
   +mrc p15, 0, r0, c1, c0, 0
   +orr r0, r0, #0x2000 /* set bit 13 'V' */
   +mcr p15, 0, r0, c1, c0, 0
   +#endif
   
   High-vectors break the current implementation. That IS WRONG. The RAM
   memory detection routine will not work if you enable high vectors since
   it depends on adjusting the jumptable at 0x0 (aka. low vectors).
  
  Right. That's why the SPL code clears the 'V' bit and we got 'low
  vectors'. But when the SPL code has done it's work we need to return to
  'high vectors' (... in bootrom space) to keep USB from bootrom alive.
  That's what my patch does. SPL run with low vectors and before it
  returns to bootrom it switches back to high vectors.
  
   Why do you need to enable high vectors? Can't you detect that USB boot
   is happening (can mx28 report boot reason like mxc chips do?)
  
  Yes, by checking some GPIOs (I send an RFC/PATCH some days ago). But
  there's no need to only do this when using USB boot.
  
   and enable high-
   vectors just before passing control back to bootrom only then?
  
  That's what I do! Please take a look at my patch.
 
 I just noticed where you put it. OK. Why that CONFIG_SKIP_LOWLEVEL_INIT
 there anyway?
 
 And about FIQ, do it like you outlined it, disable it altogether and be
 done with it.

Actually ... maybe we can store CPSR to some other register (say ... r10?) and 
restore it before passing control back to bootrom. That might be the safest way 
and I think that'd be even better solution.

M

 
 M
 
   Though now that I think of it, high-vectors should probably be
   unconditionally re-enabled upon entering bootrom. Can you investigate?
  
  That's what my patch does!
  
  
  Matthias
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] i.MX5/6 U-Boot: Cache enabling

2012-02-04 Thread Aneesh V

Hi Dirk,

On Saturday 04 February 2012 02:08 PM, Dirk Behme wrote:


Let's discuss how to enable the i.MX5/6 caches in U-Boot:

On 03.02.2012 12:00, Stefano Babic wrote:

On 03/02/2012 11:18, Dirk Behme wrote:

...

As your concerns are surely related to speed up the boot process, IMHO
we can focus efforts to add cache support for MX5 / MX6.


Ok, sounds good. Any idea what has to be done for this? Or what would be
the steps for this?


As armv7 architecture, the MX can profit of the work already done for
other SOCs. Functions for enabling / disabling / invalidate caches are
already provided, in arch/arm/lib and arch/arm/cpu/armv7/cache_v7.c. So
at least for MX5/MX6.

But we should change MXC drivers to be cache-aware. At least the FEC
driver and MMC driver are known to not work when dcache is on.


Marek, Troy, Fabio: What do you think is needed to make the i.MX5/6 FEC
driver cache-aware?

Jason, Stefano: And what do you think would be needed for the MMC driver?


Three is a generic README for ARM at doc/README.arm-caches

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


Re: [U-Boot] [PATCH 2/2] Blackfin: easylogo: add lzma logos

2012-02-04 Thread Marek Vasut
 The bf527-ezkit boards are getting too big to fit into their reserved
 flash space, so we need to use a lzma compressed logo.
 
 Since the video driver code is very similar, add lzma compressed support
 to all of the Blackfin video drivers.
 
 Signed-off-by: Mike Frysinger vap...@gentoo.org

So what exactly do you plan to do when the u-boot won't fit into the reserved 
flash space next time ?
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 00/14] Nokia RX-51 support

2012-02-04 Thread Marek Vasut
 On Tuesday 24 January 2012 15:27:57 you wrote:
  This patch series add support for new board Nokia RX-51 (aka N900).
  Last two patches adding on screen bootmenu support.
  
  This series supersedes the last sent version.
  
  Pali Rohár (14):
arm,omap3: Define save_boot_params in lowlevel_init.S for SPL only
arm: Optionally use existing atags in bootm.c
Add power bus message definitions in twl4030.h
Fix function readline in main.c
cfb_console: Fix function console_scrollup
cfb_console: Add function console_clear and console_clear_line
cfb_console: Add functions for moving with cursor
cfb_console: Add support for some ANSI terminal escape codes
New command clear: Clear the ANSI terminal
New config variable CONFIG_MENUCMD
New config variable CONFIG_PREMONITOR
New board support: Nokia RX-51 aka N900
New command bootmenu: ANSI terminal Boot Menu support
RX-51: Add support for bootmenu
   
   README   |2 +
   arch/arm/cpu/armv7/omap3/lowlevel_init.S |4 +-
   arch/arm/lib/bootm.c |   39 +++-
   board/nokia/rx51/Makefile|   46 
   board/nokia/rx51/lowlevel_init.S |   79 ++
   board/nokia/rx51/rx51.c  |  381
  
  ++ board/nokia/rx51/rx51.h  |
  378 + boards.cfg
  
  |1 +
   
   common/Makefile  |2 +
   common/cmd_bootmenu.c|  366
  
   common/cmd_clear.c   |
  42 
  
   common/env_common.c  |3 +
   common/main.c|   89 ++-
   drivers/video/cfb_console.c  |  346
   +--
  
  include/common.h |   20 ++
  
   include/config_cmd_all.h |2 +
   include/configs/nokia_rx51.h |  375
  
  + include/twl4030.h|
  98 
  
   18 files changed, 2233 insertions(+), 40 deletions(-)
   create mode 100644 board/nokia/rx51/Makefile
   create mode 100644 board/nokia/rx51/lowlevel_init.S
   create mode 100644 board/nokia/rx51/rx51.c
   create mode 100644 board/nokia/rx51/rx51.h
   create mode 100644 common/cmd_bootmenu.c
   create mode 100644 common/cmd_clear.c
   create mode 100644 include/configs/nokia_rx51.h
 
 Please look at my post:
 http://lists.denx.de/pipermail/u-boot/2012-January/115778.html
 
 After that commit, framebuffer output on Nokia RX51 not working...

Can you PLEASE keep the involved parties in Cc? Otherwise people just won't 
notice your damn mail because they usually ignore emails not addressed to them!

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


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

2012-02-04 Thread Albert ARIBAUD

Hi Stefano,

Le 22/01/2012 14:06, Stefano Babic a écrit :

Hi Albert,

please pull from u-boot-imx, thanks.

The following changes since commit 5d250e52ffd5554834a45ac8d53762fbbf36933c:

   tegra2: Enable data cache (2012-01-18 15:54:07 -0700)

are available in the git repository at:
   git://www.denx.de/git/u-boot-imx.git master


This branch has moved since the pull request and now includes, in 
addition to the 11 commits mentioned in your request, the following 5 
new commits:


Fabio Estevam (1):
  mx28: Show CPU frequency

Helmut Raiger (2):
  mc13783.h: create and add regulator mode 0 and 1
  tt01: add MMC support

Jason Liu (1):
  i.mx: i.mx5: update imx_get_mac_from_fuse function

Matthias Fuchs (1):
  mx28: fix i.MX28 spi driver

Do you want me to ignore these and honor the initial 11-commit pull 
request, or would you prefer to issue an [UPDATE] pull req for the whole 
16 commits?


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


Re: [U-Boot] [PATCH 2/2] Blackfin: easylogo: add lzma logos

2012-02-04 Thread Mike Frysinger
On Saturday 04 February 2012 09:56:33 Marek Vasut wrote:
  The bf527-ezkit boards are getting too big to fit into their reserved
  flash space, so we need to use a lzma compressed logo.
  
  Since the video driver code is very similar, add lzma compressed support
  to all of the Blackfin video drivers.
 
 So what exactly do you plan to do when the u-boot won't fit into the
 reserved flash space next time ?

i'll worry about that when it comes
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/2] Blackfin: easylogo: add lzma logos

2012-02-04 Thread Marek Vasut
 On Saturday 04 February 2012 09:56:33 Marek Vasut wrote:
   The bf527-ezkit boards are getting too big to fit into their reserved
   flash space, so we need to use a lzma compressed logo.
   
   Since the video driver code is very similar, add lzma compressed
   support to all of the Blackfin video drivers.
  
  So what exactly do you plan to do when the u-boot won't fit into the
  reserved flash space next time ?
 
 i'll worry about that when it comes
 -mike

maybe you can introduce decompressor into u-boot like linux has it and compress 
the rest of uboot with lzma/xz ? :)

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


[U-Boot] [PATCH 2/2] RFC: Let linker create phy array

2012-02-04 Thread Troy Kisky
Signed-off-by: Troy Kisky troy.ki...@boundarydevices.com
---
 drivers/net/phy/atheros.c|9 +
 drivers/net/phy/broadcom.c   |   15 +++
 drivers/net/phy/davicom.c|9 +
 drivers/net/phy/lxt.c|9 +
 drivers/net/phy/marvell.c|   24 ++--
 drivers/net/phy/micrel.c |   12 ++--
 drivers/net/phy/natsemi.c|9 +
 drivers/net/phy/phy.c|   39 +--
 drivers/net/phy/realtek.c|9 +
 drivers/net/phy/smsc.c   |   15 +++
 drivers/net/phy/teranetics.c |9 +
 drivers/net/phy/vitesse.c|   30 --
 include/phy.h|3 +++
 u-boot-common.lds|7 +++
 14 files changed, 43 insertions(+), 156 deletions(-)

diff --git a/drivers/net/phy/atheros.c b/drivers/net/phy/atheros.c
index 798473d..ad82256 100644
--- a/drivers/net/phy/atheros.c
+++ b/drivers/net/phy/atheros.c
@@ -30,7 +30,7 @@ static int ar8021_config(struct phy_device *phydev)
return 0;
 }
 
-struct phy_driver AR8021_driver =  {
+struct phy_driver AR8021_driver __phy_entry =  {
.name = AR8021,
.uid = 0x4dd040,
.mask = 0xf0,
@@ -39,10 +39,3 @@ struct phy_driver AR8021_driver =  {
.startup = genphy_startup,
.shutdown = genphy_shutdown,
 };
-
-int phy_atheros_init(void)
-{
-   phy_register(AR8021_driver);
-
-   return 0;
-}
diff --git a/drivers/net/phy/broadcom.c b/drivers/net/phy/broadcom.c
index 427ac60..513931d 100644
--- a/drivers/net/phy/broadcom.c
+++ b/drivers/net/phy/broadcom.c
@@ -248,7 +248,7 @@ static int bcm5482_startup(struct phy_device *phydev)
return 0;
 }
 
-static struct phy_driver BCM5461S_driver = {
+struct phy_driver BCM5461S_driver __phy_entry = {
.name = Broadcom BCM5461S,
.uid = 0x2060c0,
.mask = 0xf0,
@@ -258,7 +258,7 @@ static struct phy_driver BCM5461S_driver = {
.shutdown = genphy_shutdown,
 };
 
-static struct phy_driver BCM5464S_driver = {
+struct phy_driver BCM5464S_driver __phy_entry = {
.name = Broadcom BCM5464S,
.uid = 0x2060b0,
.mask = 0xf0,
@@ -268,7 +268,7 @@ static struct phy_driver BCM5464S_driver = {
.shutdown = genphy_shutdown,
 };
 
-static struct phy_driver BCM5482S_driver = {
+struct phy_driver BCM5482S_driver __phy_entry = {
.name = Broadcom BCM5482S,
.uid = 0x143bcb0,
.mask = 0xff0,
@@ -277,12 +277,3 @@ static struct phy_driver BCM5482S_driver = {
.startup = bcm5482_startup,
.shutdown = genphy_shutdown,
 };
-
-int phy_broadcom_init(void)
-{
-   phy_register(BCM5482S_driver);
-   phy_register(BCM5464S_driver);
-   phy_register(BCM5461S_driver);
-
-   return 0;
-}
diff --git a/drivers/net/phy/davicom.c b/drivers/net/phy/davicom.c
index e96a4af..1c61197 100644
--- a/drivers/net/phy/davicom.c
+++ b/drivers/net/phy/davicom.c
@@ -80,7 +80,7 @@ static int dm9161_startup(struct phy_device *phydev)
return 0;
 }
 
-static struct phy_driver DM9161_driver = {
+struct phy_driver DM9161_driver __phy_entry = {
.name = Davicom DM9161E,
.uid = 0x181b880,
.mask = 0xff0,
@@ -89,10 +89,3 @@ static struct phy_driver DM9161_driver = {
.startup = dm9161_startup,
.shutdown = genphy_shutdown,
 };
-
-int phy_davicom_init(void)
-{
-   phy_register(DM9161_driver);
-
-   return 0;
-}
diff --git a/drivers/net/phy/lxt.c b/drivers/net/phy/lxt.c
index d67bbdd..5b85616 100644
--- a/drivers/net/phy/lxt.c
+++ b/drivers/net/phy/lxt.c
@@ -69,7 +69,7 @@ static int lxt971_startup(struct phy_device *phydev)
return 0;
 }
 
-static struct phy_driver LXT971_driver = {
+struct phy_driver LXT971_driver __phy_entry = {
.name = LXT971,
.uid = 0x1378e0,
.mask = 0xf0,
@@ -78,10 +78,3 @@ static struct phy_driver LXT971_driver = {
.startup = lxt971_startup,
.shutdown = genphy_shutdown,
 };
-
-int phy_lxt_init(void)
-{
-   phy_register(LXT971_driver);
-
-   return 0;
-}
diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c
index e51e799..90072cc 100644
--- a/drivers/net/phy/marvell.c
+++ b/drivers/net/phy/marvell.c
@@ -395,7 +395,7 @@ static int m88e1149_config(struct phy_device *phydev)
 }
 
 
-static struct phy_driver M88E1011S_driver = {
+struct phy_driver M88E1011S_driver __phy_entry = {
.name = Marvell 88E1011S,
.uid = 0x1410c60,
.mask = 0xff0,
@@ -405,7 +405,7 @@ static struct phy_driver M88E1011S_driver = {
.shutdown = genphy_shutdown,
 };
 
-static struct phy_driver M88ES_driver = {
+struct phy_driver M88ES_driver __phy_entry = {
.name = Marvell 88ES,
.uid = 0x1410cc0,
.mask = 0xff0,
@@ -415,7 +415,7 @@ static struct phy_driver M88ES_driver = {
.shutdown = genphy_shutdown,
 };
 
-static struct phy_driver 

Re: [U-Boot] [PATCH v4 2/9] Rename run_command() to builtin_run_command()

2012-02-04 Thread Mike Frysinger
On Saturday 14 January 2012 01:45:50 Simon Glass wrote:
 The current run_command() is only one of the options, with
 hush providing the other.

i can't grok this sentence
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v4 5/9] Don't include standard parser if hush is used

2012-02-04 Thread Mike Frysinger
On Saturday 14 January 2012 01:45:53 Simon Glass wrote:
 This saves about 1KB of code space on ARM with CONFIG_SYS_HUSH_PARSER
 defined.

are you not using --gc-sections ?
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v4 6/9] Create a single cmd_call() function to handle command execution

2012-02-04 Thread Mike Frysinger
On Saturday 14 January 2012 01:45:54 Simon Glass wrote:
 --- a/common/command.c
 +++ b/common/command.c

 +int cmd_call(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 +{
 + int result;
 +
 + result = (cmdtp-cmd)(cmdtp, flag, argc, argv);
 + if (result)
 + debug(Command failed, result=%d, result);
 + return result;
 +}

does a static inline in the header produce the same code size or better ?

 --- a/include/command.h
 +++ b/include/command.h

 +#ifndef  __ASSEMBLY__
 +int cmd_call(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]);
 +#endif   /* __ASSEMBLY__ */

move the prototype up to the rest of the !ASSEMBLY code rather than putting it 
at the end by itself ?
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v4 4/9] Stop using builtin_run_command()

2012-02-04 Thread Mike Frysinger
On Saturday 14 January 2012 01:45:52 Simon Glass wrote:
 This function is only one of the parser options, so use run_command()
 instead. It knows how to use hush if selected.

i can't grok this either :/
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v4 7/9] Remove interleave of non-U-Boot code in hush

2012-02-04 Thread Mike Frysinger
On Saturday 14 January 2012 01:45:55 Simon Glass wrote:
 There is a nasty interleave of #ifdefs in hush.c where the two code
 paths have different indents. Remove this ickiness.

i think we've moved beyond hopes of keeping hush.c unified with its upstream, 
so this is fine

Acked-by: Mike Frysinger vap...@gentoo.org
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/2] Blackfin: easylogo: add lzma logos

2012-02-04 Thread Mike Frysinger
On Saturday 04 February 2012 14:38:15 Marek Vasut wrote:
  On Saturday 04 February 2012 09:56:33 Marek Vasut wrote:
The bf527-ezkit boards are getting too big to fit into their reserved
flash space, so we need to use a lzma compressed logo.

Since the video driver code is very similar, add lzma compressed
support to all of the Blackfin video drivers.
   
   So what exactly do you plan to do when the u-boot won't fit into the
   reserved flash space next time ?
  
  i'll worry about that when it comes
 
 maybe you can introduce decompressor into u-boot like linux has it and
 compress the rest of uboot with lzma/xz ? :)

i've thought of doing that in the past.  for some people, size matters a _lot_ 
more than speed.  although i looked at implementing it with the Blackfin 
bootrom callback mechanism rather than in u-boot directly.  i guess the SPL 
code could do the same thing easily.
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/2] RFC: Let linker create phy array

2012-02-04 Thread Mike Frysinger
On Saturday 04 February 2012 22:02:46 Troy Kisky wrote:
 --- a/drivers/net/phy/broadcom.c
 +++ b/drivers/net/phy/broadcom.c
 
 -static struct phy_driver BCM5461S_driver = {
 +struct phy_driver BCM5461S_driver __phy_entry = {

why do you have to remove the static ?  that shouldn't affect the section name 
that it gets placed into.

 --- a/include/phy.h
 +++ b/include/phy.h
 
 +extern struct phy_driver __phy_entry_start, __phy_entry_end;

linker symbols should be declared like:
extern char __phy_entry_start[];

 --- a/u-boot-common.lds
 +++ b/u-boot-common.lds

i'm not seeing this in the u-boot tree ...

 + . = ALIGN(4);
 + __phy_entry_start = .;
 + .phy_entry : {
 + KEEP(*(.phy_entry))
 + }
 + __phy_entry_end = .;

might have to introduce a helper macro like Linux's VMLINUX_SYMBOL() since 
some targets have a symbol prefix (like an underscore)
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v4] Add 'patman' patch generation, checking and submission script

2012-02-04 Thread Simon Glass
Hi Albert,

On Fri, Feb 3, 2012 at 12:00 PM, Albert ARIBAUD
albert.u.b...@aribaud.net wrote:
 Hi Simon,

 Le 03/02/2012 20:30, Simon Glass a écrit :

 Hi Albert,

 On Fri, Feb 3, 2012 at 11:00 AM, Albert ARIBAUD
 albert.u.b...@aribaud.net  wrote:

 Hi Simon,

 Le 15/01/2012 02:20, Simon Glass a écrit :

 Hi,

 Hmmm patman found a tag in this commit and tried to send it to Fred
 Bloggs. I have added the line below - sorry for the confusion.

 On Sat, Jan 14, 2012 at 5:12 PM, Simon Glasss...@chromium.org    wrote:


 What is this?
 =

 This tool is a Python script which:
 - Creates patch directly from your branch
 - Cleans them up by removing unwanted tags
 - Inserts a cover letter with change lists
 - Runs the patches through checkpatch.pl and its own checks
 - Optionally emails them out to selected people


 It seems to me that this is not specific to u-boot, and as such, has no
 reason to be managed along with U-Boot.

 Why should it not simply have its own project and resources?


 It was created in response to Wolfgang's comments that the sometimes
 low quality of patches on the U-Boot ML chews up a lot of time.

 It is not technically specific to U-Boot (since it could also be used
 with the Linux kernel), but that was my intent when creating it. If
 this goes in then I plan to look at how to automate build testing also
 so we can more easily see that patches are MAKEALL-clean.

 The discussion at the time was here:

 http://lists.denx.de/pipermail/u-boot/2011-October/105862.html

 and the many messages which followed. My patch was in response to this.


 This aptly explains why the tool was created and what it intends to attain,
 and that its use in U-Boot was discussed -- things that I did not question
 in the first place, and still do not.

 What I question is the relevance of tying together the development, source
 code management, release management etc of U-Boot and patman. Is there any
 reason that a release of U-Boot should also be a release of patman, or the
 other way around? Is there any reason even to have similar development
 models for both projects?

I'm not sure / don't mind. At little grand to describe this set of
python scripts as a project.


 As an example, the creation of git was strongly motivated by, and tied to,
 source code management requirements of Linux, but git is not integrated in
 the Linux source tree and its development is fully independent from that of
 Linux.

Yes, I understand your point, just not sure that I have a strong opinion.


 My point is that patman, not being tied to a given project and being
 certainly just as useful to may other git-based projects, it should have its
 own project, be able to evolve at its own pace, etc.

It's use of checkpatch.pl probably reduces the field of play a fair
bit. It was designed for use with U-Boot, but could be used with the
kernel. Perhaps there are others, I'm not sure.

One advantage of having it in the U-Boot source tree tools directory
is that people might find it and use it (at least at the early
stages). If it outgrows its space there due to extra features or more
generic use then it could move perhaps.

Regards,
Simon


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


Re: [U-Boot] [PATCH 2/2] RFC: Let linker create phy array

2012-02-04 Thread Dirk Behme

On 05.02.2012 04:38, Mike Frysinger wrote:

On Saturday 04 February 2012 22:02:46 Troy Kisky wrote:

--- a/drivers/net/phy/broadcom.c
+++ b/drivers/net/phy/broadcom.c

-static struct phy_driver BCM5461S_driver = {
+struct phy_driver BCM5461S_driver __phy_entry = {


why do you have to remove the static ?  that shouldn't affect the section name
that it gets placed into.


--- a/include/phy.h
+++ b/include/phy.h

+extern struct phy_driver __phy_entry_start, __phy_entry_end;


linker symbols should be declared like:
extern char __phy_entry_start[];


--- a/u-boot-common.lds
+++ b/u-boot-common.lds


i'm not seeing this in the u-boot tree ...


u-boot-common.lds is created by patch 1/2 of this series which seems 
to not reached the list (due to the size?). Most probably it waits for 
moderator approval. I got this directly as I'm in CC. See below [1] 
for the essential parts.


Best regards

Dirk


[1]

[PATCH 1/2] RFC: create u-boot-common.lds

This makes adding linker defined tables easier
as far fewer lds files will need to be touched.

Signed-off-by: Troy Kisky troy.ki...@boundarydevices.com

Series based on Stefano's u-boot-imx
Close inspection of

board/mousse/u-boot.lds.ram
arch/blackfin/cpu/u-boot.lds

is warranted.

./MAKEALL -a arm
Boards compiled: 216
Boards with warnings or errors: 71



---
 arch/arm/cpu/arm1136/u-boot.lds  |7 +--
 arch/arm/cpu/arm1176/u-boot.lds  |5 +
 arch/arm/cpu/arm720t/u-boot.lds  |7 +--
 arch/arm/cpu/arm920t/ep93xx/u-boot.lds   |5 +
 arch/arm/cpu/arm920t/u-boot.lds  |7 +--
 arch/arm/cpu/arm925t/u-boot.lds  |7 +--
 arch/arm/cpu/arm926ejs/mx28/u-boot-spl.lds   |5 +
 arch/arm/cpu/arm926ejs/u-boot.lds|7 +--
 arch/arm/cpu/arm946es/u-boot.lds |7 +--
 arch/arm/cpu/arm_intcm/u-boot.lds|7 +--
 arch/arm/cpu/armv7/u-boot.lds|8 ++--
 arch/arm/cpu/ixp/u-boot.lds  |7 +--
 arch/arm/cpu/lh7a40x/u-boot.lds  |7 +--
 arch/arm/cpu/pxa/u-boot.lds  |7 +--
 arch/arm/cpu/s3c44b0/u-boot.lds  |7 +--
 arch/arm/cpu/sa1100/u-boot.lds   |7 +--
 arch/avr32/cpu/u-boot.lds|8 +---
 arch/blackfin/cpu/u-boot.lds |   15 ++-
 arch/nds32/cpu/n1213/u-boot.lds  |5 +
 arch/nios2/cpu/u-boot.lds|8 ++--
 arch/powerpc/cpu/74xx_7xx/u-boot.lds |   11 +--
 arch/powerpc/cpu/mpc512x/u-boot.lds  |   11 +--
 arch/powerpc/cpu/mpc5xx/u-boot.lds   |   11 +--
 arch/powerpc/cpu/mpc5xxx/u-boot-customlayout.lds |   11 +--
 arch/powerpc/cpu/mpc5xxx/u-boot.lds  |   11 +--
 arch/powerpc/cpu/mpc8220/u-boot.lds  |   11 +--
 arch/powerpc/cpu/mpc824x/u-boot.lds  |   11 +--
 arch/powerpc/cpu/mpc8260/u-boot.lds  |   11 +--
 arch/powerpc/cpu/mpc83xx/u-boot.lds  |   11 +--
 arch/powerpc/cpu/mpc85xx/u-boot-nand.lds |   10 +-
 arch/powerpc/cpu/mpc85xx/u-boot.lds  |   10 +-
 arch/powerpc/cpu/mpc86xx/u-boot.lds  |   10 +-
 arch/powerpc/cpu/ppc4xx/u-boot.lds   |   10 +-
 arch/sandbox/cpu/u-boot.lds  |4 +---
 arch/sh/cpu/sh2/u-boot.lds   |9 ++---
 arch/sh/cpu/sh3/u-boot.lds   |   10 +++---
 arch/sh/cpu/sh4/u-boot.lds   |9 ++---
 arch/x86/cpu/u-boot.lds  |6 +-
 board/BuS/EB+MCF-EV123/u-boot.lds|   10 +-
 board/LEOX/elpt860/u-boot.lds|   10 +-
 board/LEOX/elpt860/u-boot.lds.debug  |4 +---
 board/RPXClassic/u-boot.lds  |   11 +--
 board/RPXClassic/u-boot.lds.debug|9 +
 board/RPXlite/u-boot.lds |   11 +--
 board/RPXlite/u-boot.lds.debug   |9 +
 board/RPXlite_dw/u-boot.lds  |   11 +--
 board/RPXlite_dw/u-boot.lds.debug|9 +
 board/RRvision/u-boot.lds|   11 +--
 board/actux1/u-boot.lds  |8 ++--
 board/actux2/u-boot.lds  |8 ++--
 board/actux3/u-boot.lds  |8 ++--
 board/adder/u-boot.lds   |   11 +--
 board/altera/nios2-generic/u-boot.lds|8 ++--
 board/amcc/acadia/u-boot-nand.lds|   11 +--
 board/amcc/bamboo/u-boot-nand.lds|   11 

Re: [U-Boot] Skipping relocation RAM to RAM, esp. on i.MX6?

2012-02-04 Thread Simon Glass
Hi,

On Sat, Feb 4, 2012 at 1:15 AM, Aneesh V ane...@ti.com wrote:
 Hi Dirk,


 On Friday 03 February 2012 12:55 PM, Dirk Behme wrote:

 Hi,

 on i.MX6 devices, e.g. ARM2 or SabreLite, the ROM boot loader copies the
 U-Boot image from the boot device, e.g. the SD card, to the main memory.
 This does mean that U-Boot is started in RAM.

 With this, one might wonder why any relocation RAM - RAM is done anyway
 and if this could be skipped?

 Looking into the details shows that board_init_f() in
 arch/arm/lib/board.c and relocate_code() in arch/arm/cpu/armv7/start.S
 [1] are involved in this.

 In board_init_f() the relocation destination address 'addr' is
 calculated. This is basically at the end of the available RAM (- some
 space for various stuff like TLB tables etc.). At SabreLite this results
 in 0x4FF8D000.

 By the boot loader, the U-Boot is loaded to

 CONFIG_SYS_TEXT_BASE 0x1780

 This results in relocate_code() copying U-Boot from RAM 0x1780 to
 RAM 0x4FF8D000.

 Setting CONFIG_SYS_TEXT_BASE to the relocation destination address
 0x4FF8D000 does avoid the (unnecessary?) copy by

 cmp r0, r6
 moveq r9, #0 /* no relocation. relocation offset(r9) = 0 */
 beq clear_bss /* skip relocation */

 in relocate_code().

 But:

 1) The resulting image still runs without the relocation
 (CONFIG_SYS_TEXT_BASE 0x4FF8D000). But e.g. the U-Boot command line
 doesn't work properly any more. Most probably this is because not only
 the copy is skipped by the 'beq clear_bss', but the whole 'fix .rel.dyn
 relocations' is skipped too.

 2) It's hard to set CONFIG_SYS_TEXT_BASE at compile time to the
 relocation address calculated at runtime in board_init_f() due to the
 amount of #ifdef and runtime calculation done there. So finding a
 generic approach which could easily defined in the config files to avoid
 the relocation seems difficult.


 I haven't really completely read your mail. But here is an
 implementation I had provided long time back for ARM. But Wolfgang
 didn't want to take it. You can see the patch and the following
 discussion in this thread:

 http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/96352

From your patch Aneesh I evolved something that I still use - it deals
with the case where malloc cannot fit below the text area.

I find any sort of messing with the ICE startup a pain - although I
have often been able to script it. But for me I need to attach the
device tree to the binary and a few other things so I might as well
disable relocation at the same time. It also allows me to debug
seamlessly in board_init_f() as well as afterwards.

I will send a patch.

It would be good to get something in mainline despite the
protestations, if only to avoid all the work that people have to do to
figure out this problem.

Regards,
Simon


 br,
 Aneesh

 ___
 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 v4 1/5] net: fec_mxc: add 1000 Mbps selection

2012-02-04 Thread Dirk Behme

On 03.02.2012 01:22, Troy Kisky wrote:

Define CONFIG_FEC_QUIRK_ENET_MAC and add to
board files mx6qarm2 and mx6qsabrelite.

Signed-off-by: Troy Kiskytroy.ki...@boundarydevices.com
Acked-by: Dirk Behmedirk.be...@de.bosch.com
---


...

In case someone wants to test this on a mx6qarm2 or any other 
mx51/53/28 board: I pushed this whole v4 patch series to a test branch 
'u-boot-imx-net-test.git'


https://github.com/dirkbehme/u-boot-imx6/commits/u-boot-imx-net-test.git

based on the recent u-boot-imx.git [1].

Best regards

Dirk

[1]

http://git.denx.de/?p=u-boot/u-boot-imx.git;a=summary
i.mx: i.mx5: update imx_get_mac_from_fuse function
8e3b8e8bb6845263d048f4f79c1923a8d4b31b55
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] arm: Add option to disable code relocation

2012-02-04 Thread Simon Glass
This permits disabling the code relation in U-Boot which is useful when
debugging with an ICE.

To use it define CONFIG_SYS_SKIP_ARM_RELOCATION in your board.

Signed-off-by: Simon Glass s...@chromium.org
---
 arch/arm/config.mk |2 ++
 arch/arm/cpu/armv7/start.S |3 +--
 arch/arm/include/asm/global_data.h |3 +++
 arch/arm/lib/board.c   |   10 ++
 4 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/arch/arm/config.mk b/arch/arm/config.mk
index 45f9dca..46b52af 100644
--- a/arch/arm/config.mk
+++ b/arch/arm/config.mk
@@ -79,5 +79,7 @@ endif
 
 # needed for relocation
 ifndef CONFIG_NAND_SPL
+ifndef CONFIG_SYS_SKIP_ARM_RELOCATION
 LDFLAGS_u-boot += -pie
 endif
+endif
diff --git a/arch/arm/cpu/armv7/start.S b/arch/arm/cpu/armv7/start.S
index ef08a55..82eac7c 100644
--- a/arch/arm/cpu/armv7/start.S
+++ b/arch/arm/cpu/armv7/start.S
@@ -183,8 +183,7 @@ stack_setup:
mov sp, r4
 
adr r0, _start
-   cmp r0, r6
-   moveq   r9, #0  /* no relocation. relocation offset(r9) = 0 */
+   subsr9, r6, r0  /* r9 - relocation offset */
beq clear_bss   /* skip relocation */
mov r1, r6  /* r1 - scratch for copy_loop */
ldr r3, _image_copy_end_ofs
diff --git a/arch/arm/include/asm/global_data.h 
b/arch/arm/include/asm/global_data.h
index c3ff789..23a6077 100644
--- a/arch/arm/include/asm/global_data.h
+++ b/arch/arm/include/asm/global_data.h
@@ -77,6 +77,9 @@ typedef   struct  global_data {
unsigned long   tlb_addr;
 #endif
const void  *fdt_blob;  /* Our device tree, NULL if none */
+#ifdef CONFIG_SYS_SKIP_ARM_RELOCATION
+   ulong   malloc_end; /* End of malloc region (addr + 1) */
+#endif
void**jt;   /* jump table */
charenv_buf[32];/* buffer for getenv() before reloc. */
 #if defined(CONFIG_POST) || defined(CONFIG_LOGBUFFER)
diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c
index 3d78274..81293c3 100644
--- a/arch/arm/lib/board.c
+++ b/arch/arm/lib/board.c
@@ -355,6 +355,7 @@ void board_init_f(ulong bootflag)
 #endif /* CONFIG_FB_ADDR */
 #endif /* CONFIG_LCD */
 
+#ifndef CONFIG_SYS_SKIP_ARM_RELOCATION
/*
 * reserve memory for U-Boot code, data  bss
 * round down to next 4 kB limit
@@ -363,6 +364,7 @@ void board_init_f(ulong bootflag)
addr = ~(4096 - 1);
 
debug(Reserving %ldk for U-Boot at: %08lx\n, gd-mon_len  10, addr);
+#endif
 
 #ifndef CONFIG_SPL_BUILD
/*
@@ -419,6 +421,10 @@ void board_init_f(ulong bootflag)
dram_init_banksize();
display_dram_config();  /* and display it */
 
+#ifdef CONFIG_SYS_SKIP_ARM_RELOCATION
+   gd-malloc_end = addr;
+   addr = _TEXT_BASE;
+#endif
gd-relocaddr = addr;
gd-start_addr_sp = addr_sp;
gd-reloc_off = addr - _TEXT_BASE;
@@ -478,7 +484,11 @@ void board_init_r(gd_t *id, ulong dest_addr)
 #endif
 
/* The Malloc area is immediately below the monitor copy in DRAM */
+#ifdef CONFIG_SYS_SKIP_ARM_RELOCATION
+   malloc_start = gd-malloc_end - TOTAL_MALLOC_LEN;
+#else
malloc_start = dest_addr - TOTAL_MALLOC_LEN;
+#endif
mem_malloc_init (malloc_start, TOTAL_MALLOC_LEN);
 
 #if !defined(CONFIG_SYS_NO_FLASH)
-- 
1.7.7.3

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


Re: [U-Boot] [PATCH] arm: Add option to disable code relocation

2012-02-04 Thread Mike Frysinger
On Sunday 05 February 2012 01:44:19 Simon Glass wrote:
 This permits disabling the code relation in U-Boot which is useful when
 debugging with an ICE.
 
 To use it define CONFIG_SYS_SKIP_ARM_RELOCATION in your board.

any reason for ARM in there ?
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot