- Fixes '+' whitespace
[openocd.git] / src / flash / ocl / at91sam7x / samflash.c
index 678d5393096b6310bef1c17be5307f586c594eb6..caa3dad41c7f19ef58d4bd377cd1d3a99d90201b 100644 (file)
@@ -86,11 +86,11 @@ 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 */
-       flash_ptr = (uint32 *)(FLASH_AREA_ADDR+(page_num*flash_page_size));
+       flash_ptr = (uint32 *)(FLASH_AREA_ADDR + (page_num*flash_page_size));
        data_ptr = data;
 
        /* copy data to latch */
@@ -100,18 +100,18 @@ int flash_page_program(uint32 *data, int page_num)
        }
 
        /* page number and page write command to FCR */
-       outr(MC_FCR+efc_ofs, ((page_num&0x3ff) << 8) | MC_KEY | MC_FCMD_WP);
+       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;
-       if ((inr(MC_FSR+efc_ofs)&MC_LOCKE)) return FLASH_STAT_LOCKE;
+       if ((inr(MC_FSR + efc_ofs)&MC_PROGE)) return FLASH_STAT_PROGE;
+       if ((inr(MC_FSR + efc_ofs)&MC_LOCKE)) return FLASH_STAT_LOCKE;
 
 #if 0
        /* verify written data */
-       flash_ptr = (uint32 *)(FLASH_AREA_ADDR+(page_num*flash_page_size));
+       flash_ptr = (uint32 *)(FLASH_AREA_ADDR + (page_num*flash_page_size));
        data_ptr = data;
 
        for (i = flash_page_size/4; i; i--) {
@@ -129,21 +129,21 @@ 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) {
 
                        /* 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);
+                       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;
-                       if ((inr(MC_FSR+efc_ofs)&MC_LOCKE)) return FLASH_STAT_LOCKE;
+                       if ((inr(MC_FSR + efc_ofs)&MC_PROGE)) return FLASH_STAT_PROGE;
+                       if ((inr(MC_FSR + efc_ofs)&MC_LOCKE)) return FLASH_STAT_LOCKE;
 
                }
                if ((page_num += flash_lock_pages)>flash_page_count) break;
@@ -151,20 +151,20 @@ 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);
+       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;
-       if ((inr(MC_FSR+efc_ofs)&MC_LOCKE)) return FLASH_STAT_LOCKE;
+       if ((inr(MC_FSR + efc_ofs)&MC_PROGE)) return FLASH_STAT_PROGE;
+       if ((inr(MC_FSR + efc_ofs)&MC_LOCKE)) return FLASH_STAT_LOCKE;
 
        /* set no erase before programming */
-       outr(MC_FMR+efc_ofs, inr(MC_FMR+efc_ofs)|0x80);
+       outr(MC_FMR + efc_ofs, inr(MC_FMR + efc_ofs)|0x80);
 
        return FLASH_STAT_OK;
 }
@@ -188,7 +188,7 @@ int flash_verify(uint32 adr, unsigned int len, uint8 *src)
 {
        unsigned char *flash_ptr;
 
-       flash_ptr = (uint8 *)FLASH_AREA_ADDR+adr;
+       flash_ptr = (uint8 *)FLASH_AREA_ADDR + adr;
        for ( ;len; len--) {
                if (*(flash_ptr++)!=*(src++)) return FLASH_STAT_VERIFE;
        }

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)