[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v1 3/3] hw/arm: xlnx-zcu102: Disable unsupported FDT firmware
From: |
Edgar E. Iglesias |
Subject: |
Re: [PATCH v1 3/3] hw/arm: xlnx-zcu102: Disable unsupported FDT firmware nodes |
Date: |
Thu, 23 Apr 2020 13:44:07 +0200 |
User-agent: |
Mutt/1.10.1 (2018-07-13) |
On Thu, Apr 23, 2020 at 12:21:11PM +0100, Peter Maydell wrote:
> On Sun, 19 Apr 2020 at 17:27, Edgar E. Iglesias
> <address@hidden> wrote:
> >
> > From: "Edgar E. Iglesias" <address@hidden>
> >
> > Disable unsupported FDT firmware nodes if a user passes us
> > a DTB with nodes enabled that the machine cannot support
> > due to lack of EL3 or EL2 support.
> >
> > Signed-off-by: Edgar E. Iglesias <address@hidden>
> > ---
> > hw/arm/xlnx-zcu102.c | 31 +++++++++++++++++++++++++++++++
> > 1 file changed, 31 insertions(+)
> > +static void zcu102_modify_dtb(const struct arm_boot_info *binfo, void *fdt)
> > +{
> > + XlnxZCU102 *s = container_of(binfo, XlnxZCU102, binfo);
> > + bool method_is_hvc;
> > + char **node_path;
> > + const char *r;
> > + int prop_len;
> > + int i;
> > +
> > + /* If EL3 is enabled, we keep all firmware nodes active. */
> > + if (!s->secure) {
> > + node_path = qemu_fdt_node_path(fdt, NULL,
> > + (char *)"xlnx,zynqmp-firmware",
> > + &error_fatal);
>
> Why do we need the 'char *' cast ?
Without it, I see the following warning but compat in
qemu_fdt_node_path should probably be changed to const char *.
I can make that change in a v2 if you prefer.
CC aarch64-softmmu/hw/arm/xlnx-zcu102.o
/home/edgar/src/c/qemu/qemu/hw/arm/xlnx-zcu102.c: In function
‘zcu102_modify_dtb’:
/home/edgar/src/c/qemu/qemu/hw/arm/xlnx-zcu102.c:84:40: error: passing argument
3 of ‘qemu_fdt_node_path’ discards ‘const’ qualifier from pointer target type
[-Werror=discarded-qualifiers]
84 | "xlnx,zynqmp-firmware",
| ^~~~~~~~~~~~~~~~~~~~~~
In file included from /home/edgar/src/c/qemu/qemu/hw/arm/xlnx-zcu102.c:26:
/home/edgar/src/c/qemu/qemu/include/sysemu/device_tree.h:46:8: note: expected
‘char *’ but argument is of type ‘const char *’
46 | char **qemu_fdt_node_path(void *fdt, const char *name, char *compat,
| ^~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[1]: *** [/home/edgar/src/c/qemu/qemu/rules.mak:69: hw/arm/xlnx-zcu102.o]
Error 1
make: *** [Makefile:527: aarch64-softmmu/all] Error 2
Cheers,
Edgar