Options for ARM SMMUs

On ARM boards, IOMMUs are known as SMMUs; a smmuman service running on the hardware needs a support library for the board SMMUs.

The configurations described here are for use with the smmu-armsmmu.so and smmu-armsmmu-safety.so support libraries for ARM SMMUs. These support libraries implement the code to communicate with ARM SMMUs, as specified in Chapter 16 of System Memory Management Unit Architecture Specification: SMMU architecture version 2.0 (2016) ARM IHI 0062D.c (ID070116). ARM Ltd, 2012-16.

To load one of these support libraries you must set the smmu option's smmu_type argument to the name of the support library:

Note: If you are using Renesas R-Car boards with IPMMUs, see Options for Renesas R-Car IPMMUs below.

Options

The following describes the options for a smmuman service using a smmu-armsmmu.so or smmu-armsmmu-safety.so support library.

smmu_type_parm

On boards that use the ARM SMMU architecture, the smmu_type_parm argument requires no further arguments. For example:

smmu armsmmu

where smmu-armsmmu[-safety].so is the name of the architecture-specific support library.

smmu_unit_parm

On boards that use the ARM SMMU architecture, the syntax for smmu_unit_parm is as follows:

paddr,NScIrpt,NSgIrpt,bypass[,res_sid[,cfg_dll]]
paddr
The physical address of the main memory SMMU registers.
NScIrpt
The interrupt number to use for context faults.
NSgIrpt
The interrupt number to use for global faults.
bypass
Bypass unidentified streams. Set to 1 (one) to bypass unidentified streams; set to 0 (zero) to not bypass unidentifed streams (see Board-specific configuration libraries below).
res_sid
Optional. A list of StreamIDs reserved for the system. Entries in the list must be separated by a colon (e.g., 4:5).
cfg_dll
Optional. The base name for the board-specific configuration DLL (see Board-specific configuration libraries below).

For example, the following shows how the smmu_unit_parm argument might be used for an i.MX8 board:

unit mmu500 0x51400000,64,66,1,4:5:16,imx8

where mmu500 is the name assigned to the SMMU unit in the configuration (see Global options), 0x514000000 is the physical address of the SMMU unit registers, 64 is the number of the interrupt to assert when a context fault occurs, 66 is the number of the interrupt to assert when a global fault occurs, 1 instructs smmuman to bypass unidentified streams, 4:5:16 specifies that StreamIDs 4, 5 and 16 are reserved for the system, and imx8 instructs smmuman to load the smmu-cfg-imx8.so library.

smmu_use_param

On boards with ARM SMMU architectures, the syntax for smmu_use_parm is as follows:

smmu_use_param sid
sid
The ID of the stream (StreamID in ARM nomenclature) the device uses to perform the transaction.
Set to * to set the StreamID at runtime. If you set StreamIDs at runtime, you must use smmu_unit_parm res_sid to identify StreamIDs that are reserved and therefore can't be used when setting a StreamID at runtime.

For example, the following shows how the smmu_use_parm argument might be used for an i.MX8 board, with the StreamID set in the configuration:

device mem:0x5b040000 use mmu500 9

where mmu500 is the name assigned to the SMMU unit in the configuration, and 9 is the StreamID.

The following shows how the smmu_unit_parm and smmu_use_param arguments might be uses for an i.MX8 board, with the StreamID set at runtime:

StreamID set at runtime

The following shows part of the configuration for an i.MX8 board, with the StreamID for a device set at runtime:

## StreamID is 0 is reserved for bypass.
smmu smmu-armsmmu.so
	unit mmu500 0x51400000,64,66,1,0,imx8
...		
device mem:0x2c000000 use mmu500 *

where smmu smmu-armsmmu.so identifies the architecture-specific support library: unit mmu500 0x51400000,64,66,1,0,imx8 configures the SMMU unit, specifying that StreamID 0 is reserved, and device mem:0x2c000000 use mmu500 * specifies that the StreamID for this device should be set at runtime.

Board-specific configuration libraries

Some boards that use ARM SMMUs require board-specific SMMU settings. If the cfg_dll argument is specified in smmu_unit_param, the smmu-armsmmu.so support library will load the specifed configuration library, which looks after the board-specific settings.

These libraries with board-specific settings are named as follows: smmu-cfg-board.so, where board is the board name.

For example, on NXP i.MX8 platforms, StreamIDs are configurable. Use the smmu_unit_param cfg_dll argument to have smmu-armsmmu.so load the smmu-cfg-imx8.so library, which will set the StreamIDs according to the configuration you specify in the smmuman configuration file.