uart0: UART.ImxUart @ sysbus 0x40027000
    IRQ -> mscm@53

uart1: UART.ImxUart @ sysbus 0x40028000
    IRQ -> mscm@54

uart2: UART.ImxUart @ sysbus 0x40029000
    IRQ -> mscm@55

eDma0: DMA.VybridDma @ sysbus <0x40018000, +0x2000> { -> mscm@0 }
eDma1: DMA.VybridDma @ sysbus <0x40098000, +0x2000> { -> mscm@2 }
fb: Video.VybridDCU @ sysbus <0x40058000, +0x2000>

usbEhci0: USBDeprecated.EHCIHostController @ sysbus <0x40034000, +0x2000>
    IRQ -> mscm@67

usbEhci1: USBDeprecated.EHCIHostController @ sysbus <0x400B4000, +0x2000>
    IRQ -> mscm@68

i2c0: I2C.VybridI2C @ sysbus 0x40066000 { -> mscm@63 }
i2c1: I2C.VybridI2C @ sysbus 0x40067000
timers: Timers.PeriodicInterruptTimer @ sysbus <0x40037000, +0x1000> { -> mscm@31 }

bootRom: Memory.MappedMemory @ sysbus 0
    size: 0x80000

ocRam: Memory.MappedMemory @ { sysbus 0x3F000000; sysbus 0x1F000000 }
    size: 0x80000

tcml: Memory.MappedMemory @ sysbus 0x1F800000
    size: 0x8000

tcmu: Memory.MappedMemory @ sysbus 0x3F800000
    size: 0x8000

memory: Memory.MappedMemory @ sysbus 0x80000000
    size: 0x10000000

gic: IRQControllers.ARM_GenericInterruptController @ {
        sysbus new Bus.BusMultiRegistration { address: 0x40003000; size: 0x1000; region: "distributor" };
        sysbus new Bus.BusMultiRegistration { address: 0x40002100; size: 0x100; region: "cpuInterface" }
    }
    supportsTwoSecurityStates: false
    architectureVersion: .GICv1
    // GIC -> ARM CPU interrupt connections are generated automatically

cpuA5: CPU.ARMv7A @ sysbus
    cpuType: "cortex-a9"
    genericInterruptController: gic

nvic: IRQControllers.NVIC @ sysbus 0xE000E000
    systickFrequency: 24000000
    IRQ -> cpuM4@0

cpuM4: CPU.CortexM @ sysbus
    cpuType: "cortex-m4"
    nvic: nvic
    IsHalted: true

gpio0: GPIOPort.NXPGPIOPort @ {
        sysbus new Bus.BusMultiRegistration { address: 0x400FF000; size: 0x40; region: "gpio" };
        sysbus new Bus.BusMultiRegistration { address: 0x40049000; size: 0xD0; region: "port" }
    }
    numberOfPins: 32
    -> gic@0x6B

gpio1: GPIOPort.NXPGPIOPort @ {
    sysbus new Bus.BusMultiRegistration { address: 0x400FF040; size: 0x40; region: "gpio" };
    sysbus new Bus.BusMultiRegistration { address: 0x4004A000; size: 0xD0; region: "port" }}
    numberOfPins: 32

gpio2: GPIOPort.NXPGPIOPort @ {
    sysbus new Bus.BusMultiRegistration { address: 0x400FF080; size: 0x40; region: "gpio" };
    sysbus new Bus.BusMultiRegistration { address: 0x4004B000; size: 0xD0; region: "port" }}
    numberOfPins: 32

gpio3: GPIOPort.NXPGPIOPort @ {
    sysbus new Bus.BusMultiRegistration { address: 0x400FF0C0; size: 0x40; region: "gpio" };
    sysbus new Bus.BusMultiRegistration { address: 0x4004C000; size: 0xD0; region: "port" }}
    numberOfPins: 32

gpio4: GPIOPort.NXPGPIOPort @ {
    sysbus new Bus.BusMultiRegistration { address: 0x400FF100; size: 0x40; region: "gpio" };
    sysbus new Bus.BusMultiRegistration { address: 0x4004D000; size: 0xD0; region: "port" }}
    numberOfPins: 32

mscm: IRQControllers.MSCM @ sysbus 0x40001000
    [0-111, 224-227] -> gic@[8-119, 0-3]
    [112-223, 228-231] -> nvic@[8-119, 0-3]

globalTimer: Timers.ARM_GlobalTimer @ sysbus 0x40002200
    0 -> gic#0@27
    frequency: 528000000
    irqController: gic

sema4: Miscellaneous.SEMA4 @ sysbus 0x4001D000
    CPU0 -> gic@4
    CPU1 -> nvic@4

nand: MTD.FSLNAND @ sysbus 0x400E0000 { -> mscm@75 }

sysbus:
    init:
        // DDR settings (u-boot checks for ram size this way
        // CR001
        Tag <0x400AE004, 0x400AE007> "DDRMC_CR001" 0x00020B10
        // CR073
        Tag <0x400AE124, 0x400AE127> "DDRMC_CR073" 0x0a010300
        // CR078
        Tag <0x400AE138, 0x400AE13B> "DDRMC_CR078" 0x0000000c
        
        Tag <0x40050080, 0x40050083> "ANADIG_PLL4_NUM" 0xFFFFFFFF
        Tag <0x40050090, 0x40050093> "ANADIG_PLL4_DENOM" 0xFFFFFFFF
        
        Tag <0x40050010, 0x40050013> "ANADIG_PLL3_CTRL" 0xFFFFFFFF
        Tag <0x40050020, 0x40050023> "ANADIG_PLL7_CTRL" 0xFFFFFFFF
        Tag <0x400500E0, 0x400500E3> "ANADIG_PLL5_CTRL" 0xFFFFFFFF
        Tag <0x40050070, 0x40050073> "ANADIG_PLL4_CTRL" 0xFFFFFFFF
        Tag <0x40044304, 0x40044307> "QuadSPI0_LCKCR" 0xFFFFFFFF
        Tag <0x40050830, 0x40050833> "USBPHY0_CTRL" 0xFFFFFFFF
