dev_sgi_ip22.cc Source File
Back to the index.
Go to the documentation of this file.
44 #define SGI_IP22_TICK_SHIFT 14
52 if (d->
reg[0x38 / 4] != 0)
65 uint64_t idata = 0, odata = 0;
71 regnr = relative_addr /
sizeof(uint32_t);
78 switch (relative_addr) {
90 debug(
"[ sgi_ip22_imc: unimplemented write "
91 "IMC_SYSID, data=0x%08x ]\n", (
int)idata);
110 debug(
"[ sgi_ip22_imc: unimplemented write "
111 "IMC_MEMCFG0, data=0x%08x ]\n", (
int)idata);
113 odata = 0x3100 + (0x8000000 >> 22);
120 debug(
"[ sgi_ip22_imc: unimplemented write "
121 "IMC_MEMCFG1, data=0x%08x ]\n", (
int)idata);
134 debug(
"[ sgi_ip22_imc: write to IMC_EEPROM, data="
135 "0x%08x ]\n", (
int)idata);
137 odata = random() & 0x1e;
138 debug(
"[ sgi_ip22_imc: read from IMC_WDOG, "
139 "data=0x%08x ]\n", (
int)odata);
144 debug(
"[ sgi_ip22_imc: unimplemented write to "
145 "address 0x%x, data=0x%08x ]\n",
146 (
int)relative_addr, (
int)idata);
148 debug(
"[ sgi_ip22_imc: unimplemented read from "
149 "address 0x%x, data=0x%08x ]\n",
150 (
int)relative_addr, (
int)odata);
169 uint64_t idata = 0, odata = 0;
173 switch (relative_addr) {
176 debug(
"[ sgi_ip22_unknown: write to address 0x%x,"
177 " data=0x%08x ]\n", (
int)relative_addr, (
int)idata);
181 debug(
"[ sgi_ip22_unknown: read from address 0x%x, "
182 "data=0x%08x ]\n", (
int)relative_addr, (
int)odata);
187 debug(
"[ sgi_ip22_unknown: unimplemented write to "
188 "address 0x%x, data=0x%08x ]\n",
189 (
int)relative_addr, (
int)idata);
191 debug(
"[ sgi_ip22_unknown: unimplemented read from "
192 "address 0x%x, data=0x%08x ]\n",
193 (
int)relative_addr, (
int)odata);
212 uint64_t idata = 0, odata = 0;
216 regnr = relative_addr /
sizeof(uint32_t);
223 switch (relative_addr) {
226 debug(
"[ sgi_ip22_unknown2: unimplemented write "
227 "to address 0x%x, data=0x%08x ]\n",
228 (
int)relative_addr, (
int)idata);
230 debug(
"[ sgi_ip22_unknown2: unimplemented read from "
231 "address 0x%x, data=0x%08x ]\n",
232 (
int)relative_addr, (
int)odata);
246 uint64_t idata = 0, odata = 0;
251 debug(
"[ sgi_ip22_sysid: write to address 0x%x, "
252 "data=0x%08x ]\n", (
int)relative_addr, (
int)idata);
266 debug(
"[ sgi_ip22_sysid: read from address 0x%x, data="
267 "0x%08x ]\n", (
int)relative_addr, (
int)odata);
280 uint64_t idata = 0, odata = 0;
284 regnr = relative_addr /
sizeof(uint32_t);
287 d->
reg[regnr] = idata;
289 odata = d->
reg[regnr];
292 switch (relative_addr) {
295 debug(
"[ sgi_ip22: write to local0 IRQ STAT, "
296 "data=0x%llx ]\n", (
long long)idata);
298 debug(
"[ sgi_ip22: read from local0 IRQ STAT, "
299 "data=0x%llx ]\n", (
long long)odata);
314 fatal(
"TODO: ip22 legacy interrupt rewrite!\n");
321 debug(
"[ sgi_ip22: read from local0 IRQ MASK, "
322 "data=0x%llx ]\n", (
long long)odata);
327 debug(
"[ sgi_ip22: write to local1 IRQ STAT, "
328 "data=0x%llx ]\n", (
long long)idata);
330 debug(
"[ sgi_ip22: read from local1 IRQ STAT, "
331 "data=0x%llx ]\n", (
long long)odata);
338 fatal(
"TODO: ip22 legacy interrupt rewrite!\n");
344 debug(
"[ sgi_ip22: read from local1 IRQ MASK, "
345 "data=0x%llx ]\n", (
long long)odata);
350 debug(
"[ sgi_ip22: write to mappable IRQ STAT, "
351 "data=0x%llx ]\n", (
long long)idata);
353 debug(
"[ sgi_ip22: read from mappable IRQ STAT, "
354 "data=0x%llx ]\n", (
long long)odata);
359 debug(
"[ sgi_ip22: write to mappable local0 IRQ "
360 "MASK, data=0x%llx ]\n", (
long long)idata);
362 debug(
"[ sgi_ip22: read from mappable local0 IRQ "
363 "MASK, data=0x%llx ]\n", (
long long)odata);
368 debug(
"[ sgi_ip22: write to mappable local1 IRQ "
369 "MASK, data=0x%llx ]\n", (
long long)idata);
371 debug(
"[ sgi_ip22: read from mappable local1 IRQ "
372 "MASK, data=0x%llx ]\n", (
long long)odata);
393 debug(
"[ sgi_ip22: unimplemented write to address "
394 "0x%x, data=0x%02x ]\n", (
int)relative_addr,
397 debug(
"[ sgi_ip22: unimplemented read from address "
398 "0x%llx ]\n", (
long long)relative_addr);
422 dev_sgi_ip22_sysid_access, (
void *)d,
DM_DEFAULT, NULL);
427 dev_sgi_ip22_unknown_access, (
void *)d,
DM_DEFAULT, NULL);
uint32_t imc_reg[DEV_SGI_IP22_IMC_LENGTH/4]
void memory_device_register(struct memory *mem, const char *, uint64_t baseaddr, uint64_t len, int(*f)(struct cpu *, struct memory *, uint64_t, unsigned char *, size_t, int, void *), void *extra, int flags, unsigned char *dyntrans_data)
#define DEV_SGI_IP22_IMC_LENGTH
void machine_add_tickfunction(struct machine *machine, void(*func)(struct cpu *, void *), void *extra, int clockshift)
void fatal(const char *fmt,...)
#define DEV_SGI_IP22_LENGTH
uint64_t memory_readmax64(struct cpu *cpu, unsigned char *buf, int len)
#define IP22_UNKNOWN2_BASE
DEVICE_ACCESS(sgi_ip22_imc)
#define DEV_SGI_IP22_UNKNOWN2_LENGTH
struct sgi_ip22_data * dev_sgi_ip22_init(struct machine *machine, struct memory *mem, uint64_t baseaddr, int guiness_flag)
#define SGI_IP22_TICK_SHIFT
int dev_sgi_ip22_access(struct cpu *cpu, struct memory *mem, uint64_t relative_addr, unsigned char *data, size_t len, int writeflag, void *)
void memory_writemax64(struct cpu *cpu, unsigned char *buf, int len, uint64_t data)
uint32_t reg[DEV_SGI_IP22_LENGTH/4]
uint32_t unknown2_reg[DEV_SGI_IP22_UNKNOWN2_LENGTH/4]
#define CHECK_ALLOCATION(ptr)
Generated on Tue Mar 24 2020 14:04:48 for GXemul by
1.8.17