All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Andreas Färber" <andreas.faerber@web.de>
To: Julio Guerra <guerr@julio.in>
Cc: "Hervé Poussineau" <hpoussin@reactos.org>,
	qemu-ppc@nongnu.org, qemu-devel@nongnu.org,
	"Fabien Chouteau" <chouteau@adacore.com>,
	"Alexander Graf" <agraf@suse.de>
Subject: Re: [Qemu-devel] [PATCH] prep: Fix software reset
Date: Mon, 06 May 2013 02:35:09 +0200	[thread overview]
Message-ID: <5186FABD.9060302@web.de> (raw)
In-Reply-To: <1361027311-23437-1-git-send-email-guerr@julio.in>

Am 16.02.2013 16:08, schrieb Julio Guerra:
> The software reset of a PReP machine should reset the entire system
> and not only the processor. It occurs when changing the 7th bit of
> port 0092 from 0 to 1.
> 
> Adding a new variable in PReP's sysctrl_t to store the soft reset bit
> makes possible to be compliant with PReP specification :
> * reset the system when changing soft reset bit from 0 to 1.
> * the soft reset bit value is 1 after a soft reset.
> * Port 0092 is read/write.
> 
> qemu_system_reset_request() does the required job (calling the reset
> handlers) when the software reset is needed.
> 
> reset_irq is no longer needed, the CPU reset (calling ppc_prep_reset)
> is called when qemu_system_reset calls every reset handlers.
> 
> Signed-off-by: Julio Guerra <guerr@julio.in>
> ---
>  hw/ppc/prep.c | 13 ++++++++-----
>  1 file changed, 8 insertions(+), 5 deletions(-)
> 
> diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c
> index e06dded..64dab8b 100644
> --- a/hw/ppc/prep.c
> +++ b/hw/ppc/prep.c
> @@ -178,12 +178,12 @@ static const MemoryRegionOps PPC_XCSR_ops = {
> 
>  /* Fake super-io ports for PREP platform (Intel 82378ZB) */
>  typedef struct sysctrl_t {
> -    qemu_irq reset_irq;
>      M48t59State *nvram;
>      uint8_t state;
>      uint8_t syscontrol;
>      int contiguous_map;
>      int endian;
> +    uint8_t sreset;
>  } sysctrl_t;
> 
>  enum {
> @@ -203,9 +203,11 @@ static void PREP_io_800_writeb (void *opaque, uint32_t addr, uint32_t val)
>          /* Special port 92 */
>          /* Check soft reset asked */
>          if (val & 0x01) {
> -            qemu_irq_raise(sysctrl->reset_irq);
> +	    if (!sysctrl->sreset)
> +                qemu_system_reset_request();
> +            sysctrl->sreset = 1;
>          } else {
> -            qemu_irq_lower(sysctrl->reset_irq);
> +            sysctrl->sreset = 0;
>          }
>          /* Check LE mode */
>          if (val & 0x02) {

> @@ -267,7 +269,7 @@ static uint32_t PREP_io_800_readb (void *opaque, uint32_t addr)
>      switch (addr) {
>      case 0x0092:
>          /* Special port 92 */
> -        retval = 0x00;
> +        retval = (sysctrl->endian << 1)

Thanks, applied this bit to prep-up:
http://repo.or.cz/w/qemu/afaerber.git/shortlog/refs/heads/prep-up

Andreas

> | sysctrl->sreset;
>          break;
>      case 0x0800:
>          /* Motorola CPU configuration register */
> @@ -624,7 +626,8 @@ static void ppc_prep_init(QEMUMachineInitArgs *args)
>      }
>      isa_create_simple(isa_bus, "i8042");
> 
> -    sysctrl->reset_irq = first_cpu->irq_inputs[PPC6xx_INPUT_HRESET];
> +    sysctrl->sreset = 0;
> +    sysctrl->endian = 0;
>      /* System control ports */
>      register_ioport_read(0x0092, 0x01, 1, &PREP_io_800_readb, sysctrl);
>      register_ioport_write(0x0092, 0x01, 1, &PREP_io_800_writeb, sysctrl);
> --
> 1.8.1.2
> 

  parent reply	other threads:[~2013-05-06  0:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1361027311-23437-1-git-send-email-guerr@julio.in>
     [not found] ` <1FAF4038-C174-40E2-B400-4DE924D2BD21@suse.de>
     [not found]   ` <512B5832.6000807@web.de>
2013-04-03 13:59     ` [Qemu-devel] [Qemu-ppc] [PATCH] prep: Fix software reset Julio Guerra
2013-04-17  6:29     ` Julio Guerra
2013-04-17 10:45       ` Andreas Färber
2013-05-06  0:35 ` Andreas Färber [this message]
2013-05-06 11:14   ` [Qemu-devel] " Julio Guerra

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=5186FABD.9060302@web.de \
    --to=andreas.faerber@web.de \
    --cc=agraf@suse.de \
    --cc=chouteau@adacore.com \
    --cc=guerr@julio.in \
    --cc=hpoussin@reactos.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.