Skip to contentSkip to conversation

AT91: Convert RTC and RTT drivers to be independent of processor base-address

PATCH Andrew Victor 3 participants 3 messages Apr 29, 2011 – May 4, 2011

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

For supporting multiple AT91 processors in a single kernel image, the following changes to the RTC and RTT driver support:
* pass base addresses via platform resources
* replace calls to at91_sys_read() / at91_sys_write()
* rename AT91_RTT/AT91_RTC to AT91xxx_RTT/AT91xxx_RTC to denote they
are processor-specific.

arch/arm/mach-at91/at572d940hf_devices.c +2 -2
index 0fc20a2..a3534e3 100644
@@ -604,8 +604,8 @@ static void __init at91_add_device_tc(void) { }
 
 static struct resource rtt_resources[] = {
 	{
-		.start	= AT91_BASE_SYS + AT91_RTT,
-		.end	= AT91_BASE_SYS + AT91_RTT + SZ_16 - 1,
+		.start	= AT91_VA_BASE_SYS + AT572D940HF_RTT,
+		.end	= AT91_VA_BASE_SYS + AT572D940HF_RTT + SZ_16 - 1,
 		.flags	= IORESOURCE_MEM,
 	}
 };
arch/arm/mach-at91/at91cap9_devices.c +2 -2
index 9ffbf3a..f20a31d 100644
@@ -674,8 +674,8 @@ static void __init at91_add_device_tc(void) { }
 
 static struct resource rtt_resources[] = {
 	{
-		.start	= AT91_BASE_SYS + AT91_RTT,
-		.end	= AT91_BASE_SYS + AT91_RTT + SZ_16 - 1,
+		.start	= AT91_VA_BASE_SYS + AT91CAP9_RTT,
+		.end	= AT91_VA_BASE_SYS + AT91CAP9_RTT + SZ_16 - 1,
 		.flags	= IORESOURCE_MEM,
 	}
 };
arch/arm/mach-at91/at91rm9200_devices.c +10 -1
index 7b53922..af4e30a 100644
@@ -665,10 +665,19 @@ static void __init at91_add_device_tc(void) { }
  * -------------------------------------------------------------------- */
 
 #if defined(CONFIG_RTC_DRV_AT91RM9200) || defined(CONFIG_RTC_DRV_AT91RM9200_MODULE)
+static struct resource rtc_resources[] = {
+	[0] = {
+		.start	= AT91_VA_BASE_SYS + AT91RM9200_RTC,
+		.end	= AT91_VA_BASE_SYS + AT91RM9200_RTC + SZ_256 - 1,
+		.flags	= IORESOURCE_MEM,
+	}
+};
+
 static struct platform_device at91rm9200_rtc_device = {
 	.name		= "at91_rtc",
 	.id		= -1,
-	.num_resources	= 0,
+	.resource	= rtc_resources,
+	.num_resources	= ARRAY_SIZE(rtc_resources),
 };
 
 static void __init at91_add_device_rtc(void)
arch/arm/mach-at91/at91sam9260_devices.c +2 -2
index 07eb7b0..fa783c7 100644
@@ -716,8 +716,8 @@ static void __init at91_add_device_tc(void) { }
 
 static struct resource rtt_resources[] = {
 	{
-		.start	= AT91_BASE_SYS + AT91_RTT,
-		.end	= AT91_BASE_SYS + AT91_RTT + SZ_16 - 1,
+		.start	= AT91_VA_BASE_SYS + AT91SAM9260_RTT,
+		.end	= AT91_VA_BASE_SYS + AT91SAM9260_RTT + SZ_16 - 1,
 		.flags	= IORESOURCE_MEM,
 	}
 };
arch/arm/mach-at91/at91sam9261_devices.c +2 -2
index 59fc483..f8a6bc9 100644
@@ -598,8 +598,8 @@ static void __init at91_add_device_tc(void) { }
 
 static struct resource rtt_resources[] = {
 	{
-		.start	= AT91_BASE_SYS + AT91_RTT,
-		.end	= AT91_BASE_SYS + AT91_RTT + SZ_16 - 1,
+		.start	= AT91_VA_BASE_SYS + AT91SAM9261_RTT,
+		.end	= AT91_VA_BASE_SYS + AT91SAM9261_RTT + SZ_16 - 1,
 		.flags	= IORESOURCE_MEM,
 	}
 };
arch/arm/mach-at91/at91sam9263_devices.c +4 -4
index fb5c23a..5a8fb39 100644
@@ -956,8 +956,8 @@ static void __init at91_add_device_tc(void) { }
 
 static struct resource rtt0_resources[] = {
 	{
-		.start	= AT91_BASE_SYS + AT91_RTT0,
-		.end	= AT91_BASE_SYS + AT91_RTT0 + SZ_16 - 1,
+		.start	= AT91_VA_BASE_SYS + AT91SAM9263_RTT0,
+		.end	= AT91_VA_BASE_SYS + AT91SAM9263_RTT0 + SZ_16 - 1,
 		.flags	= IORESOURCE_MEM,
 	}
 };
@@ -971,8 +971,8 @@ static struct platform_device at91sam9263_rtt0_device = {
 
 static struct resource rtt1_resources[] = {
 	{
-		.start	= AT91_BASE_SYS + AT91_RTT1,
-		.end	= AT91_BASE_SYS + AT91_RTT1 + SZ_16 - 1,
+		.start	= AT91_VA_BASE_SYS + AT91SAM9263_RTT1,
+		.end	= AT91_VA_BASE_SYS + AT91SAM9263_RTT1 + SZ_16 - 1,
 		.flags	= IORESOURCE_MEM,
 	}
 };
arch/arm/mach-at91/at91sam9g45_devices.c +12 -3
index 1e8f275..464d7ff 100644
@@ -1015,10 +1015,19 @@ static void __init at91_add_device_tc(void) { }
  * -------------------------------------------------------------------- */
 
 #if defined(CONFIG_RTC_DRV_AT91RM9200) || defined(CONFIG_RTC_DRV_AT91RM9200_MODULE)
+static struct resource rtc_resources[] = {
+	[0] = {
+		.start	= AT91_VA_BASE_SYS + AT91SAM9G45_RTC,
+		.end	= AT91_VA_BASE_SYS + AT91SAM9G45_RTC + SZ_256 - 1,
+		.flags	= IORESOURCE_MEM,
+	}
+};
+
 static struct platform_device at91sam9g45_rtc_device = {
 	.name		= "at91_rtc",
 	.id		= -1,
-	.num_resources	= 0,
+	.resource	= rtc_resources,
+	.num_resources	= ARRAY_SIZE(rtc_resources),
 };
 
 static void __init at91_add_device_rtc(void)
@@ -1087,8 +1096,8 @@ void __init at91_add_device_tsadcc(struct at91_tsadcc_data *data) {}
 
 static struct resource rtt_resources[] = {
 	{
-		.start	= AT91_BASE_SYS + AT91_RTT,
-		.end	= AT91_BASE_SYS + AT91_RTT + SZ_16 - 1,
+		.start	= AT91_VA_BASE_SYS + AT91SAM9G45_RTT,
+		.end	= AT91_VA_BASE_SYS + AT91SAM9G45_RTT + SZ_16 - 1,
 		.flags	= IORESOURCE_MEM,
 	}
 };
arch/arm/mach-at91/at91sam9rl_devices.c +12 -3
index 53aaa94..72effd4 100644
@@ -672,10 +672,19 @@ void __init at91_add_device_tsadcc(struct at91_tsadcc_data *data) {}
  * -------------------------------------------------------------------- */
 
 #if defined(CONFIG_RTC_DRV_AT91RM9200) || defined(CONFIG_RTC_DRV_AT91RM9200_MODULE)
+static struct resource rtc_resources[] = {
+	[0] = {
+		.start	= AT91_VA_BASE_SYS + AT91SAM9RL_RTC,
+		.end	= AT91_VA_BASE_SYS + AT91SAM9RL_RTC + SZ_256 - 1,
+		.flags	= IORESOURCE_MEM,
+	}
+};
+
 static struct platform_device at91sam9rl_rtc_device = {
 	.name		= "at91_rtc",
 	.id		= -1,
-	.num_resources	= 0,
+	.resource	= rtc_resources,
+	.num_resources	= ARRAY_SIZE(rtc_resources),
 };
 
 static void __init at91_add_device_rtc(void)
@@ -693,8 +702,8 @@ static void __init at91_add_device_rtc(void) {}
 
 static struct resource rtt_resources[] = {
 	{
-		.start	= AT91_BASE_SYS + AT91_RTT,
-		.end	= AT91_BASE_SYS + AT91_RTT + SZ_16 - 1,
+		.start	= AT91_VA_BASE_SYS + AT91SAM9RL_RTT,
+		.end	= AT91_VA_BASE_SYS + AT91SAM9RL_RTT + SZ_16 - 1,
 		.flags	= IORESOURCE_MEM,
 	}
 };
arch/arm/mach-at91/include/mach/at572d940hf.h +1 -1
index cfac3d2..b714a84 100644
@@ -99,7 +99,7 @@
 #define AT572D940HF_PIOC	(0xfffff800 - AT91_BASE_SYS)
 #define AT91_PMC	(0xfffffc00 - AT91_BASE_SYS)
 #define AT91_RSTC	(0xfffffd00 - AT91_BASE_SYS)
-#define AT91_RTT	(0xfffffd20 - AT91_BASE_SYS)
+#define AT572D940HF_RTT		(0xfffffd20 - AT91_BASE_SYS)
 #define AT91_PIT	(0xfffffd30 - AT91_BASE_SYS)
 #define AT91_WDT	(0xfffffd40 - AT91_BASE_SYS)
 
arch/arm/mach-at91/include/mach/at91_rtc.h +12 -12
index e56f470..2aa234f 100644
@@ -16,7 +16,7 @@
 #ifndef AT91_RTC_H
 #define AT91_RTC_H
 
-#define	AT91_RTC_CR		(AT91_RTC + 0x00)	/* Control Register */
+#define	AT91_RTC_CR		0x00	/* Control Register */
 #define		AT91_RTC_UPDTIM		(1 <<  0)		/* Update Request Time Register */
 #define		AT91_RTC_UPDCAL		(1 <<  1)		/* Update Request Calendar Register */
 #define		AT91_RTC_TIMEVSEL	(3 <<  8)		/* Time Event Selection */
@@ -29,44 +29,44 @@
 #define			AT91_RTC_CALEVSEL_MONTH		(1 << 16)
 #define			AT91_RTC_CALEVSEL_YEAR		(2 << 16)
 
-#define	AT91_RTC_MR		(AT91_RTC + 0x04)	/* Mode Register */
+#define	AT91_RTC_MR		0x04	/* Mode Register */
 #define			AT91_RTC_HRMOD		(1 <<  0)		/* 12/24 Hour Mode */
 
-#define	AT91_RTC_TIMR		(AT91_RTC + 0x08)	/* Time Register */
+#define	AT91_RTC_TIMR		0x08	/* Time Register */
 #define		AT91_RTC_SEC		(0x7f <<  0)		/* Current Second */
 #define		AT91_RTC_MIN		(0x7f <<  8)		/* Current Minute */
 #define		AT91_RTC_HOUR		(0x3f << 16)		/* Current Hour */
 #define		AT91_RTC_AMPM		(1    << 22)		/* Ante Meridiem Post Meridiem Indicator */
 
-#define	AT91_RTC_CALR		(AT91_RTC + 0x0c)	/* Calendar Register */
+#define	AT91_RTC_CALR		0x0c	/* Calendar Register */
 #define		AT91_RTC_CENT		(0x7f <<  0)		/* Current Century */
 #define		AT91_RTC_YEAR		(0xff <<  8)		/* Current Year */
 #define		AT91_RTC_MONTH		(0x1f << 16)		/* Current Month */
 #define		AT91_RTC_DAY		(7    << 21)		/* Current Day */
 #define		AT91_RTC_DATE		(0x3f << 24)		/* Current Date */
 
-#define	AT91_RTC_TIMALR		(AT91_RTC + 0x10)	/* Time Alarm Register */
+#define	AT91_RTC_TIMALR		0x10	/* Time Alarm Register */
 #define		AT91_RTC_SECEN		(1 <<  7)		/* Second Alarm Enable */
 #define		AT91_RTC_MINEN		(1 << 15)		/* Minute Alarm Enable */
 #define		AT91_RTC_HOUREN		(1 << 23)		/* Hour Alarm Enable */
 
-#define	AT91_RTC_CALALR		(AT91_RTC + 0x14)	/* Calendar Alarm Register */
+#define	AT91_RTC_CALALR		0x14	/* Calendar Alarm Register */
 #define		AT91_RTC_MTHEN		(1 << 23)		/* Month Alarm Enable */
 #define		AT91_RTC_DATEEN		(1 << 31)		/* Date Alarm Enable */
 
-#define	AT91_RTC_SR		(AT91_RTC + 0x18)	/* Status Register */
+#define	AT91_RTC_SR		0x18	/* Status Register */
 #define		AT91_RTC_ACKUPD		(1 <<  0)		/* Acknowledge for Update */
 #define		AT91_RTC_ALARM		(1 <<  1)		/* Alarm Flag */
 #define		AT91_RTC_SECEV		(1 <<  2)		/* Second Event */
 #define		AT91_RTC_TIMEV		(1 <<  3)		/* Time Event */
 #define		AT91_RTC_CALEV		(1 <<  4)		/* Calendar Event */
 
-#define	AT91_RTC_SCCR		(AT91_RTC + 0x1c)	/* Status Clear Command Register */
-#define	AT91_RTC_IER		(AT91_RTC + 0x20)	/* Interrupt Enable Register */
-#define	AT91_RTC_IDR		(AT91_RTC + 0x24)	/* Interrupt Disable Register */
-#define	AT91_RTC_IMR		(AT91_RTC + 0x28)	/* Interrupt Mask Register */
+#define	AT91_RTC_SCCR		0x1c	/* Status Clear Command Register */
+#define	AT91_RTC_IER		0x20	/* Interrupt Enable Register */
+#define	AT91_RTC_IDR		0x24	/* Interrupt Disable Register */
+#define	AT91_RTC_IMR		0x28	/* Interrupt Mask Register */
 
-#define	AT91_RTC_VER		(AT91_RTC + 0x2c)	/* Valid Entry Register */
+#define	AT91_RTC_VER		0x2c	/* Valid Entry Register */
 #define		AT91_RTC_NVTIM		(1 <<  0)		/* Non valid Time */
 #define		AT91_RTC_NVCAL		(1 <<  1)		/* Non valid Calendar */
 #define		AT91_RTC_NVTIMALR	(1 <<  2)		/* Non valid Time Alarm */
arch/arm/mach-at91/include/mach/at91cap9.h +1 -1
index dac41ec..a1776a0 100644
@@ -98,7 +98,7 @@
 #define AT91_PMC	(0xfffffc00 - AT91_BASE_SYS)
 #define AT91_RSTC	(0xfffffd00 - AT91_BASE_SYS)
 #define AT91_SHDWC	(0xfffffd10 - AT91_BASE_SYS)
-#define AT91_RTT	(0xfffffd20 - AT91_BASE_SYS)
+#define AT91CAP9_RTT	(0xfffffd20 - AT91_BASE_SYS)
 #define AT91_PIT	(0xfffffd30 - AT91_BASE_SYS)
 #define AT91_WDT	(0xfffffd40 - AT91_BASE_SYS)
 #define AT91_GPBR	(cpu_is_at91cap9_revB() ?	\
arch/arm/mach-at91/include/mach/at91rm9200.h +1 -1
index 14fc587..f81a976 100644
@@ -90,7 +90,7 @@
 #define AT91RM9200_PIOD	(0xfffffa00 - AT91_BASE_SYS)	/* PIO Controller D */
 #define AT91_PMC	(0xfffffc00 - AT91_BASE_SYS)	/* Power Management Controller */
 #define AT91_ST		(0xfffffd00 - AT91_BASE_SYS)	/* System Timer */
-#define AT91_RTC	(0xfffffe00 - AT91_BASE_SYS)	/* Real-Time Clock */
+#define AT91RM9200_RTC	(0xfffffe00 - AT91_BASE_SYS)	/* Real-Time Clock */
 #define AT91_MC		(0xffffff00 - AT91_BASE_SYS)	/* Memory Controllers */
 
 #define AT91_USART0	AT91RM9200_BASE_US0
arch/arm/mach-at91/include/mach/at91sam9260.h +1 -1
index c229963..53e715a 100644
@@ -96,7 +96,7 @@
 #define AT91_PMC	(0xfffffc00 - AT91_BASE_SYS)
 #define AT91_RSTC	(0xfffffd00 - AT91_BASE_SYS)
 #define AT91_SHDWC	(0xfffffd10 - AT91_BASE_SYS)
-#define AT91_RTT	(0xfffffd20 - AT91_BASE_SYS)
+#define AT91SAM9260_RTT		(0xfffffd20 - AT91_BASE_SYS)
 #define AT91_PIT	(0xfffffd30 - AT91_BASE_SYS)
 #define AT91_WDT	(0xfffffd40 - AT91_BASE_SYS)
 #define AT91_GPBR	(0xfffffd50 - AT91_BASE_SYS)
arch/arm/mach-at91/include/mach/at91sam9261.h +1 -1
index 47864c2..5e633ae 100644
@@ -79,7 +79,7 @@
 #define AT91_PMC	(0xfffffc00 - AT91_BASE_SYS)
 #define AT91_RSTC	(0xfffffd00 - AT91_BASE_SYS)
 #define AT91_SHDWC	(0xfffffd10 - AT91_BASE_SYS)
-#define AT91_RTT	(0xfffffd20 - AT91_BASE_SYS)
+#define AT91SAM9261_RTT		(0xfffffd20 - AT91_BASE_SYS)
 #define AT91_PIT	(0xfffffd30 - AT91_BASE_SYS)
 #define AT91_WDT	(0xfffffd40 - AT91_BASE_SYS)
 #define AT91_GPBR	(0xfffffd50 - AT91_BASE_SYS)
arch/arm/mach-at91/include/mach/at91sam9263.h +2 -2
index e5ef41e..c12514f 100644
@@ -95,10 +95,10 @@
 #define AT91_PMC	(0xfffffc00 - AT91_BASE_SYS)
 #define AT91_RSTC	(0xfffffd00 - AT91_BASE_SYS)
 #define AT91_SHDWC	(0xfffffd10 - AT91_BASE_SYS)
-#define AT91_RTT0	(0xfffffd20 - AT91_BASE_SYS)
+#define AT91SAM9263_RTT0	(0xfffffd20 - AT91_BASE_SYS)
 #define AT91_PIT	(0xfffffd30 - AT91_BASE_SYS)
 #define AT91_WDT	(0xfffffd40 - AT91_BASE_SYS)
-#define AT91_RTT1	(0xfffffd50 - AT91_BASE_SYS)
+#define AT91SAM9263_RTT1	(0xfffffd50 - AT91_BASE_SYS)
 #define AT91_GPBR	(0xfffffd60 - AT91_BASE_SYS)
 
 #define AT91_USART0	AT91SAM9263_BASE_US0
arch/arm/mach-at91/include/mach/at91sam9g45.h +2 -2
index a1e025e..6c42060 100644
@@ -105,11 +105,11 @@
 #define AT91_PMC	(0xfffffc00 - AT91_BASE_SYS)
 #define AT91_RSTC	(0xfffffd00 - AT91_BASE_SYS)
 #define AT91_SHDWC	(0xfffffd10 - AT91_BASE_SYS)
-#define AT91_RTT	(0xfffffd20 - AT91_BASE_SYS)
+#define AT91SAM9G45_RTT		(0xfffffd20 - AT91_BASE_SYS)
 #define AT91_PIT	(0xfffffd30 - AT91_BASE_SYS)
 #define AT91_WDT	(0xfffffd40 - AT91_BASE_SYS)
 #define AT91_GPBR	(0xfffffd60 - AT91_BASE_SYS)
-#define AT91_RTC	(0xfffffdb0 - AT91_BASE_SYS)
+#define AT91SAM9G45_RTC		(0xfffffdb0 - AT91_BASE_SYS)
 
 #define AT91_USART0	AT91SAM9G45_BASE_US0
 #define AT91_USART1	AT91SAM9G45_BASE_US1
arch/arm/mach-at91/include/mach/at91sam9rl.h +2 -2
index 94a3e81..003e0b5 100644
@@ -87,12 +87,12 @@
 #define AT91_PMC	(0xfffffc00 - AT91_BASE_SYS)
 #define AT91_RSTC	(0xfffffd00 - AT91_BASE_SYS)
 #define AT91_SHDWC	(0xfffffd10 - AT91_BASE_SYS)
-#define AT91_RTT	(0xfffffd20 - AT91_BASE_SYS)
+#define AT91SAM9RL_RTT	(0xfffffd20 - AT91_BASE_SYS)
 #define AT91_PIT	(0xfffffd30 - AT91_BASE_SYS)
 #define AT91_WDT	(0xfffffd40 - AT91_BASE_SYS)
 #define AT91_SCKCR	(0xfffffd50 - AT91_BASE_SYS)
 #define AT91_GPBR	(0xfffffd60 - AT91_BASE_SYS)
-#define AT91_RTC	(0xfffffe00 - AT91_BASE_SYS)
+#define AT91SAM9RL_RTC	(0xfffffe00 - AT91_BASE_SYS)
 
 #define AT91_USART0	AT91SAM9RL_BASE_US0
 #define AT91_USART1	AT91SAM9RL_BASE_US1
drivers/rtc/rtc-at91rm9200.c +92 -54

338 lines not on this page · raw message

drivers/rtc/rtc-at91sam9.c +1 -2
index a3ad957..6aaa7f6 100644
@@ -307,8 +307,7 @@ static int __init at91_rtc_probe(struct platform_device *pdev)
 		device_init_wakeup(&pdev->dev, 1);
 
 	platform_set_drvdata(pdev, rtc);
-	rtc->rtt = (void __force __iomem *) (AT91_VA_BASE_SYS - AT91_BASE_SYS);
-	rtc->rtt += r->start;
+	rtc->rtt = (void __force __iomem *) r->start;
 
 	mr = rtt_readl(rtc, MR);
 
#1 lore raw
Quoted 8 lines · Andrew Victor

For supporting multiple AT91 processors in a single kernel image, the following changes to the RTC and RTT driver support:
* pass base addresses via platform resources
* replace calls to at91_sys_read() / at91_sys_write()
* rename AT91_RTT/AT91_RTC to AT91xxx_RTT/AT91xxx_RTC to denote they
are processor-specific.

I work on similar patch

but here we have an issue we need to pas the GPBR resource also

Best Regards,
J.

#2 lore raw
In reply to Andrew Victor
Quoted 8 lines · Andrew Victor

For supporting multiple AT91 processors in a single kernel image, the following changes to the RTC and RTT driver support:
* pass base addresses via platform resources
* replace calls to at91_sys_read() / at91_sys_write()
* rename AT91_RTT/AT91_RTC to AT91xxx_RTT/AT91xxx_RTC to denote they
are processor-specific.

Looks mostly good. Couple of minor comments below.

~Ryan

Quoted 19 lines
drivers/rtc/rtc-at91rm9200.c +4 -0
index e39b77a..971271c 100644
@@ -27,6 +27,7 @@
 #include <linux/interrupt.h>
 #include <linux/ioctl.h>
 #include <linux/completion.h>
+#include <linux/slab.h>
 
 #include <asm/uaccess.h>
 
@@ -35,23 +36,33 @@
 
 #define AT91_RTC_EPOCH		1900UL	/* just like arch/arm/common/rtctime.c */
 
+struct at91_rtc {
+	struct rtc_device	*rtcdev;
+	void __iomem		*regbase;

drivers/rtc/rtc-at91rm9200.c line 50

Quoted 10 lines
drivers/rtc/rtc-at91rm9200.c +8 -1
+	unsigned int		alarm_year;
+};
+
 static DECLARE_COMPLETION(at91_rtc_updated);
-static unsigned int at91_alarm_year = AT91_RTC_EPOCH;
+
+#define rtc_readl(rtc, reg) \
+	__raw_readl((rtc)->regbase + (reg))
+#define rtc_writel(rtc, reg, value) \
+	__raw_writel((value), (rtc)->regbase + (reg))

static inline unsigned rtc_readl(struct at91_rtc, unsigned reg)

{
	return __raw_readl(rtc->regbase + reg);
}

static inline void rtc_writel(struct at91_rtc, unsigned reg,
unsigned value)

{
	__raw_writel(valie, rtc->regbase + reg);
}

drivers/rtc/rtc-at91rm9200.c line 55

Quoted 7 lines
drivers/rtc/rtc-at91rm9200.c +1 -2
 /*
  * Decode time/date into rtc_time structure
  */
-static void at91_rtc_decodetime(unsigned int timereg, unsigned int calreg,
-				struct rtc_time *tm)
+static void at91_rtc_decodetime(struct at91_rtc* rtc,

Nitpick, should be:

struct at91_rtc *rtc,

Signature · 7 lines
Bluewater Systems Ltd - ARM Technology Solution Centre

Ryan Mallon         		5 Amuri Park, 404 Barbadoes St
ryan at bluewatersys.com         	PO Box 13 889, Christchurch 8013
http://www.bluewatersys.com	New Zealand
Phone: +64 3 3779127		Freecall: Australia 1800 148 751
Fax:   +64 3 3779135			  USA 1800 261 2934