Merge commit 'v2.6.37-rc1' into for-2.6.37
[pandora-kernel.git] / arch / arm / mach-s5p64x0 / init.c
1 /* linux/arch/arm/mach-s5p64x0/init.c
2  *
3  * Copyright (c) 2009-2010 Samsung Electronics Co., Ltd.
4  *              http://www.samsung.com
5  *
6  * S5P64X0 - Init 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 #include <linux/kernel.h>
14 #include <linux/types.h>
15 #include <linux/init.h>
16 #include <linux/serial_core.h>
17
18 #include <mach/map.h>
19
20 #include <plat/cpu.h>
21 #include <plat/devs.h>
22 #include <plat/s5p6440.h>
23 #include <plat/s5p6450.h>
24 #include <plat/regs-serial.h>
25
26 static struct s3c24xx_uart_clksrc s5p64x0_serial_clocks[] = {
27         [0] = {
28                 .name           = "pclk_low",
29                 .divisor        = 1,
30                 .min_baud       = 0,
31                 .max_baud       = 0,
32         },
33         [1] = {
34                 .name           = "uclk1",
35                 .divisor        = 1,
36                 .min_baud       = 0,
37                 .max_baud       = 0,
38         },
39 };
40
41 /* uart registration process */
42
43 void __init s5p64x0_common_init_uarts(struct s3c2410_uartcfg *cfg, int no)
44 {
45         struct s3c2410_uartcfg *tcfg = cfg;
46         u32 ucnt;
47
48         for (ucnt = 0; ucnt < no; ucnt++, tcfg++) {
49                 if (!tcfg->clocks) {
50                         tcfg->clocks = s5p64x0_serial_clocks;
51                         tcfg->clocks_size = ARRAY_SIZE(s5p64x0_serial_clocks);
52                 }
53         }
54 }
55
56 void __init s5p6440_init_uarts(struct s3c2410_uartcfg *cfg, int no)
57 {
58         int uart;
59
60         for (uart = 0; uart < no; uart++) {
61                 s5p_uart_resources[uart].resources->start = S5P6440_PA_UART(uart);
62                 s5p_uart_resources[uart].resources->end = S5P6440_PA_UART(uart) + S5P_SZ_UART;
63         }
64
65         s5p64x0_common_init_uarts(cfg, no);
66         s3c24xx_init_uartdevs("s3c6400-uart", s5p_uart_resources, cfg, no);
67 }
68
69 void __init s5p6450_init_uarts(struct s3c2410_uartcfg *cfg, int no)
70 {
71         s5p64x0_common_init_uarts(cfg, no);
72         s3c24xx_init_uartdevs("s3c6400-uart", s5p_uart_resources, cfg, no);
73 }