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
master
Rutger Hofman 16 years ago
parent 4a1a29aa74
commit a837a66041

@ -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",

@ -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",

@ -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");

@ -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__,

@ -24,7 +24,7 @@
#include <sysdep.h>
// #include <unistd.h>
#include <unistd.h>
#include <stdio.h>
#include <string.h>
@ -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;
}

@ -38,8 +38,7 @@
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
// #include <unistd.h> /* usleep */
#include <sys/time.h> // nanosleep
#include <unistd.h> /* usleep */
#include <urjtag/log.h>
#include <urjtag/error.h>
@ -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);

@ -32,8 +32,7 @@
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
// #include <unistd.h> /* usleep */
#include <sys/time.h> // nanosleep
#include <unistd.h> /* usleep */
#include <urjtag/log.h>
#include <urjtag/error.h>
@ -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;
}
}

Loading…
Cancel
Save