qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] hw/arm/boot: Don't set up ATAGS for autogenerated dtb booting
@ 2013-12-29 14:20 Peter Maydell
  2013-12-30 20:31 ` Peter Crosthwaite
  0 siblings, 1 reply; 2+ messages in thread
From: Peter Maydell @ 2013-12-29 14:20 UTC (permalink / raw)
  To: qemu-devel; +Cc: kvmarm, patches

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: Peter Maydell <peter.maydell@linaro.org>
---
 hw/arm/boot.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/hw/arm/boot.c b/hw/arm/boot.c
index 1c1b0e5..4036262 100644
--- a/hw/arm/boot.c
+++ b/hw/arm/boot.c
@@ -173,6 +173,11 @@ static void default_reset_secondary(ARMCPU *cpu,
     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 { \
     stl_phys_notdirty(p, value);  \
     p += 4;                       \
@@ -421,7 +426,7 @@ static void do_cpu_reset(void *opaque)
                     env->regs[15] = info->loader_start;
                 }
 
-                if (!info->dtb_filename) {
+                if (!have_dtb(info)) {
                     if (old_param) {
                         set_kernel_args_old(info);
                     } else {
@@ -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
          * 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
              * kernels will trash anything in the 4K page the initrd
              * ends in, so make sure the DTB isn't caught up in that.
-- 
1.8.5

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH] hw/arm/boot: Don't set up ATAGS for autogenerated dtb booting
  2013-12-29 14:20 [Qemu-devel] [PATCH] hw/arm/boot: Don't set up ATAGS for autogenerated dtb booting Peter Maydell
@ 2013-12-30 20:31 ` Peter Crosthwaite
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Crosthwaite @ 2013-12-30 20:31 UTC (permalink / raw)
  To: Peter Maydell
  Cc: Patch Tracking, qemu-devel@nongnu.org Developers,
	kvmarm@lists.cs.columbia.edu

On Mon, Dec 30, 2013 at 12:20 AM, Peter Maydell
<peter.maydell@linaro.org> wrote:
> 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: Peter Maydell <peter.maydell@linaro.org>

Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>

> ---
>  hw/arm/boot.c | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/hw/arm/boot.c b/hw/arm/boot.c
> index 1c1b0e5..4036262 100644
> --- a/hw/arm/boot.c
> +++ b/hw/arm/boot.c
> @@ -173,6 +173,11 @@ static void default_reset_secondary(ARMCPU *cpu,
>      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 { \
>      stl_phys_notdirty(p, value);  \
>      p += 4;                       \
> @@ -421,7 +426,7 @@ static void do_cpu_reset(void *opaque)
>                      env->regs[15] = info->loader_start;
>                  }
>
> -                if (!info->dtb_filename) {
> +                if (!have_dtb(info)) {
>                      if (old_param) {
>                          set_kernel_args_old(info);
>                      } else {
> @@ -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
>           * 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
>               * kernels will trash anything in the 4K page the initrd
>               * ends in, so make sure the DTB isn't caught up in that.
> --
> 1.8.5
>
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-12-30 20:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-29 14:20 [Qemu-devel] [PATCH] hw/arm/boot: Don't set up ATAGS for autogenerated dtb booting Peter Maydell
2013-12-30 20:31 ` Peter Crosthwaite

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).