summaryrefslogtreecommitdiff
path: root/src/flash/stellaris.c
diff options
context:
space:
mode:
authorZachary T Welch <zw@superlucidity.net>2009-11-09 09:20:33 -0800
committerZachary T Welch <zw@superlucidity.net>2009-11-09 18:42:47 -0800
commit712d3fc0fb3ed69342a649d8bbb0d6d901a64720 (patch)
tree353b60ffcae5ac40cd5b2cb10c97838480e8fe17 /src/flash/stellaris.c
parent4cd02c63e9213b7f33ec4ac33d481fb00e00708f (diff)
downloadopenocd+libswd-712d3fc0fb3ed69342a649d8bbb0d6d901a64720.tar.gz
openocd+libswd-712d3fc0fb3ed69342a649d8bbb0d6d901a64720.tar.bz2
openocd+libswd-712d3fc0fb3ed69342a649d8bbb0d6d901a64720.tar.xz
openocd+libswd-712d3fc0fb3ed69342a649d8bbb0d6d901a64720.zip
flash/<assorted>.c: remove useless declarations
Remove useless forward declarations. Moves command registrations to end of files. Moves flash structure definitions to end of files. Signed-off-by: Zachary T Welch <zw@superlucidity.net>
Diffstat (limited to 'src/flash/stellaris.c')
-rw-r--r--src/flash/stellaris.c59
1 files changed, 26 insertions, 33 deletions
diff --git a/src/flash/stellaris.c b/src/flash/stellaris.c
index b482ce2e..bd561a61 100644
--- a/src/flash/stellaris.c
+++ b/src/flash/stellaris.c
@@ -34,39 +34,14 @@
#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);
-static int stellaris_protect(struct flash_bank_s *bank, int set, int first, int last);
-static int stellaris_write(struct flash_bank_s *bank, uint8_t *buffer, uint32_t offset, uint32_t count);
-static int stellaris_auto_probe(struct flash_bank_s *bank);
-static int stellaris_probe(struct flash_bank_s *bank);
-static int stellaris_protect_check(struct flash_bank_s *bank);
-static int stellaris_info(struct flash_bank_s *bank, char *buf, int buf_size);
static int stellaris_read_part_info(struct flash_bank_s *bank);
static uint32_t stellaris_get_flash_status(flash_bank_t *bank);
static void stellaris_set_flash_mode(flash_bank_t *bank,int mode);
//static uint32_t stellaris_wait_status_busy(flash_bank_t *bank, uint32_t waitbits, int timeout);
-static int stellaris_handle_mass_erase_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
static int stellaris_mass_erase(struct flash_bank_s *bank);
-flash_driver_t stellaris_flash =
-{
- .name = "stellaris",
- .register_commands = stellaris_register_commands,
- .flash_bank_command = stellaris_flash_bank_command,
- .erase = stellaris_erase,
- .protect = stellaris_protect,
- .write = stellaris_write,
- .probe = stellaris_probe,
- .auto_probe = stellaris_auto_probe,
- .erase_check = default_flash_mem_blank_check,
- .protect_check = stellaris_protect_check,
- .info = stellaris_info
-};
-
static struct {
uint32_t partno;
char *partname;
@@ -264,14 +239,6 @@ static int stellaris_flash_bank_command(struct command_context_s *cmd_ctx, char
return ERROR_OK;
}
-static int stellaris_register_commands(struct command_context_s *cmd_ctx)
-{
- command_t *stm32x_cmd = register_command(cmd_ctx, NULL, "stellaris", NULL, COMMAND_ANY, "stellaris flash specific commands");
-
- register_command(cmd_ctx, stm32x_cmd, "mass_erase", stellaris_handle_mass_erase_command, COMMAND_EXEC, "mass erase device");
- return ERROR_OK;
-}
-
static int stellaris_info(struct flash_bank_s *bank, char *buf, int buf_size)
{
int printed, device_class;
@@ -1192,3 +1159,29 @@ static int stellaris_handle_mass_erase_command(struct command_context_s *cmd_ctx
return ERROR_OK;
}
+
+static int stellaris_register_commands(struct command_context_s *cmd_ctx)
+{
+ command_t *stm32x_cmd = register_command(cmd_ctx, NULL, "stellaris",
+ NULL, COMMAND_ANY, "stellaris flash specific commands");
+
+ register_command(cmd_ctx, stm32x_cmd, "mass_erase",
+ stellaris_handle_mass_erase_command, COMMAND_EXEC,
+ "mass erase device");
+ return ERROR_OK;
+}
+
+
+flash_driver_t stellaris_flash = {
+ .name = "stellaris",
+ .register_commands = &stellaris_register_commands,
+ .flash_bank_command = &stellaris_flash_bank_command,
+ .erase = &stellaris_erase,
+ .protect = &stellaris_protect,
+ .write = &stellaris_write,
+ .probe = &stellaris_probe,
+ .auto_probe = &stellaris_auto_probe,
+ .erase_check = &default_flash_mem_blank_check,
+ .protect_check = &stellaris_protect_check,
+ .info = &stellaris_info,
+ };