AgeCommit message (Collapse)Author
2016-06-07Merge branch 'leg-configs' into leg-kernelHEADleg-20160607.0leg-kernelGraeme Gregory
2016-06-07Merge branch 'topic-pci' into leg-kernelGraeme Gregory
2016-06-07irqchip, GICv3, ITS: fixup for node handling changeGraeme Gregory
Signed-off-by: Graeme Gregory <graeme.gregory@linaro.org>
2016-06-07Merge branch 'topic-its' into leg-kernelGraeme Gregory
2016-06-07Merge branch 'topic-numa' into leg-kernelGraeme Gregory
2016-06-07Merge branch 'topic-gtdt-wakeup-timer' into leg-kernelGraeme Gregory
2016-06-07Merge branch 'topic-fvp' into leg-kernelGraeme Gregory
2016-06-07Merge branch 'topic-apei' into leg-kernelGraeme Gregory
2016-06-07vexpress64 : Remove colliding NR_CPUSleg-configs-20160607.0leg-configsGraeme Gregory
2016-06-07configs: add configs for CI jobGraeme Gregory
Signed-off-by: Graeme Gregory <graeme.gregory@linaro.org>
2016-06-07pci, pci-thunder-pem: Add ACPI support for ThunderX PEM.Tomasz Nowicki
This patch uses DECLARE_ACPI_MCFG_FIXUP to overwrite PCI config accessors. Also, it provides alternative way to find additional configuration region: thunder_pem_get_acpi_res is looking for host bridge's child (_HID "THRX0001") which contains mentioned configuration region description. See example below: Device (PEM0) { Name (_HID, EISAID ("PNP0A08")) Name (_CID, EISAID ("PNP0A03")) [...] Device (CFG0) { Name (_HID, "THRX0001") // PEM configuration space resources Name (_CRS, ResourceTemplate () { QWordMemory(ResourceConsumer, PosDecode, MinFixed, MaxFixed, NonCacheable, ReadWrite, 0, 0x87e0c5000000, 0x87E0C5FFFFFF, 0, 0x01000000) }) } } Signed-off-by: Tomasz Nowicki <tn@semihalf.com>
2016-06-07arm64, pci: Start using quirks handling for ACPI based PCI host controller.Tomasz Nowicki
pci_generic_ecam_ops is used by default. Since there are platforms which have non-compliant ECAM space we need to overwrite these accessors prior to PCI buses enumeration. In order to do that we call pci_mcfg_get_ops to retrieve pci_ecam_ops structure so that we can use proper PCI config space accessors and bus_shift. pci_generic_ecam_ops is still used for platforms free from quirks. Signed-off-by: Tomasz Nowicki <tn@semihalf.com>
2016-06-07pci, acpi: Match PCI config space accessors against platfrom specific ECAM ↵Tomasz Nowicki
quirks. Some platforms may not be fully compliant with generic set of PCI config accessors. For these cases we implement the way to overwrite accessors set. Algorithm traverses available quirk list, matches against <oem_id, oem_rev, domain, bus number> tuple and returns corresponding PCI config ops. oem_id and oem_rev come from MCFG table standard header. All quirks can be defined using DECLARE_ACPI_MCFG_FIXUP() macro and kept self contained. Example: /* Custom PCI config ops */ static struct pci_generic_ecam_ops foo_pci_ops = { .bus_shift = 24, .pci_ops = { .map_bus = pci_ecam_map_bus, .read = foo_ecam_config_read, .write = foo_ecam_config_write, } }; DECLARE_ACPI_MCFG_FIXUP(&foo_pci_ops, <oem_id_str>, <oem_rev>, <domain_nr>, <bus_nr>); Signed-off-by: Tomasz Nowicki <tn@semihalf.com>
2016-06-07pci, acpi: ARM64 support for ACPI based generic PCI host controllerTomasz Nowicki
This patch implements pci_acpi_scan_root call so that ARM64 can start using ACPI to setup and enumerate PCI buses. The implementation of pci_acpi_scan_root() looks up config space regions through MCFG interface. Then ECAM library is doing a new mapping and attach generic ECAM ops which are used for accessing config space. On ARM64, ACPI and DT can be enabled together, and in that case we need to use generic domains. In order to do that we implement ARM64 specific way of retrieving domain number from pci_config_window structure. Since we enable PCI for ACPI we need to implement raw_pci_{read|write} at the same time. ARM64 provides RAW accessors as long as there is correlated valid pci_bus structure, but not before. Signed-off-by: Tomasz Nowicki <tn@semihalf.com> Signed-off-by: Jayachandran C <jchandra@broadcom.com>
2016-06-07arm64, pci, acpi: Provide ACPI-specific prerequisites for PCI bus enumeration.Tomasz Nowicki
ACPI requires to run acpi_pci_{add|remove}_bus while new PCI bus is created. This allows to do some ACPI-specific additional configuration, like PCI hotplug slot enumeration. In order to fulfill these requirements, we implement arch-specific pcibios_{add|remove}_bus calls and call acpi_pci_{add|remove}_bus from there. Signed-off-by: Tomasz Nowicki <tn@semihalf.com>
2016-06-07acpi: Add generic MCFG table handlingTomasz Nowicki
In order to handle PCI config space regions properly in ACPI, new MCFG interface is defined which does sanity checks on MCFG table and keeps its root pointer. The user is able to lookup MCFG regions based on host bridge root structure and domain:bus_start:bus_end touple. Use pci_mmcfg_late_init old prototype to avoid another function name. Signed-off-by: Tomasz Nowicki <tn@semihalf.com> Signed-off-by: Jayachandran C <jchandra@broadcom.com>
2016-06-07arm64, pci, acpi: ACPI support for legacy IRQs parsing and consolidation ↵Tomasz Nowicki
with DT code. To enable PCI legacy IRQs on platforms booting with ACPI, arch code should include ACPI specific callbacks that parse and set-up the device IRQ number, equivalent to the DT boot path. Owing to the current ACPI core scan handlers implementation, ACPI PCI legacy IRQs bindings cannot be parsed at device add time, since that would trigger ACPI scan handlers ordering issues depending on how the ACPI tables are defined. To solve this problem and consolidate FW PCI legacy IRQs parsing in one single pcibios callback (pending final removal), this patch moves DT PCI IRQ parsing to the pcibios_alloc_irq() callback (called by PCI core code at device probe time) and adds ACPI PCI legacy IRQs parsing to the same callback too, so that FW PCI legacy IRQs parsing is confined in one single arch callback that can be easily removed when code parsing PCI legacy IRQs is consolidated and moved to core PCI code. Signed-off-by: Tomasz Nowicki <tn@semihalf.com> Suggested-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
2016-06-07pci, acpi: add acpi hook to assign domain number.Tomasz Nowicki
PCI core code provides a config option (CONFIG_PCI_DOMAINS_GENERIC) that allows assigning the PCI bus domain number generically by relying on device tree bindings, and falling back to a simple counter when the respective DT properties (ie "linux,pci-domain") are not specified in the host bridge device tree node. In a similar way, when a system is booted through ACPI, architectures that are selecting CONFIG_PCI_DOMAINS_GENERIC (ie ARM64) require kernel hooks to retrieve the domain number so that the PCI bus domain number set-up can be handled seamlessly with DT and ACPI in generic core code when CONFIG_PCI_DOMAINS_GENERIC is selected. Since currently it is not possible to retrieve a pointer to the PCI host bridge ACPI device backing the host bridge from core PCI code (which would allow retrieving the domain number in an arch agnostic way through the ACPI _SEG method), an arch specific ACPI hook has to be declared and implemented by all arches that rely on CONFIG_PCI_DOMAINS_GENERIC to retrieve the domain number and set it up in core PCI code. For the aforementioned reasons, this patch introduces a dummy acpi_pci_bus_domain_nr() hook in preparation for per-arch implementation of the same to retrieve the domain number on a per-arch basis when the system boots through ACPI. For the sake of code clarity the current code implementing generic domain number assignment (ie pci_bus_assign_domain_nr(), selected by CONFIG_PCI_DOMAINS_GENERIC) is reshuffled so that the code implementing the DT domain assignment function is stubbed out into a corresponding helper, so that DT and ACPI functions are clearly separated in preparation for arches acpi_pci_bus_domain_nr() implementations. Signed-off-by: Tomasz Nowicki <tn@semihalf.com> Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
2016-06-07acpi, pci: Support IO resources when parsing PCI host bridge resources.Tomasz Nowicki
Platforms that have memory mapped IO port (such as ARM64) need special handling for PCI I/O resources. For host bridge's resource probing case these resources need to be fixed up with pci_register_io_range/pci_remap_iospace etc. The same I/O resources need to be released after hotplug removal so that it can be re-added back by the pci_remap_iospace function during insertion. As a consequence we unmap I/O resources with pci_unmap_iospace when we release host bridge resources. Signed-off-by: Jayachandran C <jchandra@broadcom.com> Signed-off-by: Sinan Kaya <okaya@codeaurora.org> Signed-off-by: Tomasz Nowicki <tn@semihalf.com>
2016-06-07pci: Add new function to unmap IO resources.Tomasz Nowicki
We need to release I/O resources so that the same I/O resources can be allocated again (pci_remap_iospace), like in PCI hotplug removal scenario. Therefore this patch implements new pci_unmap_iospace call which unmaps I/O space as the symmetry to pci_remap_iospace. Signed-off-by: Sinan Kaya <okaya@codeaurora.org> Signed-off-by: Tomasz Nowicki <tn@semihalf.com>
2016-06-07PCI: ecam: Add parent device field to pci_config_windowJayachandran C
Add a parent device field to struct pci_config_window. The parent is not saved now, but will be useful to save it in some cases. Specifically in case of ACPI for ARM64, it can be used to setup ACPI companion and domain. Since the parent dev is in struct pci_config_window now, we need not pass it to he init function as a separate argument. Signed-off-by: Jayachandran C <jchandra@broadcom.com>
2016-06-07PCI: ecam: move ecam.h to linux/include/pci-ecam.hJayachandran C
This header will be used from arch/arm64 for ACPI PCI implementation so it needs to be moved out of drivers/pci. Update users of the header file to use the new name. No functional changes. Signed-off-by: Jayachandran C <jchandra@broadcom.com>
2016-06-07acpi, numa: Enable ACPI based NUMA on ARM64Hanjun Guo
Add function needed for cpu to node mapping, and enable ACPI based NUMA for ARM64 in Kconfig Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org> Signed-off-by: Robert Richter <rrichter@cavium.com> [david.daney@cavium.com added ACPI_NUMA default to y for ARM64] Signed-off-by: David Daney <david.daney@cavium.com> Acked-by: Catalin Marinas <catalin.marinas@arm.com>
2016-06-07arm64, acpi, numa: NUMA support based on SRAT and SLITHanjun Guo
Introduce a new file to hold ACPI based NUMA information parsing from SRAT and SLIT. SRAT includes the CPU ACPI ID to Proximity Domain mappings and memory ranges to Proximity Domain mapping. SLIT has the information of inter node distances(relative number for access latency). Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org> Signed-off-by: Ganapatrao Kulkarni <gkulkarni@caviumnetworks.com> [rrichter@cavium.com Reworked for numa v10 series ] Signed-off-by: Robert Richter <rrichter@cavium.com> [david.daney@cavium.com reorderd and combinded with other patches in Hanjun Guo's original set, removed get_mpidr_in_madt() and use acpi_map_madt_entry() instead.] Signed-off-by: David Daney <david.daney@cavium.com>
2016-06-07ACPI / processor: Add acpi_map_madt_entry().David Daney
Follow-on arm64 ACPI/NUMA patches need to map MADT entries very early (before kmalloc is usable). Add acpi_map_madt_entry() which, indirectly, uses early_memremap()/early_memunmap() to access the table and parse out the mpidr. The existing implementation of map_madt_entry() is modified to take a pointer to the MADT as a parameter and the callers adjusted. Signed-off-by: David Daney <david.daney@cavium.com>
2016-06-07acpi, numa, srat: Improve SRAT error detection and add messages.David Daney
Loosely based on code from Robert Richter and Hanjun Guo. Improve out of range node detection as well as allow for Larger SRAT entities. Add printing of nice messages. Signed-off-by: David Daney <david.daney@cavium.com>
2016-06-07acpi, numa: Move acpi_numa_memory_affinity_init() to drivers/acpi/numa.cHanjun Guo
acpi_numa_memory_affinity_init() will be reused by arm64. Move it to drivers/acpi/numa.c to facilitate reuse. No code change. Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org> Signed-off-by: Robert Richter <rrichter@cavium.com> Signed-off-by: David Daney <david.daney@cavium.com>
2016-06-07acpi, numa: remove unneeded acpi_numa=1Hanjun Guo
acpi_numa is default to 0, it's set to -1 when disable acpi numa or when a bad SRAT is parsed, and it's only consumed in srat_disabled() (compare it with 0) to continue parse the SRAT or not, so we don't need to set acpi_numa to 1 when we get a valid SRAT entry. Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org> Signed-off-by: Robert Richter <rrichter@cavium.com> Signed-off-by: David Daney <david.daney@cavium.com>
2016-06-07acpi, numa: move bad_srat() and srat_disabled() to drivers/acpi/numa.cDavid Daney
bad_srat() and srat_disabled() are shared by x86 and follow-on arm64 patches. Move them to drivers/acpi/numa.c in preparation for arm64 support. Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org> Signed-off-by: Robert Richter <rrichter@cavium.com> [david.daney@cavium.com moved definitions to drivers/acpi/numa.c] Signed-off-by: David Daney <david.daney@cavium.com>
2016-06-07x86, acpi, numa: cleanup acpi_numa_processor_affinity_init()Hanjun Guo
Cleanup acpi_numa_processor_affinity_init() in preparation for its move to drivers/acpi/numa.c. It will be reused by arm64, this has no functional change. Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org> Signed-off-by: Robert Richter <rrichter@cavium.com> Signed-off-by: David Daney <david.daney@cavium.com>
2016-06-07arm64, numa: Cleanup NUMA disabled messages.David Daney
As noted by Dennis Chen, we don't want to print "No NUMA configuration found" if NUMA was forced off from the command line. Change the type of numa_off to bool, and clean up printing code. Print "NUMA disabled" if forced off on command line and "No NUMA configuration found" if there was no firmware NUMA information. Signed-off-by: David Daney <david.daney@cavium.com> Acked-by: Catalin Marinas <catalin.marinas@arm.com>
2016-06-07arm64, numa: rework numa_add_memblk()Hanjun Guo
Rework numa_add_memblk() to update the parameter "u64 size" to "u64 end", this will make it consistent with x86 and simplifies the arm64 ACPI NUMA code to be added later. Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org> Signed-off-by: Robert Richter <rrichter@cavium.com> Signed-off-by: David Daney <david.daney@cavium.com> Acked-by: Catalin Marinas <catalin.marinas@arm.com>
2016-06-07acpi, numa: move acpi_numa_slit_init() to drivers/acpi/numa.cHanjun Guo
Identical implementations of acpi_numa_slit_init() are used by both x86 and follow-on arm64 support. Move it to drivers/acpi/numa.c, and guard with CONFIG_X86 || CONFIG_ARM64 because ia64 has its own architecture specific implementation. No code change. Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org> Signed-off-by: Robert Richter <rrichter@cavium.com> Signed-off-by: David Daney <david.daney@cavium.com>
2016-06-07acpi, numa: Move acpi_numa_arch_fixup() to ia64 onlyRobert Richter
Since acpi_numa_arch_fixup() is only used in arch ia64, move it there to make a generic interface easier. This avoids empty function stubs or some complex kconfig options for x86 and arm64. Signed-off-by: Robert Richter <rrichter@cavium.com> Reviewed-by: Hanjun Guo <hanjun.guo@linaro.org> Signed-off-by: David Daney <david.daney@cavium.com>
2016-06-07acpi, numa: remove duplicate NULL checkHanjun Guo
The argument "header" for acpi_table_print_srat_entry() is always checked before the function is called, it's duplicate to check it again, remove it. Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org> Signed-off-by: Robert Richter <rrichter@cavium.com> Signed-off-by: David Daney <david.daney@cavium.com>
2016-06-07acpi, numa: Replace ACPI_DEBUG_PRINT() with pr_debug()Hanjun Guo
ACPI_DEBUG_PRINT is a bit fragile in acpi/numa.c, the first thing is that component ACPI_NUMA(0x80000000) is not described in the Documentation/acpi/debug.txt, and even not defined in the struct acpi_dlayer acpi_debug_layers which we can not dynamically enable/disable it with /sys/modules/acpi/parameters/debug_layer. another thing is that ACPI_DEBUG_OUTPUT is controlled by ACPICA which not coordinate well with ACPI drivers. Replace ACPI_DEBUG_PRINT() with pr_debug() in this patch as pr_debug will do the same thing for debug purpose and it can make the code much cleaner, also remove the related code which not needed anymore if ACPI_DEBUG_PRINT() is gone. Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org> Signed-off-by: Robert Richter <rrichter@cavium.com> Signed-off-by: David Daney <david.daney@cavium.com>
2016-06-07acpi, numa: Use pr_fmt() instead of printkHanjun Guo
Just do some cleanups to replace printk with pr_fmt(). Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org> Signed-off-by: Robert Richter <rrichter@cavium.com> Signed-off-by: David Daney <david.daney@cavium.com>
2016-06-07acpi, gicv3, its: Use MADT ITS subtable to do PCI/MSI domain initialization.Tomasz Nowicki
Let ACPI build ITS PCI MSI domain. ACPI is responsible for retrieving inner domain token and passing it on to its_pci_msi_init_one generic init call. We have now full PCI MSI domain stack, thus we can enable ITS initialization from GICv3 core driver for ACPI scenario. Signed-off-by: Tomasz Nowicki <tn@semihalf.com>
2016-06-07its, pci, msi: Factor out code that might be reused for ACPI.Tomasz Nowicki
Firmware agnostic code lands in common functions which do necessary domain initialization based on unique domain handler. DT specific code goes to DT specific init call. Signed-off-by: Tomasz Nowicki <tn@semihalf.com>
2016-06-07irqchip, gicv3, its: Probe ITS in the ACPI way.Tomasz Nowicki
ITS is prepared for being initialized different than DT, therefore we can initialize it in ACPI way. We collect register base address from MADT table and pass mandatory info to firmware-agnostic ITS init call. Note that we are using here IORT lib to register ITS domain which then can be found and used on to build another PCI MSI domain in hierarchical stack domain. Signed-off-by: Tomasz Nowicki <tn@semihalf.com>
2016-06-07irqchip, GICv3, ITS: Refator ITS DT init code to prepare for ACPI.Tomasz Nowicki
In order to add ACPI support we need to isolate ACPI&DT common code and move DT logic to corresponding functions. To achieve this we are using firmware agnostic handle which can be unpacked to either DT or ACPI node. No functional changes other than a very minor one: 1. Fix ITS base register address type (from 'unsigned long' to 'phys_addr_t'), as a bonus we get nice string formatting. 2. Since there is only one of ITS parent domain convert it to static global variable and drop the parameter from its_probe_one. Users can refer to it in more convenient way then. Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org> Signed-off-by: Tomasz Nowicki <tn@semihalf.com>
2016-06-07irqchip, GICv3, ITS: Cleanup for ITS domain initialization.Tomasz Nowicki
There is no point to initialize ITS without having msi-controller property in corresponding DT node. However, its_probe is checking msi-controller presence at the end, so we can save our time and do that check prior to its_probe call. Also, for the code clarity purpose, we put domain initialization to separate function. Signed-off-by: Tomasz Nowicki <tn@semihalf.com> Acked-by: Marc Zyngier <marc.zyngier@arm.com>
2016-06-07acpi, pci: Setup MSI domain on a per-devices basis.Tomasz Nowicki
It is possible to provide information about which MSI controller to use on a per-device basis for DT. This patch supply this with ACPI support. Currently, IORT is the only one ACPI table which can provide such mapping. In order to plug IORT into MSI infrastructure we are adding ACPI equivalents for finding PCI device domain and its RID translation (pci_msi_domain_get_msi_rid and pci_msi_domain_get_msi_rid calls). Signed-off-by: Tomasz Nowicki <tn@semihalf.com>
2016-06-07ARM64, ACPI, PCI: I/O Remapping Table (IORT) initial support.Tomasz Nowicki
IORT shows representation of IO topology for ARM based systems. It describes how various components are connected together on parent-child basis e.g. PCI RC -> SMMU -> ITS. Also see IORT spec. Initial support allows to: - register ITS MSI chip along with ITS translation ID and domain token - deregister ITS MSI chip based on ITS translation ID - find registered domain token based on ITS translation ID - map MSI RID based on PCI device and requester ID - find domain token based on PCI device and requester ID Signed-off-by: Tomasz Nowicki <tn@semihalf.com>
2016-06-07clocksource/drivers/arm_arch_timer: Add GTDT support for memory-mapped timerFu Wei
The patch add memory-mapped timer register support by using the information provided by the new GTDT driver of ACPI. Signed-off-by: Fu Wei <fu.wei@linaro.org>
2016-06-07clocksource/drivers/arm_arch_timer: Simplify ACPI support code.Fu Wei
The patch update arm_arch_timer driver to use the function provided by the new GTDT driver of ACPI. By this way, arm_arch_timer.c can be simplified, and separate all the ACPI GTDT knowledge from this timer driver. Signed-off-by: Fu Wei <fu.wei@linaro.org> Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
2016-06-07acpi: Add GTDT table parse driver into ACPI driverFu Wei
This driver adds support for parsing all kinds of timer in GTDT: (1)arch timer: provide a kernel API to parse all the PPIs and always-on info in GTDT and export them by filling the structs which provided by parameters(pointer of them). (2)memory-mapped timer: provide a kernel APIs to parse GT Block Structure in GTDT, export all the timer info by filling the struct which provided by parameter(pointer of the struct). (3)SBSA Generic Watchdog: parse all info in SBSA Generic Watchdog Structure in GTDT, and creating a platform device with that information. This allows the operating system to obtain device data from the resource of platform device. The platform device named "sbsa-gwdt" can be used by the ARM SBSA Generic Watchdog driver. By this driver, we can simplify all the relevant drivers, and separate all the ACPI GTDT knowledge from them. Signed-off-by: Fu Wei <fu.wei@linaro.org> Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
2016-06-07clocksource/drivers/arm_arch_timer: Improve printk relevant codeFu Wei
This patch defines pr_fmt(fmt) for all pr_* functions, then the pr_* don't need to add "arch_timer:" everytime. Also delete some Blank Spaces in arch_timer_banner, according to the suggestion from checkpatch.pl. No functional change. Signed-off-by: Fu Wei <fu.wei@linaro.org>
2016-06-07clocksource/drivers/arm_arch_timer: Add a new enum for spi typeFu Wei
This patch add a new enum "spi_nr" and use it in the driver. Just for code's readability, no functional change. Signed-off-by: Fu Wei <fu.wei@linaro.org>
2016-06-07clocksource/drivers/arm_arch_timer: Move enums and defines to header fileFu Wei
To support the arm_arch_timer via ACPI we need to share defines and enums between the driver and the ACPI parser code. Split out the relevant defines and enums into arm_arch_timer.h. No functional change. Signed-off-by: Fu Wei <fu.wei@linaro.org>