bmc: implement pci support for Nuvoton
Tested: Verified this works for a Nuvoton BMC.
enable-nuvoton-p2a-mbox is for PCI-MailBox
enable-nuvoton-p2a-vga is for PCI-VGA
Signed-off-by: Medad CChien <ctcchien@nuvoton.com>
Change-Id: I15bc9cc528c285fbd015f9f2fad0913163d92db8
diff --git a/bmc/main.cpp b/bmc/main.cpp
index ab7ece8..bc25ff0 100644
--- a/bmc/main.cpp
+++ b/bmc/main.cpp
@@ -43,8 +43,14 @@
namespace
{
+#ifdef NUVOTON_P2A_MBOX
+static constexpr std::size_t memoryRegionSize = 16 * 1024UL;
+#elif defined NUVOTON_P2A_VGA
+static constexpr std::size_t memoryRegionSize = 4 * 1024 * 1024UL;
+#else
/* The maximum external buffer size we expect is 64KB. */
static constexpr std::size_t memoryRegionSize = 64 * 1024UL;
+#endif
static constexpr const char* jsonConfigurationPath =
"/usr/share/phosphor-ipmi-flash/";
@@ -62,11 +68,7 @@
#endif
#ifdef ENABLE_PCI_BRIDGE
-#if defined(ASPEED_P2A)
PciDataHandler pciDataHandler(MAPPED_ADDRESS, memoryRegionSize);
-#else
-#error "You must specify a hardware implementation."
-#endif
#endif
std::vector<DataHandlerPack> supportedTransports = {