diff options
author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-25 19:19:32 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-25 19:19:32 -0400 |
commit | ab2fd30b668b1687a9ca9e9ea0b60145deeafe84 (patch) | |
tree | eba2812d94c3a6add143b7ee182e4411a9f3d994 | |
parent | 25ee7e3832951cf5896b194f6cd929a44863f419 (diff) | |
parent | 2fac6f3fec2303649e9cd572255776cb93d3f888 (diff) |
Automated merge of kernel.org:/home/rmk/linux-2.6-rmk.git
-rw-r--r-- | arch/arm/mach-pxa/sleep.S | 56 | ||||
-rw-r--r-- | include/asm-arm/arch-s3c2410/regs-iis.h | 10 | ||||
-rw-r--r-- | include/asm-arm/arch-s3c2410/regs-mem.h | 8 | ||||
-rw-r--r-- | include/asm-arm/arch-s3c2410/regs-spi.h | 2 | ||||
-rw-r--r-- | include/asm-arm/arch-s3c2410/uncompress.h | 6 | ||||
-rw-r--r-- | include/asm-arm/string.h | 17 |
6 files changed, 87 insertions, 12 deletions
diff --git a/arch/arm/mach-pxa/sleep.S b/arch/arm/mach-pxa/sleep.S index 16cad2c2497c..5786ccad938c 100644 --- a/arch/arm/mach-pxa/sleep.S +++ b/arch/arm/mach-pxa/sleep.S | |||
@@ -18,6 +18,11 @@ | |||
18 | 18 | ||
19 | #include <asm/arch/pxa-regs.h> | 19 | #include <asm/arch/pxa-regs.h> |
20 | 20 | ||
21 | #ifdef CONFIG_PXA27x // workaround for Errata 50 | ||
22 | #define MDREFR_KDIV 0x200a4000 // all banks | ||
23 | #define CCCR_SLEEP 0x00000107 // L=7 2N=2 A=0 PPDIS=0 CPDIS=0 | ||
24 | #endif | ||
25 | |||
21 | .text | 26 | .text |
22 | 27 | ||
23 | /* | 28 | /* |
@@ -28,7 +33,9 @@ | |||
28 | 33 | ||
29 | ENTRY(pxa_cpu_suspend) | 34 | ENTRY(pxa_cpu_suspend) |
30 | 35 | ||
36 | #ifndef CONFIG_IWMMXT | ||
31 | mra r2, r3, acc0 | 37 | mra r2, r3, acc0 |
38 | #endif | ||
32 | stmfd sp!, {r2 - r12, lr} @ save registers on stack | 39 | stmfd sp!, {r2 - r12, lr} @ save registers on stack |
33 | 40 | ||
34 | @ get coprocessor registers | 41 | @ get coprocessor registers |
@@ -61,14 +68,23 @@ ENTRY(pxa_cpu_suspend) | |||
61 | @ prepare value for sleep mode | 68 | @ prepare value for sleep mode |
62 | mov r1, #3 @ sleep mode | 69 | mov r1, #3 @ sleep mode |
63 | 70 | ||
64 | @ prepare to put SDRAM into self-refresh manually | 71 | @ prepare pointer to physical address 0 (virtual mapping in generic.c) |
72 | mov r2, #UNCACHED_PHYS_0 | ||
73 | |||
74 | @ prepare SDRAM refresh settings | ||
65 | ldr r4, =MDREFR | 75 | ldr r4, =MDREFR |
66 | ldr r5, [r4] | 76 | ldr r5, [r4] |
77 | |||
78 | @ enable SDRAM self-refresh mode | ||
67 | orr r5, r5, #MDREFR_SLFRSH | 79 | orr r5, r5, #MDREFR_SLFRSH |
68 | 80 | ||
69 | @ prepare pointer to physical address 0 (virtual mapping in generic.c) | 81 | #ifdef CONFIG_PXA27x |
70 | mov r2, #UNCACHED_PHYS_0 | 82 | @ set SDCLKx divide-by-2 bits (this is part of a workaround for Errata 50) |
83 | ldr r6, =MDREFR_KDIV | ||
84 | orr r5, r5, r6 | ||
85 | #endif | ||
71 | 86 | ||
87 | #ifdef CONFIG_PXA25x | ||
72 | @ Intel PXA255 Specification Update notes problems | 88 | @ Intel PXA255 Specification Update notes problems |
73 | @ about suspending with PXBus operating above 133MHz | 89 | @ about suspending with PXBus operating above 133MHz |
74 | @ (see Errata 31, GPIO output signals, ... unpredictable in sleep | 90 | @ (see Errata 31, GPIO output signals, ... unpredictable in sleep |
@@ -100,6 +116,18 @@ ENTRY(pxa_cpu_suspend) | |||
100 | mov r0, #0 | 116 | mov r0, #0 |
101 | mcr p14, 0, r0, c6, c0, 0 | 117 | mcr p14, 0, r0, c6, c0, 0 |
102 | orr r0, r0, #2 @ initiate change bit | 118 | orr r0, r0, #2 @ initiate change bit |
119 | #endif | ||
120 | #ifdef CONFIG_PXA27x | ||
121 | @ Intel PXA270 Specification Update notes problems sleeping | ||
122 | @ with core operating above 91 MHz | ||
123 | @ (see Errata 50, ...processor does not exit from sleep...) | ||
124 | |||
125 | ldr r6, =CCCR | ||
126 | ldr r8, [r6] @ keep original value for resume | ||
127 | |||
128 | ldr r7, =CCCR_SLEEP @ prepare CCCR sleep value | ||
129 | mov r0, #0x2 @ prepare value for CLKCFG | ||
130 | #endif | ||
103 | 131 | ||
104 | @ align execution to a cache line | 132 | @ align execution to a cache line |
105 | b 1f | 133 | b 1f |
@@ -111,6 +139,7 @@ ENTRY(pxa_cpu_suspend) | |||
111 | @ All needed values are now in registers. | 139 | @ All needed values are now in registers. |
112 | @ These last instructions should be in cache | 140 | @ These last instructions should be in cache |
113 | 141 | ||
142 | #if defined(CONFIG_PXA25x) || defined(CONFIG_PXA27x) | ||
114 | @ initiate the frequency change... | 143 | @ initiate the frequency change... |
115 | str r7, [r6] | 144 | str r7, [r6] |
116 | mcr p14, 0, r0, c6, c0, 0 | 145 | mcr p14, 0, r0, c6, c0, 0 |
@@ -118,14 +147,27 @@ ENTRY(pxa_cpu_suspend) | |||
118 | @ restore the original cpu speed value for resume | 147 | @ restore the original cpu speed value for resume |
119 | str r8, [r6] | 148 | str r8, [r6] |
120 | 149 | ||
121 | @ put SDRAM into self-refresh | 150 | @ need 6 13-MHz cycles before changing PWRMODE |
122 | str r5, [r4] | 151 | @ just set frequency to 91-MHz... 6*91/13 = 42 |
152 | |||
153 | mov r0, #42 | ||
154 | 10: subs r0, r0, #1 | ||
155 | bne 10b | ||
156 | #endif | ||
157 | |||
158 | @ Do not reorder... | ||
159 | @ Intel PXA270 Specification Update notes problems performing | ||
160 | @ external accesses after SDRAM is put in self-refresh mode | ||
161 | @ (see Errata 39 ...hangs when entering self-refresh mode) | ||
123 | 162 | ||
124 | @ force address lines low by reading at physical address 0 | 163 | @ force address lines low by reading at physical address 0 |
125 | ldr r3, [r2] | 164 | ldr r3, [r2] |
126 | 165 | ||
166 | @ put SDRAM into self-refresh | ||
167 | str r5, [r4] | ||
168 | |||
127 | @ enter sleep mode | 169 | @ enter sleep mode |
128 | mcr p14, 0, r1, c7, c0, 0 | 170 | mcr p14, 0, r1, c7, c0, 0 @ PWRMODE |
129 | 171 | ||
130 | 20: b 20b @ loop waiting for sleep | 172 | 20: b 20b @ loop waiting for sleep |
131 | 173 | ||
@@ -188,7 +230,9 @@ resume_after_mmu: | |||
188 | bl cpu_xscale_proc_init | 230 | bl cpu_xscale_proc_init |
189 | #endif | 231 | #endif |
190 | ldmfd sp!, {r2, r3} | 232 | ldmfd sp!, {r2, r3} |
233 | #ifndef CONFIG_IWMMXT | ||
191 | mar acc0, r2, r3 | 234 | mar acc0, r2, r3 |
235 | #endif | ||
192 | ldmfd sp!, {r4 - r12, pc} @ return to caller | 236 | ldmfd sp!, {r4 - r12, pc} @ return to caller |
193 | 237 | ||
194 | 238 | ||
diff --git a/include/asm-arm/arch-s3c2410/regs-iis.h b/include/asm-arm/arch-s3c2410/regs-iis.h index 7ae8e1f45bc1..385b07d510da 100644 --- a/include/asm-arm/arch-s3c2410/regs-iis.h +++ b/include/asm-arm/arch-s3c2410/regs-iis.h | |||
@@ -14,6 +14,7 @@ | |||
14 | * 26-06-2003 BJD Finished off definitions for register addresses | 14 | * 26-06-2003 BJD Finished off definitions for register addresses |
15 | * 12-03-2004 BJD Updated include protection | 15 | * 12-03-2004 BJD Updated include protection |
16 | * 07-03-2005 BJD Added FIFO size flags and S3C2440 MPLL | 16 | * 07-03-2005 BJD Added FIFO size flags and S3C2440 MPLL |
17 | * 05-04-2005 LCVR Added IISFCON definitions for the S3C2400 | ||
17 | */ | 18 | */ |
18 | 19 | ||
19 | #ifndef __ASM_ARCH_REGS_IIS_H | 20 | #ifndef __ASM_ARCH_REGS_IIS_H |
@@ -68,5 +69,14 @@ | |||
68 | #define S3C2410_IISFCON_RXMASK (0x3f) | 69 | #define S3C2410_IISFCON_RXMASK (0x3f) |
69 | #define S3C2410_IISFCON_RXSHIFT (0) | 70 | #define S3C2410_IISFCON_RXSHIFT (0) |
70 | 71 | ||
72 | #define S3C2400_IISFCON_TXDMA (1<<11) | ||
73 | #define S3C2400_IISFCON_RXDMA (1<<10) | ||
74 | #define S3C2400_IISFCON_TXENABLE (1<<9) | ||
75 | #define S3C2400_IISFCON_RXENABLE (1<<8) | ||
76 | #define S3C2400_IISFCON_TXMASK (0x07 << 4) | ||
77 | #define S3C2400_IISFCON_TXSHIFT (4) | ||
78 | #define S3C2400_IISFCON_RXMASK (0x07) | ||
79 | #define S3C2400_IISFCON_RXSHIFT (0) | ||
80 | |||
71 | #define S3C2410_IISFIFO (0x10) | 81 | #define S3C2410_IISFIFO (0x10) |
72 | #endif /* __ASM_ARCH_REGS_IIS_H */ | 82 | #endif /* __ASM_ARCH_REGS_IIS_H */ |
diff --git a/include/asm-arm/arch-s3c2410/regs-mem.h b/include/asm-arm/arch-s3c2410/regs-mem.h index 1a1328ac0d79..a2d7d0cec042 100644 --- a/include/asm-arm/arch-s3c2410/regs-mem.h +++ b/include/asm-arm/arch-s3c2410/regs-mem.h | |||
@@ -12,6 +12,7 @@ | |||
12 | * Changelog: | 12 | * Changelog: |
13 | * 29-Sep-2004 BJD Initial include for Linux | 13 | * 29-Sep-2004 BJD Initial include for Linux |
14 | * 10-Mar-2005 LCVR Changed S3C2410_VA to S3C24XX_VA | 14 | * 10-Mar-2005 LCVR Changed S3C2410_VA to S3C24XX_VA |
15 | * 04-Apr-2005 LCVR Added S3C2400 DRAM/BANKSIZE_MASK definitions | ||
15 | * | 16 | * |
16 | */ | 17 | */ |
17 | 18 | ||
@@ -183,6 +184,12 @@ | |||
183 | #define S3C2410_REFRESH_TRP_3clk (1<<20) | 184 | #define S3C2410_REFRESH_TRP_3clk (1<<20) |
184 | #define S3C2410_REFRESH_TRP_4clk (2<<20) | 185 | #define S3C2410_REFRESH_TRP_4clk (2<<20) |
185 | 186 | ||
187 | #define S3C2400_REFRESH_DRAM_TRP_MASK (3<<20) | ||
188 | #define S3C2400_REFRESH_DRAM_TRP_1_5clk (0<<20) | ||
189 | #define S3C2400_REFRESH_DRAM_TRP_2_5clk (1<<20) | ||
190 | #define S3C2400_REFRESH_DRAM_TRP_3_5clk (2<<20) | ||
191 | #define S3C2400_REFRESH_DRAM_TRP_4_5clk (3<<20) | ||
192 | |||
186 | #define S3C2410_REFRESH_TSRC_MASK (3<<18) | 193 | #define S3C2410_REFRESH_TSRC_MASK (3<<18) |
187 | #define S3C2410_REFRESH_TSRC_4clk (0<<18) | 194 | #define S3C2410_REFRESH_TSRC_4clk (0<<18) |
188 | #define S3C2410_REFRESH_TSRC_5clk (1<<18) | 195 | #define S3C2410_REFRESH_TSRC_5clk (1<<18) |
@@ -205,6 +212,7 @@ | |||
205 | #define S3C2410_BANKSIZE_4M (0x5 << 0) | 212 | #define S3C2410_BANKSIZE_4M (0x5 << 0) |
206 | #define S3C2410_BANKSIZE_2M (0x4 << 0) | 213 | #define S3C2410_BANKSIZE_2M (0x4 << 0) |
207 | #define S3C2410_BANKSIZE_MASK (0x7 << 0) | 214 | #define S3C2410_BANKSIZE_MASK (0x7 << 0) |
215 | #define S3C2400_BANKSIZE_MASK (0x4 << 0) | ||
208 | #define S3C2410_BANKSIZE_SCLK_EN (1<<4) | 216 | #define S3C2410_BANKSIZE_SCLK_EN (1<<4) |
209 | #define S3C2410_BANKSIZE_SCKE_EN (1<<5) | 217 | #define S3C2410_BANKSIZE_SCKE_EN (1<<5) |
210 | #define S3C2410_BANKSIZE_BURST (1<<7) | 218 | #define S3C2410_BANKSIZE_BURST (1<<7) |
diff --git a/include/asm-arm/arch-s3c2410/regs-spi.h b/include/asm-arm/arch-s3c2410/regs-spi.h index cb502a88158b..338217858c73 100644 --- a/include/asm-arm/arch-s3c2410/regs-spi.h +++ b/include/asm-arm/arch-s3c2410/regs-spi.h | |||
@@ -12,6 +12,7 @@ | |||
12 | * 20-04-2004 KF Created file | 12 | * 20-04-2004 KF Created file |
13 | * 04-10-2004 BJD Removed VA address (no longer mapped) | 13 | * 04-10-2004 BJD Removed VA address (no longer mapped) |
14 | * tidied file for submission | 14 | * tidied file for submission |
15 | * 03-04-2005 LCVR Added S3C2400_SPPIN_nCS definition | ||
15 | */ | 16 | */ |
16 | 17 | ||
17 | #ifndef __ASM_ARCH_REGS_SPI_H | 18 | #ifndef __ASM_ARCH_REGS_SPI_H |
@@ -46,6 +47,7 @@ | |||
46 | 47 | ||
47 | #define S3C2410_SPPIN_ENMUL (1<<2) /* Multi Master Error detect */ | 48 | #define S3C2410_SPPIN_ENMUL (1<<2) /* Multi Master Error detect */ |
48 | #define S3C2410_SPPIN_RESERVED (1<<1) | 49 | #define S3C2410_SPPIN_RESERVED (1<<1) |
50 | #define S3C2400_SPPIN_nCS (1<<1) /* SPI Card Select */ | ||
49 | #define S3C2410_SPPIN_KEEP (1<<0) /* Master Out keep */ | 51 | #define S3C2410_SPPIN_KEEP (1<<0) /* Master Out keep */ |
50 | 52 | ||
51 | 53 | ||
diff --git a/include/asm-arm/arch-s3c2410/uncompress.h b/include/asm-arm/arch-s3c2410/uncompress.h index ad4252e27799..d7a4a8354fa9 100644 --- a/include/asm-arm/arch-s3c2410/uncompress.h +++ b/include/asm-arm/arch-s3c2410/uncompress.h | |||
@@ -16,6 +16,7 @@ | |||
16 | * 12-Oct-2004 BJD Take account of debug uart configuration | 16 | * 12-Oct-2004 BJD Take account of debug uart configuration |
17 | * 15-Nov-2004 BJD Fixed uart configuration | 17 | * 15-Nov-2004 BJD Fixed uart configuration |
18 | * 22-Feb-2005 BJD Added watchdog to uncompress | 18 | * 22-Feb-2005 BJD Added watchdog to uncompress |
19 | * 04-Apr-2005 LCVR Added support to S3C2400 (no cpuid at GSTATUS1) | ||
19 | */ | 20 | */ |
20 | 21 | ||
21 | #ifndef __ASM_ARCH_UNCOMPRESS_H | 22 | #ifndef __ASM_ARCH_UNCOMPRESS_H |
@@ -69,9 +70,12 @@ uart_rd(unsigned int reg) | |||
69 | static void | 70 | static void |
70 | putc(char ch) | 71 | putc(char ch) |
71 | { | 72 | { |
72 | int cpuid = *((volatile unsigned int *)S3C2410_GSTATUS1); | 73 | int cpuid = S3C2410_GSTATUS1_2410; |
73 | 74 | ||
75 | #ifndef CONFIG_CPU_S3C2400 | ||
76 | cpuid = *((volatile unsigned int *)S3C2410_GSTATUS1); | ||
74 | cpuid &= S3C2410_GSTATUS1_IDMASK; | 77 | cpuid &= S3C2410_GSTATUS1_IDMASK; |
78 | #endif | ||
75 | 79 | ||
76 | if (ch == '\n') | 80 | if (ch == '\n') |
77 | putc('\r'); /* expand newline to \r\n */ | 81 | putc('\r'); /* expand newline to \r\n */ |
diff --git a/include/asm-arm/string.h b/include/asm-arm/string.h index 2a8ab162412f..e50c4a39b699 100644 --- a/include/asm-arm/string.h +++ b/include/asm-arm/string.h | |||
@@ -29,15 +29,22 @@ extern void __memzero(void *ptr, __kernel_size_t n); | |||
29 | 29 | ||
30 | #define memset(p,v,n) \ | 30 | #define memset(p,v,n) \ |
31 | ({ \ | 31 | ({ \ |
32 | if ((n) != 0) { \ | 32 | void *__p = (p); size_t __n = n; \ |
33 | if ((__n) != 0) { \ | ||
33 | if (__builtin_constant_p((v)) && (v) == 0) \ | 34 | if (__builtin_constant_p((v)) && (v) == 0) \ |
34 | __memzero((p),(n)); \ | 35 | __memzero((__p),(__n)); \ |
35 | else \ | 36 | else \ |
36 | memset((p),(v),(n)); \ | 37 | memset((__p),(v),(__n)); \ |
37 | } \ | 38 | } \ |
38 | (p); \ | 39 | (__p); \ |
39 | }) | 40 | }) |
40 | 41 | ||
41 | #define memzero(p,n) ({ if ((n) != 0) __memzero((p),(n)); (p); }) | 42 | #define memzero(p,n) \ |
43 | ({ \ | ||
44 | void *__p = (p); size_t __n = n; \ | ||
45 | if ((__n) != 0) \ | ||
46 | __memzero((__p),(__n)); \ | ||
47 | (__p); \ | ||
48 | }) | ||
42 | 49 | ||
43 | #endif | 50 | #endif |