|
@@ -609,3 +609,56 @@ static void __init at91_add_device_tc(void) { }
|
|
* -------------------------------------------------------------------- */
|
|
* -------------------------------------------------------------------- */
|
|
|
|
|
|
static struct resource rtt_resources[] = {
|
|
static struct resource rtt_resources[] = {
|
|
|
|
+ {
|
|
|
|
+ .start = AT91SAM9261_BASE_RTT,
|
|
|
|
+ .end = AT91SAM9261_BASE_RTT + SZ_16 - 1,
|
|
|
|
+ .flags = IORESOURCE_MEM,
|
|
|
|
+ }, {
|
|
|
|
+ .flags = IORESOURCE_MEM,
|
|
|
|
+ }, {
|
|
|
|
+ .flags = IORESOURCE_IRQ,
|
|
|
|
+ }
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+static struct platform_device at91sam9261_rtt_device = {
|
|
|
|
+ .name = "at91_rtt",
|
|
|
|
+ .id = 0,
|
|
|
|
+ .resource = rtt_resources,
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+#if IS_ENABLED(CONFIG_RTC_DRV_AT91SAM9)
|
|
|
|
+static void __init at91_add_device_rtt_rtc(void)
|
|
|
|
+{
|
|
|
|
+ at91sam9261_rtt_device.name = "rtc-at91sam9";
|
|
|
|
+ /*
|
|
|
|
+ * The second resource is needed:
|
|
|
|
+ * GPBR will serve as the storage for RTC time offset
|
|
|
|
+ */
|
|
|
|
+ at91sam9261_rtt_device.num_resources = 3;
|
|
|
|
+ rtt_resources[1].start = AT91SAM9261_BASE_GPBR +
|
|
|
|
+ 4 * CONFIG_RTC_DRV_AT91SAM9_GPBR;
|
|
|
|
+ rtt_resources[1].end = rtt_resources[1].start + 3;
|
|
|
|
+ rtt_resources[2].start = NR_IRQS_LEGACY + AT91_ID_SYS;
|
|
|
|
+ rtt_resources[2].end = NR_IRQS_LEGACY + AT91_ID_SYS;
|
|
|
|
+}
|
|
|
|
+#else
|
|
|
|
+static void __init at91_add_device_rtt_rtc(void)
|
|
|
|
+{
|
|
|
|
+ /* Only one resource is needed: RTT not used as RTC */
|
|
|
|
+ at91sam9261_rtt_device.num_resources = 1;
|
|
|
|
+}
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
+static void __init at91_add_device_rtt(void)
|
|
|
|
+{
|
|
|
|
+ at91_add_device_rtt_rtc();
|
|
|
|
+ platform_device_register(&at91sam9261_rtt_device);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+/* --------------------------------------------------------------------
|
|
|
|
+ * Watchdog
|
|
|
|
+ * -------------------------------------------------------------------- */
|
|
|
|
+
|
|
|
|
+#if defined(CONFIG_AT91SAM9X_WATCHDOG) || defined(CONFIG_AT91SAM9X_WATCHDOG_MODULE)
|
|
|
|
+static struct resource wdt_resources[] = {
|