Re: [U-Boot] [PATCH V2] memcpy/memmove: Do not copy to same address

2011-06-29 Thread Matthias Weißer
Dear Wolfgang

Am 14.06.2011 08:18, schrieb Matthias Weißer:
> Am 23.05.2011 11:03, schrieb Matthias Weisser:
>> In some cases (e.g. bootm with a elf payload which is already at the right
>> position) there is a in place copy of data to the same address. Catching this
>> saves some ms while booting.
>
> What about this patch? As the initial submission of the patch was inside
> the merge window (see http://patchwork.ozlabs.org/patch/90725/) I would
> like to see the current version of this patch (see
> http://patchwork.ozlabs.org/patch/96841/) in the upcoming release.

May I kindly ask you if http://patchwork.ozlabs.org/patch/96841/ can go 
in as the merge window is now open again?

Thanks
Matthias


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


[U-Boot] Pull request: u-boot-arm/master

2011-06-29 Thread Albert ARIBAUD
Wolfgang,

The following changes since commit b1af6f532e0d348b153d5c148369229d24af361a:

   Prepare v2011.06 (2011-06-27 22:22:42 +0200)

are available in the git repository at:
   git://git.denx.de/u-boot-arm.git master

Aneesh V (9):
   arm: make default implementation of cache_flush() weakly linked
   armv7: cache maintenance operations for armv7
   armv7: rename cache related CONFIG flags
   armv7: integrate cache maintenance support
   arm: minor fixes for cache and mmu handling
   armv7: add PL310 support to u-boot
   armv7: adapt omap4 to the new cache maintenance framework
   armv7: adapt omap3 to the new cache maintenance framework
   armv7: adapt s5pc1xx to the new cache maintenance framework

David Müller (ELSOFT AG) (3):
   VCMA9: remove unneeded config.mk
   VCMA9: use CFI driver (and remove the old one)
   VCMA9: various cleanups/code style fixes

Igor Grinberg (1):
   arm: omap2: apollon: fix broken build

John Rigby (1):
   OMAP[34]: fix broken timer

Matthias Weisser (1):
   arm: Update jadecpu board

Tom Warren (2):
   GPIO: Tegra2: add GPIO driver for Tegra2
   arm: Tegra2: GPIO: enable GPIO for Tegra2 boards

  README|   11 +
  arch/arm/cpu/arm1136/start.S  |4 +-
  arch/arm/cpu/armv7/Makefile   |2 +-
  arch/arm/cpu/armv7/cache_v7.c |  394 ++
  arch/arm/cpu/armv7/cpu.c  |   50 +--
  arch/arm/cpu/armv7/omap-common/timer.c|7 +-
  arch/arm/cpu/armv7/omap3/Makefile |1 -
  arch/arm/cpu/armv7/omap3/board.c  |  136 ++-
  arch/arm/cpu/armv7/omap3/cache.S  |  263 
  arch/arm/cpu/armv7/omap3/lowlevel_init.S  |   32 ++
  arch/arm/cpu/armv7/omap4/board.c  |   12 +
  arch/arm/cpu/armv7/omap4/lowlevel_init.S  |9 +
  arch/arm/cpu/armv7/s5pc1xx/cache.S|   88 +
  arch/arm/cpu/armv7/start.S|   18 +-
  arch/arm/include/asm/arch-omap3/omap3.h   |   20 +
  arch/arm/include/asm/arch-omap3/sys_proto.h   |   10 +-
  arch/arm/include/asm/arch-omap4/sys_proto.h   |2 +-
  arch/arm/include/asm/arch-s5pc1xx/sys_proto.h |3 -
  arch/arm/include/asm/arch-tegra2/gpio.h   |  250 +++-
  arch/arm/include/asm/armv7.h  |   67 +++
  arch/arm/include/asm/global_data.h|2 +-
  arch/arm/include/asm/gpio.h   |   38 ++
  arch/arm/include/asm/pl310.h  |   73 
  arch/arm/include/asm/utils.h  |   56 +++
  arch/arm/lib/Makefile |3 +-
  arch/arm/lib/board.c  |8 +-
  arch/arm/lib/cache-cp15.c |   22 +-
  arch/arm/lib/cache-pl310.c|  115 +
  arch/arm/lib/cache.c  |   20 +-
  board/armltd/integrator/split_by_variant.sh   |8 +-
  board/mpl/vcma9/Makefile  |4 +-
  board/mpl/vcma9/cmd_vcma9.c   |   56 +---
  board/mpl/vcma9/config.mk |   24 --
  board/mpl/vcma9/flash.c   |  432 ---
  board/mpl/vcma9/lowlevel_init.S   |  549 
+++--
  board/mpl/vcma9/vcma9.c   |  284 --
  board/mpl/vcma9/vcma9.h   |  121 +-
  board/syteco/jadecpu/config.mk|1 -
  board/syteco/jadecpu/jadecpu.c|5 +-
  common/cmd_bdinfo.c   |2 +-
  drivers/gpio/Makefile |1 +
  drivers/gpio/tegra2_gpio.c|  255 
  include/common.h  |5 +-
  include/configs/B2.h  |3 +-
  include/configs/VCMA9.h   |  249 ++--
  include/configs/apollon.h |4 +
  include/configs/assabet.h |2 +-
  include/configs/ca9x4_ct_vxp.h|2 +-
  include/configs/cerf250.h |2 +-
  include/configs/cradle.h  |2 +-
  include/configs/csb226.h  |2 +-
  include/configs/dnp1110.h |2 +-
  include/configs/efikamx.h |2 +-
  include/configs/evb4510.h |3 +-
  include/configs/gcplus.h  |2 +-
  include/configs/innokom.h |2 +-
  include/configs/jadecpu.h |   24 +-
  include/configs/jornada.h |2 +-
  include/configs/lart.h|2 +-
  include/configs/lubbock.h |2 +-
  include/configs/mx51evk.h |2 +-
  include/configs/mx53evk.h |2 +-
  include/configs/omap4_panda.h |8 +-
  includ

[U-Boot] [PATCH] Makefile: need to remove generated u-boot-nand_spl.lds

2011-06-29 Thread Kumar Gala
On MPC85xx based NAND_SPL builds we generate a u-boot-nand_spl.lds based
on output from preprocessor.  We where never removed it.

Signed-off-by: Kumar Gala 
---
 Makefile |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Makefile b/Makefile
index a344536..689fddb 100644
--- a/Makefile
+++ b/Makefile
@@ -1128,7 +1128,7 @@ clean:
   $(obj)arch/blackfin/cpu/bootrom-asm-offsets.[chs]
@rm -f $(obj)include/bmp_logo.h
@rm -f $(obj)lib/asm-offsets.s
-   @rm -f $(obj)nand_spl/{u-boot.lds,u-boot-spl,u-boot-spl.map,System.map}
+   @rm -f 
$(obj)nand_spl/{u-boot.lds,u-boot-nand_spl.lds,u-boot-spl,u-boot-spl.map,System.map}
@rm -f $(obj)onenand_ipl/onenand-{ipl,ipl.bin,ipl.map}
@rm -f 
$(obj)mmc_spl/{u-boot.lds,u-boot-spl,u-boot-spl.map,u-boot-spl.bin,u-boot-mmc-spl.bin}
@rm -f $(ONENAND_BIN)
-- 
1.7.3.4

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


Re: [U-Boot] [RFC PATCH 6/7] omap: common spl support for OMAP3/4

2011-06-29 Thread Aneesh V
Hi Heiko,

On Thursday 30 June 2011 11:31 AM, Heiko Schocher wrote:
> Hello Aneesh,
>
> Aneesh V wrote:
>> Signed-off-by: Aneesh V
>> ---
>>   arch/arm/cpu/armv7/omap-common/Makefile |9 ++--
>>   arch/arm/cpu/armv7/omap-common/spl.c|   56 
>>   arch/arm/cpu/armv7/omap-common/spl.lds  |   62 
>> +++
>>   3 files changed, 123 insertions(+), 4 deletions(-)
>>   create mode 100644 arch/arm/cpu/armv7/omap-common/spl.c
>>   create mode 100644 arch/arm/cpu/armv7/omap-common/spl.lds
>>
> [...]
>> diff --git a/arch/arm/cpu/armv7/omap-common/spl.c 
>> b/arch/arm/cpu/armv7/omap-common/spl.c
>> new file mode 100644
>> index 000..b5a5f3c
>> --- /dev/null
>> +++ b/arch/arm/cpu/armv7/omap-common/spl.c
> [...]
>> @@ -0,0 +1,56 @@
>> +void board_init_f(ulong dummy)
>> +{
>> +debug(">>board_init_f()\n");
>> +relocate_code(CONFIG_SYS_SPL_STACK,&gdata, CONFIG_SYS_SPL_TEXT_BASE);
>> +debug("<
> This debug printf will never occur ;-)

Indeed. Thanks for pointing out.

>
> BTW: Do you really need to relocate code? You could just load the 2nd
> stage loader to ram from board_init_f, or?

I am passing the same address as I am executing from as the target for
the relocation, so the relocation will not happen, instead BSS will be
initialized. That's what I am calling it for. Initially I had my own
routine for clearing BSS. Then I decided to re-use it from start.S

BTW, this series is not complete as far as SPL support is concerned.
It doesn't even build due to many undefined references. It serves only
as a prototype for the framework part.

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


Re: [U-Boot] [RFC PATCH 6/7] omap: common spl support for OMAP3/4

2011-06-29 Thread Heiko Schocher
Hello Aneesh,

Aneesh V wrote:
> Signed-off-by: Aneesh V 
> ---
>  arch/arm/cpu/armv7/omap-common/Makefile |9 ++--
>  arch/arm/cpu/armv7/omap-common/spl.c|   56 
>  arch/arm/cpu/armv7/omap-common/spl.lds  |   62 
> +++
>  3 files changed, 123 insertions(+), 4 deletions(-)
>  create mode 100644 arch/arm/cpu/armv7/omap-common/spl.c
>  create mode 100644 arch/arm/cpu/armv7/omap-common/spl.lds
> 
[...]
> diff --git a/arch/arm/cpu/armv7/omap-common/spl.c 
> b/arch/arm/cpu/armv7/omap-common/spl.c
> new file mode 100644
> index 000..b5a5f3c
> --- /dev/null
> +++ b/arch/arm/cpu/armv7/omap-common/spl.c
[...]
> @@ -0,0 +1,56 @@
> +void board_init_f(ulong dummy)
> +{
> + debug(">>board_init_f()\n");
> + relocate_code(CONFIG_SYS_SPL_STACK, &gdata, CONFIG_SYS_SPL_TEXT_BASE);
> + debug("

Re: [U-Boot] [RFC PATCH 2/7] Use ALL-y style instead of ifeq blocks for better readability and upgradeability

2011-06-29 Thread Aneesh V
On Thursday 30 June 2011 12:24 AM, Mike Frysinger wrote:
> On Wednesday, June 29, 2011 09:09:22 Aneesh V wrote:
>>   Makefile |   18 +-
>>   1 files changed, 5 insertions(+), 13 deletions(-)
>>
>>   # Always append ALL so that arch config.mk's can add custom ones
>
> as this comment indicates, you forgot to up date arch config.mk's that append
> ALL.  they'll need converting to ALL-y too.
> -mike

Ok. Will correct all config.mk's

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


Re: [U-Boot] [RFC PATCH 1/7] Adapt config.mk for usage in spl/Makefile

2011-06-29 Thread Aneesh V
On Thursday 30 June 2011 12:22 AM, Mike Frysinger wrote:
> On Wednesday, June 29, 2011 09:09:21 Aneesh V wrote:
>> -$(obj)%.s:  %.S
>> +$(obj)%.s:  $(src)%.S

I too didn't understand why that was done. But I noticed it just before
sending the patches so decided to give it a try later. I tried removing
them now and it doesn't harm. Maybe, some of the changes I did to the
definition of OBJTREE obj etc would have rendered it irrelevant?

Daniel,
Can you throw some light on this?

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


Re: [U-Boot] more U-boot for Pentium

2011-06-29 Thread Raleigh Boulware

Thanks for your help I will study up on this more and get back with more 
questions next week! thanks for your help..
 
BTW I just bought an eprom programer off EBAY it will take quite some time to 
ship it from china, so i am making baby steps.. :)
 

> Date: Thu, 30 Jun 2011 12:17:46 +1000
> Subject: Re: more U-boot for Pentium
> From: graeme.r...@gmail.com
> To: r_boulw...@hotmail.com
> CC: u-boot@lists.denx.de
> 
> On Thu, Jun 30, 2011 at 12:08 PM, Raleigh Boulware
>  wrote:
> >
> >
> >> Date: Thu, 30 Jun 2011 11:58:55 +1000
> >> Subject: Re: more U-boot for Pentium
> >> From: graeme.r...@gmail.com
> >> To: r_boulw...@hotmail.com
> >> CC: u-boot@lists.denx.de
> >>
> >> On Thu, Jun 30, 2011 at 11:54 AM, Raleigh Boulware
> >>  wrote:
> >> >
> >> >
> >> >> Hi Raleigh,
> >> >>
> >> >> On Thu, Jun 30, 2011 at 11:16 AM, Raleigh Boulware
> >> >>  wrote:
> >> >> > I have been going through the code and I have stumbled accross a file
> >> >> > called
> >> >> > sc520_car.S that has something called Cache as ram. I am guessing
> >> >> > that
> >> >> > this
> >> >> > is something special for the sc520 correct? Why was there a need to
> >> >> > do
> >> >> > this?
> >> >> > Why was the Cache used like ram in the boot process?
> >> >>
> >> >> Cache-As-RAM allows the CPU cache to be used as regular RAM while
> >> >> U-Boot
> >> >> is running from Flash before the onboard SDRAM has been initialised.
> >> >> This
> >> >> allows a temporary stack, and therefore C runtime environment to be
> >> >> created. This this allows you to write the SDRAM initialisation code in
> >> >> C
> >> >> which is a lot easier than assembler.
> >> >>
> >> > So this is pnly used if we want to setup the SDRAM controller in C code
> >>
> >> More that just that - It is used for the duration of board_init_f() which
> >> may include all manner of peripheral initialisation prior to relocating
> >> U-Boot into RAM.
> > Is it possible to just set up the DDR controller early in the process in
> > assembler to avoid doing a Cache as ram? The reason I ask is because I might
> > have trouble getting other mother boards to do this.
> 
> Yes, you can setup the SDRAM controller in assembler. This would occur in
> place of the Cache-As-RAM init you see for the sc520. You also need to
> determine the memory size while you are at it (at a pinch, you can hard-
> code the memory size initially)
> 
> >
> > Als I was looking at 2 rutines. board_init_r()  and board_init_f(). It
> > appears that the code goes from assmbler to this board_init_f() then back to
> > assembler then to board_init_r(). I am not sure of the reason for this.
> 
> board_init_f() runs from Flash - It is responsible for getting everything
> setup ready to run U-Boot from RAM. The last thing board_init_f does is
> copy U-Boot from Flash into RAM and perform the relocation fixups.
> board_init_f() then calls back into assembler at which point a new stack
> is created in RAM before jumping to the in-RAM copy of board_init_r().
> Once inside board_init_r(), the Flash is never again accessed unless you
> save the environment or erase it and write a new U-Boot binary (i.e. you
> can physically remove the Flash chip and U-Boot will still run fine)
> 
> Regards,
> 
> Graeme
  ___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] more U-boot for Pentium

2011-06-29 Thread Graeme Russ
On Thu, Jun 30, 2011 at 12:08 PM, Raleigh Boulware
 wrote:
>
>
>> Date: Thu, 30 Jun 2011 11:58:55 +1000
>> Subject: Re: more U-boot for Pentium
>> From: graeme.r...@gmail.com
>> To: r_boulw...@hotmail.com
>> CC: u-boot@lists.denx.de
>>
>> On Thu, Jun 30, 2011 at 11:54 AM, Raleigh Boulware
>>  wrote:
>> >
>> >
>> >> Hi Raleigh,
>> >>
>> >> On Thu, Jun 30, 2011 at 11:16 AM, Raleigh Boulware
>> >>  wrote:
>> >> > I have been going through the code and I have stumbled accross a file
>> >> > called
>> >> > sc520_car.S that has something called Cache as ram. I am guessing
>> >> > that
>> >> > this
>> >> > is something special for the sc520 correct? Why was there a need to
>> >> > do
>> >> > this?
>> >> > Why was the Cache used like ram in the boot process?
>> >>
>> >> Cache-As-RAM allows the CPU cache to be used as regular RAM while
>> >> U-Boot
>> >> is running from Flash before the onboard SDRAM has been initialised.
>> >> This
>> >> allows a temporary stack, and therefore C runtime environment to be
>> >> created. This this allows you to write the SDRAM initialisation code in
>> >> C
>> >> which is a lot easier than assembler.
>> >>
>> > So this is pnly used if we want to setup the SDRAM controller in C code
>>
>> More that just that - It is used for the duration of board_init_f() which
>> may include all manner of peripheral initialisation prior to relocating
>> U-Boot into RAM.
> Is it possible to just set up the DDR controller early in the process in
> assembler to avoid doing a Cache as ram? The reason I ask is because I might
> have trouble getting other mother boards to do this.

Yes, you can setup the SDRAM controller in assembler. This would occur in
place of the Cache-As-RAM init you see for the sc520. You also need to
determine the memory size while you are at it (at a pinch, you can hard-
code the memory size initially)

>
> Als I was looking at 2 rutines. board_init_r()  and board_init_f(). It
> appears that the code goes from assmbler to this board_init_f() then back to
> assembler then to board_init_r(). I am not sure of the reason for this.

board_init_f() runs from Flash - It is responsible for getting everything
setup ready to run U-Boot from RAM. The last thing board_init_f does is
copy U-Boot from Flash into RAM and perform the relocation fixups.
board_init_f() then calls back into assembler at which point a new stack
is created in RAM before jumping to the in-RAM copy of board_init_r().
Once inside board_init_r(), the Flash is never again accessed unless you
save the environment or erase it and write a new U-Boot binary (i.e. you
can physically remove the Flash chip and U-Boot will still run fine)

Regards,

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


Re: [U-Boot] more U-boot for Pentium

2011-06-29 Thread Raleigh Boulware


 

> Date: Thu, 30 Jun 2011 11:58:55 +1000
> Subject: Re: more U-boot for Pentium
> From: graeme.r...@gmail.com
> To: r_boulw...@hotmail.com
> CC: u-boot@lists.denx.de
> 
> On Thu, Jun 30, 2011 at 11:54 AM, Raleigh Boulware
>  wrote:
> >
> >
> >> Hi Raleigh,
> >>
> >> On Thu, Jun 30, 2011 at 11:16 AM, Raleigh Boulware
> >>  wrote:
> >> > I have been going through the code and I have stumbled accross a file
> >> > called
> >> > sc520_car.S that has something called Cache as ram. I am guessing that
> >> > this
> >> > is something special for the sc520 correct? Why was there a need to do
> >> > this?
> >> > Why was the Cache used like ram in the boot process?
> >>
> >> Cache-As-RAM allows the CPU cache to be used as regular RAM while U-Boot
> >> is running from Flash before the onboard SDRAM has been initialised. This
> >> allows a temporary stack, and therefore C runtime environment to be
> >> created. This this allows you to write the SDRAM initialisation code in C
> >> which is a lot easier than assembler.
> >>
> > So this is pnly used if we want to setup the SDRAM controller in C code
> 
> More that just that - It is used for the duration of board_init_f() which
> may include all manner of peripheral initialisation prior to relocating
> U-Boot into RAM.
Is it possible to just set up the DDR controller early in the process in 
assembler to avoid doing a Cache as ram? The reason I ask is because I might 
have trouble getting other mother boards to do this.
 
Als I was looking at 2 rutines. board_init_r()  and board_init_f(). It appears 
that the code goes from assmbler to this board_init_f() then back to assembler 
then to board_init_r(). I am not sure of the reason for this.   
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] more U-boot for Pentium

2011-06-29 Thread Graeme Russ
On Thu, Jun 30, 2011 at 11:54 AM, Raleigh Boulware
 wrote:
>
>
>> Hi Raleigh,
>>
>> On Thu, Jun 30, 2011 at 11:16 AM, Raleigh Boulware
>>  wrote:
>> > I have been going through the code and I have stumbled accross a file
>> > called
>> > sc520_car.S that has something called Cache as ram. I am guessing that
>> > this
>> > is something special for the sc520 correct? Why was there a need to do
>> > this?
>> > Why was the Cache used like ram in the boot process?
>>
>> Cache-As-RAM allows the CPU cache to be used as regular RAM while U-Boot
>> is running from Flash before the onboard SDRAM has been initialised. This
>> allows a temporary stack, and therefore C runtime environment to be
>> created. This this allows you to write the SDRAM initialisation code in C
>> which is a lot easier than assembler.
>>
> So this is pnly used if we want to setup the SDRAM controller in C code

More that just that - It is used for the duration of board_init_f() which
may include all manner of peripheral initialisation prior to relocating
U-Boot into RAM.

> correct? In this code it is not used because the SDRAM cotroller is pretty
> much working from power up. So when I port this to my motherboard it looks
> as if i really do not need this.. Am I correct in this thinking??

You may need to initialise the SDRAM controller - It really depends on the
underlying hardware. You are going to need to have a good look at the
technical documentation for your board to figure this one out

Regards,

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


Re: [U-Boot] more U-boot for Pentium

2011-06-29 Thread Raleigh Boulware


 

> Hi Raleigh,
> 
> On Thu, Jun 30, 2011 at 11:16 AM, Raleigh Boulware
>  wrote:
> > I have been going through the code and I have stumbled accross a file called
> > sc520_car.S that has something called Cache as ram. I am guessing that this
> > is something special for the sc520 correct? Why was there a need to do this?
> > Why was the Cache used like ram in the boot process?
> 
> Cache-As-RAM allows the CPU cache to be used as regular RAM while U-Boot
> is running from Flash before the onboard SDRAM has been initialised. This
> allows a temporary stack, and therefore C runtime environment to be
> created. This this allows you to write the SDRAM initialisation code in C
> which is a lot easier than assembler.
> 
So this is pnly used if we want to setup the SDRAM controller in C code 
correct? In this code it is not used because the SDRAM cotroller is pretty much 
working from power up. So when I port this to my motherboard it looks as if i 
really do not need this.. Am I correct in this thinking??
  ___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] more U-boot for Pentium

2011-06-29 Thread Graeme Russ
Hi Raleigh,

On Thu, Jun 30, 2011 at 11:16 AM, Raleigh Boulware
 wrote:
> I have been going through the code and I have stumbled accross a file called
> sc520_car.S that has something called Cache as ram. I am guessing that this
> is something special for the sc520 correct? Why was there a need to do this?
> Why was the Cache used like ram in the boot process?

Cache-As-RAM allows the CPU cache to be used as regular RAM while U-Boot
is running from Flash before the onboard SDRAM has been initialised. This
allows a temporary stack, and therefore C runtime environment to be
created. This this allows you to write the SDRAM initialisation code in C
which is a lot easier than assembler.

>
> Also I am I see something called early_board_init. I trace this to a file
> called eNET.S but all it does is jumps back to where it came from. I don't
> understand.

This is provided in case the board needs to do any specific initialisation
extremely early in the boot process. In the case of the eNET, no such
initialisation needs to be performed.

> Where is the external memory controller set up at?

For the sc520, the is no external memory controller, and the initialisation
of SDRAM is trivial (a couple of timing parameters in a control register)

> thanks for your time

Regards,

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


[U-Boot] more U-boot for Pentium

2011-06-29 Thread Raleigh Boulware

I have been going through the code and I have stumbled accross a file called 
sc520_car.S that has something called Cache as ram. I am guessing that this is 
something special for the sc520 correct? Why was there a need to do this? Why 
was the Cache used like ram in the boot process?

Also I am I see something called early_board_init. I trace this to a file 
called eNET.S but all it does is jumps back to where it came from. I don't 
understand.

Where is the external memory controller set up at?

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


Re: [U-Boot] Pull request u-boot-blackfin.git (post branch)

2011-06-29 Thread Mike Frysinger
On Wednesday, June 29, 2011 17:21:46 Wolfgang Denk wrote:
> Please stick to the rules.  These apply to everbody, including you.
> Even more so to you, as you have the experience and knowledge so that
> you actually should be aware of how these things get done.

you'll need to revise the wiki then as this really isnt how the linux workflow 
works.  i dont know which patches exactly have been posted, which had feedback 
and were revised, etc...  so i just posted the entire set that havent been 
merged fresh in case people missed things the first time around -- as is done 
on lkml.

since most likely nothing is going to get changed (again) in the next two 
weeks, i'll simply rebase the branches and send another pull request.
-mike


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


Re: [U-Boot] [PATCH/RFC v4] unify version_string

2011-06-29 Thread Mike Frysinger
On Wednesday, June 29, 2011 18:32:49 Andreas Bießmann wrote:
> --- a/arch/arm/lib/board.c
> +++ b/arch/arm/lib/board.c
>
> -const char version_string[] =
> - U_BOOT_VERSION" (" U_BOOT_DATE " - " U_BOOT_TIME ")"CONFIG_IDENT_STRING;
> +const char * const version_string = U_BOOT_VERSION_STRING;

two things:
 - why the change to a pointer from an array ?  it wastes a pointer
 - this should be in a common file somewhere marked weak that way the people 
who do it normal (everyone but ppc?) dont have to duplicate it at all, and the 
people who do it oddly (ppc) can still keep doing what they're doing

const char __weak version_string[] = U_BOOT_VERSION_STRING;

> --- a/include/version.h
> +++ b/include/version.h
> 
> +#define U_BOOT_VERSION_STRING U_BOOT_VERSION " (" U_BOOT_DATE " - " \
> + U_BOOT_TIME ")" CONFIG_IDENT_STRING;

pretty sure that trailing semi-colon doesn't belong
-mike


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


[U-Boot] HOPE FOR JAPAN NOW: DONATE TO THE EARTHQUAKE & TSUNAMI VICTIMS

2011-06-29 Thread Unicef Relief Programm

HOPE FOR JAPAN NOW: DONATE TO THE EARTHQUAKE & TSUNAMI VICTIMS

The United Nations International Children Emergency Fund (UNICEF, USA) hereby 
appeal to all Cooperate Bodies, Non Governmental Organizations (NGO), 
Celebrities, Government Official, Individuals including you as well, on behalf 
of the Japan Earthquake & Tsunami Victims for financial supports in 
providing relief and shelter.

Your one (1) cent or $1 counts at this critical time for the Children and 
citizens of Japan and what ever support you rendered will be rewarded by God. 
Please fill out the following information's.

1). First Name
2). Last Name
3). Direct Phone Number
4). Email Address (Optional)
5). The Amount To Assist

Note that 100% of funds raised will go towards relief efforts in Japan and 
there are NO back end costs. A massive 9.8 magnitude earthquake struck 
North-East Japan on Friday, March 11th 2011. The damage to buildings is 
extensive and the number of injured or dead is estimated to be over 10,000 of 
which 40% are children.

Your financial support will help rush emergency supplies to survivors of this 
catastrophe. Your donation now will help distribute life-saving relief supplies 
including food, clean water, blankets, medical supplies and tents to children 
and families devastated by the Tsunami caused by the earthquake and aftershocks 
in Japan.

Please donate and assist the Japan earthquake & Tsunami victims financially 
and with your prayers as well. All donations will be made via , WESTERN UNION, 
and Bank Wire Transfers. Upon the confirmation of your willingness to assist 
the children and citizens of Japan, we shall respond back to you with the 
directives on how to redeem your support/donation. As soon as we receive your 
email response, We shall then provide you with the details on how to redeem and 
send your donation.

Thank you for your generous gift in this time of need.

UNICEF - UNITED KINGDOM
London. National Committee. Mail address. UNICEF House 30a Great Sutton Street 
London EC1V 0DU United Kingdom.Email: [unicefreliefprogr...@yahoo.co.uk]


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


[U-Boot] Is somebody workin on getting the AT91SAM9G45EKES working on the latest build?

2011-06-29 Thread William C. Landolina
I need the AT91SAM9G45 port - if I need to bring it up to date to keep it  
among the living I will volunteer, but if one of the usual AT91 maintainers is 
already working on it I suspect they can do it more easily than I.

I can start work on the 9G45 update in early July if necessary.  

Thanks,

Bill Landolina
Technology Atlanta Corporation
500 Sugar Mill Road - Suite 202A
Atlanta, Georgia  30350

(404) 303-0446 (Voice)
(678) 596-3625 (Cell)
w...@techatl.com


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


[U-Boot] [PATCH/RFC v4] unify version_string

2011-06-29 Thread Andreas Bießmann
This patch adds a new U_BOOT_VERSION_STRING definition to be placed in
symbol version_string in the arch specific implementations.
This is a preperation for easier modification of the version_string
variable over all architectures.

Signed-off-by: Andreas Bießmann 
CC: Mike Frysinger 
CC: Peter Pan 
---
his is an RFC as discussed in
http://article.gmane.org/gmane.comp.boot-loaders.u-boot/101695

Dear Peter Pan,

I think it would be best to base your changes to remove
timestamp on this patch (or some modified version of it)

regards

Andreas Bießmann

changes since v1:
 - remove (some) places of 'extern ... version_string' definition in favour of
   include version.h
 - use format-patch && send-email since some complained about base64 formated
   mail content

changes since v2:
 - add linker script solution for mpc512x powerpc devices
   (never compiled)

changes since v3:
 - use a common variable to join the parameters and leave the arch dependent
   parts as is

 arch/arm/lib/board.c  |8 +---
 arch/avr32/lib/board.c|4 +---
 arch/blackfin/lib/board.c |3 +--
 arch/m68k/cpu/mcf5227x/start.S|5 +
 arch/m68k/cpu/mcf523x/start.S |5 +
 arch/m68k/cpu/mcf52x2/start.S |5 +
 arch/m68k/cpu/mcf532x/start.S |5 +
 arch/m68k/cpu/mcf5445x/start.S|5 +
 arch/m68k/cpu/mcf547x_8x/start.S  |5 +
 arch/microblaze/lib/board.c   |3 +--
 arch/mips/lib/board.c |4 +---
 arch/nios2/cpu/start.S|9 +
 arch/powerpc/cpu/74xx_7xx/start.S |9 +
 arch/powerpc/cpu/mpc512x/start.S  |   12 
 arch/powerpc/cpu/mpc5xx/start.S   |9 +
 arch/powerpc/cpu/mpc5xxx/start.S  |9 +
 arch/powerpc/cpu/mpc8220/start.S  |9 +
 arch/powerpc/cpu/mpc824x/start.S  |9 +
 arch/powerpc/cpu/mpc8260/start.S  |9 +
 arch/powerpc/cpu/mpc83xx/start.S  |   12 
 arch/powerpc/cpu/mpc85xx/start.S  |9 +
 arch/powerpc/cpu/mpc86xx/start.S  |9 +
 arch/powerpc/cpu/mpc8xx/start.S   |9 +
 arch/powerpc/cpu/mpc8xx/video.c   |1 -
 arch/powerpc/cpu/ppc4xx/start.S   |9 +
 arch/sh/lib/board.c   |3 +--
 arch/sparc/cpu/leon2/start.S  |5 +
 arch/sparc/cpu/leon3/start.S  |5 +
 arch/x86/lib/board.c  |4 +---
 common/cmd_version.c  |2 --
 common/main.c |3 +--
 drivers/video/cfb_console.c   |2 +-
 include/version.h |   11 +++
 lib/display_options.c |3 +--
 34 files changed, 48 insertions(+), 166 deletions(-)

diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c
index 169dfeb..033baa7 100644
--- a/arch/arm/lib/board.c
+++ b/arch/arm/lib/board.c
@@ -42,7 +42,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -70,12 +69,7 @@ extern int  AT91F_DataflashInit(void);
 extern void dataflash_print_info(void);
 #endif
 
-#ifndef CONFIG_IDENT_STRING
-#define CONFIG_IDENT_STRING ""
-#endif
-
-const char version_string[] =
-   U_BOOT_VERSION" (" U_BOOT_DATE " - " U_BOOT_TIME ")"CONFIG_IDENT_STRING;
+const char * const version_string = U_BOOT_VERSION_STRING;
 
 #ifdef CONFIG_DRIVER_RTL8019
 extern void rtl8019_get_enetaddr (uchar * addr);
diff --git a/arch/avr32/lib/board.c b/arch/avr32/lib/board.c
index 5edef8f..b02df8f 100644
--- a/arch/avr32/lib/board.c
+++ b/arch/avr32/lib/board.c
@@ -23,7 +23,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 
@@ -41,8 +40,7 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-const char version_string[] =
-   U_BOOT_VERSION " ("U_BOOT_DATE" - "U_BOOT_TIME") " CONFIG_IDENT_STRING;
+const char * const version_string = U_BOOT_VERSION_STRING;
 
 unsigned long monitor_flash_len;
 
diff --git a/arch/blackfin/lib/board.c b/arch/blackfin/lib/board.c
index 362b8c4..be13479 100644
--- a/arch/blackfin/lib/board.c
+++ b/arch/blackfin/lib/board.c
@@ -16,7 +16,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 
@@ -39,7 +38,7 @@ int post_flag;
 
 DECLARE_GLOBAL_DATA_PTR;
 
-const char version_string[] = U_BOOT_VERSION " ("U_BOOT_DATE" - 
"U_BOOT_TIME")";
+const char * const version_string = U_BOOT_VERSION_STRING;
 
 __attribute__((always_inline))
 static inline void serial_early_puts(const char *s)
diff --git a/arch/m68k/cpu/mcf5227x/start.S b/arch/m68k/cpu/mcf5227x/start.S
index d09d492..c5096a8 100644
--- a/arch/m68k/cpu/mcf5227x/start.S
+++ b/arch/m68k/cpu/mcf5227x/start.S
@@ -23,7 +23,6 @@
 
 #include 
 #include 
-#include 
 #include "version.h"
 #include 
 
@@ -508,7 +507,5 @@ _int_handler:
 
.globl  version_string
 version_string:
-   .ascii U_BOOT_VERSION
-   .ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
-   .ascii CONFIG_IDENT_STRING, "\0"
+   .ascii U_BOOT_VERSION_STRING, "\0"
.align 4
diff --git a/arch/m68k/cpu/mcf523x/start.S b/a

Re: [U-Boot] [PATCH] ehci-hcd: Allow cleanups to happen on an EHCI timeout.

2011-06-29 Thread Simon Glass
Hi Joel,

On Sat, Jun 25, 2011 at 12:28 PM, Joel A Fernandes  wrote:
> With this, the EHCI seems to "recover" from a timeout. This is particularly
> observable if you were to ping the wrong IP Address and then ping the correct
> one or if there was a temporary failure during tftp sessions.
>
> All it takes is one timeout to disable it. If you have a noisy network (lot
> of traffic), even if the traffic is not for the board, the timeouts don't 
> occur.
>
> Signed-off-by: Joel A Fernandes 
> ---
> Robert, Could you see if this patch solves the issue you're seeing without
> increasing the timeout?
> Simon, Could this be a fix for a similar issue you were seeing with asix?

Yes this is better (ASIX can recover from a timeout), but I am
concerned that it carries on without reporting an error. Is that
right?

Should we disable async schedule and then return an error?

With respect to using a bulk USB stick (some of which take 3s or more
to respond to a submit) this doesn't make any difference for me. It
seems to take a long time to respond the first time, so the 5s timeout
seems prudent.

Since this sorts out the network side we can probably skip that patch.

Regards,
Simon

>
>  drivers/usb/host/ehci-hcd.c |    1 -
>  1 files changed, 0 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
> index 243bb39..9bfcbae 100644
> --- a/drivers/usb/host/ehci-hcd.c
> +++ b/drivers/usb/host/ehci-hcd.c
> @@ -464,7 +464,6 @@ ehci_submit_async(struct usb_device *dev, unsigned long 
> pipe, void *buffer,
>        /* Check that the TD processing happened */
>        if (token & 0x80) {
>                printf("EHCI timed out on TD - token=%#x\n", token);
> -               goto fail;
>        }
>
>        /* Disable async schedule. */
> --
> 1.7.1
>
>
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] panic: add noreturn attribute

2011-06-29 Thread Mike Frysinger
Since panic() never returns, we should add an appropriate attribute to
let gcc improve optimization around it.

Signed-off-by: Mike Frysinger 
---
 include/common.h |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/common.h b/include/common.h
index 1e21b7a..b59079b 100644
--- a/include/common.h
+++ b/include/common.h
@@ -651,7 +651,7 @@ int strict_strtoul(const char *cp, unsigned int base, 
unsigned long *res);
 unsigned long long simple_strtoull(const char *cp,char **endp,unsigned int 
base);
 long   simple_strtol(const char *cp,char **endp,unsigned int base);
 void   panic(const char *fmt, ...)
-   __attribute__ ((format (__printf__, 1, 2)));
+   __attribute__ ((format (__printf__, 1, 2), noreturn));
 intsprintf(char * buf, const char *fmt, ...)
__attribute__ ((format (__printf__, 2, 3)));
 intvsprintf(char *buf, const char *fmt, va_list args);
-- 
1.7.6

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


Re: [U-Boot] [PATCH v3] Add assert() for debug assertions

2011-06-29 Thread Mike Frysinger
On Wednesday, June 29, 2011 17:01:23 Wolfgang Denk wrote:
> Mike Frysinger wrote:
> > do we really care about that when people are using #define DEBUG ?  i'd
> > say this is an unnecessary indirection ...
> 
> Yes, we do care about the memory footprint - no matter whether with or
> without DEBUG.

there's caring about it, and there's nitpicking over ~10 bytes per call site.
-mike


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


Re: [U-Boot] Pull request u-boot-blackfin.git

2011-06-29 Thread Wolfgang Denk
Dear Mike Frysinger,

In message <1309315854-10359-1-git-send-email-vap...@gentoo.org> you wrote:
> The following changes since commit b1af6f532e0d348b153d5c148369229d24af361a:
> 
>   Prepare v2011.06 (2011-06-27 22:22:42 +0200)
> 
> are available in the git repository at:
>   git://www.denx.de/git/u-boot-blackfin.git master

NAK, as before.

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 more data I punch in this card,  the lighter it becomes, and the
lower the mailing cost."
 - Stan Kelly-Bootle, "The Devil's DP Dictionary"
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 00/18] Blackfin updates for v2011.09

2011-06-29 Thread Wolfgang Denk
Dear Mike Frysinger,

In message <1309289787-7846-1-git-send-email-vap...@gentoo.org> you wrote:
> Many of these have been posted already, but some have not.  We've pulled
> some updates from the Linux port, added support for multiple serial devs
> at the same time, and random tweaks/improvements all over.
> 
> Harald Krapfenbauer (2):
>   Blackfin: cm-bf537e/cm-bf537u/tcm-bf537: update network settings
>   Blackfin: cm-bf537e/cm-bf537u/tcm-bf537: enable mmc_spi support
> 
> Mike Frysinger (16):
>   Blackfin: uart: move debug buffers into local bss
>   Blackfin: uart: add multiple serial support
>   Blackfin: adi boards: enable multi serial support by default
>   Blackfin: dont reset SWRST on newer bf526 parts
>   Blackfin: add init.elf helper code
>   Blackfin: uart: fix printf warning
>   Blackfin: post: setup default CONFIG_SYS_POST_WORD_ADDR
>   Blackfin: gpio: optimize free path a little
>   Blackfin: sync MMR read/write helpers with Linux
>   Blackfin: portmux: allow header to be included in assembly files
>   Blackfin: drop unused dma.h header from start code
>   Blackfin: adi boards: enable pretty flash progress output
>   Blackfin: split out async setup
>   Blackfin: serial: convert to bfin_{read,write} helpers
>   Blackfin: update anomaly lists to latest public info
>   Blackfin: adi boards: also set stderr to nc with helper

All NAK for disobeying the well known rules.

See previous messages.

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
"Life is a garment we continuously alter, but which  never  seems  to
fit."  - David McCord
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Pull request u-boot-blackfin.git (post branch)

2011-06-29 Thread Wolfgang Denk
Dear Mike Frysinger,

In message <1309289196-5718-1-git-send-email-vap...@gentoo.org> you wrote:
> All of thse patches have been posted previously, and no one has
> given feedback, so here they are in a handy branch for you to pull.
> 
> The following changes since commit b1af6f532e0d348b153d5c148369229d24af361a:
> 
>   Prepare v2011.06 (2011-06-27 22:22:42 +0200)
> 
> are available in the git repository at:
>   git://www.denx.de/git/u-boot-blackfin.git post

Please stop reposting patches without reference or patch version or
change logs.

Please consider all these postings to be NAKed.

Please stick to the rules.  These apply to everbody, including you.
Even more so to you, as you have the experience and knowledge so that
you actually should be aware of how these things get done.


Also, after posting a patch series you MUST allow for review time.

Um... you are reposting old patches unchanged?  Now this is a really
stupid thing to do - please stop doing that.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Many companies that have made themselves dependent on [the  equipment
of  a  certain  major  manufacturer] (and in doing so have sold their
soul to the devil) will collapse under the sheer weight  of  the  un-
mastered complexity of their data processing systems.
  -- Edsger W. Dijkstra, SIGPLAN Notices, Volume 17, Number 5
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Pull request u-boot-blackfin.git (sf branch)

2011-06-29 Thread Wolfgang Denk
Dear Mike Frysinger,

In message <1309282783-27244-1-git-send-email-vap...@gentoo.org> you wrote:
> The following changes since commit b1af6f532e0d348b153d5c148369229d24af361a:
> 
>   Prepare v2011.06 (2011-06-27 22:22:42 +0200)
> 
> are available in the git repository at:
>   git://www.denx.de/git/u-boot-blackfin.git sf

These patches (as is) were just posted a few hours ago.  You are
supposed to allow for a couple of days for reeview before sending a
pull request.

Ignored.

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
You can only live once, but if you do it right, once is enough.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 0/9] spi flash updates for v2011.09

2011-06-29 Thread Wolfgang Denk
Dear Mike Frysinger,

In message <1309282694-27103-1-git-send-email-vap...@gentoo.org> you wrote:
> These have all been posted already.  A few part updates, bug fixes,
> code unification, and that kind of fun stuff.

Then why exactly are you reposting these here?

And IF these are reposts, why dopn't I see a patch version in the
Subject line, nor any change log in the patches itself?

NAK on the whole series.

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
You don't have to stay up nights to succeed; you have to  stay  awake
days.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Please pull u-boot-cfi-flash

2011-06-29 Thread Wolfgang Denk
Dear Stefan Roese,

In message <201106291019.59554...@denx.de> you wrote:
> Hi Wolfgang,
> 
> please pull the following patch:
> 
> The following changes since commit b1af6f532e0d348b153d5c148369229d24af361a:
> 
>   Prepare v2011.06 (2011-06-27 22:22:42 +0200)
> 
> are available in the git repository at:
>   git://www.denx.de/git/u-boot-cfi-flash.git master
> 
> Mike Frysinger (1):
>   cfi_flash: reverse geometry for newer STM parts
> 
>  drivers/mtd/cfi_flash.c |4 
>  1 files changed, 4 insertions(+), 0 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 have never understood the female capacity to avoid a direct  answer
to any question.
-- Spock, "This Side of Paradise", stardate 3417.3
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Pull request: u-boot-arm/master

2011-06-29 Thread Wolfgang Denk
Dear Albert,

In message <4e0ac19d.9070...@aribaud.net> you wrote:
> 
> Please disregard this pull request. As it came too late for 2011-06, 

OK.

> I'll re-issue it after I have merged in my current 'next' branch and the 
> patches Igor has mentioned, as soon as the merge window is announced.

The merge window is open.

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 evolution of the human race will not be accomplished in  the  ten
thousand  years  of  tame  animals,  but in the million years of wild
animals, because man is and will always be a wild animal.
  - Charles Galton Darwin
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3] Add assert() for debug assertions

2011-06-29 Thread Wolfgang Denk
Dear Mike Frysinger,

In message <201106291643.32477.vap...@gentoo.org> you wrote:
>
> do we really care about that when people are using #define DEBUG ?  i'd say
> this is an unnecessary indirection ...

Yes, we do care about the memory footprint - no matter whether with or
without DEBUG.

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
Those who do not  understand  Unix  are  condemned  to  reinvent  it,
poorly.  - Henry Spencer, University of Toronto Unix hack
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3] Add assert() for debug assertions

2011-06-29 Thread Mike Frysinger
On Wednesday, June 29, 2011 15:49:34 Simon Glass wrote:
> - Use separate __assert_fail() function to reduce memory footprint

do we really care about that when people are using #define DEBUG ?  i'd say 
this is an unnecessary indirection ...
-mike


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


[U-Boot] Please update libfdt for U-Boot

2011-06-29 Thread Tabi Timur-B04825
Jerry,

Now that the merge window is open, could you please update libfdt?
The version in U-Boot hasn't been updated in over a year, and there
are new features that I need to have.  Specifically, this commit:
http://git.jdl.com/gitweb/?p=dtc.git;a=commit;h=d75b33af676d0beac8398651a7f09037555a550b

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


[U-Boot] [PATCH v3] Add assert() for debug assertions

2011-06-29 Thread Simon Glass
assert() is like BUG_ON() but compiles to nothing unless DEBUG is defined.
This is useful when a condition is an error but a board reset is unlikely
to fix it, so it is better to soldier on in hope. Assertion failures should
be caught during development/test.

It turns out that assert() is defined separately in a few places in U-Boot
with various meanings. This patch cleans up some of these.

Build errors exposed by this change (and defining DEBUG) are also fixed in
this patch.

Signed-off-by: Simon Glass 
---
Changes in v2:
- Changed macros so that all code is compiled even if DEBUG is disabled

Changes in v3:
- Use panic() instead of printf()
- Use separate __assert_fail() function to reduce memory footprint
- Changed output format to match assert(3)

 common/dlmalloc.c |7 ---
 include/common.h  |   21 +
 include/malloc.h  |8 
 lib/qsort.c   |5 -
 lib/vsprintf.c|8 
 5 files changed, 29 insertions(+), 20 deletions(-)

diff --git a/common/dlmalloc.c b/common/dlmalloc.c
index e9bab09..f2080c6 100644
--- a/common/dlmalloc.c
+++ b/common/dlmalloc.c
@@ -286,13 +286,6 @@ extern "C" {
 
 */
 
-#ifdef DEBUG
-#include 
-#else
-#define assert(x) ((void)0)
-#endif
-
-
 /*
   INTERNAL_SIZE_T is the word-size used for internal bookkeeping
   of chunk sizes. On a 64-bit machine, you can reduce malloc
diff --git a/include/common.h b/include/common.h
index 1e21b7a..0956b93 100644
--- a/include/common.h
+++ b/include/common.h
@@ -124,6 +124,27 @@ typedef volatile unsigned char vu_char;
 #define debugX(level,fmt,args...)
 #endif /* DEBUG */
 
+#ifdef DEBUG
+# define _DEBUG 1
+#else
+# define _DEBUG 0
+#endif
+
+/*
+ * An assertion is run-time check done in debug mode only. If DEBUG is not
+ * defined then it is skipped. If DEBUG is defined and the assertion fails,
+ * then it calls panic*( which may or may not reset/halt U-Boot (see
+ * CONFIG_PANIC_HANG), It is hoped that all failing assertions are found
+ * before release, and after release it is hoped that they don't matter. But
+ * in any case these failing assertions cannot be fixed with a reset (which
+ * may just do the same assertion again).
+ */
+void __assert_fail(const char *assertion, const char *file, unsigned line,
+  const char *function);
+#define assert(x) \
+   ({ if (!(x) && _DEBUG) \
+   __assert_fail(#x, __FILE__, __LINE__, __func__); })
+
 #define error(fmt, args...) do {   \
printf("ERROR: " fmt "\nat %s:%d/%s()\n",   \
##args, __FILE__, __LINE__, __func__);  \
diff --git a/include/malloc.h b/include/malloc.h
index 3e145ad..ecf3c67 100644
--- a/include/malloc.h
+++ b/include/malloc.h
@@ -285,14 +285,6 @@ extern "C" {
 
 */
 
-#ifdef DEBUG
-/* #include  */
-#define assert(x) ((void)0)
-#else
-#define assert(x) ((void)0)
-#endif
-
-
 /*
   INTERNAL_SIZE_T is the word-size used for internal bookkeeping
   of chunk sizes. On a 64-bit machine, you can reduce malloc
diff --git a/lib/qsort.c b/lib/qsort.c
index 1cc0d31..86c392c 100644
--- a/lib/qsort.c
+++ b/lib/qsort.c
@@ -17,11 +17,6 @@
 
 #include 
 #include 
-#if 0
-#include 
-#else
-#define assert(arg)
-#endif
 
 void qsort(void  *base,
   size_t nel,
diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index 3b924ec..1f01b70 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -728,3 +728,11 @@ void panic(const char *fmt, ...)
do_reset (NULL, 0, 0, NULL);
 #endif
 }
+
+void __assert_fail(const char *assertion, const char *file, unsigned line,
+  const char *function)
+{
+   /* This will not return */
+   panic("%s:%u: %s: Assertion `%s' failed.", file, line, function,
+ assertion);
+}
-- 
1.7.3.1

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


Re: [U-Boot] Please update libfdt for U-Boot

2011-06-29 Thread Jerry Van Baren
Hi Tabi,

On 06/29/2011 03:40 PM, Tabi Timur-B04825 wrote:
> Jerry,
>
> Now that the merge window is open, could you please update libfdt?
> The version in U-Boot hasn't been updated in over a year, and there
> are new features that I need to have.  Specifically, this commit:
> http://git.jdl.com/gitweb/?p=dtc.git;a=commit;h=d75b33af676d0beac8398651a7f09037555a550b

Will do, thanks for the reminder.

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


Re: [U-Boot] GNU specific sed argument in rules.mk

2011-06-29 Thread Wolfgang Denk
Dear Jeroen Hofstee,

In message <4e0b8f82.4000...@myspectrum.nl> you wrote:
> 
> rules.mk uses the GNU specific sed \w leading to not directly obvious 
> Make / _depend errors in the build process, like circular dependencies 

You should probably mention when such errors result - I have never seen
any of these.

> Current command (gsed = GNU sed, sed = FreeBSD takes \w as w). The first 
> command is not the intention.
> [jeroen@blue ~]$ echo some/example/test.c | sed -e 's/\(.*\)\.\w/\1.o/';
> some/example/test.c
> [jeroen@blue ~]$ echo some/example/test.c | gsed -e 's/\(.*\)\.\w/\1.o/';
> some/example/test.o
> [jeroen@blue ~]$ echo some/example/test.w | sed -e 's/\(.*\)\.\w/\1.o/';
> some/example/test.o
> [jeroen@blue ~]$ echo some/example/test.w | gsed -e 's/\(.*\)\.\w/\1.o/';
> some/example/test.o
> 
> None GNU specific as per GNU docs (fine):
> [jeroen@blue ~]$ echo some/example/test.c | sed -e 
> 's/\(.*\)\.[[:alnum:]_]/\1.o/';
> some/example/test.o
> [jeroen@blue ~]$ echo some/example/test.c | gsed -e 
> 's/\(.*\)\.[[:alnum:]_]/\1.o/';
> some/example/test.o
> 
> or shorter (regex are greedy):
> [jeroen@blue ~]$ echo some/example/test.c | sed -e 's/\(.*\)\..*/\1.o/';
> some/example/test.o
> [jeroen@blue ~]$ echo some/example/test.c | gsed -e 's/\(.*\)\..*/\1.o/';
> some/example/test.o

I don't think this last version is equivalent to the original code.
With GNU sed:

-> echo foo/bar-baz.frob-nitz | sed -e 's/\(.*\)\.\w/\1.o/'
foo/bar-baz.orob-nitz
-> echo foo/bar-baz.frob-nitz | sed -e 's/\(.*\)\..*/\1.o/'
foo/bar-baz.o


> Would you accept a patch for this?

Yes, of course - if the resultinmg code works, and if you follow
patch submission rules (like SoB: line etc.).

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
Computers are not intelligent.  They only think they are.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/2] ext2: Simplify partial sector access logic

2011-06-29 Thread Anton Staaf
On Wed, Jun 29, 2011 at 6:04 AM, Detlev Zundel  wrote:

> Hi Anton,
>
> > Previously reading or writing zero full sectors (reading the end of
> > one sector and the beginning of the next for example) was special
> > cased and involved stack allocating a second sector buffer.  This
> > change uses the same code path for this case as well as when there
> > are a non-zero number of full sectors to access.  The result is
> > easier to read and reduces the maximum stack used.
>
> It's non-trivial to prove that your change is equivalent and
> unfortunately I do not have enough time to do this.  If your tests work,
> than this is certainly a good indication ;) The one thing I'd like to be
> sure is that the previous code looks like it used the stack for whole
> sectors but copied only parts of this to the provided address pointer.
> Your new code looks like it always writes whole sectors to the provided
> pointer.  Is this safe even if the caller allocated space without
> overhead for whole sectors?


Thanks for the reviews by the way.  My new version of the code still bounces
partial sector reads (both at the beginning and end of the range) through a
stack allocated sector buffer.  The portion that is writing directly to the
users buffer is only used for reading the full sectors.  The middle section
(in the "if (sectors > 0)" block) is reading only as many sectors as are
specified by (byte_len / SECTOR_SIZE).  byte_len, buf and sector at this
point in the function have been updated by the first block that deals with
reading the unaligned start of the data (if it exists).

Also, I have tested this code on a Tegra board using ext2ls and ext2load of
a kernel image.

Thanks,
Anton

Cheers
>  Detlev
>
> --
> In God we trust.  All others we monitor
>   -- NSA motto
> --
> DENX Software Engineering GmbH,  MD: Wolfgang Denk & Detlev Zundel
> HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: d...@denx.de
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [RFC PATCH 2/7] Use ALL-y style instead of ifeq blocks for better readability and upgradeability

2011-06-29 Thread Mike Frysinger
On Wednesday, June 29, 2011 09:09:22 Aneesh V wrote:
>  Makefile |   18 +-
>  1 files changed, 5 insertions(+), 13 deletions(-)
> 
>  # Always append ALL so that arch config.mk's can add custom ones

as this comment indicates, you forgot to up date arch config.mk's that append 
ALL.  they'll need converting to ALL-y too.
-mike


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


Re: [U-Boot] [RFC PATCH 1/7] Adapt config.mk for usage in spl/Makefile

2011-06-29 Thread Mike Frysinger
On Wednesday, June 29, 2011 09:09:21 Aneesh V wrote:
> -$(obj)%.s:   %.S
> +$(obj)%.s:   $(src)%.S

why ?  i dont see any explanation for this.
-mike


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


[U-Boot] GNU specific sed argument in rules.mk

2011-06-29 Thread Jeroen Hofstee
Hi Wolfgang / All,

rules.mk uses the GNU specific sed \w leading to not directly obvious 
Make / _depend errors in the build process, like circular dependencies 
warnings / crc32.c not found (some example and (incorrect) fixes), e.g.:
http://lists.denx.de/pipermail/u-boot/2009-May/051931.html
http://lists.denx.de/pipermail/u-boot/2009-June/054662.html
http://lists.denx.de/pipermail/u-boot/2009-November/064655.html
http://lists.denx.de/pipermail/u-boot/2011-March/04.html

Some test:

Current command (gsed = GNU sed, sed = FreeBSD takes \w as w). The first 
command is not the intention.
[jeroen@blue ~]$ echo some/example/test.c | sed -e 's/\(.*\)\.\w/\1.o/';
some/example/test.c
[jeroen@blue ~]$ echo some/example/test.c | gsed -e 's/\(.*\)\.\w/\1.o/';
some/example/test.o
[jeroen@blue ~]$ echo some/example/test.w | sed -e 's/\(.*\)\.\w/\1.o/';
some/example/test.o
[jeroen@blue ~]$ echo some/example/test.w | gsed -e 's/\(.*\)\.\w/\1.o/';
some/example/test.o

None GNU specific as per GNU docs (fine):
[jeroen@blue ~]$ echo some/example/test.c | sed -e 
's/\(.*\)\.[[:alnum:]_]/\1.o/';
some/example/test.o
[jeroen@blue ~]$ echo some/example/test.c | gsed -e 
's/\(.*\)\.[[:alnum:]_]/\1.o/';
some/example/test.o

or shorter (regex are greedy):
[jeroen@blue ~]$ echo some/example/test.c | sed -e 's/\(.*\)\..*/\1.o/';
some/example/test.o
[jeroen@blue ~]$ echo some/example/test.c | gsed -e 's/\(.*\)\..*/\1.o/';
some/example/test.o

Would you accept a patch for this?

Regards,
Jeroen



patch would look something like this, GNU man suggested or ...

diff --git a/rules.mk b/rules.mk
index c2860e5..385e5f5 100644
--- a/rules.mk
+++ b/rules.mk
@@ -29,11 +29,11 @@ $(obj).depend:  $(src)Makefile $(TOPDIR)/config.mk 
$(SRCS) $(HOSTSRCS)
 @rm -f $@
 @touch $@
 @for f in $(SRCS); do \
-   g=`basename $$f | sed -e 's/\(.*\)\.\w/\1.o/'`; \
+   g=`basename $$f | sed -e 's/\(.*\)\..*/\1.o/'`; \
 $(CC) -M $(CPPFLAGS) -MQ $(obj)$$g $$f>>  $@ ; \
 done
 @for f in $(HOSTSRCS); do \
-   g=`basename $$f | sed -e 's/\(.*\)\.\w/\1.o/'`; \
+   g=`basename $$f | sed -e 's/\(.*\)\..*/\1.o/'`; \
 $(HOSTCC) -M $(HOSTCPPFLAGS) -MQ $(obj)$$g $$f>>  $@ ; 
\
 done

GNU extension to regex are documented here:
See 
http://www.gnu.org/software/gawk/manual/html_node/GNU-Regexp-Operators.html
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [STATUS] v2011.06 release, Merge Window is OPEN

2011-06-29 Thread Albert ARIBAUD
Hi all,

Le 28/06/2011 12:55, Wolfgang Denk a écrit :
> Hello all,
>
> U-Boot v2011.06 has been released and is available from the git
> repository and the FTP server.
>
> KNOWN ISSUES:
>
> - The cleanup after the reorganization of the ARM code has not been
>completed yet. At the moment, approapprox, 100+ ARM boards are
>*broken* and *do not compile*.
>
>Board maintainers or other interested parties are requested to
>adapt their boards within the current merge window. All boards that
>have not been fixed within the first week of the merge window are
>considered unmaintained and without interest to the community and
>will be removed.
>
>This is the last such warning.
>
> - We still have not found a new network custodian yet.  Are there any
>volunteers?
>
> The Merge Window for the next release (v2011.09) is open until
> Sat Jul 16, 2011, 23:59:59 CEST = 18 days remaining.
>
> The next release v2011.09 is scheduled for September 04, 2011.

For information only, here are patches that were pending on 
u-boot-arm/next and were thus moved to u-boot-arm/master, or were added 
to it since the window opened:

Aneesh V (9):
   arm: make default implementation of cache_flush() weakly linked
   armv7: cache maintenance operations for armv7
   armv7: rename cache related CONFIG flags
   armv7: integrate cache maintenance support
   arm: minor fixes for cache and mmu handling
   armv7: add PL310 support to u-boot
   armv7: adapt omap4 to the new cache maintenance framework
   armv7: adapt omap3 to the new cache maintenance framework
   armv7: adapt s5pc1xx to the new cache maintenance framework

David Müller (ELSOFT AG) (3):
   VCMA9: remove unneeded config.mk
   VCMA9: use CFI driver (and remove the old one)
   VCMA9: various cleanups/code style fixes

Igor Grinberg (1):
   arm: omap2: apollon: fix broken build

John Rigby (1):
   OMAP[34]: fix broken timer

Matthias Weisser (1):
   arm: Update jadecpu board

Tom Warren (2):
   GPIO: Tegra2: add GPIO driver for Tegra2
   arm: Tegra2: GPIO: enable GPIO for Tegra2 boards

More to follow.

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


Re: [U-Boot] Removal of generated asm-offsets.s/h

2011-06-29 Thread Matthias Weisser
Hi Stefano

Am 29.06.2011 17:48, schrieb Stefano Babic:
> Hi Matthias,
> 
>>> In message<4e0b3331.9030...@arcor.de>  you wrote:

 If a soc automatically generates asm-offsets.s/h in its makefile it
 isn't removed by a make clean or make distclean. See mx35 as an example.
 Even adding a clean: target to the SoCs makefile doesn't help. What
 would be the right way to remove these files with make clean?
>>>
>>> Add it to the list of files to remove in the top level Makefile?
>>
>> Well, thats is not that easy. The generated asm-offsets.h file ends up 
>> in arch/arm/include/asm/arch-mx35/ after a "make mx35pdk_config" "make" 
>> "make distclean" run. It is generated to include/asm/arch/ in the SoCs 
>> makefile so I don't understand why it ends up in 
>> arch/arm/include/asm/arch-mx35/
> 
> There is an explicit rule in arch/arm/cpu/arm1136/mx35/Makefile. It
> seems to me the right place to put the generated file. It is an include
> header, and it should be the include directory for the desired soc, in
> this case arch/arm/include/asm/arch-mx35/

If I look into that Makefile I observe the following rule

$(TOPDIR)/include/asm/arch/asm-offsets.h:

And this rule should put the generated header file into
include/asm/arch/ which is completly removed by a "make clean". But it
ends up in arch/arm/include/asm/arch-mx35/ also. That puzzled me a bit
but I must admit that I am not an expert in the u-boot makefile structure.

>> I don't think it makes sense to add a entry for each SoC using auto 
>> generated asm-offset files to the top level makefile. Same goes for the 
>> .s file as we shouldn't remove all .s files in the tree.
> 
> Is it not enough to add the following lines to the central Makefile, as
> suggested by Wolfgang:
> 
>@rm -f arch/$(ARCH)/include/asm/arch-$(SOC)/asm-offsets.h

This will remove the handwritten asm-offsets.h files which are used in
arm/mb86r0x, arm/mx27, arm-mx5 and powerpc/mpc512x. I can change mb86r0x
to auto generate the file as I am the maintainer of this SoC. I can also
change the other ARM based SoCs but the PowerPC stuff is out of my focus.

>@rm -f $(CPUDIR)/$(SOC)/asm-offsets.s

Thats perfect for the generated .s file. I will use this if we find a
solution for the .h file in a patch.

> The files are removed, as I now tested.
> And we do not need to add an entry for each CPU/SOC...

See my comments above.

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


Re: [U-Boot] [PATCH] arm: Update jadecpu board

2011-06-29 Thread Albert ARIBAUD
Hi Matthias,

Le 29/06/2011 14:08, Matthias Weisser a écrit :
> Enable dcache and arch memset/memcpy for speed reasons
> Remove of config.mk and some environment overwrites
> Some generic cleanup
>
> Signed-off-by: Matthias Weisser
> ---
>   board/syteco/jadecpu/config.mk |1 -
>   board/syteco/jadecpu/jadecpu.c |5 +
>   include/configs/jadecpu.h  |   24 +++-
>   3 files changed, 16 insertions(+), 14 deletions(-)
>   delete mode 100644 board/syteco/jadecpu/config.mk

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

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


Re: [U-Boot] [PATCH 1/2] ext2: Fix checkpatch violations

2011-06-29 Thread Anton Staaf
Ack, you're right, I didn't mean to include the printf changes.  Sorry about
that, I will be more careful with the next patches.  Would it be best to
leave this patch as it is or split it up for the next version (if there is
one)?

Thanks,
Anton

On Wed, Jun 29, 2011 at 5:13 AM, Detlev Zundel  wrote:

> Hi Anton,
>
> > Fix all checkpatch violations in the low level Ext2 block
> > device reading code.  This is done in preparation for cleaning
> > up the partial sector access code.
> >
> > Signed-off-by: Anton Staaf 
> > Cc: Andy Fleming 
> > ---
> >  fs/ext2/dev.c |   82
> ++---
> >  1 files changed, 43 insertions(+), 39 deletions(-)
> >
> > diff --git a/fs/ext2/dev.c b/fs/ext2/dev.c
> > index 3b49650..4365b3b 100644
> > --- a/fs/ext2/dev.c
> > +++ b/fs/ext2/dev.c
> > @@ -31,7 +31,7 @@
> >  static block_dev_desc_t *ext2fs_block_dev_desc;
> >  static disk_partition_t part_info;
> >
> > -int ext2fs_set_blk_dev (block_dev_desc_t * rbdd, int part)
> > +int ext2fs_set_blk_dev(block_dev_desc_t *rbdd, int part)
> >  {
> >   ext2fs_block_dev_desc = rbdd;
> >
> > @@ -46,51 +46,55 @@ int ext2fs_set_blk_dev (block_dev_desc_t * rbdd, int
> part)
> >   return 0;
> >   }
> >   }
> > - return (part_info.size);
> > + return part_info.size;
> >  }
> >
> >
> > -int ext2fs_devread (int sector, int byte_offset, int byte_len, char
> *buf) {
> > +int ext2fs_devread(int sector, int byte_offset, int byte_len, char *buf)
> > +{
> >   char sec_buf[SECTOR_SIZE];
> >   unsigned block_len;
> >
> > -/*
> > - *  Check partition boundaries
> > - */
> > - if ((sector < 0)
> > - || ((sector + ((byte_offset + byte_len - 1) >> SECTOR_BITS)) >=
> > + /*
> > +  *  Check partition boundaries
> > +  */
> > + if ((sector < 0) ||
> > + ((sector + ((byte_offset + byte_len - 1) >> SECTOR_BITS)) >=
> >   part_info.size)) {
> > - /*  errnum = ERR_OUTSIDE_PART; */
> > - printf (" ** ext2fs_devread() read outside partition sector
> %d\n", sector);
> > - return (0);
> > + /* errnum = ERR_OUTSIDE_PART; */
> > + printf(" ** %s read outside partition sector %d\n",
> > +__func__,
> > +sector);
> > + return 0;
> >   }
> >
> > -/*
> > - *  Get the read to the beginning of a partition.
> > - */
> > + /*
> > +  *  Get the read to the beginning of a partition.
> > +  */
> >   sector += byte_offset >> SECTOR_BITS;
> >   byte_offset &= SECTOR_SIZE - 1;
> >
> > - debug (" <%d, %d, %d>\n", sector, byte_offset, byte_len);
> > + debug(" <%d, %d, %d>\n", sector, byte_offset, byte_len);
> >
> >   if (ext2fs_block_dev_desc == NULL) {
> > - printf ("** Invalid Block Device Descriptor (NULL)\n");
> > - return (0);
> > + printf(" ** %s Invalid Block Device Descriptor (NULL)\n",
> > +__func__);
> > + return 0;
>
>
> So in contrast to your commit message you actually change the format of
> the output (to the better IMHO).  It would have been better to split the
> cleanup and the changes.  Being as it is, you should at least document
> the consistency changes for the next round.
>
> Apart from that:
>
> Acked-by: Detlev Zundel 
>
> Cheers
>  Detlev
>
> --
> We support democracy, but that doesn't mean we have to support
> governments that get elected as a result of democracy.
> -- George W. Bush - March 30, 2006
> --
> DENX Software Engineering GmbH,  MD: Wolfgang Denk & Detlev Zundel
> HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: d...@denx.de
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] arm: Update jadecpu board

2011-06-29 Thread Matthias Weisser
Am 29.06.2011 19:56, schrieb Albert ARIBAUD:
> Le 29/06/2011 14:08, Matthias Weisser a écrit :
>> Enable dcache and arch memset/memcpy for speed reasons
>> Remove of config.mk and some environment overwrites
>> Some generic cleanup
>>
>> Signed-off-by: Matthias Weisser
> 
> Hi Matthias,
> 
> I assume this has been tested?

Sure. Build and runtime tested.


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


Re: [U-Boot] [PATCH] 85XX: Fix pin muxing for second USB controller

2011-06-29 Thread Kumar Gala

On Jun 27, 2011, at 1:39 AM, Felix Radensky wrote:

> On P1022/P1013 second USB controller is muxed with second
> Ethernet controller. The current code to enable second USB
> fails to properly clear pinmux bits used by ethernet. As a
> result, Linux freezes when this controller is used. This
> patch fixes the problem.
> 
> Signed-off-by: Felix Radensky 
> ---
> arch/powerpc/include/asm/immap_85xx.h |2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)

applied to 85xx

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


Re: [U-Boot] [PATCH] arm: Update jadecpu board

2011-06-29 Thread Albert ARIBAUD
Le 29/06/2011 14:08, Matthias Weisser a écrit :
> Enable dcache and arch memset/memcpy for speed reasons
> Remove of config.mk and some environment overwrites
> Some generic cleanup
>
> Signed-off-by: Matthias Weisser

Hi Matthias,

I assume this has been tested?

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


[U-Boot] [PATCH v3 3/3] arm: ca9x4_ct_vxp: enable CONFIG_BOOTP_PXE

2011-06-29 Thread Jason Hobbs
Signed-off-by: Jason Hobbs 
---
Changes for v2:
- Add armv7 architecture to VCI string

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

diff --git a/include/configs/ca9x4_ct_vxp.h b/include/configs/ca9x4_ct_vxp.h
index 7f83249..fdf9a2a 100644
--- a/include/configs/ca9x4_ct_vxp.h
+++ b/include/configs/ca9x4_ct_vxp.h
@@ -100,6 +100,11 @@
 #define CONFIG_BOOTP_GATEWAY
 #define CONFIG_BOOTP_HOSTNAME
 
+/* PXE support */
+#define CONFIG_BOOTP_PXE
+#define CONFIG_BOOTP_PXE_CLIENTARCH0x100
+#define CONFIG_BOOTP_VCI_STRING"U-boot.armv7.ca9x4_ct_vxp"
+
 /* Miscellaneous configurable options */
 #undef CONFIG_SYS_CLKS_IN_HZ
 #define CONFIG_SYS_LOAD_ADDR   0x60008000  /* load address */
-- 
1.7.0.4

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


[U-Boot] [PATCH v3 1/3] lib: add uuid_str_to_bin for use with bootp and PXE uuid

2011-06-29 Thread Jason Hobbs
Signed-off-by: Jason Hobbs 
---
Changes for v2:
- Move uuid_str_to_bin's prototype from uuid. to common.h
- Place uuid.o make rule in sorted order and conditionalize

Changes for v3:
- Check for NULL pointers in uuid conversion function

 include/common.h |3 +++
 lib/Makefile |1 +
 lib/uuid.c   |   53 +
 3 files changed, 57 insertions(+), 0 deletions(-)
 create mode 100644 lib/uuid.c

diff --git a/include/common.h b/include/common.h
index 1e21b7a..77c27a1 100644
--- a/include/common.h
+++ b/include/common.h
@@ -645,6 +645,9 @@ int strcmp_compar(const void *, const void *);
 /* lib/time.c */
 void   udelay(unsigned long);
 
+/* lib/uuid.c */
+void uuid_str_to_bin(const char *uuid, unsigned char *out);
+
 /* lib/vsprintf.c */
 ulong  simple_strtoul(const char *cp,char **endp,unsigned int base);
 int strict_strtoul(const char *cp, unsigned int base, unsigned long *res);
diff --git a/lib/Makefile b/lib/Makefile
index afa6914..a8e0920 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -51,6 +51,7 @@ COBJS-$(CONFIG_SHA256) += sha256.o
 COBJS-y += string.o
 COBJS-y+= strmhz.o
 COBJS-y += time.o
+COBJS-$(CONFIG_BOOTP_PXE) += uuid.o
 COBJS-y += vsprintf.o
 COBJS-$(CONFIG_RBTREE) += rbtree.o
 
diff --git a/lib/uuid.c b/lib/uuid.c
new file mode 100644
index 000..2270245
--- /dev/null
+++ b/lib/uuid.c
@@ -0,0 +1,53 @@
+/*
+ * Copyright 2011 Calxeda, Inc.
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include "common.h"
+
+/*
+ * 0914   19   24
+ * ----
+ *le le   le   be   be
+ */
+void uuid_str_to_bin(const char *uuid, unsigned char *out)
+{
+   uint16_t tmp16;
+   uint32_t tmp32;
+   uint64_t tmp64;
+
+   if (!uuid || !out)
+   return;
+
+   tmp32 = cpu_to_le32(simple_strtoul(uuid, NULL, 16));
+   memcpy(out, &tmp32, 4);
+
+   tmp16 = cpu_to_le16(simple_strtoul(uuid + 9, NULL, 16));
+   memcpy(out + 4, &tmp16, 2);
+
+   tmp16 = cpu_to_le16(simple_strtoul(uuid + 14, NULL, 16));
+   memcpy(out + 6, &tmp16, 2);
+
+   tmp16 = cpu_to_be16(simple_strtoul(uuid + 19, NULL, 16));
+   memcpy(out + 8, &tmp16, 2);
+
+   tmp64 = cpu_to_be64(simple_strtoull(uuid + 24, NULL, 16));
+   memcpy(out + 10, (char *)&tmp64 + 2, 6);
+}
-- 
1.7.0.4

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


[U-Boot] [PATCH v3 2/3] net: bootp: add PXE/RFC 4578 DHCP options support

2011-06-29 Thread Jason Hobbs
These options are required to be present in RFC 4578 compliant DHCP
requests. They give more information to DHCP servers to allow serving
different DHCP responses to different systems based on client
architecture, client capabilities, UUID, or vendor.

Signed-off-by: Jason Hobbs 
---
Changes for v2:
- Use common.h to get uuid_str_to_bin prototype

 net/bootp.c |   36 
 1 files changed, 36 insertions(+), 0 deletions(-)

diff --git a/net/bootp.c b/net/bootp.c
index 4db63cb..06ff598 100644
--- a/net/bootp.c
+++ b/net/bootp.c
@@ -360,6 +360,11 @@ static int DhcpExtended (u8 * e, int message_type, 
IPaddr_t ServerID, IPaddr_t R
 {
u8 *start = e;
u8 *cnt;
+#if defined(CONFIG_BOOTP_PXE)
+   char *uuid;
+   size_t vci_strlen;
+   u16 clientarch;
+#endif
 
 #if defined(CONFIG_BOOTP_VENDOREX)
u8 *x;
@@ -414,6 +419,37 @@ static int DhcpExtended (u8 * e, int message_type, 
IPaddr_t ServerID, IPaddr_t R
}
 #endif
 
+#if defined(CONFIG_BOOTP_PXE)
+   clientarch = CONFIG_BOOTP_PXE_CLIENTARCH;
+   *e++ = 93;  /* Client System Architecture */
+   *e++ = 2;
+   *e++ = (clientarch >> 8) & 0xff;
+   *e++ = clientarch & 0xff;
+
+   *e++ = 94;  /* Client Network Interface Identifier */
+   *e++ = 3;
+   *e++ = 1;   /* type field for UNDI */
+   *e++ = 0;   /* major revision */
+   *e++ = 0;   /* minor revision */
+
+   uuid = getenv("pxeuuid");
+
+   if (uuid) {
+   *e++ = 97;  /* Client Machine Identifier */
+   *e++ = 17;
+   *e++ = 0;   /* type 0 - UUID */
+
+   uuid_str_to_bin(uuid, e);
+   e += 16;
+   }
+
+   *e++ = 60;  /* Vendor Class Identifier */
+   vci_strlen = strlen(CONFIG_BOOTP_VCI_STRING);
+   *e++ = vci_strlen;
+   memcpy(e, CONFIG_BOOTP_VCI_STRING, vci_strlen);
+   e += vci_strlen;
+#endif
+
 #if defined(CONFIG_BOOTP_VENDOREX)
if ((x = dhcp_vendorex_prep (e)))
return x - start;
-- 
1.7.0.4

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


[U-Boot] [PATCH v3 0/3] Support for PXE options in DHCP requests

2011-06-29 Thread Jason Hobbs
This patch series adds support for RFC 4578 compliant DHCP request
options, which enhance the ability of DHCP servers to respond
differently to different clients.

As an example, the last patch in this series enables support for the PXE
DHCP options for the ca9x4_ct_vxp config.

changes in v2:
 - drop uuid.h in favor of common.h
 - alphabetical order for build targets

changes in v3:
  - add checks for NULL pointers in uuid conversion function

Jason Hobbs (3):
  lib: add uuid_str_to_bin for use with bootp and PXE uuid
  net: bootp: add PXE/RFC 4578 DHCP options support
  arm: ca9x4_ct_vxp: enable CONFIG_BOOTP_PXE

 include/common.h   |3 ++
 include/configs/ca9x4_ct_vxp.h |5 
 lib/Makefile   |1 +
 lib/uuid.c |   53 
 net/bootp.c|   36 +++
 5 files changed, 98 insertions(+), 0 deletions(-)
 create mode 100644 lib/uuid.c

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


[U-Boot] [PATCH v3 6/7] Add pxecfg command

2011-06-29 Thread Jason Hobbs
Add pxecfg command, which is intended to mimic PXELINUX functionality.
'pxecfg get' uses tftp to retrieve a file based on UUID, MAC address or
IP address. 'pxecfg boot' interprets the contents of PXELINUX config
like file to boot using a specific initrd, kernel and kernel command
line.

This patch also adds a README.pxecfg file - see it for more details on
the pxecfg command.

Signed-off-by: Jason Hobbs 
---
changes in v2:
- call abortboot directly instead of via a wrapper
- change the license to GPLv2+
- cleanup brace usage in multiline statements, conditionals
- allow bootfile to not exist, or to be a standalone filename
- try to clarify what's going on with get_relfile
- try cfg paths one by one instead of building an array
- refactor getenv/printfs to a new from_env function
- use the new generic menu code instead of that being integrated
- drop the ifdef from do_tftp in common.h
- use a clearer comment wrt to localcmd dup
- default to no timeout

changes in v3:
- use GPLv2+ license for the readme
- parse and create menu in separate steps
- adapt to menu interface changes

 common/Makefile |1 +
 common/cmd_pxecfg.c |  991 +++
 doc/README.pxecfg   |  239 +
 include/common.h|3 +
 4 files changed, 1234 insertions(+), 0 deletions(-)
 create mode 100644 common/cmd_pxecfg.c
 create mode 100644 doc/README.pxecfg

diff --git a/common/Makefile b/common/Makefile
index d5bd983..6a56f9f 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -136,6 +136,7 @@ COBJS-$(CONFIG_CMD_PCI) += cmd_pci.o
 endif
 COBJS-y += cmd_pcmcia.o
 COBJS-$(CONFIG_CMD_PORTIO) += cmd_portio.o
+COBJS-$(CONFIG_CMD_PXECFG) += cmd_pxecfg.o
 COBJS-$(CONFIG_CMD_REGINFO) += cmd_reginfo.o
 COBJS-$(CONFIG_CMD_REISER) += cmd_reiser.o
 COBJS-$(CONFIG_CMD_SATA) += cmd_sata.o
diff --git a/common/cmd_pxecfg.c b/common/cmd_pxecfg.c
new file mode 100644
index 000..b34ac39
--- /dev/null
+++ b/common/cmd_pxecfg.c
@@ -0,0 +1,991 @@
+/*
+ * Copyright 2010-2011 Calxeda, Inc.
+ *
+ * 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 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, see .
+ */
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "menu.h"
+
+#define MAX_TFTP_PATH_LEN 127
+
+static char *from_env(char *envvar)
+{
+   char *ret;
+
+   ret = getenv(envvar);
+
+   if (!ret)
+   printf("missing environment variable: %s\n", envvar);
+
+   return ret;
+}
+
+/*
+ * Returns the ethaddr environment variable formated with -'s instead of :'s
+ */
+static void format_mac_pxecfg(char **outbuf)
+{
+   char *p, *ethaddr;
+
+   *outbuf = NULL;
+
+   ethaddr = from_env("ethaddr");
+
+   if (!ethaddr)
+   return;
+
+   *outbuf = strdup(ethaddr);
+
+   if (*outbuf == NULL)
+   return;
+
+   for (p = *outbuf; *p; p++) {
+   if (*p == ':')
+   *p = '-';
+   }
+}
+
+/*
+ * Returns the directory the file specified in the bootfile env variable is
+ * in.
+ */
+static char *get_bootfile_path(void)
+{
+   char *bootfile, *bootfile_path, *last_slash;
+   size_t path_len;
+
+   bootfile = from_env("bootfile");
+
+   if (!bootfile)
+   return NULL;
+
+   last_slash = strrchr(bootfile, '/');
+
+   if (last_slash == NULL)
+   return NULL;
+
+   path_len = (last_slash - bootfile) + 1;
+
+   bootfile_path = malloc(path_len + 1);
+
+   if (bootfile_path == NULL) {
+   printf("out of memory\n");
+   return NULL;
+   }
+
+   strncpy(bootfile_path, bootfile, path_len);
+
+   bootfile_path[path_len] = '\0';
+
+   return bootfile_path;
+}
+
+/*
+ * As in pxelinux, paths to files in pxecfg files are relative to the location
+ * of bootfile. get_relfile takes a path from a pxecfg file and joins it with
+ * the bootfile path to get the full path to the target file.
+ */
+static int get_relfile(char *file_path, void *file_addr)
+{
+   char *bootfile_path;
+   size_t path_len;
+   char relfile[MAX_TFTP_PATH_LEN+1];
+   char addr_buf[10];
+   char *tftp_argv[] = {"tftp", NULL, NULL, NULL};
+
+   bootfile_path = get_bootfile_path();
+
+   path_len = strlen(file_path);
+
+   if (bootfile_path)
+   path_len += strlen(bootfile_path);
+
+   if (path_len > MAX_TFTP_PATH_LEN) {
+  

[U-Boot] [PATCH v3 7/7] arm: ca9x4_ct_vxp: enable pxecfg support

2011-06-29 Thread Jason Hobbs
Signed-off-by: Jason Hobbs 
---
changes in v2:
- use CONFIG_MENU to enable building the menu for pxecfg use

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

diff --git a/include/configs/ca9x4_ct_vxp.h b/include/configs/ca9x4_ct_vxp.h
index 7f83249..f3d0e3f 100644
--- a/include/configs/ca9x4_ct_vxp.h
+++ b/include/configs/ca9x4_ct_vxp.h
@@ -73,6 +73,8 @@
 /* Command line configuration */
 #define CONFIG_CMD_BDI
 #define CONFIG_CMD_DHCP
+#define CONFIG_CMD_PXECFG
+#define CONFIG_MENU
 #define CONFIG_CMD_ELF
 #define CONFIG_CMD_ENV
 #define CONFIG_CMD_FLASH
@@ -136,6 +138,9 @@
"kerneladdr=0x4410\0" \
"initrdaddr=0x4480\0" \
"maxinitrd=0x180\0" \
+   "pxecfg_ram=0x8800\0" \
+   "initrd_ram=0x6100\0" \
+   "kernel_ram=0x80008000\0" \
"console=ttyAMA0,38400n8\0" \
"dram=1024M\0" \
"root=/dev/sda1 rw\0" \
-- 
1.7.0.4

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


[U-Boot] [PATCH v3 5/7] common: add run_command2 for running simple or hush commands

2011-06-29 Thread Jason Hobbs
Signed-off-by: Jason Hobbs 
---
changes in v2:
- whitespace correction

 common/hush.c|2 +-
 common/main.c|   46 +++---
 include/common.h |1 +
 include/hush.h   |2 +-
 4 files changed, 22 insertions(+), 29 deletions(-)

diff --git a/common/hush.c b/common/hush.c
index 85a6030..940889b 100644
--- a/common/hush.c
+++ b/common/hush.c
@@ -3217,7 +3217,7 @@ int parse_stream_outer(struct in_str *inp, int flag)
 #ifndef __U_BOOT__
 static int parse_string_outer(const char *s, int flag)
 #else
-int parse_string_outer(char *s, int flag)
+int parse_string_outer(const char *s, int flag)
 #endif /* __U_BOOT__ */
 {
struct in_str input;
diff --git a/common/main.c b/common/main.c
index 489c9e9..3f19b1d 100644
--- a/common/main.c
+++ b/common/main.c
@@ -333,12 +333,7 @@ void main_loop (void)
int prev = disable_ctrlc(1);/* disable Control C checking */
 # endif
 
-# ifndef CONFIG_SYS_HUSH_PARSER
-   run_command (p, 0);
-# else
-   parse_string_outer(p, FLAG_PARSE_SEMICOLON |
-   FLAG_EXIT_FROM_LOOP);
-# endif
+   run_command2(p, 0);
 
 # ifdef CONFIG_AUTOBOOT_KEYED
disable_ctrlc(prev);/* restore Control C checking */
@@ -383,12 +378,7 @@ void main_loop (void)
int prev = disable_ctrlc(1);/* disable Control C checking */
 # endif
 
-# ifndef CONFIG_SYS_HUSH_PARSER
-   run_command (s, 0);
-# else
-   parse_string_outer(s, FLAG_PARSE_SEMICOLON |
-   FLAG_EXIT_FROM_LOOP);
-# endif
+   run_command2(s, 0);
 
 # ifdef CONFIG_AUTOBOOT_KEYED
disable_ctrlc(prev);/* restore Control C checking */
@@ -398,14 +388,8 @@ void main_loop (void)
 # ifdef CONFIG_MENUKEY
if (menukey == CONFIG_MENUKEY) {
s = getenv("menucmd");
-   if (s) {
-# ifndef CONFIG_SYS_HUSH_PARSER
-   run_command(s, 0);
-# else
-   parse_string_outer(s, FLAG_PARSE_SEMICOLON |
-   FLAG_EXIT_FROM_LOOP);
-# endif
-   }
+   if (s)
+   run_command2(s, 0);
}
 #endif /* CONFIG_MENUKEY */
 #endif /* CONFIG_BOOTDELAY */
@@ -1387,6 +1371,19 @@ int run_command (const char *cmd, int flag)
return rc ? rc : repeatable;
 }
 
+int run_command2(const char *cmd, int flag)
+{
+#ifndef CONFIG_SYS_HUSH_PARSER
+   if (run_command(cmd, flag) == -1)
+   return 1;
+#else
+   if (parse_string_outer(cmd,
+   FLAG_PARSE_SEMICOLON | FLAG_EXIT_FROM_LOOP) != 0)
+   return 1;
+#endif
+   return 0;
+}
+
 //
 
 #if defined(CONFIG_CMD_RUN)
@@ -1404,14 +1401,9 @@ int do_run (cmd_tbl_t * cmdtp, int flag, int argc, char 
* const argv[])
printf ("## Error: \"%s\" not defined\n", argv[i]);
return 1;
}
-#ifndef CONFIG_SYS_HUSH_PARSER
-   if (run_command (arg, flag) == -1)
-   return 1;
-#else
-   if (parse_string_outer(arg,
-   FLAG_PARSE_SEMICOLON | FLAG_EXIT_FROM_LOOP) != 0)
+
+   if (run_command2(arg, flag) != 0)
return 1;
-#endif
}
return 0;
 }
diff --git a/include/common.h b/include/common.h
index 394a005..bd2c1a0 100644
--- a/include/common.h
+++ b/include/common.h
@@ -228,6 +228,7 @@ int print_buffer (ulong addr, void* data, uint width, uint 
count, uint linelen);
 /* common/main.c */
 void   main_loop   (void);
 intrun_command (const char *cmd, int flag);
+intrun_command2(const char *cmd, int flag);
 intreadline(const char *const prompt);
 intreadline_into_buffer(const char *const prompt, char * buffer);
 intparse_line (char *, char *[]);
diff --git a/include/hush.h b/include/hush.h
index 5c566cc..ecf9222 100644
--- a/include/hush.h
+++ b/include/hush.h
@@ -29,7 +29,7 @@
 #define FLAG_REPARSING   (1 << 2)/* >=2nd pass */
 
 extern int u_boot_hush_start(void);
-extern int parse_string_outer(char *, int);
+extern int parse_string_outer(const char *, int);
 extern int parse_file_outer(void);
 
 int set_local_var(const char *s, int flg_export);
-- 
1.7.0.4

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


[U-Boot] [PATCH v3 3/7] common, menu: use abortboot for menu timeout

2011-06-29 Thread Jason Hobbs
Signed-off-by: Jason Hobbs 
---
changes in v2:
- expose abortboot externally instead of using a wrapper
- expose abortboot externally when CONFIG_MENU is set

changes in v3:
- simplify the conditional export of abortboot
- add timeout support for the menu in this patch
- add doc for timeout feature

 common/main.c|   10 --
 common/menu.c|   17 +++--
 doc/README.menu  |   25 ++---
 include/common.h |3 +++
 include/menu.h   |2 +-
 5 files changed, 41 insertions(+), 16 deletions(-)

diff --git a/common/main.c b/common/main.c
index 01931a1..1a371b1 100644
--- a/common/main.c
+++ b/common/main.c
@@ -87,7 +87,10 @@ extern void mdm_init(void); /* defined in board.c */
  */
 #if defined(CONFIG_BOOTDELAY) && (CONFIG_BOOTDELAY >= 0)
 # if defined(CONFIG_AUTOBOOT_KEYED)
-static inline int abortboot(int bootdelay)
+#ifndef CONFIG_MENU
+static inline
+#endif
+int abortboot(int bootdelay)
 {
int abort = 0;
uint64_t etime = endtick(bootdelay);
@@ -201,7 +204,10 @@ static inline int abortboot(int bootdelay)
 static int menukey = 0;
 #endif
 
-static inline int abortboot(int bootdelay)
+#ifndef CONFIG_MENU
+static inline
+#endif
+int abortboot(int bootdelay)
 {
int abort = 0;
 
diff --git a/common/menu.c b/common/menu.c
index 9bcd906..507b122 100644
--- a/common/menu.c
+++ b/common/menu.c
@@ -30,6 +30,7 @@ struct menu_item {
 
 struct menu {
struct menu_item *default_item;
+   int timeout;
char *title;
int prompt;
void (*item_data_print)(void *);
@@ -113,9 +114,20 @@ static inline struct menu_item *menu_item_by_key(struct 
menu *m,
return menu_items_iter(m, menu_item_key_match, item_key);
 }
 
+static inline int menu_interrupted(struct menu *m)
+{
+   if (!m->timeout)
+   return 0;
+
+   if (abortboot(m->timeout/10))
+   return 1;
+
+   return 0;
+}
+
 static inline int menu_use_default(struct menu *m)
 {
-   return !m->prompt;
+   return !m->prompt && !menu_interrupted(m);
 }
 
 static inline int menu_default_choice(struct menu *m, void **choice)
@@ -221,7 +233,7 @@ int menu_item_add(struct menu *m, char *item_key, void 
*item_data)
return 1;
 }
 
-struct menu *menu_create(char *title, int prompt,
+struct menu *menu_create(char *title, int timeout, int prompt,
void (*item_data_print)(void *))
 {
struct menu *m;
@@ -233,6 +245,7 @@ struct menu *menu_create(char *title, int prompt,
 
m->default_item = NULL;
m->prompt = prompt;
+   m->timeout = timeout;
m->item_data_print = item_data_print;
 
if (title) {
diff --git a/doc/README.menu b/doc/README.menu
index bca44be..aa48b6f 100644
--- a/doc/README.menu
+++ b/doc/README.menu
@@ -31,7 +31,7 @@ Interfaces
 
 struct menu;
 
-struct menu *menu_create(char *title, int prompt,
+struct menu *menu_create(char *title, int timeout, int prompt,
void (*item_data_print)(void *));
 int menu_item_add(struct menu *m, char *item_key, void *item_data);
 int menu_default_set(struct menu *m, char *item_key);
@@ -44,8 +44,12 @@ menu_create() - Creates a menu handle with default settings
   the list of menu items. It will be copied to internal storage, and is
   safe to discard after passing to menu_create().
 
-  prompt - If 0, don't ask for user input. If 1, the user will be ed for
-  promptinput.
+  timeout - A delay in seconds to wait for user input. If 0, timeout is
+  disabled, and the default choice will be returned unless prompt is 1.
+
+  prompt - If 0, don't ask for user input unless there is an interrupted
+  timeout. If 1, the user will be prompted for input regardless of the
+  value of timeout.
 
   item_data_print - If not NULL, will be called for each item when
   the menu is displayed, with the pointer to the item's data passed
@@ -76,7 +80,7 @@ menu_item_add() - Adds or replaces a menu item
 
 
 menu_default_set() - Sets the default choice for the menu. This is safe
-to call more than once.
+  to call more than once.
 
   m - Points to a menu created by menu_create().
 
@@ -88,8 +92,8 @@ to call more than once.
 
 
 menu_get_choice() - Returns the user's selected menu entry, or the
-default if the menu is set to not prompt. This is safe to call more than
-once.
+  default if the menu is set to not prompt or the timeout expires.
+  This is safe to call more than once.
 
   m - Points to a menu created by menu_create().
 
@@ -97,9 +101,9 @@ once.
   selected menu item. If no item is selected or there is an error, no
   value will be written at the location it points to.
 
-  Returns 1 if successful, -EINVAL if m or choice is NULL, -ENOENT if no
-  default has been set and the menu is set to not prompt, or -EINTR if
-  the user exits the menu via ctrl+c.
+  Returns 1 if successful, -EINVAL if m or choice is NULL, -ENOENT if
+  no default has been set and the menu is set to not prompt or the
+  timeout ex

[U-Boot] [PATCH v3 4/7] cosmetic, main: correct indentation/spacing issues

2011-06-29 Thread Jason Hobbs
Signed-off-by: Jason Hobbs 
---
changes in v2:
- new in v2

 common/main.c |   12 ++--
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/common/main.c b/common/main.c
index 1a371b1..489c9e9 100644
--- a/common/main.c
+++ b/common/main.c
@@ -397,15 +397,15 @@ void main_loop (void)
 
 # ifdef CONFIG_MENUKEY
if (menukey == CONFIG_MENUKEY) {
-   s = getenv("menucmd");
-   if (s) {
+   s = getenv("menucmd");
+   if (s) {
 # ifndef CONFIG_SYS_HUSH_PARSER
-   run_command (s, 0);
+   run_command(s, 0);
 # else
-   parse_string_outer(s, FLAG_PARSE_SEMICOLON |
-   FLAG_EXIT_FROM_LOOP);
+   parse_string_outer(s, FLAG_PARSE_SEMICOLON |
+   FLAG_EXIT_FROM_LOOP);
 # endif
-   }
+   }
}
 #endif /* CONFIG_MENUKEY */
 #endif /* CONFIG_BOOTDELAY */
-- 
1.7.0.4

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


[U-Boot] [PATCH v3 2/7] cosmetic, main: clean up declarations of abortboot

2011-06-29 Thread Jason Hobbs
Remove an unneeded prototype declaration from the top of main.c,
and use plain inline instead of __inline__ to please checkpatch.

Signed-off-by: Jason Hobbs 
---
changes in v3:
 - new in v3

 common/main.c |8 ++--
 1 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/common/main.c b/common/main.c
index 2730c6f..01931a1 100644
--- a/common/main.c
+++ b/common/main.c
@@ -56,10 +56,6 @@ void update_tftp (void);
 
 #define MAX_DELAY_STOP_STR 32
 
-#if defined(CONFIG_BOOTDELAY) && (CONFIG_BOOTDELAY >= 0)
-static int abortboot(int);
-#endif
-
 #undef DEBUG_PARSER
 
 charconsole_buffer[CONFIG_SYS_CBSIZE + 1]; /* console I/O buffer   
*/
@@ -91,7 +87,7 @@ extern void mdm_init(void); /* defined in board.c */
  */
 #if defined(CONFIG_BOOTDELAY) && (CONFIG_BOOTDELAY >= 0)
 # if defined(CONFIG_AUTOBOOT_KEYED)
-static __inline__ int abortboot(int bootdelay)
+static inline int abortboot(int bootdelay)
 {
int abort = 0;
uint64_t etime = endtick(bootdelay);
@@ -205,7 +201,7 @@ static __inline__ int abortboot(int bootdelay)
 static int menukey = 0;
 #endif
 
-static __inline__ int abortboot(int bootdelay)
+static inline int abortboot(int bootdelay)
 {
int abort = 0;
 
-- 
1.7.0.4

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


[U-Boot] [PATCH v3 1/7] Add generic, reusable menu code

2011-06-29 Thread Jason Hobbs
This will be used first by the pxecfg code, but is intended to be
generic and reusable for other jobs in U-boot.

Signed-off-by: Jason Hobbs 
---
changes in v2:
 - new in v2

changes in v3:
 - move timeout support to later patch
 - fix NULL case bug in menu_item_key_match
 - consistently use 'item_key' instead of 'key'
 - move default/prompt logic into menu code
 - consistently return int for error propagation
 - change option setting functions to menu_create paramaters
 - add README.menu

 common/Makefile |1 +
 common/menu.c   |  266 +++
 doc/README.menu |  158 
 include/menu.h  |   30 ++
 4 files changed, 455 insertions(+), 0 deletions(-)
 create mode 100644 common/menu.c
 create mode 100644 doc/README.menu
 create mode 100644 include/menu.h

diff --git a/common/Makefile b/common/Makefile
index 224b7cc..d5bd983 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -170,6 +170,7 @@ COBJS-$(CONFIG_CMD_KGDB) += kgdb.o kgdb_stubs.o
 COBJS-$(CONFIG_KALLSYMS) += kallsyms.o
 COBJS-$(CONFIG_LCD) += lcd.o
 COBJS-$(CONFIG_LYNXKDI) += lynxkdi.o
+COBJS-$(CONFIG_MENU) += menu.o
 COBJS-$(CONFIG_MODEM_SUPPORT) += modem.o
 COBJS-$(CONFIG_UPDATE_TFTP) += update.o
 COBJS-$(CONFIG_USB_KEYBOARD) += usb_kbd.o
diff --git a/common/menu.c b/common/menu.c
new file mode 100644
index 000..9bcd906
--- /dev/null
+++ b/common/menu.c
@@ -0,0 +1,266 @@
+/*
+ * Copyright 2010-2011 Calxeda, Inc.
+ *
+ * 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 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, see .
+ */
+
+#include 
+#include 
+#include 
+#include 
+
+#include "menu.h"
+
+struct menu_item {
+   char *key;
+   void *data;
+   struct list_head list;
+};
+
+struct menu {
+   struct menu_item *default_item;
+   char *title;
+   int prompt;
+   void (*item_data_print)(void *);
+   struct list_head items;
+};
+
+static inline void *menu_items_iter(struct menu *m,
+   void *(*callback)(struct menu *, struct menu_item *, void *),
+   void *extra)
+{
+   struct list_head *pos, *n;
+   struct menu_item *item;
+   void *ret;
+
+   list_for_each_safe(pos, n, &m->items) {
+   item = list_entry(pos, struct menu_item, list);
+
+   ret = callback(m, item, extra);
+
+   if (ret)
+   return ret;
+   }
+
+   return NULL;
+}
+
+static inline void *menu_item_print(struct menu *m,
+   struct menu_item *item,
+   void *extra)
+{
+   if (!m->item_data_print)
+   printf("%s\n", item->key);
+   else
+   m->item_data_print(item->data);
+
+   return NULL;
+}
+
+static inline void *menu_item_destroy(struct menu *m,
+   struct menu_item *item,
+   void *extra)
+{
+   if (item->key)
+   free(item->key);
+
+   free(item);
+
+   return NULL;
+}
+
+static inline void menu_display(struct menu *m)
+{
+   if (m->title)
+   printf("%s:\n", m->title);
+
+   menu_items_iter(m, menu_item_print, NULL);
+}
+
+static inline void *menu_item_key_match(struct menu *m,
+   struct menu_item *item,
+   void *extra)
+{
+   char *item_key = extra;
+
+   if (!item_key || !item->key) {
+   if (item_key == item->key)
+   return item;
+
+   return NULL;
+   }
+
+   if (strcmp(item->key, item_key) == 0)
+   return item;
+
+   return NULL;
+}
+
+static inline struct menu_item *menu_item_by_key(struct menu *m,
+   char *item_key)
+{
+   return menu_items_iter(m, menu_item_key_match, item_key);
+}
+
+static inline int menu_use_default(struct menu *m)
+{
+   return !m->prompt;
+}
+
+static inline int menu_default_choice(struct menu *m, void **choice)
+{
+   if (m->default_item) {
+   *choice = m->default_item->data;
+   return 1;
+   }
+
+   return -ENOENT;
+}
+
+static inline int menu_interactive_choice(struct menu *m, void **choice)
+{
+   char cbuf[CONFIG_SYS_CBSIZE];
+   struct menu_item *choice_item = NULL;
+   int readret;
+
+   while (!choice_item) {
+   cbuf[0] = '\0';
+
+ 

[U-Boot] [PATCH v3 0/7] Add support for pxecfg commands

2011-06-29 Thread Jason Hobbs
The pxecfg commands provide a near subset of the functionality provided
by the PXELINUX boot loader. This allows U-boot based systems to be
controlled remotely using the same PXE based techniques that many non
U-boot based servers use. To avoid identity confusion with PXELINUX, and
because not all behavior is identical, we call this feature 'pxecfg'.

As an example, support for the pxecfg commands is enabled for the
ca9x4_ct_vxp config.

Additional details are available in the README file added as part of
this patch series.

v2 of this patch series separates the menu code from the pxecfg code,
giving a reusable menu implementation. It also contains various smaller
changes documented in the comment section of the patches.

v3 of this patch series adds a README for the menu, improves the
menu interface, and includes other smaller changes documented
in the comment section of the patches.  The order of patches also
changes, with all of the menu support being added first, followed by
the pxecfg specific patches.

Jason Hobbs (7):
  Add generic, reusable menu code
  cosmetic, main: clean up declarations of abortboot
  common, menu: use abortboot for menu timeout
  cosmetic, main: correct indentation/spacing issues
  common: add run_command2 for running simple or hush commands
  Add pxecfg command
  arm: ca9x4_ct_vxp: enable pxecfg support

 common/Makefile|2 +
 common/cmd_pxecfg.c|  991 
 common/hush.c  |2 +-
 common/main.c  |   62 ++--
 common/menu.c  |  279 +++
 doc/README.menu|  161 +++
 doc/README.pxecfg  |  239 ++
 include/common.h   |7 +
 include/configs/ca9x4_ct_vxp.h |5 +
 include/hush.h |2 +-
 include/menu.h |   30 ++
 11 files changed, 1744 insertions(+), 36 deletions(-)
 create mode 100644 common/cmd_pxecfg.c
 create mode 100644 common/menu.c
 create mode 100644 doc/README.menu
 create mode 100644 doc/README.pxecfg
 create mode 100644 include/menu.h

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


Re: [U-Boot] Removal of generated asm-offsets.s/h

2011-06-29 Thread Stefano Babic
On 06/29/2011 05:00 PM, Matthias Weißer wrote:
> Am 29.06.2011 16:20, schrieb Wolfgang Denk:
>> Dear =?ISO-8859-15?Q?Matthias_Wei=DFer?=,
>>

Hi Matthias,

>> In message<4e0b3331.9030...@arcor.de>  you wrote:
>>>
>>> If a soc automatically generates asm-offsets.s/h in its makefile it
>>> isn't removed by a make clean or make distclean. See mx35 as an example.
>>> Even adding a clean: target to the SoCs makefile doesn't help. What
>>> would be the right way to remove these files with make clean?
>>
>> Add it to the list of files to remove in the top level Makefile?
> 
> Well, thats is not that easy. The generated asm-offsets.h file ends up 
> in arch/arm/include/asm/arch-mx35/ after a "make mx35pdk_config" "make" 
> "make distclean" run. It is generated to include/asm/arch/ in the SoCs 
> makefile so I don't understand why it ends up in 
> arch/arm/include/asm/arch-mx35/

There is an explicit rule in arch/arm/cpu/arm1136/mx35/Makefile. It
seems to me the right place to put the generated file. It is an include
header, and it should be the include directory for the desired soc, in
this case arch/arm/include/asm/arch-mx35/

> 
> I don't think it makes sense to add a entry for each SoC using auto 
> generated asm-offset files to the top level makefile. Same goes for the 
> .s file as we shouldn't remove all .s files in the tree.

Is it not enough to add the following lines to the central Makefile, as
suggested by Wolfgang:

   @rm -f arch/$(ARCH)/include/asm/arch-$(SOC)/asm-offsets.h
   @rm -f $(CPUDIR)/$(SOC)/asm-offsets.s

The files are removed, as I now tested.
And we do not need to add an entry for each CPU/SOC...

Best regards,
Stefano Babic

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


Re: [U-Boot] Removal of generated asm-offsets.s/h

2011-06-29 Thread Matthias Weißer
Am 29.06.2011 16:20, schrieb Wolfgang Denk:
> Dear =?ISO-8859-15?Q?Matthias_Wei=DFer?=,
>
> In message<4e0b3331.9030...@arcor.de>  you wrote:
>>
>> If a soc automatically generates asm-offsets.s/h in its makefile it
>> isn't removed by a make clean or make distclean. See mx35 as an example.
>> Even adding a clean: target to the SoCs makefile doesn't help. What
>> would be the right way to remove these files with make clean?
>
> Add it to the list of files to remove in the top level Makefile?

Well, thats is not that easy. The generated asm-offsets.h file ends up 
in arch/arm/include/asm/arch-mx35/ after a "make mx35pdk_config" "make" 
"make distclean" run. It is generated to include/asm/arch/ in the SoCs 
makefile so I don't understand why it ends up in 
arch/arm/include/asm/arch-mx35/

I don't think it makes sense to add a entry for each SoC using auto 
generated asm-offset files to the top level makefile. Same goes for the 
.s file as we shouldn't remove all .s files in the tree.

Matthias



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


Re: [U-Boot] Removal of generated asm-offsets.s/h

2011-06-29 Thread Wolfgang Denk
Dear =?ISO-8859-15?Q?Matthias_Wei=DFer?=,

In message <4e0b3331.9030...@arcor.de> you wrote:
> 
> If a soc automatically generates asm-offsets.s/h in its makefile it
> isn't removed by a make clean or make distclean. See mx35 as an example.
> Even adding a clean: target to the SoCs makefile doesn't help. What
> would be the right way to remove these files with make clean?

Add it to the list of files to remove in the top level Makefile?

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
1 1 was a race-horse, 2 2 was 1 2. When 1 1 1 1 race, 2 2 1 1 2.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] request for some debugging hints

2011-06-29 Thread Christopher Harvey
On 06/29/11 08:55, Christopher Harvey wrote:
> kernel version: 2.6.38
> u-boot version: 2011.06
> 
> I've got an ARM (armv7) kernel that I can boot under QEMU without
> problems, but refuses to boot with a bootm command under u-boot.
> 
> All I see is "Uncompressing Linux... done, booting the kernel.", then
> nothing else.
> 
> I'm also hitting a bug very similar to the following with gdb, so I'm
> having a hard time figuring out exactly which lines are blocking the
> kernel.
> http://sourceware.org/ml/gdb-patches/2011-02/msg00048.html
> but that patch doesn't fix it in my case.
> 
> Basically I was hoping for some hints in case somebody here has already
> dealt with a similar problem and could provide some tips to help me
> figure out how to spend my debugging time.
> 
> I was under the impression that the second a working kernel got passed
> the "Uncompressing Linux... done, booting the kernel." point there was
> very little that could go wrong since it means the kernel was completely
> loaded into memory and the entry point was picked properly.
> 
> The kernel is a very standard kernel, and uboot is a very minimal uboot
> build with no extra soc or board initializations besides memory size.
> eg:
> lowlevel_init is blank
> reset_cpu is an infinite loop
> timers aren't used
> 
> any hints or ideas appreciated,
> Chris

Turns out I wasn't passing the machine ID or the initrd values to the r1
and r2 registers.

using a standard board_init function fixed it.

I've been learning and working on u-boot on and off for 2 weeks and
solved it literally an hour or two after asking this question. It's
amazing how often that happens.

U-Boot is working great now.

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


[U-Boot] Removal of generated asm-offsets.s/h

2011-06-29 Thread Matthias Weißer
Hi

If a soc automatically generates asm-offsets.s/h in its makefile it 
isn't removed by a make clean or make distclean. See mx35 as an example. 
Even adding a clean: target to the SoCs makefile doesn't help. What 
would be the right way to remove these files with make clean?


Regards
Matthias Weißer
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] request for some debugging hints

2011-06-29 Thread Chander Kashyap
Dear Christopher Harvey,
One thought.. Just check you are using correct serial port as console.


On 29 June 2011 18:25, Christopher Harvey  wrote:
> kernel version: 2.6.38
> u-boot version: 2011.06
>
> I've got an ARM (armv7) kernel that I can boot under QEMU without
> problems, but refuses to boot with a bootm command under u-boot.
>
> All I see is "Uncompressing Linux... done, booting the kernel.", then
> nothing else.
>
> I'm also hitting a bug very similar to the following with gdb, so I'm
> having a hard time figuring out exactly which lines are blocking the
> kernel.
> http://sourceware.org/ml/gdb-patches/2011-02/msg00048.html
> but that patch doesn't fix it in my case.
>
> Basically I was hoping for some hints in case somebody here has already
> dealt with a similar problem and could provide some tips to help me
> figure out how to spend my debugging time.
>
> I was under the impression that the second a working kernel got passed
> the "Uncompressing Linux... done, booting the kernel." point there was
> very little that could go wrong since it means the kernel was completely
> loaded into memory and the entry point was picked properly.
>
> The kernel is a very standard kernel, and uboot is a very minimal uboot
> build with no extra soc or board initializations besides memory size.
> eg:
> lowlevel_init is blank
> reset_cpu is an infinite loop
> timers aren't used
>
> any hints or ideas appreciated,
> Chris
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>



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


Re: [U-Boot] request for some debugging hints

2011-06-29 Thread Wolfgang Denk
Dear Christopher Harvey,

In message <4e0b20d0.4070...@matrox.com> you wrote:
>
> I was under the impression that the second a working kernel got passed
> the "Uncompressing Linux... done, booting the kernel." point there was
> very little that could go wrong since it means the kernel was completely
> loaded into memory and the entry point was picked properly.

You are perfectly right and totally wrong.

Yes, you are right: when reaching this point there is not much left
that can go wrong - in U-Boot, that is.

But of course there is a million things that can go wrong in Linux,
and it appears you are running onto one of these.

> The kernel is a very standard kernel, and uboot is a very minimal uboot
> build with no extra soc or board initializations besides memory size.
> eg:
> lowlevel_init is blank
> reset_cpu is an infinite loop
> timers aren't used

May I suggest to run a standard U-Boot version instead, which includes
all the necessary initialization?

You don't mention a board name, so I guess all your code is not
available in mainline?

Best regards,

Wolfgang Denk

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


[U-Boot] [RFC PATCH 7/7] omap4: adapt Makefile for spl building

2011-06-29 Thread Aneesh V
Signed-off-by: Aneesh V 
---
 arch/arm/cpu/armv7/omap4/Makefile |   12 ++--
 include/configs/omap4_sdp4430.h   |8 
 2 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/arch/arm/cpu/armv7/omap4/Makefile 
b/arch/arm/cpu/armv7/omap4/Makefile
index 987dc9d..f28eb37 100644
--- a/arch/arm/cpu/armv7/omap4/Makefile
+++ b/arch/arm/cpu/armv7/omap4/Makefile
@@ -25,14 +25,14 @@ include $(TOPDIR)/config.mk
 
 LIB=  $(obj)lib$(SOC).o
 
-SOBJS  += lowlevel_init.o
+SOBJS-y+= lowlevel_init.o
 
-COBJS  += board.o
-COBJS  += mem.o
-COBJS  += sys_info.o
+COBJS-y:= board.o
+COBJS-$(CONFIG_NORMAL_UBOOT)   += mem.o
+COBJS-$(CONFIG_NORMAL_UBOOT)   += sys_info.o
 
-SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS   := $(addprefix $(obj),$(COBJS) $(SOBJS))
+SRCS   := $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS-y) $(SOBJS-y))
 
 all:$(obj).depend $(LIB)
 
diff --git a/include/configs/omap4_sdp4430.h b/include/configs/omap4_sdp4430.h
index 584a52b..0af8e45 100644
--- a/include/configs/omap4_sdp4430.h
+++ b/include/configs/omap4_sdp4430.h
@@ -241,4 +241,12 @@
 CONFIG_SYS_INIT_RAM_SIZE - \
 GENERATED_GBL_DATA_SIZE)
 
+#define CONFIG_UBOOT_SPL
+#define CONFIG_SYS_SPL_LDSCRIPT
"arch/arm/cpu/armv7/omap-common/spl.lds"
+#define CONFIG_SYS_SPL_TEXT_BASE   0x40304350
+#define CONFIG_SYS_SPL_MAX_SIZE0x7800  /* 30 K */
+#define CONFIG_SYS_SPL_STACK   LOW_LEVEL_SRAM_STACK
+
+#define CONFIG_SYS_SPL_BSS_START_ADDR  0x8000
+#define CONFIG_SYS_SPL_BSS_MAX_SIZE0x8 /* 512 KB */
 #endif /* __CONFIG_H */
-- 
1.7.0.4

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


[U-Boot] [RFC PATCH 6/7] omap: common spl support for OMAP3/4

2011-06-29 Thread Aneesh V
Signed-off-by: Aneesh V 
---
 arch/arm/cpu/armv7/omap-common/Makefile |9 ++--
 arch/arm/cpu/armv7/omap-common/spl.c|   56 
 arch/arm/cpu/armv7/omap-common/spl.lds  |   62 +++
 3 files changed, 123 insertions(+), 4 deletions(-)
 create mode 100644 arch/arm/cpu/armv7/omap-common/spl.c
 create mode 100644 arch/arm/cpu/armv7/omap-common/spl.lds

diff --git a/arch/arm/cpu/armv7/omap-common/Makefile 
b/arch/arm/cpu/armv7/omap-common/Makefile
index dc01ee5..7931303 100644
--- a/arch/arm/cpu/armv7/omap-common/Makefile
+++ b/arch/arm/cpu/armv7/omap-common/Makefile
@@ -25,12 +25,13 @@ include $(TOPDIR)/config.mk
 
 LIB= $(obj)libomap-common.o
 
-SOBJS  := reset.o
+SOBJS-$(CONFIG_NORMAL_UBOOT)   := reset.o
 
-COBJS  := timer.o
+COBJS-$(CONFIG_NORMAL_UBOOT)   := timer.o
+COBJS-$(CONFIG_UBOOT_SPL_BUILD):= spl.o
 
-SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
+SRCS   := $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
+OBJS   := $(addprefix $(obj),$(SOBJS-y) $(COBJS-y))
 
 all:   $(obj).depend $(LIB)
 
diff --git a/arch/arm/cpu/armv7/omap-common/spl.c 
b/arch/arm/cpu/armv7/omap-common/spl.c
new file mode 100644
index 000..b5a5f3c
--- /dev/null
+++ b/arch/arm/cpu/armv7/omap-common/spl.c
@@ -0,0 +1,56 @@
+/*
+ *
+ * Clock initialization for OMAP4
+ *
+ * (C) Copyright 2010
+ * Texas Instruments, 
+ *
+ * Aneesh V 
+ *
+ * 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 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+/* Define global data structure pointer to it*/
+gd_t gdata __attribute__ ((section(".data")));
+bd_t bdata __attribute__ ((section(".data")));
+gd_t *gd = &gdata;
+
+typedef void (*u_boot_entry_t)(void)__attribute__ ((noreturn));
+
+void board_init_f(ulong dummy)
+{
+   debug(">>board_init_f()\n");
+   relocate_code(CONFIG_SYS_SPL_STACK, &gdata, CONFIG_SYS_SPL_TEXT_BASE);
+   debug("<
+ *
+ * (C) Copyright 2010
+ * Texas Instruments, 
+ * Aneesh V 
+ *
+ * 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
+ */
+
+MEMORY { .sram : ORIGIN = CONFIG_SYS_SPL_TEXT_BASE,\
+LENGTH = CONFIG_SYS_SPL_MAX_SIZE }
+MEMORY { .sdram : ORIGIN = CONFIG_SYS_SPL_BSS_START_ADDR, \
+ LENGTH = CONFIG_SYS_SPL_BSS_MAX_SIZE }
+
+OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
+OUTPUT_ARCH(arm)
+ENTRY(_start)
+SECTIONS
+{
+   .text  :
+   {
+   __start = .;
+ arch/arm/cpu/armv7/start.o(.text)
+ *(.text*)
+   } >.sram
+
+   . = ALIGN(4);
+   .rodata : { *(SORT_BY_ALIGNMENT(.rodata*)) } >.sram
+
+   . = ALIGN(4);
+   .data : { *(SORT_BY_ALIGNMENT(.data*)) } >.sram
+   . = ALIGN(4);
+   __image_copy_end = .;
+   __flash_image_end = .;
+
+   .bss :
+   {
+   . = ALIGN(4);
+   __bss_start = .;
+   *(.bss*)
+   . = ALIGN(4);
+   _end = .;
+   } >.sdram
+}
-- 
1.7.0.4

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


[U-Boot] [RFC PATCH 5/7] armv7: adapt Makefile for spl building

2011-06-29 Thread Aneesh V
Signed-off-by: Aneesh V 
---
 arch/arm/cpu/armv7/Makefile |9 +
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/arch/arm/cpu/armv7/Makefile b/arch/arm/cpu/armv7/Makefile
index 8c0e915..549ade6 100644
--- a/arch/arm/cpu/armv7/Makefile
+++ b/arch/arm/cpu/armv7/Makefile
@@ -26,11 +26,12 @@ include $(TOPDIR)/config.mk
 LIB= $(obj)lib$(CPU).o
 
 START  := start.o
-COBJS  := cpu.o
-COBJS  += syslib.o
+COBJS-y:=
+COBJS-$(CONFIG_NORMAL_UBOOT)   += cpu.o
+COBJS-$(CONFIG_UBOOT_SPL_BUILD)+= syslib.o
 
-SRCS   := $(START:.o=.S) $(COBJS:.o=.c)
-OBJS   := $(addprefix $(obj),$(COBJS))
+SRCS   := $(START:.o=.S) $(COBJS-y:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS-y))
 START  := $(addprefix $(obj),$(START))
 
 all:   $(obj).depend $(START) $(LIB)
-- 
1.7.0.4

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


[U-Boot] [RFC PATCH 3/7] Add new folder and build system for SPL

2011-06-29 Thread Aneesh V
From: Daniel Schwierzeck 

[ane...@ti.com:
1. Changed definition of OBJTREE for SPL
2. Added support for linker script from various places
4. $(OBJTREE)/spl/obj for objects
5. Minor cleanup
]
Signed-off-by: Aneesh V 
Signed-off-by: Daniel Schwierzeck 
---
 spl/Makefile |  105 ++
 1 files changed, 105 insertions(+), 0 deletions(-)
 create mode 100644 spl/Makefile

diff --git a/spl/Makefile b/spl/Makefile
new file mode 100644
index 000..46edf2b
--- /dev/null
+++ b/spl/Makefile
@@ -0,0 +1,105 @@
+#
+# (C) Copyright 2011 Daniel Schwierzeck, daniel.schwierz...@googlemail.com.
+#
+# (C) Copyright 2011
+# Texas Instruments Incorporated - http://www.ti.com/
+# Aneesh V 
+#
+# This file is released under the terms of GPL v2 and any later version.
+# See the file COPYING in the root directory of the source tree for details.
+#
+
+CONFIG_UBOOT_SPL_BUILD = y
+export CONFIG_UBOOT_SPL_BUILD
+
+# create 'spl/obj' within OBJTREE for spl
+OBJTREE := $(OBJTREE)/spl/obj
+LNDIR  := $(OBJTREE)
+
+include $(TOPDIR)/config.mk
+# We want the final binaries in this directory
+obj:= $(obj)../
+START  = $(OBJTREE)/$(CPUDIR)/start.o
+
+LIBS-y += $(shell if [ -f $(SRCTREE)/board/$(VENDOR)/common/Makefile ]; \
+   then echo "board/$(VENDOR)/common/lib$(VENDOR).o"; fi)
+LIBS-y += board/$(BOARDDIR)/lib$(BOARD).o
+LIBS-y += $(CPUDIR)/lib$(CPU).o
+ifdef SOC
+LIBS-y += $(CPUDIR)/$(SOC)/lib$(SOC).o
+endif
+LIBS-y += arch/$(ARCH)/lib/lib$(ARCH).o
+LIBS-$(CONFIG_SPL_SPI_SUPPORT) += drivers/spi/libspi.o
+LIBS-$(CONFIG_SPL_SPI_FLASH_SUPPORT) += drivers/mtd/spi/libspi_flash.o
+LIBS-$(CONFIG_SPL_GPIO_SUPPORT) += drivers/gpio/libgpio.o
+LIBS-$(CONFIG_SPL_NAND_BOOT) += spl/nand/libnand_spl.o
+LIBS-$(CONFIG_SPL_ONENAND_BOOT) += spl/nand/libonenand_spl.o
+
+LIBS = $(addprefix $(OBJTREE)/,$(sort $(LIBS-y)))
+
+__START = $(subst $(OBJTREE)/,,$(START))
+__LIBS = $(subst $(OBJTREE)/,,$(LIBS))
+
+# Linker Script
+ifdef CONFIG_SYS_SPL_LDSCRIPT
+# need to strip off double quotes
+LDSCRIPT := $(addprefix $(SRCTREE)/,$(subst ",,$(CONFIG_SYS_SPL_LDSCRIPT)))
+endif
+
+ifeq ($(wildcard $(LDSCRIPT)),)
+   LDSCRIPT := $(TOPDIR)/$(ARCH)/$(CPU)/$(SOC)/$(BOARDDIR)/u-boot-spl.lds
+endif
+ifeq ($(wildcard $(LDSCRIPT)),)
+   LDSCRIPT := $(TOPDIR)/$(ARCH)/$(CPU)/$(SOC)/u-boot-spl.lds
+endif
+ifeq ($(wildcard $(LDSCRIPT)),)
+   LDSCRIPT := $(TOPDIR)/$(ARCH)/$(CPU)/u-boot-spl.lds
+endif
+ifeq ($(wildcard $(LDSCRIPT)),)
+$(error could not find linker script)
+endif
+
+# Special flags for CPP when processing the linker script.
+# Pass the version down so we can handle backwards compatibility
+# on the fly.
+LDPPFLAGS += \
+   -include $(TOPDIR)/include/u-boot/u-boot.lds.h \
+   -include $(TOPDIR)/include/config.h \
+   $(shell $(LD) --version | \
+ sed -ne 's/GNU ld version 
\([0-9][0-9]*\)\.\([0-9][0-9]*\).*/-DLD_MAJOR=\1 -DLD_MINOR=\2/p')
+
+ALL= $(obj)u-boot-spl.bin
+
+all:   $(ALL)
+
+$(obj)u-boot-spl.bin:  $(obj)u-boot-spl
+   $(OBJCOPY) $(OBJCFLAGS) -O binary $< $@
+
+GEN_UBOOT = \
+   UNDEF_SYM=`$(OBJDUMP) -x $(LIBS) | \
+   sed  -n -e 's/.*\($(SYM_PREFIX)__u_boot_cmd_.*\)/-u\1/p'|sort|uniq`;\
+   cd $(LNDIR) && $(LD) $(LDFLAGS) $(LDFLAGS_$(@F)) $$UNDEF_SYM $(__START) 
\
+   --start-group $(__LIBS) --end-group $(PLATFORM_LIBS) \
+   -Map u-boot-spl.map -o u-boot-spl
+
+$(obj)u-boot-spl:  depend $(START) $(LIBS) $(obj)u-boot-spl.lds
+   $(GEN_UBOOT)
+
+$(START):  depend
+   $(MAKE) -C $(SRCTREE)/$(CPUDIR) $@
+
+$(LIBS):   depend
+   $(MAKE) -C $(SRCTREE)$(dir $(subst $(OBJTREE),,$@))
+
+$(obj)u-boot-spl.lds: $(LDSCRIPT)
+   $(CPP) $(CPPFLAGS) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - < $< > $@
+
+depend:$(obj).depend
+.PHONY: depend
+
+clean:
+   # TODO: implement clean to support in-tree builds
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
-- 
1.7.0.4

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


[U-Boot] [RFC PATCH 0/7] spl framework prototype

2011-06-29 Thread Aneesh V
This is an extention of Daniel Schwierzeck's work [1]
on a new SPL framework and is intented only as a prototype to
facilitate further discussion.

Please refer [2] for an overview of this approach:

I have extended his work to make it a little more generic, did
some minor modifications and adapted it for OMAP4 as a prototype.

Appreciate your feedback. 

[1] https://github.com/danielschwierzeck/u-boot-spl/commits/spl
[2] http://marc.info/?l=u-boot&m=130823112116502&w=2

Aneesh V (3):
  armv7: adapt Makefile for spl building
  omap: common spl support for OMAP3/4
  omap4: adapt Makefile for spl building

Daniel Schwierzeck (4):
  Adapt config.mk for usage in spl/Makefile
  Use ALL-y style instead of ifeq blocks for better readability and
upgradeability
  Add new folder and build system for SPL
  Hook spl directory into main Makefile

 Makefile|   26 
 arch/arm/cpu/armv7/Makefile |9 ++-
 arch/arm/cpu/armv7/omap-common/Makefile |9 ++-
 arch/arm/cpu/armv7/omap-common/spl.c|   56 
 arch/arm/cpu/armv7/omap-common/spl.lds  |   62 ++
 arch/arm/cpu/armv7/omap4/Makefile   |   12 ++--
 config.mk   |   32 --
 include/configs/omap4_sdp4430.h |8 +++
 spl/Makefile|  105 +++
 9 files changed, 287 insertions(+), 32 deletions(-)
 create mode 100644 arch/arm/cpu/armv7/omap-common/spl.c
 create mode 100644 arch/arm/cpu/armv7/omap-common/spl.lds
 create mode 100644 spl/Makefile

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


[U-Boot] [RFC PATCH 2/7] Use ALL-y style instead of ifeq blocks for better readability and upgradeability

2011-06-29 Thread Aneesh V
From: Daniel Schwierzeck 

Signed-off-by: Daniel Schwierzeck 
---
 Makefile |   18 +-
 1 files changed, 5 insertions(+), 13 deletions(-)

diff --git a/Makefile b/Makefile
index dcf5d93..813b03b 100644
--- a/Makefile
+++ b/Makefile
@@ -311,22 +311,14 @@ BOARD_SIZE_CHECK =
 endif
 
 # Always append ALL so that arch config.mk's can add custom ones
-ALL += $(obj)u-boot.srec $(obj)u-boot.bin $(obj)System.map
+ALL-y += $(obj)u-boot.srec $(obj)u-boot.bin $(obj)System.map
 
-ifeq ($(CONFIG_NAND_U_BOOT),y)
-ALL += $(obj)u-boot-nand.bin
-endif
-
-ifeq ($(CONFIG_ONENAND_U_BOOT),y)
-ALL += $(obj)u-boot-onenand.bin
+ALL-$(CONFIG_NAND_U_BOOT) += $(obj)u-boot-nand.bin
+ALL-$(CONFIG_ONENAND_U_BOOT) += $(obj)u-boot-onenand.bin
 ONENAND_BIN ?= $(obj)onenand_ipl/onenand-ipl-2k.bin
-endif
-
-ifeq ($(CONFIG_MMC_U_BOOT),y)
-ALL += $(obj)mmc_spl/u-boot-mmc-spl.bin
-endif
+ALL-$(CONFIG_MMC_U_BOOT) += $(obj)mmc_spl/u-boot-mmc-spl.bin
 
-all:   $(ALL)
+all:   $(ALL-y)
 
 $(obj)u-boot.hex:  $(obj)u-boot
$(OBJCOPY) ${OBJCFLAGS} -O ihex $< $@
-- 
1.7.0.4

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


[U-Boot] [RFC PATCH 4/7] Hook spl directory into main Makefile

2011-06-29 Thread Aneesh V
From: Daniel Schwierzeck 

Signed-off-by: Daniel Schwierzeck 
---
 Makefile |8 
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/Makefile b/Makefile
index 813b03b..ea35b17 100644
--- a/Makefile
+++ b/Makefile
@@ -317,6 +317,7 @@ ALL-$(CONFIG_NAND_U_BOOT) += $(obj)u-boot-nand.bin
 ALL-$(CONFIG_ONENAND_U_BOOT) += $(obj)u-boot-onenand.bin
 ONENAND_BIN ?= $(obj)onenand_ipl/onenand-ipl-2k.bin
 ALL-$(CONFIG_MMC_U_BOOT) += $(obj)mmc_spl/u-boot-mmc-spl.bin
+ALL-$(CONFIG_UBOOT_SPL) += spl
 
 all:   $(ALL-y)
 
@@ -414,6 +415,12 @@ mmc_spl:   $(TIMESTAMP_FILE) $(VERSION_FILE) depend
 
 $(obj)mmc_spl/u-boot-mmc-spl.bin:  mmc_spl
 
+spl:   depend
+   $(MAKE) -C spl all
+
+$(obj)u-boot.spl.bin:  spl $(obj)u-boot.img
+   cat $(obj)spl/u-boot-spl.bin $(obj)u-boot.img > $@
+
 $(VERSION_FILE):
@( localvers='$(shell $(TOPDIR)/tools/setlocalversion 
$(TOPDIR))' ; \
   printf '#define PLAIN_VERSION "%s%s"\n' \
@@ -1127,6 +1134,7 @@ clean:
@rm -f 
$(obj)mmc_spl/{u-boot.lds,u-boot-spl,u-boot-spl.map,u-boot-spl.bin,u-boot-mmc-spl.bin}
@rm -f $(ONENAND_BIN)
@rm -f $(obj)onenand_ipl/u-boot.lds
+   @$(MAKE) -C spl clean
@rm -f $(TIMESTAMP_FILE) $(VERSION_FILE)
@find $(OBJTREE) -type f \
\( -name 'core' -o -name '*.bak' -o -name '*~' \
-- 
1.7.0.4

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


[U-Boot] [RFC PATCH 1/7] Adapt config.mk for usage in spl/Makefile

2011-06-29 Thread Aneesh V
From: Daniel Schwierzeck 

[ane...@ti.com:
1. Changed the definition of OBJTREE and the way 'obj' is defined.
2. Defined a flag to identify regular U-Boot build
3. Taking care of autoconf.mk etc for SPL due to changed OBJTREE
]
Signed-off-by: Aneesh V 
Signed-off-by: Daniel Schwierzeck 
---
 config.mk |   32 +++-
 1 files changed, 27 insertions(+), 5 deletions(-)

diff --git a/config.mk b/config.mk
index 7ce554e..2ad15c6 100644
--- a/config.mk
+++ b/config.mk
@@ -116,8 +116,14 @@ RANLIB = $(CROSS_COMPILE)RANLIB
 #
 
 # Load generated board configuration
+ifdef CONFIG_UBOOT_SPL_BUILD
+# OBJTREE points to /spl/obj inside the original OBJTREE for SPL
+sinclude $(OBJTREE)/../../include/autoconf.mk
+sinclude $(OBJTREE)/../../include/config.mk
+else
 sinclude $(OBJTREE)/include/autoconf.mk
 sinclude $(OBJTREE)/include/config.mk
+endif
 
 # Some architecture config.mk files need to know what CPUDIR is set to,
 # so calculate CPUDIR before including ARCH/SOC/CPU config.mk files.
@@ -194,13 +200,24 @@ ifneq ($(CONFIG_SYS_TEXT_BASE),)
 CPPFLAGS += -DCONFIG_SYS_TEXT_BASE=$(CONFIG_SYS_TEXT_BASE)
 endif
 
+ifneq ($(CONFIG_SPL_TEXT_BASE),)
+CPPFLAGS += -DCONFIG_SPL_TEXT_BASE=$(CONFIG_SPL_TEXT_BASE)
+endif
+
+CONFIG_NORMAL_UBOOT = $(if $(CONFIG_UBOOT_SPL_BUILD),,y)
+
 ifneq ($(RESET_VECTOR_ADDRESS),)
 CPPFLAGS += -DRESET_VECTOR_ADDRESS=$(RESET_VECTOR_ADDRESS)
 endif
 
 ifneq ($(OBJTREE),$(SRCTREE))
+ifdef CONFIG_UBOOT_SPL_BUILD
+# OBJTREE points to /spl/obj inside the original OBJTREE for SPL
+CPPFLAGS += -I$(OBJTREE)/../../include2 -I$(OBJTREE)/../../include
+else
 CPPFLAGS += -I$(OBJTREE)/include2 -I$(OBJTREE)/include
 endif
+endif
 
 CPPFLAGS += -I$(TOPDIR)/include
 CPPFLAGS += -fno-builtin -ffreestanding -nostdinc  \
@@ -236,6 +253,11 @@ ifneq ($(CONFIG_SYS_TEXT_BASE),)
 LDFLAGS_u-boot += -Ttext $(CONFIG_SYS_TEXT_BASE)
 endif
 
+LDFLAGS_u-boot-spl += -T $(obj)u-boot-spl.lds $(LDFLAGS_FINAL)
+ifneq ($(CONFIG_SPL_TEXT_BASE),)
+LDFLAGS_u-boot-spl += -Ttext $(CONFIG_SPL_TEXT_BASE)
+endif
+
 # Location of a usable BFD library, where we define "usable" as
 # "built for ${HOST}, supports ${TARGET}".  Sensible values are
 # - When cross-compiling: the root of the cross-environment
@@ -271,15 +293,15 @@ exportCONFIG_SYS_TEXT_BASE PLATFORM_CPPFLAGS 
PLATFORM_RELFLAGS CPPFLAGS CFLAGS
 BCURDIR = $(subst $(SRCTREE)/,,$(CURDIR:$(obj)%=%))
 ALL_AFLAGS = $(AFLAGS) $(AFLAGS_$(BCURDIR)/$(@F)) $(AFLAGS_$(BCURDIR))
 ALL_CFLAGS = $(CFLAGS) $(CFLAGS_$(BCURDIR)/$(@F)) $(CFLAGS_$(BCURDIR))
-$(obj)%.s: %.S
+$(obj)%.s: $(src)%.S
$(CPP) $(ALL_AFLAGS) -o $@ $<
-$(obj)%.o: %.S
+$(obj)%.o: $(src)%.S
$(CC)  $(ALL_AFLAGS) -o $@ $< -c
-$(obj)%.o: %.c
+$(obj)%.o: $(src)%.c
$(CC)  $(ALL_CFLAGS) -o $@ $< -c
-$(obj)%.i: %.c
+$(obj)%.i: $(src)%.c
$(CPP) $(ALL_CFLAGS) -o $@ $< -c
-$(obj)%.s: %.c
+$(obj)%.s: $(src)%.c
$(CC)  $(ALL_CFLAGS) -o $@ $< -c -S
 
 #
-- 
1.7.0.4

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


Re: [U-Boot] [PATCH 2/2] ext2: Simplify partial sector access logic

2011-06-29 Thread Detlev Zundel
Hi Anton,

> Previously reading or writing zero full sectors (reading the end of
> one sector and the beginning of the next for example) was special
> cased and involved stack allocating a second sector buffer.  This
> change uses the same code path for this case as well as when there
> are a non-zero number of full sectors to access.  The result is
> easier to read and reduces the maximum stack used.

It's non-trivial to prove that your change is equivalent and
unfortunately I do not have enough time to do this.  If your tests work,
than this is certainly a good indication ;) The one thing I'd like to be
sure is that the previous code looks like it used the stack for whole
sectors but copied only parts of this to the provided address pointer.
Your new code looks like it always writes whole sectors to the provided
pointer.  Is this safe even if the caller allocated space without
overhead for whole sectors?

Cheers
  Detlev

-- 
In God we trust.  All others we monitor
   -- NSA motto
--
DENX Software Engineering GmbH,  MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: d...@denx.de
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] request for some debugging hints

2011-06-29 Thread Christopher Harvey
kernel version: 2.6.38
u-boot version: 2011.06

I've got an ARM (armv7) kernel that I can boot under QEMU without
problems, but refuses to boot with a bootm command under u-boot.

All I see is "Uncompressing Linux... done, booting the kernel.", then
nothing else.

I'm also hitting a bug very similar to the following with gdb, so I'm
having a hard time figuring out exactly which lines are blocking the
kernel.
http://sourceware.org/ml/gdb-patches/2011-02/msg00048.html
but that patch doesn't fix it in my case.

Basically I was hoping for some hints in case somebody here has already
dealt with a similar problem and could provide some tips to help me
figure out how to spend my debugging time.

I was under the impression that the second a working kernel got passed
the "Uncompressing Linux... done, booting the kernel." point there was
very little that could go wrong since it means the kernel was completely
loaded into memory and the entry point was picked properly.

The kernel is a very standard kernel, and uboot is a very minimal uboot
build with no extra soc or board initializations besides memory size.
eg:
lowlevel_init is blank
reset_cpu is an infinite loop
timers aren't used

any hints or ideas appreciated,
Chris
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2] ext2: Fix checkpatch violations

2011-06-29 Thread Detlev Zundel
Hi Anton,

> Fix all checkpatch violations in the low level Ext2 block
> device reading code.  This is done in preparation for cleaning
> up the partial sector access code.
>
> Signed-off-by: Anton Staaf 
> Cc: Andy Fleming 
> ---
>  fs/ext2/dev.c |   82 
> ++---
>  1 files changed, 43 insertions(+), 39 deletions(-)
>
> diff --git a/fs/ext2/dev.c b/fs/ext2/dev.c
> index 3b49650..4365b3b 100644
> --- a/fs/ext2/dev.c
> +++ b/fs/ext2/dev.c
> @@ -31,7 +31,7 @@
>  static block_dev_desc_t *ext2fs_block_dev_desc;
>  static disk_partition_t part_info;
>  
> -int ext2fs_set_blk_dev (block_dev_desc_t * rbdd, int part)
> +int ext2fs_set_blk_dev(block_dev_desc_t *rbdd, int part)
>  {
>   ext2fs_block_dev_desc = rbdd;
>  
> @@ -46,51 +46,55 @@ int ext2fs_set_blk_dev (block_dev_desc_t * rbdd, int part)
>   return 0;
>   }
>   }
> - return (part_info.size);
> + return part_info.size;
>  }
>  
>  
> -int ext2fs_devread (int sector, int byte_offset, int byte_len, char *buf) {
> +int ext2fs_devread(int sector, int byte_offset, int byte_len, char *buf)
> +{
>   char sec_buf[SECTOR_SIZE];
>   unsigned block_len;
>  
> -/*
> - *  Check partition boundaries
> - */
> - if ((sector < 0)
> - || ((sector + ((byte_offset + byte_len - 1) >> SECTOR_BITS)) >=
> + /*
> +  *  Check partition boundaries
> +  */
> + if ((sector < 0) ||
> + ((sector + ((byte_offset + byte_len - 1) >> SECTOR_BITS)) >=
>   part_info.size)) {
> - /*  errnum = ERR_OUTSIDE_PART; */
> - printf (" ** ext2fs_devread() read outside partition sector 
> %d\n", sector);
> - return (0);
> + /* errnum = ERR_OUTSIDE_PART; */
> + printf(" ** %s read outside partition sector %d\n",
> +__func__,
> +sector);
> + return 0;
>   }
>  
> -/*
> - *  Get the read to the beginning of a partition.
> - */
> + /*
> +  *  Get the read to the beginning of a partition.
> +  */
>   sector += byte_offset >> SECTOR_BITS;
>   byte_offset &= SECTOR_SIZE - 1;
>  
> - debug (" <%d, %d, %d>\n", sector, byte_offset, byte_len);
> + debug(" <%d, %d, %d>\n", sector, byte_offset, byte_len);
>  
>   if (ext2fs_block_dev_desc == NULL) {
> - printf ("** Invalid Block Device Descriptor (NULL)\n");
> - return (0);
> + printf(" ** %s Invalid Block Device Descriptor (NULL)\n",
> +__func__);
> + return 0;


So in contrast to your commit message you actually change the format of
the output (to the better IMHO).  It would have been better to split the
cleanup and the changes.  Being as it is, you should at least document
the consistency changes for the next round.

Apart from that:

Acked-by: Detlev Zundel 

Cheers
  Detlev

-- 
We support democracy, but that doesn't mean we have to support
governments that get elected as a result of democracy.
 -- George W. Bush - March 30, 2006
--
DENX Software Engineering GmbH,  MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: d...@denx.de
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] arm: Update jadecpu board

2011-06-29 Thread Matthias Weisser
Enable dcache and arch memset/memcpy for speed reasons
Remove of config.mk and some environment overwrites
Some generic cleanup

Signed-off-by: Matthias Weisser 
---
 board/syteco/jadecpu/config.mk |1 -
 board/syteco/jadecpu/jadecpu.c |5 +
 include/configs/jadecpu.h  |   24 +++-
 3 files changed, 16 insertions(+), 14 deletions(-)
 delete mode 100644 board/syteco/jadecpu/config.mk

diff --git a/board/syteco/jadecpu/config.mk b/board/syteco/jadecpu/config.mk
deleted file mode 100644
index 617603d..000
--- a/board/syteco/jadecpu/config.mk
+++ /dev/null
@@ -1 +0,0 @@
-CONFIG_SYS_TEXT_BASE = 0x1000
diff --git a/board/syteco/jadecpu/jadecpu.c b/board/syteco/jadecpu/jadecpu.c
index 69476f8..a7b6e70 100644
--- a/board/syteco/jadecpu/jadecpu.c
+++ b/board/syteco/jadecpu/jadecpu.c
@@ -44,6 +44,7 @@ int board_init(void)
gd->bd->bi_boot_params = PHYS_SDRAM + PHYS_SDRAM_SIZE - 0x1;
 
icache_enable();
+   dcache_enable();
 
return 0;
 }
@@ -125,9 +126,6 @@ int board_late_init(void)
setenv("preboot", "run gs_slow_boot");
} else if ((in_word & 0xC0) != 0) {
setenv("stdout", "vga");
-   setenv("gs_bootcmd", "mw.l 0x4000 0 1024; usb start;"
-   "fatls usb 0; fatload usb 0 0x4000 mcq5resq.bin;"
-   "bootelf 0x4000; bootelf 0x1008");
setenv("preboot", "run gs_slow_boot");
} else {
setenv("stdin", "serial");
@@ -136,7 +134,6 @@ int board_late_init(void)
if (getenv("gs_devel")) {
setenv("preboot", "run gs_slow_boot");
} else {
-   setenv("gs_bootcmd", "bootelf 0x1008");
setenv("preboot", "run gs_fast_boot");
}
}
diff --git a/include/configs/jadecpu.h b/include/configs/jadecpu.h
index c119392..0375732 100644
--- a/include/configs/jadecpu.h
+++ b/include/configs/jadecpu.h
@@ -29,17 +29,21 @@
 #define CONFIG_MB86R0x
 #define CONFIG_MB86R0x_IOCLK   get_bus_freq(0)
 #define CONFIG_SYS_HZ  1000
+#define CONFIG_SYS_TEXT_BASE   0x1000
 
 #define CONFIG_ARM926EJS   1   /* This is an ARM926EJS Core*/
 #undef CONFIG_USE_IRQ  /* we don't need IRQ/FIQ stuff  */
 
+#define CONFIG_USE_ARCH_MEMCPY
+#define CONFIG_USE_ARCH_MEMSET
+
 /*
  * Environment settings
  */
 #define CONFIG_EXTRA_ENV_SETTINGS \
"gs_fast_boot=setenv bootdelay 5\0" \
"gs_slow_boot=setenv bootdelay 10\0" \
-   "bootcmd=mw.l 0x4000 0 1024; usb start;" \
+   "bootcmd=dcache off; mw.l 0x4000 0 1024; usb start;" \
"fatls usb 0; fatload usb 0 0x4000 jadecpu-init.bin;" \
"bootelf 0x4000\0" \
""
@@ -122,13 +126,14 @@
 #undef CONFIG_CMD_NFS
 #undef CONFIG_CMD_XIMG
 
-#define CONFIG_CMD_BMP 1
-#define CONFIG_CMD_CAN 1
-#define CONFIG_CMD_DHCP1
-#define CONFIG_CMD_ELF 1
-#define CONFIG_CMD_FAT 1
-#define CONFIG_CMD_PING1
-#define CONFIG_CMD_USB 1
+#define CONFIG_CMD_BMP
+#define CONFIG_CMD_CAN
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_FAT
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_USB
+#define CONFIG_CMD_CACHE
 
 #define CONFIG_SYS_HUSH_PARSER
 #define CONFIG_SYS_PROMPT_HUSH_PS2 "> "
@@ -196,7 +201,8 @@
 /*
  * Size of malloc() pool
  */
-#define CONFIG_SYS_MALLOC_LEN  (0x40 - 0x8000)
+#define CONFIG_SYS_MALLOC_LEN  (10 << 20)
+#define CONFIG_SYS_MEM_TOP_HIDE(4 << 20)
 
 #define CONFIG_STACKSIZE   (32*1024)   /* regular stack */
 
-- 
1.7.0.4

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


[U-Boot] [PATCH] video: Use memset instead of loop

2011-06-29 Thread Matthias Weisser
There is a optimized version of memset in u-boot available so use it instead
of the hand written loop version.

Signed-off-by: Matthias Weisser 
---
 drivers/video/mb86r0xgdc.c |3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/video/mb86r0xgdc.c b/drivers/video/mb86r0xgdc.c
index 3bdc1db..5425c9d 100644
--- a/drivers/video/mb86r0xgdc.c
+++ b/drivers/video/mb86r0xgdc.c
@@ -77,8 +77,7 @@ static void dsp_init(struct mb86r0x_gdc_dsp *dsp, char 
*modestr,
}
 
/* Fill memory with white */
-   for (i = 0; i < var_mode.xres * var_mode.yres / 2; i++)
-   *videomem++ = 0x;
+   memset(videomem, 0xFF, var_mode.xres * var_mode.yres * 2);
 
mb86r0x.winSizeX = var_mode.xres;
mb86r0x.winSizeY = var_mode.yres;
-- 
1.7.0.4

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


Re: [U-Boot] [Patch] For bug in UBIFS function ubifs_finddir

2011-06-29 Thread Detlev Zundel
Hi Stefan,

[...]

> This patch does not apply:
>
> Applying: For bug in UBIFS function ubifs_finddir
> Using index info to reconstruct a base tree...
> error: patch failed: fs/ubifs/ubifs.c:360
> error: fs/ubifs/ubifs.c: patch does not apply
> Did you hand edit your patch?
>
> How did you create this patch? I recommend to use "git format-patch". And 
> send 
> it via "git send-email".
>
> Also, please change the patch subject and add "ubifs:":
>
> - For  bug in UBIFS function ubifs_finddir
> + ubifs: Fix bug in function ubifs_finddir
>
> Please also take a look at this page for patch submission:
>
> http://www.denx.de/wiki/view/U-Boot/Patches
>
> Thanks.

Sorry for my duplication, I just saw that you beat me with your answer
;)

Cheers
  Detlev

-- 
Ich glaube, daß die Weltanschauung, die aus der modernen Physik hervorgeht,
mit unserer gegenwärtigen  Gesellschaft unvereinbar ist,  weil sie den har-
monischen Zusammenhängen,  die wir in der Natur beaobachten, nicht Rechnung
trägt.  -- Fritjof Capra
--
DENX Software Engineering GmbH,  MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: d...@denx.de
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [Patch] For bug in UBIFS function ubifs_finddir

2011-06-29 Thread Detlev Zundel
Hi Rod,

> Free private_data member element before freeing file structure.  This
> was causing malloc to crash.  Also remove unnecessary variable
> assigments after file structure was free'd.
>
> Signed-off-by: Rod Boyce 
> --- fs/ubifs/ubifs.c 
> --
> diff --git a/fs/ubifs/ubifs.c b/fs/ubifs/ubifs.c
> index 5a5c739..61f70b2 100644
> --- a/fs/ubifs/ubifs.c
> +++ b/fs/ubifs/ubifs.c
> @@ -360,6 +360,8 @@
>   return err;
>   }
>
> +if (file->private_data)
> +kfree(file->private_data);
>   if (file)
>   free(file);
>   if (dentry)
> @@ -367,10 +369,6 @@
>   if (dir)
>   free(dir);
>
> -if (file->private_data)
> -kfree(file->private_data);
> -file->private_data = NULL;
> -file->f_pos = 2;
>   return 0;
>   }

Actually the patch looks good - though I cannot apply the patch easily:

[dzu@pollux u-boot-testing (master)]$ git am -3 ~/transfer/p1
Applying: For bug in UBIFS function ubifs_finddir
Using index info to reconstruct a base tree...
error: patch failed: fs/ubifs/ubifs.c:360
error: fs/ubifs/ubifs.c: patch does not apply
Did you hand edit your patch?
It does not apply to blobs recorded in its index.
Cannot fall back to three-way merge.
Patch failed at 0001 For bug in UBIFS function ubifs_finddir
When you have resolved this problem run "git am --resolved".
If you would prefer to skip this patch, instead run "git am --skip".
To restore the original branch and stop patching run "git am --abort".

Can you please resend the patch in a way that makes it possible to apply
to current master?  And if you do that, please change the subject line
to something more expressive.

Thanks
  Detlev

-- 
... the tools we are trying to use and the language or notation we are using to
express or record our thoughts,  are the major factors  determining what we can
think or express at all!
-- Edsger W. Dijkstra
--
DENX Software Engineering GmbH,  MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: d...@denx.de
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] smc911x MII made available

2011-06-29 Thread helmut . raiger
From: Helmut Raiger 

The driver already had the MII functions, but they have not been
registered using miiphy_register().

Signed-off-by: Helmut Raiger 
---
 drivers/net/smc911x.c |   36 ++--
 1 files changed, 30 insertions(+), 6 deletions(-)

diff --git a/drivers/net/smc911x.c b/drivers/net/smc911x.c
index aeafeba..6cc236c 100644
--- a/drivers/net/smc911x.c
+++ b/drivers/net/smc911x.c
@@ -50,7 +50,7 @@ static void smc911x_handle_mac_address(struct eth_device *dev)
printf(DRIVERNAME ": MAC %pM\n", m);
 }
 
-static int smc911x_miiphy_read(struct eth_device *dev,
+static int smc911x_eth_phy_read(struct eth_device *dev,
u8 phy, u8 reg, u16 *val)
 {
while (smc911x_get_mac_csr(dev, MII_ACC) & MII_ACC_MII_BUSY)
@@ -67,7 +67,7 @@ static int smc911x_miiphy_read(struct eth_device *dev,
return 0;
 }
 
-static int smc911x_miiphy_write(struct eth_device *dev,
+static int smc911x_eth_phy_write(struct eth_device *dev,
u8 phy, u8 reg, u16  val)
 {
while (smc911x_get_mac_csr(dev, MII_ACC) & MII_ACC_MII_BUSY)
@@ -103,10 +103,10 @@ static void smc911x_phy_configure(struct eth_device *dev)
 
smc911x_phy_reset(dev);
 
-   smc911x_miiphy_write(dev, 1, MII_BMCR, BMCR_RESET);
+   smc911x_eth_phy_write(dev, 1, MII_BMCR, BMCR_RESET);
mdelay(1);
-   smc911x_miiphy_write(dev, 1, MII_ADVERTISE, 0x01e1);
-   smc911x_miiphy_write(dev, 1, MII_BMCR, BMCR_ANENABLE |
+   smc911x_eth_phy_write(dev, 1, MII_ADVERTISE, 0x01e1);
+   smc911x_eth_phy_write(dev, 1, MII_BMCR, BMCR_ANENABLE |
BMCR_ANRESTART);
 
timeout = 5000;
@@ -115,7 +115,7 @@ static void smc911x_phy_configure(struct eth_device *dev)
if ((timeout--) == 0)
goto err_out;
 
-   if (smc911x_miiphy_read(dev, 1, MII_BMSR, &status) != 0)
+   if (smc911x_eth_phy_read(dev, 1, MII_BMSR, &status) != 0)
goto err_out;
} while (!(status & BMSR_LSTATUS));
 
@@ -235,6 +235,25 @@ static int smc911x_rx(struct eth_device *dev)
return 0;
 }
 
+#if defined(CONFIG_MII) || defined(CONFIG_CMD_MII)
+/* wrapper for smc911x_eth_phy_read */
+static int smc911x_miiphy_read(char *devname, u8 phy, u8 reg, u16 *val)
+{
+   struct eth_device *dev = eth_get_dev_by_name(devname);
+   if (dev)
+   return smc911x_eth_phy_read(dev, phy, reg, val);
+   return -1;
+}
+/* wrapper for smc911x_eth_phy_write */
+static int smc911x_miiphy_write(char *devname, u8 phy, u8 reg, u16 val)
+{
+   struct eth_device *dev = eth_get_dev_by_name(devname);
+   if (dev)
+   return smc911x_eth_phy_write(dev, phy, reg, val);
+   return -1;
+}
+#endif
+
 int smc911x_initialize(u8 dev_num, int base_addr)
 {
unsigned long addrl, addrh;
@@ -273,5 +292,10 @@ int smc911x_initialize(u8 dev_num, int base_addr)
sprintf(dev->name, "%s-%hu", DRIVERNAME, dev_num);
 
eth_register(dev);
+
+#if defined(CONFIG_MII) || defined(CONFIG_CMD_MII)
+   miiphy_register(dev->name, smc911x_miiphy_read, smc911x_miiphy_write);
+#endif
+
return 1;
 }
-- 
1.7.4.4



--
Scanned by MailScanner.

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


[U-Boot] [PATCH][ATMEL] Fix compiler error for cpu at91sam9, if lowlevel init is enabled

2011-06-29 Thread e...@bus-elektronik.de
* Fix compiler error for cpu at91sam9, if lowlevel init is enabled
* use correct ATMEL_ name scheme to define ATMEL_BASE_SDRAMC

Signed-off-by: Jens Scharsig
---
 arch/arm/include/asm/arch-at91/at91sam9_sdramc.h |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/include/asm/arch-at91/at91sam9_sdramc.h
b/arch/arm/include/asm/arch-at91/at91sam9_sdramc.h
index 54159a7..2d4c49e 100644
--- a/arch/arm/include/asm/arch-at91/at91sam9_sdramc.h
+++ b/arch/arm/include/asm/arch-at91/at91sam9_sdramc.h
@@ -20,7 +20,7 @@
 #ifdef __ASSEMBLY__

 #ifndef ATMEL_BASE_SDRAMC
-#define ATMEL_BASE_SDRAMC  AT91_SDRAMC0_BASE
+#define ATMEL_BASE_SDRAMC  ATMEL_BASE_SDRAMC0
 #endif

 #define AT91_ASM_SDRAMC_MR ATMEL_BASE_SDRAMC
-- 
1.7.3.4

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


Re: [U-Boot] [4/5]devkit8000 nand_spl: Add SPL NAND support to omap_gpmc driver

2011-06-29 Thread Andreas Bießmann
Dear Simon Schwarz,

Am 28.06.2011 16:14, schrieb simonschwarz...@googlemail.com:
> Add support for NAND_SPL to omap gpmc driver. This means adding 
> nand_read_buf16 to read from GPMC 32bit buffer (16 here means 16bit bus!) and 
> adding omap_dev_ready as indicator if the GPMC is ready.  

You also set some special ECC handling in this patch, please honour this
in your commit message!

> 
> Signed-off-by: Simon Schwarz 
> --
> 
> diff --git a/drivers/mtd/nand/omap_gpmc.c b/drivers/mtd/nand/omap_gpmc.c
> index 99b9cef..7dfb05d 100644
> --- a/drivers/mtd/nand/omap_gpmc.c
> +++ b/drivers/mtd/nand/omap_gpmc.c
> @@ -29,6 +29,9 @@
>  #include 
>  #include 
>  
> +

no additional empty line

> +#define GPMC_WAIT0_PIN_ACTIVE (1 << 8)

this is only used once, why don't you use just (1<<8) where needed? Is
there some special meaning with 8 bit shift, can you use a register name
instead? Should it be configurable in any way for other omap3 devices?

> +
>  static uint8_t cs;
>  static struct nand_ecclayout hw_nand_oob = GPMC_NAND_HW_ECC_LAYOUT;
>  
> @@ -61,6 +64,37 @@ static void omap_nand_hwcontrol(struct mtd_info *mtd, 
> int32_t cmd,
>   writeb(cmd, this->IO_ADDR_W);
>  }
>  
> +/* Check wait pin as dev ready indicator */
> +int omap_dev_ready(struct mtd_info *mtd)
> +{
> + return gpmc_cfg->status & GPMC_WAIT0_PIN_ACTIVE;
> +}
> +
> +#ifdef CONFIG_PRELOADER

Isn't that SPL related? Why is it required for SPL and not for standard
U-Boot?

> +
> +/**
> + * nand_read_buf16 - [DEFAULT] read chip data into buffer
> + * @mtd:MTD device structure
> + * @buf:buffer to store date
> + * @len:number of bytes to read
> + *
> + * Default read function for 16bit buswith
> + *
> + * This function is based on nand_read_buf16 from nand_base.c. This version
> + * reads 32bit not 16bit although the bus only has 16bit.
> + */
> +static void gpmc_read_buf16(struct mtd_info *mtd, uint8_t *buf, int len)
> +{
> + int i;
> + struct nand_chip *chip = mtd->priv;
> + u32 *p = (u32 *) buf;
> + len >>= 2;
> +
> + for (i = 0; i < len; i++)
> + p[i] = readl(chip->IO_ADDR_R);
> +}
> +#endif
> +
>  /*
>   * omap_hwecc_init - Initialize the Hardware ECC for NAND flash in
>   *   GPMC controller
> @@ -278,7 +312,9 @@ void omap_nand_switch_ecc(int32_t hardware)
>   /* Update NAND handling after ECC mode switch */
>   nand_scan_tail(mtd);
>  
> + #ifndef CONFIG_SPL
>   nand->options &= ~NAND_OWN_BUFFERS;
> + #endif
>  }
>  
>  /*
> @@ -337,8 +373,23 @@ int board_nand_init(struct nand_chip *nand)
>   nand->options |= NAND_BUSWIDTH_16;
>  
>   nand->chip_delay = 100;
> + nand->dev_ready = omap_dev_ready;
>   /* Default ECC mode */
> +#ifndef CONFIG_PRELOADER

should't this some CONFIG_USE_SOFT_ECC (or whatever config variable
define that behaviour)?

>   nand->ecc.mode = NAND_ECC_SOFT;
> +#else
> + nand->ecc.mode = NAND_ECC_HW;
> + nand->ecc.layout = &hw_nand_oob;
> + nand->ecc.size = 512;
> + nand->ecc.bytes = 24;

Ouch, these two values are extremely HW spwcific and need to be
configurable then.

> + nand->ecc.hwctl = omap_enable_hwecc;
> + nand->ecc.correct = omap_correct_data;
> + nand->ecc.calculate = omap_calculate_ecc;

Isn't that some kind of CONFIG_NAND_BUSWDITH (or whatever config
variable define that behaviour) related setting?

> + nand->read_buf = gpmc_read_buf16;
> + omap_hwecc_init(nand);
> +#endif
>  
>   return 0;
>  }
> +
> +

please remove these two additional empty lines

regards

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


Re: [U-Boot] Not able access External peripherals in PPC440EP

2011-06-29 Thread Stefan Roese
Hi Suresh,

On Friday 24 June 2011 12:54:41 suresh kumar wrote:
>  Thanks for your suggestion. Now i have migrated to uboot v2011.06-rc2
> and the booting sequece is working fine. But the problem still i am
> facing is not able access the external periherals like NVRAM and ADC,
> DAC etc. What minimum initializations to be done for that.

You need at least to configure a TLB mapping and setup the EBC (chip select) 
for these peripherals.

Cheers,
Stefan

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


Re: [U-Boot] [2/5]devkit8000 nand_spl: omap3 support nand_spl boot

2011-06-29 Thread Andreas Bießmann
Dear Simon Schwarz,


Am 28.06.2011 16:14, schrieb simonschwarz...@googlemail.com:
> Deactivates caching in SPL. Add call to preloader_console_init for early 
> console output.

well, deactivating caches make the process much slower. I recommend
don't disabeling it!

BTW, this patch also add preloader_console_init() to s_init() .. please
honor this in commit message (or split off in two patches)

regards

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


Re: [U-Boot] [Patch] Update filesize environment variable on ubifs_load

2011-06-29 Thread Stefan Roese
Hi Rod,

On Saturday 18 June 2011 12:30:18 Rod Boyce wrote:
> Add functionality to update filesize environment variable when
> ubifs_load is called to read a file from filesystem
> 
> Signed-off-by: Rod Boyce 
> --- fs/ubifs/ubifs.c
> --
> diff --git a/fs/ubifs/ubifs.c b/fs/ubifs/ubifs.c
> index 61f70b2..17097f2 100644
> --- a/fs/ubifs/ubifs.c
> +++ b/fs/ubifs/ubifs.c
> @@ -686,6 +686,7 @@
>   int i;
>   int count;
>   int last_block_size = 0;
> +char buf[32];
> 
>   c->ubi = ubi_open_volume(c->vi.ubi_num, c->vi.vol_id, UBI_READONLY);
>   /* ubifs_findfile will resolve symlinks, so we know that we get
> @@ -716,6 +717,8 @@
>   count = (size + UBIFS_BLOCK_SIZE - 1) >> UBIFS_BLOCK_SHIFT;
>   printf("Loading file '%s' to addr 0x%08x with size %d (0x%08x)...\n",
>  filename, addr, size, size);
> +sprintf( buf, "%X", size );
> +setenv( "filesize", buf );

Again, patch does not apply (indentation seems broken). Please see my comments 
in the last mail. And please don't add a space after "(" and before ")":

+sprintf(buf, "%X", size);
+setenv("filesize", buf);


Cheers,
Stefan

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


Re: [U-Boot] [Patch] For bug in UBIFS function ubifs_finddir

2011-06-29 Thread Stefan Roese
Hi Rod,

On Saturday 18 June 2011 11:51:11 Rod Boyce wrote:
> Free private_data member element before freeing file structure.  This
> was causing malloc to crash.  Also remove unnecessary variable
> assigments after file structure was free'd.
> 
> Signed-off-by: Rod Boyce 
> --- fs/ubifs/ubifs.c
> --
> diff --git a/fs/ubifs/ubifs.c b/fs/ubifs/ubifs.c
> index 5a5c739..61f70b2 100644
> --- a/fs/ubifs/ubifs.c
> +++ b/fs/ubifs/ubifs.c
> @@ -360,6 +360,8 @@
>   return err;
>   }
> 
> +if (file->private_data)
> +kfree(file->private_data);
>   if (file)
>   free(file);
>   if (dentry)
> @@ -367,10 +369,6 @@
>   if (dir)
>   free(dir);
> 
> -if (file->private_data)
> -kfree(file->private_data);
> -file->private_data = NULL;
> -file->f_pos = 2;
>   return 0;

This patch does not apply:

Applying: For bug in UBIFS function ubifs_finddir
Using index info to reconstruct a base tree...
error: patch failed: fs/ubifs/ubifs.c:360
error: fs/ubifs/ubifs.c: patch does not apply
Did you hand edit your patch?

How did you create this patch? I recommend to use "git format-patch". And send 
it via "git send-email".

Also, please change the patch subject and add "ubifs:":

- For  bug in UBIFS function ubifs_finddir
+ ubifs: Fix bug in function ubifs_finddir

Please also take a look at this page for patch submission:

http://www.denx.de/wiki/view/U-Boot/Patches

Thanks.

Cheers,
Stefan

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


Re: [U-Boot] [1/5]devkit8000 nand_spl: armv7 support nand_spl boot

2011-06-29 Thread Andreas Bießmann
Dear Simon Schwarz,

(this is a review of RFC for omap3 nand spl Simon does for his bachelor
thesis, there is one question in regarding the current 'SPL framework
redesign' discussion -> entry point for spl code).

Am 28.06.2011 16:14, schrieb simonschwarz...@googlemail.com:



> --
> 
> diff --git a/arch/arm/cpu/armv7/start.S b/arch/arm/cpu/armv7/start.S
> index d91ae12..ebbfce4 100644
> --- a/arch/arm/cpu/armv7/start.S
> +++ b/arch/arm/cpu/armv7/start.S
> @@ -33,6 +33,11 @@
>  #include 
>  #include 
>  
> +/* prevent lowlevel init if this is not the preloader*/
> +#if defined(CONFIG_SPL) && !defined(CONFIG_PRELOADER)
> +#define CONFIG_SKIP_LOWLEVEL_INIT
> +#endif
> +

not here, use your board configuration header for this.

>  .globl _start
>  _start: breset
>   ldr pc, _undefined_instruction
> @@ -43,6 +48,17 @@ _start: b  reset
>   ldr pc, _irq
>   ldr pc, _fiq
>  
> +#ifdef CONFIG_PRELOADER
> +/* If in Preloader don't use interrupts...*/
> +_undefined_instruction: .word undefined_instruction
> +_software_interrupt:.word _software_interrupt
> +_prefetch_abort:.word _prefetch_abort
> +_data_abort:.word data_abort
> +_not_used:  .word _not_used
> +_irq:   .word _irq
> +_fiq:   .word _fiq
> +_pad:   .word 0x12345678 /* now 16*4=64 */
> +#else
>  _undefined_instruction: .word undefined_instruction
>  _software_interrupt: .word software_interrupt
>  _prefetch_abort: .word prefetch_abort
> @@ -51,6 +67,7 @@ _not_used:  .word not_used
>  _irq:.word irq
>  _fiq:.word fiq
>  _pad:.word 0x12345678 /* now 16*4=64 */
> +#endif /* CONFIG_PRELOADER */

why resetting the vector table? just do not enable irq at all should
also do the job, isn't it?

>  .global _end_vect
>  _end_vect:
>  
> @@ -85,6 +102,7 @@ _armboot_start:
>  /*
>   * These are defined in the board-specific linker script.
>   */
> +#ifndef CONFIG_PRELOADER

isn't that SPL specific?

>  .globl _bss_start_ofs
>  _bss_start_ofs:
>   .word __bss_start - _start
> @@ -96,6 +114,16 @@ _bss_end_ofs:
>  .globl _end_ofs
>  _end_ofs:
>   .word _end - _start
> +#else
> +/* preserved the _ofs because although there is no offset */
> +.globl _bss_start_ofs
> +_bss_start_ofs:
> + .word __bss_start
> +
> +.globl _bss_end_ofs
> +_bss_end_ofs:
> + .word __bss_end__
> +#endif
>  
>  #ifdef CONFIG_USE_IRQ
>  /* IRQ stack memory (calculated at run-time) */
> @@ -153,8 +181,15 @@ next:
>   /* the mask ROM code should have PLL and others stable */
>  #ifndef CONFIG_SKIP_LOWLEVEL_INIT
>   bl  cpu_init_crit
> -#endif
> -
> +#endif /* #ifdef CONFIG_PRELOADER */

ok to mark this #endif, but do not use  '/* #ifdef', it looks like
commented out ifdef.

> +
> +#ifdef CONFIG_PRELOADER
> +call_board_init_spl:
> +ldr sp, =(CONFIG_SYS_INIT_SP_ADDR)
> +bic sp, sp, #7 /* 8-byte alignment for ABI compliance */
> +ldr r0,=0x
> +bl  board_init_spl

why a new interface for entry point? You could just use
call_board_init_f() even for spl (just do not compile lib/board.c and
provide another one for spl). -> this should be discussed in 'SPL
framework redesign'.

> +#else
>  /* Set stackpointer in internal RAM to call board_init_f */
>  call_board_init_f:
>   ldr sp, =(CONFIG_SYS_INIT_SP_ADDR)
> @@ -182,10 +217,8 @@ stack_setup:
>   mov sp, r4
>  
>   adr r0, _start
> -#ifndef CONFIG_PRELOADER

hmm ... that ifndef was intentionally there

>   cmp r0, r6
>   beq clear_bss   /* skip relocation */
> -#endif
>   mov r1, r6  /* r1 <- scratch for copy_loop */
>   ldr r3, _bss_start_ofs
>   add r2, r0, r3  /* r2 <- source end address */
> @@ -196,7 +229,6 @@ copy_loop:
>   cmp r0, r2  /* until source end address [r2]*/
>   blo copy_loop
>  
> -#ifndef CONFIG_PRELOADER
>   /*
>* fix .rel.dyn relocations
>*/
> @@ -248,7 +280,6 @@ clbss_l:str   r2, [r0]/* clear 
> loop...*/
>   add r0, r0, #4
>   cmp r0, r1
>   bne clbss_l
> -#endif   /* #ifndef CONFIG_PRELOADER */
>  
>  /*
>   * We are done. Do not return, instead branch to second part of board
> @@ -265,16 +296,18 @@ jump_2_ram:
>   /* jump to it ... */
>   mov pc, lr
>  
> -_board_init_r_ofs:
> - .word board_init_r - _start
> -
>  _rel_dyn_start_ofs:
> - .word __rel_dyn_start - _start
> +.word __rel_dyn_start - _start
>  _rel_dyn_end_ofs:
> - .word __rel_dyn_end - _start
> +.word __rel_dyn_end - _start
>  _dynsym_start_ofs:
> - .word __dynsym_start - _start
> +.word __dynsym_start - _start
>  
> +_board_init_r_ofs:
> + .word board_init_r - _start

these changes are not necessary!

> +#endif /* #ifndef CONFIG_PRELOADER */
> +
> +#ifndef CONFIG_SKIP_LOWLEVEL_INIT

this sho

[U-Boot] Please pull u-boot-cfi-flash

2011-06-29 Thread Stefan Roese
Hi Wolfgang,

please pull the following patch:

The following changes since commit b1af6f532e0d348b153d5c148369229d24af361a:

  Prepare v2011.06 (2011-06-27 22:22:42 +0200)

are available in the git repository at:
  git://www.denx.de/git/u-boot-cfi-flash.git master

Mike Frysinger (1):
  cfi_flash: reverse geometry for newer STM parts

 drivers/mtd/cfi_flash.c |4 
 1 files changed, 4 insertions(+), 0 deletions(-)
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] cfi_flash: reverse geometry for newer STM parts

2011-06-29 Thread Stefan Roese
On Tuesday 10 May 2011 00:33:36 Mike Frysinger wrote:
> For newer STM parts where CFI >= 1.1, there is a byte in the extended
> structure that declares the flash layout type (just like the AMD parts),
> so key off of that to find out when we need to reverse the geometry.
> 
> This can be seen with M29W640 parts where U-Boot does:
> Bank # 1: CFI conformant FLASH (16 x 16)  Size: 8 MB in 135 Sectors
>   AMD Standard command set, Manufacturer ID: 0x20, Device ID: 0x22ED
>   Erase timeout: 8192 ms, write timeout: 1 ms
>   Buffer write timeout: 1 ms, buffer size: 16 bytes
> 
>   Sector Start Addresses:
>   2000   RO   20002000   RO   20004000   RO   20006000   RO   20008000 
>  RO 2000A000   RO   2000C000   RO   2000E000   RO   2001   RO  
> 2002   RO ...
> 
> But Linux does:
> physmap platform flash device: 0080 at 2000
> physmap-flash.0: Found 1 x16 devices at 0x0 in 16-bit bank.
>  Manufacturer ID 0x20 Chip ID 0x0022ed
> physmap-flash.0: Swapping erase regions for top-boot CFI table.

Applied to u-boot-cfi-flash/master. Thanks.
 
Cheers,
Stefan

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


[U-Boot] [PATCH V2 1/2] MMC: add sdhci generic framework

2011-06-29 Thread Lei Wen
Nowdays, there are plenty of mmc driver in uboot adopt the sd standard
host design, aka as sdhci. It is better to centralize the common logic
together to better maintenance.

Signed-off-by: Lei Wen 
---
V1:
add sdhci generic framework

V2:
No Change

 drivers/mmc/Makefile |1 +
 drivers/mmc/sdhci.c  |  433 ++
 include/sdhci.h  |  325 +
 3 files changed, 759 insertions(+), 0 deletions(-)
 create mode 100644 drivers/mmc/sdhci.c
 create mode 100644 include/sdhci.h

diff --git a/drivers/mmc/Makefile b/drivers/mmc/Makefile
index a8fe17a..50b5117 100644
--- a/drivers/mmc/Makefile
+++ b/drivers/mmc/Makefile
@@ -38,6 +38,7 @@ COBJS-$(CONFIG_OMAP3_MMC) += omap3_mmc.o
 COBJS-$(CONFIG_OMAP_HSMMC) += omap_hsmmc.o
 COBJS-$(CONFIG_PXA_MMC) += pxa_mmc.o
 COBJS-$(CONFIG_S5P_MMC) += s5p_mmc.o
+COBJS-$(CONFIG_SDHCI) += sdhci.o
 
 COBJS  := $(COBJS-y)
 SRCS   := $(COBJS:.o=.c)
diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c
new file mode 100644
index 000..9ebd33d
--- /dev/null
+++ b/drivers/mmc/sdhci.c
@@ -0,0 +1,433 @@
+/*
+ * Copyright 2011, Marvell Semiconductor Inc.
+ * Lei Wen 
+ *
+ * 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
+ *
+ * Back ported to the 8xx platform (from the 8260 platform) by
+ * murray.jen...@cmst.csiro.au, 27-Jan-01.
+ */
+
+#include 
+#include 
+#include 
+#include 
+
+void *aligned_buffer;
+
+static void sdhci_reset(struct sdhci_host *host, u8 mask)
+{
+   unsigned long timeout;
+
+   /* Wait max 100 ms */
+   timeout = 100;
+   sdhci_writeb(host, mask, SDHCI_SOFTWARE_RESET);
+   while (sdhci_readb(host, SDHCI_SOFTWARE_RESET) & mask) {
+   if (timeout == 0) {
+   printf("Reset 0x%x never completed.\n", (int)mask);
+   return;
+   }
+   timeout--;
+   udelay(1000);
+   }
+}
+
+static void sdhci_cmd_done(struct sdhci_host *host, struct mmc_cmd *cmd)
+{
+   int i;
+   if (cmd->resp_type & MMC_RSP_136) {
+   /* CRC is stripped so we need to do some shifting. */
+   for (i = 0; i < 4; i++) {
+   cmd->response[i] = sdhci_readl(host,
+   SDHCI_RESPONSE + (3-i)*4) << 8;
+   if (i != 3)
+   cmd->response[i] |= sdhci_readb(host,
+   SDHCI_RESPONSE + (3-i)*4-1);
+   }
+   } else {
+   cmd->response[0] = sdhci_readl(host, SDHCI_RESPONSE);
+   }
+}
+
+static void sdhci_transfer_pio(struct sdhci_host *host, struct mmc_data *data)
+{
+   int i;
+   char *offs;
+   for (i = 0; i < data->blocksize; i += 4) {
+   offs = data->dest + i;
+   if (data->flags == MMC_DATA_READ)
+   *(u32 *)offs = sdhci_readl(host, SDHCI_BUFFER);
+   else
+   sdhci_writel(host, *(u32 *)offs, SDHCI_BUFFER);
+   }
+}
+
+static int sdhci_transfer_data(struct sdhci_host *host, struct mmc_data *data,
+   unsigned int start_addr)
+{
+   unsigned int stat, rdy, mask, block = 0;
+
+   rdy = SDHCI_INT_SPACE_AVAIL | SDHCI_INT_DATA_AVAIL;
+   mask = SDHCI_DATA_AVAILABLE | SDHCI_SPACE_AVAILABLE;
+   do {
+   stat = sdhci_readl(host, SDHCI_INT_STATUS);
+   if (stat & SDHCI_INT_ERROR) {
+   printf("Error detected in status(0x%X)!\n", stat);
+   return -1;
+   }
+   if (stat & rdy) {
+   if (!(sdhci_readl(host, SDHCI_PRESENT_STATE) & mask))
+   continue;
+   sdhci_writel(host, rdy, SDHCI_INT_STATUS);
+   sdhci_transfer_pio(host, data);
+   data->dest += data->blocksize;
+   if (++block >= data->blocks)
+   break;
+   }
+#ifdef CONFIG_MMC_SDMA
+   if (stat & SDHCI_INT_DMA_END) {
+   sdhci_writel(host, SDHCI_INT_DMA_END, SDHCI_INT_STATUS);
+   start_addr

[U-Boot] [PATCH V2 2/2] MMC: add marvell sdhci driver

2011-06-29 Thread Lei Wen
This could support both armada100 and pantheon serial in the mainline,
while this driver also be tested to support upcoming mg, mmp2 and mmp3
hardware.

Signed-off-by: Lei Wen 
---
V1:
add marvell sdhci driver implementation

V2:
rename the previous file name from sdhci-mv to mv_sdhci

 drivers/mmc/Makefile   |1 +
 drivers/mmc/mv_sdhci.c |   21 +
 2 files changed, 22 insertions(+), 0 deletions(-)
 create mode 100644 drivers/mmc/mv_sdhci.c

diff --git a/drivers/mmc/Makefile b/drivers/mmc/Makefile
index 50b5117..bf6534a 100644
--- a/drivers/mmc/Makefile
+++ b/drivers/mmc/Makefile
@@ -39,6 +39,7 @@ COBJS-$(CONFIG_OMAP_HSMMC) += omap_hsmmc.o
 COBJS-$(CONFIG_PXA_MMC) += pxa_mmc.o
 COBJS-$(CONFIG_S5P_MMC) += s5p_mmc.o
 COBJS-$(CONFIG_SDHCI) += sdhci.o
+COBJS-$(CONFIG_MV_SDHCI) += mv_sdhci.o
 
 COBJS  := $(COBJS-y)
 SRCS   := $(COBJS:.o=.c)
diff --git a/drivers/mmc/mv_sdhci.c b/drivers/mmc/mv_sdhci.c
new file mode 100644
index 000..af0d486
--- /dev/null
+++ b/drivers/mmc/mv_sdhci.c
@@ -0,0 +1,21 @@
+#include 
+#include 
+#include 
+
+static char *MVSDH_NAME = "mv_sdh";
+int mv_sdh_init(u32 regbase, u32 max_clk, u32 min_clk, u32 quirks)
+{
+   struct sdhci_host *host = NULL;
+   host = (struct sdhci_host *)malloc(sizeof(struct sdhci_host));
+   if (!host) {
+   printf("sdh_host malloc fail!\n");
+   return 1;
+   }
+
+   host->name = MVSDH_NAME;
+   host->ioaddr = (void *)regbase;
+   host->quirks = quirks;
+   host->version = sdhci_readw(host, SDHCI_HOST_VERSION);
+   add_sdhci(host, max_clk, min_clk);
+   return 0;
+}
-- 
1.7.0.4

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


[U-Boot] [PATCH V2 0/2] add sdhci generic framework

2011-06-29 Thread Lei Wen
V1:
add sdhci generic framework and with marvell sdhci implementation

V2:
rename the previous file name from sdhci-mv to mv_sdhci

Lei Wen (2):
  MMC: add sdhci generic framework
  MMC: add marvell sdhci driver

 drivers/mmc/Makefile   |2 +
 drivers/mmc/mv_sdhci.c |   21 +++
 drivers/mmc/sdhci.c|  433 
 include/sdhci.h|  325 
 4 files changed, 781 insertions(+), 0 deletions(-)
 create mode 100644 drivers/mmc/mv_sdhci.c
 create mode 100644 drivers/mmc/sdhci.c
 create mode 100644 include/sdhci.h

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


Re: [U-Boot] [PATCH 1/2] MMC: add sdhci generic framework

2011-06-29 Thread Lei Wen
Hi Prafulla,

On Wed, Jun 29, 2011 at 2:56 PM, Prafulla Wadaskar  wrote:
>
>
>> -Original Message-
>> From: Lei Wen [mailto:adrian.w...@gmail.com]
>> Sent: Wednesday, June 29, 2011 9:17 AM
>> To: Lei Wen
>> Cc: Andy Fleming; Rob Herring; u-boot@lists.denx.de; Prafulla Wadaskar;
>> Yu Tang; Prabhanjan Sarnaik; Ashish Karkare
>> Subject: Re: [U-Boot] [PATCH 1/2] MMC: add sdhci generic framework
>>
>> Hi All,
>>
>> Any comment to this patch set, could it be merged in this open window?
>
> Hi Lei,
> I ack for the driver.
> Can you re-submit v2 patches as per review comments for v1?

Ok, I would push the v2 patch later.

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


Re: [U-Boot] SPL framework re-design

2011-06-29 Thread Aneesh V
On Tuesday 28 June 2011 09:48 PM, Scott Wood wrote:
> On Tue, 28 Jun 2011 12:24:11 +0530
> Aneesh V  wrote:
>
>> 1. If there are SPL customized generic files like the
>> nand_spl/nand_boot.c where do we keep them? I suggest that we keep them
>> in spl/nand, spl/onenand etc. And for the object file hierarchy let's
>> have something like spl/obj. How about that?
>
> How about drivers/nand/generic_spl.c, drivers/nand/fsl_elbc_spl.c, etc.?

Wolfgang,

How about this suggestion from Scott?
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2] MMC: add sdhci generic framework

2011-06-29 Thread Prafulla Wadaskar


> -Original Message-
> From: Lei Wen [mailto:adrian.w...@gmail.com]
> Sent: Wednesday, June 29, 2011 9:17 AM
> To: Lei Wen
> Cc: Andy Fleming; Rob Herring; u-boot@lists.denx.de; Prafulla Wadaskar;
> Yu Tang; Prabhanjan Sarnaik; Ashish Karkare
> Subject: Re: [U-Boot] [PATCH 1/2] MMC: add sdhci generic framework
> 
> Hi All,
> 
> Any comment to this patch set, could it be merged in this open window?

Hi Lei,
I ack for the driver.
Can you re-submit v2 patches as per review comments for v1?

Copying Andy Fleming on his alternate email id.

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