blob: be541cbba0708d0e152233013a6ab2fa27428424 [file] [log] [blame]
Ben Dooksa5030592008-10-21 14:06:43 +01001/* linux/arch/arm/plat-s3c/include/plat/cpu.h
Linus Torvalds1da177e2005-04-16 15:20:36 -07002 *
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.
Linus Torvalds1da177e2005-04-16 15:20:36 -070011*/
12
13/* todo - fix when rmk changes iodescs to use `void __iomem *` */
14
Lucas Correia Villa Real0367a8d2006-01-26 15:20:50 +000015#define IODESC_ENT(x) { (unsigned long)S3C24XX_VA_##x, __phys_to_pfn(S3C24XX_PA_##x), S3C24XX_SZ_##x, MT_DEVICE }
Linus Torvalds1da177e2005-04-16 15:20:36 -070016
17#ifndef MHZ
18#define MHZ (1000*1000)
19#endif
20
Ben Dooksa5030592008-10-21 14:06:43 +010021#define print_mhz(m) ((m) / MHZ), (((m) / 1000) % 1000)
Linus Torvalds1da177e2005-04-16 15:20:36 -070022
23/* forward declaration */
Ben Dooks66a9b492006-06-18 23:04:05 +010024struct s3c24xx_uart_resources;
25struct platform_device;
Linus Torvalds1da177e2005-04-16 15:20:36 -070026struct s3c2410_uartcfg;
27struct map_desc;
28
Ben Dooks74b265d2008-10-21 14:06:31 +010029/* 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
Linus Torvalds1da177e2005-04-16 15:20:36 -070044/* core initialisation functions */
45
46extern void s3c24xx_init_irq(void);
Ben Dooksd9b79fb2008-10-21 14:06:51 +010047extern void s3c64xx_init_irq(u32 vic0, u32 vic1);
Linus Torvalds1da177e2005-04-16 15:20:36 -070048
49extern void s3c24xx_init_io(struct map_desc *mach_desc, int size);
Ben Dooks6a5f4b82008-10-31 16:15:01 +000050extern void s3c64xx_init_io(struct map_desc *mach_desc, int size);
Linus Torvalds1da177e2005-04-16 15:20:36 -070051
52extern void s3c24xx_init_uarts(struct s3c2410_uartcfg *cfg, int no);
53
54extern void s3c24xx_init_clocks(int xtal);
55
Ben Dooks66a9b492006-06-18 23:04:05 +010056extern void s3c24xx_init_uartdevs(char *name,
57 struct s3c24xx_uart_resources *res,
58 struct s3c2410_uartcfg *cfg, int no);
59
Linus Torvalds1da177e2005-04-16 15:20:36 -070060/* timer for 2410/2440 */
61
62struct sys_timer;
63extern struct sys_timer s3c24xx_timer;
64
65/* system device classes */
66
Ben Dooksa3413052006-06-22 22:18:13 +010067extern struct sysdev_class s3c2410_sysclass;
Ben Dooks68d9ab32006-06-24 21:21:27 +010068extern struct sysdev_class s3c2412_sysclass;
Linus Torvalds1da177e2005-04-16 15:20:36 -070069extern struct sysdev_class s3c2440_sysclass;
Ben Dooks96ce2382006-06-18 23:06:41 +010070extern struct sysdev_class s3c2442_sysclass;
Ben Dookse4d06e32007-02-16 12:12:31 +010071extern struct sysdev_class s3c2443_sysclass;
Ben Dooks0abfe9a2008-12-12 00:24:28 +000072extern struct sysdev_class s3c6410_sysclass;
Ben Dooks1deb5072008-12-12 00:24:31 +000073extern struct sysdev_class s3c64xx_sysclass;
74