#include <ioports.h>
#include <asm/io.h>
#endif
-#ifdef CONFIG_AT91RM9200 /* need this for the at91rm9200 */
+#if defined(CONFIG_AT91RM9200) || \
+ defined(CONFIG_AT91SAM9260) || defined(CONFIG_AT91SAM9261) || \
+ defined(CONFIG_AT91SAM9263)
#include <asm/io.h>
#include <asm/arch/hardware.h>
-#endif
-#ifdef CONFIG_AT91SAM9263 /* only valid for AT91SAM9263 */
-#include <asm/arch/at91_pmc.h>
+#include <asm/arch/at91_pio.h>
+#ifdef CONFIG_AT91_LEGACY
#include <asm/arch/gpio.h>
-#include <asm/arch/io.h>
+#endif
#endif
#ifdef CONFIG_IXP425 /* only valid for IXP425 */
#include <asm/arch/ixp425.h>