1 .. SPDX-License-Identifier: GPL-2.0
3 ========================================
4 GPMC (General Purpose Memory Controller)
5 ========================================
7 GPMC is an unified memory controller dedicated to interfacing external
10 * Asynchronous SRAM like memories and application specific integrated
12 * Asynchronous, synchronous, and page mode burst NOR flash devices
16 GPMC is found on Texas Instruments SoC's (OMAP based)
17 IP details: https://www.ti.com/lit/pdf/spruh73 section 7.1
20 GPMC generic timing calculation:
21 ================================
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.
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.
45 Generic timing routine has been verified to work properly on
46 multiple onenand's and tusb6010 peripherals.
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.
54 gpmc timing dependency on peripheral timings:
56 [<gpmc_timing>: <peripheral timing1>, <peripheral timing2> ...]
81 t_iaa, t_oe, t_ce, t_aa
83 t_rd_cycle, t_cez_r, t_oez
85 4. read async non-muxed
92 t_iaa, t_oe, t_ce, t_aa
94 t_rd_cycle, t_cez_r, t_oez
101 t_oeasu, t_ach, cyc_aavdh_oe
103 t_iaa, cyc_iaa, cyc_oe
105 t_cez_r, t_oez, t_ce_rdyz
107 6. read sync non-muxed
114 t_iaa, cyc_iaa, cyc_oe
116 t_cez_r, t_oez, t_ce_rdyz
122 we_on, wr_data_mux_bus:
123 t_weasu, t_aavdh, cyc_aavhd_we
131 8. write async non-muxed
135 we_on, wr_data_mux_bus:
148 we_on, wr_data_mux_bus:
149 t_weasu, t_rdyo, t_aavdh, cyc_aavhd_we
157 10. write sync non-muxed
161 we_on, wr_data_mux_bus:
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).