|
@@ -106,3 +106,107 @@ static struct platform_device at91rm9200_udc_device = {
|
|
|
.dev = {
|
|
|
.platform_data = &udc_data,
|
|
|
},
|
|
|
+ .resource = udc_resources,
|
|
|
+ .num_resources = ARRAY_SIZE(udc_resources),
|
|
|
+};
|
|
|
+
|
|
|
+void __init at91_add_device_udc(struct at91_udc_data *data)
|
|
|
+{
|
|
|
+ if (!data)
|
|
|
+ return;
|
|
|
+
|
|
|
+ if (gpio_is_valid(data->vbus_pin)) {
|
|
|
+ at91_set_gpio_input(data->vbus_pin, 0);
|
|
|
+ at91_set_deglitch(data->vbus_pin, 1);
|
|
|
+ }
|
|
|
+ if (gpio_is_valid(data->pullup_pin))
|
|
|
+ at91_set_gpio_output(data->pullup_pin, 0);
|
|
|
+
|
|
|
+ udc_data = *data;
|
|
|
+ platform_device_register(&at91rm9200_udc_device);
|
|
|
+}
|
|
|
+#else
|
|
|
+void __init at91_add_device_udc(struct at91_udc_data *data) {}
|
|
|
+#endif
|
|
|
+
|
|
|
+
|
|
|
+/* --------------------------------------------------------------------
|
|
|
+ * Ethernet
|
|
|
+ * -------------------------------------------------------------------- */
|
|
|
+
|
|
|
+#if defined(CONFIG_ARM_AT91_ETHER) || defined(CONFIG_ARM_AT91_ETHER_MODULE)
|
|
|
+static u64 eth_dmamask = DMA_BIT_MASK(32);
|
|
|
+static struct macb_platform_data eth_data;
|
|
|
+
|
|
|
+static struct resource eth_resources[] = {
|
|
|
+ [0] = {
|
|
|
+ .start = AT91RM9200_BASE_EMAC,
|
|
|
+ .end = AT91RM9200_BASE_EMAC + SZ_16K - 1,
|
|
|
+ .flags = IORESOURCE_MEM,
|
|
|
+ },
|
|
|
+ [1] = {
|
|
|
+ .start = NR_IRQS_LEGACY + AT91RM9200_ID_EMAC,
|
|
|
+ .end = NR_IRQS_LEGACY + AT91RM9200_ID_EMAC,
|
|
|
+ .flags = IORESOURCE_IRQ,
|
|
|
+ },
|
|
|
+};
|
|
|
+
|
|
|
+static struct platform_device at91rm9200_eth_device = {
|
|
|
+ .name = "at91_ether",
|
|
|
+ .id = -1,
|
|
|
+ .dev = {
|
|
|
+ .dma_mask = ð_dmamask,
|
|
|
+ .coherent_dma_mask = DMA_BIT_MASK(32),
|
|
|
+ .platform_data = ð_data,
|
|
|
+ },
|
|
|
+ .resource = eth_resources,
|
|
|
+ .num_resources = ARRAY_SIZE(eth_resources),
|
|
|
+};
|
|
|
+
|
|
|
+void __init at91_add_device_eth(struct macb_platform_data *data)
|
|
|
+{
|
|
|
+ if (!data)
|
|
|
+ return;
|
|
|
+
|
|
|
+ if (gpio_is_valid(data->phy_irq_pin)) {
|
|
|
+ at91_set_gpio_input(data->phy_irq_pin, 0);
|
|
|
+ at91_set_deglitch(data->phy_irq_pin, 1);
|
|
|
+ }
|
|
|
+
|
|
|
+ /* Pins used for MII and RMII */
|
|
|
+ at91_set_A_periph(AT91_PIN_PA16, 0); /* EMDIO */
|
|
|
+ at91_set_A_periph(AT91_PIN_PA15, 0); /* EMDC */
|
|
|
+ at91_set_A_periph(AT91_PIN_PA14, 0); /* ERXER */
|
|
|
+ at91_set_A_periph(AT91_PIN_PA13, 0); /* ERX1 */
|
|
|
+ at91_set_A_periph(AT91_PIN_PA12, 0); /* ERX0 */
|
|
|
+ at91_set_A_periph(AT91_PIN_PA11, 0); /* ECRS_ECRSDV */
|
|
|
+ at91_set_A_periph(AT91_PIN_PA10, 0); /* ETX1 */
|
|
|
+ at91_set_A_periph(AT91_PIN_PA9, 0); /* ETX0 */
|
|
|
+ at91_set_A_periph(AT91_PIN_PA8, 0); /* ETXEN */
|
|
|
+ at91_set_A_periph(AT91_PIN_PA7, 0); /* ETXCK_EREFCK */
|
|
|
+
|
|
|
+ if (!data->is_rmii) {
|
|
|
+ at91_set_B_periph(AT91_PIN_PB19, 0); /* ERXCK */
|
|
|
+ at91_set_B_periph(AT91_PIN_PB18, 0); /* ECOL */
|
|
|
+ at91_set_B_periph(AT91_PIN_PB17, 0); /* ERXDV */
|
|
|
+ at91_set_B_periph(AT91_PIN_PB16, 0); /* ERX3 */
|
|
|
+ at91_set_B_periph(AT91_PIN_PB15, 0); /* ERX2 */
|
|
|
+ at91_set_B_periph(AT91_PIN_PB14, 0); /* ETXER */
|
|
|
+ at91_set_B_periph(AT91_PIN_PB13, 0); /* ETX3 */
|
|
|
+ at91_set_B_periph(AT91_PIN_PB12, 0); /* ETX2 */
|
|
|
+ }
|
|
|
+
|
|
|
+ eth_data = *data;
|
|
|
+ platform_device_register(&at91rm9200_eth_device);
|
|
|
+}
|
|
|
+#else
|
|
|
+void __init at91_add_device_eth(struct macb_platform_data *data) {}
|
|
|
+#endif
|
|
|
+
|
|
|
+
|
|
|
+/* --------------------------------------------------------------------
|
|
|
+ * Compact Flash / PCMCIA
|
|
|
+ * -------------------------------------------------------------------- */
|
|
|
+
|
|
|
+#if defined(CONFIG_AT91_CF) || defined(CONFIG_AT91_CF_MODULE)
|
|
|
+static struct at91_cf_data cf_data;
|