Lines Matching +full:peci +full:- +full:controller

7  * the COPYING file in the top-level directory.
14 #include "exec/address-spaces.h"
16 #include "hw/qdev-clock.h"
93 [ASPEED_DEV_I3C] = 102, /* 102 -> 105 */
95 [ASPEED_DEV_KCS] = 138, /* 138 -> 142 */
107 return qdev_get_gpio_in(DEVICE(&a->armv7m), sc->irqmap[dev]); in aspeed_soc_ast1030_get_irq()
119 if (sscanf(sc->name, "%7s", socname) != 1) { in aspeed_soc_ast1030_init()
123 object_initialize_child(obj, "armv7m", &a->armv7m, TYPE_ARMV7M); in aspeed_soc_ast1030_init()
125 s->sysclk = qdev_init_clock_in(DEVICE(s), "sysclk", NULL, NULL, 0); in aspeed_soc_ast1030_init()
127 snprintf(typename, sizeof(typename), "aspeed.scu-%s", socname); in aspeed_soc_ast1030_init()
128 object_initialize_child(obj, "scu", &s->scu, typename); in aspeed_soc_ast1030_init()
129 qdev_prop_set_uint32(DEVICE(&s->scu), "silicon-rev", sc->silicon_rev); in aspeed_soc_ast1030_init()
131 object_property_add_alias(obj, "hw-strap1", OBJECT(&s->scu), "hw-strap1"); in aspeed_soc_ast1030_init()
132 object_property_add_alias(obj, "hw-strap2", OBJECT(&s->scu), "hw-strap2"); in aspeed_soc_ast1030_init()
134 snprintf(typename, sizeof(typename), "aspeed.i2c-%s", socname); in aspeed_soc_ast1030_init()
135 object_initialize_child(obj, "i2c", &s->i2c, typename); in aspeed_soc_ast1030_init()
137 object_initialize_child(obj, "i3c", &s->i3c, TYPE_ASPEED_I3C); in aspeed_soc_ast1030_init()
139 snprintf(typename, sizeof(typename), "aspeed.timer-%s", socname); in aspeed_soc_ast1030_init()
140 object_initialize_child(obj, "timerctrl", &s->timerctrl, typename); in aspeed_soc_ast1030_init()
142 snprintf(typename, sizeof(typename), "aspeed.adc-%s", socname); in aspeed_soc_ast1030_init()
143 object_initialize_child(obj, "adc", &s->adc, typename); in aspeed_soc_ast1030_init()
145 snprintf(typename, sizeof(typename), "aspeed.fmc-%s", socname); in aspeed_soc_ast1030_init()
146 object_initialize_child(obj, "fmc", &s->fmc, typename); in aspeed_soc_ast1030_init()
148 for (i = 0; i < sc->spis_num; i++) { in aspeed_soc_ast1030_init()
149 snprintf(typename, sizeof(typename), "aspeed.spi%d-%s", i + 1, socname); in aspeed_soc_ast1030_init()
150 object_initialize_child(obj, "spi[*]", &s->spi[i], typename); in aspeed_soc_ast1030_init()
153 object_initialize_child(obj, "lpc", &s->lpc, TYPE_ASPEED_LPC); in aspeed_soc_ast1030_init()
155 object_initialize_child(obj, "peci", &s->peci, TYPE_ASPEED_PECI); in aspeed_soc_ast1030_init()
157 object_initialize_child(obj, "sbc", &s->sbc, TYPE_ASPEED_SBC); in aspeed_soc_ast1030_init()
159 for (i = 0; i < sc->wdts_num; i++) { in aspeed_soc_ast1030_init()
160 snprintf(typename, sizeof(typename), "aspeed.wdt-%s", socname); in aspeed_soc_ast1030_init()
161 object_initialize_child(obj, "wdt[*]", &s->wdt[i], typename); in aspeed_soc_ast1030_init()
164 for (i = 0; i < sc->uarts_num; i++) { in aspeed_soc_ast1030_init()
165 object_initialize_child(obj, "uart[*]", &s->uart[i], TYPE_SERIAL_MM); in aspeed_soc_ast1030_init()
168 snprintf(typename, sizeof(typename), "aspeed.gpio-%s", socname); in aspeed_soc_ast1030_init()
169 object_initialize_child(obj, "gpio", &s->gpio, typename); in aspeed_soc_ast1030_init()
171 snprintf(typename, sizeof(typename), "aspeed.hace-%s", socname); in aspeed_soc_ast1030_init()
172 object_initialize_child(obj, "hace", &s->hace, typename); in aspeed_soc_ast1030_init()
174 object_initialize_child(obj, "iomem", &s->iomem, TYPE_UNIMPLEMENTED_DEVICE); in aspeed_soc_ast1030_init()
175 object_initialize_child(obj, "sbc-unimplemented", &s->sbc_unimplemented, in aspeed_soc_ast1030_init()
177 object_initialize_child(obj, "pwm", &s->pwm, TYPE_UNIMPLEMENTED_DEVICE); in aspeed_soc_ast1030_init()
178 object_initialize_child(obj, "espi", &s->espi, TYPE_UNIMPLEMENTED_DEVICE); in aspeed_soc_ast1030_init()
179 object_initialize_child(obj, "udc", &s->udc, TYPE_UNIMPLEMENTED_DEVICE); in aspeed_soc_ast1030_init()
180 object_initialize_child(obj, "sgpiom", &s->sgpiom, in aspeed_soc_ast1030_init()
182 object_initialize_child(obj, "jtag[0]", &s->jtag[0], in aspeed_soc_ast1030_init()
184 object_initialize_child(obj, "jtag[1]", &s->jtag[1], in aspeed_soc_ast1030_init()
198 if (!clock_has_source(s->sysclk)) { in aspeed_soc_ast1030_realize()
204 aspeed_mmio_map_unimplemented(s, SYS_BUS_DEVICE(&s->iomem), "aspeed.io", in aspeed_soc_ast1030_realize()
205 sc->memmap[ASPEED_DEV_IOMEM], in aspeed_soc_ast1030_realize()
207 aspeed_mmio_map_unimplemented(s, SYS_BUS_DEVICE(&s->sbc_unimplemented), in aspeed_soc_ast1030_realize()
208 "aspeed.sbc", sc->memmap[ASPEED_DEV_SBC], in aspeed_soc_ast1030_realize()
212 armv7m = DEVICE(&a->armv7m); in aspeed_soc_ast1030_realize()
213 qdev_prop_set_uint32(armv7m, "num-irq", 256); in aspeed_soc_ast1030_realize()
214 qdev_prop_set_string(armv7m, "cpu-type", aspeed_soc_cpu_type(sc)); in aspeed_soc_ast1030_realize()
215 qdev_connect_clock_in(armv7m, "cpuclk", s->sysclk); in aspeed_soc_ast1030_realize()
216 object_property_set_link(OBJECT(&a->armv7m), "memory", in aspeed_soc_ast1030_realize()
217 OBJECT(s->memory), &error_abort); in aspeed_soc_ast1030_realize()
218 sysbus_realize(SYS_BUS_DEVICE(&a->armv7m), &error_abort); in aspeed_soc_ast1030_realize()
222 CPU(a->armv7m.cpu)->cpu_index); in aspeed_soc_ast1030_realize()
223 memory_region_init_ram(&s->sram, OBJECT(s), sram_name, sc->sram_size, &err); in aspeed_soc_ast1030_realize()
228 memory_region_add_subregion(s->memory, in aspeed_soc_ast1030_realize()
229 sc->memmap[ASPEED_DEV_SRAM], in aspeed_soc_ast1030_realize()
230 &s->sram); in aspeed_soc_ast1030_realize()
231 memory_region_init_ram(&s->secsram, OBJECT(s), "sec.sram", in aspeed_soc_ast1030_realize()
232 sc->secsram_size, &err); in aspeed_soc_ast1030_realize()
237 memory_region_add_subregion(s->memory, sc->memmap[ASPEED_DEV_SECSRAM], in aspeed_soc_ast1030_realize()
238 &s->secsram); in aspeed_soc_ast1030_realize()
241 if (!sysbus_realize(SYS_BUS_DEVICE(&s->scu), errp)) { in aspeed_soc_ast1030_realize()
244 aspeed_mmio_map(s, SYS_BUS_DEVICE(&s->scu), 0, sc->memmap[ASPEED_DEV_SCU]); in aspeed_soc_ast1030_realize()
248 object_property_set_link(OBJECT(&s->i2c), "dram", OBJECT(&s->sram), in aspeed_soc_ast1030_realize()
250 if (!sysbus_realize(SYS_BUS_DEVICE(&s->i2c), errp)) { in aspeed_soc_ast1030_realize()
253 aspeed_mmio_map(s, SYS_BUS_DEVICE(&s->i2c), 0, sc->memmap[ASPEED_DEV_I2C]); in aspeed_soc_ast1030_realize()
254 for (i = 0; i < ASPEED_I2C_GET_CLASS(&s->i2c)->num_busses; i++) { in aspeed_soc_ast1030_realize()
255 qemu_irq irq = qdev_get_gpio_in(DEVICE(&a->armv7m), in aspeed_soc_ast1030_realize()
256 sc->irqmap[ASPEED_DEV_I2C] + i); in aspeed_soc_ast1030_realize()
257 /* The AST1030 I2C controller has one IRQ per bus. */ in aspeed_soc_ast1030_realize()
258 sysbus_connect_irq(SYS_BUS_DEVICE(&s->i2c.busses[i]), 0, irq); in aspeed_soc_ast1030_realize()
262 if (!sysbus_realize(SYS_BUS_DEVICE(&s->i3c), errp)) { in aspeed_soc_ast1030_realize()
265 aspeed_mmio_map(s, SYS_BUS_DEVICE(&s->i3c), 0, sc->memmap[ASPEED_DEV_I3C]); in aspeed_soc_ast1030_realize()
267 qemu_irq irq = qdev_get_gpio_in(DEVICE(&a->armv7m), in aspeed_soc_ast1030_realize()
268 sc->irqmap[ASPEED_DEV_I3C] + i); in aspeed_soc_ast1030_realize()
269 /* The AST1030 I3C controller has one IRQ per bus. */ in aspeed_soc_ast1030_realize()
270 sysbus_connect_irq(SYS_BUS_DEVICE(&s->i3c.devices[i]), 0, irq); in aspeed_soc_ast1030_realize()
273 /* PECI */ in aspeed_soc_ast1030_realize()
274 if (!sysbus_realize(SYS_BUS_DEVICE(&s->peci), errp)) { in aspeed_soc_ast1030_realize()
277 aspeed_mmio_map(s, SYS_BUS_DEVICE(&s->peci), 0, in aspeed_soc_ast1030_realize()
278 sc->memmap[ASPEED_DEV_PECI]); in aspeed_soc_ast1030_realize()
279 sysbus_connect_irq(SYS_BUS_DEVICE(&s->peci), 0, in aspeed_soc_ast1030_realize()
283 if (!sysbus_realize(SYS_BUS_DEVICE(&s->lpc), errp)) { in aspeed_soc_ast1030_realize()
286 aspeed_mmio_map(s, SYS_BUS_DEVICE(&s->lpc), 0, sc->memmap[ASPEED_DEV_LPC]); in aspeed_soc_ast1030_realize()
289 sysbus_connect_irq(SYS_BUS_DEVICE(&s->lpc), 0, in aspeed_soc_ast1030_realize()
295 sysbus_connect_irq(SYS_BUS_DEVICE(&s->lpc), 1 + aspeed_lpc_kcs_1, in aspeed_soc_ast1030_realize()
296 qdev_get_gpio_in(DEVICE(&a->armv7m), in aspeed_soc_ast1030_realize()
297 sc->irqmap[ASPEED_DEV_KCS] + aspeed_lpc_kcs_1)); in aspeed_soc_ast1030_realize()
299 sysbus_connect_irq(SYS_BUS_DEVICE(&s->lpc), 1 + aspeed_lpc_kcs_2, in aspeed_soc_ast1030_realize()
300 qdev_get_gpio_in(DEVICE(&a->armv7m), in aspeed_soc_ast1030_realize()
301 sc->irqmap[ASPEED_DEV_KCS] + aspeed_lpc_kcs_2)); in aspeed_soc_ast1030_realize()
303 sysbus_connect_irq(SYS_BUS_DEVICE(&s->lpc), 1 + aspeed_lpc_kcs_3, in aspeed_soc_ast1030_realize()
304 qdev_get_gpio_in(DEVICE(&a->armv7m), in aspeed_soc_ast1030_realize()
305 sc->irqmap[ASPEED_DEV_KCS] + aspeed_lpc_kcs_3)); in aspeed_soc_ast1030_realize()
307 sysbus_connect_irq(SYS_BUS_DEVICE(&s->lpc), 1 + aspeed_lpc_kcs_4, in aspeed_soc_ast1030_realize()
308 qdev_get_gpio_in(DEVICE(&a->armv7m), in aspeed_soc_ast1030_realize()
309 sc->irqmap[ASPEED_DEV_KCS] + aspeed_lpc_kcs_4)); in aspeed_soc_ast1030_realize()
317 object_property_set_link(OBJECT(&s->timerctrl), "scu", OBJECT(&s->scu), in aspeed_soc_ast1030_realize()
319 if (!sysbus_realize(SYS_BUS_DEVICE(&s->timerctrl), errp)) { in aspeed_soc_ast1030_realize()
322 aspeed_mmio_map(s, SYS_BUS_DEVICE(&s->timerctrl), 0, in aspeed_soc_ast1030_realize()
323 sc->memmap[ASPEED_DEV_TIMER1]); in aspeed_soc_ast1030_realize()
326 sysbus_connect_irq(SYS_BUS_DEVICE(&s->timerctrl), i, irq); in aspeed_soc_ast1030_realize()
330 if (!sysbus_realize(SYS_BUS_DEVICE(&s->adc), errp)) { in aspeed_soc_ast1030_realize()
333 aspeed_mmio_map(s, SYS_BUS_DEVICE(&s->adc), 0, sc->memmap[ASPEED_DEV_ADC]); in aspeed_soc_ast1030_realize()
334 sysbus_connect_irq(SYS_BUS_DEVICE(&s->adc), 0, in aspeed_soc_ast1030_realize()
338 object_property_set_link(OBJECT(&s->fmc), "dram", OBJECT(&s->sram), in aspeed_soc_ast1030_realize()
340 if (!sysbus_realize(SYS_BUS_DEVICE(&s->fmc), errp)) { in aspeed_soc_ast1030_realize()
343 aspeed_mmio_map(s, SYS_BUS_DEVICE(&s->fmc), 0, sc->memmap[ASPEED_DEV_FMC]); in aspeed_soc_ast1030_realize()
344 aspeed_mmio_map(s, SYS_BUS_DEVICE(&s->fmc), 1, in aspeed_soc_ast1030_realize()
345 ASPEED_SMC_GET_CLASS(&s->fmc)->flash_window_base); in aspeed_soc_ast1030_realize()
346 sysbus_connect_irq(SYS_BUS_DEVICE(&s->fmc), 0, in aspeed_soc_ast1030_realize()
350 for (i = 0; i < sc->spis_num; i++) { in aspeed_soc_ast1030_realize()
351 object_property_set_link(OBJECT(&s->spi[i]), "dram", in aspeed_soc_ast1030_realize()
352 OBJECT(&s->sram), &error_abort); in aspeed_soc_ast1030_realize()
353 if (!sysbus_realize(SYS_BUS_DEVICE(&s->spi[i]), errp)) { in aspeed_soc_ast1030_realize()
356 aspeed_mmio_map(s, SYS_BUS_DEVICE(&s->spi[i]), 0, in aspeed_soc_ast1030_realize()
357 sc->memmap[ASPEED_DEV_SPI1 + i]); in aspeed_soc_ast1030_realize()
358 aspeed_mmio_map(s, SYS_BUS_DEVICE(&s->spi[i]), 1, in aspeed_soc_ast1030_realize()
359 ASPEED_SMC_GET_CLASS(&s->spi[i])->flash_window_base); in aspeed_soc_ast1030_realize()
362 /* Secure Boot Controller */ in aspeed_soc_ast1030_realize()
363 if (!sysbus_realize(SYS_BUS_DEVICE(&s->sbc), errp)) { in aspeed_soc_ast1030_realize()
366 aspeed_mmio_map(s, SYS_BUS_DEVICE(&s->sbc), 0, sc->memmap[ASPEED_DEV_SBC]); in aspeed_soc_ast1030_realize()
369 object_property_set_link(OBJECT(&s->hace), "dram", OBJECT(&s->sram), in aspeed_soc_ast1030_realize()
371 if (!sysbus_realize(SYS_BUS_DEVICE(&s->hace), errp)) { in aspeed_soc_ast1030_realize()
374 aspeed_mmio_map(s, SYS_BUS_DEVICE(&s->hace), 0, in aspeed_soc_ast1030_realize()
375 sc->memmap[ASPEED_DEV_HACE]); in aspeed_soc_ast1030_realize()
376 sysbus_connect_irq(SYS_BUS_DEVICE(&s->hace), 0, in aspeed_soc_ast1030_realize()
380 for (i = 0; i < sc->wdts_num; i++) { in aspeed_soc_ast1030_realize()
381 AspeedWDTClass *awc = ASPEED_WDT_GET_CLASS(&s->wdt[i]); in aspeed_soc_ast1030_realize()
382 hwaddr wdt_offset = sc->memmap[ASPEED_DEV_WDT] + i * awc->iosize; in aspeed_soc_ast1030_realize()
384 object_property_set_link(OBJECT(&s->wdt[i]), "scu", OBJECT(&s->scu), in aspeed_soc_ast1030_realize()
386 if (!sysbus_realize(SYS_BUS_DEVICE(&s->wdt[i]), errp)) { in aspeed_soc_ast1030_realize()
389 aspeed_mmio_map(s, SYS_BUS_DEVICE(&s->wdt[i]), 0, wdt_offset); in aspeed_soc_ast1030_realize()
393 if (!sysbus_realize(SYS_BUS_DEVICE(&s->gpio), errp)) { in aspeed_soc_ast1030_realize()
396 aspeed_mmio_map(s, SYS_BUS_DEVICE(&s->gpio), 0, in aspeed_soc_ast1030_realize()
397 sc->memmap[ASPEED_DEV_GPIO]); in aspeed_soc_ast1030_realize()
398 sysbus_connect_irq(SYS_BUS_DEVICE(&s->gpio), 0, in aspeed_soc_ast1030_realize()
401 aspeed_mmio_map_unimplemented(s, SYS_BUS_DEVICE(&s->pwm), "aspeed.pwm", in aspeed_soc_ast1030_realize()
402 sc->memmap[ASPEED_DEV_PWM], 0x100); in aspeed_soc_ast1030_realize()
404 aspeed_mmio_map_unimplemented(s, SYS_BUS_DEVICE(&s->espi), "aspeed.espi", in aspeed_soc_ast1030_realize()
405 sc->memmap[ASPEED_DEV_ESPI], 0x800); in aspeed_soc_ast1030_realize()
407 aspeed_mmio_map_unimplemented(s, SYS_BUS_DEVICE(&s->udc), "aspeed.udc", in aspeed_soc_ast1030_realize()
408 sc->memmap[ASPEED_DEV_UDC], 0x1000); in aspeed_soc_ast1030_realize()
409 aspeed_mmio_map_unimplemented(s, SYS_BUS_DEVICE(&s->sgpiom), "aspeed.sgpiom", in aspeed_soc_ast1030_realize()
410 sc->memmap[ASPEED_DEV_SGPIOM], 0x100); in aspeed_soc_ast1030_realize()
412 aspeed_mmio_map_unimplemented(s, SYS_BUS_DEVICE(&s->jtag[0]), "aspeed.jtag", in aspeed_soc_ast1030_realize()
413 sc->memmap[ASPEED_DEV_JTAG0], 0x20); in aspeed_soc_ast1030_realize()
414 aspeed_mmio_map_unimplemented(s, SYS_BUS_DEVICE(&s->jtag[1]), "aspeed.jtag", in aspeed_soc_ast1030_realize()
415 sc->memmap[ASPEED_DEV_JTAG1], 0x20); in aspeed_soc_ast1030_realize()
421 ARM_CPU_TYPE_NAME("cortex-m4"), /* TODO cortex-m4f */ in aspeed_soc_ast1030_class_init()
428 dc->user_creatable = false; in aspeed_soc_ast1030_class_init()
429 dc->realize = aspeed_soc_ast1030_realize; in aspeed_soc_ast1030_class_init()
431 sc->name = "ast1030-a1"; in aspeed_soc_ast1030_class_init()
432 sc->valid_cpu_types = valid_cpu_types; in aspeed_soc_ast1030_class_init()
433 sc->silicon_rev = AST1030_A1_SILICON_REV; in aspeed_soc_ast1030_class_init()
434 sc->sram_size = 0xc0000; in aspeed_soc_ast1030_class_init()
435 sc->secsram_size = 0x40000; /* 256 * KiB */ in aspeed_soc_ast1030_class_init()
436 sc->spis_num = 2; in aspeed_soc_ast1030_class_init()
437 sc->ehcis_num = 0; in aspeed_soc_ast1030_class_init()
438 sc->wdts_num = 4; in aspeed_soc_ast1030_class_init()
439 sc->macs_num = 1; in aspeed_soc_ast1030_class_init()
440 sc->uarts_num = 13; in aspeed_soc_ast1030_class_init()
441 sc->uarts_base = ASPEED_DEV_UART1; in aspeed_soc_ast1030_class_init()
442 sc->irqmap = aspeed_soc_ast1030_irqmap; in aspeed_soc_ast1030_class_init()
443 sc->memmap = aspeed_soc_ast1030_memmap; in aspeed_soc_ast1030_class_init()
444 sc->num_cpus = 1; in aspeed_soc_ast1030_class_init()
445 sc->get_irq = aspeed_soc_ast1030_get_irq; in aspeed_soc_ast1030_class_init()
455 .name = "ast1030-a1",