Hi,

I found a issue in the fixup detection of a x16 non cfi flash
connected in a x8 bus.

Attached the patch to fix the issue.

Thanks.
From dd14670cf7416573d4fdf95fd1be5ab6c5747432 Mon Sep 17 00:00:00 2001
From: Alexandre Pereira da Silva <[email protected]>
Date: Tue, 12 Apr 2011 12:56:28 -0300
Subject: [PATCH 2/3] Fix non cfi x16 nor flash connected to x8 bus.
 The ids in the table should be masked before comparison.

---
 src/flash/nor/non_cfi.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/src/flash/nor/non_cfi.c b/src/flash/nor/non_cfi.c
index b673904..795f60d 100644
--- a/src/flash/nor/non_cfi.c
+++ b/src/flash/nor/non_cfi.c
@@ -454,13 +454,19 @@ static struct non_cfi non_cfi_flashes[] = {
 
 void cfi_fixup_non_cfi(struct flash_bank *bank)
 {
+	unsigned int mask;
 	struct cfi_flash_bank *cfi_info = bank->driver_priv;
 	struct non_cfi *non_cfi = non_cfi_flashes;
 
+	if(cfi_info->x16_as_x8)
+		mask = 0xFF;
+	else
+		mask = 0xFFFF;
+
 	for (non_cfi = non_cfi_flashes; non_cfi->mfr; non_cfi++)
 	{
 		if ((cfi_info->manufacturer == non_cfi->mfr)
-			&& (cfi_info->device_id == non_cfi->id))
+			&& (cfi_info->device_id == (non_cfi->id & mask)))
 		{
 			break;
 		}
-- 
1.7.1

_______________________________________________
Openocd-development mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to