From a837a66041365104620729c658c014fb06332e38 Mon Sep 17 00:00:00 2001 From: Rutger Hofman Date: Mon, 18 May 2009 11:33:40 +0000 Subject: [PATCH] Accidentally, put in nanosleep calls. Restore to usleep git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@1603 b68d4a1b-bc3d-0410-92ed-d4ac073336b7 --- urjtag/src/bus/ejtag.c | 2 +- urjtag/src/bus/ejtag_dma.c | 2 +- urjtag/src/bus/mpc824x.c | 14 +++++++++----- urjtag/src/bus/pxa2x0.c | 4 ++-- urjtag/src/cmd/cmd_usleep.c | 6 ++---- urjtag/src/flash/amd.c | 19 +++++-------------- urjtag/src/flash/amd_flash.c | 19 +++++-------------- 7 files changed, 25 insertions(+), 41 deletions(-) diff --git a/urjtag/src/bus/ejtag.c b/urjtag/src/bus/ejtag.c index cee059ec..77bba4ba 100644 --- a/urjtag/src/bus/ejtag.c +++ b/urjtag/src/bus/ejtag.c @@ -344,7 +344,7 @@ ejtag_bus_init (urj_bus_t *bus) printf ("EJTAG version: 3.1\n"); break; default: - printf ("EJTAG version: unknown (%lu)\n", EJTAG_VER); + printf ("EJTAG version: unknown (%d)\n", EJTAG_VER); } printf ("EJTAG Implementation flags:%s%s%s%s%s%s%s\n", (BP->impcode & (1 << 28)) ? " R3k" : " R4k", diff --git a/urjtag/src/bus/ejtag_dma.c b/urjtag/src/bus/ejtag_dma.c index 5f3dc8be..b7711426 100644 --- a/urjtag/src/bus/ejtag_dma.c +++ b/urjtag/src/bus/ejtag_dma.c @@ -425,7 +425,7 @@ ejtag_dma_bus_init (urj_bus_t *bus) printf ("EJTAG version: 2.6\n"); break; default: - printf ("EJTAG version: unknown (%lu)\n", EJTAG_VER); + printf ("EJTAG version: unknown (%d)\n", EJTAG_VER); } printf ("EJTAG Implementation flags:%s%s%s%s%s%s%s\n", (BP->impcode & (1 << 28)) ? " R3k" : " R4k", diff --git a/urjtag/src/bus/mpc824x.c b/urjtag/src/bus/mpc824x.c index 1b0e810b..dbd7e881 100644 --- a/urjtag/src/bus/mpc824x.c +++ b/urjtag/src/bus/mpc824x.c @@ -367,7 +367,8 @@ setup_address (urj_bus_t *bus, uint32_t a) { for (j = 0; j < 8; j++) if ((i * 8 + j) >= (23 - k)) - printf ("%1lu", (a >> (23 - (i * 8 + j))) & 1); + printf ("%1lu", + (long unsigned) ((a >> (23 - (i * 8 + j))) & 1)); else printf (" "); printf (" "); @@ -426,9 +427,11 @@ setup_data (urj_bus_t *bus, uint32_t adr, uint32_t d) { for (j = 0; j < 8; j++) if (REVBITS) - printf ("%1lu", (d >> (BUS_WIDTH - 1 - (i * 8 + j))) & 1); + printf ("%1lu", (long unsigned) + (d >> (BUS_WIDTH - 1 - (i * 8 + j))) & 1); else - printf ("%1lu", (d >> ((i * 8 + j))) & 1); + printf ("%1lu", (long unsigned) + (d >> ((i * 8 + j))) & 1); printf (" "); } printf ("\n"); @@ -470,9 +473,10 @@ get_data (urj_bus_t *bus, uint32_t adr) { for (j = 0; j < 8; j++) if (REVBITS) - printf ("%1lu", (d >> (BUS_WIDTH - 1 - (i * 8 + j))) & 1); + printf ("%1lu", (long unsigned) + (d >> (BUS_WIDTH - 1 - (i * 8 + j))) & 1); else - printf ("%1lu", (d >> ((i * 8 + j))) & 1); + printf ("%1lu", (long unsigned) (d >> ((i * 8 + j))) & 1); printf (" "); } printf ("\n"); diff --git a/urjtag/src/bus/pxa2x0.c b/urjtag/src/bus/pxa2x0.c index 60fecf0a..048df97e 100644 --- a/urjtag/src/bus/pxa2x0.c +++ b/urjtag/src/bus/pxa2x0.c @@ -359,7 +359,7 @@ pxa2xx_bus_area (urj_bus_t *bus, uint32_t adr, urj_bus_area_t *area) case 6: case 7: printf ("TODO - BOOT_SEL: %lu\n", - get_BOOT_DEF_BOOT_SEL (BOOT_DEF)); + (long unsigned) get_BOOT_DEF_BOOT_SEL (BOOT_DEF)); return URJ_STATUS_FAIL; default: printf ("BUG in the code, file %s, line %d.\n", __FILE__, @@ -458,7 +458,7 @@ pxa27x_bus_area (urj_bus_t *bus, uint32_t adr, urj_bus_area_t *area) case 6: case 7: printf ("TODO - BOOT_SEL: %lu\n", - get_BOOT_DEF_BOOT_SEL (BOOT_DEF)); + (long unsigned) get_BOOT_DEF_BOOT_SEL (BOOT_DEF)); return URJ_STATUS_FAIL; default: printf ("BUG in the code, file %s, line %d.\n", __FILE__, diff --git a/urjtag/src/cmd/cmd_usleep.c b/urjtag/src/cmd/cmd_usleep.c index 4724bb3d..6a4e5a75 100644 --- a/urjtag/src/cmd/cmd_usleep.c +++ b/urjtag/src/cmd/cmd_usleep.c @@ -24,7 +24,7 @@ #include -// #include +#include #include #include @@ -51,9 +51,7 @@ cmd_usleep_run (urj_chain_t *chain, char *params[]) if (urj_cmd_get_number (params[1], &usecs) != URJ_STATUS_OK) return URJ_STATUS_FAIL; - // usleep (usecs); - struct timespec req = { 0, usecs * 1000 }; - nanosleep (&req, NULL); + usleep (usecs); return URJ_STATUS_OK; } diff --git a/urjtag/src/flash/amd.c b/urjtag/src/flash/amd.c index bb9e0071..5ba61a8f 100644 --- a/urjtag/src/flash/amd.c +++ b/urjtag/src/flash/amd.c @@ -38,8 +38,7 @@ #include #include #include -// #include /* usleep */ -#include // nanosleep +#include /* usleep */ #include #include @@ -157,9 +156,7 @@ amdstatus29 (urj_flash_cfi_array_t *cfi_array, uint32_t adr, if ((data1 & dq5mask) == dq5mask) break; - // usleep (100); - struct timespec req = { 0, 100 * 1000 }; - nanosleep (&req, NULL); + usleep (100); } data1 = URJ_BUS_READ (bus, adr << o); @@ -202,9 +199,7 @@ amdstatus (urj_flash_cfi_array_t *cfi_array, uint32_t adr, int data) /* return URJ_STATUS_OK; */ urj_log (URJ_LOG_LEVEL_DEBUG, "amdstatus %d: %04lX/%04lX\n", timeout, (long unsigned)data1, (long unsigned)data2); - // usleep (100); - struct timespec req = { 0, 100 * 1000 }; - nanosleep (&req, NULL); + usleep (100); } urj_error_set (URJ_ERROR_FLASH, "hardware failure"); @@ -260,9 +255,7 @@ amdstatus (urj_flash_cfi_array_t *cfi_array, uint32_t adr, int data) timeout, (long unsigned) data1, (long unsigned) data2); else urj_log (URJ_LOG_LEVEL_NORMAL, "."); - // usleep (100); - struct timespec req = { 0, 100 * 1000 }; - nanosleep (&req, NULL); + usleep (100); data1 = data2; } @@ -512,9 +505,7 @@ amd_program_buffer_status (urj_flash_cfi_array_t *cfi_array, uint32_t adr, if ((data1 & dq5mask) == dq5mask) break; - // usleep (100); - struct timespec req = { 0, 100 * 1000 }; - nanosleep (&req, NULL); + usleep (100); } data1 = URJ_BUS_READ (bus, adr); diff --git a/urjtag/src/flash/amd_flash.c b/urjtag/src/flash/amd_flash.c index e3485ba2..f38d39e3 100644 --- a/urjtag/src/flash/amd_flash.c +++ b/urjtag/src/flash/amd_flash.c @@ -32,8 +32,7 @@ #include #include #include -// #include /* usleep */ -#include // nanosleep +#include /* usleep */ #include #include @@ -228,9 +227,7 @@ amd_29xx040_status (urj_bus_t *bus, uint32_t adr, unsigned short data) return URJ_STATUS_FAIL; } } - // usleep (50); - struct timespec req = { 0, 50 * 1000 }; - nanosleep (&req, NULL); + usleep (50); } urj_error_set (URJ_ERROR_FLASH, "hardware failure"); @@ -295,9 +292,7 @@ amd_29xx040_read_array (urj_flash_cfi_array_t *cfi_array) cfi_array->address + 0x555, 0x90); URJ_BUS_WRITE (cfi_array->bus, cfi_array->address + 0x2AA, 0x00); - // usleep (100); - struct timespec req = { 0, 100 * 1000 }; - nanosleep (&req, NULL); + usleep (100); var_forced_detection.unlock_bypass = AMD_STANDARD_MODE; } URJ_BUS_WRITE (cfi_array->bus, cfi_array->address + 0x0, 0x0F0); /* AMD reset */ @@ -320,9 +315,7 @@ amd_29xx040_erase_block (urj_flash_cfi_array_t *cfi_array, { URJ_BUS_WRITE (bus, cfi_array->address + 0x555, 0x90); URJ_BUS_WRITE (bus, cfi_array->address + 0x2AA, 0x00); - // usleep (100); - struct timespec req = { 0, 100 * 1000 }; - nanosleep (&req, NULL); + usleep (100); var_forced_detection.unlock_bypass = AMD_STANDARD_MODE; } @@ -369,9 +362,7 @@ amd_29xx040_program_single (urj_flash_cfi_array_t *cfi_array, URJ_BUS_WRITE (bus, cfi_array->address + 0x555, 0xaa); URJ_BUS_WRITE (bus, cfi_array->address + 0x2AA, 0x55); URJ_BUS_WRITE (bus, cfi_array->address + 0x555, 0x20); - // usleep (1000); - struct timespec req = { 0, 100 * 1000 }; - nanosleep (&req, NULL); + usleep (1000); var_forced_detection.unlock_bypass = AMD_BYPASS_UNLOCK_MODE; } }