diff options
author | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-22 10:38:37 -0500 |
---|---|---|
committer | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-22 10:38:37 -0500 |
commit | fcc9d2e5a6c89d22b8b773a64fb4ad21ac318446 (patch) | |
tree | a57612d1888735a2ec7972891b68c1ac5ec8faea /arch/arm/plat-spear/include | |
parent | 8dea78da5cee153b8af9c07a2745f6c55057fe12 (diff) |
Diffstat (limited to 'arch/arm/plat-spear/include')
-rw-r--r-- | arch/arm/plat-spear/include/plat/clock.h | 249 | ||||
-rw-r--r-- | arch/arm/plat-spear/include/plat/gpio.h | 24 | ||||
-rw-r--r-- | arch/arm/plat-spear/include/plat/hardware.h | 23 | ||||
-rw-r--r-- | arch/arm/plat-spear/include/plat/io.h | 22 | ||||
-rw-r--r-- | arch/arm/plat-spear/include/plat/keyboard.h | 141 | ||||
-rw-r--r-- | arch/arm/plat-spear/include/plat/memory.h | 20 | ||||
-rw-r--r-- | arch/arm/plat-spear/include/plat/padmux.h | 92 | ||||
-rw-r--r-- | arch/arm/plat-spear/include/plat/shirq.h | 73 | ||||
-rw-r--r-- | arch/arm/plat-spear/include/plat/system.h | 41 | ||||
-rw-r--r-- | arch/arm/plat-spear/include/plat/vmalloc.h | 19 |
10 files changed, 704 insertions, 0 deletions
diff --git a/arch/arm/plat-spear/include/plat/clock.h b/arch/arm/plat-spear/include/plat/clock.h new file mode 100644 index 00000000000..0062bafef12 --- /dev/null +++ b/arch/arm/plat-spear/include/plat/clock.h | |||
@@ -0,0 +1,249 @@ | |||
1 | /* | ||
2 | * arch/arm/plat-spear/include/plat/clock.h | ||
3 | * | ||
4 | * Clock framework definitions for SPEAr platform | ||
5 | * | ||
6 | * Copyright (C) 2009 ST Microelectronics | ||
7 | * Viresh Kumar<viresh.kumar@st.com> | ||
8 | * | ||
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. | ||
12 | */ | ||
13 | |||
14 | #ifndef __PLAT_CLOCK_H | ||
15 | #define __PLAT_CLOCK_H | ||
16 | |||
17 | #include <linux/list.h> | ||
18 | #include <linux/clkdev.h> | ||
19 | #include <linux/types.h> | ||
20 | |||
21 | /* clk structure flags */ | ||
22 | #define ALWAYS_ENABLED (1 << 0) /* clock always enabled */ | ||
23 | #define RESET_TO_ENABLE (1 << 1) /* reset register bit to enable clk */ | ||
24 | #define ENABLED_ON_INIT (1 << 2) /* clocks enabled at init */ | ||
25 | |||
26 | /** | ||
27 | * struct clkops - clock operations | ||
28 | * @enable: pointer to clock enable function | ||
29 | * @disable: pointer to clock disable function | ||
30 | */ | ||
31 | struct clkops { | ||
32 | int (*enable) (struct clk *); | ||
33 | void (*disable) (struct clk *); | ||
34 | }; | ||
35 | |||
36 | /** | ||
37 | * struct pclk_info - parents info | ||
38 | * @pclk: pointer to parent clk | ||
39 | * @pclk_val: value to be written for selecting this parent | ||
40 | */ | ||
41 | struct pclk_info { | ||
42 | struct clk *pclk; | ||
43 | u8 pclk_val; | ||
44 | }; | ||
45 | |||
46 | /** | ||
47 | * struct pclk_sel - parents selection configuration | ||
48 | * @pclk_info: pointer to array of parent clock info | ||
49 | * @pclk_count: number of parents | ||
50 | * @pclk_sel_reg: register for selecting a parent | ||
51 | * @pclk_sel_mask: mask for selecting parent (can be used to clear bits also) | ||
52 | */ | ||
53 | struct pclk_sel { | ||
54 | struct pclk_info *pclk_info; | ||
55 | u8 pclk_count; | ||
56 | void __iomem *pclk_sel_reg; | ||
57 | unsigned int pclk_sel_mask; | ||
58 | }; | ||
59 | |||
60 | /** | ||
61 | * struct rate_config - clk rate configurations | ||
62 | * @tbls: array of device specific clk rate tables, in ascending order of rates | ||
63 | * @count: size of tbls array | ||
64 | * @default_index: default setting when originally disabled | ||
65 | */ | ||
66 | struct rate_config { | ||
67 | void *tbls; | ||
68 | u8 count; | ||
69 | u8 default_index; | ||
70 | }; | ||
71 | |||
72 | /** | ||
73 | * struct clk - clock structure | ||
74 | * @usage_count: num of users who enabled this clock | ||
75 | * @flags: flags for clock properties | ||
76 | * @rate: programmed clock rate in Hz | ||
77 | * @en_reg: clk enable/disable reg | ||
78 | * @en_reg_bit: clk enable/disable bit | ||
79 | * @ops: clk enable/disable ops - generic_clkops selected if NULL | ||
80 | * @recalc: pointer to clock rate recalculate function | ||
81 | * @set_rate: pointer to clock set rate function | ||
82 | * @calc_rate: pointer to clock get rate function for index | ||
83 | * @rate_config: rate configuration information, used by set_rate | ||
84 | * @div_factor: division factor to parent clock. | ||
85 | * @pclk: current parent clk | ||
86 | * @pclk_sel: pointer to parent selection structure | ||
87 | * @pclk_sel_shift: register shift for selecting parent of this clock | ||
88 | * @children: list for childrens or this clock | ||
89 | * @sibling: node for list of clocks having same parents | ||
90 | * @private_data: clock specific private data | ||
91 | * @node: list to maintain clocks linearly | ||
92 | * @cl: clocklook up associated with this clock | ||
93 | * @dent: object for debugfs | ||
94 | */ | ||
95 | struct clk { | ||
96 | unsigned int usage_count; | ||
97 | unsigned int flags; | ||
98 | unsigned long rate; | ||
99 | void __iomem *en_reg; | ||
100 | u8 en_reg_bit; | ||
101 | const struct clkops *ops; | ||
102 | int (*recalc) (struct clk *); | ||
103 | int (*set_rate) (struct clk *, unsigned long rate); | ||
104 | unsigned long (*calc_rate)(struct clk *, int index); | ||
105 | struct rate_config rate_config; | ||
106 | unsigned int div_factor; | ||
107 | |||
108 | struct clk *pclk; | ||
109 | struct pclk_sel *pclk_sel; | ||
110 | unsigned int pclk_sel_shift; | ||
111 | |||
112 | struct list_head children; | ||
113 | struct list_head sibling; | ||
114 | void *private_data; | ||
115 | #ifdef CONFIG_DEBUG_FS | ||
116 | struct list_head node; | ||
117 | struct clk_lookup *cl; | ||
118 | struct dentry *dent; | ||
119 | #endif | ||
120 | }; | ||
121 | |||
122 | /* pll configuration structure */ | ||
123 | struct pll_clk_masks { | ||
124 | u32 mode_mask; | ||
125 | u32 mode_shift; | ||
126 | |||
127 | u32 norm_fdbk_m_mask; | ||
128 | u32 norm_fdbk_m_shift; | ||
129 | u32 dith_fdbk_m_mask; | ||
130 | u32 dith_fdbk_m_shift; | ||
131 | u32 div_p_mask; | ||
132 | u32 div_p_shift; | ||
133 | u32 div_n_mask; | ||
134 | u32 div_n_shift; | ||
135 | }; | ||
136 | |||
137 | struct pll_clk_config { | ||
138 | void __iomem *mode_reg; | ||
139 | void __iomem *cfg_reg; | ||
140 | struct pll_clk_masks *masks; | ||
141 | }; | ||
142 | |||
143 | /* pll clk rate config structure */ | ||
144 | struct pll_rate_tbl { | ||
145 | u8 mode; | ||
146 | u16 m; | ||
147 | u8 n; | ||
148 | u8 p; | ||
149 | }; | ||
150 | |||
151 | /* ahb and apb bus configuration structure */ | ||
152 | struct bus_clk_masks { | ||
153 | u32 mask; | ||
154 | u32 shift; | ||
155 | }; | ||
156 | |||
157 | struct bus_clk_config { | ||
158 | void __iomem *reg; | ||
159 | struct bus_clk_masks *masks; | ||
160 | }; | ||
161 | |||
162 | /* ahb and apb clk bus rate config structure */ | ||
163 | struct bus_rate_tbl { | ||
164 | u8 div; | ||
165 | }; | ||
166 | |||
167 | /* Aux clk configuration structure: applicable to UART and FIRDA */ | ||
168 | struct aux_clk_masks { | ||
169 | u32 eq_sel_mask; | ||
170 | u32 eq_sel_shift; | ||
171 | u32 eq1_mask; | ||
172 | u32 eq2_mask; | ||
173 | u32 xscale_sel_mask; | ||
174 | u32 xscale_sel_shift; | ||
175 | u32 yscale_sel_mask; | ||
176 | u32 yscale_sel_shift; | ||
177 | }; | ||
178 | |||
179 | struct aux_clk_config { | ||
180 | void __iomem *synth_reg; | ||
181 | struct aux_clk_masks *masks; | ||
182 | }; | ||
183 | |||
184 | /* aux clk rate config structure */ | ||
185 | struct aux_rate_tbl { | ||
186 | u16 xscale; | ||
187 | u16 yscale; | ||
188 | u8 eq; | ||
189 | }; | ||
190 | |||
191 | /* GPT clk configuration structure */ | ||
192 | struct gpt_clk_masks { | ||
193 | u32 mscale_sel_mask; | ||
194 | u32 mscale_sel_shift; | ||
195 | u32 nscale_sel_mask; | ||
196 | u32 nscale_sel_shift; | ||
197 | }; | ||
198 | |||
199 | struct gpt_clk_config { | ||
200 | void __iomem *synth_reg; | ||
201 | struct gpt_clk_masks *masks; | ||
202 | }; | ||
203 | |||
204 | /* gpt clk rate config structure */ | ||
205 | struct gpt_rate_tbl { | ||
206 | u16 mscale; | ||
207 | u16 nscale; | ||
208 | }; | ||
209 | |||
210 | /* clcd clk configuration structure */ | ||
211 | struct clcd_synth_masks { | ||
212 | u32 div_factor_mask; | ||
213 | u32 div_factor_shift; | ||
214 | }; | ||
215 | |||
216 | struct clcd_clk_config { | ||
217 | void __iomem *synth_reg; | ||
218 | struct clcd_synth_masks *masks; | ||
219 | }; | ||
220 | |||
221 | /* clcd clk rate config structure */ | ||
222 | struct clcd_rate_tbl { | ||
223 | u16 div; | ||
224 | }; | ||
225 | |||
226 | /* platform specific clock functions */ | ||
227 | void __init clk_init(void); | ||
228 | void clk_register(struct clk_lookup *cl); | ||
229 | void recalc_root_clocks(void); | ||
230 | |||
231 | /* clock recalc & set rate functions */ | ||
232 | int follow_parent(struct clk *clk); | ||
233 | unsigned long pll_calc_rate(struct clk *clk, int index); | ||
234 | int pll_clk_recalc(struct clk *clk); | ||
235 | int pll_clk_set_rate(struct clk *clk, unsigned long desired_rate); | ||
236 | unsigned long bus_calc_rate(struct clk *clk, int index); | ||
237 | int bus_clk_recalc(struct clk *clk); | ||
238 | int bus_clk_set_rate(struct clk *clk, unsigned long desired_rate); | ||
239 | unsigned long gpt_calc_rate(struct clk *clk, int index); | ||
240 | int gpt_clk_recalc(struct clk *clk); | ||
241 | int gpt_clk_set_rate(struct clk *clk, unsigned long desired_rate); | ||
242 | unsigned long aux_calc_rate(struct clk *clk, int index); | ||
243 | int aux_clk_recalc(struct clk *clk); | ||
244 | int aux_clk_set_rate(struct clk *clk, unsigned long desired_rate); | ||
245 | unsigned long clcd_calc_rate(struct clk *clk, int index); | ||
246 | int clcd_clk_recalc(struct clk *clk); | ||
247 | int clcd_clk_set_rate(struct clk *clk, unsigned long desired_rate); | ||
248 | |||
249 | #endif /* __PLAT_CLOCK_H */ | ||
diff --git a/arch/arm/plat-spear/include/plat/gpio.h b/arch/arm/plat-spear/include/plat/gpio.h new file mode 100644 index 00000000000..b857c91257d --- /dev/null +++ b/arch/arm/plat-spear/include/plat/gpio.h | |||
@@ -0,0 +1,24 @@ | |||
1 | /* | ||
2 | * arch/arm/plat-spear/include/plat/gpio.h | ||
3 | * | ||
4 | * GPIO macros for SPEAr platform | ||
5 | * | ||
6 | * Copyright (C) 2009 ST Microelectronics | ||
7 | * Viresh Kumar<viresh.kumar@st.com> | ||
8 | * | ||
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. | ||
12 | */ | ||
13 | |||
14 | #ifndef __PLAT_GPIO_H | ||
15 | #define __PLAT_GPIO_H | ||
16 | |||
17 | #include <asm-generic/gpio.h> | ||
18 | |||
19 | #define gpio_get_value __gpio_get_value | ||
20 | #define gpio_set_value __gpio_set_value | ||
21 | #define gpio_cansleep __gpio_cansleep | ||
22 | #define gpio_to_irq __gpio_to_irq | ||
23 | |||
24 | #endif /* __PLAT_GPIO_H */ | ||
diff --git a/arch/arm/plat-spear/include/plat/hardware.h b/arch/arm/plat-spear/include/plat/hardware.h new file mode 100644 index 00000000000..66d677225d1 --- /dev/null +++ b/arch/arm/plat-spear/include/plat/hardware.h | |||
@@ -0,0 +1,23 @@ | |||
1 | /* | ||
2 | * arch/arm/plat-spear/include/plat/hardware.h | ||
3 | * | ||
4 | * Hardware definitions for SPEAr | ||
5 | * | ||
6 | * Copyright (C) 2010 ST Microelectronics | ||
7 | * Viresh Kumar<viresh.kumar@st.com> | ||
8 | * | ||
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. | ||
12 | */ | ||
13 | |||
14 | #ifndef __PLAT_HARDWARE_H | ||
15 | #define __PLAT_HARDWARE_H | ||
16 | |||
17 | #ifndef __ASSEMBLY__ | ||
18 | #define IOMEM(x) ((void __iomem __force *)(x)) | ||
19 | #else | ||
20 | #define IOMEM(x) (x) | ||
21 | #endif | ||
22 | |||
23 | #endif /* __PLAT_HARDWARE_H */ | ||
diff --git a/arch/arm/plat-spear/include/plat/io.h b/arch/arm/plat-spear/include/plat/io.h new file mode 100644 index 00000000000..4d4ba822b3e --- /dev/null +++ b/arch/arm/plat-spear/include/plat/io.h | |||
@@ -0,0 +1,22 @@ | |||
1 | /* | ||
2 | * arch/arm/plat-spear/include/plat/io.h | ||
3 | * | ||
4 | * IO definitions for SPEAr platform | ||
5 | * | ||
6 | * Copyright (C) 2009 ST Microelectronics | ||
7 | * Viresh Kumar<viresh.kumar@st.com> | ||
8 | * | ||
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. | ||
12 | */ | ||
13 | |||
14 | #ifndef __PLAT_IO_H | ||
15 | #define __PLAT_IO_H | ||
16 | |||
17 | #define IO_SPACE_LIMIT 0xFFFFFFFF | ||
18 | |||
19 | #define __io(a) __typesafe_io(a) | ||
20 | #define __mem_pci(a) (a) | ||
21 | |||
22 | #endif /* __PLAT_IO_H */ | ||
diff --git a/arch/arm/plat-spear/include/plat/keyboard.h b/arch/arm/plat-spear/include/plat/keyboard.h new file mode 100644 index 00000000000..68b5394fc58 --- /dev/null +++ b/arch/arm/plat-spear/include/plat/keyboard.h | |||
@@ -0,0 +1,141 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010 ST Microelectronics | ||
3 | * Rajeev Kumar<rajeev-dlh.kumar@st.com> | ||
4 | * | ||
5 | * This file is licensed under the terms of the GNU General Public | ||
6 | * License version 2. This program is licensed "as is" without any | ||
7 | * warranty of any kind, whether express or implied. | ||
8 | */ | ||
9 | |||
10 | #ifndef __PLAT_KEYBOARD_H | ||
11 | #define __PLAT_KEYBOARD_H | ||
12 | |||
13 | #include <linux/bitops.h> | ||
14 | #include <linux/input.h> | ||
15 | #include <linux/input/matrix_keypad.h> | ||
16 | #include <linux/types.h> | ||
17 | |||
18 | #define DECLARE_KEYMAP(_name) \ | ||
19 | int _name[] = { \ | ||
20 | KEY(0, 0, KEY_ESC), \ | ||
21 | KEY(0, 1, KEY_1), \ | ||
22 | KEY(0, 2, KEY_2), \ | ||
23 | KEY(0, 3, KEY_3), \ | ||
24 | KEY(0, 4, KEY_4), \ | ||
25 | KEY(0, 5, KEY_5), \ | ||
26 | KEY(0, 6, KEY_6), \ | ||
27 | KEY(0, 7, KEY_7), \ | ||
28 | KEY(0, 8, KEY_8), \ | ||
29 | KEY(1, 0, KEY_9), \ | ||
30 | KEY(1, 1, KEY_MINUS), \ | ||
31 | KEY(1, 2, KEY_EQUAL), \ | ||
32 | KEY(1, 3, KEY_BACKSPACE), \ | ||
33 | KEY(1, 4, KEY_TAB), \ | ||
34 | KEY(1, 5, KEY_Q), \ | ||
35 | KEY(1, 6, KEY_W), \ | ||
36 | KEY(1, 7, KEY_E), \ | ||
37 | KEY(1, 8, KEY_R), \ | ||
38 | KEY(2, 0, KEY_T), \ | ||
39 | KEY(2, 1, KEY_Y), \ | ||
40 | KEY(2, 2, KEY_U), \ | ||
41 | KEY(2, 3, KEY_I), \ | ||
42 | KEY(2, 4, KEY_O), \ | ||
43 | KEY(2, 5, KEY_P), \ | ||
44 | KEY(2, 6, KEY_LEFTBRACE), \ | ||
45 | KEY(2, 7, KEY_RIGHTBRACE), \ | ||
46 | KEY(2, 8, KEY_ENTER), \ | ||
47 | KEY(3, 0, KEY_LEFTCTRL), \ | ||
48 | KEY(3, 1, KEY_A), \ | ||
49 | KEY(3, 2, KEY_S), \ | ||
50 | KEY(3, 3, KEY_D), \ | ||
51 | KEY(3, 4, KEY_F), \ | ||
52 | KEY(3, 5, KEY_G), \ | ||
53 | KEY(3, 6, KEY_H), \ | ||
54 | KEY(3, 7, KEY_J), \ | ||
55 | KEY(3, 8, KEY_K), \ | ||
56 | KEY(4, 0, KEY_L), \ | ||
57 | KEY(4, 1, KEY_SEMICOLON), \ | ||
58 | KEY(4, 2, KEY_APOSTROPHE), \ | ||
59 | KEY(4, 3, KEY_GRAVE), \ | ||
60 | KEY(4, 4, KEY_LEFTSHIFT), \ | ||
61 | KEY(4, 5, KEY_BACKSLASH), \ | ||
62 | KEY(4, 6, KEY_Z), \ | ||
63 | KEY(4, 7, KEY_X), \ | ||
64 | KEY(4, 8, KEY_C), \ | ||
65 | KEY(4, 0, KEY_L), \ | ||
66 | KEY(4, 1, KEY_SEMICOLON), \ | ||
67 | KEY(4, 2, KEY_APOSTROPHE), \ | ||
68 | KEY(4, 3, KEY_GRAVE), \ | ||
69 | KEY(4, 4, KEY_LEFTSHIFT), \ | ||
70 | KEY(4, 5, KEY_BACKSLASH), \ | ||
71 | KEY(4, 6, KEY_Z), \ | ||
72 | KEY(4, 7, KEY_X), \ | ||
73 | KEY(4, 8, KEY_C), \ | ||
74 | KEY(4, 0, KEY_L), \ | ||
75 | KEY(4, 1, KEY_SEMICOLON), \ | ||
76 | KEY(4, 2, KEY_APOSTROPHE), \ | ||
77 | KEY(4, 3, KEY_GRAVE), \ | ||
78 | KEY(4, 4, KEY_LEFTSHIFT), \ | ||
79 | KEY(4, 5, KEY_BACKSLASH), \ | ||
80 | KEY(4, 6, KEY_Z), \ | ||
81 | KEY(4, 7, KEY_X), \ | ||
82 | KEY(4, 8, KEY_C), \ | ||
83 | KEY(5, 0, KEY_V), \ | ||
84 | KEY(5, 1, KEY_B), \ | ||
85 | KEY(5, 2, KEY_N), \ | ||
86 | KEY(5, 3, KEY_M), \ | ||
87 | KEY(5, 4, KEY_COMMA), \ | ||
88 | KEY(5, 5, KEY_DOT), \ | ||
89 | KEY(5, 6, KEY_SLASH), \ | ||
90 | KEY(5, 7, KEY_RIGHTSHIFT), \ | ||
91 | KEY(5, 8, KEY_KPASTERISK), \ | ||
92 | KEY(6, 0, KEY_LEFTALT), \ | ||
93 | KEY(6, 1, KEY_SPACE), \ | ||
94 | KEY(6, 2, KEY_CAPSLOCK), \ | ||
95 | KEY(6, 3, KEY_F1), \ | ||
96 | KEY(6, 4, KEY_F2), \ | ||
97 | KEY(6, 5, KEY_F3), \ | ||
98 | KEY(6, 6, KEY_F4), \ | ||
99 | KEY(6, 7, KEY_F5), \ | ||
100 | KEY(6, 8, KEY_F6), \ | ||
101 | KEY(7, 0, KEY_F7), \ | ||
102 | KEY(7, 1, KEY_F8), \ | ||
103 | KEY(7, 2, KEY_F9), \ | ||
104 | KEY(7, 3, KEY_F10), \ | ||
105 | KEY(7, 4, KEY_NUMLOCK), \ | ||
106 | KEY(7, 5, KEY_SCROLLLOCK), \ | ||
107 | KEY(7, 6, KEY_KP7), \ | ||
108 | KEY(7, 7, KEY_KP8), \ | ||
109 | KEY(7, 8, KEY_KP9), \ | ||
110 | KEY(8, 0, KEY_KPMINUS), \ | ||
111 | KEY(8, 1, KEY_KP4), \ | ||
112 | KEY(8, 2, KEY_KP5), \ | ||
113 | KEY(8, 3, KEY_KP6), \ | ||
114 | KEY(8, 4, KEY_KPPLUS), \ | ||
115 | KEY(8, 5, KEY_KP1), \ | ||
116 | KEY(8, 6, KEY_KP2), \ | ||
117 | KEY(8, 7, KEY_KP3), \ | ||
118 | KEY(8, 8, KEY_KP0), \ | ||
119 | } | ||
120 | |||
121 | /** | ||
122 | * struct kbd_platform_data - spear keyboard platform data | ||
123 | * keymap: pointer to keymap data (table and size) | ||
124 | * rep: enables key autorepeat | ||
125 | * | ||
126 | * This structure is supposed to be used by platform code to supply | ||
127 | * keymaps to drivers that implement keyboards. | ||
128 | */ | ||
129 | struct kbd_platform_data { | ||
130 | const struct matrix_keymap_data *keymap; | ||
131 | bool rep; | ||
132 | }; | ||
133 | |||
134 | /* This function is used to set platform data field of pdev->dev */ | ||
135 | static inline void | ||
136 | kbd_set_plat_data(struct platform_device *pdev, struct kbd_platform_data *data) | ||
137 | { | ||
138 | pdev->dev.platform_data = data; | ||
139 | } | ||
140 | |||
141 | #endif /* __PLAT_KEYBOARD_H */ | ||
diff --git a/arch/arm/plat-spear/include/plat/memory.h b/arch/arm/plat-spear/include/plat/memory.h new file mode 100644 index 00000000000..7e3599e1104 --- /dev/null +++ b/arch/arm/plat-spear/include/plat/memory.h | |||
@@ -0,0 +1,20 @@ | |||
1 | /* | ||
2 | * arch/arm/plat-spear/include/plat/memory.h | ||
3 | * | ||
4 | * Memory map for SPEAr platform | ||
5 | * | ||
6 | * Copyright (C) 2009 ST Microelectronics | ||
7 | * Viresh Kumar<viresh.kumar@st.com> | ||
8 | * | ||
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. | ||
12 | */ | ||
13 | |||
14 | #ifndef __PLAT_MEMORY_H | ||
15 | #define __PLAT_MEMORY_H | ||
16 | |||
17 | /* Physical DRAM offset */ | ||
18 | #define PLAT_PHYS_OFFSET UL(0x00000000) | ||
19 | |||
20 | #endif /* __PLAT_MEMORY_H */ | ||
diff --git a/arch/arm/plat-spear/include/plat/padmux.h b/arch/arm/plat-spear/include/plat/padmux.h new file mode 100644 index 00000000000..877f3adcf61 --- /dev/null +++ b/arch/arm/plat-spear/include/plat/padmux.h | |||
@@ -0,0 +1,92 @@ | |||
1 | /* | ||
2 | * arch/arm/plat-spear/include/plat/padmux.h | ||
3 | * | ||
4 | * SPEAr platform specific gpio pads muxing file | ||
5 | * | ||
6 | * Copyright (C) 2009 ST Microelectronics | ||
7 | * Viresh Kumar<viresh.kumar@st.com> | ||
8 | * | ||
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. | ||
12 | */ | ||
13 | |||
14 | #ifndef __PLAT_PADMUX_H | ||
15 | #define __PLAT_PADMUX_H | ||
16 | |||
17 | #include <linux/types.h> | ||
18 | |||
19 | /* | ||
20 | * struct pmx_reg: configuration structure for mode reg and mux reg | ||
21 | * | ||
22 | * offset: offset of mode reg | ||
23 | * mask: mask of mode reg | ||
24 | */ | ||
25 | struct pmx_reg { | ||
26 | u32 offset; | ||
27 | u32 mask; | ||
28 | }; | ||
29 | |||
30 | /* | ||
31 | * struct pmx_dev_mode: configuration structure every group of modes of a device | ||
32 | * | ||
33 | * ids: all modes for this configuration | ||
34 | * mask: mask for supported mode | ||
35 | */ | ||
36 | struct pmx_dev_mode { | ||
37 | u32 ids; | ||
38 | u32 mask; | ||
39 | }; | ||
40 | |||
41 | /* | ||
42 | * struct pmx_mode: mode definition structure | ||
43 | * | ||
44 | * name: mode name | ||
45 | * mask: mode mask | ||
46 | */ | ||
47 | struct pmx_mode { | ||
48 | char *name; | ||
49 | u32 id; | ||
50 | u32 mask; | ||
51 | }; | ||
52 | |||
53 | /* | ||
54 | * struct pmx_dev: device definition structure | ||
55 | * | ||
56 | * name: device name | ||
57 | * modes: device configuration array for different modes supported | ||
58 | * mode_count: size of modes array | ||
59 | * is_active: is peripheral active/enabled | ||
60 | * enb_on_reset: if 1, mask bits to be cleared in reg otherwise to be set in reg | ||
61 | */ | ||
62 | struct pmx_dev { | ||
63 | char *name; | ||
64 | struct pmx_dev_mode *modes; | ||
65 | u8 mode_count; | ||
66 | bool is_active; | ||
67 | bool enb_on_reset; | ||
68 | }; | ||
69 | |||
70 | /* | ||
71 | * struct pmx_driver: driver definition structure | ||
72 | * | ||
73 | * mode: mode to be set | ||
74 | * devs: array of pointer to pmx devices | ||
75 | * devs_count: ARRAY_SIZE of devs | ||
76 | * base: base address of soc config registers | ||
77 | * mode_reg: structure of mode config register | ||
78 | * mux_reg: structure of device mux config register | ||
79 | */ | ||
80 | struct pmx_driver { | ||
81 | struct pmx_mode *mode; | ||
82 | struct pmx_dev **devs; | ||
83 | u8 devs_count; | ||
84 | u32 *base; | ||
85 | struct pmx_reg mode_reg; | ||
86 | struct pmx_reg mux_reg; | ||
87 | }; | ||
88 | |||
89 | /* pmx functions */ | ||
90 | int pmx_register(struct pmx_driver *driver); | ||
91 | |||
92 | #endif /* __PLAT_PADMUX_H */ | ||
diff --git a/arch/arm/plat-spear/include/plat/shirq.h b/arch/arm/plat-spear/include/plat/shirq.h new file mode 100644 index 00000000000..03ed8b585dc --- /dev/null +++ b/arch/arm/plat-spear/include/plat/shirq.h | |||
@@ -0,0 +1,73 @@ | |||
1 | /* | ||
2 | * arch/arm/plat-spear/include/plat/shirq.h | ||
3 | * | ||
4 | * SPEAr platform shared irq layer header file | ||
5 | * | ||
6 | * Copyright (C) 2009 ST Microelectronics | ||
7 | * Viresh Kumar<viresh.kumar@st.com> | ||
8 | * | ||
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. | ||
12 | */ | ||
13 | |||
14 | #ifndef __PLAT_SHIRQ_H | ||
15 | #define __PLAT_SHIRQ_H | ||
16 | |||
17 | #include <linux/irq.h> | ||
18 | #include <linux/types.h> | ||
19 | |||
20 | /* | ||
21 | * struct shirq_dev_config: shared irq device configuration | ||
22 | * | ||
23 | * virq: virtual irq number of device | ||
24 | * enb_mask: enable mask of device | ||
25 | * status_mask: status mask of device | ||
26 | * clear_mask: clear mask of device | ||
27 | */ | ||
28 | struct shirq_dev_config { | ||
29 | u32 virq; | ||
30 | u32 enb_mask; | ||
31 | u32 status_mask; | ||
32 | u32 clear_mask; | ||
33 | }; | ||
34 | |||
35 | /* | ||
36 | * struct shirq_regs: shared irq register configuration | ||
37 | * | ||
38 | * base: base address of shared irq register | ||
39 | * enb_reg: enable register offset | ||
40 | * reset_to_enb: val 1 indicates, we need to clear bit for enabling interrupt | ||
41 | * status_reg: status register offset | ||
42 | * status_reg_mask: status register valid mask | ||
43 | * clear_reg: clear register offset | ||
44 | * reset_to_clear: val 1 indicates, we need to clear bit for clearing interrupt | ||
45 | */ | ||
46 | struct shirq_regs { | ||
47 | void __iomem *base; | ||
48 | u32 enb_reg; | ||
49 | u32 reset_to_enb; | ||
50 | u32 status_reg; | ||
51 | u32 status_reg_mask; | ||
52 | u32 clear_reg; | ||
53 | u32 reset_to_clear; | ||
54 | }; | ||
55 | |||
56 | /* | ||
57 | * struct spear_shirq: shared irq structure | ||
58 | * | ||
59 | * irq: hardware irq number | ||
60 | * dev_config: array of device config structures which are using "irq" line | ||
61 | * dev_count: size of dev_config array | ||
62 | * regs: register configuration for shared irq block | ||
63 | */ | ||
64 | struct spear_shirq { | ||
65 | u32 irq; | ||
66 | struct shirq_dev_config *dev_config; | ||
67 | u32 dev_count; | ||
68 | struct shirq_regs regs; | ||
69 | }; | ||
70 | |||
71 | int spear_shirq_register(struct spear_shirq *shirq); | ||
72 | |||
73 | #endif /* __PLAT_SHIRQ_H */ | ||
diff --git a/arch/arm/plat-spear/include/plat/system.h b/arch/arm/plat-spear/include/plat/system.h new file mode 100644 index 00000000000..a235fa0ca77 --- /dev/null +++ b/arch/arm/plat-spear/include/plat/system.h | |||
@@ -0,0 +1,41 @@ | |||
1 | /* | ||
2 | * arch/arm/plat-spear/include/plat/system.h | ||
3 | * | ||
4 | * SPEAr platform specific architecture functions | ||
5 | * | ||
6 | * Copyright (C) 2009 ST Microelectronics | ||
7 | * Viresh Kumar<viresh.kumar@st.com> | ||
8 | * | ||
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. | ||
12 | */ | ||
13 | |||
14 | #ifndef __PLAT_SYSTEM_H | ||
15 | #define __PLAT_SYSTEM_H | ||
16 | |||
17 | #include <linux/io.h> | ||
18 | #include <asm/hardware/sp810.h> | ||
19 | #include <mach/hardware.h> | ||
20 | |||
21 | static inline void arch_idle(void) | ||
22 | { | ||
23 | /* | ||
24 | * This should do all the clock switching | ||
25 | * and wait for interrupt tricks | ||
26 | */ | ||
27 | cpu_do_idle(); | ||
28 | } | ||
29 | |||
30 | static inline void arch_reset(char mode, const char *cmd) | ||
31 | { | ||
32 | if (mode == 's') { | ||
33 | /* software reset, Jump into ROM at address 0 */ | ||
34 | cpu_reset(0); | ||
35 | } else { | ||
36 | /* hardware reset, Use on-chip reset capability */ | ||
37 | sysctl_soft_reset((void __iomem *)VA_SPEAR_SYS_CTRL_BASE); | ||
38 | } | ||
39 | } | ||
40 | |||
41 | #endif /* __PLAT_SYSTEM_H */ | ||
diff --git a/arch/arm/plat-spear/include/plat/vmalloc.h b/arch/arm/plat-spear/include/plat/vmalloc.h new file mode 100644 index 00000000000..8c8b24d0704 --- /dev/null +++ b/arch/arm/plat-spear/include/plat/vmalloc.h | |||
@@ -0,0 +1,19 @@ | |||
1 | /* | ||
2 | * arch/arm/plat-spear/include/plat/vmalloc.h | ||
3 | * | ||
4 | * Defining Vmalloc area for SPEAr platform | ||
5 | * | ||
6 | * Copyright (C) 2009 ST Microelectronics | ||
7 | * Viresh Kumar<viresh.kumar@st.com> | ||
8 | * | ||
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. | ||
12 | */ | ||
13 | |||
14 | #ifndef __PLAT_VMALLOC_H | ||
15 | #define __PLAT_VMALLOC_H | ||
16 | |||
17 | #define VMALLOC_END 0xF0000000UL | ||
18 | |||
19 | #endif /* __PLAT_VMALLOC_H */ | ||