Hello:
On Friday 22 May 2009 20:16:14 Michael Schwingen wrote:
> Raúl Sánchez Siles wrote:
> > Hello all:
> >
> > This start a patchset series for implementing x16_as_x8 cfi compliant
> > feature.
> >
> > · 01-x16_as_x8-consolidate_addresses.patch
> > · 02-x16_as_x8-flash_address.patch
> > · 03-x16_as_x8-multibyte_read.patch
> >
> > I have taken a view to the CFI specification [0] and it looks that the
> > approach should also work for intel chips, while I had only tested it
> > with spansion flash.
>
> That looks good to me - I would have expected a lot more changes.
>
> Some style comments:
> - I do not really like left shifts with what is effectively a bool
> variable as shift amount ("bank->bus_width << cfi_info->x16_as_x8"). The
> logic is correct, but it looks strange.
>
For this point I propose the attached patch. In case it is decided to be
applied consider the commit message:
"cfi flash_address coding style fix."
HTH,
--
Raúl Sánchez Siles
Departamento de Montaje
INFOGLOBAL, S. A.
* C/ Virgilio, 2. Ciudad de la Imagen.
28223 Pozuelo de Alarcón (Madrid), España
* T: +34 91 506 40 00
* F: +34 91 506 40 01
Index: src/flash/cfi.c
===================================================================
--- src/flash/cfi.c (revisión: 1910)
+++ src/flash/cfi.c (copia de trabajo)
@@ -114,9 +114,11 @@
{
cfi_flash_bank_t *cfi_info = bank->driver_priv;
+ if(cfi_info->x16_as_x8) offset*=2;
+
/* while the sector list isn't built, only accesses to sector 0 work */
if (sector == 0)
- return bank->base + (offset * bank->bus_width <<
cfi_info->x16_as_x8 );
+ return bank->base + offset * bank->bus_width;
else
{
if (!bank->sectors)
@@ -124,7 +126,7 @@
LOG_ERROR("BUG: sector list not yet built");
exit(-1);
}
- return bank->base + bank->sectors[sector].offset + (offset *
bank->bus_width << cfi_info->x16_as_x8 );
+ return bank->base + bank->sectors[sector].offset + offset *
bank->bus_width;
}
}
_______________________________________________
Openocd-development mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/openocd-development