diff options
author | Paul Walmsley <paul@pwsan.com> | 2008-03-18 04:02:50 -0400 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2008-04-14 13:27:25 -0400 |
commit | 69d88a00a240fbed07fb6943c862ea3188e9097d (patch) | |
tree | 7656c3266f5e0b2ce6f92f5f0bb843126989a9bb /arch/arm/mach-omap2/sdrc.h | |
parent | 9330899e0f878ff3b7a23b856de8bbb52c9c04fd (diff) |
ARM: OMAP2: Add common register access for 24xx and 34xx
This patch adds common register access for 24xx and 34xx power
and clock management in order to share code between 24xx and 34xx.
Only change USB platform init code to use new register access, other
access will be changed in later patches.
Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap2/sdrc.h')
-rw-r--r-- | arch/arm/mach-omap2/sdrc.h | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/sdrc.h b/arch/arm/mach-omap2/sdrc.h new file mode 100644 index 000000000000..d7f23bc9550a --- /dev/null +++ b/arch/arm/mach-omap2/sdrc.h | |||
@@ -0,0 +1,58 @@ | |||
1 | #ifndef __ARCH_ARM_MACH_OMAP2_SDRC_H | ||
2 | #define __ARCH_ARM_MACH_OMAP2_SDRC_H | ||
3 | |||
4 | /* | ||
5 | * OMAP2 SDRC register definitions | ||
6 | * | ||
7 | * Copyright (C) 2007 Texas Instruments, Inc. | ||
8 | * Copyright (C) 2007 Nokia Corporation | ||
9 | * | ||
10 | * Written by Paul Walmsley | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or modify | ||
13 | * it under the terms of the GNU General Public License version 2 as | ||
14 | * published by the Free Software Foundation. | ||
15 | */ | ||
16 | #undef DEBUG | ||
17 | |||
18 | #include <asm/arch/sdrc.h> | ||
19 | |||
20 | #ifndef __ASSEMBLER__ | ||
21 | extern unsigned long omap2_sdrc_base; | ||
22 | extern unsigned long omap2_sms_base; | ||
23 | |||
24 | #define OMAP_SDRC_REGADDR(reg) \ | ||
25 | (void __iomem *)IO_ADDRESS(omap2_sdrc_base + (reg)) | ||
26 | #define OMAP_SMS_REGADDR(reg) \ | ||
27 | (void __iomem *)IO_ADDRESS(omap2_sms_base + (reg)) | ||
28 | |||
29 | /* SDRC global register get/set */ | ||
30 | |||
31 | static inline void sdrc_write_reg(u32 val, u16 reg) | ||
32 | { | ||
33 | __raw_writel(val, OMAP_SDRC_REGADDR(reg)); | ||
34 | } | ||
35 | |||
36 | static inline u32 sdrc_read_reg(u16 reg) | ||
37 | { | ||
38 | return __raw_readl(OMAP_SDRC_REGADDR(reg)); | ||
39 | } | ||
40 | |||
41 | /* SMS global register get/set */ | ||
42 | |||
43 | static inline void sms_write_reg(u32 val, u16 reg) | ||
44 | { | ||
45 | __raw_writel(val, OMAP_SMS_REGADDR(reg)); | ||
46 | } | ||
47 | |||
48 | static inline u32 sms_read_reg(u16 reg) | ||
49 | { | ||
50 | return __raw_readl(OMAP_SMS_REGADDR(reg)); | ||
51 | } | ||
52 | #else | ||
53 | #define OMAP242X_SDRC_REGADDR(reg) IO_ADDRESS(OMAP2420_SDRC_BASE + (reg)) | ||
54 | #define OMAP243X_SDRC_REGADDR(reg) IO_ADDRESS(OMAP243X_SDRC_BASE + (reg)) | ||
55 | #define OMAP34XX_SDRC_REGADDR(reg) IO_ADDRESS(OMAP343X_SDRC_BASE + (reg)) | ||
56 | #endif /* __ASSEMBLER__ */ | ||
57 | |||
58 | #endif | ||