Re: [U-Boot] [PATCH] mpc83xx: Size optimization of start.S

2008-12-15 Thread Jens Gehrlein
Hi Scott,

Scott Wood schrieb:
> On Mon, Dec 15, 2008 at 08:26:03AM +0100, Jens Gehrlein wrote:
>> Hi Ron,
>>
>> Ron Madrid schrieb:
>>> Currently there are in excess of 100 bytes located at the beginning of the 
>>> image
>>> built by start.S that are not being utilized.
>> Hmmm, are you sure? What if someone designs a board, where the processor
>> shall load its reset configuration from a local bus EEPROM, e.g. the
>> same NOR-Flash containing the U-Boot image (CFG_RESET_SOURCE[0:2] =
>> 000b?
>>
>> Or did I misunderstand something?
> 
> That's covered by the _HRCW_TABLE_ENTRY lines earlier in the file.

I see. I understood Ron's comment as "first 100 hex bytes".
Thanks for the hint, Scott.

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


[U-Boot] [PATCH 3/3] Move the LAW definition to fsl_law.h

2008-12-15 Thread Dave Liu
some code need the LAWAR_EN, make them sharable.

Signed-off-by: Dave Liu 
---
Jon,
The 86xx also is using the fsl_law code,
Could you ack and let Andy pick up to 85xx tree?

Thanks,
Dave

 drivers/misc/fsl_law.c|   15 ---
 include/asm-ppc/fsl_law.h |   16 
 2 files changed, 16 insertions(+), 15 deletions(-)

diff --git a/drivers/misc/fsl_law.c b/drivers/misc/fsl_law.c
index 44c9e91..6facb42 100644
--- a/drivers/misc/fsl_law.c
+++ b/drivers/misc/fsl_law.c
@@ -29,21 +29,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#define LAWAR_EN   0x8000
-/* number of LAWs in the hw implementation */
-#if defined(CONFIG_MPC8540) || defined(CONFIG_MPC8541) || \
-defined(CONFIG_MPC8560) || defined(CONFIG_MPC8555)
-#define FSL_HW_NUM_LAWS 8
-#elif defined(CONFIG_MPC8548) || defined(CONFIG_MPC8544) || \
-  defined(CONFIG_MPC8568) || \
-  defined(CONFIG_MPC8641) || defined(CONFIG_MPC8610)
-#define FSL_HW_NUM_LAWS 10
-#elif defined(CONFIG_MPC8536) || defined(CONFIG_MPC8572)
-#define FSL_HW_NUM_LAWS 12
-#else
-#error FSL_HW_NUM_LAWS not defined for this platform
-#endif
-
 void set_law(u8 idx, phys_addr_t addr, enum law_size sz, enum law_trgt_if id)
 {
volatile u32 *base = (volatile u32 *)(CONFIG_SYS_IMMR + 0xc08);
diff --git a/include/asm-ppc/fsl_law.h b/include/asm-ppc/fsl_law.h
index 5bba08d..cbcd281 100644
--- a/include/asm-ppc/fsl_law.h
+++ b/include/asm-ppc/fsl_law.h
@@ -65,6 +65,22 @@ enum law_trgt_if {
 #define LAW_TRGT_IF_PCIE_3 LAW_TRGT_IF_PCI
 #endif
 
+#define LAWAR_EN   0x8000
+
+/* number of LAWs in the hw implementation */
+#if defined(CONFIG_MPC8540) || defined(CONFIG_MPC8541) || \
+defined(CONFIG_MPC8560) || defined(CONFIG_MPC8555)
+#define FSL_HW_NUM_LAWS8
+#elif defined(CONFIG_MPC8548) || defined(CONFIG_MPC8544) || \
+  defined(CONFIG_MPC8568) || \
+  defined(CONFIG_MPC8641) || defined(CONFIG_MPC8610)
+#define FSL_HW_NUM_LAWS10
+#elif defined(CONFIG_MPC8536) || defined(CONFIG_MPC8572)
+#define FSL_HW_NUM_LAWS12
+#else
+#error FSL_HW_NUM_LAWS not defined for this platform
+#endif
+
 struct law_entry {
int index;
phys_addr_t addr;
-- 
1.5.4

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


[U-Boot] [PATCH 2/3] 85xx: Fix the wrong CSIZE mask bit

2008-12-15 Thread Dave Liu
The CSIZE is L1CFG0[56-63] in the e500 and e500mc core,
so we should mask 0xff, not 0x1ff.

Signed-off-by: Dave Liu 
---
 cpu/mpc85xx/start.S |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/cpu/mpc85xx/start.S b/cpu/mpc85xx/start.S
index 80f9677..cfa53c0 100644
--- a/cpu/mpc85xx/start.S
+++ b/cpu/mpc85xx/start.S
@@ -244,7 +244,7 @@ switch_as:
lis r3,config_sys_init_ram_a...@h
ori r3,r3,config_sys_init_ram_a...@l
mfspr   r2, L1CFG0
-   andi.   r2, r2, 0x1ff
+   andi.   r2, r2, 0xff
/* cache size * 1024 / (2 * L1 line size) */
slwir2, r2, (10 - 1 - L1_CACHE_SHIFT)
mtctr   r2
@@ -1004,7 +1004,7 @@ unlock_ram_in_cache:
lis r3,(CONFIG_SYS_INIT_RAM_ADDR & ~(CONFIG_SYS_CACHELINE_SIZE-1))@h
ori r3,r3,(CONFIG_SYS_INIT_RAM_ADDR & 
~(CONFIG_SYS_CACHELINE_SIZE-1))@l
mfspr   r4,L1CFG0
-   andi.   r4,r4,0x1ff
+   andi.   r4,r4,0xff
slwir4,r4,(10 - 1 - L1_CACHE_SHIFT)
mtctr   r4
 1: dcbir0,r3
-- 
1.5.4

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


[U-Boot] [PATCH 1/3] 85xx: Fix the boot window issue

2008-12-15 Thread Dave Liu
If one custom board is using the 8MB flash, it is set
as FLASH_BASE = 0xef00, TEXT_BASE = 0xef78.
The current start.S code will be broken at switch_as.

It is because the TLB1[15] is set as 16MB page size,
EPN = TEXT_BASE & 0xff00, RPN = 0xff00.

For the 8MB flash case, the EPN = 0xefxx,
RPN = 0xffxx. Assume the virt address of switch_as
is 0xef7ff18c, the real address of the instruction at
switch_as should be 0xff7ff18c. the 0xff7ff18c is out
of the range of the default 8MB boot LAW window
0xff80 - 0x.

So when we switch to AS1 address space at switch_as,
the core can't fetch the instruction at switch_as any
more. It will cause broken issue.

Signed-off-by: Dave Liu 
---
 cpu/mpc85xx/start.S |   16 
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/cpu/mpc85xx/start.S b/cpu/mpc85xx/start.S
index 8fa0ff7..80f9677 100644
--- a/cpu/mpc85xx/start.S
+++ b/cpu/mpc85xx/start.S
@@ -184,19 +184,19 @@ _start_e500:
mtspr   DBCR0,r0
 #endif
 
-   /* create a temp mapping in AS=1 to the boot window */
+   /* create a temp mapping in AS=1 to the 4M boot window */
lis r6,FSL_BOOKE_MAS0(1, 15, 0)@h
ori r6,r6,FSL_BOOKE_MAS0(1, 15, 0)@l
 
-   lis r7,FSL_BOOKE_MAS1(1, 1, 0, 1, BOOKE_PAGESZ_16M)@h
-   ori r7,r7,FSL_BOOKE_MAS1(1, 1, 0, 1, BOOKE_PAGESZ_16M)@l
+   lis r7,FSL_BOOKE_MAS1(1, 1, 0, 1, BOOKE_PAGESZ_4M)@h
+   ori r7,r7,FSL_BOOKE_MAS1(1, 1, 0, 1, BOOKE_PAGESZ_4M)@l
 
-   /* Align the mapping to 16MB */
-   lis r8,FSL_BOOKE_MAS2(TEXT_BASE & 0xff00, (MAS2_I|MAS2_G))@h
-   ori r8,r8,FSL_BOOKE_MAS2(TEXT_BASE & 0xff00, (MAS2_I|MAS2_G))@l
+   lis r8,FSL_BOOKE_MAS2(TEXT_BASE & 0xffc0, (MAS2_I|MAS2_G))@h
+   ori r8,r8,FSL_BOOKE_MAS2(TEXT_BASE & 0xffc0, (MAS2_I|MAS2_G))@l
 
-   lis r9,FSL_BOOKE_MAS3(0xff00, 0, (MAS3_SX|MAS3_SW|MAS3_SR))@h
-   ori r9,r9,FSL_BOOKE_MAS3(0xff00, 0, (MAS3_SX|MAS3_SW|MAS3_SR))@l
+   /* The 85xx has the default boot window 0xff80 - 0x */
+   lis r9,FSL_BOOKE_MAS3(0xffc0, 0, (MAS3_SX|MAS3_SW|MAS3_SR))@h
+   ori r9,r9,FSL_BOOKE_MAS3(0xffc0, 0, (MAS3_SX|MAS3_SW|MAS3_SR))@l
 
mtspr   MAS0,r6
mtspr   MAS1,r7
-- 
1.5.4

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


Re: [U-Boot] [PATCH v4 2/4] Introduce addr_map library

2008-12-15 Thread Becky Bruce
On Dec 15, 2008, at 6:46 PM, Wolfgang Denk wrote:

> Dear Kumar,
>
> In message <8FDAD51E-151A-43C8- 
> bfb2-101b8277e...@kernel.crashing.org> you wrote:
>>
>> On Dec 15, 2008, at 3:07 PM, Wolfgang Denk wrote:
>>
>>> Dear Kumar Gala,
>>>
>>> In message <1229210430-4522-2-git-send-email-
>>> ga...@kernel.crashing.org> you wrote:
 Add a library that helps in translating between virtual and  
 physical
 addresses.  This library can be useful as a simple means to  
 implement
 map_physmem() and virt_to_phys() for platforms that need
 functionality
 beyond the simple 1:1 mapping.

 Signed-off-by: Kumar Gala 
 ---
 * Folded in Becky's phys_size_t changes

 include/addr_map.h |   29 +
 lib_generic/Makefile   |1 +
 lib_generic/addr_map.c |   81  
 ++
 ++
 3 files changed, 111 insertions(+), 0 deletions(-)
 create mode 100644 include/addr_map.h
 create mode 100644 lib_generic/addr_map.c
>>>
>>> Applied, thanks.
>
> I'm afraid your patch causes problems on the Katmai board:
>
> Configuring for katmai board...
> In file included from 44x_spd_ddr2.c:46:
> /home/wd/git/u-boot/work/include/asm/io.h: In function 'virt_to_phys':
> /home/wd/git/u-boot/work/include/asm/io.h:303: warning: cast from  
> pointer to integer of different size

There was a patch in my series that fixed this:

[PATCH 01/11] powerpc: fix io.h build warning with CONFIG_PHYS_64BIT

That really needs to become part of Kumar's series since katmai has  
64bit enabled.

-Becky

>
> In file included from display_options.c:27:
> /home/wd/git/u-boot/work/include/asm/io.h: In function 'virt_to_phys':
> /home/wd/git/u-boot/work/include/asm/io.h:303: warning: cast from  
> pointer to integer of different size
> In file included from 4xx_pcie.c:32:
> /home/wd/git/u-boot/work/include/asm-ppc/io.h: In function  
> 'virt_to_phys':
> /home/wd/git/u-boot/work/include/asm-ppc/io.h:303: warning: cast  
> from pointer to integer of different size
> In file included from bat_rw.c:28:
> /home/wd/git/u-boot/work/include/asm/io.h: In function 'virt_to_phys':
> /home/wd/git/u-boot/work/include/asm/io.h:303: warning: cast from  
> pointer to integer of different size
> In file included from commproc.c:29:
> /home/wd/git/u-boot/work/include/asm/io.h: In function 'virt_to_phys':
> /home/wd/git/u-boot/work/include/asm/io.h:303: warning: cast from  
> pointer to integer of different size
> In file included from denali_data_eye.c:38:
> /home/wd/git/u-boot/work/include/asm/io.h: In function 'virt_to_phys':
> /home/wd/git/u-boot/work/include/asm/io.h:303: warning: cast from  
> pointer to integer of different size
> In file included from denali_spd_ddr2.c:45:
> /home/wd/git/u-boot/work/include/asm/io.h: In function 'virt_to_phys':
> /home/wd/git/u-boot/work/include/asm/io.h:303: warning: cast from  
> pointer to integer of different size
> In file included from ecc.c:44:
> /home/wd/git/u-boot/work/include/asm/io.h: In function 'virt_to_phys':
> /home/wd/git/u-boot/work/include/asm/io.h:303: warning: cast from  
> pointer to integer of different size
> In file included from i2c.c:33:
> /home/wd/git/u-boot/work/include/asm-ppc/io.h: In function  
> 'virt_to_phys':
> /home/wd/git/u-boot/work/include/asm-ppc/io.h:303: warning: cast  
> from pointer to integer of different size
> In file included from iop480_uart.c:27:
> /home/wd/git/u-boot/work/include/asm/io.h: In function 'virt_to_phys':
> /home/wd/git/u-boot/work/include/asm/io.h:303: warning: cast from  
> pointer to integer of different size
> In file included from tlb.c:30:
> /home/wd/git/u-boot/work/include/asm/io.h: In function 'virt_to_phys':
> /home/wd/git/u-boot/work/include/asm/io.h:303: warning: cast from  
> pointer to integer of different size
> In file included from 4xx_uart.c:47:
> /home/wd/git/u-boot/work/include/asm/io.h: In function 'virt_to_phys':
> /home/wd/git/u-boot/work/include/asm/io.h:303: warning: cast from  
> pointer to integer of different size
> In file included from gpio.c:26:
> /home/wd/git/u-boot/work/include/asm/io.h: In function 'virt_to_phys':
> /home/wd/git/u-boot/work/include/asm/io.h:303: warning: cast from  
> pointer to integer of different size
> In file included from miiphy.c:39:
> /home/wd/git/u-boot/work/include/asm/io.h: In function 'virt_to_phys':
> /home/wd/git/u-boot/work/include/asm/io.h:303: warning: cast from  
> pointer to integer of different size
> In file included from systemace.c:45:
> /home/wd/git/u-boot/work/include/asm/io.h: In function 'virt_to_phys':
> /home/wd/git/u-boot/work/include/asm/io.h:303: warning: cast from  
> pointer to integer of different size
> In file included from cfi_flash.c:39:
> /home/wd/git/u-boot/work/include/asm/io.h: In function 'virt_to_phys':
> /home/wd/git/u-boot/work/include/asm/io.h:303: warning: cast from  
> pointer to integer of different size
> In file included from eepro100.c:28:
> /home/wd/git

[U-Boot] sectoff in asm

2008-12-15 Thread youhello youhello
hi all:
i am a u-boot beginner, i found a line code "li r0,__got2_entr...@sectoff@l"
in almost all mpc start.s.i have tried to delete sectoff and i got same
result of uboot with "li r0,__got2_entr...@l". could you tell me what
difference between "li r0,__got2_entr...@sectoff@l" and "li
r0,__got2_entr...@l" and why the author use "li r0,__got2_entr...@sectoff@l"
but not  "li r0,__got2_entr...@l".thank very much.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v4 2/4] Introduce addr_map library

2008-12-15 Thread Wolfgang Denk
Dear Kumar,

In message <8fdad51e-151a-43c8-bfb2-101b8277e...@kernel.crashing.org> you wrote:
> 
> On Dec 15, 2008, at 3:07 PM, Wolfgang Denk wrote:
> 
> > Dear Kumar Gala,
> >
> > In message <1229210430-4522-2-git-send-email- 
> > ga...@kernel.crashing.org> you wrote:
> >> Add a library that helps in translating between virtual and physical
> >> addresses.  This library can be useful as a simple means to implement
> >> map_physmem() and virt_to_phys() for platforms that need  
> >> functionality
> >> beyond the simple 1:1 mapping.
> >>
> >> Signed-off-by: Kumar Gala 
> >> ---
> >> * Folded in Becky's phys_size_t changes
> >>
> >> include/addr_map.h |   29 +
> >> lib_generic/Makefile   |1 +
> >> lib_generic/addr_map.c |   81 ++ 
> >> ++
> >> 3 files changed, 111 insertions(+), 0 deletions(-)
> >> create mode 100644 include/addr_map.h
> >> create mode 100644 lib_generic/addr_map.c
> >
> > Applied, thanks.

I'm afraid your patch causes problems on the Katmai board:

Configuring for katmai board...
In file included from 44x_spd_ddr2.c:46:
/home/wd/git/u-boot/work/include/asm/io.h: In function 'virt_to_phys':
/home/wd/git/u-boot/work/include/asm/io.h:303: warning: cast from pointer to 
integer of different size
In file included from display_options.c:27:
/home/wd/git/u-boot/work/include/asm/io.h: In function 'virt_to_phys':
/home/wd/git/u-boot/work/include/asm/io.h:303: warning: cast from pointer to 
integer of different size
In file included from 4xx_pcie.c:32:
/home/wd/git/u-boot/work/include/asm-ppc/io.h: In function 'virt_to_phys':
/home/wd/git/u-boot/work/include/asm-ppc/io.h:303: warning: cast from pointer 
to integer of different size
In file included from bat_rw.c:28:
/home/wd/git/u-boot/work/include/asm/io.h: In function 'virt_to_phys':
/home/wd/git/u-boot/work/include/asm/io.h:303: warning: cast from pointer to 
integer of different size
In file included from commproc.c:29:
/home/wd/git/u-boot/work/include/asm/io.h: In function 'virt_to_phys':
/home/wd/git/u-boot/work/include/asm/io.h:303: warning: cast from pointer to 
integer of different size
In file included from denali_data_eye.c:38:
/home/wd/git/u-boot/work/include/asm/io.h: In function 'virt_to_phys':
/home/wd/git/u-boot/work/include/asm/io.h:303: warning: cast from pointer to 
integer of different size
In file included from denali_spd_ddr2.c:45:
/home/wd/git/u-boot/work/include/asm/io.h: In function 'virt_to_phys':
/home/wd/git/u-boot/work/include/asm/io.h:303: warning: cast from pointer to 
integer of different size
In file included from ecc.c:44:
/home/wd/git/u-boot/work/include/asm/io.h: In function 'virt_to_phys':
/home/wd/git/u-boot/work/include/asm/io.h:303: warning: cast from pointer to 
integer of different size
In file included from i2c.c:33:
/home/wd/git/u-boot/work/include/asm-ppc/io.h: In function 'virt_to_phys':
/home/wd/git/u-boot/work/include/asm-ppc/io.h:303: warning: cast from pointer 
to integer of different size
In file included from iop480_uart.c:27:
/home/wd/git/u-boot/work/include/asm/io.h: In function 'virt_to_phys':
/home/wd/git/u-boot/work/include/asm/io.h:303: warning: cast from pointer to 
integer of different size
In file included from tlb.c:30:
/home/wd/git/u-boot/work/include/asm/io.h: In function 'virt_to_phys':
/home/wd/git/u-boot/work/include/asm/io.h:303: warning: cast from pointer to 
integer of different size
In file included from 4xx_uart.c:47:
/home/wd/git/u-boot/work/include/asm/io.h: In function 'virt_to_phys':
/home/wd/git/u-boot/work/include/asm/io.h:303: warning: cast from pointer to 
integer of different size
In file included from gpio.c:26:
/home/wd/git/u-boot/work/include/asm/io.h: In function 'virt_to_phys':
/home/wd/git/u-boot/work/include/asm/io.h:303: warning: cast from pointer to 
integer of different size
In file included from miiphy.c:39:
/home/wd/git/u-boot/work/include/asm/io.h: In function 'virt_to_phys':
/home/wd/git/u-boot/work/include/asm/io.h:303: warning: cast from pointer to 
integer of different size
In file included from systemace.c:45:
/home/wd/git/u-boot/work/include/asm/io.h: In function 'virt_to_phys':
/home/wd/git/u-boot/work/include/asm/io.h:303: warning: cast from pointer to 
integer of different size
In file included from cfi_flash.c:39:
/home/wd/git/u-boot/work/include/asm/io.h: In function 'virt_to_phys':
/home/wd/git/u-boot/work/include/asm/io.h:303: warning: cast from pointer to 
integer of different size
In file included from eepro100.c:28:
/home/wd/git/u-boot/work/include/asm/io.h: In function 'virt_to_phys':
/home/wd/git/u-boot/work/include/asm/io.h:303: warning: cast from pointer to 
integer of different size
In file included from pci.c:35:
/home/wd/git/u-boot/work/include/asm/io.h: In function 'virt_to_phys':
/home/wd/git/u-boot/work/include/asm/io.h:303: warning: cast from pointer to 
integer of different size
In file included from 4xx_enet.c:84:
/home/wd/git/u-boot/work/include/asm/io.h: In fun

Re: [U-Boot] [PATCH v3] i2c: merge all i2c_reg_read() and i2c_reg_write() into inline functions

2008-12-15 Thread ksi
On Mon, 15 Dec 2008, Timur Tabi wrote:

> k...@koi8.net wrote:
>> On Mon, 15 Dec 2008, Wolfgang Denk wrote:
>>
>> Are you going to implement support for multiple I2C busses on some
> boards?
>> I'm working on something like this now so it would be nice to
> coordinate our
>> efforts somehow...
>
> Yes, my goal is to add low-level i2c functions that take an i2c bus as a
> parameter.  So instead of
>
>   i2c_set_bus_num(1);
>   i2c_read(...);
>
> you can do
>
>   i2c_read(1, ...)
>
> or something like that.  My goal is to eliminate i2c_set_bus_num() and
> everything related to it.
>
> It sounds like we're working on something very similar.  This is very
> low-priority for me, though.

That looks similar. But why do you want to remove i2c_set_bus_num()? I think
it would be less work to keep it. This way you can leave 90% or so of
existing I2C code unchanged by setting bus number to 0 at init. In your case
you will have to find each and every call to i2c_read... and change it to
the new format that includes bus number in parameters list.

My idea is to have global bus number variable in a single place and a single
i2c_set_bus_num() that can be excluded for most boards with a single bus
with #ifdef...

Then, we could use some kind of array of I2C structures each containing
pointers to appropriate i2c-{read,write,probe,init}() functions with generic
i2c functions just calling those pointers using bus number as index into
that array.

That would allow for unlimited number of different adapters for any board.
Initial code for initializing such an array would have to go into each and
every $(BOARD).c board specific file.

We could even make some default #ifdef'd structure that would've included
automagically if something like CONFIG_I2C_MULTIBUS was not defined thus
making most of the boards (actually almost all of them) work without
modifications.

Please let me know what you think...

---
**
*  k...@homeKOI8 Net  < >  The impossible we do immediately.  *
*  Las Vegas   NV, USA   < >  Miracles require 24-hour notice.   *
**
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v4 2/3] Add support for Maxim's DS4510 I2C device

2008-12-15 Thread Peter Tyser
Hi Wolfgang,
Thanks for the comments.

On Sun, 2008-12-14 at 12:38 +0100, Wolfgang Denk wrote:
> Dear Peter Tyser,
> 
> In message 
> <300544b7901dacbe6b9e3edd052629f612b92735.1228160312.git.pty...@xes-inc.com> 
> you wrote:
> > Initial support for the DS4510, a CPU supervisor with
> > integrated EEPROM, SRAM, and 4 programmable non-volatile
> > GPIO pins. The CONFIG_DS4510 define enables support
> > for the device while the CONFIG_CMD_DS4510 define
> > enables the ds4510 command. The additional
> > CONFIG_DS4510_INFO, CONFIG_DS4510_MEM, and
> > CONFIG_DS4510_RST defines add additional sub-commands
> > to the ds4510 command when defined.
> 
> General note: the code shows a serious lack of error detection and
> error handling.

OK, I'll fix it.

> > Signed-off-by: Peter Tyser 
> > ---
> >  README|4 +
> >  drivers/misc/Makefile |1 +
> >  drivers/misc/ds4510.c |  400 
> > +
> >  include/gpio/ds4510.h |   75 +
> >  4 files changed, 480 insertions(+), 0 deletions(-)
> >  create mode 100644 drivers/misc/ds4510.c
> >  create mode 100644 include/gpio/ds4510.h
> 
> The driver would probably be better placed in the drivers/hwmon/
> directory.

You commented in the original version of the patch:
"I think drivers/misc/ is probably the best place we have at the
moment, indeed."

I think drivers/misc makes the most sense, but hwmon is fine too.  Let
me know what you prefer.

> Also, I don't see a reason to create a new include/gpio/ directory
> here, especially since this is not primarily a GPIO device.

The original patch series had the pca953x.h (a purely GPIO device) and
ds4510.h in include/gpio/.  You're right that the ds4510.h doesn't
belong in include/gpio, I'll move it to include/.  I'm assuming you'd
also like the pca953x.h in this patch series to be moved from
include/gpio to include?


> > diff --git a/README b/README
> > index bca8061..cea057d 100644
> > --- a/README
> > +++ b/README
> > @@ -574,6 +574,10 @@ The following options need to be configured:
> > CONFIG_CMD_DHCP * DHCP support
> > CONFIG_CMD_DIAG * Diagnostics
> > CONFIG_CMD_DOC  * Disk-On-Chip Support
> > +   CONFIG_CMD_DS4510   * ds4510 I2C gpio commands
> > +   CONFIG_CMD_DS4510_INFO  * ds4510 I2C info command
> > +   CONFIG_CMD_DS4510_MEM   * ds4510 I2C eeprom/sram commansd
> > +   CONFIG_CMD_DS4510_RST   * ds4510 I2C rst command
> 
> Do we really need such granularity? If you have the device on your
> board and suppoort it in U-Boot, you probably always want to have
> CONFIG_CMD_DS4510_INFO and CONFIG_CMD_DS4510_RST. And
> CONFIG_CMD_DS4510_MEM seems reduindand - that should already be
> covered by the CONFIG_CMD_EEPROM setting.

I added finer granularity based on a comment you made about the pca953x
"info" command:
"Don't remove it, but maybe make it a selectable option so  those  who
like  it can include it while others that are tryting to minimize the
memory footprint don't suffer from it."

If the "info" command could be enabled/disabled I reasoned the other
functions of the chip should also be.

The original patch didn't have any command-enabling granularity.  For
our hardware setups, we only use the DS4510 as a non-volatile GPIO
device, the EEPROM, SRAM, and reset monitor functionality are not used
(I know, the part seems a bit overkill for what we use it for, but I
didn't design the hardware:).

The standard EEPROM commands could be used on the device, but I think it
would get confusing as part of the device's memory space is EEPROM only,
part SRAM only, and the other part EEPROM or SRAM depending on register
setting in the device.  Thus the eeprom command's functionality would
depend on the settings of the DS4510 device (or be limited only to the
EEPROM portion of the device), and the ds4510 command would support the
SRAM, but not EEPROM which is confusing in my opinion.

So in any case, all I really care about is the GPIO functionality of the
chip as is - I added EEPROM, reset monitor, and SRAM support to cover
all uses of the chip.  I'm fine with removing the finer granularity
command enabling/disabling, or even removing non-GPIO functionality if
you'd prefer:)  I'd vote for leaving the command enabling/disabling
implementation as is, let me know if you'd like it changed.


> > +/* Use 'maxargs' field as minimum number of args to ease error checking  */
> > +cmd_tbl_t cmd_ds4510[] = {
> 
> Please do not mis-use variables with a clearly defined meaning in such
> a way. This is not acceptable.

Alright, I'll rework this and also the pca953x.c implementation in this
patchset.

> > +#ifdef CONFIG_CMD_DS4510_MEM
> > +   "ds4510 eeprom read addr off cnt\n"
> > +   "ds4510 eeprom write addr off cnt\n"
> > +   "   - read/write 'cnt' bytes at EEPROM offset 'off'\n"
> > +   "ds4510 seeprom read addr off cnt\n"
> > +   "ds4510 seeprom write addr off cnt\n"
> > +   "   

Re: [U-Boot] [PATCH] common: Iteration limit for memory test.

2008-12-15 Thread Wolfgang Denk
Dear Dirk Eibach,

In message <1229338818-4209-1-git-send-email-eib...@gdsys.de> you wrote:
> We want to use mtest for production memory test (though I know it is
> not recommended). I implemented an iteration limit, so expect can parse
> the results.

Do you really want to use this text as part of the commit message?
Maybe not.

> The iteration limit is passed to mtest as a fourth parameter:
> [start [end [pattern [iterations
> If no fourth parameter is supplied, there is no iteration limit and the
> test will loop forever.
> 
> Signed-off-by: Dirk Eibach 
> ---
> 
>  - Modified original patch title "Added optional iteration limit for 
>alternative  memory test."
>  - Iteration limit is now implemented for both original and alternative 
>memory test.
> 
>  common/cmd_mem.c |   29 +
>  1 files changed, 25 insertions(+), 4 deletions(-)
> 
> diff --git a/common/cmd_mem.c b/common/cmd_mem.c
> index d7666c2..f87170c 100644
> --- a/common/cmd_mem.c
> +++ b/common/cmd_mem.c
> @@ -672,6 +672,8 @@ int do_mem_mtest (cmd_tbl_t *cmdtp, int flag, int argc, 
> char *argv[])
>   ulong   val;
>   ulong   readback;
>   int rcode = 0;
> + int iterations = 1;
> + int iteration_limit;
>  
>  #if defined(CONFIG_SYS_ALT_MEMTEST)
>   vu_long len;
> @@ -687,7 +689,6 @@ int do_mem_mtest (cmd_tbl_t *cmdtp, int flag, int argc, 
> char *argv[])
>   vu_long *dummy = 0; /* yes, this is address 0x0, not NULL */
>  #endif
>   int j;
> - int iterations = 1;
>  
>   static const ulong bitpattern[] = {
>   0x0001, /* single bit */
> @@ -722,6 +723,12 @@ int do_mem_mtest (cmd_tbl_t *cmdtp, int flag, int argc, 
> char *argv[])
>   pattern = 0;
>   }
>  
> + if (argc > 4) {
> + iteration_limit = (ulong)simple_strtoul(argv[4], NULL, 16);
> + } else {
> + iteration_limit = 0;
> + }

No braces for one-line commands, please.

>   printf("Iteration: %6d\r", iterations);
>   PRINTF("Iteration: %6d\n", iterations);

Seems we have some duplicated code here?

>  U_BOOT_CMD(
> - mtest,  4,  1,  do_mem_mtest,
> - "mtest  - simple RAM test\n",
> - "[start [end [pattern]]]\n"
> + mtest,5,1, do_mem_mtest,

Please use here TABs for indentation, as in the original code.


Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
If God wanted me to touch my toes, he'd have put them on my knees.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] spi/stmicro: fix debug() display of cmd

2008-12-15 Thread Wolfgang Denk
Dear Mike Frysinger,

In message <1229038748-26397-1-git-send-email-vap...@gentoo.org> you wrote:
> The stmicro_wait_ready() func tries to show the actual opcode that was sent
> to the device, but instead it displays the array pointer.  Fix it to pull
> out the opcode from the start of the array.
> 
> Signed-off-by: Mike Frysinger 
> ---
>  drivers/mtd/spi/stmicro.c |2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)

Applied, thanks.

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've got a bad feeling about this.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] env_sf: support embedded environments

2008-12-15 Thread Wolfgang Denk
Dear Mike Frysinger,

In message <1228994617-11732-1-git-send-email-vap...@gentoo.org> you wrote:
> If both CONFIG_ENV_SECT_SIZE and CONFIG_ENV_SIZE are defined, and the sect
> size is larger than the env size, then it means the env is embedded in a
> block.  So we have to save/restore the part of the sector which is not the
> environment.  Previously, saving the environment in SPI flash in this
> setup would probably brick the board as the rest of the sector tends to
> contain actual U-Boot data/code.
> 
> Signed-off-by: Mike Frysinger 
> ---
>  common/env_sf.c |   41 -
>  1 files changed, 36 insertions(+), 5 deletions(-)

Applied, thanks.

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
"There are three principal ways to lose money: wine, women,  and  en-
gineers.  While  the first two are more pleasant, the third is by far
the more certain."  -- Baron Rothschild, ca. 1800
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] smc911x_eeprom: new example app for managing newer SMC parts

2008-12-15 Thread Wolfgang Denk
Dear Mike Frysinger,

In message <1228959968-2075-1-git-send-email-vap...@gentoo.org> you wrote:
> A forward port of the last version to work with the newer smc911x driver.
> A bunch of simple functions/defines had to be split out of the smc911x
> driver to avoid ugly code duplication in the eeprom programmer.

Then please split this into two separate patches, too.

One to refactor the code, another one to add examples/smc911x_eeprom.c


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 v3] i2c: merge all i2c_reg_read() and i2c_reg_write() into inline functions

2008-12-15 Thread Timur Tabi
k...@koi8.net wrote:
> On Mon, 15 Dec 2008, Wolfgang Denk wrote:
> 
> Are you going to implement support for multiple I2C busses on some boards?
> I'm working on something like this now so it would be nice to coordinate our
> efforts somehow...

Yes, my goal is to add low-level i2c functions that take an i2c bus as a
parameter.  So instead of

i2c_set_bus_num(1);
i2c_read(...);

you can do

i2c_read(1, ...)

or something like that.  My goal is to eliminate i2c_set_bus_num() and
everything related to it.

It sounds like we're working on something very similar.  This is very
low-priority for me, though.

-- 
Timur Tabi
Linux kernel developer at Freescale
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3] i2c: merge all i2c_reg_read() and i2c_reg_write() into inline functions

2008-12-15 Thread ksi
On Mon, 15 Dec 2008, Wolfgang Denk wrote:

Are you going to implement support for multiple I2C busses on some boards?
I'm working on something like this now so it would be nice to coordinate our
efforts somehow...

There is a provision for using 2 I2C busses in fsl-i2c.c now but I'm trying
to make it more uniform to allow for different controllers on the same
board. I have the first prototype of our MPC8548E based motherboard in PCB
fab right now and I do have 3 I2C busses on it all of which are required for
U-Boot. That is 2 busses off of 2 MPC8548E I2C controllers and the third one
off of Silicon Motion SM502 MFD.

I have SM502 I2C driver written but not tested (no real hardware to test it
on yet, will be ready in something like a month) but the entire multibus
multicontroller I2C framework is not in U-Boot yet.

Are you working on something like this or just on moving i2c_reg_read() and
i2c_reg_write() functions to inlines?

> Dear Timur Tabi,
>
> In message <1228325310-19275-1-git-send-email-ti...@freescale.com> you
> wrote:
>> All implementations of the functions i2c_reg_read() and
> i2c_reg_write() are
>> identical.  We can save space and simplify the code by converting
> these
>> functions into inlines and putting them in i2c.h.
>>
>> Signed-off-by: Timur Tabi 
>> ---
>>
>> v3: add 8xx-specific code, and include PRINTDs from blackfin and pxa
>>
>> I'm posting this patch because I'm enhancing the I2C routines to
> support
>> multiple I2C busses more easily, but I need to clean up the existing
> code
>> first.
>>
>> I'm going to be on vacation when the next merge window opens, so I'm
> posting
>> this now in the hopes that it will be picked up when the window does
> open.
>
> We've been discussing this long enough when the previous window was
> open, so ...
>
>>  cpu/arm920t/at91rm9200/i2c.c  |   14 -
>>  cpu/arm926ejs/davinci/i2c.c   |   17 ---
>>  cpu/blackfin/i2c.c|   16 --
>>  cpu/mpc512x/i2c.c |   17 ---
>>  cpu/mpc5xxx/i2c.c |   16 --
>>  cpu/mpc8220/i2c.c |   16 --
>>  cpu/mpc824x/drivers/i2c/i2c.c |   14 -
>>  cpu/mpc8260/i2c.c |   16 --
>>  cpu/mpc8xx/i2c.c  |   33 -
>>  cpu/ppc4xx/i2c.c  |   20 -
>>  cpu/pxa/i2c.c |   15 --
>>  drivers/i2c/fsl_i2c.c |   16 --
>>  drivers/i2c/soft_i2c.c|   19 
>>  include/i2c.h |   62
> +++-
>>  14 files changed, 60 insertions(+), 231 deletions(-)
>
> Applied, thanks.
>
> Best regards,
>
> Wolfgang Denk
>
> -- 
> DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
> All these theories, diverse as they are, have two things  in  common:
> they explain the observed facts, and they are completeley and utterly
> wrong.   - Terry Pratchett, _The Light Fantastic_
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>

---
**
*  k...@homeKOI8 Net  < >  The impossible we do immediately.  *
*  Las Vegas   NV, USA   < >  Miracles require 24-hour notice.   *
**
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH V2 1/1] IXP425: Fixing PCI access

2008-12-15 Thread Wolfgang Denk
Dear Stefan Althoefer,

In message  you wrote:
> This patch fixes the PCI handling routines of the IXP port.
> It seems that this hasn't been touched for quite a while and
> u-boot PCI handling has changed since then (but nobody
> update IXP).
> 
> Changes (list uncomplete):
>- non_prefetched_read/write now return ERROR on
>  (master-) abort.
>- fixed pci configuration space access.
>- pci_read_config_XXX now return value 0xff even in
>  case of error (as some callers do not check the
>  return value)
>- Removed CONFIG_PCI_SCAN_SHOW, as printf is not
>  possible at the time pci_scan is called initially
>- fixed some IXP initialization of memory spaces
>- fixed address and irq assignment to PCI devices
>- fixed pci_find_device
>- some reformatting

I think most (all?) of my coding style comments for theold version of
this patch still apply and need to be addressed.

> Note: I think boards should always define IXP425_PCI_SIMPLE_MAPPING

In this case IXP425_PCI_SIMPLE_MAPPING should be eliminated.


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
That's the thing about people who think  they  hate  computers.  What
they really hate is lousy programmers.
- Larry Niven and Jerry Pournelle in "Oath of Fealty"
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] IXP425: Fixing timer code Part 1/1

2008-12-15 Thread Wolfgang Denk
Dear Stefan Althoefer,

In message <49384728.lmggwd1otzmugoap%stefan.althoe...@web.de> you wrote:
> 
> With this patch, this is nonsense. Instead you should use:
> 
> #ifdef CONFIG_USE_IRQ
> /* Interrupt driven timer wants system tick here */
> #define CONFIG_SYS_HZ  1000
> #else
> /* The code in cpu/ixp/timer.c needs timer clock tick in HZ */
> #define CONFIG_SYS_HZ  
> #endif

No, this is wrong. CONFIG_SYS_HZ should always be 1000, without
exceptions.

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
Accident: A condition in which presence of mind is good, but  absence
of body is better.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] IXP425: Fixing PCI access Part 1/1

2008-12-15 Thread Wolfgang Denk
Dear Stefan Althoefer,

In message  you wrote:
> I posted new version of patch to fix some more errors and style, so
> this is obsolete.

It would be nice if you keept the threading in place, so one can
actually see the new patch as part of the old thread.

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
"Spock, did you see the looks on their faces?"
"Yes, Captain, a sort of vacant contentment."
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] IXP425: Fixing PCI access Part 1/1

2008-12-15 Thread Wolfgang Denk
Dear Stefan Althoefer,

In message <4938471d.ipiaro7pyltl2jna%stefan.althoe...@web.de> you wrote:
> [PATCH] IXP425: Fixing PCI access
> 
> This patch fixes the PCI handling routines of the IXP port.
> It seems that this hasn't been touch for quite a while and
> u-boot PCI handling has changed since then (but nobody
> update IXP). Not even access to configuration space
> did work.
> 
> It was tested with Janz emPC-A400.

Coding style, and comments below "---", please.

> +static u32 ixp4xx_config_addr(u8 bus_num, pci_dev_t devfn, int where)
> +{
> + u32 addr;

Empty line after declarations, please.

> + if (!bus_num) {
> + /* type 0 */
> + addr = BIT(32-PCI_DEV(devfn)) | ((PCI_FUNC(devfn)) << 8) |
> + (where & ~3);

Indentation by TAB, please.

...
> + addr = ixp4xx_config_addr(PCI_BUS(dev),dev, where & ~3);
> + if( non_prefetch_read (addr, NP_CMD_CONFIGREAD, &retval) != OK ){

Space between '0' and '{', please.

> + //addr = BIT ((31 - dev)) | (where & ~3);

No C++ comments, please.

And don't add dead code.

> + if( isr & PCI_ISR_PFE ){

Write this as:

if (isr & PCI_ISR_PFE) {

> @@ -304,9 +355,7 @@ void pci_ixp_init (struct pci_controller
>   pci_write_config_word (0, PCI_CFG_COMMAND, INITIAL_PCI_CMD);
>   REG_WRITE (PCI_CSR_BASE, PCI_ISR_OFFSET, PCI_ISR_PSE
>  | PCI_ISR_PFE | PCI_ISR_PPE | PCI_ISR_AHBE);
> -#ifdef CONFIG_PCI_SCAN_SHOW
> - printf ("Device  bus  dev  func  deviceID  vendorID \n");
> -#endif
> +
>   pci_bus_scan ();

Why do you remove the message?

> + for(busno=0; busno<2; busno++){
> +   for(devno=0; devno + for(funcno=0; funcno + dev = PCI_BDF(busno,devno,funcno);
> +
> + if( pci_read_config_dword (dev, PCI_CFG_VENDOR_ID, &vendorId) 
> == ERROR ){
> + funcno=PCI_MAX_PCI_FUNCTIONS;
> + continue;
> + }

Indentation by TAB, please.

> - /*devices[nDevices].irq = 
> ixp425PciIntTranslate[dev][intPin-1]; */
> - devices[nDevices].irq = intPin;
> + //devices[nDevices].irq = 
> ixp425PciIntTranslate[devno][intPin-1];
> + devices[nDevices].irq = pciTranslateIrq(dev,intPin);
> + //devices[nDevices].irq = intPin;

No C++ comments, no dead code.

> -#ifdef CONFIG_PCI_SCAN_SHOW
> - printf ("%06d%03d %03d %04d  %08d  %08x\n", nDevices,
> - devices[nDevices].vendor_id);
> -#endif

???


and so on and on...

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
Success in marriage is not so much finding the right person as it  is
being the right person.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] IXP425: make cmd_go handle caches correctly Part 1/1

2008-12-15 Thread Wolfgang Denk
Dear Stefan Althoefer,

In message <49384710.dwdg58iab1mkoo9u%stefan.althoe...@web.de> you wrote:
> [PATCH] IXP425: make cmd_go handle caches correctly
> 
> This patch adds icache_invalidate() and dcache_flush() to
> cpu/ixp/cpu.c.
> 
> Also it adds do_go_exec() which is called from do_go().
> This private implementation performs cache handling
> before jumping into the code.
> 
> Without this cache handling, you will jump into stale
> code if you download a program several times.

Coding style: please use TABs for indentation.

> The patch is against "latest" u-boot git-repository
> 
> Please (still) be patient if style of submission or patches are
> offending.

And move such comments below th e"---" line, please.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
The first thing we do is kill all the lawyers.
(Shakespeare. II Henry VI, Act IV, scene ii)
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [patch] Improve progres bar for booting from USB stick.

2008-12-15 Thread Wolfgang Denk
Dear Remy Bohmer,

In message <49384d2b.01b2420a.53e2.7...@mx.google.com> you wrote:
> The progress bar that is displayed during booting from USB stick runs out out 
> the screen
> This change limits the 'dots' to 60 characters at most on a line.
> 
> Signed-off-by: Remy Bohmer 
> ---
>  common/usb_storage.c |7 ++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> Index: u-boot-usb.new/common/usb_storage.c
> ===
> --- u-boot-usb.new.orig/common/usb_storage.c  2008-12-04 21:59:18.0 
> +0100
> +++ u-boot-usb.new/common/usb_storage.c   2008-12-04 22:00:59.0 
> +0100
> @@ -175,10 +175,15 @@ block_dev_desc_t *usb_stor_get_dev(int i
>   return (index < USB_MAX_STOR_DEV) ? &usb_dev_desc[index] : NULL;
>  }
>  
> -
>  void usb_show_progress(void)
>  {
> + static int cnt;
> +
>   printf(".");
> + if (cnt++ == 60) {
> + cnt = 0;
> + printf("\n");
> + }
>  }

We should use putc() here, in both calls.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
It may be that your whole purpose in life is simply  to  serve  as  a
warning to others.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [patch] Print image address the bootm command assumed when it complains about wrong image format.

2008-12-15 Thread Wolfgang Denk
Dear Remy Bohmer,

In message <49384d33.130c420a.602f.8...@mx.google.com> you wrote:
> If the error "Wrong Image Format for bootm command" is displayed, it helps 
> debugging
> if the address is printed where it assumed the image to be.
> 
> Signed-off-by: Remy Bohmer 
> ---
>  common/cmd_bootm.c |6 --
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> Index: u-boot-usb.new/common/cmd_bootm.c
> ===
> --- u-boot-usb.new.orig/common/cmd_bootm.c2008-12-04 21:59:18.0 
> +0100
> +++ u-boot-usb.new/common/cmd_bootm.c 2008-12-04 22:04:06.0 +0100
> @@ -347,7 +347,8 @@ static int bootm_load_os(image_info_t os
>   puts("OK\n");
>   break;
>   case IH_COMP_GZIP:
> - printf ("   Uncompressing %s ... ", type_name);
> + printf("   Uncompressing %s ... from:0x%x(0x%x) to 0x%lx",

Please do not change coding style within a file. All the rest of this
file uses a space between the function name and the (, so please keep
that.

Also, the "..." are intended to mean "this is running now, please
wait", and thus should be at the end of the line.

> + type_name, (unsigned int)image_start, unc_len, load);

You mention that this is a debug help, so you probably want to make
it depend of DEBUG ?

>   default:
> - printf ("Wrong Image Format for %s command\n", cmdtp->name);
> + printf("Wrong Image Format at addr:0x%08lx for %s command\n",
> + img_addr, cmdtp->name);

See above about coding style.

I don't really understand why this is needed. You know where your
images are, don't you?

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 people are good only because they fear punishment, and  hope  for
reward, then we are a sorry lot indeed."- Albert Einstein
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [patch] make hello world example work for at91sam9261ek and make readme clearer about this

2008-12-15 Thread Wolfgang Denk
Dear "Remy Bohmer",

In message <3efb10970812050041y199ae0a4la4f4c3589a07...@mail.gmail.com> you 
wrote:
> 
> This was just a minor patch I had on the stack for months and
> yesterday I just put them all out.
> The most important part of this patch was the comment about the
> load-addr in the readme file.
> Frequently questions misunderstandings about the examples appear on
> the ML, and the readme change would help there.

We should take greater care than to really make this right - you
probably want to copy & paste from the FAQ.

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
Everyting looks interesting until you do it. Then you find it's  just
another job. - Terry Pratchett, _Moving Pictures_
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [patch] make hello world example work for at91sam9261ek and make readme clearer about this

2008-12-15 Thread Wolfgang Denk
Dear Remy Bohmer,

In message <49384d2e.2805420a.5c7b.8...@mx.google.com> you wrote:
>
>  'examples/hello_world.c' contains a small "Hello World" Demo
>  application; it is automatically compiled when you build U-Boot.
> -It's configured to run at address 0x00040004, so you can play with it
> +The address it will run on is determined by the LOAD_ADDR for
> +your board in examples/Makefile.
> +If it's configured to run at address 0x00040004, you can play with it
>  like that:

Um... the new text is as misleading as the  old  one  was.  LOAD_ADDR
obviously  plays  a role for the entry point address, abut it's not a
1:1 relation. Probablky nobody would set LOAD_ADDR to 0x00040004 ...

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
The universe, they said, depended for its operation on the balance of
four forces which they identified as charm,  persuasion,  uncertainty
and bloody-mindedness.  -- Terry Pratchett, "The Light Fantastic"
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] IDE: Improving speed on reading data Part 1/1

2008-12-15 Thread Wolfgang Denk
Dear Stefan Althoefer,

In message <49384704.sPrSOzo/cyqyo4zk%stefan.althoe...@web.de> you wrote:
> [PATCH] IDE: Improving speed on reading data
> 
> This patch improves the speed when reading blocks from
> IDE devices by reading more than one block at a time. Up to
> 128 blocks are requested in one read command.
> 
> On my testplatform (Janz emPC-A400 with CompactFLASH card)
> this nearly doubled speed.
> 
> Also the ide_wait() code was rewritten to have lower latency
> by polling more frequently for status.

Can you please use git-format-patch to format the patch? I don't know
how you created the diff, but it looks strange to me (and harldy
readable).

> The patch is against "latest" u-boot git-repository
> 
> Please (still) be patient if style of submission or patches are
> offending.

Such comments must go below the "---" line

> Signed-off-by: Stefan Althoefer 
> 

Thsi is the place to add comments that are not supposed to become part
of the commit message.

> - ide_outb (device, ATA_SECT_CNT, 1);
> + scnt = (blkcnt > 128) ? 128 : blkcnt;
> + ide_outb (device, ATA_SECT_CNT, scnt);

What happens if you try to read at or beyond the end of the device?

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
Brain off-line, please wait.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Warning in ffs2_1pass.c

2008-12-15 Thread Scott Wood
On Sat, Dec 13, 2008 at 06:30:21PM +0100, Dirk Behme wrote:
> Just fyi: Using git head (89d56f5503eed351efe5ab0b4dd0f1e888fd2336: 
> Merge branch 'master' of git://git.denx.de/u-boot-ppc4xx) I get warning:
> 
> -- cut --
> ffs2_1pass.c:1411:1: warning: "min_t" redefined
> In file include/nand.h:30,
>   from jffs2_1pass.c:151:
> include/linux/mtd/compat.h:34:1: warning: this is the location of the 
> previous definition
> -- cut --

That's fixed by this patch:
http://lists.denx.de/pipermail/u-boot/2008-December/044620.html

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


Re: [U-Boot] [PATCH] ARM: Allow cross endian linux boot Part 1/1

2008-12-15 Thread Wolfgang Denk
Dear Stefan Althoefer,

In message <493846df.zrcph0cfyvcoo+pi%stefan.althoe...@web.de> you wrote:
> [PATCH] ARM: Allow cross endian linux boot
> 
> This patch adds the capability to boot a little endian linux
> kernel on a big endian u-boot. This is usefull on IXP425 platform
> which is always big-endian in u-boot.
> 
> To enable crossboot, define the environment variable "crossboot". This was
> done as I found no way to pass the crossboot flag into 
> do_bootm_linux() through the command line.

Such a feature must be made configurable, so that it not blows up the
memory footprint on systems that will never need it.

In the long term, you might consider using FIT images, and encoding
the needed logic there.

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
"In matrimony, to hesitate is sometimes to be saved."- Butler
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] common: nvedit to protect additional ethernet addresses Part 1/1

2008-12-15 Thread Wolfgang Denk
Dear =?iso-8859-15?Q?Stefan_Alth=F6fer?=,

In message <531234...@web.de> you wrote:
> Then maybe we should have
> 
> #define CONFIG_ENV_PROTECTED_ITEM "ethaddr1,ethaddr2,"
> 
> in board configuration to have the greatest flexibility?

Jerry Van Baren already showed you an elegant way to solve this using
scanf().

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
Administration: An ingenious abstraction  in  politics,  designed  to
receive the kicks and cuffs due to the premier or president.
- Ambrose Bierce
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] common: nvedit to protect additional ethernet addresses Part 1/1

2008-12-15 Thread Wolfgang Denk
Dear Stefan Althoefer,

In message  you wrote:
>
> > That would be one way to avoid unnecessary tests.
> > 
> > Probably not the most elegant approach, agreed.
> > 
> > There are other options, though.
> 
> But your suggested optimizations will only be effective if someone tries to
> write to "serial#". This is not normally done (attempt can be considered
> an error).

Can it? What make you think so?

There are lots of boards that come fresh out  of  production  with  a
virgin  environment,  where  setting  "serial#" is a perfectly normal
thing, and not an error at all.

> If access to any nonprotected environment variables is requested (and speed
> does matter here) then any of the protected cases must be tested.

Yes, but you can do this in many different ways - more and less
efficient ones.

> Even you code:
> 
> 
> if( "serial#" )
>...
> else if( "ethaddr" )
>...
> else if( "eth[0-9]+addr" )
>...
> -
> 
> then all the ifs are triggered if you write to "videomode".

Yes, we probably can agree that this is one  of  the  less  efficient
implementations  [I  take  it  as  pseudo code, because otherwise all
cases would execute the "if" branch.]


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 all you have is a hammer, everything looks like a nail.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] MTD:NAND Enable nand lock, unlock feature

2008-12-15 Thread Scott Wood
On Sat, Dec 13, 2008 at 09:43:06AM -0600, Nishanth Menon wrote:
> Enable nand lock, unlock and status of lock feature.
> Not every device and platform requires this, hence,
> it is under define for CONFIG_CMD_NAND_LOCK_UNLOCK
> 
> Nand unlock and status operate on block boundary instead
> of page boundary. Details in:
> http://www.micron.com/products/partdetail?part=MT29C2G24MAKLAJG-6%20IT
> 
> Intial solution provided by Vikram Pandita 
> Includes preliminary suggestions from Scott Wood
> 
> Signed-off-by: Nishanth Menon 

Applied to u-boot-nand-flash/next, thanks!

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


Re: [U-Boot] [PATCH v3] i2c: merge all i2c_reg_read() and i2c_reg_write() into inline functions

2008-12-15 Thread Wolfgang Denk
Dear Timur Tabi,

In message <1228325310-19275-1-git-send-email-ti...@freescale.com> you wrote:
> All implementations of the functions i2c_reg_read() and i2c_reg_write() are
> identical.  We can save space and simplify the code by converting these
> functions into inlines and putting them in i2c.h.
> 
> Signed-off-by: Timur Tabi 
> ---
> 
> v3: add 8xx-specific code, and include PRINTDs from blackfin and pxa
> 
> I'm posting this patch because I'm enhancing the I2C routines to support
> multiple I2C busses more easily, but I need to clean up the existing code
> first.
> 
> I'm going to be on vacation when the next merge window opens, so I'm posting
> this now in the hopes that it will be picked up when the window does open.

We've been discussing this long enough when the previous window was
open, so ...

>  cpu/arm920t/at91rm9200/i2c.c  |   14 -
>  cpu/arm926ejs/davinci/i2c.c   |   17 ---
>  cpu/blackfin/i2c.c|   16 --
>  cpu/mpc512x/i2c.c |   17 ---
>  cpu/mpc5xxx/i2c.c |   16 --
>  cpu/mpc8220/i2c.c |   16 --
>  cpu/mpc824x/drivers/i2c/i2c.c |   14 -
>  cpu/mpc8260/i2c.c |   16 --
>  cpu/mpc8xx/i2c.c  |   33 -
>  cpu/ppc4xx/i2c.c  |   20 -
>  cpu/pxa/i2c.c |   15 --
>  drivers/i2c/fsl_i2c.c |   16 --
>  drivers/i2c/soft_i2c.c|   19 
>  include/i2c.h |   62 +++-
>  14 files changed, 60 insertions(+), 231 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
All these theories, diverse as they are, have two things  in  common:
they explain the observed facts, and they are completeley and utterly
wrong.   - Terry Pratchett, _The Light Fantastic_
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] NAND CMD: Add bad block skipping for nboot

2008-12-15 Thread Scott Wood
On Thu, Dec 11, 2008 at 01:32:40PM -0500, david.kond...@onqlegrand.com wrote:
> 
> This patch adds bad block skipping for nboot command by using
> nand_read_skip_bad function.

Patch is whitespace-mangled.

> 
> The initial read size had to be increased because there seems to be an
> issue with nand_read_skip_bad and read sizes less than erasesize when
> the first block needs to be skipped.

We should fix that.

> Diff based off of latest git as of 8:30 AM EST.

Which git?  New NAND features should be based off of the "next" branch of
u-boot-nand-flash.git.

> +
> + /* When using nand_read_skip_bad the process fails
> +   with the original size of writesize when a bad block
> +needs to be skipped.
> +
> +This points to a bug in nand_read_skip_bad, but since
> +this is supposed to be a simple fix let's just bump up
> +the size so that the read doesn't fail with bad blocks.
> + */

Typical u-boot multiline comment style is:

/*
 * foo
 * bar
 */

> - /* FIXME: skip bad blocks */
> - r = nand_read(nand, offset, &cnt, (u_char *) addr);
> + /* FIXED: Use same read function as nand read command */
> + r = nand_read_skip_bad(nand, offset, &cnt, (u_char *) addr);

Just remove the FIXME comment.

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


Re: [U-Boot] [PATCH v2 1/4] Flex-OneNAND driver

2008-12-15 Thread Scott Wood
On Thu, Dec 11, 2008 at 07:57:18PM +0530, Rohit Hagargundgi wrote:
> This patch adds support for MLC OneNAND and Flex-OneNAND devices.

Patch does not apply to u-boot-nand-flash/next (the master branch is for
2008.12 bugfixes only).

It's looking a lot better (though I'm not familiar enough with this
hardware to comment on the functional bits), though while you're
rebasing, I have some style nits:

> + unsigned boundary, blk, die = 0;

"unsigned int"

> +inline int flexonenand_region(struct mtd_info *mtd, loff_t addr)

Compiler should be able to figure out inlines by itself.

> +{
> + int i;
> +
> + for (i = 0; i < mtd->numeraseregions &&
> + addr >= mtd->eraseregions[i].offset; i++)
> + ;

Align the continuation line with "i = 0", making it distinct from the
if-body.

Move the addr >= mtd->eraseregions[i].offset test into the if-body, for
readability.

> + i--;
> + return i;
> +}

Just return i - 1.

> + ret = ret ? onenand_recover_lsb(mtd, from, ret) : ret;

if (ret)
ret = onenand_recover_lsb(mtd, from, ret);

The ?: usually decreases readability rather than increases it; it's best
to avoid unless using it would eliminate duplication or a temporary
variable.

>   /* Block lock scheme */
> - for (block = start; block < end; block++) {
> + for (block = start; block < end + 1; block++) {

block <= end

> + locked = bdry >> FLEXONENAND_PI_UNLOCK_SHIFT;
> + locked = (locked == 0x3) ? 0 : 1;

if ((bdry >> FLEXONENAND_PI_UNLOCK_SHIFT) == 3)
locked = 0;
else
locked = 1;

> + eraseshift = this->erase_shift - 1;
> +
> +
> + mtd->numeraseregions = this->dies << 1;

Only one blank line.

> + mtd->erasesize = 1 << (this->erase_shift);

Unnecessary parens.

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


Re: [U-Boot] [PATCH] usb_kbd: fix usb_kbd_deregister when DEVICE_DEREGISTER not enable

2008-12-15 Thread Remy Bohmer
Hello,

2008/12/14 Jean-Christophe PLAGNIOL-VILLARD :
> On 21:58 Tue 02 Dec , Jean-Christophe PLAGNIOL-VILLARD wrote:
>> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD 
>> ---
>>  common/usb_kbd.c  |4 
>>  include/devices.h |2 ++
>>  2 files changed, 6 insertions(+), 0 deletions(-)
> ping

pong...
Applied to u-boot-usb.

Thanks.

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


Re: [U-Boot] [PATCH v1] lib_ppc: rework the flush_cache

2008-12-15 Thread Wolfgang Denk
Dear Dave Liu,

In message <1228462574-20076-1-git-send-email-dave...@freescale.com> you wrote:
> - It is possible to miss flush/invalidate the last
>   cache line, we fix it at here.
> - add the volatile and memory clobber.
> 
> They are pointed by Scott Wood.
> 
> Signed-off-by: Dave Liu 
> ---
>  lib_ppc/cache.c |   36 +---
>  1 files changed, 17 insertions(+), 19 deletions(-)

Applied, thanks.

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 I can have honesty, it's easier to overlook mistakes.
-- Kirk, "Space Seed", stardate 3141.9
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v4 2/4] Introduce addr_map library

2008-12-15 Thread Kumar Gala

On Dec 15, 2008, at 3:07 PM, Wolfgang Denk wrote:

> Dear Kumar Gala,
>
> In message <1229210430-4522-2-git-send-email- 
> ga...@kernel.crashing.org> you wrote:
>> Add a library that helps in translating between virtual and physical
>> addresses.  This library can be useful as a simple means to implement
>> map_physmem() and virt_to_phys() for platforms that need  
>> functionality
>> beyond the simple 1:1 mapping.
>>
>> Signed-off-by: Kumar Gala 
>> ---
>> * Folded in Becky's phys_size_t changes
>>
>> include/addr_map.h |   29 +
>> lib_generic/Makefile   |1 +
>> lib_generic/addr_map.c |   81 ++ 
>> ++
>> 3 files changed, 111 insertions(+), 0 deletions(-)
>> create mode 100644 include/addr_map.h
>> create mode 100644 lib_generic/addr_map.c
>
> Applied, thanks.
>
> As discussed, I'll be leaving patches 3/4 and 4/4 of this series for
> Andy to pick them up.

just to be clear are you thinking for this upcoming release or the one  
following it?

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


Re: [U-Boot] [PATCH v4 2/4] Introduce addr_map library

2008-12-15 Thread Wolfgang Denk
Dear Kumar Gala,

In message <1229210430-4522-2-git-send-email-ga...@kernel.crashing.org> you 
wrote:
> Add a library that helps in translating between virtual and physical
> addresses.  This library can be useful as a simple means to implement
> map_physmem() and virt_to_phys() for platforms that need functionality
> beyond the simple 1:1 mapping.
> 
> Signed-off-by: Kumar Gala 
> ---
> * Folded in Becky's phys_size_t changes
> 
>  include/addr_map.h |   29 +
>  lib_generic/Makefile   |1 +
>  lib_generic/addr_map.c |   81 
> 
>  3 files changed, 111 insertions(+), 0 deletions(-)
>  create mode 100644 include/addr_map.h
>  create mode 100644 lib_generic/addr_map.c

Applied, thanks.

As discussed, I'll be leaving patches 3/4 and 4/4 of this series for
Andy to pick them up.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
The joys of love made her human and the  agonies  of  love  destroyed
her.
-- Spock, "Requiem for Methuselah", stardate 5842.8
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v4 1/4] Introduce virt_to_phys()

2008-12-15 Thread Wolfgang Denk
Dear Kumar Gala,

In message <1229210430-4522-1-git-send-email-ga...@kernel.crashing.org> you 
wrote:
> virt_to_phys() returns the physical address given a virtual.  In most cases
> this will just the input value as the vast majority of systems run in a 1:1
> mode.
> 
> However in systems that are not running this way it should report the
> physical address or ~0 if no mapping exists for the given virtual address.
> 
> Signed-off-by: Kumar Gala 
> ---
> 
> * No change, just reposting as part of the sequence
> 
> - k
> 
>  include/asm-arm/io.h|5 +
>  include/asm-avr32/io.h  |5 +
>  include/asm-blackfin/io.h   |5 +
>  include/asm-i386/io.h   |5 +
>  include/asm-m68k/io.h   |5 +
>  include/asm-microblaze/io.h |5 +
>  include/asm-mips/io.h   |2 +-
>  include/asm-nios/io.h   |5 +
>  include/asm-nios2/io.h  |5 +
>  include/asm-ppc/io.h|5 +
>  include/asm-sh/io.h |5 +
>  include/asm-sparc/io.h  |5 +
>  12 files changed, 56 insertions(+), 1 deletions(-)

Applied, thanks.

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
When you say "I wrote a program that crashed  Windows",  people  just
stare  at you blankly and say "Hey, I got those with the system, *for
free*".- Linus Torvalds in <3itc77$...@ninurta.fer.uni-lj.si>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] POST Make: fix the sub-dir dependencies missing.

2008-12-15 Thread Wolfgang Denk
Dear Yuri,

In message <1228684370-5292-1-git-send-email...@denx.de> you wrote:
> From: Yuri Tikhonov 
> 
> Signed-off-by: Yuri Tikhonov 
> ---
>  post/Makefile |7 ++-
>  1 files changed, 6 insertions(+), 1 deletions(-)

Applied, thanks.

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
Always leave room to add an explanation if it doesn't work out.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [U-Boot-Users] TFTP server support in U-boot

2008-12-15 Thread Ben Warren
Hello Santosh,

santosh pattar wrote:
> Dear All,
>
> As of now in the U-boot only TFTP client is supported. I am planning
> to have TFTP server support in the u-boot. Can you please help me in
> this regarding?
>
> Please provide me few links if this has been done already, or links
> from where i can take some information and start working on it.
>
>   
I believe this has come up before, so search the mail archives.  I don't 
remember anybody posting a patch, though.  In general, U-boot doesn't 
'serve', so you have quite a bit of work to do.  Luckily, TFTP is one of 
the more trivial protocols, hence the name.

I'm curious why you want to do this.  People generally use U-boot as 
transient software for loading operating systems that are much more 
suitable for serving images.  Do you have a situation where you have 
several identical devices and want to reduce the upstream network load?  
In that case, you may want to look into the multicast TFTP instead.

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


Re: [U-Boot] [PATCH 06/15 v6] OMAP3: Add NAND support

2008-12-15 Thread Scott Wood
Dirk Behme wrote:
> Add NAND support.
> 
> Signed-off-by: Nishanth Menon 
> Signed-off-by: Syed Mohammed Khasim 
> Signed-off-by: Dirk Behme 
> 
> ---

ACK

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


Re: [U-Boot] [PATCH] mpc83xx: Size optimization of start.S

2008-12-15 Thread Scott Wood
On Mon, Dec 15, 2008 at 08:26:03AM +0100, Jens Gehrlein wrote:
> Hi Ron,
> 
> Ron Madrid schrieb:
> > Currently there are in excess of 100 bytes located at the beginning of the 
> > image
> > built by start.S that are not being utilized.
> 
> Hmmm, are you sure? What if someone designs a board, where the processor
> shall load its reset configuration from a local bus EEPROM, e.g. the
> same NOR-Flash containing the U-Boot image (CFG_RESET_SOURCE[0:2] =
> 000b?
> 
> Or did I misunderstand something?

That's covered by the _HRCW_TABLE_ENTRY lines earlier in the file.

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


Re: [U-Boot] [PATCH] MIPS: Add VCT board series support (Part 1/3)

2008-12-15 Thread Andrew Dyer
On Mon, Dec 15, 2008 at 8:51 AM, Stefan Roese  wrote:
> This patch adds support for the Micronas VCT board series.
> Currently the following platforms are supported:
>
>  vct_premium
>  vct_premium_small
>  vct_premium_onenand
>  vct_premium_onenand_small
>  vct_platinum
>  vct_platinum_small
>  vct_platinum_onenand
>  vct_platinum_onenand_small
>  vct_platinumavc
>  vct_platinumavc_small
>  vct_platinumavc_onenand
>  vct_platinumavc_onenand_small
>
> One speciality of the VCT board is that it can't access NOR FLASH
> memory-mapped. It has to use special access functions for this.
>
> Signed-off-by: Stefan Roese 
> ---

... stuff deleted...

> diff --git a/board/micronas/vct/u-boot.lds b/board/micronas/vct/u-boot.lds
> new file mode 100644
> index 000..1e1c559
> --- /dev/null
> +++ b/board/micronas/vct/u-boot.lds
> @@ -0,0 +1,70 @@
> +/*
> + * (C) Copyright 2003
> + * Wolfgang Denk Engineering, 
> + *
> + * 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
> + */
> +
> +/*
> +OUTPUT_FORMAT("elf32-bigmips", "elf32-bigmips", "elf32-bigmips")
> +*/
> +OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips", "elf32-tradbigmips")

I believe that this should be:

OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips", "elf32-tradlittlemips")

as the parameters are for default, big, little endian compilation.

> +OUTPUT_ARCH(mips)
> +ENTRY(_start)
> +SECTIONS
> +{
> +   . = 0x;
> +
> +   . = ALIGN(4);
> +   .text   :
> +   {
> + *(.text)
> +   }
> +
> +   . = ALIGN(4);
> +   .rodata  : { *(.rodata) }
> +
> +   . = ALIGN(4);
> +   .data  : { *(.data) }
> +
> +   . = .;
> +   _gp = ALIGN(16) + 0x7ff0;
> +
> +   .got : {
> + __got_start = .;
> + *(.got)
> + __got_end = .;
> +   }
> +

I would force alignment here for sdata

> +   .sdata  : { *(.sdata) }
> +

and here

> +   .u_boot_cmd : {
> + __u_boot_cmd_start = .;
> + *(.u_boot_cmd)
> + __u_boot_cmd_end = .;
> +   }
> +

uboot_end_data is assumed to be word aligned in cpu/mips/start.S,
enforce the alignment here

> +   uboot_end_data = .;
> +   num_got_entries = (__got_end - __got_start) >> 2;
> +
> +   . = ALIGN(4);
> +   .sbss (NOLOAD)  : { *(.sbss) }

I believe .bss is also expected to be word aligned

> +   .bss (NOLOAD)  : { *(.bss) }
> +   uboot_end = .;
> +}
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] U-Boot hangs after uncompressing image

2008-12-15 Thread Marco Antônio Possamai
Hello, all!

As the title says, it hangs when uncompressing the image. The board is
the MPC5200b Lite.

Got the device-tree blob after compiling it from the lite5200b.dts. Used
the latest device-tree compiler (v1.2.0);

Got the file cuImage.lite5200b to pass it as image.

Stored 0x0001 in fdt_addr_r. Stored the path to the dtb file in
fdt_file and the image file in the bootfile.

Image's at 0x0100.

Some commands I've used:

$ tftp ${fdt_addr_r} ${fdt_file}

$ fdt addr ${fdt_addr_r}

$ tftp 0x0100 ${bootfile}

$ bootm 0x0100 - ${fdt_addr_r}


Here's what the GtkTerm spills:

## Booting kernel from Legacy Image at 0100 ...
Image Name:   Linux-2.6.26.8-dirty
Created:  2008-12-10  18:40:18 UTC
Image Type:   PowerPC Linux Kernel Image (gzip compressed)
Data Size:1741950 Bytes =  1.7 MB
Load Address: 0040
Entry Point:  00400550
Verifying Checksum ... OK
## Flattened Device Tree blob at 0001
Booting using the fdt blob at 0x1
Uncompressing Kernel Image ... OK

Then it hangs...

I've read the FAQ section about it and it simply says it could be a bad
device-tree. I'm not sure how to check it.

I'm using the latest U-Boot and the 2.6.26.8-dirty (as shown above), by
the way.


Thanks for your patience.


My PC specs:

Ubuntu 8.04 (Hardy Heron)

Kernel Linux 2.6.24-22-generic

GNOME 2.22.3

Marco Antônio Possamai

Universidade Federal de Santa Catarina

-- 
Be Yourself @ mail.com!
Choose From 200+ Email Addresses
Get a Free Account at www.mail.com

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


[U-Boot] [PATCH] at91: add at91sam9xeek board support (typo)

2008-12-15 Thread Nicolas Ferre
Typo: CFG_ convert to CONFIG_SYS_

Signed-off-by: Nicolas Ferre 
---
 Makefile |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index 7be1de2..74dfcca 100644
--- a/Makefile
+++ b/Makefile
@@ -2605,13 +2605,13 @@ at91sam9xeek_dataflash_cs1_config \
 at91sam9xeek_config:   unconfig
@mkdir -p $(obj)include
@if [ "$(findstring _nandflash,$@)" ] ; then \
-   echo "#define CFG_USE_NANDFLASH 1"  
>>$(obj)include/config.h ; \
+   echo "#define CONFIG_SYS_USE_NANDFLASH 1"   
>>$(obj)include/config.h ; \
$(XECHO) "... with environment variable in NAND FLASH" ; \
elif [ "$(findstring dataflash_cs0,$@)" ] ; then \
-   echo "#define CFG_USE_DATAFLASH_CS0 1"  
>>$(obj)include/config.h ; \
+   echo "#define CONFIG_SYS_USE_DATAFLASH_CS0 1"   
>>$(obj)include/config.h ; \
$(XECHO) "... with environment variable in SPI DATAFLASH CS0" ; 
\
else \
-   echo "#define CFG_USE_DATAFLASH_CS1 1"  
>>$(obj)include/config.h ; \
+   echo "#define CONFIG_SYS_USE_DATAFLASH_CS1 1"   
>>$(obj)include/config.h ; \
$(XECHO) "... with environment variable in SPI DATAFLASH CS1" ; 
\
fi;
@$(MKCONFIG) -n at91sam9xeek -a at91sam9260ek arm arm926ejs 
at91sam9260ek atmel at91sam9
-- 
1.5.3.7



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


[U-Boot] [PATCH] MIPS: Add VCT board series support (Part 3/3)

2008-12-15 Thread Stefan Roese
This patch adds support for the Micronas VCT board series.
Currently the following platforms are supported:

  vct_premium
  vct_premium_small
  vct_premium_onenand
  vct_premium_onenand_small
  vct_platinum
  vct_platinum_small
  vct_platinum_onenand
  vct_platinum_onenand_small
  vct_platinumavc
  vct_platinumavc_small
  vct_platinumavc_onenand
  vct_platinumavc_onenand_small

One speciality of the VCT board is that it can't access NOR FLASH
memory-mapped. It has to use special access functions for this.

Signed-off-by: Stefan Roese 
---
 MAINTAINERS |4 
 MAKEALL |   12 
 Makefile|   35 +++
 3 files changed, 51 insertions(+), 0 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 127604b..a91f427 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -659,6 +659,10 @@ Thomas Lange 
 Vlad Lungu 
qemu_mips   MIPS32
 
+Stefan Roese 
+
+   vct_xxx MIPS32 4Kc
+
 #
 # Nios-32 Systems: #
 #  #
diff --git a/MAKEALL b/MAKEALL
index a16549c..94dc505 100755
--- a/MAKEALL
+++ b/MAKEALL
@@ -610,6 +610,18 @@ LIST_arm=" \
 LIST_mips4kc=" \
incaip  \
qemu_mips   \
+   vct_platinum\
+   vct_platinum_small  \
+   vct_platinum_onenand\
+   vct_platinum_onenand_small  \
+   vct_platinumavc \
+   vct_platinumavc_small   \
+   vct_platinumavc_onenand \
+   vct_platinumavc_onenand_small   \
+   vct_premium \
+   vct_premium_small   \
+   vct_premium_onenand \
+   vct_premium_onenand_small   \
 "
 
 LIST_mips5kc=" \
diff --git a/Makefile b/Makefile
index 1fe9e20..0c6dd8f 100644
--- a/Makefile
+++ b/Makefile
@@ -3005,6 +3005,41 @@ incaip_config: unconfig
 tb0229_config: unconfig
@$(MKCONFIG) $(@:_config=) mips mips tb0229
 
+vct_premium_config \
+vct_premium_small_config   \
+vct_premium_onenand_config \
+vct_premium_onenand_small_config \
+vct_platinum_config\
+vct_platinum_small_config  \
+vct_platinum_onenand_config\
+vct_platinum_onenand_small_config \
+vct_platinumavc_config \
+vct_platinumavc_small_config   \
+vct_platinumavc_onenand_config \
+vct_platinumavc_onenand_small_config: unconfig
+   @mkdir -p $(obj)include
+   @if [ "$(findstring _premium,$@)" ] ; then \
+   echo "#define CONFIG_VCT_PREMIUM" > $(obj)include/config.h ; \
+   $(XECHO) "... on Premium board variant" ; \
+   fi
+   @if [ "$(findstring _platinum_,$@)" ] ; then \
+   echo "#define CONFIG_VCT_PLATINUM" > $(obj)include/config.h ; \
+   $(XECHO) "... on Platinum board variant" ; \
+   fi
+   @if [ "$(findstring _platinumavc,$@)" ] ; then \
+   echo "#define CONFIG_VCT_PLATINUMAVC" > $(obj)include/config.h 
; \
+   $(XECHO) "... on PlatinumAVC board variant" ; \
+   fi
+   @if [ "$(findstring _onenand,$@)" ] ; then \
+   echo "#define CONFIG_VCT_ONENAND" >> $(obj)include/config.h ; \
+   $(XECHO) "... on OneNAND board variant" ; \
+   fi
+   @if [ "$(findstring _small,$@)" ] ; then \
+   echo "#define CONFIG_VCT_SMALL_IMAGE" >> $(obj)include/config.h 
; \
+   $(XECHO) "... stripped down image variant" ; \
+   fi
+   @$(MKCONFIG) -a vct mips mips vct micronas
+
 #
 ## MIPS32 AU1X00
 #
-- 
1.6.0.5

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


[U-Boot] [PATCH] MIPS: Add VCT board series support (Part 1/3)

2008-12-15 Thread Stefan Roese
This patch adds support for the Micronas VCT board series.
Currently the following platforms are supported:

  vct_premium
  vct_premium_small
  vct_premium_onenand
  vct_premium_onenand_small
  vct_platinum
  vct_platinum_small
  vct_platinum_onenand
  vct_platinum_onenand_small
  vct_platinumavc
  vct_platinumavc_small
  vct_platinumavc_onenand
  vct_platinumavc_onenand_small

One speciality of the VCT board is that it can't access NOR FLASH
memory-mapped. It has to use special access functions for this.

Signed-off-by: Stefan Roese 
---
 board/micronas/vct/Makefile|   56 +
 board/micronas/vct/config.mk   |   31 +++
 board/micronas/vct/ebi.c   |   48 +
 board/micronas/vct/ebi_nor_flash.c |  131 
 board/micronas/vct/ebi_onenand.c   |  168 +++
 board/micronas/vct/ebi_smc911x.c   |   94 +
 board/micronas/vct/gpio.c  |   88 
 board/micronas/vct/smc_eeprom.c|  394 
 board/micronas/vct/top.c   |  289 ++
 board/micronas/vct/u-boot.lds  |   70 +++
 board/micronas/vct/vct.c   |  117 +++
 11 files changed, 1486 insertions(+), 0 deletions(-)
 create mode 100644 board/micronas/vct/Makefile
 create mode 100644 board/micronas/vct/config.mk
 create mode 100644 board/micronas/vct/ebi.c
 create mode 100644 board/micronas/vct/ebi_nor_flash.c
 create mode 100644 board/micronas/vct/ebi_onenand.c
 create mode 100644 board/micronas/vct/ebi_smc911x.c
 create mode 100644 board/micronas/vct/gpio.c
 create mode 100644 board/micronas/vct/smc_eeprom.c
 create mode 100644 board/micronas/vct/top.c
 create mode 100644 board/micronas/vct/u-boot.lds
 create mode 100644 board/micronas/vct/vct.c

diff --git a/board/micronas/vct/Makefile b/board/micronas/vct/Makefile
new file mode 100644
index 000..2f8ece6
--- /dev/null
+++ b/board/micronas/vct/Makefile
@@ -0,0 +1,56 @@
+#
+# (C) Copyright 2008 Stefan Roese , DENX Software Engineering
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB= $(obj)lib$(BOARD).a
+
+COBJS-y := $(BOARD).o
+COBJS-y += ebi.o
+COBJS-$(CONFIG_VCT_NOR) += ebi_nor_flash.o
+COBJS-$(CONFIG_VCT_ONENAND) += ebi_onenand.o
+COBJS-$(CONFIG_DRIVER_SMC911X) += ebi_smc911x.o smc_eeprom.o
+COBJS-y += gpio.o
+COBJS-y += top.o
+
+COBJS  := $(sort $(COBJS-y))
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):$(OBJS) $(SOBJS)
+   $(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS)
+
+clean:
+   rm -f $(SOBJS) $(OBJS)
+
+distclean: clean
+   rm -f $(LIB) core *.bak $(obj).depend
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/board/micronas/vct/config.mk b/board/micronas/vct/config.mk
new file mode 100644
index 000..2a71dad
--- /dev/null
+++ b/board/micronas/vct/config.mk
@@ -0,0 +1,31 @@
+#
+# (C) Copyright 2008 Stefan Roese , DENX Software Engineering
+#
+# 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
+#
+
+#
+# vct_xxx boards with MIPS 4Kc CPU core
+#
+
+sinclude $(TOPDIR)/board/$(BOARDDIR)/config.tmp
+
+ifndef TEXT_BASE
+TEXT_BASE = 0x8700
+endif
diff --git a/board/micronas/vct/ebi.c b/board/micronas/vct/ebi.c
new file mode 100644
index 000..8e93f69
---

[U-Boot] [PATCH] serial: Rename driver vcth to vct to support other board variants

2008-12-15 Thread Stefan Roese
Moved driver vcth.c to vct.c to better reflect the VCT board series.
This driver is now used by the VCT platforms:

vct_premium
vct_platinum
vct_platinumsvc

Signed-off-by: Stefan Roese 
---
 drivers/serial/Makefile  |2 +-
 drivers/serial/{vcth.c => vct.c} |8 ++--
 2 files changed, 7 insertions(+), 3 deletions(-)
 rename drivers/serial/{vcth.c => vct.c} (94%)

diff --git a/drivers/serial/Makefile b/drivers/serial/Makefile
index 17235ff..c7a1882 100644
--- a/drivers/serial/Makefile
+++ b/drivers/serial/Makefile
@@ -38,7 +38,7 @@ COBJS-$(CONFIG_PL011_SERIAL) += serial_pl01x.o
 COBJS-$(CONFIG_XILINX_UARTLITE) += serial_xuartlite.o
 COBJS-$(CONFIG_SCIF_CONSOLE) += serial_sh.o
 COBJS-$(CONFIG_USB_TTY) += usbtty.o
-COBJS-$(CONFIG_VCTH_SERIAL) += vcth.o
+COBJS-$(CONFIG_VCT_SERIAL) += vct.o
 
 COBJS  := $(sort $(COBJS-y))
 SRCS   := $(COBJS:.o=.c)
diff --git a/drivers/serial/vcth.c b/drivers/serial/vct.c
similarity index 94%
rename from drivers/serial/vcth.c
rename to drivers/serial/vct.c
index 2c847d0..556c114 100755
--- a/drivers/serial/vcth.c
+++ b/drivers/serial/vct.c
@@ -21,7 +21,11 @@
 #include 
 #include 
 
+#ifdef CONFIG_VCT_PLATINUMAVC
+#define UART_1_BASE0xBDC3
+#else
 #define UART_1_BASE0xBF89C000
+#endif
 
 #defineUART_RBR_OFF0x00/* receiver buffer reg  
*/
 #defineUART_THR_OFF0x00/* transmit holding  reg
*/
@@ -53,7 +57,7 @@
 #define UART_7DATA_BITS0x0002  /*   7 [bits]  1   bits   2 
*/
 #define UART_8DATA_BITS0x0003  /*   8 [bits]  1   bits   2 
*/
 
-static void vcth_uart_set_baud_rate(u32 address, u32 dh, u32 dl)
+static void vct_uart_set_baud_rate(u32 address, u32 dh, u32 dl)
 {
u32 val = __raw_readl(UART_1_BASE + UART_LCR_OFF);
 
@@ -74,7 +78,7 @@ static void vcth_uart_set_baud_rate(u32 address, u32 dh, u32 
dl)
 int serial_init(void)
 {
__raw_writel(UART_DIS_ALL_INTER, UART_1_BASE + UART_IER_OFF);
-   vcth_uart_set_baud_rate(UART_1_BASE, 0, UART_115200_BDR);
+   vct_uart_set_baud_rate(UART_1_BASE, 0, UART_115200_BDR);
__raw_writel(UART_8DATA_BITS, UART_1_BASE + UART_LCR_OFF);
 
return 0;
-- 
1.6.0.5

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


[U-Boot] [PATCH v4] Add support for boards where the NOR FLASH is not memory-mapped

2008-12-15 Thread Stefan Roese
This patch adds the CONFIG_FLASH_NOT_MEM_MAPPED define which can be
used on boards where the NOR FLASH is not memory-mapped and
special accessor functions are needed to access the NOR FLASH.
This affects the memory commands (cmd_mem.c) and the environment
(env_flash.c).

Boards using CONFIG_FLASH_NOT_MEM_MAPPED need to additionally specify
CONFIG_FLASH_BASE and CONFIG_FLASH_END so that the NOR FLASH region
can be detected.

This will be used by the upcoming VCT board support.

Signed-off-by: Stefan Roese 
---
v4:
- Fix a problem with "normal" NOR FLASH in "cp" command

v3:
- Removed some gratuitous underscores in function parameters
- Prototypes moved to header (common.h)
- Removed ";" after macro definition

v2:
- Added configuration option description to the README
- Fix bug in NOR FLASH end detection in env_flash.c (spotted by Wolfgang)
- Further "cleanup" of the env_flash code supporting non memory-mapped
  NOR FLASH.
- Macros in crc32.h now wrapped in "do { ... } while (0)" as suggested by
  Wolfgang

 README  |   17 +
 common/cmd_mem.c|   62 ---
 common/env_flash.c  |   66 +--
 include/common.h|8 ++
 lib_generic/crc32.c |   26 +---
 5 files changed, 147 insertions(+), 32 deletions(-)

diff --git a/README b/README
index 2a553c2..3414d66 100644
--- a/README
+++ b/README
@@ -2198,6 +2198,23 @@ Configuration Settings:
digits and dots.  Recommended value: 45 (9..1) for 80
column displays, 15 (3..1) for 40 column displays.
 
+- CONFIG_FLASH_NOT_MEM_MAPPED
+   Unfortunately there are boards, where the NOR FLASH can't
+   be accessed memory mapped. So we needed to find a way to
+   access those FLASH's from the CFI driver and the environment.
+   For the non-memory-mapped NOR FLASH, we need to define the
+   NOR FLASH area. This can't be detected via the addr2info()
+   function, since we check for flash access in the very early
+   U-Boot code, before the NOR FLASH is detected. So we need
+   to additionally define the following options to configure
+   the NOR FLASH range:
+
+   - CONFIG_FLASH_BASE
+   Starting address of the NOR FLASH area
+
+   - CONFIG_FLASH_END
+   Highest possible address of the NOR FLASH area
+
 - CONFIG_SYS_RX_ETH_BUFFER:
Defines the number of Ethernet receive buffers. On some
Ethernet controllers it is recommended to set this value
diff --git a/common/cmd_mem.c b/common/cmd_mem.c
index d7666c2..742fffa 100644
--- a/common/cmd_mem.c
+++ b/common/cmd_mem.c
@@ -43,6 +43,39 @@
 #define PRINTF(fmt,args...)
 #endif
 
+#if defined(CONFIG_HAS_DATAFLASH)
+#define CONFIG_FLASH_NOT_MEM_MAPPED
+#define OK DATAFLASH_OK
+#endif
+
+#if !defined(OK)
+#define OK 1
+#endif
+
+#if defined(CONFIG_FLASH_NOT_MEM_MAPPED)
+static inline int flash_read(void *to, const void *from, int n)
+{
+#if defined(CONFIG_HAS_DATAFLASH)
+   return read_dataflash(from, n, to);
+#elif defined(CONFIG_FLASH_NOT_MEM_MAPPED)
+   if ((addr2info((u32)from) != NULL))
+   board_flash_read_memcpy(to, from, n);
+   else
+   memcpy(to, from, n);
+   return OK;
+#endif
+}
+#endif /* defined(CONFIG_FLASH_NOT_MEM_MAPPED) */
+
+static inline int is_flash_addr(u32 addr)
+{
+#if defined(CONFIG_HAS_DATAFLASH)
+   return addr_dataflash(addr);
+#else
+   return (addr2info(addr) != NULL);
+#endif
+}
+
 static int mod_mem(cmd_tbl_t *, int, int, int, char *[]);
 
 /* Display values from last command.
@@ -63,7 +96,7 @@ staticulong   base_address = 0;
 int do_mem_md ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
ulong   addr, length;
-#if defined(CONFIG_HAS_DATAFLASH)
+#if defined(CONFIG_FLASH_NOT_MEM_MAPPED)
ulong   nbytes, linebytes;
 #endif
int size;
@@ -100,7 +133,7 @@ int do_mem_md ( cmd_tbl_t *cmdtp, int flag, int argc, char 
*argv[])
length = simple_strtoul(argv[2], NULL, 16);
}
 
-#if defined(CONFIG_HAS_DATAFLASH)
+#if defined(CONFIG_FLASH_NOT_MEM_MAPPED)
/* Print the lines.
 *
 * We buffer all read data, so we can make sure data is read only
@@ -112,10 +145,13 @@ int do_mem_md ( cmd_tbl_t *cmdtp, int flag, int argc, 
char *argv[])
void* p;
linebytes = (nbytes>DISP_LINE_LEN)?DISP_LINE_LEN:nbytes;
 
-   rc = read_dataflash(addr, (linebytes/size)*size, linebuf);
-   p = (rc == DATAFLASH_OK) ? linebuf : (void*)addr;
+   rc = flash_read(linebuf, (void *)addr, (linebytes/size)*size);
+   p = (rc == OK) ? linebuf : (void *)addr;
print_buffer(addr, p, size, linebytes/size, DISP_LINE_LEN/size);
 
+  

[U-Boot] [PATCH] fix bmp_logo.h make dependencies to allow parallel build

2008-12-15 Thread Jean-Christophe PLAGNIOL-VILLARD
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD 
---
 Makefile |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Makefile b/Makefile
index 0e31697..623b8f7 100644
--- a/Makefile
+++ b/Makefile
@@ -340,7 +340,7 @@ $(obj)u-boot:   depend $(SUBDIRS) $(OBJS) 
$(LIBBOARD) $(LIBS) $(LDSCRIPT)
 $(OBJS):   depend $(obj)include/autoconf.mk
$(MAKE) -C cpu/$(CPU) $(if $(REMOTE_BUILD),$@,$(notdir $@))
 
-$(LIBS):   depend $(obj)include/autoconf.mk
+$(LIBS):   depend $(obj)include/autoconf.mk $(SUBDIRS)
$(MAKE) -C $(dir $(subst $(obj),,$@))
 
 $(LIBBOARD):   depend $(LIBS) $(obj)include/autoconf.mk
-- 
1.5.6.5

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


[U-Boot] [PATCH] at91: Fix Atmel's at91sam9 boards out of tree build

2008-12-15 Thread Jean-Christophe PLAGNIOL-VILLARD
introduced in commit 89a7a87f084c

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD 
---
 Makefile |4 
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/Makefile b/Makefile
index 2ac8141..0e31697 100644
--- a/Makefile
+++ b/Makefile
@@ -2586,6 +2586,7 @@ at91sam9260ek_nandflash_config \
 at91sam9260ek_dataflash_cs0_config \
 at91sam9260ek_dataflash_cs1_config \
 at91sam9260ek_config   :   unconfig
+   @mkdir -p $(obj)include
@if [ "$(findstring _nandflash,$@)" ] ; then \
echo "#define CONFIG_SYS_USE_NANDFLASH 1"   
>>$(obj)include/config.h ; \
$(XECHO) "... with environment variable in NAND FLASH" ; \
@@ -2602,6 +2603,7 @@ at91sam9261ek_nandflash_config \
 at91sam9261ek_dataflash_cs0_config \
 at91sam9261ek_dataflash_cs3_config \
 at91sam9261ek_config   :   unconfig
+   @mkdir -p $(obj)include
@if [ "$(findstring _nandflash,$@)" ] ; then \
echo "#define CONFIG_SYS_USE_NANDFLASH 1"   
>>$(obj)include/config.h ; \
$(XECHO) "... with environment variable in NAND FLASH" ; \
@@ -2618,6 +2620,7 @@ at91sam9263ek_nandflash_config \
 at91sam9263ek_dataflash_config \
 at91sam9263ek_dataflash_cs0_config \
 at91sam9263ek_config   :   unconfig
+   @mkdir -p $(obj)include
@if [ "$(findstring _nandflash,$@)" ] ; then \
echo "#define CONFIG_SYS_USE_NANDFLASH 1"   
>>$(obj)include/config.h ; \
$(XECHO) "... with environment variable in NAND FLASH" ; \
@@ -2631,6 +2634,7 @@ at91sam9rlek_nandflash_config \
 at91sam9rlek_dataflash_config \
 at91sam9rlek_dataflash_cs0_config \
 at91sam9rlek_config:   unconfig
+   @mkdir -p $(obj)include
@if [ "$(findstring _nandflash,$@)" ] ; then \
echo "#define CONFIG_SYS_USE_NANDFLASH 1"   
>>$(obj)include/config.h ; \
$(XECHO) "... with environment variable in NAND FLASH" ; \
-- 
1.5.6.5

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


[U-Boot] [U-Boot-v2][PATCH] imx27: set pagesize_2k after probing the nand flash

2008-12-15 Thread frederic rodo
Signed-off-by:Frederic Rodo 
Date: Mon, 15 Dec 2008 14:37:18 +0100
Subject: [PATCH] set pagesize_2k after probing the nand flash

---
 drivers/nand/nand_imx.c |   14 +++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/drivers/nand/nand_imx.c b/drivers/nand/nand_imx.c
index fbef9b7..d15c6b0 100644
--- a/drivers/nand/nand_imx.c
+++ b/drivers/nand/nand_imx.c
@@ -1056,16 +1056,24 @@ static int __init imxnd_probe(struct device_d *dev)
this->ecc.layout = &nand_hw_eccoob_16;
}

-   host->pagesize_2k = 0;
-
/* Scan to find existence of the device */
-   if (nand_scan(mtd, 1)) {
+   if (nand_scan_ident(mtd, 1)) {
DEBUG(MTD_DEBUG_LEVEL0,
  "MXC_ND: Unable to find any NAND device.\n");
err = -ENXIO;
goto escan;
}

+   if (mtd->writesize == 2048)
+   host->pagesize_2k = 1;
+
+   if (nand_scan_tail(mtd)) {
+   DEBUG(MTD_DEBUG_LEVEL0,
+ "MXC_ND: Unable to initialize the NAND device.\n");
+   err = -ENXIO;
+   goto escan;
+   }
+
add_mtd_device(mtd);

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


[U-Boot] [U-Boot-v2][PATCH] imx27: correct READ ID cmd with 2k pages

2008-12-15 Thread frederic rodo
Signed-off-by:Frederic Rodo  
Date: Thu, 11 Dec 2008 13:05:53 +0100
Subject: [PATCH] correct send_id with 2k page

---
 drivers/nand/nand_imx.c |5 -
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/drivers/nand/nand_imx.c b/drivers/nand/nand_imx.c
index 3bf67de..fbef9b7 100644
--- a/drivers/nand/nand_imx.c
+++ b/drivers/nand/nand_imx.c
@@ -315,6 +315,9 @@ static void send_read_id(struct imx_nand_host *host)
/* Wait for operation to complete */
wait_op_done(host, TROP_US_DELAY, 0);

+   /* correct 2 send_read_id successive */
+   host->col_addr = 0;
+
if (this->options & NAND_BUSWIDTH_16) {
volatile u16 *mainbuf = host->regs + MAIN_AREA0;

@@ -865,7 +868,7 @@ static void imx_nand_command(struct mtd_info *mtd,
unsigned command,
 * the full page.
 */
send_addr(host, 0);
-   if (host->pagesize_2k)
+   if ((host->pagesize_2k) && (command != NAND_CMD_READID))
/* another col addr cycle for 2k page */
send_addr(host, 0);
}
-- 
1.4.4.4
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [RESEND][U-Boot-v2][PATCH] imx27: nandboot with 2k page

2008-12-15 Thread frederic rodo
Signed-off-by:Frederic Rodo 
>From 328f5f5b5213bd36672553bb3a411f0fd59af1fe Mon Sep 17 00:00:00 2001
Date: Thu, 11 Dec 2008 11:56:01 +0100
Subject: [PATCH] nandboot with 2k pages

---
 drivers/nand/nand_imx.c |   94 +--
 include/asm-arm/arch-imx/imx-nand.h |2 +-
 2 files changed, 79 insertions(+), 17 deletions(-)

diff --git a/drivers/nand/nand_imx.c b/drivers/nand/nand_imx.c
index f7f50b0..3bf67de 100644
--- a/drivers/nand/nand_imx.c
+++ b/drivers/nand/nand_imx.c
@@ -1090,26 +1090,74 @@ static struct driver_d imx_nand_driver = {

 static void __nand_boot_init nfc_addr(struct imx_nand_host *host, u32 offs)
 {
-   send_addr(host, offs & 0xff);
-   send_addr(host, (offs >> 9) & 0xff);
-   send_addr(host, (offs >> 17) & 0xff);
-   send_addr(host, (offs >> 25) & 0xff);
+   if (!host->pagesize_2k) {
+   send_addr(host, offs & 0xff);
+   send_addr(host, (offs >> 9) & 0xff);
+   send_addr(host, (offs >> 17) & 0xff);
+   send_addr(host, (offs >> 25) & 0xff);
+   } else {
+   /* imx27 Nand flash controller can only read full 2k page */
+   send_addr(host, 0);
+   send_addr(host, 0);
+   send_addr(host, (offs >> 11) & 0xff);
+   send_addr(host, (offs >> 19) & 0xff);
+   /* FIXME: add another send_addr for nandflash > 1Gbit
+* if (read electronic signature byte 5 > 1 Gbit)
+*  send_addr(host, (offs >> 28) & 0xff);
+*/
+
+   /* send read start command */
+   send_cmd(host, NAND_CMD_READSTART);
+   }
 }

-static int __nand_boot_init block_is_bad(struct imx_nand_host *host, u32 offs)
+static int __nand_boot_init block_is_bad(struct imx_nand_host *host, u32 offs,
+u32 pagesize)
 {
-   send_cmd(host, NAND_CMD_READOOB);
-   nfc_addr(host, offs);
-   send_read_page(host, 0, 1);
-
-   return (readw(host->regs + SPARE_AREA0) & 0xff) == 0xff ? 0 : 1;
+   if (!host->pagesize_2k) {
+   send_cmd(host, NAND_CMD_READOOB);
+   nfc_addr(host, offs);
+   send_read_page(host, 0, 1);
+   if ((readw(host->regs + SPARE_AREA0) & 0xff) != 0xff)
+   return 1;
+   } else {
+   /* The AdvancedToolKit Mark the two first page of each block */
+   /* check first page */
+   send_cmd(host, NAND_CMD_READ0);
+   nfc_addr(host, offs);
+   send_read_page(host, 0, 1);
+   send_read_page(host, 1, 1);
+   send_read_page(host, 2, 1);
+   send_read_page(host, 3, 1);
+
+   if (readw(host->regs + NFC_ECC_STATUS_RESULT) & 0xa)
+   return 1;
+
+   if ((readw(host->regs + SPARE_AREA0 + 4) & 0xFF00) != 0xFF00)
+   return 1;
+
+   /* check second page */
+   send_cmd(host, NAND_CMD_READ0);
+   nfc_addr(host, offs + pagesize);
+   send_read_page(host, 0, 1);
+   send_read_page(host, 1, 1);
+   send_read_page(host, 2, 1);
+   send_read_page(host, 3, 1);
+
+   if (readw(host->regs + NFC_ECC_STATUS_RESULT) & 0xa)
+   return 1;
+
+   if ((readw(host->regs + SPARE_AREA0 + 4) & 0xFF00) != 0xFF00)
+   return 1;
+   
+   }
+   return 0;
 }

-void __nand_boot_init imx_nand_load_image(void *dest, int size, int pagesize,
-   int blocksize)
+void __nand_boot_init imx_nand_load_image(void *dest, int size, int blocksize)
 {
struct imx_nand_host host;
-   u32 tmp, page, block;
+   u32 tmp, page, block, pagesize;

PCCR1 |= PCCR1_NFC_BAUDEN;

@@ -1117,6 +1165,10 @@ void __nand_boot_init imx_nand_load_image(void
*dest, int size, int pagesize,
case GPCR_BOOT_8BIT_NAND_2k:
case GPCR_BOOT_16BIT_NAND_2k:
host.pagesize_2k = 1;
+   pagesize = 2048;
+   break;
+   default:
+   pagesize = 512;
}

host.regs = (void __iomem *)IMX_NFC_BASE;
@@ -1134,14 +1186,19 @@ void __nand_boot_init imx_nand_load_image(void
*dest, int size, int pagesize,
/* Unlock Block Command for given address range */
writew(0x4, host.regs + NFC_WRPROT);

+   /* clear all operation  */
+   writew(0x8000, host.regs + NFC_CONFIG1);
+
+   /* enable ECC, disable spare only and interrupt */
tmp = readw(host.regs + NFC_CONFIG1);
-   tmp |= NFC_ECC_EN;
+   tmp |= NFC_ECC_EN | NFC_INT_MSK;
+   tmp &= ~ NFC_SP_EN;
writew(tmp, host.regs + NFC_CONFIG1);

block = page = 0;

while (1) {
-   if (!block_is_bad(&host, block * blocksize)) {
+   if (!block_is_bad(&host, block * blocksize, pagesize)) {
  

Re: [U-Boot] DE2 board with MMC interface (PIO based) and FAT support enabled

2008-12-15 Thread Wolfgang Denk
Dear "ivanchuklist ivanchu",

In message <51a313240812150407xc75ec0vf7e14720277bb...@mail.gmail.com> you 
wrote:
>
> I don't know how to post all what i did. I have made the diff files, i could
> post them but i don't know how the patches are managed. In fact it's not a
> patch at all, just a little branch.

You probably want to read http://www.denx.de/wiki/U-Boot/CodingStyle
and http://www.denx.de/wiki/U-Boot/Patches

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
Why can you only have two doors on a chicken coop? If it had four  it
would be a chicken sedan.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] at91: add at91sam9xeek board support

2008-12-15 Thread Nicolas Ferre
At91sam9xe is basically an at91sam9260 with embedded flash. We can manage it
as another entry for at91sam9260 in the Makefile.

Check documentation at :
http://www.atmel.com/dyn/products/product_card.asp?part_id=4263

Signed-off-by: Nicolas Ferre 
---
 Makefile|   17 +
 doc/README.at91 |2 +-
 2 files changed, 18 insertions(+), 1 deletions(-)

diff --git a/Makefile b/Makefile
index 2ac8141..ce1e932 100644
--- a/Makefile
+++ b/Makefile
@@ -2598,6 +2598,23 @@ at91sam9260ek_config :   unconfig
fi;
@$(MKCONFIG) -a at91sam9260ek arm arm926ejs at91sam9260ek atmel at91
 
+at91sam9xeek_nandflash_config \
+at91sam9xeek_dataflash_cs0_config \
+at91sam9xeek_dataflash_cs1_config \
+at91sam9xeek_config:   unconfig
+   @mkdir -p $(obj)include
+   @if [ "$(findstring _nandflash,$@)" ] ; then \
+   echo "#define CFG_USE_NANDFLASH 1"  
>>$(obj)include/config.h ; \
+   $(XECHO) "... with environment variable in NAND FLASH" ; \
+   elif [ "$(findstring dataflash_cs0,$@)" ] ; then \
+   echo "#define CFG_USE_DATAFLASH_CS0 1"  
>>$(obj)include/config.h ; \
+   $(XECHO) "... with environment variable in SPI DATAFLASH CS0" ; 
\
+   else \
+   echo "#define CFG_USE_DATAFLASH_CS1 1"  
>>$(obj)include/config.h ; \
+   $(XECHO) "... with environment variable in SPI DATAFLASH CS1" ; 
\
+   fi;
+   @$(MKCONFIG) -n at91sam9xeek -a at91sam9260ek arm arm926ejs 
at91sam9260ek atmel at91sam9
+
 at91sam9261ek_nandflash_config \
 at91sam9261ek_dataflash_cs0_config \
 at91sam9261ek_dataflash_cs3_config \
diff --git a/doc/README.at91 b/doc/README.at91
index 838769a..84421fb 100644
--- a/doc/README.at91
+++ b/doc/README.at91
@@ -3,7 +3,7 @@ Atmel AT91 Evaluation kits
 http://atmel.com/dyn/products/tools.asp?family_id=605#1443
 
 --
-AT91SAM9260EK
+AT91SAM9260EK & AT91SAM92XEEK
 --
 
 Memory map
-- 
1.5.3.7



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


[U-Boot] DE2 board with MMC interface (PIO based) and FAT support enabled

2008-12-15 Thread ivanchuklist ivanchu
Hi list,

I'm working with an Altera DE2 board (Nios II processor without MMU). I
developed a sd interface implemented with pio cores. In order to compile
u-boot correctly i modified the Makefile to match my binutils. I also
changed the file common/cmd_mem.c because it has a little problem when it
needs to manage the card to copy the data to main memory or from main
memory. I can't deduce the direction of data knowing only the address
because his address space isn't mapped on the bus like a common flash
memory. I added a command named dmcc (cmd_dmmc) to set the desired direction
of data, ie to or from mmc, to call correctly to the functions mmc_read and
mmc_write.
I have made a device block, filling the structure block_dev_desc_t and
defining mmc_get_dev(), to have access to the partition table (FAT). Now
u-boot is able to list the files inside the card (fatls mmc 0:0) and it
copies them to main memory (fatload mmc 0:0 50 zimage).
I had to modify the source common/cmd_mmc.c because it has a reference to
mmc.h, but it gives problems with the linking process because of double
reference between the objects cmd_mmc.o and cmd_mem.o. The solution was to
declare extern the function mmc_init.
I also added my board to u-boot package.
I don't know how to post all what i did. I have made the diff files, i could
post them but i don't know how the patches are managed. In fact it's not a
patch at all, just a little branch.

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


[U-Boot] U-boot to DE2 board with MMC interface (PIO based) and FAT support enabled

2008-12-15 Thread ivanchuklist ivanchu
Hi list,

I'm working with an Altera DE2 board (Nios II processor without MMU). I
developed a sd interface implemented with pio cores. In order to compile
u-boot correctly i modified the Makefile to match my binutils. I also
changed the file common/cmd_mem.c because it has a little problem when it
needs to manage the card to copy the data to main memory or from main
memory. I can't deduce the direction of data knowing only the address
because his address space isn't mapped on the bus like a common flash
memory. I added a command named dmcc (cmd_dmmc) to set the desired direction
of data, ie to or from mmc, to call correctly to the functions mmc_read and
mmc_write.
I have made a device block, filling the structure block_dev_desc_t and
defining mmc_get_dev(), to have access to the partition table (FAT). Now
u-boot is able to list the files inside the card (fatls mmc 0:0) and it
copies them to main memory (fatload mmc 0:0 50 zimage).
I had to modify the source common/cmd_mmc.c because it has a reference to
mmc.h, but it gives problems with the linking process because of double
reference between the objects cmd_mmc.o and cmd_mem.o. The solution was to
declare extern the function mmc_init.
I also added my board to u-boot package.
I don't know how to post all what i did. I have made the diff files, i could
post them but i don't know how the patches are managed. In fact it's not a
patch at all, just a little branch.

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


[U-Boot] [PATCH] common: Iteration limit for memory test.

2008-12-15 Thread Dirk Eibach
We want to use mtest for production memory test (though I know it is
not recommended). I implemented an iteration limit, so expect can parse
the results.

The iteration limit is passed to mtest as a fourth parameter:
[start [end [pattern [iterations
If no fourth parameter is supplied, there is no iteration limit and the
test will loop forever.

Signed-off-by: Dirk Eibach 
---

 - Modified original patch title "Added optional iteration limit for 
   alternative  memory test."
 - Iteration limit is now implemented for both original and alternative 
   memory test.

 common/cmd_mem.c |   29 +
 1 files changed, 25 insertions(+), 4 deletions(-)

diff --git a/common/cmd_mem.c b/common/cmd_mem.c
index d7666c2..f87170c 100644
--- a/common/cmd_mem.c
+++ b/common/cmd_mem.c
@@ -672,6 +672,8 @@ int do_mem_mtest (cmd_tbl_t *cmdtp, int flag, int argc, 
char *argv[])
ulong   val;
ulong   readback;
int rcode = 0;
+   int iterations = 1;
+   int iteration_limit;
 
 #if defined(CONFIG_SYS_ALT_MEMTEST)
vu_long len;
@@ -687,7 +689,6 @@ int do_mem_mtest (cmd_tbl_t *cmdtp, int flag, int argc, 
char *argv[])
vu_long *dummy = 0; /* yes, this is address 0x0, not NULL */
 #endif
int j;
-   int iterations = 1;
 
static const ulong bitpattern[] = {
0x0001, /* single bit */
@@ -722,6 +723,12 @@ int do_mem_mtest (cmd_tbl_t *cmdtp, int flag, int argc, 
char *argv[])
pattern = 0;
}
 
+   if (argc > 4) {
+   iteration_limit = (ulong)simple_strtoul(argv[4], NULL, 16);
+   } else {
+   iteration_limit = 0;
+   }
+
 #if defined(CONFIG_SYS_ALT_MEMTEST)
printf ("Testing %08x ... %08x:\n", (uint)start, (uint)end);
PRINTF("%s:%d: start 0x%p end 0x%p\n",
@@ -733,6 +740,13 @@ int do_mem_mtest (cmd_tbl_t *cmdtp, int flag, int argc, 
char *argv[])
return 1;
}
 
+
+   if (iteration_limit && iterations > iteration_limit) {
+   printf ("Tested %d iteration(s) without errors.\n",
+   iterations-1);
+   return 0;
+   }
+
printf("Iteration: %6d\r", iterations);
PRINTF("Iteration: %6d\n", iterations);
iterations++;
@@ -926,6 +940,13 @@ int do_mem_mtest (cmd_tbl_t *cmdtp, int flag, int argc, 
char *argv[])
return 1;
}
 
+   if (iteration_limit && iterations > iteration_limit) {
+   printf ("Tested %d iteration(s) without errors.\n",
+   iterations-1);
+   return 0;
+   }
+   ++iterations;
+
printf ("\rPattern %08lX  Writing..."
"%12s"
"\b\b\b\b\b\b\b\b\b\b",
@@ -1277,9 +1298,9 @@ U_BOOT_CMD(
 #endif /* CONFIG_LOOPW */
 
 U_BOOT_CMD(
-   mtest,  4,  1,  do_mem_mtest,
-   "mtest  - simple RAM test\n",
-   "[start [end [pattern]]]\n"
+   mtest,5,1, do_mem_mtest,
+   "mtest   - simple RAM test\n",
+   "[start [end [pattern [iterations\n"
"- simple RAM read/write test\n"
 );
 
-- 
1.5.6.5

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


Re: [U-Boot] [RFC USB PATCH V2] USB ehci fix and test on ixp4xx hardware

2008-12-15 Thread michael
Hi,

Remy Bohmer wrote:
> Hello Michael,
>
> 2008/12/12 Michael Trimarchi :
>> EHCI fix code and ixp4xx test.
>> USB ehci configuration parameter:
>>
>> #define CONFIG_CMD_USB  1
>> #define CONFIG_USB_STORAGE  1
>> #define CONFIG_USB_EHCI
>> #define CONFIG_USB_EHCI_IXP4XX  1
>> #define CONFIG_EHCI_IS_TDI  1
>> #define CONFIG_EHCI_DESC_BIG_ENDIAN 1
>> #define CONFIG_EHCI_MMIO_BIG_ENDIAN 1
>> #define CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS 2
>> #define CONFIG_LEGACY_USB_INIT_SEQ  1
>>
>> 2 USB Device(s) found
>>   scanning bus for storage devices... 0 Storage Device(s) found
>> => usb tree
>>
>> Device Tree:
>>  1  Hub (1.5MBit/s, 0mA)
>>  |  u-boot EHCI Host Controller
>>  |
>>  |+-2  Mass Storage (12MBit/s, 100mA)
>>   Sony Storage Media 0C07040930296
>>
>> =>
>>
>> Signed-off-by: Michael Trimarchi 
>> ---
>>  drivers/usb/usb_ehci.h  |   51 ++
>>  drivers/usb/usb_ehci_core.c |  127 
>> ++-
>>  2 files changed, 106 insertions(+), 72 deletions(-)
>
> Applied to u-boot-usb (next)
>
> I had some weird problems re-basing your patches, it looked like git
> choked on the [PATCH] keyword in the headers, resulting in different
> patch titles and it was complaining about empty commits. Can you
> please review if the next-tree is still as you expect? (I believe I
> fixed it all, so I expect no real problems)
>
> Thanks,
>
> Remy
>
Thank's a lot, I'll check later.
I have these things in my todo list:
- ehci-pci.c support to the usb pci device
- create an ehci struct that contains controller description
- rebase the ixp465 patch
and then add the usb_ehci_ixp4xx support

Is it ok? are there any suggests?

Michael





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


[U-Boot] TFTP server support in U-boot

2008-12-15 Thread santosh pattar
Dear All,

As of now in the U-boot only TFTP client is supported. I am planning
to have TFTP server support in the u-boot. Can you please help me in
this regarding?

Please provide me few links if this has been done already, or links
from where i can take some information and start working on it.

Hope to get some advice on this soon from you.

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