dm: at91: Add platform data for GPIO on at91sam9260-based boards
authorSimon Glass <sjg@chromium.org>
Wed, 29 Oct 2014 19:08:58 +0000 (13:08 -0600)
committerSimon Glass <sjg@chromium.org>
Fri, 21 Nov 2014 07:09:36 +0000 (08:09 +0100)
These boards all have the same GPIO arrangement, so add some common platform
data that can be used by all boards. Remove the configs which are no longer
required.

Signed-off-by: Simon Glass <sjg@chromium.org>
arch/arm/cpu/arm926ejs/at91/at91sam9260_devices.c
arch/arm/include/asm/arch-at91/at91sam9260.h

index 7a7fd7dfb223f598795a23728c745183bb4037ef..efb53d673f4ee137f68b3edfa94b707de4e1b257 100644 (file)
@@ -7,6 +7,7 @@
  */
 
 #include <common.h>
+#include <dm.h>
 #include <asm/io.h>
 #include <asm/arch/at91sam9260_matrix.h>
 #include <asm/arch/at91_common.h>
@@ -229,3 +230,16 @@ void at91_sdram_hw_init(void)
        at91_set_a_periph(AT91_PIO_PORTC, 30, 0);
        at91_set_a_periph(AT91_PIO_PORTC, 31, 0);
 }
+
+/* Platform data for the GPIOs */
+static const struct at91_port_platdata at91sam9260_plat[] = {
+       { ATMEL_BASE_PIOA, "PA" },
+       { ATMEL_BASE_PIOB, "PB" },
+       { ATMEL_BASE_PIOC, "PC" },
+};
+
+U_BOOT_DEVICES(at91sam9260_gpios) = {
+       { "gpio_at91", &at91sam9260_plat[0] },
+       { "gpio_at91", &at91sam9260_plat[1] },
+       { "gpio_at91", &at91sam9260_plat[2] },
+};
index 1e613fa636d17818490a58e2032bcc43322a2d89..bb48875290371f7d4dafd5a1e1caf7597d16c88c 100644 (file)
 /*
  * Other misc defines
  */
+#ifndef CONFIG_DM_GPIO
 #define ATMEL_PIO_PORTS                3               /* these SoCs have 3 PIO */
-#define ATMEL_PMC_UHP          AT91SAM926x_PMC_UHP
 #define ATMEL_BASE_PIO         ATMEL_BASE_PIOA
+#endif
+#define ATMEL_PMC_UHP          AT91SAM926x_PMC_UHP
 
 /*
  * SoC specific defines