/*
- * Copyright (C) 2015 Piotr Dymacz <piotr@dymacz.pl>
+ * Copyright (C) 2016 Piotr Dymacz <piotr@dymacz.pl>
*
- * SPDX-License-Identifier:GPL-2.0
+ * SPDX-License-Identifier: GPL-2.0
*/
#include <config.h>
return 1;
}
+/*
+ * Scan all configured FLASH banks one by one
+ * and try to get information about the chips
+ */
u32 flash_init(void)
{
u32 bank, i, jedec_id, sfdp_size, sfdp_ss;
info->sector_count = info->size / info->sector_size;
}
- for (i = 0; i < info->sector_count; i++){
+ for (i = 0; i < info->sector_count; i++) {
info->start[i] = CFG_FLASH_BASE
+ total_size + (i * info->sector_size);
}
return total_size;
}
+/*
+ * Erase all FLASH sectors in provided range
+ *
+ * TODO:
+ * - use some LED for indication that we are erasing?
+ */
u32 flash_erase(flash_info_t *info,
u32 s_first,
u32 s_last)
return 0;
}
-
-
/*
* Write a buffer from memory to a FLASH:
* call page program for every <= 256 bytes