Revision df33e639
b/hw/slavio_misc.c | ||
---|---|---|
50 | 50 |
uint8_t diag, mctrl; |
51 | 51 |
uint32_t sysctrl; |
52 | 52 |
uint16_t leds; |
53 |
target_phys_addr_t power_base; |
|
53 | 54 |
} MiscState; |
54 | 55 |
|
55 | 56 |
#define MISC_SIZE 1 |
... | ... | |
66 | 67 |
#define MISC_DIAG 0x01a00000 |
67 | 68 |
#define MISC_MDM 0x01b00000 |
68 | 69 |
#define MISC_SYS 0x01f00000 |
69 |
#define MISC_PWR 0x0a000000 |
|
70 | 70 |
|
71 | 71 |
#define AUX2_PWROFF 0x01 |
72 | 72 |
#define AUX2_PWRINTCLR 0x02 |
... | ... | |
145 | 145 |
MISC_DPRINTF("Write modem control %2.2x\n", val & 0xff); |
146 | 146 |
s->mctrl = val & 0xff; |
147 | 147 |
break; |
148 |
case MISC_PWR: |
|
149 |
MISC_DPRINTF("Write power management %2.2x\n", val & 0xff); |
|
150 |
cpu_interrupt(cpu_single_env, CPU_INTERRUPT_HALT); |
|
148 |
default: |
|
149 |
if (addr == s->power_base) { |
|
150 |
MISC_DPRINTF("Write power management %2.2x\n", val & 0xff); |
|
151 |
cpu_interrupt(cpu_single_env, CPU_INTERRUPT_HALT); |
|
152 |
} |
|
151 | 153 |
break; |
152 | 154 |
} |
153 | 155 |
} |
... | ... | |
178 | 180 |
ret = s->mctrl; |
179 | 181 |
MISC_DPRINTF("Read modem control %2.2x\n", ret); |
180 | 182 |
break; |
181 |
case MISC_PWR: |
|
182 |
MISC_DPRINTF("Read power management %2.2x\n", ret); |
|
183 |
default: |
|
184 |
if (addr == s->power_base) { |
|
185 |
MISC_DPRINTF("Read power management %2.2x\n", ret); |
|
186 |
} |
|
183 | 187 |
break; |
184 | 188 |
} |
185 | 189 |
return ret; |
... | ... | |
363 | 367 |
slavio_misc_io_memory); |
364 | 368 |
// Power management |
365 | 369 |
cpu_register_physical_memory(power_base, MISC_SIZE, slavio_misc_io_memory); |
370 |
s->power_base = power_base; |
|
366 | 371 |
|
367 | 372 |
/* 16 bit registers */ |
368 | 373 |
slavio_misc_io_memory = cpu_register_io_memory(0, slavio_led_mem_read, |
Also available in: Unified diff