Lines Matching +full:imx25 +full:- +full:uart

2  * Copyright (c) 2013 Jean-Christophe Dubois <jcd@tribudubois.net>
6 * Based on hw/arm/xlnx-zynqmp.c
27 #include "hw/arm/fsl-imx25.h"
29 #include "hw/qdev-properties.h"
31 #include "target/arm/cpu-qom.h"
40 object_initialize_child(obj, "cpu", &s->cpu, ARM_CPU_TYPE_NAME("arm926")); in fsl_imx25_init()
42 object_initialize_child(obj, "avic", &s->avic, TYPE_IMX_AVIC); in fsl_imx25_init()
44 object_initialize_child(obj, "ccm", &s->ccm, TYPE_IMX25_CCM); in fsl_imx25_init()
47 object_initialize_child(obj, "uart[*]", &s->uart[i], TYPE_IMX_SERIAL); in fsl_imx25_init()
51 object_initialize_child(obj, "gpt[*]", &s->gpt[i], TYPE_IMX25_GPT); in fsl_imx25_init()
55 object_initialize_child(obj, "epit[*]", &s->epit[i], TYPE_IMX_EPIT); in fsl_imx25_init()
58 object_initialize_child(obj, "fec", &s->fec, TYPE_IMX_FEC); in fsl_imx25_init()
60 object_initialize_child(obj, "rngc", &s->rngc, TYPE_IMX_RNGC); in fsl_imx25_init()
63 object_initialize_child(obj, "i2c[*]", &s->i2c[i], TYPE_IMX_I2C); in fsl_imx25_init()
67 object_initialize_child(obj, "gpio[*]", &s->gpio[i], TYPE_IMX_GPIO); in fsl_imx25_init()
71 object_initialize_child(obj, "sdhc[*]", &s->esdhc[i], TYPE_IMX_USDHC); in fsl_imx25_init()
75 object_initialize_child(obj, "usb[*]", &s->usb[i], TYPE_CHIPIDEA); in fsl_imx25_init()
78 object_initialize_child(obj, "wdt", &s->wdt, TYPE_IMX2_WDT); in fsl_imx25_init()
86 if (!qdev_realize(DEVICE(&s->cpu), NULL, errp)) { in fsl_imx25_realize()
90 if (!sysbus_realize(SYS_BUS_DEVICE(&s->avic), errp)) { in fsl_imx25_realize()
93 sysbus_mmio_map(SYS_BUS_DEVICE(&s->avic), 0, FSL_IMX25_AVIC_ADDR); in fsl_imx25_realize()
94 sysbus_connect_irq(SYS_BUS_DEVICE(&s->avic), 0, in fsl_imx25_realize()
95 qdev_get_gpio_in(DEVICE(&s->cpu), ARM_CPU_IRQ)); in fsl_imx25_realize()
96 sysbus_connect_irq(SYS_BUS_DEVICE(&s->avic), 1, in fsl_imx25_realize()
97 qdev_get_gpio_in(DEVICE(&s->cpu), ARM_CPU_FIQ)); in fsl_imx25_realize()
99 if (!sysbus_realize(SYS_BUS_DEVICE(&s->ccm), errp)) { in fsl_imx25_realize()
102 sysbus_mmio_map(SYS_BUS_DEVICE(&s->ccm), 0, FSL_IMX25_CCM_ADDR); in fsl_imx25_realize()
117 qdev_prop_set_chr(DEVICE(&s->uart[i]), "chardev", serial_hd(i)); in fsl_imx25_realize()
119 if (!sysbus_realize(SYS_BUS_DEVICE(&s->uart[i]), errp)) { in fsl_imx25_realize()
122 sysbus_mmio_map(SYS_BUS_DEVICE(&s->uart[i]), 0, serial_table[i].addr); in fsl_imx25_realize()
123 sysbus_connect_irq(SYS_BUS_DEVICE(&s->uart[i]), 0, in fsl_imx25_realize()
124 qdev_get_gpio_in(DEVICE(&s->avic), in fsl_imx25_realize()
140 s->gpt[i].ccm = IMX_CCM(&s->ccm); in fsl_imx25_realize()
142 if (!sysbus_realize(SYS_BUS_DEVICE(&s->gpt[i]), errp)) { in fsl_imx25_realize()
145 sysbus_mmio_map(SYS_BUS_DEVICE(&s->gpt[i]), 0, gpt_table[i].addr); in fsl_imx25_realize()
146 sysbus_connect_irq(SYS_BUS_DEVICE(&s->gpt[i]), 0, in fsl_imx25_realize()
147 qdev_get_gpio_in(DEVICE(&s->avic), in fsl_imx25_realize()
161 s->epit[i].ccm = IMX_CCM(&s->ccm); in fsl_imx25_realize()
163 if (!sysbus_realize(SYS_BUS_DEVICE(&s->epit[i]), errp)) { in fsl_imx25_realize()
166 sysbus_mmio_map(SYS_BUS_DEVICE(&s->epit[i]), 0, epit_table[i].addr); in fsl_imx25_realize()
167 sysbus_connect_irq(SYS_BUS_DEVICE(&s->epit[i]), 0, in fsl_imx25_realize()
168 qdev_get_gpio_in(DEVICE(&s->avic), in fsl_imx25_realize()
172 object_property_set_uint(OBJECT(&s->fec), "phy-num", s->phy_num, in fsl_imx25_realize()
174 qemu_configure_nic_device(DEVICE(&s->fec), true, NULL); in fsl_imx25_realize()
176 if (!sysbus_realize(SYS_BUS_DEVICE(&s->fec), errp)) { in fsl_imx25_realize()
179 sysbus_mmio_map(SYS_BUS_DEVICE(&s->fec), 0, FSL_IMX25_FEC_ADDR); in fsl_imx25_realize()
180 sysbus_connect_irq(SYS_BUS_DEVICE(&s->fec), 0, in fsl_imx25_realize()
181 qdev_get_gpio_in(DEVICE(&s->avic), FSL_IMX25_FEC_IRQ)); in fsl_imx25_realize()
183 if (!sysbus_realize(SYS_BUS_DEVICE(&s->rngc), errp)) { in fsl_imx25_realize()
186 sysbus_mmio_map(SYS_BUS_DEVICE(&s->rngc), 0, FSL_IMX25_RNGC_ADDR); in fsl_imx25_realize()
187 sysbus_connect_irq(SYS_BUS_DEVICE(&s->rngc), 0, in fsl_imx25_realize()
188 qdev_get_gpio_in(DEVICE(&s->avic), FSL_IMX25_RNGC_IRQ)); in fsl_imx25_realize()
201 if (!sysbus_realize(SYS_BUS_DEVICE(&s->i2c[i]), errp)) { in fsl_imx25_realize()
204 sysbus_mmio_map(SYS_BUS_DEVICE(&s->i2c[i]), 0, i2c_table[i].addr); in fsl_imx25_realize()
205 sysbus_connect_irq(SYS_BUS_DEVICE(&s->i2c[i]), 0, in fsl_imx25_realize()
206 qdev_get_gpio_in(DEVICE(&s->avic), in fsl_imx25_realize()
222 if (!sysbus_realize(SYS_BUS_DEVICE(&s->gpio[i]), errp)) { in fsl_imx25_realize()
225 sysbus_mmio_map(SYS_BUS_DEVICE(&s->gpio[i]), 0, gpio_table[i].addr); in fsl_imx25_realize()
227 sysbus_connect_irq(SYS_BUS_DEVICE(&s->gpio[i]), 0, in fsl_imx25_realize()
228 qdev_get_gpio_in(DEVICE(&s->avic), in fsl_imx25_realize()
242 object_property_set_uint(OBJECT(&s->esdhc[i]), "sd-spec-version", 2, in fsl_imx25_realize()
244 object_property_set_uint(OBJECT(&s->esdhc[i]), "capareg", in fsl_imx25_realize()
246 object_property_set_uint(OBJECT(&s->esdhc[i]), "vendor", in fsl_imx25_realize()
248 if (!sysbus_realize(SYS_BUS_DEVICE(&s->esdhc[i]), errp)) { in fsl_imx25_realize()
251 sysbus_mmio_map(SYS_BUS_DEVICE(&s->esdhc[i]), 0, esdhc_table[i].addr); in fsl_imx25_realize()
252 sysbus_connect_irq(SYS_BUS_DEVICE(&s->esdhc[i]), 0, in fsl_imx25_realize()
253 qdev_get_gpio_in(DEVICE(&s->avic), in fsl_imx25_realize()
267 sysbus_realize(SYS_BUS_DEVICE(&s->usb[i]), &error_abort); in fsl_imx25_realize()
268 sysbus_mmio_map(SYS_BUS_DEVICE(&s->usb[i]), 0, usb_table[i].addr); in fsl_imx25_realize()
269 sysbus_connect_irq(SYS_BUS_DEVICE(&s->usb[i]), 0, in fsl_imx25_realize()
270 qdev_get_gpio_in(DEVICE(&s->avic), in fsl_imx25_realize()
275 object_property_set_bool(OBJECT(&s->wdt), "pretimeout-support", true, in fsl_imx25_realize()
277 sysbus_realize(SYS_BUS_DEVICE(&s->wdt), &error_abort); in fsl_imx25_realize()
278 sysbus_mmio_map(SYS_BUS_DEVICE(&s->wdt), 0, FSL_IMX25_WDT_ADDR); in fsl_imx25_realize()
279 sysbus_connect_irq(SYS_BUS_DEVICE(&s->wdt), 0, in fsl_imx25_realize()
280 qdev_get_gpio_in(DEVICE(&s->avic), in fsl_imx25_realize()
284 if (!memory_region_init_rom(&s->rom[0], OBJECT(dev), "imx25.rom0", in fsl_imx25_realize()
289 &s->rom[0]); in fsl_imx25_realize()
290 if (!memory_region_init_rom(&s->rom[1], OBJECT(dev), "imx25.rom1", in fsl_imx25_realize()
295 &s->rom[1]); in fsl_imx25_realize()
298 if (!memory_region_init_ram(&s->iram, NULL, "imx25.iram", in fsl_imx25_realize()
303 &s->iram); in fsl_imx25_realize()
305 /* internal RAM (128 KB) is aliased over 128 MB - 128 KB */ in fsl_imx25_realize()
306 memory_region_init_alias(&s->iram_alias, OBJECT(dev), "imx25.iram_alias", in fsl_imx25_realize()
307 &s->iram, 0, FSL_IMX25_IRAM_ALIAS_SIZE); in fsl_imx25_realize()
309 &s->iram_alias); in fsl_imx25_realize()
313 DEFINE_PROP_UINT32("fec-phy-num", FslIMX25State, phy_num, 0),
322 dc->realize = fsl_imx25_realize; in fsl_imx25_class_init()
323 dc->desc = "i.MX25 SOC"; in fsl_imx25_class_init()
325 * Reason: uses serial_hds in realize and the imx25 board does not in fsl_imx25_class_init()
328 dc->user_creatable = false; in fsl_imx25_class_init()