ARM: S3C24XX: move some code from plat to mach directory
Subsystems (3)
v2 cover ARM: S3C24XX: move some code from plat to mach directory
Again the series of small moves of common code from the plat-s3c24xx to the mach-s3c24xx directory.
This time without the wrong handled irq.c . Hopefully I'll get time to do it properly later.
As the dev-uart.c move breaks the resource patch by Tushar Behera, I updated the patch to fix the correct code and will submit it as a v2 to the resource series.
Heiko Stuebner (4):
ARM: S3C24XX: move plat-s3c24xx/cpu.c
ARM: S3C24XX: move plat-s3c24xx/dev-uart.c into common.c
ARM: S3C24XX: move common power-management code to mach-s3c24xx
ARM: S3C24XX: move common clock init into common.c
arch/arm/mach-s3c24xx/Makefile | 6 +
.../{plat-s3c24xx/cpu.c => mach-s3c24xx/common.c} | 93 ++++++++++++++++++-
arch/arm/{plat-s3c24xx => mach-s3c24xx}/irq-pm.c | 0
arch/arm/{plat-s3c24xx => mach-s3c24xx}/pm.c | 0
arch/arm/{plat-s3c24xx => mach-s3c24xx}/sleep.S | 0
arch/arm/plat-s3c24xx/Makefile | 6 -
arch/arm/plat-s3c24xx/clock.c | 59 ------------
arch/arm/plat-s3c24xx/dev-uart.c | 100 --------------------
8 files changed, 98 insertions(+), 166 deletions(-)
rename arch/arm/{plat-s3c24xx/cpu.c => mach-s3c24xx/common.c} (75%)
rename arch/arm/{plat-s3c24xx => mach-s3c24xx}/irq-pm.c (100%)
rename arch/arm/{plat-s3c24xx => mach-s3c24xx}/pm.c (100%)
rename arch/arm/{plat-s3c24xx => mach-s3c24xx}/sleep.S (100%)
delete mode 100644 arch/arm/plat-s3c24xx/clock.c
delete mode 100644 arch/arm/plat-s3c24xx/dev-uart.cSignature · 1 line
1.7.5.4
PATCH v2 1/4 ARM: S3C24XX: move plat-s3c24xx/cpu.c
Following the model of s3c64xx cpu.c becomes common.c in mach-s3c24xx, to got more common code added later on.
---
arch/arm/mach-s3c24xx/Makefile | 2 ++
.../{plat-s3c24xx/cpu.c => mach-s3c24xx/common.c} | 2 +-
arch/arm/plat-s3c24xx/Makefile | 1 -
3 files changed, 3 insertions(+), 2 deletions(-)
rename arch/arm/{plat-s3c24xx/cpu.c => mach-s3c24xx/common.c} (99%)arch/arm/mach-s3c24xx/Makefile +2 -0
@@ -14,6 +14,8 @@ obj- := # core +obj-y += common.o + obj-$(CONFIG_CPU_S3C2410) += s3c2410.o obj-$(CONFIG_S3C2410_DMA) += dma-s3c2410.o obj-$(CONFIG_S3C2410_PM) += pm-s3c2410.o sleep-s3c2410.o
arch/arm/mach-s3c24xx/common.c renamed from arch/arm/plat-s3c24xx/cpu.c +1 -1
@@ -4,7 +4,7 @@* http://www.simtec.co.uk/products/SWLINUX/ * Ben Dooks <[email protected]> * -* S3C24XX CPU Support +* Common code for S3C24XX machines * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by
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
Signature · 1 line
1.7.5.4
PATCH v2 2/4 ARM: S3C24XX: move plat-s3c24xx/dev-uart.c into common.c
In reply to Heiko StübnerThe uart devices are used on all s3c24xx machines, so they can reside in the common code for all machines.
--- arch/arm/mach-s3c24xx/common.c | 73 +++++++++++++++++++++++++++ arch/arm/plat-s3c24xx/Makefile | 1 - arch/arm/plat-s3c24xx/dev-uart.c | 100 -------------------------------------- 3 files changed, 73 insertions(+), 101 deletions(-) delete mode 100644 arch/arm/plat-s3c24xx/dev-uart.c
arch/arm/mach-s3c24xx/common.c +73 -0
@@ -234,3 +234,76 @@ void __init s3c24xx_init_io(struct map_desc *mach_desc, int size)s3c_init_cpu (samsung_cpu_id, cpu_ids,ARRAY_SIZE (cpu_ids)); } + +/* Serial port registrations */ + +static struct resource s3c2410_uart0_resource[] = { + [0 ] = { + .start =S3C2410_PA_UART0 , + .end =S3C2410_PA_UART0 +0x3fff , + .flags =IORESOURCE_MEM , + }, + [1 ] = { + .start =IRQ_S3CUART_RX0 , + .end =IRQ_S3CUART_ERR0 , + .flags =IORESOURCE_IRQ , + } +}; + +static struct resource s3c2410_uart1_resource[] = { + [0 ] = { + .start =S3C2410_PA_UART1 , + .end =S3C2410_PA_UART1 +0x3fff , + .flags =IORESOURCE_MEM , + }, + [1 ] = { + .start =IRQ_S3CUART_RX1 , + .end =IRQ_S3CUART_ERR1 , + .flags =IORESOURCE_IRQ , + } +}; + +static struct resource s3c2410_uart2_resource[] = { + [0 ] = { + .start =S3C2410_PA_UART2 , + .end =S3C2410_PA_UART2 +0x3fff , + .flags =IORESOURCE_MEM , + }, + [1 ] = { + .start =IRQ_S3CUART_RX2 , + .end =IRQ_S3CUART_ERR2 , + .flags =IORESOURCE_IRQ , + } +}; + +static struct resource s3c2410_uart3_resource[] = { + [0 ] = { + .start =S3C2443_PA_UART3 , + .end =S3C2443_PA_UART3 +0x3fff , + .flags =IORESOURCE_MEM , + }, + [1 ] = { + .start =IRQ_S3CUART_RX3 , + .end =IRQ_S3CUART_ERR3 , + .flags =IORESOURCE_IRQ , + }, +}; + +struct s3c24xx_uart_resources s3c2410_uart_resources[]__initdata = { + [0 ] = { + .resources = s3c2410_uart0_resource, + .nr_resources =ARRAY_SIZE (s3c2410_uart0_resource), + }, + [1 ] = { + .resources = s3c2410_uart1_resource, + .nr_resources =ARRAY_SIZE (s3c2410_uart1_resource), + }, + [2 ] = { + .resources = s3c2410_uart2_resource, + .nr_resources =ARRAY_SIZE (s3c2410_uart2_resource), + }, + [3 ] = { + .resources = s3c2410_uart3_resource, + .nr_resources =ARRAY_SIZE (s3c2410_uart3_resource), + }, +};
arch/arm/plat-s3c24xx/Makefile +0 -1
@@ -13,7 +13,6 @@ obj- := # Core files obj-y += irq.o -obj-y += dev-uart.o obj-y += clock.o obj-$(CONFIG_S3C24XX_DCLK) += clock-dclk.o
arch/arm/plat-s3c24xx/dev-uart.c deleted +0 -100
100 lines not on this page · raw message
Signature · 1 line
1.7.5.4
PATCH v2 3/4 ARM: S3C24XX: move common power-management code to mach-s3c24xx
In reply to Heiko StübnerThis is the basic power-management code used by all s3c24xx machines.
---
arch/arm/mach-s3c24xx/Makefile | 4 ++++
arch/arm/{plat-s3c24xx => mach-s3c24xx}/irq-pm.c | 0
arch/arm/{plat-s3c24xx => mach-s3c24xx}/pm.c | 0
arch/arm/{plat-s3c24xx => mach-s3c24xx}/sleep.S | 0
arch/arm/plat-s3c24xx/Makefile | 3 ---
5 files changed, 4 insertions(+), 3 deletions(-)
rename arch/arm/{plat-s3c24xx => mach-s3c24xx}/irq-pm.c (100%)
rename arch/arm/{plat-s3c24xx => mach-s3c24xx}/pm.c (100%)
rename arch/arm/{plat-s3c24xx => mach-s3c24xx}/sleep.S (100%)arch/arm/mach-s3c24xx/Makefile +4 -0
@@ -35,6 +35,10 @@ obj-$(CONFIG_S3C2440_DMA) += dma-s3c2440.o obj-$(CONFIG_CPU_S3C2443) += s3c2443.o irq-s3c2443.o clock-s3c2443.o +# PM + +obj-$(CONFIG_PM) += pm.o irq-pm.o sleep.o + # common code obj-$(CONFIG_S3C2443_COMMON) += common-s3c2443.o
arch/arm/mach-s3c24xx/irq-pm.c renamed from arch/arm/plat-s3c24xx/irq-pm.c +0 -0
arch/arm/mach-s3c24xx/pm.c renamed from arch/arm/plat-s3c24xx/pm.c +0 -0
arch/arm/mach-s3c24xx/sleep.S renamed from arch/arm/plat-s3c24xx/sleep.S +0 -0
arch/arm/plat-s3c24xx/Makefile +0 -3
@@ -21,9 +21,6 @@ obj-$(CONFIG_CPU_FREQ_S3C24XX_DEBUGFS) += cpu-freq-debugfs.o # Architecture dependent builds -obj-$(CONFIG_PM) += pm.o -obj-$(CONFIG_PM) += irq-pm.o -obj-$(CONFIG_PM) += sleep.o obj-$(CONFIG_S3C2410_CLOCK) += s3c2410-clock.o obj-$(CONFIG_S3C24XX_DMA) += dma.o obj-$(CONFIG_S3C2410_IOTIMING) += s3c2410-iotiming.o
Signature · 1 line
1.7.5.4
PATCH v2 4/4 ARM: S3C24XX: move common clock init into common.c
In reply to Heiko Stübner--- arch/arm/mach-s3c24xx/common.c | 18 ++++++++++++ arch/arm/plat-s3c24xx/Makefile | 1 - arch/arm/plat-s3c24xx/clock.c | 59 ---------------------------------------- 3 files changed, 18 insertions(+), 60 deletions(-) delete mode 100644 arch/arm/plat-s3c24xx/clock.c
arch/arm/mach-s3c24xx/common.c +18 -0
@@ -41,6 +41,7 @@#include <asm/mach/arch.h> #include <asm/mach/map.h> +#include <mach/regs-clock.h> #include <mach/regs-gpio.h> #include <plat/regs-serial.h>
@@ -52,6 +53,8 @@#include <plat/s3c2416.h> #include <plat/s3c244x.h> #include <plat/s3c2443.h> +#include <plat/cpu-freq.h> +#include <plat/pll.h> /* table of supported CPUs */
@@ -307,3 +310,18 @@ struct s3c24xx_uart_resources s3c2410_uart_resources[] __initdata = { .nr_resources = ARRAY_SIZE(s3c2410_uart3_resource), }, }; + +/* initialise all the clocks */ + +void __init_or_cpufreq s3c24xx_setup_clocks(unsigned long fclk, +unsigned long hclk, +unsigned long pclk) +{ + clk_upll.rate =s3c24xx_get_pll (__raw_readl (S3C2410_UPLLCON ), + clk_xtal.rate); + + clk_mpll.rate = fclk; + clk_h.rate = hclk; + clk_p.rate = pclk; + clk_f.rate = fclk; +}
arch/arm/plat-s3c24xx/Makefile +0 -1
@@ -13,7 +13,6 @@ obj- := # Core files obj-y += irq.o -obj-y += clock.o obj-$(CONFIG_S3C24XX_DCLK) += clock-dclk.o obj-$(CONFIG_CPU_FREQ_S3C24XX) += cpu-freq.o
arch/arm/plat-s3c24xx/clock.c deleted +0 -59
59 lines not on this page · raw message
Signature · 1 line
1.7.5.4
v2 cover ARM: S3C24XX: move some code from plat to mach directory
In reply to Heiko StübnerQuoted 38 lines · Heiko St?bner
Again the series of small moves of common code from the plat-s3c24xx to the
mach-s3c24xx directory.This time without the wrong handled
irq.c. Hopefully I'll get time to do it
properly later.As the
dev-uart.cmove breaks the resource patch by Tushar Behera, I updated
the patch to fix the correct code and will submit it as a v2 to the resource
series.Heiko Stuebner (4):
ARM: S3C24XX: moveplat-s3c24xx/cpu.c
ARM: S3C24XX: moveplat-s3c24xx/dev-uart.cintocommon.c
ARM: S3C24XX: move common power-management code to mach-s3c24xx
ARM: S3C24XX: move common clock init intocommon.carch/arm/mach-s3c24xx/Makefile | 6 + .../{plat-s3c24xx/cpu.c => mach-s3c24xx/common.c} | 93 ++++++++++++++++++- arch/arm/{plat-s3c24xx => mach-s3c24xx}/irq-pm.c | 0 arch/arm/{plat-s3c24xx => mach-s3c24xx}/pm.c | 0 arch/arm/{plat-s3c24xx => mach-s3c24xx}/sleep.S | 0 arch/arm/plat-s3c24xx/Makefile | 6 - arch/arm/plat-s3c24xx/clock.c | 59 ------------ arch/arm/plat-s3c24xx/dev-uart.c | 100 -------------------- 8 files changed, 98 insertions(+), 166 deletions(-) rename arch/arm/{plat-s3c24xx/cpu.c => mach-s3c24xx/common.c} (75%) rename arch/arm/{plat-s3c24xx => mach-s3c24xx}/irq-pm.c (100%) rename arch/arm/{plat-s3c24xx => mach-s3c24xx}/pm.c (100%) rename arch/arm/{plat-s3c24xx => mach-s3c24xx}/sleep.S (100%) delete mode 100644 arch/arm/plat-s3c24xx/clock.c delete mode 100644 arch/arm/plat-s3c24xx/dev-uart.c
Quoted 2 lines
--
1.7.5.4
Thanks for your re-posting.
Looks better. Will apply this series instead.
Thanks.
Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.