summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArtyom Tarasenko <atar4qemu@gmail.com>2017-01-23 22:08:59 +0100
committerArtyom Tarasenko <atar4qemu@gmail.com>2017-02-26 22:46:08 +0100
commita5a08302d44a8b1a8c5819b1411002f85bb5f847 (patch)
tree167194774b341a867f43b86a39e2f14216e93cf2
parent5e3a549498ab6c55465419f003be74cb33836267 (diff)
niagara: check if a serial port is available
Reported-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Artyom Tarasenko <atar4qemu@gmail.com>
-rw-r--r--hw/sparc64/niagara.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/hw/sparc64/niagara.c b/hw/sparc64/niagara.c
index edde86ea2f..9a8d6109d4 100644
--- a/hw/sparc64/niagara.c
+++ b/hw/sparc64/niagara.c
@@ -158,9 +158,10 @@ static void niagara_init(MachineState *machine)
exit(1);
}
}
- serial_mm_init(sysmem, NIAGARA_UART_BASE, 0, NULL, 115200,
- serial_hds[0], DEVICE_BIG_ENDIAN);
-
+ if (serial_hds[0]) {
+ serial_mm_init(sysmem, NIAGARA_UART_BASE, 0, NULL, 115200,
+ serial_hds[0], DEVICE_BIG_ENDIAN);
+ }
empty_slot_init(NIAGARA_IOBBASE, NIAGARA_IOBSIZE);
sun4v_rtc_init(NIAGARA_RTC_BASE);
}