Lines Matching +full:ast2600 +full:- +full:lpc +full:- +full:reset

4  * Copyright (c) 2016-2019, IBM Corporation.
7 * the COPYING file in the top-level directory.
15 #include "qemu/error-report.h"
19 #include "target/arm/cpu-qom.h"
28 /* 0x16000000 0x17FFFFFF : AHB BUS do LPC Bus bridge */
96 /* Shared Peripheral Interrupt values below are offset by -32 from datasheet */
138 [ASPEED_DEV_I2C] = 110, /* 110 -> 125 */
139 [ASPEED_DEV_PCIE] = 167, /* 167 -> 168 */
146 [ASPEED_DEV_KCS] = 138, /* 138 -> 142 */
150 [ASPEED_DEV_I3C] = 102, /* 102 -> 107 */
158 return qdev_get_gpio_in(DEVICE(&a->a7mpcore), sc->irqmap[dev]); in aspeed_soc_ast2600_get_irq()
170 if (sscanf(sc->name, "%7s", socname) != 1) { in aspeed_soc_ast2600_init()
174 for (i = 0; i < sc->num_cpus; i++) { in aspeed_soc_ast2600_init()
175 object_initialize_child(obj, "cpu[*]", &a->cpu[i], in aspeed_soc_ast2600_init()
179 snprintf(typename, sizeof(typename), "aspeed.scu-%s", socname); in aspeed_soc_ast2600_init()
180 object_initialize_child(obj, "scu", &s->scu, typename); in aspeed_soc_ast2600_init()
181 qdev_prop_set_uint32(DEVICE(&s->scu), "silicon-rev", in aspeed_soc_ast2600_init()
182 sc->silicon_rev); in aspeed_soc_ast2600_init()
183 object_property_add_alias(obj, "hw-strap1", OBJECT(&s->scu), in aspeed_soc_ast2600_init()
184 "hw-strap1"); in aspeed_soc_ast2600_init()
185 object_property_add_alias(obj, "hw-strap2", OBJECT(&s->scu), in aspeed_soc_ast2600_init()
186 "hw-strap2"); in aspeed_soc_ast2600_init()
187 object_property_add_alias(obj, "hw-prot-key", OBJECT(&s->scu), in aspeed_soc_ast2600_init()
188 "hw-prot-key"); in aspeed_soc_ast2600_init()
190 object_initialize_child(obj, "a7mpcore", &a->a7mpcore, in aspeed_soc_ast2600_init()
193 object_initialize_child(obj, "rtc", &s->rtc, TYPE_ASPEED_RTC); in aspeed_soc_ast2600_init()
195 snprintf(typename, sizeof(typename), "aspeed.timer-%s", socname); in aspeed_soc_ast2600_init()
196 object_initialize_child(obj, "timerctrl", &s->timerctrl, typename); in aspeed_soc_ast2600_init()
198 for (i = 0; i < sc->wdts_num; i++) { in aspeed_soc_ast2600_init()
199 snprintf(typename, sizeof(typename), "aspeed.wdt-%s", socname); in aspeed_soc_ast2600_init()
200 object_initialize_child(obj, "wdt[*]", &s->wdt[i], typename); in aspeed_soc_ast2600_init()
203 snprintf(typename, sizeof(typename), "aspeed.adc-%s", socname); in aspeed_soc_ast2600_init()
204 object_initialize_child(obj, "adc", &s->adc, typename); in aspeed_soc_ast2600_init()
206 snprintf(typename, sizeof(typename), "aspeed.i2c-%s", socname); in aspeed_soc_ast2600_init()
207 object_initialize_child(obj, "i2c", &s->i2c, typename); in aspeed_soc_ast2600_init()
209 object_initialize_child(obj, "pcie-rc", &s->pcie, TYPE_ASPEED_PCIE_CFG); in aspeed_soc_ast2600_init()
211 for (i = 0; i < ARRAY_SIZE(s->pcie_phy); i++) { in aspeed_soc_ast2600_init()
212 object_initialize_child(obj, "pcie-phy[*]", &s->pcie_phy[i], in aspeed_soc_ast2600_init()
216 object_initialize_child(obj, "peci", &s->peci, TYPE_ASPEED_PECI); in aspeed_soc_ast2600_init()
218 snprintf(typename, sizeof(typename), "aspeed.fmc-%s", socname); in aspeed_soc_ast2600_init()
219 object_initialize_child(obj, "fmc", &s->fmc, typename); in aspeed_soc_ast2600_init()
221 for (i = 0; i < sc->spis_num; i++) { in aspeed_soc_ast2600_init()
222 snprintf(typename, sizeof(typename), "aspeed.spi%d-%s", i + 1, socname); in aspeed_soc_ast2600_init()
223 object_initialize_child(obj, "spi[*]", &s->spi[i], typename); in aspeed_soc_ast2600_init()
226 for (i = 0; i < sc->ehcis_num; i++) { in aspeed_soc_ast2600_init()
227 object_initialize_child(obj, "ehci[*]", &s->ehci[i], in aspeed_soc_ast2600_init()
231 object_initialize_child(obj, "uhci", &s->uhci, TYPE_ASPEED_UHCI); in aspeed_soc_ast2600_init()
233 snprintf(typename, sizeof(typename), "aspeed.sdmc-%s", socname); in aspeed_soc_ast2600_init()
234 object_initialize_child(obj, "sdmc", &s->sdmc, typename); in aspeed_soc_ast2600_init()
235 object_property_add_alias(obj, "ram-size", OBJECT(&s->sdmc), in aspeed_soc_ast2600_init()
236 "ram-size"); in aspeed_soc_ast2600_init()
238 for (i = 0; i < sc->macs_num; i++) { in aspeed_soc_ast2600_init()
239 object_initialize_child(obj, "ftgmac100[*]", &s->ftgmac100[i], in aspeed_soc_ast2600_init()
242 object_initialize_child(obj, "mii[*]", &s->mii[i], TYPE_ASPEED_MII); in aspeed_soc_ast2600_init()
245 for (i = 0; i < sc->uarts_num; i++) { in aspeed_soc_ast2600_init()
246 object_initialize_child(obj, "uart[*]", &s->uart[i], TYPE_SERIAL_MM); in aspeed_soc_ast2600_init()
249 snprintf(typename, sizeof(typename), TYPE_ASPEED_XDMA "-%s", socname); in aspeed_soc_ast2600_init()
250 object_initialize_child(obj, "xdma", &s->xdma, typename); in aspeed_soc_ast2600_init()
252 snprintf(typename, sizeof(typename), "aspeed.gpio-%s", socname); in aspeed_soc_ast2600_init()
253 object_initialize_child(obj, "gpio", &s->gpio, typename); in aspeed_soc_ast2600_init()
255 snprintf(typename, sizeof(typename), "aspeed.gpio-%s-1_8v", socname); in aspeed_soc_ast2600_init()
256 object_initialize_child(obj, "gpio_1_8v", &s->gpio_1_8v, typename); in aspeed_soc_ast2600_init()
258 snprintf(typename, sizeof(typename), "aspeed.sdhci-%s", socname); in aspeed_soc_ast2600_init()
259 object_initialize_child(obj, "sd-controller", &s->sdhci, typename); in aspeed_soc_ast2600_init()
261 object_property_set_int(OBJECT(&s->sdhci), "num-slots", 2, &error_abort); in aspeed_soc_ast2600_init()
265 object_initialize_child(obj, "sd-controller.sdhci[*]", in aspeed_soc_ast2600_init()
266 &s->sdhci.slots[i], TYPE_SYSBUS_SDHCI); in aspeed_soc_ast2600_init()
269 object_initialize_child(obj, "emmc-controller", &s->emmc, typename); in aspeed_soc_ast2600_init()
271 object_property_set_int(OBJECT(&s->emmc), "num-slots", 1, &error_abort); in aspeed_soc_ast2600_init()
273 object_initialize_child(obj, "emmc-controller.sdhci", &s->emmc.slots[0], in aspeed_soc_ast2600_init()
276 object_initialize_child(obj, "lpc", &s->lpc, TYPE_ASPEED_LPC); in aspeed_soc_ast2600_init()
278 object_initialize_child(obj, "ibt", &s->ibt, TYPE_ASPEED_IBT); in aspeed_soc_ast2600_init()
280 snprintf(typename, sizeof(typename), "aspeed.hace-%s", socname); in aspeed_soc_ast2600_init()
281 object_initialize_child(obj, "hace", &s->hace, typename); in aspeed_soc_ast2600_init()
283 object_initialize_child(obj, "i3c", &s->i3c, TYPE_ASPEED_I3C); in aspeed_soc_ast2600_init()
285 object_initialize_child(obj, "sbc", &s->sbc, TYPE_ASPEED_SBC); in aspeed_soc_ast2600_init()
287 object_initialize_child(obj, "iomem", &s->iomem, TYPE_UNIMPLEMENTED_DEVICE); in aspeed_soc_ast2600_init()
288 object_initialize_child(obj, "video", &s->video, TYPE_UNIMPLEMENTED_DEVICE); in aspeed_soc_ast2600_init()
289 object_initialize_child(obj, "dpmcu", &s->dpmcu, TYPE_UNIMPLEMENTED_DEVICE); in aspeed_soc_ast2600_init()
290 object_initialize_child(obj, "emmc-boot-controller", in aspeed_soc_ast2600_init()
291 &s->emmc_boot_controller, in aspeed_soc_ast2600_init()
295 object_initialize_child(obj, "fsi[*]", &s->fsi[i], TYPE_ASPEED_APB2OPB); in aspeed_soc_ast2600_init()
298 object_initialize_child(obj, "gfx", &s->gfx, TYPE_ASPEED_GFX); in aspeed_soc_ast2600_init()
300 object_initialize_child(obj, "pwm", &s->pwm, TYPE_ASPEED_PWM); in aspeed_soc_ast2600_init()
304 * ASPEED ast2600 has 0xf as cluster ID
306 …ocumentation/ddi0388/e/the-system-control-coprocessors/summary-of-system-control-coprocessor-regis…
321 g_autofree char *usb_bus = g_strdup_printf("usb-bus.%u", sc->ehcis_num - 1); in aspeed_soc_ast2600_realize()
324 memory_region_init(&s->spi_boot_container, OBJECT(s), in aspeed_soc_ast2600_realize()
326 memory_region_add_subregion(s->memory, sc->memmap[ASPEED_DEV_SPI_BOOT], in aspeed_soc_ast2600_realize()
327 &s->spi_boot_container); in aspeed_soc_ast2600_realize()
330 aspeed_mmio_map_unimplemented(s, SYS_BUS_DEVICE(&s->iomem), "aspeed.io", in aspeed_soc_ast2600_realize()
331 sc->memmap[ASPEED_DEV_IOMEM], in aspeed_soc_ast2600_realize()
335 aspeed_mmio_map_unimplemented(s, SYS_BUS_DEVICE(&s->video), "aspeed.video", in aspeed_soc_ast2600_realize()
336 sc->memmap[ASPEED_DEV_VIDEO], 0x1000); in aspeed_soc_ast2600_realize()
339 aspeed_mmio_map_unimplemented(s, SYS_BUS_DEVICE(&s->emmc_boot_controller), in aspeed_soc_ast2600_realize()
340 "aspeed.emmc-boot-controller", in aspeed_soc_ast2600_realize()
341 sc->memmap[ASPEED_DEV_EMMC_BC], 0x1000); in aspeed_soc_ast2600_realize()
344 for (i = 0; i < sc->num_cpus; i++) { in aspeed_soc_ast2600_realize()
345 if (sc->num_cpus > 1) { in aspeed_soc_ast2600_realize()
346 object_property_set_int(OBJECT(&a->cpu[i]), "reset-cbar", in aspeed_soc_ast2600_realize()
349 object_property_set_int(OBJECT(&a->cpu[i]), "mp-affinity", in aspeed_soc_ast2600_realize()
352 object_property_set_int(OBJECT(&a->cpu[i]), "cntfrq", 1125000000, in aspeed_soc_ast2600_realize()
354 object_property_set_bool(OBJECT(&a->cpu[i]), "neon", false, in aspeed_soc_ast2600_realize()
356 object_property_set_bool(OBJECT(&a->cpu[i]), "vfp-d32", false, in aspeed_soc_ast2600_realize()
358 object_property_set_link(OBJECT(&a->cpu[i]), "memory", in aspeed_soc_ast2600_realize()
359 OBJECT(s->memory), &error_abort); in aspeed_soc_ast2600_realize()
361 if (!qdev_realize(DEVICE(&a->cpu[i]), NULL, errp)) { in aspeed_soc_ast2600_realize()
367 object_property_set_int(OBJECT(&a->a7mpcore), "num-cpu", sc->num_cpus, in aspeed_soc_ast2600_realize()
369 object_property_set_int(OBJECT(&a->a7mpcore), "num-irq", in aspeed_soc_ast2600_realize()
373 sysbus_realize(SYS_BUS_DEVICE(&a->a7mpcore), &error_abort); in aspeed_soc_ast2600_realize()
374 aspeed_mmio_map(s, SYS_BUS_DEVICE(&a->a7mpcore), 0, ASPEED_A7MPCORE_ADDR); in aspeed_soc_ast2600_realize()
376 for (i = 0; i < sc->num_cpus; i++) { in aspeed_soc_ast2600_realize()
377 SysBusDevice *sbd = SYS_BUS_DEVICE(&a->a7mpcore); in aspeed_soc_ast2600_realize()
378 DeviceState *d = DEVICE(&a->cpu[i]); in aspeed_soc_ast2600_realize()
383 sysbus_connect_irq(sbd, i + sc->num_cpus, irq); in aspeed_soc_ast2600_realize()
385 sysbus_connect_irq(sbd, i + 2 * sc->num_cpus, irq); in aspeed_soc_ast2600_realize()
387 sysbus_connect_irq(sbd, i + 3 * sc->num_cpus, irq); in aspeed_soc_ast2600_realize()
391 sram_name = g_strdup_printf("aspeed.sram.%d", CPU(&a->cpu[0])->cpu_index); in aspeed_soc_ast2600_realize()
392 if (!memory_region_init_ram(&s->sram, OBJECT(s), sram_name, sc->sram_size, in aspeed_soc_ast2600_realize()
396 memory_region_add_subregion(s->memory, in aspeed_soc_ast2600_realize()
397 sc->memmap[ASPEED_DEV_SRAM], &s->sram); in aspeed_soc_ast2600_realize()
400 aspeed_mmio_map_unimplemented(s, SYS_BUS_DEVICE(&s->dpmcu), "aspeed.dpmcu", in aspeed_soc_ast2600_realize()
401 sc->memmap[ASPEED_DEV_DPMCU], in aspeed_soc_ast2600_realize()
405 if (!sysbus_realize(SYS_BUS_DEVICE(&s->scu), errp)) { in aspeed_soc_ast2600_realize()
408 aspeed_mmio_map(s, SYS_BUS_DEVICE(&s->scu), 0, sc->memmap[ASPEED_DEV_SCU]); in aspeed_soc_ast2600_realize()
411 if (!sysbus_realize(SYS_BUS_DEVICE(&s->rtc), errp)) { in aspeed_soc_ast2600_realize()
414 aspeed_mmio_map(s, SYS_BUS_DEVICE(&s->rtc), 0, sc->memmap[ASPEED_DEV_RTC]); in aspeed_soc_ast2600_realize()
415 sysbus_connect_irq(SYS_BUS_DEVICE(&s->rtc), 0, in aspeed_soc_ast2600_realize()
419 object_property_set_link(OBJECT(&s->timerctrl), "scu", OBJECT(&s->scu), in aspeed_soc_ast2600_realize()
421 if (!sysbus_realize(SYS_BUS_DEVICE(&s->timerctrl), errp)) { in aspeed_soc_ast2600_realize()
424 aspeed_mmio_map(s, SYS_BUS_DEVICE(&s->timerctrl), 0, in aspeed_soc_ast2600_realize()
425 sc->memmap[ASPEED_DEV_TIMER1]); in aspeed_soc_ast2600_realize()
428 sysbus_connect_irq(SYS_BUS_DEVICE(&s->timerctrl), i, irq); in aspeed_soc_ast2600_realize()
432 for (i = 0; i < sc->wdts_num; i++) { in aspeed_soc_ast2600_realize()
433 AspeedWDTClass *awc = ASPEED_WDT_GET_CLASS(&s->wdt[i]); in aspeed_soc_ast2600_realize()
435 object_property_set_link(OBJECT(&s->wdt[i]), "scu", OBJECT(&s->scu), in aspeed_soc_ast2600_realize()
437 if (!sysbus_realize(SYS_BUS_DEVICE(&s->wdt[i]), errp)) { in aspeed_soc_ast2600_realize()
440 aspeed_mmio_map(s, SYS_BUS_DEVICE(&s->wdt[i]), 0, in aspeed_soc_ast2600_realize()
441 sc->memmap[ASPEED_DEV_WDT] + i * awc->iosize); in aspeed_soc_ast2600_realize()
445 if (!sysbus_realize(SYS_BUS_DEVICE(&s->adc), errp)) { in aspeed_soc_ast2600_realize()
448 aspeed_mmio_map(s, SYS_BUS_DEVICE(&s->adc), 0, sc->memmap[ASPEED_DEV_ADC]); in aspeed_soc_ast2600_realize()
449 sysbus_connect_irq(SYS_BUS_DEVICE(&s->adc), 0, in aspeed_soc_ast2600_realize()
458 object_property_set_link(OBJECT(&s->i2c), "dram", OBJECT(s->dram_mr), in aspeed_soc_ast2600_realize()
460 if (!sysbus_realize(SYS_BUS_DEVICE(&s->i2c), errp)) { in aspeed_soc_ast2600_realize()
463 aspeed_mmio_map(s, SYS_BUS_DEVICE(&s->i2c), 0, sc->memmap[ASPEED_DEV_I2C]); in aspeed_soc_ast2600_realize()
464 for (i = 0; i < ASPEED_I2C_GET_CLASS(&s->i2c)->num_busses; i++) { in aspeed_soc_ast2600_realize()
465 irq = qdev_get_gpio_in(DEVICE(&a->a7mpcore), in aspeed_soc_ast2600_realize()
466 sc->irqmap[ASPEED_DEV_I2C] + i); in aspeed_soc_ast2600_realize()
467 /* The AST2600 I2C controller has one IRQ per bus. */ in aspeed_soc_ast2600_realize()
468 sysbus_connect_irq(SYS_BUS_DEVICE(&s->i2c.busses[i]), 0, irq); in aspeed_soc_ast2600_realize()
472 if (!sysbus_realize(SYS_BUS_DEVICE(&s->peci), errp)) { in aspeed_soc_ast2600_realize()
475 aspeed_mmio_map(s, SYS_BUS_DEVICE(&s->peci), 0, in aspeed_soc_ast2600_realize()
476 sc->memmap[ASPEED_DEV_PECI]); in aspeed_soc_ast2600_realize()
477 sysbus_connect_irq(SYS_BUS_DEVICE(&s->peci), 0, in aspeed_soc_ast2600_realize()
481 for (i = 0; i < ARRAY_SIZE(s->pcie_phy); i++) { in aspeed_soc_ast2600_realize()
482 if (!sysbus_realize(SYS_BUS_DEVICE(&s->pcie_phy[i]), errp)) { in aspeed_soc_ast2600_realize()
485 aspeed_mmio_map(s, SYS_BUS_DEVICE(&s->pcie_phy[i]), 0, in aspeed_soc_ast2600_realize()
486 sc->memmap[ASPEED_DEV_PCIE_PHY1 + i]); in aspeed_soc_ast2600_realize()
489 if (!sysbus_realize(SYS_BUS_DEVICE(&s->pcie), errp)) { in aspeed_soc_ast2600_realize()
492 aspeed_mmio_map(s, SYS_BUS_DEVICE(&s->pcie), 0, in aspeed_soc_ast2600_realize()
493 sc->memmap[ASPEED_DEV_PCIE]); in aspeed_soc_ast2600_realize()
495 for (i = 0; i < ARRAY_SIZE(s->pcie.rcs); i++) { in aspeed_soc_ast2600_realize()
496 irq = qdev_get_gpio_in(DEVICE(&a->a7mpcore), in aspeed_soc_ast2600_realize()
497 sc->irqmap[ASPEED_DEV_PCIE] + i); in aspeed_soc_ast2600_realize()
498 sysbus_connect_irq(SYS_BUS_DEVICE(&s->pcie.rcs[i]), 0, irq); in aspeed_soc_ast2600_realize()
501 for (i = 0; i < ARRAY_SIZE(s->pcie.rcs); i++) { in aspeed_soc_ast2600_realize()
502 g_autofree char *name = g_strdup_printf("pcie-mmio-%d", i); in aspeed_soc_ast2600_realize()
507 mmio_mr = sysbus_mmio_get_region(SYS_BUS_DEVICE(&s->pcie.rcs[i]), 1); in aspeed_soc_ast2600_realize()
509 memory_region_init_alias(mmio_alias, OBJECT(&s->pcie.rcs[i]), name, in aspeed_soc_ast2600_realize()
510 mmio_mr, sc->memmap[ASPEED_DEV_PCIE_MMIO1 + i], in aspeed_soc_ast2600_realize()
513 memory_region_add_subregion(s->memory, in aspeed_soc_ast2600_realize()
514 sc->memmap[ASPEED_DEV_PCIE_MMIO1 + i], in aspeed_soc_ast2600_realize()
519 object_property_set_link(OBJECT(&s->fmc), "wdt2", OBJECT(&s->wdt[2].iomem), in aspeed_soc_ast2600_realize()
521 object_property_set_link(OBJECT(&s->fmc), "dram", OBJECT(s->dram_mr), in aspeed_soc_ast2600_realize()
523 if (!sysbus_realize(SYS_BUS_DEVICE(&s->fmc), errp)) { in aspeed_soc_ast2600_realize()
526 aspeed_mmio_map(s, SYS_BUS_DEVICE(&s->fmc), 0, sc->memmap[ASPEED_DEV_FMC]); in aspeed_soc_ast2600_realize()
527 aspeed_mmio_map(s, SYS_BUS_DEVICE(&s->fmc), 1, in aspeed_soc_ast2600_realize()
528 ASPEED_SMC_GET_CLASS(&s->fmc)->flash_window_base); in aspeed_soc_ast2600_realize()
529 sysbus_connect_irq(SYS_BUS_DEVICE(&s->fmc), 0, in aspeed_soc_ast2600_realize()
533 MemoryRegion *fmc0_mmio = &s->fmc.flashes[0].mmio; in aspeed_soc_ast2600_realize()
534 memory_region_init_alias(&s->spi_boot, OBJECT(s), "aspeed.spi_boot", in aspeed_soc_ast2600_realize()
536 memory_region_add_subregion(&s->spi_boot_container, 0x0, &s->spi_boot); in aspeed_soc_ast2600_realize()
539 for (i = 0; i < sc->spis_num; i++) { in aspeed_soc_ast2600_realize()
540 object_property_set_link(OBJECT(&s->spi[i]), "dram", in aspeed_soc_ast2600_realize()
541 OBJECT(s->dram_mr), &error_abort); in aspeed_soc_ast2600_realize()
542 if (!sysbus_realize(SYS_BUS_DEVICE(&s->spi[i]), errp)) { in aspeed_soc_ast2600_realize()
545 aspeed_mmio_map(s, SYS_BUS_DEVICE(&s->spi[i]), 0, in aspeed_soc_ast2600_realize()
546 sc->memmap[ASPEED_DEV_SPI1 + i]); in aspeed_soc_ast2600_realize()
547 aspeed_mmio_map(s, SYS_BUS_DEVICE(&s->spi[i]), 1, in aspeed_soc_ast2600_realize()
548 ASPEED_SMC_GET_CLASS(&s->spi[i])->flash_window_base); in aspeed_soc_ast2600_realize()
552 for (i = 0; i < sc->ehcis_num; i++) { in aspeed_soc_ast2600_realize()
553 if (i == sc->ehcis_num - 1) { in aspeed_soc_ast2600_realize()
554 object_property_set_bool(OBJECT(&s->ehci[i]), "companion-enable", in aspeed_soc_ast2600_realize()
557 if (!sysbus_realize(SYS_BUS_DEVICE(&s->ehci[i]), errp)) { in aspeed_soc_ast2600_realize()
560 aspeed_mmio_map(s, SYS_BUS_DEVICE(&s->ehci[i]), 0, in aspeed_soc_ast2600_realize()
561 sc->memmap[ASPEED_DEV_EHCI1 + i]); in aspeed_soc_ast2600_realize()
562 sysbus_connect_irq(SYS_BUS_DEVICE(&s->ehci[i]), 0, in aspeed_soc_ast2600_realize()
567 object_property_set_str(OBJECT(&s->uhci), "masterbus", usb_bus, in aspeed_soc_ast2600_realize()
569 if (!sysbus_realize(SYS_BUS_DEVICE(&s->uhci), errp)) { in aspeed_soc_ast2600_realize()
572 aspeed_mmio_map(s, SYS_BUS_DEVICE(&s->uhci), 0, in aspeed_soc_ast2600_realize()
573 sc->memmap[ASPEED_DEV_UHCI]); in aspeed_soc_ast2600_realize()
574 sysbus_connect_irq(SYS_BUS_DEVICE(&s->uhci), 0, in aspeed_soc_ast2600_realize()
577 /* SDMC - SDRAM Memory Controller */ in aspeed_soc_ast2600_realize()
578 if (!sysbus_realize(SYS_BUS_DEVICE(&s->sdmc), errp)) { in aspeed_soc_ast2600_realize()
581 aspeed_mmio_map(s, SYS_BUS_DEVICE(&s->sdmc), 0, in aspeed_soc_ast2600_realize()
582 sc->memmap[ASPEED_DEV_SDMC]); in aspeed_soc_ast2600_realize()
590 for (i = 0; i < sc->macs_num; i++) { in aspeed_soc_ast2600_realize()
591 object_property_set_bool(OBJECT(&s->ftgmac100[i]), "aspeed", true, in aspeed_soc_ast2600_realize()
593 if (!sysbus_realize(SYS_BUS_DEVICE(&s->ftgmac100[i]), errp)) { in aspeed_soc_ast2600_realize()
596 aspeed_mmio_map(s, SYS_BUS_DEVICE(&s->ftgmac100[i]), 0, in aspeed_soc_ast2600_realize()
597 sc->memmap[ASPEED_DEV_ETH1 + i]); in aspeed_soc_ast2600_realize()
598 sysbus_connect_irq(SYS_BUS_DEVICE(&s->ftgmac100[i]), 0, in aspeed_soc_ast2600_realize()
601 object_property_set_link(OBJECT(&s->mii[i]), "nic", in aspeed_soc_ast2600_realize()
602 OBJECT(&s->ftgmac100[i]), &error_abort); in aspeed_soc_ast2600_realize()
603 if (!sysbus_realize(SYS_BUS_DEVICE(&s->mii[i]), errp)) { in aspeed_soc_ast2600_realize()
607 aspeed_mmio_map(s, SYS_BUS_DEVICE(&s->mii[i]), 0, in aspeed_soc_ast2600_realize()
608 sc->memmap[ASPEED_DEV_MII1 + i]); in aspeed_soc_ast2600_realize()
612 if (!sysbus_realize(SYS_BUS_DEVICE(&s->xdma), errp)) { in aspeed_soc_ast2600_realize()
615 aspeed_mmio_map(s, SYS_BUS_DEVICE(&s->xdma), 0, in aspeed_soc_ast2600_realize()
616 sc->memmap[ASPEED_DEV_XDMA]); in aspeed_soc_ast2600_realize()
617 sysbus_connect_irq(SYS_BUS_DEVICE(&s->xdma), 0, in aspeed_soc_ast2600_realize()
621 if (!sysbus_realize(SYS_BUS_DEVICE(&s->gpio), errp)) { in aspeed_soc_ast2600_realize()
624 aspeed_mmio_map(s, SYS_BUS_DEVICE(&s->gpio), 0, in aspeed_soc_ast2600_realize()
625 sc->memmap[ASPEED_DEV_GPIO]); in aspeed_soc_ast2600_realize()
626 sysbus_connect_irq(SYS_BUS_DEVICE(&s->gpio), 0, in aspeed_soc_ast2600_realize()
629 if (!sysbus_realize(SYS_BUS_DEVICE(&s->gpio_1_8v), errp)) { in aspeed_soc_ast2600_realize()
632 aspeed_mmio_map(s, SYS_BUS_DEVICE(&s->gpio_1_8v), 0, in aspeed_soc_ast2600_realize()
633 sc->memmap[ASPEED_DEV_GPIO_1_8V]); in aspeed_soc_ast2600_realize()
634 sysbus_connect_irq(SYS_BUS_DEVICE(&s->gpio_1_8v), 0, in aspeed_soc_ast2600_realize()
638 if (!sysbus_realize(SYS_BUS_DEVICE(&s->sdhci), errp)) { in aspeed_soc_ast2600_realize()
641 aspeed_mmio_map(s, SYS_BUS_DEVICE(&s->sdhci), 0, in aspeed_soc_ast2600_realize()
642 sc->memmap[ASPEED_DEV_SDHCI]); in aspeed_soc_ast2600_realize()
643 sysbus_connect_irq(SYS_BUS_DEVICE(&s->sdhci), 0, in aspeed_soc_ast2600_realize()
647 if (!sysbus_realize(SYS_BUS_DEVICE(&s->emmc), errp)) { in aspeed_soc_ast2600_realize()
650 aspeed_mmio_map(s, SYS_BUS_DEVICE(&s->emmc), 0, in aspeed_soc_ast2600_realize()
651 sc->memmap[ASPEED_DEV_EMMC]); in aspeed_soc_ast2600_realize()
652 sysbus_connect_irq(SYS_BUS_DEVICE(&s->emmc), 0, in aspeed_soc_ast2600_realize()
655 /* LPC */ in aspeed_soc_ast2600_realize()
656 if (!sysbus_realize(SYS_BUS_DEVICE(&s->lpc), errp)) { in aspeed_soc_ast2600_realize()
659 aspeed_mmio_map(s, SYS_BUS_DEVICE(&s->lpc), 0, sc->memmap[ASPEED_DEV_LPC]); in aspeed_soc_ast2600_realize()
661 /* Connect the LPC IRQ to the GIC. It is otherwise unused. */ in aspeed_soc_ast2600_realize()
662 sysbus_connect_irq(SYS_BUS_DEVICE(&s->lpc), 0, in aspeed_soc_ast2600_realize()
666 * On the AST2600 LPC subdevice IRQs are connected straight to the GIC. in aspeed_soc_ast2600_realize()
668 * LPC subdevice IRQ sources are offset from 1 because the LPC model caters in aspeed_soc_ast2600_realize()
669 * to the AST2400 and AST2500. SoCs before the AST2600 have one LPC IRQ in aspeed_soc_ast2600_realize()
673 sysbus_connect_irq(SYS_BUS_DEVICE(&s->lpc), 1 + aspeed_lpc_kcs_1, in aspeed_soc_ast2600_realize()
674 qdev_get_gpio_in(DEVICE(&a->a7mpcore), in aspeed_soc_ast2600_realize()
675 sc->irqmap[ASPEED_DEV_KCS] + aspeed_lpc_kcs_1)); in aspeed_soc_ast2600_realize()
677 sysbus_connect_irq(SYS_BUS_DEVICE(&s->lpc), 1 + aspeed_lpc_kcs_2, in aspeed_soc_ast2600_realize()
678 qdev_get_gpio_in(DEVICE(&a->a7mpcore), in aspeed_soc_ast2600_realize()
679 sc->irqmap[ASPEED_DEV_KCS] + aspeed_lpc_kcs_2)); in aspeed_soc_ast2600_realize()
681 sysbus_connect_irq(SYS_BUS_DEVICE(&s->lpc), 1 + aspeed_lpc_kcs_3, in aspeed_soc_ast2600_realize()
682 qdev_get_gpio_in(DEVICE(&a->a7mpcore), in aspeed_soc_ast2600_realize()
683 sc->irqmap[ASPEED_DEV_KCS] + aspeed_lpc_kcs_3)); in aspeed_soc_ast2600_realize()
685 sysbus_connect_irq(SYS_BUS_DEVICE(&s->lpc), 1 + aspeed_lpc_kcs_4, in aspeed_soc_ast2600_realize()
686 qdev_get_gpio_in(DEVICE(&a->a7mpcore), in aspeed_soc_ast2600_realize()
687 sc->irqmap[ASPEED_DEV_KCS] + aspeed_lpc_kcs_4)); in aspeed_soc_ast2600_realize()
690 if (!sysbus_realize(SYS_BUS_DEVICE(&s->ibt), errp)) { in aspeed_soc_ast2600_realize()
693 memory_region_add_subregion(&s->lpc.iomem, in aspeed_soc_ast2600_realize()
694 sc->memmap[ASPEED_DEV_IBT] - sc->memmap[ASPEED_DEV_LPC], in aspeed_soc_ast2600_realize()
695 &s->ibt.iomem); in aspeed_soc_ast2600_realize()
696 sysbus_connect_irq(SYS_BUS_DEVICE(&s->ibt), 0, in aspeed_soc_ast2600_realize()
700 object_property_set_link(OBJECT(&s->hace), "dram", OBJECT(s->dram_mr), in aspeed_soc_ast2600_realize()
702 if (!sysbus_realize(SYS_BUS_DEVICE(&s->hace), errp)) { in aspeed_soc_ast2600_realize()
705 aspeed_mmio_map(s, SYS_BUS_DEVICE(&s->hace), 0, in aspeed_soc_ast2600_realize()
706 sc->memmap[ASPEED_DEV_HACE]); in aspeed_soc_ast2600_realize()
707 sysbus_connect_irq(SYS_BUS_DEVICE(&s->hace), 0, in aspeed_soc_ast2600_realize()
711 if (!sysbus_realize(SYS_BUS_DEVICE(&s->i3c), errp)) { in aspeed_soc_ast2600_realize()
714 aspeed_mmio_map(s, SYS_BUS_DEVICE(&s->i3c), 0, sc->memmap[ASPEED_DEV_I3C]); in aspeed_soc_ast2600_realize()
716 irq = qdev_get_gpio_in(DEVICE(&a->a7mpcore), in aspeed_soc_ast2600_realize()
717 sc->irqmap[ASPEED_DEV_I3C] + i); in aspeed_soc_ast2600_realize()
718 /* The AST2600 I3C controller has one IRQ per bus. */ in aspeed_soc_ast2600_realize()
719 sysbus_connect_irq(SYS_BUS_DEVICE(&s->i3c.devices[i]), 0, irq); in aspeed_soc_ast2600_realize()
723 if (!sysbus_realize(SYS_BUS_DEVICE(&s->sbc), errp)) { in aspeed_soc_ast2600_realize()
726 aspeed_mmio_map(s, SYS_BUS_DEVICE(&s->sbc), 0, sc->memmap[ASPEED_DEV_SBC]); in aspeed_soc_ast2600_realize()
730 if (!sysbus_realize(SYS_BUS_DEVICE(&s->fsi[i]), errp)) { in aspeed_soc_ast2600_realize()
733 aspeed_mmio_map(s, SYS_BUS_DEVICE(&s->fsi[i]), 0, in aspeed_soc_ast2600_realize()
734 sc->memmap[ASPEED_DEV_FSI1 + i]); in aspeed_soc_ast2600_realize()
735 sysbus_connect_irq(SYS_BUS_DEVICE(&s->fsi[i]), 0, in aspeed_soc_ast2600_realize()
740 if (!sysbus_realize(SYS_BUS_DEVICE(&s->gfx), errp)) { in aspeed_soc_ast2600_realize()
743 aspeed_mmio_map(s, SYS_BUS_DEVICE(&s->gfx), 0, sc->memmap[ASPEED_DEV_GFX]); in aspeed_soc_ast2600_realize()
744 sysbus_connect_irq(SYS_BUS_DEVICE(&s->gfx), 0, in aspeed_soc_ast2600_realize()
748 if (!sysbus_realize(SYS_BUS_DEVICE(&s->pwm), errp)) { in aspeed_soc_ast2600_realize()
751 aspeed_mmio_map(s, SYS_BUS_DEVICE(&s->pwm), 0, sc->memmap[ASPEED_DEV_PWM]); in aspeed_soc_ast2600_realize()
752 sysbus_connect_irq(SYS_BUS_DEVICE(&s->pwm), 0, in aspeed_soc_ast2600_realize()
758 uint32_t hw_strap1 = object_property_get_uint(OBJECT(&s->scu), in aspeed_soc_ast2600_boot_from_emmc()
759 "hw-strap1", &error_abort); in aspeed_soc_ast2600_boot_from_emmc()
766 ARM_CPU_TYPE_NAME("cortex-a7"), in aspeed_soc_ast2600_class_init()
772 dc->realize = aspeed_soc_ast2600_realize; in aspeed_soc_ast2600_class_init()
774 dc->user_creatable = false; in aspeed_soc_ast2600_class_init()
776 sc->name = "ast2600-a3"; in aspeed_soc_ast2600_class_init()
777 sc->valid_cpu_types = valid_cpu_types; in aspeed_soc_ast2600_class_init()
778 sc->silicon_rev = AST2600_A3_SILICON_REV; in aspeed_soc_ast2600_class_init()
779 sc->sram_size = 0x16400; in aspeed_soc_ast2600_class_init()
780 sc->spis_num = 2; in aspeed_soc_ast2600_class_init()
781 sc->ehcis_num = 2; in aspeed_soc_ast2600_class_init()
782 sc->wdts_num = 4; in aspeed_soc_ast2600_class_init()
783 sc->macs_num = 4; in aspeed_soc_ast2600_class_init()
784 sc->uarts_num = 13; in aspeed_soc_ast2600_class_init()
785 sc->uarts_base = ASPEED_DEV_UART1; in aspeed_soc_ast2600_class_init()
786 sc->irqmap = aspeed_soc_ast2600_irqmap; in aspeed_soc_ast2600_class_init()
787 sc->memmap = aspeed_soc_ast2600_memmap; in aspeed_soc_ast2600_class_init()
788 sc->num_cpus = 2; in aspeed_soc_ast2600_class_init()
789 sc->get_irq = aspeed_soc_ast2600_get_irq; in aspeed_soc_ast2600_class_init()
790 sc->boot_from_emmc = aspeed_soc_ast2600_boot_from_emmc; in aspeed_soc_ast2600_class_init()
800 .name = "ast2600-a3",