aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-at91/at91sam9g45_devices.c
diff options
context:
space:
mode:
authorJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>2012-02-15 08:24:46 -0500
committerNicolas Ferre <nicolas.ferre@atmel.com>2012-02-23 08:57:58 -0500
commitb3af8b49befdcc53cb5d89e57662c359bc0b6989 (patch)
tree7c53b06733ae3f00a4971b0a3e7f4deee83169d1 /arch/arm/mach-at91/at91sam9g45_devices.c
parent4e9267f1b42b4f7b66214161b55f1f73365692cd (diff)
ARM: at91/rtc-at91sam9: pass the GPBR to use via resources
The GPBR registers are used for storing RTC values. The GPBR registers to use are now provided using standard resource entry. The array is filled in SoC specific code. rtc-at91sam9 RTT as RTC driver is modified to retrieve this information. Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> [nicolas.ferre@atmel.com: rework resources assignment] Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com> Reviewed-by: Ryan Mallon <rmallon@gmail.com>
Diffstat (limited to 'arch/arm/mach-at91/at91sam9g45_devices.c')
-rw-r--r--arch/arm/mach-at91/at91sam9g45_devices.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/arch/arm/mach-at91/at91sam9g45_devices.c b/arch/arm/mach-at91/at91sam9g45_devices.c
index 81d1adf1d978..98e40418fda1 100644
--- a/arch/arm/mach-at91/at91sam9g45_devices.c
+++ b/arch/arm/mach-at91/at91sam9g45_devices.c
@@ -1194,6 +1194,8 @@ static struct resource rtt_resources[] = {
1194 .start = AT91SAM9G45_BASE_RTT, 1194 .start = AT91SAM9G45_BASE_RTT,
1195 .end = AT91SAM9G45_BASE_RTT + SZ_16 - 1, 1195 .end = AT91SAM9G45_BASE_RTT + SZ_16 - 1,
1196 .flags = IORESOURCE_MEM, 1196 .flags = IORESOURCE_MEM,
1197 }, {
1198 .flags = IORESOURCE_MEM,
1197 } 1199 }
1198}; 1200};
1199 1201
@@ -1201,16 +1203,27 @@ static struct platform_device at91sam9g45_rtt_device = {
1201 .name = "at91_rtt", 1203 .name = "at91_rtt",
1202 .id = 0, 1204 .id = 0,
1203 .resource = rtt_resources, 1205 .resource = rtt_resources,
1204 .num_resources = ARRAY_SIZE(rtt_resources),
1205}; 1206};
1206 1207
1207#if IS_ENABLED(CONFIG_RTC_DRV_AT91SAM9) 1208#if IS_ENABLED(CONFIG_RTC_DRV_AT91SAM9)
1208static void __init at91_add_device_rtt_rtc(void) 1209static void __init at91_add_device_rtt_rtc(void)
1209{ 1210{
1210 at91sam9g45_rtt_device.name = "rtc-at91sam9"; 1211 at91sam9g45_rtt_device.name = "rtc-at91sam9";
1212 /*
1213 * The second resource is needed:
1214 * GPBR will serve as the storage for RTC time offset
1215 */
1216 at91sam9g45_rtt_device.num_resources = 2;
1217 rtt_resources[1].start = AT91SAM9G45_BASE_GPBR +
1218 4 * CONFIG_RTC_DRV_AT91SAM9_GPBR;
1219 rtt_resources[1].end = rtt_resources[1].start + 3;
1211} 1220}
1212#else 1221#else
1213static void __init at91_add_device_rtt_rtc(void) {} 1222static void __init at91_add_device_rtt_rtc(void)
1223{
1224 /* Only one resource is needed: RTT not used as RTC */
1225 at91sam9g45_rtt_device.num_resources = 1;
1226}
1214#endif 1227#endif
1215 1228
1216static void __init at91_add_device_rtt(void) 1229static void __init at91_add_device_rtt(void)