Advertisement
Guest User

Untitled

a guest
Mar 25th, 2013
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.64 KB | None | 0 0
  1. From e6b7ccf8a9ee96157ac93df60545ad583ad01041 Mon Sep 17 00:00:00 2001
  2. From: Fabio Estevam <fabio.estevam@freescale.com>
  3. Date: Tue, 26 Mar 2013 00:19:32 -0300
  4. Subject: [PATCH] mx6: Fix the reading of CPU version
  5.  
  6. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
  7. ---
  8. arch/arm/cpu/armv7/mx6/soc.c | 28 ++++++++++++----------------
  9. arch/arm/imx-common/cpu.c | 10 ++++------
  10. arch/arm/include/asm/arch-mx5/sys_proto.h | 6 +++---
  11. arch/arm/include/asm/arch-mx6/sys_proto.h | 5 ++---
  12. 4 files changed, 21 insertions(+), 28 deletions(-)
  13.  
  14. diff --git a/arch/arm/cpu/armv7/mx6/soc.c b/arch/arm/cpu/armv7/mx6/soc.c
  15. index 193ba12..87725eb 100644
  16. --- a/arch/arm/cpu/armv7/mx6/soc.c
  17. +++ b/arch/arm/cpu/armv7/mx6/soc.c
  18. @@ -43,22 +43,18 @@ struct scu_regs {
  19. u32 get_cpu_rev(void)
  20. {
  21. struct anatop_regs *anatop = (struct anatop_regs *)ANATOP_BASE_ADDR;
  22. - u32 reg = readl(&anatop->digprog_sololite);
  23. - u32 type = ((reg >> 16) & 0xff);
  24. -
  25. - if (type != MXC_CPU_MX6SL) {
  26. - reg = readl(&anatop->digprog);
  27. - type = ((reg >> 16) & 0xff);
  28. - if (type == MXC_CPU_MX6DL) {
  29. - struct scu_regs *scu = (struct scu_regs *)SCU_BASE_ADDR;
  30. - u32 cfg = readl(&scu->config) & 3;
  31. -
  32. - if (!cfg)
  33. - type = MXC_CPU_MX6SOLO;
  34. - }
  35. - }
  36. - reg &= 0xff; /* mx6 silicon revision */
  37. - return (type << 12) | (reg + 0x10);
  38. + u32 fsl_system_rev;
  39. + u32 cpu_rev = readl(&anatop->digprog);
  40. +
  41. + /* Chip Silicon ID */
  42. + fsl_system_rev = ((cpu_rev >> 16) & 0xFF) << 12;
  43. + /* Chip silicon major revision */
  44. + fsl_system_rev |= ((cpu_rev >> 8) & 0xFF) << 4;
  45. + fsl_system_rev += 0x10;
  46. + /* Chip silicon minor revision */
  47. + fsl_system_rev |= cpu_rev & 0xFF;
  48. +
  49. + return fsl_system_rev;
  50. }
  51.  
  52. void init_aips(void)
  53. diff --git a/arch/arm/imx-common/cpu.c b/arch/arm/imx-common/cpu.c
  54. index a9b86c1..70973c4 100644
  55. --- a/arch/arm/imx-common/cpu.c
  56. +++ b/arch/arm/imx-common/cpu.c
  57. @@ -120,12 +120,10 @@ unsigned imx_ddr_size(void)
  58. const char *get_imx_type(u32 imxtype)
  59. {
  60. switch (imxtype) {
  61. - case MXC_CPU_MX6Q:
  62. - return "6Q"; /* Quad-core version of the mx6 */
  63. - case MXC_CPU_MX6DL:
  64. - return "6DL"; /* Dual Lite version of the mx6 */
  65. - case MXC_CPU_MX6SOLO:
  66. - return "6SOLO"; /* Solo version of the mx6 */
  67. + case MXC_CPU_MX6Q_D:
  68. + return "6Q/D"; /* Quad/Dual version of the mx6 */
  69. + case MXC_CPU_MX6DL_S:
  70. + return "6DL/S"; /* Dual-Lite/Solo version of the mx6 */
  71. case MXC_CPU_MX6SL:
  72. return "6SL"; /* Solo-Lite version of the mx6 */
  73. case MXC_CPU_MX51:
  74. diff --git a/arch/arm/include/asm/arch-mx5/sys_proto.h b/arch/arm/include/asm/arch-mx5/sys_proto.h
  75. index 93ad1c6..1e2a251 100644
  76. --- a/arch/arm/include/asm/arch-mx5/sys_proto.h
  77. +++ b/arch/arm/include/asm/arch-mx5/sys_proto.h
  78. @@ -27,9 +27,9 @@
  79. #define MXC_CPU_MX51 0x51
  80. #define MXC_CPU_MX53 0x53
  81. #define MXC_CPU_MX6SL 0x60
  82. -#define MXC_CPU_MX6DL 0x61
  83. -#define MXC_CPU_MX6SOLO 0x62
  84. -#define MXC_CPU_MX6Q 0x63
  85. +#define MXC_CPU_MX6SL 0x60
  86. +#define MXC_CPU_MX6DL_S 0x61
  87. +#define MXC_CPU_MX6Q_D 0x63
  88.  
  89. #define is_soc_rev(rev) ((get_cpu_rev() & 0xFF) - rev)
  90. u32 get_cpu_rev(void);
  91. diff --git a/arch/arm/include/asm/arch-mx6/sys_proto.h b/arch/arm/include/asm/arch-mx6/sys_proto.h
  92. index 3193297..9d85340 100644
  93. --- a/arch/arm/include/asm/arch-mx6/sys_proto.h
  94. +++ b/arch/arm/include/asm/arch-mx6/sys_proto.h
  95. @@ -27,9 +27,8 @@
  96. #define MXC_CPU_MX51 0x51
  97. #define MXC_CPU_MX53 0x53
  98. #define MXC_CPU_MX6SL 0x60
  99. -#define MXC_CPU_MX6DL 0x61
  100. -#define MXC_CPU_MX6SOLO 0x62
  101. -#define MXC_CPU_MX6Q 0x63
  102. +#define MXC_CPU_MX6DL_S 0x61
  103. +#define MXC_CPU_MX6Q_D 0x63
  104.  
  105. #define is_soc_rev(rev) ((get_cpu_rev() & 0xFF) - rev)
  106. u32 get_cpu_rev(void);
  107. --
  108. 1.7.9.5
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement