FreeCalypso > hg > freecalypso-sw
comparison loadtools/flashops.c @ 410:81d387690063
Intel flash: clear SR before programming
author | Michael Spacefalcon <msokolov@ivan.Harhan.ORG> |
---|---|
date | Tue, 17 Jun 2014 03:40:49 +0000 |
parents | 23ab8fe81764 |
children |
comparison
equal
deleted
inserted
replaced
409:23ab8fe81764 | 410:81d387690063 |
---|---|
191 return(-1); | 191 return(-1); |
192 } else | 192 } else |
193 return(0); | 193 return(0); |
194 } | 194 } |
195 | 195 |
196 intel_clear_sr(bi) | |
197 struct flash_bank_info *bi; | |
198 { | |
199 printf("Clearing Intel flash SR\n"); | |
200 if (do_w16(bi->base_addr, 0x50)) { | |
201 fprintf(stderr, | |
202 "unexpected response to w16 for Clear SR command\n"); | |
203 return(-1); | |
204 } | |
205 return(0); | |
206 } | |
207 | |
196 struct flash_cmdset flash_cmdset_intel = { | 208 struct flash_cmdset flash_cmdset_intel = { |
197 .cmdset_name = "Intel", | 209 .cmdset_name = "Intel", |
198 .reset_cmd = intel_reset_cmd, | 210 .reset_cmd = intel_reset_cmd, |
199 .status_cmd = intel_status_cmd, | 211 .status_cmd = intel_status_cmd, |
200 .unlock_sector = intel_sector_unlock, | 212 .unlock_sector = intel_sector_unlock, |
201 .erase_sector = intel_sector_erase, | 213 .erase_sector = intel_sector_erase, |
214 .prep_for_program = intel_clear_sr, | |
202 .loadagent_setbase_cmd = "INFB", | 215 .loadagent_setbase_cmd = "INFB", |
203 .loadagent_program_cmd = "INFW", | 216 .loadagent_program_cmd = "INFW", |
204 .needs_unlock = 1, | 217 .needs_unlock = 1, |
205 }; | 218 }; |