[PATCH] iommu/ipmmu-vmsa: Document R-Car V3H and E3 IPMMU DT bindings

2018-05-21 Thread Magnus Damm
From: Magnus Damm <damm+rene...@opensource.se> Update the IPMMU DT binding documentation to include the compat strings for the IPMMU devices included in the R-Car V3H and E3 SoCs. Signed-off-by: Magnus Damm <damm+rene...@opensource.se> --- Developed on top of renesas-drivers-2018

[PATCH] iommu/ipmmu-vmsa: Document R-Car M3-N IPMMU DT bindings

2018-03-20 Thread Magnus Damm
From: Magnus Damm <damm+rene...@opensource.se> Update the IPMMU DT binding documentation to include the r8a77965 compat string for the IPMMU devices included in the R-Car M3-N SoC. Signed-off-by: Magnus Damm <damm+rene...@opensource.se> --- Documentation/devicetree/bindings/iommu/r

Re: [PATCH v4 02/09] iommu/ipmmu-vmsa: Add optional root device feature

2017-10-16 Thread Magnus Damm
Hi Robin, On Tue, Jun 20, 2017 at 2:19 AM, Robin Murphy <robin.mur...@arm.com> wrote: > On 19/06/17 10:14, Magnus Damm wrote: >> From: Magnus Damm <damm+rene...@opensource.se> >> >> Add root device handling to the IPMMU driver by allowing certa

[PATCH v5 07/09] iommu/ipmmu-vmsa: Make IMBUSCTR setup optional

2017-10-16 Thread Magnus Damm
From: Magnus Damm <damm+rene...@opensource.se> Introduce a feature to allow opt-out of setting up IMBUSCR. The default case is unchanged. Signed-off-by: Magnus Damm <damm+rene...@opensource.se> --- Changes since V4: - Use leaf node mmu instead of root Changes since V3: - No

[PATCH v5 09/09] iommu/ipmmu-vmsa: Hook up r8a7795 DT matching code

2017-10-16 Thread Magnus Damm
From: Magnus Damm <damm+rene...@opensource.se> Tie in r8a7795 features and update the IOMMU_OF_DECLARE compat string to include the updated compat string. Signed-off-by: Magnus Damm <damm+rene...@opensource.se> --- Changes since V4: - Got rid of root device availability chec

[PATCH v5 08/09] iommu/ipmmu-vmsa: Allow two bit SL0

2017-10-16 Thread Magnus Damm
From: Magnus Damm <damm+rene...@opensource.se> Introduce support for two bit SL0 bitfield in IMTTBCR by using a separate feature flag. Signed-off-by: Magnus Damm <damm+rene...@opensource.se> --- Changes since V4: - Use leaf node mmu instead of root Changes since V3: - None C

[PATCH v5 06/09] iommu/ipmmu-vmsa: Write IMCTR twice

2017-10-16 Thread Magnus Damm
From: Magnus Damm <damm+rene...@opensource.se> Write IMCTR both in the root device and the leaf node. To allow access of IMCTR introduce the following function: - ipmmu_ctx_write_all() While at it also rename context functions: - ipmmu_ctx_read() -> ipmmu_ctx_read_root() - ipmmu_

[PATCH v5 05/09] iommu/ipmmu-vmsa: IPMMU device is 40-bit bus master

2017-10-16 Thread Magnus Damm
From: Magnus Damm <damm+rene...@opensource.se> The r8a7795 IPMMU supports 40-bit bus mastering. Both the coherent DMA mask and the streaming DMA mask are set to unlock the 40-bit address space for coherent allocations and streaming operations. Signed-off-by: Magnus Damm <

[PATCH v5 04/09] iommu/ipmmu-vmsa: Make use of IOMMU_OF_DECLARE()

2017-10-16 Thread Magnus Damm
From: Magnus Damm <damm+rene...@opensource.se> Hook up IOMMU_OF_DECLARE() support in case CONFIG_IOMMU_DMA is enabled. The only current supported case for 32-bit ARM is disabled, however for 64-bit ARM usage of OF is required. Signed-off-by: Magnus Damm <damm+rene...@opensource.se> -

[PATCH v5 02/09] iommu/ipmmu-vmsa: Add optional root device feature

2017-10-16 Thread Magnus Damm
From: Magnus Damm <damm+rene...@opensource.se> Add root device handling to the IPMMU driver by allowing certain DT compat strings to enable has_cache_leaf_nodes that in turn will support both root devices with interrupts and leaf devices that face the actual IPMMU consumer devices. Sign

[PATCH v5 03/09] iommu/ipmmu-vmsa: Enable multi context support

2017-10-16 Thread Magnus Damm
From: Magnus Damm <damm+rene...@opensource.se> Add support for up to 8 contexts. Each context is mapped to one domain. One domain is assigned one or more slave devices. Contexts are allocated dynamically and slave devices are grouped together based on which IPMMU device they are con

[PATCH v5 01/09] iommu/ipmmu-vmsa: Introduce features, break out alias

2017-10-16 Thread Magnus Damm
From: Magnus Damm <damm+rene...@opensource.se> Introduce struct ipmmu_features to track various hardware and software implementation changes inside the driver for different kinds of IPMMU hardware. Add use_ns_alias_offset as a first example of a feature to control if the secure registe

[PATCH v5 00/09] iommu/ipmmu-vmsa: r8a7795 support V5

2017-10-16 Thread Magnus Damm
-bit ARM update V2 - Reworked root device handling to make use of driver_for_each_device() - Added deferred probing to make sure root device always is present Signed-off-by: Magnus Damm <damm+rene...@opensource.se> --- Developed on top of next-20171013 Also applies to renesas-drivers

[PATCH 1/3] iommu/ipmmu-vmsa: Document R-Car M3-W IPMMU DT bindings

2017-09-21 Thread Magnus Damm
From: Magnus Damm <damm+rene...@opensource.se> Update the IPMMU DT binding documentation to include the r8a7796 compat string for the IPMMU devices included in the R-Car M3-W SoC. Signed-off-by: Magnus Damm <damm+rene...@opensource.se> Acked-by: Laurent Pinchart &l

[PATCH 2/3] iommu/ipmmu-vmsa: Document R-Car V3M IPMMU DT bindings

2017-09-21 Thread Magnus Damm
From: Magnus Damm <damm+rene...@opensource.se> Update the IPMMU DT binding documentation to include the r8a77970 compat string for the IPMMU devices included in the R-Car V3M SoC. Signed-off-by: Magnus Damm <damm+rene...@opensource.se> --- Documentation/devicetree/bindings/iommu/r

[PATCH 3/3] iommu/ipmmu-vmsa: Document R-Car D3 IPMMU DT bindings

2017-09-21 Thread Magnus Damm
From: Magnus Damm <damm+rene...@opensource.se> Update the IPMMU DT binding documentation to include the r8a77995 compat string for the IPMMU devices included in the R-Car D3 SoC. Signed-off-by: Magnus Damm <damm+rene...@opensource.se> --- Documentation/devicetree/bindings/iommu/r

[PATCH 0/3] iommu/ipmmu-vmsa: R-Car Gen3 IPMMU DT binding update

2017-09-21 Thread Magnus Damm
for the following SoCs: - R-Car M3-W - R8A7796 - R-Car V3M - R8A77970 - R-Car D3 - R8A77995 Patch 1/3 is ready for upstream merge and includes the following tags: Signed-off-by: Magnus Damm <damm+rene...@opensource.se> Acked-by: Laurent Pinchart <laurent.pinch...@ideasonboard.com> A

[PATCH] iommu/ipmmu-vmsa: Use iommu_device_sysfs_add()/remove()

2017-08-20 Thread Magnus Damm
From: Magnus Damm <damm+rene...@opensource.se> Extend the driver to make use of iommu_device_sysfs_add()/remove() functions to hook up initial sysfs support. Suggested-by: Joerg Roedel <jroe...@suse.de> Signed-off-by: Magnus Damm <damm+rene...@opensource.se> --- Applies on to

[PATCH v2 05/05] iommu/ipmmu-vmsa: Clean up device tracking

2017-07-17 Thread Magnus Damm
Signed-off-by: Robin Murphy <robin.mur...@arm.com> Signed-off-by: Magnus Damm <damm+rene...@opensource.se> --- Change since V1: - New patch drivers/iommu/ipmmu-vmsa.c | 12 1 file changed, 12 deletions(-) --- 0008/drivers/iommu/ipmmu-vmsa.c +++ work/drivers/iommu/ipmmu-

[PATCH v2 04/05] iommu/ipmmu-vmsa: Replace local utlb code with fwspec ids

2017-07-17 Thread Magnus Damm
From: Magnus Damm <damm+rene...@opensource.se> Now when both 32-bit and 64-bit code inside the driver is using fwspec it is possible to replace the utlb handling with fwspec ids that get populated from ->of_xlate(). Suggested-by: Robin Murphy <robin.mur...@arm.com> Signed-off-

[PATCH v2 03/05] iommu/ipmmu-vmsa: Use fwspec on both 32 and 64-bit ARM

2017-07-17 Thread Magnus Damm
ed-off-by: Robin Murphy <robin.mur...@arm.com> Signed-off-by: Magnus Damm <damm+rene...@opensource.se> --- Changes since V1: - Rebased to apply on top of earlier changes in series drivers/iommu/ipmmu-vmsa.c | 21 +++-- 1 file changed, 3 insertions(+), 18 deletions(-) ---

[PATCH v2 02/05] iommu/ipmmu-vmsa: Consistent ->of_xlate() handling

2017-07-17 Thread Magnus Damm
From: Magnus Damm <damm+rene...@opensource.se> The 32-bit ARM code gets updated to make use of ->of_xlate() and the code is shared between 64-bit and 32-bit ARM. The of_device_is_available() check gets dropped since it is included in of_iommu_xlate(). Suggested-by: Robin Murphy &

[PATCH v2 01/05] iommu/ipmmu-vmsa: Use iommu_device_register()/unregister()

2017-07-17 Thread Magnus Damm
From: Magnus Damm <damm+rene...@opensource.se> Extend the driver to make use of iommu_device_register()/unregister() functions together with iommu_device_set_ops() and iommu_set_fwnode(). These used to be part of the earlier posted 64-bit ARM (r8a7795) series but it turns out that thes

[PATCH v2 00/05] iommu/ipmmu-vmsa: 32-bit ARM update V2

2017-07-17 Thread Magnus Damm
ted-by: Robin Murphy <robin.mur...@arm.com> (Patch 2 and 4) Signed-off-by: Robin Murphy <robin.mur...@arm.com> (Patch 3 and 5) Signed-off-by: Magnus Damm <damm+rene...@opensource.se> --- Changes since V1: - Minor changes to patch 1 and 2 - thanks Robin and Geert! - Added patch

[PATCH v4 3/3] iommu/ipmmu-vmsa: Hook up r8a7796 DT matching code

2017-06-19 Thread Magnus Damm
From: Magnus Damm <damm+rene...@opensource.se> Support the r8a7796 IPMMU by sharing feature flags between r8a7795 and r8a7796. Also update IOMMU_OF_DECLARE to hook up the updated compat string. Signed-off-by: Magnus Damm <damm+rene...@opensource.se> Reviewed-by: Geert Uytterhoeven

[PATCH v4 0/3] iommu/ipmmu-vmsa: r8a7796 support V4

2017-06-19 Thread Magnus Damm
for upstream merge and includes the following tags: Signed-off-by: Magnus Damm <damm+rene...@opensource.se> Acked-by: Laurent Pinchart <laurent.pinch...@ideasonboard.com> Acked-by: Rob Herring <r...@kernel.org> Acked-by: Simon Horman <horms+rene...@verge.net.au> Acked-by: Geert

[PATCH v4 1/3] iommu/ipmmu-vmsa: Add r8a7796 DT binding

2017-06-19 Thread Magnus Damm
From: Magnus Damm <damm+rene...@opensource.se> Update the IPMMU DT binding documentation to include the r8a7796 compat string for R-Car M3-W. Signed-off-by: Magnus Damm <damm+rene...@opensource.se> Acked-by: Laurent Pinchart <laurent.pinch...@ideasonboard.com> Acked-

[PATCH v4 2/3] iommu/ipmmu-vmsa: Increase maximum micro-TLBS to 48

2017-06-19 Thread Magnus Damm
From: Magnus Damm <damm+rene...@opensource.se> Bump up the maximum numbers of micro-TLBS to 48. Each IPMMU device instance get micro-TLB assignment via the "iommus" property in DT. Older SoCs tend to use a maximum number of 32 micro-TLBs per IPMMU instance however newer SoCs such

[PATCH v4 09/09] iommu/ipmmu-vmsa: Hook up r8a7795 DT matching code

2017-06-19 Thread Magnus Damm
From: Magnus Damm <damm+rene...@opensource.se> Tie in r8a7795 features and update the IOMMU_OF_DECLARE compat string to include the updated compat string. Signed-off-by: Magnus Damm <damm+rene...@opensource.se> --- Changes since V3: - Rebased code on top of [PATCH 00/04] iomm

[PATCH v4 08/09] iommu/ipmmu-vmsa: Allow two bit SL0

2017-06-19 Thread Magnus Damm
From: Magnus Damm <damm+rene...@opensource.se> Introduce support for two bit SL0 bitfield in IMTTBCR by using a separate feature flag. Signed-off-by: Magnus Damm <damm+rene...@opensource.se> --- Changes since V3: - None Changes since V2: - None Changes since V1: - None d

[PATCH v4 06/09] iommu/ipmmu-vmsa: Write IMCTR twice

2017-06-19 Thread Magnus Damm
From: Magnus Damm <damm+rene...@opensource.se> Write IMCTR both in the root device and the leaf node. To allow access of IMCTR introduce the following function: - ipmmu_ctx_write_all() While at it also rename context functions: - ipmmu_ctx_read() -> ipmmu_ctx_read_root() - ipmmu_

[PATCH v4 07/09] iommu/ipmmu-vmsa: Make IMBUSCTR setup optional

2017-06-19 Thread Magnus Damm
From: Magnus Damm <damm+rene...@opensource.se> Introduce a feature to allow opt-out of setting up IMBUSCR. The default case is unchanged. Signed-off-by: Magnus Damm <damm+rene...@opensource.se> --- Changes since V3: - None Changes since V2: - None Changes since V1: - Update

[PATCH v4 03/09] iommu/ipmmu-vmsa: Enable multi context support

2017-06-19 Thread Magnus Damm
From: Magnus Damm <damm+rene...@opensource.se> Add support for up to 8 contexts. Each context is mapped to one domain. One domain is assigned one or more slave devices. Contexts are allocated dynamically and slave devices are grouped together based on which IPMMU device they are con

[PATCH v4 04/09] iommu/ipmmu-vmsa: Make use of IOMMU_OF_DECLARE()

2017-06-19 Thread Magnus Damm
From: Magnus Damm <damm+rene...@opensource.se> Hook up IOMMU_OF_DECLARE() support in case CONFIG_IOMMU_DMA is enabled. The only current supported case for 32-bit ARM is disabled, however for 64-bit ARM usage of OF is required. Signed-off-by: Magnus Damm <damm+rene...@opensource.se> -

[PATCH v4 00/09] iommu/ipmmu-vmsa: r8a7795 support V4

2017-06-19 Thread Magnus Damm
se of iommu_device_* functions - Patch 5/9 sets the mask to 40 bits instead of 64 bits - Patch 9/9 implements white list handling via ->xlate() and fixes a bug Signed-off-by: Magnus Damm <damm+rene...@opensource.se> --- Developed on top of next-20170614 with the following series applied [PA

[PATCH v4 01/09] iommu/ipmmu-vmsa: Introduce features, break out alias

2017-06-19 Thread Magnus Damm
From: Magnus Damm <damm+rene...@opensource.se> Introduce struct ipmmu_features to track various hardware and software implementation changes inside the driver for different kinds of IPMMU hardware. Add use_ns_alias_offset as a first example of a feature to control if the secure registe

[PATCH v4 02/09] iommu/ipmmu-vmsa: Add optional root device feature

2017-06-19 Thread Magnus Damm
From: Magnus Damm <damm+rene...@opensource.se> Add root device handling to the IPMMU driver by allowing certain DT compat strings to enable has_cache_leaf_nodes that in turn will support both root devices with interrupts and leaf devices that face the actual IPMMU consumer devices. Sign

Re: [PATCH 04/04] iommu/ipmmu-vmsa: Replace local utlb code with fwspec ids

2017-06-16 Thread Magnus Damm
Hi Geert, On Fri, Jun 16, 2017 at 4:18 PM, Geert Uytterhoeven <ge...@linux-m68k.org> wrote: > Hi Magnus, > > On Thu, Jun 15, 2017 at 12:29 PM, Magnus Damm <magnus.d...@gmail.com> wrote: >> Now when both 32-bit and 64-bit code inside the driver is using >> fwspec i

[PATCH 04/04] iommu/ipmmu-vmsa: Replace local utlb code with fwspec ids

2017-06-15 Thread Magnus Damm
From: Magnus Damm <damm+rene...@opensource.se> Now when both 32-bit and 64-bit code inside the driver is using fwspec it is possible to replace the utlb handling with fwspec ids that get populated from ->of_xlate(). Suggested-by: Robin Murphy <robin.mur...@arm.com> Signed-off-

[PATCH 02/04] iommu/ipmmu-vmsa: Consistent ->of_xlate() handling

2017-06-15 Thread Magnus Damm
From: Magnus Damm <damm+rene...@opensource.se> The 32-bit ARM code gets updated to make use of ->of_xlate() and the code is shared between 64-bit and 32-bit ARM. The of_device_is_available() check gets dropped since it is included in of_iommu_xlate(). Suggested-by: Robin Murphy &

[PATCH 03/04] iommu/ipmmu-vmsa: Use fwspec on both 32 and 64-bit ARM

2017-06-15 Thread Magnus Damm
ed-off-by: Robin Murphy <robin.mur...@arm.com> Signed-off-by: Magnus Damm <damm+rene...@opensource.se> --- drivers/iommu/ipmmu-vmsa.c | 21 +++-- 1 file changed, 3 insertions(+), 18 deletions(-) --- 0010/drivers/iommu/ipmmu-vmsa.c +++ work/drivers/iommu/ipmmu-vmsa.c

[PATCH 01/04] iommu/ipmmu-vmsa: Use iommu_device_register()/unregister()

2017-06-15 Thread Magnus Damm
From: Magnus Damm <damm+rene...@opensource.se> Extend the driver to make use of iommu_device_register()/unregister() functions together with iommu_device_set_ops() and iommu_set_fwnode(). These used to be part of the earlier posted 64-bit ARM (r8a7795) series but it turns out that thes

[PATCH 00/04] iommu/ipmmu-vmsa: 32-bit ARM update

2017-06-15 Thread Magnus Damm
by: Robin Murphy <robin.mur...@arm.com> (Patch 3) Signed-off-by: Magnus Damm <damm+rene...@opensource.se> --- Developed on renesas-drivers-2017-06-13-v4.12-rc5 and rebased to next-20170614 drivers/iommu/ipmmu-vmsa.c | 186 +++- 1 file c

Re: [PATCH/RFC] iommu: Move over to unsigned int domain type

2017-05-17 Thread Magnus Damm
Hi Joerg, On Wed, May 17, 2017 at 10:18 PM, Joerg Roedel <j...@8bytes.org> wrote: > On Wed, May 17, 2017 at 07:29:12PM +0900, Magnus Damm wrote: >> From: Magnus Damm <damm+rene...@opensource.se> >> >> Checkpatch dislikes the type unsigned, so update the iommu &g

Re: [PATCH v8 06/08] iommu/ipmmu-vmsa: Use fwspec iommu_priv on ARM64

2017-05-17 Thread Magnus Damm
Hi Robin, On Wed, May 17, 2017 at 11:29 PM, Robin Murphy <robin.mur...@arm.com> wrote: > Hi Magnus, > > On 17/05/17 11:07, Magnus Damm wrote: >> From: Magnus Damm <damm+rene...@opensource.se> >> >> Convert from archdata to iommu_priv via iommu_fwspec on AR

[PATCH/RFC] iommu: Move over to unsigned int domain type

2017-05-17 Thread Magnus Damm
From: Magnus Damm <damm+rene...@opensource.se> Checkpatch dislikes the type unsigned, so update the iommu domain type and consumers to use unsigned int to reduce noise. $ ./scripts/checkpatch.pl ../linux-v4.13-pre-drivers-iommu-ipmmu-dma-ops-20170517b.patch WARNING: Prefer 'unsign

[PATCH v8 07/08] iommu/ipmmu-vmsa: Drop LPAE Kconfig dependency

2017-05-17 Thread Magnus Damm
From: Magnus Damm <damm+rene...@opensource.se> Neither the ARM page table code enabled by IOMMU_IO_PGTABLE_LPAE nor the IPMMU_VMSA driver actually depends on ARM_LPAE, so get rid of the dependency. Tested with ipmmu-vmsa on r8a7794 ALT and a kernel config using: # CONFIG_ARM_LPAE is n

[PATCH v8 08/08] iommu/ipmmu-vmsa: Fix pgsize_bitmap semicolon typo

2017-05-17 Thread Magnus Damm
From: Magnus Damm <damm+rene...@opensource.se> Fix comma-instead-of-semicolon typo error present in the latest version of the IPMMU driver. Signed-off-by: Magnus Damm <damm+rene...@opensource.se> --- Earlier posted as: [PATCH] iommu/ipmmu-vmsa: Fix pgsize_bitmap semicolon typo d

[PATCH v8 06/08] iommu/ipmmu-vmsa: Use fwspec iommu_priv on ARM64

2017-05-17 Thread Magnus Damm
From: Magnus Damm <damm+rene...@opensource.se> Convert from archdata to iommu_priv via iommu_fwspec on ARM64 but let 32-bit ARM keep on using archdata for now. Once the 32-bit ARM code and the IPMMU driver is able to move over to CONFIG_IOMMU_DMA=y then coverting to fwspec via ->

[PATCH v8 04/08] iommu/ipmmu-vmsa: Break out domain allocation code

2017-05-17 Thread Magnus Damm
From: Magnus Damm <damm+rene...@opensource.se> Break out the domain allocation code into a separate function. This is preparation for future code sharing. Signed-off-by: Magnus Damm <damm+rene...@opensource.se> Reviewed-by: Joerg Roedel <jroe...@suse.de> Reviewed-by: Geert U

[PATCH v8 01/08] iommu/ipmmu-vmsa: Remove platform data handling

2017-05-17 Thread Magnus Damm
From: Magnus Damm <damm+rene...@opensource.se> The IPMMU driver is using DT these days, and platform data is no longer used by the driver. Remove unused code. Signed-off-by: Magnus Damm <damm+rene...@opensource.se> Reviewed-by: Laurent Pinchart <laurent.pinch...@ideasonboar

[PATCH v8 00/08] iommu/ipmmu-vmsa: IPMMU multi-arch update V8

2017-05-17 Thread Magnus Damm
ial series - Updated bitmap code locking and also used lighter bitop functions - Updated the Kconfig bits to apply on top of ARCH_RENESAS Signed-off-by: Magnus Damm <damm+rene...@opensource.se> --- Developed on top of a95cfad (v4.12-rc1 + fixes): Compile tested on 32-bit and 64-bit ARM

[PATCH v8 02/08] iommu/ipmmu-vmsa: Rework interrupt code and use bitmap for context

2017-05-17 Thread Magnus Damm
From: Magnus Damm <damm+rene...@opensource.se> Introduce a bitmap for context handing and convert the interrupt routine to handle all registered contexts. At this point the number of contexts are still limited. Also remove the use of the ARM specific mapping variable from ipmmu_irq() to

[PATCH v8 05/08] iommu/ipmmu-vmsa: Add new IOMMU_DOMAIN_DMA ops

2017-05-17 Thread Magnus Damm
From: Magnus Damm <damm+rene...@opensource.se> Introduce an alternative set of iommu_ops suitable for 64-bit ARM as well as 32-bit ARM when CONFIG_IOMMU_DMA=y. Also adjust the Kconfig to depend on ARM or IOMMU_DMA. Initialize the device from ->xlate() when CONFIG_IOMMU_DMA=y. S

[PATCH v8 03/08] iommu/ipmmu-vmsa: Break out utlb parsing code

2017-05-17 Thread Magnus Damm
From: Magnus Damm <damm+rene...@opensource.se> Break out the utlb parsing code and dev_data allocation into a separate function. This is preparation for future code sharing. Signed-off-by: Magnus Damm <damm+rene...@opensource.se> Reviewed-by: Joerg Roedel <jroe...@suse.de> ---

Re: [PATCH V8 07/11] iommu: of: Handle IOMMU lookup failure with deferred probing or error

2017-05-17 Thread Magnus Damm
Hi Geert, everyone, On Fri, May 5, 2017 at 10:23 PM, Geert Uytterhoeven wrote: > Hi Sricharan, Robin, > > On Wed, May 3, 2017 at 12:24 PM, Sricharan R wrote: >> On 5/3/2017 3:24 PM, Robin Murphy wrote: >>> On 02/05/17 19:35, Geert Uytterhoeven

[PATCH] iommu/ipmmu-vmsa: Fix pgsize_bitmap semicolon typo

2017-04-20 Thread Magnus Damm
From: Magnus Damm <damm+rene...@opensource.se> Fix comman-instead-of-semicolon typo error present in the latest version of the IPMMU driver. Will in the future be rolled into next driver update. Signed-off-by: Magnus Damm <damm+rene...@opensource.se> --- Applies on top of renesas-

[PATCH v3 2/3] iommu/ipmmu-vmsa: Increase maximum micro-TLBS to 48

2017-03-11 Thread Magnus Damm
From: Magnus Damm <damm+rene...@opensource.se> Bump up the maximum numbers of micro-TLBS to 48. Each IPMMU device instance get micro-TLB assignment via the "iommus" property in DT. Older SoCs tend to use a maximum number of 32 micro-TLBs per IPMMU instance however newer SoCs such

[PATCH v3 3/3] iommu/ipmmu-vmsa: Hook up r8a7796 DT matching code

2017-03-11 Thread Magnus Damm
From: Magnus Damm <damm+rene...@opensource.se> Support the r8a7796 IPMMU by sharing feature flags between r8a7795 and r8a7796. Also update IOMMU_OF_DECLARE to hook up the updated compat string. Signed-off-by: Magnus Damm <damm+rene...@opensource.se> --- Changes since V2: - Update

[PATCH v3 0/3] iommu/ipmmu-vmsa: r8a7796 support V3

2017-03-11 Thread Magnus Damm
Changes since V1: - Patch 1/3 updated with more Acked-by tags - Patch 2/3 updated with high I/O register range support Patch 1/3 is ready for upstream merge and includes the following tags: Signed-off-by: Magnus Damm <damm+rene...@opensource.se> Acked-by: Laurent Pinchart <laur

[PATCH v3 1/3] iommu/ipmmu-vmsa: Add r8a7796 DT binding

2017-03-11 Thread Magnus Damm
From: Magnus Damm <damm+rene...@opensource.se> Update the IPMMU DT binding documentation to include the r8a7796 compat string for R-Car M3-W. Signed-off-by: Magnus Damm <damm+rene...@opensource.se> Acked-by: Laurent Pinchart <laurent.pinch...@ideasonboard.com> Acked-

Re: [PATCH v3 02/09] iommu/ipmmu-vmsa: Add optional root device feature

2017-03-08 Thread Magnus Damm
Hi Geert, On Wed, Mar 8, 2017 at 10:47 PM, Geert Uytterhoeven <ge...@linux-m68k.org> wrote: > Hi Magnus, > > On Wed, Mar 8, 2017 at 12:01 PM, Magnus Damm <magnus.d...@gmail.com> wrote: >> From: Magnus Damm <damm+rene...@opensource.se> >> >> Add root de

Re: [PATCH v3 09/09] iommu/ipmmu-vmsa: Hook up r8a7795 DT matching code

2017-03-08 Thread Magnus Damm
Hi Geert, On Wed, Mar 8, 2017 at 10:58 PM, Geert Uytterhoeven <ge...@linux-m68k.org> wrote: > Hi Magnus, > > On Wed, Mar 8, 2017 at 12:02 PM, Magnus Damm <magnus.d...@gmail.com> wrote: >> From: Magnus Damm <damm+rene...@opensource.se> >> >> Tie in r8a

Re: [PATCH v3 03/09] iommu/ipmmu-vmsa: Enable multi context support

2017-03-08 Thread Magnus Damm
Hi Robin, Thanks for your feedback! On Wed, Mar 8, 2017 at 9:21 PM, Robin Murphy <robin.mur...@arm.com> wrote: > On 08/03/17 11:01, Magnus Damm wrote: >> From: Magnus Damm <damm+rene...@opensource.se> >> >> Add support for up to 8 contexts. Each context is ma

Re: [PATCH v3 01/09] iommu/ipmmu-vmsa: Introduce features, break out alias

2017-03-08 Thread Magnus Damm
Hi Robin, On Wed, Mar 8, 2017 at 8:53 PM, Robin Murphy <robin.mur...@arm.com> wrote: > Hi Magnus, > > On 08/03/17 11:01, Magnus Damm wrote: >> From: Magnus Damm <damm+rene...@opensource.se> >> >> Introduce struct ipmmu_features to track various hardware

Re: [PATCH v3 06/09] iommu/ipmmu-vmsa: Write IMCTR twice

2017-03-08 Thread Magnus Damm
Hi Robin, On Wed, Mar 8, 2017 at 9:34 PM, Robin Murphy <robin.mur...@arm.com> wrote: > On 08/03/17 11:02, Magnus Damm wrote: >> From: Magnus Damm <damm+rene...@opensource.se> >> >> Write IMCTR both in the root device and the leaf node. >> >> Signed-of

Re: [PATCH v3 04/09] iommu/ipmmu-vmsa: Make use of IOMMU_OF_DECLARE()

2017-03-08 Thread Magnus Damm
Hi Geert, On Wed, Mar 8, 2017 at 10:52 PM, Geert Uytterhoeven <ge...@linux-m68k.org> wrote: > Hi Magnus, > > On Wed, Mar 8, 2017 at 12:02 PM, Magnus Damm <magnus.d...@gmail.com> wrote: >> From: Magnus Damm <damm+rene...@opensource.se> >> >&g

Re: [PATCH v7 06/07] iommu/ipmmu-vmsa: ARM and ARM64 archdata access

2017-03-08 Thread Magnus Damm
Hi Robin, On Wed, Mar 8, 2017 at 9:48 PM, Robin Murphy <robin.mur...@arm.com> wrote: > On 07/03/17 03:17, Magnus Damm wrote: >> From: Magnus Damm <damm+rene...@opensource.se> >> >> Not all architectures have an iommu member in their archdata, so >> use

[PATCH v3 08/09] iommu/ipmmu-vmsa: Allow two bit SL0

2017-03-08 Thread Magnus Damm
From: Magnus Damm <damm+rene...@opensource.se> Introduce support for two bit SL0 bitfield in IMTTBCR by using a separate feature flag. Signed-off-by: Magnus Damm <damm+rene...@opensource.se> --- Changes since V2: - None Changes since V1: - None drivers/iommu/ipmmu-v

[PATCH v3 09/09] iommu/ipmmu-vmsa: Hook up r8a7795 DT matching code

2017-03-08 Thread Magnus Damm
From: Magnus Damm <damm+rene...@opensource.se> Tie in r8a7795 features and update the IOMMU_OF_DECLARE compat string to include the updated compat string. TODO: - Consider making use of iommu_fwspec_add_ids() for uTLB handling Needed to coexist with non-OF R-Car Gen2 somehow... -

[PATCH v3 07/09] iommu/ipmmu-vmsa: Make IMBUSCTR setup optional

2017-03-08 Thread Magnus Damm
From: Magnus Damm <damm+rene...@opensource.se> Introduce a feature to allow opt-out of setting up IMBUSCR. The default case is unchanged. Signed-off-by: Magnus Damm <damm+rene...@opensource.se> --- Changes since V2: - None Changes since V1: - Updated the commit message - Re

[PATCH v3 06/09] iommu/ipmmu-vmsa: Write IMCTR twice

2017-03-08 Thread Magnus Damm
From: Magnus Damm <damm+rene...@opensource.se> Write IMCTR both in the root device and the leaf node. Signed-off-by: Magnus Damm <damm+rene...@opensource.se> --- Changes since V2: - None Changes since V1: - None drivers/iommu/ipmmu-vmsa.c | 17 ++--- 1 file

[PATCH v3 05/09] iommu/ipmmu-vmsa: IPMMU device is 40-bit bus master

2017-03-08 Thread Magnus Damm
From: Magnus Damm <damm+rene...@opensource.se> The r8a7795 IPMMU supports 40-bit bus mastering. Both the coherent DMA mask and the streaming DMA mask are set to unlock the 40-bit address space for coherent allocations and streaming operations. Signed-off-by: Magnus Damm <

[PATCH v3 04/09] iommu/ipmmu-vmsa: Make use of IOMMU_OF_DECLARE()

2017-03-08 Thread Magnus Damm
From: Magnus Damm <damm+rene...@opensource.se> Hook up IOMMU_OF_DECLARE() support in case CONFIG_IOMMU_DMA is enabled. The only current supported case for 32-bit ARM is disabled, however for 64-bit ARM usage of OF is required. Signed-off-by: Magnus Damm <damm+rene...@opensource.se> -

[PATCH v3 03/09] iommu/ipmmu-vmsa: Enable multi context support

2017-03-08 Thread Magnus Damm
From: Magnus Damm <damm+rene...@opensource.se> Add support for up to 8 contexts. Each context is mapped to one domain. One domain is assigned one or more slave devices. Contexts are allocated dynamically and slave devices are grouped together based on which IPMMU device they are con

[PATCH v3 02/09] iommu/ipmmu-vmsa: Add optional root device feature

2017-03-08 Thread Magnus Damm
From: Magnus Damm <damm+rene...@opensource.se> Add root device handling to the IPMMU driver by allowing certain DT compat strings to enable has_cache_leaf_nodes that in turn will support both root devices with interrupts and leaf devices that face the actual IPMMU consumer devices. Sign

[PATCH v3 00/09] iommu/ipmmu-vmsa: r8a7795 support V3

2017-03-08 Thread Magnus Damm
multi-arch update V7 Changes since V2: - Patch 2/9 has been updated with a bug fix and to supply __ipmmu_find_root() - Patch 4/9 now makes use of iommu_device_* functions - Patch 5/9 sets the mask to 40 bits instead of 64 bits - Patch 9/9 implements white list handling via ->xlate() and fixes

[PATCH v7 07/07] iommu/ipmmu-vmsa: Drop LPAE Kconfig dependency

2017-03-06 Thread Magnus Damm
From: Magnus Damm <damm+rene...@opensource.se> Neither the ARM page table code enabled by IOMMU_IO_PGTABLE_LPAE nor the IPMMU_VMSA driver actually depends on ARM_LPAE, so get rid of the dependency. Tested with ipmmu-vmsa on r8a7794 ALT and a kernel config using: # CONFIG_ARM_LPAE is n

[PATCH v7 05/07] iommu/ipmmu-vmsa: Add new IOMMU_DOMAIN_DMA ops

2017-03-06 Thread Magnus Damm
From: Magnus Damm <damm+rene...@opensource.se> Introduce an alternative set of iommu_ops suitable for 64-bit ARM as well as 32-bit ARM when CONFIG_IOMMU_DMA=y. Also adjust the Kconfig to depend on ARM or IOMMU_DMA. Initialize the device from ->xlate() when CONFIG_IOMMU_DMA=y. S

[PATCH v7 06/07] iommu/ipmmu-vmsa: ARM and ARM64 archdata access

2017-03-06 Thread Magnus Damm
From: Magnus Damm <damm+rene...@opensource.se> Not all architectures have an iommu member in their archdata, so use #ifdefs support build with COMPILE_TEST on any architecture. Signed-off-by: Magnus Damm <damm+rene...@opensource.se> Reviewed-by: Joerg Roedel <jroe...@suse.de>

[PATCH v7 02/07] iommu/ipmmu-vmsa: Rework interrupt code and use bitmap for context

2017-03-06 Thread Magnus Damm
From: Magnus Damm <damm+rene...@opensource.se> Introduce a bitmap for context handing and convert the interrupt routine to handle all registered contexts. At this point the number of contexts are still limited. Also remove the use of the ARM specific mapping variable from ipmmu_irq() to

[PATCH v7 04/07] iommu/ipmmu-vmsa: Break out domain allocation code

2017-03-06 Thread Magnus Damm
From: Magnus Damm <damm+rene...@opensource.se> Break out the domain allocation code into a separate function. This is preparation for future code sharing. Signed-off-by: Magnus Damm <damm+rene...@opensource.se> Reviewed-by: Joerg Roedel <jroe...@suse.de> --- Changes since V6:

[PATCH v7 03/07] iommu/ipmmu-vmsa: Break out utlb parsing code

2017-03-06 Thread Magnus Damm
From: Magnus Damm <damm+rene...@opensource.se> Break out the utlb parsing code and dev_data allocation into a separate function. This is preparation for future code sharing. Signed-off-by: Magnus Damm <damm+rene...@opensource.se> Reviewed-by: Joerg Roedel <jroe...@suse.de> ---

[PATCH v7 00/07] iommu/ipmmu-vmsa: IPMMU multi-arch update V7

2017-03-06 Thread Magnus Damm
ial series - Updated bitmap code locking and also used lighter bitop functions - Updated the Kconfig bits to apply on top of ARCH_RENESAS Signed-off-by: Magnus Damm <damm+rene...@opensource.se> --- Built on top v4.11-rc1: drivers/iommu/Kconfig |2 drivers/iommu/ipmmu-vmsa

[PATCH v7 01/07] iommu/ipmmu-vmsa: Remove platform data handling

2017-03-06 Thread Magnus Damm
From: Magnus Damm <damm+rene...@opensource.se> The IPMMU driver is using DT these days, and platform data is no longer used by the driver. Remove unused code. Signed-off-by: Magnus Damm <damm+rene...@opensource.se> Reviewed-by: Laurent Pinchart <laurent.pinch...@ideasonboar

Re: [PATCH/RFC v2 0/4] iommu/ipmmu-vmsa: IPMMU slave device whitelist V2

2017-03-06 Thread Magnus Damm
On Fri, Jan 27, 2017 at 3:14 PM, Magnus Damm <magnus.d...@gmail.com> wrote: > iommu/ipmmu-vmsa: IPMMU slave device whitelist V2 > > [PATCH/RFC v2 1/4] iommu/of: Skip IOMMU devices disabled in DT > [PATCH/RFC v2 2/4] iommu/ipmmu-vmsa: Get rid of disabled device check > [PA

Re: [PATCH v2 2/3] iommu/ipmmu-vmsa: Increase maximum micro-TLBS to 48

2017-01-30 Thread Magnus Damm
Hi Joerg, On Fri, Jan 27, 2017 at 8:47 PM, Joerg Roedel <j...@8bytes.org> wrote: > On Mon, Jan 23, 2017 at 08:40:29PM +0900, Magnus Damm wrote: >> From: Magnus Damm <damm+rene...@opensource.se> >> >> Bump up the maximum numbers of micro-TLBS to 48. >> >

[PATCH/RFC] iommu/dma: Per-domain flag to control size-alignment

2017-01-26 Thread Magnus Damm
From: Magnus Damm <damm+rene...@opensource.se> Introduce the flag "no_size_align" to allow disabling size-alignment on a per-domain basis. This follows the suggestion by the comment in the code, however a per-device control may be preferred? Needed to make virtual space contig

[PATCH/RFC v2 3/4] iommu/ipmmu-vmsa: Opt-in slave devices based on ES version

2017-01-26 Thread Magnus Damm
From: Magnus Damm <damm+rene...@opensource.se> Match on r8a7795 ES2 and enable a certain DMA controller. In other cases the IPMMU driver remains disabled. Signed-off-by: Magnus Damm <damm+rene...@opensource.se> --- Changes since V1: - Perform white list check in ->

[PATCH/RFC v2 1/4] iommu/of: Skip IOMMU devices disabled in DT

2017-01-26 Thread Magnus Damm
From: Magnus Damm <damm+rene...@opensource.se> Extend the shared IOMMU code to skip over ->xlate() in case the IOMMU device pointed to by a slave device has been disabled in DT. Difficult to trigger in case a single IOMMU device is used, however when multiple IOMMUs are used and som

[PATCH/RFC v2 3/4] iommu/ipmmu-vmsa: Check devices in xlate()

2017-01-26 Thread Magnus Damm
From: Magnus Damm <damm+rene...@opensource.se> Rework the IPMMU code to validate devices in ->xlate() instead of accepting all devices in xlate() and instead validating devices in ->add_device(). This makes it possible for the IPMMU device driver to reject slave devices based on sof

[PATCH/RFC v2 2/4] iommu/ipmmu-vmsa: Get rid of disabled device check

2017-01-26 Thread Magnus Damm
From: Magnus Damm <damm+rene...@opensource.se> Since of_iommu_configure() now skips over disabled devices we can simply drop this check in the IPMMU driver. Signed-off-by: Magnus Damm <damm+rene...@opensource.se> --- drivers/iommu/ipmmu-vmsa.c |7 --- 1 file changed,

[PATCH/RFC v2 0/4] iommu/ipmmu-vmsa: IPMMU slave device whitelist V2

2017-01-26 Thread Magnus Damm
he future if agreed on be rolled into the IPMMU driver series. Signed-off-by: Magnus Damm <damm+rene...@opensource.se> --- Developed on top of renesas-drivers-2017-01-24-v4.10-rc5 drivers/iommu/ipmmu-vmsa.c | 59 +++- drivers/iommu/of_iommu.c |2 -

Re: [PATCH/RFC] iommu/ipmmu-vmsa: Restrict IOMMU Domain Geometry to 32-bit address space

2017-01-26 Thread Magnus Damm
Hi Geert, On Thu, Jan 26, 2017 at 6:53 PM, Geert Uytterhoeven wrote: > Currently, the IPMMU/VMSA driver supports 32-bit I/O Virtual Addresses > only, and thus sets io_pgtable_cfg.ias = 32. However, it doesn't force > a 32-bit IOVA space through the IOMMU Domain

Re: [PATCH/RFC 3/4] iommu: dma: iommu iova domain reset

2017-01-25 Thread Magnus Damm
Hi Robin, Shimoda-san, everyone, Thanks for your feedback! On Thu, Jan 26, 2017 at 1:38 AM, Robin Murphy <robin.mur...@arm.com> wrote: > On 25/01/17 12:54, Yoshihiro Shimoda wrote: >> From: Magnus Damm <damm+rene...@opensource.se> >> >> To add a workaround code

Re: [PATCH/RFC 1/4] iommu: dma: track mapped iova

2017-01-25 Thread Magnus Damm
Hi Robin, Shimoda-san, everyone, On Thu, Jan 26, 2017 at 1:27 AM, Robin Murphy <robin.mur...@arm.com> wrote: > On 25/01/17 12:53, Yoshihiro Shimoda wrote: >> From: Magnus Damm <damm+rene...@opensource.se> >> >> To track mapped iova for a workaround code in the fu

Re: [PATCH/RFC 1/2] arm64: mm: Silently allow devices lacking IOMMU group

2017-01-25 Thread Magnus Damm
Hi Robin, On Mon, Jan 23, 2017 at 9:34 PM, Robin Murphy <robin.mur...@arm.com> wrote: > Hi Magnus, > > On 23/01/17 12:12, Magnus Damm wrote: >> From: Magnus Damm <damm+rene...@opensource.se> >> >> Consider failure of iommu_get_domain_for_dev() as non

Re: [PATCH/RFC 2/2] iommu/ipmmu-vmsa: Opt-in slave devices based on ES version

2017-01-24 Thread Magnus Damm
Hi Geert, On Mon, Jan 23, 2017 at 9:50 PM, Geert Uytterhoeven <ge...@linux-m68k.org> wrote: > Hi Magnus, > > On Mon, Jan 23, 2017 at 1:12 PM, Magnus Damm <magnus.d...@gmail.com> wrote: >> From: Magnus Damm <damm+rene...@opensource.se> >> >> Match on r8

[PATCH/RFC 2/2] iommu/ipmmu-vmsa: Opt-in slave devices based on ES version

2017-01-23 Thread Magnus Damm
From: Magnus Damm <damm+rene...@opensource.se> Match on r8a7795 ES2 and enable a certain DMA controller. In other cases the IPMMU driver remains disabled. Signed-off-by: Magnus Damm <damm+rene...@opensource.se> --- drivers/iommu/ipmmu-vmsa.c | 24 1 file

[PATCH/RFC 1/2] arm64: mm: Silently allow devices lacking IOMMU group

2017-01-23 Thread Magnus Damm
From: Magnus Damm <damm+rene...@opensource.se> Consider failure of iommu_get_domain_for_dev() as non-critical and get rid of the warning printout. This allows IOMMU properties to be included in the DTB even though the kernel is configured with CONFIG_IOMMU_API=n or in case a particular

  1   2   3   >