aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/platform/intel-mid/intel-mid.c
diff options
context:
space:
mode:
authorKuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>2013-10-17 18:35:29 -0400
committerH. Peter Anvin <hpa@linux.intel.com>2013-10-17 19:40:47 -0400
commit712b6aa8731a7e148298c58cea66a5209c659e3c (patch)
tree0949764eead1f8cef611277141c5684c55cfa957 /arch/x86/platform/intel-mid/intel-mid.c
parent6c21b176a93ffaa8023555107167379ccdc6b71f (diff)
intel_mid: Renamed *mrst* to *intel_mid*
mrst is used as common name to represent all intel_mid type soc's. But moorsetwon is just one of the intel_mid soc. So renamed them to use intel_mid. This patch mainly renames the variables and related functions that uses *mrst* prefix with *intel_mid*. To ensure that there are no functional changes, I have compared the objdump of related files before and after rename and found the only difference is symbol and name changes. Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com> Link: http://lkml.kernel.org/r/1382049336-21316-6-git-send-email-david.a.cohen@linux.intel.com Signed-off-by: David Cohen <david.a.cohen@linux.intel.com> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'arch/x86/platform/intel-mid/intel-mid.c')
-rw-r--r--arch/x86/platform/intel-mid/intel-mid.c109
1 files changed, 54 insertions, 55 deletions
diff --git a/arch/x86/platform/intel-mid/intel-mid.c b/arch/x86/platform/intel-mid/intel-mid.c
index 7e6d7b204a05..94689ac55374 100644
--- a/arch/x86/platform/intel-mid/intel-mid.c
+++ b/arch/x86/platform/intel-mid/intel-mid.c
@@ -11,7 +11,7 @@
11 * of the License. 11 * of the License.
12 */ 12 */
13 13
14#define pr_fmt(fmt) "mrst: " fmt 14#define pr_fmt(fmt) "intel_mid: " fmt
15 15
16#include <linux/init.h> 16#include <linux/init.h>
17#include <linux/kernel.h> 17#include <linux/kernel.h>
@@ -47,7 +47,7 @@
47 47
48/* 48/*
49 * the clockevent devices on Moorestown/Medfield can be APBT or LAPIC clock, 49 * the clockevent devices on Moorestown/Medfield can be APBT or LAPIC clock,
50 * cmdline option x86_mrst_timer can be used to override the configuration 50 * cmdline option x86_intel_mid_timer can be used to override the configuration
51 * to prefer one or the other. 51 * to prefer one or the other.
52 * at runtime, there are basically three timer configurations: 52 * at runtime, there are basically three timer configurations:
53 * 1. per cpu apbt clock only 53 * 1. per cpu apbt clock only
@@ -66,12 +66,12 @@
66 * lapic (always-on,ARAT) ------ 150 66 * lapic (always-on,ARAT) ------ 150
67 */ 67 */
68 68
69enum mrst_timer_options mrst_timer_options; 69enum intel_mid_timer_options intel_mid_timer_options;
70 70
71static u32 sfi_mtimer_usage[SFI_MTMR_MAX_NUM]; 71static u32 sfi_mtimer_usage[SFI_MTMR_MAX_NUM];
72static struct sfi_timer_table_entry sfi_mtimer_array[SFI_MTMR_MAX_NUM]; 72static struct sfi_timer_table_entry sfi_mtimer_array[SFI_MTMR_MAX_NUM];
73enum mrst_cpu_type __mrst_cpu_chip; 73enum intel_mid_cpu_type __intel_mid_cpu_chip;
74EXPORT_SYMBOL_GPL(__mrst_cpu_chip); 74EXPORT_SYMBOL_GPL(__intel_mid_cpu_chip);
75 75
76int sfi_mtimer_num; 76int sfi_mtimer_num;
77 77
@@ -79,11 +79,11 @@ struct sfi_rtc_table_entry sfi_mrtc_array[SFI_MRTC_MAX];
79EXPORT_SYMBOL_GPL(sfi_mrtc_array); 79EXPORT_SYMBOL_GPL(sfi_mrtc_array);
80int sfi_mrtc_num; 80int sfi_mrtc_num;
81 81
82static void mrst_power_off(void) 82static void intel_mid_power_off(void)
83{ 83{
84} 84}
85 85
86static void mrst_reboot(void) 86static void intel_mid_reboot(void)
87{ 87{
88 intel_scu_ipc_simple_command(IPCMSG_COLD_BOOT, 0); 88 intel_scu_ipc_simple_command(IPCMSG_COLD_BOOT, 0);
89} 89}
@@ -196,7 +196,7 @@ int __init sfi_parse_mrtc(struct sfi_table_header *table)
196 return 0; 196 return 0;
197} 197}
198 198
199static unsigned long __init mrst_calibrate_tsc(void) 199static unsigned long __init intel_mid_calibrate_tsc(void)
200{ 200{
201 unsigned long fast_calibrate; 201 unsigned long fast_calibrate;
202 u32 lo, hi, ratio, fsb; 202 u32 lo, hi, ratio, fsb;
@@ -227,13 +227,13 @@ static unsigned long __init mrst_calibrate_tsc(void)
227 return 0; 227 return 0;
228} 228}
229 229
230static void __init mrst_time_init(void) 230static void __init intel_mid_time_init(void)
231{ 231{
232 sfi_table_parse(SFI_SIG_MTMR, NULL, NULL, sfi_parse_mtmr); 232 sfi_table_parse(SFI_SIG_MTMR, NULL, NULL, sfi_parse_mtmr);
233 switch (mrst_timer_options) { 233 switch (intel_mid_timer_options) {
234 case MRST_TIMER_APBT_ONLY: 234 case INTEL_MID_TIMER_APBT_ONLY:
235 break; 235 break;
236 case MRST_TIMER_LAPIC_APBT: 236 case INTEL_MID_TIMER_LAPIC_APBT:
237 x86_init.timers.setup_percpu_clockev = setup_boot_APIC_clock; 237 x86_init.timers.setup_percpu_clockev = setup_boot_APIC_clock;
238 x86_cpuinit.setup_percpu_clockev = setup_secondary_APIC_clock; 238 x86_cpuinit.setup_percpu_clockev = setup_secondary_APIC_clock;
239 break; 239 break;
@@ -249,19 +249,19 @@ static void __init mrst_time_init(void)
249 apbt_time_init(); 249 apbt_time_init();
250} 250}
251 251
252static void mrst_arch_setup(void) 252static void __cpuinit intel_mid_arch_setup(void)
253{ 253{
254 if (boot_cpu_data.x86 == 6 && boot_cpu_data.x86_model == 0x27) 254 if (boot_cpu_data.x86 == 6 && boot_cpu_data.x86_model == 0x27)
255 __mrst_cpu_chip = MRST_CPU_CHIP_PENWELL; 255 __intel_mid_cpu_chip = INTEL_MID_CPU_CHIP_PENWELL;
256 else { 256 else {
257 pr_err("Unknown Intel MID CPU (%d:%d), default to Penwell\n", 257 pr_err("Unknown Intel MID CPU (%d:%d), default to Penwell\n",
258 boot_cpu_data.x86, boot_cpu_data.x86_model); 258 boot_cpu_data.x86, boot_cpu_data.x86_model);
259 __mrst_cpu_chip = MRST_CPU_CHIP_PENWELL; 259 __intel_mid_cpu_chip = INTEL_MID_CPU_CHIP_PENWELL;
260 } 260 }
261} 261}
262 262
263/* MID systems don't have i8042 controller */ 263/* MID systems don't have i8042 controller */
264static int mrst_i8042_detect(void) 264static int intel_mid_i8042_detect(void)
265{ 265{
266 return 0; 266 return 0;
267} 267}
@@ -272,7 +272,7 @@ static int mrst_i8042_detect(void)
272 * watchdog or lock debug. Reading io port 0x61 results in 0xff which 272 * watchdog or lock debug. Reading io port 0x61 results in 0xff which
273 * misled NMI handler. 273 * misled NMI handler.
274 */ 274 */
275static unsigned char mrst_get_nmi_reason(void) 275static unsigned char intel_mid_get_nmi_reason(void)
276{ 276{
277 return 0; 277 return 0;
278} 278}
@@ -281,33 +281,32 @@ static unsigned char mrst_get_nmi_reason(void)
281 * Moorestown specific x86_init function overrides and early setup 281 * Moorestown specific x86_init function overrides and early setup
282 * calls. 282 * calls.
283 */ 283 */
284void __init x86_mrst_early_setup(void) 284void __init x86_intel_mid_early_setup(void)
285{ 285{
286 x86_init.resources.probe_roms = x86_init_noop; 286 x86_init.resources.probe_roms = x86_init_noop;
287 x86_init.resources.reserve_resources = x86_init_noop; 287 x86_init.resources.reserve_resources = x86_init_noop;
288 288
289 x86_init.timers.timer_init = mrst_time_init; 289 x86_init.timers.timer_init = intel_mid_time_init;
290 x86_init.timers.setup_percpu_clockev = x86_init_noop; 290 x86_init.timers.setup_percpu_clockev = x86_init_noop;
291 291
292 x86_init.irqs.pre_vector_init = x86_init_noop; 292 x86_init.irqs.pre_vector_init = x86_init_noop;
293 293
294 x86_init.oem.arch_setup = mrst_arch_setup; 294 x86_init.oem.arch_setup = intel_mid_arch_setup;
295 295
296 x86_cpuinit.setup_percpu_clockev = apbt_setup_secondary_clock; 296 x86_cpuinit.setup_percpu_clockev = apbt_setup_secondary_clock;
297 297
298 x86_platform.calibrate_tsc = mrst_calibrate_tsc; 298 x86_platform.calibrate_tsc = intel_mid_calibrate_tsc;
299 x86_platform.i8042_detect = mrst_i8042_detect; 299 x86_platform.i8042_detect = intel_mid_i8042_detect;
300 x86_init.timers.wallclock_init = mrst_rtc_init; 300 x86_init.timers.wallclock_init = intel_mid_rtc_init;
301 x86_platform.get_nmi_reason = mrst_get_nmi_reason; 301 x86_platform.get_nmi_reason = intel_mid_get_nmi_reason;
302 302
303 x86_init.pci.init = pci_mrst_init; 303 x86_init.pci.init = intel_mid_pci_init;
304 x86_init.pci.fixup_irqs = x86_init_noop; 304 x86_init.pci.fixup_irqs = x86_init_noop;
305 305
306 legacy_pic = &null_legacy_pic; 306 legacy_pic = &null_legacy_pic;
307 307
308 /* Moorestown specific power_off/restart method */ 308 pm_power_off = intel_mid_power_off;
309 pm_power_off = mrst_power_off; 309 machine_ops.emergency_restart = intel_mid_reboot;
310 machine_ops.emergency_restart = mrst_reboot;
311 310
312 /* Avoid searching for BIOS MP tables */ 311 /* Avoid searching for BIOS MP tables */
313 x86_init.mpparse.find_smp_config = x86_init_noop; 312 x86_init.mpparse.find_smp_config = x86_init_noop;
@@ -319,24 +318,24 @@ void __init x86_mrst_early_setup(void)
319 * if user does not want to use per CPU apb timer, just give it a lower rating 318 * if user does not want to use per CPU apb timer, just give it a lower rating
320 * than local apic timer and skip the late per cpu timer init. 319 * than local apic timer and skip the late per cpu timer init.
321 */ 320 */
322static inline int __init setup_x86_mrst_timer(char *arg) 321static inline int __init setup_x86_intel_mid_timer(char *arg)
323{ 322{
324 if (!arg) 323 if (!arg)
325 return -EINVAL; 324 return -EINVAL;
326 325
327 if (strcmp("apbt_only", arg) == 0) 326 if (strcmp("apbt_only", arg) == 0)
328 mrst_timer_options = MRST_TIMER_APBT_ONLY; 327 intel_mid_timer_options = INTEL_MID_TIMER_APBT_ONLY;
329 else if (strcmp("lapic_and_apbt", arg) == 0) 328 else if (strcmp("lapic_and_apbt", arg) == 0)
330 mrst_timer_options = MRST_TIMER_LAPIC_APBT; 329 intel_mid_timer_options = INTEL_MID_TIMER_LAPIC_APBT;
331 else { 330 else {
332 pr_warn("X86 MRST timer option %s not recognised" 331 pr_warn("X86 INTEL_MID timer option %s not recognised"
333 " use x86_mrst_timer=apbt_only or lapic_and_apbt\n", 332 " use x86_intel_mid_timer=apbt_only or lapic_and_apbt\n",
334 arg); 333 arg);
335 return -EINVAL; 334 return -EINVAL;
336 } 335 }
337 return 0; 336 return 0;
338} 337}
339__setup("x86_mrst_timer=", setup_x86_mrst_timer); 338__setup("x86_intel_mid_timer=", setup_x86_intel_mid_timer);
340 339
341/* 340/*
342 * Parsing GPIO table first, since the DEVS table will need this table 341 * Parsing GPIO table first, since the DEVS table will need this table
@@ -400,7 +399,7 @@ struct devs_id {
400}; 399};
401 400
402/* the offset for the mapping of global gpio pin to irq */ 401/* the offset for the mapping of global gpio pin to irq */
403#define MRST_IRQ_OFFSET 0x100 402#define INTEL_MID_IRQ_OFFSET 0x100
404 403
405static void __init *pmic_gpio_platform_data(void *info) 404static void __init *pmic_gpio_platform_data(void *info)
406{ 405{
@@ -410,7 +409,7 @@ static void __init *pmic_gpio_platform_data(void *info)
410 if (gpio_base == -1) 409 if (gpio_base == -1)
411 gpio_base = 64; 410 gpio_base = 64;
412 pmic_gpio_pdata.gpio_base = gpio_base; 411 pmic_gpio_pdata.gpio_base = gpio_base;
413 pmic_gpio_pdata.irq_base = gpio_base + MRST_IRQ_OFFSET; 412 pmic_gpio_pdata.irq_base = gpio_base + INTEL_MID_IRQ_OFFSET;
414 pmic_gpio_pdata.gpiointr = 0xffffeff8; 413 pmic_gpio_pdata.gpiointr = 0xffffeff8;
415 414
416 return &pmic_gpio_pdata; 415 return &pmic_gpio_pdata;
@@ -424,7 +423,7 @@ static void __init *max3111_platform_data(void *info)
424 spi_info->mode = SPI_MODE_0; 423 spi_info->mode = SPI_MODE_0;
425 if (intr == -1) 424 if (intr == -1)
426 return NULL; 425 return NULL;
427 spi_info->irq = intr + MRST_IRQ_OFFSET; 426 spi_info->irq = intr + INTEL_MID_IRQ_OFFSET;
428 return NULL; 427 return NULL;
429} 428}
430 429
@@ -464,8 +463,8 @@ static void __init *max7315_platform_data(void *info)
464 return NULL; 463 return NULL;
465 max7315->gpio_base = gpio_base; 464 max7315->gpio_base = gpio_base;
466 if (intr != -1) { 465 if (intr != -1) {
467 i2c_info->irq = intr + MRST_IRQ_OFFSET; 466 i2c_info->irq = intr + INTEL_MID_IRQ_OFFSET;
468 max7315->irq_base = gpio_base + MRST_IRQ_OFFSET; 467 max7315->irq_base = gpio_base + INTEL_MID_IRQ_OFFSET;
469 } else { 468 } else {
470 i2c_info->irq = -1; 469 i2c_info->irq = -1;
471 max7315->irq_base = -1; 470 max7315->irq_base = -1;
@@ -492,8 +491,8 @@ static void *tca6416_platform_data(void *info)
492 return NULL; 491 return NULL;
493 tca6416.gpio_base = gpio_base; 492 tca6416.gpio_base = gpio_base;
494 if (intr != -1) { 493 if (intr != -1) {
495 i2c_info->irq = intr + MRST_IRQ_OFFSET; 494 i2c_info->irq = intr + INTEL_MID_IRQ_OFFSET;
496 tca6416.irq_base = gpio_base + MRST_IRQ_OFFSET; 495 tca6416.irq_base = gpio_base + INTEL_MID_IRQ_OFFSET;
497 } else { 496 } else {
498 i2c_info->irq = -1; 497 i2c_info->irq = -1;
499 tca6416.irq_base = -1; 498 tca6416.irq_base = -1;
@@ -509,7 +508,7 @@ static void *mpu3050_platform_data(void *info)
509 if (intr == -1) 508 if (intr == -1)
510 return NULL; 509 return NULL;
511 510
512 i2c_info->irq = intr + MRST_IRQ_OFFSET; 511 i2c_info->irq = intr + INTEL_MID_IRQ_OFFSET;
513 return NULL; 512 return NULL;
514} 513}
515 514
@@ -523,8 +522,8 @@ static void __init *emc1403_platform_data(void *info)
523 if (intr == -1 || intr2nd == -1) 522 if (intr == -1 || intr2nd == -1)
524 return NULL; 523 return NULL;
525 524
526 i2c_info->irq = intr + MRST_IRQ_OFFSET; 525 i2c_info->irq = intr + INTEL_MID_IRQ_OFFSET;
527 intr2nd_pdata = intr2nd + MRST_IRQ_OFFSET; 526 intr2nd_pdata = intr2nd + INTEL_MID_IRQ_OFFSET;
528 527
529 return &intr2nd_pdata; 528 return &intr2nd_pdata;
530} 529}
@@ -539,8 +538,8 @@ static void __init *lis331dl_platform_data(void *info)
539 if (intr == -1 || intr2nd == -1) 538 if (intr == -1 || intr2nd == -1)
540 return NULL; 539 return NULL;
541 540
542 i2c_info->irq = intr + MRST_IRQ_OFFSET; 541 i2c_info->irq = intr + INTEL_MID_IRQ_OFFSET;
543 intr2nd_pdata = intr2nd + MRST_IRQ_OFFSET; 542 intr2nd_pdata = intr2nd + INTEL_MID_IRQ_OFFSET;
544 543
545 return &intr2nd_pdata; 544 return &intr2nd_pdata;
546} 545}
@@ -570,9 +569,9 @@ static struct platform_device msic_device = {
570 .resource = msic_resources, 569 .resource = msic_resources,
571}; 570};
572 571
573static inline bool mrst_has_msic(void) 572static inline bool intel_mid_has_msic(void)
574{ 573{
575 return mrst_identify_cpu() == MRST_CPU_CHIP_PENWELL; 574 return intel_mid_identify_cpu() == INTEL_MID_CPU_CHIP_PENWELL;
576} 575}
577 576
578static int msic_scu_status_change(struct notifier_block *nb, 577static int msic_scu_status_change(struct notifier_block *nb,
@@ -596,7 +595,7 @@ static int __init msic_init(void)
596 * We need to be sure that the SCU IPC is ready before MSIC device 595 * We need to be sure that the SCU IPC is ready before MSIC device
597 * can be registered. 596 * can be registered.
598 */ 597 */
599 if (mrst_has_msic()) 598 if (intel_mid_has_msic())
600 intel_scu_notifier_add(&msic_scu_notifier); 599 intel_scu_notifier_add(&msic_scu_notifier);
601 600
602 return 0; 601 return 0;
@@ -851,7 +850,7 @@ static void __init sfi_handle_ipc_dev(struct sfi_device_table_entry *entry)
851 * On Medfield the platform device creation is handled by the MSIC 850 * On Medfield the platform device creation is handled by the MSIC
852 * MFD driver so we don't need to do it here. 851 * MFD driver so we don't need to do it here.
853 */ 852 */
854 if (mrst_has_msic()) 853 if (intel_mid_has_msic())
855 return; 854 return;
856 855
857 pdev = platform_device_alloc(entry->name, 0); 856 pdev = platform_device_alloc(entry->name, 0);
@@ -984,13 +983,13 @@ static int __init sfi_parse_devs(struct sfi_table_header *table)
984 return 0; 983 return 0;
985} 984}
986 985
987static int __init mrst_platform_init(void) 986static int __init intel_mid_platform_init(void)
988{ 987{
989 sfi_table_parse(SFI_SIG_GPIO, NULL, NULL, sfi_parse_gpio); 988 sfi_table_parse(SFI_SIG_GPIO, NULL, NULL, sfi_parse_gpio);
990 sfi_table_parse(SFI_SIG_DEVS, NULL, NULL, sfi_parse_devs); 989 sfi_table_parse(SFI_SIG_DEVS, NULL, NULL, sfi_parse_devs);
991 return 0; 990 return 0;
992} 991}
993arch_initcall(mrst_platform_init); 992arch_initcall(intel_mid_platform_init);
994 993
995/* 994/*
996 * we will search these buttons in SFI GPIO table (by name) 995 * we will search these buttons in SFI GPIO table (by name)
@@ -1010,7 +1009,7 @@ static struct gpio_keys_button gpio_button[] = {
1010 {SW_KEYPAD_SLIDE, -1, 1, "MagSw2", EV_SW, 0, 20}, 1009 {SW_KEYPAD_SLIDE, -1, 1, "MagSw2", EV_SW, 0, 20},
1011}; 1010};
1012 1011
1013static struct gpio_keys_platform_data mrst_gpio_keys = { 1012static struct gpio_keys_platform_data intel_mid_gpio_keys = {
1014 .buttons = gpio_button, 1013 .buttons = gpio_button,
1015 .rep = 1, 1014 .rep = 1,
1016 .nbuttons = -1, /* will fill it after search */ 1015 .nbuttons = -1, /* will fill it after search */
@@ -1020,7 +1019,7 @@ static struct platform_device pb_device = {
1020 .name = "gpio-keys", 1019 .name = "gpio-keys",
1021 .id = -1, 1020 .id = -1,
1022 .dev = { 1021 .dev = {
1023 .platform_data = &mrst_gpio_keys, 1022 .platform_data = &intel_mid_gpio_keys,
1024 }, 1023 },
1025}; 1024};
1026 1025
@@ -1047,7 +1046,7 @@ static int __init pb_keys_init(void)
1047 } 1046 }
1048 1047
1049 if (good) { 1048 if (good) {
1050 mrst_gpio_keys.nbuttons = good; 1049 intel_mid_gpio_keys.nbuttons = good;
1051 return platform_device_register(&pb_device); 1050 return platform_device_register(&pb_device);
1052 } 1051 }
1053 return 0; 1052 return 0;