diff options
author | Stefan Weil <weil@mail.berlios.de> | 2010-08-08 14:09:26 +0200 |
---|---|---|
committer | Andrzej Zaborowski <balrog@zabor.org> | 2010-09-10 01:55:53 +0200 |
commit | 6a8aabd3c132188ee8e0e82ef4aba09f782cbe96 (patch) | |
tree | b1867d887a224a7cc75c00a7c253b11ca3da0ee0 /hw/omap_uart.c | |
parent | 62dd89dea25b08796fcb83beeac3aea5f5a89c95 (diff) | |
download | qemu-6a8aabd3c132188ee8e0e82ef4aba09f782cbe96.zip qemu-6a8aabd3c132188ee8e0e82ef4aba09f782cbe96.tar.gz qemu-6a8aabd3c132188ee8e0e82ef4aba09f782cbe96.tar.bz2 |
hw/omap: Fix default setup for OMAP UART devices
Character devices created by qemu_chr_open don't
allow duplicate device names, so naming all
UART devices "null" no longer works.
Running "qemu-system-arm -M n800" (and some other machines)
results in this error message:
qemu-system-arm: Duplicate ID 'null' for chardev
Can't create serial device, empty char device
This is fixed by setting a default label "uart1",
"uart2" or "uart3".
Cc: Andrzej Zaborowski <andrew.zaborowski@intel.com>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Diffstat (limited to 'hw/omap_uart.c')
-rw-r--r-- | hw/omap_uart.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/hw/omap_uart.c b/hw/omap_uart.c index 395bf0c..cc66cd9 100644 --- a/hw/omap_uart.c +++ b/hw/omap_uart.c @@ -51,7 +51,8 @@ void omap_uart_reset(struct omap_uart_s *s) struct omap_uart_s *omap_uart_init(target_phys_addr_t base, qemu_irq irq, omap_clk fclk, omap_clk iclk, - qemu_irq txdma, qemu_irq rxdma, CharDriverState *chr) + qemu_irq txdma, qemu_irq rxdma, + const char *label, CharDriverState *chr) { struct omap_uart_s *s = (struct omap_uart_s *) qemu_mallocz(sizeof(struct omap_uart_s)); @@ -61,11 +62,11 @@ struct omap_uart_s *omap_uart_init(target_phys_addr_t base, s->irq = irq; #ifdef TARGET_WORDS_BIGENDIAN s->serial = serial_mm_init(base, 2, irq, omap_clk_getrate(fclk)/16, - chr ?: qemu_chr_open("null", "null", NULL), 1, + chr ?: qemu_chr_open(label, "null", NULL), 1, 1); #else s->serial = serial_mm_init(base, 2, irq, omap_clk_getrate(fclk)/16, - chr ?: qemu_chr_open("null", "null", NULL), 1, + chr ?: qemu_chr_open(label, "null", NULL), 1, 0); #endif return s; @@ -162,11 +163,12 @@ static CPUWriteMemoryFunc * const omap_uart_writefn[] = { struct omap_uart_s *omap2_uart_init(struct omap_target_agent_s *ta, qemu_irq irq, omap_clk fclk, omap_clk iclk, - qemu_irq txdma, qemu_irq rxdma, CharDriverState *chr) + qemu_irq txdma, qemu_irq rxdma, + const char *label, CharDriverState *chr) { target_phys_addr_t base = omap_l4_attach(ta, 0, 0); struct omap_uart_s *s = omap_uart_init(base, irq, - fclk, iclk, txdma, rxdma, chr); + fclk, iclk, txdma, rxdma, label, chr); int iomemtype = cpu_register_io_memory(omap_uart_readfn, omap_uart_writefn, s); |