ar71xx: add DB120 board specific PCI initialization
authorGabor Juhos <juhosg@openwrt.org>
Thu, 7 Apr 2011 20:53:41 +0000 (20:53 +0000)
committerGabor Juhos <juhosg@openwrt.org>
Thu, 7 Apr 2011 20:53:41 +0000 (20:53 +0000)
Signed-off-by: Jaiganesh Narayanan <jnarayanan@atheros.com>
SVN-Revision: 26523

target/linux/ar71xx/config-2.6.37
target/linux/ar71xx/files/arch/mips/ar71xx/Kconfig
target/linux/ar71xx/files/arch/mips/ar71xx/Makefile
target/linux/ar71xx/files/arch/mips/ar71xx/dev-db120-pci.c [new file with mode: 0644]
target/linux/ar71xx/files/arch/mips/ar71xx/dev-db120-pci.h [new file with mode: 0644]
target/linux/ar71xx/files/arch/mips/ar71xx/mach-db120.c

index d5a9413e37b6e837d923d9588affe025c385a4f3..826a864f39b0c982408d57b5be9d05fb6530af4c 100644 (file)
@@ -6,6 +6,7 @@ CONFIG_AR71XX_DEV_AP91_PCI=y
 CONFIG_AR71XX_DEV_AP94_PCI=y
 CONFIG_AR71XX_DEV_AR913X_WMAC=y
 CONFIG_AR71XX_DEV_AR934X_WMAC=y
 CONFIG_AR71XX_DEV_AP94_PCI=y
 CONFIG_AR71XX_DEV_AR913X_WMAC=y
 CONFIG_AR71XX_DEV_AR934X_WMAC=y
+CONFIG_AR71XX_DEV_DB120_PCI=y
 CONFIG_AR71XX_DEV_DSA=y
 CONFIG_AR71XX_DEV_GPIO_BUTTONS=y
 CONFIG_AR71XX_DEV_LEDS_GPIO=y
 CONFIG_AR71XX_DEV_DSA=y
 CONFIG_AR71XX_DEV_GPIO_BUTTONS=y
 CONFIG_AR71XX_DEV_LEDS_GPIO=y
index c35e6cfd9bfb0ea4e4beb8f2070289996b4c1368..ea377def3ddf3486dd56ca526a36f217c3c9e54f 100644 (file)
@@ -31,6 +31,7 @@ config AR71XX_MACH_AP96
 config AR71XX_MACH_DB120
        bool "Atheros DB120 board support"
        select AR71XX_DEV_AR934X_WMAC
 config AR71XX_MACH_DB120
        bool "Atheros DB120 board support"
        select AR71XX_DEV_AR934X_WMAC
+       select AR71XX_DEV_DB120_PCI if PCI
        select AR71XX_DEV_GPIO_BUTTONS
        select AR71XX_DEV_LEDS_GPIO
        select AR71XX_DEV_USB
        select AR71XX_DEV_GPIO_BUTTONS
        select AR71XX_DEV_LEDS_GPIO
        select AR71XX_DEV_USB
@@ -313,6 +314,10 @@ config AR71XX_DEV_AR913X_WMAC
 config AR71XX_DEV_AR934X_WMAC
        def_bool n
 
 config AR71XX_DEV_AR934X_WMAC
        def_bool n
 
+config AR71XX_DEV_DB120_PCI
+       select AR71XX_PCI_ATH9K_FIXUP
+       def_bool n
+
 config AR71XX_DEV_DSA
        def_bool n
 
 config AR71XX_DEV_DSA
        def_bool n
 
index 988e521a1a2c0d09f78353b3f0ea0a0fc59692c8..c9184b8e5e5d856c9462ed04f46a208d56092029 100644 (file)
@@ -17,6 +17,7 @@ obj-$(CONFIG_AR71XX_DEV_AP91_PCI)     += dev-ap91-pci.o
 obj-$(CONFIG_AR71XX_DEV_AP94_PCI)      += dev-ap94-pci.o
 obj-$(CONFIG_AR71XX_DEV_AR913X_WMAC)   += dev-ar913x-wmac.o
 obj-$(CONFIG_AR71XX_DEV_AR934X_WMAC)   += dev-ar934x-wmac.o
 obj-$(CONFIG_AR71XX_DEV_AP94_PCI)      += dev-ap94-pci.o
 obj-$(CONFIG_AR71XX_DEV_AR913X_WMAC)   += dev-ar913x-wmac.o
 obj-$(CONFIG_AR71XX_DEV_AR934X_WMAC)   += dev-ar934x-wmac.o
+obj-$(CONFIG_AR71XX_DEV_DB120_PCI)     += dev-db120-pci.o
 obj-$(CONFIG_AR71XX_DEV_DSA)           += dev-dsa.o
 obj-$(CONFIG_AR71XX_DEV_GPIO_BUTTONS)  += dev-gpio-buttons.o
 obj-$(CONFIG_AR71XX_DEV_LEDS_GPIO)     += dev-leds-gpio.o
 obj-$(CONFIG_AR71XX_DEV_DSA)           += dev-dsa.o
 obj-$(CONFIG_AR71XX_DEV_GPIO_BUTTONS)  += dev-gpio-buttons.o
 obj-$(CONFIG_AR71XX_DEV_LEDS_GPIO)     += dev-leds-gpio.o
diff --git a/target/linux/ar71xx/files/arch/mips/ar71xx/dev-db120-pci.c b/target/linux/ar71xx/files/arch/mips/ar71xx/dev-db120-pci.c
new file mode 100644 (file)
index 0000000..a488a81
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ *  Atheros db120 reference board PCI initialization
+ *
+ *  Copyright (C) 2010-2011 Jaiganesh Narayanan <jnarayanan@atheros.com>
+ *
+ *  Parts of this file are based on Atheros linux 2.6.31 BSP
+ *
+ *  This program is free software; you can redistribute it and/or modify it
+ *  under the terms of the GNU General Public License version 2 as published
+ *  by the Free Software Foundation.
+ */
+
+#include <linux/pci.h>
+
+#include <asm/mach-ar71xx/ar71xx.h>
+#include <asm/mach-ar71xx/pci.h>
+
+#include "dev-db120-pci.h"
+
+static struct ar71xx_pci_irq db120_pci_irqs[] __initdata = {
+       {
+               .slot   = 0,
+               .pin    = 1,
+               .irq    = AR71XX_PCI_IRQ_DEV0,
+       }
+};
+
+void __init db120_pci_init(void)
+{
+       ar71xx_pci_init(ARRAY_SIZE(db120_pci_irqs), db120_pci_irqs);
+}
diff --git a/target/linux/ar71xx/files/arch/mips/ar71xx/dev-db120-pci.h b/target/linux/ar71xx/files/arch/mips/ar71xx/dev-db120-pci.h
new file mode 100644 (file)
index 0000000..3e9c261
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+ *  Atheros DB120 reference board PCI initialization
+ *
+ *  Copyright (C) 2010-2011 Jaiganesh Narayanan <jnarayanan@atheros.com>
+ *
+ *  Parts of this file are based on Atheros linux 2.6.31 BSP
+ *
+ *  This program is free software; you can redistribute it and/or modify it
+ *  under the terms of the GNU General Public License version 2 as published
+ *  by the Free Software Foundation.
+ */
+
+#ifndef _AR71XX_DEV_DB120_PCI_H
+#define _AR71XX_DEV_DB120_PCI_H
+
+#if defined(CONFIG_AR71XX_DEV_DB120_PCI)
+void db120_pci_init(void);
+#else
+static inline void db120_pci_init(void) { }
+#endif
+
+#endif /* _AR71XX_DEV_DB120_PCI_H */
index 3e4af40bdbb81c7d20f07913a084e62bba5e0f0e..ad7a8937edaa5c3e7a1cc9938804ef9fbb699c7d 100644 (file)
@@ -20,6 +20,7 @@
 #include "dev-leds-gpio.h"
 #include "dev-usb.h"
 #include "dev-ar934x-wmac.h"
 #include "dev-leds-gpio.h"
 #include "dev-usb.h"
 #include "dev-ar934x-wmac.h"
+#include "dev-db120-pci.h"
 
 #define DB120_GPIO_LED_USB     11
 #define DB120_GPIO_LED_WLAN_5G 12
 
 #define DB120_GPIO_LED_USB     11
 #define DB120_GPIO_LED_WLAN_5G 12
@@ -125,6 +126,8 @@ static void __init db120_setup(void)
 
        ar934x_add_device_wmac(art + DB120_CALDATA_OFFSET,
                                art + DB120_WMAC_MAC_OFFSET);
 
        ar934x_add_device_wmac(art + DB120_CALDATA_OFFSET,
                                art + DB120_WMAC_MAC_OFFSET);
+
+       db120_pci_init();
 }
 
 MIPS_MACHINE(AR71XX_MACH_DB120, "DB120", "Atheros DB120", db120_setup);
 }
 
 MIPS_MACHINE(AR71XX_MACH_DB120, "DB120", "Atheros DB120", db120_setup);