[U-Boot] [PATCH v2] sf: Macronix additional chips supported

Mike Frysinger vapier at gentoo.org
Mon Jul 6 08:21:49 CEST 2009


On Monday 06 July 2009 02:26:20 Prafulla Wadaskar wrote:
> From: Mike Frysinger [mailto:vapier at 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20090706/ebd3d66a/attachment.pgp 


More information about the U-Boot mailing list