Patchwork [RFC,V1,11/14] vl.c: Added hw_dtb/kern_dtb command line opts

login
register
mail settings
Submitter Peter A. G. Crosthwaite
Date Aug. 25, 2011, 6:41 a.m.
Message ID <1314254480-22438-12-git-send-email-peter.crosthwaite@petalogix.com>
Download mbox | patch
Permalink /patch/111480/
State New
Headers show

Comments

Peter A. G. Crosthwaite - Aug. 25, 2011, 6:41 a.m.
Added command line options to specify device-tree-blobs for fdt generic
platforms. Different dtbs can be used for software and harware by using
both options concurrently

Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
---
 qemu-options.hx |   47 +++++++++++++++++++++++++++++++++++++++++++++++
 sysemu.h        |    4 ++++
 vl.c            |   19 +++++++++++++++++++
 3 files changed, 70 insertions(+), 0 deletions(-)

Patch

diff --git a/qemu-options.hx b/qemu-options.hx
index d86815d..b778471 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -2444,6 +2444,53 @@  Specify a trace file to log output traces to.
 ETEXI
 #endif
 
+HXCOMM Flat device-tree commandline options
+DEFHEADING()
+DEFHEADING(Flat device-tree options:)
+STEXI
+@table @option
+ETEXI
+
+DEF("hw-dtb", HAS_ARG, QEMU_OPTION_hwdtb, \
+    "-hw-dtb dtb      flat device tree describing hardware system\n",
+    QEMU_ARCH_MICROBLAZE | QEMU_ARCH_PPC)
+STEXI
+@item -hw-dtb @var{hw-dtb}
+use @var{hw-dtb} as flat device tree describing hardware system
+ETEXI
+
+DEF("kern-dtb", HAS_ARG, QEMU_OPTION_kerndtb, \
+    "-kern-dtb dtb   flat device tree passed to kernel boot\n",
+    QEMU_ARCH_MICROBLAZE | QEMU_ARCH_PPC)
+STEXI
+@item -kern-dtb @var{kern-dtb}
+use @var{kern-dtb} as flat device tree passed to kernel boot
+ETEXI
+
+STEXI
+@end table
+ETEXI
+
+
+HXCOMM AXIS device specific commandline options
+DEFHEADING()
+DEFHEADING(AXIS device options:)
+STEXI
+@table @option
+ETEXI
+
+DEF("bootsel", HAS_ARG, QEMU_OPTION_bootsel, \
+    "-bootsel      Reset value of boot select register\n",
+    QEMU_ARCH_CRIS | QEMU_ARCH_MIPS | QEMU_ARCH_ARM)
+STEXI
+@item -bootsel @var{bootsel}
+use @var{bootsel} as the reset value for the bootsel register.
+ETEXI
+
+STEXI
+@end table
+ETEXI
+
 HXCOMM This is the last statement. Insert new options before this line!
 STEXI
 @end table
diff --git a/sysemu.h b/sysemu.h
index 9090457..2108a67 100644
--- a/sysemu.h
+++ b/sysemu.h
@@ -122,6 +122,10 @@  extern int no_quit;
 extern int no_shutdown;
 extern int semihosting_enabled;
 extern int old_param;
+
+extern const char *qemu_hwdtb;
+extern const char *qemu_kerndtb;
+
 extern int boot_menu;
 extern uint8_t *boot_splash_filedata;
 extern int boot_splash_filedata_size;
diff --git a/vl.c b/vl.c
index 9cd67a3..38cc153 100644
--- a/vl.c
+++ b/vl.c
@@ -227,6 +227,10 @@  int alt_grab = 0;
 int ctrl_grab = 0;
 unsigned int nb_prom_envs = 0;
 const char *prom_envs[MAX_PROM_ENVS];
+#ifdef CONFIG_FDT
+const char *qemu_hwdtb = NULL;
+const char *qemu_kerndtb = NULL;
+#endif
 int boot_menu;
 uint8_t *boot_splash_filedata;
 int boot_splash_filedata_size;
@@ -2928,6 +2932,21 @@  int main(int argc, char **argv, char **envp)
                 }
                 xen_mode = XEN_ATTACH;
                 break;
+#ifdef CONFIG_FDT
+            case QEMU_OPTION_hwdtb:
+                qemu_hwdtb = optarg;
+                break;
+            case QEMU_OPTION_kerndtb:
+                qemu_kerndtb = optarg;
+                break;
+#else
+            case QEMU_OPTION_hwdtb:
+            case QEMU_OPTION_kerndtb:
+                printf("Option %s not supported by this qemu build"
+                    " (libfdt missing).\n", popt->name);
+                exit(1);
+                break;
+#endif
 #ifdef CONFIG_SIMPLE_TRACE
             case QEMU_OPTION_trace:
                 opts = qemu_opts_parse(qemu_find_opts("trace"), optarg, 0);