RealView.py (10358:644b615fbe6a) | RealView.py (10397:3064e1beeb49) |
---|---|
1# Copyright (c) 2009-2014 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 --- 37 unchanged lines hidden (view full) --- 46from Pci import PciConfigAll 47from Ethernet import NSGigE, IGbE_igb, IGbE_e1000 48from Ide import * 49from Platform import Platform 50from Terminal import Terminal 51from Uart import Uart 52from SimpleMemory import SimpleMemory 53from Gic import * | 1# Copyright (c) 2009-2014 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 --- 37 unchanged lines hidden (view full) --- 46from Pci import PciConfigAll 47from Ethernet import NSGigE, IGbE_igb, IGbE_e1000 48from Ide import * 49from Platform import Platform 50from Terminal import Terminal 51from Uart import Uart 52from SimpleMemory import SimpleMemory 53from Gic import * |
54from EnergyCtrl import EnergyCtrl |
|
54 55class AmbaPioDevice(BasicPioDevice): 56 type = 'AmbaPioDevice' 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(AmbaPioDevice): --- 180 unchanged lines hidden (view full) --- 242 gpio0_fake = AmbaFake(pio_addr=0x10013000) 243 gpio1_fake = AmbaFake(pio_addr=0x10014000) 244 gpio2_fake = AmbaFake(pio_addr=0x10015000) 245 ssp_fake = AmbaFake(pio_addr=0x1000d000) 246 sci_fake = AmbaFake(pio_addr=0x1000e000) 247 aaci_fake = AmbaFake(pio_addr=0x10004000) 248 mmc_fake = AmbaFake(pio_addr=0x10005000) 249 rtc = PL031(pio_addr=0x10017000, int_num=42) | 55 56class AmbaPioDevice(BasicPioDevice): 57 type = 'AmbaPioDevice' 58 abstract = True 59 cxx_header = "dev/arm/amba_device.hh" 60 amba_id = Param.UInt32("ID of AMBA device for kernel detection") 61 62class AmbaIntDevice(AmbaPioDevice): --- 180 unchanged lines hidden (view full) --- 243 gpio0_fake = AmbaFake(pio_addr=0x10013000) 244 gpio1_fake = AmbaFake(pio_addr=0x10014000) 245 gpio2_fake = AmbaFake(pio_addr=0x10015000) 246 ssp_fake = AmbaFake(pio_addr=0x1000d000) 247 sci_fake = AmbaFake(pio_addr=0x1000e000) 248 aaci_fake = AmbaFake(pio_addr=0x10004000) 249 mmc_fake = AmbaFake(pio_addr=0x10005000) 250 rtc = PL031(pio_addr=0x10017000, int_num=42) |
251 energy_ctrl = EnergyCtrl(pio_addr=0x1000f000) |
|
250 251 252 # Attach I/O devices that are on chip and also set the appropriate 253 # ranges for the bridge 254 def attachOnChipIO(self, bus, bridge): 255 self.gic.pio = bus.master 256 self.l2x0_fake.pio = bus.master 257 self.a9scu.pio = bus.master --- 40 unchanged lines hidden (view full) --- 298 self.gpio1_fake.pio = bus.master 299 self.gpio2_fake.pio = bus.master 300 self.ssp_fake.pio = bus.master 301 self.sci_fake.pio = bus.master 302 self.aaci_fake.pio = bus.master 303 self.mmc_fake.pio = bus.master 304 self.rtc.pio = bus.master 305 self.flash_fake.pio = bus.master | 252 253 254 # Attach I/O devices that are on chip and also set the appropriate 255 # ranges for the bridge 256 def attachOnChipIO(self, bus, bridge): 257 self.gic.pio = bus.master 258 self.l2x0_fake.pio = bus.master 259 self.a9scu.pio = bus.master --- 40 unchanged lines hidden (view full) --- 300 self.gpio1_fake.pio = bus.master 301 self.gpio2_fake.pio = bus.master 302 self.ssp_fake.pio = bus.master 303 self.sci_fake.pio = bus.master 304 self.aaci_fake.pio = bus.master 305 self.mmc_fake.pio = bus.master 306 self.rtc.pio = bus.master 307 self.flash_fake.pio = bus.master |
308 self.energy_ctrl.pio = bus.master |
|
306 307 # Set the clock domain for IO objects that are considered 308 # to be "far" away from the cores. 309 def offChipIOClkDomain(self, clkdomain): 310 self.uart.clk_domain = clkdomain 311 self.realview_io.clk_domain = clkdomain 312 self.timer0.clk_domain = clkdomain 313 self.timer1.clk_domain = clkdomain --- 12 unchanged lines hidden (view full) --- 326 self.gpio1_fake.clk_domain = clkdomain 327 self.gpio2_fake.clk_domain = clkdomain 328 self.ssp_fake.clk_domain = clkdomain 329 self.sci_fake.clk_domain = clkdomain 330 self.aaci_fake.clk_domain = clkdomain 331 self.mmc_fake.clk_domain = clkdomain 332 self.rtc.clk_domain = clkdomain 333 self.flash_fake.clk_domain = clkdomain | 309 310 # Set the clock domain for IO objects that are considered 311 # to be "far" away from the cores. 312 def offChipIOClkDomain(self, clkdomain): 313 self.uart.clk_domain = clkdomain 314 self.realview_io.clk_domain = clkdomain 315 self.timer0.clk_domain = clkdomain 316 self.timer1.clk_domain = clkdomain --- 12 unchanged lines hidden (view full) --- 329 self.gpio1_fake.clk_domain = clkdomain 330 self.gpio2_fake.clk_domain = clkdomain 331 self.ssp_fake.clk_domain = clkdomain 332 self.sci_fake.clk_domain = clkdomain 333 self.aaci_fake.clk_domain = clkdomain 334 self.mmc_fake.clk_domain = clkdomain 335 self.rtc.clk_domain = clkdomain 336 self.flash_fake.clk_domain = clkdomain |
337 self.energy_ctrl.clk_domain = clkdomain |
|
334 335# Reference for memory map and interrupt number 336# RealView Emulation Baseboard User Guide (ARM DUI 0143B) 337# Chapter 4: Programmer's Reference 338class RealViewEB(RealView): 339 uart = Pl011(pio_addr=0x10009000, int_num=44) 340 realview_io = RealViewCtrl(pio_addr=0x10000000, idreg=0x01400500) 341 gic = Pl390(dist_addr=0x10041000, cpu_addr=0x10040000) --- 17 unchanged lines hidden (view full) --- 359 gpio0_fake = AmbaFake(pio_addr=0x10013000) 360 gpio1_fake = AmbaFake(pio_addr=0x10014000) 361 gpio2_fake = AmbaFake(pio_addr=0x10015000) 362 ssp_fake = AmbaFake(pio_addr=0x1000d000) 363 sci_fake = AmbaFake(pio_addr=0x1000e000) 364 aaci_fake = AmbaFake(pio_addr=0x10004000) 365 mmc_fake = AmbaFake(pio_addr=0x10005000) 366 rtc_fake = AmbaFake(pio_addr=0x10017000, amba_id=0x41031) | 338 339# Reference for memory map and interrupt number 340# RealView Emulation Baseboard User Guide (ARM DUI 0143B) 341# Chapter 4: Programmer's Reference 342class RealViewEB(RealView): 343 uart = Pl011(pio_addr=0x10009000, int_num=44) 344 realview_io = RealViewCtrl(pio_addr=0x10000000, idreg=0x01400500) 345 gic = Pl390(dist_addr=0x10041000, cpu_addr=0x10040000) --- 17 unchanged lines hidden (view full) --- 363 gpio0_fake = AmbaFake(pio_addr=0x10013000) 364 gpio1_fake = AmbaFake(pio_addr=0x10014000) 365 gpio2_fake = AmbaFake(pio_addr=0x10015000) 366 ssp_fake = AmbaFake(pio_addr=0x1000d000) 367 sci_fake = AmbaFake(pio_addr=0x1000e000) 368 aaci_fake = AmbaFake(pio_addr=0x10004000) 369 mmc_fake = AmbaFake(pio_addr=0x10005000) 370 rtc_fake = AmbaFake(pio_addr=0x10017000, amba_id=0x41031) |
371 energy_ctrl = EnergyCtrl(pio_addr=0x1000f000) |
|
367 | 372 |
368 369 | |
370 # Attach I/O devices that are on chip and also set the appropriate 371 # ranges for the bridge 372 def attachOnChipIO(self, bus, bridge): 373 self.gic.pio = bus.master 374 self.l2x0_fake.pio = bus.master 375 # Bridge ranges based on excluding what is part of on-chip I/O 376 # (gic, l2x0) 377 bridge.ranges = [AddrRange(self.realview_io.pio_addr, --- 30 unchanged lines hidden (view full) --- 408 self.gpio2_fake.pio = bus.master 409 self.ssp_fake.pio = bus.master 410 self.sci_fake.pio = bus.master 411 self.aaci_fake.pio = bus.master 412 self.mmc_fake.pio = bus.master 413 self.rtc_fake.pio = bus.master 414 self.flash_fake.pio = bus.master 415 self.smcreg_fake.pio = bus.master | 373 # Attach I/O devices that are on chip and also set the appropriate 374 # ranges for the bridge 375 def attachOnChipIO(self, bus, bridge): 376 self.gic.pio = bus.master 377 self.l2x0_fake.pio = bus.master 378 # Bridge ranges based on excluding what is part of on-chip I/O 379 # (gic, l2x0) 380 bridge.ranges = [AddrRange(self.realview_io.pio_addr, --- 30 unchanged lines hidden (view full) --- 411 self.gpio2_fake.pio = bus.master 412 self.ssp_fake.pio = bus.master 413 self.sci_fake.pio = bus.master 414 self.aaci_fake.pio = bus.master 415 self.mmc_fake.pio = bus.master 416 self.rtc_fake.pio = bus.master 417 self.flash_fake.pio = bus.master 418 self.smcreg_fake.pio = bus.master |
419 self.energy_ctrl.pio = bus.master |
|
416 417 # Set the clock domain for IO objects that are considered 418 # to be "far" away from the cores. 419 def offChipIOClkDomain(self, clkdomain): 420 self.uart.clk_domain = clkdomain 421 self.realview_io.clk_domain = clkdomain 422 self.timer0.clk_domain = clkdomain 423 self.timer1.clk_domain = clkdomain --- 12 unchanged lines hidden (view full) --- 436 self.gpio2_fake.clk_domain = clkdomain 437 self.ssp_fake.clk_domain = clkdomain 438 self.sci_fake.clk_domain = clkdomain 439 self.aaci_fake.clk_domain = clkdomain 440 self.mmc_fake.clk_domain = clkdomain 441 self.rtc.clk_domain = clkdomain 442 self.flash_fake.clk_domain = clkdomain 443 self.smcreg_fake.clk_domain = clkdomain | 420 421 # Set the clock domain for IO objects that are considered 422 # to be "far" away from the cores. 423 def offChipIOClkDomain(self, clkdomain): 424 self.uart.clk_domain = clkdomain 425 self.realview_io.clk_domain = clkdomain 426 self.timer0.clk_domain = clkdomain 427 self.timer1.clk_domain = clkdomain --- 12 unchanged lines hidden (view full) --- 440 self.gpio2_fake.clk_domain = clkdomain 441 self.ssp_fake.clk_domain = clkdomain 442 self.sci_fake.clk_domain = clkdomain 443 self.aaci_fake.clk_domain = clkdomain 444 self.mmc_fake.clk_domain = clkdomain 445 self.rtc.clk_domain = clkdomain 446 self.flash_fake.clk_domain = clkdomain 447 self.smcreg_fake.clk_domain = clkdomain |
448 self.energy_ctrl.clk_domain = clkdomain |
|
444 445class VExpress_EMM(RealView): 446 _mem_regions = [(Addr('2GB'), Addr('2GB'))] 447 pci_cfg_base = 0x30000000 448 uart = Pl011(pio_addr=0x1c090000, int_num=37) 449 realview_io = RealViewCtrl(proc_id0=0x14000000, proc_id1=0x14000000, \ 450 idreg=0x02250000, pio_addr=0x1C010000) 451 gic = Pl390(dist_addr=0x2C001000, cpu_addr=0x2C002000) --- 22 unchanged lines hidden (view full) --- 474 uart2_fake = AmbaFake(pio_addr=0x1C0B0000) 475 uart3_fake = AmbaFake(pio_addr=0x1C0C0000) 476 sp810_fake = AmbaFake(pio_addr=0x1C020000, ignore_access=True) 477 watchdog_fake = AmbaFake(pio_addr=0x1C0F0000) 478 aaci_fake = AmbaFake(pio_addr=0x1C040000) 479 lan_fake = IsaFake(pio_addr=0x1A000000, pio_size=0xffff) 480 usb_fake = IsaFake(pio_addr=0x1B000000, pio_size=0x1ffff) 481 mmc_fake = AmbaFake(pio_addr=0x1c050000) | 449 450class VExpress_EMM(RealView): 451 _mem_regions = [(Addr('2GB'), Addr('2GB'))] 452 pci_cfg_base = 0x30000000 453 uart = Pl011(pio_addr=0x1c090000, int_num=37) 454 realview_io = RealViewCtrl(proc_id0=0x14000000, proc_id1=0x14000000, \ 455 idreg=0x02250000, pio_addr=0x1C010000) 456 gic = Pl390(dist_addr=0x2C001000, cpu_addr=0x2C002000) --- 22 unchanged lines hidden (view full) --- 479 uart2_fake = AmbaFake(pio_addr=0x1C0B0000) 480 uart3_fake = AmbaFake(pio_addr=0x1C0C0000) 481 sp810_fake = AmbaFake(pio_addr=0x1C020000, ignore_access=True) 482 watchdog_fake = AmbaFake(pio_addr=0x1C0F0000) 483 aaci_fake = AmbaFake(pio_addr=0x1C040000) 484 lan_fake = IsaFake(pio_addr=0x1A000000, pio_size=0xffff) 485 usb_fake = IsaFake(pio_addr=0x1B000000, pio_size=0x1ffff) 486 mmc_fake = AmbaFake(pio_addr=0x1c050000) |
487 energy_ctrl = EnergyCtrl(pio_addr=0x1c080000) |
|
482 483 # Attach any PCI devices that are supported 484 def attachPciDevices(self): 485 self.ethernet = IGbE_e1000(pci_bus=0, pci_dev=0, pci_func=0, 486 InterruptLine=1, InterruptPin=1) 487 self.ide = IdeController(disks = [], pci_bus=0, pci_dev=1, pci_func=0, 488 InterruptLine=2, InterruptPin=2) 489 --- 64 unchanged lines hidden (view full) --- 554 self.uart2_fake.pio = bus.master 555 self.uart3_fake.pio = bus.master 556 self.sp810_fake.pio = bus.master 557 self.watchdog_fake.pio = bus.master 558 self.aaci_fake.pio = bus.master 559 self.lan_fake.pio = bus.master 560 self.usb_fake.pio = bus.master 561 self.mmc_fake.pio = bus.master | 488 489 # Attach any PCI devices that are supported 490 def attachPciDevices(self): 491 self.ethernet = IGbE_e1000(pci_bus=0, pci_dev=0, pci_func=0, 492 InterruptLine=1, InterruptPin=1) 493 self.ide = IdeController(disks = [], pci_bus=0, pci_dev=1, pci_func=0, 494 InterruptLine=2, InterruptPin=2) 495 --- 64 unchanged lines hidden (view full) --- 560 self.uart2_fake.pio = bus.master 561 self.uart3_fake.pio = bus.master 562 self.sp810_fake.pio = bus.master 563 self.watchdog_fake.pio = bus.master 564 self.aaci_fake.pio = bus.master 565 self.lan_fake.pio = bus.master 566 self.usb_fake.pio = bus.master 567 self.mmc_fake.pio = bus.master |
568 self.energy_ctrl.pio = bus.master |
|
562 563 # Try to attach the I/O if it exists 564 try: 565 self.ide.pio = bus.master 566 self.ide.config = bus.master 567 self.ide.dma = bus.slave 568 self.ethernet.pio = bus.master 569 self.ethernet.config = bus.master --- 21 unchanged lines hidden (view full) --- 591 self.uart2_fake.clk_domain = clkdomain 592 self.uart3_fake.clk_domain = clkdomain 593 self.sp810_fake.clk_domain = clkdomain 594 self.watchdog_fake.clk_domain = clkdomain 595 self.aaci_fake.clk_domain = clkdomain 596 self.lan_fake.clk_domain = clkdomain 597 self.usb_fake.clk_domain = clkdomain 598 self.mmc_fake.clk_domain = clkdomain | 569 570 # Try to attach the I/O if it exists 571 try: 572 self.ide.pio = bus.master 573 self.ide.config = bus.master 574 self.ide.dma = bus.slave 575 self.ethernet.pio = bus.master 576 self.ethernet.config = bus.master --- 21 unchanged lines hidden (view full) --- 598 self.uart2_fake.clk_domain = clkdomain 599 self.uart3_fake.clk_domain = clkdomain 600 self.sp810_fake.clk_domain = clkdomain 601 self.watchdog_fake.clk_domain = clkdomain 602 self.aaci_fake.clk_domain = clkdomain 603 self.lan_fake.clk_domain = clkdomain 604 self.usb_fake.clk_domain = clkdomain 605 self.mmc_fake.clk_domain = clkdomain |
606 self.energy_ctrl.clk_domain = clkdomain |
|
599 600class VExpress_EMM64(VExpress_EMM): 601 pci_io_base = 0x2f000000 602 pci_cfg_gen_offsets = True 603 # Three memory regions are specified totalling 512GB 604 _mem_regions = [(Addr('2GB'), Addr('2GB')), (Addr('34GB'), Addr('30GB')), 605 (Addr('512GB'), Addr('480GB'))] 606 def setupBootLoader(self, mem_bus, cur_sys, loc): 607 self.nvmem = SimpleMemory(range = AddrRange(0, size = '64MB')) 608 self.nvmem.port = mem_bus.master 609 cur_sys.boot_loader = loc('boot_emm.arm64') 610 cur_sys.atags_addr = 0x8000000 611 cur_sys.load_addr_mask = 0xfffffff 612 cur_sys.load_offset = 0x80000000 613 614 | 607 608class VExpress_EMM64(VExpress_EMM): 609 pci_io_base = 0x2f000000 610 pci_cfg_gen_offsets = True 611 # Three memory regions are specified totalling 512GB 612 _mem_regions = [(Addr('2GB'), Addr('2GB')), (Addr('34GB'), Addr('30GB')), 613 (Addr('512GB'), Addr('480GB'))] 614 def setupBootLoader(self, mem_bus, cur_sys, loc): 615 self.nvmem = SimpleMemory(range = AddrRange(0, size = '64MB')) 616 self.nvmem.port = mem_bus.master 617 cur_sys.boot_loader = loc('boot_emm.arm64') 618 cur_sys.atags_addr = 0x8000000 619 cur_sys.load_addr_mask = 0xfffffff 620 cur_sys.load_offset = 0x80000000 621 622 |