diff options
| author | Tony Lindgren <tony@atomide.com> | 2008-07-03 05:24:44 -0400 |
|---|---|---|
| committer | Tony Lindgren <tony@atomide.com> | 2008-07-03 05:24:44 -0400 |
| commit | a58caad11301a5bdc2d7b76596ab5477221f7a9b (patch) | |
| tree | 95bb4df0ad450b0439cdf6256d2a2b2345b03231 /include | |
| parent | e1f80bfca86ab48b7bed731b32262fb1a2835de5 (diff) | |
ARM: OMAP: Introduce omap_globals and prcm access functions for multi-omap
New struct omap_globals contains the omap processor specific
module bases. Use omap_globals to set the various base addresses
to make detecting omap chip type simpler.
Also introduce OMAP1_IO_ADDRESS and OMAP2_IO_ADDRESS for future multi-omap
patches.
Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'include')
| -rw-r--r-- | include/asm-arm/arch-omap/common.h | 15 | ||||
| -rw-r--r-- | include/asm-arm/arch-omap/control.h | 4 | ||||
| -rw-r--r-- | include/asm-arm/arch-omap/io.h | 3 |
3 files changed, 19 insertions, 3 deletions
diff --git a/include/asm-arm/arch-omap/common.h b/include/asm-arm/arch-omap/common.h index 36a3b62d4d8d..8ac03071f60c 100644 --- a/include/asm-arm/arch-omap/common.h +++ b/include/asm-arm/arch-omap/common.h | |||
| @@ -47,8 +47,23 @@ static inline int omap_register_i2c_bus(int bus_id, u32 clkrate, | |||
| 47 | } | 47 | } |
| 48 | #endif | 48 | #endif |
| 49 | 49 | ||
| 50 | /* IO bases for various OMAP processors */ | ||
| 51 | struct omap_globals { | ||
| 52 | void __iomem *tap; /* Control module ID code */ | ||
| 53 | void __iomem *sdrc; /* SDRAM Controller */ | ||
| 54 | void __iomem *sms; /* SDRAM Memory Scheduler */ | ||
| 55 | void __iomem *ctrl; /* System Control Module */ | ||
| 56 | void __iomem *prm; /* Power and Reset Management */ | ||
| 57 | void __iomem *cm; /* Clock Management */ | ||
| 58 | }; | ||
| 59 | |||
| 50 | void omap2_set_globals_242x(void); | 60 | void omap2_set_globals_242x(void); |
| 51 | void omap2_set_globals_243x(void); | 61 | void omap2_set_globals_243x(void); |
| 52 | void omap2_set_globals_343x(void); | 62 | void omap2_set_globals_343x(void); |
| 53 | 63 | ||
| 64 | /* These get called from omap2_set_globals_xxxx(), do not call these */ | ||
| 65 | void omap2_set_globals_memory(struct omap_globals *); | ||
| 66 | void omap2_set_globals_control(struct omap_globals *); | ||
| 67 | void omap2_set_globals_prcm(struct omap_globals *); | ||
| 68 | |||
| 54 | #endif /* __ARCH_ARM_MACH_OMAP_COMMON_H */ | 69 | #endif /* __ARCH_ARM_MACH_OMAP_COMMON_H */ |
diff --git a/include/asm-arm/arch-omap/control.h b/include/asm-arm/arch-omap/control.h index 59c0686f8be7..987553e3eeb9 100644 --- a/include/asm-arm/arch-omap/control.h +++ b/include/asm-arm/arch-omap/control.h | |||
| @@ -167,8 +167,7 @@ | |||
| 167 | 167 | ||
| 168 | #ifndef __ASSEMBLY__ | 168 | #ifndef __ASSEMBLY__ |
| 169 | #if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) | 169 | #if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) |
| 170 | extern void omap_ctrl_base_set(u32 base); | 170 | extern void __iomem *omap_ctrl_base_get(void); |
| 171 | extern u32 omap_ctrl_base_get(void); | ||
| 172 | extern u8 omap_ctrl_readb(u16 offset); | 171 | extern u8 omap_ctrl_readb(u16 offset); |
| 173 | extern u16 omap_ctrl_readw(u16 offset); | 172 | extern u16 omap_ctrl_readw(u16 offset); |
| 174 | extern u32 omap_ctrl_readl(u16 offset); | 173 | extern u32 omap_ctrl_readl(u16 offset); |
| @@ -176,7 +175,6 @@ extern void omap_ctrl_writeb(u8 val, u16 offset); | |||
| 176 | extern void omap_ctrl_writew(u16 val, u16 offset); | 175 | extern void omap_ctrl_writew(u16 val, u16 offset); |
| 177 | extern void omap_ctrl_writel(u32 val, u16 offset); | 176 | extern void omap_ctrl_writel(u32 val, u16 offset); |
| 178 | #else | 177 | #else |
| 179 | #define omap_ctrl_base_set(x) WARN_ON(1) | ||
| 180 | #define omap_ctrl_base_get() 0 | 178 | #define omap_ctrl_base_get() 0 |
| 181 | #define omap_ctrl_readb(x) 0 | 179 | #define omap_ctrl_readb(x) 0 |
| 182 | #define omap_ctrl_readw(x) 0 | 180 | #define omap_ctrl_readw(x) 0 |
diff --git a/include/asm-arm/arch-omap/io.h b/include/asm-arm/arch-omap/io.h index e1fb7ec7d478..0b13557fd30b 100644 --- a/include/asm-arm/arch-omap/io.h +++ b/include/asm-arm/arch-omap/io.h | |||
| @@ -60,6 +60,7 @@ | |||
| 60 | #define IO_SIZE 0x40000 | 60 | #define IO_SIZE 0x40000 |
| 61 | #define IO_VIRT (IO_PHYS - IO_OFFSET) | 61 | #define IO_VIRT (IO_PHYS - IO_OFFSET) |
| 62 | #define IO_ADDRESS(pa) ((pa) - IO_OFFSET) | 62 | #define IO_ADDRESS(pa) ((pa) - IO_OFFSET) |
| 63 | #define OMAP1_IO_ADDRESS(pa) ((pa) - IO_OFFSET) | ||
| 63 | #define io_p2v(pa) ((pa) - IO_OFFSET) | 64 | #define io_p2v(pa) ((pa) - IO_OFFSET) |
| 64 | #define io_v2p(va) ((va) + IO_OFFSET) | 65 | #define io_v2p(va) ((va) + IO_OFFSET) |
| 65 | 66 | ||
| @@ -91,6 +92,7 @@ | |||
| 91 | 92 | ||
| 92 | #define IO_OFFSET 0x90000000 | 93 | #define IO_OFFSET 0x90000000 |
| 93 | #define IO_ADDRESS(pa) ((pa) + IO_OFFSET) /* Works for L3 and L4 */ | 94 | #define IO_ADDRESS(pa) ((pa) + IO_OFFSET) /* Works for L3 and L4 */ |
| 95 | #define OMAP2_IO_ADDRESS(pa) ((pa) + IO_OFFSET) /* Works for L3 and L4 */ | ||
| 94 | #define io_p2v(pa) ((pa) + IO_OFFSET) /* Works for L3 and L4 */ | 96 | #define io_p2v(pa) ((pa) + IO_OFFSET) /* Works for L3 and L4 */ |
| 95 | #define io_v2p(va) ((va) - IO_OFFSET) /* Works for L3 and L4 */ | 97 | #define io_v2p(va) ((va) - IO_OFFSET) /* Works for L3 and L4 */ |
| 96 | 98 | ||
| @@ -148,6 +150,7 @@ | |||
| 148 | 150 | ||
| 149 | #define IO_OFFSET 0x90000000 | 151 | #define IO_OFFSET 0x90000000 |
| 150 | #define IO_ADDRESS(pa) ((pa) + IO_OFFSET)/* Works for L3 and L4 */ | 152 | #define IO_ADDRESS(pa) ((pa) + IO_OFFSET)/* Works for L3 and L4 */ |
| 153 | #define OMAP2_IO_ADDRESS(pa) ((pa) + IO_OFFSET)/* Works for L3 and L4 */ | ||
| 151 | #define io_p2v(pa) ((pa) + IO_OFFSET)/* Works for L3 and L4 */ | 154 | #define io_p2v(pa) ((pa) + IO_OFFSET)/* Works for L3 and L4 */ |
| 152 | #define io_v2p(va) ((va) - IO_OFFSET)/* Works for L3 and L4 */ | 155 | #define io_v2p(va) ((va) - IO_OFFSET)/* Works for L3 and L4 */ |
| 153 | 156 | ||
