mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 15:53:54 -06:00
i.MX: KZM: use standalone i.MX31 SOC support
Convert the KZM board to use the i.MX31 SoC defintition instead of redefining the entire SoC on the machine level. Major rewrite of the machine init code. While touching the memory map comment de-indent to the correct level of indentation. This obsoletes the legacy i.MX device device creation helpers which are removed. Tested by booting a minimal Linux system on the emulated platform Signed-off-by: Jean-Christophe Dubois <jcd@tribudubois.net> Reviewed-by: Peter Crosthwaite <crosthwaite.peter@gmail.com> Message-id: 5e783561f092e1c939562fdff001f1ab1194b07f.1441057361.git.jcd@tribudubois.net Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
parent
558df83db7
commit
f044ac4980
5 changed files with 94 additions and 178 deletions
|
@ -21,7 +21,6 @@
|
|||
#include "hw/char/imx_serial.h"
|
||||
#include "sysemu/sysemu.h"
|
||||
#include "sysemu/char.h"
|
||||
#include "hw/arm/imx.h"
|
||||
|
||||
//#define DEBUG_SERIAL 1
|
||||
#ifdef DEBUG_SERIAL
|
||||
|
@ -334,40 +333,6 @@ static void imx_serial_init(Object *obj)
|
|||
sysbus_init_irq(sbd, &s->irq);
|
||||
}
|
||||
|
||||
void imx_serial_create(int uart, const hwaddr addr, qemu_irq irq)
|
||||
{
|
||||
DeviceState *dev;
|
||||
SysBusDevice *bus;
|
||||
CharDriverState *chr;
|
||||
const char chr_name[] = "serial";
|
||||
char label[ARRAY_SIZE(chr_name) + 1];
|
||||
|
||||
dev = qdev_create(NULL, TYPE_IMX_SERIAL);
|
||||
|
||||
if (uart >= MAX_SERIAL_PORTS) {
|
||||
hw_error("Cannot assign uart %d: QEMU supports only %d ports\n",
|
||||
uart, MAX_SERIAL_PORTS);
|
||||
}
|
||||
chr = serial_hds[uart];
|
||||
if (!chr) {
|
||||
snprintf(label, ARRAY_SIZE(label), "%s%d", chr_name, uart);
|
||||
chr = qemu_chr_new(label, "null", NULL);
|
||||
if (!(chr)) {
|
||||
hw_error("Can't assign serial port to imx-uart%d.\n", uart);
|
||||
}
|
||||
}
|
||||
|
||||
qdev_prop_set_chr(dev, "chardev", chr);
|
||||
bus = SYS_BUS_DEVICE(dev);
|
||||
qdev_init_nofail(dev);
|
||||
if (addr != (hwaddr)-1) {
|
||||
sysbus_mmio_map(bus, 0, addr);
|
||||
}
|
||||
sysbus_connect_irq(bus, 0, irq);
|
||||
|
||||
}
|
||||
|
||||
|
||||
static Property imx_serial_properties[] = {
|
||||
DEFINE_PROP_CHR("chardev", IMXSerialState, chr),
|
||||
DEFINE_PROP_END_OF_LIST(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue