Re: [U-Boot] [PATCH 3/8] boottime: Add core boottime measurement support

2012-11-27 Thread Lee Jones
Hi Simon,

  On Tue, Nov 20, 2012 at 6:33 AM, Lee Jones lee.jo...@linaro.org wrote:
   Boottime is a tool which can be used for full system booting time
   measurement. Bootloader boot time is passed to the kernel component
   though ATAGS. The kernel-side driver then uses this information to
   provide full system boot time diagnostics though debugfs.
  
   Based heavily on the original driver by Jonas Aaberg.
  
   Signed-off-by: Lee Jones lee.jo...@linaro.org
 
  Did you take a look at bootstage, which seems at least on the surface
  to provide a similar mechanism? This passes the information to the
  kernel through a device tree, or worse case a 'stash area'.
 
  I didn't see this before.
 
  I don't see the kernel counterpart, did it make it upstream?
 
 It was sent upstream, just for a feeler, but before U-Boot support was
 mainlined and before we had a way to deal with the non-fdt case. That
 is now implemented and in mainline, although it has not yet gone out
 in a release (should be Jan 2013). So I was planning to address that
 again in the kernel at some point.

Well if this does the same job as the boottime implementation, I'll
scrap my efforts to upstream it.

By the way, if Wolfgang didn't want these tracepoints in DT, then
how was your implementations upstreamed into u-boot?

Kind regards,
Lee

-- 
Lee Jones
Linaro ST-Ericsson Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] gpio: remove duplicate function signature

2012-11-27 Thread Nikita Kiryanov
gpio_request() appears twice in asm-generic/gpio.h
Remove one of the definitions.

Signed-off-by: Nikita Kiryanov nik...@compulab.co.il
---
 include/asm-generic/gpio.h |   17 -
 1 file changed, 4 insertions(+), 13 deletions(-)

diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h
index 23c9649..bfedbe4 100644
--- a/include/asm-generic/gpio.h
+++ b/include/asm-generic/gpio.h
@@ -42,10 +42,11 @@
  */
 
 /**
- * Request ownership of a GPIO.
+ * Request a gpio. This should be called before any of the other functions
+ * are used on this gpio.
  *
- * @param gpio GPIO number
- * @param labelName given to the GPIO
+ * @param gp   GPIO number
+ * @param labelUser label for this GPIO
  * @return 0 if ok, -1 on error
  */
 int gpio_request(unsigned gpio, const char *label);
@@ -93,14 +94,4 @@ int gpio_get_value(unsigned gpio);
  * @return 0 if ok, -1 on error
  */
 int gpio_set_value(unsigned gpio, int value);
-
-/**
- * Request a gpio. This should be called before any of the other functions
- * are used on this gpio.
- *
- * @param gp   GPIO number
- * @param labelUser label for this GPIO
- * @return 0 if ok, -1 on error
- */
-int gpio_request(unsigned gpio, const char *label);
 #endif /* _ASM_GENERIC_GPIO_H_ */
-- 
1.7.10.4

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


[U-Boot] [PATCH] gpio: add gpio_is_valid() to omap_gpio API

2012-11-27 Thread Nikita Kiryanov
Add gpio_is_valid() to omap_gpio API

Signed-off-by: Nikita Kiryanov nik...@compulab.co.il
---
 arch/arm/include/asm/omap_gpio.h |8 
 drivers/gpio/omap_gpio.c |4 ++--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/arch/arm/include/asm/omap_gpio.h b/arch/arm/include/asm/omap_gpio.h
index 516cc42..be94770 100644
--- a/arch/arm/include/asm/omap_gpio.h
+++ b/arch/arm/include/asm/omap_gpio.h
@@ -49,4 +49,12 @@ extern const struct gpio_bank *const omap_gpio_bank;
 
 #define METHOD_GPIO_24XX   4
 
+/**
+ * Check if gpio is valid.
+ *
+ * @param gpio GPIO number
+ * @return 0 if ok, -1 on error
+ */
+int gpio_is_valid(int gpio);
+
 #endif /* _GPIO_H_ */
diff --git a/drivers/gpio/omap_gpio.c b/drivers/gpio/omap_gpio.c
index fc89f2a..6e5b5f7 100644
--- a/drivers/gpio/omap_gpio.c
+++ b/drivers/gpio/omap_gpio.c
@@ -53,7 +53,7 @@ static inline int get_gpio_index(int gpio)
return gpio  0x1f;
 }
 
-static inline int gpio_valid(int gpio)
+int gpio_is_valid(int gpio)
 {
if (gpio  0)
return -1;
@@ -64,7 +64,7 @@ static inline int gpio_valid(int gpio)
 
 static int check_gpio(int gpio)
 {
-   if (gpio_valid(gpio)  0) {
+   if (gpio_is_valid(gpio)  0) {
printf(ERROR : check_gpio: invalid GPIO %d\n, gpio);
return -1;
}
-- 
1.7.10.4

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


[U-Boot] [PATCH] powerpc/p4080ds: fix PCI-e x8 link training down failure

2012-11-27 Thread Yuanquan Chen
Due to SerDes configuration error, if we set the PCI-e controller link width
as x8 in RCW and add a narrower width(such as x4, x2 or x1) PCI-e device to
PCI-e slot, it fails to train down to the PCI-e device's link width. According
to p4080ds errata PCIe-A003, we reset the PCI-e controller link width to x4 in
u-boot. Then it can train down to x2 or x1 width to make the PCI-e link between
RC and EP.

Signed-off-by: Yuanquan Chen b41...@freescale.com
---
 arch/powerpc/cpu/mpc85xx/cmd_errata.c |3 +++
 arch/powerpc/include/asm/config_mpc85xx.h |1 +
 drivers/pci/fsl_pci_init.c|   22 ++
 3 files changed, 26 insertions(+)

diff --git a/arch/powerpc/cpu/mpc85xx/cmd_errata.c 
b/arch/powerpc/cpu/mpc85xx/cmd_errata.c
index 2be192d..c938313 100644
--- a/arch/powerpc/cpu/mpc85xx/cmd_errata.c
+++ b/arch/powerpc/cpu/mpc85xx/cmd_errata.c
@@ -137,6 +137,9 @@ static int do_errata(cmd_tbl_t *cmdtp, int flag, int argc, 
char * const argv[])
 #ifdef CONFIG_SYS_FSL_ERRATUM_A_004934
puts(Work-around for Erratum A004934 enabled\n);
 #endif
+#ifdef CONFIG_SYS_P4080_ERRATUM_PCIE_A003
+   puts(Work-around for Erratum PCIe-A003 enabled\n);
+#endif
return 0;
 }
 
diff --git a/arch/powerpc/include/asm/config_mpc85xx.h 
b/arch/powerpc/include/asm/config_mpc85xx.h
index 03baaee..682b65d 100644
--- a/arch/powerpc/include/asm/config_mpc85xx.h
+++ b/arch/powerpc/include/asm/config_mpc85xx.h
@@ -417,6 +417,7 @@
 #define CONFIG_SYS_FSL_ERRATUM_A004510_SVR_REV 0x20
 #define CONFIG_SYS_FSL_CORENET_SNOOPVEC_COREONLY 0xff00
 #define CONFIG_SYS_FSL_ERRATUM_SRIO_A004034
+#define CONFIG_SYS_P4080_ERRATUM_PCIE_A003
 
 #elif defined(CONFIG_PPC_P5020) /* also supports P5010 */
 #define CONFIG_SYS_PPC64   /* 64-bit core */
diff --git a/drivers/pci/fsl_pci_init.c b/drivers/pci/fsl_pci_init.c
index 48ae163..77ac1f7 100644
--- a/drivers/pci/fsl_pci_init.c
+++ b/drivers/pci/fsl_pci_init.c
@@ -470,6 +470,28 @@ void fsl_pci_init(struct pci_controller *hose, struct 
fsl_pci_info *pci_info)
}
 #endif
 
+#ifdef CONFIG_SYS_P4080_ERRATUM_PCIE_A003
+   if (enabled == 0) {
+   serdes_corenet_t *srds_regs = (void 
*)CONFIG_SYS_FSL_CORENET_SERDES_ADDR;
+   temp32 = in_be32(srds_regs-srdspccr0);
+
+   if ((temp32  28) == 3) {
+   int i;
+
+   out_be32(srds_regs-srdspccr0, 2  28);
+   setbits_be32(pci-pdb_stat, 0x0800);
+   in_be32(pci-pdb_stat);
+   udelay(100);
+   clrbits_be32(pci-pdb_stat, 0x0800);
+   asm(sync;isync);
+   for (i=0; i  100  ltssm  PCI_LTSSM_L0; i++) 
{
+   pci_hose_read_config_word(hose, dev, 
PCI_LTSSM, ltssm);
+   udelay(1000);
+   }
+   enabled = ltssm = PCI_LTSSM_L0;
+   }
+   }
+#endif
if (!enabled) {
/* Let the user know there's no PCIe link */
printf(no link, regs @ 0x%lx\n, pci_info-regs);
-- 
1.7.9.5


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


[U-Boot] Reg Bootstrapping on x86-64 for tizen

2012-11-27 Thread manohar . betham

Dear All,
 
I am Manohar ,have compiled the u-boot on x86 64 bit machine using coreboot-x86.
 
Please help me / send me the procedure of bootstrapping steps of it for Tizen 
kernel.
 
Thank you!
Best Regards,
Manohar
8790215215___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] RFD: ARM: enable HYP mode on OMAP5

2012-11-27 Thread Ian Molton

Hi folks,

My colleague Clemens Fischer, and I were able to bring up the OMAP5 CPU 
in HYP mode with the following patch to u-boot.


Obviously the patch is not production grade yet, but we feel that it 
would be of use to discuss how best to integrate the code into u-boot.


The code wakes up CPU1 before putting CPU0 into HYP mode, and CPU1 goes 
back to sleep once it has entered HYP mode itself.


With this patch, a near-unmodified mainline linux kernel (patched for 
ARM KVM only) will boot up with HYP mode enabled.


Many thanks to Marc and Christoffer for their help getting KVM up and 
running!


Comments are welcome.

-Ian

From 089b4bfb2965b3146a20aab0abd9337ecce482e7 Mon Sep 17 00:00:00 2001
From: Ian Molton ian.mol...@collabora.co.uk
Date: Thu, 1 Nov 2012 16:23:03 +
Subject: [PATCH 1/3] Put both OMAP5 cores into HYP mode

---
 arch/arm/lib/bootm.c |   75 ++
 1 file changed, 75 insertions(+)

diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c
index 802e833..bddbff3 100644
--- a/arch/arm/lib/bootm.c
+++ b/arch/arm/lib/bootm.c
@@ -4,6 +4,8 @@
  * Marius Groeger mgroe...@sysgo.de
  *
  * Copyright (C) 2001  Erik Mouw (j.a.k.m...@its.tudelft.nl)
+ * HYP entry (c) 2012  Ian Molton ian.mol...@codethink.co.uk
+ *and  Clemens Fischer clemens.fisc...@h-da.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
@@ -30,6 +32,36 @@
 #include libfdt.h
 #include fdt_support.h
 
+/* A small stack to allow us to safely call the OMAP5 monitor API, in order to
+ * enable HYP mode. This must be accessible in HYP mode.
+ */
+unsigned int hyp_primary_stack[11];
+
+/*
+ * function called by cpu 1 after wakeup
+ */
+extern void __hyp_init_sec(void);
+
+asm (
+	.pushsection .text\n
+	.global __hyp_init_sec\n
+	__hyp_init_sec:\n
+		ldr r12, =0x102\n
+		mov r0, pc\n
+		smc 0x1\n
+		ldr r1, =0x48281804\n // AUX_CORE_BOOT_1
+		mov r2, #0\n
+		str r2, [r1]\n
+		isb\n
+		dsb\n
+		1: wfe\n
+		ldr r2, [r1]\n
+		cmp r2, #0\n
+		movne pc, r2\n
+		b 1b\n
+	.popsection\n
+);
+
 DECLARE_GLOBAL_DATA_PTR;
 
 #if defined (CONFIG_SETUP_MEMORY_TAGS) || \
@@ -93,6 +125,45 @@ static void announce_and_cleanup(void)
 	cleanup_before_linux();
 }
 
+/*
+ * Enable HYP mode on the OMAP5 CPU
+ *
+ * FIXME: this needs to test to make sure its running on an OMAP5
+ *
+ * We wake up CPU1 at __hyp_init_sec which allows us to put it into HYP
+ * mode.
+ *
+ * CPU1 then clears AUX_CORE_BOOT_0 and enters WFE, until the kernel wakes it.
+ *
+ * In order to avoid CPU1 continuing execution on just about any event, we
+ * wait for AUX_CORE_BOOT_0 to contain a non-zero address, at which point
+ * we continue execution at that address.
+ *
+ */
+
+void hyp_enable(void) {
+	 /*Wake up CPU1 and enable HYP on CPU0. */
+	asm(
+		ldr r1, =0x48281800\n // AUX_CORE_BOOT_1
+		ldr r2, =__hyp_init_sec\n
+		str r2, [r1, #4]\n
+		mov r2, #0x200\n
+		str r2, [r1]\n// AUX_CORE_BOOT_0
+		isb\n
+		dmb\n
+		dsb\n
+		sev\n // Wake CPU1
+		ldr r1,=hyp_primary_stack\n
+		ldr r12, =0x102\n
+		mov r0, pc\n
+		stm   r1, {r4-r14}\n
+		smc 0x1\n // CPU0 - HYP mode
+		ldr r1,=hyp_primary_stack\n
+		ldm   r1, {r4-r14}\n
+		:::r0, r1, r2, r3, cc, memory
+	);
+};
+
 int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images)
 {
 	bd_t	*bd = gd-bd;
@@ -152,6 +223,8 @@ int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images)
 
 	announce_and_cleanup();
 
+	hyp_enable();
+
 	kernel_entry(0, machid, bd-bi_boot_params);
 	/* does not return */
 
@@ -210,6 +283,8 @@ static int bootm_linux_fdt(int machid, bootm_headers_t *images)
 
 	announce_and_cleanup();
 
+	hyp_enable();
+
 	kernel_entry(0, machid, *of_flat_tree);
 	/* does not return */
 
-- 
1.7.10.4

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


[U-Boot] [PATCH v4 0/2] Factorize ARM startup code as mush as possible.

2012-11-27 Thread Albert ARIBAUD
The goal of this series is to scrub the start.S files
which have proliferated across arch/arm and eliminate
code redundancy.

This series only factorizes the C runtime framework,
that is, the assembly code responsible for setting up
the C environments needed by board_init_*() and
relocate_code().

Further factorization is possible: relocate_code() can
be moved out and possibly rewritten in C now that it
has plain C function semantics; exception handlers
should also be pretty much cpu-independent.

Also, SPL currently makes board_init_f() perform all
of the setting up, including BSS clearing and chain-
loading. This could be streamlined by only putting
basic inits in board_init_f(), letting crt0 do the
BSS initialization and chain-loading U-Boot from
inside board_init_r().

Eventually, start.S files should disappear or contain
CPU-specific code only.

The new C runtime setup sequence has been validated step by
step on targets versatileqemu using gcc version 4.2.2 from
the ELDK4.2 toolchain, and wireless_space using gcc version
4.7.2 (Ubuntu/Linaro 4.7.2-1ubuntu1).

The whole changes have been build-tested across all ARM
targets using MAKEALL -a arm.

Changes in v4:
- fixed bhs into blo in BSS init loop
- switched from explicit literals to '=target' notation
- fixed location of GD in initial environment
- stopped SPL boot sequence at calling board_init_f

Changes in v3:
- various clarifications and typo fixes
- fixed wrong LED calls conditional
- fixed open comment eating some code
- fixed code overrun in SPL case

Changes in v2:
- moved description from cover letter to patch commit msg
- added note about tests in the cover letter
- fixed baords with CONFIG_SPL but not CONFIG_SPL_STACK
- removed useless includes in arm926ejs and arm925t

Albert ARIBAUD (2):
  arm: move C runtime setup code in crt0.S
  arm: remove useless code in start.S files

 arch/arm/cpu/arm1136/start.S  |   71 +++-
 arch/arm/cpu/arm1176/start.S  |   62 ++-
 arch/arm/cpu/arm720t/start.S  |   53 ++---
 arch/arm/cpu/arm920t/start.S  |   61 ++
 arch/arm/cpu/arm925t/start.S  |   65 ++-
 arch/arm/cpu/arm926ejs/start.S|   86 ++
 arch/arm/cpu/arm946es/start.S |   56 ++
 arch/arm/cpu/arm_intcm/start.S|   63 ++-
 arch/arm/cpu/armv7/start.S|   58 +++---
 arch/arm/cpu/ixp/start.S  |   55 ++---
 arch/arm/cpu/pxa/start.S  |   63 ++-
 arch/arm/cpu/s3c44b0/start.S  |   55 ++---
 arch/arm/cpu/sa1100/start.S   |   50 ++---
 arch/arm/lib/Makefile |2 +
 arch/arm/lib/board.c  |   11 --
 arch/arm/lib/crt0.S   |  173 +
 include/common.h  |2 +-
 include/configs/socfpga_cyclone5.h|2 +-
 lib/asm-offsets.c |   10 ++
 nand_spl/board/freescale/mx31pdk/Makefile |6 +-
 nand_spl/board/karo/tx25/Makefile |6 +-
 21 files changed, 322 insertions(+), 688 deletions(-)
 create mode 100644 arch/arm/lib/crt0.S

-- 
1.7.10.4

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


[U-Boot] [PATCH v4 1/2] arm: move C runtime setup code in crt0.S

2012-11-27 Thread Albert ARIBAUD
Move all the C runtime setup code from every start.S
in arch/arm into arch/arm/lib/crt0.S. This covers
the code sequence from setting up the initial stack
to calling into board_init_r().

Also, rewrite the C runtime setup and make functions
board_init_*() and relocate_code() behave according to
normal C semantics (no jumping across the C stack any
more, etc).

Some SPL targets had to be touched because they use
start.S explicitly or for some reason; the relevant
maintainers and custodians are cc:ed.

Signed-off-by: Albert ARIBAUD albert.u.b...@aribaud.net
---
Changes in v4:
- fixed bhs into blo in BSS init loop
- switched from explicit literals to '=target' notation
- fixed location of GD in initial environment
- stopped SPL boot sequence at calling board_init_f

Changes in v3:
- various clarifications and typo fixes
- fixed wrong LED calls conditional
- fixed open comment eating some code
- fixed code overrun in SPL case

Changes in v2:
- moved description from cover letter to patch commit msg
- added note about tests in the cover letter
- fixed baords with CONFIG_SPL but not CONFIG_SPL_STACK

 arch/arm/cpu/arm1136/start.S  |   71 +++-
 arch/arm/cpu/arm1176/start.S  |   62 ++-
 arch/arm/cpu/arm720t/start.S  |   53 ++---
 arch/arm/cpu/arm920t/start.S  |   61 ++
 arch/arm/cpu/arm925t/start.S  |   61 ++
 arch/arm/cpu/arm926ejs/start.S|   80 ++---
 arch/arm/cpu/arm946es/start.S |   56 ++
 arch/arm/cpu/arm_intcm/start.S|   63 ++-
 arch/arm/cpu/armv7/start.S|   58 +++---
 arch/arm/cpu/ixp/start.S  |   55 ++---
 arch/arm/cpu/pxa/start.S  |   63 ++-
 arch/arm/cpu/s3c44b0/start.S  |   55 ++---
 arch/arm/cpu/sa1100/start.S   |   50 ++---
 arch/arm/lib/Makefile |2 +
 arch/arm/lib/board.c  |   11 --
 arch/arm/lib/crt0.S   |  173 +
 include/common.h  |2 +-
 include/configs/socfpga_cyclone5.h|2 +-
 lib/asm-offsets.c |   10 ++
 nand_spl/board/freescale/mx31pdk/Makefile |6 +-
 nand_spl/board/karo/tx25/Makefile |6 +-
 21 files changed, 322 insertions(+), 678 deletions(-)
 create mode 100644 arch/arm/lib/crt0.S

diff --git a/arch/arm/cpu/arm1136/start.S b/arch/arm/cpu/arm1136/start.S
index 5d3b4c2..a067b8a 100644
--- a/arch/arm/cpu/arm1136/start.S
+++ b/arch/arm/cpu/arm1136/start.S
@@ -165,13 +165,7 @@ next:
bl  cpu_init_crit
 #endif
 
-/* Set stackpointer in internal RAM to call board_init_f */
-call_board_init_f:
-   ldr sp, =(CONFIG_SYS_INIT_SP_ADDR)
-   bic sp, sp, #7 /* 8-byte alignment for ABI compliance */
-   ldr r0,=0x
-
-   bl  board_init_f
+   bl  _main
 
 
/*--*/
 
@@ -188,14 +182,10 @@ relocate_code:
mov r5, r1  /* save addr of gd */
mov r6, r2  /* save addr of destination */
 
-   /* Set up the stack */
-stack_setup:
-   mov sp, r4
-
adr r0, _start
cmp r0, r6
moveq   r9, #0  /* no relocation. relocation offset(r9) = 0 */
-   beq clear_bss   /* skip relocation */
+   beq relocate_done   /* skip relocation */
mov r1, r6  /* r1 - scratch for copy_loop */
ldr r3, _image_copy_end_ofs
add r2, r0, r3  /* r2 - source end address */
@@ -245,7 +235,15 @@ fixnext:
add r2, r2, #8  /* each rel.dyn entry is 8 bytes */
cmp r2, r3
blo fixloop
-   b   clear_bss
+   bx  lr
+
+#endif
+
+relocate_done:
+
+   bx  lr
+
+#ifndef CONFIG_SPL_BUILD
 
 _rel_dyn_start_ofs:
.word __rel_dyn_start - _start
@@ -253,54 +251,13 @@ _rel_dyn_end_ofs:
.word __rel_dyn_end - _start
 _dynsym_start_ofs:
.word __dynsym_start - _start
-#endif
 
-clear_bss:
-#ifdef CONFIG_SPL_BUILD
-   /* No relocation for SPL */
-   ldr r0, =__bss_start
-   ldr r1, =__bss_end__
-#else
-   ldr r0, _bss_start_ofs
-   ldr r1, _bss_end_ofs
-   mov r4, r6  /* reloc addr */
-   add r0, r0, r4
-   add r1, r1, r4
 #endif
-   mov r2, #0x /* clear*/
-
-clbss_l:cmpr0, r1  /* clear loop... */
-   bhs clbss_e /* if reached end of bss, exit */
-   str r2, [r0]
-   add r0, r0, #4
-   b   clbss_l
-clbss_e:
 
-/*
- * We are done. Do not return, instead branch to second part of board
- * initialization, now running from RAM.

[U-Boot] [PATCH v4 2/2] arm: remove useless code in start.S files

2012-11-27 Thread Albert ARIBAUD
Remove code such as unneeded includes or labels.
These removals have no functional effect.

Signed-off-by: Albert ARIBAUD albert.u.b...@aribaud.net
---
Changes in v2:
- removed useless includes in arm926ejs and arm925t

 arch/arm/cpu/arm925t/start.S   |4 
 arch/arm/cpu/arm926ejs/start.S |6 --
 2 files changed, 10 deletions(-)

diff --git a/arch/arm/cpu/arm925t/start.S b/arch/arm/cpu/arm925t/start.S
index 82f5b8b..e8d6d71 100644
--- a/arch/arm/cpu/arm925t/start.S
+++ b/arch/arm/cpu/arm925t/start.S
@@ -34,10 +34,6 @@
 #include config.h
 #include version.h
 
-#if defined(CONFIG_OMAP1510)
-#include ./configs/omap1510.h
-#endif
-
 /*
  *
  *
diff --git a/arch/arm/cpu/arm926ejs/start.S b/arch/arm/cpu/arm926ejs/start.S
index 3cdecd9..66a8b65 100644
--- a/arch/arm/cpu/arm926ejs/start.S
+++ b/arch/arm/cpu/arm926ejs/start.S
@@ -36,12 +36,6 @@
 #include common.h
 #include version.h
 
-#if defined(CONFIG_OMAP1610)
-#include ./configs/omap1510.h
-#elif defined(CONFIG_OMAP730)
-#include ./configs/omap730.h
-#endif
-
 /*
  *
  *
-- 
1.7.10.4

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


[U-Boot] [PATCH v2 1/5] imx iim: Homogenize and fix register definitions

2012-11-27 Thread Benoît Thébaudeau
Homogenize prg_p naming (the reference manuals are not always self-consistent
for that). Add missing registers. Fix some registers.

Signed-off-by: Benoît Thébaudeau benoit.thebaud...@advansee.com
Cc: Stefano Babic sba...@denx.de
Cc: Wolfgang Denk w...@denx.de
---
This patch supersedes http://patchwork.ozlabs.org/patch/177242/ .
Changes for v2:
 - Rebase against latest master.

 .../arch/arm/include/asm/arch-mx25/imx-regs.h |8 ++--
 .../arch/arm/include/asm/arch-mx27/imx-regs.h |2 +-
 .../arch/arm/include/asm/arch-mx31/imx-regs.h |9 +++--
 .../arch/arm/include/asm/arch-mx35/imx-regs.h |7 ++-
 .../arch/arm/include/asm/arch-mx5/imx-regs.h  |6 +-
 5 files changed, 25 insertions(+), 7 deletions(-)

diff --git u-boot-178d0cc.orig/arch/arm/include/asm/arch-mx25/imx-regs.h 
u-boot-178d0cc/arch/arm/include/asm/arch-mx25/imx-regs.h
index 53aafe3..1b71168 100644
--- u-boot-178d0cc.orig/arch/arm/include/asm/arch-mx25/imx-regs.h
+++ u-boot-178d0cc/arch/arm/include/asm/arch-mx25/imx-regs.h
@@ -117,8 +117,12 @@ struct iim_regs {
u32 iim_sdat;
u32 iim_prev;
u32 iim_srev;
-   u32 iim_prog_p;
-   u32 res1[0x1f5];
+   u32 iim_prg_p;
+   u32 iim_scs0;
+   u32 iim_scs1;
+   u32 iim_scs2;
+   u32 iim_scs3;
+   u32 res1[0x1f1];
struct fuse_bank {
u32 fuse_regs[0x20];
u32 fuse_rsvd[0xe0];
diff --git u-boot-178d0cc.orig/arch/arm/include/asm/arch-mx27/imx-regs.h 
u-boot-178d0cc/arch/arm/include/asm/arch-mx27/imx-regs.h
index 2f6c823..aee058f 100644
--- u-boot-178d0cc.orig/arch/arm/include/asm/arch-mx27/imx-regs.h
+++ u-boot-178d0cc/arch/arm/include/asm/arch-mx27/imx-regs.h
@@ -176,7 +176,7 @@ struct iim_regs {
u32 iim_sdat;
u32 iim_prev;
u32 iim_srev;
-   u32 iim_prog_p;
+   u32 iim_prg_p;
u32 iim_scs0;
u32 iim_scs1;
u32 iim_scs2;
diff --git u-boot-178d0cc.orig/arch/arm/include/asm/arch-mx31/imx-regs.h 
u-boot-178d0cc/arch/arm/include/asm/arch-mx31/imx-regs.h
index 8fd3d08..e799f37 100644
--- u-boot-178d0cc.orig/arch/arm/include/asm/arch-mx31/imx-regs.h
+++ u-boot-178d0cc/arch/arm/include/asm/arch-mx31/imx-regs.h
@@ -79,7 +79,7 @@ struct wdog_regs {
u16 wrsr;   /* Reset Status */
 };
 
-/* IIM Control Registers */
+/* IIM control registers */
 struct iim_regs {
u32 iim_stat;
u32 iim_statm;
@@ -91,11 +91,16 @@ struct iim_regs {
u32 iim_sdat;
u32 iim_prev;
u32 iim_srev;
-   u32 iim_prog_p;
+   u32 iim_prg_p;
u32 iim_scs0;
u32 iim_scs1;
u32 iim_scs2;
u32 iim_scs3;
+   u32 res[0x1f1];
+   struct fuse_bank {
+   u32 fuse_regs[0x20];
+   u32 fuse_rsvd[0xe0];
+   } bank[3];
 };
 
 struct iomuxc_regs {
diff --git u-boot-178d0cc.orig/arch/arm/include/asm/arch-mx35/imx-regs.h 
u-boot-178d0cc/arch/arm/include/asm/arch-mx35/imx-regs.h
index 7b09809..6161784 100644
--- u-boot-178d0cc.orig/arch/arm/include/asm/arch-mx35/imx-regs.h
+++ u-boot-178d0cc/arch/arm/include/asm/arch-mx35/imx-regs.h
@@ -258,11 +258,16 @@ struct iim_regs {
u32 iim_sdat;
u32 iim_prev;
u32 iim_srev;
-   u32 iim_prog_p;
+   u32 iim_prg_p;
u32 iim_scs0;
u32 iim_scs1;
u32 iim_scs2;
u32 iim_scs3;
+   u32 res1[0x1f1];
+   struct fuse_bank {
+   u32 fuse_regs[0x20];
+   u32 fuse_rsvd[0xe0];
+   } bank[3];
 };
 
 /* General Purpose Timer (GPT) registers */
diff --git u-boot-178d0cc.orig/arch/arm/include/asm/arch-mx5/imx-regs.h 
u-boot-178d0cc/arch/arm/include/asm/arch-mx5/imx-regs.h
index 1d060fd..8f0a7ec 100644
--- u-boot-178d0cc.orig/arch/arm/include/asm/arch-mx5/imx-regs.h
+++ u-boot-178d0cc/arch/arm/include/asm/arch-mx5/imx-regs.h
@@ -508,7 +508,7 @@ struct iim_regs {
u32 sdat;
u32 prev;
u32 srev;
-   u32 preg_p;
+   u32 prg_p;
u32 scs0;
u32 scs1;
u32 scs2;
@@ -517,7 +517,11 @@ struct iim_regs {
struct fuse_bank {
u32 fuse_regs[0x20];
u32 fuse_rsvd[0xe0];
+#if defined(CONFIG_MX51)
} bank[4];
+#elif defined(CONFIG_MX53)
+   } bank[5];
+#endif
 };
 
 struct fuse_bank0_regs {
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 2/5] imx iim: Add useful fuse definitions

2012-11-27 Thread Benoît Thébaudeau
Signed-off-by: Benoît Thébaudeau benoit.thebaud...@advansee.com
Cc: Stefano Babic sba...@denx.de
Cc: Wolfgang Denk w...@denx.de
---
This patch supersedes http://patchwork.ozlabs.org/patch/177243/ .
Changes for v2:
 - Rebase against latest master.

 .../arch/arm/include/asm/arch-mx25/imx-regs.h  |   11 ++-
 .../arch/arm/include/asm/arch-mx31/imx-regs.h  |   12 
 .../arch/arm/include/asm/arch-mx35/imx-regs.h  |   12 
 .../arch/arm/include/asm/arch-mx5/imx-regs.h   |   16 +++-
 4 files changed, 49 insertions(+), 2 deletions(-)

diff --git u-boot-178d0cc.orig/arch/arm/include/asm/arch-mx25/imx-regs.h 
u-boot-178d0cc/arch/arm/include/asm/arch-mx25/imx-regs.h
index 1b71168..9037ee5 100644
--- u-boot-178d0cc.orig/arch/arm/include/asm/arch-mx25/imx-regs.h
+++ u-boot-178d0cc/arch/arm/include/asm/arch-mx25/imx-regs.h
@@ -130,10 +130,19 @@ struct iim_regs {
 };
 
 struct fuse_bank0_regs {
-   u32 fuse0_25[0x1a];
+   u32 fuse0_7[8];
+   u32 uid[8];
+   u32 fuse16_25[0xa];
u32 mac_addr[6];
 };
 
+struct fuse_bank1_regs {
+   u32 fuse0_21[0x16];
+   u32 usr5;
+   u32 fuse23_29[7];
+   u32 usr6[2];
+};
+
 /* Multi-Layer AHB Crossbar Switch (MAX) registers */
 struct max_regs {
u32 mpr0;
diff --git u-boot-178d0cc.orig/arch/arm/include/asm/arch-mx31/imx-regs.h 
u-boot-178d0cc/arch/arm/include/asm/arch-mx31/imx-regs.h
index e799f37..81b25ae 100644
--- u-boot-178d0cc.orig/arch/arm/include/asm/arch-mx31/imx-regs.h
+++ u-boot-178d0cc/arch/arm/include/asm/arch-mx31/imx-regs.h
@@ -103,6 +103,18 @@ struct iim_regs {
} bank[3];
 };
 
+struct fuse_bank0_regs {
+   u32 fuse0_5[6];
+   u32 usr;
+   u32 fuse7_15[9];
+};
+
+struct fuse_bank2_regs {
+   u32 fuse0;
+   u32 uid[8];
+   u32 fuse9_15[7];
+};
+
 struct iomuxc_regs {
u32 unused1;
u32 unused2;
diff --git u-boot-178d0cc.orig/arch/arm/include/asm/arch-mx35/imx-regs.h 
u-boot-178d0cc/arch/arm/include/asm/arch-mx35/imx-regs.h
index 6161784..b3c733b 100644
--- u-boot-178d0cc.orig/arch/arm/include/asm/arch-mx35/imx-regs.h
+++ u-boot-178d0cc/arch/arm/include/asm/arch-mx35/imx-regs.h
@@ -270,6 +270,18 @@ struct iim_regs {
} bank[3];
 };
 
+struct fuse_bank0_regs {
+   u32 fuse0_7[8];
+   u32 uid[8];
+   u32 fuse16_31[0x10];
+};
+
+struct fuse_bank1_regs {
+   u32 fuse0_21[0x16];
+   u32 usr;
+   u32 fuse23_31[9];
+};
+
 /* General Purpose Timer (GPT) registers */
 struct gpt_regs {
u32 ctrl;   /* control */
diff --git u-boot-178d0cc.orig/arch/arm/include/asm/arch-mx5/imx-regs.h 
u-boot-178d0cc/arch/arm/include/asm/arch-mx5/imx-regs.h
index 8f0a7ec..70a5b1c 100644
--- u-boot-178d0cc.orig/arch/arm/include/asm/arch-mx5/imx-regs.h
+++ u-boot-178d0cc/arch/arm/include/asm/arch-mx5/imx-regs.h
@@ -525,8 +525,14 @@ struct iim_regs {
 };
 
 struct fuse_bank0_regs {
-   u32 fuse0_23[24];
+   u32 fuse0_7[8];
+   u32 uid[8];
+   u32 fuse16_23[8];
+#if defined(CONFIG_MX51)
+   u32 imei[8];
+#elif defined(CONFIG_MX53)
u32 gp[8];
+#endif
 };
 
 struct fuse_bank1_regs {
@@ -535,6 +541,14 @@ struct fuse_bank1_regs {
u32 fuse15_31[0x11];
 };
 
+#if defined(CONFIG_MX53)
+struct fuse_bank4_regs {
+   u32 fuse0_4[5];
+   u32 gp[3];
+   u32 fuse8_31[0x18];
+};
+#endif
+
 #endif /* __ASSEMBLER__*/
 
 #endif /* __ASM_ARCH_MX5_IMX_REGS_H__ */
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 3/5] Add fuse API and commands

2012-11-27 Thread Benoît Thébaudeau
This can be useful for fuse-like hardware, OTP SoC options, etc.

Signed-off-by: Benoît Thébaudeau benoit.thebaud...@advansee.com
Cc: Wolfgang Denk w...@denx.de
Cc: Stefano Babic sba...@denx.de
---
This patch supersedes http://patchwork.ozlabs.org/patch/177244/ .
Changes for v2:
 - Rebase against latest master.

 {u-boot-178d0cc.orig = u-boot-178d0cc}/README |1 +
 .../common/Makefile|1 +
 /dev/null = u-boot-178d0cc/common/cmd_fuse.c  |  182 
 .../include/config_cmd_all.h   |1 +
 /dev/null = u-boot-178d0cc/include/fuse.h |   49 ++
 5 files changed, 234 insertions(+)
 create mode 100644 u-boot-178d0cc/common/cmd_fuse.c
 create mode 100644 u-boot-178d0cc/include/fuse.h

diff --git u-boot-178d0cc.orig/README u-boot-178d0cc/README
index 2dc0984..cec071e 100644
--- u-boot-178d0cc.orig/README
+++ u-boot-178d0cc/README
@@ -819,6 +819,7 @@ The following options need to be configured:
CONFIG_CMD_FDOS * Dos diskette Support
CONFIG_CMD_FLASH  flinfo, erase, protect
CONFIG_CMD_FPGA   FPGA device initialization support
+   CONFIG_CMD_FUSE   Device fuse support
CONFIG_CMD_GO   * the 'go' command (exec code)
CONFIG_CMD_GREPENV  * search environment
CONFIG_CMD_HWFLOW   * RTS/CTS hw flow control
diff --git u-boot-178d0cc.orig/common/Makefile u-boot-178d0cc/common/Makefile
index 9e43322..5212575 100644
--- u-boot-178d0cc.orig/common/Makefile
+++ u-boot-178d0cc/common/Makefile
@@ -100,6 +100,7 @@ ifdef CONFIG_FPGA
 COBJS-$(CONFIG_CMD_FPGA) += cmd_fpga.o
 endif
 COBJS-$(CONFIG_CMD_FS_GENERIC) += cmd_fs.o
+COBJS-$(CONFIG_CMD_FUSE) += cmd_fuse.o
 COBJS-$(CONFIG_CMD_GPIO) += cmd_gpio.o
 COBJS-$(CONFIG_CMD_I2C) += cmd_i2c.o
 COBJS-$(CONFIG_CMD_IDE) += cmd_ide.o
diff --git u-boot-178d0cc/common/cmd_fuse.c u-boot-178d0cc/common/cmd_fuse.c
new file mode 100644
index 000..fd54d40
--- /dev/null
+++ u-boot-178d0cc/common/cmd_fuse.c
@@ -0,0 +1,182 @@
+/*
+ * (C) Copyright 2009-2012 ADVANSEE
+ * Benoît Thébaudeau benoit.thebaud...@advansee.com
+ *
+ * Based on the mpc512x iim code:
+ * Copyright 2008 Silicon Turnkey Express, Inc.
+ * Martha Marx mm...@silicontkx.com
+ *
+ * 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 fuse.h
+#include asm/errno.h
+
+static int strtou32(const char *str, unsigned int base, u32 *result)
+{
+   char *ep;
+
+   *result = simple_strtoul(str, ep, base);
+   if (ep == str || *ep != '\0')
+   return -EINVAL;
+
+   return 0;
+}
+
+static int do_fuse(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
+{
+   u32 bank, row, bit, cnt, val;
+   int ret, i;
+
+   if (argc  4 || strtou32(argv[2], 0, bank) ||
+   strtou32(argv[3], 0, row))
+   return CMD_RET_USAGE;
+
+   if (!strcmp(argv[1], read.bit)) {
+   if (argc != 5 || strtou32(argv[4], 0, bit))
+   return CMD_RET_USAGE;
+
+   printf(Reading bank %u row 0x%.8x bit %u: , bank, row, bit);
+   ret = fuse_read_bit(bank, row, bit, val);
+   if (ret)
+   goto err;
+
+   printf(%u\n, val);
+   } else if (!strcmp(argv[1], read.row)) {
+   if (argc == 4)
+   cnt = 1;
+   else if (argc != 5 || strtou32(argv[4], 0, cnt))
+   return CMD_RET_USAGE;
+
+   printf(Reading bank %u:\n, bank);
+   for (i = 0; i  cnt; i++, row++) {
+   if (!(i % 4))
+   printf(\nRow 0x%.8x:, row);
+
+   ret = fuse_read_row(bank, row, val);
+   if (ret)
+   goto err;
+
+   printf( %.8x, val);
+   }
+   putc('\n');
+   } else if (!strcmp(argv[1], sense.bit)) {
+   if (argc != 5 || strtou32(argv[4], 0, bit))
+   return CMD_RET_USAGE;
+
+   printf(Sensing bank %u row 0x%.8x 

[U-Boot] [PATCH v2 4/5] Add fsl_iim driver

2012-11-27 Thread Benoît Thébaudeau
Add a fsl_iim driver common to i.MX and MPC.

Signed-off-by: Benoît Thébaudeau benoit.thebaud...@advansee.com
Cc: Wolfgang Denk w...@denx.de
Cc: Stefano Babic sba...@denx.de
---
This patch supersedes http://patchwork.ozlabs.org/patch/177245/ .
Changes for v2:
 - Rebase against latest master.

 .../drivers/misc/Makefile  |1 +
 /dev/null = u-boot-178d0cc/drivers/misc/fsl_iim.c |  318 
 2 files changed, 319 insertions(+)
 create mode 100644 u-boot-178d0cc/drivers/misc/fsl_iim.c

diff --git u-boot-178d0cc.orig/drivers/misc/Makefile 
u-boot-178d0cc/drivers/misc/Makefile
index cdec88b..0833d78 100644
--- u-boot-178d0cc.orig/drivers/misc/Makefile
+++ u-boot-178d0cc/drivers/misc/Makefile
@@ -27,6 +27,7 @@ LIB   := $(obj)libmisc.o
 
 COBJS-$(CONFIG_ALI152X) += ali512x.o
 COBJS-$(CONFIG_DS4510)  += ds4510.o
+COBJS-$(CONFIG_FSL_IIM) += fsl_iim.o
 COBJS-$(CONFIG_FSL_LAW) += fsl_law.o
 COBJS-$(CONFIG_GPIO_LED) += gpio_led.o
 COBJS-$(CONFIG_FSL_MC9SDZ60) += mc9sdz60.o
diff --git u-boot-178d0cc/drivers/misc/fsl_iim.c 
u-boot-178d0cc/drivers/misc/fsl_iim.c
new file mode 100644
index 000..1a3d5fc
--- /dev/null
+++ u-boot-178d0cc/drivers/misc/fsl_iim.c
@@ -0,0 +1,318 @@
+/*
+ * (C) Copyright 2009-2012 ADVANSEE
+ * Benoît Thébaudeau benoit.thebaud...@advansee.com
+ *
+ * Based on the mpc512x iim code:
+ * Copyright 2008 Silicon Turnkey Express, Inc.
+ * Martha Marx mm...@silicontkx.com
+ *
+ * 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 config.h
+#include common.h
+#include hwconfig.h
+#include fuse.h
+#include asm/errno.h
+#include asm/byteorder.h
+#include asm/io.h
+
+/* FSL IIM-specific constants */
+#define STAT_BUSY  0x80
+#define STAT_PRGD  0x02
+#define STAT_SNSD  0x01
+
+#define STATM_PRGD_M   0x02
+#define STATM_SNSD_M   0x01
+
+#define ERR_PRGE   0x80
+#define ERR_WPE0x40
+#define ERR_OPE0x20
+#define ERR_RPE0x10
+#define ERR_WLRE   0x08
+#define ERR_SNSE   0x04
+#define ERR_PARITYE0x02
+
+#define EMASK_PRGE_M   0x80
+#define EMASK_WPE_M0x40
+#define EMASK_OPE_M0x20
+#define EMASK_RPE_M0x10
+#define EMASK_WLRE_M   0x08
+#define EMASK_SNSE_M   0x04
+#define EMASK_PARITYE_M0x02
+
+#define FCTL_DPC   0x80
+#define FCTL_PRG_LENGTH_MASK   0x70
+#define FCTL_ESNS_N0x08
+#define FCTL_ESNS_00x04
+#define FCTL_ESNS_10x02
+#define FCTL_PRG   0x01
+
+#define UA_A_BANK_MASK 0x38
+#define UA_A_ROWH_MASK 0x07
+
+#define LA_A_ROWL_MASK 0xf8
+#define LA_A_BIT_MASK  0x07
+
+#define PREV_PROD_REV_MASK 0xf8
+#define PREV_PROD_VT_MASK  0x07
+
+/* Select the correct accessors depending on endianness */
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+#define iim_read32 in_le32
+#define iim_write32out_le32
+#define iim_clrsetbits32   clrsetbits_le32
+#define iim_clrbits32  clrbits_le32
+#define iim_setbits32  setbits_le32
+#elif __BYTE_ORDER == __BIG_ENDIAN
+#define iim_read32 in_be32
+#define iim_write32out_be32
+#define iim_clrsetbits32   clrsetbits_be32
+#define iim_clrbits32  clrbits_be32
+#define iim_setbits32  setbits_be32
+#else
+#error Endianess is not defined: please fix to continue
+#endif
+
+/* IIM control registers */
+struct fsl_iim {
+   u32 stat;
+   u32 statm;
+   u32 err;
+   u32 emask;
+   u32 fctl;
+   u32 ua;
+   u32 la;
+   u32 sdat;
+   u32 prev;
+   u32 srev;
+   u32 prg_p;
+   u32 scs[0x1f5];
+   struct {
+   u32 row[0x100];
+   } bank[8];
+};
+
+int fuse_read_bit(u32 bank, u32 row, u32 bit, u32 *val)
+{
+   int ret;
+
+   if (bit = 8) {
+   puts(fsl_iim fuse read: Invalid argument\n);
+   return -EINVAL;
+   }
+
+   ret = fuse_read_row(bank, row, val);
+   if (ret)
+   return ret;
+
+   *val = !!(*val  1  bit);
+   return 0;
+}
+
+int 

[U-Boot] [PATCH v2 5/5] mpc iim: Switch to common fsl_iim

2012-11-27 Thread Benoît Thébaudeau
Signed-off-by: Benoît Thébaudeau benoit.thebaud...@advansee.com
Cc: Wolfgang Denk w...@denx.de
Cc: Stefano Babic sba...@denx.de
Cc: Reinhard Arlt reinhard.a...@esd-electronics.com
Cc: Michael Weiss michael.we...@ifm.com
---
This patch supersedes http://patchwork.ozlabs.org/patch/177246/ .
Changes for v2:
 - Rebase against latest master.

 .../arch/powerpc/cpu/mpc512x/Makefile  |1 -
 .../arch/powerpc/cpu/mpc512x/iim.c = /dev/null|  394 
 .../board/davedenx/aria/aria.c |2 +-
 .../board/esd/mecp5123/mecp5123.c  |2 +-
 .../board/freescale/mpc5121ads/mpc5121ads.c|2 +-
 .../board/pdm360ng/pdm360ng.c  |2 +-
 .../include/configs/aria.h |2 +-
 .../include/configs/mecp5123.h |2 +-
 .../include/configs/mpc5121ads.h   |2 +-
 9 files changed, 7 insertions(+), 402 deletions(-)
 delete mode 100644 u-boot-178d0cc.orig/arch/powerpc/cpu/mpc512x/iim.c

diff --git u-boot-178d0cc.orig/arch/powerpc/cpu/mpc512x/Makefile 
u-boot-178d0cc/arch/powerpc/cpu/mpc512x/Makefile
index b53232f..4f4c9ec 100644
--- u-boot-178d0cc.orig/arch/powerpc/cpu/mpc512x/Makefile
+++ u-boot-178d0cc/arch/powerpc/cpu/mpc512x/Makefile
@@ -38,7 +38,6 @@ COBJS-y += serial.o
 COBJS-y += speed.o
 COBJS-$(CONFIG_FSL_DIU_FB) += diu.o
 COBJS-$(CONFIG_CMD_IDE) += ide.o
-COBJS-$(CONFIG_IIM) += iim.o
 COBJS-$(CONFIG_PCI) += pci.o
 
 # Stub implementations of cache management functions for USB
diff --git u-boot-178d0cc.orig/arch/powerpc/cpu/mpc512x/iim.c 
u-boot-178d0cc.orig/arch/powerpc/cpu/mpc512x/iim.c
deleted file mode 100644
index abec8f6..000
--- u-boot-178d0cc.orig/arch/powerpc/cpu/mpc512x/iim.c
+++ /dev/null
@@ -1,394 +0,0 @@
-/*
- * Copyright 2008 Silicon Turnkey Express, Inc.
- * Martha Marx mm...@silicontkx.com
- *
- * ADS5121 IIM (Fusebox) Interface
- *
- * 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 asm/io.h
-
-#ifdef CONFIG_CMD_FUSE
-
-DECLARE_GLOBAL_DATA_PTR;
-
-static char cur_bank = '1';
-
-char *iim_err_msg(u32 err)
-{
-   static char *IIM_errs[] = {
-   Parity Error in cache,
-   Explicit Sense Cycle Error,
-   Write to Locked Register Error,
-   Read Protect Error,
-   Override Protect Error,
-   Write Protect Error};
-
-   int i;
-
-   if (!err)
-   return ;
-   for (i = 1; i  8; i++)
-   if (err  (1  i))
-   printf(IIM - %s\n, IIM_errs[i-1]);
-   return ;
-}
-
-int in_range(int n, int min, int max, char *err, char *usg)
-{
-   if (n  max || n  min) {
-   printf(err);
-   printf(Usage:\n%s\n, usg);
-   return 0;
-   }
-   return 1;
-}
-
-int ads5121_fuse_read(int bank, int fstart, int num)
-{
-   iim512x_t *iim = ((immap_t *) CONFIG_SYS_IMMR)-iim;
-   u32 *iim_fb, dummy;
-   int f, ctr;
-
-   out_be32(iim-err, in_be32(iim-err));
-   if (bank == 0)
-   iim_fb = (u32 *)(iim-fbac0);
-   else
-   iim_fb = (u32 *)(iim-fbac1);
-/* try a read to see if Read Protect is set */
-   dummy = in_be32(iim_fb[0]);
-   if (in_be32(iim-err)  IIM_ERR_RPE) {
-   printf(\tRead protect fuse is set\n);
-   out_be32(iim-err, IIM_ERR_RPE);
-   return 0;
-   }
-   printf(Reading Bank %d cache\n, bank);
-   for (f = fstart, ctr = 0; num  0; ctr++, num--, f++) {
-   if (ctr % 4 == 0)
-   printf(F%2d:, f);
-   printf(\t%#04x, (u8)(iim_fb[f]));
-   if (ctr % 4 == 3)
-   printf(\n);
-   }
-   if (ctr % 4 != 0)
-   printf(\n);
-}
-
-int ads5121_fuse_override(int bank, int f, u8 val)
-{
-   iim512x_t *iim = ((immap_t *) CONFIG_SYS_IMMR)-iim;
-   u32 *iim_fb;
-   u32 iim_stat;
-   int i;
-
-   out_be32(iim-err, in_be32(iim-err));
-   if (bank == 0)
-   iim_fb = (u32 *)(iim-fbac0);
-   else
-   iim_fb = (u32 *)(iim-fbac1);
-/* try a read to see if Read 

Re: [U-Boot] [PATCH v2 3/5] Add fuse API and commands

2012-11-27 Thread Benoît Thébaudeau
On Tuesday, November 27, 2012 2:33:40 PM, Otavio Salvador wrote:
 On Tue, Nov 27, 2012 at 11:31 AM, Benoît Thébaudeau
 benoit.thebaud...@advansee.com wrote:
  +   fuse ovride.bit bank row bit val - override a fuse
  bit\n
  +   fuse ovride.row bank row hexval [hexval...] -
  override 1 or\n
 
 Please change to override as it is nicer to read ;-)

OK, I'll do that for v3. It was to make the word a bit shorter, but I agree it's
ugly.

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


Re: [U-Boot] [PATCH v5 2/9] x86: Allow excluding reset vector code from u-boot

2012-11-27 Thread Wolfgang Denk
Dear Simon Glass,

In message CAPnjgZ2EjgHHnNj-0dyHgMMHhomYLuVJE=kf7pfcpwrsbdg...@mail.gmail.com 
you wrote:
 
  CONFIG_SYS_X86_RESET_VECTOR - is this just another new, undocumented
  variable?
 
 Yes it is new and undocumented, because it is internal to the x86
 implementation and I don't want people to set it.

Then document it as internal and not to be touched, but documented it
must be.

 Well there are now two options:
 
 1. The user-facing CONFIG_NO_RESET_CODE option which, if not defined,
 asserts CONFIG_SYS_X86_RESET_VECTOR
 2. CONFIG_SYS_X86_RESET_VECTOR which is used in the Makefiles
 
 I would rather have a single positive option
 (CONFIG_SYS_X86_RESET_VECTOR, as series v4). Failing that I would
 rather have ifneq in the Makefile (and just use CONFIG_NO_RESET_CODE).
 I am not sure how to have a negative option without an ifneq in the
 Makefile. I looked pretty hard but could not find an example in
 U-Boot.

First, you can #define CONFIG_SYS_X86_RESET_VECTOR in some global
header file, and in the boards that don't want it add an #undef in the
board config file.

Second, you can have some

RESET_OBJS-$(CONFIG_SYS_X86_RESET_VECTOR) = your_list

in your Makefile, and then use

COBJS   := $(sort $(COBJS-y) $(RESET_OBJS-))

which will include your_list only if CONFIG_SYS_X86_RESET_VECTOR is
_not_ set or empty.

etc.

 This is possible a minor point since I think Graeme said that the only
 other x86 board will move to Coreboot soon.

...for the time being, maybe.  But we should not bar other options
without serious need.

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
Doubt is a pain too lonely to know that faith is his twin brother.
- Kahlil Gibran
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v5 2/9] x86: Allow excluding reset vector code from u-boot

2012-11-27 Thread Wolfgang Denk
Dear Graeme Russ,

In message calbutcj43_3d_pgnwnc3w9q4fxy0rgzaxd1ktzb+sdytqe3...@mail.gmail.com 
you wrote:

 My vote would be for a CONFIG_X86_NO_RESET_VECTOR (and
 CONFIG_X86_NO_REAL_MODE) and just use ifneq in the Makefile

ACK for the names, but ther eis no need for ifneq or such.


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
A good marriage would be between a blind wife and deaf husband.
   -- Michel de Montaigne
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 3/8] boottime: Add core boottime measurement support

2012-11-27 Thread Wolfgang Denk
Dear Lee Jones,

In message 20121127085548.gc7...@gmail.com you wrote:
 
 By the way, if Wolfgang didn't want these tracepoints in DT, then
 how was your implementations upstreamed into u-boot?

Because I don;t manage a 100% review coverage over all submitted
patches, i. e. it escaped my attention (and I'm sorry for that).

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
It is much easier to suggest solutions when you know nothing
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Reg Bootstrapping on x86-64 for tizen

2012-11-27 Thread Wolfgang Denk
Dear manohar.bet...@smartplayin.com,

In message 1354015336.6967...@apps.rackspace.com you wrote:

 
 I am Manohar ,have compiled the u-boot on x86 64 bit machine using 
 coreboot-x86.
 
 Please help me / send me the procedure of bootstrapping steps of it for Tizen 
 kernel.

Please start reading here:
http://catb.org/esr/faqs/smart-questions.html

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 ignorance is bliss, why aren't there more happy people?
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 3/8] boottime: Add core boottime measurement support

2012-11-27 Thread Lee Jones
On Tue, 27 Nov 2012, Wolfgang Denk wrote:

 Dear Lee Jones,
 
 In message 20121127085548.gc7...@gmail.com you wrote:
  
  By the way, if Wolfgang didn't want these tracepoints in DT, then
  how was your implementations upstreamed into u-boot?
 
 Because I don;t manage a 100% review coverage over all submitted
 patches, i. e. it escaped my attention (and I'm sorry for that).

Ah, I see. Makes sense. 

Well I'm pleased someone saw sense in any case. :)

-- 
Lee Jones
Linaro ST-Ericsson Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 6/9] Properly zero out timeout value

2012-11-27 Thread Pantelis Antoniou
Zero out timeout value; letting it filled with undefined values
ends up with the dfu host hanging.

Signed-off-by: Pantelis Antoniou pa...@antoniou-consulting.com
---
 drivers/usb/gadget/f_dfu.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/usb/gadget/f_dfu.c b/drivers/usb/gadget/f_dfu.c
index 10547e3..a322ae5 100644
--- a/drivers/usb/gadget/f_dfu.c
+++ b/drivers/usb/gadget/f_dfu.c
@@ -164,6 +164,9 @@ static void handle_getstatus(struct usb_request *req)
 
/* send status response */
dstat-bStatus = f_dfu-dfu_status;
+   dstat-bwPollTimeout[0] = 0;
+   dstat-bwPollTimeout[1] = 0;
+   dstat-bwPollTimeout[2] = 0;
dstat-bState = f_dfu-dfu_state;
dstat-iString = 0;
 }
-- 
1.7.12

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


[U-Boot] [PATCH 3/9] Only perform DFU board_usb_init() for TRATS

2012-11-27 Thread Pantelis Antoniou
USB initialization shouldn't happen for all the boards.

Signed-off-by: Pantelis Antoniou pa...@antoniou-consulting.com
---
 common/cmd_dfu.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/common/cmd_dfu.c b/common/cmd_dfu.c
index 01d6b3a..327c738 100644
--- a/common/cmd_dfu.c
+++ b/common/cmd_dfu.c
@@ -55,7 +55,10 @@ static int do_dfu(cmd_tbl_t *cmdtp, int flag, int argc, char 
* const argv[])
goto done;
}
 
+#ifdef CONFIG_TRATS
board_usb_init();
+#endif
+
g_dnl_register(s);
while (1) {
if (ctrlc())
-- 
1.7.12

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


[U-Boot] [PATCH 0/9] DFU on am35xx_evm (against u-boot-usb)

2012-11-27 Thread Pantelis Antoniou
This patchset fixes various problems in the u-boot DFU implementation
and supports it on the am35xx_evm.

This patchset is against the u-boot-usb tree.

Pantelis Antoniou (9):
  [usb-gadget] Remove obsolete header file
  [usb-gadget] Fix bug when both DFU  ETHER are defined
  [dfu] Only perform DFU board_usb_init() for TRATS
  [dfu] Fix crash when wrong number of arguments given
  [dfu] Generate appropriate responses for DFU
  [dfu] Properly zero out timeout value
  [dfu] Add a partition type target
  [dfu] Issue connect/disconnect as appropriate
  [am335x_evm] Add DFU config

 common/cmd_dfu.c   |  5 -
 drivers/dfu/dfu_mmc.c  | 29 +
 drivers/usb/gadget/Makefile| 13 +++--
 drivers/usb/gadget/composite.c |  9 +
 drivers/usb/gadget/ep0.c   |  1 +
 drivers/usb/gadget/f_dfu.c |  4 +++-
 drivers/usb/gadget/g_dnl.c |  9 -
 include/configs/am335x_evm.h   | 27 +++
 include/g_dnl.h|  1 -
 9 files changed, 92 insertions(+), 6 deletions(-)

-- 
1.7.12

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


[U-Boot] [PATCH 5/9] Generate appropriate responses for DFU

2012-11-27 Thread Pantelis Antoniou
Make sure appropriate responses for the DFU protocal are
generated.

Signed-off-by: Pantelis Antoniou pa...@antoniou-consulting.com
---
 drivers/usb/gadget/composite.c | 9 +
 drivers/usb/gadget/ep0.c   | 1 +
 2 files changed, 10 insertions(+)

diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
index ebb5131..1ae318c 100644
--- a/drivers/usb/gadget/composite.c
+++ b/drivers/usb/gadget/composite.c
@@ -773,6 +773,15 @@ composite_setup(struct usb_gadget *gadget, const struct 
usb_ctrlrequest *ctrl)
if (value = 0)
value = min(w_length, (u16) value);
break;
+
+#ifdef CONFIG_DFU_FUNCTION
+   case DFU_DT_FUNC:   /* DFU */
+   value = config_desc(cdev, w_value);
+   if (value = 0)
+   value = min(w_length, (u16) value);
+   break;
+#endif
+
default:
goto unknown;
}
diff --git a/drivers/usb/gadget/ep0.c b/drivers/usb/gadget/ep0.c
index aa8f916..971d846 100644
--- a/drivers/usb/gadget/ep0.c
+++ b/drivers/usb/gadget/ep0.c
@@ -221,6 +221,7 @@ static int ep0_get_descriptor (struct usb_device_instance 
*device,
break;
 
case USB_DESCRIPTOR_TYPE_CONFIGURATION:
+   case USB_DESCRIPTOR_TYPE_OTHER_SPEED_CONFIGURATION:
{
struct usb_configuration_descriptor
*configuration_descriptor;
-- 
1.7.12

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


[U-Boot] [PATCH 8/9] Issue connect/disconnect as appropriate

2012-11-27 Thread Pantelis Antoniou
Call usb_gadget_connect/usb_gadget_disconnect in g_dnl_bind/g_dnl_unbind.

Signed-off-by: Pantelis Antoniou pa...@antoniou-consulting.com
---
 drivers/usb/gadget/g_dnl.c | 9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/g_dnl.c b/drivers/usb/gadget/g_dnl.c
index 7d87050..bbbfe02 100644
--- a/drivers/usb/gadget/g_dnl.c
+++ b/drivers/usb/gadget/g_dnl.c
@@ -83,7 +83,11 @@ static struct usb_gadget_strings *g_dnl_composite_strings[] 
= {
 
 static int g_dnl_unbind(struct usb_composite_dev *cdev)
 {
-   debug(%s\n, __func__);
+   struct usb_gadget *gadget = cdev-gadget;
+
+   debug(%s: calling usb_gadget_disconnect for controller '%s'\n, 
shortname, gadget-name);
+   usb_gadget_disconnect(gadget);
+
return 0;
 }
 
@@ -153,6 +157,9 @@ static int g_dnl_bind(struct usb_composite_dev *cdev)
device_desc.bcdDevice = __constant_cpu_to_le16(0x);
}
 
+   debug(%s: calling usb_gadget_connect for controller '%s'\n, 
shortname, gadget-name);
+   usb_gadget_connect(gadget);
+
return 0;
 
  error:
-- 
1.7.12

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


[U-Boot] [PATCH 2/9] Fix bug when both DFU ETHER are defined

2012-11-27 Thread Pantelis Antoniou
When both CONFIG_USB_GADGET  CONFIG_USB_ETHER are defined
the makefile links objects twice.

Detect this and fix it with a not very elegant way in the
makefile. Revisit and clean it later.

Signed-off-by: Pantelis Antoniou pa...@antoniou-consulting.com
---
 drivers/usb/gadget/Makefile | 13 +++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/gadget/Makefile b/drivers/usb/gadget/Makefile
index 040eaba..15206cd 100644
--- a/drivers/usb/gadget/Makefile
+++ b/drivers/usb/gadget/Makefile
@@ -26,14 +26,23 @@ include $(TOPDIR)/config.mk
 LIB:= $(obj)libusb_gadget.o
 
 # new USB gadget layer dependencies
+
+# ugh; ugh; ugh common objects included twice
+ifdef CONFIG_USB_GADGET
+   COBJS-y += epautoconf.o config.o usbstring.o
+else
+  ifdef CONFIG_USB_ETHER
+ COBJS-y += epautoconf.o config.o usbstring.o
+  endif
+endif
+
 ifdef CONFIG_USB_GADGET
-COBJS-y += epautoconf.o config.o usbstring.o
 COBJS-$(CONFIG_USB_GADGET_S3C_UDC_OTG) += s3c_udc_otg.o
 COBJS-$(CONFIG_USBDOWNLOAD_GADGET) += g_dnl.o
 COBJS-$(CONFIG_DFU_FUNCTION) += f_dfu.o
 endif
 ifdef CONFIG_USB_ETHER
-COBJS-y += ether.o epautoconf.o config.o usbstring.o
+COBJS-y += ether.o
 COBJS-$(CONFIG_USB_ETH_RNDIS) += rndis.o
 COBJS-$(CONFIG_MV_UDC) += mv_udc.o
 COBJS-$(CONFIG_CPU_PXA25X) += pxa25x_udc.o
-- 
1.7.12

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


[U-Boot] [PATCH 9/9] Add DFU config

2012-11-27 Thread Pantelis Antoniou
Add configuration for using DFU on the am335x_evm boards

Signed-off-by: Pantelis Antoniou pa...@antoniou-consulting.com
---
 include/configs/am335x_evm.h | 26 ++
 1 file changed, 26 insertions(+)

diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h
index ab9549b..0befa34 100644
--- a/include/configs/am335x_evm.h
+++ b/include/configs/am335x_evm.h
@@ -39,6 +39,8 @@
 #define CONFIG_SETUP_MEMORY_TAGS
 #define CONFIG_INITRD_TAG
 
+#define CONFIG_SYS_CACHELINE_SIZE   64
+
 /* commands to include */
 #include config_cmd_default.h
 
@@ -90,6 +92,7 @@
setenv fdtfile am335x-evm.dtb; fi;  \
if test $board_name = A335X_SK; then  \
setenv fdtfile am335x-evmsk.dtb; fi\0 \
+   CONFIG_DFU_ALT
 
 #define CONFIG_BOOTCOMMAND \
mmc dev ${mmcdev}; if mmc rescan; then  \
@@ -153,6 +156,28 @@
 #define CONFIG_CMD_SF
 #define CONFIG_SF_DEFAULT_SPEED(2400)
 
+/* USB Composite download gadget - g_dnl */
+#define CONFIG_USB_GADGET
+#define CONFIG_USBDOWNLOAD_GADGET
+#define CONFIG_DFU_FUNCTION
+#define CONFIG_DFU_MMC
+
+/* USB TI's IDs */
+#define CONFIG_USBD_HS
+#define CONFIG_G_DNL_VENDOR_NUM 0x0525
+#define CONFIG_G_DNL_PRODUCT_NUM 0xa4a7
+#define CONFIG_G_DNL_MANUFACTURER Texas Instruments
+
+#define CONFIG_DFU_ALT \
+   dfu_alt_info= \
+   boot part 0 1; \
+   rootfs part 0 2; \
+   MLO fat 0 1; \
+   u-boot.img fat 0 1; \
+   uEnv.txt fat 0 1\0
+
+#define CONFIG_CMD_DFU
+
  /* Physical Memory Map */
 #define CONFIG_NR_DRAM_BANKS   1   /*  1 bank of DRAM */
 #define PHYS_DRAM_10x8000  /* DRAM Bank #1 */
@@ -265,6 +290,7 @@
 #define CONFIG_MUSB_GADGET
 #define CONFIG_MUSB_PIO_ONLY
 #define CONFIG_USB_GADGET_DUALSPEED
+#define CONFIG_USB_GADGET_VBUS_DRAW2
 #define CONFIG_MUSB_HOST
 #define CONFIG_AM335X_USB0
 #define CONFIG_AM335X_USB0_MODEMUSB_PERIPHERAL
-- 
1.7.12

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


[U-Boot] [PATCH 1/9] Remove obsolete header file

2012-11-27 Thread Pantelis Antoniou
usbdescriptors.h conflicts with linux/usb/ch9.h
Remove it.

Signed-off-by: Pantelis Antoniou pa...@antoniou-consulting.com
---
 drivers/usb/gadget/f_dfu.c | 1 -
 include/g_dnl.h| 1 -
 2 files changed, 2 deletions(-)

diff --git a/drivers/usb/gadget/f_dfu.c b/drivers/usb/gadget/f_dfu.c
index 3ec4c65..10547e3 100644
--- a/drivers/usb/gadget/f_dfu.c
+++ b/drivers/usb/gadget/f_dfu.c
@@ -25,7 +25,6 @@
 #include malloc.h
 
 #include linux/usb/ch9.h
-#include usbdescriptors.h
 #include linux/usb/gadget.h
 #include linux/usb/composite.h
 
diff --git a/include/g_dnl.h b/include/g_dnl.h
index 0ec7440..f47395f 100644
--- a/include/g_dnl.h
+++ b/include/g_dnl.h
@@ -22,7 +22,6 @@
 #define __G_DOWNLOAD_H_
 
 #include linux/usb/ch9.h
-#include usbdescriptors.h
 #include linux/usb/gadget.h
 
 int g_dnl_register(const char *s);
-- 
1.7.12

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


[U-Boot] [PATCH 7/9] Add a partition type target

2012-11-27 Thread Pantelis Antoniou
Dealing with raw block numbers with the dfu is very annoying.
Introduce a partition method.

Signed-off-by: Pantelis Antoniou pa...@antoniou-consulting.com
---
 drivers/dfu/dfu_mmc.c | 29 +
 1 file changed, 29 insertions(+)

diff --git a/drivers/dfu/dfu_mmc.c b/drivers/dfu/dfu_mmc.c
index 5d504df..3733b21 100644
--- a/drivers/dfu/dfu_mmc.c
+++ b/drivers/dfu/dfu_mmc.c
@@ -153,6 +153,10 @@ int dfu_read_medium_mmc(struct dfu_entity *dfu, void *buf, 
long *len)
 
 int dfu_fill_entity_mmc(struct dfu_entity *dfu, char *s)
 {
+   int dev, part;
+   struct mmc *mmc;
+   block_dev_desc_t *blk_dev;
+   disk_partition_t partinfo;
char *st;
 
dfu-dev_type = DFU_DEV_MMC;
@@ -166,8 +170,33 @@ int dfu_fill_entity_mmc(struct dfu_entity *dfu, char *s)
dfu-layout = DFU_FS_FAT;
} else if (!strcmp(st, ext4)) {
dfu-layout = DFU_FS_EXT4;
+   } else if (!strcmp(st, part)) {
+
+   dfu-layout = DFU_RAW_ADDR;
+
+   dev = simple_strtoul(s, s, 10);
+   part = simple_strtoul(++s, s, 10);
+
+   mmc = find_mmc_device(dev);
+   if (mmc == NULL || mmc_init(mmc)) {
+   printf(%s: could not find mmc device #%d!\n, 
__func__, dev);
+   return -1;
+   }
+
+   blk_dev = mmc-block_dev;
+   if (get_partition_info(blk_dev, part, partinfo) != 0) {
+   printf(%s: could not find partition #%d on mmc device 
#%d!\n,
+   __func__, part, dev);
+   return -1;
+   }
+
+   dfu-data.mmc.lba_start = partinfo.start;
+   dfu-data.mmc.lba_size = partinfo.size;
+   dfu-data.mmc.lba_blk_size = partinfo.blksz;
+
} else {
printf(%s: Memory layout (%s) not supported!\n, __func__, st);
+   return -1;
}
 
if (dfu-layout == DFU_FS_EXT4 || dfu-layout == DFU_FS_FAT) {
-- 
1.7.12

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


[U-Boot] [PATCH 4/9] Fix crash when wrong number of arguments given

2012-11-27 Thread Pantelis Antoniou
Fix obvious crash when not enough arguments are given to the dfu
command.

Signed-off-by: Pantelis Antoniou pa...@antoniou-consulting.com
---
 common/cmd_dfu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/cmd_dfu.c b/common/cmd_dfu.c
index 327c738..83ef324 100644
--- a/common/cmd_dfu.c
+++ b/common/cmd_dfu.c
@@ -50,7 +50,7 @@ static int do_dfu(cmd_tbl_t *cmdtp, int flag, int argc, char 
* const argv[])
if (ret)
return CMD_RET_FAILURE;
 
-   if (strcmp(argv[3], list) == 0) {
+   if (argc  3  strcmp(argv[3], list) == 0) {
dfu_show_entities();
goto done;
}
-- 
1.7.12

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


[U-Boot] arm: empty isb() in set_cr

2012-11-27 Thread Joe Kulikauskas

#define isb() __asm__ __volatile__ ( : : : memory)
is in arch/arm/include/asm/system.h.  In my build, that is going into 
set_cr(), producing no instruction.


Is that correct?  It has been in code since 
http://lists.denx.de/pipermail/u-boot/2009-March/049870.html.


Looks like it's used only in set_cr.  Other points in the code have 
nonempty code for ISB, for example
#define CP15ISBasm volatile (mcr p15, 0, %0, c7, c5, 4 : : r 
(0))

which is in armv7.h

I don't have a standard reference platform to experiment with. The 
platform that I have uses a Cortex-A9 core, u-boot.2012.07 is ported and 
running. There are some intermittent issues there relating to enabling 
MMU/cache, lack of instruction barriers would be a plausible explanation.


Adding ISB SY in set_cr doesn't fix my issues, but it looks like a step 
in right direction. If someone could explain, or point me to email, I 
would appreciate it. Thanks in advance.


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


Re: [U-Boot] [PATCH v5 2/9] x86: Allow excluding reset vector code from u-boot

2012-11-27 Thread Simon Glass
Hi,

On Tue, Nov 27, 2012 at 5:42 AM, Wolfgang Denk w...@denx.de wrote:
 Dear Graeme Russ,

 In message 
 calbutcj43_3d_pgnwnc3w9q4fxy0rgzaxd1ktzb+sdytqe3...@mail.gmail.com you 
 wrote:

 My vote would be for a CONFIG_X86_NO_RESET_VECTOR (and
 CONFIG_X86_NO_REAL_MODE) and just use ifneq in the Makefile

 ACK for the names, but ther eis no need for ifneq or such.

Thank you both, I will make it so.

Regards,
Simon



 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
 A good marriage would be between a blind wife and deaf husband.
-- Michel de Montaigne
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v5 00/11] S3C24XX: Add support to MINI2416 board

2012-11-27 Thread José Miguel Gonçalves

Hi,

Can you tell me if this patch series is going to be included on next u-boot 
release?
Do you need anything from my side in order to push this?

Best regards,
José Gonçalves

On 21-09-2012 19:47, José Miguel Gonçalves wrote:

Support for the MINI2416 board based on a Samsung's S3C2416 SoC with
64MB DDR2 SDRAM, 256MB NAND Flash, a LAN9220 Ethernet Controller and a
WM8731 Audio CODEC.

Changes for v2:
- Coding style cleanup
- Removed new serial and rtc drivers
- Use of in-tree serial and rtc drivers

Changes for v3:
- Rebased on new SPL framework:
  http://github.com/trini/u-boot WIP/spl-improvements
- Removed patch ARM: fix relocation on ARM926EJS
- Add patch to configure printf() inclusion on SPL
- Changed new binary target name from u-boot-ubl.bin to u-boot-pad.bin
- Removed magic numbers
- Checkpatch clean except:
  - False positive:
ERROR: spaces required around that ':' (ctx:VxV)
#692: FILE: include/configs/mini2416.h:165:
+#define CONFIG_ETHADDR FE:11:22:33:44:55
  - Following preexistent coding style:
WARNING: please, no spaces at the start of a line
#1716: FILE: include/common.h:631:
+defined(CONFIG_S3C24XX) || \$

Changes for v4:
- NAND Flash driver cleanup and optimization

Changes for v5:
- Changed image filename for SPL + u-boot
- Minor change in the NAND Flash driver
- Coding style cleanup
- Removal of #define CONFIG_SYS_BAUDRATE_TABLE as this in the defaults now
- Checkpatch clean with the exceptions indicated in the v3 changes

José Miguel Gonçalves (11):
   Add configuration option to select printf() inclusion on SPL
   S3C24XX: Add core support for Samsung's S3C24XX SoCs
   serial: Add support to 4 ports in serial_s3c24x0
   serial: Use a more precise baud rate generation for serial_s3c24x0
   serial: Remove unnecessary delay in serial_s3c24x0
   rtc: Improve rtc_get() on s3c24x0_rtc
   rtc: Fix rtc_reset() on s3c24x0_rtc
   rtc: Don't allow setting unsuported years on s3c24x0_rtc
   S3C24XX: Add NAND Flash driver
   Add u-boot-with-spl.bin target to the Makefile
   S3C24XX: Add support to MINI2416 board

  MAINTAINERS |4 +
  Makefile|   11 +-
  README  |3 +
  arch/arm/cpu/arm926ejs/s3c24xx/Makefile |   56 +++
  arch/arm/cpu/arm926ejs/s3c24xx/cpu.c|   57 +++
  arch/arm/cpu/arm926ejs/s3c24xx/cpu_info.c   |   57 +++
  arch/arm/cpu/arm926ejs/s3c24xx/s3c2412_speed.c  |  114 +
  arch/arm/cpu/arm926ejs/s3c24xx/s3c2416_speed.c  |  116 +
  arch/arm/cpu/arm926ejs/s3c24xx/timer.c  |  152 ++
  arch/arm/include/asm/arch-s3c24xx/s3c2412.h |  130 +
  arch/arm/include/asm/arch-s3c24xx/s3c2416.h |  183 +++
  arch/arm/include/asm/arch-s3c24xx/s3c24x0_cpu.h |   41 ++
  arch/arm/include/asm/arch-s3c24xx/s3c24xx.h |  615 +++
  arch/arm/include/asm/arch-s3c24xx/s3c24xx_cpu.h |   30 ++
  arch/arm/include/asm/arch-s3c24xx/spl.h |   29 ++
  board/boardcon/mini2416/Makefile|   47 ++
  board/boardcon/mini2416/config.mk   |4 +
  board/boardcon/mini2416/mini2416.c  |  104 
  board/boardcon/mini2416/mini2416_spl.c  |  202 
  board/boardcon/mini2416/u-boot-spl.lds  |   63 +++
  boards.cfg  |1 +
  drivers/mtd/nand/Makefile   |1 +
  drivers/mtd/nand/s3c24xx_nand.c |  255 ++
  drivers/rtc/s3c24x0_rtc.c   |   30 +-
  drivers/serial/serial_s3c24x0.c |   52 +-
  include/common.h|   12 +
  include/configs/VCMA9.h |2 +-
  include/configs/mini2416.h  |  202 
  include/configs/smdk2410.h  |2 +-
  spl/Makefile|4 +-
  30 files changed, 2550 insertions(+), 29 deletions(-)
  create mode 100644 arch/arm/cpu/arm926ejs/s3c24xx/Makefile
  create mode 100644 arch/arm/cpu/arm926ejs/s3c24xx/cpu.c
  create mode 100644 arch/arm/cpu/arm926ejs/s3c24xx/cpu_info.c
  create mode 100644 arch/arm/cpu/arm926ejs/s3c24xx/s3c2412_speed.c
  create mode 100644 arch/arm/cpu/arm926ejs/s3c24xx/s3c2416_speed.c
  create mode 100644 arch/arm/cpu/arm926ejs/s3c24xx/timer.c
  create mode 100644 arch/arm/include/asm/arch-s3c24xx/s3c2412.h
  create mode 100644 arch/arm/include/asm/arch-s3c24xx/s3c2416.h
  create mode 100644 arch/arm/include/asm/arch-s3c24xx/s3c24x0_cpu.h
  create mode 100644 arch/arm/include/asm/arch-s3c24xx/s3c24xx.h
  create mode 100644 arch/arm/include/asm/arch-s3c24xx/s3c24xx_cpu.h
  create mode 100644 arch/arm/include/asm/arch-s3c24xx/spl.h
  create mode 100644 board/boardcon/mini2416/Makefile
  create mode 100644 board/boardcon/mini2416/config.mk
 

Re: [U-Boot] [PATCH V4 6/7] mmc: add bcm2835 driver

2012-11-27 Thread Stephen Warren
On 11/26/2012 11:49 PM, Albert ARIBAUD wrote:
 On Mon, 26 Nov 2012 21:38:16 -0700, Stephen Warren
 swar...@wwwdotorg.org wrote:
 
 This adds a simple driver for the BCM2835's SD controller.

 Workarounds are implemented for:
 * Register writes can't be too close to each-other in time, or they will
   be lost.
 * Register accesses must all be 32-bit, so implement custom accessors.

 This code was extracted from:
 git://github.com/gonzoua/u-boot-pi.git master
 which was created by Oleksandr Tymoshenko.

 Portions of the code there were obviously based on the Linux kernel at:
 git://github.com/raspberrypi/linux.git rpi-3.6.y
 commit f5b930b Main bcm2708 linux port signed-off-by Dom Cobley.

 swarren changed the following for upstream:
 * Removed hack udelay()s in bcm2835_sdhci_raw_writel(); setting
   SDHCI_QUIRK_WAIT_SEND_CMD appears to solve the issues.
 * Remove register logging from read*/write* functions.
 * Sort out confusion with min/max_freq values passed to add_sdhci().
 * Use more descriptive variable names and calculations in IO accessors.
 * Simplified and commented twoticks_delay calculation.
 * checkpatch fixes.

 Cc: Andy Fleming aflem...@gmail.com
 
 Hi Andy,
 
 As soon as you give your Ack to this patch, I'll apply the
 whole series to u-boot-arm/master.

Do feel free to apply all the patches before the MMC driver addition
without waiting for the MMC driver though.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PULL] u-boot-usb/master

2012-11-27 Thread Tom Rini
On Tue, Nov 20, 2012 at 12:17:58AM +0100, Marek Vasut wrote:

 Tom, please apply this onto u-boot/master ... I've been waiting for you to 
 return with this pull.
 
 The following changes since commit 178d0cc1a4c73c3341afbeb2a93b172de8c96bd1:
 
   Merge branch 'master' of git://git.denx.de/u-boot-video (2012-11-19 
 09:28:04 
 -0700)
 
 are available in the git repository at:
 
 
   git://git.denx.de/u-boot-usb.git master
 
 for you to fetch changes up to 7bae844f2dacd1b75f65e37624778a15e132f5e1:
 
   usb: r8a6659: Fix build by missing of parenthesis (2012-11-20 00:16:08 
 +0100)
 
 
 Allen Martin (4):
   USB: make usb_kbd obey USB DMA alignment requirements
   tegra: move TEGRA_DEVICE_SETTINGS to tegra-common-post.h
   tegra: Enable USB keyboard
   USB: add arrow key support to usb_kbd
 
 Ilya Yanok (13):
   linux/usb/ch9.h: update with the version from Linux tree
   usb: use linux/usb/ch9.h instead of usbdescriptors.h
   musb-new: port of Linux musb driver
   musb-new: dsps backend driver
   am33xx: init OTG hardware and new musb gadget driver
   am335x_evm: enable both musb gadget and host
   musb-new: am35x backend driver
   OMAP3: am35x_def.h: add USB defines
   OMAP3: am35x: add musb functions
   am3517_evm: switch to musb-new
   musb-new: omap2plus backend driver
   omap3_beagle: add musb-new init
   omap3_beagle: use new MUSB intstead of the old one
 
 Jeroen Hofstee (1):
   boards: remove the no longer used CONFIG_EHCI_DCACHE
 
 Nobuhiro Iwamatsu (2):
   usb: r8a66597: Switched from variable to only macro
   usb: r8a6659: Fix build by missing of parenthesis
 
  Makefile  |1 +
  arch/arm/cpu/armv7/am33xx/board.c |   85 +++
  arch/arm/cpu/armv7/am33xx/clock.c |8 +
  arch/arm/cpu/armv7/omap3/Makefile |1 +
  arch/arm/cpu/armv7/omap3/am35x_musb.c |   75 +++
  arch/arm/include/asm/arch-am33xx/cpu.h|   11 +-
  arch/arm/include/asm/arch-am33xx/hardware.h   |4 +
  arch/arm/include/asm/arch-omap3/am35x_def.h   |   27 +
  arch/arm/include/asm/arch-omap3/musb.h|   28 +
  arch/arm/include/asm/omap_musb.h  |   32 +
  arch/mips/cpu/mips32/au1x00/au1x00_usb_ohci.c |2 +-
  arch/powerpc/cpu/mpc5xxx/usb_ohci.c   |2 +-
  arch/powerpc/cpu/ppc4xx/usb_ohci.c|2 +-
  board/logicpd/am3517evm/am3517evm.c   |   74 +++
  board/ti/am335x/board.c   |   23 +-
  board/ti/beagle/beagle.c  |   43 ++
  common/cmd_usb.c  |2 +-
  common/usb.c  |4 +-
  common/usb_kbd.c  |   18 +-
  drivers/usb/gadget/config.c   |1 -
  drivers/usb/gadget/epautoconf.c   |1 -
  drivers/usb/gadget/ether.c|1 -
  drivers/usb/gadget/gadget_chips.h |4 +-
  drivers/usb/gadget/s3c_udc_otg.c  |1 -
  drivers/usb/gadget/usbstring.c|1 -
  drivers/usb/host/ehci-hcd.c   |   16 +-
  drivers/usb/host/isp116x-hcd.c|2 +-
  drivers/usb/host/ohci-hcd.c   |2 +-
  drivers/usb/host/ohci-s3c24xx.c   |2 +-
  drivers/usb/host/r8a66597-hcd.c   |   17 +-
  drivers/usb/host/sl811-hcd.c  |2 +-
  drivers/usb/musb-new/Makefile |   39 ++
  drivers/usb/musb-new/am35x.c  |  709 +
  drivers/usb/musb-new/linux-compat.h   |  116 
  drivers/usb/musb-new/musb_core.c  | 2497 
 ++
  drivers/usb/musb-new/musb_core.h  |  623 +++
  drivers/usb/musb-new/musb_debug.h |   58 ++
  drivers/usb/musb-new/musb_dma.h   |  186 ++
  drivers/usb/musb-new/musb_dsps.c  |  771 +++
  drivers/usb/musb-new/musb_gadget.c| 2333 
 +
  drivers/usb/musb-new/musb_gadget.h|  130 
  drivers/usb/musb-new/musb_gadget_ep0.c| 1089 
 
  drivers/usb/musb-new/musb_host.c  | 2400 
 +++
  drivers/usb/musb-new/musb_host.h  |  114 
  drivers/usb/musb-new/musb_io.h|  146 +
  drivers/usb/musb-new/musb_regs.h  |  645 +++
  drivers/usb/musb-new/musb_uboot.c |  237 +++
  drivers/usb/musb-new/omap2430.c   |  626 +++
  drivers/usb/musb-new/omap2430.h   |   56 ++
  drivers/usb/musb-new/usb-compat.h |   88 +++
  

Re: [U-Boot] [PATCH 1/9] Remove obsolete header file

2012-11-27 Thread Tom Rini
On Wed, Nov 28, 2012 at 02:43:54PM +0200, Pantelis Antoniou wrote:

 usbdescriptors.h conflicts with linux/usb/ch9.h
 Remove it.
 
 Signed-off-by: Pantelis Antoniou pa...@antoniou-consulting.com

Seeing as this change is required to fix building of trats in u-boot-usb
as well now, I am applying this now.  Thanks!

-- 
Tom


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


Re: [U-Boot] Pull request: u-boot-fdt

2012-11-27 Thread Tom Rini
On Mon, Nov 19, 2012 at 08:53:20PM -0500, Jerry Van Baren wrote:

 Dear Tom,
 
 Please pull u-boot-fdt.  These are the patches submitted by Simon Glass
 and his compatriots prior to the v2013.01 merge window closing and are
 thus eligible for inclusion in the v2013.01 release.
 
 Thanks,
 gvb
 
 The following changes since commit 59852d03867108217fe88e3bfc3e1e9cedfe63c5:
 
   Merge branch 'master' of git://www.denx.de/git/u-boot-microblaze
 (2012-11-09 08:47:25 -0700)
 
 are available in the git repository at:
 
   git://git.denx.de/u-boot-fdt.git master
 
 for you to fetch changes up to 008784765ab7f37fb355d5f7fb180661b94c42ab:
 
   fdt: Remove fdtdec_find_alias_node() function (2012-11-12 23:15:25 -0500)
 
 
 Abhilash Kesavan (2):
   fdt: Add function to get config int from device tree
   fdt: Add function for decoding multiple gpios globally available
 
 Che-Liang Chiou (2):
   fdt: Add fdtdec_get_uint64 to decode a 64-bit value from a property
   fdt: Load boot command from device tree
 
 Doug Anderson (1):
   fdt: Allow device tree to specify secure booting
 
 Gabe Black (3):
   fdt: Add function to read boolean property
   fdt: Tell the FDT library where the device tree is
   fdt: Add option to default to most compatible conf in a fit image
 
 Gerald Van Baren (1):
   fdt: Export fdtdec_lookup() and fix the name
 
 Sean Paul (1):
   fdt: Add polarity-aware gpio functions to fdtdec
 
 Simon Glass (4):
   fdt: Add function to get a config string from device tree
   fdt: Add fdtdec_decode_region() to decode memory region
   fdt: Set kernaddr if fdt indicates a kernel is present
   fdt: Remove fdtdec_find_alias_node() function
 
  README |   11 +
  common/cmd_bootm.c |   11 +
  common/image.c |  127
 
  common/main.c  |  102 -
  include/fdtdec.h   |  112 +
  include/image.h|1 +
  lib/fdtdec.c   |  125
 ---
  7 files changed, 461 insertions(+), 28 deletions(-)

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] Pull request: nand flash

2012-11-27 Thread Tom Rini
On Mon, Nov 26, 2012 at 03:49:58PM -0600, Scott Wood wrote:

 The following changes since commit 178d0cc1a4c73c3341afbeb2a93b172de8c96bd1:
 
   Merge branch 'master' of git://git.denx.de/u-boot-video (2012-11-19 
 09:28:04 -0700)
 
 are available in the git repository at:
 
 
   git://git.denx.de/u-boot-nand-flash.git master
 
 for you to fetch changes up to 3287f6d3858faee768a7c47515bd21914ad591a2:
 
   nand: Add torture feature (2012-11-26 15:41:29 -0600)
 
 
 Beno?t Th?baudeau (3):
   nand: Clean up nand_util
   nand: Fix nand_erase_opts() offset check
   nand: Add torture feature
 
 Joe Hershberger (1):
   nand: Move the sub-page read support enable to a flag
 
 Jos? Miguel Gon?alves (1):
   Add u-boot-pad.bin target to the Makefile
 
 Karl O. Pinc (1):
   README: Reference nand monitor commands in U-Boot README
 
 Prabhakar Kushwaha (1):
   driver/mtd:IFC NAND:Initialise internal SRAM before any write
 
 Scott Wood (22):
   serial/ns16550: don't build serial_ns16550 with MIN_FUNCTIONS
   serial/ns16550: wait for TEMT before initializing
   powerpc/mpc85xx: move debug tlb entry after TLB is in known state
   powerpc/mpc85xx: add comma before already enabled
   spl: rename u-boot-pad.bin to u-boot-with-spl.bin
   spl: introduce CONFIG_SPL_TARGET
   powerpc: change .fixup test to a GCC version test
   powerpc/mpc85xx: fix TLB alignment
   powerpc/mpc8xxx: move LAW code into arch/powerpc/cpu/mpc8xxx
   spl/mpc85xx: move udelay to cpu code
   spl: include resetvec and lib8xxx
   spl/mpc85xx: rename cpu_init_nand.c to spl_minimal.c
   powerpc/mpc85xx: consistently use COBJS-y
   spl/powerpc: introduce CONFIG_SPL_INIT_MINIMAL
   spl/85xx: new SPL support
   powerpc/mpc85xx/p1_p2_rdb_pc: new SPL support
   spl/nand: introduce CONFIG_SPL_NAND_DRIVERS, _BASE, and _ECC.
   spl/nand: config symbol documentation
   powerpc/mpc85xx/p1_p2_rdb_pc: convert from nand_spl to new spl
   powerpc/mpc85xx/p1_p2_rdb_pc: clean up memory map
   powerpc/mpc85xx/p2020rdb-pca: Use L2 SRAM for SPL boot
   nand/fsl: add NAND_NO_SUBPAGE_WRITE to eLBC and IFC drivers
 
  Makefile   |   22 ++-
  README |   45 -
  arch/powerpc/config.mk |5 +
  arch/powerpc/cpu/mpc85xx/Makefile  |   38 ++--
  arch/powerpc/cpu/mpc85xx/cpu.c |3 +-
  arch/powerpc/cpu/mpc85xx/cpu_init.c|2 +-
  .../cpu/mpc85xx/{cpu_init_nand.c = spl_minimal.c} |   19 +-
  arch/powerpc/cpu/mpc85xx/start.S   |  123 ++---
  arch/powerpc/cpu/mpc85xx/tlb.c |4 +-
  arch/powerpc/cpu/mpc85xx/u-boot-spl.lds|   87 +
  arch/powerpc/cpu/mpc8xxx/Makefile  |   17 ++
  .../fsl_law.c = arch/powerpc/cpu/mpc8xxx/law.c|   11 +-
  arch/powerpc/lib/Makefile  |   23 ++-
  board/freescale/p1_p2_rdb_pc/Makefile  |   16 ++
  board/freescale/p1_p2_rdb_pc/ddr.c |2 +
  board/freescale/p1_p2_rdb_pc/law.c |2 +-
  board/freescale/p1_p2_rdb_pc/p1_p2_rdb_pc.c|2 +-
  .../freescale/p1_p2_rdb_pc/spl_minimal.c   |   10 +-
  board/freescale/p1_p2_rdb_pc/tlb.c |   22 ++-
  common/cmd_nand.c  |   22 +++
  doc/README.mpc85xx |2 +-
  doc/README.nand|   21 +++
  drivers/misc/Makefile  |1 -
  drivers/mtd/nand/Makefile  |   34 +++-
  drivers/mtd/nand/fsl_elbc_nand.c   |2 +-
  drivers/mtd/nand/fsl_elbc_spl.c|  168 +
  drivers/mtd/nand/fsl_ifc_nand.c|   64 ++-
  drivers/mtd/nand/nand_base.c   |9 +-
  drivers/mtd/nand/nand_util.c   |  188 
 
  drivers/serial/ns16550.c   |3 +
  drivers/serial/serial_ns16550.c|4 +
  include/configs/am3517_crane.h |3 +
  include/configs/am3517_evm.h   |3 +
  include/configs/cam_enc_4xx.h  |3 +
  include/configs/da850evm.h |3 +
  include/configs/devkit8000.h   |3 +
  include/configs/hawkboard.h|3 +
  include/configs/igep00x0.h |3 +
  include/configs/mcx.h  |3 +
  include/configs/omap3_beagle.h |3 +
  include/configs/omap3_evm.h|3 +
  include/configs/omap3_evm_quick_nand.h |3 +
  include/configs/omap3_overo.h

[U-Boot] [PATCH 1/2 v2] tegra: display: add board pinmux

2012-11-27 Thread Marc Dietrich
Boards may require a different pinmux setup for DISPLAY than the default one.
Add a way to call into board specific code to set this up.

Signed-off-by: Marc Dietrich marvi...@gmx.de
---
changes in V2:
- fix comment padding

 arch/arm/include/asm/arch-tegra/board.h |1 +
 board/nvidia/common/board.c |7 +++
 2 files changed, 8 insertions(+)

diff --git a/arch/arm/include/asm/arch-tegra/board.h 
b/arch/arm/include/asm/arch-tegra/board.h
index be6bf25..7453dcd 100644
--- a/arch/arm/include/asm/arch-tegra/board.h
+++ b/arch/arm/include/asm/arch-tegra/board.h
@@ -44,5 +44,6 @@ void gpio_early_init(void);  /* overrideable GPIO config  
  */
 void pin_mux_usb(void);  /* overrideable USB pinmux setup   */
 void pin_mux_spi(void);  /* overrideable SPI pinmux setup   */
 void pin_mux_nand(void); /* overrideable NAND pinmux setup  */
+void pin_mux_display(void);  /* overrideable DISPLAY pinmux setup */
 
 #endif
diff --git a/board/nvidia/common/board.c b/board/nvidia/common/board.c
index 76ec687..819c120 100644
--- a/board/nvidia/common/board.c
+++ b/board/nvidia/common/board.c
@@ -87,6 +87,12 @@ void __pin_mux_nand(void)
 
 void pin_mux_nand(void) __attribute__((weak, alias(__pin_mux_nand)));
 
+void __pin_mux_display(void)
+{
+}
+
+void pin_mux_display(void) __attribute__((weak, alias(__pin_mux_display)));
+
 /*
  * Routine: power_det_init
  * Description: turn off power detects
@@ -126,6 +132,7 @@ int board_init(void)
debug(%s: Failed to init pwm\n, __func__);
 #endif
 #ifdef CONFIG_LCD
+   pin_mux_display();
tegra_lcd_check_next_stage(gd-fdt_blob, 0);
 #endif
/* boot param addr */
-- 
1.7.9.5

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


[U-Boot] [PATCH 2/2 v2] tegra: enable LCD on PAZ00

2012-11-27 Thread Marc Dietrich
This adds LCD panel descriptions to the device tree of PAZ00 and
enables LCD support in the configuration.

Signed-off-by: Marc Dietrich marvi...@gmx.de
---
I'll create a patch to add LCD support to common TEGRA_DEVICE_SETTINGS
once the tegra tree is rebased.

changes in V2:
- s/DISPALY/DISPLAY/
- removed W0 gpio which is not used
- set all panel-timings to 0

 board/compal/dts/tegra20-paz00.dts |   31 +++
 board/compal/paz00/paz00.c |   11 +++
 include/configs/paz00.h|   15 +++
 3 files changed, 57 insertions(+)

diff --git a/board/compal/dts/tegra20-paz00.dts 
b/board/compal/dts/tegra20-paz00.dts
index 9e3e169..8c258ff 100644
--- a/board/compal/dts/tegra20-paz00.dts
+++ b/board/compal/dts/tegra20-paz00.dts
@@ -54,4 +54,35 @@
usb@c5004000 {
status = disabled;
};
+
+   host1x {
+   status = okay;
+   dc@5420 {
+   status = okay;
+   rgb {
+   status = okay;
+   nvidia,panel = lcd_panel;
+   };
+   };
+   };
+
+   lcd_panel: panel {
+   /* PAZ00 has 1024x600 */
+   clock = 5403;
+   xres = 1024;
+   yres = 600;
+   right-margin = 160;
+   left-margin = 24;
+   hsync-len = 136;
+   upper-margin = 3;
+   lower-margin = 61;
+   vsync-len = 6;
+   hsync-active-high;
+   nvidia,bits-per-pixel = 16;
+   nvidia,pwm = pwm 0 0;
+   nvidia,backlight-enable-gpios = gpio 164 0;  /* PU4 */
+   nvidia,lvds-shutdown-gpios = gpio 102 0; /* PM6 */
+   nvidia,panel-vdd-gpios = gpio 4 0;   /* PA4 */
+   nvidia,panel-timings = 0 0 0 0;
+   };
 };
diff --git a/board/compal/paz00/paz00.c b/board/compal/paz00/paz00.c
index 6492d41..1447f47 100644
--- a/board/compal/paz00/paz00.c
+++ b/board/compal/paz00/paz00.c
@@ -71,3 +71,14 @@ int board_mmc_init(bd_t *bd)
return 0;
 }
 #endif
+
+#ifdef CONFIG_LCD
+/* this is a weak define that we are overriding */
+void pin_mux_display(void)
+{
+   debug(init display pinmux\n);
+
+   /* EN_VDD_PANEL GPIO A4 */
+   pinmux_tristate_disable(PINGRP_DAP2);
+}
+#endif
diff --git a/include/configs/paz00.h b/include/configs/paz00.h
index 38c79cf..4a74d00 100644
--- a/include/configs/paz00.h
+++ b/include/configs/paz00.h
@@ -36,6 +36,7 @@
 #define CONFIG_MACH_TYPE   MACH_TYPE_PAZ00
 
 #define CONFIG_BOARD_EARLY_INIT_F
+#define CONFIG_BOARD_LATE_INIT
 
 /* SD/MMC */
 #define CONFIG_MMC
@@ -71,6 +72,20 @@
 #define CONFIG_CMD_NET
 #define CONFIG_CMD_DHCP
 
+#undef TEGRA_DEVICE_SETTINGS
+#define TEGRA_DEVICE_SETTINGS  \
+   stdin=serial\0\
+   stdout=serial,lcd\0   \
+   stderr=serial,lcd\0
+
+/* LCD support */
+#define CONFIG_LCD
+#define CONFIG_PWM_TEGRA
+#define CONFIG_VIDEO_TEGRA
+#define LCD_BPPLCD_COLOR16
+#define CONFIG_SYS_WHITE_ON_BLACK
+#define CONFIG_CONSOLE_SCROLL_LINES10
+
 #include tegra-common-post.h
 
 #endif /* __CONFIG_H */
-- 
1.7.9.5

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


Re: [U-Boot] [PATCH 3/5] Add fuse API and commands

2012-11-27 Thread Eric Nelson

On 11/27/2012 12:19 AM, Dirk Behme wrote:

On 26.11.2012 17:03, Benoît Thébaudeau wrote:

Hi Eric, all,

On Thursday, August 23, 2012 3:23:20 PM, Eric Nelson wrote:

On 08/23/2012 03:31 AM, Stefano Babic wrote:

On 22/08/2012 12:43, Dirk Behme wrote:

On 14.08.2012 14:52, Benoît Thébaudeau wrote:

This can be useful for fuse-like hardware, OTP SoC options, etc.

For i.MX6, I have a port of the OTP support from Freescale's
U-Boot to
our mainline U-Boot in the queue [1].

As I don't have the overview over the various i.MXxx SoCs and
don't
understand much of this patch below: Should this implement the
same
functionality like my patch [1] for i.MX6?

I have not checked the details. but seeing the code it looks that
the
procedure to read / write are different. In this case, a further
driver
is ok.

Anyway, you should take a look if your patches can be used on a mxs
(MX28) device, because they should be closer. And then I will not
like
to have a driver for each SOC.

Generally, I think we should use the approach of the common command
and
a specific fuse implementation. Then this API should be used by
your
patches as well.


I agree.

The use of the fuse API will likely result in more code than the
imxotp implementation, and more importantly, it will make the usage
more confusing by introducing terms bank and row.

Reading and writing fuses is probably not an area that we want
confusion.


I am looking again into this question now that I have the i.MX6 reference
manual.

I don't see any difference between IIM and OCOTP features:
 - There are still banks: They exist as seen from the controller, even
if they
   don't exist physically in the efusebox. See 46.2.1 and OCOTP memory
map
   (Value of OTP Bankx Wordy shadow registers).
 - Rows are named words.
 - The read operations are read accesses to the shadow registers.
 - The sense operations are direct fuse reads (shadow reload + read), as
   explained by the steps in 46.2.1.2.
 - The prog operations are the programming of the fuses, as explained
by the
   steps in 46.2.1.3.
 - The override operations are simple write accesses to the shadow
registers, as
   explained in 46.2.1.3.

As to the vocabulary used, the differences are:
 - row - word.
 - sense - direct read.

Hence, the fuse API applies very well in this case too.


Do you like to update/rebase your patches to the latest U-Boot and
re-send? Maybe it makes sense to discuss your patches again, then?

Eric: What do you think?



Hi Benoit and Dirk,

I don't have strong feelings one way or the other. If left to
me, I'd probably stick with the imxotp command, but Benoît has
clearly walked through the details and we're not talking about
a lot of code either way.

Either way, this needs a general 'readme' for the fuse command
conventions and some per-arch documentation about how to translate
between the reference manual and the command.

It also seems appropriate to have documentation somewhere about
the conventions used for things like mac address storage. AFAIK,
the only place to find the mapping of OTP locations used for this
is in the various bits of code that implement it.

Regards,


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


Re: [U-Boot] [PATCH 2/2] tegra: enable LCD on PAZ00

2012-11-27 Thread Stephen Warren
On 11/26/2012 05:07 PM, Tom Warren wrote:
 TEGRA_DEVICE_SETTINGS patch is assigned to Marek and waiting on him to
 pull 'em thru the USB tree.

It looks like the patch has been in u-boot-usb/master for about a week.

(we really need a linux-next for U-Boot to hide all the pull latency)

So, I'd propose that paz00.h can add the config options to enable LCD
support right now, but that changes to TEGRA_DEVICE_SETTINGS should
instead be implemented generically as a change to the logic in
tegra-common-post.h (and hence support all boards not just paz00),
either applied to u-boot-usb/master right now, or u-boot-tegra/master
once the dependencies are enabled there.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 3/5] Add fuse API and commands

2012-11-27 Thread Benoît Thébaudeau
Hi Eric, Dirk,

On Tuesday, November 27, 2012 5:58:19 PM, Eric Nelson wrote:
 I don't have strong feelings one way or the other. If left to
 me, I'd probably stick with the imxotp command, but Benoît has
 clearly walked through the details and we're not talking about
 a lot of code either way.

OK. The more code is in common, the easier it is to maintain.

 Either way, this needs a general 'readme' for the fuse command
 conventions

Sure. I'll add a doc/README.fuse to v3.

 and some per-arch documentation about how to translate
 between the reference manual and the command.

Yes. Should this documentation be located in the README.fuse, or in separate
README files, or in the drivers themselves, e.g. fsl_iim.c?

 It also seems appropriate to have documentation somewhere about
 the conventions used for things like mac address storage. AFAIK,
 the only place to find the mapping of OTP locations used for this
 is in the various bits of code that implement it.

Yes. Currently, it can be found in the various imx-regs.h, in the
fuse_bankx_regs structures. This information could be added to README.imx*.

There is also an imx_get_mac_from_fuse() function implemented for each i.MX SoC
to load the MAC address from the fuses for the FEC. Perhaps a similar function
with a default implementation could be created by each applicable SoC and used
by a new command in cmd_fuse.c to handle MAC addresses read/write operations.
But this would perhaps be too specific for cmd_fuse.c. It might be better to
either have only the README.imx* documentation, or to have SoC-specific commands
for the MAC addresses, like for the clock commands. What do you think?

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


[U-Boot] [PATCH 0/4] enable USB OHCI on sam9x5ek boards

2012-11-27 Thread Richard Genoud
This small patchset is based on current master ( 
178d0cc1a4c73c3341afbeb2a93b172de8c96bd1 )
It enables usb ohci on at91sam9x5ek boards.
Tested it with a sam9g35 CPU and a usb key.

Richard Genoud (4):
  usb documentation: fix typo
  ARM: at91sam9x5: enable USB OHCI support for 9x5ek board.
  at91sam9x5ek: regroup FAT/DOS features
  at91sam9x5ek: add USB OHCI configuration

 arch/arm/cpu/arm926ejs/at91/at91sam9x5_devices.c |9 +
 arch/arm/include/asm/arch-at91/at91sam9x5.h  |2 ++
 board/atmel/at91sam9x5ek/at91sam9x5ek.c  |3 +++
 doc/README.usb   |2 +-
 drivers/usb/host/ohci-at91.c |6 --
 include/configs/at91sam9x5ek.h   |   18 +-
 6 files changed, 36 insertions(+), 4 deletions(-)

-- 
1.7.2.5

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


[U-Boot] [PATCH 1/4] usb documentation: fix typo

2012-11-27 Thread Richard Genoud
Signed-off-by: Richard Genoud richard.gen...@gmail.com
---
 doc/README.usb |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/doc/README.usb b/doc/README.usb
index ef1d6ba..b4c3ef5 100644
--- a/doc/README.usb
+++ b/doc/README.usb
@@ -63,7 +63,7 @@ Common USB Commands:
 Storage USB Commands:
 - usb scan:scans the USB for storage devices.The USB must be
running for this command (usb start)
-- usb device [dev]: show or set current USB staorage device
+- usb device [dev]: show or set current USB storage device
 - usb part [dev]:   print partition table of one or all USB storage
devices
 - usb read addr blk# cnt:
-- 
1.7.2.5

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


[U-Boot] [PATCH 3/4] at91sam9x5ek: regroup FAT/DOS features

2012-11-27 Thread Richard Genoud
Signed-off-by: Richard Genoud richard.gen...@gmail.com
---
 include/configs/at91sam9x5ek.h |6 +-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/include/configs/at91sam9x5ek.h b/include/configs/at91sam9x5ek.h
index 71f765b..5e5f9c1 100644
--- a/include/configs/at91sam9x5ek.h
+++ b/include/configs/at91sam9x5ek.h
@@ -90,6 +90,7 @@
 #define CONFIG_CMD_NAND
 #define CONFIG_CMD_SF
 #define CONFIG_CMD_MMC
+#define CONFIG_CMD_FAT
 
 /* SDRAM */
 #define CONFIG_NR_DRAM_BANKS   1
@@ -142,9 +143,12 @@
 /* MMC */
 #ifdef CONFIG_CMD_MMC
 #define CONFIG_MMC
-#define CONFIG_CMD_FAT
 #define CONFIG_GENERIC_MMC
 #define CONFIG_GENERIC_ATMEL_MCI
+#endif
+
+/* FAT */
+#ifdef CONFIG_CMD_FAT
 #define CONFIG_DOS_PARTITION
 #endif
 
-- 
1.7.2.5

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


[U-Boot] [PATCH 4/4] at91sam9x5ek: add USB OHCI configuration

2012-11-27 Thread Richard Genoud
Signed-off-by: Richard Genoud richard.gen...@gmail.com
---
 include/configs/at91sam9x5ek.h |   12 
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/include/configs/at91sam9x5ek.h b/include/configs/at91sam9x5ek.h
index 5e5f9c1..444d83e 100644
--- a/include/configs/at91sam9x5ek.h
+++ b/include/configs/at91sam9x5ek.h
@@ -91,6 +91,7 @@
 #define CONFIG_CMD_SF
 #define CONFIG_CMD_MMC
 #define CONFIG_CMD_FAT
+#define CONFIG_CMD_USB
 
 /* SDRAM */
 #define CONFIG_NR_DRAM_BANKS   1
@@ -158,6 +159,17 @@
 #define CONFIG_NET_RETRY_COUNT 20
 #define CONFIG_MACB_SEARCH_PHY
 
+/* USB */
+#ifdef CONFIG_CMD_USB
+#define CONFIG_USB_ATMEL
+#define CONFIG_USB_OHCI_NEW
+#define CONFIG_SYS_USB_OHCI_CPU_INIT
+#define CONFIG_SYS_USB_OHCI_REGS_BASE  0x0060  /* 
ATMEL_BASE_OHCI */
+#define CONFIG_SYS_USB_OHCI_SLOT_NAME  at91sam9x5
+#define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 2
+#define CONFIG_USB_STORAGE
+#endif
+
 #define CONFIG_SYS_LOAD_ADDR   0x2200  /* load address */
 
 #define CONFIG_SYS_MEMTEST_START   CONFIG_SYS_SDRAM_BASE
-- 
1.7.2.5

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


[U-Boot] [PATCH 2/4] ARM: at91sam9x5: enable USB OHCI support for 9x5ek board.

2012-11-27 Thread Richard Genoud
Signed-off-by: Richard Genoud richard.gen...@gmail.com
---
 arch/arm/cpu/arm926ejs/at91/at91sam9x5_devices.c |9 +
 arch/arm/include/asm/arch-at91/at91sam9x5.h  |2 ++
 board/atmel/at91sam9x5ek/at91sam9x5ek.c  |3 +++
 drivers/usb/host/ohci-at91.c |6 --
 4 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/arch/arm/cpu/arm926ejs/at91/at91sam9x5_devices.c 
b/arch/arm/cpu/arm926ejs/at91/at91sam9x5_devices.c
index 9348552..6af5a88 100644
--- a/arch/arm/cpu/arm926ejs/at91/at91sam9x5_devices.c
+++ b/arch/arm/cpu/arm926ejs/at91/at91sam9x5_devices.c
@@ -193,6 +193,15 @@ void at91_spi1_hw_init(unsigned long cs_mask)
 }
 #endif
 
+#ifdef CONFIG_USB_OHCI_NEW
+void at91_uhp_hw_init(void)
+{
+   /* Enable VBus on UHP ports */
+   at91_set_pio_output(AT91_PIO_PORTD, 19, 0);
+   at91_set_pio_output(AT91_PIO_PORTD, 20, 0);
+}
+#endif
+
 #ifdef CONFIG_MACB
 void at91_macb_hw_init(void)
 {
diff --git a/arch/arm/include/asm/arch-at91/at91sam9x5.h 
b/arch/arm/include/asm/arch-at91/at91sam9x5.h
index 0e728c9..de0f1b1 100644
--- a/arch/arm/include/asm/arch-at91/at91sam9x5.h
+++ b/arch/arm/include/asm/arch-at91/at91sam9x5.h
@@ -154,6 +154,8 @@
 #define ATMEL_PIO_PORTS 4
 #define CPU_HAS_PIO3
 #define PIO_SCDR_DIV(0x3fff   0)  /* Slow Clock Divider Mask */
+#define ATMEL_PMC_UHP  AT91SAM926x_PMC_UHP
+#define ATMEL_ID_UHP   ATMEL_ID_UHPHS
 
 /*
  * at91sam9x5 specific prototypes
diff --git a/board/atmel/at91sam9x5ek/at91sam9x5ek.c 
b/board/atmel/at91sam9x5ek/at91sam9x5ek.c
index edb0886..9837a17 100644
--- a/board/atmel/at91sam9x5ek/at91sam9x5ek.c
+++ b/board/atmel/at91sam9x5ek/at91sam9x5ek.c
@@ -295,6 +295,9 @@ int board_init(void)
at91_macb_hw_init();
 #endif
 
+#ifdef CONFIG_USB_OHCI_NEW
+   at91_uhp_hw_init();
+#endif
 #ifdef CONFIG_LCD
at91sam9x5ek_lcd_hw_init();
 #endif
diff --git a/drivers/usb/host/ohci-at91.c b/drivers/usb/host/ohci-at91.c
index 9532dd9..efd711d 100644
--- a/drivers/usb/host/ohci-at91.c
+++ b/drivers/usb/host/ohci-at91.c
@@ -41,7 +41,8 @@ int usb_cpu_init(void)
writel(get_pllb_init(), pmc-pllbr);
while ((readl(pmc-sr)  AT91_PMC_LOCKB) != AT91_PMC_LOCKB)
;
-#elif defined(CONFIG_AT91SAM9G45) || defined(CONFIG_AT91SAM9M10G45)
+#elif defined(CONFIG_AT91SAM9G45) || defined(CONFIG_AT91SAM9M10G45) || \
+   defined(CONFIG_AT91SAM9X5)
/* Enable UPLL */
writel(readl(pmc-uckr) | AT91_PMC_UPLLEN | AT91_PMC_BIASEN,
pmc-uckr);
@@ -81,7 +82,8 @@ int usb_cpu_stop(void)
writel(0, pmc-pllbr);
while ((readl(pmc-sr)  AT91_PMC_LOCKB) != 0)
;
-#elif defined(CONFIG_AT91SAM9G45) || defined(CONFIG_AT91SAM9M10G45)
+#elif defined(CONFIG_AT91SAM9G45) || defined(CONFIG_AT91SAM9M10G45) || \
+   defined(CONFIG_AT91SAM9X5)
/* Disable UPLL */
writel(readl(pmc-uckr)  (~AT91_PMC_UPLLEN), pmc-uckr);
while ((readl(pmc-sr)  AT91_PMC_LOCKU) == AT91_PMC_LOCKU)
-- 
1.7.2.5

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


[U-Boot] [PATCH] Remove unused CONFIG_PHYS_SDRAM_1_SIZE

2012-11-27 Thread Thomas Weber
Signed-off-by: Thomas Weber tho...@tomweber.eu
---
 include/configs/cm_t35.h | 1 -
 include/configs/dig297.h | 1 -
 include/configs/igep00x0.h   | 1 -
 include/configs/mcx.h| 1 -
 include/configs/omap3_mvblx.h| 1 -
 include/configs/omap3_pandora.h  | 1 -
 include/configs/omap3_sdp3430.h  | 1 -
 include/configs/omap3_zoom1.h| 1 -
 include/configs/omap3_zoom2.h| 1 -
 include/configs/tam3517-common.h | 1 -
 include/configs/tricorder.h  | 1 -
 11 files changed, 11 deletions(-)

diff --git a/include/configs/cm_t35.h b/include/configs/cm_t35.h
index 568ae8e..7c503d2 100644
--- a/include/configs/cm_t35.h
+++ b/include/configs/cm_t35.h
@@ -282,7 +282,6 @@
  */
 #define CONFIG_NR_DRAM_BANKS   1   /* CS1 is never populated */
 #define PHYS_SDRAM_1   OMAP34XX_SDRC_CS0
-#define PHYS_SDRAM_1_SIZE  (32  20)  /* at least 32 MiB */
 
 /*---
  * FLASH and environment organization
diff --git a/include/configs/dig297.h b/include/configs/dig297.h
index dda7582..721b91c 100644
--- a/include/configs/dig297.h
+++ b/include/configs/dig297.h
@@ -263,7 +263,6 @@
  */
 #define CONFIG_NR_DRAM_BANKS   2   /* CS1 may or may not be populated */
 #define PHYS_SDRAM_1   OMAP34XX_SDRC_CS0
-#define PHYS_SDRAM_1_SIZE  (32  20)  /* at least 32 MiB */
 #define PHYS_SDRAM_2   OMAP34XX_SDRC_CS1
 
 /*---
diff --git a/include/configs/igep00x0.h b/include/configs/igep00x0.h
index c81ab76..85eed8e 100644
--- a/include/configs/igep00x0.h
+++ b/include/configs/igep00x0.h
@@ -236,7 +236,6 @@
  */
 #define CONFIG_NR_DRAM_BANKS   2   /* CS1 may or may not be populated */
 #define PHYS_SDRAM_1   OMAP34XX_SDRC_CS0
-#define PHYS_SDRAM_1_SIZE  (32  20)  /* at least 32 meg */
 #define PHYS_SDRAM_2   OMAP34XX_SDRC_CS1
 
 /*
diff --git a/include/configs/mcx.h b/include/configs/mcx.h
index bf49cc1..a436149 100644
--- a/include/configs/mcx.h
+++ b/include/configs/mcx.h
@@ -323,7 +323,6 @@
  */
 #define CONFIG_NR_DRAM_BANKS   2   /* CS1 may or may not be populated */
 #define PHYS_SDRAM_1   OMAP34XX_SDRC_CS0
-#define PHYS_SDRAM_1_SIZE  (32  20)  /* at least 32 MiB */
 #define PHYS_SDRAM_2   OMAP34XX_SDRC_CS1
 
 /*
diff --git a/include/configs/omap3_mvblx.h b/include/configs/omap3_mvblx.h
index 67af314..09a0b2f 100644
--- a/include/configs/omap3_mvblx.h
+++ b/include/configs/omap3_mvblx.h
@@ -251,7 +251,6 @@
  */
 #define CONFIG_NR_DRAM_BANKS   1
 #define PHYS_SDRAM_1   OMAP34XX_SDRC_CS0
-#define PHYS_SDRAM_1_SIZE  (32  20)  /* at least 32 MiB */
 #define PHYS_SDRAM_2   OMAP34XX_SDRC_CS1
 
 #define CONFIG_ENV_IS_NOWHERE  1
diff --git a/include/configs/omap3_pandora.h b/include/configs/omap3_pandora.h
index 8a8a5d1..217f306 100644
--- a/include/configs/omap3_pandora.h
+++ b/include/configs/omap3_pandora.h
@@ -221,7 +221,6 @@
  */
 #define CONFIG_NR_DRAM_BANKS   2   /* CS1 may or may not be populated */
 #define PHYS_SDRAM_1   OMAP34XX_SDRC_CS0
-#define PHYS_SDRAM_1_SIZE  (32  20)  /* at least 32 MiB */
 #define PHYS_SDRAM_2   OMAP34XX_SDRC_CS1
 
 #define CONFIG_SYS_TEXT_BASE   0x80008000
diff --git a/include/configs/omap3_sdp3430.h b/include/configs/omap3_sdp3430.h
index 2a890c9..b02ec85 100644
--- a/include/configs/omap3_sdp3430.h
+++ b/include/configs/omap3_sdp3430.h
@@ -303,7 +303,6 @@
  */
 #define CONFIG_NR_DRAM_BANKS   2   /* CS1 may or may not be populated */
 #define PHYS_SDRAM_1   OMAP34XX_SDRC_CS0
-#define PHYS_SDRAM_1_SIZE  (32  20) /* at least 32 meg */
 #define PHYS_SDRAM_2   OMAP34XX_SDRC_CS1
 
 /*--*/
diff --git a/include/configs/omap3_zoom1.h b/include/configs/omap3_zoom1.h
index e152055..ee4cbd7 100644
--- a/include/configs/omap3_zoom1.h
+++ b/include/configs/omap3_zoom1.h
@@ -252,7 +252,6 @@
  */
 #define CONFIG_NR_DRAM_BANKS   2   /* CS1 may or may not be populated */
 #define PHYS_SDRAM_1   OMAP34XX_SDRC_CS0
-#define PHYS_SDRAM_1_SIZE  (32  20)  /* at least 32 MiB */
 #define PHYS_SDRAM_2   OMAP34XX_SDRC_CS1
 
 /*---
diff --git a/include/configs/omap3_zoom2.h b/include/configs/omap3_zoom2.h
index d681424..a6b48a8 100644
--- a/include/configs/omap3_zoom2.h
+++ b/include/configs/omap3_zoom2.h
@@ -221,7 +221,6 @@
  */
 #define CONFIG_NR_DRAM_BANKS   2   /* CS1 may or may not be populated */
 #define PHYS_SDRAM_1   OMAP34XX_SDRC_CS0
-#define PHYS_SDRAM_1_SIZE  (32  20)  /* at least 32 MiB */
 #define PHYS_SDRAM_2   OMAP34XX_SDRC_CS1
 
 /*---
diff --git a/include/configs/tam3517-common.h b/include/configs/tam3517-common.h

Re: [U-Boot] [PATCH 3/5] Add fuse API and commands

2012-11-27 Thread Eric Nelson

Hi Benoît,

On 11/27/2012 11:27 AM, Benoît Thébaudeau wrote:

Hi Eric, Dirk,

On Tuesday, November 27, 2012 5:58:19 PM, Eric Nelson wrote:

I don't have strong feelings one way or the other. If left to
me, I'd probably stick with the imxotp command, but Benoît has
clearly walked through the details and we're not talking about
a lot of code either way.


OK. The more code is in common, the easier it is to maintain.


Either way, this needs a general 'readme' for the fuse command
conventions


Sure. I'll add a doc/README.fuse to v3.


and some per-arch documentation about how to translate
between the reference manual and the command.


Yes. Should this documentation be located in the README.fuse, or in separate
README files, or in the drivers themselves, e.g. fsl_iim.c?



I think doc/readme.imx* is the right place.

Oops. It looks like we need one of these for i.MX6.


It also seems appropriate to have documentation somewhere about
the conventions used for things like mac address storage. AFAIK,
the only place to find the mapping of OTP locations used for this
is in the various bits of code that implement it.


Yes. Currently, it can be found in the various imx-regs.h, in the
fuse_bankx_regs structures. This information could be added to README.imx*.

There is also an imx_get_mac_from_fuse() function implemented for each i.MX SoC
to load the MAC address from the fuses for the FEC. Perhaps a similar function
with a default implementation could be created by each applicable SoC and used
by a new command in cmd_fuse.c to handle MAC addresses read/write operations.
But this would perhaps be too specific for cmd_fuse.c. It might be better to
either have only the README.imx* documentation, or to have SoC-specific commands
for the MAC addresses, like for the clock commands. What do you think?



Since this really only hits us board vendors, and is mostly used
in the production process, it's probably overkill to implement a command
to make it easier.


Best regards,
Benoît



Regards,


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


Re: [U-Boot] [PATCH V4 6/7] mmc: add bcm2835 driver

2012-11-27 Thread Albert ARIBAUD
Hi Stephen,

On Tue, 27 Nov 2012 09:32:27 -0700, Stephen Warren
swar...@wwwdotorg.org wrote:

 On 11/26/2012 11:49 PM, Albert ARIBAUD wrote:
  On Mon, 26 Nov 2012 21:38:16 -0700, Stephen Warren
  swar...@wwwdotorg.org wrote:
  
  This adds a simple driver for the BCM2835's SD controller.
 
  Workarounds are implemented for:
  * Register writes can't be too close to each-other in time, or they will
be lost.
  * Register accesses must all be 32-bit, so implement custom accessors.
 
  This code was extracted from:
  git://github.com/gonzoua/u-boot-pi.git master
  which was created by Oleksandr Tymoshenko.
 
  Portions of the code there were obviously based on the Linux kernel at:
  git://github.com/raspberrypi/linux.git rpi-3.6.y
  commit f5b930b Main bcm2708 linux port signed-off-by Dom Cobley.
 
  swarren changed the following for upstream:
  * Removed hack udelay()s in bcm2835_sdhci_raw_writel(); setting
SDHCI_QUIRK_WAIT_SEND_CMD appears to solve the issues.
  * Remove register logging from read*/write* functions.
  * Sort out confusion with min/max_freq values passed to add_sdhci().
  * Use more descriptive variable names and calculations in IO accessors.
  * Simplified and commented twoticks_delay calculation.
  * checkpatch fixes.
 
  Cc: Andy Fleming aflem...@gmail.com
  
  Hi Andy,
  
  As soon as you give your Ack to this patch, I'll apply the
  whole series to u-boot-arm/master.
 
 Do feel free to apply all the patches before the MMC driver addition
 without waiting for the MMC driver though.

You're right. I'll apply 1 to 5 and wait for Andy's comment to be taken
into account for applying 6 and 7, possibly in a newer version.

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


Re: [U-Boot] [PATCH v5 00/11] S3C24XX: Add support to MINI2416 board

2012-11-27 Thread Scott Wood

On 11/27/2012 08:56:03 AM, José Miguel Gonçalves wrote:

Hi,

Can you tell me if this patch series is going to be included on next  
u-boot release?

Do you need anything from my side in order to push this?


The NAND driver patch is:
Acked-by: Scott Wood scottw...@freescale.com

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


Re: [U-Boot] [PATCH 3/5] Add fuse API and commands

2012-11-27 Thread Benoît Thébaudeau
Hi Eric,

On Tuesday, November 27, 2012 7:36:41 PM, Eric Nelson wrote:
 Hi Benoît,
 
 On 11/27/2012 11:27 AM, Benoît Thébaudeau wrote:
  Hi Eric, Dirk,
 
  and some per-arch documentation about how to translate
  between the reference manual and the command.
 
  Yes. Should this documentation be located in the README.fuse, or in
  separate
  README files, or in the drivers themselves, e.g. fsl_iim.c?
 
 
 I think doc/readme.imx* is the right place.

MPC/i.MX25/35/51/53 would have the same documentation here since they all use
the IIM. On the other side, there would be the i.MX6 with the OCOTP. So this
part of the documentation is rather IP-specific than SoC- or platform-specific.
Hence, I think that the right place would be either README.fuse, or
README.fsl_iim/README.fsl_ocotp[/...], or fsl_iim.c/fsl_ocotp.c[/...].

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


Re: [U-Boot] [PATCH 2/2] tegra: enable LCD on PAZ00

2012-11-27 Thread Stephen Warren
On 11/27/2012 10:42 AM, Stephen Warren wrote:
 On 11/26/2012 05:07 PM, Tom Warren wrote:
 TEGRA_DEVICE_SETTINGS patch is assigned to Marek and waiting on him to
 pull 'em thru the USB tree.
 
 It looks like the patch has been in u-boot-usb/master for about a week.
 
 (we really need a linux-next for U-Boot to hide all the pull latency)
 
 So, I'd propose that paz00.h can add the config options to enable LCD
 support right now, but that changes to TEGRA_DEVICE_SETTINGS should
 instead be implemented generically as a change to the logic in
 tegra-common-post.h (and hence support all boards not just paz00),
 either applied to u-boot-usb/master right now, or u-boot-tegra/master
 once the dependencies are enabled there.

It's been pointed out that Seaboard already uses this method to override
TEGRA_DEVICE_SETTINGS. Given that precedent, I withdraw any objection.
We'll just have to remember to fix this all up once the
TEGRA_DEVICE_SETTINGS patch makes its way from u-boot-usb to u-boot-tegra.

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


Re: [U-Boot] [PATCH 3/5] Add fuse API and commands

2012-11-27 Thread Eric Nelson

On 11/27/2012 12:23 PM, Benoît Thébaudeau wrote:

Hi Eric,

On Tuesday, November 27, 2012 7:36:41 PM, Eric Nelson wrote:

Hi Benoît,

On 11/27/2012 11:27 AM, Benoît Thébaudeau wrote:

Hi Eric, Dirk,


and some per-arch documentation about how to translate
between the reference manual and the command.


Yes. Should this documentation be located in the README.fuse, or in
separate
README files, or in the drivers themselves, e.g. fsl_iim.c?



I think doc/readme.imx* is the right place.


MPC/i.MX25/35/51/53 would have the same documentation here since they all use
the IIM. On the other side, there would be the i.MX6 with the OCOTP. So this
part of the documentation is rather IP-specific than SoC- or platform-specific.
Hence, I think that the right place would be either README.fuse, or
README.fsl_iim/README.fsl_ocotp[/...], or fsl_iim.c/fsl_ocotp.c[/...].



Sounds good to me.


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


[U-Boot] [RFC/PATCHv2] OMAP3: Remove unused PHYS_SDRAM_1_SIZE

2012-11-27 Thread Thomas Weber
Remove the unused PHYS_SDRAM_1_SIZE from OMAP3 config files.

Signed-off-by: Thomas Weber tho...@tomweber.eu
---
Changelog:
v2: - Correct name of define
- Add commit message

 include/configs/cm_t35.h | 1 -
 include/configs/dig297.h | 1 -
 include/configs/igep00x0.h   | 1 -
 include/configs/mcx.h| 1 -
 include/configs/omap3_mvblx.h| 1 -
 include/configs/omap3_pandora.h  | 1 -
 include/configs/omap3_sdp3430.h  | 1 -
 include/configs/omap3_zoom1.h| 1 -
 include/configs/omap3_zoom2.h| 1 -
 include/configs/tam3517-common.h | 1 -
 include/configs/tricorder.h  | 1 -
 11 files changed, 11 deletions(-)

diff --git a/include/configs/cm_t35.h b/include/configs/cm_t35.h
index 568ae8e..7c503d2 100644
--- a/include/configs/cm_t35.h
+++ b/include/configs/cm_t35.h
@@ -282,7 +282,6 @@
  */
 #define CONFIG_NR_DRAM_BANKS   1   /* CS1 is never populated */
 #define PHYS_SDRAM_1   OMAP34XX_SDRC_CS0
-#define PHYS_SDRAM_1_SIZE  (32  20)  /* at least 32 MiB */
 
 /*---
  * FLASH and environment organization
diff --git a/include/configs/dig297.h b/include/configs/dig297.h
index dda7582..721b91c 100644
--- a/include/configs/dig297.h
+++ b/include/configs/dig297.h
@@ -263,7 +263,6 @@
  */
 #define CONFIG_NR_DRAM_BANKS   2   /* CS1 may or may not be populated */
 #define PHYS_SDRAM_1   OMAP34XX_SDRC_CS0
-#define PHYS_SDRAM_1_SIZE  (32  20)  /* at least 32 MiB */
 #define PHYS_SDRAM_2   OMAP34XX_SDRC_CS1
 
 /*---
diff --git a/include/configs/igep00x0.h b/include/configs/igep00x0.h
index c81ab76..85eed8e 100644
--- a/include/configs/igep00x0.h
+++ b/include/configs/igep00x0.h
@@ -236,7 +236,6 @@
  */
 #define CONFIG_NR_DRAM_BANKS   2   /* CS1 may or may not be populated */
 #define PHYS_SDRAM_1   OMAP34XX_SDRC_CS0
-#define PHYS_SDRAM_1_SIZE  (32  20)  /* at least 32 meg */
 #define PHYS_SDRAM_2   OMAP34XX_SDRC_CS1
 
 /*
diff --git a/include/configs/mcx.h b/include/configs/mcx.h
index bf49cc1..a436149 100644
--- a/include/configs/mcx.h
+++ b/include/configs/mcx.h
@@ -323,7 +323,6 @@
  */
 #define CONFIG_NR_DRAM_BANKS   2   /* CS1 may or may not be populated */
 #define PHYS_SDRAM_1   OMAP34XX_SDRC_CS0
-#define PHYS_SDRAM_1_SIZE  (32  20)  /* at least 32 MiB */
 #define PHYS_SDRAM_2   OMAP34XX_SDRC_CS1
 
 /*
diff --git a/include/configs/omap3_mvblx.h b/include/configs/omap3_mvblx.h
index 67af314..09a0b2f 100644
--- a/include/configs/omap3_mvblx.h
+++ b/include/configs/omap3_mvblx.h
@@ -251,7 +251,6 @@
  */
 #define CONFIG_NR_DRAM_BANKS   1
 #define PHYS_SDRAM_1   OMAP34XX_SDRC_CS0
-#define PHYS_SDRAM_1_SIZE  (32  20)  /* at least 32 MiB */
 #define PHYS_SDRAM_2   OMAP34XX_SDRC_CS1
 
 #define CONFIG_ENV_IS_NOWHERE  1
diff --git a/include/configs/omap3_pandora.h b/include/configs/omap3_pandora.h
index 8a8a5d1..217f306 100644
--- a/include/configs/omap3_pandora.h
+++ b/include/configs/omap3_pandora.h
@@ -221,7 +221,6 @@
  */
 #define CONFIG_NR_DRAM_BANKS   2   /* CS1 may or may not be populated */
 #define PHYS_SDRAM_1   OMAP34XX_SDRC_CS0
-#define PHYS_SDRAM_1_SIZE  (32  20)  /* at least 32 MiB */
 #define PHYS_SDRAM_2   OMAP34XX_SDRC_CS1
 
 #define CONFIG_SYS_TEXT_BASE   0x80008000
diff --git a/include/configs/omap3_sdp3430.h b/include/configs/omap3_sdp3430.h
index 2a890c9..b02ec85 100644
--- a/include/configs/omap3_sdp3430.h
+++ b/include/configs/omap3_sdp3430.h
@@ -303,7 +303,6 @@
  */
 #define CONFIG_NR_DRAM_BANKS   2   /* CS1 may or may not be populated */
 #define PHYS_SDRAM_1   OMAP34XX_SDRC_CS0
-#define PHYS_SDRAM_1_SIZE  (32  20) /* at least 32 meg */
 #define PHYS_SDRAM_2   OMAP34XX_SDRC_CS1
 
 /*--*/
diff --git a/include/configs/omap3_zoom1.h b/include/configs/omap3_zoom1.h
index e152055..ee4cbd7 100644
--- a/include/configs/omap3_zoom1.h
+++ b/include/configs/omap3_zoom1.h
@@ -252,7 +252,6 @@
  */
 #define CONFIG_NR_DRAM_BANKS   2   /* CS1 may or may not be populated */
 #define PHYS_SDRAM_1   OMAP34XX_SDRC_CS0
-#define PHYS_SDRAM_1_SIZE  (32  20)  /* at least 32 MiB */
 #define PHYS_SDRAM_2   OMAP34XX_SDRC_CS1
 
 /*---
diff --git a/include/configs/omap3_zoom2.h b/include/configs/omap3_zoom2.h
index d681424..a6b48a8 100644
--- a/include/configs/omap3_zoom2.h
+++ b/include/configs/omap3_zoom2.h
@@ -221,7 +221,6 @@
  */
 #define CONFIG_NR_DRAM_BANKS   2   /* CS1 may or may not be populated */
 #define PHYS_SDRAM_1   OMAP34XX_SDRC_CS0
-#define PHYS_SDRAM_1_SIZE  (32  20)  /* at least 32 MiB */
 #define PHYS_SDRAM_2   OMAP34XX_SDRC_CS1
 
 

Re: [U-Boot] [PATCH 1/9] Remove obsolete header file

2012-11-27 Thread Marek Vasut
Dear Tom Rini,

 On Wed, Nov 28, 2012 at 02:43:54PM +0200, Pantelis Antoniou wrote:
  usbdescriptors.h conflicts with linux/usb/ch9.h
  Remove it.
  
  Signed-off-by: Pantelis Antoniou pa...@antoniou-consulting.com
 
 Seeing as this change is required to fix building of trats in u-boot-usb
 as well now, I am applying this now.  Thanks!

Only this or the whole series?

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


Re: [U-Boot] [PATCH 2/2] tegra: enable LCD on PAZ00

2012-11-27 Thread Marek Vasut
Dear Stephen Warren,

 On 11/27/2012 10:42 AM, Stephen Warren wrote:
  On 11/26/2012 05:07 PM, Tom Warren wrote:
  TEGRA_DEVICE_SETTINGS patch is assigned to Marek and waiting on him to
  pull 'em thru the USB tree.
  
  It looks like the patch has been in u-boot-usb/master for about a week.
  
  (we really need a linux-next for U-Boot to hide all the pull latency)
  
  So, I'd propose that paz00.h can add the config options to enable LCD
  support right now, but that changes to TEGRA_DEVICE_SETTINGS should
  instead be implemented generically as a change to the logic in
  tegra-common-post.h (and hence support all boards not just paz00),
  either applied to u-boot-usb/master right now, or u-boot-tegra/master
  once the dependencies are enabled there.
 
 It's been pointed out that Seaboard already uses this method to override
 TEGRA_DEVICE_SETTINGS. Given that precedent, I withdraw any objection.
 We'll just have to remember to fix this all up once the
 TEGRA_DEVICE_SETTINGS patch makes its way from u-boot-usb to u-boot-tegra.

Wasn't u-boot-usb pulled just recently?

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


Re: [U-Boot] [PATCH 2/4] env_nand.c: support falling back to redundant env when writing

2012-11-27 Thread Scott Wood

On 11/21/2012 06:59:19 AM, Phil Sutter wrote:
Without this patch, when the currently chosen environment to be  
written

has bad blocks, saveenv fails completely. Instead, when there is
redundant environment fall back to the other copy. Environment reading
needs no adjustment, as the fallback logic for incomplete writes  
applies

to this case as well.

Signed-off-by: Phil Sutter phil.sut...@viprinet.com


Isn't this what CONFIG_ENV_RANGE is supposed to deal with?

Redundant environment is to deal with other problems such as a power  
failure during saveenv.  If you just fall back to the other copy,  
you're silently losing the redundancy.


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


Re: [U-Boot] [PATCH 3/4] env_nand.c: do warn only if really no valid environment could be loaded

2012-11-27 Thread Scott Wood

On 11/21/2012 06:59:20 AM, Phil Sutter wrote:

The warning is misleading, since there is no equivalent success note
when reading the other copy succeeds.

Signed-off-by: Phil Sutter phil.sut...@viprinet.com
---
 common/env_nand.c |9 +
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/common/env_nand.c b/common/env_nand.c
index 895532b..58ba558 100644
--- a/common/env_nand.c
+++ b/common/env_nand.c
@@ -315,6 +315,7 @@ int get_nand_env_oob(nand_info_t *nand, unsigned  
long *result)

 void env_relocate_spec(void)
 {
 #if !defined(ENV_IS_EMBEDDED)
+   int read1_fail = 0, read2_fail = 0;
int crc1_ok = 0, crc2_ok = 0;
env_t *ep, *tmp_env1, *tmp_env2;

@@ -326,11 +327,11 @@ void env_relocate_spec(void)
goto done;
}

-   if (readenv(CONFIG_ENV_OFFSET, (u_char *) tmp_env1))
-   puts(No Valid Environment Area found\n);
+   read1_fail = readenv(CONFIG_ENV_OFFSET, (u_char *) tmp_env1);
+	read2_fail = readenv(CONFIG_ENV_OFFSET_REDUND, (u_char *)  
tmp_env2);


Why read the redundant environment if the the main one didn't fail?

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


Re: [U-Boot] [PATCH 3/4] env_nand.c: do warn only if really no valid environment could be loaded

2012-11-27 Thread Scott Wood

On 11/27/2012 04:06:03 PM, Scott Wood wrote:

On 11/21/2012 06:59:20 AM, Phil Sutter wrote:

The warning is misleading, since there is no equivalent success note
when reading the other copy succeeds.

Signed-off-by: Phil Sutter phil.sut...@viprinet.com
---
 common/env_nand.c |9 +
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/common/env_nand.c b/common/env_nand.c
index 895532b..58ba558 100644
--- a/common/env_nand.c
+++ b/common/env_nand.c
@@ -315,6 +315,7 @@ int get_nand_env_oob(nand_info_t *nand, unsigned  
long *result)

 void env_relocate_spec(void)
 {
 #if !defined(ENV_IS_EMBEDDED)
+   int read1_fail = 0, read2_fail = 0;
int crc1_ok = 0, crc2_ok = 0;
env_t *ep, *tmp_env1, *tmp_env2;

@@ -326,11 +327,11 @@ void env_relocate_spec(void)
goto done;
}

-   if (readenv(CONFIG_ENV_OFFSET, (u_char *) tmp_env1))
-   puts(No Valid Environment Area found\n);
+   read1_fail = readenv(CONFIG_ENV_OFFSET, (u_char *) tmp_env1);
+	read2_fail = readenv(CONFIG_ENV_OFFSET_REDUND, (u_char *)  
tmp_env2);


Why read the redundant environment if the the main one didn't fail?


Never mind, misread the original code (the answer is we want to see  
which one is more recent).


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


Re: [U-Boot] [PATCH v2 09/23] Add stricmp() and strnicmp()

2012-11-27 Thread Scott Wood

On 11/22/2012 01:12:53 PM, Simon Glass wrote:
strnicmp() is present but disabled. Make it available and define  
stricmp()

also. There is a only a small performance penalty to having stricmp()
call strnicmp(), so do this instead of a standalone function, to save  
code

space.


Both POSIX and the Linux kernel call this strcasecmp() rather than  
stricmp()...


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


Re: [U-Boot] [PATCH 0/2] [RFC] DEBUG: relocate to fixed address

2012-11-27 Thread Scott Wood

On 11/21/2012 02:22:32 AM, Wolfgang Denk wrote:

Dear Tetsuyuki Kobayashi,

In message 1353476660-18018-1-git-send-email-k...@kmckk.co.jp you  
wrote:


 U-Boot from NOR flash relocates itself to RAM erea. The relocation  
address is
 calaculated at runtime to get maxium contiguous space to load  
kernel. So it may
 vary after code changed. In the early debug phase it would be  
easier to handle

 if the relocation address does not change per build.

No, it is not.


Maybe not for you, but for some of us it definitely would make things  
easier.  I usually end up randomly peeking at some likely destinations  
until I find the expected content.



You still need to determine where it gets relocated to,
and iot makes no difference for debugging wehter you enter one number
or another one.

Any debugger out there today allows you to automatemost such
operations by scripts or functions or macros you can define to help
you doing that.


Just because you've managed to compensate for it doesn't mean it isn't  
annoying.


How am I going to script gdb to figure out the relocation address when  
I'm just running it on the image to get symbols, not actually  
connecting to the target?


Is such a script published anywhere?

 My idea is define fixed address as CONFIG_DEBUG_RELOC_FIX_ADDR in  
config file
 and relocate to the address. Then you don't need to execute  
'bdinfo' command to

 get actual relocated address. It is done by the first patch.

I'm not willing to accept such change.  It appears to ad a (minimal)
easement at first glance, but at the same time it bears potential to
break a large number of other things, and not unlikely in areas which
are why you need to run a debugger in the first place.

This makes no sense.

 The second patch is for u-boot_r, which is linked for fixed  
relocation address.
 When you want to symbolic debug after relocation, flash  
'u-boot.bin' and

 load symbol from 'u-boot_r' to debugger.
 (CF. When you want to symblic debug before relocation, load symbol  
from 'u-boot'

  to debugger.)

Why would that be needed?  The standard ELF file has all debug
information you ever may need.


If the symbols in the ELF ‎file match where U-Boot is actually located,  
that avoids the need to manually apply the relocation offset every time  
you want to look at something.



Just to save the load symbol table command?


Where would you get the symbol table to load that matches U-Boot  
post-relocation?


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


Re: [U-Boot] [PATCH v5 00/11] S3C24XX: Add support to MINI2416 board

2012-11-27 Thread Marek Vasut
Dear José Miguel Gonçalves,

 Hi,
 
 Can you tell me if this patch series is going to be included on next u-boot
 release? Do you need anything from my side in order to push this?
 
 Best regards,
 José Gonçalves
[...]

Ccing Minkyu.

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


[U-Boot] [GIT PULL] u-boot-mips/master

2012-11-27 Thread Daniel Schwierzeck
Hi Tom,

please pull a fix for MIPS timers.

Thanks,
Daniel


The following changes since commit 178d0cc1a4c73c3341afbeb2a93b172de8c96bd1:

  Merge branch 'master' of git://git.denx.de/u-boot-video (2012-11-19
09:28:04 -0700)

are available in the git repository at:


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

for you to fetch changes up to 8ab36d2e5490ea7bd5a39fd65210533a6c478e28:

  MIPS: do not initialize timestamp variable before relocate_code
(2012-11-25 21:50:43 +0100)


Zhi-zhou Zhang (1):
  MIPS: do not initialize timestamp variable before relocate_code

 arch/mips/cpu/mips32/time.c | 1 -
 arch/mips/cpu/mips64/time.c | 1 -
 2 files changed, 2 deletions(-)
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] Please pull u-boot-mmc.git

2012-11-27 Thread Andy Fleming
The following changes since commit 66dc452bfe13b0e276adddf3997b9c5abc00115d:

  Remove obsolete header file (2012-11-27 09:41:10 -0700)

are available in the git repository at:

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

for you to fetch changes up to ed80c931ba7781e6605b9bdaa2a0d58ef365fe71:

  mmc: Fix incorrect handling of 'read'  'write' commands (2012-11-27 17:26:49 
-0600)


Jaehoon Chung (1):
  EXYNOS: mmc: support DesignWare Controller for Samsung-SoC

Mela Custodio (1):
  mmc: add no simultaenous power and vdd

Stephen Warren (4):
  Replace CONFIG_MMC_BOUNCE_BUFFER with CONFIG_BOUNCE_BUFFER in configs
  bouncebuf: remove dummy implementation
  common: rework bouncebuf implementation
  mmc: tegra: use bounce buffer APIs

Taylor Hutt (2):
  mmc: Fix interpretation of MMC_CMD_ALL_SEND_CID
  mmc: Fix incorrect handling of 'read'  'write' commands

Wu, Josh (1):
  mmc: at91sam9x5: support to save environment in mmc

 arch/arm/include/asm/arch-exynos/dwmmc.h |   36 ++
 boards.cfg   |1 +
 common/bouncebuf.c   |   75 --
 common/cmd_mmc.c |9 ++--
 drivers/mmc/Makefile |1 +
 drivers/mmc/exynos_dw_mmc.c  |   57 +++
 drivers/mmc/mmc.c|   16 ---
 drivers/mmc/mxsmmc.c |   30 +++-
 drivers/mmc/sdhci.c  |3 ++
 drivers/mmc/tegra_mmc.c  |   64 -
 include/bouncebuf.h  |   47 ++-
 include/configs/at91sam9x5ek.h   |   19 ++--
 include/configs/mx6qarm2.h   |2 +-
 include/configs/mx6qsabre_common.h   |2 +-
 include/configs/mx6qsabrelite.h  |2 +-
 include/configs/sc_sps_1.h   |2 +-
 include/configs/tegra20-common.h |3 ++
 include/sdhci.h  |1 +
 18 files changed, 248 insertions(+), 122 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-exynos/dwmmc.h
 create mode 100644 drivers/mmc/exynos_dw_mmc.c

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


Re: [U-Boot] [PATCH 0/2] [RFC] DEBUG: relocate to fixed address

2012-11-27 Thread Henrik Nordström
tis 2012-11-27 klockan 16:22 -0600 skrev Scott Wood:

 How am I going to script gdb to figure out the relocation address when  
 I'm just running it on the image to get symbols, not actually  
 connecting to the target?

It can be calculated from ram size and size of your u-boot binary
including bss (reported by size on the elf binary).

If you have u-boot running then bdinfo shows the address.

Hm.. wasn't there talk about a non-relocating u-boot binary for
debugging? Isn't that more appropriate for what you are trying to
accomplish?

 Where would you get the symbol table to load that matches U-Boot  
 post-relocation?

GDB supports symbol table relocation using add-symbol-file command.

Regards
Henrik

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


Re: [U-Boot] [PATCH 2/2] mmc: Split device init to decouple OCR-polling delay

2012-11-27 Thread Andy Fleming
On Sat, Oct 20, 2012 at 10:16 PM, Simon Glass s...@chromium.org wrote:

 From: Che-Liang Chiou clch...@chromium.org

 Most of time that MMC driver spends on initializing a device is polling
 OCR (operation conditions register).  To decouple this polling loop,
 device init is split into two parts: The first part fires the OCR query
 command, and the second part polls the result.  So the caller is now no
 longer bound to the OCR-polling delay; he may fire the query, go
 somewhere and then come back later for the result.

 To use this, call mmc_set_preinit() on any device which needs this.

 This can save significant amounts of time on boot (e.g. 200ms) by
 hiding the MMC init time behind other init.

 Signed-off-by: Che-Liang Chiou clch...@chromium.org
 Signed-off-by: Simon Glass s...@chromium.org



Could you rebase this on my latest tree? It failed to apply for reasons
which weren't immediately clear to me, and it's a non-trivial chunk that
failed.

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


Re: [U-Boot] [RFC] mmc: Properly determine maximum supported bus width

2012-11-27 Thread Stephen Warren
On 11/26/2012 04:33 PM, Fleming Andy-AFLEMING wrote:
 Yes, I'm processing my queue today.

This patch didn't show up in the pull request you just sent.

 On Nov 26, 2012, at 17:27, Stephen Warren swar...@wwwdotorg.org wrote:
 
 On 10/31/2012 11:02 PM, Andy Fleming wrote:
 At some point, a confusion arose about the use of the bit
 definitions in host_caps for bus widths, and the value
 in ext_csd. By coincidence, a simple shift could convert
 between one and the other:

 MMC_MODE_1BIT = 0, EXT_CSD_BUS_WIDTH_1 = 0
 MMC_MODE_4BIT = 0x100, EXT_CSD_BUS_WIDTH_4 = 1
 MMC_MODE_8BIT = 0x200, EXT_CSD_BUS_WIDTH_8 = 2

 However, as host_caps is a bitmask of supported things,
 there is not, in fact, a one-to-one correspondence. host_caps
 is capable of containing MODE_4BIT | MODE_8BIT, so nonsensical
 things were happening where we would try to set the bus width
 to 12.

 The new code clarifies the very different namespaces:

 host_caps/card_caps = bitmask (MMC_MODE_*)
 ext CSD fields are just an index (EXT_CSD_BUS_WIDTH_*)
 mmc-bus_width integer number of bits (1, 4, 8)

 We create arrays to map between the namespaces, like in Linux.

 Andy, is this patch likely to get merged soon to u-boot.git branch
 master? Unfortunately, some Tegra patches that ideally rely on this
 patch being present have already been applied and merged into
 u-boot-arm.git branch master.

 

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


Re: [U-Boot] [RFC] mmc: Properly determine maximum supported bus width

2012-11-27 Thread Andy Fleming
On Tue, Nov 27, 2012 at 5:40 PM, Stephen Warren swar...@wwwdotorg.orgwrote:

 On 11/26/2012 04:33 PM, Fleming Andy-AFLEMING wrote:
  Yes, I'm processing my queue today.

 This patch didn't show up in the pull request you just sent.



Yeah, sorry, I don't know how that happened. I'm applying it now.

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


[U-Boot] Please pull u-boot-mmc.git

2012-11-27 Thread Andy Fleming
The following changes since commit 66dc452bfe13b0e276adddf3997b9c5abc00115d:

  Remove obsolete header file (2012-11-27 09:41:10 -0700)

are available in the git repository at:

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

for you to fetch changes up to 7798f6dbd5e1a3030ed81a81da5dfb57c3307cac:

  mmc: Properly determine maximum supported bus width (2012-11-27 17:48:46 
-0600)


Andy Fleming (1):
  mmc: Properly determine maximum supported bus width

Jaehoon Chung (1):
  EXYNOS: mmc: support DesignWare Controller for Samsung-SoC

Mela Custodio (1):
  mmc: add no simultaenous power and vdd

Stephen Warren (4):
  Replace CONFIG_MMC_BOUNCE_BUFFER with CONFIG_BOUNCE_BUFFER in configs
  bouncebuf: remove dummy implementation
  common: rework bouncebuf implementation
  mmc: tegra: use bounce buffer APIs

Taylor Hutt (2):
  mmc: Fix interpretation of MMC_CMD_ALL_SEND_CID
  mmc: Fix incorrect handling of 'read'  'write' commands

Wu, Josh (1):
  mmc: at91sam9x5: support to save environment in mmc

 arch/arm/include/asm/arch-exynos/dwmmc.h |   36 ++
 boards.cfg   |1 +
 common/bouncebuf.c   |   75 --
 common/cmd_mmc.c |9 ++--
 drivers/mmc/Makefile |1 +
 drivers/mmc/exynos_dw_mmc.c  |   57 +++
 drivers/mmc/mmc.c|   63 +
 drivers/mmc/mxsmmc.c |   30 +++-
 drivers/mmc/sdhci.c  |3 ++
 drivers/mmc/tegra_mmc.c  |   64 -
 include/bouncebuf.h  |   47 ++-
 include/configs/at91sam9x5ek.h   |   19 ++--
 include/configs/mx6qarm2.h   |2 +-
 include/configs/mx6qsabre_common.h   |2 +-
 include/configs/mx6qsabrelite.h  |2 +-
 include/configs/sc_sps_1.h   |2 +-
 include/configs/tegra20-common.h |3 ++
 include/sdhci.h  |1 +
 18 files changed, 283 insertions(+), 134 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-exynos/dwmmc.h
 create mode 100644 drivers/mmc/exynos_dw_mmc.c

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


Re: [U-Boot] U-Boot for MIPS AR7161

2012-11-27 Thread Daniel Schwierzeck
Hi Allan,

2012/11/27 Drassal, Allan dra...@wsu.edu:
 I am attempting to create a U-Boot image for a router, Buffalo WZR-HP-AG300H, 
 details can be found here, http://wiki.openwrt.org/toh/buffalo/wzr-hp-ag300h.

 I am having trouble compiling and/or finding a pre-compiled version of U-Boot 
 for it.

 I am attempting to recover a router that has its bootloader erased, I have an 
 identical router that is functioning and have debug access through JTAG to 
 both devices.

have you tried to dump the MTD partition of U-Boot on the working device?

 I located one image on the internet 8Muboot_RAM_version.bin, and loaded it 
 into ram and executed it, but I don't receive any serial output, but it does 
 turn on one LED indicator on the board, indicating that the program did 
 execute somewhat.  This was built for the AR724x processor though, and might 
 be why it is not functioning fully.

Do you know the original text base address of that binary? If you load
the binary to the wrong address, function calls or relocation will not
work.


 I have attempted to halt the running board in the bootup, copy the ram 
 contents from one board to the other, and resume the processor, but it seems 
 I am missing something.

maybe there are cache coherency problems or the memory controller is
not initialized correctly

 I am going to paste below the contents of the openocd file that I am using, 
 along with the initial startup of the working board.  I can also provide any 
 other details that are helpful.

 If I can build a working RAM startup image, that would be great, I can then 
 use that to rewrite the onboard flash memory, or if I can directly access the 
 flash memory through the JTAG, but so far, I have not been successful with 
 that either.

 I believe I have a working toolchain to build U-Boot, but keep running into 
 odd errors when building possibly due to different toolchain versions.
 Any help or assistance would be greatly appreciated.

 Thanks,
 Allan Drassal

 ar71xx.cfg

 # Atheros AR71xx MIPS 24Kc SoC.
 # tested on PB44 refererence board

 adapter_nsrst_delay 100
 jtag_ntrst_delay 100

 reset_config trst_and_srst

 set CHIPNAME ar71xx

 jtag newtap $CHIPNAME cpu -irlen 5 -ircapture 0x1 -irmask 0x1f -expected-id 1

 set TARGETNAME $CHIPNAME.cpu
 target create $TARGETNAME mips_m4k -endian big -chain-position $TARGETNAME

 $TARGETNAME configure -event reset-halt-post {
 #setup PLL to lowest common denominator 300/300/150 setting
 #mww 0xb805 0x000f40a3  ;# reset val + CPU:3 DDR:3 AHB:0
 #mww 0xb805 0x800f40a3  ;# send to PLL
 mww 0xb805 0x40140180   ;# reset val + CPU:3 DDR:3 AHB:0
 mww 0xb805 0xc0140180   ;# send to PLL

 #next command will reset for PLL changes to take effect
 mww 0xb8050008 3;# set reset_switch and clock_switch 
 (resets SoC)
 }

 $TARGETNAME configure -event reset-init {
 #complete pll initialization
 mww 0xb805 0x800f0080   ;# set sw_update bit
 mww 0xb8050008 0;# clear reset_switch bit
 mww 0xb805 0x800f00e8   ;# clr pwrdwn  bypass
 mww 0xb8050008 1;# set clock_switch bit
 sleep 1 ;# wait for lock

 # Setup DDR config and flash mapping
 mww 0xb800 0x77b8884e   ;# DDR cfg cdl val (rst: 0x5bfc8d0)
 mww 0xb804 0x812cd6a8   ;# DDR cfg2 cdl val (rst: 0x80d106a8)
 #mww 0xb800 0xefbc8cd0   ;# DDR cfg cdl val (rst: 0x5bfc8d0)
 #mww 0xb804 0x8e7156a2   ;# DDR cfg2 cdl val (rst: 0x80d106a8)

 mww 0xb810 8;# force precharge all banks
 mww 0xb810 1;# force EMRS update cycle
 mww 0xb80c 0;# clr ext. mode register
 mww 0xb810 2;# force auto refresh all banks
 mww 0xb810 8;# force precharge all banks
 #mww 0xb808 0x31 ;# set DDR mode value CAS=3
 mww 0xb808 0x33 ;# set DDR mode value CAS=3
 mww 0xb810 1;# force EMRS update cycle
 #mww 0xb814 0x461b   ;# DDR refresh value
 #mww 0xb818 0x   ;# DDR Read Data This Cycle value 
 (16bit: 0x)
 mww 0xb814 0x44a6   ;# DDR refresh value
 mww 0xb818 0x00ff   ;# DDR Read Data This Cycle value 
 (16bit: 0x)
 mww 0xb81c 0x7  ;# delay added to the DQS line 
 (normal = 7)
 mww 0xb820 7
 mww 0xb824 7
 mww 0xb828 7
 }

are there no registers for enabling/disabling the memory controller?
Usually you need to disable
a memory controller when changing its configuration and to enable it
to start the
initialization sequence for the DRAM device.


 # setup working area somewhere in RAM
 $TARGETNAME configure 

Re: [U-Boot] [PATCH 0/5] Various x86 patches

2012-11-27 Thread Simon Glass
Hi,

On Sun, Apr 29, 2012 at 5:31 AM, Graeme Russ graeme.r...@gmail.com wrote:
 Hi Andy,

 On 04/29/2012 10:25 PM, Andy Pont wrote:
 Hi Graeme,

 Graeme Russ (5):
   x86: Fix compilation on 64-built built machines

 Shouldn't this be 64-bit build machines?

 Yep - Thanks

I found this series in patchwork so am bringing it into x86/next.

I updated it as above.

Regards,
Simon


 Regards,

 Graeme
 ___
 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 4/5] x86: Remove duplicate PCI init

2012-11-27 Thread Simon Glass
On Sun, Apr 29, 2012 at 5:00 AM, Graeme Russ graeme.r...@gmail.com wrote:

 Signed-off-by: Graeme Russ graeme.r...@gmail.com

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


Re: [U-Boot] [PATCH 3/5] x86: Put global data on the stack

2012-11-27 Thread Simon Glass
Hi Graham,

On Sun, Apr 29, 2012 at 5:00 AM, Graeme Russ graeme.r...@gmail.com wrote:
 Putting global data on the stack simplifies the init process (and makes it
 slightly quicker). During the 'flash' stage of the init sequence, global
 data is in the CAR stack. After SDRAM is initialised, global data is copied
 from CAR to the SDRAM stack

 Signed-off-by: Graeme Russ graeme.r...@gmail.com

As it is this changes breaks coreboot. It just needs the CAR defines
added to coreboot.h also, so I have done this and pulled it into
x86/next. I hope that is ok.

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


Re: [U-Boot] [PATCH 0/4] enable USB OHCI on sam9x5ek boards

2012-11-27 Thread Bo Shen

Hi Richard Genoud,

On 11/28/2012 0:37, Richard Genoud wrote:

This small patchset is based on current master ( 
178d0cc1a4c73c3341afbeb2a93b172de8c96bd1 )
It enables usb ohci on at91sam9x5ek boards.
Tested it with a sam9g35 CPU and a usb key.

Richard Genoud (4):
   usb documentation: fix typo
   ARM: at91sam9x5: enable USB OHCI support for 9x5ek board.
   at91sam9x5ek: regroup FAT/DOS features
   at91sam9x5ek: add USB OHCI configuration


Thanks for your work.
I think if enable EHCI instead of OHCI will be better?

Best Regards,
Bo Shen

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


Re: [U-Boot] [PATCH 2/5] x86: Forward declate gd_t

2012-11-27 Thread Simon Glass
Hi,

On Sun, Apr 29, 2012 at 7:23 PM, Marek Vasut ma...@denx.de wrote:
 Dear Graeme Russ,

 So it can be used as a type in struct global_data and remove an ugly
 typecast

 Signed-off-by: Graeme Russ graeme.r...@gmail.com
 ---
  arch/x86/cpu/cpu.c |2 +-
  arch/x86/include/asm/global_data.h |4 +++-
  2 files changed, 4 insertions(+), 2 deletions(-)

I had to modify this slightly to get it to build (added the same cast
fix to sdram.c as you did to cpu.c). Then, applied to x86/next.

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


Re: [U-Boot] [PATCH 2/5] x86: Forward declate gd_t

2012-11-27 Thread Marek Vasut
Dear Simon Glass,

 Hi,
 
 On Sun, Apr 29, 2012 at 7:23 PM, Marek Vasut ma...@denx.de wrote:
  Dear Graeme Russ,
  
  So it can be used as a type in struct global_data and remove an ugly
  typecast
  
  Signed-off-by: Graeme Russ graeme.r...@gmail.com
  ---
  
   arch/x86/cpu/cpu.c |2 +-
   arch/x86/include/asm/global_data.h |4 +++-
   2 files changed, 4 insertions(+), 2 deletions(-)
 
 I had to modify this slightly to get it to build (added the same cast
 fix to sdram.c as you did to cpu.c). Then, applied to x86/next.

It'd be really nice if you could possibly take over the x86 custodianship from 
Graeme, it seems this arch is rotting :(

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


Re: [U-Boot] [PATCH 2/5] x86: Forward declate gd_t

2012-11-27 Thread Simon Glass
Hi Marek,

On Tue, Nov 27, 2012 at 5:29 PM, Marek Vasut ma...@denx.de wrote:
 Dear Simon Glass,

 Hi,

 On Sun, Apr 29, 2012 at 7:23 PM, Marek Vasut ma...@denx.de wrote:
  Dear Graeme Russ,
 
  So it can be used as a type in struct global_data and remove an ugly
  typecast
 
  Signed-off-by: Graeme Russ graeme.r...@gmail.com
  ---
 
   arch/x86/cpu/cpu.c |2 +-
   arch/x86/include/asm/global_data.h |4 +++-
   2 files changed, 4 insertions(+), 2 deletions(-)

 I had to modify this slightly to get it to build (added the same cast
 fix to sdram.c as you did to cpu.c). Then, applied to x86/next.

 It'd be really nice if you could possibly take over the x86 custodianship from
 Graeme, it seems this arch is rotting :(

Your wish is my command :-)

Regards,
Simon


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


[U-Boot] [PATCH V4 04/11] imximage: prepare to move static variables to struct data_src

2012-11-27 Thread Troy Kisky
Need to move accesses to the static variables to
a function where struct data_src is used.

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

---
v3: new patch
---
 tools/imximage.c |   24 +---
 tools/imximage.h |3 +++
 2 files changed, 16 insertions(+), 11 deletions(-)

diff --git a/tools/imximage.c b/tools/imximage.c
index 97e5c4b..3a010a6 100644
--- a/tools/imximage.c
+++ b/tools/imximage.c
@@ -407,8 +407,11 @@ static void parse_cfg_fld(struct imx_header *imxhdr, 
int32_t *cmd,
break;
}
 }
-static uint32_t parse_cfg_file(struct imx_header *imxhdr, char *name)
+
+static int parse_cfg_file(struct imx_header *imxhdr, char *name,
+   uint32_t entry_point)
 {
+   struct data_src ds;
FILE *fd = NULL;
char *line = NULL;
char *token, *saveptr1, *saveptr2;
@@ -418,6 +421,10 @@ static uint32_t parse_cfg_file(struct imx_header *imxhdr, 
char *name)
int dcd_len = 0;
int32_t cmd;
 
+   /* Be able to detect if the cfg file has no BOOT_FROM tag */
+   g_flash_offset = FLASH_OFFSET_UNDEFINED;
+   memset(ds, 0, sizeof(struct data_src));
+   ds.imxhdr = imxhdr;
/*
 * In order to not change the old imx cfg file
 * by adding VERSION command into it, here need
@@ -465,10 +472,10 @@ static uint32_t parse_cfg_file(struct imx_header *imxhdr, 
char *name)
fprintf(stderr, Error: No BOOT_FROM tag in %s\n, name);
exit(EXIT_FAILURE);
}
-   return dcd_len;
+   /* Set the imx header */
+   return (*set_imx_hdr)(imxhdr, dcd_len, entry_point, g_flash_offset);
 }
 
-
 static int imximage_check_image_types(uint8_t type)
 {
if (type == IH_TYPE_IMXIMAGE)
@@ -510,21 +517,16 @@ int imximage_vrec_header(struct mkimage_params *params,
struct image_type_params *tparams)
 {
struct imx_header *imxhdr;
-   uint32_t dcd_len;
 
imxhdr = calloc(1, MAX_HEADER_SIZE);
if (!imxhdr) {
fprintf(stderr, Error: out of memory\n);
exit(EXIT_FAILURE);
}
-   /* Be able to detect if the cfg file has no BOOT_FROM tag */
-   g_flash_offset = FLASH_OFFSET_UNDEFINED;
-   /* Parse dcd configuration file */
-   dcd_len = parse_cfg_file(imxhdr, params-imagename);
 
-   /* Set the imx header */
-   imximage_params.header_size = (*set_imx_hdr)(imxhdr, dcd_len,
-   params-ep, g_flash_offset);
+   /* Parse dcd configuration file */
+   imximage_params.header_size = parse_cfg_file(imxhdr, params-imagename,
+   params-ep);
imximage_params.hdr = imxhdr;
return 0;
 }
diff --git a/tools/imximage.h b/tools/imximage.h
index 0f39447..2895378 100644
--- a/tools/imximage.h
+++ b/tools/imximage.h
@@ -171,4 +171,7 @@ typedef void (*set_dcd_rst_t)(struct imx_header *imxhdr,
 typedef int (*set_imx_hdr_t)(struct imx_header *imxhdr, uint32_t dcd_len,
uint32_t entry_point, uint32_t flash_offset);
 
+struct data_src {
+   struct imx_header *imxhdr;
+};
 #endif /* _IMXIMAGE_H_ */
-- 
1.7.9.5

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


[U-Boot] [PATCH V4 03/11] imximage: remove static imximage_version

2012-11-27 Thread Troy Kisky
This variable does not need to have file scope.

Signed-off-by: Troy Kisky troy.ki...@boundarydevices.com
---
 tools/imximage.c |   21 +
 1 file changed, 9 insertions(+), 12 deletions(-)

diff --git a/tools/imximage.c b/tools/imximage.c
index 8457c8e..97e5c4b 100644
--- a/tools/imximage.c
+++ b/tools/imximage.c
@@ -65,8 +65,6 @@ static table_entry_t imximage_versions[] = {
{-1,,  (Invalid), },
 };
 
-static uint32_t imximage_version;
-
 static set_dcd_val_t set_dcd_val;
 static set_dcd_rst_t set_dcd_rst;
 static set_imx_hdr_t set_imx_hdr;
@@ -254,7 +252,7 @@ static int set_imx_hdr_v2(struct imx_header *imxhdr, 
uint32_t dcd_len,
return header_length;
 }
 
-static void set_hdr_func(struct imx_header *imxhdr)
+static void set_hdr_func(struct imx_header *imxhdr, uint32_t imximage_version)
 {
switch (imximage_version) {
case IMXIMAGE_V1:
@@ -335,6 +333,7 @@ static void parse_cfg_cmd(struct imx_header *imxhdr, 
int32_t cmd, char *token,
 {
int value;
static int cmd_ver_first = ~0;
+   uint32_t imximage_version;
 
switch (cmd) {
case CMD_IMAGE_VERSION:
@@ -346,7 +345,7 @@ static void parse_cfg_cmd(struct imx_header *imxhdr, 
int32_t cmd, char *token,
exit(EXIT_FAILURE);
}
cmd_ver_first = 1;
-   set_hdr_func(imxhdr);
+   set_hdr_func(imxhdr, imximage_version);
break;
case CMD_BOOT_FROM:
g_flash_offset = get_table_entry_id(imximage_bootops,
@@ -419,6 +418,12 @@ static uint32_t parse_cfg_file(struct imx_header *imxhdr, 
char *name)
int dcd_len = 0;
int32_t cmd;
 
+   /*
+* In order to not change the old imx cfg file
+* by adding VERSION command into it, here need
+* set up function ptr group to V1 by default.
+*/
+   set_hdr_func(imxhdr, IMXIMAGE_V1);
fd = fopen(name, r);
if (fd == 0) {
fprintf(stderr, Error: %s - Can't open DCD file\n, name);
@@ -512,16 +517,8 @@ int imximage_vrec_header(struct mkimage_params *params,
fprintf(stderr, Error: out of memory\n);
exit(EXIT_FAILURE);
}
-   /*
-* In order to not change the old imx cfg file
-* by adding VERSION command into it, here need
-* set up function ptr group to V1 by default.
-*/
-   imximage_version = IMXIMAGE_V1;
/* Be able to detect if the cfg file has no BOOT_FROM tag */
g_flash_offset = FLASH_OFFSET_UNDEFINED;
-   set_hdr_func(imxhdr);
-
/* Parse dcd configuration file */
dcd_len = parse_cfg_file(imxhdr, params-imagename);
 
-- 
1.7.9.5

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


[U-Boot] [PATCH V4 11/11] parse_helper: add expression evaluation

2012-11-27 Thread Troy Kisky
Basic expressions with order precedence is
now supported.
ie. (3 + ((1+2*3)/--2 + --5 *(8/4))) is 16.

Signed-off-by: Troy Kisky troy.ki...@boundarydevices.com
---
 tools/parse_helper.c |  172 +++---
 1 file changed, 162 insertions(+), 10 deletions(-)

diff --git a/tools/parse_helper.c b/tools/parse_helper.c
index 0a5c5f6..50be832 100644
--- a/tools/parse_helper.c
+++ b/tools/parse_helper.c
@@ -97,20 +97,172 @@ int ph_skip_comma(struct parse_helper *ph)
}
 }
 
+static const char precedence[] = {
+   /* (  +  -  *  /^  |  ) */
+  0, 2, 2, 1, 1, 3, 4, 5, 6
+};
+static const char unary_operations[]  = (+-;
+static const char binary_operations[] =  +-*/^|);
+
+static uint32_t do_func(uint32_t val1, uint32_t val2, int op)
+{
+   switch (op) {
+   case 1:
+   return val1 + val2;
+   case 2:
+   return val1 - val2;
+   case 3:
+   return val1 * val2;
+   case 4:
+   return val1 / val2;
+   case 5:
+   return val1  val2;
+   case 6:
+   return val1 ^ val2;
+   case 7:
+   return val1 | val2;
+   }
+   fprintf(stderr, Error: in func %s: val1=%d val2=%d op = %d\n,
+   __func__, val1, val2, op);
+   exit(EXIT_FAILURE);
+}
+
+static int find_op(char c, const char *p)
+{
+   int i;
+   for (i = 0; ; i++) {
+   if (c == p[i])
+   return i;
+   if (!p[i])
+   break;
+   }
+   return -1;
+}
+
+#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
+
 int ph_get_value(struct parse_helper *ph, uint32_t *pval)
 {
char *endptr;
-   uint32_t value;
+   int op_i = 0;
+   int val_i = 0;
+   unsigned char op[16];
+   uint32_t val[16];
+   int unary = 1;
+   char *p;
 
-   if (ph_skip_separators(ph))
-   return -1;
-   errno = 0;
-   value = strtoul(ph-p, endptr, 16);
-   if (errno || (ph-p == endptr))
-   return -1;
-   *pval = value;
-   ph-p = endptr;
-   return 0;
+   p = ph-p;
+   for (;;) {
+   char c;
+   int i, j;
+   const char *ops = unary ? unary_operations : binary_operations;
+
+   if (unary) {
+   ph-p = p;
+   if (ph_skip_separators(ph))
+   return -1;
+   p = ph-p;
+   c = *p;
+   } else {
+   for (;;) {
+   c = *p;
+   if ((c != ' ')  (c != '\t'))
+   break;
+   p++;
+   }
+   }
+   i = find_op(c, ops);
+   debug(%d,%c,%d:%s\n, i, c, unary, p);
+   if ((i  0)  unary) {
+   if (val_i = ARRAY_SIZE(val))
+   return -1;
+   errno = 0;
+   val[val_i++] = strtoul(p, endptr, 16);
+   if (errno || (p == endptr)) {
+   ph-p = p;
+   return -1;
+   }
+   p = endptr;
+   unary = 0;
+   debug(val[%d]=%x,%d,%d\n, val_i - 1, val[val_i - 1],
+   op_i, val_i);
+do_unary:
+   while (op_i) {
+   j = op[op_i - 1];
+   if (!(j  0x80))
+   break;
+   op_i--;
+   val[val_i - 1] = do_func(0,
+   val[val_i - 1], j  0x7f);
+   debug(un:%d,%x,%d,%d\n, val[val_i - 1], j,
+   op_i, val_i);
+   }
+   continue;
+   }
+   if (i  0) {
+   c = 0;
+   i = 8;
+   } else {
+   p++;
+   }
+   if (c == '(') {
+   if (op_i = ARRAY_SIZE(op))
+   return -1;
+   op[op_i++] = i;
+   debug(op[%d]=%x,%d,%d\n, op_i - 1, op[op_i - 1],
+   op_i, val_i);
+   unary = 1;
+   continue;
+   }
+   for (;;) {
+   if (!op_i || unary)
+   break;
+   j = op[op_i - 1];
+   if (j == 0) {
+   if (c == ')') {
+   op_i--;
+   goto do_unary;
+  

[U-Boot] [PATCH V4 01/11] imximage: mx53 needs transfer length a multiple of 512

2012-11-27 Thread Troy Kisky
The mx53 ROM will truncate the length at a multiple of 512.
Transferring too much is not a problem, so round up.

Problem reported by Stefano Babic.

Signed-off-by: Troy Kisky troy.ki...@boundarydevices.com
---
 tools/imximage.c |   10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/tools/imximage.c b/tools/imximage.c
index 63f88b6..7e54e97 100644
--- a/tools/imximage.c
+++ b/tools/imximage.c
@@ -494,6 +494,8 @@ static void imximage_print_header(const void *ptr)
}
 }
 
+#define ALIGN(a, b)(((a) + (b) - 1)  ~((b) - 1))
+
 static void imximage_set_header(void *ptr, struct stat *sbuf, int ifd,
struct mkimage_params *params)
 {
@@ -515,7 +517,13 @@ static void imximage_set_header(void *ptr, struct stat 
*sbuf, int ifd,
 
/* Set the imx header */
(*set_imx_hdr)(imxhdr, dcd_len, params-ep, imxhdr-flash_offset);
-   *header_size_ptr = sbuf-st_size + imxhdr-flash_offset;
+   /*
+* ROM bug alert
+* mx53 only loads 512 byte multiples.
+* The remaining fraction of a block bytes would
+* not be loaded.
+*/
+   *header_size_ptr = ALIGN(sbuf-st_size + imxhdr-flash_offset, 512);
 }
 
 int imximage_check_params(struct mkimage_params *params)
-- 
1.7.9.5

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


[U-Boot] [PATCH V4 07/11] imximage: move set_dcd_val to struct data_src

2012-11-27 Thread Troy Kisky
Signed-off-by: Troy Kisky troy.ki...@boundarydevices.com

---
v3: new patch
---
 tools/imximage.c |9 -
 tools/imximage.h |1 +
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/tools/imximage.c b/tools/imximage.c
index 30f3c81..6d5cfa7 100644
--- a/tools/imximage.c
+++ b/tools/imximage.c
@@ -65,7 +65,6 @@ static table_entry_t imximage_versions[] = {
{-1,,  (Invalid), },
 };
 
-static set_dcd_val_t set_dcd_val;
 static set_dcd_rst_t set_dcd_rst;
 static uint32_t max_dcd_entries;
 static uint32_t *header_size_ptr;
@@ -256,13 +255,13 @@ static void set_hdr_func(struct data_src *ds, uint32_t 
imximage_version)
 {
switch (imximage_version) {
case IMXIMAGE_V1:
-   set_dcd_val = set_dcd_val_v1;
+   ds-set_dcd_val = set_dcd_val_v1;
set_dcd_rst = set_dcd_rst_v1;
ds-set_imx_hdr = set_imx_hdr_v1;
max_dcd_entries = MAX_HW_CFG_SIZE_V1;
break;
case IMXIMAGE_V2:
-   set_dcd_val = set_dcd_val_v2;
+   ds-set_dcd_val = set_dcd_val_v2;
set_dcd_rst = set_dcd_rst_v2;
ds-set_imx_hdr = set_imx_hdr_v2;
max_dcd_entries = MAX_HW_CFG_SIZE_V2;
@@ -360,7 +359,7 @@ static void parse_cfg_cmd(struct data_src *ds, int32_t cmd, 
char *token,
break;
case CMD_DATA:
value = get_cfg_value(token, name, lineno);
-   (*set_dcd_val)(ds, name, lineno, fld, value, dcd_len);
+   (*ds-set_dcd_val)(ds, name, lineno, fld, value, dcd_len);
if (unlikely(cmd_ver_first != 1))
cmd_ver_first = 0;
break;
@@ -391,7 +390,7 @@ static void parse_cfg_fld(struct data_src *ds, int32_t *cmd,
return;
 
value = get_cfg_value(token, name, lineno);
-   (*set_dcd_val)(ds, name, lineno, fld, value, *dcd_len);
+   (*ds-set_dcd_val)(ds, name, lineno, fld, value, *dcd_len);
 
if (fld == CFG_REG_VALUE) {
(*dcd_len)++;
diff --git a/tools/imximage.h b/tools/imximage.h
index f27a2ef..444ddce 100644
--- a/tools/imximage.h
+++ b/tools/imximage.h
@@ -175,5 +175,6 @@ typedef int (*set_imx_hdr_t)(struct data_src *ds, uint32_t 
dcd_len,
 struct data_src {
struct imx_header *imxhdr;
set_imx_hdr_t set_imx_hdr;
+   set_dcd_val_t set_dcd_val;
 };
 #endif /* _IMXIMAGE_H_ */
-- 
1.7.9.5

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


[U-Boot] [PATCH V4 05/11] imximage: change parameters for set_dcd_val/set_imx_hdr

2012-11-27 Thread Troy Kisky
Change 1st argument of set_imx_hdr/set_dcd_val
to struct data_src.

Signed-off-by: Troy Kisky troy.ki...@boundarydevices.com
---
 tools/imximage.c |   41 +
 tools/imximage.h |5 +++--
 2 files changed, 24 insertions(+), 22 deletions(-)

diff --git a/tools/imximage.c b/tools/imximage.c
index 3a010a6..ddac95f 100644
--- a/tools/imximage.c
+++ b/tools/imximage.c
@@ -116,10 +116,10 @@ static void err_imximage_version(int version)
exit(EXIT_FAILURE);
 }
 
-static void set_dcd_val_v1(struct imx_header *imxhdr, char *name, int lineno,
+static void set_dcd_val_v1(struct data_src *ds, char *name, int lineno,
int fld, uint32_t value, uint32_t off)
 {
-   dcd_v1_t *dcd_v1 = imxhdr-header.hdr_v1.dcd_table;
+   dcd_v1_t *dcd_v1 = ds-imxhdr-header.hdr_v1.dcd_table;
 
switch (fld) {
case CFG_REG_SIZE:
@@ -144,10 +144,10 @@ static void set_dcd_val_v1(struct imx_header *imxhdr, 
char *name, int lineno,
}
 }
 
-static void set_dcd_val_v2(struct imx_header *imxhdr, char *name, int lineno,
+static void set_dcd_val_v2(struct data_src *ds, char *name, int lineno,
int fld, uint32_t value, uint32_t off)
 {
-   dcd_v2_t *dcd_v2 = imxhdr-header.hdr_v2.dcd_table;
+   dcd_v2_t *dcd_v2 = ds-imxhdr-header.hdr_v2.dcd_table;
 
switch (fld) {
case CFG_REG_ADDRESS:
@@ -194,15 +194,15 @@ static void set_dcd_rst_v2(struct imx_header *imxhdr, 
uint32_t dcd_len,
dcd_v2-write_dcd_command.param = DCD_COMMAND_PARAM;
 }
 
-static int set_imx_hdr_v1(struct imx_header *imxhdr, uint32_t dcd_len,
+static int set_imx_hdr_v1(struct data_src *ds, uint32_t dcd_len,
uint32_t entry_point, uint32_t flash_offset)
 {
-   imx_header_v1_t *hdr_v1 = imxhdr-header.hdr_v1;
+   imx_header_v1_t *hdr_v1 = ds-imxhdr-header.hdr_v1;
flash_header_v1_t *fhdr_v1 = hdr_v1-fhdr;
dcd_v1_t *dcd_v1 = hdr_v1-dcd_table;
uint32_t hdr_base;
uint32_t header_length = (((char *)dcd_v1-addr_data[dcd_len].addr)
-   - ((char *)imxhdr));
+   - ((char *)ds-imxhdr));
 
/* Set magic number */
fhdr_v1-app_code_barker = APP_CODE_BARKER;
@@ -217,19 +217,20 @@ static int set_imx_hdr_v1(struct imx_header *imxhdr, 
uint32_t dcd_len,
/* Security feature are not supported */
fhdr_v1-app_code_csf = 0;
fhdr_v1-super_root_key = 0;
-   header_size_ptr = (uint32_t *)(((char *)imxhdr) + header_length - 4);
+   header_size_ptr = (uint32_t *)(((char *)ds-imxhdr) +
+   header_length - 4);
return header_length;
 }
 
-static int set_imx_hdr_v2(struct imx_header *imxhdr, uint32_t dcd_len,
+static int set_imx_hdr_v2(struct data_src *ds, uint32_t dcd_len,
uint32_t entry_point, uint32_t flash_offset)
 {
-   imx_header_v2_t *hdr_v2 = imxhdr-header.hdr_v2;
+   imx_header_v2_t *hdr_v2 = ds-imxhdr-header.hdr_v2;
flash_header_v2_t *fhdr_v2 = hdr_v2-fhdr;
uint32_t hdr_base;
uint32_t header_length = (dcd_len) ?
-   (char *)hdr_v2-dcd_table.addr_data[dcd_len] - ((char*)imxhdr)
-   : offsetof(imx_header_v2_t, dcd_table);
+   (char *)hdr_v2-dcd_table.addr_data[dcd_len] -
+   ((char *)ds-imxhdr) : offsetof(imx_header_v2_t, dcd_table);
 
/* Set magic number */
fhdr_v2-header.tag = IVT_HEADER_TAG; /* 0xD1 */
@@ -328,7 +329,7 @@ static void print_hdr_v2(struct imx_header *imx_hdr)
printf(Entry Point:  %08x\n, (uint32_t)fhdr_v2-entry);
 }
 
-static void parse_cfg_cmd(struct imx_header *imxhdr, int32_t cmd, char *token,
+static void parse_cfg_cmd(struct data_src *ds, int32_t cmd, char *token,
char *name, int lineno, int fld, int dcd_len)
 {
int value;
@@ -345,7 +346,7 @@ static void parse_cfg_cmd(struct imx_header *imxhdr, 
int32_t cmd, char *token,
exit(EXIT_FAILURE);
}
cmd_ver_first = 1;
-   set_hdr_func(imxhdr, imximage_version);
+   set_hdr_func(ds-imxhdr, imximage_version);
break;
case CMD_BOOT_FROM:
g_flash_offset = get_table_entry_id(imximage_bootops,
@@ -360,14 +361,14 @@ static void parse_cfg_cmd(struct imx_header *imxhdr, 
int32_t cmd, char *token,
break;
case CMD_DATA:
value = get_cfg_value(token, name, lineno);
-   (*set_dcd_val)(imxhdr, name, lineno, fld, value, dcd_len);
+   (*set_dcd_val)(ds, name, lineno, fld, value, dcd_len);
if (unlikely(cmd_ver_first != 1))
cmd_ver_first = 0;
break;
}
 }
 
-static void parse_cfg_fld(struct imx_header *imxhdr, int32_t *cmd,
+static void parse_cfg_fld(struct data_src *ds, int32_t *cmd,
char *token, char 

[U-Boot] [PATCH V4 02/11] imximage: make header variable length

2012-11-27 Thread Troy Kisky
This makes the dcd table optional as well for v2.
Also, the header offset is no longer
right before the code starts.

Before this patch mx53loco_config produces

00 402000d1 7780  777ffc2c
10 777ffc20 777ffc00  
20 777ff800 0004b200  40a001d2
30 049c01cc 5485fa53 3000 5885fa53
... more DCD table
0001c0 27220200 1c90fd63  
0001d0    
*
0003f0    0400
000400 ea14 e59ff014 e59ff014 e59ff014

Notice offset 3fc contains 0x400. This
is the header offset. There is no reason
for this to be in the file, and I have
removed it.

After this patch we have

00 402000d1 7780  777ffe60
10 777ffe54 777ffe34  
20 777ffa34 0004b000  40a001d2
30 049c01cc 5485fa53 3000 5885fa53
... more DCD table
0001c0 27220200 1c90fd63  ea14
0001d0 e59ff014 e59ff014 e59ff014 e59ff014

Notice the zeros between 0x1cc and 0x3fb have
been removed.

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

---

v4: updated commit log, minor change to rebase on previous patch
v3: other patches split from this one
---
 tools/imximage.c |   65 --
 tools/imximage.h |4 ++--
 2 files changed, 46 insertions(+), 23 deletions(-)

diff --git a/tools/imximage.c b/tools/imximage.c
index 7e54e97..8457c8e 100644
--- a/tools/imximage.c
+++ b/tools/imximage.c
@@ -65,7 +65,6 @@ static table_entry_t imximage_versions[] = {
{-1,,  (Invalid), },
 };
 
-static struct imx_header imximage_header;
 static uint32_t imximage_version;
 
 static set_dcd_val_t set_dcd_val;
@@ -73,6 +72,9 @@ static set_dcd_rst_t set_dcd_rst;
 static set_imx_hdr_t set_imx_hdr;
 static uint32_t max_dcd_entries;
 static uint32_t *header_size_ptr;
+static uint32_t g_flash_offset;
+
+static struct image_type_params imximage_params;
 
 static uint32_t get_cfg_value(char *token, char *name,  int linenr)
 {
@@ -102,8 +104,7 @@ static uint32_t detect_imximage_version(struct imx_header 
*imx_hdr)
return IMXIMAGE_V1;
 
/* Try to detect V2 */
-   if ((fhdr_v2-header.tag == IVT_HEADER_TAG) 
-   (hdr_v2-dcd_table.header.tag == DCD_HEADER_TAG))
+   if (fhdr_v2-header.tag == IVT_HEADER_TAG)
return IMXIMAGE_V2;
 
return IMXIMAGE_VER_INVALID;
@@ -195,7 +196,7 @@ static void set_dcd_rst_v2(struct imx_header *imxhdr, 
uint32_t dcd_len,
dcd_v2-write_dcd_command.param = DCD_COMMAND_PARAM;
 }
 
-static void set_imx_hdr_v1(struct imx_header *imxhdr, uint32_t dcd_len,
+static int set_imx_hdr_v1(struct imx_header *imxhdr, uint32_t dcd_len,
uint32_t entry_point, uint32_t flash_offset)
 {
imx_header_v1_t *hdr_v1 = imxhdr-header.hdr_v1;
@@ -208,7 +209,7 @@ static void set_imx_hdr_v1(struct imx_header *imxhdr, 
uint32_t dcd_len,
/* Set magic number */
fhdr_v1-app_code_barker = APP_CODE_BARKER;
 
-   hdr_base = entry_point - sizeof(struct imx_header);
+   hdr_base = entry_point - header_length;
fhdr_v1-app_dest_ptr = hdr_base - flash_offset;
fhdr_v1-app_code_jump_vector = entry_point;
 
@@ -219,14 +220,18 @@ static void set_imx_hdr_v1(struct imx_header *imxhdr, 
uint32_t dcd_len,
fhdr_v1-app_code_csf = 0;
fhdr_v1-super_root_key = 0;
header_size_ptr = (uint32_t *)(((char *)imxhdr) + header_length - 4);
+   return header_length;
 }
 
-static void set_imx_hdr_v2(struct imx_header *imxhdr, uint32_t dcd_len,
+static int set_imx_hdr_v2(struct imx_header *imxhdr, uint32_t dcd_len,
uint32_t entry_point, uint32_t flash_offset)
 {
imx_header_v2_t *hdr_v2 = imxhdr-header.hdr_v2;
flash_header_v2_t *fhdr_v2 = hdr_v2-fhdr;
uint32_t hdr_base;
+   uint32_t header_length = (dcd_len) ?
+   (char *)hdr_v2-dcd_table.addr_data[dcd_len] - ((char*)imxhdr)
+   : offsetof(imx_header_v2_t, dcd_table);
 
/* Set magic number */
fhdr_v2-header.tag = IVT_HEADER_TAG; /* 0xD1 */
@@ -235,9 +240,10 @@ static void set_imx_hdr_v2(struct imx_header *imxhdr, 
uint32_t dcd_len,
 
fhdr_v2-entry = entry_point;
fhdr_v2-reserved1 = fhdr_v2-reserved2 = 0;
-   fhdr_v2-self = hdr_base = entry_point - sizeof(struct imx_header);
+   fhdr_v2-self = hdr_base = entry_point - header_length;
 
-   fhdr_v2-dcd_ptr = hdr_base + offsetof(imx_header_v2_t, dcd_table);
+   fhdr_v2-dcd_ptr = (dcd_len) ? hdr_base
+   + offsetof(imx_header_v2_t, dcd_table) : 0;
fhdr_v2-boot_data_ptr = hdr_base
+ offsetof(imx_header_v2_t, boot_data);
hdr_v2-boot_data.start = hdr_base - flash_offset;
@@ -245,6 +251,7 @@ static void set_imx_hdr_v2(struct imx_header *imxhdr, 
uint32_t dcd_len,
/* Security feature are not supported */
fhdr_v2-csf = 0;
  

[U-Boot] [PATCH V4 08/11] imximage: enable word writes for version2 header

2012-11-27 Thread Troy Kisky
Before, only 1 write_dcd_command table was built.
Now, a new table is built when the size changes.

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

---
v3: moved static variables together
---
 tools/imximage.c |  143 ++
 tools/imximage.h |   18 +++
 2 files changed, 76 insertions(+), 85 deletions(-)

diff --git a/tools/imximage.c b/tools/imximage.c
index 6d5cfa7..2f5ee14 100644
--- a/tools/imximage.c
+++ b/tools/imximage.c
@@ -65,8 +65,6 @@ static table_entry_t imximage_versions[] = {
{-1,,  (Invalid), },
 };
 
-static set_dcd_rst_t set_dcd_rst;
-static uint32_t max_dcd_entries;
 static uint32_t *header_size_ptr;
 static uint32_t g_flash_offset;
 
@@ -115,7 +113,7 @@ static void err_imximage_version(int version)
 }
 
 static void set_dcd_val_v1(struct data_src *ds, char *name, int lineno,
-   int fld, uint32_t value, uint32_t off)
+   int fld, uint32_t value)
 {
dcd_v1_t *dcd_v1 = ds-imxhdr-header.hdr_v1.dcd_table;
 
@@ -128,13 +126,15 @@ static void set_dcd_val_v1(struct data_src *ds, char 
*name, int lineno,
name, lineno, value);
exit(EXIT_FAILURE);
}
-   dcd_v1-addr_data[off].type = value;
+   *ds-p_entry++ = value;
break;
case CFG_REG_ADDRESS:
-   dcd_v1-addr_data[off].addr = value;
+   *ds-p_entry++ = value;
break;
case CFG_REG_VALUE:
-   dcd_v1-addr_data[off].value = value;
+   *ds-p_entry++ = value;
+   dcd_v1-preamble.length = (char *)ds-p_entry
+   - (char *)dcd_v1-addr_data[0].type;
break;
default:
break;
@@ -143,16 +143,42 @@ static void set_dcd_val_v1(struct data_src *ds, char 
*name, int lineno,
 }
 
 static void set_dcd_val_v2(struct data_src *ds, char *name, int lineno,
-   int fld, uint32_t value, uint32_t off)
+   int fld, uint32_t value)
 {
+   uint32_t len;
dcd_v2_t *dcd_v2 = ds-imxhdr-header.hdr_v2.dcd_table;
 
switch (fld) {
+   case CFG_REG_SIZE:
+   /* Byte, halfword, word */
+   if ((value != 1)  (value != 2)  (value != 4)) {
+   fprintf(stderr, Error: %s[%d] - 
+   Invalid register size  (%d)\n,
+   name, lineno, value);
+   exit(EXIT_FAILURE);
+   }
+   if (ds-p_dcd  (ds-p_dcd-param == value))
+   break;
+   if (!ds-p_dcd) {
+   dcd_v2-header.tag = DCD_HEADER_TAG;
+   dcd_v2-header.version = DCD_VERSION;
+   ds-p_dcd = dcd_v2-write_dcd_command;
+   } else {
+   ds-p_dcd = (write_dcd_command_t *)ds-p_entry;
+   }
+   ds-p_dcd-param = value;
+   ds-p_dcd-tag = DCD_COMMAND_TAG;
+   ds-p_entry = (uint32_t *)(ds-p_dcd + 1);
+   break;
case CFG_REG_ADDRESS:
-   dcd_v2-addr_data[off].addr = cpu_to_be32(value);
+   *ds-p_entry++ = cpu_to_be32(value);
break;
case CFG_REG_VALUE:
-   dcd_v2-addr_data[off].value = cpu_to_be32(value);
+   *ds-p_entry++ = cpu_to_be32(value);
+   len = (char *)ds-p_entry - (char *)dcd_v2-header;
+   dcd_v2-header.length = cpu_to_be16(len);
+   len = (char *)ds-p_entry - (char *)ds-p_dcd;
+   ds-p_dcd-length = cpu_to_be16(len);
break;
default:
break;
@@ -160,47 +186,14 @@ static void set_dcd_val_v2(struct data_src *ds, char 
*name, int lineno,
}
 }
 
-/*
- * Complete setting up the rest field of DCD of V1
- * such as barker code and DCD data length.
- */
-static void set_dcd_rst_v1(struct imx_header *imxhdr, uint32_t dcd_len,
-   char *name, int lineno)
-{
-   dcd_v1_t *dcd_v1 = imxhdr-header.hdr_v1.dcd_table;
-
-   dcd_v1-preamble.barker = DCD_BARKER;
-   dcd_v1-preamble.length = dcd_len * sizeof(dcd_type_addr_data_t);
-}
-
-/*
- * Complete setting up the reset field of DCD of V2
- * such as DCD tag, version, length, etc.
- */
-static void set_dcd_rst_v2(struct imx_header *imxhdr, uint32_t dcd_len,
-   char *name, int lineno)
-{
-   dcd_v2_t *dcd_v2 = imxhdr-header.hdr_v2.dcd_table;
-
-   dcd_v2-header.tag = DCD_HEADER_TAG;
-   dcd_v2-header.length = cpu_to_be16(
-   dcd_len * sizeof(dcd_addr_data_t) + 8);
-   dcd_v2-header.version = DCD_VERSION;
-   dcd_v2-write_dcd_command.tag = 

[U-Boot] [PATCH V4 09/11] tools: add parse_helper file

2012-11-27 Thread Troy Kisky
This file can help you parse
configuration files.

Signed-off-by: Troy Kisky troy.ki...@boundarydevices.com
---
 tools/Makefile   |2 +
 tools/parse_helper.c |  173 ++
 tools/parse_helper.h |   28 
 3 files changed, 203 insertions(+)
 create mode 100644 tools/parse_helper.c
 create mode 100644 tools/parse_helper.h

diff --git a/tools/Makefile b/tools/Makefile
index 686840a..db3b247 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -94,6 +94,7 @@ NOPED_OBJ_FILES-y += aisimage.o
 NOPED_OBJ_FILES-y += kwbimage.o
 NOPED_OBJ_FILES-y += pblimage.o
 NOPED_OBJ_FILES-y += imximage.o
+NOPED_OBJ_FILES-y += parse_helper.o
 NOPED_OBJ_FILES-y += omapimage.o
 NOPED_OBJ_FILES-y += mkenvimage.o
 NOPED_OBJ_FILES-y += mkimage.o
@@ -208,6 +209,7 @@ $(obj)mkimage$(SFX):$(obj)aisimage.o \
$(obj)fit_image.o \
$(obj)image.o \
$(obj)imximage.o \
+   $(obj)parse_helper.o \
$(obj)kwbimage.o \
$(obj)pblimage.o \
$(obj)md5.o \
diff --git a/tools/parse_helper.c b/tools/parse_helper.c
new file mode 100644
index 000..0a5c5f6
--- /dev/null
+++ b/tools/parse_helper.c
@@ -0,0 +1,173 @@
+/*
+ * (C) Copyright 20012  Boundary Devices Inc, troy.ki...@boundarydevices.com
+ *
+ * Licensed under the GPL-2 or later.
+ */
+
+/* Required to obtain the getline prototype from stdio.h */
+#define _GNU_SOURCE
+
+#include mkimage.h
+#include image.h
+#include parse_helper.h
+
+int ph_open(struct parse_helper *ph, char *filename)
+{
+   ph-line = NULL;
+   ph-len = 0;
+   ph-fd = fopen(filename, r);
+   ph-lineno = 0;
+   ph-cmd_started = 0;
+   ph-filename = filename;
+   ph-p = NULL;
+   return (!ph-fd) ? -1 : 0;
+}
+
+void ph_close(struct parse_helper *ph)
+{
+   fclose(ph-fd);
+   ph-fd = NULL;
+}
+
+int ph_skip_separators(struct parse_helper *ph)
+{
+   int line_no = ph-lineno;
+   char *p = ph-p;
+
+   for (;;) {
+   char c;
+   if (!p) {
+   if (getline(ph-line, ph-len, ph-fd) = 0)
+   return -1;
+   ph-lineno++;
+   p = ph-line;
+   if (ph-cmd_started) {
+   fprintf(stderr, warning: continuing command on
+next line, line %s[%d](%s)\n,
+   ph-filename, ph-lineno, p);
+   }
+   }
+   c = *p;
+   if ((c == ' ') || (c == '\t')) {
+   p++;
+   continue;
+   }
+   /* Drop all text starting with '#' as comments */
+   if ((c == '#') || (c == '\r') || (c == '\n')
+   || !c) {
+   p = NULL;
+   continue;
+   }
+   if (c == ';') {
+   if (ph-cmd_started) {
+   fprintf(stderr, Error: command not 
+   finished:%s[%d](%s)\n,
+   ph-filename, ph-lineno, p);
+   exit(EXIT_FAILURE);
+   }
+   p++;
+   continue;
+   }
+   if (!ph-cmd_started  line_no == ph-lineno) {
+   fprintf(stderr, Error: extra data at end 
+   of line %s[%d](%s)\n,
+   ph-filename, ph-lineno, p);
+   exit(EXIT_FAILURE);
+   }
+   ph-p = p;
+   return 0;
+   }
+}
+
+int ph_skip_comma(struct parse_helper *ph)
+{
+   char *p = ph-p;
+
+   for (;;) {
+   char c = *p++;
+   if ((c == '#') || (c == '\r') || (c == '\n') || !c)
+   return 0;
+   if (c == ',') {
+   ph-p = p;
+   ph_skip_separators(ph);
+   return 1;
+   }
+   if ((c != ' ')  (c == '\t'))
+   return 0;
+   }
+}
+
+int ph_get_value(struct parse_helper *ph, uint32_t *pval)
+{
+   char *endptr;
+   uint32_t value;
+
+   if (ph_skip_separators(ph))
+   return -1;
+   errno = 0;
+   value = strtoul(ph-p, endptr, 16);
+   if (errno || (ph-p == endptr))
+   return -1;
+   *pval = value;
+   ph-p = endptr;
+   return 0;
+}
+
+/*
+ * Comma separator optional
+ * Input:
+ * ph - input source
+ * data - array to fill in
+ * cnt - exact number of elements to parse
+ * Return: number of elements parsed, or error
+ */
+int ph_get_array(struct parse_helper *ph, uint32_t 

[U-Boot] [PATCH V4 00/11] imximage series

2012-11-27 Thread Troy Kisky

This series make the file imximage.c easier to read, as well
as produces a slightly smaller file.


Only the 1st two patches are different from version 3. The
1st is a new patch which addresses an mx53 ROM bug. The 2nd
is slight changes due to rebase on 1st.



Troy Kisky (11):
  imximage: mx53 needs transfer length a multiple of 512
  imximage: make header variable length
  imximage: remove static imximage_version
  imximage: prepare to move static variables to struct data_src
  imximage: change parameters for set_dcd_val/set_imx_hdr
  imximage: move set_imx_hdr to struct data_src
  imximage: move set_dcd_val to struct data_src
  imximage: enable word writes for version2 header
  tools: add parse_helper file
  imximage: use parse_helper functions
  parse_helper: add expression evaluation

 tools/Makefile   |2 +
 tools/imximage.c |  437 ++
 tools/imximage.h |   37 ++---
 tools/parse_helper.c |  325 +
 tools/parse_helper.h |   28 
 5 files changed, 564 insertions(+), 265 deletions(-)
 create mode 100644 tools/parse_helper.c
 create mode 100644 tools/parse_helper.h

-- 
1.7.9.5

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


[U-Boot] [PATCH V4 10/11] imximage: use parse_helper functions

2012-11-27 Thread Troy Kisky
Use parse_helper functions to pulling tokens instead
of pushing them.
Remove need for switch statements to process commands.

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

---
v2: uses file parse_helper added in previous patch
changed patch subject, was cleanup parsing
---
 tools/imximage.c |  267 +++---
 tools/imximage.h |   17 ++--
 2 files changed, 101 insertions(+), 183 deletions(-)

diff --git a/tools/imximage.c b/tools/imximage.c
index 2f5ee14..5147989 100644
--- a/tools/imximage.c
+++ b/tools/imximage.c
@@ -25,9 +25,6 @@
  * MA 02111-1307 USA
  */
 
-/* Required to obtain the getline prototype from stdio.h */
-#define _GNU_SOURCE
-
 #include mkimage.h
 #include image.h
 #include imximage.h
@@ -70,21 +67,6 @@ static uint32_t g_flash_offset;
 
 static struct image_type_params imximage_params;
 
-static uint32_t get_cfg_value(char *token, char *name,  int linenr)
-{
-   char *endptr;
-   uint32_t value;
-
-   errno = 0;
-   value = strtoul(token, endptr, 16);
-   if (errno || (token == endptr)) {
-   fprintf(stderr, Error: %s[%d] - Invalid hex data(%s)\n,
-   name,  linenr, token);
-   exit(EXIT_FAILURE);
-   }
-   return value;
-}
-
 static uint32_t detect_imximage_version(struct imx_header *imx_hdr)
 {
imx_header_v1_t *hdr_v1 = imx_hdr-header.hdr_v1;
@@ -112,53 +94,36 @@ static void err_imximage_version(int version)
exit(EXIT_FAILURE);
 }
 
-static void set_dcd_val_v1(struct data_src *ds, char *name, int lineno,
-   int fld, uint32_t value)
+static int set_dcd_val_v1(struct data_src *ds, uint32_t *data)
 {
dcd_v1_t *dcd_v1 = ds-imxhdr-header.hdr_v1.dcd_table;
+   uint32_t val = *data++;
 
-   switch (fld) {
-   case CFG_REG_SIZE:
-   /* Byte, halfword, word */
-   if ((value != 1)  (value != 2)  (value != 4)) {
-   fprintf(stderr, Error: %s[%d] - 
-   Invalid register size  (%d)\n,
-   name, lineno, value);
-   exit(EXIT_FAILURE);
-   }
-   *ds-p_entry++ = value;
-   break;
-   case CFG_REG_ADDRESS:
-   *ds-p_entry++ = value;
-   break;
-   case CFG_REG_VALUE:
-   *ds-p_entry++ = value;
-   dcd_v1-preamble.length = (char *)ds-p_entry
-   - (char *)dcd_v1-addr_data[0].type;
-   break;
-   default:
-   break;
-
+   /* Byte, halfword, word */
+   if ((val != 1)  (val != 2)  (val != 4)) {
+   fprintf(stderr, Error: Invalid register size (%d)\n, val);
+   return -1;
}
+   *ds-p_entry++ = val;
+   *ds-p_entry++ = *data++;
+   *ds-p_entry++ = *data++;
+   dcd_v1-preamble.length = (char *)ds-p_entry - (char *)dcd_v1-
+   addr_data[0].type;
+   return 0;
 }
 
-static void set_dcd_val_v2(struct data_src *ds, char *name, int lineno,
-   int fld, uint32_t value)
+static int set_dcd_val_v2(struct data_src *ds, uint32_t *data)
 {
uint32_t len;
dcd_v2_t *dcd_v2 = ds-imxhdr-header.hdr_v2.dcd_table;
+   uint32_t val = *data++;
 
-   switch (fld) {
-   case CFG_REG_SIZE:
-   /* Byte, halfword, word */
-   if ((value != 1)  (value != 2)  (value != 4)) {
-   fprintf(stderr, Error: %s[%d] - 
-   Invalid register size  (%d)\n,
-   name, lineno, value);
-   exit(EXIT_FAILURE);
-   }
-   if (ds-p_dcd  (ds-p_dcd-param == value))
-   break;
+   /* Byte, halfword, word */
+   if ((val != 1)  (val != 2)  (val != 4)) {
+   fprintf(stderr, Error: Invalid register size (%d)\n, val);
+   return -1;
+   }
+   if (!(ds-p_dcd  (ds-p_dcd-param == val))) {
if (!ds-p_dcd) {
dcd_v2-header.tag = DCD_HEADER_TAG;
dcd_v2-header.version = DCD_VERSION;
@@ -166,24 +131,19 @@ static void set_dcd_val_v2(struct data_src *ds, char 
*name, int lineno,
} else {
ds-p_dcd = (write_dcd_command_t *)ds-p_entry;
}
-   ds-p_dcd-param = value;
+   ds-p_dcd-param = val;
ds-p_dcd-tag = DCD_COMMAND_TAG;
ds-p_entry = (uint32_t *)(ds-p_dcd + 1);
-   break;
-   case CFG_REG_ADDRESS:
-   *ds-p_entry++ = cpu_to_be32(value);
-   break;
-   case CFG_REG_VALUE:
-   *ds-p_entry++ = cpu_to_be32(value);
-   len = (char *)ds-p_entry - (char *)dcd_v2-header;
-   dcd_v2-header.length = cpu_to_be16(len);
-   

[U-Boot] [PATCH V4 06/11] imximage: move set_imx_hdr to struct data_src

2012-11-27 Thread Troy Kisky
Signed-off-by: Troy Kisky troy.ki...@boundarydevices.com

---
v3: new patch
---
 tools/imximage.c |   13 ++---
 tools/imximage.h |1 +
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/tools/imximage.c b/tools/imximage.c
index ddac95f..30f3c81 100644
--- a/tools/imximage.c
+++ b/tools/imximage.c
@@ -67,7 +67,6 @@ static table_entry_t imximage_versions[] = {
 
 static set_dcd_val_t set_dcd_val;
 static set_dcd_rst_t set_dcd_rst;
-static set_imx_hdr_t set_imx_hdr;
 static uint32_t max_dcd_entries;
 static uint32_t *header_size_ptr;
 static uint32_t g_flash_offset;
@@ -253,19 +252,19 @@ static int set_imx_hdr_v2(struct data_src *ds, uint32_t 
dcd_len,
return header_length;
 }
 
-static void set_hdr_func(struct imx_header *imxhdr, uint32_t imximage_version)
+static void set_hdr_func(struct data_src *ds, uint32_t imximage_version)
 {
switch (imximage_version) {
case IMXIMAGE_V1:
set_dcd_val = set_dcd_val_v1;
set_dcd_rst = set_dcd_rst_v1;
-   set_imx_hdr = set_imx_hdr_v1;
+   ds-set_imx_hdr = set_imx_hdr_v1;
max_dcd_entries = MAX_HW_CFG_SIZE_V1;
break;
case IMXIMAGE_V2:
set_dcd_val = set_dcd_val_v2;
set_dcd_rst = set_dcd_rst_v2;
-   set_imx_hdr = set_imx_hdr_v2;
+   ds-set_imx_hdr = set_imx_hdr_v2;
max_dcd_entries = MAX_HW_CFG_SIZE_V2;
break;
default:
@@ -346,7 +345,7 @@ static void parse_cfg_cmd(struct data_src *ds, int32_t cmd, 
char *token,
exit(EXIT_FAILURE);
}
cmd_ver_first = 1;
-   set_hdr_func(ds-imxhdr, imximage_version);
+   set_hdr_func(ds, imximage_version);
break;
case CMD_BOOT_FROM:
g_flash_offset = get_table_entry_id(imximage_bootops,
@@ -431,7 +430,7 @@ static int parse_cfg_file(struct imx_header *imxhdr, char 
*name,
 * by adding VERSION command into it, here need
 * set up function ptr group to V1 by default.
 */
-   set_hdr_func(imxhdr, IMXIMAGE_V1);
+   set_hdr_func(ds, IMXIMAGE_V1);
fd = fopen(name, r);
if (fd == 0) {
fprintf(stderr, Error: %s - Can't open DCD file\n, name);
@@ -474,7 +473,7 @@ static int parse_cfg_file(struct imx_header *imxhdr, char 
*name,
exit(EXIT_FAILURE);
}
/* Set the imx header */
-   return (*set_imx_hdr)(ds, dcd_len, entry_point, g_flash_offset);
+   return (*ds.set_imx_hdr)(ds, dcd_len, entry_point, g_flash_offset);
 }
 
 static int imximage_check_image_types(uint8_t type)
diff --git a/tools/imximage.h b/tools/imximage.h
index 3054d55..f27a2ef 100644
--- a/tools/imximage.h
+++ b/tools/imximage.h
@@ -174,5 +174,6 @@ typedef int (*set_imx_hdr_t)(struct data_src *ds, uint32_t 
dcd_len,
 
 struct data_src {
struct imx_header *imxhdr;
+   set_imx_hdr_t set_imx_hdr;
 };
 #endif /* _IMXIMAGE_H_ */
-- 
1.7.9.5

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


Re: [U-Boot] [PATCH 5/5] x86: Add ilog2 to bitops

2012-11-27 Thread Simon Glass
On Sun, Apr 29, 2012 at 5:00 AM, Graeme Russ graeme.r...@gmail.com wrote:
 ilog2 is required by AHCI driver

 Signed-off-by: Graeme Russ graeme.r...@gmail.com

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


Re: [U-Boot] [PATCH 2/5] x86: Forward declate gd_t

2012-11-27 Thread Marek Vasut
Dear Simon Glass,

 Hi Marek,
 
 On Tue, Nov 27, 2012 at 5:29 PM, Marek Vasut ma...@denx.de wrote:
  Dear Simon Glass,
  
  Hi,
  
  On Sun, Apr 29, 2012 at 7:23 PM, Marek Vasut ma...@denx.de wrote:
   Dear Graeme Russ,
   
   So it can be used as a type in struct global_data and remove an ugly
   typecast
   
   Signed-off-by: Graeme Russ graeme.r...@gmail.com
   ---
   
arch/x86/cpu/cpu.c |2 +-
arch/x86/include/asm/global_data.h |4 +++-
2 files changed, 4 insertions(+), 2 deletions(-)
  
  I had to modify this slightly to get it to build (added the same cast
  fix to sdram.c as you did to cpu.c). Then, applied to x86/next.
  
  It'd be really nice if you could possibly take over the x86 custodianship
  from Graeme, it seems this arch is rotting :(
 
 Your wish is my command :-)

Not so fast, this stuff is better discussed with both of those guys (CCed)

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


Re: [U-Boot] [PATCH 1/5] x86: Fix compilation on 64-built built machines

2012-11-27 Thread Simon Glass
Hi,

On Sun, Apr 29, 2012 at 5:00 AM, Graeme Russ graeme.r...@gmail.com wrote:

 Signed-off-by: Graeme Russ graeme.r...@gmail.com

I have updated the commit subject and applied to x86/next.

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


Re: [U-Boot] [PATCH 2/5] x86: Forward declate gd_t

2012-11-27 Thread Graeme Russ
Hi Marek,

On Wed, Nov 28, 2012 at 12:35 PM, Marek Vasut ma...@denx.de wrote:

 Dear Simon Glass,

  Hi Marek,
 
  On Tue, Nov 27, 2012 at 5:29 PM, Marek Vasut ma...@denx.de wrote:
   Dear Simon Glass,
  
   Hi,
  
   On Sun, Apr 29, 2012 at 7:23 PM, Marek Vasut ma...@denx.de wrote:
Dear Graeme Russ,
   
So it can be used as a type in struct global_data and remove an
 ugly
typecast
   
Signed-off-by: Graeme Russ graeme.r...@gmail.com
---
   
 arch/x86/cpu/cpu.c |2 +-
 arch/x86/include/asm/global_data.h |4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)
  
   I had to modify this slightly to get it to build (added the same cast
   fix to sdram.c as you did to cpu.c). Then, applied to x86/next.
  
   It'd be really nice if you could possibly take over the x86
 custodianship
   from Graeme, it seems this arch is rotting :(
 
  Your wish is my command :-)

 Not so fast, this stuff is better discussed with both of those guys (CCed)

 You've either had too much beer or too little sleep (or both) - Simon took
over several weeks ago :)

Regards,

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


[U-Boot] [PATCH 4/5] x86: Remove duplicate PCI init

2012-11-27 Thread Simon Glass
From: Graeme Russ graeme.r...@gmail.com

Signed-off-by: Graeme Russ graeme.r...@gmail.com
Signed-off-by: Simon Glass s...@chromium.org
---
 arch/x86/lib/board.c |3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/arch/x86/lib/board.c b/arch/x86/lib/board.c
index a13f5c0..c7d8960 100644
--- a/arch/x86/lib/board.c
+++ b/arch/x86/lib/board.c
@@ -164,9 +164,6 @@ init_fnc_t *init_sequence_r[] = {
 #ifdef CONFIG_MISC_INIT_R
misc_init_r,
 #endif
-#if defined(CONFIG_CMD_PCMCIA)  !defined(CONFIG_CMD_IDE)
-   pci_init_r,
-#endif
 #if defined(CONFIG_CMD_KGDB)
kgdb_init_r,
 #endif
-- 
1.7.7.3

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


[U-Boot] [PATCH 5/5] x86: Add ilog2 to bitops

2012-11-27 Thread Simon Glass
From: Graeme Russ graeme.r...@gmail.com

ilog2 is required by AHCI driver

Signed-off-by: Graeme Russ graeme.r...@gmail.com
Signed-off-by: Simon Glass s...@chromium.org
---
 arch/x86/include/asm/bitops.h |5 +
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/arch/x86/include/asm/bitops.h b/arch/x86/include/asm/bitops.h
index c7a38f2..5a7e4cb 100644
--- a/arch/x86/include/asm/bitops.h
+++ b/arch/x86/include/asm/bitops.h
@@ -351,6 +351,11 @@ static __inline__ int ffs(int x)
 }
 #define PLATFORM_FFS
 
+static inline int __ilog2(unsigned int x)
+{
+   return generic_fls(x) - 1;
+}
+
 /**
  * hweightN - returns the hamming weight of a N-bit word
  * @x: the word to weigh
-- 
1.7.7.3

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


[U-Boot] [PATCH 2/5] x86: Forward declare gd_t

2012-11-27 Thread Simon Glass
From: Graeme Russ graeme.r...@gmail.com

So it can be used as a type in struct global_data and remove an ugly typecast

Signed-off-by: Graeme Russ graeme.r...@gmail.com
Signed-off-by: Simon Glass s...@chromium.org
Acked-by: Marek Vasut ma...@denx.de
---
 arch/x86/cpu/cpu.c |2 +-
 arch/x86/include/asm/global_data.h |4 +++-
 arch/x86/lib/init_helpers.c|2 +-
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/arch/x86/cpu/cpu.c b/arch/x86/cpu/cpu.c
index e9bb0d7..67de6bc 100644
--- a/arch/x86/cpu/cpu.c
+++ b/arch/x86/cpu/cpu.c
@@ -92,7 +92,7 @@ static void load_gdt(const u64 *boot_gdt, u16 num_entries)
 
 void init_gd(gd_t *id, u64 *gdt_addr)
 {
-   id-gd_addr = (ulong)id;
+   id-gd_addr = id;
setup_gdt(id, gdt_addr);
 }
 
diff --git a/arch/x86/include/asm/global_data.h 
b/arch/x86/include/asm/global_data.h
index bce999f..d471367 100644
--- a/arch/x86/include/asm/global_data.h
+++ b/arch/x86/include/asm/global_data.h
@@ -33,9 +33,11 @@
 
 #ifndef __ASSEMBLY__
 
+typedef struct global_data gd_t;
+
 typedefstruct global_data {
/* NOTE: gd_addr MUST be first member of struct global_data! */
-   unsigned long   gd_addr;/* Location of Global Data */
+   gd_t *gd_addr;  /* Location of Global Data */
bd_t*bd;
unsigned long   flags;
unsigned intbaudrate;
diff --git a/arch/x86/lib/init_helpers.c b/arch/x86/lib/init_helpers.c
index 9ec34ff..2f718d7 100644
--- a/arch/x86/lib/init_helpers.c
+++ b/arch/x86/lib/init_helpers.c
@@ -126,7 +126,7 @@ int copy_gd_to_ram_f_r(void)
 * in-RAM copy of Global Data (calculate_relocation_address()
 * has already calculated the in-RAM location of the GDT)
 */
-   ram_gd-gd_addr = (ulong)ram_gd;
+   ram_gd-gd_addr = ram_gd;
init_gd(ram_gd, (u64 *)gd-gdt_addr);
 
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 3/5] x86: Put global data on the stack

2012-11-27 Thread Simon Glass
From: Graeme Russ graeme.r...@gmail.com

Putting global data on the stack simplifies the init process (and makes it
slightly quicker). During the 'flash' stage of the init sequence, global
data is in the CAR stack. After SDRAM is initialised, global data is copied
from CAR to the SDRAM stack

Signed-off-by: Graeme Russ graeme.r...@gmail.com
Signed-off-by: Simon Glass s...@chromium.org
---
 arch/x86/cpu/cpu.c  |6 ---
 arch/x86/cpu/start.S|   67 +++
 arch/x86/include/asm/global_data.h  |1 -
 arch/x86/include/asm/init_helpers.h |1 -
 arch/x86/include/asm/processor.h|1 +
 arch/x86/lib/board.c|2 +-
 arch/x86/lib/init_helpers.c |   37 +---
 include/configs/coreboot.h  |5 +--
 include/configs/eNET.h  |6 ---
 9 files changed, 65 insertions(+), 61 deletions(-)

diff --git a/arch/x86/cpu/cpu.c b/arch/x86/cpu/cpu.c
index 67de6bc..9c2db9f 100644
--- a/arch/x86/cpu/cpu.c
+++ b/arch/x86/cpu/cpu.c
@@ -90,12 +90,6 @@ 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 = id;
-   setup_gdt(id, gdt_addr);
-}
-
 void setup_gdt(gd_t *id, u64 *gdt_addr)
 {
/* CS: code, read/execute, 4 GB, base 0 */
diff --git a/arch/x86/cpu/start.S b/arch/x86/cpu/start.S
index ee0dabe..ec12e80 100644
--- a/arch/x86/cpu/start.S
+++ b/arch/x86/cpu/start.S
@@ -83,13 +83,33 @@ car_init_ret:
 * or fully initialised SDRAM - we really don't care which)
 * starting at CONFIG_SYS_CAR_ADDR to be used as a temporary stack
 */
-   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
-   callinit_gd;
+   /* Stack grows down from top of CAR */
+   movl$(CONFIG_SYS_CAR_ADDR + CONFIG_SYS_CAR_SIZE), %esp
+
+   /* Reserve space on stack for global data */
+   subl$GENERATED_GBL_DATA_SIZE, %esp
+
+   /* Align global data to 16-byte boundary */
+   andl$0xfff0, %esp
+
+   /* Setup first parameter to setup_gdt */
+   movl%esp, %eax
+
+   /* Reserve space for global descriptor table */
+   subl$X86_GDT_SIZE, %esp
+
+   /* Align temporary global descriptor table to 16-byte boundary */
+   andl$0xfff0, %esp
+
+   /* Set second parameter to setup_gdt */
+   movl%esp, %edx
+
+   /* gd-gd_addr = gd (Required to allow gd-xyz to work) */
+   movl%eax, (%eax)
+
+   /* Setup global descriptor table so gd-xyz works */
+   callsetup_gdt
 
/* Set parameter to board_init_f() to boot flags */
xorl%eax, %eax
@@ -113,9 +133,42 @@ board_init_f_r_trampoline:
 * %eax = Address of top of new stack
 */
 
-   /* Setup stack in RAM */
+   /* Stack grows down from top of SDRAM */
movl%eax, %esp
 
+   /* Reserve space on stack for global data */
+   subl$GENERATED_GBL_DATA_SIZE, %esp
+
+   /* Align global data to 16-byte boundary */
+   andl$0xfff0, %esp
+
+   /* Setup first parameter to memcpy (and setup_gdt) */
+   movl%esp, %eax
+
+   /* Setup second parameter to memcpy */
+   fs movl 0, %edx
+
+   /* Set third parameter to memcpy */
+   movl$GENERATED_GBL_DATA_SIZE, %ecx
+
+   /* Copy global data from CAR to SDRAM stack */
+   callmemcpy
+
+   /* Reserve space for global descriptor table */
+   subl$X86_GDT_SIZE, %esp
+
+   /* Align global descriptor table to 16-byte boundary */
+   andl$0xfff0, %esp
+
+   /* Set second parameter to setup_gdt */
+   movl%esp, %edx
+
+   /* gd-gd_addr = gd (Required to allow gd-xyz to work) */
+   movl%eax, (%eax)
+
+   /* Setup global descriptor table so gd-xyz works */
+   callsetup_gdt
+
/* Re-enter U-Boot by calling board_init_f_r */
callboard_init_f_r
 
diff --git a/arch/x86/include/asm/global_data.h 
b/arch/x86/include/asm/global_data.h
index d471367..fac93f0 100644
--- a/arch/x86/include/asm/global_data.h
+++ b/arch/x86/include/asm/global_data.h
@@ -54,7 +54,6 @@ typedef   struct global_data {
unsigned long   relocaddr;  /* Start address of U-Boot in RAM */
unsigned long   start_addr_sp;  /* start_addr_stackpointer */
unsigned long   gdt_addr;   /* Location of GDT */
-   unsigned long   new_gd_addr;/* New location of Global Data */
phys_size_t ram_size;   /* RAM size */
unsigned long   reset_status;   /* reset status register at boot */
void**jt;   /* jump table */
diff --git a/arch/x86/include/asm/init_helpers.h 
b/arch/x86/include/asm/init_helpers.h
index 

[U-Boot] [PATCH 1/5] x86: Fix compilation on 64-bit build machines

2012-11-27 Thread Simon Glass
From: Graeme Russ graeme.r...@gmail.com

Signed-off-by: Graeme Russ graeme.r...@gmail.com
Signed-off-by: Simon Glass s...@chromium.org
---
 Makefile |1 +
 arch/x86/cpu/config.mk   |3 ++-
 examples/standalone/Makefile |2 +-
 3 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 1a17be9..2ad5cc5 100644
--- a/Makefile
+++ b/Makefile
@@ -35,6 +35,7 @@ VERSION_FILE = $(obj)include/generated/version_autogenerated.h
 
 HOSTARCH := $(shell uname -m | \
sed -e s/i.86/x86/ \
+   -e s/x86_64/x86/ \
-e s/sun4u/sparc64/ \
-e s/arm.*/arm/ \
-e s/sa110/arm/ \
diff --git a/arch/x86/cpu/config.mk b/arch/x86/cpu/config.mk
index c00f867..092de68 100644
--- a/arch/x86/cpu/config.mk
+++ b/arch/x86/cpu/config.mk
@@ -23,7 +23,8 @@
 
 CROSS_COMPILE ?= i386-linux-
 
-PLATFORM_CPPFLAGS += -DCONFIG_X86 -D__I386__ -march=i386 -Werror
+PLATFORM_CPPFLAGS += -DCONFIG_X86 -D__I386__ -march=i386 -Werror -m32
+PLATFORM_LDFLAGS += -m elf_i386
 
 # DO NOT MODIFY THE FOLLOWING UNLESS YOU REALLY KNOW WHAT YOU ARE DOING!
 LDPPFLAGS += -DRESET_SEG_START=0x
diff --git a/examples/standalone/Makefile b/examples/standalone/Makefile
index baaa2fb..7c1ea5c 100644
--- a/examples/standalone/Makefile
+++ b/examples/standalone/Makefile
@@ -98,7 +98,7 @@ $(ELF):
 $(obj)%:   $(obj)%.o $(LIB)
$(LD) $(LDFLAGS) -g -Ttext $(CONFIG_STANDALONE_LOAD_ADDR) \
-o $@ -e $(SYM_PREFIX)$(notdir $(:.o=)) $ $(LIB) \
-   -L$(gcclibdir) -lgcc
+   -L$(USE_PRIVATE_LIBGCC) -lgcc
 
 $(SREC):
 $(obj)%.srec:  $(obj)%
-- 
1.7.7.3

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


  1   2   >