Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
u-boot-2015.04
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
vesta
u-boot-2015.04
Commits
7bc5ee07
Commit
7bc5ee07
authored
19 years ago
by
Wolfgang Denk
Browse files
Options
Downloads
Patches
Plain Diff
Prepare U-Boot for gcc-4.x
parent
61dada83
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
drivers/ns8382x.c
+2
-2
2 additions, 2 deletions
drivers/ns8382x.c
lib_ppc/board.c
+5
-2
5 additions, 2 deletions
lib_ppc/board.c
net/net.c
+2
-1
2 additions, 1 deletion
net/net.c
net/tftp.c
+20
-8
20 additions, 8 deletions
net/tftp.c
with
29 additions
and
13 deletions
drivers/ns8382x.c
+
2
−
2
View file @
7bc5ee07
...
@@ -745,7 +745,7 @@ static int
...
@@ -745,7 +745,7 @@ static int
ns8382x_send
(
struct
eth_device
*
dev
,
volatile
void
*
packet
,
int
length
)
ns8382x_send
(
struct
eth_device
*
dev
,
volatile
void
*
packet
,
int
length
)
{
{
u32
i
,
status
=
0
;
u32
i
,
status
=
0
;
u32
tx_stat
=
0
;
vu_long
tx_stat
=
0
;
/* Stop the transmitter */
/* Stop the transmitter */
OUTL
(
dev
,
TxOff
,
ChipCmd
);
OUTL
(
dev
,
TxOff
,
ChipCmd
);
...
@@ -771,7 +771,7 @@ ns8382x_send(struct eth_device *dev, volatile void *packet, int length)
...
@@ -771,7 +771,7 @@ ns8382x_send(struct eth_device *dev, volatile void *packet, int length)
/* restart the transmitter */
/* restart the transmitter */
OUTL
(
dev
,
TxOn
,
ChipCmd
);
OUTL
(
dev
,
TxOn
,
ChipCmd
);
for
(
i
=
0
;
(
(
vu_long
)
tx_stat
=
le32_to_cpu
(
txd
.
cmdsts
))
&
DescOwn
;
i
++
)
{
for
(
i
=
0
;
(
tx_stat
=
le32_to_cpu
(
txd
.
cmdsts
))
&
DescOwn
;
i
++
)
{
if
(
i
>=
TOUT_LOOP
)
{
if
(
i
>=
TOUT_LOOP
)
{
printf
(
"%s: tx error buffer not ready: txd.cmdsts %#X
\n
"
,
printf
(
"%s: tx error buffer not ready: txd.cmdsts %#X
\n
"
,
dev
->
name
,
tx_stat
);
dev
->
name
,
tx_stat
);
...
...
This diff is collapsed.
Click to expand it.
lib_ppc/board.c
+
5
−
2
View file @
7bc5ee07
...
@@ -352,6 +352,7 @@ void board_init_f (ulong bootflag)
...
@@ -352,6 +352,7 @@ void board_init_f (ulong bootflag)
bd_t
*
bd
;
bd_t
*
bd
;
ulong
len
,
addr
,
addr_sp
;
ulong
len
,
addr
,
addr_sp
;
ulong
*
s
;
gd_t
*
id
;
gd_t
*
id
;
init_fnc_t
**
init_fnc_ptr
;
init_fnc_t
**
init_fnc_ptr
;
#ifdef CONFIG_PRAM
#ifdef CONFIG_PRAM
...
@@ -471,8 +472,10 @@ void board_init_f (ulong bootflag)
...
@@ -471,8 +472,10 @@ void board_init_f (ulong bootflag)
*/
*/
addr_sp
-=
16
;
addr_sp
-=
16
;
addr_sp
&=
~
0xF
;
addr_sp
&=
~
0xF
;
*
((
ulong
*
)
addr_sp
)
--
=
0
;
s
=
(
ulong
*
)
addr_sp
;
*
((
ulong
*
)
addr_sp
)
--
=
0
;
*
s
--
=
0
;
*
s
--
=
0
;
addr_sp
=
(
ulong
)
s
;
debug
(
"Stack Pointer at: %08lx
\n
"
,
addr_sp
);
debug
(
"Stack Pointer at: %08lx
\n
"
,
addr_sp
);
/*
/*
...
...
This diff is collapsed.
Click to expand it.
net/net.c
+
2
−
1
View file @
7bc5ee07
...
@@ -1574,10 +1574,11 @@ unsigned
...
@@ -1574,10 +1574,11 @@ unsigned
NetCksum
(
uchar
*
ptr
,
int
len
)
NetCksum
(
uchar
*
ptr
,
int
len
)
{
{
ulong
xsum
;
ulong
xsum
;
ushort
*
p
=
ptr
;
xsum
=
0
;
xsum
=
0
;
while
(
len
--
>
0
)
while
(
len
--
>
0
)
xsum
+=
*
((
ushort
*
)
ptr
)
++
;
xsum
+=
*
p
++
;
xsum
=
(
xsum
&
0xffff
)
+
(
xsum
>>
16
);
xsum
=
(
xsum
&
0xffff
)
+
(
xsum
>>
16
);
xsum
=
(
xsum
&
0xffff
)
+
(
xsum
>>
16
);
xsum
=
(
xsum
&
0xffff
)
+
(
xsum
>>
16
);
return
(
xsum
&
0xffff
);
return
(
xsum
&
0xffff
);
...
...
This diff is collapsed.
Click to expand it.
net/tftp.c
+
20
−
8
View file @
7bc5ee07
...
@@ -106,6 +106,7 @@ TftpSend (void)
...
@@ -106,6 +106,7 @@ TftpSend (void)
volatile
uchar
*
pkt
;
volatile
uchar
*
pkt
;
volatile
uchar
*
xp
;
volatile
uchar
*
xp
;
int
len
=
0
;
int
len
=
0
;
volatile
ushort
*
s
;
/*
/*
* We will always be sending some sort of packet, so
* We will always be sending some sort of packet, so
...
@@ -117,7 +118,9 @@ TftpSend (void)
...
@@ -117,7 +118,9 @@ TftpSend (void)
case
STATE_RRQ
:
case
STATE_RRQ
:
xp
=
pkt
;
xp
=
pkt
;
*
((
ushort
*
)
pkt
)
++
=
htons
(
TFTP_RRQ
);
s
=
(
ushort
*
)
pkt
;
*
s
++
=
htons
(
TFTP_RRQ
);
pkt
=
(
uchar
*
)
s
;
strcpy
((
char
*
)
pkt
,
tftp_filename
);
strcpy
((
char
*
)
pkt
,
tftp_filename
);
pkt
+=
strlen
(
tftp_filename
)
+
1
;
pkt
+=
strlen
(
tftp_filename
)
+
1
;
strcpy
((
char
*
)
pkt
,
"octet"
);
strcpy
((
char
*
)
pkt
,
"octet"
);
...
@@ -135,15 +138,19 @@ TftpSend (void)
...
@@ -135,15 +138,19 @@ TftpSend (void)
case
STATE_DATA
:
case
STATE_DATA
:
case
STATE_OACK
:
case
STATE_OACK
:
xp
=
pkt
;
xp
=
pkt
;
*
((
ushort
*
)
pkt
)
++
=
htons
(
TFTP_ACK
);
s
=
(
ushort
*
)
pkt
;
*
((
ushort
*
)
pkt
)
++
=
htons
(
TftpBlock
);
*
s
++
=
htons
(
TFTP_ACK
);
*
s
++
=
htons
(
TftpBlock
);
pkt
=
(
uchar
*
)
s
;
len
=
pkt
-
xp
;
len
=
pkt
-
xp
;
break
;
break
;
case
STATE_TOO_LARGE
:
case
STATE_TOO_LARGE
:
xp
=
pkt
;
xp
=
pkt
;
*
((
ushort
*
)
pkt
)
++
=
htons
(
TFTP_ERROR
);
s
=
(
ushort
*
)
pkt
;
*
((
ushort
*
)
pkt
)
++
=
htons
(
3
);
*
s
++
=
htons
(
TFTP_ERROR
);
*
s
++
=
htons
(
3
);
pkt
=
(
uchar
*
)
s
;
strcpy
((
char
*
)
pkt
,
"File too large"
);
strcpy
((
char
*
)
pkt
,
"File too large"
);
pkt
+=
14
/*strlen("File too large")*/
+
1
;
pkt
+=
14
/*strlen("File too large")*/
+
1
;
len
=
pkt
-
xp
;
len
=
pkt
-
xp
;
...
@@ -151,8 +158,10 @@ TftpSend (void)
...
@@ -151,8 +158,10 @@ TftpSend (void)
case
STATE_BAD_MAGIC
:
case
STATE_BAD_MAGIC
:
xp
=
pkt
;
xp
=
pkt
;
*
((
ushort
*
)
pkt
)
++
=
htons
(
TFTP_ERROR
);
s
=
(
ushort
*
)
pkt
;
*
((
ushort
*
)
pkt
)
++
=
htons
(
2
);
*
s
++
=
htons
(
TFTP_ERROR
);
*
s
++
=
htons
(
2
);
pkt
=
(
uchar
*
)
s
;
strcpy
((
char
*
)
pkt
,
"File has bad magic"
);
strcpy
((
char
*
)
pkt
,
"File has bad magic"
);
pkt
+=
18
/*strlen("File has bad magic")*/
+
1
;
pkt
+=
18
/*strlen("File has bad magic")*/
+
1
;
len
=
pkt
-
xp
;
len
=
pkt
-
xp
;
...
@@ -167,6 +176,7 @@ static void
...
@@ -167,6 +176,7 @@ static void
TftpHandler
(
uchar
*
pkt
,
unsigned
dest
,
unsigned
src
,
unsigned
len
)
TftpHandler
(
uchar
*
pkt
,
unsigned
dest
,
unsigned
src
,
unsigned
len
)
{
{
ushort
proto
;
ushort
proto
;
ushort
*
s
;
if
(
dest
!=
TftpOurPort
)
{
if
(
dest
!=
TftpOurPort
)
{
return
;
return
;
...
@@ -180,7 +190,9 @@ TftpHandler (uchar * pkt, unsigned dest, unsigned src, unsigned len)
...
@@ -180,7 +190,9 @@ TftpHandler (uchar * pkt, unsigned dest, unsigned src, unsigned len)
}
}
len
-=
2
;
len
-=
2
;
/* warning: don't use increment (++) in ntohs() macros!! */
/* warning: don't use increment (++) in ntohs() macros!! */
proto
=
*
((
ushort
*
)
pkt
)
++
;
s
=
(
ushort
*
)
pkt
;
proto
=
*
s
++
;
pkt
=
(
uchar
*
)
s
;
switch
(
ntohs
(
proto
))
{
switch
(
ntohs
(
proto
))
{
case
TFTP_RRQ
:
case
TFTP_RRQ
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment