第8章 Linux Kernel Device Driver Specifications
This chapter describes the specifications of the Linux kernel device drivers unique to the Armadillo-400 Series.
It is possible to use a wide range of functionality that is not enabled by default on the Armadillo-400 Series by altering the kernel configuration.
In order to use device drivers not enabled by default on the Armadillo-400 Series, the kernel must be configured by following the steps below.
Select which pins to assign the function to with board options.
When using make menuconfig, board options can be altered under System Type -> Freescale MXC Implementations -> MX25 Options -> Armadillo-400 Board options in the Linux Kernel Configuration.
The board options are designed so that multiple functions cannot be assigned to the same pins. Pins that do not have any specific function assigned to them will be configured as GPIO.
Enable the host (master) device driver.
If required, enable the slave device driver.
If required, add device information to linux-2.6.26-at/arch/arm/mach-mx25/armadillo400.c
.
For information on altering the kernel configuration, please refer to 「Customizing Images」.
The i.MX25 processor incorporates five UART modules, UART1 to UART5. On the Armadillo-400 Series, by default UART2 is used for Serial Interface 1 (CON3), UART3 for Serial Interface 2 (CON9), and UART5 for Serial Interface 3 (CON9). Also, UART3 and UART4 can be assigned to CON11 by altering the kernel configuration. When using UART9 or UART11, CTS/RTS hardware flow control can be selectively enabled or disabled.
The UART driver has the following functionality.
7/8 bit send and receive
1/2 stop bits
None/Odd/Even parity
XON/XOFF software flow control
CTS/RTS hardware flow control
Modem line control
Standard Linux serial API
Max baud rate: 230.4Kbps (Serial Interface 1) / 4Mbps[] (Serial Interface 2, 3)
Each serial interface and their corresponding device files are shown in 表8.1「Serial Interface Device Files」.
表8.1 Serial Interface Device Files
Serial Interface | Device File | Module Used |
---|
Serial Interface 1 |
/dev/ttymxc1
| UART2 |
Serial Interface 2 |
/dev/ttymxc2
| UART3 |
Serial Interface 3 |
/dev/ttymxc4
| UART5 |
Serial Interface 4 |
/dev/ttymxc3
| UART4 |
Kernel configuration options related to the UART functionality are shown in 表8.2「UART Configuration」.
表8.2 UART Configuration
Kernel Configuration Option | Default | Description |
---|
SERIAL_MXC | y |
Enables the i.MX serial driver
|
SERIAL_MXC_CONSOLE | y |
Enables the system console for the i.MX serial driver
|
ARMADILLO400_UART3_CON9 | y |
Enables UART3 on CON9
Uses CON9_3 for UART3_RXD and CON9_5 for UART3_TXD
|
ARMADILLO400_UART3_HW_FLOW_CON9 | n |
Enables hardware flow control for UART3 on CON9
Uses CON9_11 for UART3_RTS and CON9_13 for UART3_CTS
Depends on ARMADILLO400_UART3_CON9
|
ARMADILLO400_UART3_CON11 | n |
Enables UART3 on CON11
Uses CON11_40 for UART3_RXD and CON11_41 for UART3_TXD
Cannot be used with ARMADILLO400_UART3_CON9
|
ARMADILLO400_UART3_HW_FLOW_CON11 | n |
Enables hardware flow control for UART3 on CON11
Uses CON11_42 for UART3_RTS and CON11_43 for UART3_CTS
Depends on ARMADILLO400_UART3_CON11
|
ARMADILLO400_UART4_CON11 | n |
Enables UART4 on CON11
Uses CON11_44 for UART4_RXD and CON11_45 for UART4_TXD
|
ARMADILLO400_UART4_HW_FLOW_CON11 | n |
Enables hardware flow control for UART4 on CON11
Uses CON11_46 for UART4_RTS and CON11_47 for UART4_CTS
Depends on ARMADILLO400_UART4_CON11
|
ARMADILLO400_UART5_CON9 | y |
Enables UART5 on CON9
Uses CON9_4 for UART5_RXD and CON9_6 for UART5_TXD
|
ARMADILLO400_UART5_HW_FLOW_CON9 | n |
Enables hardware flow control for UART5 on CON9
Uses CON9_12 for UART5_RTS and CON9_14 for UART5_CTS
Depends on ARMADILLO400_UART5_CON9
|
The Armadillo-400 Series Ethernet driver has the following functionality.
Auto-negotiation support
Carrier detect support
Ethtool support
The i.MX25 processor incorporates two SD/MMC/SDIO host controllers (eSDHC). On the Armadillo-400 Series, by default eSDHC1 is used for the microSD slot (CON1). Also, eSDHC2 can be assigned to CON9 by altering the kernel configuration.
The Armadillo-400 Series SD/MMC/SDIO host driver has the following functionality.
When a card is inserted in the microSD card slot, it will be registered as /dev/mmcblkN
(N is 0 or 1).
Kernel configuration options related to the SD/MMC/SDIO host functionality are shown in 表8.3「SD/MMC/SDIO Host Controller Configuration」.
表8.3 SD/MMC/SDIO Host Controller Configuration
Kernel Configuration Option | Default | Description |
---|
MMC | y |
Enables Linux kernel MMC/SD/SDIO card support
|
MMC_IMX_ESDHCI | y |
Enables the i.MX25 eSDHC driver
|
ARMADILLO400_SDHC2_CON9 | n |
Enables SDHC2 on CON9
Uses CON9_15 to CON9_24
|
The Armadillo-400 Series USB 2.0 host driver has the following functionality.
EHCI compliant
OTG not supported
USB High Speed host x1
USB Full Speed host x1
When a USB device is detected, it will be mapped to /dev/sd*
.
The video out function on Armadillo-440 is implemented as a frame buffer device.
The frame buffer device driver has the following functionality.
Double-buffer support
Max resolution: SVGA
The default settings on the Armadillo-440 LCD Model are shown below.
The frame buffers and their corresponding device files are shown in 表8.4「Frame Buffer Device Files」.
表8.4 Frame Buffer Device Files
Frame Buffer | Device File |
---|
Background plane |
/dev/fb0
|
Graphic window |
/dev/fb1
|
The LED backlight function on Armadillo-440 is implemented as a backlight class driver.
The backlight can be controlled with the files under the /sys/class/backlight/pwm-backlight
directory.
The brightness can be adjusted with the brightness
file. Write a value between 0 (off) and 255 (full brightness) to the brightness
file to change the brightness.
The current brightness can be obtained by reading the value from the brightness
file.
The backlight on/off can be controlled with the bl_power
file. Write 0 to bl_power
to turn the backlight off and write 1 to turn it back on.
The touchscreen function on Armadillo-440 is implemented as an input device and offers an event interface to userland programs.
The events sent by the interface are shown in 表8.5「Touchscreen Events」.
表8.5 Touchscreen Events
Type | Code | Value |
---|
EV_KEY(1) | BTN_TOUCH(330) | 0 or 1 |
EV_ABS(3) | ABS_X(0) | 100 - 4000 |
EV_ABS(3) | ABS_Y(1) | 100 - 4000 |
EV_ABS(3) | ABS_PRESSURE(24) | 0 or 1 |
On the Armadillo-440 LCD Model, by default the touchscreen event device is mapped to /dev/input/event1
.
![[警告]](images/warning.png) | |
---|
The event device file numbers are determined by the order the input devices are detected. Therefore, if another input device such as a USB keyboard is detected at boot time, the event device number of the touchscreen may change. |
The audio function on the Armadillo-400 Series is implemented as an ALSA device driver. The ALSA device driver has the following functionality.
Playback (2ch) / Capture (1ch)
Sampling rates: 48k, 32k, 24k, 16k, 12k, 8k Hz
Formats: Signed 16/20/24 bit, Little-endian
The audio device can be controlled via the ALSA library (libasound2).
![[警告]](images/warning.png) | |
---|
The Armadillo-400 Series audio driver cannot record and play sound at the same time. |
On the i.MX25, it is possible to select what pins to assign the audio function to with the audio multiplex function. On the Armadillo-400 Series, the audio multiplex settings can be changed in the kernel configuration. By default, the audio multiplexing is set to use AUD6, with the audio function connected to CON11. By altering the configuration, it is possible to connect the audio function to CON9 by using AUD5.
Kernel configuration options related to the audio functionality are shown in 表8.6「Audio Configuration」.
表8.6 Audio Configuration
Kernel Configuration Option | Default | Description |
---|
SOUND | y |
Enables Linux kernel sound card support
|
SND | y |
Enables Linux kernel ALSA support
|
SND_SOC | y |
Enables Linux kernel ASoC support
|
SND_MXC_SOC | y |
Enables driver which provides i.MX audio functionality
|
SND_SOC_ARMADILLO440_WM8978 | y |
Enables driver which provides audio functionality using the WM8978 codec on the Armadillo-400 Series
|
ARMADILLO400_AUD5_CON11 | y |
Assign audio function to CON11
Uses CON11_42 to CON11_47
|
ARMADILLO400_AUD6_CON9 | n |
Assign audio function to CON9
Uses CON9_15, 17, 21, 22, 23, 24
Cannot be used with ARMADILLO400_AUD5_CON11
|
The GPIO on the Armadillo-400 Series are implemented as generic GPIO.
There are two interfaces available to manipulate GPIO from userland: GPIO sysfs and an Armadillo-200 Series compatible GPIO driver. The GPIO sysfs driver is enabled by default.
Pins that do not have any other function assigned to them in the kernel configuration are all set to be GPIO.
With GPIO sysfs, I/O direction and output levels can be set and input levels checked with the files under the /sys/class/gpio/(GPIO_NAME)
directories.
The GPIO_NAME directories and their corresponding GPIO pins are shown in 表8.7「GPIO_NAME and GPIO Pins」.
表8.7 GPIO_NAME and GPIO Pins
GPIO_NAME | GPIO Pin | Initial I/O Direction | Initial Output Level |
---|
CON9_1 | CON9 pin 1 | Input | - |
CON9_2 | CON9 pin 2 | Input | - |
CON9_11 | CON9 pin 11 | Input | - |
CON9_12 | CON9 pin 12 | Input | - |
CON9_13 | CON9 pin 13 | Input | - |
CON9_14 | CON9 pin 14 | Input | - |
CON9_15 | CON9 pin 15 | Input | - |
CON9_16 | CON9 pin 16 | Input | - |
CON9_17 | CON9 pin 17 | Input | - |
CON9_18 | CON9 pin 18 | Input | - |
CON9_21 | CON9 pin 21 | Input | - |
CON9_22 | CON9 pin 22 | Input | - |
CON9_23 | CON9 pin 23 | Input | - |
CON9_24 | CON9 pin 24 | Input | - |
CON9_25 | CON9 pin 25 | Input | - |
CON9_26 | CON9 pin 26 | Input | - |
CON9_27 | CON9 pin 27 | Output | LOW |
CON9_28 | CON9 pin 28 | Output | LOW |
I/O direction configuration is done with the /sys/class/gpio/(GPIO_NAME)/direction
file by writing one of the options shown in 表8.8「GPIO I/O Direction Configuration」. The current configuration can be obtained by reading the value from the direction
file.
表8.8 GPIO I/O Direction Configuration
Configuration | Description |
---|
high | Sets the I/O direction to output and the output level to high. The output level can be obtained and set in this state. |
low | Sets the I/O direction to output and the output level to low. The output level can be obtained and set in this state. |
out | This is the same as setting "low". |
in | Sets the I/O direction to input. The input level can be obtained in this state. |
Output levels can be set and input levels checked with the /sys/class/gpio/(GPIO_NAME)/value
file. A 0 represents a low level and 1 a high level.
Interrupt type configuration is done with the /sys/class/gpio/(GPIO_NAME)/edge
file by writing one of the options shown in 表8.9「GPIO Interrupt Type Configuration」. The current configuration can be obtained by reading the value from the edge
file.
表8.9 GPIO Interrupt Type Configuration
Configuration | Description |
---|
none | Interrupt detection is not performed. |
falling | Falling edge interrupt detection is performed. |
rising | Rising edge interrupt detection is performed. |
both | Both falling edge and rising edge interrupt detection are performed. |
An example of handling GPIO sysfs interrupts in the C language is shown in 図8.1「GPIO sysfs Interrupt Sample Program」. When executed, the sample program sets the I/O direction of CON9_1 to input, the interrupt type to falling edge, and then waits for an interrupt. When an interrupt is detected the level of the GPIO pin at that time is displayed. The program exits after interrupts have been detected three times.
| The interrupt type is set to falling edge by writing "falling" to the edge file. |
| After specifying the interrupt type, the value file is opened. |
| A dummy read is performed once on the value file. Any interrupts occurring after this will be picked up in the polling. |
| The poll or select system call is used to wait for an interrupt to occur. |
| As a dummy read has been performed, in order to obtain the level of the GPIO pin after an interrupt has occurred the lseek system call must be used to return the offset to the start of the file. |
8.9.2. Armadillo-200 Series Compatible GPIO Driver
With the Armadillo-200 Series compatible GPIO driver, GPIO are manipulated by issuing ioctl function calls to the driver specific device file.
![[警告]](images/warning.png) | |
---|
The Armadillo-200 Series compatible GPIO driver is not enabled by default. To enable the driver, in the kernel configuration enable the CONFIG_ARMADILLO2X0_GPIO option after disabling the CONFIG_GPIO_SYSFS option and then rebuild the kernel. |
The GPIO names and corresponding GPIO pins for the Armadillo-200 Series compatible GPIO driver are shown in 表8.10「Armadillo-200 Series Compatible GPIO Driver GPIO List」.
表8.10 Armadillo-200 Series Compatible GPIO Driver GPIO List
GPIO Name | GPIO Pin | Initial I/O Direction | Initial Output Level |
---|
GPIO0 | CON9 pin 21 | Input | - |
GPIO1 | CON9 pin 22 | Input | - |
GPIO2 | CON9 pin 23 | Input | - |
GPIO3 | CON9 pin 24 | Input | - |
GPIO4 | CON9 pin 25 | Input | - |
GPIO5 | CON9 pin 26 | Input | - |
GPIO6 | CON9 pin 27 | Output | LOW |
GPIO7 | CON9 pin 28 | Output | LOW |
GPIO8 | CON9 pin 11 | Input | - |
GPIO9 | CON9 pin 12 | Input | - |
GPIO10 | CON9 pin 13 | Input | - |
GPIO11 | CON9 pin 14 | Input | - |
GPIO12 | CON9 pin 15 | Input | - |
GPIO13 | CON9 pin 16 | Input | - |
GPIO14 | CON9 pin 17 | Input | - |
GPIO15 | CON9 pin 18 | Input | - |
![[警告]](images/warning.png) | |
---|
With the Armadillo-200 Series compatible GPIO driver, the GPIO names and the corresponding GPIO pin positions are the same as those on the Armadillo-200 Series. Because of this, only a subsection of the GPIO available on the Armadillo-400 Series can be used with the Armadillo-200 Series compatible GPIO driver. |
The details of the device file are shown below.
表8.11 Armadillo-200 Series Compatible GPIO Driver Device File
Type | Major Number | Minor Number | Device File |
---|
Character device | 10 | 185 | /dev/gpio |
The file descriptor of the device file is specified as the first argument to ioctl, and the command to manipulate the GPIO is specified as the second argument.
表8.12 Armadillo-200 Series Compatible GPIO Driver ioctl Commands
Command | Description | Third Argument Type |
---|
PARAM_SET | Configure GPIO with the state specified in the third argument | struct gpio_param |
PARAM_GET | Get GPIO state by following the details specified in the third argument | struct gpio_param |
INTERRUPT_WAIT | Wait for GPIO interrupt by following the details specified in the third argument | struct wait_param |
The structures "struct gpio_param" and "struct wait_param" defined in (kernel source)/include/linux/armadillo2x0_gpio.h
are used for the third argument. "struct gpio_param" can be linked with its "next" member to form a singly-linked list in order to control multiple GPIO at once. Be sure to set the "next" member of the last structure of the list to "0 (NULL)". For detailed usage information, please refer to the source code of the GPIO control application (atmark-dist/vendors/AtmarkTechno/Armadillo-440/gpioctrl
).
There are two LED drivers for the Armadillo-400 Series: a LED class driver and an Armadillo-200 Series compatible LED driver. The LED class driver is enabled by default.
The LEDs can be controlled with the files under the /sys/class/leds/(LED_NAME)
directory.
The /sys/class/leds/(LED_NAME)/brightness
file is used to turn the LEDs on and off. Writing 0 to the brightness
file turns the LED off, and writing any other number turns the LED on.
A trigger mechanism is used to control blinking with the LED class driver. The mmc0, timer, heartbeat and default-on triggers can be used on the Armadillo-400 Series. The trigger can be set by writing the respective character string to the /sys/class/leds/(LED_NAME)/trigger
file.
When the mmc0 trigger is set, the LED will blink on and off in time with data accesses to the MMC/SD card.
The timer trigger can be used to have the LED blink at a certain rate. After the timer trigger has been enabled, files /sys/class/leds/(LED_NAME)/delay_on
and /sys/class/leds/(LED_NAME)/delay_off
will be created. The length of time (msec) the LED should stay on for each cycle is written to the first file, and the time (msec) it should stay off for to the second file.
When the heartbeat trigger is set, the LED will blink regularly while the system is running.
When the default-on trigger is set, the LED will remain on continuously while the system is running.
The LED_NAME names and their respective LEDs are shown in 表8.13「LED List」.
表8.13 LED List
LED_NAME | Corresponding LED | Default Trigger |
---|
red | LED3 | None |
green | LED4 | default-on |
yellow | LED5 | None |
8.10.2. Armadillo-200 Series Compatible LED Driver
With the Armadillo-200 Series compatible LED driver, LEDs are manipulated by issuing ioctl function calls to the driver specific device file.
![[警告]](images/warning.png) | |
---|
The Armadillo-200 Series compatible LED driver is not enabled by default. To enable the driver, in the kernel configuration enable the CONFIG_ARMADILLO2X0_LED option after disabling the CONFIG_LEDS_GPIO option and then rebuild the kernel. |
The details of the LED device file are shown below.
表8.14 LED Node
Type | Major Number | Minor Number | Device File |
---|
Character device | 10 | 215 | /dev/led |
The file descriptor of the device file is specified as the first argument to ioctl, and the command to manipulate the LEDs is specified as the second argument.
表8.15 LED Manipulation Commands
Command | Description | Third Argument Type |
---|
LED_RED_ON | Turn LED3 (red) on | None |
LED_RED_OFF | Turn LED3 (red) off | None |
LED_RED_STATUS | Obtain state of LED3 (red) | Buffer to store state (1 byte min) |
LED_RED_BLINKON | Start LED3 (red) blinking | None |
LED_RED_BLINKOFF | Stop LED3 (red) blinking | None |
LED_RED_BLINKSTATUS | Obtain blinking status of LED3 (red) | Buffer to store state (1 byte min) |
LED_GREEN_ON | Turn LED4 (green) on | None |
LED_GREEN_OFF | Turn LED4 (green) off | None |
LED_GREEN_STATUS | Obtain status of LED4 (green) | Buffer to store state (1 byte min) |
LED_GREEN_BLINKON | Start LED4 (green) blinking | None |
LED_GREEN_BLINKOFF | Stop LED4 (green) blinking | None |
LED_GREEN_BLINKSTATUS | Obtain blinking status of LED4 (green) | Buffer to store state (1 byte min) |
For detailed usage information on the LED device driver, please refer to the source code of the sample LED control application (atmark-dist/vendors/AtmarkTechno/Armadillo-440/ledctrl
).
The button input function on the Armadillo-400 Series is implemented as an input device and offers an event interface to userland programs.
On the Armadillo-440 LCD Model, the Armadillo-440 has one on-board tact switch and the LCD Expansion Board has three buttons mounted.
The buttons and their corresponding events are shown in 表8.16「Armadillo-440 LCD Model Button Events」.
表8.16 Armadillo-440 LCD Model Button Events
Buttons | Type | Code | Value |
---|
SW1 | EV_KEY(1) | KEY_ENTER(28) | 0 or 1 |
LCD_SW1 | EV_KEY(1) | KEY_BACK(158) | 0 or 1 |
LCD_SW2 | EV_KEY(1) | KEY_MENU(139) | 0 or 1 |
LCD_SW3 | EV_KEY(1) | KEY_HOME(102) | 0 or 1 |
On the Armadillo-440 LCD Model, by default the button event device is mapped to /dev/input/event0
.
![[警告]](images/warning.png) | |
---|
The event device file numbers are determined by the order the input devices are detected. Therefore, if another input device such as a USB keyboard is detected at boot time, the event device number of the button function may change. |
A real-time clock is incorporated on the Armadillo-440 LCD Expansion Board and the Armadillo-400 RTC Option Module.
The real-time clock is registered as /dev/rtc0
. When using the RTC Option Module with the Armadillo-440 LCD Model, the real-time clock on the RTC Option Module is registered as /dev/rtc0
, and the real-time clock on the LCD Expansion Board becomes /dev/rtc1
.
The i.MX25 processor on the Armadillo-400 Series boards includes an internal watchdog timer.
The default bootloader on the Armadillo-400 Series enables the internal watchdog timer straight after the board is powered on. It is set to time out after 10 seconds by default.
The watchdog timer is kicked automatically by the Linux kernel.
If for some reason the Linux kernel freezes and as a result is unable to kick the watchdog timer and a time-out occurs, the system will reset.
The i.MX25 processor includes three I2C controllers: I2C1 to I2C3. On the Armadillo-400 Series, by default I2C1 is used as a board internal bus, I2C2 is assigned to CON14 and I2C3 to CON11.
The I2C bus driver has the following functionality.
I2C master mode
400 kbps max
In order to use a slave device connected to an I2C bus, a chip driver for the appropriate device must be enabled. Also, if the chip driver is written in "new style"[], struct i2c_board_info must be configured appropriately. For the Armadillo-400 Series, please add the details to the armadillo400_i2cN_board_info array in linux-2.6.26-at/arch/arm/maxh-mx25/armadillo400.c (where N corresponds to the bus number).
Kernel configuration options related to the I2C functionality are shown in 表8.17「I2C Configuration」.
表8.17 I2C Configuration
Kernel Configuration Option | Default | Description |
---|
ARMADILLO400_I2C2_CON14 | y |
Enables I2C2 on CON14
Uses CON14_3 for I2C2_SCL and CON14_4 for I2C2_SDA
|
ARMADILLO400_I2C3_CON11 | y |
Enables I2C3 on CON11
Uses CON11_48 for I2C3_SCL and CON11_49 for I2C3_SDA
|
The i.MX25 processor includes three SPI controllers: CSPI1 to CSPI3. On the Armadillo-400 Series, CSPI1 and CSPI3 can be assigned to CON9 in the kernel configuration.
The SPI master driver has the following functionality.
SPI master mode
Multiple slave selects
The SPI master driver is not enabled by default. In order to use a slave device connected to a SPI bus, both the SPI master driver and a driver for the slave device must be enabled. Also, a struct spi_board_info must be configured appropriately. On the Armadillo-400 Series, please add the details to the armadillo400_spiN_board_info array in linux-2.6.26-at/arch/arm/maxh-mx25/armadillo400.c (where N corresponds to the bus number).
Kernel configuration options related to the SPI functionality are shown in 表8.18「SPI Configuration」.
表8.18 SPI Configuration
Kernel Configuration Option | Default | Description |
---|
SPI | n |
Enables Linux kernel SPI support
|
SPI_MXC | n |
Enables the i.MX SPI master driver
|
ARMADILLO400_SPI1_CON9 | n |
Enables SPI1 on CON9
Uses CON9_3 for CSPI1_MOSI, CON9_5 for CSPI1_MISO, CON9_13 for CSPI1_SCLK and CON9_26 for CSPI1_RDY
|
ARMADILLO400_SPI1_SS0_CON9_25 | n |
Uses CON9_25 for SPI1_SS0
Depends on ARMADILLO400_SPI1_CON9
|
ARMADILLO400_SPI1_SS1_CON9_11 | n |
Uses CON9_11 for SPI1_SS1
Depends on ARMADILLO400_SPI1_CON9
|
ARMADILLO400_SPI3_CON9 | n |
Enables SPI3 on CON9
Uses CON9_4 for CSPI3_MOSI, CON9_6 for CSPI3_MISO, CON9_12 for CSPI3_SCLK and CON9_14 for CSPI3_RDY
|
ARMADILLO400_SPI3_SS0_CON9_16 | n |
Uses CON9_16 for SPI3_SS0
Depends on ARMADILLO400_SPI3_CON9
|
ARMADILLO400_SPI3_SS1_CON9_18 | n |
Uses CON9_18 for SPI3_SS1
Depends on ARMADILLO400_SPI3_CON9
|
ARMADILLO400_SPI3_SS2_CON9_15 | n |
Uses CON9_15 for SPI3_SS2
Depends on ARMADILLO400_SPI3_CON9
|
ARMADILLO400_SPI3_SS2_CON9_17 | n |
Uses CON9_17 for SPI3_SS3
Depends on ARMADILLO400_SPI3_CON9
|
CON9_2 and CON9_26 can be used as one wire masters on the Armadillo-400 Series. The one wire controller included in the i.MX25 processor provides the master functionality for CON9_2, and the GPIO one wire driver provides the same for CON9_26.
The one wire master drivers are not enabled by default. In order to use a slave device connected to a one wire bus, both a one wire master driver and a driver for the slave device must be enabled.
Kernel configuration options related to the one wire functionality are shown in 表8.19「One Wire Configuration」.
表8.19 One Wire Configuration
Kernel Configuration Option | Default | Description |
---|
W1 | n |
Enables Linux kernel one wire support
|
W1_MASTER_MXC | n |
Enables the i.MX25 internal one wire master controller driver
Please enable when using CON9_2
|
W1_MASTER_GPIO | n |
Enables GPIO one wire master driver
Please enable when using CON9_26
|
ARMADILLO400_W1_CON9_2 | n |
Use CON9_2 as one wire
|
ARMADILLO400_W1_CON9_26 | n |
Use CON9_26 as one wire
|
The i.MX25 processor includes four PWM modules: PWM1 to PWM4. On the Armadillo-400 Series, by default PWM1 is used for the LED backlight (CON11_12). PWN2 can be assigned to CON9_25 and PWM4 to CON14_3 by altering the kernel configuration.
With the i.MX25 PWM driver, configuration can be changed by writing an appropriate value to the files under /sys/class/mxc_pwm/(PWM_NAME). Files used for configuration are shown in 表8.20「PWM sysfs」.
表8.20 PWM sysfs
File Name | Description |
---|
period_ns |
PWN period set in nsec
Acceptable range is from 17 to 2,147,483,647 (from 20usec to 2sec approx.)
|
duty_ns |
PWM on time (off time when invert = 1) set in nsec
Acceptable range is 0 < duty_ns < period_ns
|
invert |
PWM output reversed when set to 1
|
enable |
PWM output enabled when set to 1
Output stopped when set to 0
period_ns, duty_ns and invert can be changed even while PWM is enabled
|
Kernel configuration options related to the PWM functionality are shown in 表8.21「PWM Configuration」.
表8.21 PWM Configuration
Kernel Configuration Option | Default | Description |
---|
MXC_PWM | y |
Enable the i.MX25 PWM driver
|
MXC_PWM_CLASS | y |
Enable PWM configuration via sysfs
|
ARMADILLO400_PWM2_CON9_25 | n |
Uses CON9_25 as PWM2
The PWM_NAME is CON9_25
|
ARMADILLO400_PWM4_CON14_3 | n |
Uses CON14_3 as PWM4
The PWM_NAME is CON14_3
|
The i.MX25 processor includes two CAN controllers (FlexCAN): CAN1 and CAN2. On the Armadillo-400 Series, CAN2 can be assigned to CON14 by altering the kernel configuration. The CAN driver is not enabled by default.
The CAN functionality is provided by the SocketCAN framework. For information on SocketCAN, please refer to linux-2.6.26-at/Documentation/networking/can.txt.
The CAN driver has the following functionality.
Configuration can be changed by writing an appropriate value to the files under /sys/devices/platform/FlexCAN.1/. Files used for configuration are shown in 表8.22「CAN sysfs」[].
表8.22 CAN sysfs
File Name | Description | Default Value | Use Conditions |
---|
br_clksrc |
Specify clock source
When bus is specified, 66.5MHz is used for clock source
When osc is specified, 24MHz is used for clock source
| bus | A |
br_presdiv |
Specify clock source prescaler divider
1 to 8 can be specified
| 7 | A |
br_propseg |
Set propagation segment value
1 to 8 can be specified
| 5 | A |
br_pseg1 |
Set phase buffer segment 1 value
1 to 8 can be specified
| 5 | A |
br_pseg2 |
Set phase buffer segment 2 value
1 to 8 can be specified
| 8 | A |
br_rjw |
Set resynchronization jump width
1 to 4 can be specified
| 3 | A |
bitrate |
Displays transmission speed (bps)
Cannot be written to
| 500000 | None |
std_msg |
Set whether or not to support standard format
1 for support, 0 for no support
| 1 | A |
ext_msg |
Set whether or not to support extended format
1 for support, 0 for no support
| 1 | A |
maxmb |
Set max message buffer number
2 to 64 can be specified
| 64 | A |
rx_maxmb |
Set receive message buffer size
Send message buffer size is: maxmb - rx_maxmb
1 to maxmb - 1 can be specified
| 32 | A |
state |
Display current status
Displayed with format: "interface status::error status"
Interface status is either "Start" (up) or "Stop" (down)
Error status is one of following: "normal", "error passive", "bus off"
| Stop::normal | None |
boff_rec |
Set whether or not to recover from bus off automatically
0 to recover automatically, 1 to not recover
| 1 | A |
listen |
Set whether or not to enable listen mode (receive only)
1 to enable listen mode, 0 to disable
| 0 | A |
loopback |
Set whether or not to enable loopback mode
1 to enable loopback mode, 0 to disable
| 0 | A |
smp |
Set sampling behavior
0 for determining received bit value from 1 sample
1 for determining received bit value by majority count from 3 samples
| 1 | A |
srx_dis |
Set whether or not to receive sent frames
0 to receive sent frames, 1 to not receive
| 1 | A |
set_resframe |
Set data frame to reply with after receiving remote frame
Set with format: "ID#DATA"
ID specified with 3 digit hex (standard format) or 8 digit hex value
Data specified as 0 to 8 groups of 2 digit hex values
Data can be separated by "."
| None | B |
del_resframe |
Delete data frame set with set_resframe
Specify ID of data frame to delete with 3 digit hex (standard format) or 8 digit hex value
| None | B |
show_resframe |
Display data frame set with set_resframe
Cannot be written to
| None | C |
wakeup |
Set whether or not to enable CAN receive wakeup while suspended
1 to enable wakeup, 0 to disable
| 0 | A |
wak_src |
Set whether or not to use low-pass filter while suspended
1 to enable filter, 0 to disable
| 0 | A |
Condition A: can be set when the network interface is in the off state (ifconfig canX off).
Condition B: can be set when the network interface is in the on state (ifconfig canX on).
Condition C: can be referenced when the network interface is in the on state (ifconfig canX on).
Transmission speed is determined by the following formula.
Kernel configuration options related to the CAN functionality are shown in 表8.23「CAN Configuration」.
表8.23 CAN Configuration
Kernel Configuration Option | Default | Description |
---|
CAN | n |
Enable Linux kernel CAN support
|
CAN_RAW | n |
Enable RAW_CAN protocol support
|
CAN_BCM | n |
Enable CAN_BCM protocol support
|
CAN_FLEXCAN | n |
Enable the i.MX25 FlexCAN driver
|
ARMADILLO400_CAN2_CON14 | n |
Uses CON14 for CAN2
Uses CON14_3 for CAN2_TXCAN and CON14_4 for CAN2_RXCAN
|
The i.MX25 processor includes a keypad controller. On the Armadillo-400 Series, the keypad can be assigned to CON11 by altering the kernel configuration. The keypad driver is not enabled by default.
![[警告]](images/warning.png) | |
---|
When the keypad driver is enabled, the event device will be mapped to /dev/input/event0. This will cause the default button and touchscreen event device numbers to change. |
Kernel configuration options related to the keypad functionality are shown in 表8.24「Keypad Configuration」.
表8.24 Keypad Configuration
Kernel Configuration Option | Default | Description |
---|
INPUT | y |
Enable Linux kernel input layer support
|
INPUT_EVDEV | y |
Enable input layer event device support
|
KEYBOARD_MXC | n |
Enable the i.MX25 keypad driver
|
ARMADILLO400_KEYPAD_CON11 | n |
Enable keypad on CON11
Please enable at least one COL and ROW each
|
ARMADILLO400_KEYPAD_ROW0_CON11_40 | n |
Uses CON11_40 as ROW0
|
ARMADILLO400_KEYPAD_ROW1_CON11_41 | n |
Uses CON11_41 as ROW1
|
ARMADILLO400_KEYPAD_ROW2_CON11_42 | n |
Uses CON11_42 as ROW2
|
ARMADILLO400_KEYPAD_ROW3_CON11_43 | n |
Uses CON11_43 as ROW3
|
ARMADILLO400_KEYPAD_COL0_CON11_44 | n |
Uses CON11_44 as COL0
|
ARMADILLO400_KEYPAD_COL1_CON11_45 | n |
Uses CON11_45 as COL1
|
ARMADILLO400_KEYPAD_COL2_CON11_46 | n |
Uses CON11_46 as COL2
|
ARMADILLO400_KEYPAD_COL3_CON11_47 | n |
Uses CON11_47 as COL3
|
ARMADILLO400_KEYPAD_ROW4_CON11_48 | n |
Uses CON11_48 as ROW4
|
ARMADILLO400_KEYPAD_ROW5_CON11_49 | n |
Uses CON11_49 as ROW5
|
To set what ROW and COL range is used for the keypad, specify the appropriate values in the armadillo440_keypad_data variable in linux-2.6.26-at/arch/arm/maxh-mx25/armadillo400.c. Specify the button to event key mappings in the armadillo440_keymapping variable.
The Armadillo-400 Series support the Linux power management sleep functionality. In the sleep state, the execution of applications is paused and the kernel enters the suspend state. Power consumption is kept at a minimum during the sleep state as the operation of external devices is halted. When returning to the normal execution state from the sleep state, the kernel's resume logic is run and applications are returned to a running state.
Sleep mode can be entered by writing either "standby" or "mem" to the /sys/power/state
file. The system will return to the normal execution state from sleep mode when a wakeup interrupt occurs.
The differences in state of each mode are shown in 表8.25「Sleep Modes」. The suspend-to-RAM sleep mode provides for a greater reduction in power consumption compared to the power-on suspend mode.
表8.25 Sleep Modes
Sleep Modes | Character String Written to state File | i.MX25 Power Mode | Wakeup Basis |
---|
power-on suspend | standby | Doze Mode | Serial input, touchscreen input and button input |
suspend-to-RAM | mem | Stop Mode | Button input |
For devices that can be used as a basis for wakeups, whether or not they do trigger a wakeup can be specified with their power/wakeup
sysfs entry. Write "enabled" to the power/wakeup
file and the device will function as a basis for wakeups, and write "disabled" and they will not.
Please refer to 表8.26「Wakeup Basis Designation」 for details.
表8.26 Wakeup Basis Designation
Device | sysfs File | Initial State |
---|
Serial Interface 1 | /sys/devices/platform/mxcintuart.1/tty/ttymxc1/power/wakeup | enabled |
Serial Interface 2 | /sys/devices/platform/mxcintuart.2/tty/ttymxc2/power/wakeup | disabled |
Serial Interface 3 | /sys/devices/platform/mxcintuart.4/tty/ttymxc4/power/wakeup | disabled |
Touchscreen | /sys/devices/platform/imx_adc.0/power/wakeup | enabled |
Buttons | /sys/devices/platform/gpio-keys.0/power/wakeup | enabled |
Keypad | /sys/devices/platform/mxc_keypad.0/power/wakeup | enabled |
FlexCAN | /sys/devices/platform/FlexCAN.1/wakeup | disabled |
8.20.1. Treatment of External Devices During Sleep
On the Armadillo-400 Series, the power supply to all external devices is halted as part of the suspend logic.
Because of this, USB devices must be put into a state where they can be safely disconnected before the system in put into the sleep state. That is, USB memory must be unmounted first. As the devices will be detected again when the system resumes, USB devices can be disconnected and reconnected while the system is in the sleep state.
As opposed to this, microSD cards can be left mounted when the system is put into the sleep state. In order for this to be possible, the SD host driver does not probe for cards at resume time, and instead assumes the same card is still inserted. Because of this, microSD cards cannot be removed or inserted when the system is in the sleep state.
For Ethernet devices, at resume time the same process is followed as when a cable is reconnected. Therefore, Auto-negotiation will take place at resume time if it is enabled.
By default, +3.3V_IO output is stopped when the system is put into the sleep state. However, if Serial Port 2 or Serial Port 4 are selected as a wakeup basis, the +3.3V_IO output will continue even during the sleep state.