From: Peter Delevoryas <peter@pjd.dev>
Cc: peter@pjd.dev, peter.maydell@linaro.org, andrew@aj.id.au,
joel@jms.id.au, qemu-arm@nongnu.org, qemu-devel@nongnu.org
Subject: [PATCH 0/2] hw/gpio/aspeed: Don't let guests modify input pins
Date: Thu, 7 Jul 2022 00:20:11 -0700 [thread overview]
Message-ID: <20220707072011.34582-1-peter@pjd.dev> (raw)
The fby35 OpenBMC sysvinit scripts check various GPIO pins at start and
decide where to start IPMB daemons for each slot in the sled (4 slots max).
It only starts an IPMB daemon if the slot GPIO pins indicate that it's
present and powered on.
I've been simulating some input pins by setting their value in the machine
reset function. I think a proper solution would be to add input pins to the
Aspeed GPIO code and create devices that force the pins high or low
appropriately, but for now setting the QOM property seemed fine.
But, I noticed that while the values were set initially, something in the
boot process resets all the values I set to "low". I imagine something in
userspace or the driver is blanket writing zero to the data registers. I
think the Aspeed GPIO controller probably shouldn't be changing the value of
input pins in this case.
To fix this, we could just make sure that aspeed_gpio_update() never sets
the value of an input pin. However, that would also prevent my code in
fby35_reset from initializing the input pins to some special value. So, to
support the QOM property setup use-case, I added a "force" parameter. Kinda
hacky, but it was the simplest thing I could think of.
Thanks,
Peter
Peter Delevoryas (2):
hw/gpio/aspeed: Don't let guests modify input pins
aspeed: Add fby35-bmc slot GPIO's
hw/arm/aspeed.c | 14 +++++++++++++-
hw/gpio/aspeed_gpio.c | 22 ++++++++++++----------
2 files changed, 25 insertions(+), 11 deletions(-)
--
2.36.1
next reply other threads:[~2022-07-07 7:28 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-07 7:20 Peter Delevoryas [this message]
[not found] <20220707071731.34047-1-peter@pjd.dev>
2022-07-07 7:26 ` [PATCH 0/2] hw/gpio/aspeed: Don't let guests modify input pins Peter Delevoryas
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=20220707072011.34582-1-peter@pjd.dev \
--to=peter@pjd.dev \
--cc=andrew@aj.id.au \
--cc=joel@jms.id.au \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.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).