diff options
author | Tomasz Figa <tomasz.figa@gmail.com> | 2013-08-25 13:37:34 -0400 |
---|---|---|
committer | Kukjin Kim <kgene.kim@samsung.com> | 2013-09-16 17:48:27 -0400 |
commit | c836c90e276ec1b1b4193bb6f0b5e6b11cc69f83 (patch) | |
tree | 7aba4732b5b76ba35c3bd8e96044154135e5f891 /arch/arm/mach-s3c64xx | |
parent | 81e9c1794f24376b0515756e300476d9fec77c0b (diff) |
ARM: S3C64XX: Bypass legacy initialization when booting with DT
This patch allows bypassing most of legacy initialization when booting
an S3C64xx-based board using device tree, by adding conditional checks
for DT presence to initcalls which are no longer necessary when booting
with DT..
Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Diffstat (limited to 'arch/arm/mach-s3c64xx')
-rw-r--r-- | arch/arm/mach-s3c64xx/common.c | 12 | ||||
-rw-r--r-- | arch/arm/mach-s3c64xx/dma.c | 9 | ||||
-rw-r--r-- | arch/arm/mach-s3c64xx/irq-pm.c | 9 | ||||
-rw-r--r-- | arch/arm/mach-s3c64xx/s3c6400.c | 9 | ||||
-rw-r--r-- | arch/arm/mach-s3c64xx/s3c6410.c | 9 |
5 files changed, 48 insertions, 0 deletions
diff --git a/arch/arm/mach-s3c64xx/common.c b/arch/arm/mach-s3c64xx/common.c index 7d3cb58f1856..7a3ce4c39e5f 100644 --- a/arch/arm/mach-s3c64xx/common.c +++ b/arch/arm/mach-s3c64xx/common.c | |||
@@ -14,6 +14,10 @@ | |||
14 | * published by the Free Software Foundation. | 14 | * published by the Free Software Foundation. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | /* | ||
18 | * NOTE: Code in this file is not used when booting with Device Tree support. | ||
19 | */ | ||
20 | |||
17 | #include <linux/kernel.h> | 21 | #include <linux/kernel.h> |
18 | #include <linux/init.h> | 22 | #include <linux/init.h> |
19 | #include <linux/module.h> | 23 | #include <linux/module.h> |
@@ -203,6 +207,10 @@ void __init s3c64xx_init_io(struct map_desc *mach_desc, int size) | |||
203 | 207 | ||
204 | static __init int s3c64xx_dev_init(void) | 208 | static __init int s3c64xx_dev_init(void) |
205 | { | 209 | { |
210 | /* Not applicable when using DT. */ | ||
211 | if (of_have_populated_dt()) | ||
212 | return 0; | ||
213 | |||
206 | subsys_system_register(&s3c64xx_subsys, NULL); | 214 | subsys_system_register(&s3c64xx_subsys, NULL); |
207 | return device_register(&s3c64xx_dev); | 215 | return device_register(&s3c64xx_dev); |
208 | } | 216 | } |
@@ -404,6 +412,10 @@ static int __init s3c64xx_init_irq_eint(void) | |||
404 | { | 412 | { |
405 | int irq; | 413 | int irq; |
406 | 414 | ||
415 | /* On DT-enabled systems EINTs are handled by pinctrl-s3c64xx driver. */ | ||
416 | if (of_have_populated_dt()) | ||
417 | return -ENODEV; | ||
418 | |||
407 | for (irq = IRQ_EINT(0); irq <= IRQ_EINT(27); irq++) { | 419 | for (irq = IRQ_EINT(0); irq <= IRQ_EINT(27); irq++) { |
408 | irq_set_chip_and_handler(irq, &s3c_irq_eint, handle_level_irq); | 420 | irq_set_chip_and_handler(irq, &s3c_irq_eint, handle_level_irq); |
409 | irq_set_chip_data(irq, (void *)eint_irq_to_bit(irq)); | 421 | irq_set_chip_data(irq, (void *)eint_irq_to_bit(irq)); |
diff --git a/arch/arm/mach-s3c64xx/dma.c b/arch/arm/mach-s3c64xx/dma.c index c511dfaae148..7e22c2113816 100644 --- a/arch/arm/mach-s3c64xx/dma.c +++ b/arch/arm/mach-s3c64xx/dma.c | |||
@@ -12,6 +12,10 @@ | |||
12 | * published by the Free Software Foundation. | 12 | * published by the Free Software Foundation. |
13 | */ | 13 | */ |
14 | 14 | ||
15 | /* | ||
16 | * NOTE: Code in this file is not used when booting with Device Tree support. | ||
17 | */ | ||
18 | |||
15 | #include <linux/kernel.h> | 19 | #include <linux/kernel.h> |
16 | #include <linux/module.h> | 20 | #include <linux/module.h> |
17 | #include <linux/interrupt.h> | 21 | #include <linux/interrupt.h> |
@@ -24,6 +28,7 @@ | |||
24 | #include <linux/err.h> | 28 | #include <linux/err.h> |
25 | #include <linux/io.h> | 29 | #include <linux/io.h> |
26 | #include <linux/amba/pl080.h> | 30 | #include <linux/amba/pl080.h> |
31 | #include <linux/of.h> | ||
27 | 32 | ||
28 | #include <mach/dma.h> | 33 | #include <mach/dma.h> |
29 | #include <mach/map.h> | 34 | #include <mach/map.h> |
@@ -726,6 +731,10 @@ static int __init s3c64xx_dma_init(void) | |||
726 | { | 731 | { |
727 | int ret; | 732 | int ret; |
728 | 733 | ||
734 | /* This driver is not supported when booting with device tree. */ | ||
735 | if (of_have_populated_dt()) | ||
736 | return -ENODEV; | ||
737 | |||
729 | printk(KERN_INFO "%s: Registering DMA channels\n", __func__); | 738 | printk(KERN_INFO "%s: Registering DMA channels\n", __func__); |
730 | 739 | ||
731 | dma_pool = dma_pool_create("DMA-LLI", NULL, sizeof(struct pl080s_lli), 16, 0); | 740 | dma_pool = dma_pool_create("DMA-LLI", NULL, sizeof(struct pl080s_lli), 16, 0); |
diff --git a/arch/arm/mach-s3c64xx/irq-pm.c b/arch/arm/mach-s3c64xx/irq-pm.c index c3da1b68d03e..1649c0d1c1b8 100644 --- a/arch/arm/mach-s3c64xx/irq-pm.c +++ b/arch/arm/mach-s3c64xx/irq-pm.c | |||
@@ -12,12 +12,17 @@ | |||
12 | * published by the Free Software Foundation. | 12 | * published by the Free Software Foundation. |
13 | */ | 13 | */ |
14 | 14 | ||
15 | /* | ||
16 | * NOTE: Code in this file is not used when booting with Device Tree support. | ||
17 | */ | ||
18 | |||
15 | #include <linux/kernel.h> | 19 | #include <linux/kernel.h> |
16 | #include <linux/syscore_ops.h> | 20 | #include <linux/syscore_ops.h> |
17 | #include <linux/interrupt.h> | 21 | #include <linux/interrupt.h> |
18 | #include <linux/serial_core.h> | 22 | #include <linux/serial_core.h> |
19 | #include <linux/irq.h> | 23 | #include <linux/irq.h> |
20 | #include <linux/io.h> | 24 | #include <linux/io.h> |
25 | #include <linux/of.h> | ||
21 | 26 | ||
22 | #include <mach/map.h> | 27 | #include <mach/map.h> |
23 | 28 | ||
@@ -101,6 +106,10 @@ static struct syscore_ops s3c64xx_irq_syscore_ops = { | |||
101 | 106 | ||
102 | static __init int s3c64xx_syscore_init(void) | 107 | static __init int s3c64xx_syscore_init(void) |
103 | { | 108 | { |
109 | /* Appropriate drivers (pinctrl, uart) handle this when using DT. */ | ||
110 | if (of_have_populated_dt()) | ||
111 | return 0; | ||
112 | |||
104 | register_syscore_ops(&s3c64xx_irq_syscore_ops); | 113 | register_syscore_ops(&s3c64xx_irq_syscore_ops); |
105 | 114 | ||
106 | return 0; | 115 | return 0; |
diff --git a/arch/arm/mach-s3c64xx/s3c6400.c b/arch/arm/mach-s3c64xx/s3c6400.c index 331fe8e58145..3db0c98222f7 100644 --- a/arch/arm/mach-s3c64xx/s3c6400.c +++ b/arch/arm/mach-s3c64xx/s3c6400.c | |||
@@ -9,6 +9,10 @@ | |||
9 | * published by the Free Software Foundation. | 9 | * published by the Free Software Foundation. |
10 | */ | 10 | */ |
11 | 11 | ||
12 | /* | ||
13 | * NOTE: Code in this file is not used when booting with Device Tree support. | ||
14 | */ | ||
15 | |||
12 | #include <linux/kernel.h> | 16 | #include <linux/kernel.h> |
13 | #include <linux/types.h> | 17 | #include <linux/types.h> |
14 | #include <linux/interrupt.h> | 18 | #include <linux/interrupt.h> |
@@ -20,6 +24,7 @@ | |||
20 | #include <linux/device.h> | 24 | #include <linux/device.h> |
21 | #include <linux/serial_core.h> | 25 | #include <linux/serial_core.h> |
22 | #include <linux/platform_device.h> | 26 | #include <linux/platform_device.h> |
27 | #include <linux/of.h> | ||
23 | 28 | ||
24 | #include <asm/mach/arch.h> | 29 | #include <asm/mach/arch.h> |
25 | #include <asm/mach/map.h> | 30 | #include <asm/mach/map.h> |
@@ -76,6 +81,10 @@ static struct device s3c6400_dev = { | |||
76 | 81 | ||
77 | static int __init s3c6400_core_init(void) | 82 | static int __init s3c6400_core_init(void) |
78 | { | 83 | { |
84 | /* Not applicable when using DT. */ | ||
85 | if (of_have_populated_dt()) | ||
86 | return 0; | ||
87 | |||
79 | return subsys_system_register(&s3c6400_subsys, NULL); | 88 | return subsys_system_register(&s3c6400_subsys, NULL); |
80 | } | 89 | } |
81 | 90 | ||
diff --git a/arch/arm/mach-s3c64xx/s3c6410.c b/arch/arm/mach-s3c64xx/s3c6410.c index 7e6fa125584a..72b2278953a8 100644 --- a/arch/arm/mach-s3c64xx/s3c6410.c +++ b/arch/arm/mach-s3c64xx/s3c6410.c | |||
@@ -10,6 +10,10 @@ | |||
10 | * published by the Free Software Foundation. | 10 | * published by the Free Software Foundation. |
11 | */ | 11 | */ |
12 | 12 | ||
13 | /* | ||
14 | * NOTE: Code in this file is not used when booting with Device Tree support. | ||
15 | */ | ||
16 | |||
13 | #include <linux/kernel.h> | 17 | #include <linux/kernel.h> |
14 | #include <linux/types.h> | 18 | #include <linux/types.h> |
15 | #include <linux/interrupt.h> | 19 | #include <linux/interrupt.h> |
@@ -21,6 +25,7 @@ | |||
21 | #include <linux/device.h> | 25 | #include <linux/device.h> |
22 | #include <linux/serial_core.h> | 26 | #include <linux/serial_core.h> |
23 | #include <linux/platform_device.h> | 27 | #include <linux/platform_device.h> |
28 | #include <linux/of.h> | ||
24 | 29 | ||
25 | #include <asm/mach/arch.h> | 30 | #include <asm/mach/arch.h> |
26 | #include <asm/mach/map.h> | 31 | #include <asm/mach/map.h> |
@@ -79,6 +84,10 @@ static struct device s3c6410_dev = { | |||
79 | 84 | ||
80 | static int __init s3c6410_core_init(void) | 85 | static int __init s3c6410_core_init(void) |
81 | { | 86 | { |
87 | /* Not applicable when using DT. */ | ||
88 | if (of_have_populated_dt()) | ||
89 | return 0; | ||
90 | |||
82 | return subsys_system_register(&s3c6410_subsys, NULL); | 91 | return subsys_system_register(&s3c6410_subsys, NULL); |
83 | } | 92 | } |
84 | 93 | ||