type = 'RealView'
cxx_header = "dev/arm/realview.hh"
system = Param.System(Parent.any, "system")
+ pci_io_base = Param.Addr(0, "Base address of PCI IO Space")
pci_cfg_base = Param.Addr(0, "Base address of PCI Configuraiton Space")
+ pci_cfg_gen_offsets = Param.Bool(False, "Should the offsets used for PCI cfg access"
+ " be compatible with the pci-generic-host or the legacy host bridge?")
mem_start_addr = Param.Addr(0, "Start address of main memory")
max_mem_size = Param.Addr('256MB', "Maximum amount of RAM supported by platform")
self.mmc_fake.clk_domain = clkdomain
class VExpress_EMM64(VExpress_EMM):
+ pci_io_base = 0x2f000000
+ pci_cfg_gen_offsets = True
def setupBootLoader(self, mem_bus, cur_sys, loc):
self.nvmem = SimpleMemory(range = AddrRange(0, size = '64MB'))
self.nvmem.port = mem_bus.master
/*
- * Copyright (c) 2009 ARM Limited
+ * Copyright (c) 2009, 2014 ARM Limited
* All rights reserved
*
* The license below extends only to copyright in the software and shall
: Platform(p), system(p->system)
{}
+void
+RealView::initState()
+{
+ Addr junk;
+ bool has_gen_pci_host;
+ has_gen_pci_host = system->kernelSymtab->findAddress("gen_pci_setup", junk);
+
+ if (has_gen_pci_host && !params()->pci_cfg_gen_offsets)
+ warn("Kernel supports generic PCI host but PCI Config offsets "
+ "configured for legacy. Set pci_cfg_gen_offsets to True");
+ if (has_gen_pci_host && !params()->pci_io_base)
+ warn("Kernel supports generic PCI host but PCI IO base is set "
+ "to 0. Set pci_io_base to the start of PCI IO space");
+}
+
void
RealView::postConsoleInt()
{
{
if (bus != 0)
return ULL(-1);
- return params()->pci_cfg_base | ((func & 7) << 16) | ((dev & 0x1f) << 19);
+
+ Addr cfg_offset = 0;
+ if (params()->pci_cfg_gen_offsets)
+ cfg_offset |= ((func & 7) << 12) | ((dev & 0x1f) << 15);
+ else
+ cfg_offset |= ((func & 7) << 16) | ((dev & 0x1f) << 19);
+ return params()->pci_cfg_base | cfg_offset;
}
Addr
RealView::calcPciIOAddr(Addr addr)
{
- return addr;
+ return params()->pci_io_base + addr;
}
Addr
*/
RealView(const Params *p);
+ /** In init do some checks to help verify we're setup correctly */
+ virtual void initState();
+
/** Give platform a pointer to interrupt controller */
void setGic(BaseGic *_gic) { gic = _gic; }