aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-s3c
diff options
context:
space:
mode:
authorBen Dooks <ben-linux@fluff.org>2008-10-21 09:06:43 -0400
committerBen Dooks <ben-linux@fluff.org>2008-12-15 16:46:10 -0500
commita503059c14215ac4325e25d9061cad992a373e17 (patch)
treea6e964542d61425603240c203a6c9774ddbfd8cd /arch/arm/plat-s3c
parente425382ed90d221ef9031a1b2d97d9bfedcf90c3 (diff)
[ARM] S3C24XX: Move headers from plat-s3c24xx to plat-s3c
Move clock.h, cpu.h and devs.h to plat-s3c for use with the s3c64xx support. Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Diffstat (limited to 'arch/arm/plat-s3c')
-rw-r--r--arch/arm/plat-s3c/include/plat/clock.h72
-rw-r--r--arch/arm/plat-s3c/include/plat/cpu.h69
-rw-r--r--arch/arm/plat-s3c/include/plat/devs.h49
3 files changed, 190 insertions, 0 deletions
diff --git a/arch/arm/plat-s3c/include/plat/clock.h b/arch/arm/plat-s3c/include/plat/clock.h
new file mode 100644
index 000000000000..d871609738f9
--- /dev/null
+++ b/arch/arm/plat-s3c/include/plat/clock.h
@@ -0,0 +1,72 @@
1/* linux/arch/arm/plat-s3c/include/plat/clock.h
2 *
3 * Copyright (c) 2004-2005 Simtec Electronics
4 * http://www.simtec.co.uk/products/SWLINUX/
5 * Written by Ben Dooks, <ben@simtec.co.uk>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10*/
11
12#include <linux/spinlock.h>
13
14struct clk {
15 struct list_head list;
16 struct module *owner;
17 struct clk *parent;
18 const char *name;
19 int id;
20 int usage;
21 unsigned long rate;
22 unsigned long ctrlbit;
23
24 int (*enable)(struct clk *, int enable);
25 int (*set_rate)(struct clk *c, unsigned long rate);
26 unsigned long (*get_rate)(struct clk *c);
27 unsigned long (*round_rate)(struct clk *c, unsigned long rate);
28 int (*set_parent)(struct clk *c, struct clk *parent);
29};
30
31/* other clocks which may be registered by board support */
32
33extern struct clk s3c24xx_dclk0;
34extern struct clk s3c24xx_dclk1;
35extern struct clk s3c24xx_clkout0;
36extern struct clk s3c24xx_clkout1;
37extern struct clk s3c24xx_uclk;
38
39extern struct clk clk_usb_bus;
40
41/* core clock support */
42
43extern struct clk clk_f;
44extern struct clk clk_h;
45extern struct clk clk_p;
46extern struct clk clk_mpll;
47extern struct clk clk_upll;
48extern struct clk clk_xtal;
49
50/* exports for arch/arm/mach-s3c2410
51 *
52 * Please DO NOT use these outside of arch/arm/mach-s3c2410
53*/
54
55extern spinlock_t clocks_lock;
56
57extern int s3c2410_clkcon_enable(struct clk *clk, int enable);
58
59extern int s3c24xx_register_clock(struct clk *clk);
60extern int s3c24xx_register_clocks(struct clk **clk, int nr_clks);
61
62extern int s3c24xx_register_baseclocks(unsigned long xtal);
63
64extern void s3c24xx_setup_clocks(unsigned long fclk,
65 unsigned long hclk,
66 unsigned long pclk);
67
68extern void s3c2410_setup_clocks(void);
69extern void s3c2412_setup_clocks(void);
70extern void s3c244x_setup_clocks(void);
71extern void s3c2443_setup_clocks(void);
72
diff --git a/arch/arm/plat-s3c/include/plat/cpu.h b/arch/arm/plat-s3c/include/plat/cpu.h
new file mode 100644
index 000000000000..011157ea871a
--- /dev/null
+++ b/arch/arm/plat-s3c/include/plat/cpu.h
@@ -0,0 +1,69 @@
1/* linux/arch/arm/plat-s3c/include/plat/cpu.h
2 *
3 * Copyright (c) 2004-2005 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * Header file for S3C24XX CPU support
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 version 2 as
10 * published by the Free Software Foundation.
11*/
12
13/* todo - fix when rmk changes iodescs to use `void __iomem *` */
14
15#define IODESC_ENT(x) { (unsigned long)S3C24XX_VA_##x, __phys_to_pfn(S3C24XX_PA_##x), S3C24XX_SZ_##x, MT_DEVICE }
16
17#ifndef MHZ
18#define MHZ (1000*1000)
19#endif
20
21#define print_mhz(m) ((m) / MHZ), (((m) / 1000) % 1000)
22
23/* forward declaration */
24struct s3c24xx_uart_resources;
25struct platform_device;
26struct s3c2410_uartcfg;
27struct map_desc;
28
29/* per-cpu initialisation function table. */
30
31struct cpu_table {
32 unsigned long idcode;
33 unsigned long idmask;
34 void (*map_io)(void);
35 void (*init_uarts)(struct s3c2410_uartcfg *cfg, int no);
36 void (*init_clocks)(int xtal);
37 int (*init)(void);
38 const char *name;
39};
40
41extern void s3c_init_cpu(unsigned long idcode,
42 struct cpu_table *cpus, unsigned int cputab_size);
43
44/* core initialisation functions */
45
46extern void s3c24xx_init_irq(void);
47
48extern void s3c24xx_init_io(struct map_desc *mach_desc, int size);
49
50extern void s3c24xx_init_uarts(struct s3c2410_uartcfg *cfg, int no);
51
52extern void s3c24xx_init_clocks(int xtal);
53
54extern void s3c24xx_init_uartdevs(char *name,
55 struct s3c24xx_uart_resources *res,
56 struct s3c2410_uartcfg *cfg, int no);
57
58/* timer for 2410/2440 */
59
60struct sys_timer;
61extern struct sys_timer s3c24xx_timer;
62
63/* system device classes */
64
65extern struct sysdev_class s3c2410_sysclass;
66extern struct sysdev_class s3c2412_sysclass;
67extern struct sysdev_class s3c2440_sysclass;
68extern struct sysdev_class s3c2442_sysclass;
69extern struct sysdev_class s3c2443_sysclass;
diff --git a/arch/arm/plat-s3c/include/plat/devs.h b/arch/arm/plat-s3c/include/plat/devs.h
new file mode 100644
index 000000000000..badaac9d64a8
--- /dev/null
+++ b/arch/arm/plat-s3c/include/plat/devs.h
@@ -0,0 +1,49 @@
1/* linux/include/asm-arm/plat-s3c24xx/devs.h
2 *
3 * Copyright (c) 2004 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * Header file for s3c2410 standard platform devices
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 version 2 as
10 * published by the Free Software Foundation.
11*/
12#include <linux/platform_device.h>
13
14struct s3c24xx_uart_resources {
15 struct resource *resources;
16 unsigned long nr_resources;
17};
18
19extern struct s3c24xx_uart_resources s3c2410_uart_resources[];
20
21extern struct platform_device *s3c24xx_uart_devs[];
22extern struct platform_device *s3c24xx_uart_src[];
23
24extern struct platform_device s3c_device_timer[];
25
26extern struct platform_device s3c_device_usb;
27extern struct platform_device s3c_device_lcd;
28extern struct platform_device s3c_device_wdt;
29extern struct platform_device s3c_device_i2c;
30extern struct platform_device s3c_device_iis;
31extern struct platform_device s3c_device_rtc;
32extern struct platform_device s3c_device_adc;
33extern struct platform_device s3c_device_sdi;
34extern struct platform_device s3c_device_hsmmc;
35
36extern struct platform_device s3c_device_spi0;
37extern struct platform_device s3c_device_spi1;
38
39extern struct platform_device s3c_device_nand;
40
41extern struct platform_device s3c_device_usbgadget;
42
43/* s3c2440 specific devices */
44
45#ifdef CONFIG_CPU_S3C2440
46
47extern struct platform_device s3c_device_camif;
48
49#endif