Documentation/driver-api/memory-devices/ti-gpmc.rst GitHub 원문 ↗

Linux 6.18.37 · Driver API

General Purpose Memory Controller

TI GPMC의 peripheral timing 변환과 read·write mode별 dependency를 설명하는 전문 번역입니다.

Source pathDocumentation/driver-api/memory-devices/ti-gpmc.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

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

1. 요약·해설

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

요약과 해설

ti-gpmc.rst:1-179

Generic timing routine은 peripheral datasheet의 시간·cycle 조건을 GPMC clock과 mux·sync mode에 맞는 controller timing으로 변환합니다.

문서 구성
원문 줄내용
1-19Controller와 대상 memory
20-53Generic timing 계산
54-73공통·sync mapping
74-117Read mode mapping
118-169Write mode mapping
170-179간접 dependency

2. 영어 원문 전체

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

원문 전체 펼치기
1 .. SPDX-License-Identifier: GPL-2.0
2
3 ========================================
4 GPMC (General Purpose Memory Controller)
5 ========================================
6
7 GPMC is an unified memory controller dedicated to interfacing external
8 memory devices like
9
10 * Asynchronous SRAM like memories and application specific integrated
11 circuit devices.
12 * Asynchronous, synchronous, and page mode burst NOR flash devices
13 NAND flash
14 * Pseudo-SRAM devices
15
16 GPMC is found on Texas Instruments SoC's (OMAP based)
17 IP details: https://www.ti.com/lit/pdf/spruh73 section 7.1
18
19
20 GPMC generic timing calculation:
21 ================================
22
23 GPMC has certain timings that has to be programmed for proper
24 functioning of the peripheral, while peripheral has another set of
25 timings. To have peripheral work with gpmc, peripheral timings has to
26 be translated to the form gpmc can understand. The way it has to be
27 translated depends on the connected peripheral. Also there is a
28 dependency for certain gpmc timings on gpmc clock frequency. Hence a
29 generic timing routine was developed to achieve above requirements.
30
31 Generic routine provides a generic method to calculate gpmc timings
32 from gpmc peripheral timings. struct gpmc_device_timings fields has to
33 be updated with timings from the datasheet of the peripheral that is
34 connected to gpmc. A few of the peripheral timings can be fed either
35 in time or in cycles, provision to handle this scenario has been
36 provided (refer struct gpmc_device_timings definition). It may so
37 happen that timing as specified by peripheral datasheet is not present
38 in timing structure, in this scenario, try to correlate peripheral
39 timing to the one available. If that doesn't work, try to add a new
40 field as required by peripheral, educate generic timing routine to
41 handle it, make sure that it does not break any of the existing.
42 Then there may be cases where peripheral datasheet doesn't mention
43 certain fields of struct gpmc_device_timings, zero those entries.
44
45 Generic timing routine has been verified to work properly on
46 multiple onenand's and tusb6010 peripherals.
47
48 A word of caution: generic timing routine has been developed based
49 on understanding of gpmc timings, peripheral timings, available
50 custom timing routines, a kind of reverse engineering without
51 most of the datasheets & hardware (to be exact none of those supported
52 in mainline having custom timing routine) and by simulation.
53
54 gpmc timing dependency on peripheral timings:
55
56 [<gpmc_timing>: <peripheral timing1>, <peripheral timing2> ...]
57
58 1. common
59
60 cs_on:
61 t_ceasu
62 adv_on:
63 t_avdasu, t_ceavd
64
65 2. sync common
66
67 sync_clk:
68 clk
69 page_burst_access:
70 t_bacc
71 clk_activation:
72 t_ces, t_avds
73
74 3. read async muxed
75
76 adv_rd_off:
77 t_avdp_r
78 oe_on:
79 t_oeasu, t_aavdh
80 access:
81 t_iaa, t_oe, t_ce, t_aa
82 rd_cycle:
83 t_rd_cycle, t_cez_r, t_oez
84
85 4. read async non-muxed
86
87 adv_rd_off:
88 t_avdp_r
89 oe_on:
90 t_oeasu
91 access:
92 t_iaa, t_oe, t_ce, t_aa
93 rd_cycle:
94 t_rd_cycle, t_cez_r, t_oez
95
96 5. read sync muxed
97
98 adv_rd_off:
99 t_avdp_r, t_avdh
100 oe_on:
101 t_oeasu, t_ach, cyc_aavdh_oe
102 access:
103 t_iaa, cyc_iaa, cyc_oe
104 rd_cycle:
105 t_cez_r, t_oez, t_ce_rdyz
106
107 6. read sync non-muxed
108
109 adv_rd_off:
110 t_avdp_r
111 oe_on:
112 t_oeasu
113 access:
114 t_iaa, cyc_iaa, cyc_oe
115 rd_cycle:
116 t_cez_r, t_oez, t_ce_rdyz
117
118 7. write async muxed
119
120 adv_wr_off:
121 t_avdp_w
122 we_on, wr_data_mux_bus:
123 t_weasu, t_aavdh, cyc_aavhd_we
124 we_off:
125 t_wpl
126 cs_wr_off:
127 t_wph
128 wr_cycle:
129 t_cez_w, t_wr_cycle
130
131 8. write async non-muxed
132
133 adv_wr_off:
134 t_avdp_w
135 we_on, wr_data_mux_bus:
136 t_weasu
137 we_off:
138 t_wpl
139 cs_wr_off:
140 t_wph
141 wr_cycle:
142 t_cez_w, t_wr_cycle
143
144 9. write sync muxed
145
146 adv_wr_off:
147 t_avdp_w, t_avdh
148 we_on, wr_data_mux_bus:
149 t_weasu, t_rdyo, t_aavdh, cyc_aavhd_we
150 we_off:
151 t_wpl, cyc_wpl
152 cs_wr_off:
153 t_wph
154 wr_cycle:
155 t_cez_w, t_ce_rdyz
156
157 10. write sync non-muxed
158
159 adv_wr_off:
160 t_avdp_w
161 we_on, wr_data_mux_bus:
162 t_weasu, t_rdyo
163 we_off:
164 t_wpl, cyc_wpl
165 cs_wr_off:
166 t_wph
167 wr_cycle:
168 t_cez_w, t_ce_rdyz
169
170
171 Note:
172 Many of gpmc timings are dependent on other gpmc timings (a few
173 gpmc timings purely dependent on other gpmc timings, a reason that
174 some of the gpmc timings are missing above), and it will result in
175 indirect dependency of peripheral timings to gpmc timings other than
176 mentioned above, refer timing routine for more details. To know what
177 these peripheral timings correspond to, please see explanations in
178 struct gpmc_device_timings definition. And for gpmc timings refer
179 IP details (link above).
180

3. 한국어 전문 번역

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

GPMC 개요

1-19

GPMC, 즉 General Purpose Memory Controller는 여러 external memory device를 연결하는 통합 memory controller입니다.

대상에는 asynchronous SRAM 계열 memory와 application-specific IC, asynchronous·synchronous·page-mode burst NOR flash, NAND flash, pseudo-SRAM이 있습니다.

GPMC는 OMAP 기반 Texas Instruments SoC에 있으며 IP 상세는 TI 기술 문서 `spruh73`의 7.1절에서 확인할 수 있습니다.

GPMC 연결 대상
분류장치
AsynchronousSRAM·ASIC
FlashAsync·sync·page burst NOR, NAND
Pseudo memoryPseudo-SRAM

.. SPDX-License-Identifier: GPL-2.0

========================================
GPMC (General Purpose Memory Controller)
========================================

GPMC is an unified memory controller dedicated to interfacing external
memory devices like

 * Asynchronous SRAM like memories and application specific integrated
   circuit devices.
 * Asynchronous, synchronous, and page mode burst NOR flash devices
   NAND flash
 * Pseudo-SRAM devices

GPMC is found on Texas Instruments SoC's (OMAP based)
IP details: https://www.ti.com/lit/pdf/spruh73 section 7.1

Generic timing 계산

20-53

GPMC가 peripheral과 올바르게 동작하려면 controller timing을 program해야 하지만 peripheral datasheet는 별도 timing 집합을 제공합니다. 연결 장치에 따라 peripheral timing을 GPMC가 이해하는 형식으로 변환해야 하며 일부 GPMC timing은 GPMC clock frequency에도 의존합니다.

Generic routine은 `gpmc_device_timings`에 넣은 peripheral datasheet timing으로 GPMC timing을 계산합니다. 일부 값은 시간 또는 cycle 단위로 전달할 수 있습니다.

Datasheet timing이 구조체에 직접 없으면 기존 field와 대응 관계를 찾아야 합니다. 대응할 수 없다면 새 field와 계산 지원을 추가하되 기존 장치를 깨뜨리지 않아야 합니다. Datasheet에 없는 field는 0으로 설정합니다.

Generic routine은 여러 OneNAND와 TUSB6010 peripheral에서 검증되었습니다.

이 routine은 제한된 datasheet와 hardware 상황에서 기존 custom routine의 reverse engineering과 simulation을 바탕으로 개발되었으므로 주의해서 사용해야 합니다.

GPMC timing 변환
Peripheral datasheet`gpmc_device_timings`
시간·cycle 입력Generic timing routine
GPMC clock dependencyGPMC timing register
누락 field0 또는 검증된 새 field 추가

Peripheral datasheet 값을 controller clock과 mode에 맞는 GPMC register timing으로 변환합니다.

GPMC generic timing calculation:
================================

GPMC has certain timings that has to be programmed for proper
functioning of the peripheral, while peripheral has another set of
timings. To have peripheral work with gpmc, peripheral timings has to
be translated to the form gpmc can understand. The way it has to be
translated depends on the connected peripheral. Also there is a
dependency for certain gpmc timings on gpmc clock frequency. Hence a
generic timing routine was developed to achieve above requirements.

Generic routine provides a generic method to calculate gpmc timings
from gpmc peripheral timings. struct gpmc_device_timings fields has to
be updated with timings from the datasheet of the peripheral that is
connected to gpmc. A few of the peripheral timings can be fed either
in time or in cycles, provision to handle this scenario has been
provided (refer struct gpmc_device_timings definition). It may so
happen that timing as specified by peripheral datasheet is not present
in timing structure, in this scenario, try to correlate peripheral
timing to the one available. If that doesn't work, try to add a new
field as required by peripheral, educate generic timing routine to
handle it, make sure that it does not break any of the existing.
Then there may be cases where peripheral datasheet doesn't mention
certain fields of struct gpmc_device_timings, zero those entries.

Generic timing routine has been verified to work properly on
multiple onenand's and tusb6010 peripherals.

A word of caution: generic timing routine has been developed based
on understanding of gpmc timings, peripheral timings, available
custom timing routines, a kind of reverse engineering without
most of the datasheets & hardware (to be exact none of those supported
in mainline having custom timing routine) and by simulation.

공통·synchronous timing dependency

54-73

공통 timing에서 `cs_on`은 `t_ceasu`, `adv_on`은 `t_avdasu`와 `t_ceavd`에 의존합니다.

Synchronous 공통 timing에서 `sync_clk`는 `clk`, `page_burst_access`는 `t_bacc`, `clk_activation`은 `t_ces`와 `t_avds`에 의존합니다.

GPMC 공통 timing mapping
GPMC timingPeripheral timing
`cs_on``t_ceasu`
`adv_on``t_avdasu`, `t_ceavd`
`sync_clk``clk`
`page_burst_access``t_bacc`
`clk_activation``t_ces`, `t_avds`

gpmc timing dependency on peripheral timings:

[<gpmc_timing>: <peripheral timing1>, <peripheral timing2> ...]

1. common

cs_on:
        t_ceasu
adv_on:
        t_avdasu, t_ceavd

2. sync common

sync_clk:
        clk
page_burst_access:
        t_bacc
clk_activation:
        t_ces, t_avds

Read mode timing dependency

74-117

Asynchronous muxed read에서 `adv_rd_off`는 `t_avdp_r`, `oe_on`은 `t_oeasu`·`t_aavdh`, `access`는 `t_iaa`·`t_oe`·`t_ce`·`t_aa`, `rd_cycle`은 `t_rd_cycle`·`t_cez_r`·`t_oez`에 의존합니다.

Asynchronous non-muxed read에서는 `oe_on`에서 `t_aavdh`가 빠지고 나머지 mapping은 동일합니다.

Synchronous muxed read에서 `adv_rd_off`는 `t_avdp_r`·`t_avdh`, `oe_on`은 `t_oeasu`·`t_ach`·`cyc_aavdh_oe`, `access`는 `t_iaa`·`cyc_iaa`·`cyc_oe`, `rd_cycle`은 `t_cez_r`·`t_oez`·`t_ce_rdyz`에 의존합니다.

Synchronous non-muxed read에서는 `adv_rd_off`가 `t_avdp_r`, `oe_on`이 `t_oeasu`이고 access와 cycle mapping은 synchronous muxed mode와 같습니다.

GPMC read timing 요약
Mode`adv_rd_off``oe_on``access``rd_cycle`
Async muxed`t_avdp_r``t_oeasu`, `t_aavdh``t_iaa`, `t_oe`, `t_ce`, `t_aa``t_rd_cycle`, `t_cez_r`, `t_oez`
Async non-muxed`t_avdp_r``t_oeasu``t_iaa`, `t_oe`, `t_ce`, `t_aa``t_rd_cycle`, `t_cez_r`, `t_oez`
Sync muxed`t_avdp_r`, `t_avdh``t_oeasu`, `t_ach`, `cyc_aavdh_oe``t_iaa`, `cyc_iaa`, `cyc_oe``t_cez_r`, `t_oez`, `t_ce_rdyz`
Sync non-muxed`t_avdp_r``t_oeasu``t_iaa`, `cyc_iaa`, `cyc_oe``t_cez_r`, `t_oez`, `t_ce_rdyz`

3. read async muxed

adv_rd_off:
        t_avdp_r
oe_on:
        t_oeasu, t_aavdh
access:
        t_iaa, t_oe, t_ce, t_aa
rd_cycle:
        t_rd_cycle, t_cez_r, t_oez

4. read async non-muxed

adv_rd_off:
        t_avdp_r
oe_on:
        t_oeasu
access:
        t_iaa, t_oe, t_ce, t_aa
rd_cycle:
        t_rd_cycle, t_cez_r, t_oez

5. read sync muxed

adv_rd_off:
        t_avdp_r, t_avdh
oe_on:
        t_oeasu, t_ach, cyc_aavdh_oe
access:
        t_iaa, cyc_iaa, cyc_oe
rd_cycle:
        t_cez_r, t_oez, t_ce_rdyz

6. read sync non-muxed

adv_rd_off:
        t_avdp_r
oe_on:
        t_oeasu
access:
        t_iaa, cyc_iaa, cyc_oe
rd_cycle:
        t_cez_r, t_oez, t_ce_rdyz

Write mode timing dependency

118-169

Asynchronous muxed write에서 `adv_wr_off`는 `t_avdp_w`, `we_on`·`wr_data_mux_bus`는 `t_weasu`·`t_aavdh`·`cyc_aavhd_we`, `we_off`는 `t_wpl`, `cs_wr_off`는 `t_wph`, `wr_cycle`은 `t_cez_w`·`t_wr_cycle`에 의존합니다.

Asynchronous non-muxed write에서는 `we_on`·`wr_data_mux_bus`가 `t_weasu`에만 의존하고 나머지는 같은 mapping을 사용합니다.

Synchronous muxed write에서 `adv_wr_off`는 `t_avdp_w`·`t_avdh`, `we_on`·`wr_data_mux_bus`는 `t_weasu`·`t_rdyo`·`t_aavdh`·`cyc_aavhd_we`, `we_off`는 `t_wpl`·`cyc_wpl`, `cs_wr_off`는 `t_wph`, `wr_cycle`은 `t_cez_w`·`t_ce_rdyz`에 의존합니다.

Synchronous non-muxed write에서는 `adv_wr_off`가 `t_avdp_w`, `we_on`·`wr_data_mux_bus`가 `t_weasu`·`t_rdyo`이고 나머지는 synchronous muxed mode와 같습니다.

GPMC write timing 요약
Mode`adv_wr_off``we_on`·data`we_off``wr_cycle`
Async muxed`t_avdp_w``t_weasu`, `t_aavdh`, `cyc_aavhd_we``t_wpl``t_cez_w`, `t_wr_cycle`
Async non-muxed`t_avdp_w``t_weasu``t_wpl``t_cez_w`, `t_wr_cycle`
Sync muxed`t_avdp_w`, `t_avdh``t_weasu`, `t_rdyo`, `t_aavdh`, `cyc_aavhd_we``t_wpl`, `cyc_wpl``t_cez_w`, `t_ce_rdyz`
Sync non-muxed`t_avdp_w``t_weasu`, `t_rdyo``t_wpl`, `cyc_wpl``t_cez_w`, `t_ce_rdyz`

7. write async muxed

adv_wr_off:
        t_avdp_w
we_on, wr_data_mux_bus:
        t_weasu, t_aavdh, cyc_aavhd_we
we_off:
        t_wpl
cs_wr_off:
        t_wph
wr_cycle:
        t_cez_w, t_wr_cycle

8. write async non-muxed

adv_wr_off:
        t_avdp_w
we_on, wr_data_mux_bus:
        t_weasu
we_off:
        t_wpl
cs_wr_off:
        t_wph
wr_cycle:
        t_cez_w, t_wr_cycle

9. write sync muxed

adv_wr_off:
        t_avdp_w, t_avdh
we_on, wr_data_mux_bus:
        t_weasu, t_rdyo, t_aavdh, cyc_aavhd_we
we_off:
        t_wpl, cyc_wpl
cs_wr_off:
        t_wph
wr_cycle:
        t_cez_w, t_ce_rdyz

10. write sync non-muxed

adv_wr_off:
        t_avdp_w
we_on, wr_data_mux_bus:
        t_weasu, t_rdyo
we_off:
        t_wpl, cyc_wpl
cs_wr_off:
        t_wph
wr_cycle:
        t_cez_w, t_ce_rdyz

간접 timing dependency

170-179

많은 GPMC timing은 다른 GPMC timing에 의존합니다. 일부는 전적으로 다른 controller timing에서 계산되므로 앞의 목록에 나타나지 않습니다.

따라서 peripheral timing은 위에 직접 적힌 것 외의 GPMC timing에도 간접적으로 영향을 줄 수 있습니다. 상세 dependency는 timing routine을 확인해야 합니다.

Peripheral timing의 정의는 `gpmc_device_timings`, GPMC timing은 앞서 연결된 IP 문서를 참고합니다.

간접 dependency
Peripheral timing직접 GPMC timing종속 GPMC timingRegister 설정

Peripheral timing이 중간 GPMC timing을 거쳐 다른 controller timing에 영향을 줄 수 있습니다.


Note:
  Many of gpmc timings are dependent on other gpmc timings (a few
  gpmc timings purely dependent on other gpmc timings, a reason that
  some of the gpmc timings are missing above), and it will result in
  indirect dependency of peripheral timings to gpmc timings other than
  mentioned above, refer timing routine for more details. To know what
  these peripheral timings correspond to, please see explanations in
  struct gpmc_device_timings definition. And for gpmc timings refer
  IP details (link above).