Loop in more Nuvoton folks.

-----Original Message-----
From: Yubin Zou <[email protected]>
Sent: Wednesday, September 10, 2025 6:11 AM
To: [email protected]
Cc: Paolo Bonzini <[email protected]>; CS20 KFTing <[email protected]>; Hao 
Wu <[email protected]>; [email protected]; Peter Maydell 
<[email protected]>; Yubin Zou <[email protected]>; Titus Rwantare 
<[email protected]>
Subject: [PATCH 3/7] hw/arm: attach PCIe root complex to npmcm8xx

CAUTION - External Email: Do not click links or open attachments unless you 
acknowledge the sender and content.


From: Titus Rwantare <[email protected]>

Signed-off-by: Titus Rwantare <[email protected]>
---
 hw/arm/Kconfig           |  3 ++-
 hw/arm/npcm8xx.c         | 10 +++++++++-
 include/hw/arm/npcm8xx.h |  2 ++
 3 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig index 
2aa4b5d77864ff01e69650711e7d914f351e9966..6ac38d083e4a01e09fc00e63df66046c7c17b356
 100644
--- a/hw/arm/Kconfig
+++ b/hw/arm/Kconfig
@@ -499,7 +499,8 @@ config NPCM8XX
     select SERIAL
     select SSI
     select UNIMP
-
+    select CMIS
+    select NPCM_PCIERC

 config FSL_IMX25
     bool
diff --git a/hw/arm/npcm8xx.c b/hw/arm/npcm8xx.c index 
a276fea6985715cf82ea0ac7bb5aae78d2003ccf..9b3e648e3fc3ca4352d5c8d310a19ea462e62cc7
 100644
--- a/hw/arm/npcm8xx.c
+++ b/hw/arm/npcm8xx.c
@@ -50,6 +50,7 @@
 #define NPCM8XX_CLK_BA          0xf0801000
 #define NPCM8XX_MC_BA           0xf0824000
 #define NPCM8XX_RNG_BA          0xf000b000
+#define NPCM8XX_PCIERC_BA       0xe1000000

 /* ADC Module */
 #define NPCM8XX_ADC_BA          0xf000c000
@@ -136,6 +137,7 @@ enum NPCM8xxInterrupt {
     NPCM8XX_GPIO5_IRQ,
     NPCM8XX_GPIO6_IRQ,
     NPCM8XX_GPIO7_IRQ,
+    NPCM8XX_PCIE_RC_IRQ         = 127,
     NPCM8XX_SMBUS0_IRQ          = 128,
     NPCM8XX_SMBUS1_IRQ,
     NPCM8XX_SMBUS2_IRQ,
@@ -467,6 +469,7 @@ static void npcm8xx_init(Object *obj)

     object_initialize_child(obj, "mmc", &s->mmc, TYPE_NPCM7XX_SDHCI);
     object_initialize_child(obj, "pspi", &s->pspi, TYPE_NPCM_PSPI);
+    object_initialize_child(obj, "pcierc", &s->pcierc,
+ TYPE_NPCM_PCIERC);
 }

 static void npcm8xx_realize(DeviceState *dev, Error **errp) @@ -766,10 +769,15 
@@ static void npcm8xx_realize(DeviceState *dev, Error **errp)
     sysbus_connect_irq(SYS_BUS_DEVICE(&s->pspi), 0,
             npcm8xx_irq(s, NPCM8XX_PSPI_IRQ));

+    /* PCIe RC */
+    sysbus_realize(SYS_BUS_DEVICE(&s->pcierc), &error_abort);
+    sysbus_mmio_map(SYS_BUS_DEVICE(&s->pcierc), 0, NPCM8XX_PCIERC_BA);
+    sysbus_connect_irq(SYS_BUS_DEVICE(&s->pcierc), 0,
+                       npcm8xx_irq(s, NPCM8XX_PCIE_RC_IRQ));
+
     create_unimplemented_device("npcm8xx.shm",          0xc0001000,   4 * KiB);
     create_unimplemented_device("npcm8xx.gicextra",     0xdfffa000,  24 * KiB);
     create_unimplemented_device("npcm8xx.vdmx",         0xe0800000,   4 * KiB);
-    create_unimplemented_device("npcm8xx.pcierc",       0xe1000000,  64 * KiB);
     create_unimplemented_device("npcm8xx.rootc",        0xe8000000, 128 * MiB);
     create_unimplemented_device("npcm8xx.kcs",          0xf0007000,   4 * KiB);
     create_unimplemented_device("npcm8xx.gfxi",         0xf000e000,   4 * KiB);
diff --git a/include/hw/arm/npcm8xx.h b/include/hw/arm/npcm8xx.h index 
a8377db490586636ca4c2e491c91f40de0f17d87..fa968e9c0881adac6a27fb5f2117e2fce163be47
 100644
--- a/include/hw/arm/npcm8xx.h
+++ b/include/hw/arm/npcm8xx.h
@@ -31,6 +31,7 @@
 #include "hw/net/npcm_gmac.h"
 #include "hw/net/npcm_pcs.h"
 #include "hw/nvram/npcm7xx_otp.h"
+#include "hw/pci-host/npcm_pcierc.h"
 #include "hw/sd/npcm7xx_sdhci.h"
 #include "hw/timer/npcm7xx_timer.h"
 #include "hw/ssi/npcm7xx_fiu.h"
@@ -104,6 +105,7 @@ struct NPCM8xxState {
     NPCMPCSState        pcs;
     NPCM7xxSDHCIState   mmc;
     NPCMPSPIState       pspi;
+    NPCMPCIERCState     pcierc;
 };

 struct NPCM8xxClass {

--
2.51.0.384.g4c02a37b29-goog

________________________________
________________________________
 The privileged confidential information contained in this email is intended 
for use only by the addressees as indicated by the original sender of this 
email. If you are not the addressee indicated in this email or are not 
responsible for delivery of the email to such a person, please kindly reply to 
the sender indicating this fact and delete all copies of it from your computer 
and network server immediately. Your cooperation is highly appreciated. It is 
advised that any unauthorized use of confidential information of Nuvoton is 
strictly prohibited; and any information in this email irrelevant to the 
official business of Nuvoton shall be deemed as neither given nor endorsed by 
Nuvoton.

Reply via email to