@@ -449,11 +449,19 @@ static struct amba_device uart3_device = {
.periphid = 0x00041010,
};
+static struct resource ep93xx_rtc_resource[] = {
+ {
+ .start = EP93XX_RTC_PHYS_BASE,
+ .end = EP93XX_RTC_PHYS_BASE + 0x10c - 1,
+ .flags = IORESOURCE_MEM,
+ },
+};
static struct platform_device ep93xx_rtc_device = {
- .name = "ep93xx-rtc",
- .id = -1,
- .num_resources = 0,
+ .name = "ep93xx-rtc",
+ .id = -1,
+ .num_resources = ARRAY_SIZE(ep93xx_rtc_resource),
+ .resource = ep93xx_rtc_resource,
};
b/arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h
@@ -146,6 +146,7 @@
#define EP93XX_PWM_BASE (EP93XX_APB_VIRT_BASE +
0x00110000)
#define EP93XX_RTC_BASE (EP93XX_APB_VIRT_BASE +
0x00120000)
+#define EP93XX_RTC_PHYS_BASE (EP93XX_APB_PHYS_BASE +
0x00120000)
#define EP93XX_SYSCON_BASE (EP93XX_APB_VIRT_BASE +
0x00130000)
#define EP93XX_SYSCON_REG(x) (EP93XX_SYSCON_BASE + (x))
@@ -12,19 +12,22 @@
#include <linux/module.h>
#include <linux/rtc.h>
#include <linux/platform_device.h>
-#include <mach/hardware.h>
+#include <linux/io.h>
-#define EP93XX_RTC_REG(x) (EP93XX_RTC_BASE + (x))
-#define EP93XX_RTC_DATA EP93XX_RTC_REG(0x0000)
-#define EP93XX_RTC_LOAD EP93XX_RTC_REG(0x000C)
-#define EP93XX_RTC_SWCOMP EP93XX_RTC_REG(0x0108)
+#define EP93XX_RTC_DATA 0x000
+#define EP93XX_RTC_MATCH 0x004
+#define EP93XX_RTC_STATUS 0x008
+#define EP93XX_RTC_LOAD 0x00C
+#define EP93XX_RTC_CONTROL 0x010
+#define EP93XX_RTC_SWCOMP 0x108
#define DRV_VERSION "0.2"
static int ep93xx_get_swcomp(struct device *dev, unsigned short
*preload,
unsigned short *delete)
{
- unsigned short comp = __raw_readl(EP93XX_RTC_SWCOMP);
+ void __iomem *mmio_base = dev->platform_data;
+ unsigned long comp = __raw_readl(mmio_base + EP93XX_RTC_SWCOMP);
if (preload)