Kernel configuration

You can manage the MCA driver support through the following kernel configuration option:

  • Digi Micro Controller Assist for ConnectCore 8 SoMs (CONFIG_MFD_MCA_CC8)

This option enables support for the core functionality of the MCA and is enabled as built-in on the default ConnectCore 8X kernel configuration file.

Each one of the multi-function drivers implement their own kernel options.

Kernel driver

The MCA core driver is located at:

File Description

drivers/mfd/mca-cc8-core.c

ConnectCore 8 SoMs MCA core driver

drivers/mfd/mca-cc8-i2c.c

ConnectCore 8 SoMs MCA I2C communication driver

drivers/mfd/mca-cc8-irq.c

ConnectCore 8 SoMs MCA interrupt driver

Device tree bindings and customization

The MCA device tree binding is documented at Documentation/devicetree/bindings/mfd/digi,mca-cc8.txt.

The MCA is connected through I2C0 port of the i.MX8QXP CPU:

ConnectCore 8X device tree
&i2c0 {
	mca_cc8x: mca@63 {
		compatible = "digi,mca-cc8x";
		reg = <0x63>;
		interrupt-parent = <&gpio2>;
		interrupts = <10 IRQ_TYPE_LEVEL_HIGH>;
		interrupt-controller;
		#interrupt-cells = <2>;
		fw-update-gpio = <&gpio1 5 GPIO_ACTIVE_LOW>;
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_mca_cc8x>;

		...
	};
};
The MCA device tree node has one sub-node for each multi-function driver it supports.

System status registers

The MCA provides status information about the cause of reset and wake-up events via the sysfs.

Reset cause

Linux provides information about what caused a reset of the MCA microcontroller and i.MX8QXP processor.

This functionality is supported on MCA firmware version 0.04 and later. You can use the sysinfo command to check your MCA firmware version.

MCA microcontroller

Use the following command to display event causes flagged on the last MCA reset:

~# cat /sys/bus/i2c/devices/0-0063/last_mca_reset
Low Voltage, Power On
last_mca_reset value Description

LL Wakeup

Low leakage wakeup

Low Voltage

Low voltage on VCC_MCA

Watchdog

Internal MCA watchdog reset

Reset Pin

Assert of reset pin

Power On

Power on condition

Note that more than one value can be signaled simultaneously.

i.MX8QXP processor

Use the following command to display event causes flagged on the last i.MX8QXP reset:

~# cat /sys/bus/i2c/devices/0-0063/last_mpu_reset
Power On
last_mpu_reset value Description

Power On

Power on condition

System Reset

System reset (system call)

Watchdog

Watchdog driver reset

Off wakeup

Wakeup from power off

MCA reset

An MCA reset (internal watchdog) triggered the MPU reset

Wake-up cause

This functionality is supported on MCA firmware version 0.04 and later. You can use the sysinfo command to check your MCA firmware version.

Linux provides information about which MCA interface woke the system from low power (suspend or power off).

Status registers only include wake-up sources controlled by the MCA. If the CPU is awakened by a peripheral not controlled by the MCA, the status register indicates the wake-up source as CPU regardless of the actual wake-up source.

Use the following command to read the last ConnectCore 8X wake-up reason:

~# cat /sys/bus/i2c/devices/0-0063/last_wakeup_reason
Power IO
last_wakeup_reason value Description

Power IO

Power IO pin. Commonly connected to the power button

Timer

Internal MCA timer

RTC

Real Time Clock Alarm

LP UART

MCA UART (Not available on SOMv1)

Tamper0, Tamper1, Tamper 2, Tamper3

Digital/analog tamper interface

IO0, IO1, IO2, IO3, IO4, IO5, IO6, IO7, IO8, IO9, IO10, IO11, IO12, IO13, IO14, IO15, IO16, IO17, IO18, IO19

Digital/analog IO pin (configured as digital interrupt or analog comparator)

Vcc

Vcc detection interrupt

CPU

Other CPU or PMIC interrupt

MCA NVRAM

This functionality is supported on MCA firmware version 0.08 and later. You can use the sysinfo command to check your MCA firmware version.

The MCA provides 8 bytes of NVRAM memory. This general purpose memory preserves data in power-off mode when the board is connected to mains, or without power only if your board has a coin cell battery.

You can access this memory area through a sysfs file named: /sys/bus/i2c/devices/0-0063/nvram. You can write to the NVRAM by writing directly into the sysfs file using the following command:

~# cd /sys/bus/i2c/devices/0-0063/
~# echo -n "12345678" > nvram

You can read the content memory with the following commands:

~# hexdump -c nvram
0000000 1 2 3 4 5 6 7 8
0000008

If the values are printable, you can also read them with commands like cat:

~# cat nvram
12345678

External 32.768 kHz output

You can configure pad MCA_CLKOUT32K to output a 32.768 kHz signal for clocking external peripherals. The functionality is controlled by a sysfs entry. To enable the 32.768 kHz signal on MCA_CLKOUT32K pad:

~# echo enabled > /sys/bus/i2c/devices/0-0063/ext_32khz

To disable it:

~# echo disabled > /sys/bus/i2c/devices/0-0063/ext_32khz

To read the current status of the pad:

~# cat /sys/bus/i2c/devices/0-0063/ext_32khz
disabled

Voltage reference 1.2 V

You can configure pad MCA_VREF_OUT to output a steady temperature-compensated 1.2 V output to use as a voltage reference for external peripherals.

You can use this signal as reference voltage for the MCA ADC signals. See Analog-to-Digital Converter (ADC) for more information.
This functionality is not available on SOMv1; it’s only available on SOMv2. SOMv2 incorporates a 100 nF capacitor to filter ripple signals in the output that was required to be populated externally by the user on other Digi designs.

The functionality is controlled by a sysfs entry. To enable the voltage reference on MCA_VREF_OUT pad:

~# echo enabled > /sys/bus/i2c/devices/0-0063/vref

To disable it:

~# echo disabled > /sys/bus/i2c/devices/0-0063/vref

To read the current status of the pad:

~# cat /sys/bus/i2c/devices/0-0063/vref
disabled
If you configure the MCA ADC to use the internal 1.2 V voltage reference, the MCA_VREF_OUT pad automatically outputs the signal and sysfs controls have no effect.

SOM boot mode configuration

This functionality is supported on MCA firmware version 0.09 and later. You can use the sysinfo command to check your MCA firmware version. It also requires mca_config_tool version 1.14 or later for configuration.

MCA can be configured to boot the SOM in two different ways:

  • W4PK (wait for power key): The system doesn’t boot until the MCA PWR_IO line is asserted low. This line is commonly connected to the power button.

  • BOP (boot on power): The SOM automatically boots as soon as power is applied. This is the default mode.

This functionality can be configured using mca_config_tool --boot_mode argument.

See MCA configuration tool for additional information on this tool and functionality.