mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
To: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>,
	barebox@lists.infradead.org
Subject: [PATCH v2 07/14] bus: mvebu-mbus: Convert mbus platform driver to direct driver
Date: Mon, 20 Apr 2015 22:11:19 +0200	[thread overview]
Message-ID: <1429560686-11391-8-git-send-email-sebastian.hesselbarth@gmail.com> (raw)
In-Reply-To: <1429560686-11391-1-git-send-email-sebastian.hesselbarth@gmail.com>

Registering mbus driver as platform driver is a little late for
some register accesses to work. We have to make sure boot-up
mbus windows are disabled early, so call mbus driver directly
from SoC init.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
---
Cc: barebox@lists.infradead.org
Cc: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 arch/arm/mach-mvebu/armada-370-xp.c |  1 +
 arch/arm/mach-mvebu/dove.c          |  1 +
 arch/arm/mach-mvebu/kirkwood.c      |  1 +
 drivers/bus/mvebu-mbus.c            | 14 +-------------
 include/linux/mbus.h                |  2 ++
 5 files changed, 6 insertions(+), 13 deletions(-)

diff --git a/arch/arm/mach-mvebu/armada-370-xp.c b/arch/arm/mach-mvebu/armada-370-xp.c
index 244f8cdd81a5..ae458b4433b3 100644
--- a/arch/arm/mach-mvebu/armada-370-xp.c
+++ b/arch/arm/mach-mvebu/armada-370-xp.c
@@ -73,6 +73,7 @@ static int armada_370_xp_init_soc(struct device_node *root, void *context)
 	armada_370_xp_memory_find(&phys_base, &phys_size);
 
 	mvebu_set_memory(phys_base, phys_size);
+	mvebu_mbus_init();
 
 	/* Enable peripherals PUP */
 	reg = readl(ARMADA_XP_PUP_ENABLE_BASE);
diff --git a/arch/arm/mach-mvebu/dove.c b/arch/arm/mach-mvebu/dove.c
index c2852f8986ae..a7284fd33a63 100644
--- a/arch/arm/mach-mvebu/dove.c
+++ b/arch/arm/mach-mvebu/dove.c
@@ -93,6 +93,7 @@ static int dove_init_soc(struct device_node *root, void *context)
 	dove_memory_find(&phys_base, &phys_size);
 
 	mvebu_set_memory(phys_base, phys_size);
+	mvebu_mbus_init();
 
 	return 0;
 }
diff --git a/arch/arm/mach-mvebu/kirkwood.c b/arch/arm/mach-mvebu/kirkwood.c
index d7903f732eac..19c6f0730332 100644
--- a/arch/arm/mach-mvebu/kirkwood.c
+++ b/arch/arm/mach-mvebu/kirkwood.c
@@ -66,6 +66,7 @@ static int kirkwood_init_soc(struct device_node *root, void *context)
 	kirkwood_memory_find(&phys_base, &phys_size);
 
 	mvebu_set_memory(phys_base, phys_size);
+	mvebu_mbus_init();
 
 	return 0;
 }
diff --git a/drivers/bus/mvebu-mbus.c b/drivers/bus/mvebu-mbus.c
index 077d7ccb83ca..e1898103540b 100644
--- a/drivers/bus/mvebu-mbus.c
+++ b/drivers/bus/mvebu-mbus.c
@@ -673,7 +673,7 @@ static void mvebu_mbus_get_pcie_resources(struct device_node *np,
 	}
 }
 
-static int mvebu_mbus_probe(struct device_d *dev)
+int mvebu_mbus_init(void)
 {
 	struct device_node *np, *controller;
 	const struct of_device_id *match;
@@ -725,18 +725,6 @@ static int mvebu_mbus_probe(struct device_d *dev)
 	return mbus_dt_setup(&mbus_state);
 }
 
-static struct driver_d mvebu_mbus_driver = {
-	.probe	= mvebu_mbus_probe,
-	.name	= "mvebu-mbus",
-	.of_compatible = DRV_OF_COMPAT(mvebu_mbus_dt_ids),
-};
-
-static int mvebu_mbus_init(void)
-{
-	return platform_driver_register(&mvebu_mbus_driver);
-}
-postcore_initcall(mvebu_mbus_init);
-
 struct mbus_range {
 	const char *compatible;
 	u32 mbusid;
diff --git a/include/linux/mbus.h b/include/linux/mbus.h
index b90fabbfb7e5..bcc5949219cf 100644
--- a/include/linux/mbus.h
+++ b/include/linux/mbus.h
@@ -61,4 +61,6 @@ int mvebu_mbus_del_window(phys_addr_t base, size_t size);
 void mvebu_mbus_add_range(const char *compatible,
 			  u8 target, u8 attr, u32 remap);
 
+int mvebu_mbus_init(void);
+
 #endif /* __LINUX_MBUS_H */
-- 
2.1.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2015-04-20 20:12 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-20 20:11 [PATCH v2 00/14] Add support for Lenovo ix4-300d NAS Sebastian Hesselbarth
2015-04-20 20:11 ` [PATCH v2 01/14] net: phy: Support Marvell 88E1318S PHY Sebastian Hesselbarth
2015-04-20 20:11 ` [PATCH v2 02/14] gpio: Add driver for 74x164 compatible shift-registers Sebastian Hesselbarth
2015-04-20 20:11 ` [PATCH v2 03/14] spi: ath79: move spidelay from spi-bitbang-txrx Sebastian Hesselbarth
2015-04-20 20:11 ` [PATCH v2 04/14] spi: Add SPI GPIO bitbang driver Sebastian Hesselbarth
2015-04-20 20:11 ` [PATCH v2 05/14] bus: mvebu-mbus: Remove coherency attribute Sebastian Hesselbarth
2015-04-20 20:11 ` [PATCH v2 06/14] bus: mvebu-mbus: Drop device reference Sebastian Hesselbarth
2015-04-20 20:11 ` Sebastian Hesselbarth [this message]
2015-04-20 20:11 ` [PATCH v2 08/14] ARM: mvebu: Move PCIe register defines to socid.h Sebastian Hesselbarth
2015-04-20 20:11 ` [PATCH v2 09/14] ARM: mvebu: armada-xp: Fixup broken MV78230-A0 SoC ID Sebastian Hesselbarth
2015-04-20 20:11 ` [PATCH v2 10/14] ARM: mvebu: armada-xp: Limit PUP access to Armada XP Sebastian Hesselbarth
2015-04-20 20:11 ` [PATCH v2 11/14] ARM: mvebu: armada-xp: Use MBUS_ERR_PROP_EN define Sebastian Hesselbarth
2015-04-20 20:11 ` [PATCH v2 12/14] ARM: mvebu: armada-xp: Sort boards and images alphabetically Sebastian Hesselbarth
2015-04-20 20:11 ` [PATCH v2 13/14] ARM: mvebu: armada-xp: Add Lenovo Iomega ix4-300d Sebastian Hesselbarth
2015-04-20 20:11 ` [PATCH v2 14/14] ARM: Add Lenovo ix4 and related drivers to mvebu_defconfig Sebastian Hesselbarth
2015-04-23  5:57 ` [PATCH v2 00/14] Add support for Lenovo ix4-300d NAS Sascha Hauer

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=1429560686-11391-8-git-send-email-sebastian.hesselbarth@gmail.com \
    --to=sebastian.hesselbarth@gmail.com \
    --cc=barebox@lists.infradead.org \
    --cc=thomas.petazzoni@free-electrons.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