xref: /openbmc/linux/arch/arm/mach-lpc32xx/common.h (revision 678a0222)
1 /*
2  * arch/arm/mach-lpc32xx/common.h
3  *
4  * Author: Kevin Wells <kevin.wells@nxp.com>
5  *
6  * Copyright (C) 2009-2010 NXP Semiconductors
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  */
18 
19 #ifndef __LPC32XX_COMMON_H
20 #define __LPC32XX_COMMON_H
21 
22 #include <linux/platform_device.h>
23 
24 /*
25  * Arch specific platform device structures
26  */
27 extern struct platform_device lpc32xx_watchdog_device;
28 extern struct platform_device lpc32xx_i2c0_device;
29 extern struct platform_device lpc32xx_i2c1_device;
30 extern struct platform_device lpc32xx_i2c2_device;
31 extern struct platform_device lpc32xx_tsc_device;
32 extern struct platform_device lpc32xx_adc_device;
33 extern struct platform_device lpc32xx_rtc_device;
34 
35 /*
36  * Other arch specific structures and functions
37  */
38 extern struct sys_timer lpc32xx_timer;
39 extern void __init lpc32xx_init_irq(void);
40 extern void __init lpc32xx_map_io(void);
41 extern void __init lpc32xx_serial_init(void);
42 extern void __init lpc32xx_gpio_init(void);
43 extern void lpc23xx_restart(char, const char *);
44 
45 
46 /*
47  * Structure used for setting up and querying the PLLS
48  */
49 struct clk_pll_setup {
50 	int analog_on;
51 	int cco_bypass_b15;
52 	int direct_output_b14;
53 	int fdbk_div_ctrl_b13;
54 	int pll_p;
55 	int pll_n;
56 	u32 pll_m;
57 };
58 
59 extern int clk_is_sysclk_mainosc(void);
60 extern u32 clk_check_pll_setup(u32 ifreq, struct clk_pll_setup *pllsetup);
61 extern u32 clk_get_pllrate_from_reg(u32 inputclk, u32 regval);
62 extern u32 clk_get_pclk_div(void);
63 
64 /*
65  * Returns the LPC32xx unique 128-bit chip ID
66  */
67 extern void lpc32xx_get_uid(u32 devid[4]);
68 
69 extern void lpc32xx_watchdog_reset(void);
70 extern u32 lpc32xx_return_iram_size(void);
71 
72 /*
73  * Pointers used for sizing and copying suspend function data
74  */
75 extern int lpc32xx_sys_suspend(void);
76 extern int lpc32xx_sys_suspend_sz;
77 
78 #endif
79