mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alexandre Belloni <alexandre.belloni@free-electrons.com>
To: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>,
	Arnd Bergmann <arnd@arndb.de>,
	Boris Brezillon <boris.brezillon@free-electrons.com>,
	Bo Shen <voice.shen@atmel.com>,
	Wenyou Yang <Wenyou.Yang@atmel.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	Alexandre Belloni <alexandre.belloni@free-electrons.com>
Subject: [PATCH 17/17] ARM: at91: remove at91_dt_initialize
Date: Thu, 15 Jan 2015 22:58:20 +0100	[thread overview]
Message-ID: <1421359100-8930-18-git-send-email-alexandre.belloni@free-electrons.com> (raw)
In-Reply-To: <1421359100-8930-1-git-send-email-alexandre.belloni@free-electrons.com>

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


  parent reply	other threads:[~2015-01-15 22:00 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-15 21:58 [PATCH 00/17] AT91 cleanup for 3.20 #3 Alexandre Belloni
2015-01-15 21:58 ` [PATCH 01/17] ARM: at91: merge at91rm9200 files 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 ` [PATCH 03/17] ARM: at91:remove unused mach/system_rev.h 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 ` [PATCH 05/17] ARM: at91: sam9: set arm_pm_idle from sam9_dt_device_init 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 ` [PATCH 07/17] ARM: at91: remove unused _matrix.h headers Alexandre Belloni
2015-01-15 21:58 ` [PATCH 08/17] ARM: at91: stop using HAVE_AT91_DBGUx Alexandre Belloni
2015-01-20 10:34   ` Nicolas Ferre
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 ` [PATCH 10/17] ARM: at91: merge SOC_AT91SAM9xxx Alexandre Belloni
2015-01-22 10:22   ` Nicolas Ferre
2015-01-22 16:36     ` Alexandre Belloni
2015-01-26 17:49   ` [PATCH v2] " Nicolas Ferre
2015-01-15 21:58 ` [PATCH 11/17] ARM: at91: remove at91_boot_soc 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 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 ` [PATCH 13/17] ARM: at91: rework initialization for sam9 " Alexandre Belloni
2015-01-15 21:58 ` [PATCH 14/17] ARM: at91: rework initialization for sama5 " Alexandre Belloni
2015-01-15 21:58 ` [PATCH 15/17] ARM: at91: remove old setup Alexandre Belloni
2015-01-21 16:29   ` Nicolas Ferre
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 [this message]
2015-01-22 10:31 ` [PATCH 00/17] AT91 cleanup for 3.20 #3 Nicolas Ferre

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1421359100-8930-18-git-send-email-alexandre.belloni@free-electrons.com \
    --to=alexandre.belloni@free-electrons.com \
    --cc=Wenyou.Yang@atmel.com \
    --cc=arnd@arndb.de \
    --cc=boris.brezillon@free-electrons.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nicolas.ferre@atmel.com \
    --cc=plagnioj@jcrosoft.com \
    --cc=voice.shen@atmel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®