1. 29 11月, 2016 1 次提交
    • L
      ACPI/IORT: Introduce linker section for IORT entries probing · 34ceea27
      Lorenzo Pieralisi 提交于
      Since commit e647b532 ("ACPI: Add early device probing
      infrastructure") the kernel has gained the infrastructure that allows
      adding linker script section entries to execute ACPI driver callbacks
      (ie probe routines) for all subsystems that register a table entry
      in the respective kernel section (eg clocksource, irqchip).
      
      Since ARM IOMMU devices data is described through IORT tables when
      booting with ACPI, the ARM IOMMU drivers must be made able to hook ACPI
      callback routines that are called to probe IORT entries and initialize
      the respective IOMMU devices.
      
      To avoid adding driver specific hooks into IORT table initialization
      code (breaking therefore code modularity - ie ACPI IORT code must be made
      aware of ARM SMMU drivers ACPI init callbacks), this patch adds code
      that allows ARM SMMU drivers to take advantage of the ACPI early probing
      infrastructure, so that they can add linker script section entries
      containing drivers callback to be executed on IORT tables detection.
      
      Since IORT nodes are differentiated by a type, the callback routines
      can easily parse the IORT table entries, check the IORT nodes and
      carry out some actions whenever the IORT node type associated with
      the driver specific callback is matched.
      Signed-off-by: NLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Reviewed-by: NHanjun Guo <hanjun.guo@linaro.org>
      Reviewed-by: NTomasz Nowicki <tn@semihalf.com>
      Tested-by: NHanjun Guo <hanjun.guo@linaro.org>
      Tested-by: NTomasz Nowicki <tn@semihalf.com>
      Cc: Tomasz Nowicki <tn@semihalf.com>
      Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
      Cc: Marc Zyngier <marc.zyngier@arm.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      34ceea27
  2. 13 9月, 2016 2 次提交
    • T
      ACPI: Add new IORT functions to support MSI domain handling · 4bf2efd2
      Tomasz Nowicki 提交于
      For ITS, MSI functionality consists on building domain stack and
      during that process we need to reference to domain stack components
      e.g. before we create new DOMAIN_BUS_PCI_MSI domain we need to specify
      its DOMAIN_BUS_NEXUS parent domain. In order to manage that process
      properly, maintain list which elements contain domain token
      (unique for MSI domain stack) and ITS ID: iort_register_domain_token()
      and iort_deregister_domain_token(). Then retrieve domain token
      any time later with ITS ID being key off: iort_find_domain_token().
      With domain token and domain type we are able to find corresponding
      IRQ domain.
      
      Since IORT is prepared to describe MSI domain on a per-device basis,
      use existing IORT helpers and implement two calls:
      1. iort_msi_map_rid() to map MSI RID for a device
      2. iort_get_device_domain() to find domain token for a device
      Signed-off-by: NTomasz Nowicki <tn@semihalf.com>
      Acked-by: NRafael J. Wysocki <rjw@rjwysocki.net>
      Reviewed-by: NHanjun Guo <hanjun.guo@linaro.org>
      Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
      4bf2efd2
    • T
      ACPI: I/O Remapping Table (IORT) initial support · 88ef16d8
      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.
      http://infocenter.arm.com/help/topic/com.arm.doc.den0049b/DEN0049B_IO_Remapping_Table.pdf
      
      Initial support allows to detect IORT table presence and save its
      root pointer obtained through acpi_get_table(). The pointer validity
      depends on acpi_gbl_permanent_mmap because if acpi_gbl_permanent_mmap
      is not set while using IORT nodes we would dereference unmapped pointers.
      
      For the aforementioned reason call acpi_iort_init() from acpi_init()
      which guarantees acpi_gbl_permanent_mmap to be set at that point.
      
      Add generic helpers which are helpful for scanning and retrieving
      information from IORT table content. List of the most important helpers:
      - iort_find_dev_node() finds IORT node for a given device
      - iort_node_map_rid() maps device RID and returns IORT node which provides
        final translation
      
      IORT support is placed under drivers/acpi/arm64/ new directory due to its
      ARM64 specific nature. The code there is considered only for ARM64.
      The long term plan is to keep all ARM64 specific tables support
      in this place e.g. GTDT table.
      Signed-off-by: NTomasz Nowicki <tn@semihalf.com>
      Acked-by: NRafael J. Wysocki <rjw@rjwysocki.net>
      Reviewed-by: NHanjun Guo <hanjun.guo@linaro.org>
      Reviewed-by: NLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
      88ef16d8