Revision 4e3b1ea1 hw/slavio_misc.c

b/hw/slavio_misc.c
44 44
    int irq;
45 45
    uint8_t config;
46 46
    uint8_t aux1, aux2;
47
    uint8_t diag, mctrl;
47
    uint8_t diag, mctrl, sysctrl;
48 48
} MiscState;
49 49

  
50 50
#define MISC_MAXADDR 1
......
64 64
{
65 65
    MiscState *s = opaque;
66 66

  
67
    // Diagnostic register not cleared in reset
67
    // Diagnostic and system control registers not cleared in reset
68 68
    s->config = s->aux1 = s->aux2 = s->mctrl = 0;
69 69
}
70 70

  
......
116 116
	break;
117 117
    case 0x1f00000:
118 118
	MISC_DPRINTF("Write system control %2.2x\n", val & 0xff);
119
	if (val & 1)
119
	if (val & 1) {
120
	    s->sysctrl = 0x2;
120 121
	    qemu_system_reset_request();
122
	}
121 123
	break;
122 124
    case 0xa000000:
123 125
	MISC_DPRINTF("Write power management %2.2x\n", val & 0xff);
......
158 160
	break;
159 161
    case 0x1f00000:
160 162
	MISC_DPRINTF("Read system control %2.2x\n", ret);
163
	ret = s->sysctrl;
161 164
	break;
162 165
    case 0xa000000:
163 166
	MISC_DPRINTF("Read power management %2.2x\n", ret);
......
188 191
    qemu_put_8s(f, &s->aux2);
189 192
    qemu_put_8s(f, &s->diag);
190 193
    qemu_put_8s(f, &s->mctrl);
194
    qemu_put_8s(f, &s->sysctrl);
191 195
}
192 196

  
193 197
static int slavio_misc_load(QEMUFile *f, void *opaque, int version_id)
......
203 207
    qemu_get_8s(f, &s->aux2);
204 208
    qemu_get_8s(f, &s->diag);
205 209
    qemu_get_8s(f, &s->mctrl);
210
    qemu_get_8s(f, &s->sysctrl);
206 211
    return 0;
207 212
}
208 213

  

Also available in: Unified diff