Skip to main content

Pin multiplexing for drivers

Pin Multiplexing

On i.MX6 BSP the multiplexing of IO pins is configured to match the standard pinout for Colibri and Apalis. For additional devices like extra UARTs not part of the standard pinout, to match the pinout described in the datasheet.
A different multiplexing can be configured in the registry. Registry entries override multiplexing for a specific driver instance or set some multiplexing options as soon as the registry is loaded.

Multiplexing registry entries

It's possible to specify a generic pinout, that applies to all the modules, or a pinout specific for a module form factor (Apalis/Colibri), a specific module (ex: iMX6S256IT) or even a specific version of a specific module. Pinouts are defined using registry keys. All the keys defining a pinout are named "Pinout_" suffix.
The "Pinout_Default" entry is used to specify a pinout that applies to each module.
Each module type and revision is identified by a 8 digits code that is build in the following way:

  • 4 decimal digits for the product type (product number). Currently the following codes are defined:
Module typeCode
Colibir iMX6S 256MB0014
Colibri iMX6DL 512MB0015
Colibri iMX6S 256MB IT0016
Colibri iMX6DL 512MB IT0017
Apalis iMX6Q 1GB0027
Apalis iMX6Q 2GB IT0028
Apalis iMX6D 512MB0029
  • 1 decimal digit for major version
  • 1 decimal digit for minor version
  • 2 decimal digit for variant with 'A' being 0, 'B' being 1 etc.

For example code for an Apalis iMX6Q 1GB V1.1A is 00271100.

It's possible to specify a multiplexing for a specific module (including version) using the Pinout_XXXXXXXX format, using the full 8 digits code. To specify more generic pinout for just a specific module type or for a major-minor combination you can use just the first 4 or 6 digits of the code. You can also create a key for different modules by separating the codes with a comma.

For example:

KeyModules
Pinout_00271100Applies only to IMX6AQ1024 1.1A modules
Pinout_002711Applies only to IMX6AQ1024 1.1 modules, any variant
Pinout_0027,0028,0029Applies to all Apalis modules (Q1025,D512 and Q2048IT) in all versions and variants

The system takes the registry key which matches the the module more precisely. For example if you have a generic entry for Apalis iMX6Q 1GB and a specific one for version 1.1C and your module is Apalis iMX6Q 1GB V1.1C then the specific key is used and the more generic one (any Apalis iMX6Q 1GB module) is ignored. Values are taken from a single key, so if you need to override only a specific pin for a new version you have to copy all the settings from the more generic key to your new entry.

Inside the key it's possible to specify settings for different pins. It's possible to identify a pin using different notations:

NameDescription
gpio_XXXReference a GPIO number, SOC specific
colibripin_XXXReference a Colibri SO-DIMM connector pin number
apalispin_XXXReferences and Apalis MXM connector pin number

The registry entries must be configured as strings and they can contain the following values:

ParameterValuesDescription
altfn-1This is the compatible value to define a GPIO. In the SoC datasheet, there is no AltFn with value -1.
0 to 7Alternate Function 0 to 7. The precise meaning depends on the actual IO.
dirinIO direction is input
outIO direction is output. The real level of the pin cannot be read back.
sionautoConfigure SION bit in the input multiplexer automatically (suggested option for most of the pins)
normalDon't force the input path enabling
forceForce input path enabling
lvl0Set IO level to Logic low (if AltFn=GPIO, and Dir=out or outonly)
1Set IO level to Logic high (if AltFn=GPIO, and Dir=out or outonly)
pullnoneThis is the compatible value to remove all software pullup/down resistors or bus keepers.
upThis is the compatible value to configure a software pullup.
downThis is the compatible value to configure a software pulldown.
up22k22k pull up
up47k47k pull up
up100k100k pull up. "pull=up" and "pull=up100k" are identical.
down100k100k pull down. "pull=down" and "pull=down100k" are identical.
buskeepInstead of a pullup/down resistor, a bus keeper gets enabled
strength0Output driver and pull up/down disabled
1260 Ohm output impedance. This is the reset default value.
2130 Ohm output impedance
390 Ohm output impedance
460 Ohm output impedance
550 Ohm output impedance
640 Ohm output impedance
733 Ohm output impedance
outmodestdStandard output. This is the reset default value
odOpen drain
inmodestdNormal input. This is the reset default value.
schmittSchmitt trigger input
slewslowSlow rising and falling edge. This is the reset default value.
fastFast rising and falling edge.
speedlowIO bandwidth = 50 MHz (low). This is the reset default value
mediumIO bandwidth = 100-150 MHz (medium)
highIO bandwidth = 100-150-200 MHz (high)

For example to configure SODIMM pin 17 of the Colibri module as a GPIO output set to high state you can specify:
"colibripin_17"="altfn=-1 dir=out lvl=1"

Multiplexing for a specific driver

To configure multiplexing for a specific driver you have to put the "Pinout_*" entries under its configuration key. For example to change multiplexing of UART for all modules you can add:
[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\COM2\Pinout_Default]
entry in the registry and configure the corresponding pins.
Adding a Pinout entry will prevent the driver from applying the default pin multiplexing configuration so even if you just need to change the multiplexing of a single pin you'll have to specify the multiplexing for all the other pins managed by the driver.
Setting the wrong multiplexing may prevent the driver from working and may lead to issues.
The new multiplexing will be applied only after you reboot your device.

Multiplexing at boot

Sometimes you may need to configure pins that are not related to a specific driver or you prefer to keep all your multiplexing settings in a single entry. You can add the Pinout_* keys described above under the:
[HKEY_LOCAL_MACHINE\Drivers\Builtin\GPIOMux]
registry key.
This key is processed very early during the OS boot (as soon as registry has been loaded from filesystem). This means a few seconds after power-up but earlier than any driver or application added to the system.
If you override pinout for a device that is controlled by a driver and don't want that the driver applies its default multiplexing you can add a DWORD entry named "DoMultiplexing" under the driver's main configuration key. Setting the "DoMultiplexing" value to 0 will prevent any pin-multipleying configuration from the driver (both default pinout and customized multiplexing using the keys described above). An issue in version 1.0 of the release image affects the GPIOmux driver and prevents it from being loaded, this is going to be fixed in release 1.1 of the image. Multiplexing at boot does not work in version 1.0.



Send Feedback!