9. Linきx ー 仕様
9.3. Linきx 一覧
9.3.13. ー ー ッ
表 9.5 LED LED 対応
LED ン ー ー
/かけか/claかか/ledか/おed/ ー ー LED3(赤色) defaきlが-on /かけか/claかか/ledか/gおeen/ ー ー LED4(緑色) defaきlが-on /かけか/claかか/ledか/けelloく/ ー ー LED5(黄色) none
ー ン ー ン
System Type --->
[*] Freescale i.MX family <ARCH_MXC>
Freescale i.MX support --->
[*] Support Armadillo-410 platform <MACH_ARMADILLO410>
[*] Support Armadillo-420 platform <MACH_ARMADILLO420>
[*] Support Armadillo-440 platform <MACH_ARMADILLO440>
Armadillo-400 Board options --->
[*] Enable GPIO keys at CON11 <ARMADILLO4X0_GPIOKEYS_CON11>
Device Drivers --->
Input device support --->
-*- Generic input layer (needed for keyboard, mouse, ...) <INPUT>
-*- Matrix keymap support library <INPUT_MATRIXKMAP>
*** Userland interfaces ***
<*> Event interface <INPUT_EVDEV>
*** Input Device Drivers ***
[*] Keyboards ---> <INPUT_KEYBOARD>
<*> GPIO Buttons <KEYBOARD_GPIO>
<*> IMX keypad support <KEYBOARD_IMX>
9.3.14. I2C
I2C ン ー ー i.MX257 I2C(Inがeお IC Modきle) 利用 i.MX25
I2C1 I2C3 3 I2C ー 内蔵 い Aおmadillo-400 ー I2C1
ー 内蔵 使用 I2C2 CON14, I2C3 CON11 割 当 い
GPIO 利用 I2C (i2c-gpio) 利用 I2C 追加
標準状態 CONFIG_I2C_CHARDEV 有効 い ー ー I2C
制御 機能
最大転送 ー : 400kbpか (I2C1, I2C2, I2C3)
/deぎ/i2c-0 (I2C1) /deぎ/i2c-1 (I2C2) /deぎ/i2c-2 (I2C3)
関連 ソー ー
dおiぎeおか/i2c/i2c-boaおdinfo.c dおiぎeおか/i2c/i2c-coおe.c dおiぎeおか/i2c/i2c-deぎ.c
dおiぎeおか/i2c/algoか/i2c-algo-biが.c
ー ン ー ン
System Type --->
[*] Freescale i.MX family <ARCH_MXC>
Freescale i.MX support --->
*** MX25 platforms: ***
[*] Support Armadillo-410 platform <MACH_ARMADILLO410>
[*] Support Armadillo-420 platform <MACH_ARMADILLO420>
[*] Support Armadillo-440 platform <MACH_ARMADILLO440>
Device options --->
-*- Enable I2C1 module <I2C_MXC_SELECT1>
-*- Enable I2C2 module <I2C_MXC_SELECT2>
-*- Enable I2C3 module <I2C_MXC_SELECT3>
Armadillo-400 Board options --->
[*] Enable I2C2 at CON14 <ARMADILLO4X0_I2C2_CON14>
[*] Enable I2C3 at CON11 <ARMADILLO4X0_I2C3_CON11>
Device Drivers --->
<*> I2C support ---> <I2C>
<*> I2C device interface <I2C_CHARDEV>
[*] Autoselect pertinent helper modules <I2C_HELPER_AUTO>
I2C Hardware Bus support --->
<*> GPIO-based bitbanging I2C <I2C_GPIO>
<*> IMX I2C interface <I2C_MXC>
I2C ー 接続 使用可能 ー 対応
有効 必要 あ かがおきcが i2c_boaおd_info 適切 設定 い
Aおmadillo-400 ー linきぐ-3.14-aが/aおch/aおm/mach-imぐ/aおmadillo4ぐ0_eぐがif.c
aおmadillo4ぐ0_i2cN 配列(N 対応 数値) 記述 い
static struct i2c_board_info armadillo4x0_i2c1[] = { {
I2C_BOARD_INFO("s35390a", 0x30), },
};
図 9.1 I2C i2c_boaおd_info 設定
標準 I2C1 通信速度 40kbpか 設定 い 通信速度 aおmadillo4ぐ0_eぐがif.c
以下 場所 設定 い
static const struct imxi2c_platform_data mx25_i2c1_data __initconst = { .bitrate = 40000,
};
図 9.2 I2C 通信速度 設定
9.3.15. SPI
SPI ン ー ー i.MX257 CSPI(Configきおable Seおial Peおipheおal Inがeおface) 利用
Aおmadillo-400 ー ー ン ー ン CSP1 及び CSPI3 CON9
割 当 事 可能
Aおmadillo-400 ー ソ Linきぐ ー 仕様
標準状態 無効 い CONFIG_SPI_SPIDEV 有効化 ー ー SPI 制御
機能
SPI ー ー
複数 ー
最大通信速度 約 16Mbpか
関連 ソー ー
dおiぎeおか/かpi/かpi-biがbang.c dおiぎeおか/かpi/かpi-imぐ.c dおiぎeおか/かpi/かpi.c dおiぎeおか/かpi/かpideぎ.c
ー ン ー ン
System Type --->
[*] Freescale i.MX family <ARCH_MXC>
Freescale i.MX support --->
*** MX25 platforms: ***
[*] Support Armadillo-410 platform <MACH_ARMADILLO410>
[*] Support Armadillo-420 platform <MACH_ARMADILLO420>
[*] Support Armadillo-440 platform <MACH_ARMADILLO440>
Device options --->
[*] Enable SPI1 module <SPI_MXC_SELECT1>
[*] Enable SPI3 module <SPI_MXC_SELECT3>
Armadillo-400 Board options --->
[ ] Enable UART3 at CON9 <ARMADILLO4X0_UART3_CON9>
[ ] Enable UART5 at CON9 <ARMADILLO4X0_UART5_CON9>
[*] Enable SPI1 at CON9 <ARMADILLO4X0_SPI1_CON9>
[*] Enable SPI1_SS0 at CON9_25 <ARMADILLO4X0_SPI1_SS0_CON9_25>
[*] Enable SPI1_SS1 at CON9_11 <ARMADILLO4X0_SPI1_SS1_CON9_11>
[*] Enable SPI3 at CON9 <ARMADILLO4X0_SPI3_CON9>
[*] Enable SPI3_SS0 at CON9_16 <ARMADILLO4X0_SPI3_SS0_CON9_16>
[*] Enable SPI3_SS1 at CON9_18 <ARMADILLO4X0_SPI3_SS1_CON9_18>
[*] Enable SPI3_SS2 at CON9_15 <ARMADILLO4X0_SPI3_SS2_CON9_15>
[*] Enable SPI3_SS3 at CON9_17 <ARMADILLO4X0_SPI3_SS3_CON9_17>
Device Drivers --->
[*] SPI support ---> <SPI>
*** SPI Master Controller Drivers ***
-*- Utilities for Bitbanging SPI masters <SPI_BITBANG>
<*> Freescale i.MX SPI controllers <SPI_IMX>
*** SPI Protocol Masters ***
< > User mode SPI device driver support <SPI_SPIDEV>
CON9 SPI1 割 当 場合 設定 無効化 い
SPI ー ー ー ー 有効 必要 あ かがおきcが かpi_boaおd_info 適切 設定 い かがおきcが かpi_boaおd_info linux-3.[version]/ arch/arm/mach-imx/armadillo4x0_extif.c aおmadillo4ぐ0_かpiN_boaおd_info (N 対応 数
値) 記述 い SPI 通信速度 ー 設定
SPI ー ン ー かがおきcが かpi_boaおd_info 対応 次 示 通
ー ン ー かがおきcが かpi_boおd_info 名
CSPI1 0 aおmadillo4ぐ0_かpi0_boaおd_info CSPI3 2 aおmadillo4ぐ0_かpi2_boaおd_info
9.3.16. ッ ッ マー
Aおmadillo-400 ー ー i.MX257 WDOG(Waがchdog Timeお) 利
用
ー Heおmiが-Aが ー ー ー 有効化 標準状態
時間 10 秒 設定 Linきぐ ー ー 初期化時
時間 上書 標準状態 時間 10 秒 ー
ー 利用 定期的 ー
何 要因 ー
発生
関連 ソー ー
dおiぎeおか/くaがchdog/imぐ2_くdが.c
ー ン ー ン
Device Drivers --->
[*] Watchdog Timer Support ---> <WATCHDOG>
<*> IMX2+ Watchdog <IMX2_WDT>
i.MX257 WDOG 一度有効化 無効化
halt ン 実行 Linきぐ ー 停止 場合 発生 ー
WDOG ー 終了処理 時間 WDOG 最大
値 あ 128 秒 設定
9.3.17. 1-wiおe
Aおmadillo-400 ー CON9_2 CON9_26 1-くiおe ー 使用 事
CON9_2 i.MX257 1-くiおe(1-くiおe Modきle) 利用 CON9_26 GPIO 1-くiおe ー
用い 機能 実現 い
状態 1-くiおe 利用 1-くiおe 利用 ー
ン ー ン 行い 1-くiおe ー ー 接続 ー ー
有効 必要 あ
Aおmadillo-400 ー ソ Linきぐ ー 仕様
関連 ソー ー
dおiぎeおか/く1/maかがeおか/mぐc_く1.c dおiぎeおか/く1/く1.c
dおiぎeおか/く1/く1_inが.c dおiぎeおか/く1/く1_familけ.c dおiぎeおか/く1/く1_neがlink.c dおiぎeおか/く1/く1_io.c
ー ン ー ン
System Type --->
[*] Freescale i.MX family <ARCH_MXC>
Freescale i.MX support --->
*** MX25 platforms: ***
[*] Support Armadillo-410 platform <MACH_ARMADILLO410>
[*] Support Armadillo-420 platform <MACH_ARMADILLO420>
[*] Support Armadillo-440 platform <MACH_ARMADILLO440>
Device options --->
[*] Enable MX25 1-Wire module <W1_MXC_SELECT1>
[*] Enable GPIO 1-Wire module <W1_GPIO_SELECT1>
Armadillo-400 Board options --->
[*] Enable one wire at CON9_2 <ARMADILLO4X0_W1_CON9_2>
[*] Enable one wire at CON9_26 <ARMADILLO4X0_W1_CON9_26>
Device Drivers --->
<*> Dallas's 1-wire support ---> <W1>
1-wire Bus Masters --->
<*> Freescale MXC 1-wire busmaster <W1_MASTER_MXC>
<*> GPIO 1-wire busmaster <W1_MASTER_GPIO>
CON9_2 1-くiおe 使用 場合 設定 無効化 い
CON9_26 1-くiおe 使用 場合 設定 無効化 い
9.3.18. PWM
Aおmadillo-400 ー PWM i.MX257 PWM(Pきlかe-Widがh Modきlaがoお) 利用
ー ン ー ン 変更 PWM2 CON9_25 PWM4
CON14_3 割 当 事
関連 ソー ー
dおiぎeおか/pくm/coおe.c dおiぎeおか/pくm/pくm-imぐ.c dおiぎeおか/pくm/かけかfか.c
ー ン ー ン
System Type --->
[*] Freescale i.MX family <ARCH_MXC>
Freescale i.MX support --->
*** MX25 platforms: ***
[*] Support Armadillo-410 platform <MACH_ARMADILLO410>
[*] Support Armadillo-420 platform <MACH_ARMADILLO420>
[*] Support Armadillo-440 platform <MACH_ARMADILLO440>
Device options --->
[*] Enable PWM2 <MXC_PWM_SELECT2>
[*] Enable PWM4 <MXC_PWM_SELECT4>
Armadillo-400 Board options --->
[ ] Enable I2C2 at CON14 <ARMADILLO4X0_I2C2_CON14>
[*] Enable PWM2 at CON9_25 <ARMADILLO4X0_PWM2_CON9_25>
[*] Enable PWM4 at CON14_3 <ARMADILLO4X0_PWM4_CON14_3>
Device Drivers --->
[*] Pulse-Width Modulation (PWM) Support ---> <PWM>
<*> i.MX PWM support <PWM_IMX>
CON9_25 PWM2 使用 場合 設定 無効化 い
CON14_3 PWM4 使用 場合 有効化 無効化 い
ARMADILLO4X0_PWM4_CON14_3 ARMADILLO4X0_I2C2_CON14 無効化 有効化
PWM 機能 使用 前 eぐpoおが 必要 あ eぐpoおが /sys/class/pwm/
pwmchipN/export 0 書 込 eぐpoおが /sys/class/pwm/pwmchipN/pwm0 生成
[armadillo ~]# echo 0 > /sys/class/pwm/pwmchip0/export
図 9.3 pくmchip0 eぐpoおが
/sys/class/pwm/pwmchip
N
/exportN
ー PWM 認識 順連番 値 設定 pwmchip
N
ン い 調事 i.MX25 ー 割当 い 調 事
[armadillo ~]# ls -l /sys/class/pwm/pwmchip0
lrwxrwxrwx 1 root root 0 Jan 1 1970 /sys/class/pwm/ ⏎ pwmchip0 -> ../../devices/platform/imx27-pwm.1/pwm/pwmchip0/
上記 例 pwmchip0 imx27-pwm.1 ン い ン
先 かけかfか 名 PWM ー 対応 次 通
Aおmadillo-400 ー ソ Linきぐ ー 仕様
ー かけかfか 名 PWM2 CON9_25 imぐ27-pくm.1 PWM4 CON14_3 imぐ27-pくm.3
PWM 機能 /sys/class/pwm/pwmchipN/pwm0以下 値 書 込 事 設定変更 事
設定 使用 表 9.8. PWM かけかfか 示
表 9.8 PWM かけかfか
名 説明
enable PWM 動作/停止 設定
1: PWM 動作 peおiod dきがけ_cけcle polaおiがけ 設定 応 波形 出力 0: PWM 停止
peおiod PWM 周期 nかec 単位 設定
設定可能 範囲 17~2,147,483,647 (約 20nかec 2かec) 設定変更 enable=0 状態 行い
dきがけ_cけcle PWM High 期間(polaおiがけ=inぎeおかed 場合 Loく 期間) nかec 単位 設定 設定可能 範囲 0 < dきがけ_cけcle < peおiod 範囲
設定変更 enable=0 状態 行い
polaおiがけ
PWM 波形 極性 設定
noおmal: PWM 波形 正転状態 dきがけ_cけcle 指定 時間 High 期間 inぎeおかed: PWM 波形 反転状態 dきがけ_cけcle 指定 時間 Loく 期間 設定変更 enable=0 状態 行い
9.3.19. CAN
Aおmadillo-400 ー CAN i.MX257 FleぐCAN(Conがおolleお Aおea Neがくoおk) 利用
ー ン ー ン 変更 事 CAN2 CON14 割 当 事
関連 ソー ー
dおiぎeおか/neが/can/fleぐcan.c dおiぎeおか/neが/can/deぎ.c neが/can/af_can.c neが/can/bcm.c neが/can/gく.c neが/can/pおoc.c neが/can/おaく.c
ー ン ー ン
System Type --->
[*] Freescale i.MX family <ARCH_MXC>
Freescale i.MX support --->
*** MX25 platforms: ***
[*] Support Armadillo-410 platform <MACH_ARMADILLO410>
[*] Support Armadillo-420 platform <MACH_ARMADILLO420>
[*] Support Armadillo-440 platform <MACH_ARMADILLO440>
Device options --->
[*] Enable FlexCAN2 module <FLEXCAN_SELECT2>
Armadillo-400 Board options --->
[ ] Enable I2C2 at CON14 <ARMADILLO4X0_I2C2_CON14>
[*] Enable CAN2 at CON14 <ARMADILLO4X0_CAN2_CON14>
[*] Networking support ---> <NET>
<*> CAN bus subsystem support ---> <CAN>
<*> Raw CAN Protocol (raw access with CAN-ID filtering) <CAN_RAW>
<*> Broadcast Manager CAN Protocol (with content filtering) <CAN_BCM>
<*> CAN Gateway/Router (with netlink configuration) <CAN_GW>
CAN Device Drivers --->
<*> Platform CAN drivers with Netlink support <CAN_DEV>
[*] CAN bit-timing calculation <CAN_CALC_BITTIMING>
<*> Support for Freescale FLEXCAN based chips <CAN_FLEXCAN>
CON9 CAN2 割 当 場合 設定 無効化 い
ARMADILLO4X0_CAN2_CON14 ARMADILLO4X0_I2C2_CON14 無効化 有効化
CAN 転送速度 設定 ip ン 使用 iproute2 ip ン 通信速度
125kpbか 設定 次 ン 実行
[armadillo ~]# ip link set can0 type can bitrate 125000 loopback off
転送速度 変更 う 次 ン 表示 biがおaがe 数値 確認
[armadillo ~]# ip -s -d link show can0
2: can0: <NOARP,ECHO> mtu 16 qdisc noop state DOWN mode DEFAULT group default qlen 10 link/can promiscuity 0
can state STOPPED (berr-counter tx 0 rx 0) restart-ms 0 bitrate 125000 sample-point 0.857
tq 571 prop-seg 5 phase-seg1 6 phase-seg2 2 sjw 1
flexcan: tseg1 4..16 tseg2 2..8 sjw 1..4 brp 1..256 brp-inc 1 clock 66500000
re-started bus-errors arbit-lost error-warn error-pass bus-off 0 0 0 0 0 0 RX: bytes packets errors dropped overrun mcast
0 0 0 0 0 0 TX: bytes packets errors dropped carrier collsns 0 0 0 0 0 0
Aおmadillo-400 ー ソ Linきぐ ー 仕様
Aおmadillo-400 ー ー ー ン 標準 組 込 い BきかけBoぐ ip ン CAN 転送速度 設定
CAN 機能 使用 場合 ー ー ン ン ー
ン 行い iproute2 組 込 必要 あ
Userland Configuration Network Applications --->
[*] iproute2 チェックを入
付録 A Heおmiが-Aが ー ー ー
Heおmiが-Aが ー 製品 採用 い 高機能 ン ー ー兼 ー ー ー
Aおmadillo 保守 ー 起動 Heおmiが-Aが ー ー ー ン 表示
ン ン 入力 書 換えや Linきぐ ー
ー ー 設定等 Heおmiが-Aが ー ー ー 様々 機能 使用 代表
的 機能 い 説明
Heおmiが-AT ー
Heおmiが-AT 2 ー あ ン ン 表示
対話的 動作 対話 ー Heおmiが-AT ン ー 通信
ー ー ン ン
表示や入力 文字 表示 行い ン 実行 可能
起動直後 Heおmiが-AT 必 対話 ー い 対話 ー
ー 移行 せ ー 対話 ー
移行 ー ン ー ! 入力
Heおmiが-AT ン ー 通信 行 場合 ー 移行
通信 確立 Heおmiが-AT ン ー 送
信
対話 ー ー 移行 ー 中 入力
ン 成功 場合 以下 う 表示
+OK
A.1. veおかion
ー ン情報 表示 ン
Aおmadillo-400 ー ソ Heおmiが-Aが ー ー ー
構文:ぎeおかion
図 A.1 ぎeおかion 構文