On Friday 22 May 2009 12:20:57 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.
>
> FYI, I'm using this patchset all the time while working with flash on the
> boards I'm testing.
>
> I finally merged the command_address functionality into flash_address
> function. The rest is the same as I sent.
>
> I hope this patchset is considered for version 0.2.0. But a little
> testing should confirm this.
>
> [0] http://www.jedec.org/download/search/jesd68-01.pdf
--
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
--- a/src/flash/cfi.c
+++ b/src/flash/cfi.c
@@ -112,9 +112,11 @@
/* inline u32 flash_address(flash_bank_t *bank, int sector, u32 offset) */
static __inline__ u32 flash_address(flash_bank_t *bank, int sector, u32 offset)
{
+ cfi_flash_bank_t *cfi_info = bank->driver_priv;
+
/* while the sector list isn't built, only accesses to sector 0 work */
if (sector == 0)
- return bank->base + offset * bank->bus_width;
+ return bank->base + (offset * bank->bus_width << cfi_info->x16_as_x8 );
else
{
if (!bank->sectors)
@@ -122,7 +124,7 @@
LOG_ERROR("BUG: sector list not yet built");
exit(-1);
}
- return bank->base + bank->sectors[sector].offset + offset * bank->bus_width;
+ return bank->base + bank->sectors[sector].offset + (offset * bank->bus_width << cfi_info->x16_as_x8 );
}
}
_______________________________________________
Openocd-development mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/openocd-development