This does not add any new features, just some changes to the patches and a first try to use dt to set the irqs. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> SVN-Revision: 39466master
parent
f491623c37
commit
b75a9b04df
@ -1,21 +1,59 @@ |
|||||||
bcm53xx: register bcma bus
|
From 22b90bcf616578abe09845c72317ce53312f7faf Mon Sep 17 00:00:00 2001
|
||||||
|
From: Hauke Mehrtens <hauke@hauke-m.de>
|
||||||
|
Date: Sat, 25 Jan 2014 17:03:07 +0100
|
||||||
|
Subject: [PATCH 8/8] ARM: BCM5301X: register bcma bus
|
||||||
|
|
||||||
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
|
|
||||||
---
|
---
|
||||||
arch/arm/boot/dts/bcm4708.dtsi | 5 +++++
|
arch/arm/boot/dts/bcm4708.dtsi | 43 ++++++++++++++++++++++++++++++++++++++++
|
||||||
1 file changed, 5 insertions(+)
|
1 file changed, 43 insertions(+)
|
||||||
|
|
||||||
--- a/arch/arm/boot/dts/bcm4708.dtsi
|
--- a/arch/arm/boot/dts/bcm4708.dtsi
|
||||||
+++ b/arch/arm/boot/dts/bcm4708.dtsi
|
+++ b/arch/arm/boot/dts/bcm4708.dtsi
|
||||||
@@ -72,6 +72,11 @@
|
@@ -31,4 +31,47 @@
|
||||||
<0x19020100 0x100>;
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
+ bus@18000000 {
|
+ aix@18000000 {
|
||||||
+ compatible = "brcm,bus-aix";
|
+ compatible = "brcm,bus-aix";
|
||||||
+ reg = <0x18000000 0x1000>;
|
+ reg = <0x18000000 0x1000>;
|
||||||
+ };
|
+ ranges = <0x00000000 0x18000000 0x00100000>;
|
||||||
|
+ #address-cells = <1>;
|
||||||
|
+ #size-cells = <1>;
|
||||||
|
+
|
||||||
|
+ usb2@0 {
|
||||||
|
+ compatible = "brcm,northstar-usb2";
|
||||||
|
+ reg = <0x18021000 0x1000>;
|
||||||
|
+ interrupts = <GIC_SPI 79 IRQ_TYPE_LEVEL_HIGH>;
|
||||||
|
+ };
|
||||||
|
+
|
||||||
|
+ usb3@0 {
|
||||||
|
+ compatible = "brcm,northstar-usb3";
|
||||||
|
+ reg = <0x18023000 0x1000>;
|
||||||
|
+ interrupts = <GIC_SPI 80 IRQ_TYPE_LEVEL_HIGH>;
|
||||||
|
+ };
|
||||||
|
+
|
||||||
|
+ gmac@0 {
|
||||||
|
+ compatible = "brcm,northstar-gmac";
|
||||||
|
+ reg = <0x18024000 0x1000>;
|
||||||
|
+ interrupts = <GIC_SPI 147 IRQ_TYPE_LEVEL_HIGH>;
|
||||||
|
+ };
|
||||||
+
|
+
|
||||||
timer@19020200 {
|
+ gmac@1 {
|
||||||
compatible = "arm,cortex-a9-global-timer";
|
+ compatible = "brcm,northstar-gmac";
|
||||||
reg = <0x19020200 0x100>;
|
+ reg = <0x18025000 0x1000>;
|
||||||
|
+ interrupts = <GIC_SPI 148 IRQ_TYPE_LEVEL_HIGH>;
|
||||||
|
+ };
|
||||||
|
+
|
||||||
|
+ gmac@2 {
|
||||||
|
+ compatible = "brcm,northstar-gmac";
|
||||||
|
+ reg = <0x18026000 0x1000>;
|
||||||
|
+ interrupts = <GIC_SPI 149 IRQ_TYPE_LEVEL_HIGH>;
|
||||||
|
+ };
|
||||||
|
+
|
||||||
|
+ gmac@3 {
|
||||||
|
+ compatible = "brcm,northstar-gmac";
|
||||||
|
+ reg = <0x18027000 0x1000>;
|
||||||
|
+ interrupts = <GIC_SPI 150 IRQ_TYPE_LEVEL_HIGH>;
|
||||||
|
+ };
|
||||||
|
+ };
|
||||||
|
};
|
||||||
|
@ -0,0 +1,74 @@ |
|||||||
|
From 06a21484198df9a4d34fe5062878d3bf4fc14340 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Hauke Mehrtens <hauke@hauke-m.de>
|
||||||
|
Date: Thu, 9 Jan 2014 19:40:14 +0100
|
||||||
|
Subject: [PATCH 7/8] bcma: get irqs from dt
|
||||||
|
|
||||||
|
---
|
||||||
|
drivers/bcma/main.c | 42 +++++++++++++++++++++++++++++++++++++++++-
|
||||||
|
1 file changed, 41 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
--- a/drivers/bcma/main.c
|
||||||
|
+++ b/drivers/bcma/main.c
|
||||||
|
@@ -10,6 +10,8 @@
|
||||||
|
#include <linux/platform_device.h>
|
||||||
|
#include <linux/bcma/bcma.h>
|
||||||
|
#include <linux/slab.h>
|
||||||
|
+#include <linux/of_irq.h>
|
||||||
|
+#include <linux/of_address.h>
|
||||||
|
|
||||||
|
MODULE_DESCRIPTION("Broadcom's specific AMBA driver");
|
||||||
|
MODULE_LICENSE("GPL");
|
||||||
|
@@ -111,6 +113,38 @@ static void bcma_release_core_dev(struct
|
||||||
|
kfree(core);
|
||||||
|
}
|
||||||
|
|
||||||
|
+static struct device_node *bcma_of_find_child_device(struct platform_device *parent,
|
||||||
|
+ struct bcma_device *core)
|
||||||
|
+{
|
||||||
|
+ struct device_node *node;
|
||||||
|
+ u64 size;
|
||||||
|
+ const __be32 *reg;
|
||||||
|
+
|
||||||
|
+ if (!parent || !parent->dev.of_node)
|
||||||
|
+ return NULL;
|
||||||
|
+
|
||||||
|
+ for_each_child_of_node(parent->dev.of_node, node) {
|
||||||
|
+ reg = of_get_address(node, 0, &size, 0);
|
||||||
|
+ if (!reg)
|
||||||
|
+ continue;
|
||||||
|
+ if (be32_to_cpup(reg) == core->addr)
|
||||||
|
+ return node;
|
||||||
|
+ }
|
||||||
|
+ return NULL;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+static void bcma_of_fill_device(struct platform_device *parent,
|
||||||
|
+ struct bcma_device *core)
|
||||||
|
+{
|
||||||
|
+ struct device_node *node;
|
||||||
|
+
|
||||||
|
+ node = bcma_of_find_child_device(parent, core);
|
||||||
|
+ if (!node)
|
||||||
|
+ return;
|
||||||
|
+ core->dev.of_node = node;
|
||||||
|
+ core->irq = irq_of_parse_and_map(node, 0);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
static int bcma_register_cores(struct bcma_bus *bus)
|
||||||
|
{
|
||||||
|
struct bcma_device *core;
|
||||||
|
@@ -145,7 +179,13 @@ static int bcma_register_cores(struct bc
|
||||||
|
break;
|
||||||
|
case BCMA_HOSTTYPE_SOC:
|
||||||
|
core->dev.dma_mask = &core->dev.coherent_dma_mask;
|
||||||
|
- core->dma_dev = &core->dev;
|
||||||
|
+ if (bus->host_pdev) {
|
||||||
|
+ core->dma_dev = &bus->host_pdev->dev;
|
||||||
|
+ core->dev.parent = &bus->host_pdev->dev;
|
||||||
|
+ bcma_of_fill_device(bus->host_pdev, core);
|
||||||
|
+ } else {
|
||||||
|
+ core->dma_dev = &core->dev;
|
||||||
|
+ }
|
||||||
|
break;
|
||||||
|
case BCMA_HOSTTYPE_SDIO:
|
||||||
|
break;
|
@ -1,18 +0,0 @@ |
|||||||
bcma: fix dma mask
|
|
||||||
|
|
||||||
|
|
||||||
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
|
|
||||||
---
|
|
||||||
drivers/bcma/main.c | 1 +
|
|
||||||
1 file changed, 1 insertion(+)
|
|
||||||
|
|
||||||
--- a/drivers/bcma/main.c
|
|
||||||
+++ b/drivers/bcma/main.c
|
|
||||||
@@ -144,6 +144,7 @@ static int bcma_register_cores(struct bc
|
|
||||||
core->irq = bus->host_pci->irq;
|
|
||||||
break;
|
|
||||||
case BCMA_HOSTTYPE_SOC:
|
|
||||||
+ core->dev.coherent_dma_mask = DMA_BIT_MASK(32);
|
|
||||||
core->dev.dma_mask = &core->dev.coherent_dma_mask;
|
|
||||||
core->dma_dev = &core->dev;
|
|
||||||
break;
|
|
@ -1,156 +0,0 @@ |
|||||||
bcma: add arm support
|
|
||||||
|
|
||||||
|
|
||||||
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
|
|
||||||
---
|
|
||||||
drivers/bcma/Kconfig | 9 +++++
|
|
||||||
drivers/bcma/Makefile | 1 +
|
|
||||||
drivers/bcma/driver_arm.c | 61 ++++++++++++++++++++++++++++++++++
|
|
||||||
drivers/bcma/main.c | 7 ++++
|
|
||||||
include/linux/bcma/bcma.h | 2 ++
|
|
||||||
include/linux/bcma/bcma_driver_arm.h | 20 +++++++++++
|
|
||||||
6 files changed, 100 insertions(+)
|
|
||||||
create mode 100644 drivers/bcma/driver_arm.c
|
|
||||||
create mode 100644 include/linux/bcma/bcma_driver_arm.h
|
|
||||||
|
|
||||||
--- a/drivers/bcma/Kconfig
|
|
||||||
+++ b/drivers/bcma/Kconfig
|
|
||||||
@@ -54,6 +54,15 @@ config BCMA_DRIVER_MIPS
|
|
||||||
|
|
||||||
If unsure, say N
|
|
||||||
|
|
||||||
+config BCMA_DRIVER_ARM
|
|
||||||
+ bool "BCMA Broadcom ARM core driver"
|
|
||||||
+ depends on BCMA && ARM
|
|
||||||
+ help
|
|
||||||
+ Driver for the Broadcom MIPS core attached to Broadcom specific
|
|
||||||
+ Advanced Microcontroller Bus.
|
|
||||||
+
|
|
||||||
+ If unsure, say N
|
|
||||||
+
|
|
||||||
config BCMA_SFLASH
|
|
||||||
bool
|
|
||||||
depends on BCMA_DRIVER_MIPS
|
|
||||||
--- a/drivers/bcma/Makefile
|
|
||||||
+++ b/drivers/bcma/Makefile
|
|
||||||
@@ -5,6 +5,7 @@ bcma-$(CONFIG_BCMA_NFLASH) += driver_ch
|
|
||||||
bcma-y += driver_pci.o
|
|
||||||
bcma-$(CONFIG_BCMA_DRIVER_PCI_HOSTMODE) += driver_pci_host.o
|
|
||||||
bcma-$(CONFIG_BCMA_DRIVER_MIPS) += driver_mips.o
|
|
||||||
+bcma-$(CONFIG_BCMA_DRIVER_ARM) += driver_arm.o
|
|
||||||
bcma-$(CONFIG_BCMA_DRIVER_GMAC_CMN) += driver_gmac_cmn.o
|
|
||||||
bcma-$(CONFIG_BCMA_DRIVER_GPIO) += driver_gpio.o
|
|
||||||
bcma-$(CONFIG_BCMA_HOST_PCI) += host_pci.o
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/drivers/bcma/driver_arm.c
|
|
||||||
@@ -0,0 +1,53 @@
|
|
||||||
+/*
|
|
||||||
+ * Broadcom specific AMBA
|
|
||||||
+ * Broadcom MIPS32 74K core driver
|
|
||||||
+ *
|
|
||||||
+ * Copyright 2009, Broadcom Corporation
|
|
||||||
+ * Copyright 2006, 2007, Michael Buesch <mb@bu3sch.de>
|
|
||||||
+ * Copyright 2010, Bernhard Loos <bernhardloos@googlemail.com>
|
|
||||||
+ * Copyright 2011, Hauke Mehrtens <hauke@hauke-m.de>
|
|
||||||
+ *
|
|
||||||
+ * Licensed under the GNU/GPL. See COPYING for details.
|
|
||||||
+ */
|
|
||||||
+
|
|
||||||
+#include "bcma_private.h"
|
|
||||||
+
|
|
||||||
+#include <linux/bcma/bcma.h>
|
|
||||||
+
|
|
||||||
+static void bcma_core_mips_set_irq_name(struct bcma_bus *bus, unsigned int irq,
|
|
||||||
+ u16 coreid, u8 unit)
|
|
||||||
+{
|
|
||||||
+ struct bcma_device *core;
|
|
||||||
+
|
|
||||||
+ core = bcma_find_core_unit(bus, coreid, unit);
|
|
||||||
+ if (!core) {
|
|
||||||
+ bcma_warn(bus,
|
|
||||||
+ "Can not find core (id: 0x%x, unit %i) for IRQ configuration.\n",
|
|
||||||
+ coreid, unit);
|
|
||||||
+ return;
|
|
||||||
+ }
|
|
||||||
+ core->irq = irq;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+void bcma_core_arm_init(struct bcma_drv_arm *acore)
|
|
||||||
+{
|
|
||||||
+ struct bcma_bus *bus;
|
|
||||||
+ struct bcma_device *core;
|
|
||||||
+ bus = acore->core->bus;
|
|
||||||
+
|
|
||||||
+ if (acore->setup_done)
|
|
||||||
+ return;
|
|
||||||
+
|
|
||||||
+ bcma_core_mips_set_irq_name(bus, 111, BCMA_CORE_USB20, 0);
|
|
||||||
+
|
|
||||||
+ bcma_core_mips_set_irq_name(bus, 179, BCMA_CORE_MAC_GBIT, 0);
|
|
||||||
+ bcma_core_mips_set_irq_name(bus, 180, BCMA_CORE_MAC_GBIT, 1);
|
|
||||||
+ bcma_core_mips_set_irq_name(bus, 181, BCMA_CORE_MAC_GBIT, 2);
|
|
||||||
+ bcma_core_mips_set_irq_name(bus, 182, BCMA_CORE_MAC_GBIT, 3);
|
|
||||||
+
|
|
||||||
+ bcma_core_mips_set_irq_name(bus, 112, BCMA_CORE_USB30, 0);
|
|
||||||
+ bcma_debug(bus, "IRQ reconfiguration done\n");
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+ acore->setup_done = true;
|
|
||||||
+}
|
|
||||||
--- a/drivers/bcma/main.c
|
|
||||||
+++ b/drivers/bcma/main.c
|
|
||||||
@@ -259,6 +259,13 @@ int bcma_bus_register(struct bcma_bus *b
|
|
||||||
bcma_core_mips_init(&bus->drv_mips);
|
|
||||||
}
|
|
||||||
|
|
||||||
+ /* Init ARM core */
|
|
||||||
+ core = bcma_find_core(bus, BCMA_CORE_ARMCA9);
|
|
||||||
+ if (core) {
|
|
||||||
+ bus->drv_arm.core = core;
|
|
||||||
+ bcma_core_arm_init(&bus->drv_arm);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
/* Init PCIE core */
|
|
||||||
core = bcma_find_core_unit(bus, BCMA_CORE_PCIE, 0);
|
|
||||||
if (core) {
|
|
||||||
--- a/include/linux/bcma/bcma.h
|
|
||||||
+++ b/include/linux/bcma/bcma.h
|
|
||||||
@@ -7,6 +7,7 @@
|
|
||||||
#include <linux/bcma/bcma_driver_chipcommon.h>
|
|
||||||
#include <linux/bcma/bcma_driver_pci.h>
|
|
||||||
#include <linux/bcma/bcma_driver_mips.h>
|
|
||||||
+#include <linux/bcma/bcma_driver_arm.h>
|
|
||||||
#include <linux/bcma/bcma_driver_gmac_cmn.h>
|
|
||||||
#include <linux/ssb/ssb.h> /* SPROM sharing */
|
|
||||||
|
|
||||||
@@ -334,6 +335,7 @@ struct bcma_bus {
|
|
||||||
struct bcma_drv_cc drv_cc;
|
|
||||||
struct bcma_drv_pci drv_pci[2];
|
|
||||||
struct bcma_drv_mips drv_mips;
|
|
||||||
+ struct bcma_drv_arm drv_arm;
|
|
||||||
struct bcma_drv_gmac_cmn drv_gmac_cmn;
|
|
||||||
|
|
||||||
/* We decided to share SPROM struct with SSB as long as we do not need
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/include/linux/bcma/bcma_driver_arm.h
|
|
||||||
@@ -0,0 +1,20 @@
|
|
||||||
+#ifndef LINUX_BCMA_DRIVER_ARM_H_
|
|
||||||
+#define LINUX_BCMA_DRIVER_ARM_H_
|
|
||||||
+
|
|
||||||
+struct bcma_device;
|
|
||||||
+
|
|
||||||
+struct bcma_drv_arm {
|
|
||||||
+ struct bcma_device *core;
|
|
||||||
+ u8 setup_done:1;
|
|
||||||
+ u8 early_setup_done:1;
|
|
||||||
+};
|
|
||||||
+
|
|
||||||
+#ifdef CONFIG_BCMA_DRIVER_ARM
|
|
||||||
+extern void bcma_core_arm_init(struct bcma_drv_arm *acore);
|
|
||||||
+
|
|
||||||
+#else
|
|
||||||
+static inline void bcma_core_arm_init(struct bcma_drv_arm *acore) { }
|
|
||||||
+
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
+#endif /* LINUX_BCMA_DRIVER_ARM_H_ */
|
|
Loading…
Reference in new issue