Remove misleading typedef and redundant suffix from struct flash_sector.
18 files changed:
// sector size is 512
bank->num_sectors = bank->size / 512;
// sector size is 512
bank->num_sectors = bank->size / 512;
- bank->sectors = malloc(sizeof(flash_sector_t) * bank->num_sectors);
+ bank->sectors = malloc(sizeof(struct flash_sector) * bank->num_sectors);
for (i = 0; i < bank->num_sectors; ++i)
{
bank->sectors[i].offset = offset;
for (i = 0; i < bank->num_sectors; ++i)
{
bank->sectors[i].offset = offset;
t_bank->num_sectors = sectors_num;
/* allocate sectors */
t_bank->num_sectors = sectors_num;
/* allocate sectors */
- t_bank->sectors = malloc(sectors_num * sizeof(flash_sector_t));
+ t_bank->sectors = malloc(sectors_num * sizeof(struct flash_sector));
for (sec = 0; sec < sectors_num; sec++)
{
t_bank->sectors[sec].offset = sec * pages_per_sector * page_size;
for (sec = 0; sec < sectors_num; sec++)
{
t_bank->sectors[sec].offset = sec * pages_per_sector * page_size;
t_bank->num_sectors = num_sectors;
/* allocate sectors */
t_bank->num_sectors = num_sectors;
/* allocate sectors */
- t_bank->sectors = malloc(num_sectors * sizeof(flash_sector_t));
+ t_bank->sectors = malloc(num_sectors * sizeof(struct flash_sector));
for (sec = 0; sec < num_sectors; sec++)
{
t_bank->sectors[sec].offset = sec * pages_per_sector * page_size;
for (sec = 0; sec < num_sectors; sec++)
{
t_bank->sectors[sec].offset = sec * pages_per_sector * page_size;
bank->base = 0x00000000;
bank->size = (avr_info->flash_page_size * avr_info->flash_page_num);
bank->num_sectors = avr_info->flash_page_num;
bank->base = 0x00000000;
bank->size = (avr_info->flash_page_size * avr_info->flash_page_num);
bank->num_sectors = avr_info->flash_page_num;
- bank->sectors = malloc(sizeof(flash_sector_t) * avr_info->flash_page_num);
+ bank->sectors = malloc(sizeof(struct flash_sector) * avr_info->flash_page_num);
for (i = 0; i < avr_info->flash_page_num; i++)
{
for (i = 0; i < avr_info->flash_page_num; i++)
{
{
/* a device might have only one erase block, spanning the whole device */
bank->num_sectors = 1;
{
/* a device might have only one erase block, spanning the whole device */
bank->num_sectors = 1;
- bank->sectors = malloc(sizeof(flash_sector_t));
+ bank->sectors = malloc(sizeof(struct flash_sector));
bank->sectors[sector].offset = 0x0;
bank->sectors[sector].size = bank->size;
bank->sectors[sector].offset = 0x0;
bank->sectors[sector].size = bank->size;
}
bank->num_sectors = num_sectors;
}
bank->num_sectors = num_sectors;
- bank->sectors = malloc(sizeof(flash_sector_t) * num_sectors);
+ bank->sectors = malloc(sizeof(struct flash_sector) * num_sectors);
for (i = 0; i < cfi_info->num_erase_regions; i++)
{
for (i = 0; i < cfi_info->num_erase_regions; i++)
{
int i = 0;
uint32_t offset = 0;
bank->num_sectors = bank->size/sectorSize;
int i = 0;
uint32_t offset = 0;
bank->num_sectors = bank->size/sectorSize;
- bank->sectors = malloc(sizeof(flash_sector_t) * bank->num_sectors);
+ bank->sectors = malloc(sizeof(struct flash_sector) * bank->num_sectors);
for (i = 0; i < bank->num_sectors; i++)
{
bank->sectors[i].offset = offset;
for (i = 0; i < bank->num_sectors; i++)
{
bank->sectors[i].offset = offset;
int i = 0;
uint32_t offset = 0;
bank->num_sectors = bank->size/sectorSize;
int i = 0;
uint32_t offset = 0;
bank->num_sectors = bank->size/sectorSize;
- bank->sectors = malloc(sizeof(flash_sector_t) * bank->num_sectors);
+ bank->sectors = malloc(sizeof(struct flash_sector) * bank->num_sectors);
for (i = 0; i < bank->num_sectors; i++)
{
bank->sectors[i].offset = offset;
for (i = 0; i < bank->num_sectors; i++)
{
bank->sectors[i].offset = offset;
* within a flash bank. A single bank typically consists of multiple
* sectors, each of which can be erased and protected independently.
*/
* within a flash bank. A single bank typically consists of multiple
* sectors, each of which can be erased and protected independently.
*/
-typedef struct flash_sector_s
{
/// Bus offset from start of the flash chip (in bytes).
uint32_t offset;
{
/// Bus offset from start of the flash chip (in bytes).
uint32_t offset;
* @c flash_driver_s::protect_check.
*/
int is_protected;
* @c flash_driver_s::protect_check.
*/
int is_protected;
*/
int num_sectors;
/// Array of sectors, allocated and initilized by the flash driver
*/
int num_sectors;
/// Array of sectors, allocated and initilized by the flash driver
- flash_sector_t *sectors;
+ struct flash_sector *sectors;
struct flash_bank_s *next; /**< The next flash bank on this chip */
} flash_bank_t;
struct flash_bank_s *next; /**< The next flash bank on this chip */
} flash_bank_t;
if (bank->size == 128 * 1024)
{
bank->num_sectors = 16;
if (bank->size == 128 * 1024)
{
bank->num_sectors = 16;
- bank->sectors = malloc(sizeof(flash_sector_t) * 16);
+ bank->sectors = malloc(sizeof(struct flash_sector) * 16);
for (i = 0; i < 16; i++)
{
bank->sectors[i].offset = offset;
for (i = 0; i < 16; i++)
{
bank->sectors[i].offset = offset;
else if (bank->size == 256 * 1024)
{
bank->num_sectors = 18;
else if (bank->size == 256 * 1024)
{
bank->num_sectors = 18;
- bank->sectors = malloc(sizeof(flash_sector_t) * 18);
+ bank->sectors = malloc(sizeof(struct flash_sector) * 18);
for (i = 0; i < 8; i++)
{
for (i = 0; i < 8; i++)
{
- bank->sectors = malloc(sizeof(flash_sector_t) * bank->num_sectors);
+ bank->sectors = malloc(sizeof(struct flash_sector) * bank->num_sectors);
for (i = 0; i < bank->num_sectors; i++)
{
for (i = 0; i < bank->num_sectors; i++)
{
- bank->sectors = malloc(sizeof(flash_sector_t) * bank->num_sectors);
+ bank->sectors = malloc(sizeof(struct flash_sector) * bank->num_sectors);
for(i = 0; i < bank->num_sectors; i++)
{
for(i = 0; i < bank->num_sectors; i++)
{
/* setup the sector info... */
offset = bank->base;
bank->num_sectors = 23;
/* setup the sector info... */
offset = bank->base;
bank->num_sectors = 23;
- bank->sectors = malloc(sizeof(flash_sector_t) * 23);
+ bank->sectors = malloc(sizeof(struct flash_sector) * 23);
for (i = 0; i < 15; i++)
{
for (i = 0; i < 15; i++)
{
* the logical flash number are translated into the physical flash numbers
* of the device.
*/
* the logical flash number are translated into the physical flash numbers
* of the device.
*/
- bank->sectors = malloc(sizeof(flash_sector_t) * bank->num_sectors);
+ bank->sectors = malloc(sizeof(struct flash_sector) * bank->num_sectors);
offset = 0;
for (i = 0; i < bank->num_sectors; i++)
offset = 0;
for (i = 0; i < bank->num_sectors; i++)
ocl->buflen = dcc_buffer[0] & 0xffff;
ocl->bufalign = dcc_buffer[0] >> 16;
ocl->buflen = dcc_buffer[0] & 0xffff;
ocl->bufalign = dcc_buffer[0] >> 16;
- bank->sectors = realloc(bank->sectors, sizeof(flash_sector_t)*bank->num_sectors);
+ bank->sectors = realloc(bank->sectors, sizeof(struct flash_sector)*bank->num_sectors);
if (bank->num_sectors == 0)
{
LOG_ERROR("number of sectors shall be non zero value");
if (bank->num_sectors == 0)
{
LOG_ERROR("number of sectors shall be non zero value");
bank->num_sectors = num_pages;
bank->chip_width = 4;
bank->bus_width = 4;
bank->num_sectors = num_pages;
bank->chip_width = 4;
bank->bus_width = 4;
- bank->sectors = malloc(sizeof(flash_sector_t) * num_pages);
+ bank->sectors = malloc(sizeof(struct flash_sector) * num_pages);
for (i = 0; i < num_pages; i++)
{
for (i = 0; i < num_pages; i++)
{
/* provide this for the benefit of the higher flash driver layers */
bank->num_sectors = stellaris_info->num_pages;
/* provide this for the benefit of the higher flash driver layers */
bank->num_sectors = stellaris_info->num_pages;
- bank->sectors = malloc(sizeof(flash_sector_t) * bank->num_sectors);
+ bank->sectors = malloc(sizeof(struct flash_sector) * bank->num_sectors);
for (i = 0; i < bank->num_sectors; i++)
{
bank->sectors[i].offset = i * stellaris_info->pagesize;
for (i = 0; i < bank->num_sectors; i++)
{
bank->sectors[i].offset = i * stellaris_info->pagesize;
bank->base = 0x08000000;
bank->size = (num_pages * page_size);
bank->num_sectors = num_pages;
bank->base = 0x08000000;
bank->size = (num_pages * page_size);
bank->num_sectors = num_pages;
- bank->sectors = malloc(sizeof(flash_sector_t) * num_pages);
+ bank->sectors = malloc(sizeof(struct flash_sector) * num_pages);
for (i = 0; i < num_pages; i++)
{
for (i = 0; i < num_pages; i++)
{
num_sectors = b0_sectors + b1_sectors;
bank->num_sectors = num_sectors;
num_sectors = b0_sectors + b1_sectors;
bank->num_sectors = num_sectors;
- bank->sectors = malloc(sizeof(flash_sector_t) * num_sectors);
+ bank->sectors = malloc(sizeof(struct flash_sector) * num_sectors);
str7x_info->sector_bits = malloc(sizeof(uint32_t) * num_sectors);
num_sectors = 0;
str7x_info->sector_bits = malloc(sizeof(uint32_t) * num_sectors);
num_sectors = 0;
num_sectors = b0_sectors + b1_sectors;
bank->num_sectors = num_sectors;
num_sectors = b0_sectors + b1_sectors;
bank->num_sectors = num_sectors;
- bank->sectors = malloc(sizeof(flash_sector_t) * num_sectors);
+ bank->sectors = malloc(sizeof(struct flash_sector) * num_sectors);
str9x_info->sector_bits = malloc(sizeof(uint32_t) * num_sectors);
num_sectors = 0;
str9x_info->sector_bits = malloc(sizeof(uint32_t) * num_sectors);
num_sectors = 0;
num_sectors = b0_sectors + b1_sectors;
bank->num_sectors = num_sectors;
num_sectors = b0_sectors + b1_sectors;
bank->num_sectors = num_sectors;
- bank->sectors = malloc(sizeof(flash_sector_t) * num_sectors);
+ bank->sectors = malloc(sizeof(struct flash_sector) * num_sectors);
str9xpec_info->sector_bits = malloc(sizeof(uint32_t) * num_sectors);
num_sectors = 0;
str9xpec_info->sector_bits = malloc(sizeof(uint32_t) * num_sectors);
num_sectors = 0;
Internal Support, Helpers
---------------------------------------------------------------------- */
Internal Support, Helpers
---------------------------------------------------------------------- */
-const flash_sector_t TMS470R1A256_SECTORS[] = {
+const struct flash_sector TMS470R1A256_SECTORS[] = {
{0x00000000, 0x00002000, -1, -1},
{0x00002000, 0x00002000, -1, -1},
{0x00004000, 0x00002000, -1, -1},
{0x00000000, 0x00002000, -1, -1},
{0x00002000, 0x00002000, -1, -1},
{0x00004000, 0x00002000, -1, -1},
#define TMS470R1A256_NUM_SECTORS \
(sizeof(TMS470R1A256_SECTORS)/sizeof(TMS470R1A256_SECTORS[0]))
#define TMS470R1A256_NUM_SECTORS \
(sizeof(TMS470R1A256_SECTORS)/sizeof(TMS470R1A256_SECTORS[0]))
-const flash_sector_t TMS470R1A288_BANK0_SECTORS[] = {
+const struct flash_sector TMS470R1A288_BANK0_SECTORS[] = {
{0x00000000, 0x00002000, -1, -1},
{0x00002000, 0x00002000, -1, -1},
{0x00004000, 0x00002000, -1, -1},
{0x00000000, 0x00002000, -1, -1},
{0x00002000, 0x00002000, -1, -1},
{0x00004000, 0x00002000, -1, -1},
#define TMS470R1A288_BANK0_NUM_SECTORS \
(sizeof(TMS470R1A288_BANK0_SECTORS)/sizeof(TMS470R1A288_BANK0_SECTORS[0]))
#define TMS470R1A288_BANK0_NUM_SECTORS \
(sizeof(TMS470R1A288_BANK0_SECTORS)/sizeof(TMS470R1A288_BANK0_SECTORS[0]))
-const flash_sector_t TMS470R1A288_BANK1_SECTORS[] = {
+const struct flash_sector TMS470R1A288_BANK1_SECTORS[] = {
{0x00040000, 0x00010000, -1, -1},
{0x00050000, 0x00010000, -1, -1},
{0x00060000, 0x00010000, -1, -1},
{0x00040000, 0x00010000, -1, -1},
{0x00050000, 0x00010000, -1, -1},
{0x00060000, 0x00010000, -1, -1},
#define TMS470R1A288_BANK1_NUM_SECTORS \
(sizeof(TMS470R1A288_BANK1_SECTORS)/sizeof(TMS470R1A288_BANK1_SECTORS[0]))
#define TMS470R1A288_BANK1_NUM_SECTORS \
(sizeof(TMS470R1A288_BANK1_SECTORS)/sizeof(TMS470R1A288_BANK1_SECTORS[0]))
-const flash_sector_t TMS470R1A384_BANK0_SECTORS[] = {
+const struct flash_sector TMS470R1A384_BANK0_SECTORS[] = {
{0x00000000, 0x00002000, -1, -1},
{0x00002000, 0x00002000, -1, -1},
{0x00004000, 0x00004000, -1, -1},
{0x00000000, 0x00002000, -1, -1},
{0x00002000, 0x00002000, -1, -1},
{0x00004000, 0x00004000, -1, -1},
#define TMS470R1A384_BANK0_NUM_SECTORS \
(sizeof(TMS470R1A384_BANK0_SECTORS)/sizeof(TMS470R1A384_BANK0_SECTORS[0]))
#define TMS470R1A384_BANK0_NUM_SECTORS \
(sizeof(TMS470R1A384_BANK0_SECTORS)/sizeof(TMS470R1A384_BANK0_SECTORS[0]))
-const flash_sector_t TMS470R1A384_BANK1_SECTORS[] = {
+const struct flash_sector TMS470R1A384_BANK1_SECTORS[] = {
{0x00020000, 0x00008000, -1, -1},
{0x00028000, 0x00008000, -1, -1},
{0x00030000, 0x00008000, -1, -1},
{0x00020000, 0x00008000, -1, -1},
{0x00028000, 0x00008000, -1, -1},
{0x00030000, 0x00008000, -1, -1},
#define TMS470R1A384_BANK1_NUM_SECTORS \
(sizeof(TMS470R1A384_BANK1_SECTORS)/sizeof(TMS470R1A384_BANK1_SECTORS[0]))
#define TMS470R1A384_BANK1_NUM_SECTORS \
(sizeof(TMS470R1A384_BANK1_SECTORS)/sizeof(TMS470R1A384_BANK1_SECTORS[0]))
-const flash_sector_t TMS470R1A384_BANK2_SECTORS[] = {
+const struct flash_sector TMS470R1A384_BANK2_SECTORS[] = {
{0x00040000, 0x00008000, -1, -1},
{0x00048000, 0x00008000, -1, -1},
{0x00050000, 0x00008000, -1, -1},
{0x00040000, 0x00008000, -1, -1},
{0x00048000, 0x00008000, -1, -1},
{0x00050000, 0x00008000, -1, -1},
Linking to existing account procedure
If you already have an account and want to add another login method
you
MUST first sign in with your existing account and
then change URL to read
https://review.openocd.org/login/?link
to get to this page again but this time it'll work for linking. Thank you.
SSH host keys fingerprints
1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=.. |
|+o.. . |
|*.o . . |
|+B . . . |
|Bo. = o S |
|Oo.+ + = |
|oB=.* = . o |
| =+=.+ + E |
|. .=o . o |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)