Skip to contentSkip to conversation

ARM: Samsung: S5PC100 platform cleanup

PATCH Superseded Marek Szyprowski 4 participants 50 messages Apr 2, 2010 – May 13, 2010

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: Samsung: S5PC100 platform cleanup

Hello,

This patch series perform a general cleanup in Samsung S5PC100 SoC support. This chip is moved from custom s5pc1xx platform framework to new plat-s5p framework, so more common code can be easily reused in upcomming extensions for S5PV210/S5PC110 SoCs.

This patch series is prepared with assumption that my previous patch series are already applied:
1. Add support for Aquita board (Samsung S5PC110 based)
2. ARM: Samsung: fix broken timer irq base
3. Add S5PV210/S5PC110 platform helpers

I've tried to split my changes as much as possible to clearly show how the transition from plat-s5pc1xx to plat-s5p is being done.

This patch series includes:

[PATCH 01/16] ARM: S5PC1xx rename registers to match plat-s5p style
[PATCH 02/16] drivers: serial: S5PC100 serial driver cleanup
[PATCH 03/16] ARM: Samsung: plat-s5p - enable access to clk_27m clock [PATCH 04/16] ARM: S5PC100: copy clocks from plat-s5pc1xx
[PATCH 05/16] ARM: S5PC100: new clocks definition
[PATCH 06/16] ARM: Samsung: move S5PC100 support from plat-s5pc1xx to plat-s5p framework [PATCH 07/16] ARM: S5PC100: Move gpio support from plat-s5pc1xx to mach-s5pc100 [PATCH 08/16] ARM: S5PC100: Move frame buffer helpers from plat-s5pc1xx to mach-s5pc100 [PATCH 09/16] ARM: SMDKC100: enable frame buffer again
[PATCH 10/16] ARM: S5PC100: Move i2c helpers from plat-s5pc1xx to mach-s5pc100 [PATCH 11/16] ARM: SMDKC100: enable i2c support again
[PATCH 12/16] ARM: S5PC100: Move sdhci helpers from plat-s5pc1xx to mach-s5pc100 [PATCH 13/16] ARM: SMDKC100: enable sdhci support again
[PATCH 14/16] ARM: Samsung: Move external interrupts support from plat-s5pc1xx to plat-s5p [PATCH 15/16] ARM: S5PC100: Add support for gpio interrupt
[PATCH 16/16] ARM: remove obsolete plat-s5pc1xx directory

#1 lore raw

PATCH 1/16 ARM: S5PC1xx rename registers to match plat-s5p style

Prepare for moving support for S5PC100 SoC to plat-s5p framework (part 1). Rename all clock registers to match plat-s5p style.

---
 arch/arm/mach-s5pc100/include/mach/system.h     |    2 +-
 arch/arm/plat-s5pc1xx/clock.c                   |  190 ++++++------
 arch/arm/plat-s5pc1xx/include/plat/regs-clock.h |  366 +++++++++++-----------
 arch/arm/plat-s5pc1xx/s5pc100-clock.c           |  180 ++++++------
 4 files changed, 369 insertions(+), 369 deletions(-)
arch/arm/mach-s5pc100/include/mach/system.h +1 -1
index f0d31a2..09aea4d 100644
@@ -25,7 +25,7 @@ static void arch_idle(void)
 
 static void arch_reset(char mode, const char *cmd)
 {
-	__raw_writel(S5PC100_SWRESET_RESETVAL, S5PC100_SWRESET);
+	__raw_writel(S5P_SWRESET_RESETVAL, S5P_SWRESET);
 	return;
 }
 #endif /* __ASM_ARCH_IRQ_H */
arch/arm/plat-s5pc1xx/clock.c +95 -95

655 lines not on this page · raw message

arch/arm/plat-s5pc1xx/include/plat/regs-clock.h +183 -183

430 lines not on this page · raw message

arch/arm/plat-s5pc1xx/s5pc100-clock.c +90 -90

428 lines not on this page · raw message

Signature · 1 line
1.6.4
#2 lore raw

PATCH 1/16 ARM: S5PC1xx rename registers to match plat-s5p style

Quoted 10 lines · Marek Szyprowski

Prepare for moving support for S5PC100 SoC to plat-s5p framework (part 1). Rename all clock registers to match plat-s5p style.

---
 arch/arm/mach-s5pc100/include/mach/system.h     |    2 +-
 arch/arm/plat-s5pc1xx/clock.c                   |  190 ++++++------
 arch/arm/plat-s5pc1xx/include/plat/regs-clock.h |  366

+++++++++++-----------

Quoted 9 lines
 arch/arm/plat-s5pc1xx/s5pc100-clock.c           |  180 ++++++------
 4 files changed, 369 insertions(+), 369 deletions(-)
arch/arm/mach- renamed from arch/arm/mach-s5pc100/include/mach/system.h +0 -0

s5pc100/include/mach/system.h
index f0d31a2..09aea4d 100644

arch/arm/mach-s5pc100/include/mach/system.h static void arch_idle(void) · line 31

Quoted 8 lines
arch/arm/mach-s5pc100/include/mach/system.h +1 -1
@@ -25,7 +25,7 @@ static void arch_idle(void)
 
 static void arch_reset(char mode, const char *cmd)
 {
-	__raw_writel(S5PC100_SWRESET_RESETVAL, S5PC100_SWRESET);
+	__raw_writel(S5P_SWRESET_RESETVAL, S5P_SWRESET);
 	return;
 }
 #endif /* __ASM_ARCH_IRQ_H */

Why __ASM_ARCH_IRQ_H?
It may be right __ASM_ARCH_SYSTEM_H.

arch/arm/plat-s5pc1xx/clock.c static int s5pc1xx_clk_gate(void __iomem *reg, struct

Quoted 23 lines
arch/arm/plat-s5pc1xx/clock.c +4 -4
index 387f231..1a07dd5 100644
@@ -39,13 +39,13 @@ static int clk_48m_ctrl(struct clk *clk, int enable)
 	/* can't rely on clock lock, this register has other usages */
 	local_irq_save(flags);
 
-	val = __raw_readl(S5PC100_CLKSRC1);
+	val = __raw_readl(S5P_CLK_SRC1);	
 	if (enable)
-		val |= S5PC100_CLKSRC1_CLK48M_MASK;
+		val |= S5P_CLK_SRC1_CLK48M_MASK;
 	else
-		val &= ~S5PC100_CLKSRC1_CLK48M_MASK;
+		val &= ~S5P_CLK_SRC1_CLK48M_MASK;
 
-	__raw_writel(val, S5PC100_CLKSRC1);
+	__raw_writel(val, S5P_CLK_SRC1);
 	local_irq_restore(flags);
 
 	return 0;
@@ -99,62 +99,62 @@ static int s5pc1xx_clk_gate(void __iomem *reg, struct

clk

arch/arm/plat-s5pc1xx/clock.c static int s5pc1xx_clk_gate(void __iomem *reg, struct clk *clk, int enable) · line 102

Quoted 6 lines
arch/arm/plat-s5pc1xx/clock.c +1 -1
 *clk, int enable)
 
 static int s5pc100_clk_d00_ctrl(struct clk *clk, int enable)
 {
-	return s5pc1xx_clk_gate(S5PC100_CLKGATE_D00, clk, enable);
+	return s5pc1xx_clk_gate(S5P_CLKGATE_D00, clk, enable);

Please use s5p_gatectrl(plat-s5p/clock.c) instead of s5pc1xx_clk_gate.

arch/arm/plat-s5pc1xx/clock.c static int s5pc1xx_clk_gate(void __iomem *reg, struct clk *clk, int enable) · line 107

Quoted 6 lines
arch/arm/plat-s5pc1xx/clock.c +1 -1
 }
 
 static int s5pc100_clk_d01_ctrl(struct clk *clk, int enable)
 {
-	return s5pc1xx_clk_gate(S5PC100_CLKGATE_D01, clk, enable);
+	return s5pc1xx_clk_gate(S5P_CLKGATE_D01, clk, enable);

Same.

Quoted 50 lines
arch/arm/plat-s5pc1xx/clock.c +8 -8
 }
 
 static int s5pc100_clk_d02_ctrl(struct clk *clk, int enable)
 {
-	return s5pc1xx_clk_gate(S5PC100_CLKGATE_D02, clk, enable);
+	return s5pc1xx_clk_gate(S5P_CLKGATE_D02, clk, enable);
 }
 
 static int s5pc100_clk_d10_ctrl(struct clk *clk, int enable)
 {
-	return s5pc1xx_clk_gate(S5PC100_CLKGATE_D10, clk, enable);
+	return s5pc1xx_clk_gate(S5P_CLKGATE_D10, clk, enable);
 }
 
 static int s5pc100_clk_d11_ctrl(struct clk *clk, int enable)
 {
-	return s5pc1xx_clk_gate(S5PC100_CLKGATE_D11, clk, enable);
+	return s5pc1xx_clk_gate(S5P_CLKGATE_D11, clk, enable);
 }
 
 static int s5pc100_clk_d12_ctrl(struct clk *clk, int enable)
 {
-	return s5pc1xx_clk_gate(S5PC100_CLKGATE_D12, clk, enable);
+	return s5pc1xx_clk_gate(S5P_CLKGATE_D12, clk, enable);
 }
 
 static int s5pc100_clk_d13_ctrl(struct clk *clk, int enable)
 {
-	return s5pc1xx_clk_gate(S5PC100_CLKGATE_D13, clk, enable);
+	return s5pc1xx_clk_gate(S5P_CLKGATE_D13, clk, enable);
 }
 
 static int s5pc100_clk_d14_ctrl(struct clk *clk, int enable)
 {
-	return s5pc1xx_clk_gate(S5PC100_CLKGATE_D14, clk, enable);
+	return s5pc1xx_clk_gate(S5P_CLKGATE_D14, clk, enable);
 }
 
 static int s5pc100_clk_d15_ctrl(struct clk *clk, int enable)
 {
-	return s5pc1xx_clk_gate(S5PC100_CLKGATE_D15, clk, enable);
+	return s5pc1xx_clk_gate(S5P_CLKGATE_D15, clk, enable);
 }
 
 static int s5pc100_clk_d20_ctrl(struct clk *clk, int enable)
 {
-	return s5pc1xx_clk_gate(S5PC100_CLKGATE_D20, clk, enable);
+	return s5pc1xx_clk_gate(S5P_CLKGATE_D20, clk, enable);
 }
 

arch/arm/plat-s5pc1xx/clock.c static int s5pc1xx_clk_gate(void __iomem *reg, struct clk *clk, int enable) · line 157

Quoted 10 lines
arch/arm/plat-s5pc1xx/clock.c +2 -2
 int s5pc100_sclk0_ctrl(struct clk *clk, int enable)
 {
-	return s5pc1xx_clk_gate(S5PC100_SCLKGATE0, clk, enable);
+	return s5pc1xx_clk_gate(S5P_SCLKGATE0, clk, enable);
 }
 
 int s5pc100_sclk1_ctrl(struct clk *clk, int enable)
 {
-	return s5pc1xx_clk_gate(S5PC100_SCLKGATE1, clk, enable);
+	return s5pc1xx_clk_gate(S5P_SCLKGATE1, clk, enable);

Same comment as for above...

Quoted 568 lines
arch/arm/plat-s5pc1xx/clock.c +0 -0
 }
 

static struct clk s5pc100_init_clocks_disable[] = {

arch/arm/plat-s5pc1xx/clock.c +78 -78
@@ -163,43 +163,43 @@ static struct clk s5pc100_init_clocks_disable[] = {
 		.id		= -1,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d11_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D11_DSI,
+		.ctrlbit	= S5P_CLKGATE_D11_DSI,
 	}, {
 		.name		= "csi",
 		.id		= -1,
 		.parent		= &clk_h,
 		.enable		= s5pc100_clk_d11_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D11_CSI,
+		.ctrlbit	= S5P_CLKGATE_D11_CSI,
 	}, {
 		.name		= "ccan",
 		.id		= 0,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d14_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D14_CCAN0,
+		.ctrlbit	= S5P_CLKGATE_D14_CCAN0,
 	}, {
 		.name		= "ccan",
 		.id		= 1,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d14_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D14_CCAN1,
+		.ctrlbit	= S5P_CLKGATE_D14_CCAN1,
 	}, {
 		.name		= "keypad",
 		.id		= -1,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d15_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D15_KEYIF,
+		.ctrlbit	= S5P_CLKGATE_D15_KEYIF,
 	}, {
 		.name		= "hclkd2",
 		.id		= -1,
 		.parent		= NULL,
 		.enable		= s5pc100_clk_d20_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D20_HCLKD2,
+		.ctrlbit	= S5P_CLKGATE_D20_HCLKD2,
 	}, {
 		.name		= "iis-d2",
 		.id		= -1,
 		.parent		= NULL,
 		.enable		= s5pc100_clk_d20_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D20_I2SD2,
+		.ctrlbit	= S5P_CLKGATE_D20_I2SD2,
 	},
 };
 
@@ -210,43 +210,43 @@ static struct clk s5pc100_init_clocks[] = {
 		.id		= -1,
 		.parent		= &clk_hd0,
 		.enable		= s5pc100_clk_d00_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D00_INTC,
+		.ctrlbit	= S5P_CLKGATE_D00_INTC,
 	}, {
 		.name		= "tzic",
 		.id		= -1,
 		.parent		= &clk_hd0,
 		.enable		= s5pc100_clk_d00_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D00_TZIC,
+		.ctrlbit	= S5P_CLKGATE_D00_TZIC,
 	}, {
 		.name		= "cf-ata",
 		.id		= -1,
 		.parent		= &clk_hd0,
 		.enable		= s5pc100_clk_d00_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D00_CFCON,
+		.ctrlbit	= S5P_CLKGATE_D00_CFCON,
 	}, {
 		.name		= "mdma",
 		.id		= -1,
 		.parent		= &clk_hd0,
 		.enable		= s5pc100_clk_d00_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D00_MDMA,
+		.ctrlbit	= S5P_CLKGATE_D00_MDMA,
 	}, {
 		.name		= "g2d",
 		.id		= -1,
 		.parent		= &clk_hd0,
 		.enable		= s5pc100_clk_d00_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D00_G2D,
+		.ctrlbit	= S5P_CLKGATE_D00_G2D,
 	}, {
 		.name		= "secss",
 		.id		= -1,
 		.parent		= &clk_hd0,
 		.enable		= s5pc100_clk_d00_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D00_SECSS,
+		.ctrlbit	= S5P_CLKGATE_D00_SECSS,
 	}, {
 		.name		= "cssys",
 		.id		= -1,
 		.parent		= &clk_hd0,
 		.enable		= s5pc100_clk_d00_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D00_CSSYS,
+		.ctrlbit	= S5P_CLKGATE_D00_CSSYS,
 	},
 
 	/* Memory (D0_1) devices */
@@ -255,37 +255,37 @@ static struct clk s5pc100_init_clocks[] = {
 		.id		= -1,
 		.parent		= &clk_hd0,
 		.enable		= s5pc100_clk_d01_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D01_DMC,
+		.ctrlbit	= S5P_CLKGATE_D01_DMC,
 	}, {
 		.name		= "sromc",
 		.id		= -1,
 		.parent		= &clk_hd0,
 		.enable		= s5pc100_clk_d01_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D01_SROMC,
+		.ctrlbit	= S5P_CLKGATE_D01_SROMC,
 	}, {
 		.name		= "onenand",
 		.id		= -1,
 		.parent		= &clk_hd0,
 		.enable		= s5pc100_clk_d01_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D01_ONENAND,
+		.ctrlbit	= S5P_CLKGATE_D01_ONENAND,
 	}, {
 		.name		= "nand",
 		.id		= -1,
 		.parent		= &clk_hd0,
 		.enable		= s5pc100_clk_d01_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D01_NFCON,
+		.ctrlbit	= S5P_CLKGATE_D01_NFCON,
 	}, {
 		.name		= "intmem",
 		.id		= -1,
 		.parent		= &clk_hd0,
 		.enable		= s5pc100_clk_d01_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D01_INTMEM,
+		.ctrlbit	= S5P_CLKGATE_D01_INTMEM,
 	}, {
 		.name		= "ebi",
 		.id		= -1,
 		.parent		= &clk_hd0,
 		.enable		= s5pc100_clk_d01_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D01_EBI,
+		.ctrlbit	= S5P_CLKGATE_D01_EBI,
 	},
 
 	/* System2 (D0_2) devices */
@@ -294,13 +294,13 @@ static struct clk s5pc100_init_clocks[] = {
 		.id		= -1,
 		.parent		= &clk_pd0,
 		.enable		= s5pc100_clk_d02_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D02_SECKEY,
+		.ctrlbit	= S5P_CLKGATE_D02_SECKEY,
 	}, {
 		.name		= "sdm",
 		.id		= -1,
 		.parent		= &clk_hd0,
 		.enable		= s5pc100_clk_d02_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D02_SDM,
+		.ctrlbit	= S5P_CLKGATE_D02_SDM,
 	},
 
 	/* File (D1_0) devices */
@@ -309,49 +309,49 @@ static struct clk s5pc100_init_clocks[] = {
 		.id		= 0,
 		.parent		= &clk_h,
 		.enable		= s5pc100_clk_d10_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D10_PDMA0,
+		.ctrlbit	= S5P_CLKGATE_D10_PDMA0,
 	}, {
 		.name		= "pdma",
 		.id		= 1,
 		.parent		= &clk_h,
 		.enable		= s5pc100_clk_d10_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D10_PDMA1,
+		.ctrlbit	= S5P_CLKGATE_D10_PDMA1,
 	}, {
 		.name		= "usb-host",
 		.id		= -1,
 		.parent		= &clk_h,
 		.enable		= s5pc100_clk_d10_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D10_USBHOST,
+		.ctrlbit	= S5P_CLKGATE_D10_USBHOST,
 	}, {
 		.name		= "otg",
 		.id		= -1,
 		.parent		= &clk_h,
 		.enable		= s5pc100_clk_d10_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D10_USBOTG,
+		.ctrlbit	= S5P_CLKGATE_D10_USBOTG,
 	}, {
 		.name		= "modem",
 		.id		= -1,
 		.parent		= &clk_h,
 		.enable		= s5pc100_clk_d10_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D10_MODEMIF,
+		.ctrlbit	= S5P_CLKGATE_D10_MODEMIF,
 	}, {
 		.name		= "hsmmc",
 		.id		= 0,
 		.parent		= &clk_48m,
 		.enable		= s5pc100_clk_d10_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D10_HSMMC0,
+		.ctrlbit	= S5P_CLKGATE_D10_HSMMC0,
 	}, {
 		.name		= "hsmmc",
 		.id		= 1,
 		.parent		= &clk_48m,
 		.enable		= s5pc100_clk_d10_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D10_HSMMC1,
+		.ctrlbit	= S5P_CLKGATE_D10_HSMMC1,
 	}, {
 		.name		= "hsmmc",
 		.id		= 2,
 		.parent		= &clk_48m,
 		.enable		= s5pc100_clk_d10_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D10_HSMMC2,
+		.ctrlbit	= S5P_CLKGATE_D10_HSMMC2,
 	},
 
 	/* Multimedia1 (D1_1) devices */
@@ -360,43 +360,43 @@ static struct clk s5pc100_init_clocks[] = {
 		.id		= -1,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d11_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D11_LCD,
+		.ctrlbit	= S5P_CLKGATE_D11_LCD,
 	}, {
 		.name		= "rotator",
 		.id		= -1,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d11_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D11_ROTATOR,
+		.ctrlbit	= S5P_CLKGATE_D11_ROTATOR,
 	}, {
 		.name		= "fimc",
 		.id		= -1,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d11_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D11_FIMC0,
+		.ctrlbit	= S5P_CLKGATE_D11_FIMC0,
 	}, {
 		.name		= "fimc",
 		.id		= -1,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d11_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D11_FIMC1,
+		.ctrlbit	= S5P_CLKGATE_D11_FIMC1,
 	}, {
 		.name		= "fimc",
 		.id		= -1,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d11_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D11_FIMC2,
+		.ctrlbit	= S5P_CLKGATE_D11_FIMC2,
 	}, {
 		.name		= "jpeg",
 		.id		= -1,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d11_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D11_JPEG,
+		.ctrlbit	= S5P_CLKGATE_D11_JPEG,
 	}, {
 		.name		= "g3d",
 		.id		= -1,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d11_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D11_G3D,
+		.ctrlbit	= S5P_CLKGATE_D11_G3D,
 	},
 
 	/* Multimedia2 (D1_2) devices */
@@ -405,31 +405,31 @@ static struct clk s5pc100_init_clocks[] = {
 		.id		= -1,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d12_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D12_TV,
+		.ctrlbit	= S5P_CLKGATE_D12_TV,
 	}, {
 		.name		= "vp",
 		.id		= -1,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d12_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D12_VP,
+		.ctrlbit	= S5P_CLKGATE_D12_VP,
 	}, {
 		.name		= "mixer",
 		.id		= -1,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d12_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D12_MIXER,
+		.ctrlbit	= S5P_CLKGATE_D12_MIXER,
 	}, {
 		.name		= "hdmi",
 		.id		= -1,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d12_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D12_HDMI,
+		.ctrlbit	= S5P_CLKGATE_D12_HDMI,
 	}, {
 		.name		= "mfc",
 		.id		= -1,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d12_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D12_MFC,
+		.ctrlbit	= S5P_CLKGATE_D12_MFC,
 	},
 
 	/* System (D1_3) devices */
@@ -438,49 +438,49 @@ static struct clk s5pc100_init_clocks[] = {
 		.id		= -1,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d13_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D13_CHIPID,
+		.ctrlbit	= S5P_CLKGATE_D13_CHIPID,
 	}, {
 		.name		= "gpio",
 		.id		= -1,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d13_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D13_GPIO,
+		.ctrlbit	= S5P_CLKGATE_D13_GPIO,
 	}, {
 		.name		= "apc",
 		.id		= -1,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d13_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D13_APC,
+		.ctrlbit	= S5P_CLKGATE_D13_APC,
 	}, {
 		.name		= "iec",
 		.id		= -1,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d13_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D13_IEC,
+		.ctrlbit	= S5P_CLKGATE_D13_IEC,
 	}, {
 		.name		= "timers",
 		.id		= -1,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d13_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D13_PWM,
+		.ctrlbit	= S5P_CLKGATE_D13_PWM,
 	}, {
 		.name		= "systimer",
 		.id		= -1,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d13_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D13_SYSTIMER,
+		.ctrlbit	= S5P_CLKGATE_D13_SYSTIMER,
 	}, {
 		.name		= "watchdog",
 		.id		= -1,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d13_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D13_WDT,
+		.ctrlbit	= S5P_CLKGATE_D13_WDT,
 	}, {
 		.name		= "rtc",
 		.id		= -1,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d13_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D13_RTC,
+		.ctrlbit	= S5P_CLKGATE_D13_RTC,
 	},
 
 	/* Connectivity (D1_4) devices */
@@ -489,73 +489,73 @@ static struct clk s5pc100_init_clocks[] = {
 		.id		= 0,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d14_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D14_UART0,
+		.ctrlbit	= S5P_CLKGATE_D14_UART0,
 	}, {
 		.name		= "uart",
 		.id		= 1,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d14_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D14_UART1,
+		.ctrlbit	= S5P_CLKGATE_D14_UART1,
 	}, {
 		.name		= "uart",
 		.id		= 2,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d14_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D14_UART2,
+		.ctrlbit	= S5P_CLKGATE_D14_UART2,
 	}, {
 		.name		= "uart",
 		.id		= 3,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d14_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D14_UART3,
+		.ctrlbit	= S5P_CLKGATE_D14_UART3,
 	}, {
 		.name		= "i2c",
 		.id		= -1,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d14_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D14_IIC,
+		.ctrlbit	= S5P_CLKGATE_D14_IIC,
 	}, {
 		.name		= "hdmi-i2c",
 		.id		= -1,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d14_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D14_HDMI_IIC,
+		.ctrlbit	= S5P_CLKGATE_D14_HDMI_IIC,
 	}, {
 		.name		= "spi",
 		.id		= 0,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d14_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D14_SPI0,
+		.ctrlbit	= S5P_CLKGATE_D14_SPI0,
 	}, {
 		.name		= "spi",
 		.id		= 1,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d14_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D14_SPI1,
+		.ctrlbit	= S5P_CLKGATE_D14_SPI1,
 	}, {
 		.name		= "spi",
 		.id		= 2,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d14_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D14_SPI2,
+		.ctrlbit	= S5P_CLKGATE_D14_SPI2,
 	}, {
 		.name		= "irda",
 		.id		= -1,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d14_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D14_IRDA,
+		.ctrlbit	= S5P_CLKGATE_D14_IRDA,
 	}, {
 		.name		= "hsitx",
 		.id		= -1,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d14_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D14_HSITX,
+		.ctrlbit	= S5P_CLKGATE_D14_HSITX,
 	}, {
 		.name		= "hsirx",
 		.id		= -1,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d14_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D14_HSIRX,
+		.ctrlbit	= S5P_CLKGATE_D14_HSIRX,
 	},
 
 	/* Audio (D1_5) devices */
@@ -564,55 +564,55 @@ static struct clk s5pc100_init_clocks[] = {
 		.id		= 0,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d15_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D15_IIS0,
+		.ctrlbit	= S5P_CLKGATE_D15_IIS0,
 	}, {
 		.name		= "iis",
 		.id		= 1,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d15_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D15_IIS1,
+		.ctrlbit	= S5P_CLKGATE_D15_IIS1,
 	}, {
 		.name		= "iis",
 		.id		= 2,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d15_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D15_IIS2,
+		.ctrlbit	= S5P_CLKGATE_D15_IIS2,
 	}, {
 		.name		= "ac97",
 		.id		= -1,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d15_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D15_AC97,
+		.ctrlbit	= S5P_CLKGATE_D15_AC97,
 	}, {
 		.name		= "pcm",
 		.id		= 0,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d15_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D15_PCM0,
+		.ctrlbit	= S5P_CLKGATE_D15_PCM0,
 	}, {
 		.name		= "pcm",
 		.id		= 1,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d15_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D15_PCM1,
+		.ctrlbit	= S5P_CLKGATE_D15_PCM1,
 	}, {
 		.name		= "spdif",
 		.id		= -1,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d15_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D15_SPDIF,
+		.ctrlbit	= S5P_CLKGATE_D15_SPDIF,
 	}, {
 		.name		= "adc",
 		.id		= -1,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d15_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D15_TSADC,
+		.ctrlbit	= S5P_CLKGATE_D15_TSADC,
 	}, {
 		.name		= "cg",
 		.id		= -1,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d15_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D15_CG,
+		.ctrlbit	= S5P_CLKGATE_D15_CG,
 	},
 
 	/* Audio (D2_0) devices: all disabled */
@@ -623,49 +623,49 @@ static struct clk s5pc100_init_clocks[] = {
 		.id		= -1,
 		.parent		= NULL,
 		.enable		= s5pc100_sclk0_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_SCLK0_HPM,
+		.ctrlbit	= S5P_CLKGATE_SCLK0_HPM,
 	}, {
 		.name		= "sclk_onenand",
 		.id		= -1,
 		.parent		= NULL,
 		.enable		= s5pc100_sclk0_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_SCLK0_ONENAND,
+		.ctrlbit	= S5P_CLKGATE_SCLK0_ONENAND,
 	}, {
 		.name		= "spi_48",
 		.id		= 0,
 		.parent		= &clk_48m,
 		.enable		= s5pc100_sclk0_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_SCLK0_SPI0_48,
+		.ctrlbit	= S5P_CLKGATE_SCLK0_SPI0_48,
 	}, {
 		.name		= "spi_48",
 		.id		= 1,
 		.parent		= &clk_48m,
 		.enable		= s5pc100_sclk0_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_SCLK0_SPI1_48,
+		.ctrlbit	= S5P_CLKGATE_SCLK0_SPI1_48,
 	}, {
 		.name		= "spi_48",
 		.id		= 2,
 		.parent		= &clk_48m,
 		.enable		= s5pc100_sclk0_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_SCLK0_SPI2_48,
+		.ctrlbit	= S5P_CLKGATE_SCLK0_SPI2_48,
 	}, {
 		.name		= "mmc_48",
 		.id		= 0,
 		.parent		= &clk_48m,
 		.enable		= s5pc100_sclk0_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_SCLK0_MMC0_48,
+		.ctrlbit	= S5P_CLKGATE_SCLK0_MMC0_48,
 	}, {
 		.name		= "mmc_48",
 		.id		= 1,
 		.parent		= &clk_48m,
 		.enable		= s5pc100_sclk0_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_SCLK0_MMC1_48,
+		.ctrlbit	= S5P_CLKGATE_SCLK0_MMC1_48,

arch/arm/plat-s5pc1xx/clock.c static struct clk s5pc100_init_clocks[] = { · line 671

Quoted 10 lines
arch/arm/plat-s5pc1xx/clock.c +1 -1
 	}, {
 		.name		= "mmc_48",
 		.id		= 2,
 		.parent		= &clk_48m,
 		.enable		= s5pc100_sclk0_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_SCLK0_MMC2_48,
+		.ctrlbit	= S5P_CLKGATE_SCLK0_MMC2_48,
 	},
 	/* Special Clocks 1 */
 };

If the #defines like S5P_CLKGATE_SCLK0_MMC2_48, are only being used in only here then simply used the (1 << x) to set .ctrlbit directly. And of course, to remove those definitions will be better.

Review

Quoted 1 line
(quoted diff) +0 -0

b/arch/arm/plat-

Quoted 14 lines

s5pc1xx/include/plat/regs-clock.h
index 24dec4e..5c9c4cb 100644

arch/arm/plat-s5pc1xx/include/plat/regs-clock.h +1 -1
@@ -3,7 +3,7 @@
  * Copyright 2009 Samsung Electronics Co.
  *	Byungho Min <[email protected]>
  *
- * 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

arch/arm/plat-s5pc1xx/include/plat/regs-clock.h line 17

Quoted 7 lines
arch/arm/plat-s5pc1xx/include/plat/regs-clock.h +1 -2
@@ -13,240 +13,240 @@
 #ifndef __PLAT_REGS_CLOCK_H
 #define __PLAT_REGS_CLOCK_H __FILE__
 
-#define S5PC100_CLKREG(x)		(S5PC1XX_VA_CLK + (x))
-#define S5PC100_CLKREG_OTHER(x)		(S5PC1XX_VA_CLK_OTHER +
 (x))
+#define S5P_CLKREG(x)		(S5PC1XX_VA_CLK + (x))

To use directly S3C_VA_SYS without remapping to S5PC1XX_VA_xxx is better. If you need some offset here, then just add it here.

arch/arm/plat-s5pc1xx/include/plat/regs-clock.h line 17

Quoted 1 line
arch/arm/plat-s5pc1xx/include/plat/regs-clock.h +1 -0
+#define S5PC100_REG_OTHERS(x)	(S5PC1XX_VA_CLK_OTHER + (x))

Same. Please use S3C_VA_SYS with some offset.

Quoted 68 lines
arch/arm/plat-s5pc1xx/include/plat/regs-clock.h +28 -30
 /* s5pc100 register for clock */
-#define S5PC100_APLL_LOCK		S5PC100_CLKREG(0x00)
-#define S5PC100_MPLL_LOCK		S5PC100_CLKREG(0x04)
-#define S5PC100_EPLL_LOCK		S5PC100_CLKREG(0x08)
-#define S5PC100_HPLL_LOCK		S5PC100_CLKREG(0x0C)
+#define S5P_APLL_LOCK		S5P_CLKREG(0x00)
+#define S5P_MPLL_LOCK		S5P_CLKREG(0x04)
+#define S5P_EPLL_LOCK		S5P_CLKREG(0x08)
+#define S5P_HPLL_LOCK		S5P_CLKREG(0x0C)
 
-#define S5PC100_APLL_CON		S5PC100_CLKREG(0x100)
-#define S5PC100_MPLL_CON		S5PC100_CLKREG(0x104)
-#define S5PC100_EPLL_CON		S5PC100_CLKREG(0x108)
-#define S5PC100_HPLL_CON		S5PC100_CLKREG(0x10C)
+#define S5P_APLL_CON		S5P_CLKREG(0x100)
+#define S5P_MPLL_CON		S5P_CLKREG(0x104)
+#define S5P_EPLL_CON		S5P_CLKREG(0x108)
+#define S5P_HPLL_CON		S5P_CLKREG(0x10C)
 
-#define S5PC100_CLKSRC0			S5PC100_CLKREG(0x200)
-#define S5PC100_CLKSRC1			S5PC100_CLKREG(0x204)
-#define S5PC100_CLKSRC2			S5PC100_CLKREG(0x208)
-#define S5PC100_CLKSRC3			S5PC100_CLKREG(0x20C)
+#define S5P_CLK_SRC0		S5P_CLKREG(0x200)
+#define S5P_CLK_SRC1		S5P_CLKREG(0x204)
+#define S5P_CLK_SRC2		S5P_CLKREG(0x208)
+#define S5P_CLK_SRC3		S5P_CLKREG(0x20C)
 
-#define S5PC100_CLKDIV0			S5PC100_CLKREG(0x300)
-#define S5PC100_CLKDIV1			S5PC100_CLKREG(0x304)
-#define S5PC100_CLKDIV2			S5PC100_CLKREG(0x308)
-#define S5PC100_CLKDIV3			S5PC100_CLKREG(0x30C)
-#define S5PC100_CLKDIV4			S5PC100_CLKREG(0x310)
+#define S5P_CLK_DIV0		S5P_CLKREG(0x300)
+#define S5P_CLK_DIV1		S5P_CLKREG(0x304)
+#define S5P_CLK_DIV2		S5P_CLKREG(0x308)
+#define S5P_CLK_DIV3		S5P_CLKREG(0x30C)
+#define S5P_CLK_DIV4		S5P_CLKREG(0x310)
 
-#define S5PC100_CLK_OUT			S5PC100_CLKREG(0x400)
+#define S5P_CLK_OUT		S5P_CLKREG(0x400)
 
-#define S5PC100_CLKGATE_D00		S5PC100_CLKREG(0x500)
-#define S5PC100_CLKGATE_D01		S5PC100_CLKREG(0x504)
-#define S5PC100_CLKGATE_D02		S5PC100_CLKREG(0x508)
+#define S5P_CLKGATE_D00		S5P_CLKREG(0x500)
+#define S5P_CLKGATE_D01		S5P_CLKREG(0x504)
+#define S5P_CLKGATE_D02		S5P_CLKREG(0x508)
 
-#define S5PC100_CLKGATE_D10		S5PC100_CLKREG(0x520)
-#define S5PC100_CLKGATE_D11		S5PC100_CLKREG(0x524)
-#define S5PC100_CLKGATE_D12		S5PC100_CLKREG(0x528)
-#define S5PC100_CLKGATE_D13		S5PC100_CLKREG(0x52C)
-#define S5PC100_CLKGATE_D14		S5PC100_CLKREG(0x530)
-#define S5PC100_CLKGATE_D15		S5PC100_CLKREG(0x534)
+#define S5P_CLKGATE_D10		S5P_CLKREG(0x520)
+#define S5P_CLKGATE_D11		S5P_CLKREG(0x524)
+#define S5P_CLKGATE_D12		S5P_CLKREG(0x528)
+#define S5P_CLKGATE_D13		S5P_CLKREG(0x52C)
+#define S5P_CLKGATE_D14		S5P_CLKREG(0x530)
+#define S5P_CLKGATE_D15		S5P_CLKREG(0x534)
 
-#define S5PC100_CLKGATE_D20		S5PC100_CLKREG(0x540)
+#define S5P_CLKGATE_D20		S5P_CLKREG(0x540)
 
-#define S5PC100_SCLKGATE0		S5PC100_CLKREG(0x560)
-#define S5PC100_SCLKGATE1		S5PC100_CLKREG(0x564)

arch/arm/plat-s5pc1xx/include/plat/regs-clock.h line 62

Quoted 10 lines
arch/arm/plat-s5pc1xx/include/plat/regs-clock.h +5 -3
+#define S5P_SCLKGATE0		S5P_CLKREG(0x560)
+#define S5P_SCLKGATE1		S5P_CLKREG(0x564)
 
 /* EPLL_CON */
-#define S5PC100_EPLL_EN			(1<<31)
-#define S5PC100_EPLL_MASK		0xffffffff
-#define S5PC100_EPLLVAL(_m, _p, _s)	((_m) << 16 | ((_p) << 8) | ((_s)))
+#define S5P_EPLL_EN		(1<<31)
+#define S5P_EPLL_MASK		0xffffffff
+#define S5P_EPLLVAL(_m, _p, _s)	((_m) << 16 | ((_p) << 8) | ((_s)))

This definitions really need? I can not fine where is used.

Quoted 248 lines
arch/arm/plat-s5pc1xx/include/plat/regs-clock.h +103 -113
 /* CLKSRC0..CLKSRC3 -> mostly removed due to clksrc updates */
-#define S5PC100_CLKSRC1_CLK48M_MASK	(0x1<<24)
-#define S5PC100_CLKSRC1_CLK48M_SHIFT	(24)
+#define S5P_CLK_SRC1_CLK48M_MASK	(0x1<<24)
+#define S5P_CLK_SRC1_CLK48M_SHIFT	(24)
 
 /* CLKDIV0 */
-#define S5PC100_CLKDIV0_APLL_MASK		(0x1<<0)
-#define S5PC100_CLKDIV0_APLL_SHIFT		(0)
-#define S5PC100_CLKDIV0_ARM_MASK		(0x7<<4)
-#define S5PC100_CLKDIV0_ARM_SHIFT		(4)
-#define S5PC100_CLKDIV0_D0_MASK		(0x7<<8)
-#define S5PC100_CLKDIV0_D0_SHIFT		(8)
-#define S5PC100_CLKDIV0_PCLKD0_MASK		(0x7<<12)
-#define S5PC100_CLKDIV0_PCLKD0_SHIFT	(12)
-#define S5PC100_CLKDIV0_SECSS_MASK		(0x7<<16)
-#define S5PC100_CLKDIV0_SECSS_SHIFT		(16)
+#define S5P_CLK_DIV0_APLL_MASK		(0x1<<0)
+#define S5P_CLK_DIV0_APLL_SHIFT		(0)
+#define S5P_CLK_DIV0_ARM_MASK		(0x7<<4)
+#define S5P_CLK_DIV0_ARM_SHIFT		(4)
+#define S5P_CLK_DIV0_D0_MASK		(0x7<<8)
+#define S5P_CLK_DIV0_D0_SHIFT		(8)
+#define S5P_CLK_DIV0_PCLKD0_MASK		(0x7<<12)
+#define S5P_CLK_DIV0_PCLKD0_SHIFT	(12)
+#define S5P_CLK_DIV0_SECSS_MASK		(0x7<<16)
+#define S5P_CLK_DIV0_SECSS_SHIFT		(16)
 
 /* CLKDIV1 (OneNAND clock only used in one place, removed) */
-#define S5PC100_CLKDIV1_APLL2_MASK		(0x7<<0)
-#define S5PC100_CLKDIV1_APLL2_SHIFT		(0)
-#define S5PC100_CLKDIV1_MPLL_MASK		(0x3<<4)
-#define S5PC100_CLKDIV1_MPLL_SHIFT		(4)
-#define S5PC100_CLKDIV1_MPLL2_MASK		(0x1<<8)
-#define S5PC100_CLKDIV1_MPLL2_SHIFT		(8)
-#define S5PC100_CLKDIV1_D1_MASK		(0x7<<12)
-#define S5PC100_CLKDIV1_D1_SHIFT		(12)
-#define S5PC100_CLKDIV1_PCLKD1_MASK		(0x7<<16)
-#define S5PC100_CLKDIV1_PCLKD1_SHIFT	(16)
-#define S5PC100_CLKDIV1_CAM_MASK		(0x1F<<24)
-#define S5PC100_CLKDIV1_CAM_SHIFT		(24)
+#define S5P_CLK_DIV1_APLL2_MASK		(0x7<<0)
+#define S5P_CLK_DIV1_APLL2_SHIFT		(0)
+#define S5P_CLK_DIV1_MPLL_MASK		(0x3<<4)
+#define S5P_CLK_DIV1_MPLL_SHIFT		(4)
+#define S5P_CLK_DIV1_MPLL2_MASK		(0x1<<8)
+#define S5P_CLK_DIV1_MPLL2_SHIFT		(8)
+#define S5P_CLK_DIV1_D1_MASK		(0x7<<12)
+#define S5P_CLK_DIV1_D1_SHIFT		(12)
+#define S5P_CLK_DIV1_PCLKD1_MASK		(0x7<<16)
+#define S5P_CLK_DIV1_PCLKD1_SHIFT	(16)
+#define S5P_CLK_DIV1_CAM_MASK		(0x1F<<24)
+#define S5P_CLK_DIV1_CAM_SHIFT		(24)
 
 /* CLKDIV2 => removed in clksrc update */
 /* CLKDIV3 => removed in clksrc update, or not needed */
 /* CLKDIV4 => removed in clksrc update, or not needed */
 
 /* HCLKD0/PCLKD0 Clock Gate 0 Registers */
-#define S5PC100_CLKGATE_D00_INTC		(1<<0)
-#define S5PC100_CLKGATE_D00_TZIC		(1<<1)
-#define S5PC100_CLKGATE_D00_CFCON		(1<<2)
-#define S5PC100_CLKGATE_D00_MDMA		(1<<3)
-#define S5PC100_CLKGATE_D00_G2D		(1<<4)
-#define S5PC100_CLKGATE_D00_SECSS		(1<<5)
-#define S5PC100_CLKGATE_D00_CSSYS		(1<<6)
+#define S5P_CLKGATE_D00_INTC		(1<<0)
+#define S5P_CLKGATE_D00_TZIC		(1<<1)
+#define S5P_CLKGATE_D00_CFCON		(1<<2)
+#define S5P_CLKGATE_D00_MDMA		(1<<3)
+#define S5P_CLKGATE_D00_G2D		(1<<4)
+#define S5P_CLKGATE_D00_SECSS		(1<<5)
+#define S5P_CLKGATE_D00_CSSYS		(1<<6)
 
 /* HCLKD0/PCLKD0 Clock Gate 1 Registers */
-#define S5PC100_CLKGATE_D01_DMC		(1<<0)
-#define S5PC100_CLKGATE_D01_SROMC		(1<<1)
-#define S5PC100_CLKGATE_D01_ONENAND		(1<<2)
-#define S5PC100_CLKGATE_D01_NFCON		(1<<3)
-#define S5PC100_CLKGATE_D01_INTMEM		(1<<4)
-#define S5PC100_CLKGATE_D01_EBI		(1<<5)
+#define S5P_CLKGATE_D01_DMC		(1<<0)
+#define S5P_CLKGATE_D01_SROMC		(1<<1)
+#define S5P_CLKGATE_D01_ONENAND		(1<<2)
+#define S5P_CLKGATE_D01_NFCON		(1<<3)
+#define S5P_CLKGATE_D01_INTMEM		(1<<4)
+#define S5P_CLKGATE_D01_EBI		(1<<5)
 
 /* PCLKD0 Clock Gate 2 Registers */
-#define S5PC100_CLKGATE_D02_SECKEY		(1<<1)
-#define S5PC100_CLKGATE_D02_SDM		(1<<2)
+#define S5P_CLKGATE_D02_SECKEY		(1<<1)
+#define S5P_CLKGATE_D02_SDM		(1<<2)
 
 /* HCLKD1/PCLKD1 Clock Gate 0 Registers */
-#define S5PC100_CLKGATE_D10_PDMA0		(1<<0)
-#define S5PC100_CLKGATE_D10_PDMA1		(1<<1)
-#define S5PC100_CLKGATE_D10_USBHOST		(1<<2)
-#define S5PC100_CLKGATE_D10_USBOTG		(1<<3)
-#define S5PC100_CLKGATE_D10_MODEMIF		(1<<4)
-#define S5PC100_CLKGATE_D10_HSMMC0		(1<<5)
-#define S5PC100_CLKGATE_D10_HSMMC1		(1<<6)
-#define S5PC100_CLKGATE_D10_HSMMC2		(1<<7)
+#define S5P_CLKGATE_D10_PDMA0		(1<<0)
+#define S5P_CLKGATE_D10_PDMA1		(1<<1)
+#define S5P_CLKGATE_D10_USBHOST		(1<<2)
+#define S5P_CLKGATE_D10_USBOTG		(1<<3)
+#define S5P_CLKGATE_D10_MODEMIF		(1<<4)
+#define S5P_CLKGATE_D10_HSMMC0		(1<<5)
+#define S5P_CLKGATE_D10_HSMMC1		(1<<6)
+#define S5P_CLKGATE_D10_HSMMC2		(1<<7)
 
 /* HCLKD1/PCLKD1 Clock Gate 1 Registers */
-#define S5PC100_CLKGATE_D11_LCD		(1<<0)
-#define S5PC100_CLKGATE_D11_ROTATOR		(1<<1)
-#define S5PC100_CLKGATE_D11_FIMC0		(1<<2)
-#define S5PC100_CLKGATE_D11_FIMC1		(1<<3)
-#define S5PC100_CLKGATE_D11_FIMC2		(1<<4)
-#define S5PC100_CLKGATE_D11_JPEG		(1<<5)
-#define S5PC100_CLKGATE_D11_DSI		(1<<6)
-#define S5PC100_CLKGATE_D11_CSI		(1<<7)
-#define S5PC100_CLKGATE_D11_G3D		(1<<8)
+#define S5P_CLKGATE_D11_LCD		(1<<0)
+#define S5P_CLKGATE_D11_ROTATOR		(1<<1)
+#define S5P_CLKGATE_D11_FIMC0		(1<<2)
+#define S5P_CLKGATE_D11_FIMC1		(1<<3)
+#define S5P_CLKGATE_D11_FIMC2		(1<<4)
+#define S5P_CLKGATE_D11_JPEG		(1<<5)
+#define S5P_CLKGATE_D11_DSI		(1<<6)
+#define S5P_CLKGATE_D11_CSI		(1<<7)
+#define S5P_CLKGATE_D11_G3D		(1<<8)
 
 /* HCLKD1/PCLKD1 Clock Gate 2 Registers */
-#define S5PC100_CLKGATE_D12_TV		(1<<0)
-#define S5PC100_CLKGATE_D12_VP		(1<<1)
-#define S5PC100_CLKGATE_D12_MIXER		(1<<2)
-#define S5PC100_CLKGATE_D12_HDMI		(1<<3)
-#define S5PC100_CLKGATE_D12_MFC		(1<<4)
+#define S5P_CLKGATE_D12_TV		(1<<0)
+#define S5P_CLKGATE_D12_VP		(1<<1)
+#define S5P_CLKGATE_D12_MIXER		(1<<2)
+#define S5P_CLKGATE_D12_HDMI		(1<<3)
+#define S5P_CLKGATE_D12_MFC		(1<<4)
 
 /* HCLKD1/PCLKD1 Clock Gate 3 Registers */
-#define S5PC100_CLKGATE_D13_CHIPID		(1<<0)
-#define S5PC100_CLKGATE_D13_GPIO		(1<<1)
-#define S5PC100_CLKGATE_D13_APC		(1<<2)
-#define S5PC100_CLKGATE_D13_IEC		(1<<3)
-#define S5PC100_CLKGATE_D13_PWM		(1<<6)
-#define S5PC100_CLKGATE_D13_SYSTIMER	(1<<7)
-#define S5PC100_CLKGATE_D13_WDT		(1<<8)
-#define S5PC100_CLKGATE_D13_RTC		(1<<9)
+#define S5P_CLKGATE_D13_CHIPID		(1<<0)
+#define S5P_CLKGATE_D13_GPIO		(1<<1)
+#define S5P_CLKGATE_D13_APC		(1<<2)
+#define S5P_CLKGATE_D13_IEC		(1<<3)
+#define S5P_CLKGATE_D13_PWM		(1<<6)
+#define S5P_CLKGATE_D13_SYSTIMER	(1<<7)
+#define S5P_CLKGATE_D13_WDT		(1<<8)
+#define S5P_CLKGATE_D13_RTC		(1<<9)
 
 /* HCLKD1/PCLKD1 Clock Gate 4 Registers */
-#define S5PC100_CLKGATE_D14_UART0		(1<<0)
-#define S5PC100_CLKGATE_D14_UART1		(1<<1)
-#define S5PC100_CLKGATE_D14_UART2		(1<<2)
-#define S5PC100_CLKGATE_D14_UART3		(1<<3)
-#define S5PC100_CLKGATE_D14_IIC		(1<<4)
-#define S5PC100_CLKGATE_D14_HDMI_IIC	(1<<5)
-#define S5PC100_CLKGATE_D14_SPI0		(1<<6)
-#define S5PC100_CLKGATE_D14_SPI1		(1<<7)
-#define S5PC100_CLKGATE_D14_SPI2		(1<<8)
-#define S5PC100_CLKGATE_D14_IRDA		(1<<9)
-#define S5PC100_CLKGATE_D14_CCAN0		(1<<10)
-#define S5PC100_CLKGATE_D14_CCAN1		(1<<11)
-#define S5PC100_CLKGATE_D14_HSITX		(1<<12)
-#define S5PC100_CLKGATE_D14_HSIRX		(1<<13)
+#define S5P_CLKGATE_D14_UART0		(1<<0)
+#define S5P_CLKGATE_D14_UART1		(1<<1)
+#define S5P_CLKGATE_D14_UART2		(1<<2)
+#define S5P_CLKGATE_D14_UART3		(1<<3)
+#define S5P_CLKGATE_D14_IIC		(1<<4)
+#define S5P_CLKGATE_D14_HDMI_IIC	(1<<5)
+#define S5P_CLKGATE_D14_SPI0		(1<<6)
+#define S5P_CLKGATE_D14_SPI1		(1<<7)
+#define S5P_CLKGATE_D14_SPI2		(1<<8)
+#define S5P_CLKGATE_D14_IRDA		(1<<9)
+#define S5P_CLKGATE_D14_CCAN0		(1<<10)
+#define S5P_CLKGATE_D14_CCAN1		(1<<11)
+#define S5P_CLKGATE_D14_HSITX		(1<<12)
+#define S5P_CLKGATE_D14_HSIRX		(1<<13)
 
 /* HCLKD1/PCLKD1 Clock Gate 5 Registers */
-#define S5PC100_CLKGATE_D15_IIS0		(1<<0)
-#define S5PC100_CLKGATE_D15_IIS1		(1<<1)
-#define S5PC100_CLKGATE_D15_IIS2		(1<<2)
-#define S5PC100_CLKGATE_D15_AC97		(1<<3)
-#define S5PC100_CLKGATE_D15_PCM0		(1<<4)
-#define S5PC100_CLKGATE_D15_PCM1		(1<<5)
-#define S5PC100_CLKGATE_D15_SPDIF		(1<<6)
-#define S5PC100_CLKGATE_D15_TSADC		(1<<7)
-#define S5PC100_CLKGATE_D15_KEYIF		(1<<8)
-#define S5PC100_CLKGATE_D15_CG		(1<<9)
+#define S5P_CLKGATE_D15_IIS0		(1<<0)
+#define S5P_CLKGATE_D15_IIS1		(1<<1)
+#define S5P_CLKGATE_D15_IIS2		(1<<2)
+#define S5P_CLKGATE_D15_AC97		(1<<3)
+#define S5P_CLKGATE_D15_PCM0		(1<<4)
+#define S5P_CLKGATE_D15_PCM1		(1<<5)
+#define S5P_CLKGATE_D15_SPDIF		(1<<6)
+#define S5P_CLKGATE_D15_TSADC		(1<<7)
+#define S5P_CLKGATE_D15_KEYIF		(1<<8)
+#define S5P_CLKGATE_D15_CG		(1<<9)
 
 /* HCLKD2 Clock Gate 0 Registers */
-#define S5PC100_CLKGATE_D20_HCLKD2		(1<<0)
-#define S5PC100_CLKGATE_D20_I2SD2		(1<<1)
+#define S5P_CLKGATE_D20_HCLKD2		(1<<0)
+#define S5P_CLKGATE_D20_I2SD2		(1<<1)
 
 /* Special Clock Gate 0 Registers */
-#define	S5PC100_CLKGATE_SCLK0_HPM		(1<<0)
-#define	S5PC100_CLKGATE_SCLK0_PWI		(1<<1)
-#define	S5PC100_CLKGATE_SCLK0_ONENAND	(1<<2)
-#define	S5PC100_CLKGATE_SCLK0_UART		(1<<3)
-#define	S5PC100_CLKGATE_SCLK0_SPI0		(1<<4)
-#define	S5PC100_CLKGATE_SCLK0_SPI1		(1<<5)
-#define	S5PC100_CLKGATE_SCLK0_SPI2		(1<<6)
-#define	S5PC100_CLKGATE_SCLK0_SPI0_48	(1<<7)
-#define	S5PC100_CLKGATE_SCLK0_SPI1_48	(1<<8)
-#define	S5PC100_CLKGATE_SCLK0_SPI2_48	(1<<9)
-#define	S5PC100_CLKGATE_SCLK0_IRDA		(1<<10)
-#define	S5PC100_CLKGATE_SCLK0_USBHOST	(1<<11)
-#define	S5PC100_CLKGATE_SCLK0_MMC0		(1<<12)
-#define	S5PC100_CLKGATE_SCLK0_MMC1		(1<<13)
-#define	S5PC100_CLKGATE_SCLK0_MMC2		(1<<14)
-#define	S5PC100_CLKGATE_SCLK0_MMC0_48	(1<<15)
-#define	S5PC100_CLKGATE_SCLK0_MMC1_48	(1<<16)
-#define	S5PC100_CLKGATE_SCLK0_MMC2_48	(1<<17)
+#define	S5P_CLKGATE_SCLK0_HPM		(1<<0)
+#define	S5P_CLKGATE_SCLK0_PWI		(1<<1)
+#define	S5P_CLKGATE_SCLK0_ONENAND	(1<<2)
+#define	S5P_CLKGATE_SCLK0_UART		(1<<3)
+#define	S5P_CLKGATE_SCLK0_SPI0		(1<<4)
+#define	S5P_CLKGATE_SCLK0_SPI1		(1<<5)
+#define	S5P_CLKGATE_SCLK0_SPI2		(1<<6)
+#define	S5P_CLKGATE_SCLK0_SPI0_48	(1<<7)

arch/arm/plat-s5pc1xx/include/plat/regs-clock.h line 207

Quoted 10 lines
arch/arm/plat-s5pc1xx/include/plat/regs-clock.h +10 -0
+#define	S5P_CLKGATE_SCLK0_SPI1_48	(1<<8)
+#define	S5P_CLKGATE_SCLK0_SPI2_48	(1<<9)
+#define	S5P_CLKGATE_SCLK0_IRDA		(1<<10)
+#define	S5P_CLKGATE_SCLK0_USBHOST	(1<<11)
+#define	S5P_CLKGATE_SCLK0_MMC0		(1<<12)
+#define	S5P_CLKGATE_SCLK0_MMC1		(1<<13)
+#define	S5P_CLKGATE_SCLK0_MMC2		(1<<14)
+#define	S5P_CLKGATE_SCLK0_MMC0_48	(1<<15)
+#define	S5P_CLKGATE_SCLK0_MMC1_48	(1<<16)
+#define	S5P_CLKGATE_SCLK0_MMC2_48	(1<<17)

Please use space bar equally with the other instead of tab.

Quoted 34 lines
arch/arm/plat-s5pc1xx/include/plat/regs-clock.h +3 -29
 /* Special Clock Gate 1 Registers */
-#define	S5PC100_CLKGATE_SCLK1_LCD		(1<<0)
-#define	S5PC100_CLKGATE_SCLK1_FIMC0		(1<<1)
-#define	S5PC100_CLKGATE_SCLK1_FIMC1		(1<<2)
-#define	S5PC100_CLKGATE_SCLK1_FIMC2		(1<<3)
-#define	S5PC100_CLKGATE_SCLK1_TV54		(1<<4)
-#define	S5PC100_CLKGATE_SCLK1_VDAC54	(1<<5)
-#define	S5PC100_CLKGATE_SCLK1_MIXER		(1<<6)
-#define	S5PC100_CLKGATE_SCLK1_HDMI		(1<<7)
-#define	S5PC100_CLKGATE_SCLK1_AUDIO0	(1<<8)
-#define	S5PC100_CLKGATE_SCLK1_AUDIO1	(1<<9)
-#define	S5PC100_CLKGATE_SCLK1_AUDIO2	(1<<10)
-#define	S5PC100_CLKGATE_SCLK1_SPDIF		(1<<11)
-#define	S5PC100_CLKGATE_SCLK1_CAM		(1<<12)
-
-#define S5PC100_SWRESET		S5PC100_CLKREG_OTHER(0x000)
-#define S5PC100_OND_SWRESET	S5PC100_CLKREG_OTHER(0x008)
-#define S5PC100_GEN_CTRL	S5PC100_CLKREG_OTHER(0x100)
-#define S5PC100_GEN_STATUS	S5PC100_CLKREG_OTHER(0x104)
-#define S5PC100_MEM_SYS_CFG	S5PC100_CLKREG_OTHER(0x200)
-#define S5PC100_CAM_MUX_SEL	S5PC100_CLKREG_OTHER(0x300)
-#define S5PC100_MIXER_OUT_SEL	S5PC100_CLKREG_OTHER(0x304)
-#define S5PC100_LPMP_MODE_SEL	S5PC100_CLKREG_OTHER(0x308)
-#define S5PC100_MIPI_PHY_CON0	S5PC100_CLKREG_OTHER(0x400)
-#define S5PC100_MIPI_PHY_CON1	S5PC100_CLKREG_OTHER(0x414)
-#define S5PC100_HDMI_PHY_CON0	S5PC100_CLKREG_OTHER(0x420)
-
-#define S5PC100_SWRESET_RESETVAL	0xc100
-#define S5PC100_OTHER_SYS_INT	24
-#define S5PC100_OTHER_STA_TYPE	23
+#define	S5P_CLKGATE_SCLK1_LCD		(1<<0)
+#define	S5P_CLKGATE_SCLK1_FIMC0		(1<<1)
+#define	S5P_CLKGATE_SCLK1_FIMC1		(1<<2)

arch/arm/plat-s5pc1xx/include/plat/regs-clock.h line 222

Quoted 10 lines
arch/arm/plat-s5pc1xx/include/plat/regs-clock.h +10 -0
+#define	S5P_CLKGATE_SCLK1_FIMC2		(1<<3)
+#define	S5P_CLKGATE_SCLK1_TV54		(1<<4)
+#define	S5P_CLKGATE_SCLK1_VDAC54	(1<<5)
+#define	S5P_CLKGATE_SCLK1_MIXER		(1<<6)
+#define	S5P_CLKGATE_SCLK1_HDMI		(1<<7)
+#define	S5P_CLKGATE_SCLK1_AUDIO0	(1<<8)
+#define	S5P_CLKGATE_SCLK1_AUDIO1	(1<<9)
+#define	S5P_CLKGATE_SCLK1_AUDIO2	(1<<10)
+#define	S5P_CLKGATE_SCLK1_SPDIF		(1<<11)
+#define	S5P_CLKGATE_SCLK1_CAM		(1<<12)

Same.

And, if you use directly above value in the ctrlbit, don't need more above definitions.

Quoted 11 lines
arch/arm/plat-s5pc1xx/include/plat/regs-clock.h +11 -0
+
+#define S5P_SWRESET		S5PC100_REG_OTHERS(0x000)
+#define S5P_OND_SWRESET		S5PC100_REG_OTHERS(0x008)
+#define S5P_GEN_CTRL		S5PC100_REG_OTHERS(0x100)
+#define S5P_GEN_STATUS		S5PC100_REG_OTHERS(0x104)
+#define S5P_MEM_SYS_CFG		S5PC100_REG_OTHERS(0x200)
+#define S5P_CAM_MUX_SEL		S5PC100_REG_OTHERS(0x300)
+#define S5P_MIXER_OUT_SEL	S5PC100_REG_OTHERS(0x304)
+#define S5P_LPMP_MODE_SEL	S5PC100_REG_OTHERS(0x308)
+#define S5P_MIPI_PHY_CON0	S5PC100_REG_OTHERS(0x400)
+#define S5P_MIPI_PHY_CON1	S5PC100_REG_OTHERS(0x414)

arch/arm/plat-s5pc1xx/include/plat/regs-clock.h line 242

Quoted 10 lines
arch/arm/plat-s5pc1xx/include/plat/regs-clock.h +6 -1
+#define S5P_HDMI_PHY_CON0	S5PC100_REG_OTHERS(0x420)
+
+#define S5P_SWRESET_RESETVAL	0xc100
+#define S5P_OTHER_SYS_INT	24
+#define S5P_OTHER_STA_TYPE	23
 #define STA_TYPE_EXPON		0
 #define STA_TYPE_SFR		1
 
-#define S5PC100_SLEEP_CFG_OSC_EN	0
+#define S5P_SLEEP_CFG_OSC_EN	0

Please check whether need above definitions or not.

Quoted 4 lines
arch/arm/plat-s5pc1xx/include/plat/regs-clock.h +0 -2
 /* OTHERS Resgister */
-#define S5PC100_OTHERS_USB_SIG_MASK	(1 << 16)
-#define S5PC100_OTHERS_MIPI_DPHY_EN		(1 << 28)

arch/arm/plat-s5pc1xx/include/plat/regs-clock.h line 252

Quoted 10 lines
arch/arm/plat-s5pc1xx/include/plat/regs-clock.h +4 -2
+#define S5P_OTHERS_USB_SIG_MASK	(1 << 16)
+#define S5P_OTHERS_MIPI_DPHY_EN		(1 << 28)
 
 /* MIPI D-PHY Control Register 0 */
-#define S5PC100_MIPI_PHY_CON0_M_RESETN	(1 << 1)
-#define S5PC100_MIPI_PHY_CON0_S_RESETN	(1 << 0)
+#define S5P_MIPI_PHY_CON0_M_RESETN	(1 << 1)
+#define S5P_MIPI_PHY_CON0_S_RESETN	(1 << 0)
 
 #endif /* _PLAT_REGS_CLOCK_H */

In your 4th and 5th patch, above file will be moved to mach directory. So how about change to __ASM_ARCH_REGS_CLOCK_H from _PLAT...

Review

Quoted 1 line
(quoted diff) +0 -0

b/arch/arm/plat-s5pc1xx/s5pc100-

arch/arm/plat-s5pc1xx/s5pc100-clock.c static unsigned long

Quoted 14 lines

clock.c
index 2bf6c57..c391c61 100644

arch/arm/plat-s5pc1xx/s5pc100-clock.c +1 -1
@@ -75,7 +75,7 @@ static struct clksrc_clk clk_mout_apll = {
 		.id		= -1,
 	},
 	.sources	= &clk_src_apll,
-	.reg_src = { .reg = S5PC100_CLKSRC0, .shift = 0, .size = 1, },
+	.reg_src = { .reg = S5P_CLK_SRC0, .shift = 0, .size = 1, },
 };
 
 static unsigned long s5pc100_clk_dout_apll_get_rate(struct clk *clk)
@@ -83,8 +83,8 @@ static unsigned long

s5pc100_clk_dout_apll_get_rate(struct

arch/arm/plat-s5pc1xx/s5pc100-clock.c static unsigned long s5pc100_clk_arm_get_rate(struct

Quoted 13 lines
arch/arm/plat-s5pc1xx/s5pc100-clock.c +2 -2
 clk *clk)
 	unsigned long rate = clk_get_rate(clk->parent);
 	unsigned int ratio;
 
-	ratio = __raw_readl(S5PC100_CLKDIV0) &
 S5PC100_CLKDIV0_APLL_MASK;
-	ratio >>= S5PC100_CLKDIV0_APLL_SHIFT;
+	ratio = __raw_readl(S5P_CLK_DIV0) & S5P_CLK_DIV0_APLL_MASK;
+	ratio >>= S5P_CLK_DIV0_APLL_SHIFT;
 
arch/arm/plat-s5pc1xx/s5pc100-clock.c +0 -0
 	return rate / (ratio + 1);
 }
@@ -103,8 +103,8 @@ static unsigned long s5pc100_clk_arm_get_rate(struct

clk

arch/arm/plat-s5pc1xx/s5pc100-clock.c static unsigned long s5pc100_clk_arm_round_rate(struct

Quoted 13 lines
arch/arm/plat-s5pc1xx/s5pc100-clock.c +2 -2
 *clk)
 	unsigned long rate = clk_get_rate(clk->parent);
 	unsigned int ratio;
 
-	ratio = __raw_readl(S5PC100_CLKDIV0) &
 S5PC100_CLKDIV0_ARM_MASK;
-	ratio >>= S5PC100_CLKDIV0_ARM_SHIFT;
+	ratio = __raw_readl(S5P_CLK_DIV0) & S5P_CLK_DIV0_ARM_MASK;
+	ratio >>= S5P_CLK_DIV0_ARM_SHIFT;
 
arch/arm/plat-s5pc1xx/s5pc100-clock.c +0 -0
 	return rate / (ratio + 1);
 }
@@ -119,8 +119,8 @@ static unsigned long s5pc100_clk_arm_round_rate(struct

clk

arch/arm/plat-s5pc1xx/s5pc100-clock.c static unsigned long

Quoted 137 lines
arch/arm/plat-s5pc1xx/s5pc100-clock.c +2 -2
 *clk,
 		return rate;
 
 	div = (parent / rate) - 1;
-	if (div > S5PC100_CLKDIV0_ARM_MASK)
-		div = S5PC100_CLKDIV0_ARM_MASK;
+	if (div > S5P_CLK_DIV0_ARM_MASK)
+		div = S5P_CLK_DIV0_ARM_MASK;
 
 	return parent / (div + 1);

}

arch/arm/plat-s5pc1xx/s5pc100-clock.c +4 -4
@@ -131,16 +131,16 @@ static int s5pc100_clk_arm_set_rate(struct clk *clk,
 unsigned long rate)
 	u32 div;
 	u32 val;
 
-	if (rate < parent / (S5PC100_CLKDIV0_ARM_MASK + 1))
+	if (rate < parent / (S5P_CLK_DIV0_ARM_MASK + 1))
 		return -EINVAL;
 
 	rate = clk_round_rate(clk, rate);
 	div = clk_get_rate(clk->parent) / rate;
 
-	val = __raw_readl(S5PC100_CLKDIV0);
-	val &= S5PC100_CLKDIV0_ARM_MASK;
+	val = __raw_readl(S5P_CLK_DIV0);
+	val &= S5P_CLK_DIV0_ARM_MASK;
 	val |= (div - 1);
-	__raw_writel(val, S5PC100_CLKDIV0);
+	__raw_writel(val, S5P_CLK_DIV0);
 
 	return 0;

}

arch/arm/plat-s5pc1xx/s5pc100-clock.c +2 -2
@@ -161,8 +161,8 @@ static unsigned long
 s5pc100_clk_dout_d0_bus_get_rate(struct clk *clk)
 	unsigned long rate = clk_get_rate(clk->parent);
 	unsigned int ratio;
 
-	ratio = __raw_readl(S5PC100_CLKDIV0) & S5PC100_CLKDIV0_D0_MASK;
-	ratio >>= S5PC100_CLKDIV0_D0_SHIFT;
+	ratio = __raw_readl(S5P_CLK_DIV0) & S5P_CLK_DIV0_D0_MASK;
+	ratio >>= S5P_CLK_DIV0_D0_SHIFT;
 
 	return rate / (ratio + 1);

}

arch/arm/plat-s5pc1xx/s5pc100-clock.c +2 -2
@@ -181,8 +181,8 @@ static unsigned long
 s5pc100_clk_dout_pclkd0_get_rate(struct clk *clk)
 	unsigned long rate = clk_get_rate(clk->parent);
 	unsigned int ratio;
 
-	ratio = __raw_readl(S5PC100_CLKDIV0) &
 S5PC100_CLKDIV0_PCLKD0_MASK;
-	ratio >>= S5PC100_CLKDIV0_PCLKD0_SHIFT;
+	ratio = __raw_readl(S5P_CLK_DIV0) & S5P_CLK_DIV0_PCLKD0_MASK;
+	ratio >>= S5P_CLK_DIV0_PCLKD0_SHIFT;
 
arch/arm/plat-s5pc1xx/s5pc100-clock.c +2 -2
 	return rate / (ratio + 1);
 }
@@ -201,8 +201,8 @@ static unsigned long
 s5pc100_clk_dout_apll2_get_rate(struct clk *clk)
 	unsigned long rate = clk_get_rate(clk->parent);
 	unsigned int ratio;
 
-	ratio = __raw_readl(S5PC100_CLKDIV1) &
 S5PC100_CLKDIV1_APLL2_MASK;
-	ratio >>= S5PC100_CLKDIV1_APLL2_SHIFT;
+	ratio = __raw_readl(S5P_CLK_DIV1) & S5P_CLK_DIV1_APLL2_MASK;
+	ratio >>= S5P_CLK_DIV1_APLL2_SHIFT;
 
arch/arm/plat-s5pc1xx/s5pc100-clock.c +4 -4
 	return rate / (ratio + 1);
 }
@@ -233,7 +233,7 @@ static struct clksrc_clk clk_mout_mpll = {
 		.id		= -1,
 	},
 	.sources	= &clk_src_mpll,
-	.reg_src = { .reg = S5PC100_CLKSRC0, .shift = 4, .size = 1, },
+	.reg_src = { .reg = S5P_CLK_SRC0, .shift = 4, .size = 1, },
 };
 
 static struct clk *clkset_am_list[] = {
@@ -252,7 +252,7 @@ static struct clksrc_clk clk_mout_am = {
 		.id		= -1,
 	},
 	.sources	= &clk_src_am,
-	.reg_src = { .reg = S5PC100_CLKSRC0, .shift = 16, .size = 1, },
+	.reg_src = { .reg = S5P_CLK_SRC0, .shift = 16, .size = 1, },
 };
 
 static unsigned long s5pc100_clk_dout_d1_bus_get_rate(struct clk *clk)
@@ -262,8 +262,8 @@ static unsigned long
 s5pc100_clk_dout_d1_bus_get_rate(struct clk *clk)
 
 	printk(KERN_DEBUG "%s: parent is %ld\n", __func__, rate);
 
-	ratio = __raw_readl(S5PC100_CLKDIV1) & S5PC100_CLKDIV1_D1_MASK;
-	ratio >>= S5PC100_CLKDIV1_D1_SHIFT;
+	ratio = __raw_readl(S5P_CLK_DIV1) & S5P_CLK_DIV1_D1_MASK;
+	ratio >>= S5P_CLK_DIV1_D1_SHIFT;
 
 	return rate / (ratio + 1);

}

arch/arm/plat-s5pc1xx/s5pc100-clock.c +3 -3
@@ -293,7 +293,7 @@ static struct clksrc_clk clk_mout_onenand = {
 		.id		= -1,
 	},
 	.sources	= &clk_src_onenand,
-	.reg_src = { .reg = S5PC100_CLKSRC0, .shift = 24, .size = 1, },
+	.reg_src = { .reg = S5P_CLK_SRC0, .shift = 24, .size = 1, },
 };
 
 static unsigned long s5pc100_clk_dout_pclkd1_get_rate(struct clk *clk)
@@ -303,8 +303,8 @@ static unsigned long
 s5pc100_clk_dout_pclkd1_get_rate(struct clk *clk)
 
 	printk(KERN_DEBUG "%s: parent is %ld\n", __func__, rate);
 
-	ratio = __raw_readl(S5PC100_CLKDIV1) &
 S5PC100_CLKDIV1_PCLKD1_MASK;
-	ratio >>= S5PC100_CLKDIV1_PCLKD1_SHIFT;
+	ratio = __raw_readl(S5P_CLK_DIV1) & S5P_CLK_DIV1_PCLKD1_MASK;
+	ratio >>= S5P_CLK_DIV1_PCLKD1_SHIFT;
 
arch/arm/plat-s5pc1xx/s5pc100-clock.c +2 -2
 	return rate / (ratio + 1);
 }
@@ -325,8 +325,8 @@ static unsigned long
 s5pc100_clk_dout_mpll2_get_rate(struct clk *clk)
 
 	printk(KERN_DEBUG "%s: parent is %ld\n", __func__, rate);
 
-	ratio = __raw_readl(S5PC100_CLKDIV1) &
 S5PC100_CLKDIV1_MPLL2_MASK;
-	ratio >>= S5PC100_CLKDIV1_MPLL2_SHIFT;
+	ratio = __raw_readl(S5P_CLK_DIV1) & S5P_CLK_DIV1_MPLL2_MASK;
+	ratio >>= S5P_CLK_DIV1_MPLL2_SHIFT;
 
arch/arm/plat-s5pc1xx/s5pc100-clock.c +0 -0
 	return rate / (ratio + 1);
 }
@@ -347,8 +347,8 @@ static unsigned long

s5pc100_clk_dout_cam_get_rate(struct

arch/arm/plat-s5pc1xx/s5pc100-clock.c static unsigned long

Quoted 13 lines
arch/arm/plat-s5pc1xx/s5pc100-clock.c +2 -2
 clk *clk)
 
 	printk(KERN_DEBUG "%s: parent is %ld\n", __func__, rate);
 
-	ratio = __raw_readl(S5PC100_CLKDIV1) &
 S5PC100_CLKDIV1_CAM_MASK;
-	ratio >>= S5PC100_CLKDIV1_CAM_SHIFT;
+	ratio = __raw_readl(S5P_CLK_DIV1) & S5P_CLK_DIV1_CAM_MASK;
+	ratio >>= S5P_CLK_DIV1_CAM_SHIFT;
 
arch/arm/plat-s5pc1xx/s5pc100-clock.c +0 -0
 	return rate / (ratio + 1);
 }
@@ -369,8 +369,8 @@ static unsigned long

s5pc100_clk_dout_mpll_get_rate(struct

Quoted 31 lines
arch/arm/plat-s5pc1xx/s5pc100-clock.c +2 -2
 clk *clk)
 
 	printk(KERN_DEBUG "%s: parent is %ld\n", __func__, rate);
 
-	ratio = __raw_readl(S5PC100_CLKDIV1) &
 S5PC100_CLKDIV1_MPLL_MASK;
-	ratio >>= S5PC100_CLKDIV1_MPLL_SHIFT;
+	ratio = __raw_readl(S5P_CLK_DIV1) & S5P_CLK_DIV1_MPLL_MASK;
+	ratio >>= S5P_CLK_DIV1_MPLL_SHIFT;
 
arch/arm/plat-s5pc1xx/s5pc100-clock.c +2 -2
 	return rate / (ratio + 1);
 }
@@ -406,7 +406,7 @@ static struct clksrc_clk clk_mout_epll = {
 		.id		= -1,
 	},
 	.sources = &clk_src_epll,
-	.reg_src = { .reg = S5PC100_CLKSRC0, .shift = 8, .size = 1, },
+	.reg_src = { .reg = S5P_CLK_SRC0, .shift = 8, .size = 1, },
 };
 
 /* HPLL */
@@ -431,7 +431,7 @@ static struct clksrc_clk clk_mout_hpll = {
 		.id		= -1,
 	},
 	.sources = &clk_src_hpll,
-	.reg_src = { .reg = S5PC100_CLKSRC0, .shift = 12, .size = 1, },
+	.reg_src = { .reg = S5P_CLK_SRC0, .shift = 12, .size = 1, },
 };
 
 /* Peripherals */

arch/arm/plat-s5pc1xx/s5pc100-clock.c static struct clksrc_clk clksrc_audio[] = { · line 546

Quoted 9 lines
arch/arm/plat-s5pc1xx/s5pc100-clock.c +1 -2
@@ -539,32 +539,32 @@ static struct clksrc_clk clksrc_audio[] = {
 		.clk	= {
 			.name		= "audio-bus",
 			.id		= 0,
-			.ctrlbit	= S5PC100_CLKGATE_SCLK1_AUDIO0,
+			.ctrlbit	= S5P_CLKGATE_SCLK1_AUDIO0,
 			.enable		= s5pc100_sclk1_ctrl,
 		},
 		.sources = &clkset_audio0,
-		.reg_div = { .reg = S5PC100_CLKDIV4, .shift = 12, .size = 4,

},

arch/arm/plat-s5pc1xx/s5pc100-clock.c static struct clksrc_clk clksrc_audio[] = { · line 547

Quoted 1 line
arch/arm/plat-s5pc1xx/s5pc100-clock.c +0 -1
-		.reg_src = { .reg = S5PC100_CLKSRC3, .shift = 12, .size = 3,

},

arch/arm/plat-s5pc1xx/s5pc100-clock.c static struct clksrc_clk clksrc_audio[] = {

Quoted 12 lines
arch/arm/plat-s5pc1xx/s5pc100-clock.c +3 -2
+		.reg_div = { .reg = S5P_CLK_DIV4, .shift = 12, .size = 4, },
+		.reg_src = { .reg = S5P_CLK_SRC3, .shift = 12, .size = 3, },
 	}, {
 		.clk	= {
 			.name		= "audio-bus",
 			.id		= 1,
-			.ctrlbit	= S5PC100_CLKGATE_SCLK1_AUDIO1,
+			.ctrlbit	= S5P_CLKGATE_SCLK1_AUDIO1,
 			.enable		= s5pc100_sclk1_ctrl,
 		},
 		.sources = &clkset_audio1,
-		.reg_div = { .reg = S5PC100_CLKDIV4, .shift = 16, .size = 4,

},

arch/arm/plat-s5pc1xx/s5pc100-clock.c static struct clksrc_clk clksrc_audio[] = { · line 557

Quoted 1 line
arch/arm/plat-s5pc1xx/s5pc100-clock.c +0 -1
-		.reg_src = { .reg = S5PC100_CLKSRC3, .shift = 16, .size = 3,

},

arch/arm/plat-s5pc1xx/s5pc100-clock.c static struct clksrc_clk clksrc_audio[] = {

Quoted 12 lines
arch/arm/plat-s5pc1xx/s5pc100-clock.c +3 -2
+		.reg_div = { .reg = S5P_CLK_DIV4, .shift = 16, .size = 4, },
+		.reg_src = { .reg = S5P_CLK_SRC3, .shift = 16, .size = 3, },
 	}, {
 		.clk	= {
 			.name		= "audio-bus",
 			.id		= 2,
-			.ctrlbit	= S5PC100_CLKGATE_SCLK1_AUDIO2,
+			.ctrlbit	= S5P_CLKGATE_SCLK1_AUDIO2,
 			.enable		= s5pc100_sclk1_ctrl,
 		},
 		.sources = &clkset_audio2,
-		.reg_div = { .reg = S5PC100_CLKDIV4, .shift = 20, .size = 4,

},

arch/arm/plat-s5pc1xx/s5pc100-clock.c static struct clksrc_clk clksrc_audio[] = { · line 567

Quoted 1 line
arch/arm/plat-s5pc1xx/s5pc100-clock.c +0 -1
-		.reg_src = { .reg = S5PC100_CLKSRC3, .shift = 20, .size = 3,

},

Quoted 6 lines
arch/arm/plat-s5pc1xx/s5pc100-clock.c +2 -0
+		.reg_div = { .reg = S5P_CLK_DIV4, .shift = 20, .size = 4, },
+		.reg_src = { .reg = S5P_CLK_SRC3, .shift = 20, .size = 3, },
 	},
 };
 

arch/arm/plat-s5pc1xx/s5pc100-clock.c static struct clksrc_clk clksrc_clks[] = { · line 628

Quoted 10 lines
arch/arm/plat-s5pc1xx/s5pc100-clock.c +1 -2
@@ -620,130 +620,130 @@ static struct clksrc_clk clksrc_clks[] = {
 		.clk	= {
 			.name		= "spi_bus",
 			.id		= 0,
-			.ctrlbit	= S5PC100_CLKGATE_SCLK0_SPI0,
+			.ctrlbit	= S5P_CLKGATE_SCLK0_SPI0,
 			.enable		= s5pc100_sclk0_ctrl,
 
 		},
 		.sources = &clkset_spi,
-		.reg_div = { .reg = S5PC100_CLKDIV2, .shift = 4, .size = 4,

},

arch/arm/plat-s5pc1xx/s5pc100-clock.c static struct clksrc_clk clksrc_clks[] = { · line 629

Quoted 1 line
arch/arm/plat-s5pc1xx/s5pc100-clock.c +0 -1
-		.reg_src = { .reg = S5PC100_CLKSRC1, .shift = 4, .size = 2,

},

arch/arm/plat-s5pc1xx/s5pc100-clock.c static struct clksrc_clk clksrc_clks[] = {

Quoted 12 lines
arch/arm/plat-s5pc1xx/s5pc100-clock.c +3 -2
+		.reg_div = { .reg = S5P_CLK_DIV2, .shift = 4, .size = 4, },
+		.reg_src = { .reg = S5P_CLK_SRC1, .shift = 4, .size = 2, },
 	}, {
 		.clk	= {
 			.name		= "spi_bus",
 			.id		= 1,
-			.ctrlbit	= S5PC100_CLKGATE_SCLK0_SPI1,
+			.ctrlbit	= S5P_CLKGATE_SCLK0_SPI1,
 			.enable		= s5pc100_sclk0_ctrl,
 		},
 		.sources = &clkset_spi,
-		.reg_div = { .reg = S5PC100_CLKDIV2, .shift = 8, .size = 4,

},

arch/arm/plat-s5pc1xx/s5pc100-clock.c static struct clksrc_clk clksrc_clks[] = { · line 639

Quoted 1 line
arch/arm/plat-s5pc1xx/s5pc100-clock.c +0 -1
-		.reg_src = { .reg = S5PC100_CLKSRC1, .shift = 8, .size = 2,

},

arch/arm/plat-s5pc1xx/s5pc100-clock.c static struct clksrc_clk clksrc_clks[] = {

Quoted 12 lines
arch/arm/plat-s5pc1xx/s5pc100-clock.c +3 -2
+		.reg_div = { .reg = S5P_CLK_DIV2, .shift = 8, .size = 4, },
+		.reg_src = { .reg = S5P_CLK_SRC1, .shift = 8, .size = 2, },
 	}, {
 		.clk	= {
 			.name		= "spi_bus",
 			.id		= 2,
-			.ctrlbit	= S5PC100_CLKGATE_SCLK0_SPI2,
+			.ctrlbit	= S5P_CLKGATE_SCLK0_SPI2,
 			.enable		= s5pc100_sclk0_ctrl,
 		},
 		.sources = &clkset_spi,
-		.reg_div = { .reg = S5PC100_CLKDIV2, .shift = 12, .size = 4,

},

arch/arm/plat-s5pc1xx/s5pc100-clock.c static struct clksrc_clk clksrc_clks[] = { · line 649

Quoted 1 line
arch/arm/plat-s5pc1xx/s5pc100-clock.c +0 -1
-		.reg_src = { .reg = S5PC100_CLKSRC1, .shift = 12, .size = 2,

},

arch/arm/plat-s5pc1xx/s5pc100-clock.c static struct clksrc_clk clksrc_clks[] = {

Quoted 12 lines
arch/arm/plat-s5pc1xx/s5pc100-clock.c +3 -2
+		.reg_div = { .reg = S5P_CLK_DIV2, .shift = 12, .size = 4, },
+		.reg_src = { .reg = S5P_CLK_SRC1, .shift = 12, .size = 2, },
 	}, {
 		.clk	= {
 			.name		= "uclk1",
 			.id		= -1,
-			.ctrlbit        = S5PC100_CLKGATE_SCLK0_UART,
+			.ctrlbit        = S5P_CLKGATE_SCLK0_UART,
 			.enable		= s5pc100_sclk0_ctrl,
 		},
 		.sources = &clkset_uart,
-		.reg_div = { .reg = S5PC100_CLKDIV2, .shift = 0, .size = 3,

},

arch/arm/plat-s5pc1xx/s5pc100-clock.c static struct clksrc_clk clksrc_clks[] = { · line 659

Quoted 1 line
arch/arm/plat-s5pc1xx/s5pc100-clock.c +0 -1
-		.reg_src = { .reg = S5PC100_CLKSRC1, .shift = 0, .size = 1,

},

arch/arm/plat-s5pc1xx/s5pc100-clock.c static struct clksrc_clk clksrc_clks[] = {

Quoted 9 lines
arch/arm/plat-s5pc1xx/s5pc100-clock.c +2 -1
+		.reg_div = { .reg = S5P_CLK_DIV2, .shift = 0, .size = 3, },
+		.reg_src = { .reg = S5P_CLK_SRC1, .shift = 0, .size = 1, },
 	}, {
 		.clk	= {
 			.name		= "spdif",
 			.id		= -1,
 		},
 		.sources	= &clkset_spdif,
-		.reg_src = { .reg = S5PC100_CLKSRC3, .shift = 24, .size = 2,

},

arch/arm/plat-s5pc1xx/s5pc100-clock.c static struct clksrc_clk clksrc_clks[] = {

Quoted 11 lines
arch/arm/plat-s5pc1xx/s5pc100-clock.c +2 -2
+		.reg_src = { .reg = S5P_CLK_SRC3, .shift = 24, .size = 2, },
 	}, {
 		.clk	= {
 			.name		= "lcd",
 			.id		= -1,
-			.ctrlbit	= S5PC100_CLKGATE_SCLK1_LCD,
+			.ctrlbit	= S5P_CLKGATE_SCLK1_LCD,
 			.enable		= s5pc100_sclk1_ctrl,
 		},
 		.sources = &clkset_lcd_fimc,
-		.reg_div = { .reg = S5PC100_CLKDIV3, .shift = 12, .size = 4,

},

arch/arm/plat-s5pc1xx/s5pc100-clock.c static struct clksrc_clk clksrc_clks[] = { · line 676

Quoted 1 line
arch/arm/plat-s5pc1xx/s5pc100-clock.c +0 -1
-		.reg_src = { .reg = S5PC100_CLKSRC2, .shift = 12, .size = 2,

},

arch/arm/plat-s5pc1xx/s5pc100-clock.c static struct clksrc_clk clksrc_clks[] = {

Quoted 12 lines
arch/arm/plat-s5pc1xx/s5pc100-clock.c +3 -2
+		.reg_div = { .reg = S5P_CLK_DIV3, .shift = 12, .size = 4, },
+		.reg_src = { .reg = S5P_CLK_SRC2, .shift = 12, .size = 2, },
 	}, {
 		.clk	= {
 			.name		= "fimc",
 			.id		= 0,
-			.ctrlbit	= S5PC100_CLKGATE_SCLK1_FIMC0,
+			.ctrlbit	= S5P_CLKGATE_SCLK1_FIMC0,
 			.enable		= s5pc100_sclk1_ctrl,
 		},
 		.sources = &clkset_lcd_fimc,
-		.reg_div = { .reg = S5PC100_CLKDIV3, .shift = 16, .size = 4,

},

arch/arm/plat-s5pc1xx/s5pc100-clock.c static struct clksrc_clk clksrc_clks[] = { · line 686

Quoted 1 line
arch/arm/plat-s5pc1xx/s5pc100-clock.c +0 -1
-		.reg_src = { .reg = S5PC100_CLKSRC2, .shift = 16, .size = 2,

},

arch/arm/plat-s5pc1xx/s5pc100-clock.c static struct clksrc_clk clksrc_clks[] = {

Quoted 12 lines
arch/arm/plat-s5pc1xx/s5pc100-clock.c +3 -2
+		.reg_div = { .reg = S5P_CLK_DIV3, .shift = 16, .size = 4, },
+		.reg_src = { .reg = S5P_CLK_SRC2, .shift = 16, .size = 2, },
 	}, {
 		.clk	= {
 			.name		= "fimc",
 			.id		= 1,
-			.ctrlbit	= S5PC100_CLKGATE_SCLK1_FIMC1,
+			.ctrlbit	= S5P_CLKGATE_SCLK1_FIMC1,
 			.enable		= s5pc100_sclk1_ctrl,
 		},
 		.sources	= &clkset_lcd_fimc,
-		.reg_div = { .reg = S5PC100_CLKDIV3, .shift = 20, .size = 4,

},

arch/arm/plat-s5pc1xx/s5pc100-clock.c static struct clksrc_clk clksrc_clks[] = { · line 696

Quoted 1 line
arch/arm/plat-s5pc1xx/s5pc100-clock.c +0 -1
-		.reg_src = { .reg = S5PC100_CLKSRC2, .shift = 20, .size = 2,

},

arch/arm/plat-s5pc1xx/s5pc100-clock.c static struct clksrc_clk clksrc_clks[] = {

Quoted 12 lines
arch/arm/plat-s5pc1xx/s5pc100-clock.c +3 -2
+		.reg_div = { .reg = S5P_CLK_DIV3, .shift = 20, .size = 4, },
+		.reg_src = { .reg = S5P_CLK_SRC2, .shift = 20, .size = 2, },
 	}, {
 		.clk	= {
 			.name		= "fimc",
 			.id		= 2,
-			.ctrlbit	= S5PC100_CLKGATE_SCLK1_FIMC2,
+			.ctrlbit	= S5P_CLKGATE_SCLK1_FIMC2,
 			.enable		= s5pc100_sclk1_ctrl,
 		},
 		.sources = &clkset_lcd_fimc,
-		.reg_div = { .reg = S5PC100_CLKDIV3, .shift = 24, .size = 4,

},

arch/arm/plat-s5pc1xx/s5pc100-clock.c static struct clksrc_clk clksrc_clks[] = { · line 706

Quoted 1 line
arch/arm/plat-s5pc1xx/s5pc100-clock.c +0 -1
-		.reg_src = { .reg = S5PC100_CLKSRC2, .shift = 24, .size = 2,

},

arch/arm/plat-s5pc1xx/s5pc100-clock.c static struct clksrc_clk clksrc_clks[] = {

Quoted 12 lines
arch/arm/plat-s5pc1xx/s5pc100-clock.c +3 -2
+		.reg_div = { .reg = S5P_CLK_DIV3, .shift = 24, .size = 4, },
+		.reg_src = { .reg = S5P_CLK_SRC2, .shift = 24, .size = 2, },
 	}, {
 		.clk	= {
 			.name		= "mmc_bus",
 			.id		= 0,
-			.ctrlbit	= S5PC100_CLKGATE_SCLK0_MMC0,
+			.ctrlbit	= S5P_CLKGATE_SCLK0_MMC0,
 			.enable		= s5pc100_sclk0_ctrl,
 		},
 		.sources = &clkset_mmc,
-		.reg_div = { .reg = S5PC100_CLKDIV3, .shift = 0, .size = 4,

},

arch/arm/plat-s5pc1xx/s5pc100-clock.c static struct clksrc_clk clksrc_clks[] = { · line 716

Quoted 1 line
arch/arm/plat-s5pc1xx/s5pc100-clock.c +0 -1
-		.reg_src = { .reg = S5PC100_CLKSRC2, .shift = 0, .size = 2,

},

arch/arm/plat-s5pc1xx/s5pc100-clock.c static struct clksrc_clk clksrc_clks[] = {

Quoted 12 lines
arch/arm/plat-s5pc1xx/s5pc100-clock.c +3 -2
+		.reg_div = { .reg = S5P_CLK_DIV3, .shift = 0, .size = 4, },
+		.reg_src = { .reg = S5P_CLK_SRC2, .shift = 0, .size = 2, },
 	}, {
 		.clk	= {
 			.name		= "mmc_bus",
 			.id		= 1,
-			.ctrlbit	= S5PC100_CLKGATE_SCLK0_MMC1,
+			.ctrlbit	= S5P_CLKGATE_SCLK0_MMC1,
 			.enable		= s5pc100_sclk0_ctrl,
 		},
 		.sources = &clkset_mmc,
-		.reg_div = { .reg = S5PC100_CLKDIV3, .shift = 4, .size = 4,

},

arch/arm/plat-s5pc1xx/s5pc100-clock.c static struct clksrc_clk clksrc_clks[] = { · line 726

Quoted 1 line
arch/arm/plat-s5pc1xx/s5pc100-clock.c +0 -1
-		.reg_src = { .reg = S5PC100_CLKSRC2, .shift = 4, .size = 2,

},

arch/arm/plat-s5pc1xx/s5pc100-clock.c static struct clksrc_clk clksrc_clks[] = {

Quoted 12 lines
arch/arm/plat-s5pc1xx/s5pc100-clock.c +3 -2
+		.reg_div = { .reg = S5P_CLK_DIV3, .shift = 4, .size = 4, },
+		.reg_src = { .reg = S5P_CLK_SRC2, .shift = 4, .size = 2, },
 	}, {
 		.clk	= {
 			.name		= "mmc_bus",
 			.id		= 2,
-			.ctrlbit	= S5PC100_CLKGATE_SCLK0_MMC2,
+			.ctrlbit	= S5P_CLKGATE_SCLK0_MMC2,
 			.enable		= s5pc100_sclk0_ctrl,
 		},
 		.sources	= &clkset_mmc,
-		.reg_div = { .reg = S5PC100_CLKDIV3, .shift = 8, .size = 4,

},

arch/arm/plat-s5pc1xx/s5pc100-clock.c static struct clksrc_clk clksrc_clks[] = { · line 736

Quoted 1 line
arch/arm/plat-s5pc1xx/s5pc100-clock.c +0 -1
-		.reg_src = { .reg = S5PC100_CLKSRC2, .shift = 8, .size = 2,

},

arch/arm/plat-s5pc1xx/s5pc100-clock.c static struct clksrc_clk clksrc_clks[] = {

Quoted 13 lines
arch/arm/plat-s5pc1xx/s5pc100-clock.c +3 -2
+		.reg_div = { .reg = S5P_CLK_DIV3, .shift = 8, .size = 4, },
+		.reg_src = { .reg = S5P_CLK_SRC2, .shift = 8, .size = 2, },
 	}, {
 		.clk	= {
 			.name		= "usbhost",
 			.id		= -1,
-			.ctrlbit        =
 S5PC100_CLKGATE_SCLK0_USBHOST,
+			.ctrlbit        = S5P_CLKGATE_SCLK0_USBHOST,
 			.enable		= s5pc100_sclk0_ctrl,
 		},
 		.sources = &clkset_usbhost,
-		.reg_div = { .reg = S5PC100_CLKDIV2, .shift = 20, .size = 4,

},

arch/arm/plat-s5pc1xx/s5pc100-clock.c static struct clksrc_clk clksrc_clks[] = { · line 747

Quoted 1 line
arch/arm/plat-s5pc1xx/s5pc100-clock.c +0 -1
-		.reg_src = { .reg = S5PC100_CLKSRC1, .shift = 20, .size = 2,

},

Quoted 19 lines
arch/arm/plat-s5pc1xx/s5pc100-clock.c +4 -2
+		.reg_div = { .reg = S5P_CLK_DIV2, .shift = 20, .size = 4, },
+		.reg_src = { .reg = S5P_CLK_SRC1, .shift = 20, .size = 2, },
 	}
 };
@@ -775,8 +775,8 @@ void __init_or_cpufreq s5pc100_setup_clocks(void)
 
 	printk(KERN_DEBUG "%s: registering clocks\n", __func__);
 
-	clkdiv0 = __raw_readl(S5PC100_CLKDIV0);
-	clkdiv1 = __raw_readl(S5PC100_CLKDIV1);
+	clkdiv0 = __raw_readl(S5P_CLK_DIV0);
+	clkdiv1 = __raw_readl(S5P_CLK_DIV1);
 
 	printk(KERN_DEBUG "%s: clkdiv0 = %08x, clkdiv1 = %08x\n", __func__,
 clkdiv0, clkdiv1);
@@ -788,22 +788,22 @@ void __init_or_cpufreq s5pc100_setup_clocks(void)
 

arch/arm/plat-s5pc1xx/s5pc100-clock.c void __init_or_cpufreq s5pc100_setup_clocks(void) · line 794

Quoted 10 lines
arch/arm/plat-s5pc1xx/s5pc100-clock.c +4 -4
 	printk(KERN_DEBUG "%s: xtal is %ld\n", __func__, xtal);
 
-	apll = s5pc1xx_get_pll(xtal, __raw_readl(S5PC100_APLL_CON));
-	mpll = s5pc1xx_get_pll(xtal, __raw_readl(S5PC100_MPLL_CON));
-	epll = s5pc1xx_get_pll(xtal, __raw_readl(S5PC100_EPLL_CON));
-	hpll = s5pc1xx_get_pll(xtal, __raw_readl(S5PC100_HPLL_CON));
+	apll = s5pc1xx_get_pll(xtal, __raw_readl(S5P_APLL_CON));
+	mpll = s5pc1xx_get_pll(xtal, __raw_readl(S5P_MPLL_CON));
+	epll = s5pc1xx_get_pll(xtal, __raw_readl(S5P_EPLL_CON));
+	hpll = s5pc1xx_get_pll(xtal, __raw_readl(S5P_HPLL_CON));

How about using the s5p_get_pllxxx function instead of s5pc1xx_get_pll.

Quoted 8 lines
arch/arm/plat-s5pc1xx/s5pc100-clock.c +0 -2
 	printk(KERN_INFO "S5PC100: Apll=%ld.%03ld Mhz, Mpll=%ld.%03ld Mhz"
 		", Epll=%ld.%03ld Mhz, Hpll=%ld.%03ld Mhz\n",
 		print_mhz(apll), print_mhz(mpll),
 		print_mhz(epll), print_mhz(hpll));
 
-	armclk = apll / GET_DIV(clkdiv0, S5PC100_CLKDIV0_APLL);
-	armclk = armclk / GET_DIV(clkdiv0, S5PC100_CLKDIV0_ARM);

arch/arm/plat-s5pc1xx/s5pc100-clock.c void __init_or_cpufreq s5pc100_setup_clocks(void) · line 806

Quoted 10 lines
arch/arm/plat-s5pc1xx/s5pc100-clock.c +6 -4
-	hclkd0 = armclk / GET_DIV(clkdiv0, S5PC100_CLKDIV0_D0);
-	pclkd0 = hclkd0 / GET_DIV(clkdiv0, S5PC100_CLKDIV0_PCLKD0);
-	hclk = mpll / GET_DIV(clkdiv1, S5PC100_CLKDIV1_D1);
-	pclk = hclk / GET_DIV(clkdiv1, S5PC100_CLKDIV1_PCLKD1);
+	armclk = apll / GET_DIV(clkdiv0, S5P_CLK_DIV0_APLL);
+	armclk = armclk / GET_DIV(clkdiv0, S5P_CLK_DIV0_ARM);
+	hclkd0 = armclk / GET_DIV(clkdiv0, S5P_CLK_DIV0_D0);
+	pclkd0 = hclkd0 / GET_DIV(clkdiv0, S5P_CLK_DIV0_PCLKD0);
+	hclk = mpll / GET_DIV(clkdiv1, S5P_CLK_DIV1_D1);
+	pclk = hclk / GET_DIV(clkdiv1, S5P_CLK_DIV1_PCLKD1);

Is it necessary to change the clk parent points if this happens?

Quoted 4 lines
arch/arm/plat-s5pc1xx/s5pc100-clock.c +0 -0
 	printk(KERN_INFO "S5PC100: ARMCLK=%ld.%03ld MHz,

HCLKD0=%ld.%03ld MHz,"
" PCLKD0=%ld.%03ld MHz\n, HCLK=%ld.%03ld MHz,"

As you know, the clock scheme has been changed much. Can you re-work for c100 clock?

Quoted 1 line

--

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.

#3 lore raw

PATCH 1/16 ARM: S5PC1xx rename registers to match plat-s5p style

Hello,

Quoted 60 lines · Kukjin Kim
Quoted 10 lines · Marek Szyprowski

Prepare for moving support for S5PC100 SoC to plat-s5p framework (part 1). Rename all clock registers to match plat-s5p style.

---
 arch/arm/mach-s5pc100/include/mach/system.h     |    2 +-
 arch/arm/plat-s5pc1xx/clock.c                   |  190 ++++++------
 arch/arm/plat-s5pc1xx/include/plat/regs-clock.h |  366

+++++++++++-----------

Quoted 9 lines
 arch/arm/plat-s5pc1xx/s5pc100-clock.c           |  180 ++++++------
 4 files changed, 369 insertions(+), 369 deletions(-)
arch/arm/mach- renamed from arch/arm/mach-s5pc100/include/mach/system.h +0 -0

s5pc100/include/mach/system.h
index f0d31a2..09aea4d 100644

arch/arm/mach-s5pc100/include/mach/system.h static void arch_idle(void) · line 31

Quoted 8 lines
arch/arm/mach-s5pc100/include/mach/system.h +1 -1
@@ -25,7 +25,7 @@ static void arch_idle(void)
 
 static void arch_reset(char mode, const char *cmd)
 {
-	__raw_writel(S5PC100_SWRESET_RESETVAL, S5PC100_SWRESET);
+	__raw_writel(S5P_SWRESET_RESETVAL, S5P_SWRESET);
 	return;
 }
 #endif /* __ASM_ARCH_IRQ_H */

Why __ASM_ARCH_IRQ_H?
It may be right __ASM_ARCH_SYSTEM_H.

arch/arm/plat-

Quoted 1 line
arch/arm/plat- renamed from arch/arm/plat-s5pc1xx/clock.c +0 -0

s5pc1xx/clock.c

arch/arm/plat-s5pc1xx/clock.c static int s5pc1xx_clk_gate(void __iomem *reg, struct

Quoted 22 lines

index 387f231..1a07dd5 100644

arch/arm/plat-s5pc1xx/clock.c +4 -4
@@ -39,13 +39,13 @@ static int clk_48m_ctrl(struct clk *clk, int enable)
 	/* can't rely on clock lock, this register has other usages */
 	local_irq_save(flags);
 
-	val = __raw_readl(S5PC100_CLKSRC1);
+	val = __raw_readl(S5P_CLK_SRC1);
 	if (enable)
-		val |= S5PC100_CLKSRC1_CLK48M_MASK;
+		val |= S5P_CLK_SRC1_CLK48M_MASK;
 	else
-		val &= ~S5PC100_CLKSRC1_CLK48M_MASK;
+		val &= ~S5P_CLK_SRC1_CLK48M_MASK;
 
-	__raw_writel(val, S5PC100_CLKSRC1);
+	__raw_writel(val, S5P_CLK_SRC1);
 	local_irq_restore(flags);
 
 	return 0;
@@ -99,62 +99,62 @@ static int s5pc1xx_clk_gate(void __iomem *reg, struct

clk

Quoted 2 lines
arch/arm/plat-s5pc1xx/clock.c +0 -0
 *clk, int enable)
 
Quoted 8 lines

arch/arm/plat-s5pc1xx/clock.c static int s5pc1xx_clk_gate(void __iomem *reg, struct clk *clk, int enable) · line 102

Quoted 4 lines
arch/arm/plat-s5pc1xx/clock.c +1 -1
 static int s5pc100_clk_d00_ctrl(struct clk *clk, int enable)
 {
-	return s5pc1xx_clk_gate(S5PC100_CLKGATE_D00, clk, enable);
+	return s5pc1xx_clk_gate(S5P_CLKGATE_D00, clk, enable);

Please use s5p_gatectrl(plat-s5p/clock.c) instead of s5pc1xx_clk_gate.

...

This patch is a simple global register rename. I moved all real changes to the separate patch to make it easy to follow what has been changed.

Best regards
--
Marek Szyprowski
Samsung Poland R&D Center

#4 lore raw

PATCH 1/16 ARM: S5PC1xx rename registers to match plat-s5p style

In reply to Marek Szyprowski
Quoted 125 lines · Marek Szyprowski

Prepare for moving support for S5PC100 SoC to plat-s5p framework (part 1). Rename all clock registers to match plat-s5p style.

---
 arch/arm/mach-s5pc100/include/mach/system.h     |    2 +-
 arch/arm/plat-s5pc1xx/clock.c                   |  190 ++++++------
 arch/arm/plat-s5pc1xx/include/plat/regs-clock.h |  366 +++++++++++-----------
 arch/arm/plat-s5pc1xx/s5pc100-clock.c           |  180 ++++++------
 4 files changed, 369 insertions(+), 369 deletions(-)
arch/arm/mach-s5pc100/include/mach/system.h +1 -1
index f0d31a2..09aea4d 100644
@@ -25,7 +25,7 @@ static void arch_idle(void)
 
 static void arch_reset(char mode, const char *cmd)
 {
-	__raw_writel(S5PC100_SWRESET_RESETVAL, S5PC100_SWRESET);
+	__raw_writel(S5P_SWRESET_RESETVAL, S5P_SWRESET);
 	return;
 }
 #endif /* __ASM_ARCH_IRQ_H */
arch/arm/plat-s5pc1xx/clock.c +16 -16
index 387f231..1a07dd5 100644
@@ -39,13 +39,13 @@ static int clk_48m_ctrl(struct clk *clk, int enable)
 	/* can't rely on clock lock, this register has other usages */
 	local_irq_save(flags);
 
-	val = __raw_readl(S5PC100_CLKSRC1);
+	val = __raw_readl(S5P_CLK_SRC1);
 	if (enable)
-		val |= S5PC100_CLKSRC1_CLK48M_MASK;
+		val |= S5P_CLK_SRC1_CLK48M_MASK;
 	else
-		val &= ~S5PC100_CLKSRC1_CLK48M_MASK;
+		val &= ~S5P_CLK_SRC1_CLK48M_MASK;
 
-	__raw_writel(val, S5PC100_CLKSRC1);
+	__raw_writel(val, S5P_CLK_SRC1);
 	local_irq_restore(flags);
 
 	return 0;
@@ -99,62 +99,62 @@ static int s5pc1xx_clk_gate(void __iomem *reg, struct clk *clk, int enable)
 
 static int s5pc100_clk_d00_ctrl(struct clk *clk, int enable)
 {
-	return s5pc1xx_clk_gate(S5PC100_CLKGATE_D00, clk, enable);
+	return s5pc1xx_clk_gate(S5P_CLKGATE_D00, clk, enable);
 }
 
 static int s5pc100_clk_d01_ctrl(struct clk *clk, int enable)
 {
-	return s5pc1xx_clk_gate(S5PC100_CLKGATE_D01, clk, enable);
+	return s5pc1xx_clk_gate(S5P_CLKGATE_D01, clk, enable);
 }
 
 static int s5pc100_clk_d02_ctrl(struct clk *clk, int enable)
 {
-	return s5pc1xx_clk_gate(S5PC100_CLKGATE_D02, clk, enable);
+	return s5pc1xx_clk_gate(S5P_CLKGATE_D02, clk, enable);
 }
 
 static int s5pc100_clk_d10_ctrl(struct clk *clk, int enable)
 {
-	return s5pc1xx_clk_gate(S5PC100_CLKGATE_D10, clk, enable);
+	return s5pc1xx_clk_gate(S5P_CLKGATE_D10, clk, enable);
 }
 
 static int s5pc100_clk_d11_ctrl(struct clk *clk, int enable)
 {
-	return s5pc1xx_clk_gate(S5PC100_CLKGATE_D11, clk, enable);
+	return s5pc1xx_clk_gate(S5P_CLKGATE_D11, clk, enable);
 }
 
 static int s5pc100_clk_d12_ctrl(struct clk *clk, int enable)
 {
-	return s5pc1xx_clk_gate(S5PC100_CLKGATE_D12, clk, enable);
+	return s5pc1xx_clk_gate(S5P_CLKGATE_D12, clk, enable);
 }
 
 static int s5pc100_clk_d13_ctrl(struct clk *clk, int enable)
 {
-	return s5pc1xx_clk_gate(S5PC100_CLKGATE_D13, clk, enable);
+	return s5pc1xx_clk_gate(S5P_CLKGATE_D13, clk, enable);
 }
 
 static int s5pc100_clk_d14_ctrl(struct clk *clk, int enable)
 {
-	return s5pc1xx_clk_gate(S5PC100_CLKGATE_D14, clk, enable);
+	return s5pc1xx_clk_gate(S5P_CLKGATE_D14, clk, enable);
 }
 
 static int s5pc100_clk_d15_ctrl(struct clk *clk, int enable)
 {
-	return s5pc1xx_clk_gate(S5PC100_CLKGATE_D15, clk, enable);
+	return s5pc1xx_clk_gate(S5P_CLKGATE_D15, clk, enable);
 }
 
 static int s5pc100_clk_d20_ctrl(struct clk *clk, int enable)
 {
-	return s5pc1xx_clk_gate(S5PC100_CLKGATE_D20, clk, enable);
+	return s5pc1xx_clk_gate(S5P_CLKGATE_D20, clk, enable);
 }
 
 int s5pc100_sclk0_ctrl(struct clk *clk, int enable)
 {
-	return s5pc1xx_clk_gate(S5PC100_SCLKGATE0, clk, enable);
+	return s5pc1xx_clk_gate(S5P_SCLKGATE0, clk, enable);
 }
 
 int s5pc100_sclk1_ctrl(struct clk *clk, int enable)
 {
-	return s5pc1xx_clk_gate(S5PC100_SCLKGATE1, clk, enable);
+	return s5pc1xx_clk_gate(S5P_SCLKGATE1, clk, enable);
 }
 
 static struct clk s5pc100_init_clocks_disable[] = {
@@ -163,43 +163,43 @@ static struct clk s5pc100_init_clocks_disable[] = {
 		.id		= -1,
 		.parent		= &clk_p,

arch/arm/plat-s5pc1xx/clock.c static struct clk s5pc100_init_clocks_disable[] = { · line 172

Quoted 10 lines
arch/arm/plat-s5pc1xx/clock.c +2 -2
 		.enable		= s5pc100_clk_d11_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D11_DSI,
+		.ctrlbit	= S5P_CLKGATE_D11_DSI,
 	}, {
 		.name		= "csi",
 		.id		= -1,
 		.parent		= &clk_h,
 		.enable		= s5pc100_clk_d11_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D11_CSI,
+		.ctrlbit	= S5P_CLKGATE_D11_CSI,

Renaming S5PC100_CLKGATE_D11_CSI to S5P_CLKGATE_D11_CSI is something we should only look at doing if these are shared with the other S5P SoCs, otherwise please keep the S5PC100 prefix to keep the change down to a minimum.

Also, rember we may be in a position where we a re building multiple S5PC SoCs into one kernel.

Quoted 1,460 lines
arch/arm/plat-s5pc1xx/clock.c +77 -77
 	}, {
 		.name		= "ccan",
 		.id		= 0,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d14_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D14_CCAN0,
+		.ctrlbit	= S5P_CLKGATE_D14_CCAN0,
 	}, {
 		.name		= "ccan",
 		.id		= 1,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d14_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D14_CCAN1,
+		.ctrlbit	= S5P_CLKGATE_D14_CCAN1,
 	}, {
 		.name		= "keypad",
 		.id		= -1,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d15_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D15_KEYIF,
+		.ctrlbit	= S5P_CLKGATE_D15_KEYIF,
 	}, {
 		.name		= "hclkd2",
 		.id		= -1,
 		.parent		= NULL,
 		.enable		= s5pc100_clk_d20_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D20_HCLKD2,
+		.ctrlbit	= S5P_CLKGATE_D20_HCLKD2,
 	}, {
 		.name		= "iis-d2",
 		.id		= -1,
 		.parent		= NULL,
 		.enable		= s5pc100_clk_d20_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D20_I2SD2,
+		.ctrlbit	= S5P_CLKGATE_D20_I2SD2,
 	},
 };
 
@@ -210,43 +210,43 @@ static struct clk s5pc100_init_clocks[] = {
 		.id		= -1,
 		.parent		= &clk_hd0,
 		.enable		= s5pc100_clk_d00_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D00_INTC,
+		.ctrlbit	= S5P_CLKGATE_D00_INTC,
 	}, {
 		.name		= "tzic",
 		.id		= -1,
 		.parent		= &clk_hd0,
 		.enable		= s5pc100_clk_d00_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D00_TZIC,
+		.ctrlbit	= S5P_CLKGATE_D00_TZIC,
 	}, {
 		.name		= "cf-ata",
 		.id		= -1,
 		.parent		= &clk_hd0,
 		.enable		= s5pc100_clk_d00_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D00_CFCON,
+		.ctrlbit	= S5P_CLKGATE_D00_CFCON,
 	}, {
 		.name		= "mdma",
 		.id		= -1,
 		.parent		= &clk_hd0,
 		.enable		= s5pc100_clk_d00_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D00_MDMA,
+		.ctrlbit	= S5P_CLKGATE_D00_MDMA,
 	}, {
 		.name		= "g2d",
 		.id		= -1,
 		.parent		= &clk_hd0,
 		.enable		= s5pc100_clk_d00_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D00_G2D,
+		.ctrlbit	= S5P_CLKGATE_D00_G2D,
 	}, {
 		.name		= "secss",
 		.id		= -1,
 		.parent		= &clk_hd0,
 		.enable		= s5pc100_clk_d00_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D00_SECSS,
+		.ctrlbit	= S5P_CLKGATE_D00_SECSS,
 	}, {
 		.name		= "cssys",
 		.id		= -1,
 		.parent		= &clk_hd0,
 		.enable		= s5pc100_clk_d00_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D00_CSSYS,
+		.ctrlbit	= S5P_CLKGATE_D00_CSSYS,
 	},
 
 	/* Memory (D0_1) devices */
@@ -255,37 +255,37 @@ static struct clk s5pc100_init_clocks[] = {
 		.id		= -1,
 		.parent		= &clk_hd0,
 		.enable		= s5pc100_clk_d01_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D01_DMC,
+		.ctrlbit	= S5P_CLKGATE_D01_DMC,
 	}, {
 		.name		= "sromc",
 		.id		= -1,
 		.parent		= &clk_hd0,
 		.enable		= s5pc100_clk_d01_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D01_SROMC,
+		.ctrlbit	= S5P_CLKGATE_D01_SROMC,
 	}, {
 		.name		= "onenand",
 		.id		= -1,
 		.parent		= &clk_hd0,
 		.enable		= s5pc100_clk_d01_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D01_ONENAND,
+		.ctrlbit	= S5P_CLKGATE_D01_ONENAND,
 	}, {
 		.name		= "nand",
 		.id		= -1,
 		.parent		= &clk_hd0,
 		.enable		= s5pc100_clk_d01_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D01_NFCON,
+		.ctrlbit	= S5P_CLKGATE_D01_NFCON,
 	}, {
 		.name		= "intmem",
 		.id		= -1,
 		.parent		= &clk_hd0,
 		.enable		= s5pc100_clk_d01_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D01_INTMEM,
+		.ctrlbit	= S5P_CLKGATE_D01_INTMEM,
 	}, {
 		.name		= "ebi",
 		.id		= -1,
 		.parent		= &clk_hd0,
 		.enable		= s5pc100_clk_d01_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D01_EBI,
+		.ctrlbit	= S5P_CLKGATE_D01_EBI,
 	},
 
 	/* System2 (D0_2) devices */
@@ -294,13 +294,13 @@ static struct clk s5pc100_init_clocks[] = {
 		.id		= -1,
 		.parent		= &clk_pd0,
 		.enable		= s5pc100_clk_d02_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D02_SECKEY,
+		.ctrlbit	= S5P_CLKGATE_D02_SECKEY,
 	}, {
 		.name		= "sdm",
 		.id		= -1,
 		.parent		= &clk_hd0,
 		.enable		= s5pc100_clk_d02_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D02_SDM,
+		.ctrlbit	= S5P_CLKGATE_D02_SDM,
 	},
 
 	/* File (D1_0) devices */
@@ -309,49 +309,49 @@ static struct clk s5pc100_init_clocks[] = {
 		.id		= 0,
 		.parent		= &clk_h,
 		.enable		= s5pc100_clk_d10_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D10_PDMA0,
+		.ctrlbit	= S5P_CLKGATE_D10_PDMA0,
 	}, {
 		.name		= "pdma",
 		.id		= 1,
 		.parent		= &clk_h,
 		.enable		= s5pc100_clk_d10_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D10_PDMA1,
+		.ctrlbit	= S5P_CLKGATE_D10_PDMA1,
 	}, {
 		.name		= "usb-host",
 		.id		= -1,
 		.parent		= &clk_h,
 		.enable		= s5pc100_clk_d10_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D10_USBHOST,
+		.ctrlbit	= S5P_CLKGATE_D10_USBHOST,
 	}, {
 		.name		= "otg",
 		.id		= -1,
 		.parent		= &clk_h,
 		.enable		= s5pc100_clk_d10_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D10_USBOTG,
+		.ctrlbit	= S5P_CLKGATE_D10_USBOTG,
 	}, {
 		.name		= "modem",
 		.id		= -1,
 		.parent		= &clk_h,
 		.enable		= s5pc100_clk_d10_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D10_MODEMIF,
+		.ctrlbit	= S5P_CLKGATE_D10_MODEMIF,
 	}, {
 		.name		= "hsmmc",
 		.id		= 0,
 		.parent		= &clk_48m,
 		.enable		= s5pc100_clk_d10_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D10_HSMMC0,
+		.ctrlbit	= S5P_CLKGATE_D10_HSMMC0,
 	}, {
 		.name		= "hsmmc",
 		.id		= 1,
 		.parent		= &clk_48m,
 		.enable		= s5pc100_clk_d10_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D10_HSMMC1,
+		.ctrlbit	= S5P_CLKGATE_D10_HSMMC1,
 	}, {
 		.name		= "hsmmc",
 		.id		= 2,
 		.parent		= &clk_48m,
 		.enable		= s5pc100_clk_d10_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D10_HSMMC2,
+		.ctrlbit	= S5P_CLKGATE_D10_HSMMC2,
 	},
 
 	/* Multimedia1 (D1_1) devices */
@@ -360,43 +360,43 @@ static struct clk s5pc100_init_clocks[] = {
 		.id		= -1,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d11_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D11_LCD,
+		.ctrlbit	= S5P_CLKGATE_D11_LCD,
 	}, {
 		.name		= "rotator",
 		.id		= -1,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d11_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D11_ROTATOR,
+		.ctrlbit	= S5P_CLKGATE_D11_ROTATOR,
 	}, {
 		.name		= "fimc",
 		.id		= -1,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d11_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D11_FIMC0,
+		.ctrlbit	= S5P_CLKGATE_D11_FIMC0,
 	}, {
 		.name		= "fimc",
 		.id		= -1,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d11_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D11_FIMC1,
+		.ctrlbit	= S5P_CLKGATE_D11_FIMC1,
 	}, {
 		.name		= "fimc",
 		.id		= -1,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d11_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D11_FIMC2,
+		.ctrlbit	= S5P_CLKGATE_D11_FIMC2,
 	}, {
 		.name		= "jpeg",
 		.id		= -1,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d11_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D11_JPEG,
+		.ctrlbit	= S5P_CLKGATE_D11_JPEG,
 	}, {
 		.name		= "g3d",
 		.id		= -1,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d11_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D11_G3D,
+		.ctrlbit	= S5P_CLKGATE_D11_G3D,
 	},
 
 	/* Multimedia2 (D1_2) devices */
@@ -405,31 +405,31 @@ static struct clk s5pc100_init_clocks[] = {
 		.id		= -1,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d12_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D12_TV,
+		.ctrlbit	= S5P_CLKGATE_D12_TV,
 	}, {
 		.name		= "vp",
 		.id		= -1,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d12_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D12_VP,
+		.ctrlbit	= S5P_CLKGATE_D12_VP,
 	}, {
 		.name		= "mixer",
 		.id		= -1,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d12_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D12_MIXER,
+		.ctrlbit	= S5P_CLKGATE_D12_MIXER,
 	}, {
 		.name		= "hdmi",
 		.id		= -1,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d12_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D12_HDMI,
+		.ctrlbit	= S5P_CLKGATE_D12_HDMI,
 	}, {
 		.name		= "mfc",
 		.id		= -1,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d12_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D12_MFC,
+		.ctrlbit	= S5P_CLKGATE_D12_MFC,
 	},
 
 	/* System (D1_3) devices */
@@ -438,49 +438,49 @@ static struct clk s5pc100_init_clocks[] = {
 		.id		= -1,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d13_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D13_CHIPID,
+		.ctrlbit	= S5P_CLKGATE_D13_CHIPID,
 	}, {
 		.name		= "gpio",
 		.id		= -1,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d13_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D13_GPIO,
+		.ctrlbit	= S5P_CLKGATE_D13_GPIO,
 	}, {
 		.name		= "apc",
 		.id		= -1,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d13_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D13_APC,
+		.ctrlbit	= S5P_CLKGATE_D13_APC,
 	}, {
 		.name		= "iec",
 		.id		= -1,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d13_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D13_IEC,
+		.ctrlbit	= S5P_CLKGATE_D13_IEC,
 	}, {
 		.name		= "timers",
 		.id		= -1,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d13_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D13_PWM,
+		.ctrlbit	= S5P_CLKGATE_D13_PWM,
 	}, {
 		.name		= "systimer",
 		.id		= -1,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d13_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D13_SYSTIMER,
+		.ctrlbit	= S5P_CLKGATE_D13_SYSTIMER,
 	}, {
 		.name		= "watchdog",
 		.id		= -1,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d13_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D13_WDT,
+		.ctrlbit	= S5P_CLKGATE_D13_WDT,
 	}, {
 		.name		= "rtc",
 		.id		= -1,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d13_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D13_RTC,
+		.ctrlbit	= S5P_CLKGATE_D13_RTC,
 	},
 
 	/* Connectivity (D1_4) devices */
@@ -489,73 +489,73 @@ static struct clk s5pc100_init_clocks[] = {
 		.id		= 0,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d14_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D14_UART0,
+		.ctrlbit	= S5P_CLKGATE_D14_UART0,
 	}, {
 		.name		= "uart",
 		.id		= 1,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d14_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D14_UART1,
+		.ctrlbit	= S5P_CLKGATE_D14_UART1,
 	}, {
 		.name		= "uart",
 		.id		= 2,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d14_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D14_UART2,
+		.ctrlbit	= S5P_CLKGATE_D14_UART2,
 	}, {
 		.name		= "uart",
 		.id		= 3,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d14_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D14_UART3,
+		.ctrlbit	= S5P_CLKGATE_D14_UART3,
 	}, {
 		.name		= "i2c",
 		.id		= -1,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d14_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D14_IIC,
+		.ctrlbit	= S5P_CLKGATE_D14_IIC,
 	}, {
 		.name		= "hdmi-i2c",
 		.id		= -1,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d14_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D14_HDMI_IIC,
+		.ctrlbit	= S5P_CLKGATE_D14_HDMI_IIC,
 	}, {
 		.name		= "spi",
 		.id		= 0,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d14_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D14_SPI0,
+		.ctrlbit	= S5P_CLKGATE_D14_SPI0,
 	}, {
 		.name		= "spi",
 		.id		= 1,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d14_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D14_SPI1,
+		.ctrlbit	= S5P_CLKGATE_D14_SPI1,
 	}, {
 		.name		= "spi",
 		.id		= 2,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d14_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D14_SPI2,
+		.ctrlbit	= S5P_CLKGATE_D14_SPI2,
 	}, {
 		.name		= "irda",
 		.id		= -1,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d14_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D14_IRDA,
+		.ctrlbit	= S5P_CLKGATE_D14_IRDA,
 	}, {
 		.name		= "hsitx",
 		.id		= -1,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d14_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D14_HSITX,
+		.ctrlbit	= S5P_CLKGATE_D14_HSITX,
 	}, {
 		.name		= "hsirx",
 		.id		= -1,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d14_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D14_HSIRX,
+		.ctrlbit	= S5P_CLKGATE_D14_HSIRX,
 	},
 
 	/* Audio (D1_5) devices */
@@ -564,55 +564,55 @@ static struct clk s5pc100_init_clocks[] = {
 		.id		= 0,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d15_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D15_IIS0,
+		.ctrlbit	= S5P_CLKGATE_D15_IIS0,
 	}, {
 		.name		= "iis",
 		.id		= 1,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d15_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D15_IIS1,
+		.ctrlbit	= S5P_CLKGATE_D15_IIS1,
 	}, {
 		.name		= "iis",
 		.id		= 2,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d15_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D15_IIS2,
+		.ctrlbit	= S5P_CLKGATE_D15_IIS2,
 	}, {
 		.name		= "ac97",
 		.id		= -1,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d15_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D15_AC97,
+		.ctrlbit	= S5P_CLKGATE_D15_AC97,
 	}, {
 		.name		= "pcm",
 		.id		= 0,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d15_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D15_PCM0,
+		.ctrlbit	= S5P_CLKGATE_D15_PCM0,
 	}, {
 		.name		= "pcm",
 		.id		= 1,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d15_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D15_PCM1,
+		.ctrlbit	= S5P_CLKGATE_D15_PCM1,
 	}, {
 		.name		= "spdif",
 		.id		= -1,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d15_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D15_SPDIF,
+		.ctrlbit	= S5P_CLKGATE_D15_SPDIF,
 	}, {
 		.name		= "adc",
 		.id		= -1,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d15_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D15_TSADC,
+		.ctrlbit	= S5P_CLKGATE_D15_TSADC,
 	}, {
 		.name		= "cg",
 		.id		= -1,
 		.parent		= &clk_p,
 		.enable		= s5pc100_clk_d15_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_D15_CG,
+		.ctrlbit	= S5P_CLKGATE_D15_CG,
 	},
 
 	/* Audio (D2_0) devices: all disabled */
@@ -623,49 +623,49 @@ static struct clk s5pc100_init_clocks[] = {
 		.id		= -1,
 		.parent		= NULL,
 		.enable		= s5pc100_sclk0_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_SCLK0_HPM,
+		.ctrlbit	= S5P_CLKGATE_SCLK0_HPM,
 	}, {
 		.name		= "sclk_onenand",
 		.id		= -1,
 		.parent		= NULL,
 		.enable		= s5pc100_sclk0_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_SCLK0_ONENAND,
+		.ctrlbit	= S5P_CLKGATE_SCLK0_ONENAND,
 	}, {
 		.name		= "spi_48",
 		.id		= 0,
 		.parent		= &clk_48m,
 		.enable		= s5pc100_sclk0_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_SCLK0_SPI0_48,
+		.ctrlbit	= S5P_CLKGATE_SCLK0_SPI0_48,
 	}, {
 		.name		= "spi_48",
 		.id		= 1,
 		.parent		= &clk_48m,
 		.enable		= s5pc100_sclk0_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_SCLK0_SPI1_48,
+		.ctrlbit	= S5P_CLKGATE_SCLK0_SPI1_48,
 	}, {
 		.name		= "spi_48",
 		.id		= 2,
 		.parent		= &clk_48m,
 		.enable		= s5pc100_sclk0_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_SCLK0_SPI2_48,
+		.ctrlbit	= S5P_CLKGATE_SCLK0_SPI2_48,
 	}, {
 		.name		= "mmc_48",
 		.id		= 0,
 		.parent		= &clk_48m,
 		.enable		= s5pc100_sclk0_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_SCLK0_MMC0_48,
+		.ctrlbit	= S5P_CLKGATE_SCLK0_MMC0_48,
 	}, {
 		.name		= "mmc_48",
 		.id		= 1,
 		.parent		= &clk_48m,
 		.enable		= s5pc100_sclk0_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_SCLK0_MMC1_48,
+		.ctrlbit	= S5P_CLKGATE_SCLK0_MMC1_48,
 	}, {
 		.name		= "mmc_48",
 		.id		= 2,
 		.parent		= &clk_48m,
 		.enable		= s5pc100_sclk0_ctrl,
-		.ctrlbit	= S5PC100_CLKGATE_SCLK0_MMC2_48,
+		.ctrlbit	= S5P_CLKGATE_SCLK0_MMC2_48,
 	},
 	/* Special Clocks 1 */
 };
arch/arm/plat-s5pc1xx/include/plat/regs-clock.h +183 -183
index 24dec4e..5c9c4cb 100644
@@ -3,7 +3,7 @@
  * Copyright 2009 Samsung Electronics Co.
  *	Byungho Min <[email protected]>
  *
- * 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
@@ -13,240 +13,240 @@
 #ifndef __PLAT_REGS_CLOCK_H
 #define __PLAT_REGS_CLOCK_H __FILE__
 
-#define S5PC100_CLKREG(x)		(S5PC1XX_VA_CLK + (x))
-#define S5PC100_CLKREG_OTHER(x)		(S5PC1XX_VA_CLK_OTHER + (x))
+#define S5P_CLKREG(x)		(S5PC1XX_VA_CLK + (x))
+#define S5PC100_REG_OTHERS(x)	(S5PC1XX_VA_CLK_OTHER + (x))
 
 /* s5pc100 register for clock */
-#define S5PC100_APLL_LOCK		S5PC100_CLKREG(0x00)
-#define S5PC100_MPLL_LOCK		S5PC100_CLKREG(0x04)
-#define S5PC100_EPLL_LOCK		S5PC100_CLKREG(0x08)
-#define S5PC100_HPLL_LOCK		S5PC100_CLKREG(0x0C)
+#define S5P_APLL_LOCK		S5P_CLKREG(0x00)
+#define S5P_MPLL_LOCK		S5P_CLKREG(0x04)
+#define S5P_EPLL_LOCK		S5P_CLKREG(0x08)
+#define S5P_HPLL_LOCK		S5P_CLKREG(0x0C)
 
-#define S5PC100_APLL_CON		S5PC100_CLKREG(0x100)
-#define S5PC100_MPLL_CON		S5PC100_CLKREG(0x104)
-#define S5PC100_EPLL_CON		S5PC100_CLKREG(0x108)
-#define S5PC100_HPLL_CON		S5PC100_CLKREG(0x10C)
+#define S5P_APLL_CON		S5P_CLKREG(0x100)
+#define S5P_MPLL_CON		S5P_CLKREG(0x104)
+#define S5P_EPLL_CON		S5P_CLKREG(0x108)
+#define S5P_HPLL_CON		S5P_CLKREG(0x10C)
 
-#define S5PC100_CLKSRC0			S5PC100_CLKREG(0x200)
-#define S5PC100_CLKSRC1			S5PC100_CLKREG(0x204)
-#define S5PC100_CLKSRC2			S5PC100_CLKREG(0x208)
-#define S5PC100_CLKSRC3			S5PC100_CLKREG(0x20C)
+#define S5P_CLK_SRC0		S5P_CLKREG(0x200)
+#define S5P_CLK_SRC1		S5P_CLKREG(0x204)
+#define S5P_CLK_SRC2		S5P_CLKREG(0x208)
+#define S5P_CLK_SRC3		S5P_CLKREG(0x20C)
 
-#define S5PC100_CLKDIV0			S5PC100_CLKREG(0x300)
-#define S5PC100_CLKDIV1			S5PC100_CLKREG(0x304)
-#define S5PC100_CLKDIV2			S5PC100_CLKREG(0x308)
-#define S5PC100_CLKDIV3			S5PC100_CLKREG(0x30C)
-#define S5PC100_CLKDIV4			S5PC100_CLKREG(0x310)
+#define S5P_CLK_DIV0		S5P_CLKREG(0x300)
+#define S5P_CLK_DIV1		S5P_CLKREG(0x304)
+#define S5P_CLK_DIV2		S5P_CLKREG(0x308)
+#define S5P_CLK_DIV3		S5P_CLKREG(0x30C)
+#define S5P_CLK_DIV4		S5P_CLKREG(0x310)
 
-#define S5PC100_CLK_OUT			S5PC100_CLKREG(0x400)
+#define S5P_CLK_OUT		S5P_CLKREG(0x400)
 
-#define S5PC100_CLKGATE_D00		S5PC100_CLKREG(0x500)
-#define S5PC100_CLKGATE_D01		S5PC100_CLKREG(0x504)
-#define S5PC100_CLKGATE_D02		S5PC100_CLKREG(0x508)
+#define S5P_CLKGATE_D00		S5P_CLKREG(0x500)
+#define S5P_CLKGATE_D01		S5P_CLKREG(0x504)
+#define S5P_CLKGATE_D02		S5P_CLKREG(0x508)
 
-#define S5PC100_CLKGATE_D10		S5PC100_CLKREG(0x520)
-#define S5PC100_CLKGATE_D11		S5PC100_CLKREG(0x524)
-#define S5PC100_CLKGATE_D12		S5PC100_CLKREG(0x528)
-#define S5PC100_CLKGATE_D13		S5PC100_CLKREG(0x52C)
-#define S5PC100_CLKGATE_D14		S5PC100_CLKREG(0x530)
-#define S5PC100_CLKGATE_D15		S5PC100_CLKREG(0x534)
+#define S5P_CLKGATE_D10		S5P_CLKREG(0x520)
+#define S5P_CLKGATE_D11		S5P_CLKREG(0x524)
+#define S5P_CLKGATE_D12		S5P_CLKREG(0x528)
+#define S5P_CLKGATE_D13		S5P_CLKREG(0x52C)
+#define S5P_CLKGATE_D14		S5P_CLKREG(0x530)
+#define S5P_CLKGATE_D15		S5P_CLKREG(0x534)
 
-#define S5PC100_CLKGATE_D20		S5PC100_CLKREG(0x540)
+#define S5P_CLKGATE_D20		S5P_CLKREG(0x540)
 
-#define S5PC100_SCLKGATE0		S5PC100_CLKREG(0x560)
-#define S5PC100_SCLKGATE1		S5PC100_CLKREG(0x564)
+#define S5P_SCLKGATE0		S5P_CLKREG(0x560)
+#define S5P_SCLKGATE1		S5P_CLKREG(0x564)
 
 /* EPLL_CON */
-#define S5PC100_EPLL_EN			(1<<31)
-#define S5PC100_EPLL_MASK		0xffffffff
-#define S5PC100_EPLLVAL(_m, _p, _s)	((_m) << 16 | ((_p) << 8) | ((_s)))
+#define S5P_EPLL_EN		(1<<31)
+#define S5P_EPLL_MASK		0xffffffff
+#define S5P_EPLLVAL(_m, _p, _s)	((_m) << 16 | ((_p) << 8) | ((_s)))
 
 /* CLKSRC0..CLKSRC3 -> mostly removed due to clksrc updates */
-#define S5PC100_CLKSRC1_CLK48M_MASK	(0x1<<24)
-#define S5PC100_CLKSRC1_CLK48M_SHIFT	(24)
+#define S5P_CLK_SRC1_CLK48M_MASK	(0x1<<24)
+#define S5P_CLK_SRC1_CLK48M_SHIFT	(24)
 
 /* CLKDIV0 */
-#define S5PC100_CLKDIV0_APLL_MASK		(0x1<<0)
-#define S5PC100_CLKDIV0_APLL_SHIFT		(0)
-#define S5PC100_CLKDIV0_ARM_MASK		(0x7<<4)
-#define S5PC100_CLKDIV0_ARM_SHIFT		(4)
-#define S5PC100_CLKDIV0_D0_MASK		(0x7<<8)
-#define S5PC100_CLKDIV0_D0_SHIFT		(8)
-#define S5PC100_CLKDIV0_PCLKD0_MASK		(0x7<<12)
-#define S5PC100_CLKDIV0_PCLKD0_SHIFT	(12)
-#define S5PC100_CLKDIV0_SECSS_MASK		(0x7<<16)
-#define S5PC100_CLKDIV0_SECSS_SHIFT		(16)
+#define S5P_CLK_DIV0_APLL_MASK		(0x1<<0)
+#define S5P_CLK_DIV0_APLL_SHIFT		(0)
+#define S5P_CLK_DIV0_ARM_MASK		(0x7<<4)
+#define S5P_CLK_DIV0_ARM_SHIFT		(4)
+#define S5P_CLK_DIV0_D0_MASK		(0x7<<8)
+#define S5P_CLK_DIV0_D0_SHIFT		(8)
+#define S5P_CLK_DIV0_PCLKD0_MASK		(0x7<<12)
+#define S5P_CLK_DIV0_PCLKD0_SHIFT	(12)
+#define S5P_CLK_DIV0_SECSS_MASK		(0x7<<16)
+#define S5P_CLK_DIV0_SECSS_SHIFT		(16)
 
 /* CLKDIV1 (OneNAND clock only used in one place, removed) */
-#define S5PC100_CLKDIV1_APLL2_MASK		(0x7<<0)
-#define S5PC100_CLKDIV1_APLL2_SHIFT		(0)
-#define S5PC100_CLKDIV1_MPLL_MASK		(0x3<<4)
-#define S5PC100_CLKDIV1_MPLL_SHIFT		(4)
-#define S5PC100_CLKDIV1_MPLL2_MASK		(0x1<<8)
-#define S5PC100_CLKDIV1_MPLL2_SHIFT		(8)
-#define S5PC100_CLKDIV1_D1_MASK		(0x7<<12)
-#define S5PC100_CLKDIV1_D1_SHIFT		(12)
-#define S5PC100_CLKDIV1_PCLKD1_MASK		(0x7<<16)
-#define S5PC100_CLKDIV1_PCLKD1_SHIFT	(16)
-#define S5PC100_CLKDIV1_CAM_MASK		(0x1F<<24)
-#define S5PC100_CLKDIV1_CAM_SHIFT		(24)
+#define S5P_CLK_DIV1_APLL2_MASK		(0x7<<0)
+#define S5P_CLK_DIV1_APLL2_SHIFT		(0)
+#define S5P_CLK_DIV1_MPLL_MASK		(0x3<<4)
+#define S5P_CLK_DIV1_MPLL_SHIFT		(4)
+#define S5P_CLK_DIV1_MPLL2_MASK		(0x1<<8)
+#define S5P_CLK_DIV1_MPLL2_SHIFT		(8)
+#define S5P_CLK_DIV1_D1_MASK		(0x7<<12)
+#define S5P_CLK_DIV1_D1_SHIFT		(12)
+#define S5P_CLK_DIV1_PCLKD1_MASK		(0x7<<16)
+#define S5P_CLK_DIV1_PCLKD1_SHIFT	(16)
+#define S5P_CLK_DIV1_CAM_MASK		(0x1F<<24)
+#define S5P_CLK_DIV1_CAM_SHIFT		(24)
 
 /* CLKDIV2 => removed in clksrc update */
 /* CLKDIV3 => removed in clksrc update, or not needed */
 /* CLKDIV4 => removed in clksrc update, or not needed */
 
 /* HCLKD0/PCLKD0 Clock Gate 0 Registers */
-#define S5PC100_CLKGATE_D00_INTC		(1<<0)
-#define S5PC100_CLKGATE_D00_TZIC		(1<<1)
-#define S5PC100_CLKGATE_D00_CFCON		(1<<2)
-#define S5PC100_CLKGATE_D00_MDMA		(1<<3)
-#define S5PC100_CLKGATE_D00_G2D		(1<<4)
-#define S5PC100_CLKGATE_D00_SECSS		(1<<5)
-#define S5PC100_CLKGATE_D00_CSSYS		(1<<6)
+#define S5P_CLKGATE_D00_INTC		(1<<0)
+#define S5P_CLKGATE_D00_TZIC		(1<<1)
+#define S5P_CLKGATE_D00_CFCON		(1<<2)
+#define S5P_CLKGATE_D00_MDMA		(1<<3)
+#define S5P_CLKGATE_D00_G2D		(1<<4)
+#define S5P_CLKGATE_D00_SECSS		(1<<5)
+#define S5P_CLKGATE_D00_CSSYS		(1<<6)
 
 /* HCLKD0/PCLKD0 Clock Gate 1 Registers */
-#define S5PC100_CLKGATE_D01_DMC		(1<<0)
-#define S5PC100_CLKGATE_D01_SROMC		(1<<1)
-#define S5PC100_CLKGATE_D01_ONENAND		(1<<2)
-#define S5PC100_CLKGATE_D01_NFCON		(1<<3)
-#define S5PC100_CLKGATE_D01_INTMEM		(1<<4)
-#define S5PC100_CLKGATE_D01_EBI		(1<<5)
+#define S5P_CLKGATE_D01_DMC		(1<<0)
+#define S5P_CLKGATE_D01_SROMC		(1<<1)
+#define S5P_CLKGATE_D01_ONENAND		(1<<2)
+#define S5P_CLKGATE_D01_NFCON		(1<<3)
+#define S5P_CLKGATE_D01_INTMEM		(1<<4)
+#define S5P_CLKGATE_D01_EBI		(1<<5)
 
 /* PCLKD0 Clock Gate 2 Registers */
-#define S5PC100_CLKGATE_D02_SECKEY		(1<<1)
-#define S5PC100_CLKGATE_D02_SDM		(1<<2)
+#define S5P_CLKGATE_D02_SECKEY		(1<<1)
+#define S5P_CLKGATE_D02_SDM		(1<<2)
 
 /* HCLKD1/PCLKD1 Clock Gate 0 Registers */
-#define S5PC100_CLKGATE_D10_PDMA0		(1<<0)
-#define S5PC100_CLKGATE_D10_PDMA1		(1<<1)
-#define S5PC100_CLKGATE_D10_USBHOST		(1<<2)
-#define S5PC100_CLKGATE_D10_USBOTG		(1<<3)
-#define S5PC100_CLKGATE_D10_MODEMIF		(1<<4)
-#define S5PC100_CLKGATE_D10_HSMMC0		(1<<5)
-#define S5PC100_CLKGATE_D10_HSMMC1		(1<<6)
-#define S5PC100_CLKGATE_D10_HSMMC2		(1<<7)
+#define S5P_CLKGATE_D10_PDMA0		(1<<0)
+#define S5P_CLKGATE_D10_PDMA1		(1<<1)
+#define S5P_CLKGATE_D10_USBHOST		(1<<2)
+#define S5P_CLKGATE_D10_USBOTG		(1<<3)
+#define S5P_CLKGATE_D10_MODEMIF		(1<<4)
+#define S5P_CLKGATE_D10_HSMMC0		(1<<5)
+#define S5P_CLKGATE_D10_HSMMC1		(1<<6)
+#define S5P_CLKGATE_D10_HSMMC2		(1<<7)
 
 /* HCLKD1/PCLKD1 Clock Gate 1 Registers */
-#define S5PC100_CLKGATE_D11_LCD		(1<<0)
-#define S5PC100_CLKGATE_D11_ROTATOR		(1<<1)
-#define S5PC100_CLKGATE_D11_FIMC0		(1<<2)
-#define S5PC100_CLKGATE_D11_FIMC1		(1<<3)
-#define S5PC100_CLKGATE_D11_FIMC2		(1<<4)
-#define S5PC100_CLKGATE_D11_JPEG		(1<<5)
-#define S5PC100_CLKGATE_D11_DSI		(1<<6)
-#define S5PC100_CLKGATE_D11_CSI		(1<<7)
-#define S5PC100_CLKGATE_D11_G3D		(1<<8)
+#define S5P_CLKGATE_D11_LCD		(1<<0)
+#define S5P_CLKGATE_D11_ROTATOR		(1<<1)
+#define S5P_CLKGATE_D11_FIMC0		(1<<2)
+#define S5P_CLKGATE_D11_FIMC1		(1<<3)
+#define S5P_CLKGATE_D11_FIMC2		(1<<4)
+#define S5P_CLKGATE_D11_JPEG		(1<<5)
+#define S5P_CLKGATE_D11_DSI		(1<<6)
+#define S5P_CLKGATE_D11_CSI		(1<<7)
+#define S5P_CLKGATE_D11_G3D		(1<<8)
 
 /* HCLKD1/PCLKD1 Clock Gate 2 Registers */
-#define S5PC100_CLKGATE_D12_TV		(1<<0)
-#define S5PC100_CLKGATE_D12_VP		(1<<1)
-#define S5PC100_CLKGATE_D12_MIXER		(1<<2)
-#define S5PC100_CLKGATE_D12_HDMI		(1<<3)
-#define S5PC100_CLKGATE_D12_MFC		(1<<4)
+#define S5P_CLKGATE_D12_TV		(1<<0)
+#define S5P_CLKGATE_D12_VP		(1<<1)
+#define S5P_CLKGATE_D12_MIXER		(1<<2)
+#define S5P_CLKGATE_D12_HDMI		(1<<3)
+#define S5P_CLKGATE_D12_MFC		(1<<4)
 
 /* HCLKD1/PCLKD1 Clock Gate 3 Registers */
-#define S5PC100_CLKGATE_D13_CHIPID		(1<<0)
-#define S5PC100_CLKGATE_D13_GPIO		(1<<1)
-#define S5PC100_CLKGATE_D13_APC		(1<<2)
-#define S5PC100_CLKGATE_D13_IEC		(1<<3)
-#define S5PC100_CLKGATE_D13_PWM		(1<<6)
-#define S5PC100_CLKGATE_D13_SYSTIMER	(1<<7)
-#define S5PC100_CLKGATE_D13_WDT		(1<<8)
-#define S5PC100_CLKGATE_D13_RTC		(1<<9)
+#define S5P_CLKGATE_D13_CHIPID		(1<<0)
+#define S5P_CLKGATE_D13_GPIO		(1<<1)
+#define S5P_CLKGATE_D13_APC		(1<<2)
+#define S5P_CLKGATE_D13_IEC		(1<<3)
+#define S5P_CLKGATE_D13_PWM		(1<<6)
+#define S5P_CLKGATE_D13_SYSTIMER	(1<<7)
+#define S5P_CLKGATE_D13_WDT		(1<<8)
+#define S5P_CLKGATE_D13_RTC		(1<<9)
 
 /* HCLKD1/PCLKD1 Clock Gate 4 Registers */
-#define S5PC100_CLKGATE_D14_UART0		(1<<0)
-#define S5PC100_CLKGATE_D14_UART1		(1<<1)
-#define S5PC100_CLKGATE_D14_UART2		(1<<2)
-#define S5PC100_CLKGATE_D14_UART3		(1<<3)
-#define S5PC100_CLKGATE_D14_IIC		(1<<4)
-#define S5PC100_CLKGATE_D14_HDMI_IIC	(1<<5)
-#define S5PC100_CLKGATE_D14_SPI0		(1<<6)
-#define S5PC100_CLKGATE_D14_SPI1		(1<<7)
-#define S5PC100_CLKGATE_D14_SPI2		(1<<8)
-#define S5PC100_CLKGATE_D14_IRDA		(1<<9)
-#define S5PC100_CLKGATE_D14_CCAN0		(1<<10)
-#define S5PC100_CLKGATE_D14_CCAN1		(1<<11)
-#define S5PC100_CLKGATE_D14_HSITX		(1<<12)
-#define S5PC100_CLKGATE_D14_HSIRX		(1<<13)
+#define S5P_CLKGATE_D14_UART0		(1<<0)
+#define S5P_CLKGATE_D14_UART1		(1<<1)
+#define S5P_CLKGATE_D14_UART2		(1<<2)
+#define S5P_CLKGATE_D14_UART3		(1<<3)
+#define S5P_CLKGATE_D14_IIC		(1<<4)
+#define S5P_CLKGATE_D14_HDMI_IIC	(1<<5)
+#define S5P_CLKGATE_D14_SPI0		(1<<6)
+#define S5P_CLKGATE_D14_SPI1		(1<<7)
+#define S5P_CLKGATE_D14_SPI2		(1<<8)
+#define S5P_CLKGATE_D14_IRDA		(1<<9)
+#define S5P_CLKGATE_D14_CCAN0		(1<<10)
+#define S5P_CLKGATE_D14_CCAN1		(1<<11)
+#define S5P_CLKGATE_D14_HSITX		(1<<12)
+#define S5P_CLKGATE_D14_HSIRX		(1<<13)
 
 /* HCLKD1/PCLKD1 Clock Gate 5 Registers */
-#define S5PC100_CLKGATE_D15_IIS0		(1<<0)
-#define S5PC100_CLKGATE_D15_IIS1		(1<<1)
-#define S5PC100_CLKGATE_D15_IIS2		(1<<2)
-#define S5PC100_CLKGATE_D15_AC97		(1<<3)
-#define S5PC100_CLKGATE_D15_PCM0		(1<<4)
-#define S5PC100_CLKGATE_D15_PCM1		(1<<5)
-#define S5PC100_CLKGATE_D15_SPDIF		(1<<6)
-#define S5PC100_CLKGATE_D15_TSADC		(1<<7)
-#define S5PC100_CLKGATE_D15_KEYIF		(1<<8)
-#define S5PC100_CLKGATE_D15_CG		(1<<9)
+#define S5P_CLKGATE_D15_IIS0		(1<<0)
+#define S5P_CLKGATE_D15_IIS1		(1<<1)
+#define S5P_CLKGATE_D15_IIS2		(1<<2)
+#define S5P_CLKGATE_D15_AC97		(1<<3)
+#define S5P_CLKGATE_D15_PCM0		(1<<4)
+#define S5P_CLKGATE_D15_PCM1		(1<<5)
+#define S5P_CLKGATE_D15_SPDIF		(1<<6)
+#define S5P_CLKGATE_D15_TSADC		(1<<7)
+#define S5P_CLKGATE_D15_KEYIF		(1<<8)
+#define S5P_CLKGATE_D15_CG		(1<<9)
 
 /* HCLKD2 Clock Gate 0 Registers */
-#define S5PC100_CLKGATE_D20_HCLKD2		(1<<0)
-#define S5PC100_CLKGATE_D20_I2SD2		(1<<1)
+#define S5P_CLKGATE_D20_HCLKD2		(1<<0)
+#define S5P_CLKGATE_D20_I2SD2		(1<<1)
 
 /* Special Clock Gate 0 Registers */
-#define	S5PC100_CLKGATE_SCLK0_HPM		(1<<0)
-#define	S5PC100_CLKGATE_SCLK0_PWI		(1<<1)
-#define	S5PC100_CLKGATE_SCLK0_ONENAND	(1<<2)
-#define	S5PC100_CLKGATE_SCLK0_UART		(1<<3)
-#define	S5PC100_CLKGATE_SCLK0_SPI0		(1<<4)
-#define	S5PC100_CLKGATE_SCLK0_SPI1		(1<<5)
-#define	S5PC100_CLKGATE_SCLK0_SPI2		(1<<6)
-#define	S5PC100_CLKGATE_SCLK0_SPI0_48	(1<<7)
-#define	S5PC100_CLKGATE_SCLK0_SPI1_48	(1<<8)
-#define	S5PC100_CLKGATE_SCLK0_SPI2_48	(1<<9)
-#define	S5PC100_CLKGATE_SCLK0_IRDA		(1<<10)
-#define	S5PC100_CLKGATE_SCLK0_USBHOST	(1<<11)
-#define	S5PC100_CLKGATE_SCLK0_MMC0		(1<<12)
-#define	S5PC100_CLKGATE_SCLK0_MMC1		(1<<13)
-#define	S5PC100_CLKGATE_SCLK0_MMC2		(1<<14)
-#define	S5PC100_CLKGATE_SCLK0_MMC0_48	(1<<15)
-#define	S5PC100_CLKGATE_SCLK0_MMC1_48	(1<<16)
-#define	S5PC100_CLKGATE_SCLK0_MMC2_48	(1<<17)
+#define	S5P_CLKGATE_SCLK0_HPM		(1<<0)
+#define	S5P_CLKGATE_SCLK0_PWI		(1<<1)
+#define	S5P_CLKGATE_SCLK0_ONENAND	(1<<2)
+#define	S5P_CLKGATE_SCLK0_UART		(1<<3)
+#define	S5P_CLKGATE_SCLK0_SPI0		(1<<4)
+#define	S5P_CLKGATE_SCLK0_SPI1		(1<<5)
+#define	S5P_CLKGATE_SCLK0_SPI2		(1<<6)
+#define	S5P_CLKGATE_SCLK0_SPI0_48	(1<<7)
+#define	S5P_CLKGATE_SCLK0_SPI1_48	(1<<8)
+#define	S5P_CLKGATE_SCLK0_SPI2_48	(1<<9)
+#define	S5P_CLKGATE_SCLK0_IRDA		(1<<10)
+#define	S5P_CLKGATE_SCLK0_USBHOST	(1<<11)
+#define	S5P_CLKGATE_SCLK0_MMC0		(1<<12)
+#define	S5P_CLKGATE_SCLK0_MMC1		(1<<13)
+#define	S5P_CLKGATE_SCLK0_MMC2		(1<<14)
+#define	S5P_CLKGATE_SCLK0_MMC0_48	(1<<15)
+#define	S5P_CLKGATE_SCLK0_MMC1_48	(1<<16)
+#define	S5P_CLKGATE_SCLK0_MMC2_48	(1<<17)
 
 /* Special Clock Gate 1 Registers */
-#define	S5PC100_CLKGATE_SCLK1_LCD		(1<<0)
-#define	S5PC100_CLKGATE_SCLK1_FIMC0		(1<<1)
-#define	S5PC100_CLKGATE_SCLK1_FIMC1		(1<<2)
-#define	S5PC100_CLKGATE_SCLK1_FIMC2		(1<<3)
-#define	S5PC100_CLKGATE_SCLK1_TV54		(1<<4)
-#define	S5PC100_CLKGATE_SCLK1_VDAC54	(1<<5)
-#define	S5PC100_CLKGATE_SCLK1_MIXER		(1<<6)
-#define	S5PC100_CLKGATE_SCLK1_HDMI		(1<<7)
-#define	S5PC100_CLKGATE_SCLK1_AUDIO0	(1<<8)
-#define	S5PC100_CLKGATE_SCLK1_AUDIO1	(1<<9)
-#define	S5PC100_CLKGATE_SCLK1_AUDIO2	(1<<10)
-#define	S5PC100_CLKGATE_SCLK1_SPDIF		(1<<11)
-#define	S5PC100_CLKGATE_SCLK1_CAM		(1<<12)
-
-#define S5PC100_SWRESET		S5PC100_CLKREG_OTHER(0x000)
-#define S5PC100_OND_SWRESET	S5PC100_CLKREG_OTHER(0x008)
-#define S5PC100_GEN_CTRL	S5PC100_CLKREG_OTHER(0x100)
-#define S5PC100_GEN_STATUS	S5PC100_CLKREG_OTHER(0x104)
-#define S5PC100_MEM_SYS_CFG	S5PC100_CLKREG_OTHER(0x200)
-#define S5PC100_CAM_MUX_SEL	S5PC100_CLKREG_OTHER(0x300)
-#define S5PC100_MIXER_OUT_SEL	S5PC100_CLKREG_OTHER(0x304)
-#define S5PC100_LPMP_MODE_SEL	S5PC100_CLKREG_OTHER(0x308)
-#define S5PC100_MIPI_PHY_CON0	S5PC100_CLKREG_OTHER(0x400)
-#define S5PC100_MIPI_PHY_CON1	S5PC100_CLKREG_OTHER(0x414)
-#define S5PC100_HDMI_PHY_CON0	S5PC100_CLKREG_OTHER(0x420)
-
-#define S5PC100_SWRESET_RESETVAL	0xc100
-#define S5PC100_OTHER_SYS_INT	24
-#define S5PC100_OTHER_STA_TYPE	23
+#define	S5P_CLKGATE_SCLK1_LCD		(1<<0)
+#define	S5P_CLKGATE_SCLK1_FIMC0		(1<<1)
+#define	S5P_CLKGATE_SCLK1_FIMC1		(1<<2)
+#define	S5P_CLKGATE_SCLK1_FIMC2		(1<<3)
+#define	S5P_CLKGATE_SCLK1_TV54		(1<<4)
+#define	S5P_CLKGATE_SCLK1_VDAC54	(1<<5)
+#define	S5P_CLKGATE_SCLK1_MIXER		(1<<6)
+#define	S5P_CLKGATE_SCLK1_HDMI		(1<<7)
+#define	S5P_CLKGATE_SCLK1_AUDIO0	(1<<8)
+#define	S5P_CLKGATE_SCLK1_AUDIO1	(1<<9)
+#define	S5P_CLKGATE_SCLK1_AUDIO2	(1<<10)
+#define	S5P_CLKGATE_SCLK1_SPDIF		(1<<11)
+#define	S5P_CLKGATE_SCLK1_CAM		(1<<12)
+
+#define S5P_SWRESET		S5PC100_REG_OTHERS(0x000)
+#define S5P_OND_SWRESET		S5PC100_REG_OTHERS(0x008)
+#define S5P_GEN_CTRL		S5PC100_REG_OTHERS(0x100)
+#define S5P_GEN_STATUS		S5PC100_REG_OTHERS(0x104)
+#define S5P_MEM_SYS_CFG		S5PC100_REG_OTHERS(0x200)
+#define S5P_CAM_MUX_SEL		S5PC100_REG_OTHERS(0x300)
+#define S5P_MIXER_OUT_SEL	S5PC100_REG_OTHERS(0x304)
+#define S5P_LPMP_MODE_SEL	S5PC100_REG_OTHERS(0x308)
+#define S5P_MIPI_PHY_CON0	S5PC100_REG_OTHERS(0x400)
+#define S5P_MIPI_PHY_CON1	S5PC100_REG_OTHERS(0x414)
+#define S5P_HDMI_PHY_CON0	S5PC100_REG_OTHERS(0x420)
+
+#define S5P_SWRESET_RESETVAL	0xc100
+#define S5P_OTHER_SYS_INT	24
+#define S5P_OTHER_STA_TYPE	23
 #define STA_TYPE_EXPON		0
 #define STA_TYPE_SFR		1
 
-#define S5PC100_SLEEP_CFG_OSC_EN	0
+#define S5P_SLEEP_CFG_OSC_EN	0
 
 /* OTHERS Resgister */
-#define S5PC100_OTHERS_USB_SIG_MASK	(1 << 16)
-#define S5PC100_OTHERS_MIPI_DPHY_EN		(1 << 28)
+#define S5P_OTHERS_USB_SIG_MASK	(1 << 16)
+#define S5P_OTHERS_MIPI_DPHY_EN		(1 << 28)
 
 /* MIPI D-PHY Control Register 0 */
-#define S5PC100_MIPI_PHY_CON0_M_RESETN	(1 << 1)
-#define S5PC100_MIPI_PHY_CON0_S_RESETN	(1 << 0)
+#define S5P_MIPI_PHY_CON0_M_RESETN	(1 << 1)
+#define S5P_MIPI_PHY_CON0_S_RESETN	(1 << 0)
 
 #endif /* _PLAT_REGS_CLOCK_H */
arch/arm/plat-s5pc1xx/s5pc100-clock.c +90 -90
index 2bf6c57..c391c61 100644
@@ -75,7 +75,7 @@ static struct clksrc_clk clk_mout_apll = {
 		.id		= -1,
 	},
 	.sources	= &clk_src_apll,
-	.reg_src = { .reg = S5PC100_CLKSRC0, .shift = 0, .size = 1, },
+	.reg_src = { .reg = S5P_CLK_SRC0, .shift = 0, .size = 1, },
 };
 
 static unsigned long s5pc100_clk_dout_apll_get_rate(struct clk *clk)
@@ -83,8 +83,8 @@ static unsigned long s5pc100_clk_dout_apll_get_rate(struct clk *clk)
 	unsigned long rate = clk_get_rate(clk->parent);
 	unsigned int ratio;
 
-	ratio = __raw_readl(S5PC100_CLKDIV0) & S5PC100_CLKDIV0_APLL_MASK;
-	ratio >>= S5PC100_CLKDIV0_APLL_SHIFT;
+	ratio = __raw_readl(S5P_CLK_DIV0) & S5P_CLK_DIV0_APLL_MASK;
+	ratio >>= S5P_CLK_DIV0_APLL_SHIFT;
 
 	return rate / (ratio + 1);
 }
@@ -103,8 +103,8 @@ static unsigned long s5pc100_clk_arm_get_rate(struct clk *clk)
 	unsigned long rate = clk_get_rate(clk->parent);
 	unsigned int ratio;
 
-	ratio = __raw_readl(S5PC100_CLKDIV0) & S5PC100_CLKDIV0_ARM_MASK;
-	ratio >>= S5PC100_CLKDIV0_ARM_SHIFT;
+	ratio = __raw_readl(S5P_CLK_DIV0) & S5P_CLK_DIV0_ARM_MASK;
+	ratio >>= S5P_CLK_DIV0_ARM_SHIFT;
 
 	return rate / (ratio + 1);
 }
@@ -119,8 +119,8 @@ static unsigned long s5pc100_clk_arm_round_rate(struct clk *clk,
 		return rate;
 
 	div = (parent / rate) - 1;
-	if (div > S5PC100_CLKDIV0_ARM_MASK)
-		div = S5PC100_CLKDIV0_ARM_MASK;
+	if (div > S5P_CLK_DIV0_ARM_MASK)
+		div = S5P_CLK_DIV0_ARM_MASK;
 
 	return parent / (div + 1);
 }
@@ -131,16 +131,16 @@ static int s5pc100_clk_arm_set_rate(struct clk *clk, unsigned long rate)
 	u32 div;
 	u32 val;
 
-	if (rate < parent / (S5PC100_CLKDIV0_ARM_MASK + 1))
+	if (rate < parent / (S5P_CLK_DIV0_ARM_MASK + 1))
 		return -EINVAL;
 
 	rate = clk_round_rate(clk, rate);
 	div = clk_get_rate(clk->parent) / rate;
 
-	val = __raw_readl(S5PC100_CLKDIV0);
-	val &= S5PC100_CLKDIV0_ARM_MASK;
+	val = __raw_readl(S5P_CLK_DIV0);
+	val &= S5P_CLK_DIV0_ARM_MASK;
 	val |= (div - 1);
-	__raw_writel(val, S5PC100_CLKDIV0);
+	__raw_writel(val, S5P_CLK_DIV0);
 
 	return 0;
 }
@@ -161,8 +161,8 @@ static unsigned long s5pc100_clk_dout_d0_bus_get_rate(struct clk *clk)
 	unsigned long rate = clk_get_rate(clk->parent);
 	unsigned int ratio;
 
-	ratio = __raw_readl(S5PC100_CLKDIV0) & S5PC100_CLKDIV0_D0_MASK;
-	ratio >>= S5PC100_CLKDIV0_D0_SHIFT;
+	ratio = __raw_readl(S5P_CLK_DIV0) & S5P_CLK_DIV0_D0_MASK;
+	ratio >>= S5P_CLK_DIV0_D0_SHIFT;
 
 	return rate / (ratio + 1);
 }
@@ -181,8 +181,8 @@ static unsigned long s5pc100_clk_dout_pclkd0_get_rate(struct clk *clk)
 	unsigned long rate = clk_get_rate(clk->parent);
 	unsigned int ratio;
 
-	ratio = __raw_readl(S5PC100_CLKDIV0) & S5PC100_CLKDIV0_PCLKD0_MASK;
-	ratio >>= S5PC100_CLKDIV0_PCLKD0_SHIFT;
+	ratio = __raw_readl(S5P_CLK_DIV0) & S5P_CLK_DIV0_PCLKD0_MASK;
+	ratio >>= S5P_CLK_DIV0_PCLKD0_SHIFT;
 
 	return rate / (ratio + 1);
 }
@@ -201,8 +201,8 @@ static unsigned long s5pc100_clk_dout_apll2_get_rate(struct clk *clk)
 	unsigned long rate = clk_get_rate(clk->parent);
 	unsigned int ratio;
 
-	ratio = __raw_readl(S5PC100_CLKDIV1) & S5PC100_CLKDIV1_APLL2_MASK;
-	ratio >>= S5PC100_CLKDIV1_APLL2_SHIFT;
+	ratio = __raw_readl(S5P_CLK_DIV1) & S5P_CLK_DIV1_APLL2_MASK;
+	ratio >>= S5P_CLK_DIV1_APLL2_SHIFT;
 
 	return rate / (ratio + 1);
 }
@@ -233,7 +233,7 @@ static struct clksrc_clk clk_mout_mpll = {
 		.id		= -1,
 	},
 	.sources	= &clk_src_mpll,
-	.reg_src = { .reg = S5PC100_CLKSRC0, .shift = 4, .size = 1, },
+	.reg_src = { .reg = S5P_CLK_SRC0, .shift = 4, .size = 1, },
 };
 
 static struct clk *clkset_am_list[] = {
@@ -252,7 +252,7 @@ static struct clksrc_clk clk_mout_am = {
 		.id		= -1,
 	},
 	.sources	= &clk_src_am,
-	.reg_src = { .reg = S5PC100_CLKSRC0, .shift = 16, .size = 1, },
+	.reg_src = { .reg = S5P_CLK_SRC0, .shift = 16, .size = 1, },
 };
 
 static unsigned long s5pc100_clk_dout_d1_bus_get_rate(struct clk *clk)
@@ -262,8 +262,8 @@ static unsigned long s5pc100_clk_dout_d1_bus_get_rate(struct clk *clk)
 
 	printk(KERN_DEBUG "%s: parent is %ld\n", __func__, rate);
 
-	ratio = __raw_readl(S5PC100_CLKDIV1) & S5PC100_CLKDIV1_D1_MASK;
-	ratio >>= S5PC100_CLKDIV1_D1_SHIFT;
+	ratio = __raw_readl(S5P_CLK_DIV1) & S5P_CLK_DIV1_D1_MASK;
+	ratio >>= S5P_CLK_DIV1_D1_SHIFT;
 
 	return rate / (ratio + 1);
 }
@@ -293,7 +293,7 @@ static struct clksrc_clk clk_mout_onenand = {
 		.id		= -1,
 	},
 	.sources	= &clk_src_onenand,
-	.reg_src = { .reg = S5PC100_CLKSRC0, .shift = 24, .size = 1, },
+	.reg_src = { .reg = S5P_CLK_SRC0, .shift = 24, .size = 1, },
 };
 
 static unsigned long s5pc100_clk_dout_pclkd1_get_rate(struct clk *clk)
@@ -303,8 +303,8 @@ static unsigned long s5pc100_clk_dout_pclkd1_get_rate(struct clk *clk)
 
 	printk(KERN_DEBUG "%s: parent is %ld\n", __func__, rate);
 
-	ratio = __raw_readl(S5PC100_CLKDIV1) & S5PC100_CLKDIV1_PCLKD1_MASK;
-	ratio >>= S5PC100_CLKDIV1_PCLKD1_SHIFT;
+	ratio = __raw_readl(S5P_CLK_DIV1) & S5P_CLK_DIV1_PCLKD1_MASK;
+	ratio >>= S5P_CLK_DIV1_PCLKD1_SHIFT;
 
 	return rate / (ratio + 1);
 }
@@ -325,8 +325,8 @@ static unsigned long s5pc100_clk_dout_mpll2_get_rate(struct clk *clk)
 
 	printk(KERN_DEBUG "%s: parent is %ld\n", __func__, rate);
 
-	ratio = __raw_readl(S5PC100_CLKDIV1) & S5PC100_CLKDIV1_MPLL2_MASK;
-	ratio >>= S5PC100_CLKDIV1_MPLL2_SHIFT;
+	ratio = __raw_readl(S5P_CLK_DIV1) & S5P_CLK_DIV1_MPLL2_MASK;
+	ratio >>= S5P_CLK_DIV1_MPLL2_SHIFT;
 
 	return rate / (ratio + 1);
 }
@@ -347,8 +347,8 @@ static unsigned long s5pc100_clk_dout_cam_get_rate(struct clk *clk)
 
 	printk(KERN_DEBUG "%s: parent is %ld\n", __func__, rate);
 
-	ratio = __raw_readl(S5PC100_CLKDIV1) & S5PC100_CLKDIV1_CAM_MASK;
-	ratio >>= S5PC100_CLKDIV1_CAM_SHIFT;
+	ratio = __raw_readl(S5P_CLK_DIV1) & S5P_CLK_DIV1_CAM_MASK;
+	ratio >>= S5P_CLK_DIV1_CAM_SHIFT;
 
 	return rate / (ratio + 1);
 }
@@ -369,8 +369,8 @@ static unsigned long s5pc100_clk_dout_mpll_get_rate(struct clk *clk)
 
 	printk(KERN_DEBUG "%s: parent is %ld\n", __func__, rate);
 
-	ratio = __raw_readl(S5PC100_CLKDIV1) & S5PC100_CLKDIV1_MPLL_MASK;
-	ratio >>= S5PC100_CLKDIV1_MPLL_SHIFT;
+	ratio = __raw_readl(S5P_CLK_DIV1) & S5P_CLK_DIV1_MPLL_MASK;
+	ratio >>= S5P_CLK_DIV1_MPLL_SHIFT;
 
 	return rate / (ratio + 1);
 }
@@ -406,7 +406,7 @@ static struct clksrc_clk clk_mout_epll = {
 		.id		= -1,
 	},
 	.sources = &clk_src_epll,
-	.reg_src = { .reg = S5PC100_CLKSRC0, .shift = 8, .size = 1, },
+	.reg_src = { .reg = S5P_CLK_SRC0, .shift = 8, .size = 1, },
 };
 
 /* HPLL */
@@ -431,7 +431,7 @@ static struct clksrc_clk clk_mout_hpll = {
 		.id		= -1,
 	},
 	.sources = &clk_src_hpll,
-	.reg_src = { .reg = S5PC100_CLKSRC0, .shift = 12, .size = 1, },
+	.reg_src = { .reg = S5P_CLK_SRC0, .shift = 12, .size = 1, },
 };
 
 /* Peripherals */
@@ -539,32 +539,32 @@ static struct clksrc_clk clksrc_audio[] = {
 		.clk	= {
 			.name		= "audio-bus",
 			.id		= 0,
-			.ctrlbit	= S5PC100_CLKGATE_SCLK1_AUDIO0,
+			.ctrlbit	= S5P_CLKGATE_SCLK1_AUDIO0,
 			.enable		= s5pc100_sclk1_ctrl,
 		},
 		.sources = &clkset_audio0,
-		.reg_div = { .reg = S5PC100_CLKDIV4, .shift = 12, .size = 4, },
-		.reg_src = { .reg = S5PC100_CLKSRC3, .shift = 12, .size = 3, },
+		.reg_div = { .reg = S5P_CLK_DIV4, .shift = 12, .size = 4, },
+		.reg_src = { .reg = S5P_CLK_SRC3, .shift = 12, .size = 3, },
 	}, {
 		.clk	= {
 			.name		= "audio-bus",
 			.id		= 1,
-			.ctrlbit	= S5PC100_CLKGATE_SCLK1_AUDIO1,
+			.ctrlbit	= S5P_CLKGATE_SCLK1_AUDIO1,
 			.enable		= s5pc100_sclk1_ctrl,
 		},
 		.sources = &clkset_audio1,
-		.reg_div = { .reg = S5PC100_CLKDIV4, .shift = 16, .size = 4, },
-		.reg_src = { .reg = S5PC100_CLKSRC3, .shift = 16, .size = 3, },
+		.reg_div = { .reg = S5P_CLK_DIV4, .shift = 16, .size = 4, },
+		.reg_src = { .reg = S5P_CLK_SRC3, .shift = 16, .size = 3, },
 	}, {
 		.clk	= {
 			.name		= "audio-bus",
 			.id		= 2,
-			.ctrlbit	= S5PC100_CLKGATE_SCLK1_AUDIO2,
+			.ctrlbit	= S5P_CLKGATE_SCLK1_AUDIO2,
 			.enable		= s5pc100_sclk1_ctrl,
 		},
 		.sources = &clkset_audio2,
-		.reg_div = { .reg = S5PC100_CLKDIV4, .shift = 20, .size = 4, },
-		.reg_src = { .reg = S5PC100_CLKSRC3, .shift = 20, .size = 3, },
+		.reg_div = { .reg = S5P_CLK_DIV4, .shift = 20, .size = 4, },
+		.reg_src = { .reg = S5P_CLK_SRC3, .shift = 20, .size = 3, },
 	},
 };
 
@@ -620,130 +620,130 @@ static struct clksrc_clk clksrc_clks[] = {
 		.clk	= {
 			.name		= "spi_bus",
 			.id		= 0,
-			.ctrlbit	= S5PC100_CLKGATE_SCLK0_SPI0,
+			.ctrlbit	= S5P_CLKGATE_SCLK0_SPI0,
 			.enable		= s5pc100_sclk0_ctrl,
 
 		},
 		.sources = &clkset_spi,
-		.reg_div = { .reg = S5PC100_CLKDIV2, .shift = 4, .size = 4, },
-		.reg_src = { .reg = S5PC100_CLKSRC1, .shift = 4, .size = 2, },
+		.reg_div = { .reg = S5P_CLK_DIV2, .shift = 4, .size = 4, },
+		.reg_src = { .reg = S5P_CLK_SRC1, .shift = 4, .size = 2, },
 	}, {
 		.clk	= {
 			.name		= "spi_bus",
 			.id		= 1,
-			.ctrlbit	= S5PC100_CLKGATE_SCLK0_SPI1,
+			.ctrlbit	= S5P_CLKGATE_SCLK0_SPI1,
 			.enable		= s5pc100_sclk0_ctrl,
 		},
 		.sources = &clkset_spi,
-		.reg_div = { .reg = S5PC100_CLKDIV2, .shift = 8, .size = 4, },
-		.reg_src = { .reg = S5PC100_CLKSRC1, .shift = 8, .size = 2, },
+		.reg_div = { .reg = S5P_CLK_DIV2, .shift = 8, .size = 4, },
+		.reg_src = { .reg = S5P_CLK_SRC1, .shift = 8, .size = 2, },
 	}, {
 		.clk	= {
 			.name		= "spi_bus",
 			.id		= 2,
-			.ctrlbit	= S5PC100_CLKGATE_SCLK0_SPI2,
+			.ctrlbit	= S5P_CLKGATE_SCLK0_SPI2,
 			.enable		= s5pc100_sclk0_ctrl,
 		},
 		.sources = &clkset_spi,
-		.reg_div = { .reg = S5PC100_CLKDIV2, .shift = 12, .size = 4, },
-		.reg_src = { .reg = S5PC100_CLKSRC1, .shift = 12, .size = 2, },
+		.reg_div = { .reg = S5P_CLK_DIV2, .shift = 12, .size = 4, },
+		.reg_src = { .reg = S5P_CLK_SRC1, .shift = 12, .size = 2, },
 	}, {
 		.clk	= {
 			.name		= "uclk1",
 			.id		= -1,
-			.ctrlbit        = S5PC100_CLKGATE_SCLK0_UART,
+			.ctrlbit        = S5P_CLKGATE_SCLK0_UART,
 			.enable		= s5pc100_sclk0_ctrl,
 		},
 		.sources = &clkset_uart,
-		.reg_div = { .reg = S5PC100_CLKDIV2, .shift = 0, .size = 3, },
-		.reg_src = { .reg = S5PC100_CLKSRC1, .shift = 0, .size = 1, },
+		.reg_div = { .reg = S5P_CLK_DIV2, .shift = 0, .size = 3, },
+		.reg_src = { .reg = S5P_CLK_SRC1, .shift = 0, .size = 1, },
 	}, {
 		.clk	= {
 			.name		= "spdif",
 			.id		= -1,
 		},
 		.sources	= &clkset_spdif,
-		.reg_src = { .reg = S5PC100_CLKSRC3, .shift = 24, .size = 2, },
+		.reg_src = { .reg = S5P_CLK_SRC3, .shift = 24, .size = 2, },
 	}, {
 		.clk	= {
 			.name		= "lcd",
 			.id		= -1,
-			.ctrlbit	= S5PC100_CLKGATE_SCLK1_LCD,
+			.ctrlbit	= S5P_CLKGATE_SCLK1_LCD,
 			.enable		= s5pc100_sclk1_ctrl,
 		},
 		.sources = &clkset_lcd_fimc,
-		.reg_div = { .reg = S5PC100_CLKDIV3, .shift = 12, .size = 4, },
-		.reg_src = { .reg = S5PC100_CLKSRC2, .shift = 12, .size = 2, },
+		.reg_div = { .reg = S5P_CLK_DIV3, .shift = 12, .size = 4, },
+		.reg_src = { .reg = S5P_CLK_SRC2, .shift = 12, .size = 2, },
 	}, {
 		.clk	= {
 			.name		= "fimc",
 			.id		= 0,
-			.ctrlbit	= S5PC100_CLKGATE_SCLK1_FIMC0,
+			.ctrlbit	= S5P_CLKGATE_SCLK1_FIMC0,
 			.enable		= s5pc100_sclk1_ctrl,
 		},
 		.sources = &clkset_lcd_fimc,
-		.reg_div = { .reg = S5PC100_CLKDIV3, .shift = 16, .size = 4, },
-		.reg_src = { .reg = S5PC100_CLKSRC2, .shift = 16, .size = 2, },
+		.reg_div = { .reg = S5P_CLK_DIV3, .shift = 16, .size = 4, },
+		.reg_src = { .reg = S5P_CLK_SRC2, .shift = 16, .size = 2, },
 	}, {
 		.clk	= {
 			.name		= "fimc",
 			.id		= 1,
-			.ctrlbit	= S5PC100_CLKGATE_SCLK1_FIMC1,
+			.ctrlbit	= S5P_CLKGATE_SCLK1_FIMC1,
 			.enable		= s5pc100_sclk1_ctrl,
 		},
 		.sources	= &clkset_lcd_fimc,
-		.reg_div = { .reg = S5PC100_CLKDIV3, .shift = 20, .size = 4, },
-		.reg_src = { .reg = S5PC100_CLKSRC2, .shift = 20, .size = 2, },
+		.reg_div = { .reg = S5P_CLK_DIV3, .shift = 20, .size = 4, },
+		.reg_src = { .reg = S5P_CLK_SRC2, .shift = 20, .size = 2, },
 	}, {
 		.clk	= {
 			.name		= "fimc",
 			.id		= 2,
-			.ctrlbit	= S5PC100_CLKGATE_SCLK1_FIMC2,
+			.ctrlbit	= S5P_CLKGATE_SCLK1_FIMC2,
 			.enable		= s5pc100_sclk1_ctrl,
 		},
 		.sources = &clkset_lcd_fimc,
-		.reg_div = { .reg = S5PC100_CLKDIV3, .shift = 24, .size = 4, },
-		.reg_src = { .reg = S5PC100_CLKSRC2, .shift = 24, .size = 2, },
+		.reg_div = { .reg = S5P_CLK_DIV3, .shift = 24, .size = 4, },
+		.reg_src = { .reg = S5P_CLK_SRC2, .shift = 24, .size = 2, },
 	}, {
 		.clk	= {
 			.name		= "mmc_bus",
 			.id		= 0,
-			.ctrlbit	= S5PC100_CLKGATE_SCLK0_MMC0,
+			.ctrlbit	= S5P_CLKGATE_SCLK0_MMC0,
 			.enable		= s5pc100_sclk0_ctrl,
 		},
 		.sources = &clkset_mmc,
-		.reg_div = { .reg = S5PC100_CLKDIV3, .shift = 0, .size = 4, },
-		.reg_src = { .reg = S5PC100_CLKSRC2, .shift = 0, .size = 2, },
+		.reg_div = { .reg = S5P_CLK_DIV3, .shift = 0, .size = 4, },
+		.reg_src = { .reg = S5P_CLK_SRC2, .shift = 0, .size = 2, },
 	}, {
 		.clk	= {
 			.name		= "mmc_bus",
 			.id		= 1,
-			.ctrlbit	= S5PC100_CLKGATE_SCLK0_MMC1,
+			.ctrlbit	= S5P_CLKGATE_SCLK0_MMC1,
 			.enable		= s5pc100_sclk0_ctrl,
 		},
 		.sources = &clkset_mmc,
-		.reg_div = { .reg = S5PC100_CLKDIV3, .shift = 4, .size = 4, },
-		.reg_src = { .reg = S5PC100_CLKSRC2, .shift = 4, .size = 2, },
+		.reg_div = { .reg = S5P_CLK_DIV3, .shift = 4, .size = 4, },
+		.reg_src = { .reg = S5P_CLK_SRC2, .shift = 4, .size = 2, },
 	}, {
 		.clk	= {
 			.name		= "mmc_bus",
 			.id		= 2,
-			.ctrlbit	= S5PC100_CLKGATE_SCLK0_MMC2,
+			.ctrlbit	= S5P_CLKGATE_SCLK0_MMC2,
 			.enable		= s5pc100_sclk0_ctrl,
 		},
 		.sources	= &clkset_mmc,
-		.reg_div = { .reg = S5PC100_CLKDIV3, .shift = 8, .size = 4, },
-		.reg_src = { .reg = S5PC100_CLKSRC2, .shift = 8, .size = 2, },
+		.reg_div = { .reg = S5P_CLK_DIV3, .shift = 8, .size = 4, },
+		.reg_src = { .reg = S5P_CLK_SRC2, .shift = 8, .size = 2, },
 	}, {
 		.clk	= {
 			.name		= "usbhost",
 			.id		= -1,
-			.ctrlbit        = S5PC100_CLKGATE_SCLK0_USBHOST,
+			.ctrlbit        = S5P_CLKGATE_SCLK0_USBHOST,
 			.enable		= s5pc100_sclk0_ctrl,
 		},
 		.sources = &clkset_usbhost,
-		.reg_div = { .reg = S5PC100_CLKDIV2, .shift = 20, .size = 4, },
-		.reg_src = { .reg = S5PC100_CLKSRC1, .shift = 20, .size = 2, },
+		.reg_div = { .reg = S5P_CLK_DIV2, .shift = 20, .size = 4, },
+		.reg_src = { .reg = S5P_CLK_SRC1, .shift = 20, .size = 2, },
 	}
 };
 
@@ -775,8 +775,8 @@ void __init_or_cpufreq s5pc100_setup_clocks(void)
 
 	printk(KERN_DEBUG "%s: registering clocks\n", __func__);
 
-	clkdiv0 = __raw_readl(S5PC100_CLKDIV0);
-	clkdiv1 = __raw_readl(S5PC100_CLKDIV1);
+	clkdiv0 = __raw_readl(S5P_CLK_DIV0);
+	clkdiv1 = __raw_readl(S5P_CLK_DIV1);
 
 	printk(KERN_DEBUG "%s: clkdiv0 = %08x, clkdiv1 = %08x\n", __func__, clkdiv0, clkdiv1);
 
@@ -788,22 +788,22 @@ void __init_or_cpufreq s5pc100_setup_clocks(void)
 
 	printk(KERN_DEBUG "%s: xtal is %ld\n", __func__, xtal);
 
-	apll = s5pc1xx_get_pll(xtal, __raw_readl(S5PC100_APLL_CON));
-	mpll = s5pc1xx_get_pll(xtal, __raw_readl(S5PC100_MPLL_CON));
-	epll = s5pc1xx_get_pll(xtal, __raw_readl(S5PC100_EPLL_CON));
-	hpll = s5pc1xx_get_pll(xtal, __raw_readl(S5PC100_HPLL_CON));
+	apll = s5pc1xx_get_pll(xtal, __raw_readl(S5P_APLL_CON));
+	mpll = s5pc1xx_get_pll(xtal, __raw_readl(S5P_MPLL_CON));
+	epll = s5pc1xx_get_pll(xtal, __raw_readl(S5P_EPLL_CON));
+	hpll = s5pc1xx_get_pll(xtal, __raw_readl(S5P_HPLL_CON));
 
 	printk(KERN_INFO "S5PC100: Apll=%ld.%03ld Mhz, Mpll=%ld.%03ld Mhz"
 		", Epll=%ld.%03ld Mhz, Hpll=%ld.%03ld Mhz\n",
 		print_mhz(apll), print_mhz(mpll),
 		print_mhz(epll), print_mhz(hpll));
 
-	armclk = apll / GET_DIV(clkdiv0, S5PC100_CLKDIV0_APLL);
-	armclk = armclk / GET_DIV(clkdiv0, S5PC100_CLKDIV0_ARM);
-	hclkd0 = armclk / GET_DIV(clkdiv0, S5PC100_CLKDIV0_D0);
-	pclkd0 = hclkd0 / GET_DIV(clkdiv0, S5PC100_CLKDIV0_PCLKD0);
-	hclk = mpll / GET_DIV(clkdiv1, S5PC100_CLKDIV1_D1);
-	pclk = hclk / GET_DIV(clkdiv1, S5PC100_CLKDIV1_PCLKD1);
+	armclk = apll / GET_DIV(clkdiv0, S5P_CLK_DIV0_APLL);
+	armclk = armclk / GET_DIV(clkdiv0, S5P_CLK_DIV0_ARM);
+	hclkd0 = armclk / GET_DIV(clkdiv0, S5P_CLK_DIV0_D0);
+	pclkd0 = hclkd0 / GET_DIV(clkdiv0, S5P_CLK_DIV0_PCLKD0);
+	hclk = mpll / GET_DIV(clkdiv1, S5P_CLK_DIV1_D1);
+	pclk = hclk / GET_DIV(clkdiv1, S5P_CLK_DIV1_PCLKD1);
 
 	printk(KERN_INFO "S5PC100: ARMCLK=%ld.%03ld MHz, HCLKD0=%ld.%03ld MHz,"
 		" PCLKD0=%ld.%03ld MHz\n, HCLK=%ld.%03ld MHz,"
Signature · 7 lines
1.6.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Signature · 5 lines
-- 
Ben

Q:      What's a light-year?
A:      One-third less calories than a regular year.
#5 lore raw

PATCH 2/16 drivers: serial: S5PC100 serial driver cleanup

In reply to Marek Szyprowski

Remove unnecessary Kconfig entry. S5PC100 has exactly the same driver as S3C6400/S3C6410/S5P6440.

---
 drivers/serial/Kconfig  |   10 +---------
 drivers/serial/Makefile |    1 -
 2 files changed, 1 insertions(+), 10 deletions(-)
drivers/serial/Kconfig +1 -9
index f55c494..b68ea18 100644
@@ -534,21 +534,13 @@ config SERIAL_S3C24A0
 
 config SERIAL_S3C6400
 	tristate "Samsung S3C6400/S3C6410/S5P6440 Seria port support"
-	depends on SERIAL_SAMSUNG && (CPU_S3C6400 || CPU_S3C6410 || CPU_S5P6440)
+	depends on SERIAL_SAMSUNG && (CPU_S3C6400 || CPU_S3C6410 || CPU_S5P6440 || CPU_S5PC100)
 	select SERIAL_SAMSUNG_UARTS_4
 	default y
 	help
 	  Serial port support for the Samsung S3C6400, S3C6410 and S5P6440
 	  SoCs
 
-config SERIAL_S5PC100
-	tristate "Samsung S5PC100 Serial port support"
-	depends on SERIAL_SAMSUNG && CPU_S5PC100
-	select SERIAL_SAMSUNG_UARTS_4
-	default y
-	help
-	  Serial port support for the Samsung S5PC100 SoCs
-
 config SERIAL_S5PV210
 	tristate "Samsung S5PV210 Serial port support"
 	depends on SERIAL_SAMSUNG && (CPU_S5PV210 || CPU_S5P6442)
drivers/serial/Makefile +0 -1
index 6aa4723..328f107 100644
@@ -44,7 +44,6 @@ obj-$(CONFIG_SERIAL_S3C2412) += s3c2412.o
 obj-$(CONFIG_SERIAL_S3C2440) += s3c2440.o
 obj-$(CONFIG_SERIAL_S3C24A0) += s3c24a0.o
 obj-$(CONFIG_SERIAL_S3C6400) += s3c6400.o
-obj-$(CONFIG_SERIAL_S5PC100) += s3c6400.o
 obj-$(CONFIG_SERIAL_S5PV210) += s5pv210.o
 obj-$(CONFIG_SERIAL_MAX3100) += max3100.o
 obj-$(CONFIG_SERIAL_IP22_ZILOG) += ip22zilog.o
Signature · 1 line
1.6.4
#6 lore raw

PATCH 2/16 drivers: serial: S5PC100 serial driver cleanup

Quoted 15 lines · Marek Szyprowski

Remove unnecessary Kconfig entry. S5PC100 has exactly the same driver as S3C6400/S3C6410/S5P6440.

---
 drivers/serial/Kconfig  |   10 +---------
 drivers/serial/Makefile |    1 -
 2 files changed, 1 insertions(+), 10 deletions(-)
drivers/serial/Kconfig +0 -0
index f55c494..b68ea18 100644

drivers/serial/Kconfig config SERIAL_S3C24A0 · line 536

Quoted 3 lines
drivers/serial/Kconfig +0 -0
@@ -534,21 +534,13 @@ config SERIAL_S3C24A0
 
 config SERIAL_S3C6400
 	tristate "Samsung S3C6400/S3C6410/S5P6440 Seria port support"

it would have been nice to update the list of supported devices above.

Quoted 39 lines
drivers/serial/Kconfig +1 -9
-	depends on SERIAL_SAMSUNG && (CPU_S3C6400 || CPU_S3C6410 || CPU_S5P6440)
+	depends on SERIAL_SAMSUNG && (CPU_S3C6400 || CPU_S3C6410 || CPU_S5P6440 || CPU_S5PC100)
 	select SERIAL_SAMSUNG_UARTS_4
 	default y
 	help
 	  Serial port support for the Samsung S3C6400, S3C6410 and S5P6440
 	  SoCs
 
-config SERIAL_S5PC100
-	tristate "Samsung S5PC100 Serial port support"
-	depends on SERIAL_SAMSUNG && CPU_S5PC100
-	select SERIAL_SAMSUNG_UARTS_4
-	default y
-	help
-	  Serial port support for the Samsung S5PC100 SoCs
-
 config SERIAL_S5PV210
 	tristate "Samsung S5PV210 Serial port support"
 	depends on SERIAL_SAMSUNG && (CPU_S5PV210 || CPU_S5P6442)
drivers/serial/Makefile +0 -1
index 6aa4723..328f107 100644
@@ -44,7 +44,6 @@ obj-$(CONFIG_SERIAL_S3C2412) += s3c2412.o
 obj-$(CONFIG_SERIAL_S3C2440) += s3c2440.o
 obj-$(CONFIG_SERIAL_S3C24A0) += s3c24a0.o
 obj-$(CONFIG_SERIAL_S3C6400) += s3c6400.o
-obj-$(CONFIG_SERIAL_S5PC100) += s3c6400.o
 obj-$(CONFIG_SERIAL_S5PV210) += s5pv210.o
 obj-$(CONFIG_SERIAL_MAX3100) += max3100.o
 obj-$(CONFIG_SERIAL_IP22_ZILOG) += ip22zilog.o
Signature · 7 lines
1.6.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Signature · 5 lines
-- 
Ben

Q:      What's a light-year?
A:      One-third less calories than a regular year.
#7 lore raw

PATCH 2/16 drivers: serial: S5PC100 serial driver cleanup

Hello,

Quoted 17 lines · Ben Dooks
Quoted 16 lines · Marek Szyprowski

Remove unnecessary Kconfig entry. S5PC100 has exactly the same driver as S3C6400/S3C6410/S5P6440.

---
 drivers/serial/Kconfig  |   10 +---------
 drivers/serial/Makefile |    1 -
 2 files changed, 1 insertions(+), 10 deletions(-)
drivers/serial/Kconfig +0 -0
index f55c494..b68ea18 100644
@@ -534,21 +534,13 @@ config SERIAL_S3C24A0
 
Quoted 4 lines

drivers/serial/Kconfig config SERIAL_S3C24A0 · line 536

Quoted 2 lines
drivers/serial/Kconfig +0 -0
 config SERIAL_S3C6400
 	tristate "Samsung S3C6400/S3C6410/S5P6440 Seria port support"

it would have been nice to update the list of supported devices above.

Ok. I will fix this in the next iteration of the patches.

Best regards
--
Marek Szyprowski
Samsung Poland R&D Center

#8 lore raw

PATCH 3/16 ARM: Samsung: plat-s5p - enable access to clk_27m clock

In reply to Marek Szyprowski

Clock clk_27m can be a source for other clocks in S5PC100 clocks. This patch removes static attribute of it.

---
 arch/arm/plat-s5p/clock.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
arch/arm/plat-s5p/clock.c +2 -2
index aa96e33..519cdb4 100644
@@ -33,7 +33,7 @@ struct clk clk_ext_xtal_mux = {
 	.id		= -1,
 };
 
-static struct clk s5p_clk_27m = {
+struct clk clk_27m = {
 	.name		= "clk_27m",
 	.id		= -1,
 	.rate		= 27000000,
@@ -129,7 +129,7 @@ int s5p_gatectrl(void __iomem *reg, struct clk *clk, int enable)
 static struct clk *s5p_clks[] __initdata = {
 	&clk_ext_xtal_mux,
 	&clk_48m,
-	&s5p_clk_27m,
+	&clk_27m,
 	&clk_fout_apll,
 	&clk_fout_mpll,
 	&clk_fout_epll,
Signature · 1 line
1.6.4
#9 lore raw

PATCH 3/16 ARM: Samsung: plat-s5p - enable access to clk_27m clock

arch/arm/plat-s5p/clock.c int s5p_gatectrl(void __iomem *reg, struct clk *clk,

Quoted 24 lines · Marek Szyprowski

Clock clk_27m can be a source for other clocks in S5PC100 clocks. This patch removes static attribute of it.

---
 arch/arm/plat-s5p/clock.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
arch/arm/plat-s5p/clock.c +1 -1
index aa96e33..519cdb4 100644
@@ -33,7 +33,7 @@ struct clk clk_ext_xtal_mux = {
 	.id		= -1,
 };
 
-static struct clk s5p_clk_27m = {
+struct clk clk_27m = {
 	.name		= "clk_27m",
 	.id		= -1,
 	.rate		= 27000000,
@@ -129,7 +129,7 @@ int s5p_gatectrl(void __iomem *reg, struct clk *clk,

int

Quoted 10 lines
arch/arm/plat-s5p/clock.c +1 -1
 enable)
 static struct clk *s5p_clks[] __initdata = {
 	&clk_ext_xtal_mux,
 	&clk_48m,
-	&s5p_clk_27m,
+	&clk_27m,
 	&clk_fout_apll,
 	&clk_fout_mpll,

&clk_fout_epll,
--

Since clk_27m is now not static, it would be good to rename it as s5p_clk_27m.
Do you have any reason for renaming?

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.

#10 lore raw

PATCH 3/16 ARM: Samsung: plat-s5p - enable access to clk_27m clock

Hello,

Quoted 26 lines · Kukjin Kim

arch/arm/plat-s5p/clock.c int s5p_gatectrl(void __iomem *reg, struct clk *clk,

Quoted 24 lines · Marek Szyprowski

Clock clk_27m can be a source for other clocks in S5PC100 clocks. This patch removes static attribute of it.

---
 arch/arm/plat-s5p/clock.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
arch/arm/plat-s5p/clock.c +1 -1
index aa96e33..519cdb4 100644
@@ -33,7 +33,7 @@ struct clk clk_ext_xtal_mux = {
 	.id		= -1,
 };
 
-static struct clk s5p_clk_27m = {
+struct clk clk_27m = {
 	.name		= "clk_27m",
 	.id		= -1,
 	.rate		= 27000000,
@@ -129,7 +129,7 @@ int s5p_gatectrl(void __iomem *reg, struct clk *clk,

int

Quoted 14 lines
Quoted 10 lines
arch/arm/plat-s5p/clock.c +1 -1
 enable)
 static struct clk *s5p_clks[] __initdata = {
 	&clk_ext_xtal_mux,
 	&clk_48m,
-	&s5p_clk_27m,
+	&clk_27m,
 	&clk_fout_apll,
 	&clk_fout_mpll,

&clk_fout_epll,
--

Since clk_27m is now not static, it would be good to rename it as s5p_clk_27m.
Do you have any reason for renaming?

Yes, I wanted to make it compatible with mach-s3c64xx. A clock of the same name is defined in mach-s3c64xx/clock.c.

Best regards
--
Marek Szyprowski
Samsung Poland R&D Center

#11 lore raw

PATCH 4/16 ARM: S5PC100: copy clocks from plat-s5pc1xx

In reply to Marek Szyprowski

Prepare for moving support for S5PC100 SoC to plat-s5p framework (part 2). Copy clocks definition to mach-s5pc100 directory.

---
 .../s5pc100-clock.c => mach-s5pc100/clock.c}       |    0
 1 files changed, 0 insertions(+), 0 deletions(-)
 copy arch/arm/{plat-s5pc1xx/s5pc100-clock.c => mach-s5pc100/clock.c} (100%)
arch/arm/mach-s5pc100/clock.c renamed from arch/arm/plat-s5pc1xx/s5pc100-clock.c +0 -0
similarity index 100%
copy from arch/arm/plat-s5pc1xx/s5pc100-clock.c
copy to arch/arm/mach-s5pc100/clock.c
Signature · 1 line
1.6.4
#12 lore raw

PATCH 4/16 ARM: S5PC100: copy clocks from plat-s5pc1xx

Quoted 2 lines · Marek Szyprowski

Prepare for moving support for S5PC100 SoC to plat-s5p framework (part 2).

Copy

Quoted 8 lines

clocks definition to mach-s5pc100 directory.

---
 .../s5pc100-clock.c => mach-s5pc100/clock.c}       |    0
 1 files changed, 0 insertions(+), 0 deletions(-)
 copy arch/arm/{plat-s5pc1xx/s5pc100-clock.c => mach-s5pc100/clock.c}

(100%)

Review

Quoted 2 lines
(quoted diff) +0 -0

b/arch/arm/mach-s5pc100/clock.c

Quoted 4 lines

similarity index 100%
copy from arch/arm/plat-s5pc1xx/s5pc100-clock.c
copy to arch/arm/mach-s5pc100/clock.c
--

How about change the comment in the head of moving file.

And where is the patch for arch/arm/plat-s5pc1xx/clock.c? I couldn't find it except 01_patch which just changes naming.

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.

#13 lore raw

PATCH 4/16 ARM: S5PC100: copy clocks from plat-s5pc1xx

Hello,

Quoted 21 lines · Kukjin Kim
Quoted 2 lines · Marek Szyprowski

Prepare for moving support for S5PC100 SoC to plat-s5p framework (part 2).

Copy

Quoted 8 lines

clocks definition to mach-s5pc100 directory.

---
 .../s5pc100-clock.c => mach-s5pc100/clock.c}       |    0
 1 files changed, 0 insertions(+), 0 deletions(-)
 copy arch/arm/{plat-s5pc1xx/s5pc100-clock.c => mach-s5pc100/clock.c}

(100%)

Review

Quoted 2 lines
(quoted diff) +0 -0

b/arch/arm/mach-s5pc100/clock.c

Quoted 4 lines

similarity index 100%
copy from arch/arm/plat-s5pc1xx/s5pc100-clock.c
copy to arch/arm/mach-s5pc100/clock.c
--

Quoted 4 lines

How about change the comment in the head of moving file.

And where is the patch for arch/arm/plat-s5pc1xx/clock.c? I couldn't find it except 01_patch which just changes naming.

arch/arm/plat-s5pc1xx/clock.c file is removed in the last patch of this series ("ARM: remove obsolete plat-s5pc1xx directory"). Again I split this into separate patches to generate diffs that are easier to follow. This also made it possible not to break compilation of the kernel between the patches.

The real changes to that code is performed in the "ARM: S5PC100: new clocks definition" patch.

Best regards
--
Marek Szyprowski
Samsung Poland R&D Center

#14 lore raw

PATCH 5/16 ARM: S5PC100: new clocks definition

In reply to Marek Szyprowski

Prepare for moving support for S5PC100 SoC to plat-s5p framework (part 3). This patch adds all clocks from plat-s5pc1xx/clocks.c and removes all the code that can be reused from plat-s5p/clock.c.

---
 arch/arm/mach-s5pc100/clock.c                      |  841 ++++++++++++++++----
 .../include/mach}/regs-clock.h                     |    0
 2 files changed, 703 insertions(+), 138 deletions(-)
 copy arch/arm/{plat-s5pc1xx/include/plat => mach-s5pc100/include/mach}/regs-clock.h (100%)
arch/arm/mach-s5pc100/clock.c +703 -138
index c391c61..75fa9be 100644
@@ -16,59 +16,22 @@
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/list.h>
-#include <linux/errno.h>
 #include <linux/err.h>
 #include <linux/clk.h>
-#include <linux/sysdev.h>
 #include <linux/io.h>
 
-#include <mach/hardware.h>
 #include <mach/map.h>
 
 #include <plat/cpu-freq.h>
-
-#include <plat/regs-clock.h>
+#include <mach/regs-clock.h>
 #include <plat/clock.h>
-#include <plat/clock-clksrc.h>
 #include <plat/cpu.h>
 #include <plat/pll.h>
-#include <plat/devs.h>
+#include <plat/s5p-clock.h>
+#include <plat/clock-clksrc.h>
 #include <plat/s5pc100.h>
 
-/* fin_apll, fin_mpll and fin_epll are all the same clock, which we call
- * ext_xtal_mux for want of an actual name from the manual.
-*/
-
-static struct clk clk_ext_xtal_mux = {
-	.name		= "ext_xtal",
-	.id		= -1,
-};
-
-#define clk_fin_apll clk_ext_xtal_mux
-#define clk_fin_mpll clk_ext_xtal_mux
-#define clk_fin_epll clk_ext_xtal_mux
-#define clk_fin_hpll clk_ext_xtal_mux
-
-#define clk_fout_mpll	clk_mpll
-#define clk_vclk_54m	clk_54m
-
-/* APLL */
-static struct clk clk_fout_apll = {
-	.name		= "fout_apll",
-	.id		= -1,
-	.rate		= 27000000,
-};
-
-static struct clk *clk_src_apll_list[] = {
-	[0] = &clk_fin_apll,
-	[1] = &clk_fout_apll,
-};
-
-static struct clksrc_sources clk_src_apll = {
-	.sources	= clk_src_apll_list,
-	.nr_sources	= ARRAY_SIZE(clk_src_apll_list),
-};
-
+/* APLL Mux output clock */
 static struct clksrc_clk clk_mout_apll = {
 	.clk	= {
 		.name		= "mout_apll",
@@ -98,63 +61,6 @@ static struct clk clk_dout_apll = {
 	},
 };
 
-static unsigned long s5pc100_clk_arm_get_rate(struct clk *clk)
-{
-	unsigned long rate = clk_get_rate(clk->parent);
-	unsigned int ratio;
-
-	ratio = __raw_readl(S5P_CLK_DIV0) & S5P_CLK_DIV0_ARM_MASK;
-	ratio >>= S5P_CLK_DIV0_ARM_SHIFT;
-
-	return rate / (ratio + 1);
-}
-
-static unsigned long s5pc100_clk_arm_round_rate(struct clk *clk,
-						unsigned long rate)
-{
-	unsigned long parent = clk_get_rate(clk->parent);
-	u32 div;
-
-	if (parent < rate)
-		return rate;
-
-	div = (parent / rate) - 1;
-	if (div > S5P_CLK_DIV0_ARM_MASK)
-		div = S5P_CLK_DIV0_ARM_MASK;
-
-	return parent / (div + 1);
-}
-
-static int s5pc100_clk_arm_set_rate(struct clk *clk, unsigned long rate)
-{
-	unsigned long parent = clk_get_rate(clk->parent);
-	u32 div;
-	u32 val;
-
-	if (rate < parent / (S5P_CLK_DIV0_ARM_MASK + 1))
-		return -EINVAL;
-
-	rate = clk_round_rate(clk, rate);
-	div = clk_get_rate(clk->parent) / rate;
-
-	val = __raw_readl(S5P_CLK_DIV0);
-	val &= S5P_CLK_DIV0_ARM_MASK;
-	val |= (div - 1);
-	__raw_writel(val, S5P_CLK_DIV0);
-
-	return 0;
-}
-
-static struct clk clk_arm = {
-	.name		= "armclk",
-	.id		= -1,
-	.parent		= &clk_dout_apll,
-	.ops		= &(struct clk_ops) {
-		.get_rate	= s5pc100_clk_arm_get_rate,
-		.set_rate	= s5pc100_clk_arm_set_rate,
-		.round_rate	= s5pc100_clk_arm_round_rate,
-	},
-};
 
 static unsigned long s5pc100_clk_dout_d0_bus_get_rate(struct clk *clk)
 {
@@ -217,16 +123,6 @@ static struct clk clk_dout_apll2 = {
 };
 
 /* MPLL */
-static struct clk *clk_src_mpll_list[] = {
-	[0] = &clk_fin_mpll,
-	[1] = &clk_fout_mpll,
-};
-
-static struct clksrc_sources clk_src_mpll = {
-	.sources	= clk_src_mpll_list,
-	.nr_sources	= ARRAY_SIZE(clk_src_mpll_list),
-};
-
 static struct clksrc_clk clk_mout_mpll = {
 	.clk = {
 		.name		= "mout_mpll",
@@ -385,21 +281,6 @@ static struct clk clk_dout_mpll = {
 };
 
 /* EPLL */
-static struct clk clk_fout_epll = {
-	.name		= "fout_epll",
-	.id		= -1,
-};
-
-static struct clk *clk_src_epll_list[] = {
-	[0] = &clk_fin_epll,
-	[1] = &clk_fout_epll,
-};
-
-static struct clksrc_sources clk_src_epll = {
-	.sources	= clk_src_epll_list,
-	.nr_sources	= ARRAY_SIZE(clk_src_epll_list),
-};
-
 static struct clksrc_clk clk_mout_epll = {
 	.clk	= {
 		.name		= "mout_epll",
@@ -471,6 +352,164 @@ static struct clk clk_pcm_cd1 = {
 	.id		= -1,
 };
 
+static struct clk clk_hd0 = {
+	.name		= "hclkd0",
+	.id		= -1,
+	.rate		= 0,
+	.parent		= NULL,
+	.ctrlbit	= 0,
+	.ops		= &clk_ops_def_setrate,
+};
+
+static struct clk clk_pd0 = {
+	.name		= "pclkd0",
+	.id		= -1,
+	.rate		= 0,
+	.parent		= NULL,
+	.ctrlbit	= 0,
+	.ops		= &clk_ops_def_setrate,
+};
+
+static struct clk clk_54m = {
+	.name		= "clk_54m",
+	.id		= -1,
+	.rate		= 54000000,
+};
+
+
+static int s5pc100_clk_48m_ctrl(struct clk *clk, int enable)
+{
+	unsigned long flags;
+	u32 val;
+
+	/* can't rely on clock lock, this register has other usages */
+	local_irq_save(flags);
+
+	val = __raw_readl(S5P_CLK_SRC1);
+	if (enable)
+		val |= S5P_CLK_SRC1_CLK48M_MASK;
+	else
+		val &= ~S5P_CLK_SRC1_CLK48M_MASK;
+
+	__raw_writel(val, S5P_CLK_SRC1);
+	local_irq_restore(flags);
+
+	return 0;
+}
+
+static unsigned long s5pc100_clk_arm_get_rate(struct clk *clk)
+{
+	unsigned long rate = clk_get_rate(clk->parent);
+	unsigned int ratio;
+
+	ratio = __raw_readl(S5P_CLK_DIV0) & S5P_CLK_DIV0_ARM_MASK;
+	ratio >>= S5P_CLK_DIV0_ARM_SHIFT;
+
+	return rate / (ratio + 1);
+}
+
+static unsigned long s5pc100_clk_arm_round_rate(struct clk *clk,
+						unsigned long rate)
+{
+	unsigned long parent = clk_get_rate(clk->parent);
+	u32 div;
+
+	if (parent < rate)
+		return rate;
+
+	div = (parent / rate) - 1;
+	if (div > S5P_CLK_DIV0_ARM_MASK)
+		div = S5P_CLK_DIV0_ARM_MASK;
+
+	return parent / (div + 1);
+}
+
+static int s5pc100_clk_arm_set_rate(struct clk *clk, unsigned long rate)
+{
+	unsigned long parent = clk_get_rate(clk->parent);
+	u32 div;
+	u32 val;
+
+	if (rate < parent / (S5P_CLK_DIV0_ARM_MASK + 1))
+		return -EINVAL;
+
+	rate = clk_round_rate(clk, rate);
+	div = clk_get_rate(clk->parent) / rate;
+
+	val = __raw_readl(S5P_CLK_DIV0);
+	val &= S5P_CLK_DIV0_ARM_MASK;
+	val |= (div - 1);
+	__raw_writel(val, S5P_CLK_DIV0);
+
+	return 0;
+}
+
+static struct clk_ops s5pc100_armclk_ops = {
+	.get_rate	= s5pc100_clk_arm_get_rate,
+	.set_rate	= s5pc100_clk_arm_set_rate,
+	.round_rate	= s5pc100_clk_arm_round_rate,
+};
+
+static int s5pc100_clk_d00_ctrl(struct clk *clk, int enable)
+{
+	return s5p_gatectrl(S5P_CLKGATE_D00, clk, enable);
+}
+
+static int s5pc100_clk_d01_ctrl(struct clk *clk, int enable)
+{
+	return s5p_gatectrl(S5P_CLKGATE_D01, clk, enable);
+}
+
+static int s5pc100_clk_d02_ctrl(struct clk *clk, int enable)
+{
+	return s5p_gatectrl(S5P_CLKGATE_D02, clk, enable);
+}
+
+static int s5pc100_clk_d10_ctrl(struct clk *clk, int enable)
+{
+	return s5p_gatectrl(S5P_CLKGATE_D10, clk, enable);
+}
+
+static int s5pc100_clk_d11_ctrl(struct clk *clk, int enable)
+{
+	return s5p_gatectrl(S5P_CLKGATE_D11, clk, enable);
+}
+
+static int s5pc100_clk_d12_ctrl(struct clk *clk, int enable)
+{
+	return s5p_gatectrl(S5P_CLKGATE_D12, clk, enable);
+}
+
+static int s5pc100_clk_d13_ctrl(struct clk *clk, int enable)
+{
+	return s5p_gatectrl(S5P_CLKGATE_D13, clk, enable);
+}
+
+static int s5pc100_clk_d14_ctrl(struct clk *clk, int enable)
+{
+	return s5p_gatectrl(S5P_CLKGATE_D14, clk, enable);
+}
+
+static int s5pc100_clk_d15_ctrl(struct clk *clk, int enable)
+{
+	return s5p_gatectrl(S5P_CLKGATE_D15, clk, enable);
+}
+
+static int s5pc100_clk_d20_ctrl(struct clk *clk, int enable)
+{
+	return s5p_gatectrl(S5P_CLKGATE_D20, clk, enable);
+}
+
+static int s5pc100_sclk0_ctrl(struct clk *clk, int enable)
+{
+	return s5p_gatectrl(S5P_SCLKGATE0, clk, enable);
+}
+
+static int s5pc100_sclk1_ctrl(struct clk *clk, int enable)
+{
+	return s5p_gatectrl(S5P_SCLKGATE1, clk, enable);
+}
+
 static struct clk *clkset_audio0_list[] = {
 	&clk_mout_epll.clk,
 	&clk_dout_mpll,
@@ -583,7 +622,7 @@ static struct clk *clkset_lcd_fimc_list[] = {
 	&clk_mout_epll.clk,
 	&clk_dout_mpll,
 	&clk_mout_hpll.clk,
-	&clk_vclk_54m,
+	&clk_54m,
 };
 
 static struct clksrc_sources clkset_lcd_fimc = {
@@ -773,6 +812,11 @@ void __init_or_cpufreq s5pc100_setup_clocks(void)
 	unsigned int ptr;
 	u32 clkdiv0, clkdiv1;
 
+	/* Hook callbacks to base clocks */
+	clk_48m.enable = s5pc100_clk_48m_ctrl;
+	clk_arm.ops = &s5pc100_armclk_ops;
+	clk_arm.parent = &clk_dout_apll,
+
 	printk(KERN_DEBUG "%s: registering clocks\n", __func__);
 
 	clkdiv0 = __raw_readl(S5P_CLK_DIV0);
@@ -788,10 +832,10 @@ void __init_or_cpufreq s5pc100_setup_clocks(void)
 
 	printk(KERN_DEBUG "%s: xtal is %ld\n", __func__, xtal);
 
-	apll = s5pc1xx_get_pll(xtal, __raw_readl(S5P_APLL_CON));
-	mpll = s5pc1xx_get_pll(xtal, __raw_readl(S5P_MPLL_CON));
-	epll = s5pc1xx_get_pll(xtal, __raw_readl(S5P_EPLL_CON));
-	hpll = s5pc1xx_get_pll(xtal, __raw_readl(S5P_HPLL_CON));
+	apll = s5p_get_pll45xx(xtal, __raw_readl(S5P_APLL_CON), pll_4502);
+	mpll = s5p_get_pll45xx(xtal, __raw_readl(S5P_MPLL_CON), pll_4502);
+	epll = s5p_get_pll45xx(xtal, __raw_readl(S5P_EPLL_CON), pll_4502);
+	hpll = s5p_get_pll45xx(xtal, __raw_readl(S5P_HPLL_CON), pll_4502);
 
 	printk(KERN_INFO "S5PC100: Apll=%ld.%03ld Mhz, Mpll=%ld.%03ld Mhz"
 		", Epll=%ld.%03ld Mhz, Hpll=%ld.%03ld Mhz\n",
@@ -805,11 +849,10 @@ void __init_or_cpufreq s5pc100_setup_clocks(void)
 	hclk = mpll / GET_DIV(clkdiv1, S5P_CLK_DIV1_D1);
 	pclk = hclk / GET_DIV(clkdiv1, S5P_CLK_DIV1_PCLKD1);
 
-	printk(KERN_INFO "S5PC100: ARMCLK=%ld.%03ld MHz, HCLKD0=%ld.%03ld MHz,"
-		" PCLKD0=%ld.%03ld MHz\n, HCLK=%ld.%03ld MHz,"
-		" PCLK=%ld.%03ld MHz\n",
-		print_mhz(armclk), print_mhz(hclkd0),
-		print_mhz(pclkd0), print_mhz(hclk), print_mhz(pclk));
+	printk(KERN_INFO "S5PC100: ARMCLK=%ld.%03ld MHz, HCLKD0=%ld.%03ld MHz, "
+	       "PCLKD0=%ld.%03ld MHz, HCLK=%ld.%03ld MHz, PCLK=%ld.%03ld MHz\n",
+	       print_mhz(armclk), print_mhz(hclkd0),
+	       print_mhz(pclkd0), print_mhz(hclk), print_mhz(pclk));
 
 	clk_fout_apll.rate = apll;
 	clk_fout_mpll.rate = mpll;
@@ -830,8 +873,520 @@ void __init_or_cpufreq s5pc100_setup_clocks(void)
 		s3c_set_clksrc(clksrc_clks + ptr, true);
 }
 
+static struct clk init_clocks_disable[] = {
+	{
+		.name		= "dsi",
+		.id		= -1,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d11_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D11_DSI,
+	}, {
+		.name		= "csi",
+		.id		= -1,
+		.parent		= &clk_h,
+		.enable		= s5pc100_clk_d11_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D11_CSI,
+	}, {
+		.name		= "ccan",
+		.id		= 0,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d14_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D14_CCAN0,
+	}, {
+		.name		= "ccan",
+		.id		= 1,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d14_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D14_CCAN1,
+	}, {
+		.name		= "keypad",
+		.id		= -1,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d15_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D15_KEYIF,
+	}, {
+		.name		= "hclkd2",
+		.id		= -1,
+		.parent		= NULL,
+		.enable		= s5pc100_clk_d20_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D20_HCLKD2,
+	}, {
+		.name		= "iis-d2",
+		.id		= -1,
+		.parent		= NULL,
+		.enable		= s5pc100_clk_d20_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D20_I2SD2,
+	},
+};
+
+static struct clk init_clocks[] = {
+	/* System1 (D0_0) devices */
+	{
+		.name		= "intc",
+		.id		= -1,
+		.parent		= &clk_hd0,
+		.enable		= s5pc100_clk_d00_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D00_INTC,
+	}, {
+		.name		= "tzic",
+		.id		= -1,
+		.parent		= &clk_hd0,
+		.enable		= s5pc100_clk_d00_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D00_TZIC,
+	}, {
+		.name		= "cf-ata",
+		.id		= -1,
+		.parent		= &clk_hd0,
+		.enable		= s5pc100_clk_d00_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D00_CFCON,
+	}, {
+		.name		= "mdma",
+		.id		= -1,
+		.parent		= &clk_hd0,
+		.enable		= s5pc100_clk_d00_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D00_MDMA,
+	}, {
+		.name		= "g2d",
+		.id		= -1,
+		.parent		= &clk_hd0,
+		.enable		= s5pc100_clk_d00_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D00_G2D,
+	}, {
+		.name		= "secss",
+		.id		= -1,
+		.parent		= &clk_hd0,
+		.enable		= s5pc100_clk_d00_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D00_SECSS,
+	}, {
+		.name		= "cssys",
+		.id		= -1,
+		.parent		= &clk_hd0,
+		.enable		= s5pc100_clk_d00_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D00_CSSYS,
+	},
+
+	/* Memory (D0_1) devices */
+	{
+		.name		= "dmc",
+		.id		= -1,
+		.parent		= &clk_hd0,
+		.enable		= s5pc100_clk_d01_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D01_DMC,
+	}, {
+		.name		= "sromc",
+		.id		= -1,
+		.parent		= &clk_hd0,
+		.enable		= s5pc100_clk_d01_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D01_SROMC,
+	}, {
+		.name		= "onenand",
+		.id		= -1,
+		.parent		= &clk_hd0,
+		.enable		= s5pc100_clk_d01_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D01_ONENAND,
+	}, {
+		.name		= "nand",
+		.id		= -1,
+		.parent		= &clk_hd0,
+		.enable		= s5pc100_clk_d01_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D01_NFCON,
+	}, {
+		.name		= "intmem",
+		.id		= -1,
+		.parent		= &clk_hd0,
+		.enable		= s5pc100_clk_d01_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D01_INTMEM,
+	}, {
+		.name		= "ebi",
+		.id		= -1,
+		.parent		= &clk_hd0,
+		.enable		= s5pc100_clk_d01_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D01_EBI,
+	},
+
+	/* System2 (D0_2) devices */
+	{
+		.name		= "seckey",
+		.id		= -1,
+		.parent		= &clk_pd0,
+		.enable		= s5pc100_clk_d02_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D02_SECKEY,
+	}, {
+		.name		= "sdm",
+		.id		= -1,
+		.parent		= &clk_hd0,
+		.enable		= s5pc100_clk_d02_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D02_SDM,
+	},
+
+	/* File (D1_0) devices */
+	{
+		.name		= "pdma",
+		.id		= 0,
+		.parent		= &clk_h,
+		.enable		= s5pc100_clk_d10_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D10_PDMA0,
+	}, {
+		.name		= "pdma",
+		.id		= 1,
+		.parent		= &clk_h,
+		.enable		= s5pc100_clk_d10_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D10_PDMA1,
+	}, {
+		.name		= "usb-host",
+		.id		= -1,
+		.parent		= &clk_h,
+		.enable		= s5pc100_clk_d10_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D10_USBHOST,
+	}, {
+		.name		= "otg",
+		.id		= -1,
+		.parent		= &clk_h,
+		.enable		= s5pc100_clk_d10_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D10_USBOTG,
+	}, {
+		.name		= "modem",
+		.id		= -1,
+		.parent		= &clk_h,
+		.enable		= s5pc100_clk_d10_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D10_MODEMIF,
+	}, {
+		.name		= "hsmmc",
+		.id		= 0,
+		.parent		= &clk_48m,
+		.enable		= s5pc100_clk_d10_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D10_HSMMC0,
+	}, {
+		.name		= "hsmmc",
+		.id		= 1,
+		.parent		= &clk_48m,
+		.enable		= s5pc100_clk_d10_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D10_HSMMC1,
+	}, {
+		.name		= "hsmmc",
+		.id		= 2,
+		.parent		= &clk_48m,
+		.enable		= s5pc100_clk_d10_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D10_HSMMC2,
+	},
+
+	/* Multimedia1 (D1_1) devices */
+	{
+		.name		= "lcdcon",
+		.id		= -1,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d11_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D11_LCD,
+	}, {
+		.name		= "rotator",
+		.id		= -1,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d11_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D11_ROTATOR,
+	}, {
+		.name		= "fimc",
+		.id		= -1,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d11_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D11_FIMC0,
+	}, {
+		.name		= "fimc",
+		.id		= -1,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d11_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D11_FIMC1,
+	}, {
+		.name		= "fimc",
+		.id		= -1,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d11_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D11_FIMC2,
+	}, {
+		.name		= "jpeg",
+		.id		= -1,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d11_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D11_JPEG,
+	}, {
+		.name		= "g3d",
+		.id		= -1,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d11_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D11_G3D,
+	},
+
+	/* Multimedia2 (D1_2) devices */
+	{
+		.name		= "tv",
+		.id		= -1,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d12_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D12_TV,
+	}, {
+		.name		= "vp",
+		.id		= -1,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d12_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D12_VP,
+	}, {
+		.name		= "mixer",
+		.id		= -1,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d12_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D12_MIXER,
+	}, {
+		.name		= "hdmi",
+		.id		= -1,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d12_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D12_HDMI,
+	}, {
+		.name		= "mfc",
+		.id		= -1,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d12_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D12_MFC,
+	},
+
+	/* System (D1_3) devices */
+	{
+		.name		= "chipid",
+		.id		= -1,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d13_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D13_CHIPID,
+	}, {
+		.name		= "gpio",
+		.id		= -1,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d13_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D13_GPIO,
+	}, {
+		.name		= "apc",
+		.id		= -1,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d13_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D13_APC,
+	}, {
+		.name		= "iec",
+		.id		= -1,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d13_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D13_IEC,
+	}, {
+		.name		= "timers",
+		.id		= -1,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d13_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D13_PWM,
+	}, {
+		.name		= "systimer",
+		.id		= -1,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d13_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D13_SYSTIMER,
+	}, {
+		.name		= "watchdog",
+		.id		= -1,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d13_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D13_WDT,
+	}, {
+		.name		= "rtc",
+		.id		= -1,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d13_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D13_RTC,
+	},
+
+	/* Connectivity (D1_4) devices */
+	{
+		.name		= "uart",
+		.id		= 0,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d14_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D14_UART0,
+	}, {
+		.name		= "uart",
+		.id		= 1,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d14_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D14_UART1,
+	}, {
+		.name		= "uart",
+		.id		= 2,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d14_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D14_UART2,
+	}, {
+		.name		= "uart",
+		.id		= 3,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d14_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D14_UART3,
+	}, {
+		.name		= "i2c",
+		.id		= -1,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d14_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D14_IIC,
+	}, {
+		.name		= "hdmi-i2c",
+		.id		= -1,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d14_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D14_HDMI_IIC,
+	}, {
+		.name		= "spi",
+		.id		= 0,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d14_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D14_SPI0,
+	}, {
+		.name		= "spi",
+		.id		= 1,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d14_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D14_SPI1,
+	}, {
+		.name		= "spi",
+		.id		= 2,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d14_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D14_SPI2,
+	}, {
+		.name		= "irda",
+		.id		= -1,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d14_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D14_IRDA,
+	}, {
+		.name		= "hsitx",
+		.id		= -1,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d14_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D14_HSITX,
+	}, {
+		.name		= "hsirx",
+		.id		= -1,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d14_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D14_HSIRX,
+	},
+
+	/* Audio (D1_5) devices */
+	{
+		.name		= "iis",
+		.id		= 0,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d15_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D15_IIS0,
+	}, {
+		.name		= "iis",
+		.id		= 1,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d15_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D15_IIS1,
+	}, {
+		.name		= "iis",
+		.id		= 2,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d15_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D15_IIS2,
+	}, {
+		.name		= "ac97",
+		.id		= -1,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d15_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D15_AC97,
+	}, {
+		.name		= "pcm",
+		.id		= 0,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d15_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D15_PCM0,
+	}, {
+		.name		= "pcm",
+		.id		= 1,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d15_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D15_PCM1,
+	}, {
+		.name		= "spdif",
+		.id		= -1,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d15_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D15_SPDIF,
+	}, {
+		.name		= "adc",
+		.id		= -1,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d15_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D15_TSADC,
+	}, {
+		.name		= "cg",
+		.id		= -1,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d15_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D15_CG,
+	},
+
+	/* Audio (D2_0) devices: all disabled */
+
+	/* Special Clocks 0 */
+	{
+		.name		= "sclk_hpm",
+		.id		= -1,
+		.parent		= NULL,
+		.enable		= s5pc100_sclk0_ctrl,
+		.ctrlbit	= S5P_CLKGATE_SCLK0_HPM,
+	}, {
+		.name		= "sclk_onenand",
+		.id		= -1,
+		.parent		= NULL,
+		.enable		= s5pc100_sclk0_ctrl,
+		.ctrlbit	= S5P_CLKGATE_SCLK0_ONENAND,
+	}, {
+		.name		= "spi_48",
+		.id		= 0,
+		.parent		= &clk_48m,
+		.enable		= s5pc100_sclk0_ctrl,
+		.ctrlbit	= S5P_CLKGATE_SCLK0_SPI0_48,
+	}, {
+		.name		= "spi_48",
+		.id		= 1,
+		.parent		= &clk_48m,
+		.enable		= s5pc100_sclk0_ctrl,
+		.ctrlbit	= S5P_CLKGATE_SCLK0_SPI1_48,
+	}, {
+		.name		= "spi_48",
+		.id		= 2,
+		.parent		= &clk_48m,
+		.enable		= s5pc100_sclk0_ctrl,
+		.ctrlbit	= S5P_CLKGATE_SCLK0_SPI2_48,
+	}, {
+		.name		= "mmc_48",
+		.id		= 0,
+		.parent		= &clk_48m,
+		.enable		= s5pc100_sclk0_ctrl,
+		.ctrlbit	= S5P_CLKGATE_SCLK0_MMC0_48,
+	}, {
+		.name		= "mmc_48",
+		.id		= 1,
+		.parent		= &clk_48m,
+		.enable		= s5pc100_sclk0_ctrl,
+		.ctrlbit	= S5P_CLKGATE_SCLK0_MMC1_48,
+	}, {
+		.name		= "mmc_48",
+		.id		= 2,
+		.parent		= &clk_48m,
+		.enable		= s5pc100_sclk0_ctrl,
+		.ctrlbit	= S5P_CLKGATE_SCLK0_MMC2_48,
+	},
+	/* Special Clocks 1 */
+};
+
 static struct clk *clks[] __initdata = {
-	&clk_ext_xtal_mux,
 	&clk_dout_apll,
 	&clk_dout_d0_bus,
 	&clk_dout_pclkd0,
@@ -847,13 +1402,14 @@ static struct clk *clks[] __initdata = {
 	&clk_dout_mpll2,
 	&clk_dout_cam,
 	&clk_dout_mpll,
-	&clk_fout_epll,
 	&clk_iis_cd0,
 	&clk_iis_cd1,
 	&clk_iis_cd2,
 	&clk_pcm_cd0,
 	&clk_pcm_cd1,
-	&clk_arm,
+	&clk_pd0,
+	&clk_hd0,
+	&clk_54m,
 };
 
 void __init s5pc100_register_clocks(void)
@@ -861,16 +1417,25 @@ void __init s5pc100_register_clocks(void)
 	struct clk *clkp;
 	int ret;
 	int ptr;
+	int size;
+
+	s3c24xx_register_clocks(clks, ARRAY_SIZE(clks));
+	s3c_register_clocks(init_clocks, ARRAY_SIZE(init_clocks));
 
-	for (ptr = 0; ptr < ARRAY_SIZE(clks); ptr++) {
-		clkp = clks[ptr];
+	clkp = init_clocks_disable;
+	size = ARRAY_SIZE(init_clocks_disable);
+
+	for (ptr = 0; ptr < size; ptr++, clkp++) {
 		ret = s3c24xx_register_clock(clkp);
 		if (ret < 0) {
 			printk(KERN_ERR "Failed to register clock %s (%d)\n",
 			       clkp->name, ret);
 		}
+
+		(clkp->enable)(clkp, 0);
 	}
 
 	s3c_register_clksrc(clksrc_audio, ARRAY_SIZE(clksrc_audio));
 	s3c_register_clksrc(clksrc_clks, ARRAY_SIZE(clksrc_clks));
+	s3c_pwmclk_init();
 }
arch/arm/mach-s5pc100/include/mach/regs-clock.h renamed from arch/arm/plat-s5pc1xx/include/plat/regs-clock.h +0 -0
similarity index 100%
copy from arch/arm/plat-s5pc1xx/include/plat/regs-clock.h
copy to arch/arm/mach-s5pc100/include/mach/regs-clock.h
Signature · 1 line
1.6.4
#15 lore raw

PATCH 5/16 ARM: S5PC100: new clocks definition

Quoted 5 lines · Marek Szyprowski

Prepare for moving support for S5PC100 SoC to plat-s5p framework (part 3). This patch adds all clocks from plat-s5pc1xx/clocks.c and removes all the code that can be reused from plat-s5p/clock.c.

Quoted 8 lines
---
 arch/arm/mach-s5pc100/clock.c                      |  841
++++++++++++++++----
 .../include/mach}/regs-clock.h                     |    0
 2 files changed, 703 insertions(+), 138 deletions(-)
 copy arch/arm/{plat-s5pc1xx/include/plat =>

mach-s5pc100/include/mach}/regs-

Quoted 222 lines

clock.h (100%)

arch/arm/mach-s5pc100/clock.c +49 -123
index c391c61..75fa9be 100644
@@ -16,59 +16,22 @@
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/list.h>
-#include <linux/errno.h>
 #include <linux/err.h>
 #include <linux/clk.h>
-#include <linux/sysdev.h>
 #include <linux/io.h>
 
-#include <mach/hardware.h>
 #include <mach/map.h>
 
 #include <plat/cpu-freq.h>
-
-#include <plat/regs-clock.h>
+#include <mach/regs-clock.h>
 #include <plat/clock.h>
-#include <plat/clock-clksrc.h>
 #include <plat/cpu.h>
 #include <plat/pll.h>
-#include <plat/devs.h>
+#include <plat/s5p-clock.h>
+#include <plat/clock-clksrc.h>
 #include <plat/s5pc100.h>
 
-/* fin_apll, fin_mpll and fin_epll are all the same clock, which we call
- * ext_xtal_mux for want of an actual name from the manual.
-*/
-
-static struct clk clk_ext_xtal_mux = {
-	.name		= "ext_xtal",
-	.id		= -1,
-};
-
-#define clk_fin_apll clk_ext_xtal_mux
-#define clk_fin_mpll clk_ext_xtal_mux
-#define clk_fin_epll clk_ext_xtal_mux
-#define clk_fin_hpll clk_ext_xtal_mux
-
-#define clk_fout_mpll	clk_mpll
-#define clk_vclk_54m	clk_54m
-
-/* APLL */
-static struct clk clk_fout_apll = {
-	.name		= "fout_apll",
-	.id		= -1,
-	.rate		= 27000000,
-};
-
-static struct clk *clk_src_apll_list[] = {
-	[0] = &clk_fin_apll,
-	[1] = &clk_fout_apll,
-};
-
-static struct clksrc_sources clk_src_apll = {
-	.sources	= clk_src_apll_list,
-	.nr_sources	= ARRAY_SIZE(clk_src_apll_list),
-};
-
+/* APLL Mux output clock */
 static struct clksrc_clk clk_mout_apll = {
 	.clk	= {
 		.name		= "mout_apll",
@@ -98,63 +61,6 @@ static struct clk clk_dout_apll = {
 	},
 };
 
-static unsigned long s5pc100_clk_arm_get_rate(struct clk *clk)
-{
-	unsigned long rate = clk_get_rate(clk->parent);
-	unsigned int ratio;
-
-	ratio = __raw_readl(S5P_CLK_DIV0) & S5P_CLK_DIV0_ARM_MASK;
-	ratio >>= S5P_CLK_DIV0_ARM_SHIFT;
-
-	return rate / (ratio + 1);
-}
-
-static unsigned long s5pc100_clk_arm_round_rate(struct clk *clk,
-						unsigned long rate)
-{
-	unsigned long parent = clk_get_rate(clk->parent);
-	u32 div;
-
-	if (parent < rate)
-		return rate;
-
-	div = (parent / rate) - 1;
-	if (div > S5P_CLK_DIV0_ARM_MASK)
-		div = S5P_CLK_DIV0_ARM_MASK;
-
-	return parent / (div + 1);
-}
-
-static int s5pc100_clk_arm_set_rate(struct clk *clk, unsigned long rate)
-{
-	unsigned long parent = clk_get_rate(clk->parent);
-	u32 div;
-	u32 val;
-
-	if (rate < parent / (S5P_CLK_DIV0_ARM_MASK + 1))
-		return -EINVAL;
-
-	rate = clk_round_rate(clk, rate);
-	div = clk_get_rate(clk->parent) / rate;
-
-	val = __raw_readl(S5P_CLK_DIV0);
-	val &= S5P_CLK_DIV0_ARM_MASK;
-	val |= (div - 1);
-	__raw_writel(val, S5P_CLK_DIV0);
-
-	return 0;
-}
-
-static struct clk clk_arm = {
-	.name		= "armclk",
-	.id		= -1,
-	.parent		= &clk_dout_apll,
-	.ops		= &(struct clk_ops) {
-		.get_rate	= s5pc100_clk_arm_get_rate,
-		.set_rate	= s5pc100_clk_arm_set_rate,
-		.round_rate	= s5pc100_clk_arm_round_rate,
-	},
-};
 
 static unsigned long s5pc100_clk_dout_d0_bus_get_rate(struct clk *clk)
 {
@@ -217,16 +123,6 @@ static struct clk clk_dout_apll2 = {
 };
 
 /* MPLL */
-static struct clk *clk_src_mpll_list[] = {
-	[0] = &clk_fin_mpll,
-	[1] = &clk_fout_mpll,
-};
-
-static struct clksrc_sources clk_src_mpll = {
-	.sources	= clk_src_mpll_list,
-	.nr_sources	= ARRAY_SIZE(clk_src_mpll_list),
-};
-
 static struct clksrc_clk clk_mout_mpll = {
 	.clk = {
 		.name		= "mout_mpll",
@@ -385,21 +281,6 @@ static struct clk clk_dout_mpll = {
 };
 
 /* EPLL */
-static struct clk clk_fout_epll = {
-	.name		= "fout_epll",
-	.id		= -1,
-};
-
-static struct clk *clk_src_epll_list[] = {
-	[0] = &clk_fin_epll,
-	[1] = &clk_fout_epll,
-};
-
-static struct clksrc_sources clk_src_epll = {
-	.sources	= clk_src_epll_list,
-	.nr_sources	= ARRAY_SIZE(clk_src_epll_list),
-};
-
 static struct clksrc_clk clk_mout_epll = {
 	.clk	= {
 		.name		= "mout_epll",
@@ -471,6 +352,164 @@ static struct clk clk_pcm_cd1 = {
 	.id		= -1,
 };
 
+static struct clk clk_hd0 = {
+	.name		= "hclkd0",
+	.id		= -1,
+	.rate		= 0,
+	.parent		= NULL,
+	.ctrlbit	= 0,
+	.ops		= &clk_ops_def_setrate,
+};
+
+static struct clk clk_pd0 = {
+	.name		= "pclkd0",
+	.id		= -1,
+	.rate		= 0,
+	.parent		= NULL,
+	.ctrlbit	= 0,
+	.ops		= &clk_ops_def_setrate,
+};
+
+static struct clk clk_54m = {
+	.name		= "clk_54m",
+	.id		= -1,
+	.rate		= 54000000,
+};
+
+
+static int s5pc100_clk_48m_ctrl(struct clk *clk, int enable)
+{
+	unsigned long flags;
+	u32 val;
+
+	/* can't rely on clock lock, this register has other usages */
+	local_irq_save(flags);
+
+	val = __raw_readl(S5P_CLK_SRC1);
+	if (enable)
+		val |= S5P_CLK_SRC1_CLK48M_MASK;
+	else
+		val &= ~S5P_CLK_SRC1_CLK48M_MASK;
+
+	__raw_writel(val, S5P_CLK_SRC1);
+	local_irq_restore(flags);
+
+	return 0;
+}
+

arch/arm/mach-s5pc100/clock.c static struct clk clk_pcm_cd1 = { · line 409

Quoted 10 lines
arch/arm/mach-s5pc100/clock.c +10 -0
+static unsigned long s5pc100_clk_arm_get_rate(struct clk *clk)
+{
+	unsigned long rate = clk_get_rate(clk->parent);
+	unsigned int ratio;
+
+	ratio = __raw_readl(S5P_CLK_DIV0) & S5P_CLK_DIV0_ARM_MASK;
+	ratio >>= S5P_CLK_DIV0_ARM_SHIFT;
+
+	return rate / (ratio + 1);
+}

This is not correct. If you use structure of clksrc_clk, you can handle this easily. So no need this function.

Quoted 6 lines
arch/arm/mach-s5pc100/clock.c +6 -0
+
+static unsigned long s5pc100_clk_arm_round_rate(struct clk *clk,
+						unsigned long rate)
+{
+	unsigned long parent = clk_get_rate(clk->parent);
+	u32 div;

arch/arm/mach-s5pc100/clock.c static struct clk clk_pcm_cd1 = { · line 425

Quoted 10 lines
arch/arm/mach-s5pc100/clock.c +10 -0
+
+	if (parent < rate)
+		return rate;
+
+	div = (parent / rate) - 1;
+	if (div > S5P_CLK_DIV0_ARM_MASK)
+		div = S5P_CLK_DIV0_ARM_MASK;
+
+	return parent / (div + 1);
+}

Same as above comment.

Quoted 10 lines
arch/arm/mach-s5pc100/clock.c +10 -0
+
+static int s5pc100_clk_arm_set_rate(struct clk *clk, unsigned long rate)
+{
+	unsigned long parent = clk_get_rate(clk->parent);
+	u32 div;
+	u32 val;
+
+	if (rate < parent / (S5P_CLK_DIV0_ARM_MASK + 1))
+		return -EINVAL;
+

arch/arm/mach-s5pc100/clock.c static struct clk clk_pcm_cd1 = { · line 445

Quoted 10 lines
arch/arm/mach-s5pc100/clock.c +10 -0
+	rate = clk_round_rate(clk, rate);
+	div = clk_get_rate(clk->parent) / rate;
+
+	val = __raw_readl(S5P_CLK_DIV0);
+	val &= S5P_CLK_DIV0_ARM_MASK;
+	val |= (div - 1);
+	__raw_writel(val, S5P_CLK_DIV0);
+
+	return 0;
+}

Same.

arch/arm/mach-s5pc100/clock.c static struct clk clk_pcm_cd1 = { · line 455

Quoted 10 lines
arch/arm/mach-s5pc100/clock.c +10 -0
+
+static struct clk_ops s5pc100_armclk_ops = {
+	.get_rate	= s5pc100_clk_arm_get_rate,
+	.set_rate	= s5pc100_clk_arm_set_rate,
+	.round_rate	= s5pc100_clk_arm_round_rate,
+};
+
+static int s5pc100_clk_d00_ctrl(struct clk *clk, int enable)
+{
+	return s5p_gatectrl(S5P_CLKGATE_D00, clk, enable);

Oh, ok. I commented about this at your 1st patch.
Anyway looks good.

Quoted 70 lines
arch/arm/mach-s5pc100/clock.c +58 -1
+}
+
+static int s5pc100_clk_d01_ctrl(struct clk *clk, int enable)
+{
+	return s5p_gatectrl(S5P_CLKGATE_D01, clk, enable);
+}
+
+static int s5pc100_clk_d02_ctrl(struct clk *clk, int enable)
+{
+	return s5p_gatectrl(S5P_CLKGATE_D02, clk, enable);
+}
+
+static int s5pc100_clk_d10_ctrl(struct clk *clk, int enable)
+{
+	return s5p_gatectrl(S5P_CLKGATE_D10, clk, enable);
+}
+
+static int s5pc100_clk_d11_ctrl(struct clk *clk, int enable)
+{
+	return s5p_gatectrl(S5P_CLKGATE_D11, clk, enable);
+}
+
+static int s5pc100_clk_d12_ctrl(struct clk *clk, int enable)
+{
+	return s5p_gatectrl(S5P_CLKGATE_D12, clk, enable);
+}
+
+static int s5pc100_clk_d13_ctrl(struct clk *clk, int enable)
+{
+	return s5p_gatectrl(S5P_CLKGATE_D13, clk, enable);
+}
+
+static int s5pc100_clk_d14_ctrl(struct clk *clk, int enable)
+{
+	return s5p_gatectrl(S5P_CLKGATE_D14, clk, enable);
+}
+
+static int s5pc100_clk_d15_ctrl(struct clk *clk, int enable)
+{
+	return s5p_gatectrl(S5P_CLKGATE_D15, clk, enable);
+}
+
+static int s5pc100_clk_d20_ctrl(struct clk *clk, int enable)
+{
+	return s5p_gatectrl(S5P_CLKGATE_D20, clk, enable);
+}
+
+static int s5pc100_sclk0_ctrl(struct clk *clk, int enable)
+{
+	return s5p_gatectrl(S5P_SCLKGATE0, clk, enable);
+}
+
+static int s5pc100_sclk1_ctrl(struct clk *clk, int enable)
+{
+	return s5p_gatectrl(S5P_SCLKGATE1, clk, enable);
+}
+
 static struct clk *clkset_audio0_list[] = {
 	&clk_mout_epll.clk,
 	&clk_dout_mpll,
@@ -583,7 +622,7 @@ static struct clk *clkset_lcd_fimc_list[] = {
 	&clk_mout_epll.clk,
 	&clk_dout_mpll,
 	&clk_mout_hpll.clk,
-	&clk_vclk_54m,
+	&clk_54m,
 };
 
 static struct clksrc_sources clkset_lcd_fimc = {

arch/arm/mach-s5pc100/clock.c void __init_or_cpufreq s5pc100_setup_clocks(void) · line 817

Quoted 6 lines
arch/arm/mach-s5pc100/clock.c +3 -0
@@ -773,6 +812,11 @@ void __init_or_cpufreq s5pc100_setup_clocks(void)
 	unsigned int ptr;
 	u32 clkdiv0, clkdiv1;
 
+	/* Hook callbacks to base clocks */
+	clk_48m.enable = s5pc100_clk_48m_ctrl;
+	clk_arm.ops = &s5pc100_armclk_ops;

No need to register ops member.

Quoted 7 lines
arch/arm/mach-s5pc100/clock.c +2 -0
+	clk_arm.parent = &clk_dout_apll,
+
 	printk(KERN_DEBUG "%s: registering clocks\n", __func__);
 
 	clkdiv0 = __raw_readl(S5P_CLK_DIV0);
@@ -788,10 +832,10 @@ void __init_or_cpufreq s5pc100_setup_clocks(void)
 

arch/arm/mach-s5pc100/clock.c void __init_or_cpufreq s5pc100_setup_clocks(void) · line 838

Quoted 10 lines
arch/arm/mach-s5pc100/clock.c +4 -4
 	printk(KERN_DEBUG "%s: xtal is %ld\n", __func__, xtal);
 
-	apll = s5pc1xx_get_pll(xtal, __raw_readl(S5P_APLL_CON));
-	mpll = s5pc1xx_get_pll(xtal, __raw_readl(S5P_MPLL_CON));
-	epll = s5pc1xx_get_pll(xtal, __raw_readl(S5P_EPLL_CON));
-	hpll = s5pc1xx_get_pll(xtal, __raw_readl(S5P_HPLL_CON));
+	apll = s5p_get_pll45xx(xtal, __raw_readl(S5P_APLL_CON), pll_4502);
+	mpll = s5p_get_pll45xx(xtal, __raw_readl(S5P_MPLL_CON), pll_4502);
+	epll = s5p_get_pll45xx(xtal, __raw_readl(S5P_EPLL_CON), pll_4502);
+	hpll = s5p_get_pll45xx(xtal, __raw_readl(S5P_HPLL_CON), pll_4502);

This is ok.

Review

Quoted 590 lines
arch/arm/mach-s5pc100/clock.c +0 -1
 	printk(KERN_INFO "S5PC100: Apll=%ld.%03ld Mhz, Mpll=%ld.%03ld Mhz"
 		", Epll=%ld.%03ld Mhz, Hpll=%ld.%03ld Mhz\n",
@@ -805,11 +849,10 @@ void __init_or_cpufreq s5pc100_setup_clocks(void)
 	hclk = mpll / GET_DIV(clkdiv1, S5P_CLK_DIV1_D1);
 	pclk = hclk / GET_DIV(clkdiv1, S5P_CLK_DIV1_PCLKD1);
 
-	printk(KERN_INFO "S5PC100: ARMCLK=%ld.%03ld MHz,

HCLKD0=%ld.%03ld MHz,"

arch/arm/mach-s5pc100/clock.c +1 -4
-		" PCLKD0=%ld.%03ld MHz\n, HCLK=%ld.%03ld MHz,"
-		" PCLK=%ld.%03ld MHz\n",
-		print_mhz(armclk), print_mhz(hclkd0),
-		print_mhz(pclkd0), print_mhz(hclk), print_mhz(pclk));
+	printk(KERN_INFO "S5PC100: ARMCLK=%ld.%03ld MHz,

HCLKD0=%ld.%03ld MHz, "

arch/arm/mach-s5pc100/clock.c +1 -0
+	       "PCLKD0=%ld.%03ld MHz, HCLK=%ld.%03ld MHz,

PCLK=%ld.%03ld MHz\n",

arch/arm/mach-s5pc100/clock.c +529 -5
+	       print_mhz(armclk), print_mhz(hclkd0),
+	       print_mhz(pclkd0), print_mhz(hclk), print_mhz(pclk));
 
 	clk_fout_apll.rate = apll;
 	clk_fout_mpll.rate = mpll;
@@ -830,8 +873,520 @@ void __init_or_cpufreq s5pc100_setup_clocks(void)
 		s3c_set_clksrc(clksrc_clks + ptr, true);
 }
 
+static struct clk init_clocks_disable[] = {
+	{
+		.name		= "dsi",
+		.id		= -1,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d11_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D11_DSI,
+	}, {
+		.name		= "csi",
+		.id		= -1,
+		.parent		= &clk_h,
+		.enable		= s5pc100_clk_d11_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D11_CSI,
+	}, {
+		.name		= "ccan",
+		.id		= 0,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d14_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D14_CCAN0,
+	}, {
+		.name		= "ccan",
+		.id		= 1,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d14_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D14_CCAN1,
+	}, {
+		.name		= "keypad",
+		.id		= -1,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d15_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D15_KEYIF,
+	}, {
+		.name		= "hclkd2",
+		.id		= -1,
+		.parent		= NULL,
+		.enable		= s5pc100_clk_d20_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D20_HCLKD2,
+	}, {
+		.name		= "iis-d2",
+		.id		= -1,
+		.parent		= NULL,
+		.enable		= s5pc100_clk_d20_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D20_I2SD2,
+	},
+};
+
+static struct clk init_clocks[] = {
+	/* System1 (D0_0) devices */
+	{
+		.name		= "intc",
+		.id		= -1,
+		.parent		= &clk_hd0,
+		.enable		= s5pc100_clk_d00_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D00_INTC,
+	}, {
+		.name		= "tzic",
+		.id		= -1,
+		.parent		= &clk_hd0,
+		.enable		= s5pc100_clk_d00_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D00_TZIC,
+	}, {
+		.name		= "cf-ata",
+		.id		= -1,
+		.parent		= &clk_hd0,
+		.enable		= s5pc100_clk_d00_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D00_CFCON,
+	}, {
+		.name		= "mdma",
+		.id		= -1,
+		.parent		= &clk_hd0,
+		.enable		= s5pc100_clk_d00_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D00_MDMA,
+	}, {
+		.name		= "g2d",
+		.id		= -1,
+		.parent		= &clk_hd0,
+		.enable		= s5pc100_clk_d00_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D00_G2D,
+	}, {
+		.name		= "secss",
+		.id		= -1,
+		.parent		= &clk_hd0,
+		.enable		= s5pc100_clk_d00_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D00_SECSS,
+	}, {
+		.name		= "cssys",
+		.id		= -1,
+		.parent		= &clk_hd0,
+		.enable		= s5pc100_clk_d00_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D00_CSSYS,
+	},
+
+	/* Memory (D0_1) devices */
+	{
+		.name		= "dmc",
+		.id		= -1,
+		.parent		= &clk_hd0,
+		.enable		= s5pc100_clk_d01_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D01_DMC,
+	}, {
+		.name		= "sromc",
+		.id		= -1,
+		.parent		= &clk_hd0,
+		.enable		= s5pc100_clk_d01_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D01_SROMC,
+	}, {
+		.name		= "onenand",
+		.id		= -1,
+		.parent		= &clk_hd0,
+		.enable		= s5pc100_clk_d01_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D01_ONENAND,
+	}, {
+		.name		= "nand",
+		.id		= -1,
+		.parent		= &clk_hd0,
+		.enable		= s5pc100_clk_d01_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D01_NFCON,
+	}, {
+		.name		= "intmem",
+		.id		= -1,
+		.parent		= &clk_hd0,
+		.enable		= s5pc100_clk_d01_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D01_INTMEM,
+	}, {
+		.name		= "ebi",
+		.id		= -1,
+		.parent		= &clk_hd0,
+		.enable		= s5pc100_clk_d01_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D01_EBI,
+	},
+
+	/* System2 (D0_2) devices */
+	{
+		.name		= "seckey",
+		.id		= -1,
+		.parent		= &clk_pd0,
+		.enable		= s5pc100_clk_d02_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D02_SECKEY,
+	}, {
+		.name		= "sdm",
+		.id		= -1,
+		.parent		= &clk_hd0,
+		.enable		= s5pc100_clk_d02_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D02_SDM,
+	},
+
+	/* File (D1_0) devices */
+	{
+		.name		= "pdma",
+		.id		= 0,
+		.parent		= &clk_h,
+		.enable		= s5pc100_clk_d10_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D10_PDMA0,
+	}, {
+		.name		= "pdma",
+		.id		= 1,
+		.parent		= &clk_h,
+		.enable		= s5pc100_clk_d10_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D10_PDMA1,
+	}, {
+		.name		= "usb-host",
+		.id		= -1,
+		.parent		= &clk_h,
+		.enable		= s5pc100_clk_d10_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D10_USBHOST,
+	}, {
+		.name		= "otg",
+		.id		= -1,
+		.parent		= &clk_h,
+		.enable		= s5pc100_clk_d10_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D10_USBOTG,
+	}, {
+		.name		= "modem",
+		.id		= -1,
+		.parent		= &clk_h,
+		.enable		= s5pc100_clk_d10_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D10_MODEMIF,
+	}, {
+		.name		= "hsmmc",
+		.id		= 0,
+		.parent		= &clk_48m,
+		.enable		= s5pc100_clk_d10_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D10_HSMMC0,
+	}, {
+		.name		= "hsmmc",
+		.id		= 1,
+		.parent		= &clk_48m,
+		.enable		= s5pc100_clk_d10_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D10_HSMMC1,
+	}, {
+		.name		= "hsmmc",
+		.id		= 2,
+		.parent		= &clk_48m,
+		.enable		= s5pc100_clk_d10_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D10_HSMMC2,
+	},
+
+	/* Multimedia1 (D1_1) devices */
+	{
+		.name		= "lcdcon",
+		.id		= -1,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d11_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D11_LCD,
+	}, {
+		.name		= "rotator",
+		.id		= -1,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d11_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D11_ROTATOR,
+	}, {
+		.name		= "fimc",
+		.id		= -1,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d11_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D11_FIMC0,
+	}, {
+		.name		= "fimc",
+		.id		= -1,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d11_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D11_FIMC1,
+	}, {
+		.name		= "fimc",
+		.id		= -1,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d11_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D11_FIMC2,
+	}, {
+		.name		= "jpeg",
+		.id		= -1,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d11_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D11_JPEG,
+	}, {
+		.name		= "g3d",
+		.id		= -1,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d11_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D11_G3D,
+	},
+
+	/* Multimedia2 (D1_2) devices */
+	{
+		.name		= "tv",
+		.id		= -1,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d12_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D12_TV,
+	}, {
+		.name		= "vp",
+		.id		= -1,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d12_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D12_VP,
+	}, {
+		.name		= "mixer",
+		.id		= -1,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d12_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D12_MIXER,
+	}, {
+		.name		= "hdmi",
+		.id		= -1,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d12_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D12_HDMI,
+	}, {
+		.name		= "mfc",
+		.id		= -1,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d12_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D12_MFC,
+	},
+
+	/* System (D1_3) devices */
+	{
+		.name		= "chipid",
+		.id		= -1,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d13_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D13_CHIPID,
+	}, {
+		.name		= "gpio",
+		.id		= -1,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d13_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D13_GPIO,
+	}, {
+		.name		= "apc",
+		.id		= -1,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d13_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D13_APC,
+	}, {
+		.name		= "iec",
+		.id		= -1,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d13_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D13_IEC,
+	}, {
+		.name		= "timers",
+		.id		= -1,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d13_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D13_PWM,
+	}, {
+		.name		= "systimer",
+		.id		= -1,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d13_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D13_SYSTIMER,
+	}, {
+		.name		= "watchdog",
+		.id		= -1,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d13_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D13_WDT,
+	}, {
+		.name		= "rtc",
+		.id		= -1,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d13_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D13_RTC,
+	},
+
+	/* Connectivity (D1_4) devices */
+	{
+		.name		= "uart",
+		.id		= 0,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d14_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D14_UART0,
+	}, {
+		.name		= "uart",
+		.id		= 1,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d14_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D14_UART1,
+	}, {
+		.name		= "uart",
+		.id		= 2,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d14_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D14_UART2,
+	}, {
+		.name		= "uart",
+		.id		= 3,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d14_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D14_UART3,
+	}, {
+		.name		= "i2c",
+		.id		= -1,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d14_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D14_IIC,
+	}, {
+		.name		= "hdmi-i2c",
+		.id		= -1,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d14_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D14_HDMI_IIC,
+	}, {
+		.name		= "spi",
+		.id		= 0,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d14_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D14_SPI0,
+	}, {
+		.name		= "spi",
+		.id		= 1,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d14_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D14_SPI1,
+	}, {
+		.name		= "spi",
+		.id		= 2,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d14_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D14_SPI2,
+	}, {
+		.name		= "irda",
+		.id		= -1,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d14_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D14_IRDA,
+	}, {
+		.name		= "hsitx",
+		.id		= -1,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d14_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D14_HSITX,
+	}, {
+		.name		= "hsirx",
+		.id		= -1,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d14_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D14_HSIRX,
+	},
+
+	/* Audio (D1_5) devices */
+	{
+		.name		= "iis",
+		.id		= 0,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d15_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D15_IIS0,
+	}, {
+		.name		= "iis",
+		.id		= 1,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d15_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D15_IIS1,
+	}, {
+		.name		= "iis",
+		.id		= 2,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d15_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D15_IIS2,
+	}, {
+		.name		= "ac97",
+		.id		= -1,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d15_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D15_AC97,
+	}, {
+		.name		= "pcm",
+		.id		= 0,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d15_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D15_PCM0,
+	}, {
+		.name		= "pcm",
+		.id		= 1,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d15_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D15_PCM1,
+	}, {
+		.name		= "spdif",
+		.id		= -1,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d15_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D15_SPDIF,
+	}, {
+		.name		= "adc",
+		.id		= -1,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d15_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D15_TSADC,
+	}, {
+		.name		= "cg",
+		.id		= -1,
+		.parent		= &clk_p,
+		.enable		= s5pc100_clk_d15_ctrl,
+		.ctrlbit	= S5P_CLKGATE_D15_CG,
+	},
+
+	/* Audio (D2_0) devices: all disabled */
+
+	/* Special Clocks 0 */
+	{
+		.name		= "sclk_hpm",
+		.id		= -1,
+		.parent		= NULL,
+		.enable		= s5pc100_sclk0_ctrl,
+		.ctrlbit	= S5P_CLKGATE_SCLK0_HPM,
+	}, {
+		.name		= "sclk_onenand",
+		.id		= -1,
+		.parent		= NULL,
+		.enable		= s5pc100_sclk0_ctrl,
+		.ctrlbit	= S5P_CLKGATE_SCLK0_ONENAND,
+	}, {
+		.name		= "spi_48",
+		.id		= 0,
+		.parent		= &clk_48m,
+		.enable		= s5pc100_sclk0_ctrl,
+		.ctrlbit	= S5P_CLKGATE_SCLK0_SPI0_48,
+	}, {
+		.name		= "spi_48",
+		.id		= 1,
+		.parent		= &clk_48m,
+		.enable		= s5pc100_sclk0_ctrl,
+		.ctrlbit	= S5P_CLKGATE_SCLK0_SPI1_48,
+	}, {
+		.name		= "spi_48",
+		.id		= 2,
+		.parent		= &clk_48m,
+		.enable		= s5pc100_sclk0_ctrl,
+		.ctrlbit	= S5P_CLKGATE_SCLK0_SPI2_48,
+	}, {
+		.name		= "mmc_48",
+		.id		= 0,
+		.parent		= &clk_48m,
+		.enable		= s5pc100_sclk0_ctrl,
+		.ctrlbit	= S5P_CLKGATE_SCLK0_MMC0_48,
+	}, {
+		.name		= "mmc_48",
+		.id		= 1,
+		.parent		= &clk_48m,
+		.enable		= s5pc100_sclk0_ctrl,
+		.ctrlbit	= S5P_CLKGATE_SCLK0_MMC1_48,
+	}, {
+		.name		= "mmc_48",
+		.id		= 2,
+		.parent		= &clk_48m,
+		.enable		= s5pc100_sclk0_ctrl,
+		.ctrlbit	= S5P_CLKGATE_SCLK0_MMC2_48,
+	},
+	/* Special Clocks 1 */
+};
+
 static struct clk *clks[] __initdata = {
-	&clk_ext_xtal_mux,
 	&clk_dout_apll,
 	&clk_dout_d0_bus,
 	&clk_dout_pclkd0,
@@ -847,13 +1402,14 @@ static struct clk *clks[] __initdata = {
 	&clk_dout_mpll2,
 	&clk_dout_cam,
 	&clk_dout_mpll,
-	&clk_fout_epll,
 	&clk_iis_cd0,
 	&clk_iis_cd1,
 	&clk_iis_cd2,
 	&clk_pcm_cd0,
 	&clk_pcm_cd1,
-	&clk_arm,
+	&clk_pd0,
+	&clk_hd0,
+	&clk_54m,
 };
 
 void __init s5pc100_register_clocks(void)
@@ -861,16 +1417,25 @@ void __init s5pc100_register_clocks(void)
 	struct clk *clkp;
 	int ret;
 	int ptr;
+	int size;
+
+	s3c24xx_register_clocks(clks, ARRAY_SIZE(clks));
+	s3c_register_clocks(init_clocks, ARRAY_SIZE(init_clocks));
 
-	for (ptr = 0; ptr < ARRAY_SIZE(clks); ptr++) {
-		clkp = clks[ptr];
+	clkp = init_clocks_disable;
+	size = ARRAY_SIZE(init_clocks_disable);
+
+	for (ptr = 0; ptr < size; ptr++, clkp++) {
 		ret = s3c24xx_register_clock(clkp);
 		if (ret < 0) {
 			printk(KERN_ERR "Failed to register clock %s (%d)\n",
 			       clkp->name, ret);
 		}
+
+		(clkp->enable)(clkp, 0);
 	}
 
 	s3c_register_clksrc(clksrc_audio, ARRAY_SIZE(clksrc_audio));
 	s3c_register_clksrc(clksrc_clks, ARRAY_SIZE(clksrc_clks));
+	s3c_pwmclk_init();
 }
(quoted diff) +0 -0

b/arch/arm/mach-

Quoted 6 lines

s5pc100/include/mach/regs-clock.h
similarity index 100%
copy from arch/arm/plat-s5pc1xx/include/plat/regs-clock.h copy to arch/arm/mach-s5pc100/include/mach/regs-clock.h --
1.6.4

Marek,

Actually, need to modify many part to fit new clock scheme. For example, to use clksrc_clk is easily to handle clock.

S.LSI already made the patch for C100 clock changing which is using clksrc_clk structure. So may I submit it?

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.

#16 lore raw

PATCH 5/16 ARM: S5PC100: new clocks definition

Hello,

Quoted 244 lines · Kukjin Kim
Quoted 5 lines · Marek Szyprowski

Prepare for moving support for S5PC100 SoC to plat-s5p framework (part 3). This patch adds all clocks from plat-s5pc1xx/clocks.c and removes all the code that can be reused from plat-s5p/clock.c.

Quoted 8 lines
---
 arch/arm/mach-s5pc100/clock.c                      |  841
++++++++++++++++----
 .../include/mach}/regs-clock.h                     |    0
 2 files changed, 703 insertions(+), 138 deletions(-)
 copy arch/arm/{plat-s5pc1xx/include/plat =>

mach-s5pc100/include/mach}/regs-

arch/arm/mach-

Quoted 3 lines

clock.h (100%)

arch/arm/mach- renamed from arch/arm/mach-s5pc100/clock.c +0 -0

s5pc100/clock.c

Quoted 225 lines

index c391c61..75fa9be 100644

arch/arm/mach-s5pc100/clock.c +55 -123
@@ -16,59 +16,22 @@
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/list.h>
-#include <linux/errno.h>
 #include <linux/err.h>
 #include <linux/clk.h>
-#include <linux/sysdev.h>
 #include <linux/io.h>
 
-#include <mach/hardware.h>
 #include <mach/map.h>
 
 #include <plat/cpu-freq.h>
-
-#include <plat/regs-clock.h>
+#include <mach/regs-clock.h>
 #include <plat/clock.h>
-#include <plat/clock-clksrc.h>
 #include <plat/cpu.h>
 #include <plat/pll.h>
-#include <plat/devs.h>
+#include <plat/s5p-clock.h>
+#include <plat/clock-clksrc.h>
 #include <plat/s5pc100.h>
 
-/* fin_apll, fin_mpll and fin_epll are all the same clock, which we call
- * ext_xtal_mux for want of an actual name from the manual.
-*/
-
-static struct clk clk_ext_xtal_mux = {
-	.name		= "ext_xtal",
-	.id		= -1,
-};
-
-#define clk_fin_apll clk_ext_xtal_mux
-#define clk_fin_mpll clk_ext_xtal_mux
-#define clk_fin_epll clk_ext_xtal_mux
-#define clk_fin_hpll clk_ext_xtal_mux
-
-#define clk_fout_mpll	clk_mpll
-#define clk_vclk_54m	clk_54m
-
-/* APLL */
-static struct clk clk_fout_apll = {
-	.name		= "fout_apll",
-	.id		= -1,
-	.rate		= 27000000,
-};
-
-static struct clk *clk_src_apll_list[] = {
-	[0] = &clk_fin_apll,
-	[1] = &clk_fout_apll,
-};
-
-static struct clksrc_sources clk_src_apll = {
-	.sources	= clk_src_apll_list,
-	.nr_sources	= ARRAY_SIZE(clk_src_apll_list),
-};
-
+/* APLL Mux output clock */
 static struct clksrc_clk clk_mout_apll = {
 	.clk	= {
 		.name		= "mout_apll",
@@ -98,63 +61,6 @@ static struct clk clk_dout_apll = {
 	},
 };
 
-static unsigned long s5pc100_clk_arm_get_rate(struct clk *clk)
-{
-	unsigned long rate = clk_get_rate(clk->parent);
-	unsigned int ratio;
-
-	ratio = __raw_readl(S5P_CLK_DIV0) & S5P_CLK_DIV0_ARM_MASK;
-	ratio >>= S5P_CLK_DIV0_ARM_SHIFT;
-
-	return rate / (ratio + 1);
-}
-
-static unsigned long s5pc100_clk_arm_round_rate(struct clk *clk,
-						unsigned long rate)
-{
-	unsigned long parent = clk_get_rate(clk->parent);
-	u32 div;
-
-	if (parent < rate)
-		return rate;
-
-	div = (parent / rate) - 1;
-	if (div > S5P_CLK_DIV0_ARM_MASK)
-		div = S5P_CLK_DIV0_ARM_MASK;
-
-	return parent / (div + 1);
-}
-
-static int s5pc100_clk_arm_set_rate(struct clk *clk, unsigned long rate)
-{
-	unsigned long parent = clk_get_rate(clk->parent);
-	u32 div;
-	u32 val;
-
-	if (rate < parent / (S5P_CLK_DIV0_ARM_MASK + 1))
-		return -EINVAL;
-
-	rate = clk_round_rate(clk, rate);
-	div = clk_get_rate(clk->parent) / rate;
-
-	val = __raw_readl(S5P_CLK_DIV0);
-	val &= S5P_CLK_DIV0_ARM_MASK;
-	val |= (div - 1);
-	__raw_writel(val, S5P_CLK_DIV0);
-
-	return 0;
-}
-
-static struct clk clk_arm = {
-	.name		= "armclk",
-	.id		= -1,
-	.parent		= &clk_dout_apll,
-	.ops		= &(struct clk_ops) {
-		.get_rate	= s5pc100_clk_arm_get_rate,
-		.set_rate	= s5pc100_clk_arm_set_rate,
-		.round_rate	= s5pc100_clk_arm_round_rate,
-	},
-};
 
 static unsigned long s5pc100_clk_dout_d0_bus_get_rate(struct clk *clk)
 {
@@ -217,16 +123,6 @@ static struct clk clk_dout_apll2 = {
 };
 
 /* MPLL */
-static struct clk *clk_src_mpll_list[] = {
-	[0] = &clk_fin_mpll,
-	[1] = &clk_fout_mpll,
-};
-
-static struct clksrc_sources clk_src_mpll = {
-	.sources	= clk_src_mpll_list,
-	.nr_sources	= ARRAY_SIZE(clk_src_mpll_list),
-};
-
 static struct clksrc_clk clk_mout_mpll = {
 	.clk = {
 		.name		= "mout_mpll",
@@ -385,21 +281,6 @@ static struct clk clk_dout_mpll = {
 };
 
 /* EPLL */
-static struct clk clk_fout_epll = {
-	.name		= "fout_epll",
-	.id		= -1,
-};
-
-static struct clk *clk_src_epll_list[] = {
-	[0] = &clk_fin_epll,
-	[1] = &clk_fout_epll,
-};
-
-static struct clksrc_sources clk_src_epll = {
-	.sources	= clk_src_epll_list,
-	.nr_sources	= ARRAY_SIZE(clk_src_epll_list),
-};
-
 static struct clksrc_clk clk_mout_epll = {
 	.clk	= {
 		.name		= "mout_epll",
@@ -471,6 +352,164 @@ static struct clk clk_pcm_cd1 = {
 	.id		= -1,
 };
 
+static struct clk clk_hd0 = {
+	.name		= "hclkd0",
+	.id		= -1,
+	.rate		= 0,
+	.parent		= NULL,
+	.ctrlbit	= 0,
+	.ops		= &clk_ops_def_setrate,
+};
+
+static struct clk clk_pd0 = {
+	.name		= "pclkd0",
+	.id		= -1,
+	.rate		= 0,
+	.parent		= NULL,
+	.ctrlbit	= 0,
+	.ops		= &clk_ops_def_setrate,
+};
+
+static struct clk clk_54m = {
+	.name		= "clk_54m",
+	.id		= -1,
+	.rate		= 54000000,
+};
+
+
+static int s5pc100_clk_48m_ctrl(struct clk *clk, int enable)
+{
+	unsigned long flags;
+	u32 val;
+
+	/* can't rely on clock lock, this register has other usages */
+	local_irq_save(flags);
+
+	val = __raw_readl(S5P_CLK_SRC1);
+	if (enable)
+		val |= S5P_CLK_SRC1_CLK48M_MASK;
+	else
+		val &= ~S5P_CLK_SRC1_CLK48M_MASK;
+
+	__raw_writel(val, S5P_CLK_SRC1);
+	local_irq_restore(flags);
+
+	return 0;
+}
+
+static unsigned long s5pc100_clk_arm_get_rate(struct clk *clk)
+{
+	unsigned long rate = clk_get_rate(clk->parent);
+	unsigned int ratio;
+
+	ratio = __raw_readl(S5P_CLK_DIV0) & S5P_CLK_DIV0_ARM_MASK;
Quoted 8 lines

arch/arm/mach-s5pc100/clock.c static struct clk clk_pcm_cd1 = { · line 409

Quoted 4 lines
arch/arm/mach-s5pc100/clock.c +4 -0
+	ratio >>= S5P_CLK_DIV0_ARM_SHIFT;
+
+	return rate / (ratio + 1);
+}

This is not correct. If you use structure of clksrc_clk, you can handle this
easily. So no need this function.

Ok. I will look into this.

Quoted 136 lines
Quoted 7 lines
arch/arm/mach-s5pc100/clock.c +6 -0
+
+static unsigned long s5pc100_clk_arm_round_rate(struct clk *clk,
+						unsigned long rate)
+{
+	unsigned long parent = clk_get_rate(clk->parent);
+	u32 div;

arch/arm/mach-s5pc100/clock.c static struct clk clk_pcm_cd1 = { · line 425

Quoted 10 lines
arch/arm/mach-s5pc100/clock.c +10 -0
+
+	if (parent < rate)
+		return rate;
+
+	div = (parent / rate) - 1;
+	if (div > S5P_CLK_DIV0_ARM_MASK)
+		div = S5P_CLK_DIV0_ARM_MASK;
+
+	return parent / (div + 1);
+}

Same as above comment.

Quoted 10 lines
arch/arm/mach-s5pc100/clock.c +10 -0
+
+static int s5pc100_clk_arm_set_rate(struct clk *clk, unsigned long rate)
+{
+	unsigned long parent = clk_get_rate(clk->parent);
+	u32 div;
+	u32 val;
+
+	if (rate < parent / (S5P_CLK_DIV0_ARM_MASK + 1))
+		return -EINVAL;
+

arch/arm/mach-s5pc100/clock.c static struct clk clk_pcm_cd1 = { · line 445

Quoted 10 lines
arch/arm/mach-s5pc100/clock.c +10 -0
+	rate = clk_round_rate(clk, rate);
+	div = clk_get_rate(clk->parent) / rate;
+
+	val = __raw_readl(S5P_CLK_DIV0);
+	val &= S5P_CLK_DIV0_ARM_MASK;
+	val |= (div - 1);
+	__raw_writel(val, S5P_CLK_DIV0);
+
+	return 0;
+}

Same.

arch/arm/mach-s5pc100/clock.c static struct clk clk_pcm_cd1 = { · line 455

Quoted 10 lines
arch/arm/mach-s5pc100/clock.c +10 -0
+
+static struct clk_ops s5pc100_armclk_ops = {
+	.get_rate	= s5pc100_clk_arm_get_rate,
+	.set_rate	= s5pc100_clk_arm_set_rate,
+	.round_rate	= s5pc100_clk_arm_round_rate,
+};
+
+static int s5pc100_clk_d00_ctrl(struct clk *clk, int enable)
+{
+	return s5p_gatectrl(S5P_CLKGATE_D00, clk, enable);

Oh, ok. I commented about this at your 1st patch.
Anyway looks good.

Quoted 70 lines
arch/arm/mach-s5pc100/clock.c +58 -1
+}
+
+static int s5pc100_clk_d01_ctrl(struct clk *clk, int enable)
+{
+	return s5p_gatectrl(S5P_CLKGATE_D01, clk, enable);
+}
+
+static int s5pc100_clk_d02_ctrl(struct clk *clk, int enable)
+{
+	return s5p_gatectrl(S5P_CLKGATE_D02, clk, enable);
+}
+
+static int s5pc100_clk_d10_ctrl(struct clk *clk, int enable)
+{
+	return s5p_gatectrl(S5P_CLKGATE_D10, clk, enable);
+}
+
+static int s5pc100_clk_d11_ctrl(struct clk *clk, int enable)
+{
+	return s5p_gatectrl(S5P_CLKGATE_D11, clk, enable);
+}
+
+static int s5pc100_clk_d12_ctrl(struct clk *clk, int enable)
+{
+	return s5p_gatectrl(S5P_CLKGATE_D12, clk, enable);
+}
+
+static int s5pc100_clk_d13_ctrl(struct clk *clk, int enable)
+{
+	return s5p_gatectrl(S5P_CLKGATE_D13, clk, enable);
+}
+
+static int s5pc100_clk_d14_ctrl(struct clk *clk, int enable)
+{
+	return s5p_gatectrl(S5P_CLKGATE_D14, clk, enable);
+}
+
+static int s5pc100_clk_d15_ctrl(struct clk *clk, int enable)
+{
+	return s5p_gatectrl(S5P_CLKGATE_D15, clk, enable);
+}
+
+static int s5pc100_clk_d20_ctrl(struct clk *clk, int enable)
+{
+	return s5p_gatectrl(S5P_CLKGATE_D20, clk, enable);
+}
+
+static int s5pc100_sclk0_ctrl(struct clk *clk, int enable)
+{
+	return s5p_gatectrl(S5P_SCLKGATE0, clk, enable);
+}
+
+static int s5pc100_sclk1_ctrl(struct clk *clk, int enable)
+{
+	return s5p_gatectrl(S5P_SCLKGATE1, clk, enable);
+}
+
 static struct clk *clkset_audio0_list[] = {
 	&clk_mout_epll.clk,
 	&clk_dout_mpll,
@@ -583,7 +622,7 @@ static struct clk *clkset_lcd_fimc_list[] = {
 	&clk_mout_epll.clk,
 	&clk_dout_mpll,
 	&clk_mout_hpll.clk,
-	&clk_vclk_54m,
+	&clk_54m,
 };
 
 static struct clksrc_sources clkset_lcd_fimc = {

arch/arm/mach-s5pc100/clock.c void __init_or_cpufreq s5pc100_setup_clocks(void) · line 817

Quoted 6 lines
arch/arm/mach-s5pc100/clock.c +3 -0
@@ -773,6 +812,11 @@ void __init_or_cpufreq s5pc100_setup_clocks(void)
 	unsigned int ptr;
 	u32 clkdiv0, clkdiv1;
 
+	/* Hook callbacks to base clocks */
+	clk_48m.enable = s5pc100_clk_48m_ctrl;
+	clk_arm.ops = &s5pc100_armclk_ops;

No need to register ops member.

Quoted 7 lines

...

Marek,

Actually, need to modify many part to fit new clock scheme. For example, to use clksrc_clk is easily to handle clock.

I thought I covered most of the changes. Probably only the armclk related functions and a cleanup in s5pc100/mach/regs-clock.h are left and these can be easily fixed.

Quoted 2 lines

S.LSI already made the patch for C100 clock changing which is using clksrc_clk structure. So may I submit it?

Could you compare your version with the final version that is created by my patch series? I don't think that there will be many differences there.

Best regards
--
Marek Szyprowski
Samsung Poland R&D Center

#17 lore raw

PATCH 5/16 ARM: S5PC100: new clocks definition

Quoted 8 lines · Marek Szyprowski

Hello,

Quoted 3 lines · Kukjin Kim
Quoted 2 lines · Marek Szyprowski

Prepare for moving support for S5PC100 SoC to plat-s5p framework (part

3).

Quoted 1 line
Quoted 1 line
Quoted 1 line

This patch adds all clocks from plat-s5pc1xx/clocks.c and removes all

the

Quoted 13 lines
Quoted 13 lines
Quoted 10 lines

code that can be reused from plat-s5p/clock.c.

---
 arch/arm/mach-s5pc100/clock.c                      |  841
++++++++++++++++----
 .../include/mach}/regs-clock.h                     |    0
 2 files changed, 703 insertions(+), 138 deletions(-)
 copy arch/arm/{plat-s5pc1xx/include/plat =>

mach-s5pc100/include/mach}/regs-

Quoted 2 lines

clock.h (100%)

(snip)

Quoted 10 lines
Quoted 5 lines

Marek,

Actually, need to modify many part to fit new clock scheme. For example, to use clksrc_clk is easily to handle clock.

I thought I covered most of the changes. Probably only the armclk related functions and a cleanup in s5pc100/mach/regs-clock.h are left and these can be easily fixed.

Quoted 7 lines
Quoted 2 lines

S.LSI already made the patch for C100 clock changing which is using clksrc_clk structure. So may I submit it?

Could you compare your version with the final version that is created by my patch series? I don't think that there will be many differences there.

There are defined clock source of C100 available clock in SYS.LSI patch like clocks defined by CLK_SRC1 register.
SYS.LSI has covered all possible C100 clocks in our patch.

So I think SYS.LSI patch provides more functionality based on Ben Dooks' new clock scheme.

How about check/review it after my submitting?

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.

#18 lore raw

PATCH 5/16 ARM: S5PC100: new clocks definition

Hello,

Quoted 19 lines · Kukjin Kim

...

Quoted 10 lines
Quoted 5 lines

Marek,

Actually, need to modify many part to fit new clock scheme. For example, to use clksrc_clk is easily to handle clock.

I thought I covered most of the changes. Probably only the armclk related functions and a cleanup in s5pc100/mach/regs-clock.h are left and these can be easily fixed.

Quoted 7 lines
Quoted 2 lines

S.LSI already made the patch for C100 clock changing which is using clksrc_clk structure. So may I submit it?

Could you compare your version with the final version that is created by my patch series? I don't think that there will be many differences there.

Quoted 4 lines

There are defined clock source of C100 available clock in SYS.LSI patch like
clocks defined by CLK_SRC1 register.
SYS.LSI has covered all possible C100 clocks in our patch.

So this is rather a question of general policy about the clocks. Do we really need to define them even if no driver would use it? I'm not convinced. On the other hand defining all clocks now may reduce the driver development time in the future.

Quoted 4 lines

So I think SYS.LSI patch provides more functionality based on Ben Dooks' new clock scheme.

How about check/review it after my submitting?

Maybe it would be possible to adapt it in such a way that it would be an extension to the clocks defined by my patch series?

Ben, what do you think? Which way should we go?

Best regards
--
Marek Szyprowski
Samsung Poland R&D Center

#19 lore raw

PATCH 5/16 ARM: S5PC100: new clocks definition

Quoted 28 lines · Marek Szyprowski

Hello,

Quoted 19 lines · Kukjin Kim

...

Quoted 10 lines
Quoted 5 lines

Marek,

Actually, need to modify many part to fit new clock scheme. For example, to use clksrc_clk is easily to handle clock.

I thought I covered most of the changes. Probably only the armclk related functions and a cleanup in s5pc100/mach/regs-clock.h are left and these can be easily fixed.

Quoted 7 lines
Quoted 2 lines

S.LSI already made the patch for C100 clock changing which is using clksrc_clk structure. So may I submit it?

Could you compare your version with the final version that is created by my patch series? I don't think that there will be many differences there.

Quoted 4 lines

There are defined clock source of C100 available clock in SYS.LSI patch like
clocks defined by CLK_SRC1 register.
SYS.LSI has covered all possible C100 clocks in our patch.

Quoted 4 lines

So this is rather a question of general policy about the clocks. Do we really need to define them even if no driver would use it? I'm not convinced. On the other hand defining all clocks now may reduce the driver development time in the future.

It is always better for a code to support as many cases as possible. After all, we wouldn't want to wait for weeks until the clock support for a device to
appear upstream for a Maintainer to accept the device driver in his tree. Would we?

#20 lore raw

PATCH 5/16 ARM: S5PC100: new clocks definition

In reply to Marek Szyprowski
Quoted 28 lines · Marek Szyprowski

Hello,

Quoted 19 lines · Kukjin Kim

...

Quoted 10 lines
Quoted 5 lines

Marek,

Actually, need to modify many part to fit new clock scheme. For example, to use clksrc_clk is easily to handle clock.

I thought I covered most of the changes. Probably only the armclk related functions and a cleanup in s5pc100/mach/regs-clock.h are left and these can be easily fixed.

Quoted 7 lines
Quoted 2 lines

S.LSI already made the patch for C100 clock changing which is using clksrc_clk structure. So may I submit it?

Could you compare your version with the final version that is created by my patch series? I don't think that there will be many differences there.

Quoted 4 lines

There are defined clock source of C100 available clock in SYS.LSI patch like
clocks defined by CLK_SRC1 register.
SYS.LSI has covered all possible C100 clocks in our patch.

Quoted 4 lines

So this is rather a question of general policy about the clocks. Do we really need to define them even if no driver would use it? I'm not convinced. On the other hand defining all clocks now may reduce the driver development time in the future.

I've not really got a policy on this, when adding new SoC support I much prefer to see what is needed to get the archicture core up before adding lots of clocks.

Quoted 9 lines
Quoted 4 lines

So I think SYS.LSI patch provides more functionality based on Ben Dooks' new clock scheme.

How about check/review it after my submitting?

Maybe it would be possible to adapt it in such a way that it would be an extension to the clocks defined by my patch series?

Ben, what do you think? Which way should we go?

Signature · 4 lines
Ben

Q:      What's a light-year?
A:      One-third less calories than a regular year.
#21 lore raw

PATCH 5/16 ARM: S5PC100: new clocks definition

In reply to Kukjin Kim

Hello,

Quoted 244 lines · Kukjin Kim
Quoted 5 lines · Marek Szyprowski

Prepare for moving support for S5PC100 SoC to plat-s5p framework (part 3). This patch adds all clocks from plat-s5pc1xx/clocks.c and removes all the code that can be reused from plat-s5p/clock.c.

Quoted 8 lines
---
 arch/arm/mach-s5pc100/clock.c                      |  841
++++++++++++++++----
 .../include/mach}/regs-clock.h                     |    0
 2 files changed, 703 insertions(+), 138 deletions(-)
 copy arch/arm/{plat-s5pc1xx/include/plat =>

mach-s5pc100/include/mach}/regs-

arch/arm/mach-

Quoted 3 lines

clock.h (100%)

arch/arm/mach- renamed from arch/arm/mach-s5pc100/clock.c +0 -0

s5pc100/clock.c

Quoted 225 lines

index c391c61..75fa9be 100644

arch/arm/mach-s5pc100/clock.c +55 -123
@@ -16,59 +16,22 @@
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/list.h>
-#include <linux/errno.h>
 #include <linux/err.h>
 #include <linux/clk.h>
-#include <linux/sysdev.h>
 #include <linux/io.h>
 
-#include <mach/hardware.h>
 #include <mach/map.h>
 
 #include <plat/cpu-freq.h>
-
-#include <plat/regs-clock.h>
+#include <mach/regs-clock.h>
 #include <plat/clock.h>
-#include <plat/clock-clksrc.h>
 #include <plat/cpu.h>
 #include <plat/pll.h>
-#include <plat/devs.h>
+#include <plat/s5p-clock.h>
+#include <plat/clock-clksrc.h>
 #include <plat/s5pc100.h>
 
-/* fin_apll, fin_mpll and fin_epll are all the same clock, which we call
- * ext_xtal_mux for want of an actual name from the manual.
-*/
-
-static struct clk clk_ext_xtal_mux = {
-	.name		= "ext_xtal",
-	.id		= -1,
-};
-
-#define clk_fin_apll clk_ext_xtal_mux
-#define clk_fin_mpll clk_ext_xtal_mux
-#define clk_fin_epll clk_ext_xtal_mux
-#define clk_fin_hpll clk_ext_xtal_mux
-
-#define clk_fout_mpll	clk_mpll
-#define clk_vclk_54m	clk_54m
-
-/* APLL */
-static struct clk clk_fout_apll = {
-	.name		= "fout_apll",
-	.id		= -1,
-	.rate		= 27000000,
-};
-
-static struct clk *clk_src_apll_list[] = {
-	[0] = &clk_fin_apll,
-	[1] = &clk_fout_apll,
-};
-
-static struct clksrc_sources clk_src_apll = {
-	.sources	= clk_src_apll_list,
-	.nr_sources	= ARRAY_SIZE(clk_src_apll_list),
-};
-
+/* APLL Mux output clock */
 static struct clksrc_clk clk_mout_apll = {
 	.clk	= {
 		.name		= "mout_apll",
@@ -98,63 +61,6 @@ static struct clk clk_dout_apll = {
 	},
 };
 
-static unsigned long s5pc100_clk_arm_get_rate(struct clk *clk)
-{
-	unsigned long rate = clk_get_rate(clk->parent);
-	unsigned int ratio;
-
-	ratio = __raw_readl(S5P_CLK_DIV0) & S5P_CLK_DIV0_ARM_MASK;
-	ratio >>= S5P_CLK_DIV0_ARM_SHIFT;
-
-	return rate / (ratio + 1);
-}
-
-static unsigned long s5pc100_clk_arm_round_rate(struct clk *clk,
-						unsigned long rate)
-{
-	unsigned long parent = clk_get_rate(clk->parent);
-	u32 div;
-
-	if (parent < rate)
-		return rate;
-
-	div = (parent / rate) - 1;
-	if (div > S5P_CLK_DIV0_ARM_MASK)
-		div = S5P_CLK_DIV0_ARM_MASK;
-
-	return parent / (div + 1);
-}
-
-static int s5pc100_clk_arm_set_rate(struct clk *clk, unsigned long rate)
-{
-	unsigned long parent = clk_get_rate(clk->parent);
-	u32 div;
-	u32 val;
-
-	if (rate < parent / (S5P_CLK_DIV0_ARM_MASK + 1))
-		return -EINVAL;
-
-	rate = clk_round_rate(clk, rate);
-	div = clk_get_rate(clk->parent) / rate;
-
-	val = __raw_readl(S5P_CLK_DIV0);
-	val &= S5P_CLK_DIV0_ARM_MASK;
-	val |= (div - 1);
-	__raw_writel(val, S5P_CLK_DIV0);
-
-	return 0;
-}
-
-static struct clk clk_arm = {
-	.name		= "armclk",
-	.id		= -1,
-	.parent		= &clk_dout_apll,
-	.ops		= &(struct clk_ops) {
-		.get_rate	= s5pc100_clk_arm_get_rate,
-		.set_rate	= s5pc100_clk_arm_set_rate,
-		.round_rate	= s5pc100_clk_arm_round_rate,
-	},
-};
 
 static unsigned long s5pc100_clk_dout_d0_bus_get_rate(struct clk *clk)
 {
@@ -217,16 +123,6 @@ static struct clk clk_dout_apll2 = {
 };
 
 /* MPLL */
-static struct clk *clk_src_mpll_list[] = {
-	[0] = &clk_fin_mpll,
-	[1] = &clk_fout_mpll,
-};
-
-static struct clksrc_sources clk_src_mpll = {
-	.sources	= clk_src_mpll_list,
-	.nr_sources	= ARRAY_SIZE(clk_src_mpll_list),
-};
-
 static struct clksrc_clk clk_mout_mpll = {
 	.clk = {
 		.name		= "mout_mpll",
@@ -385,21 +281,6 @@ static struct clk clk_dout_mpll = {
 };
 
 /* EPLL */
-static struct clk clk_fout_epll = {
-	.name		= "fout_epll",
-	.id		= -1,
-};
-
-static struct clk *clk_src_epll_list[] = {
-	[0] = &clk_fin_epll,
-	[1] = &clk_fout_epll,
-};
-
-static struct clksrc_sources clk_src_epll = {
-	.sources	= clk_src_epll_list,
-	.nr_sources	= ARRAY_SIZE(clk_src_epll_list),
-};
-
 static struct clksrc_clk clk_mout_epll = {
 	.clk	= {
 		.name		= "mout_epll",
@@ -471,6 +352,164 @@ static struct clk clk_pcm_cd1 = {
 	.id		= -1,
 };
 
+static struct clk clk_hd0 = {
+	.name		= "hclkd0",
+	.id		= -1,
+	.rate		= 0,
+	.parent		= NULL,
+	.ctrlbit	= 0,
+	.ops		= &clk_ops_def_setrate,
+};
+
+static struct clk clk_pd0 = {
+	.name		= "pclkd0",
+	.id		= -1,
+	.rate		= 0,
+	.parent		= NULL,
+	.ctrlbit	= 0,
+	.ops		= &clk_ops_def_setrate,
+};
+
+static struct clk clk_54m = {
+	.name		= "clk_54m",
+	.id		= -1,
+	.rate		= 54000000,
+};
+
+
+static int s5pc100_clk_48m_ctrl(struct clk *clk, int enable)
+{
+	unsigned long flags;
+	u32 val;
+
+	/* can't rely on clock lock, this register has other usages */
+	local_irq_save(flags);
+
+	val = __raw_readl(S5P_CLK_SRC1);
+	if (enable)
+		val |= S5P_CLK_SRC1_CLK48M_MASK;
+	else
+		val &= ~S5P_CLK_SRC1_CLK48M_MASK;
+
+	__raw_writel(val, S5P_CLK_SRC1);
+	local_irq_restore(flags);
+
+	return 0;
+}
+
+static unsigned long s5pc100_clk_arm_get_rate(struct clk *clk)
+{
+	unsigned long rate = clk_get_rate(clk->parent);
+	unsigned int ratio;
+
+	ratio = __raw_readl(S5P_CLK_DIV0) & S5P_CLK_DIV0_ARM_MASK;
Quoted 8 lines

arch/arm/mach-s5pc100/clock.c static struct clk clk_pcm_cd1 = { · line 409

Quoted 4 lines
arch/arm/mach-s5pc100/clock.c +4 -0
+	ratio >>= S5P_CLK_DIV0_ARM_SHIFT;
+
+	return rate / (ratio + 1);
+}

This is not correct. If you use structure of clksrc_clk, you can handle this
easily. So no need this function.

clksrc_clk cannot be used for armclk. You define it in a similar way in mach-s5p6440/clock.c

Quoted 11 lines

...

arch/arm/mach-s5pc100/clock.c void __init_or_cpufreq s5pc100_setup_clocks(void) · line 817

Quoted 7 lines
arch/arm/mach-s5pc100/clock.c +3 -0
@@ -773,6 +812,11 @@ void __init_or_cpufreq s5pc100_setup_clocks(void)
 	unsigned int ptr;
 	u32 clkdiv0, clkdiv1;
 
+	/* Hook callbacks to base clocks */
+	clk_48m.enable = s5pc100_clk_48m_ctrl;
+	clk_arm.ops = &s5pc100_armclk_ops;

No need to register ops member.

Please check mach-s5p6440/clock.c, it is done exactly the same way.

Best regards
--
Marek Szyprowski
Samsung Poland R&D Center

#22 lore raw

PATCH 5/16 ARM: S5PC100: new clocks definition

Quoted 8 lines · Marek Szyprowski

Hello,

Quoted 3 lines · Kukjin Kim
Quoted 2 lines · Marek Szyprowski

Prepare for moving support for S5PC100 SoC to plat-s5p framework (part

3).

Quoted 1 line
Quoted 1 line
Quoted 1 line

This patch adds all clocks from plat-s5pc1xx/clocks.c and removes all

the

Quoted 13 lines
Quoted 13 lines
Quoted 10 lines

code that can be reused from plat-s5p/clock.c.

---
 arch/arm/mach-s5pc100/clock.c                      |  841
++++++++++++++++----
 .../include/mach}/regs-clock.h                     |    0
 2 files changed, 703 insertions(+), 138 deletions(-)
 copy arch/arm/{plat-s5pc1xx/include/plat =>

mach-s5pc100/include/mach}/regs-

Quoted 2 lines

clock.h (100%)

(snip)

Quoted 14 lines
Quoted 4 lines

This is not correct. If you use structure of clksrc_clk, you can handle this
easily. So no need this function.

clksrc_clk cannot be used for armclk. You define it in a similar way in mach-s5p6440/clock.c

Quoted 6 lines

...

Quoted 4 lines
arch/arm/mach-s5pc100/clock.c +0 -0
@@ -773,6 +812,11 @@ void __init_or_cpufreq s5pc100_setup_clocks(void)
 	unsigned int ptr;
 	u32 clkdiv0, clkdiv1;
 
Quoted 8 lines
Quoted 5 lines

arch/arm/mach-s5pc100/clock.c void __init_or_cpufreq s5pc100_setup_clocks(void) · line 817

Quoted 3 lines
arch/arm/mach-s5pc100/clock.c +3 -0
+	/* Hook callbacks to base clocks */
+	clk_48m.enable = s5pc100_clk_48m_ctrl;
+	clk_arm.ops = &s5pc100_armclk_ops;

No need to register ops member.

Please check mach-s5p6440/clock.c, it is done exactly the same way.

Hi,

The new 6440 clock patches use clksrc_clk struct.
For armclk also. And many other clocks also.

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.

#23 lore raw

PATCH 6/16 ARM: Samsung: move S5PC100 support from plat-s5pc1xx to plat-s5p framework

In reply to Marek Szyprowski

This patch moves S5PC100 SoC support to plat-s5p framework. Only cpu, clocks and basic interrupts are supported. Other peripherals will be moved by separate patches.

---
 arch/arm/Kconfig                                   |    9 +-
 arch/arm/Makefile                                  |    3 +-
 arch/arm/mach-s5pc100/Kconfig                      |   23 +---
 arch/arm/mach-s5pc100/Makefile                     |    8 +-
 arch/arm/mach-s5pc100/cpu.c                        |   65 ++++-----
 arch/arm/mach-s5pc100/include/mach/debug-macro.S   |    6 +-
 arch/arm/mach-s5pc100/include/mach/entry-macro.S   |    8 +-
 arch/arm/mach-s5pc100/include/mach/irqs.h          |   99 ++++++++++++-
 arch/arm/mach-s5pc100/include/mach/map.h           |  151 ++++---------------
 arch/arm/mach-s5pc100/include/mach/regs-clock.h    |    7 +-
 arch/arm/mach-s5pc100/include/mach/regs-irq.h      |    5 -
 arch/arm/mach-s5pc100/include/mach/system.h        |    7 +-
 arch/arm/mach-s5pc100/include/mach/tick.h          |    4 +-
 .../s5pc100-init.c => mach-s5pc100/init.c}         |    5 +-
 arch/arm/mach-s5pc100/mach-smdkc100.c              |   19 ++--
 arch/arm/mach-s5pc100/setup-i2c0.c                 |   25 ++++
 arch/arm/plat-s5p/Kconfig                          |    2 +-
 arch/arm/plat-s5p/cpu.c                            |   10 ++
 arch/arm/plat-s5p/include/plat/s5pc100.h           |   33 +++++
 arch/arm/plat-samsung/Kconfig                      |    2 +-
 20 files changed, 267 insertions(+), 224 deletions(-)
 rename arch/arm/{plat-s5pc1xx/s5pc100-init.c => mach-s5pc100/init.c} (73%)
 create mode 100644 arch/arm/mach-s5pc100/setup-i2c0.c
 create mode 100644 arch/arm/plat-s5p/include/plat/s5pc100.h
arch/arm/Kconfig +3 -6
index c5408bf..d05f7de 100644
@@ -694,14 +694,14 @@ config ARCH_S5P6442
 	help
 	  Samsung S5P6442 CPU based systems
 
-config ARCH_S5PC1XX
-	bool "Samsung S5PC1XX"
+config ARCH_S5PC100
+	bool "Samsung S5PC100"
 	select GENERIC_GPIO
 	select HAVE_CLK
 	select CPU_V7
 	select ARM_L1_CACHE_SHIFT_6
 	help
-	  Samsung S5PC1XX series based systems
+	  Samsung S5PC100 series based systems
 
 config ARCH_S5PV210
 	bool "Samsung S5PV210/S5PC110"
@@ -885,7 +885,6 @@ source "arch/arm/mach-sa1100/Kconfig"
 source "arch/arm/plat-samsung/Kconfig"
 source "arch/arm/plat-s3c24xx/Kconfig"
 source "arch/arm/plat-s5p/Kconfig"
-source "arch/arm/plat-s5pc1xx/Kconfig"
 
 if ARCH_S3C2410
 source "arch/arm/mach-s3c2400/Kconfig"
@@ -903,9 +902,7 @@ source "arch/arm/mach-s5p6440/Kconfig"
 
 source "arch/arm/mach-s5p6442/Kconfig"
 
-if ARCH_S5PC1XX
 source "arch/arm/mach-s5pc100/Kconfig"
-endif
 
 source "arch/arm/mach-s5pv210/Kconfig"
 
arch/arm/Makefile +1 -2
index ed820e7..245ce3b 100644
@@ -165,7 +165,7 @@ machine-$(CONFIG_ARCH_S3C24A0)		:= s3c24a0
 machine-$(CONFIG_ARCH_S3C64XX)		:= s3c64xx
 machine-$(CONFIG_ARCH_S5P6440)		:= s5p6440
 machine-$(CONFIG_ARCH_S5P6442)		:= s5p6442
-machine-$(CONFIG_ARCH_S5PC1XX)		:= s5pc100
+machine-$(CONFIG_ARCH_S5PC100)		:= s5pc100
 machine-$(CONFIG_ARCH_S5PV210)		:= s5pv210
 machine-$(CONFIG_ARCH_SA1100)		:= sa1100
 machine-$(CONFIG_ARCH_SHARK)		:= shark
@@ -190,7 +190,6 @@ plat-$(CONFIG_PLAT_NOMADIK)	:= nomadik
 plat-$(CONFIG_PLAT_ORION)	:= orion
 plat-$(CONFIG_PLAT_PXA)		:= pxa
 plat-$(CONFIG_PLAT_S3C24XX)	:= s3c24xx samsung
-plat-$(CONFIG_PLAT_S5PC1XX)	:= s5pc1xx samsung
 plat-$(CONFIG_PLAT_S5P)		:= s5p samsung
 
 ifeq ($(CONFIG_ARCH_EBSA110),y)
arch/arm/mach-s5pc100/Kconfig +5 -18
index 27ec167..54c83a4 100644
@@ -2,33 +2,20 @@
 #	Byungho Min <[email protected]>
 #
 # Licensed under GPLv2
-
 # Configuration options for the S5PC100 CPU
 
+if ARCH_S5PC100
+
 config CPU_S5PC100
 	bool
-	select CPU_S5PC100_INIT
-	select CPU_S5PC100_CLOCK
+	select PLAT_S5P
 	help
 	  Enable S5PC100 CPU support
 
-config S5PC100_SETUP_SDHCI
-        bool
-        select S5PC1XX_SETUP_SDHCI_GPIO
-        help
-          Internal helper functions for S5PC100 based SDHCI systems
-
 config MACH_SMDKC100
 	bool "SMDKC100"
 	select CPU_S5PC100
-	select S3C_DEV_FB
-	select S3C_DEV_I2C1
-	select S3C_DEV_HSMMC
-	select S3C_DEV_HSMMC1
-	select S3C_DEV_HSMMC2
-	select S5PC1XX_SETUP_I2C0
-	select S5PC1XX_SETUP_I2C1
-	select S5PC1XX_SETUP_FB_24BPP
-	select S5PC100_SETUP_SDHCI
 	help
 	  Machine support for the Samsung SMDKC100
+
+endif
arch/arm/mach-s5pc100/Makefile +3 -5
index 809ff10..8371cfb 100644
@@ -11,11 +11,9 @@ obj-				:=
 
 # Core support for S5PC100 system
 
-obj-$(CONFIG_CPU_S5PC100)	+= cpu.o
-
-# Helper and device support
-
-obj-$(CONFIG_S5PC100_SETUP_SDHCI)       += setup-sdhci.o
+obj-$(CONFIG_CPU_S5PC100)	+= cpu.o init.o clock.o
+obj-$(CONFIG_CPU_S5PC100)	+= setup-i2c0.o
 
 # machine support
+
 obj-$(CONFIG_MACH_SMDKC100)	+= mach-smdkc100.o
arch/arm/mach-s5pc100/cpu.c +31 -34

122 lines not on this page · raw message

arch/arm/mach-s5pc100/include/mach/debug-macro.S +4 -2
index e181f57..70e02e9 100644
@@ -22,12 +22,14 @@
 	 * aligned and add in the offset when we load the value here.
 	 */
 
-	.macro addruart, rx, tmp
+	.macro addruart, rx, rtmp
 		mrc	p15, 0, \rx, c1, c0
 		tst	\rx, #1
 		ldreq	\rx, = S3C_PA_UART
-		ldrne	\rx, = (S3C_VA_UART + S3C_PA_UART & 0xfffff)
+		ldrne	\rx, = S3C_VA_UART
+#if CONFIG_DEBUG_S3C_UART != 0
 		add	\rx, \rx, #(0x400 * CONFIG_DEBUG_S3C_UART)
+#endif
 	.endm
 
 /* include the reset of the code which will do the work, we're only
arch/arm/mach-s5pc100/include/mach/entry-macro.S +4 -4
index 6713193..ba76af0 100644
@@ -20,7 +20,7 @@
 	.endm
 
 	.macro	get_irqnr_preamble, base, tmp
-	ldr	\base, =S3C_VA_VIC0
+	ldr	\base, =VA_VIC0
 	.endm
 
 	.macro	arch_ret_to_user, tmp1, tmp2
@@ -29,18 +29,18 @@
 	.macro	get_irqnr_and_base, irqnr, irqstat, base, tmp
 
 	@ check the vic0
-	mov	\irqnr, # S3C_IRQ_OFFSET + 31
+	mov	\irqnr, # S5P_IRQ_OFFSET + 31
 	ldr	\irqstat, [ \base, # VIC_IRQ_STATUS ]
 	teq	\irqstat, #0
 
 	@ otherwise try vic1
-	addeq	\tmp, \base, #(S3C_VA_VIC1 - S3C_VA_VIC0)
+	addeq	\tmp, \base, #(VA_VIC1 - VA_VIC0)
 	addeq	\irqnr, \irqnr, #32
 	ldreq	\irqstat, [ \tmp, # VIC_IRQ_STATUS ]
 	teqeq	\irqstat, #0
 
 	@ otherwise try vic2
-	addeq	\tmp, \base, #(S3C_VA_VIC2 - S3C_VA_VIC0)
+	addeq	\tmp, \base, #(VA_VIC2 - VA_VIC0)
 	addeq	\irqnr, \irqnr, #32
 	ldreq	\irqstat, [ \tmp, # VIC_IRQ_STATUS ]
 	teqeq	\irqstat, #0
arch/arm/mach-s5pc100/include/mach/irqs.h +94 -5

103 lines not on this page · raw message

arch/arm/mach-s5pc100/include/mach/map.h +32 -119

176 lines not on this page · raw message

arch/arm/mach-s5pc100/include/mach/regs-clock.h +5 -2
index 5c9c4cb..7f4c142 100644
@@ -13,8 +13,11 @@
 #ifndef __PLAT_REGS_CLOCK_H
 #define __PLAT_REGS_CLOCK_H __FILE__
 
-#define S5P_CLKREG(x)		(S5PC1XX_VA_CLK + (x))
-#define S5PC100_REG_OTHERS(x)	(S5PC1XX_VA_CLK_OTHER + (x))
+#include <mach/map.h>
+
+#define S5P_CLKREG(x)		(S3C_VA_SYS + (x))
+
+#define S5PC100_REG_OTHERS(x)	(S5PC100_VA_OTHERS + (x))
 
 /* s5pc100 register for clock */
 #define S5P_APLL_LOCK		S5P_CLKREG(0x00)
arch/arm/mach-s5pc100/include/mach/regs-irq.h +0 -5
index 751ac15..d19f33e 100644
@@ -16,9 +16,4 @@
 #include <mach/map.h>
 #include <asm/hardware/vic.h>
 
-/* interrupt controller */
-#define S5PC1XX_VIC0REG(x)          		((x) + S5PC1XX_VA_VIC(0))
-#define S5PC1XX_VIC1REG(x)          		((x) + S5PC1XX_VA_VIC(1))
-#define S5PC1XX_VIC2REG(x)         		((x) + S5PC1XX_VA_VIC(2))
-
 #endif /* __ASM_ARCH_REGS_IRQ_H */
arch/arm/mach-s5pc100/include/mach/system.h +2 -5
index 09aea4d..b247e8b 100644
@@ -13,14 +13,11 @@
 
 #include <linux/io.h>
 #include <mach/map.h>
-#include <plat/regs-clock.h>
-
-void (*s5pc1xx_idle)(void);
+#include <mach/regs-clock.h>
 
 static void arch_idle(void)
 {
-	if (s5pc1xx_idle)
-		s5pc1xx_idle();
+	/* nothing here yet */
 }
 
 static void arch_reset(char mode, const char *cmd)
arch/arm/mach-s5pc100/include/mach/tick.h +2 -2
index f338c9e..20f6873 100644
@@ -20,8 +20,8 @@
  */
 static inline u32 s3c24xx_ostimer_pending(void)
 {
-	u32 pend = __raw_readl(S3C_VA_VIC0 + VIC_RAW_STATUS);
-	return pend & 1 << (IRQ_TIMER4_VIC - S5PC1XX_IRQ_VIC0(0));
+	u32 pend = __raw_readl(VA_VIC0 + VIC_RAW_STATUS);
+	return pend & (1 << (IRQ_TIMER4_VIC - S5P_IRQ_VIC0(0)));
 }
 
 #define TICK_MAX	(0xffffffff)
arch/arm/mach-s5pc100/init.c renamed from arch/arm/plat-s5pc1xx/s5pc100-init.c +1 -4
similarity index 73%
rename from arch/arm/plat-s5pc1xx/s5pc100-init.c
rename to arch/arm/mach-s5pc100/init.c
index c587108..b852cbc 100644
@@ -3,7 +3,6 @@
  * Copyright 2009 Samsung Electronics Co.
  *      Byungho Min <[email protected]>
  *
- * S5PC100 - CPU initialisation (common with other S5PC1XX chips)
  *
  * 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
@@ -19,9 +18,7 @@
 #include <plat/s5pc100.h>
 
 /* uart registration process */
-
 void __init s5pc100_common_init_uarts(struct s3c2410_uartcfg *cfg, int no)
 {
-	/* The driver name is s3c6400-uart to reuse s3c6400_serial_drv  */
-	s3c24xx_init_uartdevs("s3c6400-uart", s5pc1xx_uart_resources, cfg, no);
+	s3c24xx_init_uartdevs("s3c6400-uart", s5p_uart_resources, cfg, no);
 }
arch/arm/mach-s5pc100/mach-smdkc100.c +10 -9
index ae3c52c..8dec25f 100644
@@ -34,8 +34,6 @@
 #include <asm/mach-types.h>
 
 #include <plat/regs-serial.h>
-#include <plat/gpio-cfg.h>
-#include <plat/regs-gpio.h>
 
 #include <plat/clock.h>
 #include <plat/devs.h>
@@ -79,6 +77,7 @@ static struct s3c2410_uartcfg smdkc100_uartcfgs[] __initdata = {
 	},
 };
 
+#if 0
 /* I2C0 */
 static struct i2c_board_info i2c_devs0[] __initdata = {
 };
@@ -140,10 +139,10 @@ static struct s3c_fb_platdata smdkc100_lcd_pdata __initdata = {
 	.vidcon1	= VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC,
 	.setup_gpio	= s5pc100_fb_gpio_setup_24bpp,
 };
-
-static struct map_desc smdkc100_iodesc[] = {};
+#endif
 
 static struct platform_device *smdkc100_devices[] __initdata = {
+#if 0
 	&s3c_device_i2c0,
 	&s3c_device_i2c1,
 	&s3c_device_fb,
@@ -151,17 +150,19 @@ static struct platform_device *smdkc100_devices[] __initdata = {
 	&s3c_device_hsmmc1,
 	&s3c_device_hsmmc2,
 	&smdkc100_lcd_powerdev,
+#endif
 };
 
 static void __init smdkc100_map_io(void)
 {
-	s5pc1xx_init_io(smdkc100_iodesc, ARRAY_SIZE(smdkc100_iodesc));
+	s5p_init_io(NULL, 0, S5P_VA_CHIPID);
 	s3c24xx_init_clocks(12000000);
 	s3c24xx_init_uarts(smdkc100_uartcfgs, ARRAY_SIZE(smdkc100_uartcfgs));
 }
 
 static void __init smdkc100_machine_init(void)
 {
+#if 0
 	/* I2C */
 	s3c_i2c0_set_platdata(NULL);
 	s3c_i2c1_set_platdata(NULL);
@@ -175,14 +176,14 @@ static void __init smdkc100_machine_init(void)
 	gpio_request(S5PC100_GPH0(6), "GPH0");
 	smdkc100_lcd_power_set(&smdkc100_lcd_power_data, 0);
 	platform_add_devices(smdkc100_devices, ARRAY_SIZE(smdkc100_devices));
+#endif
 }
 
 MACHINE_START(SMDKC100, "SMDKC100")
 	/* Maintainer: Byungho Min <[email protected]> */
-	.phys_io	= S5PC100_PA_UART & 0xfff00000,
-	.io_pg_offst	= (((u32)S5PC1XX_VA_UART) >> 18) & 0xfffc,
-	.boot_params	= S5PC100_PA_SDRAM + 0x100,
-
+	.phys_io	= S3C_PA_UART & 0xfff00000,
+	.io_pg_offst	= (((u32)S3C_VA_UART) >> 18) & 0xfffc,
+	.boot_params	= S5P_PA_SDRAM + 0x100,
 	.init_irq	= s5pc100_init_irq,
 	.map_io		= smdkc100_map_io,
 	.init_machine	= smdkc100_machine_init,
arch/arm/mach-s5pc100/setup-i2c0.c new file +25 -0
new file mode 100644
index 0000000..8f65e58
@@ -0,0 +1,25 @@
+/* linux/arch/arm/mach-s5pc100/setup-i2c0.c
+ *
+ * Copyright (c) 2009 Samsung Electronics Co., Ltd.
+ *		http://www.samsung.com/
+ *
+ * I2C0 GPIO configuration.
+ *
+ * Based on plat-s3c64xx/setup-i2c0.c
+ *
+ * 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.
+*/
+
+#include <linux/kernel.h>
+#include <linux/types.h>
+
+struct platform_device; /* don't need the contents */
+
+#include <plat/iic.h>
+
+void s3c_i2c0_cfg_gpio(struct platform_device *dev)
+{
+	/* Will be populated later */
+}
arch/arm/plat-s5p/Kconfig +1 -1
index 92bd756..189be6e 100644
@@ -7,7 +7,7 @@
 
 config PLAT_S5P
 	bool
-	depends on (ARCH_S5P6440 || ARCH_S5P6442 || ARCH_S5PV210)
+	depends on (ARCH_S5P6440 || ARCH_S5P6442 || ARCH_S5PC100 || ARCH_S5PV210)
 	default y
 	select ARM_VIC
 	select NO_IOPORT
arch/arm/plat-s5p/cpu.c +10 -0
index f92e5de..75cb8c3 100644
@@ -19,12 +19,14 @@
 #include <plat/cpu.h>
 #include <plat/s5p6440.h>
 #include <plat/s5p6442.h>
+#include <plat/s5pc100.h>
 #include <plat/s5pv210.h>
 
 /* table of supported CPUs */
 
 static const char name_s5p6440[] = "S5P6440";
 static const char name_s5p6442[] = "S5P6442";
+static const char name_s5pc100[] = "S5PC100";
 static const char name_s5pv210[] = "S5PV210/S5PC110";
 
 static struct cpu_table cpu_ids[] __initdata = {
@@ -45,6 +47,14 @@ static struct cpu_table cpu_ids[] __initdata = {
 		.init		= s5p6442_init,
 		.name		= name_s5p6442,
 	}, {
+		.idcode		= 0x43100000,
+		.idmask		= 0xfffff000,
+		.map_io		= s5pc100_map_io,
+		.init_clocks	= s5pc100_init_clocks,
+		.init_uarts	= s5pc100_init_uarts,
+		.init		= s5pc100_init,
+		.name		= name_s5pc100,
+	}, {
 		.idcode		= 0x43110000,
 		.idmask		= 0xfffff000,
 		.map_io		= s5pv210_map_io,
arch/arm/plat-s5p/include/plat/s5pc100.h new file +33 -0
new file mode 100644
index 0000000..5f6099d
@@ -0,0 +1,33 @@
+/* arch/arm/plat-s5p/include/plat/s5pc100.h
+ *
+ * Copyright (c) 2010 Samsung Electronics Co., Ltd.
+ *		http://www.samsung.com/
+ *
+ * Header file for s5pc100 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 S5PC100 related SoCs */
+
+extern void s5pc100_common_init_uarts(struct s3c2410_uartcfg *cfg, int no);
+extern void s5pc100_register_clocks(void);
+extern void s5pc100_setup_clocks(void);
+
+#ifdef CONFIG_CPU_S5PC100
+
+extern  int s5pc100_init(void);
+extern void s5pc100_init_irq(void);
+extern void s5pc100_map_io(void);
+extern void s5pc100_init_clocks(int xtal);
+
+#define s5pc100_init_uarts s5pc100_common_init_uarts
+
+#else
+#define s5pc100_init_clocks NULL
+#define s5pc100_init_uarts NULL
+#define s5pc100_map_io NULL
+#define s5pc100_init NULL
+#endif
arch/arm/plat-samsung/Kconfig +1 -1
index 59cae62..74fe5d6 100644
@@ -6,7 +6,7 @@
 
 config PLAT_SAMSUNG
 	bool
-	depends on ARCH_S3C2410 || ARCH_S3C24A0 || ARCH_S3C64XX || ARCH_S5PC1XX
+	depends on ARCH_S3C2410 || ARCH_S3C24A0 || ARCH_S3C64XX
 	select NO_IOPORT
 	default y
 	help
Signature · 1 line
1.6.4
#24 lore raw

PATCH 6/16 ARM: Samsung: move S5PC100 support from plat-s5pc1xx to plat-s5p framework

Quoted 2 lines · Marek Szyprowski

This patch moves S5PC100 SoC support to plat-s5p framework. Only cpu,

clocks

Quoted 1 line

and basic interrupts are supported. Other peripherals will be moved by

separate

Quoted 4 lines

patches.

Quoted 10 lines
---
 arch/arm/Kconfig                                   |    9 +-
 arch/arm/Makefile                                  |    3 +-
 arch/arm/mach-s5pc100/Kconfig                      |   23 +---
 arch/arm/mach-s5pc100/Makefile                     |    8 +-
 arch/arm/mach-s5pc100/cpu.c                        |   65 ++++-----
 arch/arm/mach-s5pc100/include/mach/debug-macro.S   |    6 +-
 arch/arm/mach-s5pc100/include/mach/entry-macro.S   |    8 +-
 arch/arm/mach-s5pc100/include/mach/irqs.h          |   99 ++++++++++++-
 arch/arm/mach-s5pc100/include/mach/map.h           |  151

++++---------------

Quoted 47 lines
 arch/arm/mach-s5pc100/include/mach/regs-clock.h    |    7 +-
 arch/arm/mach-s5pc100/include/mach/regs-irq.h      |    5 -
 arch/arm/mach-s5pc100/include/mach/system.h        |    7 +-
 arch/arm/mach-s5pc100/include/mach/tick.h          |    4 +-
 .../s5pc100-init.c => mach-s5pc100/init.c}         |    5 +-
 arch/arm/mach-s5pc100/mach-smdkc100.c              |   19 ++--
 arch/arm/mach-s5pc100/setup-i2c0.c                 |   25 ++++
 arch/arm/plat-s5p/Kconfig                          |    2 +-
 arch/arm/plat-s5p/cpu.c                            |   10 ++
 arch/arm/plat-s5p/include/plat/s5pc100.h           |   33 +++++
 arch/arm/plat-samsung/Kconfig                      |    2 +-
 20 files changed, 267 insertions(+), 224 deletions(-)
 rename arch/arm/{plat-s5pc1xx/s5pc100-init.c => mach-s5pc100/init.c} (73%)
 create mode 100644 arch/arm/mach-s5pc100/setup-i2c0.c
 create mode 100644 arch/arm/plat-s5p/include/plat/s5pc100.h
arch/arm/Kconfig +3 -4
index c5408bf..d05f7de 100644
@@ -694,14 +694,14 @@ config ARCH_S5P6442
 	help
 	  Samsung S5P6442 CPU based systems
 
-config ARCH_S5PC1XX
-	bool "Samsung S5PC1XX"
+config ARCH_S5PC100
+	bool "Samsung S5PC100"
 	select GENERIC_GPIO
 	select HAVE_CLK
 	select CPU_V7
 	select ARM_L1_CACHE_SHIFT_6
 	help
-	  Samsung S5PC1XX series based systems
+	  Samsung S5PC100 series based systems
 
 config ARCH_S5PV210
 	bool "Samsung S5PV210/S5PC110"
@@ -885,7 +885,6 @@ source "arch/arm/mach-sa1100/Kconfig"
 source "arch/arm/plat-samsung/Kconfig"
 source "arch/arm/plat-s3c24xx/Kconfig"
 source "arch/arm/plat-s5p/Kconfig"
-source "arch/arm/plat-s5pc1xx/Kconfig"
 
 if ARCH_S3C2410
 source "arch/arm/mach-s3c2400/Kconfig"

arch/arm/Kconfig source "arch/arm/mach-s5p6440/Kconfig" · line 907

Quoted 8 lines
arch/arm/Kconfig +0 -2
@@ -903,9 +902,7 @@ source "arch/arm/mach-s5p6440/Kconfig"
 
 source "arch/arm/mach-s5p6442/Kconfig"
 
-if ARCH_S5PC1XX
 source "arch/arm/mach-s5pc100/Kconfig"
-endif
 
 source "arch/arm/mach-s5pv210/Kconfig"

Looks good.

Quoted 15 lines
arch/arm/Makefile +1 -1
index ed820e7..245ce3b 100644
@@ -165,7 +165,7 @@ machine-$(CONFIG_ARCH_S3C24A0)		:= s3c24a0
 machine-$(CONFIG_ARCH_S3C64XX)		:= s3c64xx
 machine-$(CONFIG_ARCH_S5P6440)		:= s5p6440
 machine-$(CONFIG_ARCH_S5P6442)		:= s5p6442
-machine-$(CONFIG_ARCH_S5PC1XX)		:= s5pc100
+machine-$(CONFIG_ARCH_S5PC100)		:= s5pc100
 machine-$(CONFIG_ARCH_S5PV210)		:= s5pv210
 machine-$(CONFIG_ARCH_SA1100)		:= sa1100
 machine-$(CONFIG_ARCH_SHARK)		:= shark

arch/arm/Makefile plat-$(CONFIG_PLAT_NOMADIK) := nomadik · line 195

Quoted 7 lines
arch/arm/Makefile +0 -1
@@ -190,7 +190,6 @@ plat-$(CONFIG_PLAT_NOMADIK)	:= nomadik
 plat-$(CONFIG_PLAT_ORION)	:= orion
 plat-$(CONFIG_PLAT_PXA)		:= pxa
 plat-$(CONFIG_PLAT_S3C24XX)	:= s3c24xx samsung
-plat-$(CONFIG_PLAT_S5PC1XX)	:= s5pc1xx samsung
 plat-$(CONFIG_PLAT_S5P)		:= s5p samsung
 
 ifeq ($(CONFIG_ARCH_EBSA110),y)

Looks good.

Quoted 33 lines
arch/arm/mach-s5pc100/Kconfig +3 -12
index 27ec167..54c83a4 100644
@@ -2,33 +2,20 @@
 #	Byungho Min <[email protected]>
 #
 # Licensed under GPLv2
-
 # Configuration options for the S5PC100 CPU
 
+if ARCH_S5PC100
+
 config CPU_S5PC100
 	bool
-	select CPU_S5PC100_INIT
-	select CPU_S5PC100_CLOCK
+	select PLAT_S5P
 	help
 	  Enable S5PC100 CPU support
 
-config S5PC100_SETUP_SDHCI
-        bool
-        select S5PC1XX_SETUP_SDHCI_GPIO
-        help
-          Internal helper functions for S5PC100 based SDHCI systems
-
 config MACH_SMDKC100
 	bool "SMDKC100"
 	select CPU_S5PC100
-	select S3C_DEV_FB
-	select S3C_DEV_I2C1
-	select S3C_DEV_HSMMC

arch/arm/mach-s5pc100/Kconfig line 21

Quoted 10 lines
arch/arm/mach-s5pc100/Kconfig +2 -6
-	select S3C_DEV_HSMMC1
-	select S3C_DEV_HSMMC2
-	select S5PC1XX_SETUP_I2C0
-	select S5PC1XX_SETUP_I2C1
-	select S5PC1XX_SETUP_FB_24BPP
-	select S5PC100_SETUP_SDHCI
 	help
 	  Machine support for the Samsung SMDKC100
+
+endif

Looks good.

Review

Quoted 1 line
(quoted diff) +0 -0

b/arch/arm/mach-s5pc100/Makefile

Quoted 8 lines

index 809ff10..8371cfb 100644

arch/arm/mach-s5pc100/Makefile +0 -1
@@ -11,11 +11,9 @@ obj-				:=
 
 # Core support for S5PC100 system
 
-obj-$(CONFIG_CPU_S5PC100)	+= cpu.o

arch/arm/mach-s5pc100/Makefile obj- := · line 19

Quoted 10 lines
arch/arm/mach-s5pc100/Makefile +3 -4
-
-# Helper and device support
-
-obj-$(CONFIG_S5PC100_SETUP_SDHCI)       += setup-sdhci.o
+obj-$(CONFIG_CPU_S5PC100)	+= cpu.o init.o clock.o
+obj-$(CONFIG_CPU_S5PC100)	+= setup-i2c0.o
 
 # machine support
+
 obj-$(CONFIG_MACH_SMDKC100)	+= mach-smdkc100.o

Looks good.

Quoted 105 lines
arch/arm/mach-s5pc100/cpu.c +26 -30
index d79e757..7d65b61 100644
@@ -22,47 +22,51 @@
 #include <linux/serial_core.h>
 #include <linux/platform_device.h>
 
-#include <asm/proc-fns.h>
-
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 #include <asm/mach/irq.h>
 
+#include <asm/proc-fns.h>
+
 #include <mach/hardware.h>
 #include <mach/map.h>
 #include <asm/irq.h>
 
-#include <plat/cpu-freq.h>
 #include <plat/regs-serial.h>
-#include <plat/regs-power.h>
+#include <mach/regs-clock.h>
 
 #include <plat/cpu.h>
 #include <plat/devs.h>
 #include <plat/clock.h>
-#include <plat/sdhci.h>
-#include <plat/iic-core.h>
 #include <plat/s5pc100.h>
 
 /* Initial IO mappings */
 
 static struct map_desc s5pc100_iodesc[] __initdata = {
+	{
+		.virtual	= (unsigned long)S5P_VA_SYSTIMER,
+		.pfn		= __phys_to_pfn(S5PC100_PA_SYSTIMER),
+		.length		= SZ_16K,
+		.type		= MT_DEVICE,
+	}, {
+		.virtual	= (unsigned long)VA_VIC2,
+		.pfn		= __phys_to_pfn(S5PC100_PA_VIC2),
+		.length		= SZ_16K,
+		.type		= MT_DEVICE,
+	}, {
+		.virtual	= (unsigned long)S5PC100_VA_OTHERS,
+		.pfn		= __phys_to_pfn(S5PC100_PA_OTHERS),
+		.length		= SZ_4K,
+		.type		= MT_DEVICE,
+	}
 };
 
 static void s5pc100_idle(void)
 {
-	unsigned long tmp;
-
-	tmp = __raw_readl(S5PC100_PWR_CFG);
-	tmp &= ~S5PC100_PWRCFG_CFG_DEEP_IDLE;
-	tmp &= ~S5PC100_PWRCFG_CFG_WFI_MASK;
-	tmp |= S5PC100_PWRCFG_CFG_WFI_DEEP_IDLE;
-	__raw_writel(tmp, S5PC100_PWR_CFG);
+	if (!need_resched())
+		cpu_do_idle();
 
-	tmp = __raw_readl(S5PC100_OTHERS);
-	tmp |= S5PC100_PMU_INT_DISABLE;
-	__raw_writel(tmp, S5PC100_OTHERS);
-
-	cpu_do_idle();
+	local_irq_enable();
 }
 
 /* s5pc100_map_io
@@ -73,35 +77,27 @@ static void s5pc100_idle(void)
 void __init s5pc100_map_io(void)
 {
 	iotable_init(s5pc100_iodesc, ARRAY_SIZE(s5pc100_iodesc));
-
-	/* initialise device information early */
-	s5pc100_default_sdhci0();
-	s5pc100_default_sdhci1();
-	s5pc100_default_sdhci2();
-
-	/* the i2c devices are directly compatible with s3c2440 */
-	s3c_i2c0_setname("s3c2440-i2c");
-	s3c_i2c1_setname("s3c2440-i2c");
 }
 
 void __init s5pc100_init_clocks(int xtal)
 {
-	printk(KERN_DEBUG "%s: initialising clocks\n", __func__);
+	printk(KERN_DEBUG "%s: initializing clocks\n", __func__);
+
 	s3c24xx_register_baseclocks(xtal);
-	s5pc1xx_register_clocks();
+	s5p_register_clocks(xtal);
 	s5pc100_register_clocks();
 	s5pc100_setup_clocks();
 }
 
 void __init s5pc100_init_irq(void)
 {
-	u32 vic_valid[] = {~0, ~0, ~0};
+	u32 vic[] = {~0, ~0, ~0};

arch/arm/mach-s5pc100/cpu.c static void s5pc100_idle(void) · line 102

Quoted 10 lines
arch/arm/mach-s5pc100/cpu.c +2 -2
 
 	/* VIC0, VIC1, and VIC2 are fully populated. */
-	s5pc1xx_init_irq(vic_valid, ARRAY_SIZE(vic_valid));
+	s5p_init_irq(vic, ARRAY_SIZE(vic));
 }
 
-struct sysdev_class s5pc100_sysclass = {
+static struct sysdev_class s5pc100_sysclass = {
 	.name	= "s5pc100-core",
 };

No need to add static attribute for other driver.

Review

Quoted 15 lines
arch/arm/mach-s5pc100/cpu.c +3 -2
@@ -118,9 +114,10 @@ core_initcall(s5pc100_core_init);
 
 int __init s5pc100_init(void)
 {
-	printk(KERN_DEBUG "S5PC100: Initialising architecture\n");
+	printk(KERN_INFO "S5PC100: Initializing architecture\n");
 
-	s5pc1xx_idle = s5pc100_idle;
+	/* set idle function */
+	pm_idle = s5pc100_idle;
 
 	return sysdev_register(&s5pc100_sysdev);
 }
(quoted diff) +0 -0

b/arch/arm/mach-

Review

Quoted 22 lines

s5pc100/include/mach/debug-macro.S
index e181f57..70e02e9 100644

arch/arm/mach-s5pc100/include/mach/debug-macro.S +4 -2
@@ -22,12 +22,14 @@
 	 * aligned and add in the offset when we load the value here.
 	 */
 
-	.macro addruart, rx, tmp
+	.macro addruart, rx, rtmp
 		mrc	p15, 0, \rx, c1, c0
 		tst	\rx, #1
 		ldreq	\rx, = S3C_PA_UART
-		ldrne	\rx, = (S3C_VA_UART + S3C_PA_UART & 0xfffff)
+		ldrne	\rx, = S3C_VA_UART
+#if CONFIG_DEBUG_S3C_UART != 0
 		add	\rx, \rx, #(0x400 * CONFIG_DEBUG_S3C_UART)
+#endif
 	.endm
 
 /* include the reset of the code which will do the work, we're only
(quoted diff) +0 -0

b/arch/arm/mach-

arch/arm/mach-s5pc100/include/mach/entry-macro.S

Quoted 4 lines

s5pc100/include/mach/entry-macro.S
index 6713193..ba76af0 100644

arch/arm/mach-s5pc100/include/mach/entry-macro.S +0 -0

How about changing S5PC100 from S5PC1XX the header in this entry-macro.S

Quoted 157 lines
arch/arm/mach-s5pc100/include/mach/entry-macro.S +4 -4
@@ -20,7 +20,7 @@
 	.endm
 
 	.macro	get_irqnr_preamble, base, tmp
-	ldr	\base, =S3C_VA_VIC0
+	ldr	\base, =VA_VIC0
 	.endm
 
 	.macro	arch_ret_to_user, tmp1, tmp2
@@ -29,18 +29,18 @@
 	.macro	get_irqnr_and_base, irqnr, irqstat, base, tmp
 
 	@ check the vic0
-	mov	\irqnr, # S3C_IRQ_OFFSET + 31
+	mov	\irqnr, # S5P_IRQ_OFFSET + 31
 	ldr	\irqstat, [ \base, # VIC_IRQ_STATUS ]
 	teq	\irqstat, #0
 
 	@ otherwise try vic1
-	addeq	\tmp, \base, #(S3C_VA_VIC1 - S3C_VA_VIC0)
+	addeq	\tmp, \base, #(VA_VIC1 - VA_VIC0)
 	addeq	\irqnr, \irqnr, #32
 	ldreq	\irqstat, [ \tmp, # VIC_IRQ_STATUS ]
 	teqeq	\irqstat, #0
 
 	@ otherwise try vic2
-	addeq	\tmp, \base, #(S3C_VA_VIC2 - S3C_VA_VIC0)
+	addeq	\tmp, \base, #(VA_VIC2 - VA_VIC0)
 	addeq	\irqnr, \irqnr, #32
 	ldreq	\irqstat, [ \tmp, # VIC_IRQ_STATUS ]
 	teqeq	\irqstat, #0
arch/arm/mach- renamed from arch/arm/mach-s5pc100/include/mach/irqs.h +0 -0

s5pc100/include/mach/irqs.h
index b53fa48..6789eeb 100644

arch/arm/mach-s5pc100/include/mach/irqs.h +94 -5
@@ -11,9 +11,98 @@
 
 #include <plat/irqs.h>
 
-/* LCD */
-#define IRQ_LCD_FIFO		IRQ_LCD0
-#define IRQ_LCD_VSYNC		IRQ_LCD1
-#define IRQ_LCD_SYSTEM		IRQ_LCD2
+/* VIC0: system, DMA, timer */
+#define IRQ_EINT16_31		S5P_IRQ_VIC0(16)
+#define IRQ_BATF		S5P_IRQ_VIC0(17)
+#define IRQ_MDMA		S5P_IRQ_VIC0(18)
+#define IRQ_PDMA0		S5P_IRQ_VIC0(19)
+#define IRQ_PDMA1		S5P_IRQ_VIC0(20)
+#define IRQ_TIMER0_VIC		S5P_IRQ_VIC0(21)
+#define IRQ_TIMER1_VIC		S5P_IRQ_VIC0(22)
+#define IRQ_TIMER2_VIC		S5P_IRQ_VIC0(23)
+#define IRQ_TIMER3_VIC		S5P_IRQ_VIC0(24)
+#define IRQ_TIMER4_VIC		S5P_IRQ_VIC0(25)
+#define IRQ_SYSTIMER		S5P_IRQ_VIC0(26)
+#define IRQ_WDT			S5P_IRQ_VIC0(27)
+#define IRQ_RTC_ALARM		S5P_IRQ_VIC0(28)
+#define IRQ_RTC_TIC		S5P_IRQ_VIC0(29)
+#define IRQ_GPIOINT		S5P_IRQ_VIC0(30)
 
-#endif /* __ASM_ARCH_IRQ_H */
+/* VIC1: ARM, power, memory, connectivity */
+#define IRQ_CORTEX0		S5P_IRQ_VIC1(0)
+#define IRQ_CORTEX1		S5P_IRQ_VIC1(1)
+#define IRQ_CORTEX2		S5P_IRQ_VIC1(2)
+#define IRQ_CORTEX3		S5P_IRQ_VIC1(3)
+#define IRQ_CORTEX4		S5P_IRQ_VIC1(4)
+#define IRQ_IEMAPC		S5P_IRQ_VIC1(5)
+#define IRQ_IEMIEC		S5P_IRQ_VIC1(6)
+#define IRQ_ONENAND		S5P_IRQ_VIC1(7)
+#define IRQ_NFC			S5P_IRQ_VIC1(8)
+#define IRQ_CFC			S5P_IRQ_VIC1(9)
+#define IRQ_UART0		S5P_IRQ_VIC1(10)
+#define IRQ_UART1		S5P_IRQ_VIC1(11)
+#define IRQ_UART2		S5P_IRQ_VIC1(12)
+#define IRQ_UART3		S5P_IRQ_VIC1(13)
+#define IRQ_IIC			S5P_IRQ_VIC1(14)
+#define IRQ_SPI0		S5P_IRQ_VIC1(15)
+#define IRQ_SPI1		S5P_IRQ_VIC1(16)
+#define IRQ_SPI2		S5P_IRQ_VIC1(17)
+#define IRQ_IRDA		S5P_IRQ_VIC1(18)
+#define IRQ_CAN0		S5P_IRQ_VIC1(19)
+#define IRQ_CAN1		S5P_IRQ_VIC1(20)
+#define IRQ_HSIRX		S5P_IRQ_VIC1(21)
+#define IRQ_HSITX		S5P_IRQ_VIC1(22)
+#define IRQ_UHOST		S5P_IRQ_VIC1(23)
+#define IRQ_OTG			S5P_IRQ_VIC1(24)
+#define IRQ_MSM			S5P_IRQ_VIC1(25)
+#define IRQ_HSMMC0		S5P_IRQ_VIC1(26)
+#define IRQ_HSMMC1		S5P_IRQ_VIC1(27)
+#define IRQ_HSMMC2		S5P_IRQ_VIC1(28)
+#define IRQ_MIPICSI		S5P_IRQ_VIC1(29)
+#define IRQ_MIPIDSI		S5P_IRQ_VIC1(30)
+
+/* VIC2: multimedia, audio, security */
+#define IRQ_LCD0		S5P_IRQ_VIC2(0)
+#define IRQ_LCD1		S5P_IRQ_VIC2(1)
+#define IRQ_LCD2		S5P_IRQ_VIC2(2)
+#define IRQ_LCD3		S5P_IRQ_VIC2(3)
+#define IRQ_ROTATOR		S5P_IRQ_VIC2(4)
+#define IRQ_FIMC0		S5P_IRQ_VIC2(5)
+#define IRQ_FIMC1		S5P_IRQ_VIC2(6)
+#define IRQ_FIMC2		S5P_IRQ_VIC2(7)
+#define IRQ_JPEG		S5P_IRQ_VIC2(8)
+#define IRQ_2D			S5P_IRQ_VIC2(9)
+#define IRQ_3D			S5P_IRQ_VIC2(10)
+#define IRQ_MIXER		S5P_IRQ_VIC2(11)
+#define IRQ_HDMI		S5P_IRQ_VIC2(12)
+#define IRQ_IIC1		S5P_IRQ_VIC2(13)
+#define IRQ_MFC			S5P_IRQ_VIC2(14)
+#define IRQ_TVENC		S5P_IRQ_VIC2(15)
+#define IRQ_I2S0		S5P_IRQ_VIC2(16)
+#define IRQ_I2S1		S5P_IRQ_VIC2(17)
+#define IRQ_I2S2		S5P_IRQ_VIC2(18)
+#define IRQ_AC97		S5P_IRQ_VIC2(19)
+#define IRQ_PCM0		S5P_IRQ_VIC2(20)
+#define IRQ_PCM1		S5P_IRQ_VIC2(21)
+#define IRQ_SPDIF		S5P_IRQ_VIC2(22)
+#define IRQ_ADC			S5P_IRQ_VIC2(23)
+#define IRQ_PENDN		S5P_IRQ_VIC2(24)
+#define IRQ_TC			IRQ_PENDN
+#define IRQ_KEYPAD		S5P_IRQ_VIC2(25)
+#define IRQ_CG			S5P_IRQ_VIC2(26)
+#define IRQ_SEC			S5P_IRQ_VIC2(27)
+#define IRQ_SECRX		S5P_IRQ_VIC2(28)
+#define IRQ_SECTX		S5P_IRQ_VIC2(29)
+#define IRQ_SDMIRQ		S5P_IRQ_VIC2(30)
+#define IRQ_SDMFIQ		S5P_IRQ_VIC2(31)
+#define IRQ_VIC_END		S5P_IRQ_VIC2(31)
+
+#define S5P_IRQ_EINT_BASE	(IRQ_VIC_END + 1)
+
+#define IRQ_EINT(x)             ((x) < 16 ? S5P_IRQ_VIC0(x) : \
+					(S5P_IRQ_EINT_BASE + (x)-16))
+/* Set the default NR_IRQS */
+
+#define NR_IRQS		(IRQ_EINT(31) + 1)
+
+#endif /* __ASM_ARCH_IRQS_H */
arch/arm/mach- renamed from arch/arm/mach-s5pc100/include/mach/map.h +0 -0

s5pc100/include/mach/map.h
index 4681ebe..a79b09f 100644

arch/arm/mach-s5pc100/include/mach/map.h +1 -3
@@ -3,9 +3,7 @@
  * Copyright 2009 Samsung Electronics Co.
  *	Byungho Min <[email protected]>
  *
- * Based on mach-s3c6400/include/mach/map.h
- *
- * S5PC1XX - Memory map definitions
+ * S5PC100 - Memory map 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

arch/arm/mach-s5pc100/include/mach/map.h line 24

Quoted 10 lines
arch/arm/mach-s5pc100/include/mach/map.h +1 -5
@@ -16,135 +14,50 @@
 #define __ASM_ARCH_MAP_H __FILE__
 
 #include <plat/map-base.h>
+#include <plat/map-s5p.h>
 
-/*
- * map-base.h has already defined virtual memory address
- * S3C_VA_IRQ		S3C_ADDR(0x00000000)	irq controller(s)
- * S3C_VA_SYS		S3C_ADDR(0x00100000)	system control
- * S3C_VA_MEM		S3C_ADDR(0x00200000)	system control (not

used)

Quoted 149 lines
arch/arm/mach-s5pc100/include/mach/map.h +27 -104
- * S3C_VA_TIMER		S3C_ADDR(0x00300000)	timer block
- * S3C_VA_WATCHDOG	S3C_ADDR(0x00400000)	watchdog
- * S3C_VA_UART		S3C_ADDR(0x01000000)	UART
- *
- * S5PC100 specific virtual memory address can be defined here
- * S5PC1XX_VA_GPIO	S3C_ADDR(0x00500000)	GPIO
- *
- */
-
-/* Chip ID */
 #define S5PC100_PA_CHIPID	(0xE0000000)
-#define S5PC1XX_PA_CHIPID	S5PC100_PA_CHIPID
-#define S5PC1XX_VA_CHIPID	S3C_VA_SYS
-
-/* System */
-#define S5PC100_PA_CLK		(0xE0100000)
-#define S5PC100_PA_CLK_OTHER	(0xE0200000)
-#define S5PC100_PA_PWR		(0xE0108000)
-#define S5PC1XX_PA_CLK		S5PC100_PA_CLK
-#define S5PC1XX_PA_PWR		S5PC100_PA_PWR
-#define S5PC1XX_PA_CLK_OTHER	S5PC100_PA_CLK_OTHER
-#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)
-
-/* GPIO */
-#define S5PC100_PA_GPIO		(0xE0300000)
-#define S5PC1XX_PA_GPIO		S5PC100_PA_GPIO
-#define S5PC1XX_VA_GPIO		S3C_ADDR(0x00500000)
-
-/* Interrupt */
-#define S5PC100_PA_VIC		(0xE4000000)
-#define S5PC100_VA_VIC		S3C_VA_IRQ
-#define S5PC100_PA_VIC_OFFSET	0x100000
-#define S5PC100_VA_VIC_OFFSET	0x10000
-#define S5PC1XX_PA_VIC(x)	(S5PC100_PA_VIC + ((x) *
 S5PC100_PA_VIC_OFFSET))
-#define S5PC1XX_VA_VIC(x)	(S5PC100_VA_VIC + ((x) *
 S5PC100_VA_VIC_OFFSET))
-
-/* DMA */
-#define S5PC100_PA_MDMA		(0xE8100000)
-#define S5PC100_PA_PDMA0	(0xE9000000)
-#define S5PC100_PA_PDMA1	(0xE9200000)
-
-/* Timer */
-#define S5PC100_PA_TIMER	(0xEA000000)
-#define S5PC1XX_PA_TIMER	S5PC100_PA_TIMER
-#define S5PC1XX_VA_TIMER	S3C_VA_TIMER
+#define S5P_PA_CHIPID		S5PC100_PA_CHIPID
 
-/* RTC */
-#define S5PC100_PA_RTC		(0xEA300000)
+#define S5PC100_PA_SYSCON	(0xE0100000)
+#define S5P_PA_SYSCON		S5PC100_PA_SYSCON
 
-/* UART */
-#define S5PC100_PA_UART		(0xEC000000)
-#define S5PC1XX_PA_UART		S5PC100_PA_UART
-#define S5PC1XX_VA_UART		S3C_VA_UART
+#define S5PC100_PA_OTHERS	(0xE0200000)
+#define S5PC100_VA_OTHERS	(S3C_VA_SYS + 0x10000)
 
-/* I2C */
-#define S5PC100_PA_I2C		(0xEC100000)
-#define S5PC100_PA_I2C1		(0xEC200000)
 
-/* USB HS OTG */
-#define S5PC100_PA_USB_HSOTG	(0xED200000)
-#define S5PC100_PA_USB_HSPHY	(0xED300000)
+#define S5PC100_PA_GPIO		(0xE0300000)
+#define S5P_PA_GPIO		S5PC100_PA_GPIO
+
+#define S5PC100_PA_VIC0		(0xE4000000)
+#define S5P_PA_VIC0		S5PC100_PA_VIC0
+
+#define S5PC100_PA_VIC1		(0xE4100000)
+#define S5P_PA_VIC1		S5PC100_PA_VIC1
 
-/* SD/MMC */
-#define S5PC100_PA_HSMMC(x)	(0xED800000 + ((x) * 0x100000))
-#define S5PC100_PA_HSMMC0	S5PC100_PA_HSMMC(0)
-#define S5PC100_PA_HSMMC1	S5PC100_PA_HSMMC(1)
-#define S5PC100_PA_HSMMC2	S5PC100_PA_HSMMC(2)
+#define S5PC100_PA_VIC2		(0xE4200000)
+#define S5P_PA_VIC2		S5PC100_PA_VIC2
 
-/* LCD */
-#define S5PC100_PA_FB		(0xEE000000)
+#define S5PC100_PA_TIMER	(0xEA000000)
+#define S5P_PA_TIMER		S5PC100_PA_TIMER
 
-/* Multimedia */
-#define S5PC100_PA_G2D		(0xEE800000)
-#define S5PC100_PA_JPEG		(0xEE500000)
-#define S5PC100_PA_ROTATOR	(0xEE100000)
-#define S5PC100_PA_G3D		(0xEF000000)
+#define S5PC100_PA_SYSTIMER	(0xEA100000)
 
-/* I2S */
-#define S5PC100_PA_I2S0		(0xF2000000)
-#define S5PC100_PA_I2S1		(0xF2100000)
-#define S5PC100_PA_I2S2		(0xF2200000)
+#define S5PC100_PA_UART		(0xEC000000)
 
-/* KEYPAD */
-#define S5PC100_PA_KEYPAD	(0xF3100000)
+#define S5P_PA_UART0		(S5PC100_PA_UART + 0x0)
+#define S5P_PA_UART1		(S5PC100_PA_UART + 0x400)
+#define S5P_PA_UART2		(S5PC100_PA_UART + 0x800)
+#define S5P_PA_UART3		(S5PC100_PA_UART + 0xC00)
+#define S5P_SZ_UART		SZ_256
 
-/* ADC & TouchScreen */
-#define S5PC100_PA_TSADC	(0xF3000000)
+#define S5PC100_PA_IIC0		(0xEC100000)
 
-/* ETC */
 #define S5PC100_PA_SDRAM	(0x20000000)
-#define S5PC1XX_PA_SDRAM	S5PC100_PA_SDRAM
+#define S5P_PA_SDRAM		S5PC100_PA_SDRAM
 
-/* compatibility defines. */
-#define S3C_PA_RTC		S5PC100_PA_RTC
+/* compatibiltiy defines. */
 #define S3C_PA_UART		S5PC100_PA_UART
-#define S3C_PA_UART0		(S5PC100_PA_UART + 0x0)
-#define S3C_PA_UART1		(S5PC100_PA_UART + 0x400)
-#define S3C_PA_UART2		(S5PC100_PA_UART + 0x800)
-#define S3C_PA_UART3		(S5PC100_PA_UART + 0xC00)
-#define S3C_VA_UART0		(S3C_VA_UART + 0x0)
-#define S3C_VA_UART1		(S3C_VA_UART + 0x400)
-#define S3C_VA_UART2		(S3C_VA_UART + 0x800)
-#define S3C_VA_UART3		(S3C_VA_UART + 0xC00)
-#define S3C_UART_OFFSET		0x400
-#define S3C_VA_UARTx(x)		(S3C_VA_UART + ((x) *
 S3C_UART_OFFSET))
-#define S3C_PA_FB		S5PC100_PA_FB
-#define S3C_PA_G2D		S5PC100_PA_G2D
-#define S3C_PA_G3D		S5PC100_PA_G3D
-#define S3C_PA_JPEG		S5PC100_PA_JPEG
-#define S3C_PA_ROTATOR		S5PC100_PA_ROTATOR
-#define S3C_VA_VIC0		(S3C_VA_IRQ + 0x0)
-#define S3C_VA_VIC1		(S3C_VA_IRQ + 0x10000)
-#define S3C_VA_VIC2		(S3C_VA_IRQ + 0x20000)
-#define S3C_PA_IIC		S5PC100_PA_I2C
-#define S3C_PA_IIC1		S5PC100_PA_I2C1
-#define S3C_PA_USB_HSOTG	S5PC100_PA_USB_HSOTG
-#define S3C_PA_USB_HSPHY	S5PC100_PA_USB_HSPHY

arch/arm/mach-s5pc100/include/mach/map.h line 63

Quoted 10 lines
arch/arm/mach-s5pc100/include/mach/map.h +3 -7
-#define S3C_PA_HSMMC0		S5PC100_PA_HSMMC0
-#define S3C_PA_HSMMC1		S5PC100_PA_HSMMC1
-#define S3C_PA_HSMMC2		S5PC100_PA_HSMMC2
-#define S3C_PA_KEYPAD		S5PC100_PA_KEYPAD
-#define S3C_PA_TSADC		S5PC100_PA_TSADC
-
-#endif /* __ASM_ARCH_C100_MAP_H */
+#define S3C_PA_IIC		S5PC100_PA_IIC0
+
+#endif /* __ASM_ARCH_MAP_H */

Looks good.

Review

Quoted 1 line
(quoted diff) +0 -0

b/arch/arm/mach-

Review

Quoted 72 lines

s5pc100/include/mach/regs-clock.h
index 5c9c4cb..7f4c142 100644

arch/arm/mach-s5pc100/include/mach/regs-clock.h +5 -2
@@ -13,8 +13,11 @@
 #ifndef __PLAT_REGS_CLOCK_H
 #define __PLAT_REGS_CLOCK_H __FILE__
 
-#define S5P_CLKREG(x)		(S5PC1XX_VA_CLK + (x))
-#define S5PC100_REG_OTHERS(x)	(S5PC1XX_VA_CLK_OTHER + (x))
+#include <mach/map.h>
+
+#define S5P_CLKREG(x)		(S3C_VA_SYS + (x))
+
+#define S5PC100_REG_OTHERS(x)	(S5PC100_VA_OTHERS + (x))
 
 /* s5pc100 register for clock */
 #define S5P_APLL_LOCK		S5P_CLKREG(0x00)
arch/arm/mach- renamed from arch/arm/mach-s5pc100/include/mach/regs-irq.h +0 -0

s5pc100/include/mach/regs-irq.h
index 751ac15..d19f33e 100644

arch/arm/mach-s5pc100/include/mach/regs-irq.h +0 -5
@@ -16,9 +16,4 @@
 #include <mach/map.h>
 #include <asm/hardware/vic.h>
 
-/* interrupt controller */
-#define S5PC1XX_VIC0REG(x)          		((x) + S5PC1XX_VA_VIC(0))
-#define S5PC1XX_VIC1REG(x)          		((x) + S5PC1XX_VA_VIC(1))
-#define S5PC1XX_VIC2REG(x)         		((x) + S5PC1XX_VA_VIC(2))
-
 #endif /* __ASM_ARCH_REGS_IRQ_H */
arch/arm/mach- renamed from arch/arm/mach-s5pc100/include/mach/system.h +0 -0

s5pc100/include/mach/system.h
index 09aea4d..b247e8b 100644

arch/arm/mach-s5pc100/include/mach/system.h +2 -5
@@ -13,14 +13,11 @@
 
 #include <linux/io.h>
 #include <mach/map.h>
-#include <plat/regs-clock.h>
-
-void (*s5pc1xx_idle)(void);
+#include <mach/regs-clock.h>
 
 static void arch_idle(void)
 {
-	if (s5pc1xx_idle)
-		s5pc1xx_idle();
+	/* nothing here yet */
 }
 
 static void arch_reset(char mode, const char *cmd)
arch/arm/mach- renamed from arch/arm/mach-s5pc100/include/mach/tick.h +0 -0

s5pc100/include/mach/tick.h
index f338c9e..20f6873 100644

arch/arm/mach-s5pc100/include/mach/tick.h +2 -2
@@ -20,8 +20,8 @@
  */
 static inline u32 s3c24xx_ostimer_pending(void)
 {
-	u32 pend = __raw_readl(S3C_VA_VIC0 + VIC_RAW_STATUS);
-	return pend & 1 << (IRQ_TIMER4_VIC - S5PC1XX_IRQ_VIC0(0));
+	u32 pend = __raw_readl(VA_VIC0 + VIC_RAW_STATUS);
+	return pend & (1 << (IRQ_TIMER4_VIC - S5P_IRQ_VIC0(0)));
 }
 
 #define TICK_MAX	(0xffffffff)
(quoted diff) +0 -0

b/arch/arm/mach-s5pc100/init.c

Quoted 15 lines

similarity index 73%
rename from arch/arm/plat-s5pc1xx/s5pc100-init.c
rename to arch/arm/mach-s5pc100/init.c
index c587108..b852cbc 100644

arch/arm/mach-s5pc100/init.c renamed from arch/arm/plat-s5pc1xx/s5pc100-init.c +0 -1
@@ -3,7 +3,6 @@
  * Copyright 2009 Samsung Electronics Co.
  *      Byungho Min <[email protected]>
  *
- * S5PC100 - CPU initialisation (common with other S5PC1XX chips)
  *
  * 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

arch/arm/mach-s5pc100/init.c line 26

Quoted 8 lines
arch/arm/mach-s5pc100/init.c renamed from arch/arm/plat-s5pc1xx/s5pc100-init.c +0 -3
@@ -19,9 +18,7 @@
 #include <plat/s5pc100.h>
 
 /* uart registration process */
-
 void __init s5pc100_common_init_uarts(struct s3c2410_uartcfg *cfg, int no)
 {
-	/* The driver name is s3c6400-uart to reuse s3c6400_serial_drv  */
-	s3c24xx_init_uartdevs("s3c6400-uart", s5pc1xx_uart_resources, cfg,

no);

Quoted 8 lines
arch/arm/mach-s5pc100/init.c renamed from arch/arm/plat-s5pc1xx/s5pc100-init.c +1 -0
+	s3c24xx_init_uartdevs("s3c6400-uart", s5p_uart_resources, cfg, no);
 }
arch/arm/mach- renamed from arch/arm/mach-s5pc100/mach-smdkc100.c +0 -0

s5pc100/mach-smdkc100.c
index ae3c52c..8dec25f 100644

arch/arm/mach-s5pc100/mach-smdkc100.c line 39

Quoted 8 lines
arch/arm/mach-s5pc100/mach-smdkc100.c +0 -2
@@ -34,8 +34,6 @@
 #include <asm/mach-types.h>
 
 #include <plat/regs-serial.h>
-#include <plat/gpio-cfg.h>
-#include <plat/regs-gpio.h>
 
 #include <plat/clock.h>
 #include <plat/devs.h>

There are definitions like UCON for UART in this file. But those are not used.

arch/arm/mach-s5pc100/mach-smdkc100.c static struct s3c2410_uartcfg smdkc100_uartcfgs[]

Quoted 1 line
arch/arm/mach-s5pc100/mach-smdkc100.c +0 -0
@@ -79,6 +77,7 @@ static struct s3c2410_uartcfg smdkc100_uartcfgs[]

__initdata

arch/arm/mach-s5pc100/mach-smdkc100.c static struct s3c2410_uartcfg smdkc100_uartcfgs[] __initdata = { · line 80

Quoted 5 lines
arch/arm/mach-s5pc100/mach-smdkc100.c +1 -0
 = {
 	},
 };
 
+#if 0

#if 0?

Quoted 4 lines
arch/arm/mach-s5pc100/mach-smdkc100.c +0 -0
 /* I2C0 */
 static struct i2c_board_info i2c_devs0[] __initdata = {

};

arch/arm/mach-s5pc100/mach-smdkc100.c static struct s3c_fb_platdata smdkc100_lcd_pdata · line 146

Quoted 10 lines
arch/arm/mach-s5pc100/mach-smdkc100.c +2 -2
@@ -140,10 +139,10 @@ static struct s3c_fb_platdata smdkc100_lcd_pdata
 __initdata = {
 	.vidcon1	= VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC,
 	.setup_gpio	= s5pc100_fb_gpio_setup_24bpp,
 };
-
-static struct map_desc smdkc100_iodesc[] = {};
+#endif
 
 static struct platform_device *smdkc100_devices[] __initdata = {
+#if 0

?

Review

Quoted 46 lines
arch/arm/mach-s5pc100/mach-smdkc100.c +0 -0
 	&s3c_device_i2c0,
 	&s3c_device_i2c1,
arch/arm/mach-s5pc100/mach-smdkc100.c +3 -1
 	&s3c_device_fb,
@@ -151,17 +150,19 @@ static struct platform_device *smdkc100_devices[]
 __initdata = {
 	&s3c_device_hsmmc1,
 	&s3c_device_hsmmc2,
 	&smdkc100_lcd_powerdev,
+#endif
 };
 
 static void __init smdkc100_map_io(void)
 {
-	s5pc1xx_init_io(smdkc100_iodesc, ARRAY_SIZE(smdkc100_iodesc));
+	s5p_init_io(NULL, 0, S5P_VA_CHIPID);
 	s3c24xx_init_clocks(12000000);
 	s3c24xx_init_uarts(smdkc100_uartcfgs, ARRAY_SIZE(smdkc100_uartcfgs));
 }
 
 static void __init smdkc100_machine_init(void)
 {
+#if 0
 	/* I2C */
 	s3c_i2c0_set_platdata(NULL);
arch/arm/mach-s5pc100/mach-smdkc100.c +4 -4
 	s3c_i2c1_set_platdata(NULL);
@@ -175,14 +176,14 @@ static void __init smdkc100_machine_init(void)
 	gpio_request(S5PC100_GPH0(6), "GPH0");
 	smdkc100_lcd_power_set(&smdkc100_lcd_power_data, 0);
 	platform_add_devices(smdkc100_devices,
 ARRAY_SIZE(smdkc100_devices));
+#endif
 }
 
 MACHINE_START(SMDKC100, "SMDKC100")
 	/* Maintainer: Byungho Min <[email protected]> */
-	.phys_io	= S5PC100_PA_UART & 0xfff00000,
-	.io_pg_offst	= (((u32)S5PC1XX_VA_UART) >> 18) & 0xfffc,
-	.boot_params	= S5PC100_PA_SDRAM + 0x100,
-
+	.phys_io	= S3C_PA_UART & 0xfff00000,
+	.io_pg_offst	= (((u32)S3C_VA_UART) >> 18) & 0xfffc,
+	.boot_params	= S5P_PA_SDRAM + 0x100,
 	.init_irq	= s5pc100_init_irq,
 	.map_io		= smdkc100_map_io,
arch/arm/mach-s5pc100/mach-smdkc100.c +0 -0
 	.init_machine	= smdkc100_machine_init,
(quoted diff) +0 -0

b/arch/arm/mach-s5pc100/setup-

Quoted 21 lines

i2c0.c
new file mode 100644
index 0000000..8f65e58

arch/arm/mach-s5pc100/setup-i2c0.c new file +15 -0
@@ -0,0 +1,25 @@
+/* linux/arch/arm/mach-s5pc100/setup-i2c0.c
+ *
+ * Copyright (c) 2009 Samsung Electronics Co., Ltd.
+ *		http://www.samsung.com/
+ *
+ * I2C0 GPIO configuration.
+ *
+ * Based on plat-s3c64xx/setup-i2c0.c
+ *
+ * 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.
+*/
+
+#include <linux/kernel.h>

arch/arm/mach-s5pc100/setup-i2c0.c line 25

Quoted 10 lines
arch/arm/mach-s5pc100/setup-i2c0.c new file +10 -0
+#include <linux/types.h>
+
+struct platform_device; /* don't need the contents */
+
+#include <plat/iic.h>
+
+void s3c_i2c0_cfg_gpio(struct platform_device *dev)
+{
+	/* Will be populated later */
+}

Yes, plat-s5p/setup-i2c0 file will be moved to machine directory also.

Quoted 60 lines
arch/arm/plat-s5p/Kconfig +1 -1
index 92bd756..189be6e 100644
@@ -7,7 +7,7 @@
 
 config PLAT_S5P
 	bool
-	depends on (ARCH_S5P6440 || ARCH_S5P6442 || ARCH_S5PV210)
+	depends on (ARCH_S5P6440 || ARCH_S5P6442 || ARCH_S5PC100 ||
 ARCH_S5PV210)
 	default y
 	select ARM_VIC
arch/arm/plat-s5p/Kconfig +0 -0
 	select NO_IOPORT
arch/arm/plat-s5p/cpu.c +10 -0
index f92e5de..75cb8c3 100644
@@ -19,12 +19,14 @@
 #include <plat/cpu.h>
 #include <plat/s5p6440.h>
 #include <plat/s5p6442.h>
+#include <plat/s5pc100.h>
 #include <plat/s5pv210.h>
 
 /* table of supported CPUs */
 
 static const char name_s5p6440[] = "S5P6440";
 static const char name_s5p6442[] = "S5P6442";
+static const char name_s5pc100[] = "S5PC100";
 static const char name_s5pv210[] = "S5PV210/S5PC110";
 
 static struct cpu_table cpu_ids[] __initdata = {
@@ -45,6 +47,14 @@ static struct cpu_table cpu_ids[] __initdata = {
 		.init		= s5p6442_init,
 		.name		= name_s5p6442,
 	}, {
+		.idcode		= 0x43100000,
+		.idmask		= 0xfffff000,
+		.map_io		= s5pc100_map_io,
+		.init_clocks	= s5pc100_init_clocks,
+		.init_uarts	= s5pc100_init_uarts,
+		.init		= s5pc100_init,
+		.name		= name_s5pc100,
+	}, {
 		.idcode		= 0x43110000,
 		.idmask		= 0xfffff000,
 		.map_io		= s5pv210_map_io,
arch/arm/plat- renamed from arch/arm/plat-s5p/include/plat/s5pc100.h +0 -0

s5p/include/plat/s5pc100.h
new file mode 100644
index 0000000..5f6099d

arch/arm/plat-s5p/include/plat/s5pc100.h new file +5 -0
@@ -0,0 +1,33 @@
+/* arch/arm/plat-s5p/include/plat/s5pc100.h
+ *
+ * Copyright (c) 2010 Samsung Electronics Co., Ltd.
+ *		http://www.samsung.com/
+ *

arch/arm/plat-s5p/include/plat/s5pc100.h line 15

Quoted 10 lines
arch/arm/plat-s5p/include/plat/s5pc100.h new file +10 -0
+ * Header file for s5pc100 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 S5PC100 related SoCs */
+
+extern void s5pc100_common_init_uarts(struct s3c2410_uartcfg *cfg, int

no);

Quoted 33 lines
arch/arm/plat-s5p/include/plat/s5pc100.h new file +18 -0
+extern void s5pc100_register_clocks(void);
+extern void s5pc100_setup_clocks(void);
+
+#ifdef CONFIG_CPU_S5PC100
+
+extern  int s5pc100_init(void);
+extern void s5pc100_init_irq(void);
+extern void s5pc100_map_io(void);
+extern void s5pc100_init_clocks(int xtal);
+
+#define s5pc100_init_uarts s5pc100_common_init_uarts
+
+#else
+#define s5pc100_init_clocks NULL
+#define s5pc100_init_uarts NULL
+#define s5pc100_map_io NULL
+#define s5pc100_init NULL
+#endif
arch/arm/plat-samsung/Kconfig +0 -1
index 59cae62..74fe5d6 100644
@@ -6,7 +6,7 @@
 
 config PLAT_SAMSUNG
 	bool
-	depends on ARCH_S3C2410 || ARCH_S3C24A0 || ARCH_S3C64XX ||

ARCH_S5PC1XX

arch/arm/plat-samsung/Kconfig +1 -1
+	depends on ARCH_S3C2410 || ARCH_S3C24A0 || ARCH_S3C64XX
 	select NO_IOPORT
 	default y
 	help
--
Quoted 1 line

1.6.4

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.

#25 lore raw

PATCH 6/16 ARM: Samsung: move S5PC100 support from plat-s5pc1xx to plat-s5p framework

Hello,

Quoted 80 lines · Kukjin Kim
Quoted 2 lines · Marek Szyprowski

This patch moves S5PC100 SoC support to plat-s5p framework. Only cpu,

clocks

Quoted 1 line

and basic interrupts are supported. Other peripherals will be moved by

separate

Quoted 4 lines

patches.

Quoted 10 lines
---
 arch/arm/Kconfig                                   |    9 +-
 arch/arm/Makefile                                  |    3 +-
 arch/arm/mach-s5pc100/Kconfig                      |   23 +---
 arch/arm/mach-s5pc100/Makefile                     |    8 +-
 arch/arm/mach-s5pc100/cpu.c                        |   65 ++++-----
 arch/arm/mach-s5pc100/include/mach/debug-macro.S   |    6 +-
 arch/arm/mach-s5pc100/include/mach/entry-macro.S   |    8 +-
 arch/arm/mach-s5pc100/include/mach/irqs.h          |   99 ++++++++++++-
 arch/arm/mach-s5pc100/include/mach/map.h           |  151

++++---------------

Quoted 12 lines
 arch/arm/mach-s5pc100/include/mach/regs-clock.h    |    7 +-
 arch/arm/mach-s5pc100/include/mach/regs-irq.h      |    5 -
 arch/arm/mach-s5pc100/include/mach/system.h        |    7 +-
 arch/arm/mach-s5pc100/include/mach/tick.h          |    4 +-
 .../s5pc100-init.c => mach-s5pc100/init.c}         |    5 +-
 arch/arm/mach-s5pc100/mach-smdkc100.c              |   19 ++--
 arch/arm/mach-s5pc100/setup-i2c0.c                 |   25 ++++
 arch/arm/plat-s5p/Kconfig                          |    2 +-
 arch/arm/plat-s5p/cpu.c                            |   10 ++
 arch/arm/plat-s5p/include/plat/s5pc100.h           |   33 +++++
 arch/arm/plat-samsung/Kconfig                      |    2 +-
 20 files changed, 267 insertions(+), 224 deletions(-)

...

Quoted 4 lines
arch/arm/mach-s5pc100/cpu.c +0 -0
index d79e757..7d65b61 100644

...

Quoted 37 lines
arch/arm/mach-s5pc100/cpu.c +5 -13
@@ -73,35 +77,27 @@ static void s5pc100_idle(void)
 void __init s5pc100_map_io(void)
 {
 	iotable_init(s5pc100_iodesc, ARRAY_SIZE(s5pc100_iodesc));
-
-	/* initialise device information early */
-	s5pc100_default_sdhci0();
-	s5pc100_default_sdhci1();
-	s5pc100_default_sdhci2();
-
-	/* the i2c devices are directly compatible with s3c2440 */
-	s3c_i2c0_setname("s3c2440-i2c");
-	s3c_i2c1_setname("s3c2440-i2c");
 }
 
 void __init s5pc100_init_clocks(int xtal)
 {
-	printk(KERN_DEBUG "%s: initialising clocks\n", __func__);
+	printk(KERN_DEBUG "%s: initializing clocks\n", __func__);
+
 	s3c24xx_register_baseclocks(xtal);
-	s5pc1xx_register_clocks();
+	s5p_register_clocks(xtal);
 	s5pc100_register_clocks();
 	s5pc100_setup_clocks();
 }
 
 void __init s5pc100_init_irq(void)
 {
-	u32 vic_valid[] = {~0, ~0, ~0};
+	u32 vic[] = {~0, ~0, ~0};
 
 	/* VIC0, VIC1, and VIC2 are fully populated. */
-	s5pc1xx_init_irq(vic_valid, ARRAY_SIZE(vic_valid));
+	s5p_init_irq(vic, ARRAY_SIZE(vic));
 }
 
Quoted 6 lines

arch/arm/mach-s5pc100/cpu.c static void s5pc100_idle(void) · line 102

Quoted 4 lines
arch/arm/mach-s5pc100/cpu.c +1 -1
-struct sysdev_class s5pc100_sysclass = {
+static struct sysdev_class s5pc100_sysclass = {
 	.name	= "s5pc100-core",
 };

No need to add static attribute for other driver.

Is there any reason to keep this global? It is not used anywhere else and just pollutes the kernel name space.

Quoted 27 lines

...

Review

Quoted 1 line
(quoted diff) +0 -0

b/arch/arm/mach-

Review

Quoted 22 lines

s5pc100/include/mach/debug-macro.S
index e181f57..70e02e9 100644

arch/arm/mach-s5pc100/include/mach/debug-macro.S +4 -2
@@ -22,12 +22,14 @@
 	 * aligned and add in the offset when we load the value here.
 	 */
 
-	.macro addruart, rx, tmp
+	.macro addruart, rx, rtmp
 		mrc	p15, 0, \rx, c1, c0
 		tst	\rx, #1
 		ldreq	\rx, = S3C_PA_UART
-		ldrne	\rx, = (S3C_VA_UART + S3C_PA_UART & 0xfffff)
+		ldrne	\rx, = S3C_VA_UART
+#if CONFIG_DEBUG_S3C_UART != 0
 		add	\rx, \rx, #(0x400 * CONFIG_DEBUG_S3C_UART)
+#endif
 	.endm
 
 /* include the reset of the code which will do the work, we're only
(quoted diff) +0 -0

b/arch/arm/mach-

Quoted 6 lines

arch/arm/mach-s5pc100/include/mach/entry-macro.S

Quoted 4 lines

s5pc100/include/mach/entry-macro.S
index 6713193..ba76af0 100644

arch/arm/mach-s5pc100/include/mach/entry-macro.S +0 -0

How about changing S5PC100 from S5PC1XX the header in this entry-macro.S

I must have missed that. I will check again if there are any S5PC1XX references left.

Quoted 12 lines
Quoted 12 lines
arch/arm/mach- renamed from arch/arm/mach-s5pc100/mach-smdkc100.c +0 -0

s5pc100/mach-smdkc100.c
index ae3c52c..8dec25f 100644

arch/arm/mach-s5pc100/mach-smdkc100.c +0 -2
@@ -34,8 +34,6 @@
 #include <asm/mach-types.h>
 
 #include <plat/regs-serial.h>
-#include <plat/gpio-cfg.h>
-#include <plat/regs-gpio.h>
 
Quoted 5 lines

arch/arm/mach-s5pc100/mach-smdkc100.c line 39

Quoted 2 lines
arch/arm/mach-s5pc100/mach-smdkc100.c +0 -0
 #include <plat/clock.h>
 #include <plat/devs.h>

There are definitions like UCON for UART in this file. But those are not used.

Well, right, I will fix this.

Quoted 9 lines

arch/arm/mach-s5pc100/mach-smdkc100.c static struct s3c2410_uartcfg smdkc100_uartcfgs[]

Quoted 1 line
arch/arm/mach-s5pc100/mach-smdkc100.c +0 -0
@@ -79,6 +77,7 @@ static struct s3c2410_uartcfg smdkc100_uartcfgs[]

__initdata

arch/arm/mach-s5pc100/mach-smdkc100.c static struct s3c2410_uartcfg smdkc100_uartcfgs[] __initdata = { · line 80

Quoted 5 lines
arch/arm/mach-s5pc100/mach-smdkc100.c +1 -0
 = {
 	},
 };
 
+#if 0

#if 0?

I had to disable that part of code to make it compile. It is enabled later in separate patch when the relevant functionality got moved from plat-s5pc1xx to mach-s5pc100.

Quoted 12 lines
Quoted 12 lines
arch/arm/mach-s5pc100/mach-smdkc100.c +0 -0
 /* I2C0 */
 static struct i2c_board_info i2c_devs0[] __initdata = {

};

arch/arm/mach-s5pc100/mach-smdkc100.c +1 -2
@@ -140,10 +139,10 @@ static struct s3c_fb_platdata smdkc100_lcd_pdata
 __initdata = {
 	.vidcon1	= VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC,
 	.setup_gpio	= s5pc100_fb_gpio_setup_24bpp,
 };
-
-static struct map_desc smdkc100_iodesc[] = {};
+#endif
 
Quoted 4 lines

arch/arm/mach-s5pc100/mach-smdkc100.c static struct s3c_fb_platdata smdkc100_lcd_pdata __initdata = { · line 145

Quoted 2 lines
arch/arm/mach-s5pc100/mach-smdkc100.c +1 -0
 static struct platform_device *smdkc100_devices[] __initdata = {
+#if 0

?

Same as above. I just didn't want to remove code in one patch and add it a few patches later.

Quoted 1 line

...

Best regards
--
Marek Szyprowski
Samsung Poland R&D Center

#26 lore raw

PATCH 6/16 ARM: Samsung: move S5PC100 support from plat-s5pc1xx to plat-s5p framework

Quoted 6 lines · Marek Szyprowski
Quoted 6 lines

Review static struct s3c2410_uartcfg smdkc100_uartcfgs[]

Quoted 1 line
(quoted diff) +0 -0
@@ -79,6 +77,7 @@ static struct s3c2410_uartcfg smdkc100_uartcfgs[]

__initdata

Quoted 4 lines
(quoted diff) +0 -0
 = {
 ? ? },
 ?};
 
Quoted 7 lines
Quoted 3 lines

Review static struct s3c2410_uartcfg smdkc100_uartcfgs[] · line 81

Quoted 1 line
(quoted diff) +1 -0
+#if 0

#if 0?

I had to disable that part of code to make it compile. It is enabled later in separate patch when the relevant functionality got moved from plat-s5pc1xx to mach-s5pc100.

build break is just one thing to avoid, one should make sure the functionality doesn't break either during the changes.
Is the functionality affected during these changes?

#27 lore raw

PATCH 6/16 ARM: Samsung: move S5PC100 support from plat-s5pc1xx to plat-s5p framework

Hello,

Quoted 13 lines · jassi brar
Quoted 11 lines · Marek Szyprowski
Quoted 9 lines

Review static struct s3c2410_uartcfg smdkc100_uartcfgs[]

Quoted 1 line
(quoted diff) +0 -0
@@ -79,6 +77,7 @@ static struct s3c2410_uartcfg smdkc100_uartcfgs[]

__initdata

arch/arm/mach-s5pc100/mach-smdkc100.c static struct s3c2410_uartcfg smdkc100_uartcfgs[] __initdata = { · line 80

Quoted 5 lines
arch/arm/mach-s5pc100/mach-smdkc100.c +1 -0
 = {
    },
 };
 
+#if 0

#if 0?

I had to disable that part of code to make it compile. It is enabled

Quoted 8 lines

later

Quoted 1 line

in separate patch when the relevant functionality got moved from plat-

s5pc1xx

Quoted 1 line

to mach-s5pc100.

build break is just one thing to avoid, one should make sure the functionality
doesn't break either during the changes.
Is the functionality affected during these changes?

It is, but I really see no way to preserve all functionality while moving from one platform framework to another. Please note that some of the files
stay in the same directory, but they are being changed heavily.

The only possibility to preserve all functionality would be to squash all these patches into a single large blob, what we really would like to avoid.

Best regards
--
Marek Szyprowski
Samsung Poland R&D Center

#28 lore raw

PATCH 6/16 ARM: Samsung: move S5PC100 support from plat-s5pc1xx to plat-s5p framework

Quoted 26 lines · Marek Szyprowski

Hello,

Quoted 13 lines · jassi brar
Quoted 11 lines · Marek Szyprowski
Quoted 9 lines

Review static struct s3c2410_uartcfg smdkc100_uartcfgs[]

Quoted 1 line
(quoted diff) +0 -0
@@ -79,6 +77,7 @@ static struct s3c2410_uartcfg smdkc100_uartcfgs[]

__initdata

Review static struct s3c2410_uartcfg smdkc100_uartcfgs[] · line 81

Quoted 5 lines
(quoted diff) +1 -0
 = {
 ? ? },
 ?};
 
+#if 0

#if 0?

I had to disable that part of code to make it compile. It is enabled

Quoted 8 lines

later

Quoted 1 line

in separate patch when the relevant functionality got moved from plat-

s5pc1xx

Quoted 1 line

to mach-s5pc100.

build break is just one thing to avoid, one should make sure the functionality
doesn't break either during the changes.
Is the functionality affected during these changes?

Quoted 6 lines

It is, but I really see no way to preserve all functionality while moving from one platform framework to another. Please note that some of the files ?stay in the same directory, but they are being changed heavily.

The only possibility to preserve all functionality would be to squash all these patches into a single large blob, what we really would like to avoid.

The order of preference should be to avoid
build break -> functionality break -> big patches.
Or is it just me?

Btw, it is ok to submit extra patches that do nothing but prepare ground for a big change.

Having said that, I know perhaps practically no user would even notice/care the transient break.

#29 lore raw

PATCH 7/16 ARM: S5PC100: Move gpio support from plat-s5pc1xx to mach-s5pc100

In reply to Marek Szyprowski

Move gpio-lib support from plat-s5pc1xx to mach-s5pc100. Only basic gpio functionality is now supported. Gpio interrupts are disabled temporarly and will be added later.

---
 arch/arm/mach-s5pc100/Makefile                     |    2 +-
 .../gpiolib.c => mach-s5pc100/gpio.c}              |   48 +++++++++++---------
 .../plat => mach-s5pc100/include/mach}/regs-gpio.h |    2 +-
 3 files changed, 28 insertions(+), 24 deletions(-)
 rename arch/arm/{plat-s5pc1xx/gpiolib.c => mach-s5pc100/gpio.c} (90%)
 rename arch/arm/{plat-s5pc1xx/include/plat => mach-s5pc100/include/mach}/regs-gpio.h (98%)
arch/arm/mach-s5pc100/Makefile +1 -1
index 8371cfb..187b06d 100644
@@ -11,7 +11,7 @@ obj-				:=
 
 # Core support for S5PC100 system
 
-obj-$(CONFIG_CPU_S5PC100)	+= cpu.o init.o clock.o
+obj-$(CONFIG_CPU_S5PC100)	+= cpu.o init.o clock.o gpio.o
 obj-$(CONFIG_CPU_S5PC100)	+= setup-i2c0.o
 
 # machine support
arch/arm/mach-s5pc100/gpio.c renamed from arch/arm/plat-s5pc1xx/gpiolib.c +26 -22

127 lines not on this page · raw message

arch/arm/mach-s5pc100/include/mach/regs-gpio.h renamed from arch/arm/plat-s5pc1xx/include/plat/regs-gpio.h +1 -1
similarity index 98%
rename from arch/arm/plat-s5pc1xx/include/plat/regs-gpio.h
rename to arch/arm/mach-s5pc100/include/mach/regs-gpio.h
index 43c7bc8..b523d84 100644
@@ -12,7 +12,7 @@
 #include <mach/map.h>
 
 /* S5PC100 */
-#define S5PC100_GPIO_BASE	S5PC1XX_VA_GPIO
+#define S5PC100_GPIO_BASE	S5P_VA_GPIO
 #define S5PC100_GPA0_BASE	(S5PC100_GPIO_BASE + 0x0000)
 #define S5PC100_GPA1_BASE	(S5PC100_GPIO_BASE + 0x0020)
 #define S5PC100_GPB_BASE	(S5PC100_GPIO_BASE + 0x0040)
Signature · 1 line
1.6.4
#30 lore raw

PATCH 7/16 ARM: S5PC100: Move gpio support from plat-s5pc1xx to mach-s5pc100

Quoted 10 lines · Marek Szyprowski

Move gpio-lib support from plat-s5pc1xx to mach-s5pc100. Only basic gpio functionality is now supported. Gpio interrupts are disabled temporarly and will be added later.

---
 arch/arm/mach-s5pc100/Makefile                     |    2 +-
 .../gpiolib.c => mach-s5pc100/gpio.c}              |   48

+++++++++++---------

Quoted 4 lines
 .../plat => mach-s5pc100/include/mach}/regs-gpio.h |    2 +-
 3 files changed, 28 insertions(+), 24 deletions(-)
 rename arch/arm/{plat-s5pc1xx/gpiolib.c => mach-s5pc100/gpio.c} (90%)
 rename arch/arm/{plat-s5pc1xx/include/plat =>

mach-s5pc100/include/mach}/regs-

Review

Quoted 3 lines

gpio.h (98%)

(quoted diff) +0 -0

b/arch/arm/mach-s5pc100/Makefile

Quoted 51 lines

index 8371cfb..187b06d 100644

arch/arm/mach-s5pc100/Makefile +1 -1
@@ -11,7 +11,7 @@ obj-				:=
 
 # Core support for S5PC100 system
 
-obj-$(CONFIG_CPU_S5PC100)	+= cpu.o init.o clock.o
+obj-$(CONFIG_CPU_S5PC100)	+= cpu.o init.o clock.o gpio.o
 obj-$(CONFIG_CPU_S5PC100)	+= setup-i2c0.o
 
 # machine support
arch/arm/mach-s5pc100/gpio.c renamed from arch/arm/plat-s5pc1xx/gpiolib.c +3 -3
similarity index 90%
rename from arch/arm/plat-s5pc1xx/gpiolib.c
rename to arch/arm/mach-s5pc100/gpio.c
index 1ffc57a..9f6fbe1 100644
@@ -4,7 +4,7 @@
  *  Copyright 2009 Samsung Electronics Co
  *  Kyungmin Park <[email protected]>
  *
- * S5PC1XX - GPIOlib support
+ * S5PC100 - GPIOlib 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
@@ -17,11 +17,11 @@
 #include <linux/gpio.h>
 
 #include <mach/map.h>
+#include <mach/regs-gpio.h>
 
 #include <plat/gpio-core.h>
 #include <plat/gpio-cfg.h>
 #include <plat/gpio-cfg-helpers.h>
-#include <plat/regs-gpio.h>
 
 /* S5PC100 GPIO bank summary:
  *
@@ -72,7 +72,7 @@
 #define gpio_dbg(x...) printk(KERN_DEBUG x)
 #endif
 
-/* The s5pc1xx_gpiolib routines are to control the gpio banks where
+/* The s5pc100_gpiolib routines are to control the gpio banks where
  * the gpio configuration register (GPxCON) has 4 bits per GPIO, as the
  * following example:
  *

arch/arm/mach-s5pc100/gpio.c line 90

Quoted 5 lines
arch/arm/mach-s5pc100/gpio.c renamed from arch/arm/plat-s5pc1xx/gpiolib.c +1 -1
@@ -87,7 +87,7 @@
  * the output.
  */
 
-static int s5pc1xx_gpiolib_input(struct gpio_chip *chip, unsigned offset)
+static int s5pc100_gpiolib_input(struct gpio_chip *chip, unsigned offset)

If use the samsung gpiolib, no need this function.

arch/arm/mach-s5pc100/gpio.c static int s5pc1xx_gpiolib_input(struct gpio_chip

Quoted 4 lines
arch/arm/mach-s5pc100/gpio.c renamed from arch/arm/plat-s5pc1xx/gpiolib.c +0 -0
 {
 	struct s3c_gpio_chip *ourchip = to_s3c_gpio(chip);
 	void __iomem *base = ourchip->base;
@@ -102,7 +102,7 @@ static int s5pc1xx_gpiolib_input(struct gpio_chip

*chip,

arch/arm/mach-s5pc100/gpio.c static int s5pc1xx_gpiolib_input(struct gpio_chip *chip, unsigned offset) · line 106

Quoted 7 lines
arch/arm/mach-s5pc100/gpio.c renamed from arch/arm/plat-s5pc1xx/gpiolib.c +1 -1
 unsigned offset)
 	return 0;
 }
 
-static int s5pc1xx_gpiolib_output(struct gpio_chip *chip,
+static int s5pc100_gpiolib_output(struct gpio_chip *chip,
 				       unsigned offset, int value)

Same.

arch/arm/mach-s5pc100/gpio.c static int s5pc1xx_gpiolib_output(struct gpio_chip

Quoted 3 lines
arch/arm/mach-s5pc100/gpio.c renamed from arch/arm/plat-s5pc1xx/gpiolib.c +0 -0
 {
arch/arm/mach-s5pc100/gpio.c renamed from arch/arm/plat-s5pc1xx/gpiolib.c +0 -0
 	struct s3c_gpio_chip *ourchip = to_s3c_gpio(chip);
@@ -129,12 +129,14 @@ static int s5pc1xx_gpiolib_output(struct gpio_chip

*chip,

arch/arm/mach-s5pc100/gpio.c static int s5pc1xx_gpiolib_input(struct gpio_chip *chip, unsigned offset)

Quoted 4 lines
arch/arm/mach-s5pc100/gpio.c renamed from arch/arm/plat-s5pc1xx/gpiolib.c +0 -1
 	return 0;
 }
 
-static int s5pc1xx_gpiolib_to_irq(struct gpio_chip *chip, unsigned int

offset)

arch/arm/mach-s5pc100/gpio.c static int s5pc1xx_gpiolib_output(struct gpio_chip · line 133

Quoted 2 lines
arch/arm/mach-s5pc100/gpio.c renamed from arch/arm/plat-s5pc1xx/gpiolib.c +2 -0
+#if 0
+static int s5pc100_gpiolib_to_irq(struct gpio_chip *chip, unsigned int

offset)

arch/arm/mach-s5pc100/gpio.c static int s5pc1xx_gpiolib_output(struct gpio_chip *chip,

Quoted 6 lines
arch/arm/mach-s5pc100/gpio.c renamed from arch/arm/plat-s5pc1xx/gpiolib.c +1 -1
 {
 	return S3C_IRQ_GPIO(chip->base + offset);
 }
+#endif
 
-static int s5pc1xx_gpiolib_to_eint(struct gpio_chip *chip, unsigned int

offset)

arch/arm/mach-s5pc100/gpio.c static int s5pc1xx_gpiolib_output(struct gpio_chip · line 139

Quoted 1 line
arch/arm/mach-s5pc100/gpio.c renamed from arch/arm/plat-s5pc1xx/gpiolib.c +1 -0
+static int s5pc100_gpiolib_to_eint(struct gpio_chip *chip, unsigned int

offset)

arch/arm/mach-s5pc100/gpio.c static struct s3c_gpio_chip s5pc100_gpio_chips[] = { · line 453

Quoted 9 lines
arch/arm/mach-s5pc100/gpio.c renamed from arch/arm/plat-s5pc1xx/gpiolib.c +0 -2
 {
 	int base;
 
@@ -449,33 +451,34 @@ static struct s3c_gpio_chip s5pc100_gpio_chips[] = {
 };
 
 /* FIXME move from irq-gpio.c */
-extern struct irq_chip s5pc1xx_gpioint;
-extern void s5pc1xx_irq_gpioint_handler(unsigned int irq, struct irq_desc

*desc);

arch/arm/mach-s5pc100/gpio.c static struct s3c_gpio_chip s5pc100_gpio_chips[] = { · line 455

Quoted 2 lines
arch/arm/mach-s5pc100/gpio.c renamed from arch/arm/plat-s5pc1xx/gpiolib.c +2 -0
+extern struct irq_chip s5pc100_gpioint;
+extern void s5pc100_irq_gpioint_handler(unsigned int irq, struct irq_desc

*desc);

Quoted 48 lines
arch/arm/mach-s5pc100/gpio.c renamed from arch/arm/plat-s5pc1xx/gpiolib.c +10 -9
-static __init void s5pc1xx_gpiolib_link(struct s3c_gpio_chip *chip)
+static __init void s5pc100_gpiolib_link(struct s3c_gpio_chip *chip)
 {
-	chip->chip.direction_input = s5pc1xx_gpiolib_input;
-	chip->chip.direction_output = s5pc1xx_gpiolib_output;
+	chip->chip.direction_input = s5pc100_gpiolib_input;
+	chip->chip.direction_output = s5pc100_gpiolib_output;
 	chip->pm = __gpio_pm(&s3c_gpio_pm_4bit);
-
+#if 0
 	/* Interrupt */
 	if (chip->config == &gpio_cfg) {
 		int i, irq;
 
-		chip->chip.to_irq = s5pc1xx_gpiolib_to_irq;
+		chip->chip.to_irq = s5pc100_gpiolib_to_irq;
 
 		for (i = 0;  i < chip->chip.ngpio; i++) {
 			irq = S3C_IRQ_GPIO_BASE + chip->chip.base + i;
-			set_irq_chip(irq, &s5pc1xx_gpioint);
+			set_irq_chip(irq, &s5pc100_gpioint);
 			set_irq_data(irq, &chip->chip);
 			set_irq_handler(irq, handle_level_irq);
 			set_irq_flags(irq, IRQF_VALID);
 		}
 	} else if (chip->config == &gpio_cfg_eint)
-		chip->chip.to_irq = s5pc1xx_gpiolib_to_eint;
+		chip->chip.to_irq = s5pc100_gpiolib_to_eint;
+#endif
 }
 
-static __init void s5pc1xx_gpiolib_add(struct s3c_gpio_chip *chips,
+static __init void s5pc100_gpiolib_add(struct s3c_gpio_chip *chips,
 				       int nr_chips,
 				       void (*fn)(struct s3c_gpio_chip *))
 {
@@ -486,7 +489,7 @@ static __init void s5pc1xx_gpiolib_add(struct
 s3c_gpio_chip *chips,
 	}
 }
 
-static __init int s5pc1xx_gpiolib_init(void)
+static __init int s5pc100_gpiolib_init(void)
 {
 	struct s3c_gpio_chip *chips;
arch/arm/mach-s5pc100/gpio.c renamed from arch/arm/plat-s5pc1xx/gpiolib.c +0 -0
 	int nr_chips;

arch/arm/mach-s5pc100/gpio.c static __init int s5pc1xx_gpiolib_init(void) · line 500

Quoted 5 lines
arch/arm/mach-s5pc100/gpio.c renamed from arch/arm/plat-s5pc1xx/gpiolib.c +1 -1
@@ -494,10 +497,11 @@ static __init int s5pc1xx_gpiolib_init(void)
 		chips = s5pc100_gpio_chips;
 		nr_chips = ARRAY_SIZE(s5pc100_gpio_chips);
 
-	s5pc1xx_gpiolib_add(chips, nr_chips, s5pc1xx_gpiolib_link);
+	s5pc100_gpiolib_add(chips, nr_chips, s5pc100_gpiolib_link);

How about using the samsung_gpiolib_add_4bit_chips in plat-samsung?

Review

Quoted 11 lines
arch/arm/mach-s5pc100/gpio.c renamed from arch/arm/plat-s5pc1xx/gpiolib.c +4 -3
 	/* Interrupt */
-	set_irq_chained_handler(IRQ_GPIOINT, s5pc1xx_irq_gpioint_handler);
-
+#if 0
+	set_irq_chained_handler(IRQ_GPIOINT, s5pc100_irq_gpioint_handler);
+#endif
 	return 0;
 }
-core_initcall(s5pc1xx_gpiolib_init);
+core_initcall(s5pc100_gpiolib_init);
(quoted diff) +0 -0

b/arch/arm/mach-

Quoted 17 lines

s5pc100/include/mach/regs-gpio.h
similarity index 98%
rename from arch/arm/plat-s5pc1xx/include/plat/regs-gpio.h rename to arch/arm/mach-s5pc100/include/mach/regs-gpio.h index 43c7bc8..b523d84 100644

arch/arm/mach-s5pc100/include/mach/regs-gpio.h renamed from arch/arm/plat-s5pc1xx/include/plat/regs-gpio.h +1 -2
@@ -12,7 +12,7 @@
 #include <mach/map.h>
 
 /* S5PC100 */
-#define S5PC100_GPIO_BASE	S5PC1XX_VA_GPIO
+#define S5PC100_GPIO_BASE	S5P_VA_GPIO
 #define S5PC100_GPA0_BASE	(S5PC100_GPIO_BASE + 0x0000)
 #define S5PC100_GPA1_BASE	(S5PC100_GPIO_BASE + 0x0020)
 #define S5PC100_GPB_BASE	(S5PC100_GPIO_BASE + 0x0040)
--
Quoted 1 line

1.6.4

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.

#31 lore raw

PATCH 7/16 ARM: S5PC100: Move gpio support from plat-s5pc1xx to mach-s5pc100

Hello,

Quoted 184 lines · Kukjin Kim
Quoted 10 lines · Marek Szyprowski

Move gpio-lib support from plat-s5pc1xx to mach-s5pc100. Only basic gpio functionality is now supported. Gpio interrupts are disabled temporarly and will be added later.

---
 arch/arm/mach-s5pc100/Makefile                     |    2 +-
 .../gpiolib.c => mach-s5pc100/gpio.c}              |   48

+++++++++++---------

Quoted 4 lines
 .../plat => mach-s5pc100/include/mach}/regs-gpio.h |    2 +-
 3 files changed, 28 insertions(+), 24 deletions(-)
 rename arch/arm/{plat-s5pc1xx/gpiolib.c => mach-s5pc100/gpio.c} (90%)
 rename arch/arm/{plat-s5pc1xx/include/plat =>

mach-s5pc100/include/mach}/regs-

Review

Quoted 3 lines

gpio.h (98%)

(quoted diff) +0 -0

b/arch/arm/mach-s5pc100/Makefile

arch/arm/mach-

Quoted 13 lines

index 8371cfb..187b06d 100644

arch/arm/mach-s5pc100/Makefile +1 -1
@@ -11,7 +11,7 @@ obj-				:=
 
 # Core support for S5PC100 system
 
-obj-$(CONFIG_CPU_S5PC100)	+= cpu.o init.o clock.o
+obj-$(CONFIG_CPU_S5PC100)	+= cpu.o init.o clock.o gpio.o
 obj-$(CONFIG_CPU_S5PC100)	+= setup-i2c0.o
 
 # machine support
arch/arm/mach- renamed from arch/arm/plat-s5pc1xx/gpiolib.c +0 -0

s5pc100/gpio.c

Quoted 38 lines

similarity index 90%
rename from arch/arm/plat-s5pc1xx/gpiolib.c
rename to arch/arm/mach-s5pc100/gpio.c
index 1ffc57a..9f6fbe1 100644

arch/arm/mach-s5pc100/gpio.c renamed from arch/arm/plat-s5pc1xx/gpiolib.c +3 -3
@@ -4,7 +4,7 @@
  *  Copyright 2009 Samsung Electronics Co
  *  Kyungmin Park <[email protected]>
  *
- * S5PC1XX - GPIOlib support
+ * S5PC100 - GPIOlib 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
@@ -17,11 +17,11 @@
 #include <linux/gpio.h>
 
 #include <mach/map.h>
+#include <mach/regs-gpio.h>
 
 #include <plat/gpio-core.h>
 #include <plat/gpio-cfg.h>
 #include <plat/gpio-cfg-helpers.h>
-#include <plat/regs-gpio.h>
 
 /* S5PC100 GPIO bank summary:
  *
@@ -72,7 +72,7 @@
 #define gpio_dbg(x...) printk(KERN_DEBUG x)
 #endif
 
-/* The s5pc1xx_gpiolib routines are to control the gpio banks where
+/* The s5pc100_gpiolib routines are to control the gpio banks where
  * the gpio configuration register (GPxCON) has 4 bits per GPIO, as the
  * following example:
  *

arch/arm/mach-s5pc100/gpio.c line 90

Quoted 5 lines
arch/arm/mach-s5pc100/gpio.c renamed from arch/arm/plat-s5pc1xx/gpiolib.c +1 -1
@@ -87,7 +87,7 @@
  * the output.
  */
 
-static int s5pc1xx_gpiolib_input(struct gpio_chip *chip, unsigned offset)
+static int s5pc100_gpiolib_input(struct gpio_chip *chip, unsigned offset)

If use the samsung gpiolib, no need this function.

arch/arm/mach-s5pc100/gpio.c static int s5pc1xx_gpiolib_input(struct gpio_chip

Quoted 4 lines
arch/arm/mach-s5pc100/gpio.c renamed from arch/arm/plat-s5pc1xx/gpiolib.c +0 -0
 {
 	struct s3c_gpio_chip *ourchip = to_s3c_gpio(chip);
 	void __iomem *base = ourchip->base;
@@ -102,7 +102,7 @@ static int s5pc1xx_gpiolib_input(struct gpio_chip

*chip,

arch/arm/mach-s5pc100/gpio.c static int s5pc1xx_gpiolib_input(struct gpio_chip *chip, unsigned offset) · line 106

Quoted 7 lines
arch/arm/mach-s5pc100/gpio.c renamed from arch/arm/plat-s5pc1xx/gpiolib.c +1 -1
 unsigned offset)
 	return 0;
 }
 
-static int s5pc1xx_gpiolib_output(struct gpio_chip *chip,
+static int s5pc100_gpiolib_output(struct gpio_chip *chip,
 				       unsigned offset, int value)

Same.

arch/arm/mach-s5pc100/gpio.c static int s5pc1xx_gpiolib_output(struct gpio_chip

Quoted 3 lines
arch/arm/mach-s5pc100/gpio.c renamed from arch/arm/plat-s5pc1xx/gpiolib.c +0 -0
 {
arch/arm/mach-s5pc100/gpio.c renamed from arch/arm/plat-s5pc1xx/gpiolib.c +0 -0
 	struct s3c_gpio_chip *ourchip = to_s3c_gpio(chip);
@@ -129,12 +129,14 @@ static int s5pc1xx_gpiolib_output(struct gpio_chip

*chip,

arch/arm/mach-s5pc100/gpio.c static int s5pc1xx_gpiolib_input(struct gpio_chip *chip, unsigned offset)

Quoted 4 lines
arch/arm/mach-s5pc100/gpio.c renamed from arch/arm/plat-s5pc1xx/gpiolib.c +0 -1
 	return 0;
 }
 
-static int s5pc1xx_gpiolib_to_irq(struct gpio_chip *chip, unsigned int

offset)

arch/arm/mach-s5pc100/gpio.c static int s5pc1xx_gpiolib_output(struct gpio_chip · line 133

Quoted 2 lines
arch/arm/mach-s5pc100/gpio.c renamed from arch/arm/plat-s5pc1xx/gpiolib.c +2 -0
+#if 0
+static int s5pc100_gpiolib_to_irq(struct gpio_chip *chip, unsigned int

offset)

arch/arm/mach-s5pc100/gpio.c static int s5pc1xx_gpiolib_output(struct gpio_chip *chip,

Quoted 6 lines
arch/arm/mach-s5pc100/gpio.c renamed from arch/arm/plat-s5pc1xx/gpiolib.c +1 -1
 {
 	return S3C_IRQ_GPIO(chip->base + offset);
 }
+#endif
 
-static int s5pc1xx_gpiolib_to_eint(struct gpio_chip *chip, unsigned int

offset)

arch/arm/mach-s5pc100/gpio.c static int s5pc1xx_gpiolib_output(struct gpio_chip · line 139

Quoted 1 line
arch/arm/mach-s5pc100/gpio.c renamed from arch/arm/plat-s5pc1xx/gpiolib.c +1 -0
+static int s5pc100_gpiolib_to_eint(struct gpio_chip *chip, unsigned int

offset)

arch/arm/mach-s5pc100/gpio.c static struct s3c_gpio_chip s5pc100_gpio_chips[] =

Quoted 4 lines
arch/arm/mach-s5pc100/gpio.c renamed from arch/arm/plat-s5pc1xx/gpiolib.c +0 -0
 {
 	int base;
 
@@ -449,33 +451,34 @@ static struct s3c_gpio_chip s5pc100_gpio_chips[] =

{

arch/arm/mach-s5pc100/gpio.c static struct s3c_gpio_chip s5pc100_gpio_chips[] = {

Quoted 5 lines
arch/arm/mach-s5pc100/gpio.c renamed from arch/arm/plat-s5pc1xx/gpiolib.c +0 -2
 };
 
 /* FIXME move from irq-gpio.c */
-extern struct irq_chip s5pc1xx_gpioint;
-extern void s5pc1xx_irq_gpioint_handler(unsigned int irq, struct

irq_desc
*desc);

arch/arm/mach-s5pc100/gpio.c static struct s3c_gpio_chip s5pc100_gpio_chips[] = · line 455

Quoted 2 lines
arch/arm/mach-s5pc100/gpio.c renamed from arch/arm/plat-s5pc1xx/gpiolib.c +2 -0
+extern struct irq_chip s5pc100_gpioint;
+extern void s5pc100_irq_gpioint_handler(unsigned int irq, struct

irq_desc
*desc);

Quoted 51 lines
arch/arm/mach-s5pc100/gpio.c renamed from arch/arm/plat-s5pc1xx/gpiolib.c +10 -9
-static __init void s5pc1xx_gpiolib_link(struct s3c_gpio_chip *chip)
+static __init void s5pc100_gpiolib_link(struct s3c_gpio_chip *chip)
 {
-	chip->chip.direction_input = s5pc1xx_gpiolib_input;
-	chip->chip.direction_output = s5pc1xx_gpiolib_output;
+	chip->chip.direction_input = s5pc100_gpiolib_input;
+	chip->chip.direction_output = s5pc100_gpiolib_output;
 	chip->pm = __gpio_pm(&s3c_gpio_pm_4bit);
-
+#if 0
 	/* Interrupt */
 	if (chip->config == &gpio_cfg) {
 		int i, irq;
 
-		chip->chip.to_irq = s5pc1xx_gpiolib_to_irq;
+		chip->chip.to_irq = s5pc100_gpiolib_to_irq;
 
 		for (i = 0;  i < chip->chip.ngpio; i++) {
 			irq = S3C_IRQ_GPIO_BASE + chip->chip.base + i;
-			set_irq_chip(irq, &s5pc1xx_gpioint);
+			set_irq_chip(irq, &s5pc100_gpioint);
 			set_irq_data(irq, &chip->chip);
 			set_irq_handler(irq, handle_level_irq);
 			set_irq_flags(irq, IRQF_VALID);
 		}
 	} else if (chip->config == &gpio_cfg_eint)
-		chip->chip.to_irq = s5pc1xx_gpiolib_to_eint;
+		chip->chip.to_irq = s5pc100_gpiolib_to_eint;
+#endif
 }
 
-static __init void s5pc1xx_gpiolib_add(struct s3c_gpio_chip *chips,
+static __init void s5pc100_gpiolib_add(struct s3c_gpio_chip *chips,
 				       int nr_chips,
 				       void (*fn)(struct s3c_gpio_chip *))
 {
@@ -486,7 +489,7 @@ static __init void s5pc1xx_gpiolib_add(struct
 s3c_gpio_chip *chips,
 	}
 }
 
-static __init int s5pc1xx_gpiolib_init(void)
+static __init int s5pc100_gpiolib_init(void)
 {
 	struct s3c_gpio_chip *chips;
arch/arm/mach-s5pc100/gpio.c renamed from arch/arm/plat-s5pc1xx/gpiolib.c +0 -0
 	int nr_chips;
@@ -494,10 +497,11 @@ static __init int s5pc1xx_gpiolib_init(void)
 		chips = s5pc100_gpio_chips;
 		nr_chips = ARRAY_SIZE(s5pc100_gpio_chips);
 
Quoted 4 lines

arch/arm/mach-s5pc100/gpio.c static __init int s5pc1xx_gpiolib_init(void) · line 500

Quoted 2 lines
arch/arm/mach-s5pc100/gpio.c renamed from arch/arm/plat-s5pc1xx/gpiolib.c +1 -1
-	s5pc1xx_gpiolib_add(chips, nr_chips, s5pc1xx_gpiolib_link);
+	s5pc100_gpiolib_add(chips, nr_chips, s5pc100_gpiolib_link);

How about using the samsung_gpiolib_add_4bit_chips in plat-samsung?

You are right, thanks for spotting this.

Best regards
--
Marek Szyprowski
Samsung Poland R&D Center

#32 lore raw

PATCH 7/16 ARM: S5PC100: Move gpio support from plat-s5pc1xx to mach-s5pc100

In reply to Marek Szyprowski
Quoted 75 lines · Marek Szyprowski

Move gpio-lib support from plat-s5pc1xx to mach-s5pc100. Only basic gpio functionality is now supported. Gpio interrupts are disabled temporarly and will be added later.

---
 arch/arm/mach-s5pc100/Makefile                     |    2 +-
 .../gpiolib.c => mach-s5pc100/gpio.c}              |   48 +++++++++++---------
 .../plat => mach-s5pc100/include/mach}/regs-gpio.h |    2 +-
 3 files changed, 28 insertions(+), 24 deletions(-)
 rename arch/arm/{plat-s5pc1xx/gpiolib.c => mach-s5pc100/gpio.c} (90%)
 rename arch/arm/{plat-s5pc1xx/include/plat => mach-s5pc100/include/mach}/regs-gpio.h (98%)
arch/arm/mach-s5pc100/Makefile +1 -1
index 8371cfb..187b06d 100644
@@ -11,7 +11,7 @@ obj-				:=
 
 # Core support for S5PC100 system
 
-obj-$(CONFIG_CPU_S5PC100)	+= cpu.o init.o clock.o
+obj-$(CONFIG_CPU_S5PC100)	+= cpu.o init.o clock.o gpio.o
 obj-$(CONFIG_CPU_S5PC100)	+= setup-i2c0.o
 
 # machine support
arch/arm/mach-s5pc100/gpio.c renamed from arch/arm/plat-s5pc1xx/gpiolib.c +4 -4
similarity index 90%
rename from arch/arm/plat-s5pc1xx/gpiolib.c
rename to arch/arm/mach-s5pc100/gpio.c
index 1ffc57a..9f6fbe1 100644
@@ -4,7 +4,7 @@
  *  Copyright 2009 Samsung Electronics Co
  *  Kyungmin Park <[email protected]>
  *
- * S5PC1XX - GPIOlib support
+ * S5PC100 - GPIOlib 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
@@ -17,11 +17,11 @@
 #include <linux/gpio.h>
 
 #include <mach/map.h>
+#include <mach/regs-gpio.h>
 
 #include <plat/gpio-core.h>
 #include <plat/gpio-cfg.h>
 #include <plat/gpio-cfg-helpers.h>
-#include <plat/regs-gpio.h>
 
 /* S5PC100 GPIO bank summary:
  *
@@ -72,7 +72,7 @@
 #define gpio_dbg(x...) printk(KERN_DEBUG x)
 #endif
 
-/* The s5pc1xx_gpiolib routines are to control the gpio banks where
+/* The s5pc100_gpiolib routines are to control the gpio banks where
  * the gpio configuration register (GPxCON) has 4 bits per GPIO, as the
  * following example:
  *
@@ -87,7 +87,7 @@
  * the output.
  */
 
-static int s5pc1xx_gpiolib_input(struct gpio_chip *chip, unsigned offset)
+static int s5pc100_gpiolib_input(struct gpio_chip *chip, unsigned offset)
 {
 	struct s3c_gpio_chip *ourchip = to_s3c_gpio(chip);
 	void __iomem *base = ourchip->base;

arch/arm/mach-s5pc100/gpio.c static int s5pc1xx_gpiolib_input(struct gpio_chip *chip, unsigned offset) · line 103

Quoted 2 lines
arch/arm/mach-s5pc100/gpio.c renamed from arch/arm/plat-s5pc1xx/gpiolib.c +0 -0
@@ -102,7 +102,7 @@ static int s5pc1xx_gpiolib_input(struct gpio_chip *chip, unsigned offset)
 	return 0;
 }

to be honest i'd rather see the back of these and use the common support for s5pc/s3c64xx which seems to be pretty much the same.

Quoted 116 lines
arch/arm/mach-s5pc100/gpio.c renamed from arch/arm/plat-s5pc1xx/gpiolib.c +22 -18
-static int s5pc1xx_gpiolib_output(struct gpio_chip *chip,
+static int s5pc100_gpiolib_output(struct gpio_chip *chip,
 				       unsigned offset, int value)
 {
 	struct s3c_gpio_chip *ourchip = to_s3c_gpio(chip);
@@ -129,12 +129,14 @@ static int s5pc1xx_gpiolib_output(struct gpio_chip *chip,
 	return 0;
 }
 
-static int s5pc1xx_gpiolib_to_irq(struct gpio_chip *chip, unsigned int offset)
+#if 0
+static int s5pc100_gpiolib_to_irq(struct gpio_chip *chip, unsigned int offset)
 {
 	return S3C_IRQ_GPIO(chip->base + offset);
 }
+#endif
 
-static int s5pc1xx_gpiolib_to_eint(struct gpio_chip *chip, unsigned int offset)
+static int s5pc100_gpiolib_to_eint(struct gpio_chip *chip, unsigned int offset)
 {
 	int base;
 
@@ -449,33 +451,34 @@ static struct s3c_gpio_chip s5pc100_gpio_chips[] = {
 };
 
 /* FIXME move from irq-gpio.c */
-extern struct irq_chip s5pc1xx_gpioint;
-extern void s5pc1xx_irq_gpioint_handler(unsigned int irq, struct irq_desc *desc);
+extern struct irq_chip s5pc100_gpioint;
+extern void s5pc100_irq_gpioint_handler(unsigned int irq, struct irq_desc *desc);
 
-static __init void s5pc1xx_gpiolib_link(struct s3c_gpio_chip *chip)
+static __init void s5pc100_gpiolib_link(struct s3c_gpio_chip *chip)
 {
-	chip->chip.direction_input = s5pc1xx_gpiolib_input;
-	chip->chip.direction_output = s5pc1xx_gpiolib_output;
+	chip->chip.direction_input = s5pc100_gpiolib_input;
+	chip->chip.direction_output = s5pc100_gpiolib_output;
 	chip->pm = __gpio_pm(&s3c_gpio_pm_4bit);
-
+#if 0
 	/* Interrupt */
 	if (chip->config == &gpio_cfg) {
 		int i, irq;
 
-		chip->chip.to_irq = s5pc1xx_gpiolib_to_irq;
+		chip->chip.to_irq = s5pc100_gpiolib_to_irq;
 
 		for (i = 0;  i < chip->chip.ngpio; i++) {
 			irq = S3C_IRQ_GPIO_BASE + chip->chip.base + i;
-			set_irq_chip(irq, &s5pc1xx_gpioint);
+			set_irq_chip(irq, &s5pc100_gpioint);
 			set_irq_data(irq, &chip->chip);
 			set_irq_handler(irq, handle_level_irq);
 			set_irq_flags(irq, IRQF_VALID);
 		}
 	} else if (chip->config == &gpio_cfg_eint)
-		chip->chip.to_irq = s5pc1xx_gpiolib_to_eint;
+		chip->chip.to_irq = s5pc100_gpiolib_to_eint;
+#endif
 }
 
-static __init void s5pc1xx_gpiolib_add(struct s3c_gpio_chip *chips,
+static __init void s5pc100_gpiolib_add(struct s3c_gpio_chip *chips,
 				       int nr_chips,
 				       void (*fn)(struct s3c_gpio_chip *))
 {
@@ -486,7 +489,7 @@ static __init void s5pc1xx_gpiolib_add(struct s3c_gpio_chip *chips,
 	}
 }
 
-static __init int s5pc1xx_gpiolib_init(void)
+static __init int s5pc100_gpiolib_init(void)
 {
 	struct s3c_gpio_chip *chips;
 	int nr_chips;
@@ -494,10 +497,11 @@ static __init int s5pc1xx_gpiolib_init(void)
 		chips = s5pc100_gpio_chips;
 		nr_chips = ARRAY_SIZE(s5pc100_gpio_chips);
 
-	s5pc1xx_gpiolib_add(chips, nr_chips, s5pc1xx_gpiolib_link);
+	s5pc100_gpiolib_add(chips, nr_chips, s5pc100_gpiolib_link);
 	/* Interrupt */
-	set_irq_chained_handler(IRQ_GPIOINT, s5pc1xx_irq_gpioint_handler);
-
+#if 0
+	set_irq_chained_handler(IRQ_GPIOINT, s5pc100_irq_gpioint_handler);
+#endif
 	return 0;
 }
-core_initcall(s5pc1xx_gpiolib_init);
+core_initcall(s5pc100_gpiolib_init);
arch/arm/mach-s5pc100/include/mach/regs-gpio.h renamed from arch/arm/plat-s5pc1xx/include/plat/regs-gpio.h +1 -1
similarity index 98%
rename from arch/arm/plat-s5pc1xx/include/plat/regs-gpio.h
rename to arch/arm/mach-s5pc100/include/mach/regs-gpio.h
index 43c7bc8..b523d84 100644
@@ -12,7 +12,7 @@
 #include <mach/map.h>
 
 /* S5PC100 */
-#define S5PC100_GPIO_BASE	S5PC1XX_VA_GPIO
+#define S5PC100_GPIO_BASE	S5P_VA_GPIO
 #define S5PC100_GPA0_BASE	(S5PC100_GPIO_BASE + 0x0000)
 #define S5PC100_GPA1_BASE	(S5PC100_GPIO_BASE + 0x0020)
 #define S5PC100_GPB_BASE	(S5PC100_GPIO_BASE + 0x0040)
Signature · 7 lines
1.6.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Signature · 5 lines
-- 
Ben

Q:      What's a light-year?
A:      One-third less calories than a regular year.
#33 lore raw

PATCH 8/16 ARM: S5PC100: Move frame buffer helpers from plat-s5pc1xx to mach-s5pc100

In reply to Marek Szyprowski

Move frame buffer helpers from plat-s5pc1xx to mach-s5pc100.

---
 arch/arm/mach-s5pc100/Kconfig                      |    7 +++++++
 arch/arm/mach-s5pc100/Makefile                     |    4 ++++
 arch/arm/mach-s5pc100/include/mach/irqs.h          |    5 +++++
 arch/arm/mach-s5pc100/include/mach/map.h           |    5 ++++-
 .../setup-fb-24bpp.c                               |    4 ++--
 5 files changed, 22 insertions(+), 3 deletions(-)
 rename arch/arm/{plat-s5pc1xx => mach-s5pc100}/setup-fb-24bpp.c (91%)
arch/arm/mach-s5pc100/Kconfig +7 -0
index 54c83a4..26e0028 100644
@@ -12,6 +12,13 @@ config CPU_S5PC100
 	help
 	  Enable S5PC100 CPU support
 
+# platform specific device setup
+
+config S5PC100_SETUP_FB_24BPP
+	bool
+	help
+          Common setup code for S5PC100 with an 24bpp RGB display helper.
+
 config MACH_SMDKC100
 	bool "SMDKC100"
 	select CPU_S5PC100
arch/arm/mach-s5pc100/Makefile +4 -0
index 187b06d..878dc61 100644
@@ -14,6 +14,10 @@ obj-				:=
 obj-$(CONFIG_CPU_S5PC100)	+= cpu.o init.o clock.o gpio.o
 obj-$(CONFIG_CPU_S5PC100)	+= setup-i2c0.o
 
+# Device setup
+
+obj-$(CONFIG_S5PC100_SETUP_FB_24BPP) += setup-fb-24bpp.o
+
 # machine support
 
 obj-$(CONFIG_MACH_SMDKC100)	+= mach-smdkc100.o
arch/arm/mach-s5pc100/include/mach/irqs.h +5 -0
index 6789eeb..c0747f1 100644
@@ -105,4 +105,9 @@
 
 #define NR_IRQS		(IRQ_EINT(31) + 1)
 
+/* Compatibility */
+#define IRQ_LCD_FIFO		IRQ_LCD0
+#define IRQ_LCD_VSYNC		IRQ_LCD1
+#define IRQ_LCD_SYSTEM		IRQ_LCD2
+
 #endif /* __ASM_ARCH_IRQS_H */
arch/arm/mach-s5pc100/include/mach/map.h +4 -1
index a79b09f..f08fd76 100644
@@ -25,7 +25,6 @@
 #define S5PC100_PA_OTHERS	(0xE0200000)
 #define S5PC100_VA_OTHERS	(S3C_VA_SYS + 0x10000)
 
-
 #define S5PC100_PA_GPIO		(0xE0300000)
 #define S5P_PA_GPIO		S5PC100_PA_GPIO
 
@@ -53,11 +52,15 @@
 
 #define S5PC100_PA_IIC0		(0xEC100000)
 
+#define S5PC100_PA_FB		(0xEE000000)
+
 #define S5PC100_PA_SDRAM	(0x20000000)
+
 #define S5P_PA_SDRAM		S5PC100_PA_SDRAM
 
 /* compatibiltiy defines. */
 #define S3C_PA_UART		S5PC100_PA_UART
 #define S3C_PA_IIC		S5PC100_PA_IIC0
+#define S3C_PA_FB		S5PC100_PA_FB
 
 #endif /* __ASM_ARCH_MAP_H */
arch/arm/mach-s5pc100/setup-fb-24bpp.c renamed from arch/arm/plat-s5pc1xx/setup-fb-24bpp.c +2 -2
similarity index 91%
rename from arch/arm/plat-s5pc1xx/setup-fb-24bpp.c
rename to arch/arm/mach-s5pc100/setup-fb-24bpp.c
index b02c36f..6eba6cb 100644
@@ -1,9 +1,9 @@
 /*
- * linux/arch/arm/plat-s5pc100/setup-fb-24bpp.c
+ * linux/arch/arm/mach-s5pc100/setup-fb-24bpp.c
  *
  * Copyright 2009 Samsung Electronics
  *
- * Base S5PC1XX setup information for 24bpp LCD framebuffer
+ * Base S5PC100 setup information for 24bpp LCD framebuffer
  *
  * 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
Signature · 1 line
1.6.4
#34 lore raw

PATCH 8/16 ARM: S5PC100: Move frame buffer helpers from plat-s5pc1xx to mach-s5pc100

Quoted 19 lines · Marek Szyprowski

Move frame buffer helpers from plat-s5pc1xx to mach-s5pc100.

---
 arch/arm/mach-s5pc100/Kconfig                      |    7 +++++++
 arch/arm/mach-s5pc100/Makefile                     |    4 ++++
 arch/arm/mach-s5pc100/include/mach/irqs.h          |    5 +++++
 arch/arm/mach-s5pc100/include/mach/map.h           |    5 ++++-
 .../setup-fb-24bpp.c                               |    4 ++--
 5 files changed, 22 insertions(+), 3 deletions(-)
 rename arch/arm/{plat-s5pc1xx => mach-s5pc100}/setup-fb-24bpp.c (91%)
arch/arm/mach-s5pc100/Kconfig +0 -0
index 54c83a4..26e0028 100644

arch/arm/mach-s5pc100/Kconfig config CPU_S5PC100 · line 15

Quoted 4 lines
arch/arm/mach-s5pc100/Kconfig +1 -0
@@ -12,6 +12,13 @@ config CPU_S5PC100
 	help
 	  Enable S5PC100 CPU support
 
+# platform specific device setup

I think 'machine' is better in your comment than 'platform'

Review

Quoted 10 lines
arch/arm/mach-s5pc100/Kconfig +6 -0
+
+config S5PC100_SETUP_FB_24BPP
+	bool
+	help
+          Common setup code for S5PC100 with an 24bpp RGB display helper.
+
 config MACH_SMDKC100
 	bool "SMDKC100"
 	select CPU_S5PC100
(quoted diff) +0 -0

b/arch/arm/mach-s5pc100/Makefile

Quoted 20 lines

index 187b06d..878dc61 100644

arch/arm/mach-s5pc100/Makefile +4 -0
@@ -14,6 +14,10 @@ obj-				:=
 obj-$(CONFIG_CPU_S5PC100)	+= cpu.o init.o clock.o gpio.o
 obj-$(CONFIG_CPU_S5PC100)	+= setup-i2c0.o
 
+# Device setup
+
+obj-$(CONFIG_S5PC100_SETUP_FB_24BPP) += setup-fb-24bpp.o
+
 # machine support
 
 obj-$(CONFIG_MACH_SMDKC100)	+= mach-smdkc100.o
arch/arm/mach- renamed from arch/arm/mach-s5pc100/include/mach/irqs.h +0 -0

s5pc100/include/mach/irqs.h
index 6789eeb..c0747f1 100644

arch/arm/mach-s5pc100/include/mach/irqs.h line 112

Quoted 8 lines
arch/arm/mach-s5pc100/include/mach/irqs.h +5 -0
@@ -105,4 +105,9 @@
 
 #define NR_IRQS		(IRQ_EINT(31) + 1)
 
+/* Compatibility */
+#define IRQ_LCD_FIFO		IRQ_LCD0
+#define IRQ_LCD_VSYNC		IRQ_LCD1
+#define IRQ_LCD_SYSTEM		IRQ_LCD2
+

I found above code in the mainline.
Please check commit edd6e3f89d7fe245149669400bd213140c16d6e4 that is from Pawel Osciak.

Quoted 15 lines
arch/arm/mach-s5pc100/include/mach/irqs.h +0 -0
 #endif /* __ASM_ARCH_IRQS_H */
arch/arm/mach- renamed from arch/arm/mach-s5pc100/include/mach/map.h +0 -0

s5pc100/include/mach/map.h
index a79b09f..f08fd76 100644

arch/arm/mach-s5pc100/include/mach/map.h +0 -1
@@ -25,7 +25,6 @@
 #define S5PC100_PA_OTHERS	(0xE0200000)
 #define S5PC100_VA_OTHERS	(S3C_VA_SYS + 0x10000)
 
-
 #define S5PC100_PA_GPIO		(0xE0300000)
 #define S5P_PA_GPIO		S5PC100_PA_GPIO
 

arch/arm/mach-s5pc100/include/mach/map.h line 58

Quoted 7 lines
arch/arm/mach-s5pc100/include/mach/map.h +3 -0
@@ -53,11 +52,15 @@
 
 #define S5PC100_PA_IIC0		(0xEC100000)
 
+#define S5PC100_PA_FB		(0xEE000000)
+
 #define S5PC100_PA_SDRAM	(0x20000000)
+

Don't need empty line.

Review

Quoted 9 lines
arch/arm/mach-s5pc100/include/mach/map.h +1 -0
 #define S5P_PA_SDRAM		S5PC100_PA_SDRAM
 
 /* compatibiltiy defines. */
 #define S3C_PA_UART		S5PC100_PA_UART
 #define S3C_PA_IIC		S5PC100_PA_IIC0
+#define S3C_PA_FB		S5PC100_PA_FB
 
 #endif /* __ASM_ARCH_MAP_H */
(quoted diff) +0 -0

b/arch/arm/mach-s5pc100/setup-

Quoted 10 lines

fb-24bpp.c
similarity index 91%
rename from arch/arm/plat-s5pc1xx/setup-fb-24bpp.c rename to arch/arm/mach-s5pc100/setup-fb-24bpp.c index b02c36f..6eba6cb 100644

arch/arm/mach-s5pc100/setup-fb-24bpp.c renamed from arch/arm/plat-s5pc1xx/setup-fb-24bpp.c +0 -1
@@ -1,9 +1,9 @@
 /*
- * linux/arch/arm/plat-s5pc100/setup-fb-24bpp.c

arch/arm/mach-s5pc100/setup-fb-24bpp.c

Quoted 10 lines
arch/arm/mach-s5pc100/setup-fb-24bpp.c renamed from arch/arm/plat-s5pc1xx/setup-fb-24bpp.c +2 -2
+ * linux/arch/arm/mach-s5pc100/setup-fb-24bpp.c
  *
  * Copyright 2009 Samsung Electronics
  *
- * Base S5PC1XX setup information for 24bpp LCD framebuffer
+ * Base S5PC100 setup information for 24bpp LCD framebuffer
  *
  * 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
--

In your setup-fb-24bpp.c,
- No need DISR_OFFSET definition that is not used.

And I can't apply this patch to my branches which are based on Ben's next-samsung or Linus' 34-rc7 also.

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.

#35 lore raw

PATCH 8/16 ARM: S5PC100: Move frame buffer helpers from plat-s5pc1xx to mach-s5pc100

Hello,

Quoted 24 lines · Kukjin Kim

arch/arm/mach-

Quoted 15 lines · Marek Szyprowski

Move frame buffer helpers from plat-s5pc1xx to mach-s5pc100.

---
 arch/arm/mach-s5pc100/Kconfig                      |    7 +++++++
 arch/arm/mach-s5pc100/Makefile                     |    4 ++++
 arch/arm/mach-s5pc100/include/mach/irqs.h          |    5 +++++
 arch/arm/mach-s5pc100/include/mach/map.h           |    5 ++++-
 .../setup-fb-24bpp.c                               |    4 ++--
 5 files changed, 22 insertions(+), 3 deletions(-)
 rename arch/arm/{plat-s5pc1xx => mach-s5pc100}/setup-fb-24bpp.c (91%)
arch/arm/mach- renamed from arch/arm/mach-s5pc100/Kconfig +0 -0

s5pc100/Kconfig

Quoted 7 lines

index 54c83a4..26e0028 100644

arch/arm/mach-s5pc100/Kconfig +0 -0
@@ -12,6 +12,13 @@ config CPU_S5PC100
 	help
 	  Enable S5PC100 CPU support
 
Quoted 3 lines

arch/arm/mach-s5pc100/Kconfig config CPU_S5PC100 · line 15

Quoted 1 line
arch/arm/mach-s5pc100/Kconfig +1 -0
+# platform specific device setup

I think 'machine' is better in your comment than 'platform'

ok

Quoted 34 lines

Review

Quoted 10 lines
arch/arm/mach-s5pc100/Kconfig +6 -0
+
+config S5PC100_SETUP_FB_24BPP
+	bool
+	help
+          Common setup code for S5PC100 with an 24bpp RGB display helper.
+
 config MACH_SMDKC100
 	bool "SMDKC100"
 	select CPU_S5PC100
(quoted diff) +0 -0

b/arch/arm/mach-s5pc100/Makefile

Quoted 23 lines

index 187b06d..878dc61 100644

arch/arm/mach-s5pc100/Makefile +4 -0
@@ -14,6 +14,10 @@ obj-				:=
 obj-$(CONFIG_CPU_S5PC100)	+= cpu.o init.o clock.o gpio.o
 obj-$(CONFIG_CPU_S5PC100)	+= setup-i2c0.o
 
+# Device setup
+
+obj-$(CONFIG_S5PC100_SETUP_FB_24BPP) += setup-fb-24bpp.o
+
 # machine support
 
 obj-$(CONFIG_MACH_SMDKC100)	+= mach-smdkc100.o
arch/arm/mach- renamed from arch/arm/mach-s5pc100/include/mach/irqs.h +0 -0

s5pc100/include/mach/irqs.h
index 6789eeb..c0747f1 100644

arch/arm/mach-s5pc100/include/mach/irqs.h +0 -0
@@ -105,4 +105,9 @@
 
 #define NR_IRQS		(IRQ_EINT(31) + 1)
 
Quoted 9 lines

arch/arm/mach-s5pc100/include/mach/irqs.h line 112

Quoted 5 lines
arch/arm/mach-s5pc100/include/mach/irqs.h +5 -0
+/* Compatibility */
+#define IRQ_LCD_FIFO		IRQ_LCD0
+#define IRQ_LCD_VSYNC		IRQ_LCD1
+#define IRQ_LCD_SYSTEM		IRQ_LCD2
+

I found above code in the mainline.
Please check commit edd6e3f89d7fe245149669400bd213140c16d6e4 that is from Pawel Osciak.

err, right. that code was already in mach-s5pc100/include/mach/irqs.h, but got removed accidentally in "ARM: Samsung: move S5PC100 support from plat-s5pc1xx to plat-s5p framework" patch. I will fix this.

Quoted 17 lines
Quoted 17 lines
arch/arm/mach-s5pc100/include/mach/irqs.h +0 -0
 #endif /* __ASM_ARCH_IRQS_H */
arch/arm/mach- renamed from arch/arm/mach-s5pc100/include/mach/map.h +0 -0

s5pc100/include/mach/map.h
index a79b09f..f08fd76 100644

arch/arm/mach-s5pc100/include/mach/map.h +0 -1
@@ -25,7 +25,6 @@
 #define S5PC100_PA_OTHERS	(0xE0200000)
 #define S5PC100_VA_OTHERS	(S3C_VA_SYS + 0x10000)
 
-
 #define S5PC100_PA_GPIO		(0xE0300000)
 #define S5P_PA_GPIO		S5PC100_PA_GPIO
 
@@ -53,11 +52,15 @@
 
Quoted 8 lines

arch/arm/mach-s5pc100/include/mach/map.h line 58

Quoted 6 lines
arch/arm/mach-s5pc100/include/mach/map.h +3 -0
 #define S5PC100_PA_IIC0		(0xEC100000)
 
+#define S5PC100_PA_FB		(0xEE000000)
+
 #define S5PC100_PA_SDRAM	(0x20000000)
+

Don't need empty line.

Ok.

Quoted 26 lines

Review

Quoted 10 lines
arch/arm/mach-s5pc100/include/mach/map.h +1 -0
 #define S5P_PA_SDRAM		S5PC100_PA_SDRAM
 
 /* compatibiltiy defines. */
 #define S3C_PA_UART		S5PC100_PA_UART
 #define S3C_PA_IIC		S5PC100_PA_IIC0
+#define S3C_PA_FB		S5PC100_PA_FB
 
 #endif /* __ASM_ARCH_MAP_H */
(quoted diff) +0 -0

b/arch/arm/mach-s5pc100/setup-

Quoted 15 lines

fb-24bpp.c
similarity index 91%
rename from arch/arm/plat-s5pc1xx/setup-fb-24bpp.c rename to arch/arm/mach-s5pc100/setup-fb-24bpp.c index b02c36f..6eba6cb 100644

arch/arm/mach-s5pc100/setup-fb-24bpp.c renamed from arch/arm/plat-s5pc1xx/setup-fb-24bpp.c +1 -2
@@ -1,9 +1,9 @@
 /*
- * linux/arch/arm/plat-s5pc100/setup-fb-24bpp.c
+ * linux/arch/arm/mach-s5pc100/setup-fb-24bpp.c
  *
  * Copyright 2009 Samsung Electronics
  *
- * Base S5PC1XX setup information for 24bpp LCD framebuffer
Quoted 8 lines

arch/arm/mach-s5pc100/setup-fb-24bpp.c

Quoted 5 lines
arch/arm/mach-s5pc100/setup-fb-24bpp.c renamed from arch/arm/plat-s5pc1xx/setup-fb-24bpp.c +1 -1
+ * Base S5PC100 setup information for 24bpp LCD framebuffer
  *
  * 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
--

In your setup-fb-24bpp.c,
- No need DISR_OFFSET definition that is not used.

ok

Quoted 2 lines

And I can't apply this patch to my branches which are based on Ben's next-samsung or Linus' 34-rc7 also.

Yes, they were generated a few weeks ago, then there were some changes here and there in Ben's next-samsung. I've rebased these patches onto the latest next-samsung tree. You can get them from:

git://git.infradead.org/users/kmpark/linux-2.6-samsung

branch next-samsung-s5pc1xx.

Best regards
--
Marek Szyprowski
Samsung Poland R&D Center

#36 lore raw

PATCH 9/16 ARM: SMDKC100: enable frame buffer again

In reply to Marek Szyprowski

This patch enables support for s3c frame buffer driver on SMDKC100 machine. It also fixes the wrongly defined pixel clock value (it worked only before commit eb29a5cc0b601).

---
 arch/arm/mach-s5pc100/Kconfig         |    2 ++
 arch/arm/mach-s5pc100/mach-smdkc100.c |   13 +++++--------
 2 files changed, 7 insertions(+), 8 deletions(-)
arch/arm/mach-s5pc100/Kconfig +2 -0
index 26e0028..1e7b9a7 100644
@@ -22,6 +22,8 @@ config S5PC100_SETUP_FB_24BPP
 config MACH_SMDKC100
 	bool "SMDKC100"
 	select CPU_S5PC100
+	select S5PC100_SETUP_FB_24BPP
+	select S3C_DEV_FB
 	help
 	  Machine support for the Samsung SMDKC100
 
arch/arm/mach-s5pc100/mach-smdkc100.c +5 -8
index 8dec25f..44984be 100644
@@ -85,7 +85,7 @@ static struct i2c_board_info i2c_devs0[] __initdata = {
 /* I2C1 */
 static struct i2c_board_info i2c_devs1[] __initdata = {
 };
-
+#endif
 /* LCD power controller */
 static void smdkc100_lcd_power_set(struct plat_lcd_data *pd,
 				   unsigned int power)
@@ -118,8 +118,7 @@ static struct platform_device smdkc100_lcd_powerdev = {
 static struct s3c_fb_pd_win smdkc100_fb_win0 = {
 	/* this is to ensure we use win0 */
 	.win_mode	= {
-		.refresh	= 70,
-		.pixclock	= (8+13+3+800)*(7+5+1+480),
+		.pixclock = 1000000000000ULL / ((8+13+3+800)*(7+5+1+480)*80),
 		.left_margin	= 8,
 		.right_margin	= 13,
 		.upper_margin	= 7,
@@ -139,17 +138,16 @@ static struct s3c_fb_platdata smdkc100_lcd_pdata __initdata = {
 	.vidcon1	= VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC,
 	.setup_gpio	= s5pc100_fb_gpio_setup_24bpp,
 };
-#endif
 
 static struct platform_device *smdkc100_devices[] __initdata = {
+	&s3c_device_fb,
+	&smdkc100_lcd_powerdev,
 #if 0
 	&s3c_device_i2c0,
 	&s3c_device_i2c1,
-	&s3c_device_fb,
 	&s3c_device_hsmmc0,
 	&s3c_device_hsmmc1,
 	&s3c_device_hsmmc2,
-	&smdkc100_lcd_powerdev,
 #endif
 };
 
@@ -168,7 +166,7 @@ static void __init smdkc100_machine_init(void)
 	s3c_i2c1_set_platdata(NULL);
 	i2c_register_board_info(0, i2c_devs0, ARRAY_SIZE(i2c_devs0));
 	i2c_register_board_info(1, i2c_devs1, ARRAY_SIZE(i2c_devs1));
-
+#endif
 	s3c_fb_set_platdata(&smdkc100_lcd_pdata);
 
 	/* LCD init */
@@ -176,7 +174,6 @@ static void __init smdkc100_machine_init(void)
 	gpio_request(S5PC100_GPH0(6), "GPH0");
 	smdkc100_lcd_power_set(&smdkc100_lcd_power_data, 0);
 	platform_add_devices(smdkc100_devices, ARRAY_SIZE(smdkc100_devices));
-#endif
 }
 
 MACHINE_START(SMDKC100, "SMDKC100")
Signature · 1 line
1.6.4
#37 lore raw

PATCH 9/16 ARM: SMDKC100: enable frame buffer again

Quoted 31 lines · Marek Szyprowski

This patch enables support for s3c frame buffer driver on SMDKC100 machine. It also fixes the wrongly defined pixel clock value (it worked only before commit eb29a5cc0b601).

---
 arch/arm/mach-s5pc100/Kconfig         |    2 ++
 arch/arm/mach-s5pc100/mach-smdkc100.c |   13 +++++--------
 2 files changed, 7 insertions(+), 8 deletions(-)
arch/arm/mach-s5pc100/Kconfig +2 -0
index 26e0028..1e7b9a7 100644
@@ -22,6 +22,8 @@ config S5PC100_SETUP_FB_24BPP
 config MACH_SMDKC100
 	bool "SMDKC100"
 	select CPU_S5PC100
+	select S5PC100_SETUP_FB_24BPP
+	select S3C_DEV_FB
 	help
 	  Machine support for the Samsung SMDKC100
 
arch/arm/mach- renamed from arch/arm/mach-s5pc100/mach-smdkc100.c +0 -0

s5pc100/mach-smdkc100.c
index 8dec25f..44984be 100644

arch/arm/mach-s5pc100/mach-smdkc100.c static struct i2c_board_info i2c_devs0[] __initdata = { · line 88

Quoted 5 lines
arch/arm/mach-s5pc100/mach-smdkc100.c +1 -1
@@ -85,7 +85,7 @@ static struct i2c_board_info i2c_devs0[] __initdata = {
 /* I2C1 */
 static struct i2c_board_info i2c_devs1[] __initdata = {
 };
-
+#endif

What's the pair of the above '#endif'?

arch/arm/mach-s5pc100/mach-smdkc100.c static struct platform_device smdkc100_lcd_powerdev = { · line 121

Quoted 10 lines
arch/arm/mach-s5pc100/mach-smdkc100.c +1 -2
 /* LCD power controller */
 static void smdkc100_lcd_power_set(struct plat_lcd_data *pd,
 				   unsigned int power)
@@ -118,8 +118,7 @@ static struct platform_device smdkc100_lcd_powerdev = {
 static struct s3c_fb_pd_win smdkc100_fb_win0 = {
 	/* this is to ensure we use win0 */
 	.win_mode	= {
-		.refresh	= 70,
-		.pixclock	= (8+13+3+800)*(7+5+1+480),
+		.pixclock = 1000000000000ULL / ((8+13+3+800)*(7+5+1+480)*80),

Too many 0 :-(
And how about using the definition in the related LCD driver than hard coding.

Quoted 14 lines
arch/arm/mach-s5pc100/mach-smdkc100.c +2 -1
 		.left_margin	= 8,
 		.right_margin	= 13,
 		.upper_margin	= 7,
@@ -139,17 +138,16 @@ static struct s3c_fb_platdata smdkc100_lcd_pdata
 __initdata = {
 	.vidcon1	= VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC,
 	.setup_gpio	= s5pc100_fb_gpio_setup_24bpp,
 };
-#endif
 
 static struct platform_device *smdkc100_devices[] __initdata = {
+	&s3c_device_fb,
+	&smdkc100_lcd_powerdev,

arch/arm/mach-s5pc100/mach-smdkc100.c static struct s3c_fb_platdata smdkc100_lcd_pdata · line 153

Quoted 10 lines
arch/arm/mach-s5pc100/mach-smdkc100.c +0 -2
 #if 0
 	&s3c_device_i2c0,
 	&s3c_device_i2c1,
-	&s3c_device_fb,
 	&s3c_device_hsmmc0,
 	&s3c_device_hsmmc1,
 	&s3c_device_hsmmc2,
-	&smdkc100_lcd_powerdev,
 #endif
 };

In the above code, need #if 0?

Quoted 17 lines
arch/arm/mach-s5pc100/mach-smdkc100.c +1 -2
@@ -168,7 +166,7 @@ static void __init smdkc100_machine_init(void)
 	s3c_i2c1_set_platdata(NULL);
 	i2c_register_board_info(0, i2c_devs0, ARRAY_SIZE(i2c_devs0));
 	i2c_register_board_info(1, i2c_devs1, ARRAY_SIZE(i2c_devs1));
-
+#endif
 	s3c_fb_set_platdata(&smdkc100_lcd_pdata);
 
 	/* LCD init */
@@ -176,7 +174,6 @@ static void __init smdkc100_machine_init(void)
 	gpio_request(S5PC100_GPH0(6), "GPH0");
 	smdkc100_lcd_power_set(&smdkc100_lcd_power_data, 0);
 	platform_add_devices(smdkc100_devices,
 ARRAY_SIZE(smdkc100_devices));
-#endif
 }
 
Quoted 2 lines

MACHINE_START(SMDKC100, "SMDKC100")
--

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.

#38 lore raw

PATCH 10/16 ARM: S5PC100: Move i2c helpers from plat-s5pc1xx to mach-s5pc100

In reply to Marek Szyprowski

Move i2c helpers from plat-s5pc1xx to mach-s5pc100.

---
 arch/arm/mach-s5pc100/Kconfig                      |    5 +++
 arch/arm/mach-s5pc100/Makefile                     |    1 +
 arch/arm/mach-s5pc100/cpu.c                        |    5 +++
 arch/arm/mach-s5pc100/include/mach/map.h           |    2 +
 arch/arm/mach-s5pc100/setup-i2c0.c                 |   13 ++++++--
 .../{plat-s5pc1xx => mach-s5pc100}/setup-i2c1.c    |    4 +-
 arch/arm/plat-s5pc1xx/setup-i2c0.c                 |   30 --------------------
 7 files changed, 24 insertions(+), 36 deletions(-)
 rename arch/arm/{plat-s5pc1xx => mach-s5pc100}/setup-i2c1.c (89%)
 delete mode 100644 arch/arm/plat-s5pc1xx/setup-i2c0.c
arch/arm/mach-s5pc100/Kconfig +5 -0
index 1e7b9a7..03a51e2 100644
@@ -19,6 +19,11 @@ config S5PC100_SETUP_FB_24BPP
 	help
           Common setup code for S5PC100 with an 24bpp RGB display helper.
 
+config S5PC100_SETUP_I2C1
+	bool
+	help
+	  Common setup code for i2c bus 1.
+
 config MACH_SMDKC100
 	bool "SMDKC100"
 	select CPU_S5PC100
arch/arm/mach-s5pc100/Makefile +1 -0
index 878dc61..522d8b7 100644
@@ -17,6 +17,7 @@ obj-$(CONFIG_CPU_S5PC100)	+= setup-i2c0.o
 # Device setup
 
 obj-$(CONFIG_S5PC100_SETUP_FB_24BPP) += setup-fb-24bpp.o
+obj-$(CONFIG_S5PC100_SETUP_I2C1) += setup-i2c1.o
 
 # machine support
 
arch/arm/mach-s5pc100/cpu.c +5 -0
index 7d65b61..ec92290 100644
@@ -38,6 +38,7 @@
 #include <plat/cpu.h>
 #include <plat/devs.h>
 #include <plat/clock.h>
+#include <plat/iic-core.h>
 #include <plat/s5pc100.h>
 
 /* Initial IO mappings */
@@ -77,6 +78,10 @@ static void s5pc100_idle(void)
 void __init s5pc100_map_io(void)
 {
 	iotable_init(s5pc100_iodesc, ARRAY_SIZE(s5pc100_iodesc));
+
+	/* the i2c devices are directly compatible with s3c2440 */
+	s3c_i2c0_setname("s3c2440-i2c");
+	s3c_i2c1_setname("s3c2440-i2c");
 }
 
 void __init s5pc100_init_clocks(int xtal)
arch/arm/mach-s5pc100/include/mach/map.h +2 -0
index f08fd76..82a1c9d 100644
@@ -51,6 +51,7 @@
 #define S5P_SZ_UART		SZ_256
 
 #define S5PC100_PA_IIC0		(0xEC100000)
+#define S5PC100_PA_IIC1		(0xEC200000)
 
 #define S5PC100_PA_FB		(0xEE000000)
 
@@ -61,6 +62,7 @@
 /* compatibiltiy defines. */
 #define S3C_PA_UART		S5PC100_PA_UART
 #define S3C_PA_IIC		S5PC100_PA_IIC0
+#define S3C_PA_IIC1		S5PC100_PA_IIC1
 #define S3C_PA_FB		S5PC100_PA_FB
 
 #endif /* __ASM_ARCH_MAP_H */
arch/arm/mach-s5pc100/setup-i2c0.c +9 -4
index 8f65e58..dd3174e 100644
@@ -1,9 +1,9 @@
 /* linux/arch/arm/mach-s5pc100/setup-i2c0.c
  *
- * Copyright (c) 2009 Samsung Electronics Co., Ltd.
- *		http://www.samsung.com/
+ * Copyright 2009 Samsung Electronics Co.
+ *	Byungho Min <[email protected]>
  *
- * I2C0 GPIO configuration.
+ * Base S5PC100 I2C bus 0 gpio configuration
  *
  * Based on plat-s3c64xx/setup-i2c0.c
  *
@@ -17,9 +17,14 @@
 
 struct platform_device; /* don't need the contents */
 
+#include <linux/gpio.h>
 #include <plat/iic.h>
+#include <plat/gpio-cfg.h>
 
 void s3c_i2c0_cfg_gpio(struct platform_device *dev)
 {
-	/* Will be populated later */
+	s3c_gpio_cfgpin(S5PC100_GPD(3), S3C_GPIO_SFN(2));
+	s3c_gpio_setpull(S5PC100_GPD(3), S3C_GPIO_PULL_UP);
+	s3c_gpio_cfgpin(S5PC100_GPD(4), S3C_GPIO_SFN(2));
+	s3c_gpio_setpull(S5PC100_GPD(4), S3C_GPIO_PULL_UP);
 }
arch/arm/mach-s5pc100/setup-i2c1.c renamed from arch/arm/plat-s5pc1xx/setup-i2c1.c +2 -2
similarity index 89%
rename from arch/arm/plat-s5pc1xx/setup-i2c1.c
rename to arch/arm/mach-s5pc100/setup-i2c1.c
index a0a8b4a..d1fec26 100644
@@ -1,9 +1,9 @@
-/* linux/arch/arm/plat-s3c64xx/setup-i2c1.c
+/* linux/arch/arm/mach-s5pc100/setup-i2c1.c
  *
  * Copyright 2009 Samsung Electronics Co.
  *	Byungho Min <[email protected]>
  *
- * Base S5PC1XX I2C bus 1 gpio configuration
+ * Base S5PC100 I2C bus 1 gpio configuration
  *
  * Based on plat-s3c64xx/setup-i2c1.c
  *
arch/arm/plat-s5pc1xx/setup-i2c0.c deleted +0 -30
deleted file mode 100644
index 5e4a7c3..0000000
@@ -1,30 +0,0 @@
-/* linux/arch/arm/plat-s5pc1xx/setup-i2c0.c
- *
- * Copyright 2009 Samsung Electronics Co.
- *	Byungho Min <[email protected]>
- *
- * Base S5PC1XX I2C bus 0 gpio configuration
- *
- * Based on plat-s3c64xx/setup-i2c0.c
- *
- * 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.
-*/
-
-#include <linux/kernel.h>
-#include <linux/types.h>
-
-struct platform_device; /* don't need the contents */
-
-#include <linux/gpio.h>
-#include <plat/iic.h>
-#include <plat/gpio-cfg.h>
-
-void s3c_i2c0_cfg_gpio(struct platform_device *dev)
-{
-	s3c_gpio_cfgpin(S5PC100_GPD(3), S3C_GPIO_SFN(2));
-	s3c_gpio_setpull(S5PC100_GPD(3), S3C_GPIO_PULL_UP);
-	s3c_gpio_cfgpin(S5PC100_GPD(4), S3C_GPIO_SFN(2));
-	s3c_gpio_setpull(S5PC100_GPD(4), S3C_GPIO_PULL_UP);
-}
Signature · 1 line
1.6.4
#39 lore raw

PATCH 10/16 ARM: S5PC100: Move i2c helpers from plat-s5pc1xx to mach-s5pc100

Quoted 5 lines · Marek Szyprowski

Move i2c helpers from plat-s5pc1xx to mach-s5pc100.

Quoted 8 lines
---
 arch/arm/mach-s5pc100/Kconfig                      |    5 +++
 arch/arm/mach-s5pc100/Makefile                     |    1 +
 arch/arm/mach-s5pc100/cpu.c                        |    5 +++
 arch/arm/mach-s5pc100/include/mach/map.h           |    2 +
 arch/arm/mach-s5pc100/setup-i2c0.c                 |   13 ++++++--
 .../{plat-s5pc1xx => mach-s5pc100}/setup-i2c1.c    |    4 +-
 arch/arm/plat-s5pc1xx/setup-i2c0.c                 |   30

--------------------

Review

Quoted 21 lines
 7 files changed, 24 insertions(+), 36 deletions(-)
 rename arch/arm/{plat-s5pc1xx => mach-s5pc100}/setup-i2c1.c (89%)
 delete mode 100644 arch/arm/plat-s5pc1xx/setup-i2c0.c
arch/arm/mach-s5pc100/Kconfig +5 -0
index 1e7b9a7..03a51e2 100644
@@ -19,6 +19,11 @@ config S5PC100_SETUP_FB_24BPP
 	help
           Common setup code for S5PC100 with an 24bpp RGB display helper.
 
+config S5PC100_SETUP_I2C1
+	bool
+	help
+	  Common setup code for i2c bus 1.
+
 config MACH_SMDKC100
 	bool "SMDKC100"
 	select CPU_S5PC100
(quoted diff) +0 -0

b/arch/arm/mach-s5pc100/Makefile

Review

Quoted 56 lines

index 878dc61..522d8b7 100644

arch/arm/mach-s5pc100/Makefile +1 -0
@@ -17,6 +17,7 @@ obj-$(CONFIG_CPU_S5PC100)	+= setup-i2c0.o
 # Device setup
 
 obj-$(CONFIG_S5PC100_SETUP_FB_24BPP) += setup-fb-24bpp.o
+obj-$(CONFIG_S5PC100_SETUP_I2C1) += setup-i2c1.o
 
 # machine support
 
arch/arm/mach-s5pc100/cpu.c +5 -0
index 7d65b61..ec92290 100644
@@ -38,6 +38,7 @@
 #include <plat/cpu.h>
 #include <plat/devs.h>
 #include <plat/clock.h>
+#include <plat/iic-core.h>
 #include <plat/s5pc100.h>
 
 /* Initial IO mappings */
@@ -77,6 +78,10 @@ static void s5pc100_idle(void)
 void __init s5pc100_map_io(void)
 {
 	iotable_init(s5pc100_iodesc, ARRAY_SIZE(s5pc100_iodesc));
+
+	/* the i2c devices are directly compatible with s3c2440 */
+	s3c_i2c0_setname("s3c2440-i2c");
+	s3c_i2c1_setname("s3c2440-i2c");
 }
 
 void __init s5pc100_init_clocks(int xtal)
arch/arm/mach- renamed from arch/arm/mach-s5pc100/include/mach/map.h +0 -0

s5pc100/include/mach/map.h
index f08fd76..82a1c9d 100644

arch/arm/mach-s5pc100/include/mach/map.h +2 -0
@@ -51,6 +51,7 @@
 #define S5P_SZ_UART		SZ_256
 
 #define S5PC100_PA_IIC0		(0xEC100000)
+#define S5PC100_PA_IIC1		(0xEC200000)
 
 #define S5PC100_PA_FB		(0xEE000000)
 
@@ -61,6 +62,7 @@
 /* compatibiltiy defines. */
 #define S3C_PA_UART		S5PC100_PA_UART
 #define S3C_PA_IIC		S5PC100_PA_IIC0
+#define S3C_PA_IIC1		S5PC100_PA_IIC1
 #define S3C_PA_FB		S5PC100_PA_FB
 
 #endif /* __ASM_ARCH_MAP_H */
(quoted diff) +0 -0

b/arch/arm/mach-s5pc100/setup-

Review

Quoted 34 lines

i2c0.c
index 8f65e58..dd3174e 100644

arch/arm/mach-s5pc100/setup-i2c0.c +9 -4
@@ -1,9 +1,9 @@
 /* linux/arch/arm/mach-s5pc100/setup-i2c0.c
  *
- * Copyright (c) 2009 Samsung Electronics Co., Ltd.
- *		http://www.samsung.com/
+ * Copyright 2009 Samsung Electronics Co.
+ *	Byungho Min <[email protected]>
  *
- * I2C0 GPIO configuration.
+ * Base S5PC100 I2C bus 0 gpio configuration
  *
  * Based on plat-s3c64xx/setup-i2c0.c
  *
@@ -17,9 +17,14 @@
 
 struct platform_device; /* don't need the contents */
 
+#include <linux/gpio.h>
 #include <plat/iic.h>
+#include <plat/gpio-cfg.h>
 
 void s3c_i2c0_cfg_gpio(struct platform_device *dev)
 {
-	/* Will be populated later */
+	s3c_gpio_cfgpin(S5PC100_GPD(3), S3C_GPIO_SFN(2));
+	s3c_gpio_setpull(S5PC100_GPD(3), S3C_GPIO_PULL_UP);
+	s3c_gpio_cfgpin(S5PC100_GPD(4), S3C_GPIO_SFN(2));
+	s3c_gpio_setpull(S5PC100_GPD(4), S3C_GPIO_PULL_UP);
 }
(quoted diff) +0 -0

b/arch/arm/mach-s5pc100/setup-

Review

Quoted 20 lines

i2c1.c
similarity index 89%
rename from arch/arm/plat-s5pc1xx/setup-i2c1.c
rename to arch/arm/mach-s5pc100/setup-i2c1.c
index a0a8b4a..d1fec26 100644

arch/arm/mach-s5pc100/setup-i2c1.c renamed from arch/arm/plat-s5pc1xx/setup-i2c1.c +2 -2
@@ -1,9 +1,9 @@
-/* linux/arch/arm/plat-s3c64xx/setup-i2c1.c
+/* linux/arch/arm/mach-s5pc100/setup-i2c1.c
  *
  * Copyright 2009 Samsung Electronics Co.
  *	Byungho Min <[email protected]>
  *
- * Base S5PC1XX I2C bus 1 gpio configuration
+ * Base S5PC100 I2C bus 1 gpio configuration
  *
  * Based on plat-s3c64xx/setup-i2c1.c
  *
(quoted diff) +0 -0

b/arch/arm/plat-s5pc1xx/setup-i2c0.c

Quoted 36 lines

deleted file mode 100644
index 5e4a7c3..0000000

arch/arm/plat-s5pc1xx/setup-i2c0.c deleted +0 -31
@@ -1,30 +0,0 @@
-/* linux/arch/arm/plat-s5pc1xx/setup-i2c0.c
- *
- * Copyright 2009 Samsung Electronics Co.
- *	Byungho Min <[email protected]>
- *
- * Base S5PC1XX I2C bus 0 gpio configuration
- *
- * Based on plat-s3c64xx/setup-i2c0.c
- *
- * 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.
-*/
-
-#include <linux/kernel.h>
-#include <linux/types.h>
-
-struct platform_device; /* don't need the contents */
-
-#include <linux/gpio.h>
-#include <plat/iic.h>
-#include <plat/gpio-cfg.h>
-
-void s3c_i2c0_cfg_gpio(struct platform_device *dev)
-{
-	s3c_gpio_cfgpin(S5PC100_GPD(3), S3C_GPIO_SFN(2));
-	s3c_gpio_setpull(S5PC100_GPD(3), S3C_GPIO_PULL_UP);
-	s3c_gpio_cfgpin(S5PC100_GPD(4), S3C_GPIO_SFN(2));
-	s3c_gpio_setpull(S5PC100_GPD(4), S3C_GPIO_PULL_UP);
-}
--
Quoted 1 line

1.6.4

Looks good.

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.

#40 lore raw

PATCH 11/16 ARM: SMDKC100: enable i2c support again

In reply to Marek Szyprowski

This patch enables support for i2c busses on SMDKC100 machine.

---
 arch/arm/mach-s5pc100/Kconfig         |    2 ++
 arch/arm/mach-s5pc100/mach-smdkc100.c |    8 +++-----
 2 files changed, 5 insertions(+), 5 deletions(-)
arch/arm/mach-s5pc100/Kconfig +2 -0
index 03a51e2..f2d5c23 100644
@@ -28,7 +28,9 @@ config MACH_SMDKC100
 	bool "SMDKC100"
 	select CPU_S5PC100
 	select S5PC100_SETUP_FB_24BPP
+	select S5PC100_SETUP_I2C1
 	select S3C_DEV_FB
+	select S3C_DEV_I2C1
 	help
 	  Machine support for the Samsung SMDKC100
 
arch/arm/mach-s5pc100/mach-smdkc100.c +3 -5
index 44984be..93af963 100644
@@ -77,7 +77,6 @@ static struct s3c2410_uartcfg smdkc100_uartcfgs[] __initdata = {
 	},
 };
 
-#if 0
 /* I2C0 */
 static struct i2c_board_info i2c_devs0[] __initdata = {
 };
@@ -85,7 +84,7 @@ static struct i2c_board_info i2c_devs0[] __initdata = {
 /* I2C1 */
 static struct i2c_board_info i2c_devs1[] __initdata = {
 };
-#endif
+
 /* LCD power controller */
 static void smdkc100_lcd_power_set(struct plat_lcd_data *pd,
 				   unsigned int power)
@@ -142,9 +141,9 @@ static struct s3c_fb_platdata smdkc100_lcd_pdata __initdata = {
 static struct platform_device *smdkc100_devices[] __initdata = {
 	&s3c_device_fb,
 	&smdkc100_lcd_powerdev,
-#if 0
 	&s3c_device_i2c0,
 	&s3c_device_i2c1,
+#if 0
 	&s3c_device_hsmmc0,
 	&s3c_device_hsmmc1,
 	&s3c_device_hsmmc2,
@@ -160,13 +159,12 @@ static void __init smdkc100_map_io(void)
 
 static void __init smdkc100_machine_init(void)
 {
-#if 0
 	/* I2C */
 	s3c_i2c0_set_platdata(NULL);
 	s3c_i2c1_set_platdata(NULL);
 	i2c_register_board_info(0, i2c_devs0, ARRAY_SIZE(i2c_devs0));
 	i2c_register_board_info(1, i2c_devs1, ARRAY_SIZE(i2c_devs1));
-#endif
+
 	s3c_fb_set_platdata(&smdkc100_lcd_pdata);
 
 	/* LCD init */
Signature · 1 line
1.6.4
#41 lore raw

PATCH 11/16 ARM: SMDKC100: enable i2c support again

arch/arm/mach-s5pc100/mach-smdkc100.c static struct s3c2410_uartcfg smdkc100_uartcfgs[]

Quoted 30 lines · Marek Szyprowski

This patch enables support for i2c busses on SMDKC100 machine.

---
 arch/arm/mach-s5pc100/Kconfig         |    2 ++
 arch/arm/mach-s5pc100/mach-smdkc100.c |    8 +++-----
 2 files changed, 5 insertions(+), 5 deletions(-)
arch/arm/mach-s5pc100/Kconfig +2 -0
index 03a51e2..f2d5c23 100644
@@ -28,7 +28,9 @@ config MACH_SMDKC100
 	bool "SMDKC100"
 	select CPU_S5PC100
 	select S5PC100_SETUP_FB_24BPP
+	select S5PC100_SETUP_I2C1
 	select S3C_DEV_FB
+	select S3C_DEV_I2C1
 	help
 	  Machine support for the Samsung SMDKC100
 
arch/arm/mach- renamed from arch/arm/mach-s5pc100/mach-smdkc100.c +0 -0

s5pc100/mach-smdkc100.c
index 44984be..93af963 100644

arch/arm/mach-s5pc100/mach-smdkc100.c +0 -0
@@ -77,7 +77,6 @@ static struct s3c2410_uartcfg smdkc100_uartcfgs[]

__initdata

arch/arm/mach-s5pc100/mach-smdkc100.c static struct s3c2410_uartcfg smdkc100_uartcfgs[] __initdata = { · line 80

Quoted 5 lines
arch/arm/mach-s5pc100/mach-smdkc100.c +0 -1
 = {
 	},
 };
 
-#if 0

Ok.

Quoted 13 lines
arch/arm/mach-s5pc100/mach-smdkc100.c +0 -0
 /* I2C0 */
 static struct i2c_board_info i2c_devs0[] __initdata = {

};

arch/arm/mach-s5pc100/mach-smdkc100.c +1 -1
@@ -85,7 +84,7 @@ static struct i2c_board_info i2c_devs0[] __initdata = {
 /* I2C1 */
 static struct i2c_board_info i2c_devs1[] __initdata = {
 };
-#endif
+
 /* LCD power controller */
 static void smdkc100_lcd_power_set(struct plat_lcd_data *pd,
 				   unsigned int power)

arch/arm/mach-s5pc100/mach-smdkc100.c static struct s3c_fb_platdata smdkc100_lcd_pdata · line 147

Quoted 8 lines
arch/arm/mach-s5pc100/mach-smdkc100.c +1 -1
@@ -142,9 +141,9 @@ static struct s3c_fb_platdata smdkc100_lcd_pdata
 __initdata = {
 static struct platform_device *smdkc100_devices[] __initdata = {
 	&s3c_device_fb,
 	&smdkc100_lcd_powerdev,
-#if 0
 	&s3c_device_i2c0,
 	&s3c_device_i2c1,
+#if 0

Aha ;-)

Quoted 19 lines
arch/arm/mach-s5pc100/mach-smdkc100.c +0 -0
 	&s3c_device_hsmmc0,
 	&s3c_device_hsmmc1,
arch/arm/mach-s5pc100/mach-smdkc100.c +1 -3
 	&s3c_device_hsmmc2,
@@ -160,13 +159,12 @@ static void __init smdkc100_map_io(void)
 
 static void __init smdkc100_machine_init(void)
 {
-#if 0
 	/* I2C */
 	s3c_i2c0_set_platdata(NULL);
 	s3c_i2c1_set_platdata(NULL);
 	i2c_register_board_info(0, i2c_devs0, ARRAY_SIZE(i2c_devs0));
 	i2c_register_board_info(1, i2c_devs1, ARRAY_SIZE(i2c_devs1));
-#endif
+
 	s3c_fb_set_platdata(&smdkc100_lcd_pdata);
 
 	/* LCD init */
--
Quoted 2 lines

1.6.4

Looks good except remaining if 0 :-)
I understand your intention.

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.

#42 lore raw

PATCH 12/16 ARM: S5PC100: Move sdhci helpers from plat-s5pc1xx to mach-s5pc100

In reply to Marek Szyprowski

Move sdhci helpers from plat-s5pc1xx to mach-s5pc100.

---
 arch/arm/mach-s5pc100/Kconfig                      |   11 +++++++++++
 arch/arm/mach-s5pc100/Makefile                     |    2 ++
 arch/arm/mach-s5pc100/cpu.c                        |    6 ++++++
 arch/arm/mach-s5pc100/include/mach/map.h           |    8 ++++++++
 .../setup-sdhci-gpio.c                             |    2 +-
 5 files changed, 28 insertions(+), 1 deletions(-)
 rename arch/arm/{plat-s5pc1xx => mach-s5pc100}/setup-sdhci-gpio.c (97%)
arch/arm/mach-s5pc100/Kconfig +11 -0
index f2d5c23..af64da3 100644
@@ -24,6 +24,17 @@ config S5PC100_SETUP_I2C1
 	help
 	  Common setup code for i2c bus 1.
 
+config S5PC100_SETUP_SDHCI
+        bool
+        select S5PC100_SETUP_SDHCI_GPIO
+        help
+          Internal helper functions for S5PC100 based SDHCI systems
+
+config S5PC100_SETUP_SDHCI_GPIO
+	bool
+	help
+	  Common setup code for SDHCI gpio.
+
 config MACH_SMDKC100
 	bool "SMDKC100"
 	select CPU_S5PC100
arch/arm/mach-s5pc100/Makefile +2 -0
index 522d8b7..9242f14 100644
@@ -18,6 +18,8 @@ obj-$(CONFIG_CPU_S5PC100)	+= setup-i2c0.o
 
 obj-$(CONFIG_S5PC100_SETUP_FB_24BPP) += setup-fb-24bpp.o
 obj-$(CONFIG_S5PC100_SETUP_I2C1) += setup-i2c1.o
+obj-$(CONFIG_S5PC100_SETUP_SDHCI)       += setup-sdhci.o
+obj-$(CONFIG_S5PC100_SETUP_SDHCI_GPIO)	+= setup-sdhci-gpio.o
 
 # machine support
 
arch/arm/mach-s5pc100/cpu.c +6 -0
index ec92290..d424a9f 100644
@@ -39,6 +39,7 @@
 #include <plat/devs.h>
 #include <plat/clock.h>
 #include <plat/iic-core.h>
+#include <plat/sdhci.h>
 #include <plat/s5pc100.h>
 
 /* Initial IO mappings */
@@ -79,6 +80,11 @@ void __init s5pc100_map_io(void)
 {
 	iotable_init(s5pc100_iodesc, ARRAY_SIZE(s5pc100_iodesc));
 
+	/* initialise device information early */
+	s5pc100_default_sdhci0();
+	s5pc100_default_sdhci1();
+	s5pc100_default_sdhci2();
+
 	/* the i2c devices are directly compatible with s3c2440 */
 	s3c_i2c0_setname("s3c2440-i2c");
 	s3c_i2c1_setname("s3c2440-i2c");
arch/arm/mach-s5pc100/include/mach/map.h +8 -0
index 82a1c9d..9d672fa 100644
@@ -55,6 +55,11 @@
 
 #define S5PC100_PA_FB		(0xEE000000)
 
+#define S5PC100_PA_HSMMC(x)	(0xED800000 + ((x) * 0x100000))
+#define S5PC100_PA_HSMMC0	S5PC100_PA_HSMMC(0)
+#define S5PC100_PA_HSMMC1	S5PC100_PA_HSMMC(1)
+#define S5PC100_PA_HSMMC2	S5PC100_PA_HSMMC(2)
+
 #define S5PC100_PA_SDRAM	(0x20000000)
 
 #define S5P_PA_SDRAM		S5PC100_PA_SDRAM
@@ -64,5 +69,8 @@
 #define S3C_PA_IIC		S5PC100_PA_IIC0
 #define S3C_PA_IIC1		S5PC100_PA_IIC1
 #define S3C_PA_FB		S5PC100_PA_FB
+#define S3C_PA_HSMMC0		S5PC100_PA_HSMMC0
+#define S3C_PA_HSMMC1		S5PC100_PA_HSMMC1
+#define S3C_PA_HSMMC2		S5PC100_PA_HSMMC2
 
 #endif /* __ASM_ARCH_MAP_H */
arch/arm/mach-s5pc100/setup-sdhci-gpio.c renamed from arch/arm/plat-s5pc1xx/setup-sdhci-gpio.c +1 -1
similarity index 97%
rename from arch/arm/plat-s5pc1xx/setup-sdhci-gpio.c
rename to arch/arm/mach-s5pc100/setup-sdhci-gpio.c
index 185c894..0248150 100644
@@ -2,7 +2,7 @@
  *
  * Copyright 2009 Samsung Eletronics
  *
- * S5PC1XX - Helper functions for setting up SDHCI device(s) GPIO (HSMMC)
+ * S5PC100 - Helper functions for setting up SDHCI device(s) GPIO (HSMMC)
  *
  * 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
Signature · 1 line
1.6.4
#43 lore raw

PATCH 12/16 ARM: S5PC100: Move sdhci helpers from plat-s5pc1xx to mach-s5pc100

Quoted 19 lines · Marek Szyprowski

Move sdhci helpers from plat-s5pc1xx to mach-s5pc100.

---
 arch/arm/mach-s5pc100/Kconfig                      |   11 +++++++++++
 arch/arm/mach-s5pc100/Makefile                     |    2 ++
 arch/arm/mach-s5pc100/cpu.c                        |    6 ++++++
 arch/arm/mach-s5pc100/include/mach/map.h           |    8 ++++++++
 .../setup-sdhci-gpio.c                             |    2 +-
 5 files changed, 28 insertions(+), 1 deletions(-)
 rename arch/arm/{plat-s5pc1xx => mach-s5pc100}/setup-sdhci-gpio.c (97%)
arch/arm/mach-s5pc100/Kconfig +0 -0
index f2d5c23..af64da3 100644

arch/arm/mach-s5pc100/Kconfig config S5PC100_SETUP_I2C1 · line 32

Quoted 9 lines
arch/arm/mach-s5pc100/Kconfig +6 -0
@@ -24,6 +24,17 @@ config S5PC100_SETUP_I2C1
 	help
 	  Common setup code for i2c bus 1.
 
+config S5PC100_SETUP_SDHCI
+        bool
+        select S5PC100_SETUP_SDHCI_GPIO
+        help
+          Internal helper functions for S5PC100 based SDHCI systems
+

Not aligned.
Please fix it.

Review

Quoted 9 lines
arch/arm/mach-s5pc100/Kconfig +5 -0
+config S5PC100_SETUP_SDHCI_GPIO
+	bool
+	help
+	  Common setup code for SDHCI gpio.
+
 config MACH_SMDKC100
 	bool "SMDKC100"
 	select CPU_S5PC100
(quoted diff) +0 -0

b/arch/arm/mach-s5pc100/Makefile

arch/arm/mach-s5pc100/Makefile obj-$(CONFIG_CPU_S5PC100) += setup-i2c0.o · line 22

Quoted 9 lines

index 522d8b7..9242f14 100644

arch/arm/mach-s5pc100/Makefile +2 -0
@@ -18,6 +18,8 @@ obj-$(CONFIG_CPU_S5PC100)	+= setup-i2c0.o
 
 obj-$(CONFIG_S5PC100_SETUP_FB_24BPP) += setup-fb-24bpp.o
 obj-$(CONFIG_S5PC100_SETUP_I2C1) += setup-i2c1.o
+obj-$(CONFIG_S5PC100_SETUP_SDHCI)       += setup-sdhci.o
+obj-$(CONFIG_S5PC100_SETUP_SDHCI_GPIO)	+= setup-sdhci-gpio.o

How about union the setup-sdhci-gpio.c to setup-sdhci file? I think don't need to separate setup-sdhci and setup-sdhci-gpio file.

Quoted 45 lines
arch/arm/mach-s5pc100/Makefile +0 -0
 # machine support
 
arch/arm/mach-s5pc100/cpu.c +6 -0
index ec92290..d424a9f 100644
@@ -39,6 +39,7 @@
 #include <plat/devs.h>
 #include <plat/clock.h>
 #include <plat/iic-core.h>
+#include <plat/sdhci.h>
 #include <plat/s5pc100.h>
 
 /* Initial IO mappings */
@@ -79,6 +80,11 @@ void __init s5pc100_map_io(void)
 {
 	iotable_init(s5pc100_iodesc, ARRAY_SIZE(s5pc100_iodesc));
 
+	/* initialise device information early */
+	s5pc100_default_sdhci0();
+	s5pc100_default_sdhci1();
+	s5pc100_default_sdhci2();
+
 	/* the i2c devices are directly compatible with s3c2440 */
 	s3c_i2c0_setname("s3c2440-i2c");
 	s3c_i2c1_setname("s3c2440-i2c");
arch/arm/mach- renamed from arch/arm/mach-s5pc100/include/mach/map.h +0 -0

s5pc100/include/mach/map.h
index 82a1c9d..9d672fa 100644

arch/arm/mach-s5pc100/include/mach/map.h +5 -0
@@ -55,6 +55,11 @@
 
 #define S5PC100_PA_FB		(0xEE000000)
 
+#define S5PC100_PA_HSMMC(x)	(0xED800000 + ((x) * 0x100000))
+#define S5PC100_PA_HSMMC0	S5PC100_PA_HSMMC(0)
+#define S5PC100_PA_HSMMC1	S5PC100_PA_HSMMC(1)
+#define S5PC100_PA_HSMMC2	S5PC100_PA_HSMMC(2)
+
 #define S5PC100_PA_SDRAM	(0x20000000)
 
 #define S5P_PA_SDRAM		S5PC100_PA_SDRAM

arch/arm/mach-s5pc100/include/mach/map.h line 74

Quoted 6 lines
arch/arm/mach-s5pc100/include/mach/map.h +3 -0
@@ -64,5 +69,8 @@
 #define S3C_PA_IIC		S5PC100_PA_IIC0
 #define S3C_PA_IIC1		S5PC100_PA_IIC1
 #define S3C_PA_FB		S5PC100_PA_FB
+#define S3C_PA_HSMMC0		S5PC100_PA_HSMMC0
+#define S3C_PA_HSMMC1		S5PC100_PA_HSMMC1
+#define S3C_PA_HSMMC2		S5PC100_PA_HSMMC2

The S5PC100_PA_HSMMC0/1/2 definitions are used only here. It seems better to define S3C_PA_HSMMC0/1/2 using directly S5PC100_PA_HSMMC(x) instead of S5PC100_PA_HSMMC0/1/2.

Quoted 20 lines
arch/arm/mach-s5pc100/include/mach/map.h +0 -0
 #endif /* __ASM_ARCH_MAP_H */
arch/arm/mach- renamed from arch/arm/plat-s5pc1xx/setup-sdhci-gpio.c +0 -0

s5pc100/setup-sdhci-gpio.c
similarity index 97%
rename from arch/arm/plat-s5pc1xx/setup-sdhci-gpio.c rename to arch/arm/mach-s5pc100/setup-sdhci-gpio.c index 185c894..0248150 100644

arch/arm/mach-s5pc100/setup-sdhci-gpio.c renamed from arch/arm/plat-s5pc1xx/setup-sdhci-gpio.c +1 -2
@@ -2,7 +2,7 @@
  *
  * Copyright 2009 Samsung Eletronics
  *
- * S5PC1XX - Helper functions for setting up SDHCI device(s) GPIO (HSMMC)
+ * S5PC100 - Helper functions for setting up SDHCI device(s) GPIO (HSMMC)
  *
  * 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
--
Quoted 1 line

1.6.4

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.

#44 lore raw

PATCH 12/16 ARM: S5PC100: Move sdhci helpers from plat-s5pc1xx to mach-s5pc100

Hello,

Quoted 24 lines · Kukjin Kim

arch/arm/mach-

Quoted 15 lines · Marek Szyprowski

Move sdhci helpers from plat-s5pc1xx to mach-s5pc100.

---
 arch/arm/mach-s5pc100/Kconfig                      |   11 +++++++++++
 arch/arm/mach-s5pc100/Makefile                     |    2 ++
 arch/arm/mach-s5pc100/cpu.c                        |    6 ++++++
 arch/arm/mach-s5pc100/include/mach/map.h           |    8 ++++++++
 .../setup-sdhci-gpio.c                             |    2 +-
 5 files changed, 28 insertions(+), 1 deletions(-)
 rename arch/arm/{plat-s5pc1xx => mach-s5pc100}/setup-sdhci-gpio.c (97%)
arch/arm/mach- renamed from arch/arm/mach-s5pc100/Kconfig +0 -0

s5pc100/Kconfig

Quoted 7 lines

index f2d5c23..af64da3 100644

arch/arm/mach-s5pc100/Kconfig +0 -0
@@ -24,6 +24,17 @@ config S5PC100_SETUP_I2C1
 	help
 	  Common setup code for i2c bus 1.
 
Quoted 9 lines

arch/arm/mach-s5pc100/Kconfig config S5PC100_SETUP_I2C1 · line 32

Quoted 6 lines
arch/arm/mach-s5pc100/Kconfig +6 -0
+config S5PC100_SETUP_SDHCI
+        bool
+        select S5PC100_SETUP_SDHCI_GPIO
+        help
+          Internal helper functions for S5PC100 based SDHCI systems
+

Not aligned.
Please fix it.

ok

Quoted 16 lines

Review

Quoted 10 lines
arch/arm/mach-s5pc100/Kconfig +5 -0
+config S5PC100_SETUP_SDHCI_GPIO
+	bool
+	help
+	  Common setup code for SDHCI gpio.
+
 config MACH_SMDKC100
 	bool "SMDKC100"
 	select CPU_S5PC100
(quoted diff) +0 -0

b/arch/arm/mach-s5pc100/Makefile

Quoted 5 lines

index 522d8b7..9242f14 100644

arch/arm/mach-s5pc100/Makefile +0 -0
@@ -18,6 +18,8 @@ obj-$(CONFIG_CPU_S5PC100)	+= setup-i2c0.o
 
Quoted 7 lines

arch/arm/mach-s5pc100/Makefile obj-$(CONFIG_CPU_S5PC100) += setup-i2c0.o · line 22

Quoted 4 lines
arch/arm/mach-s5pc100/Makefile +2 -0
 obj-$(CONFIG_S5PC100_SETUP_FB_24BPP) += setup-fb-24bpp.o
 obj-$(CONFIG_S5PC100_SETUP_I2C1) += setup-i2c1.o
+obj-$(CONFIG_S5PC100_SETUP_SDHCI)       += setup-sdhci.o
+obj-$(CONFIG_S5PC100_SETUP_SDHCI_GPIO)	+= setup-sdhci-gpio.o

How about union the setup-sdhci-gpio.c to setup-sdhci file? I think don't need to separate setup-sdhci and setup-sdhci-gpio file.

I just followed the style of other Samsung machines (s3c64xx mainly). If required I can merge these two files together.

Quoted 1 line

...

Best regards
--
Marek Szyprowski
Samsung Poland R&D Center

#45 lore raw

PATCH 13/16 ARM: SMDKC100: enable sdhci support again

In reply to Marek Szyprowski

This patch enables support for sdhci controllers on SMDKC100 machine.

---
 arch/arm/mach-s5pc100/Kconfig         |    4 ++++
 arch/arm/mach-s5pc100/mach-smdkc100.c |    2 --
 2 files changed, 4 insertions(+), 2 deletions(-)
arch/arm/mach-s5pc100/Kconfig +4 -0
index af64da3..168bf51 100644
@@ -40,8 +40,12 @@ config MACH_SMDKC100
 	select CPU_S5PC100
 	select S5PC100_SETUP_FB_24BPP
 	select S5PC100_SETUP_I2C1
+	select S5PC100_SETUP_SDHCI
 	select S3C_DEV_FB
 	select S3C_DEV_I2C1
+	select S3C_DEV_HSMMC
+	select S3C_DEV_HSMMC1
+	select S3C_DEV_HSMMC2
 	help
 	  Machine support for the Samsung SMDKC100
 
arch/arm/mach-s5pc100/mach-smdkc100.c +0 -2
index 93af963..052f6db 100644
@@ -143,11 +143,9 @@ static struct platform_device *smdkc100_devices[] __initdata = {
 	&smdkc100_lcd_powerdev,
 	&s3c_device_i2c0,
 	&s3c_device_i2c1,
-#if 0
 	&s3c_device_hsmmc0,
 	&s3c_device_hsmmc1,
 	&s3c_device_hsmmc2,
-#endif
 };
 
 static void __init smdkc100_map_io(void)
Signature · 1 line
1.6.4
#46 lore raw

PATCH 13/16 ARM: SMDKC100: enable sdhci support again

Quoted 44 lines · Marek Szyprowski

This patch enables support for sdhci controllers on SMDKC100 machine.

---
 arch/arm/mach-s5pc100/Kconfig         |    4 ++++
 arch/arm/mach-s5pc100/mach-smdkc100.c |    2 --
 2 files changed, 4 insertions(+), 2 deletions(-)
arch/arm/mach-s5pc100/Kconfig +4 -0
index af64da3..168bf51 100644
@@ -40,8 +40,12 @@ config MACH_SMDKC100
 	select CPU_S5PC100
 	select S5PC100_SETUP_FB_24BPP
 	select S5PC100_SETUP_I2C1
+	select S5PC100_SETUP_SDHCI
 	select S3C_DEV_FB
 	select S3C_DEV_I2C1
+	select S3C_DEV_HSMMC
+	select S3C_DEV_HSMMC1
+	select S3C_DEV_HSMMC2
 	help
 	  Machine support for the Samsung SMDKC100
 
arch/arm/mach- renamed from arch/arm/mach-s5pc100/mach-smdkc100.c +0 -0

s5pc100/mach-smdkc100.c
index 93af963..052f6db 100644

arch/arm/mach-s5pc100/mach-smdkc100.c +0 -2
@@ -143,11 +143,9 @@ static struct platform_device *smdkc100_devices[]
 __initdata = {
 	&smdkc100_lcd_powerdev,
 	&s3c_device_i2c0,
 	&s3c_device_i2c1,
-#if 0
 	&s3c_device_hsmmc0,
 	&s3c_device_hsmmc1,
 	&s3c_device_hsmmc2,
-#endif
 };
 
Quoted 3 lines

static void __init smdkc100_map_io(void)
--
1.6.4

Looks good.

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.

#47 lore raw

PATCH 14/16 ARM: Samsung: Move external interrupts support from plat-s5pc1xx to plat-s5p

In reply to Marek Szyprowski

This patch moves external interrupts support code from plat-s5pc1xx to plat-s5p and enables support for it on ARCH_S5PC100. This code can be easily reused by S5PV210/S5PC110 and probably S5P6442.

---
 arch/arm/mach-s5pc100/Kconfig                  |    1 +
 arch/arm/mach-s5pc100/gpio.c                   |    5 +-
 arch/arm/mach-s5pc100/include/mach/gpio.h      |    8 +++
 arch/arm/mach-s5pc100/include/mach/regs-gpio.h |    2 +-
 arch/arm/plat-s5p/Kconfig                      |   11 +++++
 arch/arm/plat-s5p/Makefile                     |    1 +
 arch/arm/plat-s5p/include/plat/gpio-ext.h      |   44 +++++++++++++++++++
 arch/arm/{plat-s5pc1xx => plat-s5p}/irq-eint.c |   55 ++++++++++++------------
 arch/arm/plat-s5pc1xx/include/plat/gpio-ext.h  |   44 -------------------
 9 files changed, 97 insertions(+), 74 deletions(-)
 create mode 100644 arch/arm/plat-s5p/include/plat/gpio-ext.h
 rename arch/arm/{plat-s5pc1xx => plat-s5p}/irq-eint.c (80%)
 delete mode 100644 arch/arm/plat-s5pc1xx/include/plat/gpio-ext.h
arch/arm/mach-s5pc100/Kconfig +1 -0
index 168bf51..229763c 100644
@@ -9,6 +9,7 @@ if ARCH_S5PC100
 config CPU_S5PC100
 	bool
 	select PLAT_S5P
+	select S5P_IRQ_EINT
 	help
 	  Enable S5PC100 CPU support
 
arch/arm/mach-s5pc100/gpio.c +3 -2
index 9f6fbe1..32a90db 100644
@@ -473,9 +473,10 @@ static __init void s5pc100_gpiolib_link(struct s3c_gpio_chip *chip)
 			set_irq_handler(irq, handle_level_irq);
 			set_irq_flags(irq, IRQF_VALID);
 		}
-	} else if (chip->config == &gpio_cfg_eint)
-		chip->chip.to_irq = s5pc100_gpiolib_to_eint;
+	} else
 #endif
+	if (chip->config == &gpio_cfg_eint)
+		chip->chip.to_irq = s5pc100_gpiolib_to_eint;
 }
 
 static __init void s5pc100_gpiolib_add(struct s3c_gpio_chip *chips,
arch/arm/mach-s5pc100/include/mach/gpio.h +8 -0
index 2c4cbe8..7e07016 100644
@@ -159,4 +159,12 @@ enum s3c_gpio_number {
 /* define the number of gpios we need to the one after the MP04() range */
 #define ARCH_NR_GPIOS		(S5PC100_GPIO_END + 1)
 
+/* Common compatibility defines */
+#define S5P_GPIO_EINT_SFN	S3C_GPIO_SFN(0x2)
+#define S5P_GPH0(n)		S5PC100_GPH0(n)
+#define S5P_GPH1(n)		S5PC100_GPH1(n)
+#define S5P_GPH2(n)		S5PC100_GPH2(n)
+#define S5P_GPH3(n)		S5PC100_GPH3(n)
+#define S5P_GPIO_INT_GROUP_END	S5PC100_GPIO_INT_GROUP_END
+
 #include <asm-generic/gpio.h>
arch/arm/mach-s5pc100/include/mach/regs-gpio.h +1 -1
index b523d84..57234fe 100644
@@ -60,7 +60,7 @@
 
 /* Common part */
 /* External interrupt base is same at both s5pc100 and s5pc110 */
-#define S5PC1XX_EINT_BASE	(S5PC100_EINT_BASE)
+#define S5P_EINT_BASE			(S5PC100_EINT_BASE)
 
 #define S5PC100_GPx_INPUT(__gpio)	(0x0 << ((__gpio) * 4))
 #define S5PC100_GPx_OUTPUT(__gpio)	(0x1 << ((__gpio) * 4))
arch/arm/plat-s5p/Kconfig +11 -0
index 189be6e..bf00e0e 100644
@@ -24,3 +24,14 @@ config PLAT_S5P
 	select SAMSUNG_IRQ_UART
 	help
 	  Base platform code for Samsung's S5P series SoC.
+
+if PLAT_S5P
+
+# Configuration options shared by all S5P implementations
+
+config S5P_IRQ_EINT
+	bool
+	help
+	  Common initialisation code for the EINT support on S5P platform
+
+endif
arch/arm/plat-s5p/Makefile +1 -0
index 0ec09a9..db4801f 100644
@@ -16,3 +16,4 @@ obj-y				+= dev-uart.o
 obj-y				+= cpu.o
 obj-y				+= clock.o
 obj-y				+= irq.o
+obj-$(CONFIG_S5P_IRQ_EINT)	+= irq-eint.o
arch/arm/plat-s5p/include/plat/gpio-ext.h new file +44 -0

44 lines not on this page · raw message

arch/arm/plat-s5p/irq-eint.c renamed from arch/arm/plat-s5pc1xx/irq-eint.c +28 -27

161 lines not on this page · raw message

arch/arm/plat-s5pc1xx/include/plat/gpio-ext.h deleted +0 -44

44 lines not on this page · raw message

Signature · 1 line
1.6.4
#48 lore raw

PATCH 15/16 ARM: S5PC100: Add support for gpio interrupt

In reply to Marek Szyprowski

This patch moves support for gpio interrupts from plat-s5pc1xx to mach-s5pc100 directory.

---
 arch/arm/mach-s5pc100/Makefile                     |    2 +-
 arch/arm/mach-s5pc100/gpio.c                       |    9 +--
 arch/arm/mach-s5pc100/include/mach/irqs.h          |    7 +-
 arch/arm/{plat-s5pc1xx => mach-s5pc100}/irq-gpio.c |   78 ++++++++++----------
 4 files changed, 48 insertions(+), 48 deletions(-)
 rename arch/arm/{plat-s5pc1xx => mach-s5pc100}/irq-gpio.c (72%)
arch/arm/mach-s5pc100/Makefile +1 -1
index 9242f14..d7681bf 100644
@@ -11,7 +11,7 @@ obj-				:=
 
 # Core support for S5PC100 system
 
-obj-$(CONFIG_CPU_S5PC100)	+= cpu.o init.o clock.o gpio.o
+obj-$(CONFIG_CPU_S5PC100)	+= cpu.o init.o clock.o gpio.o irq-gpio.o
 obj-$(CONFIG_CPU_S5PC100)	+= setup-i2c0.o
 
 # Device setup
arch/arm/mach-s5pc100/gpio.c +3 -6
index 32a90db..f53a74b 100644
@@ -129,12 +129,10 @@ static int s5pc100_gpiolib_output(struct gpio_chip *chip,
 	return 0;
 }
 
-#if 0
 static int s5pc100_gpiolib_to_irq(struct gpio_chip *chip, unsigned int offset)
 {
 	return S3C_IRQ_GPIO(chip->base + offset);
 }
-#endif
 
 static int s5pc100_gpiolib_to_eint(struct gpio_chip *chip, unsigned int offset)
 {
@@ -459,7 +457,7 @@ static __init void s5pc100_gpiolib_link(struct s3c_gpio_chip *chip)
 	chip->chip.direction_input = s5pc100_gpiolib_input;
 	chip->chip.direction_output = s5pc100_gpiolib_output;
 	chip->pm = __gpio_pm(&s3c_gpio_pm_4bit);
-#if 0
+
 	/* Interrupt */
 	if (chip->config == &gpio_cfg) {
 		int i, irq;
@@ -474,7 +472,7 @@ static __init void s5pc100_gpiolib_link(struct s3c_gpio_chip *chip)
 			set_irq_flags(irq, IRQF_VALID);
 		}
 	} else
-#endif
+
 	if (chip->config == &gpio_cfg_eint)
 		chip->chip.to_irq = s5pc100_gpiolib_to_eint;
 }
@@ -500,9 +498,8 @@ static __init int s5pc100_gpiolib_init(void)
 
 	s5pc100_gpiolib_add(chips, nr_chips, s5pc100_gpiolib_link);
 	/* Interrupt */
-#if 0
 	set_irq_chained_handler(IRQ_GPIOINT, s5pc100_irq_gpioint_handler);
-#endif
+
 	return 0;
 }
 core_initcall(s5pc100_gpiolib_init);
arch/arm/mach-s5pc100/include/mach/irqs.h +5 -2
index c0747f1..84c74ac 100644
@@ -101,9 +101,12 @@
 
 #define IRQ_EINT(x)             ((x) < 16 ? S5P_IRQ_VIC0(x) : \
 					(S5P_IRQ_EINT_BASE + (x)-16))
-/* Set the default NR_IRQS */
 
-#define NR_IRQS		(IRQ_EINT(31) + 1)
+#define S3C_IRQ_GPIO_BASE	(IRQ_EINT(31) + 1)
+#define S3C_IRQ_GPIO(x)		(S3C_IRQ_GPIO_BASE + (x))
+
+/* Until MP04 Groups -> 40 (exactly 39) Groups * 8 ~= 320 GPIOs */
+#define NR_IRQS		(S3C_IRQ_GPIO(320) + 1)
 
 /* Compatibility */
 #define IRQ_LCD_FIFO		IRQ_LCD0
arch/arm/mach-s5pc100/irq-gpio.c renamed from arch/arm/plat-s5pc1xx/irq-gpio.c +39 -39

177 lines not on this page · raw message

Signature · 1 line
1.6.4
#49 lore raw

PATCH 16/16 ARM: remove obsolete plat-s5pc1xx directory

In reply to Marek Szyprowski

This patch removes all obsolete files from plat-s5pc1xx. This directory is no longer needed. S5PC100 SoC is now completely supported in plat-s5p framework.

---
 arch/arm/plat-s5pc1xx/Kconfig                   |   65 --
 arch/arm/plat-s5pc1xx/Makefile                  |   30 -
 arch/arm/plat-s5pc1xx/clock.c                   |  709 ------------------
 arch/arm/plat-s5pc1xx/cpu.c                     |  122 ----
 arch/arm/plat-s5pc1xx/dev-uart.c                |  145 ----
 arch/arm/plat-s5pc1xx/include/plat/irqs.h       |  198 -----
 arch/arm/plat-s5pc1xx/include/plat/pll.h        |   38 -
 arch/arm/plat-s5pc1xx/include/plat/regs-clock.h |  252 -------
 arch/arm/plat-s5pc1xx/include/plat/regs-power.h |   84 ---
 arch/arm/plat-s5pc1xx/include/plat/s5pc100.h    |   64 --
 arch/arm/plat-s5pc1xx/irq.c                     |   75 --
 arch/arm/plat-s5pc1xx/s5pc100-clock.c           |  876 -----------------------
 12 files changed, 0 insertions(+), 2658 deletions(-)
 delete mode 100644 arch/arm/plat-s5pc1xx/Kconfig
 delete mode 100644 arch/arm/plat-s5pc1xx/Makefile
 delete mode 100644 arch/arm/plat-s5pc1xx/clock.c
 delete mode 100644 arch/arm/plat-s5pc1xx/cpu.c
 delete mode 100644 arch/arm/plat-s5pc1xx/dev-uart.c
 delete mode 100644 arch/arm/plat-s5pc1xx/include/plat/irqs.h
 delete mode 100644 arch/arm/plat-s5pc1xx/include/plat/pll.h
 delete mode 100644 arch/arm/plat-s5pc1xx/include/plat/regs-clock.h
 delete mode 100644 arch/arm/plat-s5pc1xx/include/plat/regs-power.h
 delete mode 100644 arch/arm/plat-s5pc1xx/include/plat/s5pc100.h
 delete mode 100644 arch/arm/plat-s5pc1xx/irq.c
 delete mode 100644 arch/arm/plat-s5pc1xx/s5pc100-clock.c
arch/arm/plat-s5pc1xx/Kconfig deleted +0 -65
deleted file mode 100644
index 79d3be7..0000000
@@ -1,65 +0,0 @@
-# Copyright 2009 Samsung Electronics Co.
-#	Byungho Min <[email protected]>
-#
-# Licensed under GPLv2
-
-config PLAT_S5PC1XX
-	bool
-	depends on ARCH_S5PC1XX
-	default y
-	select PLAT_S3C
-	select ARM_VIC
-	select NO_IOPORT
-	select ARCH_REQUIRE_GPIOLIB
-	select SAMSUNG_CLKSRC
-	select SAMSUNG_IRQ_UART
-	select SAMSUNG_IRQ_VIC_TIMER
-	select S3C_GPIO_TRACK
-	select S3C_GPIO_PULL_UPDOWN
-	select S5P_GPIO_DRVSTR
-	select S3C_GPIO_CFG_S3C24XX
-	select S3C_GPIO_CFG_S3C64XX
-	help
-	  Base platform code for any Samsung S5PC1XX device
-
-if PLAT_S5PC1XX
-
-# Configuration options shared by all S3C64XX implementations
-
-config CPU_S5PC100_INIT
-	bool
-	help
-	  Common initialisation code for the S5PC1XX
-
-config CPU_S5PC100_CLOCK
-	bool
-	help
-	  Common clock support code for the S5PC1XX
-
-# platform specific device setup
-
-config S5PC1XX_SETUP_FB_24BPP
-	bool
-	help
-          Common setup code for S5PC1XX with an 24bpp RGB display helper.
-
-config S5PC1XX_SETUP_I2C0
-	bool
-	default y
-	help
-	  Common setup code for i2c bus 0.
-
-	  Note, currently since i2c0 is always compiled, this setup helper
-	  is always compiled with it.
-
-config S5PC1XX_SETUP_I2C1
-	bool
-	help
-	  Common setup code for i2c bus 1.
-
-config S5PC1XX_SETUP_SDHCI_GPIO
-	bool
-	help
-	  Common setup code for SDHCI gpio.
-
-endif
arch/arm/plat-s5pc1xx/Makefile deleted +0 -30
deleted file mode 100644
index 66a8f3e..0000000
@@ -1,30 +0,0 @@
-# arch/arm/plat-s5pc1xx/Makefile
-#
-# Copyright 2009 Samsung Electronics Co.
-#
-# Licensed under GPLv2
-
-obj-y				:=
-obj-m				:=
-obj-n				:= dummy.o
-obj-				:=
-
-# Core files
-
-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
-
-# Device setup
-
-obj-$(CONFIG_S5PC1XX_SETUP_FB_24BPP) += setup-fb-24bpp.o
-obj-$(CONFIG_S5PC1XX_SETUP_I2C0) += setup-i2c0.o
-obj-$(CONFIG_S5PC1XX_SETUP_I2C1) += setup-i2c1.o
-obj-$(CONFIG_S5PC1XX_SETUP_SDHCI_GPIO)	+= setup-sdhci-gpio.o
arch/arm/plat-s5pc1xx/clock.c deleted +0 -709

709 lines not on this page · raw message

arch/arm/plat-s5pc1xx/cpu.c deleted +0 -122

122 lines not on this page · raw message

arch/arm/plat-s5pc1xx/dev-uart.c deleted +0 -145

145 lines not on this page · raw message

arch/arm/plat-s5pc1xx/include/plat/irqs.h deleted +0 -198

198 lines not on this page · raw message

arch/arm/plat-s5pc1xx/include/plat/pll.h deleted +0 -38
deleted file mode 100644
index 21afef1..0000000
@@ -1,38 +0,0 @@
-/* arch/arm/plat-s5pc1xx/include/plat/pll.h
- *
- * Copyright 2009 Samsung Electronics Co.
- *	Byungho Min <[email protected]>
- *
- * S5PC1XX PLL code
- *
- * Based on plat-s3c64xx/include/plat/pll.h
- *
- * 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.
-*/
-
-#define S5P_PLL_MDIV_MASK	((1 << (25-16+1)) - 1)
-#define S5P_PLL_PDIV_MASK	((1 << (13-8+1)) - 1)
-#define S5P_PLL_SDIV_MASK	((1 << (2-0+1)) - 1)
-#define S5P_PLL_MDIV_SHIFT	(16)
-#define S5P_PLL_PDIV_SHIFT	(8)
-#define S5P_PLL_SDIV_SHIFT	(0)
-
-#include <asm/div64.h>
-
-static inline unsigned long s5pc1xx_get_pll(unsigned long baseclk,
-					    u32 pllcon)
-{
-	u32 mdiv, pdiv, sdiv;
-	u64 fvco = baseclk;
-
-	mdiv = (pllcon >> S5P_PLL_MDIV_SHIFT) & S5P_PLL_MDIV_MASK;
-	pdiv = (pllcon >> S5P_PLL_PDIV_SHIFT) & S5P_PLL_PDIV_MASK;
-	sdiv = (pllcon >> S5P_PLL_SDIV_SHIFT) & S5P_PLL_SDIV_MASK;
-
-	fvco *= mdiv;
-	do_div(fvco, (pdiv << sdiv));
-
-	return (unsigned long)fvco;
-}
arch/arm/plat-s5pc1xx/include/plat/regs-clock.h deleted +0 -252

252 lines not on this page · raw message

arch/arm/plat-s5pc1xx/include/plat/regs-power.h deleted +0 -84

84 lines not on this page · raw message

arch/arm/plat-s5pc1xx/include/plat/s5pc100.h deleted +0 -64

64 lines not on this page · raw message

arch/arm/plat-s5pc1xx/irq.c deleted +0 -75

75 lines not on this page · raw message

arch/arm/plat-s5pc1xx/s5pc100-clock.c deleted +0 -876

876 lines not on this page · raw message

Signature · 1 line
1.6.4