[U-Boot] [PATCH 4/4] OneNAND: Use generic_onenand_read_page in IPL

Marek Vasut marek.vasut at gmail.com
Mon Oct 4 01:33:36 CEST 2010


Dne Ne 3. října 2010 16:27:04 Marek Vasut napsal(a):
> Dne Ne 3. října 2010 08:40:19 Kyungmin Park napsal(a):
> > Hi,
> > 
> > No it's used another place. that's reason not static function pointer.
> > I'll update it soon.
> 
> Hey, my problem is this code hangs my CPU. If I apply this patch, it
> doesn't happen anymore.
> 
> Where is this used and what's your proposed change?

btw. who's the OneNAND maintainer (aka. who's supposed to pick up these changes 
?)
> 
> Thank you in advance
> 
> > Thank you,
> > Kyungmin Park
> > 
> > On Sun, Oct 3, 2010 at 2:33 AM, Marek Vasut <marek.vasut at gmail.com> wrote:
> > > There apparantly is no reason for having "onenand_read_page"
> > > abstracted. Besides, it's static data which causes trouble.
> > > 
> > > Signed-off-by: Marek Vasut <marek.vasut at gmail.com>
> > > ---
> > > 
> > >  onenand_ipl/onenand_read.c |    9 +++------
> > >  1 files changed, 3 insertions(+), 6 deletions(-)
> > > 
> > > diff --git a/onenand_ipl/onenand_read.c b/onenand_ipl/onenand_read.c
> > > index 8d0df81..008d73a 100644
> > > --- a/onenand_ipl/onenand_read.c
> > > +++ b/onenand_ipl/onenand_read.c
> > > @@ -37,8 +37,6 @@
> > > 
> > >  extern void *memcpy32(void *dest, void *src, int size);
> > >  #endif
> > > 
> > > -int (*onenand_read_page)(ulong block, ulong page, u_char *buf, int
> > > pagesize); -
> > > 
> > >  /* read a page with ECC */
> > >  static int generic_onenand_read_page(ulong block, ulong page,
> > >  
> > >                                u_char * buf, int pagesize)
> > > 
> > > @@ -122,8 +120,6 @@ int onenand_read_block(unsigned char *buf)
> > > 
> > >        int pagesize, erasesize, erase_shift;
> > >        int page_is_4KiB = 0;
> > > 
> > > -       onenand_read_page = generic_onenand_read_page;
> > > -
> > > 
> > >        onenand_generic_init(&page_is_4KiB, &page);
> > >        
> > >        if (page_is_4KiB) {
> > > 
> > > @@ -139,10 +135,11 @@ int onenand_read_block(unsigned char *buf)
> > > 
> > >        /* NOTE: you must read page from page 1 of block 0 */
> > >        /* read the block page by page */
> > > 
> > > +
> > > 
> > >        for (block = 0; block < nblocks; block++) {
> > >        
> > >                for (; page < ONENAND_PAGES_PER_BLOCK; page++) {
> > > 
> > > -                       if (onenand_read_page(block, page, buf +
> > > offset, -                                               pagesize)) {
> > > +                       if (generic_onenand_read_page(block, page,
> > > +                                       buf + offset, pagesize)) {
> > > 
> > >                                /* This block is bad. Skip it
> > >                                
> > >                                 * and read next block */
> > >                                
> > >                                offset -= page * pagesize;
> > > 
> > > --
> > > 1.7.1
> > > 
> > > _______________________________________________
> > > U-Boot mailing list
> > > U-Boot at lists.denx.de
> > > http://lists.denx.de/mailman/listinfo/u-boot


More information about the U-Boot mailing list