Commit c836c90e authored by Tomasz Figa's avatar Tomasz Figa Committed by Kukjin Kim

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: default avatarTomasz Figa <tomasz.figa@gmail.com>
Signed-off-by: default avatarKukjin Kim <kgene.kim@samsung.com>
parent 81e9c179
...@@ -14,6 +14,10 @@ ...@@ -14,6 +14,10 @@
* published by the Free Software Foundation. * published by the Free Software Foundation.
*/ */
/*
* NOTE: Code in this file is not used when booting with Device Tree support.
*/
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/module.h> #include <linux/module.h>
...@@ -203,6 +207,10 @@ void __init s3c64xx_init_io(struct map_desc *mach_desc, int size) ...@@ -203,6 +207,10 @@ void __init s3c64xx_init_io(struct map_desc *mach_desc, int size)
static __init int s3c64xx_dev_init(void) static __init int s3c64xx_dev_init(void)
{ {
/* Not applicable when using DT. */
if (of_have_populated_dt())
return 0;
subsys_system_register(&s3c64xx_subsys, NULL); subsys_system_register(&s3c64xx_subsys, NULL);
return device_register(&s3c64xx_dev); return device_register(&s3c64xx_dev);
} }
...@@ -404,6 +412,10 @@ static int __init s3c64xx_init_irq_eint(void) ...@@ -404,6 +412,10 @@ static int __init s3c64xx_init_irq_eint(void)
{ {
int irq; int irq;
/* On DT-enabled systems EINTs are handled by pinctrl-s3c64xx driver. */
if (of_have_populated_dt())
return -ENODEV;
for (irq = IRQ_EINT(0); irq <= IRQ_EINT(27); irq++) { for (irq = IRQ_EINT(0); irq <= IRQ_EINT(27); irq++) {
irq_set_chip_and_handler(irq, &s3c_irq_eint, handle_level_irq); irq_set_chip_and_handler(irq, &s3c_irq_eint, handle_level_irq);
irq_set_chip_data(irq, (void *)eint_irq_to_bit(irq)); irq_set_chip_data(irq, (void *)eint_irq_to_bit(irq));
......
...@@ -12,6 +12,10 @@ ...@@ -12,6 +12,10 @@
* published by the Free Software Foundation. * published by the Free Software Foundation.
*/ */
/*
* NOTE: Code in this file is not used when booting with Device Tree support.
*/
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
...@@ -24,6 +28,7 @@ ...@@ -24,6 +28,7 @@
#include <linux/err.h> #include <linux/err.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/amba/pl080.h> #include <linux/amba/pl080.h>
#include <linux/of.h>
#include <mach/dma.h> #include <mach/dma.h>
#include <mach/map.h> #include <mach/map.h>
...@@ -726,6 +731,10 @@ static int __init s3c64xx_dma_init(void) ...@@ -726,6 +731,10 @@ static int __init s3c64xx_dma_init(void)
{ {
int ret; int ret;
/* This driver is not supported when booting with device tree. */
if (of_have_populated_dt())
return -ENODEV;
printk(KERN_INFO "%s: Registering DMA channels\n", __func__); printk(KERN_INFO "%s: Registering DMA channels\n", __func__);
dma_pool = dma_pool_create("DMA-LLI", NULL, sizeof(struct pl080s_lli), 16, 0); dma_pool = dma_pool_create("DMA-LLI", NULL, sizeof(struct pl080s_lli), 16, 0);
......
...@@ -12,12 +12,17 @@ ...@@ -12,12 +12,17 @@
* published by the Free Software Foundation. * published by the Free Software Foundation.
*/ */
/*
* NOTE: Code in this file is not used when booting with Device Tree support.
*/
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/syscore_ops.h> #include <linux/syscore_ops.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/serial_core.h> #include <linux/serial_core.h>
#include <linux/irq.h> #include <linux/irq.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/of.h>
#include <mach/map.h> #include <mach/map.h>
...@@ -101,6 +106,10 @@ static struct syscore_ops s3c64xx_irq_syscore_ops = { ...@@ -101,6 +106,10 @@ static struct syscore_ops s3c64xx_irq_syscore_ops = {
static __init int s3c64xx_syscore_init(void) static __init int s3c64xx_syscore_init(void)
{ {
/* Appropriate drivers (pinctrl, uart) handle this when using DT. */
if (of_have_populated_dt())
return 0;
register_syscore_ops(&s3c64xx_irq_syscore_ops); register_syscore_ops(&s3c64xx_irq_syscore_ops);
return 0; return 0;
......
...@@ -9,6 +9,10 @@ ...@@ -9,6 +9,10 @@
* published by the Free Software Foundation. * published by the Free Software Foundation.
*/ */
/*
* NOTE: Code in this file is not used when booting with Device Tree support.
*/
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
...@@ -20,6 +24,7 @@ ...@@ -20,6 +24,7 @@
#include <linux/device.h> #include <linux/device.h>
#include <linux/serial_core.h> #include <linux/serial_core.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/of.h>
#include <asm/mach/arch.h> #include <asm/mach/arch.h>
#include <asm/mach/map.h> #include <asm/mach/map.h>
...@@ -76,6 +81,10 @@ static struct device s3c6400_dev = { ...@@ -76,6 +81,10 @@ static struct device s3c6400_dev = {
static int __init s3c6400_core_init(void) static int __init s3c6400_core_init(void)
{ {
/* Not applicable when using DT. */
if (of_have_populated_dt())
return 0;
return subsys_system_register(&s3c6400_subsys, NULL); return subsys_system_register(&s3c6400_subsys, NULL);
} }
......
...@@ -10,6 +10,10 @@ ...@@ -10,6 +10,10 @@
* published by the Free Software Foundation. * published by the Free Software Foundation.
*/ */
/*
* NOTE: Code in this file is not used when booting with Device Tree support.
*/
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
...@@ -21,6 +25,7 @@ ...@@ -21,6 +25,7 @@
#include <linux/device.h> #include <linux/device.h>
#include <linux/serial_core.h> #include <linux/serial_core.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/of.h>
#include <asm/mach/arch.h> #include <asm/mach/arch.h>
#include <asm/mach/map.h> #include <asm/mach/map.h>
...@@ -79,6 +84,10 @@ static struct device s3c6410_dev = { ...@@ -79,6 +84,10 @@ static struct device s3c6410_dev = {
static int __init s3c6410_core_init(void) static int __init s3c6410_core_init(void)
{ {
/* Not applicable when using DT. */
if (of_have_populated_dt())
return 0;
return subsys_system_register(&s3c6410_subsys, NULL); return subsys_system_register(&s3c6410_subsys, NULL);
} }
......
...@@ -11,12 +11,18 @@ ...@@ -11,12 +11,18 @@
* published by the Free Software Foundation. * published by the Free Software Foundation.
*/ */
/*
* NOTE: Code in this file is not used on S3C64xx when booting with
* Device Tree support.
*/
#include <linux/init.h> #include <linux/init.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/ioport.h> #include <linux/ioport.h>
#include <linux/serial_core.h> #include <linux/serial_core.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/of.h>
#include <mach/hardware.h> #include <mach/hardware.h>
...@@ -148,8 +154,12 @@ static int __init s3c_arch_init(void) ...@@ -148,8 +154,12 @@ static int __init s3c_arch_init(void)
// do the correct init for cpu // do the correct init for cpu
if (cpu == NULL) if (cpu == NULL) {
/* Not needed when booting with device tree. */
if (of_have_populated_dt())
return 0;
panic("s3c_arch_init: NULL cpu\n"); panic("s3c_arch_init: NULL cpu\n");
}
ret = (cpu->init)(); ret = (cpu->init)();
if (ret != 0) if (ret != 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment