tools: implement pci support for Nuvoton
Note: burn_my_bmc will detect the PCI device at runtime
as Aspeed vs Nuvoton
Tested: Verified this works for a Nuvoton BMC.
Signed-off-by: Medad CChien <ctcchien@nuvoton.com>
Change-Id: Ifb253dee301f4d39582269f7d3e9b4f423fdfde3
diff --git a/tools/p2a.hpp b/tools/p2a.hpp
index d1a303e..84c0952 100644
--- a/tools/p2a.hpp
+++ b/tools/p2a.hpp
@@ -8,14 +8,21 @@
#include <cstdint>
#include <ipmiblob/blob_interface.hpp>
+#include <vector>
-constexpr std::uint16_t aspeedVendorId = 0x1a03;
-constexpr std::uint16_t aspeedDeviceId = 0x2000;
-constexpr std::size_t aspeedP2aOffset = 0x10000;
constexpr std::size_t aspeedP2aConfig = 0x0f000;
constexpr std::size_t aspeedP2aBridge = 0x0f004;
constexpr std::uint32_t p2ABridgeEnabled = 0x1;
+struct PciDeviceInfo
+{
+ std::uint16_t VID;
+ std::uint16_t DID;
+ std::size_t Offset;
+ std::size_t Length;
+ std::uint16_t bar;
+};
+
namespace host_tool
{
@@ -42,6 +49,12 @@
PciUtilInterface* pci;
ProgressInterface* progress;
const internal::Sys* sys;
-};
+ constexpr struct PciDeviceInfo static aspeedPciDeviceInfo = {
+ 0x1a03, 0x2000, 0x10000, 0x10000, 1};
+ constexpr struct PciDeviceInfo static nuvotonPciDeviceInfo = {
+ 0x1050, 0x0750, 0x0, 0x4000, 0};
+ const std::vector<PciDeviceInfo> PCIDeviceList = {aspeedPciDeviceInfo,
+ nuvotonPciDeviceInfo};
+};
} // namespace host_tool