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 8M Mini 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 I2C1 port of the i.MX8M Mini CPU:

ConnectCore 8M Mini device tree
&i2c1 {
	mca_cc8m: mca@63 {
		compatible = "digi,mca-cc8m";
		reg = <0x63>;
		interrupt-parent = <&gpio3>;
		interrupts = <8 IRQ_TYPE_LEVEL_HIGH>;
		interrupt-controller;
		#interrupt-cells = <2>;
		fw-update-gpio = <&gpio1 4 GPIO_ACTIVE_LOW>;
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_mca_cc8m>;

		...
	};
};
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.MX8M Mini 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.MX8M Mini processor

Use the following command to display event causes flagged on the last i.MX8M Mini 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 8M Mini 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

Tamper0, Tamper1, Tamper 2, Tamper3

Digital/analog tamper interface

IO0, IO1, IO2, IO3, IO4, 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.

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.