All of lore.kernel.org
 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>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	Boris Brezillon <boris.brezillon@free-electrons.com>,
	Alexander Stein <alexander.stein@systec-electronic.com>,
	Alexandre Belloni <alexandre.belloni@free-electrons.com>
Subject: [PATCH v3 6/9] ARM: at91: at91rm9200 use SoC detection infrastructure
Date: Wed, 11 Mar 2015 18:00:32 +0100	[thread overview]
Message-ID: <1426093235-11759-7-git-send-email-alexandre.belloni@free-electrons.com> (raw)
In-Reply-To: <1426093235-11759-1-git-send-email-alexandre.belloni@free-electrons.com>

Use the soc detection infrastructure for at91rm9200 initialization.

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

diff --git a/arch/arm/mach-at91/at91rm9200.c b/arch/arm/mach-at91/at91rm9200.c
index 8fcfb70f7124..9f3f91daf9fe 100644
--- a/arch/arm/mach-at91/at91rm9200.c
+++ b/arch/arm/mach-at91/at91rm9200.c
@@ -8,25 +8,27 @@
  * Licensed under GPLv2 or later.
  */
 
-#include <linux/types.h>
-#include <linux/init.h>
-#include <linux/module.h>
-#include <linux/gpio.h>
+#include <linux/clk-provider.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 <mach/at91_st.h>
 
 #include "generic.h"
+#include "soc.h"
+
+static const struct at91_soc rm9200_socs[] = {
+	AT91_SOC(AT91RM9200_CIDR_MATCH, 0, "at91rm9200", "at91rm9200 BGA"),
+	{ /* sentinel */ },
+};
+
+static const struct at91_soc_family rm9200_families[] = {
+	AT91_SOC_FAMILY(ARCH_ID_AT91RM9200, "AT91RM9200", rm9200_socs),
+	{ /* sentinel */ },
+};
 
 static void at91rm9200_restart(enum reboot_mode reboot_mode, const char *cmd)
 {
@@ -45,15 +47,20 @@ static void __init at91rm9200_dt_timer_init(void)
 
 static void __init at91rm9200_dt_device_init(void)
 {
-	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
+	struct soc_device *soc;
+	struct device *soc_dev = NULL;
+
+	soc = at91_soc_init(rm9200_families);
+	if (soc != NULL)
+		soc_dev = soc_device_to_device(soc);
+
+	of_platform_populate(NULL, of_default_bus_match_table, NULL, soc_dev);
 
 	arm_pm_idle = at91rm9200_idle;
 	arm_pm_restart = at91rm9200_restart;
 	at91rm9200_pm_init();
 }
 
-
-
 static const char *at91rm9200_dt_board_compat[] __initconst = {
 	"atmel,at91rm9200",
 	NULL
@@ -61,7 +68,6 @@ static const char *at91rm9200_dt_board_compat[] __initconst = {
 
 DT_MACHINE_START(at91rm9200_dt, "Atmel AT91RM9200")
 	.init_time      = at91rm9200_dt_timer_init,
-	.map_io		= at91_map_io,
 	.init_machine	= at91rm9200_dt_device_init,
 	.dt_compat	= at91rm9200_dt_board_compat,
 MACHINE_END
diff --git a/arch/arm/mach-at91/soc.h b/arch/arm/mach-at91/soc.h
index 66dcd146601a..b330fcfe18a3 100644
--- a/arch/arm/mach-at91/soc.h
+++ b/arch/arm/mach-at91/soc.h
@@ -45,4 +45,7 @@ struct at91_soc_family {
 struct soc_device * __init
 at91_soc_init(const struct at91_soc_family *families);
 
+#define ARCH_ID_AT91RM9200		0x92
+#define AT91RM9200_CIDR_MATCH		0x09290780
+
 #endif /* __AT91_SOC_H */
-- 
2.1.0


WARNING: multiple messages have this Message-ID (diff)
From: alexandre.belloni@free-electrons.com (Alexandre Belloni)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 6/9] ARM: at91: at91rm9200 use SoC detection infrastructure
Date: Wed, 11 Mar 2015 18:00:32 +0100	[thread overview]
Message-ID: <1426093235-11759-7-git-send-email-alexandre.belloni@free-electrons.com> (raw)
In-Reply-To: <1426093235-11759-1-git-send-email-alexandre.belloni@free-electrons.com>

Use the soc detection infrastructure for at91rm9200 initialization.

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

diff --git a/arch/arm/mach-at91/at91rm9200.c b/arch/arm/mach-at91/at91rm9200.c
index 8fcfb70f7124..9f3f91daf9fe 100644
--- a/arch/arm/mach-at91/at91rm9200.c
+++ b/arch/arm/mach-at91/at91rm9200.c
@@ -8,25 +8,27 @@
  * Licensed under GPLv2 or later.
  */
 
-#include <linux/types.h>
-#include <linux/init.h>
-#include <linux/module.h>
-#include <linux/gpio.h>
+#include <linux/clk-provider.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 <mach/at91_st.h>
 
 #include "generic.h"
+#include "soc.h"
+
+static const struct at91_soc rm9200_socs[] = {
+	AT91_SOC(AT91RM9200_CIDR_MATCH, 0, "at91rm9200", "at91rm9200 BGA"),
+	{ /* sentinel */ },
+};
+
+static const struct at91_soc_family rm9200_families[] = {
+	AT91_SOC_FAMILY(ARCH_ID_AT91RM9200, "AT91RM9200", rm9200_socs),
+	{ /* sentinel */ },
+};
 
 static void at91rm9200_restart(enum reboot_mode reboot_mode, const char *cmd)
 {
@@ -45,15 +47,20 @@ static void __init at91rm9200_dt_timer_init(void)
 
 static void __init at91rm9200_dt_device_init(void)
 {
-	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
+	struct soc_device *soc;
+	struct device *soc_dev = NULL;
+
+	soc = at91_soc_init(rm9200_families);
+	if (soc != NULL)
+		soc_dev = soc_device_to_device(soc);
+
+	of_platform_populate(NULL, of_default_bus_match_table, NULL, soc_dev);
 
 	arm_pm_idle = at91rm9200_idle;
 	arm_pm_restart = at91rm9200_restart;
 	at91rm9200_pm_init();
 }
 
-
-
 static const char *at91rm9200_dt_board_compat[] __initconst = {
 	"atmel,at91rm9200",
 	NULL
@@ -61,7 +68,6 @@ static const char *at91rm9200_dt_board_compat[] __initconst = {
 
 DT_MACHINE_START(at91rm9200_dt, "Atmel AT91RM9200")
 	.init_time      = at91rm9200_dt_timer_init,
-	.map_io		= at91_map_io,
 	.init_machine	= at91rm9200_dt_device_init,
 	.dt_compat	= at91rm9200_dt_board_compat,
 MACHINE_END
diff --git a/arch/arm/mach-at91/soc.h b/arch/arm/mach-at91/soc.h
index 66dcd146601a..b330fcfe18a3 100644
--- a/arch/arm/mach-at91/soc.h
+++ b/arch/arm/mach-at91/soc.h
@@ -45,4 +45,7 @@ struct at91_soc_family {
 struct soc_device * __init
 at91_soc_init(const struct at91_soc_family *families);
 
+#define ARCH_ID_AT91RM9200		0x92
+#define AT91RM9200_CIDR_MATCH		0x09290780
+
 #endif /* __AT91_SOC_H */
-- 
2.1.0

  parent reply	other threads:[~2015-03-11 17:01 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-11 17:00 [PATCH v3 0/9] ARM: at91 cleanups for 4.1 #1 Alexandre Belloni
2015-03-11 17:00 ` Alexandre Belloni
2015-03-11 17:00 ` [PATCH v3 1/9] ARM: at91: remove NEED_MACH_IO_H Alexandre Belloni
2015-03-11 17:00   ` Alexandre Belloni
2015-03-11 17:00 ` [PATCH v3 2/9] ARM: at91: remove unused at91_ioremap_matrix and header Alexandre Belloni
2015-03-11 17:00   ` Alexandre Belloni
2015-03-11 17:00 ` [PATCH v3 3/9] ARM: at91: remove unused _matrix.h headers Alexandre Belloni
2015-03-11 17:00   ` Alexandre Belloni
2015-03-11 17:00 ` [PATCH v3 4/9] ARM: at91/dt: introduce atmel,<chip>-dbgu Alexandre Belloni
2015-03-11 17:00   ` Alexandre Belloni
2015-03-11 17:00 ` [PATCH v3 5/9] ARM: at91: add soc detection infrastructure Alexandre Belloni
2015-03-11 17:00   ` Alexandre Belloni
2015-03-12 13:18   ` Nicolas Ferre
2015-03-12 13:18     ` Nicolas Ferre
2015-03-11 17:00 ` Alexandre Belloni [this message]
2015-03-11 17:00   ` [PATCH v3 6/9] ARM: at91: at91rm9200 use SoC " Alexandre Belloni
2015-03-11 17:00 ` [PATCH v3 7/9] ARM: at91: at91sam9: " Alexandre Belloni
2015-03-11 17:00   ` Alexandre Belloni
2015-03-11 17:00 ` [PATCH v3 8/9] ARM: at91: sama5 " Alexandre Belloni
2015-03-11 17:00   ` Alexandre Belloni
2015-03-11 17:00 ` [PATCH v3 9/9] ARM: at91: remove old setup Alexandre Belloni
2015-03-11 17:00   ` Alexandre Belloni
2015-03-12 13:19 ` [PATCH v3 0/9] ARM: at91 cleanups for 4.1 #1 Nicolas Ferre
2015-03-12 13:19   ` 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=1426093235-11759-7-git-send-email-alexandre.belloni@free-electrons.com \
    --to=alexandre.belloni@free-electrons.com \
    --cc=alexander.stein@systec-electronic.com \
    --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 \
    /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 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.