S3C24XX: remove global plat/s3c24??.h SoC-headers
Subsystems (4)
cover S3C24XX: remove global plat/s3c24??.h SoC-headers
The plat-samsung/s3c24??.h headers contain function declarations that are mostly private to the relevant SoCs.
This patchset follows the work started by Kukjin Kim for newer Samsung-SoCs and moves them from a global space to their SoC directories as common.h .
The the only non-mach user of these files is plat-s3c24xx/cpu.c . It seemes to have been built to generalize the init of S3C24XX-SoCs, but in reality its savings are rather low and introduce ifdef-voodoo to distinguish between S3C2412 and S3C2416.
Therefore the series introduces common.c files for these SoCs, that now contain the SoC-specific cpu-init - the relevant parts of the cpu.c code. cpu.c is completely removed at the end of the series.
The number of lines add + deleted is mostly equal and the positive diffstat results from the added GPL headers to the common.c files for the most part. Another sign of low savings in the cpu.c abstraction.
As always, each patch is compile-tested individually and correctnes of the move was tested on s3c2416 hardware - so hopefully I did not break any other of the touched SoCs.
As with the newer SoCs more common code can move into the common.c files later on.
The series is based on the linux-samsung/for-next branch of 2012-01-02, as it needs the restart patches, that create the common.h for some SoCs.
Heiko Stuebner (8):
S3C24XX: Remove extern declaration of clk_msysclk
S3C24XX: move common S3C2443 clock definitions to clock.h
S3C2410: move s3c2410_baseclk_add to clock.h
S3C2416: move io-init to SoC specific files
S3C2443: move io-init to SoC specific files
S3C2440: move io-init to SoC specific files
S3C2412: move io-init to SoC specific files
S3C2410: move io-init to SoC specific files
arch/arm/mach-s3c2410/Makefile | 2 +- arch/arm/mach-s3c2410/common.c | 80 ++++++++++ arch/arm/mach-s3c2410/common.h | 11 ++ arch/arm/mach-s3c2410/mach-amlm5900.c | 2 +- arch/arm/mach-s3c2410/mach-bast.c | 2 +- arch/arm/mach-s3c2410/mach-h1940.c | 2 +- arch/arm/mach-s3c2410/mach-n30.c | 3 +- arch/arm/mach-s3c2410/mach-otom.c | 3 +- arch/arm/mach-s3c2410/mach-qt2410.c | 2 +- arch/arm/mach-s3c2410/mach-smdk2410.c | 2 +- arch/arm/mach-s3c2410/mach-tct_hammer.c | 2 +- arch/arm/mach-s3c2410/mach-vr1000.c | 2 +- arch/arm/mach-s3c2410/s3c2410.c | 3 +- arch/arm/mach-s3c2412/Makefile | 2 +- arch/arm/mach-s3c2412/clock.c | 3 +- arch/arm/mach-s3c2412/common.c | 79 ++++++++++ arch/arm/mach-s3c2412/common.h | 30 ++++ arch/arm/mach-s3c2412/mach-jive.c | 5 +- arch/arm/mach-s3c2412/mach-smdk2413.c | 6 +- arch/arm/mach-s3c2412/mach-vstms.c | 5 +- arch/arm/mach-s3c2412/pm.c | 2 +- arch/arm/mach-s3c2412/s3c2412.c | 3 +- arch/arm/mach-s3c2416/Makefile | 2 +- arch/arm/mach-s3c2416/clock.c | 4 +- arch/arm/mach-s3c2416/common.c | 70 +++++++++ arch/arm/mach-s3c2416/common.h | 30 ++++ arch/arm/mach-s3c2416/mach-smdk2416.c | 6 +- arch/arm/mach-s3c2416/s3c2416.c | 3 +- arch/arm/mach-s3c2440/Makefile | 2 +- arch/arm/mach-s3c2440/common.c | 100 ++++++++++++ arch/arm/mach-s3c2440/common.h | 20 +++ arch/arm/mach-s3c2440/dsc.c | 2 +- arch/arm/mach-s3c2440/mach-anubis.c | 2 +- arch/arm/mach-s3c2440/mach-at2440evb.c | 2 +- arch/arm/mach-s3c2440/mach-gta02.c | 2 +- arch/arm/mach-s3c2440/mach-mini2440.c | 2 +- arch/arm/mach-s3c2440/mach-nexcoder.c | 4 +- arch/arm/mach-s3c2440/mach-osiris.c | 2 +- arch/arm/mach-s3c2440/mach-rx1950.c | 2 +- arch/arm/mach-s3c2440/mach-rx3715.c | 2 +- arch/arm/mach-s3c2440/mach-smdk2440.c | 4 +- arch/arm/mach-s3c2440/s3c2440.c | 3 +- arch/arm/mach-s3c2440/s3c2442.c | 3 +- arch/arm/mach-s3c2440/s3c244x.c | 4 +- arch/arm/mach-s3c2443/Makefile | 2 +- arch/arm/mach-s3c2443/clock.c | 3 +- arch/arm/mach-s3c2443/common.c | 70 +++++++++ arch/arm/mach-s3c2443/common.h | 31 ++++ arch/arm/mach-s3c2443/mach-smdk2443.c | 6 +- arch/arm/mach-s3c2443/s3c2443.c | 3 +- arch/arm/plat-s3c24xx/Makefile | 1 - arch/arm/plat-s3c24xx/cpu.c | 208 -------------------------- arch/arm/plat-s3c24xx/s3c2410-clock.c | 1 - arch/arm/plat-s3c24xx/s3c2443-clock.c | 1 - arch/arm/plat-samsung/include/plat/clock.h | 22 +++ arch/arm/plat-samsung/include/plat/cpu.h | 2 - arch/arm/plat-samsung/include/plat/s3c2410.h | 33 ---- arch/arm/plat-samsung/include/plat/s3c2412.h | 32 ---- arch/arm/plat-samsung/include/plat/s3c2416.h | 33 ---- arch/arm/plat-samsung/include/plat/s3c2443.h | 54 ------- arch/arm/plat-samsung/include/plat/s3c244x.h | 42 ----- 61 files changed, 603 insertions(+), 463 deletions(-) create mode 100644 arch/arm/mach-s3c2410/common.c create mode 100644 arch/arm/mach-s3c2412/common.c create mode 100644 arch/arm/mach-s3c2412/common.h create mode 100644 arch/arm/mach-s3c2416/common.c create mode 100644 arch/arm/mach-s3c2416/common.h create mode 100644 arch/arm/mach-s3c2440/common.c create mode 100644 arch/arm/mach-s3c2443/common.c create mode 100644 arch/arm/mach-s3c2443/common.h delete mode 100644 arch/arm/plat-s3c24xx/cpu.c delete mode 100644 arch/arm/plat-samsung/include/plat/s3c2410.h delete mode 100644 arch/arm/plat-samsung/include/plat/s3c2412.h delete mode 100644 arch/arm/plat-samsung/include/plat/s3c2416.h delete mode 100644 arch/arm/plat-samsung/include/plat/s3c2443.h delete mode 100644 arch/arm/plat-samsung/include/plat/s3c244x.h
Signature · 1 line
1.7.5.4
PATCH 1/8 S3C24XX: Remove extern declaration of clk_msysclk
clk_msysclk is not needed outside of s3c2443-clock.c.
Removing the extern declaration will prevent conflicts with the s3c2412 clk_msysclk in the following cleanups.
--- arch/arm/plat-samsung/include/plat/s3c2443.h | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)
arch/arm/plat-samsung/include/plat/s3c2443.h +0 -1
@@ -51,4 +51,3 @@ extern int s3c2443_clkcon_enable_s(struct clk *clk, int enable);extern struct clksrc_clk clk_epllref;extern struct clksrc_clk clk_esysclk; -extern struct clksrc_clk clk_msysclk;
Signature · 1 line
1.7.5.4
PATCH 2/8 S3C24XX: move common S3C2443 clock definitions to clock.h
In reply to Heiko Stübnerplat-samsung/clock.h currently keeps all the SoC specific clock declarations except the ones for S3C2443/S3C2416 which were kept in s3c2443.h.
This patch moves them out of s3c2443.h to get rid of the header completely later on.
--- arch/arm/mach-s3c2416/clock.c | 1 - arch/arm/plat-s3c24xx/s3c2443-clock.c | 1 - arch/arm/plat-samsung/include/plat/clock.h | 19 +++++++++++++++++++ arch/arm/plat-samsung/include/plat/s3c2443.h | 19 ------------------- 4 files changed, 19 insertions(+), 21 deletions(-)
arch/arm/mach-s3c2416/clock.c +0 -1
@@ -15,7 +15,6 @@#include <linux/clk.h> #include <plat/s3c2416.h> -#include <plat/s3c2443.h> #include <plat/clock.h> #include <plat/clock-clksrc.h> #include <plat/cpu.h>
arch/arm/plat-s3c24xx/s3c2443-clock.c +0 -1
@@ -12,7 +12,6 @@#include <mach/regs-s3c2443-clock.h> -#include <plat/s3c2443.h> #include <plat/clock.h> #include <plat/clock-clksrc.h> #include <plat/cpu.h>
arch/arm/plat-samsung/include/plat/clock.h +19 -0
@@ -79,6 +79,10 @@ extern struct clk clk_epll;extern struct clk clk_xtal;extern struct clk clk_ext; +/* S3C2443/S3C2416 specific clocks */ +extern struct clksrc_clk clk_epllref; +extern struct clksrc_clk clk_esysclk; +/* S3C64XX specific clocks */ extern struct clk clk_h2;extern struct clk clk_27m;
@@ -116,6 +120,21 @@ extern void s3c2412_setup_clocks(void);extern void s3c244x_setup_clocks (void );extern void s3c2443_setup_clocks (void ); + +/* S3C2443/S3C2416 specific clock functions */ + +typedef unsigned int (*pll_fn )(unsigned int reg,unsigned int base); + +extern void s3c2443_common_setup_clocks (pll_fn get_mpll); +extern void s3c2443_common_init_clocks (int xtal,pll_fn get_mpll, +unsigned int *divs,int nr_divs, +int divmask); + +extern int s3c2443_clkcon_enable_h (struct clk *clk,int enable); +extern int s3c2443_clkcon_enable_p (struct clk *clk,int enable); +extern int s3c2443_clkcon_enable_s (struct clk *clk,int enable); + +/* S3C64XX specific functions and clocks */ extern int s3c64xx_sclk_ctrl (struct clk *clk,int enable);
arch/arm/plat-samsung/include/plat/s3c2443.h +0 -19
@@ -32,22 +32,3 @@ extern void s3c2443_restart(char mode, const char *cmd);#define s3c2443_init NULL#define s3c2443_restart NULL#endif - -/* common code used by s3c2443 and others. -* note, not to be used outside of arch/arm/mach-s3c* */ - -struct clk ;/* some files don't need clk.h otherwise */ - -typedef unsigned int (*pll_fn )(unsigned int reg,unsigned int base); - -extern void s3c2443_common_setup_clocks (pll_fn get_mpll); -extern void s3c2443_common_init_clocks (int xtal,pll_fn get_mpll, -unsigned int *divs,int nr_divs, -int divmask); - -extern int s3c2443_clkcon_enable_h (struct clk *clk,int enable); -extern int s3c2443_clkcon_enable_p (struct clk *clk,int enable); -extern int s3c2443_clkcon_enable_s (struct clk *clk,int enable); - -extern struct clksrc_clk clk_epllref; -extern struct clksrc_clk clk_esysclk;
Signature · 1 line
1.7.5.4
PATCH 3/8 S3C2410: move s3c2410_baseclk_add to clock.h
In reply to Heiko Stübnerplat-samsung/clock.h currently keeps all the SoC specific clock declarations. As we want to get rid of s3c2410.h altogether, move the s3c2410_baseclk_add there too.
--- arch/arm/plat-samsung/include/plat/clock.h | 3 +++ arch/arm/plat-samsung/include/plat/s3c2410.h | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-)
arch/arm/plat-samsung/include/plat/clock.h +3 -0
@@ -120,6 +120,9 @@ extern void s3c2412_setup_clocks(void);extern void s3c244x_setup_clocks (void );extern void s3c2443_setup_clocks (void ); +/* S3C2410 specific clock functions */ + +extern int s3c2410_baseclk_add (void );/* S3C2443/S3C2416 specific clock functions */
arch/arm/plat-samsung/include/plat/s3c2410.h +0 -2
@@ -29,5 +29,3 @@ extern void s3c2410_init_clocks(int xtal);#define s3c2410_init NULL#define s3c2410a_init NULL#endif - -extern int s3c2410_baseclk_add (void );
Signature · 1 line
1.7.5.4
PATCH 4/8 S3C2416: move io-init to SoC specific files
In reply to Heiko StübnerIntroduce common.h/common.c to replace calls to s3c24xx_init_io and make the s3c2416.h header obsolete.
This also removes a cpu-specific ifdef in the common init function.
--- arch/arm/mach-s3c2416/Makefile | 2 +- arch/arm/mach-s3c2416/clock.c | 3 +- arch/arm/mach-s3c2416/common.c | 70 ++++++++++++++++++++++++++ arch/arm/mach-s3c2416/common.h | 30 +++++++++++ arch/arm/mach-s3c2416/mach-smdk2416.c | 6 ++- arch/arm/mach-s3c2416/s3c2416.c | 3 +- arch/arm/plat-s3c24xx/cpu.c | 21 -------- arch/arm/plat-samsung/include/plat/s3c2416.h | 33 ------------ 8 files changed, 109 insertions(+), 59 deletions(-) create mode 100644 arch/arm/mach-s3c2416/common.c create mode 100644 arch/arm/mach-s3c2416/common.h delete mode 100644 arch/arm/plat-samsung/include/plat/s3c2416.h
arch/arm/mach-s3c2416/Makefile +1 -1
@@ -9,7 +9,7 @@ obj-m := obj-n := obj- := -obj-$(CONFIG_CPU_S3C2416) += s3c2416.o clock.o +obj-$(CONFIG_CPU_S3C2416) += s3c2416.o clock.o common.o obj-$(CONFIG_CPU_S3C2416) += irq.o obj-$(CONFIG_S3C2416_PM) += pm.o #obj-$(CONFIG_S3C2416_DMA) += dma.o
arch/arm/mach-s3c2416/clock.c +2 -1
@@ -14,7 +14,6 @@#include <linux/init.h> #include <linux/clk.h> -#include <plat/s3c2416.h> #include <plat/clock.h> #include <plat/clock-clksrc.h> #include <plat/cpu.h>
@@ -27,6 +26,8 @@#include <mach/regs-clock.h> #include <mach/regs-s3c2443-clock.h> +#include "common.h" +/* armdiv * * this clock is sourced from msysclk and can have a number of
arch/arm/mach-s3c2416/common.c new file +70 -0
70 lines not on this page · raw message
arch/arm/mach-s3c2416/common.h new file +30 -0
@@ -0,0 +1,30 @@ +/* +* Copyright (c) 2009 Yauhen Kharuzhy <[email protected]> +* +* Header file for s3c2416 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. +*/ + +#ifndef __ARCH_ARM_MACH_S3C2416_COMMON_H +#define __ARCH_ARM_MACH_S3C2416_COMMON_H + +struct s3c2410_uartcfg ; + +extern int s3c2416_init (void ); + +extern void s3c2416_map_io (void ); + +extern void s3c2416_init_uarts (struct s3c2410_uartcfg *cfg,int no); + +extern void s3c2416_init_clocks (int xtal); + +extern int s3c2416_baseclk_add (void ); + +extern void s3c2416_restart (char mode,const char *cmd); + +extern void s3c2416_init_io (struct map_desc *mach_desc,int size); + +#endif
arch/arm/mach-s3c2416/mach-smdk2416.c +4 -2
@@ -42,7 +42,6 @@#include <mach/leds-gpio.h> #include <plat/iic.h> -#include <plat/s3c2416.h> #include <plat/gpio-cfg.h> #include <plat/clock.h> #include <plat/devs.h>
@@ -56,6 +55,8 @@#include <plat/common-smdk.h> +#include "common.h" +static struct map_desc smdk2416_iodesc[]__initdata = {/* ISA IO Space map (memory space selected by A24) */
@@ -215,7 +216,8 @@ static struct platform_device *smdk2416_devices[] __initdata = {static void __init smdk2416_map_io (void ) { -s3c24xx_init_io (smdk2416_iodesc,ARRAY_SIZE (smdk2416_iodesc)); +s3c2416_init_io (smdk2416_iodesc,ARRAY_SIZE (smdk2416_iodesc)); +s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (smdk2416_uartcfgs,ARRAY_SIZE (smdk2416_uartcfgs)); }
arch/arm/mach-s3c2416/s3c2416.c +2 -1
@@ -50,7 +50,6 @@#include <plat/gpio-core.h> #include <plat/gpio-cfg.h> #include <plat/gpio-cfg-helpers.h> -#include <plat/s3c2416.h> #include <plat/devs.h> #include <plat/cpu.h> #include <plat/sdhci.h>
@@ -62,6 +61,8 @@#include <plat/adc-core.h> #include <plat/rtc-core.h> +#include "common.h" +static struct map_desc s3c2416_iodesc[]__initdata = {IODESC_ENT (WATCHDOG ),IODESC_ENT (CLKPWR ),
arch/arm/plat-s3c24xx/cpu.c +0 -21
@@ -47,7 +47,6 @@#include <plat/clock.h> #include <plat/s3c2410.h> #include <plat/s3c2412.h> -#include <plat/s3c2416.h> #include <plat/s3c244x.h> #include <plat/s3c2443.h>
@@ -55,7 +54,6 @@static const char name_s3c2410[] ="S3C2410" ;static const char name_s3c2412[] ="S3C2412" ; -static const char name_s3c2416[] ="S3C2416/S3C2450" ;static const char name_s3c2440[] ="S3C2440" ;static const char name_s3c2442[] ="S3C2442" ;static const char name_s3c2442b[] ="S3C2442B" ;
@@ -136,15 +134,6 @@ static struct cpu_table cpu_ids[] __initdata = { .init = s3c2412_init, .name = name_s3c2412, }, - {/* a strange version of the s3c2416 */ - .idcode = 0x32450003, - .idmask = 0xffffffff, - .map_io = s3c2416_map_io, - .init_clocks = s3c2416_init_clocks, - .init_uarts = s3c2416_init_uarts, - .init = s3c2416_init, - .name = name_s3c2416, - }, { .idcode = 0x32443001, .idmask = 0xffffffff,
@@ -169,16 +158,6 @@ static struct map_desc s3c_iodesc[] __initdata = {static unsigned long s3c24xx_read_idcode_v5 (void ) { -#if defined(CONFIG_CPU_S3C2416 ) -/* s3c2416 is v5, with S3C24XX_GSTATUS1 instead of S3C2412_GSTATUS1 */ - -u32 gs =__raw_readl (S3C24XX_GSTATUS1 ); - -/* test for s3c2416 or similar device */ -if ((gs >>16 ) ==0x3245 ) -return gs; -#endif -#if defined(CONFIG_CPU_S3C2412 ) || defined(CONFIG_CPU_S3C2413 )return __raw_readl (S3C2412_GSTATUS1 );#else
arch/arm/plat-samsung/include/plat/s3c2416.h deleted +0 -33
@@ -1,33 +0,0 @@ -/* linux/arch/arm/plat-samsung/include/plat/s3c2416.h -* -* Copyright (c) 2009 Yauhen Kharuzhy <[email protected]> -* -* Header file for s3c2416 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_S3C2416 - -struct s3c2410_uartcfg ; - -extern int s3c2416_init (void ); - -extern void s3c2416_map_io (void ); - -extern void s3c2416_init_uarts (struct s3c2410_uartcfg *cfg,int no); - -extern void s3c2416_init_clocks (int xtal); - -extern int s3c2416_baseclk_add (void ); - -extern void s3c2416_restart (char mode,const char *cmd); -#else -#define s3c2416_init_clocks NULL -#define s3c2416_init_uarts NULL -#define s3c2416_map_io NULL -#define s3c2416_init NULL -#define s3c2416_restart NULL -#endif
Signature · 1 line
1.7.5.4
PATCH 5/8 S3C2443: move io-init to SoC specific files
In reply to Heiko StübnerIntroduce common.h/common.c to replace calls to s3c24xx_init_io and make the s3c2443.h header obsolete.
--- arch/arm/mach-s3c2443/Makefile | 2 +- arch/arm/mach-s3c2443/clock.c | 3 +- arch/arm/mach-s3c2443/common.c | 70 ++++++++++++++++++++++++++ arch/arm/mach-s3c2443/common.h | 31 +++++++++++ arch/arm/mach-s3c2443/mach-smdk2443.c | 5 +- arch/arm/mach-s3c2443/s3c2443.c | 3 +- arch/arm/plat-s3c24xx/cpu.c | 11 ---- arch/arm/plat-samsung/include/plat/s3c2443.h | 34 ------------ 8 files changed, 109 insertions(+), 50 deletions(-) create mode 100644 arch/arm/mach-s3c2443/common.c create mode 100644 arch/arm/mach-s3c2443/common.h delete mode 100644 arch/arm/plat-samsung/include/plat/s3c2443.h
arch/arm/mach-s3c2443/Makefile +1 -1
@@ -9,7 +9,7 @@ obj-m := obj-n := obj- := -obj-$(CONFIG_CPU_S3C2443) += s3c2443.o +obj-$(CONFIG_CPU_S3C2443) += s3c2443.o common.o obj-$(CONFIG_CPU_S3C2443) += irq.o obj-$(CONFIG_CPU_S3C2443) += clock.o
arch/arm/mach-s3c2443/clock.c +2 -1
@@ -41,11 +41,12 @@#include <plat/cpu-freq.h> -#include <plat/s3c2443.h> #include <plat/clock.h> #include <plat/clock-clksrc.h> #include <plat/cpu.h> +#include "common.h" +/* We currently have to assume that the system is running * from the XTPll input, and that all ***REFCLKs are being * fed from it, as we cannot read the state of OM[4] from
arch/arm/mach-s3c2443/common.c new file +70 -0
70 lines not on this page · raw message
arch/arm/mach-s3c2443/common.h new file +31 -0
@@ -0,0 +1,31 @@ +/* +* Copyright (c) 2004-2005 Simtec Electronics +* Ben Dooks <[email protected]> +* +* Header file for s3c2443 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. +*/ + +#ifndef __ARCH_ARM_MACH_S3C2443_COMMON_H +#define __ARCH_ARM_MACH_S3C2443_COMMON_H + +struct s3c2410_uartcfg ; + +extern int s3c2443_init (void ); + +extern void s3c2443_map_io (void ); + +extern void s3c2443_init_uarts (struct s3c2410_uartcfg *cfg,int no); + +extern void s3c2443_init_clocks (int xtal); + +extern int s3c2443_baseclk_add (void ); + +extern void s3c2443_restart (char mode,const char *cmd); + +extern void s3c2443_init_io (struct map_desc *mach_desc,int size); + +#endif
arch/arm/mach-s3c2443/mach-smdk2443.c +3 -2
@@ -40,13 +40,14 @@#include <plat/iic.h> #include <plat/s3c2410.h> -#include <plat/s3c2443.h> #include <plat/clock.h> #include <plat/devs.h> #include <plat/cpu.h> #include <plat/common-smdk.h> +#include "common.h" +static struct map_desc smdk2443_iodesc[]__initdata = {/* ISA IO Space map (memory space selected by A24) */
@@ -120,7 +121,7 @@ static struct platform_device *smdk2443_devices[] __initdata = {static void __init smdk2443_map_io (void ) { -s3c24xx_init_io (smdk2443_iodesc,ARRAY_SIZE (smdk2443_iodesc)); +s3c2443_init_io (smdk2443_iodesc,ARRAY_SIZE (smdk2443_iodesc));s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (smdk2443_uartcfgs,ARRAY_SIZE (smdk2443_uartcfgs)); }
arch/arm/mach-s3c2443/s3c2443.c +2 -1
@@ -35,7 +35,6 @@#include <plat/gpio-core.h> #include <plat/gpio-cfg.h> #include <plat/gpio-cfg-helpers.h> -#include <plat/s3c2443.h> #include <plat/devs.h> #include <plat/cpu.h> #include <plat/fb-core.h>
@@ -43,6 +42,8 @@#include <plat/adc-core.h> #include <plat/rtc-core.h> +#include "common.h" +static struct map_desc s3c2443_iodesc[]__initdata = {IODESC_ENT (WATCHDOG ),IODESC_ENT (CLKPWR ),
arch/arm/plat-s3c24xx/cpu.c +0 -11
@@ -48,7 +48,6 @@#include <plat/s3c2410.h> #include <plat/s3c2412.h> #include <plat/s3c244x.h> -#include <plat/s3c2443.h> /* table of supported CPUs */
@@ -57,7 +56,6 @@ static const char name_s3c2412[] = "S3C2412";static const char name_s3c2440[] ="S3C2440" ;static const char name_s3c2442[] ="S3C2442" ;static const char name_s3c2442b[] ="S3C2442B" ; -static const char name_s3c2443[] ="S3C2443" ;static const char name_s3c2410a[] ="S3C2410A" ;static const char name_s3c2440a[] ="S3C2440A" ;
@@ -134,15 +132,6 @@ static struct cpu_table cpu_ids[] __initdata = { .init = s3c2412_init, .name = name_s3c2412, }, - { - .idcode = 0x32443001, - .idmask = 0xffffffff, - .map_io = s3c2443_map_io, - .init_clocks = s3c2443_init_clocks, - .init_uarts = s3c2443_init_uarts, - .init = s3c2443_init, - .name = name_s3c2443, - }, };/* minimal IO mapping */
arch/arm/plat-samsung/include/plat/s3c2443.h deleted +0 -34
@@ -1,34 +0,0 @@ -/* linux/arch/arm/plat-samsung/include/plat/s3c2443.h -* -* Copyright (c) 2004-2005 Simtec Electronics -* Ben Dooks <[email protected]> -* -* Header file for s3c2443 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_S3C2443 - -struct s3c2410_uartcfg ; - -extern int s3c2443_init (void ); - -extern void s3c2443_map_io (void ); - -extern void s3c2443_init_uarts (struct s3c2410_uartcfg *cfg,int no); - -extern void s3c2443_init_clocks (int xtal); - -extern int s3c2443_baseclk_add (void ); - -extern void s3c2443_restart (char mode,const char *cmd); -#else -#define s3c2443_init_clocks NULL -#define s3c2443_init_uarts NULL -#define s3c2443_map_io NULL -#define s3c2443_init NULL -#define s3c2443_restart NULL -#endif
Signature · 1 line
1.7.5.4
PATCH 6/8 S3C2440: move io-init to SoC specific files
In reply to Heiko StübnerIntroduce common.c to replace calls to s3c24xx_init_io and make the s3c244x.h header obsolete.
--- arch/arm/mach-s3c2440/Makefile | 2 +- arch/arm/mach-s3c2440/common.c | 100 ++++++++++++++++++++++++++ arch/arm/mach-s3c2440/common.h | 20 +++++ arch/arm/mach-s3c2440/dsc.c | 2 +- arch/arm/mach-s3c2440/mach-anubis.c | 2 +- arch/arm/mach-s3c2440/mach-at2440evb.c | 2 +- arch/arm/mach-s3c2440/mach-gta02.c | 2 +- arch/arm/mach-s3c2440/mach-mini2440.c | 2 +- arch/arm/mach-s3c2440/mach-nexcoder.c | 3 +- arch/arm/mach-s3c2440/mach-osiris.c | 2 +- arch/arm/mach-s3c2440/mach-rx1950.c | 2 +- arch/arm/mach-s3c2440/mach-rx3715.c | 2 +- arch/arm/mach-s3c2440/mach-smdk2440.c | 3 +- arch/arm/mach-s3c2440/s3c2440.c | 3 +- arch/arm/mach-s3c2440/s3c2442.c | 3 +- arch/arm/mach-s3c2440/s3c244x.c | 3 +- arch/arm/plat-s3c24xx/cpu.c | 41 ----------- arch/arm/plat-samsung/include/plat/s3c244x.h | 42 ----------- 18 files changed, 137 insertions(+), 99 deletions(-) create mode 100644 arch/arm/mach-s3c2440/common.c delete mode 100644 arch/arm/plat-samsung/include/plat/s3c244x.h
arch/arm/mach-s3c2440/Makefile +1 -1
@@ -9,7 +9,7 @@ obj-m := obj-n := obj- := -obj-$(CONFIG_CPU_S3C2440) += s3c2440.o dsc.o +obj-$(CONFIG_CPU_S3C2440) += s3c2440.o dsc.o common.o obj-$(CONFIG_CPU_S3C2442) += s3c2442.o obj-$(CONFIG_CPU_S3C2440) += irq.o
arch/arm/mach-s3c2440/common.c new file +100 -0
100 lines not on this page · raw message
arch/arm/mach-s3c2440/common.h +20 -0
@@ -12,6 +12,26 @@#ifndef __ARCH_ARM_MACH_S3C2440_COMMON_H#define __ARCH_ARM_MACH_S3C2440_COMMON_H +extern void s3c244x_map_io (void ); + +extern void s3c244x_init_uarts (struct s3c2410_uartcfg *cfg,int no); + +extern void s3c244x_init_clocks (int xtal); +void s3c2440_restart (char mode,const char *cmd); +extern void s3c244x_init_io (struct map_desc *mach_desc,int size); + +#ifdef CONFIG_CPU_S3C2440 +extern int s3c2440_init (void ); + +extern void s3c2440_map_io (void ); +#endif + +#ifdef CONFIG_CPU_S3C2442 +extern int s3c2442_init (void ); + +extern void s3c2442_map_io (void ); +#endif +#endif /* __ARCH_ARM_MACH_S3C2440_COMMON_H */
arch/arm/mach-s3c2440/dsc.c +1 -1
@@ -28,7 +28,7 @@#include <mach/regs-dsc.h> #include <plat/cpu.h> -#include <plat/s3c244x.h> +#include "common.h" int s3c2440_set_dsc (unsigned int pin,unsigned int value) {
arch/arm/mach-s3c2440/mach-anubis.c +1 -1
@@ -450,7 +450,7 @@ static void __init anubis_map_io(void)s3c24xx_register_clocks (anubis_clocks,ARRAY_SIZE (anubis_clocks)); -s3c24xx_init_io (anubis_iodesc,ARRAY_SIZE (anubis_iodesc)); +s3c244x_init_io (anubis_iodesc,ARRAY_SIZE (anubis_iodesc));s3c24xx_init_clocks (0 );s3c24xx_init_uarts (anubis_uartcfgs,ARRAY_SIZE (anubis_uartcfgs));
arch/arm/mach-s3c2440/mach-at2440evb.c +1 -1
@@ -200,7 +200,7 @@ static struct platform_device *at2440evb_devices[] __initdata = {static void __init at2440evb_map_io (void ) { -s3c24xx_init_io (at2440evb_iodesc,ARRAY_SIZE (at2440evb_iodesc)); +s3c244x_init_io (at2440evb_iodesc,ARRAY_SIZE (at2440evb_iodesc));s3c24xx_init_clocks (16934400 );s3c24xx_init_uarts (at2440evb_uartcfgs,ARRAY_SIZE (at2440evb_uartcfgs)); }
arch/arm/mach-s3c2440/mach-gta02.c +1 -1
@@ -508,7 +508,7 @@ static struct platform_device gta02_buttons_device = {static void __init gta02_map_io (void ) { -s3c24xx_init_io (gta02_iodesc,ARRAY_SIZE (gta02_iodesc)); +s3c244x_init_io (gta02_iodesc,ARRAY_SIZE (gta02_iodesc));s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (gta02_uartcfgs,ARRAY_SIZE (gta02_uartcfgs)); }
arch/arm/mach-s3c2440/mach-mini2440.c +1 -1
@@ -535,7 +535,7 @@ static struct platform_device *mini2440_devices[] __initdata = {static void __init mini2440_map_io (void ) { -s3c24xx_init_io (mini2440_iodesc,ARRAY_SIZE (mini2440_iodesc)); +s3c244x_init_io (mini2440_iodesc,ARRAY_SIZE (mini2440_iodesc));s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (mini2440_uartcfgs,ARRAY_SIZE (mini2440_uartcfgs)); }
arch/arm/mach-s3c2440/mach-nexcoder.c +1 -2
@@ -42,7 +42,6 @@#include <plat/gpio-cfg.h> #include <plat/s3c2410.h> -#include <plat/s3c244x.h> #include <plat/clock.h> #include <plat/devs.h> #include <plat/cpu.h>
@@ -138,7 +137,7 @@ static void __init nexcoder_sensorboard_init(void)static void __init nexcoder_map_io (void ) { -s3c24xx_init_io (nexcoder_iodesc,ARRAY_SIZE (nexcoder_iodesc)); +s3c244x_init_io (nexcoder_iodesc,ARRAY_SIZE (nexcoder_iodesc));s3c24xx_init_clocks (0 );s3c24xx_init_uarts (nexcoder_uartcfgs,ARRAY_SIZE (nexcoder_uartcfgs));
arch/arm/mach-s3c2440/mach-osiris.c +1 -1
@@ -391,7 +391,7 @@ static void __init osiris_map_io(void)s3c24xx_register_clocks (osiris_clocks,ARRAY_SIZE (osiris_clocks)); -s3c24xx_init_io (osiris_iodesc,ARRAY_SIZE (osiris_iodesc)); +s3c244x_init_io (osiris_iodesc,ARRAY_SIZE (osiris_iodesc));s3c24xx_init_clocks (0 );s3c24xx_init_uarts (osiris_uartcfgs,ARRAY_SIZE (osiris_uartcfgs));
arch/arm/mach-s3c2440/mach-rx1950.c +1 -1
@@ -746,7 +746,7 @@ static void __init rx1950_map_io(void)s3c24xx_register_clocks (rx1950_clocks,ARRAY_SIZE (rx1950_clocks)); -s3c24xx_init_io (rx1950_iodesc,ARRAY_SIZE (rx1950_iodesc)); +s3c244x_init_io (rx1950_iodesc,ARRAY_SIZE (rx1950_iodesc));s3c24xx_init_clocks (16934000 );s3c24xx_init_uarts (rx1950_uartcfgs,ARRAY_SIZE (rx1950_uartcfgs));
arch/arm/mach-s3c2440/mach-rx3715.c +1 -1
@@ -176,7 +176,7 @@ static struct platform_device *rx3715_devices[] __initdata = {static void __init rx3715_map_io (void ) { -s3c24xx_init_io (rx3715_iodesc,ARRAY_SIZE (rx3715_iodesc)); +s3c244x_init_io (rx3715_iodesc,ARRAY_SIZE (rx3715_iodesc));s3c24xx_init_clocks (16934000 );s3c24xx_init_uarts (rx3715_uartcfgs,ARRAY_SIZE (rx3715_uartcfgs)); }
arch/arm/mach-s3c2440/mach-smdk2440.c +1 -2
@@ -40,7 +40,6 @@#include <plat/iic.h> #include <plat/s3c2410.h> -#include <plat/s3c244x.h> #include <plat/clock.h> #include <plat/devs.h> #include <plat/cpu.h>
@@ -161,7 +160,7 @@ static struct platform_device *smdk2440_devices[] __initdata = {static void __init smdk2440_map_io (void ) { -s3c24xx_init_io (smdk2440_iodesc,ARRAY_SIZE (smdk2440_iodesc)); +s3c244x_init_io (smdk2440_iodesc,ARRAY_SIZE (smdk2440_iodesc));s3c24xx_init_clocks (16934400 );s3c24xx_init_uarts (smdk2440_uartcfgs,ARRAY_SIZE (smdk2440_uartcfgs)); }
arch/arm/mach-s3c2440/s3c2440.c +2 -1
@@ -33,7 +33,6 @@#include <plat/devs.h> #include <plat/cpu.h> -#include <plat/s3c244x.h> #include <plat/pm.h> #include <plat/watchdog-reset.h>
@@ -41,6 +40,8 @@#include <plat/gpio-cfg.h> #include <plat/gpio-cfg-helpers.h> +#include "common.h" +static struct sys_device s3c2440_sysdev = { .cls = &s3c2440_sysclass, };
arch/arm/mach-s3c2440/s3c2442.c +2 -1
@@ -45,13 +45,14 @@#include <plat/clock.h> #include <plat/cpu.h> -#include <plat/s3c244x.h> #include <plat/pm.h> #include <plat/gpio-core.h> #include <plat/gpio-cfg.h> #include <plat/gpio-cfg-helpers.h> +#include "common.h" +/* S3C2442 extended clock support */ static unsigned long s3c2442_camif_upll_round(struct clk *clk,
arch/arm/mach-s3c2440/s3c244x.c +2 -1
@@ -39,7 +39,6 @@#include <mach/regs-dsc.h> #include <plat/s3c2410.h> -#include <plat/s3c244x.h> #include <plat/clock.h> #include <plat/devs.h> #include <plat/cpu.h>
@@ -47,6 +46,8 @@#include <plat/pll.h> #include <plat/nand-core.h> +#include "common.h" +static struct map_desc s3c244x_iodesc[]__initdata = {IODESC_ENT (CLKPWR ),IODESC_ENT (TIMER ),
arch/arm/plat-s3c24xx/cpu.c +0 -41
59 lines not on this page · raw message
arch/arm/plat-samsung/include/plat/s3c244x.h deleted +0 -42
42 lines not on this page · raw message
Signature · 1 line
1.7.5.4
PATCH 7/8 S3C2412: move io-init to SoC specific files
In reply to Heiko StübnerIntroduce common.c to replace calls to s3c24xx_init_io and make the s3c2412.h header obsolete.
--- arch/arm/mach-s3c2412/Makefile | 2 +- arch/arm/mach-s3c2412/clock.c | 3 +- arch/arm/mach-s3c2412/common.c | 79 ++++++++++++++++++++++++++ arch/arm/mach-s3c2412/common.h | 30 ++++++++++ arch/arm/mach-s3c2412/mach-jive.c | 5 +- arch/arm/mach-s3c2412/mach-smdk2413.c | 6 +- arch/arm/mach-s3c2412/mach-vstms.c | 5 +- arch/arm/mach-s3c2412/pm.c | 2 +- arch/arm/mach-s3c2412/s3c2412.c | 3 +- arch/arm/plat-s3c24xx/cpu.c | 35 +----------- arch/arm/plat-samsung/include/plat/s3c2412.h | 32 ---------- 11 files changed, 124 insertions(+), 78 deletions(-) create mode 100644 arch/arm/mach-s3c2412/common.c create mode 100644 arch/arm/mach-s3c2412/common.h delete mode 100644 arch/arm/plat-samsung/include/plat/s3c2412.h
arch/arm/mach-s3c2412/Makefile +1 -1
@@ -9,7 +9,7 @@ obj-m := obj-n := obj- := -obj-$(CONFIG_CPU_S3C2412) += s3c2412.o +obj-$(CONFIG_CPU_S3C2412) += s3c2412.o common.o obj-$(CONFIG_CPU_S3C2412) += irq.o obj-$(CONFIG_CPU_S3C2412) += clock.o obj-$(CONFIG_S3C2412_DMA) += dma.o
arch/arm/mach-s3c2412/clock.c +2 -1
@@ -41,10 +41,11 @@#include <mach/regs-clock.h> #include <mach/regs-gpio.h> -#include <plat/s3c2412.h> #include <plat/clock.h> #include <plat/cpu.h> +#include "common.h" +/* We currently have to assume that the system is running * from the XTPll input, and that all ***REFCLKs are being * fed from it, as we cannot read the state of OM[4] from
arch/arm/mach-s3c2412/common.c new file +79 -0
79 lines not on this page · raw message
arch/arm/mach-s3c2412/common.h new file +30 -0
@@ -0,0 +1,30 @@ +/* linux/arch/arm/plat-samsung/include/plat/s3c2412.h +* +* Copyright (c) 2006 Simtec Electronics +* Ben Dooks <[email protected]> +* +* Header file for s3c2412 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. +*/ + +#ifndef __ARCH_ARM_MACH_S3C2412_COMMON_H +#define __ARCH_ARM_MACH_S3C2412_COMMON_H + +extern int s3c2412_init (void ); + +extern void s3c2412_map_io (void ); + +extern void s3c2412_init_uarts (struct s3c2410_uartcfg *cfg,int no); + +extern void s3c2412_init_clocks (int xtal); + +extern int s3c2412_baseclk_add (void ); + +extern void s3c2412_restart (char mode,const char *cmd); + +extern void s3c2412_init_io (struct map_desc *mach_desc,int size); + +#endif
arch/arm/mach-s3c2412/mach-jive.c +3 -2
@@ -48,7 +48,6 @@#include <linux/mtd/nand_ecc.h> #include <linux/mtd/partitions.h> -#include <plat/s3c2412.h> #include <plat/gpio-cfg.h> #include <plat/clock.h> #include <plat/devs.h>
@@ -56,6 +55,8 @@#include <plat/pm.h> #include <plat/udc.h> +#include "common.h" +static struct map_desc jive_iodesc[]__initdata = { };
@@ -503,7 +504,7 @@ static struct syscore_ops jive_pm_syscore_ops = {static void __init jive_map_io (void ) { -s3c24xx_init_io (jive_iodesc,ARRAY_SIZE (jive_iodesc)); +s3c2412_init_io (jive_iodesc,ARRAY_SIZE (jive_iodesc));s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (jive_uartcfgs,ARRAY_SIZE (jive_uartcfgs)); }
arch/arm/mach-s3c2412/mach-smdk2413.c +3 -3
@@ -42,14 +42,14 @@#include <plat/iic.h> #include <mach/fb.h> -#include <plat/s3c2410.h> -#include <plat/s3c2412.h> #include <plat/clock.h> #include <plat/devs.h> #include <plat/cpu.h> #include <plat/common-smdk.h> +#include "common.h" +static struct map_desc smdk2413_iodesc[]__initdata = { };
@@ -104,7 +104,7 @@ static void __init smdk2413_fixup(struct tag *tags, char **cmdline,static void __init smdk2413_map_io (void ) { -s3c24xx_init_io (smdk2413_iodesc,ARRAY_SIZE (smdk2413_iodesc)); +s3c2412_init_io (smdk2413_iodesc,ARRAY_SIZE (smdk2413_iodesc));s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (smdk2413_uartcfgs,ARRAY_SIZE (smdk2413_uartcfgs)); }
arch/arm/mach-s3c2412/mach-vstms.c +2 -3
@@ -42,12 +42,11 @@#include <plat/iic.h> #include <plat/nand.h> -#include <plat/s3c2410.h> -#include <plat/s3c2412.h> #include <plat/clock.h> #include <plat/devs.h> #include <plat/cpu.h> +#include "common.h" static struct map_desc vstms_iodesc[]__initdata = { };
@@ -141,7 +140,7 @@ static void __init vstms_fixup(struct tag *tags, char **cmdline,static void __init vstms_map_io (void ) { -s3c24xx_init_io (vstms_iodesc,ARRAY_SIZE (vstms_iodesc)); +s3c2412_init_io (vstms_iodesc,ARRAY_SIZE (vstms_iodesc));s3c24xx_init_clocks (12000000 );s3c24xx_init_uarts (vstms_uartcfgs,ARRAY_SIZE (vstms_uartcfgs)); }
arch/arm/mach-s3c2412/pm.c +1 -1
@@ -33,7 +33,7 @@#include <plat/cpu.h> #include <plat/pm.h> -#include <plat/s3c2412.h> +#include "common.h" extern void s3c2412_sleep_enter (void );
arch/arm/mach-s3c2412/s3c2412.c +2 -1
@@ -45,7 +45,6 @@#include <plat/regs-spi.h> #include <mach/regs-s3c2412.h> -#include <plat/s3c2412.h> #include <plat/cpu.h> #include <plat/devs.h> #include <plat/clock.h>
@@ -53,6 +52,8 @@#include <plat/pll.h> #include <plat/nand-core.h> +#include "common.h" +#ifndef CONFIG_CPU_S3C2412_ONLY void __iomem *s3c24xx_va_gpio2 =S3C24XX_VA_GPIO ;
arch/arm/plat-s3c24xx/cpu.c +1 -34
@@ -46,12 +46,10 @@#include <plat/devs.h> #include <plat/clock.h> #include <plat/s3c2410.h> -#include <plat/s3c2412.h> /* table of supported CPUs */ static const char name_s3c2410[] ="S3C2410" ; -static const char name_s3c2412[] ="S3C2412" ;static const char name_s3c2410a[] ="S3C2410A" ;static struct cpu_table cpu_ids[]__initdata = {
@@ -73,24 +71,6 @@ static struct cpu_table cpu_ids[] __initdata = { .init = s3c2410a_init, .name = name_s3c2410a }, - { - .idcode = 0x32412001, - .idmask = 0xffffffff, - .map_io = s3c2412_map_io, - .init_clocks = s3c2412_init_clocks, - .init_uarts = s3c2412_init_uarts, - .init = s3c2412_init, - .name = name_s3c2412, - }, - {/* a newer version of the s3c2412 */ - .idcode = 0x32412003, - .idmask = 0xffffffff, - .map_io = s3c2412_map_io, - .init_clocks = s3c2412_init_clocks, - .init_uarts = s3c2412_init_uarts, - .init = s3c2412_init, - .name = name_s3c2412, - }, };/* minimal IO mapping */
@@ -104,15 +84,6 @@ static struct map_desc s3c_iodesc[] __initdata = {/* read cpu identificaiton code */ -static unsigned long s3c24xx_read_idcode_v5 (void ) -{ -#if defined(CONFIG_CPU_S3C2412 ) || defined(CONFIG_CPU_S3C2413 ) -return __raw_readl (S3C2412_GSTATUS1 ); -#else -return 1UL ;/* don't look like an 2400 */ -#endif -} -static unsigned long s3c24xx_read_idcode_v4 (void ) {return __raw_readl (S3C2410_GSTATUS1 );
@@ -124,11 +95,7 @@ void __init s3c24xx_init_io(struct map_desc *mach_desc, int size)iotable_init (mach_desc, size);iotable_init (s3c_iodesc,ARRAY_SIZE (s3c_iodesc)); -if (cpu_architecture () >= CPU_ARCH_ARMv5) { - samsung_cpu_id =s3c24xx_read_idcode_v5 (); - }else { - samsung_cpu_id =s3c24xx_read_idcode_v4 (); - } + samsung_cpu_id =s3c24xx_read_idcode_v4 ();s3c24xx_init_cpu ();s3c_init_cpu (samsung_cpu_id, cpu_ids,ARRAY_SIZE (cpu_ids));
arch/arm/plat-samsung/include/plat/s3c2412.h deleted +0 -32
@@ -1,32 +0,0 @@ -/* linux/arch/arm/plat-samsung/include/plat/s3c2412.h -* -* Copyright (c) 2006 Simtec Electronics -* Ben Dooks <[email protected]> -* -* Header file for s3c2412 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_S3C2412 - -extern int s3c2412_init (void ); - -extern void s3c2412_map_io (void ); - -extern void s3c2412_init_uarts (struct s3c2410_uartcfg *cfg,int no); - -extern void s3c2412_init_clocks (int xtal); - -extern int s3c2412_baseclk_add (void ); - -extern void s3c2412_restart (char mode,const char *cmd); -#else -#define s3c2412_init_clocks NULL -#define s3c2412_init_uarts NULL -#define s3c2412_map_io NULL -#define s3c2412_init NULL -#define s3c2412_restart NULL -#endif
Signature · 1 line
1.7.5.4
PATCH 8/8 S3C2410: move io-init to SoC specific files
In reply to Heiko StübnerIntroduce common.c to replace calls to s3c24xx_init_io and make the s3c2410.h header obsolete.
This also removes unnecessary references to s3c2410.h that were still present in s3c2440 and s3c2443.
--- arch/arm/mach-s3c2410/Makefile | 2 +- arch/arm/mach-s3c2410/common.c | 80 ++++++++++++++++++++ arch/arm/mach-s3c2410/common.h | 11 +++ arch/arm/mach-s3c2410/mach-amlm5900.c | 2 +- arch/arm/mach-s3c2410/mach-bast.c | 2 +- arch/arm/mach-s3c2410/mach-h1940.c | 2 +- arch/arm/mach-s3c2410/mach-n30.c | 3 +- arch/arm/mach-s3c2410/mach-otom.c | 3 +- arch/arm/mach-s3c2410/mach-qt2410.c | 2 +- arch/arm/mach-s3c2410/mach-smdk2410.c | 2 +- arch/arm/mach-s3c2410/mach-tct_hammer.c | 2 +- arch/arm/mach-s3c2410/mach-vr1000.c | 2 +- arch/arm/mach-s3c2410/s3c2410.c | 3 +- arch/arm/mach-s3c2440/mach-nexcoder.c | 1 - arch/arm/mach-s3c2440/mach-smdk2440.c | 1 - arch/arm/mach-s3c2440/s3c244x.c | 1 - arch/arm/mach-s3c2443/mach-smdk2443.c | 1 - arch/arm/plat-s3c24xx/Makefile | 1 - arch/arm/plat-s3c24xx/cpu.c | 102 -------------------------- arch/arm/plat-s3c24xx/s3c2410-clock.c | 1 - arch/arm/plat-samsung/include/plat/cpu.h | 2 - arch/arm/plat-samsung/include/plat/s3c2410.h | 31 -------- 22 files changed, 103 insertions(+), 154 deletions(-) create mode 100644 arch/arm/mach-s3c2410/common.c delete mode 100644 arch/arm/plat-s3c24xx/cpu.c delete mode 100644 arch/arm/plat-samsung/include/plat/s3c2410.h
arch/arm/mach-s3c2410/Makefile +1 -1
@@ -9,7 +9,7 @@ obj-m := obj-n := obj- := -obj-$(CONFIG_CPU_S3C2410) += s3c2410.o +obj-$(CONFIG_CPU_S3C2410) += s3c2410.o common.o obj-$(CONFIG_CPU_S3C2410_DMA) += dma.o obj-$(CONFIG_CPU_S3C2410_DMA) += dma.o obj-$(CONFIG_S3C2410_PM) += pm.o sleep.o
arch/arm/mach-s3c2410/common.c new file +80 -0
80 lines not on this page · raw message
arch/arm/mach-s3c2410/common.h +11 -0
@@ -12,6 +12,17 @@#ifndef __ARCH_ARM_MACH_S3C2410_COMMON_H#define __ARCH_ARM_MACH_S3C2410_COMMON_H +extern int s3c2410_init (void ); +extern int s3c2410a_init (void ); + +extern void s3c2410_map_io (void ); + +extern void s3c2410_init_uarts (struct s3c2410_uartcfg *cfg,int no); + +extern void s3c2410_init_clocks (int xtal); +void s3c2410_restart (char mode,const char *cmd); +extern void s3c2410_init_io (struct map_desc *mach_desc,int size); +#endif /* __ARCH_ARM_MACH_S3C2410_COMMON_H */
arch/arm/mach-s3c2410/mach-amlm5900.c +1 -1
@@ -162,7 +162,7 @@ static struct platform_device *amlm5900_devices[] __initdata = {static void __init amlm5900_map_io (void ) { -s3c24xx_init_io (amlm5900_iodesc,ARRAY_SIZE (amlm5900_iodesc)); +s3c2410_init_io (amlm5900_iodesc,ARRAY_SIZE (amlm5900_iodesc));s3c24xx_init_clocks (0 );s3c24xx_init_uarts (amlm5900_uartcfgs,ARRAY_SIZE (amlm5900_uartcfgs)); }
arch/arm/mach-s3c2410/mach-bast.c +1 -1
@@ -608,7 +608,7 @@ static void __init bast_map_io(void)s3c_hwmon_set_platdata (&bast_hwmon_info); -s3c24xx_init_io (bast_iodesc,ARRAY_SIZE (bast_iodesc)); +s3c2410_init_io (bast_iodesc,ARRAY_SIZE (bast_iodesc));s3c24xx_init_clocks (0 );s3c24xx_init_uarts (bast_uartcfgs,ARRAY_SIZE (bast_uartcfgs)); }
arch/arm/mach-s3c2410/mach-h1940.c +1 -1
@@ -654,7 +654,7 @@ static struct platform_device *h1940_devices[] __initdata = {static void __init h1940_map_io (void ) { -s3c24xx_init_io (h1940_iodesc,ARRAY_SIZE (h1940_iodesc)); +s3c2410_init_io (h1940_iodesc,ARRAY_SIZE (h1940_iodesc));s3c24xx_init_clocks (0 );s3c24xx_init_uarts (h1940_uartcfgs,ARRAY_SIZE (h1940_uartcfgs));
arch/arm/mach-s3c2410/mach-n30.c +1 -2
@@ -48,7 +48,6 @@#include <plat/cpu.h> #include <plat/devs.h> #include <plat/mci.h> -#include <plat/s3c2410.h> #include <plat/udc.h> #include "common.h"
@@ -532,7 +531,7 @@ static void __init n30_hwinit(void)static void __init n30_map_io (void ) { -s3c24xx_init_io (n30_iodesc,ARRAY_SIZE (n30_iodesc)); +s3c2410_init_io (n30_iodesc,ARRAY_SIZE (n30_iodesc));n30_hwinit ();s3c24xx_init_clocks (0 );s3c24xx_init_uarts (n30_uartcfgs,ARRAY_SIZE (n30_uartcfgs));
arch/arm/mach-s3c2410/mach-otom.c +1 -2
@@ -32,7 +32,6 @@#include <plat/regs-serial.h> #include <mach/regs-gpio.h> -#include <plat/s3c2410.h> #include <plat/clock.h> #include <plat/devs.h> #include <plat/iic.h>
@@ -105,7 +104,7 @@ static struct platform_device *otom11_devices[] __initdata = {static void __init otom11_map_io (void ) { -s3c24xx_init_io (otom11_iodesc,ARRAY_SIZE (otom11_iodesc)); +s3c2410_init_io (otom11_iodesc,ARRAY_SIZE (otom11_iodesc));s3c24xx_init_clocks (0 );s3c24xx_init_uarts (otom11_uartcfgs,ARRAY_SIZE (otom11_uartcfgs)); }
arch/arm/mach-s3c2410/mach-qt2410.c +1 -1
@@ -310,7 +310,7 @@ __setup("tft=", qt2410_tft_setup);static void __init qt2410_map_io (void ) { -s3c24xx_init_io (qt2410_iodesc,ARRAY_SIZE (qt2410_iodesc)); +s3c2410_init_io (qt2410_iodesc,ARRAY_SIZE (qt2410_iodesc));s3c24xx_init_clocks (12 *1000 *1000 );s3c24xx_init_uarts (smdk2410_uartcfgs,ARRAY_SIZE (smdk2410_uartcfgs)); }
arch/arm/mach-s3c2410/mach-smdk2410.c +1 -1
@@ -98,7 +98,7 @@ static struct platform_device *smdk2410_devices[] __initdata = {static void __init smdk2410_map_io (void ) { -s3c24xx_init_io (smdk2410_iodesc,ARRAY_SIZE (smdk2410_iodesc)); +s3c2410_init_io (smdk2410_iodesc,ARRAY_SIZE (smdk2410_iodesc));s3c24xx_init_clocks (0 );s3c24xx_init_uarts (smdk2410_uartcfgs,ARRAY_SIZE (smdk2410_uartcfgs)); }
arch/arm/mach-s3c2410/mach-tct_hammer.c +1 -1
@@ -136,7 +136,7 @@ static struct platform_device *tct_hammer_devices[] __initdata = {static void __init tct_hammer_map_io (void ) { -s3c24xx_init_io (tct_hammer_iodesc,ARRAY_SIZE (tct_hammer_iodesc)); +s3c2410_init_io (tct_hammer_iodesc,ARRAY_SIZE (tct_hammer_iodesc));s3c24xx_init_clocks (0 );s3c24xx_init_uarts (tct_hammer_uartcfgs,ARRAY_SIZE (tct_hammer_uartcfgs)); }
arch/arm/mach-s3c2410/mach-vr1000.c +1 -1
@@ -356,7 +356,7 @@ static void __init vr1000_map_io(void) pm_power_off = vr1000_power_off; -s3c24xx_init_io (vr1000_iodesc,ARRAY_SIZE (vr1000_iodesc)); +s3c2410_init_io (vr1000_iodesc,ARRAY_SIZE (vr1000_iodesc));s3c24xx_init_clocks (0 );s3c24xx_init_uarts (vr1000_uartcfgs,ARRAY_SIZE (vr1000_uartcfgs)); }
arch/arm/mach-s3c2410/s3c2410.c +2 -1
@@ -36,7 +36,6 @@#include <mach/regs-clock.h> #include <plat/regs-serial.h> -#include <plat/s3c2410.h> #include <plat/cpu.h> #include <plat/devs.h> #include <plat/clock.h>
@@ -48,6 +47,8 @@#include <plat/gpio-cfg.h> #include <plat/gpio-cfg-helpers.h> +#include "common.h" +/* Initial IO mappings */ static struct map_desc s3c2410_iodesc[]__initdata = {
arch/arm/mach-s3c2440/mach-nexcoder.c +0 -1
@@ -41,7 +41,6 @@#include <plat/iic.h> #include <plat/gpio-cfg.h> -#include <plat/s3c2410.h> #include <plat/clock.h> #include <plat/devs.h> #include <plat/cpu.h>
arch/arm/mach-s3c2440/mach-smdk2440.c +0 -1
@@ -39,7 +39,6 @@#include <mach/fb.h> #include <plat/iic.h> -#include <plat/s3c2410.h> #include <plat/clock.h> #include <plat/devs.h> #include <plat/cpu.h>
arch/arm/mach-s3c2440/s3c244x.c +0 -1
@@ -38,7 +38,6 @@#include <mach/regs-gpioj.h> #include <mach/regs-dsc.h> -#include <plat/s3c2410.h> #include <plat/clock.h> #include <plat/devs.h> #include <plat/cpu.h>
arch/arm/mach-s3c2443/mach-smdk2443.c +0 -1
@@ -39,7 +39,6 @@#include <mach/fb.h> #include <plat/iic.h> -#include <plat/s3c2410.h> #include <plat/clock.h> #include <plat/devs.h> #include <plat/cpu.h>
arch/arm/plat-s3c24xx/Makefile +0 -1
@@ -12,7 +12,6 @@ obj- := # Core files -obj-y += cpu.o obj-y += irq.o obj-y += dev-uart.o obj-y += clock.o
arch/arm/plat-s3c24xx/cpu.c deleted +0 -102
102 lines not on this page · raw message
arch/arm/plat-s3c24xx/s3c2410-clock.c +0 -1
@@ -41,7 +41,6 @@#include <mach/regs-clock.h> #include <mach/regs-gpio.h> -#include <plat/s3c2410.h> #include <plat/clock.h> #include <plat/cpu.h>
arch/arm/plat-samsung/include/plat/cpu.h +0 -2
@@ -154,8 +154,6 @@ extern void s3c_init_cpu(unsigned long idcode,extern void s3c24xx_init_irq (void );extern void s5p_init_irq (u32 *vic,u32 num_vic); -extern void s3c24xx_init_io (struct map_desc *mach_desc,int size); -extern void s3c24xx_init_cpu (void );extern void s3c64xx_init_cpu (void );extern void s5p_init_cpu (void __iomem *cpuid_addr);
arch/arm/plat-samsung/include/plat/s3c2410.h deleted +0 -31
@@ -1,31 +0,0 @@ -/* linux/arch/arm/plat-samsung/include/plat/s3c2410.h -* -* Copyright (c) 2004 Simtec Electronics -* Ben Dooks <[email protected]> -* -* Header file for s3c2410 machine directory -* -* 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_S3C2410 - -extern int s3c2410_init (void ); -extern int s3c2410a_init (void ); - -extern void s3c2410_map_io (void ); - -extern void s3c2410_init_uarts (struct s3c2410_uartcfg *cfg,int no); - -extern void s3c2410_init_clocks (int xtal); - -#else -#define s3c2410_init_clocks NULL -#define s3c2410_init_uarts NULL -#define s3c2410_map_io NULL -#define s3c2410_init NULL -#define s3c2410a_init NULL -#endif
Signature · 1 line
1.7.5.4
cover S3C24XX: remove global plat/s3c24??.h SoC-headers
In reply to Heiko StübnerQuoted 14 lines · Heiko St?bner
The plat-samsung/s3c24??.h headers contain function declarations that are mostly private to the relevant SoCs.
This patchset follows the work started by Kukjin Kim for newer Samsung- SoCs
and moves them from a global space to their SoC directories ascommon.h.The the only non-mach user of these files is
plat-s3c24xx/cpu.c. It seemes
to have been built to generalize the init of S3C24XX-SoCs, but in reality its savings are rather low and introduce ifdef-voodoo to distinguish between S3C2412 and S3C2416.
Quoted 7 lines
Therefore the series introduces
common.cfiles for these SoCs, that now contain the SoC-specific cpu-init - the relevant parts of thecpu.ccode.cpu.cis completely removed at the end of the series.The number of lines add + deleted is mostly equal and the positive diffstat
results from the added GPL headers to thecommon.cfiles for the most
part.
Quoted 7 lines
Another sign of low savings in the
cpu.cabstraction.As always, each patch is compile-tested individually and correctnes of the move was tested on s3c2416 hardware - so hopefully I did not break any other
of the touched SoCs.
Quoted 6 lines
As with the newer SoCs more common code can move into the
common.cfiles later on.The series is based on the linux-samsung/for-next branch of 2012-01-02, as it needs the restart patches, that create the
common.hfor some SoCs.
Hi Heiko,
This approach looks good to me but since I was thinking we need to merge various mach-s3c24{1,4}{0,2,6,0,3} directories to just one mach-s3c24xx directory without plat-s3c24xx which can split into plat-samsung for all of Samsung stuff and into mach-s3c24xx only for s3c24xx stuff, I didn't create common.[ch] in each mach-s3c24xx directories. But now this could be good to us...I think, we can make better output together about that. Let me back on this after this merge window.
Thanks.
Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.
Quoted 54 lines
Heiko Stuebner (8):
S3C24XX: Remove extern declaration ofclk_msysclk
S3C24XX: move common S3C2443 clock definitions toclock.h
S3C2410: moves3c2410_baseclk_addtoclock.h
S3C2416: move io-init to SoC specific files
S3C2443: move io-init to SoC specific files
S3C2440: move io-init to SoC specific files
S3C2412: move io-init to SoC specific files
S3C2410: move io-init to SoC specific filesarch/arm/mach-s3c2410/Makefile | 2 +- arch/arm/mach-s3c2410/common.c | 80 ++++++++++ arch/arm/mach-s3c2410/common.h | 11 ++ arch/arm/mach-s3c2410/mach-amlm5900.c | 2 +- arch/arm/mach-s3c2410/mach-bast.c | 2 +- arch/arm/mach-s3c2410/mach-h1940.c | 2 +- arch/arm/mach-s3c2410/mach-n30.c | 3 +- arch/arm/mach-s3c2410/mach-otom.c | 3 +- arch/arm/mach-s3c2410/mach-qt2410.c | 2 +- arch/arm/mach-s3c2410/mach-smdk2410.c | 2 +- arch/arm/mach-s3c2410/mach-tct_hammer.c | 2 +- arch/arm/mach-s3c2410/mach-vr1000.c | 2 +- arch/arm/mach-s3c2410/s3c2410.c | 3 +- arch/arm/mach-s3c2412/Makefile | 2 +- arch/arm/mach-s3c2412/clock.c | 3 +- arch/arm/mach-s3c2412/common.c | 79 ++++++++++ arch/arm/mach-s3c2412/common.h | 30 ++++ arch/arm/mach-s3c2412/mach-jive.c | 5 +- arch/arm/mach-s3c2412/mach-smdk2413.c | 6 +- arch/arm/mach-s3c2412/mach-vstms.c | 5 +- arch/arm/mach-s3c2412/pm.c | 2 +- arch/arm/mach-s3c2412/s3c2412.c | 3 +- arch/arm/mach-s3c2416/Makefile | 2 +- arch/arm/mach-s3c2416/clock.c | 4 +- arch/arm/mach-s3c2416/common.c | 70 +++++++++ arch/arm/mach-s3c2416/common.h | 30 ++++ arch/arm/mach-s3c2416/mach-smdk2416.c | 6 +- arch/arm/mach-s3c2416/s3c2416.c | 3 +- arch/arm/mach-s3c2440/Makefile | 2 +- arch/arm/mach-s3c2440/common.c | 100 ++++++++++++ arch/arm/mach-s3c2440/common.h | 20 +++ arch/arm/mach-s3c2440/dsc.c | 2 +- arch/arm/mach-s3c2440/mach-anubis.c | 2 +- arch/arm/mach-s3c2440/mach-at2440evb.c | 2 +- arch/arm/mach-s3c2440/mach-gta02.c | 2 +- arch/arm/mach-s3c2440/mach-mini2440.c | 2 +- arch/arm/mach-s3c2440/mach-nexcoder.c | 4 +- arch/arm/mach-s3c2440/mach-osiris.c | 2 +- arch/arm/mach-s3c2440/mach-rx1950.c | 2 +- arch/arm/mach-s3c2440/mach-rx3715.c | 2 +- arch/arm/mach-s3c2440/mach-smdk2440.c | 4 +- arch/arm/mach-s3c2440/s3c2440.c | 3 +- arch/arm/mach-s3c2440/s3c2442.c | 3 +- arch/arm/mach-s3c2440/s3c244x.c | 4 +-
Quoted 8 lines
arch/arm/mach-s3c2443/Makefile | 2 +- arch/arm/mach-s3c2443/clock.c | 3 +- arch/arm/mach-s3c2443/common.c | 70 +++++++++ arch/arm/mach-s3c2443/common.h | 31 ++++ arch/arm/mach-s3c2443/mach-smdk2443.c | 6 +- arch/arm/mach-s3c2443/s3c2443.c | 3 +- arch/arm/plat-s3c24xx/Makefile | 1 - arch/arm/plat-s3c24xx/cpu.c | 208
--------------------------
Quoted 27 lines
arch/arm/plat-s3c24xx/s3c2410-clock.c | 1 - arch/arm/plat-s3c24xx/s3c2443-clock.c | 1 - arch/arm/plat-samsung/include/plat/clock.h | 22 +++ arch/arm/plat-samsung/include/plat/cpu.h | 2 - arch/arm/plat-samsung/include/plat/s3c2410.h | 33 ---- arch/arm/plat-samsung/include/plat/s3c2412.h | 32 ---- arch/arm/plat-samsung/include/plat/s3c2416.h | 33 ---- arch/arm/plat-samsung/include/plat/s3c2443.h | 54 ------- arch/arm/plat-samsung/include/plat/s3c244x.h | 42 ----- 61 files changed, 603 insertions(+), 463 deletions(-) create mode 100644 arch/arm/mach-s3c2410/common.c create mode 100644 arch/arm/mach-s3c2412/common.c create mode 100644 arch/arm/mach-s3c2412/common.h create mode 100644 arch/arm/mach-s3c2416/common.c create mode 100644 arch/arm/mach-s3c2416/common.h create mode 100644 arch/arm/mach-s3c2440/common.c create mode 100644 arch/arm/mach-s3c2443/common.c create mode 100644 arch/arm/mach-s3c2443/common.h delete mode 100644 arch/arm/plat-s3c24xx/cpu.c delete mode 100644 arch/arm/plat-samsung/include/plat/s3c2410.h delete mode 100644 arch/arm/plat-samsung/include/plat/s3c2412.h delete mode 100644 arch/arm/plat-samsung/include/plat/s3c2416.h delete mode 100644 arch/arm/plat-samsung/include/plat/s3c2443.h delete mode 100644 arch/arm/plat-samsung/include/plat/s3c244x.h--
1.7.5.4