From: Peter Maydell <peter.maydell@linaro.org>
To: Maxim Uvarov <maxim.uvarov@linaro.org>
Cc: "Andrew Jones" <drjones@redhat.com>,
"Jose Marinho" <Jose.Marinho@arm.com>,
"QEMU Developers" <qemu-devel@nongnu.org>,
"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
tf-a@lists.trustedfirmware.org, qemu-arm <qemu-arm@nongnu.org>
Subject: Re: [PATCHv7 2/3] arm-virt: refactor gpios creation
Date: Tue, 19 Jan 2021 11:39:19 +0000 [thread overview]
Message-ID: <CAFEAcA-dcw_Qrej5r68oMeQgnskWJS0tmCCdyTAaapJtTtffVw@mail.gmail.com> (raw)
In-Reply-To: <20210115101126.4259-3-maxim.uvarov@linaro.org>
On Fri, 15 Jan 2021 at 10:11, Maxim Uvarov <maxim.uvarov@linaro.org> wrote:
>
> No functional change. Just refactor code to better
> support secure and normal world gpios.
>
> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
> ---
> @@ -847,21 +873,22 @@ static void create_gpio(const VirtMachineState *vms)
> qemu_fdt_setprop_string(vms->fdt, nodename, "clock-names", "apb_pclk");
> qemu_fdt_setprop_cell(vms->fdt, nodename, "phandle", phandle);
>
> - gpio_key_dev = sysbus_create_simple("gpio-key", -1,
> - qdev_get_gpio_in(pl061_dev, 3));
> - qemu_fdt_add_subnode(vms->fdt, "/gpio-keys");
> - qemu_fdt_setprop_string(vms->fdt, "/gpio-keys", "compatible", "gpio-keys");
> - qemu_fdt_setprop_cell(vms->fdt, "/gpio-keys", "#size-cells", 0);
> - qemu_fdt_setprop_cell(vms->fdt, "/gpio-keys", "#address-cells", 1);
> + if (gpio == VIRT_GPIO) {
> + qemu_fdt_setprop_string(vms->fdt, "/chosen", "stdout-path", nodename);
You don't want to set /chosen/stdout-path (that is specific to the
uart, it's telling the kernel where it should send its bootup
output by default).
> + } else {
> + /* Mark as not usable by the normal world */
> + qemu_fdt_setprop_string(vms->fdt, nodename, "status", "disabled");
> + qemu_fdt_setprop_string(vms->fdt, nodename, "secure-status", "okay");
>
> - qemu_fdt_add_subnode(vms->fdt, "/gpio-keys/poweroff");
> - qemu_fdt_setprop_string(vms->fdt, "/gpio-keys/poweroff",
> - "label", "GPIO Key Poweroff");
> - qemu_fdt_setprop_cell(vms->fdt, "/gpio-keys/poweroff", "linux,code",
> - KEY_POWER);
> - qemu_fdt_setprop_cells(vms->fdt, "/gpio-keys/poweroff",
> - "gpios", phandle, 3, 0);
> + qemu_fdt_setprop_string(vms->fdt, "/secure-chosen", "stdout-path",
> + nodename);
> + }
Similarly here you don't want to set /secure-chosen/stdout-path.
Patch looks OK otherwise.
thanks
-- PMM
next prev parent reply other threads:[~2021-01-19 11:41 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-15 10:11 [PATCHv7 0/3] arm-virt: add secure pl061 for reset/power down Maxim Uvarov
2021-01-15 10:11 ` [PATCHv7 1/3] hw: gpio: implement gpio-pwr driver for qemu reset/poweroff Maxim Uvarov
2021-01-19 11:36 ` Peter Maydell
2021-01-15 10:11 ` [PATCHv7 2/3] arm-virt: refactor gpios creation Maxim Uvarov
2021-01-19 11:39 ` Peter Maydell [this message]
2021-01-15 10:11 ` [PATCHv7 3/3] arm-virt: add secure pl061 for reset/power down Maxim Uvarov
2021-01-19 13:07 ` Peter Maydell
2021-01-19 13:47 ` Maxim Uvarov
2021-01-19 14:12 ` Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAFEAcA-dcw_Qrej5r68oMeQgnskWJS0tmCCdyTAaapJtTtffVw@mail.gmail.com \
--to=peter.maydell@linaro.org \
--cc=Jose.Marinho@arm.com \
--cc=drjones@redhat.com \
--cc=f4bug@amsat.org \
--cc=maxim.uvarov@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=tf-a@lists.trustedfirmware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).