[backfire] merge r27449
[openwrt-10.03/.git] / target / linux / ifxmips / files / arch / mips / ifxmips / board.c
index 0f05aed057d15da484e327a29e7d473028458736..0f084a81b000398e495433e7aaf62ed5a67dd391 100644 (file)
 #include <linux/time.h>
 #include <linux/io.h>
 #include <linux/gpio.h>
+
 #include <asm/bootinfo.h>
 #include <asm/irq.h>
-#include <asm/ifxmips/ifxmips.h>
-#include <asm/ifxmips/ifxmips_irq.h>
+
+#include <ifxmips.h>
+#include <ifxmips_irq.h>
 
 #define MAX_BOARD_NAME_LEN             32
 #define MAX_IFXMIPS_DEVS               9
@@ -53,6 +55,7 @@ enum {
 };
 
 extern int ifxmips_pci_external_clock;
+extern int ifxmips_pci_req_mask;
 
 static unsigned int chiprev;
 static int cmdline_mac;
@@ -68,6 +71,7 @@ struct ifxmips_board {
        struct gpio_led *ifxmips_leds;
        struct gpio_led *gpio_leds;
        int pci_external_clock;
+       int pci_req_mask;
        int num_devs;
 };
 
@@ -204,6 +208,7 @@ static struct gpio_led easy4010_leds[] = {
 
 static struct ifxmips_board boards[] = {
        {
+               /* infineon eval kit */
                .type = EASY50712,
                .name = "EASY50712",
                .system_type = SYSTEM_DANUBE_CHIPID1,
@@ -214,6 +219,7 @@ static struct ifxmips_board boards[] = {
                        .end = (1 << 0) | (1 << 1)},
                .ifxmips_leds = easy50712_leds,
        }, {
+               /* infineon eval kit */
                .type = EASY4010,
                .name = "EASY4010",
                .system_type = SYSTEM_TWINPASS_CHIPID,
@@ -224,6 +230,7 @@ static struct ifxmips_board boards[] = {
                        .end = (1 << 0) | (1 << 1)},
                .ifxmips_leds = easy4010_leds,
        }, {
+               /* arcaydian annex-a board used by thompson, airties, ... */
                .type = ARV4519,
                .name = "ARV4519",
                .system_type = SYSTEM_DANUBE_CHIPID2,
@@ -330,9 +337,10 @@ struct ifxmips_board *ifxmips_find_board(void)
 
 int __init ifxmips_init_devices(void)
 {
-       struct ifxmips_board *board = ifxmips_find_board();
+       struct ifxmips_board *board;
 
        chiprev = (ifxmips_r32(IFXMIPS_MPS_CHIPID) & 0x0FFFFFFF);
+       board = ifxmips_find_board();
        ifxmips_brn = ifxmips_find_brn_block();
 
        if (!cmdline_mac)
@@ -361,6 +369,7 @@ int __init ifxmips_init_devices(void)
                ifxmips_led_data.num_leds = ARRAY_SIZE(easy4010_leds);
                break;
        case ARV4519:
+               /* set some sane defaults for the gpios */
                gpio_set_value(3, 0);
                gpio_set_value(4, 0);
                gpio_set_value(5, 0);
@@ -386,6 +395,8 @@ int __init ifxmips_init_devices(void)
        ifxmips_gpio_dev.resource = &board->gpiodev_resource;
        if (board->pci_external_clock)
                ifxmips_pci_external_clock = 1;
+       if (board->pci_req_mask)
+               ifxmips_pci_req_mask = board->pci_req_mask;
        printk(KERN_INFO "using board definition %s\n", board->name);
        return platform_add_devices(board->devs, board->num_devs);
 }