aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKukjin Kim <kgene.kim@samsung.com>2010-11-14 19:18:57 -0500
committerKukjin Kim <kgene.kim@samsung.com>2010-12-29 19:37:48 -0500
commit8cf460a5d7c12e16ba29d0e4940df4657a7439cc (patch)
tree3b3fca476131bf2c0203686142e922c85dde36f6
parent387c31c7e5c9805b0aef8833d1731a5fe7bdea14 (diff)
ARM: S5P: Move the SROM register definitions to plat-s5p
The SROM register difinitions of S5PV310/S5PC210 (mach/regs-srom.h) can be used to other S5P SoCs such as S5PV210/S5PC110. So moved into plat/regs-srom.h of plat-s5p directory. Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
-rw-r--r--arch/arm/mach-s5pv310/include/mach/regs-srom.h50
-rw-r--r--arch/arm/mach-s5pv310/mach-smdkc210.c31
-rw-r--r--arch/arm/mach-s5pv310/mach-smdkv310.c31
-rw-r--r--arch/arm/plat-s5p/include/plat/regs-srom.h50
4 files changed, 80 insertions, 82 deletions
diff --git a/arch/arm/mach-s5pv310/include/mach/regs-srom.h b/arch/arm/mach-s5pv310/include/mach/regs-srom.h
deleted file mode 100644
index 1898b3e10550..000000000000
--- a/arch/arm/mach-s5pv310/include/mach/regs-srom.h
+++ /dev/null
@@ -1,50 +0,0 @@
1/* linux/arch/arm/mach-s5pv310/include/mach/regs-srom.h
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
5 *
6 * S5PV310 - SROMC register definitions
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#ifndef __ASM_ARCH_REGS_SROM_H
14#define __ASM_ARCH_REGS_SROM_H __FILE__
15
16#include <mach/map.h>
17
18#define S5PV310_SROMREG(x) (S5P_VA_SROMC + (x))
19
20#define S5PV310_SROM_BW S5PV310_SROMREG(0x0)
21#define S5PV310_SROM_BC0 S5PV310_SROMREG(0x4)
22#define S5PV310_SROM_BC1 S5PV310_SROMREG(0x8)
23#define S5PV310_SROM_BC2 S5PV310_SROMREG(0xc)
24#define S5PV310_SROM_BC3 S5PV310_SROMREG(0x10)
25
26/* one register BW holds 4 x 4-bit packed settings for NCS0 - NCS3 */
27
28#define S5PV310_SROM_BW__DATAWIDTH__SHIFT 0
29#define S5PV310_SROM_BW__ADDRMODE__SHIFT 1
30#define S5PV310_SROM_BW__WAITENABLE__SHIFT 2
31#define S5PV310_SROM_BW__BYTEENABLE__SHIFT 3
32
33#define S5PV310_SROM_BW__CS_MASK 0xf
34
35#define S5PV310_SROM_BW__NCS0__SHIFT 0
36#define S5PV310_SROM_BW__NCS1__SHIFT 4
37#define S5PV310_SROM_BW__NCS2__SHIFT 8
38#define S5PV310_SROM_BW__NCS3__SHIFT 12
39
40/* applies to same to BCS0 - BCS3 */
41
42#define S5PV310_SROM_BCX__PMC__SHIFT 0
43#define S5PV310_SROM_BCX__TACP__SHIFT 4
44#define S5PV310_SROM_BCX__TCAH__SHIFT 8
45#define S5PV310_SROM_BCX__TCOH__SHIFT 12
46#define S5PV310_SROM_BCX__TACC__SHIFT 16
47#define S5PV310_SROM_BCX__TCOS__SHIFT 24
48#define S5PV310_SROM_BCX__TACS__SHIFT 28
49
50#endif /* __ASM_ARCH_REGS_SROM_H */
diff --git a/arch/arm/mach-s5pv310/mach-smdkc210.c b/arch/arm/mach-s5pv310/mach-smdkc210.c
index 2b8d4fc52d7c..62956d3488b1 100644
--- a/arch/arm/mach-s5pv310/mach-smdkc210.c
+++ b/arch/arm/mach-s5pv310/mach-smdkc210.c
@@ -19,13 +19,13 @@
19#include <asm/mach-types.h> 19#include <asm/mach-types.h>
20 20
21#include <plat/regs-serial.h> 21#include <plat/regs-serial.h>
22#include <plat/regs-srom.h>
22#include <plat/s5pv310.h> 23#include <plat/s5pv310.h>
23#include <plat/cpu.h> 24#include <plat/cpu.h>
24#include <plat/devs.h> 25#include <plat/devs.h>
25#include <plat/sdhci.h> 26#include <plat/sdhci.h>
26 27
27#include <mach/map.h> 28#include <mach/map.h>
28#include <mach/regs-srom.h>
29 29
30/* Following are default values for UCON, ULCON and UFCON UART registers */ 30/* Following are default values for UCON, ULCON and UFCON UART registers */
31#define SMDKC210_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ 31#define SMDKC210_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
@@ -154,23 +154,22 @@ static void __init smdkc210_smsc911x_init(void)
154 u32 cs1; 154 u32 cs1;
155 155
156 /* configure nCS1 width to 16 bits */ 156 /* configure nCS1 width to 16 bits */
157 cs1 = __raw_readl(S5PV310_SROM_BW) & 157 cs1 = __raw_readl(S5P_SROM_BW) &
158 ~(S5PV310_SROM_BW__CS_MASK << 158 ~(S5P_SROM_BW__CS_MASK << S5P_SROM_BW__NCS1__SHIFT);
159 S5PV310_SROM_BW__NCS1__SHIFT); 159 cs1 |= ((1 << S5P_SROM_BW__DATAWIDTH__SHIFT) |
160 cs1 |= ((1 << S5PV310_SROM_BW__DATAWIDTH__SHIFT) | 160 (1 << S5P_SROM_BW__WAITENABLE__SHIFT) |
161 (1 << S5PV310_SROM_BW__WAITENABLE__SHIFT) | 161 (1 << S5P_SROM_BW__BYTEENABLE__SHIFT)) <<
162 (1 << S5PV310_SROM_BW__BYTEENABLE__SHIFT)) << 162 S5P_SROM_BW__NCS1__SHIFT;
163 S5PV310_SROM_BW__NCS1__SHIFT; 163 __raw_writel(cs1, S5P_SROM_BW);
164 __raw_writel(cs1, S5PV310_SROM_BW);
165 164
166 /* set timing for nCS1 suitable for ethernet chip */ 165 /* set timing for nCS1 suitable for ethernet chip */
167 __raw_writel((0x1 << S5PV310_SROM_BCX__PMC__SHIFT) | 166 __raw_writel((0x1 << S5P_SROM_BCX__PMC__SHIFT) |
168 (0x9 << S5PV310_SROM_BCX__TACP__SHIFT) | 167 (0x9 << S5P_SROM_BCX__TACP__SHIFT) |
169 (0xc << S5PV310_SROM_BCX__TCAH__SHIFT) | 168 (0xc << S5P_SROM_BCX__TCAH__SHIFT) |
170 (0x1 << S5PV310_SROM_BCX__TCOH__SHIFT) | 169 (0x1 << S5P_SROM_BCX__TCOH__SHIFT) |
171 (0x6 << S5PV310_SROM_BCX__TACC__SHIFT) | 170 (0x6 << S5P_SROM_BCX__TACC__SHIFT) |
172 (0x1 << S5PV310_SROM_BCX__TCOS__SHIFT) | 171 (0x1 << S5P_SROM_BCX__TCOS__SHIFT) |
173 (0x1 << S5PV310_SROM_BCX__TACS__SHIFT), S5PV310_SROM_BC1); 172 (0x1 << S5P_SROM_BCX__TACS__SHIFT), S5P_SROM_BC1);
174} 173}
175 174
176static void __init smdkc210_map_io(void) 175static void __init smdkc210_map_io(void)
diff --git a/arch/arm/mach-s5pv310/mach-smdkv310.c b/arch/arm/mach-s5pv310/mach-smdkv310.c
index 35826d66632c..342660232342 100644
--- a/arch/arm/mach-s5pv310/mach-smdkv310.c
+++ b/arch/arm/mach-s5pv310/mach-smdkv310.c
@@ -19,13 +19,13 @@
19#include <asm/mach-types.h> 19#include <asm/mach-types.h>
20 20
21#include <plat/regs-serial.h> 21#include <plat/regs-serial.h>
22#include <plat/regs-srom.h>
22#include <plat/s5pv310.h> 23#include <plat/s5pv310.h>
23#include <plat/cpu.h> 24#include <plat/cpu.h>
24#include <plat/devs.h> 25#include <plat/devs.h>
25#include <plat/sdhci.h> 26#include <plat/sdhci.h>
26 27
27#include <mach/map.h> 28#include <mach/map.h>
28#include <mach/regs-srom.h>
29 29
30/* Following are default values for UCON, ULCON and UFCON UART registers */ 30/* Following are default values for UCON, ULCON and UFCON UART registers */
31#define SMDKV310_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ 31#define SMDKV310_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
@@ -154,23 +154,22 @@ static void __init smdkv310_smsc911x_init(void)
154 u32 cs1; 154 u32 cs1;
155 155
156 /* configure nCS1 width to 16 bits */ 156 /* configure nCS1 width to 16 bits */
157 cs1 = __raw_readl(S5PV310_SROM_BW) & 157 cs1 = __raw_readl(S5P_SROM_BW) &
158 ~(S5PV310_SROM_BW__CS_MASK << 158 ~(S5P_SROM_BW__CS_MASK << S5P_SROM_BW__NCS1__SHIFT);
159 S5PV310_SROM_BW__NCS1__SHIFT); 159 cs1 |= ((1 << S5P_SROM_BW__DATAWIDTH__SHIFT) |
160 cs1 |= ((1 << S5PV310_SROM_BW__DATAWIDTH__SHIFT) | 160 (1 << S5P_SROM_BW__WAITENABLE__SHIFT) |
161 (1 << S5PV310_SROM_BW__WAITENABLE__SHIFT) | 161 (1 << S5P_SROM_BW__BYTEENABLE__SHIFT)) <<
162 (1 << S5PV310_SROM_BW__BYTEENABLE__SHIFT)) << 162 S5P_SROM_BW__NCS1__SHIFT;
163 S5PV310_SROM_BW__NCS1__SHIFT; 163 __raw_writel(cs1, S5P_SROM_BW);
164 __raw_writel(cs1, S5PV310_SROM_BW);
165 164
166 /* set timing for nCS1 suitable for ethernet chip */ 165 /* set timing for nCS1 suitable for ethernet chip */
167 __raw_writel((0x1 << S5PV310_SROM_BCX__PMC__SHIFT) | 166 __raw_writel((0x1 << S5P_SROM_BCX__PMC__SHIFT) |
168 (0x9 << S5PV310_SROM_BCX__TACP__SHIFT) | 167 (0x9 << S5P_SROM_BCX__TACP__SHIFT) |
169 (0xc << S5PV310_SROM_BCX__TCAH__SHIFT) | 168 (0xc << S5P_SROM_BCX__TCAH__SHIFT) |
170 (0x1 << S5PV310_SROM_BCX__TCOH__SHIFT) | 169 (0x1 << S5P_SROM_BCX__TCOH__SHIFT) |
171 (0x6 << S5PV310_SROM_BCX__TACC__SHIFT) | 170 (0x6 << S5P_SROM_BCX__TACC__SHIFT) |
172 (0x1 << S5PV310_SROM_BCX__TCOS__SHIFT) | 171 (0x1 << S5P_SROM_BCX__TCOS__SHIFT) |
173 (0x1 << S5PV310_SROM_BCX__TACS__SHIFT), S5PV310_SROM_BC1); 172 (0x1 << S5P_SROM_BCX__TACS__SHIFT), S5P_SROM_BC1);
174} 173}
175 174
176static void __init smdkv310_map_io(void) 175static void __init smdkv310_map_io(void)
diff --git a/arch/arm/plat-s5p/include/plat/regs-srom.h b/arch/arm/plat-s5p/include/plat/regs-srom.h
new file mode 100644
index 000000000000..0fdac48a5985
--- /dev/null
+++ b/arch/arm/plat-s5p/include/plat/regs-srom.h
@@ -0,0 +1,50 @@
1/* linux/arch/arm/plat-s5p/include/plat/regs-srom.h
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
5 *
6 * S5P SROMC register definitions
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#ifndef __ASM_PLAT_S5P_REGS_SROM_H
14#define __ASM_PLAT_S5P_REGS_SROM_H __FILE__
15
16#include <mach/map.h>
17
18#define S5P_SROMREG(x) (S5P_VA_SROMC + (x))
19
20#define S5P_SROM_BW S5P_SROMREG(0x0)
21#define S5P_SROM_BC0 S5P_SROMREG(0x4)
22#define S5P_SROM_BC1 S5P_SROMREG(0x8)
23#define S5P_SROM_BC2 S5P_SROMREG(0xc)
24#define S5P_SROM_BC3 S5P_SROMREG(0x10)
25
26/* one register BW holds 4 x 4-bit packed settings for NCS0 - NCS3 */
27
28#define S5P_SROM_BW__DATAWIDTH__SHIFT 0
29#define S5P_SROM_BW__ADDRMODE__SHIFT 1
30#define S5P_SROM_BW__WAITENABLE__SHIFT 2
31#define S5P_SROM_BW__BYTEENABLE__SHIFT 3
32
33#define S5P_SROM_BW__CS_MASK 0xf
34
35#define S5P_SROM_BW__NCS0__SHIFT 0
36#define S5P_SROM_BW__NCS1__SHIFT 4
37#define S5P_SROM_BW__NCS2__SHIFT 8
38#define S5P_SROM_BW__NCS3__SHIFT 12
39
40/* applies to same to BCS0 - BCS3 */
41
42#define S5P_SROM_BCX__PMC__SHIFT 0
43#define S5P_SROM_BCX__TACP__SHIFT 4
44#define S5P_SROM_BCX__TCAH__SHIFT 8
45#define S5P_SROM_BCX__TCOH__SHIFT 12
46#define S5P_SROM_BCX__TACC__SHIFT 16
47#define S5P_SROM_BCX__TCOS__SHIFT 24
48#define S5P_SROM_BCX__TACS__SHIFT 28
49
50#endif /* __ASM_PLAT_S5P_REGS_SROM_H */