X-Git-Url: https://review.openocd.org/gitweb?a=blobdiff_plain;f=src%2Fflash%2Fnor%2Fatsamv.c;h=5beeefc5ab56dafe19d6afd063b36091f3a2b307;hb=30de1bfda4ea0fd4cd01a2055df463767b979ed4;hp=77fb7e68b86a454eb6f2b4ee36f62c42e60a0900;hpb=0c8ec7c826c60391034fe5f0ea90f8538ac94b38;p=openocd.git diff --git a/src/flash/nor/atsamv.c b/src/flash/nor/atsamv.c index 77fb7e68b8..5beeefc5ab 100644 --- a/src/flash/nor/atsamv.c +++ b/src/flash/nor/atsamv.c @@ -12,15 +12,17 @@ * (atsamv, atsams, and atsame support) * * * * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General public License as published by * + * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS for A PARTICULAR PURPOSE. See the * - * GNU General public License for more details. * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * 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, see . * ***************************************************************************/ /* Some of the the lower level code was based on code supplied by @@ -92,7 +94,7 @@ #define SAMV_PAGE_SIZE 512 #define SAMV_FLASH_BASE 0x00400000 -extern struct flash_driver atsamv_flash; +extern const struct flash_driver atsamv_flash; struct samv_flash_bank { int probed; @@ -145,7 +147,7 @@ static int samv_efc_perform_command(struct target *target, { int r; uint32_t v; - long long ms_now, ms_end; + int64_t ms_now, ms_end; if (status) *status = 0; @@ -361,6 +363,9 @@ static int samv_probe(struct flash_bank *bank) uint8_t nvm_size_code = (device_id >> 8) & 0xf; switch (nvm_size_code) { + case 10: + bank->size = 512 * 1024; + break; case 12: bank->size = 1024 * 1024; break; @@ -721,7 +726,7 @@ static const struct command_registration atsamv_command_handlers[] = { COMMAND_REGISTRATION_DONE }; -struct flash_driver atsamv_flash = { +const struct flash_driver atsamv_flash = { .name = "atsamv", .commands = atsamv_command_handlers, .flash_bank_command = samv_flash_bank_command, @@ -734,4 +739,5 @@ struct flash_driver atsamv_flash = { .erase_check = default_flash_blank_check, .protect_check = samv_protect_check, .info = samv_get_info, + .free_driver_priv = default_flash_free_driver_priv, };