FreeCalypso > hg > freecalypso-sw
changeset 203:99c234bf6a9b
fc-loadtool flash ID check: definitions created
author | Michael Spacefalcon <msokolov@ivan.Harhan.ORG> |
---|---|
date | Mon, 23 Dec 2013 07:26:37 +0000 |
parents | b26b7459bd44 |
children | 61c7480b3c50 |
files | loadtools/flash.h loadtools/ltflash.c |
diffstat | 2 files changed, 23 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- 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; };
--- 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 */