[adm5120] more license cleanups
[10.03/openwrt.git] / target / linux / adm5120 / files / include / asm-mips / mach-adm5120 / adm5120_platform.h
1 /*
2  *  $Id$
3  *
4  *  ADM5120 specific platform definitions
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 #ifndef _ADM5120_PLATFORM_H_
16 #define _ADM5120_PLATFORM_H_
17
18 #include <linux/device.h>
19 #include <linux/platform_device.h>
20
21 #include <linux/mtd/mtd.h>
22 #include <linux/mtd/map.h>
23 #include <linux/mtd/partitions.h>
24 #include <linux/mtd/nand.h>
25
26 #include <linux/amba/bus.h>
27 #include <linux/amba/serial.h>
28
29 struct adm5120_flash_platform_data {
30         void                    (*set_vpp)(struct map_info *, int);
31         void                    (*switch_bank)(unsigned);
32         u32                     window_size;
33 #ifdef CONFIG_MTD_PARTITIONS
34         unsigned int            nr_parts;
35         struct mtd_partition    *parts;
36 #endif
37 };
38
39 struct adm5120_switch_platform_data {
40         /* TODO: not yet implemented */
41 };
42
43 struct adm5120_pci_irq {
44         u8      slot;
45         u8      func;
46         u8      pin;
47         unsigned irq;
48 };
49
50 #define PCIIRQ(s,f,p,i) {.slot = (s), .func = (f), .pin  = (p), .irq  = (i)}
51
52 #ifdef CONFIG_PCI
53 extern void adm5120_pci_set_irq_map(unsigned int nr_irqs,
54                 struct adm5120_pci_irq *map) __init;
55 #else
56 static inline void adm5120_pci_set_irq_map(unsigned int nr_irqs,
57                 struct adm5120_pci_irq *map)
58 {
59 }
60 #endif
61
62 extern struct adm5120_flash_platform_data adm5120_flash0_data;
63 extern struct adm5120_flash_platform_data adm5120_flash1_data;
64 extern struct platform_nand_data adm5120_nand_data;
65 extern struct adm5120_switch_platform_data adm5120_switch_data;
66 extern struct amba_pl010_data adm5120_uart0_data;
67 extern struct amba_pl010_data adm5120_uart1_data;
68
69 extern struct platform_device adm5120_flash0_device;
70 extern struct platform_device adm5120_flash1_device;
71 extern struct platform_device adm5120_nand_device;
72 extern struct platform_device adm5120_hcd_device;
73 extern struct platform_device adm5120_switch_device;
74 extern struct amba_device adm5120_uart0_device;
75 extern struct amba_device adm5120_uart1_device;
76
77 extern void adm5120_uart_set_mctrl(struct amba_device *dev, void __iomem *base,
78                 unsigned int mctrl);
79
80 extern void adm5120_nand_cmd_ctrl(struct mtd_info *mtd, int cmd,
81                 unsigned int ctrl);
82 extern int adm5120_nand_ready(struct mtd_info *mtd);
83
84 #endif /* _ADM5120_PLATFORM_H_ */