diff options
author | Jon Hunter <jon-hunter@ti.com> | 2013-02-21 19:51:27 -0500 |
---|---|---|
committer | Jon Hunter <jon-hunter@ti.com> | 2013-04-03 21:12:18 -0400 |
commit | d36b4cd46d23dd3c283c2e11de540e4cb875255d (patch) | |
tree | 0592949fab0eee58a2285dffb8735ca6bb606284 | |
parent | 8c8a77712756edcef9298444868537af42334fc0 (diff) |
ARM: OMAP2+: Add additional GPMC timing parameters
Some of the GPMC timings parameters are currently missing from the GPMC
device-tree binding. Add these parameters to the binding documentation
as well as code to read them. Also add either "-ps" or "-ns" suffix to
the GPMC timing properties to indicate whether the timing is in
picoseconds or nanoseconds.
The existing code in gpmc_read_timings_dt() is checking the value of
of_property_read_u32() and only is successful storing the value read
in the gpmc_timings structure. Checking the return value in this case
is not necessary and we can simply read the value, if present, and
store directly in the gpmc_timings structure. Therefore, simplify the
code by removing these checks.
The comment in the gpmc_read_timings_dt() function, "only for OMAP3430"
is also incorrect as it is applicable to all OMAP3+ devices. So correct
this too.
Signed-off-by: Jon Hunter <jon-hunter@ti.com>
Tested-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
-rw-r--r-- | Documentation/devicetree/bindings/bus/ti-gpmc.txt | 78 | ||||
-rw-r--r-- | arch/arm/mach-omap2/gpmc.c | 94 |
2 files changed, 98 insertions, 74 deletions
diff --git a/Documentation/devicetree/bindings/bus/ti-gpmc.txt b/Documentation/devicetree/bindings/bus/ti-gpmc.txt index 6fde1cfe51f8..4b87ea1194e3 100644 --- a/Documentation/devicetree/bindings/bus/ti-gpmc.txt +++ b/Documentation/devicetree/bindings/bus/ti-gpmc.txt | |||
@@ -35,35 +35,59 @@ Required properties: | |||
35 | 35 | ||
36 | Timing properties for child nodes. All are optional and default to 0. | 36 | Timing properties for child nodes. All are optional and default to 0. |
37 | 37 | ||
38 | - gpmc,sync-clk: Minimum clock period for synchronous mode, in picoseconds | 38 | - gpmc,sync-clk-ps: Minimum clock period for synchronous mode, in picoseconds |
39 | 39 | ||
40 | Chip-select signal timings corresponding to GPMC_CONFIG2: | 40 | Chip-select signal timings (in nanoseconds) corresponding to GPMC_CONFIG2: |
41 | - gpmc,cs-on: Assertion time | 41 | - gpmc,cs-on-ns: Assertion time |
42 | - gpmc,cs-rd-off: Read deassertion time | 42 | - gpmc,cs-rd-off-ns: Read deassertion time |
43 | - gpmc,cs-wr-off: Write deassertion time | 43 | - gpmc,cs-wr-off-ns: Write deassertion time |
44 | 44 | ||
45 | ADV signal timings corresponding to GPMC_CONFIG3: | 45 | ADV signal timings (in nanoseconds) corresponding to GPMC_CONFIG3: |
46 | - gpmc,adv-on: Assertion time | 46 | - gpmc,adv-on-ns: Assertion time |
47 | - gpmc,adv-rd-off: Read deassertion time | 47 | - gpmc,adv-rd-off-ns: Read deassertion time |
48 | - gpmc,adv-wr-off: Write deassertion time | 48 | - gpmc,adv-wr-off-ns: Write deassertion time |
49 | 49 | ||
50 | WE signals timings corresponding to GPMC_CONFIG4: | 50 | WE signals timings (in nanoseconds) corresponding to GPMC_CONFIG4: |
51 | - gpmc,we-on: Assertion time | 51 | - gpmc,we-on-ns Assertion time |
52 | - gpmc,we-off: Deassertion time | 52 | - gpmc,we-off-ns: Deassertion time |
53 | 53 | ||
54 | OE signals timings corresponding to GPMC_CONFIG4: | 54 | OE signals timings (in nanoseconds) corresponding to GPMC_CONFIG4: |
55 | - gpmc,oe-on: Assertion time | 55 | - gpmc,oe-on-ns: Assertion time |
56 | - gpmc,oe-off: Deassertion time | 56 | - gpmc,oe-off-ns: Deassertion time |
57 | 57 | ||
58 | Access time and cycle time timings corresponding to GPMC_CONFIG5: | 58 | Access time and cycle time timings (in nanoseconds) corresponding to |
59 | - gpmc,page-burst-access: Multiple access word delay | 59 | GPMC_CONFIG5: |
60 | - gpmc,access: Start-cycle to first data valid delay | 60 | - gpmc,page-burst-access-ns: Multiple access word delay |
61 | - gpmc,rd-cycle: Total read cycle time | 61 | - gpmc,access-ns: Start-cycle to first data valid delay |
62 | - gpmc,wr-cycle: Total write cycle time | 62 | - gpmc,rd-cycle-ns: Total read cycle time |
63 | - gpmc,wr-cycle-ns: Total write cycle time | ||
64 | - gpmc,bus-turnaround-ns: Turn-around time between successive accesses | ||
65 | - gpmc,cycle2cycle-delay-ns: Delay between chip-select pulses | ||
66 | - gpmc,clk-activation-ns: GPMC clock activation time | ||
67 | - gpmc,wait-monitoring-ns: Start of wait monitoring with regard to valid | ||
68 | data | ||
69 | |||
70 | Boolean timing parameters. If property is present parameter enabled and | ||
71 | disabled if omitted: | ||
72 | - gpmc,adv-extra-delay: ADV signal is delayed by half GPMC clock | ||
73 | - gpmc,cs-extra-delay: CS signal is delayed by half GPMC clock | ||
74 | - gpmc,cycle2cycle-diffcsen: Add "cycle2cycle-delay" between successive | ||
75 | accesses to a different CS | ||
76 | - gpmc,cycle2cycle-samecsen: Add "cycle2cycle-delay" between successive | ||
77 | accesses to the same CS | ||
78 | - gpmc,oe-extra-delay: OE signal is delayed by half GPMC clock | ||
79 | - gpmc,we-extra-delay: WE signal is delayed by half GPMC clock | ||
80 | - gpmc,time-para-granularity: Multiply all access times by 2 | ||
63 | 81 | ||
64 | The following are only applicable to OMAP3+ and AM335x: | 82 | The following are only applicable to OMAP3+ and AM335x: |
65 | - gpmc,wr-access | 83 | - gpmc,wr-access-ns: In synchronous write mode, for single or |
66 | - gpmc,wr-data-mux-bus | 84 | burst accesses, defines the number of |
85 | GPMC_FCLK cycles from start access time | ||
86 | to the GPMC_CLK rising edge used by the | ||
87 | memory device for the first data capture. | ||
88 | - gpmc,wr-data-mux-bus-ns: In address-data multiplex mode, specifies | ||
89 | the time when the first data is driven on | ||
90 | the address-data bus. | ||
67 | 91 | ||
68 | GPMC chip-select settings properties for child nodes. All are optional. | 92 | GPMC chip-select settings properties for child nodes. All are optional. |
69 | 93 | ||
diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c index 85231b3a217e..ab658eb1419b 100644 --- a/arch/arm/mach-omap2/gpmc.c +++ b/arch/arm/mach-omap2/gpmc.c | |||
@@ -1230,67 +1230,67 @@ void gpmc_read_settings_dt(struct device_node *np, struct gpmc_settings *p) | |||
1230 | static void __maybe_unused gpmc_read_timings_dt(struct device_node *np, | 1230 | static void __maybe_unused gpmc_read_timings_dt(struct device_node *np, |
1231 | struct gpmc_timings *gpmc_t) | 1231 | struct gpmc_timings *gpmc_t) |
1232 | { | 1232 | { |
1233 | u32 val; | 1233 | struct gpmc_bool_timings *p; |
1234 | |||
1235 | if (!np || !gpmc_t) | ||
1236 | return; | ||
1234 | 1237 | ||
1235 | memset(gpmc_t, 0, sizeof(*gpmc_t)); | 1238 | memset(gpmc_t, 0, sizeof(*gpmc_t)); |
1236 | 1239 | ||
1237 | /* minimum clock period for syncronous mode */ | 1240 | /* minimum clock period for syncronous mode */ |
1238 | if (!of_property_read_u32(np, "gpmc,sync-clk", &val)) | 1241 | of_property_read_u32(np, "gpmc,sync-clk-ps", &gpmc_t->sync_clk); |
1239 | gpmc_t->sync_clk = val; | ||
1240 | 1242 | ||
1241 | /* chip select timtings */ | 1243 | /* chip select timtings */ |
1242 | if (!of_property_read_u32(np, "gpmc,cs-on", &val)) | 1244 | of_property_read_u32(np, "gpmc,cs-on-ns", &gpmc_t->cs_on); |
1243 | gpmc_t->cs_on = val; | 1245 | of_property_read_u32(np, "gpmc,cs-rd-off-ns", &gpmc_t->cs_rd_off); |
1244 | 1246 | of_property_read_u32(np, "gpmc,cs-wr-off-ns", &gpmc_t->cs_wr_off); | |
1245 | if (!of_property_read_u32(np, "gpmc,cs-rd-off", &val)) | ||
1246 | gpmc_t->cs_rd_off = val; | ||
1247 | |||
1248 | if (!of_property_read_u32(np, "gpmc,cs-wr-off", &val)) | ||
1249 | gpmc_t->cs_wr_off = val; | ||
1250 | 1247 | ||
1251 | /* ADV signal timings */ | 1248 | /* ADV signal timings */ |
1252 | if (!of_property_read_u32(np, "gpmc,adv-on", &val)) | 1249 | of_property_read_u32(np, "gpmc,adv-on-ns", &gpmc_t->adv_on); |
1253 | gpmc_t->adv_on = val; | 1250 | of_property_read_u32(np, "gpmc,adv-rd-off-ns", &gpmc_t->adv_rd_off); |
1254 | 1251 | of_property_read_u32(np, "gpmc,adv-wr-off-ns", &gpmc_t->adv_wr_off); | |
1255 | if (!of_property_read_u32(np, "gpmc,adv-rd-off", &val)) | ||
1256 | gpmc_t->adv_rd_off = val; | ||
1257 | |||
1258 | if (!of_property_read_u32(np, "gpmc,adv-wr-off", &val)) | ||
1259 | gpmc_t->adv_wr_off = val; | ||
1260 | 1252 | ||
1261 | /* WE signal timings */ | 1253 | /* WE signal timings */ |
1262 | if (!of_property_read_u32(np, "gpmc,we-on", &val)) | 1254 | of_property_read_u32(np, "gpmc,we-on-ns", &gpmc_t->we_on); |
1263 | gpmc_t->we_on = val; | 1255 | of_property_read_u32(np, "gpmc,we-off-ns", &gpmc_t->we_off); |
1264 | |||
1265 | if (!of_property_read_u32(np, "gpmc,we-off", &val)) | ||
1266 | gpmc_t->we_off = val; | ||
1267 | 1256 | ||
1268 | /* OE signal timings */ | 1257 | /* OE signal timings */ |
1269 | if (!of_property_read_u32(np, "gpmc,oe-on", &val)) | 1258 | of_property_read_u32(np, "gpmc,oe-on-ns", &gpmc_t->oe_on); |
1270 | gpmc_t->oe_on = val; | 1259 | of_property_read_u32(np, "gpmc,oe-off-ns", &gpmc_t->oe_off); |
1271 | |||
1272 | if (!of_property_read_u32(np, "gpmc,oe-off", &val)) | ||
1273 | gpmc_t->oe_off = val; | ||
1274 | 1260 | ||
1275 | /* access and cycle timings */ | 1261 | /* access and cycle timings */ |
1276 | if (!of_property_read_u32(np, "gpmc,page-burst-access", &val)) | 1262 | of_property_read_u32(np, "gpmc,page-burst-access-ns", |
1277 | gpmc_t->page_burst_access = val; | 1263 | &gpmc_t->page_burst_access); |
1278 | 1264 | of_property_read_u32(np, "gpmc,access-ns", &gpmc_t->access); | |
1279 | if (!of_property_read_u32(np, "gpmc,access", &val)) | 1265 | of_property_read_u32(np, "gpmc,rd-cycle-ns", &gpmc_t->rd_cycle); |
1280 | gpmc_t->access = val; | 1266 | of_property_read_u32(np, "gpmc,wr-cycle-ns", &gpmc_t->wr_cycle); |
1281 | 1267 | of_property_read_u32(np, "gpmc,bus-turnaround-ns", | |
1282 | if (!of_property_read_u32(np, "gpmc,rd-cycle", &val)) | 1268 | &gpmc_t->bus_turnaround); |
1283 | gpmc_t->rd_cycle = val; | 1269 | of_property_read_u32(np, "gpmc,cycle2cycle-delay-ns", |
1284 | 1270 | &gpmc_t->cycle2cycle_delay); | |
1285 | if (!of_property_read_u32(np, "gpmc,wr-cycle", &val)) | 1271 | of_property_read_u32(np, "gpmc,wait-monitoring-ns", |
1286 | gpmc_t->wr_cycle = val; | 1272 | &gpmc_t->wait_monitoring); |
1287 | 1273 | of_property_read_u32(np, "gpmc,clk-activation-ns", | |
1288 | /* only for OMAP3430 */ | 1274 | &gpmc_t->clk_activation); |
1289 | if (!of_property_read_u32(np, "gpmc,wr-access", &val)) | 1275 | |
1290 | gpmc_t->wr_access = val; | 1276 | /* only applicable to OMAP3+ */ |
1291 | 1277 | of_property_read_u32(np, "gpmc,wr-access-ns", &gpmc_t->wr_access); | |
1292 | if (!of_property_read_u32(np, "gpmc,wr-data-mux-bus", &val)) | 1278 | of_property_read_u32(np, "gpmc,wr-data-mux-bus-ns", |
1293 | gpmc_t->wr_data_mux_bus = val; | 1279 | &gpmc_t->wr_data_mux_bus); |
1280 | |||
1281 | /* bool timing parameters */ | ||
1282 | p = &gpmc_t->bool_timings; | ||
1283 | |||
1284 | p->cycle2cyclediffcsen = | ||
1285 | of_property_read_bool(np, "gpmc,cycle2cycle-diffcsen"); | ||
1286 | p->cycle2cyclesamecsen = | ||
1287 | of_property_read_bool(np, "gpmc,cycle2cycle-samecsen"); | ||
1288 | p->we_extra_delay = of_property_read_bool(np, "gpmc,we-extra-delay"); | ||
1289 | p->oe_extra_delay = of_property_read_bool(np, "gpmc,oe-extra-delay"); | ||
1290 | p->adv_extra_delay = of_property_read_bool(np, "gpmc,adv-extra-delay"); | ||
1291 | p->cs_extra_delay = of_property_read_bool(np, "gpmc,cs-extra-delay"); | ||
1292 | p->time_para_granularity = | ||
1293 | of_property_read_bool(np, "gpmc,time-para-granularity"); | ||
1294 | } | 1294 | } |
1295 | 1295 | ||
1296 | #ifdef CONFIG_MTD_NAND | 1296 | #ifdef CONFIG_MTD_NAND |