← Documents Documentation/arch/arm/pxa/mfp.rst GitHub 원문 ↗

Linux 6.18.37 · Architecture

MFP Configuration for PXA2xx/PXA3xx Processors

PXA2xx/PXA3xx의 Multi-Function Pin API, GPIO와 MFP의 분리, MFPR bitfield, 보드 초기화와 wakeup 설정을 설명합니다.

Source pathDocumentation/arch/arm/pxa/mfp.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

요약과 해설

mfp.rst:1-288

PXA3xx의 MFP는 GPIO controller에서 pin-mux와 저전력·pull·edge 기능을 분리해 외부 pad 앞의 독립된 라우팅 계층으로 만듭니다. 따라서 GPIO 번호는 내부 signal을, MFP pin 번호는 물리 pad를 가리키며 둘을 같은 개념으로 취급하면 안 됩니다.

통합 API는 processor-neutral 32-bit pin configuration을 정의하고 PXA2xx 또는 PXA3xx 구현이 이를 서로 다른 실제 register 집합으로 변환합니다. board code는 processor별 header 하나를 선택하고 초기화 배열을 `__initdata`로 제공하며, wakeup capability와 실제 IRQ wakeup 활성화를 별도로 설정합니다.

PXA MFP 구성 계층
board pin configurationunified MFP APIPXA3xx MFPRMFPexternal PAD
board pin configurationunified MFP APIPXA2xx GAFRx·GPDRx·PGSRx·wake registersexternal PAD

board의 공통 pin 정의가 processor별 변환기를 거쳐 실제 register와 외부 pad를 구성합니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

원문 전체 펼치기
1 ==============================================
2 MFP Configuration for PXA2xx/PXA3xx Processors
3 ==============================================
4
5 Eric Miao <eric.miao@marvell.com>
6
7 MFP stands for Multi-Function Pin, which is the pin-mux logic on PXA3xx and
8 later PXA series processors. This document describes the existing MFP API,
9 and how board/platform driver authors could make use of it.
10
11 Basic Concept
12 =============
13
14 Unlike the GPIO alternate function settings on PXA25x and PXA27x, a new MFP
15 mechanism is introduced from PXA3xx to completely move the pin-mux functions
16 out of the GPIO controller. In addition to pin-mux configurations, the MFP
17 also controls the low power state, driving strength, pull-up/down and event
18 detection of each pin. Below is a diagram of internal connections between
19 the MFP logic and the remaining SoC peripherals::
20
21 +--------+
22 | |--(GPIO19)--+
23 | GPIO | |
24 | |--(GPIO...) |
25 +--------+ |
26 | +---------+
27 +--------+ +------>| |
28 | PWM2 |--(PWM_OUT)-------->| MFP |
29 +--------+ +------>| |-------> to external PAD
30 | +---->| |
31 +--------+ | | +-->| |
32 | SSP2 |---(TXD)----+ | | +---------+
33 +--------+ | |
34 | |
35 +--------+ | |
36 | Keypad |--(MKOUT4)----+ |
37 +--------+ |
38 |
39 +--------+ |
40 | UART2 |---(TXD)--------+
41 +--------+
42
43 NOTE: the external pad is named as MFP_PIN_GPIO19, it doesn't necessarily
44 mean it's dedicated for GPIO19, only as a hint that internally this pin
45 can be routed from GPIO19 of the GPIO controller.
46
47 To better understand the change from PXA25x/PXA27x GPIO alternate function
48 to this new MFP mechanism, here are several key points:
49
50 1. GPIO controller on PXA3xx is now a dedicated controller, same as other
51 internal controllers like PWM, SSP and UART, with 128 internal signals
52 which can be routed to external through one or more MFPs (e.g. GPIO<0>
53 can be routed through either MFP_PIN_GPIO0 as well as MFP_PIN_GPIO0_2,
54 see arch/arm/mach-pxa/mfp-pxa300.h)
55
56 2. Alternate function configuration is removed from this GPIO controller,
57 the remaining functions are pure GPIO-specific, i.e.
58
59 - GPIO signal level control
60 - GPIO direction control
61 - GPIO level change detection
62
63 3. Low power state for each pin is now controlled by MFP, this means the
64 PGSRx registers on PXA2xx are now useless on PXA3xx
65
66 4. Wakeup detection is now controlled by MFP, PWER does not control the
67 wakeup from GPIO(s) any more, depending on the sleeping state, ADxER
68 (as defined in pxa3xx-regs.h) controls the wakeup from MFP
69
70 NOTE: with such a clear separation of MFP and GPIO, by GPIO<xx> we normally
71 mean it is a GPIO signal, and by MFP<xxx> or pin xxx, we mean a physical
72 pad (or ball).
73
74 MFP API Usage
75 =============
76
77 For board code writers, here are some guidelines:
78
79 1. include ONE of the following header files in your <board>.c:
80
81 - #include "mfp-pxa25x.h"
82 - #include "mfp-pxa27x.h"
83 - #include "mfp-pxa300.h"
84 - #include "mfp-pxa320.h"
85 - #include "mfp-pxa930.h"
86
87 NOTE: only one file in your <board>.c, depending on the processors used,
88 because pin configuration definitions may conflict in these file (i.e.
89 same name, different meaning and settings on different processors). E.g.
90 for zylonite platform, which support both PXA300/PXA310 and PXA320, two
91 separate files are introduced: zylonite_pxa300.c and zylonite_pxa320.c
92 (in addition to handle MFP configuration differences, they also handle
93 the other differences between the two combinations).
94
95 NOTE: PXA300 and PXA310 are almost identical in pin configurations (with
96 PXA310 supporting some additional ones), thus the difference is actually
97 covered in a single mfp-pxa300.h.
98
99 2. prepare an array for the initial pin configurations, e.g.::
100
101 static unsigned long mainstone_pin_config[] __initdata = {
102 /* Chip Select */
103 GPIO15_nCS_1,
104
105 /* LCD - 16bpp Active TFT */
106 GPIOxx_TFT_LCD_16BPP,
107 GPIO16_PWM0_OUT, /* Backlight */
108
109 /* MMC */
110 GPIO32_MMC_CLK,
111 GPIO112_MMC_CMD,
112 GPIO92_MMC_DAT_0,
113 GPIO109_MMC_DAT_1,
114 GPIO110_MMC_DAT_2,
115 GPIO111_MMC_DAT_3,
116
117 ...
118
119 /* GPIO */
120 GPIO1_GPIO | WAKEUP_ON_EDGE_BOTH,
121 };
122
123 a) once the pin configurations are passed to pxa{2xx,3xx}_mfp_config(),
124 and written to the actual registers, they are useless and may discard,
125 adding '__initdata' will help save some additional bytes here.
126
127 b) when there is only one possible pin configurations for a component,
128 some simplified definitions can be used, e.g. GPIOxx_TFT_LCD_16BPP on
129 PXA25x and PXA27x processors
130
131 c) if by board design, a pin can be configured to wake up the system
132 from low power state, it can be 'OR'ed with any of:
133
134 WAKEUP_ON_EDGE_BOTH
135 WAKEUP_ON_EDGE_RISE
136 WAKEUP_ON_EDGE_FALL
137 WAKEUP_ON_LEVEL_HIGH - specifically for enabling of keypad GPIOs,
138
139 to indicate that this pin has the capability of wake-up the system,
140 and on which edge(s). This, however, doesn't necessarily mean the
141 pin _will_ wakeup the system, it will only when set_irq_wake() is
142 invoked with the corresponding GPIO IRQ (GPIO_IRQ(xx) or gpio_to_irq())
143 and eventually calls gpio_set_wake() for the actual register setting.
144
145 d) although PXA3xx MFP supports edge detection on each pin, the
146 internal logic will only wakeup the system when those specific bits
147 in ADxER registers are set, which can be well mapped to the
148 corresponding peripheral, thus set_irq_wake() can be called with
149 the peripheral IRQ to enable the wakeup.
150
151
152 MFP on PXA3xx
153 =============
154
155 Every external I/O pad on PXA3xx (excluding those for special purpose) has
156 one MFP logic associated, and is controlled by one MFP register (MFPR).
157
158 The MFPR has the following bit definitions (for PXA300/PXA310/PXA320)::
159
160 31 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
161 +-------------------------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
162 | RESERVED |PS|PU|PD| DRIVE |SS|SD|SO|EC|EF|ER|--| AF_SEL |
163 +-------------------------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
164
165 Bit 3: RESERVED
166 Bit 4: EDGE_RISE_EN - enable detection of rising edge on this pin
167 Bit 5: EDGE_FALL_EN - enable detection of falling edge on this pin
168 Bit 6: EDGE_CLEAR - disable edge detection on this pin
169 Bit 7: SLEEP_OE_N - enable outputs during low power modes
170 Bit 8: SLEEP_DATA - output data on the pin during low power modes
171 Bit 9: SLEEP_SEL - selection control for low power modes signals
172 Bit 13: PULLDOWN_EN - enable the internal pull-down resistor on this pin
173 Bit 14: PULLUP_EN - enable the internal pull-up resistor on this pin
174 Bit 15: PULL_SEL - pull state controlled by selected alternate function
175 (0) or by PULL{UP,DOWN}_EN bits (1)
176
177 Bit 0 - 2: AF_SEL - alternate function selection, 8 possibilities, from 0-7
178 Bit 10-12: DRIVE - drive strength and slew rate
179 0b000 - fast 1mA
180 0b001 - fast 2mA
181 0b002 - fast 3mA
182 0b003 - fast 4mA
183 0b004 - slow 6mA
184 0b005 - fast 6mA
185 0b006 - slow 10mA
186 0b007 - fast 10mA
187
188 MFP Design for PXA2xx/PXA3xx
189 ============================
190
191 Due to the difference of pin-mux handling between PXA2xx and PXA3xx, a unified
192 MFP API is introduced to cover both series of processors.
193
194 The basic idea of this design is to introduce definitions for all possible pin
195 configurations, these definitions are processor and platform independent, and
196 the actual API invoked to convert these definitions into register settings and
197 make them effective there-after.
198
199 Files Involved
200 --------------
201
202 - arch/arm/mach-pxa/include/mach/mfp.h
203
204 for
205 1. Unified pin definitions - enum constants for all configurable pins
206 2. processor-neutral bit definitions for a possible MFP configuration
207
208 - arch/arm/mach-pxa/mfp-pxa3xx.h
209
210 for PXA3xx specific MFPR register bit definitions and PXA3xx common pin
211 configurations
212
213 - arch/arm/mach-pxa/mfp-pxa2xx.h
214
215 for PXA2xx specific definitions and PXA25x/PXA27x common pin configurations
216
217 - arch/arm/mach-pxa/mfp-pxa25x.h
218 arch/arm/mach-pxa/mfp-pxa27x.h
219 arch/arm/mach-pxa/mfp-pxa300.h
220 arch/arm/mach-pxa/mfp-pxa320.h
221 arch/arm/mach-pxa/mfp-pxa930.h
222
223 for processor specific definitions
224
225 - arch/arm/mach-pxa/mfp-pxa3xx.c
226 - arch/arm/mach-pxa/mfp-pxa2xx.c
227
228 for implementation of the pin configuration to take effect for the actual
229 processor.
230
231 Pin Configuration
232 -----------------
233
234 The following comments are copied from mfp.h (see the actual source code
235 for most updated info)::
236
237 /*
238 * a possible MFP configuration is represented by a 32-bit integer
239 *
240 * bit 0.. 9 - MFP Pin Number (1024 Pins Maximum)
241 * bit 10..12 - Alternate Function Selection
242 * bit 13..15 - Drive Strength
243 * bit 16..18 - Low Power Mode State
244 * bit 19..20 - Low Power Mode Edge Detection
245 * bit 21..22 - Run Mode Pull State
246 *
247 * to facilitate the definition, the following macros are provided
248 *
249 * MFP_CFG_DEFAULT - default MFP configuration value, with
250 * alternate function = 0,
251 * drive strength = fast 3mA (MFP_DS03X)
252 * low power mode = default
253 * edge detection = none
254 *
255 * MFP_CFG - default MFPR value with alternate function
256 * MFP_CFG_DRV - default MFPR value with alternate function and
257 * pin drive strength
258 * MFP_CFG_LPM - default MFPR value with alternate function and
259 * low power mode
260 * MFP_CFG_X - default MFPR value with alternate function,
261 * pin drive strength and low power mode
262 */
263
264 Examples of pin configurations are::
265
266 #define GPIO94_SSP3_RXD MFP_CFG_X(GPIO94, AF1, DS08X, FLOAT)
267
268 which reads GPIO94 can be configured as SSP3_RXD, with alternate function
269 selection of 1, driving strength of 0b101, and a float state in low power
270 modes.
271
272 NOTE: this is the default setting of this pin being configured as SSP3_RXD
273 which can be modified a bit in board code, though it is not recommended to
274 do so, simply because this default setting is usually carefully encoded,
275 and is supposed to work in most cases.
276
277 Register Settings
278 -----------------
279
280 Register settings on PXA3xx for a pin configuration is actually very
281 straight-forward, most bits can be converted directly into MFPR value
282 in a easier way. Two sets of MFPR values are calculated: the run-time
283 ones and the low power mode ones, to allow different settings.
284
285 The conversion from a generic pin configuration to the actual register
286 settings on PXA2xx is a bit complicated: many registers are involved,
287 including GAFRx, GPDRx, PGSRx, PWER, PKWR, PFER and PRER. Please see
288 mfp-pxa2xx.c for how the conversion is made.
289

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

PXA2xx/PXA3xx 프로세서의 MFP 구성

1-10

저자는 Eric Miao `<eric.miao@marvell.com>`입니다.

MFP는 Multi-Function Pin의 약자로 PXA3xx와 이후 PXA 계열 프로세서의 pin-mux logic을 뜻합니다. 이 문서는 기존 MFP API와 board/platform 드라이버 작성자가 이를 사용하는 방법을 설명합니다.

기본 개념

11-73

PXA25x와 PXA27x의 GPIO alternate-function 설정과 달리 PXA3xx부터는 새 MFP 메커니즘이 pin-mux 기능을 GPIO controller 밖으로 완전히 분리합니다. MFP는 pin-mux뿐 아니라 각 pin의 low-power state, drive strength, pull-up/down, event detection도 제어합니다.

SoC 내부 신호에서 외부 PAD까지
GPIO controller / GPIO19MFPexternal PAD
PWM2 / PWM_OUTMFPexternal PAD
SSP2 / TXDMFPexternal PAD
Keypad / MKOUT4MFPexternal PAD
UART2 / TXDMFPexternal PAD

GPIO19, PWM2, SSP2, Keypad, UART2의 내부 신호 가운데 선택된 하나가 MFP를 거쳐 동일한 외부 PAD로 라우팅됩니다.

외부 pad 이름이 `MFP_PIN_GPIO19`라고 해서 GPIO19 전용이라는 뜻은 아닙니다. GPIO controller의 GPIO19를 내부적으로 이 pin에 라우팅할 수 있다는 힌트일 뿐입니다.

PXA25x/PXA27x의 GPIO alternate function에서 새 MFP 방식으로 바뀐 핵심은 다음과 같습니다.

  • PXA3xx의 GPIO controller는 PWM, SSP, UART 같은 다른 내부 controller와 동등한 전용 controller가 되었습니다. 128개 내부 신호는 하나 이상의 MFP를 거쳐 외부로 라우팅할 수 있습니다. 예를 들어 `GPIO<0>`은 `MFP_PIN_GPIO0` 또는 `MFP_PIN_GPIO0_2`로 라우팅할 수 있으며 `arch/arm/mach-pxa/mfp-pxa300.h`를 참조합니다.
  • alternate-function 구성은 GPIO controller에서 제거되었습니다. 남은 기능은 GPIO signal level 제어, GPIO direction 제어, GPIO level-change detection처럼 순수 GPIO 기능입니다.
  • 각 pin의 low-power state는 MFP가 제어하므로 PXA2xx의 `PGSRx` register는 PXA3xx에서 쓸모가 없습니다.
  • wakeup detection도 MFP가 제어합니다. `PWER`는 더 이상 GPIO wakeup을 제어하지 않으며, sleep state에 따라 `pxa3xx-regs.h`에 정의된 `ADxER`가 MFP wakeup을 제어합니다.

MFP와 GPIO가 명확히 분리되므로 `GPIO<xx>`는 일반적으로 GPIO signal을, `MFP<xxx>` 또는 pin xxx는 물리 pad나 ball을 뜻합니다.

MFP API 사용법

74-151

board code 작성자는 `<board>.c`에서 사용하는 processor에 맞춰 다음 header 중 하나만 include해야 합니다.

  • `#include "mfp-pxa25x.h"`
  • `#include "mfp-pxa27x.h"`
  • `#include "mfp-pxa300.h"`
  • `#include "mfp-pxa320.h"`
  • `#include "mfp-pxa930.h"`

processor마다 같은 이름이 서로 다른 의미와 설정을 가질 수 있어 pin configuration 정의가 충돌하므로 `<board>.c`에는 하나만 포함해야 합니다. PXA300/PXA310과 PXA320을 모두 지원하는 zylonite는 `zylonite_pxa300.c`와 `zylonite_pxa320.c`로 나누어 MFP와 그 밖의 조합별 차이를 처리합니다.

PXA300과 PXA310의 pin configuration은 거의 같고 PXA310에 일부 설정이 추가된 정도이므로 두 processor의 차이는 하나의 `mfp-pxa300.h`가 다룹니다.

초기 pin configuration 배열은 다음과 같이 준비합니다.

static unsigned long mainstone_pin_config[] __initdata = {
   /* Chip Select */
   GPIO15_nCS_1,

   /* LCD - 16bpp Active TFT */
   GPIOxx_TFT_LCD_16BPP,
   GPIO16_PWM0_OUT,        /* Backlight */

   /* MMC */
   GPIO32_MMC_CLK,
   GPIO112_MMC_CMD,
   GPIO92_MMC_DAT_0,
   GPIO109_MMC_DAT_1,
   GPIO110_MMC_DAT_2,
   GPIO111_MMC_DAT_3,

   ...

   /* GPIO */
   GPIO1_GPIO | WAKEUP_ON_EDGE_BOTH,
};
  • pin configuration을 `pxa{2xx,3xx}_mfp_config()`에 전달해 실제 register에 기록하면 배열은 더 이상 필요하지 않습니다. `__initdata`를 붙이면 초기화 후 버려져 몇 byte를 더 절약할 수 있습니다.
  • 한 component에 가능한 pin configuration이 하나뿐이면 PXA25x/PXA27x의 `GPIOxx_TFT_LCD_16BPP`처럼 단순화한 정의를 사용할 수 있습니다.
  • board 설계상 어떤 pin이 low-power state에서 system을 깨울 수 있다면 `WAKEUP_ON_EDGE_BOTH`, `WAKEUP_ON_EDGE_RISE`, `WAKEUP_ON_EDGE_FALL`, 또는 keypad GPIO 활성화용 `WAKEUP_ON_LEVEL_HIGH`를 OR하여 wakeup capability와 edge를 표시할 수 있습니다.

wakeup capability를 pin configuration에 표시했다고 해서 그 pin이 자동으로 system을 깨우는 것은 아닙니다. 대응 GPIO IRQ인 `GPIO_IRQ(xx)` 또는 `gpio_to_irq()`에 대해 `set_irq_wake()`를 호출하고, 최종적으로 `gpio_set_wake()`가 실제 register를 설정해야 합니다.

PXA3xx MFP는 pin마다 edge detection을 지원하지만 내부 logic은 `ADxER` register의 해당 bit가 설정된 경우에만 system을 깨웁니다. 이 bit는 대응 peripheral에 매핑할 수 있으므로 peripheral IRQ에 `set_irq_wake()`를 호출해 wakeup을 활성화할 수 있습니다.

PXA3xx의 MFP

152-187

특수 목적 pad를 제외한 PXA3xx의 모든 외부 I/O pad에는 MFP logic 하나가 연결되며, 각각 하나의 MFP register인 `MFPR`로 제어합니다.

PXA300/PXA310/PXA320 MFPR bitfield
bitfield의미
31:16RESERVED예약 영역
15PS`PULL_SEL`
14PU`PULLUP_EN`
13PD`PULLDOWN_EN`
12:10DRIVEdrive strength와 slew rate
9SS`SLEEP_SEL`
8SD`SLEEP_DATA`
7SO`SLEEP_OE_N`
6EC`EDGE_CLEAR`
5EF`EDGE_FALL_EN`
4ER`EDGE_RISE_EN`
3RESERVED예약 bit
2:0AF_SELalternate function 선택

원문의 32-bit ASCII register 그림을 field별 구조로 다시 나타냈습니다.

각 control bit의 동작은 다음과 같습니다.

bit이름동작
3RESERVED예약됨
4`EDGE_RISE_EN`이 pin의 rising edge detection 활성화
5`EDGE_FALL_EN`이 pin의 falling edge detection 활성화
6`EDGE_CLEAR`이 pin의 edge detection 비활성화
7`SLEEP_OE_N`low-power mode에서 output 활성화
8`SLEEP_DATA`low-power mode에서 pin에 출력할 data
9`SLEEP_SEL`low-power mode signal 선택 제어
13`PULLDOWN_EN`내부 pull-down resistor 활성화
14`PULLUP_EN`내부 pull-up resistor 활성화
15`PULL_SEL`pull state를 selected alternate function이 제어하면 `0`, `PULL{UP,DOWN}_EN` bit가 제어하면 `1`
0-2`AF_SEL`0~7 가운데 하나를 고르는 8가지 alternate-function selection
10-12`DRIVE`drive strength와 slew rate 선택
DRIVE 값slew전류
`0b000`fast1mA
`0b001`fast2mA
`0b002`fast3mA
`0b003`fast4mA
`0b004`slow6mA
`0b005`fast6mA
`0b006`slow10mA
`0b007`fast10mA

PXA2xx/PXA3xx 통합 MFP 설계

188-198

PXA2xx와 PXA3xx는 pin-mux 처리 방식이 다르므로 두 processor 계열을 모두 포괄하는 통합 MFP API를 도입했습니다.

설계의 기본 생각은 가능한 모든 pin configuration을 processor와 platform에 독립적인 정의로 표현한 뒤, 실제 API가 이를 processor register 설정으로 변환해 적용하도록 하는 것입니다.

관련 파일

199-230
파일책임
`arch/arm/mach-pxa/include/mach/mfp.h`모든 configurable pin의 통합 enum 정의와 processor-neutral MFP configuration bit 정의
`arch/arm/mach-pxa/mfp-pxa3xx.h`PXA3xx 고유 MFPR register bit와 PXA3xx 공통 pin configuration 정의
`arch/arm/mach-pxa/mfp-pxa2xx.h`PXA2xx 고유 정의와 PXA25x/PXA27x 공통 pin configuration
`mfp-pxa25x.h`, `mfp-pxa27x.h`, `mfp-pxa300.h`, `mfp-pxa320.h`, `mfp-pxa930.h`processor별 정의. 원문 경로는 모두 `arch/arm/mach-pxa/` 아래입니다.
`arch/arm/mach-pxa/mfp-pxa3xx.c`, `arch/arm/mach-pxa/mfp-pxa2xx.c`실제 processor에서 pin configuration을 적용하는 구현

Pin configuration

231-276

다음 주석은 `mfp.h`에서 복사한 것입니다. 최신 정보는 실제 source code를 확인해야 합니다.

/*
 * a possible MFP configuration is represented by a 32-bit integer
 *
 * bit  0.. 9 - MFP Pin Number (1024 Pins Maximum)
 * bit 10..12 - Alternate Function Selection
 * bit 13..15 - Drive Strength
 * bit 16..18 - Low Power Mode State
 * bit 19..20 - Low Power Mode Edge Detection
 * bit 21..22 - Run Mode Pull State
 *
 * to facilitate the definition, the following macros are provided
 *
 * MFP_CFG_DEFAULT - default MFP configuration value, with
 *                   alternate function = 0,
 *                   drive strength = fast 3mA (MFP_DS03X)
 *                   low power mode = default
 *                   edge detection = none
 *
 * MFP_CFG        - default MFPR value with alternate function
 * MFP_CFG_DRV        - default MFPR value with alternate function and
 *                   pin drive strength
 * MFP_CFG_LPM        - default MFPR value with alternate function and
 *                   low power mode
 * MFP_CFG_X        - default MFPR value with alternate function,
 *                   pin drive strength and low power mode
 */

가능한 MFP configuration 하나는 32-bit integer로 표현됩니다.

bit필드
0..9MFP pin number, 최대 1024개 pin
10..12Alternate Function Selection
13..15Drive Strength
16..18Low Power Mode State
19..20Low Power Mode Edge Detection
21..22Run Mode Pull State
macro용도
`MFP_CFG_DEFAULT`AF=0, fast 3mA(`MFP_DS03X`), 기본 low-power mode, edge detection 없음
`MFP_CFG`기본 MFPR 값과 alternate function
`MFP_CFG_DRV`기본 MFPR 값, alternate function, pin drive strength
`MFP_CFG_LPM`기본 MFPR 값, alternate function, low-power mode
`MFP_CFG_X`기본 MFPR 값, alternate function, pin drive strength, low-power mode

pin configuration 예는 다음과 같습니다.

#define GPIO94_SSP3_RXD                MFP_CFG_X(GPIO94, AF1, DS08X, FLOAT)

이 정의는 GPIO94를 `SSP3_RXD`로 구성할 수 있으며 alternate-function selection은 1, drive strength는 `0b101`, low-power mode에서는 float state라는 뜻입니다.

이 값은 pin을 `SSP3_RXD`로 구성할 때의 기본 설정입니다. board code에서 일부를 바꿀 수는 있지만, 기본값은 보통 신중히 encoding되어 대부분의 경우 동작하도록 설계되므로 수정은 권장하지 않습니다.

Register 설정

277-288

PXA3xx에서는 generic pin configuration의 대부분 bit를 MFPR 값으로 직접 변환할 수 있어 register 설정이 비교적 단순합니다. runtime용과 low-power mode용 MFPR 값을 각각 계산하여 두 상태에 다른 설정을 적용할 수 있습니다.

PXA2xx에서 generic pin configuration을 실제 register 설정으로 바꾸는 과정은 더 복잡합니다. `GAFRx`, `GPDRx`, `PGSRx`, `PWER`, `PKWR`, `PFER`, `PRER` 등 여러 register가 관여합니다. 변환 방법은 `mfp-pxa2xx.c`를 참조하십시오.