[adm5120] license cleanup
[openwrt.git] / target / linux / adm5120 / files / arch / mips / adm5120 / boards / cellvision.c
index f7d44e2..178c87f 100644 (file)
@@ -6,20 +6,9 @@
  *  Copyright (C) 2007 OpenWrt.org
  *  Copyright (C) 2007 Gabor Juhos <juhosg at openwrt.org>
  *
- *  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 Free Software Foundation; either version 2
- *  of the License, or (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the
- *  Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- *  Boston, MA  02110-1301, USA.
+ *  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.
  *
  */
 
@@ -29,8 +18,9 @@
 #include <asm/bootinfo.h>
 #include <asm/gpio.h>
 
-#include <asm/mach-adm5120/adm5120_board.h>
-#include <asm/mach-adm5120/adm5120_platform.h>
+#include <adm5120_board.h>
+#include <adm5120_platform.h>
+#include <adm5120_irq.h>
 
 static void switch_bank_gpio5(unsigned bank)
 {
@@ -44,6 +34,12 @@ static void switch_bank_gpio5(unsigned bank)
        }
 }
 
+static struct adm5120_pci_irq cas771_pci_irqs[] __initdata = {
+       PCIIRQ(2, 0, 1, ADM5120_IRQ_PCI0),
+       PCIIRQ(3, 0, 1, ADM5120_IRQ_PCI1),
+       PCIIRQ(3, 2, 3, ADM5120_IRQ_PCI2)
+};
+
 static struct mtd_partition cas6xx_partitions[] = {
        {
                .name   = "admboot",
@@ -124,69 +120,53 @@ static void __init cas7xx_setup(void)
        /* TODO: setup mac address */
 }
 
-static struct adm5120_board cas630_board __initdata = {
-       .mach_type      = MACH_ADM5120_CAS630,
-       .name           = "Cellvision CAS-630/630W",
+/*--------------------------------------------------------------------------*/
+
+ADM5120_BOARD_START(CAS630, "Cellvision CAS-630/630W")
        .board_setup    = cas6xx_setup,
        .eth_num_ports  = 1,
        .num_devices    = ARRAY_SIZE(cas6xx_devices),
        .devices        = cas6xx_devices,
-};
+       /* TODO: PCI IRQ map */
+ADM5120_BOARD_END
 
-static struct adm5120_board cas670_board __initdata = {
-       .mach_type      = MACH_ADM5120_CAS670,
-       .name           = "Cellvision CAS-670/670W",
+ADM5120_BOARD_START(CAS670, "Cellvision CAS-670/670W")
        .board_setup    = cas6xx_setup,
        .eth_num_ports  = 1,
        .num_devices    = ARRAY_SIZE(cas6xx_devices),
        .devices        = cas6xx_devices,
-};
+       /* TODO: PCI IRQ map */
+ADM5120_BOARD_END
 
-static struct adm5120_board cas700_board __initdata = {
-       .mach_type      = MACH_ADM5120_CAS700,
-       .name           = "Cellvision CAS-700/700W",
+ADM5120_BOARD_START(CAS700, "Cellvision CAS-700/700W")
        .board_setup    = cas7xx_setup,
        .eth_num_ports  = 1,
        .num_devices    = ARRAY_SIZE(cas7xx_devices),
        .devices        = cas7xx_devices,
-};
+       /* TODO: PCI IRQ map */
+ADM5120_BOARD_END
 
-static struct adm5120_board cas771_board __initdata = {
-       .mach_type      = MACH_ADM5120_CAS771,
-       .name           = "Cellvision CAS-771/771W",
+ADM5120_BOARD_START(CAS771, "Cellvision CAS-771/771W")
        .board_setup    = cas7xx_setup,
        .eth_num_ports  = 1,
        .num_devices    = ARRAY_SIZE(cas7xx_devices),
        .devices        = cas7xx_devices,
-};
+       .pci_nr_irqs    = ARRAY_SIZE(cas771_pci_irqs),
+       .pci_irq_map    = cas771_pci_irqs,
+ADM5120_BOARD_END
 
-static struct adm5120_board cas790_board __initdata = {
-       .mach_type      = MACH_ADM5120_CAS790,
-       .name           = "Cellvision CAS-790",
+ADM5120_BOARD_START(CAS790, "Cellvision CAS-790")
        .board_setup    = cas7xx_setup,
        .eth_num_ports  = 1,
        .num_devices    = ARRAY_SIZE(cas7xx_devices),
        .devices        = cas7xx_devices,
-};
+       /* TODO: PCI IRQ map */
+ADM5120_BOARD_END
 
-static struct adm5120_board cas861_board __initdata = {
-       .mach_type      = MACH_ADM5120_CAS861,
-       .name           = "Cellvision CAS-861/861W",
+ADM5120_BOARD_START(CAS861, "Cellvision CAS-861/861W")
        .board_setup    = cas7xx_setup,
        .eth_num_ports  = 1,
        .num_devices    = ARRAY_SIZE(cas7xx_devices),
        .devices        = cas7xx_devices,
-};
-
-static int __init register_boards(void)
-{
-       adm5120_board_register(&cas630_board);
-       adm5120_board_register(&cas670_board);
-       adm5120_board_register(&cas700_board);
-       adm5120_board_register(&cas771_board);
-       adm5120_board_register(&cas790_board);
-       adm5120_board_register(&cas861_board);
-       return 0;
-}
-
-pure_initcall(register_boards);
+       /* TODO: PCI IRQ map */
+ADM5120_BOARD_END