blob: 48a5731ee98868400793a809b515729857018160 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/* linux/include/asm-arm/arch-s3c2410/uncompress.h
2 *
Ben Dooksdd1313a2007-07-22 16:22:06 +01003 * Copyright (c) 2003, 2007 Simtec Electronics
4 * http://armlinux.simtec.co.uk/
Ben Dooksf0560762006-12-17 19:59:20 +01005 * Ben Dooks <ben@simtec.co.uk>
Linus Torvalds1da177e2005-04-16 15:20:36 -07006 *
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.
Linus Torvalds1da177e2005-04-16 15:20:36 -070012*/
13
14#ifndef __ASM_ARCH_UNCOMPRESS_H
15#define __ASM_ARCH_UNCOMPRESS_H
16
Ben Dooksa14a26a2007-07-22 16:13:29 +010017#include <asm/arch/regs-gpio.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070018#include <asm/arch/map.h>
19
20/* working in physical space... */
21#undef S3C2410_GPIOREG
Lucas Correia Villa Real0367a8d2006-01-26 15:20:50 +000022#define S3C2410_GPIOREG(x) ((S3C24XX_PA_GPIO + (x)))
Ben Dooksa14a26a2007-07-22 16:13:29 +010023
24#include <asm/plat-s3c/uncompress.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070025
Ben Dooks5c492182007-07-22 16:14:02 +010026static 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
Ben Dooksa14a26a2007-07-22 16:13:29 +010035static void arch_detect_cpu(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -070036{
Ben Dooksa14a26a2007-07-22 16:13:29 +010037 unsigned int cpuid;
Linus Torvalds1da177e2005-04-16 15:20:36 -070038
Lucas Correia Villa Realbd7b1702005-04-25 23:12:50 +010039 cpuid = *((volatile unsigned int *)S3C2410_GSTATUS1);
Linus Torvalds1da177e2005-04-16 15:20:36 -070040 cpuid &= S3C2410_GSTATUS1_IDMASK;
Linus Torvalds1da177e2005-04-16 15:20:36 -070041
Ben Dooks5c492182007-07-22 16:14:02 +010042 if (is_arm926() || cpuid == S3C2410_GSTATUS1_2440 ||
Ben Dooksa14a26a2007-07-22 16:13:29 +010043 cpuid == S3C2410_GSTATUS1_2442) {
44 fifo_mask = S3C2440_UFSTAT_TXMASK;
45 fifo_max = 63 << S3C2440_UFSTAT_TXSHIFT;
Linus Torvalds1da177e2005-04-16 15:20:36 -070046 } else {
Ben Dooksa14a26a2007-07-22 16:13:29 +010047 fifo_mask = S3C2410_UFSTAT_TXMASK;
48 fifo_max = 15 << S3C2410_UFSTAT_TXSHIFT;
Linus Torvalds1da177e2005-04-16 15:20:36 -070049 }
Linus Torvalds1da177e2005-04-16 15:20:36 -070050}
51
Linus Torvalds1da177e2005-04-16 15:20:36 -070052#endif /* __ASM_ARCH_UNCOMPRESS_H */