[PATCH 03/19] ARM: S5PC1XX: prepare common cpu&clocks code for S5PC110 sub-platform

Marek Szyprowski m.szyprowski at samsung.com
Wed Nov 18 08:32:58 EST 2009


From: Kyungmin Park <kyungmin.park at samsung.com>

CLK_OTHER register block is specific for S5PC100 SoC, so move the
definition to mach-s5pc100/cpu.c. Size of CLK and PWR register block is
different on S5PC100 and S5PC110, thus new defines are introduced.

Clock and pll hierarchy is completely different between S5PC100 and
S5PC110 SoCs, so move related includes to new sub-platform and rename
plat-s5pc1xx/clocks.c and plat-s5pc1xx/s5pc100-clock.c to
s5pc100-clocks.c (periperal clocks definition) and s5pc100-plls.c (core
pll hierarchy definition).

Signed-off-by: Kyungmin Park <kyungmin.park at samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski at samsung.com>


---
 arch/arm/mach-s5pc100/cpu.c                        |    6 ++++++
 arch/arm/mach-s5pc100/include/mach/map.h           |    2 ++
 .../include/plat/regs-clock.h                      |    2 +-
 .../include/plat/regs-power.h                      |    2 +-
 arch/arm/plat-s5pc1xx/Makefile                     |    3 +--
 arch/arm/plat-s5pc1xx/cpu.c                        |   18 ++++++------------
 .../arm/plat-s5pc1xx/{clock.c => s5pc100-clocks.c} |    4 ++--
 .../{s5pc100-clock.c => s5pc100-plls.c}            |    2 +-
 8 files changed, 20 insertions(+), 19 deletions(-)
 rename arch/arm/{plat-s5pc1xx => mach-s5pc100}/include/plat/regs-clock.h (99%)
 rename arch/arm/{plat-s5pc1xx => mach-s5pc100}/include/plat/regs-power.h (98%)
 rename arch/arm/plat-s5pc1xx/{clock.c => s5pc100-clocks.c} (99%)
 rename arch/arm/plat-s5pc1xx/{s5pc100-clock.c => s5pc100-plls.c} (99%)

diff --git a/arch/arm/mach-s5pc100/cpu.c b/arch/arm/mach-s5pc100/cpu.c
index d79e757..41fdecf 100644
--- a/arch/arm/mach-s5pc100/cpu.c
+++ b/arch/arm/mach-s5pc100/cpu.c
@@ -46,6 +46,12 @@
 /* Initial IO mappings */
 
 static struct map_desc s5pc100_iodesc[] __initdata = {
+	{
+		.virtual	= (unsigned long)S5PC1XX_VA_CLK_OTHER,
+		.pfn		= __phys_to_pfn(S5PC1XX_PA_CLK_OTHER),
+		.length		= SZ_4K,
+		.type		= MT_DEVICE,
+	}
 };
 
 static void s5pc100_idle(void)
diff --git a/arch/arm/mach-s5pc100/include/mach/map.h b/arch/arm/mach-s5pc100/include/mach/map.h
index f90c033..88f267a 100644
--- a/arch/arm/mach-s5pc100/include/mach/map.h
+++ b/arch/arm/mach-s5pc100/include/mach/map.h
@@ -46,6 +46,8 @@
 #define S5PC1XX_VA_CLK		(S3C_VA_SYS + 0x10000)
 #define S5PC1XX_VA_PWR		(S3C_VA_SYS + 0x20000)
 #define S5PC1XX_VA_CLK_OTHER	(S3C_VA_SYS + 0x30000)
+#define S5PC1XX_SZ_CLK		SZ_4K
+#define S5PC1XX_SZ_PWR		SZ_4K
 
 /* GPIO */
 #define S5PC100_PA_GPIO		(0xE0300000)
diff --git a/arch/arm/plat-s5pc1xx/include/plat/regs-clock.h b/arch/arm/mach-s5pc100/include/plat/regs-clock.h
similarity index 99%
rename from arch/arm/plat-s5pc1xx/include/plat/regs-clock.h
rename to arch/arm/mach-s5pc100/include/plat/regs-clock.h
index c5cc86e..f0a007b 100644
--- a/arch/arm/plat-s5pc1xx/include/plat/regs-clock.h
+++ b/arch/arm/mach-s5pc100/include/plat/regs-clock.h
@@ -3,7 +3,7 @@
  * Copyright 2009 Samsung Electronics Co.
  *	Byungho Min <bhmin at samsung.com>
  *
- * S5PC1XX clock register definitions
+ * S5PC100 clock register definitions
  *
  * 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
diff --git a/arch/arm/plat-s5pc1xx/include/plat/regs-power.h b/arch/arm/mach-s5pc100/include/plat/regs-power.h
similarity index 98%
rename from arch/arm/plat-s5pc1xx/include/plat/regs-power.h
rename to arch/arm/mach-s5pc100/include/plat/regs-power.h
index 02ffa49..50a9679 100644
--- a/arch/arm/plat-s5pc1xx/include/plat/regs-power.h
+++ b/arch/arm/mach-s5pc100/include/plat/regs-power.h
@@ -3,7 +3,7 @@
  * Copyright 2009 Samsung Electronics Co.
  *	Jongse Won <jongse.won at samsung.com>
  *
- * S5PC1XX clock register definitions
+ * S5PC100 power controll register definitions
  *
  * 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
diff --git a/arch/arm/plat-s5pc1xx/Makefile b/arch/arm/plat-s5pc1xx/Makefile
index 278f268..5da300e 100644
--- a/arch/arm/plat-s5pc1xx/Makefile
+++ b/arch/arm/plat-s5pc1xx/Makefile
@@ -14,13 +14,12 @@ obj-				:=
 obj-y				+= dev-uart.o
 obj-y				+= cpu.o
 obj-y				+= irq.o irq-gpio.o irq-eint.o
-obj-y				+= clock.o
 obj-y				+= gpiolib.o
 
 # CPU support
 
 obj-$(CONFIG_CPU_S5PC100_INIT)	+= s5pc100-init.o
-obj-$(CONFIG_CPU_S5PC100_CLOCK)	+= s5pc100-clock.o
+obj-$(CONFIG_CPU_S5PC100_CLOCK)	+= s5pc100-plls.o s5pc100-clocks.o
 
 # Device setup
 
diff --git a/arch/arm/plat-s5pc1xx/cpu.c b/arch/arm/plat-s5pc1xx/cpu.c
index 02baeaa..ecd6d38 100644
--- a/arch/arm/plat-s5pc1xx/cpu.c
+++ b/arch/arm/plat-s5pc1xx/cpu.c
@@ -50,18 +50,11 @@ static struct cpu_table cpu_ids[] __initdata = {
 };
 /* minimal IO mapping */
 
-/* see notes on uart map in arch/arm/mach-s5pc100/include/mach/debug-macro.S */
-#define UART_OFFS (S3C_PA_UART & 0xffff)
 
 static struct map_desc s5pc1xx_iodesc[] __initdata = {
 	{
-		.virtual	= (unsigned long)S5PC1XX_VA_CLK_OTHER,
-		.pfn		= __phys_to_pfn(S5PC1XX_PA_CLK_OTHER),
-		.length		= SZ_4K,
-		.type		= MT_DEVICE,
-	}, {
 		.virtual	= (unsigned long)S5PC1XX_VA_GPIO,
-		.pfn		= __phys_to_pfn(S5PC100_PA_GPIO),
+		.pfn		= __phys_to_pfn(S5PC1XX_PA_GPIO),
 		.length		= SZ_4K,
 		.type		= MT_DEVICE,
 	}, {
@@ -72,15 +65,15 @@ static struct map_desc s5pc1xx_iodesc[] __initdata = {
 	}, {
 		.virtual	= (unsigned long)S5PC1XX_VA_CLK,
 		.pfn		= __phys_to_pfn(S5PC1XX_PA_CLK),
-		.length		= SZ_4K,
+		.length		= S5PC1XX_SZ_CLK,
 		.type		= MT_DEVICE,
 	}, {
 		.virtual	= (unsigned long)S5PC1XX_VA_PWR,
 		.pfn		= __phys_to_pfn(S5PC1XX_PA_PWR),
-		.length		= SZ_4K,
+		.length		= S5PC1XX_SZ_PWR,
 		.type		= MT_DEVICE,
 	}, {
-		.virtual	= (unsigned long)(S5PC1XX_VA_UART),
+		.virtual	= (unsigned long)S5PC1XX_VA_UART,
 		.pfn		= __phys_to_pfn(S5PC1XX_PA_UART),
 		.length		= SZ_4K,
 		.type		= MT_DEVICE,
@@ -115,8 +108,9 @@ void __init s5pc1xx_init_io(struct map_desc *mach_desc, int size)
 
 	/* initialise the io descriptors we need for initialisation */
 	iotable_init(s5pc1xx_iodesc, ARRAY_SIZE(s5pc1xx_iodesc));
-	iotable_init(mach_desc, size);
 
 	idcode = __raw_readl(S5PC1XX_VA_CHIPID);
 	s3c_init_cpu(idcode, cpu_ids, ARRAY_SIZE(cpu_ids));
+
+	iotable_init(mach_desc, size);
 }
diff --git a/arch/arm/plat-s5pc1xx/clock.c b/arch/arm/plat-s5pc1xx/s5pc100-clocks.c
similarity index 99%
rename from arch/arm/plat-s5pc1xx/clock.c
rename to arch/arm/plat-s5pc1xx/s5pc100-clocks.c
index 26c21d8..355e98a 100644
--- a/arch/arm/plat-s5pc1xx/clock.c
+++ b/arch/arm/plat-s5pc1xx/s5pc100-clocks.c
@@ -1,8 +1,8 @@
-/* linux/arch/arm/plat-s5pc1xx/clock.c
+/* linux/arch/arm/plat-s5pc100/s5pc100-clocks.c
  *
  * Copyright 2009 Samsung Electronics Co.
  *
- * S5PC1XX Base clock support
+ * S5PC100 - Clocks support
  *
  * Based on plat-s3c64xx/clock.c
  *
diff --git a/arch/arm/plat-s5pc1xx/s5pc100-clock.c b/arch/arm/plat-s5pc1xx/s5pc100-plls.c
similarity index 99%
rename from arch/arm/plat-s5pc1xx/s5pc100-clock.c
rename to arch/arm/plat-s5pc1xx/s5pc100-plls.c
index b436d44..e620bf2 100644
--- a/arch/arm/plat-s5pc1xx/s5pc100-clock.c
+++ b/arch/arm/plat-s5pc1xx/s5pc100-plls.c
@@ -1,4 +1,4 @@
-/* linux/arch/arm/plat-s5pc1xx/s5pc100-clock.c
+/* linux/arch/arm/plat-s5pc100/s5pc100-plls.c
  *
  * Copyright 2009 Samsung Electronics, Co.
  *	Byungho Min <bhmin at samsung.com>
-- 
1.6.4




More information about the linux-arm-kernel mailing list