Lines Matching +full:reset +full:- +full:snvs +full:- +full:powered
8 * Based on hw/arm/fsl-imx6.c
23 #include "hw/arm/fsl-imx7.h"
27 #include "qemu/error-report.h"
29 #include "target/arm/cpu-qom.h"
43 for (i = 0; i < MIN(ms->smp.cpus, FSL_IMX7_NUM_CPUS); i++) { in fsl_imx7_init()
45 object_initialize_child(obj, name, &s->cpu[i], in fsl_imx7_init()
46 ARM_CPU_TYPE_NAME("cortex-a7")); in fsl_imx7_init()
52 object_initialize_child(obj, "a7mpcore", &s->a7mpcore, in fsl_imx7_init()
60 object_initialize_child(obj, name, &s->gpio[i], TYPE_IMX_GPIO); in fsl_imx7_init()
68 object_initialize_child(obj, name, &s->gpt[i], TYPE_IMX7_GPT); in fsl_imx7_init()
74 object_initialize_child(obj, "ccm", &s->ccm, TYPE_IMX7_CCM); in fsl_imx7_init()
79 object_initialize_child(obj, "analog", &s->analog, TYPE_IMX7_ANALOG); in fsl_imx7_init()
84 object_initialize_child(obj, "gpcv2", &s->gpcv2, TYPE_IMX_GPCV2); in fsl_imx7_init()
89 object_initialize_child(obj, "src", &s->src, TYPE_IMX7_SRC); in fsl_imx7_init()
96 object_initialize_child(obj, name, &s->spi[i], TYPE_IMX_SPI); in fsl_imx7_init()
104 object_initialize_child(obj, name, &s->i2c[i], TYPE_IMX_I2C); in fsl_imx7_init()
112 object_initialize_child(obj, name, &s->uart[i], TYPE_IMX_SERIAL); in fsl_imx7_init()
120 object_initialize_child(obj, name, &s->eth[i], TYPE_IMX_ENET); in fsl_imx7_init()
128 object_initialize_child(obj, name, &s->usdhc[i], TYPE_IMX_USDHC); in fsl_imx7_init()
132 * SNVS in fsl_imx7_init()
134 object_initialize_child(obj, "snvs", &s->snvs, TYPE_IMX7_SNVS); in fsl_imx7_init()
141 object_initialize_child(obj, name, &s->wdt[i], TYPE_IMX2_WDT); in fsl_imx7_init()
147 object_initialize_child(obj, "gpr", &s->gpr, TYPE_IMX7_GPR); in fsl_imx7_init()
152 object_initialize_child(obj, "pcie", &s->pcie, TYPE_DESIGNWARE_PCIE_HOST); in fsl_imx7_init()
159 object_initialize_child(obj, name, &s->usb[i], TYPE_CHIPIDEA); in fsl_imx7_init()
171 unsigned int smp_cpus = ms->smp.cpus; in fsl_imx7_realize()
183 o = OBJECT(&s->cpu[i]); in fsl_imx7_realize()
187 object_property_set_int(o, "reset-cbar", FSL_IMX7_A7MPCORE_ADDR, in fsl_imx7_realize()
193 * Secondary CPUs start in powered-down state (and can be in fsl_imx7_realize()
194 * powered up via the SRC system reset controller) in fsl_imx7_realize()
196 object_property_set_bool(o, "start-powered-off", true, in fsl_imx7_realize()
206 object_property_set_int(OBJECT(&s->a7mpcore), "num-cpu", smp_cpus, in fsl_imx7_realize()
208 object_property_set_int(OBJECT(&s->a7mpcore), "num-irq", in fsl_imx7_realize()
211 sysbus_realize(SYS_BUS_DEVICE(&s->a7mpcore), &error_abort); in fsl_imx7_realize()
212 sysbus_mmio_map(SYS_BUS_DEVICE(&s->a7mpcore), 0, FSL_IMX7_A7MPCORE_ADDR); in fsl_imx7_realize()
215 SysBusDevice *sbd = SYS_BUS_DEVICE(&s->a7mpcore); in fsl_imx7_realize()
231 create_unimplemented_device("a7mpcore-dap", FSL_IMX7_A7MPCORE_DAP_ADDR, in fsl_imx7_realize()
252 s->gpt[i].ccm = IMX_CCM(&s->ccm); in fsl_imx7_realize()
253 sysbus_realize(SYS_BUS_DEVICE(&s->gpt[i]), &error_abort); in fsl_imx7_realize()
254 sysbus_mmio_map(SYS_BUS_DEVICE(&s->gpt[i]), 0, FSL_IMX7_GPTn_ADDR[i]); in fsl_imx7_realize()
255 sysbus_connect_irq(SYS_BUS_DEVICE(&s->gpt[i]), 0, in fsl_imx7_realize()
256 qdev_get_gpio_in(DEVICE(&s->a7mpcore), in fsl_imx7_realize()
294 sysbus_realize(SYS_BUS_DEVICE(&s->gpio[i]), &error_abort); in fsl_imx7_realize()
295 sysbus_mmio_map(SYS_BUS_DEVICE(&s->gpio[i]), 0, in fsl_imx7_realize()
298 sysbus_connect_irq(SYS_BUS_DEVICE(&s->gpio[i]), 0, in fsl_imx7_realize()
299 qdev_get_gpio_in(DEVICE(&s->a7mpcore), in fsl_imx7_realize()
302 sysbus_connect_irq(SYS_BUS_DEVICE(&s->gpio[i]), 1, in fsl_imx7_realize()
303 qdev_get_gpio_in(DEVICE(&s->a7mpcore), in fsl_imx7_realize()
318 sysbus_realize(SYS_BUS_DEVICE(&s->ccm), &error_abort); in fsl_imx7_realize()
319 sysbus_mmio_map(SYS_BUS_DEVICE(&s->ccm), 0, FSL_IMX7_CCM_ADDR); in fsl_imx7_realize()
324 sysbus_realize(SYS_BUS_DEVICE(&s->analog), &error_abort); in fsl_imx7_realize()
325 sysbus_mmio_map(SYS_BUS_DEVICE(&s->analog), 0, FSL_IMX7_ANALOG_ADDR); in fsl_imx7_realize()
330 sysbus_realize(SYS_BUS_DEVICE(&s->gpcv2), &error_abort); in fsl_imx7_realize()
331 sysbus_mmio_map(SYS_BUS_DEVICE(&s->gpcv2), 0, FSL_IMX7_GPC_ADDR); in fsl_imx7_realize()
352 sysbus_realize(SYS_BUS_DEVICE(&s->spi[i]), &error_abort); in fsl_imx7_realize()
353 sysbus_mmio_map(SYS_BUS_DEVICE(&s->spi[i]), 0, in fsl_imx7_realize()
355 sysbus_connect_irq(SYS_BUS_DEVICE(&s->spi[i]), 0, in fsl_imx7_realize()
356 qdev_get_gpio_in(DEVICE(&s->a7mpcore), in fsl_imx7_realize()
378 sysbus_realize(SYS_BUS_DEVICE(&s->i2c[i]), &error_abort); in fsl_imx7_realize()
379 sysbus_mmio_map(SYS_BUS_DEVICE(&s->i2c[i]), 0, FSL_IMX7_I2Cn_ADDR[i]); in fsl_imx7_realize()
381 sysbus_connect_irq(SYS_BUS_DEVICE(&s->i2c[i]), 0, in fsl_imx7_realize()
382 qdev_get_gpio_in(DEVICE(&s->a7mpcore), in fsl_imx7_realize()
411 qdev_prop_set_chr(DEVICE(&s->uart[i]), "chardev", serial_hd(i)); in fsl_imx7_realize()
413 sysbus_realize(SYS_BUS_DEVICE(&s->uart[i]), &error_abort); in fsl_imx7_realize()
415 sysbus_mmio_map(SYS_BUS_DEVICE(&s->uart[i]), 0, FSL_IMX7_UARTn_ADDR[i]); in fsl_imx7_realize()
417 irq = qdev_get_gpio_in(DEVICE(&s->a7mpcore), FSL_IMX7_UARTn_IRQ[i]); in fsl_imx7_realize()
418 sysbus_connect_irq(SYS_BUS_DEVICE(&s->uart[i]), 0, irq); in fsl_imx7_realize()
428 object_property_set_bool(OBJECT(&s->eth[i]), "phy-connected", in fsl_imx7_realize()
429 s->phy_connected[i], &error_abort); in fsl_imx7_realize()
434 if (!s->phy_connected[i]) { in fsl_imx7_realize()
435 object_property_set_link(OBJECT(&s->eth[1 - i]), "phy-consumer", in fsl_imx7_realize()
436 OBJECT(&s->eth[i]), &error_abort); in fsl_imx7_realize()
446 object_property_set_uint(OBJECT(&s->eth[i]), "phy-num", in fsl_imx7_realize()
447 s->phy_num[i], &error_abort); in fsl_imx7_realize()
448 object_property_set_uint(OBJECT(&s->eth[i]), "tx-ring-num", in fsl_imx7_realize()
450 qemu_configure_nic_device(DEVICE(&s->eth[i]), true, NULL); in fsl_imx7_realize()
451 sysbus_realize(SYS_BUS_DEVICE(&s->eth[i]), &error_abort); in fsl_imx7_realize()
453 sysbus_mmio_map(SYS_BUS_DEVICE(&s->eth[i]), 0, FSL_IMX7_ENETn_ADDR[i]); in fsl_imx7_realize()
455 irq = qdev_get_gpio_in(DEVICE(&s->a7mpcore), FSL_IMX7_ENET_IRQ(i, 0)); in fsl_imx7_realize()
456 sysbus_connect_irq(SYS_BUS_DEVICE(&s->eth[i]), 0, irq); in fsl_imx7_realize()
457 irq = qdev_get_gpio_in(DEVICE(&s->a7mpcore), FSL_IMX7_ENET_IRQ(i, 3)); in fsl_imx7_realize()
458 sysbus_connect_irq(SYS_BUS_DEVICE(&s->eth[i]), 1, irq); in fsl_imx7_realize()
477 object_property_set_uint(OBJECT(&s->usdhc[i]), "vendor", in fsl_imx7_realize()
479 sysbus_realize(SYS_BUS_DEVICE(&s->usdhc[i]), &error_abort); in fsl_imx7_realize()
481 sysbus_mmio_map(SYS_BUS_DEVICE(&s->usdhc[i]), 0, in fsl_imx7_realize()
484 irq = qdev_get_gpio_in(DEVICE(&s->a7mpcore), FSL_IMX7_USDHCn_IRQ[i]); in fsl_imx7_realize()
485 sysbus_connect_irq(SYS_BUS_DEVICE(&s->usdhc[i]), 0, irq); in fsl_imx7_realize()
489 * SNVS in fsl_imx7_realize()
491 sysbus_realize(SYS_BUS_DEVICE(&s->snvs), &error_abort); in fsl_imx7_realize()
492 sysbus_mmio_map(SYS_BUS_DEVICE(&s->snvs), 0, FSL_IMX7_SNVS_HP_ADDR); in fsl_imx7_realize()
497 sysbus_realize(SYS_BUS_DEVICE(&s->src), &error_abort); in fsl_imx7_realize()
498 sysbus_mmio_map(SYS_BUS_DEVICE(&s->src), 0, FSL_IMX7_SRC_ADDR); in fsl_imx7_realize()
517 object_property_set_bool(OBJECT(&s->wdt[i]), "pretimeout-support", in fsl_imx7_realize()
519 sysbus_realize(SYS_BUS_DEVICE(&s->wdt[i]), &error_abort); in fsl_imx7_realize()
521 sysbus_mmio_map(SYS_BUS_DEVICE(&s->wdt[i]), 0, FSL_IMX7_WDOGn_ADDR[i]); in fsl_imx7_realize()
522 sysbus_connect_irq(SYS_BUS_DEVICE(&s->wdt[i]), 0, in fsl_imx7_realize()
523 qdev_get_gpio_in(DEVICE(&s->a7mpcore), in fsl_imx7_realize()
591 sysbus_realize(SYS_BUS_DEVICE(&s->gpr), &error_abort); in fsl_imx7_realize()
592 sysbus_mmio_map(SYS_BUS_DEVICE(&s->gpr), 0, FSL_IMX7_IOMUXC_GPR_ADDR); in fsl_imx7_realize()
597 sysbus_realize(SYS_BUS_DEVICE(&s->pcie), &error_abort); in fsl_imx7_realize()
598 sysbus_mmio_map(SYS_BUS_DEVICE(&s->pcie), 0, FSL_IMX7_PCIE_REG_ADDR); in fsl_imx7_realize()
600 irq = qdev_get_gpio_in(DEVICE(&s->a7mpcore), FSL_IMX7_PCI_INTA_IRQ); in fsl_imx7_realize()
601 sysbus_connect_irq(SYS_BUS_DEVICE(&s->pcie), 0, irq); in fsl_imx7_realize()
602 irq = qdev_get_gpio_in(DEVICE(&s->a7mpcore), FSL_IMX7_PCI_INTB_IRQ); in fsl_imx7_realize()
603 sysbus_connect_irq(SYS_BUS_DEVICE(&s->pcie), 1, irq); in fsl_imx7_realize()
604 irq = qdev_get_gpio_in(DEVICE(&s->a7mpcore), FSL_IMX7_PCI_INTC_IRQ); in fsl_imx7_realize()
605 sysbus_connect_irq(SYS_BUS_DEVICE(&s->pcie), 2, irq); in fsl_imx7_realize()
606 irq = qdev_get_gpio_in(DEVICE(&s->a7mpcore), FSL_IMX7_PCI_INTD_IRQ); in fsl_imx7_realize()
607 sysbus_connect_irq(SYS_BUS_DEVICE(&s->pcie), 3, irq); in fsl_imx7_realize()
631 sysbus_realize(SYS_BUS_DEVICE(&s->usb[i]), &error_abort); in fsl_imx7_realize()
632 sysbus_mmio_map(SYS_BUS_DEVICE(&s->usb[i]), 0, in fsl_imx7_realize()
635 irq = qdev_get_gpio_in(DEVICE(&s->a7mpcore), FSL_IMX7_USBn_IRQ[i]); in fsl_imx7_realize()
636 sysbus_connect_irq(SYS_BUS_DEVICE(&s->usb[i]), 0, irq); in fsl_imx7_realize()
666 create_unimplemented_device("dma-apbh", FSL_IMX7_DMA_APBH_ADDR, in fsl_imx7_realize()
671 create_unimplemented_device("pcie-phy", FSL_IMX7_PCIE_PHY_ADDR, in fsl_imx7_realize()
689 memory_region_init_ram(&s->ocram, NULL, "imx7.ocram", in fsl_imx7_realize()
693 &s->ocram); in fsl_imx7_realize()
698 memory_region_init_ram(&s->ocram_epdc, NULL, "imx7.ocram_epdc", in fsl_imx7_realize()
702 &s->ocram_epdc); in fsl_imx7_realize()
707 memory_region_init_ram(&s->ocram_pxp, NULL, "imx7.ocram_pxp", in fsl_imx7_realize()
711 &s->ocram_pxp); in fsl_imx7_realize()
716 memory_region_init_ram(&s->ocram_s, NULL, "imx7.ocram_s", in fsl_imx7_realize()
720 &s->ocram_s); in fsl_imx7_realize()
725 memory_region_init_rom(&s->rom, OBJECT(dev), "imx7.rom", in fsl_imx7_realize()
728 &s->rom); in fsl_imx7_realize()
733 memory_region_init_rom(&s->caam, OBJECT(dev), "imx7.caam", in fsl_imx7_realize()
736 &s->caam); in fsl_imx7_realize()
740 DEFINE_PROP_UINT32("fec1-phy-num", FslIMX7State, phy_num[0], 0),
741 DEFINE_PROP_UINT32("fec2-phy-num", FslIMX7State, phy_num[1], 1),
742 DEFINE_PROP_BOOL("fec1-phy-connected", FslIMX7State, phy_connected[0],
744 DEFINE_PROP_BOOL("fec2-phy-connected", FslIMX7State, phy_connected[1],
754 dc->realize = fsl_imx7_realize; in fsl_imx7_class_init()
757 dc->user_creatable = false; in fsl_imx7_class_init()
758 dc->desc = "i.MX7 SOC"; in fsl_imx7_class_init()