blob: 7058382a640566a891a6efdcec4b5232a144469b [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/* linux/include/asm-arm/arch-s3c2410/uncompress.h
2 *
Ben Dooksf0560762006-12-17 19:59:20 +01003 * Copyright (c) 2003 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
Linus Torvalds1da177e2005-04-16 15:20:36 -07005 *
6 * S3C2410 - 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.
Linus Torvalds1da177e2005-04-16 15:20:36 -070011*/
12
13#ifndef __ASM_ARCH_UNCOMPRESS_H
14#define __ASM_ARCH_UNCOMPRESS_H
15
Ben Dooksa14a26a2007-07-22 16:13:29 +010016#include <asm/arch/regs-gpio.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070017#include <asm/arch/map.h>
18
19/* working in physical space... */
20#undef S3C2410_GPIOREG
Lucas Correia Villa Real0367a8d2006-01-26 15:20:50 +000021#define S3C2410_GPIOREG(x) ((S3C24XX_PA_GPIO + (x)))
Ben Dooksa14a26a2007-07-22 16:13:29 +010022
23#include <asm/plat-s3c/uncompress.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070024
25/* how many bytes we allow into the FIFO at a time in FIFO mode */
26#define FIFO_MAX (14)
27
Ben Dooks5c492182007-07-22 16:14:02 +010028static inline int is_arm926(void)
29{
30 unsigned int cpuid;
31
32 asm volatile ("mrc p15, 0, %0, c1, c0, 0" : "=r" (cpuid));
33
34 return ((cpuid & 0xff0) == 0x260);
35}
36
Ben Dooksa14a26a2007-07-22 16:13:29 +010037static void arch_detect_cpu(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -070038{
Ben Dooksa14a26a2007-07-22 16:13:29 +010039 unsigned int cpuid;
Linus Torvalds1da177e2005-04-16 15:20:36 -070040
Lucas Correia Villa Realbd7b1702005-04-25 23:12:50 +010041 cpuid = *((volatile unsigned int *)S3C2410_GSTATUS1);
Linus Torvalds1da177e2005-04-16 15:20:36 -070042 cpuid &= S3C2410_GSTATUS1_IDMASK;
Linus Torvalds1da177e2005-04-16 15:20:36 -070043
Ben Dooks5c492182007-07-22 16:14:02 +010044 if (is_arm926() || cpuid == S3C2410_GSTATUS1_2440 ||
Ben Dooksa14a26a2007-07-22 16:13:29 +010045 cpuid == S3C2410_GSTATUS1_2442) {
46 fifo_mask = S3C2440_UFSTAT_TXMASK;
47 fifo_max = 63 << S3C2440_UFSTAT_TXSHIFT;
Linus Torvalds1da177e2005-04-16 15:20:36 -070048 } else {
Ben Dooksa14a26a2007-07-22 16:13:29 +010049 fifo_mask = S3C2410_UFSTAT_TXMASK;
50 fifo_max = 15 << S3C2410_UFSTAT_TXSHIFT;
Linus Torvalds1da177e2005-04-16 15:20:36 -070051 }
Linus Torvalds1da177e2005-04-16 15:20:36 -070052}
53
Linus Torvalds1da177e2005-04-16 15:20:36 -070054#endif /* __ASM_ARCH_UNCOMPRESS_H */