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