cpu-imx35.c 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. * MX35 CPU type detection
  3. *
  4. * Copyright (c) 2009 Daniel Mack <daniel@caiaq.de>
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. */
  11. #include <linux/module.h>
  12. #include <linux/io.h>
  13. #include <mach/hardware.h>
  14. #include <mach/iim.h>
  15. unsigned int mx35_cpu_rev;
  16. EXPORT_SYMBOL(mx35_cpu_rev);
  17. void __init mx35_read_cpu_rev(void)
  18. {
  19. u32 rev;
  20. char *srev;
  21. rev = __raw_readl(MX35_IO_ADDRESS(MX35_IIM_BASE_ADDR + MXC_IIMSREV));
  22. switch (rev) {
  23. case 0x00:
  24. mx35_cpu_rev = IMX_CHIP_REVISION_1_0;
  25. srev = "1.0";
  26. break;
  27. case 0x10:
  28. mx35_cpu_rev = IMX_CHIP_REVISION_2_0;
  29. srev = "2.0";
  30. break;
  31. case 0x11:
  32. mx35_cpu_rev = IMX_CHIP_REVISION_2_1;
  33. srev = "2.1";
  34. break;
  35. default:
  36. mx35_cpu_rev = IMX_CHIP_REVISION_UNKNOWN;
  37. srev = "unknown";
  38. }
  39. printk(KERN_INFO "CPU identified as i.MX35, silicon rev %s\n", srev);
  40. }