S3C24XX: remove global plat/s3c24??.h SoC-headers
Subsystems (4)
v2 cover S3C24XX: remove global plat/s3c24??.h SoC-headers
The plat-samsung/s3c24??.h headers contain function declarations that are 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.
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 i.e. between S3C2412 and S3C2416.
All the S3C24XX SoCs already have a s3c24??.c file keeping code common to all cpus in the respective directory. These file can also carry the SoC-specific cpu-init - the relevant parts of the cpu.c code. cpu.c is completely removed at the end of the series.
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.
The series is based on linux-next of 2012-01-17.
changes since v1:
the SoCs already contain files for common code, so there is no need to introduce an additional common.c . Also this common.c would hinder reducing the number of mach-directories as suggested by Kukjin Kim in the long run. When the code lives in SoC specific files they can happily share the same directory at a later time without requiring additional renames.
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/common.h | 17 -- arch/arm/mach-s3c2410/mach-amlm5900.c | 4 +- arch/arm/mach-s3c2410/mach-bast.c | 4 +- arch/arm/mach-s3c2410/mach-h1940.c | 4 +- arch/arm/mach-s3c2410/mach-n30.c | 5 +- arch/arm/mach-s3c2410/mach-otom.c | 5 +- arch/arm/mach-s3c2410/mach-qt2410.c | 4 +- arch/arm/mach-s3c2410/mach-smdk2410.c | 4 +- arch/arm/mach-s3c2410/mach-tct_hammer.c | 4 +- arch/arm/mach-s3c2410/mach-vr1000.c | 4 +- arch/arm/mach-s3c2410/s3c2410.c | 50 ++++++- arch/arm/mach-s3c2410/s3c2410.h | 28 ++++ arch/arm/mach-s3c2412/clock.c | 3 +- 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 | 49 ++++++- arch/arm/mach-s3c2412/s3c2412.h | 30 ++++ arch/arm/mach-s3c2416/clock.c | 4 +- arch/arm/mach-s3c2416/mach-smdk2416.c | 6 +- arch/arm/mach-s3c2416/s3c2416.c | 40 +++++- arch/arm/mach-s3c2416/s3c2416.h | 30 ++++ arch/arm/mach-s3c2440/common.h | 17 -- arch/arm/mach-s3c2440/dsc.c | 2 +- arch/arm/mach-s3c2440/mach-anubis.c | 4 +- arch/arm/mach-s3c2440/mach-at2440evb.c | 4 +- arch/arm/mach-s3c2440/mach-gta02.c | 4 +- arch/arm/mach-s3c2440/mach-mini2440.c | 4 +- arch/arm/mach-s3c2440/mach-nexcoder.c | 6 +- arch/arm/mach-s3c2440/mach-osiris.c | 4 +- arch/arm/mach-s3c2440/mach-rx1950.c | 4 +- arch/arm/mach-s3c2440/mach-rx3715.c | 4 +- arch/arm/mach-s3c2440/mach-smdk2440.c | 6 +- arch/arm/mach-s3c2440/s3c2440.c | 3 +- arch/arm/mach-s3c2440/s3c2442.c | 3 +- arch/arm/mach-s3c2440/s3c244x.c | 71 +++++++++- arch/arm/mach-s3c2440/s3c244x.h | 37 +++++ arch/arm/mach-s3c2443/clock.c | 3 +- arch/arm/mach-s3c2443/mach-smdk2443.c | 6 +- arch/arm/mach-s3c2443/s3c2443.c | 40 +++++- arch/arm/mach-s3c2443/s3c2443.h | 31 ++++ arch/arm/plat-s3c24xx/Makefile | 1 - arch/arm/plat-s3c24xx/cpu.c | 207 -------------------------- 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 ----- 53 files changed, 485 insertions(+), 509 deletions(-) delete mode 100644 arch/arm/mach-s3c2410/common.h create mode 100644 arch/arm/mach-s3c2410/s3c2410.h create mode 100644 arch/arm/mach-s3c2412/s3c2412.h create mode 100644 arch/arm/mach-s3c2416/s3c2416.h delete mode 100644 arch/arm/mach-s3c2440/common.h create mode 100644 arch/arm/mach-s3c2440/s3c244x.h create mode 100644 arch/arm/mach-s3c2443/s3c2443.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 v2 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.2.3
PATCH v2 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.2.3
PATCH v2 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.2.3
PATCH v2 4/8 S3C2416: move io-init to SoC specific files
In reply to Heiko StübnerMove s3c2416 specific code from s3c24xx_init_io to s3c2416.c and make the s3c2416.h header obsolete.
This also removes a cpu-specific ifdef in the common init function.
--- arch/arm/mach-s3c2416/clock.c | 3 +- arch/arm/mach-s3c2416/mach-smdk2416.c | 6 ++- arch/arm/mach-s3c2416/s3c2416.c | 40 +++++++++++++++++++++++++- arch/arm/mach-s3c2416/s3c2416.h | 30 +++++++++++++++++++ arch/arm/plat-s3c24xx/cpu.c | 21 ------------- arch/arm/plat-samsung/include/plat/s3c2416.h | 33 --------------------- 6 files changed, 75 insertions(+), 58 deletions(-) create mode 100644 arch/arm/mach-s3c2416/s3c2416.h delete mode 100644 arch/arm/plat-samsung/include/plat/s3c2416.h
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 "s3c2416.h" +/* armdiv * * this clock is sourced from msysclk and can have a number of
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>
@@ -57,6 +56,8 @@#include <plat/common-smdk.h> +#include "s3c2416.h" +static struct map_desc smdk2416_iodesc[]__initdata = {/* ISA IO Space map (memory space selected by A24) */
@@ -216,7 +217,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 +39 -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,45 @@#include <plat/adc-core.h> #include <plat/rtc-core.h> +#include "s3c2416.h" + +/* table of supported CPUs */ + +static const char name_s3c2416[] ="S3C2416/S3C2450" ; + +static struct cpu_table cpu_ids[]__initdata = { + {/* 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, + }, +}; + +/* minimal IO mapping */ + +static struct map_desc s3c_iodesc[]__initdata = { +IODESC_ENT (GPIO ), +IODESC_ENT (IRQ ), +IODESC_ENT (MEMCTRL ), +IODESC_ENT (UART ) +}; + +void __init s3c2416_init_io (struct map_desc *mach_desc,int size) +{ +/* initialise the io descriptors we need for initialisation */ +iotable_init (mach_desc, size); +iotable_init (s3c_iodesc,ARRAY_SIZE (s3c_iodesc)); + + samsung_cpu_id =__raw_readl (S3C24XX_GSTATUS1 ); +s3c24xx_init_cpu (); + +s3c_init_cpu (samsung_cpu_id, cpu_ids,ARRAY_SIZE (cpu_ids)); +} +static struct map_desc s3c2416_iodesc[]__initdata = {IODESC_ENT (WATCHDOG ),IODESC_ENT (CLKPWR ),
arch/arm/mach-s3c2416/s3c2416.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_S3C2416_H +#define __ARCH_ARM_MACH_S3C2416_S3C2416_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/plat-s3c24xx/cpu.c +0 -21
@@ -46,7 +46,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>
@@ -54,7 +53,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" ;
@@ -135,15 +133,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,
@@ -168,16 +157,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.2.3
PATCH v2 4/8 S3C2416: move io-init to SoC specific files
Quoted 10 lines · Heiko St?bner
arch/arm/mach-s3c2416/s3c2416.c +10
-0+/* minimal IO mapping */ + +static struct map_desc s3c_iodesc[]__initdata = { +IODESC_ENT (GPIO ), +IODESC_ENT (IRQ ), +IODESC_ENT (MEMCTRL ), +IODESC_ENT (UART ) +}; + +void __init s3c2416_init_io (struct map_desc *mach_desc,int size)
arch/arm/mach-s3c2416/s3c2416.c line 101
Quoted 10 lines
arch/arm/mach-s3c2416/s3c2416.c +10
-0+{ +/* initialise the io descriptors we need for initialisation */ +iotable_init (mach_desc, size); +iotable_init (s3c_iodesc,ARRAY_SIZE (s3c_iodesc)); + + samsung_cpu_id =__raw_readl (S3C24XX_GSTATUS1 ); +s3c24xx_init_cpu (); + +s3c_init_cpu (samsung_cpu_id, cpu_ids,ARRAY_SIZE (cpu_ids)); +}
Why do we need this implemented in every Samsung mach directory? Why not provide a new function in arch/arm/plat-s3c24xx/cpu.c:
void __init s3c24xx_common_init_io(void __iomem *id_reg, struct cpu_table *ids,
size_t nr_ids)
{
iotable_init(s3c_iodesc, ARRAY_SIZE(s3c_iodesc));
samsung_cpu_id = __raw_readl(id_reg);
s3c24xx_init_cpu();
s3c_init_cpu(samsung_cpu_id, ids, nr_ids);
}and then this becomes:
void __init s3c2416_init_io(struct map_desc *mach_desc, int size)
{
/* initialise the io descriptors we need for initialisation */
iotable_init(mach_desc, size);
s3c24xx_common_init_io(S3C24XX_GSTATUS1, cpu_ids, ARRAY_SIZE(cpu_ids));
}PATCH v2 4/8 S3C2416: move io-init to SoC specific files
Am Dienstag 17 Januar 2012, 22:43:36 schrieb Russell King - ARM Linux:
Quoted 35 lines · Heiko St?bner
Quoted 10 lines
arch/arm/mach-s3c2416/s3c2416.c +10
-0+/* minimal IO mapping */ + +static struct map_desc s3c_iodesc[]__initdata = { +IODESC_ENT (GPIO ), +IODESC_ENT (IRQ ), +IODESC_ENT (MEMCTRL ), +IODESC_ENT (UART ) +}; + +void __init s3c2416_init_io (struct map_desc *mach_desc,int size)arch/arm/mach-s3c2416/s3c2416.c line 101
Quoted 10 lines
arch/arm/mach-s3c2416/s3c2416.c +10
-0+{ +/* initialise the io descriptors we need for initialisation */ +iotable_init (mach_desc, size); +iotable_init (s3c_iodesc,ARRAY_SIZE (s3c_iodesc)); + + samsung_cpu_id =__raw_readl (S3C24XX_GSTATUS1 ); +s3c24xx_init_cpu (); + +s3c_init_cpu (samsung_cpu_id, cpu_ids,ARRAY_SIZE (cpu_ids)); +}Why do we need this implemented in every Samsung mach directory? Why not provide a new function in
arch/arm/plat-s3c24xx/cpu.c:void
__inits3c24xx_common_init_io(void __iomem *id_reg, struct cpu_table *ids, size_t nr_ids){ iotable_init(s3c_iodesc, ARRAY_SIZE(s3c_iodesc)); samsung_cpu_id = __raw_readl(id_reg); s3c24xx_init_cpu(); s3c_init_cpu(samsung_cpu_id, ids, nr_ids); }
Quoted 8 lines
and then this becomes:
void
__inits3c2416_init_io(struct map_desc *mach_desc, int size){ /* initialise the io descriptors we need for initialisation */ iotable_init(mach_desc, size); s3c24xx_common_init_io(S3C24XX_GSTATUS1, cpu_ids, ARRAY_SIZE(cpu_ids)); }
this looks nice, and you're right of course, this is much saner.
PATCH v2 5/8 S3C2443: move io-init to SoC specific files
In reply to Heiko StübnerMove s3c2443 specific code from s3c24xx_init_io to s3c2443.c and make the s3c2443.h header obsolete.
--- arch/arm/mach-s3c2443/clock.c | 3 +- arch/arm/mach-s3c2443/mach-smdk2443.c | 5 ++- arch/arm/mach-s3c2443/s3c2443.c | 40 +++++++++++++++++++++++++- arch/arm/mach-s3c2443/s3c2443.h | 31 ++++++++++++++++++++ arch/arm/plat-s3c24xx/cpu.c | 11 ------- arch/arm/plat-samsung/include/plat/s3c2443.h | 34 ---------------------- 6 files changed, 75 insertions(+), 49 deletions(-) create mode 100644 arch/arm/mach-s3c2443/s3c2443.h delete mode 100644 arch/arm/plat-samsung/include/plat/s3c2443.h
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 "s3c2443.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/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 "s3c2443.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 +39 -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,45 @@#include <plat/adc-core.h> #include <plat/rtc-core.h> +#include "s3c2443.h" + +/* table of supported CPUs */ + +static const char name_s3c2443[] ="S3C2443" ; + +static struct cpu_table cpu_ids[]__initdata = { + { + .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 */ + +static struct map_desc s3c_iodesc[]__initdata = { +IODESC_ENT (GPIO ), +IODESC_ENT (IRQ ), +IODESC_ENT (MEMCTRL ), +IODESC_ENT (UART ) +}; + +void __init s3c2443_init_io (struct map_desc *mach_desc,int size) +{ +/* initialise the io descriptors we need for initialisation */ +iotable_init (mach_desc, size); +iotable_init (s3c_iodesc,ARRAY_SIZE (s3c_iodesc)); + + samsung_cpu_id =__raw_readl (S3C2410_GSTATUS1 ); +s3c24xx_init_cpu (); + +s3c_init_cpu (samsung_cpu_id, cpu_ids,ARRAY_SIZE (cpu_ids)); +} +static struct map_desc s3c2443_iodesc[]__initdata = {IODESC_ENT (WATCHDOG ),IODESC_ENT (CLKPWR ),
arch/arm/mach-s3c2443/s3c2443.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_S3C2443_H +#define __ARCH_ARM_MACH_S3C2443_S3C2443_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/plat-s3c24xx/cpu.c +0 -11
@@ -47,7 +47,6 @@#include <plat/s3c2410.h> #include <plat/s3c2412.h> #include <plat/s3c244x.h> -#include <plat/s3c2443.h> /* table of supported CPUs */
@@ -56,7 +55,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" ;
@@ -133,15 +131,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.2.3
PATCH v2 6/8 S3C2440: move io-init to SoC specific files
In reply to Heiko StübnerMove s3c244x specific code from s3c24xx_init_io to s3c244x.c and make the s3c244x.h header obsolete.
--- arch/arm/mach-s3c2440/common.h | 17 ------ arch/arm/mach-s3c2440/dsc.c | 2 +- arch/arm/mach-s3c2440/mach-anubis.c | 4 +- arch/arm/mach-s3c2440/mach-at2440evb.c | 4 +- arch/arm/mach-s3c2440/mach-gta02.c | 4 +- arch/arm/mach-s3c2440/mach-mini2440.c | 4 +- arch/arm/mach-s3c2440/mach-nexcoder.c | 5 +- arch/arm/mach-s3c2440/mach-osiris.c | 4 +- arch/arm/mach-s3c2440/mach-rx1950.c | 4 +- arch/arm/mach-s3c2440/mach-rx3715.c | 4 +- arch/arm/mach-s3c2440/mach-smdk2440.c | 5 +- arch/arm/mach-s3c2440/s3c2440.c | 3 +- arch/arm/mach-s3c2440/s3c2442.c | 3 +- arch/arm/mach-s3c2440/s3c244x.c | 70 +++++++++++++++++++++++++- arch/arm/mach-s3c2440/s3c244x.h | 37 ++++++++++++++ arch/arm/plat-s3c24xx/cpu.c | 41 --------------- arch/arm/plat-samsung/include/plat/s3c244x.h | 42 --------------- 17 files changed, 129 insertions(+), 124 deletions(-) delete mode 100644 arch/arm/mach-s3c2440/common.h create mode 100644 arch/arm/mach-s3c2440/s3c244x.h delete mode 100644 arch/arm/plat-samsung/include/plat/s3c244x.h
arch/arm/mach-s3c2440/common.h deleted +0 -17
@@ -1,17 +0,0 @@ -/* -* Copyright (c) 2011 Samsung Electronics Co., Ltd. -* http://www.samsung.com -* -* Common Header for S3C2440 machines -* -* 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_S3C2440_COMMON_H -#define __ARCH_ARM_MACH_S3C2440_COMMON_H - -void s3c2440_restart (char mode,const char *cmd); - -#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 "s3c244x.h" int s3c2440_set_dsc (unsigned int pin,unsigned int value) {
arch/arm/mach-s3c2440/mach-anubis.c +2 -2
@@ -55,7 +55,7 @@#include <plat/cpu.h> #include <plat/audio-simtec.h> -#include "common.h" +#include "s3c244x.h" #define COPYRIGHT ", Copyright 2005-2009 Simtec Electronics"
@@ -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 +2 -2
@@ -49,7 +49,7 @@#include <plat/cpu.h> #include <plat/mci.h> -#include "common.h" +#include "s3c244x.h" static struct map_desc at2440evb_iodesc[]__initdata = {/* Nothing here */
@@ -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 +2 -2
@@ -90,7 +90,7 @@#include <plat/iic.h> #include <plat/ts.h> -#include "common.h" +#include "s3c244x.h" static struct pcf50633 *gta02_pcf;
@@ -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 +2 -2
@@ -60,7 +60,7 @@#include <sound/s3c24xx_uda134x.h> -#include "common.h" +#include "s3c244x.h" #define MACH_MINI2440_DM9K_BASE (S3C2410_CS4 + 0x300)
@@ -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 +2 -3
@@ -42,12 +42,11 @@#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> -#include "common.h" +#include "s3c244x.h" static struct map_desc nexcoder_iodesc[]__initdata = {/* nothing here yet */
@@ -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 +2 -2
@@ -54,7 +54,7 @@#include <plat/devs.h> #include <plat/cpu.h> -#include "common.h" +#include "s3c244x.h" /* onboard perihperal map */
@@ -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 +2 -2
@@ -62,7 +62,7 @@#include <sound/uda1380.h> -#include "common.h" +#include "s3c244x.h" #define LCD_PWM_PERIOD 192960#define LCD_PWM_DUTY 127353
@@ -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 +2 -2
@@ -51,7 +51,7 @@#include <plat/cpu.h> #include <plat/pm.h> -#include "common.h" +#include "s3c244x.h" static struct map_desc rx3715_iodesc[]__initdata = {/* dump ISA space somewhere unused */
@@ -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 +2 -3
@@ -40,14 +40,13 @@#include <plat/iic.h> #include <plat/s3c2410.h> -#include <plat/s3c244x.h> #include <plat/clock.h> #include <plat/devs.h> #include <plat/cpu.h> #include <plat/common-smdk.h> -#include "common.h" +#include "s3c244x.h" static struct map_desc smdk2440_iodesc[]__initdata = {/* ISA IO Space map (memory space selected by A24) */
@@ -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 "s3c244x.h" +static struct device s3c2440_dev = { .bus = &s3c2440_subsys, };
arch/arm/mach-s3c2440/s3c2442.c +2 -1
@@ -44,13 +44,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 "s3c244x.h" +/* S3C2442 extended clock support */ static unsigned long s3c2442_camif_upll_round(struct clk *clk,
arch/arm/mach-s3c2440/s3c244x.c +69 -1
82 lines not on this page · raw message
arch/arm/mach-s3c2440/s3c244x.h new file +37 -0
@@ -0,0 +1,37 @@ +/* +* Copyright (c) 2011 Samsung Electronics Co., Ltd. +* http://www.samsung.com +* +* Common Header for S3C2440 machines +* +* 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_S3C2440_S3C244X_H +#define __ARCH_ARM_MACH_S3C2440_S3C244X_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_S3C244X_H */
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.2.3
PATCH v2 7/8 S3C2412: move io-init to SoC specific files
In reply to Heiko StübnerMove s3c2412 specific code from s3c24xx_init_io to s3c2412.c and make the s3c2412.h header obsolete.
--- arch/arm/mach-s3c2412/clock.c | 3 +- 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 | 49 +++++++++++++++++++++++++- arch/arm/mach-s3c2412/s3c2412.h | 30 ++++++++++++++++ arch/arm/plat-s3c24xx/cpu.c | 35 +------------------ arch/arm/plat-samsung/include/plat/s3c2412.h | 32 ----------------- 9 files changed, 90 insertions(+), 77 deletions(-) create mode 100644 arch/arm/mach-s3c2412/s3c2412.h delete mode 100644 arch/arm/plat-samsung/include/plat/s3c2412.h
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 "s3c2412.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/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 "s3c2412.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 "s3c2412.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 "s3c2412.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 "s3c2412.h" extern void s3c2412_sleep_enter (void );
arch/arm/mach-s3c2412/s3c2412.c +48 -1
61 lines not on this page · raw message
arch/arm/mach-s3c2412/s3c2412.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_S3C2412_H +#define __ARCH_ARM_MACH_S3C2412_S3C2412_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/plat-s3c24xx/cpu.c +1 -34
@@ -45,12 +45,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 = {
@@ -72,24 +70,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 */
@@ -103,15 +83,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 );
@@ -123,11 +94,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.2.3
PATCH v2 7/8 S3C2412: move io-init to SoC specific files
Quoted 17 lines · Heiko St?bner
arch/arm/plat-s3c24xx/cpu.c +0
-9@@ -103,15 +83,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 );
arch/arm/plat-s3c24xx/cpu.c void __init s3c24xx_init_io(struct map_desc *mach_desc, int size) · line 97
Quoted 9 lines
arch/arm/plat-s3c24xx/cpu.c +1
-5@@ -123,11 +94,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 ();
I really don't like seeing patches which do this kind of thing:
patch 1: move A
patch 2: move B
patch 3: move C and delete D which A,B,C all depend on
It means that if, for whatever reason, patch 2 has to be reverted or removed, you also have to revert patch 3. Rather than this:
patch 1: move A
patch 2: move B
patch 3: move C
patch 4: delete D which A,B,C all depend on
This makes each 'move' patches _totally_ independent of each other, and of the delete D patch, and makes the interdependencies of the patches easier to express and understand.
Note that you didn't say you deleted D, which the others rely upon, in the patch commentry:
Quoted 2 lines
Move s3c2412 specific code from
s3c24xx_init_iotos3c2412.cand make thes3c2412.hheader obsolete.
PATCH v2 8/8 S3C2410: move io-init to SoC specific files
In reply to Heiko StübnerMove s3c2410 specific code from s3c24xx_init_io to s3c2410.c 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/common.h | 17 ----- arch/arm/mach-s3c2410/mach-amlm5900.c | 4 +- arch/arm/mach-s3c2410/mach-bast.c | 4 +- arch/arm/mach-s3c2410/mach-h1940.c | 4 +- arch/arm/mach-s3c2410/mach-n30.c | 5 +- arch/arm/mach-s3c2410/mach-otom.c | 5 +- arch/arm/mach-s3c2410/mach-qt2410.c | 4 +- arch/arm/mach-s3c2410/mach-smdk2410.c | 4 +- arch/arm/mach-s3c2410/mach-tct_hammer.c | 4 +- arch/arm/mach-s3c2410/mach-vr1000.c | 4 +- arch/arm/mach-s3c2410/s3c2410.c | 50 +++++++++++++- arch/arm/mach-s3c2410/s3c2410.h | 28 +++++++ 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 | 101 -------------------------- 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 -------- 21 files changed, 95 insertions(+), 178 deletions(-) delete mode 100644 arch/arm/mach-s3c2410/common.h create mode 100644 arch/arm/mach-s3c2410/s3c2410.h delete mode 100644 arch/arm/plat-s3c24xx/cpu.c delete mode 100644 arch/arm/plat-samsung/include/plat/s3c2410.h
arch/arm/mach-s3c2410/common.h deleted +0 -17
@@ -1,17 +0,0 @@ -/* -* Copyright (c) 2011 Samsung Electronics Co., Ltd. -* http://www.samsung.com -* -* Common Header for S3C2410 machines -* -* 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_S3C2410_COMMON_H -#define __ARCH_ARM_MACH_S3C2410_COMMON_H - -void s3c2410_restart (char mode,const char *cmd); - -#endif /* __ARCH_ARM_MACH_S3C2410_COMMON_H */
arch/arm/mach-s3c2410/mach-amlm5900.c +2 -2
@@ -63,7 +63,7 @@#include <linux/mtd/map.h> #include <linux/mtd/physmap.h> -#include "common.h" +#include "s3c2410.h" static struct resource amlm5900_nor_resource = { .start =0x00000000 ,
@@ -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 +2 -2
@@ -66,7 +66,7 @@#include "usb-simtec.h" #include "nor-simtec.h" -#include "common.h" +#include "s3c2410.h" #define COPYRIGHT ", Copyright 2004-2008 Simtec Electronics"
@@ -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 +2 -2
@@ -70,7 +70,7 @@#include <sound/uda1380.h> -#include "common.h" +#include "s3c2410.h" #define H1940_LATCH ((void __force __iomem *)0xF8000000)
@@ -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 +2 -3
@@ -48,10 +48,9 @@#include <plat/cpu.h> #include <plat/devs.h> #include <plat/mci.h> -#include <plat/s3c2410.h> #include <plat/udc.h> -#include "common.h" +#include "s3c2410.h" static struct map_desc n30_iodesc[]__initdata = {/* nothing here yet */
@@ -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 +2 -3
@@ -32,13 +32,12 @@#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> #include <plat/cpu.h> -#include "common.h" +#include "s3c2410.h" static struct map_desc otom11_iodesc[]__initdata = {/* Device area */
@@ -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 +2 -2
@@ -62,7 +62,7 @@#include <plat/cpu.h> #include <plat/pm.h> -#include "common.h" +#include "s3c2410.h" static struct map_desc qt2410_iodesc[]__initdata = { {0xe0000000 ,__phys_to_pfn (S3C2410_CS3 +0x01000000 ),SZ_1M ,MT_DEVICE }
@@ -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 +2 -2
@@ -54,7 +54,7 @@#include <plat/common-smdk.h> -#include "common.h" +#include "s3c2410.h" static struct map_desc smdk2410_iodesc[]__initdata = {/* nothing here yet */
@@ -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 +2 -2
@@ -54,7 +54,7 @@#include <linux/mtd/map.h> #include <linux/mtd/physmap.h> -#include "common.h" +#include "s3c2410.h" static struct resource tct_hammer_nor_resource = { .start =0x00000000 ,
@@ -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 +2 -2
@@ -53,7 +53,7 @@#include "usb-simtec.h" #include "nor-simtec.h" -#include "common.h" +#include "s3c2410.h" /* macros for virtual address mods for the io space entries */ #define VA_C5 (item) ((unsigned long)(item) + BAST_VAM_CS5)
@@ -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 +49 -1
62 lines not on this page · raw message
arch/arm/mach-s3c2410/s3c2410.h new file +28 -0
@@ -0,0 +1,28 @@ +/* +* Copyright (c) 2011 Samsung Electronics Co., Ltd. +* http://www.samsung.com +* +* Common Header for S3C2410 machines +* +* 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_S3C2410_S3C2410_H +#define __ARCH_ARM_MACH_S3C2410_S3C2410_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-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 -101
101 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.2.3
v2 cover S3C24XX: remove global plat/s3c24??.h SoC-headers
In reply to Heiko StübnerQuoted 3 lines · Heiko St?bner
53 files changed, 485 insertions(+), 509 deletions(-) delete mode 100644 arch/arm/mach-s3c2410/common.h create mode 100644 arch/arm/mach-s3c2410/s3c2410.h
Given the amount of pain we've recently been through creating common.h in this merge window, I'm going to say no to getting rid of it this early. Hell, this merge window hasn't even closed and the file which was created during it is already being deleted?
No, this isn't right. Especially as you're having to change all the #include statements in each mach-* file from common.h to s3c2410.h.