[U-Boot] Enquiry?

2011-11-05 Thread Ben Harold
Good day,
I want to place an order and I have a private freight agent that will commence 
to your location for the pick up.So you don't have any stress to face in the 
shipping arrangement to Malaysia,but I will like to know if you have credit 
card processing machine to charge my VISA card for the goods's payment ? If 
yes,then treat this email with good concern and include your website/current 
price list in your reply.

Regards,
Ben Harold


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


[U-Boot] [PATCH] Makefile: Add the missing dependency for spl target

2011-11-05 Thread Aneesh V
Wolfgang's patch for build time improvement is bringing
out issues due to missing dependencies in the top-level
Makefile. I get errors such as the below while building
with many threads.

make[1]: /home/a0393566local/u-boot-denx/tools/mkimage: Command not found

This also allows one to do:
$ make spl/u-boot-spl.bin
if you want to build only spl

Cc: Wolfgang Denk w...@denx.de
Signed-off-by: Aneesh V ane...@ti.com
---
 Makefile |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Makefile b/Makefile
index 82de62b..7ae8b22 100644
--- a/Makefile
+++ b/Makefile
@@ -481,7 +481,7 @@ mmc_spl:$(TIMESTAMP_FILE) $(VERSION_FILE) depend
 
 $(obj)mmc_spl/u-boot-mmc-spl.bin:  mmc_spl
 
-$(obj)spl/u-boot-spl.bin:  depend
+$(obj)spl/u-boot-spl.bin:  $(SUBDIR_TOOLS) depend
$(MAKE) -C spl all
 
 updater:
-- 
1.7.1

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


Re: [U-Boot] [PATCH 3/9] arm: Move CP15 init out of cpu_init_crit()

2011-11-05 Thread Albert ARIBAUD
Hi Simon et al.,

Thanks to you and others for their patience. Let me summarize the thread:

- ARM7TDMI definitely lacks a cp15, as AN99 explicitely states;

- ARM provides no other, reliable, way to identify an ARM7TDMI reliably;

- Identification through a manufacturer-specific method just defeats the 
goal.

This makes it impossible to support ARM7TDMI (as well as others listed 
in AM99)  with a start.S code that contains cp15 instructions.

OTOH, I've gone through a number of ARM TRMs for cores that have 
caches/MMU and they all state that these are disabled on reset. I will 
also assume that when U-Boot starts indirectly through SPL or any other 
mechanism, and if this mechanism uses caches/MMU, then it will disable 
them properly before passing control to U-Boot, just like U-Boot 
disables caches etc before passing control to e.g. Linux.

I understand that this initialization is done so that the the cache/MMU 
is in a correct state, and this must still be ensured, but I now think 
that ensuring this is the burden of whatever passed control to the start 
label (this includes true resets, branching from SPL or any other IPL, 
and --ugh-- branching to start from inside U-Boot).

Based on this, I revise my opinion that the caches and MMU cleaning code 
in start.S should be kept there, and actually I now consider that they 
should be removed entirely.

However, removing cp15 inits would mean a *third* revision of your 
patchset, plus it could cause unexpected issues which I don't want to 
happen at this point of the release cycle.

Therefore, I'll go back to your patch as posted on oct 13th.

Apologies for the long discussion.

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


Re: [U-Boot] [PATCH 3/9] arm: Move CP15 init out of cpu_init_crit()

2011-11-05 Thread Albert ARIBAUD
Hi Simon,

Going back to this version of the patch as indicated, I notice something 
weird:

Le 13/10/2011 23:05, Simon Glass a écrit :
 Some SOCs have do not start up with their 'main' CPU. The first U-Boot
 code may then be executed with a CPU which does not have a CP15, or not a
 useful one.

 Here we split the initialization of CP15 into a separate call, which can
 be performed later if required.

 Once the main CPU is running, you should call cpu_init_cp15() to perform
 this init as early as possible.

 Existing ARMv7 boards which define CONFIG_SKIP_LOWLEVEL_INIT should not
 need to change, this CP15 init is still skipped in that case. The only
 impact for these boards is that the cpu_init_cp15() will be available
 even if it is never used on these boards.

 Signed-off-by: Simon Glasss...@chromium.org
 ---
   arch/arm/cpu/armv7/start.S|   24 ++--
   arch/arm/include/asm/u-boot-arm.h |3 +++
   2 files changed, 21 insertions(+), 6 deletions(-)

 diff --git a/arch/arm/cpu/armv7/start.S b/arch/arm/cpu/armv7/start.S
 index db8e9d2..7fdd422 100644
 --- a/arch/arm/cpu/armv7/start.S
 +++ b/arch/arm/cpu/armv7/start.S
 @@ -168,6 +168,7 @@ next:
   #endif
   /* the mask ROM code should have PLL and others stable */
   #ifndef CONFIG_SKIP_LOWLEVEL_INIT
 + bl  cpu_reset_cp15
   bl  cpu_init_crit
   #endif

 @@ -305,17 +306,16 @@ jump_2_ram:
   _board_init_r_ofs:
   .word board_init_r - _start

 -
 -#ifndef CONFIG_SKIP_LOWLEVEL_INIT
   /*
*
 - * CPU_init_critical registers
 + * cpu_reset_cp15
*
 - * setup important registers
 - * setup memory timing
 + * Setup CP15 registers (cache, MMU, TLBs). The I-cache is turned on unless
 + * CONFIG_SYS_ICACHE_OFF is defined.
*
*/
 -cpu_init_crit:
 +.globl cpu_init_cp15
 +cpu_init_cp15:

Seems like half this patch says 'cpu_reset_cp15' and then the second 
half says 'cpu_init_cp15' (I prefer 'cpu_init_cp15').

   /*
* Invalidate L1 I/D
*/
 @@ -340,7 +340,19 @@ cpu_init_crit:
   orr r0, r0, #0x1000 @ set bit 12 (I) I-cache
   #endif
   mcr p15, 0, r0, c1, c0, 0
 + mov pc, lr  @ back to my caller

 +
 +#ifndef CONFIG_SKIP_LOWLEVEL_INIT
 +/*
 + *
 + * CPU_init_critical registers
 + *
 + * setup important registers
 + * setup memory timing
 + *
 + */
 +cpu_init_crit:
   /*
* Jump to board specific initialization...
* The Mask ROM will have already initialized
 diff --git a/arch/arm/include/asm/u-boot-arm.h 
 b/arch/arm/include/asm/u-boot-arm.h
 index d3308f7..4ca75f9 100644
 --- a/arch/arm/include/asm/u-boot-arm.h
 +++ b/arch/arm/include/asm/u-boot-arm.h
 @@ -46,6 +46,9 @@ extern ulong IRQ_STACK_START_IN;/* 8 bytes in IRQ stack 
 */
   int cpu_init(void);
   int cleanup_before_linux(void);

 +/* Set up ARMv7 MMU, caches and TLBs */
 +void cpu_init_cp15(void);
 +
   /* cpu/.../arch/cpu.c */
   int arch_cpu_init(void);
   int arch_misc_init(void);

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


Re: [U-Boot] U-Boot maintainers: some boards are broken by recent mach-type update

2011-11-05 Thread David Müller (ELSOFT AG)
Hi Albert

Albert ARIBAUD wrote:
 U-Boot maintainers of such boards (in Cc: of this mail) should provide a 
 patch to re-introduce the MACH_TYPE_XX definition in their boards' 
 config header file in include/configs/.

Could you please apply the following patches:

- http://patchwork.ozlabs.org/patch/122787/
- http://patchwork.ozlabs.org/patch/122786/

Thank you

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


Re: [U-Boot] [PATCH v2] config.mk: use memoization in cc-option macro to speed up compilation

2011-11-05 Thread Aneesh V
On Friday 04 November 2011 06:15 PM, Daniel Schwierzeck wrote:
 Apply memoization to cc-option macro by caching the results of the
 gcc calls. This macro is called very often so using cached results
 leads to faster compilation times.

This one gives even better results compared to your
previous version.

Tested-by: Aneesh V ane...@ti.com

br,
Aneesh



 Signed-off-by: Daniel Schwierzeckdaniel.schwierz...@googlemail.com
 ---
 Changes for v2:
   - move cache file to $(obj)/include/generated
   - reworked completely
   - cache also non-working gcc options
   - remove CACHE_CC_OPTIONS config switch and enable this optimization
 by default

   config.mk |   23 +--
   1 files changed, 21 insertions(+), 2 deletions(-)

 diff --git a/config.mk b/config.mk
 index 918cffe..0da961a 100644
 --- a/config.mk
 +++ b/config.mk
 @@ -107,8 +107,27 @@ HOSTCFLAGS   += -pedantic
   # Option checker (courtesy linux kernel) to ensure
   # only supported compiler options are used
   #
 -cc-option = $(shell if $(CC) $(CFLAGS) $(1) -S -o /dev/null -xc /dev/null \
 -   /dev/null 21; then echo $(1); else echo $(2); fi ;)
 +CC_OPTIONS_CACHE_FILE := $(OBJTREE)/include/generated/cc_options.mk
 +
 +$(if $(wildcard $(CC_OPTIONS_CACHE_FILE)),,\
 + $(shell mkdir -p $(dir $(CC_OPTIONS_CACHE_FILE
 +
 +sinclude $(CC_OPTIONS_CACHE_FILE)
 +
 +_ccopt_sys = $(shell if $(CC) $(CFLAGS) $(1) -S -o /dev/null -xc /dev/null \
 +   /dev/null 21; then \
 + echo 'CC_OPTIONS += $(strip $1)'  $(CC_OPTIONS_CACHE_FILE); \
 + echo $(1); else \
 + [ x$(strip $2) != x ]  \
 + echo 'CC_OPTIONS_NOP += $(strip $2)'  
 $(CC_OPTIONS_CACHE_FILE); \
 + echo $(2); fi)
 +
 +_ccopt_cached = $(if $(filter $1,$(CC_OPTIONS)),$1,)
 +_ccopt_nop_cached = $(if $(filter $1,$(CC_OPTIONS_NOP)),$1,)
 +
 +cc-option = $(if $(call _ccopt_cached,$1),$1,\
 + $(if $(call _ccopt_nop_cached,$2),$2,\
 + $(call _ccopt_sys,$1,$2)))

   #
   # Include the make variables (CC, etc...)

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


Re: [U-Boot] [PATCH v2] config.mk: use memoization in cc-option macro to speed up compilation

2011-11-05 Thread Albert ARIBAUD
Hi all,

Le 04/11/2011 18:56, Wolfgang Denk a écrit :
 Dear Daniel Schwierzeck,

 In 
 messageCACUy__XY1873+dT-s=-gypebq5hnysmywwt-gxexiwy97ec...@mail.gmail.com  
 you wrote:

 Should we change it? is the semantic still the same?

 I'm not sure. At first reading it doesn't look really the same to me.

They are not, at least for ELDK4.2.

The only difference is in -mabi options, where the change would reduce 
-mabi=apcs-gnu -mabi=aapcs-linux to -mabi=aapcs-linux.

apcs-gnu, IIUC, is 'old ABI', while 'aapcs-linux' is 'new ABI', aka 
eabi. Most of the toolchains I see are eabi (ELDK and CS notably). There 
may be 'old ABI' toolchains out there, but I don't think they are old 
ABI either.

Anyway, I've just tried ./MAKEALL edminiv2 with ELD42 and a couple of CS 
toolchains, and nowhere in the log does -mabi=apcs-gnu show up -- the 
gcc invocations only have -mabi=aapcs-linux.

I've also tested making ED Mini V2 with and without the patch but 
without Daniel's proposed change to arch/arm/config.mk, and there is no 
difference in build commands (except that for some reason the patch 
inserts multiple spaces between some gcc invocation options.

Daniel, what do you mean with does not work correctly?

 Best regards,

 Wolfgang Denk

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


Re: [U-Boot] [PATCH] powerpc: Revert arch/powerpc/lib/board.c: fix build warning

2011-11-05 Thread Wolfgang Denk
Dear Kim Phillips,

In message 2004163427.db13a668c89386e254098...@freescale.com you wrote:
 This reverts commit a9f4fc3fe571cc99260b063ad0ff291d31bafed0.
 
 commit aab773a47a8f7f40b9d7c4877853b00d22fb1347 already fixed the
 issue.
 
 Signed-off-by: Kim Phillips kim.phill...@freescale.com
 ---
  arch/powerpc/lib/board.c |4 +---
  1 files changed, 1 insertions(+), 3 deletions(-)
 
 diff --git a/arch/powerpc/lib/board.c b/arch/powerpc/lib/board.c
 index 3a1b375..508075f 100644
 --- a/arch/powerpc/lib/board.c
 +++ b/arch/powerpc/lib/board.c
 @@ -625,9 +625,7 @@ void board_init_r (gd_t *id, ulong dest_addr)
  {
   bd_t *bd;
   ulong malloc_start;
 -#if defined(CONFIG_SYS_FLASH_CHECKSUM) || defined(CONFIG_CMD_NET)
 - char *s;
 -#endif
 +

Which tree / version is your patch based on?  It does not apply to
master.  We fixed this with commit commit ecfd752.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
The most difficult thing in the world is to know how to  do  a  thing
and to watch someone else doing it wrong, without commenting.
-- T.H. White
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/2] mvgbe: fix network device indices

2011-11-05 Thread Albert ARIBAUD
Le 05/11/2011 00:06, Mike Frysinger a écrit :
 On Friday 04 November 2011 02:29:24 Prafulla Wadaskar wrote:
 Mike Frysinger:
 On Thursday 03 November 2011 19:02:26 Michael Walle wrote:
 Am Donnerstag 03 November 2011, 19:10:57 schrieb Mike Frysinger:
 On Thursday 27 October 2011 17:31:36 Michael Walle wrote:
 --- a/drivers/net/mvgbe.c
 +++ b/drivers/net/mvgbe.c

 +/* Extract the MAC address from the environment */
 +while (!eth_getenv_enetaddr_by_index(eth, dev-index,
 +dev-enetaddr)) {

  /* Generate Private MAC addr if not set */
  dev-enetaddr[0] = 0x02;
  dev-enetaddr[1] = 0x50;

 this is wrong.  net drivers should not be touching the env
 at all.  please fix your driver to not do that first.

 i guess this whole mac randomization/generation code belongs to board
 specific files.

 correct

 We can move mac randomization code to the board specific files, but it will
 be needed for each board and there will be code duplication.

 there's two issues here.  (1) no net driver should touch the env.  this is why
 we have the dev-enetaddr field in the first place.  (2) drivers should be
 seeding dev-enetaddr with values from storage directly related to it.  so for
 parts that have dedicated EEPROM interfaces, reading the MAC out of that
 storage makes sense.  if no storage like that exists, then it is up to the
 board to figure out where to find the address.

 that means this could should be moved to the boards file.

 How about supporting standalone mac randomization feature?

 i think Wolfgang would be opposed to that.  mac randomization should not be
 the first line of defense.  your board is supposed to be managing this sanely.
 from the mvgbe code, it seems that this is not the case and these boards are a
 bit insane.

Granted, MAC randomization as a feature -- i.e., choosing to use a 
random MAC *instead* of any other way -- would be Bad(tm).

But what about MAC randomization as a function provided by the SoC level 
to board MAC init code that wants to use it? For instance, a weak MAC 
setup function provided by the SoC level, and the board level would use 
it or provide its own.

 -mike

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


Re: [U-Boot] [PATCH 0/3] ARM: vexpress: add support for A5 core tile

2011-11-05 Thread Albert ARIBAUD
Le 18/10/2011 14:41, Ryan Harkin a écrit :
 Add support for the A5 Core Tile on the Versatile Express motherboard.

 Ryan Harkin (3):
ARM: vexpress: move files in preparation for adding a new platform
ARM: vexpress: create A9 specific board config
ARM: vexpress: create A5 specific board config

   MAINTAINERS|3 +-
   board/armltd/vexpress/Makefile |2 +-
   .../vexpress/{ca9x4_ct_vxp.c =  vexpress_common.c} |   29 ++-
   boards.cfg |3 +-
   include/configs/ca9x4_ct_vxp.h |  206 -
   include/configs/vexpress_ca5x2.h   |   34 +++
   include/configs/vexpress_ca9x4.h   |   34 +++
   include/configs/vexpress_common.h  |  314 
 
   8 files changed, 410 insertions(+), 215 deletions(-)
   rename board/armltd/vexpress/{ca9x4_ct_vxp.c =  vexpress_common.c} (90%)
   delete mode 100644 include/configs/ca9x4_ct_vxp.h
   create mode 100644 include/configs/vexpress_ca5x2.h
   create mode 100644 include/configs/vexpress_ca9x4.h
   create mode 100644 include/configs/vexpress_common.h

The series is not bisectable in that board ca9x4_ct_vxp disappears in 
patch 1/3 to reappear in patch 2/3. Please reorganize patch set so that 
common files are extracted without preventing ca9x4_ct_vxp from building.

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


Re: [U-Boot] [PATCH] arm: jadecpu: Readd MACH_TYPE_JADECPU

2011-11-05 Thread Albert ARIBAUD
Hi Matthias,

Le 31/10/2011 08:26, Matthias Weisser a écrit :
 MACH_TYPE_JADECPU was removed from mach-types.h. Add it to board
 config file.

 Signed-off-by: Matthias Weisserweiss...@arcor.de
 ---
   board/syteco/jadecpu/jadecpu.c |1 -
   include/configs/jadecpu.h  |6 ++
   2 files changed, 6 insertions(+), 1 deletions(-)

 diff --git a/board/syteco/jadecpu/jadecpu.c b/board/syteco/jadecpu/jadecpu.c
 index 63a0d33..72288fe 100644
 --- a/board/syteco/jadecpu/jadecpu.c
 +++ b/board/syteco/jadecpu/jadecpu.c
 @@ -40,7 +40,6 @@ int board_init(void)
   writel(0x0010,ccnt-cmux_md);

   gd-flags = 0;
 - gd-bd-bi_arch_number = MACH_TYPE_JADECPU;
   gd-bd-bi_boot_params = PHYS_SDRAM + PHYS_SDRAM_SIZE - 0x1;

   icache_enable();
 diff --git a/include/configs/jadecpu.h b/include/configs/jadecpu.h
 index a239efc..42cb858 100644
 --- a/include/configs/jadecpu.h
 +++ b/include/configs/jadecpu.h
 @@ -37,6 +37,12 @@
   #define CONFIG_USE_ARCH_MEMCPY
   #define CONFIG_USE_ARCH_MEMSET

 +#ifndef MACH_TYPE_JADECPU
 +#define MACH_TYPE_JADECPU2636
 +#endif

NAK -- remove ifndef/endif around definition. This way, if/when mach 
type reappears in official mach-type.h, we will get a warning about your 
mach-type being defined twice.

 +#define CONFIG_MACH_TYPE MACH_TYPE_JADECPU
 +
   /*
* Environment settings
*/

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


[U-Boot] [PATCH V4] sandbox: Add improved RAM simulation

2011-11-05 Thread Matthias Weisser
Using mmap to allocate memory from the OS for RAM simulation we can use
u-boot own malloc implementation.

Signed-off-by: Matthias Weisser weiss...@arcor.de
---
Changes in V4:
  Rebased to current HEAD
  
Changes in V3:
  Fixed a build warning

Changes in V2:
  Removed the address hint for mmap
  Removed the special handling of dlmalloc in common
  Set gd-bd-bi_dram[0].start to 0 again

 arch/sandbox/cpu/os.c|7 +++
 arch/sandbox/lib/board.c |   17 ++---
 common/Makefile  |3 ---
 include/os.h |8 
 4 files changed, 25 insertions(+), 10 deletions(-)

diff --git a/arch/sandbox/cpu/os.c b/arch/sandbox/cpu/os.c
index f80faac..b7c3bf5 100644
--- a/arch/sandbox/cpu/os.c
+++ b/arch/sandbox/cpu/os.c
@@ -25,6 +25,7 @@
 #include unistd.h
 #include sys/types.h
 #include sys/stat.h
+#include sys/mman.h
 
 #include os.h
 
@@ -87,3 +88,9 @@ void os_tty_raw(int fd)
 
atexit(os_fd_restore);
 }
+
+void *os_malloc(size_t length)
+{
+   return mmap(NULL, length, PROT_READ | PROT_WRITE,
+   MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
+}
diff --git a/arch/sandbox/lib/board.c b/arch/sandbox/lib/board.c
index ae5a517..b7997e9 100644
--- a/arch/sandbox/lib/board.c
+++ b/arch/sandbox/lib/board.c
@@ -45,8 +45,12 @@
 #include version.h
 #include serial.h
 
+#include os.h
+
 DECLARE_GLOBAL_DATA_PTR;
 
+static gd_t gd_mem;
+
 /
  * Init Utilities  *
  
@@ -147,7 +151,7 @@ void board_init_f(ulong bootflag)
uchar *mem;
unsigned long addr_sp, addr, size;
 
-   gd = malloc(sizeof(gd_t));
+   gd = gd_mem;
assert(gd);
 
memset((void *)gd, 0, sizeof(gd_t));
@@ -158,7 +162,8 @@ void board_init_f(ulong bootflag)
}
 
size = CONFIG_SYS_SDRAM_SIZE;
-   mem = malloc(size);
+   mem = os_malloc(CONFIG_SYS_SDRAM_SIZE);
+
assert(mem);
gd-ram_buf = mem;
addr = (ulong)(mem + size);
@@ -214,11 +219,9 @@ void board_init_r(gd_t *id, ulong dest_addr)
post_output_backlog();
 #endif
 
-#if 0 /* Sandbox uses system malloc for now */
-   /* The Malloc area is immediately below the monitor copy in DRAM */
-   malloc_start = dest_addr - TOTAL_MALLOC_LEN;
-   mem_malloc_init(malloc_start, TOTAL_MALLOC_LEN);
-#endif
+   /* The Malloc area is at the top of simulated DRAM */
+   mem_malloc_init((ulong)gd-ram_buf + gd-ram_size - TOTAL_MALLOC_LEN,
+   TOTAL_MALLOC_LEN);
 
/* initialize environment */
env_relocate();
diff --git a/common/Makefile b/common/Makefile
index 1b672ad..015c17e 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -29,9 +29,6 @@ LIB   = $(obj)libcommon.o
 ifndef CONFIG_SPL_BUILD
 COBJS-y += main.o
 COBJS-y += command.o
-ifndef CONFIG_SANDBOX
-COBJS-y += dlmalloc.o
-endif
 COBJS-y += exports.o
 COBJS-$(CONFIG_SYS_HUSH_PARSER) += hush.o
 COBJS-y += image.o
diff --git a/include/os.h b/include/os.h
index d5df22f..fd4120c 100644
--- a/include/os.h
+++ b/include/os.h
@@ -76,3 +76,11 @@ void os_exit(int exit_code);
  * Put tty into raw mode to mimic serial console better
  */
 void os_tty_raw(int fd);
+
+/**
+ * Acquires some memory from the underlying os.
+ *
+ * \param length   Number of bytes to be allocated
+ * \return Pointer to length bytes or NULL on error
+ */
+void *os_malloc(size_t length);
-- 
1.7.4.1

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


Re: [U-Boot] [PATCH V2] ARM: re-introduce the MACH_TYPE_XXXXXX for EB_CPUX9K2 board

2011-11-05 Thread Albert ARIBAUD
Le 31/10/2011 09:48, Igor Grinberg a écrit :
 Hi Jens,

 On 10/31/11 10:27, Jens Scharsig wrote:
 Am 2011-10-31 08:46, schrieb Igor Grinberg:
 Hi Jens,
 @@ -41,6 +41,8 @@
   #define CONFIG_MISC_INIT_R
   #define CONFIG_BOARD_EARLY_INIT_F

 +#define MACH_TYPE_EB_CPUX9K2   1977
 +

 While you are at it, probably, it will be a good time
 to switch to the new standard and use the CONFIG_MACH_TYPE
 option. Please, read the README file.

   
 /*--*/
   #define CONFIG_SYS_TEXT_BASE 0x
   #define CONFIG_SYS_LOAD_ADDR 0x2100  /* default load 
 address */


 Dear Albert ARIBAUD,

 What's your opinion?

 #define MACH_TYPE_EB_CPUX9K2 1977

 or

 #define CONFIG_MACH_TYPE 1977

 It should be both:

 #define MACH_TYPE_EB_CPUX9K2 1977

 and then:

 #define CONFIG_MACH_TYPE MACH_TYPE_EB_CPUX9K2

Correct.

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


Re: [U-Boot] [PATCH 2/2] at91: defined mach-types for otc570 board in board config file

2011-11-05 Thread Albert ARIBAUD
Hi Daniel,

Le 31/10/2011 09:52, Daniel Gorsulowski a écrit :
 quotation from Albert ARIBAUD:
 Recently the ARM mach-types.h file has been brought in sync with its
 Linux original, leasing to a number of boards not being listed any more,
 as the new list only contains boards which have actual Linux support or
 were declared less than one year ago.

 The symptom is a build failure with a message of the form error:
 'MACH_TYPE_XX' undeclared (first use in this function).

 U-Boot maintainers of such boards (in Cc: of this mail) should provide a
 patch to re-introduce the MACH_TYPE_XX definition in their boards'
 config header file in include/configs/.

 Signed-off-by: Daniel Gorsulowskidaniel.gorsulow...@esd.eu
 ---
   include/configs/otc570.h |7 +++
   1 files changed, 7 insertions(+), 0 deletions(-)

 diff --git a/include/configs/otc570.h b/include/configs/otc570.h
 index e2c2eda..c068aa0 100644
 --- a/include/configs/otc570.h
 +++ b/include/configs/otc570.h
 @@ -45,6 +45,13 @@
*/
   #define CONFIG_SYS_TEXT_BASE0x20002000

 +/*
 + * since a number of boards are not being listed in linux
 + * arch/arm/tools/mach-types any more, the mach-types have to be
 + * defined here
 + */
 +#define MACH_TYPE_OTC570 2166
 +
   /* ARM asynchronous clock */
   #define CONFIG_SYS_AT91_SLOW_CLOCK  32768   /* 32.768 kHz crystal */
   #define CONFIG_SYS_AT91_MAIN_CLOCK  1600/* 16.0 MHz crystal */

Applied to u-boot-arm/master, thanks!

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


Re: [U-Boot] [PATCH 1/2] at91: defined mach-types for meesc board in board config file

2011-11-05 Thread Albert ARIBAUD
Hi Daniel,

Le 31/10/2011 09:52, Daniel Gorsulowski a écrit :
 quotation from Albert ARIBAUD:
 Recently the ARM mach-types.h file has been brought in sync with its
 Linux original, leasing to a number of boards not being listed any more,
 as the new list only contains boards which have actual Linux support or
 were declared less than one year ago.

 The symptom is a build failure with a message of the form error:
 'MACH_TYPE_XX' undeclared (first use in this function).

 U-Boot maintainers of such boards (in Cc: of this mail) should provide a
 patch to re-introduce the MACH_TYPE_XX definition in their boards'
 config header file in include/configs/.

 Signed-off-by: Daniel Gorsulowskidaniel.gorsulow...@esd.eu
 ---
   include/configs/meesc.h |8 
   1 files changed, 8 insertions(+), 0 deletions(-)

 diff --git a/include/configs/meesc.h b/include/configs/meesc.h
 index a2b55d5..ea40290 100644
 --- a/include/configs/meesc.h
 +++ b/include/configs/meesc.h
 @@ -45,6 +45,14 @@
*/
   #define CONFIG_SYS_TEXT_BASE0x20002000

 +/*
 + * since a number of boards are not being listed in linux
 + * arch/arm/tools/mach-types any more, the mach-types have to be
 + * defined here
 + */
 +#define MACH_TYPE_MEESC  2165
 +#define MACH_TYPE_ETHERCAN2  2407
 +
   /* ARM asynchronous clock */
   #define CONFIG_SYS_AT91_SLOW_CLOCK  32768   /* 32.768 kHz crystal */
   #define CONFIG_SYS_AT91_MAIN_CLOCK  1600/* 16.0 MHz crystal */

Applied to u-boot-arm/master, thanks!

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


Re: [U-Boot] [PATCH] matrix vision: fix MVBLM7, MVSMR build error

2011-11-05 Thread Schwarz,Andre



Kim Phillips kim.phill...@freescale.com hat am 4. November 2011 um 22:43
geschrieben:

 when a mkimage binary isn't present in the default system PATH, we
 get this error:

 $ ./MAKEALL MVBLM7
 Configuring for MVBLM7 board...
 make[1]: mkimage: Command not found
 make[1]: *** [libmvblm7.o] Error 127
 make: *** [board/matrix_vision/mvblm7/libmvblm7.o] Error 2
 powerpc-linux-gnu-size: './u-boot': No such file

 fix by referencing u-boot's built-in mkimage instead.

 Signed-off-by: Kim Phillips kim.phill...@freescale.com 
Acked-by: Andre Schwarz andre.schw...@matrix-vision.de 
 

 ---
  board/matrix_vision/mvblm7/Makefile |    2 +-
  board/matrix_vision/mvsmr/Makefile  |    2 +-
  2 files changed, 2 insertions(+), 2 deletions(-)

 diff --git a/board/matrix_vision/mvblm7/Makefile
 b/board/matrix_vision/mvblm7/Makefile
 index 81761ca..48a602c 100644
 --- a/board/matrix_vision/mvblm7/Makefile
 +++ b/board/matrix_vision/mvblm7/Makefile
 @@ -32,7 +32,7 @@ SOBJS        := $(addprefix $(obj),$(SOBJS))
 
  $(LIB):        $(obj).depend $(OBJS)
          $(call cmd_link_o_target, $(OBJS))
 -        @mkimage -T script -C none -n M7_script -d bootscript
 $(obj)bootscript.img
 +        @$(OBJTREE)/tools/mkimage -T script -C none -n M7_script -d
 bootscript $(obj)bootscript.img
 
  #
 
 diff --git a/board/matrix_vision/mvsmr/Makefile
 b/board/matrix_vision/mvsmr/Makefile
 index 37b9bac..bb77eff 100644
 --- a/board/matrix_vision/mvsmr/Makefile
 +++ b/board/matrix_vision/mvsmr/Makefile
 @@ -36,7 +36,7 @@ SOBJS   := $(addprefix $(obj),$(SOBJS))
 
  $(LIB): $(obj).depend $(OBJS)
                  $(call cmd_link_o_target, $(OBJS))
 -        @mkimage -T script -C none -n mvSMR_Script -d bootscript
 $(obj)bootscript.img
 +        @$(OBJTREE)/tools/mkimage -T script -C none -n mvSMR_Script -d
 bootscript $(obj)bootscript.img
 
  #
 
 --
 1.7.7.2

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


[U-Boot] Boards compiled twice in ./MAKEALL arm?

2011-11-05 Thread Albert ARIBAUD
Hi all,

When applying the meesc mach-type patch, I noticed a weird thing: on 
commit 867b96a5b7b1de56181b57bdfb25151c01a0fb3f, just before fixing 
meesc, I did a ./MAKEALL arm and noticed that some boards were mentioned 
twice in the build summary:

- SUMMARY 
Boards compiled: 255
Boards with warnings or errors: 67 ( a320evb eb_cpux9k2 VCMA9 
sbc35_a9g20_nandflash sbc35_a9g20_eeprom tny_a9g20_nandflash 
tny_a9g20_eeprom tny_a9260_nandflash tny_a9260_eeprom meesc 
meesc_dataflash otc570 otc570_dataflash pm9261 pm9263 pm9g45 da830evm 
da850evm cam_enc_4xx hawkboard_nand davinci_schmoogie davinci_sonata 
km_kirkwood km_kirkwood_pci mgcoge3un portl2 jadecpu dkb tt01 
mx31pdk_nand smdk6400 ca9x4_ct_vxp am335x_evm omap3_mvblx omap4_panda 
harmony seaboard eb_cpux9k2 sbc35_a9g20_nandflash sbc35_a9g20_eeprom 
tny_a9g20_nandflash tny_a9g20_eeprom tny_a9260_nandflash 
tny_a9260_eeprom meesc meesc_dataflash otc570 otc570_dataflash pm9261 
pm9263 pm9g45 cerf250 cradle csb226 innokom pleb2 xm250 actux1_4_16 
actux1_8_16 actux1_4_32 actux1_8_32 actux2 actux3 actux4 dvlhost pdnb3 
scpu )
--

Namely, the wole of 'sbc35_a9g20_nandflash sbc35_a9g20_eeprom 
tny_a9g20_nandflash tny_a9g20_eeprom tny_a9260_nandflash 
tny_a9260_eeprom meesc meesc_dataflash otc570 otc570_dataflash pm9261 
pm9263 pm9g45' is mentioned twice.

Anyone have any idea why?

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


[U-Boot] [PATCH v2] arm: jadecpu: Readd MACH_TYPE_JADECPU

2011-11-05 Thread Matthias Weisser
MACH_TYPE_JADECPU was removed from mach-types.h. Add it to board
config file.

Signed-off-by: Matthias Weisser weiss...@arcor.de
---
Changes in V2:
  Removed ifdef around MACH_TYPE

 board/syteco/jadecpu/jadecpu.c |1 -
 include/configs/jadecpu.h  |6 ++
 2 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/board/syteco/jadecpu/jadecpu.c b/board/syteco/jadecpu/jadecpu.c
index 63a0d33..72288fe 100644
--- a/board/syteco/jadecpu/jadecpu.c
+++ b/board/syteco/jadecpu/jadecpu.c
@@ -40,7 +40,6 @@ int board_init(void)
writel(0x0010, ccnt-cmux_md);
 
gd-flags = 0;
-   gd-bd-bi_arch_number = MACH_TYPE_JADECPU;
gd-bd-bi_boot_params = PHYS_SDRAM + PHYS_SDRAM_SIZE - 0x1;
 
icache_enable();
diff --git a/include/configs/jadecpu.h b/include/configs/jadecpu.h
index a239efc..42cb858 100644
--- a/include/configs/jadecpu.h
+++ b/include/configs/jadecpu.h
@@ -37,6 +37,10 @@
 #define CONFIG_USE_ARCH_MEMCPY
 #define CONFIG_USE_ARCH_MEMSET
 
+#define MACH_TYPE_JADECPU  2636
+
+#define CONFIG_MACH_TYPE MACH_TYPE_JADECPU
+
 /*
  * Environment settings
  */
-- 
1.7.4.1

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


Re: [U-Boot] [PATCH 3/3] netspace_v2: Read Ethernet MAC address from EEPROM

2011-11-05 Thread Simon Guinot
Hi Prafulla,

On Mon, Oct 31, 2011 at 02:58:36PM +0100, Simon Guinot wrote:
 From: Simon Guinot simon.gui...@sequanux.org
 
 Signed-off-by: Simon Guinot simon.gui...@sequanux.org
 ---
  board/LaCie/netspace_v2/netspace_v2.c |   43 
 +
  include/configs/netspace_v2.h |1 +
  2 files changed, 44 insertions(+), 0 deletions(-)
  delete mode 100644 arch/arm/cpu/arm926ejs/kirkwood/asm-offsets.s

Do you want me to repost this patch with some modifications ?

Regards,

Simon

 
 diff --git a/arch/arm/cpu/arm926ejs/kirkwood/asm-offsets.s 
 b/arch/arm/cpu/arm926ejs/kirkwood/asm-offsets.s
 deleted file mode 100644
 index e69de29..000
 diff --git a/board/LaCie/netspace_v2/netspace_v2.c 
 b/board/LaCie/netspace_v2/netspace_v2.c
 index 7c4b15e..a7717b9 100644
 --- a/board/LaCie/netspace_v2/netspace_v2.c
 +++ b/board/LaCie/netspace_v2/netspace_v2.c
 @@ -24,6 +24,7 @@
  #include miiphy.h
  #include netdev.h
  #include command.h
 +#include i2c.h
  #include asm/arch/cpu.h
  #include asm/arch/kirkwood.h
  #include asm/arch/mpp.h
 @@ -89,6 +90,48 @@ int board_init(void)
   return 0;
  }
  
 +int misc_init_r(void)
 +{
 +#ifdef CONFIG_CMD_I2C
 + if (!getenv(ethaddr)) {
 + ushort version;
 + uchar mac[6];
 + int ret;
 +
 + /* I2C-0 for on-board EEPROM */
 + i2c_set_bus_num(0);
 +
 + /* Check layout version for EEPROM data */
 + ret = i2c_read(CONFIG_SYS_I2C_EEPROM_ADDR, 0,
 + CONFIG_SYS_I2C_EEPROM_ADDR_LEN,
 + (uchar *) version, 2);
 + if (ret != 0) {
 + printf(Error: failed to read I2C EEPROM @%02x\n,
 + CONFIG_SYS_I2C_EEPROM_ADDR);
 + return ret;
 + }
 + version = be16_to_cpu(version);
 + if (version  1 || version  3) {
 + printf(Error: unknown version %d for EEPROM data\n,
 + version);
 + return -1;
 + }
 +
 + /* Read Ethernet MAC address from EEPROM */
 + ret = i2c_read(CONFIG_SYS_I2C_EEPROM_ADDR, 2,
 + CONFIG_SYS_I2C_EEPROM_ADDR_LEN, mac, 6);
 + if (ret != 0) {
 + printf(Error: failed to read I2C EEPROM @%02x\n,
 + CONFIG_SYS_I2C_EEPROM_ADDR);
 + return ret;
 + }
 + eth_setenv_enetaddr(ethaddr, mac);
 + }
 +#endif /* CONFIG_CMD_I2C */
 +
 + return 0;
 +}
 +
  void mv_phy_88e1116_init(char *name)
  {
   u16 reg;
 diff --git a/include/configs/netspace_v2.h b/include/configs/netspace_v2.h
 index bb27ed7..1ddf4b4 100644
 --- a/include/configs/netspace_v2.h
 +++ b/include/configs/netspace_v2.h
 @@ -87,6 +87,7 @@
   * Ethernet Driver configuration
   */
  #ifdef CONFIG_CMD_NET
 +#define CONFIG_MISC_INIT_R /* Call misc_init_r() to initialize MAC address */
  #define CONFIG_MVGBE_PORTS   {1, 0} /* enable port 0 only */
  #define CONFIG_NETCONSOLE
  #endif
 -- 
 1.7.5.1
 
 ___
 U-Boot mailing list
 U-Boot@lists.denx.de
 http://lists.denx.de/mailman/listinfo/u-boot


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 v2] arm: jadecpu: Readd MACH_TYPE_JADECPU

2011-11-05 Thread Albert ARIBAUD
Hi Matthias,

Le 05/11/2011 13:15, Matthias Weisser a écrit :
 MACH_TYPE_JADECPU was removed from mach-types.h. Add it to board
 config file.

 Signed-off-by: Matthias Weisserweiss...@arcor.de
 ---
 Changes in V2:
Removed ifdef around MACH_TYPE

   board/syteco/jadecpu/jadecpu.c |1 -
   include/configs/jadecpu.h  |6 ++
   2 files changed, 6 insertions(+), 1 deletions(-)

 diff --git a/board/syteco/jadecpu/jadecpu.c b/board/syteco/jadecpu/jadecpu.c
 index 63a0d33..72288fe 100644
 --- a/board/syteco/jadecpu/jadecpu.c
 +++ b/board/syteco/jadecpu/jadecpu.c
 @@ -40,7 +40,6 @@ int board_init(void)
   writel(0x0010,ccnt-cmux_md);

   gd-flags = 0;
 - gd-bd-bi_arch_number = MACH_TYPE_JADECPU;
   gd-bd-bi_boot_params = PHYS_SDRAM + PHYS_SDRAM_SIZE - 0x1;

   icache_enable();
 diff --git a/include/configs/jadecpu.h b/include/configs/jadecpu.h
 index a239efc..42cb858 100644
 --- a/include/configs/jadecpu.h
 +++ b/include/configs/jadecpu.h
 @@ -37,6 +37,10 @@
   #define CONFIG_USE_ARCH_MEMCPY
   #define CONFIG_USE_ARCH_MEMSET

 +#define MACH_TYPE_JADECPU2636
 +
 +#define CONFIG_MACH_TYPE MACH_TYPE_JADECPU
 +
   /*
* Environment settings
*/

Applied to u-boot-arm/master, thanks!

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


Re: [U-Boot] [PATCH V3] Arm: re-introduce the MACH_TYPE_XXXXXX for EB_CPUX9K2 board

2011-11-05 Thread Albert ARIBAUD
Hi Jens,

Le 31/10/2011 19:52, Jens Scharsig a écrit :
 * re-introduce the MACH_TYPE_XX for EB_CPUX9K2 board

 Signed-off-by: Jens Scharsigjs_at...@scharsoft.de
 ---
   include/configs/eb_cpux9k2.h |2 ++
   1 files changed, 2 insertions(+), 0 deletions(-)

 diff --git a/include/configs/eb_cpux9k2.h b/include/configs/eb_cpux9k2.h
 index 4324172..b08de4a 100644
 --- a/include/configs/eb_cpux9k2.h
 +++ b/include/configs/eb_cpux9k2.h
 @@ -41,6 +41,8 @@
   #define CONFIG_MISC_INIT_R
   #define CONFIG_BOARD_EARLY_INIT_F

 +#define MACH_TYPE_EB_CPUX9K2 1977
 +#define CONFIG_MACH_TYPE MACH_TYPE_EB_CPUX9K2
   
 /*--*/
   #define CONFIG_SYS_TEXT_BASE0x
   #define CONFIG_SYS_LOAD_ADDR0x2100  /* default load 
 address */

Applied to u-boot-arm/master, thanks!

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


Re: [U-Boot] [PATCH 2/2] mvgbe: fix network device indices

2011-11-05 Thread Wolfgang Denk
Dear Albert ARIBAUD,

In message 4eb507b7.9090...@aribaud.net you wrote:

 But what about MAC randomization as a function provided by the SoC level
 to board MAC init code that wants to use it? For instance, a weak MAC
 setup function provided by the SoC level, and the board level would use
 it or provide its own.

What would be the result?  A bord that comes up with a new MAC address
each time you reset it?

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
No journaling file system can recover your data if the disk dies.
 - Steve Rago in d4cw1p@plc.com
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] arm: jadecpu: Readd MACH_TYPE_JADECPU

2011-11-05 Thread Wolfgang Denk
Dear Albert ARIBAUD,

In message 4eb514c7.9000...@aribaud.net you wrote:
 
  +#ifndef MACH_TYPE_JADECPU
  +#define MACH_TYPE_JADECPU  2636
  +#endif
 
 NAK -- remove ifndef/endif around definition. This way, if/when mach
 type reappears in official mach-type.h, we will get a warning about your
 mach-type being defined twice.

Note that you will only get a warning if a _different_ value get's
defined (``warning: VAR redefined'').  If both values are the same,
no warning will be raised.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
If the facts don't fit the theory, change the facts.
   -- Albert Einstein
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] config.mk: use memoization in cc-option macro to speed up compilation

2011-11-05 Thread Wolfgang Denk
Dear Albert ARIBAUD,

In message 4eb4ff09.5070...@aribaud.net you wrote:
 
 apcs-gnu, IIUC, is 'old ABI', while 'aapcs-linux' is 'new ABI', aka 
 eabi. Most of the toolchains I see are eabi (ELDK and CS notably). There 
 may be 'old ABI' toolchains out there, but I don't think they are old 
 ABI either.
 
 Anyway, I've just tried ./MAKEALL edminiv2 with ELD42 and a couple of CS 
 toolchains, and nowhere in the log does -mabi=apcs-gnu show up -- the 
 gcc invocations only have -mabi=aapcs-linux.

Try ELDK 4.1 ...


Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
If God had a beard, he'd be a UNIX programmer.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 3/9] arm: Move CP15 init out of cpu_init_crit()

2011-11-05 Thread Simon Glass
Hi Albert,

On Sat, Nov 5, 2011 at 1:09 AM, Albert ARIBAUD
albert.u.b...@aribaud.net wrote:
 Hi Simon et al.,

 Thanks to you and others for their patience. Let me summarize the thread:

 - ARM7TDMI definitely lacks a cp15, as AN99 explicitely states;

 - ARM provides no other, reliable, way to identify an ARM7TDMI reliably;

 - Identification through a manufacturer-specific method just defeats the
 goal.

 This makes it impossible to support ARM7TDMI (as well as others listed in
 AM99)  with a start.S code that contains cp15 instructions.

 OTOH, I've gone through a number of ARM TRMs for cores that have caches/MMU
 and they all state that these are disabled on reset. I will also assume that
 when U-Boot starts indirectly through SPL or any other mechanism, and if
 this mechanism uses caches/MMU, then it will disable them properly before
 passing control to U-Boot, just like U-Boot disables caches etc before
 passing control to e.g. Linux.

 I understand that this initialization is done so that the the cache/MMU is
 in a correct state, and this must still be ensured, but I now think that
 ensuring this is the burden of whatever passed control to the start label
 (this includes true resets, branching from SPL or any other IPL, and --ugh--
 branching to start from inside U-Boot).

 Based on this, I revise my opinion that the caches and MMU cleaning code in
 start.S should be kept there, and actually I now consider that they should
 be removed entirely.

 However, removing cp15 inits would mean a *third* revision of your patchset,
 plus it could cause unexpected issues which I don't want to happen at this
 point of the release cycle.

Yes - I did something similar at v2 where I moved it into a library.
Best left alone for now. I would prefer to continue this discussion if
needed later when we have got this series committed.


 Therefore, I'll go back to your patch as posted on oct 13th.

 Apologies for the long discussion.

 Amicalement,
 --
 Albert.


OK, it will at least need a rebase - I will take another look.

Also please note that my series is based on Stephen Warren's MMC
series (1/4 went in via the MMC tree, the other three are ready for
your to pick up) and also Stephen's GPIO patch which is still pending.
Please pick up Stephen's patches first.

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


Re: [U-Boot] [PATCH v2] config.mk: use memoization in cc-option macro to speed up compilation

2011-11-05 Thread Daniel Schwierzeck
Hi Albert,

On 05.11.2011 10:16, Albert ARIBAUD wrote:
 Hi all,

 Le 04/11/2011 18:56, Wolfgang Denk a écrit :
 Dear Daniel Schwierzeck,

 In
 messageCACUy__XY1873+dT-s=-gypebq5hnysmywwt-gxexiwy97ec...@mail.gmail.com
 you wrote:

 Should we change it? is the semantic still the same?

 I'm not sure. At first reading it doesn't look really the same to me.

 They are not, at least for ELDK4.2.

 The only difference is in -mabi options, where the change would reduce
 -mabi=apcs-gnu -mabi=aapcs-linux to -mabi=aapcs-linux.

 apcs-gnu, IIUC, is 'old ABI', while 'aapcs-linux' is 'new ABI', aka
 eabi. Most of the toolchains I see are eabi (ELDK and CS notably). There
 may be 'old ABI' toolchains out there, but I don't think they are old
 ABI either.

 Anyway, I've just tried ./MAKEALL edminiv2 with ELD42 and a couple of CS
 toolchains, and nowhere in the log does -mabi=apcs-gnu show up -- the
 gcc invocations only have -mabi=aapcs-linux.

Looks like I read it wrong. So you always want -mabi=apcs-gnu 
-mabi=aapcs-linux -mno-thumb-interwork in $(PF_CPPFLAGS_ABI) with EABI? 
Sorry but I am not an ARM expert ;)


 I've also tested making ED Mini V2 with and without the patch but
 without Daniel's proposed change to arch/arm/config.mk, and there is no
 difference in build commands (except that for some reason the patch
 inserts multiple spaces between some gcc invocation options.

I guess this comes from making the macros more readable. Maybe I can 
optimize this.


 Daniel, what do you mean with does not work correctly?

that the generated cache file looks not right

CC_OPTIONS += -mabi=apcs-gnu
CC_OPTIONS_NOP += -mabi=apcs-gnu
CC_OPTIONS += -mno-thumb-interwork
CC_OPTIONS += -mabi=aapcs-linux -mno-thumb-interwork

But if you want -mabi=apcs-gnu -mabi=aapcs-linux -mno-thumb-interwork 
then it should already work correctly without my change in
arch/arm/config.mk.

Best regards,
Daniel

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


[U-Boot] [PATCH v4 0/9] tegra2: Tidy up boot path

2011-11-05 Thread Simon Glass
On Tegra2 the AVP runs the normal U-Boot code to a point, then halts and
the A9 takes over. The current Tegra2 boot path is fairly complex, since it
has a separate path and code for the Cortex-A9 and the AVP. In fact, they
can largely execute the same code path.

This series cleans up this logic and removes some parallel and un-needed
code.

Note this series is rebased against master, with the following patches
added, which should be picked up first:

http://patchwork.ozlabs.org/patch/122888/
http://patchwork.ozlabs.org/patch/122887/
http://patchwork.ozlabs.org/patch/122889/
http://patchwork.ozlabs.org/patch/118184/


Changes in v2:
- Move Makefile armv4t flags from arch/arm/lib to Tegra's config.mk
- Keep Tegra's config.mk file around so we can set the armv4t flags

Changes in v4:
- Revert series to version 1
- Rebase against master
- Use cp_init_cp15() name consistently

Simon Glass (9):
  tegra2: Add arch_cpu_init() to fire up Cortex-A9
  tegra2: Simplify tegra_start() boot path
  arm: Move CP15 init out of cpu_init_crit()
  tegra2: Enable instruction cache
  tegra2: Remove unneeded boot code
  tegra2: Remove unneeded config option
  tegra2: Remove unused low-level Tegra2 UART code
  tegra2: Remove unneeded 'dynamic ram size' message
  tegra2: Don't use board pointer before it is set up

 arch/arm/cpu/armv7/start.S|   36 +-
 arch/arm/cpu/armv7/tegra2/Makefile|5 +
 arch/arm/cpu/armv7/tegra2/ap20.c  |   54 +++--
 arch/arm/cpu/armv7/tegra2/ap20.h  |   10 +--
 arch/arm/cpu/armv7/tegra2/board.c |   35 -
 arch/arm/cpu/armv7/tegra2/config.mk   |7 +-
 arch/arm/cpu/armv7/tegra2/lowlevel_init.S |  118 -
 arch/arm/include/asm/u-boot-arm.h |3 +
 board/nvidia/common/board.c   |6 +-
 board/nvidia/common/board.h   |1 -
 drivers/serial/Makefile   |1 -
 drivers/serial/serial_tegra2.c|   77 ---
 drivers/serial/serial_tegra2.h|   29 ---
 include/configs/tegra2-common.h   |3 +-
 14 files changed, 84 insertions(+), 301 deletions(-)
 delete mode 100644 drivers/serial/serial_tegra2.c
 delete mode 100644 drivers/serial/serial_tegra2.h

-- 
1.7.3.1

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


[U-Boot] [PATCH v4 2/9] tegra2: Simplify tegra_start() boot path

2011-11-05 Thread Simon Glass
The Tegra2 boot path is more complicated than it needs to be. Since we want
to move to building most of U-Boot with ARMv7 and only a small part with
ARMv4T (for AVP) it should be as simple as possible.

This makes tegra2_start() into a simple function which either does AVP
init or A9 init depending on which core is running it. Both cores now
following the same init path, beginning at _start, and the special Tegra2
boot path code is no longer required.

Only two files need to be built for ARMv4T, and this is handled in the
Tegra2 CPU Makefile.

Signed-off-by: Simon Glass s...@chromium.org
---

 arch/arm/cpu/armv7/tegra2/Makefile |5 +++
 arch/arm/cpu/armv7/tegra2/ap20.c   |   54 +++
 arch/arm/cpu/armv7/tegra2/ap20.h   |3 ++
 3 files changed, 37 insertions(+), 25 deletions(-)

diff --git a/arch/arm/cpu/armv7/tegra2/Makefile 
b/arch/arm/cpu/armv7/tegra2/Makefile
index f0dc2ff..955c3b6 100644
--- a/arch/arm/cpu/armv7/tegra2/Makefile
+++ b/arch/arm/cpu/armv7/tegra2/Makefile
@@ -23,6 +23,11 @@
 # MA 02111-1307 USA
 #
 
+# The AVP is ARMv4T architecture so we must use special compiler
+# flags for any startup files it might use.
+CFLAGS_arch/arm/cpu/armv7/tegra2/ap20.o += -march=armv4t
+CFLAGS_arch/arm/cpu/armv7/tegra2/clock.o += -march=armv4t
+
 include $(TOPDIR)/config.mk
 
 LIB=  $(obj)lib$(SOC).o
diff --git a/arch/arm/cpu/armv7/tegra2/ap20.c b/arch/arm/cpu/armv7/tegra2/ap20.c
index 5cb4b1b..4c44bb3 100644
--- a/arch/arm/cpu/armv7/tegra2/ap20.c
+++ b/arch/arm/cpu/armv7/tegra2/ap20.c
@@ -31,7 +31,12 @@
 #include asm/arch/scu.h
 #include common.h
 
-u32 s_first_boot = 1;
+/* Returns 1 if the current CPU executing is a Cortex-A9, else 0 */
+static int ap20_cpu_is_cortexa9(void)
+{
+   u32 id = readb(NV_PA_PG_UP_BASE + PG_UP_TAG_0);
+   return id == (PG_UP_TAG_0_PID_CPU  0xff);
+}
 
 void init_pllx(void)
 {
@@ -283,38 +288,37 @@ void init_pmc_scratch(void)
writel(CONFIG_SYS_BOARD_ODMDATA, pmc-pmc_scratch20);
 }
 
-void cpu_start(void)
+void tegra2_start(void)
 {
struct pmux_tri_ctlr *pmt = (struct pmux_tri_ctlr *)NV_PA_APB_MISC_BASE;
 
-   /* enable JTAG */
-   writel(0xC0, pmt-pmt_cfg_ctl);
+   /* If we are the AVP, start up the first Cortex-A9 */
+   if (!ap20_cpu_is_cortexa9()) {
+   /* enable JTAG */
+   writel(0xC0, pmt-pmt_cfg_ctl);
 
-   if (s_first_boot) {
/*
-* Need to set this before cold-booting,
-*  otherwise we'll end up in an infinite loop.
-*/
-   s_first_boot = 0;
-   cold_boot();
+   * If we are ARM7 - give it a different stack. We are about to
+   * start up the A9 which will want to use this one.
+   */
+   asm volatile(ldr   sp, =%c0\n
+   : : i(AVP_EARLY_BOOT_STACK_LIMIT));
+
+   start_cpu((u32)_start);
+   halt_avp();
+   /* not reached */
}
-}
 
-void tegra2_start()
-{
-   if (s_first_boot) {
-   /* Init Debug UART Port (115200 8n1) */
-   uart_init();
+   /* Init PMC scratch memory */
+   init_pmc_scratch();
 
-   /* Init PMC scratch memory */
-   init_pmc_scratch();
-   }
+   enable_scu();
 
-#ifdef CONFIG_ENABLE_CORTEXA9
-   /* take the mpcore out of reset */
-   cpu_start();
+   /* enable SMP mode and FW for CPU0, by writing to Auxiliary Ctl reg */
+   asm volatile(
+   mrcp15, 0, r0, c1, c0, 1\n
+   orrr0, r0, #0x41\n
+   mcrp15, 0, r0, c1, c0, 1\n);
 
-   /* configure cache */
-   cache_configure();
-#endif
+   /* FIXME: should have ap20's L2 disabled too? */
 }
diff --git a/arch/arm/cpu/armv7/tegra2/ap20.h b/arch/arm/cpu/armv7/tegra2/ap20.h
index 49fe340..1bb48d6 100644
--- a/arch/arm/cpu/armv7/tegra2/ap20.h
+++ b/arch/arm/cpu/armv7/tegra2/ap20.h
@@ -102,3 +102,6 @@ void uart_init(void);
 void udelay(unsigned long);
 void cold_boot(void);
 void cache_configure(void);
+
+/* This is the main entry into U-Boot, used by the Cortex-A9 */
+extern void _start(void);
-- 
1.7.3.1

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


[U-Boot] [PATCH v4 6/9] tegra2: Remove unneeded config option

2011-11-05 Thread Simon Glass
CONFIG_ENABLE_CORTEXA9 and CONFIG_SKIP_RELOCATE_UBOOT are not needed,
so remove them.

Signed-off-by: Simon Glass s...@chromium.org
---

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

diff --git a/include/configs/tegra2-common.h b/include/configs/tegra2-common.h
index 16debf6..e233b1c 100644
--- a/include/configs/tegra2-common.h
+++ b/include/configs/tegra2-common.h
@@ -36,7 +36,6 @@
 #define CONFIG_SYS_CACHELINE_SIZE  32
 
 #define CONFIG_ARCH_CPU_INIT   /* Fire up the A9 core */
-#define CONFIG_ENABLE_CORTEXA9 /* enable CPU (A9 complex) */
 
 #include asm/arch/tegra2.h   /* get chip and board defs */
 
@@ -46,7 +45,6 @@
 #define CONFIG_DISPLAY_CPUINFO
 #define CONFIG_DISPLAY_BOARDINFO
 
-#define CONFIG_SKIP_RELOCATE_UBOOT
 #define CONFIG_SKIP_LOWLEVEL_INIT
 
 #define CONFIG_CMDLINE_TAG /* enable passing of ATAGs */
-- 
1.7.3.1

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


[U-Boot] [PATCH v4 9/9] tegra2: Don't use board pointer before it is set up

2011-11-05 Thread Simon Glass
In board_init_f() the gd-bd pointer is not valid when dram_init() is called.
This only avoids dying because DRAM is at zero on Tegra2. The common ARM
routine sets up the banks in the same way anyway, so we can just remove this
code.

Signed-off-by: Simon Glass s...@chromium.org
---

 arch/arm/cpu/armv7/tegra2/board.c |   10 +-
 1 files changed, 1 insertions(+), 9 deletions(-)

diff --git a/arch/arm/cpu/armv7/tegra2/board.c 
b/arch/arm/cpu/armv7/tegra2/board.c
index fbf189a..59dce8f 100644
--- a/arch/arm/cpu/armv7/tegra2/board.c
+++ b/arch/arm/cpu/armv7/tegra2/board.c
@@ -57,16 +57,8 @@ unsigned int query_sdram_size(void)
 
 int dram_init(void)
 {
-   unsigned long rs;
-
/* We do not initialise DRAM here. We just query the size */
-   gd-bd-bi_dram[0].start = PHYS_SDRAM_1;
-   gd-bd-bi_dram[0].size = gd-ram_size = query_sdram_size();
-
-   /* Now check it dynamically */
-   rs = get_ram_size(CONFIG_SYS_SDRAM_BASE, gd-ram_size);
-   if (rs)
-   gd-bd-bi_dram[0].size = gd-ram_size = rs;
+   gd-ram_size = query_sdram_size();
return 0;
 }
 
-- 
1.7.3.1

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


[U-Boot] [PATCH v4 8/9] tegra2: Remove unneeded 'dynamic ram size' message

2011-11-05 Thread Simon Glass
This message is not required, since it is followed by an 'official' U-Boot
message.

U-Boot 2011.03-00048-gd7cb0d3 (May 11 2011 - 17:17:23)

TEGRA2
Board: NVIDIA Seaboard
dynamic ram_size = 1073741824
DRAM:  1 GiB

becomes:

TEGRA2
Board: NVIDIA Seaboard
DRAM:  1 GiB

This is a separate commit since it changes behavior.

Signed-off-by: Simon Glass s...@chromium.org
---

 arch/arm/cpu/armv7/tegra2/board.c |4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/arch/arm/cpu/armv7/tegra2/board.c 
b/arch/arm/cpu/armv7/tegra2/board.c
index e6fe4fd..fbf189a 100644
--- a/arch/arm/cpu/armv7/tegra2/board.c
+++ b/arch/arm/cpu/armv7/tegra2/board.c
@@ -65,10 +65,8 @@ int dram_init(void)
 
/* Now check it dynamically */
rs = get_ram_size(CONFIG_SYS_SDRAM_BASE, gd-ram_size);
-   if (rs) {
-   printf(dynamic ram_size = %lu\n, rs);
+   if (rs)
gd-bd-bi_dram[0].size = gd-ram_size = rs;
-   }
return 0;
 }
 
-- 
1.7.3.1

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


[U-Boot] [PATCH v4 4/9] tegra2: Enable instruction cache

2011-11-05 Thread Simon Glass
Since low-level init is skipped, the instruction cache is never enabled on
Tegra2. This explicitly calls this initialization as soon as the A9 is
initialized.

Signed-off-by: Simon Glass s...@chromium.org
---

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

diff --git a/board/nvidia/common/board.c b/board/nvidia/common/board.c
index 56850cc..c806a6b 100644
--- a/board/nvidia/common/board.c
+++ b/board/nvidia/common/board.c
@@ -114,6 +114,9 @@ int board_init(void)
 #ifdef CONFIG_BOARD_EARLY_INIT_F
 int board_early_init_f(void)
 {
+   /* We didn't do this init in start.S, so do it now */
+   cpu_init_cp15();
+
/* Initialize essential common plls */
clock_early_init();
 
-- 
1.7.3.1

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


[U-Boot] [PATCH v4 1/9] tegra2: Add arch_cpu_init() to fire up Cortex-A9

2011-11-05 Thread Simon Glass
We want to move away from a special Tegra2 start-up, and just use
arch_cpu_init() instead. However, if we run board_init_f() from boot
we need to build it for ARMv4T, since the Tegra's AVP start-up CPU
does not support ARMv7.

The effect of this is to do the AVP init earlier, and in
arch_cpu_init(), rather that board_early_init_f().

Signed-off-by: Simon Glass s...@chromium.org
---
Changes in v2:
- Move Makefile armv4t flags from arch/arm/lib to Tegra's config.mk

 arch/arm/cpu/armv7/tegra2/board.c   |   15 +++
 arch/arm/cpu/armv7/tegra2/config.mk |6 ++
 board/nvidia/common/board.c |3 ---
 board/nvidia/common/board.h |1 -
 include/configs/tegra2-common.h |1 +
 5 files changed, 22 insertions(+), 4 deletions(-)

diff --git a/arch/arm/cpu/armv7/tegra2/board.c 
b/arch/arm/cpu/armv7/tegra2/board.c
index 751102d..4530194 100644
--- a/arch/arm/cpu/armv7/tegra2/board.c
+++ b/arch/arm/cpu/armv7/tegra2/board.c
@@ -23,6 +23,7 @@
 
 #include common.h
 #include asm/io.h
+#include ap20.h
 #include asm/arch/sys_proto.h
 #include asm/arch/tegra2.h
 #include asm/arch/pmc.h
@@ -86,3 +87,17 @@ int checkboard(void)
return 0;
 }
 #endif /* CONFIG_DISPLAY_BOARDINFO */
+
+#ifdef CONFIG_ARCH_CPU_INIT
+/*
+ * Note this function is executed by the ARM7TDMI AVP. It does not return
+ * in this case. It is also called once the A9 starts up, but does nothing in
+ * that case.
+ */
+int arch_cpu_init(void)
+{
+   /* Fire up the Cortex A9 */
+   tegra2_start();
+   return 0;
+}
+#endif
diff --git a/arch/arm/cpu/armv7/tegra2/config.mk 
b/arch/arm/cpu/armv7/tegra2/config.mk
index 96c0795..f84fdc8 100644
--- a/arch/arm/cpu/armv7/tegra2/config.mk
+++ b/arch/arm/cpu/armv7/tegra2/config.mk
@@ -26,3 +26,9 @@
 
 # Use ARMv4 for Tegra2 - initial code runs on the AVP, which is an ARM7TDI.
 PLATFORM_CPPFLAGS += -march=armv4
+
+# Tegra has an ARMv4T CPU which runs board_init_f(), so we must build this
+# file with compatible flags
+ifdef CONFIG_TEGRA2
+CFLAGS_arch/arm/lib/board.o += -march=armv4t
+endif
diff --git a/board/nvidia/common/board.c b/board/nvidia/common/board.c
index 0f12de2..56850cc 100644
--- a/board/nvidia/common/board.c
+++ b/board/nvidia/common/board.c
@@ -125,9 +125,6 @@ int board_early_init_f(void)
 
/* Initialize periph GPIOs */
gpio_config_uart();
-
-   /* Init UART, scratch regs, and start CPU */
-   tegra2_start();
return 0;
 }
 #endif /* EARLY_INIT */
diff --git a/board/nvidia/common/board.h b/board/nvidia/common/board.h
index 35acbca..1f57086 100644
--- a/board/nvidia/common/board.h
+++ b/board/nvidia/common/board.h
@@ -24,7 +24,6 @@
 #ifndef _BOARD_H_
 #define _BOARD_H_
 
-void tegra2_start(void);
 void gpio_config_uart(void);
 int tegra2_mmc_init(int dev_index, int bus_width, int pwr_gpio, int cd_gpio);
 
diff --git a/include/configs/tegra2-common.h b/include/configs/tegra2-common.h
index 9c3b9fa..16debf6 100644
--- a/include/configs/tegra2-common.h
+++ b/include/configs/tegra2-common.h
@@ -35,6 +35,7 @@
 
 #define CONFIG_SYS_CACHELINE_SIZE  32
 
+#define CONFIG_ARCH_CPU_INIT   /* Fire up the A9 core */
 #define CONFIG_ENABLE_CORTEXA9 /* enable CPU (A9 complex) */
 
 #include asm/arch/tegra2.h   /* get chip and board defs */
-- 
1.7.3.1

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


[U-Boot] [PATCH v4 3/9] arm: Move CP15 init out of cpu_init_crit()

2011-11-05 Thread Simon Glass
Some SOCs have do not start up with their 'main' CPU. The first U-Boot
code may then be executed with a CPU which does not have a CP15, or not a
useful one.

Here we split the initialization of CP15 into a separate call, which can
be performed later if required.

Once the main CPU is running, you should call cpu_init_cp15() to perform
this init as early as possible.

Existing ARMv7 boards which define CONFIG_SKIP_LOWLEVEL_INIT should not
need to change, this CP15 init is still skipped in that case. The only
impact for these boards is that the cpu_init_cp15() will be available
even if it is never used on these boards.

Signed-off-by: Simon Glass s...@chromium.org
---
Changes in v4:
- Revert series to version 1
- Rebase against master
- Use cp_init_cp15() name consistently

 arch/arm/cpu/armv7/start.S|   24 ++--
 arch/arm/include/asm/u-boot-arm.h |3 +++
 2 files changed, 21 insertions(+), 6 deletions(-)

diff --git a/arch/arm/cpu/armv7/start.S b/arch/arm/cpu/armv7/start.S
index db8e9d2..299161d 100644
--- a/arch/arm/cpu/armv7/start.S
+++ b/arch/arm/cpu/armv7/start.S
@@ -168,6 +168,7 @@ next:
 #endif
/* the mask ROM code should have PLL and others stable */
 #ifndef CONFIG_SKIP_LOWLEVEL_INIT
+   bl  cpu_init_cp15
bl  cpu_init_crit
 #endif
 
@@ -305,17 +306,16 @@ jump_2_ram:
 _board_init_r_ofs:
.word board_init_r - _start
 
-
-#ifndef CONFIG_SKIP_LOWLEVEL_INIT
 /*
  *
- * CPU_init_critical registers
+ * cpu_init_cp15
  *
- * setup important registers
- * setup memory timing
+ * Setup CP15 registers (cache, MMU, TLBs). The I-cache is turned on unless
+ * CONFIG_SYS_ICACHE_OFF is defined.
  *
  */
-cpu_init_crit:
+.globl cpu_init_cp15
+cpu_init_cp15:
/*
 * Invalidate L1 I/D
 */
@@ -340,7 +340,19 @@ cpu_init_crit:
orr r0, r0, #0x1000 @ set bit 12 (I) I-cache
 #endif
mcr p15, 0, r0, c1, c0, 0
+   mov pc, lr  @ back to my caller
 
+
+#ifndef CONFIG_SKIP_LOWLEVEL_INIT
+/*
+ *
+ * CPU_init_critical registers
+ *
+ * setup important registers
+ * setup memory timing
+ *
+ */
+cpu_init_crit:
/*
 * Jump to board specific initialization...
 * The Mask ROM will have already initialized
diff --git a/arch/arm/include/asm/u-boot-arm.h 
b/arch/arm/include/asm/u-boot-arm.h
index d3308f7..4ca75f9 100644
--- a/arch/arm/include/asm/u-boot-arm.h
+++ b/arch/arm/include/asm/u-boot-arm.h
@@ -46,6 +46,9 @@ extern ulong IRQ_STACK_START_IN;  /* 8 bytes in IRQ stack 
*/
 intcpu_init(void);
 intcleanup_before_linux(void);
 
+/* Set up ARMv7 MMU, caches and TLBs */
+void   cpu_init_cp15(void);
+
 /* cpu/.../arch/cpu.c */
 intarch_cpu_init(void);
 intarch_misc_init(void);
-- 
1.7.3.1

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


[U-Boot] [PATCH v4 5/9] tegra2: Remove unneeded boot code

2011-11-05 Thread Simon Glass
Since we have cache support built in we can remove Tegra's existing cache
initialization code amd other related dead code.

Signed-off-by: Simon Glass s...@chromium.org
---
Changes in v2:
- Keep Tegra's config.mk file around so we can set the armv4t flags

 arch/arm/cpu/armv7/start.S|   12 ---
 arch/arm/cpu/armv7/tegra2/ap20.h  |7 +--
 arch/arm/cpu/armv7/tegra2/board.c |8 --
 arch/arm/cpu/armv7/tegra2/config.mk   |3 -
 arch/arm/cpu/armv7/tegra2/lowlevel_init.S |  118 -
 5 files changed, 1 insertions(+), 147 deletions(-)

diff --git a/arch/arm/cpu/armv7/start.S b/arch/arm/cpu/armv7/start.S
index 299161d..63ed7c1 100644
--- a/arch/arm/cpu/armv7/start.S
+++ b/arch/arm/cpu/armv7/start.S
@@ -81,18 +81,6 @@ _end_vect:
 _TEXT_BASE:
.word   CONFIG_SYS_TEXT_BASE
 
-#ifdef CONFIG_TEGRA2
-/*
- * Tegra2 uses 2 separate CPUs - the AVP (ARM7TDMI) and the CPU (dual A9s).
- * U-Boot runs on the AVP first, setting things up for the CPU (PLLs,
- * muxes, clocks, clamps, etc.). Then the AVP halts, and expects the CPU
- * to pick up its reset vector, which points here.
- */
-.globl _armboot_start
-_armboot_start:
-   .word _start
-#endif
-
 /*
  * These are defined in the board-specific linker script.
  */
diff --git a/arch/arm/cpu/armv7/tegra2/ap20.h b/arch/arm/cpu/armv7/tegra2/ap20.h
index 1bb48d6..a4b4d73 100644
--- a/arch/arm/cpu/armv7/tegra2/ap20.h
+++ b/arch/arm/cpu/armv7/tegra2/ap20.h
@@ -95,13 +95,8 @@
 #define HALT_COP_EVENT_IRQ_1   (1  11)
 #define HALT_COP_EVENT_FIQ_1   (1  9)
 
-/* Prototypes */
-
+/* Start up the tegra2 SOC */
 void tegra2_start(void);
-void uart_init(void);
-void udelay(unsigned long);
-void cold_boot(void);
-void cache_configure(void);
 
 /* This is the main entry into U-Boot, used by the Cortex-A9 */
 extern void _start(void);
diff --git a/arch/arm/cpu/armv7/tegra2/board.c 
b/arch/arm/cpu/armv7/tegra2/board.c
index 4530194..e6fe4fd 100644
--- a/arch/arm/cpu/armv7/tegra2/board.c
+++ b/arch/arm/cpu/armv7/tegra2/board.c
@@ -55,14 +55,6 @@ unsigned int query_sdram_size(void)
}
 }
 
-void s_init(void)
-{
-#ifndef CONFIG_ICACHE_OFF
-   icache_enable();
-#endif
-   invalidate_dcache();
-}
-
 int dram_init(void)
 {
unsigned long rs;
diff --git a/arch/arm/cpu/armv7/tegra2/config.mk 
b/arch/arm/cpu/armv7/tegra2/config.mk
index f84fdc8..8f9bdc9 100644
--- a/arch/arm/cpu/armv7/tegra2/config.mk
+++ b/arch/arm/cpu/armv7/tegra2/config.mk
@@ -24,9 +24,6 @@
 # MA 02111-1307 USA
 #
 
-# Use ARMv4 for Tegra2 - initial code runs on the AVP, which is an ARM7TDI.
-PLATFORM_CPPFLAGS += -march=armv4
-
 # Tegra has an ARMv4T CPU which runs board_init_f(), so we must build this
 # file with compatible flags
 ifdef CONFIG_TEGRA2
diff --git a/arch/arm/cpu/armv7/tegra2/lowlevel_init.S 
b/arch/arm/cpu/armv7/tegra2/lowlevel_init.S
index f24a2ff..6b86647 100644
--- a/arch/arm/cpu/armv7/tegra2/lowlevel_init.S
+++ b/arch/arm/cpu/armv7/tegra2/lowlevel_init.S
@@ -26,14 +26,6 @@
 #include config.h
 #include version.h
 
-
-_TEXT_BASE:
-   .word   CONFIG_SYS_TEXT_BASE@ sdram load addr from config file
-
-.global invalidate_dcache
-invalidate_dcache:
-   mov pc, lr
-
.align  5
 .global reset_cpu
 reset_cpu:
@@ -47,113 +39,3 @@ _loop_forever:
b   _loop_forever
 rstctl:
.word   PRM_RSTCTRL
-
-.globl lowlevel_init
-lowlevel_init:
-   ldr sp, SRAM_STACK
-   str ip, [sp]
-   mov ip, lr
-   bl  s_init  @ go setup pll, mux  memory
-   ldr ip, [sp]
-   mov lr, ip
-
-   mov pc, lr  @ back to arch calling code
-
-
-.globl startup_cpu
-startup_cpu:
-   @ Initialize the AVP, clocks, and memory controller
-   @ SDRAM is guaranteed to be on at this point
-
-   ldr r0, =cold_boot  @ R0 = reset vector for CPU
-   bl  start_cpu   @ start the CPU
-
-   @ Transfer control to the AVP code
-   bl  halt_avp
-
-   @ Should never get here
-_loop_forever2:
-   b   _loop_forever2
-
-.globl cache_configure
-cache_configure:
-   stmdb   r13!,{r14}
-   @ invalidate instruction cache
-   mov r1, #0
-   mcr p15, 0, r1, c7, c5, 0
-
-   @ invalidate the id tlb entries
-   mcr p15, 0, r1, c8, c5, 0
-   mcr p15, 0, r1, c8, c6, 0
-
-   @ enable instruction cache
-   mrc p15, 0, r1, c1, c0, 0
-   orr r1, r1, #(112)
-   mcr p15, 0, r1, c1, c0, 0
-
-   bl  enable_scu
-
-   @ enable SMP mode and FW for CPU0, by writing to Auxiliary Ctl reg
-   mrc p15, 0, r0, c1, c0, 1
-   orr r0, r0, #0x41
-   mcr p15, 0, r0, c1, c0, 1
-
-   @ Now flush the Dcache
-   mov r0, #0
-   @ 256 cache lines
-   mov r1, #256
-
-invalidate_loop:
-   add r1, r1, #-1
-   mov r0, r1, lsl #5
-   @ 

[U-Boot] [PATCH v4 7/9] tegra2: Remove unused low-level Tegra2 UART code

2011-11-05 Thread Simon Glass
This was used by the AVP in early boot but is no longer used. Unless we
plan to enable it somehow it is not needed. In any case we should try
to use the ns16550 driver instead as it has the same code.

Signed-off-by: Simon Glass s...@chromium.org
---

 drivers/serial/Makefile|1 -
 drivers/serial/serial_tegra2.c |   77 
 drivers/serial/serial_tegra2.h |   29 ---
 3 files changed, 0 insertions(+), 107 deletions(-)
 delete mode 100644 drivers/serial/serial_tegra2.c
 delete mode 100644 drivers/serial/serial_tegra2.h

diff --git a/drivers/serial/Makefile b/drivers/serial/Makefile
index 6309549..616b857 100644
--- a/drivers/serial/Makefile
+++ b/drivers/serial/Makefile
@@ -55,7 +55,6 @@ COBJS-$(CONFIG_S3C44B0_SERIAL) += serial_s3c44b0.o
 COBJS-$(CONFIG_XILINX_UARTLITE) += serial_xuartlite.o
 COBJS-$(CONFIG_SANDBOX_SERIAL) += sandbox.o
 COBJS-$(CONFIG_SCIF_CONSOLE) += serial_sh.o
-COBJS-$(CONFIG_TEGRA2) += serial_tegra2.o
 
 ifndef CONFIG_SPL_BUILD
 COBJS-$(CONFIG_USB_TTY) += usbtty.o
diff --git a/drivers/serial/serial_tegra2.c b/drivers/serial/serial_tegra2.c
deleted file mode 100644
index 8ff34ea..000
--- a/drivers/serial/serial_tegra2.c
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- *  (C) Copyright 2010,2011
- *  NVIDIA Corporation www.nvidia.com
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-#include common.h
-#include ns16550.h
-#include asm/io.h
-#include asm/arch/tegra2.h
-#include serial_tegra2.h
-
-static void setup_uart(struct uart_ctlr *u)
-{
-   u32 reg;
-
-   /* Prepare the divisor value */
-   reg = NVRM_PLLP_FIXED_FREQ_KHZ * 1000 / NV_DEFAULT_DEBUG_BAUD / 16;
-
-   /* Set up UART parameters */
-   writel(UART_LCR_DLAB, u-uart_lcr);
-   writel(reg, u-uart_thr_dlab_0);
-   writel(0, u-uart_ier_dlab_0);
-   writel(0, u-uart_lcr);/* clear DLAB */
-   writel((UART_FCR_TRIGGER_3 | UART_FCR_FIFO_EN | \
-   UART_FCR_CLEAR_XMIT | UART_FCR_CLEAR_RCVR), u-uart_iir_fcr);
-   writel(0, u-uart_ier_dlab_0);
-   writel(UART_LCR_WLS_8, u-uart_lcr);   /* 8N1 */
-   writel(UART_MCR_RTS, u-uart_mcr);
-   writel(0, u-uart_msr);
-   writel(0, u-uart_spr);
-   writel(0, u-uart_irda_csr);
-   writel(0, u-uart_asr);
-   writel((UART_FCR_TRIGGER_3 | UART_FCR_FIFO_EN), u-uart_iir_fcr);
-
-   /* Flush any old characters out of the RX FIFO */
-   reg = readl(u-uart_lsr);
-
-   while (reg  UART_LSR_DR) {
-   reg = readl(u-uart_thr_dlab_0);
-   reg = readl(u-uart_lsr);
-   }
-}
-
-/*
- * Routine: uart_init
- * Description: init the UART clocks, muxes, and baudrate/parity/etc.
- */
-void uart_init(void)
-{
-   struct uart_ctlr *uart = (struct uart_ctlr *)NV_PA_APB_UARTD_BASE;
-#if defined(CONFIG_TEGRA2_ENABLE_UARTD)
-   setup_uart(uart);
-#endif /* CONFIG_TEGRA2_ENABLE_UARTD */
-#if defined(CONFIG_TEGRA2_ENABLE_UARTA)
-   uart = (struct uart_ctlr *)NV_PA_APB_UARTA_BASE;
-
-   setup_uart(uart);
-#endif /* CONFIG_TEGRA2_ENABLE_UARTA */
-}
diff --git a/drivers/serial/serial_tegra2.h b/drivers/serial/serial_tegra2.h
deleted file mode 100644
index 5704800..000
--- a/drivers/serial/serial_tegra2.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- *  (C) Copyright 2010,2011
- *  NVIDIA Corporation www.nvidia.com
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-#ifndef _SERIAL_TEGRA_H_
-#define _SERIAL_TEGRA_H_
-

Re: [U-Boot] [PATCH 3/9] arm: Move CP15 init out of cpu_init_crit()

2011-11-05 Thread Simon Glass
Hi Albert,

On Sat, Nov 5, 2011 at 1:17 AM, Albert ARIBAUD
albert.u.b...@aribaud.net wrote:
 Hi Simon,

 Going back to this version of the patch as indicated, I notice something
 weird:

 Le 13/10/2011 23:05, Simon Glass a écrit :

 Some SOCs have do not start up with their 'main' CPU. The first U-Boot
 code may then be executed with a CPU which does not have a CP15, or not a
 useful one.

 Here we split the initialization of CP15 into a separate call, which can
 be performed later if required.

 Once the main CPU is running, you should call cpu_init_cp15() to perform
 this init as early as possible.

 Existing ARMv7 boards which define CONFIG_SKIP_LOWLEVEL_INIT should not
 need to change, this CP15 init is still skipped in that case. The only
 impact for these boards is that the cpu_init_cp15() will be available
 even if it is never used on these boards.

 Signed-off-by: Simon Glasss...@chromium.org
 ---
  arch/arm/cpu/armv7/start.S        |   24 ++--
  arch/arm/include/asm/u-boot-arm.h |    3 +++
  2 files changed, 21 insertions(+), 6 deletions(-)

 diff --git a/arch/arm/cpu/armv7/start.S b/arch/arm/cpu/armv7/start.S
 index db8e9d2..7fdd422 100644
 --- a/arch/arm/cpu/armv7/start.S
 +++ b/arch/arm/cpu/armv7/start.S
 @@ -168,6 +168,7 @@ next:
  #endif
        /* the mask ROM code should have PLL and others stable */
  #ifndef CONFIG_SKIP_LOWLEVEL_INIT
 +       bl      cpu_reset_cp15
        bl      cpu_init_crit
  #endif

 @@ -305,17 +306,16 @@ jump_2_ram:
  _board_init_r_ofs:
        .word board_init_r - _start

 -
 -#ifndef CONFIG_SKIP_LOWLEVEL_INIT

  /*
   *
 - * CPU_init_critical registers
 + * cpu_reset_cp15
   *
 - * setup important registers
 - * setup memory timing
 + * Setup CP15 registers (cache, MMU, TLBs). The I-cache is turned on
 unless
 + * CONFIG_SYS_ICACHE_OFF is defined.
   *

 */
 -cpu_init_crit:
 +.globl cpu_init_cp15
 +cpu_init_cp15:

 Seems like half this patch says 'cpu_reset_cp15' and then the second half
 says 'cpu_init_cp15' (I prefer 'cpu_init_cp15').

Given this and the activity in the past 3 weeks I have done a new
serial v4 with a rebase and this fixed. The only change I made to the
series was in this one patch to correct the first call to
cpu_init_cp15 and update the comment. But I suggest you pick up this
new series to avoid conflicts.

Regards,
Simon


        /*
         * Invalidate L1 I/D
         */
 @@ -340,7 +340,19 @@ cpu_init_crit:
        orr     r0, r0, #0x1000     @ set bit 12 (I) I-cache
  #endif
        mcr     p15, 0, r0, c1, c0, 0
 +       mov     pc, lr                  @ back to my caller

 +
 +#ifndef CONFIG_SKIP_LOWLEVEL_INIT

 +/*
 + *
 + * CPU_init_critical registers
 + *
 + * setup important registers
 + * setup memory timing
 + *
 +
 */
 +cpu_init_crit:
        /*
         * Jump to board specific initialization...
         * The Mask ROM will have already initialized
 diff --git a/arch/arm/include/asm/u-boot-arm.h
 b/arch/arm/include/asm/u-boot-arm.h
 index d3308f7..4ca75f9 100644
 --- a/arch/arm/include/asm/u-boot-arm.h
 +++ b/arch/arm/include/asm/u-boot-arm.h
 @@ -46,6 +46,9 @@ extern ulong IRQ_STACK_START_IN;      /* 8 bytes in IRQ
 stack */
  int   cpu_init(void);
  int   cleanup_before_linux(void);

 +/* Set up ARMv7 MMU, caches and TLBs */
 +void   cpu_init_cp15(void);
 +
  /* cpu/.../arch/cpu.c */
  int   arch_cpu_init(void);
  int   arch_misc_init(void);

 Amicalement,
 --
 Albert.

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


Re: [U-Boot] [PATCH] arm: jadecpu: Readd MACH_TYPE_JADECPU

2011-11-05 Thread Albert ARIBAUD
Le 05/11/2011 14:26, Wolfgang Denk a écrit :
 Dear Albert ARIBAUD,

 In message4eb514c7.9000...@aribaud.net  you wrote:

 +#ifndef MACH_TYPE_JADECPU
 +#define MACH_TYPE_JADECPU  2636
 +#endif

 NAK -- remove ifndef/endif around definition. This way, if/when mach
 type reappears in official mach-type.h, we will get a warning about your
 mach-type being defined twice.

 Note that you will only get a warning if a _different_ value get's
 defined (``warning: VAR redefined'').  If both values are the same,
 no warning will be raised.

Hmm, correct. In order to catch the mach-type creeping back in 
mach-types.h, we'd need to define something like

#define MACH_TYPE_JADECPU   (2636)

I'll post an ARM-global patch for this, but as it will obviously not be 
a bugfix, it'll wait until next merge window.

 Best regards,

 Wolfgang Denk

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


Re: [U-Boot] About the pull request and patchwork

2011-11-05 Thread Wolfgang Denk
Dear =?UTF-8?B?6aas5YWL5rOh?=,

In message CACCg+XPzirovdMwQbXBZQMxcPz161n=z9h2hntyuzrdbwh3...@mail.gmail.com 
you wrote:
 
 I think if we (custodians) could assigned the pull request as accept
 or something after Wolfgang
 has pull the commits from downstream will be good.
 What do you guys think about it?

I wrote before that I would really appreciate if _anybody_ who notices
incorrect / obsolete states oin Patchwork could please update these.

Unlike as for normal patches, I didn't find a way yet to auto-update
the status for pull requests in PW.


So yes, please, if you notice such inconsistencies, help out and
update the status as needed.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
A good aphorism is too hard for the tooth of time, and  is  not  worn
away  by  all  the  centuries,  although  it serves as food for every
epoch.  - Friedrich Wilhelm Nietzsche
  _Miscellaneous Maxims and Opinions_ no. 168
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] mx5: Correct a warning in clock.c

2011-11-05 Thread Simon Glass
This corects the warning below, obtained with my gcc 4.6 compiler.

arch/arm/cpu/armv7/mx5/libmx5.o: In function `decode_pll':
arch/arm/cpu/armv7/mx5/clock.c:94: undefined reference to `__aeabi_uldivmod'

I am not able to test this on MX5x hardware, but it does improve the
MAKEALL output for me. You may already have a similar patch, but I cannot
see it on the list.

Signed-off-by: Simon Glass s...@chromium.org
---
 arch/arm/cpu/armv7/mx5/clock.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/cpu/armv7/mx5/clock.c b/arch/arm/cpu/armv7/mx5/clock.c
index 0769a64..933ce05 100644
--- a/arch/arm/cpu/armv7/mx5/clock.c
+++ b/arch/arm/cpu/armv7/mx5/clock.c
@@ -91,7 +91,7 @@ static uint32_t decode_pll(struct mxc_pll_reg *pll, uint32_t 
infreq)
if (ctrl  MXC_DPLLC_CTL_DPDCK0_2_EN)
refclk *= 2;
 
-   refclk /= pdf + 1;
+   do_div(refclk, pdf + 1);
temp = refclk * mfn_abs;
do_div(temp, mfd + 1);
ret = refclk * mfi;
-- 
1.7.3.1

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


Re: [U-Boot] About the pull request and patchwork

2011-11-05 Thread 馬克泡
Hi all,

2011/11/5 Wolfgang Denk w...@denx.de:
 Dear =?UTF-8?B?6aas5YWL5rOh?=,

 In message 
 CACCg+XPzirovdMwQbXBZQMxcPz161n=z9h2hntyuzrdbwh3...@mail.gmail.com you 
 wrote:
 I wrote before that I would really appreciate if _anybody_ who notices
 incorrect / obsolete states oin Patchwork could please update these.

 Unlike as for normal patches, I didn't find a way yet to auto-update
 the status for pull requests in PW.


 So yes, please, if you notice such inconsistencies, help out and
 update the status as needed.


Maybe a perl or a python script is need to auto update the patchwork status
by analyzing the table format of patckwork.
Is this possible?

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


Re: [U-Boot] [PATCH 2/2] mvgbe: fix network device indices

2011-11-05 Thread Albert ARIBAUD
Hi Wolfgang,

Le 05/11/2011 14:21, Wolfgang Denk a écrit :
 Dear Albert ARIBAUD,

 In message4eb507b7.9090...@aribaud.net  you wrote:

 But what about MAC randomization as a function provided by the SoC level
 to board MAC init code that wants to use it? For instance, a weak MAC
 setup function provided by the SoC level, and the board level would use
 it or provide its own.

 What would be the result?  A bord that comes up with a new MAC address
 each time you reset it?

No -- the goal of the randomization code was, is, and will be to allow 
the board to use the network when no correct MAC address can be found 
anywhere (env vars, EEPROM, e-fuses, whatever). When a correct address 
is available, that address will be used. Typically, this happens when 
the board has not been provisioned yet, at a point where the MAC address 
it uses is not relevant yet.

Notes:

1. This code would only be available to kirkwood-based boards anyway.

2. Although the code incorrectly describes it as private, the random 
address is actually a locally administered address (bit 1 of first octet 
is set), which eliminates the risk of clashing against any 'normal' 
(universally administered) address; and its last three octets are 
randomized in order to limit the risk of clashing against other locally 
administered addresses if we're unlucky enough to have any on the 
network segment.

 Best regards,

 Wolfgang Denk

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


Re: [U-Boot] [PATCH v2 3/8] tegra2: spi: Add SPI driver for Tegra2 SOC

2011-11-05 Thread Simon Glass
Hi Mike,

On Thu, Nov 3, 2011 at 6:36 PM, Mike Frysinger vap...@gentoo.org wrote:
 On Thursday 03 November 2011 18:41:34 Simon Glass wrote:
 --- a/arch/arm/include/asm/arch-tegra2/tegra2.h
 +++ b/arch/arm/include/asm/arch-tegra2/tegra2.h

  #define NV_PA_APB_UARTC_BASE (NV_PA_APB_MISC_BASE + 0x6200)
  #define NV_PA_APB_UARTD_BASE (NV_PA_APB_MISC_BASE + 0x6300)
  #define NV_PA_APB_UARTE_BASE (NV_PA_APB_MISC_BASE + 0x6400)
 +#define TEGRA2_SPI_BASE              (NV_PA_APB_MISC_BASE + 0xC380)
  #define NV_PA_PMC_BASE               0x7000E400
  #define NV_PA_CSITE_BASE     0x7004

 shouldn't it use the same naming convention ?  NV__SPI_BASE ?

Actually we are moving away from this - the prefixes just obfuscate
the meaning. A later patch will tidy this up a little.


 --- /dev/null
 +++ b/drivers/spi/tegra2_spi.c

 +int spi_cs_is_valid(unsigned int bus, unsigned int cs)
 +{
 +     /* Tegra2 SPI-Flash - only 1 device ('bus/cs') */
 +     if (bus  0  cs != 0)
 +             return 0;
 +     else
 +             return 1;
 +}

 shouldn't that be || and not  ?

This function should be removed as it doesn't print enough errors.


 +struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs,
 +             unsigned int max_hz, unsigned int mode)
 +{
 +     struct tegra_spi_slave *spi;
 +
 +     if (!spi_cs_is_valid(bus, cs))
 +             return NULL;
 +
 +     if (bus != 0) {
 +             printf(SPI error: unsupported bus %d\n, bus);
 +             return NULL;
 +     }
 +     if (cs != 0) {
 +             printf(SPI error: unsupported chip select %d on bus %d\n,
 +                    cs, bus);
 +             return NULL;
 +     }

 doesn't spi_cs_is_valid() make these two later checks redundant ?

Yes - have removed the function.


 +     if (mode  SPI_MODE_3) {
 +             printf(SPI error: unsupported SPI mode %i\n, mode);
 +             return NULL;
 +     }

 this is weird ... i'd just drop it as this isn't something that should be in
 spi drivers, but rather the common layer (if we choose to do so)

OK


 +int spi_xfer(struct spi_slave *slave, unsigned int bitlen,
 +             const void *data_out, void *data_in, unsigned long flags)
 +{
 ...
 +     if (bitlen  7)
 +             return -1;

 i'd use (bitlen % 8) as that is what all the other drivers are doing

OK


 +     reg = readl(regs-status);
 +     writel(reg, regs-status);     /* Clear all SPI events via R/W */

 are these R1C or W1C bits ?  if the latter, you could just write -1 and avoid
 the read altogether ...
 -mike


The next line is:

debug(spi_xfer entry: STATUS = %08x\n, reg);

and I didn't want to remove that, so I need to keep the read
unfortunately. It could perhaps be this if you are keen:

writel(-1, regs-status);     /* Clear all SPI events via R/W */
debug(spi_xfer entry: STATUS = %08x\n, readl(reg-status));

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


Re: [U-Boot] [PATCH v2 6/8] tegra2: Implement SPI / UART GPIO switch

2011-11-05 Thread Simon Glass
Hi Mike,

On Thu, Nov 3, 2011 at 6:44 PM, Mike Frysinger vap...@gentoo.org wrote:
 On Thursday 03 November 2011 18:41:37 Simon Glass wrote:
 Since we are adding a second file to board/nvidia/common, we create
 a proper Makefile there and remove the direct board.o include from
 board/nvidia/seaboard/Makefile

 so who is including board/nvidia/common/libnvidia.o now ?

No one - it doesn't exist and that directory doesn't have a Makefile.
The top-level Makefile doesn't require it, but since I now have more
than one object file I want to create a library.


 --- /dev/null
 +++ b/arch/arm/include/asm/arch-tegra2/uart-spi-switch.h

 +#ifndef __ASSEMBLY__

 the asm checking is incomplete.  so it must not matter - drop it.

OK

 --- /dev/null
 +++ b/board/nvidia/common/uart-spi-switch.c

 +#include asm/io.h
 +#include libfdt.h
 +#include fdt_support.h

 seems to be unused
 -mike


OK - yes this isn't needed until FDT support is in there (will be a
later patch set).

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


[U-Boot] [PATCH v3 0/8] tegra2: Implement SPI flash and saved environment

2011-11-05 Thread Simon Glass
Enable SPI flash on the Tegra2 Seaboard along with a saved 8KB environment.
This involves a few pieces:

- Tegra2 SPI driver
- Seaboard config changes
- a SPI / UART switch to handle switching between SPI and console UART

This series applies cleanly on top of Stephen Warren's latest patch series

http://patchwork.ozlabs.org/project/uboot/list/?submitter=Stephen+Warrenstate=*q=v7

(the first patch of which is already applied)

and also requires Stephen's GPIO fix.

http://patchwork.ozlabs.org/patch/118184/

Still to come are the NS16550 driver changes to cope with the pins
disappearing from under it. This patch series has been NAKed, the XON/XOFF
series won't really help and it isn't clear exactly what to do here. I
will return to this another day.

http://patchwork.ozlabs.org/patch/120013/

This patch series has been tested on Seaboard and other Tegra2 hardware.

Changes in v2:
- Update to support SPI mode and frequency
- Tidy driver according to comments, and tidy a little more
- Add CONFIG_SPI_FLASH_SIZE to define flash size
- Add config for SPI environment mode/speed
- Fix up GPIO selection to use gpio_request() first
- Rename uart-spi-fix to uart-spi-switch
- Rename uart/spi_enable() to pinmux_select_uart/spi()
- Add pinmux logic to SPI driver

Changes in v3:
- Remove the replaced bus/cs check function
- Change (bitlen  7) to (bitlen % 8)
- Remove unneeded #includes and header file guard

Simon Glass (7):
  tegra2: Tidy UART selection
  tegra2: Add UARTB support
  tegra2: config: Enable SPI flash on Seaboard
  tegra2: Enable SPI environment on Seaboard
  tegra2: Implement SPI / UART GPIO switch
  tegra2: spi: Support SPI / UART switch
  tegra2: Plumb in SPI/UART switch code

Tom Warren (1):
  tegra2: spi: Add SPI driver for Tegra2 SOC

 arch/arm/include/asm/arch-tegra2/tegra2.h  |1 +
 arch/arm/include/asm/arch-tegra2/tegra2_spi.h  |   76 ++
 arch/arm/include/asm/arch-tegra2/uart-spi-switch.h |   46 
 board/nvidia/common/Makefile   |   47 
 board/nvidia/common/board.c|   79 --
 board/nvidia/common/board.h|1 +
 board/nvidia/common/uart-spi-switch.c  |  138 ++
 board/nvidia/seaboard/Makefile |1 -
 board/nvidia/seaboard/seaboard.c   |3 +
 drivers/spi/Makefile   |1 +
 drivers/spi/tegra2_spi.c   |  274 
 include/configs/harmony.h  |3 +
 include/configs/seaboard.h |   20 ++
 include/configs/tegra2-common.h|3 +-
 14 files changed, 667 insertions(+), 26 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-tegra2/tegra2_spi.h
 create mode 100644 arch/arm/include/asm/arch-tegra2/uart-spi-switch.h
 create mode 100644 board/nvidia/common/Makefile
 create mode 100644 board/nvidia/common/uart-spi-switch.c
 create mode 100644 drivers/spi/tegra2_spi.c

-- 
1.7.3.1

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


[U-Boot] [PATCH v3 8/8] tegra2: Plumb in SPI/UART switch code

2011-11-05 Thread Simon Glass
On Seaboard the UART and SPI interfere with each other. This causes the UART
to receive spurious zero bytes after SPI transactions and also means that
SPI can corrupt a few output characters when it starts up if they are still
in the UART buffer.

This updates the board to use the SPI/UART switch to avoid the problem.

For now this feature is turned off since it needs changes to the NS16550
UART to operate.

Signed-off-by: Simon Glass s...@chromium.org
---

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

diff --git a/board/nvidia/common/board.c b/board/nvidia/common/board.c
index 2591ebc..0403645 100644
--- a/board/nvidia/common/board.c
+++ b/board/nvidia/common/board.c
@@ -112,9 +112,13 @@ static void pin_mux_uart(int uart_ids)
  */
 int board_init(void)
 {
+   /* Do clocks and UART first so that printf() works */
clock_init();
clock_verify();
 
+#ifdef CONFIG_SPI_UART_SWITCH
+   gpio_config_uart();
+#endif
 #ifdef CONFIG_TEGRA2_SPI
spi_init();
 #endif
@@ -149,7 +153,11 @@ int board_early_init_f(void)
pin_mux_uart(uart_ids);
 
/* Initialize periph GPIOs */
+#ifdef CONFIG_SPI_UART_SWITCH
+   gpio_early_init_uart();
+#else
gpio_config_uart();
+#endif
 
/* Init UART, scratch regs, and start CPU */
tegra2_start();
diff --git a/board/nvidia/common/board.h b/board/nvidia/common/board.h
index 35acbca..2c89ff4 100644
--- a/board/nvidia/common/board.h
+++ b/board/nvidia/common/board.h
@@ -27,5 +27,6 @@
 void tegra2_start(void);
 void gpio_config_uart(void);
 int tegra2_mmc_init(int dev_index, int bus_width, int pwr_gpio, int cd_gpio);
+void gpio_early_init_uart(void);
 
 #endif /* BOARD_H */
diff --git a/board/nvidia/seaboard/seaboard.c b/board/nvidia/seaboard/seaboard.c
index 7f2827b..0b779f6 100644
--- a/board/nvidia/seaboard/seaboard.c
+++ b/board/nvidia/seaboard/seaboard.c
@@ -31,6 +31,8 @@
 #endif
 #include ../common/board.h
 
+/* TODO: Remove this code when the SPI switch is working */
+#ifndef CONFIG_SPI_UART_SWITCH
 /*
  * Routine: gpio_config_uart_seaboard
  * Description: Force GPIO_PI3 low on Seaboard so UART4 works.
@@ -48,6 +50,7 @@ void gpio_config_uart(void)
return;
gpio_config_uart_seaboard();
 }
+#endif
 
 #ifdef CONFIG_TEGRA2_MMC
 /*
-- 
1.7.3.1

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


[U-Boot] [PATCH v3 5/8] tegra2: Enable SPI environment on Seaboard

2011-11-05 Thread Simon Glass
This uses the SPI flash on Seaboard to store an 8KB environment.

Signed-off-by: Simon Glass s...@chromium.org
---
Changes in v2:
- Add CONFIG_SPI_FLASH_SIZE to define flash size
- Add config for SPI environment mode/speed

 include/configs/harmony.h   |3 +++
 include/configs/seaboard.h  |9 +
 include/configs/tegra2-common.h |3 +--
 3 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/include/configs/harmony.h b/include/configs/harmony.h
index 89e4911..ce0ae9f 100644
--- a/include/configs/harmony.h
+++ b/include/configs/harmony.h
@@ -58,4 +58,7 @@
 #define CONFIG_EFI_PARTITION
 #define CONFIG_CMD_EXT2
 #define CONFIG_CMD_FAT
+
+/* Environment not stored */
+#define CONFIG_ENV_IS_NOWHERE
 #endif /* __CONFIG_H */
diff --git a/include/configs/seaboard.h b/include/configs/seaboard.h
index 7e8c8cc..261f952 100644
--- a/include/configs/seaboard.h
+++ b/include/configs/seaboard.h
@@ -52,6 +52,7 @@
 #define CONFIG_SF_DEFAULT_MODE SPI_MODE_0
 #define CONFIG_CMD_SPI
 #define CONFIG_CMD_SF
+#define CONFIG_SPI_FLASH_SIZE  (4  20)
 
 /* SD/MMC */
 #define CONFIG_MMC
@@ -63,4 +64,12 @@
 #define CONFIG_EFI_PARTITION
 #define CONFIG_CMD_EXT2
 #define CONFIG_CMD_FAT
+
+/* Environment in SPI */
+#define CONFIG_ENV_IS_IN_SPI_FLASH
+#define CONFIG_ENV_SPI_MAX_HZ  4800
+#define CONFIG_ENV_SPI_MODESPI_MODE_0
+
+#define CONFIG_ENV_SECT_SIZECONFIG_ENV_SIZE
+#define CONFIG_ENV_OFFSET   (CONFIG_SPI_FLASH_SIZE - CONFIG_ENV_SECT_SIZE)
 #endif /* __CONFIG_H */
diff --git a/include/configs/tegra2-common.h b/include/configs/tegra2-common.h
index 9c3b9fa..4595ae4 100644
--- a/include/configs/tegra2-common.h
+++ b/include/configs/tegra2-common.h
@@ -52,8 +52,7 @@
 #define CONFIG_OF_LIBFDT   /* enable passing of devicetree */
 
 /* Environment */
-#define CONFIG_ENV_IS_NOWHERE
-#define CONFIG_ENV_SIZE0x2 /* Total Size 
Environment */
+#define CONFIG_ENV_SIZE0x2000  /* Total Size 
Environment */
 
 /*
  * Size of malloc() pool
-- 
1.7.3.1

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


[U-Boot] [PATCH v3 1/8] tegra2: Tidy UART selection

2011-11-05 Thread Simon Glass
UART selection is done with a lot of #ifdefs. This cleans things up
a little.

Signed-off-by: Simon Glass s...@chromium.org
---

 board/nvidia/common/board.c |   57 +-
 1 files changed, 34 insertions(+), 23 deletions(-)

diff --git a/board/nvidia/common/board.c b/board/nvidia/common/board.c
index 0f12de2..a5da310 100644
--- a/board/nvidia/common/board.c
+++ b/board/nvidia/common/board.c
@@ -35,6 +35,12 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
+enum {
+   /* UARTs which we can enable */
+   UARTA   = 1  0,
+   UARTD   = 1  3,
+};
+
 const struct tegra2_sysinfo sysinfo = {
CONFIG_TEGRA2_BOARD_STRING
 };
@@ -64,36 +70,32 @@ static void enable_uart(enum periph_id pid)
 
 /*
  * Routine: clock_init_uart
- * Description: init the PLL and clock for the UART(s)
+ * Description: init clock for the UART(s)
  */
-static void clock_init_uart(void)
+static void clock_init_uart(int uart_ids)
 {
-#if defined(CONFIG_TEGRA2_ENABLE_UARTA)
-   enable_uart(PERIPH_ID_UART1);
-#endif /* CONFIG_TEGRA2_ENABLE_UARTA */
-#if defined(CONFIG_TEGRA2_ENABLE_UARTD)
-   enable_uart(PERIPH_ID_UART4);
-#endif /* CONFIG_TEGRA2_ENABLE_UARTD */
+   if (uart_ids  UARTA)
+   enable_uart(PERIPH_ID_UART1);
+   if (uart_ids  UARTD)
+   enable_uart(PERIPH_ID_UART4);
 }
 
 /*
  * Routine: pin_mux_uart
  * Description: setup the pin muxes/tristate values for the UART(s)
  */
-static void pin_mux_uart(void)
+static void pin_mux_uart(int uart_ids)
 {
-#if defined(CONFIG_TEGRA2_ENABLE_UARTA)
-   pinmux_set_func(PINGRP_IRRX, PMUX_FUNC_UARTA);
-   pinmux_set_func(PINGRP_IRTX, PMUX_FUNC_UARTA);
-
-   pinmux_tristate_disable(PINGRP_IRRX);
-   pinmux_tristate_disable(PINGRP_IRTX);
-#endif /* CONFIG_TEGRA2_ENABLE_UARTA */
-#if defined(CONFIG_TEGRA2_ENABLE_UARTD)
-   pinmux_set_func(PINGRP_GMC, PMUX_FUNC_UARTD);
-
-   pinmux_tristate_disable(PINGRP_GMC);
-#endif /* CONFIG_TEGRA2_ENABLE_UARTD */
+   if (uart_ids  UARTA) {
+   pinmux_set_func(PINGRP_IRRX, PMUX_FUNC_UARTA);
+   pinmux_set_func(PINGRP_IRTX, PMUX_FUNC_UARTA);
+   pinmux_tristate_disable(PINGRP_IRRX);
+   pinmux_tristate_disable(PINGRP_IRTX);
+   }
+   if (uart_ids  UARTD) {
+   pinmux_set_func(PINGRP_GMC, PMUX_FUNC_UARTD);
+   pinmux_tristate_disable(PINGRP_GMC);
+   }
 }
 
 /*
@@ -114,14 +116,23 @@ int board_init(void)
 #ifdef CONFIG_BOARD_EARLY_INIT_F
 int board_early_init_f(void)
 {
+   int uart_ids = 0;   /* bit mask of which UART ids to enable */
+
+#ifdef CONFIG_TEGRA2_ENABLE_UARTA
+   uart_ids |= UARTA;
+#endif
+#ifdef CONFIG_TEGRA2_ENABLE_UARTD
+   uart_ids |= UARTD;
+#endif
+
/* Initialize essential common plls */
clock_early_init();
 
/* Initialize UART clocks */
-   clock_init_uart();
+   clock_init_uart(uart_ids);
 
/* Initialize periph pinmuxes */
-   pin_mux_uart();
+   pin_mux_uart(uart_ids);
 
/* Initialize periph GPIOs */
gpio_config_uart();
-- 
1.7.3.1

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


[U-Boot] [PATCH v3 6/8] tegra2: Implement SPI / UART GPIO switch

2011-11-05 Thread Simon Glass
The Tegra2 Seaboard has the unfortunate feature that SPI and the console
UART are multiplexed on the same pins. We need to switch between one
and the other during SPI and console activity.

This new file implements a switch and keeps track of which peripheral
owns the pins. It also flips over the controlling GPIO as needed

Since we are adding a second file to board/nvidia/common, we create
a proper Makefile there and remove the direct board.o include from
board/nvidia/seaboard/Makefile

Signed-off-by: Simon Glass s...@chromium.org
---
Changes in v2:
- Fix up GPIO selection to use gpio_request() first
- Rename uart-spi-fix to uart-spi-switch
- Rename uart/spi_enable() to pinmux_select_uart/spi()

Changes in v3:
- Remove unneeded #includes and header file guard

 arch/arm/include/asm/arch-tegra2/uart-spi-switch.h |   46 +++
 board/nvidia/common/Makefile   |   47 +++
 board/nvidia/common/uart-spi-switch.c  |  138 
 board/nvidia/seaboard/Makefile |1 -
 4 files changed, 231 insertions(+), 1 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-tegra2/uart-spi-switch.h
 create mode 100644 board/nvidia/common/Makefile
 create mode 100644 board/nvidia/common/uart-spi-switch.c

diff --git a/arch/arm/include/asm/arch-tegra2/uart-spi-switch.h 
b/arch/arm/include/asm/arch-tegra2/uart-spi-switch.h
new file mode 100644
index 000..e4503b1
--- /dev/null
+++ b/arch/arm/include/asm/arch-tegra2/uart-spi-switch.h
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2011 The Chromium OS Authors.
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#ifndef _UART_SPI_SWITCH_H
+#define _UART_SPI_SWITCH_H
+
+#if defined(CONFIG_SPI_UART_SWITCH)
+/*
+ * Signal that we are about to use the UART. This unfortunate hack is
+ * required by Seaboard, which cannot use its console and SPI at the same
+ * time! If the board file provides this, the board config will declare it.
+ * Let this be a lesson for others.
+ */
+void pinmux_select_uart(NS16550_t regs);
+
+/*
+ * Signal that we are about the use the SPI bus.
+ */
+void pinmux_select_spi(void);
+
+#else /* not CONFIG_SPI_UART_SWITCH */
+
+static inline void pinmux_select_uart(NS16550_t regs) {}
+static inline void pinmux_select_spi(void) {}
+
+#endif
+
+#endif
diff --git a/board/nvidia/common/Makefile b/board/nvidia/common/Makefile
new file mode 100644
index 000..3e748fd
--- /dev/null
+++ b/board/nvidia/common/Makefile
@@ -0,0 +1,47 @@
+# Copyright (c) 2011 The Chromium OS Authors.
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+
+include $(TOPDIR)/config.mk
+
+ifneq ($(OBJTREE),$(SRCTREE))
+$(shell mkdir -p $(obj)board/$(VENDOR)/common)
+endif
+
+LIB= $(obj)lib$(VENDOR).o
+
+COBJS-y += board.o
+COBJS-$(CONFIG_SPI_UART_SWITCH) += uart-spi-switch.o
+
+COBJS  := $(COBJS-y)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+all:   $(LIB)
+
+$(LIB):$(obj).depend $(OBJS) $(SOBJS)
+   $(call cmd_link_o_target, $(OBJS) $(SOBJS))
+
+#
+# This is for $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/board/nvidia/common/uart-spi-switch.c 
b/board/nvidia/common/uart-spi-switch.c
new file mode 100644
index 000..23aa0b9
--- /dev/null
+++ 

[U-Boot] [PATCH v3 2/8] tegra2: Add UARTB support

2011-11-05 Thread Simon Glass
UARTB is used on some boards, so support it here.

Signed-off-by: Simon Glass s...@chromium.org
---

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

diff --git a/board/nvidia/common/board.c b/board/nvidia/common/board.c
index a5da310..a2d45c1 100644
--- a/board/nvidia/common/board.c
+++ b/board/nvidia/common/board.c
@@ -38,6 +38,7 @@ DECLARE_GLOBAL_DATA_PTR;
 enum {
/* UARTs which we can enable */
UARTA   = 1  0,
+   UARTB   = 1  1,
UARTD   = 1  3,
 };
 
@@ -76,6 +77,8 @@ static void clock_init_uart(int uart_ids)
 {
if (uart_ids  UARTA)
enable_uart(PERIPH_ID_UART1);
+   if (uart_ids  UARTB)
+   enable_uart(PERIPH_ID_UART2);
if (uart_ids  UARTD)
enable_uart(PERIPH_ID_UART4);
 }
@@ -92,6 +95,10 @@ static void pin_mux_uart(int uart_ids)
pinmux_tristate_disable(PINGRP_IRRX);
pinmux_tristate_disable(PINGRP_IRTX);
}
+   if (uart_ids  UARTB) {
+   pinmux_set_func(PINGRP_UAD, PMUX_FUNC_IRDA);
+   pinmux_tristate_disable(PINGRP_UAD);
+   }
if (uart_ids  UARTD) {
pinmux_set_func(PINGRP_GMC, PMUX_FUNC_UARTD);
pinmux_tristate_disable(PINGRP_GMC);
@@ -121,6 +128,9 @@ int board_early_init_f(void)
 #ifdef CONFIG_TEGRA2_ENABLE_UARTA
uart_ids |= UARTA;
 #endif
+#ifdef CONFIG_TEGRA2_ENABLE_UARTB
+   uart_ids |= UARTB;
+#endif
 #ifdef CONFIG_TEGRA2_ENABLE_UARTD
uart_ids |= UARTD;
 #endif
-- 
1.7.3.1

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


[U-Boot] [PATCH v3 3/8] tegra2: spi: Add SPI driver for Tegra2 SOC

2011-11-05 Thread Simon Glass
From: Tom Warren twarren.nvi...@gmail.com

This driver supports SPI on Tegra2, running at 48MHz.

Signed-off-by: Tom Warren twar...@nvidia.com
---
Changes in v2:
- Update to support SPI mode and frequency
- Tidy driver according to comments, and tidy a little more

Changes in v3:
- Remove the replaced bus/cs check function
- Change (bitlen  7) to (bitlen % 8)

 arch/arm/include/asm/arch-tegra2/tegra2.h |1 +
 arch/arm/include/asm/arch-tegra2/tegra2_spi.h |   76 +++
 board/nvidia/common/board.c   |4 +
 drivers/spi/Makefile  |1 +
 drivers/spi/tegra2_spi.c  |  260 +
 5 files changed, 342 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-tegra2/tegra2_spi.h
 create mode 100644 drivers/spi/tegra2_spi.c

diff --git a/arch/arm/include/asm/arch-tegra2/tegra2.h 
b/arch/arm/include/asm/arch-tegra2/tegra2.h
index 742a75a..8941443 100644
--- a/arch/arm/include/asm/arch-tegra2/tegra2.h
+++ b/arch/arm/include/asm/arch-tegra2/tegra2.h
@@ -38,6 +38,7 @@
 #define NV_PA_APB_UARTC_BASE   (NV_PA_APB_MISC_BASE + 0x6200)
 #define NV_PA_APB_UARTD_BASE   (NV_PA_APB_MISC_BASE + 0x6300)
 #define NV_PA_APB_UARTE_BASE   (NV_PA_APB_MISC_BASE + 0x6400)
+#define TEGRA2_SPI_BASE(NV_PA_APB_MISC_BASE + 0xC380)
 #define NV_PA_PMC_BASE 0x7000E400
 #define NV_PA_CSITE_BASE   0x7004
 
diff --git a/arch/arm/include/asm/arch-tegra2/tegra2_spi.h 
b/arch/arm/include/asm/arch-tegra2/tegra2_spi.h
new file mode 100644
index 000..ceec428
--- /dev/null
+++ b/arch/arm/include/asm/arch-tegra2/tegra2_spi.h
@@ -0,0 +1,76 @@
+/*
+ * NVIDIA Tegra2 SPI-FLASH controller
+ *
+ * Copyright 2010-2011 NVIDIA Corporation
+ *
+ * This software may be used and distributed according to the
+ * terms of the GNU Public License, Version 2, incorporated
+ * herein by reference.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * Version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#ifndef _TEGRA2_SPI_H_
+#define _TEGRA2_SPI_H_
+
+#include asm/types.h
+
+struct spi_tegra {
+   u32 command;/* SPI_COMMAND_0 register  */
+   u32 status; /* SPI_STATUS_0 register */
+   u32 rx_cmp; /* SPI_RX_CMP_0 register  */
+   u32 dma_ctl;/* SPI_DMA_CTL_0 register */
+   u32 tx_fifo;/* SPI_TX_FIFO_0 register */
+   u32 rsvd[3];/* offsets 0x14 to 0x1F reserved */
+   u32 rx_fifo;/* SPI_RX_FIFO_0 register */
+};
+
+#define SPI_CMD_GO (1  30)
+#define SPI_CMD_ACTIVE_SCLK_SHIFT  26
+#define SPI_CMD_ACTIVE_SCLK_MASK   (3  SPI_CMD_ACTIVE_SCLK_SHIFT)
+#define SPI_CMD_CK_SDA (1  21)
+#define SPI_CMD_ACTIVE_SDA_SHIFT   18
+#define SPI_CMD_ACTIVE_SDA_MASK(3  SPI_CMD_ACTIVE_SDA_SHIFT)
+#define SPI_CMD_CS_POL (1  16)
+#define SPI_CMD_TXEN   (1  15)
+#define SPI_CMD_RXEN   (1  14)
+#define SPI_CMD_CS_VAL (1  13)
+#define SPI_CMD_CS_SOFT(1  12)
+#define SPI_CMD_CS_DELAY   (1  9)
+#define SPI_CMD_CS3_EN (1  8)
+#define SPI_CMD_CS2_EN (1  7)
+#define SPI_CMD_CS1_EN (1  6)
+#define SPI_CMD_CS0_EN (1  5)
+#define SPI_CMD_BIT_LENGTH (1  4)
+#define SPI_CMD_BIT_LENGTH_MASK0x001F
+
+#define SPI_STAT_BSY   (1  31)
+#define SPI_STAT_RDY   (1  30)
+#define SPI_STAT_RXF_FLUSH (1  29)
+#define SPI_STAT_TXF_FLUSH (1  28)
+#define SPI_STAT_RXF_UNR   (1  27)
+#define SPI_STAT_TXF_OVF   (1  26)
+#define SPI_STAT_RXF_EMPTY (1  25)
+#define SPI_STAT_RXF_FULL  (1  24)
+#define SPI_STAT_TXF_EMPTY (1  23)
+#define SPI_STAT_TXF_FULL  (1  22)
+#define SPI_STAT_SEL_TXRX_N(1  16)
+#define SPI_STAT_CUR_BLKCNT(1  15)
+
+#define SPI_TIMEOUT1000
+#define TEGRA2_SPI_MAX_FREQ5200
+
+
+#endif /* _TEGRA2_SPI_H_ */
diff --git a/board/nvidia/common/board.c b/board/nvidia/common/board.c
index a2d45c1..2591ebc 100644
--- a/board/nvidia/common/board.c
+++ b/board/nvidia/common/board.c
@@ -31,6 +31,7 @@
 #include asm/arch/clock.h
 #include asm/arch/pinmux.h
 #include asm/arch/uart.h
+#include spi.h
 #include board.h
 
 DECLARE_GLOBAL_DATA_PTR;

[U-Boot] [PATCH v3 4/8] tegra2: config: Enable SPI flash on Seaboard

2011-11-05 Thread Simon Glass
The Seaboard includes a Winbond 4MB flash part.

Signed-off-by: Simon Glass s...@chromium.org
---

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

diff --git a/include/configs/seaboard.h b/include/configs/seaboard.h
index 7d29144..7e8c8cc 100644
--- a/include/configs/seaboard.h
+++ b/include/configs/seaboard.h
@@ -37,11 +37,22 @@
 #define CONFIG_TEGRA2_ENABLE_UARTD
 #define CONFIG_SYS_NS16550_COM1NV_PA_APB_UARTD_BASE
 
+/* On Seaboard: GPIO_PI3 = Port I = 8, bit = 3 */
+#define CONFIG_UART_DISABLE_GPIO   GPIO_PI3
+
 #define CONFIG_MACH_TYPE   MACH_TYPE_SEABOARD
 #define CONFIG_SYS_BOARD_ODMDATA   0x300d8011 /* lp1, 1GB */
 
 #define CONFIG_BOARD_EARLY_INIT_F
 
+/* SPI */
+#define CONFIG_TEGRA2_SPI
+#define CONFIG_SPI_FLASH
+#define CONFIG_SPI_FLASH_WINBOND
+#define CONFIG_SF_DEFAULT_MODE SPI_MODE_0
+#define CONFIG_CMD_SPI
+#define CONFIG_CMD_SF
+
 /* SD/MMC */
 #define CONFIG_MMC
 #define CONFIG_GENERIC_MMC
-- 
1.7.3.1

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


[U-Boot] [PATCH v3 7/8] tegra2: spi: Support SPI / UART switch

2011-11-05 Thread Simon Glass
Add the SPI / UART switch logic into the Tegra2 SPI driver so that it
can co-exist with the NS16550 UART.

We need the ns16550.h header for NS16550_t for now.

Signed-off-by: Simon Glass s...@chromium.org
---
Changes in v2:
- Add pinmux logic to SPI driver
- Rename uart/spi_enable() to pinmux_select_uart/spi()

 drivers/spi/tegra2_spi.c |   14 ++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/drivers/spi/tegra2_spi.c b/drivers/spi/tegra2_spi.c
index 2db5a84..fe37218 100644
--- a/drivers/spi/tegra2_spi.c
+++ b/drivers/spi/tegra2_spi.c
@@ -28,9 +28,11 @@
 #include spi.h
 #include asm/io.h
 #include asm/gpio.h
+#include ns16550.h
 #include asm/arch/clk_rst.h
 #include asm/arch/clock.h
 #include asm/arch/pinmux.h
+#include asm/arch/uart-spi-switch.h
 #include asm/arch/tegra2_spi.h
 
 struct tegra_spi_slave {
@@ -123,6 +125,16 @@ int spi_claim_bus(struct spi_slave *slave)
 */
pinmux_set_func(PINGRP_GMD, PMUX_FUNC_SFLASH);
pinmux_tristate_disable(PINGRP_LSPI);
+
+#ifndef CONFIG_SPI_UART_SWITCH
+   /*
+* NOTE:
+* Only set PinMux bits 3:2 to SPI here on boards that don't have the
+* SPI UART switch or subsequent UART data won't go out!  See
+* spi_uart_switch().
+*/
+   /* TODO: pinmux_set_func(PINGRP_GMC, PMUX_FUNC_SFLASH); */
+#endif
return 0;
 }
 
@@ -140,6 +152,8 @@ void spi_cs_activate(struct spi_slave *slave)
 {
struct tegra_spi_slave *spi = to_tegra_spi(slave);
 
+   pinmux_select_spi();
+
/* CS is negated on Tegra, so drive a 1 to get a 0 */
setbits_le32(spi-regs-command, SPI_CMD_CS_VAL);
 }
-- 
1.7.3.1

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


Re: [U-Boot] [PATCH] arm: jadecpu: Readd MACH_TYPE_JADECPU

2011-11-05 Thread Wolfgang Denk
Dear Albert ARIBAUD,

In message 4eb543af.7010...@aribaud.net you wrote:

  Note that you will only get a warning if a _different_ value get's
  defined (``warning: VAR redefined'').  If both values are the same,
  no warning will be raised.
 
 Hmm, correct. In order to catch the mach-type creeping back in 
 mach-types.h, we'd need to define something like
 
   #define MACH_TYPE_JADECPU   (2636)
 
 I'll post an ARM-global patch for this, but as it will obviously not be 
 a bugfix, it'll wait until next merge window.

Please save the effort.  Waht would it be good for?  As long as the
values are the same, it's OK anyway.  And if they should be different,
we get a bunch of warnings.

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
I am pleased to see that we have differences.  May we together become
greater than the sum of both of us.
-- Surak of Vulcan, The Savage Curtain, stardate 5906.4
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] About the pull request and patchwork

2011-11-05 Thread Wolfgang Denk
Dear =?UTF-8?B?6aas5YWL5rOh?=,

In message caccg+xoeelw0gpcak7hlnbpmmnb5h0hrty92n6w1nmbslen...@mail.gmail.com 
you wrote:
 
  So yes, please, if you notice such inconsistencies, help out and
  update the status as needed.
 
 Maybe a perl or a python script is need to auto update the patchwork status
 by analyzing the table format of patckwork.
 Is this possible?

What exactly do you want to do?

For normal actions you can use pwclient.  

For a start, try

pwclient search 'pull request' | \
egrep -v 'Accepted|Superseded|Changes|Rejected|Applicable'


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
I am an atheist, thank God!
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] config.mk: use memoization in cc-option macro to speed up compilation

2011-11-05 Thread Albert ARIBAUD
Hi Daniel,

Le 05/11/2011 14:43, Daniel Schwierzeck a écrit :
 Hi Albert,

 On 05.11.2011 10:16, Albert ARIBAUD wrote:
 Hi all,

 Le 04/11/2011 18:56, Wolfgang Denk a écrit :
 Dear Daniel Schwierzeck,

 In
 messageCACUy__XY1873+dT-s=-gypebq5hnysmywwt-gxexiwy97ec...@mail.gmail.com

 you wrote:

 Should we change it? is the semantic still the same?

 I'm not sure. At first reading it doesn't look really the same to me.

 They are not, at least for ELDK4.2.

 The only difference is in -mabi options, where the change would reduce
 -mabi=apcs-gnu -mabi=aapcs-linux to -mabi=aapcs-linux.

 apcs-gnu, IIUC, is 'old ABI', while 'aapcs-linux' is 'new ABI', aka
 eabi. Most of the toolchains I see are eabi (ELDK and CS notably). There
 may be 'old ABI' toolchains out there, but I don't think they are old
 ABI either.

 Anyway, I've just tried ./MAKEALL edminiv2 with ELD42 and a couple of CS
 toolchains, and nowhere in the log does -mabi=apcs-gnu show up -- the
 gcc invocations only have -mabi=aapcs-linux.

 Looks like I read it wrong. So you always want -mabi=apcs-gnu
 -mabi=aapcs-linux -mno-thumb-interwork in $(PF_CPPFLAGS_ABI) with EABI?
 Sorry but I am not an ARM expert ;)

No, I don't want that. :)

The problem I see is having two conflicting -mabi options, 
-mabi=apcs-gnu and -mabi=aapcs-linux, in the same command line. There 
should be only one -- and it should be the same across the whole U-Boot 
building process.

The duplicate -mno-thumb-interwork does not worry me fronm a functional 
standpoint; it's just a waste of space, that's all.

 I've also tested making ED Mini V2 with and without the patch but
 without Daniel's proposed change to arch/arm/config.mk, and there is no
 difference in build commands (except that for some reason the patch
 inserts multiple spaces between some gcc invocation options.

 I guess this comes from making the macros more readable. Maybe I can
 optimize this.


 Daniel, what do you mean with does not work correctly?

 that the generated cache file looks not right

 CC_OPTIONS += -mabi=apcs-gnu
 CC_OPTIONS_NOP += -mabi=apcs-gnu
 CC_OPTIONS += -mno-thumb-interwork
 CC_OPTIONS += -mabi=aapcs-linux -mno-thumb-interwork

I'm not a makefile expert, so looks not right is a bit meaningless to 
me. If not right means there are several conflicting -mabi options 
and there are repeated -mno-thumb-interwork options then I agree with 
your does not look right statement.

 But if you want -mabi=apcs-gnu -mabi=aapcs-linux -mno-thumb-interwork
 then it should already work correctly without my change in
 arch/arm/config.mk.

As I said, no, I don't want that. I want the right -mabi option only, 
and I'd like a single -mno-thumb-interwork option.

But what I don't understand is the discrepancy which I see between the 
CC_OPTIONS resulting from include/generated/cc_options.mk and the actual 
command line options used to generate e.g. edminiv2.

 Best regards,
 Daniel

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


Re: [U-Boot] [PATCH] arm: jadecpu: Readd MACH_TYPE_JADECPU

2011-11-05 Thread Albert ARIBAUD
Le 05/11/2011 15:56, Wolfgang Denk a écrit :
 Dear Albert ARIBAUD,

 In message4eb543af.7010...@aribaud.net  you wrote:

 Note that you will only get a warning if a _different_ value get's
 defined (``warning: VAR redefined'').  If both values are the same,
 no warning will be raised.

 Hmm, correct. In order to catch the mach-type creeping back in
 mach-types.h, we'd need to define something like

  #define MACH_TYPE_JADECPU   (2636)

 I'll post an ARM-global patch for this, but as it will obviously not be
 a bugfix, it'll wait until next merge window.

 Please save the effort.  Waht would it be good for?  As long as the
 values are the same, it's OK anyway.  And if they should be different,
 we get a bunch of warnings.

Just wanted to make sure we know when the temporary MACH_TYPE addition 
in the config header becomes obsolete. But then, I can also run a grep 
on include/configs/*.h whenever mach-types.h is updated.

 Best regards,

 Wolfgang Denk

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


Re: [U-Boot] [PATCH V4] sandbox: Add improved RAM simulation

2011-11-05 Thread Simon Glass
On Sat, Nov 5, 2011 at 3:40 AM, Matthias Weisser weiss...@arcor.de wrote:
 Using mmap to allocate memory from the OS for RAM simulation we can use
 u-boot own malloc implementation.

 Signed-off-by: Matthias Weisser weiss...@arcor.de

Thanks for the rebase

Tested-by: Simon Glass s...@chromium.org

 ---
 Changes in V4:
  Rebased to current HEAD

 Changes in V3:
  Fixed a build warning

 Changes in V2:
  Removed the address hint for mmap
  Removed the special handling of dlmalloc in common
  Set gd-bd-bi_dram[0].start to 0 again

  arch/sandbox/cpu/os.c    |    7 +++
  arch/sandbox/lib/board.c |   17 ++---
  common/Makefile          |    3 ---
  include/os.h             |    8 
  4 files changed, 25 insertions(+), 10 deletions(-)

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


Re: [U-Boot] [PATCH 2/2] mvgbe: fix network device indices

2011-11-05 Thread Wolfgang Denk
Dear Albert ARIBAUD,

In message 4eb54978.5020...@aribaud.net you wrote:

  What would be the result?  A bord that comes up with a new MAC address
  each time you reset it?
 
 No -- the goal of the randomization code was, is, and will be to allow 
 the board to use the network when no correct MAC address can be found 
 anywhere (env vars, EEPROM, e-fuses, whatever). When a correct address 

And if this is the case, then the board will come up with a new MAC
address each time you reset it, right?

 is available, that address will be used. Typically, this happens when 
 the board has not been provisioned yet, at a point where the MAC address 
 it uses is not relevant yet.

I've done provisioning stuff a couple of times before, and I'm just
doing is again.  Random MAC addresses are a broken concept, and
anybody who considers using it should reassess his concepts.

Where is the real MAC address coming from, and how does it get
assigned to this specific board?  And how do you make sure not to make
mistakes when all you see is some board with a random MAC address?

[The systems I know usually either have the MAC address pre-programmed
in some storage device on the board, or printed on a barcode label, so
you can use ca barcode reader in combination with askenv and very
little U-Boot scripting as part of your production test /
initialization procedures.]

 1. This code would only be available to kirkwood-based boards anyway.

That doe snot make things any better.

 2. Although the code incorrectly describes it as private, the random 
 address is actually a locally administered address (bit 1 of first octet 
 is set), which eliminates the risk of clashing against any 'normal' 
 (universally administered) address; and its last three octets are 
 randomized in order to limit the risk of clashing against other locally 
 administered addresses if we're unlucky enough to have any on the 
 network segment.

I consider the whole approach broken and object against it.

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
Perfection is reached, not when there is no longer anything  to  add,
but when there is no longer anything to take away.
   - Antoine de Saint-Exupery
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 01/22] drivers/net/pcnet.c: Change debug code to fix build warning

2011-11-05 Thread Wolfgang Denk
Fix:
pcnet.c: In function 'pcnet_probe':
pcnet.c:247:8: warning: variable 'chipname' set but not used
[-Wunused-but-set-variable]

Signed-off-by: Wolfgang Denk w...@denx.de
Cc: Wolfgang Grandegger w...@denx.de
---
 drivers/net/pcnet.c |   17 -
 1 files changed, 4 insertions(+), 13 deletions(-)

diff --git a/drivers/net/pcnet.c b/drivers/net/pcnet.c
index e994cb6..45066c8 100644
--- a/drivers/net/pcnet.c
+++ b/drivers/net/pcnet.c
@@ -30,21 +30,12 @@
 #include asm/io.h
 #include pci.h
 
-#if 0
 #definePCNET_DEBUG_LEVEL   0   /* 0=off, 1=init, 2=rx/tx */
-#endif
 
-#if PCNET_DEBUG_LEVEL  0
-#definePCNET_DEBUG1(fmt,args...)   printf (fmt ,##args)
-#if PCNET_DEBUG_LEVEL  1
-#definePCNET_DEBUG2(fmt,args...)   printf (fmt ,##args)
-#else
-#define PCNET_DEBUG2(fmt,args...)
-#endif
-#else
-#define PCNET_DEBUG1(fmt,args...)
-#define PCNET_DEBUG2(fmt,args...)
-#endif
+#define PCNET_DEBUG1(fmt,args...)  \
+   debug_cond(PCNET_DEBUG_LEVEL  0, fmt ,##args)
+#define PCNET_DEBUG2(fmt,args...)  \
+   debug_cond(PCNET_DEBUG_LEVEL  1, fmt ,##args)
 
 #if !defined(CONF_PCNET_79C973)  defined(CONF_PCNET_79C975)
 #error Macro for PCnet chip version is not defined!
-- 
1.7.6.4

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


[U-Boot] [PATCH 07/22] common/cmd_flash.c: Fix GCC 4.6 build warnings

2011-11-05 Thread Wolfgang Denk
Fix:
cmd_flash.c:355:32: warning: 'info' may be used uninitialized in this
function [-Wuninitialized]
cmd_flash.c:354:10: warning: 'sect_first' may be used uninitialized in
this function [-Wuninitialized]
cmd_flash.c:354:10: warning: 'sect_last' may be used uninitialized in
this function [-Wuninitialized]
cmd_flash.c: In function 'do_protect':
cmd_flash.c:540:9: warning: 'info' may be used uninitialized in this
function [-Wuninitialized]
cmd_flash.c:538:9: warning: 'sect_first' may be used uninitialized in
this function [-Wuninitialized]
cmd_flash.c:538:9: warning: 'sect_last' may be used uninitialized in
this function [-Wuninitialized]

Signed-off-by: Wolfgang Denk w...@denx.de
---
 common/cmd_flash.c |8 
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/common/cmd_flash.c b/common/cmd_flash.c
index 6765347..c6ea25a 100644
--- a/common/cmd_flash.c
+++ b/common/cmd_flash.c
@@ -324,9 +324,9 @@ int do_flinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char 
* const argv[])
 int do_flerase (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 #ifndef CONFIG_SYS_NO_FLASH
-   flash_info_t *info;
+   flash_info_t *info = NULL;
ulong bank, addr_first, addr_last;
-   int n, sect_first, sect_last;
+   int n, sect_first = 0, sect_last = 0;
 #if defined(CONFIG_CMD_MTDPARTS)
struct mtd_device *dev;
struct part_info *part;
@@ -457,9 +457,9 @@ int do_protect (cmd_tbl_t *cmdtp, int flag, int argc, char 
* const argv[])
 {
int rcode = 0;
 #ifndef CONFIG_SYS_NO_FLASH
-   flash_info_t *info;
+   flash_info_t *info = NULL;
ulong bank;
-   int i, n, sect_first, sect_last;
+   int i, n, sect_first = 0, sect_last = 0;
 #if defined(CONFIG_CMD_MTDPARTS)
struct mtd_device *dev;
struct part_info *part;
-- 
1.7.6.4

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


[U-Boot] [PATCH 03/22] board/mousse/flash.c: Fix GCC 4.6 buil warnings

2011-11-05 Thread Wolfgang Denk
Fix:
flash.c: In function 'flash_erase':
flash.c:780:18: warning: variable 'l_sect' set but not used
[-Wunused-but-set-variable]
flash.c:779:11: warning: variable 'addr' set but not used
[-Wunused-but-set-variable]

Signed-off-by: Wolfgang Denk w...@denx.de
---
 board/mousse/flash.c |8 +---
 1 files changed, 1 insertions(+), 7 deletions(-)

diff --git a/board/mousse/flash.c b/board/mousse/flash.c
index d729f33..cc40535 100644
--- a/board/mousse/flash.c
+++ b/board/mousse/flash.c
@@ -776,8 +776,7 @@ void flash_print_info (flash_info_t * info)
  */
 int flash_erase (flash_info_t * info, int s_first, int s_last)
 {
-   vu_long *addr = (vu_long *) (info-start[0]);
-   int prot, sect, l_sect;
+   int prot, sect;
flash_dev_t *dev = NULL;
 
if ((s_first  0) || (s_first  s_last)) {
@@ -803,17 +802,12 @@ int flash_erase (flash_info_t * info, int s_first, int 
s_last)
printf (\n);
}
 
-   l_sect = -1;
-
/* Start erase on unprotected sectors */
dev = getFlashDevFromInfo (info);
if (dev) {
printf (Erase FLASH[%s] -%d sectors:, dev-name, 
dev-sectors);
for (sect = s_first; sect = s_last; sect++) {
if (info-protect[sect] == 0) { /* not protected */
-   addr = (vu_long *) (dev-base);
-   /*   printf(erase_sector: sector=%d, 
addr=0x%x\n,
-  sect, addr); */
printf (.);
if (ERROR == flashEraseSector (dev, sect)) {
printf (ERROR: could not erase sector 
%d on FLASH[%s]\n, sect, dev-name);
-- 
1.7.6.4

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


[U-Boot] [PATCH 05/22] board/linkstation/ide.c: Fix GCC 4.6 build warnings

2011-11-05 Thread Wolfgang Denk
Fix:
ide.c: In function 'ide_preinit':
ide.c:69:21: warning: array subscript is above array bounds
[-Warray-bounds]
ide.c:69:21: warning: array subscript is above array bounds
[-Warray-bounds]
ide.c:70:17: warning: array subscript is above array bounds
[-Warray-bounds]

Signed-off-by: Wolfgang Denk w...@denx.de
Cc: Guennadi Liakhovetski g.liakhovet...@gmx.de
---
 board/linkstation/ide.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/board/linkstation/ide.c b/board/linkstation/ide.c
index 568fdf5..14e3fd0 100644
--- a/board/linkstation/ide.c
+++ b/board/linkstation/ide.c
@@ -64,12 +64,14 @@ int ide_preinit (void)
ide_bus_offset[0] = pci_hose_bus_to_phys(hose,
 ide_bus_offset[0]  
0xfffe,
 PCI_REGION_IO);
+#if CONFIG_SYS_IDE_MAXBUS  1
pci_read_config_dword(devbusfn, PCI_BASE_ADDRESS_2,
  (u32 *) ide_bus_offset[1]);
ide_bus_offset[1] = 0xfffe;
ide_bus_offset[1] = pci_hose_bus_to_phys(hose,
 ide_bus_offset[1]  
0xfffe,
 PCI_REGION_IO);
+#endif
}
 
if (pci_find_device (PCI_VENDOR_ID_ITE, PCI_DEVICE_ID_ITE_8212, 0) != 
-1) {
-- 
1.7.6.4

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


[U-Boot] [PATCH 08/22] arch/powerpc/cpu/mpc8260/spi.c: Fix GCC 4.6 build warnings

2011-11-05 Thread Wolfgang Denk
Fix:
spi.c: In function 'spi_init_r':
spi.c:279:22: warning: variable 'cp' set but not used
[-Wunused-but-set-variable]
spi.c: In function 'spi_xfer':
spi.c:361:22: warning: variable 'cp' set but not used
[-Wunused-but-set-variable]

Signed-off-by: Wolfgang Denk w...@denx.de
---
 arch/powerpc/cpu/mpc8260/spi.c |4 
 1 files changed, 0 insertions(+), 4 deletions(-)

diff --git a/arch/powerpc/cpu/mpc8260/spi.c b/arch/powerpc/cpu/mpc8260/spi.c
index f5d2ac3..dc98ea7 100644
--- a/arch/powerpc/cpu/mpc8260/spi.c
+++ b/arch/powerpc/cpu/mpc8260/spi.c
@@ -276,11 +276,9 @@ void spi_init_r (void)
 {
volatile spi_t *spi;
volatile immap_t *immr;
-   volatile cpm8260_t *cp;
volatile cbd_t *tbdf, *rbdf;
 
immr = (immap_t *)  CONFIG_SYS_IMMR;
-   cp   = (cpm8260_t *) immr-im_cpm;
 
spi  = (spi_t *)immr-im_dprambase[PROFF_SPI];
 
@@ -358,7 +356,6 @@ ssize_t spi_read (uchar *addr, int alen, uchar *buffer, int 
len)
 ssize_t spi_xfer (size_t count)
 {
volatile immap_t *immr;
-   volatile cpm8260_t *cp;
volatile spi_t *spi;
cbd_t *tbdf, *rbdf;
int tm;
@@ -366,7 +363,6 @@ ssize_t spi_xfer (size_t count)
DPRINT ((*** spi_xfer entered ***\n));
 
immr = (immap_t *) CONFIG_SYS_IMMR;
-   cp   = (cpm8260_t *) immr-im_cpm;
 
spi  = (spi_t *)immr-im_dprambase[PROFF_SPI];
 
-- 
1.7.6.4

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


[U-Boot] [PATCH 04/22] drivers/net/rtl8169.c: Fix GCC 4.6 build warning

2011-11-05 Thread Wolfgang Denk
Fix:
rtl8169.c: In function 'rtl_init':
rtl8169.c:742:13: warning: variable 'printed_version' set but not used
[-Wunused-but-set-variable]

Signed-off-by: Wolfgang Denk w...@denx.de
---
 drivers/net/rtl8169.c |3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/drivers/net/rtl8169.c b/drivers/net/rtl8169.c
index b81dcad..1ad13bd 100644
--- a/drivers/net/rtl8169.c
+++ b/drivers/net/rtl8169.c
@@ -739,7 +739,6 @@ INIT - Look for an adapter, this routine's visible to the 
outside
 static int rtl_init(struct eth_device *dev, bd_t *bis)
 {
static int board_idx = -1;
-   static int printed_version = 0;
int i, rc;
int option = -1, Cap10_100 = 0, Cap1000 = 0;
 
@@ -751,8 +750,6 @@ static int rtl_init(struct eth_device *dev, bd_t *bis)
 
board_idx++;
 
-   printed_version = 1;
-
/* point to private storage */
tpc = tpx;
 
-- 
1.7.6.4

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


[U-Boot] [PATCH 00/22] Fix GCC 4.6 build warnings (Part 2)

2011-11-05 Thread Wolfgang Denk
The following set of patches is the second batch of fixes of new
build warnings raised by recent compiler versions (GCC 4.6.x).

To be continued...

...all help with that would be highly welcome!

Wolfgang Denk (22):
  drivers/net/pcnet.c: Change debug code to fix build warning
  board/etin/kvme080/multiverse.c: Fix GCC 4.6 build warning.
  board/mousse/flash.c: Fix GCC 4.6 buil warnings
  drivers/net/rtl8169.c: Fix GCC 4.6 build warning
  board/linkstation/ide.c: Fix GCC 4.6 build warnings
  drivers/net/rtl8139.c: Fix GCC 4.6 build warnings
  common/cmd_flash.c: Fix GCC 4.6 build warnings
  arch/powerpc/cpu/mpc8260/spi.c: Fix GCC 4.6 build warnings
  board/cogent/flash.c: Fix GCC 4.6 buiild warning
  board/gw8260/flash.c: minimal CodingStyle cleanup
  board/gw8260/flash.c: Fix GCC 4.6 build warning
  board/ep82xxm/ep82xxm.c: Fix GCC 4.6 build warning
  board/hymod/input.c: Fix GCC 4.6 build warning
  board/ids8247/ids8247.c: Fix GCC 4.6 build warning
  board/rpxsuper/flash.c: minimal CodingStyle cleanup
  board/rpxsuper/flash.c: Fix GCC 4.6 build warning
  board/sacsng/sacsng.c: CodingStyle cleanup
  board/sacsng/sacsng.c: Fix GCC 4.6 build warning
  board/freescale/mpc8266ads/mpc8266ads.c: CodingStyle cleanup
  board/freescale/mpc8266ads/mpc8266ads.c: Fix GCC 4.6 build warning
  board/funkwerk/vovpn-gw/vovpn-gw.c: Fix GCC 4.6 build warning
  board/siemens/SCM/scm.c: Fix GCC 4.6 build warning

 arch/powerpc/cpu/mpc8260/spi.c  |4 -
 board/cogent/flash.c|3 +-
 board/ep82xxm/ep82xxm.c |3 +-
 board/etin/kvme080/multiverse.c |3 +-
 board/freescale/mpc8266ads/mpc8266ads.c |  592 +++---
 board/funkwerk/vovpn-gw/vovpn-gw.c  |3 +-
 board/gw8260/flash.c|   74 +-
 board/hymod/input.c |3 +-
 board/ids8247/ids8247.c |3 +-
 board/linkstation/ide.c |2 +
 board/mousse/flash.c|8 +-
 board/rpxsuper/flash.c  |   46 +-
 board/sacsng/sacsng.c   | 1327 +++
 board/siemens/SCM/scm.c |3 +-
 common/cmd_flash.c  |8 +-
 drivers/net/pcnet.c |   17 +-
 drivers/net/rtl8139.c   |   49 +-
 drivers/net/rtl8169.c   |3 -
 18 files changed, 1062 insertions(+), 1089 deletions(-)

-- 
1.7.6.4

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


[U-Boot] [PATCH 12/22] board/ep82xxm/ep82xxm.c: Fix GCC 4.6 build warning

2011-11-05 Thread Wolfgang Denk
Fix:
ep82xxm.c: In function 'initdram':
ep82xxm.c:233:16: warning: variable 'ramtmp' set but not used
[-Wunused-but-set-variable]

Signed-off-by: Wolfgang Denk w...@denx.de
---
 board/ep82xxm/ep82xxm.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/board/ep82xxm/ep82xxm.c b/board/ep82xxm/ep82xxm.c
index c1d6e91..182cabc 100644
--- a/board/ep82xxm/ep82xxm.c
+++ b/board/ep82xxm/ep82xxm.c
@@ -31,6 +31,7 @@
 #include pci.h
 #endif
 #include miiphy.h
+#include linux/compiler.h
 
 /*
  * I/O Port configuration table
@@ -230,8 +231,8 @@ phys_size_t initdram(int board_type)
uint psdmr = CONFIG_SYS_PSDMR;
int i;
 
-   unsigned char   ramtmp;
unsigned char   *ramptr1 = (unsigned char *)0x0110;
+   __maybe_unused unsigned charramtmp;
 
memctl-memc_mptpr = CONFIG_SYS_MPTPR;
 
-- 
1.7.6.4

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


[U-Boot] [PATCH 06/22] drivers/net/rtl8139.c: Fix GCC 4.6 build warnings

2011-11-05 Thread Wolfgang Denk
Fix:
rtl8139.c: In function 'rtl8139_probe':
rtl8139.c:256:15: warning: variable 'fullduplex' set but not used
[-Wunused-but-set-variable]
rtl8139.c:256:6: warning: variable 'speed10' set but not used
[-Wunused-but-set-variable]
rtl8139.c: In function 'rtl_transmit':
rtl8139.c:419:16: warning: variable 'txstatus' set but not used
[-Wunused-but-set-variable]

Change code to use new debug macros; also fix the new errors and
warnigns popping up now, like error: 'to' undeclared and some
warning: format '%X' expects argument of type 'unsigned int', but
argument X has type 'long unsigned int'

Signed-off-by: Wolfgang Denk w...@denx.de
---
 drivers/net/rtl8139.c |   49 +++--
 1 files changed, 19 insertions(+), 30 deletions(-)

diff --git a/drivers/net/rtl8139.c b/drivers/net/rtl8139.c
index c2779db..e3feef8 100644
--- a/drivers/net/rtl8139.c
+++ b/drivers/net/rtl8139.c
@@ -95,10 +95,9 @@
 #define RX_BUF_LEN_IDX 0   /* 0, 1, 2 is allowed - 8,16,32K rx buffer */
 #define RX_BUF_LEN (8192  RX_BUF_LEN_IDX)
 
-#undef DEBUG_TX
-#undef DEBUG_RX
+#define DEBUG_TX   0   /* set to 1 to enable debug code */
+#define DEBUG_RX   0   /* set to 1 to enable debug code */
 
-#define currticks()get_timer(0)
 #define bus_to_phys(a) pci_mem_to_phys((pci_dev_t)dev-priv, a)
 #define phys_to_bus(a) pci_phys_to_mem((pci_dev_t)dev-priv, a)
 
@@ -253,7 +252,6 @@ int rtl8139_initialize(bd_t *bis)
 static int rtl8139_probe(struct eth_device *dev, bd_t *bis)
 {
int i;
-   int speed10, fullduplex;
int addr_len;
unsigned short *ap = (unsigned short *)dev-enetaddr;
 
@@ -266,9 +264,6 @@ static int rtl8139_probe(struct eth_device *dev, bd_t *bis)
for (i = 0; i  3; i++)
*ap++ = le16_to_cpu (read_eeprom(i + 7, addr_len));
 
-   speed10 = inb(ioaddr + MediaStatus)  MSRSpeed10;
-   fullduplex = inw(ioaddr + MII_BMCR)  BMCRDuplex;
-
rtl_reset(dev);
 
if (inb(ioaddr + MediaStatus)  MSRLinkFail) {
@@ -389,9 +384,8 @@ static void rtl_reset(struct eth_device *dev)
 * from the configuration EEPROM default, because the card manufacturer
 * should have set that to match the card.  */
 
-#ifdef DEBUG_RX
-   printf(rx ring address is %X\n,(unsigned long)rx_ring);
-#endif
+   debug_cond(DEBUG_RX,
+   rx ring address is %lX\n,(unsigned long)rx_ring);
flush_cache((unsigned long)rx_ring, RX_BUF_LEN);
outl(phys_to_bus((int)rx_ring), ioaddr + RxBuf);
 
@@ -424,9 +418,7 @@ static int rtl_transmit(struct eth_device *dev, volatile 
void *packet, int lengt
 
memcpy((char *)tx_buffer, (char *)packet, (int)length);
 
-#ifdef DEBUG_TX
-   printf(sending %d bytes\n, len);
-#endif
+   debug_cond(DEBUG_TX, sending %d bytes\n, len);
 
/* Note: RTL8139 doesn't auto-pad, send minimum payload (another 4
 * bytes are sent automatically for the FCS, totalling to 64 bytes). */
@@ -453,16 +445,18 @@ static int rtl_transmit(struct eth_device *dev, volatile 
void *packet, int lengt
 
if (status  TxOK) {
cur_tx = (cur_tx + 1) % NUM_TX_DESC;
-#ifdef DEBUG_TX
-   printf(tx done (%d ticks), status %hX txstatus %X\n,
-   to-currticks(), status, txstatus);
-#endif
+
+   debug_cond(DEBUG_TX,
+   tx done, status %hX txstatus %lX\n,
+   status, txstatus);
+
return length;
} else {
-#ifdef DEBUG_TX
-   printf(tx timeout/error (%d usecs), status %hX txstatus %X\n,
-  10*i, status, txstatus);
-#endif
+
+   debug_cond(DEBUG_TX,
+   tx timeout/error (%d usecs), status %hX txstatus 
%lX\n,
+   10*i, status, txstatus);
+
rtl_reset(dev);
 
return 0;
@@ -486,9 +480,7 @@ static int rtl_poll(struct eth_device *dev)
/* See below for the rest of the interrupt acknowledges.  */
outw(status  ~(RxFIFOOver | RxOverflow | RxOK), ioaddr + IntrStatus);
 
-#ifdef DEBUG_RX
-   printf(rtl_poll: int %hX , status);
-#endif
+   debug_cond(DEBUG_RX, rtl_poll: int %hX , status);
 
ring_offs = cur_rx % RX_BUF_LEN;
/* ring_offs is guaranteed being 4-byte aligned */
@@ -513,14 +505,11 @@ static int rtl_poll(struct eth_device *dev)
memcpy((rxdata[semi_count]), rx_ring, rx_size-4-semi_count);
 
NetReceive(rxdata, length);
-#ifdef DEBUG_RX
-   printf(rx packet %d+%d bytes, 
semi_count,rx_size-4-semi_count);
-#endif
+   debug_cond(DEBUG_RX, rx packet %d+%d bytes,
+   semi_count, rx_size-4-semi_count);
} else {
NetReceive(rx_ring + ring_offs + 4, length);
-#ifdef DEBUG_RX
-   printf(rx packet %d bytes, rx_size-4);
-#endif
+   debug_cond(DEBUG_RX, rx packet %d bytes, rx_size-4);
}

[U-Boot] [PATCH 14/22] board/ids8247/ids8247.c: Fix GCC 4.6 build warning

2011-11-05 Thread Wolfgang Denk
Fix:
ids8247.c: In function 'initdram':
ids8247.c:284:14: warning: variable 'lsize' set but not used
[-Wunused-but-set-variable]

Signed-off-by: Wolfgang Denk w...@denx.de
Cc: Heiko Schocher h...@denx.de
---
 board/ids8247/ids8247.c |3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/board/ids8247/ids8247.c b/board/ids8247/ids8247.c
index d621833..02db07f 100644
--- a/board/ids8247/ids8247.c
+++ b/board/ids8247/ids8247.c
@@ -281,10 +281,9 @@ phys_size_t initdram (int board_type)
volatile immap_t *immap = (immap_t *) CONFIG_SYS_IMMR;
volatile memctl8260_t *memctl = immap-im_memctl;
 
-   long psize, lsize;
+   long psize;
 
psize = 16 * 1024 * 1024;
-   lsize = 0;
 
memctl-memc_psrt = CONFIG_SYS_PSRT;
memctl-memc_mptpr = CONFIG_SYS_MPTPR;
-- 
1.7.6.4

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


[U-Boot] [PATCH 20/22] board/freescale/mpc8266ads/mpc8266ads.c: Fix GCC 4.6 build warning

2011-11-05 Thread Wolfgang Denk
Fix:
mpc8266ads.c: In function 'initdram':
mpc8266ads.c:278:9: warning: variable 'spd_size' set but not used
[-Wunused-but-set-variable]

Signed-off-by: Wolfgang Denk w...@denx.de
---
 board/freescale/mpc8266ads/mpc8266ads.c |2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/board/freescale/mpc8266ads/mpc8266ads.c 
b/board/freescale/mpc8266ads/mpc8266ads.c
index c7fcfe5..5d48968 100644
--- a/board/freescale/mpc8266ads/mpc8266ads.c
+++ b/board/freescale/mpc8266ads/mpc8266ads.c
@@ -275,7 +275,6 @@ phys_size_t initdram(int board_type)
uint sdam;
uint bsma;
uint sda10;
-   u_char spd_size;
u_char data;
u_char cksum;
int j;
@@ -292,7 +291,6 @@ phys_size_t initdram(int board_type)
i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
 
i2c_read(SDRAM_SPD_ADDR, 0, 1, data, 1);
-   spd_size = data;
cksum = data;
for (j = 1; j  64; j++) {  /* read only the checksummed bytes */
/* note: the I2C address autoincrements when alen == 0 */
-- 
1.7.6.4

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


[U-Boot] [PATCH 21/22] board/funkwerk/vovpn-gw/vovpn-gw.c: Fix GCC 4.6 build warning

2011-11-05 Thread Wolfgang Denk
Fix:
vovpn-gw.c: In function 'misc_init_r':
vovpn-gw.c:266:16: warning: variable 'temp' set but not used
[-Wunused-but-set-variable]

Signed-off-by: Wolfgang Denk w...@denx.de
---
 board/funkwerk/vovpn-gw/vovpn-gw.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/board/funkwerk/vovpn-gw/vovpn-gw.c 
b/board/funkwerk/vovpn-gw/vovpn-gw.c
index a4bfbc9..57bd21f 100644
--- a/board/funkwerk/vovpn-gw/vovpn-gw.c
+++ b/board/funkwerk/vovpn-gw/vovpn-gw.c
@@ -25,6 +25,7 @@
 #include mpc8260.h
 #include asm/m8260_pci.h
 #include miiphy.h
+#include linux/compiler.h
 
 #include m88e6060.h
 
@@ -263,7 +264,7 @@ int board_early_init_f (void)
 int misc_init_r (void)
 {
volatile ioport_t *iop;
-   unsigned char temp;
+   __maybe_unused unsigned char temp;
 #if 0
/* DUMP UPMA RAM */
volatile immap_t *immap;
-- 
1.7.6.4

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


[U-Boot] [PATCH 22/22] board/siemens/SCM/scm.c: Fix GCC 4.6 build warning

2011-11-05 Thread Wolfgang Denk
Fix:
scm.c: In function 'config_scoh_cs':
scm.c:400:16: warning: variable 'tmp' set but not used
[-Wunused-but-set-variable]

Signed-off-by: Wolfgang Denk w...@denx.de
---
 board/siemens/SCM/scm.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/board/siemens/SCM/scm.c b/board/siemens/SCM/scm.c
index 926e491..461b56e 100644
--- a/board/siemens/SCM/scm.c
+++ b/board/siemens/SCM/scm.c
@@ -24,6 +24,7 @@
 #include common.h
 #include ioports.h
 #include mpc8260.h
+#include linux/compiler.h
 
 #include scm.h
 
@@ -397,7 +398,7 @@ static void config_scoh_cs (void)
volatile immap_t *immr = (immap_t *) CONFIG_SYS_IMMR;
volatile memctl8260_t *memctl = immr-im_memctl;
volatile can_reg_t *can = (volatile can_reg_t *) CONFIG_SYS_CAN0_BASE;
-   volatile uint tmp, i;
+   __maybe_unused volatile uint tmp, i;
 
/* Initialize OR3 / BR3 for CAN Bus Controller 0 */
memctl-memc_or3 = CONFIG_SYS_CAN0_OR3;
-- 
1.7.6.4

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


[U-Boot] [PATCH 02/22] board/etin/kvme080/multiverse.c: Fix GCC 4.6 build warning.

2011-11-05 Thread Wolfgang Denk
Signed-off-by: Wolfgang Denk w...@denx.de
Cc: Sangmoon Kim dog...@etinsys.com
---
 board/etin/kvme080/multiverse.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/board/etin/kvme080/multiverse.c b/board/etin/kvme080/multiverse.c
index eb89581..93ad57a 100644
--- a/board/etin/kvme080/multiverse.c
+++ b/board/etin/kvme080/multiverse.c
@@ -17,6 +17,7 @@
 #include common.h
 #include asm/io.h
 #include pci.h
+#include linux/compiler.h
 
 #include multiverse.h
 
@@ -103,7 +104,7 @@ int multiv_reset(unsigned long base)
 
 void multiv_auto_slot_id(unsigned long base)
 {
-   unsigned int vector;
+   __maybe_unused unsigned int vector;
int slot_id = 1;
if (readb(base + VME_CTRL)  VME_CTRL_SYSFAIL) {
*(volatile unsigned int*)(base + VME_IRQ2_REG) = 0xfe;
-- 
1.7.6.4

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


[U-Boot] [PATCH 10/22] board/gw8260/flash.c: minimal CodingStyle cleanup

2011-11-05 Thread Wolfgang Denk
Really minimal and local, just good enough to make checkpatch not
complain about the changes in the following commit.

Signed-off-by: Wolfgang Denk w...@denx.de
Cc: Oliver Brown obr...@adventnetworks.com
---
 board/gw8260/flash.c |   75 --
 1 files changed, 36 insertions(+), 39 deletions(-)

diff --git a/board/gw8260/flash.c b/board/gw8260/flash.c
index 6035f69..c1c26ea 100644
--- a/board/gw8260/flash.c
+++ b/board/gw8260/flash.c
@@ -63,54 +63,51 @@ static int write_word (flash_info_t *info, ulong dest, 
ulong data);
 /*   functions  */
 /*/
 
-/*/
-/* NAME: flash_init() - initializes flash banks */
-/*  */
-/* DESCRIPTION: */
-/*   This function initializes the flash bank(s).   */
-/*  */
-/* RETURNS: */
-/*   The size in bytes of the flash */
-/*  */
-/* RESTRICTIONS/LIMITATIONS:*/
-/*  */
-/*  */
-/*/
-unsigned long flash_init (void)
+/*
+ * NAME: flash_init() - initializes flash banks
+ *
+ * DESCRIPTION:
+ *   This function initializes the flash bank(s).
+ *
+ * RETURNS:
+ *   The size in bytes of the flash
+ *
+ * RESTRICTIONS/LIMITATIONS:
+ *
+ *
+ */
+unsigned long flash_init(void)
 {
-unsigned long size;
-int i;
-
-/* Init: no FLASHes known */
-for (i=0; iCONFIG_SYS_MAX_FLASH_BANKS; ++i) {
-   flash_info[i].flash_id = FLASH_UNKNOWN;
-}
-
-/* for now, only support the 4 MB Flash SIMM */
-size = flash_get_size((vu_long *)CONFIG_SYS_FLASH0_BASE, flash_info[0]);
-
-/*
- * protect monitor and environment sectors
- */
-
+   unsigned long size;
+   int i;
+
+   /* Init: no FLASHes known */
+   for (i = 0; i  CONFIG_SYS_MAX_FLASH_BANKS; ++i)
+   flash_info[i].flash_id = FLASH_UNKNOWN;
+
+   /* for now, only support the 4 MB Flash SIMM */
+   size = flash_get_size((vu_long *) CONFIG_SYS_FLASH0_BASE,
+ flash_info[0]);
+   /*
+* protect monitor and environment sectors
+*/
 #if CONFIG_SYS_MONITOR_BASE = CONFIG_SYS_FLASH0_BASE
-flash_protect(FLAG_PROTECT_SET,
- CONFIG_SYS_MONITOR_BASE,
- CONFIG_SYS_MONITOR_BASE+monitor_flash_len-1,
- flash_info[0]);
+   flash_protect(FLAG_PROTECT_SET,
+ CONFIG_SYS_MONITOR_BASE,
+ CONFIG_SYS_MONITOR_BASE + monitor_flash_len - 1,
+ flash_info[0]);
 #endif
 
 #if defined(CONFIG_ENV_IS_IN_FLASH)  defined(CONFIG_ENV_ADDR)
-# ifndef  CONFIG_ENV_SIZE
-#  define CONFIG_ENV_SIZE  CONFIG_ENV_SECT_SIZE
-# endif
-flash_protect(FLAG_PROTECT_SET,
- CONFIG_ENV_ADDR,
- CONFIG_ENV_ADDR + CONFIG_ENV_SIZE - 1,
- flash_info[0]);
+#ifndef CONFIG_ENV_SIZE
+#define CONFIG_ENV_SIZECONFIG_ENV_SECT_SIZE
+#endif
+   flash_protect(FLAG_PROTECT_SET,
+ CONFIG_ENV_ADDR,
+ CONFIG_ENV_ADDR + CONFIG_ENV_SIZE - 1, flash_info[0]);
 #endif
 
-return (CONFIG_SYS_FLASH0_SIZE * 1024 * 1024);  /*size*/
+   return CONFIG_SYS_FLASH0_SIZE * 1024 * 1024;/*size */
 }
 
 /*/
-- 
1.7.6.4

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


[U-Boot] [PATCH 19/22] board/freescale/mpc8266ads/mpc8266ads.c: CodingStyle cleanup

2011-11-05 Thread Wolfgang Denk
Make (mostly) checkpatch clean.

Signed-off-by: Wolfgang Denk w...@denx.de
Cc: Rune Torgersen ru...@innovsys.com
---
 board/freescale/mpc8266ads/mpc8266ads.c |  594 ---
 1 files changed, 304 insertions(+), 290 deletions(-)

diff --git a/board/freescale/mpc8266ads/mpc8266ads.c 
b/board/freescale/mpc8266ads/mpc8266ads.c
index 2caf4aa..c7fcfe5 100644
--- a/board/freescale/mpc8266ads/mpc8266ads.c
+++ b/board/freescale/mpc8266ads/mpc8266ads.c
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2001
+ * (C) Copyright 2001-2011
  * Wolfgang Denk, DENX Software Engineering, w...@denx.de.
  *
  * Modified during 2001 by
@@ -61,8 +61,8 @@
 
 const iop_conf_t iop_conf_tab[4][32] = {
 
-/* Port A configuration */
-{  /*conf ppar psor pdir podr pdat */
+   /* Port A configuration */
+   {   /*  conf ppar psor pdir podr pdat */
/* PA31 */ {   0,   1,   0,   1,   0,   0   }, /* FCC1 TxENB */
/* PA30 */ {   0,   1,   0,   0,   0,   0   }, /* FCC1 TxClav   */
/* PA29 */ {   0,   1,   0,   1,   0,   0   }, /* FCC1 TxSOC  */
@@ -95,10 +95,10 @@ const iop_conf_t iop_conf_tab[4][32] = {
/* PA2  */ {   0,   0,   0,   1,   0,   0   }, /* PA2 */
/* PA1  */ {   1,   0,   0,   0,   0,   0   }, /* FREERUN */
/* PA0  */ {   0,   0,   0,   1,   0,   0   }  /* PA0 */
-},
+   },
 
-/* Port B configuration */
-{   /*   conf ppar psor pdir podr pdat */
+   /* Port B configuration */
+   {   /*  conf ppar psor pdir podr pdat */
/* PB31 */ {   1,   1,   0,   1,   0,   0   }, /* FCC2 MII TX_ER */
/* PB30 */ {   1,   1,   0,   0,   0,   0   }, /* FCC2 MII RX_DV */
/* PB29 */ {   1,   1,   1,   1,   0,   0   }, /* FCC2 MII TX_EN */
@@ -131,10 +131,10 @@ const iop_conf_t iop_conf_tab[4][32] = {
/* PB2  */ {   0,   0,   0,   0,   0,   0   }, /* pin doesn't exist */
/* PB1  */ {   0,   0,   0,   0,   0,   0   }, /* pin doesn't exist */
/* PB0  */ {   0,   0,   0,   0,   0,   0   }  /* pin doesn't exist */
-},
+   },
 
-/* Port C */
-{   /*   conf ppar psor pdir podr pdat */
+   /* Port C */
+   {   /*  conf ppar psor pdir podr pdat */
/* PC31 */ {   0,   0,   0,   1,   0,   0   }, /* PC31 */
/* PC30 */ {   0,   0,   0,   1,   0,   0   }, /* PC30 */
/* PC29 */ {   0,   1,   1,   0,   0,   0   }, /* SCC1 EN *CLSN */
@@ -167,10 +167,10 @@ const iop_conf_t iop_conf_tab[4][32] = {
/* PC2  */ {   0,   0,   0,   1,   0,   1   }, /* ENET FDE */
/* PC1  */ {   0,   0,   0,   1,   0,   0   }, /* ENET DSQE */
/* PC0  */ {   0,   0,   0,   1,   0,   0   }, /* ENET LBK */
-},
+   },
 
-/* Port D */
-{   /*   conf ppar psor pdir podr pdat */
+   /* Port D */
+   {   /*  conf ppar psor pdir podr pdat */
/* PD31 */ {   1,   1,   0,   0,   0,   0   }, /* SCC1 EN RxD */
/* PD30 */ {   1,   1,   1,   1,   0,   0   }, /* SCC1 EN TxD */
/* PD29 */ {   0,   1,   0,   1,   0,   0   }, /* SCC1 EN TENA */
@@ -203,7 +203,7 @@ const iop_conf_t iop_conf_tab[4][32] = {
/* PD2  */ {   0,   0,   0,   0,   0,   0   }, /* pin doesn't exist */
/* PD1  */ {   0,   0,   0,   0,   0,   0   }, /* pin doesn't exist */
/* PD0  */ {   0,   0,   0,   0,   0,   0   }  /* pin doesn't exist */
-}
+   }
 };
 
 typedef struct bscr_ {
@@ -224,317 +224,331 @@ typedef struct pci_ic_s {
 
 void reset_phy(void)
 {
-volatile bcsr_t  *bcsr   = (bcsr_t *)CONFIG_SYS_BCSR;
+   volatile bcsr_t *bcsr = (bcsr_t *)CONFIG_SYS_BCSR;
 
-/* reset the FEC port */
-bcsr-bcsr1= ~FETH_RST;
-bcsr-bcsr1|= FETH_RST;
+   /* reset the FEC port */
+   bcsr-bcsr1 = ~FETH_RST;
+   bcsr-bcsr1 |= FETH_RST;
 }
 
 
-int board_early_init_f (void)
+int board_early_init_f(void)
 {
-volatile bcsr_t  *bcsr = (bcsr_t *)CONFIG_SYS_BCSR;
-volatile pci_ic_t *pci_ic  = (pci_ic_t *) CONFIG_SYS_PCI_INT;
+   volatile bcsr_t *bcsr = (bcsr_t *)CONFIG_SYS_BCSR;
+   volatile pci_ic_t *pci_ic = (pci_ic_t *)CONFIG_SYS_PCI_INT;
 
-bcsr-bcsr1= ~FETHIEN  ~RS232EN_1  ~RS232EN_2;
+   bcsr-bcsr1 = ~FETHIEN  ~RS232EN_1  ~RS232EN_2;
 
-/* mask all PCI interrupts */
-pci_ic-pci_int_mask |= 0xfff0;
+   /* mask all PCI interrupts */
+   pci_ic-pci_int_mask |= 0xfff0;
 
-return 0;
+   return 0;
 }
 
 int checkboard(void)
 {
-puts (Board: Motorola MPC8266ADS\n);
-return 0;
+   puts(Board: Motorola MPC8266ADS\n);
+   return 0;
 }
 
 phys_size_t initdram(int board_type)
 {
/* Autoinit part stolen from board/sacsng/sacsng.c */
-volatile immap_t *immap = (immap_t *)CONFIG_SYS_IMMR;
-volatile memctl8260_t *memctl   = immap-im_memctl;
-volatile uchar c = 0xff;
-volatile uchar *ramaddr = (uchar 

[U-Boot] [PATCH 15/22] board/rpxsuper/flash.c: minimal CodingStyle cleanup

2011-11-05 Thread Wolfgang Denk
Really minimal and local, just good enough to make checkpatch not
complain about the changes in the following commit.

Signed-off-by: Wolfgang Denk w...@denx.de
---
 board/rpxsuper/flash.c |   47 +++
 1 files changed, 23 insertions(+), 24 deletions(-)

diff --git a/board/rpxsuper/flash.c b/board/rpxsuper/flash.c
index be29b65..724ae88 100644
--- a/board/rpxsuper/flash.c
+++ b/board/rpxsuper/flash.c
@@ -47,41 +47,40 @@ static int write_word (flash_info_t *info, ulong dest, 
ulong data);
 /*---
  */
 
-unsigned long flash_init (void)
+unsigned long flash_init(void)
 {
-unsigned long size;
-int i;
+   unsigned long size;
+   int i;
 
-/* Init: no FLASHes known */
-for (i=0; iCONFIG_SYS_MAX_FLASH_BANKS; ++i) {
-   flash_info[i].flash_id = FLASH_UNKNOWN;
-}
+   /* Init: no FLASHes known */
+   for (i = 0; i  CONFIG_SYS_MAX_FLASH_BANKS; ++i)
+   flash_info[i].flash_id = FLASH_UNKNOWN;
 
-/* for now, only support the 4 MB Flash SIMM */
-size = flash_get_size((vu_long *)CONFIG_SYS_FLASH0_BASE, flash_info[0]);
+   /* for now, only support the 4 MB Flash SIMM */
+   size = flash_get_size((vu_long *) CONFIG_SYS_FLASH0_BASE,
+ flash_info[0]);
 
-/*
- * protect monitor and environment sectors
- */
+   /*
+* protect monitor and environment sectors
+*/
 
 #if CONFIG_SYS_MONITOR_BASE = CONFIG_SYS_FLASH0_BASE
-flash_protect(FLAG_PROTECT_SET,
- CONFIG_SYS_MONITOR_BASE,
- CONFIG_SYS_MONITOR_BASE+monitor_flash_len-1,
- flash_info[0]);
+   flash_protect(FLAG_PROTECT_SET,
+ CONFIG_SYS_MONITOR_BASE,
+ CONFIG_SYS_MONITOR_BASE + monitor_flash_len - 1,
+ flash_info[0]);
 #endif
 
 #if defined(CONFIG_ENV_IS_IN_FLASH)  defined(CONFIG_ENV_ADDR)
-# ifndef  CONFIG_ENV_SIZE
-#  define CONFIG_ENV_SIZE  CONFIG_ENV_SECT_SIZE
-# endif
-flash_protect(FLAG_PROTECT_SET,
- CONFIG_ENV_ADDR,
- CONFIG_ENV_ADDR + CONFIG_ENV_SIZE - 1,
- flash_info[0]);
+#ifndef CONFIG_ENV_SIZE
+#define CONFIG_ENV_SIZECONFIG_ENV_SECT_SIZE
+#endif
+   flash_protect(FLAG_PROTECT_SET,
+ CONFIG_ENV_ADDR,
+ CONFIG_ENV_ADDR + CONFIG_ENV_SIZE - 1, flash_info[0]);
 #endif
 
-return /*size*/ (CONFIG_SYS_FLASH0_SIZE * 1024 * 1024);
+   return /*size */ (CONFIG_SYS_FLASH0_SIZE * 1024 * 1024);
 }
 
 /*---
-- 
1.7.6.4

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


[U-Boot] [PATCH 13/22] board/hymod/input.c: Fix GCC 4.6 build warning

2011-11-05 Thread Wolfgang Denk
Fix:
input.c: In function 'hymod_get_ethaddr':
input.c:79:10: warning: variable 'ea' set but not used
[-Wunused-but-set-variable]

Signed-off-by: Wolfgang Denk w...@denx.de
Cc: Murray Jensen murray.jen...@csiro.au
---
 board/hymod/input.c |3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/board/hymod/input.c b/board/hymod/input.c
index 998132d..1a2b8d2 100644
--- a/board/hymod/input.c
+++ b/board/hymod/input.c
@@ -76,7 +76,6 @@ hymod_get_ethaddr (void)
if (n == 17) {
int i;
char *p, *q;
-   uchar ea[6];
 
/* see if it looks like an ethernet address */
 
@@ -85,7 +84,7 @@ hymod_get_ethaddr (void)
for (i = 0; i  6; i++) {
char term = (i == 5 ? '\0' : ':');
 
-   ea[i] = simple_strtol (p, q, 16);
+   (void)simple_strtol (p, q, 16);
 
if ((q - p) != 2 || *q++ != term)
break;
-- 
1.7.6.4

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


[U-Boot] [PATCH 16/22] board/rpxsuper/flash.c: Fix GCC 4.6 build warning

2011-11-05 Thread Wolfgang Denk
Fix:
flash.c: In function 'flash_init':
flash.c:52:19: warning: variable 'size' set but not used
[-Wunused-but-set-variable]

Signed-off-by: Wolfgang Denk w...@denx.de
---
 board/rpxsuper/flash.c |5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/board/rpxsuper/flash.c b/board/rpxsuper/flash.c
index 724ae88..70ae1d2 100644
--- a/board/rpxsuper/flash.c
+++ b/board/rpxsuper/flash.c
@@ -49,7 +49,6 @@ static int write_word (flash_info_t *info, ulong dest, ulong 
data);
 
 unsigned long flash_init(void)
 {
-   unsigned long size;
int i;
 
/* Init: no FLASHes known */
@@ -57,7 +56,7 @@ unsigned long flash_init(void)
flash_info[i].flash_id = FLASH_UNKNOWN;
 
/* for now, only support the 4 MB Flash SIMM */
-   size = flash_get_size((vu_long *) CONFIG_SYS_FLASH0_BASE,
+   (void)flash_get_size((vu_long *) CONFIG_SYS_FLASH0_BASE,
  flash_info[0]);
 
/*
@@ -80,7 +79,7 @@ unsigned long flash_init(void)
  CONFIG_ENV_ADDR + CONFIG_ENV_SIZE - 1, flash_info[0]);
 #endif
 
-   return /*size */ (CONFIG_SYS_FLASH0_SIZE * 1024 * 1024);
+   return CONFIG_SYS_FLASH0_SIZE * 1024 * 1024;
 }
 
 /*---
-- 
1.7.6.4

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


[U-Boot] [PATCH 18/22] board/sacsng/sacsng.c: Fix GCC 4.6 build warning

2011-11-05 Thread Wolfgang Denk
Fix:
sacsng.c: In function 'initdram':
sacsng.c:180:9: warning: variable 'spd_size' set but not used
[-Wunused-but-set-variable]

Signed-off-by: Wolfgang Denk w...@denx.de
Cc: Jerry Van Baren gerald.vanba...@smiths-aerospace.com
---
 board/sacsng/sacsng.c |2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/board/sacsng/sacsng.c b/board/sacsng/sacsng.c
index 09f59a0..536d7de 100644
--- a/board/sacsng/sacsng.c
+++ b/board/sacsng/sacsng.c
@@ -177,7 +177,6 @@ phys_size_t initdram(int board_type)
uint sdam;
uint bsma;
uint sda10;
-   u_char spd_size;
u_char data;
u_char cksum;
int j;
@@ -192,7 +191,6 @@ phys_size_t initdram(int board_type)
 * Read the SDRAM SPD EEPROM via I2C.
 */
i2c_read(SDRAM_SPD_ADDR, 0, 1, data, 1);
-   spd_size = data;
cksum = data;
for (j = 1; j  64; j++) {  /* read only the checksummed bytes */
/* note: the I2C address autoincrements when alen == 0 */
-- 
1.7.6.4

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


[U-Boot] [PATCH 11/22] board/gw8260/flash.c: Fix GCC 4.6 build warning

2011-11-05 Thread Wolfgang Denk
Fix:
flash.c: In function 'flash_init':
flash.c:81:16: warning: variable 'size' set but not used
[-Wunused-but-set-variable]

Signed-off-by: Wolfgang Denk w...@denx.de
Cc: Oliver Brown obr...@adventnetworks.com
---
 board/gw8260/flash.c |3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/board/gw8260/flash.c b/board/gw8260/flash.c
index c1c26ea..fb29659 100644
--- a/board/gw8260/flash.c
+++ b/board/gw8260/flash.c
@@ -78,7 +78,6 @@ static int write_word (flash_info_t *info, ulong dest, ulong 
data);
  */
 unsigned long flash_init(void)
 {
-   unsigned long size;
int i;
 
/* Init: no FLASHes known */
@@ -86,7 +85,7 @@ unsigned long flash_init(void)
flash_info[i].flash_id = FLASH_UNKNOWN;
 
/* for now, only support the 4 MB Flash SIMM */
-   size = flash_get_size((vu_long *) CONFIG_SYS_FLASH0_BASE,
+   (void)flash_get_size((vu_long *) CONFIG_SYS_FLASH0_BASE,
  flash_info[0]);
/*
 * protect monitor and environment sectors
-- 
1.7.6.4

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


[U-Boot] [PATCH 09/22] board/cogent/flash.c: Fix GCC 4.6 buiild warning

2011-11-05 Thread Wolfgang Denk
Fix:
flash.c: In function 'flash_init':
flash.c:295:16: warning: variable 'fip' set but not used
[-Wunused-but-set-variable]

Signed-off-by: Wolfgang Denk w...@denx.de
Cc: Murray Jensen murray.jen...@csiro.au
---
 board/cogent/flash.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/board/cogent/flash.c b/board/cogent/flash.c
index e6c85b6..ec3f94d 100644
--- a/board/cogent/flash.c
+++ b/board/cogent/flash.c
@@ -23,6 +23,7 @@
 
 #include common.h
 #include board/cogent/flash.h
+#include linux/compiler.h
 
 flash_info_t   flash_info[CONFIG_SYS_MAX_FLASH_BANKS]; /* info for FLASH chips 
*/
 
@@ -292,7 +293,7 @@ flash_init(void)
 {
unsigned long total;
int i;
-   flash_info_t *fip;
+   __maybe_unused flash_info_t *fip;
 
/* Init: no FLASHes known */
for (i=0; iCONFIG_SYS_MAX_FLASH_BANKS; ++i) {
-- 
1.7.6.4

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


[U-Boot] [PATCH 17/22] board/sacsng/sacsng.c: CodingStyle cleanup

2011-11-05 Thread Wolfgang Denk
Make (mostly) checkpatch clean.

Signed-off-by: Wolfgang Denk w...@denx.de
Cc: Jerry Van Baren gerald.vanba...@smiths-aerospace.com
---
 board/sacsng/sacsng.c | 1329 -
 1 files changed, 663 insertions(+), 666 deletions(-)

diff --git a/board/sacsng/sacsng.c b/board/sacsng/sacsng.c
index 61cab87..09f59a0 100644
--- a/board/sacsng/sacsng.c
+++ b/board/sacsng/sacsng.c
@@ -39,7 +39,7 @@ extern void eth_loopback_test(void);
 #endif /* CONFIG_ETHER_LOOPBACK_TEST */
 
 #include clkinit.h
-#include ioconfig.h /* I/O configuration table */
+#include ioconfig.h  /* I/O configuration table */
 
 /*
  * PBI Page Based Interleaving
@@ -61,88 +61,86 @@ extern void eth_loopback_test(void);
 /*
  * ADC/DAC Defines:
  */
-#define INITIAL_SAMPLE_RATE 10016 /* Initial Daq sample rate */
-#define INITIAL_RIGHT_JUST  0 /* Initial DAC right justification */
-#define INITIAL_MCLK_DIVIDE 0 /* Initial MCLK Divide */
-#define INITIAL_SAMPLE_64X  1 /* Initial  64x clocking mode */
-#define INITIAL_SAMPLE_128X 0 /* Initial 128x clocking mode */
+#define INITIAL_SAMPLE_RATE 10016  /* Initial Daq sample rate */
+#define INITIAL_RIGHT_JUST  0  /* Initial DAC right justification */
+#define INITIAL_MCLK_DIVIDE 0  /* Initial MCLK Divide */
+#define INITIAL_SAMPLE_64X  1  /* Initial  64x clocking mode */
+#define INITIAL_SAMPLE_128X 0  /* Initial 128x clocking mode */
 
 /*
  * ADC Defines:
  */
-#define I2C_ADC_1_ADDR 0x0E   /* I2C Address of the ADC #1 */
-#define I2C_ADC_2_ADDR 0x0F   /* I2C Address of the ADC #2 */
+#define I2C_ADC_1_ADDR 0x0E/* I2C Address of the ADC #1 */
+#define I2C_ADC_2_ADDR 0x0F/* I2C Address of the ADC #2 */
 
-#define ADC_SDATA1_MASK 0x0002/* PA14 - CH12SDATA_PU   */
-#define ADC_SDATA2_MASK 0x0001/* PA15 - CH34SDATA_PU   */
+#define ADC_SDATA1_MASK 0x0002 /* PA14 - CH12SDATA_PU   */
+#define ADC_SDATA2_MASK 0x0001 /* PA15 - CH34SDATA_PU   */
 
-#define ADC_VREF_CAP   100/* VREF capacitor in uF */
-#define ADC_INITIAL_DELAY (10 * ADC_VREF_CAP) /* 10 usec per uF, in usec */
-#define ADC_SDATA_DELAY100/* ADC SDATA release delay in usec */
+#define ADC_VREF_CAP   100 /* VREF capacitor in uF */
+#define ADC_INITIAL_DELAY (10 * ADC_VREF_CAP)  /* 10 usec per uF, in usec */
+#define ADC_SDATA_DELAY100 /* ADC SDATA release delay in 
usec */
 #define ADC_CAL_DELAY (100 / INITIAL_SAMPLE_RATE * 4500)
- /* Wait at least 4100 LRCLK's */
-
-#define ADC_REG1_FRAME_START0x80  /* Frame start */
-#define ADC_REG1_GROUND_CAL 0x40  /* Ground calibration enable */
-#define ADC_REG1_ANA_MOD_PDOWN  0x20  /* Analog modulator section in power 
down */
-#define ADC_REG1_DIG_MOD_PDOWN  0x10  /* Digital modulator section in power 
down */
-
-#define ADC_REG2_128x   0x80  /* Oversample at 128x */
-#define ADC_REG2_CAL0x40  /* System calibration enable */
-#define ADC_REG2_CHANGE_SIGN0x20  /* Change sign enable */
-#define ADC_REG2_LR_DISABLE 0x10  /* Left/Right output disable */
-#define ADC_REG2_HIGH_PASS_DIS  0x08  /* High pass filter disable */
-#define ADC_REG2_SLAVE_MODE 0x04  /* Slave mode */
-#define ADC_REG2_DFS0x02  /* Digital format select */
-#define ADC_REG2_MUTE   0x01  /* Mute */
-
-#define ADC_REG7_ADDR_ENABLE0x80  /* Address enable */
-#define ADC_REG7_PEAK_ENABLE0x40  /* Peak enable */
-#define ADC_REG7_PEAK_UPDATE0x20  /* Peak update */
-#define ADC_REG7_PEAK_FORMAT0x10  /* Peak display format */
-#define ADC_REG7_DIG_FILT_PDOWN 0x04  /* Digital filter power down enable */
-#define ADC_REG7_FIR2_IN_EN 0x02  /* External FIR2 input enable */
-#define ADC_REG7_PSYCHO_EN  0x01  /* External pyscho filter input enable */
+   /* Wait at least 4100 LRCLK's */
+
+#define ADC_REG1_FRAME_START0x80   /* Frame start */
+#define ADC_REG1_GROUND_CAL 0x40   /* Ground calibration enable */
+#define ADC_REG1_ANA_MOD_PDOWN  0x20   /* Analog modulator section in power 
down */
+#define ADC_REG1_DIG_MOD_PDOWN  0x10   /* Digital modulator section in power 
down */
+
+#define ADC_REG2_128x   0x80   /* Oversample at 128x */
+#define ADC_REG2_CAL0x40   /* System calibration enable */
+#define ADC_REG2_CHANGE_SIGN0x20   /* Change sign enable */
+#define ADC_REG2_LR_DISABLE 0x10   /* Left/Right output disable */
+#define ADC_REG2_HIGH_PASS_DIS  0x08   /* High pass filter disable */
+#define ADC_REG2_SLAVE_MODE 0x04   /* Slave mode */
+#define ADC_REG2_DFS0x02   /* Digital format select */
+#define ADC_REG2_MUTE   0x01   /* Mute */
+
+#define ADC_REG7_ADDR_ENABLE0x80   /* Address enable */
+#define ADC_REG7_PEAK_ENABLE0x40   /* Peak enable */
+#define ADC_REG7_PEAK_UPDATE0x20   /* Peak update */
+#define 

Re: [U-Boot] [PATCH] dfu: initial implementation

2011-11-05 Thread Wolfgang Denk
Dear Andrzej Pietrasiewicz,

In message 000601cc9abe$4f544bd0$edfce370$%p...@samsung.com you wrote:
 
   http://www.usb.org/developers/devclass_docs/DFU_1.1.pdf
 
 DFU is part of USB; an extension to be precise, but an extension bound
 so tightly to the design and philosophy of USB that it is rather
 inconceivable to separate the two.

Could you please be so kind and explain which exact issues you see for
such a separation?

  Eventually it should be possible to run this protocol over Ethernet or
  even over a serial line?
 
 Of course there is no such a reason, provided we lay USB over Ethernet
 or serial line first ;)

This is of course not intended.  I was thinking about a plain standard
UDP based link.

 Seriously speaking, in view of ties between DFU and USB
 IMHO it is impossible, or, at least, highly impractical.

Can you please support this statement with a few facts?

  If my assumption is correct, then what would it take to split off
  protocol part and make it independent of the actual driver interface?
 
 I guess that in the situation given it would be of little use.

What do you think would be of little use?

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
This restaurant was advertising breakfast  any  time.  So  I  ordered
french toast in the renaissance.- Steven Wright, comedian
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] dfu: initial implementation

2011-11-05 Thread Wolfgang Denk
Dear Stefan Schmidt,

In message 2002200717.GP17069@excalibur.local you wrote:

 While I think a dfu command is usefull I don't like the need to
 execute it before any DFU interaction can happen. That may be an
 option during development but for field upgrades or receovery it is
 not.

Yes, a command is the natural way in U-Boot to start any activities.

 I already wrote a bit about my approach here. At OpenMoko we used a
 button to enter u-boot during startup when pressed. This offered a

This is just another way to start a command.

 usbtty interface as usb gadget as well as the runtime descripto for
 DFU. With dfu-util it was possible to iniate the DFU download or
 upload procedure while being in the mode. Another option would be to
 directly jump into DFU mode when a button is pressed.

NAK.  Let's stick to standard interfaces.

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
Each honest calling, each walk of life, has its own  elite,  its  own
aristocracy based on excellence of performance. - James Bryant Conant
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v0 1/4] Groundwork for generalization of env interface

2011-11-05 Thread Wolfgang Denk
Dear Gerlando Falauto,

In message 1319647072-17504-2-git-send-email-gerlando.fala...@keymile.com you 
wrote:
 Signed-off-by: Gerlando Falauto gerlando.fala...@keymile.com
 ---
  common/cmd_nvedit.c   |  152 
 +++--
  common/env_common.c   |   15 -
  include/environment.h |7 ++
  include/search.h  |   13 
  lib/hashtable.c   |   50 
  5 files changed, 179 insertions(+), 58 deletions(-)
...
 -int _do_env_set (int flag, int argc, char * const argv[])
 +int env_check_apply(const char *name, const char *oldval,
 + const char *newval, int flag)

Please use only TAB for indentation.  Please fix globally.


 - if (ep) {   /* variable exists */
 + if ((oldval != NULL) /* variable exists */
 +   ((flag  H_FORCE) == 0)) { /* and we are not forced */

Incorrect indentation.


 +/*
 + * Set a new environment variable,
 + * or replace or delete an existing one.
 +*/

Incorrect multiline comment style.

 + /* Perform requested checks. Notice how since we are overwriting
 +  * a single variable, we need to set H_NOCLEAR */

Incorrect multiline comment style.

  void set_default_env(const char *s)
  {
 + /* By default, do not apply changes as they will eventually
 +  * be applied by someone else */

Incorrect multiline comment style.

Please fix globally!

 + if (himport_ex(env_htab, (char *)default_environment,
 + sizeof(default_environment), '\0', 0,
 +   0, NULL, apply_function) == 0) {

Incorrect / inconsistent indentation.  Please fix globally.


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
Applying computer technology is simply finding the  right  wrench  to
pound in the correct screw.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v0 2/4] env: check and apply changes on delete/destroy

2011-11-05 Thread Wolfgang Denk
Dear Gerlando Falauto,

In message 1319647072-17504-3-git-send-email-gerlando.fala...@keymile.com you 
wrote:
 Signed-off-by: Gerlando Falauto gerlando.fala...@keymile.com
 ---
  common/cmd_nvedit.c |2 +-
  include/search.h|6 --
  lib/hashtable.c |   18 --
  3 files changed, 17 insertions(+), 9 deletions(-)

Are you sure these changes are really independent from the previous
and following ones?  Ordo we introduc bisectability issues here?


 -extern void hdestroy_r(struct hsearch_data *__htab);
 +extern void hdestroy_r(struct hsearch_data *__htab,
 +apply_cb apply);

See provious comments - indentation always by TAB. Please fix
globally, i. e. in all your patches.


 + if (apply != NULL) {
 + /* deletion is always forced */

Um why is this the case?

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
  Is there a way to determine Yesterday's date using Unix utilities?
 echo what is yesterday's date? | /bin/mail root
 -- Randal L. Schwartz in ukbuh2y982@julie.teleport.com
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v0 1/4] Groundwork for generalization of env interface

2011-11-05 Thread Wolfgang Denk
Dear Gerlando Falauto,

In message 1319647072-17504-2-git-send-email-gerlando.fala...@keymile.com you 
wrote:
 Signed-off-by: Gerlando Falauto gerlando.fala...@keymile.com
 ---
  common/cmd_nvedit.c   |  152 
 +++--
  common/env_common.c   |   15 -
  include/environment.h |7 ++
  include/search.h  |   13 
  lib/hashtable.c   |   50 
  5 files changed, 179 insertions(+), 58 deletions(-)

This patch introduces new build warnings:

cmd_nvedit.c: In function 'env_check_apply':
cmd_nvedit.c:242:3: warning: passing argument 1 of 'serial_assign'
discards 'const' qualifier from pointer target type [enabled by
default]
/home/wd/git/u-boot/env-substitute/include/serial.h:95:12: note:
expected 'char *' but argument is of type 'const char *'

Please fix.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
A year spent in artificial intelligence is enough to make one believe
in God.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v0 3/4] env: implement selective env default

2011-11-05 Thread Wolfgang Denk
Dear Gerlando Falauto,

In message 1319647072-17504-4-git-send-email-gerlando.fala...@keymile.com you 
wrote:
 Signed-off-by: Gerlando Falauto gerlando.fala...@keymile.com
 ---
  README   |2 ++
  common/cmd_nvedit.c  |   42 --
  common/env_common.c  |   14 ++
  include/config_cmd_all.h |1 +
  include/environment.h|5 +
  5 files changed, 58 insertions(+), 6 deletions(-)

Did you actually ever try to compile your code, and test it?

...
 +#if CONFIG_CMD_DEFAULTENV_VARS

When I try and enable your code by adding

#define CONFIG_CMD_DEFAULTENV_VARS

to a board config file, this will result in a an error:

cmd_nvedit.c:699:31: error: #if with no expression


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
Copy from one, it's plagiarism; copy from two, it's research.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH V4] sandbox: Add improved RAM simulation

2011-11-05 Thread Mike Frysinger
Acked-by: Mike Frysinger vap...@gentoo.org
-mike


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


Re: [U-Boot] [PATCH v0 1/7] x86: Punt cold- and warm-boot flags

2011-11-05 Thread Mike Frysinger
On Friday 04 November 2011 22:21:45 Graeme Russ wrote:
 Nobody uses them anyway

thanks !  this was the only hold out i had with gd flag unification (hrm, did i 
forget to post that patch?).

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


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


Re: [U-Boot] nds32: toolchains for building ?

2011-11-05 Thread Mike Frysinger
On Friday 04 November 2011 21:35:02 馬克泡 wrote:
 2011/11/5 Mike Frysinger vap...@gentoo.org:
  On Friday 04 November 2011 18:22:32 Mike Frysinger wrote:
  On Friday 04 November 2011 04:24:51 馬克泡 wrote:
   It's pity that only you can found the toolchain with full source from
   public is very old.
   I can give you the url as follows.
   http://osdk.andestech.com/
  
  yes, i d/l-ed that monster of a .rar (which contains .tar.gz which
  themselves contain .tar.gz .), but the linker in there segfaults for
  me :(
 
 The old toolchain contains a lot of bugs, even the implementation of
 rpath has problems.
 Please do not waste your time!
 I'll try to get one for you next week. :)

thanks.  i think you should still fix that linker script issue i pointed out as 
it seems like the linker is putting stuff after the _end/.bss in your u-boot 
image ... not that i can double check as i can't link the final ELF and analyze 
it :).
-mike


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


Re: [U-Boot] [PATCH v8 1/4] gpio: Modify common gpio.h to more closely match Linux

2011-11-05 Thread Mike Frysinger
Acked-by: Mike Frysinger vap...@gentoo.org
-mike


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


Re: [U-Boot] [PATCH v8 3/4] mpc83xx: Add a GPIO driver for the MPC83XX family

2011-11-05 Thread Mike Frysinger
On Friday 04 November 2011 22:25:00 Joe Hershberger wrote:
 --- /dev/null
 +++ b/arch/powerpc/include/asm/arch-mpc83xx/gpio.h

 +#if defined(CONFIG_MPC8313) || defined(CONFIG_MPC8308) || \
 + defined(CONFIG_MPC8315)
 + #define MPC83XX_GPIO_CTRLRS 1
 +#elif defined(CONFIG_MPC834x) || defined(CONFIG_MPC837x)
 + #define MPC83XX_GPIO_CTRLRS 2
 +#else
 + #define MPC83XX_GPIO_CTRLRS 0
 +#endif

there should not be whitespace before the #

 --- /dev/null
 +++ b/drivers/gpio/mpc83xx_gpio.c

 +#ifndef CONFIG_MPC83XX_GPIO_0_INIT_DIRECTION
 + #define CONFIG_MPC83XX_GPIO_0_INIT_DIRECTION 0
 +#endif
 +#ifndef CONFIG_MPC83XX_GPIO_1_INIT_DIRECTION
 + #define CONFIG_MPC83XX_GPIO_1_INIT_DIRECTION 0
 +#endif
 +#ifndef CONFIG_MPC83XX_GPIO_0_INIT_OPEN_DRAIN
 + #define CONFIG_MPC83XX_GPIO_0_INIT_OPEN_DRAIN 0
 +#endif
 +#ifndef CONFIG_MPC83XX_GPIO_1_INIT_OPEN_DRAIN
 + #define CONFIG_MPC83XX_GPIO_1_INIT_OPEN_DRAIN 0
 +#endif
 +#ifndef CONFIG_MPC83XX_GPIO_0_INIT_VALUE
 + #define CONFIG_MPC83XX_GPIO_0_INIT_VALUE 0
 +#endif
 +#ifndef CONFIG_MPC83XX_GPIO_1_INIT_VALUE
 + #define CONFIG_MPC83XX_GPIO_1_INIT_VALUE 0
 +#endif

same here
-mike


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


Re: [U-Boot] [PATCH v2 6/8] tegra2: Implement SPI / UART GPIO switch

2011-11-05 Thread Mike Frysinger
On Saturday 05 November 2011 10:43:07 Simon Glass wrote:
 On Thu, Nov 3, 2011 at 6:44 PM, Mike Frysinger wrote:
  On Thursday 03 November 2011 18:41:37 Simon Glass wrote:
  Since we are adding a second file to board/nvidia/common, we create
  a proper Makefile there and remove the direct board.o include from
  board/nvidia/seaboard/Makefile
  
  so who is including board/nvidia/common/libnvidia.o now ?
 
 No one - it doesn't exist and that directory doesn't have a Makefile.
 The top-level Makefile doesn't require it, but since I now have more
 than one object file I want to create a library.

this patchset adds:
 board/nvidia/common/Makefile   |   47 +++

which creates a libnvidia.o.  so once this patch is applied, how is 
libnvidia.o getting linked in ?
-mike


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


Re: [U-Boot] [PATCH v2 3/8] tegra2: spi: Add SPI driver for Tegra2 SOC

2011-11-05 Thread Mike Frysinger
On Saturday 05 November 2011 10:36:30 Simon Glass wrote:
 On Thu, Nov 3, 2011 at 6:36 PM, Mike Frysinger wrote:
  On Thursday 03 November 2011 18:41:34 Simon Glass wrote:
  --- /dev/null
  +++ b/drivers/spi/tegra2_spi.c
  
  +int spi_cs_is_valid(unsigned int bus, unsigned int cs)
  +{
  + /* Tegra2 SPI-Flash - only 1 device ('bus/cs') */
  + if (bus  0  cs != 0)
  + return 0;
  + else
  + return 1;
  +}
  
  shouldn't that be || and not  ?
 
 This function should be removed as it doesn't print enough errors.

this func is part of the SPI API.  you can't remove it ;).

  +struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs,
  + unsigned int max_hz, unsigned int mode)
  +{
  + struct tegra_spi_slave *spi;
  +
  + if (!spi_cs_is_valid(bus, cs))
  + return NULL;
  +
  + if (bus != 0) {
  + printf(SPI error: unsupported bus %d\n, bus);
  + return NULL;
  + }
  + if (cs != 0) {
  + printf(SPI error: unsupported chip select %d on bus
  %d\n, +cs, bus);
  + return NULL;
  + }
  
  doesn't spi_cs_is_valid() make these two later checks redundant ?
 
 Yes - have removed the function.

i think this is the wrong direction ... other SPI buses are not warning about 
invalid bus/cs combos and that seems to be fine.  i don't think the tegra spi 
bus needs to be uniquely verbose.

  + reg = readl(regs-status);
  + writel(reg, regs-status); /* Clear all SPI events via R/W */
  
  are these R1C or W1C bits ?  if the latter, you could just write -1 and
  avoid the read altogether ...
 
 The next line is:
 
   debug(spi_xfer entry: STATUS = %08x\n, reg);
 
 and I didn't want to remove that, so I need to keep the read
 unfortunately. It could perhaps be this if you are keen:
 
 writel(-1, regs-status); /* Clear all SPI events via R/W */
 debug(spi_xfer entry: STATUS = %08x\n, readl(reg-status));

what you have now is fine if you prefer it that way
-mike


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


[U-Boot] [PATCH] Blackfin: cache result of cpp check

2011-11-05 Thread Mike Frysinger
Avoid overhead of computing this value multiple times.

Signed-off-by: Mike Frysinger vap...@gentoo.org
---
 arch/blackfin/config.mk |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/arch/blackfin/config.mk b/arch/blackfin/config.mk
index f9d46de..3595aa2 100644
--- a/arch/blackfin/config.mk
+++ b/arch/blackfin/config.mk
@@ -48,9 +48,10 @@ ALL-y += $(obj)u-boot.ldr
 endif
 ifeq ($(CONFIG_ENV_IS_EMBEDDED_IN_LDR),y)
 CREATE_LDR_ENV = $(obj)tools/envcrc --binary  $(obj)env-ldr.o
-HOSTCFLAGS_NOPED += \
+HOSTCFLAGS_NOPED_ADSP := \
$(shell $(CPP) -dD - -mcpu=$(CONFIG_BFIN_CPU) /dev/null \
| awk '$$2 ~ /ADSP/ { print -D $$2 }')
+HOSTCFLAGS_NOPED += $(HOSTCFLAGS_NOPED_ADSP)
 else
 CREATE_LDR_ENV =
 endif
-- 
1.7.6.1

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


[U-Boot] [PATCH/RFC] global_data: unify global flag defines

2011-11-05 Thread Mike Frysinger
All the global flag defines are the same across all arches (ignoring two
unique x86 ones).  So unify them in one place, and add a simple way for
arches to extend for their needs.

Signed-off-by: Mike Frysinger vap...@gentoo.org
---
note: this depends on Graeme's x86 boot flag clean up

 arch/arm/include/asm/global_data.h|   14 +---
 arch/avr32/include/asm/global_data.h  |   14 +---
 arch/blackfin/include/asm/global_data.h   |   14 +---
 arch/m68k/include/asm/global_data.h   |   14 +---
 arch/microblaze/include/asm/global_data.h |   14 +---
 arch/mips/include/asm/global_data.h   |   14 +---
 arch/nds32/include/asm/global_data.h  |   14 +---
 arch/nios2/include/asm/global_data.h  |   10 +
 arch/powerpc/include/asm/global_data.h|   14 +---
 arch/sandbox/include/asm/global_data.h|   14 +---
 arch/sh/include/asm/global_data.h |9 +---
 arch/sparc/include/asm/global_data.h  |   14 +---
 arch/x86/include/asm/global_data.h|   16 +-
 include/asm-generic/global_data_flags.h   |   33 +
 14 files changed, 46 insertions(+), 162 deletions(-)
 create mode 100644 include/asm-generic/global_data_flags.h

diff --git a/arch/arm/include/asm/global_data.h 
b/arch/arm/include/asm/global_data.h
index c3ff789..f8088fe 100644
--- a/arch/arm/include/asm/global_data.h
+++ b/arch/arm/include/asm/global_data.h
@@ -29,8 +29,6 @@
  * some locked parts of the data cache) to allow for a minimum set of
  * global variables during system initialization (until we have set
  * up the memory controller so that we can use RAM).
- *
- * Keep it *SMALL* and remember to set GENERATED_GBL_DATA_SIZE  sizeof(gd_t)
  */
 
 typedefstruct  global_data {
@@ -86,17 +84,7 @@ typedef  struct  global_data {
 #endif
 } gd_t;
 
-/*
- * Global Data Flags
- */
-#defineGD_FLG_RELOC0x1 /* Code was relocated to RAM
*/
-#defineGD_FLG_DEVINIT  0x2 /* Devices have been 
initialized*/
-#defineGD_FLG_SILENT   0x4 /* Silent mode  
*/
-#defineGD_FLG_POSTFAIL 0x8 /* Critical POST test failed
*/
-#defineGD_FLG_POSTSTOP 0x00010 /* POST seqeunce aborted
*/
-#defineGD_FLG_LOGINIT  0x00020 /* Log Buffer has been 
initialized  */
-#define GD_FLG_DISABLE_CONSOLE 0x00040 /* Disable console (in  out)   
*/
-#define GD_FLG_ENV_READY   0x00080 /* Environment imported into hash table 
*/
+#include asm-generic/global_data_flags.h
 
 #define DECLARE_GLOBAL_DATA_PTR register volatile gd_t *gd asm (r8)
 
diff --git a/arch/avr32/include/asm/global_data.h 
b/arch/avr32/include/asm/global_data.h
index 5c654bd..7878bb1 100644
--- a/arch/avr32/include/asm/global_data.h
+++ b/arch/avr32/include/asm/global_data.h
@@ -28,8 +28,6 @@
  * some locked parts of the data cache) to allow for a minimum set of
  * global variables during system initialization (until we have set
  * up the memory controller so that we can use RAM).
- *
- * Keep it *SMALL* and remember to set GENERATED_GBL_DATA_SIZE  sizeof(gd_t)
  */
 
 typedefstruct  global_data {
@@ -52,17 +50,7 @@ typedef  struct  global_data {
charenv_buf[32];/* buffer for getenv() before reloc. */
 } gd_t;
 
-/*
- * Global Data Flags
- */
-#defineGD_FLG_RELOC0x1 /* Code was relocated to RAM
*/
-#defineGD_FLG_DEVINIT  0x2 /* Devices have been 
initialized*/
-#defineGD_FLG_SILENT   0x4 /* Silent mode  
*/
-#defineGD_FLG_POSTFAIL 0x8 /* Critical POST test failed
*/
-#defineGD_FLG_POSTSTOP 0x00010 /* POST seqeunce aborted
*/
-#defineGD_FLG_LOGINIT  0x00020 /* Log Buffer has been 
initialized  */
-#define GD_FLG_DISABLE_CONSOLE 0x00040 /* Disable console (in  out)   
*/
-#define GD_FLG_ENV_READY   0x00080 /* Environment imported into hash table 
*/
+#include asm-generic/global_data_flags.h
 
 #define DECLARE_GLOBAL_DATA_PTR register gd_t *gd asm(r5)
 
diff --git a/arch/blackfin/include/asm/global_data.h 
b/arch/blackfin/include/asm/global_data.h
index 67aa30f..ad42e91 100644
--- a/arch/blackfin/include/asm/global_data.h
+++ b/arch/blackfin/include/asm/global_data.h
@@ -36,8 +36,6 @@
  * some locked parts of the data cache) to allow for a minimum set of
  * global variables during system initialization (until we have set
  * up the memory controller so that we can use RAM).
- *
- * Keep it *SMALL* and remember to set GENERATED_GBL_DATA_SIZE  sizeof(gd_t)
  */
 typedef struct global_data {
bd_t *bd;
@@ -61,17 +59,7 @@ typedef struct global_data {
charenv_buf[32];/* buffer for getenv() 

Re: [U-Boot] [PATCH v2 1/3] image: Make image_get_fdt work like image_get_{ram_disk, kernel}

2011-11-05 Thread Marek Vasut
 image_get_ram_disk() and image_get_kernel() perform operations in a
 consistent order. Modify image_get_fdt() to do things the same way.
 This allows a later change to insert some image header manipulations
 into these three functions in a consistent fashion.
 
 v2: New patch
 
 Signed-off-by: Stephen Warren swar...@nvidia.com

Hi Stephen,

this patchset is good and all, but can we not also introduce cmd_zload to load 
zImages? Wolfgang, today's ARM hardware will really benefit from that, uImage 
holds us back a lot these days. Other option is to extend cmd_bootm() to load 
zImages.

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


Re: [U-Boot] [PATCH v2 6/8] tegra2: Implement SPI / UART GPIO switch

2011-11-05 Thread Simon Glass
Hi Mike,

On Sat, Nov 5, 2011 at 10:11 AM, Mike Frysinger vap...@gentoo.org wrote:
 On Saturday 05 November 2011 10:43:07 Simon Glass wrote:
 On Thu, Nov 3, 2011 at 6:44 PM, Mike Frysinger wrote:
  On Thursday 03 November 2011 18:41:37 Simon Glass wrote:
  Since we are adding a second file to board/nvidia/common, we create
  a proper Makefile there and remove the direct board.o include from
  board/nvidia/seaboard/Makefile
 
  so who is including board/nvidia/common/libnvidia.o now ?

 No one - it doesn't exist and that directory doesn't have a Makefile.
 The top-level Makefile doesn't require it, but since I now have more
 than one object file I want to create a library.

 this patchset adds:
  board/nvidia/common/Makefile                       |   47 +++

 which creates a libnvidia.o.  so once this patch is applied, how is
 libnvidia.o getting linked in ?
 -mike


There is a bit of the top-level Makefile which does this:

LIBS += $(shell if [ -f board/$(VENDOR)/common/Makefile ]; then echo \
board/$(VENDOR)/common/lib$(VENDOR).o; fi)

but it is only activated if it sees a Makefile there. By adding it,
the library is created for me.

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


Re: [U-Boot] [PATCH v2 3/8] tegra2: spi: Add SPI driver for Tegra2 SOC

2011-11-05 Thread Simon Glass
Hi Mike,

On Sat, Nov 5, 2011 at 10:13 AM, Mike Frysinger vap...@gentoo.org wrote:
 On Saturday 05 November 2011 10:36:30 Simon Glass wrote:
 On Thu, Nov 3, 2011 at 6:36 PM, Mike Frysinger wrote:
  On Thursday 03 November 2011 18:41:34 Simon Glass wrote:
  --- /dev/null
  +++ b/drivers/spi/tegra2_spi.c
 
  +int spi_cs_is_valid(unsigned int bus, unsigned int cs)
  +{
  +     /* Tegra2 SPI-Flash - only 1 device ('bus/cs') */
  +     if (bus  0  cs != 0)
  +             return 0;
  +     else
  +             return 1;
  +}
 
  shouldn't that be || and not  ?

 This function should be removed as it doesn't print enough errors.

 this func is part of the SPI API.  you can't remove it ;).

OK - it seems to only be used by the mmc_spi command which Tegra isn't
using. But I will add it back in. (Should it be called in
spi_flash_probe(), for example?)


  +struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs,
  +             unsigned int max_hz, unsigned int mode)
  +{
  +     struct tegra_spi_slave *spi;
  +
  +     if (!spi_cs_is_valid(bus, cs))
  +             return NULL;
  +
  +     if (bus != 0) {
  +             printf(SPI error: unsupported bus %d\n, bus);
  +             return NULL;
  +     }
  +     if (cs != 0) {
  +             printf(SPI error: unsupported chip select %d on bus
  %d\n, +                    cs, bus);
  +             return NULL;
  +     }
 
  doesn't spi_cs_is_valid() make these two later checks redundant ?

 Yes - have removed the function.

 i think this is the wrong direction ... other SPI buses are not warning about
 invalid bus/cs combos and that seems to be fine.  i don't think the tegra spi
 bus needs to be uniquely verbose.

OK, I was lead astray by the OMAP code which does this. I will revert
and resend this patch.


  +     reg = readl(regs-status);
  +     writel(reg, regs-status);     /* Clear all SPI events via R/W */
 
  are these R1C or W1C bits ?  if the latter, you could just write -1 and
  avoid the read altogether ...

 The next line is:

       debug(spi_xfer entry: STATUS = %08x\n, reg);

 and I didn't want to remove that, so I need to keep the read
 unfortunately. It could perhaps be this if you are keen:

 writel(-1, regs-status);     /* Clear all SPI events via R/W */
 debug(spi_xfer entry: STATUS = %08x\n, readl(reg-status));

 what you have now is fine if you prefer it that way
 -mike


OK - I will leave it. I have already modified Tom's driver more than is polite.

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


  1   2   >