[PATCH v4 15/15] drivers: acpi: iort: introduce iort_iommu_configure

2016-08-15 Thread Lorenzo Pieralisi
DT based systems have a generic kernel API to configure IOMMUs for devices (ie of_iommu_configure()). On ARM based ACPI systems, the of_iommu_configure() equivalent can be implemented atop ACPI IORT kernel API, with the corresponding functions to map device identifiers to IOMMUs and retrieve the c

[PATCH v4 14/15] drivers: acpi: iort: add single mapping function

2016-08-15 Thread Lorenzo Pieralisi
The current IORT id mapping API requires components to provide an input requester ID (a Bus-Device-Function (BDF) identifier for PCI devices) to translate an input identifier to an output identifier through an IORT range mapping. Named components do not have an identifiable source ID therefore the

[PATCH v4 13/15] drivers: acpi: iort: replace rid map type with type mask

2016-08-15 Thread Lorenzo Pieralisi
IORT tables provide data that allow the kernel to carry out device ID mappings between endpoints and system components (eg interrupt controllers, IOMMUs). When the mapping for a given device ID is carried out, the translation mechanism is done on a per-subsystem basis rather than a component subtyp

[PATCH v4 07/15] drivers: acpi: implement acpi_dma_configure

2016-08-15 Thread Lorenzo Pieralisi
On DT based systems, the of_dma_configure() API implements DMA configuration for a given device. On ACPI systems an API equivalent to of_dma_configure() is missing which implies that it is currently not possible to set-up DMA operations for devices through the ACPI generic kernel layer. This patch

[PATCH v4 05/15] drivers: platform: add fwnode base platform devices retrieval

2016-08-15 Thread Lorenzo Pieralisi
The platform device kernel API does not provide functions to retrieve a platform device through the corresponding struct device fwnode pointer. Implement the fwnode platform_device look-up in drivers core code by using the bus_find_device() API and a corresponding matching function. The OF equival

[PATCH v4 04/15] drivers: acpi: iort: add support for IOMMU fwnode registration

2016-08-15 Thread Lorenzo Pieralisi
The ACPI IORT table provide entries for IOMMU (aka SMMU in ARM world) components that allow creating the kernel data structures required to probe and initialize the IOMMU devices. This patch provides support in the IORT kernel code to register IOMMU components and their respective fwnode. Signed-

[PATCH v4 12/15] drivers: iommu: arm-smmu-v3: add IORT configuration

2016-08-15 Thread Lorenzo Pieralisi
In ACPI bases systems, in order to be able to create platform devices and initialize them for ARM SMMU v3 components, the IORT kernel implementation requires a set of static functions to be used by the IORT kernel layer to configure platform devices for ARM SMMU v3 components. Add static configura

[PATCH v4 11/15] drivers: iommu: arm-smmu-v3: enable ACPI driver initialization

2016-08-15 Thread Lorenzo Pieralisi
On systems booting with ACPI that enable the ARM SMMU components in the kernel config options, the ARM SMMU v3 init function (ie arm_smmu_init(), that registers the driver and sets-up bus iommu operations) does not run only because the device tree interface (of_find_matching_node()) fails to find t

[PATCH v4 03/15] drivers: acpi: iort: introduce linker section for IORT entries probing

2016-08-15 Thread Lorenzo Pieralisi
Since commit e647b532275b ("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

[PATCH v4 10/15] drivers: iommu: arm-smmu-v3: split probe functions into DT/generic portions

2016-08-15 Thread Lorenzo Pieralisi
Current ARM SMMUv3 probe functions intermingle HW and DT probing in the initialization functions to detect and programme the ARM SMMU v3 driver features. In order to allow probing the ARM SMMUv3 with other firmwares than DT, this patch splits the ARM SMMUv3 init functions into DT and HW specific po

[PATCH v4 09/15] drivers: acpi: iort: add support for ARM SMMU platform devices creation

2016-08-15 Thread Lorenzo Pieralisi
In ARM ACPI systems, IOMMU components are specified through static IORT table entries. In order to create platform devices for the corresponding ARM SMMU components, IORT kernel code should be made able to parse IORT table entries and create platform devices dynamically. This patch adds the generi

[PATCH v4 08/15] drivers: acpi: iort: add node match function

2016-08-15 Thread Lorenzo Pieralisi
Device drivers (eg ARM SMMU) need to know if a specific component is part of the IORT table, so that kernel data structures are not initialized at initcalls time if the respective component is not part of the IORT table. To this end, this patch adds a trivial function that allows detecting if a gi

[PATCH v4 06/15] drivers: iommu: make iommu_fwspec OF agnostic

2016-08-15 Thread Lorenzo Pieralisi
The iommu_fwspec structure, used to hold per device iommu configuration data is not OF specific and therefore can be moved to a generic and OF independent compilation unit. In particular, the iommu_fwspec handling hinges on the device_node pointer to identify the IOMMU device associated with the i

[PATCH v4 02/15] drivers: iommu: implement arch_{set/get}_iommu_fwspec API

2016-08-15 Thread Lorenzo Pieralisi
The iommu fwspec configuration mechanism currently relies on the arch specific struct dev_archdata.iommu member to stash the struct iommu_fwspec pointer set-up for streamid translation. The struct dev_archdata.iommu member is arch specific and is not present on all arches that make use of the stru

[PATCH v4 01/15] drivers: iommu: add FWNODE_IOMMU fwnode type

2016-08-15 Thread Lorenzo Pieralisi
On systems booting with a device tree, every struct device is associated with a struct device_node, that represents its DT representation. The device node can be used in generic kernel contexts (eg IRQ translation, IOMMU streamid mapping), to retrieve the properties associated with the device and c

[PATCH v4 00/15] ACPI IORT ARM SMMU v3 support

2016-08-15 Thread Lorenzo Pieralisi
This patch series is v4 of a previous posting: https://lkml.org/lkml/2016/7/20/248 v3 -> v4 - Added single mapping API (for IORT named components) - Fixed arm_smmu_iort_xlate() return value - Reworked fwnode registration and platform device creation ordering to f

[git pull] IOMMU Fixes for Linux v4.8-rc2

2016-08-15 Thread Joerg Roedel
Hi Linus, The following changes since commit 29b4817d4018df78086157ea3a55c1d9424a7cfc: Linux 4.8-rc1 (2016-08-07 18:18:00 -0700) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git tags/iommu-fixes-v4.8-rc2 for you to fetch changes up to c9