ARM: S3C64XX: Added common.c and common.h for S3C64XX SoCs
Subsystems (3)
PATCH 1/1 ARM: S3C64XX: Added common.c and common.h for S3C64XX SoCs
This patch adds common.c and common.h which are used only in the arch/arm/mach-s3c64xx directory. The common.c file includes cpu.c, irq.c and irq-eint.c which are used commonly on S3C64XX SoCs and the common.h file includes plat/s3c6400.h and plat/s3c6410.h files.
Cc Ben Dooks <[email protected]>
Cc Russell King <[email protected]>
Signed-off-by Kukjin Kim <[email protected]>
--- arch/arm/mach-s3c64xx/Makefile | 63 ++--- arch/arm/mach-s3c64xx/clock.c | 4 +- arch/arm/mach-s3c64xx/common.c | 375 ++++++++++++++++++++++++++ arch/arm/mach-s3c64xx/common.h | 55 ++++ arch/arm/mach-s3c64xx/cpu.c | 161 ----------- arch/arm/mach-s3c64xx/irq-eint.c | 213 --------------- arch/arm/mach-s3c64xx/irq.c | 47 ---- arch/arm/mach-s3c64xx/mach-anw6410.c | 3 +- arch/arm/mach-s3c64xx/mach-crag6410.c | 3 +- arch/arm/mach-s3c64xx/mach-hmt.c | 3 +- arch/arm/mach-s3c64xx/mach-mini6410.c | 3 +- arch/arm/mach-s3c64xx/mach-ncp.c | 3 +- arch/arm/mach-s3c64xx/mach-real6410.c | 3 +- arch/arm/mach-s3c64xx/mach-smartq.c | 2 + arch/arm/mach-s3c64xx/mach-smartq5.c | 2 +- arch/arm/mach-s3c64xx/mach-smartq7.c | 2 +- arch/arm/mach-s3c64xx/mach-smdk6400.c | 3 +- arch/arm/mach-s3c64xx/mach-smdk6410.c | 3 +- arch/arm/mach-s3c64xx/s3c6400.c | 5 +- arch/arm/mach-s3c64xx/s3c6410.c | 6 +- arch/arm/plat-samsung/include/plat/cpu.h | 4 - arch/arm/plat-samsung/include/plat/s3c6400.h | 36 --- arch/arm/plat-samsung/include/plat/s3c6410.h | 29 -- 23 files changed, 487 insertions(+), 541 deletions(-) create mode 100644 arch/arm/mach-s3c64xx/common.c create mode 100644 arch/arm/mach-s3c64xx/common.h delete mode 100644 arch/arm/mach-s3c64xx/cpu.c delete mode 100644 arch/arm/mach-s3c64xx/irq-eint.c delete mode 100644 arch/arm/mach-s3c64xx/irq.c delete mode 100644 arch/arm/plat-samsung/include/plat/s3c6400.h delete mode 100644 arch/arm/plat-samsung/include/plat/s3c6410.h
arch/arm/mach-s3c64xx/Makefile +29 -34
@@ -10,53 +10,48 @@ obj-m := obj-n := obj- := -# Core files -obj-y += cpu.o -obj-y += clock.o +# Core -# Core support for S3C6400 system +obj-y += common.o clock.o + +# Core support obj-$(CONFIG_CPU_S3C6400) += s3c6400.o obj-$(CONFIG_CPU_S3C6410) += s3c6410.o -obj-y += irq.o -obj-y += irq-eint.o +# PM + +obj-$(CONFIG_PM) += pm.o irq-pm.o sleep.o # DMA support obj-$(CONFIG_S3C64XX_DMA) += dma.o -# Device setup +# Device support -obj-$(CONFIG_S3C64XX_SETUP_I2C0) += setup-i2c0.o -obj-$(CONFIG_S3C64XX_SETUP_I2C1) += setup-i2c1.o -obj-$(CONFIG_S3C64XX_SETUP_IDE) += setup-ide.o -obj-$(CONFIG_S3C64XX_SETUP_KEYPAD) += setup-keypad.o -obj-$(CONFIG_S3C64XX_SETUP_FB_24BPP) += setup-fb-24bpp.o -obj-$(CONFIG_S3C64XX_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o +obj-y += dev-uart.o +obj-y += dev-audio.o +obj-$(CONFIG_S3C64XX_DEV_SPI) += dev-spi.o -# PM +# Device setup -obj-$(CONFIG_PM) += pm.o -obj-$(CONFIG_PM) += sleep.o -obj-$(CONFIG_PM) += irq-pm.o +obj-$(CONFIG_S3C64XX_SETUP_FB_24BPP) += setup-fb-24bpp.o +obj-$(CONFIG_S3C64XX_SETUP_I2C0) += setup-i2c0.o +obj-$(CONFIG_S3C64XX_SETUP_I2C1) += setup-i2c1.o +obj-$(CONFIG_S3C64XX_SETUP_IDE) += setup-ide.o +obj-$(CONFIG_S3C64XX_SETUP_KEYPAD) += setup-keypad.o +obj-$(CONFIG_S3C64XX_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o # Machine support -obj-$(CONFIG_MACH_ANW6410) += mach-anw6410.o -obj-$(CONFIG_MACH_SMDK6400) += mach-smdk6400.o -obj-$(CONFIG_MACH_SMDK6410) += mach-smdk6410.o -obj-$(CONFIG_MACH_REAL6410) += mach-real6410.o -obj-$(CONFIG_MACH_MINI6410) += mach-mini6410.o -obj-$(CONFIG_MACH_NCP) += mach-ncp.o -obj-$(CONFIG_MACH_HMT) += mach-hmt.o -obj-$(CONFIG_MACH_SMARTQ) += mach-smartq.o -obj-$(CONFIG_MACH_SMARTQ5) += mach-smartq5.o -obj-$(CONFIG_MACH_SMARTQ7) += mach-smartq7.o -obj-$(CONFIG_MACH_WLF_CRAGG_6410) += mach-crag6410.o mach-crag6410-module.o - -# device support - -obj-y += dev-uart.o -obj-y += dev-audio.o -obj-$(CONFIG_S3C64XX_DEV_SPI) += dev-spi.o +obj-$(CONFIG_MACH_ANW6410) += mach-anw6410.o +obj-$(CONFIG_MACH_HMT) += mach-hmt.o +obj-$(CONFIG_MACH_MINI6410) += mach-mini6410.o +obj-$(CONFIG_MACH_NCP) += mach-ncp.o +obj-$(CONFIG_MACH_REAL6410) += mach-real6410.o +obj-$(CONFIG_MACH_SMARTQ) += mach-smartq.o +obj-$(CONFIG_MACH_SMARTQ5) += mach-smartq5.o +obj-$(CONFIG_MACH_SMARTQ7) += mach-smartq7.o +obj-$(CONFIG_MACH_SMDK6400) += mach-smdk6400.o +obj-$(CONFIG_MACH_SMDK6410) += mach-smdk6410.o +obj-$(CONFIG_MACH_WLF_CRAGG_6410) += mach-crag6410.o mach-crag6410-module.o
arch/arm/mach-s3c64xx/clock.c +2 -2
@@ -760,7 +760,7 @@ static struct clk_lookup s3c64xx_clk_lookup[] = {#define GET_DIV (clk, field) ((((clk) & field##_MASK) >> field##_SHIFT) + 1) -void __init_or_cpufreq s3c6400_setup_clocks(void) +void __init_or_cpufreq s3c64xx_setup_clocks(void) {struct clk *xtal_clk;unsigned long xtal;
@@ -859,7 +859,7 @@ static struct clk *clks[] __initdata = {* as ARMCLK as well as the necessary parent clocks. * * This call does not setup the clocks, which is left to the -* s3c6400_setup_clocks() call which may be needed by the cpufreq +* s3c64xx_setup_clocks() call which may be needed by the cpufreq * or resume code to re-set the clocks if the bootloader has changed * them. */
arch/arm/mach-s3c64xx/common.c new file +375 -0
375 lines not on this page · raw message
arch/arm/mach-s3c64xx/common.h new file +55 -0
55 lines not on this page · raw message
arch/arm/mach-s3c64xx/cpu.c deleted +0 -161
161 lines not on this page · raw message
arch/arm/mach-s3c64xx/irq-eint.c deleted +0 -213
213 lines not on this page · raw message
arch/arm/mach-s3c64xx/irq.c deleted +0 -47
47 lines not on this page · raw message
arch/arm/mach-s3c64xx/mach-anw6410.c +2 -1
@@ -45,13 +45,14 @@#include <plat/fb.h> #include <plat/regs-fb-v4.h> -#include <plat/s3c6410.h> #include <plat/clock.h> #include <plat/devs.h> #include <plat/cpu.h> #include <mach/regs-gpio.h> #include <mach/regs-modem.h> +#include "common.h" +/* DM9000 */ #define ANW6410_PA_DM9000 (0x18000000)
arch/arm/mach-s3c64xx/mach-crag6410.c +2 -1
@@ -52,7 +52,6 @@#include <mach/regs-gpio-memport.h> -#include <plat/s3c6410.h> #include <plat/regs-serial.h> #include <plat/regs-fb-v4.h> #include <plat/fb.h>
@@ -68,6 +67,8 @@#include <plat/iic.h> #include <plat/pm.h> +#include "common.h" +/* serial port setup */ #define UCON (S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK)
arch/arm/mach-s3c64xx/mach-hmt.c +2 -1
@@ -37,12 +37,13 @@#include <plat/fb.h> #include <plat/nand.h> -#include <plat/s3c6410.h> #include <plat/clock.h> #include <plat/devs.h> #include <plat/cpu.h> #include <plat/regs-fb-v4.h> +#include "common.h" +#define UCON S3C2410_UCON_DEFAULT#define ULCON (S3C2410_LCON_CS8 | S3C2410_LCON_PNONE)#define UFCON (S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE)
arch/arm/mach-s3c64xx/mach-mini6410.c +2 -1
@@ -33,7 +33,6 @@#include <mach/regs-modem.h> #include <mach/regs-srom.h> -#include <plat/s3c6410.h> #include <plat/adc.h> #include <plat/cpu.h> #include <plat/devs.h>
@@ -45,6 +44,8 @@#include <video/platform_lcd.h> +#include "common.h" +#define UCON S3C2410_UCON_DEFAULT#define ULCON (S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB)#define UFCON (S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE)
arch/arm/mach-s3c64xx/mach-ncp.c +2 -1
@@ -39,12 +39,13 @@#include <plat/iic.h> #include <plat/fb.h> -#include <plat/s3c6410.h> #include <plat/clock.h> #include <plat/devs.h> #include <plat/cpu.h> #include <plat/regs-fb-v4.h> +#include "common.h" +#define UCON S3C2410_UCON_DEFAULT#define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE#define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE
arch/arm/mach-s3c64xx/mach-real6410.c +2 -1
@@ -34,7 +34,6 @@#include <mach/regs-modem.h> #include <mach/regs-srom.h> -#include <plat/s3c6410.h> #include <plat/adc.h> #include <plat/cpu.h> #include <plat/devs.h>
@@ -46,6 +45,8 @@#include <video/platform_lcd.h> +#include "common.h" +#define UCON S3C2410_UCON_DEFAULT#define ULCON (S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB)#define UFCON (S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE)
arch/arm/mach-s3c64xx/mach-smartq.c +2 -0
@@ -40,6 +40,8 @@#include <video/platform_lcd.h> +#include "common.h" +#define UCON S3C2410_UCON_DEFAULT#define ULCON (S3C2410_LCON_CS8 | S3C2410_LCON_PNONE)#define UFCON (S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE)
arch/arm/mach-s3c64xx/mach-smartq5.c +1 -1
@@ -23,13 +23,13 @@#include <mach/map.h> #include <mach/regs-gpio.h> -#include <plat/s3c6410.h> #include <plat/cpu.h> #include <plat/devs.h> #include <plat/fb.h> #include <plat/gpio-cfg.h> #include <plat/regs-fb-v4.h> +#include "common.h" #include "mach-smartq.h" static struct gpio_led smartq5_leds[] = {
arch/arm/mach-s3c64xx/mach-smartq7.c +1 -1
@@ -23,13 +23,13 @@#include <mach/map.h> #include <mach/regs-gpio.h> -#include <plat/s3c6410.h> #include <plat/cpu.h> #include <plat/devs.h> #include <plat/fb.h> #include <plat/gpio-cfg.h> #include <plat/regs-fb-v4.h> +#include "common.h" #include "mach-smartq.h" static struct gpio_led smartq7_leds[] = {
arch/arm/mach-s3c64xx/mach-smdk6400.c +2 -1
@@ -31,12 +31,13 @@#include <plat/regs-serial.h> -#include <plat/s3c6400.h> #include <plat/clock.h> #include <plat/devs.h> #include <plat/cpu.h> #include <plat/iic.h> +#include "common.h" +#define UCON S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK#define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB#define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE
arch/arm/mach-s3c64xx/mach-smdk6410.c +2 -1
@@ -63,7 +63,6 @@#include <plat/fb.h> #include <plat/gpio-cfg.h> -#include <plat/s3c6410.h> #include <plat/clock.h> #include <plat/devs.h> #include <plat/cpu.h>
@@ -73,6 +72,8 @@#include <plat/backlight.h> #include <plat/regs-fb-v4.h> +#include "common.h" +#define UCON S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK#define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB#define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE
arch/arm/mach-s3c64xx/s3c6400.c +3 -2
@@ -38,7 +38,8 @@#include <plat/sdhci.h> #include <plat/iic-core.h> #include <plat/onenand-core.h> -#include <plat/s3c6400.h> + +#include "common.h" void __init s3c6400_map_io (void ) {
@@ -60,7 +61,7 @@ void __init s3c6400_map_io(void)void __init s3c6400_init_clocks (int xtal) {s3c64xx_register_clocks (xtal,S3C6400_CLKDIV0_ARM_MASK ); -s3c6400_setup_clocks (); +s3c64xx_setup_clocks (); }void __init s3c6400_init_irq (void )
arch/arm/mach-s3c64xx/s3c6410.c +3 -3
@@ -41,8 +41,8 @@#include <plat/adc-core.h> #include <plat/iic-core.h> #include <plat/onenand-core.h> -#include <plat/s3c6400.h> -#include <plat/s3c6410.h> + +#include "common.h" void __init s3c6410_map_io (void ) {
@@ -66,7 +66,7 @@ void __init s3c6410_init_clocks(int xtal) {printk (KERN_DEBUG "%s: initialising clocks\n" , __func__);s3c64xx_register_clocks (xtal,S3C6410_CLKDIV0_ARM_MASK ); -s3c6400_setup_clocks (); +s3c64xx_setup_clocks (); }void __init s3c6410_init_irq (void )
arch/arm/plat-samsung/include/plat/cpu.h +0 -4
@@ -152,11 +152,9 @@ extern void s3c_init_cpu(unsigned long idcode,/* core initialisation functions */ extern void s3c24xx_init_irq (void ); -extern void s3c64xx_init_irq (u32 vic0,u32 vic1);extern void s5p_init_irq (u32 *vic,u32 num_vic);extern void s3c24xx_init_io (struct map_desc *mach_desc,int size); -extern void s3c64xx_init_io (struct map_desc *mach_desc,int size);extern void s5p_init_io (struct map_desc *mach_desc,int size,void __iomem *cpuid_addr);
@@ -183,7 +181,6 @@ extern struct syscore_ops s3c2410_pm_syscore_ops;extern struct syscore_ops s3c2412_pm_syscore_ops;extern struct syscore_ops s3c2416_pm_syscore_ops;extern struct syscore_ops s3c244x_pm_syscore_ops; -extern struct syscore_ops s3c64xx_irq_syscore_ops;/* system device classes */
@@ -195,7 +192,6 @@ extern struct sysdev_class s3c2440_sysclass;extern struct sysdev_class s3c2442_sysclass;extern struct sysdev_class s3c2443_sysclass;extern struct sysdev_class s3c6410_sysclass; -extern struct sysdev_class s3c64xx_sysclass;extern struct sysdev_class s5p64x0_sysclass;extern struct sysdev_class s5pv210_sysclass;extern struct sysdev_class exynos4_sysclass;
arch/arm/plat-samsung/include/plat/s3c6400.h deleted +0 -36
@@ -1,36 +0,0 @@ -/* linux/arch/arm/plat-samsung/include/plat/s3c6400.h -* -* Copyright 2008 Openmoko, Inc. -* Copyright 2008 Simtec Electronics -* Ben Dooks <[email protected]> -* http://armlinux.simtec.co.uk/ -* -* Header file for s3c6400 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. -*/ - -/* Common init code for S3C6400 related SoCs */ - -extern void s3c6400_common_init_uarts (struct s3c2410_uartcfg *cfg,int no); -extern void s3c6400_setup_clocks (void ); - -extern void s3c64xx_register_clocks (unsigned long xtal,unsigned armclk_limit); - -#ifdef CONFIG_CPU_S3C6400 - -extern int s3c6400_init (void ); -extern void s3c6400_init_irq (void ); -extern void s3c6400_map_io (void ); -extern void s3c6400_init_clocks (int xtal); - -#define s3c6400_init_uarts s3c6400_common_init_uarts - -#else -#define s3c6400_init_clocks NULL -#define s3c6400_init_uarts NULL -#define s3c6400_map_io NULL -#define s3c6400_init NULL -#endif
arch/arm/plat-samsung/include/plat/s3c6410.h deleted +0 -29
@@ -1,29 +0,0 @@ -/* linux/arch/arm/plat-samsung/include/plat/s3c6410.h -* -* Copyright 2008 Openmoko, Inc. -* Copyright 2008 Simtec Electronics -* Ben Dooks <[email protected]> -* http://armlinux.simtec.co.uk/ -* -* Header file for s3c6410 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_S3C6410 - -extern int s3c6410_init (void ); -extern void s3c6410_init_irq (void ); -extern void s3c6410_map_io (void ); -extern void s3c6410_init_clocks (int xtal); - -#define s3c6410_init_uarts s3c6400_common_init_uarts - -#else -#define s3c6410_init_clocks NULL -#define s3c6410_init_uarts NULL -#define s3c6410_map_io NULL -#define s3c6410_init NULL -#endif
Signature · 1 line
1.7.1