Re: [U-Boot] Bug in buildsystem for SPL LDSCRIPT

2014-04-09 Thread Andreas Bießmann
Hi Masahiro,

On 04/09/2014 04:27 AM, Masahiro Yamada wrote:
 On Mon, 07 Apr 2014 11:35:07 +0200
 Andreas Biesmann andreas.de...@googlemail.com wrote:
 
 and also to the list ... sorry for the noise

 On 04/07/2014 11:27 AM, Andreas Biesmann wrote:
 Hi Masahiro,

 a late bug report ;) changing my board config file will not regenerate
 the spl/u-boot-spl.lds for the board though it depends on it. The
 LDSCRIPT is patched with some size information for range checking which
 is not updated in my case. However regenerating the file by deleting it
 first works. Cold you please provide a fix for that in 2014.04?
 
 Could you give me an example in which spl/u-bool-spl.lds is not
 correctly regenerated.


it is not regenerated when the configuration is changed. Here is my use
case:

---8---
abiessmann@punisher % git describe
v2014.04-rc3-91-g36490ee
abiessmann@punisher % PATH=$ARMa8_PATH:$PATH make O=/tmp/tricorder
ARCH=arm CROSS_COMPILE=arm-cortexa8-linux-gnueabi- -j16 -s
tricorder_config all
Configuring for tricorder board...
PATH=$ARMa8_PATH:$PATH make O=/tmp/tricorder ARCH=arm  -j16 -s  all
27.23s user 2.47s system 539% cpu 5.507 total
abiessmann@punisher % grep CONFIG_SPL_MAX_SIZE include/configs/tricorder.h
#define CONFIG_SPL_MAX_SIZE (57 * 1024) /* 7 KB for stack */
abiessmann@punisher % head -1 /tmp/tricorder/spl/u-boot-spl.lds
MEMORY { .sram : ORIGIN = 0x4020, LENGTH = (57 * 1024) }
---8---


... modify configuration

---8---
abiessmann@punisher % grep CONFIG_SPL_MAX_SIZE include/configs/tricorder.h
#define CONFIG_SPL_MAX_SIZE (59 * 1024) /* 7 KB for stack */
abiessmann@punisher % PATH=$ARMa8_PATH:$PATH make O=/tmp/tricorder
ARCH=arm CROSS_COMPILE=arm-cortexa8-linux-gnueabi- -j16 -s all
PATH=$ARMa8_PATH:$PATH make O=/tmp/tricorder ARCH=arm  -j16 -s all
25.25s user 2.16s system 550% cpu 4.974 total
abiessmann@punisher % head -1 /tmp/tricorder/spl/u-boot-spl.lds
MEMORY { .sram : ORIGIN = 0x4020, LENGTH = (57 * 1024) }
abiessmann@punisher % ls -l /tmp/tricorder/spl/u-boot-spl.lds
-rw-r--r-- 1 abiessmann abiessmann 699 Apr  9 08:27
/tmp/tricorder/spl/u-boot-spl.lds
abiessmann@punisher % ls -l /tmp/tricorder/spl/u-boot-spl
-rwxr-xr-x 1 abiessmann abiessmann 571948 Apr  9 08:28
/tmp/tricorder/spl/u-boot-spl*
abiessmann@punisher % ls -l include/configs/tricorder.h
-rw-r--r-- 1 abiessmann abiessmann 12071 Apr  9 08:28
include/configs/tricorder.h
abiessmann@punisher %
---8---

Best regards

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


Re: [U-Boot] [PATCH v2 2/2] mx6: add example DTB for mx6qsabreauto

2014-04-09 Thread Stefano Babic
Hi Masahiro,

On 09/04/2014 04:19, Masahiro Yamada wrote:

 --- /dev/null
 +++ b/arch/arm/dts/imx6q-sabreauto.dts
 @@ -0,0 +1,13 @@
 +/*
 ++ * Copyright 2012 Freescale Semiconductor, Inc.
 ++ * Copyright 2011 Linaro Ltd.
 ++ *
 ++ * SPDX-License-Identifier: GPL-2.0+
 ++ */
 +
 
 This patch has been applied, but the license block
  in arch/arm/dts/imx6q-sabreauto.dts looks weird.

It is ! Thanks to have noted it !

 
 Could you fix the broken format in a follow-up patch?

Of course !

Best regards,
Stefano Babic


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


[U-Boot] [PATCH] mx6: fix weird formatting in imx6q-sabreauto.dts

2014-04-09 Thread Stefano Babic
Reported-by: Masahiro Yamada yamad...@jp.panasonic.com
Signed-off-by: Stefano Babic sba...@denx.de
---
 arch/arm/dts/imx6q-sabreauto.dts |   10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/arm/dts/imx6q-sabreauto.dts b/arch/arm/dts/imx6q-sabreauto.dts
index a3c9c91..7af2a88 100644
--- a/arch/arm/dts/imx6q-sabreauto.dts
+++ b/arch/arm/dts/imx6q-sabreauto.dts
@@ -1,9 +1,9 @@
 /*
-+ * Copyright 2012 Freescale Semiconductor, Inc.
-+ * Copyright 2011 Linaro Ltd.
-+ *
-+ * SPDX-License-Identifier: GPL-2.0+
-+ */
+ * Copyright 2012 Freescale Semiconductor, Inc.
+ * Copyright 2011 Linaro Ltd.
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
 
 /dts-v1/;
 
-- 
1.7.9.5

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


[U-Boot] [PATCH] trats: config: fix: Set default console to ttySAC2

2014-04-09 Thread Lukasz Majewski
During providing device tree support for Exynos4 based boards,
a tiny mistake has creeped in the fe60164 commit.

This commit restores proper setting of default console for the
trats board.

Signed-off-by: Lukasz Majewski l.majew...@samsung.com
Cc: Minkyu Kang mk7.k...@samsung.com
---
 include/configs/trats.h |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/configs/trats.h b/include/configs/trats.h
index bf2c869..1d81a29 100644
--- a/include/configs/trats.h
+++ b/include/configs/trats.h
@@ -60,7 +60,7 @@
 
 #define CONFIG_BOOTARGSPlease use defined boot
 #define CONFIG_BOOTCOMMAND run mmcboot
-#define CONFIG_DEFAULT_CONSOLE console=ttySAC1,115200n8\0
+#define CONFIG_DEFAULT_CONSOLE console=ttySAC2,115200n8\0
 
 #define CONFIG_SYS_INIT_SP_ADDR(CONFIG_SYS_LOAD_ADDR \
- GENERATED_GBL_DATA_SIZE)
-- 
1.7.10.4

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


[U-Boot] [PATCH] trats2: config: fix: Set default console to ttySAC2

2014-04-09 Thread Lukasz Majewski
During providing device tree support for Exynos4 based boards,
a tiny mistake has creeped in the 1ecab0f commit.

This commit restores proper setting of default console for the
trats2 board.

Signed-off-by: Lukasz Majewski l.majew...@samsung.com
Cc: Minkyu Kang mk7.k...@samsung.com
---
 include/configs/trats2.h |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/configs/trats2.h b/include/configs/trats2.h
index aee9ee2..0760309 100644
--- a/include/configs/trats2.h
+++ b/include/configs/trats2.h
@@ -53,7 +53,7 @@
 
 #define CONFIG_BOOTARGSPlease use defined boot
 #define CONFIG_BOOTCOMMAND run mmcboot
-#define CONFIG_DEFAULT_CONSOLE console=ttySAC1,115200n8\0
+#define CONFIG_DEFAULT_CONSOLE console=ttySAC2,115200n8\0
 
 #define CONFIG_SYS_INIT_SP_ADDR(CONFIG_SYS_LOAD_ADDR \
- GENERATED_GBL_DATA_SIZE)
-- 
1.7.10.4

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


[U-Boot] [PATCH] kbuild: fix a bug in regeneration of linker scripts

2014-04-09 Thread Masahiro Yamada
In some use cases, SPL linker script was not updated even when
it should be.

For instance,

  $ make tricoder_config all
[ build complete ]
  ... modify include/configs/tricoder.h
  $ make

spl/u-boot-spl.lds should be updated in this case, but it wasn't.

To fix this problem, linker scripts generation should be handled
by $(call if_changed_dep,...) rather than by $(call if_changed,...).

Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
Reported-by: Andreas Bießmann andreas.de...@googlemail.com
---

 Makefile | 6 +++---
 spl/Makefile | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/Makefile b/Makefile
index b807e5c..b2937e9 100644
--- a/Makefile
+++ b/Makefile
@@ -1053,11 +1053,11 @@ depend dep:
 
 # ---
 quiet_cmd_cpp_lds = LDS $@
-cmd_cpp_lds = $(CPP) $(cpp_flags) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ \
-   -x assembler-with-cpp -P -o $@ $
+cmd_cpp_lds = $(CPP) -Wp,-MD,$(depfile) $(cpp_flags) $(LDPPFLAGS) -ansi \
+   -D__ASSEMBLY__ -x assembler-with-cpp -P -o $@ $
 
 u-boot.lds: $(LDSCRIPT) prepare FORCE
-   $(call if_changed,cpp_lds)
+   $(call if_changed_dep,cpp_lds)
 
 PHONY += nand_spl
 nand_spl: prepare
diff --git a/spl/Makefile b/spl/Makefile
index 9f5dbf4..6fec252 100644
--- a/spl/Makefile
+++ b/spl/Makefile
@@ -231,11 +231,11 @@ $(u-boot-spl-dirs):
$(Q)$(MAKE) $(build)=$@
 
 quiet_cmd_cpp_lds = LDS $@
-cmd_cpp_lds = $(CPP) $(cpp_flags) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ \
-   -x assembler-with-cpp -P -o $@ $
+cmd_cpp_lds = $(CPP) -Wp,-MD,$(depfile) $(cpp_flags) $(LDPPFLAGS) -ansi \
+   -D__ASSEMBLY__ -x assembler-with-cpp -P -o $@ $
 
 $(obj)/u-boot-spl.lds: $(LDSCRIPT) FORCE
-   $(call if_changed,cpp_lds)
+   $(call if_changed_dep,cpp_lds)
 
 # read all saved command lines
 
-- 
1.8.3.2

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


Re: [U-Boot] Bug in buildsystem for SPL LDSCRIPT

2014-04-09 Thread Masahiro Yamada
Hi Andreas,


On Wed, 09 Apr 2014 08:31:53 +0200
Andreas Biesmann andreas.de...@googlemail.com wrote:

 Hi Masahiro,
 
 On 04/09/2014 04:27 AM, Masahiro Yamada wrote:
  On Mon, 07 Apr 2014 11:35:07 +0200
  Andreas Biesmann andreas.de...@googlemail.com wrote:
  
  and also to the list ... sorry for the noise
 
  On 04/07/2014 11:27 AM, Andreas Biesmann wrote:
  Hi Masahiro,
 
  a late bug report ;) changing my board config file will not regenerate
  the spl/u-boot-spl.lds for the board though it depends on it. The
  LDSCRIPT is patched with some size information for range checking which
  is not updated in my case. However regenerating the file by deleting it
  first works. Cold you please provide a fix for that in 2014.04?


Thanks your bug report!

I think
http://patchwork.ozlabs.org/patch/337822/
should fix the problem.


Best Regards
Masahiro Yamada

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


Re: [U-Boot] [PATCH] kbuild: fix a bug in regeneration of linker scripts

2014-04-09 Thread Andreas Bießmann
On 04/09/2014 01:10 PM, Masahiro Yamada wrote:
 In some use cases, SPL linker script was not updated even when
 it should be.
 
 For instance,
 
   $ make tricoder_config all
 [ build complete ]
   ... modify include/configs/tricoder.h
   $ make
 
 spl/u-boot-spl.lds should be updated in this case, but it wasn't.
 
 To fix this problem, linker scripts generation should be handled
 by $(call if_changed_dep,...) rather than by $(call if_changed,...).
 
 Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
 Reported-by: Andreas Bießmann andreas.de...@googlemail.com

Tested-by: Andreas Bießmann andreas.de...@googlemail.com
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Bug in buildsystem for SPL LDSCRIPT

2014-04-09 Thread Andreas Bießmann
Hi Masahiro,

On 04/09/2014 01:13 PM, Masahiro Yamada wrote:
 On Wed, 09 Apr 2014 08:31:53 +0200
 Andreas Biesmann andreas.de...@googlemail.com wrote:
 On 04/09/2014 04:27 AM, Masahiro Yamada wrote:
 On Mon, 07 Apr 2014 11:35:07 +0200
 Andreas Biesmann andreas.de...@googlemail.com wrote:

 and also to the list ... sorry for the noise

 On 04/07/2014 11:27 AM, Andreas Biesmann wrote:
 Hi Masahiro,

 a late bug report ;) changing my board config file will not regenerate
 the spl/u-boot-spl.lds for the board though it depends on it. The
 LDSCRIPT is patched with some size information for range checking which
 is not updated in my case. However regenerating the file by deleting it
 first works. Cold you please provide a fix for that in 2014.04?
 
 
 Thanks your bug report!
 
 I think
 http://patchwork.ozlabs.org/patch/337822/
 should fix the problem.

works like a charm, many thanks!

Best regrads

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


[U-Boot] [BeagleBone Black] AM335x CPU frequency

2014-04-09 Thread Xuebing Wang

Hi community,

Can someone confirm that in the latest u-boot code, by default 
BeagleBone Black CPU AM335x is using opp100 (dpll_mpu_opp100), and CPU 
runs at 1GHz? Thanks.


--
Thanks,
Xuebing Wang

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


[U-Boot] [PATCH] am335x: Switch to CONFIG_SKIP_LOWLEVEL_INIT from guarding SPL or NOR_BOOT

2014-04-09 Thread Tom Rini
In the case of SPL or NOR_BOOT (no SPL involved) we need to include
certain code in the build.  Use !CONFIG_SKIP_LOWLEVEL_INIT rather than
CONFIG_SPL_BUILD || CONFIG_NOR_BOOT to make the code clearer, and to
make supporting XIP QSPI boot clearer in the code.

Signed-off-by: Tom Rini tr...@ti.com
---
 arch/arm/cpu/armv7/am33xx/board.c |4 +---
 arch/arm/cpu/armv7/am33xx/emif4.c |2 +-
 board/silica/pengwyn/Makefile |2 +-
 board/ti/am335x/Makefile  |2 +-
 board/ti/am335x/board.c   |2 +-
 5 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/arch/arm/cpu/armv7/am33xx/board.c 
b/arch/arm/cpu/armv7/am33xx/board.c
index fb44cc8..28c16f8 100644
--- a/arch/arm/cpu/armv7/am33xx/board.c
+++ b/arch/arm/cpu/armv7/am33xx/board.c
@@ -142,7 +142,7 @@ int arch_misc_init(void)
return 0;
 }
 
-#if defined(CONFIG_SPL_BUILD) || defined(CONFIG_NOR_BOOT)
+#ifndef CONFIG_SKIP_LOWLEVEL_INIT
 /*
  * This function is the place to do per-board things such as ramp up the
  * MPU clock frequency.
@@ -200,9 +200,7 @@ static void watchdog_disable(void)
while (readl(wdtimer-wdtwwps) != 0x0)
;
 }
-#endif
 
-#if defined(CONFIG_SPL_BUILD) || defined(CONFIG_NOR_BOOT)
 void s_init(void)
 {
/*
diff --git a/arch/arm/cpu/armv7/am33xx/emif4.c 
b/arch/arm/cpu/armv7/am33xx/emif4.c
index 3e39752..2c67c32 100644
--- a/arch/arm/cpu/armv7/am33xx/emif4.c
+++ b/arch/arm/cpu/armv7/am33xx/emif4.c
@@ -35,7 +35,7 @@ void dram_init_banksize(void)
 }
 
 
-#if defined(CONFIG_SPL_BUILD) || defined(CONFIG_NOR_BOOT)
+#ifndef CONFIG_SKIP_LOWLEVEL_INIT
 #ifdef CONFIG_TI81XX
 static struct dmm_lisa_map_regs *hw_lisa_map_regs =
(struct dmm_lisa_map_regs *)DMM_BASE;
diff --git a/board/silica/pengwyn/Makefile b/board/silica/pengwyn/Makefile
index c8b4f9a..804ac37 100644
--- a/board/silica/pengwyn/Makefile
+++ b/board/silica/pengwyn/Makefile
@@ -6,7 +6,7 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-ifeq ($(CONFIG_SPL_BUILD)$(CONFIG_NOR_BOOT),y)
+ifeq ($(CONFIG_SKIP_LOWLEVEL_INIT),)
 obj-y  := mux.o
 endif
 
diff --git a/board/ti/am335x/Makefile b/board/ti/am335x/Makefile
index c8b4f9a..804ac37 100644
--- a/board/ti/am335x/Makefile
+++ b/board/ti/am335x/Makefile
@@ -6,7 +6,7 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-ifeq ($(CONFIG_SPL_BUILD)$(CONFIG_NOR_BOOT),y)
+ifeq ($(CONFIG_SKIP_LOWLEVEL_INIT),)
 obj-y  := mux.o
 endif
 
diff --git a/board/ti/am335x/board.c b/board/ti/am335x/board.c
index 554398f..fe1d000 100644
--- a/board/ti/am335x/board.c
+++ b/board/ti/am335x/board.c
@@ -81,7 +81,7 @@ static int read_eeprom(struct am335x_baseboard_id *header)
return 0;
 }
 
-#if defined(CONFIG_SPL_BUILD) || defined(CONFIG_NOR_BOOT)
+#ifndef CONFIG_SKIP_LOWLEVEL_INIT
 static const struct ddr_data ddr2_data = {
.datardsratio0 = ((MT47H128M16RT25E_RD_DQS30) |
  (MT47H128M16RT25E_RD_DQS20) |
-- 
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] lib: Add CONFIG_FDT_IGNORE_FIXUP_MEMORY_NODE

2014-04-09 Thread Tom Rini
On Wed, Apr 09, 2014 at 12:20:43PM +0900, Masahiro Yamada wrote:

 Hi Nobuhiro, Tom,
 
 
  diff --git a/arch/arm/lib/bootm-fdt.c b/arch/arm/lib/bootm-fdt.c
  index e40691d..8da9dac 100644
  --- a/arch/arm/lib/bootm-fdt.c
  +++ b/arch/arm/lib/bootm-fdt.c
  @@ -18,6 +18,7 @@
   #include common.h
   #include fdt_support.h
   
  +#ifndef CONFIG_FDT_IGNORE_FIXUP_MEMORY_NODE
   DECLARE_GLOBAL_DATA_PTR;
   
   int arch_fixup_memory_node(void *blob)
  @@ -34,3 +35,4 @@ int arch_fixup_memory_node(void *blob)
   
  return fdt_fixup_memory_banks(blob, start, size, CONFIG_NR_DRAM_BANKS);
   }
  +#endif  /* CONFIG_FDT_IGNORE_FIXUP_MEMORY_NODE */
 
 
 I am not happy about defining CONFIG macro to disable some code.
 
 Please do
 
 #ifdef CONFIG_FDT_FIXUP_MEMORY_NODE
.
 #endif
 
 rather than
 
 #ifndef CONFIG_FDT_IGNORE_FIXUP_MEMORY_NODE
.
 #endif
 
 
 
 We expect most of boards should be fixed-up by U-Boot.
 So, add 
 
  #define CONFIG_FDT_FIXUP_MEMORY_NODE
 
 to include/config_defaults.h
 
 and
 
 #undef  CONFIG_FDT_FIXUP_MEMORY_NODE
 
 only to boards for which you want to skip memory fix-up.

Agreed.

 Basically, we should not use CONFIG macros for negation.
 
 CONFIG_SKIP_LOWLEVEL_INIT, CONFIG_SYS_DCACHE_OFF,
 are examples of bad macros.

Lets hold off on fixing these until we're farther along with the
conversion to Kconfig.  Unless it'll be really problematic not to..
Thanks!

-- 
Tom


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


[U-Boot] [PATCH] arm:board:trats2:FIX: Clear INFORM4 and INFORM5 registers at correct boot

2014-04-09 Thread Lukasz Majewski
During switch to device tree, commit 1ecab0f has removed this code.

INFORM4 and INFORM5 registers are used by TRATS2 first stage bootloader for
providing recovery. For normal operation, those two must be cleared out.

This error emerges when one force reset from u-boot's command line for
three times.

Signed-off-by: Lukasz Majewski l.majew...@samsung.com
Cc: Minkyu Kang mk7.k...@samsung.com
---
 board/samsung/trats2/trats2.c |   13 +
 1 file changed, 13 insertions(+)

diff --git a/board/samsung/trats2/trats2.c b/board/samsung/trats2/trats2.c
index 2a6c9f9..75a6c7b 100644
--- a/board/samsung/trats2/trats2.c
+++ b/board/samsung/trats2/trats2.c
@@ -150,9 +150,22 @@ static int pmic_init_max77686(void);
 
 int exynos_init(void)
 {
+   struct exynos4_power *pwr =
+   (struct exynos4_power *)samsung_get_base_power();
+
check_hw_revision();
printf(HW Revision:\t0x%04x\n, board_rev);
 
+   /*
+* First bootloader on the TRATS2 platform uses
+* INFORM4 and INFORM5 registers for recovery
+*
+* To indicate correct boot chain - those two
+* registers must be cleared out
+*/
+   writel(0, (unsigned int)pwr-inform4);
+   writel(0, (unsigned int)pwr-inform5);
+
return 0;
 }
 
-- 
1.7.10.4

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


[U-Boot] [RFC][PATCH] fdt: Remove fdt_fixup_memory function

2014-04-09 Thread Tom Rini
The fdt_fixup_memory function is only used on PowerPC where we only
claim one memory bank in U-Boot (and then in the device tree) so we can
call a function that just calls fdt_fixup_memory_banks(..., 1).  Call
this directly for consistency with other architectures.

Cc: Jerry Van Baren vanba...@cideas.com
Cc: Wolfgang Denk w...@denx.de
Cc: Stefan Roese s...@denx.de
Signed-off-by: Tom Rini tr...@ti.com
---
 arch/powerpc/cpu/74xx_7xx/cpu.c |2 +-
 arch/powerpc/cpu/mpc512x/cpu.c  |2 +-
 arch/powerpc/cpu/mpc5xxx/cpu.c  |2 +-
 arch/powerpc/cpu/mpc8260/cpu.c  |2 +-
 arch/powerpc/cpu/mpc83xx/fdt.c  |2 +-
 arch/powerpc/cpu/mpc85xx/fdt.c  |2 +-
 arch/powerpc/cpu/mpc86xx/fdt.c  |2 +-
 arch/powerpc/cpu/mpc8xx/fdt.c   |2 +-
 arch/powerpc/cpu/ppc4xx/fdt.c   |2 +-
 arch/powerpc/lib/bootm.c|2 +-
 board/exmeritus/hww1u1a/hww1u1a.c   |2 +-
 board/freescale/b4860qds/b4860qds.c |2 +-
 board/freescale/bsc9131rdb/bsc9131rdb.c |2 +-
 board/freescale/bsc9132qds/bsc9132qds.c |2 +-
 board/freescale/c29xpcie/c29xpcie.c |2 +-
 board/freescale/corenet_ds/corenet_ds.c |2 +-
 board/freescale/mpc7448hpc2/mpc7448hpc2.c   |2 +-
 board/freescale/mpc8572ds/mpc8572ds.c   |2 +-
 board/freescale/p1010rdb/p1010rdb.c |2 +-
 board/freescale/p1022ds/p1022ds.c   |2 +-
 board/freescale/p1023rdb/p1023rdb.c |2 +-
 board/freescale/p1023rds/p1023rds.c |2 +-
 board/freescale/p1_p2_rdb/p1_p2_rdb.c   |2 +-
 board/freescale/p1_p2_rdb_pc/p1_p2_rdb_pc.c |2 +-
 board/freescale/p1_twr/p1_twr.c |2 +-
 board/freescale/p2020come/p2020come.c   |2 +-
 board/freescale/p2020ds/p2020ds.c   |2 +-
 board/freescale/p2041rdb/p2041rdb.c |2 +-
 board/freescale/t1040qds/t1040qds.c |2 +-
 board/freescale/t104xrdb/t104xrdb.c |2 +-
 board/freescale/t208xqds/t208xqds.c |2 +-
 board/freescale/t208xrdb/t208xrdb.c |2 +-
 board/freescale/t4qds/t4240emu.c|2 +-
 board/freescale/t4qds/t4240qds.c|2 +-
 board/gdsys/p1022/controlcenterd.c  |2 +-
 board/keymile/kmp204x/kmp204x.c |2 +-
 common/cmd_fdt.c|2 +-
 common/fdt_support.c|5 -
 include/fdt_support.h   |1 -
 39 files changed, 37 insertions(+), 43 deletions(-)

diff --git a/arch/powerpc/cpu/74xx_7xx/cpu.c b/arch/powerpc/cpu/74xx_7xx/cpu.c
index 6cd54bf..50608cf 100644
--- a/arch/powerpc/cpu/74xx_7xx/cpu.c
+++ b/arch/powerpc/cpu/74xx_7xx/cpu.c
@@ -292,7 +292,7 @@ void ft_cpu_setup(void *blob, bd_t *bd)
do_fixup_by_prop_u32(blob, device_type, cpu, 4,
 clock-frequency, bd-bi_intfreq, 1);
 
-   fdt_fixup_memory(blob, (u64)bd-bi_memstart, (u64)bd-bi_memsize);
+   fdt_fixup_memory_banks(blob, bd-bi_memstart, bd-bi_memsize, 1);
 
fdt_fixup_ethernet(blob);
 }
diff --git a/arch/powerpc/cpu/mpc512x/cpu.c b/arch/powerpc/cpu/mpc512x/cpu.c
index 8508e8d..5041db7 100644
--- a/arch/powerpc/cpu/mpc512x/cpu.c
+++ b/arch/powerpc/cpu/mpc512x/cpu.c
@@ -183,7 +183,7 @@ void ft_cpu_setup(void *blob, bd_t *bd)
 #ifdef CONFIG_HAS_ETH0
fdt_fixup_ethernet(blob);
 #endif
-   fdt_fixup_memory(blob, (u64)bd-bi_memstart, (u64)bd-bi_memsize);
+   fdt_fixup_memory_banks(blob, bd-bi_memstart, bd-bi_memsize, 1);
 }
 #endif
 
diff --git a/arch/powerpc/cpu/mpc5xxx/cpu.c b/arch/powerpc/cpu/mpc5xxx/cpu.c
index 7a463b5..7be7fd8 100644
--- a/arch/powerpc/cpu/mpc5xxx/cpu.c
+++ b/arch/powerpc/cpu/mpc5xxx/cpu.c
@@ -133,7 +133,7 @@ void ft_cpu_setup(void *blob, bd_t *bd)
}
 
 #endif
-   fdt_fixup_memory(blob, (u64)bd-bi_memstart, (u64)bd-bi_memsize);
+   fdt_fixup_memory_banks(blob, bd-bi_memstart, bd-bi_memsize, 1);
 }
 #endif
 
diff --git a/arch/powerpc/cpu/mpc8260/cpu.c b/arch/powerpc/cpu/mpc8260/cpu.c
index 6eed6f5..588699d 100644
--- a/arch/powerpc/cpu/mpc8260/cpu.c
+++ b/arch/powerpc/cpu/mpc8260/cpu.c
@@ -301,7 +301,7 @@ void ft_cpu_setup (void *blob, bd_t *bd)
timebase-frequency, OF_TBCLK, 1);
do_fixup_by_prop_u32(blob, device_type, cpu, 4,
clock-frequency, bd-bi_intfreq, 1);
-   fdt_fixup_memory(blob, (u64)bd-bi_memstart, (u64)bd-bi_memsize);
+   fdt_fixup_memory_banks(blob, bd-bi_memstart, bd-bi_memsize, 1);
 }
 #endif /* CONFIG_OF_LIBFDT */
 
diff --git a/arch/powerpc/cpu/mpc83xx/fdt.c b/arch/powerpc/cpu/mpc83xx/fdt.c
index cce7d6b..346a1b3 100644
--- a/arch/powerpc/cpu/mpc83xx/fdt.c
+++ b/arch/powerpc/cpu/mpc83xx/fdt.c
@@ -122,7 +122,7 @@ void ft_cpu_setup(void *blob, bd_t *bd)
clock-frequency, CONFIG_SYS_NS16550_CLK, 1);
 #endif
 
-   fdt_fixup_memory(blob, (u64)bd-bi_memstart, 

Re: [U-Boot] [PATCH] arm:board:trats2:FIX: Clear INFORM4 and INFORM5 registers at correct boot

2014-04-09 Thread Minkyu Kang
Dear Lukasz Majewski,

On 09/04/14 21:41, Lukasz Majewski wrote:
 During switch to device tree, commit 1ecab0f has removed this code.
 
 INFORM4 and INFORM5 registers are used by TRATS2 first stage bootloader for
 providing recovery. For normal operation, those two must be cleared out.
 
 This error emerges when one force reset from u-boot's command line for
 three times.
 
 Signed-off-by: Lukasz Majewski l.majew...@samsung.com
 Cc: Minkyu Kang mk7.k...@samsung.com
 ---
  board/samsung/trats2/trats2.c |   13 +
  1 file changed, 13 insertions(+)
 
 diff --git a/board/samsung/trats2/trats2.c b/board/samsung/trats2/trats2.c
 index 2a6c9f9..75a6c7b 100644
 --- a/board/samsung/trats2/trats2.c
 +++ b/board/samsung/trats2/trats2.c
 @@ -150,9 +150,22 @@ static int pmic_init_max77686(void);
  
  int exynos_init(void)
  {
 + struct exynos4_power *pwr =
 + (struct exynos4_power *)samsung_get_base_power();
 +
   check_hw_revision();
   printf(HW Revision:\t0x%04x\n, board_rev);
  
 + /*
 +  * First bootloader on the TRATS2 platform uses
 +  * INFORM4 and INFORM5 registers for recovery
 +  *
 +  * To indicate correct boot chain - those two
 +  * registers must be cleared out
 +  */
 + writel(0, (unsigned int)pwr-inform4);
 + writel(0, (unsigned int)pwr-inform5);

I think, you don't have to do type casting.

 +
   return 0;
  }
  
 

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


Re: [U-Boot] [PATCH] arm:board:trats2:FIX: Clear INFORM4 and INFORM5 registers at correct boot

2014-04-09 Thread Lukasz Majewski
Hi Minkyu,

 Dear Lukasz Majewski,
 
 On 09/04/14 21:41, Lukasz Majewski wrote:
  During switch to device tree, commit 1ecab0f has removed this code.
  
  INFORM4 and INFORM5 registers are used by TRATS2 first stage
  bootloader for providing recovery. For normal operation, those two
  must be cleared out.
  
  This error emerges when one force reset from u-boot's command line
  for three times.
  
  Signed-off-by: Lukasz Majewski l.majew...@samsung.com
  Cc: Minkyu Kang mk7.k...@samsung.com
  ---
   board/samsung/trats2/trats2.c |   13 +
   1 file changed, 13 insertions(+)
  
  diff --git a/board/samsung/trats2/trats2.c
  b/board/samsung/trats2/trats2.c index 2a6c9f9..75a6c7b 100644
  --- a/board/samsung/trats2/trats2.c
  +++ b/board/samsung/trats2/trats2.c
  @@ -150,9 +150,22 @@ static int pmic_init_max77686(void);
   
   int exynos_init(void)
   {
  +   struct exynos4_power *pwr =
  +   (struct exynos4_power *)samsung_get_base_power();
  +
  check_hw_revision();
  printf(HW Revision:\t0x%04x\n, board_rev);
   
  +   /*
  +* First bootloader on the TRATS2 platform uses
  +* INFORM4 and INFORM5 registers for recovery
  +*
  +* To indicate correct boot chain - those two
  +* registers must be cleared out
  +*/
  +   writel(0, (unsigned int)pwr-inform4);
  +   writel(0, (unsigned int)pwr-inform5);
 
 I think, you don't have to do type casting.

You are right, thanks for pointing out.

 
  +
  return 0;
   }
   
  
 
 Thanks,
 Minkyu Kang.



-- 
Best regards,

Lukasz Majewski

Samsung RD Institute Poland (SRPOL) | Linux Platform Group
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2] arm:board:trats2:FIX: Clear INFORM4 and INFORM5 registers at correct boot

2014-04-09 Thread Lukasz Majewski
During switch to device tree, commit 1ecab0f has removed this code.

INFORM4 and INFORM5 registers are used by TRATS2 first stage bootloader for
providing recovery. For normal operation, those two must be cleared out.

This error emerges when one force reset from u-boot's command line for
three times.

Signed-off-by: Lukasz Majewski l.majew...@samsung.com
Cc: Minkyu Kang mk7.k...@samsung.com

---
Changes for v2:
- Remove redundant cast
---
 board/samsung/trats2/trats2.c |   13 +
 1 file changed, 13 insertions(+)

diff --git a/board/samsung/trats2/trats2.c b/board/samsung/trats2/trats2.c
index 2a6c9f9..f558ef9 100644
--- a/board/samsung/trats2/trats2.c
+++ b/board/samsung/trats2/trats2.c
@@ -150,9 +150,22 @@ static int pmic_init_max77686(void);
 
 int exynos_init(void)
 {
+   struct exynos4_power *pwr =
+   (struct exynos4_power *)samsung_get_base_power();
+
check_hw_revision();
printf(HW Revision:\t0x%04x\n, board_rev);
 
+   /*
+* First bootloader on the TRATS2 platform uses
+* INFORM4 and INFORM5 registers for recovery
+*
+* To indicate correct boot chain - those two
+* registers must be cleared out
+*/
+   writel(0, pwr-inform4);
+   writel(0, pwr-inform5);
+
return 0;
 }
 
-- 
1.7.10.4

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


Re: [U-Boot] Modify go to allow chain loading a second u-boot

2014-04-09 Thread Helmut Raiger

On 04/08/2014 04:27 AM, Simon Glass wrote:


1) add option to 'go' command, which is hard as it has variable
arguments


This seems best to me if you don't want to add a new command. Maybe 
you could add a '-c' argument to cleanup?


This kind of option is clearly not what other u-boot commands use, I 
could not find a single command
that supports '-' style options. If this had been widely used, I 
wouldn't have asked in the first place.


Thanks anyway, answers are flowing in quite sparsely.

Helmut


--
Scanned by MailScanner.

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


Re: [U-Boot] [BeagleBone Black] AM335x CPU frequency

2014-04-09 Thread Robert Nelson
On Wed, Apr 9, 2014 at 6:59 AM, Xuebing Wang xbi...@gmail.com wrote:
 Hi community,

 Can someone confirm that in the latest u-boot code, by default BeagleBone
 Black CPU AM335x is using opp100 (dpll_mpu_opp100), and CPU runs at 1GHz?
 Thanks.

http://git.denx.de/?p=u-boot.git;a=blob;f=board/ti/am335x/board.c;hb=HEAD#l280

Regards,

-- 
Robert Nelson
http://www.rcn-ee.com/
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Chain loading an u-boot from an u-boot

2014-04-09 Thread Helmut Raiger

On 04/04/2014 11:25 AM, Stefano Babic wrote:

Hi Helmut,

On 04/04/2014 01:13, Simon Glass wrote:


1) add option to 'go' command, which is hard as it has variable arguments
2) add another go command
3) use an environment variable to set the option for 'go'

Theoretically I could use a u-boot image to encapsulate the second u-boot
and use 'bootm', but I think I'll stumble over the same kind of questions.


There is already 'dcache off' but I wonder if something like 'go prepare'
would be useful? Another option is that bootm has a prepare state, but it
requires an image.

I agree with Simon. If you have not changed your target, you are using a
MX31 and what cleanup_linux for arm1136 does is turning off the caches.
What about if you turn off i-cache and d-cache in einem script before
the go command ?

Best regards,
Stefano


Hi Stefano,

cleanup_before_linux() also disables interrupts and flushes the cache(s).
Simply turning off the caches did not do the trick.

Using 'go prepare' would be a solution as the 2nd argument should be an 
address (i.e. numeric) in any case.


Thx,
Helmut


--
Scanned by MailScanner.

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


Re: [U-Boot] [RFC][PATCH] fdt: Remove fdt_fixup_memory function

2014-04-09 Thread Wolfgang Denk
Dear Tom Rini,

In message 1397047800-26221-1-git-send-email-tr...@ti.com you wrote:
 The fdt_fixup_memory function is only used on PowerPC where we only
 claim one memory bank in U-Boot (and then in the device tree) so we can
 call a function that just calls fdt_fixup_memory_banks(..., 1).  Call
 this directly for consistency with other architectures.

I understand what you mean and what you want, but I'm not really
happy about it.

First, the description is not correct.  In my understanding a bank
of memory is some memory device which, on the hardware level, is
addressed using one specific chip select signal.  On PPC, we usually
have flexible memory controllers, so e can always map all existing
memory banks such that they for a single, contiguous region.

It is causing me some creepes to introduce code that claims it is
fixing memory for only one bank - I feel this is wrong.

And is dropping the (u64) not a problem?  bd-bi_memstart is just an
unsigned long, but fdt_fixup_memory_banks() expects a u64 ?

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
All these theories, diverse as they are, have two things  in  common:
they explain the observed facts, and they are completeley and utterly
wrong.   - Terry Pratchett, _The Light Fantastic_
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Modify go to allow chain loading a second u-boot

2014-04-09 Thread Wolfgang Denk
Dear Helmut,

In message 53455133.5010...@hale.at you wrote:

  This seems best to me if you don't want to add a new command. Maybe 
  you could add a '-c' argument to cleanup?
 
 This kind of option is clearly not what other u-boot commands use, I 
 could not find a single command
 that supports '-' style options. If this had been widely used, I 
 wouldn't have asked in the first place.

It seems you did not look very carefully.  Just for example:

= help env
env - environment handling commands

Usage:
env ask name [message] [size] - ask for environment variable
env default [-f] -a - [forcibly] reset default environment
env default [-f] var [...] - [forcibly] reset variable(s) to their default 
values
env delete [-f] var [...] - [forcibly] delete variable(s)
env edit name - edit environment variable
env export [-t | -b | -c] [-s size] addr [var ...] - export environment
env import [-d] [-t | -b | -c] addr [size] - import environment
env print [-a | name ...] - print environment
env run var [...] - run commands in an environment variable
env save - save environment
env set [-f] name [arg ...]


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
What we hope ever to do with ease, we must learn  first  to  do  with
diligence.   - Samuel Johnson
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] data abort in omap_gpio

2014-04-09 Thread Andreas Bießmann
Hi all,

I've encountered a data abort in tricorder board when switching gpio's.

Here is the trace:

---8---
gpio_direction_output (gpio=value optimized out, value=0) at
/home/abiessmann/src/u-boot/drivers/gpio/omap_gpio.c:197
197 _set_gpio_dataout(bank, get_gpio_index(gpio), value);
(gdb) s
_set_gpio_dataout (gpio=value optimized out, value=0) at
/home/abiessmann/src/u-boot/drivers/gpio/omap_gpio.c:102
102 void *reg = bank-base;
(gdb) s
105 switch (bank-method) {
(gdb) s
107 if (enable)
(gdb) list
102 void *reg = bank-base;
103 u32 l = 0;
104 
105 switch (bank-method) {
106 case METHOD_GPIO_24XX:
107 if (enable)
108 reg += OMAP_GPIO_SETDATAOUT;
109 else
110 reg += OMAP_GPIO_CLEARDATAOUT;
111 l = 1  gpio;
(gdb) s
111 l = 1  gpio;
(gdb) s
108 reg += OMAP_GPIO_SETDATAOUT;
(gdb) s
110 reg += OMAP_GPIO_CLEARDATAOUT;
(gdb) s
111 l = 1  gpio;
(gdb) s
118 __raw_writel(l, reg);
(gdb) print/x l
$18 = 0x800
(gdb) print/x reg
$19 = 0x49050090
(gdb) s
^C
Program received signal SIGSTOP, Stopped (signal).
_start () at /home/abiessmann/src/u-boot/arch/arm/cpu/armv7/start.S:27
27  ldr pc, _data_abort
(gdb)
---8---

Anyone aware of that?

I'll dive into that tomorrow. If anyone knows that problem a pointer
would be good.

Best regards

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


[U-Boot] Data abort in omap_gpio

2014-04-09 Thread Andreas Bießmann
Hi all,

I've encountered a data abort in omap_gpio when using
gpio_direction_output(). Anyone aware of that?

Here is the trace:

---8---
gpio_direction_output (gpio=value optimized out, value=0) at
/home/abiessmann/src/u-boot/drivers/gpio/omap_gpio.c:197
197 _set_gpio_dataout(bank, get_gpio_index(gpio), value);
(gdb) s
_set_gpio_dataout (gpio=value optimized out, value=0) at
/home/abiessmann/src/u-boot/drivers/gpio/omap_gpio.c:102
102 void *reg = bank-base;
(gdb) s
105 switch (bank-method) {
(gdb) s
107 if (enable)
(gdb) list
102 void *reg = bank-base;
103 u32 l = 0;
104 
105 switch (bank-method) {
106 case METHOD_GPIO_24XX:
107 if (enable)
108 reg += OMAP_GPIO_SETDATAOUT;
109 else
110 reg += OMAP_GPIO_CLEARDATAOUT;
111 l = 1  gpio;
(gdb) s
111 l = 1  gpio;
(gdb) s
108 reg += OMAP_GPIO_SETDATAOUT;
(gdb) s
110 reg += OMAP_GPIO_CLEARDATAOUT;
(gdb) s
111 l = 1  gpio;
(gdb) s
118 __raw_writel(l, reg);
(gdb) print/s l
$17 = 2048
(gdb) print/x l
$18 = 0x800
(gdb) print/x reg
$19 = 0x49050090
(gdb) s
^C
Program received signal SIGSTOP, Stopped (signal).
_start () at /home/abiessmann/src/u-boot/arch/arm/cpu/armv7/start.S:27
27  ldr pc, _data_abort
(gdb)
---8---

(Encounterd with tricorder board current ToT)

I'll dive into that tomorrow. If anyone has some pointeres, please speak
out loud ;)

Best Regards

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


Re: [U-Boot] Data abort in omap_gpio

2014-04-09 Thread Tom Rini
On Wed, Apr 09, 2014 at 05:22:57PM +0200, Andreas Bießmann wrote:

 Hi all,
 
 I've encountered a data abort in omap_gpio when using
 gpio_direction_output(). Anyone aware of that?
 
 Here is the trace:
 
 ---8---
 gpio_direction_output (gpio=value optimized out, value=0) at
 /home/abiessmann/src/u-boot/drivers/gpio/omap_gpio.c:197
 197   _set_gpio_dataout(bank, get_gpio_index(gpio), value);
 (gdb) s
 _set_gpio_dataout (gpio=value optimized out, value=0) at
 /home/abiessmann/src/u-boot/drivers/gpio/omap_gpio.c:102
 102   void *reg = bank-base;
 (gdb) s
 105   switch (bank-method) {
 (gdb) s
 107   if (enable)
 (gdb) list
 102   void *reg = bank-base;
 103   u32 l = 0;
 104   
 105   switch (bank-method) {
 106   case METHOD_GPIO_24XX:
 107   if (enable)
 108   reg += OMAP_GPIO_SETDATAOUT;
 109   else
 110   reg += OMAP_GPIO_CLEARDATAOUT;
 111   l = 1  gpio;
 (gdb) s
 111   l = 1  gpio;
 (gdb) s
 108   reg += OMAP_GPIO_SETDATAOUT;
 (gdb) s
 110   reg += OMAP_GPIO_CLEARDATAOUT;
 (gdb) s
 111   l = 1  gpio;
 (gdb) s
 118   __raw_writel(l, reg);
 (gdb) print/s l
 $17 = 2048
 (gdb) print/x l
 $18 = 0x800
 (gdb) print/x reg
 $19 = 0x49050090
 (gdb) s
 ^C
 Program received signal SIGSTOP, Stopped (signal).
 _start () at /home/abiessmann/src/u-boot/arch/arm/cpu/armv7/start.S:27
 27ldr pc, _data_abort
 (gdb)
 ---8---
 
 (Encounterd with tricorder board current ToT)
 
 I'll dive into that tomorrow. If anyone has some pointeres, please speak
 out loud ;)

You need to add the relevant CONFIG_OMAP3_GPIO_n define to enable
clocks/etc for the gpios being used.

-- 
Tom


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


Re: [U-Boot] [PATCH 04/11] MX6: add common SPL configuration

2014-04-09 Thread Tim Harvey
On Wed, Apr 9, 2014 at 7:55 AM, Nikita Kiryanov nik...@compulab.co.il wrote:
 Hi Tim,

 On 04/03/2014 09:01 AM, Tim Harvey wrote: Add a common header which can
 hopefully be shared among imx6 SPL users


 Signed-off-by: Tim Harvey thar...@gateworks.com
 ---
   include/configs/imx6_spl.h | 64

 ++

   1 file changed, 64 insertions(+)
   create mode 100644 include/configs/imx6_spl.h

 diff --git a/include/configs/imx6_spl.h b/include/configs/imx6_spl.h
 new file mode 100644
 index 000..f9bdf55
 --- /dev/null
 +++ b/include/configs/imx6_spl.h
 @@ -0,0 +1,64 @@
 +/*
 + * Author: Tim Harvey thar...@gateworks.com
 + *
 + * SPDX-License-Identifier: GPL-2.0+
 + */
 +#ifndef __IMX6_SPL_CONFIG_H
 +#define __IMX6_SPL_CONFIG_H
 +
 +#ifdef CONFIG_SPL
 +
 +#define CONFIG_SPL_FRAMEWORK
 +
 +/*
 + * IMX6 OCRAM (IRAM) is from 0x00907000 to 0x0093


 That's not true for all IMX6 SoCs. On i.MX6 Solo and DualLite it's
 0x00907000 to 0x0091.


 + *  - we start at 0x00908000 so as to leave some room for IVT/DCD
 + *  - recommended stack (from IMX6DQRM Figure 8-3) is at 0x0093FFB8
 + *  - this leaves about 224K for SPL image and stack
 + */
 +#define CONFIG_SPL_LDSCRIPT
 arch/arm/cpu/armv7/mx6/u-boot-spl.lds
 +#define CONFIG_SPL_TEXT_BASE   0x00908000
 +#define CONFIG_SPL_MAX_SIZE(128 * 1024)


 This should be a smaller value if we want this config to apply for
 i.MX6 Solo and DualLite, which have a 68KB OCRAM free area.

Hi Nikita,

Agreed - I just discovered this yesterday. I had tested on an
IMX6DL/SOLO via boot from OTG, but I had not tested those combinations
when booting from flash and indeed they failed.

The 68KB OCRAM free area also assumes that you start at 0x00907000 and
as we start at 0x00908000 to leave room for the IVT+DCD this becomes
65KB



 +#define CONFIG_SPL_START_S_PATHarch/arm/cpu/armv7
 +#define CONFIG_SPL_STACK   0x0093FFB8


 For i.MX6 Solo and DualLite this address should be lower (recommended
 address is 0x0091FFB8).

Agreed



 +#define CONFIG_SPL_LIBCOMMON_SUPPORT
 +#define CONFIG_SPL_LIBGENERIC_SUPPORT
 +#define CONFIG_SPL_SERIAL_SUPPORT
 +#define CONFIG_SPL_I2C_SUPPORT
 +#define CONFIG_SPL_GPIO_SUPPORT
 +
 +/* NAND support */
 +#if defined(CONFIG_SPL_NAND_SUPPORT)
 +#define CONFIG_SPL_NAND_MXS
 +#define CONFIG_SPL_NAND_BASE
 +#define CONFIG_SPL_DMA_SUPPORT
 +#endif



 --
 Regards,
 Nikita.

This presents another challenge for SPL NAND as currently my SPL is
~70K. There is a lot of unnecessary code in the mtd nand layer that
I'm including because that layer includes support for both read and
write (I don't need write for SPL) as well as various NAND types (and
I only need BCH).

I'm not sure yet what the best approach is to resolve that. I can either:
 a) add a lot of ifdef's around functions in
drivers/mtd/nand/{nand_base.c,nand_bbt.c} to remove NAND write and non
BCH support for CONFIG_SPL_BUILD
 b) re-write the necessary functionality (code duplication) into
drivers/mtd/nand/mxs_nand_spl.c

Thanks for the review!

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


Re: [U-Boot] [PATCH 09/11] IMX: add additional function for pinmux using an array

2014-04-09 Thread Tim Harvey
On Wed, Apr 9, 2014 at 7:56 AM, Nikita Kiryanov nik...@compulab.co.il wrote:
 Hi Tim,


 On 04/03/2014 09:01 AM, Tim Harvey wrote:

 Add new function that can take an array of iomux configs, an index, and
 a stride to allow a multi-dimentional array of pinmux values to be used
 to define pinmux values per cpu-type.

 This takes a different approach to previously proposed solutions which
 used
 multiple arrays of pad lists. The goal is to eliminate having these
 multiple
 arrays such as 'mx6q_uart1_pads' and 'mx6dl_uart1_pads' which are almost
 identical copies of each other except for the MX6Q/MX6DL prefix on the
 PAD.


 I like this approach, but I think you should also define the IOMUX,
 SETUP_PAD, and SETUP_PADS macros from patch 10 in this file, as they
 (macros and function) are clearly meant to be used together.


I agree with this. Do the macro names IOMUX, SETUP_PAD, SETUP_PADS make sense?



 Signed-off-by: Tim Harvey thar...@gateworks.com
 ---
   arch/arm/imx-common/iomux-v3.c | 19 +++
   arch/arm/include/asm/imx-common/iomux-v3.h |  5 -
   2 files changed, 19 insertions(+), 5 deletions(-)

 diff --git a/arch/arm/imx-common/iomux-v3.c
 b/arch/arm/imx-common/iomux-v3.c
 index b59b802..d3e1e30 100644
 --- a/arch/arm/imx-common/iomux-v3.c
 +++ b/arch/arm/imx-common/iomux-v3.c
 @@ -46,12 +46,23 @@ void imx_iomux_v3_setup_pad(iomux_v3_cfg_t pad)
   #endif
   }

 -void imx_iomux_v3_setup_multiple_pads(iomux_v3_cfg_t const *pad_list,
 - unsigned count)
 +/* configures a list of pads within an array of lists */
 +void imx_iomux_v3_setup_multiple_pads_array(iomux_v3_cfg_t const
 *pad_list,
 +   unsigned count, unsigned list,
 +   unsigned stride)
   {
 iomux_v3_cfg_t const *p = pad_list;
 int i;

 -   for (i = 0; i  count; i++)
 -   imx_iomux_v3_setup_pad(*p++);
 +   p += list;
 +   for (i = 0; i  count; i++) {
 +   imx_iomux_v3_setup_pad(*p);
 +   p += stride;
 +   }
 +}
 +
 +void imx_iomux_v3_setup_multiple_pads(iomux_v3_cfg_t const *pad_list,
 + unsigned count)
 +{
 +   imx_iomux_v3_setup_multiple_pads_array(pad_list, count, 0, 1);
   }
 diff --git a/arch/arm/include/asm/imx-common/iomux-v3.h
 b/arch/arm/include/asm/imx-common/iomux-v3.h
 index dec11a1..c8cc45b 100644
 --- a/arch/arm/include/asm/imx-common/iomux-v3.h
 +++ b/arch/arm/include/asm/imx-common/iomux-v3.h
 @@ -167,7 +167,10 @@ typedef u64 iomux_v3_cfg_t;
   #define GPIO_PORTF(5  GPIO_PORT_SHIFT)

   void imx_iomux_v3_setup_pad(iomux_v3_cfg_t pad);
 +void imx_iomux_v3_setup_multiple_pads_array(iomux_v3_cfg_t const
 *pad_list,
 +   unsigned count, unsigned list,
 +   unsigned stride);
   void imx_iomux_v3_setup_multiple_pads(iomux_v3_cfg_t const *pad_list,
 -unsigned count);
 + unsigned count);


 The above change is a cleanup and should not be in this patch.


If there appears to be general agreement on this approach, I'll submit
a new 2-patch series just for this patch and pull it out of my overall
series.

Regards,

Tim


   #endif/* __MACH_IOMUX_V3_H__*/



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


Re: [U-Boot] [PATCH 07/11] MX6: use macro building for MX6Q/MX6DL iomux regs

2014-04-09 Thread Tim Harvey
On Wed, Apr 9, 2014 at 7:57 AM, Nikita Kiryanov nik...@compulab.co.il wrote:
 Hi Tim,


 On 04/03/2014 09:01 AM, Tim Harvey wrote:

 This is an attempt at using a macro to allow mx6dl-ddr.h and
 mx6q-ddr.h registers to be used together which is needed for an SPL
 bootloader
 that can run on either CPU's and must configure MMDC iomux dynamically.

 I am trying to come up with a solution similar to Eric's approach with the
 similar issue regarding IMX pinmux but this approach is broken in that
 imximage
 will choke on the cfgtmp file due to the fact that the pre-processor won't
 use the enum's as it did the #defines. I'm looking for some positive
 suggestions here or perhaps someone else can come up with a solution for
 this
 particular issue which I haven't been able to resolve.


 Why can't you just rename the register name #defines without enclosing
 them in an anonymous enum? Then they could coexist and will be usable
 by imximage.

 --
 Regards,
 Nikita.

Nikita,

The cfg files are currently all written to use the IOMUX register
names as MX6_ (no Q vs DL) so that a single cfg file can be used for a
build-time configuration of IMX6Q or IMX6DL. Furthermore, then cfg
files use the pre-processor only, which is why the enums I chose don't
work for non-SPL. For SPL, I need both sets of #defines (here they
could be enums however) so I would have to duplicate all of the
#defines in mx6q_pins.h and mx6dl_pins.h to provide both the MX6_ and
the MX6Q_/MX6DL_ #defines. I'm ok with submitting that duplication if
there is no other way.

Am I missing something completely obvious here? Maybe an example of
what you are thinking would help me understand.

Regards,

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


Re: [U-Boot] [PATCH 06/11] MX6: add struct for sharing data between SPL and uboot

2014-04-09 Thread Nikita Kiryanov

Hi Tim,

On 04/03/2014 09:01 AM, Tim Harvey wrote:

This can be used to pass info between the SPL and u-boot.

Signed-off-by: Tim Harvey thar...@gateworks.com
---
  arch/arm/include/asm/arch-mx6/sys_proto.h | 5 +
  1 file changed, 5 insertions(+)

diff --git a/arch/arm/include/asm/arch-mx6/sys_proto.h 
b/arch/arm/include/asm/arch-mx6/sys_proto.h
index 38851a1..f43e09c 100644
--- a/arch/arm/include/asm/arch-mx6/sys_proto.h
+++ b/arch/arm/include/asm/arch-mx6/sys_proto.h
@@ -39,4 +39,9 @@ int mxs_wait_mask_set(struct mxs_register_32 *reg,
  int mxs_wait_mask_clr(struct mxs_register_32 *reg,
   uint32_t mask,
   unsigned int timeout);
+
+struct mx6_spl_data {
+   uint8_t boot_mode_idx;
+   uint32_tmem_dram_size;
+};
  #endif



While I'm in favor of having some way for SPL to pass data to U-Boot,
I don't think this patch achieves this as long as we don't have a
common mechanism that makes use of this struct. At the very least I
would've expected to see a #define that is shared by SPL and U-Boot
that defines the address for this struct (if we were to use the ventana
implementation).

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


Re: [U-Boot] [PATCH 07/11] MX6: use macro building for MX6Q/MX6DL iomux regs

2014-04-09 Thread Nikita Kiryanov

Hi Tim,

On 04/03/2014 09:01 AM, Tim Harvey wrote:

This is an attempt at using a macro to allow mx6dl-ddr.h and
mx6q-ddr.h registers to be used together which is needed for an SPL bootloader
that can run on either CPU's and must configure MMDC iomux dynamically.

I am trying to come up with a solution similar to Eric's approach with the
similar issue regarding IMX pinmux but this approach is broken in that imximage
will choke on the cfgtmp file due to the fact that the pre-processor won't
use the enum's as it did the #defines. I'm looking for some positive
suggestions here or perhaps someone else can come up with a solution for this
particular issue which I haven't been able to resolve.


Why can't you just rename the register name #defines without enclosing
them in an anonymous enum? Then they could coexist and will be usable
by imximage.

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


Re: [U-Boot] [PATCH 09/11] IMX: add additional function for pinmux using an array

2014-04-09 Thread Nikita Kiryanov

Hi Tim,

On 04/03/2014 09:01 AM, Tim Harvey wrote:

Add new function that can take an array of iomux configs, an index, and
a stride to allow a multi-dimentional array of pinmux values to be used
to define pinmux values per cpu-type.

This takes a different approach to previously proposed solutions which used
multiple arrays of pad lists. The goal is to eliminate having these multiple
arrays such as 'mx6q_uart1_pads' and 'mx6dl_uart1_pads' which are almost
identical copies of each other except for the MX6Q/MX6DL prefix on the PAD.


I like this approach, but I think you should also define the IOMUX,
SETUP_PAD, and SETUP_PADS macros from patch 10 in this file, as they
(macros and function) are clearly meant to be used together.



Signed-off-by: Tim Harvey thar...@gateworks.com
---
  arch/arm/imx-common/iomux-v3.c | 19 +++
  arch/arm/include/asm/imx-common/iomux-v3.h |  5 -
  2 files changed, 19 insertions(+), 5 deletions(-)

diff --git a/arch/arm/imx-common/iomux-v3.c b/arch/arm/imx-common/iomux-v3.c
index b59b802..d3e1e30 100644
--- a/arch/arm/imx-common/iomux-v3.c
+++ b/arch/arm/imx-common/iomux-v3.c
@@ -46,12 +46,23 @@ void imx_iomux_v3_setup_pad(iomux_v3_cfg_t pad)
  #endif
  }

-void imx_iomux_v3_setup_multiple_pads(iomux_v3_cfg_t const *pad_list,
- unsigned count)
+/* configures a list of pads within an array of lists */
+void imx_iomux_v3_setup_multiple_pads_array(iomux_v3_cfg_t const *pad_list,
+   unsigned count, unsigned list,
+   unsigned stride)
  {
iomux_v3_cfg_t const *p = pad_list;
int i;

-   for (i = 0; i  count; i++)
-   imx_iomux_v3_setup_pad(*p++);
+   p += list;
+   for (i = 0; i  count; i++) {
+   imx_iomux_v3_setup_pad(*p);
+   p += stride;
+   }
+}
+
+void imx_iomux_v3_setup_multiple_pads(iomux_v3_cfg_t const *pad_list,
+ unsigned count)
+{
+   imx_iomux_v3_setup_multiple_pads_array(pad_list, count, 0, 1);
  }
diff --git a/arch/arm/include/asm/imx-common/iomux-v3.h 
b/arch/arm/include/asm/imx-common/iomux-v3.h
index dec11a1..c8cc45b 100644
--- a/arch/arm/include/asm/imx-common/iomux-v3.h
+++ b/arch/arm/include/asm/imx-common/iomux-v3.h
@@ -167,7 +167,10 @@ typedef u64 iomux_v3_cfg_t;
  #define GPIO_PORTF(5  GPIO_PORT_SHIFT)

  void imx_iomux_v3_setup_pad(iomux_v3_cfg_t pad);
+void imx_iomux_v3_setup_multiple_pads_array(iomux_v3_cfg_t const *pad_list,
+   unsigned count, unsigned list,
+   unsigned stride);
  void imx_iomux_v3_setup_multiple_pads(iomux_v3_cfg_t const *pad_list,
-unsigned count);
+ unsigned count);


The above change is a cleanup and should not be in this patch.



  #endif/* __MACH_IOMUX_V3_H__*/




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


Re: [U-Boot] [PATCH 03/11] MX6: provide linker script for SPL

2014-04-09 Thread Nikita Kiryanov

Hi Tim,

On 04/03/2014 09:01 AM, Tim Harvey wrote:

Signed-off-by: Tim Harvey thar...@gateworks.com
---
  arch/arm/cpu/armv7/mx6/u-boot-spl.lds | 52 +++
  1 file changed, 52 insertions(+)
  create mode 100644 arch/arm/cpu/armv7/mx6/u-boot-spl.lds



+1

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


Re: [U-Boot] [PATCH 01/11] SPL: NAND: remove CONFIG_SYS_NAND_PAGE_SIZE

2014-04-09 Thread Nikita Kiryanov

Hi Tim,

On 04/03/2014 09:01 AM, Tim Harvey wrote:

We only need to read in the size of struct image_header and thus don't
need to know the page size of the nand device.

Signed-off-by: Tim Harvey thar...@gateworks.com
---
  common/spl/spl_nand.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/spl/spl_nand.c b/common/spl/spl_nand.c
index 9da0218..062461b 100644
--- a/common/spl/spl_nand.c
+++ b/common/spl/spl_nand.c
@@ -76,7 +76,7 @@ void spl_nand_load_image(void)
  #endif
/* Load u-boot */
nand_spl_load_image(CONFIG_SYS_NAND_U_BOOT_OFFS,
-   CONFIG_SYS_NAND_PAGE_SIZE, (void *)header);
+   sizeof(*header), (void *)header);
spl_parse_image_header(header);
nand_spl_load_image(CONFIG_SYS_NAND_U_BOOT_OFFS,
spl_image.size, (void *)spl_image.load_addr);



+1

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


Re: [U-Boot] [PATCH 04/11] MX6: add common SPL configuration

2014-04-09 Thread Nikita Kiryanov

Hi Tim,

On 04/03/2014 09:01 AM, Tim Harvey wrote: Add a common header which can 
hopefully be shared among imx6 SPL users


Signed-off-by: Tim Harvey thar...@gateworks.com
---
  include/configs/imx6_spl.h | 64

++

  1 file changed, 64 insertions(+)
  create mode 100644 include/configs/imx6_spl.h

diff --git a/include/configs/imx6_spl.h b/include/configs/imx6_spl.h
new file mode 100644
index 000..f9bdf55
--- /dev/null
+++ b/include/configs/imx6_spl.h
@@ -0,0 +1,64 @@
+/*
+ * Author: Tim Harvey thar...@gateworks.com
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+#ifndef __IMX6_SPL_CONFIG_H
+#define __IMX6_SPL_CONFIG_H
+
+#ifdef CONFIG_SPL
+
+#define CONFIG_SPL_FRAMEWORK
+
+/*
+ * IMX6 OCRAM (IRAM) is from 0x00907000 to 0x0093


That's not true for all IMX6 SoCs. On i.MX6 Solo and DualLite it's
0x00907000 to 0x0091.


+ *  - we start at 0x00908000 so as to leave some room for IVT/DCD
+ *  - recommended stack (from IMX6DQRM Figure 8-3) is at 0x0093FFB8
+ *  - this leaves about 224K for SPL image and stack
+ */
+#define CONFIG_SPL_LDSCRIPTarch/arm/cpu/armv7/mx6/u-boot-spl.lds
+#define CONFIG_SPL_TEXT_BASE   0x00908000
+#define CONFIG_SPL_MAX_SIZE(128 * 1024)


This should be a smaller value if we want this config to apply for
i.MX6 Solo and DualLite, which have a 68KB OCRAM free area.


+#define CONFIG_SPL_START_S_PATHarch/arm/cpu/armv7
+#define CONFIG_SPL_STACK   0x0093FFB8


For i.MX6 Solo and DualLite this address should be lower (recommended
address is 0x0091FFB8).


+#define CONFIG_SPL_LIBCOMMON_SUPPORT
+#define CONFIG_SPL_LIBGENERIC_SUPPORT
+#define CONFIG_SPL_SERIAL_SUPPORT
+#define CONFIG_SPL_I2C_SUPPORT
+#define CONFIG_SPL_GPIO_SUPPORT
+
+/* NAND support */
+#if defined(CONFIG_SPL_NAND_SUPPORT)
+#define CONFIG_SPL_NAND_MXS
+#define CONFIG_SPL_NAND_BASE
+#define CONFIG_SPL_DMA_SUPPORT
+#endif



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


[U-Boot] How to extract files from U-Boot image file, LZMA-compressed?

2014-04-09 Thread kebjo
How to extract files from U-Boot image file, LZMA-compressed?



--
View this message in context: 
http://u-boot.10912.n7.nabble.com/How-to-extract-files-from-U-Boot-image-file-LZMA-compressed-tp177663.html
Sent from the U-Boot mailing list archive at Nabble.com.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [RFC][PATCH] fdt: Remove fdt_fixup_memory function

2014-04-09 Thread Tom Rini
On Wed, Apr 09, 2014 at 04:26:40PM +0200, Wolfgang Denk wrote:
 Dear Tom Rini,
 
 In message 1397047800-26221-1-git-send-email-tr...@ti.com you wrote:
  The fdt_fixup_memory function is only used on PowerPC where we only
  claim one memory bank in U-Boot (and then in the device tree) so we can
  call a function that just calls fdt_fixup_memory_banks(..., 1).  Call
  this directly for consistency with other architectures.
 
 I understand what you mean and what you want, but I'm not really
 happy about it.

Code or comment wise?

 First, the description is not correct.  In my understanding a bank
 of memory is some memory device which, on the hardware level, is
 addressed using one specific chip select signal.  On PPC, we usually
 have flexible memory controllers, so e can always map all existing
 memory banks such that they for a single, contiguous region.

Right, so we have a mismatch between function name
(fdt_fixup_memory_bank) and function of the node
(Documentation/devicetree/booting-without-of.txt in the kernel is,
sadly, the best description I can find of the memory node bindings).  We
itterate over the number of banks passed in (1 on PowerPC,
CONFIG_NR_DRAM_BANKS on ARM, which is between 1 and 4) and do, as the
binding expects, set the reg property correctly (base, size) for each
bank.  It would be more correct to call this ranges rather than
banks, or perhaps nr_ranges.

 It is causing me some creepes to introduce code that claims it is
 fixing memory for only one bank - I feel this is wrong.
 
 And is dropping the (u64) not a problem?  bd-bi_memstart is just an
 unsigned long, but fdt_fixup_memory_banks() expects a u64 ?

Oops, I don't know how I missed that.  Or rather, what the hell is up
with calling fdt_fixup_memory() in two places on PowerPC?  I just
changed the call in board/freescale/t1040qds/t1040qds.c::ft_board_setup,
which uses phy_addr_t/phy_size_t on getenv_lowmem_... and this is fine, but
arch/powerpc/cpu/mpc85xx/fdt.c::ft_cpu_setup calls bd-bi_mem* and needs
a cast.

-- 
Tom


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


[U-Boot] Add support for SPI NOR on the Freescale MCIMX6SLEVK Board

2014-04-09 Thread Sam Catch
I am trying to add support for the SPI NOR device on the  Freescale
MCIMX6SLEVK Board.  I have created a patch that should enable support
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] Add support for SPI NOR on the Freescale MCIMX6SLEVK Board

2014-04-09 Thread Sam Catch
I am trying to add support for the SPI NOR device on the  Freescale
MCIMX6SLEVK Board.  I have created a patch that should enable support but
the probe command does not find the device.  The process fails during the
ECSPI transfer.

I have tried the following patch to the latest git master of u-boot:

http://pastebin.com/hamK7Ybb
U-Boot Output
= sf probe
SF: Unsupported flash IDs: manuf 00, jedec , ext_jedec 

Failed to initialize SPI flash at 0:27392
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Different Port for TFTP communication

2014-04-09 Thread Nikolay Dimitrov

Sorry for the duplicate answer, I'm reading this list via daily digest.

Kind regards,
Nikolay

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


[U-Boot] [PATCH] serial: nsl16550: add hw flow control support

2014-04-09 Thread Murali Karicheri
keystone serial hw support hw flow control. This patch
enables hw flow control for keystone EVMs as an optional
feature based on CONFIG_SERIAL_HW_FLOW_CONTROL.

Signed-off-by: Murali Karicheri m-kariche...@ti.com
---
 depends on keystone patch series which is on the list.
 README   |4 
 drivers/serial/ns16550.c |6 ++
 include/ns16550.h|1 +
 3 files changed, 11 insertions(+)

diff --git a/README b/README
index 63c2dba..85c0076 100644
--- a/README
+++ b/README
@@ -711,6 +711,10 @@ The following options need to be configured:
boot loader that has already initialized the UART.  Define this
variable to flush the UART at init time.
 
+   CONFIG_SERIAL_HW_FLOW_CONTROL
+
+   Define this variable to enable hw flow control in serial driver.
+   Current user of this option is drivers/serial/nsl16550.c driver
 
 - Console Interface:
Depending on board, define exactly one serial port
diff --git a/drivers/serial/ns16550.c b/drivers/serial/ns16550.c
index 8a13454..f26979d 100644
--- a/drivers/serial/ns16550.c
+++ b/drivers/serial/ns16550.c
@@ -33,6 +33,12 @@
 #if defined(CONFIG_K2HK_EVM)
 #define UART_REG_VAL_PWREMU_MGMT_UART_DISABLE   0
 #define UART_REG_VAL_PWREMU_MGMT_UART_ENABLE ((1  14) | (1  13) | (1  0))
+#undef UART_MCRVAL
+#ifdef CONFIG_SERIAL_HW_FLOW_CONTROL
+#define UART_MCRVAL (UART_MCR_RTS | UART_MCR_AFE)
+#else
+#define UART_MCRVAL (UART_MCR_RTS)
+#endif
 #endif
 
 #ifndef CONFIG_SYS_NS16550_IER
diff --git a/include/ns16550.h b/include/ns16550.h
index 51cb5b4..17f829f 100644
--- a/include/ns16550.h
+++ b/include/ns16550.h
@@ -100,6 +100,7 @@ typedef struct NS16550 *NS16550_t;
 #define UART_MCR_OUT1  0x04/* Out 1 */
 #define UART_MCR_OUT2  0x08/* Out 2 */
 #define UART_MCR_LOOP  0x10/* Enable loopback test mode */
+#define UART_MCR_AFE   0x20/* Enable auto-RTS/CTS */
 
 #define UART_MCR_DMA_EN0x04
 #define UART_MCR_TX_DFR0x08
-- 
1.7.9.5

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


[U-Boot] [RESEND: PATCH] serial: nsl16550: add hw flow control support

2014-04-09 Thread Murali Karicheri
keystone serial hw support hw flow control. This patch
enables hw flow control for keystone EVMs as an optional
feature based on CONFIG_HWFLOW

Signed-off-by: Murali Karicheri m-kariche...@ti.com
---
 Depends on keystone patch series on the u-boot mailing list
 drivers/serial/ns16550.c |6 ++
 include/ns16550.h|1 +
 2 files changed, 7 insertions(+)

diff --git a/drivers/serial/ns16550.c b/drivers/serial/ns16550.c
index 8a13454..e49a053 100644
--- a/drivers/serial/ns16550.c
+++ b/drivers/serial/ns16550.c
@@ -33,6 +33,12 @@
 #if defined(CONFIG_K2HK_EVM)
 #define UART_REG_VAL_PWREMU_MGMT_UART_DISABLE   0
 #define UART_REG_VAL_PWREMU_MGMT_UART_ENABLE ((1  14) | (1  13) | (1  0))
+#undef UART_MCRVAL
+#ifdef CONFIG_HWFLOW
+#define UART_MCRVAL (UART_MCR_RTS | UART_MCR_AFE)
+#else
+#define UART_MCRVAL (UART_MCR_RTS)
+#endif
 #endif
 
 #ifndef CONFIG_SYS_NS16550_IER
diff --git a/include/ns16550.h b/include/ns16550.h
index 51cb5b4..17f829f 100644
--- a/include/ns16550.h
+++ b/include/ns16550.h
@@ -100,6 +100,7 @@ typedef struct NS16550 *NS16550_t;
 #define UART_MCR_OUT1  0x04/* Out 1 */
 #define UART_MCR_OUT2  0x08/* Out 2 */
 #define UART_MCR_LOOP  0x10/* Enable loopback test mode */
+#define UART_MCR_AFE   0x20/* Enable auto-RTS/CTS */
 
 #define UART_MCR_DMA_EN0x04
 #define UART_MCR_TX_DFR0x08
-- 
1.7.9.5

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


[U-Boot] [PATCH] Enable big-endian processors to use EHCI interrupt transfers

2014-04-09 Thread Adrian Cox

Add endian support macros to interrupt transfers in the EHCI driver, to allow
operation on PowerPC.

Signed-off-by: Adrian Cox adr...@humboldt.co.uk
---
 drivers/usb/host/ehci-hcd.c |   50 +--
 1 file changed, 25 insertions(+), 25 deletions(-)

diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index 6017090..a030f2b 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -998,8 +998,8 @@ int usb_lowlevel_init(int index, enum usb_init_type init, 
void **controller)
if (!ehcic[index].periodic_list)
return -ENOMEM;
for (i = 0; i  1024; i++) {
-   ehcic[index].periodic_list[i] = (uint32_t)periodic
-   | QH_LINK_TYPE_QH;
+   ehcic[index].periodic_list[i] = cpu_to_hc32((uint32_t)periodic
+   | QH_LINK_TYPE_QH);
}
 
flush_dcache_range((uint32_t)ehcic[index].periodic_list,
@@ -1089,7 +1089,7 @@ struct int_queue {
struct qTD *tds;
 };
 
-#define NEXT_QH(qh) (struct QH *)((qh)-qh_link  ~0x1f)
+#define NEXT_QH(qh) (struct QH *)(hc32_to_cpu((qh)-qh_link)  ~0x1f)
 
 static int
 enable_periodic(struct ehci_ctrl *ctrl)
@@ -1184,41 +1184,41 @@ create_int_queue(struct usb_device *dev, unsigned long 
pipe, int queuesize,
struct qTD *td = result-tds + i;
void **buf = qh-buffer;
 
-   qh-qh_link = (uint32_t)(qh+1) | QH_LINK_TYPE_QH;
+   qh-qh_link = cpu_to_hc32((uint32_t)(qh+1) | QH_LINK_TYPE_QH);
if (i == queuesize - 1)
-   qh-qh_link = QH_LINK_TERMINATE;
+   qh-qh_link = cpu_to_hc32(QH_LINK_TERMINATE);
 
-   qh-qh_overlay.qt_next = (uint32_t)td;
-   qh-qh_overlay.qt_altnext = QT_NEXT_TERMINATE;
-   qh-qh_endpt1 = (0  28) | /* No NAK reload (ehci 4.9) */
+   qh-qh_overlay.qt_next = cpu_to_hc32((uint32_t)td);
+   qh-qh_overlay.qt_altnext = cpu_to_hc32(QT_NEXT_TERMINATE);
+   qh-qh_endpt1 = cpu_to_hc32((0  28) | /* No NAK reload (ehci 
4.9) */
(usb_maxpacket(dev, pipe)  16) | /* MPS */
(1  14) |
QH_ENDPT1_EPS(ehci_encode_speed(dev-speed)) |
(usb_pipeendpoint(pipe)  8) | /* Endpoint Number */
-   (usb_pipedevice(pipe)  0);
-   qh-qh_endpt2 = (1  30) | /* 1 Tx per mframe */
-   (1  0); /* S-mask: microframe 0 */
+   (usb_pipedevice(pipe)  0));
+   qh-qh_endpt2 = cpu_to_hc32((1  30) | /* 1 Tx per mframe */
+   (1  0)); /* S-mask: microframe 0 */
if (dev-speed == USB_SPEED_LOW ||
dev-speed == USB_SPEED_FULL) {
debug(TT: port: %d, hub address: %d\n,
dev-portnr, dev-parent-devnum);
-   qh-qh_endpt2 |= (dev-portnr  23) |
+   qh-qh_endpt2 |= cpu_to_hc32((dev-portnr  23) |
(dev-parent-devnum  16) |
-   (0x1c  8); /* C-mask: microframes 2-4 */
+   (0x1c  8)); /* C-mask: microframes 2-4 */
}
 
-   td-qt_next = QT_NEXT_TERMINATE;
-   td-qt_altnext = QT_NEXT_TERMINATE;
+   td-qt_next = cpu_to_hc32(QT_NEXT_TERMINATE);
+   td-qt_altnext = cpu_to_hc32(QT_NEXT_TERMINATE);
debug(communication direction is '%s'\n,
  usb_pipein(pipe) ? in : out);
-   td-qt_token = (elementsize  16) |
+   td-qt_token = cpu_to_hc32((elementsize  16) |
((usb_pipein(pipe) ? 1 : 0)  8) | /* IN/OUT token */
-   0x80; /* active */
-   td-qt_buffer[0] = (uint32_t)buffer + i * elementsize;
-   td-qt_buffer[1] = (td-qt_buffer[0] + 0x1000)  ~0xfff;
-   td-qt_buffer[2] = (td-qt_buffer[0] + 0x2000)  ~0xfff;
-   td-qt_buffer[3] = (td-qt_buffer[0] + 0x3000)  ~0xfff;
-   td-qt_buffer[4] = (td-qt_buffer[0] + 0x4000)  ~0xfff;
+   0x80); /* active */
+   td-qt_buffer[0] = cpu_to_hc32((uint32_t)buffer + i * 
elementsize);
+   td-qt_buffer[1] = cpu_to_hc32((td-qt_buffer[0] + 0x1000)  
~0xfff);
+   td-qt_buffer[2] = cpu_to_hc32((td-qt_buffer[0] + 0x2000)  
~0xfff);
+   td-qt_buffer[3] = cpu_to_hc32((td-qt_buffer[0] + 0x3000)  
~0xfff);
+   td-qt_buffer[4] = cpu_to_hc32((td-qt_buffer[0] + 0x4000)  
~0xfff);
 
*buf = buffer + i * elementsize;
}
@@ -1241,7 +1241,7 @@ create_int_queue(struct usb_device *dev, unsigned long 
pipe, int queuesize,
/* hook up to periodic list */
struct QH *list = 

[U-Boot] AP94 u-boot network failure

2014-04-09 Thread donce donce
I have this u-boot code from vizio router
I can successfully compile this for AP94  target
However in u-boot, network doesn't work at all
Network has static IP by default and ping host in console :
Using eth0 device
ping failed: host 192.168.1.1 is not alive
Check mii dump below, I don't see anything wrong
Please help me
Below link to download source
http://www.mediafire.com/download/m53wqcov9v9pxhk/u-boot-1.1.4.zip

0. (1000) -- PHY control register --
  (8000:) 0.15= 0reset
  (4000:) 0.14= 0loopback
  (2040:) 0. 6,13 =   b00speed selection = 10 Mbps
  (1000:1000) 0.12= 1A/N enable
  (0800:) 0.11= 0power-down
  (0400:) 0.10= 0isolate
  (0200:) 0. 9= 0restart A/N
  (0100:) 0. 8= 0duplex = half
  (0080:) 0. 7= 0collision test enable
  (003f:) 0. 5- 0 = 0(reserved)

1. (7949) -- PHY status register --
  (8000:) 1.15= 0100BASE-T4 able
  (4000:4000) 1.14= 1100BASE-X  full duplex able
  (2000:2000) 1.13= 1100BASE-X  half duplex able
  (1000:1000) 1.12= 110 Mbpsfull duplex able
  (0800:0800) 1.11= 110 Mbpshalf duplex able
  (0400:) 1.10= 0100BASE-T2 full duplex able
  (0200:) 1. 9= 0100BASE-T2 half duplex able
  (0100:0100) 1. 8= 1extended status
  (0080:) 1. 7= 0(reserved)
  (0040:0040) 1. 6= 1MF preamble suppression
  (0020:) 1. 5= 0A/N complete
  (0010:) 1. 4= 0remote fault
  (0008:0008) 1. 3= 1A/N able
  (0004:) 1. 2= 0link status
  (0002:) 1. 1= 0jabber detect
  (0001:0001) 1. 0= 1extended capabilities

2. (004d) -- PHY ID 1 register --
  (:004d) 2.15- 0 =77OUI portion

3. (d043) -- PHY ID 2 register --
  (fc00:d000) 3.15-10 =52OUI portion
  (03f0:0040) 3. 9- 4 = 4manufacturer part number
  (000f:0003) 3. 3- 0 = 3manufacturer rev. number

4. (01e1) -- Autonegotiation advertisement register --
  (8000:) 4.15= 0next page able
  (4000:) 4.14= 0reserved
  (2000:) 4.13= 0remote fault
  (1000:) 4.12= 0reserved
  (0800:) 4.11= 0asymmetric pause
  (0400:) 4.10= 0pause enable
  (0200:) 4. 9= 0100BASE-T4 able
  (0100:0100) 4. 8= 1100BASE-TX full duplex able
  (0080:0080) 4. 7= 1100BASE-TX able
  (0040:0040) 4. 6= 110BASE-T   full duplex able
  (0020:0020) 4. 5= 110BASE-T   able
  (001f:0001) 4. 4- 0 = 1selector = IEEE 802.3

5. () -- Autonegotiation partner abilities register
--
  (8000:) 5.15= 0next page able
  (4000:) 5.14= 0acknowledge
  (2000:) 5.13= 0remote fault
  (1000:) 5.12= 0(reserved)
  (0800:) 5.11= 0asymmetric pause able
  (0400:) 5.10= 0pause able
  (0200:) 5. 9= 0100BASE-T4 able
  (0100:) 5. 8= 0100BASE-X full duplex able
  (0080:) 5. 7= 0100BASE-TX able
  (0040:) 5. 6= 010BASE-T full duplex able
  (0020:) 5. 5= 010BASE-T able
  (001f:) 5. 4- 0 = 0selector = ???
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] Enable big-endian processors to use EHCI interrupt transfers

2014-04-09 Thread Adrian Cox

Add endian support macros to interrupt transfers in the EHCI driver, to allow
operation on PowerPC.

Signed-off-by: Adrian Cox adr...@humboldt.co.uk
---
 drivers/usb/host/ehci-hcd.c |   50 +--
 1 file changed, 25 insertions(+), 25 deletions(-)

diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index 6017090..a030f2b 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -998,8 +998,8 @@ int usb_lowlevel_init(int index, enum usb_init_type init, 
void **controller)
if (!ehcic[index].periodic_list)
return -ENOMEM;
for (i = 0; i  1024; i++) {
-   ehcic[index].periodic_list[i] = (uint32_t)periodic
-   | QH_LINK_TYPE_QH;
+   ehcic[index].periodic_list[i] = cpu_to_hc32((uint32_t)periodic
+   | QH_LINK_TYPE_QH);
}
 
flush_dcache_range((uint32_t)ehcic[index].periodic_list,
@@ -1089,7 +1089,7 @@ struct int_queue {
struct qTD *tds;
 };
 
-#define NEXT_QH(qh) (struct QH *)((qh)-qh_link  ~0x1f)
+#define NEXT_QH(qh) (struct QH *)(hc32_to_cpu((qh)-qh_link)  ~0x1f)
 
 static int
 enable_periodic(struct ehci_ctrl *ctrl)
@@ -1184,41 +1184,41 @@ create_int_queue(struct usb_device *dev, unsigned long 
pipe, int queuesize,
struct qTD *td = result-tds + i;
void **buf = qh-buffer;
 
-   qh-qh_link = (uint32_t)(qh+1) | QH_LINK_TYPE_QH;
+   qh-qh_link = cpu_to_hc32((uint32_t)(qh+1) | QH_LINK_TYPE_QH);
if (i == queuesize - 1)
-   qh-qh_link = QH_LINK_TERMINATE;
+   qh-qh_link = cpu_to_hc32(QH_LINK_TERMINATE);
 
-   qh-qh_overlay.qt_next = (uint32_t)td;
-   qh-qh_overlay.qt_altnext = QT_NEXT_TERMINATE;
-   qh-qh_endpt1 = (0  28) | /* No NAK reload (ehci 4.9) */
+   qh-qh_overlay.qt_next = cpu_to_hc32((uint32_t)td);
+   qh-qh_overlay.qt_altnext = cpu_to_hc32(QT_NEXT_TERMINATE);
+   qh-qh_endpt1 = cpu_to_hc32((0  28) | /* No NAK reload (ehci 
4.9) */
(usb_maxpacket(dev, pipe)  16) | /* MPS */
(1  14) |
QH_ENDPT1_EPS(ehci_encode_speed(dev-speed)) |
(usb_pipeendpoint(pipe)  8) | /* Endpoint Number */
-   (usb_pipedevice(pipe)  0);
-   qh-qh_endpt2 = (1  30) | /* 1 Tx per mframe */
-   (1  0); /* S-mask: microframe 0 */
+   (usb_pipedevice(pipe)  0));
+   qh-qh_endpt2 = cpu_to_hc32((1  30) | /* 1 Tx per mframe */
+   (1  0)); /* S-mask: microframe 0 */
if (dev-speed == USB_SPEED_LOW ||
dev-speed == USB_SPEED_FULL) {
debug(TT: port: %d, hub address: %d\n,
dev-portnr, dev-parent-devnum);
-   qh-qh_endpt2 |= (dev-portnr  23) |
+   qh-qh_endpt2 |= cpu_to_hc32((dev-portnr  23) |
(dev-parent-devnum  16) |
-   (0x1c  8); /* C-mask: microframes 2-4 */
+   (0x1c  8)); /* C-mask: microframes 2-4 */
}
 
-   td-qt_next = QT_NEXT_TERMINATE;
-   td-qt_altnext = QT_NEXT_TERMINATE;
+   td-qt_next = cpu_to_hc32(QT_NEXT_TERMINATE);
+   td-qt_altnext = cpu_to_hc32(QT_NEXT_TERMINATE);
debug(communication direction is '%s'\n,
  usb_pipein(pipe) ? in : out);
-   td-qt_token = (elementsize  16) |
+   td-qt_token = cpu_to_hc32((elementsize  16) |
((usb_pipein(pipe) ? 1 : 0)  8) | /* IN/OUT token */
-   0x80; /* active */
-   td-qt_buffer[0] = (uint32_t)buffer + i * elementsize;
-   td-qt_buffer[1] = (td-qt_buffer[0] + 0x1000)  ~0xfff;
-   td-qt_buffer[2] = (td-qt_buffer[0] + 0x2000)  ~0xfff;
-   td-qt_buffer[3] = (td-qt_buffer[0] + 0x3000)  ~0xfff;
-   td-qt_buffer[4] = (td-qt_buffer[0] + 0x4000)  ~0xfff;
+   0x80); /* active */
+   td-qt_buffer[0] = cpu_to_hc32((uint32_t)buffer + i * 
elementsize);
+   td-qt_buffer[1] = cpu_to_hc32((td-qt_buffer[0] + 0x1000)  
~0xfff);
+   td-qt_buffer[2] = cpu_to_hc32((td-qt_buffer[0] + 0x2000)  
~0xfff);
+   td-qt_buffer[3] = cpu_to_hc32((td-qt_buffer[0] + 0x3000)  
~0xfff);
+   td-qt_buffer[4] = cpu_to_hc32((td-qt_buffer[0] + 0x4000)  
~0xfff);
 
*buf = buffer + i * elementsize;
}
@@ -1241,7 +1241,7 @@ create_int_queue(struct usb_device *dev, unsigned long 
pipe, int queuesize,
/* hook up to periodic list */
struct QH *list = 

Re: [U-Boot] [PATCH] Enable big-endian processors to use EHCI interrupt transfers

2014-04-09 Thread Marek Vasut
On Wednesday, April 09, 2014 at 11:03:50 PM, Adrian Cox wrote:
 Add endian support macros to interrupt transfers in the EHCI driver, to
 allow operation on PowerPC.
 
 Signed-off-by: Adrian Cox adr...@humboldt.co.uk

Why did I just get this email twice please?

btw Adrian, sorry for my slow replies this week. I'll process the ML stuff 
during the weekend as I am really busy this week.

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


[U-Boot] How can I save U-Boot env vars to HUSH shell vars.

2014-04-09 Thread James Chargin
I'd like to store the values of environment variables in HUSH shell 
variables and then restore them later. My ultimate goal is to preserve a 
few environment variables through a env default -f.


I'm working with U-Boot 2010.12. Changing to a newer version is not 
possible at this time.


I realize this is a very old U-Boot. I'm hoping that the relevant parts 
of U-Boot have not changed between that old version and versions you 
might provide help for.


I tried a few things and haven't found the right combination. I think 
the following commands demonstrate my problem.


Given the U-Boot commands

= setenv e e ethaddr ipaddr rootpath
=
= printenv e ethaddr ipaddr rootpath
e=e ethaddr ipaddr rootpath
ethaddr=00:00:17:88:09:36
ipaddr=10.3.134.80
rootpath=/home/anyuser/a/device/tr/rootfs
=
= for i in $e; do v_$i=$i; done
=

What I get:

= showvar
HUSH_VERSION=0.01
v_e=e
v_ethaddr=ethaddr
v_ipaddr=ipaddr
v_rootpath=rootpath
=

What I want:

= showvar
HUSH_VERSION=0.01
v_e=e ethaddr ipaddr rootpath
v_ethaddr=00:00:17:88:09:36
v_ipaddr=10.3.134.80
v_rootpath=/home/anyuser/a/device/tr/rootfs
=

So, how do I re-write the for loop to get the desired results

Thanks for any help,
Jim

--
Jim Chargin
AJA Video Systems   j...@aja.com
(530) 271-3334  http://www.aja.com
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [RFC][PATCH] fdt: Remove fdt_fixup_memory function

2014-04-09 Thread Wolfgang Denk
Dear Tom,

In message 20140409182426.GV23803@bill-the-cat you wrote:
 
  I understand what you mean and what you want, but I'm not really
  happy about it.
 
 Code or comment wise?

Both...

 Right, so we have a mismatch between function name
 (fdt_fixup_memory_bank) and function of the node
 (Documentation/devicetree/booting-without-of.txt in the kernel is,
 sadly, the best description I can find of the memory node bindings).  We
 itterate over the number of banks passed in (1 on PowerPC,
 CONFIG_NR_DRAM_BANKS on ARM, which is between 1 and 4) and do, as the

If I u nderstand correctly, CONFIG_NR_DRAM_BANKS gives only the
maximum possible number of banks.  On the actual system less banks may
be present.

 binding expects, set the reg property correctly (base, size) for each
 bank.  It would be more correct to call this ranges rather than
 banks, or perhaps nr_ranges.

Yes, ture.  But then, AFAICT ARM has never made such clear definition
of terms, and for the tyical ARM memory controllers range and bank
are actually synonyms, so this never bothered anybody.

  And is dropping the (u64) not a problem?  bd-bi_memstart is just an
  unsigned long, but fdt_fixup_memory_banks() expects a u64 ?
 
 Oops, I don't know how I missed that.  Or rather, what the hell is up
 with calling fdt_fixup_memory() in two places on PowerPC?  I just
 changed the call in board/freescale/t1040qds/t1040qds.c::ft_board_setup,
 which uses phy_addr_t/phy_size_t on getenv_lowmem_... and this is fine, but
 arch/powerpc/cpu/mpc85xx/fdt.c::ft_cpu_setup calls bd-bi_mem* and needs
 a cast.

This should probably best be answered by the MPC85xx experts...

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 common sense to take a method and try it. If it fails, admit it
frankly and try another. But above all, try something.
  - Franklin D. Roosevelt
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] How can I save U-Boot env vars to HUSH shell vars.

2014-04-09 Thread Wolfgang Denk
Dear James,

In message 5345b6ec.6050...@gmail.com you wrote:
 I'd like to store the values of environment variables in HUSH shell 
 variables and then restore them later. My ultimate goal is to preserve a 
 few environment variables through a env default -f.

It is probably easier to use env export to store this set of
variables to some area in memory.  You could even make this permanent
by writing it to flash or some storage device.

 I'm working with U-Boot 2010.12. Changing to a newer version is not 
 possible at this time.

Heh.  As soon as you have to change _any_ code, you can as well
upgrade.

 I realize this is a very old U-Boot. I'm hoping that the relevant parts 
 of U-Boot have not changed between that old version and versions you 
 might provide help for.

Well, a ton of bug fixes and improvements have been added since.  One
of the extensions you want and which has been added only after
v2010.12 is the capability to export only a sub-set of the environment
(i. e. a list of variables passed on the command line).

 = for i in $e; do v_$i=$i; done
...
 What I get:

...is exactly what you coded.  You would get the same in any other
shell, too.

 = showvar
 HUSH_VERSION=0.01
 v_e=e ethaddr ipaddr rootpath
 v_ethaddr=00:00:17:88:09:36
 v_ipaddr=10.3.134.80
 v_rootpath=/home/anyuser/a/device/tr/rootfs
 =
 
 So, how do I re-write the for loop to get the desired results

This would require an eval or command substitution, which we do not
have in our implementation of the hush shell.

To me it seems the easiest way to get what you want is to use
env export ... ethaddr ipaddr rootpath or similar.

Um... yes, this requires an update to more recent code.

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
Of course there's no reason for it, it's just our policy.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [RFC PATCH] MIPS: incaip: move board specific code out of generic code

2014-04-09 Thread Daniel Schwierzeck
Dear Wolfgang,

2014-04-08 21:56 GMT+02:00 Daniel Schwierzeck daniel.schwierz...@gmail.com:
 2014-04-08 21:39 GMT+02:00 Wolfgang Denk w...@denx.de:
 Dear Daniel,

 In message 1396908893-12011-1-git-send-email-daniel.schwierz...@gmail.com 
 you wrote:
 This is required to switch MIPS platform to generic board.

 Cc: Wolfgang Denk w...@denx.de
 Signed-off-by: Daniel Schwierzeck daniel.schwierz...@gmail.com
 ---
 Wolfgang, I would rather remove this board. It is obviously dead and no one 
 ever
 cared about it since you have added it. The code does not conform to current
 coding style. Also it needs a lot of cleanup if we switch to driver model
 eventually.

 I agree that it nakes no sense to put endless efforts on this ancient
 piece of dead hardware.  I'll be happy if you can provide a removal
 patch.  Alternatively, I can do one, but it will take a while until I
 find time to do so.


 ok I will prepare a patch during the next merge window, thanks.

Still one question. You respectively DENX generate and provide a DULG
for INCA-IP [1]. Does it serve as reference for the MIPS ELDK? When
yes may I suggest to replace it with Malta board? Malta is the only
platform which is concurrently supported in mainline kernel and U-Boot
and it is also supported by Qemu.

[1] http://www.denx.de/wiki/view/DULG/Manual?stickboard=incaip

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


Re: [U-Boot] [RFC][PATCH] fdt: Remove fdt_fixup_memory function

2014-04-09 Thread Tom Rini
On Wed, Apr 09, 2014 at 11:39:10PM +0200, Wolfgang Denk wrote:
 Dear Tom,
 
 In message 20140409182426.GV23803@bill-the-cat you wrote:
  
   I understand what you mean and what you want, but I'm not really
   happy about it.
  
  Code or comment wise?
 
 Both...

OK, concept wise?

  Right, so we have a mismatch between function name
  (fdt_fixup_memory_bank) and function of the node
  (Documentation/devicetree/booting-without-of.txt in the kernel is,
  sadly, the best description I can find of the memory node bindings).  We
  itterate over the number of banks passed in (1 on PowerPC,
  CONFIG_NR_DRAM_BANKS on ARM, which is between 1 and 4) and do, as the
 
 If I u nderstand correctly, CONFIG_NR_DRAM_BANKS gives only the
 maximum possible number of banks.  On the actual system less banks may
 be present.

If I recall correctly, when we have less populated banks than
CONFIG_NR_DRAM_BANKS we set size to 0, but I'll have to double check the
omap3 sdrc and emif code.

  binding expects, set the reg property correctly (base, size) for each
  bank.  It would be more correct to call this ranges rather than
  banks, or perhaps nr_ranges.
 
 Yes, ture.  But then, AFAICT ARM has never made such clear definition
 of terms, and for the tyical ARM memory controllers range and bank
 are actually synonyms, so this never bothered anybody.

Well, the binding means range not bank.  The usage of
CONFIG_NR_DRAM_BANKS within U-Boot is used to check for actual banks.
I'm not aware off-hand, but it's not impossible that we have
discontiguous DRAM chunks.  I know on omap3 we make sure to map them
contiguously.

The high level point here is to get things to the point of having a
single call we use for setting the /memory node for the kernel so that
we can then easily enough change things so that this depends on
CONFIG_something_or_another so that cases where we know we don't want to
modify the /memory node (it contains more memory than we can probe or
discontiguous ranges that again, we can't probe), we don't.

-- 
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] How can I save U-Boot env vars to HUSH shell vars.

2014-04-09 Thread James Chargin

Dear Wolfgang,

Thank you for your reply.

On 04/09/2014 02:50 PM, Wolfgang Denk wrote:

Dear James,

In message 5345b6ec.6050...@gmail.com you wrote:

I'd like to store the values of environment variables in HUSH shell
variables and then restore them later. My ultimate goal is to preserve a
few environment variables through a env default -f.


It is probably easier to use env export to store this set of
variables to some area in memory.  You could even make this permanent
by writing it to flash or some storage device.


I hadn't thought of exporting the environment to memory, excellent idea.




I'm working with U-Boot 2010.12. Changing to a newer version is not
possible at this time.


Heh.  As soon as you have to change _any_ code, you can as well
upgrade.


I was hoping (in vain perhaps) to do my work modifying only the environment.




I realize this is a very old U-Boot. I'm hoping that the relevant parts
of U-Boot have not changed between that old version and versions you
might provide help for.


Well, a ton of bug fixes and improvements have been added since.  One
of the extensions you want and which has been added only after
v2010.12 is the capability to export only a sub-set of the environment
(i. e. a list of variables passed on the command line).



This is a definite drawback to having an old U-Boot; I'm sure I would 
benefit from the bug fixes and other enhancements.


Exporting a list of values sounds like a nice addition that would be 
helpful to me.



= for i in $e; do v_$i=$i; done

...

What I get:


...is exactly what you coded.  You would get the same in any other
shell, too.


= showvar
HUSH_VERSION=0.01
v_e=e ethaddr ipaddr rootpath
v_ethaddr=00:00:17:88:09:36
v_ipaddr=10.3.134.80
v_rootpath=/home/anyuser/a/device/tr/rootfs
=

So, how do I re-write the for loop to get the desired results


This would require an eval or command substitution, which we do not
have in our implementation of the hush shell.



eval seemed to me also to be what I wanted. I'm aware it isn't present 
in hush, but I was hoping for some magic from the community. :-)



To me it seems the easiest way to get what you want is to use
env export ... ethaddr ipaddr rootpath or similar.



I suppose, with my 2010.12, I could export everything to memory and then 
parse through it to find the values I need then import them. Sounds 
vaguely possible but it's probably more complex than doing the U-Boot 
upgrade.



Um... yes, this requires an update to more recent code.


Yes, update is on my to-do list, but schedules dictate that the upgrade 
is not my first priority. The conclusion reached here adds to the 
argument for doing it sooner rather than later.




Best regards,

Wolfgang Denk



Thank you again for you comments.
Jim
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Modify go to allow chain loading a second u-boot

2014-04-09 Thread Rob Herring
On Thu, Apr 3, 2014 at 4:40 AM, Helmut Raiger helmut.rai...@hale.at wrote:
 Hi,

   for all the wrong reasons I have to load a second u-boot from a first one.

FYI, I can do this without problems on highbank. It's certainly useful
for development.

 I'm finally able to start it, but it only works if I do a
 cleanup_before_linux(),
 i.e. turn off interrupts and caches before the actual 'go'.

Most platforms (at least on ARM) don't enable interrupts, so your
problem is probably the cache. Loaded data (2nd u-boot) goes into the
d-cache and needs to be flushed to be in sync with the i-cache on
Harvard architecture processors. It works for me since the d-cache is
not enabled in u-boot on highbank (and all the init code is safe to
run twice).

 For testing I patched the go command, but obviously this can't be
 contributed as such.

 Anyone having a suggestion on how to do this?

The go command should have a defined state with respect to caches as
to how programs are entered. Loading code and jumping to it without
any cache maintenance is simply broken. Fix the go command. If an
architecture does not need a cache flush, then it should simply be a
nop.

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


Re: [U-Boot] [PATCH] trats2: config: fix: Set default console to ttySAC2

2014-04-09 Thread Minkyu Kang
On 09/04/14 17:44, Lukasz Majewski wrote:
 During providing device tree support for Exynos4 based boards,
 a tiny mistake has creeped in the 1ecab0f commit.
 
 This commit restores proper setting of default console for the
 trats2 board.
 
 Signed-off-by: Lukasz Majewski l.majew...@samsung.com
 Cc: Minkyu Kang mk7.k...@samsung.com
 ---
  include/configs/trats2.h |2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/include/configs/trats2.h b/include/configs/trats2.h
 index aee9ee2..0760309 100644
 --- a/include/configs/trats2.h
 +++ b/include/configs/trats2.h
 @@ -53,7 +53,7 @@
  
  #define CONFIG_BOOTARGS  Please use defined boot
  #define CONFIG_BOOTCOMMAND   run mmcboot
 -#define CONFIG_DEFAULT_CONSOLE   console=ttySAC1,115200n8\0
 +#define CONFIG_DEFAULT_CONSOLE   console=ttySAC2,115200n8\0
  
  #define CONFIG_SYS_INIT_SP_ADDR  (CONFIG_SYS_LOAD_ADDR \
   - GENERATED_GBL_DATA_SIZE)
 

Acked-by: Minkyu Kang mk7.k...@samsung.com

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


Re: [U-Boot] [PATCH] trats: config: fix: Set default console to ttySAC2

2014-04-09 Thread Minkyu Kang
On 09/04/14 17:44, Lukasz Majewski wrote:
 During providing device tree support for Exynos4 based boards,
 a tiny mistake has creeped in the fe60164 commit.
 
 This commit restores proper setting of default console for the
 trats board.
 
 Signed-off-by: Lukasz Majewski l.majew...@samsung.com
 Cc: Minkyu Kang mk7.k...@samsung.com
 ---
  include/configs/trats.h |2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/include/configs/trats.h b/include/configs/trats.h
 index bf2c869..1d81a29 100644
 --- a/include/configs/trats.h
 +++ b/include/configs/trats.h
 @@ -60,7 +60,7 @@
  
  #define CONFIG_BOOTARGS  Please use defined boot
  #define CONFIG_BOOTCOMMAND   run mmcboot
 -#define CONFIG_DEFAULT_CONSOLE   console=ttySAC1,115200n8\0
 +#define CONFIG_DEFAULT_CONSOLE   console=ttySAC2,115200n8\0
  
  #define CONFIG_SYS_INIT_SP_ADDR  (CONFIG_SYS_LOAD_ADDR \
   - GENERATED_GBL_DATA_SIZE)
 

Acked-by: Minkyu Kang mk7.k...@samsung.com

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


Re: [U-Boot] [PATCH v2] arm:board:trats2:FIX: Clear INFORM4 and INFORM5 registers at correct boot

2014-04-09 Thread Minkyu Kang
On 09/04/14 22:09, Lukasz Majewski wrote:
 During switch to device tree, commit 1ecab0f has removed this code.
 
 INFORM4 and INFORM5 registers are used by TRATS2 first stage bootloader for
 providing recovery. For normal operation, those two must be cleared out.
 
 This error emerges when one force reset from u-boot's command line for
 three times.
 
 Signed-off-by: Lukasz Majewski l.majew...@samsung.com
 Cc: Minkyu Kang mk7.k...@samsung.com
 
 ---
 Changes for v2:
 - Remove redundant cast
 ---
  board/samsung/trats2/trats2.c |   13 +
  1 file changed, 13 insertions(+)
 
 diff --git a/board/samsung/trats2/trats2.c b/board/samsung/trats2/trats2.c
 index 2a6c9f9..f558ef9 100644
 --- a/board/samsung/trats2/trats2.c
 +++ b/board/samsung/trats2/trats2.c
 @@ -150,9 +150,22 @@ static int pmic_init_max77686(void);
  
  int exynos_init(void)
  {
 + struct exynos4_power *pwr =
 + (struct exynos4_power *)samsung_get_base_power();
 +
   check_hw_revision();
   printf(HW Revision:\t0x%04x\n, board_rev);
  
 + /*
 +  * First bootloader on the TRATS2 platform uses
 +  * INFORM4 and INFORM5 registers for recovery
 +  *
 +  * To indicate correct boot chain - those two
 +  * registers must be cleared out
 +  */
 + writel(0, pwr-inform4);
 + writel(0, pwr-inform5);
 +
   return 0;
  }
  
 

Acked-by: Minkyu Kang mk7.k...@samsung.com

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


Re: [U-Boot] [PATCH] buildman: make output dir configurable

2014-04-09 Thread Simon Glass
Hi Daniel,

On 8 April 2014 12:52, Daniel Schwierzeck daniel.schwierz...@gmail.comwrote:

 2014-04-08 21:35 GMT+02:00 Simon Glass s...@chromium.org:
  Hi Daniel,
 
  On 28 March 2014 14:46, Daniel Schwierzeck daniel.schwierz...@gmail.com
 
  wrote:
 
  Add an option to specify the output directory to override the
  default path '../'. This is useful for building in a ramdisk.
 
  Signed-off-by: Daniel Schwierzeck daniel.schwierz...@gmail.com
  Cc: Simon Glass s...@chromium.org
  ---
   tools/buildman/buildman.py | 2 ++
   tools/buildman/control.py  | 2 +-
   2 files changed, 3 insertions(+), 1 deletion(-)
 
  diff --git a/tools/buildman/buildman.py b/tools/buildman/buildman.py
  index 8822efe..0d95246 100755
  --- a/tools/buildman/buildman.py
  +++ b/tools/buildman/buildman.py
  @@ -101,6 +101,8 @@ parser.add_option('-T', '--threads', type='int',
  default=None, help='Number of builder threads to use')
   parser.add_option('-u', '--show_unknown', action='store_true',
  default=False, help='Show boards with unknown build result')
  +parser.add_option('-o', '--output-dir', type='string',
  +   dest='output_dir', default='..', help='Output directory')
 
 
  Can you expand the help here a bit? This is the directory where all the
  builds happen, with a separate sub-directory for each commit. It also
 holds
  the working directory (.bm-work). So maybe 'Build output directory, also
  used for working space' ?
 

 sure. How about that?

   -o OUTPUT_DIR, --output-dir=OUTPUT_DIR
 Directory where all builds happen and buildman has
 its
 workspace (default is ../)


SGTM

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


[U-Boot] [PATCH] Powerpc/mpc8536DS: Increase SPI/SD uboot Image size to 768K

2014-04-09 Thread Haijun Zhang
u-boot binary size for Freescale mpc8536DS platforms is 512KB.
This has been reached to upper limit of the platforms and causig
linker error. So increase the u-boot binary size to 768KB.

Signed-off-by: Haijun Zhang haijun.zh...@freescale.com
---
 include/configs/MPC8536DS.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/configs/MPC8536DS.h b/include/configs/MPC8536DS.h
index aec201a..a98ae5b 100644
--- a/include/configs/MPC8536DS.h
+++ b/include/configs/MPC8536DS.h
@@ -31,13 +31,13 @@
 
 #ifdef CONFIG_SDCARD
 #define CONFIG_RAMBOOT_SDCARD  1
-#define CONFIG_SYS_TEXT_BASE   0xf8f8
+#define CONFIG_SYS_TEXT_BASE   0xf8f4
 #define CONFIG_RESET_VECTOR_ADDRESS0xf8fc
 #endif
 
 #ifdef CONFIG_SPIFLASH
 #define CONFIG_RAMBOOT_SPIFLASH1
-#define CONFIG_SYS_TEXT_BASE   0xf8f8
+#define CONFIG_SYS_TEXT_BASE   0xf8f4
 #define CONFIG_RESET_VECTOR_ADDRESS0xf8fc
 #endif
 
-- 
1.8.5


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


[U-Boot] [PATCH 2/2] dfu, nand: add medium specific polltimeout function

2014-04-09 Thread Heiko Schocher
add a possibility to add a medium specific polltimeout
function. So it is possible to define different
poll timeouts.

Used on nand medium, for setting the DFU_MANIFEST_POLL_TIMEOUT
only on nand ubi partitions, which is currently the only
usecase.

Signed-off-by: Heiko Schocher h...@denx.de
Cc: Lukasz Majewski l.majew...@samsung.com
Cc: Kyungmin Park kyungmin.p...@samsung.com
Cc: Marek Vasut ma...@denx.de
Cc: Pantelis Antoniou pa...@antoniou-consulting.com
---
 drivers/dfu/dfu_nand.c | 13 +
 drivers/usb/gadget/f_dfu.c | 14 +-
 include/dfu.h  |  1 +
 3 files changed, 27 insertions(+), 1 deletion(-)

diff --git a/drivers/dfu/dfu_nand.c b/drivers/dfu/dfu_nand.c
index 2d07097..ccdbef6 100644
--- a/drivers/dfu/dfu_nand.c
+++ b/drivers/dfu/dfu_nand.c
@@ -163,6 +163,18 @@ static int dfu_flush_medium_nand(struct dfu_entity *dfu)
return ret;
 }
 
+unsigned int dfu_polltimeout_nand(struct dfu_entity *dfu)
+{
+   /*
+* Currently, Poll Timeout != 0 is only needed on nand
+* ubi partition, as the not used sectors need an erase
+*/
+   if (dfu-data.nand.ubi)
+   return DFU_MANIFEST_POLL_TIMEOUT;
+
+   return DFU_DEFAULT_POLL_TIMEOUT;
+}
+
 int dfu_fill_entity_nand(struct dfu_entity *dfu, char *s)
 {
char *st;
@@ -211,6 +223,7 @@ int dfu_fill_entity_nand(struct dfu_entity *dfu, char *s)
dfu-read_medium = dfu_read_medium_nand;
dfu-write_medium = dfu_write_medium_nand;
dfu-flush_medium = dfu_flush_medium_nand;
+   dfu-poll_timeout = dfu_polltimeout_nand;
 
/* initial state */
dfu-inited = 0;
diff --git a/drivers/usb/gadget/f_dfu.c b/drivers/usb/gadget/f_dfu.c
index de75ff1..9128add 100644
--- a/drivers/usb/gadget/f_dfu.c
+++ b/drivers/usb/gadget/f_dfu.c
@@ -174,6 +174,17 @@ static void dnload_request_flush(struct usb_ep *ep, struct 
usb_request *req)
  req-length, f_dfu-blk_seq_num);
 }
 
+static void dfu_set_poll_timeout_manifest(struct dfu_status *dstat,
+ struct f_dfu *f_dfu)
+{
+   struct dfu_entity *dfu = dfu_get_entity(f_dfu-altsetting);
+
+   if (dfu-poll_timeout)
+   dfu_set_poll_timeout(dstat, dfu-poll_timeout(dfu));
+   else
+   dfu_set_poll_timeout(dstat, DFU_MANIFEST_POLL_TIMEOUT);
+}
+
 static void handle_getstatus(struct usb_request *req)
 {
struct dfu_status *dstat = (struct dfu_status *)req-buf;
@@ -190,7 +201,8 @@ static void handle_getstatus(struct usb_request *req)
f_dfu-dfu_state = DFU_STATE_dfuMANIFEST;
break;
case DFU_STATE_dfuMANIFEST:
-   dfu_set_poll_timeout(dstat, DFU_MANIFEST_POLL_TIMEOUT);
+   dfu_set_poll_timeout_manifest(dstat, f_dfu);
+   break;
default:
break;
}
diff --git a/include/dfu.h b/include/dfu.h
index 6c71ecb..c7fd270 100644
--- a/include/dfu.h
+++ b/include/dfu.h
@@ -105,6 +105,7 @@ struct dfu_entity {
u64 offset, void *buf, long *len);
 
int (*flush_medium)(struct dfu_entity *dfu);
+   unsigned int (*poll_timeout)(struct dfu_entity *dfu);
 
struct list_head list;
 
-- 
1.8.3.1

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


[U-Boot] [PATCH 1/2] musb-new, dfu: first send request answer then call completions

2014-04-09 Thread Heiko Schocher
comment in ep0_txstate() states:

report completions as soon as the fifo's loaded; there's no win
 in waiting till this last packet gets acked.

This is wrong for using dfu. In the dfu usecase we must send
a PollTimeout to the host, so the host can wait until the
U-Boot Code is ready for answering new usb requests. So the
answer which contains the PollTimeout must send *before*
U-Boot calls req-complete.

The req-complete is used in the dfu case for flushing the
medium, when entering DFU_STATE_dfuMANIFEST_SYNC state.

Signed-off-by: Heiko Schocher h...@denx.de
Cc: Lukasz Majewski l.majew...@samsung.com
Cc: Kyungmin Park kyungmin.p...@samsung.com
Cc: Marek Vasut ma...@denx.de
Cc: Pantelis Antoniou pa...@antoniou-consulting.com

---

Tested on the dxr2 and pxm2 boards. If dfu_flush() needs longer
then 5 sec, dfu-util breaks with current mainline code:

[...]
finished!
unable to read DFU status
$

With this patch, it shows again:

[...]
finished!
state(7) = dfuMANIFEST, status(0) = No error condition is present
state(2) = dfuIDLE, status(0) = No error condition is present
Done!
$
---
 drivers/usb/musb-new/musb_gadget_ep0.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/musb-new/musb_gadget_ep0.c 
b/drivers/usb/musb-new/musb_gadget_ep0.c
index 6599d38..8c3b0a1 100644
--- a/drivers/usb/musb-new/musb_gadget_ep0.c
+++ b/drivers/usb/musb-new/musb_gadget_ep0.c
@@ -576,6 +576,10 @@ static void ep0_txstate(struct musb *musb)
} else
request = NULL;
 
+   /* send it out, triggering a txpktrdy cleared irq */
+   musb_ep_select(musb-mregs, 0);
+   musb_writew(regs, MUSB_CSR0, csr);
+
/* report completions as soon as the fifo's loaded; there's no
 * win in waiting till this last packet gets acked.  (other than
 * very precise fault reporting, needed by USB TMC; possible with
@@ -588,10 +592,6 @@ static void ep0_txstate(struct musb *musb)
return;
musb-ackpend = 0;
}
-
-   /* send it out, triggering a txpktrdy cleared irq */
-   musb_ep_select(musb-mregs, 0);
-   musb_writew(regs, MUSB_CSR0, csr);
 }
 
 /*
-- 
1.8.3.1

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


Re: [U-Boot] [PATCH v3 1/4]drivers: mmc: dwmmc: enable support for DT

2014-04-09 Thread Jaehoon Chung
Hi, Minkyu.

On 04/08/2014 02:08 PM, Beomho Seo wrote:
 Thank you for your advice.
 
 On 04/08/2014 11:53 AM, Minkyu Kang wrote:
 Dear Beonho Seo,

 On 20/03/14 13:14, Beomho Seo wrote:
 This patch enables for device tree for dw-mmc driver.
 Driver have been fixed because it is used exynos5 and exynos4.
 Add, fdt compat id of exynos4 dwmmc.

 Signed-off-by: Beomho Seo beomho@samsung.com
 Signed-off-by: Jaehoon Chung jh80.ch...@samsung.com
 Tested-by: Piotr Wilczek p.wilc...@samsung.com
 Cc: Lukasz Majewski l.majew...@samsung.com
 Cc: Piotr Wilczek p.wilc...@samsung.com
 Cc: Minkyu Kang mk7.k...@samsung.com
 ---
 Changes for v3:
 - None.

  drivers/mmc/exynos_dw_mmc.c |   21 +
  include/fdtdec.h|1 +
  lib/fdtdec.c|1 +
  3 files changed, 19 insertions(+), 4 deletions(-)

 diff --git a/drivers/mmc/exynos_dw_mmc.c b/drivers/mmc/exynos_dw_mmc.c
 index de8cdcc..b9d41d4 100644
 --- a/drivers/mmc/exynos_dw_mmc.c
 +++ b/drivers/mmc/exynos_dw_mmc.c
 @@ -13,6 +13,7 @@
  #include asm/arch/dwmmc.h
  #include asm/arch/clk.h
  #include asm/arch/pinmux.h
 +#include asm/gpio.h

  #defineDWMMC_MAX_CH_NUM4
  #defineDWMMC_MAX_FREQ  5200
 @@ -82,6 +83,7 @@ int exynos_dwmci_add_port(int index, u32 regbase, int 
 bus_width, u32 clksel)
 freq = 5200;
 sclk = get_mmc_clk(index);
 div = DIV_ROUND_UP(sclk, freq);
 +   div -= 1;

 why?

 
 It need for set accurately required frequency.
 Above code prevent to set below the required frequency.
 For example above case,
 If sclk is 100 MHz and required frequency 50 MHz, Where div = 2.
 and then mmc clock set 33 MHz calculating.
 So It need div minus one.

It didn't consider how div value is set into CMU register.
SCLK = (MOUT/(PRE_RATIO + 1))/(RATIO + 1).
Finally, it didn't consider for plus one. Source clock is set to wrong value.

It needs to change other approach than using just div -= 1.

If i understood something wrong, let me know, plz.

Best Regards,
Jaehoon Chung
 
 /* set the clock divisor for mmc */
 set_mmc_clk(index, div);

 @@ -118,15 +120,21 @@ int exynos_dwmmc_init(const void *blob)
  {
 int index, bus_width;
 int node_list[DWMMC_MAX_CH_NUM];
 -   int err = 0, dev_id, flag, count, i;
 +   int err = 0, dev_id, flag, count, i, compat_id;
 u32 clksel_val, base, timing[3];

 +#ifdef CONFIG_EXYNOS4
 +   compat_id = COMPAT_SAMSUNG_EXYNOS4_DWMMC;
 +#else
 +   compat_id = COMPAT_SAMSUNG_EXYNOS5_DWMMC;
 +#endif

 NAK.
 please don't use ifdef.

 
 OK. I will change it.
 
 +
 count = fdtdec_find_aliases_for_id(blob, mmc,
 -   COMPAT_SAMSUNG_EXYNOS5_DWMMC, node_list,
 -   DWMMC_MAX_CH_NUM);
 +   compat_id, node_list, DWMMC_MAX_CH_NUM);

 for (i = 0; i  count; i++) {
 int node = node_list[i];
 +   struct fdt_gpio_state pwr_gpio;

 if (node = 0)
 continue;
 @@ -145,6 +153,9 @@ int exynos_dwmmc_init(const void *blob)
 else
 flag = PINMUX_FLAG_NONE;

 +   fdtdec_decode_gpio(blob, node, pwr-gpios, pwr_gpio);
 +   if (fdt_gpio_isvalid(pwr_gpio))
 +   gpio_direction_output(pwr_gpio.gpio, 1);

 please add blank line.

 
 OK. I will add blank line.
 
 /* config pinmux for each mmc channel */
 err = exynos_pinmux_config(dev_id, flag);
 if (err) {
 @@ -152,7 +163,9 @@ int exynos_dwmmc_init(const void *blob)
 return err;
 }

 -   index = dev_id - PERIPH_ID_SDMMC0;
 +   index = fdtdec_get_int(blob, node, index, dev_id);
 +   if (index == dev_id)
 +   index = dev_id - PERIPH_ID_SDMMC0;

 I can't understand why this routine is needed.
 Could you please explain?

 
 SDMMC index(0, 1 ... 4) is need to get/set mmc clk.
 It is decided the difference between dev_id and PERIPH_ID_SDMMC0(=75).
 But If dev_id is PERIPH_ID_SDMMC4(=131), index is set inaccurately.
 So I add index property at device tree. and then parse it.
 If index property not exist, index is decided the difference between dev_id 
 and PERIPH_ID_SDMMC0.
 

 /* Get the base address from the device node */
 base = fdtdec_get_addr(blob, node, reg);
 diff --git a/include/fdtdec.h b/include/fdtdec.h
 index 63027bd..15f50fe 100644
 --- a/include/fdtdec.h
 +++ b/include/fdtdec.h
 @@ -83,6 +83,7 @@ enum fdt_compat_id {
 COMPAT_SAMSUNG_EXYNOS5_DP,  /* Exynos Display port controller */
 COMPAT_SAMSUNG_EXYNOS5_DWMMC,   /* Exynos5 DWMMC controller */
 COMPAT_SAMSUNG_EXYNOS_MMC,  /* Exynos MMC controller */
 +   COMPAT_SAMSUNG_EXYNOS4_DWMMC,   /* Exynos4 DWMMC controller */

 Do we need to separate exynos4 dwmmc and exynos5 dwmmc?

 
 OK, I will change and test it.
 
 Jaehoon,
 how you think?

 COMPAT_SAMSUNG_EXYNOS_SERIAL,   /* Exynos UART */