On Monday 06 July 2009 02:26:20 Prafulla Wadaskar wrote:
> From: Mike Frysinger [mailto:vap...@gentoo.org]
> > On Friday 03 July 2009 13:28:01 Prafulla Wadaskar wrote:
> > > + {
> > > +         .idcode0 = MXIC_ID_MT_MX2512855E,
> > > +         .idcode1 = MXIC_ID_MD_MX2512855E,
> > > +         .page_size = 256,
> > > +         .pages_per_sector = 16,
> > > +         .sectors_per_block = 16,
> > > +         .nr_blocks = 256,
> > > +         .name = "MX25L12855E",
> > > + },
> > >  };
> >
> > can you compare the code size to see if combining the id's in
> > a u16 is better than comparing multiple u8's ?
>
> At this moment we can save 28bytes with above suggestions,
> but Mx25L12805D and MX25L12855E have different memory types (0x20, 0x26
> resp), and they have different protection algorithm features which I was
> trying to expose through "protect" command interface in my next patch, then
> we will need this abstraction. So I wish to keep this.
> What do you think?

i was referring to also the .text differences, not just the .data.  so with a 
u16, the structure would look like:
{...
        .id = 0x1826,
        .name = "MX25L12855E",
...},{...
        .id = 0x1820,
        .name = "MX25L12805D",
...},

and the probe would look something like:
        u16 id = idcode[0] | (idcode[1] << 8);
        ...
        if (params->id == id)
                ...

i dont think this would prevent you from doing protection detection on the 
0x18 family as you could create a new define:
#define MX_PROT_FAMILY_FOO 0x18

and then in the probe code do:
        if (idcode[1] == MX_PROT_FAMILY_FOO)

i dont think the u8 -> u16 conversion would cause problems here would it ?
-mike

Attachment: signature.asc
Description: This is a digitally signed message part.

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

Reply via email to