All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/17] AT91 cleanup for 3.20 #3
@ 2015-01-15 21:58 ` Alexandre Belloni
  0 siblings, 0 replies; 56+ messages in thread
From: Alexandre Belloni @ 2015-01-15 21:58 UTC (permalink / raw)
  To: Nicolas Ferre
  Cc: Jean-Christophe Plagniol-Villard, Arnd Bergmann, Boris Brezillon,
	Bo Shen, Wenyou Yang, linux-arm-kernel, linux-kernel,
	Alexandre Belloni

This patch sets is based on AT91 cleanup for 3.20 #2. it goes further in the
cleanup.

It merges board-dt ans soc files, ending up with only at91rm9200.c, at91sam9.c,
sama5d3.c and sama5d4.c.

It merges all the SOC_AT91SAM9xxx config option under SOC_AT91SAM9.

It also removes unused headers.

There is also one fix regarding arm_pm_idle for sam9n12 and sam9g45.

Alexandre Belloni (15):
  ARM: at91:remove unused mach/system_rev.h
  ARM: at91: fix sam9n12 and sam9x5 arm_pm_idle
  ARM: at91: sam9: set arm_pm_idle from sam9_dt_device_init
  ARM: at91: remove unused at91_ioremap_matrix and header
  ARM: at91: remove unused _matrix.h headers
  ARM: at91: stop using HAVE_AT91_DBGUx
  ARM: at91: pm: remove warning to remove SOC_AT91SAM9263 usage
  ARM: at91: merge SOC_AT91SAM9xxx
  ARM: at91: remove at91_boot_soc
  ARM: at91: rework initialization for rm9200 based boards
  ARM: at91: rework initialization for sam9 based boards
  ARM: at91: rework initialization for sama5 based boards
  ARM: at91: remove old setup
  ARM: at91: mark const init data with __initconst instead of __initdata
  ARM: at91: remove at91_dt_initialize

Arnd Bergmann (2):
  ARM: at91: merge at91rm9200 files
  ARM: at91: move sama5 specific code into per-soc files

 arch/arm/Kconfig.debug                             |   6 +-
 arch/arm/configs/at91_dt_defconfig                 |  10 +-
 arch/arm/mach-at91/Kconfig                         | 111 ++----
 arch/arm/mach-at91/Makefile                        |  17 +-
 arch/arm/mach-at91/at91rm9200.c                    |  49 ++-
 arch/arm/mach-at91/{board-dt-sam9.c => at91sam9.c} |  21 +-
 arch/arm/mach-at91/at91sam9260.c                   |  32 --
 arch/arm/mach-at91/at91sam9261.c                   |  31 --
 arch/arm/mach-at91/at91sam9263.c                   |  30 --
 arch/arm/mach-at91/at91sam9g45.c                   |  30 --
 arch/arm/mach-at91/at91sam9n12.c                   |  20 -
 arch/arm/mach-at91/at91sam9rl.c                    |  32 --
 arch/arm/mach-at91/at91sam9x5.c                    |  20 -
 arch/arm/mach-at91/board-dt-rm9200.c               |  54 ---
 arch/arm/mach-at91/board-dt-sama5.c                |  60 ---
 arch/arm/mach-at91/generic.h                       |  11 -
 arch/arm/mach-at91/include/mach/at91_dbgu.h        |  63 ----
 arch/arm/mach-at91/include/mach/at91_matrix.h      |  23 --
 arch/arm/mach-at91/include/mach/at91_ramc.h        |   6 -
 .../mach-at91/include/mach/at91sam9260_matrix.h    |  80 ----
 .../mach-at91/include/mach/at91sam9261_matrix.h    |  64 ----
 .../mach-at91/include/mach/at91sam9263_matrix.h    | 129 -------
 arch/arm/mach-at91/include/mach/at91sam9_smc.h     |   2 -
 .../mach-at91/include/mach/at91sam9g45_matrix.h    | 153 --------
 .../mach-at91/include/mach/at91sam9n12_matrix.h    |  53 ---
 .../arm/mach-at91/include/mach/at91sam9rl_matrix.h |  96 -----
 .../arm/mach-at91/include/mach/at91sam9x5_matrix.h |  53 ---
 arch/arm/mach-at91/include/mach/cpu.h              | 240 ------------
 arch/arm/mach-at91/include/mach/system_rev.h       |  27 --
 arch/arm/mach-at91/pm.c                            |  48 ++-
 arch/arm/mach-at91/pm_slowclock.S                  |   9 -
 arch/arm/mach-at91/sama5d3.c                       |  31 +-
 arch/arm/mach-at91/sama5d4.c                       |  35 +-
 arch/arm/mach-at91/setup.c                         | 407 ---------------------
 arch/arm/mach-at91/soc.h                           |  77 ----
 35 files changed, 151 insertions(+), 1979 deletions(-)
 rename arch/arm/mach-at91/{board-dt-sam9.c => at91sam9.c} (71%)
 delete mode 100644 arch/arm/mach-at91/at91sam9260.c
 delete mode 100644 arch/arm/mach-at91/at91sam9261.c
 delete mode 100644 arch/arm/mach-at91/at91sam9263.c
 delete mode 100644 arch/arm/mach-at91/at91sam9g45.c
 delete mode 100644 arch/arm/mach-at91/at91sam9n12.c
 delete mode 100644 arch/arm/mach-at91/at91sam9rl.c
 delete mode 100644 arch/arm/mach-at91/at91sam9x5.c
 delete mode 100644 arch/arm/mach-at91/board-dt-rm9200.c
 delete mode 100644 arch/arm/mach-at91/board-dt-sama5.c
 delete mode 100644 arch/arm/mach-at91/include/mach/at91_dbgu.h
 delete mode 100644 arch/arm/mach-at91/include/mach/at91_matrix.h
 delete mode 100644 arch/arm/mach-at91/include/mach/at91sam9260_matrix.h
 delete mode 100644 arch/arm/mach-at91/include/mach/at91sam9261_matrix.h
 delete mode 100644 arch/arm/mach-at91/include/mach/at91sam9263_matrix.h
 delete mode 100644 arch/arm/mach-at91/include/mach/at91sam9g45_matrix.h
 delete mode 100644 arch/arm/mach-at91/include/mach/at91sam9n12_matrix.h
 delete mode 100644 arch/arm/mach-at91/include/mach/at91sam9rl_matrix.h
 delete mode 100644 arch/arm/mach-at91/include/mach/at91sam9x5_matrix.h
 delete mode 100644 arch/arm/mach-at91/include/mach/cpu.h
 delete mode 100644 arch/arm/mach-at91/include/mach/system_rev.h
 delete mode 100644 arch/arm/mach-at91/setup.c
 delete mode 100644 arch/arm/mach-at91/soc.h

-- 
2.1.0


^ permalink raw reply	[flat|nested] 56+ messages in thread

* [PATCH 00/17] AT91 cleanup for 3.20 #3
@ 2015-01-15 21:58 ` Alexandre Belloni
  0 siblings, 0 replies; 56+ messages in thread
From: Alexandre Belloni @ 2015-01-15 21:58 UTC (permalink / raw)
  To: linux-arm-kernel

This patch sets is based on AT91 cleanup for 3.20 #2. it goes further in the
cleanup.

It merges board-dt ans soc files, ending up with only at91rm9200.c, at91sam9.c,
sama5d3.c and sama5d4.c.

It merges all the SOC_AT91SAM9xxx config option under SOC_AT91SAM9.

It also removes unused headers.

There is also one fix regarding arm_pm_idle for sam9n12 and sam9g45.

Alexandre Belloni (15):
  ARM: at91:remove unused mach/system_rev.h
  ARM: at91: fix sam9n12 and sam9x5 arm_pm_idle
  ARM: at91: sam9: set arm_pm_idle from sam9_dt_device_init
  ARM: at91: remove unused at91_ioremap_matrix and header
  ARM: at91: remove unused _matrix.h headers
  ARM: at91: stop using HAVE_AT91_DBGUx
  ARM: at91: pm: remove warning to remove SOC_AT91SAM9263 usage
  ARM: at91: merge SOC_AT91SAM9xxx
  ARM: at91: remove at91_boot_soc
  ARM: at91: rework initialization for rm9200 based boards
  ARM: at91: rework initialization for sam9 based boards
  ARM: at91: rework initialization for sama5 based boards
  ARM: at91: remove old setup
  ARM: at91: mark const init data with __initconst instead of __initdata
  ARM: at91: remove at91_dt_initialize

Arnd Bergmann (2):
  ARM: at91: merge at91rm9200 files
  ARM: at91: move sama5 specific code into per-soc files

 arch/arm/Kconfig.debug                             |   6 +-
 arch/arm/configs/at91_dt_defconfig                 |  10 +-
 arch/arm/mach-at91/Kconfig                         | 111 ++----
 arch/arm/mach-at91/Makefile                        |  17 +-
 arch/arm/mach-at91/at91rm9200.c                    |  49 ++-
 arch/arm/mach-at91/{board-dt-sam9.c => at91sam9.c} |  21 +-
 arch/arm/mach-at91/at91sam9260.c                   |  32 --
 arch/arm/mach-at91/at91sam9261.c                   |  31 --
 arch/arm/mach-at91/at91sam9263.c                   |  30 --
 arch/arm/mach-at91/at91sam9g45.c                   |  30 --
 arch/arm/mach-at91/at91sam9n12.c                   |  20 -
 arch/arm/mach-at91/at91sam9rl.c                    |  32 --
 arch/arm/mach-at91/at91sam9x5.c                    |  20 -
 arch/arm/mach-at91/board-dt-rm9200.c               |  54 ---
 arch/arm/mach-at91/board-dt-sama5.c                |  60 ---
 arch/arm/mach-at91/generic.h                       |  11 -
 arch/arm/mach-at91/include/mach/at91_dbgu.h        |  63 ----
 arch/arm/mach-at91/include/mach/at91_matrix.h      |  23 --
 arch/arm/mach-at91/include/mach/at91_ramc.h        |   6 -
 .../mach-at91/include/mach/at91sam9260_matrix.h    |  80 ----
 .../mach-at91/include/mach/at91sam9261_matrix.h    |  64 ----
 .../mach-at91/include/mach/at91sam9263_matrix.h    | 129 -------
 arch/arm/mach-at91/include/mach/at91sam9_smc.h     |   2 -
 .../mach-at91/include/mach/at91sam9g45_matrix.h    | 153 --------
 .../mach-at91/include/mach/at91sam9n12_matrix.h    |  53 ---
 .../arm/mach-at91/include/mach/at91sam9rl_matrix.h |  96 -----
 .../arm/mach-at91/include/mach/at91sam9x5_matrix.h |  53 ---
 arch/arm/mach-at91/include/mach/cpu.h              | 240 ------------
 arch/arm/mach-at91/include/mach/system_rev.h       |  27 --
 arch/arm/mach-at91/pm.c                            |  48 ++-
 arch/arm/mach-at91/pm_slowclock.S                  |   9 -
 arch/arm/mach-at91/sama5d3.c                       |  31 +-
 arch/arm/mach-at91/sama5d4.c                       |  35 +-
 arch/arm/mach-at91/setup.c                         | 407 ---------------------
 arch/arm/mach-at91/soc.h                           |  77 ----
 35 files changed, 151 insertions(+), 1979 deletions(-)
 rename arch/arm/mach-at91/{board-dt-sam9.c => at91sam9.c} (71%)
 delete mode 100644 arch/arm/mach-at91/at91sam9260.c
 delete mode 100644 arch/arm/mach-at91/at91sam9261.c
 delete mode 100644 arch/arm/mach-at91/at91sam9263.c
 delete mode 100644 arch/arm/mach-at91/at91sam9g45.c
 delete mode 100644 arch/arm/mach-at91/at91sam9n12.c
 delete mode 100644 arch/arm/mach-at91/at91sam9rl.c
 delete mode 100644 arch/arm/mach-at91/at91sam9x5.c
 delete mode 100644 arch/arm/mach-at91/board-dt-rm9200.c
 delete mode 100644 arch/arm/mach-at91/board-dt-sama5.c
 delete mode 100644 arch/arm/mach-at91/include/mach/at91_dbgu.h
 delete mode 100644 arch/arm/mach-at91/include/mach/at91_matrix.h
 delete mode 100644 arch/arm/mach-at91/include/mach/at91sam9260_matrix.h
 delete mode 100644 arch/arm/mach-at91/include/mach/at91sam9261_matrix.h
 delete mode 100644 arch/arm/mach-at91/include/mach/at91sam9263_matrix.h
 delete mode 100644 arch/arm/mach-at91/include/mach/at91sam9g45_matrix.h
 delete mode 100644 arch/arm/mach-at91/include/mach/at91sam9n12_matrix.h
 delete mode 100644 arch/arm/mach-at91/include/mach/at91sam9rl_matrix.h
 delete mode 100644 arch/arm/mach-at91/include/mach/at91sam9x5_matrix.h
 delete mode 100644 arch/arm/mach-at91/include/mach/cpu.h
 delete mode 100644 arch/arm/mach-at91/include/mach/system_rev.h
 delete mode 100644 arch/arm/mach-at91/setup.c
 delete mode 100644 arch/arm/mach-at91/soc.h

-- 
2.1.0

^ permalink raw reply	[flat|nested] 56+ messages in thread

* [PATCH 01/17] ARM: at91: merge at91rm9200 files
  2015-01-15 21:58 ` Alexandre Belloni
@ 2015-01-15 21:58   ` Alexandre Belloni
  -1 siblings, 0 replies; 56+ messages in thread
From: Alexandre Belloni @ 2015-01-15 21:58 UTC (permalink / raw)
  To: Nicolas Ferre
  Cc: Jean-Christophe Plagniol-Villard, Arnd Bergmann, Boris Brezillon,
	Bo Shen, Wenyou Yang, linux-arm-kernel, linux-kernel,
	Alexandre Belloni

From: Arnd Bergmann <arnd@arndb.de>

There is only one board file for the rm9200 soc file left, so
it makes sense to merge the two files into one, which allows
us further cleanup.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
---
 arch/arm/mach-at91/Makefile          |  1 -
 arch/arm/mach-at91/at91rm9200.c      | 50 ++++++++++++++++++++++++++++-----
 arch/arm/mach-at91/board-dt-rm9200.c | 54 ------------------------------------
 3 files changed, 43 insertions(+), 62 deletions(-)
 delete mode 100644 arch/arm/mach-at91/board-dt-rm9200.c

diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile
index 8ef7d9a2e855..d89c2437ef10 100644
--- a/arch/arm/mach-at91/Makefile
+++ b/arch/arm/mach-at91/Makefile
@@ -19,7 +19,6 @@ obj-$(CONFIG_SOC_SAMA5D3)	+= sama5d3.o
 obj-$(CONFIG_SOC_SAMA5D4)	+= sama5d4.o
 
 # AT91SAM board with device-tree
-obj-$(CONFIG_SOC_AT91RM9200) += board-dt-rm9200.o
 obj-$(CONFIG_SOC_AT91SAM9) += board-dt-sam9.o
 
 # SAMA5 board with device-tree
diff --git a/arch/arm/mach-at91/at91rm9200.c b/arch/arm/mach-at91/at91rm9200.c
index 3be1963f5c56..eaa30b1fea01 100644
--- a/arch/arm/mach-at91/at91rm9200.c
+++ b/arch/arm/mach-at91/at91rm9200.c
@@ -1,20 +1,30 @@
 /*
- * arch/arm/mach-at91/at91rm9200.c
+ *  Setup code for AT91RM9200
  *
  *  Copyright (C) 2005 SAN People
+ *  Copyright (C) 2011 Atmel,
+ *                2011 Nicolas Ferre <nicolas.ferre@atmel.com>
+ *                2012 Joachim Eastwood <manabian@gmail.com>
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
+ * Licensed under GPLv2 or later.
  */
-
+#include <linux/types.h>
+#include <linux/init.h>
 #include <linux/module.h>
+#include <linux/gpio.h>
+#include <linux/of.h>
+#include <linux/of_irq.h>
+#include <linux/of_platform.h>
+#include <linux/clk-provider.h>
 #include <linux/clk/at91_pmc.h>
 
+#include <asm/setup.h>
+#include <asm/irq.h>
+#include <asm/mach/arch.h>
+#include <asm/mach/irq.h>
 #include <asm/mach/map.h>
 #include <asm/system_misc.h>
+
 #include <mach/at91_st.h>
 #include <mach/hardware.h>
 
@@ -44,3 +54,29 @@ static void __init at91rm9200_initialize(void)
 AT91_SOC_START(at91rm9200)
 	.init = at91rm9200_initialize,
 AT91_SOC_END
+
+static void __init at91rm9200_dt_timer_init(void)
+{
+	of_clk_init(NULL);
+	at91rm9200_timer_init();
+}
+
+static void __init rm9200_dt_device_init(void)
+{
+	at91_rm9200_pm_init();
+
+	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
+}
+
+static const char *at91rm9200_dt_board_compat[] __initdata = {
+	"atmel,at91rm9200",
+	NULL
+};
+
+DT_MACHINE_START(at91rm9200_dt, "Atmel AT91RM9200 (Device Tree)")
+	.init_time      = at91rm9200_dt_timer_init,
+	.map_io		= at91_map_io,
+	.init_early	= at91_dt_initialize,
+	.init_machine	= rm9200_dt_device_init,
+	.dt_compat	= at91rm9200_dt_board_compat,
+MACHINE_END
diff --git a/arch/arm/mach-at91/board-dt-rm9200.c b/arch/arm/mach-at91/board-dt-rm9200.c
deleted file mode 100644
index 5f82a65153e1..000000000000
--- a/arch/arm/mach-at91/board-dt-rm9200.c
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- *  Setup code for AT91RM9200 Evaluation Kits with Device Tree support
- *
- *  Copyright (C) 2011 Atmel,
- *                2011 Nicolas Ferre <nicolas.ferre@atmel.com>
- *                2012 Joachim Eastwood <manabian@gmail.com>
- *
- * Licensed under GPLv2 or later.
- */
-
-#include <linux/types.h>
-#include <linux/init.h>
-#include <linux/module.h>
-#include <linux/gpio.h>
-#include <linux/of.h>
-#include <linux/of_irq.h>
-#include <linux/of_platform.h>
-#include <linux/clk-provider.h>
-
-#include <asm/setup.h>
-#include <asm/irq.h>
-#include <asm/mach/arch.h>
-#include <asm/mach/map.h>
-#include <asm/mach/irq.h>
-
-#include "generic.h"
-
-static void __init at91rm9200_dt_timer_init(void)
-{
-	of_clk_init(NULL);
-	at91rm9200_timer_init();
-}
-
-static void __init rm9200_dt_device_init(void)
-{
-	at91_rm9200_pm_init();
-
-	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
-}
-
-
-
-static const char *at91rm9200_dt_board_compat[] __initdata = {
-	"atmel,at91rm9200",
-	NULL
-};
-
-DT_MACHINE_START(at91rm9200_dt, "Atmel AT91RM9200 (Device Tree)")
-	.init_time      = at91rm9200_dt_timer_init,
-	.map_io		= at91_map_io,
-	.init_early	= at91_dt_initialize,
-	.init_machine	= rm9200_dt_device_init,
-	.dt_compat	= at91rm9200_dt_board_compat,
-MACHINE_END
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 56+ messages in thread

* [PATCH 01/17] ARM: at91: merge at91rm9200 files
@ 2015-01-15 21:58   ` Alexandre Belloni
  0 siblings, 0 replies; 56+ messages in thread
From: Alexandre Belloni @ 2015-01-15 21:58 UTC (permalink / raw)
  To: linux-arm-kernel

From: Arnd Bergmann <arnd@arndb.de>

There is only one board file for the rm9200 soc file left, so
it makes sense to merge the two files into one, which allows
us further cleanup.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
---
 arch/arm/mach-at91/Makefile          |  1 -
 arch/arm/mach-at91/at91rm9200.c      | 50 ++++++++++++++++++++++++++++-----
 arch/arm/mach-at91/board-dt-rm9200.c | 54 ------------------------------------
 3 files changed, 43 insertions(+), 62 deletions(-)
 delete mode 100644 arch/arm/mach-at91/board-dt-rm9200.c

diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile
index 8ef7d9a2e855..d89c2437ef10 100644
--- a/arch/arm/mach-at91/Makefile
+++ b/arch/arm/mach-at91/Makefile
@@ -19,7 +19,6 @@ obj-$(CONFIG_SOC_SAMA5D3)	+= sama5d3.o
 obj-$(CONFIG_SOC_SAMA5D4)	+= sama5d4.o
 
 # AT91SAM board with device-tree
-obj-$(CONFIG_SOC_AT91RM9200) += board-dt-rm9200.o
 obj-$(CONFIG_SOC_AT91SAM9) += board-dt-sam9.o
 
 # SAMA5 board with device-tree
diff --git a/arch/arm/mach-at91/at91rm9200.c b/arch/arm/mach-at91/at91rm9200.c
index 3be1963f5c56..eaa30b1fea01 100644
--- a/arch/arm/mach-at91/at91rm9200.c
+++ b/arch/arm/mach-at91/at91rm9200.c
@@ -1,20 +1,30 @@
 /*
- * arch/arm/mach-at91/at91rm9200.c
+ *  Setup code for AT91RM9200
  *
  *  Copyright (C) 2005 SAN People
+ *  Copyright (C) 2011 Atmel,
+ *                2011 Nicolas Ferre <nicolas.ferre@atmel.com>
+ *                2012 Joachim Eastwood <manabian@gmail.com>
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
+ * Licensed under GPLv2 or later.
  */
-
+#include <linux/types.h>
+#include <linux/init.h>
 #include <linux/module.h>
+#include <linux/gpio.h>
+#include <linux/of.h>
+#include <linux/of_irq.h>
+#include <linux/of_platform.h>
+#include <linux/clk-provider.h>
 #include <linux/clk/at91_pmc.h>
 
+#include <asm/setup.h>
+#include <asm/irq.h>
+#include <asm/mach/arch.h>
+#include <asm/mach/irq.h>
 #include <asm/mach/map.h>
 #include <asm/system_misc.h>
+
 #include <mach/at91_st.h>
 #include <mach/hardware.h>
 
@@ -44,3 +54,29 @@ static void __init at91rm9200_initialize(void)
 AT91_SOC_START(at91rm9200)
 	.init = at91rm9200_initialize,
 AT91_SOC_END
+
+static void __init at91rm9200_dt_timer_init(void)
+{
+	of_clk_init(NULL);
+	at91rm9200_timer_init();
+}
+
+static void __init rm9200_dt_device_init(void)
+{
+	at91_rm9200_pm_init();
+
+	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
+}
+
+static const char *at91rm9200_dt_board_compat[] __initdata = {
+	"atmel,at91rm9200",
+	NULL
+};
+
+DT_MACHINE_START(at91rm9200_dt, "Atmel AT91RM9200 (Device Tree)")
+	.init_time      = at91rm9200_dt_timer_init,
+	.map_io		= at91_map_io,
+	.init_early	= at91_dt_initialize,
+	.init_machine	= rm9200_dt_device_init,
+	.dt_compat	= at91rm9200_dt_board_compat,
+MACHINE_END
diff --git a/arch/arm/mach-at91/board-dt-rm9200.c b/arch/arm/mach-at91/board-dt-rm9200.c
deleted file mode 100644
index 5f82a65153e1..000000000000
--- a/arch/arm/mach-at91/board-dt-rm9200.c
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- *  Setup code for AT91RM9200 Evaluation Kits with Device Tree support
- *
- *  Copyright (C) 2011 Atmel,
- *                2011 Nicolas Ferre <nicolas.ferre@atmel.com>
- *                2012 Joachim Eastwood <manabian@gmail.com>
- *
- * Licensed under GPLv2 or later.
- */
-
-#include <linux/types.h>
-#include <linux/init.h>
-#include <linux/module.h>
-#include <linux/gpio.h>
-#include <linux/of.h>
-#include <linux/of_irq.h>
-#include <linux/of_platform.h>
-#include <linux/clk-provider.h>
-
-#include <asm/setup.h>
-#include <asm/irq.h>
-#include <asm/mach/arch.h>
-#include <asm/mach/map.h>
-#include <asm/mach/irq.h>
-
-#include "generic.h"
-
-static void __init at91rm9200_dt_timer_init(void)
-{
-	of_clk_init(NULL);
-	at91rm9200_timer_init();
-}
-
-static void __init rm9200_dt_device_init(void)
-{
-	at91_rm9200_pm_init();
-
-	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
-}
-
-
-
-static const char *at91rm9200_dt_board_compat[] __initdata = {
-	"atmel,at91rm9200",
-	NULL
-};
-
-DT_MACHINE_START(at91rm9200_dt, "Atmel AT91RM9200 (Device Tree)")
-	.init_time      = at91rm9200_dt_timer_init,
-	.map_io		= at91_map_io,
-	.init_early	= at91_dt_initialize,
-	.init_machine	= rm9200_dt_device_init,
-	.dt_compat	= at91rm9200_dt_board_compat,
-MACHINE_END
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 56+ messages in thread

* [PATCH 02/17] ARM: at91: move sama5 specific code into per-soc files
  2015-01-15 21:58 ` Alexandre Belloni
@ 2015-01-15 21:58   ` Alexandre Belloni
  -1 siblings, 0 replies; 56+ messages in thread
From: Alexandre Belloni @ 2015-01-15 21:58 UTC (permalink / raw)
  To: Nicolas Ferre
  Cc: Jean-Christophe Plagniol-Villard, Arnd Bergmann, Boris Brezillon,
	Bo Shen, Wenyou Yang, linux-arm-kernel, linux-kernel,
	Alexandre Belloni

From: Arnd Bergmann <arnd@arndb.de>

The common board-dt-sama5 file no longer contains any shared
code, so we can just move the machine descriptors into the
per-soc files for further cleanup.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
---
 arch/arm/mach-at91/Makefile         |  3 --
 arch/arm/mach-at91/board-dt-sama5.c | 60 -------------------------------------
 arch/arm/mach-at91/sama5d3.c        | 28 +++++++++++++----
 arch/arm/mach-at91/sama5d4.c        | 33 ++++++++++++++++++--
 4 files changed, 54 insertions(+), 70 deletions(-)
 delete mode 100644 arch/arm/mach-at91/board-dt-sama5.c

diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile
index d89c2437ef10..4bce1fac680e 100644
--- a/arch/arm/mach-at91/Makefile
+++ b/arch/arm/mach-at91/Makefile
@@ -21,9 +21,6 @@ obj-$(CONFIG_SOC_SAMA5D4)	+= sama5d4.o
 # AT91SAM board with device-tree
 obj-$(CONFIG_SOC_AT91SAM9) += board-dt-sam9.o
 
-# SAMA5 board with device-tree
-obj-$(CONFIG_SOC_SAMA5)		+= board-dt-sama5.o
-
 # Power Management
 obj-$(CONFIG_PM)		+= pm.o
 obj-$(CONFIG_AT91_SLOW_CLOCK)	+= pm_slowclock.o
diff --git a/arch/arm/mach-at91/board-dt-sama5.c b/arch/arm/mach-at91/board-dt-sama5.c
deleted file mode 100644
index 44d372a22a29..000000000000
--- a/arch/arm/mach-at91/board-dt-sama5.c
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- *  Setup code for SAMA5 Evaluation Kits with Device Tree support
- *
- *  Copyright (C) 2013 Atmel,
- *                2013 Ludovic Desroches <ludovic.desroches@atmel.com>
- *
- * Licensed under GPLv2 or later.
- */
-
-#include <linux/types.h>
-#include <linux/init.h>
-#include <linux/module.h>
-#include <linux/gpio.h>
-#include <linux/micrel_phy.h>
-#include <linux/of.h>
-#include <linux/of_irq.h>
-#include <linux/of_platform.h>
-#include <linux/phy.h>
-#include <linux/clk-provider.h>
-
-#include <asm/setup.h>
-#include <asm/irq.h>
-#include <asm/mach/arch.h>
-#include <asm/mach/map.h>
-#include <asm/mach/irq.h>
-
-#include "generic.h"
-
-static void __init sama5_dt_device_init(void)
-{
-	at91_sam9260_pm_init();
-	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
-}
-
-static const char *sama5_dt_board_compat[] __initconst = {
-	"atmel,sama5",
-	NULL
-};
-
-DT_MACHINE_START(sama5_dt, "Atmel SAMA5 (Device Tree)")
-	/* Maintainer: Atmel */
-	.map_io		= at91_map_io,
-	.init_early	= at91_dt_initialize,
-	.init_machine	= sama5_dt_device_init,
-	.dt_compat	= sama5_dt_board_compat,
-MACHINE_END
-
-static const char *sama5_alt_dt_board_compat[] __initconst = {
-	"atmel,sama5d4",
-	NULL
-};
-
-DT_MACHINE_START(sama5_alt_dt, "Atmel SAMA5 (Device Tree)")
-	/* Maintainer: Atmel */
-	.map_io		= at91_alt_map_io,
-	.init_early	= at91_dt_initialize,
-	.init_machine	= sama5_dt_device_init,
-	.dt_compat	= sama5_alt_dt_board_compat,
-	.l2c_aux_mask	= ~0UL,
-MACHINE_END
diff --git a/arch/arm/mach-at91/sama5d3.c b/arch/arm/mach-at91/sama5d3.c
index b7c64ca7107f..ecd35f135a9f 100644
--- a/arch/arm/mach-at91/sama5d3.c
+++ b/arch/arm/mach-at91/sama5d3.c
@@ -7,19 +7,18 @@
  * Licensed under GPLv2 or later.
  */
 
-#include <linux/module.h>
-#include <linux/dma-mapping.h>
-#include <linux/clk/at91_pmc.h>
+#include <linux/init.h>
+#include <linux/of_platform.h>
 
-#include <asm/irq.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
+#include <asm/mach/irq.h>
+
 #include <mach/sama5d3.h>
 #include <mach/cpu.h>
 
 #include "soc.h"
 #include "generic.h"
-#include "sam9_smc.h"
 
 /* --------------------------------------------------------------------
  *  AT91SAM9x5 processor initialization
@@ -27,3 +26,22 @@
 
 AT91_SOC_START(sama5d3)
 AT91_SOC_END
+
+static void __init sama5_dt_device_init(void)
+{
+	at91_sam9260_pm_init();
+	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
+}
+
+static const char *sama5_dt_board_compat[] __initconst = {
+	"atmel,sama5",
+	NULL
+};
+
+DT_MACHINE_START(sama5_dt, "Atmel SAMA5 (Device Tree)")
+	/* Maintainer: Atmel */
+	.map_io		= at91_map_io,
+	.init_early	= at91_dt_initialize,
+	.init_machine	= sama5_dt_device_init,
+	.dt_compat	= sama5_dt_board_compat,
+MACHINE_END
diff --git a/arch/arm/mach-at91/sama5d4.c b/arch/arm/mach-at91/sama5d4.c
index fa127fb79221..68573cd9d8f9 100644
--- a/arch/arm/mach-at91/sama5d4.c
+++ b/arch/arm/mach-at91/sama5d4.c
@@ -10,17 +10,27 @@
 #include <linux/module.h>
 #include <linux/dma-mapping.h>
 #include <linux/clk/at91_pmc.h>
+#include <linux/types.h>
+#include <linux/init.h>
+#include <linux/gpio.h>
+#include <linux/micrel_phy.h>
+#include <linux/of.h>
+#include <linux/of_irq.h>
+#include <linux/of_platform.h>
+#include <linux/phy.h>
+#include <linux/clk-provider.h>
 
 #include <asm/irq.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
+#include <asm/mach/irq.h>
+
 #include <mach/sama5d4.h>
 #include <mach/cpu.h>
 #include <mach/hardware.h>
 
 #include "soc.h"
 #include "generic.h"
-#include "sam9_smc.h"
 
 /* --------------------------------------------------------------------
  *  Processor initialization
@@ -52,7 +62,6 @@ static struct map_desc at91_io_desc[] __initdata = {
 	},
 };
 
-
 static void __init sama5d4_map_io(void)
 {
 	iotable_init(at91_io_desc, ARRAY_SIZE(at91_io_desc));
@@ -61,3 +70,23 @@ static void __init sama5d4_map_io(void)
 AT91_SOC_START(sama5d4)
 	.map_io = sama5d4_map_io,
 AT91_SOC_END
+
+static void __init sama5d4_dt_device_init(void)
+{
+	at91_sam9260_pm_init();
+	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
+}
+
+static const char *sama5_alt_dt_board_compat[] __initconst = {
+	"atmel,sama5d4",
+	NULL
+};
+
+DT_MACHINE_START(sama5_alt_dt, "Atmel SAMA5 (Device Tree)")
+	/* Maintainer: Atmel */
+	.map_io		= at91_alt_map_io,
+	.init_early	= at91_dt_initialize,
+	.init_machine	= sama5d4_dt_device_init,
+	.dt_compat	= sama5_alt_dt_board_compat,
+	.l2c_aux_mask	= ~0UL,
+MACHINE_END
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 56+ messages in thread

* [PATCH 02/17] ARM: at91: move sama5 specific code into per-soc files
@ 2015-01-15 21:58   ` Alexandre Belloni
  0 siblings, 0 replies; 56+ messages in thread
From: Alexandre Belloni @ 2015-01-15 21:58 UTC (permalink / raw)
  To: linux-arm-kernel

From: Arnd Bergmann <arnd@arndb.de>

The common board-dt-sama5 file no longer contains any shared
code, so we can just move the machine descriptors into the
per-soc files for further cleanup.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
---
 arch/arm/mach-at91/Makefile         |  3 --
 arch/arm/mach-at91/board-dt-sama5.c | 60 -------------------------------------
 arch/arm/mach-at91/sama5d3.c        | 28 +++++++++++++----
 arch/arm/mach-at91/sama5d4.c        | 33 ++++++++++++++++++--
 4 files changed, 54 insertions(+), 70 deletions(-)
 delete mode 100644 arch/arm/mach-at91/board-dt-sama5.c

diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile
index d89c2437ef10..4bce1fac680e 100644
--- a/arch/arm/mach-at91/Makefile
+++ b/arch/arm/mach-at91/Makefile
@@ -21,9 +21,6 @@ obj-$(CONFIG_SOC_SAMA5D4)	+= sama5d4.o
 # AT91SAM board with device-tree
 obj-$(CONFIG_SOC_AT91SAM9) += board-dt-sam9.o
 
-# SAMA5 board with device-tree
-obj-$(CONFIG_SOC_SAMA5)		+= board-dt-sama5.o
-
 # Power Management
 obj-$(CONFIG_PM)		+= pm.o
 obj-$(CONFIG_AT91_SLOW_CLOCK)	+= pm_slowclock.o
diff --git a/arch/arm/mach-at91/board-dt-sama5.c b/arch/arm/mach-at91/board-dt-sama5.c
deleted file mode 100644
index 44d372a22a29..000000000000
--- a/arch/arm/mach-at91/board-dt-sama5.c
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- *  Setup code for SAMA5 Evaluation Kits with Device Tree support
- *
- *  Copyright (C) 2013 Atmel,
- *                2013 Ludovic Desroches <ludovic.desroches@atmel.com>
- *
- * Licensed under GPLv2 or later.
- */
-
-#include <linux/types.h>
-#include <linux/init.h>
-#include <linux/module.h>
-#include <linux/gpio.h>
-#include <linux/micrel_phy.h>
-#include <linux/of.h>
-#include <linux/of_irq.h>
-#include <linux/of_platform.h>
-#include <linux/phy.h>
-#include <linux/clk-provider.h>
-
-#include <asm/setup.h>
-#include <asm/irq.h>
-#include <asm/mach/arch.h>
-#include <asm/mach/map.h>
-#include <asm/mach/irq.h>
-
-#include "generic.h"
-
-static void __init sama5_dt_device_init(void)
-{
-	at91_sam9260_pm_init();
-	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
-}
-
-static const char *sama5_dt_board_compat[] __initconst = {
-	"atmel,sama5",
-	NULL
-};
-
-DT_MACHINE_START(sama5_dt, "Atmel SAMA5 (Device Tree)")
-	/* Maintainer: Atmel */
-	.map_io		= at91_map_io,
-	.init_early	= at91_dt_initialize,
-	.init_machine	= sama5_dt_device_init,
-	.dt_compat	= sama5_dt_board_compat,
-MACHINE_END
-
-static const char *sama5_alt_dt_board_compat[] __initconst = {
-	"atmel,sama5d4",
-	NULL
-};
-
-DT_MACHINE_START(sama5_alt_dt, "Atmel SAMA5 (Device Tree)")
-	/* Maintainer: Atmel */
-	.map_io		= at91_alt_map_io,
-	.init_early	= at91_dt_initialize,
-	.init_machine	= sama5_dt_device_init,
-	.dt_compat	= sama5_alt_dt_board_compat,
-	.l2c_aux_mask	= ~0UL,
-MACHINE_END
diff --git a/arch/arm/mach-at91/sama5d3.c b/arch/arm/mach-at91/sama5d3.c
index b7c64ca7107f..ecd35f135a9f 100644
--- a/arch/arm/mach-at91/sama5d3.c
+++ b/arch/arm/mach-at91/sama5d3.c
@@ -7,19 +7,18 @@
  * Licensed under GPLv2 or later.
  */
 
-#include <linux/module.h>
-#include <linux/dma-mapping.h>
-#include <linux/clk/at91_pmc.h>
+#include <linux/init.h>
+#include <linux/of_platform.h>
 
-#include <asm/irq.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
+#include <asm/mach/irq.h>
+
 #include <mach/sama5d3.h>
 #include <mach/cpu.h>
 
 #include "soc.h"
 #include "generic.h"
-#include "sam9_smc.h"
 
 /* --------------------------------------------------------------------
  *  AT91SAM9x5 processor initialization
@@ -27,3 +26,22 @@
 
 AT91_SOC_START(sama5d3)
 AT91_SOC_END
+
+static void __init sama5_dt_device_init(void)
+{
+	at91_sam9260_pm_init();
+	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
+}
+
+static const char *sama5_dt_board_compat[] __initconst = {
+	"atmel,sama5",
+	NULL
+};
+
+DT_MACHINE_START(sama5_dt, "Atmel SAMA5 (Device Tree)")
+	/* Maintainer: Atmel */
+	.map_io		= at91_map_io,
+	.init_early	= at91_dt_initialize,
+	.init_machine	= sama5_dt_device_init,
+	.dt_compat	= sama5_dt_board_compat,
+MACHINE_END
diff --git a/arch/arm/mach-at91/sama5d4.c b/arch/arm/mach-at91/sama5d4.c
index fa127fb79221..68573cd9d8f9 100644
--- a/arch/arm/mach-at91/sama5d4.c
+++ b/arch/arm/mach-at91/sama5d4.c
@@ -10,17 +10,27 @@
 #include <linux/module.h>
 #include <linux/dma-mapping.h>
 #include <linux/clk/at91_pmc.h>
+#include <linux/types.h>
+#include <linux/init.h>
+#include <linux/gpio.h>
+#include <linux/micrel_phy.h>
+#include <linux/of.h>
+#include <linux/of_irq.h>
+#include <linux/of_platform.h>
+#include <linux/phy.h>
+#include <linux/clk-provider.h>
 
 #include <asm/irq.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
+#include <asm/mach/irq.h>
+
 #include <mach/sama5d4.h>
 #include <mach/cpu.h>
 #include <mach/hardware.h>
 
 #include "soc.h"
 #include "generic.h"
-#include "sam9_smc.h"
 
 /* --------------------------------------------------------------------
  *  Processor initialization
@@ -52,7 +62,6 @@ static struct map_desc at91_io_desc[] __initdata = {
 	},
 };
 
-
 static void __init sama5d4_map_io(void)
 {
 	iotable_init(at91_io_desc, ARRAY_SIZE(at91_io_desc));
@@ -61,3 +70,23 @@ static void __init sama5d4_map_io(void)
 AT91_SOC_START(sama5d4)
 	.map_io = sama5d4_map_io,
 AT91_SOC_END
+
+static void __init sama5d4_dt_device_init(void)
+{
+	at91_sam9260_pm_init();
+	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
+}
+
+static const char *sama5_alt_dt_board_compat[] __initconst = {
+	"atmel,sama5d4",
+	NULL
+};
+
+DT_MACHINE_START(sama5_alt_dt, "Atmel SAMA5 (Device Tree)")
+	/* Maintainer: Atmel */
+	.map_io		= at91_alt_map_io,
+	.init_early	= at91_dt_initialize,
+	.init_machine	= sama5d4_dt_device_init,
+	.dt_compat	= sama5_alt_dt_board_compat,
+	.l2c_aux_mask	= ~0UL,
+MACHINE_END
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 56+ messages in thread

* [PATCH 03/17] ARM: at91:remove unused mach/system_rev.h
  2015-01-15 21:58 ` Alexandre Belloni
@ 2015-01-15 21:58   ` Alexandre Belloni
  -1 siblings, 0 replies; 56+ messages in thread
From: Alexandre Belloni @ 2015-01-15 21:58 UTC (permalink / raw)
  To: Nicolas Ferre
  Cc: Jean-Christophe Plagniol-Villard, Arnd Bergmann, Boris Brezillon,
	Bo Shen, Wenyou Yang, linux-arm-kernel, linux-kernel,
	Alexandre Belloni

mach/system_rev.h is not used, remove it.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
---
 arch/arm/mach-at91/include/mach/system_rev.h | 27 ---------------------------
 1 file changed, 27 deletions(-)
 delete mode 100644 arch/arm/mach-at91/include/mach/system_rev.h

diff --git a/arch/arm/mach-at91/include/mach/system_rev.h b/arch/arm/mach-at91/include/mach/system_rev.h
deleted file mode 100644
index ef79a9aafc08..000000000000
--- a/arch/arm/mach-at91/include/mach/system_rev.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright (C) 2011 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
- *
- * Under GPLv2 only
- */
-
-#ifndef __ARCH_SYSTEM_REV_H__
-#define __ARCH_SYSTEM_REV_H__
-
-#include <asm/system_info.h>
-
-/*
- * board revision encoding
- * mach specific
- * the 16-31 bit are reserved for at91 generic information
- *
- * bit 31:
- *	0 => nand 8 bit
- *	1 => nand 16 bit
- */
-#define BOARD_HAVE_NAND_16BIT	(1 << 31)
-static inline int board_have_nand_16bit(void)
-{
-	return (system_rev & BOARD_HAVE_NAND_16BIT) ? 1 : 0;
-}
-
-#endif /* __ARCH_SYSTEM_REV_H__ */
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 56+ messages in thread

* [PATCH 03/17] ARM: at91:remove unused mach/system_rev.h
@ 2015-01-15 21:58   ` Alexandre Belloni
  0 siblings, 0 replies; 56+ messages in thread
From: Alexandre Belloni @ 2015-01-15 21:58 UTC (permalink / raw)
  To: linux-arm-kernel

mach/system_rev.h is not used, remove it.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
---
 arch/arm/mach-at91/include/mach/system_rev.h | 27 ---------------------------
 1 file changed, 27 deletions(-)
 delete mode 100644 arch/arm/mach-at91/include/mach/system_rev.h

diff --git a/arch/arm/mach-at91/include/mach/system_rev.h b/arch/arm/mach-at91/include/mach/system_rev.h
deleted file mode 100644
index ef79a9aafc08..000000000000
--- a/arch/arm/mach-at91/include/mach/system_rev.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright (C) 2011 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
- *
- * Under GPLv2 only
- */
-
-#ifndef __ARCH_SYSTEM_REV_H__
-#define __ARCH_SYSTEM_REV_H__
-
-#include <asm/system_info.h>
-
-/*
- * board revision encoding
- * mach specific
- * the 16-31 bit are reserved for at91 generic information
- *
- * bit 31:
- *	0 => nand 8 bit
- *	1 => nand 16 bit
- */
-#define BOARD_HAVE_NAND_16BIT	(1 << 31)
-static inline int board_have_nand_16bit(void)
-{
-	return (system_rev & BOARD_HAVE_NAND_16BIT) ? 1 : 0;
-}
-
-#endif /* __ARCH_SYSTEM_REV_H__ */
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 56+ messages in thread

* [PATCH 04/17] ARM: at91: fix sam9n12 and sam9x5 arm_pm_idle
  2015-01-15 21:58 ` Alexandre Belloni
@ 2015-01-15 21:58   ` Alexandre Belloni
  -1 siblings, 0 replies; 56+ messages in thread
From: Alexandre Belloni @ 2015-01-15 21:58 UTC (permalink / raw)
  To: Nicolas Ferre
  Cc: Jean-Christophe Plagniol-Villard, Arnd Bergmann, Boris Brezillon,
	Bo Shen, Wenyou Yang, linux-arm-kernel, linux-kernel,
	Alexandre Belloni

sam9n12 and sam9x5 don't set arm_pm_idle because of an oversight, fix that.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Suggested-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/arm/mach-at91/at91sam9n12.c | 5 +++++
 arch/arm/mach-at91/at91sam9x5.c  | 6 ++++++
 2 files changed, 11 insertions(+)

diff --git a/arch/arm/mach-at91/at91sam9n12.c b/arch/arm/mach-at91/at91sam9n12.c
index b5ea69a3eaf6..276b8f0e4183 100644
--- a/arch/arm/mach-at91/at91sam9n12.c
+++ b/arch/arm/mach-at91/at91sam9n12.c
@@ -15,6 +15,11 @@
 /* --------------------------------------------------------------------
  *  AT91SAM9N12 processor initialization
  * -------------------------------------------------------------------- */
+static void __init at91sam9n12_initialize(void)
+{
+	arm_pm_idle = at91sam9_idle;
+}
 
 AT91_SOC_START(at91sam9n12)
+	.init = at91sam9n12_initialize,
 AT91_SOC_END
diff --git a/arch/arm/mach-at91/at91sam9x5.c b/arch/arm/mach-at91/at91sam9x5.c
index 7b60a529db01..7b6fb1bca505 100644
--- a/arch/arm/mach-at91/at91sam9x5.c
+++ b/arch/arm/mach-at91/at91sam9x5.c
@@ -16,5 +16,11 @@
  *  AT91SAM9x5 processor initialization
  * -------------------------------------------------------------------- */
 
+static void __init at91sam9x5_initialize(void)
+{
+	arm_pm_idle = at91sam9_idle;
+}
+
 AT91_SOC_START(at91sam9x5)
+	.init = at91sam9x5_initialize,
 AT91_SOC_END
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 56+ messages in thread

* [PATCH 04/17] ARM: at91: fix sam9n12 and sam9x5 arm_pm_idle
@ 2015-01-15 21:58   ` Alexandre Belloni
  0 siblings, 0 replies; 56+ messages in thread
From: Alexandre Belloni @ 2015-01-15 21:58 UTC (permalink / raw)
  To: linux-arm-kernel

sam9n12 and sam9x5 don't set arm_pm_idle because of an oversight, fix that.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Suggested-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/arm/mach-at91/at91sam9n12.c | 5 +++++
 arch/arm/mach-at91/at91sam9x5.c  | 6 ++++++
 2 files changed, 11 insertions(+)

diff --git a/arch/arm/mach-at91/at91sam9n12.c b/arch/arm/mach-at91/at91sam9n12.c
index b5ea69a3eaf6..276b8f0e4183 100644
--- a/arch/arm/mach-at91/at91sam9n12.c
+++ b/arch/arm/mach-at91/at91sam9n12.c
@@ -15,6 +15,11 @@
 /* --------------------------------------------------------------------
  *  AT91SAM9N12 processor initialization
  * -------------------------------------------------------------------- */
+static void __init at91sam9n12_initialize(void)
+{
+	arm_pm_idle = at91sam9_idle;
+}
 
 AT91_SOC_START(at91sam9n12)
+	.init = at91sam9n12_initialize,
 AT91_SOC_END
diff --git a/arch/arm/mach-at91/at91sam9x5.c b/arch/arm/mach-at91/at91sam9x5.c
index 7b60a529db01..7b6fb1bca505 100644
--- a/arch/arm/mach-at91/at91sam9x5.c
+++ b/arch/arm/mach-at91/at91sam9x5.c
@@ -16,5 +16,11 @@
  *  AT91SAM9x5 processor initialization
  * -------------------------------------------------------------------- */
 
+static void __init at91sam9x5_initialize(void)
+{
+	arm_pm_idle = at91sam9_idle;
+}
+
 AT91_SOC_START(at91sam9x5)
+	.init = at91sam9x5_initialize,
 AT91_SOC_END
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 56+ messages in thread

* [PATCH 05/17] ARM: at91: sam9: set arm_pm_idle from sam9_dt_device_init
  2015-01-15 21:58 ` Alexandre Belloni
@ 2015-01-15 21:58   ` Alexandre Belloni
  -1 siblings, 0 replies; 56+ messages in thread
From: Alexandre Belloni @ 2015-01-15 21:58 UTC (permalink / raw)
  To: Nicolas Ferre
  Cc: Jean-Christophe Plagniol-Villard, Arnd Bergmann, Boris Brezillon,
	Bo Shen, Wenyou Yang, linux-arm-kernel, linux-kernel,
	Alexandre Belloni

As all sam9 SoCs are setting arm_pm_idle to at91sam9_idle(), do it from
sam9_dt_device_init().

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Suggested-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/arm/mach-at91/at91sam9260.c   | 6 ------
 arch/arm/mach-at91/at91sam9261.c   | 6 ------
 arch/arm/mach-at91/at91sam9263.c   | 6 ------
 arch/arm/mach-at91/at91sam9g45.c   | 5 -----
 arch/arm/mach-at91/at91sam9rl.c    | 6 ------
 arch/arm/mach-at91/board-dt-sam9.c | 4 ++++
 6 files changed, 4 insertions(+), 29 deletions(-)

diff --git a/arch/arm/mach-at91/at91sam9260.c b/arch/arm/mach-at91/at91sam9260.c
index ab9841c8b0d5..37b7ce4c6a3b 100644
--- a/arch/arm/mach-at91/at91sam9260.c
+++ b/arch/arm/mach-at91/at91sam9260.c
@@ -22,11 +22,5 @@
  *  AT91SAM9260 processor initialization
  * -------------------------------------------------------------------- */
 
-static void __init at91sam9260_initialize(void)
-{
-	arm_pm_idle = at91sam9_idle;
-}
-
 AT91_SOC_START(at91sam9260)
-	.init = at91sam9260_initialize,
 AT91_SOC_END
diff --git a/arch/arm/mach-at91/at91sam9261.c b/arch/arm/mach-at91/at91sam9261.c
index 2029096b93fa..aebbf76b6038 100644
--- a/arch/arm/mach-at91/at91sam9261.c
+++ b/arch/arm/mach-at91/at91sam9261.c
@@ -21,11 +21,5 @@
  *  AT91SAM9261 processor initialization
  * -------------------------------------------------------------------- */
 
-static void __init at91sam9261_initialize(void)
-{
-	arm_pm_idle = at91sam9_idle;
-}
-
 AT91_SOC_START(at91sam9261)
-	.init = at91sam9261_initialize,
 AT91_SOC_END
diff --git a/arch/arm/mach-at91/at91sam9263.c b/arch/arm/mach-at91/at91sam9263.c
index 1fe672a05513..dca29457d9cc 100644
--- a/arch/arm/mach-at91/at91sam9263.c
+++ b/arch/arm/mach-at91/at91sam9263.c
@@ -20,11 +20,5 @@
  *  AT91SAM9263 processor initialization
  * -------------------------------------------------------------------- */
 
-static void __init at91sam9263_initialize(void)
-{
-	arm_pm_idle = at91sam9_idle;
-}
-
 AT91_SOC_START(at91sam9263)
-	.init = at91sam9263_initialize,
 AT91_SOC_END
diff --git a/arch/arm/mach-at91/at91sam9g45.c b/arch/arm/mach-at91/at91sam9g45.c
index f3130501fa75..d77d10cf10f6 100644
--- a/arch/arm/mach-at91/at91sam9g45.c
+++ b/arch/arm/mach-at91/at91sam9g45.c
@@ -20,11 +20,6 @@
 /* --------------------------------------------------------------------
  *  AT91SAM9G45 processor initialization
  * -------------------------------------------------------------------- */
-static void __init at91sam9g45_initialize(void)
-{
-	arm_pm_idle = at91sam9_idle;
-}
 
 AT91_SOC_START(at91sam9g45)
-	.init = at91sam9g45_initialize,
 AT91_SOC_END
diff --git a/arch/arm/mach-at91/at91sam9rl.c b/arch/arm/mach-at91/at91sam9rl.c
index dab3c0d47f96..a585ff3adf96 100644
--- a/arch/arm/mach-at91/at91sam9rl.c
+++ b/arch/arm/mach-at91/at91sam9rl.c
@@ -22,11 +22,5 @@
  *  AT91SAM9RL processor initialization
  * -------------------------------------------------------------------- */
 
-static void __init at91sam9rl_initialize(void)
-{
-	arm_pm_idle = at91sam9_idle;
-}
-
 AT91_SOC_START(at91sam9rl)
-	.init = at91sam9rl_initialize,
 AT91_SOC_END
diff --git a/arch/arm/mach-at91/board-dt-sam9.c b/arch/arm/mach-at91/board-dt-sam9.c
index 0fe1ced608c5..508468d77475 100644
--- a/arch/arm/mach-at91/board-dt-sam9.c
+++ b/arch/arm/mach-at91/board-dt-sam9.c
@@ -26,7 +26,9 @@
 
 static void __init sam9_dt_device_init(void)
 {
+	arm_pm_idle = at91sam9_idle;
 	at91_sam9260_pm_init();
+
 	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 }
 
@@ -45,7 +47,9 @@ MACHINE_END
 
 static void __init sam9g45_dt_device_init(void)
 {
+	arm_pm_idle = at91sam9_idle;
 	at91_sam9g45_pm_init();
+
 	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 }
 
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 56+ messages in thread

* [PATCH 05/17] ARM: at91: sam9: set arm_pm_idle from sam9_dt_device_init
@ 2015-01-15 21:58   ` Alexandre Belloni
  0 siblings, 0 replies; 56+ messages in thread
From: Alexandre Belloni @ 2015-01-15 21:58 UTC (permalink / raw)
  To: linux-arm-kernel

As all sam9 SoCs are setting arm_pm_idle to at91sam9_idle(), do it from
sam9_dt_device_init().

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Suggested-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/arm/mach-at91/at91sam9260.c   | 6 ------
 arch/arm/mach-at91/at91sam9261.c   | 6 ------
 arch/arm/mach-at91/at91sam9263.c   | 6 ------
 arch/arm/mach-at91/at91sam9g45.c   | 5 -----
 arch/arm/mach-at91/at91sam9rl.c    | 6 ------
 arch/arm/mach-at91/board-dt-sam9.c | 4 ++++
 6 files changed, 4 insertions(+), 29 deletions(-)

diff --git a/arch/arm/mach-at91/at91sam9260.c b/arch/arm/mach-at91/at91sam9260.c
index ab9841c8b0d5..37b7ce4c6a3b 100644
--- a/arch/arm/mach-at91/at91sam9260.c
+++ b/arch/arm/mach-at91/at91sam9260.c
@@ -22,11 +22,5 @@
  *  AT91SAM9260 processor initialization
  * -------------------------------------------------------------------- */
 
-static void __init at91sam9260_initialize(void)
-{
-	arm_pm_idle = at91sam9_idle;
-}
-
 AT91_SOC_START(at91sam9260)
-	.init = at91sam9260_initialize,
 AT91_SOC_END
diff --git a/arch/arm/mach-at91/at91sam9261.c b/arch/arm/mach-at91/at91sam9261.c
index 2029096b93fa..aebbf76b6038 100644
--- a/arch/arm/mach-at91/at91sam9261.c
+++ b/arch/arm/mach-at91/at91sam9261.c
@@ -21,11 +21,5 @@
  *  AT91SAM9261 processor initialization
  * -------------------------------------------------------------------- */
 
-static void __init at91sam9261_initialize(void)
-{
-	arm_pm_idle = at91sam9_idle;
-}
-
 AT91_SOC_START(at91sam9261)
-	.init = at91sam9261_initialize,
 AT91_SOC_END
diff --git a/arch/arm/mach-at91/at91sam9263.c b/arch/arm/mach-at91/at91sam9263.c
index 1fe672a05513..dca29457d9cc 100644
--- a/arch/arm/mach-at91/at91sam9263.c
+++ b/arch/arm/mach-at91/at91sam9263.c
@@ -20,11 +20,5 @@
  *  AT91SAM9263 processor initialization
  * -------------------------------------------------------------------- */
 
-static void __init at91sam9263_initialize(void)
-{
-	arm_pm_idle = at91sam9_idle;
-}
-
 AT91_SOC_START(at91sam9263)
-	.init = at91sam9263_initialize,
 AT91_SOC_END
diff --git a/arch/arm/mach-at91/at91sam9g45.c b/arch/arm/mach-at91/at91sam9g45.c
index f3130501fa75..d77d10cf10f6 100644
--- a/arch/arm/mach-at91/at91sam9g45.c
+++ b/arch/arm/mach-at91/at91sam9g45.c
@@ -20,11 +20,6 @@
 /* --------------------------------------------------------------------
  *  AT91SAM9G45 processor initialization
  * -------------------------------------------------------------------- */
-static void __init at91sam9g45_initialize(void)
-{
-	arm_pm_idle = at91sam9_idle;
-}
 
 AT91_SOC_START(at91sam9g45)
-	.init = at91sam9g45_initialize,
 AT91_SOC_END
diff --git a/arch/arm/mach-at91/at91sam9rl.c b/arch/arm/mach-at91/at91sam9rl.c
index dab3c0d47f96..a585ff3adf96 100644
--- a/arch/arm/mach-at91/at91sam9rl.c
+++ b/arch/arm/mach-at91/at91sam9rl.c
@@ -22,11 +22,5 @@
  *  AT91SAM9RL processor initialization
  * -------------------------------------------------------------------- */
 
-static void __init at91sam9rl_initialize(void)
-{
-	arm_pm_idle = at91sam9_idle;
-}
-
 AT91_SOC_START(at91sam9rl)
-	.init = at91sam9rl_initialize,
 AT91_SOC_END
diff --git a/arch/arm/mach-at91/board-dt-sam9.c b/arch/arm/mach-at91/board-dt-sam9.c
index 0fe1ced608c5..508468d77475 100644
--- a/arch/arm/mach-at91/board-dt-sam9.c
+++ b/arch/arm/mach-at91/board-dt-sam9.c
@@ -26,7 +26,9 @@
 
 static void __init sam9_dt_device_init(void)
 {
+	arm_pm_idle = at91sam9_idle;
 	at91_sam9260_pm_init();
+
 	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 }
 
@@ -45,7 +47,9 @@ MACHINE_END
 
 static void __init sam9g45_dt_device_init(void)
 {
+	arm_pm_idle = at91sam9_idle;
 	at91_sam9g45_pm_init();
+
 	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 }
 
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 56+ messages in thread

* [PATCH 06/17] ARM: at91: remove unused at91_ioremap_matrix and header
  2015-01-15 21:58 ` Alexandre Belloni
@ 2015-01-15 21:58   ` Alexandre Belloni
  -1 siblings, 0 replies; 56+ messages in thread
From: Alexandre Belloni @ 2015-01-15 21:58 UTC (permalink / raw)
  To: Nicolas Ferre
  Cc: Jean-Christophe Plagniol-Villard, Arnd Bergmann, Boris Brezillon,
	Bo Shen, Wenyou Yang, linux-arm-kernel, linux-kernel,
	Alexandre Belloni

at91_ioremap_matrix and the at91_matrix.h header are not used anymore, remove
them.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
---
 arch/arm/mach-at91/generic.h                  |  4 ----
 arch/arm/mach-at91/include/mach/at91_matrix.h | 23 -----------------------
 arch/arm/mach-at91/setup.c                    | 10 ----------
 3 files changed, 37 deletions(-)
 delete mode 100644 arch/arm/mach-at91/include/mach/at91_matrix.h

diff --git a/arch/arm/mach-at91/generic.h b/arch/arm/mach-at91/generic.h
index 44fc725edcf1..1e60faec2eba 100644
--- a/arch/arm/mach-at91/generic.h
+++ b/arch/arm/mach-at91/generic.h
@@ -28,10 +28,6 @@ extern void at91rm9200_timer_init(void);
 extern void at91rm9200_idle(void);
 extern void at91sam9_idle(void);
 
-/* Matrix */
-extern void at91_ioremap_matrix(u32 base_addr);
-
-
 #ifdef CONFIG_PM
 extern void __init at91_rm9200_pm_init(void);
 extern void __init at91_sam9260_pm_init(void);
diff --git a/arch/arm/mach-at91/include/mach/at91_matrix.h b/arch/arm/mach-at91/include/mach/at91_matrix.h
deleted file mode 100644
index f8996c954131..000000000000
--- a/arch/arm/mach-at91/include/mach/at91_matrix.h
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright (C) 2011 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
- *
- * Under GPLv2
- */
-
-#ifndef __MACH_AT91_MATRIX_H__
-#define __MACH_AT91_MATRIX_H__
-
-#ifndef __ASSEMBLY__
-extern void __iomem *at91_matrix_base;
-
-#define at91_matrix_read(field) \
-	__raw_readl(at91_matrix_base + field)
-
-#define at91_matrix_write(field, value) \
-	__raw_writel(value, at91_matrix_base + field)
-
-#else
-.extern at91_matrix_base
-#endif
-
-#endif /* __MACH_AT91_MATRIX_H__ */
diff --git a/arch/arm/mach-at91/setup.c b/arch/arm/mach-at91/setup.c
index 4c184285d38f..88649dee830e 100644
--- a/arch/arm/mach-at91/setup.c
+++ b/arch/arm/mach-at91/setup.c
@@ -351,16 +351,6 @@ void __init at91_alt_map_io(void)
 		at91_boot_soc.map_io();
 }
 
-void __iomem *at91_matrix_base;
-EXPORT_SYMBOL_GPL(at91_matrix_base);
-
-void __init at91_ioremap_matrix(u32 base_addr)
-{
-	at91_matrix_base = ioremap(base_addr, 512);
-	if (!at91_matrix_base)
-		panic(pr_fmt("Impossible to ioremap at91_matrix_base\n"));
-}
-
 static struct of_device_id ramc_ids[] = {
 	{ .compatible = "atmel,at91rm9200-sdramc", .data = at91rm9200_standby },
 	{ .compatible = "atmel,at91sam9260-sdramc", .data = at91sam9_sdram_standby },
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 56+ messages in thread

* [PATCH 06/17] ARM: at91: remove unused at91_ioremap_matrix and header
@ 2015-01-15 21:58   ` Alexandre Belloni
  0 siblings, 0 replies; 56+ messages in thread
From: Alexandre Belloni @ 2015-01-15 21:58 UTC (permalink / raw)
  To: linux-arm-kernel

at91_ioremap_matrix and the at91_matrix.h header are not used anymore, remove
them.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
---
 arch/arm/mach-at91/generic.h                  |  4 ----
 arch/arm/mach-at91/include/mach/at91_matrix.h | 23 -----------------------
 arch/arm/mach-at91/setup.c                    | 10 ----------
 3 files changed, 37 deletions(-)
 delete mode 100644 arch/arm/mach-at91/include/mach/at91_matrix.h

diff --git a/arch/arm/mach-at91/generic.h b/arch/arm/mach-at91/generic.h
index 44fc725edcf1..1e60faec2eba 100644
--- a/arch/arm/mach-at91/generic.h
+++ b/arch/arm/mach-at91/generic.h
@@ -28,10 +28,6 @@ extern void at91rm9200_timer_init(void);
 extern void at91rm9200_idle(void);
 extern void at91sam9_idle(void);
 
-/* Matrix */
-extern void at91_ioremap_matrix(u32 base_addr);
-
-
 #ifdef CONFIG_PM
 extern void __init at91_rm9200_pm_init(void);
 extern void __init at91_sam9260_pm_init(void);
diff --git a/arch/arm/mach-at91/include/mach/at91_matrix.h b/arch/arm/mach-at91/include/mach/at91_matrix.h
deleted file mode 100644
index f8996c954131..000000000000
--- a/arch/arm/mach-at91/include/mach/at91_matrix.h
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright (C) 2011 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
- *
- * Under GPLv2
- */
-
-#ifndef __MACH_AT91_MATRIX_H__
-#define __MACH_AT91_MATRIX_H__
-
-#ifndef __ASSEMBLY__
-extern void __iomem *at91_matrix_base;
-
-#define at91_matrix_read(field) \
-	__raw_readl(at91_matrix_base + field)
-
-#define at91_matrix_write(field, value) \
-	__raw_writel(value, at91_matrix_base + field)
-
-#else
-.extern at91_matrix_base
-#endif
-
-#endif /* __MACH_AT91_MATRIX_H__ */
diff --git a/arch/arm/mach-at91/setup.c b/arch/arm/mach-at91/setup.c
index 4c184285d38f..88649dee830e 100644
--- a/arch/arm/mach-at91/setup.c
+++ b/arch/arm/mach-at91/setup.c
@@ -351,16 +351,6 @@ void __init at91_alt_map_io(void)
 		at91_boot_soc.map_io();
 }
 
-void __iomem *at91_matrix_base;
-EXPORT_SYMBOL_GPL(at91_matrix_base);
-
-void __init at91_ioremap_matrix(u32 base_addr)
-{
-	at91_matrix_base = ioremap(base_addr, 512);
-	if (!at91_matrix_base)
-		panic(pr_fmt("Impossible to ioremap at91_matrix_base\n"));
-}
-
 static struct of_device_id ramc_ids[] = {
 	{ .compatible = "atmel,at91rm9200-sdramc", .data = at91rm9200_standby },
 	{ .compatible = "atmel,at91sam9260-sdramc", .data = at91sam9_sdram_standby },
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 56+ messages in thread

* [PATCH 07/17] ARM: at91: remove unused _matrix.h headers
  2015-01-15 21:58 ` Alexandre Belloni
@ 2015-01-15 21:58   ` Alexandre Belloni
  -1 siblings, 0 replies; 56+ messages in thread
From: Alexandre Belloni @ 2015-01-15 21:58 UTC (permalink / raw)
  To: Nicolas Ferre
  Cc: Jean-Christophe Plagniol-Villard, Arnd Bergmann, Boris Brezillon,
	Bo Shen, Wenyou Yang, linux-arm-kernel, linux-kernel,
	Alexandre Belloni

The matrix headers are not used anymore, remove them.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
---
 .../mach-at91/include/mach/at91sam9260_matrix.h    |  80 -----------
 .../mach-at91/include/mach/at91sam9261_matrix.h    |  64 ---------
 .../mach-at91/include/mach/at91sam9263_matrix.h    | 129 -----------------
 .../mach-at91/include/mach/at91sam9g45_matrix.h    | 153 ---------------------
 .../mach-at91/include/mach/at91sam9n12_matrix.h    |  53 -------
 .../arm/mach-at91/include/mach/at91sam9rl_matrix.h |  96 -------------
 .../arm/mach-at91/include/mach/at91sam9x5_matrix.h |  53 -------
 7 files changed, 628 deletions(-)
 delete mode 100644 arch/arm/mach-at91/include/mach/at91sam9260_matrix.h
 delete mode 100644 arch/arm/mach-at91/include/mach/at91sam9261_matrix.h
 delete mode 100644 arch/arm/mach-at91/include/mach/at91sam9263_matrix.h
 delete mode 100644 arch/arm/mach-at91/include/mach/at91sam9g45_matrix.h
 delete mode 100644 arch/arm/mach-at91/include/mach/at91sam9n12_matrix.h
 delete mode 100644 arch/arm/mach-at91/include/mach/at91sam9rl_matrix.h
 delete mode 100644 arch/arm/mach-at91/include/mach/at91sam9x5_matrix.h

diff --git a/arch/arm/mach-at91/include/mach/at91sam9260_matrix.h b/arch/arm/mach-at91/include/mach/at91sam9260_matrix.h
deleted file mode 100644
index f459df420629..000000000000
--- a/arch/arm/mach-at91/include/mach/at91sam9260_matrix.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * arch/arm/mach-at91/include/mach/at91sam9260_matrix.h
- *
- *  Copyright (C) 2007 Atmel Corporation.
- *
- * Memory Controllers (MATRIX, EBI) - System peripherals registers.
- * Based on AT91SAM9260 datasheet revision B.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- */
-
-#ifndef AT91SAM9260_MATRIX_H
-#define AT91SAM9260_MATRIX_H
-
-#define AT91_MATRIX_MCFG0	0x00			/* Master Configuration Register 0 */
-#define AT91_MATRIX_MCFG1	0x04			/* Master Configuration Register 1 */
-#define AT91_MATRIX_MCFG2	0x08			/* Master Configuration Register 2 */
-#define AT91_MATRIX_MCFG3	0x0C			/* Master Configuration Register 3 */
-#define AT91_MATRIX_MCFG4	0x10			/* Master Configuration Register 4 */
-#define AT91_MATRIX_MCFG5	0x14			/* Master Configuration Register 5 */
-#define		AT91_MATRIX_ULBT		(7 << 0)	/* Undefined Length Burst Type */
-#define			AT91_MATRIX_ULBT_INFINITE	(0 << 0)
-#define			AT91_MATRIX_ULBT_SINGLE		(1 << 0)
-#define			AT91_MATRIX_ULBT_FOUR		(2 << 0)
-#define			AT91_MATRIX_ULBT_EIGHT		(3 << 0)
-#define			AT91_MATRIX_ULBT_SIXTEEN	(4 << 0)
-
-#define AT91_MATRIX_SCFG0	0x40			/* Slave Configuration Register 0 */
-#define AT91_MATRIX_SCFG1	0x44			/* Slave Configuration Register 1 */
-#define AT91_MATRIX_SCFG2	0x48			/* Slave Configuration Register 2 */
-#define AT91_MATRIX_SCFG3	0x4C			/* Slave Configuration Register 3 */
-#define AT91_MATRIX_SCFG4	0x50			/* Slave Configuration Register 4 */
-#define		AT91_MATRIX_SLOT_CYCLE		(0xff <<  0)	/* Maximum Number of Allowed Cycles for a Burst */
-#define		AT91_MATRIX_DEFMSTR_TYPE	(3    << 16)	/* Default Master Type */
-#define			AT91_MATRIX_DEFMSTR_TYPE_NONE	(0 << 16)
-#define			AT91_MATRIX_DEFMSTR_TYPE_LAST	(1 << 16)
-#define			AT91_MATRIX_DEFMSTR_TYPE_FIXED	(2 << 16)
-#define		AT91_MATRIX_FIXED_DEFMSTR	(7    << 18)	/* Fixed Index of Default Master */
-#define		AT91_MATRIX_ARBT		(3    << 24)	/* Arbitration Type */
-#define			AT91_MATRIX_ARBT_ROUND_ROBIN	(0 << 24)
-#define			AT91_MATRIX_ARBT_FIXED_PRIORITY	(1 << 24)
-
-#define AT91_MATRIX_PRAS0	0x80			/* Priority Register A for Slave 0 */
-#define AT91_MATRIX_PRAS1	0x88			/* Priority Register A for Slave 1 */
-#define AT91_MATRIX_PRAS2	0x90			/* Priority Register A for Slave 2 */
-#define AT91_MATRIX_PRAS3	0x98			/* Priority Register A for Slave 3 */
-#define AT91_MATRIX_PRAS4	0xA0			/* Priority Register A for Slave 4 */
-#define		AT91_MATRIX_M0PR		(3 << 0)	/* Master 0 Priority */
-#define		AT91_MATRIX_M1PR		(3 << 4)	/* Master 1 Priority */
-#define		AT91_MATRIX_M2PR		(3 << 8)	/* Master 2 Priority */
-#define		AT91_MATRIX_M3PR		(3 << 12)	/* Master 3 Priority */
-#define		AT91_MATRIX_M4PR		(3 << 16)	/* Master 4 Priority */
-#define		AT91_MATRIX_M5PR		(3 << 20)	/* Master 5 Priority */
-
-#define AT91_MATRIX_MRCR	0x100			/* Master Remap Control Register */
-#define		AT91_MATRIX_RCB0		(1 << 0)	/* Remap Command for AHB Master 0 (ARM926EJ-S Instruction Master) */
-#define		AT91_MATRIX_RCB1		(1 << 1)	/* Remap Command for AHB Master 1 (ARM926EJ-S Data Master) */
-
-#define AT91_MATRIX_EBICSA	0x11C			/* EBI Chip Select Assignment Register */
-#define		AT91_MATRIX_CS1A		(1 << 1)	/* Chip Select 1 Assignment */
-#define			AT91_MATRIX_CS1A_SMC		(0 << 1)
-#define			AT91_MATRIX_CS1A_SDRAMC		(1 << 1)
-#define		AT91_MATRIX_CS3A		(1 << 3)	/* Chip Select 3 Assignment */
-#define			AT91_MATRIX_CS3A_SMC		(0 << 3)
-#define			AT91_MATRIX_CS3A_SMC_SMARTMEDIA	(1 << 3)
-#define		AT91_MATRIX_CS4A		(1 << 4)	/* Chip Select 4 Assignment */
-#define			AT91_MATRIX_CS4A_SMC		(0 << 4)
-#define			AT91_MATRIX_CS4A_SMC_CF1	(1 << 4)
-#define		AT91_MATRIX_CS5A		(1 << 5)	/* Chip Select 5 Assignment */
-#define			AT91_MATRIX_CS5A_SMC		(0 << 5)
-#define			AT91_MATRIX_CS5A_SMC_CF2	(1 << 5)
-#define		AT91_MATRIX_DBPUC		(1 << 8)	/* Data Bus Pull-up Configuration */
-#define		AT91_MATRIX_VDDIOMSEL		(1 << 16)	/* Memory voltage selection */
-#define			AT91_MATRIX_VDDIOMSEL_1_8V	(0 << 16)
-#define			AT91_MATRIX_VDDIOMSEL_3_3V	(1 << 16)
-
-#endif
diff --git a/arch/arm/mach-at91/include/mach/at91sam9261_matrix.h b/arch/arm/mach-at91/include/mach/at91sam9261_matrix.h
deleted file mode 100644
index a50cdf8b8ca4..000000000000
--- a/arch/arm/mach-at91/include/mach/at91sam9261_matrix.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * arch/arm/mach-at91/include/mach/at91sam9261_matrix.h
- *
- *  Copyright (C) 2007 Atmel Corporation.
- *
- * Memory Controllers (MATRIX, EBI) - System peripherals registers.
- * Based on AT91SAM9261 datasheet revision D.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- */
-
-#ifndef AT91SAM9261_MATRIX_H
-#define AT91SAM9261_MATRIX_H
-
-#define AT91_MATRIX_MCFG	0x00			/* Master Configuration Register */
-#define		AT91_MATRIX_RCB0	(1 << 0)		/* Remap Command for AHB Master 0 (ARM926EJ-S Instruction Master) */
-#define		AT91_MATRIX_RCB1	(1 << 1)		/* Remap Command for AHB Master 1 (ARM926EJ-S Data Master) */
-
-#define AT91_MATRIX_SCFG0	0x04			/* Slave Configuration Register 0 */
-#define AT91_MATRIX_SCFG1	0x08			/* Slave Configuration Register 1 */
-#define AT91_MATRIX_SCFG2	0x0C			/* Slave Configuration Register 2 */
-#define AT91_MATRIX_SCFG3	0x10			/* Slave Configuration Register 3 */
-#define AT91_MATRIX_SCFG4	0x14			/* Slave Configuration Register 4 */
-#define		AT91_MATRIX_SLOT_CYCLE		(0xff << 0)	/* Maximum Number of Allowed Cycles for a Burst */
-#define		AT91_MATRIX_DEFMSTR_TYPE	(3    << 16)	/* Default Master Type */
-#define			AT91_MATRIX_DEFMSTR_TYPE_NONE	(0 << 16)
-#define			AT91_MATRIX_DEFMSTR_TYPE_LAST	(1 << 16)
-#define			AT91_MATRIX_DEFMSTR_TYPE_FIXED	(2 << 16)
-#define		AT91_MATRIX_FIXED_DEFMSTR	(7    << 18)	/* Fixed Index of Default Master */
-
-#define AT91_MATRIX_TCR		0x24			/* TCM Configuration Register */
-#define		AT91_MATRIX_ITCM_SIZE		(0xf << 0)	/* Size of ITCM enabled memory block */
-#define			AT91_MATRIX_ITCM_0		(0 << 0)
-#define			AT91_MATRIX_ITCM_16		(5 << 0)
-#define			AT91_MATRIX_ITCM_32		(6 << 0)
-#define			AT91_MATRIX_ITCM_64		(7 << 0)
-#define		AT91_MATRIX_DTCM_SIZE		(0xf << 4)	/* Size of DTCM enabled memory block */
-#define			AT91_MATRIX_DTCM_0		(0 << 4)
-#define			AT91_MATRIX_DTCM_16		(5 << 4)
-#define			AT91_MATRIX_DTCM_32		(6 << 4)
-#define			AT91_MATRIX_DTCM_64		(7 << 4)
-
-#define AT91_MATRIX_EBICSA	0x30			/* EBI Chip Select Assignment Register */
-#define		AT91_MATRIX_CS1A		(1 << 1)	/* Chip Select 1 Assignment */
-#define			AT91_MATRIX_CS1A_SMC		(0 << 1)
-#define			AT91_MATRIX_CS1A_SDRAMC		(1 << 1)
-#define		AT91_MATRIX_CS3A		(1 << 3)	/* Chip Select 3 Assignment */
-#define			AT91_MATRIX_CS3A_SMC		(0 << 3)
-#define			AT91_MATRIX_CS3A_SMC_SMARTMEDIA	(1 << 3)
-#define		AT91_MATRIX_CS4A		(1 << 4)	/* Chip Select 4 Assignment */
-#define			AT91_MATRIX_CS4A_SMC		(0 << 4)
-#define			AT91_MATRIX_CS4A_SMC_CF1	(1 << 4)
-#define		AT91_MATRIX_CS5A		(1 << 5)	/* Chip Select 5 Assignment */
-#define			AT91_MATRIX_CS5A_SMC		(0 << 5)
-#define			AT91_MATRIX_CS5A_SMC_CF2	(1 << 5)
-#define		AT91_MATRIX_DBPUC		(1 << 8)	/* Data Bus Pull-up Configuration */
-
-#define AT91_MATRIX_USBPUCR	0x34			/* USB Pad Pull-Up Control Register */
-#define		AT91_MATRIX_USBPUCR_PUON	(1 << 30)	/* USB Device PAD Pull-up Enable */
-
-#endif
diff --git a/arch/arm/mach-at91/include/mach/at91sam9263_matrix.h b/arch/arm/mach-at91/include/mach/at91sam9263_matrix.h
deleted file mode 100644
index ebb5fdb565e0..000000000000
--- a/arch/arm/mach-at91/include/mach/at91sam9263_matrix.h
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * arch/arm/mach-at91/include/mach/at91sam9263_matrix.h
- *
- *  Copyright (C) 2006 Atmel Corporation.
- *
- * Memory Controllers (MATRIX, EBI) - System peripherals registers.
- * Based on AT91SAM9263 datasheet revision B (Preliminary).
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- */
-
-#ifndef AT91SAM9263_MATRIX_H
-#define AT91SAM9263_MATRIX_H
-
-#define AT91_MATRIX_MCFG0	0x00			/* Master Configuration Register 0 */
-#define AT91_MATRIX_MCFG1	0x04			/* Master Configuration Register 1 */
-#define AT91_MATRIX_MCFG2	0x08			/* Master Configuration Register 2 */
-#define AT91_MATRIX_MCFG3	0x0C			/* Master Configuration Register 3 */
-#define AT91_MATRIX_MCFG4	0x10			/* Master Configuration Register 4 */
-#define AT91_MATRIX_MCFG5	0x14			/* Master Configuration Register 5 */
-#define AT91_MATRIX_MCFG6	0x18			/* Master Configuration Register 6 */
-#define AT91_MATRIX_MCFG7	0x1C			/* Master Configuration Register 7 */
-#define AT91_MATRIX_MCFG8	0x20			/* Master Configuration Register 8 */
-#define		AT91_MATRIX_ULBT	(7 << 0)	/* Undefined Length Burst Type */
-#define			AT91_MATRIX_ULBT_INFINITE	(0 << 0)
-#define			AT91_MATRIX_ULBT_SINGLE		(1 << 0)
-#define			AT91_MATRIX_ULBT_FOUR		(2 << 0)
-#define			AT91_MATRIX_ULBT_EIGHT		(3 << 0)
-#define			AT91_MATRIX_ULBT_SIXTEEN	(4 << 0)
-
-#define AT91_MATRIX_SCFG0	0x40			/* Slave Configuration Register 0 */
-#define AT91_MATRIX_SCFG1	0x44			/* Slave Configuration Register 1 */
-#define AT91_MATRIX_SCFG2	0x48			/* Slave Configuration Register 2 */
-#define AT91_MATRIX_SCFG3	0x4C			/* Slave Configuration Register 3 */
-#define AT91_MATRIX_SCFG4	0x50			/* Slave Configuration Register 4 */
-#define AT91_MATRIX_SCFG5	0x54			/* Slave Configuration Register 5 */
-#define AT91_MATRIX_SCFG6	0x58			/* Slave Configuration Register 6 */
-#define AT91_MATRIX_SCFG7	0x5C			/* Slave Configuration Register 7 */
-#define		AT91_MATRIX_SLOT_CYCLE		(0xff << 0)	/* Maximum Number of Allowed Cycles for a Burst */
-#define		AT91_MATRIX_DEFMSTR_TYPE	(3    << 16)	/* Default Master Type */
-#define			AT91_MATRIX_DEFMSTR_TYPE_NONE	(0 << 16)
-#define			AT91_MATRIX_DEFMSTR_TYPE_LAST	(1 << 16)
-#define			AT91_MATRIX_DEFMSTR_TYPE_FIXED	(2 << 16)
-#define		AT91_MATRIX_FIXED_DEFMSTR	(0xf  << 18)	/* Fixed Index of Default Master */
-#define		AT91_MATRIX_ARBT		(3    << 24)	/* Arbitration Type */
-#define			AT91_MATRIX_ARBT_ROUND_ROBIN	(0 << 24)
-#define			AT91_MATRIX_ARBT_FIXED_PRIORITY	(1 << 24)
-
-#define AT91_MATRIX_PRAS0	0x80			/* Priority Register A for Slave 0 */
-#define AT91_MATRIX_PRBS0	0x84			/* Priority Register B for Slave 0 */
-#define AT91_MATRIX_PRAS1	0x88			/* Priority Register A for Slave 1 */
-#define AT91_MATRIX_PRBS1	0x8C			/* Priority Register B for Slave 1 */
-#define AT91_MATRIX_PRAS2	0x90			/* Priority Register A for Slave 2 */
-#define AT91_MATRIX_PRBS2	0x94			/* Priority Register B for Slave 2 */
-#define AT91_MATRIX_PRAS3	0x98			/* Priority Register A for Slave 3 */
-#define AT91_MATRIX_PRBS3	0x9C			/* Priority Register B for Slave 3 */
-#define AT91_MATRIX_PRAS4	0xA0			/* Priority Register A for Slave 4 */
-#define AT91_MATRIX_PRBS4	0xA4			/* Priority Register B for Slave 4 */
-#define AT91_MATRIX_PRAS5	0xA8			/* Priority Register A for Slave 5 */
-#define AT91_MATRIX_PRBS5	0xAC			/* Priority Register B for Slave 5 */
-#define AT91_MATRIX_PRAS6	0xB0			/* Priority Register A for Slave 6 */
-#define AT91_MATRIX_PRBS6	0xB4			/* Priority Register B for Slave 6 */
-#define AT91_MATRIX_PRAS7	0xB8			/* Priority Register A for Slave 7 */
-#define AT91_MATRIX_PRBS7	0xBC			/* Priority Register B for Slave 7 */
-#define		AT91_MATRIX_M0PR		(3 << 0)	/* Master 0 Priority */
-#define		AT91_MATRIX_M1PR		(3 << 4)	/* Master 1 Priority */
-#define		AT91_MATRIX_M2PR		(3 << 8)	/* Master 2 Priority */
-#define		AT91_MATRIX_M3PR		(3 << 12)	/* Master 3 Priority */
-#define		AT91_MATRIX_M4PR		(3 << 16)	/* Master 4 Priority */
-#define		AT91_MATRIX_M5PR		(3 << 20)	/* Master 5 Priority */
-#define		AT91_MATRIX_M6PR		(3 << 24)	/* Master 6 Priority */
-#define		AT91_MATRIX_M7PR		(3 << 28)	/* Master 7 Priority */
-#define		AT91_MATRIX_M8PR		(3 << 0)	/* Master 8 Priority (in Register B) */
-
-#define AT91_MATRIX_MRCR	0x100			/* Master Remap Control Register */
-#define		AT91_MATRIX_RCB0		(1 << 0)	/* Remap Command for AHB Master 0 (ARM926EJ-S Instruction Master) */
-#define		AT91_MATRIX_RCB1		(1 << 1)	/* Remap Command for AHB Master 1 (ARM926EJ-S Data Master) */
-#define		AT91_MATRIX_RCB2		(1 << 2)
-#define		AT91_MATRIX_RCB3		(1 << 3)
-#define		AT91_MATRIX_RCB4		(1 << 4)
-#define		AT91_MATRIX_RCB5		(1 << 5)
-#define		AT91_MATRIX_RCB6		(1 << 6)
-#define		AT91_MATRIX_RCB7		(1 << 7)
-#define		AT91_MATRIX_RCB8		(1 << 8)
-
-#define AT91_MATRIX_TCMR	0x114			/* TCM Configuration Register */
-#define		AT91_MATRIX_ITCM_SIZE		(0xf << 0)	/* Size of ITCM enabled memory block */
-#define			AT91_MATRIX_ITCM_0		(0 << 0)
-#define			AT91_MATRIX_ITCM_16		(5 << 0)
-#define			AT91_MATRIX_ITCM_32		(6 << 0)
-#define		AT91_MATRIX_DTCM_SIZE		(0xf << 4)	/* Size of DTCM enabled memory block */
-#define			AT91_MATRIX_DTCM_0		(0 << 4)
-#define			AT91_MATRIX_DTCM_16		(5 << 4)
-#define			AT91_MATRIX_DTCM_32		(6 << 4)
-
-#define AT91_MATRIX_EBI0CSA	0x120			/* EBI0 Chip Select Assignment Register */
-#define		AT91_MATRIX_EBI0_CS1A		(1 << 1)	/* Chip Select 1 Assignment */
-#define			AT91_MATRIX_EBI0_CS1A_SMC		(0 << 1)
-#define			AT91_MATRIX_EBI0_CS1A_SDRAMC		(1 << 1)
-#define		AT91_MATRIX_EBI0_CS3A		(1 << 3)	/* Chip Select 3 Assignment */
-#define			AT91_MATRIX_EBI0_CS3A_SMC		(0 << 3)
-#define			AT91_MATRIX_EBI0_CS3A_SMC_SMARTMEDIA	(1 << 3)
-#define		AT91_MATRIX_EBI0_CS4A		(1 << 4)	/* Chip Select 4 Assignment */
-#define			AT91_MATRIX_EBI0_CS4A_SMC		(0 << 4)
-#define			AT91_MATRIX_EBI0_CS4A_SMC_CF1		(1 << 4)
-#define		AT91_MATRIX_EBI0_CS5A		(1 << 5)	/* Chip Select 5 Assignment */
-#define			AT91_MATRIX_EBI0_CS5A_SMC		(0 << 5)
-#define			AT91_MATRIX_EBI0_CS5A_SMC_CF2		(1 << 5)
-#define		AT91_MATRIX_EBI0_DBPUC		(1 << 8)	/* Data Bus Pull-up Configuration */
-#define		AT91_MATRIX_EBI0_VDDIOMSEL	(1 << 16)	/* Memory voltage selection */
-#define			AT91_MATRIX_EBI0_VDDIOMSEL_1_8V		(0 << 16)
-#define			AT91_MATRIX_EBI0_VDDIOMSEL_3_3V		(1 << 16)
-
-#define AT91_MATRIX_EBI1CSA	0x124			/* EBI1 Chip Select Assignment Register */
-#define		AT91_MATRIX_EBI1_CS1A		(1 << 1)	/* Chip Select 1 Assignment */
-#define			AT91_MATRIX_EBI1_CS1A_SMC		(0 << 1)
-#define			AT91_MATRIX_EBI1_CS1A_SDRAMC		(1 << 1)
-#define		AT91_MATRIX_EBI1_CS2A		(1 << 3)	/* Chip Select 3 Assignment */
-#define			AT91_MATRIX_EBI1_CS2A_SMC		(0 << 3)
-#define			AT91_MATRIX_EBI1_CS2A_SMC_SMARTMEDIA	(1 << 3)
-#define		AT91_MATRIX_EBI1_DBPUC		(1 << 8)	/* Data Bus Pull-up Configuration */
-#define		AT91_MATRIX_EBI1_VDDIOMSEL	(1 << 16)	/* Memory voltage selection */
-#define			AT91_MATRIX_EBI1_VDDIOMSEL_1_8V		(0 << 16)
-#define			AT91_MATRIX_EBI1_VDDIOMSEL_3_3V		(1 << 16)
-
-#endif
diff --git a/arch/arm/mach-at91/include/mach/at91sam9g45_matrix.h b/arch/arm/mach-at91/include/mach/at91sam9g45_matrix.h
deleted file mode 100644
index b76e2ed2fbc2..000000000000
--- a/arch/arm/mach-at91/include/mach/at91sam9g45_matrix.h
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * Matrix-centric header file for the AT91SAM9G45 family
- *
- *  Copyright (C) 2008-2009 Atmel Corporation.
- *
- * Memory Controllers (MATRIX, EBI) - System peripherals registers.
- * Based on AT91SAM9G45 preliminary datasheet.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- */
-
-#ifndef AT91SAM9G45_MATRIX_H
-#define AT91SAM9G45_MATRIX_H
-
-#define AT91_MATRIX_MCFG0	0x00			/* Master Configuration Register 0 */
-#define AT91_MATRIX_MCFG1	0x04			/* Master Configuration Register 1 */
-#define AT91_MATRIX_MCFG2	0x08			/* Master Configuration Register 2 */
-#define AT91_MATRIX_MCFG3	0x0C			/* Master Configuration Register 3 */
-#define AT91_MATRIX_MCFG4	0x10			/* Master Configuration Register 4 */
-#define AT91_MATRIX_MCFG5	0x14			/* Master Configuration Register 5 */
-#define AT91_MATRIX_MCFG6	0x18			/* Master Configuration Register 6 */
-#define AT91_MATRIX_MCFG7	0x1C			/* Master Configuration Register 7 */
-#define AT91_MATRIX_MCFG8	0x20			/* Master Configuration Register 8 */
-#define AT91_MATRIX_MCFG9	0x24			/* Master Configuration Register 9 */
-#define AT91_MATRIX_MCFG10	0x28			/* Master Configuration Register 10 */
-#define AT91_MATRIX_MCFG11	0x2C			/* Master Configuration Register 11 */
-#define		AT91_MATRIX_ULBT	(7 << 0)	/* Undefined Length Burst Type */
-#define			AT91_MATRIX_ULBT_INFINITE	(0 << 0)
-#define			AT91_MATRIX_ULBT_SINGLE		(1 << 0)
-#define			AT91_MATRIX_ULBT_FOUR		(2 << 0)
-#define			AT91_MATRIX_ULBT_EIGHT		(3 << 0)
-#define			AT91_MATRIX_ULBT_SIXTEEN	(4 << 0)
-#define			AT91_MATRIX_ULBT_THIRTYTWO	(5 << 0)
-#define			AT91_MATRIX_ULBT_SIXTYFOUR	(6 << 0)
-#define			AT91_MATRIX_ULBT_128		(7 << 0)
-
-#define AT91_MATRIX_SCFG0	0x40			/* Slave Configuration Register 0 */
-#define AT91_MATRIX_SCFG1	0x44			/* Slave Configuration Register 1 */
-#define AT91_MATRIX_SCFG2	0x48			/* Slave Configuration Register 2 */
-#define AT91_MATRIX_SCFG3	0x4C			/* Slave Configuration Register 3 */
-#define AT91_MATRIX_SCFG4	0x50			/* Slave Configuration Register 4 */
-#define AT91_MATRIX_SCFG5	0x54			/* Slave Configuration Register 5 */
-#define AT91_MATRIX_SCFG6	0x58			/* Slave Configuration Register 6 */
-#define AT91_MATRIX_SCFG7	0x5C			/* Slave Configuration Register 7 */
-#define		AT91_MATRIX_SLOT_CYCLE		(0x1ff << 0)	/* Maximum Number of Allowed Cycles for a Burst */
-#define		AT91_MATRIX_DEFMSTR_TYPE	(3    << 16)	/* Default Master Type */
-#define			AT91_MATRIX_DEFMSTR_TYPE_NONE	(0 << 16)
-#define			AT91_MATRIX_DEFMSTR_TYPE_LAST	(1 << 16)
-#define			AT91_MATRIX_DEFMSTR_TYPE_FIXED	(2 << 16)
-#define		AT91_MATRIX_FIXED_DEFMSTR	(0xf  << 18)	/* Fixed Index of Default Master */
-
-#define AT91_MATRIX_PRAS0	0x80			/* Priority Register A for Slave 0 */
-#define AT91_MATRIX_PRBS0	0x84			/* Priority Register B for Slave 0 */
-#define AT91_MATRIX_PRAS1	0x88			/* Priority Register A for Slave 1 */
-#define AT91_MATRIX_PRBS1	0x8C			/* Priority Register B for Slave 1 */
-#define AT91_MATRIX_PRAS2	0x90			/* Priority Register A for Slave 2 */
-#define AT91_MATRIX_PRBS2	0x94			/* Priority Register B for Slave 2 */
-#define AT91_MATRIX_PRAS3	0x98			/* Priority Register A for Slave 3 */
-#define AT91_MATRIX_PRBS3	0x9C			/* Priority Register B for Slave 3 */
-#define AT91_MATRIX_PRAS4	0xA0			/* Priority Register A for Slave 4 */
-#define AT91_MATRIX_PRBS4	0xA4			/* Priority Register B for Slave 4 */
-#define AT91_MATRIX_PRAS5	0xA8			/* Priority Register A for Slave 5 */
-#define AT91_MATRIX_PRBS5	0xAC			/* Priority Register B for Slave 5 */
-#define AT91_MATRIX_PRAS6	0xB0			/* Priority Register A for Slave 6 */
-#define AT91_MATRIX_PRBS6	0xB4			/* Priority Register B for Slave 6 */
-#define AT91_MATRIX_PRAS7	0xB8			/* Priority Register A for Slave 7 */
-#define AT91_MATRIX_PRBS7	0xBC			/* Priority Register B for Slave 7 */
-#define		AT91_MATRIX_M0PR		(3 << 0)	/* Master 0 Priority */
-#define		AT91_MATRIX_M1PR		(3 << 4)	/* Master 1 Priority */
-#define		AT91_MATRIX_M2PR		(3 << 8)	/* Master 2 Priority */
-#define		AT91_MATRIX_M3PR		(3 << 12)	/* Master 3 Priority */
-#define		AT91_MATRIX_M4PR		(3 << 16)	/* Master 4 Priority */
-#define		AT91_MATRIX_M5PR		(3 << 20)	/* Master 5 Priority */
-#define		AT91_MATRIX_M6PR		(3 << 24)	/* Master 6 Priority */
-#define		AT91_MATRIX_M7PR		(3 << 28)	/* Master 7 Priority */
-#define		AT91_MATRIX_M8PR		(3 << 0)	/* Master 8 Priority (in Register B) */
-#define		AT91_MATRIX_M9PR		(3 << 4)	/* Master 9 Priority (in Register B) */
-#define		AT91_MATRIX_M10PR		(3 << 8)	/* Master 10 Priority (in Register B) */
-#define		AT91_MATRIX_M11PR		(3 << 12)	/* Master 11 Priority (in Register B) */
-
-#define AT91_MATRIX_MRCR	0x100			/* Master Remap Control Register */
-#define		AT91_MATRIX_RCB0		(1 << 0)	/* Remap Command for AHB Master 0 (ARM926EJ-S Instruction Master) */
-#define		AT91_MATRIX_RCB1		(1 << 1)	/* Remap Command for AHB Master 1 (ARM926EJ-S Data Master) */
-#define		AT91_MATRIX_RCB2		(1 << 2)
-#define		AT91_MATRIX_RCB3		(1 << 3)
-#define		AT91_MATRIX_RCB4		(1 << 4)
-#define		AT91_MATRIX_RCB5		(1 << 5)
-#define		AT91_MATRIX_RCB6		(1 << 6)
-#define		AT91_MATRIX_RCB7		(1 << 7)
-#define		AT91_MATRIX_RCB8		(1 << 8)
-#define		AT91_MATRIX_RCB9		(1 << 9)
-#define		AT91_MATRIX_RCB10		(1 << 10)
-#define		AT91_MATRIX_RCB11		(1 << 11)
-
-#define AT91_MATRIX_TCMR	0x110			/* TCM Configuration Register */
-#define		AT91_MATRIX_ITCM_SIZE		(0xf << 0)	/* Size of ITCM enabled memory block */
-#define			AT91_MATRIX_ITCM_0		(0 << 0)
-#define			AT91_MATRIX_ITCM_32		(6 << 0)
-#define		AT91_MATRIX_DTCM_SIZE		(0xf << 4)	/* Size of DTCM enabled memory block */
-#define			AT91_MATRIX_DTCM_0		(0 << 4)
-#define			AT91_MATRIX_DTCM_32		(6 << 4)
-#define			AT91_MATRIX_DTCM_64		(7 << 4)
-#define		AT91_MATRIX_TCM_NWS		(0x1 << 11)	/* Wait state TCM register */
-#define			AT91_MATRIX_TCM_NO_WS		(0x0 << 11)
-#define			AT91_MATRIX_TCM_ONE_WS		(0x1 << 11)
-
-#define AT91_MATRIX_VIDEO	0x118			/* Video Mode Configuration Register */
-#define		AT91C_VDEC_SEL			(0x1 <<  0) /* Video Mode Selection */
-#define			AT91C_VDEC_SEL_OFF		(0 << 0)
-#define			AT91C_VDEC_SEL_ON		(1 << 0)
-
-#define AT91_MATRIX_EBICSA	0x128			/* EBI Chip Select Assignment Register */
-#define		AT91_MATRIX_EBI_CS1A		(1 << 1)	/* Chip Select 1 Assignment */
-#define			AT91_MATRIX_EBI_CS1A_SMC		(0 << 1)
-#define			AT91_MATRIX_EBI_CS1A_SDRAMC		(1 << 1)
-#define		AT91_MATRIX_EBI_CS3A		(1 << 3)	/* Chip Select 3 Assignment */
-#define			AT91_MATRIX_EBI_CS3A_SMC		(0 << 3)
-#define			AT91_MATRIX_EBI_CS3A_SMC_SMARTMEDIA	(1 << 3)
-#define		AT91_MATRIX_EBI_CS4A		(1 << 4)	/* Chip Select 4 Assignment */
-#define			AT91_MATRIX_EBI_CS4A_SMC		(0 << 4)
-#define			AT91_MATRIX_EBI_CS4A_SMC_CF0		(1 << 4)
-#define		AT91_MATRIX_EBI_CS5A		(1 << 5)	/* Chip Select 5 Assignment */
-#define			AT91_MATRIX_EBI_CS5A_SMC		(0 << 5)
-#define			AT91_MATRIX_EBI_CS5A_SMC_CF1		(1 << 5)
-#define		AT91_MATRIX_EBI_DBPUC		(1 << 8)	/* Data Bus Pull-up Configuration */
-#define			AT91_MATRIX_EBI_DBPU_ON			(0 << 8)
-#define			AT91_MATRIX_EBI_DBPU_OFF		(1 << 8)
-#define		AT91_MATRIX_EBI_VDDIOMSEL	(1 << 16)	/* Memory voltage selection */
-#define			AT91_MATRIX_EBI_VDDIOMSEL_1_8V		(0 << 16)
-#define			AT91_MATRIX_EBI_VDDIOMSEL_3_3V		(1 << 16)
-#define		AT91_MATRIX_EBI_EBI_IOSR	(1 << 17)	/* EBI I/O slew rate selection */
-#define			AT91_MATRIX_EBI_EBI_IOSR_REDUCED	(0 << 17)
-#define			AT91_MATRIX_EBI_EBI_IOSR_NORMAL		(1 << 17)
-#define		AT91_MATRIX_EBI_DDR_IOSR	(1 << 18)	/* DDR2 dedicated port I/O slew rate selection */
-#define			AT91_MATRIX_EBI_DDR_IOSR_REDUCED	(0 << 18)
-#define			AT91_MATRIX_EBI_DDR_IOSR_NORMAL		(1 << 18)
-
-#define AT91_MATRIX_WPMR	0x1E4			/* Write Protect Mode Register */
-#define		AT91_MATRIX_WPMR_WPEN		(1 << 0)	/* Write Protect ENable */
-#define			AT91_MATRIX_WPMR_WP_WPDIS		(0 << 0)
-#define			AT91_MATRIX_WPMR_WP_WPEN		(1 << 0)
-#define		AT91_MATRIX_WPMR_WPKEY		(0xFFFFFF << 8)	/* Write Protect KEY */
-
-#define AT91_MATRIX_WPSR	0x1E8			/* Write Protect Status Register */
-#define		AT91_MATRIX_WPSR_WPVS		(1 << 0)	/* Write Protect Violation Status */
-#define			AT91_MATRIX_WPSR_NO_WPV		(0 << 0)
-#define			AT91_MATRIX_WPSR_WPV		(1 << 0)
-#define		AT91_MATRIX_WPSR_WPVSRC		(0xFFFF << 8)	/* Write Protect Violation Source */
-
-#endif
diff --git a/arch/arm/mach-at91/include/mach/at91sam9n12_matrix.h b/arch/arm/mach-at91/include/mach/at91sam9n12_matrix.h
deleted file mode 100644
index 40060cd62fa9..000000000000
--- a/arch/arm/mach-at91/include/mach/at91sam9n12_matrix.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Matrix-centric header file for the AT91SAM9N12
- *
- * Copyright (C) 2012 Atmel Corporation.
- *
- * Only EBI related registers.
- * Write Protect register definitions may be useful.
- *
- * Licensed under GPLv2 or later.
- */
-
-#ifndef _AT91SAM9N12_MATRIX_H_
-#define _AT91SAM9N12_MATRIX_H_
-
-#define AT91_MATRIX_EBICSA	(AT91_MATRIX + 0x118)	/* EBI Chip Select Assignment Register */
-#define		AT91_MATRIX_EBI_CS1A		(1 << 1)	/* Chip Select 1 Assignment */
-#define			AT91_MATRIX_EBI_CS1A_SMC		(0 << 1)
-#define			AT91_MATRIX_EBI_CS1A_SDRAMC		(1 << 1)
-#define		AT91_MATRIX_EBI_CS3A		(1 << 3)	/* Chip Select 3 Assignment */
-#define			AT91_MATRIX_EBI_CS3A_SMC		(0 << 3)
-#define			AT91_MATRIX_EBI_CS3A_SMC_NANDFLASH	(1 << 3)
-#define		AT91_MATRIX_EBI_DBPUC		(1 << 8)	/* Data Bus Pull-up Configuration */
-#define			AT91_MATRIX_EBI_DBPU_ON			(0 << 8)
-#define			AT91_MATRIX_EBI_DBPU_OFF		(1 << 8)
-#define		AT91_MATRIX_EBI_VDDIOMSEL	(1 << 16)	/* Memory voltage selection */
-#define			AT91_MATRIX_EBI_VDDIOMSEL_1_8V		(0 << 16)
-#define			AT91_MATRIX_EBI_VDDIOMSEL_3_3V		(1 << 16)
-#define		AT91_MATRIX_EBI_EBI_IOSR	(1 << 17)	/* EBI I/O slew rate selection */
-#define			AT91_MATRIX_EBI_EBI_IOSR_REDUCED	(0 << 17)
-#define			AT91_MATRIX_EBI_EBI_IOSR_NORMAL		(1 << 17)
-#define		AT91_MATRIX_EBI_DDR_IOSR	(1 << 18)	/* DDR2 dedicated port I/O slew rate selection */
-#define			AT91_MATRIX_EBI_DDR_IOSR_REDUCED	(0 << 18)
-#define			AT91_MATRIX_EBI_DDR_IOSR_NORMAL		(1 << 18)
-#define		AT91_MATRIX_NFD0_SELECT		(1 << 24)	/* NAND Flash Data Bus Selection */
-#define			AT91_MATRIX_NFD0_ON_D0			(0 << 24)
-#define			AT91_MATRIX_NFD0_ON_D16			(1 << 24)
-#define		AT91_MATRIX_DDR_MP_EN		(1 << 25)	/* DDR Multi-port Enable */
-#define			AT91_MATRIX_MP_OFF			(0 << 25)
-#define			AT91_MATRIX_MP_ON			(1 << 25)
-
-#define AT91_MATRIX_WPMR	(AT91_MATRIX + 0x1E4)	/* Write Protect Mode Register */
-#define		AT91_MATRIX_WPMR_WPEN		(1 << 0)	/* Write Protect ENable */
-#define			AT91_MATRIX_WPMR_WP_WPDIS		(0 << 0)
-#define			AT91_MATRIX_WPMR_WP_WPEN		(1 << 0)
-#define		AT91_MATRIX_WPMR_WPKEY		(0xFFFFFF << 8)	/* Write Protect KEY */
-
-#define AT91_MATRIX_WPSR	(AT91_MATRIX + 0x1E8)	/* Write Protect Status Register */
-#define		AT91_MATRIX_WPSR_WPVS		(1 << 0)	/* Write Protect Violation Status */
-#define			AT91_MATRIX_WPSR_NO_WPV		(0 << 0)
-#define			AT91_MATRIX_WPSR_WPV		(1 << 0)
-#define		AT91_MATRIX_WPSR_WPVSRC		(0xFFFF << 8)	/* Write Protect Violation Source */
-
-#endif
diff --git a/arch/arm/mach-at91/include/mach/at91sam9rl_matrix.h b/arch/arm/mach-at91/include/mach/at91sam9rl_matrix.h
deleted file mode 100644
index 6d160adadafc..000000000000
--- a/arch/arm/mach-at91/include/mach/at91sam9rl_matrix.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * arch/arm/mach-at91/include/mach/at91sam9rl_matrix.h
- *
- *  Copyright (C) 2007 Atmel Corporation
- *
- * Memory Controllers (MATRIX, EBI) - System peripherals registers.
- * Based on AT91SAM9RL datasheet revision A. (Preliminary)
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file COPYING in the main directory of this archive for
- * more details.
- */
-
-#ifndef AT91SAM9RL_MATRIX_H
-#define AT91SAM9RL_MATRIX_H
-
-#define AT91_MATRIX_MCFG0	0x00			/* Master Configuration Register 0 */
-#define AT91_MATRIX_MCFG1	0x04			/* Master Configuration Register 1 */
-#define AT91_MATRIX_MCFG2	0x08			/* Master Configuration Register 2 */
-#define AT91_MATRIX_MCFG3	0x0C			/* Master Configuration Register 3 */
-#define AT91_MATRIX_MCFG4	0x10			/* Master Configuration Register 4 */
-#define AT91_MATRIX_MCFG5	0x14			/* Master Configuration Register 5 */
-#define		AT91_MATRIX_ULBT	(7 << 0)	/* Undefined Length Burst Type */
-#define			AT91_MATRIX_ULBT_INFINITE	(0 << 0)
-#define			AT91_MATRIX_ULBT_SINGLE		(1 << 0)
-#define			AT91_MATRIX_ULBT_FOUR		(2 << 0)
-#define			AT91_MATRIX_ULBT_EIGHT		(3 << 0)
-#define			AT91_MATRIX_ULBT_SIXTEEN	(4 << 0)
-
-#define AT91_MATRIX_SCFG0	0x40			/* Slave Configuration Register 0 */
-#define AT91_MATRIX_SCFG1	0x44			/* Slave Configuration Register 1 */
-#define AT91_MATRIX_SCFG2	0x48			/* Slave Configuration Register 2 */
-#define AT91_MATRIX_SCFG3	0x4C			/* Slave Configuration Register 3 */
-#define AT91_MATRIX_SCFG4	0x50			/* Slave Configuration Register 4 */
-#define AT91_MATRIX_SCFG5	0x54			/* Slave Configuration Register 5 */
-#define		AT91_MATRIX_SLOT_CYCLE		(0xff << 0)	/* Maximum Number of Allowed Cycles for a Burst */
-#define		AT91_MATRIX_DEFMSTR_TYPE	(3    << 16)	/* Default Master Type */
-#define			AT91_MATRIX_DEFMSTR_TYPE_NONE	(0 << 16)
-#define			AT91_MATRIX_DEFMSTR_TYPE_LAST	(1 << 16)
-#define			AT91_MATRIX_DEFMSTR_TYPE_FIXED	(2 << 16)
-#define		AT91_MATRIX_FIXED_DEFMSTR	(0xf  << 18)	/* Fixed Index of Default Master */
-#define		AT91_MATRIX_ARBT		(3    << 24)	/* Arbitration Type */
-#define			AT91_MATRIX_ARBT_ROUND_ROBIN	(0 << 24)
-#define			AT91_MATRIX_ARBT_FIXED_PRIORITY	(1 << 24)
-
-#define AT91_MATRIX_PRAS0	0x80			/* Priority Register A for Slave 0 */
-#define AT91_MATRIX_PRAS1	0x88			/* Priority Register A for Slave 1 */
-#define AT91_MATRIX_PRAS2	0x90			/* Priority Register A for Slave 2 */
-#define AT91_MATRIX_PRAS3	0x98			/* Priority Register A for Slave 3 */
-#define AT91_MATRIX_PRAS4	0xA0			/* Priority Register A for Slave 4 */
-#define AT91_MATRIX_PRAS5	0xA8			/* Priority Register A for Slave 5 */
-#define		AT91_MATRIX_M0PR		(3 << 0)	/* Master 0 Priority */
-#define		AT91_MATRIX_M1PR		(3 << 4)	/* Master 1 Priority */
-#define		AT91_MATRIX_M2PR		(3 << 8)	/* Master 2 Priority */
-#define		AT91_MATRIX_M3PR		(3 << 12)	/* Master 3 Priority */
-#define		AT91_MATRIX_M4PR		(3 << 16)	/* Master 4 Priority */
-#define		AT91_MATRIX_M5PR		(3 << 20)	/* Master 5 Priority */
-
-#define AT91_MATRIX_MRCR	0x100			/* Master Remap Control Register */
-#define		AT91_MATRIX_RCB0		(1 << 0)	/* Remap Command for AHB Master 0 (ARM926EJ-S Instruction Master) */
-#define		AT91_MATRIX_RCB1		(1 << 1)	/* Remap Command for AHB Master 1 (ARM926EJ-S Data Master) */
-#define		AT91_MATRIX_RCB2		(1 << 2)
-#define		AT91_MATRIX_RCB3		(1 << 3)
-#define		AT91_MATRIX_RCB4		(1 << 4)
-#define		AT91_MATRIX_RCB5		(1 << 5)
-
-#define AT91_MATRIX_TCMR	0x114			/* TCM Configuration Register */
-#define		AT91_MATRIX_ITCM_SIZE		(0xf << 0)	/* Size of ITCM enabled memory block */
-#define			AT91_MATRIX_ITCM_0		(0 << 0)
-#define			AT91_MATRIX_ITCM_16		(5 << 0)
-#define			AT91_MATRIX_ITCM_32		(6 << 0)
-#define		AT91_MATRIX_DTCM_SIZE		(0xf << 4)	/* Size of DTCM enabled memory block */
-#define			AT91_MATRIX_DTCM_0		(0 << 4)
-#define			AT91_MATRIX_DTCM_16		(5 << 4)
-#define			AT91_MATRIX_DTCM_32		(6 << 4)
-
-#define AT91_MATRIX_EBICSA	0x120			/* EBI0 Chip Select Assignment Register */
-#define		AT91_MATRIX_CS1A		(1 << 1)	/* Chip Select 1 Assignment */
-#define			AT91_MATRIX_CS1A_SMC		(0 << 1)
-#define			AT91_MATRIX_CS1A_SDRAMC		(1 << 1)
-#define		AT91_MATRIX_CS3A		(1 << 3)	/* Chip Select 3 Assignment */
-#define			AT91_MATRIX_CS3A_SMC		(0 << 3)
-#define			AT91_MATRIX_CS3A_SMC_SMARTMEDIA	(1 << 3)
-#define		AT91_MATRIX_CS4A		(1 << 4)	/* Chip Select 4 Assignment */
-#define			AT91_MATRIX_CS4A_SMC		(0 << 4)
-#define			AT91_MATRIX_CS4A_SMC_CF1	(1 << 4)
-#define		AT91_MATRIX_CS5A		(1 << 5)	/* Chip Select 5 Assignment */
-#define			AT91_MATRIX_CS5A_SMC		(0 << 5)
-#define			AT91_MATRIX_CS5A_SMC_CF2	(1 << 5)
-#define		AT91_MATRIX_DBPUC		(1 << 8)	/* Data Bus Pull-up Configuration */
-#define		AT91_MATRIX_VDDIOMSEL		(1 << 16)	/* Memory voltage selection */
-#define			AT91_MATRIX_VDDIOMSEL_1_8V	(0 << 16)
-#define			AT91_MATRIX_VDDIOMSEL_3_3V	(1 << 16)
-
-
-#endif
diff --git a/arch/arm/mach-at91/include/mach/at91sam9x5_matrix.h b/arch/arm/mach-at91/include/mach/at91sam9x5_matrix.h
deleted file mode 100644
index a606d3966470..000000000000
--- a/arch/arm/mach-at91/include/mach/at91sam9x5_matrix.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Matrix-centric header file for the AT91SAM9x5 family
- *
- *  Copyright (C) 2009-2012 Atmel Corporation.
- *
- * Only EBI related registers.
- * Write Protect register definitions may be useful.
- *
- * Licensed under GPLv2 or later.
- */
-
-#ifndef AT91SAM9X5_MATRIX_H
-#define AT91SAM9X5_MATRIX_H
-
-#define AT91_MATRIX_EBICSA	(AT91_MATRIX + 0x120)	/* EBI Chip Select Assignment Register */
-#define		AT91_MATRIX_EBI_CS1A		(1 << 1)	/* Chip Select 1 Assignment */
-#define			AT91_MATRIX_EBI_CS1A_SMC		(0 << 1)
-#define			AT91_MATRIX_EBI_CS1A_SDRAMC		(1 << 1)
-#define		AT91_MATRIX_EBI_CS3A		(1 << 3)	/* Chip Select 3 Assignment */
-#define			AT91_MATRIX_EBI_CS3A_SMC		(0 << 3)
-#define			AT91_MATRIX_EBI_CS3A_SMC_NANDFLASH	(1 << 3)
-#define		AT91_MATRIX_EBI_DBPUC		(1 << 8)	/* Data Bus Pull-up Configuration */
-#define			AT91_MATRIX_EBI_DBPU_ON			(0 << 8)
-#define			AT91_MATRIX_EBI_DBPU_OFF		(1 << 8)
-#define		AT91_MATRIX_EBI_VDDIOMSEL	(1 << 16)	/* Memory voltage selection */
-#define			AT91_MATRIX_EBI_VDDIOMSEL_1_8V		(0 << 16)
-#define			AT91_MATRIX_EBI_VDDIOMSEL_3_3V		(1 << 16)
-#define		AT91_MATRIX_EBI_EBI_IOSR	(1 << 17)	/* EBI I/O slew rate selection */
-#define			AT91_MATRIX_EBI_EBI_IOSR_REDUCED	(0 << 17)
-#define			AT91_MATRIX_EBI_EBI_IOSR_NORMAL		(1 << 17)
-#define		AT91_MATRIX_EBI_DDR_IOSR	(1 << 18)	/* DDR2 dedicated port I/O slew rate selection */
-#define			AT91_MATRIX_EBI_DDR_IOSR_REDUCED	(0 << 18)
-#define			AT91_MATRIX_EBI_DDR_IOSR_NORMAL		(1 << 18)
-#define		AT91_MATRIX_NFD0_SELECT		(1 << 24)	/* NAND Flash Data Bus Selection */
-#define			AT91_MATRIX_NFD0_ON_D0			(0 << 24)
-#define			AT91_MATRIX_NFD0_ON_D16			(1 << 24)
-#define		AT91_MATRIX_DDR_MP_EN		(1 << 25)	/* DDR Multi-port Enable */
-#define			AT91_MATRIX_MP_OFF			(0 << 25)
-#define			AT91_MATRIX_MP_ON			(1 << 25)
-
-#define AT91_MATRIX_WPMR	(AT91_MATRIX + 0x1E4)	/* Write Protect Mode Register */
-#define		AT91_MATRIX_WPMR_WPEN		(1 << 0)	/* Write Protect ENable */
-#define			AT91_MATRIX_WPMR_WP_WPDIS		(0 << 0)
-#define			AT91_MATRIX_WPMR_WP_WPEN		(1 << 0)
-#define		AT91_MATRIX_WPMR_WPKEY		(0xFFFFFF << 8)	/* Write Protect KEY */
-
-#define AT91_MATRIX_WPSR	(AT91_MATRIX + 0x1E8)	/* Write Protect Status Register */
-#define		AT91_MATRIX_WPSR_WPVS		(1 << 0)	/* Write Protect Violation Status */
-#define			AT91_MATRIX_WPSR_NO_WPV		(0 << 0)
-#define			AT91_MATRIX_WPSR_WPV		(1 << 0)
-#define		AT91_MATRIX_WPSR_WPVSRC		(0xFFFF << 8)	/* Write Protect Violation Source */
-
-#endif
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 56+ messages in thread

* [PATCH 07/17] ARM: at91: remove unused _matrix.h headers
@ 2015-01-15 21:58   ` Alexandre Belloni
  0 siblings, 0 replies; 56+ messages in thread
From: Alexandre Belloni @ 2015-01-15 21:58 UTC (permalink / raw)
  To: linux-arm-kernel

The matrix headers are not used anymore, remove them.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
---
 .../mach-at91/include/mach/at91sam9260_matrix.h    |  80 -----------
 .../mach-at91/include/mach/at91sam9261_matrix.h    |  64 ---------
 .../mach-at91/include/mach/at91sam9263_matrix.h    | 129 -----------------
 .../mach-at91/include/mach/at91sam9g45_matrix.h    | 153 ---------------------
 .../mach-at91/include/mach/at91sam9n12_matrix.h    |  53 -------
 .../arm/mach-at91/include/mach/at91sam9rl_matrix.h |  96 -------------
 .../arm/mach-at91/include/mach/at91sam9x5_matrix.h |  53 -------
 7 files changed, 628 deletions(-)
 delete mode 100644 arch/arm/mach-at91/include/mach/at91sam9260_matrix.h
 delete mode 100644 arch/arm/mach-at91/include/mach/at91sam9261_matrix.h
 delete mode 100644 arch/arm/mach-at91/include/mach/at91sam9263_matrix.h
 delete mode 100644 arch/arm/mach-at91/include/mach/at91sam9g45_matrix.h
 delete mode 100644 arch/arm/mach-at91/include/mach/at91sam9n12_matrix.h
 delete mode 100644 arch/arm/mach-at91/include/mach/at91sam9rl_matrix.h
 delete mode 100644 arch/arm/mach-at91/include/mach/at91sam9x5_matrix.h

diff --git a/arch/arm/mach-at91/include/mach/at91sam9260_matrix.h b/arch/arm/mach-at91/include/mach/at91sam9260_matrix.h
deleted file mode 100644
index f459df420629..000000000000
--- a/arch/arm/mach-at91/include/mach/at91sam9260_matrix.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * arch/arm/mach-at91/include/mach/at91sam9260_matrix.h
- *
- *  Copyright (C) 2007 Atmel Corporation.
- *
- * Memory Controllers (MATRIX, EBI) - System peripherals registers.
- * Based on AT91SAM9260 datasheet revision B.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- */
-
-#ifndef AT91SAM9260_MATRIX_H
-#define AT91SAM9260_MATRIX_H
-
-#define AT91_MATRIX_MCFG0	0x00			/* Master Configuration Register 0 */
-#define AT91_MATRIX_MCFG1	0x04			/* Master Configuration Register 1 */
-#define AT91_MATRIX_MCFG2	0x08			/* Master Configuration Register 2 */
-#define AT91_MATRIX_MCFG3	0x0C			/* Master Configuration Register 3 */
-#define AT91_MATRIX_MCFG4	0x10			/* Master Configuration Register 4 */
-#define AT91_MATRIX_MCFG5	0x14			/* Master Configuration Register 5 */
-#define		AT91_MATRIX_ULBT		(7 << 0)	/* Undefined Length Burst Type */
-#define			AT91_MATRIX_ULBT_INFINITE	(0 << 0)
-#define			AT91_MATRIX_ULBT_SINGLE		(1 << 0)
-#define			AT91_MATRIX_ULBT_FOUR		(2 << 0)
-#define			AT91_MATRIX_ULBT_EIGHT		(3 << 0)
-#define			AT91_MATRIX_ULBT_SIXTEEN	(4 << 0)
-
-#define AT91_MATRIX_SCFG0	0x40			/* Slave Configuration Register 0 */
-#define AT91_MATRIX_SCFG1	0x44			/* Slave Configuration Register 1 */
-#define AT91_MATRIX_SCFG2	0x48			/* Slave Configuration Register 2 */
-#define AT91_MATRIX_SCFG3	0x4C			/* Slave Configuration Register 3 */
-#define AT91_MATRIX_SCFG4	0x50			/* Slave Configuration Register 4 */
-#define		AT91_MATRIX_SLOT_CYCLE		(0xff <<  0)	/* Maximum Number of Allowed Cycles for a Burst */
-#define		AT91_MATRIX_DEFMSTR_TYPE	(3    << 16)	/* Default Master Type */
-#define			AT91_MATRIX_DEFMSTR_TYPE_NONE	(0 << 16)
-#define			AT91_MATRIX_DEFMSTR_TYPE_LAST	(1 << 16)
-#define			AT91_MATRIX_DEFMSTR_TYPE_FIXED	(2 << 16)
-#define		AT91_MATRIX_FIXED_DEFMSTR	(7    << 18)	/* Fixed Index of Default Master */
-#define		AT91_MATRIX_ARBT		(3    << 24)	/* Arbitration Type */
-#define			AT91_MATRIX_ARBT_ROUND_ROBIN	(0 << 24)
-#define			AT91_MATRIX_ARBT_FIXED_PRIORITY	(1 << 24)
-
-#define AT91_MATRIX_PRAS0	0x80			/* Priority Register A for Slave 0 */
-#define AT91_MATRIX_PRAS1	0x88			/* Priority Register A for Slave 1 */
-#define AT91_MATRIX_PRAS2	0x90			/* Priority Register A for Slave 2 */
-#define AT91_MATRIX_PRAS3	0x98			/* Priority Register A for Slave 3 */
-#define AT91_MATRIX_PRAS4	0xA0			/* Priority Register A for Slave 4 */
-#define		AT91_MATRIX_M0PR		(3 << 0)	/* Master 0 Priority */
-#define		AT91_MATRIX_M1PR		(3 << 4)	/* Master 1 Priority */
-#define		AT91_MATRIX_M2PR		(3 << 8)	/* Master 2 Priority */
-#define		AT91_MATRIX_M3PR		(3 << 12)	/* Master 3 Priority */
-#define		AT91_MATRIX_M4PR		(3 << 16)	/* Master 4 Priority */
-#define		AT91_MATRIX_M5PR		(3 << 20)	/* Master 5 Priority */
-
-#define AT91_MATRIX_MRCR	0x100			/* Master Remap Control Register */
-#define		AT91_MATRIX_RCB0		(1 << 0)	/* Remap Command for AHB Master 0 (ARM926EJ-S Instruction Master) */
-#define		AT91_MATRIX_RCB1		(1 << 1)	/* Remap Command for AHB Master 1 (ARM926EJ-S Data Master) */
-
-#define AT91_MATRIX_EBICSA	0x11C			/* EBI Chip Select Assignment Register */
-#define		AT91_MATRIX_CS1A		(1 << 1)	/* Chip Select 1 Assignment */
-#define			AT91_MATRIX_CS1A_SMC		(0 << 1)
-#define			AT91_MATRIX_CS1A_SDRAMC		(1 << 1)
-#define		AT91_MATRIX_CS3A		(1 << 3)	/* Chip Select 3 Assignment */
-#define			AT91_MATRIX_CS3A_SMC		(0 << 3)
-#define			AT91_MATRIX_CS3A_SMC_SMARTMEDIA	(1 << 3)
-#define		AT91_MATRIX_CS4A		(1 << 4)	/* Chip Select 4 Assignment */
-#define			AT91_MATRIX_CS4A_SMC		(0 << 4)
-#define			AT91_MATRIX_CS4A_SMC_CF1	(1 << 4)
-#define		AT91_MATRIX_CS5A		(1 << 5)	/* Chip Select 5 Assignment */
-#define			AT91_MATRIX_CS5A_SMC		(0 << 5)
-#define			AT91_MATRIX_CS5A_SMC_CF2	(1 << 5)
-#define		AT91_MATRIX_DBPUC		(1 << 8)	/* Data Bus Pull-up Configuration */
-#define		AT91_MATRIX_VDDIOMSEL		(1 << 16)	/* Memory voltage selection */
-#define			AT91_MATRIX_VDDIOMSEL_1_8V	(0 << 16)
-#define			AT91_MATRIX_VDDIOMSEL_3_3V	(1 << 16)
-
-#endif
diff --git a/arch/arm/mach-at91/include/mach/at91sam9261_matrix.h b/arch/arm/mach-at91/include/mach/at91sam9261_matrix.h
deleted file mode 100644
index a50cdf8b8ca4..000000000000
--- a/arch/arm/mach-at91/include/mach/at91sam9261_matrix.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * arch/arm/mach-at91/include/mach/at91sam9261_matrix.h
- *
- *  Copyright (C) 2007 Atmel Corporation.
- *
- * Memory Controllers (MATRIX, EBI) - System peripherals registers.
- * Based on AT91SAM9261 datasheet revision D.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- */
-
-#ifndef AT91SAM9261_MATRIX_H
-#define AT91SAM9261_MATRIX_H
-
-#define AT91_MATRIX_MCFG	0x00			/* Master Configuration Register */
-#define		AT91_MATRIX_RCB0	(1 << 0)		/* Remap Command for AHB Master 0 (ARM926EJ-S Instruction Master) */
-#define		AT91_MATRIX_RCB1	(1 << 1)		/* Remap Command for AHB Master 1 (ARM926EJ-S Data Master) */
-
-#define AT91_MATRIX_SCFG0	0x04			/* Slave Configuration Register 0 */
-#define AT91_MATRIX_SCFG1	0x08			/* Slave Configuration Register 1 */
-#define AT91_MATRIX_SCFG2	0x0C			/* Slave Configuration Register 2 */
-#define AT91_MATRIX_SCFG3	0x10			/* Slave Configuration Register 3 */
-#define AT91_MATRIX_SCFG4	0x14			/* Slave Configuration Register 4 */
-#define		AT91_MATRIX_SLOT_CYCLE		(0xff << 0)	/* Maximum Number of Allowed Cycles for a Burst */
-#define		AT91_MATRIX_DEFMSTR_TYPE	(3    << 16)	/* Default Master Type */
-#define			AT91_MATRIX_DEFMSTR_TYPE_NONE	(0 << 16)
-#define			AT91_MATRIX_DEFMSTR_TYPE_LAST	(1 << 16)
-#define			AT91_MATRIX_DEFMSTR_TYPE_FIXED	(2 << 16)
-#define		AT91_MATRIX_FIXED_DEFMSTR	(7    << 18)	/* Fixed Index of Default Master */
-
-#define AT91_MATRIX_TCR		0x24			/* TCM Configuration Register */
-#define		AT91_MATRIX_ITCM_SIZE		(0xf << 0)	/* Size of ITCM enabled memory block */
-#define			AT91_MATRIX_ITCM_0		(0 << 0)
-#define			AT91_MATRIX_ITCM_16		(5 << 0)
-#define			AT91_MATRIX_ITCM_32		(6 << 0)
-#define			AT91_MATRIX_ITCM_64		(7 << 0)
-#define		AT91_MATRIX_DTCM_SIZE		(0xf << 4)	/* Size of DTCM enabled memory block */
-#define			AT91_MATRIX_DTCM_0		(0 << 4)
-#define			AT91_MATRIX_DTCM_16		(5 << 4)
-#define			AT91_MATRIX_DTCM_32		(6 << 4)
-#define			AT91_MATRIX_DTCM_64		(7 << 4)
-
-#define AT91_MATRIX_EBICSA	0x30			/* EBI Chip Select Assignment Register */
-#define		AT91_MATRIX_CS1A		(1 << 1)	/* Chip Select 1 Assignment */
-#define			AT91_MATRIX_CS1A_SMC		(0 << 1)
-#define			AT91_MATRIX_CS1A_SDRAMC		(1 << 1)
-#define		AT91_MATRIX_CS3A		(1 << 3)	/* Chip Select 3 Assignment */
-#define			AT91_MATRIX_CS3A_SMC		(0 << 3)
-#define			AT91_MATRIX_CS3A_SMC_SMARTMEDIA	(1 << 3)
-#define		AT91_MATRIX_CS4A		(1 << 4)	/* Chip Select 4 Assignment */
-#define			AT91_MATRIX_CS4A_SMC		(0 << 4)
-#define			AT91_MATRIX_CS4A_SMC_CF1	(1 << 4)
-#define		AT91_MATRIX_CS5A		(1 << 5)	/* Chip Select 5 Assignment */
-#define			AT91_MATRIX_CS5A_SMC		(0 << 5)
-#define			AT91_MATRIX_CS5A_SMC_CF2	(1 << 5)
-#define		AT91_MATRIX_DBPUC		(1 << 8)	/* Data Bus Pull-up Configuration */
-
-#define AT91_MATRIX_USBPUCR	0x34			/* USB Pad Pull-Up Control Register */
-#define		AT91_MATRIX_USBPUCR_PUON	(1 << 30)	/* USB Device PAD Pull-up Enable */
-
-#endif
diff --git a/arch/arm/mach-at91/include/mach/at91sam9263_matrix.h b/arch/arm/mach-at91/include/mach/at91sam9263_matrix.h
deleted file mode 100644
index ebb5fdb565e0..000000000000
--- a/arch/arm/mach-at91/include/mach/at91sam9263_matrix.h
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * arch/arm/mach-at91/include/mach/at91sam9263_matrix.h
- *
- *  Copyright (C) 2006 Atmel Corporation.
- *
- * Memory Controllers (MATRIX, EBI) - System peripherals registers.
- * Based on AT91SAM9263 datasheet revision B (Preliminary).
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- */
-
-#ifndef AT91SAM9263_MATRIX_H
-#define AT91SAM9263_MATRIX_H
-
-#define AT91_MATRIX_MCFG0	0x00			/* Master Configuration Register 0 */
-#define AT91_MATRIX_MCFG1	0x04			/* Master Configuration Register 1 */
-#define AT91_MATRIX_MCFG2	0x08			/* Master Configuration Register 2 */
-#define AT91_MATRIX_MCFG3	0x0C			/* Master Configuration Register 3 */
-#define AT91_MATRIX_MCFG4	0x10			/* Master Configuration Register 4 */
-#define AT91_MATRIX_MCFG5	0x14			/* Master Configuration Register 5 */
-#define AT91_MATRIX_MCFG6	0x18			/* Master Configuration Register 6 */
-#define AT91_MATRIX_MCFG7	0x1C			/* Master Configuration Register 7 */
-#define AT91_MATRIX_MCFG8	0x20			/* Master Configuration Register 8 */
-#define		AT91_MATRIX_ULBT	(7 << 0)	/* Undefined Length Burst Type */
-#define			AT91_MATRIX_ULBT_INFINITE	(0 << 0)
-#define			AT91_MATRIX_ULBT_SINGLE		(1 << 0)
-#define			AT91_MATRIX_ULBT_FOUR		(2 << 0)
-#define			AT91_MATRIX_ULBT_EIGHT		(3 << 0)
-#define			AT91_MATRIX_ULBT_SIXTEEN	(4 << 0)
-
-#define AT91_MATRIX_SCFG0	0x40			/* Slave Configuration Register 0 */
-#define AT91_MATRIX_SCFG1	0x44			/* Slave Configuration Register 1 */
-#define AT91_MATRIX_SCFG2	0x48			/* Slave Configuration Register 2 */
-#define AT91_MATRIX_SCFG3	0x4C			/* Slave Configuration Register 3 */
-#define AT91_MATRIX_SCFG4	0x50			/* Slave Configuration Register 4 */
-#define AT91_MATRIX_SCFG5	0x54			/* Slave Configuration Register 5 */
-#define AT91_MATRIX_SCFG6	0x58			/* Slave Configuration Register 6 */
-#define AT91_MATRIX_SCFG7	0x5C			/* Slave Configuration Register 7 */
-#define		AT91_MATRIX_SLOT_CYCLE		(0xff << 0)	/* Maximum Number of Allowed Cycles for a Burst */
-#define		AT91_MATRIX_DEFMSTR_TYPE	(3    << 16)	/* Default Master Type */
-#define			AT91_MATRIX_DEFMSTR_TYPE_NONE	(0 << 16)
-#define			AT91_MATRIX_DEFMSTR_TYPE_LAST	(1 << 16)
-#define			AT91_MATRIX_DEFMSTR_TYPE_FIXED	(2 << 16)
-#define		AT91_MATRIX_FIXED_DEFMSTR	(0xf  << 18)	/* Fixed Index of Default Master */
-#define		AT91_MATRIX_ARBT		(3    << 24)	/* Arbitration Type */
-#define			AT91_MATRIX_ARBT_ROUND_ROBIN	(0 << 24)
-#define			AT91_MATRIX_ARBT_FIXED_PRIORITY	(1 << 24)
-
-#define AT91_MATRIX_PRAS0	0x80			/* Priority Register A for Slave 0 */
-#define AT91_MATRIX_PRBS0	0x84			/* Priority Register B for Slave 0 */
-#define AT91_MATRIX_PRAS1	0x88			/* Priority Register A for Slave 1 */
-#define AT91_MATRIX_PRBS1	0x8C			/* Priority Register B for Slave 1 */
-#define AT91_MATRIX_PRAS2	0x90			/* Priority Register A for Slave 2 */
-#define AT91_MATRIX_PRBS2	0x94			/* Priority Register B for Slave 2 */
-#define AT91_MATRIX_PRAS3	0x98			/* Priority Register A for Slave 3 */
-#define AT91_MATRIX_PRBS3	0x9C			/* Priority Register B for Slave 3 */
-#define AT91_MATRIX_PRAS4	0xA0			/* Priority Register A for Slave 4 */
-#define AT91_MATRIX_PRBS4	0xA4			/* Priority Register B for Slave 4 */
-#define AT91_MATRIX_PRAS5	0xA8			/* Priority Register A for Slave 5 */
-#define AT91_MATRIX_PRBS5	0xAC			/* Priority Register B for Slave 5 */
-#define AT91_MATRIX_PRAS6	0xB0			/* Priority Register A for Slave 6 */
-#define AT91_MATRIX_PRBS6	0xB4			/* Priority Register B for Slave 6 */
-#define AT91_MATRIX_PRAS7	0xB8			/* Priority Register A for Slave 7 */
-#define AT91_MATRIX_PRBS7	0xBC			/* Priority Register B for Slave 7 */
-#define		AT91_MATRIX_M0PR		(3 << 0)	/* Master 0 Priority */
-#define		AT91_MATRIX_M1PR		(3 << 4)	/* Master 1 Priority */
-#define		AT91_MATRIX_M2PR		(3 << 8)	/* Master 2 Priority */
-#define		AT91_MATRIX_M3PR		(3 << 12)	/* Master 3 Priority */
-#define		AT91_MATRIX_M4PR		(3 << 16)	/* Master 4 Priority */
-#define		AT91_MATRIX_M5PR		(3 << 20)	/* Master 5 Priority */
-#define		AT91_MATRIX_M6PR		(3 << 24)	/* Master 6 Priority */
-#define		AT91_MATRIX_M7PR		(3 << 28)	/* Master 7 Priority */
-#define		AT91_MATRIX_M8PR		(3 << 0)	/* Master 8 Priority (in Register B) */
-
-#define AT91_MATRIX_MRCR	0x100			/* Master Remap Control Register */
-#define		AT91_MATRIX_RCB0		(1 << 0)	/* Remap Command for AHB Master 0 (ARM926EJ-S Instruction Master) */
-#define		AT91_MATRIX_RCB1		(1 << 1)	/* Remap Command for AHB Master 1 (ARM926EJ-S Data Master) */
-#define		AT91_MATRIX_RCB2		(1 << 2)
-#define		AT91_MATRIX_RCB3		(1 << 3)
-#define		AT91_MATRIX_RCB4		(1 << 4)
-#define		AT91_MATRIX_RCB5		(1 << 5)
-#define		AT91_MATRIX_RCB6		(1 << 6)
-#define		AT91_MATRIX_RCB7		(1 << 7)
-#define		AT91_MATRIX_RCB8		(1 << 8)
-
-#define AT91_MATRIX_TCMR	0x114			/* TCM Configuration Register */
-#define		AT91_MATRIX_ITCM_SIZE		(0xf << 0)	/* Size of ITCM enabled memory block */
-#define			AT91_MATRIX_ITCM_0		(0 << 0)
-#define			AT91_MATRIX_ITCM_16		(5 << 0)
-#define			AT91_MATRIX_ITCM_32		(6 << 0)
-#define		AT91_MATRIX_DTCM_SIZE		(0xf << 4)	/* Size of DTCM enabled memory block */
-#define			AT91_MATRIX_DTCM_0		(0 << 4)
-#define			AT91_MATRIX_DTCM_16		(5 << 4)
-#define			AT91_MATRIX_DTCM_32		(6 << 4)
-
-#define AT91_MATRIX_EBI0CSA	0x120			/* EBI0 Chip Select Assignment Register */
-#define		AT91_MATRIX_EBI0_CS1A		(1 << 1)	/* Chip Select 1 Assignment */
-#define			AT91_MATRIX_EBI0_CS1A_SMC		(0 << 1)
-#define			AT91_MATRIX_EBI0_CS1A_SDRAMC		(1 << 1)
-#define		AT91_MATRIX_EBI0_CS3A		(1 << 3)	/* Chip Select 3 Assignment */
-#define			AT91_MATRIX_EBI0_CS3A_SMC		(0 << 3)
-#define			AT91_MATRIX_EBI0_CS3A_SMC_SMARTMEDIA	(1 << 3)
-#define		AT91_MATRIX_EBI0_CS4A		(1 << 4)	/* Chip Select 4 Assignment */
-#define			AT91_MATRIX_EBI0_CS4A_SMC		(0 << 4)
-#define			AT91_MATRIX_EBI0_CS4A_SMC_CF1		(1 << 4)
-#define		AT91_MATRIX_EBI0_CS5A		(1 << 5)	/* Chip Select 5 Assignment */
-#define			AT91_MATRIX_EBI0_CS5A_SMC		(0 << 5)
-#define			AT91_MATRIX_EBI0_CS5A_SMC_CF2		(1 << 5)
-#define		AT91_MATRIX_EBI0_DBPUC		(1 << 8)	/* Data Bus Pull-up Configuration */
-#define		AT91_MATRIX_EBI0_VDDIOMSEL	(1 << 16)	/* Memory voltage selection */
-#define			AT91_MATRIX_EBI0_VDDIOMSEL_1_8V		(0 << 16)
-#define			AT91_MATRIX_EBI0_VDDIOMSEL_3_3V		(1 << 16)
-
-#define AT91_MATRIX_EBI1CSA	0x124			/* EBI1 Chip Select Assignment Register */
-#define		AT91_MATRIX_EBI1_CS1A		(1 << 1)	/* Chip Select 1 Assignment */
-#define			AT91_MATRIX_EBI1_CS1A_SMC		(0 << 1)
-#define			AT91_MATRIX_EBI1_CS1A_SDRAMC		(1 << 1)
-#define		AT91_MATRIX_EBI1_CS2A		(1 << 3)	/* Chip Select 3 Assignment */
-#define			AT91_MATRIX_EBI1_CS2A_SMC		(0 << 3)
-#define			AT91_MATRIX_EBI1_CS2A_SMC_SMARTMEDIA	(1 << 3)
-#define		AT91_MATRIX_EBI1_DBPUC		(1 << 8)	/* Data Bus Pull-up Configuration */
-#define		AT91_MATRIX_EBI1_VDDIOMSEL	(1 << 16)	/* Memory voltage selection */
-#define			AT91_MATRIX_EBI1_VDDIOMSEL_1_8V		(0 << 16)
-#define			AT91_MATRIX_EBI1_VDDIOMSEL_3_3V		(1 << 16)
-
-#endif
diff --git a/arch/arm/mach-at91/include/mach/at91sam9g45_matrix.h b/arch/arm/mach-at91/include/mach/at91sam9g45_matrix.h
deleted file mode 100644
index b76e2ed2fbc2..000000000000
--- a/arch/arm/mach-at91/include/mach/at91sam9g45_matrix.h
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * Matrix-centric header file for the AT91SAM9G45 family
- *
- *  Copyright (C) 2008-2009 Atmel Corporation.
- *
- * Memory Controllers (MATRIX, EBI) - System peripherals registers.
- * Based on AT91SAM9G45 preliminary datasheet.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- */
-
-#ifndef AT91SAM9G45_MATRIX_H
-#define AT91SAM9G45_MATRIX_H
-
-#define AT91_MATRIX_MCFG0	0x00			/* Master Configuration Register 0 */
-#define AT91_MATRIX_MCFG1	0x04			/* Master Configuration Register 1 */
-#define AT91_MATRIX_MCFG2	0x08			/* Master Configuration Register 2 */
-#define AT91_MATRIX_MCFG3	0x0C			/* Master Configuration Register 3 */
-#define AT91_MATRIX_MCFG4	0x10			/* Master Configuration Register 4 */
-#define AT91_MATRIX_MCFG5	0x14			/* Master Configuration Register 5 */
-#define AT91_MATRIX_MCFG6	0x18			/* Master Configuration Register 6 */
-#define AT91_MATRIX_MCFG7	0x1C			/* Master Configuration Register 7 */
-#define AT91_MATRIX_MCFG8	0x20			/* Master Configuration Register 8 */
-#define AT91_MATRIX_MCFG9	0x24			/* Master Configuration Register 9 */
-#define AT91_MATRIX_MCFG10	0x28			/* Master Configuration Register 10 */
-#define AT91_MATRIX_MCFG11	0x2C			/* Master Configuration Register 11 */
-#define		AT91_MATRIX_ULBT	(7 << 0)	/* Undefined Length Burst Type */
-#define			AT91_MATRIX_ULBT_INFINITE	(0 << 0)
-#define			AT91_MATRIX_ULBT_SINGLE		(1 << 0)
-#define			AT91_MATRIX_ULBT_FOUR		(2 << 0)
-#define			AT91_MATRIX_ULBT_EIGHT		(3 << 0)
-#define			AT91_MATRIX_ULBT_SIXTEEN	(4 << 0)
-#define			AT91_MATRIX_ULBT_THIRTYTWO	(5 << 0)
-#define			AT91_MATRIX_ULBT_SIXTYFOUR	(6 << 0)
-#define			AT91_MATRIX_ULBT_128		(7 << 0)
-
-#define AT91_MATRIX_SCFG0	0x40			/* Slave Configuration Register 0 */
-#define AT91_MATRIX_SCFG1	0x44			/* Slave Configuration Register 1 */
-#define AT91_MATRIX_SCFG2	0x48			/* Slave Configuration Register 2 */
-#define AT91_MATRIX_SCFG3	0x4C			/* Slave Configuration Register 3 */
-#define AT91_MATRIX_SCFG4	0x50			/* Slave Configuration Register 4 */
-#define AT91_MATRIX_SCFG5	0x54			/* Slave Configuration Register 5 */
-#define AT91_MATRIX_SCFG6	0x58			/* Slave Configuration Register 6 */
-#define AT91_MATRIX_SCFG7	0x5C			/* Slave Configuration Register 7 */
-#define		AT91_MATRIX_SLOT_CYCLE		(0x1ff << 0)	/* Maximum Number of Allowed Cycles for a Burst */
-#define		AT91_MATRIX_DEFMSTR_TYPE	(3    << 16)	/* Default Master Type */
-#define			AT91_MATRIX_DEFMSTR_TYPE_NONE	(0 << 16)
-#define			AT91_MATRIX_DEFMSTR_TYPE_LAST	(1 << 16)
-#define			AT91_MATRIX_DEFMSTR_TYPE_FIXED	(2 << 16)
-#define		AT91_MATRIX_FIXED_DEFMSTR	(0xf  << 18)	/* Fixed Index of Default Master */
-
-#define AT91_MATRIX_PRAS0	0x80			/* Priority Register A for Slave 0 */
-#define AT91_MATRIX_PRBS0	0x84			/* Priority Register B for Slave 0 */
-#define AT91_MATRIX_PRAS1	0x88			/* Priority Register A for Slave 1 */
-#define AT91_MATRIX_PRBS1	0x8C			/* Priority Register B for Slave 1 */
-#define AT91_MATRIX_PRAS2	0x90			/* Priority Register A for Slave 2 */
-#define AT91_MATRIX_PRBS2	0x94			/* Priority Register B for Slave 2 */
-#define AT91_MATRIX_PRAS3	0x98			/* Priority Register A for Slave 3 */
-#define AT91_MATRIX_PRBS3	0x9C			/* Priority Register B for Slave 3 */
-#define AT91_MATRIX_PRAS4	0xA0			/* Priority Register A for Slave 4 */
-#define AT91_MATRIX_PRBS4	0xA4			/* Priority Register B for Slave 4 */
-#define AT91_MATRIX_PRAS5	0xA8			/* Priority Register A for Slave 5 */
-#define AT91_MATRIX_PRBS5	0xAC			/* Priority Register B for Slave 5 */
-#define AT91_MATRIX_PRAS6	0xB0			/* Priority Register A for Slave 6 */
-#define AT91_MATRIX_PRBS6	0xB4			/* Priority Register B for Slave 6 */
-#define AT91_MATRIX_PRAS7	0xB8			/* Priority Register A for Slave 7 */
-#define AT91_MATRIX_PRBS7	0xBC			/* Priority Register B for Slave 7 */
-#define		AT91_MATRIX_M0PR		(3 << 0)	/* Master 0 Priority */
-#define		AT91_MATRIX_M1PR		(3 << 4)	/* Master 1 Priority */
-#define		AT91_MATRIX_M2PR		(3 << 8)	/* Master 2 Priority */
-#define		AT91_MATRIX_M3PR		(3 << 12)	/* Master 3 Priority */
-#define		AT91_MATRIX_M4PR		(3 << 16)	/* Master 4 Priority */
-#define		AT91_MATRIX_M5PR		(3 << 20)	/* Master 5 Priority */
-#define		AT91_MATRIX_M6PR		(3 << 24)	/* Master 6 Priority */
-#define		AT91_MATRIX_M7PR		(3 << 28)	/* Master 7 Priority */
-#define		AT91_MATRIX_M8PR		(3 << 0)	/* Master 8 Priority (in Register B) */
-#define		AT91_MATRIX_M9PR		(3 << 4)	/* Master 9 Priority (in Register B) */
-#define		AT91_MATRIX_M10PR		(3 << 8)	/* Master 10 Priority (in Register B) */
-#define		AT91_MATRIX_M11PR		(3 << 12)	/* Master 11 Priority (in Register B) */
-
-#define AT91_MATRIX_MRCR	0x100			/* Master Remap Control Register */
-#define		AT91_MATRIX_RCB0		(1 << 0)	/* Remap Command for AHB Master 0 (ARM926EJ-S Instruction Master) */
-#define		AT91_MATRIX_RCB1		(1 << 1)	/* Remap Command for AHB Master 1 (ARM926EJ-S Data Master) */
-#define		AT91_MATRIX_RCB2		(1 << 2)
-#define		AT91_MATRIX_RCB3		(1 << 3)
-#define		AT91_MATRIX_RCB4		(1 << 4)
-#define		AT91_MATRIX_RCB5		(1 << 5)
-#define		AT91_MATRIX_RCB6		(1 << 6)
-#define		AT91_MATRIX_RCB7		(1 << 7)
-#define		AT91_MATRIX_RCB8		(1 << 8)
-#define		AT91_MATRIX_RCB9		(1 << 9)
-#define		AT91_MATRIX_RCB10		(1 << 10)
-#define		AT91_MATRIX_RCB11		(1 << 11)
-
-#define AT91_MATRIX_TCMR	0x110			/* TCM Configuration Register */
-#define		AT91_MATRIX_ITCM_SIZE		(0xf << 0)	/* Size of ITCM enabled memory block */
-#define			AT91_MATRIX_ITCM_0		(0 << 0)
-#define			AT91_MATRIX_ITCM_32		(6 << 0)
-#define		AT91_MATRIX_DTCM_SIZE		(0xf << 4)	/* Size of DTCM enabled memory block */
-#define			AT91_MATRIX_DTCM_0		(0 << 4)
-#define			AT91_MATRIX_DTCM_32		(6 << 4)
-#define			AT91_MATRIX_DTCM_64		(7 << 4)
-#define		AT91_MATRIX_TCM_NWS		(0x1 << 11)	/* Wait state TCM register */
-#define			AT91_MATRIX_TCM_NO_WS		(0x0 << 11)
-#define			AT91_MATRIX_TCM_ONE_WS		(0x1 << 11)
-
-#define AT91_MATRIX_VIDEO	0x118			/* Video Mode Configuration Register */
-#define		AT91C_VDEC_SEL			(0x1 <<  0) /* Video Mode Selection */
-#define			AT91C_VDEC_SEL_OFF		(0 << 0)
-#define			AT91C_VDEC_SEL_ON		(1 << 0)
-
-#define AT91_MATRIX_EBICSA	0x128			/* EBI Chip Select Assignment Register */
-#define		AT91_MATRIX_EBI_CS1A		(1 << 1)	/* Chip Select 1 Assignment */
-#define			AT91_MATRIX_EBI_CS1A_SMC		(0 << 1)
-#define			AT91_MATRIX_EBI_CS1A_SDRAMC		(1 << 1)
-#define		AT91_MATRIX_EBI_CS3A		(1 << 3)	/* Chip Select 3 Assignment */
-#define			AT91_MATRIX_EBI_CS3A_SMC		(0 << 3)
-#define			AT91_MATRIX_EBI_CS3A_SMC_SMARTMEDIA	(1 << 3)
-#define		AT91_MATRIX_EBI_CS4A		(1 << 4)	/* Chip Select 4 Assignment */
-#define			AT91_MATRIX_EBI_CS4A_SMC		(0 << 4)
-#define			AT91_MATRIX_EBI_CS4A_SMC_CF0		(1 << 4)
-#define		AT91_MATRIX_EBI_CS5A		(1 << 5)	/* Chip Select 5 Assignment */
-#define			AT91_MATRIX_EBI_CS5A_SMC		(0 << 5)
-#define			AT91_MATRIX_EBI_CS5A_SMC_CF1		(1 << 5)
-#define		AT91_MATRIX_EBI_DBPUC		(1 << 8)	/* Data Bus Pull-up Configuration */
-#define			AT91_MATRIX_EBI_DBPU_ON			(0 << 8)
-#define			AT91_MATRIX_EBI_DBPU_OFF		(1 << 8)
-#define		AT91_MATRIX_EBI_VDDIOMSEL	(1 << 16)	/* Memory voltage selection */
-#define			AT91_MATRIX_EBI_VDDIOMSEL_1_8V		(0 << 16)
-#define			AT91_MATRIX_EBI_VDDIOMSEL_3_3V		(1 << 16)
-#define		AT91_MATRIX_EBI_EBI_IOSR	(1 << 17)	/* EBI I/O slew rate selection */
-#define			AT91_MATRIX_EBI_EBI_IOSR_REDUCED	(0 << 17)
-#define			AT91_MATRIX_EBI_EBI_IOSR_NORMAL		(1 << 17)
-#define		AT91_MATRIX_EBI_DDR_IOSR	(1 << 18)	/* DDR2 dedicated port I/O slew rate selection */
-#define			AT91_MATRIX_EBI_DDR_IOSR_REDUCED	(0 << 18)
-#define			AT91_MATRIX_EBI_DDR_IOSR_NORMAL		(1 << 18)
-
-#define AT91_MATRIX_WPMR	0x1E4			/* Write Protect Mode Register */
-#define		AT91_MATRIX_WPMR_WPEN		(1 << 0)	/* Write Protect ENable */
-#define			AT91_MATRIX_WPMR_WP_WPDIS		(0 << 0)
-#define			AT91_MATRIX_WPMR_WP_WPEN		(1 << 0)
-#define		AT91_MATRIX_WPMR_WPKEY		(0xFFFFFF << 8)	/* Write Protect KEY */
-
-#define AT91_MATRIX_WPSR	0x1E8			/* Write Protect Status Register */
-#define		AT91_MATRIX_WPSR_WPVS		(1 << 0)	/* Write Protect Violation Status */
-#define			AT91_MATRIX_WPSR_NO_WPV		(0 << 0)
-#define			AT91_MATRIX_WPSR_WPV		(1 << 0)
-#define		AT91_MATRIX_WPSR_WPVSRC		(0xFFFF << 8)	/* Write Protect Violation Source */
-
-#endif
diff --git a/arch/arm/mach-at91/include/mach/at91sam9n12_matrix.h b/arch/arm/mach-at91/include/mach/at91sam9n12_matrix.h
deleted file mode 100644
index 40060cd62fa9..000000000000
--- a/arch/arm/mach-at91/include/mach/at91sam9n12_matrix.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Matrix-centric header file for the AT91SAM9N12
- *
- * Copyright (C) 2012 Atmel Corporation.
- *
- * Only EBI related registers.
- * Write Protect register definitions may be useful.
- *
- * Licensed under GPLv2 or later.
- */
-
-#ifndef _AT91SAM9N12_MATRIX_H_
-#define _AT91SAM9N12_MATRIX_H_
-
-#define AT91_MATRIX_EBICSA	(AT91_MATRIX + 0x118)	/* EBI Chip Select Assignment Register */
-#define		AT91_MATRIX_EBI_CS1A		(1 << 1)	/* Chip Select 1 Assignment */
-#define			AT91_MATRIX_EBI_CS1A_SMC		(0 << 1)
-#define			AT91_MATRIX_EBI_CS1A_SDRAMC		(1 << 1)
-#define		AT91_MATRIX_EBI_CS3A		(1 << 3)	/* Chip Select 3 Assignment */
-#define			AT91_MATRIX_EBI_CS3A_SMC		(0 << 3)
-#define			AT91_MATRIX_EBI_CS3A_SMC_NANDFLASH	(1 << 3)
-#define		AT91_MATRIX_EBI_DBPUC		(1 << 8)	/* Data Bus Pull-up Configuration */
-#define			AT91_MATRIX_EBI_DBPU_ON			(0 << 8)
-#define			AT91_MATRIX_EBI_DBPU_OFF		(1 << 8)
-#define		AT91_MATRIX_EBI_VDDIOMSEL	(1 << 16)	/* Memory voltage selection */
-#define			AT91_MATRIX_EBI_VDDIOMSEL_1_8V		(0 << 16)
-#define			AT91_MATRIX_EBI_VDDIOMSEL_3_3V		(1 << 16)
-#define		AT91_MATRIX_EBI_EBI_IOSR	(1 << 17)	/* EBI I/O slew rate selection */
-#define			AT91_MATRIX_EBI_EBI_IOSR_REDUCED	(0 << 17)
-#define			AT91_MATRIX_EBI_EBI_IOSR_NORMAL		(1 << 17)
-#define		AT91_MATRIX_EBI_DDR_IOSR	(1 << 18)	/* DDR2 dedicated port I/O slew rate selection */
-#define			AT91_MATRIX_EBI_DDR_IOSR_REDUCED	(0 << 18)
-#define			AT91_MATRIX_EBI_DDR_IOSR_NORMAL		(1 << 18)
-#define		AT91_MATRIX_NFD0_SELECT		(1 << 24)	/* NAND Flash Data Bus Selection */
-#define			AT91_MATRIX_NFD0_ON_D0			(0 << 24)
-#define			AT91_MATRIX_NFD0_ON_D16			(1 << 24)
-#define		AT91_MATRIX_DDR_MP_EN		(1 << 25)	/* DDR Multi-port Enable */
-#define			AT91_MATRIX_MP_OFF			(0 << 25)
-#define			AT91_MATRIX_MP_ON			(1 << 25)
-
-#define AT91_MATRIX_WPMR	(AT91_MATRIX + 0x1E4)	/* Write Protect Mode Register */
-#define		AT91_MATRIX_WPMR_WPEN		(1 << 0)	/* Write Protect ENable */
-#define			AT91_MATRIX_WPMR_WP_WPDIS		(0 << 0)
-#define			AT91_MATRIX_WPMR_WP_WPEN		(1 << 0)
-#define		AT91_MATRIX_WPMR_WPKEY		(0xFFFFFF << 8)	/* Write Protect KEY */
-
-#define AT91_MATRIX_WPSR	(AT91_MATRIX + 0x1E8)	/* Write Protect Status Register */
-#define		AT91_MATRIX_WPSR_WPVS		(1 << 0)	/* Write Protect Violation Status */
-#define			AT91_MATRIX_WPSR_NO_WPV		(0 << 0)
-#define			AT91_MATRIX_WPSR_WPV		(1 << 0)
-#define		AT91_MATRIX_WPSR_WPVSRC		(0xFFFF << 8)	/* Write Protect Violation Source */
-
-#endif
diff --git a/arch/arm/mach-at91/include/mach/at91sam9rl_matrix.h b/arch/arm/mach-at91/include/mach/at91sam9rl_matrix.h
deleted file mode 100644
index 6d160adadafc..000000000000
--- a/arch/arm/mach-at91/include/mach/at91sam9rl_matrix.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * arch/arm/mach-at91/include/mach/at91sam9rl_matrix.h
- *
- *  Copyright (C) 2007 Atmel Corporation
- *
- * Memory Controllers (MATRIX, EBI) - System peripherals registers.
- * Based on AT91SAM9RL datasheet revision A. (Preliminary)
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file COPYING in the main directory of this archive for
- * more details.
- */
-
-#ifndef AT91SAM9RL_MATRIX_H
-#define AT91SAM9RL_MATRIX_H
-
-#define AT91_MATRIX_MCFG0	0x00			/* Master Configuration Register 0 */
-#define AT91_MATRIX_MCFG1	0x04			/* Master Configuration Register 1 */
-#define AT91_MATRIX_MCFG2	0x08			/* Master Configuration Register 2 */
-#define AT91_MATRIX_MCFG3	0x0C			/* Master Configuration Register 3 */
-#define AT91_MATRIX_MCFG4	0x10			/* Master Configuration Register 4 */
-#define AT91_MATRIX_MCFG5	0x14			/* Master Configuration Register 5 */
-#define		AT91_MATRIX_ULBT	(7 << 0)	/* Undefined Length Burst Type */
-#define			AT91_MATRIX_ULBT_INFINITE	(0 << 0)
-#define			AT91_MATRIX_ULBT_SINGLE		(1 << 0)
-#define			AT91_MATRIX_ULBT_FOUR		(2 << 0)
-#define			AT91_MATRIX_ULBT_EIGHT		(3 << 0)
-#define			AT91_MATRIX_ULBT_SIXTEEN	(4 << 0)
-
-#define AT91_MATRIX_SCFG0	0x40			/* Slave Configuration Register 0 */
-#define AT91_MATRIX_SCFG1	0x44			/* Slave Configuration Register 1 */
-#define AT91_MATRIX_SCFG2	0x48			/* Slave Configuration Register 2 */
-#define AT91_MATRIX_SCFG3	0x4C			/* Slave Configuration Register 3 */
-#define AT91_MATRIX_SCFG4	0x50			/* Slave Configuration Register 4 */
-#define AT91_MATRIX_SCFG5	0x54			/* Slave Configuration Register 5 */
-#define		AT91_MATRIX_SLOT_CYCLE		(0xff << 0)	/* Maximum Number of Allowed Cycles for a Burst */
-#define		AT91_MATRIX_DEFMSTR_TYPE	(3    << 16)	/* Default Master Type */
-#define			AT91_MATRIX_DEFMSTR_TYPE_NONE	(0 << 16)
-#define			AT91_MATRIX_DEFMSTR_TYPE_LAST	(1 << 16)
-#define			AT91_MATRIX_DEFMSTR_TYPE_FIXED	(2 << 16)
-#define		AT91_MATRIX_FIXED_DEFMSTR	(0xf  << 18)	/* Fixed Index of Default Master */
-#define		AT91_MATRIX_ARBT		(3    << 24)	/* Arbitration Type */
-#define			AT91_MATRIX_ARBT_ROUND_ROBIN	(0 << 24)
-#define			AT91_MATRIX_ARBT_FIXED_PRIORITY	(1 << 24)
-
-#define AT91_MATRIX_PRAS0	0x80			/* Priority Register A for Slave 0 */
-#define AT91_MATRIX_PRAS1	0x88			/* Priority Register A for Slave 1 */
-#define AT91_MATRIX_PRAS2	0x90			/* Priority Register A for Slave 2 */
-#define AT91_MATRIX_PRAS3	0x98			/* Priority Register A for Slave 3 */
-#define AT91_MATRIX_PRAS4	0xA0			/* Priority Register A for Slave 4 */
-#define AT91_MATRIX_PRAS5	0xA8			/* Priority Register A for Slave 5 */
-#define		AT91_MATRIX_M0PR		(3 << 0)	/* Master 0 Priority */
-#define		AT91_MATRIX_M1PR		(3 << 4)	/* Master 1 Priority */
-#define		AT91_MATRIX_M2PR		(3 << 8)	/* Master 2 Priority */
-#define		AT91_MATRIX_M3PR		(3 << 12)	/* Master 3 Priority */
-#define		AT91_MATRIX_M4PR		(3 << 16)	/* Master 4 Priority */
-#define		AT91_MATRIX_M5PR		(3 << 20)	/* Master 5 Priority */
-
-#define AT91_MATRIX_MRCR	0x100			/* Master Remap Control Register */
-#define		AT91_MATRIX_RCB0		(1 << 0)	/* Remap Command for AHB Master 0 (ARM926EJ-S Instruction Master) */
-#define		AT91_MATRIX_RCB1		(1 << 1)	/* Remap Command for AHB Master 1 (ARM926EJ-S Data Master) */
-#define		AT91_MATRIX_RCB2		(1 << 2)
-#define		AT91_MATRIX_RCB3		(1 << 3)
-#define		AT91_MATRIX_RCB4		(1 << 4)
-#define		AT91_MATRIX_RCB5		(1 << 5)
-
-#define AT91_MATRIX_TCMR	0x114			/* TCM Configuration Register */
-#define		AT91_MATRIX_ITCM_SIZE		(0xf << 0)	/* Size of ITCM enabled memory block */
-#define			AT91_MATRIX_ITCM_0		(0 << 0)
-#define			AT91_MATRIX_ITCM_16		(5 << 0)
-#define			AT91_MATRIX_ITCM_32		(6 << 0)
-#define		AT91_MATRIX_DTCM_SIZE		(0xf << 4)	/* Size of DTCM enabled memory block */
-#define			AT91_MATRIX_DTCM_0		(0 << 4)
-#define			AT91_MATRIX_DTCM_16		(5 << 4)
-#define			AT91_MATRIX_DTCM_32		(6 << 4)
-
-#define AT91_MATRIX_EBICSA	0x120			/* EBI0 Chip Select Assignment Register */
-#define		AT91_MATRIX_CS1A		(1 << 1)	/* Chip Select 1 Assignment */
-#define			AT91_MATRIX_CS1A_SMC		(0 << 1)
-#define			AT91_MATRIX_CS1A_SDRAMC		(1 << 1)
-#define		AT91_MATRIX_CS3A		(1 << 3)	/* Chip Select 3 Assignment */
-#define			AT91_MATRIX_CS3A_SMC		(0 << 3)
-#define			AT91_MATRIX_CS3A_SMC_SMARTMEDIA	(1 << 3)
-#define		AT91_MATRIX_CS4A		(1 << 4)	/* Chip Select 4 Assignment */
-#define			AT91_MATRIX_CS4A_SMC		(0 << 4)
-#define			AT91_MATRIX_CS4A_SMC_CF1	(1 << 4)
-#define		AT91_MATRIX_CS5A		(1 << 5)	/* Chip Select 5 Assignment */
-#define			AT91_MATRIX_CS5A_SMC		(0 << 5)
-#define			AT91_MATRIX_CS5A_SMC_CF2	(1 << 5)
-#define		AT91_MATRIX_DBPUC		(1 << 8)	/* Data Bus Pull-up Configuration */
-#define		AT91_MATRIX_VDDIOMSEL		(1 << 16)	/* Memory voltage selection */
-#define			AT91_MATRIX_VDDIOMSEL_1_8V	(0 << 16)
-#define			AT91_MATRIX_VDDIOMSEL_3_3V	(1 << 16)
-
-
-#endif
diff --git a/arch/arm/mach-at91/include/mach/at91sam9x5_matrix.h b/arch/arm/mach-at91/include/mach/at91sam9x5_matrix.h
deleted file mode 100644
index a606d3966470..000000000000
--- a/arch/arm/mach-at91/include/mach/at91sam9x5_matrix.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Matrix-centric header file for the AT91SAM9x5 family
- *
- *  Copyright (C) 2009-2012 Atmel Corporation.
- *
- * Only EBI related registers.
- * Write Protect register definitions may be useful.
- *
- * Licensed under GPLv2 or later.
- */
-
-#ifndef AT91SAM9X5_MATRIX_H
-#define AT91SAM9X5_MATRIX_H
-
-#define AT91_MATRIX_EBICSA	(AT91_MATRIX + 0x120)	/* EBI Chip Select Assignment Register */
-#define		AT91_MATRIX_EBI_CS1A		(1 << 1)	/* Chip Select 1 Assignment */
-#define			AT91_MATRIX_EBI_CS1A_SMC		(0 << 1)
-#define			AT91_MATRIX_EBI_CS1A_SDRAMC		(1 << 1)
-#define		AT91_MATRIX_EBI_CS3A		(1 << 3)	/* Chip Select 3 Assignment */
-#define			AT91_MATRIX_EBI_CS3A_SMC		(0 << 3)
-#define			AT91_MATRIX_EBI_CS3A_SMC_NANDFLASH	(1 << 3)
-#define		AT91_MATRIX_EBI_DBPUC		(1 << 8)	/* Data Bus Pull-up Configuration */
-#define			AT91_MATRIX_EBI_DBPU_ON			(0 << 8)
-#define			AT91_MATRIX_EBI_DBPU_OFF		(1 << 8)
-#define		AT91_MATRIX_EBI_VDDIOMSEL	(1 << 16)	/* Memory voltage selection */
-#define			AT91_MATRIX_EBI_VDDIOMSEL_1_8V		(0 << 16)
-#define			AT91_MATRIX_EBI_VDDIOMSEL_3_3V		(1 << 16)
-#define		AT91_MATRIX_EBI_EBI_IOSR	(1 << 17)	/* EBI I/O slew rate selection */
-#define			AT91_MATRIX_EBI_EBI_IOSR_REDUCED	(0 << 17)
-#define			AT91_MATRIX_EBI_EBI_IOSR_NORMAL		(1 << 17)
-#define		AT91_MATRIX_EBI_DDR_IOSR	(1 << 18)	/* DDR2 dedicated port I/O slew rate selection */
-#define			AT91_MATRIX_EBI_DDR_IOSR_REDUCED	(0 << 18)
-#define			AT91_MATRIX_EBI_DDR_IOSR_NORMAL		(1 << 18)
-#define		AT91_MATRIX_NFD0_SELECT		(1 << 24)	/* NAND Flash Data Bus Selection */
-#define			AT91_MATRIX_NFD0_ON_D0			(0 << 24)
-#define			AT91_MATRIX_NFD0_ON_D16			(1 << 24)
-#define		AT91_MATRIX_DDR_MP_EN		(1 << 25)	/* DDR Multi-port Enable */
-#define			AT91_MATRIX_MP_OFF			(0 << 25)
-#define			AT91_MATRIX_MP_ON			(1 << 25)
-
-#define AT91_MATRIX_WPMR	(AT91_MATRIX + 0x1E4)	/* Write Protect Mode Register */
-#define		AT91_MATRIX_WPMR_WPEN		(1 << 0)	/* Write Protect ENable */
-#define			AT91_MATRIX_WPMR_WP_WPDIS		(0 << 0)
-#define			AT91_MATRIX_WPMR_WP_WPEN		(1 << 0)
-#define		AT91_MATRIX_WPMR_WPKEY		(0xFFFFFF << 8)	/* Write Protect KEY */
-
-#define AT91_MATRIX_WPSR	(AT91_MATRIX + 0x1E8)	/* Write Protect Status Register */
-#define		AT91_MATRIX_WPSR_WPVS		(1 << 0)	/* Write Protect Violation Status */
-#define			AT91_MATRIX_WPSR_NO_WPV		(0 << 0)
-#define			AT91_MATRIX_WPSR_WPV		(1 << 0)
-#define		AT91_MATRIX_WPSR_WPVSRC		(0xFFFF << 8)	/* Write Protect Violation Source */
-
-#endif
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 56+ messages in thread

* [PATCH 08/17] ARM: at91: stop using HAVE_AT91_DBGUx
  2015-01-15 21:58 ` Alexandre Belloni
@ 2015-01-15 21:58   ` Alexandre Belloni
  -1 siblings, 0 replies; 56+ messages in thread
From: Alexandre Belloni @ 2015-01-15 21:58 UTC (permalink / raw)
  To: Nicolas Ferre
  Cc: Jean-Christophe Plagniol-Villard, Arnd Bergmann, Boris Brezillon,
	Bo Shen, Wenyou Yang, linux-arm-kernel, linux-kernel,
	Alexandre Belloni

In order to remove SOC_SAM9xxx options, stop using HAVE_AT91_DBGUx.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
---
 arch/arm/Kconfig.debug     |  6 +++---
 arch/arm/mach-at91/Kconfig | 19 -------------------
 2 files changed, 3 insertions(+), 22 deletions(-)

diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
index e34d24949c6a..42a38731da99 100644
--- a/arch/arm/Kconfig.debug
+++ b/arch/arm/Kconfig.debug
@@ -117,17 +117,17 @@ choice
 	config AT91_DEBUG_LL_DBGU0
 		bool "Kernel low-level debugging on rm9200, 9260/9g20, 9261/9g10, 9rl, 9x5, 9n12"
 		select DEBUG_AT91_UART
-		depends on HAVE_AT91_DBGU0
+		depends on SOC_AT91RM9200 || SOC_AT91SAM9
 
 	config AT91_DEBUG_LL_DBGU1
 		bool "Kernel low-level debugging on 9263, 9g45 and sama5d3"
 		select DEBUG_AT91_UART
-		depends on HAVE_AT91_DBGU1
+		depends on SOC_AT91SAM9 || SOC_SAMA5
 
 	config AT91_DEBUG_LL_DBGU2
 		bool "Kernel low-level debugging on sama5d4"
 		select DEBUG_AT91_UART
-		depends on HAVE_AT91_DBGU2
+		depends on SOC_SAMA5
 
 	config DEBUG_BCM2835
 		bool "Kernel low-level debugging on BCM2835 PL011 UART"
diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
index b7dcef50db23..c6956b863b9d 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -6,15 +6,6 @@ config HAVE_AT91_UTMI
 config HAVE_AT91_USB_CLK
 	bool
 
-config HAVE_AT91_DBGU0
-	bool
-
-config HAVE_AT91_DBGU1
-	bool
-
-config HAVE_AT91_DBGU2
-	bool
-
 config COMMON_CLK_AT91
 	bool
 	select COMMON_CLK
@@ -70,7 +61,6 @@ config SOC_SAMA5D3
 	bool "SAMA5D3 family"
 	select SOC_SAMA5
 	select HAVE_FB_ATMEL
-	select HAVE_AT91_DBGU1
 	select HAVE_AT91_UTMI
 	select HAVE_AT91_SMD
 	select HAVE_AT91_USB_CLK
@@ -81,7 +71,6 @@ config SOC_SAMA5D3
 config SOC_SAMA5D4
 	bool "SAMA5D4 family"
 	select SOC_SAMA5
-	select HAVE_AT91_DBGU2
 	select CLKSRC_MMIO
 	select CACHE_L2X0
 	select CACHE_PL310
@@ -101,12 +90,10 @@ config SOC_AT91RM9200
 	select COMMON_CLK_AT91
 	select CPU_ARM920T
 	select GENERIC_CLOCKEVENTS
-	select HAVE_AT91_DBGU0
 	select HAVE_AT91_USB_CLK
 
 config SOC_AT91SAM9260
 	bool "AT91SAM9260, AT91SAM9XE or AT91SAM9G20"
-	select HAVE_AT91_DBGU0
 	select SOC_AT91SAM9
 	select HAVE_AT91_USB_CLK
 	help
@@ -115,7 +102,6 @@ config SOC_AT91SAM9260
 
 config SOC_AT91SAM9261
 	bool "AT91SAM9261 or AT91SAM9G10"
-	select HAVE_AT91_DBGU0
 	select HAVE_FB_ATMEL
 	select SOC_AT91SAM9
 	select HAVE_AT91_USB_CLK
@@ -124,21 +110,18 @@ config SOC_AT91SAM9261
 
 config SOC_AT91SAM9263
 	bool "AT91SAM9263"
-	select HAVE_AT91_DBGU1
 	select HAVE_FB_ATMEL
 	select SOC_AT91SAM9
 	select HAVE_AT91_USB_CLK
 
 config SOC_AT91SAM9RL
 	bool "AT91SAM9RL"
-	select HAVE_AT91_DBGU0
 	select HAVE_FB_ATMEL
 	select SOC_AT91SAM9
 	select HAVE_AT91_UTMI
 
 config SOC_AT91SAM9G45
 	bool "AT91SAM9G45 or AT91SAM9M10 families"
-	select HAVE_AT91_DBGU1
 	select HAVE_FB_ATMEL
 	select SOC_AT91SAM9
 	select HAVE_AT91_UTMI
@@ -149,7 +132,6 @@ config SOC_AT91SAM9G45
 
 config SOC_AT91SAM9X5
 	bool "AT91SAM9x5 family"
-	select HAVE_AT91_DBGU0
 	select HAVE_FB_ATMEL
 	select SOC_AT91SAM9
 	select HAVE_AT91_UTMI
@@ -164,7 +146,6 @@ config SOC_AT91SAM9X5
 
 config SOC_AT91SAM9N12
 	bool "AT91SAM9N12 family"
-	select HAVE_AT91_DBGU0
 	select HAVE_FB_ATMEL
 	select SOC_AT91SAM9
 	select HAVE_AT91_USB_CLK
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 56+ messages in thread

* [PATCH 08/17] ARM: at91: stop using HAVE_AT91_DBGUx
@ 2015-01-15 21:58   ` Alexandre Belloni
  0 siblings, 0 replies; 56+ messages in thread
From: Alexandre Belloni @ 2015-01-15 21:58 UTC (permalink / raw)
  To: linux-arm-kernel

In order to remove SOC_SAM9xxx options, stop using HAVE_AT91_DBGUx.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
---
 arch/arm/Kconfig.debug     |  6 +++---
 arch/arm/mach-at91/Kconfig | 19 -------------------
 2 files changed, 3 insertions(+), 22 deletions(-)

diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
index e34d24949c6a..42a38731da99 100644
--- a/arch/arm/Kconfig.debug
+++ b/arch/arm/Kconfig.debug
@@ -117,17 +117,17 @@ choice
 	config AT91_DEBUG_LL_DBGU0
 		bool "Kernel low-level debugging on rm9200, 9260/9g20, 9261/9g10, 9rl, 9x5, 9n12"
 		select DEBUG_AT91_UART
-		depends on HAVE_AT91_DBGU0
+		depends on SOC_AT91RM9200 || SOC_AT91SAM9
 
 	config AT91_DEBUG_LL_DBGU1
 		bool "Kernel low-level debugging on 9263, 9g45 and sama5d3"
 		select DEBUG_AT91_UART
-		depends on HAVE_AT91_DBGU1
+		depends on SOC_AT91SAM9 || SOC_SAMA5
 
 	config AT91_DEBUG_LL_DBGU2
 		bool "Kernel low-level debugging on sama5d4"
 		select DEBUG_AT91_UART
-		depends on HAVE_AT91_DBGU2
+		depends on SOC_SAMA5
 
 	config DEBUG_BCM2835
 		bool "Kernel low-level debugging on BCM2835 PL011 UART"
diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
index b7dcef50db23..c6956b863b9d 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -6,15 +6,6 @@ config HAVE_AT91_UTMI
 config HAVE_AT91_USB_CLK
 	bool
 
-config HAVE_AT91_DBGU0
-	bool
-
-config HAVE_AT91_DBGU1
-	bool
-
-config HAVE_AT91_DBGU2
-	bool
-
 config COMMON_CLK_AT91
 	bool
 	select COMMON_CLK
@@ -70,7 +61,6 @@ config SOC_SAMA5D3
 	bool "SAMA5D3 family"
 	select SOC_SAMA5
 	select HAVE_FB_ATMEL
-	select HAVE_AT91_DBGU1
 	select HAVE_AT91_UTMI
 	select HAVE_AT91_SMD
 	select HAVE_AT91_USB_CLK
@@ -81,7 +71,6 @@ config SOC_SAMA5D3
 config SOC_SAMA5D4
 	bool "SAMA5D4 family"
 	select SOC_SAMA5
-	select HAVE_AT91_DBGU2
 	select CLKSRC_MMIO
 	select CACHE_L2X0
 	select CACHE_PL310
@@ -101,12 +90,10 @@ config SOC_AT91RM9200
 	select COMMON_CLK_AT91
 	select CPU_ARM920T
 	select GENERIC_CLOCKEVENTS
-	select HAVE_AT91_DBGU0
 	select HAVE_AT91_USB_CLK
 
 config SOC_AT91SAM9260
 	bool "AT91SAM9260, AT91SAM9XE or AT91SAM9G20"
-	select HAVE_AT91_DBGU0
 	select SOC_AT91SAM9
 	select HAVE_AT91_USB_CLK
 	help
@@ -115,7 +102,6 @@ config SOC_AT91SAM9260
 
 config SOC_AT91SAM9261
 	bool "AT91SAM9261 or AT91SAM9G10"
-	select HAVE_AT91_DBGU0
 	select HAVE_FB_ATMEL
 	select SOC_AT91SAM9
 	select HAVE_AT91_USB_CLK
@@ -124,21 +110,18 @@ config SOC_AT91SAM9261
 
 config SOC_AT91SAM9263
 	bool "AT91SAM9263"
-	select HAVE_AT91_DBGU1
 	select HAVE_FB_ATMEL
 	select SOC_AT91SAM9
 	select HAVE_AT91_USB_CLK
 
 config SOC_AT91SAM9RL
 	bool "AT91SAM9RL"
-	select HAVE_AT91_DBGU0
 	select HAVE_FB_ATMEL
 	select SOC_AT91SAM9
 	select HAVE_AT91_UTMI
 
 config SOC_AT91SAM9G45
 	bool "AT91SAM9G45 or AT91SAM9M10 families"
-	select HAVE_AT91_DBGU1
 	select HAVE_FB_ATMEL
 	select SOC_AT91SAM9
 	select HAVE_AT91_UTMI
@@ -149,7 +132,6 @@ config SOC_AT91SAM9G45
 
 config SOC_AT91SAM9X5
 	bool "AT91SAM9x5 family"
-	select HAVE_AT91_DBGU0
 	select HAVE_FB_ATMEL
 	select SOC_AT91SAM9
 	select HAVE_AT91_UTMI
@@ -164,7 +146,6 @@ config SOC_AT91SAM9X5
 
 config SOC_AT91SAM9N12
 	bool "AT91SAM9N12 family"
-	select HAVE_AT91_DBGU0
 	select HAVE_FB_ATMEL
 	select SOC_AT91SAM9
 	select HAVE_AT91_USB_CLK
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 56+ messages in thread

* [PATCH 09/17] ARM: at91: pm: remove warning to remove SOC_AT91SAM9263 usage
  2015-01-15 21:58 ` Alexandre Belloni
@ 2015-01-15 21:58   ` Alexandre Belloni
  -1 siblings, 0 replies; 56+ messages in thread
From: Alexandre Belloni @ 2015-01-15 21:58 UTC (permalink / raw)
  To: Nicolas Ferre
  Cc: Jean-Christophe Plagniol-Villard, Arnd Bergmann, Boris Brezillon,
	Bo Shen, Wenyou Yang, linux-arm-kernel, linux-kernel,
	Alexandre Belloni

The SOC_AT91SAM9263 is being removed, stop using it.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
---
 arch/arm/mach-at91/pm_slowclock.S | 9 ---------
 1 file changed, 9 deletions(-)

diff --git a/arch/arm/mach-at91/pm_slowclock.S b/arch/arm/mach-at91/pm_slowclock.S
index 20018779bae7..556151e85ec4 100644
--- a/arch/arm/mach-at91/pm_slowclock.S
+++ b/arch/arm/mach-at91/pm_slowclock.S
@@ -17,15 +17,6 @@
 #include <mach/hardware.h>
 #include <mach/at91_ramc.h>
 
-
-#ifdef CONFIG_SOC_AT91SAM9263
-/*
- * FIXME either or both the SDRAM controllers (EB0, EB1) might be in use;
- * handle those cases both here and in the Suspend-To-RAM support.
- */
-#warning Assuming EB1 SDRAM controller is *NOT* used
-#endif
-
 /*
  * When SLOWDOWN_MASTER_CLOCK is defined we will also slow down the Master
  * clock during suspend by adjusting its prescalar and divisor.
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 56+ messages in thread

* [PATCH 09/17] ARM: at91: pm: remove warning to remove SOC_AT91SAM9263 usage
@ 2015-01-15 21:58   ` Alexandre Belloni
  0 siblings, 0 replies; 56+ messages in thread
From: Alexandre Belloni @ 2015-01-15 21:58 UTC (permalink / raw)
  To: linux-arm-kernel

The SOC_AT91SAM9263 is being removed, stop using it.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
---
 arch/arm/mach-at91/pm_slowclock.S | 9 ---------
 1 file changed, 9 deletions(-)

diff --git a/arch/arm/mach-at91/pm_slowclock.S b/arch/arm/mach-at91/pm_slowclock.S
index 20018779bae7..556151e85ec4 100644
--- a/arch/arm/mach-at91/pm_slowclock.S
+++ b/arch/arm/mach-at91/pm_slowclock.S
@@ -17,15 +17,6 @@
 #include <mach/hardware.h>
 #include <mach/at91_ramc.h>
 
-
-#ifdef CONFIG_SOC_AT91SAM9263
-/*
- * FIXME either or both the SDRAM controllers (EB0, EB1) might be in use;
- * handle those cases both here and in the Suspend-To-RAM support.
- */
-#warning Assuming EB1 SDRAM controller is *NOT* used
-#endif
-
 /*
  * When SLOWDOWN_MASTER_CLOCK is defined we will also slow down the Master
  * clock during suspend by adjusting its prescalar and divisor.
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 56+ messages in thread

* [PATCH 10/17] ARM: at91: merge SOC_AT91SAM9xxx
  2015-01-15 21:58 ` Alexandre Belloni
@ 2015-01-15 21:58   ` Alexandre Belloni
  -1 siblings, 0 replies; 56+ messages in thread
From: Alexandre Belloni @ 2015-01-15 21:58 UTC (permalink / raw)
  To: Nicolas Ferre
  Cc: Jean-Christophe Plagniol-Villard, Arnd Bergmann, Boris Brezillon,
	Bo Shen, Wenyou Yang, linux-arm-kernel, linux-kernel,
	Alexandre Belloni

Only use SOC_AT91SAM9 for all the at91sam9 SoCs.

It enables HAVE_AT91_SMD and HAVE_AT91_UTMI for all the sam9 SoCs but this only
represents 96 bytes of uncompressed kernel code.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
---
 arch/arm/configs/at91_dt_defconfig | 10 +----
 arch/arm/mach-at91/Kconfig         | 92 +++++++++++---------------------------
 2 files changed, 27 insertions(+), 75 deletions(-)

diff --git a/arch/arm/configs/at91_dt_defconfig b/arch/arm/configs/at91_dt_defconfig
index 8116d122e098..811e72bbe642 100644
--- a/arch/arm/configs/at91_dt_defconfig
+++ b/arch/arm/configs/at91_dt_defconfig
@@ -15,15 +15,7 @@ CONFIG_MODULE_UNLOAD=y
 # CONFIG_IOSCHED_CFQ is not set
 CONFIG_ARCH_AT91=y
 CONFIG_SOC_AT91RM9200=y
-CONFIG_SOC_AT91SAM9260=y
-CONFIG_SOC_AT91SAM9261=y
-CONFIG_SOC_AT91SAM9263=y
-CONFIG_SOC_AT91SAM9RL=y
-CONFIG_SOC_AT91SAM9G45=y
-CONFIG_SOC_AT91SAM9X5=y
-CONFIG_SOC_AT91SAM9N12=y
-CONFIG_MACH_AT91RM9200_DT=y
-CONFIG_MACH_AT91SAM9_DT=y
+CONFIG_SOC_AT91SAM9=y
 CONFIG_AT91_TIMER_HZ=128
 CONFIG_AEABI=y
 CONFIG_UACCESS_WITH_MEMCPY=y
diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
index c6956b863b9d..c6740e359a44 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -16,15 +16,6 @@ config HAVE_AT91_SMD
 config HAVE_AT91_H32MX
 	bool
 
-config SOC_AT91SAM9
-	bool
-	select ATMEL_AIC_IRQ
-	select COMMON_CLK_AT91
-	select CPU_ARM926T
-	select GENERIC_CLOCKEVENTS
-	select MEMORY
-	select ATMEL_SDRAMC
-
 config SOC_SAMA5
 	bool
 	select ATMEL_AIC5_IRQ
@@ -92,67 +83,36 @@ config SOC_AT91RM9200
 	select GENERIC_CLOCKEVENTS
 	select HAVE_AT91_USB_CLK
 
-config SOC_AT91SAM9260
-	bool "AT91SAM9260, AT91SAM9XE or AT91SAM9G20"
-	select SOC_AT91SAM9
-	select HAVE_AT91_USB_CLK
-	help
-	  Select this if you are using one of Atmel's AT91SAM9260, AT91SAM9XE
-	  or AT91SAM9G20 SoC.
-
-config SOC_AT91SAM9261
-	bool "AT91SAM9261 or AT91SAM9G10"
-	select HAVE_FB_ATMEL
-	select SOC_AT91SAM9
-	select HAVE_AT91_USB_CLK
-	help
-	  Select this if you are using one of Atmel's AT91SAM9261 or AT91SAM9G10 SoC.
-
-config SOC_AT91SAM9263
-	bool "AT91SAM9263"
-	select HAVE_FB_ATMEL
-	select SOC_AT91SAM9
-	select HAVE_AT91_USB_CLK
-
-config SOC_AT91SAM9RL
-	bool "AT91SAM9RL"
-	select HAVE_FB_ATMEL
-	select SOC_AT91SAM9
-	select HAVE_AT91_UTMI
-
-config SOC_AT91SAM9G45
-	bool "AT91SAM9G45 or AT91SAM9M10 families"
-	select HAVE_FB_ATMEL
-	select SOC_AT91SAM9
-	select HAVE_AT91_UTMI
-	select HAVE_AT91_USB_CLK
-	help
-	  Select this if you are using one of Atmel's AT91SAM9G45 family SoC.
-	  This support covers AT91SAM9G45, AT91SAM9G46, AT91SAM9M10 and AT91SAM9M11.
-
-config SOC_AT91SAM9X5
-	bool "AT91SAM9x5 family"
-	select HAVE_FB_ATMEL
-	select SOC_AT91SAM9
-	select HAVE_AT91_UTMI
+config SOC_AT91SAM9
+	bool "AT91SAM9"
+	select ATMEL_AIC_IRQ
+	select ATMEL_SDRAMC
+	select COMMON_CLK_AT91
+	select CPU_ARM926T
+	select GENERIC_CLOCKEVENTS
 	select HAVE_AT91_SMD
 	select HAVE_AT91_USB_CLK
-	help
-	  Select this if you are using one of Atmel's AT91SAM9x5 family SoC.
-	  This means that your SAM9 name finishes with a '5' (except if it is
-	  AT91SAM9G45!).
-	  This support covers AT91SAM9G15, AT91SAM9G25, AT91SAM9X25, AT91SAM9G35
-	  and AT91SAM9X35.
-
-config SOC_AT91SAM9N12
-	bool "AT91SAM9N12 family"
+	select HAVE_AT91_UTMI
 	select HAVE_FB_ATMEL
-	select SOC_AT91SAM9
-	select HAVE_AT91_USB_CLK
+	select MEMORY
 	help
-	  Select this if you are using Atmel's AT91SAM9N12 SoC.
-
-# ----------------------------------------------------------
+	  Select this if you are using one of those Atmel SoC:
+	    AT91SAM9260
+	    AT91SAM9261
+	    AT91SAM9263
+	    AT91SAM9G15
+	    AT91SAM9G20
+	    AT91SAM9G25
+	    AT91SAM9G35
+	    AT91SAM9G45
+	    AT91SAM9G46
+	    AT91SAM9M10
+	    AT91SAM9M11
+	    AT91SAM9N12
+	    AT91SAM9RL
+	    AT91SAM9X25
+	    AT91SAM9X35
+	    AT91SAM9XE
 endif # SOC_SAM_V4_V5
 
 comment "AT91 Feature Selections"
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 56+ messages in thread

* [PATCH 10/17] ARM: at91: merge SOC_AT91SAM9xxx
@ 2015-01-15 21:58   ` Alexandre Belloni
  0 siblings, 0 replies; 56+ messages in thread
From: Alexandre Belloni @ 2015-01-15 21:58 UTC (permalink / raw)
  To: linux-arm-kernel

Only use SOC_AT91SAM9 for all the at91sam9 SoCs.

It enables HAVE_AT91_SMD and HAVE_AT91_UTMI for all the sam9 SoCs but this only
represents 96 bytes of uncompressed kernel code.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
---
 arch/arm/configs/at91_dt_defconfig | 10 +----
 arch/arm/mach-at91/Kconfig         | 92 +++++++++++---------------------------
 2 files changed, 27 insertions(+), 75 deletions(-)

diff --git a/arch/arm/configs/at91_dt_defconfig b/arch/arm/configs/at91_dt_defconfig
index 8116d122e098..811e72bbe642 100644
--- a/arch/arm/configs/at91_dt_defconfig
+++ b/arch/arm/configs/at91_dt_defconfig
@@ -15,15 +15,7 @@ CONFIG_MODULE_UNLOAD=y
 # CONFIG_IOSCHED_CFQ is not set
 CONFIG_ARCH_AT91=y
 CONFIG_SOC_AT91RM9200=y
-CONFIG_SOC_AT91SAM9260=y
-CONFIG_SOC_AT91SAM9261=y
-CONFIG_SOC_AT91SAM9263=y
-CONFIG_SOC_AT91SAM9RL=y
-CONFIG_SOC_AT91SAM9G45=y
-CONFIG_SOC_AT91SAM9X5=y
-CONFIG_SOC_AT91SAM9N12=y
-CONFIG_MACH_AT91RM9200_DT=y
-CONFIG_MACH_AT91SAM9_DT=y
+CONFIG_SOC_AT91SAM9=y
 CONFIG_AT91_TIMER_HZ=128
 CONFIG_AEABI=y
 CONFIG_UACCESS_WITH_MEMCPY=y
diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
index c6956b863b9d..c6740e359a44 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -16,15 +16,6 @@ config HAVE_AT91_SMD
 config HAVE_AT91_H32MX
 	bool
 
-config SOC_AT91SAM9
-	bool
-	select ATMEL_AIC_IRQ
-	select COMMON_CLK_AT91
-	select CPU_ARM926T
-	select GENERIC_CLOCKEVENTS
-	select MEMORY
-	select ATMEL_SDRAMC
-
 config SOC_SAMA5
 	bool
 	select ATMEL_AIC5_IRQ
@@ -92,67 +83,36 @@ config SOC_AT91RM9200
 	select GENERIC_CLOCKEVENTS
 	select HAVE_AT91_USB_CLK
 
-config SOC_AT91SAM9260
-	bool "AT91SAM9260, AT91SAM9XE or AT91SAM9G20"
-	select SOC_AT91SAM9
-	select HAVE_AT91_USB_CLK
-	help
-	  Select this if you are using one of Atmel's AT91SAM9260, AT91SAM9XE
-	  or AT91SAM9G20 SoC.
-
-config SOC_AT91SAM9261
-	bool "AT91SAM9261 or AT91SAM9G10"
-	select HAVE_FB_ATMEL
-	select SOC_AT91SAM9
-	select HAVE_AT91_USB_CLK
-	help
-	  Select this if you are using one of Atmel's AT91SAM9261 or AT91SAM9G10 SoC.
-
-config SOC_AT91SAM9263
-	bool "AT91SAM9263"
-	select HAVE_FB_ATMEL
-	select SOC_AT91SAM9
-	select HAVE_AT91_USB_CLK
-
-config SOC_AT91SAM9RL
-	bool "AT91SAM9RL"
-	select HAVE_FB_ATMEL
-	select SOC_AT91SAM9
-	select HAVE_AT91_UTMI
-
-config SOC_AT91SAM9G45
-	bool "AT91SAM9G45 or AT91SAM9M10 families"
-	select HAVE_FB_ATMEL
-	select SOC_AT91SAM9
-	select HAVE_AT91_UTMI
-	select HAVE_AT91_USB_CLK
-	help
-	  Select this if you are using one of Atmel's AT91SAM9G45 family SoC.
-	  This support covers AT91SAM9G45, AT91SAM9G46, AT91SAM9M10 and AT91SAM9M11.
-
-config SOC_AT91SAM9X5
-	bool "AT91SAM9x5 family"
-	select HAVE_FB_ATMEL
-	select SOC_AT91SAM9
-	select HAVE_AT91_UTMI
+config SOC_AT91SAM9
+	bool "AT91SAM9"
+	select ATMEL_AIC_IRQ
+	select ATMEL_SDRAMC
+	select COMMON_CLK_AT91
+	select CPU_ARM926T
+	select GENERIC_CLOCKEVENTS
 	select HAVE_AT91_SMD
 	select HAVE_AT91_USB_CLK
-	help
-	  Select this if you are using one of Atmel's AT91SAM9x5 family SoC.
-	  This means that your SAM9 name finishes with a '5' (except if it is
-	  AT91SAM9G45!).
-	  This support covers AT91SAM9G15, AT91SAM9G25, AT91SAM9X25, AT91SAM9G35
-	  and AT91SAM9X35.
-
-config SOC_AT91SAM9N12
-	bool "AT91SAM9N12 family"
+	select HAVE_AT91_UTMI
 	select HAVE_FB_ATMEL
-	select SOC_AT91SAM9
-	select HAVE_AT91_USB_CLK
+	select MEMORY
 	help
-	  Select this if you are using Atmel's AT91SAM9N12 SoC.
-
-# ----------------------------------------------------------
+	  Select this if you are using one of those Atmel SoC:
+	    AT91SAM9260
+	    AT91SAM9261
+	    AT91SAM9263
+	    AT91SAM9G15
+	    AT91SAM9G20
+	    AT91SAM9G25
+	    AT91SAM9G35
+	    AT91SAM9G45
+	    AT91SAM9G46
+	    AT91SAM9M10
+	    AT91SAM9M11
+	    AT91SAM9N12
+	    AT91SAM9RL
+	    AT91SAM9X25
+	    AT91SAM9X35
+	    AT91SAM9XE
 endif # SOC_SAM_V4_V5
 
 comment "AT91 Feature Selections"
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 56+ messages in thread

* [PATCH 11/17] ARM: at91: remove at91_boot_soc
  2015-01-15 21:58 ` Alexandre Belloni
@ 2015-01-15 21:58   ` Alexandre Belloni
  -1 siblings, 0 replies; 56+ messages in thread
From: Alexandre Belloni @ 2015-01-15 21:58 UTC (permalink / raw)
  To: Nicolas Ferre
  Cc: Jean-Christophe Plagniol-Villard, Arnd Bergmann, Boris Brezillon,
	Bo Shen, Wenyou Yang, linux-arm-kernel, linux-kernel,
	Alexandre Belloni

at91_boot_soc is not used by any SoC, remove its usage. Also remove all the now
empty SoC files.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
---
 arch/arm/mach-at91/Makefile        |  7 ----
 arch/arm/mach-at91/at91rm9200.c    | 17 +--------
 arch/arm/mach-at91/at91sam9260.c   | 26 -------------
 arch/arm/mach-at91/at91sam9261.c   | 25 -------------
 arch/arm/mach-at91/at91sam9263.c   | 24 ------------
 arch/arm/mach-at91/at91sam9g45.c   | 25 -------------
 arch/arm/mach-at91/at91sam9n12.c   | 25 -------------
 arch/arm/mach-at91/at91sam9rl.c    | 26 -------------
 arch/arm/mach-at91/at91sam9x5.c    | 26 -------------
 arch/arm/mach-at91/board-dt-sam9.c |  1 +
 arch/arm/mach-at91/sama5d3.c       |  9 -----
 arch/arm/mach-at91/sama5d4.c       | 24 +-----------
 arch/arm/mach-at91/setup.c         | 32 ----------------
 arch/arm/mach-at91/soc.h           | 77 --------------------------------------
 14 files changed, 4 insertions(+), 340 deletions(-)
 delete mode 100644 arch/arm/mach-at91/at91sam9260.c
 delete mode 100644 arch/arm/mach-at91/at91sam9261.c
 delete mode 100644 arch/arm/mach-at91/at91sam9263.c
 delete mode 100644 arch/arm/mach-at91/at91sam9g45.c
 delete mode 100644 arch/arm/mach-at91/at91sam9n12.c
 delete mode 100644 arch/arm/mach-at91/at91sam9rl.c
 delete mode 100644 arch/arm/mach-at91/at91sam9x5.c
 delete mode 100644 arch/arm/mach-at91/soc.h

diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile
index 4bce1fac680e..76d6d869bf4e 100644
--- a/arch/arm/mach-at91/Makefile
+++ b/arch/arm/mach-at91/Makefile
@@ -8,13 +8,6 @@ obj-$(CONFIG_SOC_AT91SAM9)	+= sam9_smc.o
 
 # CPU-specific support
 obj-$(CONFIG_SOC_AT91RM9200)	+= at91rm9200.o at91rm9200_time.o
-obj-$(CONFIG_SOC_AT91SAM9260)	+= at91sam9260.o
-obj-$(CONFIG_SOC_AT91SAM9261)	+= at91sam9261.o
-obj-$(CONFIG_SOC_AT91SAM9263)	+= at91sam9263.o
-obj-$(CONFIG_SOC_AT91SAM9G45)	+= at91sam9g45.o
-obj-$(CONFIG_SOC_AT91SAM9N12)	+= at91sam9n12.o
-obj-$(CONFIG_SOC_AT91SAM9X5)	+= at91sam9x5.o
-obj-$(CONFIG_SOC_AT91SAM9RL)	+= at91sam9rl.o
 obj-$(CONFIG_SOC_SAMA5D3)	+= sama5d3.o
 obj-$(CONFIG_SOC_SAMA5D4)	+= sama5d4.o
 
diff --git a/arch/arm/mach-at91/at91rm9200.c b/arch/arm/mach-at91/at91rm9200.c
index eaa30b1fea01..a3c0dd612d77 100644
--- a/arch/arm/mach-at91/at91rm9200.c
+++ b/arch/arm/mach-at91/at91rm9200.c
@@ -28,7 +28,6 @@
 #include <mach/at91_st.h>
 #include <mach/hardware.h>
 
-#include "soc.h"
 #include "generic.h"
 
 
@@ -41,20 +40,6 @@ static void at91rm9200_restart(enum reboot_mode reboot_mode, const char *cmd)
 	at91_st_write(AT91_ST_CR, AT91_ST_WDRST);
 }
 
-/* --------------------------------------------------------------------
- *  AT91RM9200 processor initialization
- * -------------------------------------------------------------------- */
-
-static void __init at91rm9200_initialize(void)
-{
-	arm_pm_idle = at91rm9200_idle;
-	arm_pm_restart = at91rm9200_restart;
-}
-
-AT91_SOC_START(at91rm9200)
-	.init = at91rm9200_initialize,
-AT91_SOC_END
-
 static void __init at91rm9200_dt_timer_init(void)
 {
 	of_clk_init(NULL);
@@ -63,6 +48,8 @@ static void __init at91rm9200_dt_timer_init(void)
 
 static void __init rm9200_dt_device_init(void)
 {
+	arm_pm_idle = at91rm9200_idle;
+	arm_pm_restart = at91rm9200_restart;
 	at91_rm9200_pm_init();
 
 	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
diff --git a/arch/arm/mach-at91/at91sam9260.c b/arch/arm/mach-at91/at91sam9260.c
deleted file mode 100644
index 37b7ce4c6a3b..000000000000
--- a/arch/arm/mach-at91/at91sam9260.c
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * arch/arm/mach-at91/at91sam9260.c
- *
- *  Copyright (C) 2006 SAN People
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- */
-
-#include <asm/system_misc.h>
-#include <mach/cpu.h>
-#include <mach/at91_dbgu.h>
-#include <mach/hardware.h>
-
-#include "soc.h"
-#include "generic.h"
-
-/* --------------------------------------------------------------------
- *  AT91SAM9260 processor initialization
- * -------------------------------------------------------------------- */
-
-AT91_SOC_START(at91sam9260)
-AT91_SOC_END
diff --git a/arch/arm/mach-at91/at91sam9261.c b/arch/arm/mach-at91/at91sam9261.c
deleted file mode 100644
index aebbf76b6038..000000000000
--- a/arch/arm/mach-at91/at91sam9261.c
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * arch/arm/mach-at91/at91sam9261.c
- *
- *  Copyright (C) 2005 SAN People
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- */
-
-#include <asm/system_misc.h>
-#include <mach/cpu.h>
-#include <mach/hardware.h>
-
-#include "soc.h"
-#include "generic.h"
-
-/* --------------------------------------------------------------------
- *  AT91SAM9261 processor initialization
- * -------------------------------------------------------------------- */
-
-AT91_SOC_START(at91sam9261)
-AT91_SOC_END
diff --git a/arch/arm/mach-at91/at91sam9263.c b/arch/arm/mach-at91/at91sam9263.c
deleted file mode 100644
index dca29457d9cc..000000000000
--- a/arch/arm/mach-at91/at91sam9263.c
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * arch/arm/mach-at91/at91sam9263.c
- *
- *  Copyright (C) 2007 Atmel Corporation.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- */
-
-#include <asm/system_misc.h>
-#include <mach/hardware.h>
-
-#include "soc.h"
-#include "generic.h"
-
-/* --------------------------------------------------------------------
- *  AT91SAM9263 processor initialization
- * -------------------------------------------------------------------- */
-
-AT91_SOC_START(at91sam9263)
-AT91_SOC_END
diff --git a/arch/arm/mach-at91/at91sam9g45.c b/arch/arm/mach-at91/at91sam9g45.c
deleted file mode 100644
index d77d10cf10f6..000000000000
--- a/arch/arm/mach-at91/at91sam9g45.c
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- *  Chip-specific setup code for the AT91SAM9G45 family
- *
- *  Copyright (C) 2009 Atmel Corporation.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- */
-
-#include <asm/system_misc.h>
-#include <asm/irq.h>
-#include <mach/hardware.h>
-
-#include "soc.h"
-#include "generic.h"
-
-/* --------------------------------------------------------------------
- *  AT91SAM9G45 processor initialization
- * -------------------------------------------------------------------- */
-
-AT91_SOC_START(at91sam9g45)
-AT91_SOC_END
diff --git a/arch/arm/mach-at91/at91sam9n12.c b/arch/arm/mach-at91/at91sam9n12.c
deleted file mode 100644
index 276b8f0e4183..000000000000
--- a/arch/arm/mach-at91/at91sam9n12.c
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * SoC specific setup code for the AT91SAM9N12
- *
- * Copyright (C) 2012 Atmel Corporation.
- *
- * Licensed under GPLv2 or later.
- */
-
-#include <asm/system_misc.h>
-#include <mach/hardware.h>
-
-#include "soc.h"
-#include "generic.h"
-
-/* --------------------------------------------------------------------
- *  AT91SAM9N12 processor initialization
- * -------------------------------------------------------------------- */
-static void __init at91sam9n12_initialize(void)
-{
-	arm_pm_idle = at91sam9_idle;
-}
-
-AT91_SOC_START(at91sam9n12)
-	.init = at91sam9n12_initialize,
-AT91_SOC_END
diff --git a/arch/arm/mach-at91/at91sam9rl.c b/arch/arm/mach-at91/at91sam9rl.c
deleted file mode 100644
index a585ff3adf96..000000000000
--- a/arch/arm/mach-at91/at91sam9rl.c
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * arch/arm/mach-at91/at91sam9rl.c
- *
- *  Copyright (C) 2005 SAN People
- *  Copyright (C) 2007 Atmel Corporation
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file COPYING in the main directory of this archive for
- * more details.
- */
-
-#include <asm/system_misc.h>
-#include <asm/irq.h>
-#include <mach/cpu.h>
-#include <mach/at91_dbgu.h>
-#include <mach/hardware.h>
-
-#include "soc.h"
-#include "generic.h"
-
-/* --------------------------------------------------------------------
- *  AT91SAM9RL processor initialization
- * -------------------------------------------------------------------- */
-
-AT91_SOC_START(at91sam9rl)
-AT91_SOC_END
diff --git a/arch/arm/mach-at91/at91sam9x5.c b/arch/arm/mach-at91/at91sam9x5.c
deleted file mode 100644
index 7b6fb1bca505..000000000000
--- a/arch/arm/mach-at91/at91sam9x5.c
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- *  Chip-specific setup code for the AT91SAM9x5 family
- *
- *  Copyright (C) 2010-2012 Atmel Corporation.
- *
- * Licensed under GPLv2 or later.
- */
-
-#include <asm/system_misc.h>
-#include <mach/hardware.h>
-
-#include "soc.h"
-#include "generic.h"
-
-/* --------------------------------------------------------------------
- *  AT91SAM9x5 processor initialization
- * -------------------------------------------------------------------- */
-
-static void __init at91sam9x5_initialize(void)
-{
-	arm_pm_idle = at91sam9_idle;
-}
-
-AT91_SOC_START(at91sam9x5)
-	.init = at91sam9x5_initialize,
-AT91_SOC_END
diff --git a/arch/arm/mach-at91/board-dt-sam9.c b/arch/arm/mach-at91/board-dt-sam9.c
index 508468d77475..6f90201dbd47 100644
--- a/arch/arm/mach-at91/board-dt-sam9.c
+++ b/arch/arm/mach-at91/board-dt-sam9.c
@@ -21,6 +21,7 @@
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 #include <asm/mach/irq.h>
+#include <asm/system_misc.h>
 
 #include "generic.h"
 
diff --git a/arch/arm/mach-at91/sama5d3.c b/arch/arm/mach-at91/sama5d3.c
index ecd35f135a9f..6f73a34cb7e4 100644
--- a/arch/arm/mach-at91/sama5d3.c
+++ b/arch/arm/mach-at91/sama5d3.c
@@ -12,21 +12,12 @@
 
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
-#include <asm/mach/irq.h>
 
 #include <mach/sama5d3.h>
 #include <mach/cpu.h>
 
-#include "soc.h"
 #include "generic.h"
 
-/* --------------------------------------------------------------------
- *  AT91SAM9x5 processor initialization
- * -------------------------------------------------------------------- */
-
-AT91_SOC_START(sama5d3)
-AT91_SOC_END
-
 static void __init sama5_dt_device_init(void)
 {
 	at91_sam9260_pm_init();
diff --git a/arch/arm/mach-at91/sama5d4.c b/arch/arm/mach-at91/sama5d4.c
index 68573cd9d8f9..87c71afedb57 100644
--- a/arch/arm/mach-at91/sama5d4.c
+++ b/arch/arm/mach-at91/sama5d4.c
@@ -7,34 +7,16 @@
  * Licensed under GPLv2 or later.
  */
 
-#include <linux/module.h>
-#include <linux/dma-mapping.h>
-#include <linux/clk/at91_pmc.h>
-#include <linux/types.h>
-#include <linux/init.h>
-#include <linux/gpio.h>
-#include <linux/micrel_phy.h>
-#include <linux/of.h>
-#include <linux/of_irq.h>
 #include <linux/of_platform.h>
-#include <linux/phy.h>
-#include <linux/clk-provider.h>
 
-#include <asm/irq.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
-#include <asm/mach/irq.h>
 
 #include <mach/sama5d4.h>
-#include <mach/cpu.h>
 #include <mach/hardware.h>
 
-#include "soc.h"
 #include "generic.h"
 
-/* --------------------------------------------------------------------
- *  Processor initialization
- * -------------------------------------------------------------------- */
 static struct map_desc at91_io_desc[] __initdata = {
 	{
 	.virtual        = (unsigned long)AT91_ALT_IO_P2V(SAMA5D4_BASE_MPDDRC),
@@ -67,10 +49,6 @@ static void __init sama5d4_map_io(void)
 	iotable_init(at91_io_desc, ARRAY_SIZE(at91_io_desc));
 }
 
-AT91_SOC_START(sama5d4)
-	.map_io = sama5d4_map_io,
-AT91_SOC_END
-
 static void __init sama5d4_dt_device_init(void)
 {
 	at91_sam9260_pm_init();
@@ -84,7 +62,7 @@ static const char *sama5_alt_dt_board_compat[] __initconst = {
 
 DT_MACHINE_START(sama5_alt_dt, "Atmel SAMA5 (Device Tree)")
 	/* Maintainer: Atmel */
-	.map_io		= at91_alt_map_io,
+	.map_io		= sama5d4_map_io,
 	.init_early	= at91_dt_initialize,
 	.init_machine	= sama5d4_dt_device_init,
 	.dt_compat	= sama5_alt_dt_board_compat,
diff --git a/arch/arm/mach-at91/setup.c b/arch/arm/mach-at91/setup.c
index 88649dee830e..42ebe8d41433 100644
--- a/arch/arm/mach-at91/setup.c
+++ b/arch/arm/mach-at91/setup.c
@@ -22,12 +22,9 @@
 #include <mach/cpu.h>
 #include <mach/at91_dbgu.h>
 
-#include "soc.h"
 #include "generic.h"
 #include "pm.h"
 
-struct at91_init_soc __initdata at91_boot_soc;
-
 struct at91_socinfo at91_soc_initdata;
 EXPORT_SYMBOL(at91_soc_initdata);
 
@@ -60,61 +57,51 @@ static void __init soc_detect(u32 dbgu_base)
 		at91_soc_initdata.type = AT91_SOC_RM9200;
 		if (at91_soc_initdata.subtype == AT91_SOC_SUBTYPE_UNKNOWN)
 			at91_soc_initdata.subtype = AT91_SOC_RM9200_BGA;
-		at91_boot_soc = at91rm9200_soc;
 		break;
 
 	case ARCH_ID_AT91SAM9260:
 		at91_soc_initdata.type = AT91_SOC_SAM9260;
 		at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE;
-		at91_boot_soc = at91sam9260_soc;
 		break;
 
 	case ARCH_ID_AT91SAM9261:
 		at91_soc_initdata.type = AT91_SOC_SAM9261;
 		at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE;
-		at91_boot_soc = at91sam9261_soc;
 		break;
 
 	case ARCH_ID_AT91SAM9263:
 		at91_soc_initdata.type = AT91_SOC_SAM9263;
 		at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE;
-		at91_boot_soc = at91sam9263_soc;
 		break;
 
 	case ARCH_ID_AT91SAM9G20:
 		at91_soc_initdata.type = AT91_SOC_SAM9G20;
 		at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE;
-		at91_boot_soc = at91sam9260_soc;
 		break;
 
 	case ARCH_ID_AT91SAM9G45:
 		at91_soc_initdata.type = AT91_SOC_SAM9G45;
 		if (cidr == ARCH_ID_AT91SAM9G45ES)
 			at91_soc_initdata.subtype = AT91_SOC_SAM9G45ES;
-		at91_boot_soc = at91sam9g45_soc;
 		break;
 
 	case ARCH_ID_AT91SAM9RL64:
 		at91_soc_initdata.type = AT91_SOC_SAM9RL;
 		at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE;
-		at91_boot_soc = at91sam9rl_soc;
 		break;
 
 	case ARCH_ID_AT91SAM9X5:
 		at91_soc_initdata.type = AT91_SOC_SAM9X5;
-		at91_boot_soc = at91sam9x5_soc;
 		break;
 
 	case ARCH_ID_AT91SAM9N12:
 		at91_soc_initdata.type = AT91_SOC_SAM9N12;
-		at91_boot_soc = at91sam9n12_soc;
 		break;
 
 	case ARCH_ID_SAMA5:
 		at91_soc_initdata.exid = __raw_readl(AT91_IO_P2V(dbgu_base) + AT91_DBGU_EXID);
 		if (at91_soc_initdata.exid & ARCH_EXID_SAMA5D3) {
 			at91_soc_initdata.type = AT91_SOC_SAMA5D3;
-			at91_boot_soc = sama5d3_soc;
 		}
 		break;
 	}
@@ -123,13 +110,11 @@ static void __init soc_detect(u32 dbgu_base)
 	if ((socid & ~AT91_CIDR_EXT) == ARCH_ID_AT91SAM9G10) {
 		at91_soc_initdata.type = AT91_SOC_SAM9G10;
 		at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE;
-		at91_boot_soc = at91sam9261_soc;
 	}
 	/* at91sam9xe */
 	else if ((cidr & AT91_CIDR_ARCH) == ARCH_FAMILY_AT91SAM9XE) {
 		at91_soc_initdata.type = AT91_SOC_SAM9260;
 		at91_soc_initdata.subtype = AT91_SOC_SAM9XE;
-		at91_boot_soc = at91sam9260_soc;
 	}
 
 	if (!at91_soc_is_detected())
@@ -209,10 +194,8 @@ static void __init alt_soc_detect(u32 dbgu_base)
 		at91_soc_initdata.exid = __raw_readl(AT91_ALT_IO_P2V(dbgu_base) + AT91_DBGU_EXID);
 		if (at91_soc_initdata.exid & ARCH_EXID_SAMA5D3) {
 			at91_soc_initdata.type = AT91_SOC_SAMA5D3;
-			at91_boot_soc = sama5d3_soc;
 		} else if (at91_soc_initdata.exid & ARCH_EXID_SAMA5D4) {
 			at91_soc_initdata.type = AT91_SOC_SAMA5D4;
-			at91_boot_soc = sama5d4_soc;
 		}
 		break;
 	}
@@ -318,12 +301,6 @@ void __init at91_map_io(void)
 	if (at91_soc_initdata.subtype != AT91_SOC_SUBTYPE_NONE)
 		pr_info("Detected soc subtype: %s\n",
 			at91_get_soc_subtype(&at91_soc_initdata));
-
-	if (!at91_soc_is_enabled())
-		panic(pr_fmt("Soc not enabled"));
-
-	if (at91_boot_soc.map_io)
-		at91_boot_soc.map_io();
 }
 
 void __init at91_alt_map_io(void)
@@ -343,12 +320,6 @@ void __init at91_alt_map_io(void)
 	if (at91_soc_initdata.subtype != AT91_SOC_SUBTYPE_NONE)
 		pr_info("AT91: Detected soc subtype: %s\n",
 			at91_get_soc_subtype(&at91_soc_initdata));
-
-	if (!at91_soc_is_enabled())
-		panic("AT91: Soc not enabled");
-
-	if (at91_boot_soc.map_io)
-		at91_boot_soc.map_io();
 }
 
 static struct of_device_id ramc_ids[] = {
@@ -391,7 +362,4 @@ static void at91_dt_ramc(void)
 void __init at91_dt_initialize(void)
 {
 	at91_dt_ramc();
-
-	if (at91_boot_soc.init)
-		at91_boot_soc.init();
 }
diff --git a/arch/arm/mach-at91/soc.h b/arch/arm/mach-at91/soc.h
deleted file mode 100644
index ae6c0b2f1146..000000000000
--- a/arch/arm/mach-at91/soc.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright (C) 2011 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
- *
- * Under GPLv2
- */
-
-struct at91_init_soc {
-	int builtin;
-	void (*map_io)(void);
-	void (*init)(void);
-};
-
-extern struct at91_init_soc at91_boot_soc;
-extern struct at91_init_soc at91rm9200_soc;
-extern struct at91_init_soc at91sam9260_soc;
-extern struct at91_init_soc at91sam9261_soc;
-extern struct at91_init_soc at91sam9263_soc;
-extern struct at91_init_soc at91sam9g45_soc;
-extern struct at91_init_soc at91sam9rl_soc;
-extern struct at91_init_soc at91sam9x5_soc;
-extern struct at91_init_soc at91sam9n12_soc;
-extern struct at91_init_soc sama5d3_soc;
-extern struct at91_init_soc sama5d4_soc;
-
-#define AT91_SOC_START(_name)				\
-struct at91_init_soc __initdata _name##_soc		\
- __used							\
-						= {	\
-	.builtin	= 1,				\
-
-#define AT91_SOC_END					\
-};
-
-static inline int at91_soc_is_enabled(void)
-{
-	return at91_boot_soc.builtin;
-}
-
-#if !defined(CONFIG_SOC_AT91RM9200)
-#define at91rm9200_soc	at91_boot_soc
-#endif
-
-#if !defined(CONFIG_SOC_AT91SAM9260)
-#define at91sam9260_soc	at91_boot_soc
-#endif
-
-#if !defined(CONFIG_SOC_AT91SAM9261)
-#define at91sam9261_soc	at91_boot_soc
-#endif
-
-#if !defined(CONFIG_SOC_AT91SAM9263)
-#define at91sam9263_soc	at91_boot_soc
-#endif
-
-#if !defined(CONFIG_SOC_AT91SAM9G45)
-#define at91sam9g45_soc	at91_boot_soc
-#endif
-
-#if !defined(CONFIG_SOC_AT91SAM9RL)
-#define at91sam9rl_soc	at91_boot_soc
-#endif
-
-#if !defined(CONFIG_SOC_AT91SAM9X5)
-#define at91sam9x5_soc	at91_boot_soc
-#endif
-
-#if !defined(CONFIG_SOC_AT91SAM9N12)
-#define at91sam9n12_soc	at91_boot_soc
-#endif
-
-#if !defined(CONFIG_SOC_SAMA5D3)
-#define sama5d3_soc	at91_boot_soc
-#endif
-
-#if !defined(CONFIG_SOC_SAMA5D4)
-#define sama5d4_soc	at91_boot_soc
-#endif
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 56+ messages in thread

* [PATCH 11/17] ARM: at91: remove at91_boot_soc
@ 2015-01-15 21:58   ` Alexandre Belloni
  0 siblings, 0 replies; 56+ messages in thread
From: Alexandre Belloni @ 2015-01-15 21:58 UTC (permalink / raw)
  To: linux-arm-kernel

at91_boot_soc is not used by any SoC, remove its usage. Also remove all the now
empty SoC files.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
---
 arch/arm/mach-at91/Makefile        |  7 ----
 arch/arm/mach-at91/at91rm9200.c    | 17 +--------
 arch/arm/mach-at91/at91sam9260.c   | 26 -------------
 arch/arm/mach-at91/at91sam9261.c   | 25 -------------
 arch/arm/mach-at91/at91sam9263.c   | 24 ------------
 arch/arm/mach-at91/at91sam9g45.c   | 25 -------------
 arch/arm/mach-at91/at91sam9n12.c   | 25 -------------
 arch/arm/mach-at91/at91sam9rl.c    | 26 -------------
 arch/arm/mach-at91/at91sam9x5.c    | 26 -------------
 arch/arm/mach-at91/board-dt-sam9.c |  1 +
 arch/arm/mach-at91/sama5d3.c       |  9 -----
 arch/arm/mach-at91/sama5d4.c       | 24 +-----------
 arch/arm/mach-at91/setup.c         | 32 ----------------
 arch/arm/mach-at91/soc.h           | 77 --------------------------------------
 14 files changed, 4 insertions(+), 340 deletions(-)
 delete mode 100644 arch/arm/mach-at91/at91sam9260.c
 delete mode 100644 arch/arm/mach-at91/at91sam9261.c
 delete mode 100644 arch/arm/mach-at91/at91sam9263.c
 delete mode 100644 arch/arm/mach-at91/at91sam9g45.c
 delete mode 100644 arch/arm/mach-at91/at91sam9n12.c
 delete mode 100644 arch/arm/mach-at91/at91sam9rl.c
 delete mode 100644 arch/arm/mach-at91/at91sam9x5.c
 delete mode 100644 arch/arm/mach-at91/soc.h

diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile
index 4bce1fac680e..76d6d869bf4e 100644
--- a/arch/arm/mach-at91/Makefile
+++ b/arch/arm/mach-at91/Makefile
@@ -8,13 +8,6 @@ obj-$(CONFIG_SOC_AT91SAM9)	+= sam9_smc.o
 
 # CPU-specific support
 obj-$(CONFIG_SOC_AT91RM9200)	+= at91rm9200.o at91rm9200_time.o
-obj-$(CONFIG_SOC_AT91SAM9260)	+= at91sam9260.o
-obj-$(CONFIG_SOC_AT91SAM9261)	+= at91sam9261.o
-obj-$(CONFIG_SOC_AT91SAM9263)	+= at91sam9263.o
-obj-$(CONFIG_SOC_AT91SAM9G45)	+= at91sam9g45.o
-obj-$(CONFIG_SOC_AT91SAM9N12)	+= at91sam9n12.o
-obj-$(CONFIG_SOC_AT91SAM9X5)	+= at91sam9x5.o
-obj-$(CONFIG_SOC_AT91SAM9RL)	+= at91sam9rl.o
 obj-$(CONFIG_SOC_SAMA5D3)	+= sama5d3.o
 obj-$(CONFIG_SOC_SAMA5D4)	+= sama5d4.o
 
diff --git a/arch/arm/mach-at91/at91rm9200.c b/arch/arm/mach-at91/at91rm9200.c
index eaa30b1fea01..a3c0dd612d77 100644
--- a/arch/arm/mach-at91/at91rm9200.c
+++ b/arch/arm/mach-at91/at91rm9200.c
@@ -28,7 +28,6 @@
 #include <mach/at91_st.h>
 #include <mach/hardware.h>
 
-#include "soc.h"
 #include "generic.h"
 
 
@@ -41,20 +40,6 @@ static void at91rm9200_restart(enum reboot_mode reboot_mode, const char *cmd)
 	at91_st_write(AT91_ST_CR, AT91_ST_WDRST);
 }
 
-/* --------------------------------------------------------------------
- *  AT91RM9200 processor initialization
- * -------------------------------------------------------------------- */
-
-static void __init at91rm9200_initialize(void)
-{
-	arm_pm_idle = at91rm9200_idle;
-	arm_pm_restart = at91rm9200_restart;
-}
-
-AT91_SOC_START(at91rm9200)
-	.init = at91rm9200_initialize,
-AT91_SOC_END
-
 static void __init at91rm9200_dt_timer_init(void)
 {
 	of_clk_init(NULL);
@@ -63,6 +48,8 @@ static void __init at91rm9200_dt_timer_init(void)
 
 static void __init rm9200_dt_device_init(void)
 {
+	arm_pm_idle = at91rm9200_idle;
+	arm_pm_restart = at91rm9200_restart;
 	at91_rm9200_pm_init();
 
 	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
diff --git a/arch/arm/mach-at91/at91sam9260.c b/arch/arm/mach-at91/at91sam9260.c
deleted file mode 100644
index 37b7ce4c6a3b..000000000000
--- a/arch/arm/mach-at91/at91sam9260.c
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * arch/arm/mach-at91/at91sam9260.c
- *
- *  Copyright (C) 2006 SAN People
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- */
-
-#include <asm/system_misc.h>
-#include <mach/cpu.h>
-#include <mach/at91_dbgu.h>
-#include <mach/hardware.h>
-
-#include "soc.h"
-#include "generic.h"
-
-/* --------------------------------------------------------------------
- *  AT91SAM9260 processor initialization
- * -------------------------------------------------------------------- */
-
-AT91_SOC_START(at91sam9260)
-AT91_SOC_END
diff --git a/arch/arm/mach-at91/at91sam9261.c b/arch/arm/mach-at91/at91sam9261.c
deleted file mode 100644
index aebbf76b6038..000000000000
--- a/arch/arm/mach-at91/at91sam9261.c
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * arch/arm/mach-at91/at91sam9261.c
- *
- *  Copyright (C) 2005 SAN People
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- */
-
-#include <asm/system_misc.h>
-#include <mach/cpu.h>
-#include <mach/hardware.h>
-
-#include "soc.h"
-#include "generic.h"
-
-/* --------------------------------------------------------------------
- *  AT91SAM9261 processor initialization
- * -------------------------------------------------------------------- */
-
-AT91_SOC_START(at91sam9261)
-AT91_SOC_END
diff --git a/arch/arm/mach-at91/at91sam9263.c b/arch/arm/mach-at91/at91sam9263.c
deleted file mode 100644
index dca29457d9cc..000000000000
--- a/arch/arm/mach-at91/at91sam9263.c
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * arch/arm/mach-at91/at91sam9263.c
- *
- *  Copyright (C) 2007 Atmel Corporation.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- */
-
-#include <asm/system_misc.h>
-#include <mach/hardware.h>
-
-#include "soc.h"
-#include "generic.h"
-
-/* --------------------------------------------------------------------
- *  AT91SAM9263 processor initialization
- * -------------------------------------------------------------------- */
-
-AT91_SOC_START(at91sam9263)
-AT91_SOC_END
diff --git a/arch/arm/mach-at91/at91sam9g45.c b/arch/arm/mach-at91/at91sam9g45.c
deleted file mode 100644
index d77d10cf10f6..000000000000
--- a/arch/arm/mach-at91/at91sam9g45.c
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- *  Chip-specific setup code for the AT91SAM9G45 family
- *
- *  Copyright (C) 2009 Atmel Corporation.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- */
-
-#include <asm/system_misc.h>
-#include <asm/irq.h>
-#include <mach/hardware.h>
-
-#include "soc.h"
-#include "generic.h"
-
-/* --------------------------------------------------------------------
- *  AT91SAM9G45 processor initialization
- * -------------------------------------------------------------------- */
-
-AT91_SOC_START(at91sam9g45)
-AT91_SOC_END
diff --git a/arch/arm/mach-at91/at91sam9n12.c b/arch/arm/mach-at91/at91sam9n12.c
deleted file mode 100644
index 276b8f0e4183..000000000000
--- a/arch/arm/mach-at91/at91sam9n12.c
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * SoC specific setup code for the AT91SAM9N12
- *
- * Copyright (C) 2012 Atmel Corporation.
- *
- * Licensed under GPLv2 or later.
- */
-
-#include <asm/system_misc.h>
-#include <mach/hardware.h>
-
-#include "soc.h"
-#include "generic.h"
-
-/* --------------------------------------------------------------------
- *  AT91SAM9N12 processor initialization
- * -------------------------------------------------------------------- */
-static void __init at91sam9n12_initialize(void)
-{
-	arm_pm_idle = at91sam9_idle;
-}
-
-AT91_SOC_START(at91sam9n12)
-	.init = at91sam9n12_initialize,
-AT91_SOC_END
diff --git a/arch/arm/mach-at91/at91sam9rl.c b/arch/arm/mach-at91/at91sam9rl.c
deleted file mode 100644
index a585ff3adf96..000000000000
--- a/arch/arm/mach-at91/at91sam9rl.c
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * arch/arm/mach-at91/at91sam9rl.c
- *
- *  Copyright (C) 2005 SAN People
- *  Copyright (C) 2007 Atmel Corporation
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file COPYING in the main directory of this archive for
- * more details.
- */
-
-#include <asm/system_misc.h>
-#include <asm/irq.h>
-#include <mach/cpu.h>
-#include <mach/at91_dbgu.h>
-#include <mach/hardware.h>
-
-#include "soc.h"
-#include "generic.h"
-
-/* --------------------------------------------------------------------
- *  AT91SAM9RL processor initialization
- * -------------------------------------------------------------------- */
-
-AT91_SOC_START(at91sam9rl)
-AT91_SOC_END
diff --git a/arch/arm/mach-at91/at91sam9x5.c b/arch/arm/mach-at91/at91sam9x5.c
deleted file mode 100644
index 7b6fb1bca505..000000000000
--- a/arch/arm/mach-at91/at91sam9x5.c
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- *  Chip-specific setup code for the AT91SAM9x5 family
- *
- *  Copyright (C) 2010-2012 Atmel Corporation.
- *
- * Licensed under GPLv2 or later.
- */
-
-#include <asm/system_misc.h>
-#include <mach/hardware.h>
-
-#include "soc.h"
-#include "generic.h"
-
-/* --------------------------------------------------------------------
- *  AT91SAM9x5 processor initialization
- * -------------------------------------------------------------------- */
-
-static void __init at91sam9x5_initialize(void)
-{
-	arm_pm_idle = at91sam9_idle;
-}
-
-AT91_SOC_START(at91sam9x5)
-	.init = at91sam9x5_initialize,
-AT91_SOC_END
diff --git a/arch/arm/mach-at91/board-dt-sam9.c b/arch/arm/mach-at91/board-dt-sam9.c
index 508468d77475..6f90201dbd47 100644
--- a/arch/arm/mach-at91/board-dt-sam9.c
+++ b/arch/arm/mach-at91/board-dt-sam9.c
@@ -21,6 +21,7 @@
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 #include <asm/mach/irq.h>
+#include <asm/system_misc.h>
 
 #include "generic.h"
 
diff --git a/arch/arm/mach-at91/sama5d3.c b/arch/arm/mach-at91/sama5d3.c
index ecd35f135a9f..6f73a34cb7e4 100644
--- a/arch/arm/mach-at91/sama5d3.c
+++ b/arch/arm/mach-at91/sama5d3.c
@@ -12,21 +12,12 @@
 
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
-#include <asm/mach/irq.h>
 
 #include <mach/sama5d3.h>
 #include <mach/cpu.h>
 
-#include "soc.h"
 #include "generic.h"
 
-/* --------------------------------------------------------------------
- *  AT91SAM9x5 processor initialization
- * -------------------------------------------------------------------- */
-
-AT91_SOC_START(sama5d3)
-AT91_SOC_END
-
 static void __init sama5_dt_device_init(void)
 {
 	at91_sam9260_pm_init();
diff --git a/arch/arm/mach-at91/sama5d4.c b/arch/arm/mach-at91/sama5d4.c
index 68573cd9d8f9..87c71afedb57 100644
--- a/arch/arm/mach-at91/sama5d4.c
+++ b/arch/arm/mach-at91/sama5d4.c
@@ -7,34 +7,16 @@
  * Licensed under GPLv2 or later.
  */
 
-#include <linux/module.h>
-#include <linux/dma-mapping.h>
-#include <linux/clk/at91_pmc.h>
-#include <linux/types.h>
-#include <linux/init.h>
-#include <linux/gpio.h>
-#include <linux/micrel_phy.h>
-#include <linux/of.h>
-#include <linux/of_irq.h>
 #include <linux/of_platform.h>
-#include <linux/phy.h>
-#include <linux/clk-provider.h>
 
-#include <asm/irq.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
-#include <asm/mach/irq.h>
 
 #include <mach/sama5d4.h>
-#include <mach/cpu.h>
 #include <mach/hardware.h>
 
-#include "soc.h"
 #include "generic.h"
 
-/* --------------------------------------------------------------------
- *  Processor initialization
- * -------------------------------------------------------------------- */
 static struct map_desc at91_io_desc[] __initdata = {
 	{
 	.virtual        = (unsigned long)AT91_ALT_IO_P2V(SAMA5D4_BASE_MPDDRC),
@@ -67,10 +49,6 @@ static void __init sama5d4_map_io(void)
 	iotable_init(at91_io_desc, ARRAY_SIZE(at91_io_desc));
 }
 
-AT91_SOC_START(sama5d4)
-	.map_io = sama5d4_map_io,
-AT91_SOC_END
-
 static void __init sama5d4_dt_device_init(void)
 {
 	at91_sam9260_pm_init();
@@ -84,7 +62,7 @@ static const char *sama5_alt_dt_board_compat[] __initconst = {
 
 DT_MACHINE_START(sama5_alt_dt, "Atmel SAMA5 (Device Tree)")
 	/* Maintainer: Atmel */
-	.map_io		= at91_alt_map_io,
+	.map_io		= sama5d4_map_io,
 	.init_early	= at91_dt_initialize,
 	.init_machine	= sama5d4_dt_device_init,
 	.dt_compat	= sama5_alt_dt_board_compat,
diff --git a/arch/arm/mach-at91/setup.c b/arch/arm/mach-at91/setup.c
index 88649dee830e..42ebe8d41433 100644
--- a/arch/arm/mach-at91/setup.c
+++ b/arch/arm/mach-at91/setup.c
@@ -22,12 +22,9 @@
 #include <mach/cpu.h>
 #include <mach/at91_dbgu.h>
 
-#include "soc.h"
 #include "generic.h"
 #include "pm.h"
 
-struct at91_init_soc __initdata at91_boot_soc;
-
 struct at91_socinfo at91_soc_initdata;
 EXPORT_SYMBOL(at91_soc_initdata);
 
@@ -60,61 +57,51 @@ static void __init soc_detect(u32 dbgu_base)
 		at91_soc_initdata.type = AT91_SOC_RM9200;
 		if (at91_soc_initdata.subtype == AT91_SOC_SUBTYPE_UNKNOWN)
 			at91_soc_initdata.subtype = AT91_SOC_RM9200_BGA;
-		at91_boot_soc = at91rm9200_soc;
 		break;
 
 	case ARCH_ID_AT91SAM9260:
 		at91_soc_initdata.type = AT91_SOC_SAM9260;
 		at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE;
-		at91_boot_soc = at91sam9260_soc;
 		break;
 
 	case ARCH_ID_AT91SAM9261:
 		at91_soc_initdata.type = AT91_SOC_SAM9261;
 		at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE;
-		at91_boot_soc = at91sam9261_soc;
 		break;
 
 	case ARCH_ID_AT91SAM9263:
 		at91_soc_initdata.type = AT91_SOC_SAM9263;
 		at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE;
-		at91_boot_soc = at91sam9263_soc;
 		break;
 
 	case ARCH_ID_AT91SAM9G20:
 		at91_soc_initdata.type = AT91_SOC_SAM9G20;
 		at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE;
-		at91_boot_soc = at91sam9260_soc;
 		break;
 
 	case ARCH_ID_AT91SAM9G45:
 		at91_soc_initdata.type = AT91_SOC_SAM9G45;
 		if (cidr == ARCH_ID_AT91SAM9G45ES)
 			at91_soc_initdata.subtype = AT91_SOC_SAM9G45ES;
-		at91_boot_soc = at91sam9g45_soc;
 		break;
 
 	case ARCH_ID_AT91SAM9RL64:
 		at91_soc_initdata.type = AT91_SOC_SAM9RL;
 		at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE;
-		at91_boot_soc = at91sam9rl_soc;
 		break;
 
 	case ARCH_ID_AT91SAM9X5:
 		at91_soc_initdata.type = AT91_SOC_SAM9X5;
-		at91_boot_soc = at91sam9x5_soc;
 		break;
 
 	case ARCH_ID_AT91SAM9N12:
 		at91_soc_initdata.type = AT91_SOC_SAM9N12;
-		at91_boot_soc = at91sam9n12_soc;
 		break;
 
 	case ARCH_ID_SAMA5:
 		at91_soc_initdata.exid = __raw_readl(AT91_IO_P2V(dbgu_base) + AT91_DBGU_EXID);
 		if (at91_soc_initdata.exid & ARCH_EXID_SAMA5D3) {
 			at91_soc_initdata.type = AT91_SOC_SAMA5D3;
-			at91_boot_soc = sama5d3_soc;
 		}
 		break;
 	}
@@ -123,13 +110,11 @@ static void __init soc_detect(u32 dbgu_base)
 	if ((socid & ~AT91_CIDR_EXT) == ARCH_ID_AT91SAM9G10) {
 		at91_soc_initdata.type = AT91_SOC_SAM9G10;
 		at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE;
-		at91_boot_soc = at91sam9261_soc;
 	}
 	/* at91sam9xe */
 	else if ((cidr & AT91_CIDR_ARCH) == ARCH_FAMILY_AT91SAM9XE) {
 		at91_soc_initdata.type = AT91_SOC_SAM9260;
 		at91_soc_initdata.subtype = AT91_SOC_SAM9XE;
-		at91_boot_soc = at91sam9260_soc;
 	}
 
 	if (!at91_soc_is_detected())
@@ -209,10 +194,8 @@ static void __init alt_soc_detect(u32 dbgu_base)
 		at91_soc_initdata.exid = __raw_readl(AT91_ALT_IO_P2V(dbgu_base) + AT91_DBGU_EXID);
 		if (at91_soc_initdata.exid & ARCH_EXID_SAMA5D3) {
 			at91_soc_initdata.type = AT91_SOC_SAMA5D3;
-			at91_boot_soc = sama5d3_soc;
 		} else if (at91_soc_initdata.exid & ARCH_EXID_SAMA5D4) {
 			at91_soc_initdata.type = AT91_SOC_SAMA5D4;
-			at91_boot_soc = sama5d4_soc;
 		}
 		break;
 	}
@@ -318,12 +301,6 @@ void __init at91_map_io(void)
 	if (at91_soc_initdata.subtype != AT91_SOC_SUBTYPE_NONE)
 		pr_info("Detected soc subtype: %s\n",
 			at91_get_soc_subtype(&at91_soc_initdata));
-
-	if (!at91_soc_is_enabled())
-		panic(pr_fmt("Soc not enabled"));
-
-	if (at91_boot_soc.map_io)
-		at91_boot_soc.map_io();
 }
 
 void __init at91_alt_map_io(void)
@@ -343,12 +320,6 @@ void __init at91_alt_map_io(void)
 	if (at91_soc_initdata.subtype != AT91_SOC_SUBTYPE_NONE)
 		pr_info("AT91: Detected soc subtype: %s\n",
 			at91_get_soc_subtype(&at91_soc_initdata));
-
-	if (!at91_soc_is_enabled())
-		panic("AT91: Soc not enabled");
-
-	if (at91_boot_soc.map_io)
-		at91_boot_soc.map_io();
 }
 
 static struct of_device_id ramc_ids[] = {
@@ -391,7 +362,4 @@ static void at91_dt_ramc(void)
 void __init at91_dt_initialize(void)
 {
 	at91_dt_ramc();
-
-	if (at91_boot_soc.init)
-		at91_boot_soc.init();
 }
diff --git a/arch/arm/mach-at91/soc.h b/arch/arm/mach-at91/soc.h
deleted file mode 100644
index ae6c0b2f1146..000000000000
--- a/arch/arm/mach-at91/soc.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright (C) 2011 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
- *
- * Under GPLv2
- */
-
-struct at91_init_soc {
-	int builtin;
-	void (*map_io)(void);
-	void (*init)(void);
-};
-
-extern struct at91_init_soc at91_boot_soc;
-extern struct at91_init_soc at91rm9200_soc;
-extern struct at91_init_soc at91sam9260_soc;
-extern struct at91_init_soc at91sam9261_soc;
-extern struct at91_init_soc at91sam9263_soc;
-extern struct at91_init_soc at91sam9g45_soc;
-extern struct at91_init_soc at91sam9rl_soc;
-extern struct at91_init_soc at91sam9x5_soc;
-extern struct at91_init_soc at91sam9n12_soc;
-extern struct at91_init_soc sama5d3_soc;
-extern struct at91_init_soc sama5d4_soc;
-
-#define AT91_SOC_START(_name)				\
-struct at91_init_soc __initdata _name##_soc		\
- __used							\
-						= {	\
-	.builtin	= 1,				\
-
-#define AT91_SOC_END					\
-};
-
-static inline int at91_soc_is_enabled(void)
-{
-	return at91_boot_soc.builtin;
-}
-
-#if !defined(CONFIG_SOC_AT91RM9200)
-#define at91rm9200_soc	at91_boot_soc
-#endif
-
-#if !defined(CONFIG_SOC_AT91SAM9260)
-#define at91sam9260_soc	at91_boot_soc
-#endif
-
-#if !defined(CONFIG_SOC_AT91SAM9261)
-#define at91sam9261_soc	at91_boot_soc
-#endif
-
-#if !defined(CONFIG_SOC_AT91SAM9263)
-#define at91sam9263_soc	at91_boot_soc
-#endif
-
-#if !defined(CONFIG_SOC_AT91SAM9G45)
-#define at91sam9g45_soc	at91_boot_soc
-#endif
-
-#if !defined(CONFIG_SOC_AT91SAM9RL)
-#define at91sam9rl_soc	at91_boot_soc
-#endif
-
-#if !defined(CONFIG_SOC_AT91SAM9X5)
-#define at91sam9x5_soc	at91_boot_soc
-#endif
-
-#if !defined(CONFIG_SOC_AT91SAM9N12)
-#define at91sam9n12_soc	at91_boot_soc
-#endif
-
-#if !defined(CONFIG_SOC_SAMA5D3)
-#define sama5d3_soc	at91_boot_soc
-#endif
-
-#if !defined(CONFIG_SOC_SAMA5D4)
-#define sama5d4_soc	at91_boot_soc
-#endif
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 56+ messages in thread

* [PATCH 12/17] ARM: at91: rework initialization for rm9200 based boards
  2015-01-15 21:58 ` Alexandre Belloni
@ 2015-01-15 21:58   ` Alexandre Belloni
  -1 siblings, 0 replies; 56+ messages in thread
From: Alexandre Belloni @ 2015-01-15 21:58 UTC (permalink / raw)
  To: Nicolas Ferre
  Cc: Jean-Christophe Plagniol-Villard, Arnd Bergmann, Boris Brezillon,
	Bo Shen, Wenyou Yang, linux-arm-kernel, linux-kernel,
	Alexandre Belloni

Remove useless .map_io and .init_early by moving at91_dt_initialize() to
rm9200_dt_device_init().

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
---
 arch/arm/mach-at91/at91rm9200.c | 15 ++-------------
 1 file changed, 2 insertions(+), 13 deletions(-)

diff --git a/arch/arm/mach-at91/at91rm9200.c b/arch/arm/mach-at91/at91rm9200.c
index a3c0dd612d77..6992cc9ce902 100644
--- a/arch/arm/mach-at91/at91rm9200.c
+++ b/arch/arm/mach-at91/at91rm9200.c
@@ -8,21 +8,12 @@
  *
  * Licensed under GPLv2 or later.
  */
-#include <linux/types.h>
-#include <linux/init.h>
-#include <linux/module.h>
-#include <linux/gpio.h>
 #include <linux/of.h>
-#include <linux/of_irq.h>
 #include <linux/of_platform.h>
 #include <linux/clk-provider.h>
-#include <linux/clk/at91_pmc.h>
 
-#include <asm/setup.h>
-#include <asm/irq.h>
+#include <asm/io.h>
 #include <asm/mach/arch.h>
-#include <asm/mach/irq.h>
-#include <asm/mach/map.h>
 #include <asm/system_misc.h>
 
 #include <mach/at91_st.h>
@@ -30,7 +21,6 @@
 
 #include "generic.h"
 
-
 static void at91rm9200_restart(enum reboot_mode reboot_mode, const char *cmd)
 {
 	/*
@@ -51,6 +41,7 @@ static void __init rm9200_dt_device_init(void)
 	arm_pm_idle = at91rm9200_idle;
 	arm_pm_restart = at91rm9200_restart;
 	at91_rm9200_pm_init();
+	at91_dt_initialize();
 
 	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 }
@@ -62,8 +53,6 @@ static const char *at91rm9200_dt_board_compat[] __initdata = {
 
 DT_MACHINE_START(at91rm9200_dt, "Atmel AT91RM9200 (Device Tree)")
 	.init_time      = at91rm9200_dt_timer_init,
-	.map_io		= at91_map_io,
-	.init_early	= at91_dt_initialize,
 	.init_machine	= rm9200_dt_device_init,
 	.dt_compat	= at91rm9200_dt_board_compat,
 MACHINE_END
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 56+ messages in thread

* [PATCH 12/17] ARM: at91: rework initialization for rm9200 based boards
@ 2015-01-15 21:58   ` Alexandre Belloni
  0 siblings, 0 replies; 56+ messages in thread
From: Alexandre Belloni @ 2015-01-15 21:58 UTC (permalink / raw)
  To: linux-arm-kernel

Remove useless .map_io and .init_early by moving at91_dt_initialize() to
rm9200_dt_device_init().

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
---
 arch/arm/mach-at91/at91rm9200.c | 15 ++-------------
 1 file changed, 2 insertions(+), 13 deletions(-)

diff --git a/arch/arm/mach-at91/at91rm9200.c b/arch/arm/mach-at91/at91rm9200.c
index a3c0dd612d77..6992cc9ce902 100644
--- a/arch/arm/mach-at91/at91rm9200.c
+++ b/arch/arm/mach-at91/at91rm9200.c
@@ -8,21 +8,12 @@
  *
  * Licensed under GPLv2 or later.
  */
-#include <linux/types.h>
-#include <linux/init.h>
-#include <linux/module.h>
-#include <linux/gpio.h>
 #include <linux/of.h>
-#include <linux/of_irq.h>
 #include <linux/of_platform.h>
 #include <linux/clk-provider.h>
-#include <linux/clk/at91_pmc.h>
 
-#include <asm/setup.h>
-#include <asm/irq.h>
+#include <asm/io.h>
 #include <asm/mach/arch.h>
-#include <asm/mach/irq.h>
-#include <asm/mach/map.h>
 #include <asm/system_misc.h>
 
 #include <mach/at91_st.h>
@@ -30,7 +21,6 @@
 
 #include "generic.h"
 
-
 static void at91rm9200_restart(enum reboot_mode reboot_mode, const char *cmd)
 {
 	/*
@@ -51,6 +41,7 @@ static void __init rm9200_dt_device_init(void)
 	arm_pm_idle = at91rm9200_idle;
 	arm_pm_restart = at91rm9200_restart;
 	at91_rm9200_pm_init();
+	at91_dt_initialize();
 
 	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 }
@@ -62,8 +53,6 @@ static const char *at91rm9200_dt_board_compat[] __initdata = {
 
 DT_MACHINE_START(at91rm9200_dt, "Atmel AT91RM9200 (Device Tree)")
 	.init_time      = at91rm9200_dt_timer_init,
-	.map_io		= at91_map_io,
-	.init_early	= at91_dt_initialize,
 	.init_machine	= rm9200_dt_device_init,
 	.dt_compat	= at91rm9200_dt_board_compat,
 MACHINE_END
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 56+ messages in thread

* [PATCH 13/17] ARM: at91: rework initialization for sam9 based boards
  2015-01-15 21:58 ` Alexandre Belloni
@ 2015-01-15 21:58   ` Alexandre Belloni
  -1 siblings, 0 replies; 56+ messages in thread
From: Alexandre Belloni @ 2015-01-15 21:58 UTC (permalink / raw)
  To: Nicolas Ferre
  Cc: Jean-Christophe Plagniol-Villard, Arnd Bergmann, Boris Brezillon,
	Bo Shen, Wenyou Yang, linux-arm-kernel, linux-kernel,
	Alexandre Belloni

Remove useless .map_io and .init_early by moving at91_dt_initialize() to
sam9*_dt_device_init(). Also rename board-dt-sam9.c to at91sam9.c

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
---
 arch/arm/mach-at91/Makefile                        |  4 +---
 arch/arm/mach-at91/{board-dt-sam9.c => at91sam9.c} | 16 ++--------------
 2 files changed, 3 insertions(+), 17 deletions(-)
 rename arch/arm/mach-at91/{board-dt-sam9.c => at91sam9.c} (76%)

diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile
index 76d6d869bf4e..27b503defe80 100644
--- a/arch/arm/mach-at91/Makefile
+++ b/arch/arm/mach-at91/Makefile
@@ -8,12 +8,10 @@ obj-$(CONFIG_SOC_AT91SAM9)	+= sam9_smc.o
 
 # CPU-specific support
 obj-$(CONFIG_SOC_AT91RM9200)	+= at91rm9200.o at91rm9200_time.o
+obj-$(CONFIG_SOC_AT91SAM9)	+= at91sam9.o
 obj-$(CONFIG_SOC_SAMA5D3)	+= sama5d3.o
 obj-$(CONFIG_SOC_SAMA5D4)	+= sama5d4.o
 
-# AT91SAM board with device-tree
-obj-$(CONFIG_SOC_AT91SAM9) += board-dt-sam9.o
-
 # Power Management
 obj-$(CONFIG_PM)		+= pm.o
 obj-$(CONFIG_AT91_SLOW_CLOCK)	+= pm_slowclock.o
diff --git a/arch/arm/mach-at91/board-dt-sam9.c b/arch/arm/mach-at91/at91sam9.c
similarity index 76%
rename from arch/arm/mach-at91/board-dt-sam9.c
rename to arch/arm/mach-at91/at91sam9.c
index 6f90201dbd47..8b890644d6f0 100644
--- a/arch/arm/mach-at91/board-dt-sam9.c
+++ b/arch/arm/mach-at91/at91sam9.c
@@ -7,20 +7,10 @@
  * Licensed under GPLv2 or later.
  */
 
-#include <linux/types.h>
-#include <linux/init.h>
-#include <linux/module.h>
-#include <linux/gpio.h>
 #include <linux/of.h>
-#include <linux/of_irq.h>
 #include <linux/of_platform.h>
-#include <linux/clk-provider.h>
 
-#include <asm/setup.h>
-#include <asm/irq.h>
 #include <asm/mach/arch.h>
-#include <asm/mach/map.h>
-#include <asm/mach/irq.h>
 #include <asm/system_misc.h>
 
 #include "generic.h"
@@ -29,6 +19,7 @@ static void __init sam9_dt_device_init(void)
 {
 	arm_pm_idle = at91sam9_idle;
 	at91_sam9260_pm_init();
+	at91_dt_initialize();
 
 	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 }
@@ -40,8 +31,6 @@ static const char *at91_dt_board_compat[] __initdata = {
 
 DT_MACHINE_START(at91sam_dt, "Atmel AT91SAM (Device Tree)")
 	/* Maintainer: Atmel */
-	.map_io		= at91_map_io,
-	.init_early	= at91_dt_initialize,
 	.init_machine	= sam9_dt_device_init,
 	.dt_compat	= at91_dt_board_compat,
 MACHINE_END
@@ -50,6 +39,7 @@ static void __init sam9g45_dt_device_init(void)
 {
 	arm_pm_idle = at91sam9_idle;
 	at91_sam9g45_pm_init();
+	at91_dt_initialize();
 
 	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 }
@@ -61,8 +51,6 @@ static const char *at91_9g45_board_compat[] __initconst = {
 
 DT_MACHINE_START(at91sam9g45_dt, "Atmel AT91SAM9G45")
 	/* Maintainer: Atmel */
-	.map_io		= at91_map_io,
-	.init_early	= at91_dt_initialize,
 	.init_machine	= sam9g45_dt_device_init,
 	.dt_compat	= at91_9g45_board_compat,
 MACHINE_END
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 56+ messages in thread

* [PATCH 13/17] ARM: at91: rework initialization for sam9 based boards
@ 2015-01-15 21:58   ` Alexandre Belloni
  0 siblings, 0 replies; 56+ messages in thread
From: Alexandre Belloni @ 2015-01-15 21:58 UTC (permalink / raw)
  To: linux-arm-kernel

Remove useless .map_io and .init_early by moving at91_dt_initialize() to
sam9*_dt_device_init(). Also rename board-dt-sam9.c to at91sam9.c

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
---
 arch/arm/mach-at91/Makefile                        |  4 +---
 arch/arm/mach-at91/{board-dt-sam9.c => at91sam9.c} | 16 ++--------------
 2 files changed, 3 insertions(+), 17 deletions(-)
 rename arch/arm/mach-at91/{board-dt-sam9.c => at91sam9.c} (76%)

diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile
index 76d6d869bf4e..27b503defe80 100644
--- a/arch/arm/mach-at91/Makefile
+++ b/arch/arm/mach-at91/Makefile
@@ -8,12 +8,10 @@ obj-$(CONFIG_SOC_AT91SAM9)	+= sam9_smc.o
 
 # CPU-specific support
 obj-$(CONFIG_SOC_AT91RM9200)	+= at91rm9200.o at91rm9200_time.o
+obj-$(CONFIG_SOC_AT91SAM9)	+= at91sam9.o
 obj-$(CONFIG_SOC_SAMA5D3)	+= sama5d3.o
 obj-$(CONFIG_SOC_SAMA5D4)	+= sama5d4.o
 
-# AT91SAM board with device-tree
-obj-$(CONFIG_SOC_AT91SAM9) += board-dt-sam9.o
-
 # Power Management
 obj-$(CONFIG_PM)		+= pm.o
 obj-$(CONFIG_AT91_SLOW_CLOCK)	+= pm_slowclock.o
diff --git a/arch/arm/mach-at91/board-dt-sam9.c b/arch/arm/mach-at91/at91sam9.c
similarity index 76%
rename from arch/arm/mach-at91/board-dt-sam9.c
rename to arch/arm/mach-at91/at91sam9.c
index 6f90201dbd47..8b890644d6f0 100644
--- a/arch/arm/mach-at91/board-dt-sam9.c
+++ b/arch/arm/mach-at91/at91sam9.c
@@ -7,20 +7,10 @@
  * Licensed under GPLv2 or later.
  */
 
-#include <linux/types.h>
-#include <linux/init.h>
-#include <linux/module.h>
-#include <linux/gpio.h>
 #include <linux/of.h>
-#include <linux/of_irq.h>
 #include <linux/of_platform.h>
-#include <linux/clk-provider.h>
 
-#include <asm/setup.h>
-#include <asm/irq.h>
 #include <asm/mach/arch.h>
-#include <asm/mach/map.h>
-#include <asm/mach/irq.h>
 #include <asm/system_misc.h>
 
 #include "generic.h"
@@ -29,6 +19,7 @@ static void __init sam9_dt_device_init(void)
 {
 	arm_pm_idle = at91sam9_idle;
 	at91_sam9260_pm_init();
+	at91_dt_initialize();
 
 	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 }
@@ -40,8 +31,6 @@ static const char *at91_dt_board_compat[] __initdata = {
 
 DT_MACHINE_START(at91sam_dt, "Atmel AT91SAM (Device Tree)")
 	/* Maintainer: Atmel */
-	.map_io		= at91_map_io,
-	.init_early	= at91_dt_initialize,
 	.init_machine	= sam9_dt_device_init,
 	.dt_compat	= at91_dt_board_compat,
 MACHINE_END
@@ -50,6 +39,7 @@ static void __init sam9g45_dt_device_init(void)
 {
 	arm_pm_idle = at91sam9_idle;
 	at91_sam9g45_pm_init();
+	at91_dt_initialize();
 
 	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 }
@@ -61,8 +51,6 @@ static const char *at91_9g45_board_compat[] __initconst = {
 
 DT_MACHINE_START(at91sam9g45_dt, "Atmel AT91SAM9G45")
 	/* Maintainer: Atmel */
-	.map_io		= at91_map_io,
-	.init_early	= at91_dt_initialize,
 	.init_machine	= sam9g45_dt_device_init,
 	.dt_compat	= at91_9g45_board_compat,
 MACHINE_END
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 56+ messages in thread

* [PATCH 14/17] ARM: at91: rework initialization for sama5 based boards
  2015-01-15 21:58 ` Alexandre Belloni
@ 2015-01-15 21:58   ` Alexandre Belloni
  -1 siblings, 0 replies; 56+ messages in thread
From: Alexandre Belloni @ 2015-01-15 21:58 UTC (permalink / raw)
  To: Nicolas Ferre
  Cc: Jean-Christophe Plagniol-Villard, Arnd Bergmann, Boris Brezillon,
	Bo Shen, Wenyou Yang, linux-arm-kernel, linux-kernel,
	Alexandre Belloni

Removed useless .map_io for sama5d3 and .init_early by moving
at91_dt_initialize() to sama5*_dt_device_init()

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
---
 arch/arm/mach-at91/sama5d3.c | 9 ++-------
 arch/arm/mach-at91/sama5d4.c | 3 ++-
 2 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/arch/arm/mach-at91/sama5d3.c b/arch/arm/mach-at91/sama5d3.c
index 6f73a34cb7e4..752d1612ff1f 100644
--- a/arch/arm/mach-at91/sama5d3.c
+++ b/arch/arm/mach-at91/sama5d3.c
@@ -7,20 +7,17 @@
  * Licensed under GPLv2 or later.
  */
 
-#include <linux/init.h>
 #include <linux/of_platform.h>
 
 #include <asm/mach/arch.h>
-#include <asm/mach/map.h>
-
-#include <mach/sama5d3.h>
-#include <mach/cpu.h>
 
 #include "generic.h"
 
 static void __init sama5_dt_device_init(void)
 {
 	at91_sam9260_pm_init();
+	at91_dt_initialize();
+
 	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 }
 
@@ -31,8 +28,6 @@ static const char *sama5_dt_board_compat[] __initconst = {
 
 DT_MACHINE_START(sama5_dt, "Atmel SAMA5 (Device Tree)")
 	/* Maintainer: Atmel */
-	.map_io		= at91_map_io,
-	.init_early	= at91_dt_initialize,
 	.init_machine	= sama5_dt_device_init,
 	.dt_compat	= sama5_dt_board_compat,
 MACHINE_END
diff --git a/arch/arm/mach-at91/sama5d4.c b/arch/arm/mach-at91/sama5d4.c
index 87c71afedb57..2f1ee08dc49f 100644
--- a/arch/arm/mach-at91/sama5d4.c
+++ b/arch/arm/mach-at91/sama5d4.c
@@ -52,6 +52,8 @@ static void __init sama5d4_map_io(void)
 static void __init sama5d4_dt_device_init(void)
 {
 	at91_sam9260_pm_init();
+	at91_dt_initialize();
+
 	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 }
 
@@ -63,7 +65,6 @@ static const char *sama5_alt_dt_board_compat[] __initconst = {
 DT_MACHINE_START(sama5_alt_dt, "Atmel SAMA5 (Device Tree)")
 	/* Maintainer: Atmel */
 	.map_io		= sama5d4_map_io,
-	.init_early	= at91_dt_initialize,
 	.init_machine	= sama5d4_dt_device_init,
 	.dt_compat	= sama5_alt_dt_board_compat,
 	.l2c_aux_mask	= ~0UL,
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 56+ messages in thread

* [PATCH 14/17] ARM: at91: rework initialization for sama5 based boards
@ 2015-01-15 21:58   ` Alexandre Belloni
  0 siblings, 0 replies; 56+ messages in thread
From: Alexandre Belloni @ 2015-01-15 21:58 UTC (permalink / raw)
  To: linux-arm-kernel

Removed useless .map_io for sama5d3 and .init_early by moving
at91_dt_initialize() to sama5*_dt_device_init()

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
---
 arch/arm/mach-at91/sama5d3.c | 9 ++-------
 arch/arm/mach-at91/sama5d4.c | 3 ++-
 2 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/arch/arm/mach-at91/sama5d3.c b/arch/arm/mach-at91/sama5d3.c
index 6f73a34cb7e4..752d1612ff1f 100644
--- a/arch/arm/mach-at91/sama5d3.c
+++ b/arch/arm/mach-at91/sama5d3.c
@@ -7,20 +7,17 @@
  * Licensed under GPLv2 or later.
  */
 
-#include <linux/init.h>
 #include <linux/of_platform.h>
 
 #include <asm/mach/arch.h>
-#include <asm/mach/map.h>
-
-#include <mach/sama5d3.h>
-#include <mach/cpu.h>
 
 #include "generic.h"
 
 static void __init sama5_dt_device_init(void)
 {
 	at91_sam9260_pm_init();
+	at91_dt_initialize();
+
 	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 }
 
@@ -31,8 +28,6 @@ static const char *sama5_dt_board_compat[] __initconst = {
 
 DT_MACHINE_START(sama5_dt, "Atmel SAMA5 (Device Tree)")
 	/* Maintainer: Atmel */
-	.map_io		= at91_map_io,
-	.init_early	= at91_dt_initialize,
 	.init_machine	= sama5_dt_device_init,
 	.dt_compat	= sama5_dt_board_compat,
 MACHINE_END
diff --git a/arch/arm/mach-at91/sama5d4.c b/arch/arm/mach-at91/sama5d4.c
index 87c71afedb57..2f1ee08dc49f 100644
--- a/arch/arm/mach-at91/sama5d4.c
+++ b/arch/arm/mach-at91/sama5d4.c
@@ -52,6 +52,8 @@ static void __init sama5d4_map_io(void)
 static void __init sama5d4_dt_device_init(void)
 {
 	at91_sam9260_pm_init();
+	at91_dt_initialize();
+
 	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 }
 
@@ -63,7 +65,6 @@ static const char *sama5_alt_dt_board_compat[] __initconst = {
 DT_MACHINE_START(sama5_alt_dt, "Atmel SAMA5 (Device Tree)")
 	/* Maintainer: Atmel */
 	.map_io		= sama5d4_map_io,
-	.init_early	= at91_dt_initialize,
 	.init_machine	= sama5d4_dt_device_init,
 	.dt_compat	= sama5_alt_dt_board_compat,
 	.l2c_aux_mask	= ~0UL,
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 56+ messages in thread

* [PATCH 15/17] ARM: at91: remove old setup
  2015-01-15 21:58 ` Alexandre Belloni
@ 2015-01-15 21:58   ` Alexandre Belloni
  -1 siblings, 0 replies; 56+ messages in thread
From: Alexandre Belloni @ 2015-01-15 21:58 UTC (permalink / raw)
  To: Nicolas Ferre
  Cc: Jean-Christophe Plagniol-Villard, Arnd Bergmann, Boris Brezillon,
	Bo Shen, Wenyou Yang, linux-arm-kernel, linux-kernel,
	Alexandre Belloni

The old initialization is not used anymore, remove it.
Also remove now unused cpu.h and at91_dbgu.h

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
---
 arch/arm/mach-at91/generic.h                   |   4 -
 arch/arm/mach-at91/include/mach/at91_dbgu.h    |  63 ------
 arch/arm/mach-at91/include/mach/at91_ramc.h    |   6 -
 arch/arm/mach-at91/include/mach/at91sam9_smc.h |   2 -
 arch/arm/mach-at91/include/mach/cpu.h          | 240 --------------------
 arch/arm/mach-at91/pm.c                        |   5 +-
 arch/arm/mach-at91/setup.c                     | 301 -------------------------
 7 files changed, 4 insertions(+), 617 deletions(-)
 delete mode 100644 arch/arm/mach-at91/include/mach/at91_dbgu.h
 delete mode 100644 arch/arm/mach-at91/include/mach/cpu.h

diff --git a/arch/arm/mach-at91/generic.h b/arch/arm/mach-at91/generic.h
index 1e60faec2eba..881e73a27fab 100644
--- a/arch/arm/mach-at91/generic.h
+++ b/arch/arm/mach-at91/generic.h
@@ -14,10 +14,6 @@
 #include <linux/of.h>
 #include <linux/reboot.h>
 
- /* Map io */
-extern void __init at91_map_io(void);
-extern void __init at91_alt_map_io(void);
-
  /* Processors */
 extern void __init at91_dt_initialize(void);
 
diff --git a/arch/arm/mach-at91/include/mach/at91_dbgu.h b/arch/arm/mach-at91/include/mach/at91_dbgu.h
deleted file mode 100644
index 42925e8f78e4..000000000000
--- a/arch/arm/mach-at91/include/mach/at91_dbgu.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * arch/arm/mach-at91/include/mach/at91_dbgu.h
- *
- * Copyright (C) 2005 Ivan Kokshaysky
- * Copyright (C) SAN People
- *
- * Debug Unit (DBGU) - System peripherals registers.
- * Based on AT91RM9200 datasheet revision E.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- */
-
-#ifndef AT91_DBGU_H
-#define AT91_DBGU_H
-
-#define AT91_DBGU_CR		(0x00)	/* Control Register */
-#define AT91_DBGU_MR		(0x04)	/* Mode Register */
-#define AT91_DBGU_IER		(0x08)	/* Interrupt Enable Register */
-#define		AT91_DBGU_TXRDY		(1 << 1)		/* Transmitter Ready */
-#define		AT91_DBGU_TXEMPTY	(1 << 9)		/* Transmitter Empty */
-#define AT91_DBGU_IDR		(0x0c)	/* Interrupt Disable Register */
-#define AT91_DBGU_IMR		(0x10)	/* Interrupt Mask Register */
-#define AT91_DBGU_SR		(0x14)	/* Status Register */
-#define AT91_DBGU_RHR		(0x18)	/* Receiver Holding Register */
-#define AT91_DBGU_THR		(0x1c)	/* Transmitter Holding Register */
-#define AT91_DBGU_BRGR		(0x20)	/* Baud Rate Generator Register */
-
-#define AT91_DBGU_CIDR		(0x40)	/* Chip ID Register */
-#define AT91_DBGU_EXID		(0x44)	/* Chip ID Extension Register */
-#define AT91_DBGU_FNR		(0x48)	/* Force NTRST Register [SAM9 only] */
-#define		AT91_DBGU_FNTRST	(1 << 0)		/* Force NTRST */
-
-/*
- * Some AT91 parts that don't have full DEBUG units still support the ID
- * and extensions register.
- */
-#define		AT91_CIDR_VERSION	(0x1f << 0)		/* Version of the Device */
-#define		AT91_CIDR_EPROC		(7    << 5)		/* Embedded Processor */
-#define		AT91_CIDR_NVPSIZ	(0xf  << 8)		/* Nonvolatile Program Memory Size */
-#define		AT91_CIDR_NVPSIZ2	(0xf  << 12)		/* Second Nonvolatile Program Memory Size */
-#define		AT91_CIDR_SRAMSIZ	(0xf  << 16)		/* Internal SRAM Size */
-#define			AT91_CIDR_SRAMSIZ_1K	(1 << 16)
-#define			AT91_CIDR_SRAMSIZ_2K	(2 << 16)
-#define			AT91_CIDR_SRAMSIZ_112K	(4 << 16)
-#define			AT91_CIDR_SRAMSIZ_4K	(5 << 16)
-#define			AT91_CIDR_SRAMSIZ_80K	(6 << 16)
-#define			AT91_CIDR_SRAMSIZ_160K	(7 << 16)
-#define			AT91_CIDR_SRAMSIZ_8K	(8 << 16)
-#define			AT91_CIDR_SRAMSIZ_16K	(9 << 16)
-#define			AT91_CIDR_SRAMSIZ_32K	(10 << 16)
-#define			AT91_CIDR_SRAMSIZ_64K	(11 << 16)
-#define			AT91_CIDR_SRAMSIZ_128K	(12 << 16)
-#define			AT91_CIDR_SRAMSIZ_256K	(13 << 16)
-#define			AT91_CIDR_SRAMSIZ_96K	(14 << 16)
-#define			AT91_CIDR_SRAMSIZ_512K	(15 << 16)
-#define		AT91_CIDR_ARCH		(0xff << 20)		/* Architecture Identifier */
-#define		AT91_CIDR_NVPTYP	(7    << 28)		/* Nonvolatile Program Memory Type */
-#define		AT91_CIDR_EXT		(1    << 31)		/* Extension Flag */
-
-#endif
diff --git a/arch/arm/mach-at91/include/mach/at91_ramc.h b/arch/arm/mach-at91/include/mach/at91_ramc.h
index e4492b151fee..80431ece8a54 100644
--- a/arch/arm/mach-at91/include/mach/at91_ramc.h
+++ b/arch/arm/mach-at91/include/mach/at91_ramc.h
@@ -9,17 +9,11 @@
 #ifndef __AT91_RAMC_H__
 #define __AT91_RAMC_H__
 
-#ifndef __ASSEMBLY__
-extern void __iomem *at91_ramc_base[];
-
 #define at91_ramc_read(id, field) \
 	__raw_readl(at91_ramc_base[id] + field)
 
 #define at91_ramc_write(id, field, value) \
 	__raw_writel(value, at91_ramc_base[id] + field)
-#else
-.extern at91_ramc_base
-#endif
 
 #define AT91_MEMCTRL_MC		0
 #define AT91_MEMCTRL_SDRAMC	1
diff --git a/arch/arm/mach-at91/include/mach/at91sam9_smc.h b/arch/arm/mach-at91/include/mach/at91sam9_smc.h
index 175e1fdd9fe8..ff54a0ce90e3 100644
--- a/arch/arm/mach-at91/include/mach/at91sam9_smc.h
+++ b/arch/arm/mach-at91/include/mach/at91sam9_smc.h
@@ -16,8 +16,6 @@
 #ifndef AT91SAM9_SMC_H
 #define AT91SAM9_SMC_H
 
-#include <mach/cpu.h>
-
 #ifndef __ASSEMBLY__
 struct sam9_smc_config {
 	/* Setup register */
diff --git a/arch/arm/mach-at91/include/mach/cpu.h b/arch/arm/mach-at91/include/mach/cpu.h
deleted file mode 100644
index 61914fb35f5d..000000000000
--- a/arch/arm/mach-at91/include/mach/cpu.h
+++ /dev/null
@@ -1,240 +0,0 @@
-/*
- * arch/arm/mach-at91/include/mach/cpu.h
- *
- * Copyright (C) 2006 SAN People
- * Copyright (C) 2011 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- */
-
-#ifndef __MACH_CPU_H__
-#define __MACH_CPU_H__
-
-#define ARCH_ID_AT91RM9200	0x09290780
-#define ARCH_ID_AT91SAM9260	0x019803a0
-#define ARCH_ID_AT91SAM9261	0x019703a0
-#define ARCH_ID_AT91SAM9263	0x019607a0
-#define ARCH_ID_AT91SAM9G10	0x019903a0
-#define ARCH_ID_AT91SAM9G20	0x019905a0
-#define ARCH_ID_AT91SAM9RL64	0x019b03a0
-#define ARCH_ID_AT91SAM9G45	0x819b05a0
-#define ARCH_ID_AT91SAM9G45MRL	0x819b05a2	/* aka 9G45-ES2 & non ES lots */
-#define ARCH_ID_AT91SAM9G45ES	0x819b05a1	/* 9G45-ES (Engineering Sample) */
-#define ARCH_ID_AT91SAM9X5	0x819a05a0
-#define ARCH_ID_AT91SAM9N12	0x819a07a0
-
-#define ARCH_ID_AT91SAM9XE128	0x329973a0
-#define ARCH_ID_AT91SAM9XE256	0x329a93a0
-#define ARCH_ID_AT91SAM9XE512	0x329aa3a0
-
-#define ARCH_ID_AT91M40800	0x14080044
-#define ARCH_ID_AT91R40807	0x44080746
-#define ARCH_ID_AT91M40807	0x14080745
-#define ARCH_ID_AT91R40008	0x44000840
-
-#define ARCH_ID_SAMA5		0x8A5C07C0
-
-#define ARCH_EXID_AT91SAM9M11	0x00000001
-#define ARCH_EXID_AT91SAM9M10	0x00000002
-#define ARCH_EXID_AT91SAM9G46	0x00000003
-#define ARCH_EXID_AT91SAM9G45	0x00000004
-
-#define ARCH_EXID_AT91SAM9G15	0x00000000
-#define ARCH_EXID_AT91SAM9G35	0x00000001
-#define ARCH_EXID_AT91SAM9X35	0x00000002
-#define ARCH_EXID_AT91SAM9G25	0x00000003
-#define ARCH_EXID_AT91SAM9X25	0x00000004
-
-#define ARCH_EXID_SAMA5D3	0x00004300
-#define ARCH_EXID_SAMA5D31	0x00444300
-#define ARCH_EXID_SAMA5D33	0x00414300
-#define ARCH_EXID_SAMA5D34	0x00414301
-#define ARCH_EXID_SAMA5D35	0x00584300
-#define ARCH_EXID_SAMA5D36	0x00004301
-
-#define ARCH_EXID_SAMA5D4	0x00000007
-#define ARCH_EXID_SAMA5D41	0x00000001
-#define ARCH_EXID_SAMA5D42	0x00000002
-#define ARCH_EXID_SAMA5D43	0x00000003
-#define ARCH_EXID_SAMA5D44	0x00000004
-
-#define ARCH_FAMILY_AT91SAM9	0x01900000
-#define ARCH_FAMILY_AT91SAM9XE	0x02900000
-
-/* RM9200 type */
-#define ARCH_REVISON_9200_BGA	(0 << 0)
-#define ARCH_REVISON_9200_PQFP	(1 << 0)
-
-#ifndef __ASSEMBLY__
-enum at91_soc_type {
-	/* 920T */
-	AT91_SOC_RM9200,
-
-	/* SAM92xx */
-	AT91_SOC_SAM9260, AT91_SOC_SAM9261, AT91_SOC_SAM9263,
-
-	/* SAM9Gxx */
-	AT91_SOC_SAM9G10, AT91_SOC_SAM9G20, AT91_SOC_SAM9G45,
-
-	/* SAM9RL */
-	AT91_SOC_SAM9RL,
-
-	/* SAM9X5 */
-	AT91_SOC_SAM9X5,
-
-	/* SAM9N12 */
-	AT91_SOC_SAM9N12,
-
-	/* SAMA5D3 */
-	AT91_SOC_SAMA5D3,
-
-	/* SAMA5D4 */
-	AT91_SOC_SAMA5D4,
-
-	/* Unknown type */
-	AT91_SOC_UNKNOWN,
-};
-
-enum at91_soc_subtype {
-	/* RM9200 */
-	AT91_SOC_RM9200_BGA, AT91_SOC_RM9200_PQFP,
-
-	/* SAM9260 */
-	AT91_SOC_SAM9XE,
-
-	/* SAM9G45 */
-	AT91_SOC_SAM9G45ES, AT91_SOC_SAM9M10, AT91_SOC_SAM9G46, AT91_SOC_SAM9M11,
-
-	/* SAM9X5 */
-	AT91_SOC_SAM9G15, AT91_SOC_SAM9G35, AT91_SOC_SAM9X35,
-	AT91_SOC_SAM9G25, AT91_SOC_SAM9X25,
-
-	/* SAMA5D3 */
-	AT91_SOC_SAMA5D31, AT91_SOC_SAMA5D33, AT91_SOC_SAMA5D34,
-	AT91_SOC_SAMA5D35, AT91_SOC_SAMA5D36,
-
-	/* SAMA5D4 */
-	AT91_SOC_SAMA5D41, AT91_SOC_SAMA5D42, AT91_SOC_SAMA5D43,
-	AT91_SOC_SAMA5D44,
-
-	/* No subtype for this SoC */
-	AT91_SOC_SUBTYPE_NONE,
-
-	/* Unknown subtype */
-	AT91_SOC_SUBTYPE_UNKNOWN,
-};
-
-struct at91_socinfo {
-	unsigned int type, subtype;
-	unsigned int cidr, exid;
-};
-
-extern struct at91_socinfo at91_soc_initdata;
-const char *at91_get_soc_type(struct at91_socinfo *c);
-const char *at91_get_soc_subtype(struct at91_socinfo *c);
-
-static inline int at91_soc_is_detected(void)
-{
-	return at91_soc_initdata.type != AT91_SOC_UNKNOWN;
-}
-
-#ifdef CONFIG_SOC_AT91RM9200
-#define cpu_is_at91rm9200()	(at91_soc_initdata.type == AT91_SOC_RM9200)
-#define cpu_is_at91rm9200_bga()	(at91_soc_initdata.subtype == AT91_SOC_RM9200_BGA)
-#define cpu_is_at91rm9200_pqfp() (at91_soc_initdata.subtype == AT91_SOC_RM9200_PQFP)
-#else
-#define cpu_is_at91rm9200()	(0)
-#define cpu_is_at91rm9200_bga()	(0)
-#define cpu_is_at91rm9200_pqfp() (0)
-#endif
-
-#ifdef CONFIG_SOC_AT91SAM9260
-#define cpu_is_at91sam9xe()	(at91_soc_initdata.subtype == AT91_SOC_SAM9XE)
-#define cpu_is_at91sam9260()	(at91_soc_initdata.type == AT91_SOC_SAM9260)
-#define cpu_is_at91sam9g20()	(at91_soc_initdata.type == AT91_SOC_SAM9G20)
-#else
-#define cpu_is_at91sam9xe()	(0)
-#define cpu_is_at91sam9260()	(0)
-#define cpu_is_at91sam9g20()	(0)
-#endif
-
-#ifdef CONFIG_SOC_AT91SAM9261
-#define cpu_is_at91sam9261()	(at91_soc_initdata.type == AT91_SOC_SAM9261)
-#define cpu_is_at91sam9g10()	(at91_soc_initdata.type == AT91_SOC_SAM9G10)
-#else
-#define cpu_is_at91sam9261()	(0)
-#define cpu_is_at91sam9g10()	(0)
-#endif
-
-#ifdef CONFIG_SOC_AT91SAM9263
-#define cpu_is_at91sam9263()	(at91_soc_initdata.type == AT91_SOC_SAM9263)
-#else
-#define cpu_is_at91sam9263()	(0)
-#endif
-
-#ifdef CONFIG_SOC_AT91SAM9RL
-#define cpu_is_at91sam9rl()	(at91_soc_initdata.type == AT91_SOC_SAM9RL)
-#else
-#define cpu_is_at91sam9rl()	(0)
-#endif
-
-#ifdef CONFIG_SOC_AT91SAM9G45
-#define cpu_is_at91sam9g45()	(at91_soc_initdata.type == AT91_SOC_SAM9G45)
-#define cpu_is_at91sam9g45es()	(at91_soc_initdata.subtype == AT91_SOC_SAM9G45ES)
-#define cpu_is_at91sam9m10()	(at91_soc_initdata.subtype == AT91_SOC_SAM9M10)
-#define cpu_is_at91sam9g46()	(at91_soc_initdata.subtype == AT91_SOC_SAM9G46)
-#define cpu_is_at91sam9m11()	(at91_soc_initdata.subtype == AT91_SOC_SAM9M11)
-#else
-#define cpu_is_at91sam9g45()	(0)
-#define cpu_is_at91sam9g45es()	(0)
-#define cpu_is_at91sam9m10()	(0)
-#define cpu_is_at91sam9g46()	(0)
-#define cpu_is_at91sam9m11()	(0)
-#endif
-
-#ifdef CONFIG_SOC_AT91SAM9X5
-#define cpu_is_at91sam9x5()	(at91_soc_initdata.type == AT91_SOC_SAM9X5)
-#define cpu_is_at91sam9g15()	(at91_soc_initdata.subtype == AT91_SOC_SAM9G15)
-#define cpu_is_at91sam9g35()	(at91_soc_initdata.subtype == AT91_SOC_SAM9G35)
-#define cpu_is_at91sam9x35()	(at91_soc_initdata.subtype == AT91_SOC_SAM9X35)
-#define cpu_is_at91sam9g25()	(at91_soc_initdata.subtype == AT91_SOC_SAM9G25)
-#define cpu_is_at91sam9x25()	(at91_soc_initdata.subtype == AT91_SOC_SAM9X25)
-#else
-#define cpu_is_at91sam9x5()	(0)
-#define cpu_is_at91sam9g15()	(0)
-#define cpu_is_at91sam9g35()	(0)
-#define cpu_is_at91sam9x35()	(0)
-#define cpu_is_at91sam9g25()	(0)
-#define cpu_is_at91sam9x25()	(0)
-#endif
-
-#ifdef CONFIG_SOC_AT91SAM9N12
-#define cpu_is_at91sam9n12()	(at91_soc_initdata.type == AT91_SOC_SAM9N12)
-#else
-#define cpu_is_at91sam9n12()	(0)
-#endif
-
-#ifdef CONFIG_SOC_SAMA5D3
-#define cpu_is_sama5d3()	(at91_soc_initdata.type == AT91_SOC_SAMA5D3)
-#else
-#define cpu_is_sama5d3()	(0)
-#endif
-
-#ifdef CONFIG_SOC_SAMA5D4
-#define cpu_is_sama5d4()	(at91_soc_initdata.type == AT91_SOC_SAMA5D4)
-#else
-#define cpu_is_sama5d4()	(0)
-#endif
-
-/*
- * Since this is ARM, we will never run on any AVR32 CPU. But these
- * definitions may reduce clutter in common drivers.
- */
-#define cpu_is_at32ap7000()	(0)
-#endif /* __ASSEMBLY__ */
-
-#endif /* __MACH_CPU_H__ */
diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c
index 778f11132b31..11bf992838af 100644
--- a/arch/arm/mach-at91/pm.c
+++ b/arch/arm/mach-at91/pm.c
@@ -19,6 +19,7 @@
 #include <linux/sysfs.h>
 #include <linux/module.h>
 #include <linux/of.h>
+#include <linux/of_address.h>
 #include <linux/of_platform.h>
 #include <linux/platform_device.h>
 #include <linux/io.h>
@@ -29,10 +30,12 @@
 #include <asm/mach/time.h>
 #include <asm/mach/irq.h>
 
-#include <mach/cpu.h>
 #include <mach/hardware.h>
 
 #include "generic.h"
+
+static void __iomem *at91_ramc_base[2];
+
 #include "pm.h"
 
 static struct {
diff --git a/arch/arm/mach-at91/setup.c b/arch/arm/mach-at91/setup.c
index 42ebe8d41433..4036e3e0ff96 100644
--- a/arch/arm/mach-at91/setup.c
+++ b/arch/arm/mach-at91/setup.c
@@ -7,321 +7,20 @@
 
 #define pr_fmt(fmt)	"AT91: " fmt
 
-#include <linux/module.h>
 #include <linux/io.h>
-#include <linux/mm.h>
 #include <linux/pm.h>
 #include <linux/of_address.h>
-#include <linux/pinctrl/machine.h>
-#include <linux/clk/at91_pmc.h>
 
 #include <asm/system_misc.h>
-#include <asm/mach/map.h>
 
 #include <mach/hardware.h>
-#include <mach/cpu.h>
-#include <mach/at91_dbgu.h>
 
 #include "generic.h"
 #include "pm.h"
 
-struct at91_socinfo at91_soc_initdata;
-EXPORT_SYMBOL(at91_soc_initdata);
-
 void __iomem *at91_ramc_base[2];
 EXPORT_SYMBOL_GPL(at91_ramc_base);
 
-static struct map_desc at91_io_desc __initdata __maybe_unused = {
-	.virtual	= (unsigned long)AT91_VA_BASE_SYS,
-	.pfn		= __phys_to_pfn(AT91_BASE_SYS),
-	.length		= SZ_16K,
-	.type		= MT_DEVICE,
-};
-
-static struct map_desc at91_alt_io_desc __initdata __maybe_unused = {
-	.virtual	= (unsigned long)AT91_ALT_VA_BASE_SYS,
-	.pfn		= __phys_to_pfn(AT91_ALT_BASE_SYS),
-	.length		= 24 * SZ_1K,
-	.type		= MT_DEVICE,
-};
-
-static void __init soc_detect(u32 dbgu_base)
-{
-	u32 cidr, socid;
-
-	cidr = __raw_readl(AT91_IO_P2V(dbgu_base) + AT91_DBGU_CIDR);
-	socid = cidr & ~AT91_CIDR_VERSION;
-
-	switch (socid) {
-	case ARCH_ID_AT91RM9200:
-		at91_soc_initdata.type = AT91_SOC_RM9200;
-		if (at91_soc_initdata.subtype == AT91_SOC_SUBTYPE_UNKNOWN)
-			at91_soc_initdata.subtype = AT91_SOC_RM9200_BGA;
-		break;
-
-	case ARCH_ID_AT91SAM9260:
-		at91_soc_initdata.type = AT91_SOC_SAM9260;
-		at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE;
-		break;
-
-	case ARCH_ID_AT91SAM9261:
-		at91_soc_initdata.type = AT91_SOC_SAM9261;
-		at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE;
-		break;
-
-	case ARCH_ID_AT91SAM9263:
-		at91_soc_initdata.type = AT91_SOC_SAM9263;
-		at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE;
-		break;
-
-	case ARCH_ID_AT91SAM9G20:
-		at91_soc_initdata.type = AT91_SOC_SAM9G20;
-		at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE;
-		break;
-
-	case ARCH_ID_AT91SAM9G45:
-		at91_soc_initdata.type = AT91_SOC_SAM9G45;
-		if (cidr == ARCH_ID_AT91SAM9G45ES)
-			at91_soc_initdata.subtype = AT91_SOC_SAM9G45ES;
-		break;
-
-	case ARCH_ID_AT91SAM9RL64:
-		at91_soc_initdata.type = AT91_SOC_SAM9RL;
-		at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE;
-		break;
-
-	case ARCH_ID_AT91SAM9X5:
-		at91_soc_initdata.type = AT91_SOC_SAM9X5;
-		break;
-
-	case ARCH_ID_AT91SAM9N12:
-		at91_soc_initdata.type = AT91_SOC_SAM9N12;
-		break;
-
-	case ARCH_ID_SAMA5:
-		at91_soc_initdata.exid = __raw_readl(AT91_IO_P2V(dbgu_base) + AT91_DBGU_EXID);
-		if (at91_soc_initdata.exid & ARCH_EXID_SAMA5D3) {
-			at91_soc_initdata.type = AT91_SOC_SAMA5D3;
-		}
-		break;
-	}
-
-	/* at91sam9g10 */
-	if ((socid & ~AT91_CIDR_EXT) == ARCH_ID_AT91SAM9G10) {
-		at91_soc_initdata.type = AT91_SOC_SAM9G10;
-		at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE;
-	}
-	/* at91sam9xe */
-	else if ((cidr & AT91_CIDR_ARCH) == ARCH_FAMILY_AT91SAM9XE) {
-		at91_soc_initdata.type = AT91_SOC_SAM9260;
-		at91_soc_initdata.subtype = AT91_SOC_SAM9XE;
-	}
-
-	if (!at91_soc_is_detected())
-		return;
-
-	at91_soc_initdata.cidr = cidr;
-
-	/* sub version of soc */
-	if (!at91_soc_initdata.exid)
-		at91_soc_initdata.exid = __raw_readl(AT91_IO_P2V(dbgu_base) + AT91_DBGU_EXID);
-
-	if (at91_soc_initdata.type == AT91_SOC_SAM9G45) {
-		switch (at91_soc_initdata.exid) {
-		case ARCH_EXID_AT91SAM9M10:
-			at91_soc_initdata.subtype = AT91_SOC_SAM9M10;
-			break;
-		case ARCH_EXID_AT91SAM9G46:
-			at91_soc_initdata.subtype = AT91_SOC_SAM9G46;
-			break;
-		case ARCH_EXID_AT91SAM9M11:
-			at91_soc_initdata.subtype = AT91_SOC_SAM9M11;
-			break;
-		}
-	}
-
-	if (at91_soc_initdata.type == AT91_SOC_SAM9X5) {
-		switch (at91_soc_initdata.exid) {
-		case ARCH_EXID_AT91SAM9G15:
-			at91_soc_initdata.subtype = AT91_SOC_SAM9G15;
-			break;
-		case ARCH_EXID_AT91SAM9G35:
-			at91_soc_initdata.subtype = AT91_SOC_SAM9G35;
-			break;
-		case ARCH_EXID_AT91SAM9X35:
-			at91_soc_initdata.subtype = AT91_SOC_SAM9X35;
-			break;
-		case ARCH_EXID_AT91SAM9G25:
-			at91_soc_initdata.subtype = AT91_SOC_SAM9G25;
-			break;
-		case ARCH_EXID_AT91SAM9X25:
-			at91_soc_initdata.subtype = AT91_SOC_SAM9X25;
-			break;
-		}
-	}
-
-	if (at91_soc_initdata.type == AT91_SOC_SAMA5D3) {
-		switch (at91_soc_initdata.exid) {
-		case ARCH_EXID_SAMA5D31:
-			at91_soc_initdata.subtype = AT91_SOC_SAMA5D31;
-			break;
-		case ARCH_EXID_SAMA5D33:
-			at91_soc_initdata.subtype = AT91_SOC_SAMA5D33;
-			break;
-		case ARCH_EXID_SAMA5D34:
-			at91_soc_initdata.subtype = AT91_SOC_SAMA5D34;
-			break;
-		case ARCH_EXID_SAMA5D35:
-			at91_soc_initdata.subtype = AT91_SOC_SAMA5D35;
-			break;
-		case ARCH_EXID_SAMA5D36:
-			at91_soc_initdata.subtype = AT91_SOC_SAMA5D36;
-			break;
-		}
-	}
-}
-
-static void __init alt_soc_detect(u32 dbgu_base)
-{
-	u32 cidr, socid;
-
-	/* SoC ID */
-	cidr = __raw_readl(AT91_ALT_IO_P2V(dbgu_base) + AT91_DBGU_CIDR);
-	socid = cidr & ~AT91_CIDR_VERSION;
-
-	switch (socid) {
-	case ARCH_ID_SAMA5:
-		at91_soc_initdata.exid = __raw_readl(AT91_ALT_IO_P2V(dbgu_base) + AT91_DBGU_EXID);
-		if (at91_soc_initdata.exid & ARCH_EXID_SAMA5D3) {
-			at91_soc_initdata.type = AT91_SOC_SAMA5D3;
-		} else if (at91_soc_initdata.exid & ARCH_EXID_SAMA5D4) {
-			at91_soc_initdata.type = AT91_SOC_SAMA5D4;
-		}
-		break;
-	}
-
-	if (!at91_soc_is_detected())
-		return;
-
-	at91_soc_initdata.cidr = cidr;
-
-	/* sub version of soc */
-	if (!at91_soc_initdata.exid)
-		at91_soc_initdata.exid = __raw_readl(AT91_ALT_IO_P2V(dbgu_base) + AT91_DBGU_EXID);
-
-	if (at91_soc_initdata.type == AT91_SOC_SAMA5D4) {
-		switch (at91_soc_initdata.exid) {
-		case ARCH_EXID_SAMA5D41:
-			at91_soc_initdata.subtype = AT91_SOC_SAMA5D41;
-			break;
-		case ARCH_EXID_SAMA5D42:
-			at91_soc_initdata.subtype = AT91_SOC_SAMA5D42;
-			break;
-		case ARCH_EXID_SAMA5D43:
-			at91_soc_initdata.subtype = AT91_SOC_SAMA5D43;
-			break;
-		case ARCH_EXID_SAMA5D44:
-			at91_soc_initdata.subtype = AT91_SOC_SAMA5D44;
-			break;
-		}
-	}
-}
-
-static const char *soc_name[] = {
-	[AT91_SOC_RM9200]	= "at91rm9200",
-	[AT91_SOC_SAM9260]	= "at91sam9260",
-	[AT91_SOC_SAM9261]	= "at91sam9261",
-	[AT91_SOC_SAM9263]	= "at91sam9263",
-	[AT91_SOC_SAM9G10]	= "at91sam9g10",
-	[AT91_SOC_SAM9G20]	= "at91sam9g20",
-	[AT91_SOC_SAM9G45]	= "at91sam9g45",
-	[AT91_SOC_SAM9RL]	= "at91sam9rl",
-	[AT91_SOC_SAM9X5]	= "at91sam9x5",
-	[AT91_SOC_SAM9N12]	= "at91sam9n12",
-	[AT91_SOC_SAMA5D3]	= "sama5d3",
-	[AT91_SOC_SAMA5D4]	= "sama5d4",
-	[AT91_SOC_UNKNOWN]	= "Unknown",
-};
-
-const char *at91_get_soc_type(struct at91_socinfo *c)
-{
-	return soc_name[c->type];
-}
-EXPORT_SYMBOL(at91_get_soc_type);
-
-static const char *soc_subtype_name[] = {
-	[AT91_SOC_RM9200_BGA]	= "at91rm9200 BGA",
-	[AT91_SOC_RM9200_PQFP]	= "at91rm9200 PQFP",
-	[AT91_SOC_SAM9XE]	= "at91sam9xe",
-	[AT91_SOC_SAM9G45ES]	= "at91sam9g45es",
-	[AT91_SOC_SAM9M10]	= "at91sam9m10",
-	[AT91_SOC_SAM9G46]	= "at91sam9g46",
-	[AT91_SOC_SAM9M11]	= "at91sam9m11",
-	[AT91_SOC_SAM9G15]	= "at91sam9g15",
-	[AT91_SOC_SAM9G35]	= "at91sam9g35",
-	[AT91_SOC_SAM9X35]	= "at91sam9x35",
-	[AT91_SOC_SAM9G25]	= "at91sam9g25",
-	[AT91_SOC_SAM9X25]	= "at91sam9x25",
-	[AT91_SOC_SAMA5D31]	= "sama5d31",
-	[AT91_SOC_SAMA5D33]	= "sama5d33",
-	[AT91_SOC_SAMA5D34]	= "sama5d34",
-	[AT91_SOC_SAMA5D35]	= "sama5d35",
-	[AT91_SOC_SAMA5D36]	= "sama5d36",
-	[AT91_SOC_SAMA5D41]	= "sama5d41",
-	[AT91_SOC_SAMA5D42]	= "sama5d42",
-	[AT91_SOC_SAMA5D43]	= "sama5d43",
-	[AT91_SOC_SAMA5D44]	= "sama5d44",
-	[AT91_SOC_SUBTYPE_NONE]	= "None",
-	[AT91_SOC_SUBTYPE_UNKNOWN] = "Unknown",
-};
-
-const char *at91_get_soc_subtype(struct at91_socinfo *c)
-{
-	return soc_subtype_name[c->subtype];
-}
-EXPORT_SYMBOL(at91_get_soc_subtype);
-
-void __init at91_map_io(void)
-{
-	/* Map peripherals */
-	iotable_init(&at91_io_desc, 1);
-
-	at91_soc_initdata.type = AT91_SOC_UNKNOWN;
-	at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_UNKNOWN;
-
-	soc_detect(AT91_BASE_DBGU0);
-	if (!at91_soc_is_detected())
-		soc_detect(AT91_BASE_DBGU1);
-
-	if (!at91_soc_is_detected())
-		panic(pr_fmt("Impossible to detect the SOC type"));
-
-	pr_info("Detected soc type: %s\n",
-		at91_get_soc_type(&at91_soc_initdata));
-	if (at91_soc_initdata.subtype != AT91_SOC_SUBTYPE_NONE)
-		pr_info("Detected soc subtype: %s\n",
-			at91_get_soc_subtype(&at91_soc_initdata));
-}
-
-void __init at91_alt_map_io(void)
-{
-	/* Map peripherals */
-	iotable_init(&at91_alt_io_desc, 1);
-
-	at91_soc_initdata.type = AT91_SOC_UNKNOWN;
-	at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_UNKNOWN;
-
-	alt_soc_detect(AT91_BASE_DBGU2);
-	if (!at91_soc_is_detected())
-		panic("AT91: Impossible to detect the SOC type");
-
-	pr_info("AT91: Detected soc type: %s\n",
-		at91_get_soc_type(&at91_soc_initdata));
-	if (at91_soc_initdata.subtype != AT91_SOC_SUBTYPE_NONE)
-		pr_info("AT91: Detected soc subtype: %s\n",
-			at91_get_soc_subtype(&at91_soc_initdata));
-}
-
 static struct of_device_id ramc_ids[] = {
 	{ .compatible = "atmel,at91rm9200-sdramc", .data = at91rm9200_standby },
 	{ .compatible = "atmel,at91sam9260-sdramc", .data = at91sam9_sdram_standby },
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 56+ messages in thread

* [PATCH 15/17] ARM: at91: remove old setup
@ 2015-01-15 21:58   ` Alexandre Belloni
  0 siblings, 0 replies; 56+ messages in thread
From: Alexandre Belloni @ 2015-01-15 21:58 UTC (permalink / raw)
  To: linux-arm-kernel

The old initialization is not used anymore, remove it.
Also remove now unused cpu.h and at91_dbgu.h

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
---
 arch/arm/mach-at91/generic.h                   |   4 -
 arch/arm/mach-at91/include/mach/at91_dbgu.h    |  63 ------
 arch/arm/mach-at91/include/mach/at91_ramc.h    |   6 -
 arch/arm/mach-at91/include/mach/at91sam9_smc.h |   2 -
 arch/arm/mach-at91/include/mach/cpu.h          | 240 --------------------
 arch/arm/mach-at91/pm.c                        |   5 +-
 arch/arm/mach-at91/setup.c                     | 301 -------------------------
 7 files changed, 4 insertions(+), 617 deletions(-)
 delete mode 100644 arch/arm/mach-at91/include/mach/at91_dbgu.h
 delete mode 100644 arch/arm/mach-at91/include/mach/cpu.h

diff --git a/arch/arm/mach-at91/generic.h b/arch/arm/mach-at91/generic.h
index 1e60faec2eba..881e73a27fab 100644
--- a/arch/arm/mach-at91/generic.h
+++ b/arch/arm/mach-at91/generic.h
@@ -14,10 +14,6 @@
 #include <linux/of.h>
 #include <linux/reboot.h>
 
- /* Map io */
-extern void __init at91_map_io(void);
-extern void __init at91_alt_map_io(void);
-
  /* Processors */
 extern void __init at91_dt_initialize(void);
 
diff --git a/arch/arm/mach-at91/include/mach/at91_dbgu.h b/arch/arm/mach-at91/include/mach/at91_dbgu.h
deleted file mode 100644
index 42925e8f78e4..000000000000
--- a/arch/arm/mach-at91/include/mach/at91_dbgu.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * arch/arm/mach-at91/include/mach/at91_dbgu.h
- *
- * Copyright (C) 2005 Ivan Kokshaysky
- * Copyright (C) SAN People
- *
- * Debug Unit (DBGU) - System peripherals registers.
- * Based on AT91RM9200 datasheet revision E.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- */
-
-#ifndef AT91_DBGU_H
-#define AT91_DBGU_H
-
-#define AT91_DBGU_CR		(0x00)	/* Control Register */
-#define AT91_DBGU_MR		(0x04)	/* Mode Register */
-#define AT91_DBGU_IER		(0x08)	/* Interrupt Enable Register */
-#define		AT91_DBGU_TXRDY		(1 << 1)		/* Transmitter Ready */
-#define		AT91_DBGU_TXEMPTY	(1 << 9)		/* Transmitter Empty */
-#define AT91_DBGU_IDR		(0x0c)	/* Interrupt Disable Register */
-#define AT91_DBGU_IMR		(0x10)	/* Interrupt Mask Register */
-#define AT91_DBGU_SR		(0x14)	/* Status Register */
-#define AT91_DBGU_RHR		(0x18)	/* Receiver Holding Register */
-#define AT91_DBGU_THR		(0x1c)	/* Transmitter Holding Register */
-#define AT91_DBGU_BRGR		(0x20)	/* Baud Rate Generator Register */
-
-#define AT91_DBGU_CIDR		(0x40)	/* Chip ID Register */
-#define AT91_DBGU_EXID		(0x44)	/* Chip ID Extension Register */
-#define AT91_DBGU_FNR		(0x48)	/* Force NTRST Register [SAM9 only] */
-#define		AT91_DBGU_FNTRST	(1 << 0)		/* Force NTRST */
-
-/*
- * Some AT91 parts that don't have full DEBUG units still support the ID
- * and extensions register.
- */
-#define		AT91_CIDR_VERSION	(0x1f << 0)		/* Version of the Device */
-#define		AT91_CIDR_EPROC		(7    << 5)		/* Embedded Processor */
-#define		AT91_CIDR_NVPSIZ	(0xf  << 8)		/* Nonvolatile Program Memory Size */
-#define		AT91_CIDR_NVPSIZ2	(0xf  << 12)		/* Second Nonvolatile Program Memory Size */
-#define		AT91_CIDR_SRAMSIZ	(0xf  << 16)		/* Internal SRAM Size */
-#define			AT91_CIDR_SRAMSIZ_1K	(1 << 16)
-#define			AT91_CIDR_SRAMSIZ_2K	(2 << 16)
-#define			AT91_CIDR_SRAMSIZ_112K	(4 << 16)
-#define			AT91_CIDR_SRAMSIZ_4K	(5 << 16)
-#define			AT91_CIDR_SRAMSIZ_80K	(6 << 16)
-#define			AT91_CIDR_SRAMSIZ_160K	(7 << 16)
-#define			AT91_CIDR_SRAMSIZ_8K	(8 << 16)
-#define			AT91_CIDR_SRAMSIZ_16K	(9 << 16)
-#define			AT91_CIDR_SRAMSIZ_32K	(10 << 16)
-#define			AT91_CIDR_SRAMSIZ_64K	(11 << 16)
-#define			AT91_CIDR_SRAMSIZ_128K	(12 << 16)
-#define			AT91_CIDR_SRAMSIZ_256K	(13 << 16)
-#define			AT91_CIDR_SRAMSIZ_96K	(14 << 16)
-#define			AT91_CIDR_SRAMSIZ_512K	(15 << 16)
-#define		AT91_CIDR_ARCH		(0xff << 20)		/* Architecture Identifier */
-#define		AT91_CIDR_NVPTYP	(7    << 28)		/* Nonvolatile Program Memory Type */
-#define		AT91_CIDR_EXT		(1    << 31)		/* Extension Flag */
-
-#endif
diff --git a/arch/arm/mach-at91/include/mach/at91_ramc.h b/arch/arm/mach-at91/include/mach/at91_ramc.h
index e4492b151fee..80431ece8a54 100644
--- a/arch/arm/mach-at91/include/mach/at91_ramc.h
+++ b/arch/arm/mach-at91/include/mach/at91_ramc.h
@@ -9,17 +9,11 @@
 #ifndef __AT91_RAMC_H__
 #define __AT91_RAMC_H__
 
-#ifndef __ASSEMBLY__
-extern void __iomem *at91_ramc_base[];
-
 #define at91_ramc_read(id, field) \
 	__raw_readl(at91_ramc_base[id] + field)
 
 #define at91_ramc_write(id, field, value) \
 	__raw_writel(value, at91_ramc_base[id] + field)
-#else
-.extern at91_ramc_base
-#endif
 
 #define AT91_MEMCTRL_MC		0
 #define AT91_MEMCTRL_SDRAMC	1
diff --git a/arch/arm/mach-at91/include/mach/at91sam9_smc.h b/arch/arm/mach-at91/include/mach/at91sam9_smc.h
index 175e1fdd9fe8..ff54a0ce90e3 100644
--- a/arch/arm/mach-at91/include/mach/at91sam9_smc.h
+++ b/arch/arm/mach-at91/include/mach/at91sam9_smc.h
@@ -16,8 +16,6 @@
 #ifndef AT91SAM9_SMC_H
 #define AT91SAM9_SMC_H
 
-#include <mach/cpu.h>
-
 #ifndef __ASSEMBLY__
 struct sam9_smc_config {
 	/* Setup register */
diff --git a/arch/arm/mach-at91/include/mach/cpu.h b/arch/arm/mach-at91/include/mach/cpu.h
deleted file mode 100644
index 61914fb35f5d..000000000000
--- a/arch/arm/mach-at91/include/mach/cpu.h
+++ /dev/null
@@ -1,240 +0,0 @@
-/*
- * arch/arm/mach-at91/include/mach/cpu.h
- *
- * Copyright (C) 2006 SAN People
- * Copyright (C) 2011 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- */
-
-#ifndef __MACH_CPU_H__
-#define __MACH_CPU_H__
-
-#define ARCH_ID_AT91RM9200	0x09290780
-#define ARCH_ID_AT91SAM9260	0x019803a0
-#define ARCH_ID_AT91SAM9261	0x019703a0
-#define ARCH_ID_AT91SAM9263	0x019607a0
-#define ARCH_ID_AT91SAM9G10	0x019903a0
-#define ARCH_ID_AT91SAM9G20	0x019905a0
-#define ARCH_ID_AT91SAM9RL64	0x019b03a0
-#define ARCH_ID_AT91SAM9G45	0x819b05a0
-#define ARCH_ID_AT91SAM9G45MRL	0x819b05a2	/* aka 9G45-ES2 & non ES lots */
-#define ARCH_ID_AT91SAM9G45ES	0x819b05a1	/* 9G45-ES (Engineering Sample) */
-#define ARCH_ID_AT91SAM9X5	0x819a05a0
-#define ARCH_ID_AT91SAM9N12	0x819a07a0
-
-#define ARCH_ID_AT91SAM9XE128	0x329973a0
-#define ARCH_ID_AT91SAM9XE256	0x329a93a0
-#define ARCH_ID_AT91SAM9XE512	0x329aa3a0
-
-#define ARCH_ID_AT91M40800	0x14080044
-#define ARCH_ID_AT91R40807	0x44080746
-#define ARCH_ID_AT91M40807	0x14080745
-#define ARCH_ID_AT91R40008	0x44000840
-
-#define ARCH_ID_SAMA5		0x8A5C07C0
-
-#define ARCH_EXID_AT91SAM9M11	0x00000001
-#define ARCH_EXID_AT91SAM9M10	0x00000002
-#define ARCH_EXID_AT91SAM9G46	0x00000003
-#define ARCH_EXID_AT91SAM9G45	0x00000004
-
-#define ARCH_EXID_AT91SAM9G15	0x00000000
-#define ARCH_EXID_AT91SAM9G35	0x00000001
-#define ARCH_EXID_AT91SAM9X35	0x00000002
-#define ARCH_EXID_AT91SAM9G25	0x00000003
-#define ARCH_EXID_AT91SAM9X25	0x00000004
-
-#define ARCH_EXID_SAMA5D3	0x00004300
-#define ARCH_EXID_SAMA5D31	0x00444300
-#define ARCH_EXID_SAMA5D33	0x00414300
-#define ARCH_EXID_SAMA5D34	0x00414301
-#define ARCH_EXID_SAMA5D35	0x00584300
-#define ARCH_EXID_SAMA5D36	0x00004301
-
-#define ARCH_EXID_SAMA5D4	0x00000007
-#define ARCH_EXID_SAMA5D41	0x00000001
-#define ARCH_EXID_SAMA5D42	0x00000002
-#define ARCH_EXID_SAMA5D43	0x00000003
-#define ARCH_EXID_SAMA5D44	0x00000004
-
-#define ARCH_FAMILY_AT91SAM9	0x01900000
-#define ARCH_FAMILY_AT91SAM9XE	0x02900000
-
-/* RM9200 type */
-#define ARCH_REVISON_9200_BGA	(0 << 0)
-#define ARCH_REVISON_9200_PQFP	(1 << 0)
-
-#ifndef __ASSEMBLY__
-enum at91_soc_type {
-	/* 920T */
-	AT91_SOC_RM9200,
-
-	/* SAM92xx */
-	AT91_SOC_SAM9260, AT91_SOC_SAM9261, AT91_SOC_SAM9263,
-
-	/* SAM9Gxx */
-	AT91_SOC_SAM9G10, AT91_SOC_SAM9G20, AT91_SOC_SAM9G45,
-
-	/* SAM9RL */
-	AT91_SOC_SAM9RL,
-
-	/* SAM9X5 */
-	AT91_SOC_SAM9X5,
-
-	/* SAM9N12 */
-	AT91_SOC_SAM9N12,
-
-	/* SAMA5D3 */
-	AT91_SOC_SAMA5D3,
-
-	/* SAMA5D4 */
-	AT91_SOC_SAMA5D4,
-
-	/* Unknown type */
-	AT91_SOC_UNKNOWN,
-};
-
-enum at91_soc_subtype {
-	/* RM9200 */
-	AT91_SOC_RM9200_BGA, AT91_SOC_RM9200_PQFP,
-
-	/* SAM9260 */
-	AT91_SOC_SAM9XE,
-
-	/* SAM9G45 */
-	AT91_SOC_SAM9G45ES, AT91_SOC_SAM9M10, AT91_SOC_SAM9G46, AT91_SOC_SAM9M11,
-
-	/* SAM9X5 */
-	AT91_SOC_SAM9G15, AT91_SOC_SAM9G35, AT91_SOC_SAM9X35,
-	AT91_SOC_SAM9G25, AT91_SOC_SAM9X25,
-
-	/* SAMA5D3 */
-	AT91_SOC_SAMA5D31, AT91_SOC_SAMA5D33, AT91_SOC_SAMA5D34,
-	AT91_SOC_SAMA5D35, AT91_SOC_SAMA5D36,
-
-	/* SAMA5D4 */
-	AT91_SOC_SAMA5D41, AT91_SOC_SAMA5D42, AT91_SOC_SAMA5D43,
-	AT91_SOC_SAMA5D44,
-
-	/* No subtype for this SoC */
-	AT91_SOC_SUBTYPE_NONE,
-
-	/* Unknown subtype */
-	AT91_SOC_SUBTYPE_UNKNOWN,
-};
-
-struct at91_socinfo {
-	unsigned int type, subtype;
-	unsigned int cidr, exid;
-};
-
-extern struct at91_socinfo at91_soc_initdata;
-const char *at91_get_soc_type(struct at91_socinfo *c);
-const char *at91_get_soc_subtype(struct at91_socinfo *c);
-
-static inline int at91_soc_is_detected(void)
-{
-	return at91_soc_initdata.type != AT91_SOC_UNKNOWN;
-}
-
-#ifdef CONFIG_SOC_AT91RM9200
-#define cpu_is_at91rm9200()	(at91_soc_initdata.type == AT91_SOC_RM9200)
-#define cpu_is_at91rm9200_bga()	(at91_soc_initdata.subtype == AT91_SOC_RM9200_BGA)
-#define cpu_is_at91rm9200_pqfp() (at91_soc_initdata.subtype == AT91_SOC_RM9200_PQFP)
-#else
-#define cpu_is_at91rm9200()	(0)
-#define cpu_is_at91rm9200_bga()	(0)
-#define cpu_is_at91rm9200_pqfp() (0)
-#endif
-
-#ifdef CONFIG_SOC_AT91SAM9260
-#define cpu_is_at91sam9xe()	(at91_soc_initdata.subtype == AT91_SOC_SAM9XE)
-#define cpu_is_at91sam9260()	(at91_soc_initdata.type == AT91_SOC_SAM9260)
-#define cpu_is_at91sam9g20()	(at91_soc_initdata.type == AT91_SOC_SAM9G20)
-#else
-#define cpu_is_at91sam9xe()	(0)
-#define cpu_is_at91sam9260()	(0)
-#define cpu_is_at91sam9g20()	(0)
-#endif
-
-#ifdef CONFIG_SOC_AT91SAM9261
-#define cpu_is_at91sam9261()	(at91_soc_initdata.type == AT91_SOC_SAM9261)
-#define cpu_is_at91sam9g10()	(at91_soc_initdata.type == AT91_SOC_SAM9G10)
-#else
-#define cpu_is_at91sam9261()	(0)
-#define cpu_is_at91sam9g10()	(0)
-#endif
-
-#ifdef CONFIG_SOC_AT91SAM9263
-#define cpu_is_at91sam9263()	(at91_soc_initdata.type == AT91_SOC_SAM9263)
-#else
-#define cpu_is_at91sam9263()	(0)
-#endif
-
-#ifdef CONFIG_SOC_AT91SAM9RL
-#define cpu_is_at91sam9rl()	(at91_soc_initdata.type == AT91_SOC_SAM9RL)
-#else
-#define cpu_is_at91sam9rl()	(0)
-#endif
-
-#ifdef CONFIG_SOC_AT91SAM9G45
-#define cpu_is_at91sam9g45()	(at91_soc_initdata.type == AT91_SOC_SAM9G45)
-#define cpu_is_at91sam9g45es()	(at91_soc_initdata.subtype == AT91_SOC_SAM9G45ES)
-#define cpu_is_at91sam9m10()	(at91_soc_initdata.subtype == AT91_SOC_SAM9M10)
-#define cpu_is_at91sam9g46()	(at91_soc_initdata.subtype == AT91_SOC_SAM9G46)
-#define cpu_is_at91sam9m11()	(at91_soc_initdata.subtype == AT91_SOC_SAM9M11)
-#else
-#define cpu_is_at91sam9g45()	(0)
-#define cpu_is_at91sam9g45es()	(0)
-#define cpu_is_at91sam9m10()	(0)
-#define cpu_is_at91sam9g46()	(0)
-#define cpu_is_at91sam9m11()	(0)
-#endif
-
-#ifdef CONFIG_SOC_AT91SAM9X5
-#define cpu_is_at91sam9x5()	(at91_soc_initdata.type == AT91_SOC_SAM9X5)
-#define cpu_is_at91sam9g15()	(at91_soc_initdata.subtype == AT91_SOC_SAM9G15)
-#define cpu_is_at91sam9g35()	(at91_soc_initdata.subtype == AT91_SOC_SAM9G35)
-#define cpu_is_at91sam9x35()	(at91_soc_initdata.subtype == AT91_SOC_SAM9X35)
-#define cpu_is_at91sam9g25()	(at91_soc_initdata.subtype == AT91_SOC_SAM9G25)
-#define cpu_is_at91sam9x25()	(at91_soc_initdata.subtype == AT91_SOC_SAM9X25)
-#else
-#define cpu_is_at91sam9x5()	(0)
-#define cpu_is_at91sam9g15()	(0)
-#define cpu_is_at91sam9g35()	(0)
-#define cpu_is_at91sam9x35()	(0)
-#define cpu_is_at91sam9g25()	(0)
-#define cpu_is_at91sam9x25()	(0)
-#endif
-
-#ifdef CONFIG_SOC_AT91SAM9N12
-#define cpu_is_at91sam9n12()	(at91_soc_initdata.type == AT91_SOC_SAM9N12)
-#else
-#define cpu_is_at91sam9n12()	(0)
-#endif
-
-#ifdef CONFIG_SOC_SAMA5D3
-#define cpu_is_sama5d3()	(at91_soc_initdata.type == AT91_SOC_SAMA5D3)
-#else
-#define cpu_is_sama5d3()	(0)
-#endif
-
-#ifdef CONFIG_SOC_SAMA5D4
-#define cpu_is_sama5d4()	(at91_soc_initdata.type == AT91_SOC_SAMA5D4)
-#else
-#define cpu_is_sama5d4()	(0)
-#endif
-
-/*
- * Since this is ARM, we will never run on any AVR32 CPU. But these
- * definitions may reduce clutter in common drivers.
- */
-#define cpu_is_at32ap7000()	(0)
-#endif /* __ASSEMBLY__ */
-
-#endif /* __MACH_CPU_H__ */
diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c
index 778f11132b31..11bf992838af 100644
--- a/arch/arm/mach-at91/pm.c
+++ b/arch/arm/mach-at91/pm.c
@@ -19,6 +19,7 @@
 #include <linux/sysfs.h>
 #include <linux/module.h>
 #include <linux/of.h>
+#include <linux/of_address.h>
 #include <linux/of_platform.h>
 #include <linux/platform_device.h>
 #include <linux/io.h>
@@ -29,10 +30,12 @@
 #include <asm/mach/time.h>
 #include <asm/mach/irq.h>
 
-#include <mach/cpu.h>
 #include <mach/hardware.h>
 
 #include "generic.h"
+
+static void __iomem *at91_ramc_base[2];
+
 #include "pm.h"
 
 static struct {
diff --git a/arch/arm/mach-at91/setup.c b/arch/arm/mach-at91/setup.c
index 42ebe8d41433..4036e3e0ff96 100644
--- a/arch/arm/mach-at91/setup.c
+++ b/arch/arm/mach-at91/setup.c
@@ -7,321 +7,20 @@
 
 #define pr_fmt(fmt)	"AT91: " fmt
 
-#include <linux/module.h>
 #include <linux/io.h>
-#include <linux/mm.h>
 #include <linux/pm.h>
 #include <linux/of_address.h>
-#include <linux/pinctrl/machine.h>
-#include <linux/clk/at91_pmc.h>
 
 #include <asm/system_misc.h>
-#include <asm/mach/map.h>
 
 #include <mach/hardware.h>
-#include <mach/cpu.h>
-#include <mach/at91_dbgu.h>
 
 #include "generic.h"
 #include "pm.h"
 
-struct at91_socinfo at91_soc_initdata;
-EXPORT_SYMBOL(at91_soc_initdata);
-
 void __iomem *at91_ramc_base[2];
 EXPORT_SYMBOL_GPL(at91_ramc_base);
 
-static struct map_desc at91_io_desc __initdata __maybe_unused = {
-	.virtual	= (unsigned long)AT91_VA_BASE_SYS,
-	.pfn		= __phys_to_pfn(AT91_BASE_SYS),
-	.length		= SZ_16K,
-	.type		= MT_DEVICE,
-};
-
-static struct map_desc at91_alt_io_desc __initdata __maybe_unused = {
-	.virtual	= (unsigned long)AT91_ALT_VA_BASE_SYS,
-	.pfn		= __phys_to_pfn(AT91_ALT_BASE_SYS),
-	.length		= 24 * SZ_1K,
-	.type		= MT_DEVICE,
-};
-
-static void __init soc_detect(u32 dbgu_base)
-{
-	u32 cidr, socid;
-
-	cidr = __raw_readl(AT91_IO_P2V(dbgu_base) + AT91_DBGU_CIDR);
-	socid = cidr & ~AT91_CIDR_VERSION;
-
-	switch (socid) {
-	case ARCH_ID_AT91RM9200:
-		at91_soc_initdata.type = AT91_SOC_RM9200;
-		if (at91_soc_initdata.subtype == AT91_SOC_SUBTYPE_UNKNOWN)
-			at91_soc_initdata.subtype = AT91_SOC_RM9200_BGA;
-		break;
-
-	case ARCH_ID_AT91SAM9260:
-		at91_soc_initdata.type = AT91_SOC_SAM9260;
-		at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE;
-		break;
-
-	case ARCH_ID_AT91SAM9261:
-		at91_soc_initdata.type = AT91_SOC_SAM9261;
-		at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE;
-		break;
-
-	case ARCH_ID_AT91SAM9263:
-		at91_soc_initdata.type = AT91_SOC_SAM9263;
-		at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE;
-		break;
-
-	case ARCH_ID_AT91SAM9G20:
-		at91_soc_initdata.type = AT91_SOC_SAM9G20;
-		at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE;
-		break;
-
-	case ARCH_ID_AT91SAM9G45:
-		at91_soc_initdata.type = AT91_SOC_SAM9G45;
-		if (cidr == ARCH_ID_AT91SAM9G45ES)
-			at91_soc_initdata.subtype = AT91_SOC_SAM9G45ES;
-		break;
-
-	case ARCH_ID_AT91SAM9RL64:
-		at91_soc_initdata.type = AT91_SOC_SAM9RL;
-		at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE;
-		break;
-
-	case ARCH_ID_AT91SAM9X5:
-		at91_soc_initdata.type = AT91_SOC_SAM9X5;
-		break;
-
-	case ARCH_ID_AT91SAM9N12:
-		at91_soc_initdata.type = AT91_SOC_SAM9N12;
-		break;
-
-	case ARCH_ID_SAMA5:
-		at91_soc_initdata.exid = __raw_readl(AT91_IO_P2V(dbgu_base) + AT91_DBGU_EXID);
-		if (at91_soc_initdata.exid & ARCH_EXID_SAMA5D3) {
-			at91_soc_initdata.type = AT91_SOC_SAMA5D3;
-		}
-		break;
-	}
-
-	/* at91sam9g10 */
-	if ((socid & ~AT91_CIDR_EXT) == ARCH_ID_AT91SAM9G10) {
-		at91_soc_initdata.type = AT91_SOC_SAM9G10;
-		at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE;
-	}
-	/* at91sam9xe */
-	else if ((cidr & AT91_CIDR_ARCH) == ARCH_FAMILY_AT91SAM9XE) {
-		at91_soc_initdata.type = AT91_SOC_SAM9260;
-		at91_soc_initdata.subtype = AT91_SOC_SAM9XE;
-	}
-
-	if (!at91_soc_is_detected())
-		return;
-
-	at91_soc_initdata.cidr = cidr;
-
-	/* sub version of soc */
-	if (!at91_soc_initdata.exid)
-		at91_soc_initdata.exid = __raw_readl(AT91_IO_P2V(dbgu_base) + AT91_DBGU_EXID);
-
-	if (at91_soc_initdata.type == AT91_SOC_SAM9G45) {
-		switch (at91_soc_initdata.exid) {
-		case ARCH_EXID_AT91SAM9M10:
-			at91_soc_initdata.subtype = AT91_SOC_SAM9M10;
-			break;
-		case ARCH_EXID_AT91SAM9G46:
-			at91_soc_initdata.subtype = AT91_SOC_SAM9G46;
-			break;
-		case ARCH_EXID_AT91SAM9M11:
-			at91_soc_initdata.subtype = AT91_SOC_SAM9M11;
-			break;
-		}
-	}
-
-	if (at91_soc_initdata.type == AT91_SOC_SAM9X5) {
-		switch (at91_soc_initdata.exid) {
-		case ARCH_EXID_AT91SAM9G15:
-			at91_soc_initdata.subtype = AT91_SOC_SAM9G15;
-			break;
-		case ARCH_EXID_AT91SAM9G35:
-			at91_soc_initdata.subtype = AT91_SOC_SAM9G35;
-			break;
-		case ARCH_EXID_AT91SAM9X35:
-			at91_soc_initdata.subtype = AT91_SOC_SAM9X35;
-			break;
-		case ARCH_EXID_AT91SAM9G25:
-			at91_soc_initdata.subtype = AT91_SOC_SAM9G25;
-			break;
-		case ARCH_EXID_AT91SAM9X25:
-			at91_soc_initdata.subtype = AT91_SOC_SAM9X25;
-			break;
-		}
-	}
-
-	if (at91_soc_initdata.type == AT91_SOC_SAMA5D3) {
-		switch (at91_soc_initdata.exid) {
-		case ARCH_EXID_SAMA5D31:
-			at91_soc_initdata.subtype = AT91_SOC_SAMA5D31;
-			break;
-		case ARCH_EXID_SAMA5D33:
-			at91_soc_initdata.subtype = AT91_SOC_SAMA5D33;
-			break;
-		case ARCH_EXID_SAMA5D34:
-			at91_soc_initdata.subtype = AT91_SOC_SAMA5D34;
-			break;
-		case ARCH_EXID_SAMA5D35:
-			at91_soc_initdata.subtype = AT91_SOC_SAMA5D35;
-			break;
-		case ARCH_EXID_SAMA5D36:
-			at91_soc_initdata.subtype = AT91_SOC_SAMA5D36;
-			break;
-		}
-	}
-}
-
-static void __init alt_soc_detect(u32 dbgu_base)
-{
-	u32 cidr, socid;
-
-	/* SoC ID */
-	cidr = __raw_readl(AT91_ALT_IO_P2V(dbgu_base) + AT91_DBGU_CIDR);
-	socid = cidr & ~AT91_CIDR_VERSION;
-
-	switch (socid) {
-	case ARCH_ID_SAMA5:
-		at91_soc_initdata.exid = __raw_readl(AT91_ALT_IO_P2V(dbgu_base) + AT91_DBGU_EXID);
-		if (at91_soc_initdata.exid & ARCH_EXID_SAMA5D3) {
-			at91_soc_initdata.type = AT91_SOC_SAMA5D3;
-		} else if (at91_soc_initdata.exid & ARCH_EXID_SAMA5D4) {
-			at91_soc_initdata.type = AT91_SOC_SAMA5D4;
-		}
-		break;
-	}
-
-	if (!at91_soc_is_detected())
-		return;
-
-	at91_soc_initdata.cidr = cidr;
-
-	/* sub version of soc */
-	if (!at91_soc_initdata.exid)
-		at91_soc_initdata.exid = __raw_readl(AT91_ALT_IO_P2V(dbgu_base) + AT91_DBGU_EXID);
-
-	if (at91_soc_initdata.type == AT91_SOC_SAMA5D4) {
-		switch (at91_soc_initdata.exid) {
-		case ARCH_EXID_SAMA5D41:
-			at91_soc_initdata.subtype = AT91_SOC_SAMA5D41;
-			break;
-		case ARCH_EXID_SAMA5D42:
-			at91_soc_initdata.subtype = AT91_SOC_SAMA5D42;
-			break;
-		case ARCH_EXID_SAMA5D43:
-			at91_soc_initdata.subtype = AT91_SOC_SAMA5D43;
-			break;
-		case ARCH_EXID_SAMA5D44:
-			at91_soc_initdata.subtype = AT91_SOC_SAMA5D44;
-			break;
-		}
-	}
-}
-
-static const char *soc_name[] = {
-	[AT91_SOC_RM9200]	= "at91rm9200",
-	[AT91_SOC_SAM9260]	= "at91sam9260",
-	[AT91_SOC_SAM9261]	= "at91sam9261",
-	[AT91_SOC_SAM9263]	= "at91sam9263",
-	[AT91_SOC_SAM9G10]	= "at91sam9g10",
-	[AT91_SOC_SAM9G20]	= "at91sam9g20",
-	[AT91_SOC_SAM9G45]	= "at91sam9g45",
-	[AT91_SOC_SAM9RL]	= "at91sam9rl",
-	[AT91_SOC_SAM9X5]	= "at91sam9x5",
-	[AT91_SOC_SAM9N12]	= "at91sam9n12",
-	[AT91_SOC_SAMA5D3]	= "sama5d3",
-	[AT91_SOC_SAMA5D4]	= "sama5d4",
-	[AT91_SOC_UNKNOWN]	= "Unknown",
-};
-
-const char *at91_get_soc_type(struct at91_socinfo *c)
-{
-	return soc_name[c->type];
-}
-EXPORT_SYMBOL(at91_get_soc_type);
-
-static const char *soc_subtype_name[] = {
-	[AT91_SOC_RM9200_BGA]	= "at91rm9200 BGA",
-	[AT91_SOC_RM9200_PQFP]	= "at91rm9200 PQFP",
-	[AT91_SOC_SAM9XE]	= "at91sam9xe",
-	[AT91_SOC_SAM9G45ES]	= "at91sam9g45es",
-	[AT91_SOC_SAM9M10]	= "at91sam9m10",
-	[AT91_SOC_SAM9G46]	= "at91sam9g46",
-	[AT91_SOC_SAM9M11]	= "at91sam9m11",
-	[AT91_SOC_SAM9G15]	= "at91sam9g15",
-	[AT91_SOC_SAM9G35]	= "at91sam9g35",
-	[AT91_SOC_SAM9X35]	= "at91sam9x35",
-	[AT91_SOC_SAM9G25]	= "at91sam9g25",
-	[AT91_SOC_SAM9X25]	= "at91sam9x25",
-	[AT91_SOC_SAMA5D31]	= "sama5d31",
-	[AT91_SOC_SAMA5D33]	= "sama5d33",
-	[AT91_SOC_SAMA5D34]	= "sama5d34",
-	[AT91_SOC_SAMA5D35]	= "sama5d35",
-	[AT91_SOC_SAMA5D36]	= "sama5d36",
-	[AT91_SOC_SAMA5D41]	= "sama5d41",
-	[AT91_SOC_SAMA5D42]	= "sama5d42",
-	[AT91_SOC_SAMA5D43]	= "sama5d43",
-	[AT91_SOC_SAMA5D44]	= "sama5d44",
-	[AT91_SOC_SUBTYPE_NONE]	= "None",
-	[AT91_SOC_SUBTYPE_UNKNOWN] = "Unknown",
-};
-
-const char *at91_get_soc_subtype(struct at91_socinfo *c)
-{
-	return soc_subtype_name[c->subtype];
-}
-EXPORT_SYMBOL(at91_get_soc_subtype);
-
-void __init at91_map_io(void)
-{
-	/* Map peripherals */
-	iotable_init(&at91_io_desc, 1);
-
-	at91_soc_initdata.type = AT91_SOC_UNKNOWN;
-	at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_UNKNOWN;
-
-	soc_detect(AT91_BASE_DBGU0);
-	if (!at91_soc_is_detected())
-		soc_detect(AT91_BASE_DBGU1);
-
-	if (!at91_soc_is_detected())
-		panic(pr_fmt("Impossible to detect the SOC type"));
-
-	pr_info("Detected soc type: %s\n",
-		at91_get_soc_type(&at91_soc_initdata));
-	if (at91_soc_initdata.subtype != AT91_SOC_SUBTYPE_NONE)
-		pr_info("Detected soc subtype: %s\n",
-			at91_get_soc_subtype(&at91_soc_initdata));
-}
-
-void __init at91_alt_map_io(void)
-{
-	/* Map peripherals */
-	iotable_init(&at91_alt_io_desc, 1);
-
-	at91_soc_initdata.type = AT91_SOC_UNKNOWN;
-	at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_UNKNOWN;
-
-	alt_soc_detect(AT91_BASE_DBGU2);
-	if (!at91_soc_is_detected())
-		panic("AT91: Impossible to detect the SOC type");
-
-	pr_info("AT91: Detected soc type: %s\n",
-		at91_get_soc_type(&at91_soc_initdata));
-	if (at91_soc_initdata.subtype != AT91_SOC_SUBTYPE_NONE)
-		pr_info("AT91: Detected soc subtype: %s\n",
-			at91_get_soc_subtype(&at91_soc_initdata));
-}
-
 static struct of_device_id ramc_ids[] = {
 	{ .compatible = "atmel,at91rm9200-sdramc", .data = at91rm9200_standby },
 	{ .compatible = "atmel,at91sam9260-sdramc", .data = at91sam9_sdram_standby },
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 56+ messages in thread

* [PATCH 16/17] ARM: at91: mark const init data with __initconst instead of __initdata
  2015-01-15 21:58 ` Alexandre Belloni
@ 2015-01-15 21:58   ` Alexandre Belloni
  -1 siblings, 0 replies; 56+ messages in thread
From: Alexandre Belloni @ 2015-01-15 21:58 UTC (permalink / raw)
  To: Nicolas Ferre
  Cc: Jean-Christophe Plagniol-Villard, Arnd Bergmann, Boris Brezillon,
	Bo Shen, Wenyou Yang, linux-arm-kernel, linux-kernel,
	Alexandre Belloni

As long as there is no other non-const variable marked __initdata in the
same compilation unit it doesn't hurt. If there were one however
compilation would fail with

	error: $variablename causes a section type conflict

because a section containing const variables is marked read only and so
cannot contain non-const variables.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
---
 arch/arm/mach-at91/at91rm9200.c | 2 +-
 arch/arm/mach-at91/at91sam9.c   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-at91/at91rm9200.c b/arch/arm/mach-at91/at91rm9200.c
index 6992cc9ce902..a1d1e63fb405 100644
--- a/arch/arm/mach-at91/at91rm9200.c
+++ b/arch/arm/mach-at91/at91rm9200.c
@@ -46,7 +46,7 @@ static void __init rm9200_dt_device_init(void)
 	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 }
 
-static const char *at91rm9200_dt_board_compat[] __initdata = {
+static const char *at91rm9200_dt_board_compat[] __initconst = {
 	"atmel,at91rm9200",
 	NULL
 };
diff --git a/arch/arm/mach-at91/at91sam9.c b/arch/arm/mach-at91/at91sam9.c
index 8b890644d6f0..0aeabcf4ddb8 100644
--- a/arch/arm/mach-at91/at91sam9.c
+++ b/arch/arm/mach-at91/at91sam9.c
@@ -24,7 +24,7 @@ static void __init sam9_dt_device_init(void)
 	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 }
 
-static const char *at91_dt_board_compat[] __initdata = {
+static const char *at91_dt_board_compat[] __initconst = {
 	"atmel,at91sam9",
 	NULL
 };
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 56+ messages in thread

* [PATCH 16/17] ARM: at91: mark const init data with __initconst instead of __initdata
@ 2015-01-15 21:58   ` Alexandre Belloni
  0 siblings, 0 replies; 56+ messages in thread
From: Alexandre Belloni @ 2015-01-15 21:58 UTC (permalink / raw)
  To: linux-arm-kernel

As long as there is no other non-const variable marked __initdata in the
same compilation unit it doesn't hurt. If there were one however
compilation would fail with

	error: $variablename causes a section type conflict

because a section containing const variables is marked read only and so
cannot contain non-const variables.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
---
 arch/arm/mach-at91/at91rm9200.c | 2 +-
 arch/arm/mach-at91/at91sam9.c   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-at91/at91rm9200.c b/arch/arm/mach-at91/at91rm9200.c
index 6992cc9ce902..a1d1e63fb405 100644
--- a/arch/arm/mach-at91/at91rm9200.c
+++ b/arch/arm/mach-at91/at91rm9200.c
@@ -46,7 +46,7 @@ static void __init rm9200_dt_device_init(void)
 	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 }
 
-static const char *at91rm9200_dt_board_compat[] __initdata = {
+static const char *at91rm9200_dt_board_compat[] __initconst = {
 	"atmel,at91rm9200",
 	NULL
 };
diff --git a/arch/arm/mach-at91/at91sam9.c b/arch/arm/mach-at91/at91sam9.c
index 8b890644d6f0..0aeabcf4ddb8 100644
--- a/arch/arm/mach-at91/at91sam9.c
+++ b/arch/arm/mach-at91/at91sam9.c
@@ -24,7 +24,7 @@ static void __init sam9_dt_device_init(void)
 	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 }
 
-static const char *at91_dt_board_compat[] __initdata = {
+static const char *at91_dt_board_compat[] __initconst = {
 	"atmel,at91sam9",
 	NULL
 };
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 56+ messages in thread

* [PATCH 17/17] ARM: at91: remove at91_dt_initialize
  2015-01-15 21:58 ` Alexandre Belloni
@ 2015-01-15 21:58   ` Alexandre Belloni
  -1 siblings, 0 replies; 56+ messages in thread
From: Alexandre Belloni @ 2015-01-15 21:58 UTC (permalink / raw)
  To: Nicolas Ferre
  Cc: Jean-Christophe Plagniol-Villard, Arnd Bergmann, Boris Brezillon,
	Bo Shen, Wenyou Yang, linux-arm-kernel, linux-kernel,
	Alexandre Belloni

Move the ramc initialization to pm.c as it is the only user left. This allows to
get rid of at91_dt_initialize() and setup.c

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
---
 arch/arm/mach-at91/Makefile     |  2 --
 arch/arm/mach-at91/at91rm9200.c |  1 -
 arch/arm/mach-at91/at91sam9.c   |  2 --
 arch/arm/mach-at91/generic.h    |  3 --
 arch/arm/mach-at91/pm.c         | 43 ++++++++++++++++++++++++++-
 arch/arm/mach-at91/sama5d3.c    |  1 -
 arch/arm/mach-at91/sama5d4.c    |  1 -
 arch/arm/mach-at91/setup.c      | 64 -----------------------------------------
 8 files changed, 42 insertions(+), 75 deletions(-)
 delete mode 100644 arch/arm/mach-at91/setup.c

diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile
index 27b503defe80..be26bb8c9a9a 100644
--- a/arch/arm/mach-at91/Makefile
+++ b/arch/arm/mach-at91/Makefile
@@ -2,8 +2,6 @@
 # Makefile for the linux kernel.
 #
 
-obj-y		:= setup.o
-
 obj-$(CONFIG_SOC_AT91SAM9)	+= sam9_smc.o
 
 # CPU-specific support
diff --git a/arch/arm/mach-at91/at91rm9200.c b/arch/arm/mach-at91/at91rm9200.c
index a1d1e63fb405..4ab2e2bbdee2 100644
--- a/arch/arm/mach-at91/at91rm9200.c
+++ b/arch/arm/mach-at91/at91rm9200.c
@@ -41,7 +41,6 @@ static void __init rm9200_dt_device_init(void)
 	arm_pm_idle = at91rm9200_idle;
 	arm_pm_restart = at91rm9200_restart;
 	at91_rm9200_pm_init();
-	at91_dt_initialize();
 
 	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 }
diff --git a/arch/arm/mach-at91/at91sam9.c b/arch/arm/mach-at91/at91sam9.c
index 0aeabcf4ddb8..8223b1298510 100644
--- a/arch/arm/mach-at91/at91sam9.c
+++ b/arch/arm/mach-at91/at91sam9.c
@@ -19,7 +19,6 @@ static void __init sam9_dt_device_init(void)
 {
 	arm_pm_idle = at91sam9_idle;
 	at91_sam9260_pm_init();
-	at91_dt_initialize();
 
 	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 }
@@ -39,7 +38,6 @@ static void __init sam9g45_dt_device_init(void)
 {
 	arm_pm_idle = at91sam9_idle;
 	at91_sam9g45_pm_init();
-	at91_dt_initialize();
 
 	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 }
diff --git a/arch/arm/mach-at91/generic.h b/arch/arm/mach-at91/generic.h
index 881e73a27fab..1384354e93dc 100644
--- a/arch/arm/mach-at91/generic.h
+++ b/arch/arm/mach-at91/generic.h
@@ -14,9 +14,6 @@
 #include <linux/of.h>
 #include <linux/reboot.h>
 
- /* Processors */
-extern void __init at91_dt_initialize(void);
-
  /* Timer */
 extern void at91rm9200_timer_init(void);
 
diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c
index 11bf992838af..4aebd7ba7640 100644
--- a/arch/arm/mach-at91/pm.c
+++ b/arch/arm/mach-at91/pm.c
@@ -44,6 +44,7 @@ static struct {
 } at91_pm_data;
 
 static void (*at91_pm_standby)(void);
+static void __iomem *at91_ramc_base[2];
 
 static int at91_pm_valid_state(suspend_state_t state)
 {
@@ -227,6 +228,44 @@ void at91_pm_set_standby(void (*at91_standby)(void))
 	}
 }
 
+
+static struct of_device_id ramc_ids[] = {
+	{ .compatible = "atmel,at91rm9200-sdramc", .data = at91rm9200_standby },
+	{ .compatible = "atmel,at91sam9260-sdramc", .data = at91sam9_sdram_standby },
+	{ .compatible = "atmel,at91sam9g45-ddramc", .data = at91_ddr_standby },
+	{ .compatible = "atmel,sama5d3-ddramc", .data = at91_ddr_standby },
+	{ /*sentinel*/ }
+};
+
+static void at91_dt_ramc(void)
+{
+	struct device_node *np;
+	const struct of_device_id *of_id;
+	int idx = 0;
+	const void *standby = NULL;
+
+	for_each_matching_node_and_match(np, ramc_ids, &of_id) {
+		at91_ramc_base[idx] = of_iomap(np, 0);
+		if (!at91_ramc_base[idx])
+			panic(pr_fmt("unable to map ramc[%d] cpu registers\n"), idx);
+
+		if (!standby)
+			standby = of_id->data;
+
+		idx++;
+	}
+
+	if (!idx)
+		panic(pr_fmt("unable to find compatible ram controller node in dtb\n"));
+
+	if (!standby) {
+		pr_warn("ramc no standby function available\n");
+		return;
+	}
+
+	at91_pm_set_standby(standby);
+}
+
 #ifdef CONFIG_AT91_SLOW_CLOCK
 static void __init at91_pm_sram_init(void)
 {
@@ -268,7 +307,6 @@ put_node:
 }
 #endif
 
-
 static void __init at91_pm_init(void)
 {
 #ifdef CONFIG_AT91_SLOW_CLOCK
@@ -288,6 +326,7 @@ void __init at91_rm9200_pm_init(void)
 	/*
 	 * AT91RM9200 SDRAM low-power mode cannot be used with self-refresh.
 	 */
+	at91_dt_ramc();
 	at91_ramc_write(0, AT91RM9200_SDRAMC_LPR, 0);
 
 	at91_pm_data.uhp_udp_mask = AT91RM9200_PMC_UHP | AT91RM9200_PMC_UDP;
@@ -298,6 +337,7 @@ void __init at91_rm9200_pm_init(void)
 
 void __init at91_sam9260_pm_init(void)
 {
+	at91_dt_ramc();
 	at91_pm_data.memctrl = AT91_MEMCTRL_SDRAMC;
 	at91_pm_data.uhp_udp_mask = AT91SAM926x_PMC_UHP | AT91SAM926x_PMC_UDP;
 	return at91_pm_init();
@@ -305,6 +345,7 @@ void __init at91_sam9260_pm_init(void)
 
 void __init at91_sam9g45_pm_init(void)
 {
+	at91_dt_ramc();
 	at91_pm_data.uhp_udp_mask = AT91SAM926x_PMC_UHP;
 	at91_pm_data.memctrl = AT91_MEMCTRL_DDRSDR;
 	return at91_pm_init();
diff --git a/arch/arm/mach-at91/sama5d3.c b/arch/arm/mach-at91/sama5d3.c
index 752d1612ff1f..3af2b4bcc205 100644
--- a/arch/arm/mach-at91/sama5d3.c
+++ b/arch/arm/mach-at91/sama5d3.c
@@ -16,7 +16,6 @@
 static void __init sama5_dt_device_init(void)
 {
 	at91_sam9260_pm_init();
-	at91_dt_initialize();
 
 	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 }
diff --git a/arch/arm/mach-at91/sama5d4.c b/arch/arm/mach-at91/sama5d4.c
index 2f1ee08dc49f..2ec43ee3f440 100644
--- a/arch/arm/mach-at91/sama5d4.c
+++ b/arch/arm/mach-at91/sama5d4.c
@@ -52,7 +52,6 @@ static void __init sama5d4_map_io(void)
 static void __init sama5d4_dt_device_init(void)
 {
 	at91_sam9260_pm_init();
-	at91_dt_initialize();
 
 	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 }
diff --git a/arch/arm/mach-at91/setup.c b/arch/arm/mach-at91/setup.c
deleted file mode 100644
index 4036e3e0ff96..000000000000
--- a/arch/arm/mach-at91/setup.c
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (C) 2007 Atmel Corporation.
- * Copyright (C) 2011 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
- *
- * Under GPLv2
- */
-
-#define pr_fmt(fmt)	"AT91: " fmt
-
-#include <linux/io.h>
-#include <linux/pm.h>
-#include <linux/of_address.h>
-
-#include <asm/system_misc.h>
-
-#include <mach/hardware.h>
-
-#include "generic.h"
-#include "pm.h"
-
-void __iomem *at91_ramc_base[2];
-EXPORT_SYMBOL_GPL(at91_ramc_base);
-
-static struct of_device_id ramc_ids[] = {
-	{ .compatible = "atmel,at91rm9200-sdramc", .data = at91rm9200_standby },
-	{ .compatible = "atmel,at91sam9260-sdramc", .data = at91sam9_sdram_standby },
-	{ .compatible = "atmel,at91sam9g45-ddramc", .data = at91_ddr_standby },
-	{ .compatible = "atmel,sama5d3-ddramc", .data = at91_ddr_standby },
-	{ /*sentinel*/ }
-};
-
-static void at91_dt_ramc(void)
-{
-	struct device_node *np;
-	const struct of_device_id *of_id;
-	int idx = 0;
-	const void *standby = NULL;
-
-	for_each_matching_node_and_match(np, ramc_ids, &of_id) {
-		at91_ramc_base[idx] = of_iomap(np, 0);
-		if (!at91_ramc_base[idx])
-			panic(pr_fmt("unable to map ramc[%d] cpu registers\n"), idx);
-
-		if (!standby)
-			standby = of_id->data;
-
-		idx++;
-	}
-
-	if (!idx)
-		panic(pr_fmt("unable to find compatible ram controller node in dtb\n"));
-
-	if (!standby) {
-		pr_warn("ramc no standby function available\n");
-		return;
-	}
-
-	at91_pm_set_standby(standby);
-}
-
-void __init at91_dt_initialize(void)
-{
-	at91_dt_ramc();
-}
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 56+ messages in thread

* [PATCH 17/17] ARM: at91: remove at91_dt_initialize
@ 2015-01-15 21:58   ` Alexandre Belloni
  0 siblings, 0 replies; 56+ messages in thread
From: Alexandre Belloni @ 2015-01-15 21:58 UTC (permalink / raw)
  To: linux-arm-kernel

Move the ramc initialization to pm.c as it is the only user left. This allows to
get rid of at91_dt_initialize() and setup.c

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
---
 arch/arm/mach-at91/Makefile     |  2 --
 arch/arm/mach-at91/at91rm9200.c |  1 -
 arch/arm/mach-at91/at91sam9.c   |  2 --
 arch/arm/mach-at91/generic.h    |  3 --
 arch/arm/mach-at91/pm.c         | 43 ++++++++++++++++++++++++++-
 arch/arm/mach-at91/sama5d3.c    |  1 -
 arch/arm/mach-at91/sama5d4.c    |  1 -
 arch/arm/mach-at91/setup.c      | 64 -----------------------------------------
 8 files changed, 42 insertions(+), 75 deletions(-)
 delete mode 100644 arch/arm/mach-at91/setup.c

diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile
index 27b503defe80..be26bb8c9a9a 100644
--- a/arch/arm/mach-at91/Makefile
+++ b/arch/arm/mach-at91/Makefile
@@ -2,8 +2,6 @@
 # Makefile for the linux kernel.
 #
 
-obj-y		:= setup.o
-
 obj-$(CONFIG_SOC_AT91SAM9)	+= sam9_smc.o
 
 # CPU-specific support
diff --git a/arch/arm/mach-at91/at91rm9200.c b/arch/arm/mach-at91/at91rm9200.c
index a1d1e63fb405..4ab2e2bbdee2 100644
--- a/arch/arm/mach-at91/at91rm9200.c
+++ b/arch/arm/mach-at91/at91rm9200.c
@@ -41,7 +41,6 @@ static void __init rm9200_dt_device_init(void)
 	arm_pm_idle = at91rm9200_idle;
 	arm_pm_restart = at91rm9200_restart;
 	at91_rm9200_pm_init();
-	at91_dt_initialize();
 
 	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 }
diff --git a/arch/arm/mach-at91/at91sam9.c b/arch/arm/mach-at91/at91sam9.c
index 0aeabcf4ddb8..8223b1298510 100644
--- a/arch/arm/mach-at91/at91sam9.c
+++ b/arch/arm/mach-at91/at91sam9.c
@@ -19,7 +19,6 @@ static void __init sam9_dt_device_init(void)
 {
 	arm_pm_idle = at91sam9_idle;
 	at91_sam9260_pm_init();
-	at91_dt_initialize();
 
 	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 }
@@ -39,7 +38,6 @@ static void __init sam9g45_dt_device_init(void)
 {
 	arm_pm_idle = at91sam9_idle;
 	at91_sam9g45_pm_init();
-	at91_dt_initialize();
 
 	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 }
diff --git a/arch/arm/mach-at91/generic.h b/arch/arm/mach-at91/generic.h
index 881e73a27fab..1384354e93dc 100644
--- a/arch/arm/mach-at91/generic.h
+++ b/arch/arm/mach-at91/generic.h
@@ -14,9 +14,6 @@
 #include <linux/of.h>
 #include <linux/reboot.h>
 
- /* Processors */
-extern void __init at91_dt_initialize(void);
-
  /* Timer */
 extern void at91rm9200_timer_init(void);
 
diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c
index 11bf992838af..4aebd7ba7640 100644
--- a/arch/arm/mach-at91/pm.c
+++ b/arch/arm/mach-at91/pm.c
@@ -44,6 +44,7 @@ static struct {
 } at91_pm_data;
 
 static void (*at91_pm_standby)(void);
+static void __iomem *at91_ramc_base[2];
 
 static int at91_pm_valid_state(suspend_state_t state)
 {
@@ -227,6 +228,44 @@ void at91_pm_set_standby(void (*at91_standby)(void))
 	}
 }
 
+
+static struct of_device_id ramc_ids[] = {
+	{ .compatible = "atmel,at91rm9200-sdramc", .data = at91rm9200_standby },
+	{ .compatible = "atmel,at91sam9260-sdramc", .data = at91sam9_sdram_standby },
+	{ .compatible = "atmel,at91sam9g45-ddramc", .data = at91_ddr_standby },
+	{ .compatible = "atmel,sama5d3-ddramc", .data = at91_ddr_standby },
+	{ /*sentinel*/ }
+};
+
+static void at91_dt_ramc(void)
+{
+	struct device_node *np;
+	const struct of_device_id *of_id;
+	int idx = 0;
+	const void *standby = NULL;
+
+	for_each_matching_node_and_match(np, ramc_ids, &of_id) {
+		at91_ramc_base[idx] = of_iomap(np, 0);
+		if (!at91_ramc_base[idx])
+			panic(pr_fmt("unable to map ramc[%d] cpu registers\n"), idx);
+
+		if (!standby)
+			standby = of_id->data;
+
+		idx++;
+	}
+
+	if (!idx)
+		panic(pr_fmt("unable to find compatible ram controller node in dtb\n"));
+
+	if (!standby) {
+		pr_warn("ramc no standby function available\n");
+		return;
+	}
+
+	at91_pm_set_standby(standby);
+}
+
 #ifdef CONFIG_AT91_SLOW_CLOCK
 static void __init at91_pm_sram_init(void)
 {
@@ -268,7 +307,6 @@ put_node:
 }
 #endif
 
-
 static void __init at91_pm_init(void)
 {
 #ifdef CONFIG_AT91_SLOW_CLOCK
@@ -288,6 +326,7 @@ void __init at91_rm9200_pm_init(void)
 	/*
 	 * AT91RM9200 SDRAM low-power mode cannot be used with self-refresh.
 	 */
+	at91_dt_ramc();
 	at91_ramc_write(0, AT91RM9200_SDRAMC_LPR, 0);
 
 	at91_pm_data.uhp_udp_mask = AT91RM9200_PMC_UHP | AT91RM9200_PMC_UDP;
@@ -298,6 +337,7 @@ void __init at91_rm9200_pm_init(void)
 
 void __init at91_sam9260_pm_init(void)
 {
+	at91_dt_ramc();
 	at91_pm_data.memctrl = AT91_MEMCTRL_SDRAMC;
 	at91_pm_data.uhp_udp_mask = AT91SAM926x_PMC_UHP | AT91SAM926x_PMC_UDP;
 	return at91_pm_init();
@@ -305,6 +345,7 @@ void __init at91_sam9260_pm_init(void)
 
 void __init at91_sam9g45_pm_init(void)
 {
+	at91_dt_ramc();
 	at91_pm_data.uhp_udp_mask = AT91SAM926x_PMC_UHP;
 	at91_pm_data.memctrl = AT91_MEMCTRL_DDRSDR;
 	return at91_pm_init();
diff --git a/arch/arm/mach-at91/sama5d3.c b/arch/arm/mach-at91/sama5d3.c
index 752d1612ff1f..3af2b4bcc205 100644
--- a/arch/arm/mach-at91/sama5d3.c
+++ b/arch/arm/mach-at91/sama5d3.c
@@ -16,7 +16,6 @@
 static void __init sama5_dt_device_init(void)
 {
 	at91_sam9260_pm_init();
-	at91_dt_initialize();
 
 	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 }
diff --git a/arch/arm/mach-at91/sama5d4.c b/arch/arm/mach-at91/sama5d4.c
index 2f1ee08dc49f..2ec43ee3f440 100644
--- a/arch/arm/mach-at91/sama5d4.c
+++ b/arch/arm/mach-at91/sama5d4.c
@@ -52,7 +52,6 @@ static void __init sama5d4_map_io(void)
 static void __init sama5d4_dt_device_init(void)
 {
 	at91_sam9260_pm_init();
-	at91_dt_initialize();
 
 	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 }
diff --git a/arch/arm/mach-at91/setup.c b/arch/arm/mach-at91/setup.c
deleted file mode 100644
index 4036e3e0ff96..000000000000
--- a/arch/arm/mach-at91/setup.c
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (C) 2007 Atmel Corporation.
- * Copyright (C) 2011 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
- *
- * Under GPLv2
- */
-
-#define pr_fmt(fmt)	"AT91: " fmt
-
-#include <linux/io.h>
-#include <linux/pm.h>
-#include <linux/of_address.h>
-
-#include <asm/system_misc.h>
-
-#include <mach/hardware.h>
-
-#include "generic.h"
-#include "pm.h"
-
-void __iomem *at91_ramc_base[2];
-EXPORT_SYMBOL_GPL(at91_ramc_base);
-
-static struct of_device_id ramc_ids[] = {
-	{ .compatible = "atmel,at91rm9200-sdramc", .data = at91rm9200_standby },
-	{ .compatible = "atmel,at91sam9260-sdramc", .data = at91sam9_sdram_standby },
-	{ .compatible = "atmel,at91sam9g45-ddramc", .data = at91_ddr_standby },
-	{ .compatible = "atmel,sama5d3-ddramc", .data = at91_ddr_standby },
-	{ /*sentinel*/ }
-};
-
-static void at91_dt_ramc(void)
-{
-	struct device_node *np;
-	const struct of_device_id *of_id;
-	int idx = 0;
-	const void *standby = NULL;
-
-	for_each_matching_node_and_match(np, ramc_ids, &of_id) {
-		at91_ramc_base[idx] = of_iomap(np, 0);
-		if (!at91_ramc_base[idx])
-			panic(pr_fmt("unable to map ramc[%d] cpu registers\n"), idx);
-
-		if (!standby)
-			standby = of_id->data;
-
-		idx++;
-	}
-
-	if (!idx)
-		panic(pr_fmt("unable to find compatible ram controller node in dtb\n"));
-
-	if (!standby) {
-		pr_warn("ramc no standby function available\n");
-		return;
-	}
-
-	at91_pm_set_standby(standby);
-}
-
-void __init at91_dt_initialize(void)
-{
-	at91_dt_ramc();
-}
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 56+ messages in thread

* Re: [PATCH 08/17] ARM: at91: stop using HAVE_AT91_DBGUx
  2015-01-15 21:58   ` Alexandre Belloni
@ 2015-01-20 10:34     ` Nicolas Ferre
  -1 siblings, 0 replies; 56+ messages in thread
From: Nicolas Ferre @ 2015-01-20 10:34 UTC (permalink / raw)
  To: Alexandre Belloni
  Cc: Jean-Christophe Plagniol-Villard, Arnd Bergmann, Boris Brezillon,
	Bo Shen, Wenyou Yang, linux-arm-kernel, linux-kernel

Le 15/01/2015 22:58, Alexandre Belloni a écrit :
> In order to remove SOC_SAM9xxx options, stop using HAVE_AT91_DBGUx.
> 
> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
> ---
>  arch/arm/Kconfig.debug     |  6 +++---
>  arch/arm/mach-at91/Kconfig | 19 -------------------
>  2 files changed, 3 insertions(+), 22 deletions(-)
> 
> diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
> index e34d24949c6a..42a38731da99 100644
> --- a/arch/arm/Kconfig.debug
> +++ b/arch/arm/Kconfig.debug
> @@ -117,17 +117,17 @@ choice
>  	config AT91_DEBUG_LL_DBGU0
>  		bool "Kernel low-level debugging on rm9200, 9260/9g20, 9261/9g10, 9rl, 9x5, 9n12"
>  		select DEBUG_AT91_UART
> -		depends on HAVE_AT91_DBGU0
> +		depends on SOC_AT91RM9200 || SOC_AT91SAM9
>  
>  	config AT91_DEBUG_LL_DBGU1
>  		bool "Kernel low-level debugging on 9263, 9g45 and sama5d3"
>  		select DEBUG_AT91_UART
> -		depends on HAVE_AT91_DBGU1
> +		depends on SOC_AT91SAM9 || SOC_SAMA5
>  
>  	config AT91_DEBUG_LL_DBGU2
>  		bool "Kernel low-level debugging on sama5d4"
>  		select DEBUG_AT91_UART
> -		depends on HAVE_AT91_DBGU2

These values are used below in the file: in:
"
default "debug/at91.S" if AT91_DEBUG_LL_DBGU0 || AT91_DEBUG_LL_DBGU1 || \
                       AT91_DEBUG_LL_DBGU2

"

So I guess there is a little patch missing: I answer to the
message "[PATCH 5/7] ARM: at91: move debug-macro.S into the common space" by fixing this.
Please tell me if it's okay.

Bye,


> +		depends on SOC_SAMA5
>  
>  	config DEBUG_BCM2835
>  		bool "Kernel low-level debugging on BCM2835 PL011 UART"
> diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
> index b7dcef50db23..c6956b863b9d 100644
> --- a/arch/arm/mach-at91/Kconfig
> +++ b/arch/arm/mach-at91/Kconfig
> @@ -6,15 +6,6 @@ config HAVE_AT91_UTMI
>  config HAVE_AT91_USB_CLK
>  	bool
>  
> -config HAVE_AT91_DBGU0
> -	bool
> -
> -config HAVE_AT91_DBGU1
> -	bool
> -
> -config HAVE_AT91_DBGU2
> -	bool
> -
>  config COMMON_CLK_AT91
>  	bool
>  	select COMMON_CLK
> @@ -70,7 +61,6 @@ config SOC_SAMA5D3
>  	bool "SAMA5D3 family"
>  	select SOC_SAMA5
>  	select HAVE_FB_ATMEL
> -	select HAVE_AT91_DBGU1
>  	select HAVE_AT91_UTMI
>  	select HAVE_AT91_SMD
>  	select HAVE_AT91_USB_CLK
> @@ -81,7 +71,6 @@ config SOC_SAMA5D3
>  config SOC_SAMA5D4
>  	bool "SAMA5D4 family"
>  	select SOC_SAMA5
> -	select HAVE_AT91_DBGU2
>  	select CLKSRC_MMIO
>  	select CACHE_L2X0
>  	select CACHE_PL310
> @@ -101,12 +90,10 @@ config SOC_AT91RM9200
>  	select COMMON_CLK_AT91
>  	select CPU_ARM920T
>  	select GENERIC_CLOCKEVENTS
> -	select HAVE_AT91_DBGU0
>  	select HAVE_AT91_USB_CLK
>  
>  config SOC_AT91SAM9260
>  	bool "AT91SAM9260, AT91SAM9XE or AT91SAM9G20"
> -	select HAVE_AT91_DBGU0
>  	select SOC_AT91SAM9
>  	select HAVE_AT91_USB_CLK
>  	help
> @@ -115,7 +102,6 @@ config SOC_AT91SAM9260
>  
>  config SOC_AT91SAM9261
>  	bool "AT91SAM9261 or AT91SAM9G10"
> -	select HAVE_AT91_DBGU0
>  	select HAVE_FB_ATMEL
>  	select SOC_AT91SAM9
>  	select HAVE_AT91_USB_CLK
> @@ -124,21 +110,18 @@ config SOC_AT91SAM9261
>  
>  config SOC_AT91SAM9263
>  	bool "AT91SAM9263"
> -	select HAVE_AT91_DBGU1
>  	select HAVE_FB_ATMEL
>  	select SOC_AT91SAM9
>  	select HAVE_AT91_USB_CLK
>  
>  config SOC_AT91SAM9RL
>  	bool "AT91SAM9RL"
> -	select HAVE_AT91_DBGU0
>  	select HAVE_FB_ATMEL
>  	select SOC_AT91SAM9
>  	select HAVE_AT91_UTMI
>  
>  config SOC_AT91SAM9G45
>  	bool "AT91SAM9G45 or AT91SAM9M10 families"
> -	select HAVE_AT91_DBGU1
>  	select HAVE_FB_ATMEL
>  	select SOC_AT91SAM9
>  	select HAVE_AT91_UTMI
> @@ -149,7 +132,6 @@ config SOC_AT91SAM9G45
>  
>  config SOC_AT91SAM9X5
>  	bool "AT91SAM9x5 family"
> -	select HAVE_AT91_DBGU0
>  	select HAVE_FB_ATMEL
>  	select SOC_AT91SAM9
>  	select HAVE_AT91_UTMI
> @@ -164,7 +146,6 @@ config SOC_AT91SAM9X5
>  
>  config SOC_AT91SAM9N12
>  	bool "AT91SAM9N12 family"
> -	select HAVE_AT91_DBGU0
>  	select HAVE_FB_ATMEL
>  	select SOC_AT91SAM9
>  	select HAVE_AT91_USB_CLK
> 


-- 
Nicolas Ferre

^ permalink raw reply	[flat|nested] 56+ messages in thread

* [PATCH 08/17] ARM: at91: stop using HAVE_AT91_DBGUx
@ 2015-01-20 10:34     ` Nicolas Ferre
  0 siblings, 0 replies; 56+ messages in thread
From: Nicolas Ferre @ 2015-01-20 10:34 UTC (permalink / raw)
  To: linux-arm-kernel

Le 15/01/2015 22:58, Alexandre Belloni a ?crit :
> In order to remove SOC_SAM9xxx options, stop using HAVE_AT91_DBGUx.
> 
> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
> ---
>  arch/arm/Kconfig.debug     |  6 +++---
>  arch/arm/mach-at91/Kconfig | 19 -------------------
>  2 files changed, 3 insertions(+), 22 deletions(-)
> 
> diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
> index e34d24949c6a..42a38731da99 100644
> --- a/arch/arm/Kconfig.debug
> +++ b/arch/arm/Kconfig.debug
> @@ -117,17 +117,17 @@ choice
>  	config AT91_DEBUG_LL_DBGU0
>  		bool "Kernel low-level debugging on rm9200, 9260/9g20, 9261/9g10, 9rl, 9x5, 9n12"
>  		select DEBUG_AT91_UART
> -		depends on HAVE_AT91_DBGU0
> +		depends on SOC_AT91RM9200 || SOC_AT91SAM9
>  
>  	config AT91_DEBUG_LL_DBGU1
>  		bool "Kernel low-level debugging on 9263, 9g45 and sama5d3"
>  		select DEBUG_AT91_UART
> -		depends on HAVE_AT91_DBGU1
> +		depends on SOC_AT91SAM9 || SOC_SAMA5
>  
>  	config AT91_DEBUG_LL_DBGU2
>  		bool "Kernel low-level debugging on sama5d4"
>  		select DEBUG_AT91_UART
> -		depends on HAVE_AT91_DBGU2

These values are used below in the file: in:
"
default "debug/at91.S" if AT91_DEBUG_LL_DBGU0 || AT91_DEBUG_LL_DBGU1 || \
                       AT91_DEBUG_LL_DBGU2

"

So I guess there is a little patch missing: I answer to the
message "[PATCH 5/7] ARM: at91: move debug-macro.S into the common space" by fixing this.
Please tell me if it's okay.

Bye,


> +		depends on SOC_SAMA5
>  
>  	config DEBUG_BCM2835
>  		bool "Kernel low-level debugging on BCM2835 PL011 UART"
> diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
> index b7dcef50db23..c6956b863b9d 100644
> --- a/arch/arm/mach-at91/Kconfig
> +++ b/arch/arm/mach-at91/Kconfig
> @@ -6,15 +6,6 @@ config HAVE_AT91_UTMI
>  config HAVE_AT91_USB_CLK
>  	bool
>  
> -config HAVE_AT91_DBGU0
> -	bool
> -
> -config HAVE_AT91_DBGU1
> -	bool
> -
> -config HAVE_AT91_DBGU2
> -	bool
> -
>  config COMMON_CLK_AT91
>  	bool
>  	select COMMON_CLK
> @@ -70,7 +61,6 @@ config SOC_SAMA5D3
>  	bool "SAMA5D3 family"
>  	select SOC_SAMA5
>  	select HAVE_FB_ATMEL
> -	select HAVE_AT91_DBGU1
>  	select HAVE_AT91_UTMI
>  	select HAVE_AT91_SMD
>  	select HAVE_AT91_USB_CLK
> @@ -81,7 +71,6 @@ config SOC_SAMA5D3
>  config SOC_SAMA5D4
>  	bool "SAMA5D4 family"
>  	select SOC_SAMA5
> -	select HAVE_AT91_DBGU2
>  	select CLKSRC_MMIO
>  	select CACHE_L2X0
>  	select CACHE_PL310
> @@ -101,12 +90,10 @@ config SOC_AT91RM9200
>  	select COMMON_CLK_AT91
>  	select CPU_ARM920T
>  	select GENERIC_CLOCKEVENTS
> -	select HAVE_AT91_DBGU0
>  	select HAVE_AT91_USB_CLK
>  
>  config SOC_AT91SAM9260
>  	bool "AT91SAM9260, AT91SAM9XE or AT91SAM9G20"
> -	select HAVE_AT91_DBGU0
>  	select SOC_AT91SAM9
>  	select HAVE_AT91_USB_CLK
>  	help
> @@ -115,7 +102,6 @@ config SOC_AT91SAM9260
>  
>  config SOC_AT91SAM9261
>  	bool "AT91SAM9261 or AT91SAM9G10"
> -	select HAVE_AT91_DBGU0
>  	select HAVE_FB_ATMEL
>  	select SOC_AT91SAM9
>  	select HAVE_AT91_USB_CLK
> @@ -124,21 +110,18 @@ config SOC_AT91SAM9261
>  
>  config SOC_AT91SAM9263
>  	bool "AT91SAM9263"
> -	select HAVE_AT91_DBGU1
>  	select HAVE_FB_ATMEL
>  	select SOC_AT91SAM9
>  	select HAVE_AT91_USB_CLK
>  
>  config SOC_AT91SAM9RL
>  	bool "AT91SAM9RL"
> -	select HAVE_AT91_DBGU0
>  	select HAVE_FB_ATMEL
>  	select SOC_AT91SAM9
>  	select HAVE_AT91_UTMI
>  
>  config SOC_AT91SAM9G45
>  	bool "AT91SAM9G45 or AT91SAM9M10 families"
> -	select HAVE_AT91_DBGU1
>  	select HAVE_FB_ATMEL
>  	select SOC_AT91SAM9
>  	select HAVE_AT91_UTMI
> @@ -149,7 +132,6 @@ config SOC_AT91SAM9G45
>  
>  config SOC_AT91SAM9X5
>  	bool "AT91SAM9x5 family"
> -	select HAVE_AT91_DBGU0
>  	select HAVE_FB_ATMEL
>  	select SOC_AT91SAM9
>  	select HAVE_AT91_UTMI
> @@ -164,7 +146,6 @@ config SOC_AT91SAM9X5
>  
>  config SOC_AT91SAM9N12
>  	bool "AT91SAM9N12 family"
> -	select HAVE_AT91_DBGU0
>  	select HAVE_FB_ATMEL
>  	select SOC_AT91SAM9
>  	select HAVE_AT91_USB_CLK
> 


-- 
Nicolas Ferre

^ permalink raw reply	[flat|nested] 56+ messages in thread

* Re: [PATCH 08/17] ARM: at91: stop using HAVE_AT91_DBGUx
  2015-01-20 10:34     ` Nicolas Ferre
@ 2015-01-20 15:12       ` Alexandre Belloni
  -1 siblings, 0 replies; 56+ messages in thread
From: Alexandre Belloni @ 2015-01-20 15:12 UTC (permalink / raw)
  To: Nicolas Ferre
  Cc: Jean-Christophe Plagniol-Villard, Arnd Bergmann, Boris Brezillon,
	Bo Shen, Wenyou Yang, linux-arm-kernel, linux-kernel

On 20/01/2015 at 11:34:53 +0100, Nicolas Ferre wrote :
> Le 15/01/2015 22:58, Alexandre Belloni a écrit :
> > In order to remove SOC_SAM9xxx options, stop using HAVE_AT91_DBGUx.
> > 
> > Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
> > ---
> >  arch/arm/Kconfig.debug     |  6 +++---
> >  arch/arm/mach-at91/Kconfig | 19 -------------------
> >  2 files changed, 3 insertions(+), 22 deletions(-)
> > 
> > diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
> > index e34d24949c6a..42a38731da99 100644
> > --- a/arch/arm/Kconfig.debug
> > +++ b/arch/arm/Kconfig.debug
> > @@ -117,17 +117,17 @@ choice
> >  	config AT91_DEBUG_LL_DBGU0
> >  		bool "Kernel low-level debugging on rm9200, 9260/9g20, 9261/9g10, 9rl, 9x5, 9n12"
> >  		select DEBUG_AT91_UART
> > -		depends on HAVE_AT91_DBGU0
> > +		depends on SOC_AT91RM9200 || SOC_AT91SAM9
> >  
> >  	config AT91_DEBUG_LL_DBGU1
> >  		bool "Kernel low-level debugging on 9263, 9g45 and sama5d3"
> >  		select DEBUG_AT91_UART
> > -		depends on HAVE_AT91_DBGU1
> > +		depends on SOC_AT91SAM9 || SOC_SAMA5
> >  
> >  	config AT91_DEBUG_LL_DBGU2
> >  		bool "Kernel low-level debugging on sama5d4"
> >  		select DEBUG_AT91_UART
> > -		depends on HAVE_AT91_DBGU2
> 
> These values are used below in the file: in:
> "
> default "debug/at91.S" if AT91_DEBUG_LL_DBGU0 || AT91_DEBUG_LL_DBGU1 || \
>                        AT91_DEBUG_LL_DBGU2
> 
> "
> 
> So I guess there is a little patch missing: I answer to the
> message "[PATCH 5/7] ARM: at91: move debug-macro.S into the common space" by fixing this.
> Please tell me if it's okay.
> 

Your correction was right. The patch correcting that was not part of the
last rebase.

-- 
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 56+ messages in thread

* [PATCH 08/17] ARM: at91: stop using HAVE_AT91_DBGUx
@ 2015-01-20 15:12       ` Alexandre Belloni
  0 siblings, 0 replies; 56+ messages in thread
From: Alexandre Belloni @ 2015-01-20 15:12 UTC (permalink / raw)
  To: linux-arm-kernel

On 20/01/2015 at 11:34:53 +0100, Nicolas Ferre wrote :
> Le 15/01/2015 22:58, Alexandre Belloni a ?crit :
> > In order to remove SOC_SAM9xxx options, stop using HAVE_AT91_DBGUx.
> > 
> > Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
> > ---
> >  arch/arm/Kconfig.debug     |  6 +++---
> >  arch/arm/mach-at91/Kconfig | 19 -------------------
> >  2 files changed, 3 insertions(+), 22 deletions(-)
> > 
> > diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
> > index e34d24949c6a..42a38731da99 100644
> > --- a/arch/arm/Kconfig.debug
> > +++ b/arch/arm/Kconfig.debug
> > @@ -117,17 +117,17 @@ choice
> >  	config AT91_DEBUG_LL_DBGU0
> >  		bool "Kernel low-level debugging on rm9200, 9260/9g20, 9261/9g10, 9rl, 9x5, 9n12"
> >  		select DEBUG_AT91_UART
> > -		depends on HAVE_AT91_DBGU0
> > +		depends on SOC_AT91RM9200 || SOC_AT91SAM9
> >  
> >  	config AT91_DEBUG_LL_DBGU1
> >  		bool "Kernel low-level debugging on 9263, 9g45 and sama5d3"
> >  		select DEBUG_AT91_UART
> > -		depends on HAVE_AT91_DBGU1
> > +		depends on SOC_AT91SAM9 || SOC_SAMA5
> >  
> >  	config AT91_DEBUG_LL_DBGU2
> >  		bool "Kernel low-level debugging on sama5d4"
> >  		select DEBUG_AT91_UART
> > -		depends on HAVE_AT91_DBGU2
> 
> These values are used below in the file: in:
> "
> default "debug/at91.S" if AT91_DEBUG_LL_DBGU0 || AT91_DEBUG_LL_DBGU1 || \
>                        AT91_DEBUG_LL_DBGU2
> 
> "
> 
> So I guess there is a little patch missing: I answer to the
> message "[PATCH 5/7] ARM: at91: move debug-macro.S into the common space" by fixing this.
> Please tell me if it's okay.
> 

Your correction was right. The patch correcting that was not part of the
last rebase.

-- 
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 56+ messages in thread

* Re: [PATCH 15/17] ARM: at91: remove old setup
  2015-01-15 21:58   ` Alexandre Belloni
@ 2015-01-21 16:29     ` Nicolas Ferre
  -1 siblings, 0 replies; 56+ messages in thread
From: Nicolas Ferre @ 2015-01-21 16:29 UTC (permalink / raw)
  To: Alexandre Belloni, Arnd Bergmann
  Cc: Jean-Christophe Plagniol-Villard, Boris Brezillon, Bo Shen,
	Wenyou Yang, linux-arm-kernel, linux-kernel

Le 15/01/2015 22:58, Alexandre Belloni a écrit :
> The old initialization is not used anymore, remove it.
> Also remove now unused cpu.h and at91_dbgu.h
> 
> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
> ---
>  arch/arm/mach-at91/generic.h                   |   4 -
>  arch/arm/mach-at91/include/mach/at91_dbgu.h    |  63 ------
>  arch/arm/mach-at91/include/mach/at91_ramc.h    |   6 -
>  arch/arm/mach-at91/include/mach/at91sam9_smc.h |   2 -
>  arch/arm/mach-at91/include/mach/cpu.h          | 240 --------------------

BTW, both at91_dbgu.h and cpu.h are needed for the uncompress.h AT91
file. I need to re-integrate both of them until this feature is
completely generalized with multi-platform. Are you okay with this
modification?

>  arch/arm/mach-at91/pm.c                        |   5 +-
>  arch/arm/mach-at91/setup.c                     | 301 -------------------------

I'm perfectly fine with removing the old setup code as we have the full
DT initialization in place.
This setup code didn't prove it had added any benefit in comparison with
the usual DT initialization process. Code is much more simpler and clearer.

Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>

I plan to queue these patches really soon on top of my
at91-3.20-cleanup branch.

Thanks, bye.


>  7 files changed, 4 insertions(+), 617 deletions(-)
>  delete mode 100644 arch/arm/mach-at91/include/mach/at91_dbgu.h
>  delete mode 100644 arch/arm/mach-at91/include/mach/cpu.h
> 
> diff --git a/arch/arm/mach-at91/generic.h b/arch/arm/mach-at91/generic.h
> index 1e60faec2eba..881e73a27fab 100644
> --- a/arch/arm/mach-at91/generic.h
> +++ b/arch/arm/mach-at91/generic.h
> @@ -14,10 +14,6 @@
>  #include <linux/of.h>
>  #include <linux/reboot.h>
>  
> - /* Map io */
> -extern void __init at91_map_io(void);
> -extern void __init at91_alt_map_io(void);
> -
>   /* Processors */
>  extern void __init at91_dt_initialize(void);
>  
> diff --git a/arch/arm/mach-at91/include/mach/at91_dbgu.h b/arch/arm/mach-at91/include/mach/at91_dbgu.h
> deleted file mode 100644
> index 42925e8f78e4..000000000000
> --- a/arch/arm/mach-at91/include/mach/at91_dbgu.h
> +++ /dev/null
> @@ -1,63 +0,0 @@
> -/*
> - * arch/arm/mach-at91/include/mach/at91_dbgu.h
> - *
> - * Copyright (C) 2005 Ivan Kokshaysky
> - * Copyright (C) SAN People
> - *
> - * Debug Unit (DBGU) - System peripherals registers.
> - * Based on AT91RM9200 datasheet revision E.
> - *
> - * This program is free software; you can redistribute it and/or modify
> - * it under the terms of the GNU General Public License as published by
> - * the Free Software Foundation; either version 2 of the License, or
> - * (at your option) any later version.
> - */
> -
> -#ifndef AT91_DBGU_H
> -#define AT91_DBGU_H
> -
> -#define AT91_DBGU_CR		(0x00)	/* Control Register */
> -#define AT91_DBGU_MR		(0x04)	/* Mode Register */
> -#define AT91_DBGU_IER		(0x08)	/* Interrupt Enable Register */
> -#define		AT91_DBGU_TXRDY		(1 << 1)		/* Transmitter Ready */
> -#define		AT91_DBGU_TXEMPTY	(1 << 9)		/* Transmitter Empty */
> -#define AT91_DBGU_IDR		(0x0c)	/* Interrupt Disable Register */
> -#define AT91_DBGU_IMR		(0x10)	/* Interrupt Mask Register */
> -#define AT91_DBGU_SR		(0x14)	/* Status Register */
> -#define AT91_DBGU_RHR		(0x18)	/* Receiver Holding Register */
> -#define AT91_DBGU_THR		(0x1c)	/* Transmitter Holding Register */
> -#define AT91_DBGU_BRGR		(0x20)	/* Baud Rate Generator Register */
> -
> -#define AT91_DBGU_CIDR		(0x40)	/* Chip ID Register */
> -#define AT91_DBGU_EXID		(0x44)	/* Chip ID Extension Register */
> -#define AT91_DBGU_FNR		(0x48)	/* Force NTRST Register [SAM9 only] */
> -#define		AT91_DBGU_FNTRST	(1 << 0)		/* Force NTRST */
> -
> -/*
> - * Some AT91 parts that don't have full DEBUG units still support the ID
> - * and extensions register.
> - */
> -#define		AT91_CIDR_VERSION	(0x1f << 0)		/* Version of the Device */
> -#define		AT91_CIDR_EPROC		(7    << 5)		/* Embedded Processor */
> -#define		AT91_CIDR_NVPSIZ	(0xf  << 8)		/* Nonvolatile Program Memory Size */
> -#define		AT91_CIDR_NVPSIZ2	(0xf  << 12)		/* Second Nonvolatile Program Memory Size */
> -#define		AT91_CIDR_SRAMSIZ	(0xf  << 16)		/* Internal SRAM Size */
> -#define			AT91_CIDR_SRAMSIZ_1K	(1 << 16)
> -#define			AT91_CIDR_SRAMSIZ_2K	(2 << 16)
> -#define			AT91_CIDR_SRAMSIZ_112K	(4 << 16)
> -#define			AT91_CIDR_SRAMSIZ_4K	(5 << 16)
> -#define			AT91_CIDR_SRAMSIZ_80K	(6 << 16)
> -#define			AT91_CIDR_SRAMSIZ_160K	(7 << 16)
> -#define			AT91_CIDR_SRAMSIZ_8K	(8 << 16)
> -#define			AT91_CIDR_SRAMSIZ_16K	(9 << 16)
> -#define			AT91_CIDR_SRAMSIZ_32K	(10 << 16)
> -#define			AT91_CIDR_SRAMSIZ_64K	(11 << 16)
> -#define			AT91_CIDR_SRAMSIZ_128K	(12 << 16)
> -#define			AT91_CIDR_SRAMSIZ_256K	(13 << 16)
> -#define			AT91_CIDR_SRAMSIZ_96K	(14 << 16)
> -#define			AT91_CIDR_SRAMSIZ_512K	(15 << 16)
> -#define		AT91_CIDR_ARCH		(0xff << 20)		/* Architecture Identifier */
> -#define		AT91_CIDR_NVPTYP	(7    << 28)		/* Nonvolatile Program Memory Type */
> -#define		AT91_CIDR_EXT		(1    << 31)		/* Extension Flag */
> -
> -#endif
> diff --git a/arch/arm/mach-at91/include/mach/at91_ramc.h b/arch/arm/mach-at91/include/mach/at91_ramc.h
> index e4492b151fee..80431ece8a54 100644
> --- a/arch/arm/mach-at91/include/mach/at91_ramc.h
> +++ b/arch/arm/mach-at91/include/mach/at91_ramc.h
> @@ -9,17 +9,11 @@
>  #ifndef __AT91_RAMC_H__
>  #define __AT91_RAMC_H__
>  
> -#ifndef __ASSEMBLY__
> -extern void __iomem *at91_ramc_base[];
> -
>  #define at91_ramc_read(id, field) \
>  	__raw_readl(at91_ramc_base[id] + field)
>  
>  #define at91_ramc_write(id, field, value) \
>  	__raw_writel(value, at91_ramc_base[id] + field)
> -#else
> -.extern at91_ramc_base
> -#endif
>  
>  #define AT91_MEMCTRL_MC		0
>  #define AT91_MEMCTRL_SDRAMC	1
> diff --git a/arch/arm/mach-at91/include/mach/at91sam9_smc.h b/arch/arm/mach-at91/include/mach/at91sam9_smc.h
> index 175e1fdd9fe8..ff54a0ce90e3 100644
> --- a/arch/arm/mach-at91/include/mach/at91sam9_smc.h
> +++ b/arch/arm/mach-at91/include/mach/at91sam9_smc.h
> @@ -16,8 +16,6 @@
>  #ifndef AT91SAM9_SMC_H
>  #define AT91SAM9_SMC_H
>  
> -#include <mach/cpu.h>
> -
>  #ifndef __ASSEMBLY__
>  struct sam9_smc_config {
>  	/* Setup register */
> diff --git a/arch/arm/mach-at91/include/mach/cpu.h b/arch/arm/mach-at91/include/mach/cpu.h
> deleted file mode 100644
> index 61914fb35f5d..000000000000
> --- a/arch/arm/mach-at91/include/mach/cpu.h
> +++ /dev/null
> @@ -1,240 +0,0 @@
> -/*
> - * arch/arm/mach-at91/include/mach/cpu.h
> - *
> - * Copyright (C) 2006 SAN People
> - * Copyright (C) 2011 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> - *
> - * This program is free software; you can redistribute it and/or modify
> - * it under the terms of the GNU General Public License as published by
> - * the Free Software Foundation; either version 2 of the License, or
> - * (at your option) any later version.
> - *
> - */
> -
> -#ifndef __MACH_CPU_H__
> -#define __MACH_CPU_H__
> -
> -#define ARCH_ID_AT91RM9200	0x09290780
> -#define ARCH_ID_AT91SAM9260	0x019803a0
> -#define ARCH_ID_AT91SAM9261	0x019703a0
> -#define ARCH_ID_AT91SAM9263	0x019607a0
> -#define ARCH_ID_AT91SAM9G10	0x019903a0
> -#define ARCH_ID_AT91SAM9G20	0x019905a0
> -#define ARCH_ID_AT91SAM9RL64	0x019b03a0
> -#define ARCH_ID_AT91SAM9G45	0x819b05a0
> -#define ARCH_ID_AT91SAM9G45MRL	0x819b05a2	/* aka 9G45-ES2 & non ES lots */
> -#define ARCH_ID_AT91SAM9G45ES	0x819b05a1	/* 9G45-ES (Engineering Sample) */
> -#define ARCH_ID_AT91SAM9X5	0x819a05a0
> -#define ARCH_ID_AT91SAM9N12	0x819a07a0
> -
> -#define ARCH_ID_AT91SAM9XE128	0x329973a0
> -#define ARCH_ID_AT91SAM9XE256	0x329a93a0
> -#define ARCH_ID_AT91SAM9XE512	0x329aa3a0
> -
> -#define ARCH_ID_AT91M40800	0x14080044
> -#define ARCH_ID_AT91R40807	0x44080746
> -#define ARCH_ID_AT91M40807	0x14080745
> -#define ARCH_ID_AT91R40008	0x44000840
> -
> -#define ARCH_ID_SAMA5		0x8A5C07C0
> -
> -#define ARCH_EXID_AT91SAM9M11	0x00000001
> -#define ARCH_EXID_AT91SAM9M10	0x00000002
> -#define ARCH_EXID_AT91SAM9G46	0x00000003
> -#define ARCH_EXID_AT91SAM9G45	0x00000004
> -
> -#define ARCH_EXID_AT91SAM9G15	0x00000000
> -#define ARCH_EXID_AT91SAM9G35	0x00000001
> -#define ARCH_EXID_AT91SAM9X35	0x00000002
> -#define ARCH_EXID_AT91SAM9G25	0x00000003
> -#define ARCH_EXID_AT91SAM9X25	0x00000004
> -
> -#define ARCH_EXID_SAMA5D3	0x00004300
> -#define ARCH_EXID_SAMA5D31	0x00444300
> -#define ARCH_EXID_SAMA5D33	0x00414300
> -#define ARCH_EXID_SAMA5D34	0x00414301
> -#define ARCH_EXID_SAMA5D35	0x00584300
> -#define ARCH_EXID_SAMA5D36	0x00004301
> -
> -#define ARCH_EXID_SAMA5D4	0x00000007
> -#define ARCH_EXID_SAMA5D41	0x00000001
> -#define ARCH_EXID_SAMA5D42	0x00000002
> -#define ARCH_EXID_SAMA5D43	0x00000003
> -#define ARCH_EXID_SAMA5D44	0x00000004
> -
> -#define ARCH_FAMILY_AT91SAM9	0x01900000
> -#define ARCH_FAMILY_AT91SAM9XE	0x02900000
> -
> -/* RM9200 type */
> -#define ARCH_REVISON_9200_BGA	(0 << 0)
> -#define ARCH_REVISON_9200_PQFP	(1 << 0)
> -
> -#ifndef __ASSEMBLY__
> -enum at91_soc_type {
> -	/* 920T */
> -	AT91_SOC_RM9200,
> -
> -	/* SAM92xx */
> -	AT91_SOC_SAM9260, AT91_SOC_SAM9261, AT91_SOC_SAM9263,
> -
> -	/* SAM9Gxx */
> -	AT91_SOC_SAM9G10, AT91_SOC_SAM9G20, AT91_SOC_SAM9G45,
> -
> -	/* SAM9RL */
> -	AT91_SOC_SAM9RL,
> -
> -	/* SAM9X5 */
> -	AT91_SOC_SAM9X5,
> -
> -	/* SAM9N12 */
> -	AT91_SOC_SAM9N12,
> -
> -	/* SAMA5D3 */
> -	AT91_SOC_SAMA5D3,
> -
> -	/* SAMA5D4 */
> -	AT91_SOC_SAMA5D4,
> -
> -	/* Unknown type */
> -	AT91_SOC_UNKNOWN,
> -};
> -
> -enum at91_soc_subtype {
> -	/* RM9200 */
> -	AT91_SOC_RM9200_BGA, AT91_SOC_RM9200_PQFP,
> -
> -	/* SAM9260 */
> -	AT91_SOC_SAM9XE,
> -
> -	/* SAM9G45 */
> -	AT91_SOC_SAM9G45ES, AT91_SOC_SAM9M10, AT91_SOC_SAM9G46, AT91_SOC_SAM9M11,
> -
> -	/* SAM9X5 */
> -	AT91_SOC_SAM9G15, AT91_SOC_SAM9G35, AT91_SOC_SAM9X35,
> -	AT91_SOC_SAM9G25, AT91_SOC_SAM9X25,
> -
> -	/* SAMA5D3 */
> -	AT91_SOC_SAMA5D31, AT91_SOC_SAMA5D33, AT91_SOC_SAMA5D34,
> -	AT91_SOC_SAMA5D35, AT91_SOC_SAMA5D36,
> -
> -	/* SAMA5D4 */
> -	AT91_SOC_SAMA5D41, AT91_SOC_SAMA5D42, AT91_SOC_SAMA5D43,
> -	AT91_SOC_SAMA5D44,
> -
> -	/* No subtype for this SoC */
> -	AT91_SOC_SUBTYPE_NONE,
> -
> -	/* Unknown subtype */
> -	AT91_SOC_SUBTYPE_UNKNOWN,
> -};
> -
> -struct at91_socinfo {
> -	unsigned int type, subtype;
> -	unsigned int cidr, exid;
> -};
> -
> -extern struct at91_socinfo at91_soc_initdata;
> -const char *at91_get_soc_type(struct at91_socinfo *c);
> -const char *at91_get_soc_subtype(struct at91_socinfo *c);
> -
> -static inline int at91_soc_is_detected(void)
> -{
> -	return at91_soc_initdata.type != AT91_SOC_UNKNOWN;
> -}
> -
> -#ifdef CONFIG_SOC_AT91RM9200
> -#define cpu_is_at91rm9200()	(at91_soc_initdata.type == AT91_SOC_RM9200)
> -#define cpu_is_at91rm9200_bga()	(at91_soc_initdata.subtype == AT91_SOC_RM9200_BGA)
> -#define cpu_is_at91rm9200_pqfp() (at91_soc_initdata.subtype == AT91_SOC_RM9200_PQFP)
> -#else
> -#define cpu_is_at91rm9200()	(0)
> -#define cpu_is_at91rm9200_bga()	(0)
> -#define cpu_is_at91rm9200_pqfp() (0)
> -#endif
> -
> -#ifdef CONFIG_SOC_AT91SAM9260
> -#define cpu_is_at91sam9xe()	(at91_soc_initdata.subtype == AT91_SOC_SAM9XE)
> -#define cpu_is_at91sam9260()	(at91_soc_initdata.type == AT91_SOC_SAM9260)
> -#define cpu_is_at91sam9g20()	(at91_soc_initdata.type == AT91_SOC_SAM9G20)
> -#else
> -#define cpu_is_at91sam9xe()	(0)
> -#define cpu_is_at91sam9260()	(0)
> -#define cpu_is_at91sam9g20()	(0)
> -#endif
> -
> -#ifdef CONFIG_SOC_AT91SAM9261
> -#define cpu_is_at91sam9261()	(at91_soc_initdata.type == AT91_SOC_SAM9261)
> -#define cpu_is_at91sam9g10()	(at91_soc_initdata.type == AT91_SOC_SAM9G10)
> -#else
> -#define cpu_is_at91sam9261()	(0)
> -#define cpu_is_at91sam9g10()	(0)
> -#endif
> -
> -#ifdef CONFIG_SOC_AT91SAM9263
> -#define cpu_is_at91sam9263()	(at91_soc_initdata.type == AT91_SOC_SAM9263)
> -#else
> -#define cpu_is_at91sam9263()	(0)
> -#endif
> -
> -#ifdef CONFIG_SOC_AT91SAM9RL
> -#define cpu_is_at91sam9rl()	(at91_soc_initdata.type == AT91_SOC_SAM9RL)
> -#else
> -#define cpu_is_at91sam9rl()	(0)
> -#endif
> -
> -#ifdef CONFIG_SOC_AT91SAM9G45
> -#define cpu_is_at91sam9g45()	(at91_soc_initdata.type == AT91_SOC_SAM9G45)
> -#define cpu_is_at91sam9g45es()	(at91_soc_initdata.subtype == AT91_SOC_SAM9G45ES)
> -#define cpu_is_at91sam9m10()	(at91_soc_initdata.subtype == AT91_SOC_SAM9M10)
> -#define cpu_is_at91sam9g46()	(at91_soc_initdata.subtype == AT91_SOC_SAM9G46)
> -#define cpu_is_at91sam9m11()	(at91_soc_initdata.subtype == AT91_SOC_SAM9M11)
> -#else
> -#define cpu_is_at91sam9g45()	(0)
> -#define cpu_is_at91sam9g45es()	(0)
> -#define cpu_is_at91sam9m10()	(0)
> -#define cpu_is_at91sam9g46()	(0)
> -#define cpu_is_at91sam9m11()	(0)
> -#endif
> -
> -#ifdef CONFIG_SOC_AT91SAM9X5
> -#define cpu_is_at91sam9x5()	(at91_soc_initdata.type == AT91_SOC_SAM9X5)
> -#define cpu_is_at91sam9g15()	(at91_soc_initdata.subtype == AT91_SOC_SAM9G15)
> -#define cpu_is_at91sam9g35()	(at91_soc_initdata.subtype == AT91_SOC_SAM9G35)
> -#define cpu_is_at91sam9x35()	(at91_soc_initdata.subtype == AT91_SOC_SAM9X35)
> -#define cpu_is_at91sam9g25()	(at91_soc_initdata.subtype == AT91_SOC_SAM9G25)
> -#define cpu_is_at91sam9x25()	(at91_soc_initdata.subtype == AT91_SOC_SAM9X25)
> -#else
> -#define cpu_is_at91sam9x5()	(0)
> -#define cpu_is_at91sam9g15()	(0)
> -#define cpu_is_at91sam9g35()	(0)
> -#define cpu_is_at91sam9x35()	(0)
> -#define cpu_is_at91sam9g25()	(0)
> -#define cpu_is_at91sam9x25()	(0)
> -#endif
> -
> -#ifdef CONFIG_SOC_AT91SAM9N12
> -#define cpu_is_at91sam9n12()	(at91_soc_initdata.type == AT91_SOC_SAM9N12)
> -#else
> -#define cpu_is_at91sam9n12()	(0)
> -#endif
> -
> -#ifdef CONFIG_SOC_SAMA5D3
> -#define cpu_is_sama5d3()	(at91_soc_initdata.type == AT91_SOC_SAMA5D3)
> -#else
> -#define cpu_is_sama5d3()	(0)
> -#endif
> -
> -#ifdef CONFIG_SOC_SAMA5D4
> -#define cpu_is_sama5d4()	(at91_soc_initdata.type == AT91_SOC_SAMA5D4)
> -#else
> -#define cpu_is_sama5d4()	(0)
> -#endif
> -
> -/*
> - * Since this is ARM, we will never run on any AVR32 CPU. But these
> - * definitions may reduce clutter in common drivers.
> - */
> -#define cpu_is_at32ap7000()	(0)
> -#endif /* __ASSEMBLY__ */
> -
> -#endif /* __MACH_CPU_H__ */
> diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c
> index 778f11132b31..11bf992838af 100644
> --- a/arch/arm/mach-at91/pm.c
> +++ b/arch/arm/mach-at91/pm.c
> @@ -19,6 +19,7 @@
>  #include <linux/sysfs.h>
>  #include <linux/module.h>
>  #include <linux/of.h>
> +#include <linux/of_address.h>
>  #include <linux/of_platform.h>
>  #include <linux/platform_device.h>
>  #include <linux/io.h>
> @@ -29,10 +30,12 @@
>  #include <asm/mach/time.h>
>  #include <asm/mach/irq.h>
>  
> -#include <mach/cpu.h>
>  #include <mach/hardware.h>
>  
>  #include "generic.h"
> +
> +static void __iomem *at91_ramc_base[2];
> +
>  #include "pm.h"
>  
>  static struct {
> diff --git a/arch/arm/mach-at91/setup.c b/arch/arm/mach-at91/setup.c
> index 42ebe8d41433..4036e3e0ff96 100644
> --- a/arch/arm/mach-at91/setup.c
> +++ b/arch/arm/mach-at91/setup.c
> @@ -7,321 +7,20 @@
>  
>  #define pr_fmt(fmt)	"AT91: " fmt
>  
> -#include <linux/module.h>
>  #include <linux/io.h>
> -#include <linux/mm.h>
>  #include <linux/pm.h>
>  #include <linux/of_address.h>
> -#include <linux/pinctrl/machine.h>
> -#include <linux/clk/at91_pmc.h>
>  
>  #include <asm/system_misc.h>
> -#include <asm/mach/map.h>
>  
>  #include <mach/hardware.h>
> -#include <mach/cpu.h>
> -#include <mach/at91_dbgu.h>
>  
>  #include "generic.h"
>  #include "pm.h"
>  
> -struct at91_socinfo at91_soc_initdata;
> -EXPORT_SYMBOL(at91_soc_initdata);
> -
>  void __iomem *at91_ramc_base[2];
>  EXPORT_SYMBOL_GPL(at91_ramc_base);
>  
> -static struct map_desc at91_io_desc __initdata __maybe_unused = {
> -	.virtual	= (unsigned long)AT91_VA_BASE_SYS,
> -	.pfn		= __phys_to_pfn(AT91_BASE_SYS),
> -	.length		= SZ_16K,
> -	.type		= MT_DEVICE,
> -};
> -
> -static struct map_desc at91_alt_io_desc __initdata __maybe_unused = {
> -	.virtual	= (unsigned long)AT91_ALT_VA_BASE_SYS,
> -	.pfn		= __phys_to_pfn(AT91_ALT_BASE_SYS),
> -	.length		= 24 * SZ_1K,
> -	.type		= MT_DEVICE,
> -};
> -
> -static void __init soc_detect(u32 dbgu_base)
> -{
> -	u32 cidr, socid;
> -
> -	cidr = __raw_readl(AT91_IO_P2V(dbgu_base) + AT91_DBGU_CIDR);
> -	socid = cidr & ~AT91_CIDR_VERSION;
> -
> -	switch (socid) {
> -	case ARCH_ID_AT91RM9200:
> -		at91_soc_initdata.type = AT91_SOC_RM9200;
> -		if (at91_soc_initdata.subtype == AT91_SOC_SUBTYPE_UNKNOWN)
> -			at91_soc_initdata.subtype = AT91_SOC_RM9200_BGA;
> -		break;
> -
> -	case ARCH_ID_AT91SAM9260:
> -		at91_soc_initdata.type = AT91_SOC_SAM9260;
> -		at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE;
> -		break;
> -
> -	case ARCH_ID_AT91SAM9261:
> -		at91_soc_initdata.type = AT91_SOC_SAM9261;
> -		at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE;
> -		break;
> -
> -	case ARCH_ID_AT91SAM9263:
> -		at91_soc_initdata.type = AT91_SOC_SAM9263;
> -		at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE;
> -		break;
> -
> -	case ARCH_ID_AT91SAM9G20:
> -		at91_soc_initdata.type = AT91_SOC_SAM9G20;
> -		at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE;
> -		break;
> -
> -	case ARCH_ID_AT91SAM9G45:
> -		at91_soc_initdata.type = AT91_SOC_SAM9G45;
> -		if (cidr == ARCH_ID_AT91SAM9G45ES)
> -			at91_soc_initdata.subtype = AT91_SOC_SAM9G45ES;
> -		break;
> -
> -	case ARCH_ID_AT91SAM9RL64:
> -		at91_soc_initdata.type = AT91_SOC_SAM9RL;
> -		at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE;
> -		break;
> -
> -	case ARCH_ID_AT91SAM9X5:
> -		at91_soc_initdata.type = AT91_SOC_SAM9X5;
> -		break;
> -
> -	case ARCH_ID_AT91SAM9N12:
> -		at91_soc_initdata.type = AT91_SOC_SAM9N12;
> -		break;
> -
> -	case ARCH_ID_SAMA5:
> -		at91_soc_initdata.exid = __raw_readl(AT91_IO_P2V(dbgu_base) + AT91_DBGU_EXID);
> -		if (at91_soc_initdata.exid & ARCH_EXID_SAMA5D3) {
> -			at91_soc_initdata.type = AT91_SOC_SAMA5D3;
> -		}
> -		break;
> -	}
> -
> -	/* at91sam9g10 */
> -	if ((socid & ~AT91_CIDR_EXT) == ARCH_ID_AT91SAM9G10) {
> -		at91_soc_initdata.type = AT91_SOC_SAM9G10;
> -		at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE;
> -	}
> -	/* at91sam9xe */
> -	else if ((cidr & AT91_CIDR_ARCH) == ARCH_FAMILY_AT91SAM9XE) {
> -		at91_soc_initdata.type = AT91_SOC_SAM9260;
> -		at91_soc_initdata.subtype = AT91_SOC_SAM9XE;
> -	}
> -
> -	if (!at91_soc_is_detected())
> -		return;
> -
> -	at91_soc_initdata.cidr = cidr;
> -
> -	/* sub version of soc */
> -	if (!at91_soc_initdata.exid)
> -		at91_soc_initdata.exid = __raw_readl(AT91_IO_P2V(dbgu_base) + AT91_DBGU_EXID);
> -
> -	if (at91_soc_initdata.type == AT91_SOC_SAM9G45) {
> -		switch (at91_soc_initdata.exid) {
> -		case ARCH_EXID_AT91SAM9M10:
> -			at91_soc_initdata.subtype = AT91_SOC_SAM9M10;
> -			break;
> -		case ARCH_EXID_AT91SAM9G46:
> -			at91_soc_initdata.subtype = AT91_SOC_SAM9G46;
> -			break;
> -		case ARCH_EXID_AT91SAM9M11:
> -			at91_soc_initdata.subtype = AT91_SOC_SAM9M11;
> -			break;
> -		}
> -	}
> -
> -	if (at91_soc_initdata.type == AT91_SOC_SAM9X5) {
> -		switch (at91_soc_initdata.exid) {
> -		case ARCH_EXID_AT91SAM9G15:
> -			at91_soc_initdata.subtype = AT91_SOC_SAM9G15;
> -			break;
> -		case ARCH_EXID_AT91SAM9G35:
> -			at91_soc_initdata.subtype = AT91_SOC_SAM9G35;
> -			break;
> -		case ARCH_EXID_AT91SAM9X35:
> -			at91_soc_initdata.subtype = AT91_SOC_SAM9X35;
> -			break;
> -		case ARCH_EXID_AT91SAM9G25:
> -			at91_soc_initdata.subtype = AT91_SOC_SAM9G25;
> -			break;
> -		case ARCH_EXID_AT91SAM9X25:
> -			at91_soc_initdata.subtype = AT91_SOC_SAM9X25;
> -			break;
> -		}
> -	}
> -
> -	if (at91_soc_initdata.type == AT91_SOC_SAMA5D3) {
> -		switch (at91_soc_initdata.exid) {
> -		case ARCH_EXID_SAMA5D31:
> -			at91_soc_initdata.subtype = AT91_SOC_SAMA5D31;
> -			break;
> -		case ARCH_EXID_SAMA5D33:
> -			at91_soc_initdata.subtype = AT91_SOC_SAMA5D33;
> -			break;
> -		case ARCH_EXID_SAMA5D34:
> -			at91_soc_initdata.subtype = AT91_SOC_SAMA5D34;
> -			break;
> -		case ARCH_EXID_SAMA5D35:
> -			at91_soc_initdata.subtype = AT91_SOC_SAMA5D35;
> -			break;
> -		case ARCH_EXID_SAMA5D36:
> -			at91_soc_initdata.subtype = AT91_SOC_SAMA5D36;
> -			break;
> -		}
> -	}
> -}
> -
> -static void __init alt_soc_detect(u32 dbgu_base)
> -{
> -	u32 cidr, socid;
> -
> -	/* SoC ID */
> -	cidr = __raw_readl(AT91_ALT_IO_P2V(dbgu_base) + AT91_DBGU_CIDR);
> -	socid = cidr & ~AT91_CIDR_VERSION;
> -
> -	switch (socid) {
> -	case ARCH_ID_SAMA5:
> -		at91_soc_initdata.exid = __raw_readl(AT91_ALT_IO_P2V(dbgu_base) + AT91_DBGU_EXID);
> -		if (at91_soc_initdata.exid & ARCH_EXID_SAMA5D3) {
> -			at91_soc_initdata.type = AT91_SOC_SAMA5D3;
> -		} else if (at91_soc_initdata.exid & ARCH_EXID_SAMA5D4) {
> -			at91_soc_initdata.type = AT91_SOC_SAMA5D4;
> -		}
> -		break;
> -	}
> -
> -	if (!at91_soc_is_detected())
> -		return;
> -
> -	at91_soc_initdata.cidr = cidr;
> -
> -	/* sub version of soc */
> -	if (!at91_soc_initdata.exid)
> -		at91_soc_initdata.exid = __raw_readl(AT91_ALT_IO_P2V(dbgu_base) + AT91_DBGU_EXID);
> -
> -	if (at91_soc_initdata.type == AT91_SOC_SAMA5D4) {
> -		switch (at91_soc_initdata.exid) {
> -		case ARCH_EXID_SAMA5D41:
> -			at91_soc_initdata.subtype = AT91_SOC_SAMA5D41;
> -			break;
> -		case ARCH_EXID_SAMA5D42:
> -			at91_soc_initdata.subtype = AT91_SOC_SAMA5D42;
> -			break;
> -		case ARCH_EXID_SAMA5D43:
> -			at91_soc_initdata.subtype = AT91_SOC_SAMA5D43;
> -			break;
> -		case ARCH_EXID_SAMA5D44:
> -			at91_soc_initdata.subtype = AT91_SOC_SAMA5D44;
> -			break;
> -		}
> -	}
> -}
> -
> -static const char *soc_name[] = {
> -	[AT91_SOC_RM9200]	= "at91rm9200",
> -	[AT91_SOC_SAM9260]	= "at91sam9260",
> -	[AT91_SOC_SAM9261]	= "at91sam9261",
> -	[AT91_SOC_SAM9263]	= "at91sam9263",
> -	[AT91_SOC_SAM9G10]	= "at91sam9g10",
> -	[AT91_SOC_SAM9G20]	= "at91sam9g20",
> -	[AT91_SOC_SAM9G45]	= "at91sam9g45",
> -	[AT91_SOC_SAM9RL]	= "at91sam9rl",
> -	[AT91_SOC_SAM9X5]	= "at91sam9x5",
> -	[AT91_SOC_SAM9N12]	= "at91sam9n12",
> -	[AT91_SOC_SAMA5D3]	= "sama5d3",
> -	[AT91_SOC_SAMA5D4]	= "sama5d4",
> -	[AT91_SOC_UNKNOWN]	= "Unknown",
> -};
> -
> -const char *at91_get_soc_type(struct at91_socinfo *c)
> -{
> -	return soc_name[c->type];
> -}
> -EXPORT_SYMBOL(at91_get_soc_type);
> -
> -static const char *soc_subtype_name[] = {
> -	[AT91_SOC_RM9200_BGA]	= "at91rm9200 BGA",
> -	[AT91_SOC_RM9200_PQFP]	= "at91rm9200 PQFP",
> -	[AT91_SOC_SAM9XE]	= "at91sam9xe",
> -	[AT91_SOC_SAM9G45ES]	= "at91sam9g45es",
> -	[AT91_SOC_SAM9M10]	= "at91sam9m10",
> -	[AT91_SOC_SAM9G46]	= "at91sam9g46",
> -	[AT91_SOC_SAM9M11]	= "at91sam9m11",
> -	[AT91_SOC_SAM9G15]	= "at91sam9g15",
> -	[AT91_SOC_SAM9G35]	= "at91sam9g35",
> -	[AT91_SOC_SAM9X35]	= "at91sam9x35",
> -	[AT91_SOC_SAM9G25]	= "at91sam9g25",
> -	[AT91_SOC_SAM9X25]	= "at91sam9x25",
> -	[AT91_SOC_SAMA5D31]	= "sama5d31",
> -	[AT91_SOC_SAMA5D33]	= "sama5d33",
> -	[AT91_SOC_SAMA5D34]	= "sama5d34",
> -	[AT91_SOC_SAMA5D35]	= "sama5d35",
> -	[AT91_SOC_SAMA5D36]	= "sama5d36",
> -	[AT91_SOC_SAMA5D41]	= "sama5d41",
> -	[AT91_SOC_SAMA5D42]	= "sama5d42",
> -	[AT91_SOC_SAMA5D43]	= "sama5d43",
> -	[AT91_SOC_SAMA5D44]	= "sama5d44",
> -	[AT91_SOC_SUBTYPE_NONE]	= "None",
> -	[AT91_SOC_SUBTYPE_UNKNOWN] = "Unknown",
> -};
> -
> -const char *at91_get_soc_subtype(struct at91_socinfo *c)
> -{
> -	return soc_subtype_name[c->subtype];
> -}
> -EXPORT_SYMBOL(at91_get_soc_subtype);
> -
> -void __init at91_map_io(void)
> -{
> -	/* Map peripherals */
> -	iotable_init(&at91_io_desc, 1);
> -
> -	at91_soc_initdata.type = AT91_SOC_UNKNOWN;
> -	at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_UNKNOWN;
> -
> -	soc_detect(AT91_BASE_DBGU0);
> -	if (!at91_soc_is_detected())
> -		soc_detect(AT91_BASE_DBGU1);
> -
> -	if (!at91_soc_is_detected())
> -		panic(pr_fmt("Impossible to detect the SOC type"));
> -
> -	pr_info("Detected soc type: %s\n",
> -		at91_get_soc_type(&at91_soc_initdata));
> -	if (at91_soc_initdata.subtype != AT91_SOC_SUBTYPE_NONE)
> -		pr_info("Detected soc subtype: %s\n",
> -			at91_get_soc_subtype(&at91_soc_initdata));
> -}
> -
> -void __init at91_alt_map_io(void)
> -{
> -	/* Map peripherals */
> -	iotable_init(&at91_alt_io_desc, 1);
> -
> -	at91_soc_initdata.type = AT91_SOC_UNKNOWN;
> -	at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_UNKNOWN;
> -
> -	alt_soc_detect(AT91_BASE_DBGU2);
> -	if (!at91_soc_is_detected())
> -		panic("AT91: Impossible to detect the SOC type");
> -
> -	pr_info("AT91: Detected soc type: %s\n",
> -		at91_get_soc_type(&at91_soc_initdata));
> -	if (at91_soc_initdata.subtype != AT91_SOC_SUBTYPE_NONE)
> -		pr_info("AT91: Detected soc subtype: %s\n",
> -			at91_get_soc_subtype(&at91_soc_initdata));
> -}
> -
>  static struct of_device_id ramc_ids[] = {
>  	{ .compatible = "atmel,at91rm9200-sdramc", .data = at91rm9200_standby },
>  	{ .compatible = "atmel,at91sam9260-sdramc", .data = at91sam9_sdram_standby },
> 


-- 
Nicolas Ferre

^ permalink raw reply	[flat|nested] 56+ messages in thread

* [PATCH 15/17] ARM: at91: remove old setup
@ 2015-01-21 16:29     ` Nicolas Ferre
  0 siblings, 0 replies; 56+ messages in thread
From: Nicolas Ferre @ 2015-01-21 16:29 UTC (permalink / raw)
  To: linux-arm-kernel

Le 15/01/2015 22:58, Alexandre Belloni a ?crit :
> The old initialization is not used anymore, remove it.
> Also remove now unused cpu.h and at91_dbgu.h
> 
> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
> ---
>  arch/arm/mach-at91/generic.h                   |   4 -
>  arch/arm/mach-at91/include/mach/at91_dbgu.h    |  63 ------
>  arch/arm/mach-at91/include/mach/at91_ramc.h    |   6 -
>  arch/arm/mach-at91/include/mach/at91sam9_smc.h |   2 -
>  arch/arm/mach-at91/include/mach/cpu.h          | 240 --------------------

BTW, both at91_dbgu.h and cpu.h are needed for the uncompress.h AT91
file. I need to re-integrate both of them until this feature is
completely generalized with multi-platform. Are you okay with this
modification?

>  arch/arm/mach-at91/pm.c                        |   5 +-
>  arch/arm/mach-at91/setup.c                     | 301 -------------------------

I'm perfectly fine with removing the old setup code as we have the full
DT initialization in place.
This setup code didn't prove it had added any benefit in comparison with
the usual DT initialization process. Code is much more simpler and clearer.

Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>

I plan to queue these patches really soon on top of my
at91-3.20-cleanup branch.

Thanks, bye.


>  7 files changed, 4 insertions(+), 617 deletions(-)
>  delete mode 100644 arch/arm/mach-at91/include/mach/at91_dbgu.h
>  delete mode 100644 arch/arm/mach-at91/include/mach/cpu.h
> 
> diff --git a/arch/arm/mach-at91/generic.h b/arch/arm/mach-at91/generic.h
> index 1e60faec2eba..881e73a27fab 100644
> --- a/arch/arm/mach-at91/generic.h
> +++ b/arch/arm/mach-at91/generic.h
> @@ -14,10 +14,6 @@
>  #include <linux/of.h>
>  #include <linux/reboot.h>
>  
> - /* Map io */
> -extern void __init at91_map_io(void);
> -extern void __init at91_alt_map_io(void);
> -
>   /* Processors */
>  extern void __init at91_dt_initialize(void);
>  
> diff --git a/arch/arm/mach-at91/include/mach/at91_dbgu.h b/arch/arm/mach-at91/include/mach/at91_dbgu.h
> deleted file mode 100644
> index 42925e8f78e4..000000000000
> --- a/arch/arm/mach-at91/include/mach/at91_dbgu.h
> +++ /dev/null
> @@ -1,63 +0,0 @@
> -/*
> - * arch/arm/mach-at91/include/mach/at91_dbgu.h
> - *
> - * Copyright (C) 2005 Ivan Kokshaysky
> - * Copyright (C) SAN People
> - *
> - * Debug Unit (DBGU) - System peripherals registers.
> - * Based on AT91RM9200 datasheet revision E.
> - *
> - * This program is free software; you can redistribute it and/or modify
> - * it under the terms of the GNU General Public License as published by
> - * the Free Software Foundation; either version 2 of the License, or
> - * (at your option) any later version.
> - */
> -
> -#ifndef AT91_DBGU_H
> -#define AT91_DBGU_H
> -
> -#define AT91_DBGU_CR		(0x00)	/* Control Register */
> -#define AT91_DBGU_MR		(0x04)	/* Mode Register */
> -#define AT91_DBGU_IER		(0x08)	/* Interrupt Enable Register */
> -#define		AT91_DBGU_TXRDY		(1 << 1)		/* Transmitter Ready */
> -#define		AT91_DBGU_TXEMPTY	(1 << 9)		/* Transmitter Empty */
> -#define AT91_DBGU_IDR		(0x0c)	/* Interrupt Disable Register */
> -#define AT91_DBGU_IMR		(0x10)	/* Interrupt Mask Register */
> -#define AT91_DBGU_SR		(0x14)	/* Status Register */
> -#define AT91_DBGU_RHR		(0x18)	/* Receiver Holding Register */
> -#define AT91_DBGU_THR		(0x1c)	/* Transmitter Holding Register */
> -#define AT91_DBGU_BRGR		(0x20)	/* Baud Rate Generator Register */
> -
> -#define AT91_DBGU_CIDR		(0x40)	/* Chip ID Register */
> -#define AT91_DBGU_EXID		(0x44)	/* Chip ID Extension Register */
> -#define AT91_DBGU_FNR		(0x48)	/* Force NTRST Register [SAM9 only] */
> -#define		AT91_DBGU_FNTRST	(1 << 0)		/* Force NTRST */
> -
> -/*
> - * Some AT91 parts that don't have full DEBUG units still support the ID
> - * and extensions register.
> - */
> -#define		AT91_CIDR_VERSION	(0x1f << 0)		/* Version of the Device */
> -#define		AT91_CIDR_EPROC		(7    << 5)		/* Embedded Processor */
> -#define		AT91_CIDR_NVPSIZ	(0xf  << 8)		/* Nonvolatile Program Memory Size */
> -#define		AT91_CIDR_NVPSIZ2	(0xf  << 12)		/* Second Nonvolatile Program Memory Size */
> -#define		AT91_CIDR_SRAMSIZ	(0xf  << 16)		/* Internal SRAM Size */
> -#define			AT91_CIDR_SRAMSIZ_1K	(1 << 16)
> -#define			AT91_CIDR_SRAMSIZ_2K	(2 << 16)
> -#define			AT91_CIDR_SRAMSIZ_112K	(4 << 16)
> -#define			AT91_CIDR_SRAMSIZ_4K	(5 << 16)
> -#define			AT91_CIDR_SRAMSIZ_80K	(6 << 16)
> -#define			AT91_CIDR_SRAMSIZ_160K	(7 << 16)
> -#define			AT91_CIDR_SRAMSIZ_8K	(8 << 16)
> -#define			AT91_CIDR_SRAMSIZ_16K	(9 << 16)
> -#define			AT91_CIDR_SRAMSIZ_32K	(10 << 16)
> -#define			AT91_CIDR_SRAMSIZ_64K	(11 << 16)
> -#define			AT91_CIDR_SRAMSIZ_128K	(12 << 16)
> -#define			AT91_CIDR_SRAMSIZ_256K	(13 << 16)
> -#define			AT91_CIDR_SRAMSIZ_96K	(14 << 16)
> -#define			AT91_CIDR_SRAMSIZ_512K	(15 << 16)
> -#define		AT91_CIDR_ARCH		(0xff << 20)		/* Architecture Identifier */
> -#define		AT91_CIDR_NVPTYP	(7    << 28)		/* Nonvolatile Program Memory Type */
> -#define		AT91_CIDR_EXT		(1    << 31)		/* Extension Flag */
> -
> -#endif
> diff --git a/arch/arm/mach-at91/include/mach/at91_ramc.h b/arch/arm/mach-at91/include/mach/at91_ramc.h
> index e4492b151fee..80431ece8a54 100644
> --- a/arch/arm/mach-at91/include/mach/at91_ramc.h
> +++ b/arch/arm/mach-at91/include/mach/at91_ramc.h
> @@ -9,17 +9,11 @@
>  #ifndef __AT91_RAMC_H__
>  #define __AT91_RAMC_H__
>  
> -#ifndef __ASSEMBLY__
> -extern void __iomem *at91_ramc_base[];
> -
>  #define at91_ramc_read(id, field) \
>  	__raw_readl(at91_ramc_base[id] + field)
>  
>  #define at91_ramc_write(id, field, value) \
>  	__raw_writel(value, at91_ramc_base[id] + field)
> -#else
> -.extern at91_ramc_base
> -#endif
>  
>  #define AT91_MEMCTRL_MC		0
>  #define AT91_MEMCTRL_SDRAMC	1
> diff --git a/arch/arm/mach-at91/include/mach/at91sam9_smc.h b/arch/arm/mach-at91/include/mach/at91sam9_smc.h
> index 175e1fdd9fe8..ff54a0ce90e3 100644
> --- a/arch/arm/mach-at91/include/mach/at91sam9_smc.h
> +++ b/arch/arm/mach-at91/include/mach/at91sam9_smc.h
> @@ -16,8 +16,6 @@
>  #ifndef AT91SAM9_SMC_H
>  #define AT91SAM9_SMC_H
>  
> -#include <mach/cpu.h>
> -
>  #ifndef __ASSEMBLY__
>  struct sam9_smc_config {
>  	/* Setup register */
> diff --git a/arch/arm/mach-at91/include/mach/cpu.h b/arch/arm/mach-at91/include/mach/cpu.h
> deleted file mode 100644
> index 61914fb35f5d..000000000000
> --- a/arch/arm/mach-at91/include/mach/cpu.h
> +++ /dev/null
> @@ -1,240 +0,0 @@
> -/*
> - * arch/arm/mach-at91/include/mach/cpu.h
> - *
> - * Copyright (C) 2006 SAN People
> - * Copyright (C) 2011 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> - *
> - * This program is free software; you can redistribute it and/or modify
> - * it under the terms of the GNU General Public License as published by
> - * the Free Software Foundation; either version 2 of the License, or
> - * (at your option) any later version.
> - *
> - */
> -
> -#ifndef __MACH_CPU_H__
> -#define __MACH_CPU_H__
> -
> -#define ARCH_ID_AT91RM9200	0x09290780
> -#define ARCH_ID_AT91SAM9260	0x019803a0
> -#define ARCH_ID_AT91SAM9261	0x019703a0
> -#define ARCH_ID_AT91SAM9263	0x019607a0
> -#define ARCH_ID_AT91SAM9G10	0x019903a0
> -#define ARCH_ID_AT91SAM9G20	0x019905a0
> -#define ARCH_ID_AT91SAM9RL64	0x019b03a0
> -#define ARCH_ID_AT91SAM9G45	0x819b05a0
> -#define ARCH_ID_AT91SAM9G45MRL	0x819b05a2	/* aka 9G45-ES2 & non ES lots */
> -#define ARCH_ID_AT91SAM9G45ES	0x819b05a1	/* 9G45-ES (Engineering Sample) */
> -#define ARCH_ID_AT91SAM9X5	0x819a05a0
> -#define ARCH_ID_AT91SAM9N12	0x819a07a0
> -
> -#define ARCH_ID_AT91SAM9XE128	0x329973a0
> -#define ARCH_ID_AT91SAM9XE256	0x329a93a0
> -#define ARCH_ID_AT91SAM9XE512	0x329aa3a0
> -
> -#define ARCH_ID_AT91M40800	0x14080044
> -#define ARCH_ID_AT91R40807	0x44080746
> -#define ARCH_ID_AT91M40807	0x14080745
> -#define ARCH_ID_AT91R40008	0x44000840
> -
> -#define ARCH_ID_SAMA5		0x8A5C07C0
> -
> -#define ARCH_EXID_AT91SAM9M11	0x00000001
> -#define ARCH_EXID_AT91SAM9M10	0x00000002
> -#define ARCH_EXID_AT91SAM9G46	0x00000003
> -#define ARCH_EXID_AT91SAM9G45	0x00000004
> -
> -#define ARCH_EXID_AT91SAM9G15	0x00000000
> -#define ARCH_EXID_AT91SAM9G35	0x00000001
> -#define ARCH_EXID_AT91SAM9X35	0x00000002
> -#define ARCH_EXID_AT91SAM9G25	0x00000003
> -#define ARCH_EXID_AT91SAM9X25	0x00000004
> -
> -#define ARCH_EXID_SAMA5D3	0x00004300
> -#define ARCH_EXID_SAMA5D31	0x00444300
> -#define ARCH_EXID_SAMA5D33	0x00414300
> -#define ARCH_EXID_SAMA5D34	0x00414301
> -#define ARCH_EXID_SAMA5D35	0x00584300
> -#define ARCH_EXID_SAMA5D36	0x00004301
> -
> -#define ARCH_EXID_SAMA5D4	0x00000007
> -#define ARCH_EXID_SAMA5D41	0x00000001
> -#define ARCH_EXID_SAMA5D42	0x00000002
> -#define ARCH_EXID_SAMA5D43	0x00000003
> -#define ARCH_EXID_SAMA5D44	0x00000004
> -
> -#define ARCH_FAMILY_AT91SAM9	0x01900000
> -#define ARCH_FAMILY_AT91SAM9XE	0x02900000
> -
> -/* RM9200 type */
> -#define ARCH_REVISON_9200_BGA	(0 << 0)
> -#define ARCH_REVISON_9200_PQFP	(1 << 0)
> -
> -#ifndef __ASSEMBLY__
> -enum at91_soc_type {
> -	/* 920T */
> -	AT91_SOC_RM9200,
> -
> -	/* SAM92xx */
> -	AT91_SOC_SAM9260, AT91_SOC_SAM9261, AT91_SOC_SAM9263,
> -
> -	/* SAM9Gxx */
> -	AT91_SOC_SAM9G10, AT91_SOC_SAM9G20, AT91_SOC_SAM9G45,
> -
> -	/* SAM9RL */
> -	AT91_SOC_SAM9RL,
> -
> -	/* SAM9X5 */
> -	AT91_SOC_SAM9X5,
> -
> -	/* SAM9N12 */
> -	AT91_SOC_SAM9N12,
> -
> -	/* SAMA5D3 */
> -	AT91_SOC_SAMA5D3,
> -
> -	/* SAMA5D4 */
> -	AT91_SOC_SAMA5D4,
> -
> -	/* Unknown type */
> -	AT91_SOC_UNKNOWN,
> -};
> -
> -enum at91_soc_subtype {
> -	/* RM9200 */
> -	AT91_SOC_RM9200_BGA, AT91_SOC_RM9200_PQFP,
> -
> -	/* SAM9260 */
> -	AT91_SOC_SAM9XE,
> -
> -	/* SAM9G45 */
> -	AT91_SOC_SAM9G45ES, AT91_SOC_SAM9M10, AT91_SOC_SAM9G46, AT91_SOC_SAM9M11,
> -
> -	/* SAM9X5 */
> -	AT91_SOC_SAM9G15, AT91_SOC_SAM9G35, AT91_SOC_SAM9X35,
> -	AT91_SOC_SAM9G25, AT91_SOC_SAM9X25,
> -
> -	/* SAMA5D3 */
> -	AT91_SOC_SAMA5D31, AT91_SOC_SAMA5D33, AT91_SOC_SAMA5D34,
> -	AT91_SOC_SAMA5D35, AT91_SOC_SAMA5D36,
> -
> -	/* SAMA5D4 */
> -	AT91_SOC_SAMA5D41, AT91_SOC_SAMA5D42, AT91_SOC_SAMA5D43,
> -	AT91_SOC_SAMA5D44,
> -
> -	/* No subtype for this SoC */
> -	AT91_SOC_SUBTYPE_NONE,
> -
> -	/* Unknown subtype */
> -	AT91_SOC_SUBTYPE_UNKNOWN,
> -};
> -
> -struct at91_socinfo {
> -	unsigned int type, subtype;
> -	unsigned int cidr, exid;
> -};
> -
> -extern struct at91_socinfo at91_soc_initdata;
> -const char *at91_get_soc_type(struct at91_socinfo *c);
> -const char *at91_get_soc_subtype(struct at91_socinfo *c);
> -
> -static inline int at91_soc_is_detected(void)
> -{
> -	return at91_soc_initdata.type != AT91_SOC_UNKNOWN;
> -}
> -
> -#ifdef CONFIG_SOC_AT91RM9200
> -#define cpu_is_at91rm9200()	(at91_soc_initdata.type == AT91_SOC_RM9200)
> -#define cpu_is_at91rm9200_bga()	(at91_soc_initdata.subtype == AT91_SOC_RM9200_BGA)
> -#define cpu_is_at91rm9200_pqfp() (at91_soc_initdata.subtype == AT91_SOC_RM9200_PQFP)
> -#else
> -#define cpu_is_at91rm9200()	(0)
> -#define cpu_is_at91rm9200_bga()	(0)
> -#define cpu_is_at91rm9200_pqfp() (0)
> -#endif
> -
> -#ifdef CONFIG_SOC_AT91SAM9260
> -#define cpu_is_at91sam9xe()	(at91_soc_initdata.subtype == AT91_SOC_SAM9XE)
> -#define cpu_is_at91sam9260()	(at91_soc_initdata.type == AT91_SOC_SAM9260)
> -#define cpu_is_at91sam9g20()	(at91_soc_initdata.type == AT91_SOC_SAM9G20)
> -#else
> -#define cpu_is_at91sam9xe()	(0)
> -#define cpu_is_at91sam9260()	(0)
> -#define cpu_is_at91sam9g20()	(0)
> -#endif
> -
> -#ifdef CONFIG_SOC_AT91SAM9261
> -#define cpu_is_at91sam9261()	(at91_soc_initdata.type == AT91_SOC_SAM9261)
> -#define cpu_is_at91sam9g10()	(at91_soc_initdata.type == AT91_SOC_SAM9G10)
> -#else
> -#define cpu_is_at91sam9261()	(0)
> -#define cpu_is_at91sam9g10()	(0)
> -#endif
> -
> -#ifdef CONFIG_SOC_AT91SAM9263
> -#define cpu_is_at91sam9263()	(at91_soc_initdata.type == AT91_SOC_SAM9263)
> -#else
> -#define cpu_is_at91sam9263()	(0)
> -#endif
> -
> -#ifdef CONFIG_SOC_AT91SAM9RL
> -#define cpu_is_at91sam9rl()	(at91_soc_initdata.type == AT91_SOC_SAM9RL)
> -#else
> -#define cpu_is_at91sam9rl()	(0)
> -#endif
> -
> -#ifdef CONFIG_SOC_AT91SAM9G45
> -#define cpu_is_at91sam9g45()	(at91_soc_initdata.type == AT91_SOC_SAM9G45)
> -#define cpu_is_at91sam9g45es()	(at91_soc_initdata.subtype == AT91_SOC_SAM9G45ES)
> -#define cpu_is_at91sam9m10()	(at91_soc_initdata.subtype == AT91_SOC_SAM9M10)
> -#define cpu_is_at91sam9g46()	(at91_soc_initdata.subtype == AT91_SOC_SAM9G46)
> -#define cpu_is_at91sam9m11()	(at91_soc_initdata.subtype == AT91_SOC_SAM9M11)
> -#else
> -#define cpu_is_at91sam9g45()	(0)
> -#define cpu_is_at91sam9g45es()	(0)
> -#define cpu_is_at91sam9m10()	(0)
> -#define cpu_is_at91sam9g46()	(0)
> -#define cpu_is_at91sam9m11()	(0)
> -#endif
> -
> -#ifdef CONFIG_SOC_AT91SAM9X5
> -#define cpu_is_at91sam9x5()	(at91_soc_initdata.type == AT91_SOC_SAM9X5)
> -#define cpu_is_at91sam9g15()	(at91_soc_initdata.subtype == AT91_SOC_SAM9G15)
> -#define cpu_is_at91sam9g35()	(at91_soc_initdata.subtype == AT91_SOC_SAM9G35)
> -#define cpu_is_at91sam9x35()	(at91_soc_initdata.subtype == AT91_SOC_SAM9X35)
> -#define cpu_is_at91sam9g25()	(at91_soc_initdata.subtype == AT91_SOC_SAM9G25)
> -#define cpu_is_at91sam9x25()	(at91_soc_initdata.subtype == AT91_SOC_SAM9X25)
> -#else
> -#define cpu_is_at91sam9x5()	(0)
> -#define cpu_is_at91sam9g15()	(0)
> -#define cpu_is_at91sam9g35()	(0)
> -#define cpu_is_at91sam9x35()	(0)
> -#define cpu_is_at91sam9g25()	(0)
> -#define cpu_is_at91sam9x25()	(0)
> -#endif
> -
> -#ifdef CONFIG_SOC_AT91SAM9N12
> -#define cpu_is_at91sam9n12()	(at91_soc_initdata.type == AT91_SOC_SAM9N12)
> -#else
> -#define cpu_is_at91sam9n12()	(0)
> -#endif
> -
> -#ifdef CONFIG_SOC_SAMA5D3
> -#define cpu_is_sama5d3()	(at91_soc_initdata.type == AT91_SOC_SAMA5D3)
> -#else
> -#define cpu_is_sama5d3()	(0)
> -#endif
> -
> -#ifdef CONFIG_SOC_SAMA5D4
> -#define cpu_is_sama5d4()	(at91_soc_initdata.type == AT91_SOC_SAMA5D4)
> -#else
> -#define cpu_is_sama5d4()	(0)
> -#endif
> -
> -/*
> - * Since this is ARM, we will never run on any AVR32 CPU. But these
> - * definitions may reduce clutter in common drivers.
> - */
> -#define cpu_is_at32ap7000()	(0)
> -#endif /* __ASSEMBLY__ */
> -
> -#endif /* __MACH_CPU_H__ */
> diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c
> index 778f11132b31..11bf992838af 100644
> --- a/arch/arm/mach-at91/pm.c
> +++ b/arch/arm/mach-at91/pm.c
> @@ -19,6 +19,7 @@
>  #include <linux/sysfs.h>
>  #include <linux/module.h>
>  #include <linux/of.h>
> +#include <linux/of_address.h>
>  #include <linux/of_platform.h>
>  #include <linux/platform_device.h>
>  #include <linux/io.h>
> @@ -29,10 +30,12 @@
>  #include <asm/mach/time.h>
>  #include <asm/mach/irq.h>
>  
> -#include <mach/cpu.h>
>  #include <mach/hardware.h>
>  
>  #include "generic.h"
> +
> +static void __iomem *at91_ramc_base[2];
> +
>  #include "pm.h"
>  
>  static struct {
> diff --git a/arch/arm/mach-at91/setup.c b/arch/arm/mach-at91/setup.c
> index 42ebe8d41433..4036e3e0ff96 100644
> --- a/arch/arm/mach-at91/setup.c
> +++ b/arch/arm/mach-at91/setup.c
> @@ -7,321 +7,20 @@
>  
>  #define pr_fmt(fmt)	"AT91: " fmt
>  
> -#include <linux/module.h>
>  #include <linux/io.h>
> -#include <linux/mm.h>
>  #include <linux/pm.h>
>  #include <linux/of_address.h>
> -#include <linux/pinctrl/machine.h>
> -#include <linux/clk/at91_pmc.h>
>  
>  #include <asm/system_misc.h>
> -#include <asm/mach/map.h>
>  
>  #include <mach/hardware.h>
> -#include <mach/cpu.h>
> -#include <mach/at91_dbgu.h>
>  
>  #include "generic.h"
>  #include "pm.h"
>  
> -struct at91_socinfo at91_soc_initdata;
> -EXPORT_SYMBOL(at91_soc_initdata);
> -
>  void __iomem *at91_ramc_base[2];
>  EXPORT_SYMBOL_GPL(at91_ramc_base);
>  
> -static struct map_desc at91_io_desc __initdata __maybe_unused = {
> -	.virtual	= (unsigned long)AT91_VA_BASE_SYS,
> -	.pfn		= __phys_to_pfn(AT91_BASE_SYS),
> -	.length		= SZ_16K,
> -	.type		= MT_DEVICE,
> -};
> -
> -static struct map_desc at91_alt_io_desc __initdata __maybe_unused = {
> -	.virtual	= (unsigned long)AT91_ALT_VA_BASE_SYS,
> -	.pfn		= __phys_to_pfn(AT91_ALT_BASE_SYS),
> -	.length		= 24 * SZ_1K,
> -	.type		= MT_DEVICE,
> -};
> -
> -static void __init soc_detect(u32 dbgu_base)
> -{
> -	u32 cidr, socid;
> -
> -	cidr = __raw_readl(AT91_IO_P2V(dbgu_base) + AT91_DBGU_CIDR);
> -	socid = cidr & ~AT91_CIDR_VERSION;
> -
> -	switch (socid) {
> -	case ARCH_ID_AT91RM9200:
> -		at91_soc_initdata.type = AT91_SOC_RM9200;
> -		if (at91_soc_initdata.subtype == AT91_SOC_SUBTYPE_UNKNOWN)
> -			at91_soc_initdata.subtype = AT91_SOC_RM9200_BGA;
> -		break;
> -
> -	case ARCH_ID_AT91SAM9260:
> -		at91_soc_initdata.type = AT91_SOC_SAM9260;
> -		at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE;
> -		break;
> -
> -	case ARCH_ID_AT91SAM9261:
> -		at91_soc_initdata.type = AT91_SOC_SAM9261;
> -		at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE;
> -		break;
> -
> -	case ARCH_ID_AT91SAM9263:
> -		at91_soc_initdata.type = AT91_SOC_SAM9263;
> -		at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE;
> -		break;
> -
> -	case ARCH_ID_AT91SAM9G20:
> -		at91_soc_initdata.type = AT91_SOC_SAM9G20;
> -		at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE;
> -		break;
> -
> -	case ARCH_ID_AT91SAM9G45:
> -		at91_soc_initdata.type = AT91_SOC_SAM9G45;
> -		if (cidr == ARCH_ID_AT91SAM9G45ES)
> -			at91_soc_initdata.subtype = AT91_SOC_SAM9G45ES;
> -		break;
> -
> -	case ARCH_ID_AT91SAM9RL64:
> -		at91_soc_initdata.type = AT91_SOC_SAM9RL;
> -		at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE;
> -		break;
> -
> -	case ARCH_ID_AT91SAM9X5:
> -		at91_soc_initdata.type = AT91_SOC_SAM9X5;
> -		break;
> -
> -	case ARCH_ID_AT91SAM9N12:
> -		at91_soc_initdata.type = AT91_SOC_SAM9N12;
> -		break;
> -
> -	case ARCH_ID_SAMA5:
> -		at91_soc_initdata.exid = __raw_readl(AT91_IO_P2V(dbgu_base) + AT91_DBGU_EXID);
> -		if (at91_soc_initdata.exid & ARCH_EXID_SAMA5D3) {
> -			at91_soc_initdata.type = AT91_SOC_SAMA5D3;
> -		}
> -		break;
> -	}
> -
> -	/* at91sam9g10 */
> -	if ((socid & ~AT91_CIDR_EXT) == ARCH_ID_AT91SAM9G10) {
> -		at91_soc_initdata.type = AT91_SOC_SAM9G10;
> -		at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE;
> -	}
> -	/* at91sam9xe */
> -	else if ((cidr & AT91_CIDR_ARCH) == ARCH_FAMILY_AT91SAM9XE) {
> -		at91_soc_initdata.type = AT91_SOC_SAM9260;
> -		at91_soc_initdata.subtype = AT91_SOC_SAM9XE;
> -	}
> -
> -	if (!at91_soc_is_detected())
> -		return;
> -
> -	at91_soc_initdata.cidr = cidr;
> -
> -	/* sub version of soc */
> -	if (!at91_soc_initdata.exid)
> -		at91_soc_initdata.exid = __raw_readl(AT91_IO_P2V(dbgu_base) + AT91_DBGU_EXID);
> -
> -	if (at91_soc_initdata.type == AT91_SOC_SAM9G45) {
> -		switch (at91_soc_initdata.exid) {
> -		case ARCH_EXID_AT91SAM9M10:
> -			at91_soc_initdata.subtype = AT91_SOC_SAM9M10;
> -			break;
> -		case ARCH_EXID_AT91SAM9G46:
> -			at91_soc_initdata.subtype = AT91_SOC_SAM9G46;
> -			break;
> -		case ARCH_EXID_AT91SAM9M11:
> -			at91_soc_initdata.subtype = AT91_SOC_SAM9M11;
> -			break;
> -		}
> -	}
> -
> -	if (at91_soc_initdata.type == AT91_SOC_SAM9X5) {
> -		switch (at91_soc_initdata.exid) {
> -		case ARCH_EXID_AT91SAM9G15:
> -			at91_soc_initdata.subtype = AT91_SOC_SAM9G15;
> -			break;
> -		case ARCH_EXID_AT91SAM9G35:
> -			at91_soc_initdata.subtype = AT91_SOC_SAM9G35;
> -			break;
> -		case ARCH_EXID_AT91SAM9X35:
> -			at91_soc_initdata.subtype = AT91_SOC_SAM9X35;
> -			break;
> -		case ARCH_EXID_AT91SAM9G25:
> -			at91_soc_initdata.subtype = AT91_SOC_SAM9G25;
> -			break;
> -		case ARCH_EXID_AT91SAM9X25:
> -			at91_soc_initdata.subtype = AT91_SOC_SAM9X25;
> -			break;
> -		}
> -	}
> -
> -	if (at91_soc_initdata.type == AT91_SOC_SAMA5D3) {
> -		switch (at91_soc_initdata.exid) {
> -		case ARCH_EXID_SAMA5D31:
> -			at91_soc_initdata.subtype = AT91_SOC_SAMA5D31;
> -			break;
> -		case ARCH_EXID_SAMA5D33:
> -			at91_soc_initdata.subtype = AT91_SOC_SAMA5D33;
> -			break;
> -		case ARCH_EXID_SAMA5D34:
> -			at91_soc_initdata.subtype = AT91_SOC_SAMA5D34;
> -			break;
> -		case ARCH_EXID_SAMA5D35:
> -			at91_soc_initdata.subtype = AT91_SOC_SAMA5D35;
> -			break;
> -		case ARCH_EXID_SAMA5D36:
> -			at91_soc_initdata.subtype = AT91_SOC_SAMA5D36;
> -			break;
> -		}
> -	}
> -}
> -
> -static void __init alt_soc_detect(u32 dbgu_base)
> -{
> -	u32 cidr, socid;
> -
> -	/* SoC ID */
> -	cidr = __raw_readl(AT91_ALT_IO_P2V(dbgu_base) + AT91_DBGU_CIDR);
> -	socid = cidr & ~AT91_CIDR_VERSION;
> -
> -	switch (socid) {
> -	case ARCH_ID_SAMA5:
> -		at91_soc_initdata.exid = __raw_readl(AT91_ALT_IO_P2V(dbgu_base) + AT91_DBGU_EXID);
> -		if (at91_soc_initdata.exid & ARCH_EXID_SAMA5D3) {
> -			at91_soc_initdata.type = AT91_SOC_SAMA5D3;
> -		} else if (at91_soc_initdata.exid & ARCH_EXID_SAMA5D4) {
> -			at91_soc_initdata.type = AT91_SOC_SAMA5D4;
> -		}
> -		break;
> -	}
> -
> -	if (!at91_soc_is_detected())
> -		return;
> -
> -	at91_soc_initdata.cidr = cidr;
> -
> -	/* sub version of soc */
> -	if (!at91_soc_initdata.exid)
> -		at91_soc_initdata.exid = __raw_readl(AT91_ALT_IO_P2V(dbgu_base) + AT91_DBGU_EXID);
> -
> -	if (at91_soc_initdata.type == AT91_SOC_SAMA5D4) {
> -		switch (at91_soc_initdata.exid) {
> -		case ARCH_EXID_SAMA5D41:
> -			at91_soc_initdata.subtype = AT91_SOC_SAMA5D41;
> -			break;
> -		case ARCH_EXID_SAMA5D42:
> -			at91_soc_initdata.subtype = AT91_SOC_SAMA5D42;
> -			break;
> -		case ARCH_EXID_SAMA5D43:
> -			at91_soc_initdata.subtype = AT91_SOC_SAMA5D43;
> -			break;
> -		case ARCH_EXID_SAMA5D44:
> -			at91_soc_initdata.subtype = AT91_SOC_SAMA5D44;
> -			break;
> -		}
> -	}
> -}
> -
> -static const char *soc_name[] = {
> -	[AT91_SOC_RM9200]	= "at91rm9200",
> -	[AT91_SOC_SAM9260]	= "at91sam9260",
> -	[AT91_SOC_SAM9261]	= "at91sam9261",
> -	[AT91_SOC_SAM9263]	= "at91sam9263",
> -	[AT91_SOC_SAM9G10]	= "at91sam9g10",
> -	[AT91_SOC_SAM9G20]	= "at91sam9g20",
> -	[AT91_SOC_SAM9G45]	= "at91sam9g45",
> -	[AT91_SOC_SAM9RL]	= "at91sam9rl",
> -	[AT91_SOC_SAM9X5]	= "at91sam9x5",
> -	[AT91_SOC_SAM9N12]	= "at91sam9n12",
> -	[AT91_SOC_SAMA5D3]	= "sama5d3",
> -	[AT91_SOC_SAMA5D4]	= "sama5d4",
> -	[AT91_SOC_UNKNOWN]	= "Unknown",
> -};
> -
> -const char *at91_get_soc_type(struct at91_socinfo *c)
> -{
> -	return soc_name[c->type];
> -}
> -EXPORT_SYMBOL(at91_get_soc_type);
> -
> -static const char *soc_subtype_name[] = {
> -	[AT91_SOC_RM9200_BGA]	= "at91rm9200 BGA",
> -	[AT91_SOC_RM9200_PQFP]	= "at91rm9200 PQFP",
> -	[AT91_SOC_SAM9XE]	= "at91sam9xe",
> -	[AT91_SOC_SAM9G45ES]	= "at91sam9g45es",
> -	[AT91_SOC_SAM9M10]	= "at91sam9m10",
> -	[AT91_SOC_SAM9G46]	= "at91sam9g46",
> -	[AT91_SOC_SAM9M11]	= "at91sam9m11",
> -	[AT91_SOC_SAM9G15]	= "at91sam9g15",
> -	[AT91_SOC_SAM9G35]	= "at91sam9g35",
> -	[AT91_SOC_SAM9X35]	= "at91sam9x35",
> -	[AT91_SOC_SAM9G25]	= "at91sam9g25",
> -	[AT91_SOC_SAM9X25]	= "at91sam9x25",
> -	[AT91_SOC_SAMA5D31]	= "sama5d31",
> -	[AT91_SOC_SAMA5D33]	= "sama5d33",
> -	[AT91_SOC_SAMA5D34]	= "sama5d34",
> -	[AT91_SOC_SAMA5D35]	= "sama5d35",
> -	[AT91_SOC_SAMA5D36]	= "sama5d36",
> -	[AT91_SOC_SAMA5D41]	= "sama5d41",
> -	[AT91_SOC_SAMA5D42]	= "sama5d42",
> -	[AT91_SOC_SAMA5D43]	= "sama5d43",
> -	[AT91_SOC_SAMA5D44]	= "sama5d44",
> -	[AT91_SOC_SUBTYPE_NONE]	= "None",
> -	[AT91_SOC_SUBTYPE_UNKNOWN] = "Unknown",
> -};
> -
> -const char *at91_get_soc_subtype(struct at91_socinfo *c)
> -{
> -	return soc_subtype_name[c->subtype];
> -}
> -EXPORT_SYMBOL(at91_get_soc_subtype);
> -
> -void __init at91_map_io(void)
> -{
> -	/* Map peripherals */
> -	iotable_init(&at91_io_desc, 1);
> -
> -	at91_soc_initdata.type = AT91_SOC_UNKNOWN;
> -	at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_UNKNOWN;
> -
> -	soc_detect(AT91_BASE_DBGU0);
> -	if (!at91_soc_is_detected())
> -		soc_detect(AT91_BASE_DBGU1);
> -
> -	if (!at91_soc_is_detected())
> -		panic(pr_fmt("Impossible to detect the SOC type"));
> -
> -	pr_info("Detected soc type: %s\n",
> -		at91_get_soc_type(&at91_soc_initdata));
> -	if (at91_soc_initdata.subtype != AT91_SOC_SUBTYPE_NONE)
> -		pr_info("Detected soc subtype: %s\n",
> -			at91_get_soc_subtype(&at91_soc_initdata));
> -}
> -
> -void __init at91_alt_map_io(void)
> -{
> -	/* Map peripherals */
> -	iotable_init(&at91_alt_io_desc, 1);
> -
> -	at91_soc_initdata.type = AT91_SOC_UNKNOWN;
> -	at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_UNKNOWN;
> -
> -	alt_soc_detect(AT91_BASE_DBGU2);
> -	if (!at91_soc_is_detected())
> -		panic("AT91: Impossible to detect the SOC type");
> -
> -	pr_info("AT91: Detected soc type: %s\n",
> -		at91_get_soc_type(&at91_soc_initdata));
> -	if (at91_soc_initdata.subtype != AT91_SOC_SUBTYPE_NONE)
> -		pr_info("AT91: Detected soc subtype: %s\n",
> -			at91_get_soc_subtype(&at91_soc_initdata));
> -}
> -
>  static struct of_device_id ramc_ids[] = {
>  	{ .compatible = "atmel,at91rm9200-sdramc", .data = at91rm9200_standby },
>  	{ .compatible = "atmel,at91sam9260-sdramc", .data = at91sam9_sdram_standby },
> 


-- 
Nicolas Ferre

^ permalink raw reply	[flat|nested] 56+ messages in thread

* Re: [PATCH 15/17] ARM: at91: remove old setup
  2015-01-21 16:29     ` Nicolas Ferre
@ 2015-01-21 20:40       ` Alexandre Belloni
  -1 siblings, 0 replies; 56+ messages in thread
From: Alexandre Belloni @ 2015-01-21 20:40 UTC (permalink / raw)
  To: Nicolas Ferre
  Cc: Arnd Bergmann, Jean-Christophe Plagniol-Villard, Boris Brezillon,
	Bo Shen, Wenyou Yang, linux-arm-kernel, linux-kernel

On 21/01/2015 at 17:29:42 +0100, Nicolas Ferre wrote :
> Le 15/01/2015 22:58, Alexandre Belloni a écrit :
> > The old initialization is not used anymore, remove it.
> > Also remove now unused cpu.h and at91_dbgu.h
> > 
> > Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
> > ---
> >  arch/arm/mach-at91/generic.h                   |   4 -
> >  arch/arm/mach-at91/include/mach/at91_dbgu.h    |  63 ------
> >  arch/arm/mach-at91/include/mach/at91_ramc.h    |   6 -
> >  arch/arm/mach-at91/include/mach/at91sam9_smc.h |   2 -
> >  arch/arm/mach-at91/include/mach/cpu.h          | 240 --------------------
> 
> BTW, both at91_dbgu.h and cpu.h are needed for the uncompress.h AT91
> file. I need to re-integrate both of them until this feature is
> completely generalized with multi-platform. Are you okay with this
> modification?
> 

Ok, then remove it along with uncompress.h later. I rebased that branch
too many times, sorry about that.

> >  arch/arm/mach-at91/pm.c                        |   5 +-
> >  arch/arm/mach-at91/setup.c                     | 301 -------------------------
> 
> I'm perfectly fine with removing the old setup code as we have the full
> DT initialization in place.
> This setup code didn't prove it had added any benefit in comparison with
> the usual DT initialization process. Code is much more simpler and clearer.
> 
> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
> 
> I plan to queue these patches really soon on top of my
> at91-3.20-cleanup branch.
> 
> Thanks, bye.
> 
> 
> >  7 files changed, 4 insertions(+), 617 deletions(-)
> >  delete mode 100644 arch/arm/mach-at91/include/mach/at91_dbgu.h
> >  delete mode 100644 arch/arm/mach-at91/include/mach/cpu.h
> > 
> > diff --git a/arch/arm/mach-at91/generic.h b/arch/arm/mach-at91/generic.h
> > index 1e60faec2eba..881e73a27fab 100644
> > --- a/arch/arm/mach-at91/generic.h
> > +++ b/arch/arm/mach-at91/generic.h
> > @@ -14,10 +14,6 @@
> >  #include <linux/of.h>
> >  #include <linux/reboot.h>
> >  
> > - /* Map io */
> > -extern void __init at91_map_io(void);
> > -extern void __init at91_alt_map_io(void);
> > -
> >   /* Processors */
> >  extern void __init at91_dt_initialize(void);
> >  
> > diff --git a/arch/arm/mach-at91/include/mach/at91_dbgu.h b/arch/arm/mach-at91/include/mach/at91_dbgu.h
> > deleted file mode 100644
> > index 42925e8f78e4..000000000000
> > --- a/arch/arm/mach-at91/include/mach/at91_dbgu.h
> > +++ /dev/null
> > @@ -1,63 +0,0 @@
> > -/*
> > - * arch/arm/mach-at91/include/mach/at91_dbgu.h
> > - *
> > - * Copyright (C) 2005 Ivan Kokshaysky
> > - * Copyright (C) SAN People
> > - *
> > - * Debug Unit (DBGU) - System peripherals registers.
> > - * Based on AT91RM9200 datasheet revision E.
> > - *
> > - * This program is free software; you can redistribute it and/or modify
> > - * it under the terms of the GNU General Public License as published by
> > - * the Free Software Foundation; either version 2 of the License, or
> > - * (at your option) any later version.
> > - */
> > -
> > -#ifndef AT91_DBGU_H
> > -#define AT91_DBGU_H
> > -
> > -#define AT91_DBGU_CR		(0x00)	/* Control Register */
> > -#define AT91_DBGU_MR		(0x04)	/* Mode Register */
> > -#define AT91_DBGU_IER		(0x08)	/* Interrupt Enable Register */
> > -#define		AT91_DBGU_TXRDY		(1 << 1)		/* Transmitter Ready */
> > -#define		AT91_DBGU_TXEMPTY	(1 << 9)		/* Transmitter Empty */
> > -#define AT91_DBGU_IDR		(0x0c)	/* Interrupt Disable Register */
> > -#define AT91_DBGU_IMR		(0x10)	/* Interrupt Mask Register */
> > -#define AT91_DBGU_SR		(0x14)	/* Status Register */
> > -#define AT91_DBGU_RHR		(0x18)	/* Receiver Holding Register */
> > -#define AT91_DBGU_THR		(0x1c)	/* Transmitter Holding Register */
> > -#define AT91_DBGU_BRGR		(0x20)	/* Baud Rate Generator Register */
> > -
> > -#define AT91_DBGU_CIDR		(0x40)	/* Chip ID Register */
> > -#define AT91_DBGU_EXID		(0x44)	/* Chip ID Extension Register */
> > -#define AT91_DBGU_FNR		(0x48)	/* Force NTRST Register [SAM9 only] */
> > -#define		AT91_DBGU_FNTRST	(1 << 0)		/* Force NTRST */
> > -
> > -/*
> > - * Some AT91 parts that don't have full DEBUG units still support the ID
> > - * and extensions register.
> > - */
> > -#define		AT91_CIDR_VERSION	(0x1f << 0)		/* Version of the Device */
> > -#define		AT91_CIDR_EPROC		(7    << 5)		/* Embedded Processor */
> > -#define		AT91_CIDR_NVPSIZ	(0xf  << 8)		/* Nonvolatile Program Memory Size */
> > -#define		AT91_CIDR_NVPSIZ2	(0xf  << 12)		/* Second Nonvolatile Program Memory Size */
> > -#define		AT91_CIDR_SRAMSIZ	(0xf  << 16)		/* Internal SRAM Size */
> > -#define			AT91_CIDR_SRAMSIZ_1K	(1 << 16)
> > -#define			AT91_CIDR_SRAMSIZ_2K	(2 << 16)
> > -#define			AT91_CIDR_SRAMSIZ_112K	(4 << 16)
> > -#define			AT91_CIDR_SRAMSIZ_4K	(5 << 16)
> > -#define			AT91_CIDR_SRAMSIZ_80K	(6 << 16)
> > -#define			AT91_CIDR_SRAMSIZ_160K	(7 << 16)
> > -#define			AT91_CIDR_SRAMSIZ_8K	(8 << 16)
> > -#define			AT91_CIDR_SRAMSIZ_16K	(9 << 16)
> > -#define			AT91_CIDR_SRAMSIZ_32K	(10 << 16)
> > -#define			AT91_CIDR_SRAMSIZ_64K	(11 << 16)
> > -#define			AT91_CIDR_SRAMSIZ_128K	(12 << 16)
> > -#define			AT91_CIDR_SRAMSIZ_256K	(13 << 16)
> > -#define			AT91_CIDR_SRAMSIZ_96K	(14 << 16)
> > -#define			AT91_CIDR_SRAMSIZ_512K	(15 << 16)
> > -#define		AT91_CIDR_ARCH		(0xff << 20)		/* Architecture Identifier */
> > -#define		AT91_CIDR_NVPTYP	(7    << 28)		/* Nonvolatile Program Memory Type */
> > -#define		AT91_CIDR_EXT		(1    << 31)		/* Extension Flag */
> > -
> > -#endif
> > diff --git a/arch/arm/mach-at91/include/mach/at91_ramc.h b/arch/arm/mach-at91/include/mach/at91_ramc.h
> > index e4492b151fee..80431ece8a54 100644
> > --- a/arch/arm/mach-at91/include/mach/at91_ramc.h
> > +++ b/arch/arm/mach-at91/include/mach/at91_ramc.h
> > @@ -9,17 +9,11 @@
> >  #ifndef __AT91_RAMC_H__
> >  #define __AT91_RAMC_H__
> >  
> > -#ifndef __ASSEMBLY__
> > -extern void __iomem *at91_ramc_base[];
> > -
> >  #define at91_ramc_read(id, field) \
> >  	__raw_readl(at91_ramc_base[id] + field)
> >  
> >  #define at91_ramc_write(id, field, value) \
> >  	__raw_writel(value, at91_ramc_base[id] + field)
> > -#else
> > -.extern at91_ramc_base
> > -#endif
> >  
> >  #define AT91_MEMCTRL_MC		0
> >  #define AT91_MEMCTRL_SDRAMC	1
> > diff --git a/arch/arm/mach-at91/include/mach/at91sam9_smc.h b/arch/arm/mach-at91/include/mach/at91sam9_smc.h
> > index 175e1fdd9fe8..ff54a0ce90e3 100644
> > --- a/arch/arm/mach-at91/include/mach/at91sam9_smc.h
> > +++ b/arch/arm/mach-at91/include/mach/at91sam9_smc.h
> > @@ -16,8 +16,6 @@
> >  #ifndef AT91SAM9_SMC_H
> >  #define AT91SAM9_SMC_H
> >  
> > -#include <mach/cpu.h>
> > -
> >  #ifndef __ASSEMBLY__
> >  struct sam9_smc_config {
> >  	/* Setup register */
> > diff --git a/arch/arm/mach-at91/include/mach/cpu.h b/arch/arm/mach-at91/include/mach/cpu.h
> > deleted file mode 100644
> > index 61914fb35f5d..000000000000
> > --- a/arch/arm/mach-at91/include/mach/cpu.h
> > +++ /dev/null
> > @@ -1,240 +0,0 @@
> > -/*
> > - * arch/arm/mach-at91/include/mach/cpu.h
> > - *
> > - * Copyright (C) 2006 SAN People
> > - * Copyright (C) 2011 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> > - *
> > - * This program is free software; you can redistribute it and/or modify
> > - * it under the terms of the GNU General Public License as published by
> > - * the Free Software Foundation; either version 2 of the License, or
> > - * (at your option) any later version.
> > - *
> > - */
> > -
> > -#ifndef __MACH_CPU_H__
> > -#define __MACH_CPU_H__
> > -
> > -#define ARCH_ID_AT91RM9200	0x09290780
> > -#define ARCH_ID_AT91SAM9260	0x019803a0
> > -#define ARCH_ID_AT91SAM9261	0x019703a0
> > -#define ARCH_ID_AT91SAM9263	0x019607a0
> > -#define ARCH_ID_AT91SAM9G10	0x019903a0
> > -#define ARCH_ID_AT91SAM9G20	0x019905a0
> > -#define ARCH_ID_AT91SAM9RL64	0x019b03a0
> > -#define ARCH_ID_AT91SAM9G45	0x819b05a0
> > -#define ARCH_ID_AT91SAM9G45MRL	0x819b05a2	/* aka 9G45-ES2 & non ES lots */
> > -#define ARCH_ID_AT91SAM9G45ES	0x819b05a1	/* 9G45-ES (Engineering Sample) */
> > -#define ARCH_ID_AT91SAM9X5	0x819a05a0
> > -#define ARCH_ID_AT91SAM9N12	0x819a07a0
> > -
> > -#define ARCH_ID_AT91SAM9XE128	0x329973a0
> > -#define ARCH_ID_AT91SAM9XE256	0x329a93a0
> > -#define ARCH_ID_AT91SAM9XE512	0x329aa3a0
> > -
> > -#define ARCH_ID_AT91M40800	0x14080044
> > -#define ARCH_ID_AT91R40807	0x44080746
> > -#define ARCH_ID_AT91M40807	0x14080745
> > -#define ARCH_ID_AT91R40008	0x44000840
> > -
> > -#define ARCH_ID_SAMA5		0x8A5C07C0
> > -
> > -#define ARCH_EXID_AT91SAM9M11	0x00000001
> > -#define ARCH_EXID_AT91SAM9M10	0x00000002
> > -#define ARCH_EXID_AT91SAM9G46	0x00000003
> > -#define ARCH_EXID_AT91SAM9G45	0x00000004
> > -
> > -#define ARCH_EXID_AT91SAM9G15	0x00000000
> > -#define ARCH_EXID_AT91SAM9G35	0x00000001
> > -#define ARCH_EXID_AT91SAM9X35	0x00000002
> > -#define ARCH_EXID_AT91SAM9G25	0x00000003
> > -#define ARCH_EXID_AT91SAM9X25	0x00000004
> > -
> > -#define ARCH_EXID_SAMA5D3	0x00004300
> > -#define ARCH_EXID_SAMA5D31	0x00444300
> > -#define ARCH_EXID_SAMA5D33	0x00414300
> > -#define ARCH_EXID_SAMA5D34	0x00414301
> > -#define ARCH_EXID_SAMA5D35	0x00584300
> > -#define ARCH_EXID_SAMA5D36	0x00004301
> > -
> > -#define ARCH_EXID_SAMA5D4	0x00000007
> > -#define ARCH_EXID_SAMA5D41	0x00000001
> > -#define ARCH_EXID_SAMA5D42	0x00000002
> > -#define ARCH_EXID_SAMA5D43	0x00000003
> > -#define ARCH_EXID_SAMA5D44	0x00000004
> > -
> > -#define ARCH_FAMILY_AT91SAM9	0x01900000
> > -#define ARCH_FAMILY_AT91SAM9XE	0x02900000
> > -
> > -/* RM9200 type */
> > -#define ARCH_REVISON_9200_BGA	(0 << 0)
> > -#define ARCH_REVISON_9200_PQFP	(1 << 0)
> > -
> > -#ifndef __ASSEMBLY__
> > -enum at91_soc_type {
> > -	/* 920T */
> > -	AT91_SOC_RM9200,
> > -
> > -	/* SAM92xx */
> > -	AT91_SOC_SAM9260, AT91_SOC_SAM9261, AT91_SOC_SAM9263,
> > -
> > -	/* SAM9Gxx */
> > -	AT91_SOC_SAM9G10, AT91_SOC_SAM9G20, AT91_SOC_SAM9G45,
> > -
> > -	/* SAM9RL */
> > -	AT91_SOC_SAM9RL,
> > -
> > -	/* SAM9X5 */
> > -	AT91_SOC_SAM9X5,
> > -
> > -	/* SAM9N12 */
> > -	AT91_SOC_SAM9N12,
> > -
> > -	/* SAMA5D3 */
> > -	AT91_SOC_SAMA5D3,
> > -
> > -	/* SAMA5D4 */
> > -	AT91_SOC_SAMA5D4,
> > -
> > -	/* Unknown type */
> > -	AT91_SOC_UNKNOWN,
> > -};
> > -
> > -enum at91_soc_subtype {
> > -	/* RM9200 */
> > -	AT91_SOC_RM9200_BGA, AT91_SOC_RM9200_PQFP,
> > -
> > -	/* SAM9260 */
> > -	AT91_SOC_SAM9XE,
> > -
> > -	/* SAM9G45 */
> > -	AT91_SOC_SAM9G45ES, AT91_SOC_SAM9M10, AT91_SOC_SAM9G46, AT91_SOC_SAM9M11,
> > -
> > -	/* SAM9X5 */
> > -	AT91_SOC_SAM9G15, AT91_SOC_SAM9G35, AT91_SOC_SAM9X35,
> > -	AT91_SOC_SAM9G25, AT91_SOC_SAM9X25,
> > -
> > -	/* SAMA5D3 */
> > -	AT91_SOC_SAMA5D31, AT91_SOC_SAMA5D33, AT91_SOC_SAMA5D34,
> > -	AT91_SOC_SAMA5D35, AT91_SOC_SAMA5D36,
> > -
> > -	/* SAMA5D4 */
> > -	AT91_SOC_SAMA5D41, AT91_SOC_SAMA5D42, AT91_SOC_SAMA5D43,
> > -	AT91_SOC_SAMA5D44,
> > -
> > -	/* No subtype for this SoC */
> > -	AT91_SOC_SUBTYPE_NONE,
> > -
> > -	/* Unknown subtype */
> > -	AT91_SOC_SUBTYPE_UNKNOWN,
> > -};
> > -
> > -struct at91_socinfo {
> > -	unsigned int type, subtype;
> > -	unsigned int cidr, exid;
> > -};
> > -
> > -extern struct at91_socinfo at91_soc_initdata;
> > -const char *at91_get_soc_type(struct at91_socinfo *c);
> > -const char *at91_get_soc_subtype(struct at91_socinfo *c);
> > -
> > -static inline int at91_soc_is_detected(void)
> > -{
> > -	return at91_soc_initdata.type != AT91_SOC_UNKNOWN;
> > -}
> > -
> > -#ifdef CONFIG_SOC_AT91RM9200
> > -#define cpu_is_at91rm9200()	(at91_soc_initdata.type == AT91_SOC_RM9200)
> > -#define cpu_is_at91rm9200_bga()	(at91_soc_initdata.subtype == AT91_SOC_RM9200_BGA)
> > -#define cpu_is_at91rm9200_pqfp() (at91_soc_initdata.subtype == AT91_SOC_RM9200_PQFP)
> > -#else
> > -#define cpu_is_at91rm9200()	(0)
> > -#define cpu_is_at91rm9200_bga()	(0)
> > -#define cpu_is_at91rm9200_pqfp() (0)
> > -#endif
> > -
> > -#ifdef CONFIG_SOC_AT91SAM9260
> > -#define cpu_is_at91sam9xe()	(at91_soc_initdata.subtype == AT91_SOC_SAM9XE)
> > -#define cpu_is_at91sam9260()	(at91_soc_initdata.type == AT91_SOC_SAM9260)
> > -#define cpu_is_at91sam9g20()	(at91_soc_initdata.type == AT91_SOC_SAM9G20)
> > -#else
> > -#define cpu_is_at91sam9xe()	(0)
> > -#define cpu_is_at91sam9260()	(0)
> > -#define cpu_is_at91sam9g20()	(0)
> > -#endif
> > -
> > -#ifdef CONFIG_SOC_AT91SAM9261
> > -#define cpu_is_at91sam9261()	(at91_soc_initdata.type == AT91_SOC_SAM9261)
> > -#define cpu_is_at91sam9g10()	(at91_soc_initdata.type == AT91_SOC_SAM9G10)
> > -#else
> > -#define cpu_is_at91sam9261()	(0)
> > -#define cpu_is_at91sam9g10()	(0)
> > -#endif
> > -
> > -#ifdef CONFIG_SOC_AT91SAM9263
> > -#define cpu_is_at91sam9263()	(at91_soc_initdata.type == AT91_SOC_SAM9263)
> > -#else
> > -#define cpu_is_at91sam9263()	(0)
> > -#endif
> > -
> > -#ifdef CONFIG_SOC_AT91SAM9RL
> > -#define cpu_is_at91sam9rl()	(at91_soc_initdata.type == AT91_SOC_SAM9RL)
> > -#else
> > -#define cpu_is_at91sam9rl()	(0)
> > -#endif
> > -
> > -#ifdef CONFIG_SOC_AT91SAM9G45
> > -#define cpu_is_at91sam9g45()	(at91_soc_initdata.type == AT91_SOC_SAM9G45)
> > -#define cpu_is_at91sam9g45es()	(at91_soc_initdata.subtype == AT91_SOC_SAM9G45ES)
> > -#define cpu_is_at91sam9m10()	(at91_soc_initdata.subtype == AT91_SOC_SAM9M10)
> > -#define cpu_is_at91sam9g46()	(at91_soc_initdata.subtype == AT91_SOC_SAM9G46)
> > -#define cpu_is_at91sam9m11()	(at91_soc_initdata.subtype == AT91_SOC_SAM9M11)
> > -#else
> > -#define cpu_is_at91sam9g45()	(0)
> > -#define cpu_is_at91sam9g45es()	(0)
> > -#define cpu_is_at91sam9m10()	(0)
> > -#define cpu_is_at91sam9g46()	(0)
> > -#define cpu_is_at91sam9m11()	(0)
> > -#endif
> > -
> > -#ifdef CONFIG_SOC_AT91SAM9X5
> > -#define cpu_is_at91sam9x5()	(at91_soc_initdata.type == AT91_SOC_SAM9X5)
> > -#define cpu_is_at91sam9g15()	(at91_soc_initdata.subtype == AT91_SOC_SAM9G15)
> > -#define cpu_is_at91sam9g35()	(at91_soc_initdata.subtype == AT91_SOC_SAM9G35)
> > -#define cpu_is_at91sam9x35()	(at91_soc_initdata.subtype == AT91_SOC_SAM9X35)
> > -#define cpu_is_at91sam9g25()	(at91_soc_initdata.subtype == AT91_SOC_SAM9G25)
> > -#define cpu_is_at91sam9x25()	(at91_soc_initdata.subtype == AT91_SOC_SAM9X25)
> > -#else
> > -#define cpu_is_at91sam9x5()	(0)
> > -#define cpu_is_at91sam9g15()	(0)
> > -#define cpu_is_at91sam9g35()	(0)
> > -#define cpu_is_at91sam9x35()	(0)
> > -#define cpu_is_at91sam9g25()	(0)
> > -#define cpu_is_at91sam9x25()	(0)
> > -#endif
> > -
> > -#ifdef CONFIG_SOC_AT91SAM9N12
> > -#define cpu_is_at91sam9n12()	(at91_soc_initdata.type == AT91_SOC_SAM9N12)
> > -#else
> > -#define cpu_is_at91sam9n12()	(0)
> > -#endif
> > -
> > -#ifdef CONFIG_SOC_SAMA5D3
> > -#define cpu_is_sama5d3()	(at91_soc_initdata.type == AT91_SOC_SAMA5D3)
> > -#else
> > -#define cpu_is_sama5d3()	(0)
> > -#endif
> > -
> > -#ifdef CONFIG_SOC_SAMA5D4
> > -#define cpu_is_sama5d4()	(at91_soc_initdata.type == AT91_SOC_SAMA5D4)
> > -#else
> > -#define cpu_is_sama5d4()	(0)
> > -#endif
> > -
> > -/*
> > - * Since this is ARM, we will never run on any AVR32 CPU. But these
> > - * definitions may reduce clutter in common drivers.
> > - */
> > -#define cpu_is_at32ap7000()	(0)
> > -#endif /* __ASSEMBLY__ */
> > -
> > -#endif /* __MACH_CPU_H__ */
> > diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c
> > index 778f11132b31..11bf992838af 100644
> > --- a/arch/arm/mach-at91/pm.c
> > +++ b/arch/arm/mach-at91/pm.c
> > @@ -19,6 +19,7 @@
> >  #include <linux/sysfs.h>
> >  #include <linux/module.h>
> >  #include <linux/of.h>
> > +#include <linux/of_address.h>
> >  #include <linux/of_platform.h>
> >  #include <linux/platform_device.h>
> >  #include <linux/io.h>
> > @@ -29,10 +30,12 @@
> >  #include <asm/mach/time.h>
> >  #include <asm/mach/irq.h>
> >  
> > -#include <mach/cpu.h>
> >  #include <mach/hardware.h>
> >  
> >  #include "generic.h"
> > +
> > +static void __iomem *at91_ramc_base[2];
> > +
> >  #include "pm.h"
> >  
> >  static struct {
> > diff --git a/arch/arm/mach-at91/setup.c b/arch/arm/mach-at91/setup.c
> > index 42ebe8d41433..4036e3e0ff96 100644
> > --- a/arch/arm/mach-at91/setup.c
> > +++ b/arch/arm/mach-at91/setup.c
> > @@ -7,321 +7,20 @@
> >  
> >  #define pr_fmt(fmt)	"AT91: " fmt
> >  
> > -#include <linux/module.h>
> >  #include <linux/io.h>
> > -#include <linux/mm.h>
> >  #include <linux/pm.h>
> >  #include <linux/of_address.h>
> > -#include <linux/pinctrl/machine.h>
> > -#include <linux/clk/at91_pmc.h>
> >  
> >  #include <asm/system_misc.h>
> > -#include <asm/mach/map.h>
> >  
> >  #include <mach/hardware.h>
> > -#include <mach/cpu.h>
> > -#include <mach/at91_dbgu.h>
> >  
> >  #include "generic.h"
> >  #include "pm.h"
> >  
> > -struct at91_socinfo at91_soc_initdata;
> > -EXPORT_SYMBOL(at91_soc_initdata);
> > -
> >  void __iomem *at91_ramc_base[2];
> >  EXPORT_SYMBOL_GPL(at91_ramc_base);
> >  
> > -static struct map_desc at91_io_desc __initdata __maybe_unused = {
> > -	.virtual	= (unsigned long)AT91_VA_BASE_SYS,
> > -	.pfn		= __phys_to_pfn(AT91_BASE_SYS),
> > -	.length		= SZ_16K,
> > -	.type		= MT_DEVICE,
> > -};
> > -
> > -static struct map_desc at91_alt_io_desc __initdata __maybe_unused = {
> > -	.virtual	= (unsigned long)AT91_ALT_VA_BASE_SYS,
> > -	.pfn		= __phys_to_pfn(AT91_ALT_BASE_SYS),
> > -	.length		= 24 * SZ_1K,
> > -	.type		= MT_DEVICE,
> > -};
> > -
> > -static void __init soc_detect(u32 dbgu_base)
> > -{
> > -	u32 cidr, socid;
> > -
> > -	cidr = __raw_readl(AT91_IO_P2V(dbgu_base) + AT91_DBGU_CIDR);
> > -	socid = cidr & ~AT91_CIDR_VERSION;
> > -
> > -	switch (socid) {
> > -	case ARCH_ID_AT91RM9200:
> > -		at91_soc_initdata.type = AT91_SOC_RM9200;
> > -		if (at91_soc_initdata.subtype == AT91_SOC_SUBTYPE_UNKNOWN)
> > -			at91_soc_initdata.subtype = AT91_SOC_RM9200_BGA;
> > -		break;
> > -
> > -	case ARCH_ID_AT91SAM9260:
> > -		at91_soc_initdata.type = AT91_SOC_SAM9260;
> > -		at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE;
> > -		break;
> > -
> > -	case ARCH_ID_AT91SAM9261:
> > -		at91_soc_initdata.type = AT91_SOC_SAM9261;
> > -		at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE;
> > -		break;
> > -
> > -	case ARCH_ID_AT91SAM9263:
> > -		at91_soc_initdata.type = AT91_SOC_SAM9263;
> > -		at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE;
> > -		break;
> > -
> > -	case ARCH_ID_AT91SAM9G20:
> > -		at91_soc_initdata.type = AT91_SOC_SAM9G20;
> > -		at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE;
> > -		break;
> > -
> > -	case ARCH_ID_AT91SAM9G45:
> > -		at91_soc_initdata.type = AT91_SOC_SAM9G45;
> > -		if (cidr == ARCH_ID_AT91SAM9G45ES)
> > -			at91_soc_initdata.subtype = AT91_SOC_SAM9G45ES;
> > -		break;
> > -
> > -	case ARCH_ID_AT91SAM9RL64:
> > -		at91_soc_initdata.type = AT91_SOC_SAM9RL;
> > -		at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE;
> > -		break;
> > -
> > -	case ARCH_ID_AT91SAM9X5:
> > -		at91_soc_initdata.type = AT91_SOC_SAM9X5;
> > -		break;
> > -
> > -	case ARCH_ID_AT91SAM9N12:
> > -		at91_soc_initdata.type = AT91_SOC_SAM9N12;
> > -		break;
> > -
> > -	case ARCH_ID_SAMA5:
> > -		at91_soc_initdata.exid = __raw_readl(AT91_IO_P2V(dbgu_base) + AT91_DBGU_EXID);
> > -		if (at91_soc_initdata.exid & ARCH_EXID_SAMA5D3) {
> > -			at91_soc_initdata.type = AT91_SOC_SAMA5D3;
> > -		}
> > -		break;
> > -	}
> > -
> > -	/* at91sam9g10 */
> > -	if ((socid & ~AT91_CIDR_EXT) == ARCH_ID_AT91SAM9G10) {
> > -		at91_soc_initdata.type = AT91_SOC_SAM9G10;
> > -		at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE;
> > -	}
> > -	/* at91sam9xe */
> > -	else if ((cidr & AT91_CIDR_ARCH) == ARCH_FAMILY_AT91SAM9XE) {
> > -		at91_soc_initdata.type = AT91_SOC_SAM9260;
> > -		at91_soc_initdata.subtype = AT91_SOC_SAM9XE;
> > -	}
> > -
> > -	if (!at91_soc_is_detected())
> > -		return;
> > -
> > -	at91_soc_initdata.cidr = cidr;
> > -
> > -	/* sub version of soc */
> > -	if (!at91_soc_initdata.exid)
> > -		at91_soc_initdata.exid = __raw_readl(AT91_IO_P2V(dbgu_base) + AT91_DBGU_EXID);
> > -
> > -	if (at91_soc_initdata.type == AT91_SOC_SAM9G45) {
> > -		switch (at91_soc_initdata.exid) {
> > -		case ARCH_EXID_AT91SAM9M10:
> > -			at91_soc_initdata.subtype = AT91_SOC_SAM9M10;
> > -			break;
> > -		case ARCH_EXID_AT91SAM9G46:
> > -			at91_soc_initdata.subtype = AT91_SOC_SAM9G46;
> > -			break;
> > -		case ARCH_EXID_AT91SAM9M11:
> > -			at91_soc_initdata.subtype = AT91_SOC_SAM9M11;
> > -			break;
> > -		}
> > -	}
> > -
> > -	if (at91_soc_initdata.type == AT91_SOC_SAM9X5) {
> > -		switch (at91_soc_initdata.exid) {
> > -		case ARCH_EXID_AT91SAM9G15:
> > -			at91_soc_initdata.subtype = AT91_SOC_SAM9G15;
> > -			break;
> > -		case ARCH_EXID_AT91SAM9G35:
> > -			at91_soc_initdata.subtype = AT91_SOC_SAM9G35;
> > -			break;
> > -		case ARCH_EXID_AT91SAM9X35:
> > -			at91_soc_initdata.subtype = AT91_SOC_SAM9X35;
> > -			break;
> > -		case ARCH_EXID_AT91SAM9G25:
> > -			at91_soc_initdata.subtype = AT91_SOC_SAM9G25;
> > -			break;
> > -		case ARCH_EXID_AT91SAM9X25:
> > -			at91_soc_initdata.subtype = AT91_SOC_SAM9X25;
> > -			break;
> > -		}
> > -	}
> > -
> > -	if (at91_soc_initdata.type == AT91_SOC_SAMA5D3) {
> > -		switch (at91_soc_initdata.exid) {
> > -		case ARCH_EXID_SAMA5D31:
> > -			at91_soc_initdata.subtype = AT91_SOC_SAMA5D31;
> > -			break;
> > -		case ARCH_EXID_SAMA5D33:
> > -			at91_soc_initdata.subtype = AT91_SOC_SAMA5D33;
> > -			break;
> > -		case ARCH_EXID_SAMA5D34:
> > -			at91_soc_initdata.subtype = AT91_SOC_SAMA5D34;
> > -			break;
> > -		case ARCH_EXID_SAMA5D35:
> > -			at91_soc_initdata.subtype = AT91_SOC_SAMA5D35;
> > -			break;
> > -		case ARCH_EXID_SAMA5D36:
> > -			at91_soc_initdata.subtype = AT91_SOC_SAMA5D36;
> > -			break;
> > -		}
> > -	}
> > -}
> > -
> > -static void __init alt_soc_detect(u32 dbgu_base)
> > -{
> > -	u32 cidr, socid;
> > -
> > -	/* SoC ID */
> > -	cidr = __raw_readl(AT91_ALT_IO_P2V(dbgu_base) + AT91_DBGU_CIDR);
> > -	socid = cidr & ~AT91_CIDR_VERSION;
> > -
> > -	switch (socid) {
> > -	case ARCH_ID_SAMA5:
> > -		at91_soc_initdata.exid = __raw_readl(AT91_ALT_IO_P2V(dbgu_base) + AT91_DBGU_EXID);
> > -		if (at91_soc_initdata.exid & ARCH_EXID_SAMA5D3) {
> > -			at91_soc_initdata.type = AT91_SOC_SAMA5D3;
> > -		} else if (at91_soc_initdata.exid & ARCH_EXID_SAMA5D4) {
> > -			at91_soc_initdata.type = AT91_SOC_SAMA5D4;
> > -		}
> > -		break;
> > -	}
> > -
> > -	if (!at91_soc_is_detected())
> > -		return;
> > -
> > -	at91_soc_initdata.cidr = cidr;
> > -
> > -	/* sub version of soc */
> > -	if (!at91_soc_initdata.exid)
> > -		at91_soc_initdata.exid = __raw_readl(AT91_ALT_IO_P2V(dbgu_base) + AT91_DBGU_EXID);
> > -
> > -	if (at91_soc_initdata.type == AT91_SOC_SAMA5D4) {
> > -		switch (at91_soc_initdata.exid) {
> > -		case ARCH_EXID_SAMA5D41:
> > -			at91_soc_initdata.subtype = AT91_SOC_SAMA5D41;
> > -			break;
> > -		case ARCH_EXID_SAMA5D42:
> > -			at91_soc_initdata.subtype = AT91_SOC_SAMA5D42;
> > -			break;
> > -		case ARCH_EXID_SAMA5D43:
> > -			at91_soc_initdata.subtype = AT91_SOC_SAMA5D43;
> > -			break;
> > -		case ARCH_EXID_SAMA5D44:
> > -			at91_soc_initdata.subtype = AT91_SOC_SAMA5D44;
> > -			break;
> > -		}
> > -	}
> > -}
> > -
> > -static const char *soc_name[] = {
> > -	[AT91_SOC_RM9200]	= "at91rm9200",
> > -	[AT91_SOC_SAM9260]	= "at91sam9260",
> > -	[AT91_SOC_SAM9261]	= "at91sam9261",
> > -	[AT91_SOC_SAM9263]	= "at91sam9263",
> > -	[AT91_SOC_SAM9G10]	= "at91sam9g10",
> > -	[AT91_SOC_SAM9G20]	= "at91sam9g20",
> > -	[AT91_SOC_SAM9G45]	= "at91sam9g45",
> > -	[AT91_SOC_SAM9RL]	= "at91sam9rl",
> > -	[AT91_SOC_SAM9X5]	= "at91sam9x5",
> > -	[AT91_SOC_SAM9N12]	= "at91sam9n12",
> > -	[AT91_SOC_SAMA5D3]	= "sama5d3",
> > -	[AT91_SOC_SAMA5D4]	= "sama5d4",
> > -	[AT91_SOC_UNKNOWN]	= "Unknown",
> > -};
> > -
> > -const char *at91_get_soc_type(struct at91_socinfo *c)
> > -{
> > -	return soc_name[c->type];
> > -}
> > -EXPORT_SYMBOL(at91_get_soc_type);
> > -
> > -static const char *soc_subtype_name[] = {
> > -	[AT91_SOC_RM9200_BGA]	= "at91rm9200 BGA",
> > -	[AT91_SOC_RM9200_PQFP]	= "at91rm9200 PQFP",
> > -	[AT91_SOC_SAM9XE]	= "at91sam9xe",
> > -	[AT91_SOC_SAM9G45ES]	= "at91sam9g45es",
> > -	[AT91_SOC_SAM9M10]	= "at91sam9m10",
> > -	[AT91_SOC_SAM9G46]	= "at91sam9g46",
> > -	[AT91_SOC_SAM9M11]	= "at91sam9m11",
> > -	[AT91_SOC_SAM9G15]	= "at91sam9g15",
> > -	[AT91_SOC_SAM9G35]	= "at91sam9g35",
> > -	[AT91_SOC_SAM9X35]	= "at91sam9x35",
> > -	[AT91_SOC_SAM9G25]	= "at91sam9g25",
> > -	[AT91_SOC_SAM9X25]	= "at91sam9x25",
> > -	[AT91_SOC_SAMA5D31]	= "sama5d31",
> > -	[AT91_SOC_SAMA5D33]	= "sama5d33",
> > -	[AT91_SOC_SAMA5D34]	= "sama5d34",
> > -	[AT91_SOC_SAMA5D35]	= "sama5d35",
> > -	[AT91_SOC_SAMA5D36]	= "sama5d36",
> > -	[AT91_SOC_SAMA5D41]	= "sama5d41",
> > -	[AT91_SOC_SAMA5D42]	= "sama5d42",
> > -	[AT91_SOC_SAMA5D43]	= "sama5d43",
> > -	[AT91_SOC_SAMA5D44]	= "sama5d44",
> > -	[AT91_SOC_SUBTYPE_NONE]	= "None",
> > -	[AT91_SOC_SUBTYPE_UNKNOWN] = "Unknown",
> > -};
> > -
> > -const char *at91_get_soc_subtype(struct at91_socinfo *c)
> > -{
> > -	return soc_subtype_name[c->subtype];
> > -}
> > -EXPORT_SYMBOL(at91_get_soc_subtype);
> > -
> > -void __init at91_map_io(void)
> > -{
> > -	/* Map peripherals */
> > -	iotable_init(&at91_io_desc, 1);
> > -
> > -	at91_soc_initdata.type = AT91_SOC_UNKNOWN;
> > -	at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_UNKNOWN;
> > -
> > -	soc_detect(AT91_BASE_DBGU0);
> > -	if (!at91_soc_is_detected())
> > -		soc_detect(AT91_BASE_DBGU1);
> > -
> > -	if (!at91_soc_is_detected())
> > -		panic(pr_fmt("Impossible to detect the SOC type"));
> > -
> > -	pr_info("Detected soc type: %s\n",
> > -		at91_get_soc_type(&at91_soc_initdata));
> > -	if (at91_soc_initdata.subtype != AT91_SOC_SUBTYPE_NONE)
> > -		pr_info("Detected soc subtype: %s\n",
> > -			at91_get_soc_subtype(&at91_soc_initdata));
> > -}
> > -
> > -void __init at91_alt_map_io(void)
> > -{
> > -	/* Map peripherals */
> > -	iotable_init(&at91_alt_io_desc, 1);
> > -
> > -	at91_soc_initdata.type = AT91_SOC_UNKNOWN;
> > -	at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_UNKNOWN;
> > -
> > -	alt_soc_detect(AT91_BASE_DBGU2);
> > -	if (!at91_soc_is_detected())
> > -		panic("AT91: Impossible to detect the SOC type");
> > -
> > -	pr_info("AT91: Detected soc type: %s\n",
> > -		at91_get_soc_type(&at91_soc_initdata));
> > -	if (at91_soc_initdata.subtype != AT91_SOC_SUBTYPE_NONE)
> > -		pr_info("AT91: Detected soc subtype: %s\n",
> > -			at91_get_soc_subtype(&at91_soc_initdata));
> > -}
> > -
> >  static struct of_device_id ramc_ids[] = {
> >  	{ .compatible = "atmel,at91rm9200-sdramc", .data = at91rm9200_standby },
> >  	{ .compatible = "atmel,at91sam9260-sdramc", .data = at91sam9_sdram_standby },
> > 
> 
> 
> -- 
> Nicolas Ferre

-- 
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 56+ messages in thread

* [PATCH 15/17] ARM: at91: remove old setup
@ 2015-01-21 20:40       ` Alexandre Belloni
  0 siblings, 0 replies; 56+ messages in thread
From: Alexandre Belloni @ 2015-01-21 20:40 UTC (permalink / raw)
  To: linux-arm-kernel

On 21/01/2015 at 17:29:42 +0100, Nicolas Ferre wrote :
> Le 15/01/2015 22:58, Alexandre Belloni a ?crit :
> > The old initialization is not used anymore, remove it.
> > Also remove now unused cpu.h and at91_dbgu.h
> > 
> > Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
> > ---
> >  arch/arm/mach-at91/generic.h                   |   4 -
> >  arch/arm/mach-at91/include/mach/at91_dbgu.h    |  63 ------
> >  arch/arm/mach-at91/include/mach/at91_ramc.h    |   6 -
> >  arch/arm/mach-at91/include/mach/at91sam9_smc.h |   2 -
> >  arch/arm/mach-at91/include/mach/cpu.h          | 240 --------------------
> 
> BTW, both at91_dbgu.h and cpu.h are needed for the uncompress.h AT91
> file. I need to re-integrate both of them until this feature is
> completely generalized with multi-platform. Are you okay with this
> modification?
> 

Ok, then remove it along with uncompress.h later. I rebased that branch
too many times, sorry about that.

> >  arch/arm/mach-at91/pm.c                        |   5 +-
> >  arch/arm/mach-at91/setup.c                     | 301 -------------------------
> 
> I'm perfectly fine with removing the old setup code as we have the full
> DT initialization in place.
> This setup code didn't prove it had added any benefit in comparison with
> the usual DT initialization process. Code is much more simpler and clearer.
> 
> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
> 
> I plan to queue these patches really soon on top of my
> at91-3.20-cleanup branch.
> 
> Thanks, bye.
> 
> 
> >  7 files changed, 4 insertions(+), 617 deletions(-)
> >  delete mode 100644 arch/arm/mach-at91/include/mach/at91_dbgu.h
> >  delete mode 100644 arch/arm/mach-at91/include/mach/cpu.h
> > 
> > diff --git a/arch/arm/mach-at91/generic.h b/arch/arm/mach-at91/generic.h
> > index 1e60faec2eba..881e73a27fab 100644
> > --- a/arch/arm/mach-at91/generic.h
> > +++ b/arch/arm/mach-at91/generic.h
> > @@ -14,10 +14,6 @@
> >  #include <linux/of.h>
> >  #include <linux/reboot.h>
> >  
> > - /* Map io */
> > -extern void __init at91_map_io(void);
> > -extern void __init at91_alt_map_io(void);
> > -
> >   /* Processors */
> >  extern void __init at91_dt_initialize(void);
> >  
> > diff --git a/arch/arm/mach-at91/include/mach/at91_dbgu.h b/arch/arm/mach-at91/include/mach/at91_dbgu.h
> > deleted file mode 100644
> > index 42925e8f78e4..000000000000
> > --- a/arch/arm/mach-at91/include/mach/at91_dbgu.h
> > +++ /dev/null
> > @@ -1,63 +0,0 @@
> > -/*
> > - * arch/arm/mach-at91/include/mach/at91_dbgu.h
> > - *
> > - * Copyright (C) 2005 Ivan Kokshaysky
> > - * Copyright (C) SAN People
> > - *
> > - * Debug Unit (DBGU) - System peripherals registers.
> > - * Based on AT91RM9200 datasheet revision E.
> > - *
> > - * This program is free software; you can redistribute it and/or modify
> > - * it under the terms of the GNU General Public License as published by
> > - * the Free Software Foundation; either version 2 of the License, or
> > - * (at your option) any later version.
> > - */
> > -
> > -#ifndef AT91_DBGU_H
> > -#define AT91_DBGU_H
> > -
> > -#define AT91_DBGU_CR		(0x00)	/* Control Register */
> > -#define AT91_DBGU_MR		(0x04)	/* Mode Register */
> > -#define AT91_DBGU_IER		(0x08)	/* Interrupt Enable Register */
> > -#define		AT91_DBGU_TXRDY		(1 << 1)		/* Transmitter Ready */
> > -#define		AT91_DBGU_TXEMPTY	(1 << 9)		/* Transmitter Empty */
> > -#define AT91_DBGU_IDR		(0x0c)	/* Interrupt Disable Register */
> > -#define AT91_DBGU_IMR		(0x10)	/* Interrupt Mask Register */
> > -#define AT91_DBGU_SR		(0x14)	/* Status Register */
> > -#define AT91_DBGU_RHR		(0x18)	/* Receiver Holding Register */
> > -#define AT91_DBGU_THR		(0x1c)	/* Transmitter Holding Register */
> > -#define AT91_DBGU_BRGR		(0x20)	/* Baud Rate Generator Register */
> > -
> > -#define AT91_DBGU_CIDR		(0x40)	/* Chip ID Register */
> > -#define AT91_DBGU_EXID		(0x44)	/* Chip ID Extension Register */
> > -#define AT91_DBGU_FNR		(0x48)	/* Force NTRST Register [SAM9 only] */
> > -#define		AT91_DBGU_FNTRST	(1 << 0)		/* Force NTRST */
> > -
> > -/*
> > - * Some AT91 parts that don't have full DEBUG units still support the ID
> > - * and extensions register.
> > - */
> > -#define		AT91_CIDR_VERSION	(0x1f << 0)		/* Version of the Device */
> > -#define		AT91_CIDR_EPROC		(7    << 5)		/* Embedded Processor */
> > -#define		AT91_CIDR_NVPSIZ	(0xf  << 8)		/* Nonvolatile Program Memory Size */
> > -#define		AT91_CIDR_NVPSIZ2	(0xf  << 12)		/* Second Nonvolatile Program Memory Size */
> > -#define		AT91_CIDR_SRAMSIZ	(0xf  << 16)		/* Internal SRAM Size */
> > -#define			AT91_CIDR_SRAMSIZ_1K	(1 << 16)
> > -#define			AT91_CIDR_SRAMSIZ_2K	(2 << 16)
> > -#define			AT91_CIDR_SRAMSIZ_112K	(4 << 16)
> > -#define			AT91_CIDR_SRAMSIZ_4K	(5 << 16)
> > -#define			AT91_CIDR_SRAMSIZ_80K	(6 << 16)
> > -#define			AT91_CIDR_SRAMSIZ_160K	(7 << 16)
> > -#define			AT91_CIDR_SRAMSIZ_8K	(8 << 16)
> > -#define			AT91_CIDR_SRAMSIZ_16K	(9 << 16)
> > -#define			AT91_CIDR_SRAMSIZ_32K	(10 << 16)
> > -#define			AT91_CIDR_SRAMSIZ_64K	(11 << 16)
> > -#define			AT91_CIDR_SRAMSIZ_128K	(12 << 16)
> > -#define			AT91_CIDR_SRAMSIZ_256K	(13 << 16)
> > -#define			AT91_CIDR_SRAMSIZ_96K	(14 << 16)
> > -#define			AT91_CIDR_SRAMSIZ_512K	(15 << 16)
> > -#define		AT91_CIDR_ARCH		(0xff << 20)		/* Architecture Identifier */
> > -#define		AT91_CIDR_NVPTYP	(7    << 28)		/* Nonvolatile Program Memory Type */
> > -#define		AT91_CIDR_EXT		(1    << 31)		/* Extension Flag */
> > -
> > -#endif
> > diff --git a/arch/arm/mach-at91/include/mach/at91_ramc.h b/arch/arm/mach-at91/include/mach/at91_ramc.h
> > index e4492b151fee..80431ece8a54 100644
> > --- a/arch/arm/mach-at91/include/mach/at91_ramc.h
> > +++ b/arch/arm/mach-at91/include/mach/at91_ramc.h
> > @@ -9,17 +9,11 @@
> >  #ifndef __AT91_RAMC_H__
> >  #define __AT91_RAMC_H__
> >  
> > -#ifndef __ASSEMBLY__
> > -extern void __iomem *at91_ramc_base[];
> > -
> >  #define at91_ramc_read(id, field) \
> >  	__raw_readl(at91_ramc_base[id] + field)
> >  
> >  #define at91_ramc_write(id, field, value) \
> >  	__raw_writel(value, at91_ramc_base[id] + field)
> > -#else
> > -.extern at91_ramc_base
> > -#endif
> >  
> >  #define AT91_MEMCTRL_MC		0
> >  #define AT91_MEMCTRL_SDRAMC	1
> > diff --git a/arch/arm/mach-at91/include/mach/at91sam9_smc.h b/arch/arm/mach-at91/include/mach/at91sam9_smc.h
> > index 175e1fdd9fe8..ff54a0ce90e3 100644
> > --- a/arch/arm/mach-at91/include/mach/at91sam9_smc.h
> > +++ b/arch/arm/mach-at91/include/mach/at91sam9_smc.h
> > @@ -16,8 +16,6 @@
> >  #ifndef AT91SAM9_SMC_H
> >  #define AT91SAM9_SMC_H
> >  
> > -#include <mach/cpu.h>
> > -
> >  #ifndef __ASSEMBLY__
> >  struct sam9_smc_config {
> >  	/* Setup register */
> > diff --git a/arch/arm/mach-at91/include/mach/cpu.h b/arch/arm/mach-at91/include/mach/cpu.h
> > deleted file mode 100644
> > index 61914fb35f5d..000000000000
> > --- a/arch/arm/mach-at91/include/mach/cpu.h
> > +++ /dev/null
> > @@ -1,240 +0,0 @@
> > -/*
> > - * arch/arm/mach-at91/include/mach/cpu.h
> > - *
> > - * Copyright (C) 2006 SAN People
> > - * Copyright (C) 2011 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> > - *
> > - * This program is free software; you can redistribute it and/or modify
> > - * it under the terms of the GNU General Public License as published by
> > - * the Free Software Foundation; either version 2 of the License, or
> > - * (at your option) any later version.
> > - *
> > - */
> > -
> > -#ifndef __MACH_CPU_H__
> > -#define __MACH_CPU_H__
> > -
> > -#define ARCH_ID_AT91RM9200	0x09290780
> > -#define ARCH_ID_AT91SAM9260	0x019803a0
> > -#define ARCH_ID_AT91SAM9261	0x019703a0
> > -#define ARCH_ID_AT91SAM9263	0x019607a0
> > -#define ARCH_ID_AT91SAM9G10	0x019903a0
> > -#define ARCH_ID_AT91SAM9G20	0x019905a0
> > -#define ARCH_ID_AT91SAM9RL64	0x019b03a0
> > -#define ARCH_ID_AT91SAM9G45	0x819b05a0
> > -#define ARCH_ID_AT91SAM9G45MRL	0x819b05a2	/* aka 9G45-ES2 & non ES lots */
> > -#define ARCH_ID_AT91SAM9G45ES	0x819b05a1	/* 9G45-ES (Engineering Sample) */
> > -#define ARCH_ID_AT91SAM9X5	0x819a05a0
> > -#define ARCH_ID_AT91SAM9N12	0x819a07a0
> > -
> > -#define ARCH_ID_AT91SAM9XE128	0x329973a0
> > -#define ARCH_ID_AT91SAM9XE256	0x329a93a0
> > -#define ARCH_ID_AT91SAM9XE512	0x329aa3a0
> > -
> > -#define ARCH_ID_AT91M40800	0x14080044
> > -#define ARCH_ID_AT91R40807	0x44080746
> > -#define ARCH_ID_AT91M40807	0x14080745
> > -#define ARCH_ID_AT91R40008	0x44000840
> > -
> > -#define ARCH_ID_SAMA5		0x8A5C07C0
> > -
> > -#define ARCH_EXID_AT91SAM9M11	0x00000001
> > -#define ARCH_EXID_AT91SAM9M10	0x00000002
> > -#define ARCH_EXID_AT91SAM9G46	0x00000003
> > -#define ARCH_EXID_AT91SAM9G45	0x00000004
> > -
> > -#define ARCH_EXID_AT91SAM9G15	0x00000000
> > -#define ARCH_EXID_AT91SAM9G35	0x00000001
> > -#define ARCH_EXID_AT91SAM9X35	0x00000002
> > -#define ARCH_EXID_AT91SAM9G25	0x00000003
> > -#define ARCH_EXID_AT91SAM9X25	0x00000004
> > -
> > -#define ARCH_EXID_SAMA5D3	0x00004300
> > -#define ARCH_EXID_SAMA5D31	0x00444300
> > -#define ARCH_EXID_SAMA5D33	0x00414300
> > -#define ARCH_EXID_SAMA5D34	0x00414301
> > -#define ARCH_EXID_SAMA5D35	0x00584300
> > -#define ARCH_EXID_SAMA5D36	0x00004301
> > -
> > -#define ARCH_EXID_SAMA5D4	0x00000007
> > -#define ARCH_EXID_SAMA5D41	0x00000001
> > -#define ARCH_EXID_SAMA5D42	0x00000002
> > -#define ARCH_EXID_SAMA5D43	0x00000003
> > -#define ARCH_EXID_SAMA5D44	0x00000004
> > -
> > -#define ARCH_FAMILY_AT91SAM9	0x01900000
> > -#define ARCH_FAMILY_AT91SAM9XE	0x02900000
> > -
> > -/* RM9200 type */
> > -#define ARCH_REVISON_9200_BGA	(0 << 0)
> > -#define ARCH_REVISON_9200_PQFP	(1 << 0)
> > -
> > -#ifndef __ASSEMBLY__
> > -enum at91_soc_type {
> > -	/* 920T */
> > -	AT91_SOC_RM9200,
> > -
> > -	/* SAM92xx */
> > -	AT91_SOC_SAM9260, AT91_SOC_SAM9261, AT91_SOC_SAM9263,
> > -
> > -	/* SAM9Gxx */
> > -	AT91_SOC_SAM9G10, AT91_SOC_SAM9G20, AT91_SOC_SAM9G45,
> > -
> > -	/* SAM9RL */
> > -	AT91_SOC_SAM9RL,
> > -
> > -	/* SAM9X5 */
> > -	AT91_SOC_SAM9X5,
> > -
> > -	/* SAM9N12 */
> > -	AT91_SOC_SAM9N12,
> > -
> > -	/* SAMA5D3 */
> > -	AT91_SOC_SAMA5D3,
> > -
> > -	/* SAMA5D4 */
> > -	AT91_SOC_SAMA5D4,
> > -
> > -	/* Unknown type */
> > -	AT91_SOC_UNKNOWN,
> > -};
> > -
> > -enum at91_soc_subtype {
> > -	/* RM9200 */
> > -	AT91_SOC_RM9200_BGA, AT91_SOC_RM9200_PQFP,
> > -
> > -	/* SAM9260 */
> > -	AT91_SOC_SAM9XE,
> > -
> > -	/* SAM9G45 */
> > -	AT91_SOC_SAM9G45ES, AT91_SOC_SAM9M10, AT91_SOC_SAM9G46, AT91_SOC_SAM9M11,
> > -
> > -	/* SAM9X5 */
> > -	AT91_SOC_SAM9G15, AT91_SOC_SAM9G35, AT91_SOC_SAM9X35,
> > -	AT91_SOC_SAM9G25, AT91_SOC_SAM9X25,
> > -
> > -	/* SAMA5D3 */
> > -	AT91_SOC_SAMA5D31, AT91_SOC_SAMA5D33, AT91_SOC_SAMA5D34,
> > -	AT91_SOC_SAMA5D35, AT91_SOC_SAMA5D36,
> > -
> > -	/* SAMA5D4 */
> > -	AT91_SOC_SAMA5D41, AT91_SOC_SAMA5D42, AT91_SOC_SAMA5D43,
> > -	AT91_SOC_SAMA5D44,
> > -
> > -	/* No subtype for this SoC */
> > -	AT91_SOC_SUBTYPE_NONE,
> > -
> > -	/* Unknown subtype */
> > -	AT91_SOC_SUBTYPE_UNKNOWN,
> > -};
> > -
> > -struct at91_socinfo {
> > -	unsigned int type, subtype;
> > -	unsigned int cidr, exid;
> > -};
> > -
> > -extern struct at91_socinfo at91_soc_initdata;
> > -const char *at91_get_soc_type(struct at91_socinfo *c);
> > -const char *at91_get_soc_subtype(struct at91_socinfo *c);
> > -
> > -static inline int at91_soc_is_detected(void)
> > -{
> > -	return at91_soc_initdata.type != AT91_SOC_UNKNOWN;
> > -}
> > -
> > -#ifdef CONFIG_SOC_AT91RM9200
> > -#define cpu_is_at91rm9200()	(at91_soc_initdata.type == AT91_SOC_RM9200)
> > -#define cpu_is_at91rm9200_bga()	(at91_soc_initdata.subtype == AT91_SOC_RM9200_BGA)
> > -#define cpu_is_at91rm9200_pqfp() (at91_soc_initdata.subtype == AT91_SOC_RM9200_PQFP)
> > -#else
> > -#define cpu_is_at91rm9200()	(0)
> > -#define cpu_is_at91rm9200_bga()	(0)
> > -#define cpu_is_at91rm9200_pqfp() (0)
> > -#endif
> > -
> > -#ifdef CONFIG_SOC_AT91SAM9260
> > -#define cpu_is_at91sam9xe()	(at91_soc_initdata.subtype == AT91_SOC_SAM9XE)
> > -#define cpu_is_at91sam9260()	(at91_soc_initdata.type == AT91_SOC_SAM9260)
> > -#define cpu_is_at91sam9g20()	(at91_soc_initdata.type == AT91_SOC_SAM9G20)
> > -#else
> > -#define cpu_is_at91sam9xe()	(0)
> > -#define cpu_is_at91sam9260()	(0)
> > -#define cpu_is_at91sam9g20()	(0)
> > -#endif
> > -
> > -#ifdef CONFIG_SOC_AT91SAM9261
> > -#define cpu_is_at91sam9261()	(at91_soc_initdata.type == AT91_SOC_SAM9261)
> > -#define cpu_is_at91sam9g10()	(at91_soc_initdata.type == AT91_SOC_SAM9G10)
> > -#else
> > -#define cpu_is_at91sam9261()	(0)
> > -#define cpu_is_at91sam9g10()	(0)
> > -#endif
> > -
> > -#ifdef CONFIG_SOC_AT91SAM9263
> > -#define cpu_is_at91sam9263()	(at91_soc_initdata.type == AT91_SOC_SAM9263)
> > -#else
> > -#define cpu_is_at91sam9263()	(0)
> > -#endif
> > -
> > -#ifdef CONFIG_SOC_AT91SAM9RL
> > -#define cpu_is_at91sam9rl()	(at91_soc_initdata.type == AT91_SOC_SAM9RL)
> > -#else
> > -#define cpu_is_at91sam9rl()	(0)
> > -#endif
> > -
> > -#ifdef CONFIG_SOC_AT91SAM9G45
> > -#define cpu_is_at91sam9g45()	(at91_soc_initdata.type == AT91_SOC_SAM9G45)
> > -#define cpu_is_at91sam9g45es()	(at91_soc_initdata.subtype == AT91_SOC_SAM9G45ES)
> > -#define cpu_is_at91sam9m10()	(at91_soc_initdata.subtype == AT91_SOC_SAM9M10)
> > -#define cpu_is_at91sam9g46()	(at91_soc_initdata.subtype == AT91_SOC_SAM9G46)
> > -#define cpu_is_at91sam9m11()	(at91_soc_initdata.subtype == AT91_SOC_SAM9M11)
> > -#else
> > -#define cpu_is_at91sam9g45()	(0)
> > -#define cpu_is_at91sam9g45es()	(0)
> > -#define cpu_is_at91sam9m10()	(0)
> > -#define cpu_is_at91sam9g46()	(0)
> > -#define cpu_is_at91sam9m11()	(0)
> > -#endif
> > -
> > -#ifdef CONFIG_SOC_AT91SAM9X5
> > -#define cpu_is_at91sam9x5()	(at91_soc_initdata.type == AT91_SOC_SAM9X5)
> > -#define cpu_is_at91sam9g15()	(at91_soc_initdata.subtype == AT91_SOC_SAM9G15)
> > -#define cpu_is_at91sam9g35()	(at91_soc_initdata.subtype == AT91_SOC_SAM9G35)
> > -#define cpu_is_at91sam9x35()	(at91_soc_initdata.subtype == AT91_SOC_SAM9X35)
> > -#define cpu_is_at91sam9g25()	(at91_soc_initdata.subtype == AT91_SOC_SAM9G25)
> > -#define cpu_is_at91sam9x25()	(at91_soc_initdata.subtype == AT91_SOC_SAM9X25)
> > -#else
> > -#define cpu_is_at91sam9x5()	(0)
> > -#define cpu_is_at91sam9g15()	(0)
> > -#define cpu_is_at91sam9g35()	(0)
> > -#define cpu_is_at91sam9x35()	(0)
> > -#define cpu_is_at91sam9g25()	(0)
> > -#define cpu_is_at91sam9x25()	(0)
> > -#endif
> > -
> > -#ifdef CONFIG_SOC_AT91SAM9N12
> > -#define cpu_is_at91sam9n12()	(at91_soc_initdata.type == AT91_SOC_SAM9N12)
> > -#else
> > -#define cpu_is_at91sam9n12()	(0)
> > -#endif
> > -
> > -#ifdef CONFIG_SOC_SAMA5D3
> > -#define cpu_is_sama5d3()	(at91_soc_initdata.type == AT91_SOC_SAMA5D3)
> > -#else
> > -#define cpu_is_sama5d3()	(0)
> > -#endif
> > -
> > -#ifdef CONFIG_SOC_SAMA5D4
> > -#define cpu_is_sama5d4()	(at91_soc_initdata.type == AT91_SOC_SAMA5D4)
> > -#else
> > -#define cpu_is_sama5d4()	(0)
> > -#endif
> > -
> > -/*
> > - * Since this is ARM, we will never run on any AVR32 CPU. But these
> > - * definitions may reduce clutter in common drivers.
> > - */
> > -#define cpu_is_at32ap7000()	(0)
> > -#endif /* __ASSEMBLY__ */
> > -
> > -#endif /* __MACH_CPU_H__ */
> > diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c
> > index 778f11132b31..11bf992838af 100644
> > --- a/arch/arm/mach-at91/pm.c
> > +++ b/arch/arm/mach-at91/pm.c
> > @@ -19,6 +19,7 @@
> >  #include <linux/sysfs.h>
> >  #include <linux/module.h>
> >  #include <linux/of.h>
> > +#include <linux/of_address.h>
> >  #include <linux/of_platform.h>
> >  #include <linux/platform_device.h>
> >  #include <linux/io.h>
> > @@ -29,10 +30,12 @@
> >  #include <asm/mach/time.h>
> >  #include <asm/mach/irq.h>
> >  
> > -#include <mach/cpu.h>
> >  #include <mach/hardware.h>
> >  
> >  #include "generic.h"
> > +
> > +static void __iomem *at91_ramc_base[2];
> > +
> >  #include "pm.h"
> >  
> >  static struct {
> > diff --git a/arch/arm/mach-at91/setup.c b/arch/arm/mach-at91/setup.c
> > index 42ebe8d41433..4036e3e0ff96 100644
> > --- a/arch/arm/mach-at91/setup.c
> > +++ b/arch/arm/mach-at91/setup.c
> > @@ -7,321 +7,20 @@
> >  
> >  #define pr_fmt(fmt)	"AT91: " fmt
> >  
> > -#include <linux/module.h>
> >  #include <linux/io.h>
> > -#include <linux/mm.h>
> >  #include <linux/pm.h>
> >  #include <linux/of_address.h>
> > -#include <linux/pinctrl/machine.h>
> > -#include <linux/clk/at91_pmc.h>
> >  
> >  #include <asm/system_misc.h>
> > -#include <asm/mach/map.h>
> >  
> >  #include <mach/hardware.h>
> > -#include <mach/cpu.h>
> > -#include <mach/at91_dbgu.h>
> >  
> >  #include "generic.h"
> >  #include "pm.h"
> >  
> > -struct at91_socinfo at91_soc_initdata;
> > -EXPORT_SYMBOL(at91_soc_initdata);
> > -
> >  void __iomem *at91_ramc_base[2];
> >  EXPORT_SYMBOL_GPL(at91_ramc_base);
> >  
> > -static struct map_desc at91_io_desc __initdata __maybe_unused = {
> > -	.virtual	= (unsigned long)AT91_VA_BASE_SYS,
> > -	.pfn		= __phys_to_pfn(AT91_BASE_SYS),
> > -	.length		= SZ_16K,
> > -	.type		= MT_DEVICE,
> > -};
> > -
> > -static struct map_desc at91_alt_io_desc __initdata __maybe_unused = {
> > -	.virtual	= (unsigned long)AT91_ALT_VA_BASE_SYS,
> > -	.pfn		= __phys_to_pfn(AT91_ALT_BASE_SYS),
> > -	.length		= 24 * SZ_1K,
> > -	.type		= MT_DEVICE,
> > -};
> > -
> > -static void __init soc_detect(u32 dbgu_base)
> > -{
> > -	u32 cidr, socid;
> > -
> > -	cidr = __raw_readl(AT91_IO_P2V(dbgu_base) + AT91_DBGU_CIDR);
> > -	socid = cidr & ~AT91_CIDR_VERSION;
> > -
> > -	switch (socid) {
> > -	case ARCH_ID_AT91RM9200:
> > -		at91_soc_initdata.type = AT91_SOC_RM9200;
> > -		if (at91_soc_initdata.subtype == AT91_SOC_SUBTYPE_UNKNOWN)
> > -			at91_soc_initdata.subtype = AT91_SOC_RM9200_BGA;
> > -		break;
> > -
> > -	case ARCH_ID_AT91SAM9260:
> > -		at91_soc_initdata.type = AT91_SOC_SAM9260;
> > -		at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE;
> > -		break;
> > -
> > -	case ARCH_ID_AT91SAM9261:
> > -		at91_soc_initdata.type = AT91_SOC_SAM9261;
> > -		at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE;
> > -		break;
> > -
> > -	case ARCH_ID_AT91SAM9263:
> > -		at91_soc_initdata.type = AT91_SOC_SAM9263;
> > -		at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE;
> > -		break;
> > -
> > -	case ARCH_ID_AT91SAM9G20:
> > -		at91_soc_initdata.type = AT91_SOC_SAM9G20;
> > -		at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE;
> > -		break;
> > -
> > -	case ARCH_ID_AT91SAM9G45:
> > -		at91_soc_initdata.type = AT91_SOC_SAM9G45;
> > -		if (cidr == ARCH_ID_AT91SAM9G45ES)
> > -			at91_soc_initdata.subtype = AT91_SOC_SAM9G45ES;
> > -		break;
> > -
> > -	case ARCH_ID_AT91SAM9RL64:
> > -		at91_soc_initdata.type = AT91_SOC_SAM9RL;
> > -		at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE;
> > -		break;
> > -
> > -	case ARCH_ID_AT91SAM9X5:
> > -		at91_soc_initdata.type = AT91_SOC_SAM9X5;
> > -		break;
> > -
> > -	case ARCH_ID_AT91SAM9N12:
> > -		at91_soc_initdata.type = AT91_SOC_SAM9N12;
> > -		break;
> > -
> > -	case ARCH_ID_SAMA5:
> > -		at91_soc_initdata.exid = __raw_readl(AT91_IO_P2V(dbgu_base) + AT91_DBGU_EXID);
> > -		if (at91_soc_initdata.exid & ARCH_EXID_SAMA5D3) {
> > -			at91_soc_initdata.type = AT91_SOC_SAMA5D3;
> > -		}
> > -		break;
> > -	}
> > -
> > -	/* at91sam9g10 */
> > -	if ((socid & ~AT91_CIDR_EXT) == ARCH_ID_AT91SAM9G10) {
> > -		at91_soc_initdata.type = AT91_SOC_SAM9G10;
> > -		at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE;
> > -	}
> > -	/* at91sam9xe */
> > -	else if ((cidr & AT91_CIDR_ARCH) == ARCH_FAMILY_AT91SAM9XE) {
> > -		at91_soc_initdata.type = AT91_SOC_SAM9260;
> > -		at91_soc_initdata.subtype = AT91_SOC_SAM9XE;
> > -	}
> > -
> > -	if (!at91_soc_is_detected())
> > -		return;
> > -
> > -	at91_soc_initdata.cidr = cidr;
> > -
> > -	/* sub version of soc */
> > -	if (!at91_soc_initdata.exid)
> > -		at91_soc_initdata.exid = __raw_readl(AT91_IO_P2V(dbgu_base) + AT91_DBGU_EXID);
> > -
> > -	if (at91_soc_initdata.type == AT91_SOC_SAM9G45) {
> > -		switch (at91_soc_initdata.exid) {
> > -		case ARCH_EXID_AT91SAM9M10:
> > -			at91_soc_initdata.subtype = AT91_SOC_SAM9M10;
> > -			break;
> > -		case ARCH_EXID_AT91SAM9G46:
> > -			at91_soc_initdata.subtype = AT91_SOC_SAM9G46;
> > -			break;
> > -		case ARCH_EXID_AT91SAM9M11:
> > -			at91_soc_initdata.subtype = AT91_SOC_SAM9M11;
> > -			break;
> > -		}
> > -	}
> > -
> > -	if (at91_soc_initdata.type == AT91_SOC_SAM9X5) {
> > -		switch (at91_soc_initdata.exid) {
> > -		case ARCH_EXID_AT91SAM9G15:
> > -			at91_soc_initdata.subtype = AT91_SOC_SAM9G15;
> > -			break;
> > -		case ARCH_EXID_AT91SAM9G35:
> > -			at91_soc_initdata.subtype = AT91_SOC_SAM9G35;
> > -			break;
> > -		case ARCH_EXID_AT91SAM9X35:
> > -			at91_soc_initdata.subtype = AT91_SOC_SAM9X35;
> > -			break;
> > -		case ARCH_EXID_AT91SAM9G25:
> > -			at91_soc_initdata.subtype = AT91_SOC_SAM9G25;
> > -			break;
> > -		case ARCH_EXID_AT91SAM9X25:
> > -			at91_soc_initdata.subtype = AT91_SOC_SAM9X25;
> > -			break;
> > -		}
> > -	}
> > -
> > -	if (at91_soc_initdata.type == AT91_SOC_SAMA5D3) {
> > -		switch (at91_soc_initdata.exid) {
> > -		case ARCH_EXID_SAMA5D31:
> > -			at91_soc_initdata.subtype = AT91_SOC_SAMA5D31;
> > -			break;
> > -		case ARCH_EXID_SAMA5D33:
> > -			at91_soc_initdata.subtype = AT91_SOC_SAMA5D33;
> > -			break;
> > -		case ARCH_EXID_SAMA5D34:
> > -			at91_soc_initdata.subtype = AT91_SOC_SAMA5D34;
> > -			break;
> > -		case ARCH_EXID_SAMA5D35:
> > -			at91_soc_initdata.subtype = AT91_SOC_SAMA5D35;
> > -			break;
> > -		case ARCH_EXID_SAMA5D36:
> > -			at91_soc_initdata.subtype = AT91_SOC_SAMA5D36;
> > -			break;
> > -		}
> > -	}
> > -}
> > -
> > -static void __init alt_soc_detect(u32 dbgu_base)
> > -{
> > -	u32 cidr, socid;
> > -
> > -	/* SoC ID */
> > -	cidr = __raw_readl(AT91_ALT_IO_P2V(dbgu_base) + AT91_DBGU_CIDR);
> > -	socid = cidr & ~AT91_CIDR_VERSION;
> > -
> > -	switch (socid) {
> > -	case ARCH_ID_SAMA5:
> > -		at91_soc_initdata.exid = __raw_readl(AT91_ALT_IO_P2V(dbgu_base) + AT91_DBGU_EXID);
> > -		if (at91_soc_initdata.exid & ARCH_EXID_SAMA5D3) {
> > -			at91_soc_initdata.type = AT91_SOC_SAMA5D3;
> > -		} else if (at91_soc_initdata.exid & ARCH_EXID_SAMA5D4) {
> > -			at91_soc_initdata.type = AT91_SOC_SAMA5D4;
> > -		}
> > -		break;
> > -	}
> > -
> > -	if (!at91_soc_is_detected())
> > -		return;
> > -
> > -	at91_soc_initdata.cidr = cidr;
> > -
> > -	/* sub version of soc */
> > -	if (!at91_soc_initdata.exid)
> > -		at91_soc_initdata.exid = __raw_readl(AT91_ALT_IO_P2V(dbgu_base) + AT91_DBGU_EXID);
> > -
> > -	if (at91_soc_initdata.type == AT91_SOC_SAMA5D4) {
> > -		switch (at91_soc_initdata.exid) {
> > -		case ARCH_EXID_SAMA5D41:
> > -			at91_soc_initdata.subtype = AT91_SOC_SAMA5D41;
> > -			break;
> > -		case ARCH_EXID_SAMA5D42:
> > -			at91_soc_initdata.subtype = AT91_SOC_SAMA5D42;
> > -			break;
> > -		case ARCH_EXID_SAMA5D43:
> > -			at91_soc_initdata.subtype = AT91_SOC_SAMA5D43;
> > -			break;
> > -		case ARCH_EXID_SAMA5D44:
> > -			at91_soc_initdata.subtype = AT91_SOC_SAMA5D44;
> > -			break;
> > -		}
> > -	}
> > -}
> > -
> > -static const char *soc_name[] = {
> > -	[AT91_SOC_RM9200]	= "at91rm9200",
> > -	[AT91_SOC_SAM9260]	= "at91sam9260",
> > -	[AT91_SOC_SAM9261]	= "at91sam9261",
> > -	[AT91_SOC_SAM9263]	= "at91sam9263",
> > -	[AT91_SOC_SAM9G10]	= "at91sam9g10",
> > -	[AT91_SOC_SAM9G20]	= "at91sam9g20",
> > -	[AT91_SOC_SAM9G45]	= "at91sam9g45",
> > -	[AT91_SOC_SAM9RL]	= "at91sam9rl",
> > -	[AT91_SOC_SAM9X5]	= "at91sam9x5",
> > -	[AT91_SOC_SAM9N12]	= "at91sam9n12",
> > -	[AT91_SOC_SAMA5D3]	= "sama5d3",
> > -	[AT91_SOC_SAMA5D4]	= "sama5d4",
> > -	[AT91_SOC_UNKNOWN]	= "Unknown",
> > -};
> > -
> > -const char *at91_get_soc_type(struct at91_socinfo *c)
> > -{
> > -	return soc_name[c->type];
> > -}
> > -EXPORT_SYMBOL(at91_get_soc_type);
> > -
> > -static const char *soc_subtype_name[] = {
> > -	[AT91_SOC_RM9200_BGA]	= "at91rm9200 BGA",
> > -	[AT91_SOC_RM9200_PQFP]	= "at91rm9200 PQFP",
> > -	[AT91_SOC_SAM9XE]	= "at91sam9xe",
> > -	[AT91_SOC_SAM9G45ES]	= "at91sam9g45es",
> > -	[AT91_SOC_SAM9M10]	= "at91sam9m10",
> > -	[AT91_SOC_SAM9G46]	= "at91sam9g46",
> > -	[AT91_SOC_SAM9M11]	= "at91sam9m11",
> > -	[AT91_SOC_SAM9G15]	= "at91sam9g15",
> > -	[AT91_SOC_SAM9G35]	= "at91sam9g35",
> > -	[AT91_SOC_SAM9X35]	= "at91sam9x35",
> > -	[AT91_SOC_SAM9G25]	= "at91sam9g25",
> > -	[AT91_SOC_SAM9X25]	= "at91sam9x25",
> > -	[AT91_SOC_SAMA5D31]	= "sama5d31",
> > -	[AT91_SOC_SAMA5D33]	= "sama5d33",
> > -	[AT91_SOC_SAMA5D34]	= "sama5d34",
> > -	[AT91_SOC_SAMA5D35]	= "sama5d35",
> > -	[AT91_SOC_SAMA5D36]	= "sama5d36",
> > -	[AT91_SOC_SAMA5D41]	= "sama5d41",
> > -	[AT91_SOC_SAMA5D42]	= "sama5d42",
> > -	[AT91_SOC_SAMA5D43]	= "sama5d43",
> > -	[AT91_SOC_SAMA5D44]	= "sama5d44",
> > -	[AT91_SOC_SUBTYPE_NONE]	= "None",
> > -	[AT91_SOC_SUBTYPE_UNKNOWN] = "Unknown",
> > -};
> > -
> > -const char *at91_get_soc_subtype(struct at91_socinfo *c)
> > -{
> > -	return soc_subtype_name[c->subtype];
> > -}
> > -EXPORT_SYMBOL(at91_get_soc_subtype);
> > -
> > -void __init at91_map_io(void)
> > -{
> > -	/* Map peripherals */
> > -	iotable_init(&at91_io_desc, 1);
> > -
> > -	at91_soc_initdata.type = AT91_SOC_UNKNOWN;
> > -	at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_UNKNOWN;
> > -
> > -	soc_detect(AT91_BASE_DBGU0);
> > -	if (!at91_soc_is_detected())
> > -		soc_detect(AT91_BASE_DBGU1);
> > -
> > -	if (!at91_soc_is_detected())
> > -		panic(pr_fmt("Impossible to detect the SOC type"));
> > -
> > -	pr_info("Detected soc type: %s\n",
> > -		at91_get_soc_type(&at91_soc_initdata));
> > -	if (at91_soc_initdata.subtype != AT91_SOC_SUBTYPE_NONE)
> > -		pr_info("Detected soc subtype: %s\n",
> > -			at91_get_soc_subtype(&at91_soc_initdata));
> > -}
> > -
> > -void __init at91_alt_map_io(void)
> > -{
> > -	/* Map peripherals */
> > -	iotable_init(&at91_alt_io_desc, 1);
> > -
> > -	at91_soc_initdata.type = AT91_SOC_UNKNOWN;
> > -	at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_UNKNOWN;
> > -
> > -	alt_soc_detect(AT91_BASE_DBGU2);
> > -	if (!at91_soc_is_detected())
> > -		panic("AT91: Impossible to detect the SOC type");
> > -
> > -	pr_info("AT91: Detected soc type: %s\n",
> > -		at91_get_soc_type(&at91_soc_initdata));
> > -	if (at91_soc_initdata.subtype != AT91_SOC_SUBTYPE_NONE)
> > -		pr_info("AT91: Detected soc subtype: %s\n",
> > -			at91_get_soc_subtype(&at91_soc_initdata));
> > -}
> > -
> >  static struct of_device_id ramc_ids[] = {
> >  	{ .compatible = "atmel,at91rm9200-sdramc", .data = at91rm9200_standby },
> >  	{ .compatible = "atmel,at91sam9260-sdramc", .data = at91sam9_sdram_standby },
> > 
> 
> 
> -- 
> Nicolas Ferre

-- 
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 56+ messages in thread

* Re: [PATCH 10/17] ARM: at91: merge SOC_AT91SAM9xxx
  2015-01-15 21:58   ` Alexandre Belloni
@ 2015-01-22 10:22     ` Nicolas Ferre
  -1 siblings, 0 replies; 56+ messages in thread
From: Nicolas Ferre @ 2015-01-22 10:22 UTC (permalink / raw)
  To: Alexandre Belloni
  Cc: Jean-Christophe Plagniol-Villard, Arnd Bergmann, Boris Brezillon,
	Bo Shen, Wenyou Yang, linux-arm-kernel, linux-kernel

Le 15/01/2015 22:58, Alexandre Belloni a écrit :
> Only use SOC_AT91SAM9 for all the at91sam9 SoCs.
> 
> It enables HAVE_AT91_SMD and HAVE_AT91_UTMI for all the sam9 SoCs but this only
> represents 96 bytes of uncompressed kernel code.

After this patch that removes all the CONFIG_SOC_AT91SAM9xxxx options
excepted CONFIG_SOC_AT91SAM9, I still see a lot of them remaining in the
source tree.

So, this patch is not complete in my opinion. Even if you remove these
options later on, why not suppress them here?

> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
> ---
>  arch/arm/configs/at91_dt_defconfig | 10 +----
>  arch/arm/mach-at91/Kconfig         | 92 +++++++++++---------------------------
>  2 files changed, 27 insertions(+), 75 deletions(-)
> 
> diff --git a/arch/arm/configs/at91_dt_defconfig b/arch/arm/configs/at91_dt_defconfig
> index 8116d122e098..811e72bbe642 100644
> --- a/arch/arm/configs/at91_dt_defconfig
> +++ b/arch/arm/configs/at91_dt_defconfig
> @@ -15,15 +15,7 @@ CONFIG_MODULE_UNLOAD=y
>  # CONFIG_IOSCHED_CFQ is not set
>  CONFIG_ARCH_AT91=y
>  CONFIG_SOC_AT91RM9200=y
> -CONFIG_SOC_AT91SAM9260=y
> -CONFIG_SOC_AT91SAM9261=y
> -CONFIG_SOC_AT91SAM9263=y
> -CONFIG_SOC_AT91SAM9RL=y
> -CONFIG_SOC_AT91SAM9G45=y
> -CONFIG_SOC_AT91SAM9X5=y
> -CONFIG_SOC_AT91SAM9N12=y
> -CONFIG_MACH_AT91RM9200_DT=y
> -CONFIG_MACH_AT91SAM9_DT=y
> +CONFIG_SOC_AT91SAM9=y
>  CONFIG_AT91_TIMER_HZ=128
>  CONFIG_AEABI=y
>  CONFIG_UACCESS_WITH_MEMCPY=y
> diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
> index c6956b863b9d..c6740e359a44 100644
> --- a/arch/arm/mach-at91/Kconfig
> +++ b/arch/arm/mach-at91/Kconfig
> @@ -16,15 +16,6 @@ config HAVE_AT91_SMD
>  config HAVE_AT91_H32MX
>  	bool
>  
> -config SOC_AT91SAM9
> -	bool
> -	select ATMEL_AIC_IRQ
> -	select COMMON_CLK_AT91
> -	select CPU_ARM926T
> -	select GENERIC_CLOCKEVENTS
> -	select MEMORY
> -	select ATMEL_SDRAMC
> -
>  config SOC_SAMA5
>  	bool
>  	select ATMEL_AIC5_IRQ
> @@ -92,67 +83,36 @@ config SOC_AT91RM9200
>  	select GENERIC_CLOCKEVENTS
>  	select HAVE_AT91_USB_CLK
>  
> -config SOC_AT91SAM9260
> -	bool "AT91SAM9260, AT91SAM9XE or AT91SAM9G20"
> -	select SOC_AT91SAM9
> -	select HAVE_AT91_USB_CLK
> -	help
> -	  Select this if you are using one of Atmel's AT91SAM9260, AT91SAM9XE
> -	  or AT91SAM9G20 SoC.
> -
> -config SOC_AT91SAM9261
> -	bool "AT91SAM9261 or AT91SAM9G10"
> -	select HAVE_FB_ATMEL
> -	select SOC_AT91SAM9
> -	select HAVE_AT91_USB_CLK
> -	help
> -	  Select this if you are using one of Atmel's AT91SAM9261 or AT91SAM9G10 SoC.
> -
> -config SOC_AT91SAM9263
> -	bool "AT91SAM9263"
> -	select HAVE_FB_ATMEL
> -	select SOC_AT91SAM9
> -	select HAVE_AT91_USB_CLK
> -
> -config SOC_AT91SAM9RL
> -	bool "AT91SAM9RL"
> -	select HAVE_FB_ATMEL
> -	select SOC_AT91SAM9
> -	select HAVE_AT91_UTMI
> -
> -config SOC_AT91SAM9G45
> -	bool "AT91SAM9G45 or AT91SAM9M10 families"
> -	select HAVE_FB_ATMEL
> -	select SOC_AT91SAM9
> -	select HAVE_AT91_UTMI
> -	select HAVE_AT91_USB_CLK
> -	help
> -	  Select this if you are using one of Atmel's AT91SAM9G45 family SoC.
> -	  This support covers AT91SAM9G45, AT91SAM9G46, AT91SAM9M10 and AT91SAM9M11.
> -
> -config SOC_AT91SAM9X5
> -	bool "AT91SAM9x5 family"
> -	select HAVE_FB_ATMEL
> -	select SOC_AT91SAM9
> -	select HAVE_AT91_UTMI
> +config SOC_AT91SAM9
> +	bool "AT91SAM9"
> +	select ATMEL_AIC_IRQ
> +	select ATMEL_SDRAMC
> +	select COMMON_CLK_AT91
> +	select CPU_ARM926T
> +	select GENERIC_CLOCKEVENTS
>  	select HAVE_AT91_SMD
>  	select HAVE_AT91_USB_CLK
> -	help
> -	  Select this if you are using one of Atmel's AT91SAM9x5 family SoC.
> -	  This means that your SAM9 name finishes with a '5' (except if it is
> -	  AT91SAM9G45!).
> -	  This support covers AT91SAM9G15, AT91SAM9G25, AT91SAM9X25, AT91SAM9G35
> -	  and AT91SAM9X35.
> -
> -config SOC_AT91SAM9N12
> -	bool "AT91SAM9N12 family"
> +	select HAVE_AT91_UTMI
>  	select HAVE_FB_ATMEL
> -	select SOC_AT91SAM9
> -	select HAVE_AT91_USB_CLK
> +	select MEMORY
>  	help
> -	  Select this if you are using Atmel's AT91SAM9N12 SoC.
> -
> -# ----------------------------------------------------------
> +	  Select this if you are using one of those Atmel SoC:
> +	    AT91SAM9260
> +	    AT91SAM9261
> +	    AT91SAM9263
> +	    AT91SAM9G15
> +	    AT91SAM9G20
> +	    AT91SAM9G25
> +	    AT91SAM9G35
> +	    AT91SAM9G45
> +	    AT91SAM9G46
> +	    AT91SAM9M10
> +	    AT91SAM9M11
> +	    AT91SAM9N12
> +	    AT91SAM9RL
> +	    AT91SAM9X25
> +	    AT91SAM9X35
> +	    AT91SAM9XE
>  endif # SOC_SAM_V4_V5
>  
>  comment "AT91 Feature Selections"
> 


-- 
Nicolas Ferre

^ permalink raw reply	[flat|nested] 56+ messages in thread

* [PATCH 10/17] ARM: at91: merge SOC_AT91SAM9xxx
@ 2015-01-22 10:22     ` Nicolas Ferre
  0 siblings, 0 replies; 56+ messages in thread
From: Nicolas Ferre @ 2015-01-22 10:22 UTC (permalink / raw)
  To: linux-arm-kernel

Le 15/01/2015 22:58, Alexandre Belloni a ?crit :
> Only use SOC_AT91SAM9 for all the at91sam9 SoCs.
> 
> It enables HAVE_AT91_SMD and HAVE_AT91_UTMI for all the sam9 SoCs but this only
> represents 96 bytes of uncompressed kernel code.

After this patch that removes all the CONFIG_SOC_AT91SAM9xxxx options
excepted CONFIG_SOC_AT91SAM9, I still see a lot of them remaining in the
source tree.

So, this patch is not complete in my opinion. Even if you remove these
options later on, why not suppress them here?

> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
> ---
>  arch/arm/configs/at91_dt_defconfig | 10 +----
>  arch/arm/mach-at91/Kconfig         | 92 +++++++++++---------------------------
>  2 files changed, 27 insertions(+), 75 deletions(-)
> 
> diff --git a/arch/arm/configs/at91_dt_defconfig b/arch/arm/configs/at91_dt_defconfig
> index 8116d122e098..811e72bbe642 100644
> --- a/arch/arm/configs/at91_dt_defconfig
> +++ b/arch/arm/configs/at91_dt_defconfig
> @@ -15,15 +15,7 @@ CONFIG_MODULE_UNLOAD=y
>  # CONFIG_IOSCHED_CFQ is not set
>  CONFIG_ARCH_AT91=y
>  CONFIG_SOC_AT91RM9200=y
> -CONFIG_SOC_AT91SAM9260=y
> -CONFIG_SOC_AT91SAM9261=y
> -CONFIG_SOC_AT91SAM9263=y
> -CONFIG_SOC_AT91SAM9RL=y
> -CONFIG_SOC_AT91SAM9G45=y
> -CONFIG_SOC_AT91SAM9X5=y
> -CONFIG_SOC_AT91SAM9N12=y
> -CONFIG_MACH_AT91RM9200_DT=y
> -CONFIG_MACH_AT91SAM9_DT=y
> +CONFIG_SOC_AT91SAM9=y
>  CONFIG_AT91_TIMER_HZ=128
>  CONFIG_AEABI=y
>  CONFIG_UACCESS_WITH_MEMCPY=y
> diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
> index c6956b863b9d..c6740e359a44 100644
> --- a/arch/arm/mach-at91/Kconfig
> +++ b/arch/arm/mach-at91/Kconfig
> @@ -16,15 +16,6 @@ config HAVE_AT91_SMD
>  config HAVE_AT91_H32MX
>  	bool
>  
> -config SOC_AT91SAM9
> -	bool
> -	select ATMEL_AIC_IRQ
> -	select COMMON_CLK_AT91
> -	select CPU_ARM926T
> -	select GENERIC_CLOCKEVENTS
> -	select MEMORY
> -	select ATMEL_SDRAMC
> -
>  config SOC_SAMA5
>  	bool
>  	select ATMEL_AIC5_IRQ
> @@ -92,67 +83,36 @@ config SOC_AT91RM9200
>  	select GENERIC_CLOCKEVENTS
>  	select HAVE_AT91_USB_CLK
>  
> -config SOC_AT91SAM9260
> -	bool "AT91SAM9260, AT91SAM9XE or AT91SAM9G20"
> -	select SOC_AT91SAM9
> -	select HAVE_AT91_USB_CLK
> -	help
> -	  Select this if you are using one of Atmel's AT91SAM9260, AT91SAM9XE
> -	  or AT91SAM9G20 SoC.
> -
> -config SOC_AT91SAM9261
> -	bool "AT91SAM9261 or AT91SAM9G10"
> -	select HAVE_FB_ATMEL
> -	select SOC_AT91SAM9
> -	select HAVE_AT91_USB_CLK
> -	help
> -	  Select this if you are using one of Atmel's AT91SAM9261 or AT91SAM9G10 SoC.
> -
> -config SOC_AT91SAM9263
> -	bool "AT91SAM9263"
> -	select HAVE_FB_ATMEL
> -	select SOC_AT91SAM9
> -	select HAVE_AT91_USB_CLK
> -
> -config SOC_AT91SAM9RL
> -	bool "AT91SAM9RL"
> -	select HAVE_FB_ATMEL
> -	select SOC_AT91SAM9
> -	select HAVE_AT91_UTMI
> -
> -config SOC_AT91SAM9G45
> -	bool "AT91SAM9G45 or AT91SAM9M10 families"
> -	select HAVE_FB_ATMEL
> -	select SOC_AT91SAM9
> -	select HAVE_AT91_UTMI
> -	select HAVE_AT91_USB_CLK
> -	help
> -	  Select this if you are using one of Atmel's AT91SAM9G45 family SoC.
> -	  This support covers AT91SAM9G45, AT91SAM9G46, AT91SAM9M10 and AT91SAM9M11.
> -
> -config SOC_AT91SAM9X5
> -	bool "AT91SAM9x5 family"
> -	select HAVE_FB_ATMEL
> -	select SOC_AT91SAM9
> -	select HAVE_AT91_UTMI
> +config SOC_AT91SAM9
> +	bool "AT91SAM9"
> +	select ATMEL_AIC_IRQ
> +	select ATMEL_SDRAMC
> +	select COMMON_CLK_AT91
> +	select CPU_ARM926T
> +	select GENERIC_CLOCKEVENTS
>  	select HAVE_AT91_SMD
>  	select HAVE_AT91_USB_CLK
> -	help
> -	  Select this if you are using one of Atmel's AT91SAM9x5 family SoC.
> -	  This means that your SAM9 name finishes with a '5' (except if it is
> -	  AT91SAM9G45!).
> -	  This support covers AT91SAM9G15, AT91SAM9G25, AT91SAM9X25, AT91SAM9G35
> -	  and AT91SAM9X35.
> -
> -config SOC_AT91SAM9N12
> -	bool "AT91SAM9N12 family"
> +	select HAVE_AT91_UTMI
>  	select HAVE_FB_ATMEL
> -	select SOC_AT91SAM9
> -	select HAVE_AT91_USB_CLK
> +	select MEMORY
>  	help
> -	  Select this if you are using Atmel's AT91SAM9N12 SoC.
> -
> -# ----------------------------------------------------------
> +	  Select this if you are using one of those Atmel SoC:
> +	    AT91SAM9260
> +	    AT91SAM9261
> +	    AT91SAM9263
> +	    AT91SAM9G15
> +	    AT91SAM9G20
> +	    AT91SAM9G25
> +	    AT91SAM9G35
> +	    AT91SAM9G45
> +	    AT91SAM9G46
> +	    AT91SAM9M10
> +	    AT91SAM9M11
> +	    AT91SAM9N12
> +	    AT91SAM9RL
> +	    AT91SAM9X25
> +	    AT91SAM9X35
> +	    AT91SAM9XE
>  endif # SOC_SAM_V4_V5
>  
>  comment "AT91 Feature Selections"
> 


-- 
Nicolas Ferre

^ permalink raw reply	[flat|nested] 56+ messages in thread

* Re: [PATCH 00/17] AT91 cleanup for 3.20 #3
  2015-01-15 21:58 ` Alexandre Belloni
@ 2015-01-22 10:31   ` Nicolas Ferre
  -1 siblings, 0 replies; 56+ messages in thread
From: Nicolas Ferre @ 2015-01-22 10:31 UTC (permalink / raw)
  To: Alexandre Belloni
  Cc: Jean-Christophe Plagniol-Villard, Arnd Bergmann, Boris Brezillon,
	Bo Shen, Wenyou Yang, linux-arm-kernel, linux-kernel

Le 15/01/2015 22:58, Alexandre Belloni a écrit :
> This patch sets is based on AT91 cleanup for 3.20 #2. it goes further in the
> cleanup.
> 
> It merges board-dt ans soc files, ending up with only at91rm9200.c, at91sam9.c,
> sama5d3.c and sama5d4.c.

I'm not entirely comfortable with this this merge. Maybe I'm too used to
"board files" ;-)
On the other hand, there is also a phy fixup that will go into the sama5
board file (in "fixes for 3.19").

So, I may delay these changes a little bit.

> It merges all the SOC_AT91SAM9xxx config option under SOC_AT91SAM9.
> 
> It also removes unused headers.
> 
> There is also one fix regarding arm_pm_idle for sam9n12 and sam9g45.

I'm reordering these patches a little bit for creating a at91-cleanup3
tag that I can send quickly.

So, let's rework this series a little bit.

Bye,

> Alexandre Belloni (15):
>   ARM: at91:remove unused mach/system_rev.h
>   ARM: at91: fix sam9n12 and sam9x5 arm_pm_idle
>   ARM: at91: sam9: set arm_pm_idle from sam9_dt_device_init
>   ARM: at91: remove unused at91_ioremap_matrix and header
>   ARM: at91: remove unused _matrix.h headers
>   ARM: at91: stop using HAVE_AT91_DBGUx
>   ARM: at91: pm: remove warning to remove SOC_AT91SAM9263 usage
>   ARM: at91: merge SOC_AT91SAM9xxx
>   ARM: at91: remove at91_boot_soc
>   ARM: at91: rework initialization for rm9200 based boards
>   ARM: at91: rework initialization for sam9 based boards
>   ARM: at91: rework initialization for sama5 based boards
>   ARM: at91: remove old setup
>   ARM: at91: mark const init data with __initconst instead of __initdata
>   ARM: at91: remove at91_dt_initialize
> 
> Arnd Bergmann (2):
>   ARM: at91: merge at91rm9200 files
>   ARM: at91: move sama5 specific code into per-soc files
> 
>  arch/arm/Kconfig.debug                             |   6 +-
>  arch/arm/configs/at91_dt_defconfig                 |  10 +-
>  arch/arm/mach-at91/Kconfig                         | 111 ++----
>  arch/arm/mach-at91/Makefile                        |  17 +-
>  arch/arm/mach-at91/at91rm9200.c                    |  49 ++-
>  arch/arm/mach-at91/{board-dt-sam9.c => at91sam9.c} |  21 +-
>  arch/arm/mach-at91/at91sam9260.c                   |  32 --
>  arch/arm/mach-at91/at91sam9261.c                   |  31 --
>  arch/arm/mach-at91/at91sam9263.c                   |  30 --
>  arch/arm/mach-at91/at91sam9g45.c                   |  30 --
>  arch/arm/mach-at91/at91sam9n12.c                   |  20 -
>  arch/arm/mach-at91/at91sam9rl.c                    |  32 --
>  arch/arm/mach-at91/at91sam9x5.c                    |  20 -
>  arch/arm/mach-at91/board-dt-rm9200.c               |  54 ---
>  arch/arm/mach-at91/board-dt-sama5.c                |  60 ---
>  arch/arm/mach-at91/generic.h                       |  11 -
>  arch/arm/mach-at91/include/mach/at91_dbgu.h        |  63 ----
>  arch/arm/mach-at91/include/mach/at91_matrix.h      |  23 --
>  arch/arm/mach-at91/include/mach/at91_ramc.h        |   6 -
>  .../mach-at91/include/mach/at91sam9260_matrix.h    |  80 ----
>  .../mach-at91/include/mach/at91sam9261_matrix.h    |  64 ----
>  .../mach-at91/include/mach/at91sam9263_matrix.h    | 129 -------
>  arch/arm/mach-at91/include/mach/at91sam9_smc.h     |   2 -
>  .../mach-at91/include/mach/at91sam9g45_matrix.h    | 153 --------
>  .../mach-at91/include/mach/at91sam9n12_matrix.h    |  53 ---
>  .../arm/mach-at91/include/mach/at91sam9rl_matrix.h |  96 -----
>  .../arm/mach-at91/include/mach/at91sam9x5_matrix.h |  53 ---
>  arch/arm/mach-at91/include/mach/cpu.h              | 240 ------------
>  arch/arm/mach-at91/include/mach/system_rev.h       |  27 --
>  arch/arm/mach-at91/pm.c                            |  48 ++-
>  arch/arm/mach-at91/pm_slowclock.S                  |   9 -
>  arch/arm/mach-at91/sama5d3.c                       |  31 +-
>  arch/arm/mach-at91/sama5d4.c                       |  35 +-
>  arch/arm/mach-at91/setup.c                         | 407 ---------------------
>  arch/arm/mach-at91/soc.h                           |  77 ----
>  35 files changed, 151 insertions(+), 1979 deletions(-)
>  rename arch/arm/mach-at91/{board-dt-sam9.c => at91sam9.c} (71%)
>  delete mode 100644 arch/arm/mach-at91/at91sam9260.c
>  delete mode 100644 arch/arm/mach-at91/at91sam9261.c
>  delete mode 100644 arch/arm/mach-at91/at91sam9263.c
>  delete mode 100644 arch/arm/mach-at91/at91sam9g45.c
>  delete mode 100644 arch/arm/mach-at91/at91sam9n12.c
>  delete mode 100644 arch/arm/mach-at91/at91sam9rl.c
>  delete mode 100644 arch/arm/mach-at91/at91sam9x5.c
>  delete mode 100644 arch/arm/mach-at91/board-dt-rm9200.c
>  delete mode 100644 arch/arm/mach-at91/board-dt-sama5.c
>  delete mode 100644 arch/arm/mach-at91/include/mach/at91_dbgu.h
>  delete mode 100644 arch/arm/mach-at91/include/mach/at91_matrix.h
>  delete mode 100644 arch/arm/mach-at91/include/mach/at91sam9260_matrix.h
>  delete mode 100644 arch/arm/mach-at91/include/mach/at91sam9261_matrix.h
>  delete mode 100644 arch/arm/mach-at91/include/mach/at91sam9263_matrix.h
>  delete mode 100644 arch/arm/mach-at91/include/mach/at91sam9g45_matrix.h
>  delete mode 100644 arch/arm/mach-at91/include/mach/at91sam9n12_matrix.h
>  delete mode 100644 arch/arm/mach-at91/include/mach/at91sam9rl_matrix.h
>  delete mode 100644 arch/arm/mach-at91/include/mach/at91sam9x5_matrix.h
>  delete mode 100644 arch/arm/mach-at91/include/mach/cpu.h
>  delete mode 100644 arch/arm/mach-at91/include/mach/system_rev.h
>  delete mode 100644 arch/arm/mach-at91/setup.c
>  delete mode 100644 arch/arm/mach-at91/soc.h
> 


-- 
Nicolas Ferre

^ permalink raw reply	[flat|nested] 56+ messages in thread

* [PATCH 00/17] AT91 cleanup for 3.20 #3
@ 2015-01-22 10:31   ` Nicolas Ferre
  0 siblings, 0 replies; 56+ messages in thread
From: Nicolas Ferre @ 2015-01-22 10:31 UTC (permalink / raw)
  To: linux-arm-kernel

Le 15/01/2015 22:58, Alexandre Belloni a ?crit :
> This patch sets is based on AT91 cleanup for 3.20 #2. it goes further in the
> cleanup.
> 
> It merges board-dt ans soc files, ending up with only at91rm9200.c, at91sam9.c,
> sama5d3.c and sama5d4.c.

I'm not entirely comfortable with this this merge. Maybe I'm too used to
"board files" ;-)
On the other hand, there is also a phy fixup that will go into the sama5
board file (in "fixes for 3.19").

So, I may delay these changes a little bit.

> It merges all the SOC_AT91SAM9xxx config option under SOC_AT91SAM9.
> 
> It also removes unused headers.
> 
> There is also one fix regarding arm_pm_idle for sam9n12 and sam9g45.

I'm reordering these patches a little bit for creating a at91-cleanup3
tag that I can send quickly.

So, let's rework this series a little bit.

Bye,

> Alexandre Belloni (15):
>   ARM: at91:remove unused mach/system_rev.h
>   ARM: at91: fix sam9n12 and sam9x5 arm_pm_idle
>   ARM: at91: sam9: set arm_pm_idle from sam9_dt_device_init
>   ARM: at91: remove unused at91_ioremap_matrix and header
>   ARM: at91: remove unused _matrix.h headers
>   ARM: at91: stop using HAVE_AT91_DBGUx
>   ARM: at91: pm: remove warning to remove SOC_AT91SAM9263 usage
>   ARM: at91: merge SOC_AT91SAM9xxx
>   ARM: at91: remove at91_boot_soc
>   ARM: at91: rework initialization for rm9200 based boards
>   ARM: at91: rework initialization for sam9 based boards
>   ARM: at91: rework initialization for sama5 based boards
>   ARM: at91: remove old setup
>   ARM: at91: mark const init data with __initconst instead of __initdata
>   ARM: at91: remove at91_dt_initialize
> 
> Arnd Bergmann (2):
>   ARM: at91: merge at91rm9200 files
>   ARM: at91: move sama5 specific code into per-soc files
> 
>  arch/arm/Kconfig.debug                             |   6 +-
>  arch/arm/configs/at91_dt_defconfig                 |  10 +-
>  arch/arm/mach-at91/Kconfig                         | 111 ++----
>  arch/arm/mach-at91/Makefile                        |  17 +-
>  arch/arm/mach-at91/at91rm9200.c                    |  49 ++-
>  arch/arm/mach-at91/{board-dt-sam9.c => at91sam9.c} |  21 +-
>  arch/arm/mach-at91/at91sam9260.c                   |  32 --
>  arch/arm/mach-at91/at91sam9261.c                   |  31 --
>  arch/arm/mach-at91/at91sam9263.c                   |  30 --
>  arch/arm/mach-at91/at91sam9g45.c                   |  30 --
>  arch/arm/mach-at91/at91sam9n12.c                   |  20 -
>  arch/arm/mach-at91/at91sam9rl.c                    |  32 --
>  arch/arm/mach-at91/at91sam9x5.c                    |  20 -
>  arch/arm/mach-at91/board-dt-rm9200.c               |  54 ---
>  arch/arm/mach-at91/board-dt-sama5.c                |  60 ---
>  arch/arm/mach-at91/generic.h                       |  11 -
>  arch/arm/mach-at91/include/mach/at91_dbgu.h        |  63 ----
>  arch/arm/mach-at91/include/mach/at91_matrix.h      |  23 --
>  arch/arm/mach-at91/include/mach/at91_ramc.h        |   6 -
>  .../mach-at91/include/mach/at91sam9260_matrix.h    |  80 ----
>  .../mach-at91/include/mach/at91sam9261_matrix.h    |  64 ----
>  .../mach-at91/include/mach/at91sam9263_matrix.h    | 129 -------
>  arch/arm/mach-at91/include/mach/at91sam9_smc.h     |   2 -
>  .../mach-at91/include/mach/at91sam9g45_matrix.h    | 153 --------
>  .../mach-at91/include/mach/at91sam9n12_matrix.h    |  53 ---
>  .../arm/mach-at91/include/mach/at91sam9rl_matrix.h |  96 -----
>  .../arm/mach-at91/include/mach/at91sam9x5_matrix.h |  53 ---
>  arch/arm/mach-at91/include/mach/cpu.h              | 240 ------------
>  arch/arm/mach-at91/include/mach/system_rev.h       |  27 --
>  arch/arm/mach-at91/pm.c                            |  48 ++-
>  arch/arm/mach-at91/pm_slowclock.S                  |   9 -
>  arch/arm/mach-at91/sama5d3.c                       |  31 +-
>  arch/arm/mach-at91/sama5d4.c                       |  35 +-
>  arch/arm/mach-at91/setup.c                         | 407 ---------------------
>  arch/arm/mach-at91/soc.h                           |  77 ----
>  35 files changed, 151 insertions(+), 1979 deletions(-)
>  rename arch/arm/mach-at91/{board-dt-sam9.c => at91sam9.c} (71%)
>  delete mode 100644 arch/arm/mach-at91/at91sam9260.c
>  delete mode 100644 arch/arm/mach-at91/at91sam9261.c
>  delete mode 100644 arch/arm/mach-at91/at91sam9263.c
>  delete mode 100644 arch/arm/mach-at91/at91sam9g45.c
>  delete mode 100644 arch/arm/mach-at91/at91sam9n12.c
>  delete mode 100644 arch/arm/mach-at91/at91sam9rl.c
>  delete mode 100644 arch/arm/mach-at91/at91sam9x5.c
>  delete mode 100644 arch/arm/mach-at91/board-dt-rm9200.c
>  delete mode 100644 arch/arm/mach-at91/board-dt-sama5.c
>  delete mode 100644 arch/arm/mach-at91/include/mach/at91_dbgu.h
>  delete mode 100644 arch/arm/mach-at91/include/mach/at91_matrix.h
>  delete mode 100644 arch/arm/mach-at91/include/mach/at91sam9260_matrix.h
>  delete mode 100644 arch/arm/mach-at91/include/mach/at91sam9261_matrix.h
>  delete mode 100644 arch/arm/mach-at91/include/mach/at91sam9263_matrix.h
>  delete mode 100644 arch/arm/mach-at91/include/mach/at91sam9g45_matrix.h
>  delete mode 100644 arch/arm/mach-at91/include/mach/at91sam9n12_matrix.h
>  delete mode 100644 arch/arm/mach-at91/include/mach/at91sam9rl_matrix.h
>  delete mode 100644 arch/arm/mach-at91/include/mach/at91sam9x5_matrix.h
>  delete mode 100644 arch/arm/mach-at91/include/mach/cpu.h
>  delete mode 100644 arch/arm/mach-at91/include/mach/system_rev.h
>  delete mode 100644 arch/arm/mach-at91/setup.c
>  delete mode 100644 arch/arm/mach-at91/soc.h
> 


-- 
Nicolas Ferre

^ permalink raw reply	[flat|nested] 56+ messages in thread

* Re: [PATCH 10/17] ARM: at91: merge SOC_AT91SAM9xxx
  2015-01-22 10:22     ` Nicolas Ferre
@ 2015-01-22 16:36       ` Alexandre Belloni
  -1 siblings, 0 replies; 56+ messages in thread
From: Alexandre Belloni @ 2015-01-22 16:36 UTC (permalink / raw)
  To: Nicolas Ferre
  Cc: Jean-Christophe Plagniol-Villard, Arnd Bergmann, Boris Brezillon,
	Bo Shen, Wenyou Yang, linux-arm-kernel, linux-kernel

On 22/01/2015 at 11:22:21 +0100, Nicolas Ferre wrote :
> Le 15/01/2015 22:58, Alexandre Belloni a écrit :
> > Only use SOC_AT91SAM9 for all the at91sam9 SoCs.
> > 
> > It enables HAVE_AT91_SMD and HAVE_AT91_UTMI for all the sam9 SoCs but this only
> > represents 96 bytes of uncompressed kernel code.
> 
> After this patch that removes all the CONFIG_SOC_AT91SAM9xxxx options
> excepted CONFIG_SOC_AT91SAM9, I still see a lot of them remaining in the
> source tree.
> 
> So, this patch is not complete in my opinion. Even if you remove these
> options later on, why not suppress them here?
> 

They went through other branches (you were in copy).


-- 
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 56+ messages in thread

* [PATCH 10/17] ARM: at91: merge SOC_AT91SAM9xxx
@ 2015-01-22 16:36       ` Alexandre Belloni
  0 siblings, 0 replies; 56+ messages in thread
From: Alexandre Belloni @ 2015-01-22 16:36 UTC (permalink / raw)
  To: linux-arm-kernel

On 22/01/2015 at 11:22:21 +0100, Nicolas Ferre wrote :
> Le 15/01/2015 22:58, Alexandre Belloni a ?crit :
> > Only use SOC_AT91SAM9 for all the at91sam9 SoCs.
> > 
> > It enables HAVE_AT91_SMD and HAVE_AT91_UTMI for all the sam9 SoCs but this only
> > represents 96 bytes of uncompressed kernel code.
> 
> After this patch that removes all the CONFIG_SOC_AT91SAM9xxxx options
> excepted CONFIG_SOC_AT91SAM9, I still see a lot of them remaining in the
> source tree.
> 
> So, this patch is not complete in my opinion. Even if you remove these
> options later on, why not suppress them here?
> 

They went through other branches (you were in copy).


-- 
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 56+ messages in thread

* [PATCH v2] ARM: at91: merge SOC_AT91SAM9xxx
  2015-01-15 21:58   ` Alexandre Belloni
@ 2015-01-26 17:49     ` Nicolas Ferre
  -1 siblings, 0 replies; 56+ messages in thread
From: Nicolas Ferre @ 2015-01-26 17:49 UTC (permalink / raw)
  To: Alexandre Belloni
  Cc: Boris BREZILLON, linux-arm-kernel, linux-kernel,
	Jean-Christophe PLAGNIOL-VILLARD, Bo Shen, Wenyou Yang,
	Arnd Bergmann, Nicolas Ferre

From: Alexandre Belloni <alexandre.belloni@free-electrons.com>

Only use SOC_AT91SAM9 for all the at91sam9 SoCs.

It enables HAVE_AT91_SMD and HAVE_AT91_UTMI for all the sam9 SoCs but this only
represents 96 bytes of uncompressed kernel code.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
[nicolas.ferre@atmel.com: remove all use of particular SAM9 config options]
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
---
 arch/arm/configs/at91_dt_defconfig    | 10 +---
 arch/arm/mach-at91/Kconfig            | 92 ++++++++++-------------------------
 arch/arm/mach-at91/Makefile           |  7 ---
 arch/arm/mach-at91/at91sam9260.c      | 26 ----------
 arch/arm/mach-at91/at91sam9261.c      | 25 ----------
 arch/arm/mach-at91/at91sam9263.c      | 24 ---------
 arch/arm/mach-at91/at91sam9g45.c      | 24 ---------
 arch/arm/mach-at91/at91sam9n12.c      | 20 --------
 arch/arm/mach-at91/at91sam9rl.c       | 25 ----------
 arch/arm/mach-at91/at91sam9x5.c       | 20 --------
 arch/arm/mach-at91/include/mach/cpu.h | 52 ++++++--------------
 arch/arm/mach-at91/soc.h              | 20 +-------
 12 files changed, 42 insertions(+), 303 deletions(-)
 delete mode 100644 arch/arm/mach-at91/at91sam9260.c
 delete mode 100644 arch/arm/mach-at91/at91sam9261.c
 delete mode 100644 arch/arm/mach-at91/at91sam9263.c
 delete mode 100644 arch/arm/mach-at91/at91sam9g45.c
 delete mode 100644 arch/arm/mach-at91/at91sam9n12.c
 delete mode 100644 arch/arm/mach-at91/at91sam9rl.c
 delete mode 100644 arch/arm/mach-at91/at91sam9x5.c

diff --git a/arch/arm/configs/at91_dt_defconfig b/arch/arm/configs/at91_dt_defconfig
index a67375f24b21..f2670f638e97 100644
--- a/arch/arm/configs/at91_dt_defconfig
+++ b/arch/arm/configs/at91_dt_defconfig
@@ -15,15 +15,7 @@ CONFIG_MODULE_UNLOAD=y
 # CONFIG_IOSCHED_CFQ is not set
 CONFIG_ARCH_AT91=y
 CONFIG_SOC_AT91RM9200=y
-CONFIG_SOC_AT91SAM9260=y
-CONFIG_SOC_AT91SAM9261=y
-CONFIG_SOC_AT91SAM9263=y
-CONFIG_SOC_AT91SAM9RL=y
-CONFIG_SOC_AT91SAM9G45=y
-CONFIG_SOC_AT91SAM9X5=y
-CONFIG_SOC_AT91SAM9N12=y
-CONFIG_MACH_AT91RM9200_DT=y
-CONFIG_MACH_AT91SAM9_DT=y
+CONFIG_SOC_AT91SAM9=y
 CONFIG_AT91_TIMER_HZ=128
 CONFIG_AEABI=y
 CONFIG_UACCESS_WITH_MEMCPY=y
diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
index c6956b863b9d..c6740e359a44 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -16,15 +16,6 @@ config HAVE_AT91_SMD
 config HAVE_AT91_H32MX
 	bool
 
-config SOC_AT91SAM9
-	bool
-	select ATMEL_AIC_IRQ
-	select COMMON_CLK_AT91
-	select CPU_ARM926T
-	select GENERIC_CLOCKEVENTS
-	select MEMORY
-	select ATMEL_SDRAMC
-
 config SOC_SAMA5
 	bool
 	select ATMEL_AIC5_IRQ
@@ -92,67 +83,36 @@ config SOC_AT91RM9200
 	select GENERIC_CLOCKEVENTS
 	select HAVE_AT91_USB_CLK
 
-config SOC_AT91SAM9260
-	bool "AT91SAM9260, AT91SAM9XE or AT91SAM9G20"
-	select SOC_AT91SAM9
-	select HAVE_AT91_USB_CLK
-	help
-	  Select this if you are using one of Atmel's AT91SAM9260, AT91SAM9XE
-	  or AT91SAM9G20 SoC.
-
-config SOC_AT91SAM9261
-	bool "AT91SAM9261 or AT91SAM9G10"
-	select HAVE_FB_ATMEL
-	select SOC_AT91SAM9
-	select HAVE_AT91_USB_CLK
-	help
-	  Select this if you are using one of Atmel's AT91SAM9261 or AT91SAM9G10 SoC.
-
-config SOC_AT91SAM9263
-	bool "AT91SAM9263"
-	select HAVE_FB_ATMEL
-	select SOC_AT91SAM9
-	select HAVE_AT91_USB_CLK
-
-config SOC_AT91SAM9RL
-	bool "AT91SAM9RL"
-	select HAVE_FB_ATMEL
-	select SOC_AT91SAM9
-	select HAVE_AT91_UTMI
-
-config SOC_AT91SAM9G45
-	bool "AT91SAM9G45 or AT91SAM9M10 families"
-	select HAVE_FB_ATMEL
-	select SOC_AT91SAM9
-	select HAVE_AT91_UTMI
-	select HAVE_AT91_USB_CLK
-	help
-	  Select this if you are using one of Atmel's AT91SAM9G45 family SoC.
-	  This support covers AT91SAM9G45, AT91SAM9G46, AT91SAM9M10 and AT91SAM9M11.
-
-config SOC_AT91SAM9X5
-	bool "AT91SAM9x5 family"
-	select HAVE_FB_ATMEL
-	select SOC_AT91SAM9
-	select HAVE_AT91_UTMI
+config SOC_AT91SAM9
+	bool "AT91SAM9"
+	select ATMEL_AIC_IRQ
+	select ATMEL_SDRAMC
+	select COMMON_CLK_AT91
+	select CPU_ARM926T
+	select GENERIC_CLOCKEVENTS
 	select HAVE_AT91_SMD
 	select HAVE_AT91_USB_CLK
-	help
-	  Select this if you are using one of Atmel's AT91SAM9x5 family SoC.
-	  This means that your SAM9 name finishes with a '5' (except if it is
-	  AT91SAM9G45!).
-	  This support covers AT91SAM9G15, AT91SAM9G25, AT91SAM9X25, AT91SAM9G35
-	  and AT91SAM9X35.
-
-config SOC_AT91SAM9N12
-	bool "AT91SAM9N12 family"
+	select HAVE_AT91_UTMI
 	select HAVE_FB_ATMEL
-	select SOC_AT91SAM9
-	select HAVE_AT91_USB_CLK
+	select MEMORY
 	help
-	  Select this if you are using Atmel's AT91SAM9N12 SoC.
-
-# ----------------------------------------------------------
+	  Select this if you are using one of those Atmel SoC:
+	    AT91SAM9260
+	    AT91SAM9261
+	    AT91SAM9263
+	    AT91SAM9G15
+	    AT91SAM9G20
+	    AT91SAM9G25
+	    AT91SAM9G35
+	    AT91SAM9G45
+	    AT91SAM9G46
+	    AT91SAM9M10
+	    AT91SAM9M11
+	    AT91SAM9N12
+	    AT91SAM9RL
+	    AT91SAM9X25
+	    AT91SAM9X35
+	    AT91SAM9XE
 endif # SOC_SAM_V4_V5
 
 comment "AT91 Feature Selections"
diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile
index 8ef7d9a2e855..ad7fc5834188 100644
--- a/arch/arm/mach-at91/Makefile
+++ b/arch/arm/mach-at91/Makefile
@@ -8,13 +8,6 @@ obj-$(CONFIG_SOC_AT91SAM9)	+= sam9_smc.o
 
 # CPU-specific support
 obj-$(CONFIG_SOC_AT91RM9200)	+= at91rm9200.o at91rm9200_time.o
-obj-$(CONFIG_SOC_AT91SAM9260)	+= at91sam9260.o
-obj-$(CONFIG_SOC_AT91SAM9261)	+= at91sam9261.o
-obj-$(CONFIG_SOC_AT91SAM9263)	+= at91sam9263.o
-obj-$(CONFIG_SOC_AT91SAM9G45)	+= at91sam9g45.o
-obj-$(CONFIG_SOC_AT91SAM9N12)	+= at91sam9n12.o
-obj-$(CONFIG_SOC_AT91SAM9X5)	+= at91sam9x5.o
-obj-$(CONFIG_SOC_AT91SAM9RL)	+= at91sam9rl.o
 obj-$(CONFIG_SOC_SAMA5D3)	+= sama5d3.o
 obj-$(CONFIG_SOC_SAMA5D4)	+= sama5d4.o
 
diff --git a/arch/arm/mach-at91/at91sam9260.c b/arch/arm/mach-at91/at91sam9260.c
deleted file mode 100644
index 37b7ce4c6a3b..000000000000
--- a/arch/arm/mach-at91/at91sam9260.c
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * arch/arm/mach-at91/at91sam9260.c
- *
- *  Copyright (C) 2006 SAN People
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- */
-
-#include <asm/system_misc.h>
-#include <mach/cpu.h>
-#include <mach/at91_dbgu.h>
-#include <mach/hardware.h>
-
-#include "soc.h"
-#include "generic.h"
-
-/* --------------------------------------------------------------------
- *  AT91SAM9260 processor initialization
- * -------------------------------------------------------------------- */
-
-AT91_SOC_START(at91sam9260)
-AT91_SOC_END
diff --git a/arch/arm/mach-at91/at91sam9261.c b/arch/arm/mach-at91/at91sam9261.c
deleted file mode 100644
index aebbf76b6038..000000000000
--- a/arch/arm/mach-at91/at91sam9261.c
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * arch/arm/mach-at91/at91sam9261.c
- *
- *  Copyright (C) 2005 SAN People
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- */
-
-#include <asm/system_misc.h>
-#include <mach/cpu.h>
-#include <mach/hardware.h>
-
-#include "soc.h"
-#include "generic.h"
-
-/* --------------------------------------------------------------------
- *  AT91SAM9261 processor initialization
- * -------------------------------------------------------------------- */
-
-AT91_SOC_START(at91sam9261)
-AT91_SOC_END
diff --git a/arch/arm/mach-at91/at91sam9263.c b/arch/arm/mach-at91/at91sam9263.c
deleted file mode 100644
index dca29457d9cc..000000000000
--- a/arch/arm/mach-at91/at91sam9263.c
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * arch/arm/mach-at91/at91sam9263.c
- *
- *  Copyright (C) 2007 Atmel Corporation.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- */
-
-#include <asm/system_misc.h>
-#include <mach/hardware.h>
-
-#include "soc.h"
-#include "generic.h"
-
-/* --------------------------------------------------------------------
- *  AT91SAM9263 processor initialization
- * -------------------------------------------------------------------- */
-
-AT91_SOC_START(at91sam9263)
-AT91_SOC_END
diff --git a/arch/arm/mach-at91/at91sam9g45.c b/arch/arm/mach-at91/at91sam9g45.c
deleted file mode 100644
index 4957a9ef748a..000000000000
--- a/arch/arm/mach-at91/at91sam9g45.c
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- *  Chip-specific setup code for the AT91SAM9G45 family
- *
- *  Copyright (C) 2009 Atmel Corporation.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- */
-
-#include <asm/system_misc.h>
-#include <mach/hardware.h>
-
-#include "soc.h"
-#include "generic.h"
-
-/* --------------------------------------------------------------------
- *  AT91SAM9G45 processor initialization
- * -------------------------------------------------------------------- */
-
-AT91_SOC_START(at91sam9g45)
-AT91_SOC_END
diff --git a/arch/arm/mach-at91/at91sam9n12.c b/arch/arm/mach-at91/at91sam9n12.c
deleted file mode 100644
index b5ea69a3eaf6..000000000000
--- a/arch/arm/mach-at91/at91sam9n12.c
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * SoC specific setup code for the AT91SAM9N12
- *
- * Copyright (C) 2012 Atmel Corporation.
- *
- * Licensed under GPLv2 or later.
- */
-
-#include <asm/system_misc.h>
-#include <mach/hardware.h>
-
-#include "soc.h"
-#include "generic.h"
-
-/* --------------------------------------------------------------------
- *  AT91SAM9N12 processor initialization
- * -------------------------------------------------------------------- */
-
-AT91_SOC_START(at91sam9n12)
-AT91_SOC_END
diff --git a/arch/arm/mach-at91/at91sam9rl.c b/arch/arm/mach-at91/at91sam9rl.c
deleted file mode 100644
index 6cb40e4ec20f..000000000000
--- a/arch/arm/mach-at91/at91sam9rl.c
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * arch/arm/mach-at91/at91sam9rl.c
- *
- *  Copyright (C) 2005 SAN People
- *  Copyright (C) 2007 Atmel Corporation
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file COPYING in the main directory of this archive for
- * more details.
- */
-
-#include <asm/system_misc.h>
-#include <mach/cpu.h>
-#include <mach/at91_dbgu.h>
-#include <mach/hardware.h>
-
-#include "soc.h"
-#include "generic.h"
-
-/* --------------------------------------------------------------------
- *  AT91SAM9RL processor initialization
- * -------------------------------------------------------------------- */
-
-AT91_SOC_START(at91sam9rl)
-AT91_SOC_END
diff --git a/arch/arm/mach-at91/at91sam9x5.c b/arch/arm/mach-at91/at91sam9x5.c
deleted file mode 100644
index 7b60a529db01..000000000000
--- a/arch/arm/mach-at91/at91sam9x5.c
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- *  Chip-specific setup code for the AT91SAM9x5 family
- *
- *  Copyright (C) 2010-2012 Atmel Corporation.
- *
- * Licensed under GPLv2 or later.
- */
-
-#include <asm/system_misc.h>
-#include <mach/hardware.h>
-
-#include "soc.h"
-#include "generic.h"
-
-/* --------------------------------------------------------------------
- *  AT91SAM9x5 processor initialization
- * -------------------------------------------------------------------- */
-
-AT91_SOC_START(at91sam9x5)
-AT91_SOC_END
diff --git a/arch/arm/mach-at91/include/mach/cpu.h b/arch/arm/mach-at91/include/mach/cpu.h
index 61914fb35f5d..ce7c80a44983 100644
--- a/arch/arm/mach-at91/include/mach/cpu.h
+++ b/arch/arm/mach-at91/include/mach/cpu.h
@@ -152,69 +152,45 @@ static inline int at91_soc_is_detected(void)
 #define cpu_is_at91rm9200_pqfp() (0)
 #endif
 
-#ifdef CONFIG_SOC_AT91SAM9260
+#ifdef CONFIG_SOC_AT91SAM9
 #define cpu_is_at91sam9xe()	(at91_soc_initdata.subtype == AT91_SOC_SAM9XE)
 #define cpu_is_at91sam9260()	(at91_soc_initdata.type == AT91_SOC_SAM9260)
 #define cpu_is_at91sam9g20()	(at91_soc_initdata.type == AT91_SOC_SAM9G20)
-#else
-#define cpu_is_at91sam9xe()	(0)
-#define cpu_is_at91sam9260()	(0)
-#define cpu_is_at91sam9g20()	(0)
-#endif
-
-#ifdef CONFIG_SOC_AT91SAM9261
 #define cpu_is_at91sam9261()	(at91_soc_initdata.type == AT91_SOC_SAM9261)
 #define cpu_is_at91sam9g10()	(at91_soc_initdata.type == AT91_SOC_SAM9G10)
-#else
-#define cpu_is_at91sam9261()	(0)
-#define cpu_is_at91sam9g10()	(0)
-#endif
-
-#ifdef CONFIG_SOC_AT91SAM9263
 #define cpu_is_at91sam9263()	(at91_soc_initdata.type == AT91_SOC_SAM9263)
-#else
-#define cpu_is_at91sam9263()	(0)
-#endif
-
-#ifdef CONFIG_SOC_AT91SAM9RL
 #define cpu_is_at91sam9rl()	(at91_soc_initdata.type == AT91_SOC_SAM9RL)
-#else
-#define cpu_is_at91sam9rl()	(0)
-#endif
-
-#ifdef CONFIG_SOC_AT91SAM9G45
 #define cpu_is_at91sam9g45()	(at91_soc_initdata.type == AT91_SOC_SAM9G45)
 #define cpu_is_at91sam9g45es()	(at91_soc_initdata.subtype == AT91_SOC_SAM9G45ES)
 #define cpu_is_at91sam9m10()	(at91_soc_initdata.subtype == AT91_SOC_SAM9M10)
 #define cpu_is_at91sam9g46()	(at91_soc_initdata.subtype == AT91_SOC_SAM9G46)
 #define cpu_is_at91sam9m11()	(at91_soc_initdata.subtype == AT91_SOC_SAM9M11)
-#else
-#define cpu_is_at91sam9g45()	(0)
-#define cpu_is_at91sam9g45es()	(0)
-#define cpu_is_at91sam9m10()	(0)
-#define cpu_is_at91sam9g46()	(0)
-#define cpu_is_at91sam9m11()	(0)
-#endif
-
-#ifdef CONFIG_SOC_AT91SAM9X5
 #define cpu_is_at91sam9x5()	(at91_soc_initdata.type == AT91_SOC_SAM9X5)
 #define cpu_is_at91sam9g15()	(at91_soc_initdata.subtype == AT91_SOC_SAM9G15)
 #define cpu_is_at91sam9g35()	(at91_soc_initdata.subtype == AT91_SOC_SAM9G35)
 #define cpu_is_at91sam9x35()	(at91_soc_initdata.subtype == AT91_SOC_SAM9X35)
 #define cpu_is_at91sam9g25()	(at91_soc_initdata.subtype == AT91_SOC_SAM9G25)
 #define cpu_is_at91sam9x25()	(at91_soc_initdata.subtype == AT91_SOC_SAM9X25)
+#define cpu_is_at91sam9n12()	(at91_soc_initdata.type == AT91_SOC_SAM9N12)
 #else
+#define cpu_is_at91sam9xe()	(0)
+#define cpu_is_at91sam9260()	(0)
+#define cpu_is_at91sam9g20()	(0)
+#define cpu_is_at91sam9261()	(0)
+#define cpu_is_at91sam9g10()	(0)
+#define cpu_is_at91sam9263()	(0)
+#define cpu_is_at91sam9rl()	(0)
+#define cpu_is_at91sam9g45()	(0)
+#define cpu_is_at91sam9g45es()	(0)
+#define cpu_is_at91sam9m10()	(0)
+#define cpu_is_at91sam9g46()	(0)
+#define cpu_is_at91sam9m11()	(0)
 #define cpu_is_at91sam9x5()	(0)
 #define cpu_is_at91sam9g15()	(0)
 #define cpu_is_at91sam9g35()	(0)
 #define cpu_is_at91sam9x35()	(0)
 #define cpu_is_at91sam9g25()	(0)
 #define cpu_is_at91sam9x25()	(0)
-#endif
-
-#ifdef CONFIG_SOC_AT91SAM9N12
-#define cpu_is_at91sam9n12()	(at91_soc_initdata.type == AT91_SOC_SAM9N12)
-#else
 #define cpu_is_at91sam9n12()	(0)
 #endif
 
diff --git a/arch/arm/mach-at91/soc.h b/arch/arm/mach-at91/soc.h
index ae6c0b2f1146..f803e1016f74 100644
--- a/arch/arm/mach-at91/soc.h
+++ b/arch/arm/mach-at91/soc.h
@@ -40,31 +40,13 @@ static inline int at91_soc_is_enabled(void)
 #define at91rm9200_soc	at91_boot_soc
 #endif
 
-#if !defined(CONFIG_SOC_AT91SAM9260)
+#if !defined(CONFIG_SOC_AT91SAM9)
 #define at91sam9260_soc	at91_boot_soc
-#endif
-
-#if !defined(CONFIG_SOC_AT91SAM9261)
 #define at91sam9261_soc	at91_boot_soc
-#endif
-
-#if !defined(CONFIG_SOC_AT91SAM9263)
 #define at91sam9263_soc	at91_boot_soc
-#endif
-
-#if !defined(CONFIG_SOC_AT91SAM9G45)
 #define at91sam9g45_soc	at91_boot_soc
-#endif
-
-#if !defined(CONFIG_SOC_AT91SAM9RL)
 #define at91sam9rl_soc	at91_boot_soc
-#endif
-
-#if !defined(CONFIG_SOC_AT91SAM9X5)
 #define at91sam9x5_soc	at91_boot_soc
-#endif
-
-#if !defined(CONFIG_SOC_AT91SAM9N12)
 #define at91sam9n12_soc	at91_boot_soc
 #endif
 
-- 
2.1.3


^ permalink raw reply related	[flat|nested] 56+ messages in thread

* [PATCH v2] ARM: at91: merge SOC_AT91SAM9xxx
@ 2015-01-26 17:49     ` Nicolas Ferre
  0 siblings, 0 replies; 56+ messages in thread
From: Nicolas Ferre @ 2015-01-26 17:49 UTC (permalink / raw)
  To: linux-arm-kernel

From: Alexandre Belloni <alexandre.belloni@free-electrons.com>

Only use SOC_AT91SAM9 for all the at91sam9 SoCs.

It enables HAVE_AT91_SMD and HAVE_AT91_UTMI for all the sam9 SoCs but this only
represents 96 bytes of uncompressed kernel code.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
[nicolas.ferre at atmel.com: remove all use of particular SAM9 config options]
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
---
 arch/arm/configs/at91_dt_defconfig    | 10 +---
 arch/arm/mach-at91/Kconfig            | 92 ++++++++++-------------------------
 arch/arm/mach-at91/Makefile           |  7 ---
 arch/arm/mach-at91/at91sam9260.c      | 26 ----------
 arch/arm/mach-at91/at91sam9261.c      | 25 ----------
 arch/arm/mach-at91/at91sam9263.c      | 24 ---------
 arch/arm/mach-at91/at91sam9g45.c      | 24 ---------
 arch/arm/mach-at91/at91sam9n12.c      | 20 --------
 arch/arm/mach-at91/at91sam9rl.c       | 25 ----------
 arch/arm/mach-at91/at91sam9x5.c       | 20 --------
 arch/arm/mach-at91/include/mach/cpu.h | 52 ++++++--------------
 arch/arm/mach-at91/soc.h              | 20 +-------
 12 files changed, 42 insertions(+), 303 deletions(-)
 delete mode 100644 arch/arm/mach-at91/at91sam9260.c
 delete mode 100644 arch/arm/mach-at91/at91sam9261.c
 delete mode 100644 arch/arm/mach-at91/at91sam9263.c
 delete mode 100644 arch/arm/mach-at91/at91sam9g45.c
 delete mode 100644 arch/arm/mach-at91/at91sam9n12.c
 delete mode 100644 arch/arm/mach-at91/at91sam9rl.c
 delete mode 100644 arch/arm/mach-at91/at91sam9x5.c

diff --git a/arch/arm/configs/at91_dt_defconfig b/arch/arm/configs/at91_dt_defconfig
index a67375f24b21..f2670f638e97 100644
--- a/arch/arm/configs/at91_dt_defconfig
+++ b/arch/arm/configs/at91_dt_defconfig
@@ -15,15 +15,7 @@ CONFIG_MODULE_UNLOAD=y
 # CONFIG_IOSCHED_CFQ is not set
 CONFIG_ARCH_AT91=y
 CONFIG_SOC_AT91RM9200=y
-CONFIG_SOC_AT91SAM9260=y
-CONFIG_SOC_AT91SAM9261=y
-CONFIG_SOC_AT91SAM9263=y
-CONFIG_SOC_AT91SAM9RL=y
-CONFIG_SOC_AT91SAM9G45=y
-CONFIG_SOC_AT91SAM9X5=y
-CONFIG_SOC_AT91SAM9N12=y
-CONFIG_MACH_AT91RM9200_DT=y
-CONFIG_MACH_AT91SAM9_DT=y
+CONFIG_SOC_AT91SAM9=y
 CONFIG_AT91_TIMER_HZ=128
 CONFIG_AEABI=y
 CONFIG_UACCESS_WITH_MEMCPY=y
diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
index c6956b863b9d..c6740e359a44 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -16,15 +16,6 @@ config HAVE_AT91_SMD
 config HAVE_AT91_H32MX
 	bool
 
-config SOC_AT91SAM9
-	bool
-	select ATMEL_AIC_IRQ
-	select COMMON_CLK_AT91
-	select CPU_ARM926T
-	select GENERIC_CLOCKEVENTS
-	select MEMORY
-	select ATMEL_SDRAMC
-
 config SOC_SAMA5
 	bool
 	select ATMEL_AIC5_IRQ
@@ -92,67 +83,36 @@ config SOC_AT91RM9200
 	select GENERIC_CLOCKEVENTS
 	select HAVE_AT91_USB_CLK
 
-config SOC_AT91SAM9260
-	bool "AT91SAM9260, AT91SAM9XE or AT91SAM9G20"
-	select SOC_AT91SAM9
-	select HAVE_AT91_USB_CLK
-	help
-	  Select this if you are using one of Atmel's AT91SAM9260, AT91SAM9XE
-	  or AT91SAM9G20 SoC.
-
-config SOC_AT91SAM9261
-	bool "AT91SAM9261 or AT91SAM9G10"
-	select HAVE_FB_ATMEL
-	select SOC_AT91SAM9
-	select HAVE_AT91_USB_CLK
-	help
-	  Select this if you are using one of Atmel's AT91SAM9261 or AT91SAM9G10 SoC.
-
-config SOC_AT91SAM9263
-	bool "AT91SAM9263"
-	select HAVE_FB_ATMEL
-	select SOC_AT91SAM9
-	select HAVE_AT91_USB_CLK
-
-config SOC_AT91SAM9RL
-	bool "AT91SAM9RL"
-	select HAVE_FB_ATMEL
-	select SOC_AT91SAM9
-	select HAVE_AT91_UTMI
-
-config SOC_AT91SAM9G45
-	bool "AT91SAM9G45 or AT91SAM9M10 families"
-	select HAVE_FB_ATMEL
-	select SOC_AT91SAM9
-	select HAVE_AT91_UTMI
-	select HAVE_AT91_USB_CLK
-	help
-	  Select this if you are using one of Atmel's AT91SAM9G45 family SoC.
-	  This support covers AT91SAM9G45, AT91SAM9G46, AT91SAM9M10 and AT91SAM9M11.
-
-config SOC_AT91SAM9X5
-	bool "AT91SAM9x5 family"
-	select HAVE_FB_ATMEL
-	select SOC_AT91SAM9
-	select HAVE_AT91_UTMI
+config SOC_AT91SAM9
+	bool "AT91SAM9"
+	select ATMEL_AIC_IRQ
+	select ATMEL_SDRAMC
+	select COMMON_CLK_AT91
+	select CPU_ARM926T
+	select GENERIC_CLOCKEVENTS
 	select HAVE_AT91_SMD
 	select HAVE_AT91_USB_CLK
-	help
-	  Select this if you are using one of Atmel's AT91SAM9x5 family SoC.
-	  This means that your SAM9 name finishes with a '5' (except if it is
-	  AT91SAM9G45!).
-	  This support covers AT91SAM9G15, AT91SAM9G25, AT91SAM9X25, AT91SAM9G35
-	  and AT91SAM9X35.
-
-config SOC_AT91SAM9N12
-	bool "AT91SAM9N12 family"
+	select HAVE_AT91_UTMI
 	select HAVE_FB_ATMEL
-	select SOC_AT91SAM9
-	select HAVE_AT91_USB_CLK
+	select MEMORY
 	help
-	  Select this if you are using Atmel's AT91SAM9N12 SoC.
-
-# ----------------------------------------------------------
+	  Select this if you are using one of those Atmel SoC:
+	    AT91SAM9260
+	    AT91SAM9261
+	    AT91SAM9263
+	    AT91SAM9G15
+	    AT91SAM9G20
+	    AT91SAM9G25
+	    AT91SAM9G35
+	    AT91SAM9G45
+	    AT91SAM9G46
+	    AT91SAM9M10
+	    AT91SAM9M11
+	    AT91SAM9N12
+	    AT91SAM9RL
+	    AT91SAM9X25
+	    AT91SAM9X35
+	    AT91SAM9XE
 endif # SOC_SAM_V4_V5
 
 comment "AT91 Feature Selections"
diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile
index 8ef7d9a2e855..ad7fc5834188 100644
--- a/arch/arm/mach-at91/Makefile
+++ b/arch/arm/mach-at91/Makefile
@@ -8,13 +8,6 @@ obj-$(CONFIG_SOC_AT91SAM9)	+= sam9_smc.o
 
 # CPU-specific support
 obj-$(CONFIG_SOC_AT91RM9200)	+= at91rm9200.o at91rm9200_time.o
-obj-$(CONFIG_SOC_AT91SAM9260)	+= at91sam9260.o
-obj-$(CONFIG_SOC_AT91SAM9261)	+= at91sam9261.o
-obj-$(CONFIG_SOC_AT91SAM9263)	+= at91sam9263.o
-obj-$(CONFIG_SOC_AT91SAM9G45)	+= at91sam9g45.o
-obj-$(CONFIG_SOC_AT91SAM9N12)	+= at91sam9n12.o
-obj-$(CONFIG_SOC_AT91SAM9X5)	+= at91sam9x5.o
-obj-$(CONFIG_SOC_AT91SAM9RL)	+= at91sam9rl.o
 obj-$(CONFIG_SOC_SAMA5D3)	+= sama5d3.o
 obj-$(CONFIG_SOC_SAMA5D4)	+= sama5d4.o
 
diff --git a/arch/arm/mach-at91/at91sam9260.c b/arch/arm/mach-at91/at91sam9260.c
deleted file mode 100644
index 37b7ce4c6a3b..000000000000
--- a/arch/arm/mach-at91/at91sam9260.c
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * arch/arm/mach-at91/at91sam9260.c
- *
- *  Copyright (C) 2006 SAN People
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- */
-
-#include <asm/system_misc.h>
-#include <mach/cpu.h>
-#include <mach/at91_dbgu.h>
-#include <mach/hardware.h>
-
-#include "soc.h"
-#include "generic.h"
-
-/* --------------------------------------------------------------------
- *  AT91SAM9260 processor initialization
- * -------------------------------------------------------------------- */
-
-AT91_SOC_START(at91sam9260)
-AT91_SOC_END
diff --git a/arch/arm/mach-at91/at91sam9261.c b/arch/arm/mach-at91/at91sam9261.c
deleted file mode 100644
index aebbf76b6038..000000000000
--- a/arch/arm/mach-at91/at91sam9261.c
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * arch/arm/mach-at91/at91sam9261.c
- *
- *  Copyright (C) 2005 SAN People
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- */
-
-#include <asm/system_misc.h>
-#include <mach/cpu.h>
-#include <mach/hardware.h>
-
-#include "soc.h"
-#include "generic.h"
-
-/* --------------------------------------------------------------------
- *  AT91SAM9261 processor initialization
- * -------------------------------------------------------------------- */
-
-AT91_SOC_START(at91sam9261)
-AT91_SOC_END
diff --git a/arch/arm/mach-at91/at91sam9263.c b/arch/arm/mach-at91/at91sam9263.c
deleted file mode 100644
index dca29457d9cc..000000000000
--- a/arch/arm/mach-at91/at91sam9263.c
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * arch/arm/mach-at91/at91sam9263.c
- *
- *  Copyright (C) 2007 Atmel Corporation.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- */
-
-#include <asm/system_misc.h>
-#include <mach/hardware.h>
-
-#include "soc.h"
-#include "generic.h"
-
-/* --------------------------------------------------------------------
- *  AT91SAM9263 processor initialization
- * -------------------------------------------------------------------- */
-
-AT91_SOC_START(at91sam9263)
-AT91_SOC_END
diff --git a/arch/arm/mach-at91/at91sam9g45.c b/arch/arm/mach-at91/at91sam9g45.c
deleted file mode 100644
index 4957a9ef748a..000000000000
--- a/arch/arm/mach-at91/at91sam9g45.c
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- *  Chip-specific setup code for the AT91SAM9G45 family
- *
- *  Copyright (C) 2009 Atmel Corporation.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- */
-
-#include <asm/system_misc.h>
-#include <mach/hardware.h>
-
-#include "soc.h"
-#include "generic.h"
-
-/* --------------------------------------------------------------------
- *  AT91SAM9G45 processor initialization
- * -------------------------------------------------------------------- */
-
-AT91_SOC_START(at91sam9g45)
-AT91_SOC_END
diff --git a/arch/arm/mach-at91/at91sam9n12.c b/arch/arm/mach-at91/at91sam9n12.c
deleted file mode 100644
index b5ea69a3eaf6..000000000000
--- a/arch/arm/mach-at91/at91sam9n12.c
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * SoC specific setup code for the AT91SAM9N12
- *
- * Copyright (C) 2012 Atmel Corporation.
- *
- * Licensed under GPLv2 or later.
- */
-
-#include <asm/system_misc.h>
-#include <mach/hardware.h>
-
-#include "soc.h"
-#include "generic.h"
-
-/* --------------------------------------------------------------------
- *  AT91SAM9N12 processor initialization
- * -------------------------------------------------------------------- */
-
-AT91_SOC_START(at91sam9n12)
-AT91_SOC_END
diff --git a/arch/arm/mach-at91/at91sam9rl.c b/arch/arm/mach-at91/at91sam9rl.c
deleted file mode 100644
index 6cb40e4ec20f..000000000000
--- a/arch/arm/mach-at91/at91sam9rl.c
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * arch/arm/mach-at91/at91sam9rl.c
- *
- *  Copyright (C) 2005 SAN People
- *  Copyright (C) 2007 Atmel Corporation
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file COPYING in the main directory of this archive for
- * more details.
- */
-
-#include <asm/system_misc.h>
-#include <mach/cpu.h>
-#include <mach/at91_dbgu.h>
-#include <mach/hardware.h>
-
-#include "soc.h"
-#include "generic.h"
-
-/* --------------------------------------------------------------------
- *  AT91SAM9RL processor initialization
- * -------------------------------------------------------------------- */
-
-AT91_SOC_START(at91sam9rl)
-AT91_SOC_END
diff --git a/arch/arm/mach-at91/at91sam9x5.c b/arch/arm/mach-at91/at91sam9x5.c
deleted file mode 100644
index 7b60a529db01..000000000000
--- a/arch/arm/mach-at91/at91sam9x5.c
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- *  Chip-specific setup code for the AT91SAM9x5 family
- *
- *  Copyright (C) 2010-2012 Atmel Corporation.
- *
- * Licensed under GPLv2 or later.
- */
-
-#include <asm/system_misc.h>
-#include <mach/hardware.h>
-
-#include "soc.h"
-#include "generic.h"
-
-/* --------------------------------------------------------------------
- *  AT91SAM9x5 processor initialization
- * -------------------------------------------------------------------- */
-
-AT91_SOC_START(at91sam9x5)
-AT91_SOC_END
diff --git a/arch/arm/mach-at91/include/mach/cpu.h b/arch/arm/mach-at91/include/mach/cpu.h
index 61914fb35f5d..ce7c80a44983 100644
--- a/arch/arm/mach-at91/include/mach/cpu.h
+++ b/arch/arm/mach-at91/include/mach/cpu.h
@@ -152,69 +152,45 @@ static inline int at91_soc_is_detected(void)
 #define cpu_is_at91rm9200_pqfp() (0)
 #endif
 
-#ifdef CONFIG_SOC_AT91SAM9260
+#ifdef CONFIG_SOC_AT91SAM9
 #define cpu_is_at91sam9xe()	(at91_soc_initdata.subtype == AT91_SOC_SAM9XE)
 #define cpu_is_at91sam9260()	(at91_soc_initdata.type == AT91_SOC_SAM9260)
 #define cpu_is_at91sam9g20()	(at91_soc_initdata.type == AT91_SOC_SAM9G20)
-#else
-#define cpu_is_at91sam9xe()	(0)
-#define cpu_is_at91sam9260()	(0)
-#define cpu_is_at91sam9g20()	(0)
-#endif
-
-#ifdef CONFIG_SOC_AT91SAM9261
 #define cpu_is_at91sam9261()	(at91_soc_initdata.type == AT91_SOC_SAM9261)
 #define cpu_is_at91sam9g10()	(at91_soc_initdata.type == AT91_SOC_SAM9G10)
-#else
-#define cpu_is_at91sam9261()	(0)
-#define cpu_is_at91sam9g10()	(0)
-#endif
-
-#ifdef CONFIG_SOC_AT91SAM9263
 #define cpu_is_at91sam9263()	(at91_soc_initdata.type == AT91_SOC_SAM9263)
-#else
-#define cpu_is_at91sam9263()	(0)
-#endif
-
-#ifdef CONFIG_SOC_AT91SAM9RL
 #define cpu_is_at91sam9rl()	(at91_soc_initdata.type == AT91_SOC_SAM9RL)
-#else
-#define cpu_is_at91sam9rl()	(0)
-#endif
-
-#ifdef CONFIG_SOC_AT91SAM9G45
 #define cpu_is_at91sam9g45()	(at91_soc_initdata.type == AT91_SOC_SAM9G45)
 #define cpu_is_at91sam9g45es()	(at91_soc_initdata.subtype == AT91_SOC_SAM9G45ES)
 #define cpu_is_at91sam9m10()	(at91_soc_initdata.subtype == AT91_SOC_SAM9M10)
 #define cpu_is_at91sam9g46()	(at91_soc_initdata.subtype == AT91_SOC_SAM9G46)
 #define cpu_is_at91sam9m11()	(at91_soc_initdata.subtype == AT91_SOC_SAM9M11)
-#else
-#define cpu_is_at91sam9g45()	(0)
-#define cpu_is_at91sam9g45es()	(0)
-#define cpu_is_at91sam9m10()	(0)
-#define cpu_is_at91sam9g46()	(0)
-#define cpu_is_at91sam9m11()	(0)
-#endif
-
-#ifdef CONFIG_SOC_AT91SAM9X5
 #define cpu_is_at91sam9x5()	(at91_soc_initdata.type == AT91_SOC_SAM9X5)
 #define cpu_is_at91sam9g15()	(at91_soc_initdata.subtype == AT91_SOC_SAM9G15)
 #define cpu_is_at91sam9g35()	(at91_soc_initdata.subtype == AT91_SOC_SAM9G35)
 #define cpu_is_at91sam9x35()	(at91_soc_initdata.subtype == AT91_SOC_SAM9X35)
 #define cpu_is_at91sam9g25()	(at91_soc_initdata.subtype == AT91_SOC_SAM9G25)
 #define cpu_is_at91sam9x25()	(at91_soc_initdata.subtype == AT91_SOC_SAM9X25)
+#define cpu_is_at91sam9n12()	(at91_soc_initdata.type == AT91_SOC_SAM9N12)
 #else
+#define cpu_is_at91sam9xe()	(0)
+#define cpu_is_at91sam9260()	(0)
+#define cpu_is_at91sam9g20()	(0)
+#define cpu_is_at91sam9261()	(0)
+#define cpu_is_at91sam9g10()	(0)
+#define cpu_is_at91sam9263()	(0)
+#define cpu_is_at91sam9rl()	(0)
+#define cpu_is_at91sam9g45()	(0)
+#define cpu_is_at91sam9g45es()	(0)
+#define cpu_is_at91sam9m10()	(0)
+#define cpu_is_at91sam9g46()	(0)
+#define cpu_is_at91sam9m11()	(0)
 #define cpu_is_at91sam9x5()	(0)
 #define cpu_is_at91sam9g15()	(0)
 #define cpu_is_at91sam9g35()	(0)
 #define cpu_is_at91sam9x35()	(0)
 #define cpu_is_at91sam9g25()	(0)
 #define cpu_is_at91sam9x25()	(0)
-#endif
-
-#ifdef CONFIG_SOC_AT91SAM9N12
-#define cpu_is_at91sam9n12()	(at91_soc_initdata.type == AT91_SOC_SAM9N12)
-#else
 #define cpu_is_at91sam9n12()	(0)
 #endif
 
diff --git a/arch/arm/mach-at91/soc.h b/arch/arm/mach-at91/soc.h
index ae6c0b2f1146..f803e1016f74 100644
--- a/arch/arm/mach-at91/soc.h
+++ b/arch/arm/mach-at91/soc.h
@@ -40,31 +40,13 @@ static inline int at91_soc_is_enabled(void)
 #define at91rm9200_soc	at91_boot_soc
 #endif
 
-#if !defined(CONFIG_SOC_AT91SAM9260)
+#if !defined(CONFIG_SOC_AT91SAM9)
 #define at91sam9260_soc	at91_boot_soc
-#endif
-
-#if !defined(CONFIG_SOC_AT91SAM9261)
 #define at91sam9261_soc	at91_boot_soc
-#endif
-
-#if !defined(CONFIG_SOC_AT91SAM9263)
 #define at91sam9263_soc	at91_boot_soc
-#endif
-
-#if !defined(CONFIG_SOC_AT91SAM9G45)
 #define at91sam9g45_soc	at91_boot_soc
-#endif
-
-#if !defined(CONFIG_SOC_AT91SAM9RL)
 #define at91sam9rl_soc	at91_boot_soc
-#endif
-
-#if !defined(CONFIG_SOC_AT91SAM9X5)
 #define at91sam9x5_soc	at91_boot_soc
-#endif
-
-#if !defined(CONFIG_SOC_AT91SAM9N12)
 #define at91sam9n12_soc	at91_boot_soc
 #endif
 
-- 
2.1.3

^ permalink raw reply related	[flat|nested] 56+ messages in thread

* [PATCH v2] ARM: at91: at91rm9200: set idle and restart from rm9200_dt_device_init()
  2015-01-15 21:58   ` Alexandre Belloni
@ 2015-01-26 18:08     ` Nicolas Ferre
  -1 siblings, 0 replies; 56+ messages in thread
From: Nicolas Ferre @ 2015-01-26 18:08 UTC (permalink / raw)
  To: Alexandre Belloni
  Cc: Boris BREZILLON, linux-arm-kernel, linux-kernel,
	Jean-Christophe PLAGNIOL-VILLARD, Bo Shen, Wenyou Yang,
	Arnd Bergmann, Nicolas Ferre

From: Alexandre Belloni <alexandre.belloni@free-electrons.com>

Setup arm_pm_idle and arm_pm_restart function pointers from
rm9200_dt_device_init() function to simplify the at91rm9200 initialization
process.
This same move is already done for the sam9s.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
[nicolas.ferre@atmel.com: adapt patch to newer series]
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
---
 arch/arm/mach-at91/at91rm9200.c      | 14 --------------
 arch/arm/mach-at91/board-dt-rm9200.c | 14 ++++++++++++++
 2 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/arch/arm/mach-at91/at91rm9200.c b/arch/arm/mach-at91/at91rm9200.c
index 3be1963f5c56..ae0d5f0eb108 100644
--- a/arch/arm/mach-at91/at91rm9200.c
+++ b/arch/arm/mach-at91/at91rm9200.c
@@ -22,25 +22,11 @@
 #include "generic.h"
 
 
-static void at91rm9200_restart(enum reboot_mode reboot_mode, const char *cmd)
-{
-	/*
-	 * Perform a hardware reset with the use of the Watchdog timer.
-	 */
-	at91_st_write(AT91_ST_WDMR, AT91_ST_RSTEN | AT91_ST_EXTEN | 1);
-	at91_st_write(AT91_ST_CR, AT91_ST_WDRST);
-}
 
 /* --------------------------------------------------------------------
  *  AT91RM9200 processor initialization
  * -------------------------------------------------------------------- */
 
-static void __init at91rm9200_initialize(void)
-{
-	arm_pm_idle = at91rm9200_idle;
-	arm_pm_restart = at91rm9200_restart;
-}
 
 AT91_SOC_START(at91rm9200)
-	.init = at91rm9200_initialize,
 AT91_SOC_END
diff --git a/arch/arm/mach-at91/board-dt-rm9200.c b/arch/arm/mach-at91/board-dt-rm9200.c
index d47c4433444d..5fcd1c73ece0 100644
--- a/arch/arm/mach-at91/board-dt-rm9200.c
+++ b/arch/arm/mach-at91/board-dt-rm9200.c
@@ -22,9 +22,21 @@
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 #include <asm/mach/irq.h>
+#include <asm/system_misc.h>
+
+#include <mach/at91_st.h>
 
 #include "generic.h"
 
+static void at91rm9200_restart(enum reboot_mode reboot_mode, const char *cmd)
+{
+	/*
+	 * Perform a hardware reset with the use of the Watchdog timer.
+	 */
+	at91_st_write(AT91_ST_WDMR, AT91_ST_RSTEN | AT91_ST_EXTEN | 1);
+	at91_st_write(AT91_ST_CR, AT91_ST_WDRST);
+}
+
 static void __init at91rm9200_dt_timer_init(void)
 {
 	of_clk_init(NULL);
@@ -35,6 +47,8 @@ static void __init rm9200_dt_device_init(void)
 {
 	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 
+	arm_pm_idle = at91rm9200_idle;
+	arm_pm_restart = at91rm9200_restart;
 	at91_rm9200_pm_init();
 }
 
-- 
2.1.3


^ permalink raw reply related	[flat|nested] 56+ messages in thread

* [PATCH v2] ARM: at91: at91rm9200: set idle and restart from rm9200_dt_device_init()
@ 2015-01-26 18:08     ` Nicolas Ferre
  0 siblings, 0 replies; 56+ messages in thread
From: Nicolas Ferre @ 2015-01-26 18:08 UTC (permalink / raw)
  To: linux-arm-kernel

From: Alexandre Belloni <alexandre.belloni@free-electrons.com>

Setup arm_pm_idle and arm_pm_restart function pointers from
rm9200_dt_device_init() function to simplify the at91rm9200 initialization
process.
This same move is already done for the sam9s.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
[nicolas.ferre at atmel.com: adapt patch to newer series]
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
---
 arch/arm/mach-at91/at91rm9200.c      | 14 --------------
 arch/arm/mach-at91/board-dt-rm9200.c | 14 ++++++++++++++
 2 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/arch/arm/mach-at91/at91rm9200.c b/arch/arm/mach-at91/at91rm9200.c
index 3be1963f5c56..ae0d5f0eb108 100644
--- a/arch/arm/mach-at91/at91rm9200.c
+++ b/arch/arm/mach-at91/at91rm9200.c
@@ -22,25 +22,11 @@
 #include "generic.h"
 
 
-static void at91rm9200_restart(enum reboot_mode reboot_mode, const char *cmd)
-{
-	/*
-	 * Perform a hardware reset with the use of the Watchdog timer.
-	 */
-	at91_st_write(AT91_ST_WDMR, AT91_ST_RSTEN | AT91_ST_EXTEN | 1);
-	at91_st_write(AT91_ST_CR, AT91_ST_WDRST);
-}
 
 /* --------------------------------------------------------------------
  *  AT91RM9200 processor initialization
  * -------------------------------------------------------------------- */
 
-static void __init at91rm9200_initialize(void)
-{
-	arm_pm_idle = at91rm9200_idle;
-	arm_pm_restart = at91rm9200_restart;
-}
 
 AT91_SOC_START(at91rm9200)
-	.init = at91rm9200_initialize,
 AT91_SOC_END
diff --git a/arch/arm/mach-at91/board-dt-rm9200.c b/arch/arm/mach-at91/board-dt-rm9200.c
index d47c4433444d..5fcd1c73ece0 100644
--- a/arch/arm/mach-at91/board-dt-rm9200.c
+++ b/arch/arm/mach-at91/board-dt-rm9200.c
@@ -22,9 +22,21 @@
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 #include <asm/mach/irq.h>
+#include <asm/system_misc.h>
+
+#include <mach/at91_st.h>
 
 #include "generic.h"
 
+static void at91rm9200_restart(enum reboot_mode reboot_mode, const char *cmd)
+{
+	/*
+	 * Perform a hardware reset with the use of the Watchdog timer.
+	 */
+	at91_st_write(AT91_ST_WDMR, AT91_ST_RSTEN | AT91_ST_EXTEN | 1);
+	at91_st_write(AT91_ST_CR, AT91_ST_WDRST);
+}
+
 static void __init at91rm9200_dt_timer_init(void)
 {
 	of_clk_init(NULL);
@@ -35,6 +47,8 @@ static void __init rm9200_dt_device_init(void)
 {
 	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 
+	arm_pm_idle = at91rm9200_idle;
+	arm_pm_restart = at91rm9200_restart;
 	at91_rm9200_pm_init();
 }
 
-- 
2.1.3

^ permalink raw reply related	[flat|nested] 56+ messages in thread

* Re: [PATCH v2] ARM: at91: at91rm9200: set idle and restart from rm9200_dt_device_init()
  2015-01-26 18:08     ` Nicolas Ferre
@ 2015-01-26 19:01       ` Alexandre Belloni
  -1 siblings, 0 replies; 56+ messages in thread
From: Alexandre Belloni @ 2015-01-26 19:01 UTC (permalink / raw)
  To: Nicolas Ferre
  Cc: Boris BREZILLON, linux-arm-kernel, linux-kernel,
	Jean-Christophe PLAGNIOL-VILLARD, Bo Shen, Wenyou Yang,
	Arnd Bergmann

On 26/01/2015 at 19:08:33 +0100, Nicolas Ferre wrote :
> From: Alexandre Belloni <alexandre.belloni@free-electrons.com>
> 
> Setup arm_pm_idle and arm_pm_restart function pointers from
> rm9200_dt_device_init() function to simplify the at91rm9200 initialization
> process.
> This same move is already done for the sam9s.
> 
> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
> [nicolas.ferre@atmel.com: adapt patch to newer series]
> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
> ---
>  arch/arm/mach-at91/at91rm9200.c      | 14 --------------
>  arch/arm/mach-at91/board-dt-rm9200.c | 14 ++++++++++++++
>  2 files changed, 14 insertions(+), 14 deletions(-)

I'm pretty sure Arnd wanted us to get rid of the board-dt-* files and
only keep the soc files. Anyway, board-dt doesn't mean anything anymore
since all the boards are dt enabled...

-- 
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 56+ messages in thread

* [PATCH v2] ARM: at91: at91rm9200: set idle and restart from rm9200_dt_device_init()
@ 2015-01-26 19:01       ` Alexandre Belloni
  0 siblings, 0 replies; 56+ messages in thread
From: Alexandre Belloni @ 2015-01-26 19:01 UTC (permalink / raw)
  To: linux-arm-kernel

On 26/01/2015 at 19:08:33 +0100, Nicolas Ferre wrote :
> From: Alexandre Belloni <alexandre.belloni@free-electrons.com>
> 
> Setup arm_pm_idle and arm_pm_restart function pointers from
> rm9200_dt_device_init() function to simplify the at91rm9200 initialization
> process.
> This same move is already done for the sam9s.
> 
> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
> [nicolas.ferre at atmel.com: adapt patch to newer series]
> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
> ---
>  arch/arm/mach-at91/at91rm9200.c      | 14 --------------
>  arch/arm/mach-at91/board-dt-rm9200.c | 14 ++++++++++++++
>  2 files changed, 14 insertions(+), 14 deletions(-)

I'm pretty sure Arnd wanted us to get rid of the board-dt-* files and
only keep the soc files. Anyway, board-dt doesn't mean anything anymore
since all the boards are dt enabled...

-- 
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 56+ messages in thread

end of thread, other threads:[~2015-01-26 19:01 UTC | newest]

Thread overview: 56+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-15 21:58 [PATCH 00/17] AT91 cleanup for 3.20 #3 Alexandre Belloni
2015-01-15 21:58 ` Alexandre Belloni
2015-01-15 21:58 ` [PATCH 01/17] ARM: at91: merge at91rm9200 files Alexandre Belloni
2015-01-15 21:58   ` Alexandre Belloni
2015-01-15 21:58 ` [PATCH 02/17] ARM: at91: move sama5 specific code into per-soc files Alexandre Belloni
2015-01-15 21:58   ` Alexandre Belloni
2015-01-15 21:58 ` [PATCH 03/17] ARM: at91:remove unused mach/system_rev.h Alexandre Belloni
2015-01-15 21:58   ` Alexandre Belloni
2015-01-15 21:58 ` [PATCH 04/17] ARM: at91: fix sam9n12 and sam9x5 arm_pm_idle Alexandre Belloni
2015-01-15 21:58   ` Alexandre Belloni
2015-01-15 21:58 ` [PATCH 05/17] ARM: at91: sam9: set arm_pm_idle from sam9_dt_device_init Alexandre Belloni
2015-01-15 21:58   ` Alexandre Belloni
2015-01-15 21:58 ` [PATCH 06/17] ARM: at91: remove unused at91_ioremap_matrix and header Alexandre Belloni
2015-01-15 21:58   ` Alexandre Belloni
2015-01-15 21:58 ` [PATCH 07/17] ARM: at91: remove unused _matrix.h headers Alexandre Belloni
2015-01-15 21:58   ` Alexandre Belloni
2015-01-15 21:58 ` [PATCH 08/17] ARM: at91: stop using HAVE_AT91_DBGUx Alexandre Belloni
2015-01-15 21:58   ` Alexandre Belloni
2015-01-20 10:34   ` Nicolas Ferre
2015-01-20 10:34     ` Nicolas Ferre
2015-01-20 15:12     ` Alexandre Belloni
2015-01-20 15:12       ` Alexandre Belloni
2015-01-15 21:58 ` [PATCH 09/17] ARM: at91: pm: remove warning to remove SOC_AT91SAM9263 usage Alexandre Belloni
2015-01-15 21:58   ` Alexandre Belloni
2015-01-15 21:58 ` [PATCH 10/17] ARM: at91: merge SOC_AT91SAM9xxx Alexandre Belloni
2015-01-15 21:58   ` Alexandre Belloni
2015-01-22 10:22   ` Nicolas Ferre
2015-01-22 10:22     ` Nicolas Ferre
2015-01-22 16:36     ` Alexandre Belloni
2015-01-22 16:36       ` Alexandre Belloni
2015-01-26 17:49   ` [PATCH v2] " Nicolas Ferre
2015-01-26 17:49     ` Nicolas Ferre
2015-01-15 21:58 ` [PATCH 11/17] ARM: at91: remove at91_boot_soc Alexandre Belloni
2015-01-15 21:58   ` Alexandre Belloni
2015-01-26 18:08   ` [PATCH v2] ARM: at91: at91rm9200: set idle and restart from rm9200_dt_device_init() Nicolas Ferre
2015-01-26 18:08     ` Nicolas Ferre
2015-01-26 19:01     ` Alexandre Belloni
2015-01-26 19:01       ` Alexandre Belloni
2015-01-15 21:58 ` [PATCH 12/17] ARM: at91: rework initialization for rm9200 based boards Alexandre Belloni
2015-01-15 21:58   ` Alexandre Belloni
2015-01-15 21:58 ` [PATCH 13/17] ARM: at91: rework initialization for sam9 " Alexandre Belloni
2015-01-15 21:58   ` Alexandre Belloni
2015-01-15 21:58 ` [PATCH 14/17] ARM: at91: rework initialization for sama5 " Alexandre Belloni
2015-01-15 21:58   ` Alexandre Belloni
2015-01-15 21:58 ` [PATCH 15/17] ARM: at91: remove old setup Alexandre Belloni
2015-01-15 21:58   ` Alexandre Belloni
2015-01-21 16:29   ` Nicolas Ferre
2015-01-21 16:29     ` Nicolas Ferre
2015-01-21 20:40     ` Alexandre Belloni
2015-01-21 20:40       ` Alexandre Belloni
2015-01-15 21:58 ` [PATCH 16/17] ARM: at91: mark const init data with __initconst instead of __initdata Alexandre Belloni
2015-01-15 21:58   ` Alexandre Belloni
2015-01-15 21:58 ` [PATCH 17/17] ARM: at91: remove at91_dt_initialize Alexandre Belloni
2015-01-15 21:58   ` Alexandre Belloni
2015-01-22 10:31 ` [PATCH 00/17] AT91 cleanup for 3.20 #3 Nicolas Ferre
2015-01-22 10:31   ` Nicolas Ferre

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.