diff --git a/urjtag/src/bsdl/bsdl.c b/urjtag/src/bsdl/bsdl.c index 0c761714..883e69e5 100644 --- a/urjtag/src/bsdl/bsdl.c +++ b/urjtag/src/bsdl/bsdl.c @@ -128,7 +128,7 @@ urj_bsdl_read_file (urj_chain_t *chain, const char *BSDL_File_Name, urj_vhdl_parser_priv_t *vhdl_parser_priv; urj_bsdl_jtag_ctrl_t jtag_ctrl; int Compile_Errors = 1; - int result; + int result = 0; if (globs->debug) proc_mode |= URJ_BSDL_MODE_MSG_ALL; diff --git a/urjtag/src/bus/bf533_ezkit.c b/urjtag/src/bus/bf533_ezkit.c index ac8e6d99..38e48c48 100644 --- a/urjtag/src/bus/bf533_ezkit.c +++ b/urjtag/src/bus/bf533_ezkit.c @@ -318,7 +318,8 @@ bf533_ezkit_bus_write (urj_bus_t *bus, uint32_t adr, uint32_t data) urj_part_t *p = bus->part; urj_chain_t *chain = bus->chain; - urj_log (URJ_LOG_LEVEL_COMM, "Writing %04X to %08X...\n", data, adr); + urj_log (URJ_LOG_LEVEL_COMM, "Writing %04lX to %08lX...\n", + (long unsigned) data, (long unsigned) adr); select_flash (bus); urj_part_set_signal (p, AOE, 1, 1); diff --git a/urjtag/src/bus/bf533_stamp.c b/urjtag/src/bus/bf533_stamp.c index 9c163072..fae19b87 100644 --- a/urjtag/src/bus/bf533_stamp.c +++ b/urjtag/src/bus/bf533_stamp.c @@ -320,7 +320,8 @@ bf533_stamp_bus_write (urj_bus_t *bus, uint32_t adr, uint32_t data) urj_part_t *p = bus->part; urj_chain_t *chain = bus->chain; - urj_log (URJ_LOG_LEVEL_COMM, "Writing %04X to %08X...\n", data, adr); + urj_log (URJ_LOG_LEVEL_COMM, "Writing %04lX to %08lX...\n", + (long unsigned) data, (long unsigned) adr); select_flash (bus); urj_part_set_signal (p, AOE, 1, 1); diff --git a/urjtag/src/bus/ejtag_dma.c b/urjtag/src/bus/ejtag_dma.c index b0a7e6e5..f8ef66de 100644 --- a/urjtag/src/bus/ejtag_dma.c +++ b/urjtag/src/bus/ejtag_dma.c @@ -208,16 +208,17 @@ ejtag_dma_write (urj_bus_t *bus, unsigned int addr, unsigned int data, int sz) for (i = 0; i < 32; i++) ejaddr->in->data[i] = (addr >> i) & 1; urj_tap_chain_shift_data_registers (bus->chain, 0); /* Push the address to write */ - urj_log (URJ_LOG_LEVEL_COMM, "Wrote to ejaddr->in =%s %08X\n", - urj_tap_register_get_string (ejaddr->in), reg_value (ejaddr->in)); + urj_log (URJ_LOG_LEVEL_COMM, "Wrote to ejaddr->in =%s %08lX\n", + urj_tap_register_get_string (ejaddr->in), + (long unsigned) reg_value (ejaddr->in)); urj_part_set_instruction (bus->part, "EJTAG_DATA"); urj_tap_chain_shift_instructions (bus->chain); for (i = 0; i < 32; i++) ejdata->in->data[i] = (data >> i) & 1; urj_tap_chain_shift_data_registers (bus->chain, 0); /* Push the data to write */ - urj_log (URJ_LOG_LEVEL_COMM, "Wrote to edata->in(%c) =%s %08X\n", + urj_log (URJ_LOG_LEVEL_COMM, "Wrote to edata->in(%c) =%s %08lX\n", siz_ (sz), urj_tap_register_get_string (ejdata->in), - reg_value (ejdata->in)); + (long unsigned) reg_value (ejdata->in)); urj_part_set_instruction (bus->part, "EJTAG_CONTROL"); urj_tap_chain_shift_instructions (bus->chain); urj_tap_register_fill (ejctrl->in, 0); @@ -228,8 +229,9 @@ ejtag_dma_write (urj_bus_t *bus, unsigned int addr, unsigned int data, int sz) if (sz) ejctrl->in->data[sz] = 1; // Size : can be WORD/HALFWORD or nothing for byte urj_tap_chain_shift_data_registers (bus->chain, 0); /* Do the operation */ - urj_log (URJ_LOG_LEVEL_ALL, "Wrote to ejctrl->in =%s %08X\n", - urj_tap_register_get_string (ejctrl->in), reg_value (ejctrl->in)); + urj_log (URJ_LOG_LEVEL_ALL, "Wrote to ejctrl->in =%s %08lX\n", + urj_tap_register_get_string (ejctrl->in), + (long unsigned) reg_value (ejctrl->in)); do { @@ -286,8 +288,9 @@ ejtag_dma_read (urj_bus_t *bus, unsigned int addr, int sz) for (i = 0; i < 32; i++) ejaddr->in->data[i] = (addr >> i) & 1; urj_tap_chain_shift_data_registers (bus->chain, 0); /* Push the address to read */ - urj_log (URJ_LOG_LEVEL_COMM, "Wrote to ejaddr->in =%s %08X\n", - urj_tap_register_get_string (ejaddr->in), reg_value (ejaddr->in)); + urj_log (URJ_LOG_LEVEL_COMM, "Wrote to ejaddr->in =%s %08lX\n", + urj_tap_register_get_string (ejaddr->in), + (long unsigned) reg_value (ejaddr->in)); urj_part_set_instruction (bus->part, "EJTAG_CONTROL"); urj_tap_chain_shift_instructions (bus->chain); urj_tap_register_fill (ejctrl->in, 0); @@ -299,8 +302,9 @@ ejtag_dma_read (urj_bus_t *bus, unsigned int addr, int sz) ejctrl->in->data[sz] = 1; // Size : can be WORD/HALFWORD or nothing for byte ejctrl->in->data[DmaRwn] = 1; // This is a read urj_tap_chain_shift_data_registers (bus->chain, 0); /* Do the operation */ - urj_log (URJ_LOG_LEVEL_ALL, "Wrote to ejctrl->in =%s %08X\n", - urj_tap_register_get_string (ejctrl->in), reg_value (ejctrl->in)); + urj_log (URJ_LOG_LEVEL_ALL, "Wrote to ejctrl->in =%s %08lX\n", + urj_tap_register_get_string (ejctrl->in), + (long unsigned) reg_value (ejctrl->in)); do { @@ -312,12 +316,12 @@ ejtag_dma_read (urj_bus_t *bus, unsigned int addr, int sz) ejctrl->in->data[DmaAcc] = 1; urj_tap_chain_shift_data_registers (bus->chain, 1); - urj_log (URJ_LOG_LEVEL_ALL, "Wrote to ejctrl->in =%s %08X\n", + urj_log (URJ_LOG_LEVEL_ALL, "Wrote to ejctrl->in =%s %08lX\n", urj_tap_register_get_string (ejctrl->in), - reg_value (ejctrl->in)); - urj_log (URJ_LOG_LEVEL_ALL, "Read from ejctrl->out =%s %08X\n", + (long unsigned) reg_value (ejctrl->in)); + urj_log (URJ_LOG_LEVEL_ALL, "Read from ejctrl->out =%s %08lX\n", urj_tap_register_get_string (ejctrl->out), - reg_value (ejctrl->out)); + (long unsigned) reg_value (ejctrl->out)); timeout--; if (!timeout) break; @@ -329,9 +333,9 @@ ejtag_dma_read (urj_bus_t *bus, unsigned int addr, int sz) urj_tap_register_fill (ejdata->in, 0); urj_tap_chain_shift_data_registers (bus->chain, 1); ret = reg_value (ejdata->out); - urj_log (URJ_LOG_LEVEL_COMM, "Read from ejdata->out(%c) =%s %08X\n", + urj_log (URJ_LOG_LEVEL_COMM, "Read from ejdata->out(%c) =%s %08lX\n", siz_ (sz), urj_tap_register_get_string (ejdata->out), - reg_value (ejdata->out)); + (long unsigned) reg_value (ejdata->out)); urj_part_set_instruction (bus->part, "EJTAG_CONTROL"); urj_tap_chain_shift_instructions (bus->chain); urj_tap_register_fill (ejctrl->in, 0); @@ -339,10 +343,12 @@ ejtag_dma_read (urj_bus_t *bus, unsigned int addr, int sz) ejctrl->in->data[ProbEn] = 1; urj_tap_chain_shift_data_registers (bus->chain, 1); // Disable DMA, reset state to previous one. - urj_log (URJ_LOG_LEVEL_ALL, "Wrote to ejctrl->in =%s %08X\n", - urj_tap_register_get_string (ejctrl->in),reg_value (ejctrl->in)); - urj_log (URJ_LOG_LEVEL_ALL, "Read from ejctrl->out =%s %08X\n", - urj_tap_register_get_string (ejctrl->out), reg_value(ejctrl->out)); + urj_log (URJ_LOG_LEVEL_ALL, "Wrote to ejctrl->in =%s %08lX\n", + urj_tap_register_get_string (ejctrl->in), + (long unsigned) reg_value (ejctrl->in)); + urj_log (URJ_LOG_LEVEL_ALL, "Read from ejctrl->out =%s %08lX\n", + urj_tap_register_get_string (ejctrl->out), + (long unsigned) reg_value(ejctrl->out)); if (ejctrl->out->data[Derr] == 1) { // Check for DMA error, i.e. incorrect address @@ -626,7 +632,8 @@ get_sz (uint32_t adr) static void ejtag_dma_bus_write (urj_bus_t *bus, uint32_t adr, uint32_t data) { - urj_log (URJ_LOG_LEVEL_ALL, "%s:adr=0x%x,data=0x%x\n", __func__, adr, data); + urj_log (URJ_LOG_LEVEL_ALL, "%s:adr=0x%lx,got=0x%lx\n", __func__, + (long unsigned) adr, (long unsigned) data); ejtag_dma_write (bus, adr, data, get_sz (adr)); } @@ -638,7 +645,8 @@ static uint32_t ejtag_dma_bus_read (urj_bus_t *bus, uint32_t adr) { int data = ejtag_dma_read (bus, adr, get_sz (adr)); - urj_log (URJ_LOG_LEVEL_ALL, "%s:adr=0x%x,got=0x%x\n", __func__, adr, data); + urj_log (URJ_LOG_LEVEL_ALL, "%s:adr=0x%lx,got=0x%lx\n", __func__, + (long unsigned) adr, (long unsigned) data); return data; } @@ -651,8 +659,8 @@ static int ejtag_dma_bus_read_start (urj_bus_t *bus, uint32_t adr) { _data_read = ejtag_dma_read (bus, adr, get_sz (adr)); - urj_log (URJ_LOG_LEVEL_ALL, "%s:adr=0x%x, got=0x%x\n", __func__, adr, - _data_read); + urj_log (URJ_LOG_LEVEL_ALL, "%s:adr=0x%lx, got=0x%lx\n", __func__, + (long unsigned) adr, (long unsigned) _data_read); return URJ_STATUS_OK; } @@ -666,8 +674,8 @@ ejtag_dma_bus_read_next (urj_bus_t *bus, uint32_t adr) { uint32_t tmp_value = _data_read; _data_read = ejtag_dma_read (bus, adr, get_sz (adr)); - urj_log (URJ_LOG_LEVEL_ALL, "%s:adr=0x%x, got=0x%x\n", __func__, adr, - _data_read); + urj_log (URJ_LOG_LEVEL_ALL, "%s:adr=0x%lx, got=0x%lx\n", __func__, + (long unsigned) adr, (long unsigned) _data_read); return tmp_value; } diff --git a/urjtag/src/bus/fjmem.c b/urjtag/src/bus/fjmem.c index 4dd846ff..64decac2 100644 --- a/urjtag/src/bus/fjmem.c +++ b/urjtag/src/bus/fjmem.c @@ -339,8 +339,10 @@ fjmem_query_blocks (urj_chain_t *chain, urj_part_t *part, urj_bus_t *bus) bl->end = bl->start + (1 << (bl->addr_width + bl->ashift)) - 1; urj_log (URJ_LOG_LEVEL_DEBUG, "block # %d\n", block_num); - urj_log (URJ_LOG_LEVEL_DEBUG, " start 0x%08x\n", bl->start); - urj_log (URJ_LOG_LEVEL_DEBUG, " end 0x%08x\n", bl->end); + urj_log (URJ_LOG_LEVEL_DEBUG, " start 0x%08lx\n", + (long unsigned) bl->start); + urj_log (URJ_LOG_LEVEL_DEBUG, " end 0x%08lx\n", + (long unsigned) bl->end); urj_log (URJ_LOG_LEVEL_DEBUG, " addr len %d\n", bl->addr_width); urj_log (URJ_LOG_LEVEL_DEBUG, " data len %d\n", bl->data_width); } diff --git a/urjtag/src/bus/s3c4510x.c b/urjtag/src/bus/s3c4510x.c index f69d099f..30be7238 100644 --- a/urjtag/src/bus/s3c4510x.c +++ b/urjtag/src/bus/s3c4510x.c @@ -434,7 +434,8 @@ s3c4510_bus_write (urj_bus_t *bus, uint32_t adr, uint32_t data) s3c4510_bus_setup_ctrl (bus, 0x01ffff); /* nOE=1, nRCS0 =1 */ urj_tap_chain_shift_data_registers (chain, 0); - urj_log (URJ_LOG_LEVEL_DEBUG, "URJ_BUS_WRITE %08x @ %08x\n", data, adr); + urj_log (URJ_LOG_LEVEL_DEBUG, "URJ_BUS_WRITE %08lx @ %08lx\n", + (long unsigned) data, (long unsigned) adr); } const urj_bus_driver_t urj_bus_s3c4510_bus = { diff --git a/urjtag/src/flash/cfi.c b/urjtag/src/flash/cfi.c index 6befe7da..5ccc0279 100644 --- a/urjtag/src/flash/cfi.c +++ b/urjtag/src/flash/cfi.c @@ -249,7 +249,8 @@ urj_flash_cfi_detect (urj_bus_t *bus, uint32_t adr, { write1 (0, CFI_CMD_READ_ARRAY1); urj_error_set (URJ_ERROR_OUT_OF_MEMORY, "malloc(%zd) fails", - tmp * sizeof (urj_flash_cfi_erase_block_region_t)); + (size_t) tmp + * sizeof (urj_flash_cfi_erase_block_region_t)); return URJ_STATUS_FAIL; } diff --git a/urjtag/src/tap/cable/cmd_xfer.c b/urjtag/src/tap/cable/cmd_xfer.c index 419d55c9..ec795e30 100644 --- a/urjtag/src/tap/cable/cmd_xfer.c +++ b/urjtag/src/tap/cable/cmd_xfer.c @@ -62,7 +62,7 @@ extend_cmd_buffer (urj_tap_cable_cx_cmd_t *cmd) if (cmd->buf == NULL) { urj_error_set (URJ_ERROR_OUT_OF_MEMORY, "realloc(%s,%zd) fails", - "cmd->buf", cmd->buf_len); + "cmd->buf", (size_t) cmd->buf_len); } return cmd->buf ? 1 : 0;