mirror of
https://github.com/dingusdev/dingusppc.git
synced 2025-01-11 05:29:43 +00:00
pcidevice: fix expansion ROM mapping.
This commit is contained in:
parent
5220b03f0f
commit
32b8c8ed43
@ -136,7 +136,7 @@ void PCIDevice::pci_cfg_write(uint32_t reg_offs, uint32_t value, uint32_t size)
|
|||||||
} else {
|
} else {
|
||||||
this->exp_rom_bar = (data & 0xFFFFF801UL);
|
this->exp_rom_bar = (data & 0xFFFFF801UL);
|
||||||
if (this->exp_rom_bar & 1) {
|
if (this->exp_rom_bar & 1) {
|
||||||
this->map_exp_rom_mem(this->exp_rom_bar & 0xFFFFF800UL);
|
this->map_exp_rom_mem();
|
||||||
} else {
|
} else {
|
||||||
LOG_F(WARNING, "%s: unmapping of expansion ROM not implemented yet",
|
LOG_F(WARNING, "%s: unmapping of expansion ROM not implemented yet",
|
||||||
this->pci_name.c_str());
|
this->pci_name.c_str());
|
||||||
@ -235,9 +235,15 @@ void PCIDevice::set_bar_value(int bar_num, uint32_t value)
|
|||||||
this->pci_notify_bar_change(bar_num);
|
this->pci_notify_bar_change(bar_num);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PCIDevice::map_exp_rom_mem(uint32_t rom_addr)
|
void PCIDevice::map_exp_rom_mem()
|
||||||
{
|
{
|
||||||
|
uint32_t rom_addr, rom_size;
|
||||||
|
|
||||||
|
rom_addr = this->exp_rom_bar & 0xFFFFF800UL;
|
||||||
|
rom_size = ~this->exp_bar_cfg + 1;
|
||||||
|
|
||||||
if (!this->exp_rom_addr || this->exp_rom_addr != rom_addr) {
|
if (!this->exp_rom_addr || this->exp_rom_addr != rom_addr) {
|
||||||
this->host_instance->pci_register_mmio_region(rom_addr, 0x10000, this);
|
this->host_instance->pci_register_mmio_region(rom_addr, rom_size, this);
|
||||||
|
this->exp_rom_addr = rom_addr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -101,7 +101,7 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
void do_bar_sizing(int bar_num);
|
void do_bar_sizing(int bar_num);
|
||||||
void set_bar_value(int bar_num, uint32_t value);
|
void set_bar_value(int bar_num, uint32_t value);
|
||||||
void map_exp_rom_mem(uint32_t rom_addr);
|
void map_exp_rom_mem();
|
||||||
|
|
||||||
std::string pci_name; // human-readable device name
|
std::string pci_name; // human-readable device name
|
||||||
PCIHost* host_instance; // host bridge instance to call back
|
PCIHost* host_instance; // host bridge instance to call back
|
||||||
|
@ -217,7 +217,7 @@ uint32_t AtiMach64Gx::read(uint32_t rgn_start, uint32_t offset, int size)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// memory mapped expansion ROM region
|
// memory mapped expansion ROM region
|
||||||
if (rgn_start >= this->exp_rom_addr && offset < this->exp_rom_size) {
|
if (rgn_start == this->exp_rom_addr && offset < this->exp_rom_size) {
|
||||||
return read_mem(&this->exp_rom_data[offset], size);
|
return read_mem(&this->exp_rom_data[offset], size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user