qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: Chris Laplante <chris@laplante.io>
Cc: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: Re: Emulation of 'System OFF' mode in ARM nRF51 SoCs
Date: Mon, 3 Jul 2023 12:20:51 +0100	[thread overview]
Message-ID: <CAFEAcA-4A0Lzy2g2vk0Ja3Bw_j904ePMfD0Z9eNc5ZVkrLpfKA@mail.gmail.com> (raw)
In-Reply-To: <qy_CVPE85v6mhzp6uqOrcOH8ZTGsRDVzv4I4n1WWEjnOr4hSeYVEw9BvjbINNK7mCtMxWSyWBFhUGEZLSgAzJWPHZcfnEEX15e-kwZGEEGE=@laplante.io>

On Sat, 1 Jul 2023 at 20:29, Chris Laplante <chris@laplante.io> wrote:
>
> Hi Peter,
>
> > The reference manual is very unclear about what this "emulated
> > system off" mode actually does. I think that implementing
> > real "system off" is probably simpler. For that you should be able
> > to implement it something like this:
> >
> > (1) the power management device implements the SYSTEMOFF register
> > to call arm_set_cpu_off() when a 1 is written
> > (2) make sure the GPIO device implements DETECT as a GPIO output
> > signal, ie an outbound qemu_irq (if we don't do this already
> > the functionality will need to be added to the device model)
>
> Working on adding this now. One question - if the CPU is off (via arm_set_cpu_off), will the 'DETECT' IRQ I add to nrf51_gpio.c still fire?

Yes. The only thing that turning the CPU off affects is
the CPU -- all the rest of the devices in the system
continue to behave as normal.

> > (3) similarly for ANADETECT from the LPCOMP device
> > (4) Wire those qemu_irq GPIO outputs up to inputs on the
> > power management device. When the power management device
> > sees those signals go high and the CPU is in system off mode,
> > it should trigger the reset of the CPU by calling
> > arm_set_cpu_on_and_reset().
> >
>
> There is no power management IC or device in this system.

The manual says there is: chapter 12 describes the
power management and the registers involved, which are
in the POWER peripheral part of the SoC, starting at
0x4000_0000. QEMU just doesn't model that yet.

thanks
-- PMM


  reply	other threads:[~2023-07-03 11:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-14  2:27 Emulation of 'System OFF' mode in ARM nRF51 SoCs Chris Laplante
2023-06-19 11:01 ` Philippe Mathieu-Daudé
2023-07-01 19:29   ` Chris Laplante
2023-06-19 12:03 ` Peter Maydell
2023-07-01 19:29   ` Chris Laplante
2023-07-03 11:20     ` Peter Maydell [this message]
2023-07-06 22:13       ` Chris Laplante

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-4A0Lzy2g2vk0Ja3Bw_j904ePMfD0Z9eNc5ZVkrLpfKA@mail.gmail.com \
    --to=peter.maydell@linaro.org \
    --cc=chris@laplante.io \
    --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).