Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* linux/include/asm-arm/arch-s3c2410/uncompress.h |
| 2 | * |
Ben Dooks | dd1313a | 2007-07-22 16:22:06 +0100 | [diff] [blame] | 3 | * Copyright (c) 2003, 2007 Simtec Electronics |
| 4 | * http://armlinux.simtec.co.uk/ |
Ben Dooks | f056076 | 2006-12-17 19:59:20 +0100 | [diff] [blame] | 5 | * Ben Dooks <ben@simtec.co.uk> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 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. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 12 | */ |
| 13 | |
| 14 | #ifndef __ASM_ARCH_UNCOMPRESS_H |
| 15 | #define __ASM_ARCH_UNCOMPRESS_H |
| 16 | |
Ben Dooks | a14a26a | 2007-07-22 16:13:29 +0100 | [diff] [blame] | 17 | #include <asm/arch/regs-gpio.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 18 | #include <asm/arch/map.h> |
| 19 | |
| 20 | /* working in physical space... */ |
| 21 | #undef S3C2410_GPIOREG |
Lucas Correia Villa Real | 0367a8d | 2006-01-26 15:20:50 +0000 | [diff] [blame] | 22 | #define S3C2410_GPIOREG(x) ((S3C24XX_PA_GPIO + (x))) |
Ben Dooks | a14a26a | 2007-07-22 16:13:29 +0100 | [diff] [blame] | 23 | |
| 24 | #include <asm/plat-s3c/uncompress.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 25 | |
Ben Dooks | 5c49218 | 2007-07-22 16:14:02 +0100 | [diff] [blame] | 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 | |
Ben Dooks | a14a26a | 2007-07-22 16:13:29 +0100 | [diff] [blame] | 35 | static void arch_detect_cpu(void) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 36 | { |
Ben Dooks | a14a26a | 2007-07-22 16:13:29 +0100 | [diff] [blame] | 37 | unsigned int cpuid; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 38 | |
Lucas Correia Villa Real | bd7b170 | 2005-04-25 23:12:50 +0100 | [diff] [blame] | 39 | cpuid = *((volatile unsigned int *)S3C2410_GSTATUS1); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 40 | cpuid &= S3C2410_GSTATUS1_IDMASK; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 41 | |
Ben Dooks | 5c49218 | 2007-07-22 16:14:02 +0100 | [diff] [blame] | 42 | if (is_arm926() || cpuid == S3C2410_GSTATUS1_2440 || |
Ben Dooks | a14a26a | 2007-07-22 16:13:29 +0100 | [diff] [blame] | 43 | cpuid == S3C2410_GSTATUS1_2442) { |
| 44 | fifo_mask = S3C2440_UFSTAT_TXMASK; |
| 45 | fifo_max = 63 << S3C2440_UFSTAT_TXSHIFT; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 46 | } else { |
Ben Dooks | a14a26a | 2007-07-22 16:13:29 +0100 | [diff] [blame] | 47 | fifo_mask = S3C2410_UFSTAT_TXMASK; |
| 48 | fifo_max = 15 << S3C2410_UFSTAT_TXSHIFT; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 49 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 50 | } |
| 51 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 52 | #endif /* __ASM_ARCH_UNCOMPRESS_H */ |