Re: [PATCH 7/8] ARM: OMAP: Remove plat/io.h by moving it into mach/io.h
On 02/28/2012 07:47 PM, Tony Lindgren wrote: * Rob Herring robherri...@gmail.com [120226 19:15]: On 02/24/2012 12:22 PM, Tony Lindgren wrote: * Tony Lindgren t...@atomide.com [120223 15:36]: * Rob Herring robherri...@gmail.com [120221 17:53]: On 02/21/2012 05:40 PM, Tony Lindgren wrote: + +/* + * 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); These can't be moved to common.h like omap2? Not for omap1 currently because a bunch of legacy drivers are using them :( Looks like we can have them in mach-omap1/include/mach/hardware.h. Eventually the SoC specific hardware.h files could be renamed to just something like omap1.h, omap2plus.h and so. And then they could be included in the common hardware.h. Updated patch below, now io.h for both omap1 and omap2+ are minimized, and turns out only minimal driver changes were needed. Looks good to me. Do you have a branch for this that I can base on? Yes it's now in iomap branch that merged into my cleanup branch that I'll ask Arnd and Olof to pull tomorrow. So take your pick out of the following two: 1. iomap branch based on v3.3-rc4 that you probably want to use git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap iomap 2. cleanup branch based on RMK's commit 61b80086a525c8a6081257ae40da5dee2bcaee16 (Merge branch 'entry-macro-cleanup' of git://sources.calxeda.com/kernel/linux into for-armsoc) git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap cleanup BTW, I noticed the following fix is needed for some .configs that I found with randconfig builds, that's only in the cleanup branch as I already merged in iomap and pushed it out. Should not affect your patches though. BTW, all these includes need to get removed. I'll add a fix to my series unless you already have fixes: arch/arm/mach-omap1/sleep.S:#include mach/io.h arch/arm/mach-omap1/sram.S:#include mach/io.h arch/arm/plat-omap/include/plat/sdrc.h:#include mach/io.h drivers/media/video/davinci/vpbe_osd.c:#include mach/io.h drivers/media/video/davinci/vpbe_venc.c:#include mach/io.h drivers/video/omap2/vrfb.c:#include mach/io.h Rob Regards, Tony From: Tony Lindgren t...@atomide.com Date: Tue, 28 Feb 2012 17:28:09 -0800 Subject: [PATCH] ARM: OMAP2+: Fix L4_EMU_34XX_BASE error after iomap changes With the introduction of iomap changes platform init code fails for emu.c if CONFIG_OMAP3_EMU is selected: arch/arm/mach-omap2/emu.c:35:8: error: 'L4_EMU_34XX_BASE' undeclared here (not in a function) Signed-off-by: Tony Lindgren t...@atomide.com --- a/arch/arm/mach-omap2/emu.c +++ b/arch/arm/mach-omap2/emu.c @@ -21,6 +21,8 @@ #include linux/clk.h #include linux/err.h +#include mach/hardware.h + #include iomap.h MODULE_LICENSE(GPL); -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 7/8] ARM: OMAP: Remove plat/io.h by moving it into mach/io.h
On Wed, Feb 29, 2012 at 05:59:27PM -0600, Rob Herring wrote: BTW, all these includes need to get removed. I'll add a fix to my series unless you already have fixes: arch/arm/mach-omap1/sleep.S:#include mach/io.h arch/arm/mach-omap1/sram.S:#include mach/io.h arch/arm/plat-omap/include/plat/sdrc.h:#include mach/io.h drivers/media/video/davinci/vpbe_osd.c:#include mach/io.h drivers/media/video/davinci/vpbe_venc.c:#include mach/io.h drivers/video/omap2/vrfb.c:#include mach/io.h All the ones included from .h and .c files should be using linux/io.h and not some other derivative. -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 7/8] ARM: OMAP: Remove plat/io.h by moving it into mach/io.h
* Russell King - ARM Linux li...@arm.linux.org.uk [120229 15:40]: On Wed, Feb 29, 2012 at 05:59:27PM -0600, Rob Herring wrote: BTW, all these includes need to get removed. I'll add a fix to my series unless you already have fixes: arch/arm/mach-omap1/sleep.S:#include mach/io.h arch/arm/mach-omap1/sram.S:#include mach/io.h arch/arm/plat-omap/include/plat/sdrc.h:#include mach/io.h drivers/media/video/davinci/vpbe_osd.c:#include mach/io.h drivers/media/video/davinci/vpbe_venc.c:#include mach/io.h drivers/video/omap2/vrfb.c:#include mach/io.h All the ones included from .h and .c files should be using linux/io.h and not some other derivative. Oops looks like I missed some files while fixing up the .c files. The .S files should be able to just use the local header now. I'll do a patch for that, won't touch the davinci files though. Regards, Tony -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 7/8] ARM: OMAP: Remove plat/io.h by moving it into mach/io.h
* Tony Lindgren t...@atomide.com [120229 16:08]: * Russell King - ARM Linux li...@arm.linux.org.uk [120229 15:40]: On Wed, Feb 29, 2012 at 05:59:27PM -0600, Rob Herring wrote: BTW, all these includes need to get removed. I'll add a fix to my series unless you already have fixes: arch/arm/mach-omap1/sleep.S:#include mach/io.h arch/arm/mach-omap1/sram.S:#include mach/io.h arch/arm/plat-omap/include/plat/sdrc.h:#include mach/io.h drivers/media/video/davinci/vpbe_osd.c:#include mach/io.h drivers/media/video/davinci/vpbe_venc.c:#include mach/io.h drivers/video/omap2/vrfb.c:#include mach/io.h All the ones included from .h and .c files should be using linux/io.h and not some other derivative. Oops looks like I missed some files while fixing up the .c files. The .S files should be able to just use the local header now. I'll do a patch for that, won't touch the davinci files though. Here's the patch to remove mach/io.h for omaps. We can now remove all of them like Rob suggested :) Rob, I assume you'll apply this into your branch? Regards, Tony From: Tony Lindgren t...@atomide.com Date: Wed, 29 Feb 2012 17:01:22 -0800 Subject: [PATCH] ARM: OMAP: Remove remaining includes for mach/io.h These are no longer needed with the recent iomap.h changes. Reported-by: Rob Herring robherri...@gmail.com Signed-off-by: Tony Lindgren t...@atomide.com --- a/arch/arm/mach-omap1/include/mach/entry-macro.S +++ b/arch/arm/mach-omap1/include/mach/entry-macro.S @@ -11,7 +11,6 @@ */ #include mach/hardware.h -#include mach/io.h #include mach/irqs.h #include ../../iomap.h --- a/arch/arm/mach-omap1/sram.S +++ b/arch/arm/mach-omap1/sram.S @@ -12,7 +12,6 @@ #include asm/assembler.h -#include mach/io.h #include mach/hardware.h #include iomap.h --- a/arch/arm/plat-omap/include/plat/sdrc.h +++ b/arch/arm/plat-omap/include/plat/sdrc.h @@ -16,8 +16,6 @@ * published by the Free Software Foundation. */ -#include mach/io.h - /* SDRC register offsets - read/write with sdrc_{read,write}_reg() */ #define SDRC_SYSCONFIG 0x010 --- a/drivers/video/omap2/vrfb.c +++ b/drivers/video/omap2/vrfb.c @@ -27,7 +27,6 @@ #include linux/bitops.h #include linux/mutex.h -#include mach/io.h #include plat/vrfb.h #include plat/sdrc.h -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 7/8] ARM: OMAP: Remove plat/io.h by moving it into mach/io.h
On 02/29/2012 07:03 PM, Tony Lindgren wrote: * Tony Lindgren t...@atomide.com [120229 16:08]: * Russell King - ARM Linux li...@arm.linux.org.uk [120229 15:40]: On Wed, Feb 29, 2012 at 05:59:27PM -0600, Rob Herring wrote: BTW, all these includes need to get removed. I'll add a fix to my series unless you already have fixes: arch/arm/mach-omap1/sleep.S:#include mach/io.h arch/arm/mach-omap1/sram.S:#include mach/io.h arch/arm/plat-omap/include/plat/sdrc.h:#include mach/io.h drivers/media/video/davinci/vpbe_osd.c:#include mach/io.h drivers/media/video/davinci/vpbe_venc.c:#include mach/io.h drivers/video/omap2/vrfb.c:#include mach/io.h All the ones included from .h and .c files should be using linux/io.h and not some other derivative. Oops looks like I missed some files while fixing up the .c files. The .S files should be able to just use the local header now. I'll do a patch for that, won't touch the davinci files though. Here's the patch to remove mach/io.h for omaps. We can now remove all of them like Rob suggested :) Rob, I assume you'll apply this into your branch? Yes Regards, Tony From: Tony Lindgren t...@atomide.com Date: Wed, 29 Feb 2012 17:01:22 -0800 Subject: [PATCH] ARM: OMAP: Remove remaining includes for mach/io.h These are no longer needed with the recent iomap.h changes. Reported-by: Rob Herring robherri...@gmail.com Signed-off-by: Tony Lindgren t...@atomide.com --- a/arch/arm/mach-omap1/include/mach/entry-macro.S +++ b/arch/arm/mach-omap1/include/mach/entry-macro.S @@ -11,7 +11,6 @@ */ #include mach/hardware.h -#include mach/io.h #include mach/irqs.h #include ../../iomap.h --- a/arch/arm/mach-omap1/sram.S +++ b/arch/arm/mach-omap1/sram.S @@ -12,7 +12,6 @@ #include asm/assembler.h -#include mach/io.h #include mach/hardware.h #include iomap.h --- a/arch/arm/plat-omap/include/plat/sdrc.h +++ b/arch/arm/plat-omap/include/plat/sdrc.h @@ -16,8 +16,6 @@ * published by the Free Software Foundation. */ -#include mach/io.h - I added iomap.h here as there are macros in the header from it. Rob /* SDRC register offsets - read/write with sdrc_{read,write}_reg() */ #define SDRC_SYSCONFIG 0x010 --- a/drivers/video/omap2/vrfb.c +++ b/drivers/video/omap2/vrfb.c @@ -27,7 +27,6 @@ #include linux/bitops.h #include linux/mutex.h -#include mach/io.h #include plat/vrfb.h #include plat/sdrc.h -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 7/8] ARM: OMAP: Remove plat/io.h by moving it into mach/io.h
* Rob Herring robherri...@gmail.com [120229 19:02]: On 02/29/2012 07:03 PM, Tony Lindgren wrote: Rob, I assume you'll apply this into your branch? Yes OK --- a/arch/arm/plat-omap/include/plat/sdrc.h +++ b/arch/arm/plat-omap/include/plat/sdrc.h @@ -16,8 +16,6 @@ * published by the Free Software Foundation. */ -#include mach/io.h - I added iomap.h here as there are macros in the header from it. Hmm, did you get some compile error? I though all code using sdrc.h already has iomap.h included. This file should eventually be local to mach-omap2. Regards, Tony -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 7/8] ARM: OMAP: Remove plat/io.h by moving it into mach/io.h
On 02/29/2012 09:46 PM, Tony Lindgren wrote: * Rob Herring robherri...@gmail.com [120229 19:02]: On 02/29/2012 07:03 PM, Tony Lindgren wrote: Rob, I assume you'll apply this into your branch? Yes OK --- a/arch/arm/plat-omap/include/plat/sdrc.h +++ b/arch/arm/plat-omap/include/plat/sdrc.h @@ -16,8 +16,6 @@ * published by the Free Software Foundation. */ -#include mach/io.h - I added iomap.h here as there are macros in the header from it. Hmm, did you get some compile error? I though all code using sdrc.h already has iomap.h included. This file should eventually be local to mach-omap2. No, just examined the file. If it compiles, either way is fine with me. Rob -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 7/8] ARM: OMAP: Remove plat/io.h by moving it into mach/io.h
* Rob Herring robherri...@gmail.com [120229 19:22]: On 02/29/2012 09:46 PM, Tony Lindgren wrote: * Rob Herring robherri...@gmail.com [120229 19:02]: On 02/29/2012 07:03 PM, Tony Lindgren wrote: Rob, I assume you'll apply this into your branch? Yes OK --- a/arch/arm/plat-omap/include/plat/sdrc.h +++ b/arch/arm/plat-omap/include/plat/sdrc.h @@ -16,8 +16,6 @@ * published by the Free Software Foundation. */ -#include mach/io.h - I added iomap.h here as there are macros in the header from it. Hmm, did you get some compile error? I though all code using sdrc.h already has iomap.h included. This file should eventually be local to mach-omap2. No, just examined the file. If it compiles, either way is fine with me. OK let's leave it out then as it simplifies further clean up. I tested it with omap1_defconfig and omap2plus_defconfig, will also run some randconfigs with it. Regards, Tony -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 7/8] ARM: OMAP: Remove plat/io.h by moving it into mach/io.h
* Rob Herring robherri...@gmail.com [120226 19:15]: On 02/24/2012 12:22 PM, Tony Lindgren wrote: * Tony Lindgren t...@atomide.com [120223 15:36]: * Rob Herring robherri...@gmail.com [120221 17:53]: On 02/21/2012 05:40 PM, Tony Lindgren wrote: + +/* + * 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); These can't be moved to common.h like omap2? Not for omap1 currently because a bunch of legacy drivers are using them :( Looks like we can have them in mach-omap1/include/mach/hardware.h. Eventually the SoC specific hardware.h files could be renamed to just something like omap1.h, omap2plus.h and so. And then they could be included in the common hardware.h. Updated patch below, now io.h for both omap1 and omap2+ are minimized, and turns out only minimal driver changes were needed. Looks good to me. Do you have a branch for this that I can base on? Yes it's now in iomap branch that merged into my cleanup branch that I'll ask Arnd and Olof to pull tomorrow. So take your pick out of the following two: 1. iomap branch based on v3.3-rc4 that you probably want to use git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap iomap 2. cleanup branch based on RMK's commit 61b80086a525c8a6081257ae40da5dee2bcaee16 (Merge branch 'entry-macro-cleanup' of git://sources.calxeda.com/kernel/linux into for-armsoc) git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap cleanup BTW, I noticed the following fix is needed for some .configs that I found with randconfig builds, that's only in the cleanup branch as I already merged in iomap and pushed it out. Should not affect your patches though. Regards, Tony From: Tony Lindgren t...@atomide.com Date: Tue, 28 Feb 2012 17:28:09 -0800 Subject: [PATCH] ARM: OMAP2+: Fix L4_EMU_34XX_BASE error after iomap changes With the introduction of iomap changes platform init code fails for emu.c if CONFIG_OMAP3_EMU is selected: arch/arm/mach-omap2/emu.c:35:8: error: 'L4_EMU_34XX_BASE' undeclared here (not in a function) Signed-off-by: Tony Lindgren t...@atomide.com --- a/arch/arm/mach-omap2/emu.c +++ b/arch/arm/mach-omap2/emu.c @@ -21,6 +21,8 @@ #include linux/clk.h #include linux/err.h +#include mach/hardware.h + #include iomap.h MODULE_LICENSE(GPL); -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 7/8] ARM: OMAP: Remove plat/io.h by moving it into mach/io.h
* Tony Lindgren t...@atomide.com [120228 17:15]: * Rob Herring robherri...@gmail.com [120226 19:15]: On 02/24/2012 12:22 PM, Tony Lindgren wrote: * Tony Lindgren t...@atomide.com [120223 15:36]: * Rob Herring robherri...@gmail.com [120221 17:53]: On 02/21/2012 05:40 PM, Tony Lindgren wrote: + +/* + * 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); These can't be moved to common.h like omap2? Not for omap1 currently because a bunch of legacy drivers are using them :( Looks like we can have them in mach-omap1/include/mach/hardware.h. Eventually the SoC specific hardware.h files could be renamed to just something like omap1.h, omap2plus.h and so. And then they could be included in the common hardware.h. Updated patch below, now io.h for both omap1 and omap2+ are minimized, and turns out only minimal driver changes were needed. Looks good to me. Do you have a branch for this that I can base on? Yes it's now in iomap branch that merged into my cleanup branch that I'll ask Arnd and Olof to pull tomorrow. So take your pick out of the following two: 1. iomap branch based on v3.3-rc4 that you probably want to use git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap iomap Correction: #1 above is based on v3.3-rc3, not -rc4. 2. cleanup branch based on RMK's commit 61b80086a525c8a6081257ae40da5dee2bcaee16 (Merge branch 'entry-macro-cleanup' of git://sources.calxeda.com/kernel/linux into for-armsoc) git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap cleanup Regards, Tony -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 7/8] ARM: OMAP: Remove plat/io.h by moving it into mach/io.h
On 02/24/2012 12:22 PM, Tony Lindgren wrote: * Tony Lindgren t...@atomide.com [120223 15:36]: * Rob Herring robherri...@gmail.com [120221 17:53]: On 02/21/2012 05:40 PM, Tony Lindgren wrote: + +/* + * 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); These can't be moved to common.h like omap2? Not for omap1 currently because a bunch of legacy drivers are using them :( Looks like we can have them in mach-omap1/include/mach/hardware.h. Eventually the SoC specific hardware.h files could be renamed to just something like omap1.h, omap2plus.h and so. And then they could be included in the common hardware.h. Updated patch below, now io.h for both omap1 and omap2+ are minimized, and turns out only minimal driver changes were needed. Looks good to me. Do you have a branch for this that I can base on? Rob Regards, Tony From: Tony Lindgren t...@atomide.com Date: Fri, 24 Feb 2012 09:05:43 -0800 Subject: [PATCH] ARM: OMAP: Remove plat/io.h by splitting it into mach/io.h and mach/hardware.h This is needed to minimize io.h so the SoC specific io.h for ARMs can removed. Note that minimal driver changes for DSS and RNG are needed to include cpu.h for SoC detection macros. Cc: Tomi Valkeinen tomi.valkei...@ti.com Cc: Matt Mackall m...@selenic.com Cc: Herbert Xu herb...@gondor.apana.org.au Signed-off-by: Tony Lindgren t...@atomide.com diff --git a/arch/arm/mach-omap1/clock.c b/arch/arm/mach-omap1/clock.c index 0e8c176..67382dd 100644 --- a/arch/arm/mach-omap1/clock.c +++ b/arch/arm/mach-omap1/clock.c @@ -15,6 +15,7 @@ #include linux/list.h #include linux/errno.h #include linux/err.h +#include linux/io.h #include linux/clk.h #include linux/clkdev.h @@ -26,6 +27,8 @@ #include plat/sram.h #include plat/clkdev_omap.h +#include mach/hardware.h + #include iomap.h #include clock.h #include opp.h diff --git a/arch/arm/mach-omap1/clock_data.c b/arch/arm/mach-omap1/clock_data.c index 10b7451..c6ce93f 100644 --- a/arch/arm/mach-omap1/clock_data.c +++ b/arch/arm/mach-omap1/clock_data.c @@ -15,6 +15,7 @@ */ #include linux/kernel.h +#include linux/io.h #include linux/clk.h #include linux/cpufreq.h #include linux/delay.h @@ -27,6 +28,8 @@ #include plat/sram.h /* for omap_sram_reprogram_clock() */ #include plat/usb.h /* for OTG_BASE */ +#include mach/hardware.h + #include iomap.h #include clock.h diff --git a/arch/arm/mach-omap1/flash.c b/arch/arm/mach-omap1/flash.c index 98d29a0..f9bf78d 100644 --- a/arch/arm/mach-omap1/flash.c +++ b/arch/arm/mach-omap1/flash.c @@ -13,6 +13,8 @@ #include plat/tc.h #include plat/flash.h +#include mach/hardware.h + void omap1_set_vpp(struct platform_device *pdev, int enable) { static int count; diff --git a/arch/arm/mach-omap1/id.c b/arch/arm/mach-omap1/id.c index 7483db2..f24c1e2 100644 --- a/arch/arm/mach-omap1/id.c +++ b/arch/arm/mach-omap1/id.c @@ -18,6 +18,8 @@ #include plat/cpu.h +#include mach/hardware.h + #define OMAP_DIE_ID_00xfffe1800 #define OMAP_DIE_ID_10xfffe1804 #define OMAP_PRODUCTION_ID_0 0xfffe2000 diff --git a/arch/arm/mach-omap1/include/mach/hardware.h b/arch/arm/mach-omap1/include/mach/hardware.h index a3f6287..01e35fa 100644 --- a/arch/arm/mach-omap1/include/mach/hardware.h +++ b/arch/arm/mach-omap1/include/mach/hardware.h @@ -2,4 +2,40 @@ * arch/arm/mach-omap1/include/mach/hardware.h */ +#ifndef __MACH_HARDWARE_H +#define __MACH_HARDWARE_H + +#ifndef __ASSEMBLER__ +/* + * 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); + +#include plat/tc.h + +/* Almost all documentation for chip and board memory maps assumes + * BM is clear. Most devel boards have a switch to control booting + * from NOR flash (using external chipselect 3) rather than mask ROM, + * which uses BM to interchange the physical CS0 and CS3 addresses. + */ +static inline u32 omap_cs0m_phys(void) +{ + return (omap_readl(EMIFS_CONFIG) OMAP_EMIFS_CONFIG_BM) + ? OMAP_CS3_PHYS : 0; +} + +static inline u32 omap_cs3_phys(void) +{ + return (omap_readl(EMIFS_CONFIG) OMAP_EMIFS_CONFIG_BM) + ? 0 : OMAP_CS3_PHYS; +} + +#endif +#endif + #include plat/hardware.h diff --git a/arch/arm/mach-omap1/include/mach/io.h b/arch/arm/mach-omap1/include/mach/io.h index 57bdf74..37b12e1 100644 ---
Re: [PATCH 7/8] ARM: OMAP: Remove plat/io.h by moving it into mach/io.h
* Tony Lindgren t...@atomide.com [120223 15:36]: * Rob Herring robherri...@gmail.com [120221 17:53]: On 02/21/2012 05:40 PM, Tony Lindgren wrote: + +/* + * 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); These can't be moved to common.h like omap2? Not for omap1 currently because a bunch of legacy drivers are using them :( Looks like we can have them in mach-omap1/include/mach/hardware.h. Eventually the SoC specific hardware.h files could be renamed to just something like omap1.h, omap2plus.h and so. And then they could be included in the common hardware.h. Updated patch below, now io.h for both omap1 and omap2+ are minimized, and turns out only minimal driver changes were needed. Regards, Tony From: Tony Lindgren t...@atomide.com Date: Fri, 24 Feb 2012 09:05:43 -0800 Subject: [PATCH] ARM: OMAP: Remove plat/io.h by splitting it into mach/io.h and mach/hardware.h This is needed to minimize io.h so the SoC specific io.h for ARMs can removed. Note that minimal driver changes for DSS and RNG are needed to include cpu.h for SoC detection macros. Cc: Tomi Valkeinen tomi.valkei...@ti.com Cc: Matt Mackall m...@selenic.com Cc: Herbert Xu herb...@gondor.apana.org.au Signed-off-by: Tony Lindgren t...@atomide.com diff --git a/arch/arm/mach-omap1/clock.c b/arch/arm/mach-omap1/clock.c index 0e8c176..67382dd 100644 --- a/arch/arm/mach-omap1/clock.c +++ b/arch/arm/mach-omap1/clock.c @@ -15,6 +15,7 @@ #include linux/list.h #include linux/errno.h #include linux/err.h +#include linux/io.h #include linux/clk.h #include linux/clkdev.h @@ -26,6 +27,8 @@ #include plat/sram.h #include plat/clkdev_omap.h +#include mach/hardware.h + #include iomap.h #include clock.h #include opp.h diff --git a/arch/arm/mach-omap1/clock_data.c b/arch/arm/mach-omap1/clock_data.c index 10b7451..c6ce93f 100644 --- a/arch/arm/mach-omap1/clock_data.c +++ b/arch/arm/mach-omap1/clock_data.c @@ -15,6 +15,7 @@ */ #include linux/kernel.h +#include linux/io.h #include linux/clk.h #include linux/cpufreq.h #include linux/delay.h @@ -27,6 +28,8 @@ #include plat/sram.h /* for omap_sram_reprogram_clock() */ #include plat/usb.h /* for OTG_BASE */ +#include mach/hardware.h + #include iomap.h #include clock.h diff --git a/arch/arm/mach-omap1/flash.c b/arch/arm/mach-omap1/flash.c index 98d29a0..f9bf78d 100644 --- a/arch/arm/mach-omap1/flash.c +++ b/arch/arm/mach-omap1/flash.c @@ -13,6 +13,8 @@ #include plat/tc.h #include plat/flash.h +#include mach/hardware.h + void omap1_set_vpp(struct platform_device *pdev, int enable) { static int count; diff --git a/arch/arm/mach-omap1/id.c b/arch/arm/mach-omap1/id.c index 7483db2..f24c1e2 100644 --- a/arch/arm/mach-omap1/id.c +++ b/arch/arm/mach-omap1/id.c @@ -18,6 +18,8 @@ #include plat/cpu.h +#include mach/hardware.h + #define OMAP_DIE_ID_0 0xfffe1800 #define OMAP_DIE_ID_1 0xfffe1804 #define OMAP_PRODUCTION_ID_0 0xfffe2000 diff --git a/arch/arm/mach-omap1/include/mach/hardware.h b/arch/arm/mach-omap1/include/mach/hardware.h index a3f6287..01e35fa 100644 --- a/arch/arm/mach-omap1/include/mach/hardware.h +++ b/arch/arm/mach-omap1/include/mach/hardware.h @@ -2,4 +2,40 @@ * arch/arm/mach-omap1/include/mach/hardware.h */ +#ifndef __MACH_HARDWARE_H +#define __MACH_HARDWARE_H + +#ifndef __ASSEMBLER__ +/* + * 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); + +#include plat/tc.h + +/* Almost all documentation for chip and board memory maps assumes + * BM is clear. Most devel boards have a switch to control booting + * from NOR flash (using external chipselect 3) rather than mask ROM, + * which uses BM to interchange the physical CS0 and CS3 addresses. + */ +static inline u32 omap_cs0m_phys(void) +{ + return (omap_readl(EMIFS_CONFIG) OMAP_EMIFS_CONFIG_BM) + ? OMAP_CS3_PHYS : 0; +} + +static inline u32 omap_cs3_phys(void) +{ + return (omap_readl(EMIFS_CONFIG) OMAP_EMIFS_CONFIG_BM) + ? 0 : OMAP_CS3_PHYS; +} + +#endif +#endif + #include plat/hardware.h diff --git a/arch/arm/mach-omap1/include/mach/io.h b/arch/arm/mach-omap1/include/mach/io.h index 57bdf74..37b12e1 100644 --- a/arch/arm/mach-omap1/include/mach/io.h +++ b/arch/arm/mach-omap1/include/mach/io.h @@ -1,5 +1,46 @@ /* * arch/arm/mach-omap1/include/mach/io.h + * + * IO definitions for TI OMAP processors and boards + * + * Copied from arch/arm/mach-sa1100/include/mach/io.h + * Copyright
Re: [PATCH 7/8] ARM: OMAP: Remove plat/io.h by moving it into mach/io.h
* Rob Herring robherri...@gmail.com [120221 17:53]: On 02/21/2012 05:40 PM, Tony Lindgren wrote: This is needed so we can eventually remove mach/io.h for omap2+. ... -#include plat/io.h +#ifndef __ASM_ARM_ARCH_IO_H +#define __ASM_ARM_ARCH_IO_H + +#include mach/hardware.h This shouldn't be needed. Good catch, will update things for that. + +#define IO_SPACE_LIMIT 0x + +/* + * We don't actually have real ISA nor PCI buses, but there is so many + * drivers out there that might just work if we fake them... + */ +#define __io(a)__typesafe_io(a) +#define __mem_pci(a) (a) + +/* + * + * I/O mapping + * + */ + +#ifdef __ASSEMBLER__ +#define IOMEM(x) (x) +#else +#define IOMEM(x) ((void __force __iomem *)(x)) +#endif + This can't be moved to iomap.h? I did that for other platforms. Well I was thinking we should define these somewhere for everybody, so I was trying to avoid adding yet another copy.. But I can move it and then we can clean it up later to avoid more dependencies here. +/* + * + * Omap specific register access + * + */ + +#ifndef __ASSEMBLER__ + +/* + * 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); These can't be moved to common.h like omap2? Not for omap1 currently because a bunch of legacy drivers are using them :( Anyways, that should be OK for now as omap1 requires v5 flags and it currently does not make sense to try to compile into a common zImage. At least the USB driver already needs to be cleaned up for that, so eventually omap1 io.h can disappear too. Same comments on omap2 io.h. Thanks, will post an updated patch. Regards, Tony -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 7/8] ARM: OMAP: Remove plat/io.h by moving it into mach/io.h
This is needed so we can eventually remove mach/io.h for omap2+. Signed-off-by: Tony Lindgren t...@atomide.com --- arch/arm/mach-omap1/include/mach/io.h | 78 ++- arch/arm/mach-omap2/common.h | 10 arch/arm/mach-omap2/include/mach/io.h | 60 +++- arch/arm/mach-omap2/pm24xx.c |2 - arch/arm/plat-omap/dma.c |2 + arch/arm/plat-omap/include/plat/io.h | 84 - arch/arm/plat-omap/usb.c |2 + 7 files changed, 150 insertions(+), 88 deletions(-) delete mode 100644 arch/arm/plat-omap/include/plat/io.h diff --git a/arch/arm/mach-omap1/include/mach/io.h b/arch/arm/mach-omap1/include/mach/io.h index 57bdf74..07ffba8 100644 --- a/arch/arm/mach-omap1/include/mach/io.h +++ b/arch/arm/mach-omap1/include/mach/io.h @@ -1,5 +1,81 @@ /* * arch/arm/mach-omap1/include/mach/io.h + * + * IO definitions for TI OMAP processors and boards + * + * Copied from arch/arm/mach-sa1100/include/mach/io.h + * Copyright (C) 1997-1999 Russell King + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 675 Mass Ave, Cambridge, MA 02139, USA. + * + * Modifications: + * 06-12-1997 RMK Created. + * 07-04-1999 RMK Major cleanup */ -#include plat/io.h +#ifndef __ASM_ARM_ARCH_IO_H +#define __ASM_ARM_ARCH_IO_H + +#include mach/hardware.h + +#define IO_SPACE_LIMIT 0x + +/* + * We don't actually have real ISA nor PCI buses, but there is so many + * drivers out there that might just work if we fake them... + */ +#define __io(a)__typesafe_io(a) +#define __mem_pci(a) (a) + +/* + * + * I/O mapping + * + */ + +#ifdef __ASSEMBLER__ +#define IOMEM(x) (x) +#else +#define IOMEM(x) ((void __force __iomem *)(x)) +#endif + +/* + * + * Omap specific register access + * + */ + +#ifndef __ASSEMBLER__ + +/* + * 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 + +#endif diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h index f78ec4e..09ca9e9 100644 --- a/arch/arm/mach-omap2/common.h +++ b/arch/arm/mach-omap2/common.h @@ -242,5 +242,15 @@ 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/include/mach/io.h b/arch/arm/mach-omap2/include/mach/io.h index fd78f31..7306404 100644 --- a/arch/arm/mach-omap2/include/mach/io.h +++ b/arch/arm/mach-omap2/include/mach/io.h @@ -1,5 +1,63 @@ /* * arch/arm/mach-omap2/include/mach/io.h + * + * IO definitions for TI OMAP processors and boards + * + * Copied from arch/arm/mach-sa1100/include/mach/io.h + * Copyright (C) 1997-1999 Russell King + * + * Copyright (C) 2009 Texas Instruments + * Added OMAP4 support - Santosh Shilimkar santosh.shilim...@ti.com + * + * This program is free software; you can redistribute it and/or modify it +
Re: [PATCH 7/8] ARM: OMAP: Remove plat/io.h by moving it into mach/io.h
On 02/21/2012 05:40 PM, Tony Lindgren wrote: This is needed so we can eventually remove mach/io.h for omap2+. Signed-off-by: Tony Lindgren t...@atomide.com --- arch/arm/mach-omap1/include/mach/io.h | 78 ++- arch/arm/mach-omap2/common.h | 10 arch/arm/mach-omap2/include/mach/io.h | 60 +++- arch/arm/mach-omap2/pm24xx.c |2 - arch/arm/plat-omap/dma.c |2 + arch/arm/plat-omap/include/plat/io.h | 84 - arch/arm/plat-omap/usb.c |2 + 7 files changed, 150 insertions(+), 88 deletions(-) delete mode 100644 arch/arm/plat-omap/include/plat/io.h diff --git a/arch/arm/mach-omap1/include/mach/io.h b/arch/arm/mach-omap1/include/mach/io.h index 57bdf74..07ffba8 100644 --- a/arch/arm/mach-omap1/include/mach/io.h +++ b/arch/arm/mach-omap1/include/mach/io.h @@ -1,5 +1,81 @@ /* * arch/arm/mach-omap1/include/mach/io.h + * + * IO definitions for TI OMAP processors and boards + * + * Copied from arch/arm/mach-sa1100/include/mach/io.h + * Copyright (C) 1997-1999 Russell King + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 675 Mass Ave, Cambridge, MA 02139, USA. + * + * Modifications: + * 06-12-1997 RMK Created. + * 07-04-1999 RMK Major cleanup */ -#include plat/io.h +#ifndef __ASM_ARM_ARCH_IO_H +#define __ASM_ARM_ARCH_IO_H + +#include mach/hardware.h This shouldn't be needed. + +#define IO_SPACE_LIMIT 0x + +/* + * We don't actually have real ISA nor PCI buses, but there is so many + * drivers out there that might just work if we fake them... + */ +#define __io(a) __typesafe_io(a) +#define __mem_pci(a) (a) + +/* + * + * I/O mapping + * + */ + +#ifdef __ASSEMBLER__ +#define IOMEM(x) (x) +#else +#define IOMEM(x) ((void __force __iomem *)(x)) +#endif + This can't be moved to iomap.h? I did that for other platforms. +/* + * + * Omap specific register access + * + */ + +#ifndef __ASSEMBLER__ + +/* + * 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); These can't be moved to common.h like omap2? Same comments on omap2 io.h. Rob + +#endif + +#endif diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h index f78ec4e..09ca9e9 100644 --- a/arch/arm/mach-omap2/common.h +++ b/arch/arm/mach-omap2/common.h @@ -242,5 +242,15 @@ 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/include/mach/io.h b/arch/arm/mach-omap2/include/mach/io.h index fd78f31..7306404 100644 --- a/arch/arm/mach-omap2/include/mach/io.h +++ b/arch/arm/mach-omap2/include/mach/io.h @@ -1,5 +1,63 @@ /* *