All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
To: BALATON Zoltan <balaton@eik.bme.hu>,
	qemu-devel@nongnu.org, qemu-ppc@nongnu.org
Cc: David Gibson <david@gibson.dropbear.id.au>,
	Howard Spoelstra <hsp.cat7@gmail.com>
Subject: Re: [PATCH v5 09/11] macio: Add dummy screamer register area
Date: Fri, 26 Jun 2020 14:12:34 +0100	[thread overview]
Message-ID: <3012998c-8345-f654-1de1-dd623ef375e8@ilande.co.uk> (raw)
In-Reply-To: <ecaaee4ba802b7a53de03e401c4d68e94de554f5.1592315226.git.balaton@eik.bme.hu>

On 16/06/2020 14:47, BALATON Zoltan wrote:

> The only thing this returns is an idle status so the firmware
> continues, otherwise just ignores and logs access for debugging. This
> is a stop gap until proper implementation of this device lands.
> 
> Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
> ---
>  hw/misc/macio/macio.c | 34 ++++++++++++++++++++++++++++++++++
>  1 file changed, 34 insertions(+)
> 
> diff --git a/hw/misc/macio/macio.c b/hw/misc/macio/macio.c
> index 8ba7af073c..c7e8556ca6 100644
> --- a/hw/misc/macio/macio.c
> +++ b/hw/misc/macio/macio.c
> @@ -26,6 +26,7 @@
>  #include "qemu/osdep.h"
>  #include "qapi/error.h"
>  #include "qemu/module.h"
> +#include "qemu/log.h"
>  #include "hw/ppc/mac.h"
>  #include "hw/misc/macio/cuda.h"
>  #include "hw/pci/pci.h"
> @@ -94,6 +95,33 @@ static void macio_bar_setup(MacIOState *s)
>      macio_escc_legacy_setup(s);
>  }
>  
> +#define AWAC_CODEC_STATUS_REG 0x20
> +
> +#define AWAC_MAKER_CRYSTAL 1
> +#define AWAC_REV_SCREAMER 3
> +#define AWAC_VALID_DATA 0x40
> +
> +static uint64_t screamer_read(void *opaque, hwaddr addr, unsigned size)
> +{
> +    qemu_log_mask(LOG_UNIMP,
> +                  "macio: screamer read %" HWADDR_PRIx "  %d\n", addr, size);
> +    return (addr == AWAC_CODEC_STATUS_REG ? AWAC_VALID_DATA << 8 |
> +            AWAC_MAKER_CRYSTAL << 16 | AWAC_REV_SCREAMER << 20 : 0);
> +}
> +
> +static void screamer_write(void *opaque, hwaddr addr,
> +                           uint64_t val, unsigned size)
> +{
> +    qemu_log_mask(LOG_UNIMP,
> +                  "macio: screamer write %" HWADDR_PRIx "  %d = %"PRIx64"\n",
> +                  addr, size, val);
> +}
> +
> +const MemoryRegionOps screamer_ops = {
> +    .read = screamer_read,
> +    .write = screamer_write,
> +};

static const.

>  static void macio_common_realize(PCIDevice *d, Error **errp)
>  {
>      MacIOState *s = MACIO(d);
> @@ -149,6 +177,7 @@ static void macio_oldworld_realize(PCIDevice *d, Error **errp)
>      DeviceState *pic_dev = DEVICE(os->pic);
>      Error *err = NULL;
>      SysBusDevice *sysbus_dev;
> +    MemoryRegion *screamer = g_new(MemoryRegion, 1);
>  
>      macio_common_realize(d, &err);
>      if (err) {
> @@ -208,6 +237,11 @@ static void macio_oldworld_realize(PCIDevice *d, Error **errp)
>          error_propagate(errp, err);
>          return;
>      }
> +
> +    /* Dummy screamer sound device */
> +    memory_region_init_io(screamer, OBJECT(d), &screamer_ops, NULL,
> +                          "screamer", 0x2000);
> +    memory_region_add_subregion(&s->bar, 0x14000, screamer);
>  }
>  
>  static void macio_init_ide(MacIOState *s, MACIOIDEState *ide, int index)

Again I'm wary of adding empty devices here as the main issue around the screamer
code (and why it has not been submitted upstream) is that it can cause random hangs
for MacOS on startup. Does it regress any MacOS 9 through 10.5 boot tests?

FWIW I've rebased the latest version of my screamer branch at
https://github.com/mcayland/qemu/commits/screamer to git master if you want to see if
any noise comes out.


ATB,

Mark.


  reply	other threads:[~2020-06-26 13:13 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-16 13:47 [PATCH v5 00/11] Mac Old World ROM experiment BALATON Zoltan
2020-06-16 13:47 ` [PATCH v5 05/11] grackle: Set revision in PCI config to match hardware BALATON Zoltan
2020-06-26 12:51   ` Mark Cave-Ayland
2020-06-16 13:47 ` [PATCH v5 09/11] macio: Add dummy screamer register area BALATON Zoltan
2020-06-26 13:12   ` Mark Cave-Ayland [this message]
2020-06-28 12:26     ` BALATON Zoltan
2020-06-28 14:08       ` BALATON Zoltan
2020-06-28 14:29         ` BALATON Zoltan
2020-06-28 14:53           ` BALATON Zoltan
2020-06-28 15:04             ` BALATON Zoltan
2020-06-16 13:47 ` [PATCH v5 08/11] mac_oldworld: Add machine ID register BALATON Zoltan
2020-06-26 13:07   ` Mark Cave-Ayland
2020-06-16 13:47 ` [PATCH v5 10/11] WIP macio/cuda: Attempt to add i2c support BALATON Zoltan
2020-06-28 12:37   ` [RFC PATCH] " BALATON Zoltan
2020-06-16 13:47 ` [PATCH v5 06/11] mac_oldworld: Rename ppc_heathrow_reset to ppc_heathrow_cpu_reset BALATON Zoltan
2020-06-26 12:55   ` Mark Cave-Ayland
2020-06-26 22:22     ` BALATON Zoltan
2020-06-16 13:47 ` [PATCH v5 07/11] mac_oldworld: Map macio to expected address at reset BALATON Zoltan
2020-06-26 13:03   ` Mark Cave-Ayland
2020-06-26 22:25     ` BALATON Zoltan
2020-06-16 13:47 ` [PATCH v5 02/11] mac_newworld: Allow loading binary ROM image BALATON Zoltan
2020-06-26 12:42   ` Mark Cave-Ayland
2020-06-16 13:47 ` [PATCH v5 11/11] mac_oldworld: Add SPD data to cover RAM BALATON Zoltan
2020-06-16 13:47 ` [PATCH v5 01/11] mac_oldworld: Allow loading binary ROM image BALATON Zoltan
2020-06-26 12:38   ` Mark Cave-Ayland
2020-06-26 21:57     ` BALATON Zoltan
2020-06-16 13:47 ` [PATCH v5 04/11] mac_oldworld: Drop some variables BALATON Zoltan
2020-06-26 12:46   ` Mark Cave-Ayland
2020-06-16 13:47 ` [PATCH v5 03/11] mac_oldworld: Drop a variable, use get_system_memory() directly BALATON Zoltan
2020-06-26 12:42   ` Mark Cave-Ayland
2020-06-26 10:21 ` [PATCH v5 00/11] Mac Old World ROM experiment BALATON Zoltan
2020-06-26 12:23   ` Mark Cave-Ayland
2020-06-28 18:34     ` BALATON Zoltan

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=3012998c-8345-f654-1de1-dd623ef375e8@ilande.co.uk \
    --to=mark.cave-ayland@ilande.co.uk \
    --cc=balaton@eik.bme.hu \
    --cc=david@gibson.dropbear.id.au \
    --cc=hsp.cat7@gmail.com \
    --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.