qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/2] hw/misc/bcm2835_property: Add dummy Get/Set GPIO virt buf messages
@ 2021-10-17  7:48 Benjamin Herrenschmidt
  2021-11-18 15:24 ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 2+ messages in thread
From: Benjamin Herrenschmidt @ 2021-10-17  7:48 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-arm, Alex Bennée

Without these the RaspiOS kernel tries to ioremap some bogus address
and dumps a backtrace in the console at boot. These work around it.

The virt-gpio driver still fails to initialize but much more cleanly

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
 hw/misc/bcm2835_property.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/hw/misc/bcm2835_property.c b/hw/misc/bcm2835_property.c
index b958fa6a5c..62037c0630 100644
--- a/hw/misc/bcm2835_property.c
+++ b/hw/misc/bcm2835_property.c
@@ -274,6 +274,13 @@ static void bcm2835_property_mbox_push(BCM2835PropertyState *s, uint32_t value)
             resplen = 4;
             break;
 
+        case 0x00048020: /* Set GPIO virt buf */
+            /* fall through */
+        case 0x00040010: /* Get GPIO virt buf */
+            stl_le_phys(&s->dma_as, value + 12, 0);
+            resplen = 4;
+            break;
+
         case 0x00060001: /* Get DMA channels */
             /* channels 2-5 */
             stl_le_phys(&s->dma_as, value + 12, 0x003C);




^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 2/2] hw/misc/bcm2835_property: Add dummy Get/Set GPIO virt buf messages
  2021-10-17  7:48 [PATCH 2/2] hw/misc/bcm2835_property: Add dummy Get/Set GPIO virt buf messages Benjamin Herrenschmidt
@ 2021-11-18 15:24 ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 2+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-11-18 15:24 UTC (permalink / raw)
  To: Benjamin Herrenschmidt, qemu-devel; +Cc: qemu-arm

Hi Benjamin,

On 10/17/21 09:48, Benjamin Herrenschmidt wrote:
> Without these the RaspiOS kernel tries to ioremap some bogus address
> and dumps a backtrace in the console at boot. These work around it.
> 
> The virt-gpio driver still fails to initialize but much more cleanly
> 
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> ---
>  hw/misc/bcm2835_property.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/hw/misc/bcm2835_property.c b/hw/misc/bcm2835_property.c
> index b958fa6a5c..62037c0630 100644
> --- a/hw/misc/bcm2835_property.c
> +++ b/hw/misc/bcm2835_property.c
> @@ -274,6 +274,13 @@ static void bcm2835_property_mbox_push(BCM2835PropertyState *s, uint32_t value)
>              resplen = 4;
>              break;
>  
> +        case 0x00048020: /* Set GPIO virt buf */
> +            /* fall through */
> +        case 0x00040010: /* Get GPIO virt buf */
> +            stl_le_phys(&s->dma_as, value + 12, 0);

This is not correct. You tell the kernel it can access the virtbuf
at 0x0000.0000, but the raspi_smpboot code and raspi_spintables are
stored there.

You need to store the uint32_t value in BCM2835PropertyState on SET
and return it on GET.

> +            resplen = 4;
> +            break;

Regards,

Phil.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-11-18 15:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-17  7:48 [PATCH 2/2] hw/misc/bcm2835_property: Add dummy Get/Set GPIO virt buf messages Benjamin Herrenschmidt
2021-11-18 15:24 ` Philippe Mathieu-Daudé

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).