blob: cedfff51c82b11f59fac4f17c2a0aff0e49256dd [file] [log] [blame]
Ben Dooksc116c1d2010-01-29 09:02:12 +00001/* linux/arch/arm/plat-samsung/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
Kyungmin Parkc3fcf5d2009-11-17 08:41:17 +010015#ifndef __SAMSUNG_PLAT_CPU_H
16#define __SAMSUNG_PLAT_CPU_H
17
Lucas Correia Villa Real0367a8d2006-01-26 15:20:50 +000018#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 -070019
20#ifndef MHZ
21#define MHZ (1000*1000)
22#endif
23
Ben Dooksa5030592008-10-21 14:06:43 +010024#define print_mhz(m) ((m) / MHZ), (((m) / 1000) % 1000)
Linus Torvalds1da177e2005-04-16 15:20:36 -070025
26/* forward declaration */
Ben Dooks66a9b492006-06-18 23:04:05 +010027struct s3c24xx_uart_resources;
28struct platform_device;
Linus Torvalds1da177e2005-04-16 15:20:36 -070029struct s3c2410_uartcfg;
30struct map_desc;
31
Ben Dooks74b265d2008-10-21 14:06:31 +010032/* per-cpu initialisation function table. */
33
34struct cpu_table {
35 unsigned long idcode;
36 unsigned long idmask;
37 void (*map_io)(void);
38 void (*init_uarts)(struct s3c2410_uartcfg *cfg, int no);
39 void (*init_clocks)(int xtal);
40 int (*init)(void);
41 const char *name;
42};
43
44extern void s3c_init_cpu(unsigned long idcode,
45 struct cpu_table *cpus, unsigned int cputab_size);
46
Linus Torvalds1da177e2005-04-16 15:20:36 -070047/* core initialisation functions */
48
49extern void s3c24xx_init_irq(void);
Ben Dooksd9b79fb2008-10-21 14:06:51 +010050extern void s3c64xx_init_irq(u32 vic0, u32 vic1);
Kukjin Kim209fecd2010-01-14 15:29:17 +090051extern void s5p_init_irq(u32 *vic, u32 num_vic);
Linus Torvalds1da177e2005-04-16 15:20:36 -070052
53extern void s3c24xx_init_io(struct map_desc *mach_desc, int size);
Ben Dooks6a5f4b82008-10-31 16:15:01 +000054extern void s3c64xx_init_io(struct map_desc *mach_desc, int size);
Kukjin Kim209fecd2010-01-14 15:29:17 +090055extern void s5p_init_io(struct map_desc *mach_desc,
56 int size, void __iomem *cpuid_addr);
Linus Torvalds1da177e2005-04-16 15:20:36 -070057
58extern void s3c24xx_init_uarts(struct s3c2410_uartcfg *cfg, int no);
59
60extern void s3c24xx_init_clocks(int xtal);
61
Ben Dooks66a9b492006-06-18 23:04:05 +010062extern void s3c24xx_init_uartdevs(char *name,
63 struct s3c24xx_uart_resources *res,
64 struct s3c2410_uartcfg *cfg, int no);
65
Linus Torvalds1da177e2005-04-16 15:20:36 -070066/* timer for 2410/2440 */
67
68struct sys_timer;
69extern struct sys_timer s3c24xx_timer;
70
71/* system device classes */
72
Ben Dooksa3413052006-06-22 22:18:13 +010073extern struct sysdev_class s3c2410_sysclass;
Ben Dooksf0176792009-07-30 23:23:38 +010074extern struct sysdev_class s3c2410a_sysclass;
Ben Dooks68d9ab32006-06-24 21:21:27 +010075extern struct sysdev_class s3c2412_sysclass;
Yauhen Kharuzhyf1290a42010-04-28 18:09:01 +090076extern struct sysdev_class s3c2416_sysclass;
Linus Torvalds1da177e2005-04-16 15:20:36 -070077extern struct sysdev_class s3c2440_sysclass;
Ben Dooks96ce2382006-06-18 23:06:41 +010078extern struct sysdev_class s3c2442_sysclass;
Ben Dookse4d06e32007-02-16 12:12:31 +010079extern struct sysdev_class s3c2443_sysclass;
Ben Dooks0abfe9a2008-12-12 00:24:28 +000080extern struct sysdev_class s3c6410_sysclass;
Ben Dooks1deb5072008-12-12 00:24:31 +000081extern struct sysdev_class s3c64xx_sysclass;
Abhilash Kesavand7297612010-10-08 20:55:02 +090082extern struct sysdev_class s5p64x0_sysclass;
Kukjin Kim0ad73ce2010-05-11 09:56:37 +090083extern struct sysdev_class s5p6442_sysclass;
84extern struct sysdev_class s5pv210_sysclass;
Jaecheol Lee16638952011-03-10 13:33:59 +090085extern struct sysdev_class exynos4_sysclass;
Ben Dooks1deb5072008-12-12 00:24:31 +000086
Kyungmin Parkc3fcf5d2009-11-17 08:41:17 +010087extern void (*s5pc1xx_idle)(void);
88
89#endif