stellaris: remove needless code
authorDavid Brownell <dbrownell@users.sourceforge.net>
Wed, 16 Dec 2009 22:17:31 +0000 (14:17 -0800)
committerDavid Brownell <dbrownell@users.sourceforge.net>
Wed, 16 Dec 2009 22:17:31 +0000 (14:17 -0800)
No point in reading and discarding a status value when fetching
part description data.  Or having that needless "#if 0" code.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
src/flash/nor/stellaris.c

index 8b0d9d30e6eb3c7edca9d87e77ef55e37eb7c0f1..0ae65dc8ac195242cfc79f42ecebf1e21111d450 100644 (file)
@@ -37,7 +37,6 @@
 #define DID0_VER(did0) ((did0 >> 28)&0x07)
 
 static int stellaris_read_part_info(struct flash_bank *bank);
-static uint32_t stellaris_get_flash_status(struct flash_bank *bank);
 
 static int stellaris_mass_erase(struct flash_bank *bank);
 
@@ -335,16 +334,6 @@ static int stellaris_info(struct flash_bank *bank, char *buf, int buf_size)
 *      chip identification and status                                         *
 ***************************************************************************/
 
-static uint32_t stellaris_get_flash_status(struct flash_bank *bank)
-{
-       struct target *target = bank->target;
-       uint32_t fmc;
-
-       target_read_u32(target, FLASH_CONTROL_BASE | FLASH_FMC, &fmc);
-
-       return fmc;
-}
-
 /* Set the flash timimg register to match current clocking */
 static void stellaris_set_flash_timing(struct flash_bank *bank)
 {
@@ -473,48 +462,12 @@ static void stellaris_read_clock_info(struct flash_bank *bank)
                stellaris_info->mck_freq = mainfreq;
 }
 
-#if 0
-static uint32_t stellaris_wait_status_busy(struct flash_bank *bank, uint32_t waitbits, int timeout)
-{
-       uint32_t status;
-
-       /* Stellaris waits for cmdbit to clear */
-       while (((status = stellaris_get_flash_status(bank)) & waitbits) && (timeout-- > 0))
-       {
-               LOG_DEBUG("status: 0x%x", status);
-               alive_sleep(1);
-       }
-
-       /* Flash errors are reflected in the FLASH_CRIS register */
-
-       return status;
-}
-
-/* Send one command to the flash controller */
-static int stellaris_flash_command(struct flash_bank *bank,uint8_t cmd,uint16_t pagen)
-{
-       uint32_t fmc;
-       struct target *target = bank->target;
-
-       fmc = FMC_WRKEY | cmd;
-       target_write_u32(target, FLASH_CONTROL_BASE | FLASH_FMC, fmc);
-       LOG_DEBUG("Flash command: 0x%x", fmc);
-
-       if (stellaris_wait_status_busy(bank, cmd, 100))
-       {
-               return ERROR_FLASH_OPERATION_FAILED;
-       }
-
-       return ERROR_OK;
-}
-#endif
-
 /* Read device id register, main clock frequency register and fill in driver info structure */
 static int stellaris_read_part_info(struct flash_bank *bank)
 {
        struct stellaris_flash_bank *stellaris_info = bank->driver_priv;
        struct target *target = bank->target;
-       uint32_t did0, did1, ver, fam, status;
+       uint32_t did0, did1, ver, fam;
        int i;
 
        /* Read and parse chip identification register */
@@ -618,8 +571,6 @@ static int stellaris_read_part_info(struct flash_bank *bank)
        /* Read main and master clock freqency register */
        stellaris_read_clock_info(bank);
 
-       status = stellaris_get_flash_status(bank);
-
        return ERROR_OK;
 }
 

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)