]> git.sur5r.net Git - openocd/blobdiff - src/flash/mflash.c
Eliminate MixedCaps symbol from public JTAG TAP API:
[openocd] / src / flash / mflash.c
index f2cfd4a111f49a053a40fc48bd85b9c13e85f61a..2587b6b5f931f42fcd49ccaf68457a5b1912f37a 100644 (file)
@@ -345,7 +345,7 @@ static int mg_dsk_drv_info(void)
        if (! mflash_bank->drv_info)
                mflash_bank->drv_info = malloc(sizeof(mg_drv_info_t));
 
-       target->type->read_memory(target, mg_buff, 2, sizeof(mg_io_type_drv_info) >> 1,
+       target_read_memory(target, mg_buff, 2, sizeof(mg_io_type_drv_info) >> 1,
                        (u8 *)&mflash_bank->drv_info->drv_id);
 
        mflash_bank->drv_info->tot_sects = (u32)(mflash_bank->drv_info->drv_id.total_user_addressable_sectors_hi << 16)
@@ -428,7 +428,7 @@ static int mg_mflash_do_read_sects(void *buff, u32 sect_num, u32 sect_cnt)
        for (i = 0; i < sect_cnt; i++) {
                mg_dsk_wait(mg_io_wait_drq, MG_OEM_DISK_WAIT_TIME_NORMAL);
 
-               target->type->read_memory(target, address, 2, MG_MFLASH_SECTOR_SIZE / 2, buff_ptr);
+               target_read_memory(target, address, 2, MG_MFLASH_SECTOR_SIZE / 2, buff_ptr);
                buff_ptr += MG_MFLASH_SECTOR_SIZE;
 
                target_write_u8(target, mflash_bank->base + MG_REG_OFFSET + MG_REG_COMMAND, mg_io_cmd_confirm_read);
@@ -494,7 +494,7 @@ static int mg_mflash_do_write_sects(void *buff, u32 sect_num, u32 sect_cnt,
                if (ret != ERROR_OK)
                        LOG_ERROR("mg_io_wait_drq time out");
 
-               ret = target->type->write_memory(target, address, 2, MG_MFLASH_SECTOR_SIZE / 2, buff_ptr);
+               ret = target_write_memory(target, address, 2, MG_MFLASH_SECTOR_SIZE / 2, buff_ptr);
                if (ret != ERROR_OK)
                        LOG_ERROR("mem write error");
                buff_ptr += MG_MFLASH_SECTOR_SIZE;
@@ -927,12 +927,12 @@ static int mg_verify_interface(void)
                for (i = 0; i < MG_MFLASH_SECTOR_SIZE >> 1; i++)
                        buff[i] = i;
 
-               target->type->write_memory(target, address, 2,
+               target_write_memory(target, address, 2,
                                MG_MFLASH_SECTOR_SIZE / 2, (u8 *)buff);
 
                memset(buff, 0xff, MG_MFLASH_SECTOR_SIZE);
 
-               target->type->read_memory(target, address, 2,
+               target_read_memory(target, address, 2,
                                MG_MFLASH_SECTOR_SIZE / 2, (u8 *)buff);
 
                for (i = 0; i < MG_MFLASH_SECTOR_SIZE >> 1; i++) {
@@ -1126,8 +1126,9 @@ static int mg_set_pll(mg_pll_t *pll)
        u8 buff[512];
 
        memset(buff, 0xff, 512);
-       *((u32 *)&buff[0]) = pll->lock_cyc;     /* PLL Lock cycle */
-       *((u16 *)&buff[4]) = pll->feedback_div; /* PLL Feedback 9bit Divider */
+       /* PLL Lock cycle and Feedback 9bit Divider */
+       memcpy(buff, &pll->lock_cyc, sizeof(u32));
+       memcpy(buff + 4, &pll->feedback_div, sizeof(u16));
        buff[6] = pll->input_div;               /* PLL Input 5bit Divider */
        buff[7] = pll->output_div;              /* PLL Output Divider */