blob: 8b283f847daa61ef89b44eabda3d4f70df729063 [file] [log] [blame]
Russell Kinga09e64f2008-08-05 16:14:15 +01001/* arch/arm/mach-s3c2410/include/mach/uncompress.h
2 *
Ben Dooksccae9412009-11-13 22:54:14 +00003 * Copyright (c) 2003-2007 Simtec Electronics
Russell Kinga09e64f2008-08-05 16:14:15 +01004 * 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
Ben Dooksd5120ae2008-10-07 23:09:51 +010024#include <plat/uncompress.h>
Russell Kinga09e64f2008-08-05 16:14:15 +010025
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 ||
Yauhen Kharuzhy5faf5012009-08-19 16:31:05 +030043 cpuid == S3C2410_GSTATUS1_2442 ||
44 cpuid == S3C2410_GSTATUS1_2416 ||
45 cpuid == S3C2410_GSTATUS1_2450) {
Russell Kinga09e64f2008-08-05 16:14:15 +010046 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
54#endif /* __ASM_ARCH_UNCOMPRESS_H */