|
@@ -486,3 +486,126 @@ static struct resource lcdc_resources[] = {
|
|
|
},
|
|
|
#endif
|
|
|
};
|
|
|
+
|
|
|
+static struct platform_device at91_lcdc_device = {
|
|
|
+ .name = "atmel_lcdfb",
|
|
|
+ .id = 0,
|
|
|
+ .dev = {
|
|
|
+ .dma_mask = &lcdc_dmamask,
|
|
|
+ .coherent_dma_mask = DMA_BIT_MASK(32),
|
|
|
+ .platform_data = &lcdc_data,
|
|
|
+ },
|
|
|
+ .resource = lcdc_resources,
|
|
|
+ .num_resources = ARRAY_SIZE(lcdc_resources),
|
|
|
+};
|
|
|
+
|
|
|
+void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data)
|
|
|
+{
|
|
|
+ if (!data) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+#if defined(CONFIG_FB_ATMEL_STN)
|
|
|
+ at91_set_A_periph(AT91_PIN_PB0, 0); /* LCDVSYNC */
|
|
|
+ at91_set_A_periph(AT91_PIN_PB1, 0); /* LCDHSYNC */
|
|
|
+ at91_set_A_periph(AT91_PIN_PB2, 0); /* LCDDOTCK */
|
|
|
+ at91_set_A_periph(AT91_PIN_PB3, 0); /* LCDDEN */
|
|
|
+ at91_set_A_periph(AT91_PIN_PB4, 0); /* LCDCC */
|
|
|
+ at91_set_A_periph(AT91_PIN_PB5, 0); /* LCDD0 */
|
|
|
+ at91_set_A_periph(AT91_PIN_PB6, 0); /* LCDD1 */
|
|
|
+ at91_set_A_periph(AT91_PIN_PB7, 0); /* LCDD2 */
|
|
|
+ at91_set_A_periph(AT91_PIN_PB8, 0); /* LCDD3 */
|
|
|
+#else
|
|
|
+ at91_set_A_periph(AT91_PIN_PB1, 0); /* LCDHSYNC */
|
|
|
+ at91_set_A_periph(AT91_PIN_PB2, 0); /* LCDDOTCK */
|
|
|
+ at91_set_A_periph(AT91_PIN_PB3, 0); /* LCDDEN */
|
|
|
+ at91_set_A_periph(AT91_PIN_PB4, 0); /* LCDCC */
|
|
|
+ at91_set_A_periph(AT91_PIN_PB7, 0); /* LCDD2 */
|
|
|
+ at91_set_A_periph(AT91_PIN_PB8, 0); /* LCDD3 */
|
|
|
+ at91_set_A_periph(AT91_PIN_PB9, 0); /* LCDD4 */
|
|
|
+ at91_set_A_periph(AT91_PIN_PB10, 0); /* LCDD5 */
|
|
|
+ at91_set_A_periph(AT91_PIN_PB11, 0); /* LCDD6 */
|
|
|
+ at91_set_A_periph(AT91_PIN_PB12, 0); /* LCDD7 */
|
|
|
+ at91_set_A_periph(AT91_PIN_PB15, 0); /* LCDD10 */
|
|
|
+ at91_set_A_periph(AT91_PIN_PB16, 0); /* LCDD11 */
|
|
|
+ at91_set_A_periph(AT91_PIN_PB17, 0); /* LCDD12 */
|
|
|
+ at91_set_A_periph(AT91_PIN_PB18, 0); /* LCDD13 */
|
|
|
+ at91_set_A_periph(AT91_PIN_PB19, 0); /* LCDD14 */
|
|
|
+ at91_set_A_periph(AT91_PIN_PB20, 0); /* LCDD15 */
|
|
|
+ at91_set_B_periph(AT91_PIN_PB23, 0); /* LCDD18 */
|
|
|
+ at91_set_B_periph(AT91_PIN_PB24, 0); /* LCDD19 */
|
|
|
+ at91_set_B_periph(AT91_PIN_PB25, 0); /* LCDD20 */
|
|
|
+ at91_set_B_periph(AT91_PIN_PB26, 0); /* LCDD21 */
|
|
|
+ at91_set_B_periph(AT91_PIN_PB27, 0); /* LCDD22 */
|
|
|
+ at91_set_B_periph(AT91_PIN_PB28, 0); /* LCDD23 */
|
|
|
+#endif
|
|
|
+
|
|
|
+ if (ARRAY_SIZE(lcdc_resources) > 2) {
|
|
|
+ void __iomem *fb;
|
|
|
+ struct resource *fb_res = &lcdc_resources[2];
|
|
|
+ size_t fb_len = resource_size(fb_res);
|
|
|
+
|
|
|
+ fb = ioremap(fb_res->start, fb_len);
|
|
|
+ if (fb) {
|
|
|
+ memset(fb, 0, fb_len);
|
|
|
+ iounmap(fb);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ lcdc_data = *data;
|
|
|
+ platform_device_register(&at91_lcdc_device);
|
|
|
+}
|
|
|
+#else
|
|
|
+void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data) {}
|
|
|
+#endif
|
|
|
+
|
|
|
+
|
|
|
+/* --------------------------------------------------------------------
|
|
|
+ * Timer/Counter block
|
|
|
+ * -------------------------------------------------------------------- */
|
|
|
+
|
|
|
+#ifdef CONFIG_ATMEL_TCLIB
|
|
|
+
|
|
|
+static struct resource tcb_resources[] = {
|
|
|
+ [0] = {
|
|
|
+ .start = AT91SAM9261_BASE_TCB0,
|
|
|
+ .end = AT91SAM9261_BASE_TCB0 + SZ_16K - 1,
|
|
|
+ .flags = IORESOURCE_MEM,
|
|
|
+ },
|
|
|
+ [1] = {
|
|
|
+ .start = NR_IRQS_LEGACY + AT91SAM9261_ID_TC0,
|
|
|
+ .end = NR_IRQS_LEGACY + AT91SAM9261_ID_TC0,
|
|
|
+ .flags = IORESOURCE_IRQ,
|
|
|
+ },
|
|
|
+ [2] = {
|
|
|
+ .start = NR_IRQS_LEGACY + AT91SAM9261_ID_TC1,
|
|
|
+ .end = NR_IRQS_LEGACY + AT91SAM9261_ID_TC1,
|
|
|
+ .flags = IORESOURCE_IRQ,
|
|
|
+ },
|
|
|
+ [3] = {
|
|
|
+ .start = NR_IRQS_LEGACY + AT91SAM9261_ID_TC2,
|
|
|
+ .end = NR_IRQS_LEGACY + AT91SAM9261_ID_TC2,
|
|
|
+ .flags = IORESOURCE_IRQ,
|
|
|
+ },
|
|
|
+};
|
|
|
+
|
|
|
+static struct platform_device at91sam9261_tcb_device = {
|
|
|
+ .name = "atmel_tcb",
|
|
|
+ .id = 0,
|
|
|
+ .resource = tcb_resources,
|
|
|
+ .num_resources = ARRAY_SIZE(tcb_resources),
|
|
|
+};
|
|
|
+
|
|
|
+static void __init at91_add_device_tc(void)
|
|
|
+{
|
|
|
+ platform_device_register(&at91sam9261_tcb_device);
|
|
|
+}
|
|
|
+#else
|
|
|
+static void __init at91_add_device_tc(void) { }
|
|
|
+#endif
|
|
|
+
|
|
|
+
|
|
|
+/* --------------------------------------------------------------------
|
|
|
+ * RTT
|
|
|
+ * -------------------------------------------------------------------- */
|
|
|
+
|
|
|
+static struct resource rtt_resources[] = {
|