Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OS
U-Boot.Mirror
提交
9d2b18a0
U
U-Boot.Mirror
项目概览
OS
/
U-Boot.Mirror
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
U-Boot.Mirror
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
9d2b18a0
编写于
6月 28, 2003
作者:
W
wdenk
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Rewrite command lookup and help command (fix problems with bubble
sort when sorting command name list). Minor cleanup here and there.
上级
d1cbe85b
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
79 addition
and
80 deletion
+79
-80
CHANGELOG
CHANGELOG
+3
-0
common/cmd_bdinfo.c
common/cmd_bdinfo.c
+1
-0
common/cmd_bootm.c
common/cmd_bootm.c
+8
-1
common/cmd_mem.c
common/cmd_mem.c
+4
-2
common/command.c
common/command.c
+51
-41
lib_ppc/board.c
lib_ppc/board.c
+12
-36
未找到文件。
CHANGELOG
浏览文件 @
9d2b18a0
...
...
@@ -2,6 +2,9 @@
Changes since U-Boot 0.4.0:
======================================================================
* Rewrite command lookup and help command (fix problems with bubble
sort when sorting command name list). Minor cleanup here and there.
* Merge from "stable branch", tag LABEL_2003_06_28_1800-stable:
- Allow to call sysmon function interactively
- PIC on LWMON board needs delay after power-on
...
...
common/cmd_bdinfo.c
浏览文件 @
9d2b18a0
...
...
@@ -26,6 +26,7 @@
*/
#include <common.h>
#include <command.h>
#include <net.h>
/* for print_IPaddr */
#if (CONFIG_COMMANDS & CFG_CMD_BDI)
...
...
common/cmd_bootm.c
浏览文件 @
9d2b18a0
...
...
@@ -873,7 +873,14 @@ int do_bootd (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
}
cmd_tbl_t
U_BOOT_CMD
(
BOOTD
)
=
MK_CMD_ENTRY
(
"bootd"
,
1
,
1
,
do_bootd
,
"boot"
,
1
,
1
,
do_bootd
,
"boot - boot default, i.e., run 'bootcmd'
\n
"
,
NULL
);
/* keep old command name "bootd" for backward compatibility */
cmd_tbl_t
U_BOOT_CMD
(
BOOTD
)
=
MK_CMD_ENTRY
(
"bootd"
,
1
,
1
,
do_bootd
,
"bootd - boot default, i.e., run 'bootcmd'
\n
"
,
NULL
);
...
...
common/cmd_mem.c
浏览文件 @
9d2b18a0
...
...
@@ -36,8 +36,10 @@
#include <dataflash.h>
#endif
#if (CONFIG_COMMANDS & (CFG_CMD_MEMORY | CFG_CMD_PCI | CFG_CMD_I2C\
| CMD_CMD_PORTIO))
#if (CONFIG_COMMANDS & (CFG_CMD_MEMORY | \
CFG_CMD_I2C | \
CFG_CMD_PCI | \
CMD_CMD_PORTIO ) )
int
cmd_get_data_size
(
char
*
arg
,
int
default_size
)
{
/* Check for a size specification .b, .w or .l.
...
...
common/command.c
浏览文件 @
9d2b18a0
...
...
@@ -72,44 +72,44 @@ int do_help (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
if
(
argc
==
1
)
{
/*show list of commands */
int
cmd_items
=
(((
int
)
&
__u_boot_cmd_end
)
-
((
int
)
&
__u_boot_cmd_start
))
/
sizeof
(
*
cmdtp
);
int
end_sort
;
cmd_tbl_t
*
cmd_array
[(
cmd_items
+
1
)];
int
i
;
/* Make list of commands from .uboot_cmd section */
cmdtp
=
(
cmd_tbl_t
*
)
&
__u_boot_cmd_start
;
for
(
i
=
1
;
i
<=
cmd_items
;
i
++
)
{
cmd_array
[
i
]
=
cmdtp
;
cmdtp
++
;
int
cmd_items
=
&
__u_boot_cmd_end
-
&
__u_boot_cmd_start
;
/* pointer arith! */
cmd_tbl_t
*
cmd_array
[
cmd_items
];
int
i
,
j
,
swaps
;
/* Make array of commands from .uboot_cmd section */
cmdtp
=
&
__u_boot_cmd_start
;
for
(
i
=
0
;
i
<
cmd_items
;
i
++
)
{
cmd_array
[
i
]
=
cmdtp
++
;
}
/* Sort command list */
end_sort
=
0
;
for
(
i
=
1
;
end_sort
!=
1
||
i
<=
cmd_items
-
1
;
i
++
)
{
if
(
i
==
cmd_items
)
{
/* Last command */
end_sort
=
1
;
i
=
1
;
}
if
(
strcmp
(
cmd_array
[
i
]
->
name
,
cmd_array
[
i
+
1
]
->
name
)
>
0
)
{
end_sort
=
0
;
*
cmd_array
[
0
]
=
*
cmd_array
[
i
];
*
cmd_array
[
i
]
=
*
cmd_array
[
i
+
1
];
*
cmd_array
[
i
+
1
]
=
*
cmd_array
[
0
];
/* Sort command list (trivial bubble sort) */
for
(
i
=
cmd_items
-
1
;
i
>
0
;
--
i
)
{
swaps
=
0
;
for
(
j
=
0
;
j
<
i
;
++
j
)
{
if
(
strcmp
(
cmd_array
[
j
]
->
name
,
cmd_array
[
j
+
1
]
->
name
)
>
0
)
{
cmd_tbl_t
*
tmp
;
tmp
=
cmd_array
[
j
];
cmd_array
[
j
]
=
cmd_array
[
j
+
1
];
cmd_array
[
j
+
1
]
=
tmp
;
++
swaps
;
}
}
if
(
!
swaps
)
break
;
}
/* print short help (usage) */
for
(
cmdtp
=
(
cmd_tbl_t
*
)
&
__u_boot_cmd_start
;
cmdtp
!=
(
cmd_tbl_t
*
)
&
__u_boot_cmd_end
;
cmdtp
++
)
{
for
(
i
=
0
;
i
<
cmd_items
;
i
++
)
{
const
char
*
usage
=
cmd_array
[
i
]
->
usage
;
/* allow user abort */
if
(
ctrlc
())
return
1
;
if
(
cmdtp
->
usage
==
NULL
)
if
(
usage
==
NULL
)
continue
;
puts
(
cmdtp
->
usage
);
puts
(
usage
);
}
return
0
;
}
...
...
@@ -181,21 +181,31 @@ cmd_tbl_t U_BOOT_CMD(ECHO) = MK_CMD_ENTRY(
cmd_tbl_t
*
find_cmd
(
const
char
*
cmd
)
{
cmd_tbl_t
*
cmdtp
;
cmd_tbl_t
*
cmdtp_temp
=
&
__u_boot_cmd_start
;
/*Init value */
int
one_cmd_name
=
0
;
for
(
cmdtp
=
&
__u_boot_cmd_start
;
cmdtp
!=
&
__u_boot_cmd_end
;
cmdtp
++
)
{
if
((
strncmp
(
cmd
,
cmdtp
->
name
,
strlen
(
cmd
))
==
0
)
&&
(
strlen
(
cmd
)
==
strlen
(
cmdtp
->
name
)))
return
cmdtp
;
else
if
(
strncmp
(
cmd
,
cmdtp
->
name
,
strlen
(
cmd
))
==
0
)
{
cmdtp_temp
=
cmdtp
;
one_cmd_name
++
;
}
else
;
const
char
*
p
;
int
len
;
int
n_found
=
0
;
/*
* Some commands allow length modifiers (like "cp.b");
* compare command name only until first dot.
*/
len
=
((
p
=
strchr
(
cmd
,
'.'
))
==
NULL
)
?
strlen
(
cmd
)
:
(
p
-
cmd
);
for
(
cmdtp
=
&
__u_boot_cmd_start
;
cmdtp
!=
&
__u_boot_cmd_end
;
cmdtp
++
)
{
if
(
strncmp
(
cmd
,
cmdtp
->
name
,
len
)
==
0
)
{
if
(
len
==
strlen
(
cmdtp
->
name
))
return
cmdtp
;
/* full match */
cmdtp_temp
=
cmdtp
;
/* abbreviated command ? */
n_found
++
;
}
}
if
(
one_cmd_name
==
1
)
if
(
n_found
==
1
)
{
/* exactly one match */
return
cmdtp_temp
;
}
return
NULL
;
/* not found
|| one_cmd_name >2
*/
return
NULL
;
/* not found
or ambiguous command
*/
}
lib_ppc/board.c
浏览文件 @
9d2b18a0
...
...
@@ -401,9 +401,7 @@ void board_init_f (ulong bootflag)
#ifdef CONFIG_LOGBUFFER
/* reserve kernel log buffer */
addr
-=
(
LOGBUFF_RESERVE
);
# ifdef DEBUG
printf
(
"Reserving %ldk for kernel logbuffer at %08lx
\n
"
,
LOGBUFF_LEN
,
addr
);
# endif
debug
(
"Reserving %dk for kernel logbuffer at %08lx
\n
"
,
LOGBUFF_LEN
,
addr
);
#endif
#ifdef CONFIG_PRAM
...
...
@@ -413,16 +411,12 @@ void board_init_f (ulong bootflag)
i
=
getenv_r
(
"pram"
,
tmp
,
sizeof
(
tmp
));
reg
=
(
i
>
0
)
?
simple_strtoul
(
tmp
,
NULL
,
10
)
:
CONFIG_PRAM
;
addr
-=
(
reg
<<
10
);
/* size is in kB */
# ifdef DEBUG
printf
(
"Reserving %ldk for protected RAM at %08lx
\n
"
,
reg
,
addr
);
# endif
debug
(
"Reserving %ldk for protected RAM at %08lx
\n
"
,
reg
,
addr
);
#endif
/* CONFIG_PRAM */
/* round down to next 4 kB limit */
addr
&=
~
(
4096
-
1
);
#ifdef DEBUG
printf
(
"Top of RAM usable for U-Boot at: %08lx
\n
"
,
addr
);
#endif
debug
(
"Top of RAM usable for U-Boot at: %08lx
\n
"
,
addr
);
#ifdef CONFIG_LCD
/* reserve memory for LCD display (always full pages) */
...
...
@@ -443,9 +437,7 @@ void board_init_f (ulong bootflag)
addr
-=
len
;
addr
&=
~
(
4096
-
1
);
#ifdef DEBUG
printf
(
"Reserving %ldk for U-Boot at: %08lx
\n
"
,
len
>>
10
,
addr
);
#endif
debug
(
"Reserving %ldk for U-Boot at: %08lx
\n
"
,
len
>>
10
,
addr
);
#ifdef CONFIG_AMIGAONEG3SE
gd
->
relocaddr
=
addr
;
...
...
@@ -455,10 +447,8 @@ void board_init_f (ulong bootflag)
* reserve memory for malloc() arena
*/
addr_sp
=
addr
-
TOTAL_MALLOC_LEN
;
#ifdef DEBUG
printf
(
"Reserving %dk for malloc() at: %08lx
\n
"
,
debug
(
"Reserving %dk for malloc() at: %08lx
\n
"
,
TOTAL_MALLOC_LEN
>>
10
,
addr_sp
);
#endif
/*
* (permanently) allocate a Board Info struct
...
...
@@ -467,16 +457,12 @@ void board_init_f (ulong bootflag)
addr_sp
-=
sizeof
(
bd_t
);
bd
=
(
bd_t
*
)
addr_sp
;
gd
->
bd
=
bd
;
#ifdef DEBUG
printf
(
"Reserving %d Bytes for Board Info at: %08lx
\n
"
,
debug
(
"Reserving %d Bytes for Board Info at: %08lx
\n
"
,
sizeof
(
bd_t
),
addr_sp
);
#endif
addr_sp
-=
sizeof
(
gd_t
);
id
=
(
gd_t
*
)
addr_sp
;
#ifdef DEBUG
printf
(
"Reserving %d Bytes for Global Data at: %08lx
\n
"
,
debug
(
"Reserving %d Bytes for Global Data at: %08lx
\n
"
,
sizeof
(
gd_t
),
addr_sp
);
#endif
/*
* Finally, we set up a new (bigger) stack.
...
...
@@ -488,9 +474,7 @@ void board_init_f (ulong bootflag)
addr_sp
&=
~
0xF
;
*
((
ulong
*
)
addr_sp
)
--
=
0
;
*
((
ulong
*
)
addr_sp
)
--
=
0
;
#ifdef DEBUG
printf
(
"Stack Pointer at: %08lx
\n
"
,
addr_sp
);
#endif
debug
(
"Stack Pointer at: %08lx
\n
"
,
addr_sp
);
/*
* Save local variables to board info struct
...
...
@@ -536,9 +520,7 @@ void board_init_f (ulong bootflag)
#endif
#endif
#ifdef DEBUG
printf
(
"New Stack Pointer is: %08lx
\n
"
,
addr_sp
);
#endif
debug
(
"New Stack Pointer is: %08lx
\n
"
,
addr_sp
);
WATCHDOG_RESET
();
...
...
@@ -588,9 +570,7 @@ void board_init_r (gd_t *id, ulong dest_addr)
gd
->
flags
|=
GD_FLG_RELOC
;
/* tell others: relocation done */
#ifdef DEBUG
printf
(
"Now running in RAM - U-Boot at: %08lx
\n
"
,
dest_addr
);
#endif
debug
(
"Now running in RAM - U-Boot at: %08lx
\n
"
,
dest_addr
);
WATCHDOG_RESET
();
...
...
@@ -847,9 +827,7 @@ void board_init_r (gd_t *id, ulong dest_addr)
defined(CONFIG_SPD823TS) )
WATCHDOG_RESET
();
# ifdef DEBUG
puts
(
"Reset Ethernet PHY
\n
"
);
# endif
debug
(
"Reset Ethernet PHY
\n
"
);
reset_phy
();
#endif
...
...
@@ -859,9 +837,7 @@ void board_init_r (gd_t *id, ulong dest_addr)
kgdb_init
();
#endif
#ifdef DEBUG
printf
(
"U-Boot relocated to %08lx
\n
"
,
dest_addr
);
#endif
debug
(
"U-Boot relocated to %08lx
\n
"
,
dest_addr
);
/*
* Enable Interrupts
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录