uncompress.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /* arch/arm/mach-s3c2410/include/mach/uncompress.h
  2. *
  3. * Copyright (c) 2003-2007 Simtec Electronics
  4. * http://armlinux.simtec.co.uk/
  5. * Ben Dooks <ben@simtec.co.uk>
  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.
  12. */
  13. #ifndef __ASM_ARCH_UNCOMPRESS_H
  14. #define __ASM_ARCH_UNCOMPRESS_H
  15. #include <mach/regs-gpio.h>
  16. #include <mach/map.h>
  17. /* working in physical space... */
  18. #undef S3C2410_GPIOREG
  19. #define S3C2410_GPIOREG(x) ((S3C24XX_PA_GPIO + (x)))
  20. #include <plat/uncompress.h>
  21. static inline int is_arm926(void)
  22. {
  23. unsigned int cpuid;
  24. asm volatile ("mrc p15, 0, %0, c1, c0, 0" : "=r" (cpuid));
  25. return ((cpuid & 0xff0) == 0x260);
  26. }
  27. static void arch_detect_cpu(void)
  28. {
  29. unsigned int cpuid;
  30. cpuid = *((volatile unsigned int *)S3C2410_GSTATUS1);
  31. cpuid &= S3C2410_GSTATUS1_IDMASK;
  32. if (is_arm926() || cpuid == S3C2410_GSTATUS1_2440 ||
  33. cpuid == S3C2410_GSTATUS1_2442 ||
  34. cpuid == S3C2410_GSTATUS1_2416 ||
  35. cpuid == S3C2410_GSTATUS1_2450) {
  36. fifo_mask = S3C2440_UFSTAT_TXMASK;
  37. fifo_max = 63 << S3C2440_UFSTAT_TXSHIFT;
  38. } else {
  39. fifo_mask = S3C2410_UFSTAT_TXMASK;
  40. fifo_max = 15 << S3C2410_UFSTAT_TXSHIFT;
  41. }
  42. }
  43. #endif /* __ASM_ARCH_UNCOMPRESS_H */