提交 83bfffec 编写于 作者: P Peter Maydell

hw/arm/boot: Don't set up ATAGS for autogenerated dtb booting

The code which decides whether to set up the ATAGS data structure on
reset was using the wrong conditional, which meant we were creating
an ATAGS structure when doing a device-tree boot if the dtb was
autogenerated by the board. This is harmless, but unnecessary, so
bring it in to line with user-provided-dtb boots.
Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
Reviewed-by: NPeter Crosthwaite <peter.crosthwaite@xilinx.com>
Message-id: 1388326833-656-1-git-send-email-peter.maydell@linaro.org
上级 360a6f2d
...@@ -173,6 +173,11 @@ static void default_reset_secondary(ARMCPU *cpu, ...@@ -173,6 +173,11 @@ static void default_reset_secondary(ARMCPU *cpu,
env->regs[15] = info->smp_loader_start; env->regs[15] = info->smp_loader_start;
} }
static inline bool have_dtb(const struct arm_boot_info *info)
{
return info->dtb_filename || info->get_dtb;
}
#define WRITE_WORD(p, value) do { \ #define WRITE_WORD(p, value) do { \
stl_phys_notdirty(p, value); \ stl_phys_notdirty(p, value); \
p += 4; \ p += 4; \
...@@ -421,7 +426,7 @@ static void do_cpu_reset(void *opaque) ...@@ -421,7 +426,7 @@ static void do_cpu_reset(void *opaque)
env->regs[15] = info->loader_start; env->regs[15] = info->loader_start;
} }
if (!info->dtb_filename) { if (!have_dtb(info)) {
if (old_param) { if (old_param) {
set_kernel_args_old(info); set_kernel_args_old(info);
} else { } else {
...@@ -542,7 +547,7 @@ void arm_load_kernel(ARMCPU *cpu, struct arm_boot_info *info) ...@@ -542,7 +547,7 @@ void arm_load_kernel(ARMCPU *cpu, struct arm_boot_info *info)
/* for device tree boot, we pass the DTB directly in r2. Otherwise /* for device tree boot, we pass the DTB directly in r2. Otherwise
* we point to the kernel args. * we point to the kernel args.
*/ */
if (info->dtb_filename || info->get_dtb) { if (have_dtb(info)) {
/* Place the DTB after the initrd in memory. Note that some /* Place the DTB after the initrd in memory. Note that some
* kernels will trash anything in the 4K page the initrd * kernels will trash anything in the 4K page the initrd
* ends in, so make sure the DTB isn't caught up in that. * ends in, so make sure the DTB isn't caught up in that.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册