2 * OSBRiDGE 5GXi/5XLi board support
4 * Copyright (C) 2009 Gabor Juhos <juhosg@openwrt.org>
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 as published
8 * by the Free Software Foundation.
11 #include <linux/kernel.h>
12 #include <linux/init.h>
13 #include <linux/gpio.h>
14 #include <linux/irq.h>
15 #include <linux/etherdevice.h>
17 #include <asm/mips_machine.h>
19 #include <asm/mach-adm5120/adm5120_defs.h>
20 #include <asm/mach-adm5120/adm5120_platform.h>
21 #include <asm/mach-adm5120/adm5120_info.h>
23 #ifdef CONFIG_MTD_PARTITIONS
24 static struct mtd_partition osbridge_5gxi_partitions[] = {
29 .mask_flags = MTD_WRITEABLE,
36 .offset = MTDPART_OFS_APPEND,
37 .size = MTDPART_SIZ_FULL,
40 #endif /* CONFIG_MTD_PARTITIONS */
42 static struct gpio_led osbridge_5gxi_gpio_leds[] __initdata = {
43 GPIO_LED_INV(ADM5120_GPIO_PIN6, "5gxi:green:user", NULL),
44 GPIO_LED_INV(ADM5120_GPIO_P0L0, "5gxi:yellow:lan", NULL),
47 static struct adm5120_pci_irq osbridge_5gxi_pci_irqs[] __initdata = {
48 PCIIRQ(2, 0, 1, ADM5120_IRQ_PCI0),
51 static u8 osbridge_5gxi_vlans[6] __initdata = {
52 0x41, 0x00, 0x00, 0x00, 0x00, 0x00
55 static void __init osbridge_5gxi_setup(void)
57 #ifdef CONFIG_MTD_PARTITIONS
58 adm5120_flash0_data.nr_parts = ARRAY_SIZE(osbridge_5gxi_partitions);
59 adm5120_flash0_data.parts = osbridge_5gxi_partitions;
60 #endif /* CONFIG_MTD_PARTITIONS */
62 adm5120_add_device_uart(0);
63 adm5120_add_device_uart(1);
65 adm5120_add_device_flash(0);
67 adm5120_add_device_switch(1, osbridge_5gxi_vlans);
68 adm5120_add_device_gpio_leds(ARRAY_SIZE(osbridge_5gxi_gpio_leds),
69 osbridge_5gxi_gpio_leds);
70 adm5120_pci_set_irq_map(ARRAY_SIZE(osbridge_5gxi_pci_irqs),
71 osbridge_5gxi_pci_irqs);
74 MIPS_MACHINE(MACH_ADM5120_5GXI, "OSBRiDGE 5GXi/5XLi board",