2 * ADM5120 specific platform definitions
4 * Copyright (C) 2007-2008 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.
12 #ifndef _ASM_MIPS_MACH_ADM5120_PLATFORM_H
13 #define _ASM_MIPS_MACH_ADM5120_PLATFORM_H
15 #include <linux/device.h>
16 #include <linux/platform_device.h>
17 #include <linux/input.h>
18 #include <linux/leds.h>
19 #include <linux/mtd/mtd.h>
20 #include <linux/mtd/map.h>
21 #include <linux/mtd/partitions.h>
22 #include <linux/mtd/nand.h>
23 #include <linux/gpio_buttons.h>
24 #include <linux/amba/bus.h>
25 #include <linux/amba/serial.h>
27 struct adm5120_flash_platform_data
{
28 void (*set_vpp
)(struct map_info
*, int);
29 void (*switch_bank
)(unsigned);
31 #ifdef CONFIG_MTD_PARTITIONS
32 unsigned int nr_parts
;
33 struct mtd_partition
*parts
;
37 struct adm5120_switch_platform_data
{
38 /* TODO: not yet implemented */
41 struct adm5120_pci_irq
{
48 #define PCIIRQ(s,f,p,i) {.slot = (s), .func = (f), .pin = (p), .irq = (i)}
51 extern void adm5120_pci_set_irq_map(unsigned int nr_irqs
,
52 struct adm5120_pci_irq
*map
) __init
;
54 static inline void adm5120_pci_set_irq_map(unsigned int nr_irqs
,
55 struct adm5120_pci_irq
*map
)
60 extern void adm5120_setup_eth_macs(u8
*mac_base
) __init
;
62 extern struct adm5120_flash_platform_data adm5120_flash0_data
;
63 extern struct adm5120_flash_platform_data adm5120_flash1_data
;
65 extern void adm5120_add_device_flash(unsigned id
) __init
;
66 extern void adm5120_add_device_usb(void) __init
;
67 extern void adm5120_add_device_uart(unsigned id
) __init
;
68 extern void adm5120_add_device_nand(struct platform_nand_data
*pdata
) __init
;
69 extern void adm5120_add_device_switch(unsigned num_ports
, u8
*vlan_map
) __init
;
70 extern void adm5120_add_device_gpio(u32 disable_mask
) __init
;
71 extern void adm5120_add_device_gpio_buttons(unsigned nbuttons
,
72 struct gpio_button
*buttons
) __init
;
74 #define GPIO_LED_DEF(g, n, t, a) { \
76 .default_trigger = (t), \
81 #define GPIO_LED_STD(g, n, t) GPIO_LED_DEF((g), (n), (t), 0)
82 #define GPIO_LED_INV(g, n, t) GPIO_LED_DEF((g), (n), (t), 1)
84 extern void adm5120_add_device_gpio_leds(unsigned num_leds
,
85 struct gpio_led
*leds
) __init
;
87 #endif /* _ASM_MIPS_MACH_ADM5120_PLATFORM_H */