RealView.py (9394:e88cf95d33d3) RealView.py (9525:0587c8983d47)
1# Copyright (c) 2009-2012 ARM Limited
2# All rights reserved.
3#
4# The license below extends only to copyright in the software and shall
5# not be construed as granting a license to any other intellectual
6# property including but not limited to intellectual property relating
7# to a hardware implementation of the functionality of the software
8# licensed hereunder. You may use the software subject to the license

--- 36 unchanged lines hidden (view full) ---

45from Device import BasicPioDevice, PioDevice, IsaFake, BadAddr, DmaDevice
46from Pci import PciConfigAll
47from Ethernet import NSGigE, IGbE_e1000, IGbE_igb
48from Ide import *
49from Platform import Platform
50from Terminal import Terminal
51from Uart import Uart
52from SimpleMemory import SimpleMemory
1# Copyright (c) 2009-2012 ARM Limited
2# All rights reserved.
3#
4# The license below extends only to copyright in the software and shall
5# not be construed as granting a license to any other intellectual
6# property including but not limited to intellectual property relating
7# to a hardware implementation of the functionality of the software
8# licensed hereunder. You may use the software subject to the license

--- 36 unchanged lines hidden (view full) ---

45from Device import BasicPioDevice, PioDevice, IsaFake, BadAddr, DmaDevice
46from Pci import PciConfigAll
47from Ethernet import NSGigE, IGbE_e1000, IGbE_igb
48from Ide import *
49from Platform import Platform
50from Terminal import Terminal
51from Uart import Uart
52from SimpleMemory import SimpleMemory
53from Gic import *
53
54class AmbaDevice(BasicPioDevice):
55 type = 'AmbaDevice'
56 abstract = True
57 cxx_header = "dev/arm/amba_device.hh"
58 amba_id = Param.UInt32("ID of AMBA device for kernel detection")
59
60class AmbaIntDevice(AmbaDevice):
61 type = 'AmbaIntDevice'
62 abstract = True
63 cxx_header = "dev/arm/amba_device.hh"
54
55class AmbaDevice(BasicPioDevice):
56 type = 'AmbaDevice'
57 abstract = True
58 cxx_header = "dev/arm/amba_device.hh"
59 amba_id = Param.UInt32("ID of AMBA device for kernel detection")
60
61class AmbaIntDevice(AmbaDevice):
62 type = 'AmbaIntDevice'
63 abstract = True
64 cxx_header = "dev/arm/amba_device.hh"
64 gic = Param.Gic(Parent.any, "Gic to use for interrupting")
65 gic = Param.BaseGic(Parent.any, "Gic to use for interrupting")
65 int_num = Param.UInt32("Interrupt number that connects to GIC")
66 int_delay = Param.Latency("100ns",
67 "Time between action and interrupt generation by device")
68
69class AmbaDmaDevice(DmaDevice):
70 type = 'AmbaDmaDevice'
71 abstract = True
72 cxx_header = "dev/arm/amba_device.hh"
73 pio_addr = Param.Addr("Address for AMBA slave interface")
74 pio_latency = Param.Latency("10ns", "Time between action and write/read result by AMBA DMA Device")
66 int_num = Param.UInt32("Interrupt number that connects to GIC")
67 int_delay = Param.Latency("100ns",
68 "Time between action and interrupt generation by device")
69
70class AmbaDmaDevice(DmaDevice):
71 type = 'AmbaDmaDevice'
72 abstract = True
73 cxx_header = "dev/arm/amba_device.hh"
74 pio_addr = Param.Addr("Address for AMBA slave interface")
75 pio_latency = Param.Latency("10ns", "Time between action and write/read result by AMBA DMA Device")
75 gic = Param.Gic(Parent.any, "Gic to use for interrupting")
76 gic = Param.BaseGic(Parent.any, "Gic to use for interrupting")
76 int_num = Param.UInt32("Interrupt number that connects to GIC")
77 amba_id = Param.UInt32("ID of AMBA device for kernel detection")
78
79class A9SCU(BasicPioDevice):
80 type = 'A9SCU'
81 cxx_header = "dev/arm/a9scu.hh"
82
83class RealViewCtrl(BasicPioDevice):
84 type = 'RealViewCtrl'
85 cxx_header = "dev/arm/rv_ctrl.hh"
86 proc_id0 = Param.UInt32(0x0C000000, "Processor ID, SYS_PROCID")
87 proc_id1 = Param.UInt32(0x0C000222, "Processor ID, SYS_PROCID1")
88 idreg = Param.UInt32(0x00000000, "ID Register, SYS_ID")
89
77 int_num = Param.UInt32("Interrupt number that connects to GIC")
78 amba_id = Param.UInt32("ID of AMBA device for kernel detection")
79
80class A9SCU(BasicPioDevice):
81 type = 'A9SCU'
82 cxx_header = "dev/arm/a9scu.hh"
83
84class RealViewCtrl(BasicPioDevice):
85 type = 'RealViewCtrl'
86 cxx_header = "dev/arm/rv_ctrl.hh"
87 proc_id0 = Param.UInt32(0x0C000000, "Processor ID, SYS_PROCID")
88 proc_id1 = Param.UInt32(0x0C000222, "Processor ID, SYS_PROCID1")
89 idreg = Param.UInt32(0x00000000, "ID Register, SYS_ID")
90
90class Gic(PioDevice):
91 type = 'Gic'
92 cxx_header = "dev/arm/gic.hh"
93 platform = Param.Platform(Parent.any, "Platform this device is part of.")
94 dist_addr = Param.Addr(0x1f001000, "Address for distributor")
95 cpu_addr = Param.Addr(0x1f000100, "Address for cpu")
96 dist_pio_delay = Param.Latency('10ns', "Delay for PIO r/w to distributor")
97 cpu_pio_delay = Param.Latency('10ns', "Delay for PIO r/w to cpu interface")
98 int_latency = Param.Latency('10ns', "Delay for interrupt to get to CPU")
99 it_lines = Param.UInt32(128, "Number of interrupt lines supported (max = 1020)")
100
101class AmbaFake(AmbaDevice):
102 type = 'AmbaFake'
103 cxx_header = "dev/arm/amba_fake.hh"
104 ignore_access = Param.Bool(False, "Ignore reads/writes to this device, (e.g. IsaFake + AMBA)")
105 amba_id = 0;
106
107class Pl011(Uart):
108 type = 'Pl011'
109 cxx_header = "dev/arm/pl011.hh"
91class AmbaFake(AmbaDevice):
92 type = 'AmbaFake'
93 cxx_header = "dev/arm/amba_fake.hh"
94 ignore_access = Param.Bool(False, "Ignore reads/writes to this device, (e.g. IsaFake + AMBA)")
95 amba_id = 0;
96
97class Pl011(Uart):
98 type = 'Pl011'
99 cxx_header = "dev/arm/pl011.hh"
110 gic = Param.Gic(Parent.any, "Gic to use for interrupting")
100 gic = Param.BaseGic(Parent.any, "Gic to use for interrupting")
111 int_num = Param.UInt32("Interrupt number that connects to GIC")
112 end_on_eot = Param.Bool(False, "End the simulation when a EOT is received on the UART")
113 int_delay = Param.Latency("100ns", "Time between action and interrupt generation by UART")
114
115class Sp804(AmbaDevice):
116 type = 'Sp804'
117 cxx_header = "dev/arm/timer_sp804.hh"
101 int_num = Param.UInt32("Interrupt number that connects to GIC")
102 end_on_eot = Param.Bool(False, "End the simulation when a EOT is received on the UART")
103 int_delay = Param.Latency("100ns", "Time between action and interrupt generation by UART")
104
105class Sp804(AmbaDevice):
106 type = 'Sp804'
107 cxx_header = "dev/arm/timer_sp804.hh"
118 gic = Param.Gic(Parent.any, "Gic to use for interrupting")
108 gic = Param.BaseGic(Parent.any, "Gic to use for interrupting")
119 int_num0 = Param.UInt32("Interrupt number that connects to GIC")
120 clock0 = Param.Clock('1MHz', "Clock speed of the input")
121 int_num1 = Param.UInt32("Interrupt number that connects to GIC")
122 clock1 = Param.Clock('1MHz', "Clock speed of the input")
123 amba_id = 0x00141804
124
125class CpuLocalTimer(BasicPioDevice):
126 type = 'CpuLocalTimer'
127 cxx_header = "dev/arm/timer_cpulocal.hh"
109 int_num0 = Param.UInt32("Interrupt number that connects to GIC")
110 clock0 = Param.Clock('1MHz', "Clock speed of the input")
111 int_num1 = Param.UInt32("Interrupt number that connects to GIC")
112 clock1 = Param.Clock('1MHz', "Clock speed of the input")
113 amba_id = 0x00141804
114
115class CpuLocalTimer(BasicPioDevice):
116 type = 'CpuLocalTimer'
117 cxx_header = "dev/arm/timer_cpulocal.hh"
128 gic = Param.Gic(Parent.any, "Gic to use for interrupting")
118 gic = Param.BaseGic(Parent.any, "Gic to use for interrupting")
129 int_num_timer = Param.UInt32("Interrrupt number used per-cpu to GIC")
130 int_num_watchdog = Param.UInt32("Interrupt number for per-cpu watchdog to GIC")
131 # Override the default clock
132 clock = '1GHz'
133
134class PL031(AmbaIntDevice):
135 type = 'PL031'
136 cxx_header = "dev/arm/rtc_pl031.hh"

--- 32 unchanged lines hidden (view full) ---

169
170
171# Reference for memory map and interrupt number
172# RealView Platform Baseboard Explore for Cortex-A9 User Guide(ARM DUI 0440A)
173# Chapter 4: Programmer's Reference
174class RealViewPBX(RealView):
175 uart = Pl011(pio_addr=0x10009000, int_num=44)
176 realview_io = RealViewCtrl(pio_addr=0x10000000)
119 int_num_timer = Param.UInt32("Interrrupt number used per-cpu to GIC")
120 int_num_watchdog = Param.UInt32("Interrupt number for per-cpu watchdog to GIC")
121 # Override the default clock
122 clock = '1GHz'
123
124class PL031(AmbaIntDevice):
125 type = 'PL031'
126 cxx_header = "dev/arm/rtc_pl031.hh"

--- 32 unchanged lines hidden (view full) ---

159
160
161# Reference for memory map and interrupt number
162# RealView Platform Baseboard Explore for Cortex-A9 User Guide(ARM DUI 0440A)
163# Chapter 4: Programmer's Reference
164class RealViewPBX(RealView):
165 uart = Pl011(pio_addr=0x10009000, int_num=44)
166 realview_io = RealViewCtrl(pio_addr=0x10000000)
177 gic = Gic()
167 gic = Pl390()
178 timer0 = Sp804(int_num0=36, int_num1=36, pio_addr=0x10011000)
179 timer1 = Sp804(int_num0=37, int_num1=37, pio_addr=0x10012000)
180 local_cpu_timer = CpuLocalTimer(int_num_timer=29, int_num_watchdog=30, pio_addr=0x1f000600)
181 clcd = Pl111(pio_addr=0x10020000, int_num=55)
182 kmi0 = Pl050(pio_addr=0x10006000, int_num=52)
183 kmi1 = Pl050(pio_addr=0x10007000, int_num=53, is_mouse=True)
184 a9scu = A9SCU(pio_addr=0x1f000000)
185 cf_ctrl = IdeController(disks=[], pci_func=0, pci_dev=7, pci_bus=2,

--- 71 unchanged lines hidden (view full) ---

257 self.flash_fake.pio = bus.master
258
259# Reference for memory map and interrupt number
260# RealView Emulation Baseboard User Guide (ARM DUI 0143B)
261# Chapter 4: Programmer's Reference
262class RealViewEB(RealView):
263 uart = Pl011(pio_addr=0x10009000, int_num=44)
264 realview_io = RealViewCtrl(pio_addr=0x10000000)
168 timer0 = Sp804(int_num0=36, int_num1=36, pio_addr=0x10011000)
169 timer1 = Sp804(int_num0=37, int_num1=37, pio_addr=0x10012000)
170 local_cpu_timer = CpuLocalTimer(int_num_timer=29, int_num_watchdog=30, pio_addr=0x1f000600)
171 clcd = Pl111(pio_addr=0x10020000, int_num=55)
172 kmi0 = Pl050(pio_addr=0x10006000, int_num=52)
173 kmi1 = Pl050(pio_addr=0x10007000, int_num=53, is_mouse=True)
174 a9scu = A9SCU(pio_addr=0x1f000000)
175 cf_ctrl = IdeController(disks=[], pci_func=0, pci_dev=7, pci_bus=2,

--- 71 unchanged lines hidden (view full) ---

247 self.flash_fake.pio = bus.master
248
249# Reference for memory map and interrupt number
250# RealView Emulation Baseboard User Guide (ARM DUI 0143B)
251# Chapter 4: Programmer's Reference
252class RealViewEB(RealView):
253 uart = Pl011(pio_addr=0x10009000, int_num=44)
254 realview_io = RealViewCtrl(pio_addr=0x10000000)
265 gic = Gic(dist_addr=0x10041000, cpu_addr=0x10040000)
255 gic = Pl390(dist_addr=0x10041000, cpu_addr=0x10040000)
266 timer0 = Sp804(int_num0=36, int_num1=36, pio_addr=0x10011000)
267 timer1 = Sp804(int_num0=37, int_num1=37, pio_addr=0x10012000)
268 clcd = Pl111(pio_addr=0x10020000, int_num=23)
269 kmi0 = Pl050(pio_addr=0x10006000, int_num=20)
270 kmi1 = Pl050(pio_addr=0x10007000, int_num=21, is_mouse=True)
271
272 l2x0_fake = IsaFake(pio_addr=0x1f002000, pio_size=0xfff, warn_access="1")
273 flash_fake = IsaFake(pio_addr=0x40000000, pio_size=0x20000000-1,

--- 59 unchanged lines hidden (view full) ---

333 self.smcreg_fake.pio = bus.master
334
335class VExpress_EMM(RealView):
336 mem_start_addr = '2GB'
337 max_mem_size = '2GB'
338 pci_cfg_base = 0x30000000
339 uart = Pl011(pio_addr=0x1c090000, int_num=37)
340 realview_io = RealViewCtrl(proc_id0=0x14000000, proc_id1=0x14000000, pio_addr=0x1C010000)
256 timer0 = Sp804(int_num0=36, int_num1=36, pio_addr=0x10011000)
257 timer1 = Sp804(int_num0=37, int_num1=37, pio_addr=0x10012000)
258 clcd = Pl111(pio_addr=0x10020000, int_num=23)
259 kmi0 = Pl050(pio_addr=0x10006000, int_num=20)
260 kmi1 = Pl050(pio_addr=0x10007000, int_num=21, is_mouse=True)
261
262 l2x0_fake = IsaFake(pio_addr=0x1f002000, pio_size=0xfff, warn_access="1")
263 flash_fake = IsaFake(pio_addr=0x40000000, pio_size=0x20000000-1,

--- 59 unchanged lines hidden (view full) ---

323 self.smcreg_fake.pio = bus.master
324
325class VExpress_EMM(RealView):
326 mem_start_addr = '2GB'
327 max_mem_size = '2GB'
328 pci_cfg_base = 0x30000000
329 uart = Pl011(pio_addr=0x1c090000, int_num=37)
330 realview_io = RealViewCtrl(proc_id0=0x14000000, proc_id1=0x14000000, pio_addr=0x1C010000)
341 gic = Gic(dist_addr=0x2C001000, cpu_addr=0x2C002000)
331 gic = Pl390(dist_addr=0x2C001000, cpu_addr=0x2C002000)
342 local_cpu_timer = CpuLocalTimer(int_num_timer=29, int_num_watchdog=30, pio_addr=0x2C080000)
343 timer0 = Sp804(int_num0=34, int_num1=34, pio_addr=0x1C110000, clock0='1MHz', clock1='1MHz')
344 timer1 = Sp804(int_num0=35, int_num1=35, pio_addr=0x1C120000, clock0='1MHz', clock1='1MHz')
345 clcd = Pl111(pio_addr=0x1c1f0000, int_num=46)
346 kmi0 = Pl050(pio_addr=0x1c060000, int_num=44)
347 kmi1 = Pl050(pio_addr=0x1c070000, int_num=45, is_mouse=True)
348 cf_ctrl = IdeController(disks=[], pci_func=0, pci_dev=0, pci_bus=2,
349 io_shift = 2, ctrl_offset = 2, Command = 0x1,

--- 84 unchanged lines hidden ---
332 local_cpu_timer = CpuLocalTimer(int_num_timer=29, int_num_watchdog=30, pio_addr=0x2C080000)
333 timer0 = Sp804(int_num0=34, int_num1=34, pio_addr=0x1C110000, clock0='1MHz', clock1='1MHz')
334 timer1 = Sp804(int_num0=35, int_num1=35, pio_addr=0x1C120000, clock0='1MHz', clock1='1MHz')
335 clcd = Pl111(pio_addr=0x1c1f0000, int_num=46)
336 kmi0 = Pl050(pio_addr=0x1c060000, int_num=44)
337 kmi1 = Pl050(pio_addr=0x1c070000, int_num=45, is_mouse=True)
338 cf_ctrl = IdeController(disks=[], pci_func=0, pci_dev=0, pci_bus=2,
339 io_shift = 2, ctrl_offset = 2, Command = 0x1,

--- 84 unchanged lines hidden ---