|
16 | 16 | #include <linux/init.h> |
17 | 17 | #include <linux/platform_device.h> |
18 | 18 | #include <linux/io.h> |
19 | | -#include <linux/platform_data/rtc-m48t86.h> |
20 | 19 | #include <linux/mtd/nand.h> |
21 | 20 | #include <linux/mtd/partitions.h> |
22 | 21 |
|
@@ -45,16 +44,6 @@ static struct map_desc ts72xx_io_desc[] __initdata = { |
45 | 44 | .pfn = __phys_to_pfn(TS72XX_OPTIONS2_PHYS_BASE), |
46 | 45 | .length = TS72XX_OPTIONS2_SIZE, |
47 | 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 |
|
183 | | -static unsigned char ts72xx_rtc_readbyte(unsigned long addr) |
184 | | -{ |
185 | | - __raw_writeb(addr, TS72XX_RTC_INDEX_VIRT_BASE); |
186 | | - return __raw_readb(TS72XX_RTC_DATA_VIRT_BASE); |
187 | | -} |
188 | | - |
189 | | -static 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 | | - |
195 | | -static struct m48t86_ops ts72xx_rtc_ops = { |
196 | | - .readbyte = ts72xx_rtc_readbyte, |
197 | | - .writebyte = ts72xx_rtc_writebyte, |
| 177 | +static struct resource ts72xx_rtc_resources[] = { |
| 178 | + DEFINE_RES_MEM(TS72XX_RTC_INDEX_PHYS_BASE, 0x01), |
| 179 | + DEFINE_RES_MEM(TS72XX_RTC_DATA_PHYS_BASE, 0x01), |
198 | 180 | }; |
199 | 181 |
|
200 | 182 | static struct platform_device ts72xx_rtc_device = { |
201 | 183 | .name = "rtc-m48t86", |
202 | 184 | .id = -1, |
203 | | - .dev = { |
204 | | - .platform_data = &ts72xx_rtc_ops, |
205 | | - }, |
206 | | - .num_resources = 0, |
| 185 | + .resource = ts72xx_rtc_resources, |
| 186 | + .num_resources = ARRAY_SIZE(ts72xx_rtc_resources), |
207 | 187 | }; |
208 | 188 |
|
209 | 189 | static struct resource ts72xx_wdt_resources[] = { |
|
0 commit comments