qemu-ppc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 3/7] hw/ppc: Handle stash command in PowerNV SBE


From: Aditya Gupta
Subject: Re: [PATCH 3/7] hw/ppc: Handle stash command in PowerNV SBE
Date: Fri, 14 Mar 2025 00:16:46 +0530
User-agent: Mozilla Thunderbird

On 11/03/25 10:20, Harsh Prateek Bora wrote:


<...snip...>

--- a/hw/ppc/pnv_sbe.c
+++ b/hw/ppc/pnv_sbe.c
@@ -82,6 +82,8 @@
  #define SBE_CONTROL_REG_S0              PPC_BIT(14)
  #define SBE_CONTROL_REG_S1              PPC_BIT(15)
  +static uint64_t mpipl_skiboot_base = 0x30000000 /*default SKIBOOT_BASE*/;
+
  static void pnv_sbe_set_host_doorbell(PnvSBE *sbe, uint64_t val)
  {
      val &= SBE_HOST_RESPONSE_MASK; /* Is this right? What does HW do? */
@@ -281,6 +283,29 @@ static void do_sbe_msg(PnvSBE *sbe)
              timer_del(sbe->timer);
          }
          break;
+    case SBE_CMD_STASH_MPIPL_CONFIG:
+        /* key = sbe->mbox[1] */
+        switch (sbe->mbox[1]) {
+        case SBE_STASH_KEY_SKIBOOT_BASE:
+            mpipl_skiboot_base = sbe->mbox[2];
+            qemu_log_mask(LOG_UNIMP,
+                "Stashing skiboot base: 0x%lx\n", mpipl_skiboot_base);
+
+            /*
+             * Set the response register.
+             *
+             * Currently setting the same sequence number in
+             * response as we got in the request.
+             */
+            sbe->mbox[4] = sbe->mbox[0];    /* sequence number */
+            pnv_sbe_set_host_doorbell(sbe,
+                    sbe->host_doorbell | SBE_HOST_RESPONSE_WAITING);
+
+            break;
+        default:
+            qemu_log_mask(LOG_UNIMP, "SBE Unimplemented command: 0x%x\n", cmd);

Unimplemented SBE_CMD_STASH_MPIPL_CONFIG key ?

Got it. Thanks for the reword suggestion, will do it.


Thanks,

- Aditya G


+        }
+        break;
      default:
          qemu_log_mask(LOG_UNIMP, "SBE Unimplemented command: 0x%x\n", cmd);
      }
diff --git a/include/hw/ppc/pnv_sbe.h b/include/hw/ppc/pnv_sbe.h
index b6b378ad14c7..f6cbcf990ed9 100644
--- a/include/hw/ppc/pnv_sbe.h
+++ b/include/hw/ppc/pnv_sbe.h
@@ -53,4 +53,7 @@ struct PnvSBEClass {
      const MemoryRegionOps *xscom_mbox_ops;
  };
  +/* Helper to access stashed SKIBOOT_BASE */
+bool pnv_sbe_mpipl_skiboot_base(void);
+
  #endif /* PPC_PNV_SBE_H */



reply via email to

[Prev in Thread] Current Thread [Next in Thread]