*/
 
 #include <common.h>
+#include <dm.h>
 #include <asm/io.h>
 #include <asm/arch/at91sam9260_matrix.h>
 #include <asm/arch/at91_common.h>
        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] },
+};
 
 /*
  * 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