[U-Boot] [PATCH] fix flash_sect_erase() to display correct message

Wolfgang Denk wd at denx.de
Wed Nov 18 23:33:35 CET 2009


Dear =?UTF-8?B?IlNldW5naHllb24gUmhlZSAo7J207Iq57ZiEKSI=?=,

In message <4B035EE8.90702 at lpmtec.com> you wrote:
> 
> > I think this patch is not an improvement. Now it prints "Not erased"
> > even when sectors _have_ successfully been earased, which is at least
> > as wrong als the old behaviour.
...
> > As you can see, we _always_ print a warning message.
> >   
> Actually, we usually print the warning message but not _always_.
> That depends on the flash implementation (*flash.c) of each board.

Ah! So you are talking about a custom flash driver.

> At least 20 implementations currently do nothing and return with
> ERR_PROTECTED if they found any protected sectors. I was porting U-Boot

Well, in this case we should consider this flash driver incomplete or
broken and fix that one first.

> to my board and found the artifact. Unfortunately (or fortunately in
> some respect), I chose smdk2410's flash.c as a template which belongs
> to the _irregular_ case.

So I suggest you dump your copy of that driver code, and use the CFI
driver instead - it seems the smdk2410 flash driver supports only CFI
conformant flashes anyway, so it could/should be removed.

> > If you want, and if you can find a clean way to implement it, it
> > might make sense to change the output into something like "Erased 4
> > (instead of 7 requested) sectors" or the like.
> >   
> I think we need to first make all of them consistent. My suggestion is:

OK, then please start by removing obsolete and redundant driver code
and use the CFI driver wherever possible.

> - display a warning message in flash_erase() that there are some
>   protected sectors and erase unprotected sectors like now.

OK.

> - remove the number indicating how manny sectors are erased from the
>   message in flash_sect_erase() or any caller of flash_erase(). A simple
>   message like "done" would be enough.

I disagree. I find the number of erased sectors a pretty useful
information (for example when it comes to calculate ease timings).

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: wd at denx.de
Alles Gescheite ist schon gedacht worden, man muß nur versuchen,
es noch einmal zu denken.          -- Goethe, Maximen und Reflexionen


More information about the U-Boot mailing list