109
109
#define ENABLE_PREFETCH (0x1 << 7)
110
110
#define DMA_MPU_MODE 2
111
111
112
- #define GPMC_REVISION_MAJOR (l ) ((l >> 4) & 0xf)
113
- #define GPMC_REVISION_MINOR (l ) (l & 0xf)
112
+ #define GPMC_REVISION_MAJOR (l ) (((l) >> 4) & 0xf)
113
+ #define GPMC_REVISION_MINOR (l ) ((l) & 0xf)
114
114
115
115
#define GPMC_HAS_WR_ACCESS 0x1
116
116
#define GPMC_HAS_WR_DATA_MUX_BUS 0x2
141
141
#define GPMC_CONFIG1_WRITEMULTIPLE_SUPP (1 << 28)
142
142
#define GPMC_CONFIG1_WRITETYPE_ASYNC (0 << 27)
143
143
#define GPMC_CONFIG1_WRITETYPE_SYNC (1 << 27)
144
- #define GPMC_CONFIG1_CLKACTIVATIONTIME (val ) ((val & 3) << 25)
144
+ #define GPMC_CONFIG1_CLKACTIVATIONTIME (val ) ((( val) & 3) << 25)
145
145
/** CLKACTIVATIONTIME Max Ticks */
146
146
#define GPMC_CONFIG1_CLKACTIVATIONTIME_MAX 2
147
- #define GPMC_CONFIG1_PAGE_LEN (val ) ((val & 3) << 23)
147
+ #define GPMC_CONFIG1_PAGE_LEN (val ) ((( val) & 3) << 23)
148
148
/** ATTACHEDDEVICEPAGELENGTH Max Value */
149
149
#define GPMC_CONFIG1_ATTACHEDDEVICEPAGELENGTH_MAX 2
150
150
#define GPMC_CONFIG1_WAIT_READ_MON (1 << 22)
151
151
#define GPMC_CONFIG1_WAIT_WRITE_MON (1 << 21)
152
- #define GPMC_CONFIG1_WAIT_MON_TIME (val ) ((val & 3) << 18)
152
+ #define GPMC_CONFIG1_WAIT_MON_TIME (val ) ((( val) & 3) << 18)
153
153
/** WAITMONITORINGTIME Max Ticks */
154
154
#define GPMC_CONFIG1_WAITMONITORINGTIME_MAX 2
155
- #define GPMC_CONFIG1_WAIT_PIN_SEL (val ) ((val & 3) << 16)
156
- #define GPMC_CONFIG1_DEVICESIZE (val ) ((val & 3) << 12)
155
+ #define GPMC_CONFIG1_WAIT_PIN_SEL (val ) ((( val) & 3) << 16)
156
+ #define GPMC_CONFIG1_DEVICESIZE (val ) ((( val) & 3) << 12)
157
157
#define GPMC_CONFIG1_DEVICESIZE_16 GPMC_CONFIG1_DEVICESIZE(1)
158
158
/** DEVICESIZE Max Value */
159
159
#define GPMC_CONFIG1_DEVICESIZE_MAX 1
160
- #define GPMC_CONFIG1_DEVICETYPE (val ) ((val & 3) << 10)
160
+ #define GPMC_CONFIG1_DEVICETYPE (val ) ((( val) & 3) << 10)
161
161
#define GPMC_CONFIG1_DEVICETYPE_NOR GPMC_CONFIG1_DEVICETYPE(0)
162
- #define GPMC_CONFIG1_MUXTYPE (val ) ((val & 3) << 8)
162
+ #define GPMC_CONFIG1_MUXTYPE (val ) ((( val) & 3) << 8)
163
163
#define GPMC_CONFIG1_TIME_PARA_GRAN (1 << 4)
164
- #define GPMC_CONFIG1_FCLK_DIV (val ) (val & 3)
164
+ #define GPMC_CONFIG1_FCLK_DIV (val ) (( val) & 3)
165
165
#define GPMC_CONFIG1_FCLK_DIV2 (GPMC_CONFIG1_FCLK_DIV(1))
166
166
#define GPMC_CONFIG1_FCLK_DIV3 (GPMC_CONFIG1_FCLK_DIV(2))
167
167
#define GPMC_CONFIG1_FCLK_DIV4 (GPMC_CONFIG1_FCLK_DIV(3))
@@ -246,7 +246,7 @@ static DEFINE_SPINLOCK(gpmc_mem_lock);
246
246
static unsigned int gpmc_cs_num = GPMC_CS_NUM ;
247
247
static unsigned int gpmc_nr_waitpins ;
248
248
static resource_size_t phys_base , mem_size ;
249
- static unsigned gpmc_capability ;
249
+ static unsigned int gpmc_capability ;
250
250
static void __iomem * gpmc_base ;
251
251
252
252
static struct clk * gpmc_l3_clk ;
@@ -292,15 +292,14 @@ static unsigned long gpmc_get_fclk_period(void)
292
292
293
293
/**
294
294
* gpmc_get_clk_period - get period of selected clock domain in ps
295
- * @cs Chip Select Region.
296
- * @cd Clock Domain.
295
+ * @cs: Chip Select Region.
296
+ * @cd: Clock Domain.
297
297
*
298
298
* GPMC_CS_CONFIG1 GPMCFCLKDIVIDER for cs has to be setup
299
299
* prior to calling this function with GPMC_CD_CLK.
300
300
*/
301
301
static unsigned long gpmc_get_clk_period (int cs , enum gpmc_clk_domain cd )
302
302
{
303
-
304
303
unsigned long tick_ps = gpmc_get_fclk_period ();
305
304
u32 l ;
306
305
int div ;
@@ -320,7 +319,6 @@ static unsigned long gpmc_get_clk_period(int cs, enum gpmc_clk_domain cd)
320
319
}
321
320
322
321
return tick_ps ;
323
-
324
322
}
325
323
326
324
static unsigned int gpmc_ns_to_clk_ticks (unsigned int time_ns , int cs ,
@@ -412,7 +410,7 @@ static void gpmc_cs_bool_timings(int cs, const struct gpmc_bool_timings *p)
412
410
* @reg: GPMC_CS_CONFIGn register offset.
413
411
* @st_bit: Start Bit
414
412
* @end_bit: End Bit. Must be >= @st_bit.
415
- * @ma:x Maximum parameter value (before optional @shift).
413
+ * @max: Maximum parameter value (before optional @shift).
416
414
* If 0, maximum is as high as @st_bit and @end_bit allow.
417
415
* @name: DTS node name, w/o "gpmc,"
418
416
* @cd: Clock Domain of timing parameter.
@@ -512,7 +510,7 @@ static void gpmc_cs_show_timings(int cs, const char *desc)
512
510
GPMC_GET_RAW_BOOL (GPMC_CS_CONFIG1 , 4 , 4 , "time-para-granularity" );
513
511
GPMC_GET_RAW (GPMC_CS_CONFIG1 , 8 , 9 , "mux-add-data" );
514
512
GPMC_GET_RAW_SHIFT_MAX (GPMC_CS_CONFIG1 , 12 , 13 , 1 ,
515
- GPMC_CONFIG1_DEVICESIZE_MAX , "device-width" );
513
+ GPMC_CONFIG1_DEVICESIZE_MAX , "device-width" );
516
514
GPMC_GET_RAW (GPMC_CS_CONFIG1 , 16 , 17 , "wait-pin" );
517
515
GPMC_GET_RAW_BOOL (GPMC_CS_CONFIG1 , 21 , 21 , "wait-on-write" );
518
516
GPMC_GET_RAW_BOOL (GPMC_CS_CONFIG1 , 22 , 22 , "wait-on-read" );
@@ -626,9 +624,8 @@ static int set_gpmc_timing_reg(int cs, int reg, int st_bit, int end_bit, int max
626
624
627
625
l = gpmc_cs_read_reg (cs , reg );
628
626
#ifdef CONFIG_OMAP_GPMC_DEBUG
629
- pr_info (
630
- "GPMC CS%d: %-17s: %3d ticks, %3lu ns (was %3i ticks) %3d ns\n" ,
631
- cs , name , ticks , gpmc_get_clk_period (cs , cd ) * ticks / 1000 ,
627
+ pr_info ("GPMC CS%d: %-17s: %3d ticks, %3lu ns (was %3i ticks) %3d ns\n" ,
628
+ cs , name , ticks , gpmc_get_clk_period (cs , cd ) * ticks / 1000 ,
632
629
(l >> st_bit ) & mask , time );
633
630
#endif
634
631
l &= ~(mask << st_bit );
@@ -663,7 +660,6 @@ static int set_gpmc_timing_reg(int cs, int reg, int st_bit, int end_bit, int max
663
660
*/
664
661
static int gpmc_calc_waitmonitoring_divider (unsigned int wait_monitoring )
665
662
{
666
-
667
663
int div = gpmc_ns_to_ticks (wait_monitoring );
668
664
669
665
div += GPMC_CONFIG1_WAITMONITORINGTIME_MAX - 1 ;
@@ -675,7 +671,6 @@ static int gpmc_calc_waitmonitoring_divider(unsigned int wait_monitoring)
675
671
div = 1 ;
676
672
677
673
return div ;
678
-
679
674
}
680
675
681
676
/**
@@ -729,7 +724,6 @@ int gpmc_cs_set_timings(int cs, const struct gpmc_timings *t,
729
724
if (!s -> sync_read && !s -> sync_write &&
730
725
(s -> wait_on_read || s -> wait_on_write )
731
726
) {
732
-
733
727
div = gpmc_calc_waitmonitoring_divider (t -> wait_monitoring );
734
728
if (div < 0 ) {
735
729
pr_err ("%s: waitmonitoringtime %3d ns too large for greatest gpmcfclkdivider.\n" ,
@@ -1088,7 +1082,7 @@ static struct gpmc_nand_ops nand_ops = {
1088
1082
1089
1083
/**
1090
1084
* gpmc_omap_get_nand_ops - Get the GPMC NAND interface
1091
- * @regs : the GPMC NAND register map exclusive for NAND use.
1085
+ * @reg : the GPMC NAND register map exclusive for NAND use.
1092
1086
* @cs: GPMC chip select number on which the NAND sits. The
1093
1087
* register map returned will be specific to this chip select.
1094
1088
*
@@ -1243,7 +1237,7 @@ int gpmc_omap_onenand_set_timings(struct device *dev, int cs, int freq,
1243
1237
}
1244
1238
EXPORT_SYMBOL_GPL (gpmc_omap_onenand_set_timings );
1245
1239
1246
- int gpmc_get_client_irq (unsigned irq_config )
1240
+ int gpmc_get_client_irq (unsigned int irq_config )
1247
1241
{
1248
1242
if (!gpmc_irq_domain ) {
1249
1243
pr_warn ("%s called before GPMC IRQ domain available\n" ,
@@ -1466,7 +1460,6 @@ static void gpmc_mem_exit(void)
1466
1460
continue ;
1467
1461
gpmc_cs_delete_mem (cs );
1468
1462
}
1469
-
1470
1463
}
1471
1464
1472
1465
static void gpmc_mem_init (void )
@@ -1635,17 +1628,14 @@ static int gpmc_calc_async_read_timings(struct gpmc_timings *gpmc_t,
1635
1628
/* oe_on */
1636
1629
temp = dev_t -> t_oeasu ;
1637
1630
if (mux )
1638
- temp = max_t (u32 , temp ,
1639
- gpmc_t -> adv_rd_off + dev_t -> t_aavdh );
1631
+ temp = max_t (u32 , temp , gpmc_t -> adv_rd_off + dev_t -> t_aavdh );
1640
1632
gpmc_t -> oe_on = gpmc_round_ps_to_ticks (temp );
1641
1633
1642
1634
/* access */
1643
1635
temp = max_t (u32 , dev_t -> t_iaa , /* XXX: remove t_iaa in async ? */
1644
- gpmc_t -> oe_on + dev_t -> t_oe );
1645
- temp = max_t (u32 , temp ,
1646
- gpmc_t -> cs_on + dev_t -> t_ce );
1647
- temp = max_t (u32 , temp ,
1648
- gpmc_t -> adv_on + dev_t -> t_aa );
1636
+ gpmc_t -> oe_on + dev_t -> t_oe );
1637
+ temp = max_t (u32 , temp , gpmc_t -> cs_on + dev_t -> t_ce );
1638
+ temp = max_t (u32 , temp , gpmc_t -> adv_on + dev_t -> t_aa );
1649
1639
gpmc_t -> access = gpmc_round_ps_to_ticks (temp );
1650
1640
1651
1641
gpmc_t -> oe_off = gpmc_t -> access + gpmc_ticks_to_ps (1 );
@@ -2091,7 +2081,7 @@ static int gpmc_probe_generic_child(struct platform_device *pdev,
2091
2081
gpmc_cs_disable_mem (cs );
2092
2082
2093
2083
/*
2094
- * FIXME: gpmc_cs_request() will map the CS to an arbitary
2084
+ * FIXME: gpmc_cs_request() will map the CS to an arbitrary
2095
2085
* location in the gpmc address space. When booting with
2096
2086
* device-tree we want the NOR flash to be mapped to the
2097
2087
* location specified in the device-tree blob. So remap the
0 commit comments