qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ppc/pegasos2: Allow setprop in VOF
@ 2021-07-09 13:19 BALATON Zoltan
  2021-07-12  2:05 ` David Gibson
  0 siblings, 1 reply; 2+ messages in thread
From: BALATON Zoltan @ 2021-07-09 13:19 UTC (permalink / raw)
  To: qemu-devel, qemu-ppc; +Cc: Alexey Kardashevskiy, David Gibson

Linux needs setprop to fix up the device tree, otherwise it's not
finding devices and cannot boot. Since recent VOF change now we need
to add a callback to allow this which is what this patch does.

Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
---
 hw/ppc/pegasos2.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/hw/ppc/pegasos2.c b/hw/ppc/pegasos2.c
index 5c4e2ae8bf..f25816082c 100644
--- a/hw/ppc/pegasos2.c
+++ b/hw/ppc/pegasos2.c
@@ -443,10 +443,17 @@ static target_ulong vhyp_encode_hpt_for_kvm_pr(PPCVirtualHypervisor *vhyp)
     return POWERPC_CPU(current_cpu)->env.spr[SPR_SDR1];
 }
 
+static bool pegasos2_setprop(MachineState *ms, const char *path,
+                             const char *propname, void *val, int vallen)
+{
+    return true;
+}
+
 static void pegasos2_machine_class_init(ObjectClass *oc, void *data)
 {
     MachineClass *mc = MACHINE_CLASS(oc);
     PPCVirtualHypervisorClass *vhc = PPC_VIRTUAL_HYPERVISOR_CLASS(oc);
+    VofMachineIfClass *vmc = VOF_MACHINE_CLASS(oc);
 
     mc->desc = "Genesi/bPlan Pegasos II";
     mc->init = pegasos2_init;
@@ -462,6 +469,8 @@ static void pegasos2_machine_class_init(ObjectClass *oc, void *data)
     vhc->cpu_exec_enter = vhyp_nop;
     vhc->cpu_exec_exit = vhyp_nop;
     vhc->encode_hpt_for_kvm_pr = vhyp_encode_hpt_for_kvm_pr;
+
+    vmc->setprop = pegasos2_setprop;
 }
 
 static const TypeInfo pegasos2_machine_info = {
@@ -471,6 +480,7 @@ static const TypeInfo pegasos2_machine_info = {
     .instance_size = sizeof(Pegasos2MachineState),
     .interfaces = (InterfaceInfo[]) {
         { TYPE_PPC_VIRTUAL_HYPERVISOR },
+        { TYPE_VOF_MACHINE_IF },
         { }
     },
 };
-- 
2.21.4



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

* Re: [PATCH] ppc/pegasos2: Allow setprop in VOF
  2021-07-09 13:19 [PATCH] ppc/pegasos2: Allow setprop in VOF BALATON Zoltan
@ 2021-07-12  2:05 ` David Gibson
  0 siblings, 0 replies; 2+ messages in thread
From: David Gibson @ 2021-07-12  2:05 UTC (permalink / raw)
  To: BALATON Zoltan; +Cc: Alexey Kardashevskiy, qemu-ppc, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 2114 bytes --]

On Fri, Jul 09, 2021 at 03:19:13PM +0200, BALATON Zoltan wrote:
> Linux needs setprop to fix up the device tree, otherwise it's not
> finding devices and cannot boot. Since recent VOF change now we need
> to add a callback to allow this which is what this patch does.
> 
> Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>

Applied to ppc-for-6.1.

> ---
>  hw/ppc/pegasos2.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/hw/ppc/pegasos2.c b/hw/ppc/pegasos2.c
> index 5c4e2ae8bf..f25816082c 100644
> --- a/hw/ppc/pegasos2.c
> +++ b/hw/ppc/pegasos2.c
> @@ -443,10 +443,17 @@ static target_ulong vhyp_encode_hpt_for_kvm_pr(PPCVirtualHypervisor *vhyp)
>      return POWERPC_CPU(current_cpu)->env.spr[SPR_SDR1];
>  }
>  
> +static bool pegasos2_setprop(MachineState *ms, const char *path,
> +                             const char *propname, void *val, int vallen)
> +{
> +    return true;
> +}
> +
>  static void pegasos2_machine_class_init(ObjectClass *oc, void *data)
>  {
>      MachineClass *mc = MACHINE_CLASS(oc);
>      PPCVirtualHypervisorClass *vhc = PPC_VIRTUAL_HYPERVISOR_CLASS(oc);
> +    VofMachineIfClass *vmc = VOF_MACHINE_CLASS(oc);
>  
>      mc->desc = "Genesi/bPlan Pegasos II";
>      mc->init = pegasos2_init;
> @@ -462,6 +469,8 @@ static void pegasos2_machine_class_init(ObjectClass *oc, void *data)
>      vhc->cpu_exec_enter = vhyp_nop;
>      vhc->cpu_exec_exit = vhyp_nop;
>      vhc->encode_hpt_for_kvm_pr = vhyp_encode_hpt_for_kvm_pr;
> +
> +    vmc->setprop = pegasos2_setprop;
>  }
>  
>  static const TypeInfo pegasos2_machine_info = {
> @@ -471,6 +480,7 @@ static const TypeInfo pegasos2_machine_info = {
>      .instance_size = sizeof(Pegasos2MachineState),
>      .interfaces = (InterfaceInfo[]) {
>          { TYPE_PPC_VIRTUAL_HYPERVISOR },
> +        { TYPE_VOF_MACHINE_IF },
>          { }
>      },
>  };

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

end of thread, other threads:[~2021-07-12  2:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-07-09 13:19 [PATCH] ppc/pegasos2: Allow setprop in VOF BALATON Zoltan
2021-07-12  2:05 ` David Gibson

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