Abhimanyu Kapur | 440cdde | 2012-12-04 00:05:40 -0800 | [diff] [blame] | 1 | /* Copyright (c) 2009-2013, The Linux Foundation. All rights reserved. |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2 | * |
| 3 | * This program is free software; you can redistribute it and/or modify |
| 4 | * it under the terms of the GNU General Public License version 2 and |
| 5 | * only version 2 as published by the Free Software Foundation. |
| 6 | * |
| 7 | * This program is distributed in the hope that it will be useful, |
| 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 10 | * GNU General Public License for more details. |
| 11 | * |
| 12 | */ |
| 13 | /* |
| 14 | * SOC Info Routines |
| 15 | * |
| 16 | */ |
| 17 | |
Abhimanyu Kapur | 440cdde | 2012-12-04 00:05:40 -0800 | [diff] [blame] | 18 | #include <linux/err.h> |
| 19 | #include <linux/of.h> |
| 20 | #include <linux/platform_device.h> |
| 21 | #include <linux/sys_soc.h> |
| 22 | #include <linux/slab.h> |
| 23 | #include <linux/stat.h> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 24 | #include <linux/sysdev.h> |
Abhimanyu Kapur | 440cdde | 2012-12-04 00:05:40 -0800 | [diff] [blame] | 25 | #include <linux/types.h> |
| 26 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 27 | #include <asm/mach-types.h> |
Abhimanyu Kapur | 440cdde | 2012-12-04 00:05:40 -0800 | [diff] [blame] | 28 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 29 | #include <mach/socinfo.h> |
Jeff Hugo | 5ba15fe | 2013-05-06 14:24:24 -0600 | [diff] [blame] | 30 | #include <mach/msm_smem.h> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 31 | |
Abhimanyu Kapur | cf3ed15 | 2013-03-01 19:32:19 -0800 | [diff] [blame] | 32 | #include "boot_stats.h" |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 33 | |
| 34 | #define BUILD_ID_LENGTH 32 |
| 35 | |
| 36 | enum { |
| 37 | HW_PLATFORM_UNKNOWN = 0, |
| 38 | HW_PLATFORM_SURF = 1, |
| 39 | HW_PLATFORM_FFA = 2, |
| 40 | HW_PLATFORM_FLUID = 3, |
| 41 | HW_PLATFORM_SVLTE_FFA = 4, |
| 42 | HW_PLATFORM_SVLTE_SURF = 5, |
Jin Hong | 4975332 | 2011-12-15 16:55:37 -0800 | [diff] [blame] | 43 | HW_PLATFORM_MTP = 8, |
Amir Samuelov | 1b0dc31 | 2011-11-17 20:43:33 +0200 | [diff] [blame] | 44 | HW_PLATFORM_LIQUID = 9, |
Zhang Chang Ken | 59004eb | 2011-08-08 09:06:58 -0400 | [diff] [blame] | 45 | /* Dragonboard platform id is assigned as 10 in CDT */ |
| 46 | HW_PLATFORM_DRAGON = 10, |
David Ng | 32dfa3c | 2013-03-19 16:55:54 -0700 | [diff] [blame] | 47 | HW_PLATFORM_QRD = 11, |
ChandraMouli Bothsa | eae28bb | 2012-09-20 09:57:37 +0530 | [diff] [blame] | 48 | HW_PLATFORM_HRD = 13, |
| 49 | HW_PLATFORM_DTV = 14, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 50 | HW_PLATFORM_INVALID |
| 51 | }; |
| 52 | |
| 53 | const char *hw_platform[] = { |
| 54 | [HW_PLATFORM_UNKNOWN] = "Unknown", |
| 55 | [HW_PLATFORM_SURF] = "Surf", |
| 56 | [HW_PLATFORM_FFA] = "FFA", |
| 57 | [HW_PLATFORM_FLUID] = "Fluid", |
| 58 | [HW_PLATFORM_SVLTE_FFA] = "SVLTE_FFA", |
Zhang Chang Ken | ef05b17 | 2011-07-27 15:28:13 -0400 | [diff] [blame] | 59 | [HW_PLATFORM_SVLTE_SURF] = "SLVTE_SURF", |
Jin Hong | 4975332 | 2011-12-15 16:55:37 -0800 | [diff] [blame] | 60 | [HW_PLATFORM_MTP] = "MTP", |
| 61 | [HW_PLATFORM_LIQUID] = "Liquid", |
ChandraMouli Bothsa | eae28bb | 2012-09-20 09:57:37 +0530 | [diff] [blame] | 62 | [HW_PLATFORM_DRAGON] = "Dragon", |
David Ng | 32dfa3c | 2013-03-19 16:55:54 -0700 | [diff] [blame] | 63 | [HW_PLATFORM_QRD] = "QRD", |
ChandraMouli Bothsa | eae28bb | 2012-09-20 09:57:37 +0530 | [diff] [blame] | 64 | [HW_PLATFORM_HRD] = "HRD", |
| 65 | [HW_PLATFORM_DTV] = "DTV", |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 66 | }; |
| 67 | |
| 68 | enum { |
| 69 | ACCESSORY_CHIP_UNKNOWN = 0, |
| 70 | ACCESSORY_CHIP_CHARM = 58, |
| 71 | }; |
| 72 | |
| 73 | enum { |
| 74 | PLATFORM_SUBTYPE_UNKNOWN = 0x0, |
| 75 | PLATFORM_SUBTYPE_CHARM = 0x1, |
| 76 | PLATFORM_SUBTYPE_STRANGE = 0x2, |
| 77 | PLATFORM_SUBTYPE_STRANGE_2A = 0x3, |
| 78 | PLATFORM_SUBTYPE_INVALID, |
| 79 | }; |
| 80 | |
| 81 | const char *hw_platform_subtype[] = { |
| 82 | [PLATFORM_SUBTYPE_UNKNOWN] = "Unknown", |
| 83 | [PLATFORM_SUBTYPE_CHARM] = "charm", |
| 84 | [PLATFORM_SUBTYPE_STRANGE] = "strange", |
| 85 | [PLATFORM_SUBTYPE_STRANGE_2A] = "strange_2a," |
| 86 | }; |
| 87 | |
| 88 | /* Used to parse shared memory. Must match the modem. */ |
| 89 | struct socinfo_v1 { |
| 90 | uint32_t format; |
| 91 | uint32_t id; |
| 92 | uint32_t version; |
| 93 | char build_id[BUILD_ID_LENGTH]; |
| 94 | }; |
| 95 | |
| 96 | struct socinfo_v2 { |
| 97 | struct socinfo_v1 v1; |
| 98 | |
| 99 | /* only valid when format==2 */ |
| 100 | uint32_t raw_id; |
| 101 | uint32_t raw_version; |
| 102 | }; |
| 103 | |
| 104 | struct socinfo_v3 { |
| 105 | struct socinfo_v2 v2; |
| 106 | |
| 107 | /* only valid when format==3 */ |
| 108 | uint32_t hw_platform; |
| 109 | }; |
| 110 | |
| 111 | struct socinfo_v4 { |
| 112 | struct socinfo_v3 v3; |
| 113 | |
| 114 | /* only valid when format==4 */ |
| 115 | uint32_t platform_version; |
| 116 | }; |
| 117 | |
| 118 | struct socinfo_v5 { |
| 119 | struct socinfo_v4 v4; |
| 120 | |
| 121 | /* only valid when format==5 */ |
| 122 | uint32_t accessory_chip; |
| 123 | }; |
| 124 | |
| 125 | struct socinfo_v6 { |
| 126 | struct socinfo_v5 v5; |
| 127 | |
| 128 | /* only valid when format==6 */ |
| 129 | uint32_t hw_platform_subtype; |
| 130 | }; |
| 131 | |
Jin Hong | 9b556c3 | 2012-08-13 23:06:26 -0700 | [diff] [blame] | 132 | struct socinfo_v7 { |
| 133 | struct socinfo_v6 v6; |
| 134 | |
| 135 | /* only valid when format==7 */ |
| 136 | uint32_t pmic_model; |
| 137 | uint32_t pmic_die_revision; |
| 138 | }; |
| 139 | |
Abhimanyu Kapur | 781c03d | 2013-02-21 16:20:23 -0800 | [diff] [blame] | 140 | struct socinfo_v8 { |
| 141 | struct socinfo_v7 v7; |
| 142 | |
| 143 | /* only valid when format==8*/ |
| 144 | uint32_t pmic_model_1; |
| 145 | uint32_t pmic_die_revision_1; |
| 146 | uint32_t pmic_model_2; |
| 147 | uint32_t pmic_die_revision_2; |
| 148 | }; |
| 149 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 150 | static union { |
| 151 | struct socinfo_v1 v1; |
| 152 | struct socinfo_v2 v2; |
| 153 | struct socinfo_v3 v3; |
| 154 | struct socinfo_v4 v4; |
| 155 | struct socinfo_v5 v5; |
| 156 | struct socinfo_v6 v6; |
Jin Hong | 9b556c3 | 2012-08-13 23:06:26 -0700 | [diff] [blame] | 157 | struct socinfo_v7 v7; |
Abhimanyu Kapur | 781c03d | 2013-02-21 16:20:23 -0800 | [diff] [blame] | 158 | struct socinfo_v8 v8; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 159 | } *socinfo; |
| 160 | |
| 161 | static enum msm_cpu cpu_of_id[] = { |
| 162 | |
| 163 | /* 7x01 IDs */ |
| 164 | [1] = MSM_CPU_7X01, |
| 165 | [16] = MSM_CPU_7X01, |
| 166 | [17] = MSM_CPU_7X01, |
| 167 | [18] = MSM_CPU_7X01, |
| 168 | [19] = MSM_CPU_7X01, |
| 169 | [23] = MSM_CPU_7X01, |
| 170 | [25] = MSM_CPU_7X01, |
| 171 | [26] = MSM_CPU_7X01, |
| 172 | [32] = MSM_CPU_7X01, |
| 173 | [33] = MSM_CPU_7X01, |
| 174 | [34] = MSM_CPU_7X01, |
| 175 | [35] = MSM_CPU_7X01, |
| 176 | |
| 177 | /* 7x25 IDs */ |
| 178 | [20] = MSM_CPU_7X25, |
| 179 | [21] = MSM_CPU_7X25, /* 7225 */ |
| 180 | [24] = MSM_CPU_7X25, /* 7525 */ |
| 181 | [27] = MSM_CPU_7X25, /* 7625 */ |
| 182 | [39] = MSM_CPU_7X25, |
| 183 | [40] = MSM_CPU_7X25, |
| 184 | [41] = MSM_CPU_7X25, |
| 185 | [42] = MSM_CPU_7X25, |
| 186 | [62] = MSM_CPU_7X25, /* 7625-1 */ |
| 187 | [63] = MSM_CPU_7X25, /* 7225-1 */ |
| 188 | [66] = MSM_CPU_7X25, /* 7225-2 */ |
| 189 | |
| 190 | |
| 191 | /* 7x27 IDs */ |
| 192 | [43] = MSM_CPU_7X27, |
| 193 | [44] = MSM_CPU_7X27, |
| 194 | [61] = MSM_CPU_7X27, |
| 195 | [67] = MSM_CPU_7X27, /* 7227-1 */ |
| 196 | [68] = MSM_CPU_7X27, /* 7627-1 */ |
| 197 | [69] = MSM_CPU_7X27, /* 7627-2 */ |
| 198 | |
| 199 | |
| 200 | /* 8x50 IDs */ |
| 201 | [30] = MSM_CPU_8X50, |
| 202 | [36] = MSM_CPU_8X50, |
| 203 | [37] = MSM_CPU_8X50, |
| 204 | [38] = MSM_CPU_8X50, |
| 205 | |
| 206 | /* 7x30 IDs */ |
| 207 | [59] = MSM_CPU_7X30, |
| 208 | [60] = MSM_CPU_7X30, |
| 209 | |
| 210 | /* 8x55 IDs */ |
| 211 | [74] = MSM_CPU_8X55, |
| 212 | [75] = MSM_CPU_8X55, |
| 213 | [85] = MSM_CPU_8X55, |
| 214 | |
| 215 | /* 8x60 IDs */ |
| 216 | [70] = MSM_CPU_8X60, |
| 217 | [71] = MSM_CPU_8X60, |
| 218 | [86] = MSM_CPU_8X60, |
| 219 | |
| 220 | /* 8960 IDs */ |
| 221 | [87] = MSM_CPU_8960, |
| 222 | |
| 223 | /* 7x25A IDs */ |
| 224 | [88] = MSM_CPU_7X25A, |
| 225 | [89] = MSM_CPU_7X25A, |
| 226 | [96] = MSM_CPU_7X25A, |
| 227 | |
| 228 | /* 7x27A IDs */ |
| 229 | [90] = MSM_CPU_7X27A, |
| 230 | [91] = MSM_CPU_7X27A, |
| 231 | [92] = MSM_CPU_7X27A, |
| 232 | [97] = MSM_CPU_7X27A, |
| 233 | |
| 234 | /* FSM9xxx ID */ |
| 235 | [94] = FSM_CPU_9XXX, |
| 236 | [95] = FSM_CPU_9XXX, |
| 237 | |
| 238 | /* 7x25AA ID */ |
| 239 | [98] = MSM_CPU_7X25AA, |
| 240 | [99] = MSM_CPU_7X25AA, |
| 241 | [100] = MSM_CPU_7X25AA, |
| 242 | |
Joel King | bf2ff51 | 2011-07-22 13:43:11 -0700 | [diff] [blame] | 243 | /* 7x27AA ID */ |
| 244 | [101] = MSM_CPU_7X27AA, |
| 245 | [102] = MSM_CPU_7X27AA, |
| 246 | [103] = MSM_CPU_7X27AA, |
Kaushal Kumar | dc0beb9 | 2012-06-29 19:31:05 +0530 | [diff] [blame] | 247 | [136] = MSM_CPU_7X27AA, |
Joel King | bf2ff51 | 2011-07-22 13:43:11 -0700 | [diff] [blame] | 248 | |
Rohit Vaswani | 8a28b4a | 2011-08-10 19:07:00 -0700 | [diff] [blame] | 249 | /* 9x15 ID */ |
| 250 | [104] = MSM_CPU_9615, |
Rohit Vaswani | 865f2ca | 2011-10-03 17:40:42 -0700 | [diff] [blame] | 251 | [105] = MSM_CPU_9615, |
Rohit Vaswani | 7a83fa9 | 2012-01-11 15:05:39 -0800 | [diff] [blame] | 252 | [106] = MSM_CPU_9615, |
| 253 | [107] = MSM_CPU_9615, |
Abhimanyu Kapur | 4514912 | 2013-03-20 01:07:52 -0700 | [diff] [blame] | 254 | [171] = MSM_CPU_9615, |
Rohit Vaswani | 8a28b4a | 2011-08-10 19:07:00 -0700 | [diff] [blame] | 255 | |
Stepan Moskovchenko | a8f0a22 | 2011-10-24 18:53:17 -0700 | [diff] [blame] | 256 | /* 8064 IDs */ |
Joel King | bf2ff51 | 2011-07-22 13:43:11 -0700 | [diff] [blame] | 257 | [109] = MSM_CPU_8064, |
| 258 | |
Stepan Moskovchenko | a8f0a22 | 2011-10-24 18:53:17 -0700 | [diff] [blame] | 259 | /* 8930 IDs */ |
| 260 | [116] = MSM_CPU_8930, |
Stepan Moskovchenko | db71cd6 | 2011-11-23 14:28:57 -0800 | [diff] [blame] | 261 | [117] = MSM_CPU_8930, |
| 262 | [118] = MSM_CPU_8930, |
| 263 | [119] = MSM_CPU_8930, |
David Ng | c103f1c | 2013-02-12 18:49:25 -0800 | [diff] [blame] | 264 | [179] = MSM_CPU_8930, |
Stepan Moskovchenko | db71cd6 | 2011-11-23 14:28:57 -0800 | [diff] [blame] | 265 | |
| 266 | /* 8627 IDs */ |
| 267 | [120] = MSM_CPU_8627, |
| 268 | [121] = MSM_CPU_8627, |
Stepan Moskovchenko | a8f0a22 | 2011-10-24 18:53:17 -0700 | [diff] [blame] | 269 | |
Jin Hong | 0698b56 | 2011-11-05 13:57:25 -0700 | [diff] [blame] | 270 | /* 8660A ID */ |
| 271 | [122] = MSM_CPU_8960, |
| 272 | |
| 273 | /* 8260A ID */ |
| 274 | [123] = MSM_CPU_8960, |
| 275 | |
| 276 | /* 8060A ID */ |
| 277 | [124] = MSM_CPU_8960, |
| 278 | |
Abhimanyu Kapur | 90ced6e | 2012-06-26 17:41:25 -0700 | [diff] [blame] | 279 | /* 8974 IDs */ |
| 280 | [126] = MSM_CPU_8974, |
Stepan Moskovchenko | 22dce83 | 2013-03-25 14:36:52 -0700 | [diff] [blame] | 281 | [184] = MSM_CPU_8974, |
Stepan Moskovchenko | 2f06d83 | 2013-05-06 12:52:32 -0700 | [diff] [blame] | 282 | [185] = MSM_CPU_8974, |
| 283 | [186] = MSM_CPU_8974, |
Sathish Ambley | a99d685 | 2011-10-31 15:50:55 -0700 | [diff] [blame] | 284 | |
Taniya Das | a04e189 | 2011-11-16 14:49:12 +0530 | [diff] [blame] | 285 | /* 8625 IDs */ |
| 286 | [127] = MSM_CPU_8625, |
| 287 | [128] = MSM_CPU_8625, |
| 288 | [129] = MSM_CPU_8625, |
Kaushal Kumar | 1f8876a | 2012-08-21 14:53:50 +0530 | [diff] [blame] | 289 | [137] = MSM_CPU_8625, |
Kaushal Kumar | c84b9c2 | 2012-10-12 12:47:55 +0530 | [diff] [blame] | 290 | [167] = MSM_CPU_8625, |
Taniya Das | a04e189 | 2011-11-16 14:49:12 +0530 | [diff] [blame] | 291 | |
Joel King | 8e0bf67 | 2012-05-18 15:40:40 -0700 | [diff] [blame] | 292 | /* 8064 MPQ ID */ |
| 293 | [130] = MSM_CPU_8064, |
Rohit Vaswani | 47ee9e9 | 2012-04-23 18:42:03 -0700 | [diff] [blame] | 294 | |
Pankaj Kumar | fee56a8 | 2012-04-17 14:26:49 +0530 | [diff] [blame] | 295 | /* 7x25AB IDs */ |
| 296 | [131] = MSM_CPU_7X25AB, |
| 297 | [132] = MSM_CPU_7X25AB, |
| 298 | [133] = MSM_CPU_7X25AB, |
Kaushal Kumar | dc0beb9 | 2012-06-29 19:31:05 +0530 | [diff] [blame] | 299 | [135] = MSM_CPU_7X25AB, |
Pankaj Kumar | fee56a8 | 2012-04-17 14:26:49 +0530 | [diff] [blame] | 300 | |
Joel King | 8e0bf67 | 2012-05-18 15:40:40 -0700 | [diff] [blame] | 301 | /* 9625 IDs */ |
| 302 | [134] = MSM_CPU_9625, |
Abhimanyu Kapur | 430add8 | 2013-01-28 13:51:01 -0800 | [diff] [blame] | 303 | [148] = MSM_CPU_9625, |
Abhimanyu Kapur | 0e088bb | 2013-01-08 18:41:17 -0800 | [diff] [blame] | 304 | [149] = MSM_CPU_9625, |
| 305 | [150] = MSM_CPU_9625, |
Abhimanyu Kapur | 430add8 | 2013-01-28 13:51:01 -0800 | [diff] [blame] | 306 | [151] = MSM_CPU_9625, |
| 307 | [152] = MSM_CPU_9625, |
| 308 | [173] = MSM_CPU_9625, |
| 309 | [174] = MSM_CPU_9625, |
| 310 | [175] = MSM_CPU_9625, |
Joel King | 8e0bf67 | 2012-05-18 15:40:40 -0700 | [diff] [blame] | 311 | |
Stepan Moskovchenko | ec6a803 | 2012-07-06 15:42:01 -0700 | [diff] [blame] | 312 | /* 8960AB IDs */ |
| 313 | [138] = MSM_CPU_8960AB, |
| 314 | [139] = MSM_CPU_8960AB, |
| 315 | [140] = MSM_CPU_8960AB, |
| 316 | [141] = MSM_CPU_8960AB, |
| 317 | |
Stepan Moskovchenko | 8f362fe | 2012-07-12 19:19:52 -0700 | [diff] [blame] | 318 | /* 8930AA IDs */ |
Stepan Moskovchenko | 8b38bb3 | 2012-07-06 16:57:34 -0700 | [diff] [blame] | 319 | [142] = MSM_CPU_8930AA, |
Stepan Moskovchenko | 8f362fe | 2012-07-12 19:19:52 -0700 | [diff] [blame] | 320 | [143] = MSM_CPU_8930AA, |
| 321 | [144] = MSM_CPU_8930AA, |
Stepan Moskovchenko | 9e83cb9 | 2012-10-22 18:52:06 -0700 | [diff] [blame] | 322 | [160] = MSM_CPU_8930AA, |
David Ng | c103f1c | 2013-02-12 18:49:25 -0800 | [diff] [blame] | 323 | [180] = MSM_CPU_8930AA, |
Stepan Moskovchenko | 8b38bb3 | 2012-07-06 16:57:34 -0700 | [diff] [blame] | 324 | |
Syed Rameez Mustafa | d6084d3 | 2012-08-23 15:47:50 -0700 | [diff] [blame] | 325 | /* 8226 IDs */ |
| 326 | [145] = MSM_CPU_8226, |
| 327 | |
Ravi Kumar V | 754282d | 2012-08-31 22:32:20 +0530 | [diff] [blame] | 328 | /* 8092 IDs */ |
| 329 | [146] = MSM_CPU_8092, |
| 330 | |
Syed Rameez Mustafa | 3971c14 | 2013-01-09 19:04:53 -0800 | [diff] [blame] | 331 | /* 8610 IDs */ |
| 332 | [147] = MSM_CPU_8610, |
Abhimanyu Kapur | 35bc084 | 2013-04-19 20:02:58 -0700 | [diff] [blame] | 333 | [161] = MSM_CPU_8610, |
| 334 | [162] = MSM_CPU_8610, |
| 335 | [163] = MSM_CPU_8610, |
| 336 | [164] = MSM_CPU_8610, |
David Ng | e7b76b8 | 2013-04-10 14:59:52 -0700 | [diff] [blame] | 337 | [165] = MSM_CPU_8610, |
Abhimanyu Kapur | 35bc084 | 2013-04-19 20:02:58 -0700 | [diff] [blame] | 338 | [166] = MSM_CPU_8610, |
Syed Rameez Mustafa | 158d668 | 2012-09-21 18:25:50 -0700 | [diff] [blame] | 339 | |
Jay Chokshi | b2de509 | 2012-09-19 18:28:12 -0700 | [diff] [blame] | 340 | /* 8064AB IDs */ |
| 341 | [153] = MSM_CPU_8064AB, |
| 342 | |
Stepan Moskovchenko | a03e761 | 2012-10-16 18:34:17 -0700 | [diff] [blame] | 343 | /* 8930AB IDs */ |
| 344 | [154] = MSM_CPU_8930AB, |
| 345 | [155] = MSM_CPU_8930AB, |
| 346 | [156] = MSM_CPU_8930AB, |
Utsab Bose | 89b3299 | 2012-11-08 11:15:45 +0530 | [diff] [blame] | 347 | [157] = MSM_CPU_8930AB, |
David Ng | c103f1c | 2013-02-12 18:49:25 -0800 | [diff] [blame] | 348 | [181] = MSM_CPU_8930AB, |
Utsab Bose | 89b3299 | 2012-11-08 11:15:45 +0530 | [diff] [blame] | 349 | |
| 350 | /* 8625Q IDs */ |
| 351 | [168] = MSM_CPU_8625Q, |
| 352 | [169] = MSM_CPU_8625Q, |
| 353 | [170] = MSM_CPU_8625Q, |
| 354 | |
Jay Chokshi | f929474 | 2013-01-15 13:06:27 -0800 | [diff] [blame] | 355 | /* 8064AA IDs */ |
| 356 | [172] = MSM_CPU_8064AA, |
Stepan Moskovchenko | a03e761 | 2012-10-16 18:34:17 -0700 | [diff] [blame] | 357 | |
Stepan Moskovchenko | e90cd65 | 2013-04-18 12:54:47 -0700 | [diff] [blame] | 358 | /* 8084 IDs */ |
| 359 | [178] = MSM_CPU_8084, |
Stepan Moskovchenko | 55dfdc3 | 2013-01-24 15:48:23 -0800 | [diff] [blame] | 360 | |
Abhimanyu Kapur | 37bea77 | 2013-04-11 18:19:38 -0700 | [diff] [blame] | 361 | /* krypton IDs */ |
| 362 | [187] = MSM_CPU_KRYPTON, |
| 363 | |
Rohit Vaswani | c3df8b9 | 2013-03-20 19:11:15 -0700 | [diff] [blame] | 364 | /* FSM9900 ID */ |
| 365 | [188] = FSM_CPU_9900, |
| 366 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 367 | /* Uninitialized IDs are not known to run Linux. |
| 368 | MSM_CPU_UNKNOWN is set to 0 to ensure these IDs are |
| 369 | considered as unknown CPU. */ |
| 370 | }; |
| 371 | |
| 372 | static enum msm_cpu cur_cpu; |
| 373 | |
| 374 | static struct socinfo_v1 dummy_socinfo = { |
| 375 | .format = 1, |
| 376 | .version = 1, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 377 | }; |
| 378 | |
| 379 | uint32_t socinfo_get_id(void) |
| 380 | { |
| 381 | return (socinfo) ? socinfo->v1.id : 0; |
| 382 | } |
| 383 | EXPORT_SYMBOL_GPL(socinfo_get_id); |
| 384 | |
| 385 | uint32_t socinfo_get_version(void) |
| 386 | { |
| 387 | return (socinfo) ? socinfo->v1.version : 0; |
| 388 | } |
| 389 | |
| 390 | char *socinfo_get_build_id(void) |
| 391 | { |
| 392 | return (socinfo) ? socinfo->v1.build_id : NULL; |
| 393 | } |
| 394 | |
| 395 | uint32_t socinfo_get_raw_id(void) |
| 396 | { |
| 397 | return socinfo ? |
| 398 | (socinfo->v1.format >= 2 ? socinfo->v2.raw_id : 0) |
| 399 | : 0; |
| 400 | } |
| 401 | |
| 402 | uint32_t socinfo_get_raw_version(void) |
| 403 | { |
| 404 | return socinfo ? |
| 405 | (socinfo->v1.format >= 2 ? socinfo->v2.raw_version : 0) |
| 406 | : 0; |
| 407 | } |
| 408 | |
| 409 | uint32_t socinfo_get_platform_type(void) |
| 410 | { |
| 411 | return socinfo ? |
| 412 | (socinfo->v1.format >= 3 ? socinfo->v3.hw_platform : 0) |
| 413 | : 0; |
| 414 | } |
| 415 | |
| 416 | |
| 417 | uint32_t socinfo_get_platform_version(void) |
| 418 | { |
| 419 | return socinfo ? |
| 420 | (socinfo->v1.format >= 4 ? socinfo->v4.platform_version : 0) |
| 421 | : 0; |
| 422 | } |
| 423 | |
| 424 | /* This information is directly encoded by the machine id */ |
| 425 | /* Thus no external callers rely on this information at the moment */ |
| 426 | static uint32_t socinfo_get_accessory_chip(void) |
| 427 | { |
| 428 | return socinfo ? |
| 429 | (socinfo->v1.format >= 5 ? socinfo->v5.accessory_chip : 0) |
| 430 | : 0; |
| 431 | } |
| 432 | |
| 433 | uint32_t socinfo_get_platform_subtype(void) |
| 434 | { |
| 435 | return socinfo ? |
| 436 | (socinfo->v1.format >= 6 ? socinfo->v6.hw_platform_subtype : 0) |
| 437 | : 0; |
| 438 | } |
| 439 | |
Jin Hong | 9b556c3 | 2012-08-13 23:06:26 -0700 | [diff] [blame] | 440 | enum pmic_model socinfo_get_pmic_model(void) |
| 441 | { |
| 442 | return socinfo ? |
| 443 | (socinfo->v1.format >= 7 ? socinfo->v7.pmic_model |
| 444 | : PMIC_MODEL_UNKNOWN) |
| 445 | : PMIC_MODEL_UNKNOWN; |
| 446 | } |
| 447 | |
| 448 | uint32_t socinfo_get_pmic_die_revision(void) |
| 449 | { |
| 450 | return socinfo ? |
| 451 | (socinfo->v1.format >= 7 ? socinfo->v7.pmic_die_revision : 0) |
| 452 | : 0; |
| 453 | } |
| 454 | |
Abhimanyu Kapur | 440cdde | 2012-12-04 00:05:40 -0800 | [diff] [blame] | 455 | static uint32_t socinfo_get_format(void) |
| 456 | { |
| 457 | return socinfo ? socinfo->v1.format : 0; |
| 458 | } |
| 459 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 460 | enum msm_cpu socinfo_get_msm_cpu(void) |
| 461 | { |
| 462 | return cur_cpu; |
| 463 | } |
| 464 | EXPORT_SYMBOL_GPL(socinfo_get_msm_cpu); |
| 465 | |
| 466 | static ssize_t |
| 467 | socinfo_show_id(struct sys_device *dev, |
| 468 | struct sysdev_attribute *attr, |
| 469 | char *buf) |
| 470 | { |
| 471 | if (!socinfo) { |
| 472 | pr_err("%s: No socinfo found!\n", __func__); |
| 473 | return 0; |
| 474 | } |
| 475 | |
| 476 | return snprintf(buf, PAGE_SIZE, "%u\n", socinfo_get_id()); |
| 477 | } |
| 478 | |
| 479 | static ssize_t |
| 480 | socinfo_show_version(struct sys_device *dev, |
| 481 | struct sysdev_attribute *attr, |
| 482 | char *buf) |
| 483 | { |
| 484 | uint32_t version; |
| 485 | |
| 486 | if (!socinfo) { |
| 487 | pr_err("%s: No socinfo found!\n", __func__); |
| 488 | return 0; |
| 489 | } |
| 490 | |
| 491 | version = socinfo_get_version(); |
| 492 | return snprintf(buf, PAGE_SIZE, "%u.%u\n", |
| 493 | SOCINFO_VERSION_MAJOR(version), |
| 494 | SOCINFO_VERSION_MINOR(version)); |
| 495 | } |
| 496 | |
| 497 | static ssize_t |
| 498 | socinfo_show_build_id(struct sys_device *dev, |
| 499 | struct sysdev_attribute *attr, |
| 500 | char *buf) |
| 501 | { |
| 502 | if (!socinfo) { |
| 503 | pr_err("%s: No socinfo found!\n", __func__); |
| 504 | return 0; |
| 505 | } |
| 506 | |
| 507 | return snprintf(buf, PAGE_SIZE, "%-.32s\n", socinfo_get_build_id()); |
| 508 | } |
| 509 | |
| 510 | static ssize_t |
| 511 | socinfo_show_raw_id(struct sys_device *dev, |
| 512 | struct sysdev_attribute *attr, |
| 513 | char *buf) |
| 514 | { |
| 515 | if (!socinfo) { |
| 516 | pr_err("%s: No socinfo found!\n", __func__); |
| 517 | return 0; |
| 518 | } |
| 519 | if (socinfo->v1.format < 2) { |
| 520 | pr_err("%s: Raw ID not available!\n", __func__); |
| 521 | return 0; |
| 522 | } |
| 523 | |
| 524 | return snprintf(buf, PAGE_SIZE, "%u\n", socinfo_get_raw_id()); |
| 525 | } |
| 526 | |
| 527 | static ssize_t |
| 528 | socinfo_show_raw_version(struct sys_device *dev, |
| 529 | struct sysdev_attribute *attr, |
| 530 | char *buf) |
| 531 | { |
| 532 | if (!socinfo) { |
| 533 | pr_err("%s: No socinfo found!\n", __func__); |
| 534 | return 0; |
| 535 | } |
| 536 | if (socinfo->v1.format < 2) { |
| 537 | pr_err("%s: Raw version not available!\n", __func__); |
| 538 | return 0; |
| 539 | } |
| 540 | |
| 541 | return snprintf(buf, PAGE_SIZE, "%u\n", socinfo_get_raw_version()); |
| 542 | } |
| 543 | |
| 544 | static ssize_t |
| 545 | socinfo_show_platform_type(struct sys_device *dev, |
| 546 | struct sysdev_attribute *attr, |
| 547 | char *buf) |
| 548 | { |
| 549 | uint32_t hw_type; |
| 550 | |
| 551 | if (!socinfo) { |
| 552 | pr_err("%s: No socinfo found!\n", __func__); |
| 553 | return 0; |
| 554 | } |
| 555 | if (socinfo->v1.format < 3) { |
| 556 | pr_err("%s: platform type not available!\n", __func__); |
| 557 | return 0; |
| 558 | } |
| 559 | |
| 560 | hw_type = socinfo_get_platform_type(); |
| 561 | if (hw_type >= HW_PLATFORM_INVALID) { |
| 562 | pr_err("%s: Invalid hardware platform type found\n", |
| 563 | __func__); |
| 564 | hw_type = HW_PLATFORM_UNKNOWN; |
| 565 | } |
| 566 | |
| 567 | return snprintf(buf, PAGE_SIZE, "%-.32s\n", hw_platform[hw_type]); |
| 568 | } |
| 569 | |
| 570 | static ssize_t |
| 571 | socinfo_show_platform_version(struct sys_device *dev, |
| 572 | struct sysdev_attribute *attr, |
| 573 | char *buf) |
| 574 | { |
| 575 | |
| 576 | if (!socinfo) { |
| 577 | pr_err("%s: No socinfo found!\n", __func__); |
| 578 | return 0; |
| 579 | } |
| 580 | if (socinfo->v1.format < 4) { |
| 581 | pr_err("%s: platform version not available!\n", __func__); |
| 582 | return 0; |
| 583 | } |
| 584 | |
| 585 | return snprintf(buf, PAGE_SIZE, "%u\n", |
| 586 | socinfo_get_platform_version()); |
| 587 | } |
| 588 | |
| 589 | static ssize_t |
| 590 | socinfo_show_accessory_chip(struct sys_device *dev, |
| 591 | struct sysdev_attribute *attr, |
| 592 | char *buf) |
| 593 | { |
| 594 | if (!socinfo) { |
| 595 | pr_err("%s: No socinfo found!\n", __func__); |
| 596 | return 0; |
| 597 | } |
| 598 | if (socinfo->v1.format < 5) { |
| 599 | pr_err("%s: accessory chip not available!\n", __func__); |
| 600 | return 0; |
| 601 | } |
| 602 | |
| 603 | return snprintf(buf, PAGE_SIZE, "%u\n", |
| 604 | socinfo_get_accessory_chip()); |
| 605 | } |
| 606 | |
| 607 | static ssize_t |
| 608 | socinfo_show_platform_subtype(struct sys_device *dev, |
| 609 | struct sysdev_attribute *attr, |
| 610 | char *buf) |
| 611 | { |
| 612 | uint32_t hw_subtype; |
| 613 | if (!socinfo) { |
| 614 | pr_err("%s: No socinfo found!\n", __func__); |
| 615 | return 0; |
| 616 | } |
| 617 | if (socinfo->v1.format < 6) { |
| 618 | pr_err("%s: platform subtype not available!\n", __func__); |
| 619 | return 0; |
| 620 | } |
| 621 | |
| 622 | hw_subtype = socinfo_get_platform_subtype(); |
| 623 | if (hw_subtype >= PLATFORM_SUBTYPE_INVALID) { |
| 624 | pr_err("%s: Invalid hardware platform sub type found\n", |
| 625 | __func__); |
| 626 | hw_subtype = PLATFORM_SUBTYPE_UNKNOWN; |
| 627 | } |
| 628 | return snprintf(buf, PAGE_SIZE, "%-.32s\n", |
| 629 | hw_platform_subtype[hw_subtype]); |
| 630 | } |
| 631 | |
Jin Hong | 9b556c3 | 2012-08-13 23:06:26 -0700 | [diff] [blame] | 632 | static ssize_t |
| 633 | socinfo_show_pmic_model(struct sys_device *dev, |
| 634 | struct sysdev_attribute *attr, |
| 635 | char *buf) |
| 636 | { |
| 637 | if (!socinfo) { |
| 638 | pr_err("%s: No socinfo found!\n", __func__); |
| 639 | return 0; |
| 640 | } |
| 641 | if (socinfo->v1.format < 7) { |
| 642 | pr_err("%s: pmic_model not available!\n", __func__); |
| 643 | return 0; |
| 644 | } |
| 645 | |
| 646 | return snprintf(buf, PAGE_SIZE, "%u\n", |
| 647 | socinfo_get_pmic_model()); |
| 648 | } |
| 649 | |
| 650 | static ssize_t |
| 651 | socinfo_show_pmic_die_revision(struct sys_device *dev, |
| 652 | struct sysdev_attribute *attr, |
| 653 | char *buf) |
| 654 | { |
| 655 | if (!socinfo) { |
| 656 | pr_err("%s: No socinfo found!\n", __func__); |
| 657 | return 0; |
| 658 | } |
| 659 | if (socinfo->v1.format < 7) { |
| 660 | pr_err("%s: pmic_die_revision not available!\n", __func__); |
| 661 | return 0; |
| 662 | } |
| 663 | |
| 664 | return snprintf(buf, PAGE_SIZE, "%u\n", |
| 665 | socinfo_get_pmic_die_revision()); |
| 666 | } |
| 667 | |
Abhimanyu Kapur | 440cdde | 2012-12-04 00:05:40 -0800 | [diff] [blame] | 668 | static ssize_t |
| 669 | msm_get_vendor(struct device *dev, |
| 670 | struct device_attribute *attr, |
| 671 | char *buf) |
| 672 | { |
| 673 | return snprintf(buf, PAGE_SIZE, "Qualcomm\n"); |
| 674 | } |
| 675 | |
| 676 | static ssize_t |
| 677 | msm_get_raw_id(struct device *dev, |
| 678 | struct device_attribute *attr, |
| 679 | char *buf) |
| 680 | { |
| 681 | return snprintf(buf, PAGE_SIZE, "%u\n", |
| 682 | socinfo_get_raw_id()); |
| 683 | } |
| 684 | |
| 685 | static ssize_t |
| 686 | msm_get_raw_version(struct device *dev, |
| 687 | struct device_attribute *attr, |
| 688 | char *buf) |
| 689 | { |
| 690 | return snprintf(buf, PAGE_SIZE, "%u\n", |
| 691 | socinfo_get_raw_version()); |
| 692 | } |
| 693 | |
| 694 | static ssize_t |
| 695 | msm_get_build_id(struct device *dev, |
| 696 | struct device_attribute *attr, |
| 697 | char *buf) |
| 698 | { |
| 699 | return snprintf(buf, PAGE_SIZE, "%-.32s\n", |
| 700 | socinfo_get_build_id()); |
| 701 | } |
| 702 | |
| 703 | static ssize_t |
| 704 | msm_get_hw_platform(struct device *dev, |
| 705 | struct device_attribute *attr, |
| 706 | char *buf) |
| 707 | { |
| 708 | uint32_t hw_type; |
| 709 | hw_type = socinfo_get_platform_type(); |
| 710 | |
| 711 | return snprintf(buf, PAGE_SIZE, "%-.32s\n", |
| 712 | hw_platform[hw_type]); |
| 713 | } |
| 714 | |
| 715 | static ssize_t |
| 716 | msm_get_platform_version(struct device *dev, |
| 717 | struct device_attribute *attr, |
| 718 | char *buf) |
| 719 | { |
| 720 | return snprintf(buf, PAGE_SIZE, "%u\n", |
| 721 | socinfo_get_platform_version()); |
| 722 | } |
| 723 | |
| 724 | static ssize_t |
| 725 | msm_get_accessory_chip(struct device *dev, |
| 726 | struct device_attribute *attr, |
| 727 | char *buf) |
| 728 | { |
| 729 | return snprintf(buf, PAGE_SIZE, "%u\n", |
| 730 | socinfo_get_accessory_chip()); |
| 731 | } |
| 732 | |
| 733 | static ssize_t |
| 734 | msm_get_platform_subtype(struct device *dev, |
| 735 | struct device_attribute *attr, |
| 736 | char *buf) |
| 737 | { |
| 738 | uint32_t hw_subtype; |
| 739 | hw_subtype = socinfo_get_platform_subtype(); |
| 740 | return snprintf(buf, PAGE_SIZE, "%-.32s\n", |
| 741 | hw_platform_subtype[hw_subtype]); |
| 742 | } |
| 743 | |
| 744 | static ssize_t |
| 745 | msm_get_pmic_model(struct device *dev, |
| 746 | struct device_attribute *attr, |
| 747 | char *buf) |
| 748 | { |
| 749 | return snprintf(buf, PAGE_SIZE, "%u\n", |
| 750 | socinfo_get_pmic_model()); |
| 751 | } |
| 752 | |
| 753 | static ssize_t |
| 754 | msm_get_pmic_die_revision(struct device *dev, |
| 755 | struct device_attribute *attr, |
| 756 | char *buf) |
| 757 | { |
| 758 | return snprintf(buf, PAGE_SIZE, "%u\n", |
| 759 | socinfo_get_pmic_die_revision()); |
| 760 | } |
| 761 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 762 | static struct sysdev_attribute socinfo_v1_files[] = { |
| 763 | _SYSDEV_ATTR(id, 0444, socinfo_show_id, NULL), |
| 764 | _SYSDEV_ATTR(version, 0444, socinfo_show_version, NULL), |
| 765 | _SYSDEV_ATTR(build_id, 0444, socinfo_show_build_id, NULL), |
| 766 | }; |
| 767 | |
| 768 | static struct sysdev_attribute socinfo_v2_files[] = { |
| 769 | _SYSDEV_ATTR(raw_id, 0444, socinfo_show_raw_id, NULL), |
| 770 | _SYSDEV_ATTR(raw_version, 0444, socinfo_show_raw_version, NULL), |
| 771 | }; |
| 772 | |
| 773 | static struct sysdev_attribute socinfo_v3_files[] = { |
| 774 | _SYSDEV_ATTR(hw_platform, 0444, socinfo_show_platform_type, NULL), |
| 775 | }; |
| 776 | |
| 777 | static struct sysdev_attribute socinfo_v4_files[] = { |
| 778 | _SYSDEV_ATTR(platform_version, 0444, |
| 779 | socinfo_show_platform_version, NULL), |
| 780 | }; |
| 781 | |
| 782 | static struct sysdev_attribute socinfo_v5_files[] = { |
| 783 | _SYSDEV_ATTR(accessory_chip, 0444, |
| 784 | socinfo_show_accessory_chip, NULL), |
| 785 | }; |
| 786 | |
| 787 | static struct sysdev_attribute socinfo_v6_files[] = { |
| 788 | _SYSDEV_ATTR(platform_subtype, 0444, |
| 789 | socinfo_show_platform_subtype, NULL), |
| 790 | }; |
| 791 | |
Jin Hong | 9b556c3 | 2012-08-13 23:06:26 -0700 | [diff] [blame] | 792 | static struct sysdev_attribute socinfo_v7_files[] = { |
| 793 | _SYSDEV_ATTR(pmic_model, 0444, |
| 794 | socinfo_show_pmic_model, NULL), |
| 795 | _SYSDEV_ATTR(pmic_die_revision, 0444, |
| 796 | socinfo_show_pmic_die_revision, NULL), |
| 797 | }; |
| 798 | |
Abhimanyu Kapur | 440cdde | 2012-12-04 00:05:40 -0800 | [diff] [blame] | 799 | static struct device_attribute msm_soc_attr_raw_version = |
| 800 | __ATTR(raw_version, S_IRUGO, msm_get_raw_version, NULL); |
| 801 | |
| 802 | static struct device_attribute msm_soc_attr_raw_id = |
| 803 | __ATTR(raw_id, S_IRUGO, msm_get_raw_id, NULL); |
| 804 | |
| 805 | static struct device_attribute msm_soc_attr_vendor = |
| 806 | __ATTR(vendor, S_IRUGO, msm_get_vendor, NULL); |
| 807 | |
| 808 | static struct device_attribute msm_soc_attr_build_id = |
| 809 | __ATTR(build_id, S_IRUGO, msm_get_build_id, NULL); |
| 810 | |
| 811 | static struct device_attribute msm_soc_attr_hw_platform = |
| 812 | __ATTR(hw_platform, S_IRUGO, msm_get_hw_platform, NULL); |
| 813 | |
| 814 | |
| 815 | static struct device_attribute msm_soc_attr_platform_version = |
| 816 | __ATTR(platform_version, S_IRUGO, |
| 817 | msm_get_platform_version, NULL); |
| 818 | |
| 819 | static struct device_attribute msm_soc_attr_accessory_chip = |
| 820 | __ATTR(accessory_chip, S_IRUGO, |
| 821 | msm_get_accessory_chip, NULL); |
| 822 | |
| 823 | static struct device_attribute msm_soc_attr_platform_subtype = |
| 824 | __ATTR(platform_subtype, S_IRUGO, |
| 825 | msm_get_platform_subtype, NULL); |
| 826 | |
| 827 | static struct device_attribute msm_soc_attr_pmic_model = |
| 828 | __ATTR(pmic_model, S_IRUGO, |
| 829 | msm_get_pmic_model, NULL); |
| 830 | |
| 831 | static struct device_attribute msm_soc_attr_pmic_die_revision = |
| 832 | __ATTR(pmic_die_revision, S_IRUGO, |
| 833 | msm_get_pmic_die_revision, NULL); |
| 834 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 835 | static struct sysdev_class soc_sysdev_class = { |
| 836 | .name = "soc", |
| 837 | }; |
| 838 | |
| 839 | static struct sys_device soc_sys_device = { |
| 840 | .id = 0, |
| 841 | .cls = &soc_sysdev_class, |
| 842 | }; |
| 843 | |
| 844 | static int __init socinfo_create_files(struct sys_device *dev, |
| 845 | struct sysdev_attribute files[], |
| 846 | int size) |
| 847 | { |
| 848 | int i; |
| 849 | for (i = 0; i < size; i++) { |
| 850 | int err = sysdev_create_file(dev, &files[i]); |
| 851 | if (err) { |
| 852 | pr_err("%s: sysdev_create_file(%s)=%d\n", |
| 853 | __func__, files[i].attr.name, err); |
| 854 | return err; |
| 855 | } |
| 856 | } |
| 857 | return 0; |
| 858 | } |
| 859 | |
Stephen Boyd | 69a22e4 | 2012-02-22 09:16:07 -0800 | [diff] [blame] | 860 | static void * __init setup_dummy_socinfo(void) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 861 | { |
Stepan Moskovchenko | 070a05d | 2013-04-02 18:07:17 -0700 | [diff] [blame] | 862 | if (early_machine_is_mpq8092()) { |
Ravi Kumar V | 754282d | 2012-08-31 22:32:20 +0530 | [diff] [blame] | 863 | dummy_socinfo.id = 146; |
| 864 | strlcpy(dummy_socinfo.build_id, "mpq8092 - ", |
| 865 | sizeof(dummy_socinfo.build_id)); |
Stepan Moskovchenko | e90cd65 | 2013-04-18 12:54:47 -0700 | [diff] [blame] | 866 | } else if (early_machine_is_apq8084()) { |
Stepan Moskovchenko | f07190a | 2013-01-24 15:48:49 -0800 | [diff] [blame] | 867 | dummy_socinfo.id = 178; |
Stepan Moskovchenko | e90cd65 | 2013-04-18 12:54:47 -0700 | [diff] [blame] | 868 | strlcpy(dummy_socinfo.build_id, "apq8084 - ", |
Stepan Moskovchenko | f07190a | 2013-01-24 15:48:49 -0800 | [diff] [blame] | 869 | sizeof(dummy_socinfo.build_id)); |
Abhimanyu Kapur | 37bea77 | 2013-04-11 18:19:38 -0700 | [diff] [blame] | 870 | } else if (early_machine_is_msmkrypton()) { |
| 871 | dummy_socinfo.id = 187; |
| 872 | strlcpy(dummy_socinfo.build_id, "msmkrypton - ", |
| 873 | sizeof(dummy_socinfo.build_id)); |
Ravi Kumar V | 754282d | 2012-08-31 22:32:20 +0530 | [diff] [blame] | 874 | } |
Sathish Ambley | 3e265ce | 2012-03-08 16:44:04 -0800 | [diff] [blame] | 875 | strlcat(dummy_socinfo.build_id, "Dummy socinfo", |
| 876 | sizeof(dummy_socinfo.build_id)); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 877 | return (void *) &dummy_socinfo; |
| 878 | } |
| 879 | |
Abhimanyu Kapur | 440cdde | 2012-12-04 00:05:40 -0800 | [diff] [blame] | 880 | static void __init populate_soc_sysfs_files(struct device *msm_soc_device) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 881 | { |
Abhimanyu Kapur | 440cdde | 2012-12-04 00:05:40 -0800 | [diff] [blame] | 882 | uint32_t legacy_format = socinfo_get_format(); |
Jin Hong | 9b556c3 | 2012-08-13 23:06:26 -0700 | [diff] [blame] | 883 | |
Abhimanyu Kapur | 440cdde | 2012-12-04 00:05:40 -0800 | [diff] [blame] | 884 | device_create_file(msm_soc_device, &msm_soc_attr_vendor); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 885 | |
Abhimanyu Kapur | 440cdde | 2012-12-04 00:05:40 -0800 | [diff] [blame] | 886 | switch (legacy_format) { |
Abhimanyu Kapur | 781c03d | 2013-02-21 16:20:23 -0800 | [diff] [blame] | 887 | case 8: |
Abhimanyu Kapur | 440cdde | 2012-12-04 00:05:40 -0800 | [diff] [blame] | 888 | case 7: |
| 889 | device_create_file(msm_soc_device, |
| 890 | &msm_soc_attr_pmic_model); |
| 891 | device_create_file(msm_soc_device, |
| 892 | &msm_soc_attr_pmic_die_revision); |
| 893 | case 6: |
| 894 | device_create_file(msm_soc_device, |
| 895 | &msm_soc_attr_platform_subtype); |
| 896 | case 5: |
| 897 | device_create_file(msm_soc_device, |
| 898 | &msm_soc_attr_accessory_chip); |
| 899 | case 4: |
| 900 | device_create_file(msm_soc_device, |
| 901 | &msm_soc_attr_platform_version); |
| 902 | case 3: |
| 903 | device_create_file(msm_soc_device, |
| 904 | &msm_soc_attr_hw_platform); |
| 905 | case 2: |
| 906 | device_create_file(msm_soc_device, |
| 907 | &msm_soc_attr_raw_id); |
| 908 | device_create_file(msm_soc_device, |
| 909 | &msm_soc_attr_raw_version); |
| 910 | case 1: |
| 911 | device_create_file(msm_soc_device, |
| 912 | &msm_soc_attr_build_id); |
| 913 | break; |
| 914 | default: |
| 915 | pr_err("%s:Unknown socinfo format:%u\n", __func__, |
| 916 | legacy_format); |
| 917 | break; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 918 | } |
| 919 | |
Abhimanyu Kapur | 440cdde | 2012-12-04 00:05:40 -0800 | [diff] [blame] | 920 | return; |
| 921 | } |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 922 | |
Abhimanyu Kapur | 440cdde | 2012-12-04 00:05:40 -0800 | [diff] [blame] | 923 | static void __init soc_info_populate(struct soc_device_attribute *soc_dev_attr) |
| 924 | { |
| 925 | uint32_t soc_version = socinfo_get_version(); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 926 | |
Abhimanyu Kapur | 440cdde | 2012-12-04 00:05:40 -0800 | [diff] [blame] | 927 | soc_dev_attr->soc_id = kasprintf(GFP_KERNEL, "%d", socinfo_get_id()); |
| 928 | soc_dev_attr->machine = "Snapdragon"; |
| 929 | soc_dev_attr->revision = kasprintf(GFP_KERNEL, "%u.%u", |
| 930 | SOCINFO_VERSION_MAJOR(soc_version), |
| 931 | SOCINFO_VERSION_MINOR(soc_version)); |
| 932 | return; |
| 933 | |
| 934 | } |
| 935 | |
Abhimanyu Kapur | 91a0a50 | 2013-01-11 19:24:59 -0800 | [diff] [blame] | 936 | static int __init socinfo_init_sysdev(void) |
| 937 | { |
| 938 | int err; |
| 939 | struct device *msm_soc_device; |
| 940 | struct soc_device *soc_dev; |
| 941 | struct soc_device_attribute *soc_dev_attr; |
| 942 | |
| 943 | if (!socinfo) { |
| 944 | pr_err("%s: No socinfo found!\n", __func__); |
| 945 | return -ENODEV; |
| 946 | } |
| 947 | |
| 948 | soc_dev_attr = kzalloc(sizeof(*soc_dev_attr), GFP_KERNEL); |
| 949 | if (!soc_dev_attr) { |
| 950 | pr_err("%s: Soc Device alloc failed!\n", __func__); |
| 951 | return -ENOMEM; |
| 952 | } |
| 953 | |
| 954 | soc_info_populate(soc_dev_attr); |
| 955 | soc_dev = soc_device_register(soc_dev_attr); |
| 956 | if (IS_ERR_OR_NULL(soc_dev)) { |
| 957 | kfree(soc_dev_attr); |
| 958 | pr_err("%s: Soc device register failed\n", __func__); |
| 959 | return -EIO; |
| 960 | } |
| 961 | |
| 962 | msm_soc_device = soc_device_to_device(soc_dev); |
| 963 | populate_soc_sysfs_files(msm_soc_device); |
| 964 | err = sysdev_class_register(&soc_sysdev_class); |
| 965 | if (err) { |
| 966 | pr_err("%s: sysdev_class_register fail (%d)\n", |
| 967 | __func__, err); |
| 968 | return err; |
| 969 | } |
| 970 | err = sysdev_register(&soc_sys_device); |
| 971 | if (err) { |
| 972 | pr_err("%s: sysdev_register fail (%d)\n", |
| 973 | __func__, err); |
| 974 | return err; |
| 975 | } |
| 976 | socinfo_create_files(&soc_sys_device, socinfo_v1_files, |
| 977 | ARRAY_SIZE(socinfo_v1_files)); |
| 978 | if (socinfo->v1.format < 2) |
| 979 | return err; |
| 980 | socinfo_create_files(&soc_sys_device, socinfo_v2_files, |
| 981 | ARRAY_SIZE(socinfo_v2_files)); |
| 982 | |
| 983 | if (socinfo->v1.format < 3) |
| 984 | return err; |
| 985 | |
| 986 | socinfo_create_files(&soc_sys_device, socinfo_v3_files, |
| 987 | ARRAY_SIZE(socinfo_v3_files)); |
| 988 | |
| 989 | if (socinfo->v1.format < 4) |
| 990 | return err; |
| 991 | |
| 992 | socinfo_create_files(&soc_sys_device, socinfo_v4_files, |
| 993 | ARRAY_SIZE(socinfo_v4_files)); |
| 994 | |
| 995 | if (socinfo->v1.format < 5) |
| 996 | return err; |
| 997 | |
| 998 | socinfo_create_files(&soc_sys_device, socinfo_v5_files, |
| 999 | ARRAY_SIZE(socinfo_v5_files)); |
| 1000 | |
| 1001 | if (socinfo->v1.format < 6) |
| 1002 | return err; |
| 1003 | |
| 1004 | socinfo_create_files(&soc_sys_device, socinfo_v6_files, |
| 1005 | ARRAY_SIZE(socinfo_v6_files)); |
| 1006 | |
| 1007 | if (socinfo->v1.format < 7) |
| 1008 | return err; |
| 1009 | |
| 1010 | socinfo_create_files(&soc_sys_device, socinfo_v7_files, |
| 1011 | ARRAY_SIZE(socinfo_v7_files)); |
| 1012 | |
| 1013 | return 0; |
| 1014 | } |
| 1015 | |
| 1016 | arch_initcall(socinfo_init_sysdev); |
| 1017 | |
Abhimanyu Kapur | 440cdde | 2012-12-04 00:05:40 -0800 | [diff] [blame] | 1018 | static void socinfo_print(void) |
| 1019 | { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1020 | switch (socinfo->v1.format) { |
| 1021 | case 1: |
| 1022 | pr_info("%s: v%u, id=%u, ver=%u.%u\n", |
| 1023 | __func__, socinfo->v1.format, socinfo->v1.id, |
| 1024 | SOCINFO_VERSION_MAJOR(socinfo->v1.version), |
| 1025 | SOCINFO_VERSION_MINOR(socinfo->v1.version)); |
| 1026 | break; |
| 1027 | case 2: |
| 1028 | pr_info("%s: v%u, id=%u, ver=%u.%u, " |
| 1029 | "raw_id=%u, raw_ver=%u\n", |
| 1030 | __func__, socinfo->v1.format, socinfo->v1.id, |
| 1031 | SOCINFO_VERSION_MAJOR(socinfo->v1.version), |
| 1032 | SOCINFO_VERSION_MINOR(socinfo->v1.version), |
| 1033 | socinfo->v2.raw_id, socinfo->v2.raw_version); |
| 1034 | break; |
| 1035 | case 3: |
| 1036 | pr_info("%s: v%u, id=%u, ver=%u.%u, " |
| 1037 | "raw_id=%u, raw_ver=%u, hw_plat=%u\n", |
| 1038 | __func__, socinfo->v1.format, socinfo->v1.id, |
| 1039 | SOCINFO_VERSION_MAJOR(socinfo->v1.version), |
| 1040 | SOCINFO_VERSION_MINOR(socinfo->v1.version), |
| 1041 | socinfo->v2.raw_id, socinfo->v2.raw_version, |
| 1042 | socinfo->v3.hw_platform); |
| 1043 | break; |
| 1044 | case 4: |
| 1045 | pr_info("%s: v%u, id=%u, ver=%u.%u, " |
| 1046 | "raw_id=%u, raw_ver=%u, hw_plat=%u, hw_plat_ver=%u\n", |
| 1047 | __func__, socinfo->v1.format, socinfo->v1.id, |
| 1048 | SOCINFO_VERSION_MAJOR(socinfo->v1.version), |
| 1049 | SOCINFO_VERSION_MINOR(socinfo->v1.version), |
| 1050 | socinfo->v2.raw_id, socinfo->v2.raw_version, |
| 1051 | socinfo->v3.hw_platform, socinfo->v4.platform_version); |
| 1052 | break; |
| 1053 | case 5: |
| 1054 | pr_info("%s: v%u, id=%u, ver=%u.%u, " |
| 1055 | "raw_id=%u, raw_ver=%u, hw_plat=%u, hw_plat_ver=%u\n" |
| 1056 | " accessory_chip=%u\n", __func__, socinfo->v1.format, |
| 1057 | socinfo->v1.id, |
| 1058 | SOCINFO_VERSION_MAJOR(socinfo->v1.version), |
| 1059 | SOCINFO_VERSION_MINOR(socinfo->v1.version), |
| 1060 | socinfo->v2.raw_id, socinfo->v2.raw_version, |
| 1061 | socinfo->v3.hw_platform, socinfo->v4.platform_version, |
| 1062 | socinfo->v5.accessory_chip); |
| 1063 | break; |
| 1064 | case 6: |
| 1065 | pr_info("%s: v%u, id=%u, ver=%u.%u, " |
| 1066 | "raw_id=%u, raw_ver=%u, hw_plat=%u, hw_plat_ver=%u\n" |
| 1067 | " accessory_chip=%u hw_plat_subtype=%u\n", __func__, |
| 1068 | socinfo->v1.format, |
| 1069 | socinfo->v1.id, |
| 1070 | SOCINFO_VERSION_MAJOR(socinfo->v1.version), |
| 1071 | SOCINFO_VERSION_MINOR(socinfo->v1.version), |
| 1072 | socinfo->v2.raw_id, socinfo->v2.raw_version, |
| 1073 | socinfo->v3.hw_platform, socinfo->v4.platform_version, |
| 1074 | socinfo->v5.accessory_chip, |
| 1075 | socinfo->v6.hw_platform_subtype); |
| 1076 | break; |
Abhimanyu Kapur | 781c03d | 2013-02-21 16:20:23 -0800 | [diff] [blame] | 1077 | case 8: |
Jin Hong | 9b556c3 | 2012-08-13 23:06:26 -0700 | [diff] [blame] | 1078 | case 7: |
| 1079 | pr_info("%s: v%u, id=%u, ver=%u.%u, raw_id=%u, raw_ver=%u, hw_plat=%u, hw_plat_ver=%u\n accessory_chip=%u, hw_plat_subtype=%u, pmic_model=%u, pmic_die_revision=%u\n", |
| 1080 | __func__, |
| 1081 | socinfo->v1.format, |
| 1082 | socinfo->v1.id, |
| 1083 | SOCINFO_VERSION_MAJOR(socinfo->v1.version), |
| 1084 | SOCINFO_VERSION_MINOR(socinfo->v1.version), |
| 1085 | socinfo->v2.raw_id, socinfo->v2.raw_version, |
| 1086 | socinfo->v3.hw_platform, socinfo->v4.platform_version, |
| 1087 | socinfo->v5.accessory_chip, |
| 1088 | socinfo->v6.hw_platform_subtype, |
| 1089 | socinfo->v7.pmic_model, |
| 1090 | socinfo->v7.pmic_die_revision); |
| 1091 | break; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1092 | default: |
| 1093 | pr_err("%s: Unknown format found\n", __func__); |
| 1094 | break; |
| 1095 | } |
Abhimanyu Kapur | 440cdde | 2012-12-04 00:05:40 -0800 | [diff] [blame] | 1096 | } |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1097 | |
Abhimanyu Kapur | 91a0a50 | 2013-01-11 19:24:59 -0800 | [diff] [blame] | 1098 | int __init socinfo_init(void) |
Abhimanyu Kapur | 440cdde | 2012-12-04 00:05:40 -0800 | [diff] [blame] | 1099 | { |
Abhimanyu Kapur | 781c03d | 2013-02-21 16:20:23 -0800 | [diff] [blame] | 1100 | socinfo = smem_alloc(SMEM_HW_SW_BUILD_ID, sizeof(struct socinfo_v8)); |
| 1101 | |
| 1102 | if (!socinfo) |
| 1103 | socinfo = smem_alloc(SMEM_HW_SW_BUILD_ID, |
| 1104 | sizeof(struct socinfo_v7)); |
Abhimanyu Kapur | 440cdde | 2012-12-04 00:05:40 -0800 | [diff] [blame] | 1105 | |
| 1106 | if (!socinfo) |
| 1107 | socinfo = smem_alloc(SMEM_HW_SW_BUILD_ID, |
| 1108 | sizeof(struct socinfo_v6)); |
| 1109 | |
| 1110 | if (!socinfo) |
| 1111 | socinfo = smem_alloc(SMEM_HW_SW_BUILD_ID, |
| 1112 | sizeof(struct socinfo_v5)); |
| 1113 | |
| 1114 | if (!socinfo) |
| 1115 | socinfo = smem_alloc(SMEM_HW_SW_BUILD_ID, |
| 1116 | sizeof(struct socinfo_v4)); |
| 1117 | |
| 1118 | if (!socinfo) |
| 1119 | socinfo = smem_alloc(SMEM_HW_SW_BUILD_ID, |
| 1120 | sizeof(struct socinfo_v3)); |
| 1121 | |
| 1122 | if (!socinfo) |
| 1123 | socinfo = smem_alloc(SMEM_HW_SW_BUILD_ID, |
| 1124 | sizeof(struct socinfo_v2)); |
| 1125 | |
| 1126 | if (!socinfo) |
| 1127 | socinfo = smem_alloc(SMEM_HW_SW_BUILD_ID, |
| 1128 | sizeof(struct socinfo_v1)); |
| 1129 | |
| 1130 | if (!socinfo) { |
| 1131 | pr_warn("%s: Can't find SMEM_HW_SW_BUILD_ID; falling back on dummy values.\n", |
| 1132 | __func__); |
| 1133 | socinfo = setup_dummy_socinfo(); |
| 1134 | } |
| 1135 | |
| 1136 | WARN(!socinfo_get_id(), "Unknown SOC ID!\n"); |
| 1137 | WARN(socinfo_get_id() >= ARRAY_SIZE(cpu_of_id), |
| 1138 | "New IDs added! ID => CPU mapping might need an update.\n"); |
| 1139 | |
| 1140 | if (socinfo->v1.id < ARRAY_SIZE(cpu_of_id)) |
| 1141 | cur_cpu = cpu_of_id[socinfo->v1.id]; |
| 1142 | |
Abhimanyu Kapur | cf3ed15 | 2013-03-01 19:32:19 -0800 | [diff] [blame] | 1143 | boot_stats_init(); |
Abhimanyu Kapur | 440cdde | 2012-12-04 00:05:40 -0800 | [diff] [blame] | 1144 | socinfo_print(); |
Abhimanyu Kapur | 440cdde | 2012-12-04 00:05:40 -0800 | [diff] [blame] | 1145 | |
Abhimanyu Kapur | 91a0a50 | 2013-01-11 19:24:59 -0800 | [diff] [blame] | 1146 | return 0; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1147 | } |
Stepan Moskovchenko | eff783a | 2011-08-22 19:01:58 -0700 | [diff] [blame] | 1148 | |
| 1149 | const int get_core_count(void) |
| 1150 | { |
| 1151 | if (!(read_cpuid_mpidr() & BIT(31))) |
| 1152 | return 1; |
| 1153 | |
Jin Hong | c5f5d54 | 2012-04-12 16:48:51 -0700 | [diff] [blame] | 1154 | if (read_cpuid_mpidr() & BIT(30)) |
Stepan Moskovchenko | eff783a | 2011-08-22 19:01:58 -0700 | [diff] [blame] | 1155 | return 1; |
| 1156 | |
| 1157 | /* 1 + the PART[1:0] field of MIDR */ |
| 1158 | return ((read_cpuid_id() >> 4) & 3) + 1; |
| 1159 | } |
| 1160 | |
| 1161 | const int read_msm_cpu_type(void) |
| 1162 | { |
Stepan Moskovchenko | a8f0a22 | 2011-10-24 18:53:17 -0700 | [diff] [blame] | 1163 | if (socinfo_get_msm_cpu() != MSM_CPU_UNKNOWN) |
| 1164 | return socinfo_get_msm_cpu(); |
| 1165 | |
Stepan Moskovchenko | eff783a | 2011-08-22 19:01:58 -0700 | [diff] [blame] | 1166 | switch (read_cpuid_id()) { |
| 1167 | case 0x510F02D0: |
| 1168 | case 0x510F02D2: |
| 1169 | case 0x510F02D4: |
| 1170 | return MSM_CPU_8X60; |
| 1171 | |
| 1172 | case 0x510F04D0: |
| 1173 | case 0x510F04D1: |
| 1174 | case 0x510F04D2: |
Stepan Moskovchenko | a8f0a22 | 2011-10-24 18:53:17 -0700 | [diff] [blame] | 1175 | case 0x511F04D0: |
| 1176 | case 0x512F04D0: |
Stepan Moskovchenko | eff783a | 2011-08-22 19:01:58 -0700 | [diff] [blame] | 1177 | return MSM_CPU_8960; |
| 1178 | |
Stepan Moskovchenko | a8f0a22 | 2011-10-24 18:53:17 -0700 | [diff] [blame] | 1179 | case 0x51404D11: /* We can't get here unless we are in bringup */ |
| 1180 | return MSM_CPU_8930; |
Stepan Moskovchenko | eff783a | 2011-08-22 19:01:58 -0700 | [diff] [blame] | 1181 | |
| 1182 | case 0x510F06F0: |
| 1183 | return MSM_CPU_8064; |
| 1184 | |
Stepan Moskovchenko | 02c4d0c | 2012-07-26 14:33:02 -0700 | [diff] [blame] | 1185 | case 0x511F06F1: |
Matt Wagantall | bdff7fe | 2013-01-08 13:36:40 -0800 | [diff] [blame] | 1186 | case 0x511F06F2: |
Stepan Moskovchenko | 02c4d0c | 2012-07-26 14:33:02 -0700 | [diff] [blame] | 1187 | case 0x512F06F0: |
| 1188 | return MSM_CPU_8974; |
| 1189 | |
Stepan Moskovchenko | eff783a | 2011-08-22 19:01:58 -0700 | [diff] [blame] | 1190 | default: |
| 1191 | return MSM_CPU_UNKNOWN; |
| 1192 | }; |
| 1193 | } |
Stepan Moskovchenko | 70dc7cf | 2011-08-22 19:08:42 -0700 | [diff] [blame] | 1194 | |
Jin Hong | 12b8b43 | 2012-07-18 10:00:31 -0700 | [diff] [blame] | 1195 | const int cpu_is_krait(void) |
| 1196 | { |
| 1197 | return ((read_cpuid_id() & 0xFF00FC00) == 0x51000400); |
| 1198 | } |
| 1199 | |
Stepan Moskovchenko | 70dc7cf | 2011-08-22 19:08:42 -0700 | [diff] [blame] | 1200 | const int cpu_is_krait_v1(void) |
| 1201 | { |
| 1202 | switch (read_cpuid_id()) { |
| 1203 | case 0x510F04D0: |
| 1204 | case 0x510F04D1: |
| 1205 | case 0x510F04D2: |
| 1206 | return 1; |
| 1207 | |
| 1208 | default: |
| 1209 | return 0; |
| 1210 | }; |
| 1211 | } |
Jin Hong | 12b8b43 | 2012-07-18 10:00:31 -0700 | [diff] [blame] | 1212 | |
| 1213 | const int cpu_is_krait_v2(void) |
| 1214 | { |
| 1215 | switch (read_cpuid_id()) { |
| 1216 | case 0x511F04D0: |
| 1217 | case 0x511F04D1: |
| 1218 | case 0x511F04D2: |
| 1219 | case 0x511F04D3: |
| 1220 | case 0x511F04D4: |
| 1221 | |
| 1222 | case 0x510F06F0: |
| 1223 | case 0x510F06F1: |
| 1224 | case 0x510F06F2: |
| 1225 | return 1; |
| 1226 | |
| 1227 | default: |
| 1228 | return 0; |
| 1229 | }; |
| 1230 | } |
Joel King | 824bd1f | 2012-08-19 12:55:49 -0700 | [diff] [blame] | 1231 | |
| 1232 | const int cpu_is_krait_v3(void) |
| 1233 | { |
| 1234 | switch (read_cpuid_id()) { |
| 1235 | case 0x512F04D0: |
| 1236 | case 0x511F06F0: |
| 1237 | case 0x511F06F1: |
Matt Wagantall | bdff7fe | 2013-01-08 13:36:40 -0800 | [diff] [blame] | 1238 | case 0x511F06F2: |
Joel King | 824bd1f | 2012-08-19 12:55:49 -0700 | [diff] [blame] | 1239 | case 0x510F05D0: |
| 1240 | return 1; |
| 1241 | |
| 1242 | default: |
| 1243 | return 0; |
| 1244 | }; |
| 1245 | } |