RealView.py (9330:4a3269a11230) RealView.py (9338:97b4a2be1e5b)
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

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

49from Platform import Platform
50from Terminal import Terminal
51from Uart import Uart
52from SimpleMemory import SimpleMemory
53
54class AmbaDevice(BasicPioDevice):
55 type = 'AmbaDevice'
56 abstract = True
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

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

49from Platform import Platform
50from Terminal import Terminal
51from Uart import Uart
52from SimpleMemory import SimpleMemory
53
54class AmbaDevice(BasicPioDevice):
55 type = 'AmbaDevice'
56 abstract = True
57 cxx_header = "dev/arm/amba_device.hh"
57 amba_id = Param.UInt32("ID of AMBA device for kernel detection")
58
59class AmbaIntDevice(AmbaDevice):
60 type = 'AmbaIntDevice'
61 abstract = True
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"
62 gic = Param.Gic(Parent.any, "Gic to use for interrupting")
63 int_num = Param.UInt32("Interrupt number that connects to GIC")
64 int_delay = Param.Latency("100ns",
65 "Time between action and interrupt generation by device")
66
67class AmbaDmaDevice(DmaDevice):
68 type = 'AmbaDmaDevice'
69 abstract = True
64 gic = Param.Gic(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"
70 pio_addr = Param.Addr("Address for AMBA slave interface")
71 pio_latency = Param.Latency("10ns", "Time between action and write/read result by AMBA DMA Device")
72 gic = Param.Gic(Parent.any, "Gic to use for interrupting")
73 int_num = Param.UInt32("Interrupt number that connects to GIC")
74 amba_id = Param.UInt32("ID of AMBA device for kernel detection")
75
76class A9SCU(BasicPioDevice):
77 type = 'A9SCU'
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")
75 gic = Param.Gic(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"
78
79class RealViewCtrl(BasicPioDevice):
80 type = 'RealViewCtrl'
82
83class RealViewCtrl(BasicPioDevice):
84 type = 'RealViewCtrl'
85 cxx_header = "dev/arm/rv_ctrl.hh"
81 proc_id0 = Param.UInt32(0x0C000000, "Processor ID, SYS_PROCID")
82 proc_id1 = Param.UInt32(0x0C000222, "Processor ID, SYS_PROCID1")
83 idreg = Param.UInt32(0x00000000, "ID Register, SYS_ID")
84
85class Gic(PioDevice):
86 type = 'Gic'
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
90class Gic(PioDevice):
91 type = 'Gic'
92 cxx_header = "dev/arm/gic.hh"
87 platform = Param.Platform(Parent.any, "Platform this device is part of.")
88 dist_addr = Param.Addr(0x1f001000, "Address for distributor")
89 cpu_addr = Param.Addr(0x1f000100, "Address for cpu")
90 dist_pio_delay = Param.Latency('10ns', "Delay for PIO r/w to distributor")
91 cpu_pio_delay = Param.Latency('10ns', "Delay for PIO r/w to cpu interface")
92 int_latency = Param.Latency('10ns', "Delay for interrupt to get to CPU")
93 it_lines = Param.UInt32(128, "Number of interrupt lines supported (max = 1020)")
94
95class AmbaFake(AmbaDevice):
96 type = 'AmbaFake'
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"
97 ignore_access = Param.Bool(False, "Ignore reads/writes to this device, (e.g. IsaFake + AMBA)")
98 amba_id = 0;
99
100class Pl011(Uart):
101 type = 'Pl011'
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"
102 gic = Param.Gic(Parent.any, "Gic to use for interrupting")
103 int_num = Param.UInt32("Interrupt number that connects to GIC")
104 end_on_eot = Param.Bool(False, "End the simulation when a EOT is received on the UART")
105 int_delay = Param.Latency("100ns", "Time between action and interrupt generation by UART")
106
107class Sp804(AmbaDevice):
108 type = 'Sp804'
110 gic = Param.Gic(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"
109 gic = Param.Gic(Parent.any, "Gic to use for interrupting")
110 int_num0 = Param.UInt32("Interrupt number that connects to GIC")
111 clock0 = Param.Clock('1MHz', "Clock speed of the input")
112 int_num1 = Param.UInt32("Interrupt number that connects to GIC")
113 clock1 = Param.Clock('1MHz', "Clock speed of the input")
114 amba_id = 0x00141804
115
116class CpuLocalTimer(BasicPioDevice):
117 type = 'CpuLocalTimer'
118 gic = Param.Gic(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"
118 gic = Param.Gic(Parent.any, "Gic to use for interrupting")
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'
128 gic = Param.Gic(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"
126 time = Param.Time('01/01/2009', "System time to use ('Now' for actual time)")
127 amba_id = 0x00341031
128
129class Pl050(AmbaIntDevice):
130 type = 'Pl050'
137 time = Param.Time('01/01/2009', "System time to use ('Now' for actual time)")
138 amba_id = 0x00341031
139
140class Pl050(AmbaIntDevice):
141 type = 'Pl050'
142 cxx_header = "dev/arm/kmi.hh"
131 vnc = Param.VncInput(Parent.any, "Vnc server for remote frame buffer display")
132 is_mouse = Param.Bool(False, "Is this interface a mouse, if not a keyboard")
133 int_delay = '1us'
134 amba_id = 0x00141050
135
136class Pl111(AmbaDmaDevice):
137 type = 'Pl111'
143 vnc = Param.VncInput(Parent.any, "Vnc server for remote frame buffer display")
144 is_mouse = Param.Bool(False, "Is this interface a mouse, if not a keyboard")
145 int_delay = '1us'
146 amba_id = 0x00141050
147
148class Pl111(AmbaDmaDevice):
149 type = 'Pl111'
150 cxx_header = "dev/arm/pl111.hh"
138 # Override the default clock
139 clock = '24MHz'
140 vnc = Param.VncInput(Parent.any, "Vnc server for remote frame buffer display")
141 amba_id = 0x00141111
142
143class RealView(Platform):
144 type = 'RealView'
151 # Override the default clock
152 clock = '24MHz'
153 vnc = Param.VncInput(Parent.any, "Vnc server for remote frame buffer display")
154 amba_id = 0x00141111
155
156class RealView(Platform):
157 type = 'RealView'
158 cxx_header = "dev/arm/realview.hh"
145 system = Param.System(Parent.any, "system")
146 pci_cfg_base = Param.Addr(0, "Base address of PCI Configuraiton Space")
147 mem_start_addr = Param.Addr(0, "Start address of main memory")
148 max_mem_size = Param.Addr('256MB', "Maximum amount of RAM supported by platform")
149
150 def setupBootLoader(self, mem_bus, cur_sys, loc):
151 self.nvmem = SimpleMemory(range = AddrRange(Addr('2GB'),
152 size = '64MB'),

--- 268 unchanged lines hidden ---
159 system = Param.System(Parent.any, "system")
160 pci_cfg_base = Param.Addr(0, "Base address of PCI Configuraiton Space")
161 mem_start_addr = Param.Addr(0, "Start address of main memory")
162 max_mem_size = Param.Addr('256MB', "Maximum amount of RAM supported by platform")
163
164 def setupBootLoader(self, mem_bus, cur_sys, loc):
165 self.nvmem = SimpleMemory(range = AddrRange(Addr('2GB'),
166 size = '64MB'),

--- 268 unchanged lines hidden ---