aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2019-01-27 14:08:36 +0100
committerLinus Walleij <linus.walleij@linaro.org>2019-04-23 16:02:15 +0200
commit9540724ca29d54b65aaea120072166ebc2d5f4a1 (patch)
treee65284e2e52bb78d60e0b9a7dfeb0c8d02d5908c /drivers
parentARM: ixp4xx: Add DT bindings (diff)
downloadlinux-dev-9540724ca29d54b65aaea120072166ebc2d5f4a1.tar.xz
linux-dev-9540724ca29d54b65aaea120072166ebc2d5f4a1.zip
ARM: ixp4xx: Add device tree boot support
This adds a minimal support for booting IXP4xx systems from device tree. We have to add hacks to the QMGR, NPE and notably also ethernet and watchdog drivers so that they don't crash the platform: these drivers are unconditionally starting to grab regions of statically remapped IO space with no concern of the device model or other platforms. We will go in and properly fix these drivers as we go along but for now this hack gets us to a place where we can start working on proper device tree support for these platforms. Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/ethernet/xscale/ixp4xx_eth.c10
-rw-r--r--drivers/watchdog/ixp4xx_wdt.c9
2 files changed, 19 insertions, 0 deletions
diff --git a/drivers/net/ethernet/xscale/ixp4xx_eth.c b/drivers/net/ethernet/xscale/ixp4xx_eth.c
index ed6623a9801e..05d27fa9835f 100644
--- a/drivers/net/ethernet/xscale/ixp4xx_eth.c
+++ b/drivers/net/ethernet/xscale/ixp4xx_eth.c
@@ -31,6 +31,7 @@
#include <linux/io.h>
#include <linux/kernel.h>
#include <linux/net_tstamp.h>
+#include <linux/of.h>
#include <linux/phy.h>
#include <linux/platform_device.h>
#include <linux/ptp_classify.h>
@@ -1497,6 +1498,15 @@ static struct platform_driver ixp4xx_eth_driver = {
static int __init eth_init_module(void)
{
int err;
+
+ /*
+ * FIXME: we bail out on device tree boot but this really needs
+ * to be fixed in a nicer way: this registers the MDIO bus before
+ * even matching the driver infrastructure, we should only probe
+ * detected hardware.
+ */
+ if (of_have_populated_dt())
+ return -ENODEV;
if ((err = ixp4xx_mdio_register()))
return err;
return platform_driver_register(&ixp4xx_eth_driver);
diff --git a/drivers/watchdog/ixp4xx_wdt.c b/drivers/watchdog/ixp4xx_wdt.c
index f20cc53ff719..a80449bb36f0 100644
--- a/drivers/watchdog/ixp4xx_wdt.c
+++ b/drivers/watchdog/ixp4xx_wdt.c
@@ -21,6 +21,7 @@
#include <linux/kernel.h>
#include <linux/fs.h>
#include <linux/miscdevice.h>
+#include <linux/of.h>
#include <linux/watchdog.h>
#include <linux/init.h>
#include <linux/bitops.h>
@@ -176,6 +177,14 @@ static int __init ixp4xx_wdt_init(void)
{
int ret;
+ /*
+ * FIXME: we bail out on device tree boot but this really needs
+ * to be fixed in a nicer way: this registers the MDIO bus before
+ * even matching the driver infrastructure, we should only probe
+ * detected hardware.
+ */
+ if (of_have_populated_dt())
+ return -ENODEV;
if (!(read_cpuid_id() & 0xf) && !cpu_is_ixp46x()) {
pr_err("Rev. A0 IXP42x CPU detected - watchdog disabled\n");