dev-amdgpu: Support multiple CPs and MMIO AddrRanges
Currently gem5 assumes that there is only one command processor (CP) which contains the PM4 packet processor. Some GPU devices have multiple CPs which the driver tests individually during POST if they are used or not. Therefore, these additional CPs need to be supported. This commit allows for multiple PM4 packet processors which represent multiple CPs. Each of these processors will have its own independent MMIO address range. To more easily support ranges, the MMIO addresses now use AddrRange to index a PM4 packet processor instead of the hard-coded constexpr MMIO start and size pairs. By default only one PM4 packet processor is created, meaning the functionality of the simulation is unchanged for devices currently supported in gem5. Change-Id: I977f4fd3a169ef4a78671a4fb58c8ea0e19bf52c
This commit is contained in:
@@ -63,6 +63,10 @@ class PM4PacketProcessor : public DmaVirtDevice
|
||||
std::unordered_map<uint16_t, PM4Queue *> queues;
|
||||
/* A map of PM4 queues based on doorbell offset */
|
||||
std::unordered_map<uint32_t, PM4Queue *> queuesMap;
|
||||
|
||||
int _ipId;
|
||||
AddrRange _mmioRange;
|
||||
|
||||
public:
|
||||
PM4PacketProcessor(const PM4PacketProcessorParams &p);
|
||||
|
||||
@@ -188,6 +192,9 @@ class PM4PacketProcessor : public DmaVirtDevice
|
||||
void setRbDoorbellCntrl(uint32_t data);
|
||||
void setRbDoorbellRangeLo(uint32_t data);
|
||||
void setRbDoorbellRangeHi(uint32_t data);
|
||||
|
||||
int getIpId() const { return _ipId; }
|
||||
AddrRange getMMIORange() const { return _mmioRange; }
|
||||
};
|
||||
|
||||
} // namespace gem5
|
||||
|
||||
Reference in New Issue
Block a user