diff options
Diffstat (limited to 'src/flash')
-rw-r--r-- | src/flash/at91sam7.c | 2 | ||||
-rw-r--r-- | src/flash/flash.c | 4 | ||||
-rw-r--r-- | src/flash/ocl.c | 4 | ||||
-rw-r--r-- | src/flash/ocl/at91sam7x/dcc.c | 2 | ||||
-rw-r--r-- | src/flash/ocl/at91sam7x/samflash.c | 12 | ||||
-rw-r--r-- | src/flash/str9x.c | 6 |
6 files changed, 15 insertions, 15 deletions
diff --git a/src/flash/at91sam7.c b/src/flash/at91sam7.c index 27779a39..8b51b95b 100644 --- a/src/flash/at91sam7.c +++ b/src/flash/at91sam7.c @@ -284,7 +284,7 @@ static int at91sam7_flash_command(struct flash_bank_s *bank, uint8_t cmd, uint16 target_write_u32(target, MC_FCR[bank->bank_number], fcr); LOG_DEBUG("Flash command: 0x%" PRIx32 ", flash bank: %i, page number: %u", fcr, bank->bank_number+1, pagen); - if ((at91sam7_info->cidr_arch == 0x60) && ((cmd==SLB)|(cmd==CLB))) + if ((at91sam7_info->cidr_arch == 0x60) && ((cmd == SLB)|(cmd == CLB))) { /* Lock bit manipulation on AT91SAM7A3 waits for FC_FSR bit 1, EOL */ if (at91sam7_wait_status_busy(bank, MC_FSR_EOL, 10)&0x0C) diff --git a/src/flash/flash.c b/src/flash/flash.c index 60827594..3b8a883c 100644 --- a/src/flash/flash.c +++ b/src/flash/flash.c @@ -654,7 +654,7 @@ static int handle_flash_write_image_command(struct command_context_s *cmd_ctx, c /* flash auto-erase is disabled by default*/ int auto_erase = 0; - if (strcmp(args[0], "erase")==0) + if (strcmp(args[0], "erase") == 0) { auto_erase = 1; args++; @@ -894,7 +894,7 @@ static int handle_flash_write_bank_command(struct command_context_s *cmd_ctx, ch fileio_close(&fileio); return retvaltemp; } - if (retval==ERROR_OK) + if (retval == ERROR_OK) { command_print(cmd_ctx, "wrote %lld byte from file %s to flash bank %li at offset 0x%8.8" PRIx32 " in %s (%f kb/s)", diff --git a/src/flash/ocl.c b/src/flash/ocl.c index a83f5ea8..e6a342e7 100644 --- a/src/flash/ocl.c +++ b/src/flash/ocl.c @@ -172,7 +172,7 @@ static int ocl_write(struct flash_bank_s *bank, uint8_t *buffer, uint32_t offset int i; /* check preconditions */ - if (ocl->buflen == 0 || ocl->bufalign==0) + if (ocl->buflen == 0 || ocl->bufalign == 0) return ERROR_FLASH_BANK_NOT_PROBED; if (bank->target->state != TARGET_RUNNING) @@ -373,7 +373,7 @@ static int ocl_auto_probe(struct flash_bank_s *bank) { ocl_priv_t *ocl = bank->driver_priv; - if (ocl->buflen == 0 || ocl->bufalign==0) + if (ocl->buflen == 0 || ocl->bufalign == 0) return ERROR_FLASH_BANK_NOT_PROBED; return ERROR_OK; diff --git a/src/flash/ocl/at91sam7x/dcc.c b/src/flash/ocl/at91sam7x/dcc.c index 3507bbe5..a6976595 100644 --- a/src/flash/ocl/at91sam7x/dcc.c +++ b/src/flash/ocl/at91sam7x/dcc.c @@ -27,7 +27,7 @@ uint32 dcc_rd(void) do { asm volatile ("mrc p14, 0, %0, C0, C0" : "=r" (dcc_reg) : ); - } while ((dcc_reg&1)==0); + } while ((dcc_reg&1) == 0); asm volatile ("mrc p14, 0, %0, C1, C0" : "=r" (dcc_reg) : ); return dcc_reg; diff --git a/src/flash/ocl/at91sam7x/samflash.c b/src/flash/ocl/at91sam7x/samflash.c index 893b579f..a534f6d8 100644 --- a/src/flash/ocl/at91sam7x/samflash.c +++ b/src/flash/ocl/at91sam7x/samflash.c @@ -86,7 +86,7 @@ int flash_page_program(uint32 *data, int page_num) else efc_ofs=0; /* wait until FLASH is ready, just for sure */ - while ((inr(MC_FSR+efc_ofs)&MC_FRDY)==0); + while ((inr(MC_FSR+efc_ofs)&MC_FRDY) == 0); /* calculate page address, only lower 8 bits are used to address the latch, but the upper part of address is needed for writing to proper EFC */ @@ -103,7 +103,7 @@ int flash_page_program(uint32 *data, int page_num) outr(MC_FCR+efc_ofs, ((page_num&0x3ff) << 8) | MC_KEY | MC_FCMD_WP); /* wait until it's done */ - while ((inr(MC_FSR+efc_ofs)&MC_FRDY)==0); + while ((inr(MC_FSR+efc_ofs)&MC_FRDY) == 0); /* check for errors */ if ((inr(MC_FSR+efc_ofs)&MC_PROGE)) return FLASH_STAT_PROGE; @@ -134,12 +134,12 @@ int flash_erase_plane(int efc_ofs) if (lockbits&1) { /* wait until FLASH is ready, just for sure */ - while ((inr(MC_FSR+efc_ofs)&MC_FRDY)==0); + while ((inr(MC_FSR+efc_ofs)&MC_FRDY) == 0); outr(MC_FCR+efc_ofs, ((page_num&0x3ff) << 8) | 0x5a000004); /* wait until it's done */ - while ((inr(MC_FSR+efc_ofs)&MC_FRDY)==0); + while ((inr(MC_FSR+efc_ofs)&MC_FRDY) == 0); /* check for errors */ if ((inr(MC_FSR+efc_ofs)&MC_PROGE)) return FLASH_STAT_PROGE; @@ -151,13 +151,13 @@ int flash_erase_plane(int efc_ofs) } /* wait until FLASH is ready, just for sure */ - while ((inr(MC_FSR+efc_ofs)&MC_FRDY)==0); + while ((inr(MC_FSR+efc_ofs)&MC_FRDY) == 0); /* erase all command to FCR */ outr(MC_FCR+efc_ofs, 0x5a000008); /* wait until it's done */ - while ((inr(MC_FSR+efc_ofs)&MC_FRDY)==0); + while ((inr(MC_FSR+efc_ofs)&MC_FRDY) == 0); /* check for errors */ if ((inr(MC_FSR+efc_ofs)&MC_PROGE)) return FLASH_STAT_PROGE; diff --git a/src/flash/str9x.c b/src/flash/str9x.c index 2b92d009..73c86da7 100644 --- a/src/flash/str9x.c +++ b/src/flash/str9x.c @@ -309,7 +309,7 @@ static int str9x_erase(struct flash_bank_s *bank, int first, int last) break; alive_sleep(1); } - if (timeout==1000) + if (timeout == 1000) { LOG_ERROR("erase timed out"); return ERROR_FAIL; @@ -582,7 +582,7 @@ static int str9x_write(struct flash_bank_s *bank, break; alive_sleep(1); } - if (timeout==1000) + if (timeout == 1000) { LOG_ERROR("write timed out"); return ERROR_FAIL; @@ -631,7 +631,7 @@ static int str9x_write(struct flash_bank_s *bank, break; alive_sleep(1); } - if (timeout==1000) + if (timeout == 1000) { LOG_ERROR("write timed out"); return ERROR_FAIL; |