summaryrefslogtreecommitdiff
path: root/src/flash/nor
diff options
context:
space:
mode:
authorDavid Brownell <dbrownell@users.sourceforge.net>2009-12-16 14:17:31 -0800
committerDavid Brownell <dbrownell@users.sourceforge.net>2009-12-16 14:17:31 -0800
commit6f2b9ea9e158aa116937b234a9c069bfef1f4238 (patch)
tree359162ef7939ebc8d7ce9fa5dd174a6dbb5fab0a /src/flash/nor
parentf85dc92d2a2b336f9844c0eddcdf4df4c0dc9fbf (diff)
downloadopenocd+libswd-6f2b9ea9e158aa116937b234a9c069bfef1f4238.tar.gz
openocd+libswd-6f2b9ea9e158aa116937b234a9c069bfef1f4238.tar.bz2
openocd+libswd-6f2b9ea9e158aa116937b234a9c069bfef1f4238.tar.xz
openocd+libswd-6f2b9ea9e158aa116937b234a9c069bfef1f4238.zip
stellaris: remove needless code
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>
Diffstat (limited to 'src/flash/nor')
-rw-r--r--src/flash/nor/stellaris.c51
1 files changed, 1 insertions, 50 deletions
diff --git a/src/flash/nor/stellaris.c b/src/flash/nor/stellaris.c
index 8b0d9d30..0ae65dc8 100644
--- a/src/flash/nor/stellaris.c
+++ b/src/flash/nor/stellaris.c
@@ -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;
}