ARM: at91: SAMA5D4 SoC detection code and low level routines
[firefly-linux-kernel-4.4.55.git] / arch / arm / mach-at91 / include / mach / hardware.h
index 56338245653aea10f094ec765f0d9afdb99ae580..d84776f6b8ac0f63b97d86c33e4bb2d4d1e6f5eb 100644 (file)
 /* DBGU base */
 /* rm9200, 9260/9g20, 9261/9g10, 9rl */
 #define AT91_BASE_DBGU0        0xfffff200
-/* 9263, 9g45 */
+/* 9263, 9g45, sama5d3 */
 #define AT91_BASE_DBGU1        0xffffee00
+/* sama5d4 */
+#define AT91_BASE_DBGU2        0xfc069000
 
 #if defined(CONFIG_ARCH_AT91X40)
 #include <mach/at91x40.h>
@@ -34,6 +36,7 @@
 #include <mach/at91sam9x5.h>
 #include <mach/at91sam9n12.h>
 #include <mach/sama5d3.h>
+#include <mach/sama5d4.h>
 
 /*
  * On all at91 except rm9200 and x40 have the System Controller starts
  * and map the same memory space
  */
 #define AT91_BASE_SYS  0xffffc000
+
+/*
+ * On sama5d4 there is no system controller, we map some needed peripherals
+ */
+#define AT91_ALT_BASE_SYS      0xfc069000
 #endif
 
 /*
  */
 #define AT91_IO_PHYS_BASE      0xFFF78000
 #define AT91_IO_VIRT_BASE      IOMEM(0xFF000000 - AT91_IO_SIZE)
+
+/*
+ * On sama5d4, remap the peripherals from address 0xFC069000 .. 0xFC06F000
+ * to 0xFB069000 .. 0xFB06F000.  (24Kb)
+ */
+#define AT91_ALT_IO_PHYS_BASE  AT91_ALT_BASE_SYS
+#define AT91_ALT_IO_VIRT_BASE  IOMEM(0xFB069000)
 #else
 /*
  * Identity mapping for the non MMU case.
 
  /* Convert a physical IO address to virtual IO address */
 #define AT91_IO_P2V(x)         ((x) - AT91_IO_PHYS_BASE + AT91_IO_VIRT_BASE)
+#define AT91_ALT_IO_P2V(x)     ((x) - AT91_ALT_IO_PHYS_BASE + AT91_ALT_IO_VIRT_BASE)
 
 /*
  * Virtual to Physical Address mapping for IO devices.
  */
 #define AT91_VA_BASE_SYS       AT91_IO_P2V(AT91_BASE_SYS)
+#define AT91_ALT_VA_BASE_SYS   AT91_ALT_IO_P2V(AT91_ALT_BASE_SYS)
 
  /* Internal SRAM is mapped below the IO devices */
 #define AT91_SRAM_MAX          SZ_1M