summaryrefslogtreecommitdiff
path: root/src/flash
diff options
context:
space:
mode:
authorzwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2009-06-23 22:40:42 +0000
committerzwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2009-06-23 22:40:42 +0000
commit0e2c2fe1d1eec5482078147d551215a58604cc3a (patch)
tree5b829774e1f67afc86acb0a0f968d0a6a4766246 /src/flash
parent6319ea33f7369823043eaefdb72b7463e760be27 (diff)
downloadopenocd+libswd-0e2c2fe1d1eec5482078147d551215a58604cc3a.tar.gz
openocd+libswd-0e2c2fe1d1eec5482078147d551215a58604cc3a.tar.bz2
openocd+libswd-0e2c2fe1d1eec5482078147d551215a58604cc3a.tar.xz
openocd+libswd-0e2c2fe1d1eec5482078147d551215a58604cc3a.zip
- Fixes '>>' whitespace
- Replace ')\(>>\)\(\w\)' with ') \1 \2'. - Replace '\(\w\)\(>>\)(' with '\1 \2 ('. - Replace '\(\w\)\(>>\)\(\w\)' with '\1 \2 \3'. git-svn-id: svn://svn.berlios.de/openocd/trunk@2369 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src/flash')
-rw-r--r--src/flash/at91sam7.c42
-rw-r--r--src/flash/flash.c4
-rw-r--r--src/flash/ocl/at91sam7x/samflash.c4
-rw-r--r--src/flash/pic32mx.c14
-rw-r--r--src/flash/stellaris.c18
5 files changed, 41 insertions, 41 deletions
diff --git a/src/flash/at91sam7.c b/src/flash/at91sam7.c
index bb059c06..55afb6bf 100644
--- a/src/flash/at91sam7.c
+++ b/src/flash/at91sam7.c
@@ -366,13 +366,13 @@ static int at91sam7_read_part_info(struct flash_bank_s *bank)
at91sam7_info = t_bank->driver_priv;
at91sam7_info->cidr = cidr;
- at91sam7_info->cidr_ext = (cidr>>31)&0x0001;
- at91sam7_info->cidr_nvptyp = (cidr>>28)&0x0007;
- at91sam7_info->cidr_arch = (cidr>>20)&0x00FF;
- at91sam7_info->cidr_sramsiz = (cidr>>16)&0x000F;
- at91sam7_info->cidr_nvpsiz2 = (cidr>>12)&0x000F;
- at91sam7_info->cidr_nvpsiz = (cidr>>8)&0x000F;
- at91sam7_info->cidr_eproc = (cidr>>5)&0x0007;
+ at91sam7_info->cidr_ext = (cidr >> 31)&0x0001;
+ at91sam7_info->cidr_nvptyp = (cidr >> 28)&0x0007;
+ at91sam7_info->cidr_arch = (cidr >> 20)&0x00FF;
+ at91sam7_info->cidr_sramsiz = (cidr >> 16)&0x000F;
+ at91sam7_info->cidr_nvpsiz2 = (cidr >> 12)&0x000F;
+ at91sam7_info->cidr_nvpsiz = (cidr >> 8)&0x000F;
+ at91sam7_info->cidr_eproc = (cidr >> 5)&0x0007;
at91sam7_info->cidr_version = cidr&0x001F;
/* calculate master clock frequency */
@@ -391,10 +391,10 @@ static int at91sam7_read_part_info(struct flash_bank_s *bank)
return ERROR_OK;
}
- arch = (cidr>>20)&0x00FF;
+ arch = (cidr >> 20)&0x00FF;
/* check flash size */
- switch ((cidr>>8)&0x000F)
+ switch ((cidr >> 8)&0x000F)
{
case FLASH_SIZE_8KB:
break;
@@ -586,13 +586,13 @@ static int at91sam7_read_part_info(struct flash_bank_s *bank)
at91sam7_info = t_bank->driver_priv;
at91sam7_info->cidr = cidr;
- at91sam7_info->cidr_ext = (cidr>>31)&0x0001;
- at91sam7_info->cidr_nvptyp = (cidr>>28)&0x0007;
- at91sam7_info->cidr_arch = (cidr>>20)&0x00FF;
- at91sam7_info->cidr_sramsiz = (cidr>>16)&0x000F;
- at91sam7_info->cidr_nvpsiz2 = (cidr>>12)&0x000F;
- at91sam7_info->cidr_nvpsiz = (cidr>>8)&0x000F;
- at91sam7_info->cidr_eproc = (cidr>>5)&0x0007;
+ at91sam7_info->cidr_ext = (cidr >> 31)&0x0001;
+ at91sam7_info->cidr_nvptyp = (cidr >> 28)&0x0007;
+ at91sam7_info->cidr_arch = (cidr >> 20)&0x00FF;
+ at91sam7_info->cidr_sramsiz = (cidr >> 16)&0x000F;
+ at91sam7_info->cidr_nvpsiz2 = (cidr >> 12)&0x000F;
+ at91sam7_info->cidr_nvpsiz = (cidr >> 8)&0x000F;
+ at91sam7_info->cidr_eproc = (cidr >> 5)&0x0007;
at91sam7_info->cidr_version = cidr&0x001F;
at91sam7_info->target_name = target_name;
@@ -702,12 +702,12 @@ static int at91sam7_protect_check(struct flash_bank_s *bank)
}
status = at91sam7_get_flash_status(bank->target, bank->bank_number);
- at91sam7_info->lockbits = (status>>16);
+ at91sam7_info->lockbits = (status >> 16);
at91sam7_info->num_lockbits_on = 0;
for (lock_pos=0; lock_pos<bank->num_sectors; lock_pos++)
{
- if ( ((status>>(16+lock_pos))&(0x0001)) == 1)
+ if ( ((status >> (16+lock_pos))&(0x0001)) == 1)
{
at91sam7_info->num_lockbits_on++;
bank->sectors[lock_pos].is_protected = 1;
@@ -719,13 +719,13 @@ static int at91sam7_protect_check(struct flash_bank_s *bank)
/* GPNVM and SECURITY bits apply only for MC_FSR of EFC0 */
status = at91sam7_get_flash_status(bank->target, 0);
- at91sam7_info->securitybit = (status>>4)&0x01;
- at91sam7_info->nvmbits = (status>>8)&0xFF;
+ at91sam7_info->securitybit = (status >> 4)&0x01;
+ at91sam7_info->nvmbits = (status >> 8)&0xFF;
at91sam7_info->num_nvmbits_on = 0;
for (gpnvm_pos=0; gpnvm_pos<at91sam7_info->num_nvmbits; gpnvm_pos++)
{
- if ( ((status>>(8+gpnvm_pos))&(0x01)) == 1)
+ if ( ((status >> (8+gpnvm_pos))&(0x01)) == 1)
{
at91sam7_info->num_nvmbits_on++;
}
diff --git a/src/flash/flash.c b/src/flash/flash.c
index d5bdf60e..60827594 100644
--- a/src/flash/flash.c
+++ b/src/flash/flash.c
@@ -374,7 +374,7 @@ static int handle_flash_info_command(struct command_context_s *cmd_ctx, char *cm
j,
p->sectors[j].offset,
p->sectors[j].size,
- p->sectors[j].size>>10,
+ p->sectors[j].size >> 10,
protect_state);
}
@@ -465,7 +465,7 @@ static int handle_flash_erase_check_command(struct command_context_s *cmd_ctx, c
j,
p->sectors[j].offset,
p->sectors[j].size,
- p->sectors[j].size>>10,
+ p->sectors[j].size >> 10,
erase_state);
}
}
diff --git a/src/flash/ocl/at91sam7x/samflash.c b/src/flash/ocl/at91sam7x/samflash.c
index 66a857b3..b5255191 100644
--- a/src/flash/ocl/at91sam7x/samflash.c
+++ b/src/flash/ocl/at91sam7x/samflash.c
@@ -32,7 +32,7 @@ int flash_init(void)
{
unsigned int nvpsiz;
- nvpsiz=(inr(DBGU_CIDR)>>8)&0xf;
+ nvpsiz=(inr(DBGU_CIDR) >> 8)&0xf;
switch (nvpsiz) {
case 3:
@@ -129,7 +129,7 @@ int flash_erase_plane(int efc_ofs)
int page_num;
page_num=0;
- lockbits=inr(MC_FSR+efc_ofs)>>16;
+ lockbits=inr(MC_FSR+efc_ofs) >> 16;
while (lockbits) {
if (lockbits&1) {
diff --git a/src/flash/pic32mx.c b/src/flash/pic32mx.c
index 9ed1aef1..dd24a7dc 100644
--- a/src/flash/pic32mx.c
+++ b/src/flash/pic32mx.c
@@ -605,11 +605,11 @@ static int pic32mx_probe(struct flash_bank_s *bank)
device_id = ejtag_info->idcode;
LOG_INFO( "device id = 0x%08" PRIx32 " (manuf 0x%03x dev 0x%02x, ver 0x%03x)",
device_id,
- (unsigned)((device_id>>1)&0x7ff),
- (unsigned)((device_id>>12)&0xff),
- (unsigned)((device_id>>20)&0xfff) );
+ (unsigned)((device_id >> 1)&0x7ff),
+ (unsigned)((device_id >> 12)&0xff),
+ (unsigned)((device_id >> 20)&0xfff) );
- if (((device_id>>1)&0x7ff) != PIC32MX_MANUF_ID) {
+ if (((device_id >> 1)&0x7ff) != PIC32MX_MANUF_ID) {
LOG_WARNING( "Cannot identify target as a PIC32MX family." );
return ERROR_FLASH_OPERATION_FAILED;
}
@@ -697,10 +697,10 @@ static int pic32mx_info(struct flash_bank_s *bank, char *buf, int buf_size)
device_id = ejtag_info->idcode;
- if (((device_id>>1)&0x7ff) != PIC32MX_MANUF_ID) {
+ if (((device_id >> 1)&0x7ff) != PIC32MX_MANUF_ID) {
snprintf(buf, buf_size,
"Cannot identify target as a PIC32MX family (manufacturer 0x%03d != 0x%03d)\n",
- (unsigned)((device_id>>1)&0x7ff),
+ (unsigned)((device_id >> 1)&0x7ff),
PIC32MX_MANUF_ID);
return ERROR_FLASH_OPERATION_FAILED;
}
@@ -716,7 +716,7 @@ static int pic32mx_info(struct flash_bank_s *bank, char *buf, int buf_size)
buf += printed;
buf_size -= printed;
printed = snprintf(buf, buf_size, " Ver: 0x%03x",
- (unsigned)((device_id>>20)&0xfff));
+ (unsigned)((device_id >> 20)&0xfff));
return ERROR_OK;
}
diff --git a/src/flash/stellaris.c b/src/flash/stellaris.c
index e8ee2fbf..8f5f03a0 100644
--- a/src/flash/stellaris.c
+++ b/src/flash/stellaris.c
@@ -33,7 +33,7 @@
#include "binarybuffer.h"
-#define DID0_VER(did0) ((did0>>28)&0x07)
+#define DID0_VER(did0) ((did0 >> 28)&0x07)
static int stellaris_register_commands(struct command_context_s *cmd_ctx);
static int stellaris_flash_bank_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct flash_bank_s *bank);
static int stellaris_erase(struct flash_bank_s *bank, int first, int last);
@@ -286,7 +286,7 @@ static int stellaris_info(struct flash_bank_s *bank, char *buf, int buf_size)
if (DID0_VER(stellaris_info->did0) > 0)
{
- device_class = (stellaris_info->did0>>16) & 0xFF;
+ device_class = (stellaris_info->did0 >> 16) & 0xFF;
}
else
{
@@ -298,7 +298,7 @@ static int stellaris_info(struct flash_bank_s *bank, char *buf, int buf_size)
device_class,
StellarisClassname[device_class],
stellaris_info->target_name,
- (int)('A' + ((stellaris_info->did0>>8) & 0xFF)),
+ (int)('A' + ((stellaris_info->did0 >> 8) & 0xFF)),
(int)((stellaris_info->did0) & 0xFF));
buf += printed;
buf_size -= printed;
@@ -309,7 +309,7 @@ static int stellaris_info(struct flash_bank_s *bank, char *buf, int buf_size)
stellaris_info->did1,
stellaris_info->did1,
"ARMV7M",
- (int)((1+((stellaris_info->dc0>>16) & 0xFFFF))/4),
+ (int)((1+((stellaris_info->dc0 >> 16) & 0xFFFF))/4),
(int)((1+(stellaris_info->dc0 & 0xFFFF))*2));
buf += printed;
buf_size -= printed;
@@ -366,11 +366,11 @@ static void stellaris_read_clock_info(flash_bank_t *bank)
LOG_DEBUG("Stellaris PLLCFG %" PRIx32 "", pllcfg);
stellaris_info->rcc = rcc;
- sysdiv = (rcc>>23) & 0xF;
- usesysdiv = (rcc>>22) & 0x1;
- bypass = (rcc>>11) & 0x1;
- oscsrc = (rcc>>4) & 0x3;
- /* xtal = (rcc>>6)&0xF; */
+ sysdiv = (rcc >> 23) & 0xF;
+ usesysdiv = (rcc >> 22) & 0x1;
+ bypass = (rcc >> 11) & 0x1;
+ oscsrc = (rcc >> 4) & 0x3;
+ /* xtal = (rcc >> 6)&0xF; */
switch (oscsrc)
{
case 0: