Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OS
U-Boot.Mirror
提交
34b5fc4d
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,发现更多精彩内容 >>
提交
34b5fc4d
编写于
4月 27, 2011
作者:
W
Wolfgang Denk
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' of
git://git.denx.de/u-boot-fdt
上级
547bea12
55b0a393
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
93 addition
and
52 deletion
+93
-52
README
README
+14
-2
arch/arm/lib/bootm.c
arch/arm/lib/bootm.c
+3
-2
arch/m68k/lib/bootm.c
arch/m68k/lib/bootm.c
+2
-5
arch/powerpc/lib/bootm.c
arch/powerpc/lib/bootm.c
+10
-9
common/cmd_bootm.c
common/cmd_bootm.c
+4
-3
common/fdt_support.c
common/fdt_support.c
+1
-1
common/image.c
common/image.c
+54
-18
include/configs/omap3_beagle.h
include/configs/omap3_beagle.h
+0
-7
include/image.h
include/image.h
+5
-5
未找到文件。
README
浏览文件 @
34b5fc4d
...
...
@@ -2348,7 +2348,10 @@ Configuration Settings:
used) must be put below this limit, unless "bootm_low"
enviroment variable is defined and non-zero. In such case
all data for the Linux kernel must be between "bootm_low"
and "bootm_low" + CONFIG_SYS_BOOTMAPSZ.
and "bootm_low" + CONFIG_SYS_BOOTMAPSZ. The environment
variable "bootm_mapsize" will override the value of
CONFIG_SYS_BOOTMAPSZ. If CONFIG_SYS_BOOTMAPSZ is undefined,
then the value in "bootm_size" will be used instead.
- CONFIG_SYS_BOOT_RAMDISK_HIGH:
Enable initrd_high functionality. If defined then the
...
...
@@ -3184,7 +3187,16 @@ List of environment variables (most likely not complete):
for use by the bootm command. See also "bootm_size"
environment variable. Address defined by "bootm_low" is
also the base of the initial memory mapping for the Linux
kernel -- see the description of CONFIG_SYS_BOOTMAPSZ.
kernel -- see the description of CONFIG_SYS_BOOTMAPSZ and
bootm_mapsize.
bootm_mapsize - Size of the initial memory mapping for the Linux kernel.
This variable is given as a hexadecimal number and it
defines the size of the memory region starting at base
address bootm_low that is accessible by the Linux kernel
during early boot. If unset, CONFIG_SYS_BOOTMAPSZ is used
as the default value if it is defined, and bootm_size is
used otherwise.
bootm_size - Memory range available for image processing in the bootm
command can be restricted. This variable is given as
...
...
arch/arm/lib/bootm.c
浏览文件 @
34b5fc4d
...
...
@@ -178,7 +178,6 @@ static int bootm_linux_fdt(int machid, bootm_headers_t *images)
{
ulong
rd_len
;
void
(
*
kernel_entry
)(
int
zero
,
int
dt_machid
,
void
*
dtblob
);
ulong
bootmap_base
=
getenv_bootm_low
();
ulong
of_size
=
images
->
ft_len
;
char
**
of_flat_tree
=
&
images
->
ft_addr
;
ulong
*
initrd_start
=
&
images
->
initrd_start
;
...
...
@@ -188,13 +187,15 @@ static int bootm_linux_fdt(int machid, bootm_headers_t *images)
kernel_entry
=
(
void
(
*
)(
int
,
int
,
void
*
))
images
->
ep
;
boot_fdt_add_mem_rsv_regions
(
lmb
,
*
of_flat_tree
);
rd_len
=
images
->
rd_end
-
images
->
rd_start
;
ret
=
boot_ramdisk_high
(
lmb
,
images
->
rd_start
,
rd_len
,
initrd_start
,
initrd_end
);
if
(
ret
)
return
ret
;
ret
=
boot_relocate_fdt
(
lmb
,
bootmap_base
,
of_flat_tree
,
&
of_size
);
ret
=
boot_relocate_fdt
(
lmb
,
of_flat_tree
,
&
of_size
);
if
(
ret
)
return
ret
;
...
...
arch/m68k/lib/bootm.c
浏览文件 @
34b5fc4d
...
...
@@ -71,7 +71,6 @@ int do_bootm_linux(int flag, int argc, char * const argv[], bootm_headers_t *ima
int
ret
;
ulong
cmd_start
,
cmd_end
;
ulong
bootmap_base
;
bd_t
*
kbd
;
void
(
*
kernel
)
(
bd_t
*
,
ulong
,
ulong
,
ulong
,
ulong
);
struct
lmb
*
lmb
=
&
images
->
lmb
;
...
...
@@ -79,17 +78,15 @@ int do_bootm_linux(int flag, int argc, char * const argv[], bootm_headers_t *ima
if
((
flag
!=
0
)
&&
(
flag
!=
BOOTM_STATE_OS_GO
))
return
1
;
bootmap_base
=
getenv_bootm_low
();
/* allocate space and init command line */
ret
=
boot_get_cmdline
(
lmb
,
&
cmd_start
,
&
cmd_end
,
bootmap_base
);
ret
=
boot_get_cmdline
(
lmb
,
&
cmd_start
,
&
cmd_end
);
if
(
ret
)
{
puts
(
"ERROR with allocation of cmdline
\n
"
);
goto
error
;
}
/* allocate space for kernel copy of board info */
ret
=
boot_get_kbd
(
lmb
,
&
kbd
,
bootmap_base
);
ret
=
boot_get_kbd
(
lmb
,
&
kbd
);
if
(
ret
)
{
puts
(
"ERROR with allocation of kernel bd
\n
"
);
goto
error
;
...
...
arch/powerpc/lib/bootm.c
浏览文件 @
34b5fc4d
...
...
@@ -96,7 +96,7 @@ static void boot_jump_linux(bootm_headers_t *images)
debug
(
" Booting using OF flat tree...
\n
"
);
WATCHDOG_RESET
();
(
*
kernel
)
((
bd_t
*
)
of_flat_tree
,
0
,
0
,
EPAPR_MAGIC
,
CONFIG_SYS_BOOTMAPSZ
,
0
,
0
);
getenv_bootm_mapsize
()
,
0
,
0
);
/* does not return */
}
else
#endif
...
...
@@ -186,7 +186,6 @@ static void boot_prep_linux(void)
static
int
boot_cmdline_linux
(
bootm_headers_t
*
images
)
{
ulong
bootmap_base
=
getenv_bootm_low
();
ulong
of_size
=
images
->
ft_len
;
struct
lmb
*
lmb
=
&
images
->
lmb
;
ulong
*
cmd_start
=
&
images
->
cmdline_start
;
...
...
@@ -196,7 +195,7 @@ static int boot_cmdline_linux(bootm_headers_t *images)
if
(
!
of_size
)
{
/* allocate space and init command line */
ret
=
boot_get_cmdline
(
lmb
,
cmd_start
,
cmd_end
,
bootmap_base
);
ret
=
boot_get_cmdline
(
lmb
,
cmd_start
,
cmd_end
);
if
(
ret
)
{
puts
(
"ERROR with allocation of cmdline
\n
"
);
return
ret
;
...
...
@@ -208,7 +207,6 @@ static int boot_cmdline_linux(bootm_headers_t *images)
static
int
boot_bd_t_linux
(
bootm_headers_t
*
images
)
{
ulong
bootmap_base
=
getenv_bootm_low
();
ulong
of_size
=
images
->
ft_len
;
struct
lmb
*
lmb
=
&
images
->
lmb
;
bd_t
**
kbd
=
&
images
->
kbd
;
...
...
@@ -217,7 +215,7 @@ static int boot_bd_t_linux(bootm_headers_t *images)
if
(
!
of_size
)
{
/* allocate space for kernel copy of board info */
ret
=
boot_get_kbd
(
lmb
,
kbd
,
bootmap_base
);
ret
=
boot_get_kbd
(
lmb
,
kbd
);
if
(
ret
)
{
puts
(
"ERROR with allocation of kernel bd
\n
"
);
return
ret
;
...
...
@@ -235,13 +233,16 @@ static int boot_body_linux(bootm_headers_t *images)
ulong
*
initrd_start
=
&
images
->
initrd_start
;
ulong
*
initrd_end
=
&
images
->
initrd_end
;
#if defined(CONFIG_OF_LIBFDT)
ulong
bootmap_base
=
getenv_bootm_low
();
ulong
of_size
=
images
->
ft_len
;
char
**
of_flat_tree
=
&
images
->
ft_addr
;
#endif
int
ret
;
#if defined(CONFIG_OF_LIBFDT)
boot_fdt_add_mem_rsv_regions
(
lmb
,
*
of_flat_tree
);
#endif
/* allocate space and init command line */
ret
=
boot_cmdline_linux
(
images
);
if
(
ret
)
...
...
@@ -257,8 +258,8 @@ static int boot_body_linux(bootm_headers_t *images)
if
(
ret
)
return
ret
;
#if defined(CONFIG_OF_LIBFDT)
&& defined(CONFIG_SYS_BOOTMAPSZ)
ret
=
boot_relocate_fdt
(
lmb
,
bootmap_base
,
of_flat_tree
,
&
of_size
);
#if defined(CONFIG_OF_LIBFDT)
ret
=
boot_relocate_fdt
(
lmb
,
of_flat_tree
,
&
of_size
);
if
(
ret
)
return
ret
;
...
...
@@ -296,7 +297,7 @@ static int boot_body_linux(bootm_headers_t *images)
if
(
*
initrd_start
&&
*
initrd_end
)
fdt_initrd
(
*
of_flat_tree
,
*
initrd_start
,
*
initrd_end
,
1
);
}
#endif
/* CONFIG_OF_LIBFDT
&& CONFIG_SYS_BOOTMAPSZ
*/
#endif
/* CONFIG_OF_LIBFDT */
return
0
;
}
...
...
common/cmd_bootm.c
浏览文件 @
34b5fc4d
...
...
@@ -544,11 +544,12 @@ int do_bootm_subcommand (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv
}
break
;
#endif
#if defined(CONFIG_OF_LIBFDT)
&& defined(CONFIG_SYS_BOOTMAPSZ)
#if defined(CONFIG_OF_LIBFDT)
case
BOOTM_STATE_FDT
:
{
ulong
bootmap_base
=
getenv_bootm_low
();
ret
=
boot_relocate_fdt
(
&
images
.
lmb
,
bootmap_base
,
boot_fdt_add_mem_rsv_regions
(
&
images
.
lmb
,
images
.
ft_addr
);
ret
=
boot_relocate_fdt
(
&
images
.
lmb
,
&
images
.
ft_addr
,
&
images
.
ft_len
);
break
;
}
...
...
common/fdt_support.c
浏览文件 @
34b5fc4d
...
...
@@ -183,7 +183,7 @@ int fdt_initrd(void *fdt, ulong initrd_start, ulong initrd_end, int force)
}
}
err
=
fdt_add_mem_rsv
(
fdt
,
initrd_start
,
initrd_end
-
initrd_start
+
1
);
err
=
fdt_add_mem_rsv
(
fdt
,
initrd_start
,
initrd_end
-
initrd_start
);
if
(
err
<
0
)
{
printf
(
"fdt_initrd: %s
\n
"
,
fdt_strerror
(
err
));
return
err
;
...
...
common/image.c
浏览文件 @
34b5fc4d
...
...
@@ -454,6 +454,22 @@ phys_size_t getenv_bootm_size(void)
#endif
}
phys_size_t
getenv_bootm_mapsize
(
void
)
{
phys_size_t
tmp
;
char
*
s
=
getenv
(
"bootm_mapsize"
);
if
(
s
)
{
tmp
=
(
phys_size_t
)
simple_strtoull
(
s
,
NULL
,
16
);
return
tmp
;
}
#if defined(CONFIG_SYS_BOOTMAPSZ)
return
CONFIG_SYS_BOOTMAPSZ
;
#else
return
getenv_bootm_size
();
#endif
}
void
memmove_wd
(
void
*
to
,
void
*
from
,
size_t
len
,
ulong
chunksz
)
{
if
(
to
==
from
)
...
...
@@ -1169,10 +1185,37 @@ static int fit_check_fdt (const void *fit, int fdt_noffset, int verify)
#define CONFIG_SYS_FDT_PAD 0x3000
#endif
#if defined(CONFIG_OF_LIBFDT)
/**
* boot_fdt_add_mem_rsv_regions - Mark the memreserve sections as unusable
* @lmb: pointer to lmb handle, will be used for memory mgmt
* @fdt_blob: pointer to fdt blob base address
*
* Adds the memreserve regions in the dtb to the lmb block. Adding the
* memreserve regions prevents u-boot from using them to store the initrd
* or the fdt blob.
*/
void
boot_fdt_add_mem_rsv_regions
(
struct
lmb
*
lmb
,
void
*
fdt_blob
)
{
uint64_t
addr
,
size
;
int
i
,
total
;
if
(
fdt_check_header
(
fdt_blob
)
!=
0
)
return
;
total
=
fdt_num_mem_rsv
(
fdt_blob
);
for
(
i
=
0
;
i
<
total
;
i
++
)
{
if
(
fdt_get_mem_rsv
(
fdt_blob
,
i
,
&
addr
,
&
size
)
!=
0
)
continue
;
printf
(
" reserving fdt memory region: addr=%llx size=%llx
\n
"
,
(
unsigned
long
long
)
addr
,
(
unsigned
long
long
)
size
);
lmb_reserve
(
lmb
,
addr
,
size
);
}
}
/**
* boot_relocate_fdt - relocate flat device tree
* @lmb: pointer to lmb handle, will be used for memory mgmt
* @bootmap_base: base address of the bootmap region
* @of_flat_tree: pointer to a char* variable, will hold fdt start address
* @of_size: pointer to a ulong variable, will hold fdt length
*
...
...
@@ -1187,9 +1230,7 @@ static int fit_check_fdt (const void *fit, int fdt_noffset, int verify)
* 0 - success
* 1 - failure
*/
#if defined(CONFIG_SYS_BOOTMAPSZ)
int
boot_relocate_fdt
(
struct
lmb
*
lmb
,
ulong
bootmap_base
,
char
**
of_flat_tree
,
ulong
*
of_size
)
int
boot_relocate_fdt
(
struct
lmb
*
lmb
,
char
**
of_flat_tree
,
ulong
*
of_size
)
{
void
*
fdt_blob
=
*
of_flat_tree
;
void
*
of_start
=
0
;
...
...
@@ -1209,7 +1250,7 @@ int boot_relocate_fdt (struct lmb *lmb, ulong bootmap_base,
/* Pad the FDT by a specified amount */
of_len
=
*
of_size
+
CONFIG_SYS_FDT_PAD
;
of_start
=
(
void
*
)(
unsigned
long
)
lmb_alloc_base
(
lmb
,
of_len
,
0x1000
,
(
CONFIG_SYS_BOOTMAPSZ
+
bootmap_base
));
getenv_bootm_mapsize
()
+
getenv_bootm_low
(
));
if
(
of_start
==
0
)
{
puts
(
"device tree - allocation error
\n
"
);
...
...
@@ -1238,7 +1279,7 @@ int boot_relocate_fdt (struct lmb *lmb, ulong bootmap_base,
error:
return
1
;
}
#endif
/* CONFIG_
SYS_BOOTMAPSZ
*/
#endif
/* CONFIG_
OF_LIBFDT
*/
/**
* boot_get_fdt - main fdt handling routine
...
...
@@ -1567,11 +1608,9 @@ error:
* @lmb: pointer to lmb handle, will be used for memory mgmt
* @cmd_start: pointer to a ulong variable, will hold cmdline start
* @cmd_end: pointer to a ulong variable, will hold cmdline end
* @bootmap_base: ulong variable, holds offset in physical memory to
* base of bootmap
*
* boot_get_cmdline() allocates space for kernel command line below
* BOOTMAPSZ +
bootmap_base
address. If "bootargs" U-boot environemnt
* BOOTMAPSZ +
getenv_bootm_low()
address. If "bootargs" U-boot environemnt
* variable is present its contents is copied to allocated kernel
* command line.
*
...
...
@@ -1579,14 +1618,13 @@ error:
* 0 - success
* -1 - failure
*/
int
boot_get_cmdline
(
struct
lmb
*
lmb
,
ulong
*
cmd_start
,
ulong
*
cmd_end
,
ulong
bootmap_base
)
int
boot_get_cmdline
(
struct
lmb
*
lmb
,
ulong
*
cmd_start
,
ulong
*
cmd_end
)
{
char
*
cmdline
;
char
*
s
;
cmdline
=
(
char
*
)(
ulong
)
lmb_alloc_base
(
lmb
,
CONFIG_SYS_BARGSIZE
,
0xf
,
CONFIG_SYS_BOOTMAPSZ
+
bootmap_base
);
getenv_bootm_mapsize
()
+
getenv_bootm_low
()
);
if
(
cmdline
==
NULL
)
return
-
1
;
...
...
@@ -1610,21 +1648,19 @@ int boot_get_cmdline (struct lmb *lmb, ulong *cmd_start, ulong *cmd_end,
* boot_get_kbd - allocate and initialize kernel copy of board info
* @lmb: pointer to lmb handle, will be used for memory mgmt
* @kbd: double pointer to board info data
* @bootmap_base: ulong variable, holds offset in physical memory to
* base of bootmap
*
* boot_get_kbd() allocates space for kernel copy of board info data below
* BOOTMAPSZ +
bootmap_base address and kernel board info is initialized with
* the current u-boot board info data.
* BOOTMAPSZ +
getenv_bootm_low() address and kernel board info is initialized
*
with
the current u-boot board info data.
*
* returns:
* 0 - success
* -1 - failure
*/
int
boot_get_kbd
(
struct
lmb
*
lmb
,
bd_t
**
kbd
,
ulong
bootmap_base
)
int
boot_get_kbd
(
struct
lmb
*
lmb
,
bd_t
**
kbd
)
{
*
kbd
=
(
bd_t
*
)(
ulong
)
lmb_alloc_base
(
lmb
,
sizeof
(
bd_t
),
0xf
,
CONFIG_SYS_BOOTMAPSZ
+
bootmap_base
);
getenv_bootm_mapsize
()
+
getenv_bootm_low
()
);
if
(
*
kbd
==
NULL
)
return
-
1
;
...
...
include/configs/omap3_beagle.h
浏览文件 @
34b5fc4d
...
...
@@ -56,13 +56,6 @@
#define CONFIG_MISC_INIT_R
#define CONFIG_OF_LIBFDT 1
/*
* The early kernel mapping on ARM currently only maps from the base of DRAM
* to the end of the kernel image. The kernel is loaded at DRAM base + 0x8000.
* The early kernel pagetable uses DRAM base + 0x4000 to DRAM base + 0x8000,
* so that leaves DRAM base to DRAM base + 0x4000 available.
*/
#define CONFIG_SYS_BOOTMAPSZ 0x4000
#define CONFIG_CMDLINE_TAG 1
/* enable passing of ATAGs */
#define CONFIG_SETUP_MEMORY_TAGS 1
...
...
include/image.h
浏览文件 @
34b5fc4d
...
...
@@ -336,8 +336,8 @@ int boot_get_ramdisk (int argc, char * const argv[], bootm_headers_t *images,
#ifdef CONFIG_OF_LIBFDT
int
boot_get_fdt
(
int
flag
,
int
argc
,
char
*
const
argv
[],
bootm_headers_t
*
images
,
char
**
of_flat_tree
,
ulong
*
of_size
);
int
boot_relocate_fdt
(
struct
lmb
*
lmb
,
ulong
bootmap_base
,
char
**
of_flat_tree
,
ulong
*
of_size
);
void
boot_fdt_add_mem_rsv_regions
(
struct
lmb
*
lmb
,
void
*
fdt_blob
);
int
boot_relocate_fdt
(
struct
lmb
*
lmb
,
char
**
of_flat_tree
,
ulong
*
of_size
);
#endif
#ifdef CONFIG_SYS_BOOT_RAMDISK_HIGH
...
...
@@ -345,11 +345,10 @@ int boot_ramdisk_high (struct lmb *lmb, ulong rd_data, ulong rd_len,
ulong
*
initrd_start
,
ulong
*
initrd_end
);
#endif
/* CONFIG_SYS_BOOT_RAMDISK_HIGH */
#ifdef CONFIG_SYS_BOOT_GET_CMDLINE
int
boot_get_cmdline
(
struct
lmb
*
lmb
,
ulong
*
cmd_start
,
ulong
*
cmd_end
,
ulong
bootmap_base
);
int
boot_get_cmdline
(
struct
lmb
*
lmb
,
ulong
*
cmd_start
,
ulong
*
cmd_end
);
#endif
/* CONFIG_SYS_BOOT_GET_CMDLINE */
#ifdef CONFIG_SYS_BOOT_GET_KBD
int
boot_get_kbd
(
struct
lmb
*
lmb
,
bd_t
**
kbd
,
ulong
bootmap_base
);
int
boot_get_kbd
(
struct
lmb
*
lmb
,
bd_t
**
kbd
);
#endif
/* CONFIG_SYS_BOOT_GET_KBD */
#endif
/* !USE_HOSTCC */
...
...
@@ -453,6 +452,7 @@ int image_check_dcrc (const image_header_t *hdr);
int
getenv_yesno
(
char
*
var
);
ulong
getenv_bootm_low
(
void
);
phys_size_t
getenv_bootm_size
(
void
);
phys_size_t
getenv_bootm_mapsize
(
void
);
void
memmove_wd
(
void
*
to
,
void
*
from
,
size_t
len
,
ulong
chunksz
);
#endif
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录