Commit | Line | Data |
---|---|---|
a09e64fb | 1 | /* arch/arm/mach-s3c2410/include/mach/uncompress.h |
1da177e4 | 2 | * |
ccae941e | 3 | * Copyright (c) 2003-2007 Simtec Electronics |
dd1313a1 | 4 | * http://armlinux.simtec.co.uk/ |
f056076e | 5 | * Ben Dooks <ben@simtec.co.uk> |
1da177e4 LT |
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. | |
1da177e4 LT |
12 | */ |
13 | ||
14 | #ifndef __ASM_ARCH_UNCOMPRESS_H | |
15 | #define __ASM_ARCH_UNCOMPRESS_H | |
16 | ||
a09e64fb RK |
17 | #include <mach/regs-gpio.h> |
18 | #include <mach/map.h> | |
1da177e4 LT |
19 | |
20 | /* working in physical space... */ | |
21 | #undef S3C2410_GPIOREG | |
0367a8d3 | 22 | #define S3C2410_GPIOREG(x) ((S3C24XX_PA_GPIO + (x))) |
a14a26ac | 23 | |
d5120ae7 | 24 | #include <plat/uncompress.h> |
1da177e4 | 25 | |
5c49218a BD |
26 | static 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 | ||
a14a26ac | 35 | static void arch_detect_cpu(void) |
1da177e4 | 36 | { |
a14a26ac | 37 | unsigned int cpuid; |
1da177e4 | 38 | |
bd7b1702 | 39 | cpuid = *((volatile unsigned int *)S3C2410_GSTATUS1); |
1da177e4 | 40 | cpuid &= S3C2410_GSTATUS1_IDMASK; |
1da177e4 | 41 | |
5c49218a | 42 | if (is_arm926() || cpuid == S3C2410_GSTATUS1_2440 || |
5faf5011 YK |
43 | cpuid == S3C2410_GSTATUS1_2442 || |
44 | cpuid == S3C2410_GSTATUS1_2416 || | |
45 | cpuid == S3C2410_GSTATUS1_2450) { | |
a14a26ac BD |
46 | fifo_mask = S3C2440_UFSTAT_TXMASK; |
47 | fifo_max = 63 << S3C2440_UFSTAT_TXSHIFT; | |
1da177e4 | 48 | } else { |
a14a26ac BD |
49 | fifo_mask = S3C2410_UFSTAT_TXMASK; |
50 | fifo_max = 15 << S3C2410_UFSTAT_TXSHIFT; | |
1da177e4 | 51 | } |
1da177e4 LT |
52 | } |
53 | ||
1da177e4 | 54 | #endif /* __ASM_ARCH_UNCOMPRESS_H */ |