]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
ARM: OMAP: Fix GPMC_CS_CONFIG1 writing and typos
authorTony Lindgren <tony@atomide.com>
Thu, 29 Jun 2006 01:13:16 +0000 (18:13 -0700)
committerTony Lindgren <tony@atomide.com>
Thu, 29 Jun 2006 01:13:16 +0000 (18:13 -0700)
Fix GPMC_CS_CONFIG1 writing and typos

Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/mach-omap2/gpmc.c
include/asm-arm/arch-omap/gpmc.h

index c7a48f921fef01b58464fbdb85fd760578817ba7..e1affe7fb6ae4b5215410309b2470aacef5041f2 100644 (file)
@@ -88,6 +88,13 @@ unsigned int gpmc_ns_to_ticks(unsigned int time_ns)
        return (time_ns * 1000 + tick_ps - 1) / tick_ps;
 }
 
+unsigned int gpmc_round_ns_to_ticks(unsigned int time_ns)
+{
+       unsigned long ticks = gpmc_ns_to_ticks(time_ns);
+
+       return ticks * gpmc_get_fclk_period() / 1000;
+}
+
 #ifdef DEBUG
 static int set_gpmc_timing_reg(int cs, int reg, int st_bit, int end_bit,
                               int time, const char *name)
@@ -141,7 +148,7 @@ int gpmc_cs_calc_divider(int cs, unsigned int sync_clk)
        div = l / gpmc_get_fclk_period();
        if (div > 4)
                return -1;
-       if (div < 0)
+       if (div <= 0)
                div = 1;
 
        return div;
@@ -183,6 +190,7 @@ int gpmc_cs_set_timings(int cs, const struct gpmc_timings *t)
        l = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1);
        l &= ~0x03;
        l |= (div - 1);
+       gpmc_cs_write_reg(cs, GPMC_CS_CONFIG1, l);
 
        return 0;
 }
index 1a0a5207822d660fc1e74efb1d501621a4a5c308..e724d14e440084654a35f6c6915a3f5437ff20a4 100644 (file)
 #define GPMC_CS_NAND_DATA      0x24
 
 #define GPMC_CONFIG1_WRAPBURST_SUPP     (1 << 31)
-#define GPMC_CONFIG1_READMULTIPLE_SUPP  (1 << 20)
+#define GPMC_CONFIG1_READMULTIPLE_SUPP  (1 << 30)
 #define GPMC_CONFIG1_READTYPE_ASYNC     (0 << 29)
 #define GPMC_CONFIG1_READTYPE_SYNC      (1 << 29)
+#define GPMC_CONFIG1_WRITEMULTIPLE_SUPP        (1 << 28)
 #define GPMC_CONFIG1_WRITETYPE_ASYNC    (0 << 27)
 #define GPMC_CONFIG1_WRITETYPE_SYNC     (1 << 27)
 #define GPMC_CONFIG1_CLKACTIVATIONTIME(val) ((val & 3) << 25)
@@ -80,6 +81,7 @@ struct gpmc_timings {
 };
 
 extern unsigned int gpmc_ns_to_ticks(unsigned int time_ns);
+extern unsigned int gpmc_round_ns_to_ticks(unsigned int time_ns);
 
 extern void gpmc_cs_write_reg(int cs, int idx, u32 val);
 extern u32 gpmc_cs_read_reg(int cs, int idx);