All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot-Users] Re: Patch s3c2410 nand-boot.
       [not found] <3F68D1DF.7020007@libero.it>
@ 2003-09-18 10:31 ` Wolfgang Denk
  2003-09-18 12:09   ` Gianluca
  0 siblings, 1 reply; 6+ messages in thread
From: Wolfgang Denk @ 2003-09-18 10:31 UTC (permalink / raw)
  To: u-boot

Dear Gianluca,

in message <3F68D1DF.7020007@libero.it> you wrote:
> 
> I send you my patch for s3c2410 ARM processor. This patch implements 
> boot directly from nandflash. I haven't created new board in board 
> directory but I have writed new config-file (smdk2410nand.h) that use 
> smdk2410 board.

I have forwarded your patch to David M?ller who is the maintainer for
the SMDK2410 board; I cannot test it myself.

> I tested with MAKEALL ARM9 my patch.
> I changed the frequency of internal clock of s3c2410 (for smdk2410 
> borad) because (only) in this way the Linux Mizi kernel can boot correctly.
> The patch is based on u-boot 0.4.8.
> 
> This is my first contribution to open source and I hope that it is 
> useful to someone.

It is definitely useful, but I have a couple of questions:

* Which problem are you trying to address which is not  supported  by
  the existing NAND code?

* Is it necessary to implement this in a processor specific way?

* You add new configuration options like CONFIG_S3C2410_NAND_BOOT but
  do not include any  dosumentation.  At  least,  please  provide  an
  explantion  of these options for the README fie. If you feel longer
  explanations are needed create a new file  doc/README.NAND-Boot  or
  so.


David, I've forwarded the patch to you. Can you please have a look at
the implementation details? Thanks.

Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd at denx.de
"If God had wanted us to use the metric system, Jesus would have  had
10 apostles."

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot-Users] Re: Patch s3c2410 nand-boot.
  2003-09-18 10:31 ` [U-Boot-Users] Re: Patch s3c2410 nand-boot Wolfgang Denk
@ 2003-09-18 12:09   ` Gianluca
  2003-09-19 10:15     ` "David Müller (ELSOFT AG)"
  0 siblings, 1 reply; 6+ messages in thread
From: Gianluca @ 2003-09-18 12:09 UTC (permalink / raw)
  To: u-boot

Wolfgang Denk wrote:
> Dear Gianluca,
> 
> in message <3F68D1DF.7020007@libero.it> you wrote:
> 
>>I send you my patch for s3c2410 ARM processor. This patch implements 
>>boot directly from nandflash. I haven't created new board in board 
>>directory but I have writed new config-file (smdk2410nand.h) that use 
>>smdk2410 board.
> 
> 
> I have forwarded your patch to David M?ller who is the maintainer for
> the SMDK2410 board; I cannot test it myself.
> 
> 
>>I tested with MAKEALL ARM9 my patch.
>>I changed the frequency of internal clock of s3c2410 (for smdk2410 
>>borad) because (only) in this way the Linux Mizi kernel can boot correctly.
>>The patch is based on u-boot 0.4.8.
>>
>>This is my first contribution to open source and I hope that it is 
>>useful to someone.
> 
> 
> It is definitely useful, but I have a couple of questions:
> 
> * Which problem are you trying to address which is not  supported  by
>   the existing NAND code?

I have changed NAND code only to remove warning beacuse I don't use
some variable an then I rewrite "unsigned long nandptr = nand->IO_ADDR;" in
"unsigned long nandptr;  nandptr = nand->IO_ADDR;".

> 
> * Is it necessary to implement this in a processor specific way?

The boot from nand (without flash) is specific of s3c2410 cpu and so I
rewrite some part of cpu/arm920t/start.S (reset and copy from nand to ram).

> 
> * You add new configuration options like CONFIG_S3C2410_NAND_BOOT but
>   do not include any  dosumentation.  At  least,  please  provide  an
>   explantion  of these options for the README fie. If you feel longer
>   explanations are needed create a new file  doc/README.NAND-Boot  or
>   so.
> 

I have forgot!
When you want boot from nand-flash and not from frash you have to define
CONFIG_S3C2410_NAND_BOOT in your conifg file. This define is independent 
  to u-boot NAND support.

> 
> David, I've forwarded the patch to you. Can you please have a look at
> the implementation details? Thanks.
> 
> Best regards,
> 
> Wolfgang Denk
> 

Bye
Ginaluca

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot-Users] Re: Patch s3c2410 nand-boot.
  2003-09-18 12:09   ` Gianluca
@ 2003-09-19 10:15     ` "David Müller (ELSOFT AG)"
  2003-09-19 20:14       ` Wolfgang Denk
  0 siblings, 1 reply; 6+ messages in thread
From: "David Müller (ELSOFT AG)" @ 2003-09-19 10:15 UTC (permalink / raw)
  To: u-boot

Hello

Gianluca wrote:
> I have changed NAND code only to remove warning beacuse I don't use
> some variable an then I rewrite "unsigned long nandptr = nand->IO_ADDR;" in
> "unsigned long nandptr;  nandptr = nand->IO_ADDR;".
>

Wolfgang and I have agreed, that direct hardware accesses and board
specific implementation details should be removed from "cmd_nand.c", but
should be implemented in a cpu and / or board specific low level NAND
flash driver instead.

Please take a look at the NAND part of the Linux MTD drivers to get an
idea how it should work.


> David, I've forwarded the patch to you. Can you please have a look at
> the implementation details? Thanks.
>

I'm afraid that "bulletproof" booting from a NAND flash is not as simple
as i may look at first. Please keep in mind that NAND flash are not 100%
error free, but contain an arbitrary number of "bad blocks" (and new
ones could appear during lifetime). Only the two first blocks of a NAND
flash device are normally guarantied to be error free. Additionally the
code which can be executed "directly" on the S3C24x0 when booting from a
NAND flash is further limited to 4KB in size.

So a multi stage boot process has to be implemented. After reset,
hardware loads a tiny piece of code from the first two blocks of the
NAND flash. This code has to do:

  - minimial initialisation of CPU
  - initialisation of SDRAM and NAND flash
  - copy rest of boot code (U-Boot) from NAND to SDRAM while taking
    care of bad blocks
  - jump to an appropriate place to give up control to rest of boot code



Dave

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot-Users] Re: Patch s3c2410 nand-boot.
  2003-09-19 10:15     ` "David Müller (ELSOFT AG)"
@ 2003-09-19 20:14       ` Wolfgang Denk
  2003-09-22 13:22         ` Matt Matoushek
  0 siblings, 1 reply; 6+ messages in thread
From: Wolfgang Denk @ 2003-09-19 20:14 UTC (permalink / raw)
  To: u-boot

Hello,

in message <3F6AD744.1030107@elsoft.ch> you wrote:
> 
> So a multi stage boot process has to be implemented. After reset,

I agree.

> hardware loads a tiny piece of code from the first two blocks of the
> NAND flash. This code has to do:
> 
>   - minimial initialisation of CPU
>   - initialisation of SDRAM and NAND flash
>   - copy rest of boot code (U-Boot) from NAND to SDRAM while taking
>     care of bad blocks
>   - jump to an appropriate place to give up control to rest of boot code

In my opinion, such a "primary  boot  loader"  should  be  completely
independend  of U-Boot, i. e. you shouldbe able to use it to load any
other boot loader as well, and the U-Boot  code  itself  should  only
need minimal adjustment.

Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd at denx.de
Good morning. This is the telephone company. Due  to  repairs,  we're
giving  you  advance notice that your service will be cut off indefi-
nitely at ten o'clock. That's two minutes from now.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot-Users] Re: Patch s3c2410 nand-boot.
@ 2003-09-20 13:57 Woodruff, Richard
  0 siblings, 0 replies; 6+ messages in thread
From: Woodruff, Richard @ 2003-09-20 13:57 UTC (permalink / raw)
  To: u-boot

The CONFIG_OMAP1510 defines in cmd_nand.c aren't really CPU specific, they
are NAND specific (for NAND parts which have their WP pins hooked up).  It
happens that our design hooked them up to a BIU signal which matched up to
its functionality.

Woodhouse had indicated to me that the general NAND MTD code would be
changing to handle the selective control of the WP signal also as other
devices are showing up with it connected.  I think he said the parts he had
previously worked with just globally disabled the wp function.

Those defines should probably be renamed and inlined like the other control
pin def's.

I still need to put a patch in as write_oob won't work from the command line
interface if the WP pin is enabled.

Regards,

Richard W.

-----Original Message-----
From: "David M?ller (ELSOFT AG)" [mailto:d.mueller at elsoft.ch] 
Sent: Friday, September 19, 2003 5:16 AM
To: Gianluca
Cc: u-boot-users at lists.sourceforge.net
Subject: Re: [U-Boot-Users] Re: Patch s3c2410 nand-boot.

Hello

Gianluca wrote:
> I have changed NAND code only to remove warning beacuse I don't use
> some variable an then I rewrite "unsigned long nandptr = nand->IO_ADDR;"
in
> "unsigned long nandptr;  nandptr = nand->IO_ADDR;".
>

Wolfgang and I have agreed, that direct hardware accesses and board
specific implementation details should be removed from "cmd_nand.c", but
should be implemented in a cpu and / or board specific low level NAND
flash driver instead.

Please take a look at the NAND part of the Linux MTD drivers to get an
idea how it should work.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot-Users] Re: Patch s3c2410 nand-boot.
  2003-09-19 20:14       ` Wolfgang Denk
@ 2003-09-22 13:22         ` Matt Matoushek
  0 siblings, 0 replies; 6+ messages in thread
From: Matt Matoushek @ 2003-09-22 13:22 UTC (permalink / raw)
  To: u-boot

Wolfgang wrote:


>> In my opinion, such a "primary  boot  loader"  should  be  completely
>> independend  of U-Boot, i. e. you shouldbe able to use it to load any
>> other boot loader as well, and the U-Boot  code  itself  should  only
>> need minimal adjustment.


Samsung has such a solution (ADAM) available from the s3c2410 page.  The
direct link is below. (sorry about any line wrapping)

http://www.samsung.com/Products/Semiconductor/SystemLSI/MobileSolutions/
MobileASSP/MobileComputing/S3C2410X/2410loadGNU.tar

I now have a question for the U-boot team.  I have been unsuccessful in
compiling the U-boot code for the smdk2410 with the nand command
enabled.  I am successful in compiling, writing U-boot to NOR flash and
loading and running linux via tftp and bootm.  

My attempts at getting nand support have included the following:

-  Simply un-commenting CFG_CMD_NAND in include/configs/smdk2410.h.
This resulted in compile error -- CFG_MAX_NAND_DEVICE,
NAND_ChipID_UNKNOWN, etc.. all undeclared

-  Copy and Paste code from the VCMA9 board, and config in order to
alleviate compile errors.  I won't claim to know why what I was copying
was working, only that I was able to compile with nand support and get a
print out of the nand size, etc. from the nand command.

For the question.  Is U-boot presently able to take an image from NAND
flash and load it into RAM?  What is the status of this functionality on
the SMDK2410 evaluation board?  What am I missing?

Oh, and thanks for a fun tool!

--
Matt Matoushek

Invocon, Inc.
www.invocon.com
281-292-9903
mmatoushek at invocon.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2003-09-22 13:22 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <3F68D1DF.7020007@libero.it>
2003-09-18 10:31 ` [U-Boot-Users] Re: Patch s3c2410 nand-boot Wolfgang Denk
2003-09-18 12:09   ` Gianluca
2003-09-19 10:15     ` "David Müller (ELSOFT AG)"
2003-09-19 20:14       ` Wolfgang Denk
2003-09-22 13:22         ` Matt Matoushek
2003-09-20 13:57 Woodruff, Richard

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.