* (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 <http://www.gnu.org/licenses/>. *
***************************************************************************/
/* Some of the the lower level code was based on code supplied by
#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;
{
int r;
uint32_t v;
- long long ms_now, ms_end;
+ int64_t ms_now, ms_end;
if (status)
*status = 0;
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;
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,
.erase_check = default_flash_blank_check,
.protect_check = samv_protect_check,
.info = samv_get_info,
+ .free_driver_priv = default_flash_free_driver_priv,
};