mirror of
https://github.com/u-boot/u-boot.git
synced 2025-05-08 10:39:08 +00:00
Minor code cleanup
This commit is contained in:
parent
50814844e4
commit
b2f508075c
5 changed files with 27 additions and 27 deletions
|
@ -2,6 +2,8 @@
|
||||||
Changes for U-Boot 1.1.3:
|
Changes for U-Boot 1.1.3:
|
||||||
======================================================================
|
======================================================================
|
||||||
|
|
||||||
|
* Minor code cleanup
|
||||||
|
|
||||||
* Add forgotten new fils from latest VoiceBlue update
|
* Add forgotten new fils from latest VoiceBlue update
|
||||||
|
|
||||||
* Make bootretry feature work with hush shell.
|
* Make bootretry feature work with hush shell.
|
||||||
|
@ -26,7 +28,7 @@ Changes for U-Boot 1.1.3:
|
||||||
|
|
||||||
* Move the AT91RM9200DK to the ARM Systems list.
|
* Move the AT91RM9200DK to the ARM Systems list.
|
||||||
Patch by Anders Larsen, 26 Apr 2005
|
Patch by Anders Larsen, 26 Apr 2005
|
||||||
|
|
||||||
* Eliminate calls of ARM libgcc.a helper functions _divsi3 and _modsi3
|
* Eliminate calls of ARM libgcc.a helper functions _divsi3 and _modsi3
|
||||||
Patch by Anders Larsen, 26 Apr 2005
|
Patch by Anders Larsen, 26 Apr 2005
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,7 @@ SOBJS := setup.o
|
||||||
gcclibdir := $(shell dirname `$(CC) -print-libgcc-file-name`)
|
gcclibdir := $(shell dirname `$(CC) -print-libgcc-file-name`)
|
||||||
|
|
||||||
LOAD_ADDR = 0x10400000
|
LOAD_ADDR = 0x10400000
|
||||||
LDSCRIPT = $(TOPDIR)/board/$(BOARDDIR)/eeprom.lds
|
LDSCRIPT = $(TOPDIR)/board/$(BOARDDIR)/eeprom.lds
|
||||||
|
|
||||||
all: $(LIB) eeprom.srec eeprom.bin
|
all: $(LIB) eeprom.srec eeprom.bin
|
||||||
|
|
||||||
|
|
|
@ -146,7 +146,7 @@ int eeprom(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
int i, len, ret;
|
int i, len, ret;
|
||||||
unsigned char buf[58], *p;
|
unsigned char buf[58], *p;
|
||||||
|
|
||||||
app_startup(argv);
|
app_startup(argv);
|
||||||
if (get_version() != XF_VERSION) {
|
if (get_version() != XF_VERSION) {
|
||||||
printf("Wrong XF_VERSION.\n");
|
printf("Wrong XF_VERSION.\n");
|
||||||
|
@ -209,4 +209,3 @@ int eeprom(int argc, char *argv[])
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,5 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
.globl _start
|
.globl _start
|
||||||
_start: b eeprom
|
_start: b eeprom
|
||||||
|
|
||||||
|
|
40
net/net.c
40
net/net.c
|
@ -40,10 +40,10 @@
|
||||||
*
|
*
|
||||||
* DHCP:
|
* DHCP:
|
||||||
*
|
*
|
||||||
* Prerequisites: - own ethernet address
|
* Prerequisites: - own ethernet address
|
||||||
* We want: - IP, Netmask, ServerIP, Gateway IP
|
* We want: - IP, Netmask, ServerIP, Gateway IP
|
||||||
* - bootfilename, lease time
|
* - bootfilename, lease time
|
||||||
* Next step: - TFTP
|
* Next step: - TFTP
|
||||||
*
|
*
|
||||||
* TFTP:
|
* TFTP:
|
||||||
*
|
*
|
||||||
|
@ -67,7 +67,7 @@
|
||||||
*
|
*
|
||||||
* SNTP:
|
* SNTP:
|
||||||
*
|
*
|
||||||
* Prerequisites: - own ethernet address
|
* Prerequisites: - own ethernet address
|
||||||
* - own IP address
|
* - own IP address
|
||||||
* We want: - network time
|
* We want: - network time
|
||||||
* Next step: none
|
* Next step: none
|
||||||
|
@ -185,7 +185,7 @@ static int net_check_prereq (proto_t protocol);
|
||||||
IPaddr_t NetArpWaitPacketIP;
|
IPaddr_t NetArpWaitPacketIP;
|
||||||
IPaddr_t NetArpWaitReplyIP;
|
IPaddr_t NetArpWaitReplyIP;
|
||||||
uchar *NetArpWaitPacketMAC; /* MAC address of waiting packet's destination */
|
uchar *NetArpWaitPacketMAC; /* MAC address of waiting packet's destination */
|
||||||
uchar *NetArpWaitTxPacket; /* THE transmit packet */
|
uchar *NetArpWaitTxPacket; /* THE transmit packet */
|
||||||
int NetArpWaitTxPacketSize;
|
int NetArpWaitTxPacketSize;
|
||||||
uchar NetArpWaitPacketBuf[PKTSIZE_ALIGN + PKTALIGN];
|
uchar NetArpWaitPacketBuf[PKTSIZE_ALIGN + PKTALIGN];
|
||||||
ulong NetArpWaitTimerStart;
|
ulong NetArpWaitTimerStart;
|
||||||
|
@ -212,8 +212,8 @@ void ArpRequest (void)
|
||||||
arp->ar_pln = 4;
|
arp->ar_pln = 4;
|
||||||
arp->ar_op = htons (ARPOP_REQUEST);
|
arp->ar_op = htons (ARPOP_REQUEST);
|
||||||
|
|
||||||
memcpy (&arp->ar_data[0], NetOurEther, 6); /* source ET addr */
|
memcpy (&arp->ar_data[0], NetOurEther, 6); /* source ET addr */
|
||||||
NetWriteIP ((uchar *) & arp->ar_data[6], NetOurIP); /* source IP addr */
|
NetWriteIP ((uchar *) & arp->ar_data[6], NetOurIP); /* source IP addr */
|
||||||
for (i = 10; i < 16; ++i) {
|
for (i = 10; i < 16; ++i) {
|
||||||
arp->ar_data[i] = 0; /* dest ET addr = 0 */
|
arp->ar_data[i] = 0; /* dest ET addr = 0 */
|
||||||
}
|
}
|
||||||
|
@ -372,11 +372,11 @@ restart:
|
||||||
*/
|
*/
|
||||||
NetOurIP = 0;
|
NetOurIP = 0;
|
||||||
NetServerIP = getenv_IPaddr ("serverip");
|
NetServerIP = getenv_IPaddr ("serverip");
|
||||||
NetOurVLAN = getenv_VLAN("vlan"); /* VLANs must be read */
|
NetOurVLAN = getenv_VLAN("vlan"); /* VLANs must be read */
|
||||||
NetOurNativeVLAN = getenv_VLAN("nvlan");
|
NetOurNativeVLAN = getenv_VLAN("nvlan");
|
||||||
case CDP:
|
case CDP:
|
||||||
NetOurVLAN = getenv_VLAN("vlan"); /* VLANs must be read */
|
NetOurVLAN = getenv_VLAN("vlan"); /* VLANs must be read */
|
||||||
NetOurNativeVLAN = getenv_VLAN("nvlan");
|
NetOurNativeVLAN = getenv_VLAN("nvlan");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -1429,7 +1429,7 @@ NetReceive(volatile uchar * inpkt, int len)
|
||||||
|
|
||||||
#ifdef CONFIG_UDP_CHECKSUM
|
#ifdef CONFIG_UDP_CHECKSUM
|
||||||
if (ip->udp_xsum != 0) {
|
if (ip->udp_xsum != 0) {
|
||||||
ulong xsum;
|
ulong xsum;
|
||||||
ushort *sumptr;
|
ushort *sumptr;
|
||||||
ushort sumlen;
|
ushort sumlen;
|
||||||
|
|
||||||
|
@ -1444,24 +1444,24 @@ NetReceive(volatile uchar * inpkt, int len)
|
||||||
sumptr = (ushort *) &(ip->udp_src);
|
sumptr = (ushort *) &(ip->udp_src);
|
||||||
|
|
||||||
while (sumlen > 1) {
|
while (sumlen > 1) {
|
||||||
ushort sumdata;
|
ushort sumdata;
|
||||||
|
|
||||||
sumdata = *sumptr++;
|
sumdata = *sumptr++;
|
||||||
xsum += ntohs(sumdata);
|
xsum += ntohs(sumdata);
|
||||||
sumlen -= 2;
|
sumlen -= 2;
|
||||||
}
|
}
|
||||||
if (sumlen > 0) {
|
if (sumlen > 0) {
|
||||||
ushort sumdata;
|
ushort sumdata;
|
||||||
|
|
||||||
sumdata = *(unsigned char *) sumptr;
|
sumdata = *(unsigned char *) sumptr;
|
||||||
sumdata = (sumdata << 8) & 0xff00;
|
sumdata = (sumdata << 8) & 0xff00;
|
||||||
xsum += sumdata;
|
xsum += sumdata;
|
||||||
}
|
}
|
||||||
while ((xsum >> 16) != 0) {
|
while ((xsum >> 16) != 0) {
|
||||||
xsum = (xsum & 0x0000ffff) + ((xsum >> 16) & 0x0000ffff);
|
xsum = (xsum & 0x0000ffff) + ((xsum >> 16) & 0x0000ffff);
|
||||||
}
|
}
|
||||||
if ((xsum != 0x00000000) && (xsum != 0x0000ffff)) {
|
if ((xsum != 0x00000000) && (xsum != 0x0000ffff)) {
|
||||||
printf(" UDP wrong checksum %08x %08x\n", xsum, ntohs(ip->udp_xsum));
|
printf(" UDP wrong checksum %08x %08x\n", xsum, ntohs(ip->udp_xsum));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1517,7 +1517,7 @@ static int net_check_prereq (proto_t protocol)
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
#if (CONFIG_COMMANDS & (CFG_CMD_PING | CFG_CMD_SNTP))
|
#if (CONFIG_COMMANDS & (CFG_CMD_PING | CFG_CMD_SNTP))
|
||||||
common:
|
common:
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (NetOurIP == 0) {
|
if (NetOurIP == 0) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue