This is the mail archive of the
ecos-devel@sources.redhat.com
mailing list for the eCos project.
Re: RedBoot load command speedup
- From: jeroen dobbelaere <jeroen dot dobbelaere at acunia dot com>
- To: ecos-devel at sources dot redhat dot com
- Date: Mon, 01 Jul 2002 15:06:33 +0200
- Subject: Re: RedBoot load command speedup
- Organization: ACUNIA
Hi all,
I am experimenting with an xscale platform with a smc91c111 ethernet chip.
By using appended patch, I am able reducing the time to
download 32MByte (tftp) from >4 minutes to 20 seconds.
(Which becomes acceptable)
I think reducing those delay values _is_ important.
Greetings,
--
Jeroen Dobbelaere
Embedded Software Engineer
ACUNIA Embedded Solutions
http://www.acunia.com/aes
diff -ru ecos-orig/packages/io/eth/current/src/stand_alone/eth_drv.c ecos/packages/io/eth/current/src/stand_alone/eth_drv.c
--- ecos-orig/packages/io/eth/current/src/stand_alone/eth_drv.c Thu May 30 17:02:50 2002
+++ ecos/packages/io/eth/current/src/stand_alone/eth_drv.c Tue Jun 25 12:03:54 2002
@@ -266,7 +266,7 @@
int sg_len = 2;
void *dbg = CYGACC_CALL_IF_DBG_DATA();
int old_state;
- int wait_time = 5; // Timeout before giving up
+ int wait_time = 50000; // Timeout before giving up
void *eth_drv_old = 0;
if (dbg) {
@@ -287,7 +287,7 @@
while (!(sc->funs->can_send)(sc)) {
// Give driver a chance to service hardware
(sc->funs->poll)(sc);
- CYGACC_CALL_IF_DELAY_US(2*100000);
+ CYGACC_CALL_IF_DELAY_US(2*10);
if (--wait_time <= 0)
goto reset_and_out; // Give up on sending packet
}
@@ -310,14 +310,14 @@
(sc->funs->send)(sc, sg_list, sg_len, len+14, (CYG_ADDRWORD)&packet_sent);
- wait_time = 500;
+ wait_time = 50000;
while (1) {
(sc->funs->poll)(sc);
if(packet_sent)
break;
- CYGACC_CALL_IF_DELAY_US(2*1000);
+ CYGACC_CALL_IF_DELAY_US(2*10);
if (--wait_time <= 0)
goto reset_and_out; // Give up on sending packet
}
diff -ru ecos-orig/packages/redboot/current/src/net/udp.c ecos/packages/redboot/current/src/net/udp.c
--- ecos-orig/packages/redboot/current/src/net/udp.c Thu May 30 17:07:48 2002
+++ ecos/packages/redboot/current/src/net/udp.c Tue Jun 25 12:06:10 2002
@@ -242,7 +242,7 @@
{
int res, my_port, total_ms;
udp_socket_t skt;
- unsigned long start;
+ unsigned long timeout;
my_port = ntohs(local->sin_port);
if (__udp_install_listener(&skt, my_port, __udp_recvfrom_handler) < 0) {
@@ -252,15 +252,16 @@
recvfrom_len = len;
recvfrom_server = server;
total_ms = (timo->tv_sec * 1000) + (timo->tv_usec / 1000);
- start = MS_TICKS();
+ timeout = total_ms*500;
res = -1;
- while ((MS_TICKS_DELAY() - start) < total_ms) {
+ while (timeout--) {
__enet_poll(); // Handle the hardware
if (!recvfrom_buf) {
// Data have arrived
res = recvfrom_len;
break;
}
+ CYGACC_CALL_IF_DELAY_US(20);
}
__udp_remove_listener(my_port);
return res;