levelDataPreprocessingThread.c 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. /*
  2. * linux/arch/arm/mach-omap2/id.c
  3. *
  4. * OMAP2 CPU identification code
  5. *
  6. * Copyright (C) 2005 Nokia Corporation
  7. * Written by Tony Lindgren <tony@atomide.com>
  8. *
  9. * Copyright (C) 2009-11 Texas Instruments
  10. * Added OMAP4 support - Santosh Shilimkar <santosh.shilimkar@ti.com>
  11. *
  12. * This program is free software; you can redistribute it and/or modify
  13. * it under the terms of the GNU General Public License version 2 as
  14. * published by the Free Software Foundation.
  15. */
  16. #include <linux/module.h>
  17. #include <linux/kernel.h>
  18. #include <linux/init.h>
  19. #include <linux/io.h>
  20. #include <asm/cputype.h>
  21. #include "common.h"
  22. #include "id.h"
  23. #include "soc.h"
  24. #include "control.h"
  25. #define OMAP4_SILICON_TYPE_STANDARD 0x01
  26. #define OMAP4_SILICON_TYPE_PERFORMANCE 0x02
  27. static unsigned int omap_revision;
  28. static const char *cpu_rev;
  29. u32 omap_features;
  30. unsigned int omap_rev(void)
  31. {
  32. return omap_revision;
  33. }
  34. EXPORT_SYMBOL(omap_rev);
  35. int omap_type(void)
  36. {
  37. u32 val = 0;
  38. if (cpu_is_omap24xx()) {
  39. val = omap_ctrl_readl(OMAP24XX_CONTROL_STATUS);
  40. } else if (soc_is_am33xx()) {
  41. val = omap_ctrl_readl(AM33XX_CONTROL_STATUS);
  42. } else if (cpu_is_omap34xx()) {
  43. val = omap_ctrl_readl(OMAP343X_CONTROL_STATUS);
  44. } else if (cpu_is_omap44xx()) {
  45. val = omap_ctrl_readl(OMAP4_CTRL_MODULE_CORE_STATUS);
  46. } else if (soc_is_omap54xx()) {
  47. val = omap_ctrl_readl(OMAP5XXX_CONTROL_STATUS);
  48. val &= OMAP5_DEVICETYPE_MASK;
  49. val >>= 6;
  50. goto out;
  51. } else {
  52. pr_err("Cannot detect omap type!\n");
  53. goto out;
  54. }
  55. val &= OMAP2_DEVICETYPE_MASK;
  56. val >>= 8;
  57. out:
  58. return val;
  59. }
  60. EXPORT_SYMBOL(omap_type);
  61. /*----------------------------------------------------------------------------*/
  62. #define OMAP_TAP_IDCODE 0x0204
  63. #define OMAP_TAP_DIE_ID_0 0x0218
  64. #define OMAP_TAP_DIE_ID_1 0x021C
  65. #define OMAP_TAP_DIE_ID_2 0x0220
  66. #define OMAP_TAP_DIE_ID_3 0x0224
  67. #define OMAP_TAP_DIE_ID_44XX_0 0x0200
  68. #define OMAP_TAP_DIE_ID_44XX_1 0x0208
  69. #define OMAP_TAP_DIE_ID_44XX_2 0x020c
  70. #define OMAP_TAP_DIE_ID_44XX_3 0x0210
  71. #define read_tap_reg(reg) __raw_readl(tap_base + (reg))
  72. struct omap_id {
  73. u16 hawkeye; /* Silicon type (Hawkeye id) */
  74. u8 dev; /* Device type from production_id reg */
  75. u32 type; /* Combined type id copied to omap_revision */
  76. };
  77. /* Register values to detect the OMAP version */