# HG changeset patch # User Michael Spacefalcon # Date 1387783597 0 # Node ID 99c234bf6a9b4a9139784d9f1dd8eb8b314f2e3a # Parent b26b7459bd448ee102c51d772987046b014aaa02 fc-loadtool flash ID check: definitions created diff -r b26b7459bd44 -r 99c234bf6a9b loadtools/flash.h --- a/loadtools/flash.h Thu Dec 19 08:32:33 2013 +0000 +++ b/loadtools/flash.h Mon Dec 23 07:26:37 2013 +0000 @@ -12,9 +12,16 @@ unsigned nsectors; }; +struct flash_idcheck { + uint16_t offset; + uint16_t expect_val; +}; + struct flash_bank_desc { struct flash_region_desc *regions; uint32_t prog_base_mask; + struct flash_idcheck *idcheck_table; + unsigned idcheck_num; }; struct flash_device_desc { @@ -36,4 +43,5 @@ struct flash_bank_desc *bank_desc; struct sector_info *sectors; unsigned nsectors; + int idcheck_done; }; diff -r b26b7459bd44 -r 99c234bf6a9b loadtools/ltflash.c --- a/loadtools/ltflash.c Thu Dec 19 08:32:33 2013 +0000 +++ b/loadtools/ltflash.c Mon Dec 23 07:26:37 2013 +0000 @@ -20,8 +20,13 @@ {0, 0} /* array terminator */ }; +static struct flash_idcheck k5a32xx_topboot_idcheck[2] = { + {0x00, 0x00EC}, + {0x02, 0x22A0} +}; + static struct flash_bank_desc k5a32xx_topboot_bankdesc = { - k5a32xx_topboot_regions, 0xFFF00000 + k5a32xx_topboot_regions, 0xFFF00000, k5a32xx_topboot_idcheck, 2 }; /* S{29,71}PL129N device description */ @@ -40,9 +45,16 @@ {0, 0} /* array terminator */ }; +static struct flash_idcheck pl129n_idcheck[4] = { + {0x00, 0x0001}, + {0x02, 0x227E}, + {0x1C, 0x2221}, + {0x1E, 0x2200} +}; + static struct flash_bank_desc pl129n_banks[2] = { - {pl129n_ce1_regions, 0xFFFC0000}, - {pl129n_ce2_regions, 0xFFFC0000} + {pl129n_ce1_regions, 0xFFFC0000, pl129n_idcheck, 4}, + {pl129n_ce2_regions, 0xFFFC0000, pl129n_idcheck, 4} }; /* list of supported flash devices */