[adm5120] license cleanup
[openwrt/svn-archive/archive.git] / target / linux / adm5120 / files / arch / mips / adm5120 / boards / edimax.c
1 /*
2 * $Id$
3 *
4 * Edimax boards
5 *
6 * Copyright (C) 2007 OpenWrt.org
7 * Copyright (C) 2007 Gabor Juhos <juhosg at openwrt.org>
8 *
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License version 2 as published
11 * by the Free Software Foundation.
12 *
13 */
14
15 #include <linux/kernel.h>
16 #include <linux/init.h>
17
18 #include <asm/bootinfo.h>
19 #include <asm/gpio.h>
20
21 #include <adm5120_board.h>
22 #include <adm5120_irq.h>
23 #include <adm5120_platform.h>
24
25 static struct adm5120_pci_irq br61xx_pci_irqs[] __initdata = {
26 PCIIRQ(2, 0, 1, ADM5120_IRQ_PCI0),
27 };
28
29 static struct mtd_partition br61xx_partitions[] = {
30 {
31 .name = "admboot",
32 .offset = 0,
33 .size = 32*1024,
34 .mask_flags = MTD_WRITEABLE,
35 } , {
36 .name = "config",
37 .offset = MTDPART_OFS_APPEND,
38 .size = 32*1024,
39 } , {
40 .name = "firmware",
41 .offset = MTDPART_OFS_APPEND,
42 .size = MTDPART_SIZ_FULL,
43 }
44 };
45
46 static struct platform_device *br6104k_devices[] __initdata = {
47 &adm5120_flash0_device,
48 &adm5120_hcd_device,
49 };
50
51 static struct platform_device *br61x4wg_devices[] __initdata = {
52 &adm5120_flash0_device,
53 };
54
55 static void __init br61xx_setup(void) {
56 /* setup data for flash0 device */
57 adm5120_flash0_data.nr_parts = ARRAY_SIZE(br61xx_partitions);
58 adm5120_flash0_data.parts = br61xx_partitions;
59
60 /* TODO: setup mac addresses, if possible */
61 }
62
63 unsigned char br61xx_vlans[6] = {
64 0x41, 0x42, 0x44, 0x48, 0x50, 0x00
65 };
66
67 /*--------------------------------------------------------------------------*/
68
69 ADM5120_BOARD_START(BR6104K, "Edimax BR-6104K/6104KP")
70 .board_setup = br61xx_setup,
71 .eth_num_ports = 5,
72 .eth_vlans = br61xx_vlans,
73 .num_devices = ARRAY_SIZE(br6104k_devices),
74 .devices = br6104k_devices,
75 ADM5120_BOARD_END
76
77 ADM5120_BOARD_START(BR61x4WG, "Edimax BR-6104WG/6114WG")
78 .board_setup = br61xx_setup,
79 .eth_num_ports = 5,
80 .eth_vlans = br61xx_vlans,
81 .num_devices = ARRAY_SIZE(br61x4wg_devices),
82 .devices = br61x4wg_devices,
83 .pci_nr_irqs = ARRAY_SIZE(br61xx_pci_irqs),
84 .pci_irq_map = br61xx_pci_irqs,
85 ADM5120_BOARD_END