]> git.sur5r.net Git - openocd/blobdiff - src/flash/ocl.c
Eliminate MixedCaps symbol from public JTAG TAP API:
[openocd] / src / flash / ocl.c
index 8f2a54456c836ed08f8f08659227c71b8b9ef46b..b9028b1e8d6a1119bcdb07fb7c7ed128fd01f056 100644 (file)
 #include "config.h"
 #endif
 
-#include "replacements.h"
-
 #include "ocl.h"
-
 #include "flash.h"
-#include "target.h"
-#include "log.h"
-#include "binarybuffer.h"
-#include "types.h"
 #include "embeddedice.h"
-#include "arm7_9_common.h"
 
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
 
 static int ocl_register_commands(struct command_context_s *cmd_ctx);
 static int ocl_flash_bank_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct flash_bank_s *bank);
@@ -66,8 +55,8 @@ flash_driver_t ocl_flash =
 typedef struct ocl_priv_s
 {
        arm_jtag_t *jtag_info;
-       int buflen;
-       int bufalign;
+       unsigned int buflen;
+       unsigned int bufalign;
 } ocl_priv_t;
 
 static int ocl_register_commands(struct command_context_s *cmd_ctx)
@@ -119,13 +108,13 @@ static int ocl_erase(struct flash_bank_s *bank, int first, int last)
        /* check preconditions */
        if (bank->num_sectors == 0)
                return ERROR_FLASH_BANK_NOT_PROBED;
-               
+
        if (bank->target->state != TARGET_RUNNING)
        {
                LOG_ERROR("target has to be running to communicate with the loader");
                return ERROR_TARGET_NOT_RUNNING;
        }
-               
+
        if ((first == 0) && (last == bank->num_sectors - 1))
        {
                dcc_buffer[0] = OCL_ERASE_ALL;
@@ -179,7 +168,7 @@ static int ocl_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 coun
        int byteofs;
        int runlen;
        u32 chksum;
-       
+
        int i;
 
        /* check preconditions */
@@ -238,7 +227,7 @@ static int ocl_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 coun
                        chksum ^= *(dcc_bufptr++);
 
                *(dcc_bufptr++) = chksum;
-               
+
                /* send the data */
                if ((retval = embeddedice_send(ocl->jtag_info, dcc_buffer, dcc_bufptr-dcc_buffer)) != ERROR_OK)
                {
@@ -303,7 +292,7 @@ static int ocl_probe(struct flash_bank_s *bank)
        /* receive response */
        if ((retval = embeddedice_receive(ocl->jtag_info, dcc_buffer, 1) != ERROR_OK))
                return retval;
-               
+
        if (dcc_buffer[0] != OCL_CMD_DONE)
        {
                LOG_ERROR("loader response to OCL_PROBE 0x%08X", dcc_buffer[0]);