]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blob - arch/arm/mach-omap2/sdrc.h
Merge current mainline tree into linux-omap tree
[linux-2.6-omap-h63xx.git] / arch / arm / mach-omap2 / sdrc.h
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 <linux/kernel.h>
19 #include <asm/arch/sdrc.h>
20
21 extern unsigned long omap2_sdrc_base;
22 extern unsigned long omap2_sms_base;
23
24 #define OMAP_SDRC_REGADDR(reg)  (void __iomem *)IO_ADDRESS(omap2_sdrc_base + reg)
25 #define OMAP_SMS_REGADDR(reg)   (void __iomem *)IO_ADDRESS(omap2_sms_base + reg)
26
27
28 /* SDRC global register get/set */
29
30 static void __attribute__((unused)) sdrc_write_reg(u32 val, u16 reg)
31 {
32         pr_debug("sdrc_write_reg: writing 0x%0x to 0x%0x\n", val,
33                  (u32)OMAP_SDRC_REGADDR(reg));
34
35         __raw_writel(val, OMAP_SDRC_REGADDR(reg));
36 }
37
38 static u32 __attribute__((unused)) sdrc_read_reg(u16 reg)
39 {
40         return __raw_readl(OMAP_SDRC_REGADDR(reg));
41 }
42
43 /* SMS global register get/set */
44
45 static void __attribute__((unused)) sms_write_reg(u32 val, u16 reg)
46 {
47         pr_debug("sms_write_reg: writing 0x%0x to 0x%0x\n", val,
48                  (u32)OMAP_SMS_REGADDR(reg));
49
50         __raw_writel(val, OMAP_SMS_REGADDR(reg));
51 }
52
53 static u32 __attribute__((unused)) sms_read_reg(u16 reg)
54 {
55         return __raw_readl(OMAP_SMS_REGADDR(reg));
56 }
57
58
59
60 #endif