spi-topcliff-pch: supports a spi mode setup and bit order setup by IO control
[zen-stable.git] / arch / arm / mach-spear3xx / include / mach / generic.h
blob14276e5a98d2e2081d5ba227ceac6d5f11b6d985
1 /*
2 * arch/arm/mach-spear3xx/generic.h
4 * SPEAr3XX machine family generic header file
6 * Copyright (C) 2009 ST Microelectronics
7 * Viresh Kumar<viresh.kumar@st.com>
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
14 #ifndef __MACH_GENERIC_H
15 #define __MACH_GENERIC_H
17 #include <linux/init.h>
18 #include <linux/platform_device.h>
19 #include <linux/amba/bus.h>
20 #include <asm/mach/time.h>
21 #include <asm/mach/map.h>
22 #include <plat/padmux.h>
24 /* spear3xx declarations */
26 * Each GPT has 2 timer channels
27 * Following GPT channels will be used as clock source and clockevent
29 #define SPEAR_GPT0_BASE SPEAR3XX_ML1_TMR_BASE
30 #define SPEAR_GPT0_CHAN0_IRQ SPEAR3XX_IRQ_CPU_GPT1_1
31 #define SPEAR_GPT0_CHAN1_IRQ SPEAR3XX_IRQ_CPU_GPT1_2
33 /* Add spear3xx family device structure declarations here */
34 extern struct amba_device spear3xx_gpio_device;
35 extern struct amba_device spear3xx_uart_device;
36 extern struct sys_timer spear3xx_timer;
38 /* Add spear3xx family function declarations here */
39 void __init spear3xx_clk_init(void);
40 void __init spear_setup_timer(void);
41 void __init spear3xx_map_io(void);
42 void __init spear3xx_init_irq(void);
43 void __init spear3xx_init(void);
45 void spear_restart(char, const char *);
47 /* pad mux declarations */
48 #define PMX_FIRDA_MASK (1 << 14)
49 #define PMX_I2C_MASK (1 << 13)
50 #define PMX_SSP_CS_MASK (1 << 12)
51 #define PMX_SSP_MASK (1 << 11)
52 #define PMX_MII_MASK (1 << 10)
53 #define PMX_GPIO_PIN0_MASK (1 << 9)
54 #define PMX_GPIO_PIN1_MASK (1 << 8)
55 #define PMX_GPIO_PIN2_MASK (1 << 7)
56 #define PMX_GPIO_PIN3_MASK (1 << 6)
57 #define PMX_GPIO_PIN4_MASK (1 << 5)
58 #define PMX_GPIO_PIN5_MASK (1 << 4)
59 #define PMX_UART0_MODEM_MASK (1 << 3)
60 #define PMX_UART0_MASK (1 << 2)
61 #define PMX_TIMER_3_4_MASK (1 << 1)
62 #define PMX_TIMER_1_2_MASK (1 << 0)
64 /* pad mux devices */
65 extern struct pmx_dev spear3xx_pmx_firda;
66 extern struct pmx_dev spear3xx_pmx_i2c;
67 extern struct pmx_dev spear3xx_pmx_ssp_cs;
68 extern struct pmx_dev spear3xx_pmx_ssp;
69 extern struct pmx_dev spear3xx_pmx_mii;
70 extern struct pmx_dev spear3xx_pmx_gpio_pin0;
71 extern struct pmx_dev spear3xx_pmx_gpio_pin1;
72 extern struct pmx_dev spear3xx_pmx_gpio_pin2;
73 extern struct pmx_dev spear3xx_pmx_gpio_pin3;
74 extern struct pmx_dev spear3xx_pmx_gpio_pin4;
75 extern struct pmx_dev spear3xx_pmx_gpio_pin5;
76 extern struct pmx_dev spear3xx_pmx_uart0_modem;
77 extern struct pmx_dev spear3xx_pmx_uart0;
78 extern struct pmx_dev spear3xx_pmx_timer_3_4;
79 extern struct pmx_dev spear3xx_pmx_timer_1_2;
81 #if defined(CONFIG_MACH_SPEAR310) || defined(CONFIG_MACH_SPEAR320)
82 /* padmux plgpio devices */
83 extern struct pmx_dev spear3xx_pmx_plgpio_0_1;
84 extern struct pmx_dev spear3xx_pmx_plgpio_2_3;
85 extern struct pmx_dev spear3xx_pmx_plgpio_4_5;
86 extern struct pmx_dev spear3xx_pmx_plgpio_6_9;
87 extern struct pmx_dev spear3xx_pmx_plgpio_10_27;
88 extern struct pmx_dev spear3xx_pmx_plgpio_28;
89 extern struct pmx_dev spear3xx_pmx_plgpio_29;
90 extern struct pmx_dev spear3xx_pmx_plgpio_30;
91 extern struct pmx_dev spear3xx_pmx_plgpio_31;
92 extern struct pmx_dev spear3xx_pmx_plgpio_32;
93 extern struct pmx_dev spear3xx_pmx_plgpio_33;
94 extern struct pmx_dev spear3xx_pmx_plgpio_34_36;
95 extern struct pmx_dev spear3xx_pmx_plgpio_37_42;
96 extern struct pmx_dev spear3xx_pmx_plgpio_43_44_47_48;
97 extern struct pmx_dev spear3xx_pmx_plgpio_45_46_49_50;
98 #endif
100 /* spear300 declarations */
101 #ifdef CONFIG_MACH_SPEAR300
102 /* Add spear300 machine device structure declarations here */
103 extern struct amba_device spear300_gpio1_device;
105 /* pad mux modes */
106 extern struct pmx_mode spear300_nand_mode;
107 extern struct pmx_mode spear300_nor_mode;
108 extern struct pmx_mode spear300_photo_frame_mode;
109 extern struct pmx_mode spear300_lend_ip_phone_mode;
110 extern struct pmx_mode spear300_hend_ip_phone_mode;
111 extern struct pmx_mode spear300_lend_wifi_phone_mode;
112 extern struct pmx_mode spear300_hend_wifi_phone_mode;
113 extern struct pmx_mode spear300_ata_pabx_wi2s_mode;
114 extern struct pmx_mode spear300_ata_pabx_i2s_mode;
115 extern struct pmx_mode spear300_caml_lcdw_mode;
116 extern struct pmx_mode spear300_camu_lcd_mode;
117 extern struct pmx_mode spear300_camu_wlcd_mode;
118 extern struct pmx_mode spear300_caml_lcd_mode;
120 /* pad mux devices */
121 extern struct pmx_dev spear300_pmx_fsmc_2_chips;
122 extern struct pmx_dev spear300_pmx_fsmc_4_chips;
123 extern struct pmx_dev spear300_pmx_keyboard;
124 extern struct pmx_dev spear300_pmx_clcd;
125 extern struct pmx_dev spear300_pmx_telecom_gpio;
126 extern struct pmx_dev spear300_pmx_telecom_tdm;
127 extern struct pmx_dev spear300_pmx_telecom_spi_cs_i2c_clk;
128 extern struct pmx_dev spear300_pmx_telecom_camera;
129 extern struct pmx_dev spear300_pmx_telecom_dac;
130 extern struct pmx_dev spear300_pmx_telecom_i2s;
131 extern struct pmx_dev spear300_pmx_telecom_boot_pins;
132 extern struct pmx_dev spear300_pmx_telecom_sdhci_4bit;
133 extern struct pmx_dev spear300_pmx_telecom_sdhci_8bit;
134 extern struct pmx_dev spear300_pmx_gpio1;
136 /* Add spear300 machine function declarations here */
137 void __init spear300_init(struct pmx_mode *pmx_mode, struct pmx_dev **pmx_devs,
138 u8 pmx_dev_count);
140 #endif /* CONFIG_MACH_SPEAR300 */
142 /* spear310 declarations */
143 #ifdef CONFIG_MACH_SPEAR310
144 /* Add spear310 machine device structure declarations here */
146 /* pad mux devices */
147 extern struct pmx_dev spear310_pmx_emi_cs_0_1_4_5;
148 extern struct pmx_dev spear310_pmx_emi_cs_2_3;
149 extern struct pmx_dev spear310_pmx_uart1;
150 extern struct pmx_dev spear310_pmx_uart2;
151 extern struct pmx_dev spear310_pmx_uart3_4_5;
152 extern struct pmx_dev spear310_pmx_fsmc;
153 extern struct pmx_dev spear310_pmx_rs485_0_1;
154 extern struct pmx_dev spear310_pmx_tdm0;
156 /* Add spear310 machine function declarations here */
157 void __init spear310_init(struct pmx_mode *pmx_mode, struct pmx_dev **pmx_devs,
158 u8 pmx_dev_count);
160 #endif /* CONFIG_MACH_SPEAR310 */
162 /* spear320 declarations */
163 #ifdef CONFIG_MACH_SPEAR320
164 /* Add spear320 machine device structure declarations here */
166 /* pad mux modes */
167 extern struct pmx_mode spear320_auto_net_smii_mode;
168 extern struct pmx_mode spear320_auto_net_mii_mode;
169 extern struct pmx_mode spear320_auto_exp_mode;
170 extern struct pmx_mode spear320_small_printers_mode;
172 /* pad mux devices */
173 extern struct pmx_dev spear320_pmx_clcd;
174 extern struct pmx_dev spear320_pmx_emi;
175 extern struct pmx_dev spear320_pmx_fsmc;
176 extern struct pmx_dev spear320_pmx_spp;
177 extern struct pmx_dev spear320_pmx_sdhci;
178 extern struct pmx_dev spear320_pmx_i2s;
179 extern struct pmx_dev spear320_pmx_uart1;
180 extern struct pmx_dev spear320_pmx_uart1_modem;
181 extern struct pmx_dev spear320_pmx_uart2;
182 extern struct pmx_dev spear320_pmx_touchscreen;
183 extern struct pmx_dev spear320_pmx_can;
184 extern struct pmx_dev spear320_pmx_sdhci_led;
185 extern struct pmx_dev spear320_pmx_pwm0;
186 extern struct pmx_dev spear320_pmx_pwm1;
187 extern struct pmx_dev spear320_pmx_pwm2;
188 extern struct pmx_dev spear320_pmx_pwm3;
189 extern struct pmx_dev spear320_pmx_ssp1;
190 extern struct pmx_dev spear320_pmx_ssp2;
191 extern struct pmx_dev spear320_pmx_mii1;
192 extern struct pmx_dev spear320_pmx_smii0;
193 extern struct pmx_dev spear320_pmx_smii1;
194 extern struct pmx_dev spear320_pmx_i2c1;
196 /* Add spear320 machine function declarations here */
197 void __init spear320_init(struct pmx_mode *pmx_mode, struct pmx_dev **pmx_devs,
198 u8 pmx_dev_count);
200 #endif /* CONFIG_MACH_SPEAR320 */
202 #endif /* __MACH_GENERIC_H */