Skip to content

Commit 0fe3ede

Browse files
Aaron SierraBoris Brezillon
authored andcommitted
mtd: cfi: Add early fixup for S70GL02GS
S70GL02GS flash reports a single 256 MiB chip, but is really made up of two 128 MiB chips with 1024 sectors each. Without early fixups (top half of device cannot be written or erased): ff0000000.nor-boot: Found 1 x16 devices at 0x0 in 16-bit bank. <snip> Amd/Fujitsu Extended Query Table at 0x0040 Amd/Fujitsu Extended Query version 1.5. number of CFI chips: 1 With early fixups (entire device can be written and erased): Bad S70GL02GS CFI data; adjust to detect 2 chips ff0000000.nor-boot: Found 1 x16 devices at 0x0 in 16-bit bank. <snip> ff0000000.nor-boot: Found 1 x16 devices at 0x8000000 in 16-bit bank Amd/Fujitsu Extended Query Table at 0x0040 Amd/Fujitsu Extended Query version 1.5. number of CFI chips: 2 Signed-off-by: Aaron Sierra <asierra@xes-inc.com> Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
1 parent b1c97e2 commit 0fe3ede

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

drivers/mtd/chips/cfi_probe.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,19 @@ static int __xipram cfi_probe_chip(struct map_info *map, __u32 base,
175175
return 1;
176176
}
177177

178+
static void fixup_s70gl02gs_chips(struct cfi_private *cfi)
179+
{
180+
/*
181+
* S70GL02GS flash reports a single 256 MiB chip, but is really made up
182+
* of two 128 MiB chips with 1024 sectors each.
183+
*/
184+
cfi->cfiq->DevSize = 27;
185+
cfi->cfiq->EraseRegionInfo[0] = 0x20003ff;
186+
pr_warn("Bad S70GL02GS CFI data; adjust to detect 2 chips\n");
187+
}
188+
178189
static const struct cfi_early_fixup cfi_early_fixup_table[] = {
190+
{ CFI_MFR_AMD, 0x4801, fixup_s70gl02gs_chips },
179191
{ },
180192
};
181193

0 commit comments

Comments
 (0)