From a08ab63761730634bbbf8f361d1a058c1f4af9c5 Mon Sep 17 00:00:00 2001 From: Ben Dooks Date: Tue, 21 Oct 2008 14:06:39 +0100 Subject: [ARM] S3C64XX: Initial arch directory Add the initial PLAT_S3C64XX support files and directory structure. Signed-off-by: Ben Dooks --- arch/arm/mach-s3c6410/Kconfig | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 arch/arm/mach-s3c6410/Kconfig (limited to 'arch/arm/mach-s3c6410') diff --git a/arch/arm/mach-s3c6410/Kconfig b/arch/arm/mach-s3c6410/Kconfig new file mode 100644 index 0000000..6ef4c94 --- /dev/null +++ b/arch/arm/mach-s3c6410/Kconfig @@ -0,0 +1,8 @@ +# arch/arm/mach-s3c6410/Kconfig +# +# Copyright 2008 Openmoko, Inc. +# Copyright 2008 Simtec Electronics +# +# Licensed under GPLv2 + +# Configuration options for the S3C6410 CPU -- cgit v1.1 From d626aeedc96e21a048f1a300cd6360f3a7be10f2 Mon Sep 17 00:00:00 2001 From: Ben Dooks Date: Tue, 21 Oct 2008 14:06:50 +0100 Subject: [ARM] S3C6410: Initial CPU support code Initial support for the Samsung S3C6410 SoC. Signed-off-by: Ben Dooks --- arch/arm/mach-s3c6410/Kconfig | 6 ++++ arch/arm/mach-s3c6410/Makefile | 16 +++++++++ arch/arm/mach-s3c6410/cpu.c | 81 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 103 insertions(+) create mode 100644 arch/arm/mach-s3c6410/Makefile create mode 100644 arch/arm/mach-s3c6410/cpu.c (limited to 'arch/arm/mach-s3c6410') diff --git a/arch/arm/mach-s3c6410/Kconfig b/arch/arm/mach-s3c6410/Kconfig index 6ef4c94..c473ba9 100644 --- a/arch/arm/mach-s3c6410/Kconfig +++ b/arch/arm/mach-s3c6410/Kconfig @@ -6,3 +6,9 @@ # Licensed under GPLv2 # Configuration options for the S3C6410 CPU + +config CPU_S3C6410 + bool + help + Enable S3C6410 CPU support + diff --git a/arch/arm/mach-s3c6410/Makefile b/arch/arm/mach-s3c6410/Makefile new file mode 100644 index 0000000..b35e04d --- /dev/null +++ b/arch/arm/mach-s3c6410/Makefile @@ -0,0 +1,16 @@ +# arch/arm/plat-s3c6410/Makefile +# +# Copyright 2008 Openmoko, Inc. +# Copyright 2008 Simtec Electronics +# +# Licensed under GPLv2 + +obj-y := +obj-m := +obj-n := +obj- := + +# Core support for S3C6410 system + +obj-$(CONFIG_CPU_S3C6410) += cpu.o + diff --git a/arch/arm/mach-s3c6410/cpu.c b/arch/arm/mach-s3c6410/cpu.c new file mode 100644 index 0000000..fbca763 --- /dev/null +++ b/arch/arm/mach-s3c6410/cpu.c @@ -0,0 +1,81 @@ +/* linux/arch/arm/mach-s3c6410/cpu.c + * + * Copyright 2008 Simtec Electronics + * Copyright 2008 Simtec Electronics + * Ben Dooks + * http://armlinux.simtec.co.uk/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +#include +#include + +#include +#include +#include +#include + +/* Initial IO mappings */ + +static struct map_desc s3c6410_iodesc[] __initdata = { +}; + +/* s3c6410_map_io + * + * register the standard cpu IO areas +*/ + +void __init s3c6410_map_io(void) +{ + iotable_init(s3c6410_iodesc, ARRAY_SIZE(s3c6410_iodesc)); +} + +void __init s3c6410_init_clocks(int xtal) +{ + printk(KERN_INFO "%s: initialising clocks\n", __func__); + s3c24xx_register_baseclocks(xtal); +} + +struct sysdev_class s3c6410_sysclass = { + .name = "s3c6410-core", +}; + +static struct sys_device s3c6410_sysdev = { + .cls = &s3c6410_sysclass, +}; + +static int __init s3c6410_core_init(void) +{ + return sysdev_class_register(&s3c6410_sysclass); +} + +core_initcall(s3c6410_core_init); + +int __init s3c6410_init(void) +{ + printk("S3C6410: Initialising architecture\n"); + + return sysdev_register(&s3c6410_sysdev); +} -- cgit v1.1 From d9b79fb56829de34eaddb01b405216eddd0d3b10 Mon Sep 17 00:00:00 2001 From: Ben Dooks Date: Tue, 21 Oct 2008 14:06:51 +0100 Subject: [ARM] S3C64XX: Add VIC0 and VIC1 sourced interripts Add and initialise the two VIC (PL192) found on the S3C64XX series CPUs. Signed-off-by: Ben Dooks --- arch/arm/mach-s3c6410/cpu.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'arch/arm/mach-s3c6410') diff --git a/arch/arm/mach-s3c6410/cpu.c b/arch/arm/mach-s3c6410/cpu.c index fbca763..c3e317c 100644 --- a/arch/arm/mach-s3c6410/cpu.c +++ b/arch/arm/mach-s3c6410/cpu.c @@ -58,6 +58,12 @@ void __init s3c6410_init_clocks(int xtal) s3c24xx_register_baseclocks(xtal); } +void __init s3c6410_init_irq(void) +{ + /* VIC0 is missing IRQ7, VIC1 is fully populated. */ + s3c64xx_init_irq(~0 & ~(1 << 7), ~0); +} + struct sysdev_class s3c6410_sysclass = { .name = "s3c6410-core", }; -- cgit v1.1 From aa64ea3f78496bcd7d72d5caffa3d0bf43e84e54 Mon Sep 17 00:00:00 2001 From: Ben Dooks Date: Tue, 21 Oct 2008 14:06:58 +0100 Subject: [ARM] S3C64XX: Common init code for S3C6400 and S3C6410 Add the common initialisation code for both the S3C6400 and S3C6410, the UART registration. Signed-off-by: Ben Dooks --- arch/arm/mach-s3c6410/Kconfig | 1 + 1 file changed, 1 insertion(+) (limited to 'arch/arm/mach-s3c6410') diff --git a/arch/arm/mach-s3c6410/Kconfig b/arch/arm/mach-s3c6410/Kconfig index c473ba9..eff8248 100644 --- a/arch/arm/mach-s3c6410/Kconfig +++ b/arch/arm/mach-s3c6410/Kconfig @@ -9,6 +9,7 @@ config CPU_S3C6410 bool + select CPU_S3C6400_INIT help Enable S3C6410 CPU support -- cgit v1.1 From 4b31d8b2256db3ed825a63603f223f84d927ca39 Mon Sep 17 00:00:00 2001 From: Ben Dooks Date: Tue, 21 Oct 2008 14:07:00 +0100 Subject: [ARM] S3C64XX: Add initial clock framework Add the initial clocks definitions for the s3c6400 and s3c6410. Move the epll and ext clock from the s3c2443 support into the common code. Signed-off-by: Ben Dooks --- arch/arm/mach-s3c6410/cpu.c | 1 + 1 file changed, 1 insertion(+) (limited to 'arch/arm/mach-s3c6410') diff --git a/arch/arm/mach-s3c6410/cpu.c b/arch/arm/mach-s3c6410/cpu.c index c3e317c..94a6204 100644 --- a/arch/arm/mach-s3c6410/cpu.c +++ b/arch/arm/mach-s3c6410/cpu.c @@ -56,6 +56,7 @@ void __init s3c6410_init_clocks(int xtal) { printk(KERN_INFO "%s: initialising clocks\n", __func__); s3c24xx_register_baseclocks(xtal); + s3c64xx_register_clocks(); } void __init s3c6410_init_irq(void) -- cgit v1.1 From cf18acf0e04260ff8ffa46dc245d3d2324ed41b0 Mon Sep 17 00:00:00 2001 From: Ben Dooks Date: Tue, 21 Oct 2008 14:07:02 +0100 Subject: [ARM] S3C64XX: Clock support for S3C6400/S3C6410 Add the PLL clock initialisation and clock registration and include the clocks sourced via CLKDIVx for most of the on-chip peripherals. Signed-off-by: Ben Dooks --- arch/arm/mach-s3c6410/Kconfig | 1 + arch/arm/mach-s3c6410/cpu.c | 3 +++ 2 files changed, 4 insertions(+) (limited to 'arch/arm/mach-s3c6410') diff --git a/arch/arm/mach-s3c6410/Kconfig b/arch/arm/mach-s3c6410/Kconfig index eff8248..d8377f7 100644 --- a/arch/arm/mach-s3c6410/Kconfig +++ b/arch/arm/mach-s3c6410/Kconfig @@ -10,6 +10,7 @@ config CPU_S3C6410 bool select CPU_S3C6400_INIT + select CPU_S3C6400_CLOCK help Enable S3C6410 CPU support diff --git a/arch/arm/mach-s3c6410/cpu.c b/arch/arm/mach-s3c6410/cpu.c index 94a6204..846f464 100644 --- a/arch/arm/mach-s3c6410/cpu.c +++ b/arch/arm/mach-s3c6410/cpu.c @@ -35,6 +35,7 @@ #include #include #include +#include #include /* Initial IO mappings */ @@ -57,6 +58,8 @@ void __init s3c6410_init_clocks(int xtal) printk(KERN_INFO "%s: initialising clocks\n", __func__); s3c24xx_register_baseclocks(xtal); s3c64xx_register_clocks(); + s3c6400_register_clocks(); + s3c6400_setup_clocks(); } void __init s3c6410_init_irq(void) -- cgit v1.1 From 5718df9dd01b4c30d21eaef08b80a3893b0fa7f3 Mon Sep 17 00:00:00 2001 From: Ben Dooks Date: Tue, 21 Oct 2008 14:07:09 +0100 Subject: [ARM] SMDK6410: Initial machine support Initial machine support for the Samsung SMDK6410. Signed-off-by: Ben Dooks --- arch/arm/mach-s3c6410/Kconfig | 5 ++ arch/arm/mach-s3c6410/Makefile | 3 ++ arch/arm/mach-s3c6410/mach-smdk6410.c | 91 +++++++++++++++++++++++++++++++++++ 3 files changed, 99 insertions(+) create mode 100644 arch/arm/mach-s3c6410/mach-smdk6410.c (limited to 'arch/arm/mach-s3c6410') diff --git a/arch/arm/mach-s3c6410/Kconfig b/arch/arm/mach-s3c6410/Kconfig index d8377f7..75b1244 100644 --- a/arch/arm/mach-s3c6410/Kconfig +++ b/arch/arm/mach-s3c6410/Kconfig @@ -14,3 +14,8 @@ config CPU_S3C6410 help Enable S3C6410 CPU support +config MACH_SMDK6410 + bool "SMDK6410" + select CPU_S3C6410 + help + Machine support for the Samsung SMDK6410 diff --git a/arch/arm/mach-s3c6410/Makefile b/arch/arm/mach-s3c6410/Makefile index b35e04d..4a20a00 100644 --- a/arch/arm/mach-s3c6410/Makefile +++ b/arch/arm/mach-s3c6410/Makefile @@ -14,3 +14,6 @@ obj- := obj-$(CONFIG_CPU_S3C6410) += cpu.o +# machine support + +obj-$(CONFIG_MACH_SMDK6410) += mach-smdk6410.o diff --git a/arch/arm/mach-s3c6410/mach-smdk6410.c b/arch/arm/mach-s3c6410/mach-smdk6410.c new file mode 100644 index 0000000..35d42e8 --- /dev/null +++ b/arch/arm/mach-s3c6410/mach-smdk6410.c @@ -0,0 +1,91 @@ +/* linux/arch/arm/mach-s3c6410/mach-smdk6410.c + * + * Copyright 2008 Openmoko, Inc. + * Copyright 2008 Simtec Electronics + * Ben Dooks + * http://armlinux.simtec.co.uk/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +#include +#include + +#include + +#include +#include +#include +#include + +#define UCON S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK +#define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB +#define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE + +static struct s3c2410_uartcfg smdk6410_uartcfgs[] __initdata = { + [0] = { + .hwport = 0, + .flags = 0, + .ucon = 0x3c5, + .ulcon = 0x03, + .ufcon = 0x51, + }, + [1] = { + .hwport = 1, + .flags = 0, + .ucon = 0x3c5, + .ulcon = 0x03, + .ufcon = 0x51, + }, +}; + +struct map_desc smdk6410_iodesc[] = {}; + +static struct platform_device *smdk6410_devices[] __initdata = { +}; + +extern void s3c64xx_init_io(struct map_desc *, int); + +static void __init smdk6410_map_io(void) +{ + s3c64xx_init_io(smdk6410_iodesc, ARRAY_SIZE(smdk6410_iodesc)); + s3c24xx_init_clocks(12000000); + s3c24xx_init_uarts(smdk6410_uartcfgs, ARRAY_SIZE(smdk6410_uartcfgs)); +} + +static void __init smdk6410_machine_init(void) +{ + platform_add_devices(smdk6410_devices, ARRAY_SIZE(smdk6410_devices)); +} + +MACHINE_START(SMDK6410, "SMDK6410") + /* Maintainer: Ben Dooks */ + .phys_io = S3C_PA_UART & 0xfff00000, + .io_pg_offst = (((u32)S3C_VA_UART) >> 18) & 0xfffc, + .boot_params = S3C64XX_PA_SDRAM + 0x100, + + .init_irq = s3c6410_init_irq, + .map_io = smdk6410_map_io, + .init_machine = smdk6410_machine_init, + .timer = &s3c24xx_timer, +MACHINE_END -- cgit v1.1 From 39669f594e75997db6a893c1e4a1c05312661fe2 Mon Sep 17 00:00:00 2001 From: Ben Dooks Date: Tue, 21 Oct 2008 14:07:12 +0100 Subject: [ARM] S3C64XX: Reduce some output from INFO to DEBUG Some of the startup output can be reduced to KERN_DEBUG from KERN_INFO as it is only really useful when trying to debug kernel initialisation problems. Signed-off-by: Ben Dooks --- arch/arm/mach-s3c6410/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/arm/mach-s3c6410') diff --git a/arch/arm/mach-s3c6410/cpu.c b/arch/arm/mach-s3c6410/cpu.c index 846f464..975cf88 100644 --- a/arch/arm/mach-s3c6410/cpu.c +++ b/arch/arm/mach-s3c6410/cpu.c @@ -55,7 +55,7 @@ void __init s3c6410_map_io(void) void __init s3c6410_init_clocks(int xtal) { - printk(KERN_INFO "%s: initialising clocks\n", __func__); + printk(KERN_DEBUG "%s: initialising clocks\n", __func__); s3c24xx_register_baseclocks(xtal); s3c64xx_register_clocks(); s3c6400_register_clocks(); -- cgit v1.1 From 6a5f4b8535868ada539ea2479d4f0a6c694b3908 Mon Sep 17 00:00:00 2001 From: Ben Dooks Date: Fri, 31 Oct 2008 16:15:01 +0000 Subject: [ARM] S3C64XX: Fix missing definition of s3c64xx_init_io() The function s3c64xx_init_io was missing from and was masked by the SMDK6410 having an local definition. Fix by removing the SMDK6410 variant and adding it to the relevant file. Signed-off-by: Ben Dooks --- arch/arm/mach-s3c6410/mach-smdk6410.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'arch/arm/mach-s3c6410') diff --git a/arch/arm/mach-s3c6410/mach-smdk6410.c b/arch/arm/mach-s3c6410/mach-smdk6410.c index 35d42e8..9213a8b 100644 --- a/arch/arm/mach-s3c6410/mach-smdk6410.c +++ b/arch/arm/mach-s3c6410/mach-smdk6410.c @@ -64,8 +64,6 @@ struct map_desc smdk6410_iodesc[] = {}; static struct platform_device *smdk6410_devices[] __initdata = { }; -extern void s3c64xx_init_io(struct map_desc *, int); - static void __init smdk6410_map_io(void) { s3c64xx_init_io(smdk6410_iodesc, ARRAY_SIZE(smdk6410_iodesc)); -- cgit v1.1