X-Git-Url: https://review.openocd.org/gitweb?p=openocd.git;a=blobdiff_plain;f=src%2Fflash%2Fnor%2Fstmsmi.c;h=e4d59fe3347dfdbbccb2fe4e1a62cde27fb9944c;hp=9a715ef947d3ee85876afe5da532f621f4492b36;hb=d0e763ac7ef6aa17b17bd00ccdfbccfb4eacda69;hpb=f132fcf636361009b4125827351ef01556d49b31 diff --git a/src/flash/nor/stmsmi.c b/src/flash/nor/stmsmi.c index 9a715ef947..e4d59fe334 100644 --- a/src/flash/nor/stmsmi.c +++ b/src/flash/nor/stmsmi.c @@ -12,9 +12,7 @@ * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * + * along with this program. If not, see . * ***************************************************************************/ /* STM Serial Memory Interface (SMI) controller is a SPI bus controller @@ -120,7 +118,7 @@ struct stmsmi_flash_bank { int probed; uint32_t io_base; uint32_t bank_num; - struct flash_device *dev; + const struct flash_device *dev; }; struct stmsmi_target { @@ -130,7 +128,7 @@ struct stmsmi_target { uint32_t io_base; }; -static struct stmsmi_target target_devices[] = { +static const struct stmsmi_target target_devices[] = { /* name, tap_idcode, smi_base, io_base */ { "SPEAr3xx/6xx", 0x07926041, 0xf8000000, 0xfc000000 }, { "STR75x", 0x4f1f0041, 0x80000000, 0x90000000 }, @@ -372,7 +370,7 @@ static int stmsmi_protect(struct flash_bank *bank, int set, return ERROR_OK; } -static int smi_write_buffer(struct flash_bank *bank, uint8_t *buffer, +static int smi_write_buffer(struct flash_bank *bank, const uint8_t *buffer, uint32_t address, uint32_t len) { struct target *target = bank->target; @@ -397,7 +395,7 @@ static int smi_write_buffer(struct flash_bank *bank, uint8_t *buffer, return ERROR_OK; } -static int stmsmi_write(struct flash_bank *bank, uint8_t *buffer, +static int stmsmi_write(struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count) { struct target *target = bank->target; @@ -529,7 +527,7 @@ static int stmsmi_probe(struct flash_bank *bank) uint32_t io_base; struct flash_sector *sectors; uint32_t id = 0; /* silence uninitialized warning */ - struct stmsmi_target *target_device; + const struct stmsmi_target *target_device; int retval; if (stmsmi_info->probed) @@ -575,7 +573,7 @@ static int stmsmi_probe(struct flash_bank *bank) return retval; stmsmi_info->dev = NULL; - for (struct flash_device *p = flash_devices; p->name ; p++) + for (const struct flash_device *p = flash_devices; p->name ; p++) if (p->device_id == id) { stmsmi_info->dev = p; break;