|
@@ -530,3 +530,65 @@ void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices)
|
|
|
|
|
|
if (devices[i].bus_num == 0)
|
|
|
enable_spi0 = 1;
|
|
|
+ else
|
|
|
+ enable_spi1 = 1;
|
|
|
+
|
|
|
+ /* enable chip-select pin */
|
|
|
+ at91_set_gpio_output(cs_pin, 1);
|
|
|
+
|
|
|
+ /* pass chip-select pin to driver */
|
|
|
+ devices[i].controller_data = (void *) cs_pin;
|
|
|
+ }
|
|
|
+
|
|
|
+ spi_register_board_info(devices, nr_devices);
|
|
|
+
|
|
|
+ /* Configure SPI bus(es) */
|
|
|
+ if (enable_spi0) {
|
|
|
+ at91_set_A_periph(AT91_PIN_PA0, 0); /* SPI0_MISO */
|
|
|
+ at91_set_A_periph(AT91_PIN_PA1, 0); /* SPI0_MOSI */
|
|
|
+ at91_set_A_periph(AT91_PIN_PA2, 0); /* SPI1_SPCK */
|
|
|
+
|
|
|
+ platform_device_register(&at91sam9260_spi0_device);
|
|
|
+ }
|
|
|
+ if (enable_spi1) {
|
|
|
+ at91_set_A_periph(AT91_PIN_PB0, 0); /* SPI1_MISO */
|
|
|
+ at91_set_A_periph(AT91_PIN_PB1, 0); /* SPI1_MOSI */
|
|
|
+ at91_set_A_periph(AT91_PIN_PB2, 0); /* SPI1_SPCK */
|
|
|
+
|
|
|
+ platform_device_register(&at91sam9260_spi1_device);
|
|
|
+ }
|
|
|
+}
|
|
|
+#else
|
|
|
+void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices) {}
|
|
|
+#endif
|
|
|
+
|
|
|
+
|
|
|
+/* --------------------------------------------------------------------
|
|
|
+ * Timer/Counter blocks
|
|
|
+ * -------------------------------------------------------------------- */
|
|
|
+
|
|
|
+#ifdef CONFIG_ATMEL_TCLIB
|
|
|
+
|
|
|
+static struct resource tcb0_resources[] = {
|
|
|
+ [0] = {
|
|
|
+ .start = AT91SAM9260_BASE_TCB0,
|
|
|
+ .end = AT91SAM9260_BASE_TCB0 + SZ_256 - 1,
|
|
|
+ .flags = IORESOURCE_MEM,
|
|
|
+ },
|
|
|
+ [1] = {
|
|
|
+ .start = NR_IRQS_LEGACY + AT91SAM9260_ID_TC0,
|
|
|
+ .end = NR_IRQS_LEGACY + AT91SAM9260_ID_TC0,
|
|
|
+ .flags = IORESOURCE_IRQ,
|
|
|
+ },
|
|
|
+ [2] = {
|
|
|
+ .start = NR_IRQS_LEGACY + AT91SAM9260_ID_TC1,
|
|
|
+ .end = NR_IRQS_LEGACY + AT91SAM9260_ID_TC1,
|
|
|
+ .flags = IORESOURCE_IRQ,
|
|
|
+ },
|
|
|
+ [3] = {
|
|
|
+ .start = NR_IRQS_LEGACY + AT91SAM9260_ID_TC2,
|
|
|
+ .end = NR_IRQS_LEGACY + AT91SAM9260_ID_TC2,
|
|
|
+ .flags = IORESOURCE_IRQ,
|
|
|
+ },
|
|
|
+};
|
|
|
+
|