From: DENX Support System Date: Sat, 1 Apr 2006 00:20:04 +0200 Subject: [DNX#2006040142000062] [U-Boot-Users] [PATCH] eliminate assumptions about [...] Message-ID: <1143843604.641734.734210885@castor.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hello list, inside the automatic U-Boot patch tracking system a new ticket [DNX#2006040142000062] was created: > Hi, > > the dataflash driver contains a hard-coded partition table which might > suit one particular board (which I doubt, however) but certainly isn't > generally applicable. > > Furthermore, it write-protects the first two partitions, which violates > the U-Boot standard of allowing the user enough rope to shoot himself > in the foot. > > Besides, the dataflash partitions aren't even on sector boundaries (the > dataflash chips have rather unusual sector sizes; 528 or 1056 bytes, > which makes one wonder what the folks at Atmel are smoking). > > The patch below places the entire dataflash in one (writable) partition. > > Cheers > Anders > > Signed-off-by: Anders Larsen > > CHANGELOG: > Don't write-protect arbitrary areas of Atmel dataflash > Patch by Anders Larsen, 13 Oct 2005 > > --- > > drivers/dataflash.c | 7 ++----- > include/dataflash.h | 4 ++-- > 2 files changed, 4 insertions(+), 7 deletions(-) > > diff --git a/drivers/dataflash.c b/drivers/dataflash.c > index ded0395..a558dba 100644 > --- a/drivers/dataflash.c > +++ b/drivers/dataflash.c > @@ -33,10 +33,7 @@ int cs[][CFG_MAX_DATAFLASH_BANKS] = { > > /*define the area offsets*/ > dataflash_protect_t area_list[NB_DATAFLASH_AREA] = { > - {0, 0x7fff, FLAG_PROTECT_SET}, /* ROM code */ > - {0x8000, 0x1ffff, FLAG_PROTECT_SET}, /* u-boot code */ > - {0x20000, 0x27fff, FLAG_PROTECT_CLEAR}, /* u-boot environment */ > - {0x28000, 0x1fffff, FLAG_PROTECT_CLEAR}, /* data area size to tune */ > + {0, 0x1fffff, FLAG_PROTECT_CLEAR}, /* size tuned below */ > }; > > extern void AT91F_SpiInit (void); > @@ -110,7 +107,7 @@ int AT91F_DataflashInit (void) > break; > } > /* set the last area end to the dataflash size*/ > - area_list[NB_DATAFLASH_AREA -1].end = > + area_list[NB_DATAFLASH_AREA-1].end = > (dataflash_info[i].Device.pages_number * > dataflash_info[i].Device.pages_size)-1; > > diff --git a/include/dataflash.h b/include/dataflash.h > index 650454e..825eec6 100644 > --- a/include/dataflash.h > +++ b/include/dataflash.h > @@ -37,8 +37,8 @@ > #include > #include "config.h" > > -/*number of protected area*/ > -#define NB_DATAFLASH_AREA 4 > +/*number of areas*/ > +#define NB_DATAFLASH_AREA 1 > > /*define the area structure*/ > typedef struct { > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: > Power Architecture Resource Center: Free content, downloads, > discussions, > and more. http://solutions.newsforge.com/ibmarch.tmpl > _______________________________________________ > U-Boot-Users mailing list > U-Boot-Users at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/u-boot-users Your U-Boot support team