mirror of
https://github.com/dingusdev/dingusppc.git
synced 2024-11-04 04:06:42 +00:00
Merge pull request #77 from mihaip/upstream-machineid
machinepdm: fix machine ID
This commit is contained in:
commit
79ee8543f5
@ -27,6 +27,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
#include <devices/ioctrl/macio.h>
|
||||
|
||||
#include <cinttypes>
|
||||
#include <loguru.hpp>
|
||||
#include <string>
|
||||
|
||||
/**
|
||||
@ -58,7 +59,14 @@ public:
|
||||
~NubusMacID() = default;
|
||||
|
||||
uint32_t read(uint32_t rgn_start, uint32_t offset, int size) {
|
||||
return (offset < 4 ? this->id[offset] : 0);
|
||||
if (size == 4 && offset == 0) {
|
||||
return *(uint32_t*)this->id;
|
||||
}
|
||||
if (size == 1 && offset < 4) {
|
||||
return this->id[offset];
|
||||
}
|
||||
ABORT_F("NubusMacID: invalid read size %d, offset %d!", size, offset);
|
||||
return 0;
|
||||
};
|
||||
|
||||
/* not writable */
|
||||
|
@ -50,7 +50,7 @@ int initialize_pdm(std::string& id)
|
||||
HMC* hmc_obj = dynamic_cast<HMC*>(gMachineObj->get_comp_by_name("HMC"));
|
||||
|
||||
if (id == "pm6100") {
|
||||
machine_id = 0x3010;
|
||||
machine_id = 0x3011;
|
||||
} else if (id == "pm7100") {
|
||||
machine_id = 0x3012;
|
||||
} else if (id == "pm8100") {
|
||||
|
Loading…
Reference in New Issue
Block a user