4 * ADM5120 specific platform definitions
6 * Copyright (C) 2007-2008 OpenWrt.org
7 * Copyright (C) 2007-2008 Gabor Juhos <juhosg at openwrt.org>
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.
15 #ifndef _ADM5120_PLATFORM_H_
16 #define _ADM5120_PLATFORM_H_
18 #include <linux/device.h>
19 #include <linux/platform_device.h>
21 #include <linux/mtd/mtd.h>
22 #include <linux/mtd/map.h>
23 #include <linux/mtd/partitions.h>
24 #include <linux/mtd/nand.h>
26 #include <linux/input.h>
27 #include <linux/gpio_buttons.h>
29 #include <linux/amba/bus.h>
30 #include <linux/amba/serial.h>
32 struct adm5120_flash_platform_data
{
33 void (*set_vpp
)(struct map_info
*, int);
34 void (*switch_bank
)(unsigned);
36 #ifdef CONFIG_MTD_PARTITIONS
37 unsigned int nr_parts
;
38 struct mtd_partition
*parts
;
42 struct adm5120_switch_platform_data
{
43 /* TODO: not yet implemented */
46 struct adm5120_pci_irq
{
53 #define PCIIRQ(s,f,p,i) {.slot = (s), .func = (f), .pin = (p), .irq = (i)}
56 extern void adm5120_pci_set_irq_map(unsigned int nr_irqs
,
57 struct adm5120_pci_irq
*map
) __init
;
59 static inline void adm5120_pci_set_irq_map(unsigned int nr_irqs
,
60 struct adm5120_pci_irq
*map
)
65 #define ADM5120_NUM_BUTTONS 5
67 extern struct adm5120_flash_platform_data adm5120_flash0_data
;
68 extern struct adm5120_flash_platform_data adm5120_flash1_data
;
69 extern struct platform_nand_data adm5120_nand_data
;
70 extern struct adm5120_switch_platform_data adm5120_switch_data
;
71 extern struct gpio_button adm5120_buttons
[ADM5120_NUM_BUTTONS
];
72 extern struct gpio_buttons_platform_data adm5120_buttons_data
;
73 extern struct amba_pl010_data adm5120_uart0_data
;
74 extern struct amba_pl010_data adm5120_uart1_data
;
76 extern struct platform_device adm5120_flash0_device
;
77 extern struct platform_device adm5120_flash1_device
;
78 extern struct platform_device adm5120_nand_device
;
79 extern struct platform_device adm5120_hcd_device
;
80 extern struct platform_device adm5120_switch_device
;
81 extern struct platform_device adm5120_buttons_device
;
82 extern struct amba_device adm5120_uart0_device
;
83 extern struct amba_device adm5120_uart1_device
;
85 extern void adm5120_uart_set_mctrl(struct amba_device
*dev
, void __iomem
*base
,
88 extern void adm5120_nand_cmd_ctrl(struct mtd_info
*mtd
, int cmd
,
90 extern int adm5120_nand_ready(struct mtd_info
*mtd
);
92 #endif /* _ADM5120_PLATFORM_H_ */