4 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
6 drivers/bcma/Kconfig | 9 +++++
7 drivers/bcma/Makefile | 1 +
8 drivers/bcma/driver_arm.c | 61 ++++++++++++++++++++++++++++++++++
9 drivers/bcma/main.c | 7 ++++
10 include/linux/bcma/bcma.h | 2 ++
11 include/linux/bcma/bcma_driver_arm.h | 20 +++++++++++
12 6 files changed, 100 insertions(+)
13 create mode 100644 drivers/bcma/driver_arm.c
14 create mode 100644 include/linux/bcma/bcma_driver_arm.h
16 --- a/drivers/bcma/Kconfig
17 +++ b/drivers/bcma/Kconfig
18 @@ -54,6 +54,15 @@ config BCMA_DRIVER_MIPS
22 +config BCMA_DRIVER_ARM
23 + bool "BCMA Broadcom ARM core driver"
24 + depends on BCMA && ARM
26 + Driver for the Broadcom MIPS core attached to Broadcom specific
27 + Advanced Microcontroller Bus.
33 depends on BCMA_DRIVER_MIPS
34 --- a/drivers/bcma/Makefile
35 +++ b/drivers/bcma/Makefile
36 @@ -5,6 +5,7 @@ bcma-$(CONFIG_BCMA_NFLASH) += driver_ch
37 bcma-y += driver_pci.o
38 bcma-$(CONFIG_BCMA_DRIVER_PCI_HOSTMODE) += driver_pci_host.o
39 bcma-$(CONFIG_BCMA_DRIVER_MIPS) += driver_mips.o
40 +bcma-$(CONFIG_BCMA_DRIVER_ARM) += driver_arm.o
41 bcma-$(CONFIG_BCMA_DRIVER_GMAC_CMN) += driver_gmac_cmn.o
42 bcma-$(CONFIG_BCMA_DRIVER_GPIO) += driver_gpio.o
43 bcma-$(CONFIG_BCMA_HOST_PCI) += host_pci.o
45 +++ b/drivers/bcma/driver_arm.c
48 + * Broadcom specific AMBA
49 + * Broadcom MIPS32 74K core driver
51 + * Copyright 2009, Broadcom Corporation
52 + * Copyright 2006, 2007, Michael Buesch <mb@bu3sch.de>
53 + * Copyright 2010, Bernhard Loos <bernhardloos@googlemail.com>
54 + * Copyright 2011, Hauke Mehrtens <hauke@hauke-m.de>
56 + * Licensed under the GNU/GPL. See COPYING for details.
59 +#include "bcma_private.h"
61 +#include <linux/bcma/bcma.h>
63 +static void bcma_core_mips_set_irq_name(struct bcma_bus *bus, unsigned int irq,
64 + u16 coreid, u8 unit)
66 + struct bcma_device *core;
68 + core = bcma_find_core_unit(bus, coreid, unit);
71 + "Can not find core (id: 0x%x, unit %i) for IRQ configuration.\n",
78 +void bcma_core_arm_init(struct bcma_drv_arm *acore)
80 + struct bcma_bus *bus;
81 + struct bcma_device *core;
82 + bus = acore->core->bus;
84 + if (acore->setup_done)
87 + bcma_core_mips_set_irq_name(bus, 111, BCMA_CORE_USB20, 0);
89 + bcma_core_mips_set_irq_name(bus, 179, BCMA_CORE_MAC_GBIT, 0);
90 + bcma_core_mips_set_irq_name(bus, 180, BCMA_CORE_MAC_GBIT, 1);
91 + bcma_core_mips_set_irq_name(bus, 181, BCMA_CORE_MAC_GBIT, 2);
92 + bcma_core_mips_set_irq_name(bus, 182, BCMA_CORE_MAC_GBIT, 3);
94 + bcma_core_mips_set_irq_name(bus, 112, BCMA_CORE_USB30, 0);
95 + bcma_debug(bus, "IRQ reconfiguration done\n");
98 + acore->setup_done = true;
100 --- a/drivers/bcma/main.c
101 +++ b/drivers/bcma/main.c
102 @@ -258,6 +258,13 @@ int bcma_bus_register(struct bcma_bus *b
103 bcma_core_mips_init(&bus->drv_mips);
106 + /* Init ARM core */
107 + core = bcma_find_core(bus, BCMA_CORE_ARMCA9);
109 + bus->drv_arm.core = core;
110 + bcma_core_arm_init(&bus->drv_arm);
114 core = bcma_find_core_unit(bus, BCMA_CORE_PCIE, 0);
116 --- a/include/linux/bcma/bcma.h
117 +++ b/include/linux/bcma/bcma.h
119 #include <linux/bcma/bcma_driver_chipcommon.h>
120 #include <linux/bcma/bcma_driver_pci.h>
121 #include <linux/bcma/bcma_driver_mips.h>
122 +#include <linux/bcma/bcma_driver_arm.h>
123 #include <linux/bcma/bcma_driver_gmac_cmn.h>
124 #include <linux/ssb/ssb.h> /* SPROM sharing */
126 @@ -334,6 +335,7 @@ struct bcma_bus {
127 struct bcma_drv_cc drv_cc;
128 struct bcma_drv_pci drv_pci[2];
129 struct bcma_drv_mips drv_mips;
130 + struct bcma_drv_arm drv_arm;
131 struct bcma_drv_gmac_cmn drv_gmac_cmn;
133 /* We decided to share SPROM struct with SSB as long as we do not need
135 +++ b/include/linux/bcma/bcma_driver_arm.h
137 +#ifndef LINUX_BCMA_DRIVER_ARM_H_
138 +#define LINUX_BCMA_DRIVER_ARM_H_
142 +struct bcma_drv_arm {
143 + struct bcma_device *core;
145 + u8 early_setup_done:1;
148 +#ifdef CONFIG_BCMA_DRIVER_ARM
149 +extern void bcma_core_arm_init(struct bcma_drv_arm *acore);
152 +static inline void bcma_core_arm_init(struct bcma_drv_arm *acore) { }
156 +#endif /* LINUX_BCMA_DRIVER_ARM_H_ */