* [PATCH 1/8] ARM: OMAP2+: Move DISPC L3 firewall to happen in omap_display_init() [not found] <20120221233619.18709.87982.stgit@kaulin.local> @ 2012-02-21 23:40 ` Tony Lindgren 2012-02-22 8:09 ` Tomi Valkeinen 2012-02-21 23:40 ` [PATCH 8/8] ARM: OMAP2+: Limit omap_read/write usage to legacy USB drivers Tony Lindgren 1 sibling, 1 reply; 9+ messages in thread From: Tony Lindgren @ 2012-02-21 23:40 UTC (permalink / raw) To: linux-arm-kernel Otherwise we cannot move most of plat/io.h to be a local iomap.h for mach-omap2. Cc: Tomi Valkeinen <tomi.valkeinen@ti.com> Cc: linux-fbdev@vger.kernel.org Signed-off-by: Tony Lindgren <tony@atomide.com> --- arch/arm/mach-omap2/display.c | 3 +++ drivers/video/omap2/dss/dispc.c | 5 ----- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c index 3677b1f..5a7f12f 100644 --- a/arch/arm/mach-omap2/display.c +++ b/arch/arm/mach-omap2/display.c @@ -191,6 +191,9 @@ int __init omap_display_init(struct omap_dss_board_info *board_data) memset(&pdata, 0, sizeof(pdata)); if (cpu_is_omap24xx()) { + /* L3 firewall setting: enable access to OCM RAM */ + __raw_writel(0x402000b0, OMAP2_L3_IO_ADDRESS(0x680050a0)); + curr_dss_hwmod = omap2_dss_hwmod_data; oh_count = ARRAY_SIZE(omap2_dss_hwmod_data); } else if (cpu_is_omap34xx()) { diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c index e1626a1..cce0820 100644 --- a/drivers/video/omap2/dss/dispc.c +++ b/drivers/video/omap2/dss/dispc.c @@ -3272,11 +3272,6 @@ static void _omap_dispc_initial_config(void) if (dss_has_feature(FEAT_FUNCGATED)) REG_FLD_MOD(DISPC_CONFIG, 1, 9, 9); - /* L3 firewall setting: enable access to OCM RAM */ - /* XXX this should be somewhere in plat-omap */ - if (cpu_is_omap24xx()) - __raw_writel(0x402000b0, OMAP2_L3_IO_ADDRESS(0x680050a0)); - _dispc_setup_color_conv_coef(); dispc_set_loadmode(OMAP_DSS_LOAD_FRAME_ONLY); ^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 1/8] ARM: OMAP2+: Move DISPC L3 firewall to happen in omap_display_init() 2012-02-21 23:40 ` [PATCH 1/8] ARM: OMAP2+: Move DISPC L3 firewall to happen in omap_display_init() Tony Lindgren @ 2012-02-22 8:09 ` Tomi Valkeinen 2012-02-22 19:05 ` Tony Lindgren 0 siblings, 1 reply; 9+ messages in thread From: Tomi Valkeinen @ 2012-02-22 8:09 UTC (permalink / raw) To: linux-arm-kernel [-- Attachment #1: Type: text/plain, Size: 2021 bytes --] Hi, On Tue, 2012-02-21 at 15:40 -0800, Tony Lindgren wrote: > Otherwise we cannot move most of plat/io.h to be a local > iomap.h for mach-omap2. > > Cc: Tomi Valkeinen <tomi.valkeinen@ti.com> > Cc: linux-fbdev@vger.kernel.org > Signed-off-by: Tony Lindgren <tony@atomide.com> > --- > arch/arm/mach-omap2/display.c | 3 +++ > drivers/video/omap2/dss/dispc.c | 5 ----- > 2 files changed, 3 insertions(+), 5 deletions(-) > > diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c > index 3677b1f..5a7f12f 100644 > --- a/arch/arm/mach-omap2/display.c > +++ b/arch/arm/mach-omap2/display.c > @@ -191,6 +191,9 @@ int __init omap_display_init(struct omap_dss_board_info *board_data) > memset(&pdata, 0, sizeof(pdata)); > > if (cpu_is_omap24xx()) { > + /* L3 firewall setting: enable access to OCM RAM */ > + __raw_writel(0x402000b0, OMAP2_L3_IO_ADDRESS(0x680050a0)); > + > curr_dss_hwmod = omap2_dss_hwmod_data; > oh_count = ARRAY_SIZE(omap2_dss_hwmod_data); > } else if (cpu_is_omap34xx()) { > diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c > index e1626a1..cce0820 100644 > --- a/drivers/video/omap2/dss/dispc.c > +++ b/drivers/video/omap2/dss/dispc.c > @@ -3272,11 +3272,6 @@ static void _omap_dispc_initial_config(void) > if (dss_has_feature(FEAT_FUNCGATED)) > REG_FLD_MOD(DISPC_CONFIG, 1, 9, 9); > > - /* L3 firewall setting: enable access to OCM RAM */ > - /* XXX this should be somewhere in plat-omap */ > - if (cpu_is_omap24xx()) > - __raw_writel(0x402000b0, OMAP2_L3_IO_ADDRESS(0x680050a0)); > - > _dispc_setup_color_conv_coef(); > > dispc_set_loadmode(OMAP_DSS_LOAD_FRAME_ONLY); > I think the whole raw_writel line can be removed. It's been copied from the old omapfb, and my understanding is that it's about using SRAM for framebuffer. Using SRAM for fb is no longer supported, and I have a patch set that removes the remaining SRAM code from omapfb/omapdss. Tomi [-- Attachment #2: This is a digitally signed message part --] [-- Type: application/pgp-signature, Size: 836 bytes --] ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/8] ARM: OMAP2+: Move DISPC L3 firewall to happen in omap_display_init() 2012-02-22 8:09 ` Tomi Valkeinen @ 2012-02-22 19:05 ` Tony Lindgren 2012-02-22 22:17 ` Tony Lindgren 0 siblings, 1 reply; 9+ messages in thread From: Tony Lindgren @ 2012-02-22 19:05 UTC (permalink / raw) To: linux-arm-kernel * Tomi Valkeinen <tomi.valkeinen@ti.com> [120221 23:38]: > Hi, > > On Tue, 2012-02-21 at 15:40 -0800, Tony Lindgren wrote: > > Otherwise we cannot move most of plat/io.h to be a local > > iomap.h for mach-omap2. > > > > Cc: Tomi Valkeinen <tomi.valkeinen@ti.com> > > Cc: linux-fbdev@vger.kernel.org > > Signed-off-by: Tony Lindgren <tony@atomide.com> > > --- > > arch/arm/mach-omap2/display.c | 3 +++ > > drivers/video/omap2/dss/dispc.c | 5 ----- > > 2 files changed, 3 insertions(+), 5 deletions(-) > > > > diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c > > index 3677b1f..5a7f12f 100644 > > --- a/arch/arm/mach-omap2/display.c > > +++ b/arch/arm/mach-omap2/display.c > > @@ -191,6 +191,9 @@ int __init omap_display_init(struct omap_dss_board_info *board_data) > > memset(&pdata, 0, sizeof(pdata)); > > > > if (cpu_is_omap24xx()) { > > + /* L3 firewall setting: enable access to OCM RAM */ > > + __raw_writel(0x402000b0, OMAP2_L3_IO_ADDRESS(0x680050a0)); > > + > > curr_dss_hwmod = omap2_dss_hwmod_data; > > oh_count = ARRAY_SIZE(omap2_dss_hwmod_data); > > } else if (cpu_is_omap34xx()) { > > diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c > > index e1626a1..cce0820 100644 > > --- a/drivers/video/omap2/dss/dispc.c > > +++ b/drivers/video/omap2/dss/dispc.c > > @@ -3272,11 +3272,6 @@ static void _omap_dispc_initial_config(void) > > if (dss_has_feature(FEAT_FUNCGATED)) > > REG_FLD_MOD(DISPC_CONFIG, 1, 9, 9); > > > > - /* L3 firewall setting: enable access to OCM RAM */ > > - /* XXX this should be somewhere in plat-omap */ > > - if (cpu_is_omap24xx()) > > - __raw_writel(0x402000b0, OMAP2_L3_IO_ADDRESS(0x680050a0)); > > - > > _dispc_setup_color_conv_coef(); > > > > dispc_set_loadmode(OMAP_DSS_LOAD_FRAME_ONLY); > > > > I think the whole raw_writel line can be removed. It's been copied from > the old omapfb, and my understanding is that it's about using SRAM for > framebuffer. Using SRAM for fb is no longer supported, and I have a > patch set that removes the remaining SRAM code from omapfb/omapdss. OK, I'll remove those from drivers/video/omap2/dss/dispc.c so this series keeps building. Tony ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/8] ARM: OMAP2+: Move DISPC L3 firewall to happen in omap_display_init() 2012-02-22 19:05 ` Tony Lindgren @ 2012-02-22 22:17 ` Tony Lindgren 0 siblings, 0 replies; 9+ messages in thread From: Tony Lindgren @ 2012-02-22 22:17 UTC (permalink / raw) To: linux-arm-kernel * Tony Lindgren <tony@atomide.com> [120222 10:34]: > * Tomi Valkeinen <tomi.valkeinen@ti.com> [120221 23:38]: > > Hi, > > > > On Tue, 2012-02-21 at 15:40 -0800, Tony Lindgren wrote: > > > Otherwise we cannot move most of plat/io.h to be a local > > > iomap.h for mach-omap2. > > > > > > Cc: Tomi Valkeinen <tomi.valkeinen@ti.com> > > > Cc: linux-fbdev@vger.kernel.org > > > Signed-off-by: Tony Lindgren <tony@atomide.com> > > > --- > > > arch/arm/mach-omap2/display.c | 3 +++ > > > drivers/video/omap2/dss/dispc.c | 5 ----- > > > 2 files changed, 3 insertions(+), 5 deletions(-) > > > > > > diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c > > > index 3677b1f..5a7f12f 100644 > > > --- a/arch/arm/mach-omap2/display.c > > > +++ b/arch/arm/mach-omap2/display.c > > > @@ -191,6 +191,9 @@ int __init omap_display_init(struct omap_dss_board_info *board_data) > > > memset(&pdata, 0, sizeof(pdata)); > > > > > > if (cpu_is_omap24xx()) { > > > + /* L3 firewall setting: enable access to OCM RAM */ > > > + __raw_writel(0x402000b0, OMAP2_L3_IO_ADDRESS(0x680050a0)); > > > + > > > curr_dss_hwmod = omap2_dss_hwmod_data; > > > oh_count = ARRAY_SIZE(omap2_dss_hwmod_data); > > > } else if (cpu_is_omap34xx()) { > > > diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c > > > index e1626a1..cce0820 100644 > > > --- a/drivers/video/omap2/dss/dispc.c > > > +++ b/drivers/video/omap2/dss/dispc.c > > > @@ -3272,11 +3272,6 @@ static void _omap_dispc_initial_config(void) > > > if (dss_has_feature(FEAT_FUNCGATED)) > > > REG_FLD_MOD(DISPC_CONFIG, 1, 9, 9); > > > > > > - /* L3 firewall setting: enable access to OCM RAM */ > > > - /* XXX this should be somewhere in plat-omap */ > > > - if (cpu_is_omap24xx()) > > > - __raw_writel(0x402000b0, OMAP2_L3_IO_ADDRESS(0x680050a0)); > > > - > > > _dispc_setup_color_conv_coef(); > > > > > > dispc_set_loadmode(OMAP_DSS_LOAD_FRAME_ONLY); > > > > > > > I think the whole raw_writel line can be removed. It's been copied from > > the old omapfb, and my understanding is that it's about using SRAM for > > framebuffer. Using SRAM for fb is no longer supported, and I have a > > patch set that removes the remaining SRAM code from omapfb/omapdss. > > OK, I'll remove those from drivers/video/omap2/dss/dispc.c so this > series keeps building. Here's this one updated. Tony From: Tony Lindgren <tony@atomide.com> Date: Mon, 20 Feb 2012 12:55:07 -0800 Subject: [PATCH] ARM: OMAP2+: Drop DISPC L3 firewall code This is only needed when using SRAM for framebuffer, and the support for SRAM framebuffer is about to get removed. Otherwise we cannot move most of plat/io.h to be a local iomap.h for mach-omap2. Cc: Tomi Valkeinen <tomi.valkeinen@ti.com> Cc: linux-fbdev@vger.kernel.org Signed-off-by: Tony Lindgren <tony@atomide.com> --- a/drivers/video/omap2/dss/dispc.c +++ b/drivers/video/omap2/dss/dispc.c @@ -3272,11 +3272,6 @@ static void _omap_dispc_initial_config(void) if (dss_has_feature(FEAT_FUNCGATED)) REG_FLD_MOD(DISPC_CONFIG, 1, 9, 9); - /* L3 firewall setting: enable access to OCM RAM */ - /* XXX this should be somewhere in plat-omap */ - if (cpu_is_omap24xx()) - __raw_writel(0x402000b0, OMAP2_L3_IO_ADDRESS(0x680050a0)); - _dispc_setup_color_conv_coef(); dispc_set_loadmode(OMAP_DSS_LOAD_FRAME_ONLY); ^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 8/8] ARM: OMAP2+: Limit omap_read/write usage to legacy USB drivers [not found] <20120221233619.18709.87982.stgit@kaulin.local> 2012-02-21 23:40 ` [PATCH 1/8] ARM: OMAP2+: Move DISPC L3 firewall to happen in omap_display_init() Tony Lindgren @ 2012-02-21 23:40 ` Tony Lindgren 2012-02-22 8:14 ` Tomi Valkeinen 1 sibling, 1 reply; 9+ messages in thread From: Tony Lindgren @ 2012-02-21 23:40 UTC (permalink / raw) To: linux-arm-kernel 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. Also, let's make drivers/video/omap/lcdc.c depend on ARCH_OMAP1 as it is not needed for omap2+. 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. Cc: Tomi Valkeinen <tomi.valkeinen@ti.com> Cc: linux-fbdev@vger.kernel.org Signed-off-by: Tony Lindgren <tony@atomide.com> --- arch/arm/mach-omap2/common.h | 10 -------- arch/arm/mach-omap2/io.c | 40 --------------------------------- arch/arm/plat-omap/include/plat/usb.h | 40 +++++++++++++++++++++++++++++++++ drivers/video/omap/Kconfig | 2 +- 4 files changed, 41 insertions(+), 51 deletions(-) diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h index 09ca9e9..f78ec4e 100644 --- a/arch/arm/mach-omap2/common.h +++ b/arch/arm/mach-omap2/common.h @@ -242,15 +242,5 @@ struct omap_sdrc_params; extern void omap_sdrc_init(struct omap_sdrc_params *sdrc_cs0, struct omap_sdrc_params *sdrc_cs1); -/* - * NOTE: Please use ioremap + __raw_read/write where possible instead of these - */ -extern u8 omap_readb(u32 pa); -extern u16 omap_readw(u32 pa); -extern u32 omap_readl(u32 pa); -extern void omap_writeb(u8 v, u32 pa); -extern void omap_writew(u16 v, u32 pa); -extern void omap_writel(u32 v, u32 pa); - #endif /* __ASSEMBLER__ */ #endif /* __ARCH_ARM_MACH_OMAP2PLUS_COMMON_H */ diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c index 0119807..3203128 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, _omap2_init_reprogram_sdrc(); } } - -/* - * NOTE: Please use ioremap + __raw_read/write where possible instead of these - */ - -u8 omap_readb(u32 pa) -{ - return __raw_readb(OMAP2_L4_IO_ADDRESS(pa)); -} -EXPORT_SYMBOL(omap_readb); - -u16 omap_readw(u32 pa) -{ - return __raw_readw(OMAP2_L4_IO_ADDRESS(pa)); -} -EXPORT_SYMBOL(omap_readw); - -u32 omap_readl(u32 pa) -{ - return __raw_readl(OMAP2_L4_IO_ADDRESS(pa)); -} -EXPORT_SYMBOL(omap_readl); - -void omap_writeb(u8 v, u32 pa) -{ - __raw_writeb(v, OMAP2_L4_IO_ADDRESS(pa)); -} -EXPORT_SYMBOL(omap_writeb); - -void omap_writew(u16 v, u32 pa) -{ - __raw_writew(v, OMAP2_L4_IO_ADDRESS(pa)); -} -EXPORT_SYMBOL(omap_writew); - -void omap_writel(u32 v, u32 pa) -{ - __raw_writel(v, OMAP2_L4_IO_ADDRESS(pa)); -} -EXPORT_SYMBOL(omap_writel); diff --git a/arch/arm/plat-omap/include/plat/usb.h b/arch/arm/plat-omap/include/plat/usb.h index dc864b5..5f6ced4 100644 --- a/arch/arm/plat-omap/include/plat/usb.h +++ b/arch/arm/plat-omap/include/plat/usb.h @@ -3,6 +3,7 @@ #ifndef __ASM_ARCH_OMAP_USB_H #define __ASM_ARCH_OMAP_USB_H +#include <linux/io.h> #include <linux/usb/musb.h> #include <plat/board.h> @@ -105,6 +106,45 @@ extern int omap4430_phy_set_clk(struct device *dev, int on); extern int omap4430_phy_init(struct device *dev); extern int omap4430_phy_exit(struct device *dev); extern int omap4430_phy_suspend(struct device *dev, int suspend); + +/* + * NOTE: Please update omap USB drivers to use ioremap + read/write + */ + +#define OMAP2_L4_IO_OFFSET 0xb2000000 +#define OMAP2_L4_IO_ADDRESS(pa) IOMEM((pa) + OMAP2_L4_IO_OFFSET) + +static inline u8 omap_readb(u32 pa) +{ + return __raw_readb(OMAP2_L4_IO_ADDRESS(pa)); +} + +static inline u16 omap_readw(u32 pa) +{ + return __raw_readw(OMAP2_L4_IO_ADDRESS(pa)); +} + +static inline u32 omap_readl(u32 pa) +{ + return __raw_readl(OMAP2_L4_IO_ADDRESS(pa)); +} + +static inline void omap_writeb(u8 v, u32 pa) +{ + __raw_writeb(v, OMAP2_L4_IO_ADDRESS(pa)); +} + + +static inline void omap_writew(u16 v, u32 pa) +{ + __raw_writew(v, OMAP2_L4_IO_ADDRESS(pa)); +} + +static inline void omap_writel(u32 v, u32 pa) +{ + __raw_writel(v, OMAP2_L4_IO_ADDRESS(pa)); +} + #endif extern void am35x_musb_reset(void); diff --git a/drivers/video/omap/Kconfig b/drivers/video/omap/Kconfig index 84ff232..295d1cc 100644 --- a/drivers/video/omap/Kconfig +++ b/drivers/video/omap/Kconfig @@ -11,7 +11,7 @@ config FB_OMAP config FB_OMAP_LCDC_EXTERNAL bool "External LCD controller support" - depends on FB_OMAP + depends on FB_OMAP && ARCH_OMAP1 help Say Y here, if you want to have support for boards with an external LCD controller connected to the SoSSI/RFBI interface. ^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 8/8] ARM: OMAP2+: Limit omap_read/write usage to legacy USB drivers 2012-02-21 23:40 ` [PATCH 8/8] ARM: OMAP2+: Limit omap_read/write usage to legacy USB drivers Tony Lindgren @ 2012-02-22 8:14 ` Tomi Valkeinen 2012-02-22 18:57 ` Tony Lindgren 0 siblings, 1 reply; 9+ messages in thread From: Tomi Valkeinen @ 2012-02-22 8:14 UTC (permalink / raw) To: linux-arm-kernel [-- Attachment #1: Type: text/plain, Size: 689 bytes --] On Tue, 2012-02-21 at 15:40 -0800, Tony Lindgren wrote: > 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. > > Also, let's make drivers/video/omap/lcdc.c depend on > ARCH_OMAP1 as it is not needed for omap2+. I'm ok with the lcdc.c change, but I also have a patch series that makes the same change, plus removes the omap2 code from drivers/video/omap/. Can you check the series, and give ack if the arch/arm side looks fine? It's this one: [PATCH 00/16] OMAPDSS: old OMAPFB cleanup Tomi [-- Attachment #2: This is a digitally signed message part --] [-- Type: application/pgp-signature, Size: 836 bytes --] ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 8/8] ARM: OMAP2+: Limit omap_read/write usage to legacy USB drivers 2012-02-22 8:14 ` Tomi Valkeinen @ 2012-02-22 18:57 ` Tony Lindgren 2012-02-22 22:44 ` Tony Lindgren 0 siblings, 1 reply; 9+ messages in thread From: Tony Lindgren @ 2012-02-22 18:57 UTC (permalink / raw) To: linux-arm-kernel * Tomi Valkeinen <tomi.valkeinen@ti.com> [120221 23:42]: > On Tue, 2012-02-21 at 15:40 -0800, Tony Lindgren wrote: > > 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. > > > > Also, let's make drivers/video/omap/lcdc.c depend on > > ARCH_OMAP1 as it is not needed for omap2+. > > I'm ok with the lcdc.c change, but I also have a patch series that makes > the same change, plus removes the omap2 code from drivers/video/omap/. OK, I'll drop the lcdc.c change from my series as that should only affect randconfig builds. > Can you check the series, and give ack if the arch/arm side looks fine? > It's this one: [PATCH 00/16] OMAPDSS: old OMAPFB cleanup Yeah great, I've acked those. Let's do a test merge when I have these in cleanup branch, looks like the conflicts should be trivial. Tony ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 8/8] ARM: OMAP2+: Limit omap_read/write usage to legacy USB drivers 2012-02-22 18:57 ` Tony Lindgren @ 2012-02-22 22:44 ` Tony Lindgren 2012-02-24 18:25 ` Tony Lindgren 0 siblings, 1 reply; 9+ messages in thread From: Tony Lindgren @ 2012-02-22 22:44 UTC (permalink / raw) To: linux-arm-kernel * Tony Lindgren <tony@atomide.com> [120222 10:27]: > * Tomi Valkeinen <tomi.valkeinen@ti.com> [120221 23:42]: > > On Tue, 2012-02-21 at 15:40 -0800, Tony Lindgren wrote: > > > 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. > > > > > > Also, let's make drivers/video/omap/lcdc.c depend on > > > ARCH_OMAP1 as it is not needed for omap2+. > > > > I'm ok with the lcdc.c change, but I also have a patch series that makes > > the same change, plus removes the omap2 code from drivers/video/omap/. > > OK, I'll drop the lcdc.c change from my series as that should > only affect randconfig builds. Here's this one updated. Noticed one more legacy driver that needs omap_read/write defined to build on 2420. Regards, Tony Date: Tue, 21 Feb 2012 13:27:33 -0800 Subject: [PATCH] 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> diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h index 09ca9e9..f78ec4e 100644 --- a/arch/arm/mach-omap2/common.h +++ b/arch/arm/mach-omap2/common.h @@ -242,15 +242,5 @@ struct omap_sdrc_params; extern void omap_sdrc_init(struct omap_sdrc_params *sdrc_cs0, struct omap_sdrc_params *sdrc_cs1); -/* - * NOTE: Please use ioremap + __raw_read/write where possible instead of these - */ -extern u8 omap_readb(u32 pa); -extern u16 omap_readw(u32 pa); -extern u32 omap_readl(u32 pa); -extern void omap_writeb(u8 v, u32 pa); -extern void omap_writew(u16 v, u32 pa); -extern void omap_writel(u32 v, u32 pa); - #endif /* __ASSEMBLER__ */ #endif /* __ARCH_ARM_MACH_OMAP2PLUS_COMMON_H */ diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c index 0119807..3203128 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, _omap2_init_reprogram_sdrc(); } } - -/* - * NOTE: Please use ioremap + __raw_read/write where possible instead of these - */ - -u8 omap_readb(u32 pa) -{ - return __raw_readb(OMAP2_L4_IO_ADDRESS(pa)); -} -EXPORT_SYMBOL(omap_readb); - -u16 omap_readw(u32 pa) -{ - return __raw_readw(OMAP2_L4_IO_ADDRESS(pa)); -} -EXPORT_SYMBOL(omap_readw); - -u32 omap_readl(u32 pa) -{ - return __raw_readl(OMAP2_L4_IO_ADDRESS(pa)); -} -EXPORT_SYMBOL(omap_readl); - -void omap_writeb(u8 v, u32 pa) -{ - __raw_writeb(v, OMAP2_L4_IO_ADDRESS(pa)); -} -EXPORT_SYMBOL(omap_writeb); - -void omap_writew(u16 v, u32 pa) -{ - __raw_writew(v, OMAP2_L4_IO_ADDRESS(pa)); -} -EXPORT_SYMBOL(omap_writew); - -void omap_writel(u32 v, u32 pa) -{ - __raw_writel(v, OMAP2_L4_IO_ADDRESS(pa)); -} -EXPORT_SYMBOL(omap_writel); diff --git a/arch/arm/plat-omap/include/plat/keypad.h b/arch/arm/plat-omap/include/plat/keypad.h index 793ce9d..4b35555 100644 --- a/arch/arm/plat-omap/include/plat/keypad.h +++ b/arch/arm/plat-omap/include/plat/keypad.h @@ -12,6 +12,8 @@ #ifndef CONFIG_ARCH_OMAP1 #warning Please update the board to use matrix-keypad driver +#define omap_readw(reg) 0 +#define omap_writew(val, reg) do {} while(0) #endif #include <linux/input/matrix_keypad.h> diff --git a/arch/arm/plat-omap/include/plat/usb.h b/arch/arm/plat-omap/include/plat/usb.h index dc864b5..5f6ced4 100644 --- a/arch/arm/plat-omap/include/plat/usb.h +++ b/arch/arm/plat-omap/include/plat/usb.h @@ -3,6 +3,7 @@ #ifndef __ASM_ARCH_OMAP_USB_H #define __ASM_ARCH_OMAP_USB_H +#include <linux/io.h> #include <linux/usb/musb.h> #include <plat/board.h> @@ -105,6 +106,45 @@ extern int omap4430_phy_set_clk(struct device *dev, int on); extern int omap4430_phy_init(struct device *dev); extern int omap4430_phy_exit(struct device *dev); extern int omap4430_phy_suspend(struct device *dev, int suspend); + +/* + * NOTE: Please update omap USB drivers to use ioremap + read/write + */ + +#define OMAP2_L4_IO_OFFSET 0xb2000000 +#define OMAP2_L4_IO_ADDRESS(pa) IOMEM((pa) + OMAP2_L4_IO_OFFSET) + +static inline u8 omap_readb(u32 pa) +{ + return __raw_readb(OMAP2_L4_IO_ADDRESS(pa)); +} + +static inline u16 omap_readw(u32 pa) +{ + return __raw_readw(OMAP2_L4_IO_ADDRESS(pa)); +} + +static inline u32 omap_readl(u32 pa) +{ + return __raw_readl(OMAP2_L4_IO_ADDRESS(pa)); +} + +static inline void omap_writeb(u8 v, u32 pa) +{ + __raw_writeb(v, OMAP2_L4_IO_ADDRESS(pa)); +} + + +static inline void omap_writew(u16 v, u32 pa) +{ + __raw_writew(v, OMAP2_L4_IO_ADDRESS(pa)); +} + +static inline void omap_writel(u32 v, u32 pa) +{ + __raw_writel(v, OMAP2_L4_IO_ADDRESS(pa)); +} + #endif extern void am35x_musb_reset(void); ^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 8/8] ARM: OMAP2+: Limit omap_read/write usage to legacy USB drivers 2012-02-22 22:44 ` Tony Lindgren @ 2012-02-24 18:25 ` Tony Lindgren 0 siblings, 0 replies; 9+ messages in thread From: Tony Lindgren @ 2012-02-24 18:25 UTC (permalink / raw) To: linux-arm-kernel * Tony Lindgren <tony@atomide.com> [120222 14:13]: > * Tony Lindgren <tony@atomide.com> [120222 10:27]: > > * Tomi Valkeinen <tomi.valkeinen@ti.com> [120221 23:42]: > > > On Tue, 2012-02-21 at 15:40 -0800, Tony Lindgren wrote: > > > > 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. > > > > > > > > Also, let's make drivers/video/omap/lcdc.c depend on > > > > ARCH_OMAP1 as it is not needed for omap2+. > > > > > > I'm ok with the lcdc.c change, but I also have a patch series that makes > > > the same change, plus removes the omap2 code from drivers/video/omap/. > > > > OK, I'll drop the lcdc.c change from my series as that should > > only affect randconfig builds. > > Here's this one updated. Noticed one more legacy driver > that needs omap_read/write defined to build on 2420. This one needed some updates for usb.h after updating patch 7/8 in this series. Updated patch below. Regards, Tony From: Tony Lindgren <tony@atomide.com> Date: Wed, 22 Feb 2012 14:52:41 -0800 Subject: [PATCH] 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> diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h index 09ca9e9..f78ec4e 100644 --- a/arch/arm/mach-omap2/common.h +++ b/arch/arm/mach-omap2/common.h @@ -242,15 +242,5 @@ struct omap_sdrc_params; extern void omap_sdrc_init(struct omap_sdrc_params *sdrc_cs0, struct omap_sdrc_params *sdrc_cs1); -/* - * NOTE: Please use ioremap + __raw_read/write where possible instead of these - */ -extern u8 omap_readb(u32 pa); -extern u16 omap_readw(u32 pa); -extern u32 omap_readl(u32 pa); -extern void omap_writeb(u8 v, u32 pa); -extern void omap_writew(u16 v, u32 pa); -extern void omap_writel(u32 v, u32 pa); - #endif /* __ASSEMBLER__ */ #endif /* __ARCH_ARM_MACH_OMAP2PLUS_COMMON_H */ diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c index 0119807..3203128 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, _omap2_init_reprogram_sdrc(); } } - -/* - * NOTE: Please use ioremap + __raw_read/write where possible instead of these - */ - -u8 omap_readb(u32 pa) -{ - return __raw_readb(OMAP2_L4_IO_ADDRESS(pa)); -} -EXPORT_SYMBOL(omap_readb); - -u16 omap_readw(u32 pa) -{ - return __raw_readw(OMAP2_L4_IO_ADDRESS(pa)); -} -EXPORT_SYMBOL(omap_readw); - -u32 omap_readl(u32 pa) -{ - return __raw_readl(OMAP2_L4_IO_ADDRESS(pa)); -} -EXPORT_SYMBOL(omap_readl); - -void omap_writeb(u8 v, u32 pa) -{ - __raw_writeb(v, OMAP2_L4_IO_ADDRESS(pa)); -} -EXPORT_SYMBOL(omap_writeb); - -void omap_writew(u16 v, u32 pa) -{ - __raw_writew(v, OMAP2_L4_IO_ADDRESS(pa)); -} -EXPORT_SYMBOL(omap_writew); - -void omap_writel(u32 v, u32 pa) -{ - __raw_writel(v, OMAP2_L4_IO_ADDRESS(pa)); -} -EXPORT_SYMBOL(omap_writel); diff --git a/arch/arm/plat-omap/include/plat/keypad.h b/arch/arm/plat-omap/include/plat/keypad.h index 793ce9d..a6b21ed 100644 --- a/arch/arm/plat-omap/include/plat/keypad.h +++ b/arch/arm/plat-omap/include/plat/keypad.h @@ -12,6 +12,8 @@ #ifndef CONFIG_ARCH_OMAP1 #warning Please update the board to use matrix-keypad driver +#define omap_readw(reg) 0 +#define omap_writew(val, reg) do {} while (0) #endif #include <linux/input/matrix_keypad.h> diff --git a/arch/arm/plat-omap/include/plat/usb.h b/arch/arm/plat-omap/include/plat/usb.h index dc864b5..d0fc9f4 100644 --- a/arch/arm/plat-omap/include/plat/usb.h +++ b/arch/arm/plat-omap/include/plat/usb.h @@ -3,6 +3,7 @@ #ifndef __ASM_ARCH_OMAP_USB_H #define __ASM_ARCH_OMAP_USB_H +#include <linux/io.h> #include <linux/usb/musb.h> #include <plat/board.h> @@ -105,6 +106,46 @@ extern int omap4430_phy_set_clk(struct device *dev, int on); extern int omap4430_phy_init(struct device *dev); extern int omap4430_phy_exit(struct device *dev); extern int omap4430_phy_suspend(struct device *dev, int suspend); + +/* + * NOTE: Please update omap USB drivers to use ioremap + read/write + */ + +#define OMAP2_L4_IO_OFFSET 0xb2000000 +#define IOMEM(x) ((void __force __iomem *)(x)) +#define OMAP2_L4_IO_ADDRESS(pa) IOMEM((pa) + OMAP2_L4_IO_OFFSET) + +static inline u8 omap_readb(u32 pa) +{ + return __raw_readb(OMAP2_L4_IO_ADDRESS(pa)); +} + +static inline u16 omap_readw(u32 pa) +{ + return __raw_readw(OMAP2_L4_IO_ADDRESS(pa)); +} + +static inline u32 omap_readl(u32 pa) +{ + return __raw_readl(OMAP2_L4_IO_ADDRESS(pa)); +} + +static inline void omap_writeb(u8 v, u32 pa) +{ + __raw_writeb(v, OMAP2_L4_IO_ADDRESS(pa)); +} + + +static inline void omap_writew(u16 v, u32 pa) +{ + __raw_writew(v, OMAP2_L4_IO_ADDRESS(pa)); +} + +static inline void omap_writel(u32 v, u32 pa) +{ + __raw_writel(v, OMAP2_L4_IO_ADDRESS(pa)); +} + #endif extern void am35x_musb_reset(void); ^ permalink raw reply related [flat|nested] 9+ messages in thread
end of thread, other threads:[~2012-02-24 18:25 UTC | newest] Thread overview: 9+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- [not found] <20120221233619.18709.87982.stgit@kaulin.local> 2012-02-21 23:40 ` [PATCH 1/8] ARM: OMAP2+: Move DISPC L3 firewall to happen in omap_display_init() Tony Lindgren 2012-02-22 8:09 ` Tomi Valkeinen 2012-02-22 19:05 ` Tony Lindgren 2012-02-22 22:17 ` Tony Lindgren 2012-02-21 23:40 ` [PATCH 8/8] ARM: OMAP2+: Limit omap_read/write usage to legacy USB drivers Tony Lindgren 2012-02-22 8:14 ` Tomi Valkeinen 2012-02-22 18:57 ` Tony Lindgren 2012-02-22 22:44 ` Tony Lindgren 2012-02-24 18:25 ` Tony Lindgren
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).