← Documents Documentation/devicetree/bindings/mmc/ti-omap-hsmmc.txt GitHub 원문 ↗

Linux 6.18.37 · Devicetree Bindings

TI OMAP High-Speed MMC

OMAP·66AK2G HSMMC와 AM33xx suspend SDIO wake 우회입니다.

Source pathDocumentation/devicetree/bindings/mmc/ti-omap-hsmmc.txt
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

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

1. 요약·해설

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

요약과 해설

ti-omap-hsmmc.txt:1-134

SoC별 clock·power 요구, DMA와 DAT1 GPIO remux 절차를 설명합니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 * TI Highspeed MMC host controller for OMAP and 66AK2G family.
2
3 The Highspeed MMC Host Controller on TI OMAP and 66AK2G family
4 provides an interface for MMC, SD, and SDIO types of memory cards.
5
6 This file documents differences between the core properties described
7 by mmc.txt and the properties used by the omap_hsmmc driver.
8
9 Required properties:
10 --------------------
11 - compatible:
12 Should be "ti,omap2-hsmmc", for OMAP2 controllers
13 Should be "ti,omap3-hsmmc", for OMAP3 controllers
14 Should be "ti,omap3-pre-es3-hsmmc" for OMAP3 controllers pre ES3.0
15 Should be "ti,omap4-hsmmc", for OMAP4 controllers
16 Should be "ti,am33xx-hsmmc", for AM335x controllers
17 Should be "ti,k2g-hsmmc", "ti,omap4-hsmmc" for 66AK2G controllers.
18
19 SoC specific required properties:
20 ---------------------------------
21 The following are mandatory properties for OMAPs, AM33xx and AM43xx SoCs only:
22 - ti,hwmods: Must be "mmc<n>", n is controller instance starting 1.
23
24 The following are mandatory properties for 66AK2G SoCs only:
25 - power-domains:Should contain a phandle to a PM domain provider node
26 and an args specifier containing the MMC device id
27 value. This property is as per the binding,
28 Documentation/devicetree/bindings/soc/ti/sci-pm-domain.yaml
29 - clocks: Must contain an entry for each entry in clock-names. Should
30 be defined as per the he appropriate clock bindings consumer
31 usage in Documentation/devicetree/bindings/clock/ti,sci-clk.yaml
32 - clock-names: Shall be "fck" for the functional clock,
33 and "mmchsdb_fck" for the debounce clock.
34
35
36 Optional properties:
37 --------------------
38 - ti,dual-volt: boolean, supports dual voltage cards
39 - <supply-name>-supply: phandle to the regulator device tree node
40 "supply-name" examples are "vmmc",
41 "vmmc_aux"(deprecated)/"vqmmc" etc
42 - ti,non-removable: non-removable slot (like eMMC)
43 - ti,needs-special-reset: Requires a special softreset sequence
44 - ti,needs-special-hs-handling: HSMMC IP needs special setting
45 for handling High Speed
46 - dmas: List of DMA specifiers with the controller specific
47 format as described in the generic DMA client
48 binding. A tx and rx specifier is required.
49 - dma-names: List of DMA request names. These strings correspond
50 1:1 with the DMA specifiers listed in dmas.
51 The string naming is to be "rx" and "tx" for
52 RX and TX DMA requests, respectively.
53
54 Examples:
55
56 [hwmod populated DMA resources]
57
58 mmc1: mmc@4809c000 {
59 compatible = "ti,omap4-hsmmc";
60 reg = <0x4809c000 0x400>;
61 ti,hwmods = "mmc1";
62 ti,dual-volt;
63 bus-width = <4>;
64 vmmc-supply = <&vmmc>; /* phandle to regulator node */
65 ti,non-removable;
66 };
67
68 [generic DMA request binding]
69
70 mmc1: mmc@4809c000 {
71 compatible = "ti,omap4-hsmmc";
72 reg = <0x4809c000 0x400>;
73 ti,hwmods = "mmc1";
74 ti,dual-volt;
75 bus-width = <4>;
76 vmmc-supply = <&vmmc>; /* phandle to regulator node */
77 ti,non-removable;
78 dmas = <&edma 24
79 &edma 25>;
80 dma-names = "tx", "rx";
81 };
82
83 [workaround for missing swakeup on am33xx]
84
85 This SOC is missing the swakeup line, it will not detect SDIO irq
86 while in suspend.
87
88 ------
89 | PRCM |
90 ------
91 ^ |
92 swakeup | | fclk
93 | v
94 ------ ------- -----
95 | card | -- CIRQ --> | hsmmc | -- IRQ --> | CPU |
96 ------ ------- -----
97
98 In suspend the fclk is off and the module is dysfunctional. Even register reads
99 will fail. A small logic in the host will request fclk restore, when an
100 external event is detected. Once the clock is restored, the host detects the
101 event normally. Since am33xx doesn't have this line it never wakes from
102 suspend.
103
104 The workaround is to reconfigure the dat1 line as a GPIO upon suspend. To make
105 this work, we need to set the named pinctrl states "default" and "idle".
106 Prepare idle to remux dat1 as a gpio, and default to remux it back as sdio
107 dat1. The MMC driver will then toggle between idle and default state during
108 runtime.
109
110 In summary:
111 1. select matching 'compatible' section, see example below.
112 2. specify pinctrl states "default" and "idle", "sleep" is optional.
113 3. specify the gpio irq used for detecting sdio irq in suspend
114
115 If configuration is incomplete, a warning message is emitted "falling back to
116 polling". Also check the "sdio irq mode" in /sys/kernel/debug/mmc0/regs. Mind
117 not every application needs SDIO irq, e.g. MMC cards.
118
119 mmc1: mmc@48060100 {
120 compatible = "ti,am33xx-hsmmc";
121 ...
122 pinctrl-names = "default", "idle", "sleep"
123 pinctrl-0 = <&mmc1_pins>;
124 pinctrl-1 = <&mmc1_idle>;
125 pinctrl-2 = <&mmc1_sleep>;
126 ...
127 interrupts-extended = <&intc 64 &gpio2 28 IRQ_TYPE_LEVEL_LOW>;
128 };
129
130 mmc1_idle : pinmux_cirq_pin {
131 pinctrl-single,pins = <
132 0x0f8 0x3f /* GPIO2_28 */
133 >;
134 };
135

3. 한국어 전문 번역

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

OMAP·66AK2G High-Speed MMC

1-8

TI OMAP 및 66AK2G 계열의 High-Speed MMC Host Controller는 MMC, SD, SDIO memory card interface를 제공합니다. 이 문서는 `mmc.txt`의 core 속성과 `omap_hsmmc` driver 전용 속성의 차이를 설명합니다.

TI High-Speed MMC 역할
OMAP / 66AK2G HSMMCMMC
OMAP / 66AK2G HSMMCSD
OMAP / 66AK2G HSMMCSDIO

하나의 host controller가 세 card protocol을 지원합니다.

Controller별 compatible

9-18

`compatible`은 OMAP2에 `ti,omap2-hsmmc`, OMAP3에 `ti,omap3-hsmmc`, ES3.0 이전 OMAP3에 `ti,omap3-pre-es3-hsmmc`, OMAP4에 `ti,omap4-hsmmc`, AM335x에 `ti,am33xx-hsmmc`를 사용합니다. 66AK2G는 `ti,k2g-hsmmc`와 fallback `ti,omap4-hsmmc`를 함께 사용합니다.

TI HSMMC compatible
SoCcompatible
OMAP2ti,omap2-hsmmc
OMAP3 / pre-ES3.0ti,omap3-hsmmc / ti,omap3-pre-es3-hsmmc
OMAP4 / AM335xti,omap4-hsmmc / ti,am33xx-hsmmc
66AK2Gti,k2g-hsmmc, ti,omap4-hsmmc

SoC 세대와 전용 호환 문자열의 대응입니다.

SoC별 hwmod·power domain·clock

19-35

OMAP, AM33xx, AM43xx SoC에서는 `ti,hwmods`가 필수이며 1부터 시작하는 controller instance를 넣은 `mmc<n>`이어야 합니다.

66AK2G에서만 `power-domains`가 필수이며 PM domain provider node의 phandle과 MMC device ID argument를 포함합니다. 형식은 `Documentation/devicetree/bindings/soc/ti/sci-pm-domain.yaml`을 따릅니다.

66AK2G의 `clocks`는 `clock-names`의 각 항목에 대응하는 entry를 포함하고 `Documentation/devicetree/bindings/clock/ti,sci-clk.yaml`의 consumer 형식을 따라야 합니다. `clock-names`는 functional clock인 `fck`와 debounce clock인 `mmchsdb_fck`입니다.

전압·reset·high-speed·DMA

36-53

선택 boolean `ti,dual-volt`는 dual-voltage card 지원을 뜻합니다. `<supply-name>-supply`는 regulator node의 phandle이며 이름의 예는 `vmmc`, deprecated `vmmc_aux`, 그리고 그 대체인 `vqmmc`입니다. `ti,non-removable`은 eMMC처럼 제거할 수 없는 slot을 나타냅니다.

`ti,needs-special-reset`은 특별한 soft-reset sequence가 필요함을, `ti,needs-special-hs-handling`은 HSMMC IP가 High Speed 처리를 위한 특별한 설정을 필요로 함을 나타냅니다.

`dmas`에는 generic DMA client binding의 controller별 형식으로 TX와 RX specifier를 넣습니다. `dma-names`는 각 specifier와 1:1로 대응하며 RX와 TX request의 이름은 각각 `rx`, `tx`입니다.

hwmod가 채운 DMA resource

54-67

첫 예제는 DMA resource를 hwmod가 채우는 구성입니다. OMAP4 `mmc1`에 dual-voltage, 4-bit bus, VMMC regulator와 non-removable slot을 설정하며 DTS에 `dmas`를 직접 쓰지 않습니다.

[hwmod populated DMA resources]

        mmc1: mmc@4809c000 {
                compatible = "ti,omap4-hsmmc";
                reg = <0x4809c000 0x400>;
                ti,hwmods = "mmc1";
                ti,dual-volt;
                bus-width = <4>;
                vmmc-supply = <&vmmc>; /* phandle to regulator node */
                ti,non-removable;
        };

Generic DMA request 예제

68-82

두 번째 예제는 같은 controller에 EDMA request 24와 25를 직접 지정하고 이름을 `tx`, `rx`로 연결합니다.

[generic DMA request binding]

        mmc1: mmc@4809c000 {
                compatible = "ti,omap4-hsmmc";
                reg = <0x4809c000 0x400>;
                ti,hwmods = "mmc1";
                ti,dual-volt;
                bus-width = <4>;
                vmmc-supply = <&vmmc>; /* phandle to regulator node */
                ti,non-removable;
                dmas = <&edma 24
                        &edma 25>;
                dma-names = "tx", "rx";
        };

AM33xx swakeup 누락 우회

83-118

AM33xx SoC에는 `swakeup` line이 없으므로 suspend 중 SDIO IRQ를 감지하지 못합니다. 정상 구조에서는 card의 CIRQ가 HSMMC로 들어오고 HSMMC가 CPU에 IRQ를 보내며, HSMMC와 PRCM 사이에는 wake 요청인 `swakeup`과 functional clock인 `fclk`가 오갑니다.

정상 HSMMC wake·clock 흐름
CardCIRQ → HSMMC
CIRQ → HSMMCHSMMC
HSMMCIRQ → CPU
IRQ → CPUCPU
HSMMCswakeup → PRCM
swakeup → PRCMPRCM
PRCMfclk → HSMMC
fclk → HSMMCHSMMC

원문의 ASCII 그림을 같은 신호 방향과 구성요소를 보존한 구조화 도식으로 다시 그렸습니다.

Suspend 중에는 `fclk`가 꺼져 module이 동작하지 않고 register read도 실패합니다. 정상 host의 작은 logic은 외부 event를 감지하면 `fclk` 복원을 요청하고, clock이 돌아오면 event를 일반 방식으로 감지합니다. AM33xx에는 이 요청 line이 없기 때문에 suspend에서 깨어나지 못합니다.

우회 방법은 suspend 때 DAT1 line을 GPIO로 재구성하는 것입니다. `default`와 `idle`이라는 pinctrl state를 정의하고, `idle`에서는 DAT1을 GPIO로 remux하며 `default`에서는 SDIO DAT1로 되돌립니다. MMC driver는 runtime 중 두 state를 전환합니다.

구성 순서는 1) 아래 예제와 일치하는 `compatible` section을 선택하고, 2) `default`와 `idle` pinctrl state를 지정하며 선택적으로 `sleep`을 추가하고, 3) suspend 중 SDIO IRQ를 감지할 GPIO IRQ를 지정하는 것입니다.

구성이 불완전하면 `falling back to polling` 경고가 출력됩니다. `/sys/kernel/debug/mmc0/regs`의 `sdio irq mode`도 확인할 수 있습니다. MMC card처럼 모든 응용이 SDIO IRQ를 필요로 하는 것은 아닙니다.

DAT1 GPIO remux 예제

119-134

예제는 AM33xx `mmc1`에 `default`, `idle`, `sleep` pinctrl state를 연결하고, controller interrupt 64와 GPIO2_28의 level-low interrupt를 `interrupts-extended`로 함께 지정합니다. `mmc1_idle` state에서는 offset `0x0f8`을 GPIO2_28 mode로 설정합니다.

mmc1: mmc@48060100 {
        compatible = "ti,am33xx-hsmmc";
        ...
        pinctrl-names = "default", "idle", "sleep"
        pinctrl-0 = <&mmc1_pins>;
        pinctrl-1 = <&mmc1_idle>;
        pinctrl-2 = <&mmc1_sleep>;
        ...
        interrupts-extended = <&intc 64 &gpio2 28 IRQ_TYPE_LEVEL_LOW>;
};

mmc1_idle : pinmux_cirq_pin {
        pinctrl-single,pins = <
                0x0f8 0x3f      /* GPIO2_28 */
        >;
};