Re: [U-Boot] ubi part failing on NAND

2009-12-18 Thread Stefan Roese
Jeff,

On Thursday 17 December 2009 22:09:03 Jeff Angielski wrote:
> The "ubi part" command is failing for me on my PowerPC 85xx board.  I am
> not trying to do anything special, just create the partitions and
> volumes so that I can try writing an ubi.img.  It spits out enough
> information that it looks like it did work but it prints out an error
> nonetheless.
> 
> And of course there is the long standing issue of the reported MTD
> number not making any sense.  But previous posts have discounted this as
> an issue.

Patches to fix/change this are welcome. :)
 
> Here is the snippet of the error:
> 
> UBI error: ubi_init: cannot attach mtd2
> UBI: mtd2 is detached from ubi0
> UBI error: ubi_init: UBI error: cannot initialize UBI, error -17
> UBI init error -17

-17 == EEXIST. Looking at the code (build.c) shows that ubi_attach_mtd_dev() 
is returning this error code in case the MTD device is already attached. Even 
though the UBI implementation should handle this without any problems. I have 
to admit that I'm a bit out of ideas what's going wrong in your case. I just 
checked again and UBI works fine for me with the latest version:


=> mtdparts  

device nand0 , # parts = 3
 #: namesizeoffset  mask_flags
 0: bootloader  0x0010  0x  0 
 1: rootfs  0x0100  0x0010  0 
 2: ubifs   0x02f0  0x0110  0 

active partition: nand0,0 - (bootloader) 0x0010 @ 0x

defaults:
mtdids  : nand0=nand
mtdparts: mtdparts=nand:1m(bootloader),16m(rootfs),-(ubifs)
=> nand erase 110 2f0  

NAND erase: device 0 offset 0x110, size 0x2f0
Erasing at 0x3ffc000 -- 100% complete.   
OK   
=> ubi part ubifs
Creating 1 MTD partitions on "nand0":
0x0110-0x0400 : "mtd=2"  
UBI: attaching mtd1 to ubi0  
UBI: physical eraseblock size:   16384 bytes (16 KiB)
UBI: logical eraseblock size:15872 bytes 
UBI: smallest flash I/O unit:512 
UBI: sub-page size:  256 
UBI: VID header offset:  256 (aligned 256)   
UBI: data offset:512 
UBI: empty MTD device detected   
UBI: create volume table (copy #1)   
UBI: create volume table (copy #2)   
UBI: attached mtd1 to ubi0   
UBI: MTD device name:"mtd=2" 
UBI: MTD device size:47 MiB  
UBI: number of good PEBs:3008
UBI: number of bad PEBs: 0   
UBI: max. allowed volumes:   92  
UBI: wear-leveling threshold:4096
UBI: number of internal volumes: 1   
UBI: number of user volumes: 0   
UBI: available PEBs: 2974
UBI: total number of reserved PEBs: 34   
UBI: number of PEBs reserved for bad PEB handling: 30
UBI: max/mean erase counter: 0/0 
=> mtdparts  

device nand0 , # parts = 3
 #: namesizeoffset  mask_flags
 0: bootloader  0x0010  0x  0 
 1: rootfs  0x0100  0x0010  0 
 2: ubifs   0x02f0  0x0110  0 

active partition: nand0,0 - (bootloader) 0x0010 @ 0x

defaults:
mtdids  : nand0=nand
mtdparts: mtdparts=nand:1m(bootloader),16m(rootfs),-(ubifs)
=> nand erase 10 100   

NAND erase: device 0 offset 0x10, size 0x100
Erasing at 0x10fc000 -- 100% complete.
OK
=> ubi part rootfs
UBI: mtd1 is detached from ubi0
Creating 1 MTD partitions on "nand0":
0x0010-0x0110 : "mtd=1"
UBI: attaching mtd1 to ubi0
UBI: physical eraseblock size:   16384 bytes (16 KiB)
UBI: logical eraseblock size:15872 bytes
UBI: smallest flash I/O unit:512
UBI: sub-page size:  256
UBI: VID header offset:  256 (aligned 256)
UBI: data offset:512
UBI: empty MTD device detected
UBI: create volume table (copy #1)
UBI: create volume table (copy #2)
UBI: attached mtd1 to ubi0
UBI: MTD device name:"mtd=1"
UBI: MTD device size:16 MiB
UBI: number of good PEBs:1024
UBI: number of bad PEBs: 0
UBI: max. allowed volumes:   92
UBI: wear-leveling threshold:4096
UBI: number of internal volumes: 1
UBI: number of user volumes: 0
UBI: available PEBs: 1010
UBI: total number of reserved PEBs: 14
UBI: number of PEBs reserved for bad PEB handling: 10
UBI: max/mean erase counter: 0/0
=>


Perhaps you should try the latest version as well. 

Re: [U-Boot] RFC common omap3 subconfig ? was Re: [PATCH] OMAP3EVM: Increase bootargs string length.

2009-12-18 Thread Stefan Roese
Hi Heiko,

On Thursday 17 December 2009 19:23:58 Heiko Schocher wrote:
> > We already have some similar common config files. Take a look for example
> > at the AMCC config header:
> >
> > include/configs/amcc-common.h
> 
> I vote for collecting "common config files" in a subdir:
> 
> include/configs/common
> 
> for example:
> include/configs/common/mpc83xx.h
> 
> collects all common config options for 83xx boards.
> and so on for all other architectures/manufacturer ...
> 
> And a "#include "configs/common/..." provides enough
> information, what will come in with that include ...

Yes, such a directory could make sense. But please note that we already have 
something similar:

include/asm-ppc/config.h

The other architectures have this file as well, but most of them don't define 
much in it. Not sure how to best merge/consolidate this.

Cheers,
Stefan

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


[U-Boot] s5pc1xx: update cache routines

2009-12-18 Thread Minkyu Kang
Because of v7_flush_dcache_all is moved to omap3/cache.S
and s5pc110 needs cache routines, need to update s5pc1xx cache routines.

l2_cache_enable and l2_caceh_disable are moved from cache.c to cache.S
and invalidate_dcache is modified for SoC specific.

Signed-off-by: Minkyu Kang 
---
 cpu/arm_cortexa8/s5pc1xx/Makefile|4 +-
 cpu/arm_cortexa8/s5pc1xx/cache.S |  120 ++
 cpu/arm_cortexa8/s5pc1xx/cache.c |   43 ---
 include/asm-arm/arch-s5pc1xx/sys_proto.h |   32 
 include/configs/smdkc100.h   |2 -
 5 files changed, 154 insertions(+), 47 deletions(-)
 create mode 100644 cpu/arm_cortexa8/s5pc1xx/cache.S
 delete mode 100644 cpu/arm_cortexa8/s5pc1xx/cache.c
 create mode 100644 include/asm-arm/arch-s5pc1xx/sys_proto.h

diff --git a/cpu/arm_cortexa8/s5pc1xx/Makefile 
b/cpu/arm_cortexa8/s5pc1xx/Makefile
index e08d9d8..4f922e6 100644
--- a/cpu/arm_cortexa8/s5pc1xx/Makefile
+++ b/cpu/arm_cortexa8/s5pc1xx/Makefile
@@ -28,9 +28,9 @@ include $(TOPDIR)/config.mk
 
 LIB= $(obj)lib$(SOC).a
 
-SOBJS  = reset.o
+SOBJS  = cache.o
+SOBJS  += reset.o
 
-COBJS  += cache.o
 COBJS  += clock.o
 COBJS  += cpu_info.o
 COBJS  += timer.o
diff --git a/cpu/arm_cortexa8/s5pc1xx/cache.S b/cpu/arm_cortexa8/s5pc1xx/cache.S
new file mode 100644
index 000..23f527a
--- /dev/null
+++ b/cpu/arm_cortexa8/s5pc1xx/cache.S
@@ -0,0 +1,120 @@
+/*
+ * Copyright (C) 2009 Samsung Electronics
+ * Minkyu Kang 
+ *
+ * based on cpu/arm_cortexa8/omap3/cache.S
+ *
+ * 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 
+
+.align 5
+.global invalidate_dcache
+.global l2_cache_enable
+.global l2_cache_disable
+
+/*
+ * invalidate_dcache()
+ * Invalidate the whole D-cache.
+ *
+ * Corrupted registers: r0-r5, r7, r9-r11
+ */
+invalidate_dcache:
+   stmfd   r13!, {r0 - r5, r7, r9 - r12, r14}
+
+   cmp r0, #0xC100 @ check if the cpu is s5pc100
+
+   beq finished_inval  @ s5pc100 doesn't need this
+   @ routine
+   mrc p15, 1, r0, c0, c0, 1   @ read clidr
+   andsr3, r0, #0x700  @ extract loc from clidr
+   mov r3, r3, lsr #23 @ left align loc bit field
+   beq finished_inval  @ if loc is 0, then no need to
+   @ clean
+   mov r10, #0 @ start clean at cache level 0
+inval_loop1:
+   add r2, r10, r10, lsr #1@ work out 3x current cache
+   @ level
+   mov r1, r0, lsr r2  @ extract cache type bits from
+   @ clidr
+   and r1, r1, #7  @ mask of the bits for current
+   @ cache only
+   cmp r1, #2  @ see what cache we have at
+   @ this level
+   blt skip_inval  @ skip if no cache, or just
+   @ i-cache
+   mcr p15, 2, r10, c0, c0, 0  @ select current cache level
+   @ in cssr
+   mov r2, #0  @ operand for mcr SBZ
+   mcr p15, 0, r2, c7, c5, 4   @ flush prefetch buffer to
+   @ sych the new cssr&csidr,
+   @ with armv7 this is 'isb',
+   @ but we compile with armv5
+   mrc p15, 1, r1, c0, c0, 0   @ read the new csidr
+   and r2, r1, #7  @ extract the length of the
+   @ cache lines
+   add r2, r2, #4  @ add 4 (line length offset)
+   ldr r4, =0x3ff
+   andsr4, r4, r1, lsr #3  @ find maximum number on the
+   @ way size
+   clz r5, r4  @ find bit position of way
+

[U-Boot] [PATCHv2] onenand: Fix compile errors due to FlexOneNAND

2009-12-18 Thread Sanjeev Premi
This patch fixes the compile error while trying to
compile for omap3evm.

env_onenand.c: In function 'env_relocate_spec':
env_onenand.c:70: error: 'CONFIG_ENV_ADDR_FLEX' undeclared
 (first use in this function)
env_onenand.c:70: error: (Each undeclared identifier is re
ported only once
env_onenand.c:70: error: for each function it appears in.)
env_onenand.c: In function 'saveenv':
env_onenand.c:106: error: 'CONFIG_ENV_ADDR_FLEX' undeclare
d (first use in this function)
env_onenand.c:107: error: 'CONFIG_ENV_SIZE_FLEX' undeclare
d (first use in this function)

Signed-off-by: Sanjeev Premi 
---
 common/env_onenand.c |9 -
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/common/env_onenand.c b/common/env_onenand.c
index 23d2caa..cf997bf 100644
--- a/common/env_onenand.c
+++ b/common/env_onenand.c
@@ -60,15 +60,18 @@ uchar env_get_char_spec(int index)
 void env_relocate_spec(void)
 {
struct mtd_info *mtd = &onenand_mtd;
+#ifdef CONFIG_ENV_ADDR_FLEX
struct onenand_chip *this = &onenand_chip;
+#endif
loff_t env_addr;
int use_default = 0;
size_t retlen;
 
env_addr = CONFIG_ENV_ADDR;
+#ifdef CONFIG_ENV_ADDR_FLEX
if (FLEXONENAND(this))
env_addr = CONFIG_ENV_ADDR_FLEX;
-
+#endif
/* Check OneNAND exist */
if (mtd->writesize)
/* Ignore read fail */
@@ -94,7 +97,9 @@ void env_relocate_spec(void)
 int saveenv(void)
 {
struct mtd_info *mtd = &onenand_mtd;
+#ifdef CONFIG_ENV_ADDR_FLEX
struct onenand_chip *this = &onenand_chip;
+#endif
loff_t env_addr = CONFIG_ENV_ADDR;
struct erase_info instr = {
.callback   = NULL,
@@ -102,12 +107,14 @@ int saveenv(void)
size_t retlen;
 
instr.len = CONFIG_ENV_SIZE;
+#ifdef CONFIG_ENV_ADDR_FLEX
if (FLEXONENAND(this)) {
env_addr = CONFIG_ENV_ADDR_FLEX;
instr.len = CONFIG_ENV_SIZE_FLEX;
instr.len <<= onenand_mtd.eraseregions[0].numblocks == 1 ?
1 : 0;
}
+#endif
instr.addr = env_addr;
instr.mtd = mtd;
if (mtd->erase(mtd, &instr)) {
-- 
1.6.2.2

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


Re: [U-Boot] [PATCH 2/3] Add board specific code for da850 EVM

2009-12-18 Thread Sudhakar Rajashekhar
Nick Thompson  ge.com> writes:

> 
> On 16/12/09 10:24, Sudhakar Rajashekhara wrote:
> > Provides initial support for TI OMAP-L138/DA850 SoC devices on
> > a Logic PD EVM board.
> > 
> > Provides:
> > Initial boot and configuration.
> > Support for i2c.
> > UART support (console).
> > 
> > Signed-off-by: Sudhakar Rajashekhara  ti.com>
> > ---
> >  board/davinci/da8xxevm/Makefile |1 +
> >  board/davinci/da8xxevm/da850evm.c   |  124 
+++
> >  include/asm-arm/arch-davinci/hardware.h |1 +
> >  3 files changed, 126 insertions(+), 0 deletions(-)
> >  create mode 100644 board/davinci/da8xxevm/da850evm.c
> > 
> 
> [...]
> 
> > diff --git a/board/davinci/da8xxevm/da850evm.c 
b/board/davinci/da8xxevm/da850evm.c
> > new file mode 100644
> > index 000..92548e2
> > --- /dev/null
> > +++ b/board/davinci/da8xxevm/da850evm.c
> > @@ -0,0 +1,124 @@
> > +/*
> > + * (C) Copyright 2009, Texas Instruments, Inc. http://www.ti.com/
> > + *
> > + * Based on da830evm.c
> 
> At this point, this seem to be a copy of da830evm.c (well except the first 
few lines above).
> 

I don't think you have observed that the PINMUX registers are different on 
da850. So we are at risk of adding many ifdefs now itself if we combine da830 
and da850. Also, there are few things which differ between da830 and da850, for 
example, MAC address is stored in I2C eeprom on da830 and in SPI eeprom on 
da850. You can have a look at http://www.arago-project.org/git/people/?
p=sekhar/u-boot-omapl1.git;a=summary to understand how the da830 and da850 
files look later when support for most peripherals are added.

To avoid code cluttering, I prefer using two separate files for da830 and da850.

Regards,
Sudhakar




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


[U-Boot] [PATCH] MIPS: qemu_mips: Fix a build failure caused by missing

2009-12-18 Thread Shinya Kuribayashi
make -C lib_generic/
zlib.c:31:27: error: asm/unaligned.h: No such file or directory
zlib.c: In function 'inflate_fast':
zlib.c:641: warning: implicit declaration of function 'get_unaligned'
make[1]: *** [zlib.o] Error 1
make[1]: Leaving directory `/home/skuribay/git/u-boot.git/lib_generic'
make: *** [lib_generic/libgeneric.a] Error 2

Import relevant header file from LMO tree (slightly modified to U-Boot).

Reported-by: Himanshu Chauhan 
Signed-off-by: Shinya Kuribayashi 
---

Himanshu Chauhan wrote:
> I see that in include directory asm points to asm-mips. Inside asm-mips 
> there is another link arch->arch-mips which is a dead link. THere is no 
> directory named arch-mips there.

This is another topic, let's ignore here.

> Whats the problem here? Should I pull only the MIPS custodian tree?

I confirmed that this patch fixes the build error, but not sure
it works or not.  Just build tested.  And note that there there's
nothing interesting in the u-boot-mips tree, sorry.


 include/asm-mips/unaligned.h |   26 ++
 1 files changed, 26 insertions(+), 0 deletions(-)
 create mode 100644 include/asm-mips/unaligned.h

diff --git a/include/asm-mips/unaligned.h b/include/asm-mips/unaligned.h
new file mode 100644
index 000..da6a347
--- /dev/null
+++ b/include/asm-mips/unaligned.h
@@ -0,0 +1,26 @@
+/*
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 2007 Ralf Baechle (r...@linux-mips.org)
+ */
+#ifndef _ASM_MIPS_UNALIGNED_H
+#define _ASM_MIPS_UNALIGNED_H
+
+#include 
+#if defined(__MIPSEB__)
+# define get_unaligned __get_unaligned_be
+# define put_unaligned __put_unaligned_be
+#elif defined(__MIPSEL__)
+# define get_unaligned __get_unaligned_le
+# define put_unaligned __put_unaligned_le
+#else
+#  error "MIPS, but neither __MIPSEB__, nor __MIPSEL__???"
+#endif
+
+# include 
+# include 
+# include 
+
+#endif /* _ASM_MIPS_UNALIGNED_H */
-- 
1.6.5.7
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Breakage on arm/next

2009-12-18 Thread apgmoorthy
Hi Sanjeev,

> 
> Is there any update on the fix/proposal?
> 
> I am trying to build for omap3_evm; but see the same problem.
> My repo is currently at:
>   bb3bcfa : Merge branch 'next' of ../next
>   a200a7c : Update CHANGELOG; prepare Prepare v2009.11
> 

As Scott pointed out rightly, my previous suggestion missed 
to see certain scenario.I will send the fix shortly. 
Sorry for the Delay.

With Regards
  Moorthy

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


[U-Boot] Boot X86 PC from USB using U_boot

2009-12-18 Thread Sasi, Anoop IN BLR SISL
Hi all please help me

Am a beginner in Linux. I have a PC with UBUNTU 9.04 installed .
I was trying to boot Linux PC from USB. I could able to boot PC with GRUB 
installed
in USB .

 Is it possible to boot the PC (X86 architecture) from USB with U-Boot in the 
USB?

What all configuration changes I need do to make this possible?

I have downloaded U-boot then configured and build for X86 architecture 
(sc520_cdp_config)
And made a bootable partition in usb and copied u-boot image in to it and tried 
to boot from usb but
It is not working.

Please help me in this.



With best regards,
Anoop Sasi


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


Re: [U-Boot] [PATCH] MIPS: qemu_mips: Fix a build failure caused by missing

2009-12-18 Thread Himanshu Chauhan
Shinya Kuribayashi wrote:
> make -C lib_generic/
> zlib.c:31:27: error: asm/unaligned.h: No such file or directory
> zlib.c: In function 'inflate_fast':
> zlib.c:641: warning: implicit declaration of function 'get_unaligned'
> make[1]: *** [zlib.o] Error 1
> make[1]: Leaving directory `/home/skuribay/git/u-boot.git/lib_generic'
> make: *** [lib_generic/libgeneric.a] Error 2
> 
> Import relevant header file from LMO tree (slightly modified to U-Boot).
> 
> Reported-by: Himanshu Chauhan 
> Signed-off-by: Shinya Kuribayashi 
> ---
> 
> Himanshu Chauhan wrote:
>> I see that in include directory asm points to asm-mips. Inside 
>> asm-mips there is another link arch->arch-mips which is a dead link. 
>> THere is no directory named arch-mips there.
> 
> This is another topic, let's ignore here.
> 
>> Whats the problem here? Should I pull only the MIPS custodian tree?
> 
> I confirmed that this patch fixes the build error, but not sure
> it works or not.  Just build tested.  And note that there there's
> nothing interesting in the u-boot-mips tree, sorry.
> 
> 
> include/asm-mips/unaligned.h |   26 ++
> 1 files changed, 26 insertions(+), 0 deletions(-)
> create mode 100644 include/asm-mips/unaligned.h
> 
> diff --git a/include/asm-mips/unaligned.h b/include/asm-mips/unaligned.h
> new file mode 100644
> index 000..da6a347
> --- /dev/null
> +++ b/include/asm-mips/unaligned.h
> @@ -0,0 +1,26 @@
> +/*
> + * This file is subject to the terms and conditions of the GNU General 
> Public
> + * License.  See the file "COPYING" in the main directory of this archive
> + * for more details.
> + *
> + * Copyright (C) 2007 Ralf Baechle (r...@linux-mips.org)
> + */
> +#ifndef _ASM_MIPS_UNALIGNED_H
> +#define _ASM_MIPS_UNALIGNED_H
> +
> +#include 
> +#if defined(__MIPSEB__)
> +# define get_unaligned__get_unaligned_be
> +# define put_unaligned__put_unaligned_be
> +#elif defined(__MIPSEL__)
> +# define get_unaligned__get_unaligned_le
> +# define put_unaligned__put_unaligned_le
> +#else
> +#  error "MIPS, but neither __MIPSEB__, nor __MIPSEL__???"
> +#endif
> +
> +# include 
> +# include 
> +# include 
> +
> +#endif /* _ASM_MIPS_UNALIGNED_H */

Thanks for sending this patch across. I will try this.

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


Re: [U-Boot] [PATCH] MIPS: qemu_mips: Fix a build failure caused by missing

2009-12-18 Thread Stefan Roese
On Friday 18 December 2009 11:32:13 Shinya Kuribayashi wrote:
> make -C lib_generic/
> zlib.c:31:27: error: asm/unaligned.h: No such file or directory
> zlib.c: In function 'inflate_fast':
> zlib.c:641: warning: implicit declaration of function 'get_unaligned'
> make[1]: *** [zlib.o] Error 1
> make[1]: Leaving directory `/home/skuribay/git/u-boot.git/lib_generic'
> make: *** [lib_generic/libgeneric.a] Error 2
> 
> Import relevant header file from LMO tree (slightly modified to U-Boot).

Why don't you import this file from the Linux tree? This should work without 
modifications. And that's what we've done for PPC and ARM as well.
 
Cheers,
Stefan

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


Re: [U-Boot] [PATCH] MIPS: qemu_mips: Fix a build failure caused by missing

2009-12-18 Thread Himanshu Chauhan
Stefan Roese wrote:
> On Friday 18 December 2009 11:32:13 Shinya Kuribayashi wrote:
>> make -C lib_generic/
>> zlib.c:31:27: error: asm/unaligned.h: No such file or directory
>> zlib.c: In function 'inflate_fast':
>> zlib.c:641: warning: implicit declaration of function 'get_unaligned'
>> make[1]: *** [zlib.o] Error 1
>> make[1]: Leaving directory `/home/skuribay/git/u-boot.git/lib_generic'
>> make: *** [lib_generic/libgeneric.a] Error 2
>>
>> Import relevant header file from LMO tree (slightly modified to U-Boot).
> 
> Why don't you import this file from the Linux tree? This should work without 
> modifications. And that's what we've done for PPC and ARM as well.
>  
> Cheers,
> Stefan
> 
> --
> DENX Software Engineering GmbH,  MD: Wolfgang Denk & Detlev Zundel
> HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: off...@denx.de
> 

I think thats what it is. Both are same.

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


Re: [U-Boot] [PATCH] MIPS: qemu_mips: Fix a build failure caused by missing

2009-12-18 Thread Stefan Roese
On Friday 18 December 2009 13:04:59 Himanshu Chauhan wrote:
> >> Import relevant header file from LMO tree (slightly modified to U-Boot).
> >
> > Why don't you import this file from the Linux tree? This should work
> > without modifications. And that's what we've done for PPC and ARM as
> > well.
> >
> > Cheers,
> > Stefan
> >
> > --
> > DENX Software Engineering GmbH,  MD: Wolfgang Denk & Detlev Zundel
> > HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> > Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: off...@denx.de
> 
> I think thats what it is. Both are same.

No, not exactly. They're nearly identical. But there are differences. Not sure 
if these differences are important though.

Don't get me wrong. I'm not NACK'ing the patch. I'm just pointing out that 
it's different from the Linux version.

Cheers,
Stefan

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


Re: [U-Boot] [PATCH] MIPS: qemu_mips: Fix a build failure caused by missing

2009-12-18 Thread Stefan Roese
On Friday 18 December 2009 13:20:56 Stefan Roese wrote:
> > I think thats what it is. Both are same.
> 
> No, not exactly. They're nearly identical. But there are differences. Not
>  sure if these differences are important though.
> 
> Don't get me wrong. I'm not NACK'ing the patch. I'm just pointing out that
> it's different from the Linux version.

Just to make it clear. Here a diff between both versions:

--- u-boot/include/asm-mips/unaligned.h
+++ linux-2.6/linus/arch/mips/include/asm/unaligned.h
@@ -8,19 +8,21 @@
 #ifndef _ASM_MIPS_UNALIGNED_H
 #define _ASM_MIPS_UNALIGNED_H

-#include 
+#include 
 #if defined(__MIPSEB__)
+# include 
+# include 
 # define get_unaligned __get_unaligned_be
 # define put_unaligned __put_unaligned_be
 #elif defined(__MIPSEL__)
+# include 
+# include 
 # define get_unaligned __get_unaligned_le
 # define put_unaligned __put_unaligned_le
 #else
 #  error "MIPS, but neither __MIPSEB__, nor __MIPSEL__???"
 #endif

-# include 
-# include 
 # include 

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


Re: [U-Boot] [PATCH 1/3] Prepare for da850 support

2009-12-18 Thread Sudhakar Rajashekhara
Hi,

On Fri, Dec 18, 2009 at 02:42:01, Wolfgang Denk wrote:
> Dear Sudhakar Rajashekhara,
> 
> In message <1260959053-29746-1-git-send-email-sudhakar@ti.com> you wrote:
> > DA850/OMAP-L138 is a new SoC from Texas Instruments
> > (http://focus.ti.com/docs/prod/folders/print/omap-l138.html).
> > This SoC is similar to DA830/OMAP-L137 in many aspects. Hence
> > rename the da830 specific files and folders to da8xx to
> > accommodate DA850/OMAP-L138.
> ...
> >  7 files changed, 226 insertions(+), 222 deletions(-)
> >  delete mode 100644 board/davinci/da830evm/Makefile
> >  delete mode 100644 board/davinci/da830evm/config.mk
> >  delete mode 100644 board/davinci/da830evm/da830evm.c
> >  create mode 100644 board/davinci/da8xxevm/Makefile
> >  create mode 100644 board/davinci/da8xxevm/config.mk
> >  create mode 100644 board/davinci/da8xxevm/da830evm.c
> 
> Please use the "-M" option to "git  format-patch" (maybe also "-C" and
> even "--find-copies-harder") to save reviewers the work of comparing
> the deleted and the new files.
> 
> Please resubmit - I am not in the mood to manually compare the files.
> 

I was not aware of the -M option. I'll resubmit the patch after addressing your
comments.

Thanks,
Sudhakar


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


Re: [U-Boot] ubi part failing on NAND

2009-12-18 Thread hedwin
Jeff, what is the size of your allocateble memory. Had to increase it to 4MB
to get it working.

On Fri, Dec 18, 2009 at 9:16 AM, Stefan Roese  wrote:
> Jeff,
>
> On Thursday 17 December 2009 22:09:03 Jeff Angielski wrote:
>> The "ubi part" command is failing for me on my PowerPC 85xx board.  I am
>> not trying to do anything special, just create the partitions and
>> volumes so that I can try writing an ubi.img.  It spits out enough
>> information that it looks like it did work but it prints out an error
>> nonetheless.
>>
>> And of course there is the long standing issue of the reported MTD
>> number not making any sense.  But previous posts have discounted this as
>> an issue.
>
> Patches to fix/change this are welcome. :)
>
>> Here is the snippet of the error:
>>
>> UBI error: ubi_init: cannot attach mtd2
>> UBI: mtd2 is detached from ubi0
>> UBI error: ubi_init: UBI error: cannot initialize UBI, error -17
>> UBI init error -17
>
> -17 == EEXIST. Looking at the code (build.c) shows that ubi_attach_mtd_dev()
> is returning this error code in case the MTD device is already attached. Even
> though the UBI implementation should handle this without any problems. I have
> to admit that I'm a bit out of ideas what's going wrong in your case. I just
> checked again and UBI works fine for me with the latest version:
>
>
> => mtdparts
>
> device nand0 , # parts = 3
>  #: name                size            offset          mask_flags
>  0: bootloader          0x0010      0x      0
>  1: rootfs              0x0100      0x0010      0
>  2: ubifs               0x02f0      0x0110      0
>
> active partition: nand0,0 - (bootloader) 0x0010 @ 0x
>
> defaults:
> mtdids  : nand0=nand
> mtdparts: mtdparts=nand:1m(bootloader),16m(rootfs),-(ubifs)
> => nand erase 110 2f0
>
> NAND erase: device 0 offset 0x110, size 0x2f0
> Erasing at 0x3ffc000 -- 100% complete.
> OK
> => ubi part ubifs
> Creating 1 MTD partitions on "nand0":
> 0x0110-0x0400 : "mtd=2"
> UBI: attaching mtd1 to ubi0
> UBI: physical eraseblock size:   16384 bytes (16 KiB)
> UBI: logical eraseblock size:    15872 bytes
> UBI: smallest flash I/O unit:    512
> UBI: sub-page size:              256
> UBI: VID header offset:          256 (aligned 256)
> UBI: data offset:                512
> UBI: empty MTD device detected
> UBI: create volume table (copy #1)
> UBI: create volume table (copy #2)
> UBI: attached mtd1 to ubi0
> UBI: MTD device name:            "mtd=2"
> UBI: MTD device size:            47 MiB
> UBI: number of good PEBs:        3008
> UBI: number of bad PEBs:         0
> UBI: max. allowed volumes:       92
> UBI: wear-leveling threshold:    4096
> UBI: number of internal volumes: 1
> UBI: number of user volumes:     0
> UBI: available PEBs:             2974
> UBI: total number of reserved PEBs: 34
> UBI: number of PEBs reserved for bad PEB handling: 30
> UBI: max/mean erase counter: 0/0
> => mtdparts
>
> device nand0 , # parts = 3
>  #: name                size            offset          mask_flags
>  0: bootloader          0x0010      0x      0
>  1: rootfs              0x0100      0x0010      0
>  2: ubifs               0x02f0      0x0110      0
>
> active partition: nand0,0 - (bootloader) 0x0010 @ 0x
>
> defaults:
> mtdids  : nand0=nand
> mtdparts: mtdparts=nand:1m(bootloader),16m(rootfs),-(ubifs)
> => nand erase 10 100
>
> NAND erase: device 0 offset 0x10, size 0x100
> Erasing at 0x10fc000 -- 100% complete.
> OK
> => ubi part rootfs
> UBI: mtd1 is detached from ubi0
> Creating 1 MTD partitions on "nand0":
> 0x0010-0x0110 : "mtd=1"
> UBI: attaching mtd1 to ubi0
> UBI: physical eraseblock size:   16384 bytes (16 KiB)
> UBI: logical eraseblock size:    15872 bytes
> UBI: smallest flash I/O unit:    512
> UBI: sub-page size:              256
> UBI: VID header offset:          256 (aligned 256)
> UBI: data offset:                512
> UBI: empty MTD device detected
> UBI: create volume table (copy #1)
> UBI: create volume table (copy #2)
> UBI: attached mtd1 to ubi0
> UBI: MTD device name:            "mtd=1"
> UBI: MTD device size:            16 MiB
> UBI: number of good PEBs:        1024
> UBI: number of bad PEBs:         0
> UBI: max. allowed volumes:       92
> UBI: wear-leveling threshold:    4096
> UBI: number of internal volumes: 1
> UBI: number of user volumes:     0
> UBI: available PEBs:             1010
> UBI: total number of reserved PEBs: 14
> UBI: number of PEBs reserved for bad PEB handling: 10
> UBI: max/mean erase counter: 0/0
> =>
>
>
> Perhaps you should try the latest version as well. Could be that this is a bug
> already fixed now. Otherwise you need to debug this problem yourself, since I
> can't reproduce it here.
>
> Cheers,
> Stefan
>
> --
> DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
> HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone:

Re: [U-Boot] Boot X86 PC from USB using U_boot

2009-12-18 Thread Jerry Van Baren
Sasi, Anoop IN BLR SISL wrote:
> Hi all please help me
> 
> Am a beginner in Linux. I have a PC with UBUNTU 9.04 installed .
> I was trying to boot Linux PC from USB. I could able to boot PC with GRUB 
> installed
> in USB .
> 
>  Is it possible to boot the PC (X86 architecture) from USB with U-Boot in the 
> USB?

Theoretically, yes.  Practically, it would be a *LOT* of work and 
require hardware details that you probably cannot get (chipset register 
definitions, how to initialize them, etc.).

With GRUB, the manufacturer's BIOS initialize the chipset and then boots 
GRUB -> linux based on the already configured hardware.  U-Boot 
initializes the hardware, so you need the information that the PC BIOS / 
hardware manufacturer has (and won't tell you) to replace BIOS+GRUB with 
U-Boot.

There is some support for x86 in u-boot, but it is for one (?) specific 
x86 CPU, the AMD sc520, and your PC probably isn't running that.
http://git.denx.de/?p=u-boot.git;a=tree;f=cpu/i386;h=cf975ccb545ea90c755b573c1c695fde12d2ba4c;hb=HEAD

> What all configuration changes I need do to make this possible?

That is a huge open-ended question.  We don't have an answer.

> I have downloaded U-boot then configured and build for X86 architecture 
> (sc520_cdp_config)
> And made a bootable partition in usb and copied u-boot image in to it and 
> tried to boot from usb but
> It is not working.

You probably don't have a sc520.

> Please help me in this.

Use the BIOS + GRUB.  It works very well.

> With best regards,
> Anoop Sasi

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


Re: [U-Boot] ubi part failing on NAND

2009-12-18 Thread Stefan Roese
On Friday 18 December 2009 13:35:26 hedwin wrote:
> Jeff, what is the size of your allocateble memory. Had to increase it to
>  4MB to get it working.

I've got 1MByte for my test on Kilauea. This should be enough. There
is already a compile-time check in the UBI code:


#if (CONFIG_SYS_MALLOC_LEN < (512 << 10))
#error Malloc area too small for UBI, increase CONFIG_SYS_MALLOC_LEN to >= 512k
#endif

Please let me know if this really is not enough. But for me, 1MB is working.
 
Cheers,
Stefan

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


Re: [U-Boot] [PATCH] MIPS: qemu_mips: Fix a build failure caused by missing

2009-12-18 Thread Himanshu Chauhan
Stefan Roese wrote:
> On Friday 18 December 2009 13:20:56 Stefan Roese wrote:
>>> I think thats what it is. Both are same.
>> No, not exactly. They're nearly identical. But there are differences. Not
>>  sure if these differences are important though.
>>
>> Don't get me wrong. I'm not NACK'ing the patch. I'm just pointing out that
>> it's different from the Linux version.
> 
> Just to make it clear. Here a diff between both versions:
> 
> --- u-boot/include/asm-mips/unaligned.h
> +++ linux-2.6/linus/arch/mips/include/asm/unaligned.h
> @@ -8,19 +8,21 @@
>  #ifndef _ASM_MIPS_UNALIGNED_H
>  #define _ASM_MIPS_UNALIGNED_H
> 
> -#include 
> +#include 
>  #if defined(__MIPSEB__)
> +# include 
> +# include 
>  # define get_unaligned __get_unaligned_be
>  # define put_unaligned __put_unaligned_be
>  #elif defined(__MIPSEL__)
> +# include 
> +# include 
>  # define get_unaligned __get_unaligned_le
>  # define put_unaligned __put_unaligned_le
>  #else
>  #  error "MIPS, but neither __MIPSEB__, nor __MIPSEL__???"
>  #endif
> 
> -# include 
> -# include 
>  # include 
> 
>  #endif /* _ASM_MIPS_UNALIGNED_H */
> 

I think whatever Shinya sent was modified version of linux's unaligned.h 
and its working.

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


Re: [U-Boot] [PATCH 3/3] Create configuration file for da850 EVM

2009-12-18 Thread Sudhakar Rajashekhara
Hi,

Wolfgang Denk  denx.de> writes:

> 
> Please do not add such scripting to the top level Makefile; it is not
> needed any more.
> 

OK. I'll remove it.

> > --- /dev/null
> > +++ b/include/configs/da850evm.h
> ...
> > +/*
> > + * U-Boot general configuration
> > + */
> > +#undef CONFIG_USE_IRQ  /* No IRQ/FIQ in U-Boot */
> > +#undef CONFIG_MISC_INIT_R
> > +#undef CONFIG_BOOTDELAY
> 
> Don't undef what is not defined.
> 

OK. Will fix it globally.

[...]

> > +#define CONFIG_BOOTARGS"mem=32M console=ttyS2,115200n8 
root=/dev/mtdblock/2 rw noinitrd ip=dhcp"
> 
> Line too long!
> 

I'll correct it.

> > +#define CONFIG_BOOTCOMMAND ""
> 
> What do you intend here? If you don't need a boot command, then don't
> define one. Defining an empty one makes no sense.
> 

I'll remove it.

[...]

> > +#undef CONFIG_CMD_IMLS
> 
> Why would you undefine this command? "imls" is a pretty useful
> command, and does not require a substantioal amount of memory?
> 

I'll enable support for "imls" once I add in support for SPI/NAND/NOR flashes.

Regards,
Sudhakar


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


[U-Boot] [PATCH v2] TI: DaVinci: Updating EMAC driver for DM365, DM646x and DA8XX

2009-12-18 Thread Nick Thompson
The EMAC IP on DM365, DM646x and DA830 is slightly different
from that on DM644x. This change updates the DaVinci EMAC driver
so that EMAC becomes operational on SOCs with EMAC v2.

Signed-off-by: Nick Thompson 
---
CHANGES:
Move ;'s from the end of all empty while loops to next line.
Gig enable function has no ifdefs on body.
Gig enable doesn't change the ET1011C PHY SYSCLK reg as this
is board specific (to the DM6467 HD EVM).
All struct register overlay accesses now use writel/readl.
MDIO startup delay is not specific to emac_v2

UNCHANGED:
Gig enable called whenever phy link is checked since link
may have dropped out and come back. I can't test
if removing these calls is acceptable.
Legacy register definitions are uppercase - new definitions
are lowercase.

 drivers/net/davinci_emac.c   |  226 +++---
 include/asm-arm/arch-davinci/emac_defs.h |   59 +++-
 2 files changed, 202 insertions(+), 83 deletions(-)

diff --git a/drivers/net/davinci_emac.c b/drivers/net/davinci_emac.c
index fa8cee4..4c3b185 100644
--- a/drivers/net/davinci_emac.c
+++ b/drivers/net/davinci_emac.c
@@ -42,10 +42,17 @@
 #include 
 #include 
 #include 
+#include 
 
 unsigned int   emac_dbg = 0;
 #define debug_emac(fmt,args...)if (emac_dbg) printf(fmt,##args)
 
+#ifdef DAVINCI_EMAC_GIG_ENABLE
+#define emac_gigabit_enable()  davinci_eth_gigabit_enable()
+#else
+#define emac_gigabit_enable()  /* no gigabit to enable */
+#endif
+
 static void davinci_eth_mdio_enable(void);
 
 static int gen_init_phy(int phy_addr);
@@ -99,12 +106,14 @@ static void davinci_eth_mdio_enable(void)
 
clkdiv = (EMAC_MDIO_BUS_FREQ / EMAC_MDIO_CLOCK_FREQ) - 1;
 
-   adap_mdio->CONTROL = (clkdiv & 0xff) |
-   MDIO_CONTROL_ENABLE |
-   MDIO_CONTROL_FAULT |
-   MDIO_CONTROL_FAULT_ENABLE;
+   writel((clkdiv & 0xff) |
+   MDIO_CONTROL_ENABLE |
+   MDIO_CONTROL_FAULT |
+   MDIO_CONTROL_FAULT_ENABLE,
+  &adap_mdio->CONTROL);
 
-   while (adap_mdio->CONTROL & MDIO_CONTROL_IDLE) {;}
+   while (readl(&adap_mdio->CONTROL) & MDIO_CONTROL_IDLE)
+   ;
 }
 
 /*
@@ -119,7 +128,8 @@ static int davinci_eth_phy_detect(void)
 
active_phy_addr = 0xff;
 
-   if ((phy_act_state = adap_mdio->ALIVE) == 0)
+   phy_act_state = readl(&adap_mdio->ALIVE) & EMAC_MDIO_PHY_MASK;
+   if (phy_act_state == 0)
return(0);  /* No active PHYs */
 
debug_emac("davinci_eth_phy_detect(), ALIVE = 0x%08x\n", phy_act_state);
@@ -144,15 +154,18 @@ int davinci_eth_phy_read(u_int8_t phy_addr, u_int8_t 
reg_num, u_int16_t *data)
 {
int tmp;
 
-   while (adap_mdio->USERACCESS0 & MDIO_USERACCESS0_GO) {;}
+   while (readl(&adap_mdio->USERACCESS0) & MDIO_USERACCESS0_GO)
+   ;
 
-   adap_mdio->USERACCESS0 = MDIO_USERACCESS0_GO |
-   MDIO_USERACCESS0_WRITE_READ |
-   ((reg_num & 0x1f) << 21) |
-   ((phy_addr & 0x1f) << 16);
+   writel(MDIO_USERACCESS0_GO |
+  MDIO_USERACCESS0_WRITE_READ |
+  ((reg_num & 0x1f) << 21) |
+  ((phy_addr & 0x1f) << 16),
+  &adap_mdio->USERACCESS0);
 
/* Wait for command to complete */
-   while ((tmp = adap_mdio->USERACCESS0) & MDIO_USERACCESS0_GO) {;}
+   while ((tmp = readl(&adap_mdio->USERACCESS0)) & MDIO_USERACCESS0_GO)
+   ;
 
if (tmp & MDIO_USERACCESS0_ACK) {
*data = tmp & 0x;
@@ -167,16 +180,19 @@ int davinci_eth_phy_read(u_int8_t phy_addr, u_int8_t 
reg_num, u_int16_t *data)
 int davinci_eth_phy_write(u_int8_t phy_addr, u_int8_t reg_num, u_int16_t data)
 {
 
-   while (adap_mdio->USERACCESS0 & MDIO_USERACCESS0_GO) {;}
+   while (readl(&adap_mdio->USERACCESS0) & MDIO_USERACCESS0_GO)
+   ;
 
-   adap_mdio->USERACCESS0 = MDIO_USERACCESS0_GO |
-   MDIO_USERACCESS0_WRITE_WRITE |
-   ((reg_num & 0x1f) << 21) |
-   ((phy_addr & 0x1f) << 16) |
-   (data & 0x);
+   writel(MDIO_USERACCESS0_GO |
+  MDIO_USERACCESS0_WRITE_WRITE |
+  ((reg_num & 0x1f) << 21) |
+  ((phy_addr & 0x1f) << 16) |
+  (data & 0x),
+  &adap_mdio->USERACCESS0);
 
/* Wait for command to complete */
-   while (adap_mdio->USERACCESS0 & MDIO_USERACCESS0_GO) {;}
+   while (readl(&adap_mdio->USERACCESS0) & MDIO_USERACCESS0_GO)
+   ;
 
return(1);
 }
@@ -245,9 +261,24 @@ static int davinci_mii_phy_write(char *devname, unsigned 
char addr, unsigned cha
 {
return(davinci_eth_phy_write(addr, reg, value) ? 0 : 1

[U-Boot] [PATCH]: U-Boot build failure with CONFIG_SYS_NO_FLASH defined for qemu-mips.

2009-12-18 Thread Himanshu Chauhan
U-Boot hangs with qemu-system-mips with ##unknown flash error.
Disabling flash using CONFIG_SYS_NO_FLASH breaks the build.
This patch fixes the issue. Don't know if its okay.

Signed-off-by: Himanshu Chauhan 

diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c
index efd6aec..5bd3af0 100644
--- a/common/cmd_bootm.c
+++ b/common/cmd_bootm.c
@@ -76,7 +76,7 @@ extern void bz_internal_error(int);
 static int image_info (unsigned long addr);
 #endif

-#if defined(CONFIG_CMD_IMLS)
+#if !defined(CONFIG_SYS_NO_FLASH) && defined(CONFIG_CMD_IMLS)
 #include 
 extern flash_info_t flash_info[]; /* info for FLASH chips */
 static int do_imls (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
@@ -1153,7 +1153,7 @@ U_BOOT_CMD(
 /***/
 /* imls - list all images found in flash */
 /***/
-#if defined(CONFIG_CMD_IMLS)
+#if !defined(CONFIG_SYS_NO_FLASH) && defined(CONFIG_CMD_IMLS)
 int do_imls (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
flash_info_t *info;
diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c
index 24eb33f..06c7271 100644
--- a/drivers/mtd/cfi_flash.c
+++ b/drivers/mtd/cfi_flash.c
@@ -41,6 +41,7 @@
 #include 
 #include 

+#ifndef CONFIG_SYS_NO_FLASH
 /*
  * This file implements a Common Flash Interface (CFI) driver for
  * U-Boot.
@@ -2020,3 +2021,5 @@ unsigned long flash_init (void)

return (size);
 }
+
+#endif
diff --git a/include/configs/qemu-mips.h b/include/configs/qemu-mips.h
index cbacdf9..49a1a1c 100644
--- a/include/configs/qemu-mips.h
+++ b/include/configs/qemu-mips.h
:q
@@ -142,6 +142,7 @@
 #define CONFIG_SYS_INIT_SP_OFFSET  0x40

 /* We boot from this flash, selected with dip switch */
+#define CONFIG_SYS_NO_FLASH
 #define CONFIG_SYS_FLASH_BASE  0xbfc0
 #define CONFIG_SYS_MAX_FLASH_BANKS 1
 #define CONFIG_SYS_MAX_FLASH_SECT  128
@@ -149,7 +150,8 @@
 #define CONFIG_FLASH_CFI_DRIVER1
 #define CONFIG_SYS_FLASH_USE_BUFFER_WRITE  1

-#define CONFIG_ENV_IS_IN_FLASH 1
+#define CONFIG_ENV_IS_IN_FLASH 0
+#define CONFIG_ENV_IS_NOWHERE
 #define CONFIG_ENV_ADDR(CONFIG_SYS_FLASH_BASE + 
CONFIG_SYS_MONITOR_LEN)

 /* Address and size of Primary Environment Sector */
diff --git a/include/mtd/cfi_flash.h b/include/mtd/cfi_flash.h
index 2aa6911..2229ddf 100644
--- a/include/mtd/cfi_flash.h
+++ b/include/mtd/cfi_flash.h
@@ -151,7 +151,8 @@ struct cfi_pri_hdr {
u8  minor_version;
 } __attribute__((packed));

-void flash_write_cmd(flash_info_t * info, flash_sect_t sect,
-uint offset, u32 cmd);
+#ifndef CONFIG_SYS_NO_FLASH
+void flash_write_cmd(flash_info_t * info, flash_sect_t sect, uint offset, u32 
cmd);
+#endif

 #endif /* __CFI_FLASH_H__ */

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


Re: [U-Boot] [PATCH] MIPS: qemu_mips: Fix a build failure caused by missing

2009-12-18 Thread Stefan Roese
On Friday 18 December 2009 14:02:01 Shinya Kuribayashi wrote:
> >> I think thats what it is. Both are same.
> >
> > No, not exactly. They're nearly identical. But there are differences. Not
> > sure if these differences are important though.
> 
> Hm, the original header is (lmo = linux-mips.org):
> http://git.kernel.org/?p=linux/kernel/git/ralf/linux.git;a=blob;f=arch/mips
> /include/asm/unaligned.h;h=42f66c311473abb98fe7a845e360e365ccfed837;hb=mast
> er
> 
> Are you referring to another one?

I just took the one from the latest Linux tree (Linus from today).
 
> > Don't get me wrong. I'm not NACK'ing the patch. I'm just pointing out
> > that it's different from the Linux version.
> 
> I'm afraid 'LMO' needlessly makes you confused.  Or am I missing
> something?

Yes, "LMO" was confusing me.

Cheers,
Stefan

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


Re: [U-Boot] [PATCH] MIPS: qemu_mips: Fix a build failure caused by missing

2009-12-18 Thread Shinya Kuribayashi
Stefan Roese wrote:
> On Friday 18 December 2009 13:04:59 Himanshu Chauhan wrote:
 Import relevant header file from LMO tree (slightly modified to U-Boot).
>>> Why don't you import this file from the Linux tree? This should work
>>> without modifications. And that's what we've done for PPC and ARM as
>>> well.
[...]
>> I think thats what it is. Both are same.
> 
> No, not exactly. They're nearly identical. But there are differences. Not 
> sure 
> if these differences are important though.

Hm, the original header is (lmo = linux-mips.org):
http://git.kernel.org/?p=linux/kernel/git/ralf/linux.git;a=blob;f=arch/mips/include/asm/unaligned.h;h=42f66c311473abb98fe7a845e360e365ccfed837;hb=master

Are you referring to another one?

> Don't get me wrong. I'm not NACK'ing the patch. I'm just pointing out that 
> it's different from the Linux version.

I'm afraid 'LMO' needlessly makes you confused.  Or am I missing
something?
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] MIPS: qemu_mips: Fix a build failure caused by missing

2009-12-18 Thread Himanshu Chauhan
Shinya Kuribayashi wrote:
> make -C lib_generic/
> zlib.c:31:27: error: asm/unaligned.h: No such file or directory
> zlib.c: In function 'inflate_fast':
> zlib.c:641: warning: implicit declaration of function 'get_unaligned'
> make[1]: *** [zlib.o] Error 1
> make[1]: Leaving directory `/home/skuribay/git/u-boot.git/lib_generic'
> make: *** [lib_generic/libgeneric.a] Error 2
> 
> Import relevant header file from LMO tree (slightly modified to U-Boot).
> 
> Reported-by: Himanshu Chauhan 
> Signed-off-by: Shinya Kuribayashi 
> ---
> 
> Himanshu Chauhan wrote:
>> I see that in include directory asm points to asm-mips. Inside
>> asm-mips there is another link arch->arch-mips which is a dead link.
>> THere is no directory named arch-mips there.
> 
> This is another topic, let's ignore here.
> 

Is arch-mips scheduled to be added?

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


Re: [U-Boot] [PATCH] MIPS: qemu_mips: Fix a build failure caused by missing

2009-12-18 Thread Shinya Kuribayashi
Himanshu Chauhan wrote:
>> Himanshu Chauhan wrote:
>>> I see that in include directory asm points to asm-mips. Inside
>>> asm-mips there is another link arch->arch-mips which is a dead link.
>>> THere is no directory named arch-mips there.
>> This is another topic, let's ignore here.
> 
> Is arch-mips scheduled to be added?

Not at the moment.  I'm not sure how it works, in the first place.

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


Re: [U-Boot] [PATCH v2] TI: DaVinci: Updating EMAC driver for DM365, DM646x and DA8XX

2009-12-18 Thread Nick Thompson
On 18/12/09 12:57, Nick Thompson wrote:
> The EMAC IP on DM365, DM646x and DA830 is slightly different
> from that on DM644x. This change updates the DaVinci EMAC driver
> so that EMAC becomes operational on SOCs with EMAC v2.

Please ignore this patch...

The patch is incorrectly formatted due to an e-mail issue.
v3 will be posted shortly.

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


[U-Boot] [PATCH v3] TI: DaVinci: Updating EMAC driver for DM365, DM646x and DA8XX

2009-12-18 Thread Nick Thompson
The EMAC IP on DM365, DM646x and DA830 is slightly different
from that on DM644x. This change updates the DaVinci EMAC driver
so that EMAC becomes operational on SOCs with EMAC v2.

Signed-off-by: Nick Thompson 
---
v2 was messed up, these changes are relative to the original patch

CHANGES:
Move ;'s from the end of all empty while loops to next line.
Gig enable function has no ifdefs on body.
Gig enable doesn't change the ET1011C PHY SYSCLK reg as this
is board specific (to the DM6467 HD EVM).
All struct register overlay accesses now use writel/readl.
MDIO startup delay is not specific to emac_v2.
Fixed some over-long lines and bad indents.

UNCHANGED:
Gig enable called whenever phy link is checked since link
may have dropped out and come back. I can't test
if removing these calls is acceptable.
Legacy register definitions are uppercase - new definitions
are lowercase.

 drivers/net/davinci_emac.c   |  266 +++---
 include/asm-arm/arch-davinci/emac_defs.h |   59 ++-
 2 files changed, 226 insertions(+), 99 deletions(-)

diff --git a/drivers/net/davinci_emac.c b/drivers/net/davinci_emac.c
index fa8cee4..02bbb8c 100644
--- a/drivers/net/davinci_emac.c
+++ b/drivers/net/davinci_emac.c
@@ -42,10 +42,17 @@
 #include 
 #include 
 #include 
+#include 
 
 unsigned int   emac_dbg = 0;
 #define debug_emac(fmt,args...)if (emac_dbg) printf(fmt,##args)
 
+#ifdef DAVINCI_EMAC_GIG_ENABLE
+#define emac_gigabit_enable()  davinci_eth_gigabit_enable()
+#else
+#define emac_gigabit_enable()  /* no gigabit to enable */
+#endif
+
 static void davinci_eth_mdio_enable(void);
 
 static int gen_init_phy(int phy_addr);
@@ -99,12 +106,14 @@ static void davinci_eth_mdio_enable(void)
 
clkdiv = (EMAC_MDIO_BUS_FREQ / EMAC_MDIO_CLOCK_FREQ) - 1;
 
-   adap_mdio->CONTROL = (clkdiv & 0xff) |
-   MDIO_CONTROL_ENABLE |
-   MDIO_CONTROL_FAULT |
-   MDIO_CONTROL_FAULT_ENABLE;
+   writel((clkdiv & 0xff) |
+  MDIO_CONTROL_ENABLE |
+  MDIO_CONTROL_FAULT |
+  MDIO_CONTROL_FAULT_ENABLE,
+  &adap_mdio->CONTROL);
 
-   while (adap_mdio->CONTROL & MDIO_CONTROL_IDLE) {;}
+   while (readl(&adap_mdio->CONTROL) & MDIO_CONTROL_IDLE)
+   ;
 }
 
 /*
@@ -119,7 +128,8 @@ static int davinci_eth_phy_detect(void)
 
active_phy_addr = 0xff;
 
-   if ((phy_act_state = adap_mdio->ALIVE) == 0)
+   phy_act_state = readl(&adap_mdio->ALIVE) & EMAC_MDIO_PHY_MASK;
+   if (phy_act_state == 0)
return(0);  /* No active PHYs */
 
debug_emac("davinci_eth_phy_detect(), ALIVE = 0x%08x\n", phy_act_state);
@@ -144,15 +154,18 @@ int davinci_eth_phy_read(u_int8_t phy_addr, u_int8_t 
reg_num, u_int16_t *data)
 {
int tmp;
 
-   while (adap_mdio->USERACCESS0 & MDIO_USERACCESS0_GO) {;}
+   while (readl(&adap_mdio->USERACCESS0) & MDIO_USERACCESS0_GO)
+   ;
 
-   adap_mdio->USERACCESS0 = MDIO_USERACCESS0_GO |
-   MDIO_USERACCESS0_WRITE_READ |
-   ((reg_num & 0x1f) << 21) |
-   ((phy_addr & 0x1f) << 16);
+   writel(MDIO_USERACCESS0_GO |
+  MDIO_USERACCESS0_WRITE_READ |
+  ((reg_num & 0x1f) << 21) |
+  ((phy_addr & 0x1f) << 16),
+  &adap_mdio->USERACCESS0);
 
/* Wait for command to complete */
-   while ((tmp = adap_mdio->USERACCESS0) & MDIO_USERACCESS0_GO) {;}
+   while ((tmp = readl(&adap_mdio->USERACCESS0)) & MDIO_USERACCESS0_GO)
+   ;
 
if (tmp & MDIO_USERACCESS0_ACK) {
*data = tmp & 0x;
@@ -167,16 +180,19 @@ int davinci_eth_phy_read(u_int8_t phy_addr, u_int8_t 
reg_num, u_int16_t *data)
 int davinci_eth_phy_write(u_int8_t phy_addr, u_int8_t reg_num, u_int16_t data)
 {
 
-   while (adap_mdio->USERACCESS0 & MDIO_USERACCESS0_GO) {;}
+   while (readl(&adap_mdio->USERACCESS0) & MDIO_USERACCESS0_GO)
+   ;
 
-   adap_mdio->USERACCESS0 = MDIO_USERACCESS0_GO |
-   MDIO_USERACCESS0_WRITE_WRITE |
-   ((reg_num & 0x1f) << 21) |
-   ((phy_addr & 0x1f) << 16) |
-   (data & 0x);
+   writel(MDIO_USERACCESS0_GO |
+  MDIO_USERACCESS0_WRITE_WRITE |
+  ((reg_num & 0x1f) << 21) |
+  ((phy_addr & 0x1f) << 16) |
+  (data & 0x),
+  &adap_mdio->USERACCESS0);
 
/* Wait for command to complete */
-   while (adap_mdio->USERACCESS0 & MDIO_USERACCESS0_GO) {;}
+   while (readl(&adap_mdio->USERACCESS0) & MDIO_USERACCESS0_GO)
+   ;
 
return(1);
 }
@@ -245,9 +261,24 @@ static int davinci_mii_phy_wri

Re: [U-Boot] [PATCHv2] onenand: Fix compile errors due to FlexOneNAND

2009-12-18 Thread Tom
Sanjeev Premi wrote:
> This patch fixes the compile error while trying to
> compile for omap3evm.
> 
> env_onenand.c: In function 'env_relocate_spec':
> env_onenand.c:70: error: 'CONFIG_ENV_ADDR_FLEX' undeclared
>  (first use in this function)
> env_onenand.c:70: error: (Each undeclared identifier is re
> ported only once
> env_onenand.c:70: error: for each function it appears in.)
> env_onenand.c: In function 'saveenv':
> env_onenand.c:106: error: 'CONFIG_ENV_ADDR_FLEX' undeclare
> d (first use in this function)
> env_onenand.c:107: error: 'CONFIG_ENV_SIZE_FLEX' undeclare
> d (first use in this function)
> 
> Signed-off-by: Sanjeev Premi 

Ack-ed
Thank you,
Tom
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] add ASTRO MCF5373L board

2009-12-18 Thread Wolfgang Wegner
Dear Wolfgang Denk,

On Thu, Dec 17, 2009 at 11:33:07PM +0100, Wolfgang Denk wrote:
> Dear Wolfgang Wegner,
> 
[...]
> > diff --git a/Makefile b/Makefile
> > index 75b2c1e..924e210 100644
> > --- a/Makefile
> > +++ b/Makefile
> > @@ -2263,6 +2263,18 @@ M5485HFE_config :unconfig
> >  TASREG_config :unconfig
> > @$(MKCONFIG) $(@:_config=) m68k mcf52x2 tasreg esd
> >  
> > +astro_mcf5373l_config \
> > +astro_mcf5373l_ram_config :unconfig
> > +   @if [ "$@" = "astro_mcf5373l_ram_config" ] ; then \
> > +   echo "#define CONFIG_MONITOR_IS_IN_RAM" >> 
> > $(obj)include/config.h ; \
> > +   echo "TEXT_BASE = 0x4002" > 
> > $(obj)board/astro/mcf5373l/config.tmp ; \
> > +   $(XECHO) "... for RAM boot ..." ; \
> > +   else \
> > +   echo "TEXT_BASE = 0x" > 
> > $(obj)board/astro/mcf5373l/config.tmp ; \
> > +   $(XECHO) "... for FLASH boot ..." ; \
> > +   fi
> > +   @$(MKCONFIG) -a astro_mcf5373l m68k mcf532x mcf5373l astro
> 
> Please keep lists sorted, and don't add such scripting to the
> Makefile. It is not needed any more.

Another question here:
which sorting scheme should I adhere to? With the exception of the
tasreg board, all coldfire boards are sorted according to their
processor number (this sorting is in turn alphabetical, not numerical,
probably because it better represents the family affiliation), only
the tasreg board is at the end of the list according to the
alphabetical order of the board names...

Best regards,
Wolfgang

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


[U-Boot] [PATCH v2 1/3] TI: DaVinci: Prepare for da850 support

2009-12-18 Thread Sudhakar Rajashekhara
DA850/OMAP-L138 is a new SoC from Texas Instruments
(http://focus.ti.com/docs/prod/folders/print/omap-l138.html).
This SoC is similar to DA830/OMAP-L137 in many aspects. Hence
rename the da830 specific files and folders to da8xx to
accommodate DA850/OMAP-L138.

Signed-off-by: Sudhakar Rajashekhara 
---
This patch applies to u-boot-ti branch.

Since the previous version following are the changes:
1. Scripting in the main Makefile has been removed.
2. Patch was created using -M option.

 Makefile|2 +-
 board/davinci/{da830evm => da8xxevm}/Makefile   |4 +++-
 board/davinci/{da830evm => da8xxevm}/config.mk  |0 
 board/davinci/{da830evm => da8xxevm}/da830evm.c |0 
 4 files changed, 4 insertions(+), 2 deletions(-)
 rename board/davinci/{da830evm => da8xxevm}/Makefile (94%)
 rename board/davinci/{da830evm => da8xxevm}/config.mk (100%)
 rename board/davinci/{da830evm => da8xxevm}/da830evm.c (100%)

diff --git a/Makefile b/Makefile
index b891b1b..048b2b3 100644
--- a/Makefile
+++ b/Makefile
@@ -2934,7 +2934,7 @@ cp1026_config: unconfig
@board/armltd/integrator/split_by_variant.sh cp $@
 
 da830evm_config:   unconfig
-   @$(MKCONFIG) $(@:_config=) arm arm926ejs da830evm davinci davinci
+   @$(MKCONFIG) $(@:_config=) arm arm926ejs da8xxevm davinci davinci
 
 davinci_dvevm_config : unconfig
@$(MKCONFIG) $(@:_config=) arm arm926ejs dvevm davinci davinci
diff --git a/board/davinci/da830evm/Makefile b/board/davinci/da8xxevm/Makefile
similarity index 94%
rename from board/davinci/da830evm/Makefile
rename to board/davinci/da8xxevm/Makefile
index 02636fa..20f4915 100644
--- a/board/davinci/da830evm/Makefile
+++ b/board/davinci/da8xxevm/Makefile
@@ -27,7 +27,9 @@ include $(TOPDIR)/config.mk
 
 LIB= $(obj)lib$(BOARD).a
 
-COBJS  := da830evm.o
+COBJS-$(CONFIG_MACH_DAVINCI_DA830_EVM) += da830evm.o
+
+COBJS   := $(sort $(COBJS-y))
 
 SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(COBJS))
diff --git a/board/davinci/da830evm/config.mk b/board/davinci/da8xxevm/config.mk
similarity index 100%
rename from board/davinci/da830evm/config.mk
rename to board/davinci/da8xxevm/config.mk
diff --git a/board/davinci/da830evm/da830evm.c 
b/board/davinci/da8xxevm/da830evm.c
similarity index 100%
rename from board/davinci/da830evm/da830evm.c
rename to board/davinci/da8xxevm/da830evm.c
-- 
1.5.6

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


[U-Boot] [PATCH v2 2/3] TI: DaVinci: Add board specific code for da850 EVM

2009-12-18 Thread Sudhakar Rajashekhara
Provides initial support for TI OMAP-L138/DA850 SoC devices on
a Logic PD EVM board.

Provides:
Initial boot and configuration.
Support for i2c.
UART support (console).

Signed-off-by: Sudhakar Rajashekhara 
---
This patch applies to u-boot-ti branch.

Since the previous version following are the changes:
Macro used for conditional compilation has changed.

 board/davinci/da8xxevm/Makefile |1 +
 board/davinci/da8xxevm/da850evm.c   |  124 +++
 include/asm-arm/arch-davinci/hardware.h |1 +
 3 files changed, 126 insertions(+), 0 deletions(-)
 create mode 100644 board/davinci/da8xxevm/da850evm.c

diff --git a/board/davinci/da8xxevm/Makefile b/board/davinci/da8xxevm/Makefile
index 20f4915..bcf315c 100644
--- a/board/davinci/da8xxevm/Makefile
+++ b/board/davinci/da8xxevm/Makefile
@@ -28,6 +28,7 @@ include $(TOPDIR)/config.mk
 LIB= $(obj)lib$(BOARD).a
 
 COBJS-$(CONFIG_MACH_DAVINCI_DA830_EVM) += da830evm.o
+COBJS-$(CONFIG_MACH_DAVINCI_DA850_EVM) += da850evm.o
 
 COBJS   := $(sort $(COBJS-y))
 
diff --git a/board/davinci/da8xxevm/da850evm.c 
b/board/davinci/da8xxevm/da850evm.c
new file mode 100644
index 000..92548e2
--- /dev/null
+++ b/board/davinci/da8xxevm/da850evm.c
@@ -0,0 +1,124 @@
+/*
+ * (C) Copyright 2009, Texas Instruments, Inc. http://www.ti.com/
+ *
+ * Based on da830evm.c
+ *
+ * Copyright (C) 2007 Sergey Kubushyn 
+ *
+ * Parts are shamelessly stolen from various TI sources, original copyright
+ * follows:
+ * -
+ *
+ * Copyright (C) 2004 Texas Instruments.
+ *
+ * 
+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * 
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include "../common/misc.h"
+
+DECLARE_GLOBAL_DATA_PTR;
+
+#define pinmux &davinci_syscfg_regs->pinmux
+
+#ifdef CONFIG_SPI_FLASH
+/* SPI0 pin muxer settings */
+const struct pinmux_config spi1_pins[] = {
+   { pinmux[5], 1, 1 },
+   { pinmux[5], 1, 2 },
+   { pinmux[5], 1, 4 },
+   { pinmux[5], 1, 5 }
+};
+#endif
+
+/* UART pin muxer settings */
+const struct pinmux_config uart_pins[] = {
+   { pinmux[0], 4, 6 },
+   { pinmux[0], 4, 7 },
+   { pinmux[4], 2, 4 },
+   { pinmux[4], 2, 5 }
+};
+
+/* I2C pin muxer settings */
+const struct pinmux_config i2c_pins[] = {
+   { pinmux[4], 2, 2 },
+   { pinmux[4], 2, 3 }
+};
+
+int board_init(void)
+{
+#ifndef CONFIG_USE_IRQ
+   /*
+* Mask all IRQs by clearing the global enable and setting
+* the enable clear for all the 90 interrupts.
+*/
+
+   writel(0, &davinci_aintc_regs->ger);
+
+   writel(0, &davinci_aintc_regs->hier);
+
+   writel(0x, &davinci_aintc_regs->ecr1);
+   writel(0x, &davinci_aintc_regs->ecr2);
+   writel(0x, &davinci_aintc_regs->ecr3);
+#endif
+
+   /* arch number of the board */
+   gd->bd->bi_arch_number = MACH_TYPE_DAVINCI_DA850_EVM;
+
+   /* address of boot parameters */
+   gd->bd->bi_boot_params = LINUX_BOOT_PARAM_ADDR;
+
+   /*
+* Power on required peripherals
+* ARM does not have access by default to PSC0 and PSC1
+* assuming here that the DSP bootloader has set the IOPU
+* such that PSC access is available to ARM
+*/
+   lpsc_on(DAVINCI_LPSC_AEMIF);/* NAND, NOR */
+   lpsc_on(DAVINCI_LPSC_SPI1); /* Serial Flash */
+   lpsc_on(DAVINCI_LPSC_EMAC); /* image download */
+   lpsc_on(DAVINCI_LPSC_UART2);/* console */
+   lpsc_on(DAVINCI_LPSC_GPIO);
+
+   /* setup the SUSPSRC for ARM to control emulation suspend */
+   writel(readl(&davinci_syscfg_regs->suspsrc) &
+  ~(DAVINCI_SYSCFG_SUSPSRC_EMAC | DAVINCI_SYSCFG_SUSPSRC_I2C |
+DAVINCI_SYSCFG_SUSPSRC_SPI1 | DAVINCI_SYSCFG_SUSPSRC_TIMER0 |
+DAVINCI_SYSCFG_SUSPSRC_UART2),
+  &davinci_syscfg_regs->suspsrc);
+
+#ifdef CONFIG_SPI_FLASH
+   if (davinci_configure_pin_mux(spi1_pins, ARRAY_SIZE(spi1_pins)) != 0)
+   return 1;
+#endif
+
+   if (davinci_configure_pin_mux(uart_pins, ARRAY_SIZE(uart_pins)) != 0)
+   r

[U-Boot] [PATCH v2 3/3] TI: DaVinci: Create configuration file for da850 EVM

2009-12-18 Thread Sudhakar Rajashekhara
Provides initial support for TI OMAP-L138/DA850 SoC devices
on a Logic PD EVM board.

Signed-off-by: Sudhakar Rajashekhara 
---
This patch applies to u-boot-ti branch.

Since the previous version following are the changes:
1. Scripting has been removed from the main Makefile.
2. Comments from Wolfgang Denk at [1] have been fixed.

[1] http://lists.denx.de/pipermail/u-boot/2009-December/065590.html

 MAINTAINERS|4 +
 MAKEALL|1 +
 Makefile   |3 +
 include/configs/da850evm.h |  136 
 4 files changed, 144 insertions(+), 0 deletions(-)
 create mode 100644 include/configs/da850evm.h

diff --git a/MAINTAINERS b/MAINTAINERS
index 8a61f5b..03d2ede 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -722,6 +722,10 @@ Nick Thompson 
 
da830evmARM926EJS (DA830/OMAP-L137)
 
+Sudhakar Rajashekhara 
+
+   da850evmARM926EJS (DA850/OMAP-L138)
+
 Albin Tonnerre 
 
sbc35_a9g20 ARM926EJS (AT91SAM9G20 SoC)
diff --git a/MAKEALL b/MAKEALL
index 6ee5c49..74bb85e 100755
--- a/MAKEALL
+++ b/MAKEALL
@@ -551,6 +551,7 @@ LIST_ARM9=" \
cp946es \
cp966   \
da830evm\
+   da850evm\
imx27lite   \
lpd7a400\
mv88f6281gtw_ge \
diff --git a/Makefile b/Makefile
index 048b2b3..ead6482 100644
--- a/Makefile
+++ b/Makefile
@@ -2933,6 +2933,9 @@ cp922_XA10_config \
 cp1026_config: unconfig
@board/armltd/integrator/split_by_variant.sh cp $@
 
+da850evm_config:   unconfig
+   @$(MKCONFIG) $(@:_config=) arm arm926ejs da8xxevm davinci davinci
+
 da830evm_config:   unconfig
@$(MKCONFIG) $(@:_config=) arm arm926ejs da8xxevm davinci davinci
 
diff --git a/include/configs/da850evm.h b/include/configs/da850evm.h
new file mode 100644
index 000..8f5bb49
--- /dev/null
+++ b/include/configs/da850evm.h
@@ -0,0 +1,136 @@
+/*
+ * Copyright (C) 2009 Texas Instruments, Inc 
+ *
+ * Based on davinci_dvevm.h. Original Copyrights follow:
+ *
+ * Copyright (C) 2007 Sergey Kubushyn 
+ *
+ * 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 __CONFIG_H
+#define __CONFIG_H
+
+/*
+ * Board
+ */
+
+/*
+ * SoC Configuration
+ */
+#define CONFIG_MACH_DAVINCI_DA850_EVM
+#define CONFIG_ARM926EJS   /* arm926ejs CPU core */
+#define CONFIG_SOC_DA8XX   /* TI DA8xx SoC */
+#define CONFIG_SYS_CLK_FREQclk_get(DAVINCI_ARM_CLKID)
+#define CONFIG_SYS_OSCIN_FREQ  2400
+#define CONFIG_SYS_TIMERBASE   DAVINCI_TIMER0_BASE
+#define CONFIG_SYS_HZ_CLOCKclk_get(DAVINCI_AUXCLK_CLKID)
+#define CONFIG_SYS_HZ  1000
+#define CONFIG_SKIP_LOWLEVEL_INIT
+#define CONFIG_SKIP_RELOCATE_UBOOT /* to a proper address, init done */
+
+/*
+ * Memory Info
+ */
+#define CONFIG_SYS_MALLOC_LEN  (0x1 + 1*1024*1024) /* malloc() len */
+#define CONFIG_SYS_GBL_DATA_SIZE   128 /* reserved for initial data */
+#define PHYS_SDRAM_1   DAVINCI_DDR_EMIF_DATA_BASE /* DDR Start */
+#define PHYS_SDRAM_1_SIZE  (64 << 20) /* SDRAM size 64MB */
+#define CONFIG_SYS_MEMTEST_START   PHYS_SDRAM_1 /* memtest start addr */
+#define CONFIG_SYS_MEMTEST_END (PHYS_SDRAM_1 + 16*1024*1024) /* 16MB 
test */
+#define CONFIG_NR_DRAM_BANKS   1 /* we have 1 bank of DRAM */
+#define CONFIG_STACKSIZE   (256*1024) /* regular stack */
+
+/*
+ * Serial Driver info
+ */
+#define CONFIG_SYS_NS16550
+#define CONFIG_SYS_NS16550_SERIAL
+#define CONFIG_SYS_NS16550_REG_SIZE-4  /* NS16550 register size */
+#define CONFIG_SYS_NS16550_COM1DAVINCI_UART2_BASE /* Base address of 
UART2 */
+#define CONFIG_SYS_NS16550_CLK clk_get(DAVINCI_UART2_CLKID)
+#define CONFIG_CONS_INDEX  1   /* use UART0 for console */
+#define CONFIG_BAUDRATE115200  /* Default baud rate */
+#define CONFIG_SYS_BAUDRATE_TABLE  { 9600, 19200, 38400, 57600, 115200 }
+
+/*
+ * I2C Configuration
+ */
+#define CONFIG_HARD_I2C
+#define CONFIG_DRIVER_DAVINCI_I2C
+#define CONFIG_SYS_I2C_SPEED   25000
+#define CONFIG_SYS_I2C_SLAVE   10 /* Bogus, master-only in U-Boot */
+
+/*
+ * 

Re: [U-Boot] ubi part failing on NAND

2009-12-18 Thread Jeff Angielski
hedwin wrote:
> Jeff, what is the size of your allocateble memory. Had to increase it to 4MB
> to get it working.

#define CONFIG_SYS_MALLOC_LEN   (1024 * 1024)

I'll try increasing it to see if that helps.

> 
> On Fri, Dec 18, 2009 at 9:16 AM, Stefan Roese  wrote:
>> Jeff,
>>
>> On Thursday 17 December 2009 22:09:03 Jeff Angielski wrote:
>>> The "ubi part" command is failing for me on my PowerPC 85xx board.  I am
>>> not trying to do anything special, just create the partitions and
>>> volumes so that I can try writing an ubi.img.  It spits out enough
>>> information that it looks like it did work but it prints out an error
>>> nonetheless.
>>>
>>> And of course there is the long standing issue of the reported MTD
>>> number not making any sense.  But previous posts have discounted this as
>>> an issue.
>> Patches to fix/change this are welcome. :)
>>
>>> Here is the snippet of the error:
>>>
>>> UBI error: ubi_init: cannot attach mtd2
>>> UBI: mtd2 is detached from ubi0
>>> UBI error: ubi_init: UBI error: cannot initialize UBI, error -17
>>> UBI init error -17
>> -17 == EEXIST. Looking at the code (build.c) shows that ubi_attach_mtd_dev()
>> is returning this error code in case the MTD device is already attached. Even
>> though the UBI implementation should handle this without any problems. I have
>> to admit that I'm a bit out of ideas what's going wrong in your case. I just
>> checked again and UBI works fine for me with the latest version:
>>
>>
>> => mtdparts
>>
>> device nand0 , # parts = 3
>>  #: namesizeoffset  mask_flags
>>  0: bootloader  0x0010  0x  0
>>  1: rootfs  0x0100  0x0010  0
>>  2: ubifs   0x02f0  0x0110  0
>>
>> active partition: nand0,0 - (bootloader) 0x0010 @ 0x
>>
>> defaults:
>> mtdids  : nand0=nand
>> mtdparts: mtdparts=nand:1m(bootloader),16m(rootfs),-(ubifs)
>> => nand erase 110 2f0
>>
>> NAND erase: device 0 offset 0x110, size 0x2f0
>> Erasing at 0x3ffc000 -- 100% complete.
>> OK
>> => ubi part ubifs
>> Creating 1 MTD partitions on "nand0":
>> 0x0110-0x0400 : "mtd=2"
>> UBI: attaching mtd1 to ubi0
>> UBI: physical eraseblock size:   16384 bytes (16 KiB)
>> UBI: logical eraseblock size:15872 bytes
>> UBI: smallest flash I/O unit:512
>> UBI: sub-page size:  256
>> UBI: VID header offset:  256 (aligned 256)
>> UBI: data offset:512
>> UBI: empty MTD device detected
>> UBI: create volume table (copy #1)
>> UBI: create volume table (copy #2)
>> UBI: attached mtd1 to ubi0
>> UBI: MTD device name:"mtd=2"
>> UBI: MTD device size:47 MiB
>> UBI: number of good PEBs:3008
>> UBI: number of bad PEBs: 0
>> UBI: max. allowed volumes:   92
>> UBI: wear-leveling threshold:4096
>> UBI: number of internal volumes: 1
>> UBI: number of user volumes: 0
>> UBI: available PEBs: 2974
>> UBI: total number of reserved PEBs: 34
>> UBI: number of PEBs reserved for bad PEB handling: 30
>> UBI: max/mean erase counter: 0/0
>> => mtdparts
>>
>> device nand0 , # parts = 3
>>  #: namesizeoffset  mask_flags
>>  0: bootloader  0x0010  0x  0
>>  1: rootfs  0x0100  0x0010  0
>>  2: ubifs   0x02f0  0x0110  0
>>
>> active partition: nand0,0 - (bootloader) 0x0010 @ 0x
>>
>> defaults:
>> mtdids  : nand0=nand
>> mtdparts: mtdparts=nand:1m(bootloader),16m(rootfs),-(ubifs)
>> => nand erase 10 100
>>
>> NAND erase: device 0 offset 0x10, size 0x100
>> Erasing at 0x10fc000 -- 100% complete.
>> OK
>> => ubi part rootfs
>> UBI: mtd1 is detached from ubi0
>> Creating 1 MTD partitions on "nand0":
>> 0x0010-0x0110 : "mtd=1"
>> UBI: attaching mtd1 to ubi0
>> UBI: physical eraseblock size:   16384 bytes (16 KiB)
>> UBI: logical eraseblock size:15872 bytes
>> UBI: smallest flash I/O unit:512
>> UBI: sub-page size:  256
>> UBI: VID header offset:  256 (aligned 256)
>> UBI: data offset:512
>> UBI: empty MTD device detected
>> UBI: create volume table (copy #1)
>> UBI: create volume table (copy #2)
>> UBI: attached mtd1 to ubi0
>> UBI: MTD device name:"mtd=1"
>> UBI: MTD device size:16 MiB
>> UBI: number of good PEBs:1024
>> UBI: number of bad PEBs: 0
>> UBI: max. allowed volumes:   92
>> UBI: wear-leveling threshold:4096
>> UBI: number of internal volumes: 1
>> UBI: number of user volumes: 0
>> UBI: available PEBs: 1010
>> UBI: total number of reserved PEBs: 14
>> UBI: number of PEBs reserved for bad PEB handling: 10
>> UBI: max/mean erase counter: 0/0
>> =>
>>
>>
>> Perhaps you should try the latest version as well. Could be that this is a 
>> bug
>> already fixed now. Otherwise you need to d

Re: [U-Boot] ubi part failing on NAND

2009-12-18 Thread Jeff Angielski
Stefan Roese wrote:
> On Friday 18 December 2009 13:35:26 hedwin wrote:
>> Jeff, what is the size of your allocateble memory. Had to increase it to
>>  4MB to get it working.
> 
> I've got 1MByte for my test on Kilauea. This should be enough. There
> is already a compile-time check in the UBI code:
> 
> 
> #if (CONFIG_SYS_MALLOC_LEN < (512 << 10))
> #error Malloc area too small for UBI, increase CONFIG_SYS_MALLOC_LEN to >= 
> 512k
> #endif
> 
> Please let me know if this really is not enough. But for me, 1MB is working.

As per Hedwin's suggestion I increased my CONFIG_SYS_MALLOC_LEN to 4MB 
and the error disappeared.  Thanks Hedwin!  And now the UBI output 
matches my part (e.g. PEB size).


=> nand erase 0x0 0x4000

=> ubi part fs1
Creating 1 MTD partitions on "nand0":
0x-0x2000 : "mtd=0"
UBI: attaching mtd2 to ubi0
UBI: physical eraseblock size:   262144 bytes (256 KiB)
UBI: logical eraseblock size:253952 bytes
UBI: smallest flash I/O unit:4096
UBI: VID header offset:  4096 (aligned 4096)
UBI: data offset:8192
UBI: empty MTD device detected
UBI: create volume table (copy #1)
UBI: create volume table (copy #2)
UBI: attached mtd2 to ubi0
UBI: MTD device name:"mtd=0"
UBI: MTD device size:512 MiB
UBI: number of good PEBs:2045
UBI: number of bad PEBs: 3
UBI: max. allowed volumes:   128
UBI: wear-leveling threshold:4096
UBI: number of internal volumes: 1
UBI: number of user volumes: 0
UBI: available PEBs: 2021
UBI: total number of reserved PEBs: 24
UBI: number of PEBs reserved for bad PEB handling: 20
UBI: max/mean erase counter: 0/0
=>

-- 
Jeff Angielski
The PTR Group
www.theptrgroup.com
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 1/2] mpc5xxx.h: Add structure definition for XLB arbiter block.

2009-12-18 Thread Detlev Zundel
Signed-off-by: Detlev Zundel 
---
 include/mpc5xxx.h |   17 +
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/include/mpc5xxx.h b/include/mpc5xxx.h
index 476d149..4dcf90c 100644
--- a/include/mpc5xxx.h
+++ b/include/mpc5xxx.h
@@ -947,6 +947,23 @@ struct mpc5xxx_mscan {
struct mscan_buffer cantxfg;/* MSCAN + 0x60 *//* Foreground 
transmit buffer */
};
 
+struct mpc5xxx_xlb {
+   volatile u8 reserved[0x40]; /* XLB + 0x00 */
+   volatile u32 config;/* XLB + 0x40 */
+   volatile u32 version;   /* XLB + 0x44 */
+   volatile u32 status;/* XLB + 0x48 */
+   volatile u32 int_enable;/* XLB + 0x4c */
+   volatile u32 addr_capture;  /* XLB + 0x50 */
+   volatile u32 bus_sig_capture;   /* XLB + 0x54 */
+   volatile u32 addr_timeout;  /* XLB + 0x58 */
+   volatile u32 data_timeout;  /* XLB + 0x5c */
+   volatile u32 bus_act_timeout;   /* XLB + 0x60 */
+   volatile u32 master_pri_enable; /* XLB + 0x64 */
+   volatile u32 master_priority;   /* XLB + 0x68 */
+   volatile u32 base_address;  /* XLB + 0x6c */
+   volatile u32 snoop_window;  /* XLB + 0x70 */
+};
+
 /* function prototypes */
 void loadtask(int basetask, int tasks);
 
-- 
1.6.2.5

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


[U-Boot] [PATCH 2/2] mpc5xxx/cpu_init.c: Convert to IO accessors.

2009-12-18 Thread Detlev Zundel
Signed-off-by: Detlev Zundel 
---
 cpu/mpc5xxx/cpu_init.c |  126 +--
 1 files changed, 78 insertions(+), 48 deletions(-)

diff --git a/cpu/mpc5xxx/cpu_init.c b/cpu/mpc5xxx/cpu_init.c
index 14bd417..acff5f5 100644
--- a/cpu/mpc5xxx/cpu_init.c
+++ b/cpu/mpc5xxx/cpu_init.c
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2000-2003
+ * (C) Copyright 2000-2009
  * Wolfgang Denk, DENX Software Engineering, w...@denx.de.
  *
  * See file CREDITS for list of people who contributed to this
@@ -23,6 +23,7 @@
 
 #include 
 #include 
+#include 
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -34,6 +35,16 @@ DECLARE_GLOBAL_DATA_PTR;
  */
 void cpu_init_f (void)
 {
+   volatile struct mpc5xxx_mmap_ctl *mm =
+   (struct mpc5xxx_mmap_ctl *) CONFIG_SYS_MBAR;
+   volatile struct mpc5xxx_lpb *lpb =
+   (struct mpc5xxx_lpb *) MPC5XXX_LPB;
+   volatile struct mpc5xxx_cdm *cdm =
+   (struct mpc5xxx_cdm *) MPC5XXX_CDM;
+   volatile struct mpc5xxx_gpio *gpio =
+   (struct mpc5xxx_gpio *) MPC5XXX_GPIO;
+   volatile struct mpc5xxx_xlb *xlb =
+   (struct mpc5xxx_xlb *) MPC5XXX_XLBARB;
unsigned long addecr = (1 << 25); /* Boot_CS */
 #if defined(CONFIG_SYS_RAMBOOT) && defined(CONFIG_MGT5100)
addecr |= (1 << 22); /* SDRAM enable */
@@ -48,119 +59,135 @@ void cpu_init_f (void)
 * Memory Controller: configure chip selects and enable them
 */
 #if defined(CONFIG_SYS_BOOTCS_START) && defined(CONFIG_SYS_BOOTCS_SIZE)
-   *(vu_long *)MPC5XXX_BOOTCS_START = START_REG(CONFIG_SYS_BOOTCS_START);
-   *(vu_long *)MPC5XXX_BOOTCS_STOP = STOP_REG(CONFIG_SYS_BOOTCS_START,
-   CONFIG_SYS_BOOTCS_SIZE);
+   out_be32(&mm->boot_start, START_REG(CONFIG_SYS_BOOTCS_START));
+   out_be32(&mm->boot_stop, STOP_REG(CONFIG_SYS_BOOTCS_START,
+ CONFIG_SYS_BOOTCS_SIZE));
 #endif
 #if defined(CONFIG_SYS_BOOTCS_CFG)
-   *(vu_long *)MPC5XXX_BOOTCS_CFG = CONFIG_SYS_BOOTCS_CFG;
+   out_be32(&lpb->cs0_cfg, CONFIG_SYS_BOOTCS_CFG);
 #endif
 
 #if defined(CONFIG_SYS_CS0_START) && defined(CONFIG_SYS_CS0_SIZE)
-   *(vu_long *)MPC5XXX_CS0_START = START_REG(CONFIG_SYS_CS0_START);
-   *(vu_long *)MPC5XXX_CS0_STOP = STOP_REG(CONFIG_SYS_CS0_START, 
CONFIG_SYS_CS0_SIZE);
+   out_be32(&mm->cs0_start, START_REG(CONFIG_SYS_CS0_START));
+   out_be32(&mm->cs0_stop, STOP_REG(CONFIG_SYS_CS0_START,
+CONFIG_SYS_CS0_SIZE));
/* CS0 and BOOT_CS cannot be enabled at once. */
/*  addecr |= (1 << 16); */
 #endif
 #if defined(CONFIG_SYS_CS0_CFG)
-   *(vu_long *)MPC5XXX_CS0_CFG = CONFIG_SYS_CS0_CFG;
+   out_be32(&lpb->cs0_cfg, CONFIG_SYS_CS0_CFG);
 #endif
 
 #if defined(CONFIG_SYS_CS1_START) && defined(CONFIG_SYS_CS1_SIZE)
-   *(vu_long *)MPC5XXX_CS1_START = START_REG(CONFIG_SYS_CS1_START);
-   *(vu_long *)MPC5XXX_CS1_STOP = STOP_REG(CONFIG_SYS_CS1_START, 
CONFIG_SYS_CS1_SIZE);
+   out_be32(&mm->cs1_start, START_REG(CONFIG_SYS_CS1_START));
+   out_be32(&mm->cs1_stop, STOP_REG(CONFIG_SYS_CS1_START,
+CONFIG_SYS_CS1_SIZE));
addecr |= (1 << 17);
 #endif
 #if defined(CONFIG_SYS_CS1_CFG)
-   *(vu_long *)MPC5XXX_CS1_CFG = CONFIG_SYS_CS1_CFG;
+   out_be32(&lpb->cs1_cfg, CONFIG_SYS_CS1_CFG);
 #endif
 
 #if defined(CONFIG_SYS_CS2_START) && defined(CONFIG_SYS_CS2_SIZE)
-   *(vu_long *)MPC5XXX_CS2_START = START_REG(CONFIG_SYS_CS2_START);
-   *(vu_long *)MPC5XXX_CS2_STOP = STOP_REG(CONFIG_SYS_CS2_START, 
CONFIG_SYS_CS2_SIZE);
+   out_be32(&mm->cs2_start, START_REG(CONFIG_SYS_CS2_START));
+   out_be32(&mm->cs2_stop, STOP_REG(CONFIG_SYS_CS2_START,
+CONFIG_SYS_CS2_SIZE));
addecr |= (1 << 18);
 #endif
 #if defined(CONFIG_SYS_CS2_CFG)
-   *(vu_long *)MPC5XXX_CS2_CFG = CONFIG_SYS_CS2_CFG;
+   out_be32(&lpb->cs2_cfg, CONFIG_SYS_CS2_CFG);
 #endif
 
 #if defined(CONFIG_SYS_CS3_START) && defined(CONFIG_SYS_CS3_SIZE)
-   *(vu_long *)MPC5XXX_CS3_START = START_REG(CONFIG_SYS_CS3_START);
-   *(vu_long *)MPC5XXX_CS3_STOP = STOP_REG(CONFIG_SYS_CS3_START, 
CONFIG_SYS_CS3_SIZE);
+   out_be32(&mm->cs3_start, START_REG(CONFIG_SYS_CS3_START));
+   out_be32(&mm->cs3_stop, STOP_REG(CONFIG_SYS_CS3_START,
+CONFIG_SYS_CS3_SIZE));
addecr |= (1 << 19);
 #endif
 #if defined(CONFIG_SYS_CS3_CFG)
-   *(vu_long *)MPC5XXX_CS3_CFG = CONFIG_SYS_CS3_CFG;
+   out_be32(&lpb->cs3_cfg, CONFIG_SYS_CS3_CFG);
 #endif
 
 #if defined(CONFIG_SYS_CS4_START) && defined(CONFIG_SYS_CS4_SIZE)
-   *(vu_long *)MPC5XXX_CS4_START = START_REG(CONFIG_SYS_CS4_START);
-   *(vu_long *)MPC5XXX_CS4_STOP = STOP_REG(CONFIG_SYS_CS4_START, 
CONFIG_SYS_CS4_SIZE);
+   out_be32(&mm->cs4_start, START_REG(CONFIG_SYS_CS4_START));
+   out_be32(&mm->cs4_stop, STOP_RE

[U-Boot] [PATCH 0/2] 5xxx cleanup, no functional changes

2009-12-18 Thread Detlev Zundel
This is some more cleanup moving to IO accessor functions.

And yes, I know about the checkpatch warnings, but this is inline with
the current code.

Detlev Zundel (2):
  mpc5xxx.h: Add structure definition for XLB arbiter block.
  mpc5xxx/cpu_init.c: Convert to IO accessors.

 cpu/mpc5xxx/cpu_init.c |  126 +--
 include/mpc5xxx.h  |   17 +++
 2 files changed, 95 insertions(+), 48 deletions(-)

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


Re: [U-Boot] About GPL

2009-12-18 Thread Robin Getz
On Wed 16 Dec 2009 21:55, Rob Westfall pondered:
> Where exactly is the line for what you have to provide vs what you
> don't have to provide?
> 
> We are building boards that are based on a standard board, but we have
> obviously had to modify include/config/ to setup for our
> hardware and create customized files to support our board.  We have
> NOT modified files outside of customizing a
> /include/config/ and creating a board/ directory
> based on a existing board that is already released from the cpu
> vendor.

The Free Software Foundation has this to say:

http://www.gnu.org/licenses/gpl-faq.html#DistributingSourceIsInconvenient

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


[U-Boot] [STATUS] U-Boot 2009.11 Release

2009-12-18 Thread Wolfgang Denk
Hi everybody,

U-Boot v2009.11 has been released and is available from the git
repository and the FTP server.

The "next" branch has been pulled into mainline ("master" branch) and
has been removed afterward.

The Merge Window for the next release (v2010.02) is open until Mon
Jan 18, 2010, 23:59:59 CET = 31 days remaining. Because of the Xmas
break I decided to have a longer Merge Window than usual.

The next release is scheduled for March 13, 2010.

See  http://www.denx.de/wiki/U-Boot/ReleaseCycle  for details,
including guestimates for the next releases after that.

A little statistics [1] - changes since release v2009.08:


Processed 578 csets from 90 developers
38 employers found
A total of 50678 lines added, 26546 removed (delta 24132)

Compare v2009.08:

Processed 724 csets from 96 developers
34 employers found
A total of 83512 lines added, 52725 removed (delta 30787)

Developers with the most changesets
Kumar Gala  54 (9.3%)
Peter Tyser 46 (8.0%)
Wolfgang Denk   37 (6.4%)
Mike Frysinger  31 (5.4%)
Sandeep Paulraj 29 (5.0%)
Stefan Roese22 (3.8%)
Paul Gortmaker  20 (3.5%)
Poonam Aggrwal  16 (2.8%)
Anton Vorontsov 16 (2.8%)
Prafulla Wadaskar   14 (2.4%)
...

Developers with the most changed lines
Wolfgang Denk 9075 (15.1%)
Kumar Gala6106 (10.2%)
Stefan Roese  4533 (7.6%)
Minkyu Kang   3208 (5.3%)
Tom Rix   2884 (4.8%)
Kevin Morfitt 2363 (3.9%)
Niklaus Giger 2214 (3.7%)
Peter Tyser   2198 (3.7%)
Poonam Aggrwal2136 (3.6%)
Prafulla Wadaskar 2052 (3.4%)
...

Developers with the most lines removed
Kumar Gala2543 (9.6%)
Peter Tyser   1595 (6.0%)
Kevin Morfitt  888 (3.3%)
Michal Simek   799 (3.0%)
Stefan Roese   334 (1.3%)
Scott McNutt   196 (0.7%)
Marcel Ziswiler 96 (0.4%)
Becky Bruce 78 (0.3%)
Nobuhiro Iwamatsu   15 (0.1%)
Pratap Chandu8 (0.0%)
...

Developers with the most signoffs (total 869)
Kumar Gala 206 (23.7%)
Stefan Roese69 (7.9%)
Ben Warren  53 (6.1%)
Peter Tyser 48 (5.5%)
Mike Frysinger  44 (5.1%)
Sandeep Paulraj 31 (3.6%)
Scott Wood  23 (2.6%)
Kim Phillips20 (2.3%)
Paul Gortmaker  20 (2.3%)
Wolfgang Denk   18 (2.1%)
...

Developers with the most reviews (total 2)
Roland Lezuo 2 (100.0%)

Developers with the most test credits (total 16)
Wolfgang Denk6 (37.5%)
Heiko Schocher   4 (25.0%)
Kumar Gala   2 (12.5%)
Peter Tyser  2 (12.5%)
Mike Rapoport2 (12.5%)

Developers who gave the most tested-by credits (total 16)
Wolfgang Denk8 (50.0%)
Marcel Ziswiler  2 (12.5%)
Peter Tyser  1 (6.2%)
Ben Warren   1 (6.2%)
Mike Frysinger   1 (6.2%)
Kevin Morfitt1 (6.2%)
Timur Tabi   1 (6.2%)
Michael Brandt   1 (6.2%)

Developers with the most report credits (total 6)
Ed Swarthout 2 (33.3%)
Peter Gombos 2 (33.3%)
Guenter Koellner 2 (33.3%)

Developers who gave the most report credits (total 6)
Wolfgang Denk4 (66.7%)
Peter Tyser  1 (16.7%)
Mike Frysinger   1 (16.7%)

Top changeset contributors by employer
Freescale  110 (19.0%)
(Unknown)   88 (15.2%)
DENX Software Engineering   68 (11.8%)
Extreme Engineering Solutions   47 (8.1%)
Analog Devices  38 (6.6%)
Texas Instruments   34 (5.9%)
Wind River  26 (4.5%)
MontaVista  16 (2.8%)
Graeme Russ 14 (2.4%)
Marvell 14 (2.4%)
...

Top lines changed by employer
DENX Software Engineering 14608 (24.3%)
Freescale 11330 (18.9%)
(Unknown) 11007 (18.3%)
Wind River3630 (6.0%)
Samsung   3259 (5.4%)
Extreme Engineering Solutions 2447 (4.1%)
Marvell   2052 (3.4%)
IBM   1913 (3.2%)
Texas Instruments 1546 (2.6%)
EmCraft Systems   1510 (2.5%)
...

Employers with the most signoffs (total 869)
Freescale  302 (34.8%)
(Unknown)  144 (16.6%)
DENX Software Engineering  100 (11.5%)
Analog Devices  51 (5.9%)
Extreme Engineering Solutions   49 (5.6%)
Texas Instruments   42 (4.8%)
Wind River  32 (3.7%)
Samsung 24 (2.8%)
Marvell 17 (2.0%)
MontaVista  16 (1.8%)
...

[1] See http://www.denx.de/wiki/U-Boot/UbootStat_

Re: [U-Boot] [PATCH] add ASTRO MCF5373L board

2009-12-18 Thread Wolfgang Denk
Dear Wolfgang Wegner,

In message <20091218142428.gd30...@leila.ping.de> you wrote:
> 
> > >  TASREG_config :  unconfig
> > >   @$(MKCONFIG) $(@:_config=) m68k mcf52x2 tasreg esd
> > >  
> > > +astro_mcf5373l_config \
> > > +astro_mcf5373l_ram_config :  unconfig
> > > + @if [ "$@" = "astro_mcf5373l_ram_config" ] ; then \
> > > + echo "#define CONFIG_MONITOR_IS_IN_RAM" >> 
> > > $(obj)include/config.h ; \
> > > + echo "TEXT_BASE = 0x4002" > 
> > > $(obj)board/astro/mcf5373l/config.tmp ; \
> > > + $(XECHO) "... for RAM boot ..." ; \
> > > + else \
> > > + echo "TEXT_BASE = 0x" > 
> > > $(obj)board/astro/mcf5373l/config.tmp ; \
> > > + $(XECHO) "... for FLASH boot ..." ; \
> > > + fi
> > > + @$(MKCONFIG) -a astro_mcf5373l m68k mcf532x mcf5373l astro
> > 
> > Please keep lists sorted, and don't add such scripting to the
> > Makefile. It is not needed any more.
> 
> Another question here:
> which sorting scheme should I adhere to? With the exception of the
> tasreg board, all coldfire boards are sorted according to their
> processor number (this sorting is in turn alphabetical, not numerical,
> probably because it better represents the family affiliation), only
> the tasreg board is at the end of the list according to the
> alphabetical order of the board names...

Please use the equivalent of "sort -f" on the make target names.

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
"Deliver yesterday, code today, think tomorrow."
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] add ASTRO MCF5373L board

2009-12-18 Thread Wolfgang Denk
Dear Wolfgang Wegner,

In message <20091217235204.gb30...@leila.ping.de> you wrote:
> 
> > Please keep lists sorted, and don't add such scripting to the
> > Makefile. It is not needed any more.
> 
> How can I avoid this scripting? I took the freescale EVM boards as a
> reference. Could you please point me to a better example on how to
> set these variables, especially TEXT_BASE, on a per-target basis?

The new "mkconfig" script allows you to generate CONFIG_MK_* variables
from the make target names, which you then can use to adjust other
settings.

> > > + /* PAR_T0IN -> GPIO */
> > > + gpiop->par_timer &= 0xfc;
> > 
> > Please use I/O accessors to access device registers. Please fix
> > globally.
> 
> Sorry if this is a stupid question, but so this should read:
> 
> tmp_char = readb(&gpiop->par_timer);
> tmp_char &= 0xfc;
> writeb(tmp_char, &gpiop->par_timer);

Right.

> And how about word and long-word registers? As far as I understand
> from asm-m68k/io.h, the I/O accessors do byte-swap, how does this
> make sense on a big-endian-only device?

There should be non-swapping accessor functions as well.

> > Do you really need a board specific linker script?
> 
> Probably not in this case, but unfortunately this is what all
> current Coldfire boards do, and I am not familiar enough with
> ld to overlook which consequences changing this might have.

Hm...

Tsi Chung Liew, are you planning for some cleanup to use a single
common linker script for all boards without special requirements?

> (It may be trivial for MCF53xx, but for other devices like
> MCF5445x with the possibility for serial boot, there are
> big differences between the different linker files.)

There are probably just a few major "types" ?

> > > + s = flash_full_status_check_nb (flash_info, fl_sector,
> > > + 0, "erase");
> > > + if (s != ERR_BUSY) {
> > > + if (s == ERR_OK) {
> > > + flash_sect_count++;
> > > + flash_prog_stat = FL_STAT_IDLE;
> > > + }
> > > + else
> > 
> > And again. Please fix indentation globally.
> 
> Sorry to ask, but which part of indentation is wrong here?
> (Except the else/if you quoted in the other examples)

the "else" must be on the same line as the "}".

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 see that Microsoft's campaign  to  destroy  all  knowledge  of  any
operating   environment   but  its  own  environment-of-the-year  has
succeeded in creating a generation of users who don't understand  the
concept of a shell...
-- L. Peter Deutsch in 
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] ARM: Add support for edb93xx boards

2009-12-18 Thread Matthias Kaehlcke
hi,

El Tue, Dec 08, 2009 at 09:33:18PM +0100 Wolfgang Denk ha dit:

> After relocation we have a full-blown, "normal" C runtime environment.
> Before that, you can use C as well, if you mind the restrictions (like
> data and bss not being available/writable yet, no real stack, etc.).

as suggested i reimplemented the flash, pll and sdram initialization
in C, what is working so far.

now i am trying to reimplement the lowlevel_init() function in C. this
seems to be an easy task, but gcc insists to use the stack, which
isn't set up at this point

the C implementation is:

void lowlevel_init(void)
{
red_LED_on();
green_LED_on();

/* Configure flash wait states before we switch to the PLL */
flash_cfg();

/* Set up PLL */
pll_cfg();

green_LED_off();

/* Setup SDRAM */
sdram_cfg();

green_LED_on();
red_LED_off();

/* FIXME: we use async mode for now */
__asm__ __volatile__("mrc p15, 0, r0, c1, c0, 0\n"
"orr r0, r0, #0xc000\n"
"mcr p15, 0, r0, c1, c0, 0");
}

which results in the following machine/assembly code:

c1f01094 :
c1f01094:   e52de004push{lr}; (str lr,
[sp, #-4]!)
c1f01098:   e24dd004sub sp, sp, #4  ; 0x4
c1f0109c:   ebe4bl  c1f01034 
c1f010a0:   ebefbl  c1f01064 
c1f010a4:   eb00483dbl  c1f131a0 
c1f010a8:   eb004842bl  c1f131b8 
c1f010ac:   ebf2bl  c1f0107c 
c1f010b0:   eb004852bl  c1f13200 
c1f010b4:   ebeabl  c1f01064 
c1f010b8:   ebe3bl  c1f0104c 
c1f010bc:   ee110f10mrc 15, 0, r0, cr1, cr0, {0}
c1f010c0:   e3800103orr r0, r0, #-1073741824;
0xc000
c1f010c4:   ee010f10mcr 15, 0, r0, cr1, cr0, {0}
c1f010c8:   e28dd004add sp, sp, #4  ; 0x4
c1f010cc:   e8bd8000pop {pc}

is there a way to convince the compiler not to use the stack, or is it
for some reason impossible to translate this routine to C without
having a stack?

kind regards

-- 
Matthias Kaehlcke
Embedded Linux Developer
Barcelona


  The salvation of mankind lies only in making everything the concern of all
 (Alexander Solzhenitsyn)
 .''`.
using free software / Debian GNU/Linux | http://debian.org  : :'  :
`. `'`
gpg --keyserver pgp.mit.edu --recv-keys 47D8E5D4  `-
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] MIPS: qemu_mips: Fix a build failure caused by missing

2009-12-18 Thread Wolfgang Denk
Dear Himanshu Chauhan,

In message <4b2b79a9.1000...@symmetricore.com> you wrote:
> Stefan Roese wrote:
> > On Friday 18 December 2009 13:20:56 Stefan Roese wrote:
> >>> I think thats what it is. Both are same.
> >> No, not exactly. They're nearly identical. But there are differences. Not
> >>  sure if these differences are important though.
> >>
> >> Don't get me wrong. I'm not NACK'ing the patch. I'm just pointing out that
> >> it's different from the Linux version.
> > 
> > Just to make it clear. Here a diff between both versions:
> > 
> > --- u-boot/include/asm-mips/unaligned.h
> > +++ linux-2.6/linus/arch/mips/include/asm/unaligned.h
> > @@ -8,19 +8,21 @@
> >  #ifndef _ASM_MIPS_UNALIGNED_H
> >  #define _ASM_MIPS_UNALIGNED_H
> > 
> > -#include 
> > +#include 
> >  #if defined(__MIPSEB__)
> > +# include 
> > +# include 
> >  # define get_unaligned __get_unaligned_be
> >  # define put_unaligned __put_unaligned_be
> >  #elif defined(__MIPSEL__)
> > +# include 
> > +# include 
> >  # define get_unaligned __get_unaligned_le
> >  # define put_unaligned __put_unaligned_le
> >  #else
> >  #  error "MIPS, but neither __MIPSEB__, nor __MIPSEL__???"
> >  #endif
> > 
> > -# include 
> > -# include 
> >  # include 
> > 
> >  #endif /* _ASM_MIPS_UNALIGNED_H */
> > 
> 
> I think whatever Shinya sent was modified version of linux's unaligned.h 
> and its working.

Hm... has this really been tested on both big endian and on little
endian MIPS systems?

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
"Beware of bugs in the above code; I have only proved it correct, not
tried it." - Donald Knuth
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/9] smi driver support for SPEAr SoCs

2009-12-18 Thread Vipin Kumar
Dear Wolfgang,

>> Signed-off-by: Vipin 
> ...
>> +static ulong flash_get_size(ulong base, int banknum)
>> +{
>> +     flash_info_t *info = &flash_info[banknum];
>> +     unsigned int value = 0;
>> +     unsigned int density = 0;
>
> remove useless initialization.

Ok
I will send out a fresh patchset v2 with your review comments
incorporated.
Please let me know if it is ok

>> +     int i;
>> +
>> +     value = smi_read_id(info, banknum);
>> +     density = (value >> 16) & 0xff;
>> +
>> +     switch (density) {
>> +     case 0x10:
>> +             info->size = 64 * 1024;
>> +             info->sector_count = 2;
>> +             break;
>> +     case 0x11:
>> +             info->size = 128 * 1024;
>> +             info->sector_count = 4;
>> +             break;
>> +     case 0x12:
>> +             info->size = 256 * 1024;
>> +             info->sector_count = 4;
>> +             break;
>> +     case 0x13:
>> +             info->size = 512 * 1024;
>> +             info->sector_count = 8;
>> +             break;
>> +     case 0x14:
>> +             info->size = 1 * 1024 * 1024;
>> +             info->sector_count = 16;
>> +             break;
>> +     case 0x15:
>> +             info->size = 2 * 1024 * 1024;
>> +             info->sector_count = 32;
>> +             break;
>> +     case 0x16:
>> +             info->size = 4 * 1024 * 1024;
>> +             info->sector_count = 64;
>> +             break;
>> +     case 0x17:
>> +             info->size = 8 * 1024 * 1024;
>> +             info->sector_count = 128;
>> +             break;
>> +     case 0x18:
>> +             info->size = 16 * 1024 * 1024;
>> +             info->sector_count = 64;
>> +             break;
>> +     default:
>> +             return 0x0;
>> +     }
>
> Consider using lookup tables?

Currently supported flashes have consequent values of density.
It may have random values supported in future. That's the reason
I feel it's better to keep the code this way

>> +     /* Assume that all sectors are unprotected by default */
>> +     for (i = 0; i < CONFIG_SYS_MAX_FLASH_SECT; i++)
>> +             info->protect[i] = 0;
>
> Um... is this assumption correct?

It is intentional

>
>> +static int smi_wait_till_ready(int bank, int timeout)
>> +{
>> +     int count;
>> +     int sr;
>> +
>> +     /* One chip guarantees max 5 msec wait here after page writes,
>> +        but potentially three seconds (!) after page erase. */
>> +     for (count = 0; count < timeout; count++) {
>> +             sr = smi_read_sr(bank);
>> +             if (sr < 0)
>> +                     break;
>> +             else if (!(sr & WIP_BIT))
>> +                     return 0;
>
> Use braces here.

Ok. braces added

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


Re: [U-Boot] [PATCH] MIPS: qemu_mips: Fix a build failure caused by missing

2009-12-18 Thread Himanshu Chauhan
Wolfgang Denk wrote:
> Dear Himanshu Chauhan,
> 
> In message <4b2b79a9.1000...@symmetricore.com> you wrote:
>> Stefan Roese wrote:
>>> On Friday 18 December 2009 13:20:56 Stefan Roese wrote:
> I think thats what it is. Both are same.
 No, not exactly. They're nearly identical. But there are differences. Not
  sure if these differences are important though.

 Don't get me wrong. I'm not NACK'ing the patch. I'm just pointing out that
 it's different from the Linux version.
>>> Just to make it clear. Here a diff between both versions:
>>>
>>> --- u-boot/include/asm-mips/unaligned.h
>>> +++ linux-2.6/linus/arch/mips/include/asm/unaligned.h
>> I think whatever Shinya sent was modified version of linux's unaligned.h 
>> and its working.
> 
> Hm... has this really been tested on both big endian and on little
> endian MIPS systems?
> 
> Best regards,
> 
> Wolfgang Denk
> 

Dear Wolfgang,

I am using MIPS emulation on QEMU for my U-Boot. This patch works on big-endian 
emulation. I haven't
tested it on little endian emulation. My statement of "its working" was for the 
build fix. So I
won't say its ready for commit before being *actually* tested thoroughly.

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


[U-Boot] [PATCH][RESEND]: Fix for U-Boot build failure with CONFIG_SYS_NO_FLASH defined for qemu-mips.

2009-12-18 Thread Himanshu Chauhan
U-Boot hangs with qemu-system-mips with ##unknown flash error.
Disabling flash using CONFIG_SYS_NO_FLASH breaks the build.
This patch fixes the issue. Don't know if its okay.

Signed-off-by: Himanshu Chauhan 

diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c
index efd6aec..5bd3af0 100644
--- a/common/cmd_bootm.c
+++ b/common/cmd_bootm.c
@@ -76,7 +76,7 @@ extern void bz_internal_error(int);
 static int image_info (unsigned long addr);
 #endif

-#if defined(CONFIG_CMD_IMLS)
+#if !defined(CONFIG_SYS_NO_FLASH) && defined(CONFIG_CMD_IMLS)
 #include 
 extern flash_info_t flash_info[]; /* info for FLASH chips */
 static int do_imls (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
@@ -1153,7 +1153,7 @@ U_BOOT_CMD(
 /***/
 /* imls - list all images found in flash */
 /***/
-#if defined(CONFIG_CMD_IMLS)
+#if !defined(CONFIG_SYS_NO_FLASH) && defined(CONFIG_CMD_IMLS)
 int do_imls (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
flash_info_t *info;
diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c
index 24eb33f..06c7271 100644
--- a/drivers/mtd/cfi_flash.c
+++ b/drivers/mtd/cfi_flash.c
@@ -41,6 +41,7 @@
 #include 
 #include 

+#ifndef CONFIG_SYS_NO_FLASH
 /*
  * This file implements a Common Flash Interface (CFI) driver for
  * U-Boot.
@@ -2020,3 +2021,5 @@ unsigned long flash_init (void)

return (size);
 }
+
+#endif
diff --git a/include/configs/qemu-mips.h b/include/configs/qemu-mips.h
index cbacdf9..49a1a1c 100644
--- a/include/configs/qemu-mips.h
+++ b/include/configs/qemu-mips.h
:q
@@ -142,6 +142,7 @@
 #define CONFIG_SYS_INIT_SP_OFFSET  0x40

 /* We boot from this flash, selected with dip switch */
+#define CONFIG_SYS_NO_FLASH
 #define CONFIG_SYS_FLASH_BASE  0xbfc0
 #define CONFIG_SYS_MAX_FLASH_BANKS 1
 #define CONFIG_SYS_MAX_FLASH_SECT  128
@@ -149,7 +150,8 @@
 #define CONFIG_FLASH_CFI_DRIVER1
 #define CONFIG_SYS_FLASH_USE_BUFFER_WRITE  1

-#define CONFIG_ENV_IS_IN_FLASH 1
+#define CONFIG_ENV_IS_IN_FLASH 0
+#define CONFIG_ENV_IS_NOWHERE
 #define CONFIG_ENV_ADDR(CONFIG_SYS_FLASH_BASE + 
CONFIG_SYS_MONITOR_LEN)

 /* Address and size of Primary Environment Sector */
diff --git a/include/mtd/cfi_flash.h b/include/mtd/cfi_flash.h
index 2aa6911..2229ddf 100644
--- a/include/mtd/cfi_flash.h
+++ b/include/mtd/cfi_flash.h
@@ -151,7 +151,8 @@ struct cfi_pri_hdr {
u8  minor_version;
 } __attribute__((packed));

-void flash_write_cmd(flash_info_t * info, flash_sect_t sect,
-uint offset, u32 cmd);
+#ifndef CONFIG_SYS_NO_FLASH
+void flash_write_cmd(flash_info_t * info, flash_sect_t sect, uint offset, u32 
cmd);
+#endif

 #endif /* __CFI_FLASH_H__ */


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


Re: [U-Boot] [PATCH 4/9] usbd driver and usb boot firmware support for SPEAr SoCs

2009-12-18 Thread Vipin Kumar
Dear Wolfgang,

>>
>> Signed-off-by: Vipin 
>> ---
>>  common/main.c                         |    2 +
>>  drivers/serial/usbtty.h               |    2 +
>>  drivers/usb/gadget/Makefile           |    1 +
>>  drivers/usb/gadget/spr_udc.c          |  996 
>> +
>>  include/asm-arm/arch-spear/spr_misc.h |  126 +
>>  include/usb/spr_udc.h                 |  227 
>>  6 files changed, 1354 insertions(+), 0 deletions(-)
>>  mode change 100644 => 100755 drivers/serial/usbtty.h
>>  mode change 100644 => 100755 drivers/usb/gadget/Makefile
>>  create mode 100755 drivers/usb/gadget/spr_udc.c
>>  create mode 100644 include/asm-arm/arch-spear/spr_misc.h
>>  create mode 100755 include/usb/spr_udc.h
>
> Please split into two patches: one with generic usbd driver, and the
> second adding support for SPEAr.
>

Ok. Accepted.
patch-set v2 would contain the changes

>> diff --git a/common/main.c b/common/main.c
>> index 10d8904..79f3018 100644
>> --- a/common/main.c
>> +++ b/common/main.c
>> @@ -397,6 +397,7 @@ void main_loop (void)
>>
>>       debug ("### main_loop: bootcmd=\"%s\"\n", s ? s : "");
>>
>> +#if !defined(CONFIG_SPEAR_USBTTY)
>>       if (bootdelay >= 0 && s && !abortboot (bootdelay)) {
>>  # ifdef CONFIG_AUTOBOOT_KEYED
>>               int prev = disable_ctrlc(1);    /* disable Control C checking 
>> */
>> @@ -413,6 +414,7 @@ void main_loop (void)
>>               disable_ctrlc(prev);    /* restore Control C checking */
>>  # endif
>>       }
>> +# endif
>
> Why would this be needed?

We also use u-boot as a firmware which runs on the board in a special
mode in which the firmware fetches and burns images into
NOR/NAND flashes. Under this mode, we would like to always jump to
u-boot prompt.
Also, the bootdelay variable should remain unchanged as we save default
environment variables as well.

>
>
>> diff --git a/drivers/usb/gadget/spr_udc.c b/drivers/usb/gadget/spr_udc.c
>> new file mode 100755
>> index 000..5b135c7
>> --- /dev/null
>> +++ b/drivers/usb/gadget/spr_udc.c
> ...
>> +/* Some kind of debugging output... */
>> +#if 1
>> +#define UDCDBG(str)
>> +#define UDCDBGA(fmt, args...)
>> +#else
>> +#define UDCDBG(str) serial_printf(str "\n")
>> +#define UDCDBGA(fmt, args...) serial_printf(fmt "\n", ##args)
>> +#endif
>
> This looks wrong. Should that be a "#ifndef DEBUG" instead of "#if 1"?
>
> And cannot we use standard debug facilities?
>

Ok, changed to #ifndef DEBUG
The standard debug facilities use printf and we also test and use this for
usbtty feature. So, a serial_printf is required

>> +static struct udc_endp_regs *const outep_regs_p =
>> +             &((struct udc_regs *const)CONFIG_SYS_USBD_BASE)->out_regs[0];
>> +static struct udc_endp_regs *const inep_regs_p =
>> +             &((struct udc_regs *const)CONFIG_SYS_USBD_BASE)->in_regs[0];
>> +
>> +/*
>> + * udc_state_transition - Write the next packet to TxFIFO.
>> + * @initial: Initial state.
>> + * @final:   Final state.
>> + *
>> + * Helper function to implement device state changes. The device states and
>> + * the events that transition between them are:
>> + *
>> + *                           STATE_ATTACHED
>> + *                           ||      /\
>> + *                           \/      ||
>> + *   DEVICE_HUB_CONFIGURED                   DEVICE_HUB_RESET
>> + *                           ||      /\
>> + *                           \/      ||
>> + *                           STATE_POWERED
>> + *                           ||      /\
>> + *                           \/      ||
>> + *   DEVICE_RESET                            DEVICE_POWER_INTERRUPTION
>> + *                           ||      /\
>> + *                           \/      ||
>> + *                           STATE_DEFAULT
>> + *                           ||      /\
>> + *                           \/      ||
>> + *   DEVICE_ADDRESS_ASSIGNED                 DEVICE_RESET
>> + *                           ||      /\
>> + *                           \/      ||
>> + *                           STATE_ADDRESSED
>> + *                           ||      /\
>> + *                           \/      ||
>> + *   DEVICE_CONFIGURED                       DEVICE_DE_CONFIGURED
>> + *                           ||      /\
>> + *                           \/      ||
>> + *                           STATE_CONFIGURED
>> + *
>> + * udc_state_transition transitions up (in the direction from STATE_ATTACHED
>> + * to STATE_CONFIGURED) from the specified initial state to the specified 
>> final
>> + * state, passing through each intermediate state on the way. If the initial
>> + * state is at or above (i.e. nearer to STATE_CONFIGURED) the final state, 
>> then
>> + * no state transitions will take place.
>> + *
>> + * udc_state_transition also transitions down (in the direction from
>> + * STATE_CONFIGURED to STATE_ATTACHED) from the specified initial state to 
>> the
>> + * specified final state, passing through each intermediate state on the 
>> way.
>> + * If the i

Re: [U-Boot] [PATCH 6/9] SPEAr300 SoC support added

2009-12-18 Thread Vipin Kumar
Dear Wolfgang,

>>
>> Signed-off-by: Vipin 
> ...
>> diff --git a/board/spear/spear300/config.mk b/board/spear/spear300/config.mk
>> new file mode 100755
>> index 000..90a6cf9
>> --- /dev/null
>> +++ b/board/spear/spear300/config.mk
> ...
>> +PLATFORM_RELFLAGS += -DCONFIG_SPEAR_USBTTY
>> +endif
>> +
>
> Please do not add trailing empty lines. [Please check globally.]

Ok. Corrected globally

>> diff --git a/board/spear/spear300/spr300_board.c 
>> b/board/spear/spear300/spr300_board.c
>> new file mode 100755
>> index 000..97de0be
>> --- /dev/null
>> +++ b/board/spear/spear300/spr300_board.c
>
> Usually the file name is the same as the board config name.

Ok. filename corrected

>> +int board_nand_init(struct nand_chip *nand)
>> +{
>> +     struct misc_regs *const misc_regs_p =
>> +             (struct misc_regs *)CONFIG_SPEAR_MISCBASE;
>> +
>> +     if (((readl(&misc_regs_p->auto_cfg_reg) & MISC_SOCCFGMSK) ==
>> +                             MISC_SOCCFG30) ||
>> +        ((readl(&misc_regs_p->auto_cfg_reg) & MISC_SOCCFGMSK) ==
>> +                             MISC_SOCCFG31)) {
>> +
>> +             return spear_nand_init(nand);
>> +     } else {
>> +             return -1;
>
> "else" not needed. Unindent the "return -1;".

Ok.
Removed else and unindented

>> diff --git a/include/configs/spear300.h b/include/configs/spear300.h
>> new file mode 100755
>> index 000..59b1f45
>> --- /dev/null
>> +++ b/include/configs/spear300.h
> ...
>> +/*
>> + * Ethernet MAC driver configuration
>> + */
>> +/* #define CONFIG_SPEARMAC */
>> +/* #define CONFIG_ETHAUTONEG */
>> +/* #define CONFIG_ETHDEBUG */
>
> Don't add dead code.

Ok. dead code removed

>> +#define CONFIG_SYS_FIFO_BASE                 (0xE1000800)
>> +#define CONFIG_USBD_PRODUCT_NAME             "SPEAr SoC"
>> +#define CONFIG_USBD_MANUFACTURER             "ST Microelectronics"
>> +
>> +#define CONFIG_EXTRA_ENV_SETTINGS               "usbtty=cdc_acm"
>
> Vertial alignment by TABs only, please.

Ok. Used tabs for vertical alignment

>> +/* #define CONFIG_SYS_I2C_MULTI_EEPROMS */
>> +/* #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN        0x1 */
>
> Don't add dead code. Please fix globally.

Ok. Corrected globally

>> +/*
>> + * SMI driver configuration
>> + */
>> +#define CONFIG_SPEARSMI
>> +#undef  CONFIG_SYS_NO_FLASH
>
> Don't undef what is not defined anyway.

Ok. undef removed

>> +#define CONFIG_SYS_HZ                                (26000)
>
> CONFIG_SYS_HZ _must_ be defined as 1000.

Could not understand the reason why it is necessary

>> +/* #define CONFIG_ETHADDR                    00:11:22:33:44:55 */
>> +
>> +/* #define CONFIG_NETMASK                    255.255.255.0 */
>> +/* #define CONFIG_IPADDR                     192.168.1.10 */
>> +/* #define CONFIG_SERVERIP                   192.168.1.1 */
>> +/* #define CONFIG_GATEWAYIP                  192.168.1.1 */
>
> Get rid of all this stuff.

Ok. Dead code removed

>> +#define CONFIG_ENV_ADDR                              
>> (CONFIG_SYS_MONITOR_BASE + \
>> +                                             CONFIG_SYS_MONITOR_LEN)
>> +
>> +#define CONFIG_BOOTARGS                              "console=ttyS0 
>> mem=128M "  \
>
> Lines too long.

Ok. Corrected.

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


Re: [U-Boot] [PATCH 7/9] SPEAr310 SoC support added

2009-12-18 Thread Vipin Kumar
Dear Wolfgang,

>>
>> Signed-off-by: Vipin 
>> ---
>>  MAKEALL                             |    1 +
>>  Makefile                            |    3 +
>>  board/spear/spear310/Makefile       |   52 +
>>  board/spear/spear310/config.mk      |   42 
>>  board/spear/spear310/spr310_board.c |   58 ++
>>  include/configs/spear310.h          |  353 
>> +++
>
> The commit message seems wrong. You just add a new board, not a new
> SoC.

SPEAr310 is a new SoC but it has a lot in common with SPEAr300
Offcourse, since only the common IP's are supported in uboot, there
is no new driver required for SPEAr310.

>> diff --git a/board/spear/spear310/config.mk b/board/spear/spear310/config.mk
>> new file mode 100755
>> index 000..8b7aa05
>> --- /dev/null
>> +++ b/board/spear/spear310/config.mk
> ...
>> +ifeq ($(CONSOLE),USB)
>> +PLATFORM_RELFLAGS += -DCONFIG_SPEAR_USBTTY
>> +endif
>> +
>
> No trailing empty lines, please.

Ok. Trailing empty lines removed globally

>> +int board_nand_init(struct nand_chip *nand)
>> +{
>> +     struct misc_regs *const misc_regs_p =
>> +             (struct misc_regs *)CONFIG_SPEAR_MISCBASE;
>> +
>> +     if (((readl(&misc_regs_p->auto_cfg_reg) & MISC_SOCCFGMSK) ==
>> +                             MISC_SOCCFG30) ||
>> +        ((readl(&misc_regs_p->auto_cfg_reg) & MISC_SOCCFGMSK) ==
>> +                             MISC_SOCCFG31)) {
>> +
>> +             return spear_nand_init(nand);
>> +     } else {
>> +             return -1;
>> +     }
>
> No else, unindent the "return -1;".

Ok. else removed and return -1 unindented

>> +/*
>> + * Ethernet MAC driver configuration
>> + */
>> +/* #define CONFIG_SPEAR_SMII */
>> +/* #define CONFIG_SPEARMAC */
>> +/* #define CONFIG_ETHAUTONEG */
>> +/* #define CONFIG_ETHDEBUG */
>
> Don't add dead code (fix globally).

Fixed globally

>> +
>> +#define CONFIG_SYS_SERIAL1                      0xB200
>> +#define CONFIG_SYS_SERIAL2                      0xB208
>> +#define CONFIG_SYS_SERIAL3                      0xB210
>> +#define CONFIG_SYS_SERIAL4                      0xB218
>> +#define CONFIG_SYS_SERIAL5                      0xB220
>> +#define CONFIG_PL01x_PORTS                      { (void 
>> *)CONFIG_SYS_SERIAL0,  \
>> +                                             (void *)CONFIG_SYS_SERIAL1,    
>> \
>> +                                             (void *)CONFIG_SYS_SERIAL2,    
>> \
>> +                                             (void *)CONFIG_SYS_SERIAL3,    
>> \
>> +                                             (void *)CONFIG_SYS_SERIAL4,    
>> \
>> +                                             (void *)CONFIG_SYS_SERIAL5}
>
> Indentation / avertical alignment by TABs, please. [Globally.]

Changed to use tabs for indenting and vertical alignment

>> +#define CONFIG_BOOTARGS                              "console=ttyS0 
>> mem=128M "  \
> ...
>> +#define CONFIG_ENV_ADDR                              
>> (CONFIG_SYS_MONITOR_BASE + \
>
> etc.: Lines too long.

Long lines curtailed globally

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


Re: [U-Boot] [PATCH 2/9] smi driver support for SPEAr SoCs

2009-12-18 Thread Wolfgang Denk
Dear Vipin Kumar,

In message <83d1d72b0912182244yb303c6ai3b61d7b896020...@mail.gmail.com> you 
wrote:
> 
> >> + switch (density) {
> >> + case 0x10:
> >> + info->size = 64 * 1024;
> >> + info->sector_count = 2;
> >> + break;
> >> + case 0x11:
> >> + info->size = 128 * 1024;
> >> + info->sector_count = 4;
> >> + break;
> >> + case 0x12:
> >> + info->size = 256 * 1024;
> >> + info->sector_count = 4;
> >> + break;
> >> + case 0x13:
> >> + info->size = 512 * 1024;
> >> + info->sector_count = 8;
> >> + break;
> >> + case 0x14:
> >> + info->size = 1 * 1024 * 1024;
> >> + info->sector_count = 16;
> >> + break;
> >> + case 0x15:
> >> + info->size = 2 * 1024 * 1024;
> >> + info->sector_count = 32;
> >> + break;
> >> + case 0x16:
> >> + info->size = 4 * 1024 * 1024;
> >> + info->sector_count = 64;
> >> + break;
> >> + case 0x17:
> >> + info->size = 8 * 1024 * 1024;
> >> + info->sector_count = 128;
> >> + break;
> >> + case 0x18:
> >> + info->size = 16 * 1024 * 1024;
> >> + info->sector_count = 64;
> >> + break;
> >> + default:
> >> + return 0x0;
> >> + }
> >
> > Consider using lookup tables?
>
> Currently supported flashes have consequent values of density.
> It may have random values supported in future. That's the reason
> I feel it's better to keep the code this way

That's why I did not recommend to calculate this witha simple
formula, (which would be trivially possible for "size", but not so
for "sector_count"), but using a lookup table - this is independent
of the actual values.

> >> + /* Assume that all sectors are unprotected by default */
> >> + for (i = 0; i < CONFIG_SYS_MAX_FLASH_SECT; i++)
> >> + info->protect[i] = 0;
> >
> > Um... is this assumption correct?
>
> It is intentional

Why don;t you protect sectors where the U-Bootimage and environment
are stored?


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


Re: [U-Boot] [PATCH 8/9] SPEAr320 SoC support added

2009-12-18 Thread Vipin Kumar
Dear Wolfgang,

>> Signed-off-by: Vipin 
>> ---
>>  MAKEALL                             |    1 +
>>  Makefile                            |    3 +
>>  board/spear/spear320/Makefile       |   52 ++
>>  board/spear/spear320/config.mk      |   42 +
>>  board/spear/spear320/spr320_board.c |   58 ++
>>  include/configs/spear320.h          |  336 
>> +++
>>  6 files changed, 492 insertions(+), 0 deletions(-)
>>  create mode 100755 board/spear/spear320/Makefile
>>  create mode 100755 board/spear/spear320/config.mk
>>  create mode 100755 board/spear/spear320/spr320_board.c
>>  create mode 100755 include/configs/spear320.h
>
> Again: you seem to be adding just a new board, not a new SoC - please
> fix commit message.
>
> See review comments for previous patch; they all apply here, too.

Ok. Changed according to previous patch comments

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


Re: [U-Boot] [PATCH 4/9] usbd driver and usb boot firmware support for SPEAr SoCs

2009-12-18 Thread Wolfgang Denk
Dear Vipin Kumar,

In message <83d1d72b0912182302m68e7ba06q5e23a695f855...@mail.gmail.com> you 
wrote:
>
> >> --- a/common/main.c
> >> +++ b/common/main.c
> >> @@ -397,6 +397,7 @@ void main_loop (void)
> >>
> >>   debug ("### main_loop: bootcmd=\"%s\"\n", s ? s : " NED>");
> >>
> >> +#if !defined(CONFIG_SPEAR_USBTTY)
> >>   if (bootdelay >= 0 && s && !abortboot (bootdelay)) {
> >>  # ifdef CONFIG_AUTOBOOT_KEYED
> >>   int prev = disable_ctrlc(1);/* dis> able Control C 
> >> checking */
> >> @@ -413,6 +414,7 @@ void main_loop (void)
> >>   disable_ctrlc(prev);/* restore Contr> ol C checking */
> >>  # endif
> >>   }
> >> +# endif
> >
> > Why would this be needed?
>
> We also use u-boot as a firmware which runs on the board in a special
> mode in which the firmware fetches and burns images into
> NOR/NAND flashes. Under this mode, we would like to always jump to
> u-boot prompt.

This can be done by plain config settings. No need to chang ethe code.

> Also, the bootdelay variable should remain unchanged as we save default
> environment variables as well.

Think of a different way to switch modes, please. I don't accept this
change to common code.

> > Too long lines.
>
> I assume line length of 80 is acceptable. Right?

Maximum, right.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
What is mind?  No matter.  What is matter?  Never mind.
  -- Thomas Hewitt Key, 1799-1875
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 6/9] SPEAr300 SoC support added

2009-12-18 Thread Wolfgang Denk
Dear Vipin Kumar,

In message <83d1d72b0912182310i1abf805jf6e338fd01fae...@mail.gmail.com> you 
wrote:
> 
> > CONFIG_SYS_HZ _must_ be defined as 1000.
> 
> Could not understand the reason why it is necessary

Some parts of the code rely on this. It has been a bad idea to ever
make this a config variable (but that's history, and we cannot change
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
If you hear an onion ring, answer it.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 9/9] SPEAr600 build support added

2009-12-18 Thread Vipin Kumar
Dear Wolfgang,

>>
>> Signed-off-by: Vipin 
>> ---
>>  MAKEALL  |    1 +
>>  Makefile |    3 +++
>>  2 files changed, 4 insertions(+), 0 deletions(-)
>
> This patch must be merged with the one adding the actual code for this
> board.

Ok. Patch merged with the previous one where actual code for SPEAr600
is added

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


Re: [U-Boot] [PATCH 5/9] SPEAr600 SoC support added

2009-12-18 Thread Vipin Kumar
Dear Wolfgang,

> In message <1261090481.11634.5308.ca...@localhost.localdomain> you wrote:
>>
>> > > I haven't looked at the code differences between the sp3xx boards, but
>> > > you might be able to use 1 common board file/header file to support them
>> > > all.  For example, take a look at the M5475AFE_config rule in
>> > > U-Boot's ./Makefile.  Some extra code in the Makefile and some #ifdefs
>> > > in the sp3xx code might accommodate all 3 boards.
>> >
>> > Extra code in the Makefile should not be needed any more.
>>
>> To be clear, you still think its a good idea to look into combining the
>> similar boards, correct?  I haven't dealt with the MKCONFIG voodoo, so
>
> Yes, of course.
>
>> maybe I chose a poor example.  Perhaps the CPCI405 and friends is a
>> better example?
>
> Or this:
>
> 2485 P1011RDB_config \
> 2486 P1011RDB_NAND_config \
> 2487 P1011RDB_SDCARD_config \
> 2488 P1011RDB_SPIFLASH_config \
> 2489 P1020RDB_config \
> 2490 P1020RDB_NAND_config \
> 2491 P1020RDB_SDCARD_config \
> 2492 P1020RDB_SPIFLASH_config \
> 2493 P2010RDB_config \
> 2494 P2010RDB_NAND_config \
> 2495 P2010RDB_SDCARD_config \
> 2496 P2010RDB_SPIFLASH_config \
> 2497 P2020RDB_config \
> 2498 P2020RDB_NAND_config \
> 2499 P2020RDB_SDCARD_config \
> 2500 P2020RDB_SPIFLASH_config:       unconfig
> 2501         @$(MKCONFIG) -t $(@:_config=) P1_P2_RDB ppc mpc85xx p1_p2_rdb 
> freescale
>
>
> No scripting any more in the Makefile :-)

Ok. Used the above example to combine SPEAr boards

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


Re: [U-Boot] [PATCH 2/9] smi driver support for SPEAr SoCs

2009-12-18 Thread Vipin Kumar
Dear Wolfgang,

> In message <83d1d72b0912182244yb303c6ai3b61d7b896020...@mail.gmail.com> you 
> wrote:
>>
>> >> +     switch (density) {
>> >> +     case 0x10:
>> >> +             info->size = 64 * 1024;
>> >> +             info->sector_count = 2;
>> >> +             break;
>> >> +     case 0x11:
>> >> +             info->size = 128 * 1024;
>> >> +             info->sector_count = 4;
>> >> +             break;
>> >> +     case 0x12:
>> >> +             info->size = 256 * 1024;
>> >> +             info->sector_count = 4;
>> >> +             break;
>> >> +     case 0x13:
>> >> +             info->size = 512 * 1024;
>> >> +             info->sector_count = 8;
>> >> +             break;
>> >> +     case 0x14:
>> >> +             info->size = 1 * 1024 * 1024;
>> >> +             info->sector_count = 16;
>> >> +             break;
>> >> +     case 0x15:
>> >> +             info->size = 2 * 1024 * 1024;
>> >> +             info->sector_count = 32;
>> >> +             break;
>> >> +     case 0x16:
>> >> +             info->size = 4 * 1024 * 1024;
>> >> +             info->sector_count = 64;
>> >> +             break;
>> >> +     case 0x17:
>> >> +             info->size = 8 * 1024 * 1024;
>> >> +             info->sector_count = 128;
>> >> +             break;
>> >> +     case 0x18:
>> >> +             info->size = 16 * 1024 * 1024;
>> >> +             info->sector_count = 64;
>> >> +             break;
>> >> +     default:
>> >> +             return 0x0;
>> >> +     }
>> >
>> > Consider using lookup tables?
>>
>> Currently supported flashes have consequent values of density.
>> It may have random values supported in future. That's the reason
>> I feel it's better to keep the code this way
>
> That's why I did not recommend to calculate this witha simple
> formula, (which would be trivially possible for "size", but not so
> for "sector_count"), but using a lookup table - this is independent
> of the actual values.

Ok. I would implement the code using lookup tables

>> >> +     /* Assume that all sectors are unprotected by default */
>> >> +     for (i = 0; i < CONFIG_SYS_MAX_FLASH_SECT; i++)
>> >> +             info->protect[i] = 0;
>> >
>> > Um... is this assumption correct?
>>
>> It is intentional
>
> Why don;t you protect sectors where the U-Bootimage and environment
> are stored?

Since the code is being developed for a development board, erasing and
flashing the uboot is frequent. This is done only to save unprotect every
time before erasing/flashing uboot

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


Re: [U-Boot] [PATCH 6/9] SPEAr300 SoC support added

2009-12-18 Thread Vipin Kumar
Dear Wolfgang,

> In message <83d1d72b0912182310i1abf805jf6e338fd01fae...@mail.gmail.com> you 
> wrote:
>>
>> > CONFIG_SYS_HZ _must_ be defined as 1000.
>>
>> Could not understand the reason why it is necessary
>
> Some parts of the code rely on this. It has been a bad idea to ever
> make this a config variable (but that's history, and we cannot change
> it).
>

Ok. change accepted

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