From: Afzal Mohammed <afzal@ti.com> To: tony@atomide.com, jon-hunter@ti.com, paul@pwsan.com, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Afzal Mohammed <afzal@ti.com> Subject: [PATCH v6 09/10] ARM: OMAP2+: smc91x: generic timing calculation Date: Tue, 21 Aug 2012 16:16:00 +0530 [thread overview] Message-ID: <3a90c0a44f09b51fb0cbb4c0d15db4743eb36bc5.1345524670.git.afzal@ti.com> (raw) In-Reply-To: <cover.1345524670.git.afzal@ti.com> Generic gpmc timing calculation helper is available now, use it instead of custom timing calculation. Signed-off-by: Afzal Mohammed <afzal@ti.com> --- arch/arm/mach-omap2/gpmc-smc91x.c | 43 ++++++++++++++---------------------- 1 files changed, 17 insertions(+), 26 deletions(-) diff --git a/arch/arm/mach-omap2/gpmc-smc91x.c b/arch/arm/mach-omap2/gpmc-smc91x.c index ba10c24..43900f9 100644 --- a/arch/arm/mach-omap2/gpmc-smc91x.c +++ b/arch/arm/mach-omap2/gpmc-smc91x.c @@ -57,6 +57,7 @@ static struct platform_device gpmc_smc91x_device = { static int smc91c96_gpmc_retime(void) { struct gpmc_timings t; + struct gpmc_device_timings dev_t; const int t3 = 10; /* Figure 12.2 read and 12.4 write */ const int t4_r = 20; /* Figure 12.2 read */ const int t4_w = 5; /* Figure 12.4 write */ @@ -67,32 +68,6 @@ static int smc91c96_gpmc_retime(void) const int t20 = 185; /* Figure 12.2 read and 12.4 write */ u32 l; - memset(&t, 0, sizeof(t)); - - /* Read timings */ - t.cs_on = 0; - t.adv_on = t.cs_on; - t.oe_on = t.adv_on + t3; - t.access = t.oe_on + t5; - t.oe_off = t.access; - t.adv_rd_off = t.oe_off + max(t4_r, t6); - t.cs_rd_off = t.oe_off; - t.rd_cycle = t20 - t.oe_on; - - /* Write timings */ - t.we_on = t.adv_on + t3; - - if (cpu_is_omap34xx() && (gpmc_cfg->flags & GPMC_MUX_ADD_DATA)) { - t.wr_data_mux_bus = t.we_on; - t.we_off = t.wr_data_mux_bus + t7; - } else - t.we_off = t.we_on + t7; - if (cpu_is_omap34xx()) - t.wr_access = t.we_off; - t.adv_wr_off = t.we_off + max(t4_w, t8); - t.cs_wr_off = t.we_off + t4_w; - t.wr_cycle = t20 - t.we_on; - l = GPMC_CONFIG1_DEVICESIZE_16; if (gpmc_cfg->flags & GPMC_MUX_ADD_DATA) l |= GPMC_CONFIG1_MUXADDDATA; @@ -114,6 +89,22 @@ static int smc91c96_gpmc_retime(void) if (gpmc_cfg->flags & GPMC_MUX_ADD_DATA) return 0; + memset(&dev_t, 0, sizeof(dev_t)); + + dev_t.t_oeasu = t3 * 1000; + dev_t.t_oe = t5 * 1000; + dev_t.t_cez_r = t4_r * 1000; + dev_t.t_oez = t6 * 1000; + dev_t.t_rd_cycle = (t20 - t3) * 1000; + + dev_t.t_weasu = t3 * 1000; + dev_t.t_wpl = t7 * 1000; + dev_t.t_wph = t8 * 1000; + dev_t.t_cez_w = t4_w * 1000; + dev_t.t_wr_cycle = (t20 - t3) * 1000; + + gpmc_calc_timings(&t, &dev_t); + return gpmc_cs_set_timings(gpmc_cfg->cs, &t); } -- 1.7.1
WARNING: multiple messages have this Message-ID (diff)
From: afzal@ti.com (Afzal Mohammed) To: linux-arm-kernel@lists.infradead.org Subject: [PATCH v6 09/10] ARM: OMAP2+: smc91x: generic timing calculation Date: Tue, 21 Aug 2012 16:16:00 +0530 [thread overview] Message-ID: <3a90c0a44f09b51fb0cbb4c0d15db4743eb36bc5.1345524670.git.afzal@ti.com> (raw) In-Reply-To: <cover.1345524670.git.afzal@ti.com> Generic gpmc timing calculation helper is available now, use it instead of custom timing calculation. Signed-off-by: Afzal Mohammed <afzal@ti.com> --- arch/arm/mach-omap2/gpmc-smc91x.c | 43 ++++++++++++++---------------------- 1 files changed, 17 insertions(+), 26 deletions(-) diff --git a/arch/arm/mach-omap2/gpmc-smc91x.c b/arch/arm/mach-omap2/gpmc-smc91x.c index ba10c24..43900f9 100644 --- a/arch/arm/mach-omap2/gpmc-smc91x.c +++ b/arch/arm/mach-omap2/gpmc-smc91x.c @@ -57,6 +57,7 @@ static struct platform_device gpmc_smc91x_device = { static int smc91c96_gpmc_retime(void) { struct gpmc_timings t; + struct gpmc_device_timings dev_t; const int t3 = 10; /* Figure 12.2 read and 12.4 write */ const int t4_r = 20; /* Figure 12.2 read */ const int t4_w = 5; /* Figure 12.4 write */ @@ -67,32 +68,6 @@ static int smc91c96_gpmc_retime(void) const int t20 = 185; /* Figure 12.2 read and 12.4 write */ u32 l; - memset(&t, 0, sizeof(t)); - - /* Read timings */ - t.cs_on = 0; - t.adv_on = t.cs_on; - t.oe_on = t.adv_on + t3; - t.access = t.oe_on + t5; - t.oe_off = t.access; - t.adv_rd_off = t.oe_off + max(t4_r, t6); - t.cs_rd_off = t.oe_off; - t.rd_cycle = t20 - t.oe_on; - - /* Write timings */ - t.we_on = t.adv_on + t3; - - if (cpu_is_omap34xx() && (gpmc_cfg->flags & GPMC_MUX_ADD_DATA)) { - t.wr_data_mux_bus = t.we_on; - t.we_off = t.wr_data_mux_bus + t7; - } else - t.we_off = t.we_on + t7; - if (cpu_is_omap34xx()) - t.wr_access = t.we_off; - t.adv_wr_off = t.we_off + max(t4_w, t8); - t.cs_wr_off = t.we_off + t4_w; - t.wr_cycle = t20 - t.we_on; - l = GPMC_CONFIG1_DEVICESIZE_16; if (gpmc_cfg->flags & GPMC_MUX_ADD_DATA) l |= GPMC_CONFIG1_MUXADDDATA; @@ -114,6 +89,22 @@ static int smc91c96_gpmc_retime(void) if (gpmc_cfg->flags & GPMC_MUX_ADD_DATA) return 0; + memset(&dev_t, 0, sizeof(dev_t)); + + dev_t.t_oeasu = t3 * 1000; + dev_t.t_oe = t5 * 1000; + dev_t.t_cez_r = t4_r * 1000; + dev_t.t_oez = t6 * 1000; + dev_t.t_rd_cycle = (t20 - t3) * 1000; + + dev_t.t_weasu = t3 * 1000; + dev_t.t_wpl = t7 * 1000; + dev_t.t_wph = t8 * 1000; + dev_t.t_cez_w = t4_w * 1000; + dev_t.t_wr_cycle = (t20 - t3) * 1000; + + gpmc_calc_timings(&t, &dev_t); + return gpmc_cs_set_timings(gpmc_cfg->cs, &t); } -- 1.7.1
next prev parent reply other threads:[~2012-08-21 10:46 UTC|newest] Thread overview: 74+ messages / expand[flat|nested] mbox.gz Atom feed top 2012-08-21 10:41 [PATCH v6 00/10] OMAP-GPMC: generic time calc, prepare for driver Afzal Mohammed 2012-08-21 10:41 ` Afzal Mohammed 2012-08-21 10:45 ` [PATCH v6 01/10] ARM: OMAP2+: nand: unify init functions Afzal Mohammed 2012-08-21 10:45 ` Afzal Mohammed 2012-08-21 11:37 ` Igor Grinberg 2012-08-21 11:37 ` Igor Grinberg 2012-08-21 10:45 ` [PATCH v6 02/10] ARM: OMAP2+: gpmc: handle additional timings Afzal Mohammed 2012-08-21 10:45 ` Afzal Mohammed 2012-08-21 10:45 ` [PATCH v6 03/10] ARM: OMAP2+: onenand: refactor for clarity Afzal Mohammed 2012-08-21 10:45 ` Afzal Mohammed 2012-08-21 10:45 ` [PATCH v6 04/10] ARM: OMAP2+: GPMC: Remove unused OneNAND get_freq() platform function Afzal Mohammed 2012-08-21 10:45 ` Afzal Mohammed 2012-08-21 10:45 ` [PATCH v6 05/10] ARM: OMAP2+: gpmc: find features by ip rev check Afzal Mohammed 2012-08-21 10:45 ` Afzal Mohammed 2012-08-22 2:08 ` Jon Hunter 2012-08-22 2:08 ` Jon Hunter 2012-08-21 10:45 ` [PATCH v6 06/10] ARM: OMAP2+: gpmc: remove cs# in sync clk div calc Afzal Mohammed 2012-08-21 10:45 ` Afzal Mohammed 2012-08-22 2:11 ` Jon Hunter 2012-08-22 2:11 ` Jon Hunter 2012-08-21 10:45 ` [PATCH v6 07/10] ARM: OMAP2+: gpmc: generic timing calculation Afzal Mohammed 2012-08-21 10:45 ` Afzal Mohammed 2012-08-23 2:58 ` Jon Hunter 2012-08-23 2:58 ` Jon Hunter 2012-08-24 19:54 ` Tony Lindgren 2012-08-24 19:54 ` Tony Lindgren 2012-08-27 11:46 ` Mohammed, Afzal 2012-08-27 11:46 ` Mohammed, Afzal 2012-08-27 10:37 ` Mohammed, Afzal 2012-08-27 10:37 ` Mohammed, Afzal 2012-08-27 20:30 ` Jon Hunter 2012-08-27 20:30 ` Jon Hunter 2012-08-28 12:21 ` Mohammed, Afzal 2012-08-28 12:21 ` Mohammed, Afzal 2012-08-21 10:45 ` [PATCH v6 08/10] ARM: OMAP2+: onenand: " Afzal Mohammed 2012-08-21 10:45 ` Afzal Mohammed 2012-08-21 10:46 ` Afzal Mohammed [this message] 2012-08-21 10:46 ` [PATCH v6 09/10] ARM: OMAP2+: smc91x: " Afzal Mohammed 2012-08-21 10:46 ` [PATCH v6 10/10] ARM: OMAP2+: tusb6010: " Afzal Mohammed 2012-08-21 10:46 ` Afzal Mohammed 2012-08-24 19:46 ` Tony Lindgren 2012-08-24 19:46 ` Tony Lindgren 2012-08-27 8:34 ` Mohammed, Afzal 2012-08-27 8:34 ` Mohammed, Afzal 2012-09-03 5:34 ` Mohammed, Afzal 2012-09-03 5:34 ` Mohammed, Afzal 2012-09-06 7:39 ` Mohammed, Afzal 2012-09-06 7:39 ` Mohammed, Afzal 2012-09-06 20:43 ` Tony Lindgren 2012-09-06 20:43 ` Tony Lindgren 2012-09-11 18:46 ` Tony Lindgren 2012-09-11 18:46 ` Tony Lindgren 2012-09-12 9:50 ` Mohammed, Afzal 2012-09-12 9:50 ` Mohammed, Afzal 2012-09-14 10:20 ` Mohammed, Afzal 2012-09-14 10:20 ` Mohammed, Afzal 2012-09-17 8:39 ` Mohammed, Afzal 2012-09-17 8:39 ` Mohammed, Afzal 2012-09-17 22:50 ` Tony Lindgren 2012-09-17 22:50 ` Tony Lindgren 2012-09-17 23:10 ` Tony Lindgren 2012-09-17 23:10 ` Tony Lindgren 2012-09-19 13:43 ` Mohammed, Afzal 2012-09-19 13:43 ` Mohammed, Afzal 2012-09-07 0:15 ` Paul Walmsley 2012-09-07 0:15 ` Paul Walmsley 2012-08-27 12:16 ` [PATCH v6 00/10] OMAP-GPMC: generic time calc, prepare for driver Daniel Mack 2012-08-27 12:16 ` Daniel Mack 2012-08-27 12:38 ` Mohammed, Afzal 2012-08-27 12:38 ` Mohammed, Afzal 2012-08-27 13:30 ` Daniel Mack 2012-08-27 13:30 ` Daniel Mack 2012-08-27 14:01 ` Mohammed, Afzal 2012-08-27 14:01 ` Mohammed, Afzal
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=3a90c0a44f09b51fb0cbb4c0d15db4743eb36bc5.1345524670.git.afzal@ti.com \ --to=afzal@ti.com \ --cc=jon-hunter@ti.com \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-omap@vger.kernel.org \ --cc=paul@pwsan.com \ --cc=tony@atomide.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.