요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
* Freescale IMX27 IOMUX Controller
Required properties:
- compatible: "fsl,imx27-iomuxc"
The iomuxc driver node should define subnodes containing of pinctrl configuration subnodes.
Required properties for pin configuration node:
- fsl,pins: three integers array, represents a group of pins mux and config
setting. The format is fsl,pins = <PIN MUX_ID CONFIG>.
PIN is an integer between 0 and 0xbf. imx27 has 6 ports with 32 configurable
configurable pins each. PIN is PORT * 32 + PORT_PIN, PORT_PIN is the pin
number on the specific port (between 0 and 31).
MUX_ID is
function + (direction << 2) + (gpio_oconf << 4) + (gpio_iconfa << 8) + (gpio_iconfb << 10)
function value is used to select the pin function.
Possible values:
0 - Primary function
1 - Alternate function
2 - GPIO
Registers: GIUS (GPIO In Use), GPR (General Purpose Register)
direction defines the data direction of the pin.
Possible values:
0 - Input
1 - Output
Register: DDIR
gpio_oconf configures the gpio submodule output signal. This does not
have any effect unless GPIO function is selected. A/B/C_IN are output
signals of function blocks A,B and C. Specific function blocks are
described in the reference manual.
Possible values:
0 - A_IN
1 - B_IN
2 - C_IN
3 - Data Register
Registers: OCR1, OCR2
gpio_iconfa/b configures the gpio submodule input to functionblocks A and
B. GPIO function should be selected if this is configured.
Possible values:
0 - GPIO_IN
1 - Interrupt Status Register
2 - Pulldown
3 - Pullup
Registers ICONFA1, ICONFA2, ICONFB1 and ICONFB2
CONFIG can be 0 or 1, meaning Pullup disable/enable.
The iomux controller has gpio child nodes which are embedded in the iomux
control registers. They have to be defined as child nodes of the iomux device
node. If gpio subnodes are defined "#address-cells", "#size-cells" and "ranges"
properties for the iomux device node are required.
Example:
iomuxc: iomuxc@10015000 {
compatible = "fsl,imx27-iomuxc";
reg = <0x10015000 0x600>;
#address-cells = <1>;
#size-cells = <1>;
ranges;
gpio1: gpio@10015000 {
...
};
...
uart {
pinctrl_uart1: uart-1 {
fsl,pins = <
0x8c 0x004 0x0 /* UART1_TXD__UART1_TXD */
0x8d 0x000 0x0 /* UART1_RXD__UART1_RXD */
0x8e 0x004 0x0 /* UART1_CTS__UART1_CTS */
0x8f 0x000 0x0 /* UART1_RTS__UART1_RTS */
>;
};
...
};
};
For convenience there are macros defined in imx27-pinfunc.h which provide PIN
and MUX_ID. They are structured as MX27_PAD_<Pad name>__<Signal name>. The names
are defined in the i.MX27 reference manual.
The above example using macros:
iomuxc: iomuxc@10015000 {
compatible = "fsl,imx27-iomuxc";
reg = <0x10015000 0x600>;
#address-cells = <1>;
#size-cells = <1>;
ranges;
gpio1: gpio@10015000 {
...
};
...
uart {
pinctrl_uart1: uart-1 {
fsl,pins = <
MX27_PAD_UART1_TXD__UART1_TXD 0x0
MX27_PAD_UART1_RXD__UART1_RXD 0x0
MX27_PAD_UART1_CTS__UART1_CTS 0x0
MX27_PAD_UART1_RTS__UART1_RTS 0x0
>;
};
...
};
};
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
i.MX27 controller와 fsl,pins 형식
1-18Freescale i.MX27 IOMUX Controller의 필수 `compatible` 값은 `fsl,imx27-iomuxc`입니다. IOMUXC driver 노드는 pinctrl configuration 하위 노드를 담는 하위 노드를 정의해야 합니다.
Pin configuration node의 필수 `fsl,pins`는 pin group의 mux와 config를 나타내는 정수 3개 배열이며 형식은 `fsl,pins = <PIN MUX_ID CONFIG>`입니다.
`PIN`은 0부터 `0xbf` 사이입니다. i.MX27에는 구성 가능한 pin 32개를 가진 port 6개가 있으며 `PIN = PORT * 32 + PORT_PIN`, `PORT_PIN`은 해당 port의 0부터 31 사이 pin 번호입니다.
`MUX_ID` 계산식은 다음과 같습니다.
function + (direction << 2) + (gpio_oconf << 4) + (gpio_iconfa << 8) + (gpio_iconfb << 10)
i.MX27 function·direction·GPIO output
19-41`function` 값은 pin function을 선택합니다. 0은 primary function, 1은 alternate function, 2는 GPIO이며 관련 register는 `GIUS`와 `GPR`입니다.
`direction`은 pin data 방향을 정합니다. 0은 input, 1은 output이며 관련 register는 `DDIR`입니다.
`gpio_oconf`는 GPIO submodule output 신호를 구성하며 GPIO function을 선택했을 때만 효과가 있습니다. `A_IN`, `B_IN`, `C_IN`은 function block A, B, C의 출력 신호입니다. 값 0, 1, 2는 각각 `A_IN`, `B_IN`, `C_IN`, 값 3은 Data Register이며 관련 register는 `OCR1`, `OCR2`입니다.
i.MX27 GPIO input과 CONFIG
42-58`gpio_iconfa/b`는 function block A와 B로 들어가는 GPIO submodule input을 구성하며 이 값을 설정할 때는 GPIO function을 선택해야 합니다. 값 0은 `GPIO_IN`, 1은 Interrupt Status Register, 2는 pulldown, 3은 pullup입니다. 관련 register는 `ICONFA1`, `ICONFA2`, `ICONFB1`, `ICONFB2`입니다.
`CONFIG`는 0 또는 1이며 각각 pull-up 비활성화와 활성화를 뜻합니다.
GPIO child node는 IOMUX control register에 포함되어 있으므로 IOMUX device node의 child로 정의해야 합니다. GPIO 하위 노드를 정의하면 IOMUX device node에 `#address-cells`, `#size-cells`, `ranges` 속성이 필요합니다.
i.MX27 숫자 PIN·MUX_ID 예제
59-87첫 예제는 IOMUXC 아래 GPIO child를 두고 UART1의 TXD, RXD, CTS, RTS pin을 숫자 `PIN`, `MUX_ID`, `CONFIG` 값으로 구성합니다.
iomuxc: iomuxc@10015000 {
compatible = "fsl,imx27-iomuxc";
reg = <0x10015000 0x600>;
#address-cells = <1>;
#size-cells = <1>;
ranges;
gpio1: gpio@10015000 {
...
};
...
uart {
pinctrl_uart1: uart-1 {
fsl,pins = <
0x8c 0x004 0x0 /* UART1_TXD__UART1_TXD */
0x8d 0x000 0x0 /* UART1_RXD__UART1_RXD */
0x8e 0x004 0x0 /* UART1_CTS__UART1_CTS */
0x8f 0x000 0x0 /* UART1_RTS__UART1_RTS */
>;
};
...
};
};
i.MX27 pinfunc macro 예제
88-121편의를 위해 `imx27-pinfunc.h`에는 `PIN`과 `MUX_ID`를 함께 제공하는 macro가 있습니다. 이름 형식은 `MX27_PAD_<Pad name>__<Signal name>`이며 이름은 i.MX27 reference manual에 정의됩니다.
다음은 같은 UART1 구성을 macro로 다시 작성한 전체 예제입니다.
iomuxc: iomuxc@10015000 {
compatible = "fsl,imx27-iomuxc";
reg = <0x10015000 0x600>;
#address-cells = <1>;
#size-cells = <1>;
ranges;
gpio1: gpio@10015000 {
...
};
...
uart {
pinctrl_uart1: uart-1 {
fsl,pins = <
MX27_PAD_UART1_TXD__UART1_TXD 0x0
MX27_PAD_UART1_RXD__UART1_RXD 0x0
MX27_PAD_UART1_CTS__UART1_CTS 0x0
MX27_PAD_UART1_RTS__UART1_RTS 0x0
>;
};
...
};
};
요약과 해설
fsl,imx27-pinctrl.txt:1-121MUX_ID bit field, GPIO 입출력 선택, 숫자와 pinfunc macro UART1 예제를 설명합니다.