#
# Authors: Ali Saidi
# Gabe Black
+# William Wang
from m5.params import *
from m5.proxy import *
-from Device import BasicPioDevice, PioDevice, IsaFake, BadAddr
+from Device import BasicPioDevice, PioDevice, IsaFake, BadAddr, DmaDevice
from Platform import Platform
from Terminal import Terminal
from Uart import Uart
abstract = True
amba_id = Param.UInt32("ID of AMBA device for kernel detection")
+class AmbaIntDevice(AmbaDevice):
+ type = 'AmbaIntDevice'
+ abstract = True
+ gic = Param.Gic(Parent.any, "Gic to use for interrupting")
+ int_num = Param.UInt32("Interrupt number that connects to GIC")
+ int_delay = Param.Latency("100ns",
+ "Time between action and interrupt generation by device")
+
+class AmbaDmaDevice(DmaDevice):
+ type = 'AmbaDmaDevice'
+ abstract = True
+ pio_addr = Param.Addr("Address for AMBA slave interface")
+ pio_latency = Param.Latency("10ns", "Time between action and write/read result by AMBA DMA Device")
+ gic = Param.Gic(Parent.any, "Gic to use for interrupting")
+ int_num = Param.UInt32("Interrupt number that connects to GIC")
+ amba_id = Param.UInt32("ID of AMBA device for kernel detection")
+
class RealViewCtrl(BasicPioDevice):
type = 'RealViewCtrl'
proc_id = Param.UInt32(0x0C000000, "Platform ID")
clock1 = Param.Clock('1MHz', "Clock speed of the input")
amba_id = 0x00141804
+class Pl050(AmbaIntDevice):
+ type = 'Pl050'
+ vnc = Param.VncServer(Parent.any, "Vnc server for remote frame buffer display")
+ is_mouse = Param.Bool(False, "Is this interface a mouse, if not a keyboard")
+ int_delay = '1us'
+ amba_id = 0x00141050
+
+class Pl111(AmbaDmaDevice):
+ type = 'Pl111'
+ clock = Param.Clock('24MHz', "Clock speed of the input")
+ vnc = Param.VncServer(Parent.any, "Vnc server for remote frame buffer display")
+ amba_id = 0x00141111
+
class RealView(Platform):
type = 'RealView'
system = Param.System(Parent.any, "system")
+# Reference for memory map and interrupt number
+# RealView Platform Baseboard Explore for Cortex-A9 User Guide(ARM DUI 0440A)
+# Chapter 4: Programmer's Reference
class RealViewPBX(RealView):
uart = Pl011(pio_addr=0x10009000, int_num=44)
realview_io = RealViewCtrl(pio_addr=0x10000000)
gic = Gic()
timer0 = Sp804(int_num0=36, int_num1=36, pio_addr=0x10011000)
timer1 = Sp804(int_num0=37, int_num1=37, pio_addr=0x10012000)
+ clcd = Pl111(pio_addr=0x10020000, int_num=55)
+ kmi0 = Pl050(pio_addr=0x10006000, int_num=52)
+ kmi1 = Pl050(pio_addr=0x10007000, int_num=53, is_mouse=True)
- l2x0_fake = IsaFake(pio_addr=0x1f002000, pio_size=0xfff, warn_access="1")
+ l2x0_fake = IsaFake(pio_addr=0x1f002000, pio_size=0xfff)
+ flash_fake = IsaFake(pio_addr=0x40000000, pio_size=0x4000000)
dmac_fake = AmbaFake(pio_addr=0x10030000)
uart1_fake = AmbaFake(pio_addr=0x1000a000)
uart2_fake = AmbaFake(pio_addr=0x1000b000)
uart3_fake = AmbaFake(pio_addr=0x1000c000)
smc_fake = AmbaFake(pio_addr=0x100e1000)
- clcd_fake = AmbaFake(pio_addr=0x10020000)
sp810_fake = AmbaFake(pio_addr=0x10001000, ignore_access=True)
watchdog_fake = AmbaFake(pio_addr=0x10010000)
gpio0_fake = AmbaFake(pio_addr=0x10013000)
sci_fake = AmbaFake(pio_addr=0x1000e000)
aaci_fake = AmbaFake(pio_addr=0x10004000)
mmc_fake = AmbaFake(pio_addr=0x10005000)
- kmi0_fake = AmbaFake(pio_addr=0x10006000)
- kmi1_fake = AmbaFake(pio_addr=0x10007000)
rtc_fake = AmbaFake(pio_addr=0x10017000, amba_id=0x41031)
-
+ cf0_fake = IsaFake(pio_addr=0x18000000, pio_size=0xfff)
# Attach I/O devices that are on chip
self.realview_io.pio = bus.port
self.timer0.pio = bus.port
self.timer1.pio = bus.port
+ self.clcd.pio = bus.port
+ self.kmi0.pio = bus.port
+ self.kmi1.pio = bus.port
self.dmac_fake.pio = bus.port
self.uart1_fake.pio = bus.port
self.uart2_fake.pio = bus.port
self.uart3_fake.pio = bus.port
self.smc_fake.pio = bus.port
- self.clcd_fake.pio = bus.port
self.sp810_fake.pio = bus.port
self.watchdog_fake.pio = bus.port
self.gpio0_fake.pio = bus.port
self.sci_fake.pio = bus.port
self.aaci_fake.pio = bus.port
self.mmc_fake.pio = bus.port
- self.kmi0_fake.pio = bus.port
- self.kmi1_fake.pio = bus.port
self.rtc_fake.pio = bus.port
+ self.flash_fake.pio = bus.port
+ self.cf0_fake.pio = bus.port
+# Reference for memory map and interrupt number
+# RealView Emulation Baseboard User Guide (ARM DUI 0143B)
+# Chapter 4: Programmer's Reference
class RealViewEB(RealView):
uart = Pl011(pio_addr=0x10009000, int_num=44)
realview_io = RealViewCtrl(pio_addr=0x10000000)
gic = Gic(dist_addr=0x10041000, cpu_addr=0x10040000)
timer0 = Sp804(int_num0=36, int_num1=36, pio_addr=0x10011000)
timer1 = Sp804(int_num0=37, int_num1=37, pio_addr=0x10012000)
+ clcd = Pl111(pio_addr=0x10020000, int_num=23)
+ kmi0 = Pl050(pio_addr=0x10006000, int_num=20)
+ kmi1 = Pl050(pio_addr=0x10007000, int_num=21, is_mouse=True)
l2x0_fake = IsaFake(pio_addr=0x1f002000, pio_size=0xfff, warn_access="1")
dmac_fake = AmbaFake(pio_addr=0x10030000)
uart2_fake = AmbaFake(pio_addr=0x1000b000)
uart3_fake = AmbaFake(pio_addr=0x1000c000)
smc_fake = AmbaFake(pio_addr=0x100e1000)
- clcd_fake = AmbaFake(pio_addr=0x10020000)
sp810_fake = AmbaFake(pio_addr=0x10001000, ignore_access=True)
watchdog_fake = AmbaFake(pio_addr=0x10010000)
gpio0_fake = AmbaFake(pio_addr=0x10013000)
sci_fake = AmbaFake(pio_addr=0x1000e000)
aaci_fake = AmbaFake(pio_addr=0x10004000)
mmc_fake = AmbaFake(pio_addr=0x10005000)
- kmi0_fake = AmbaFake(pio_addr=0x10006000)
- kmi1_fake = AmbaFake(pio_addr=0x10007000)
rtc_fake = AmbaFake(pio_addr=0x10017000, amba_id=0x41031)
self.realview_io.pio = bus.port
self.timer0.pio = bus.port
self.timer1.pio = bus.port
+ self.clcd.pio = bus.port
+ self.kmi0.pio = bus.port
+ self.kmi1.pio = bus.port
self.dmac_fake.pio = bus.port
self.uart1_fake.pio = bus.port
self.uart2_fake.pio = bus.port
self.uart3_fake.pio = bus.port
self.smc_fake.pio = bus.port
- self.clcd_fake.pio = bus.port
self.sp810_fake.pio = bus.port
self.watchdog_fake.pio = bus.port
self.gpio0_fake.pio = bus.port
self.sci_fake.pio = bus.port
self.aaci_fake.pio = bus.port
self.mmc_fake.pio = bus.port
- self.kmi0_fake.pio = bus.port
- self.kmi1_fake.pio = bus.port
self.rtc_fake.pio = bus.port