aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorHeiko Stuebner <heiko@sntech.de>2014-03-11 09:05:09 -0400
committerKukjin Kim <kgene.kim@samsung.com>2014-03-11 09:05:18 -0400
commit19a964644f1e655c3f67d539c1e99a9fbcc4588c (patch)
treeefb70098653c97223d3f262788a8e12d3a3ca1c2 /arch/arm
parent90266754801c0361c3c6e06dc3d763b00810e1a9 (diff)
ARM: SAMSUNG: remove all custom uncompress.h
All Samsung platforms now use the generic uncompress.h so all the custom ones can be removed. Signed-off-by: Heiko Stuebner <heiko@sntech.de> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-s3c24xx/include/mach/uncompress.h57
-rw-r--r--arch/arm/mach-s3c64xx/include/mach/uncompress.h31
-rw-r--r--arch/arm/mach-s5p64x0/include/mach/uncompress.h34
-rw-r--r--arch/arm/mach-s5pc100/include/mach/uncompress.h30
-rw-r--r--arch/arm/mach-s5pv210/include/mach/uncompress.h28
-rw-r--r--arch/arm/plat-samsung/include/plat/uncompress.h175
6 files changed, 0 insertions, 355 deletions
diff --git a/arch/arm/mach-s3c24xx/include/mach/uncompress.h b/arch/arm/mach-s3c24xx/include/mach/uncompress.h
deleted file mode 100644
index 7d2ce205dce8..000000000000
--- a/arch/arm/mach-s3c24xx/include/mach/uncompress.h
+++ /dev/null
@@ -1,57 +0,0 @@
1/* arch/arm/mach-s3c2410/include/mach/uncompress.h
2 *
3 * Copyright (c) 2003-2007 Simtec Electronics
4 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk>
6 *
7 * S3C2410 - uncompress code
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12*/
13
14#ifndef __ASM_ARCH_UNCOMPRESS_H
15#define __ASM_ARCH_UNCOMPRESS_H
16
17#include <mach/regs-gpio.h>
18#include <mach/map.h>
19
20/* working in physical space... */
21#undef S3C2410_GPIOREG
22#define S3C2410_GPIOREG(x) ((S3C24XX_PA_GPIO + (x)))
23
24#include <plat/uncompress.h>
25
26static inline int is_arm926(void)
27{
28 unsigned int cpuid;
29
30 asm volatile ("mrc p15, 0, %0, c1, c0, 0" : "=r" (cpuid));
31
32 return ((cpuid & 0xff0) == 0x260);
33}
34
35static void arch_detect_cpu(void)
36{
37 unsigned int cpuid;
38
39 cpuid = *((volatile unsigned int *)S3C2410_GSTATUS1);
40 cpuid &= S3C2410_GSTATUS1_IDMASK;
41
42 if (is_arm926() || cpuid == S3C2410_GSTATUS1_2440 ||
43 cpuid == S3C2410_GSTATUS1_2442 ||
44 cpuid == S3C2410_GSTATUS1_2416 ||
45 cpuid == S3C2410_GSTATUS1_2450) {
46 fifo_mask = S3C2440_UFSTAT_TXMASK;
47 fifo_max = 63 << S3C2440_UFSTAT_TXSHIFT;
48 } else {
49 fifo_mask = S3C2410_UFSTAT_TXMASK;
50 fifo_max = 15 << S3C2410_UFSTAT_TXSHIFT;
51 }
52
53 uart_base = (volatile u8 *) S3C_PA_UART +
54 (S3C_UART_OFFSET * CONFIG_S3C_LOWLEVEL_UART_PORT);
55}
56
57#endif /* __ASM_ARCH_UNCOMPRESS_H */
diff --git a/arch/arm/mach-s3c64xx/include/mach/uncompress.h b/arch/arm/mach-s3c64xx/include/mach/uncompress.h
deleted file mode 100644
index 1c956738b42d..000000000000
--- a/arch/arm/mach-s3c64xx/include/mach/uncompress.h
+++ /dev/null
@@ -1,31 +0,0 @@
1/* arch/arm/mach-s3c6400/include/mach/uncompress.h
2 *
3 * Copyright 2008 Openmoko, Inc.
4 * Copyright 2008 Simtec Electronics
5 * http://armlinux.simtec.co.uk/
6 * Ben Dooks <ben@simtec.co.uk>
7 *
8 * S3C6400 - uncompress code
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13*/
14
15#ifndef __ASM_ARCH_UNCOMPRESS_H
16#define __ASM_ARCH_UNCOMPRESS_H
17
18#include <mach/map.h>
19#include <plat/uncompress.h>
20
21static void arch_detect_cpu(void)
22{
23 /* we do not need to do any cpu detection here at the moment. */
24 fifo_mask = S3C2440_UFSTAT_TXMASK;
25 fifo_max = 63 << S3C2440_UFSTAT_TXSHIFT;
26
27 uart_base = (volatile u8 *)S3C_PA_UART +
28 (S3C_UART_OFFSET * CONFIG_S3C_LOWLEVEL_UART_PORT);
29}
30
31#endif /* __ASM_ARCH_UNCOMPRESS_H */
diff --git a/arch/arm/mach-s5p64x0/include/mach/uncompress.h b/arch/arm/mach-s5p64x0/include/mach/uncompress.h
deleted file mode 100644
index bbcc3f669ee3..000000000000
--- a/arch/arm/mach-s5p64x0/include/mach/uncompress.h
+++ /dev/null
@@ -1,34 +0,0 @@
1/* linux/arch/arm/mach-s5p64x0/include/mach/uncompress.h
2 *
3 * Copyright (c) 2009-2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
5 *
6 * S5P64X0 - uncompress code
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_UNCOMPRESS_H
14#define __ASM_ARCH_UNCOMPRESS_H
15
16#include <mach/map.h>
17#include <plat/uncompress.h>
18
19static void arch_detect_cpu(void)
20{
21 unsigned int chipid;
22
23 chipid = *(const volatile unsigned int __force *) 0xE0100118;
24
25 if ((chipid & 0xff000) == 0x50000)
26 uart_base = (volatile u8 *)S5P6450_PA_UART(CONFIG_S3C_LOWLEVEL_UART_PORT);
27 else
28 uart_base = (volatile u8 *)S5P6440_PA_UART(CONFIG_S3C_LOWLEVEL_UART_PORT);
29
30 fifo_mask = S3C2440_UFSTAT_TXMASK;
31 fifo_max = 63 << S3C2440_UFSTAT_TXSHIFT;
32}
33
34#endif /* __ASM_ARCH_UNCOMPRESS_H */
diff --git a/arch/arm/mach-s5pc100/include/mach/uncompress.h b/arch/arm/mach-s5pc100/include/mach/uncompress.h
deleted file mode 100644
index 720e1339425c..000000000000
--- a/arch/arm/mach-s5pc100/include/mach/uncompress.h
+++ /dev/null
@@ -1,30 +0,0 @@
1/* arch/arm/mach-s5pc100/include/mach/uncompress.h
2 *
3 * Copyright 2009 Samsung Electronics Co.
4 * Byungho Min <bhmin@samsung.com>
5 *
6 * S5PC100 - uncompress code
7 *
8 * Based on mach-s3c6400/include/mach/uncompress.h
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13*/
14
15#ifndef __ASM_ARCH_UNCOMPRESS_H
16#define __ASM_ARCH_UNCOMPRESS_H
17
18#include <mach/map.h>
19#include <plat/uncompress.h>
20
21static void arch_detect_cpu(void)
22{
23 /* we do not need to do any cpu detection here at the moment. */
24 fifo_mask = S3C2440_UFSTAT_TXMASK;
25 fifo_max = 63 << S3C2440_UFSTAT_TXSHIFT;
26
27 uart_base = (volatile u8 *)S5P_PA_UART(CONFIG_S3C_LOWLEVEL_UART_PORT);
28}
29
30#endif /* __ASM_ARCH_UNCOMPRESS_H */
diff --git a/arch/arm/mach-s5pv210/include/mach/uncompress.h b/arch/arm/mach-s5pv210/include/mach/uncompress.h
deleted file mode 100644
index 231cb07de058..000000000000
--- a/arch/arm/mach-s5pv210/include/mach/uncompress.h
+++ /dev/null
@@ -1,28 +0,0 @@
1/* linux/arch/arm/mach-s5pv210/include/mach/uncompress.h
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * S5PV210 - uncompress code
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_UNCOMPRESS_H
14#define __ASM_ARCH_UNCOMPRESS_H
15
16#include <mach/map.h>
17#include <plat/uncompress.h>
18
19static void arch_detect_cpu(void)
20{
21 /* we do not need to do any cpu detection here at the moment. */
22 fifo_mask = S5PV210_UFSTAT_TXMASK;
23 fifo_max = 63 << S5PV210_UFSTAT_TXSHIFT;
24
25 uart_base = (volatile u8 *)S5P_PA_UART(CONFIG_S3C_LOWLEVEL_UART_PORT);
26}
27
28#endif /* __ASM_ARCH_UNCOMPRESS_H */
diff --git a/arch/arm/plat-samsung/include/plat/uncompress.h b/arch/arm/plat-samsung/include/plat/uncompress.h
deleted file mode 100644
index 61054fd88d43..000000000000
--- a/arch/arm/plat-samsung/include/plat/uncompress.h
+++ /dev/null
@@ -1,175 +0,0 @@
1/* arch/arm/plat-samsung/include/plat/uncompress.h
2 *
3 * Copyright 2003, 2007 Simtec Electronics
4 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk>
6 *
7 * S3C - uncompress code
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12*/
13
14#ifndef __ASM_PLAT_UNCOMPRESS_H
15#define __ASM_PLAT_UNCOMPRESS_H
16
17typedef unsigned int upf_t; /* cannot include linux/serial_core.h */
18
19/* uart setup */
20
21unsigned int fifo_mask;
22unsigned int fifo_max;
23
24volatile u8 *uart_base;
25
26/* forward declerations */
27
28static void arch_detect_cpu(void);
29
30/* defines for UART registers */
31
32#include <linux/serial_s3c.h>
33
34/* working in physical space... */
35#define S3C_WDOGREG(x) ((S3C_PA_WDT + (x)))
36
37#define S3C2410_WTCON S3C_WDOGREG(0x00)
38#define S3C2410_WTDAT S3C_WDOGREG(0x04)
39#define S3C2410_WTCNT S3C_WDOGREG(0x08)
40
41#define S3C2410_WTCON_RSTEN (1 << 0)
42#define S3C2410_WTCON_ENABLE (1 << 5)
43
44#define S3C2410_WTCON_DIV128 (3 << 3)
45
46#define S3C2410_WTCON_PRESCALE(x) ((x) << 8)
47
48/* how many bytes we allow into the FIFO at a time in FIFO mode */
49#define FIFO_MAX (14)
50
51static __inline__ void
52uart_wr(unsigned int reg, unsigned int val)
53{
54 volatile unsigned int *ptr;
55
56 ptr = (volatile unsigned int *)(reg + uart_base);
57 *ptr = val;
58}
59
60static __inline__ unsigned int
61uart_rd(unsigned int reg)
62{
63 volatile unsigned int *ptr;
64
65 ptr = (volatile unsigned int *)(reg + uart_base);
66 return *ptr;
67}
68
69/* we can deal with the case the UARTs are being run
70 * in FIFO mode, so that we don't hold up our execution
71 * waiting for tx to happen...
72*/
73
74static void putc(int ch)
75{
76 if (!config_enabled(CONFIG_DEBUG_LL))
77 return;
78
79 if (uart_rd(S3C2410_UFCON) & S3C2410_UFCON_FIFOMODE) {
80 int level;
81
82 while (1) {
83 level = uart_rd(S3C2410_UFSTAT);
84 level &= fifo_mask;
85
86 if (level < fifo_max)
87 break;
88 }
89
90 } else {
91 /* not using fifos */
92
93 while ((uart_rd(S3C2410_UTRSTAT) & S3C2410_UTRSTAT_TXE) != S3C2410_UTRSTAT_TXE)
94 barrier();
95 }
96
97 /* write byte to transmission register */
98 uart_wr(S3C2410_UTXH, ch);
99}
100
101static inline void flush(void)
102{
103}
104
105#define __raw_writel(d, ad) \
106 do { \
107 *((volatile unsigned int __force *)(ad)) = (d); \
108 } while (0)
109
110#ifdef CONFIG_S3C_BOOT_ERROR_RESET
111
112static void arch_decomp_error(const char *x)
113{
114 putstr("\n\n");
115 putstr(x);
116 putstr("\n\n -- System resetting\n");
117
118 __raw_writel(0x4000, S3C2410_WTDAT);
119 __raw_writel(0x4000, S3C2410_WTCNT);
120 __raw_writel(S3C2410_WTCON_ENABLE | S3C2410_WTCON_DIV128 | S3C2410_WTCON_RSTEN | S3C2410_WTCON_PRESCALE(0x40), S3C2410_WTCON);
121
122 while(1);
123}
124
125#define arch_error arch_decomp_error
126#endif
127
128#ifdef CONFIG_S3C_BOOT_UART_FORCE_FIFO
129static inline void arch_enable_uart_fifo(void)
130{
131 u32 fifocon;
132
133 if (!config_enabled(CONFIG_DEBUG_LL))
134 return;
135
136 fifocon = uart_rd(S3C2410_UFCON);
137
138 if (!(fifocon & S3C2410_UFCON_FIFOMODE)) {
139 fifocon |= S3C2410_UFCON_RESETBOTH;
140 uart_wr(S3C2410_UFCON, fifocon);
141
142 /* wait for fifo reset to complete */
143 while (1) {
144 fifocon = uart_rd(S3C2410_UFCON);
145 if (!(fifocon & S3C2410_UFCON_RESETBOTH))
146 break;
147 }
148
149 uart_wr(S3C2410_UFCON, S3C2410_UFCON_FIFOMODE);
150 }
151}
152#else
153#define arch_enable_uart_fifo() do { } while(0)
154#endif
155
156
157static void
158arch_decomp_setup(void)
159{
160 /* we may need to setup the uart(s) here if we are not running
161 * on an BAST... the BAST will have left the uarts configured
162 * after calling linux.
163 */
164
165 arch_detect_cpu();
166
167 /* Enable the UART FIFOs if they where not enabled and our
168 * configuration says we should turn them on.
169 */
170
171 arch_enable_uart_fifo();
172}
173
174
175#endif /* __ASM_PLAT_UNCOMPRESS_H */