26
#include "hw/core/qdev-clock.h"
27
28
/*
29
- * The SSE-300 puts some devices in different places to the
29
+ * The SSE-300 and SSE-310 put some devices in different places to the
30
* SSE-200 (and original IoTKit). We use an array of these structs
31
* to define how each variant lays out these devices. (Parts of the
32
* SoC that are the same for all variants aren't handled via these
118
DEFINE_PROP_UINT32("CPU0_MPU_S", ARMSSE, cpu_mpu_s[0], 8),
119
};
120
121
+static const Property sse310_properties[] = {
122
+ DEFINE_PROP_LINK("memory", ARMSSE, board_memory, TYPE_MEMORY_REGION,
123
+ MemoryRegion *),
124
+ DEFINE_PROP_UINT32("EXP_NUMIRQ", ARMSSE, exp_numirq, 64),
125
+ DEFINE_PROP_UINT32("SRAM_ADDR_WIDTH", ARMSSE, sram_addr_width, 21),
126
+ DEFINE_PROP_UINT32("init-svtor", ARMSSE, init_svtor, 0x10000000),
127
+ DEFINE_PROP_BOOL("CPU0_FPU", ARMSSE, cpu_fpu[0], true),
128
+ DEFINE_PROP_BOOL("CPU0_DSP", ARMSSE, cpu_dsp[0], true),
129
+ DEFINE_PROP_UINT32("CPU0_MPU_NS", ARMSSE, cpu_mpu_ns[0], 8),
130
+ DEFINE_PROP_UINT32("CPU0_MPU_S", ARMSSE, cpu_mpu_s[0], 8),
131
+};
132
+
133
static const ARMSSEDeviceInfo iotkit_devices[] = {
134
{
135
.name = "timer0",
492
}
493
};
494
495
+static const ARMSSEDeviceInfo sse310_devices[] = {
496
+ {
497
+ .name = "timer0",
498
+ .type = TYPE_SSE_TIMER,
499
+ .index = 0,
500
+ .addr = 0x48000000,
501
+ .ppc = 0,
502
+ .ppc_port = 0,
503
+ .irq = 3,
504
+ },
505
+ {
506
+ .name = "timer1",
507
+ .type = TYPE_SSE_TIMER,
508
+ .index = 1,
509
+ .addr = 0x48001000,
510
+ .ppc = 0,
511
+ .ppc_port = 1,
512
+ .irq = 4,
513
+ },
514
+ {
515
+ .name = "timer2",
516
+ .type = TYPE_SSE_TIMER,
517
+ .index = 2,
518
+ .addr = 0x48002000,
519
+ .ppc = 0,
520
+ .ppc_port = 2,
521
+ .irq = 5,
522
+ },
523
+ {
524
+ .name = "timer3",
525
+ .type = TYPE_SSE_TIMER,
526
+ .index = 3,
527
+ .addr = 0x48003000,
528
+ .ppc = 0,
529
+ .ppc_port = 5,
530
+ .irq = 27,
531
+ },
532
+ {
533
+ .name = "s32ktimer",
534
+ .type = TYPE_CMSDK_APB_TIMER,
535
+ .index = 0,
536
+ .addr = 0x4802f000,
537
+ .ppc = 1,
538
+ .ppc_port = 0,
539
+ .irq = 2,
540
+ .slowclk = true,
541
+ },
542
+ {
543
+ .name = "s32kwatchdog",
544
+ .type = TYPE_CMSDK_APB_WATCHDOG,
545
+ .index = 0,
546
+ .addr = 0x5802e000,
547
+ .ppc = NO_PPC,
548
+ .irq = NMI_0,
549
+ .slowclk = true,
550
+ },
551
+ {
552
+ .name = "watchdog",
553
+ .type = TYPE_UNIMPLEMENTED_DEVICE,
554
+ .index = 0,
555
+ .addr = 0x48040000,
556
+ .size = 0x2000,
557
+ .ppc = NO_PPC,
558
+ .irq = NO_IRQ,
559
+ },
560
+ {
561
+ .name = "armsse-sysinfo",
562
+ .type = TYPE_IOTKIT_SYSINFO,
563
+ .index = 0,
564
+ .addr = 0x48020000,
565
+ .ppc = NO_PPC,
566
+ .irq = NO_IRQ,
567
+ },
568
+ {
569
+ .name = "armsse-sysctl",
570
+ .type = TYPE_IOTKIT_SYSCTL,
571
+ .index = 0,
572
+ .addr = 0x58021000,
573
+ .ppc = NO_PPC,
574
+ .irq = NO_IRQ,
575
+ },
576
+ {
577
+ .name = "SYS_PPU",
578
+ .type = TYPE_UNIMPLEMENTED_DEVICE,
579
+ .index = 1,
580
+ .addr = 0x58022000,
581
+ .size = 0x1000,
582
+ .ppc = NO_PPC,
583
+ .irq = NO_IRQ,
584
+ },
585
+ {
586
+ .name = "CPU0CORE_PPU",
587
+ .type = TYPE_UNIMPLEMENTED_DEVICE,
588
+ .index = 2,
589
+ .addr = 0x58023000,
590
+ .size = 0x1000,
591
+ .ppc = NO_PPC,
592
+ .irq = NO_IRQ,
593
+ },
594
+ {
595
+ .name = "MGMT_PPU",
596
+ .type = TYPE_UNIMPLEMENTED_DEVICE,
597
+ .index = 3,
598
+ .addr = 0x58028000,
599
+ .size = 0x1000,
600
+ .ppc = NO_PPC,
601
+ .irq = NO_IRQ,
602
+ },
603
+ {
604
+ .name = "DEBUG_PPU",
605
+ .type = TYPE_UNIMPLEMENTED_DEVICE,
606
+ .index = 4,
607
+ .addr = 0x58029000,
608
+ .size = 0x1000,
609
+ .ppc = NO_PPC,
610
+ .irq = NO_IRQ,
611
+ },
612
+ {
613
+ .name = "NPU0_PPU",
614
+ .type = TYPE_UNIMPLEMENTED_DEVICE,
615
+ .index = 5,
616
+ .addr = 0x5802a000,
617
+ .size = 0x1000,
618
+ .ppc = NO_PPC,
619
+ .irq = NO_IRQ,
620
+ },
621
+ {
622
+ .name = "NPU0_CFG",
623
+ .type = TYPE_UNIMPLEMENTED_DEVICE,
624
+ .index = 6,
625
+ .addr = 0x40004000,
626
+ .size = 0x1000,
627
+ .ppc = NO_PPC,
628
+ .irq = NO_IRQ,
629
+ },
630
+ {
631
+ .name = NULL,
632
+ }
633
+};
634
+
635
/* Is internal IRQ n shared between CPUs in a multi-core SSE ? */
636
static const bool sse200_irq_is_common[32] = {
637
[0 ... 5] = true,
659
/* 30, 31: reserved */
660
};
661
662
+static const bool sse310_irq_is_common[32] = {
663
+ [0 ... 5] = true,
664
+ /* 6-8: reserved */
665
+ [9 ... 12] = true,
666
+ /* 13: reserved */
667
+ [14] = true,
668
+ /* 15: reserved */
669
+ [16] = true,
670
+ /* 17-26: reserved */
671
+ [27] = true,
672
+ /* 28, 29: per-CPU CTI interrupts */
673
+ /* 30, 31: reserved */
674
+};
675
+
676
static const ARMSSEInfo armsse_variants[] = {
677
{
678
.name = TYPE_IOTKIT,
740
.devinfo = sse300_devices,
741
.irq_is_common = sse300_irq_is_common,
742
},
743
+ {
744
+ .name = TYPE_SSE310,
745
+ .sse_version = ARMSSE_SSE310,
746
+ .cpu_type = ARM_CPU_TYPE_NAME("cortex-m85"),
747
+ .sram_banks = 2,
748
+ .sram_bank_base = 0x21000000,
749
+ .num_cpus = 1,
750
+ .sys_version = 0x7e10043b,
751
+ .iidr = 0x74e0043b,
752
+ .cpuwait_rst = 0,
753
+ .has_mhus = false,
754
+ .has_cachectrl = false,
755
+ .has_cpusecctrl = true,
756
+ .has_cpuid = true,
757
+ .has_cpu_pwrctrl = true,
758
+ .has_sse_counter = true,
759
+ .has_tcms = true,
760
+ .props = sse310_properties,
761
+ .props_count = ARRAY_SIZE(sse310_properties),
762
+ .devinfo = sse310_devices,
763
+ .irq_is_common = sse310_irq_is_common,
764
+ }
765
};
766
767
static uint32_t armsse_sys_config_value(ARMSSE *s, const ARMSSEInfo *info)
792
sys_config = deposit32(sys_config, 4, 5, s->sram_addr_width);
793
sys_config = deposit32(sys_config, 16, 3, 3); /* CPU0 = Cortex-M55 */
794
break;
795
+ case ARMSSE_SSE310:
796
+ sys_config = 0;
797
+ sys_config = deposit32(sys_config, 0, 4, info->sram_banks);
798
+ sys_config = deposit32(sys_config, 4, 5, s->sram_addr_width);
799
+ sys_config = deposit32(sys_config, 10, 1, 0); /* No CoreSight SoC */
800
+ sys_config = deposit32(sys_config, 11, 2, 0); /* Basic level PI */
801
+ sys_config = deposit32(sys_config, 16, 3, 4); /* CPU0 = Cortex-M85 */
802
+ break;
803
default:
804
g_assert_not_reached();
805
}
1401
qdev_connect_gpio_out(DEVICE(&s->nmi_orgate), 0,
1402
qdev_get_gpio_in_named(DEVICE(&s->armv7m), "NMI", 0));
1403
1208
- /* The SSE-300 has a System Counter / System Timestamp Generator */
1404
+ /* The SSE-300/SSE-310 has a System Counter / System Timestamp Generator */
1405
if (info->has_sse_counter) {
1406
SysBusDevice *sbd = SYS_BUS_DEVICE(&s->sse_counter);
1407
1421
}
1422
1423
if (info->has_tcms) {
1228
- /* The SSE-300 has an ITCM at 0x0000_0000 and a DTCM at 0x2000_0000 */
1229
- memory_region_init_ram(&s->itcm, NULL, "sse300-itcm", 512 * KiB, errp);
1424
+ /* SSE-300/SSE-310 have ITCM at 0x0000_0000 and DTCM at 0x2000_0000 */
1425
+ memory_region_init_ram(&s->itcm, NULL, "itcm", 512 * KiB, errp);
1426
if (*errp) {
1427
return;
1428
}
1233
- memory_region_init_ram(&s->dtcm, NULL, "sse300-dtcm", 512 * KiB, errp);
1429
+ memory_region_init_ram(&s->dtcm, NULL, "dtcm", 512 * KiB, errp);
1430
if (*errp) {
1431
return;
1432
}
1657
* 0x50010000: L1 icache control registers
1658
* 0x50011000: CPUSECCTRL (CPU local security control registers)
1659
* 0x4001f000 and 0x5001f000: CPU_IDENTITY register block
1464
- * The SSE-300 has an extra:
1660
+ * The SSE-300 and SSE-310 have an extra:
1661
* 0x40012000 and 0x50012000: CPU_PWRCTRL register block
1662
*/
1663
if (info->has_cachectrl) {