Re: [PATCH v6 00/16] ACPI IORT ARM SMMU support

2016-10-27 Thread Lorenzo Pieralisi
On Thu, Oct 27, 2016 at 12:24:48PM +0200, Rafael J. Wysocki wrote:
> On Wed, Oct 26, 2016 at 1:04 PM, Lorenzo Pieralisi
>  wrote:
> > Rafael, Joerg (and anyone else CC'ed),
> >
> > On Tue, Oct 18, 2016 at 05:03:58PM +0100, Lorenzo Pieralisi wrote:
> >> This patch series is v6 of a previous posting:
> >>
> >> https://lkml.org/lkml/2016/9/9/418
> >>
> >> v5 -> v6
> >>   - Rebased against v4.9-rc1
> >>   - Changed FWNODE_IOMMU to FWNODE_ACPI_STATIC
> >>   - Moved platform devices creation into IORT code
> >>   - Updated fwnode handling
> >>   - Added default dma masks initialization
> >
> > Any comments on v6 ? Patches touching generic ACPI code
> > are {1, 2, 7}, patch 4 updates the IOMMU of_iommu_{set/get}_ops()
> > API to make it work on ACPI systems too, by replacing the
> > device_node with a fwnode_handle pointer as look-up token;
> > the remainder of patches are ARM specific and creates the
> > infrastructure to probe ARM SMMU devices through ACPI,
> > ARM IORT table in particular. Given the generic bits changes
> > above I would not leave it to late -rc to reach an agreement
> > please, thank you.
> 
> I'll do my best to look at these in the next few days, but please also
> note what I wrote before:
> 
> http://marc.info/?l=linux-acpi=147744344531599=2

Thanks, understood, I asked because if I have to respin it I'd like
to do it asap and the generic ACPI patches are simple but fundamental
to the series, anyway I think it is something we can manage next week
at LPC.

Thanks !
Lorenzo


Re: [PATCH v6 00/16] ACPI IORT ARM SMMU support

2016-10-27 Thread Lorenzo Pieralisi
On Thu, Oct 27, 2016 at 12:24:48PM +0200, Rafael J. Wysocki wrote:
> On Wed, Oct 26, 2016 at 1:04 PM, Lorenzo Pieralisi
>  wrote:
> > Rafael, Joerg (and anyone else CC'ed),
> >
> > On Tue, Oct 18, 2016 at 05:03:58PM +0100, Lorenzo Pieralisi wrote:
> >> This patch series is v6 of a previous posting:
> >>
> >> https://lkml.org/lkml/2016/9/9/418
> >>
> >> v5 -> v6
> >>   - Rebased against v4.9-rc1
> >>   - Changed FWNODE_IOMMU to FWNODE_ACPI_STATIC
> >>   - Moved platform devices creation into IORT code
> >>   - Updated fwnode handling
> >>   - Added default dma masks initialization
> >
> > Any comments on v6 ? Patches touching generic ACPI code
> > are {1, 2, 7}, patch 4 updates the IOMMU of_iommu_{set/get}_ops()
> > API to make it work on ACPI systems too, by replacing the
> > device_node with a fwnode_handle pointer as look-up token;
> > the remainder of patches are ARM specific and creates the
> > infrastructure to probe ARM SMMU devices through ACPI,
> > ARM IORT table in particular. Given the generic bits changes
> > above I would not leave it to late -rc to reach an agreement
> > please, thank you.
> 
> I'll do my best to look at these in the next few days, but please also
> note what I wrote before:
> 
> http://marc.info/?l=linux-acpi=147744344531599=2

Thanks, understood, I asked because if I have to respin it I'd like
to do it asap and the generic ACPI patches are simple but fundamental
to the series, anyway I think it is something we can manage next week
at LPC.

Thanks !
Lorenzo


Re: [PATCH v6 00/16] ACPI IORT ARM SMMU support

2016-10-27 Thread Rafael J. Wysocki
On Wed, Oct 26, 2016 at 1:04 PM, Lorenzo Pieralisi
 wrote:
> Rafael, Joerg (and anyone else CC'ed),
>
> On Tue, Oct 18, 2016 at 05:03:58PM +0100, Lorenzo Pieralisi wrote:
>> This patch series is v6 of a previous posting:
>>
>> https://lkml.org/lkml/2016/9/9/418
>>
>> v5 -> v6
>>   - Rebased against v4.9-rc1
>>   - Changed FWNODE_IOMMU to FWNODE_ACPI_STATIC
>>   - Moved platform devices creation into IORT code
>>   - Updated fwnode handling
>>   - Added default dma masks initialization
>
> Any comments on v6 ? Patches touching generic ACPI code
> are {1, 2, 7}, patch 4 updates the IOMMU of_iommu_{set/get}_ops()
> API to make it work on ACPI systems too, by replacing the
> device_node with a fwnode_handle pointer as look-up token;
> the remainder of patches are ARM specific and creates the
> infrastructure to probe ARM SMMU devices through ACPI,
> ARM IORT table in particular. Given the generic bits changes
> above I would not leave it to late -rc to reach an agreement
> please, thank you.

I'll do my best to look at these in the next few days, but please also
note what I wrote before:

http://marc.info/?l=linux-acpi=147744344531599=2

Thanks,
Rafael


Re: [PATCH v6 00/16] ACPI IORT ARM SMMU support

2016-10-27 Thread Rafael J. Wysocki
On Wed, Oct 26, 2016 at 1:04 PM, Lorenzo Pieralisi
 wrote:
> Rafael, Joerg (and anyone else CC'ed),
>
> On Tue, Oct 18, 2016 at 05:03:58PM +0100, Lorenzo Pieralisi wrote:
>> This patch series is v6 of a previous posting:
>>
>> https://lkml.org/lkml/2016/9/9/418
>>
>> v5 -> v6
>>   - Rebased against v4.9-rc1
>>   - Changed FWNODE_IOMMU to FWNODE_ACPI_STATIC
>>   - Moved platform devices creation into IORT code
>>   - Updated fwnode handling
>>   - Added default dma masks initialization
>
> Any comments on v6 ? Patches touching generic ACPI code
> are {1, 2, 7}, patch 4 updates the IOMMU of_iommu_{set/get}_ops()
> API to make it work on ACPI systems too, by replacing the
> device_node with a fwnode_handle pointer as look-up token;
> the remainder of patches are ARM specific and creates the
> infrastructure to probe ARM SMMU devices through ACPI,
> ARM IORT table in particular. Given the generic bits changes
> above I would not leave it to late -rc to reach an agreement
> please, thank you.

I'll do my best to look at these in the next few days, but please also
note what I wrote before:

http://marc.info/?l=linux-acpi=147744344531599=2

Thanks,
Rafael


Re: [PATCH v6 00/16] ACPI IORT ARM SMMU support

2016-10-26 Thread Lorenzo Pieralisi
Rafael, Joerg (and anyone else CC'ed),

On Tue, Oct 18, 2016 at 05:03:58PM +0100, Lorenzo Pieralisi wrote:
> This patch series is v6 of a previous posting:
> 
> https://lkml.org/lkml/2016/9/9/418
> 
> v5 -> v6
>   - Rebased against v4.9-rc1
>   - Changed FWNODE_IOMMU to FWNODE_ACPI_STATIC
>   - Moved platform devices creation into IORT code
>   - Updated fwnode handling
>   - Added default dma masks initialization

Any comments on v6 ? Patches touching generic ACPI code
are {1, 2, 7}, patch 4 updates the IOMMU of_iommu_{set/get}_ops()
API to make it work on ACPI systems too, by replacing the
device_node with a fwnode_handle pointer as look-up token;
the remainder of patches are ARM specific and creates the
infrastructure to probe ARM SMMU devices through ACPI,
ARM IORT table in particular. Given the generic bits changes
above I would not leave it to late -rc to reach an agreement
please, thank you.

Cheers,
Lorenzo

> v4 -> v5
>   - Added SMMUv1/v2 support
>   - Rebased against v4.8-rc5 and dependencies series
>   - Consolidated IORT platform devices creation
> 
> 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 fix probe ordering dependencies
>   - Added code to keep device_node ref count with new iommu
> fwspec API
>   - Added patch to make iommu_fwspec arch agnostic
>   - Dropped RFC status
>   - Rebased against v4.8-rc2
> 
> v2 -> v3
>   - Rebased on top of dependencies series [1][2][3](v4.7-rc3)
>   - Added back reliance on ACPI early probing infrastructure
>   - Patch[1-3] merged through other dependent series
>   - Added back IOMMU fwnode generalization
>   - Move SMMU v3 static functions configuration to IORT code
>   - Implemented generic IOMMU fwspec API
>   - Added code to implement fwnode platform device look-up
> 
> v1 -> v2:
>   - Rebased on top of dependencies series [1][2][3](v4.7-rc1)
>   - Removed IOMMU fwnode generalization
>   - Implemented ARM SMMU v3 ACPI probing instead of ARM SMMU v2
> owing to patch series dependencies [1]
>   - Moved platform device creation logic to IORT code to
> generalize its usage for ARM SMMU v1-v2-v3 components
>   - Removed reliance on ACPI early device probing
>   - Created IORT specific iommu_xlate() translation hook leaving
> OF code unchanged according to v1 reviews
> 
> The ACPI IORT table provides information that allows instantiating
> ARM SMMU devices and carrying out id mappings between components on
> ARM based systems (devices, IOMMUs, interrupt controllers).
> 
> http://infocenter.arm.com/help/topic/com.arm.doc.den0049b/DEN0049B_IO_Remapping_Table.pdf
> 
> Building on basic IORT support, this patchset enables ARM SMMUs support
> on ACPI systems.
> 
> Most of the code is aimed at building the required generic ACPI
> infrastructure to create and enable IOMMU components and to bring
> the IOMMU infrastructure for ACPI on par with DT, which is going to
> make future ARM SMMU components easier to integrate.
> 
> PATCH (1) adds a FWNODE_ACPI_STATIC type to the struct fwnode_handle type.
>   It is required to attach a fwnode identifier to platform
>   devices allocated/detected through static ACPI table entries
>   (ie IORT tables entries).
>   IOMMU devices have to have an identifier to look them up
>   eg IOMMU core layer carrying out id translation. This can be
>   done through a fwnode_handle (ie IOMMU platform devices created
>   out of IORT tables are not ACPI devices hence they can't be
>   allocated as such, otherwise they would have a fwnode_handle of
>   type FWNODE_ACPI).
> 
> PATCH (2) makes use of the ACPI early probing API to add a linker script
>   section for probing devices via IORT ACPI kernel code.
> 
> PATCH (3) provides IORT support for registering IOMMU IORT node through
>   their fwnode handle.
> 
> PATCH (4) make of_iommu_{set/get}_ops() functions DT agnostic.
> 
> PATCH (5) convert ARM SMMU driver to use fwnode instead of of_node as
>   look-up and iommu_ops retrieval token.
> 
> PATCH (6) convert ARM SMMU v3 driver to use fwnode instead of of_node as
>   look-up and iommu_ops retrieval token.
> 
> PATCH (7) implements the of_dma_configure() API in ACPI world -
>   acpi_dma_configure() - and patches PCI and ACPI core code to
>   start making use of it.
> 
> PATCH (8) provides an IORT function to detect existence of specific type
>   of IORT components.
> 
> PATCH (9) creates the kernel infrastructure required to create ARM SMMU
>   platform devices for IORT nodes.
> 
> PATCH (10) refactors the ARM SMMU v3 driver so that the init functions are
>split in a way that groups together code that 

Re: [PATCH v6 00/16] ACPI IORT ARM SMMU support

2016-10-26 Thread Lorenzo Pieralisi
Rafael, Joerg (and anyone else CC'ed),

On Tue, Oct 18, 2016 at 05:03:58PM +0100, Lorenzo Pieralisi wrote:
> This patch series is v6 of a previous posting:
> 
> https://lkml.org/lkml/2016/9/9/418
> 
> v5 -> v6
>   - Rebased against v4.9-rc1
>   - Changed FWNODE_IOMMU to FWNODE_ACPI_STATIC
>   - Moved platform devices creation into IORT code
>   - Updated fwnode handling
>   - Added default dma masks initialization

Any comments on v6 ? Patches touching generic ACPI code
are {1, 2, 7}, patch 4 updates the IOMMU of_iommu_{set/get}_ops()
API to make it work on ACPI systems too, by replacing the
device_node with a fwnode_handle pointer as look-up token;
the remainder of patches are ARM specific and creates the
infrastructure to probe ARM SMMU devices through ACPI,
ARM IORT table in particular. Given the generic bits changes
above I would not leave it to late -rc to reach an agreement
please, thank you.

Cheers,
Lorenzo

> v4 -> v5
>   - Added SMMUv1/v2 support
>   - Rebased against v4.8-rc5 and dependencies series
>   - Consolidated IORT platform devices creation
> 
> 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 fix probe ordering dependencies
>   - Added code to keep device_node ref count with new iommu
> fwspec API
>   - Added patch to make iommu_fwspec arch agnostic
>   - Dropped RFC status
>   - Rebased against v4.8-rc2
> 
> v2 -> v3
>   - Rebased on top of dependencies series [1][2][3](v4.7-rc3)
>   - Added back reliance on ACPI early probing infrastructure
>   - Patch[1-3] merged through other dependent series
>   - Added back IOMMU fwnode generalization
>   - Move SMMU v3 static functions configuration to IORT code
>   - Implemented generic IOMMU fwspec API
>   - Added code to implement fwnode platform device look-up
> 
> v1 -> v2:
>   - Rebased on top of dependencies series [1][2][3](v4.7-rc1)
>   - Removed IOMMU fwnode generalization
>   - Implemented ARM SMMU v3 ACPI probing instead of ARM SMMU v2
> owing to patch series dependencies [1]
>   - Moved platform device creation logic to IORT code to
> generalize its usage for ARM SMMU v1-v2-v3 components
>   - Removed reliance on ACPI early device probing
>   - Created IORT specific iommu_xlate() translation hook leaving
> OF code unchanged according to v1 reviews
> 
> The ACPI IORT table provides information that allows instantiating
> ARM SMMU devices and carrying out id mappings between components on
> ARM based systems (devices, IOMMUs, interrupt controllers).
> 
> http://infocenter.arm.com/help/topic/com.arm.doc.den0049b/DEN0049B_IO_Remapping_Table.pdf
> 
> Building on basic IORT support, this patchset enables ARM SMMUs support
> on ACPI systems.
> 
> Most of the code is aimed at building the required generic ACPI
> infrastructure to create and enable IOMMU components and to bring
> the IOMMU infrastructure for ACPI on par with DT, which is going to
> make future ARM SMMU components easier to integrate.
> 
> PATCH (1) adds a FWNODE_ACPI_STATIC type to the struct fwnode_handle type.
>   It is required to attach a fwnode identifier to platform
>   devices allocated/detected through static ACPI table entries
>   (ie IORT tables entries).
>   IOMMU devices have to have an identifier to look them up
>   eg IOMMU core layer carrying out id translation. This can be
>   done through a fwnode_handle (ie IOMMU platform devices created
>   out of IORT tables are not ACPI devices hence they can't be
>   allocated as such, otherwise they would have a fwnode_handle of
>   type FWNODE_ACPI).
> 
> PATCH (2) makes use of the ACPI early probing API to add a linker script
>   section for probing devices via IORT ACPI kernel code.
> 
> PATCH (3) provides IORT support for registering IOMMU IORT node through
>   their fwnode handle.
> 
> PATCH (4) make of_iommu_{set/get}_ops() functions DT agnostic.
> 
> PATCH (5) convert ARM SMMU driver to use fwnode instead of of_node as
>   look-up and iommu_ops retrieval token.
> 
> PATCH (6) convert ARM SMMU v3 driver to use fwnode instead of of_node as
>   look-up and iommu_ops retrieval token.
> 
> PATCH (7) implements the of_dma_configure() API in ACPI world -
>   acpi_dma_configure() - and patches PCI and ACPI core code to
>   start making use of it.
> 
> PATCH (8) provides an IORT function to detect existence of specific type
>   of IORT components.
> 
> PATCH (9) creates the kernel infrastructure required to create ARM SMMU
>   platform devices for IORT nodes.
> 
> PATCH (10) refactors the ARM SMMU v3 driver so that the init functions are
>split in a way that groups together code that 

Re: [PATCH v6 00/16] ACPI IORT ARM SMMU support

2016-10-25 Thread Hanjun Guo

On 2016/10/19 0:03, Lorenzo Pieralisi wrote:

This patch series is v6 of a previous posting:

https://lkml.org/lkml/2016/9/9/418

v5 -> v6
- Rebased against v4.9-rc1
- Changed FWNODE_IOMMU to FWNODE_ACPI_STATIC
- Moved platform devices creation into IORT code
- Updated fwnode handling
- Added default dma masks initialization

v4 -> v5
- Added SMMUv1/v2 support
- Rebased against v4.8-rc5 and dependencies series
- Consolidated IORT platform devices creation


[...]


The ACPI IORT table provides information that allows instantiating
ARM SMMU devices and carrying out id mappings between components on
ARM based systems (devices, IOMMUs, interrupt controllers).

http://infocenter.arm.com/help/topic/com.arm.doc.den0049b/DEN0049B_IO_Remapping_Table.pdf

Building on basic IORT support, this patchset enables ARM SMMUs support
on ACPI systems.

Most of the code is aimed at building the required generic ACPI
infrastructure to create and enable IOMMU components and to bring
the IOMMU infrastructure for ACPI on par with DT, which is going to
make future ARM SMMU components easier to integrate.


[...]


This patchset is provided for review/testing purposes here:

git://git.kernel.org/pub/scm/linux/kernel/git/lpieralisi/linux.git 
acpi/iort-smmu-v6

Tested on Juno and FVP models for ARM SMMU v1 and v3 probing path.


I rebased my platform MSI, interrupt producer and mbi-gen patch set
on top of yours, and test it on Hisilicon D03 board with SMMv3
enabled, USB and SAS are working properly with configuration
in IORT (yes, I need to add patch from Robin - iommu/arm-smmu: Don't
inadvertently reject multiple SMMUv3s),

Tested-by: Hanjun Guo 

Thanks
Hanjun


Re: [PATCH v6 00/16] ACPI IORT ARM SMMU support

2016-10-25 Thread Hanjun Guo

On 2016/10/19 0:03, Lorenzo Pieralisi wrote:

This patch series is v6 of a previous posting:

https://lkml.org/lkml/2016/9/9/418

v5 -> v6
- Rebased against v4.9-rc1
- Changed FWNODE_IOMMU to FWNODE_ACPI_STATIC
- Moved platform devices creation into IORT code
- Updated fwnode handling
- Added default dma masks initialization

v4 -> v5
- Added SMMUv1/v2 support
- Rebased against v4.8-rc5 and dependencies series
- Consolidated IORT platform devices creation


[...]


The ACPI IORT table provides information that allows instantiating
ARM SMMU devices and carrying out id mappings between components on
ARM based systems (devices, IOMMUs, interrupt controllers).

http://infocenter.arm.com/help/topic/com.arm.doc.den0049b/DEN0049B_IO_Remapping_Table.pdf

Building on basic IORT support, this patchset enables ARM SMMUs support
on ACPI systems.

Most of the code is aimed at building the required generic ACPI
infrastructure to create and enable IOMMU components and to bring
the IOMMU infrastructure for ACPI on par with DT, which is going to
make future ARM SMMU components easier to integrate.


[...]


This patchset is provided for review/testing purposes here:

git://git.kernel.org/pub/scm/linux/kernel/git/lpieralisi/linux.git 
acpi/iort-smmu-v6

Tested on Juno and FVP models for ARM SMMU v1 and v3 probing path.


I rebased my platform MSI, interrupt producer and mbi-gen patch set
on top of yours, and test it on Hisilicon D03 board with SMMv3
enabled, USB and SAS are working properly with configuration
in IORT (yes, I need to add patch from Robin - iommu/arm-smmu: Don't
inadvertently reject multiple SMMUv3s),

Tested-by: Hanjun Guo 

Thanks
Hanjun


[PATCH v6 00/16] ACPI IORT ARM SMMU support

2016-10-18 Thread Lorenzo Pieralisi
This patch series is v6 of a previous posting:

https://lkml.org/lkml/2016/9/9/418

v5 -> v6
- Rebased against v4.9-rc1
- Changed FWNODE_IOMMU to FWNODE_ACPI_STATIC
- Moved platform devices creation into IORT code
- Updated fwnode handling
- Added default dma masks initialization

v4 -> v5
- Added SMMUv1/v2 support
- Rebased against v4.8-rc5 and dependencies series
- Consolidated IORT platform devices creation

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 fix probe ordering dependencies
- Added code to keep device_node ref count with new iommu
  fwspec API
- Added patch to make iommu_fwspec arch agnostic
- Dropped RFC status
- Rebased against v4.8-rc2

v2 -> v3
- Rebased on top of dependencies series [1][2][3](v4.7-rc3)
- Added back reliance on ACPI early probing infrastructure
- Patch[1-3] merged through other dependent series
- Added back IOMMU fwnode generalization
- Move SMMU v3 static functions configuration to IORT code
- Implemented generic IOMMU fwspec API
- Added code to implement fwnode platform device look-up

v1 -> v2:
- Rebased on top of dependencies series [1][2][3](v4.7-rc1)
- Removed IOMMU fwnode generalization
- Implemented ARM SMMU v3 ACPI probing instead of ARM SMMU v2
  owing to patch series dependencies [1]
- Moved platform device creation logic to IORT code to
  generalize its usage for ARM SMMU v1-v2-v3 components
- Removed reliance on ACPI early device probing
- Created IORT specific iommu_xlate() translation hook leaving
  OF code unchanged according to v1 reviews

The ACPI IORT table provides information that allows instantiating
ARM SMMU devices and carrying out id mappings between components on
ARM based systems (devices, IOMMUs, interrupt controllers).

http://infocenter.arm.com/help/topic/com.arm.doc.den0049b/DEN0049B_IO_Remapping_Table.pdf

Building on basic IORT support, this patchset enables ARM SMMUs support
on ACPI systems.

Most of the code is aimed at building the required generic ACPI
infrastructure to create and enable IOMMU components and to bring
the IOMMU infrastructure for ACPI on par with DT, which is going to
make future ARM SMMU components easier to integrate.

PATCH (1) adds a FWNODE_ACPI_STATIC type to the struct fwnode_handle type.
  It is required to attach a fwnode identifier to platform
  devices allocated/detected through static ACPI table entries
  (ie IORT tables entries).
  IOMMU devices have to have an identifier to look them up
  eg IOMMU core layer carrying out id translation. This can be
  done through a fwnode_handle (ie IOMMU platform devices created
  out of IORT tables are not ACPI devices hence they can't be
  allocated as such, otherwise they would have a fwnode_handle of
  type FWNODE_ACPI).

PATCH (2) makes use of the ACPI early probing API to add a linker script
  section for probing devices via IORT ACPI kernel code.

PATCH (3) provides IORT support for registering IOMMU IORT node through
  their fwnode handle.

PATCH (4) make of_iommu_{set/get}_ops() functions DT agnostic.

PATCH (5) convert ARM SMMU driver to use fwnode instead of of_node as
  look-up and iommu_ops retrieval token.

PATCH (6) convert ARM SMMU v3 driver to use fwnode instead of of_node as
  look-up and iommu_ops retrieval token.

PATCH (7) implements the of_dma_configure() API in ACPI world -
  acpi_dma_configure() - and patches PCI and ACPI core code to
  start making use of it.

PATCH (8) provides an IORT function to detect existence of specific type
  of IORT components.

PATCH (9) creates the kernel infrastructure required to create ARM SMMU
  platform devices for IORT nodes.

PATCH (10) refactors the ARM SMMU v3 driver so that the init functions are
   split in a way that groups together code that probes through DT
   and code that carries out HW registers FW agnostic probing, in
   preparation for adding the ACPI probing path.

PATCH (11) adds ARM SMMU v3 IORT IOMMU operations to create and probe
   ARM SMMU v3 components.

PATCH (12) refactors the ARM SMMU v1/v2 driver so that the init functions
   are split in a way that groups together code that probes
   through DT and code that carries out HW registers FW agnostic
   probing, in preparation for adding the ACPI probing path.

PATCH (13) adds ARM SMMU v1/v2 IORT IOMMU operations to create and
   probe ARM SMMU v1/v2 components.

PATCH (14) Extend the IORT iort_node_map_rid() to work on a type mask
   instead of a 

[PATCH v6 00/16] ACPI IORT ARM SMMU support

2016-10-18 Thread Lorenzo Pieralisi
This patch series is v6 of a previous posting:

https://lkml.org/lkml/2016/9/9/418

v5 -> v6
- Rebased against v4.9-rc1
- Changed FWNODE_IOMMU to FWNODE_ACPI_STATIC
- Moved platform devices creation into IORT code
- Updated fwnode handling
- Added default dma masks initialization

v4 -> v5
- Added SMMUv1/v2 support
- Rebased against v4.8-rc5 and dependencies series
- Consolidated IORT platform devices creation

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 fix probe ordering dependencies
- Added code to keep device_node ref count with new iommu
  fwspec API
- Added patch to make iommu_fwspec arch agnostic
- Dropped RFC status
- Rebased against v4.8-rc2

v2 -> v3
- Rebased on top of dependencies series [1][2][3](v4.7-rc3)
- Added back reliance on ACPI early probing infrastructure
- Patch[1-3] merged through other dependent series
- Added back IOMMU fwnode generalization
- Move SMMU v3 static functions configuration to IORT code
- Implemented generic IOMMU fwspec API
- Added code to implement fwnode platform device look-up

v1 -> v2:
- Rebased on top of dependencies series [1][2][3](v4.7-rc1)
- Removed IOMMU fwnode generalization
- Implemented ARM SMMU v3 ACPI probing instead of ARM SMMU v2
  owing to patch series dependencies [1]
- Moved platform device creation logic to IORT code to
  generalize its usage for ARM SMMU v1-v2-v3 components
- Removed reliance on ACPI early device probing
- Created IORT specific iommu_xlate() translation hook leaving
  OF code unchanged according to v1 reviews

The ACPI IORT table provides information that allows instantiating
ARM SMMU devices and carrying out id mappings between components on
ARM based systems (devices, IOMMUs, interrupt controllers).

http://infocenter.arm.com/help/topic/com.arm.doc.den0049b/DEN0049B_IO_Remapping_Table.pdf

Building on basic IORT support, this patchset enables ARM SMMUs support
on ACPI systems.

Most of the code is aimed at building the required generic ACPI
infrastructure to create and enable IOMMU components and to bring
the IOMMU infrastructure for ACPI on par with DT, which is going to
make future ARM SMMU components easier to integrate.

PATCH (1) adds a FWNODE_ACPI_STATIC type to the struct fwnode_handle type.
  It is required to attach a fwnode identifier to platform
  devices allocated/detected through static ACPI table entries
  (ie IORT tables entries).
  IOMMU devices have to have an identifier to look them up
  eg IOMMU core layer carrying out id translation. This can be
  done through a fwnode_handle (ie IOMMU platform devices created
  out of IORT tables are not ACPI devices hence they can't be
  allocated as such, otherwise they would have a fwnode_handle of
  type FWNODE_ACPI).

PATCH (2) makes use of the ACPI early probing API to add a linker script
  section for probing devices via IORT ACPI kernel code.

PATCH (3) provides IORT support for registering IOMMU IORT node through
  their fwnode handle.

PATCH (4) make of_iommu_{set/get}_ops() functions DT agnostic.

PATCH (5) convert ARM SMMU driver to use fwnode instead of of_node as
  look-up and iommu_ops retrieval token.

PATCH (6) convert ARM SMMU v3 driver to use fwnode instead of of_node as
  look-up and iommu_ops retrieval token.

PATCH (7) implements the of_dma_configure() API in ACPI world -
  acpi_dma_configure() - and patches PCI and ACPI core code to
  start making use of it.

PATCH (8) provides an IORT function to detect existence of specific type
  of IORT components.

PATCH (9) creates the kernel infrastructure required to create ARM SMMU
  platform devices for IORT nodes.

PATCH (10) refactors the ARM SMMU v3 driver so that the init functions are
   split in a way that groups together code that probes through DT
   and code that carries out HW registers FW agnostic probing, in
   preparation for adding the ACPI probing path.

PATCH (11) adds ARM SMMU v3 IORT IOMMU operations to create and probe
   ARM SMMU v3 components.

PATCH (12) refactors the ARM SMMU v1/v2 driver so that the init functions
   are split in a way that groups together code that probes
   through DT and code that carries out HW registers FW agnostic
   probing, in preparation for adding the ACPI probing path.

PATCH (13) adds ARM SMMU v1/v2 IORT IOMMU operations to create and
   probe ARM SMMU v1/v2 components.

PATCH (14) Extend the IORT iort_node_map_rid() to work on a type mask
   instead of a