1# Copyright (c) 2009-2017 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 --- 331 unchanged lines hidden (view full) --- 340 pass 341 342 def onChipIOClkDomain(self, clkdomain): 343 self._attach_clk(self._on_chip_devices(), clkdomain) 344 345 def offChipIOClkDomain(self, clkdomain): 346 self._attach_clk(self._off_chip_devices(), clkdomain) 347 |
348 def attachOnChipIO(self, bus, bridge=None, *args, **kwargs): 349 self._attach_io(self._on_chip_devices(), bus, *args, **kwargs) |
350 if bridge: 351 bridge.ranges = self._off_chip_ranges 352 353 def attachIO(self, *args, **kwargs): 354 self._attach_io(self._off_chip_devices(), *args, **kwargs) 355 |
356 def setupBootLoader(self, mem_bus, cur_sys, loc): 357 self.nvmem = SimpleMemory(range = AddrRange('2GB', size = '64MB'), 358 conf_table_reported = False) 359 self.nvmem.port = mem_bus.master 360 cur_sys.boot_loader = loc('boot.arm') 361 cur_sys.atags_addr = 0x100 362 cur_sys.load_addr_mask = 0xfffffff 363 cur_sys.load_offset = 0 --- 242 unchanged lines hidden (view full) --- 606 self.mmc_fake.clk_domain = clkdomain 607 self.rtc.clk_domain = clkdomain 608 self.flash_fake.clk_domain = clkdomain 609 self.smcreg_fake.clk_domain = clkdomain 610 self.energy_ctrl.clk_domain = clkdomain 611 612class VExpress_EMM(RealView): 613 _mem_regions = [(Addr('2GB'), Addr('2GB'))] |
614 615 # Ranges based on excluding what is part of on-chip I/O (gic, 616 # a9scu) 617 _off_chip_ranges = [AddrRange(0x2F000000, size='16MB'), 618 AddrRange(0x30000000, size='256MB'), 619 AddrRange(0x40000000, size='512MB'), 620 AddrRange(0x18000000, size='64MB'), 621 AddrRange(0x1C000000, size='64MB')] 622 623 # Platform control device (off-chip) 624 realview_io = RealViewCtrl(proc_id0=0x14000000, proc_id1=0x14000000, 625 idreg=0x02250000, pio_addr=0x1C010000) 626 |
627 mcc = VExpressMCC() 628 dcc = CoreTile2A15DCC() |
629 630 ### On-chip devices ### |
631 gic = Pl390(dist_addr=0x2C001000, cpu_addr=0x2C002000) |
632 vgic = VGic(vcpu_addr=0x2c006000, hv_addr=0x2c004000, ppint=25) 633 634 local_cpu_timer = CpuLocalTimer(int_num_timer=29, int_num_watchdog=30, 635 pio_addr=0x2C080000) 636 637 hdlcd = HDLcd(pxl_clk=dcc.osc_pxl, 638 pio_addr=0x2b000000, int_num=117, 639 workaround_swap_rb=True) 640 641 def _on_chip_devices(self): 642 devices = [ 643 self.gic, self.vgic, 644 self.local_cpu_timer 645 ] 646 if hasattr(self, "gicv2m"): 647 devices.append(self.gicv2m) 648 devices.append(self.hdlcd) 649 return devices 650 651 ### Off-chip devices ### 652 uart = Pl011(pio_addr=0x1c090000, int_num=37) |
653 pci_host = GenericPciHost( 654 conf_base=0x30000000, conf_size='256MB', conf_device_bits=16, 655 pci_pio_base=0) |
656 |
657 generic_timer = GenericTimer(int_phys=29, int_virt=27) 658 timer0 = Sp804(int_num0=34, int_num1=34, pio_addr=0x1C110000, clock0='1MHz', clock1='1MHz') 659 timer1 = Sp804(int_num0=35, int_num1=35, pio_addr=0x1C120000, clock0='1MHz', clock1='1MHz') 660 clcd = Pl111(pio_addr=0x1c1f0000, int_num=46) |
661 kmi0 = Pl050(pio_addr=0x1c060000, int_num=44) 662 kmi1 = Pl050(pio_addr=0x1c070000, int_num=45, is_mouse=True) |
663 cf_ctrl = IdeController(disks=[], pci_func=0, pci_dev=0, pci_bus=2, 664 io_shift = 2, ctrl_offset = 2, Command = 0x1, 665 BAR0 = 0x1C1A0000, BAR0Size = '256B', 666 BAR1 = 0x1C1A0100, BAR1Size = '4096B', 667 BAR0LegacyIO = True, BAR1LegacyIO = True) 668 669 vram = SimpleMemory(range = AddrRange(0x18000000, size='32MB'), 670 conf_table_reported = False) --- 6 unchanged lines hidden (view full) --- 677 sp810_fake = AmbaFake(pio_addr=0x1C020000, ignore_access=True) 678 watchdog_fake = AmbaFake(pio_addr=0x1C0F0000) 679 aaci_fake = AmbaFake(pio_addr=0x1C040000) 680 lan_fake = IsaFake(pio_addr=0x1A000000, pio_size=0xffff) 681 usb_fake = IsaFake(pio_addr=0x1B000000, pio_size=0x1ffff) 682 mmc_fake = AmbaFake(pio_addr=0x1c050000) 683 energy_ctrl = EnergyCtrl(pio_addr=0x1c080000) 684 |
685 def _off_chip_devices(self): 686 devices = [ 687 self.uart, 688 self.realview_io, 689 self.pci_host, 690 self.timer0, 691 self.timer1, 692 self.clcd, 693 self.kmi0, 694 self.kmi1, 695 self.cf_ctrl, 696 self.rtc, 697 self.vram, 698 self.l2x0_fake, 699 self.uart1_fake, 700 self.uart2_fake, 701 self.uart3_fake, 702 self.sp810_fake, 703 self.watchdog_fake, 704 self.aaci_fake, 705 self.lan_fake, 706 self.usb_fake, 707 self.mmc_fake, 708 self.energy_ctrl, 709 ] 710 # Try to attach the I/O if it exists 711 if hasattr(self, "ide"): 712 devices.append(self.ide) 713 if hasattr(self, "ethernet"): 714 devices.append(self.ethernet) 715 return devices 716 |
717 # Attach any PCI devices that are supported 718 def attachPciDevices(self): 719 self.ethernet = IGbE_e1000(pci_bus=0, pci_dev=0, pci_func=0, 720 InterruptLine=1, InterruptPin=1) 721 self.ide = IdeController(disks = [], pci_bus=0, pci_dev=1, pci_func=0, 722 InterruptLine=2, InterruptPin=2) 723 724 def enableMSIX(self): --- 5 unchanged lines hidden (view full) --- 730 self.nvmem = SimpleMemory(range = AddrRange('64MB'), 731 conf_table_reported = False) 732 self.nvmem.port = mem_bus.master 733 cur_sys.boot_loader = loc('boot_emm.arm') 734 cur_sys.atags_addr = 0x8000000 735 cur_sys.load_addr_mask = 0xfffffff 736 cur_sys.load_offset = 0x80000000 737 |
738class VExpress_EMM64(VExpress_EMM): 739 # Three memory regions are specified totalling 512GB 740 _mem_regions = [(Addr('2GB'), Addr('2GB')), (Addr('34GB'), Addr('30GB')), 741 (Addr('512GB'), Addr('480GB'))] 742 pci_host = GenericPciHost( 743 conf_base=0x30000000, conf_size='256MB', conf_device_bits=12, 744 pci_pio_base=0x2f000000) 745 --- 186 unchanged lines hidden --- |