aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2012-02-24 13:34:36 -0500
committerTony Lindgren <tony@atomide.com>2012-02-24 13:34:36 -0500
commitacea7c7b81e8f67513aebade8cb99c7789c44d8c (patch)
tree98d6dd2fb5a3f947e1ebc90e6496ec757d918a4d
parent2c799cef4d145af2182594a41cb5e5b42f2535c5 (diff)
ARM: OMAP2+: Limit omap_read/write usage to legacy USB drivers
Drivers should no longer use omap_read/write functions but instead use ioremap + read/write functions. As some USB legacy code is still shared between omap1 and omap2420, let's limit the omap_read/write to plat/usb.h. Note that the long term fix is to update the drivers to use ioremap and read/write functions. That can now be done as a separate patch series that is limited to the USB drivers. Also make sure the legacy omap1-keypad.c driver builds if selected for 2420 based systems. Cc: Tomi Valkeinen <tomi.valkeinen@ti.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
-rw-r--r--arch/arm/mach-omap2/common.h10
-rw-r--r--arch/arm/mach-omap2/io.c40
-rw-r--r--arch/arm/plat-omap/include/plat/keypad.h2
-rw-r--r--arch/arm/plat-omap/include/plat/usb.h41
4 files changed, 43 insertions, 50 deletions
diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h
index 09ca9e9cc176..f78ec4e6a5c7 100644
--- a/arch/arm/mach-omap2/common.h
+++ b/arch/arm/mach-omap2/common.h
@@ -242,15 +242,5 @@ struct omap_sdrc_params;
242extern void omap_sdrc_init(struct omap_sdrc_params *sdrc_cs0, 242extern void omap_sdrc_init(struct omap_sdrc_params *sdrc_cs0,
243 struct omap_sdrc_params *sdrc_cs1); 243 struct omap_sdrc_params *sdrc_cs1);
244 244
245/*
246 * NOTE: Please use ioremap + __raw_read/write where possible instead of these
247 */
248extern u8 omap_readb(u32 pa);
249extern u16 omap_readw(u32 pa);
250extern u32 omap_readl(u32 pa);
251extern void omap_writeb(u8 v, u32 pa);
252extern void omap_writew(u16 v, u32 pa);
253extern void omap_writel(u32 v, u32 pa);
254
255#endif /* __ASSEMBLER__ */ 245#endif /* __ASSEMBLER__ */
256#endif /* __ARCH_ARM_MACH_OMAP2PLUS_COMMON_H */ 246#endif /* __ARCH_ARM_MACH_OMAP2PLUS_COMMON_H */
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index 0119807016f9..3203128eef7d 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -487,43 +487,3 @@ void __init omap_sdrc_init(struct omap_sdrc_params *sdrc_cs0,
487 _omap2_init_reprogram_sdrc(); 487 _omap2_init_reprogram_sdrc();
488 } 488 }
489} 489}
490
491/*
492 * NOTE: Please use ioremap + __raw_read/write where possible instead of these
493 */
494
495u8 omap_readb(u32 pa)
496{
497 return __raw_readb(OMAP2_L4_IO_ADDRESS(pa));
498}
499EXPORT_SYMBOL(omap_readb);
500
501u16 omap_readw(u32 pa)
502{
503 return __raw_readw(OMAP2_L4_IO_ADDRESS(pa));
504}
505EXPORT_SYMBOL(omap_readw);
506
507u32 omap_readl(u32 pa)
508{
509 return __raw_readl(OMAP2_L4_IO_ADDRESS(pa));
510}
511EXPORT_SYMBOL(omap_readl);
512
513void omap_writeb(u8 v, u32 pa)
514{
515 __raw_writeb(v, OMAP2_L4_IO_ADDRESS(pa));
516}
517EXPORT_SYMBOL(omap_writeb);
518
519void omap_writew(u16 v, u32 pa)
520{
521 __raw_writew(v, OMAP2_L4_IO_ADDRESS(pa));
522}
523EXPORT_SYMBOL(omap_writew);
524
525void omap_writel(u32 v, u32 pa)
526{
527 __raw_writel(v, OMAP2_L4_IO_ADDRESS(pa));
528}
529EXPORT_SYMBOL(omap_writel);
diff --git a/arch/arm/plat-omap/include/plat/keypad.h b/arch/arm/plat-omap/include/plat/keypad.h
index 793ce9d53294..a6b21eddb212 100644
--- a/arch/arm/plat-omap/include/plat/keypad.h
+++ b/arch/arm/plat-omap/include/plat/keypad.h
@@ -12,6 +12,8 @@
12 12
13#ifndef CONFIG_ARCH_OMAP1 13#ifndef CONFIG_ARCH_OMAP1
14#warning Please update the board to use matrix-keypad driver 14#warning Please update the board to use matrix-keypad driver
15#define omap_readw(reg) 0
16#define omap_writew(val, reg) do {} while (0)
15#endif 17#endif
16#include <linux/input/matrix_keypad.h> 18#include <linux/input/matrix_keypad.h>
17 19
diff --git a/arch/arm/plat-omap/include/plat/usb.h b/arch/arm/plat-omap/include/plat/usb.h
index dc864b580da0..d0fc9f4dc155 100644
--- a/arch/arm/plat-omap/include/plat/usb.h
+++ b/arch/arm/plat-omap/include/plat/usb.h
@@ -3,6 +3,7 @@
3#ifndef __ASM_ARCH_OMAP_USB_H 3#ifndef __ASM_ARCH_OMAP_USB_H
4#define __ASM_ARCH_OMAP_USB_H 4#define __ASM_ARCH_OMAP_USB_H
5 5
6#include <linux/io.h>
6#include <linux/usb/musb.h> 7#include <linux/usb/musb.h>
7#include <plat/board.h> 8#include <plat/board.h>
8 9
@@ -105,6 +106,46 @@ extern int omap4430_phy_set_clk(struct device *dev, int on);
105extern int omap4430_phy_init(struct device *dev); 106extern int omap4430_phy_init(struct device *dev);
106extern int omap4430_phy_exit(struct device *dev); 107extern int omap4430_phy_exit(struct device *dev);
107extern int omap4430_phy_suspend(struct device *dev, int suspend); 108extern int omap4430_phy_suspend(struct device *dev, int suspend);
109
110/*
111 * NOTE: Please update omap USB drivers to use ioremap + read/write
112 */
113
114#define OMAP2_L4_IO_OFFSET 0xb2000000
115#define IOMEM(x) ((void __force __iomem *)(x))
116#define OMAP2_L4_IO_ADDRESS(pa) IOMEM((pa) + OMAP2_L4_IO_OFFSET)
117
118static inline u8 omap_readb(u32 pa)
119{
120 return __raw_readb(OMAP2_L4_IO_ADDRESS(pa));
121}
122
123static inline u16 omap_readw(u32 pa)
124{
125 return __raw_readw(OMAP2_L4_IO_ADDRESS(pa));
126}
127
128static inline u32 omap_readl(u32 pa)
129{
130 return __raw_readl(OMAP2_L4_IO_ADDRESS(pa));
131}
132
133static inline void omap_writeb(u8 v, u32 pa)
134{
135 __raw_writeb(v, OMAP2_L4_IO_ADDRESS(pa));
136}
137
138
139static inline void omap_writew(u16 v, u32 pa)
140{
141 __raw_writew(v, OMAP2_L4_IO_ADDRESS(pa));
142}
143
144static inline void omap_writel(u32 v, u32 pa)
145{
146 __raw_writel(v, OMAP2_L4_IO_ADDRESS(pa));
147}
148
108#endif 149#endif
109 150
110extern void am35x_musb_reset(void); 151extern void am35x_musb_reset(void);