Finish portability support for AC_HEADER_STDBOOL configure macro.
[openocd.git] / src / flash / lpc288x.c
index a0becf5bbe84fd632ba92354274a09aa2782dadb..1f47896452856892dc55eba0f2ac54ebfb8bfb58 100644 (file)
 /* F_CLK_TIME */
 #define FCT_CLK_DIV_MASK    0x0FFF
 
-int lpc288x_register_commands(struct command_context_s *cmd_ctx);
-int lpc288x_flash_bank_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct flash_bank_s *bank);
-int lpc288x_erase(struct flash_bank_s *bank, int first, int last);
-int lpc288x_protect(struct flash_bank_s *bank, int set, int first, int last);
-int lpc288x_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count);
-int lpc288x_probe(struct flash_bank_s *bank);
-int lpc288x_auto_probe(struct flash_bank_s *bank);
-int lpc288x_erase_check(struct flash_bank_s *bank);
-int lpc288x_protect_check(struct flash_bank_s *bank);
-int lpc288x_info(struct flash_bank_s *bank, char *buf, int buf_size);
-void lpc288x_set_flash_mode(flash_bank_t *bank, u8 flashplane, int mode);
-u32 lpc288x_wait_status_busy(flash_bank_t *bank, int timeout);
-void lpc288x_load_timer(int erase, struct target_s *target);
-void lpc288x_set_flash_clk(struct flash_bank_s *bank);
-u32 lpc288x_system_ready(struct flash_bank_s *bank);
-int lpc288x_handle_part_id_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
+static int lpc288x_register_commands(struct command_context_s *cmd_ctx);
+static int lpc288x_flash_bank_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct flash_bank_s *bank);
+static int lpc288x_erase(struct flash_bank_s *bank, int first, int last);
+static int lpc288x_protect(struct flash_bank_s *bank, int set, int first, int last);
+static int lpc288x_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count);
+static int lpc288x_probe(struct flash_bank_s *bank);
+static int lpc288x_erase_check(struct flash_bank_s *bank);
+static int lpc288x_protect_check(struct flash_bank_s *bank);
+static int lpc288x_info(struct flash_bank_s *bank, char *buf, int buf_size);
+static u32 lpc288x_wait_status_busy(flash_bank_t *bank, int timeout);
+static void lpc288x_load_timer(int erase, struct target_s *target);
+static void lpc288x_set_flash_clk(struct flash_bank_s *bank);
+static u32 lpc288x_system_ready(struct flash_bank_s *bank);
 
 flash_driver_t lpc288x_flash =
 {
@@ -126,12 +123,12 @@ flash_driver_t lpc288x_flash =
        .info = lpc288x_info
 };
 
-int lpc288x_register_commands(struct command_context_s *cmd_ctx)
+static int lpc288x_register_commands(struct command_context_s *cmd_ctx)
 {
        return ERROR_OK;
 }
 
-u32 lpc288x_wait_status_busy(flash_bank_t *bank, int timeout)
+static u32 lpc288x_wait_status_busy(flash_bank_t *bank, int timeout)
 {
        u32 status;
        target_t *target = bank->target;
@@ -151,7 +148,7 @@ u32 lpc288x_wait_status_busy(flash_bank_t *bank, int timeout)
 }
 
 /* Read device id register and fill in driver info structure */
-int lpc288x_read_part_info(struct flash_bank_s *bank)
+static int lpc288x_read_part_info(struct flash_bank_s *bank)
 {
        lpc288x_flash_bank_t *lpc288x_info = bank->driver_priv;
        target_t *target = bank->target;
@@ -201,13 +198,13 @@ int lpc288x_read_part_info(struct flash_bank_s *bank)
        return ERROR_OK;
 }
 
-int lpc288x_protect_check(struct flash_bank_s *bank)
+static int lpc288x_protect_check(struct flash_bank_s *bank)
 {
        return ERROR_OK;
 }
 
 /* flash_bank LPC288x 0 0 0 0 <target#> <cclk> */
-int lpc288x_flash_bank_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct flash_bank_s *bank)
+static int lpc288x_flash_bank_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct flash_bank_s *bank)
 {
        lpc288x_flash_bank_t *lpc288x_info;
        
@@ -232,7 +229,7 @@ int lpc288x_flash_bank_command(struct command_context_s *cmd_ctx, char *cmd, cha
  * AHB = 12 MHz ?
  * 12000000/66000 = 182
  * CLK_DIV = 60 ? */
-void lpc288x_set_flash_clk(struct flash_bank_s *bank)
+static void lpc288x_set_flash_clk(struct flash_bank_s *bank)
 {
        u32 clk_time;
        lpc288x_flash_bank_t *lpc288x_info = bank->driver_priv;
@@ -247,7 +244,7 @@ void lpc288x_set_flash_clk(struct flash_bank_s *bank)
  * LOAD_TIMER_WRITE            FPT_TIME        = ((1,000,000 / AHB tcyc (in ns)) - 2) / 512
  *                                                                     = 23 (75) (AN10548 72 - is this wrong?)
  * TODO: Sort out timing calcs ;) */
-void lpc288x_load_timer(int erase, struct target_s *target)
+static void lpc288x_load_timer(int erase, struct target_s *target)
 {
        if (erase == LOAD_TIMER_ERASE)
        {
@@ -259,7 +256,7 @@ void lpc288x_load_timer(int erase, struct target_s *target)
        }
 }
 
-u32 lpc288x_system_ready(struct flash_bank_s *bank)
+static u32 lpc288x_system_ready(struct flash_bank_s *bank)
 {
        lpc288x_flash_bank_t *lpc288x_info = bank->driver_priv;
        if (lpc288x_info->cidr == 0)
@@ -275,7 +272,7 @@ u32 lpc288x_system_ready(struct flash_bank_s *bank)
        return ERROR_OK;
 }
 
-int lpc288x_erase_check(struct flash_bank_s *bank)
+static int lpc288x_erase_check(struct flash_bank_s *bank)
 {
        u32 status = lpc288x_system_ready(bank);        /* probed? halted? */
        if (status != ERROR_OK)
@@ -287,7 +284,7 @@ int lpc288x_erase_check(struct flash_bank_s *bank)
        return ERROR_OK;
 }
 
-int lpc288x_erase(struct flash_bank_s *bank, int first, int last)
+static int lpc288x_erase(struct flash_bank_s *bank, int first, int last)
 {
        u32 status;
        int sector;
@@ -328,13 +325,14 @@ int lpc288x_erase(struct flash_bank_s *bank, int first, int last)
        return ERROR_OK;
 }
 
-int lpc288x_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count)
+static int lpc288x_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count)
 {
        u8 page_buffer[FLASH_PAGE_SIZE];
-       u32 i, status, source_offset,dest_offset;
+       u32 status, source_offset,dest_offset;
        target_t *target = bank->target;
        u32 bytes_remaining = count;
        u32 first_sector, last_sector, sector, page;
+       int i;
        
        /* probed? halted? */
        status = lpc288x_system_ready(bank);
@@ -443,7 +441,7 @@ int lpc288x_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count)
        return ERROR_OK;
 }
 
-int lpc288x_probe(struct flash_bank_s *bank)
+static int lpc288x_probe(struct flash_bank_s *bank)
 {
        /* we only deal with LPC2888 so flash config is fixed */
        lpc288x_flash_bank_t *lpc288x_info = bank->driver_priv;
@@ -466,13 +464,13 @@ int lpc288x_probe(struct flash_bank_s *bank)
        return ERROR_OK;
 }
 
-int lpc288x_info(struct flash_bank_s *bank, char *buf, int buf_size)
+static int lpc288x_info(struct flash_bank_s *bank, char *buf, int buf_size)
 {
        snprintf(buf, buf_size, "lpc288x flash driver");
        return ERROR_OK;
 }
 
-int lpc288x_protect(struct flash_bank_s *bank, int set, int first, int last)
+static int lpc288x_protect(struct flash_bank_s *bank, int set, int first, int last)
 {
        int lockregion, status;
        u32 value;

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)