aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/mach-ep93xx/ts72xx.c40
-rw-r--r--arch/arm/mach-ep93xx/ts72xx.h11
2 files changed, 10 insertions, 41 deletions
diff --git a/arch/arm/mach-ep93xx/ts72xx.c b/arch/arm/mach-ep93xx/ts72xx.c
index 3b39ea353d30..8a5b6f059498 100644
--- a/arch/arm/mach-ep93xx/ts72xx.c
+++ b/arch/arm/mach-ep93xx/ts72xx.c
@@ -16,7 +16,6 @@
16#include <linux/init.h> 16#include <linux/init.h>
17#include <linux/platform_device.h> 17#include <linux/platform_device.h>
18#include <linux/io.h> 18#include <linux/io.h>
19#include <linux/platform_data/rtc-m48t86.h>
20#include <linux/mtd/nand.h> 19#include <linux/mtd/nand.h>
21#include <linux/mtd/partitions.h> 20#include <linux/mtd/partitions.h>
22 21
@@ -45,16 +44,6 @@ static struct map_desc ts72xx_io_desc[] __initdata = {
45 .pfn = __phys_to_pfn(TS72XX_OPTIONS2_PHYS_BASE), 44 .pfn = __phys_to_pfn(TS72XX_OPTIONS2_PHYS_BASE),
46 .length = TS72XX_OPTIONS2_SIZE, 45 .length = TS72XX_OPTIONS2_SIZE,
47 .type = MT_DEVICE, 46 .type = MT_DEVICE,
48 }, {
49 .virtual = (unsigned long)TS72XX_RTC_INDEX_VIRT_BASE,
50 .pfn = __phys_to_pfn(TS72XX_RTC_INDEX_PHYS_BASE),
51 .length = TS72XX_RTC_INDEX_SIZE,
52 .type = MT_DEVICE,
53 }, {
54 .virtual = (unsigned long)TS72XX_RTC_DATA_VIRT_BASE,
55 .pfn = __phys_to_pfn(TS72XX_RTC_DATA_PHYS_BASE),
56 .length = TS72XX_RTC_DATA_SIZE,
57 .type = MT_DEVICE,
58 } 47 }
59}; 48};
60 49
@@ -179,31 +168,22 @@ static void __init ts72xx_register_flash(void)
179 } 168 }
180} 169}
181 170
171/*************************************************************************
172 * RTC M48T86
173 *************************************************************************/
174#define TS72XX_RTC_INDEX_PHYS_BASE (EP93XX_CS1_PHYS_BASE + 0x00800000)
175#define TS72XX_RTC_DATA_PHYS_BASE (EP93XX_CS1_PHYS_BASE + 0x01700000)
182 176
183static unsigned char ts72xx_rtc_readbyte(unsigned long addr) 177static struct resource ts72xx_rtc_resources[] = {
184{ 178 DEFINE_RES_MEM(TS72XX_RTC_INDEX_PHYS_BASE, 0x01),
185 __raw_writeb(addr, TS72XX_RTC_INDEX_VIRT_BASE); 179 DEFINE_RES_MEM(TS72XX_RTC_DATA_PHYS_BASE, 0x01),
186 return __raw_readb(TS72XX_RTC_DATA_VIRT_BASE);
187}
188
189static void ts72xx_rtc_writebyte(unsigned char value, unsigned long addr)
190{
191 __raw_writeb(addr, TS72XX_RTC_INDEX_VIRT_BASE);
192 __raw_writeb(value, TS72XX_RTC_DATA_VIRT_BASE);
193}
194
195static struct m48t86_ops ts72xx_rtc_ops = {
196 .readbyte = ts72xx_rtc_readbyte,
197 .writebyte = ts72xx_rtc_writebyte,
198}; 180};
199 181
200static struct platform_device ts72xx_rtc_device = { 182static struct platform_device ts72xx_rtc_device = {
201 .name = "rtc-m48t86", 183 .name = "rtc-m48t86",
202 .id = -1, 184 .id = -1,
203 .dev = { 185 .resource = ts72xx_rtc_resources,
204 .platform_data = &ts72xx_rtc_ops, 186 .num_resources = ARRAY_SIZE(ts72xx_rtc_resources),
205 },
206 .num_resources = 0,
207}; 187};
208 188
209static struct resource ts72xx_wdt_resources[] = { 189static struct resource ts72xx_wdt_resources[] = {
diff --git a/arch/arm/mach-ep93xx/ts72xx.h b/arch/arm/mach-ep93xx/ts72xx.h
index 071feaa30adc..2255ba29fdd6 100644
--- a/arch/arm/mach-ep93xx/ts72xx.h
+++ b/arch/arm/mach-ep93xx/ts72xx.h
@@ -9,8 +9,6 @@
9 * febff000 22000000 4K model number register (bits 0-2) 9 * febff000 22000000 4K model number register (bits 0-2)
10 * febfe000 22400000 4K options register 10 * febfe000 22400000 4K options register
11 * febfd000 22800000 4K options register #2 11 * febfd000 22800000 4K options register #2
12 * febf9000 10800000 4K TS-5620 RTC index register
13 * febf8000 11700000 4K TS-5620 RTC data register
14 */ 12 */
15 13
16#define TS72XX_MODEL_PHYS_BASE 0x22000000 14#define TS72XX_MODEL_PHYS_BASE 0x22000000
@@ -40,15 +38,6 @@
40#define TS72XX_OPTIONS2_TS9420 0x04 38#define TS72XX_OPTIONS2_TS9420 0x04
41#define TS72XX_OPTIONS2_TS9420_BOOT 0x02 39#define TS72XX_OPTIONS2_TS9420_BOOT 0x02
42 40
43
44#define TS72XX_RTC_INDEX_VIRT_BASE IOMEM(0xfebf9000)
45#define TS72XX_RTC_INDEX_PHYS_BASE 0x10800000
46#define TS72XX_RTC_INDEX_SIZE 0x00001000
47
48#define TS72XX_RTC_DATA_VIRT_BASE IOMEM(0xfebf8000)
49#define TS72XX_RTC_DATA_PHYS_BASE 0x11700000
50#define TS72XX_RTC_DATA_SIZE 0x00001000
51
52#define TS72XX_WDT_CONTROL_PHYS_BASE 0x23800000 41#define TS72XX_WDT_CONTROL_PHYS_BASE 0x23800000
53#define TS72XX_WDT_FEED_PHYS_BASE 0x23c00000 42#define TS72XX_WDT_FEED_PHYS_BASE 0x23c00000
54 43