From 5cbcccb370355d4cd8534796bf32ac8bb04627cc Mon Sep 17 00:00:00 2001 From: Ben Dooks Date: Tue, 26 Jan 2010 16:06:46 +0900 Subject: [PATCH 1/7] ARM: S3C24XX: Merge s3c2442 and s3c2440 machines into mach-s3c2440 Move the pair of machines in arch/arm/mach-s3c2442 into the mach-s3c2440 directory as the S3C2440 and S3C2442 are very close. Signed-off-by: Ben Dooks --- arch/arm/mach-s3c2440/Kconfig | 20 +++++++++++++++-- arch/arm/mach-s3c2440/Makefile | 1 + .../include/mach/gta02.h | 0 .../mach-gta02.c | 0 arch/arm/mach-s3c2442/Kconfig | 22 ------------------- arch/arm/mach-s3c2442/Makefile | 2 -- 6 files changed, 19 insertions(+), 26 deletions(-) rename arch/arm/{mach-s3c2442 => mach-s3c2440}/include/mach/gta02.h (100%) rename arch/arm/{mach-s3c2442 => mach-s3c2440}/mach-gta02.c (100%) diff --git a/arch/arm/mach-s3c2440/Kconfig b/arch/arm/mach-s3c2440/Kconfig index 80879358eb2f..5486929dc3d0 100644 --- a/arch/arm/mach-s3c2440/Kconfig +++ b/arch/arm/mach-s3c2440/Kconfig @@ -21,8 +21,7 @@ config S3C2440_DMA help Support for S3C2440 specific DMA code5A - -menu "S3C2440 Machines" +menu "S3C2440 and S3C2442 Machines" config MACH_ANUBIS bool "Simtec Electronics ANUBIS" @@ -37,6 +36,18 @@ config MACH_ANUBIS Say Y here if you are using the Simtec Electronics ANUBIS development system +config MACH_NEO1973_GTA02 + bool "Openmoko GTA02 / Freerunner phone" + select CPU_S3C2442 + select MFD_PCF50633 + select PCF50633_GPIO + select I2C + select POWER_SUPPLY + select MACH_NEO1973 + select S3C2410_PWM + help + Say Y here if you are using the Openmoko GTA02 / Freerunner GSM Phone + config MACH_OSIRIS bool "Simtec IM2440D20 (OSIRIS) module" select CPU_S3C2440 @@ -99,6 +110,11 @@ config SMDK2440_CPU2440 select S3C2440_XTAL_16934400 select CPU_S3C2440 +config SMDK2440_CPU2442 + bool "SMDM2440 with S3C2442 CPU module" + depends on ARCH_S3C2440 + select CPU_S3C2442 + config MACH_AT2440EVB bool "Avantech AT2440EVB development board" select CPU_S3C2440 diff --git a/arch/arm/mach-s3c2440/Makefile b/arch/arm/mach-s3c2440/Makefile index 5f3224531885..e51497ca12ea 100644 --- a/arch/arm/mach-s3c2440/Makefile +++ b/arch/arm/mach-s3c2440/Makefile @@ -23,6 +23,7 @@ obj-$(CONFIG_ARCH_S3C2440) += mach-smdk2440.o obj-$(CONFIG_MACH_NEXCODER_2440) += mach-nexcoder.o obj-$(CONFIG_MACH_AT2440EVB) += mach-at2440evb.o obj-$(CONFIG_MACH_MINI2440) += mach-mini2440.o +obj-$(CONFIG_MACH_NEO1973_GTA02) += mach-gta02.o # extra machine support diff --git a/arch/arm/mach-s3c2442/include/mach/gta02.h b/arch/arm/mach-s3c2440/include/mach/gta02.h similarity index 100% rename from arch/arm/mach-s3c2442/include/mach/gta02.h rename to arch/arm/mach-s3c2440/include/mach/gta02.h diff --git a/arch/arm/mach-s3c2442/mach-gta02.c b/arch/arm/mach-s3c2440/mach-gta02.c similarity index 100% rename from arch/arm/mach-s3c2442/mach-gta02.c rename to arch/arm/mach-s3c2440/mach-gta02.c diff --git a/arch/arm/mach-s3c2442/Kconfig b/arch/arm/mach-s3c2442/Kconfig index 8d3811852fc7..4832cd6ccfbc 100644 --- a/arch/arm/mach-s3c2442/Kconfig +++ b/arch/arm/mach-s3c2442/Kconfig @@ -13,25 +13,3 @@ config CPU_S3C2442 select CPU_LLSERIAL_S3C2440 help Support for S3C2442 Samsung Mobile CPU based systems. - - -menu "S3C2442 Machines" - -config SMDK2440_CPU2442 - bool "SMDM2440 with S3C2442 CPU module" - depends on ARCH_S3C2440 - select CPU_S3C2442 - -config MACH_NEO1973_GTA02 - bool "Openmoko GTA02 / Freerunner phone" - select CPU_S3C2442 - select MFD_PCF50633 - select PCF50633_GPIO - select I2C - select POWER_SUPPLY - select MACH_NEO1973 - select S3C2410_PWM - help - Say Y here if you are using the Openmoko GTA02 / Freerunner GSM Phone - -endmenu diff --git a/arch/arm/mach-s3c2442/Makefile b/arch/arm/mach-s3c2442/Makefile index 2a19113a5769..2a909c6c5798 100644 --- a/arch/arm/mach-s3c2442/Makefile +++ b/arch/arm/mach-s3c2442/Makefile @@ -12,7 +12,5 @@ obj- := obj-$(CONFIG_CPU_S3C2442) += s3c2442.o obj-$(CONFIG_CPU_S3C2442) += clock.o -obj-$(CONFIG_MACH_NEO1973_GTA02) += mach-gta02.o - # Machine support From 491547d43bc2393de914b5ad18b6f5219107f918 Mon Sep 17 00:00:00 2001 From: Ben Dooks Date: Tue, 26 Jan 2010 16:13:35 +0900 Subject: [PATCH 2/7] ARM: S3C2442: Merge s3c2442.c and clock.c Merge s3c2442.c and clock.c as the s3c242.c does not contain much and the clock parts are always built for s3c2442 anyway. Signed-off-by: Ben Dooks --- arch/arm/mach-s3c2442/Makefile | 1 - arch/arm/mach-s3c2442/clock.c | 153 ------------------------------- arch/arm/mach-s3c2442/s3c2442.c | 155 +++++++++++++++++++++++++++++--- 3 files changed, 143 insertions(+), 166 deletions(-) delete mode 100644 arch/arm/mach-s3c2442/clock.c diff --git a/arch/arm/mach-s3c2442/Makefile b/arch/arm/mach-s3c2442/Makefile index 2a909c6c5798..7e31ccdc83de 100644 --- a/arch/arm/mach-s3c2442/Makefile +++ b/arch/arm/mach-s3c2442/Makefile @@ -10,7 +10,6 @@ obj-n := obj- := obj-$(CONFIG_CPU_S3C2442) += s3c2442.o -obj-$(CONFIG_CPU_S3C2442) += clock.o # Machine support diff --git a/arch/arm/mach-s3c2442/clock.c b/arch/arm/mach-s3c2442/clock.c deleted file mode 100644 index d9b692a12480..000000000000 --- a/arch/arm/mach-s3c2442/clock.c +++ /dev/null @@ -1,153 +0,0 @@ -/* linux/arch/arm/mach-s3c2442/clock.c - * - * Copyright (c) 2004-2005 Simtec Electronics - * http://armlinux.simtec.co.uk/ - * Ben Dooks - * - * S3C2442 Clock support - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include - -#include -#include - -/* S3C2442 extended clock support */ - -static unsigned long s3c2442_camif_upll_round(struct clk *clk, - unsigned long rate) -{ - unsigned long parent_rate = clk_get_rate(clk->parent); - int div; - - if (rate > parent_rate) - return parent_rate; - - div = parent_rate / rate; - - if (div == 3) - return parent_rate / 3; - - /* note, we remove the +/- 1 calculations for the divisor */ - - div /= 2; - - if (div < 1) - div = 1; - else if (div > 16) - div = 16; - - return parent_rate / (div * 2); -} - -static int s3c2442_camif_upll_setrate(struct clk *clk, unsigned long rate) -{ - unsigned long parent_rate = clk_get_rate(clk->parent); - unsigned long camdivn = __raw_readl(S3C2440_CAMDIVN); - - rate = s3c2442_camif_upll_round(clk, rate); - - camdivn &= ~S3C2442_CAMDIVN_CAMCLK_DIV3; - - if (rate == parent_rate) { - camdivn &= ~S3C2440_CAMDIVN_CAMCLK_SEL; - } else if ((parent_rate / rate) == 3) { - camdivn |= S3C2440_CAMDIVN_CAMCLK_SEL; - camdivn |= S3C2442_CAMDIVN_CAMCLK_DIV3; - } else { - camdivn &= ~S3C2440_CAMDIVN_CAMCLK_MASK; - camdivn |= S3C2440_CAMDIVN_CAMCLK_SEL; - camdivn |= (((parent_rate / rate) / 2) - 1); - } - - __raw_writel(camdivn, S3C2440_CAMDIVN); - - return 0; -} - -/* Extra S3C2442 clocks */ - -static struct clk s3c2442_clk_cam = { - .name = "camif", - .id = -1, - .enable = s3c2410_clkcon_enable, - .ctrlbit = S3C2440_CLKCON_CAMERA, -}; - -static struct clk s3c2442_clk_cam_upll = { - .name = "camif-upll", - .id = -1, - .ops = &(struct clk_ops) { - .set_rate = s3c2442_camif_upll_setrate, - .round_rate = s3c2442_camif_upll_round, - }, -}; - -static int s3c2442_clk_add(struct sys_device *sysdev) -{ - struct clk *clock_upll; - struct clk *clock_h; - struct clk *clock_p; - - clock_p = clk_get(NULL, "pclk"); - clock_h = clk_get(NULL, "hclk"); - clock_upll = clk_get(NULL, "upll"); - - if (IS_ERR(clock_p) || IS_ERR(clock_h) || IS_ERR(clock_upll)) { - printk(KERN_ERR "S3C2442: Failed to get parent clocks\n"); - return -EINVAL; - } - - s3c2442_clk_cam.parent = clock_h; - s3c2442_clk_cam_upll.parent = clock_upll; - - s3c24xx_register_clock(&s3c2442_clk_cam); - s3c24xx_register_clock(&s3c2442_clk_cam_upll); - - clk_disable(&s3c2442_clk_cam); - - return 0; -} - -static struct sysdev_driver s3c2442_clk_driver = { - .add = s3c2442_clk_add, -}; - -static __init int s3c2442_clk_init(void) -{ - return sysdev_driver_register(&s3c2442_sysclass, &s3c2442_clk_driver); -} - -arch_initcall(s3c2442_clk_init); diff --git a/arch/arm/mach-s3c2442/s3c2442.c b/arch/arm/mach-s3c2442/s3c2442.c index 4663bdc7fff6..188ad1e57dc0 100644 --- a/arch/arm/mach-s3c2442/s3c2442.c +++ b/arch/arm/mach-s3c2442/s3c2442.c @@ -1,27 +1,158 @@ /* linux/arch/arm/mach-s3c2442/s3c2442.c * - * Copyright (c) 2006 Simtec Electronics - * Ben Dooks + * Copyright (c) 2004-2005 Simtec Electronics + * http://armlinux.simtec.co.uk/ + * Ben Dooks * - * Samsung S3C2442 Mobile CPU support + * S3C2442 core and lock support * * 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. + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include -#include -#include -#include #include -#include +#include +#include +#include +#include +#include +#include #include +#include +#include +#include +#include +#include -#include +#include +#include +#include + +#include + +#include #include +/* S3C2442 extended clock support */ + +static unsigned long s3c2442_camif_upll_round(struct clk *clk, + unsigned long rate) +{ + unsigned long parent_rate = clk_get_rate(clk->parent); + int div; + + if (rate > parent_rate) + return parent_rate; + + div = parent_rate / rate; + + if (div == 3) + return parent_rate / 3; + + /* note, we remove the +/- 1 calculations for the divisor */ + + div /= 2; + + if (div < 1) + div = 1; + else if (div > 16) + div = 16; + + return parent_rate / (div * 2); +} + +static int s3c2442_camif_upll_setrate(struct clk *clk, unsigned long rate) +{ + unsigned long parent_rate = clk_get_rate(clk->parent); + unsigned long camdivn = __raw_readl(S3C2440_CAMDIVN); + + rate = s3c2442_camif_upll_round(clk, rate); + + camdivn &= ~S3C2442_CAMDIVN_CAMCLK_DIV3; + + if (rate == parent_rate) { + camdivn &= ~S3C2440_CAMDIVN_CAMCLK_SEL; + } else if ((parent_rate / rate) == 3) { + camdivn |= S3C2440_CAMDIVN_CAMCLK_SEL; + camdivn |= S3C2442_CAMDIVN_CAMCLK_DIV3; + } else { + camdivn &= ~S3C2440_CAMDIVN_CAMCLK_MASK; + camdivn |= S3C2440_CAMDIVN_CAMCLK_SEL; + camdivn |= (((parent_rate / rate) / 2) - 1); + } + + __raw_writel(camdivn, S3C2440_CAMDIVN); + + return 0; +} + +/* Extra S3C2442 clocks */ + +static struct clk s3c2442_clk_cam = { + .name = "camif", + .id = -1, + .enable = s3c2410_clkcon_enable, + .ctrlbit = S3C2440_CLKCON_CAMERA, +}; + +static struct clk s3c2442_clk_cam_upll = { + .name = "camif-upll", + .id = -1, + .ops = &(struct clk_ops) { + .set_rate = s3c2442_camif_upll_setrate, + .round_rate = s3c2442_camif_upll_round, + }, +}; + +static int s3c2442_clk_add(struct sys_device *sysdev) +{ + struct clk *clock_upll; + struct clk *clock_h; + struct clk *clock_p; + + clock_p = clk_get(NULL, "pclk"); + clock_h = clk_get(NULL, "hclk"); + clock_upll = clk_get(NULL, "upll"); + + if (IS_ERR(clock_p) || IS_ERR(clock_h) || IS_ERR(clock_upll)) { + printk(KERN_ERR "S3C2442: Failed to get parent clocks\n"); + return -EINVAL; + } + + s3c2442_clk_cam.parent = clock_h; + s3c2442_clk_cam_upll.parent = clock_upll; + + s3c24xx_register_clock(&s3c2442_clk_cam); + s3c24xx_register_clock(&s3c2442_clk_cam_upll); + + clk_disable(&s3c2442_clk_cam); + + return 0; +} + +static struct sysdev_driver s3c2442_clk_driver = { + .add = s3c2442_clk_add, +}; + +static __init int s3c2442_clk_init(void) +{ + return sysdev_driver_register(&s3c2442_sysclass, &s3c2442_clk_driver); +} + +arch_initcall(s3c2442_clk_init); + + static struct sys_device s3c2442_sysdev = { .cls = &s3c2442_sysclass, }; From 1f51bbfd5905b8c860cc95ae10c20e0844d0ade8 Mon Sep 17 00:00:00 2001 From: Ben Dooks Date: Tue, 26 Jan 2010 16:27:08 +0900 Subject: [PATCH 3/7] ARM: S3C2440: Fix SMDK2440 SoC selection Fix the entries for SMDK2440 should have allowed for S3C2440 or S3C2440 SoC selection but this depended on ARCH_S3C2440 which has not been around for a while. Remove the dependency to allow this to be selected. Signed-off-by: Ben Dooks --- arch/arm/mach-s3c2440/Kconfig | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/arm/mach-s3c2440/Kconfig b/arch/arm/mach-s3c2440/Kconfig index 5486929dc3d0..45cab7af5cde 100644 --- a/arch/arm/mach-s3c2440/Kconfig +++ b/arch/arm/mach-s3c2440/Kconfig @@ -105,14 +105,12 @@ config MACH_NEXCODER_2440 config SMDK2440_CPU2440 bool "SMDK2440 with S3C2440 CPU module" - depends on ARCH_S3C2440 default y if ARCH_S3C2440 select S3C2440_XTAL_16934400 select CPU_S3C2440 config SMDK2440_CPU2442 bool "SMDM2440 with S3C2442 CPU module" - depends on ARCH_S3C2440 select CPU_S3C2442 config MACH_AT2440EVB From 916ee9249a7f19d8eb18cc9ee16ca495a517ab34 Mon Sep 17 00:00:00 2001 From: Ben Dooks Date: Tue, 26 Jan 2010 16:31:32 +0900 Subject: [PATCH 4/7] ARM: S3C244X: Move S3C2442 code into S3C2440 Move the remaining S3C2442 code into mach-s3c2440 as there is only one file currently in there and these two SoCs are very similar. Signed-off-by: Ben Dooks --- arch/arm/mach-s3c2440/Kconfig | 12 ++++++++++++ arch/arm/mach-s3c2440/Makefile | 2 ++ arch/arm/{mach-s3c2442 => mach-s3c2440}/s3c2442.c | 0 arch/arm/mach-s3c2442/Kconfig | 11 ----------- 4 files changed, 14 insertions(+), 11 deletions(-) rename arch/arm/{mach-s3c2442 => mach-s3c2440}/s3c2442.c (100%) diff --git a/arch/arm/mach-s3c2440/Kconfig b/arch/arm/mach-s3c2440/Kconfig index 45cab7af5cde..f496385e1c75 100644 --- a/arch/arm/mach-s3c2440/Kconfig +++ b/arch/arm/mach-s3c2440/Kconfig @@ -15,6 +15,18 @@ config CPU_S3C2440 help Support for S3C2440 Samsung Mobile CPU based systems. +config CPU_S3C2442 + bool + depends on ARCH_S3C2410 + select CPU_ARM920T + select S3C2410_CLOCK + select S3C2410_GPIO + select S3C2410_PM if PM + select CPU_S3C244X + select CPU_LLSERIAL_S3C2440 + help + Support for S3C2442 Samsung Mobile CPU based systems. + config S3C2440_DMA bool depends on ARCH_S3C2410 && CPU_S3C24405B diff --git a/arch/arm/mach-s3c2440/Makefile b/arch/arm/mach-s3c2440/Makefile index e51497ca12ea..e8412b35dcb0 100644 --- a/arch/arm/mach-s3c2440/Makefile +++ b/arch/arm/mach-s3c2440/Makefile @@ -10,6 +10,8 @@ obj-n := obj- := obj-$(CONFIG_CPU_S3C2440) += s3c2440.o dsc.o +obj-$(CONFIG_CPU_S3C2442) += s3c2442.o + obj-$(CONFIG_CPU_S3C2440) += irq.o obj-$(CONFIG_CPU_S3C2440) += clock.o obj-$(CONFIG_S3C2440_DMA) += dma.o diff --git a/arch/arm/mach-s3c2442/s3c2442.c b/arch/arm/mach-s3c2440/s3c2442.c similarity index 100% rename from arch/arm/mach-s3c2442/s3c2442.c rename to arch/arm/mach-s3c2440/s3c2442.c diff --git a/arch/arm/mach-s3c2442/Kconfig b/arch/arm/mach-s3c2442/Kconfig index 4832cd6ccfbc..29ef0669e959 100644 --- a/arch/arm/mach-s3c2442/Kconfig +++ b/arch/arm/mach-s3c2442/Kconfig @@ -2,14 +2,3 @@ # # Licensed under GPLv2 -config CPU_S3C2442 - bool - depends on ARCH_S3C2410 - select CPU_ARM920T - select S3C2410_CLOCK - select S3C2410_GPIO - select S3C2410_PM if PM - select CPU_S3C244X - select CPU_LLSERIAL_S3C2440 - help - Support for S3C2442 Samsung Mobile CPU based systems. From 70556b143ae4cf404a73c2461a6bf7fef3fefbf7 Mon Sep 17 00:00:00 2001 From: Ben Dooks Date: Tue, 26 Jan 2010 16:37:50 +0900 Subject: [PATCH 5/7] ARM: S3C24XX: Remove old mach-s3c2442 Remove the old mach-s3c2442 directory now all is merged into mach-s3c2440 and remove it from the arch/arm build process. Signed-off-by: Ben Dooks --- arch/arm/Kconfig | 1 - arch/arm/Makefile | 2 +- arch/arm/mach-s3c2442/Kconfig | 4 ---- arch/arm/mach-s3c2442/Makefile | 15 --------------- 4 files changed, 1 insertion(+), 21 deletions(-) delete mode 100644 arch/arm/mach-s3c2442/Kconfig delete mode 100644 arch/arm/mach-s3c2442/Makefile diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 3bc5169f0f82..63f726f594f2 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -794,7 +794,6 @@ source "arch/arm/mach-s3c2400/Kconfig" source "arch/arm/mach-s3c2410/Kconfig" source "arch/arm/mach-s3c2412/Kconfig" source "arch/arm/mach-s3c2440/Kconfig" -source "arch/arm/mach-s3c2442/Kconfig" source "arch/arm/mach-s3c2443/Kconfig" endif diff --git a/arch/arm/Makefile b/arch/arm/Makefile index bbcd512ccf7e..893bcfc77708 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile @@ -158,7 +158,7 @@ machine-$(CONFIG_ARCH_PNX4008) := pnx4008 machine-$(CONFIG_ARCH_PXA) := pxa machine-$(CONFIG_ARCH_REALVIEW) := realview machine-$(CONFIG_ARCH_RPC) := rpc -machine-$(CONFIG_ARCH_S3C2410) := s3c2410 s3c2400 s3c2412 s3c2440 s3c2442 s3c2443 +machine-$(CONFIG_ARCH_S3C2410) := s3c2410 s3c2400 s3c2412 s3c2440 s3c2443 machine-$(CONFIG_ARCH_S3C24A0) := s3c24a0 machine-$(CONFIG_ARCH_S3C64XX) := s3c6400 s3c6410 machine-$(CONFIG_ARCH_S5P6440) := s5p6440 diff --git a/arch/arm/mach-s3c2442/Kconfig b/arch/arm/mach-s3c2442/Kconfig deleted file mode 100644 index 29ef0669e959..000000000000 --- a/arch/arm/mach-s3c2442/Kconfig +++ /dev/null @@ -1,4 +0,0 @@ -# Copyright 2007 Simtec Electronics -# -# Licensed under GPLv2 - diff --git a/arch/arm/mach-s3c2442/Makefile b/arch/arm/mach-s3c2442/Makefile deleted file mode 100644 index 7e31ccdc83de..000000000000 --- a/arch/arm/mach-s3c2442/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -# arch/arm/mach-s3c2442/Makefile -# -# Copyright 2007 Simtec Electronics -# -# Licensed under GPLv2 - -obj-y := -obj-m := -obj-n := -obj- := - -obj-$(CONFIG_CPU_S3C2442) += s3c2442.o - -# Machine support - From 58bac7b8ded70c39bcd5f7037091051c277618aa Mon Sep 17 00:00:00 2001 From: Ben Dooks Date: Tue, 26 Jan 2010 16:47:41 +0900 Subject: [PATCH 6/7] ARM: S3C24XX: Move S3C2440/S3C2442 plat-s3c24xx support to mach-s3c2440 Remove the old common S3C2440 and S3C2442 SoC support from plat-s3c24xx into mach-s3c2440 now this directory is serving both SoCs. Signed-off-by: Ben Dooks --- arch/arm/mach-s3c2440/Kconfig | 42 +++++++++++++++++++ arch/arm/mach-s3c2440/Makefile | 8 ++++ .../s3c244x-clock.c | 0 .../s3c244x-irq.c | 0 .../{plat-s3c24xx => mach-s3c2440}/s3c244x.c | 2 +- arch/arm/plat-s3c24xx/Kconfig | 41 ------------------ arch/arm/plat-s3c24xx/Makefile | 7 ---- arch/arm/plat-s3c24xx/cpu.c | 2 +- .../plat-s3c24xx/{ => include/plat}/s3c244x.h | 2 +- 9 files changed, 53 insertions(+), 51 deletions(-) rename arch/arm/{plat-s3c24xx => mach-s3c2440}/s3c244x-clock.c (100%) rename arch/arm/{plat-s3c24xx => mach-s3c2440}/s3c244x-irq.c (100%) rename arch/arm/{plat-s3c24xx => mach-s3c2440}/s3c244x.c (99%) rename arch/arm/plat-s3c24xx/{ => include/plat}/s3c244x.h (92%) diff --git a/arch/arm/mach-s3c2440/Kconfig b/arch/arm/mach-s3c2440/Kconfig index f496385e1c75..7f465265cf04 100644 --- a/arch/arm/mach-s3c2440/Kconfig +++ b/arch/arm/mach-s3c2440/Kconfig @@ -27,6 +27,48 @@ config CPU_S3C2442 help Support for S3C2442 Samsung Mobile CPU based systems. +config CPU_S3C244X + bool + depends on ARCH_S3C2410 && (CPU_S3C2440 || CPU_S3C2442) + help + Support for S3C2440 and S3C2442 Samsung Mobile CPU based systems. + + + +config S3C2440_CPUFREQ + bool "S3C2440/S3C2442 CPU Frequency scaling support" + depends on CPU_FREQ_S3C24XX && (CPU_S3C2440 || CPU_S3C2442) + select S3C2410_CPUFREQ_UTILS + default y + help + CPU Frequency scaling support for S3C2440 and S3C2442 SoC CPUs. + +config S3C2440_XTAL_12000000 + bool + help + Indicate that the build needs to support 12MHz system + crystal. + +config S3C2440_XTAL_16934400 + bool + help + Indicate that the build needs to support 16.9344MHz system + crystal. + +config S3C2440_PLL_12000000 + bool + depends on S3C2440_CPUFREQ && S3C2440_XTAL_12000000 + default y if CPU_FREQ_S3C24XX_PLL + help + PLL tables for S3C2440 or S3C2442 CPUs with 12MHz crystals. + +config S3C2440_PLL_16934400 + bool + depends on S3C2440_CPUFREQ && S3C2440_XTAL_16934400 + default y if CPU_FREQ_S3C24XX_PLL + help + PLL tables for S3C2440 or S3C2442 CPUs with 16.934MHz crystals. + config S3C2440_DMA bool depends on ARCH_S3C2410 && CPU_S3C24405B diff --git a/arch/arm/mach-s3c2440/Makefile b/arch/arm/mach-s3c2440/Makefile index e8412b35dcb0..c85ba32d8956 100644 --- a/arch/arm/mach-s3c2440/Makefile +++ b/arch/arm/mach-s3c2440/Makefile @@ -16,6 +16,14 @@ obj-$(CONFIG_CPU_S3C2440) += irq.o obj-$(CONFIG_CPU_S3C2440) += clock.o obj-$(CONFIG_S3C2440_DMA) += dma.o +obj-$(CONFIG_CPU_S3C244X) += s3c244x.o +obj-$(CONFIG_CPU_S3C244X) += s3c244x-irq.o +obj-$(CONFIG_CPU_S3C244X) += s3c244x-clock.o +obj-$(CONFIG_S3C2440_CPUFREQ) += s3c2440-cpufreq.o + +obj-$(CONFIG_S3C2440_PLL_12000000) += s3c2440-pll-12000000.o +obj-$(CONFIG_S3C2440_PLL_16934400) += s3c2440-pll-16934400.o + # Machine support obj-$(CONFIG_MACH_ANUBIS) += mach-anubis.o diff --git a/arch/arm/plat-s3c24xx/s3c244x-clock.c b/arch/arm/mach-s3c2440/s3c244x-clock.c similarity index 100% rename from arch/arm/plat-s3c24xx/s3c244x-clock.c rename to arch/arm/mach-s3c2440/s3c244x-clock.c diff --git a/arch/arm/plat-s3c24xx/s3c244x-irq.c b/arch/arm/mach-s3c2440/s3c244x-irq.c similarity index 100% rename from arch/arm/plat-s3c24xx/s3c244x-irq.c rename to arch/arm/mach-s3c2440/s3c244x-irq.c diff --git a/arch/arm/plat-s3c24xx/s3c244x.c b/arch/arm/mach-s3c2440/s3c244x.c similarity index 99% rename from arch/arm/plat-s3c24xx/s3c244x.c rename to arch/arm/mach-s3c2440/s3c244x.c index 12623a474b54..46e13db03e79 100644 --- a/arch/arm/plat-s3c24xx/s3c244x.c +++ b/arch/arm/mach-s3c2440/s3c244x.c @@ -39,7 +39,7 @@ #include #include -#include "s3c244x.h" +#include #include #include #include diff --git a/arch/arm/plat-s3c24xx/Kconfig b/arch/arm/plat-s3c24xx/Kconfig index a806f359ceb6..0cc5760b668a 100644 --- a/arch/arm/plat-s3c24xx/Kconfig +++ b/arch/arm/plat-s3c24xx/Kconfig @@ -27,46 +27,6 @@ config S3C24XX_DCLK help Clock code for supporting DCLK/CLKOUT on S3C24XX architectures -config CPU_S3C244X - bool - depends on ARCH_S3C2410 && (CPU_S3C2440 || CPU_S3C2442) - help - Support for S3C2440 and S3C2442 Samsung Mobile CPU based systems. - -config S3C2440_CPUFREQ - bool "S3C2440/S3C2442 CPU Frequency scaling support" - depends on CPU_FREQ_S3C24XX && (CPU_S3C2440 || CPU_S3C2442) - select S3C2410_CPUFREQ_UTILS - default y - help - CPU Frequency scaling support for S3C2440 and S3C2442 SoC CPUs. - -config S3C2440_XTAL_12000000 - bool - help - Indicate that the build needs to support 12MHz system - crystal. - -config S3C2440_XTAL_16934400 - bool - help - Indicate that the build needs to support 16.9344MHz system - crystal. - -config S3C2440_PLL_12000000 - bool - depends on S3C2440_CPUFREQ && S3C2440_XTAL_12000000 - default y if CPU_FREQ_S3C24XX_PLL - help - PLL tables for S3C2440 or S3C2442 CPUs with 12MHz crystals. - -config S3C2440_PLL_16934400 - bool - depends on S3C2440_CPUFREQ && S3C2440_XTAL_16934400 - default y if CPU_FREQ_S3C24XX_PLL - help - PLL tables for S3C2440 or S3C2442 CPUs with 16.934MHz crystals. - config S3C24XX_PWM bool "PWM device support" select HAVE_PWM @@ -74,7 +34,6 @@ config S3C24XX_PWM Support for exporting the PWM timer blocks via the pwm device system. - # gpio configurations config S3C24XX_GPIO_EXTRA diff --git a/arch/arm/plat-s3c24xx/Makefile b/arch/arm/plat-s3c24xx/Makefile index e0100266d039..c2237c41141f 100644 --- a/arch/arm/plat-s3c24xx/Makefile +++ b/arch/arm/plat-s3c24xx/Makefile @@ -25,13 +25,6 @@ obj-$(CONFIG_CPU_FREQ_S3C24XX_DEBUGFS) += cpu-freq-debugfs.o # Architecture dependant builds -obj-$(CONFIG_CPU_S3C244X) += s3c244x.o -obj-$(CONFIG_CPU_S3C244X) += s3c244x-irq.o -obj-$(CONFIG_CPU_S3C244X) += s3c244x-clock.o -obj-$(CONFIG_S3C2440_CPUFREQ) += s3c2440-cpufreq.o -obj-$(CONFIG_S3C2440_PLL_12000000) += s3c2440-pll-12000000.o -obj-$(CONFIG_S3C2440_PLL_16934400) += s3c2440-pll-16934400.o - obj-$(CONFIG_PM_SIMTEC) += pm-simtec.o obj-$(CONFIG_PM) += pm.o obj-$(CONFIG_PM) += irq-pm.o diff --git a/arch/arm/plat-s3c24xx/cpu.c b/arch/arm/plat-s3c24xx/cpu.c index 4af9dd948793..6ecf87af9602 100644 --- a/arch/arm/plat-s3c24xx/cpu.c +++ b/arch/arm/plat-s3c24xx/cpu.c @@ -49,7 +49,7 @@ #include #include #include -#include "s3c244x.h" +#include #include #include #include diff --git a/arch/arm/plat-s3c24xx/s3c244x.h b/arch/arm/plat-s3c24xx/include/plat/s3c244x.h similarity index 92% rename from arch/arm/plat-s3c24xx/s3c244x.h rename to arch/arm/plat-s3c24xx/include/plat/s3c244x.h index 6aab5eaae2b4..8da0904c41ab 100644 --- a/arch/arm/plat-s3c24xx/s3c244x.h +++ b/arch/arm/plat-s3c24xx/include/plat/s3c244x.h @@ -1,4 +1,4 @@ -/* linux/arch/arm/plat-s3c24xx/s3c244x.h +/* linux/arch/arm/plat-s3c24xx/include/plat/s3c244x.h * * Copyright (c) 2004-2005 Simtec Electronics * Ben Dooks From 84c9b7271a0af08c4e5fce3901a0ad3d952036bc Mon Sep 17 00:00:00 2001 From: Ben Dooks Date: Tue, 26 Jan 2010 16:54:21 +0900 Subject: [PATCH 7/7] ARM: S3C244X: Merge plat-s3c24xx s3c2440.h and s3c2442.h into s3c244x.h Merge these two headers into one, these two SoCs are so similar. Note, correct fault in mach-smdk2443.h including the wrong header. Signed-off-by: Ben Dooks --- arch/arm/mach-s3c2440/dsc.c | 2 +- arch/arm/mach-s3c2440/mach-nexcoder.c | 2 +- arch/arm/mach-s3c2440/mach-smdk2440.c | 2 +- arch/arm/mach-s3c2440/s3c2440.c | 2 +- arch/arm/mach-s3c2440/s3c244x.c | 1 - arch/arm/mach-s3c2443/mach-smdk2443.c | 2 +- arch/arm/plat-s3c24xx/cpu.c | 2 -- arch/arm/plat-s3c24xx/include/plat/s3c2440.h | 17 ----------------- arch/arm/plat-s3c24xx/include/plat/s3c2442.h | 17 ----------------- arch/arm/plat-s3c24xx/include/plat/s3c244x.h | 12 ++++++++++++ 10 files changed, 17 insertions(+), 42 deletions(-) delete mode 100644 arch/arm/plat-s3c24xx/include/plat/s3c2440.h delete mode 100644 arch/arm/plat-s3c24xx/include/plat/s3c2442.h diff --git a/arch/arm/mach-s3c2440/dsc.c b/arch/arm/mach-s3c2440/dsc.c index 554044272771..9ea66e31f626 100644 --- a/arch/arm/mach-s3c2440/dsc.c +++ b/arch/arm/mach-s3c2440/dsc.c @@ -28,7 +28,7 @@ #include #include -#include +#include int s3c2440_set_dsc(unsigned int pin, unsigned int value) { diff --git a/arch/arm/mach-s3c2440/mach-nexcoder.c b/arch/arm/mach-s3c2440/mach-nexcoder.c index 86a243b3e37d..342041593f22 100644 --- a/arch/arm/mach-s3c2440/mach-nexcoder.c +++ b/arch/arm/mach-s3c2440/mach-nexcoder.c @@ -41,7 +41,7 @@ #include #include -#include +#include #include #include #include diff --git a/arch/arm/mach-s3c2440/mach-smdk2440.c b/arch/arm/mach-s3c2440/mach-smdk2440.c index df3e9a3be82f..3ac3d636d615 100644 --- a/arch/arm/mach-s3c2440/mach-smdk2440.c +++ b/arch/arm/mach-s3c2440/mach-smdk2440.c @@ -40,7 +40,7 @@ #include #include -#include +#include #include #include #include diff --git a/arch/arm/mach-s3c2440/s3c2440.c b/arch/arm/mach-s3c2440/s3c2440.c index ac1f7ea5f405..2b68f7ea45ae 100644 --- a/arch/arm/mach-s3c2440/s3c2440.c +++ b/arch/arm/mach-s3c2440/s3c2440.c @@ -29,9 +29,9 @@ #include #include -#include #include #include +#include static struct sys_device s3c2440_sysdev = { .cls = &s3c2440_sysclass, diff --git a/arch/arm/mach-s3c2440/s3c244x.c b/arch/arm/mach-s3c2440/s3c244x.c index 46e13db03e79..5e4a97e76533 100644 --- a/arch/arm/mach-s3c2440/s3c244x.c +++ b/arch/arm/mach-s3c2440/s3c244x.c @@ -38,7 +38,6 @@ #include #include -#include #include #include #include diff --git a/arch/arm/mach-s3c2443/mach-smdk2443.c b/arch/arm/mach-s3c2443/mach-smdk2443.c index 039a46243105..d65afdee59c5 100644 --- a/arch/arm/mach-s3c2443/mach-smdk2443.c +++ b/arch/arm/mach-s3c2443/mach-smdk2443.c @@ -40,7 +40,7 @@ #include #include -#include +#include #include #include #include diff --git a/arch/arm/plat-s3c24xx/cpu.c b/arch/arm/plat-s3c24xx/cpu.c index 6ecf87af9602..9ca64df35bf6 100644 --- a/arch/arm/plat-s3c24xx/cpu.c +++ b/arch/arm/plat-s3c24xx/cpu.c @@ -50,8 +50,6 @@ #include #include #include -#include -#include #include /* table of supported CPUs */ diff --git a/arch/arm/plat-s3c24xx/include/plat/s3c2440.h b/arch/arm/plat-s3c24xx/include/plat/s3c2440.h deleted file mode 100644 index 107853bf9481..000000000000 --- a/arch/arm/plat-s3c24xx/include/plat/s3c2440.h +++ /dev/null @@ -1,17 +0,0 @@ -/* linux/include/asm-arm/plat-s3c24xx/s3c2440.h - * - * Copyright (c) 2004-2005 Simtec Electronics - * Ben Dooks - * - * Header file for s3c2440 cpu support - * - * 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. -*/ - -#ifdef CONFIG_CPU_S3C2440 -extern int s3c2440_init(void); -#else -#define s3c2440_init NULL -#endif diff --git a/arch/arm/plat-s3c24xx/include/plat/s3c2442.h b/arch/arm/plat-s3c24xx/include/plat/s3c2442.h deleted file mode 100644 index 451a23a2092a..000000000000 --- a/arch/arm/plat-s3c24xx/include/plat/s3c2442.h +++ /dev/null @@ -1,17 +0,0 @@ -/* linux/include/asm-arm/plat-s3c24xx/s3c2442.h - * - * Copyright (c) 2006 Simtec Electronics - * Ben Dooks - * - * Header file for s3c2442 cpu support - * - * 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. -*/ - -#ifdef CONFIG_CPU_S3C2442 -extern int s3c2442_init(void); -#else -#define s3c2442_init NULL -#endif diff --git a/arch/arm/plat-s3c24xx/include/plat/s3c244x.h b/arch/arm/plat-s3c24xx/include/plat/s3c244x.h index 8da0904c41ab..307248d1ccbb 100644 --- a/arch/arm/plat-s3c24xx/include/plat/s3c244x.h +++ b/arch/arm/plat-s3c24xx/include/plat/s3c244x.h @@ -23,3 +23,15 @@ extern void s3c244x_init_clocks(int xtal); #define s3c244x_init_uarts NULL #define s3c244x_map_io NULL #endif + +#ifdef CONFIG_CPU_S3C2440 +extern int s3c2440_init(void); +#else +#define s3c2440_init NULL +#endif + +#ifdef CONFIG_CPU_S3C2442 +extern int s3c2442_init(void); +#else +#define s3c2442_init NULL +#endif