diff options
Diffstat (limited to 'arch/arm/plat-s5p')
-rw-r--r-- | arch/arm/plat-s5p/Kconfig | 5 | ||||
-rw-r--r-- | arch/arm/plat-s5p/cpu.c | 14 | ||||
-rw-r--r-- | arch/arm/plat-s5p/include/plat/map-s5p.h | 23 | ||||
-rw-r--r-- | arch/arm/plat-s5p/include/plat/pll.h | 41 | ||||
-rw-r--r-- | arch/arm/plat-s5p/include/plat/s5pv310.h | 34 | ||||
-rw-r--r-- | arch/arm/plat-s5p/irq.c | 2 |
6 files changed, 112 insertions, 7 deletions
diff --git a/arch/arm/plat-s5p/Kconfig b/arch/arm/plat-s5p/Kconfig index 11d6a1bbd90..907ac6312a1 100644 --- a/arch/arm/plat-s5p/Kconfig +++ b/arch/arm/plat-s5p/Kconfig | |||
@@ -7,9 +7,10 @@ | |||
7 | 7 | ||
8 | config PLAT_S5P | 8 | config PLAT_S5P |
9 | bool | 9 | bool |
10 | depends on (ARCH_S5P6440 || ARCH_S5P6442 || ARCH_S5PC100 || ARCH_S5PV210) | 10 | depends on (ARCH_S5P6440 || ARCH_S5P6442 || ARCH_S5PC100 || ARCH_S5PV210 || ARCH_S5PV310) |
11 | default y | 11 | default y |
12 | select ARM_VIC | 12 | select ARM_VIC if !ARCH_S5PV310 |
13 | select ARM_GIC if ARCH_S5PV310 | ||
13 | select NO_IOPORT | 14 | select NO_IOPORT |
14 | select ARCH_REQUIRE_GPIOLIB | 15 | select ARCH_REQUIRE_GPIOLIB |
15 | select S3C_GPIO_TRACK | 16 | select S3C_GPIO_TRACK |
diff --git a/arch/arm/plat-s5p/cpu.c b/arch/arm/plat-s5p/cpu.c index 1ab55e82587..b07a078fd28 100644 --- a/arch/arm/plat-s5p/cpu.c +++ b/arch/arm/plat-s5p/cpu.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <plat/s5p6442.h> | 21 | #include <plat/s5p6442.h> |
22 | #include <plat/s5pc100.h> | 22 | #include <plat/s5pc100.h> |
23 | #include <plat/s5pv210.h> | 23 | #include <plat/s5pv210.h> |
24 | #include <plat/s5pv310.h> | ||
24 | 25 | ||
25 | /* table of supported CPUs */ | 26 | /* table of supported CPUs */ |
26 | 27 | ||
@@ -28,6 +29,7 @@ static const char name_s5p6440[] = "S5P6440"; | |||
28 | static const char name_s5p6442[] = "S5P6442"; | 29 | static const char name_s5p6442[] = "S5P6442"; |
29 | static const char name_s5pc100[] = "S5PC100"; | 30 | static const char name_s5pc100[] = "S5PC100"; |
30 | static const char name_s5pv210[] = "S5PV210/S5PC110"; | 31 | static const char name_s5pv210[] = "S5PV210/S5PC110"; |
32 | static const char name_s5pv310[] = "S5PV310"; | ||
31 | 33 | ||
32 | static struct cpu_table cpu_ids[] __initdata = { | 34 | static struct cpu_table cpu_ids[] __initdata = { |
33 | { | 35 | { |
@@ -62,6 +64,14 @@ static struct cpu_table cpu_ids[] __initdata = { | |||
62 | .init_uarts = s5pv210_init_uarts, | 64 | .init_uarts = s5pv210_init_uarts, |
63 | .init = s5pv210_init, | 65 | .init = s5pv210_init, |
64 | .name = name_s5pv210, | 66 | .name = name_s5pv210, |
67 | }, { | ||
68 | .idcode = 0x43200000, | ||
69 | .idmask = 0xfffff000, | ||
70 | .map_io = s5pv310_map_io, | ||
71 | .init_clocks = s5pv310_init_clocks, | ||
72 | .init_uarts = s5pv310_init_uarts, | ||
73 | .init = s5pv310_init, | ||
74 | .name = name_s5pv310, | ||
65 | }, | 75 | }, |
66 | }; | 76 | }; |
67 | 77 | ||
@@ -81,8 +91,9 @@ static struct map_desc s5p_iodesc[] __initdata = { | |||
81 | }, { | 91 | }, { |
82 | .virtual = (unsigned long)S3C_VA_UART, | 92 | .virtual = (unsigned long)S3C_VA_UART, |
83 | .pfn = __phys_to_pfn(S3C_PA_UART), | 93 | .pfn = __phys_to_pfn(S3C_PA_UART), |
84 | .length = SZ_4K, | 94 | .length = SZ_512K, |
85 | .type = MT_DEVICE, | 95 | .type = MT_DEVICE, |
96 | #ifdef CONFIG_ARM_VIC | ||
86 | }, { | 97 | }, { |
87 | .virtual = (unsigned long)VA_VIC0, | 98 | .virtual = (unsigned long)VA_VIC0, |
88 | .pfn = __phys_to_pfn(S5P_PA_VIC0), | 99 | .pfn = __phys_to_pfn(S5P_PA_VIC0), |
@@ -93,6 +104,7 @@ static struct map_desc s5p_iodesc[] __initdata = { | |||
93 | .pfn = __phys_to_pfn(S5P_PA_VIC1), | 104 | .pfn = __phys_to_pfn(S5P_PA_VIC1), |
94 | .length = SZ_16K, | 105 | .length = SZ_16K, |
95 | .type = MT_DEVICE, | 106 | .type = MT_DEVICE, |
107 | #endif | ||
96 | }, { | 108 | }, { |
97 | .virtual = (unsigned long)S3C_VA_TIMER, | 109 | .virtual = (unsigned long)S3C_VA_TIMER, |
98 | .pfn = __phys_to_pfn(S5P_PA_TIMER), | 110 | .pfn = __phys_to_pfn(S5P_PA_TIMER), |
diff --git a/arch/arm/plat-s5p/include/plat/map-s5p.h b/arch/arm/plat-s5p/include/plat/map-s5p.h index 14828521f70..54e9fb9d315 100644 --- a/arch/arm/plat-s5p/include/plat/map-s5p.h +++ b/arch/arm/plat-s5p/include/plat/map-s5p.h | |||
@@ -18,12 +18,27 @@ | |||
18 | #define S5P_VA_SYSTIMER S3C_ADDR(0x01200000) | 18 | #define S5P_VA_SYSTIMER S3C_ADDR(0x01200000) |
19 | #define S5P_VA_SROMC S3C_ADDR(0x01100000) | 19 | #define S5P_VA_SROMC S3C_ADDR(0x01100000) |
20 | 20 | ||
21 | #define S5P_VA_UART0 (S3C_VA_UART + 0x0) | 21 | #define S5P_VA_COMBINER_BASE S3C_ADDR(0x00600000) |
22 | #define S5P_VA_UART1 (S3C_VA_UART + 0x400) | 22 | #define S5P_VA_COMBINER(x) (S5P_VA_COMBINER_BASE + ((x) >> 2) * 0x10) |
23 | #define S5P_VA_UART2 (S3C_VA_UART + 0x800) | ||
24 | #define S5P_VA_UART3 (S3C_VA_UART + 0xC00) | ||
25 | 23 | ||
24 | #define S5P_VA_COREPERI_BASE S3C_ADDR(0x00800000) | ||
25 | #define S5P_VA_COREPERI(x) (S5P_VA_COREPERI_BASE + (x)) | ||
26 | #define S5P_VA_SCU S5P_VA_COREPERI(0x0) | ||
27 | #define S5P_VA_GIC_CPU S5P_VA_COREPERI(0x100) | ||
28 | #define S5P_VA_TWD S5P_VA_COREPERI(0x600) | ||
29 | #define S5P_VA_GIC_DIST S5P_VA_COREPERI(0x1000) | ||
30 | |||
31 | #define S5P_VA_L2CC S3C_ADDR(0x00900000) | ||
32 | |||
33 | #define S5P_VA_UART(x) (S3C_VA_UART + ((x) * S3C_UART_OFFSET)) | ||
34 | #define S5P_VA_UART0 S5P_VA_UART(0) | ||
35 | #define S5P_VA_UART1 S5P_VA_UART(1) | ||
36 | #define S5P_VA_UART2 S5P_VA_UART(2) | ||
37 | #define S5P_VA_UART3 S5P_VA_UART(3) | ||
38 | |||
39 | #ifndef S3C_UART_OFFSET | ||
26 | #define S3C_UART_OFFSET (0x400) | 40 | #define S3C_UART_OFFSET (0x400) |
41 | #endif | ||
27 | 42 | ||
28 | #define VA_VIC(x) (S3C_VA_IRQ + ((x) * 0x10000)) | 43 | #define VA_VIC(x) (S3C_VA_IRQ + ((x) * 0x10000)) |
29 | #define VA_VIC0 VA_VIC(0) | 44 | #define VA_VIC0 VA_VIC(0) |
diff --git a/arch/arm/plat-s5p/include/plat/pll.h b/arch/arm/plat-s5p/include/plat/pll.h index 7db322726bc..4e8fe08cb70 100644 --- a/arch/arm/plat-s5p/include/plat/pll.h +++ b/arch/arm/plat-s5p/include/plat/pll.h | |||
@@ -46,6 +46,47 @@ static inline unsigned long s5p_get_pll45xx(unsigned long baseclk, u32 pll_con, | |||
46 | return (unsigned long)fvco; | 46 | return (unsigned long)fvco; |
47 | } | 47 | } |
48 | 48 | ||
49 | #define PLL46XX_KDIV_MASK (0xFFFF) | ||
50 | #define PLL46XX_MDIV_MASK (0x1FF) | ||
51 | #define PLL46XX_PDIV_MASK (0x3F) | ||
52 | #define PLL46XX_SDIV_MASK (0x7) | ||
53 | #define PLL46XX_MDIV_SHIFT (16) | ||
54 | #define PLL46XX_PDIV_SHIFT (8) | ||
55 | #define PLL46XX_SDIV_SHIFT (0) | ||
56 | |||
57 | enum pll46xx_type_t { | ||
58 | pll_4600, | ||
59 | pll_4650, | ||
60 | }; | ||
61 | |||
62 | static inline unsigned long s5p_get_pll46xx(unsigned long baseclk, | ||
63 | u32 pll_con0, u32 pll_con1, | ||
64 | enum pll46xx_type_t pll_type) | ||
65 | { | ||
66 | unsigned long result; | ||
67 | u32 mdiv, pdiv, sdiv, kdiv; | ||
68 | u64 tmp; | ||
69 | |||
70 | mdiv = (pll_con0 >> PLL46XX_MDIV_SHIFT) & PLL46XX_MDIV_MASK; | ||
71 | pdiv = (pll_con0 >> PLL46XX_PDIV_SHIFT) & PLL46XX_PDIV_MASK; | ||
72 | sdiv = (pll_con0 >> PLL46XX_SDIV_SHIFT) & PLL46XX_SDIV_MASK; | ||
73 | kdiv = pll_con1 & PLL46XX_KDIV_MASK; | ||
74 | |||
75 | tmp = baseclk; | ||
76 | |||
77 | if (pll_type == pll_4600) { | ||
78 | tmp *= (mdiv << 16) + kdiv; | ||
79 | do_div(tmp, (pdiv << sdiv)); | ||
80 | result = tmp >> 16; | ||
81 | } else { | ||
82 | tmp *= (mdiv << 10) + kdiv; | ||
83 | do_div(tmp, (pdiv << sdiv)); | ||
84 | result = tmp >> 10; | ||
85 | } | ||
86 | |||
87 | return result; | ||
88 | } | ||
89 | |||
49 | #define PLL90XX_MDIV_MASK (0xFF) | 90 | #define PLL90XX_MDIV_MASK (0xFF) |
50 | #define PLL90XX_PDIV_MASK (0x3F) | 91 | #define PLL90XX_PDIV_MASK (0x3F) |
51 | #define PLL90XX_SDIV_MASK (0x7) | 92 | #define PLL90XX_SDIV_MASK (0x7) |
diff --git a/arch/arm/plat-s5p/include/plat/s5pv310.h b/arch/arm/plat-s5p/include/plat/s5pv310.h new file mode 100644 index 00000000000..769c991ceb3 --- /dev/null +++ b/arch/arm/plat-s5p/include/plat/s5pv310.h | |||
@@ -0,0 +1,34 @@ | |||
1 | /* linux/arch/arm/plat-s5p/include/plat/s5pv310.h | ||
2 | * | ||
3 | * Copyright (c) 2010 Samsung Electronics Co., Ltd. | ||
4 | * http://www.samsung.com/ | ||
5 | * | ||
6 | * Header file for s5pv310 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 | /* Common init code for S5PV310 related SoCs */ | ||
14 | |||
15 | extern void s5pv310_common_init_uarts(struct s3c2410_uartcfg *cfg, int no); | ||
16 | extern void s5pv310_register_clocks(void); | ||
17 | extern void s5pv310_setup_clocks(void); | ||
18 | |||
19 | #ifdef CONFIG_CPU_S5PV310 | ||
20 | |||
21 | extern int s5pv310_init(void); | ||
22 | extern void s5pv310_init_irq(void); | ||
23 | extern void s5pv310_map_io(void); | ||
24 | extern void s5pv310_init_clocks(int xtal); | ||
25 | extern struct sys_timer s5pv310_timer; | ||
26 | |||
27 | #define s5pv310_init_uarts s5pv310_common_init_uarts | ||
28 | |||
29 | #else | ||
30 | #define s5pv310_init_clocks NULL | ||
31 | #define s5pv310_init_uarts NULL | ||
32 | #define s5pv310_map_io NULL | ||
33 | #define s5pv310_init NULL | ||
34 | #endif | ||
diff --git a/arch/arm/plat-s5p/irq.c b/arch/arm/plat-s5p/irq.c index 25e1eb6de59..5560b12035d 100644 --- a/arch/arm/plat-s5p/irq.c +++ b/arch/arm/plat-s5p/irq.c | |||
@@ -56,11 +56,13 @@ static struct s3c_uart_irq uart_irqs[] = { | |||
56 | 56 | ||
57 | void __init s5p_init_irq(u32 *vic, u32 num_vic) | 57 | void __init s5p_init_irq(u32 *vic, u32 num_vic) |
58 | { | 58 | { |
59 | #ifdef CONFIG_ARM_VIC | ||
59 | int irq; | 60 | int irq; |
60 | 61 | ||
61 | /* initialize the VICs */ | 62 | /* initialize the VICs */ |
62 | for (irq = 0; irq < num_vic; irq++) | 63 | for (irq = 0; irq < num_vic; irq++) |
63 | vic_init(VA_VIC(irq), VIC_BASE(irq), vic[irq], 0); | 64 | vic_init(VA_VIC(irq), VIC_BASE(irq), vic[irq], 0); |
65 | #endif | ||
64 | 66 | ||
65 | s3c_init_vic_timer_irq(IRQ_TIMER0_VIC, IRQ_TIMER0); | 67 | s3c_init_vic_timer_irq(IRQ_TIMER0_VIC, IRQ_TIMER0); |
66 | s3c_init_vic_timer_irq(IRQ_TIMER1_VIC, IRQ_TIMER1); | 68 | s3c_init_vic_timer_irq(IRQ_TIMER1_VIC, IRQ_TIMER1); |