| 
									
										
										
										
											2008-08-05 16:14:15 +01:00
										 |  |  | /* arch/arm/mach-s3c2410/include/mach/uncompress.h
 | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2009-11-13 22:54:14 +00:00
										 |  |  |  * Copyright (c) 2003-2007 Simtec Electronics | 
					
						
							| 
									
										
										
										
											2007-07-22 16:22:06 +01:00
										 |  |  |  *	http://armlinux.simtec.co.uk/
 | 
					
						
							| 
									
										
										
										
											2006-12-17 19:59:20 +01:00
										 |  |  |  *	Ben Dooks <ben@simtec.co.uk> | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  |  * | 
					
						
							|  |  |  |  * S3C2410 - uncompress code | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * This program is free software; you can redistribute it and/or modify | 
					
						
							|  |  |  |  * it under the terms of the GNU General Public License version 2 as | 
					
						
							|  |  |  |  * published by the Free Software Foundation. | 
					
						
							|  |  |  | */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #ifndef __ASM_ARCH_UNCOMPRESS_H
 | 
					
						
							|  |  |  | #define __ASM_ARCH_UNCOMPRESS_H
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-08-05 16:14:15 +01:00
										 |  |  | #include <mach/regs-gpio.h>
 | 
					
						
							|  |  |  | #include <mach/map.h>
 | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | /* working in physical space... */ | 
					
						
							|  |  |  | #undef S3C2410_GPIOREG
 | 
					
						
							| 
									
										
										
										
											2006-01-26 15:20:50 +00:00
										 |  |  | #define S3C2410_GPIOREG(x) ((S3C24XX_PA_GPIO + (x)))
 | 
					
						
							| 
									
										
										
										
											2007-07-22 16:13:29 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-10-07 23:09:51 +01:00
										 |  |  | #include <plat/uncompress.h>
 | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-07-22 16:14:02 +01:00
										 |  |  | static inline int is_arm926(void) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	unsigned int cpuid; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	asm volatile ("mrc p15, 0, %0, c1, c0, 0" : "=r" (cpuid)); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	return ((cpuid & 0xff0) == 0x260); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-07-22 16:13:29 +01:00
										 |  |  | static void arch_detect_cpu(void) | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2007-07-22 16:13:29 +01:00
										 |  |  | 	unsigned int cpuid; | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-04-25 23:12:50 +01:00
										 |  |  | 	cpuid = *((volatile unsigned int *)S3C2410_GSTATUS1); | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	cpuid &= S3C2410_GSTATUS1_IDMASK; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-07-22 16:14:02 +01:00
										 |  |  | 	if (is_arm926() || cpuid == S3C2410_GSTATUS1_2440 || | 
					
						
							| 
									
										
										
										
											2009-08-19 16:31:05 +03:00
										 |  |  | 	    cpuid == S3C2410_GSTATUS1_2442 || | 
					
						
							|  |  |  | 	    cpuid == S3C2410_GSTATUS1_2416 || | 
					
						
							|  |  |  | 	    cpuid == S3C2410_GSTATUS1_2450) { | 
					
						
							| 
									
										
										
										
											2007-07-22 16:13:29 +01:00
										 |  |  | 		fifo_mask = S3C2440_UFSTAT_TXMASK; | 
					
						
							|  |  |  | 		fifo_max = 63 << S3C2440_UFSTAT_TXSHIFT; | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	} else { | 
					
						
							| 
									
										
										
										
											2007-07-22 16:13:29 +01:00
										 |  |  | 		fifo_mask = S3C2410_UFSTAT_TXMASK; | 
					
						
							|  |  |  | 		fifo_max = 15 << S3C2410_UFSTAT_TXSHIFT; | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	} | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #endif /* __ASM_ARCH_UNCOMPRESS_H */
 |