1*4882a593Smuzhiyun /*
2*4882a593Smuzhiyun * Prototypes, etc. for the Freescale MPC52xx embedded cpu chips
3*4882a593Smuzhiyun * May need to be cleaned as the port goes on ...
4*4882a593Smuzhiyun *
5*4882a593Smuzhiyun * Copyright (C) 2004-2005 Sylvain Munaut <tnt@246tNt.com>
6*4882a593Smuzhiyun * Copyright (C) 2003 MontaVista, Software, Inc.
7*4882a593Smuzhiyun *
8*4882a593Smuzhiyun * This file is licensed under the terms of the GNU General Public License
9*4882a593Smuzhiyun * version 2. This program is licensed "as is" without any warranty of any
10*4882a593Smuzhiyun * kind, whether express or implied.
11*4882a593Smuzhiyun */
12*4882a593Smuzhiyun
13*4882a593Smuzhiyun #ifndef __ASM_POWERPC_MPC52xx_H__
14*4882a593Smuzhiyun #define __ASM_POWERPC_MPC52xx_H__
15*4882a593Smuzhiyun
16*4882a593Smuzhiyun #ifndef __ASSEMBLY__
17*4882a593Smuzhiyun #include <asm/types.h>
18*4882a593Smuzhiyun #include <asm/prom.h>
19*4882a593Smuzhiyun #include <asm/mpc5xxx.h>
20*4882a593Smuzhiyun #endif /* __ASSEMBLY__ */
21*4882a593Smuzhiyun
22*4882a593Smuzhiyun #include <linux/suspend.h>
23*4882a593Smuzhiyun
24*4882a593Smuzhiyun /* Variants of the 5200(B) */
25*4882a593Smuzhiyun #define MPC5200_SVR 0x80110010
26*4882a593Smuzhiyun #define MPC5200_SVR_MASK 0xfffffff0
27*4882a593Smuzhiyun #define MPC5200B_SVR 0x80110020
28*4882a593Smuzhiyun #define MPC5200B_SVR_MASK 0xfffffff0
29*4882a593Smuzhiyun
30*4882a593Smuzhiyun /* ======================================================================== */
31*4882a593Smuzhiyun /* Structures mapping of some unit register set */
32*4882a593Smuzhiyun /* ======================================================================== */
33*4882a593Smuzhiyun
34*4882a593Smuzhiyun #ifndef __ASSEMBLY__
35*4882a593Smuzhiyun
36*4882a593Smuzhiyun /* Memory Mapping Control */
37*4882a593Smuzhiyun struct mpc52xx_mmap_ctl {
38*4882a593Smuzhiyun u32 mbar; /* MMAP_CTRL + 0x00 */
39*4882a593Smuzhiyun
40*4882a593Smuzhiyun u32 cs0_start; /* MMAP_CTRL + 0x04 */
41*4882a593Smuzhiyun u32 cs0_stop; /* MMAP_CTRL + 0x08 */
42*4882a593Smuzhiyun u32 cs1_start; /* MMAP_CTRL + 0x0c */
43*4882a593Smuzhiyun u32 cs1_stop; /* MMAP_CTRL + 0x10 */
44*4882a593Smuzhiyun u32 cs2_start; /* MMAP_CTRL + 0x14 */
45*4882a593Smuzhiyun u32 cs2_stop; /* MMAP_CTRL + 0x18 */
46*4882a593Smuzhiyun u32 cs3_start; /* MMAP_CTRL + 0x1c */
47*4882a593Smuzhiyun u32 cs3_stop; /* MMAP_CTRL + 0x20 */
48*4882a593Smuzhiyun u32 cs4_start; /* MMAP_CTRL + 0x24 */
49*4882a593Smuzhiyun u32 cs4_stop; /* MMAP_CTRL + 0x28 */
50*4882a593Smuzhiyun u32 cs5_start; /* MMAP_CTRL + 0x2c */
51*4882a593Smuzhiyun u32 cs5_stop; /* MMAP_CTRL + 0x30 */
52*4882a593Smuzhiyun
53*4882a593Smuzhiyun u32 sdram0; /* MMAP_CTRL + 0x34 */
54*4882a593Smuzhiyun u32 sdram1; /* MMAP_CTRL + 0X38 */
55*4882a593Smuzhiyun
56*4882a593Smuzhiyun u32 reserved[4]; /* MMAP_CTRL + 0x3c .. 0x48 */
57*4882a593Smuzhiyun
58*4882a593Smuzhiyun u32 boot_start; /* MMAP_CTRL + 0x4c */
59*4882a593Smuzhiyun u32 boot_stop; /* MMAP_CTRL + 0x50 */
60*4882a593Smuzhiyun
61*4882a593Smuzhiyun u32 ipbi_ws_ctrl; /* MMAP_CTRL + 0x54 */
62*4882a593Smuzhiyun
63*4882a593Smuzhiyun u32 cs6_start; /* MMAP_CTRL + 0x58 */
64*4882a593Smuzhiyun u32 cs6_stop; /* MMAP_CTRL + 0x5c */
65*4882a593Smuzhiyun u32 cs7_start; /* MMAP_CTRL + 0x60 */
66*4882a593Smuzhiyun u32 cs7_stop; /* MMAP_CTRL + 0x64 */
67*4882a593Smuzhiyun };
68*4882a593Smuzhiyun
69*4882a593Smuzhiyun /* SDRAM control */
70*4882a593Smuzhiyun struct mpc52xx_sdram {
71*4882a593Smuzhiyun u32 mode; /* SDRAM + 0x00 */
72*4882a593Smuzhiyun u32 ctrl; /* SDRAM + 0x04 */
73*4882a593Smuzhiyun u32 config1; /* SDRAM + 0x08 */
74*4882a593Smuzhiyun u32 config2; /* SDRAM + 0x0c */
75*4882a593Smuzhiyun };
76*4882a593Smuzhiyun
77*4882a593Smuzhiyun /* SDMA */
78*4882a593Smuzhiyun struct mpc52xx_sdma {
79*4882a593Smuzhiyun u32 taskBar; /* SDMA + 0x00 */
80*4882a593Smuzhiyun u32 currentPointer; /* SDMA + 0x04 */
81*4882a593Smuzhiyun u32 endPointer; /* SDMA + 0x08 */
82*4882a593Smuzhiyun u32 variablePointer; /* SDMA + 0x0c */
83*4882a593Smuzhiyun
84*4882a593Smuzhiyun u8 IntVect1; /* SDMA + 0x10 */
85*4882a593Smuzhiyun u8 IntVect2; /* SDMA + 0x11 */
86*4882a593Smuzhiyun u16 PtdCntrl; /* SDMA + 0x12 */
87*4882a593Smuzhiyun
88*4882a593Smuzhiyun u32 IntPend; /* SDMA + 0x14 */
89*4882a593Smuzhiyun u32 IntMask; /* SDMA + 0x18 */
90*4882a593Smuzhiyun
91*4882a593Smuzhiyun u16 tcr[16]; /* SDMA + 0x1c .. 0x3a */
92*4882a593Smuzhiyun
93*4882a593Smuzhiyun u8 ipr[32]; /* SDMA + 0x3c .. 0x5b */
94*4882a593Smuzhiyun
95*4882a593Smuzhiyun u32 cReqSelect; /* SDMA + 0x5c */
96*4882a593Smuzhiyun u32 task_size0; /* SDMA + 0x60 */
97*4882a593Smuzhiyun u32 task_size1; /* SDMA + 0x64 */
98*4882a593Smuzhiyun u32 MDEDebug; /* SDMA + 0x68 */
99*4882a593Smuzhiyun u32 ADSDebug; /* SDMA + 0x6c */
100*4882a593Smuzhiyun u32 Value1; /* SDMA + 0x70 */
101*4882a593Smuzhiyun u32 Value2; /* SDMA + 0x74 */
102*4882a593Smuzhiyun u32 Control; /* SDMA + 0x78 */
103*4882a593Smuzhiyun u32 Status; /* SDMA + 0x7c */
104*4882a593Smuzhiyun u32 PTDDebug; /* SDMA + 0x80 */
105*4882a593Smuzhiyun };
106*4882a593Smuzhiyun
107*4882a593Smuzhiyun /* GPT */
108*4882a593Smuzhiyun struct mpc52xx_gpt {
109*4882a593Smuzhiyun u32 mode; /* GPTx + 0x00 */
110*4882a593Smuzhiyun u32 count; /* GPTx + 0x04 */
111*4882a593Smuzhiyun u32 pwm; /* GPTx + 0x08 */
112*4882a593Smuzhiyun u32 status; /* GPTx + 0X0c */
113*4882a593Smuzhiyun };
114*4882a593Smuzhiyun
115*4882a593Smuzhiyun /* GPIO */
116*4882a593Smuzhiyun struct mpc52xx_gpio {
117*4882a593Smuzhiyun u32 port_config; /* GPIO + 0x00 */
118*4882a593Smuzhiyun u32 simple_gpioe; /* GPIO + 0x04 */
119*4882a593Smuzhiyun u32 simple_ode; /* GPIO + 0x08 */
120*4882a593Smuzhiyun u32 simple_ddr; /* GPIO + 0x0c */
121*4882a593Smuzhiyun u32 simple_dvo; /* GPIO + 0x10 */
122*4882a593Smuzhiyun u32 simple_ival; /* GPIO + 0x14 */
123*4882a593Smuzhiyun u8 outo_gpioe; /* GPIO + 0x18 */
124*4882a593Smuzhiyun u8 reserved1[3]; /* GPIO + 0x19 */
125*4882a593Smuzhiyun u8 outo_dvo; /* GPIO + 0x1c */
126*4882a593Smuzhiyun u8 reserved2[3]; /* GPIO + 0x1d */
127*4882a593Smuzhiyun u8 sint_gpioe; /* GPIO + 0x20 */
128*4882a593Smuzhiyun u8 reserved3[3]; /* GPIO + 0x21 */
129*4882a593Smuzhiyun u8 sint_ode; /* GPIO + 0x24 */
130*4882a593Smuzhiyun u8 reserved4[3]; /* GPIO + 0x25 */
131*4882a593Smuzhiyun u8 sint_ddr; /* GPIO + 0x28 */
132*4882a593Smuzhiyun u8 reserved5[3]; /* GPIO + 0x29 */
133*4882a593Smuzhiyun u8 sint_dvo; /* GPIO + 0x2c */
134*4882a593Smuzhiyun u8 reserved6[3]; /* GPIO + 0x2d */
135*4882a593Smuzhiyun u8 sint_inten; /* GPIO + 0x30 */
136*4882a593Smuzhiyun u8 reserved7[3]; /* GPIO + 0x31 */
137*4882a593Smuzhiyun u16 sint_itype; /* GPIO + 0x34 */
138*4882a593Smuzhiyun u16 reserved8; /* GPIO + 0x36 */
139*4882a593Smuzhiyun u8 gpio_control; /* GPIO + 0x38 */
140*4882a593Smuzhiyun u8 reserved9[3]; /* GPIO + 0x39 */
141*4882a593Smuzhiyun u8 sint_istat; /* GPIO + 0x3c */
142*4882a593Smuzhiyun u8 sint_ival; /* GPIO + 0x3d */
143*4882a593Smuzhiyun u8 bus_errs; /* GPIO + 0x3e */
144*4882a593Smuzhiyun u8 reserved10; /* GPIO + 0x3f */
145*4882a593Smuzhiyun };
146*4882a593Smuzhiyun
147*4882a593Smuzhiyun #define MPC52xx_GPIO_PSC_CONFIG_UART_WITHOUT_CD 4
148*4882a593Smuzhiyun #define MPC52xx_GPIO_PSC_CONFIG_UART_WITH_CD 5
149*4882a593Smuzhiyun #define MPC52xx_GPIO_PCI_DIS (1<<15)
150*4882a593Smuzhiyun
151*4882a593Smuzhiyun /* GPIO with WakeUp*/
152*4882a593Smuzhiyun struct mpc52xx_gpio_wkup {
153*4882a593Smuzhiyun u8 wkup_gpioe; /* GPIO_WKUP + 0x00 */
154*4882a593Smuzhiyun u8 reserved1[3]; /* GPIO_WKUP + 0x03 */
155*4882a593Smuzhiyun u8 wkup_ode; /* GPIO_WKUP + 0x04 */
156*4882a593Smuzhiyun u8 reserved2[3]; /* GPIO_WKUP + 0x05 */
157*4882a593Smuzhiyun u8 wkup_ddr; /* GPIO_WKUP + 0x08 */
158*4882a593Smuzhiyun u8 reserved3[3]; /* GPIO_WKUP + 0x09 */
159*4882a593Smuzhiyun u8 wkup_dvo; /* GPIO_WKUP + 0x0C */
160*4882a593Smuzhiyun u8 reserved4[3]; /* GPIO_WKUP + 0x0D */
161*4882a593Smuzhiyun u8 wkup_inten; /* GPIO_WKUP + 0x10 */
162*4882a593Smuzhiyun u8 reserved5[3]; /* GPIO_WKUP + 0x11 */
163*4882a593Smuzhiyun u8 wkup_iinten; /* GPIO_WKUP + 0x14 */
164*4882a593Smuzhiyun u8 reserved6[3]; /* GPIO_WKUP + 0x15 */
165*4882a593Smuzhiyun u16 wkup_itype; /* GPIO_WKUP + 0x18 */
166*4882a593Smuzhiyun u8 reserved7[2]; /* GPIO_WKUP + 0x1A */
167*4882a593Smuzhiyun u8 wkup_maste; /* GPIO_WKUP + 0x1C */
168*4882a593Smuzhiyun u8 reserved8[3]; /* GPIO_WKUP + 0x1D */
169*4882a593Smuzhiyun u8 wkup_ival; /* GPIO_WKUP + 0x20 */
170*4882a593Smuzhiyun u8 reserved9[3]; /* GPIO_WKUP + 0x21 */
171*4882a593Smuzhiyun u8 wkup_istat; /* GPIO_WKUP + 0x24 */
172*4882a593Smuzhiyun u8 reserved10[3]; /* GPIO_WKUP + 0x25 */
173*4882a593Smuzhiyun };
174*4882a593Smuzhiyun
175*4882a593Smuzhiyun /* XLB Bus control */
176*4882a593Smuzhiyun struct mpc52xx_xlb {
177*4882a593Smuzhiyun u8 reserved[0x40];
178*4882a593Smuzhiyun u32 config; /* XLB + 0x40 */
179*4882a593Smuzhiyun u32 version; /* XLB + 0x44 */
180*4882a593Smuzhiyun u32 status; /* XLB + 0x48 */
181*4882a593Smuzhiyun u32 int_enable; /* XLB + 0x4c */
182*4882a593Smuzhiyun u32 addr_capture; /* XLB + 0x50 */
183*4882a593Smuzhiyun u32 bus_sig_capture; /* XLB + 0x54 */
184*4882a593Smuzhiyun u32 addr_timeout; /* XLB + 0x58 */
185*4882a593Smuzhiyun u32 data_timeout; /* XLB + 0x5c */
186*4882a593Smuzhiyun u32 bus_act_timeout; /* XLB + 0x60 */
187*4882a593Smuzhiyun u32 master_pri_enable; /* XLB + 0x64 */
188*4882a593Smuzhiyun u32 master_priority; /* XLB + 0x68 */
189*4882a593Smuzhiyun u32 base_address; /* XLB + 0x6c */
190*4882a593Smuzhiyun u32 snoop_window; /* XLB + 0x70 */
191*4882a593Smuzhiyun };
192*4882a593Smuzhiyun
193*4882a593Smuzhiyun #define MPC52xx_XLB_CFG_PLDIS (1 << 31)
194*4882a593Smuzhiyun #define MPC52xx_XLB_CFG_SNOOP (1 << 15)
195*4882a593Smuzhiyun
196*4882a593Smuzhiyun /* Clock Distribution control */
197*4882a593Smuzhiyun struct mpc52xx_cdm {
198*4882a593Smuzhiyun u32 jtag_id; /* CDM + 0x00 reg0 read only */
199*4882a593Smuzhiyun u32 rstcfg; /* CDM + 0x04 reg1 read only */
200*4882a593Smuzhiyun u32 breadcrumb; /* CDM + 0x08 reg2 */
201*4882a593Smuzhiyun
202*4882a593Smuzhiyun u8 mem_clk_sel; /* CDM + 0x0c reg3 byte0 */
203*4882a593Smuzhiyun u8 xlb_clk_sel; /* CDM + 0x0d reg3 byte1 read only */
204*4882a593Smuzhiyun u8 ipb_clk_sel; /* CDM + 0x0e reg3 byte2 */
205*4882a593Smuzhiyun u8 pci_clk_sel; /* CDM + 0x0f reg3 byte3 */
206*4882a593Smuzhiyun
207*4882a593Smuzhiyun u8 ext_48mhz_en; /* CDM + 0x10 reg4 byte0 */
208*4882a593Smuzhiyun u8 fd_enable; /* CDM + 0x11 reg4 byte1 */
209*4882a593Smuzhiyun u16 fd_counters; /* CDM + 0x12 reg4 byte2,3 */
210*4882a593Smuzhiyun
211*4882a593Smuzhiyun u32 clk_enables; /* CDM + 0x14 reg5 */
212*4882a593Smuzhiyun
213*4882a593Smuzhiyun u8 osc_disable; /* CDM + 0x18 reg6 byte0 */
214*4882a593Smuzhiyun u8 reserved0[3]; /* CDM + 0x19 reg6 byte1,2,3 */
215*4882a593Smuzhiyun
216*4882a593Smuzhiyun u8 ccs_sleep_enable; /* CDM + 0x1c reg7 byte0 */
217*4882a593Smuzhiyun u8 osc_sleep_enable; /* CDM + 0x1d reg7 byte1 */
218*4882a593Smuzhiyun u8 reserved1; /* CDM + 0x1e reg7 byte2 */
219*4882a593Smuzhiyun u8 ccs_qreq_test; /* CDM + 0x1f reg7 byte3 */
220*4882a593Smuzhiyun
221*4882a593Smuzhiyun u8 soft_reset; /* CDM + 0x20 u8 byte0 */
222*4882a593Smuzhiyun u8 no_ckstp; /* CDM + 0x21 u8 byte0 */
223*4882a593Smuzhiyun u8 reserved2[2]; /* CDM + 0x22 u8 byte1,2,3 */
224*4882a593Smuzhiyun
225*4882a593Smuzhiyun u8 pll_lock; /* CDM + 0x24 reg9 byte0 */
226*4882a593Smuzhiyun u8 pll_looselock; /* CDM + 0x25 reg9 byte1 */
227*4882a593Smuzhiyun u8 pll_sm_lockwin; /* CDM + 0x26 reg9 byte2 */
228*4882a593Smuzhiyun u8 reserved3; /* CDM + 0x27 reg9 byte3 */
229*4882a593Smuzhiyun
230*4882a593Smuzhiyun u16 reserved4; /* CDM + 0x28 reg10 byte0,1 */
231*4882a593Smuzhiyun u16 mclken_div_psc1; /* CDM + 0x2a reg10 byte2,3 */
232*4882a593Smuzhiyun
233*4882a593Smuzhiyun u16 reserved5; /* CDM + 0x2c reg11 byte0,1 */
234*4882a593Smuzhiyun u16 mclken_div_psc2; /* CDM + 0x2e reg11 byte2,3 */
235*4882a593Smuzhiyun
236*4882a593Smuzhiyun u16 reserved6; /* CDM + 0x30 reg12 byte0,1 */
237*4882a593Smuzhiyun u16 mclken_div_psc3; /* CDM + 0x32 reg12 byte2,3 */
238*4882a593Smuzhiyun
239*4882a593Smuzhiyun u16 reserved7; /* CDM + 0x34 reg13 byte0,1 */
240*4882a593Smuzhiyun u16 mclken_div_psc6; /* CDM + 0x36 reg13 byte2,3 */
241*4882a593Smuzhiyun };
242*4882a593Smuzhiyun
243*4882a593Smuzhiyun /* Interrupt controller Register set */
244*4882a593Smuzhiyun struct mpc52xx_intr {
245*4882a593Smuzhiyun u32 per_mask; /* INTR + 0x00 */
246*4882a593Smuzhiyun u32 per_pri1; /* INTR + 0x04 */
247*4882a593Smuzhiyun u32 per_pri2; /* INTR + 0x08 */
248*4882a593Smuzhiyun u32 per_pri3; /* INTR + 0x0c */
249*4882a593Smuzhiyun u32 ctrl; /* INTR + 0x10 */
250*4882a593Smuzhiyun u32 main_mask; /* INTR + 0x14 */
251*4882a593Smuzhiyun u32 main_pri1; /* INTR + 0x18 */
252*4882a593Smuzhiyun u32 main_pri2; /* INTR + 0x1c */
253*4882a593Smuzhiyun u32 reserved1; /* INTR + 0x20 */
254*4882a593Smuzhiyun u32 enc_status; /* INTR + 0x24 */
255*4882a593Smuzhiyun u32 crit_status; /* INTR + 0x28 */
256*4882a593Smuzhiyun u32 main_status; /* INTR + 0x2c */
257*4882a593Smuzhiyun u32 per_status; /* INTR + 0x30 */
258*4882a593Smuzhiyun u32 reserved2; /* INTR + 0x34 */
259*4882a593Smuzhiyun u32 per_error; /* INTR + 0x38 */
260*4882a593Smuzhiyun };
261*4882a593Smuzhiyun
262*4882a593Smuzhiyun #endif /* __ASSEMBLY__ */
263*4882a593Smuzhiyun
264*4882a593Smuzhiyun
265*4882a593Smuzhiyun /* ========================================================================= */
266*4882a593Smuzhiyun /* Prototypes for MPC52xx sysdev */
267*4882a593Smuzhiyun /* ========================================================================= */
268*4882a593Smuzhiyun
269*4882a593Smuzhiyun #ifndef __ASSEMBLY__
270*4882a593Smuzhiyun
271*4882a593Smuzhiyun /* mpc52xx_common.c */
272*4882a593Smuzhiyun extern void mpc5200_setup_xlb_arbiter(void);
273*4882a593Smuzhiyun extern void mpc52xx_declare_of_platform_devices(void);
274*4882a593Smuzhiyun extern int mpc5200_psc_ac97_gpio_reset(int psc_number);
275*4882a593Smuzhiyun extern void mpc52xx_map_common_devices(void);
276*4882a593Smuzhiyun extern int mpc52xx_set_psc_clkdiv(int psc_id, int clkdiv);
277*4882a593Smuzhiyun extern unsigned int mpc52xx_get_xtal_freq(struct device_node *node);
278*4882a593Smuzhiyun extern void __noreturn mpc52xx_restart(char *cmd);
279*4882a593Smuzhiyun
280*4882a593Smuzhiyun /* mpc52xx_gpt.c */
281*4882a593Smuzhiyun struct mpc52xx_gpt_priv;
282*4882a593Smuzhiyun extern struct mpc52xx_gpt_priv *mpc52xx_gpt_from_irq(int irq);
283*4882a593Smuzhiyun extern int mpc52xx_gpt_start_timer(struct mpc52xx_gpt_priv *gpt, u64 period,
284*4882a593Smuzhiyun int continuous);
285*4882a593Smuzhiyun extern u64 mpc52xx_gpt_timer_period(struct mpc52xx_gpt_priv *gpt);
286*4882a593Smuzhiyun extern int mpc52xx_gpt_stop_timer(struct mpc52xx_gpt_priv *gpt);
287*4882a593Smuzhiyun
288*4882a593Smuzhiyun /* mpc52xx_lpbfifo.c */
289*4882a593Smuzhiyun #define MPC52XX_LPBFIFO_FLAG_READ (0)
290*4882a593Smuzhiyun #define MPC52XX_LPBFIFO_FLAG_WRITE (1<<0)
291*4882a593Smuzhiyun #define MPC52XX_LPBFIFO_FLAG_NO_INCREMENT (1<<1)
292*4882a593Smuzhiyun #define MPC52XX_LPBFIFO_FLAG_NO_DMA (1<<2)
293*4882a593Smuzhiyun #define MPC52XX_LPBFIFO_FLAG_POLL_DMA (1<<3)
294*4882a593Smuzhiyun
295*4882a593Smuzhiyun struct mpc52xx_lpbfifo_request {
296*4882a593Smuzhiyun struct list_head list;
297*4882a593Smuzhiyun
298*4882a593Smuzhiyun /* localplus bus address */
299*4882a593Smuzhiyun unsigned int cs;
300*4882a593Smuzhiyun size_t offset;
301*4882a593Smuzhiyun
302*4882a593Smuzhiyun /* Memory address */
303*4882a593Smuzhiyun void *data;
304*4882a593Smuzhiyun phys_addr_t data_phys;
305*4882a593Smuzhiyun
306*4882a593Smuzhiyun /* Details of transfer */
307*4882a593Smuzhiyun size_t size;
308*4882a593Smuzhiyun size_t pos; /* current position of transfer */
309*4882a593Smuzhiyun int flags;
310*4882a593Smuzhiyun int defer_xfer_start;
311*4882a593Smuzhiyun
312*4882a593Smuzhiyun /* What to do when finished */
313*4882a593Smuzhiyun void (*callback)(struct mpc52xx_lpbfifo_request *);
314*4882a593Smuzhiyun
315*4882a593Smuzhiyun void *priv; /* Driver private data */
316*4882a593Smuzhiyun
317*4882a593Smuzhiyun /* statistics */
318*4882a593Smuzhiyun int irq_count;
319*4882a593Smuzhiyun int irq_ticks;
320*4882a593Smuzhiyun u8 last_byte;
321*4882a593Smuzhiyun int buffer_not_done_cnt;
322*4882a593Smuzhiyun };
323*4882a593Smuzhiyun
324*4882a593Smuzhiyun extern int mpc52xx_lpbfifo_submit(struct mpc52xx_lpbfifo_request *req);
325*4882a593Smuzhiyun extern void mpc52xx_lpbfifo_abort(struct mpc52xx_lpbfifo_request *req);
326*4882a593Smuzhiyun extern void mpc52xx_lpbfifo_poll(void);
327*4882a593Smuzhiyun extern int mpc52xx_lpbfifo_start_xfer(struct mpc52xx_lpbfifo_request *req);
328*4882a593Smuzhiyun
329*4882a593Smuzhiyun /* mpc52xx_pic.c */
330*4882a593Smuzhiyun extern void mpc52xx_init_irq(void);
331*4882a593Smuzhiyun extern unsigned int mpc52xx_get_irq(void);
332*4882a593Smuzhiyun
333*4882a593Smuzhiyun /* mpc52xx_pci.c */
334*4882a593Smuzhiyun #ifdef CONFIG_PCI
335*4882a593Smuzhiyun extern int __init mpc52xx_add_bridge(struct device_node *node);
336*4882a593Smuzhiyun extern void __init mpc52xx_setup_pci(void);
337*4882a593Smuzhiyun #else
mpc52xx_setup_pci(void)338*4882a593Smuzhiyun static inline void mpc52xx_setup_pci(void) { }
339*4882a593Smuzhiyun #endif
340*4882a593Smuzhiyun
341*4882a593Smuzhiyun #endif /* __ASSEMBLY__ */
342*4882a593Smuzhiyun
343*4882a593Smuzhiyun #ifdef CONFIG_PM
344*4882a593Smuzhiyun struct mpc52xx_suspend {
345*4882a593Smuzhiyun void (*board_suspend_prepare)(void __iomem *mbar);
346*4882a593Smuzhiyun void (*board_resume_finish)(void __iomem *mbar);
347*4882a593Smuzhiyun };
348*4882a593Smuzhiyun
349*4882a593Smuzhiyun extern struct mpc52xx_suspend mpc52xx_suspend;
350*4882a593Smuzhiyun extern int __init mpc52xx_pm_init(void);
351*4882a593Smuzhiyun extern int mpc52xx_set_wakeup_gpio(u8 pin, u8 level);
352*4882a593Smuzhiyun
353*4882a593Smuzhiyun /* lite5200 calls mpc5200 suspend functions, so here they are */
354*4882a593Smuzhiyun extern int mpc52xx_pm_prepare(void);
355*4882a593Smuzhiyun extern int mpc52xx_pm_enter(suspend_state_t);
356*4882a593Smuzhiyun extern void mpc52xx_pm_finish(void);
357*4882a593Smuzhiyun extern char saved_sram[0x4000]; /* reuse buffer from mpc52xx suspend */
358*4882a593Smuzhiyun
359*4882a593Smuzhiyun #ifdef CONFIG_PPC_LITE5200
360*4882a593Smuzhiyun int __init lite5200_pm_init(void);
361*4882a593Smuzhiyun #endif
362*4882a593Smuzhiyun #endif /* CONFIG_PM */
363*4882a593Smuzhiyun
364*4882a593Smuzhiyun #endif /* __ASM_POWERPC_MPC52xx_H__ */
365*4882a593Smuzhiyun
366