diff options
author | Peter Crosthwaite <peter.crosthwaite@xilinx.com> | 2014-01-06 10:16:38 +0000 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2014-01-08 19:07:21 +0000 |
commit | 823dd48761a668c8e787cb9cf07234b656a05926 (patch) | |
tree | fb154f67a0397cecf7eed659f994b9f61bed68e7 /hw | |
parent | 589bfb6888385ae1767fe2f94528f2dacf59509a (diff) |
char/cadence_uart: Fix reset.
Don't reset the uart as an init step. Register the reset function as a
proper reset fn instead.
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Message-id: d82cd2e65e5a6f8b6deeecb6cced61f0bf3f8c89.1388626249.git.peter.crosthwaite@xilinx.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/char/cadence_uart.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/hw/char/cadence_uart.c b/hw/char/cadence_uart.c index fb9db89ee9..7edc1196f3 100644 --- a/hw/char/cadence_uart.c +++ b/hw/char/cadence_uart.c @@ -431,8 +431,10 @@ static const MemoryRegionOps uart_ops = { .endianness = DEVICE_NATIVE_ENDIAN, }; -static void cadence_uart_reset(UartState *s) +static void cadence_uart_reset(DeviceState *dev) { + UartState *s = CADENCE_UART(dev); + s->r[R_CR] = 0x00000128; s->r[R_IMR] = 0; s->r[R_CISR] = 0; @@ -465,8 +467,6 @@ static int cadence_uart_init(SysBusDevice *dev) s->chr = qemu_char_get_next_serial(); - cadence_uart_reset(s); - if (s->chr) { qemu_chr_add_handlers(s->chr, uart_can_receive, uart_receive, uart_event, s); @@ -508,6 +508,7 @@ static void cadence_uart_class_init(ObjectClass *klass, void *data) sdc->init = cadence_uart_init; dc->vmsd = &vmstate_cadence_uart; + dc->reset = cadence_uart_reset; } static const TypeInfo cadence_uart_info = { |