# HG changeset patch # User Mychaela Falconia # Date 1576925304 0 # Node ID 3886a8a40809b50e5e92fd0e45006b4eed0f8293 # Parent 6e8edc321460c70f7c6c78210e4844ea6979e9a7 fc-loadtool: added support for old Am29DL640G flash chip diff -r 6e8edc321460 -r 3886a8a40809 loadtools/flashid.c --- a/loadtools/flashid.c Sun Nov 17 22:40:36 2019 +0000 +++ b/loadtools/flashid.c Sat Dec 21 10:48:24 2019 +0000 @@ -14,6 +14,7 @@ extern struct flash_device flashdev_28F640C3B; extern struct flash_device flashdev_28F640W30T; extern struct flash_device flashdev_28F640W30B; +extern struct flash_device flashdev_Am29DL640G; extern struct flash_device flashdev_PL129J; extern struct flash_device flashdev_PL129N; extern struct flash_device flashdev_K5A32xx_T; @@ -111,6 +112,8 @@ printf("Extended ID: %04X %04X\n", ext1, ext2); if (ext1 == 0x2221 && ext2 == 0x2200) return spansion_pl129j_or_n(bi); + if (ext1 == 0x2202 && ext2 == 0x2201) + return try_device(bi, &flashdev_Am29DL640G); fprintf(stderr, "Error: unknown device ID\n"); return(-1); } diff -r 6e8edc321460 -r 3886a8a40809 loadtools/fldevs.c --- a/loadtools/fldevs.c Sun Nov 17 22:40:36 2019 +0000 +++ b/loadtools/fldevs.c Sat Dec 21 10:48:24 2019 +0000 @@ -52,6 +52,13 @@ .total_sectors = 135, }; +static struct flash_geom geom_8M_bothends = { + .total_size = 0x800000, + .nregions = 3, + .regions = {0x2000, 8, 0x10000, 126, 0x2000, 8}, + .total_sectors = 142, +}; + static struct flash_geom geom_8M_topboot_big = { .total_size = 0x800000, .nregions = 2, @@ -192,6 +199,46 @@ .cmdset = &flash_cmdset_intel_w30, }; +/* classic AMD flash chips */ + +static struct cfi_check Am29DL640G_cfi[] = { + {0x10, 'Q'}, + {0x11, 'R'}, + {0x12, 'Y'}, + {0x13, 0x02}, + {0x14, 0x00}, + {0x15, 0x40}, + {0x16, 0x00}, + {0x27, 0x17}, + {0x2C, 0x03}, + {0x2D, 0x07}, + {0x2E, 0x00}, + {0x2F, 0x20}, + {0x30, 0x00}, + {0x31, 0x7D}, + {0x32, 0x00}, + {0x33, 0x00}, + {0x34, 0x01}, + {0x35, 0x07}, + {0x36, 0x00}, + {0x37, 0x20}, + {0x38, 0x00}, + {0x40, 'P'}, + {0x41, 'R'}, + {0x42, 'I'}, + {0x43, '1'}, + {0x44, '3'}, + {-1, 0} +}; + +struct flash_device flashdev_Am29DL640G = { + .name = "Am29DL640G", + .cfi_table = Am29DL640G_cfi, + .required_global_config = FLASH_GLOBAL_CFG_SINGLE_8M, + .bank_geom = {&geom_8M_bothends, 0}, + .cmdset = &flash_cmdset_amd, +}; + /* Spansion S71PL-J and S71PL-N flash */ static struct cfi_check spansion_PL129J_cfi[] = {