Require libfdt for arm/microblaze/ppc softmmu targets
cover Require libfdt for arm/microblaze/ppc softmmu targets
This patchset makes libfdt mandatory for building the ARM, MicroBlaze and PPC softmmu targets. These architectures need libfdt for at least some of their board models to be usefully functional, so now that we have an in-tree version of libfdt it's better to insist on using it rather than allowing users to build less-than-useful binaries.
NB: I have tested the ARM change, but only compile-tested PPC and MicroBlaze.
Peter Maydell (4):
configure: Require libfdt for arm, ppc, microblaze softmmu targets
arm: Remove CONFIG_FDT conditionals
microblaze: Remove CONFIG_FDT conditionals
ppc: Remove CONFIG_FDT conditionals
configure | 20 ++++++++++++++++++++ default-configs/ppc-softmmu.mak | 2 +- default-configs/ppc64-softmmu.mak | 4 ++-- default-configs/ppcemb-softmmu.mak | 2 +- hw/arm/boot.c | 7 ------- hw/microblaze/boot.c | 12 ------------ hw/ppc/ppc440_bamboo.c | 2 -- hw/ppc/spapr_vio.c | 6 ------ hw/ppc/virtex_ml507.c | 18 ------------------ 9 files changed, 24 insertions(+), 49 deletions(-)
Signature · 1 line
1.7.9.5
PATCH 1/4 configure: Require libfdt for arm, ppc, microblaze softmmu targets
A number of our softmmu targets (PPC, ARM, Microblaze) now more or less require flattened device tree support for various board models to work correctly. Make libfdt mandatory if the target list includes these, rather than building unhelpful half-functional binaries.
--- configure | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+)
configure +20 -0
@@ -2518,6 +2518,26 @@ fi ########################################## # fdt probe +# fdt support is mandatory for at least some target architectures, +# so insist on it if we're building those system emulators. +fdt_required=no +for target in $target_list; do + case $target in + arm*softmmu|ppc*softmmu|microblaze*softmmu) + fdt_required=yes + ;; + esac +done + +if test "$fdt_required" = "yes"; then + if test "$fdt" = "no"; then + error_exit "fdt disabled but some requested targets require it." \ + "You can turn off fdt only if you also disable all the system emulation" \ + "targets which need it (by specifying a cut down --target-list)." + fi + fdt=yes +fi + if test "$fdt" != "no" ; then fdt_libs="-lfdt" cat > $TMPC << EOF
Signature · 1 line
1.7.9.5
Re: [Qemu-devel] [PATCH 1/4] configure: Require libfdt for arm, ppc, microblaze softmmu targets
Quoted 6 lines · Peter Maydell
A number of our softmmu targets (PPC, ARM, Microblaze) now more or less require flattened device tree support for various board models to work correctly. Make libfdt mandatory if the target list includes these, rather than building unhelpful half-functional binaries.
Signed-off-by Peter Maydell <[email protected]>
Quoted 39 lines
--- configure | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+)configure +20
-1@@ -2518,6 +2518,26 @@ fi ########################################## # fdt probe +# fdt support is mandatory for at least some target architectures, +# so insist on it if we're building those system emulators. +fdt_required=no +for target in $target_list; do + case $target in + arm*softmmu|ppc*softmmu|microblaze*softmmu) + fdt_required=yes + ;; + esac +done + +if test "$fdt_required" = "yes"; then + if test "$fdt" = "no"; then + error_exit "fdt disabled but some requested targets require it." \ + "You can turn off fdt only if you also disable all the system emulation" \ + "targets which need it (by specifying a cut down --target-list)." + fi + fdt=yes +fi + if test "$fdt" != "no" ; then fdt_libs="-lfdt" cat > $TMPC << EOF --1.7.9.5
Re: [Qemu-devel] [PATCH 1/4] configure: Require libfdt for arm, ppc, microblaze softmmu targets
In reply to Peter MaydellAm 24.05.2013 17:26, schrieb Peter Maydell:
Quoted 15 lines
A number of our softmmu targets (PPC, ARM, Microblaze) now more or less require flattened device tree support for various board models to work correctly. Make libfdt mandatory if the target list includes these, rather than building unhelpful half-functional binaries.
Signed-off-by Peter Maydell <[email protected]>--- configure | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+)configure +0
-0
configure fi · line 2526
Quoted 9 lines
configure +6
-0@@ -2518,6 +2518,26 @@ fi ########################################## # fdt probe +# fdt support is mandatory for at least some target architectures, +# so insist on it if we're building those system emulators. +fdt_required=no +for target in $target_list; do + case $target in + arm*softmmu|ppc*softmmu|microblaze*softmmu)
Assuming you'll apply this through your tree, it would be more self-explanatory to use foo*-softmmu despite no practical difference.
I'm guessing arm* is in preparation for a future armeb-softmmu?
Otherwise looks good; still have testing pseries on my TODO list.
Andreas
Quoted 17 lines
configure +14
-0+ fdt_required=yes + ;; + esac +done + +if test "$fdt_required" = "yes"; then + if test "$fdt" = "no"; then + error_exit "fdt disabled but some requested targets require it." \ + "You can turn off fdt only if you also disable all the system emulation" \ + "targets which need it (by specifying a cut down --target-list)." + fi + fdt=yes +fi + if test "$fdt" != "no" ; then fdt_libs="-lfdt" cat > $TMPC << EOF
Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
Re: [Qemu-devel] [PATCH 1/4] configure: Require libfdt for arm, ppc, microblaze softmmu targets
Quoted 10 lines · Andreas Färber
Am 24.05.2013 17:26, schrieb Peter Maydell:
configure fi · line 2526
Quoted 6 lines
configure +6
-0+# fdt support is mandatory for at least some target architectures, +# so insist on it if we're building those system emulators. +fdt_required=no +for target in $target_list; do + case $target in + arm*softmmu|ppc*softmmu|microblaze*softmmu)Assuming you'll apply this through your tree, it would be more self-explanatory to use foo*-softmmu despite no practical difference.
Agreed.
Quoted 1 line
I'm guessing arm* is in preparation for a future armeb-softmmu?
Yes, also for consistency with ppc.
-- PMM
PATCH 2/4 arm: Remove CONFIG_FDT conditionals
In reply to Peter MaydellNow that we know we're compiling with libfdt, we can remove the CONFIG_FDT conditionals.
--- hw/arm/boot.c | 7 ------- 1 file changed, 7 deletions(-)
hw/arm/boot.c +0 -7
@@ -227,7 +227,6 @@ static void set_kernel_args_old(const struct arm_boot_info *info)static int load_dtb (hwaddr addr,const struct arm_boot_info *binfo) { -#ifdef CONFIG_FDT uint32_t *mem_reg_property;uint32_t mem_reg_propsize;void *fdt =NULL ;
@@ -308,12 +307,6 @@ static int load_dtb(hwaddr addr, const struct arm_boot_info *binfo)cpu_physical_memory_write (addr, fdt, size);return 0 ; - -#else -fprintf (stderr,"Device tree requested, " -"but qemu was compiled without fdt support\n" ); -return -1 ; -#endif }static void do_cpu_reset (void *opaque)
Signature · 1 line
1.7.9.5
Re: [Qemu-devel] [PATCH 2/4] arm: Remove CONFIG_FDT conditionals
Quoted 4 lines · Peter Maydell
Now that we know we're compiling with libfdt, we can remove the
CONFIG_FDTconditionals.Signed-off-by Peter Maydell <[email protected]>
Quoted 33 lines
--- hw/arm/boot.c | 7 ------- 1 file changed, 7 deletions(-)hw/arm/boot.c +0
-8@@ -227,7 +227,6 @@ static void set_kernel_args_old(const struct arm_boot_info *info)static int load_dtb (hwaddr addr,const struct arm_boot_info *binfo) { -#ifdef CONFIG_FDT uint32_t *mem_reg_property;uint32_t mem_reg_propsize;void *fdt =NULL ;@@ -308,12 +307,6 @@ static int load_dtb(hwaddr addr, const struct arm_boot_info *binfo)cpu_physical_memory_write (addr, fdt, size);return 0 ; - -#else -fprintf (stderr,"Device tree requested, " -"but qemu was compiled without fdt support\n" ); -return -1 ; -#endif }static void do_cpu_reset (void *opaque) --1.7.9.5
PATCH 3/4 microblaze: Remove CONFIG_FDT conditionals
In reply to Peter MaydellNow that we know we're compiling with libfdt we can remove the CONFIG_FDT conditionals.
--- hw/microblaze/boot.c | 12 ------------ 1 file changed, 12 deletions(-)
hw/microblaze/boot.c +0 -12
@@ -61,7 +61,6 @@ static int microblaze_load_dtb(hwaddr addr, const char *dtb_filename) {int fdt_size; -#ifdef CONFIG_FDT void *fdt =NULL ;int r;
@@ -81,17 +80,6 @@ static int microblaze_load_dtb(hwaddr addr, }cpu_physical_memory_write (addr, fdt, fdt_size); -#else -/* We lack libfdt so we cannot manipulate the fdt. Just pass on the blob -to the kernel. */ -if (dtb_filename) { - fdt_size =load_image_targphys (dtb_filename, addr,0x10000 ); - } -if (kernel_cmdline) { -fprintf (stderr, -"Warning: missing libfdt, cannot pass cmdline to kernel!\n" ); - } -#endif return fdt_size; }
Signature · 1 line
1.7.9.5
Re: [Qemu-devel] [PATCH 3/4] microblaze: Remove CONFIG_FDT conditionals
Quoted 4 lines · Peter Maydell
Now that we know we're compiling with libfdt we can remove the
CONFIG_FDTconditionals.Signed-off-by Peter Maydell <[email protected]>
Quoted 38 lines
--- hw/microblaze/boot.c | 12 ------------ 1 file changed, 12 deletions(-)hw/microblaze/boot.c +0
-13@@ -61,7 +61,6 @@ static int microblaze_load_dtb(hwaddr addr, const char *dtb_filename) {int fdt_size; -#ifdef CONFIG_FDT void *fdt =NULL ;int r;@@ -81,17 +80,6 @@ static int microblaze_load_dtb(hwaddr addr, }cpu_physical_memory_write (addr, fdt, fdt_size); -#else -/* We lack libfdt so we cannot manipulate the fdt. Just pass on the blob -to the kernel. */ -if (dtb_filename) { - fdt_size =load_image_targphys (dtb_filename, addr,0x10000 ); - } -if (kernel_cmdline) { -fprintf (stderr, -"Warning: missing libfdt, cannot pass cmdline to kernel!\n" ); - } -#endif return fdt_size; } --1.7.9.5
PATCH 4/4 ppc: Remove CONFIG_FDT conditionals
In reply to Peter MaydellNow that we know we're compiling with libfdt we can remove the CONFIG_FDT conditionals.
--- default-configs/ppc-softmmu.mak | 2 +- default-configs/ppc64-softmmu.mak | 4 ++-- default-configs/ppcemb-softmmu.mak | 2 +- hw/ppc/ppc440_bamboo.c | 2 -- hw/ppc/spapr_vio.c | 6 ------ hw/ppc/virtex_ml507.c | 18 ------------------ 6 files changed, 4 insertions(+), 30 deletions(-)
default-configs/ppc-softmmu.mak +1 -1
@@ -42,6 +42,6 @@ CONFIG_I8259=y CONFIG_XILINX=y CONFIG_XILINX_ETHLITE=y CONFIG_OPENPIC=y -CONFIG_E500=$(CONFIG_FDT) +CONFIG_E500=y # For PReP CONFIG_MC146818RTC=y
default-configs/ppc64-softmmu.mak +2 -2
@@ -42,8 +42,8 @@ CONFIG_I8259=y CONFIG_XILINX=y CONFIG_XILINX_ETHLITE=y CONFIG_OPENPIC=y -CONFIG_PSERIES=$(CONFIG_FDT) -CONFIG_E500=$(CONFIG_FDT) +CONFIG_PSERIES=y +CONFIG_E500=y # For pSeries CONFIG_PCI_HOTPLUG=y # For PReP
default-configs/ppcemb-softmmu.mak +1 -1
@@ -37,6 +37,6 @@ CONFIG_I8259=y CONFIG_XILINX=y CONFIG_XILINX_ETHLITE=y CONFIG_OPENPIC=y -CONFIG_E500=$(CONFIG_FDT) +CONFIG_E500=y # For PReP CONFIG_MC146818RTC=y
hw/ppc/ppc440_bamboo.c +0 -2
@@ -58,7 +58,6 @@ static int bamboo_load_device_tree(hwaddr addr, const char *kernel_cmdline) {int ret =-1 ; -#ifdef CONFIG_FDT uint32_t mem_reg_property[] = {0 ,0 ,cpu_to_be32 (ramsize) };char *filename;int fdt_size;
@@ -115,7 +114,6 @@ static int bamboo_load_device_tree(hwaddr addr,g_free (fdt); out: -#endif return ret; }
hw/ppc/spapr_vio.c +0 -6
@@ -34,9 +34,7 @@#include "hw/ppc/spapr_vio.h" #include "hw/ppc/xics.h" -#ifdef CONFIG_FDT #include <libfdt.h> -#endif /* CONFIG_FDT */ /* #define DEBUG_SPAPR */
@@ -94,7 +92,6 @@ VIOsPAPRDevice *spapr_vio_find_by_reg(VIOsPAPRBus *bus, uint32_t reg)return NULL ; } -#ifdef CONFIG_FDT static int vio_make_devnode (VIOsPAPRDevice *dev,void *fdt) {
@@ -159,7 +156,6 @@ static int vio_make_devnode(VIOsPAPRDevice *dev,return node_off; } -#endif /* CONFIG_FDT */ /* * CRQ handling
@@ -570,7 +566,6 @@ static void spapr_vio_register_types(void)type_init (spapr_vio_register_types) -#ifdef CONFIG_FDT static int compare_reg(const void *p1, const void *p2) {VIOsPAPRDevice const *dev1, *dev2;
@@ -655,4 +650,3 @@ int spapr_populate_chosen_stdout(void *fdt, VIOsPAPRBus *bus)return ret; } -#endif /* CONFIG_FDT */
hw/ppc/virtex_ml507.c +0 -18
@@ -141,7 +141,6 @@ static int xilinx_load_device_tree(hwaddr addr, {char *path;int fdt_size; -#ifdef CONFIG_FDT void *fdt;int r;
@@ -162,23 +161,6 @@ static int xilinx_load_device_tree(hwaddr addr,if (r <0 )fprintf (stderr,"couldn't set /chosen/bootargs\n" );cpu_physical_memory_write (addr, fdt, fdt_size); -#else -/* We lack libfdt so we cannot manipulate the fdt. Just pass on the blob -to the kernel. */ - fdt_size =load_image_targphys ("ppc.dtb" , addr,0x10000 ); -if (fdt_size <0 ) { - path =qemu_find_file (QEMU_FILE_TYPE_BIOS ,BINARY_DEVICE_TREE_FILE ); -if (path) { - fdt_size =load_image_targphys (path, addr,0x10000 ); -g_free (path); - } - } - -if (kernel_cmdline) { -fprintf (stderr, -"Warning: missing libfdt, cannot pass cmdline to kernel!\n" ); - } -#endif return fdt_size; }
Signature · 1 line
1.7.9.5
Quoted 9 lines · Peter Maydell
This patchset makes libfdt mandatory for building the ARM, MicroBlaze and PPC softmmu targets. These architectures need libfdt for at least some of their board models to be usefully functional, so now that we have an in-tree version of libfdt it's better to insist on using it rather than allowing users to build less-than-useful binaries.
NB: I have tested the ARM change, but only compile-tested PPC and MicroBlaze.
Hi,
I test ran the ppc virtex-ml507 and microblaze petalogix s3adsp images, works ok.
Cheers,
Edgar
Quoted 21 lines
Peter Maydell (4):
configure: Require libfdt for arm, ppc, microblaze softmmu targets
arm: RemoveCONFIG_FDTconditionals
microblaze: RemoveCONFIG_FDTconditionals
ppc: RemoveCONFIG_FDTconditionalsconfigure | 20 ++++++++++++++++++++ default-configs/ppc-softmmu.mak | 2 +- default-configs/ppc64-softmmu.mak | 4 ++-- default-configs/ppcemb-softmmu.mak | 2 +- hw/arm/boot.c | 7 ------- hw/microblaze/boot.c | 12 ------------ hw/ppc/ppc440_bamboo.c | 2 -- hw/ppc/spapr_vio.c | 6 ------ hw/ppc/virtex_ml507.c | 18 ------------------ 9 files changed, 24 insertions(+), 49 deletions(-)Signature · 1 line
1.7.9.5