mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Loic Pallardy <loic.pallardy-ext@stericsson.com>
To: Samuel Ortiz <sameo@linux.intel.com>,
	<linux-kernel@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	Linus Walleij <linus.walleij@linaro.com>
Cc: Lee Jones <lee.jones@linaro.org>,
	Loic Pallardy <loic.pallardy@gmail.com>,
	LT ST-Ericsson <st-ericsson@lists.linaro.org>,
	STEricsson_nomadik_linux <STEricsson_nomadik_linux@list.st.com>,
	Loic Pallardy <loic.pallardy-ext@stericsson.com>,
	Loic Pallardy <loic.pallardy@stericsson.com>,
	Maxime Coquelin <maxime.coquelin@stericsson.com>
Subject: [PATCH 04/17] mfd: dbx500-prcmu: Introduce TCDM mapping struct
Date: Wed, 5 Sep 2012 11:59:00 +0200	[thread overview]
Message-ID: <1346839153-6465-5-git-send-email-loic.pallardy-ext@stericsson.com> (raw)
In-Reply-To: <1346839153-6465-1-git-send-email-loic.pallardy-ext@stericsson.com>

TCDM size varies between DBs models.
This patch introduces a new structure aimed to handle the TCDM
dynamically.

Each SoC from ux500 family declares its mapping and pass it to
prcmu early init.

Signed-off-by: Loic Pallardy <loic.pallardy@stericsson.com>
Signed-off-by: Maxime Coquelin <maxime.coquelin@stericsson.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
---
 arch/arm/mach-ux500/board-mop500.c         |  3 ++-
 arch/arm/mach-ux500/cpu-db8500.c           | 11 +++++++++++
 arch/arm/mach-ux500/include/mach/devices.h |  3 +++
 include/linux/mfd/dbx500-prcmu.h           |  9 +++++++--
 4 files changed, 23 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c
index 057dfdb..a38493b 100644
--- a/arch/arm/mach-ux500/board-mop500.c
+++ b/arch/arm/mach-ux500/board-mop500.c
@@ -28,6 +28,7 @@
 #include <linux/mfd/tps6105x.h>
 #include <linux/mfd/abx500/ab8500-gpio.h>
 #include <linux/mfd/abx500/ab8500-codec.h>
+#include <linux/mfd/dbx500-prcmu.h>
 #include <linux/leds-lp5521.h>
 #include <linux/input.h>
 #include <linux/smsc911x.h>
@@ -718,7 +719,7 @@ static void __init u9540_init_machine(void)
 
 static void __init mop500_init_irq(void)
 {
-	prcmu_early_init();
+	prcmu_early_init(&db8500_tcdm_map);
 	ux500_init_irq();
 }
 
diff --git a/arch/arm/mach-ux500/cpu-db8500.c b/arch/arm/mach-ux500/cpu-db8500.c
index f3ed787..59dcf82 100644
--- a/arch/arm/mach-ux500/cpu-db8500.c
+++ b/arch/arm/mach-ux500/cpu-db8500.c
@@ -17,6 +17,7 @@
 #include <linux/platform_device.h>
 #include <linux/io.h>
 #include <linux/mfd/abx500/ab8500.h>
+#include <linux/mfd/dbx500-prcmu.h>
 
 #include <asm/mach/map.h>
 #include <asm/pmu.h>
@@ -133,6 +134,16 @@ static struct platform_device db8500_prcmu_device = {
 	.name			= "db8500-prcmu",
 };
 
+struct prcmu_tcdm_map db8500_tcdm_map = {
+	.tcdm_size = SZ_4K,
+	.legacy_offset = 0,
+};
+
+struct prcmu_tcdm_map db9540_tcdm_map = {
+	.tcdm_size = SZ_4K + SZ_8K,
+	.legacy_offset = SZ_8K,
+};
+
 static struct platform_device *platform_devs[] __initdata = {
 	&u8500_dma40_device,
 	&db8500_pmu_device,
diff --git a/arch/arm/mach-ux500/include/mach/devices.h b/arch/arm/mach-ux500/include/mach/devices.h
index cbc6f1e..1caa76e 100644
--- a/arch/arm/mach-ux500/include/mach/devices.h
+++ b/arch/arm/mach-ux500/include/mach/devices.h
@@ -20,4 +20,7 @@ extern struct platform_device ux500_cryp1_device;
 extern struct platform_device u8500_dma40_device;
 extern struct platform_device ux500_ske_keypad_device;
 
+extern struct prcmu_tcdm_map db8500_tcdm_map;
+extern struct prcmu_tcdm_map db9540_tcdm_map;
+
 #endif
diff --git a/include/linux/mfd/dbx500-prcmu.h b/include/linux/mfd/dbx500-prcmu.h
index 5b90e94..55025ba 100644
--- a/include/linux/mfd/dbx500-prcmu.h
+++ b/include/linux/mfd/dbx500-prcmu.h
@@ -213,13 +213,18 @@ enum ddr_pwrst {
 	DDR_PWR_STATE_OFFHIGHLAT    = 0x03
 };
 
+struct prcmu_tcdm_map {
+	u32 tcdm_size;
+	u32 legacy_offset;
+};
+
 #include <linux/mfd/db8500-prcmu.h>
 
 #if defined(CONFIG_UX500_SOC_DB8500)
 
 #include <mach/id.h>
 
-static inline void __init prcmu_early_init(void)
+static inline void __init prcmu_early_init(struct prcmu_tcdm_map *map)
 {
 	return db8500_prcmu_early_init();
 }
@@ -438,7 +443,7 @@ static inline int prcmu_config_a9wdog(u8 num, bool sleep_auto_off)
 }
 #else
 
-static inline void __init prcmu_early_init(void) {}
+static inline void __init prcmu_early_init(struct prcmu_tcdm_map *map) {}
 
 static inline int prcmu_set_power_state(u8 state, bool keep_ulp_clk,
 	bool keep_ap_pll)
-- 
1.7.11.1


  parent reply	other threads:[~2012-09-05 10:02 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-05  9:58 [PATCH 00/17] Add ST-Ericsson U9540 support Loic Pallardy
2012-09-05  9:58 ` [PATCH 01/17] arm: ux500: add u9540 pin configuration Loic Pallardy
2012-09-05  9:58 ` [PATCH 02/17] arm: ux500: add ccu9540 board support Loic Pallardy
2012-09-05 10:42   ` Arnd Bergmann
2012-09-05 11:38     ` Loic PALLARDY
2012-09-05 12:08       ` Linus Walleij
2012-09-05 12:11       ` Arnd Bergmann
2012-09-05 12:41         ` [st-ericsson] " Linus Walleij
2012-09-05  9:58 ` [PATCH 03/17] arm: ux500: Create board-specific IRQ init callback Loic Pallardy
2012-09-05  9:59 ` Loic Pallardy [this message]
2012-09-05  9:59 ` [PATCH 05/17] mfd: dbx500-prcmu: Handle TCDM mapping Loic Pallardy
2012-09-05  9:59 ` [PATCH 06/17] arm: ux500: Add u9540 PRCMU TCDM configuration Loic Pallardy
2012-09-05  9:59 ` [PATCH 07/17] mfd: prcmu: configurable tcdm base address Loic Pallardy
2012-09-05  9:59 ` [PATCH 08/17] arm: ux500: update DB internal irq nb Loic Pallardy
2012-09-05  9:59 ` [PATCH 09/17] mfd: prcmu: add db9540 support Loic Pallardy
2012-09-05  9:59 ` [PATCH 10/17] mfd: prcmu: dbx500-prmcu creation Loic Pallardy
2012-09-05  9:59 ` [PATCH 11/17] mfd: pcrmu: create common header file for legacy mailbox Loic Pallardy
2012-09-05  9:59 ` [PATCH 12/17] mfd: prcmu: make fw_project_name generic Loic Pallardy
2012-09-05  9:59 ` [PATCH 13/17] mfd: prcmu: make legacy mailbox services configurable Loic Pallardy
2012-09-05  9:59 ` [PATCH 14/17] mfd: db8500-prcmu: use db8500 legacy services Loic Pallardy
2012-09-05 11:01   ` Arnd Bergmann
2012-09-05  9:59 ` [PATCH 15/17] mfd: dbx540-prcmu creation Loic Pallardy
2012-09-05 12:10   ` Arnd Bergmann
2012-09-05 12:39     ` [st-ericsson] " Linus Walleij
2012-09-05 12:52       ` Arnd Bergmann
2012-09-05  9:59 ` [PATCH 16/17] arm: ux500: add dbx540 prcmu platform data Loic Pallardy
2012-09-05  9:59 ` [PATCH 17/17] mfd: db8500-prcmu: activate dbx540-prcmu driver Loic Pallardy

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=1346839153-6465-5-git-send-email-loic.pallardy-ext@stericsson.com \
    --to=loic.pallardy-ext@stericsson.com \
    --cc=STEricsson_nomadik_linux@list.st.com \
    --cc=lee.jones@linaro.org \
    --cc=linus.walleij@linaro.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=loic.pallardy@gmail.com \
    --cc=loic.pallardy@stericsson.com \
    --cc=maxime.coquelin@stericsson.com \
    --cc=sameo@linux.intel.com \
    --cc=st-ericsson@lists.linaro.org \
    /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®