요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
* Freescale IOMUX Controller (IOMUXC) for i.MX
The IOMUX Controller (IOMUXC), together with the IOMUX, enables the IC
to share one PAD to several functional blocks. The sharing is done by
multiplexing the PAD input/output signals. For each PAD there are up to
8 muxing options (called ALT modes). Since different modules require
different PAD settings (like pull up, keeper, etc) the IOMUXC controls
also the PAD settings parameters.
Please refer to pinctrl-bindings.txt in this directory for details of the
common pinctrl bindings used by client devices, including the meaning of the
phrase "pin configuration node".
Freescale IMX pin configuration node is a node of a group of pins which can be
used for a specific device or function. This node represents both mux and config
of the pins in that group. The 'mux' selects the function mode(also named mux
mode) this pin can work on and the 'config' configures various pad settings
such as pull-up, open drain, drive strength, etc.
Required properties for iomux controller:
- compatible: "fsl,<soc>-iomuxc"
Please refer to each fsl,<soc>-pinctrl.txt binding doc for supported SoCs.
Required properties for pin configuration node:
- fsl,pins: each entry consists of 6 integers and represents the mux and config
setting for one pin. The first 5 integers <mux_reg conf_reg input_reg mux_val
input_val> are specified using a PIN_FUNC_ID macro, which can be found in
imx*-pinfunc.h under device tree source folder. The last integer CONFIG is
the pad setting value like pull-up on this pin. And that's why fsl,pins entry
looks like <PIN_FUNC_ID CONFIG> in the example below.
Bits used for CONFIG:
NO_PAD_CTL(1 << 31): indicate this pin does not need config.
SION(1 << 30): Software Input On Field.
Force the selected mux mode input path no matter of MUX_MODE functionality.
By default the input path is determined by functionality of the selected
mux mode (regular).
Other bits are used for PAD setting.
Please refer to each fsl,<soc>-pinctrl,txt binding doc for SoC specific part
of bits definitions.
NOTE:
Some requirements for using fsl,imx-pinctrl binding:
1. We have pin function node defined under iomux controller node to represent
what pinmux functions this SoC supports.
2. The pin configuration node intends to work on a specific function should
to be defined under that specific function node.
The function node's name should represent well about what function
this group of pins in this pin configuration node are working on.
3. The driver can use the function node's name and pin configuration node's
name describe the pin function and group hierarchy.
For example, Linux IMX pinctrl driver takes the function node's name
as the function name and pin configuration node's name as group name to
create the map table.
4. Each pin configuration node should have a phandle, devices can set pins
configurations by referring to the phandle of that pin configuration node.
Examples:
usdhc@219c000 { /* uSDHC4 */
non-removable;
vmmc-supply = <®_3p3v>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_usdhc4_1>;
};
iomuxc@20e0000 {
compatible = "fsl,imx6q-iomuxc";
reg = <0x020e0000 0x4000>;
/* shared pinctrl settings */
usdhc4 {
pinctrl_usdhc4_1: usdhc4grp-1 {
fsl,pins = <
MX6QDL_PAD_SD4_CMD__SD4_CMD 0x17059
MX6QDL_PAD_SD4_CLK__SD4_CLK 0x10059
MX6QDL_PAD_SD4_DAT0__SD4_DATA0 0x17059
MX6QDL_PAD_SD4_DAT1__SD4_DATA1 0x17059
MX6QDL_PAD_SD4_DAT2__SD4_DATA2 0x17059
MX6QDL_PAD_SD4_DAT3__SD4_DATA3 0x17059
MX6QDL_PAD_SD4_DAT4__SD4_DATA4 0x17059
MX6QDL_PAD_SD4_DAT5__SD4_DATA5 0x17059
MX6QDL_PAD_SD4_DAT6__SD4_DATA6 0x17059
MX6QDL_PAD_SD4_DAT7__SD4_DATA7 0x17059
>;
};
....
};
Refer to the IOMUXC controller chapter in imx6q datasheet,
0x17059 means enable hysteresis, 47KOhm Pull Up, 50Mhz speed,
80Ohm driver strength and Fast Slew Rate.
User should refer to each SoC spec to set the correct value.
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
i.MX IOMUXC 개념
1-18Freescale i.MX IOMUX Controller(IOMUXC)는 IOMUX와 함께 하나의 PAD를 여러 functional block이 공유하게 합니다. PAD 입출력 신호를 multiplex하며 각 PAD에는 ALT mode라고 부르는 mux 선택지가 최대 8개 있습니다.
Module마다 pull-up, keeper 같은 PAD 설정이 다르므로 IOMUXC는 PAD setting parameter도 제어합니다. Client device의 공통 pinctrl binding과 `pin configuration node`의 의미는 같은 directory의 `pinctrl-bindings.txt`를 따릅니다.
i.MX pin configuration node는 특정 device 또는 function에 쓰는 pin group을 나타내며 mux와 configuration을 함께 정의합니다. `mux`는 pin이 동작할 function mode를 선택하고 `config`는 pull-up, open drain, drive strength 같은 PAD 설정을 구성합니다.
IOMUX controller와 fsl,pins
19-42IOMUX controller의 필수 `compatible` 형식은 `fsl,<soc>-iomuxc`입니다. 지원 SoC는 각 `fsl,<soc>-pinctrl.txt` binding 문서에서 확인합니다.
Pin configuration node의 필수 `fsl,pins`에서 각 항목은 정수 6개로 pin 하나의 mux와 config를 나타냅니다. 앞의 다섯 값 `<mux_reg conf_reg input_reg mux_val input_val>`은 device tree source의 `imx*-pinfunc.h`에 있는 `PIN_FUNC_ID` macro로 지정하고 마지막 `CONFIG` 값은 pull-up 같은 PAD 설정입니다. 따라서 예제에서는 `<PIN_FUNC_ID CONFIG>` 형식으로 보입니다.
`CONFIG`의 `NO_PAD_CTL(1 << 31)`은 pin configuration이 필요 없음을 뜻합니다. `SION(1 << 30)`은 Software Input On Field로, 선택한 `MUX_MODE`의 기능과 관계없이 입력 경로를 강제로 켭니다. 기본 상태에서는 선택한 mux mode 기능이 입력 경로를 결정합니다. 나머지 bit는 PAD 설정에 사용하며 SoC별 정의는 각 binding 문서를 참조합니다.
i.MX function과 group 계층 규칙
43-59IOMUX controller 아래에는 SoC가 지원하는 pinmux function을 나타내는 pin function node를 정의합니다. 특정 function에서 동작할 pin configuration node는 그 function node 아래에 둡니다.
Function node 이름은 해당 pin group의 기능을 잘 나타내야 합니다. Driver는 function node와 pin configuration node의 이름으로 function/group 계층을 설명할 수 있습니다. Linux i.MX pinctrl driver는 전자를 function 이름, 후자를 group 이름으로 사용해 map table을 만듭니다.
각 pin configuration node에는 phandle이 있어야 하며 device는 그 phandle을 참조하여 pin configuration을 설정합니다.
i.MX6Q uSDHC4 예제
60-93예제의 uSDHC4 device는 `pinctrl_usdhc4_1`을 기본 pinctrl 상태로 참조합니다. IOMUXC의 `usdhc4grp-1`은 command, clock, data 0부터 7까지의 PAD macro와 `CONFIG` 값을 나열합니다.
usdhc@219c000 { /* uSDHC4 */
non-removable;
vmmc-supply = <®_3p3v>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_usdhc4_1>;
};
iomuxc@20e0000 {
compatible = "fsl,imx6q-iomuxc";
reg = <0x020e0000 0x4000>;
/* shared pinctrl settings */
usdhc4 {
pinctrl_usdhc4_1: usdhc4grp-1 {
fsl,pins = <
MX6QDL_PAD_SD4_CMD__SD4_CMD 0x17059
MX6QDL_PAD_SD4_CLK__SD4_CLK 0x10059
MX6QDL_PAD_SD4_DAT0__SD4_DATA0 0x17059
MX6QDL_PAD_SD4_DAT1__SD4_DATA1 0x17059
MX6QDL_PAD_SD4_DAT2__SD4_DATA2 0x17059
MX6QDL_PAD_SD4_DAT3__SD4_DATA3 0x17059
MX6QDL_PAD_SD4_DAT4__SD4_DATA4 0x17059
MX6QDL_PAD_SD4_DAT5__SD4_DATA5 0x17059
MX6QDL_PAD_SD4_DAT6__SD4_DATA6 0x17059
MX6QDL_PAD_SD4_DAT7__SD4_DATA7 0x17059
>;
};
....
};
i.MX6Q datasheet의 IOMUXC 장을 기준으로 `0x17059`는 hysteresis 활성화, 47KOhm pull-up, 50MHz 속도, 80Ohm drive strength, fast slew rate를 뜻합니다. 올바른 값은 각 SoC specification을 참조해 정해야 합니다.
요약과 해설
fsl,imx-pinctrl.txt:1-93PIN_FUNC_ID, CONFIG bit, SION, phandle 규칙과 i.MX6Q uSDHC4 예제를 설명합니다.