summaryrefslogtreecommitdiff
path: root/target/linux/brcm47xx/files/arch
diff options
context:
space:
mode:
authorMichael Büsch <mb@bu3sch.de>2008-02-20 17:56:24 +0000
committerMichael Büsch <mb@bu3sch.de>2008-02-20 17:56:24 +0000
commit19477a56a9ea88c4ca07c900cd260233ff26fc3e (patch)
tree86736a30b62013a151dc363060f80566bd5c1077 /target/linux/brcm47xx/files/arch
parentbd91c79caa0a941aeead832c3d2e851761eebc73 (diff)
downloadmtk-20170518-19477a56a9ea88c4ca07c900cd260233ff26fc3e.zip
mtk-20170518-19477a56a9ea88c4ca07c900cd260233ff26fc3e.tar.gz
mtk-20170518-19477a56a9ea88c4ca07c900cd260233ff26fc3e.tar.bz2
bcm47xx: Add driver for the SSB Gigabit Ethernet core. It doesn't work, yet, but let's commit what we have.
SVN-Revision: 10509
Diffstat (limited to 'target/linux/brcm47xx/files/arch')
-rw-r--r--target/linux/brcm47xx/files/arch/mips/bcm947xx/irq.c23
-rw-r--r--target/linux/brcm47xx/files/arch/mips/bcm947xx/setup.c14
2 files changed, 37 insertions, 0 deletions
diff --git a/target/linux/brcm47xx/files/arch/mips/bcm947xx/irq.c b/target/linux/brcm47xx/files/arch/mips/bcm947xx/irq.c
index 56d4c84..c6b85a9 100644
--- a/target/linux/brcm47xx/files/arch/mips/bcm947xx/irq.c
+++ b/target/linux/brcm47xx/files/arch/mips/bcm947xx/irq.c
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2004 Florian Schirmer (jolt@tuxbox.org)
+ * Copyright (C) 2008 Michael Buesch <mb@bu3sch.de>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -29,12 +30,18 @@
#include <linux/module.h>
#include <linux/smp.h>
#include <linux/types.h>
+#include <linux/pci.h>
+#include <linux/ssb/ssb.h>
#include <asm/cpu.h>
#include <asm/io.h>
#include <asm/irq.h>
#include <asm/irq_cpu.h>
+
+extern struct ssb_bus ssb;
+
+
void plat_irq_dispatch(void)
{
u32 cause;
@@ -61,3 +68,19 @@ void __init arch_init_irq(void)
{
mips_cpu_irq_init();
}
+
+int pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
+{
+ int res;
+
+ res = ssb_pcibios_map_irq(dev, slot, pin);
+ if (res < 0) {
+ printk(KERN_ALERT "PCI: Failed to map IRQ of device %s\n",
+ pci_name((struct pci_dev *)dev));
+ return 0;
+ }
+ /* IRQ-0 and IRQ-1 are software interrupts. */
+ WARN_ON((res == 0) || (res == 1));
+
+ return res;
+}
diff --git a/target/linux/brcm47xx/files/arch/mips/bcm947xx/setup.c b/target/linux/brcm47xx/files/arch/mips/bcm947xx/setup.c
index 85ff1cf..5856d8f 100644
--- a/target/linux/brcm47xx/files/arch/mips/bcm947xx/setup.c
+++ b/target/linux/brcm47xx/files/arch/mips/bcm947xx/setup.c
@@ -47,6 +47,20 @@ extern void bcm47xx_time_init(void);
struct ssb_bus ssb;
+
+int pcibios_plat_dev_init(struct pci_dev *dev)
+{
+ int err;
+
+ err = ssb_pcibios_plat_dev_init(dev);
+ if (err) {
+ printk(KERN_ALERT "PCI: Failed to init device %s\n",
+ pci_name(dev));
+ }
+
+ return err;
+}
+
static void bcm47xx_machine_restart(char *command)
{
printk(KERN_ALERT "Please stand by while rebooting the system...\n");