qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL 0/2] target-arm queue
@ 2016-11-28 13:51 Peter Maydell
  2016-11-28 13:51 ` [Qemu-devel] [PULL 1/2] generic-loader: file: Only set a PC if a CPU is specified Peter Maydell
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Peter Maydell @ 2016-11-28 13:51 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Hajnoczi

target-arm queue for 2.8 rc2: just two bugfixes.

thanks
-- PMM

The following changes since commit 00227fefd2059464cd2f59aed29944874c630e2f:

  Update version for v2.8.0-rc1 release (2016-11-22 22:29:08 +0000)

are available in the git repository at:

  git://git.linaro.org/people/pmaydell/qemu-arm.git tags/pull-target-arm-20161128

for you to fetch changes up to b77257d7bae26a0fca6a90af88d54ee2c45f5b61:

  arm: Create /chosen and /memory devicetree nodes if necessary (2016-11-28 11:32:34 +0000)

----------------------------------------------------------------
target-arm queue:
 * hw/arm/boot: fix crash handling device trees with no /chosen
   or /memory nodes
 * generic-loader: only set PC if a CPU is specified

----------------------------------------------------------------
Alistair Francis (1):
      generic-loader: file: Only set a PC if a CPU is specified

Guenter Roeck (1):
      arm: Create /chosen and /memory devicetree nodes if necessary

 hw/arm/boot.c            | 17 +++++++++++++++++
 hw/core/generic-loader.c |  7 ++++++-
 2 files changed, 23 insertions(+), 1 deletion(-)

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

* [Qemu-devel] [PULL 1/2] generic-loader: file: Only set a PC if a CPU is specified
  2016-11-28 13:51 [Qemu-devel] [PULL 0/2] target-arm queue Peter Maydell
@ 2016-11-28 13:51 ` Peter Maydell
  2016-11-28 13:51 ` [Qemu-devel] [PULL 2/2] arm: Create /chosen and /memory devicetree nodes if necessary Peter Maydell
  2016-11-29  9:28 ` [Qemu-devel] [PULL 0/2] target-arm queue Stefan Hajnoczi
  2 siblings, 0 replies; 4+ messages in thread
From: Peter Maydell @ 2016-11-28 13:51 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Hajnoczi

From: Alistair Francis <alistair.francis@xilinx.com>

This patch fixes the generic-loader file loading to only set the program
counter if a CPU is specified. This follows what is written in the
documentation and was always part of the original intention.

Signed-off-by: Alistair Francis <alistair.francis@xilinx.com>
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Message-id: 537bf4d08be7acf7a89b590cff69e19db7f0a6cd.1478908712.git.alistair.francis@xilinx.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 hw/core/generic-loader.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/hw/core/generic-loader.c b/hw/core/generic-loader.c
index 79ab6df..208f549 100644
--- a/hw/core/generic-loader.c
+++ b/hw/core/generic-loader.c
@@ -93,7 +93,12 @@ static void generic_loader_realize(DeviceState *dev, Error **errp)
                        "image");
             return;
         }
-        s->set_pc = true;
+        /* The user specified a file, only set the PC if they also specified
+         * a CPU to use.
+         */
+        if (s->cpu_num != CPU_NONE) {
+            s->set_pc = true;
+        }
     } else if (s->addr) {
         /* User is setting the PC */
         if (s->data || s->data_len || s->data_be) {
-- 
2.7.4

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

* [Qemu-devel] [PULL 2/2] arm: Create /chosen and /memory devicetree nodes if necessary
  2016-11-28 13:51 [Qemu-devel] [PULL 0/2] target-arm queue Peter Maydell
  2016-11-28 13:51 ` [Qemu-devel] [PULL 1/2] generic-loader: file: Only set a PC if a CPU is specified Peter Maydell
@ 2016-11-28 13:51 ` Peter Maydell
  2016-11-29  9:28 ` [Qemu-devel] [PULL 0/2] target-arm queue Stefan Hajnoczi
  2 siblings, 0 replies; 4+ messages in thread
From: Peter Maydell @ 2016-11-28 13:51 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Hajnoczi

From: Guenter Roeck <linux@roeck-us.net>

While customary, the /chosen and /memory devicetree nodes do not have to
exist. Create if necessary. Also create the /memory/device_type property
if needed.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Message-id: 1479346221-18474-1-git-send-email-linux@roeck-us.net
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 hw/arm/boot.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/hw/arm/boot.c b/hw/arm/boot.c
index 942416d..ff621e4 100644
--- a/hw/arm/boot.c
+++ b/hw/arm/boot.c
@@ -9,6 +9,7 @@
 
 #include "qemu/osdep.h"
 #include "qapi/error.h"
+#include <libfdt.h>
 #include "hw/hw.h"
 #include "hw/arm/arm.h"
 #include "hw/arm/linux-boot-if.h"
@@ -486,6 +487,17 @@ static int load_dtb(hwaddr addr, const struct arm_boot_info *binfo,
             g_free(nodename);
         }
     } else {
+        Error *err = NULL;
+
+        rc = fdt_path_offset(fdt, "/memory");
+        if (rc < 0) {
+            qemu_fdt_add_subnode(fdt, "/memory");
+        }
+
+        if (!qemu_fdt_getprop(fdt, "/memory", "device_type", NULL, &err)) {
+            qemu_fdt_setprop_string(fdt, "/memory", "device_type", "memory");
+        }
+
         rc = qemu_fdt_setprop_sized_cells(fdt, "/memory", "reg",
                                           acells, binfo->loader_start,
                                           scells, binfo->ram_size);
@@ -495,6 +507,11 @@ static int load_dtb(hwaddr addr, const struct arm_boot_info *binfo,
         }
     }
 
+    rc = fdt_path_offset(fdt, "/chosen");
+    if (rc < 0) {
+        qemu_fdt_add_subnode(fdt, "/chosen");
+    }
+
     if (binfo->kernel_cmdline && *binfo->kernel_cmdline) {
         rc = qemu_fdt_setprop_string(fdt, "/chosen", "bootargs",
                                      binfo->kernel_cmdline);
-- 
2.7.4

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

* Re: [Qemu-devel] [PULL 0/2] target-arm queue
  2016-11-28 13:51 [Qemu-devel] [PULL 0/2] target-arm queue Peter Maydell
  2016-11-28 13:51 ` [Qemu-devel] [PULL 1/2] generic-loader: file: Only set a PC if a CPU is specified Peter Maydell
  2016-11-28 13:51 ` [Qemu-devel] [PULL 2/2] arm: Create /chosen and /memory devicetree nodes if necessary Peter Maydell
@ 2016-11-29  9:28 ` Stefan Hajnoczi
  2 siblings, 0 replies; 4+ messages in thread
From: Stefan Hajnoczi @ 2016-11-29  9:28 UTC (permalink / raw)
  To: Peter Maydell; +Cc: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1364 bytes --]

On Mon, Nov 28, 2016 at 01:51:09PM +0000, Peter Maydell wrote:
> target-arm queue for 2.8 rc2: just two bugfixes.
> 
> thanks
> -- PMM
> 
> The following changes since commit 00227fefd2059464cd2f59aed29944874c630e2f:
> 
>   Update version for v2.8.0-rc1 release (2016-11-22 22:29:08 +0000)
> 
> are available in the git repository at:
> 
>   git://git.linaro.org/people/pmaydell/qemu-arm.git tags/pull-target-arm-20161128
> 
> for you to fetch changes up to b77257d7bae26a0fca6a90af88d54ee2c45f5b61:
> 
>   arm: Create /chosen and /memory devicetree nodes if necessary (2016-11-28 11:32:34 +0000)
> 
> ----------------------------------------------------------------
> target-arm queue:
>  * hw/arm/boot: fix crash handling device trees with no /chosen
>    or /memory nodes
>  * generic-loader: only set PC if a CPU is specified
> 
> ----------------------------------------------------------------
> Alistair Francis (1):
>       generic-loader: file: Only set a PC if a CPU is specified
> 
> Guenter Roeck (1):
>       arm: Create /chosen and /memory devicetree nodes if necessary
> 
>  hw/arm/boot.c            | 17 +++++++++++++++++
>  hw/core/generic-loader.c |  7 ++++++-
>  2 files changed, 23 insertions(+), 1 deletion(-)

Thanks, applied to my staging tree:
https://github.com/stefanha/qemu/commits/staging

Stefan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]

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

end of thread, other threads:[~2016-11-29  9:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-28 13:51 [Qemu-devel] [PULL 0/2] target-arm queue Peter Maydell
2016-11-28 13:51 ` [Qemu-devel] [PULL 1/2] generic-loader: file: Only set a PC if a CPU is specified Peter Maydell
2016-11-28 13:51 ` [Qemu-devel] [PULL 2/2] arm: Create /chosen and /memory devicetree nodes if necessary Peter Maydell
2016-11-29  9:28 ` [Qemu-devel] [PULL 0/2] target-arm queue Stefan Hajnoczi

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).