Re: [U-Boot-Users] [PATCH 3/3][MIPS] lib_mips/time.c: Fix improper use of CFG_HZ and timer routines

2008-05-30 Thread Shinya Kuribayashi
>> probably have to use the initial data structure for this.
> 
> Looked around board_init_r, and it seems there is no {set,get}_timer
> user there. I'm going to leave timestamp as it is at this moment.

s/board_init_r/board_init_f/


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [PATCH 3/3][MIPS] lib_mips/time.c: Fix improper use of CFG_HZ and timer routines

2008-05-30 Thread Shinya Kuribayashi
Wolfgang Denk wrote:
> In message <[EMAIL PROTECTED]> you wrote:
>> My udelay is already global-variable-free. And as for cycles_per_jiffy
>> and expirelo, we could make it work like this:
> ...
>> -static unsigned int expirelo;
>> +static unsigned long cycles_per_jiffy = (CONFIG_MIPS_TIMER_FREQ + CFG_HZ / 
>> 2) / CFG_HZ;
> 
> If it's a constant anyway - then why do we need a variable for it?

Of course, we don't. That was for easy review, will fix.

>> But I have no clue about timestamp.
> 
> Maybe there is a register that is (1) common to all or at least most
> of the supported processors we could use for that? If not, then we

I'm afraid there's not such register left.

> probably have to use the initial data structure for this.

Looked around board_init_r, and it seems there is no {set,get}_timer
user there. I'm going to leave timestamp as it is at this moment.


  Shinya


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [PATCH 4/8] New board SIMPC8313 support: support forbooting from NAND in start.S

2008-05-30 Thread Kumar Gala

On May 30, 2008, at 5:51 PM, Scott Wood wrote:

> On Sat, May 31, 2008 at 06:47:21AM +0800, Liu Dave wrote:
>>
>> ---
>> cpu/mpc83xx/start.S |  310
>> ---
>> 1 files changed, 220 insertions(+), 90 deletions(-)
>>
>> diff --git a/cpu/mpc83xx/start.S b/cpu/mpc83xx/start.S
>> index 309eb30..39bcaa8 100644
>> --- a/cpu/mpc83xx/start.S
>> +++ b/cpu/mpc83xx/start.S
>> @@ -63,6 +63,9 @@
>>  * Use r14 to access the GOT
>>  */
>>  START_GOT
>> +#if defined(CONFIG_NAND_SPL)
>> +GOT_ENTRY(_GOT_TABLE_)
>> +#else
>>  GOT_ENTRY(_GOT2_TABLE_)
>>  GOT_ENTRY(_FIXUP_TABLE_)
>>
>> @@ -74,6 +77,7 @@
>>  GOT_ENTRY(__init_end)
>>  GOT_ENTRY(_end)
>>  GOT_ENTRY(__bss_start)
>> +#endif /* CONFIG_NAND_SPL */
>>  END_GOT
>>
>> [Dave] I strongly suggest we create one lite new start.S for the  
>> NAND boot,
>>   not modify the original start.S
>
> I'd prefer otherwise, if we can keep the #ifdeffing to a minimum.

w/o knowing what has to fit in the first 4k page for NAND for 83xx,  
86xx, and 85xx its difficult to suggest solutions.  However could we  
do something evil and #include start_template.S in the two locations  
or something like that (So the actual source isn't duplicated)?

- k

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [MIPS] Convert CPU type name into CONFIG_CPU_*

2008-05-30 Thread Shinya Kuribayashi
Wolfgang Denk wrote:
>> First of all, current CONFIG_MIPS32 defines are useless. We can even
>> remove them. What is fine granularity for, huh?
> 
> Why are these useless?

There is no user of this config, we can even remove these all.

>> [btw tb0229 is not MIPS32 at all. it's VR4131 based machine.]
> 
> Please excuse my ignorance - but I thought the VR4131 was a 32 bit
> MIPS based processor. Is this understanding incorrect?

All VR41XX processors are 32/64-bit capable. In this case it just runs
in 32-bit mode. What's important is that VR41XX is MIPS III ISA [1].

And in cases where saying MIPS32, it usually means MIPS32 ISA. It's
MIPS32(R) Arhchitecture [2].

[1] http://www.linux-mips.org/wiki/NEC_VR4100
[2] http://www.mips.com/products/processors/architectures/mips32/

See also
[3] http://www.linux-mips.org/wiki/Instruction_Set_Architecture

The binaries compiled for MIPS32 might work on VR41XX machines (I'm not
sure. usually we don't do that.), but that's not my point.

>> And why I use CONFIG_CPU_MIPS32_R1, instead of CONFIG_CPU_MIPS32, is due
>> to avoiding #ifdef mess. CONFIG_CPU_MIPS32 is inadequate for this use.
> 
> Where is such #ifdef mess supposed to happen? Do you refer to existing
> code, or anything you are going to add?

The latter.

> Well, yes - if it's for compiler/assembler options only, then the
> board config file is not the correct place for this.

I don't think so because 1) CPU type is not board-dependent, and 2) the
board config file is not board-specific file, but system config file.
CPU type is reasonably one of system configuration, IMO.

And these CPU type specifiers are not only used for compiler/assembler
optimization, but also is useful when categorizing processor specific
routines. For example, Linux is doing like this:

[arch/mips/mm/Makefile]
  obj-$(CONFIG_CPU_MIPS32) += c-r4k.o cex-gen.o tlb-r4k.o
  obj-$(CONFIG_CPU_TX39XX) += c-tx39.o tlb-r3k.o

In accordance with above, we can do like this:

[cpu/mips/Makefile]
  SOBJS-$(CONFIG_CPU_MIPS32) += cache-mips32.o
  SOBJS-$(CONFIG_CPU_VR41XX) += cache-vr41xx.o

Unfortunately current cache routines doesn't work for all NEC VR-series
processors at all. I'll fix in the future.

At last I have to mention about CPU type specifiers. These specifiers
are neigher MIPS Processor ID (PRId) nor gcc -march option alternatives.
These are virtual options designed for organizing various MIPS options,
routines, and object selections of Makefile. They're defined in Kconfig.

I think these are exactly good granularity, and like to see them in
U-Boot system configuration, too.


  Shinya

P.S. I decided to defer this patch due to some reason. That's another
 story and will inform the list later.


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


[U-Boot-Users] Dijital baskılarınız hakkın da...

2008-05-30 Thread Merkez Baskı

Online Baskı Merkezi

BODY {
BACKGROUND-COLOR: #ff
}
style1 {
FONT-WEIGHT: bold; FONT-FAMILY: Arial, Helvetica, sans-serif
}
style9 {
FONT-FAMILY: Arial, Helvetica, sans-serif
}
style12 {
FONT-SIZE: 16px
}




 


  
  

  


  



  Sayın Yetkili,


  İç ve dış mekan dijital baskı, 
  
  Bina ve cam reklamları, 
  Reklam teşhir ürünleri, 
  Araç kaplama, 

  konularında hizmet veren firmamız her 
  kalite ve fiyat aralığında ürün yelpazesine sahiptir. 

  Konusunda uzman personel ve müşteri 
  memnuniyeti ilkeleriyle sizlerinde tüm baskı ihtiyaçlarını 
  profesyonel bir yaklaşımla çözmeye talibiz.

  

  MERKEZ DİJİTAL BASKI SANAYİ ve TİCARET 
  LTD. ŞTİ.

  Çobançeşme Mah. Çalışlar Cad. No:3 
  Yenibosna İstanbul

  (Koçtaş, Adli tıp yanı, İhlas Koleji 
  karşısı) kroki için 
  tıklayınız... 

  Tel: 0212 452 02 02

  Fax: 0212 552 76 98 

  www.merkezbaski.com 
  






 
 


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [PATCH 4/8] New board SIMPC8313 support: support forbooting from NAND in start.S

2008-05-30 Thread Kumar Gala

On May 30, 2008, at 6:00 PM, Ron Madrid wrote:

> OK.  Thank you for responding, this was my biggest concern.  I tried  
> to talk about what should be
> done about this before, but people didn't appear to be very  
> interested.
>
> Is this something that will go into the cpu/mpc83xx/ folder as  
> well?  If you'd like I can strip
> out everything that isn't involved in the NAND boot (as far as I  
> know) at see what people think.
> Or is this something that the folks at Freescale would rather do?   
> Let me know.

What actual does the NAND version of start.S need to do?

- k

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [PATCH 4/8] New board SIMPC8313 support: support forbooting from NAND in start.S

2008-05-30 Thread Wolfgang Denk
Dear Liu,

in message <[EMAIL PROTECTED]> you wrote:
> 
> > [Dave] I strongly suggest we create one lite new start.S for the NAND boot,
> >not modify the original start.S
> 
> I'd prefer otherwise, if we can keep the #ifdeffing to a minimum.
> 
> [Dave] The new start.S for NAND boot should be very lite. same things
> for 85xx/86xx, creating new start.S for e500/e600 for NAND boot.
> I don't like some much #ifdefine n the start.S which has not good > readable.


Your quoting is a mess.

Please read http://www.netmeister.org/news/learn2quote.html

Please read it, and fix your quoting.

> --_=_NextPart_001_01C8C2A8.E5EB52D1
> Content-Type: text/html;
>   charset="iso-8859-1"
> Content-Transfer-Encoding: quoted-printable

And stop posting HTML.

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: [EMAIL PROTECTED]
Landing: a controlled mid-air collision with a planet.

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [PATCH 4/8] New board SIMPC8313 support: support forbooting from NAND in start.S

2008-05-30 Thread Ron Madrid
OK.  Thank you for responding, this was my biggest concern.  I tried to talk 
about what should be
done about this before, but people didn't appear to be very interested.

Is this something that will go into the cpu/mpc83xx/ folder as well?  If you'd 
like I can strip
out everything that isn't involved in the NAND boot (as far as I know) at see 
what people think. 
Or is this something that the folks at Freescale would rather do?  Let me know.

Ron
--- Liu Dave <[EMAIL PROTECTED]> wrote:

> 
> ---
>  cpu/mpc83xx/start.S |  310
> ---
>  1 files changed, 220 insertions(+), 90 deletions(-)
> 
> diff --git a/cpu/mpc83xx/start.S b/cpu/mpc83xx/start.S
> index 309eb30..39bcaa8 100644
> --- a/cpu/mpc83xx/start.S
> +++ b/cpu/mpc83xx/start.S
> @@ -63,6 +63,9 @@
>   * Use r14 to access the GOT
>   */
>   START_GOT
> +#if defined(CONFIG_NAND_SPL)
> + GOT_ENTRY(_GOT_TABLE_)
> +#else
>   GOT_ENTRY(_GOT2_TABLE_)
>   GOT_ENTRY(_FIXUP_TABLE_)
>  
> @@ -74,6 +77,7 @@
>   GOT_ENTRY(__init_end)
>   GOT_ENTRY(_end)
>   GOT_ENTRY(__bss_start)
> +#endif /* CONFIG_NAND_SPL */
>   END_GOT
>  
> [Dave] I strongly suggest we create one lite new start.S for the NAND boot,
>not modify the original start.S
> 


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [PATCH 4/8] New board SIMPC8313 support: support forbooting from NAND in start.S

2008-05-30 Thread Liu Dave
> diff --git a/cpu/mpc83xx/start.S b/cpu/mpc83xx/start.S
> index 309eb30..39bcaa8 100644
> --- a/cpu/mpc83xx/start.S
> +++ b/cpu/mpc83xx/start.S
> @@ -63,6 +63,9 @@
>   * Use r14 to access the GOT
>   */
>   START_GOT
> +#if defined(CONFIG_NAND_SPL)
> + GOT_ENTRY(_GOT_TABLE_)
> +#else
>   GOT_ENTRY(_GOT2_TABLE_)
>   GOT_ENTRY(_FIXUP_TABLE_)
>  
> @@ -74,6 +77,7 @@
>   GOT_ENTRY(__init_end)
>   GOT_ENTRY(_end)
>   GOT_ENTRY(__bss_start)
> +#endif /* CONFIG_NAND_SPL */
>   END_GOT
>  
> [Dave] I strongly suggest we create one lite new start.S for the NAND boot,
>not modify the original start.S

I'd prefer otherwise, if we can keep the #ifdeffing to a minimum.

[Dave] The new start.S for NAND boot should be very lite. same things
for 85xx/86xx, creating new start.S for e500/e600 for NAND boot.
I don't like some much #ifdefine n the start.S which has not good readable.
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [PATCH 4/8] New board SIMPC8313 support: support forbooting from NAND in start.S

2008-05-30 Thread Scott Wood
On Sat, May 31, 2008 at 06:47:21AM +0800, Liu Dave wrote:
> 
> ---
>  cpu/mpc83xx/start.S |  310
> ---
>  1 files changed, 220 insertions(+), 90 deletions(-)
> 
> diff --git a/cpu/mpc83xx/start.S b/cpu/mpc83xx/start.S
> index 309eb30..39bcaa8 100644
> --- a/cpu/mpc83xx/start.S
> +++ b/cpu/mpc83xx/start.S
> @@ -63,6 +63,9 @@
>   * Use r14 to access the GOT
>   */
>   START_GOT
> +#if defined(CONFIG_NAND_SPL)
> + GOT_ENTRY(_GOT_TABLE_)
> +#else
>   GOT_ENTRY(_GOT2_TABLE_)
>   GOT_ENTRY(_FIXUP_TABLE_)
>  
> @@ -74,6 +77,7 @@
>   GOT_ENTRY(__init_end)
>   GOT_ENTRY(_end)
>   GOT_ENTRY(__bss_start)
> +#endif /* CONFIG_NAND_SPL */
>   END_GOT
>  
> [Dave] I strongly suggest we create one lite new start.S for the NAND boot,
>not modify the original start.S

I'd prefer otherwise, if we can keep the #ifdeffing to a minimum.

-Scott

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [PATCH 4/8] New board SIMPC8313 support: support forbooting from NAND in start.S

2008-05-30 Thread Liu Dave

---
 cpu/mpc83xx/start.S |  310
---
 1 files changed, 220 insertions(+), 90 deletions(-)

diff --git a/cpu/mpc83xx/start.S b/cpu/mpc83xx/start.S
index 309eb30..39bcaa8 100644
--- a/cpu/mpc83xx/start.S
+++ b/cpu/mpc83xx/start.S
@@ -63,6 +63,9 @@
  * Use r14 to access the GOT
  */
START_GOT
+#if defined(CONFIG_NAND_SPL)
+   GOT_ENTRY(_GOT_TABLE_)
+#else
GOT_ENTRY(_GOT2_TABLE_)
GOT_ENTRY(_FIXUP_TABLE_)
 
@@ -74,6 +77,7 @@
GOT_ENTRY(__init_end)
GOT_ENTRY(_end)
GOT_ENTRY(__bss_start)
+#endif /* CONFIG_NAND_SPL */
END_GOT
 
[Dave] I strongly suggest we create one lite new start.S for the NAND boot,
   not modify the original start.S
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [PATCH 7/8] New board SIMPC8313 support: nand support

2008-05-30 Thread Ron Madrid
It probably wouldn't be too much trouble for me to revert back to that branch, 
but if we are
looking at a matter of weeks then it's probably not worth the time.  I guess in 
the mean time I'll
just focus on getting something done with the cpu/mpc83xx/start.S file since it 
will affect other
boards and people are complaining about the changes to it.

Thanks for all the help.  You've been very kind and I appreciate it.  Not 
having a mentor or
someone experienced in these things at work has been very hindering for me, and 
I'm sure
frustrating for several people on this mail-list.

Ron
--- Scott Wood <[EMAIL PROTECTED]> wrote:

> On Fri, May 30, 2008 at 03:02:54PM -0700, Ron Madrid wrote:
> > So am I just stuck until then, since we clearly shouldn't put old drivers 
> > into the code, but
> the
> > mtd branch is not rebased yet?
> 
> Yes, unless you want to target the current mtd-2.6.22.1 branch (I don't
> know how much has changed that affects the board port).  I'll try to do
> it sometime early next week, though.
> 
> -Scott
> 


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [PATCH 7/8] New board SIMPC8313 support: nand support

2008-05-30 Thread Scott Wood
On Fri, May 30, 2008 at 03:02:54PM -0700, Ron Madrid wrote:
> So am I just stuck until then, since we clearly shouldn't put old drivers 
> into the code, but the
> mtd branch is not rebased yet?

Yes, unless you want to target the current mtd-2.6.22.1 branch (I don't
know how much has changed that affects the board port).  I'll try to do
it sometime early next week, though.

-Scott

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [PATCH 7/8] New board SIMPC8313 support: nand support

2008-05-30 Thread Ron Madrid
So am I just stuck until then, since we clearly shouldn't put old drivers into 
the code, but the
mtd branch is not rebased yet?  Or is there some other road I should be 
following?

Ron

--- Scott Wood <[EMAIL PROTECTED]> wrote:

> On Fri, May 30, 2008 at 02:01:09PM -0700, Ron Madrid wrote:
> > So does this mean that I need to now base all of my patches off of the 
> > mtd-2.6.22.1 branch on
> the
> > u-boot-nand-flash tree?  How do the two (u-boot and u-boot-nand-flash) 
> > coincide, or don't
> they? 
> > It looks like in the Makefile of the mtd-2.6.22.1 branch the version of 
> > u-boot is 1.3.1.
> 
> I hope to get mtd-2.6.22.1 rebased onto current u-boot soon.
> 
> -Scott
> 


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [AT91] Problems configuring bit-banged I2C

2008-05-30 Thread Sergey Lapin
> Why don't you use the gpio function?
Well, I tried to use them but that lead to same result.

> > +
> void at91sam9260_i2c_init(void)
> {
>   at91_set_GPIO_periph(AT91_PIN_PA23, 0);
>   at91_set_multi_drive(AT91_PIN_PA23, 1);
> 
>   at91_set_A_periph(AT91_PIN_PA24, 0);
Why?

>   at91_set_multi_drive(AT91_PIN_PA24, 1);
> }
> 
> void at91sam9260_i2c_scl(unsigned long bit)
> {
>   at91_set_gpio_value(AT91_PIN_PA24, bit);
> }
> 
> void at91sam9260_i2c_sda(unsigned long bit)
> {
>   at91_set_gpio_value(AT91_PIN_PA23, bit)
> }
> int at91sam9260_i2c_read(void)
> {
>   retrun at91_get_gpio_value(AT91_PIN_PA23);
> }
> void at91sam9260_i2c_active()
> {
>   gpio_direction_output(AT91_PIN_PA23, 0);
> }
> 
> void at91sam9260_i2c_tristate()
> {
>   gpio_direction_input(AT91_PIN_PA23);
> }
Thanks a lot for your help, but this did not work either.
iprobe returns full 0x0 - 0x7f range as devices.
Linux i2c-gpio works properly and returns proper set of devices (0x68,
0x50). Is it me or there's bug somewhere?
I can see output values with oscilloscope. I wonder what happens.

> 
> I sync it will be better to use the hardware stack which is not too
> complicate to implement

As commented in Linux kernel about i2c_at91, it is very buggy,
and I was afraid that it could not work for me at all. i2c-gpio works
in Linux. What prevents soft i2c from working ont the same CPU?
This stuff is a mystery for me :(


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [PATCH 7/8] New board SIMPC8313 support: nand support

2008-05-30 Thread Scott Wood
On Fri, May 30, 2008 at 02:01:09PM -0700, Ron Madrid wrote:
> So does this mean that I need to now base all of my patches off of the 
> mtd-2.6.22.1 branch on the
> u-boot-nand-flash tree?  How do the two (u-boot and u-boot-nand-flash) 
> coincide, or don't they? 
> It looks like in the Makefile of the mtd-2.6.22.1 branch the version of 
> u-boot is 1.3.1.

I hope to get mtd-2.6.22.1 rebased onto current u-boot soon.

-Scott

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [PATCH 7/8] New board SIMPC8313 support: nand support

2008-05-30 Thread Ron Madrid
So does this mean that I need to now base all of my patches off of the 
mtd-2.6.22.1 branch on the
u-boot-nand-flash tree?  How do the two (u-boot and u-boot-nand-flash) 
coincide, or don't they? 
It looks like in the Makefile of the mtd-2.6.22.1 branch the version of u-boot 
is 1.3.1.

Ron
--- Scott Wood <[EMAIL PROTECTED]> wrote:

> Ron Madrid wrote:
> > New board SIMPC8313 support: nand support
> > 
> > I realize that perhaps these files should be in the
> > drivers/mtd/nand folder, but I have been informed by
> > Scott Wood that he will be soon working on nand
> > support for the MPC83XX(?) family of chips.  So these
> > will be considered temporary and removed at that time.
> 
> I'd really rather not merge this old driver -- can you work off of the 
> mtd-2.6.22.1 branch of the u-boot-nand-flash tree (which has a newer 
> elbc fcm nand driver)?
> 
> -Scott
> 


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


[U-Boot-Users] eth0 not geting enabled

2008-05-30 Thread Avinash Vijayvergia
Hi there

I am working on at91sam9260ek. I have put kernel and rfs on dataflash. Now this 
board boots up but doesn't enable eth0. I searched net and found that if I do a 
ping it enables phy (MD9161A). But if I do that when there is no network u-boot 
never recovers. Can someone tell me the way out.

Thanks
Avinash



  -
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [PATCH 4/8] New board SIMPC8313 support: support for booting from NAND in start.S

2008-05-30 Thread Ron Madrid
With the limited space I found that I needed to save every byte I could.  What 
in particular
concerns you?

Ron
--- Kumar Gala <[EMAIL PROTECTED]> wrote:

> 
> On May 30, 2008, at 1:13 PM, Ron Madrid wrote:
> 
> > New board SIMPC8313 support: support for booting from
> > NAND in start.S
> >
> > Reorganization/optimization of a few functions to fit
> > into the 4K FCM boot RAM of the MPC8313 for nand_spl
> > build.
> >
> > Signed-off-by: Ron Madrid
> > ---
> > cpu/mpc83xx/start.S |  310
> > ---
> > 1 files changed, 220 insertions(+), 90 deletions(-)
> 
> there are a lot of changes here that don't seem necessary or gratuitous
> 
> - k
> 
> 


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [PATCH]env_nand.c Added bad block management for environment variables

2008-05-30 Thread Stuart Wood
Scott, I this this one is it, and thnaks for pointing out the
nand_erase_opts() function.

Stuart

---
Modified to check for bad blocks and to skipping over them when
CFG_ENV_RANGE has been defined.
CFG_ENV_RANGE must be larger than CFG_ENV_SIZE and aligned to the NAND
flash block size.

signed off by Stuart Wood <[EMAIL PROTECTED]>
---


diff --git a/common/env_nand.c b/common/env_nand.c
index 49742f5..508d7a4 100644
--- a/common/env_nand.c
+++ b/common/env_nand.c
@@ -1,4 +1,7 @@
 /*
+ * (C) Copyright 2008
+ * Stuart Wood, Lab X Technologies <[EMAIL PROTECTED]>
+ *
  * (C) Copyright 2004
  * Jian Zhang, Texas Instruments, [EMAIL PROTECTED]

@@ -53,6 +56,10 @@
 #error CONFIG_INFERNO not supported yet
 #endif

+#ifndef CFG_ENV_RANGE
+#define CFG_ENV_RANGE  CFG_ENV_SIZE
+#endif
+
 int nand_legacy_rw (struct nand_chip* nand, int cmd,
size_t start, size_t len,
size_t * retlen, u_char * buf);
@@ -151,35 +158,71 @@ int env_init(void)
  * The legacy NAND code saved the environment in the first NAND device i.e.,
  * nand_dev_desc + 0. This is also the behaviour using the new NAND code.
  */
+int writeenv(size_t offset, u_char *buf)
+{
+   size_t end = offset + CFG_ENV_RANGE;
+   size_t amount_saved = 0;
+   size_t blocksize;
+
+   u_char *char_ptr;
+
+   blocksize = nand_info[0].erasesize;
+
+   while (amount_saved < CFG_ENV_SIZE && offset < end) {
+   if (nand_block_isbad(&nand_info[0], offset)) {
+   offset += blocksize;
+   } else {
+   char_ptr = &buf[amount_saved];
+   if (nand_write(&nand_info[0], offset, &blocksize,
+   char_ptr))
+   return 1;
+   offset += blocksize;
+   amount_saved += blocksize;
+   }
+   }
+   if (amount_saved != CFG_ENV_SIZE)
+   return 1;
+
+   return 0;
+}  
 #ifdef CFG_ENV_OFFSET_REDUND
 int saveenv(void)
 {
size_t total;
int ret = 0;
+   nand_erase_options_t nand_erase_options;

env_ptr->flags++;
total = CFG_ENV_SIZE;

+   nand_erase_options.length = CFG_ENV_RANGE;
+   nand_erase_options.quiet = 0;
+   nand_erase_options.jffs2 = 0;
+   nand_erase_options.scrub = 0;
+
+   if (CFG_ENV_RANGE < CFG_ENV_SIZE)
+   return 1;
if(gd->env_valid == 1) {
-   puts ("Erasing redundant Nand...");
-   if (nand_erase(&nand_info[0],
-  CFG_ENV_OFFSET_REDUND, CFG_ENV_SIZE))
+   puts ("Erasing redundant Nand...\n");
+   nand_erase_options.offset = CFG_ENV_OFFSET_REDUND;
+   if (nand_erase_opts(&nand_info[0], &nand_erase_options))
return 1;
+
puts ("Writing to redundant Nand... ");
-   ret = nand_write(&nand_info[0], CFG_ENV_OFFSET_REDUND, &total,
-(u_char*) env_ptr);
+   ret = writeenv(CFG_ENV_OFFSET_REDUND, (u_char *) env_ptr);
} else {
-   puts ("Erasing Nand...");
-   if (nand_erase(&nand_info[0],
-  CFG_ENV_OFFSET, CFG_ENV_SIZE))
+   puts ("Erasing Nand...\n");
+   nand_erase_options.offset = CFG_ENV_OFFSET;
+   if (nand_erase_opts(&nand_info[0], &nand_erase_options))
return 1;

puts ("Writing to Nand... ");
-   ret = nand_write(&nand_info[0], CFG_ENV_OFFSET, &total,
-(u_char*) env_ptr);
+   ret = writeenv(CFG_ENV_OFFSET, (u_char *) env_ptr);
}
-   if (ret || total != CFG_ENV_SIZE)
+   if (ret) {
+   puts("FAILED!\n");
return 1;
+   }

puts ("done\n");
gd->env_valid = (gd->env_valid == 2 ? 1 : 2);
@@ -191,15 +234,24 @@ int saveenv(void)
size_t total;
int ret = 0;

-   puts ("Erasing Nand...");
-   if (nand_erase(&nand_info[0], CFG_ENV_OFFSET, CFG_ENV_SIZE))
+   nand_erase_options.length = CFG_ENV_RANGE;
+   nand_erase_options.quiet = 0;
+   nand_erase_options.jffs2 = 0;
+   nand_erase_options.scrub = 0;
+   nand_erase_options.offset = CFG_ENV_OFFSET;
+
+   if (CFG_ENV_RANGE < CFG_ENV_SIZE)
+   return 1;
+   puts ("Erasing Nand...\n");
+   if (nand_erase_opts(&nand_info[0], &nand_erase_options))
return 1;

puts ("Writing to Nand... ");
total = CFG_ENV_SIZE;
-   ret = nand_write(&nand_info[0], CFG_ENV_OFFSET, &total, 
(u_char*)env_ptr);
-   if (ret || total != CFG_ENV_SIZE)
+   if (writeenv(CFG_ENV_OFFSET, env_ptr)) {
+   puts("FAILED!\n");
return 1;
+   }

puts ("done\n");
return ret;
@@ -207,6 +259,33 @@ int saveenv(void)
 #endif /* CFG_ENV_OFFSET_REDUND */
 #end

Re: [U-Boot-Users] [PATCH 2/8] New board SIMPC8313 support: README

2008-05-30 Thread Ron Madrid
It is.  I'll change that.

Thank you,

Ron
--- Kumar Gala <[EMAIL PROTECTED]> wrote:

> 
> On May 30, 2008, at 1:08 PM, Ron Madrid wrote:
> 
> > New board SIMPC8313 support: README
> >
> > Signed-off-by: Ron Madrid
> > ---
> > doc/README.simpc8313 |   70
> > ++
> > 1 files changed, 70 insertions(+), 0 deletions(-)
> > create mode 100644 doc/README.simpc8313
> >
> > diff --git a/doc/README.simpc8313
> > b/doc/README.simpc8313
> > new file mode 100644
> > index 000..60e5ab8
> > --- /dev/null
> > +++ b/doc/README.simpc8313
> > @@ -0,0 +1,70 @@
> > +Freescale MPC8313ERDB Board
> 
> this seems wrong.
> 
> - k
> 
> 


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [PATCH 4/8] New board SIMPC8313 support: support for booting from NAND in start.S

2008-05-30 Thread Kumar Gala

On May 30, 2008, at 1:13 PM, Ron Madrid wrote:

> New board SIMPC8313 support: support for booting from
> NAND in start.S
>
> Reorganization/optimization of a few functions to fit
> into the 4K FCM boot RAM of the MPC8313 for nand_spl
> build.
>
> Signed-off-by: Ron Madrid
> ---
> cpu/mpc83xx/start.S |  310
> ---
> 1 files changed, 220 insertions(+), 90 deletions(-)

there are a lot of changes here that don't seem necessary or gratuitous

- k


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [PATCH 2/8] New board SIMPC8313 support: README

2008-05-30 Thread Kumar Gala

On May 30, 2008, at 1:08 PM, Ron Madrid wrote:

> New board SIMPC8313 support: README
>
> Signed-off-by: Ron Madrid
> ---
> doc/README.simpc8313 |   70
> ++
> 1 files changed, 70 insertions(+), 0 deletions(-)
> create mode 100644 doc/README.simpc8313
>
> diff --git a/doc/README.simpc8313
> b/doc/README.simpc8313
> new file mode 100644
> index 000..60e5ab8
> --- /dev/null
> +++ b/doc/README.simpc8313
> @@ -0,0 +1,70 @@
> +Freescale MPC8313ERDB Board

this seems wrong.

- k


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [PATCH 5/8] New board SIMPC8313 support: nand_spl

2008-05-30 Thread Ron Madrid
I'm sorry, I didn't think my e-mail would do that. 
I'll fix this.

Ron
--- Scott Wood <[EMAIL PROTECTED]> wrote:

> On Fri, May 30, 2008 at 11:15:16AM -0700, Ron Madrid
> wrote:
> > New board SIMPC8313 support: nand_spl
> > 
> > Signed-off-by: Ron Madrid
> > ---
> >  nand_spl/board/sheldon/simpc8313/Makefile   |  
> 91
> > +++
> >  nand_spl/board/sheldon/simpc8313/config.mk  |  
> 50
> > +++
> >  nand_spl/board/sheldon/simpc8313/u-boot.lds |  
> 65
> > +++
> >  3 files changed, 206 insertions(+), 0
> deletions(-)
> >  create mode 100644
> > nand_spl/board/sheldon/simpc8313/Makefile
> >  create mode 100644
> > nand_spl/board/sheldon/simpc8313/config.mk
> >  create mode 100644
> > nand_spl/board/sheldon/simpc8313/u-boot.lds
> 
> This patch is badly line-wrapped...
> 
> -Scott
> 


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [PATCH] TQM85xx: NAND support via local bus UPMB

2008-05-30 Thread Anton Vorontsov
On Fri, May 30, 2008 at 08:00:32PM +0200, Wolfgang Grandegger wrote:
[...]
> Fix that, but I can still not access the device properly. I'm a bit
> puzzled because it uses a different algorithm to access the device.
> While my and the Linux fsl_upm driver uses NAND_ALE, NAND_CLE and
> friends to manage the access via hwcontrol callback, the fsl_upm driver
> of U-Boot uses the cmdfunc callback doing different things. 

I wonder if your NAND chip is a large page one? Because currently
fsl_upm_nand hardcodes OOB stuff (bad thing, but with old mtd subsystem
I didn't find better way ;-).

As for u-boot and linux doing different things... with this patch
u-boot and linux are identical:

http://www.denx.de/cgi-bin/gitweb.cgi?p=u-boot/u-boot-nand-flash.git;a=commitdiff;h=dffa9a8b31b2c21fd3a72ba1f58dd04911b95b6f

This is in U-Boot's mtd-2.6.22.1 branch though. :-/ Your approach with hwctl
seem to be more universal (for old mtd subsystem), since it doesn't duplicate
MTD cmdfunc, thus should work for all NAND chips...

Could you prepare a patch that replacing fsl_upm_nand.c's current logic
with yours (that should work for your NAND chip), and I'll test it
on MPC8360E-RDK?

-- 
Anton Vorontsov
email: [EMAIL PROTECTED]
irc://irc.freenode.net/bd2

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [PATCH 7/8] New board SIMPC8313 support: nand support

2008-05-30 Thread Ron Madrid
Sure can.  I was not aware of this.

Ron
--- Scott Wood <[EMAIL PROTECTED]> wrote:

> Ron Madrid wrote:
> > New board SIMPC8313 support: nand support
> > 
> > I realize that perhaps these files should be in
> the
> > drivers/mtd/nand folder, but I have been informed
> by
> > Scott Wood that he will be soon working on nand
> > support for the MPC83XX(?) family of chips.  So
> these
> > will be considered temporary and removed at that
> time.
> 
> I'd really rather not merge this old driver -- can
> you work off of the 
> mtd-2.6.22.1 branch of the u-boot-nand-flash tree
> (which has a newer 
> elbc fcm nand driver)?
> 
> -Scott
> 


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [PATCH 7/8] New board SIMPC8313 support: nand support

2008-05-30 Thread Scott Wood
Ron Madrid wrote:
> New board SIMPC8313 support: nand support
> 
> I realize that perhaps these files should be in the
> drivers/mtd/nand folder, but I have been informed by
> Scott Wood that he will be soon working on nand
> support for the MPC83XX(?) family of chips.  So these
> will be considered temporary and removed at that time.

I'd really rather not merge this old driver -- can you work off of the 
mtd-2.6.22.1 branch of the u-boot-nand-flash tree (which has a newer 
elbc fcm nand driver)?

-Scott

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [PATCH 5/8] New board SIMPC8313 support: nand_spl

2008-05-30 Thread Scott Wood
On Fri, May 30, 2008 at 11:15:16AM -0700, Ron Madrid wrote:
> New board SIMPC8313 support: nand_spl
> 
> Signed-off-by: Ron Madrid
> ---
>  nand_spl/board/sheldon/simpc8313/Makefile   |   91
> +++
>  nand_spl/board/sheldon/simpc8313/config.mk  |   50
> +++
>  nand_spl/board/sheldon/simpc8313/u-boot.lds |   65
> +++
>  3 files changed, 206 insertions(+), 0 deletions(-)
>  create mode 100644
> nand_spl/board/sheldon/simpc8313/Makefile
>  create mode 100644
> nand_spl/board/sheldon/simpc8313/config.mk
>  create mode 100644
> nand_spl/board/sheldon/simpc8313/u-boot.lds

This patch is badly line-wrapped...

-Scott

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


[U-Boot-Users] [PATCH 8/8] New board SIMPC8313 support: nand_boot.c, sdram.c, simpc8313.c

2008-05-30 Thread Ron Madrid
New board SIMPC8313 support: nand_boot.c, sdram.c,
simpc8313.c

Remaining board specific files.

Signed-off-by: Ron Madrid
---
 board/sheldon/simpc8313/nand_boot.c |  424
+++
 board/sheldon/simpc8313/sdram.c |  204
+
 board/sheldon/simpc8313/simpc8313.c |  113 ++
 3 files changed, 741 insertions(+), 0 deletions(-)
 create mode 100644
board/sheldon/simpc8313/nand_boot.c
 create mode 100644 board/sheldon/simpc8313/sdram.c
 create mode 100644
board/sheldon/simpc8313/simpc8313.c

diff --git a/board/sheldon/simpc8313/nand_boot.c
b/board/sheldon/simpc8313/nand_boot.c
new file mode 100644
index 000..39a5616
--- /dev/null
+++ b/board/sheldon/simpc8313/nand_boot.c
@@ -0,0 +1,424 @@
+/*
+ * Copyright 2008 Sheldon Instruments, Inc.
+ * 
+ * Origin from MPC8313EMDS of
[EMAIL PROTECTED]
+ *
+ * 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 
+
+/* NAND ECC checking method - 0 = no hardware ECC
check */
+#define NAND_HARD_ECC ((CFG_NAND_BR0_PRELIM >>
BR_DECC_SHIFT) & 3)
+
+/* NAND Page Size : 0 = small page (512 bytes ), 1 =
large page (2048 bytes) */
+#define NAND_PGS ((CFG_NAND_OR0_PRELIM >>
OR_FCM_PGS_SHIFT) & 1)
+
+/* Timeout in case FCM does not complete */
+#define NAND_TIMEOUT(100)
+
+/* Delay before restarting after a fatal u-boot error
*/
+#define RESTART_DELAY   (0x400)
+
+/* Error codes returned from nand_read_next_block()  
 */
+#define NAND_OK  (1)   /* read block okay  
  */
+#define NAND_BAD_BLOCK   (0)   /* block marked bad -
skip block   */
+#define NAND_ERR_TIMEOUT (-1)  /* timeout error -
fatal error */
+#define NAND_ERR_ECC (-2)  /* uncorrectable ecc -
fatal error */
+
+/* Macros to control selected serial port */
+#if CONFIG_CONS_INDEX == 1 &&
defined(CFG_NS16550_COM1)
+#define NS16550_COM ((NS16550_t)CFG_NS16550_COM1)
+#elif CONFIG_CONS_INDEX == 2 &&
defined(CFG_NS16550_COM2)
+#define NS16550_COM ((NS16550_t)CFG_NS16550_COM2)
+#else
+#warning  "*"
+#warning  "** No console port defined **"
+#warning  "*"
+#define NS16550_COM ((NS16550_t)0)
+#define CFG_NAND_BOOT_QUIET
+#endif /* CONFIG_CONS_INDEX */
+
+/* Quiet Boot - only prints fatal error messages */
+#if defined(CFG_NAND_BOOT_QUIET)
+#define status_putc(c) { while (0); }
+#define status_puts(s) { while (0); }
+#else
+#define status_putc(c) { putc(c); }
+#define status_puts(s) { puts(s); }
+#endif /* CFG_NAND_BOOT_QUIET */
+
+#if !(NAND_HARD_ECC)
+const u_char ecc_pos[] = {
+#if (NAND_PGS)
+   40, 41, 42, 43, 44, 45, 46, 47,
+   48, 49, 50, 51, 52, 53, 54, 55,
+   56, 57, 58, 59, 60, 61, 62, 63
+#else
+   0, 1, 2, 3, 6, 7
+#endif /* NAND_PGS */
+};
+#endif /* !(NAND_HARD_ECC) */
+
+/* u-boot version string from start.S */
+extern char version_string[];
+
+/* nand_ecc.c */
+extern int nand_correct_data (u_char * dat, const
u_char * ecc_pos, int blocks);
+
+/* hang */
+void hang (void)
+{
+   while(1);
+}
+
+#define LCRVAL LCR_8N1 /* 8 data, 1 stop, no
parity */
+#define MCRVAL (MCR_DTR | MCR_RTS) /* RTS/DTR */
+#define FCRVAL (FCR_FIFO_EN | FCR_RXSR | FCR_TXSR) /*
Clear & enable FIFOs */
+
+static
+void NS16550a_init (int baud_divisor)
+{
+   if (NS16550_COM) {
+   NS16550_COM->ier = 0x00;
+   NS16550_COM->lcr = LCR_BKSE | LCRVAL;
+   NS16550_COM->dll = baud_divisor & 0xff;
+   NS16550_COM->dlm = (baud_divisor >> 8) & 0xff;
+   NS16550_COM->lcr = LCRVAL;
+   NS16550_COM->mcr = MCRVAL;
+   NS16550_COM->fcr = FCRVAL;
+   }
+}
+
+/* print a single character, with an extra line feed
for return characters */
+void putc (const char c)
+{
+   if (NS16550_COM) {
+   if (c == '\n') {
+   while ((NS16550_COM->lsr & LSR_THRE) == 0);
+   NS16550_COM->thr = '\r';
+   }
+   while ((NS16550_COM->lsr & LSR_THRE) == 0);
+   NS16550_COM->thr = c;
+   }
+}
+
+/* print an entire null terminated string */
+void puts (const char *s)
+{
+   while (*s

[U-Boot-Users] [PATCH 7/8] New board SIMPC8313 support: nand support

2008-05-30 Thread Ron Madrid
New board SIMPC8313 support: nand support

I realize that perhaps these files should be in the
drivers/mtd/nand folder, but I have been informed by
Scott Wood that he will be soon working on nand
support for the MPC83XX(?) family of chips.  So these
will be considered temporary and removed at that time.

Signed-off-by: Ron Madrid
---
 board/sheldon/simpc8313/nand.c |  868

 board/sheldon/simpc8313/nand_ecc.c |  214 +
 2 files changed, 1082 insertions(+), 0 deletions(-)
 create mode 100644 board/sheldon/simpc8313/nand.c
 create mode 100644 board/sheldon/simpc8313/nand_ecc.c

diff --git a/board/sheldon/simpc8313/nand.c
b/board/sheldon/simpc8313/nand.c
new file mode 100644
index 000..a8fbf96
--- /dev/null
+++ b/board/sheldon/simpc8313/nand.c
@@ -0,0 +1,868 @@
+/*
+ * Copyright (C) Freescale Semiconductor, Inc. 2006. 
+ * 
+ * Initialized by [EMAIL PROTECTED]
+ *[EMAIL PROTECTED]
+ *
+ * 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 
+
+#ifdef CONFIG_CMD_NAND
+#if defined(CFG_NAND_LEGACY)
+ #error "U-Boot legacy NAND commands not supported."
+#else
+
+#include 
+#include 
+#include 
+
+#undef CFG_FCM_DEBUG
+#define CFG_FCM_DEBUG_LVL 1
+#ifdef CFG_FCM_DEBUG
+#define FCM_DEBUG(n, args...)  \
+   do {\
+   if (n <= (CFG_FCM_DEBUG_LVL + 0))   \
+   printf(args);   \
+   } while(0)
+#else /* CONFIG_FCM_DEBUG */
+#define FCM_DEBUG(n, args...) do { } while(0)
+#endif
+
+#define MIN(x, y)  ((x < y) ? x : y)
+
+#define ERR_BYTE 0xFF  /* Value returned for read
bytes when read failed */
+
+#define FCM_TIMEOUT_USECS 10 /* Maximum number of
uSecs to wait for FCM */
+
+/* Private structure holding NAND Flash device
specific information */
+struct fcm_nand {
+   int bank;   /* Chip select bank number 
   */
+   unsigned intbase;   /* Chip select base address
   */
+   int pgs;/* NAND page size  
   */
+   int oobbuf; /* Pointer to OOB block
   */
+   unsigned intpage;   /* Last page written to /
read from*/
+   unsigned intfmr;/* FCM Flash Mode Register
value   */
+   unsigned intmdr;/* UPM/FCM Data Register
value */
+   unsigned intuse_mdr;/* Non zero if the MDR is
to be set*/
+   u_char *addr;   /* Address of assigned
FCM buffer  */
+   unsigned intread_bytes; /* Number of bytes read
during command */
+   unsigned intindex;  /* Pointer to next byte to
'read'  */
+   unsigned intreq_bytes;  /* Number of bytes read if
command ok  */
+   unsigned intreq_index;  /* New read index if
command ok*/
+   unsigned intstatus; /* status read from LTESR
after last op*/
+};
+
+
+/* These map to the positions used by the FCM
hardware ECC generator */
+
+/* Small Page FLASH with FMR[ECCM] = 0 */
+static struct nand_oobinfo fcm_oob_sp_eccm0 = { /*
TODO */
+   .useecc = MTD_NANDECC_AUTOPL_USR, /*
MTD_NANDECC_PLACEONLY, */
+   .eccbytes = 3,
+   .eccpos = {6, 7, 8},
+   .oobfree = { {0, 5}, {9, 7} }
+};
+
+/* Small Page FLASH with FMR[ECCM] = 1 */
+static struct nand_oobinfo fcm_oob_sp_eccm1 = { /*
TODO */
+   .useecc = MTD_NANDECC_AUTOPL_USR, /*
MTD_NANDECC_PLACEONLY, */
+   .eccbytes = 3,
+   .eccpos = {8, 9, 10},
+   .oobfree = { {0, 5}, {6, 2}, {11, 5} }
+};
+
+/* Large Page FLASH with FMR[ECCM] = 0 */
+static struct nand_oobinfo fcm_oob_lp_eccm0 = {
+   .useecc = MTD_NANDECC_AUTOPL_USR, /*
MTD_NANDECC_PLACEONLY, */
+   .eccbytes = 12,
+   .eccpos = {6, 7, 8, 22, 23, 24, 38, 39, 40, 54, 55,
56},
+   .oobfree = { {1, 5}, {9, 13}, {25, 13}, {41, 13},
{57, 7} }
+};
+
+/* Large Page FLASH with FMR[ECCM] = 1 */
+static struct nand_oobinfo fcm_oob_lp_eccm1 = {
+   .useecc = MTD_NANDECC_AUTOPL_USR, /*
MTD_NANDECC_PLACEONLY, */
+   .eccbytes = 12,
+   .eccpos = {8, 9, 10, 24, 25, 26, 40, 41, 42, 56, 57,
58},
+   .oobfree = { {1, 7}, {11, 13},

[U-Boot-Users] [PATCH 6/8] New board SIMPC8313 support: Makefile, config.mk

2008-05-30 Thread Ron Madrid
New board SIMPC8313 support: Makefile, config.mk

Signed-off-by: Ron Madrid
---
 board/sheldon/simpc8313/Makefile  |   50
+
 board/sheldon/simpc8313/config.mk |3 ++
 2 files changed, 53 insertions(+), 0 deletions(-)
 create mode 100644 board/sheldon/simpc8313/Makefile
 create mode 100644 board/sheldon/simpc8313/config.mk

diff --git a/board/sheldon/simpc8313/Makefile
b/board/sheldon/simpc8313/Makefile
new file mode 100644
index 000..6f0a19d
--- /dev/null
+++ b/board/sheldon/simpc8313/Makefile
@@ -0,0 +1,50 @@
+#
+# (C) Copyright 2006
+# Wolfgang Denk, DENX Software Engineering,
[EMAIL PROTECTED]
+#
+# See file CREDITS for list of people who contributed
to this
+# project.
+#
+# This program is free software; you can redistribute
it and/or
+# modify it under the terms of the GNU General Public
License as
+# published by the Free Software Foundation; either
version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it
will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied
warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General
Public License
+# along with this program; if not, write to the Free
Software
+# Foundation, Inc., 59 Temple Place, Suite 330,
Boston,
+# MA 02111-1307 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB= $(obj)lib$(BOARD).a
+
+COBJS  := $(BOARD).o sdram.o nand.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):$(obj).depend $(OBJS)
+   $(AR) crv $@ $(OBJS)
+
+clean:
+   rm -f $(SOBJS) $(OBJS)
+
+distclean: clean
+   rm -f $(LIB) core *.bak .depend
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/board/sheldon/simpc8313/config.mk
b/board/sheldon/simpc8313/config.mk
new file mode 100644
index 000..3be029f
--- /dev/null
+++ b/board/sheldon/simpc8313/config.mk
@@ -0,0 +1,3 @@
+sinclude $(OBJTREE)/board/$(BOARDDIR)/config.tmp
+
+TEXT_BASE  =   0x0100
-- 
1.5.5.1



-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


[U-Boot-Users] [PATCH 5/8] New board SIMPC8313 support: nand_spl

2008-05-30 Thread Ron Madrid
New board SIMPC8313 support: nand_spl

Signed-off-by: Ron Madrid
---
 nand_spl/board/sheldon/simpc8313/Makefile   |   91
+++
 nand_spl/board/sheldon/simpc8313/config.mk  |   50
+++
 nand_spl/board/sheldon/simpc8313/u-boot.lds |   65
+++
 3 files changed, 206 insertions(+), 0 deletions(-)
 create mode 100644
nand_spl/board/sheldon/simpc8313/Makefile
 create mode 100644
nand_spl/board/sheldon/simpc8313/config.mk
 create mode 100644
nand_spl/board/sheldon/simpc8313/u-boot.lds

diff --git a/nand_spl/board/sheldon/simpc8313/Makefile
b/nand_spl/board/sheldon/simpc8313/Makefile
new file mode 100644
index 000..3ebe00d
--- /dev/null
+++ b/nand_spl/board/sheldon/simpc8313/Makefile
@@ -0,0 +1,91 @@
+#
+# (C) Copyright 2008, Sheldon Instruments, Inc.
+# Adapted from Freescale MPC8313ERDB BSP
+#
+# (C) Copyright 2006
+# Stefan Roese, DENX Software Engineering,
[EMAIL PROTECTED]
+#
+# See file CREDITS for list of people who contributed
to this
+# project.
+#
+# This program is free software; you can redistribute
it and/or
+# modify it under the terms of the GNU General Public
License as
+# published by the Free Software Foundation; either
version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it
will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied
warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General
Public License
+# along with this program; if not, write to the Free
Software
+# Foundation, Inc., 59 Temple Place, Suite 330,
Boston,
+# MA 02111-1307 USA
+#
+
+include $(TOPDIR)/config.mk
+include
$(TOPDIR)/nand_spl/board/$(BOARDDIR)/config.mk
+
+LDSCRIPT=
$(TOPDIR)/nand_spl/board/$(BOARDDIR)/u-boot.lds
+LDFLAGS= -Bstatic -T $(LDSCRIPT) -Ttext $(TEXT_BASE)
$(PLATFORM_LDFLAGS)
+AFLAGS += -DCONFIG_NAND_SPL
+CFLAGS += -DCONFIG_NAND_SPL
+
+SOBJS  = start.o
+COBJS  = sdram.o nand_boot.o nand_ecc.o
+
+SRCS   := $(addprefix $(obj),$(SOBJS:.o=.S)
$(COBJS:.o=.c))
+OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
+__OBJS := $(SOBJS) $(COBJS)
+LNDIR  := $(OBJTREE)/nand_spl/board/$(BOARDDIR)
+
+nandobj:= $(OBJTREE)/nand_spl/
+
+ALL= $(nandobj)u-boot-spl $(nandobj)u-boot-spl.bin
$(nandobj)u-boot-spl-16k.bin
+
+all:   $(obj).depend $(ALL)
+
+$(nandobj)u-boot-spl-16k.bin: $(nandobj)u-boot-spl
+   $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(PAD_TO) -O binary
$< $@
+
+$(nandobj)u-boot-spl.bin:  $(nandobj)u-boot-spl
+   $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
+
+$(nandobj)u-boot-spl:  $(OBJS)
+   cd $(LNDIR) && $(LD) $(LDFLAGS) $$UNDEF_SYM
$(__OBJS) \
+   -Map $(nandobj)u-boot-spl.map \
+   -o $(nandobj)u-boot-spl
+
+# from cpu directory
+$(obj)start.S:
+   @rm -f $(obj)start.S
+   ln -s $(SRCTREE)/cpu/mpc83xx/start.S $(obj)start.S
+
+# from board directory
+$(obj)sdram.c:
+   @rm -f $(obj)sdram.c
+   ln -s $(SRCTREE)/board/$(BOARDDIR)/sdram.c
$(obj)sdram.c
+
+$(obj)nand_boot.c:
+   @rm -f $(obj)nand_boot.c
+   ln -s $(SRCTREE)/board/$(BOARDDIR)/nand_boot.c
$(obj)nand_boot.c
+
+$(obj)nand_ecc.c:
+   @rm -f $(obj)nand_ecc.c
+   ln -s $(SRCTREE)/board/$(BOARDDIR)/nand_ecc.c
$(obj)nand_ecc.c
+
+#
+
+$(obj)%.o: $(obj)%.S
+   $(CC) $(AFLAGS) -c -o $@ $<
+
+$(obj)%.o: $(obj)%.c
+   $(CC) $(CFLAGS) -c -o $@ $<
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git
a/nand_spl/board/sheldon/simpc8313/config.mk
b/nand_spl/board/sheldon/simpc8313/config.mk
new file mode 100644
index 000..c8c2d9a
--- /dev/null
+++ b/nand_spl/board/sheldon/simpc8313/config.mk
@@ -0,0 +1,50 @@
+#
+# (C) Copyright 2008, Sheldon Instruments, Inc.
+# Adapted from Freescale MPC8313ERDB BSP
+#
+# (C) Copyright 2006
+# Stefan Roese, DENX Software Engineering,
[EMAIL PROTECTED]
+#
+# 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
+#
+#
+# Sheldon Instrument SIMPC8313
+#
+#
+# TEXT_BASE for SPL:
+#
+

[U-Boot-Users] [PATCH 4/8] New board SIMPC8313 support: support for booting from NAND in start.S

2008-05-30 Thread Ron Madrid
New board SIMPC8313 support: support for booting from
NAND in start.S

Reorganization/optimization of a few functions to fit
into the 4K FCM boot RAM of the MPC8313 for nand_spl
build.

Signed-off-by: Ron Madrid
---
 cpu/mpc83xx/start.S |  310
---
 1 files changed, 220 insertions(+), 90 deletions(-)

diff --git a/cpu/mpc83xx/start.S b/cpu/mpc83xx/start.S
index 309eb30..39bcaa8 100644
--- a/cpu/mpc83xx/start.S
+++ b/cpu/mpc83xx/start.S
@@ -63,6 +63,9 @@
  * Use r14 to access the GOT
  */
START_GOT
+#if defined(CONFIG_NAND_SPL)
+   GOT_ENTRY(_GOT_TABLE_)
+#else
GOT_ENTRY(_GOT2_TABLE_)
GOT_ENTRY(_FIXUP_TABLE_)
 
@@ -74,6 +77,7 @@
GOT_ENTRY(__init_end)
GOT_ENTRY(_end)
GOT_ENTRY(__bss_start)
+#endif /* CONFIG_NAND_SPL */
END_GOT
 
 /*
@@ -103,7 +107,56 @@ version_string:
.ascii U_BOOT_VERSION
.ascii " (", __DATE__, " - ", __TIME__, ")"
.ascii " ", CONFIG_IDENT_STRING, "\0"
+   .align 4
+
+/*/
+
+   .globl enable_addr_trans
+enable_addr_trans:
+   /* enable address translation */
+   mfmsr   r5
+   ori r5, r5, (MSR_IR | MSR_DR)
+   mtmsr   r5
+   isync
+   blr
+
+/* Cache functions.
+ *
+ * Note: requires that all cache bits in
+ * HID0 are in the low half word.
+ */
+   .globl  icache_enable
+icache_enable:
+   mfspr   r3, HID0
+   ori r3, r3, HID0_ICE
+   li  r4, HID0_ILOCK
+   andcr3, r3, r4
+   ori r4, r3, HID0_ICFI
+   isync
+   mtspr   HID0, r4/* sets enable and invalidate,
clears lock */
+   isync
+   mtspr   HID0, r3/* clears invalidate */
+   blr
+
+   .globl  dcache_enable
+dcache_enable:
+   mfspr   r3, HID0
+   li  r5, HID0_DCFI|HID0_DLOCK
+   andcr3, r3, r5
+   mtspr   HID0, r3/* no invalidate, unlock */
+   ori r3, r3, HID0_DCE
+   ori r5, r3, HID0_DCFI
+   mtspr   HID0, r5/* enable + invalidate */
+   mtspr   HID0, r3/* enable */
+   sync
+   blr
+
+   .globl get_pvr
+get_pvr:
+   mfspr   r3, PVR
+   blr
 
+/*/
 
 #ifndef CONFIG_DEFAULT_IMMR
 #error CONFIG_DEFAULT_IMMR must be defined
@@ -165,7 +218,7 @@ boot_warm: /* time t 5 */
 
bl  init_e300_core
 
-#ifndef CFG_RAMBOOT
+#if !defined(CFG_RAMBOOT) &&
!defined(CONFIG_NAND_U_BOOT)
 
/* Inflate flash location so it appears everywhere,
calculate */
/* the absolute address in final location of the
FLASH, jump  */
@@ -181,7 +234,7 @@ in_flash:
 #if 1 /* Remapping flash with LAW0. */
bl remap_flash_by_law0
 #endif
-#endif /* CFG_RAMBOOT */
+#endif /* !defined(CFG_RAMBOOT) &&
!defined(CONFIG_NAND_U_BOOT) */
 
/* setup the bats */
bl  setup_bats
@@ -234,6 +287,7 @@ in_flash:
/* run low-level CPU init code (in Flash)*/
bl  cpu_init_f
 
+#if !defined(CONFIG_NAND_SPL)
/* r3: BOOTFLAG */
mr  r3, r21
/* run 1st part of board init code (in Flash)*/
@@ -428,6 +482,7 @@ int_return:
lwz r1,GPR1(r1)
SYNC
rfi
+#endif /* CONFIG_NAND_SPL */
 
 /*
  * This code initialises the E300 processor core
@@ -550,6 +605,7 @@ init_e300_core: /* time t 10 */
/*--*/
blr
 
+#if !defined(CONFIG_NAND_SPL)
.globl  invalidate_bats
 invalidate_bats:
/* invalidate BATs */
@@ -577,6 +633,7 @@ invalidate_bats:
isync
sync
blr
+#endif /* CONFIG_NAND_SPL */
 
/* setup_bats - set them up to some initial state */
.globl  setup_bats
@@ -584,148 +641,228 @@ setup_bats:
addis   r0, r0, 0x
 
/* IBAT 0 */
+#if ((CFG_IBAT0L == 0) && (CFG_IBAT0U == 0))
+   mtspr   IBAT0L, r0
+   mtspr   IBAT0U, r0
+#else
addis   r4, r0, [EMAIL PROTECTED]
ori r4, r4, [EMAIL PROTECTED]
addis   r3, r0, [EMAIL PROTECTED]
ori r3, r3, [EMAIL PROTECTED]
mtspr   IBAT0L, r4
mtspr   IBAT0U, r3
+#endif
isync
 
/* DBAT 0 */
+#if ((CFG_DBAT0L == 0) && (CFG_DBAT0U == 0))
+   mtspr   DBAT0L, r0
+   mtspr   DBAT0U, r0
+#else
addis   r4, r0, [EMAIL PROTECTED]
ori r4, r4, [EMAIL PROTECTED]
addis   r3, r0, [EMAIL PROTECTED]
ori r3, r3, [EMAIL PROTECTED]
mtspr   DBAT0L, r4
mtspr   DBAT0U, r3
+#endif
isync
 
/* IBAT 1 */
+#if ((CFG_IBAT1L == 0) && (CFG_IBAT1U == 0))
+   mtspr   IBAT1L, r0
+   mtspr   IBAT1U, r0
+#else
addis   r4, r0, [EMAIL PROTECTED]
ori r4, r4, [EMAIL PROTECTED]
addis   r3, r0, [EMAIL PROTECTED]
ori r3, r3, [EMAIL PROTECTED]
mtspr   IBAT1L, r4
mtspr   IBAT1U, r3
+#endif
   

[U-Boot-Users] [PATCH 3/8] New board SIMPC8313 support: config SIMPC8313.h

2008-05-30 Thread Ron Madrid
New board SIMPC8313 support: config SIMPC8313.h

Signed-off-by: Ron Madrid
---
 include/configs/SIMPC8313.h |  505
+++
 1 files changed, 505 insertions(+), 0 deletions(-)
 create mode 100644 include/configs/SIMPC8313.h

diff --git a/include/configs/SIMPC8313.h
b/include/configs/SIMPC8313.h
new file mode 100644
index 000..8afb149
--- /dev/null
+++ b/include/configs/SIMPC8313.h
@@ -0,0 +1,505 @@
+/*
+ * Copyright (C) Sheldon Instruments, Inc. 2008.
+ *
+ * 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
+ */
+/*
+ * simpc8313 board configuration file
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+#undef DEBUG
+
+/*
+ * High Level Configuration Options
+ */
+#define CONFIG_E3001   /* E300 Family */
+#define CONFIG_MPC83XX 1   /* MPC83XX family */
+#define CONFIG_MPC831X 1
+#define CONFIG_MPC8313 1   /* MPC8313 specific */
+
+#define CONFIG_NAND_U_BOOT
+
+#define CONFIG_PCI
+#define CONFIG_83XX_GENERIC_PCI
+
+#ifdef PCI_66M
+#define CONFIG_83XX_CLKIN  /* in Hz */
+#define CONFIG_83XX_PCICLK /* in Hz */
+#else
+#define CONFIG_83XX_CLKIN  /* in Hz */
+#define CONFIG_83XX_PCICLK /* in Hz */
+#endif
+
+#ifndef CONFIG_SYS_CLK_FREQ
+#ifdef PCI_66M
+#define CONFIG_SYS_CLK_FREQ
+#else
+#define CONFIG_SYS_CLK_FREQ
+#endif
+#endif
+
+/* System performance */
+#define CFG_ACR_PIPE_DEP   3   /* Arbiter pipeline depth
(0-3) */
+#define CFG_ACR_RPTCNT 3   /* Arbiter repeat count
(0-7) */
+
+/*#define CFG_SCCR ( SCCR_RES \
+   | SCCR_TSEC1CM_1\
+   | SCCR_TSEC1ON  \
+   | SCCR_TSEC2ON  \
+   | SCCR_ENCCM_3  \
+   | SCCR_USBCM_3  \
+   | SCCR_PCICM)
+*/
+#define CONFIG_BOARD_EARLY_INIT_F  /* call
board_pre_init */
+#undef  CONFIG_BOARD_EARLY_INIT_F
+#define CONFIG_BOARD_EARLY_INIT_R  /* call board_init
*/
+#undef  CONFIG_BOARD_EARLY_INIT_R
+
+#define CFG_RESET_ADDRESS  0x3000
+
+#define CFG_IMMR   0xE000
+
+#undef CFG_DRAM_TEST   /* memory test, takes time */
+#define CFG_MEMTEST_START  0x1000  /* memtest
region */
+#define CFG_MEMTEST_END0x07F0
+
+/*
+ * DDR Setup
+ */
+#undef CONFIG_SPD_EEPROM   /* use SPD EEPROM for DDR
setup*/
+
+#define CFG_DDR_BASE   0x  /* DDR is system
memory*/
+#define CFG_SDRAM_BASE CFG_DDR_BASE
+#define CFG_DDR_SDRAM_BASE CFG_DDR_BASE
+#undef  CONFIG_DDR_2T_TIMING
+
+/*
+ * Manually set up DDR parameters
+ */
+#define CONFIG_VERY_BIG_RAM
+#define CONFIG_MAX_MEM_MAPPED (512 << 20)
+
+#define CFG_DDRCDR ( DDRCDR_EN \
+   | DDRCDR_PZ_NOMZ \
+   | DDRCDR_NZ_NOMZ \
+   | DDRCDR_M_ODR )
+   /* 0x7302 TODO ODR & DRN ? */
+
+/*
+ * FLASH on the Local Bus
+ */
+#define CFG_NO_FLASH
+
+#define CFG_MONITOR_BASE   TEXT_BASE   /* start of
monitor */
+
+#define CFG_INIT_RAM_LOCK  1
+#define CFG_INIT_RAM_ADDR  0xFD00  /* Initial RAM
address */
+#define CFG_INIT_RAM_END   0x1000  /* End of used area
in RAM*/
+
+#define CFG_GBL_DATA_SIZE  0x100   /* num bytes initial
data */
+#define CFG_GBL_DATA_OFFSET(CFG_INIT_RAM_END -
CFG_GBL_DATA_SIZE)
+#define CFG_INIT_SP_OFFSET CFG_GBL_DATA_OFFSET
+
+#define CFG_MONITOR_LEN(256 * 1024)/* Reserve 256
kB for Mon */
+#define CFG_MALLOC_LEN (128 * 1024)/* Reserved for
malloc */
+
+/*
+ * Local Bus LCRR and LBCR regs
+ */
+#define CFG_LCRR   LCRR_EADC_1 | LCRR_CLKDIV_2 /*
0x00010002 */
+
+#define CFG_LBC_LBCR   ( 0x0004 /* TODO */ \
+   | (0xFF << LBCR_BMT_SHIFT) \
+   | 0xF ) /* 0x0004ff0f */
+
+#define CFG_LBC_MRTPR  0x2000  /*TODO */  /* LB
refresh timer prescal, 266MHz/32 

[U-Boot-Users] [PATCH 2/8] New board SIMPC8313 support: README

2008-05-30 Thread Ron Madrid
New board SIMPC8313 support: README

Signed-off-by: Ron Madrid
---
 doc/README.simpc8313 |   70
++
 1 files changed, 70 insertions(+), 0 deletions(-)
 create mode 100644 doc/README.simpc8313

diff --git a/doc/README.simpc8313
b/doc/README.simpc8313
new file mode 100644
index 000..60e5ab8
--- /dev/null
+++ b/doc/README.simpc8313
@@ -0,0 +1,70 @@
+Freescale MPC8313ERDB Board
+---
+
+1. Board Switches and Jumpers
+
+   S2 is used to set CFG_RESET_SOURCE.
+
+   To boot the image in Large page NAND flash, use
these DIP
+   switch settings for S2:
+
+   +--+ ON
+   | * *  |
+   |  * * |
+   +--+
+ 12345678
+
+   To boot the image in Large page NAND flash, use
these DIP
+   switch settings for S2:
+
+   +--+ ON
+   | ***  |
+   |* |
+   +--+
+ 12345678
+   (where the '*' indicates the position of the tab of
the switch.)
+
+2. Memory Map
+   The memory map looks like this:
+
+   0x_ 0x1fff_ DDR  512M
+   0x8000_ 0x8fff_ PCI MEM  256M
+   0x9000_ 0x9fff_ PCI_MMIO 256M
+   0xe000_ 0xe00f_ IMMR 1M
+   0xe200_ 0xe20f_ PCI IO   16M
+   0xe280_ 0xe280_7fff NAND FLASH (CS0) 32K
+   or
+   0xe280_ 0xe281_ NAND FLASH (CS0) 128K
+   0xfa00_ 0xfa00_7fff FPGA (CS1)   1M
+
+3. Compilation
+
+   Assuming you're using BASH (or similar) as your
shell:
+
+   export CROSS_COMPILE=your-cross-compiler-prefix-
+   make distclean
+   make SIMPC8313_LP_config
+   (or make SIMPC8313_SP_config, depending on the page
size
+of your NAND flash)
+   make
+
+4. Downloading and Flashing Images
+
+4.1Reflash U-boot Image using U-boot
+
+   =>run update_uboot
+
+   You may want to try
+   =>tftp $loadaddr $uboot
+   first, to make sure that the TFTP load will succeed
before it
+   goes ahead and wipes out your current firmware.  And
of course,
+   have an alternate means of programming the flash
available
+   if the new u-boot doesn't boot.
+
+4.2Downloading and Booting Linux Kernel
+
+   TODO:
+
+5  Notes
+
+   The console baudrate for SIMPC8313 is 115200bps.
-- 
1.5.5.1



-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


[U-Boot-Users] [PATCH 1/8] New board SIMPC8313 support: MAINTAINERS, MAKEALL, Makefile

2008-05-30 Thread Ron Madrid
New board SIMPC8313 support: MAINTAINERS, MAKEALL,
Makefile

Signed-off-by: Ron Madrid
---
 MAINTAINERS |5 +
 MAKEALL |2 ++
 Makefile|   18 ++
 3 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index ac7572c..021fc4b 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -255,6 +255,11 @@ Jon Loeliger <[EMAIL PROTECTED]>
MPC8555CDS  MPC8555
 
MPC8641HPCN MPC8641D
+ 
+Ron Madrid <[EMAIL PROTECTED]>
+
+   SIMPC8313   MPC8313
+
 
 Dan Malek <[EMAIL PROTECTED]>
 
diff --git a/MAKEALL b/MAKEALL
index 0674069..493a489 100755
--- a/MAKEALL
+++ b/MAKEALL
@@ -331,6 +331,8 @@ LIST_83xx=" \
MPC837XEMDS \
MPC837XERDB \
sbc8349 \
+   SIMPC8313_LP\
+   SIMPC8313_SP\
TQM834x \
 "
 
diff --git a/Makefile b/Makefile
index 3401203..03e514f 100644
--- a/Makefile
+++ b/Makefile
@@ -2101,6 +2101,24 @@ MPC837XEMDS_HOST_config:
unconfig
 
 MPC837XERDB_config:unconfig
@$(MKCONFIG) -a MPC837XERDB ppc mpc83xx mpc837xerdb
freescale
+ 
+SIMPC8313_LP_config \
+SIMPC8313_SP_config:   unconfig
+   @mkdir -p $(obj)include
+   @mkdir -p $(obj)nand_spl/board/sheldon/simpc8313
+   @if [ "$(findstring _LP_,$@)" ] ; then \
+   echo -n "... Large Page NAND " ; \
+   echo "#define CONFIG_NAND_LP" >>
$(obj)include/config.h ; \
+   $(MKCONFIG) -a SIMPC8313 ppc mpc83xx simpc8313
sheldon; \
+   echo "PAD_TO  = 0xFFF2" >>
$(obj)board/sheldon/simpc8313/config.tmp ; \
+   fi ;
+   @if [ "$(findstring _SP_,$@)" ] ; then \
+   echo -n "... Small Page NAND " ; \
+   echo "#define CONFIG_NAND_SP" >>
$(obj)include/config.h ; \
+   $(MKCONFIG) -a SIMPC8313 ppc mpc83xx simpc8313
sheldon; \
+   echo "PAD_TO  = 0xFFF04000" >>
$(obj)board/sheldon/simpc8313/config.tmp ; \
+   fi ;
+   @echo "CONFIG_NAND_U_BOOT = y" >>
$(obj)include/config.mk
 
 sbc8349_config:unconfig
@$(MKCONFIG) $(@:_config=) ppc mpc83xx sbc8349
-- 
1.5.5.1



-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [PATCH] TQM85xx: NAND support via local bus UPMB

2008-05-30 Thread Wolfgang Grandegger
Anton Vorontsov wrote:
> On Thu, May 29, 2008 at 01:58:14PM +0200, Wolfgang Grandegger wrote:
>> Anton Vorontsov wrote:
>>> On Wed, May 28, 2008 at 08:38:37PM +0200, Wolfgang Grandegger wrote:
 Scott Wood wrote:
> On Wed, May 28, 2008 at 08:12:28PM +0200, Wolfgang Grandegger wrote:
>> This patch adds support for NAND FLASH on the TQM8548. It is disabled by
>> default and can be enabled for the TQM8548 modules. Note that the R/B pin
>> is not supported by that module requiring to use the specified maximum
>> delay time.
>>
>> Note: With NAND support enabled the size of the U-Boot image exceeds
>> 256 KB and TEXT_BASE must therefore be set to 0xfff8 in config.mk,
>> doubling the image size :-(.
> What does this do differently from the code in drivers/mtd/nand/fsl_upm.c?
 Maybe it does not support multi banks on a NAND chip. I have to check.
>>> Me thinks that you'll have to call fsl_upm_nand_init() for each
>>> chip, and that's all. If not, feel free to patch it as you feel appropriate,
>>> I'll able to regress-test this driver on MPC8360E-RDK.
>> That seems not to be a minor problem. If CFG_MAX_NAND_DEVICE > 1,
>> board_nand_init() will be called twice with the base address from
>> CFG_NAND_BASE_LIST. The only problem I see is that the UPM interface is
>> setup twice.
> 
> Personally I think we should remove UPM programming code from the
> fsl_upm_nand.c, and program the UPM via its own interface, see this post:
> 
> From: David Saada <[EMAIL PROTECTED]>
> To: "'u-boot-users@lists.sourceforge.net'" 
> 
> Date: Mon, 19 May 2008 19:05:04 +0300
> Subject: [U-Boot-Users] [PATCH][resubmit] MPC85xx, MPC83xx: Add/Fix UPM 
> configuration support
> 
> ^^^ But this is still WIP, and I'm not sure if this is suitable for our
> needs (didn't try it).

OK.

> How much of this is board-specific?
 Well, I already gave drivers/mtd/nand/fsl_upm.c a try but was unable to
 get it working on this board. Therefore I decided to keep this known to
 work driver which we have already for a while.
>>> This isn't really an excuse to duplicate drivers. :-) This driver was
>>> tested on MPC8555 and MPC8360 CPUs, so it should work with no drastic
>>> changes. Some issues might still be there, and if so, fixes are highly
>>> appreciated.
>> I know, sniff.
>>
 With Linux, I had more success.
>>> ..especially if general idea works well, we should use single driver.
>> I already had a closer look and realized a difference in writing the UPM
>> array. In fsl_upm.c there is:
>>
>>   static void fsl_upm_setup(struct fsl_upm *upm)
>>   {
>>  int i;
>>
>>  /* write upm array */
>>  out_be32(upm->mxmr, FSL_UPM_MxMR_OP_WA);
>>
>>  for (i = 0; i < 64; i++) {
>>  out_be32(upm->mdr, upm->array[i]);
>>  out_8(upm->io_addr, 0x0);
>>  }
>>
>>  /* normal operation */
>>  out_be32(upm->mxmr, FSL_UPM_MxMR_OP_NO);
>>  while (in_be32(upm->mxmr) != FSL_UPM_MxMR_OP_NO)
>>  eieio();
>>   }
>>
>> But in my driver I fold the machine address into mbmr for each value:
>>
>> out_be32 (&lbc->mbmr,
>>  (in_be32 (&lbc->mbmr) & ~(MxMR_OP_NORM | MxMR_MAD)) |
>>   MxMR_OP_WARR | (i & MxMR_MAD));
>>   ^
> 
> I see. I think there will be a problem with a
> 
> static void fsl_upm_start_pattern(struct fsl_upm *upm, u32 pat_offset)
> {
> out_be32(upm->mxmr, FSL_UPM_MxMR_OP_RP | pat_offset);
> }
> 
> static void fsl_upm_end_pattern(struct fsl_upm *upm)
> {
> out_be32(upm->mxmr, FSL_UPM_MxMR_OP_NO);
> while (in_be32(upm->mxmr) != FSL_UPM_MxMR_OP_NO)
> eieio();
> }
> 
> Since it zeroes these values. No problem though, this should
> be replaced by the Linux' versions, that is
> 
> clrsetbits_be32(upm->mxmr, MxMR_MAD, MxMR_OP_RP | pat_offset);
> for start_pattern, and  clrbits32(upm->mxmr, MxMR_OP_RP); for
> end_pattern.
> 
> So, this will leave your values intact, and will work for all boards as
> well.

Fix that, but I can still not access the device properly. I'm a bit
puzzled because it uses a different algorithm to access the device.
While my and the Linux fsl_upm driver uses NAND_ALE, NAND_CLE and
friends to manage the access via hwcontrol callback, the fsl_upm driver
of U-Boot uses the cmdfunc callback doing different things. What is the
difference? It seems to work on the MPC8555, at least, as you mention below.

>> Seem also that defines a duplicated :-(.
> 
> No problem. Please, remove the ones you don't like, and leave the ones
> you do like. :-) Feel completely free to do everything you need to make
> fsl_upm_nand.c work on your hardware, and then we'll see what we can do
> to make our hardware work together.

OK. The defines should go to fsl_lbc.h nowadays.

> As for UPM programming, as I've said, just remove UPM programming code
> from the NAND driver, and leave it in the board file until (if) we'll
> start using generic

Re: [U-Boot-Users] Sandisk mDoC H3 support

2008-05-30 Thread Lars Munch
On Wed, May 07, 2008 at 04:46:04PM +0300, Micha Kalfon wrote:
> Hello all,
> 
> In the last few weeks I've been working on a u-boot driver for
> Sandisk's (MSystems) mDoc H3 device - basically, it's a DiskOnChip
> device which exposes a simple ATA interface to the software and works
> differently from previous generation DoCs (see
> http://www.linuxdevices.com/articles/AT2185129745.html for more).
> 
> I implemented the following low-level features in u-boot which allow
> using the DoC H3 as a boot device (currently all I need it for) :
> 
> 1. Basic partitioning - allows statically allocating sectors for
> numerous binary (raw) partitions.
> 2. Writing IPL boot block - basically, the very initial 2KB of code
> than run when the CPU boots.
> 3. Reading and Writing of binary partitions - I place u-boot binary in
> one partition to be loaded and run by the IPL and the linux kernel
> uImage in another.
> 
> Features are exposed to the user / bootscript as simple u-boot commands.
> 
> 
> Does anyone see benefit from this to other u-boot users? If not, what
> can be added / changed to make it so?

Great! I for one would very much like to have support for this in u-boot.

Regards
Lars Munch

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [PATCH]env_nand.c Added bad block management for environment variables

2008-05-30 Thread Scott Wood
On Fri, May 30, 2008 at 11:14:10AM -0400, Stuart Wood wrote:
> +int writeenv(size_t offset, u_char * buf)

No space after '*'.

> + char_ptr = &buf[amount_saved];
> + if (nand_write(&nand_info[0], offset, &blocksize, 
> char_ptr)) {

Wrap long line.

> + return 1;
> + } else {

The "else" is superfluous.

> + puts ("Erasing redundant Nand...\n");
> + nand_erase(&nand_info[0], CFG_ENV_OFFSET_REDUND, CFG_ENV_RANGE);
> +

If erasing fails for reasons other than a bad block, we should abort.

If erasing fails due to a bad block, we should skip past it; however,
the current erase code fails and does not try to erase any further
blocks.  Use nand_erase_opts() instead.

> - if (ret || total != CFG_ENV_SIZE)
> + if (ret || total != CFG_ENV_SIZE) {
> + puts("FAILED!\n");
>   return 1;
> + }

total is no longer referenced anywhere but here and the initialization;
remove it.

> + while (amount_loaded < CFG_ENV_SIZE && offset < end) {
> + if (nand_block_isbad(&nand_info[0], offset)) {
> + offset += blocksize;
> + } else {
> + char_ptr = &buf[amount_loaded];
> + nand_read(&nand_info[0], offset, &blocksize, char_ptr);

Please check the return value of nand_read.

-Scott

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [PATCH]env_nand.c Added bad block management for environment variables

2008-05-30 Thread Stuart Wood
Modified to check for bad blocks and to skipping over them when
CFG_ENV_RANGE has been defined.
CFG_ENV_RANGE must be larger than CFG_ENV_SIZE and aligned to the NAND
flash block size.

signed off by Stuart Wood <[EMAIL PROTECTED]>
---

diff --git a/common/env_nand.c b/common/env_nand.c
index 49742f5..d5f330c 100644
--- a/common/env_nand.c
+++ b/common/env_nand.c
@@ -1,4 +1,7 @@
 /*
+ * (C) Copyright 2008
+ * Stuart Wood, Lab X Technologies <[EMAIL PROTECTED]>
+ *
  * (C) Copyright 2004
  * Jian Zhang, Texas Instruments, [EMAIL PROTECTED]

@@ -53,6 +56,10 @@
 #error CONFIG_INFERNO not supported yet
 #endif

+#ifndef CFG_ENV_RANGE
+#define CFG_ENV_RANGE  CFG_ENV_SIZE
+#endif
+
 int nand_legacy_rw (struct nand_chip* nand, int cmd,
size_t start, size_t len,
size_t * retlen, u_char * buf);
@@ -151,6 +158,34 @@ int env_init(void)
  * The legacy NAND code saved the environment in the first NAND device i.e.,
  * nand_dev_desc + 0. This is also the behaviour using the new NAND code.
  */
+int writeenv(size_t offset, u_char * buf)
+{
+   size_t end = offset + CFG_ENV_RANGE;
+   size_t amount_saved = 0;
+   size_t blocksize;
+
+   u_char *char_ptr;
+
+   blocksize = nand_info[0].erasesize;
+
+   while (amount_saved < CFG_ENV_SIZE && offset < end) {
+   if (nand_block_isbad(&nand_info[0], offset)) {
+   offset += blocksize;
+   } else {
+   char_ptr = &buf[amount_saved];
+   if (nand_write(&nand_info[0], offset, &blocksize, 
char_ptr)) {
+   return 1;
+   } else {
+   offset += blocksize;
+   amount_saved += blocksize;
+   }
+   }
+   }
+   if (amount_saved != CFG_ENV_SIZE)
+   return 1;
+
+   return 0;
+}  
 #ifdef CFG_ENV_OFFSET_REDUND
 int saveenv(void)
 {
@@ -160,26 +195,25 @@ int saveenv(void)
env_ptr->flags++;
total = CFG_ENV_SIZE;

+   if (CFG_ENV_RANGE < CFG_ENV_SIZE)
+   return 1;
if(gd->env_valid == 1) {
-   puts ("Erasing redundant Nand...");
-   if (nand_erase(&nand_info[0],
-  CFG_ENV_OFFSET_REDUND, CFG_ENV_SIZE))
-   return 1;
+   puts ("Erasing redundant Nand...\n");
+   nand_erase(&nand_info[0], CFG_ENV_OFFSET_REDUND, CFG_ENV_RANGE);
+
puts ("Writing to redundant Nand... ");
-   ret = nand_write(&nand_info[0], CFG_ENV_OFFSET_REDUND, &total,
-(u_char*) env_ptr);
+   ret = writeenv(CFG_ENV_OFFSET_REDUND, env_ptr);
} else {
-   puts ("Erasing Nand...");
-   if (nand_erase(&nand_info[0],
-  CFG_ENV_OFFSET, CFG_ENV_SIZE))
-   return 1;
+   puts ("Erasing Nand...\n");
+   nand_erase(&nand_info[0], CFG_ENV_OFFSET, CFG_ENV_RANGE);

puts ("Writing to Nand... ");
-   ret = nand_write(&nand_info[0], CFG_ENV_OFFSET, &total,
-(u_char*) env_ptr);
+   ret = writeenv(CFG_ENV_OFFSET, env_ptr);
}
-   if (ret || total != CFG_ENV_SIZE)
+   if (ret || total != CFG_ENV_SIZE) {
+   puts("FAILED!\n");
return 1;
+   }

puts ("done\n");
gd->env_valid = (gd->env_valid == 2 ? 1 : 2);
@@ -191,15 +225,18 @@ int saveenv(void)
size_t total;
int ret = 0;

-   puts ("Erasing Nand...");
-   if (nand_erase(&nand_info[0], CFG_ENV_OFFSET, CFG_ENV_SIZE))
+   if (CFG_ENV_RANGE < CFG_ENV_SIZE)
return 1;
+   puts ("Erasing Nand...\n");
+   nand_erase(&nand_info[0], CFG_ENV_OFFSET, CFG_ENV_RANGE);

puts ("Writing to Nand... ");
total = CFG_ENV_SIZE;
-   ret = nand_write(&nand_info[0], CFG_ENV_OFFSET, &total, 
(u_char*)env_ptr);
-   if (ret || total != CFG_ENV_SIZE)
+   ret = writeenv(CFG_ENV_OFFSET, env_ptr);
+   if (ret || total != CFG_ENV_SIZE) {
+   puts("FAILED!\n");
return 1;
+   }

puts ("done\n");
return ret;
@@ -207,11 +244,39 @@ int saveenv(void)
 #endif /* CFG_ENV_OFFSET_REDUND */
 #endif /* CMD_SAVEENV */

+int readenv (size_t offset, u_char * buf)
+{
+   size_t end = offset + CFG_ENV_RANGE;
+   size_t amount_loaded = 0;
+   size_t blocksize;
+
+   u_char *char_ptr;
+
+   blocksize = nand_info[0].erasesize;
+
+   while (amount_loaded < CFG_ENV_SIZE && offset < end) {
+   if (nand_block_isbad(&nand_info[0], offset)) {
+   offset += blocksize;
+   } else {
+   char_ptr = &buf[amount_loaded];
+   nand_read(&nand_info[0], offset, &blocksize, char_ptr);
+  

[U-Boot-Users] [PATCH] 4xx: Cleanup CPCI405 variant's config file

2008-05-30 Thread Matthias Fuchs
This patch removes some dead code from CPCI405 board's
config files. JFFS2 support is also removed. It's not used and
CPCI4052 does not build anymore without some size reduction.

Signed-off-by: Matthias Fuchs <[EMAIL PROTECTED]>
---
 include/configs/CPCI4052.h  |   38 --
 include/configs/CPCI405AB.h |   22 --
 include/configs/CPCI405DT.h |   33 -
 3 files changed, 0 insertions(+), 93 deletions(-)

diff --git a/include/configs/CPCI4052.h b/include/configs/CPCI4052.h
index b248639..fd49f56 100644
--- a/include/configs/CPCI4052.h
+++ b/include/configs/CPCI4052.h
@@ -88,32 +88,17 @@
 #define CONFIG_CMD_FAT
 #define CONFIG_CMD_ELF
 #define CONFIG_CMD_DATE
-#define CONFIG_CMD_JFFS2
 #define CONFIG_CMD_I2C
 #define CONFIG_CMD_MII
 #define CONFIG_CMD_PING
 #define CONFIG_CMD_BSP
 #define CONFIG_CMD_EEPROM
 
-
-#if 0 /* test-only */
-#define CONFIG_NETCONSOLE
-#define CONFIG_NET_MULTI
-
-#ifdef CONFIG_NET_MULTI
-#define CONFIG_PHY1_ADDR   1   /* PHY address: for NetConsole  */
-#endif
-#endif
-
 #define CONFIG_MAC_PARTITION
 #define CONFIG_DOS_PARTITION
 
 #define CONFIG_SUPPORT_VFAT
 
-#if 0 /* test-only */
-#define CONFIG_AUTO_UPDATE  1   /* autoupdate via compactflash  */
-#endif
-
 #undef CONFIG_WATCHDOG /* watchdog disabled*/
 
 #define CONFIG_SDRAM_BANK0 1   /* init onboard SDRAM bank 0*/
@@ -256,29 +241,6 @@
 
 #define CFG_FLASH_EMPTY_INFO   /* print 'E' for empty sector on flinfo 
*/
 
-
-/*
- * JFFS2 partitions
- */
-
-/* No command line, one static partition, use whole device */
-#undef CONFIG_JFFS2_CMDLINE
-#define CONFIG_JFFS2_DEV   "nor0"
-#define CONFIG_JFFS2_PART_SIZE 0x
-#define CONFIG_JFFS2_PART_OFFSET   0x
-
-/* mtdparts command line support */
-
-/* Use first bank for JFFS2, second bank contains U-Boot.
- *
- * Note: fake mtd_id's used, no linux mtd map file.
- */
-/*
-#define CONFIG_JFFS2_CMDLINE
-#define MTDIDS_DEFAULT "nor0=cpci4052-0"
-#define MTDPARTS_DEFAULT   "mtdparts=cpci4052-0:-(jffs2)"
-*/
-
 #if 0 /* Use NVRAM for environment variables */
 /*---
  * NVRAM organization
diff --git a/include/configs/CPCI405AB.h b/include/configs/CPCI405AB.h
index 1e9597d..55dd629 100644
--- a/include/configs/CPCI405AB.h
+++ b/include/configs/CPCI405AB.h
@@ -88,7 +88,6 @@
 #define CONFIG_CMD_FAT
 #define CONFIG_CMD_ELF
 #define CONFIG_CMD_DATE
-#define CONFIG_CMD_JFFS2
 #define CONFIG_CMD_I2C
 #define CONFIG_CMD_MII
 #define CONFIG_CMD_PING
@@ -238,27 +237,6 @@
 
 #define CFG_FLASH_EMPTY_INFO   /* print 'E' for empty sector on flinfo 
*/
 
-/*
- * JFFS2 partitions
- */
-/* No command line, one static partition */
-#undef CONFIG_JFFS2_CMDLINE
-#define CONFIG_JFFS2_DEV   "nor0"
-#define CONFIG_JFFS2_PART_SIZE 0x
-#define CONFIG_JFFS2_PART_OFFSET   0x
-
-/* mtdparts command line support */
-
-/* Use first bank for JFFS2, second bank contains U-Boot.
- *
- * Note: fake mtd_id's used, no linux mtd map file.
- */
-/*
-#define CONFIG_JFFS2_CMDLINE
-#define MTDIDS_DEFAULT "nor0=cpci405ab-0"
-#define MTDPARTS_DEFAULT   "mtdparts=cpci405ab-0:-(jffs2)"
-*/
-
 /*---
  * I2C EEPROM (CAT24WC32) for environment
  */
diff --git a/include/configs/CPCI405DT.h b/include/configs/CPCI405DT.h
index a8029ea..6b585be 100644
--- a/include/configs/CPCI405DT.h
+++ b/include/configs/CPCI405DT.h
@@ -87,23 +87,12 @@
 #define CONFIG_CMD_FAT
 #define CONFIG_CMD_ELF
 #define CONFIG_CMD_DATE
-#define CONFIG_CMD_JFFS2
 #define CONFIG_CMD_I2C
 #define CONFIG_CMD_MII
 #define CONFIG_CMD_PING
 #define CONFIG_CMD_BSP
 #define CONFIG_CMD_EEPROM
 
-
-#if 0 /* test-only */
-#define CONFIG_NETCONSOLE
-#define CONFIG_NET_MULTI
-
-#ifdef CONFIG_NET_MULTI
-#define CONFIG_PHY1_ADDR   1   /* PHY address: for NetConsole  */
-#endif
-#endif
-
 #define CONFIG_MAC_PARTITION
 #define CONFIG_DOS_PARTITION
 
@@ -260,27 +249,6 @@
 
 #define CFG_FLASH_EMPTY_INFO   /* print 'E' for empty sector on flinfo 
*/
 
-/*
- * JFFS2 partitions
- */
-/* No command line, one static partition */
-#undef CONFIG_JFFS2_CMDLINE
-#define CONFIG_JFFS2_DEV   "nor0"
-#define CONFIG_JFFS2_PART_SIZE 0x
-#define CONFIG_JFFS2_PART_OFFSET   0x
-
-/* mtdparts command line support */
-
-/* Use first bank for JFFS2, second bank contains U-Boot.
- *
- * Note: fake mtd_id's used, no linux mtd map file.
- */
-/*
-#define CONFIG_JFFS2_CMDLINE
-#define MTDIDS_DEFAULT "nor0=cpci405dt-0"
-#define MTDPARTS_DEFAULT   "mtdparts=cpci405dt-0:-(jffs2)"
-*/
-
 #if 0 /* Use NVRAM for environment variables */
 /*---
  * NVRAM organization
@@ -416,7 +384,6 @@
 #define CFG_GBL_DAT

Re: [U-Boot-Users] u-boot v2

2008-05-30 Thread Menon, Nishanth
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> On Behalf Of Robert Schwebel
> Sent: Friday, May 30, 2008 5:50 AM
> To: Kenneth Johansson
> Cc: u-boot-users@lists.sourceforge.net
> Subject: Re: [U-Boot-Users] u-boot v2
> 
> On Wed, May 28, 2008 at 03:41:58PM +0200, Kenneth Johansson wrote:
> > I'm just wondering what the status and plans are with the V2 branch.
> >
> > Is the plan that at some future date everyone just stops works on the
> > main branch and switch over to V2 or is the features of V2 going to be
> > ported over one by one.
> 
> v2 is currently a technology study, lead by Pengutronix developers
> (mainly Sascha Hauer), which shows where *we* do currently see weak
> points in the U-Boot design and how things could look in the future.
> 
> I doubt that there will some point in time where everyone will just
> switch over; what will happen depends very much on how much people look
> at the code, see the shiny beauty of these ideas and start contributing
> :-)
Some personal experiences might be in context.
a) If you look at u-boot v2 with the expectation that architecture is same as 
U-Boot v1, you'd be sadly proven wrong. It is more aligned with linux kernel 
architecture than U-Boot v1.
b) If you expect all features you see in U-Boot v1 to be present in U-Boot v2, 
again you'd be proven wrong. In my experience, most peripherals and features I 
need, I am having to port it/make it work.. but then folks who love to hack 
around from scratch would love it..
c) Is there a huge user base like U-Boot v1 for U-Boot v2? Not from what I see 
in the list and in irc. U-Boot v2 is what we'd call "early adopter" phase.. 
mebbe a little before that I guess. Very few brave folks have stepped in ;)..
d) I find U-Boot v2 code architecture to be much cleaner, easily modifiable+ 
maintainable in comparison with U-Boot v1. But then, that is a personal 
preference (no offence to any folks ;)).
e) Are all features stable? I do not think so.. As it is still a nascent 
concept. But I think we can fix all that is broken out there. Lot of stuff can 
be done in sandbox (PC app emulation of u-boot v2), so there are opportunities.

In short, I see huge potential in U-Boot v2, only it will take some effort in 
getting it working in mainstream.

Regards,
Nishanth Menon


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] can u-boot run standalone in qemu(qemu-system-arm) without kernel image(for mainstone II)

2008-05-30 Thread Vlad Lungu
wong wrote:
> hi, all
> 
> I'm a newbie to both u-boot and qemu.
> Maybe it's a silly question, but I can not find the solution through the
> Internet for almost 2 weeks, sorry :(
> 
> Here is my question:
> 
> I wanna run u-boot as a standalone app (or image?) in qemu, and I do't wanna
> any create linux image.
> Is that possible? I just wanna to study u-boot.

I have no idea if it is possible with that particular emulation, but I did 
something similar
with qemu-system-mips. Qemu loads a bootloader binary image  on startup (if 
available) with most
emulations, for you it should be named arm_bios.bin probably. You can tell Qemu 
from what directory
to load it with the -L option, so just create a symlink to u-boot.bin named 
arm_bios.bin and launch
qemu-system-mips -L . /dev/null (/dev/null is needed so it will not complain 
that you have no kernel
and no disk image)

When you pass the -kernel option to qemu, it usually has a very small internal 
bootloader to setup a
few registers and pass control to the kernel. I know it does this for mips.

> And now, my idea is to create a flash image with u-boot,  how about this
> way?
> 

It depends on how that particular machine is emulated. Check the -pflash option 
Qemu, it might help.

Regards,
Vlad

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] U-Boot NAND driver for s3c6400

2008-05-30 Thread Guennadi Liakhovetski
On Fri, 30 May 2008, Martin Krause wrote:

> Hi Guennadi,
> 
> [EMAIL PROTECTED] wrote on :
> > Hi Harald, all
> > 
> > do you or anyone else know, if there is a s3c6400 NAND driver
> > available somewhere for a recent U-Boot version (not OneNAND)?
> > Preferably with booting from NAND support?
> 
> I have the U-Boot code delivered by Samsung with the SMDK6400.
> It is based on U-Boot 1.1.6 and boots from NAND, but I guess
> you already have this code?

yep, got that, thanks. That's why I said "recent version":-) That would 
reduce porting work.

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] U-Boot NAND driver for s3c6400

2008-05-30 Thread Martin Krause
Hi Guennadi,

[EMAIL PROTECTED] wrote on :
> Hi Harald, all
> 
> do you or anyone else know, if there is a s3c6400 NAND driver
> available somewhere for a recent U-Boot version (not OneNAND)?
> Preferably with booting from NAND support?

I have the U-Boot code delivered by Samsung with the SMDK6400.
It is based on U-Boot 1.1.6 and boots from NAND, but I guess
you already have this code?

Best Regards,
Martin Krause

--
TQ-Systems GmbH
Muehlstrasse 2, Gut Delling, D-82229 Seefeld
Amtsgericht Muenchen, HRB 105 018, UST-IdNr. DE 811 607 913
Geschaeftsfuehrer: Dipl.-Ing. (FH) Detlef Schneider, Dipl.-Ing. (FH) Ruediger 
Stahl
http://www.tq-group.com

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] u-boot v2

2008-05-30 Thread Robert Schwebel
On Wed, May 28, 2008 at 03:41:58PM +0200, Kenneth Johansson wrote:
> I'm just wondering what the status and plans are with the V2 branch. 
> 
> Is the plan that at some future date everyone just stops works on the
> main branch and switch over to V2 or is the features of V2 going to be
> ported over one by one.

v2 is currently a technology study, lead by Pengutronix developers
(mainly Sascha Hauer), which shows where *we* do currently see weak
points in the U-Boot design and how things could look in the future.

I doubt that there will some point in time where everyone will just
switch over; what will happen depends very much on how much people look
at the code, see the shiny beauty of these ideas and start contributing
:-)

People have contributed in the past, they still do, we do active
development on it for real life customer projects, because it solves
real problems. So it will evolve over the time. Anything else is a
matter of community activity.

Robert
-- 
 Dipl.-Ing. Robert Schwebel | http://www.pengutronix.de
 Pengutronix - Linux Solutions for Science and Industry
   Handelsregister:  Amtsgericht Hildesheim, HRA 2686
 Hannoversche Str. 2, 31134 Hildesheim, Germany
   Phone: +49-5121-206917-0 |  Fax: +49-5121-206917-9


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [PATCH] Fix lwmon5 dsp POST sequence.

2008-05-30 Thread Wolfgang Denk
In message <[EMAIL PROTECTED]> you wrote:
> 
> + /* momorize fpga status */

momorize ?

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: [EMAIL PROTECTED]
Those who do not  understand  Unix  are  condemned  to  reinvent  it,
poorly.  - Henry Spencer, University of Toronto Unix hack

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


[U-Boot-Users] MPC8360x FATAL BUG with UEC and 10BaseT

2008-05-30 Thread Russell McGuire
All - Freescale crowd,

Carefully reading the manual it becomes evident, though not obvious that
current U-boot UEC driver would crash with any 10BaseT hub connected.

I.e. any RGMII connection with Half Duplex, which the current UEC driver
readily will set, is an illegal mode in the MPC83xx chipsets. At least the
MPC836xx chips.  

You'll get TX FIFO errors, followed by no TX Buffers ready, as the QE just
locks up.

My main concern is that how does one make the PHY switch modes without
implementing some kind of crude reset of the entire driver? I.e. the PHY has
to change interface mode from RGMII to something else that can support half
duplex, as well as the MAC inside the MPC83xx has to change modes to
something other than RGMII that can support half duplex. 

Currently there is no code path to drive anything other than RGMII. Anyone
got suggestions? My beta code for a national GigE part, simply calls a
function similar to the Marvell change_phy_interface() seems to cause the QE
to never get a lock with the PHY device, and thus nothing is ever
established.  Not sure if the QE is losing sync with the PHY or the PHY is
blowing up due to a change of interface type on the fly.

Kim???

-Russ




-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [PATCH] Add a fpga memory test and some bugfixes to the fpga POST.

2008-05-30 Thread Wolfgang Denk
In message <[EMAIL PROTECTED]> you wrote:
>
> + out_be32(address, pattern[i]);
> + /* read other location (protect against data lines capacity) */
> + read_value = in_be16((void *)FPGA_VERSION_REG);

You should perform a 32 bit read here, too.

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: [EMAIL PROTECTED]
The day-to-day travails of the IBM programmer are so amusing to  most
of us who are fortunate enough never to have been one - like watching
Charlie Chaplin trying to cook a shoe.

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] [PATCH] Fix a missing include for the lwmon5 dspic init POST.

2008-05-30 Thread Wolfgang Denk
In message <[EMAIL PROTECTED]> you wrote:
...
> - while (!gpio_read_in_bit(CFG_GPIO_DSPIC_READY) && reg++ < 1000) {
> + while (gpio_read_in_bit(CFG_GPIO_DSPIC_READY) && reg++ < 1000) {
>   udelay(1000);
>   }
> - gpio_write_bit(CFG_GPIO_HIGHSIDE, 0);
>   if (gpio_read_in_bit(CFG_GPIO_DSPIC_READY)) {
>   /* set "boot error" flag */
>   out_be32((void *)CFG_DSPIC_TEST_ADDR,
>   in_be32((void *)CFG_DSPIC_TEST_ADDR) |
>   CFG_DSPIC_TEST_MASK);
> + } else {
> + /* dspic ready - disable LSB transmitter */
> + gpio_write_bit(CFG_GPIO_HIGHSIDE, 0);

Description and patch don't match. Please fix.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [EMAIL PROTECTED]
: ... and it's got weird formatting - Notepad, Write, Works  3  can't
: decipher it, and it's too big to go in DOS Edit. Help!
Install an operating system. :-)  -- Tom Christiansen

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


Re: [U-Boot-Users] u-boot and Linux kernel forward compatibility is unsure?

2008-05-30 Thread Wolfgang Denk
In message <[EMAIL PROTECTED]> you wrote:
> 
> I wonder if this is a common use and if it makes sense to implement
> this for mainstream u-boot, or is this very specific?

This is common use, and U-Boot already support it. See the bootcount
feature (http://www.denx.de/wiki/view/DULG/UBootBootCountLimit), and
read about alternative images in the new image format
(doc/uImage.FIT/*).

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: [EMAIL PROTECTED]
They're usually so busy thinking about what  happens  next  that  the
only  time they ever find out what is happening now is when they come
to look back on it. - Terry Pratchett, _Wyrd Sisters_

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


[U-Boot-Users] U-Boot NAND driver for s3c6400

2008-05-30 Thread Guennadi Liakhovetski
Hi Harald, all

do you or anyone else know, if there is a s3c6400 NAND driver available 
somewhere for a recent U-Boot version (not OneNAND)? Preferably with 
booting from NAND support?

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


[U-Boot-Users] 真诚信

2008-05-30 Thread 您好
你好。我公司是一家香港上市公司的下属子公司,在全国大中城市有多家分部。
现在有一部分:工商业销售、建筑安装、咨询、广告服务、餐饮酒店等fa#票
价钱低点如贵公司有业务需要我方诚恳联系贵方携手共创效益。
彼此合作真诚必将成为朋友!
联系人:刘总13691829296
致,礼!

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


[U-Boot-Users] [PATCH] Fix lwmon5 dsp POST sequence.

2008-05-30 Thread sascha.laue
From: Sascha Laue <[EMAIL PROTECTED]>


Signed-off-by: Sascha Laue <[EMAIL PROTECTED]>
---
 post/board/lwmon5/dsp.c |   21 +++--
 1 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/post/board/lwmon5/dsp.c b/post/board/lwmon5/dsp.c
index a96ac7d..bc12e42 100644
--- a/post/board/lwmon5/dsp.c
+++ b/post/board/lwmon5/dsp.c
@@ -33,20 +33,37 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#define DSP_STATUS_REG 0xC408
+#define DSP_STATUS_REG 0xC408
+#define FPGA_STATUS_REG0xC40C
 
 int dsp_post_test(int flags)
 {
+   uint   old_value;
uint   read_value;
intret;
+   
+   /* momorize fpga status */
+   old_value = in_be32((void *)FPGA_STATUS_REG);
+   /* enable outputs */
+   out_be32((void *)FPGA_STATUS_REG, 0x30);
+   
+   /* generate sync signal */
+   out_be32((void *)DSP_STATUS_REG, 0x300);
+   udelay(5);
+   out_be32((void *)DSP_STATUS_REG, 0);
+   udelay(500);
 
+   /* read status */   
ret = 0;
read_value = in_be32((void *)DSP_STATUS_REG) & 0x3;
-   if (read_value != 0x3) {
+   if (!(read_value & 0x3)) {
post_log("\nDSP status read %08X\n", read_value);
ret = 1;
}
 
+   /* restore fpga status */
+   out_be32((void *)FPGA_STATUS_REG, old_value);
+
return ret;
 }
 
-- 
1.5.2.4


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


[U-Boot-Users] [PATCH] Add a fpga memory test and some bugfixes to the fpga POST.

2008-05-30 Thread sascha.laue
From: Sascha Laue <[EMAIL PROTECTED]>

Signed-off-by: Sascha Laue <[EMAIL PROTECTED]>
---
 post/board/lwmon5/fpga.c |   58 ++---
 1 files changed, 54 insertions(+), 4 deletions(-)

diff --git a/post/board/lwmon5/fpga.c b/post/board/lwmon5/fpga.c
index b48390b..aa8f8bb 100644
--- a/post/board/lwmon5/fpga.c
+++ b/post/board/lwmon5/fpga.c
@@ -41,6 +41,14 @@ DECLARE_GLOBAL_DATA_PTR;
 
 #if CONFIG_POST & CFG_POST_BSPEC3
 
+const static uint pattern[] = {
+   0x,
+   0x,
+   0xAAAA,
+   0x5555,
+   0x0
+};
+
 static int one_scratch_test(uint value)
 {
uint read_value;
@@ -60,13 +68,47 @@ static int one_scratch_test(uint value)
return ret;
 }
 
+/* FPGA Memory-pattern-test */
+static int fpga_mem_test(void * address)
+{
+   int ret = 1;
+   uint read_value;
+   uint old_value;
+   uint i = 0;
+
+   old_value = in_be32(address);
+
+   while (pattern[i] != 0) {
+   out_be32(address, pattern[i]);
+   /* read other location (protect against data lines capacity) */
+   read_value = in_be16((void *)FPGA_VERSION_REG);
+   /* verify test pattern */
+   read_value = in_be32(address);
+
+   if (read_value != pattern[i]) {
+   post_log("FPGA memory test failed.");
+   post_log(" write %08X, read %08X at address %08X\n",
+   pattern[i], read_value, address);
+   goto out;
+   }
+   i++;
+   }
+
+   ret = 0;
+out:
+   out_be32(address, old_value);
+   return ret;
+}
+
 /* Verify FPGA, get version & memory size */
 int fpga_post_test(int flags)
 {
uint   old_value;
-   ushort version;
+   uint   version;
uint   read_value;
intret = 0;
+   uint   address;
+   uint   old_fpga_stat;
 
post_log("\n");
old_value = in_be32((void *)FPGA_SCRATCH_REG);
@@ -78,16 +120,24 @@ int fpga_post_test(int flags)
 
out_be32((void *)FPGA_SCRATCH_REG, old_value);
 
-   version = in_be16((void *)FPGA_VERSION_REG);
-   post_log("FPGA : version %u.%u\n",
+   version = in_be32((void *)FPGA_VERSION_REG);
+   post_log("FPGA version %u.%u\n",
(version >> 8) & 0xFF, version & 0xFF);
 
/* Enable write to FPGA RAM */
out_be32((void *)FPGA_STAT, in_be32((void *)FPGA_STAT) | 0x1000);
 
read_value = get_ram_size((void *)CFG_FPGA_BASE_1, 0x4000);
-   post_log("FPGA RAM size: %d bytes\n", read_value);
+   post_log("FPGA RAM size %d bytes\n", read_value);
 
+   for (address = 0; address < 0x1000; address++) {
+   if (fpga_mem_test((void *)(FPGA_RAM_START + 4*address)) == 1) {
+   ret = 1;
+   goto out;
+   }
+   }
+out:
+   out_be32((void *)FPGA_STAT, in_be32((void *)FPGA_STAT) & 0xEFFF);
return ret;
 }
 
-- 
1.5.2.4


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


[U-Boot-Users] [PATCH] configure dsp POST and add watchdog reset to the diag cmd.

2008-05-30 Thread sascha.laue
From: Sascha Laue <[EMAIL PROTECTED]>


Signed-off-by: Sascha Laue <[EMAIL PROTECTED]>
---
 post/post.c  |1 +
 post/tests.c |2 +-
 2 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/post/post.c b/post/post.c
index d31829b..99dc8c9 100644
--- a/post/post.c
+++ b/post/post.c
@@ -319,6 +319,7 @@ int post_run (char *name, int flags)
}
 
if (i < post_list_size) {
+   WATCHDOG_RESET();
return post_run_single (post_list + i,
test_flags[i],
flags, i);
diff --git a/post/tests.c b/post/tests.c
index a790c78..e88d92e 100644
--- a/post/tests.c
+++ b/post/tests.c
@@ -240,7 +240,7 @@ struct post_test post_list[] =
"DSP test",
"dsp",
"This test checks any connected DSP(s).",
-   POST_RAM | POST_MANUAL,
+   POST_RAM | POST_ALWAYS | POST_MANUAL,
&dsp_post_test,
NULL,
NULL,
-- 
1.5.2.4


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


[U-Boot-Users] [PATCH] Change GPIO to control the LSB transmitter on lwmon5 board.

2008-05-30 Thread sascha.laue
From: Sascha Laue <[EMAIL PROTECTED]>


Signed-off-by: Sascha Laue <[EMAIL PROTECTED]>
---
 board/lwmon5/lwmon5.c|5 +++--
 include/configs/lwmon5.h |2 ++
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/board/lwmon5/lwmon5.c b/board/lwmon5/lwmon5.c
index c29dfc1..7bfbb1b 100644
--- a/board/lwmon5/lwmon5.c
+++ b/board/lwmon5/lwmon5.c
@@ -98,7 +98,8 @@ int board_early_init_f(void)
gpio_write_bit(CFG_GPIO_FLASH_WP, 1);
 
 #if CONFIG_POST & CFG_POST_BSPEC1
-   gpio_write_bit(CFG_GPIO_HIGHSIDE, 1);
+   /* enable the LSB transmitter */
+   gpio_write_bit(CFG_GPIO_LSB_ENABLE, 1);
 
reg = 0; /* reuse as counter */
out_be32((void *)CFG_DSPIC_TEST_ADDR,
@@ -114,7 +115,7 @@ int board_early_init_f(void)
CFG_DSPIC_TEST_MASK);
} else {
/* dspic ready - disable LSB transmitter */
-   gpio_write_bit(CFG_GPIO_HIGHSIDE, 0);
+   gpio_write_bit(CFG_GPIO_LSB_ENABLE, 0);
}
 #endif
 
diff --git a/include/configs/lwmon5.h b/include/configs/lwmon5.h
index cf406c8..2ad82ed 100644
--- a/include/configs/lwmon5.h
+++ b/include/configs/lwmon5.h
@@ -521,6 +521,8 @@
 #define CFG_GPIO_FLASH_WP  14
 #define CFG_GPIO_PHY0_RST  22
 #define CFG_GPIO_DSPIC_READY   51
+#define CFG_GPIO_CAN_ENABLE53
+#define CFG_GPIO_LSB_ENABLE54
 #define CFG_GPIO_EEPROM_EXT_WP 55
 #define CFG_GPIO_HIGHSIDE  56
 #define CFG_GPIO_EEPROM_INT_WP 57
-- 
1.5.2.4


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users


[U-Boot-Users] [PATCH] Fix a missing include for the lwmon5 dspic init POST.

2008-05-30 Thread sascha.laue
From: Sascha Laue <[EMAIL PROTECTED]>

Signed-off-by: Sascha Laue <[EMAIL PROTECTED]>
---
 board/lwmon5/lwmon5.c |7 +--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/board/lwmon5/lwmon5.c b/board/lwmon5/lwmon5.c
index b63fbdc..c29dfc1 100644
--- a/board/lwmon5/lwmon5.c
+++ b/board/lwmon5/lwmon5.c
@@ -24,6 +24,7 @@
 #include 
 #include 
 #include 
+#include 
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -103,15 +104,17 @@ int board_early_init_f(void)
out_be32((void *)CFG_DSPIC_TEST_ADDR,
in_be32((void *)CFG_DSPIC_TEST_ADDR)
& ~CFG_DSPIC_TEST_MASK);
-   while (!gpio_read_in_bit(CFG_GPIO_DSPIC_READY) && reg++ < 1000) {
+   while (gpio_read_in_bit(CFG_GPIO_DSPIC_READY) && reg++ < 1000) {
udelay(1000);
}
-   gpio_write_bit(CFG_GPIO_HIGHSIDE, 0);
if (gpio_read_in_bit(CFG_GPIO_DSPIC_READY)) {
/* set "boot error" flag */
out_be32((void *)CFG_DSPIC_TEST_ADDR,
in_be32((void *)CFG_DSPIC_TEST_ADDR) |
CFG_DSPIC_TEST_MASK);
+   } else {
+   /* dspic ready - disable LSB transmitter */
+   gpio_write_bit(CFG_GPIO_HIGHSIDE, 0);
}
 #endif
 
-- 
1.5.2.4


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users