Lines Matching +full:mhu +full:- +full:rx

2  * Arm Musca-B1 test chip board emulation
14 * the SSE-200 subsystem for embedded:
15 …https://developer.arm.com/products/system-design/development-boards/iot-test-chips-and-boards/musc…
16 …https://developer.arm.com/products/system-design/development-boards/iot-test-chips-and-boards/musc…
23 #include "qemu/error-report.h"
25 #include "exec/address-spaces.h"
31 #include "hw/core/split-irq.h"
32 #include "hw/misc/tz-mpc.h"
33 #include "hw/misc/tz-ppc.h"
36 #include "hw/qdev-clock.h"
73 UnimplementedDeviceState mhu[2]; member
91 #define TYPE_MUSCA_A_MACHINE MACHINE_TYPE_NAME("musca-a")
92 #define TYPE_MUSCA_B1_MACHINE MACHINE_TYPE_NAME("musca-b1")
99 * don't model that in our SSE-200 model yet. in OBJECT_DECLARE_TYPE()
110 return qdev_get_gpio_in(DEVICE(&mms->cpu_irq_splitter[irqno]), 0); in OBJECT_DECLARE_TYPE()
225 int i = mpc - &mms->mpc[0]; in make_mpc()
230 const MPCInfo *mpcinfo = mmc->mpc_info; in make_mpc()
232 mpcname = g_strdup_printf("%s-mpc", mpcinfo[i].name); in make_mpc()
236 downstream = &mms->ram[i]; in make_mpc()
241 downstream = &mms->ram[i]; in make_mpc()
247 uds = &mms->cryptoisland; in make_mpc()
266 /* and connect its interrupt to the SSE-200 */ in make_mpc()
268 qdev_get_gpio_in_named(DEVICE(&mms->sse), in make_mpc()
291 int i = uart - &mms->uart[0]; in make_uart()
300 sysbus_connect_irq(s, 1, get_sse_irq_in(mms, irqbase + 0)); /* RX */ in make_uart()
313 * behind the Musca-A PPC's single port. These devices don't have a PPC in make_musca_a_devs()
320 MemoryRegion *container = &mms->container; in make_musca_a_devs()
323 { "uart0", make_uart, &mms->uart[0], 0x1000, 0x1000 }, in make_musca_a_devs()
324 { "uart1", make_uart, &mms->uart[1], 0x2000, 0x1000 }, in make_musca_a_devs()
325 { "spi", make_unimp_dev, &mms->spi, 0x3000, 0x1000 }, in make_musca_a_devs()
326 { "i2c0", make_unimp_dev, &mms->i2c[0], 0x4000, 0x1000 }, in make_musca_a_devs()
327 { "i2c1", make_unimp_dev, &mms->i2c[1], 0x5000, 0x1000 }, in make_musca_a_devs()
328 { "i2s", make_unimp_dev, &mms->i2s, 0x6000, 0x1000 }, in make_musca_a_devs()
329 { "pwm0", make_unimp_dev, &mms->pwm[0], 0x7000, 0x1000 }, in make_musca_a_devs()
330 { "rtc", make_rtc, &mms->rtc, 0x8000, 0x1000 }, in make_musca_a_devs()
331 { "qspi", make_unimp_dev, &mms->qspi, 0xa000, 0x1000 }, in make_musca_a_devs()
332 { "timer", make_unimp_dev, &mms->timer, 0xb000, 0x1000 }, in make_musca_a_devs()
333 { "scc", make_unimp_dev, &mms->scc, 0xc000, 0x1000 }, in make_musca_a_devs()
334 { "pwm1", make_unimp_dev, &mms->pwm[1], 0xe000, 0x1000 }, in make_musca_a_devs()
335 { "pwm2", make_unimp_dev, &mms->pwm[2], 0xf000, 0x1000 }, in make_musca_a_devs()
336 { "gpio", make_unimp_dev, &mms->gpio, 0x10000, 0x1000 }, in make_musca_a_devs()
337 { "mpc0", make_mpc, &mms->mpc[0], 0x12000, 0x1000 }, in make_musca_a_devs()
338 { "mpc1", make_mpc, &mms->mpc[1], 0x13000, 0x1000 }, in make_musca_a_devs()
341 memory_region_init(container, OBJECT(mms), "musca-device-container", size); in make_musca_a_devs()
347 mr = pinfo->devfn(mms, pinfo->opaque, pinfo->name, pinfo->size); in make_musca_a_devs()
348 memory_region_add_subregion(container, pinfo->addr, mr); in make_musca_a_devs()
351 return &mms->container; in make_musca_a_devs()
365 assert(mmc->num_irqs <= MUSCA_NUMIRQ_MAX); in musca_init()
366 assert(mmc->num_mpcs <= MUSCA_MPC_MAX); in musca_init()
368 mms->sysclk = clock_new(OBJECT(machine), "SYSCLK"); in musca_init()
369 clock_set_hz(mms->sysclk, SYSCLK_FRQ); in musca_init()
370 mms->s32kclk = clock_new(OBJECT(machine), "S32KCLK"); in musca_init()
371 clock_set_hz(mms->s32kclk, S32KCLK_FRQ); in musca_init()
373 object_initialize_child(OBJECT(machine), "sse-200", &mms->sse, in musca_init()
375 ssedev = DEVICE(&mms->sse); in musca_init()
376 object_property_set_link(OBJECT(&mms->sse), "memory", in musca_init()
378 qdev_prop_set_uint32(ssedev, "EXP_NUMIRQ", mmc->num_irqs); in musca_init()
379 qdev_prop_set_uint32(ssedev, "init-svtor", mmc->init_svtor); in musca_init()
380 qdev_prop_set_uint32(ssedev, "SRAM_ADDR_WIDTH", mmc->sram_addr_width); in musca_init()
381 qdev_connect_clock_in(ssedev, "MAINCLK", mms->sysclk); in musca_init()
382 qdev_connect_clock_in(ssedev, "S32KCLK", mms->s32kclk); in musca_init()
384 * Musca-A takes the default SSE-200 FPU/DSP settings (ie no for in musca_init()
385 * CPU0 and yes for CPU1); Musca-B1 explicitly enables them for CPU0. in musca_init()
387 if (mmc->type == MUSCA_B1) { in musca_init()
391 sysbus_realize(SYS_BUS_DEVICE(&mms->sse), &error_fatal); in musca_init()
395 * for each CPU in the SSE-200 from each device in the board. in musca_init()
397 for (i = 0; i < mmc->num_irqs; i++) { in musca_init()
398 char *name = g_strdup_printf("musca-irq-splitter%d", i); in musca_init()
399 SplitIRQ *splitter = &mms->cpu_irq_splitter[i]; in musca_init()
406 object_property_set_int(OBJECT(splitter), "num-lines", 2, in musca_init()
417 * The sec_resp_cfg output from the SSE-200 must be split into multiple in musca_init()
420 object_initialize_child_with_props(OBJECT(machine), "sec-resp-splitter", in musca_init()
421 &mms->sec_resp_splitter, in musca_init()
422 sizeof(mms->sec_resp_splitter), in musca_init()
425 object_property_set_int(OBJECT(&mms->sec_resp_splitter), "num-lines", in musca_init()
426 ARRAY_SIZE(mms->ppc), &error_fatal); in musca_init()
427 qdev_realize(DEVICE(&mms->sec_resp_splitter), NULL, &error_fatal); in musca_init()
428 dev_splitter = DEVICE(&mms->sec_resp_splitter); in musca_init()
443 * The PPC mapping differs for the -A and -B1 variants; the -A version in musca_init()
450 { "musca-devices", make_musca_a_devs, 0, 0x40100000, 0x100000 }, in musca_init()
463 { "eflash0", make_unimp_dev, &mms->eflash[0], in musca_init()
465 { "eflash1", make_unimp_dev, &mms->eflash[1], in musca_init()
467 { "qspi", make_unimp_dev, &mms->qspi, 0x42800000, 0x100000 }, in musca_init()
468 { "mpc0", make_mpc, &mms->mpc[0], 0x52000000, 0x1000 }, in musca_init()
469 { "mpc1", make_mpc, &mms->mpc[1], 0x52100000, 0x1000 }, in musca_init()
470 { "mpc2", make_mpc, &mms->mpc[2], 0x52200000, 0x1000 }, in musca_init()
471 { "mpc3", make_mpc, &mms->mpc[3], 0x52300000, 0x1000 }, in musca_init()
472 { "mhu0", make_unimp_dev, &mms->mhu[0], 0x42600000, 0x100000 }, in musca_init()
473 { "mhu1", make_unimp_dev, &mms->mhu[1], 0x42700000, 0x100000 }, in musca_init()
479 { "mpc4", make_mpc, &mms->mpc[4], 0x52e00000, 0x1000 }, in musca_init()
484 { "pwm0", make_unimp_dev, &mms->pwm[0], 0x40101000, 0x1000 }, in musca_init()
485 { "pwm1", make_unimp_dev, &mms->pwm[1], 0x40102000, 0x1000 }, in musca_init()
486 { "pwm2", make_unimp_dev, &mms->pwm[2], 0x40103000, 0x1000 }, in musca_init()
487 { "i2s", make_unimp_dev, &mms->i2s, 0x40104000, 0x1000 }, in musca_init()
488 { "uart0", make_uart, &mms->uart[0], 0x40105000, 0x1000 }, in musca_init()
489 { "uart1", make_uart, &mms->uart[1], 0x40106000, 0x1000 }, in musca_init()
490 { "i2c0", make_unimp_dev, &mms->i2c[0], 0x40108000, 0x1000 }, in musca_init()
491 { "i2c1", make_unimp_dev, &mms->i2c[1], 0x40109000, 0x1000 }, in musca_init()
492 { "spi", make_unimp_dev, &mms->spi, 0x4010a000, 0x1000 }, in musca_init()
493 { "scc", make_unimp_dev, &mms->scc, 0x5010b000, 0x1000 }, in musca_init()
494 { "timer", make_unimp_dev, &mms->timer, 0x4010c000, 0x1000 }, in musca_init()
495 { "rtc", make_rtc, &mms->rtc, 0x4010d000, 0x1000 }, in musca_init()
496 { "pvt", make_unimp_dev, &mms->pvt, 0x4010e000, 0x1000 }, in musca_init()
497 { "sdio", make_unimp_dev, &mms->sdio, 0x4010f000, 0x1000 }, in musca_init()
503 { "gpio", make_unimp_dev, &mms->gpio, 0x41000000, 0x1000 }, in musca_init()
508 switch (mmc->type) { in musca_init()
524 TZPPC *ppc = &mms->ppc[i]; in musca_init()
529 object_initialize_child(OBJECT(machine), ppcinfo->name, ppc, in musca_init()
534 const PPCPortInfo *pinfo = &ppcinfo->ports[port]; in musca_init()
538 if (!pinfo->devfn) { in musca_init()
542 mr = pinfo->devfn(mms, pinfo->opaque, pinfo->name, pinfo->size); in musca_init()
552 const PPCPortInfo *pinfo = &ppcinfo->ports[port]; in musca_init()
554 if (!pinfo->devfn) { in musca_init()
557 sysbus_mmio_map(SYS_BUS_DEVICE(ppc), port, pinfo->addr); in musca_init()
559 gpioname = g_strdup_printf("%s_nonsec", ppcinfo->name); in musca_init()
565 gpioname = g_strdup_printf("%s_ap", ppcinfo->name); in musca_init()
572 gpioname = g_strdup_printf("%s_irq_enable", ppcinfo->name); in musca_init()
577 gpioname = g_strdup_printf("%s_irq_clear", ppcinfo->name); in musca_init()
582 gpioname = g_strdup_printf("%s_irq_status", ppcinfo->name); in musca_init()
593 armv7m_load_kernel(mms->sse.armv7m[0].cpu, machine->kernel_filename, in musca_init()
601 ARM_CPU_TYPE_NAME("cortex-m33"), in musca_class_init()
605 mc->default_cpus = 2; in musca_class_init()
606 mc->min_cpus = mc->default_cpus; in musca_class_init()
607 mc->max_cpus = mc->default_cpus; in musca_class_init()
608 mc->valid_cpu_types = valid_cpu_types; in musca_class_init()
609 mc->init = musca_init; in musca_class_init()
617 mc->desc = "ARM Musca-A board (dual Cortex-M33)"; in musca_a_class_init()
618 mmc->type = MUSCA_A; in musca_a_class_init()
619 mmc->init_svtor = 0x10200000; in musca_a_class_init()
620 mmc->sram_addr_width = 15; in musca_a_class_init()
621 mmc->num_irqs = 64; in musca_a_class_init()
622 mmc->mpc_info = a_mpc_info; in musca_a_class_init()
623 mmc->num_mpcs = ARRAY_SIZE(a_mpc_info); in musca_a_class_init()
631 mc->desc = "ARM Musca-B1 board (dual Cortex-M33)"; in musca_b1_class_init()
632 mmc->type = MUSCA_B1; in musca_b1_class_init()
640 mmc->init_svtor = 0x10000000; in musca_b1_class_init()
641 mmc->sram_addr_width = 17; in musca_b1_class_init()
642 mmc->num_irqs = 96; in musca_b1_class_init()
643 mmc->mpc_info = b1_mpc_info; in musca_b1_class_init()
644 mmc->num_mpcs = ARRAY_SIZE(b1_mpc_info); in musca_b1_class_init()