diff options
| author | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-17 16:15:55 -0500 |
|---|---|---|
| committer | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-17 16:15:55 -0500 |
| commit | 8dea78da5cee153b8af9c07a2745f6c55057fe12 (patch) | |
| tree | a8f4d49d63b1ecc92f2fddceba0655b2472c5bd9 /arch/x86/platform/mrst | |
| parent | 406089d01562f1e2bf9f089fd7637009ebaad589 (diff) | |
Patched in Tegra support.
Diffstat (limited to 'arch/x86/platform/mrst')
| -rw-r--r-- | arch/x86/platform/mrst/Makefile | 7 | ||||
| -rw-r--r-- | arch/x86/platform/mrst/early_printk_mrst.c | 29 | ||||
| -rw-r--r-- | arch/x86/platform/mrst/mrst.c | 310 | ||||
| -rw-r--r-- | arch/x86/platform/mrst/vrtc.c | 5 |
4 files changed, 54 insertions, 297 deletions
diff --git a/arch/x86/platform/mrst/Makefile b/arch/x86/platform/mrst/Makefile index af1da7e623f..1ea38775a6d 100644 --- a/arch/x86/platform/mrst/Makefile +++ b/arch/x86/platform/mrst/Makefile | |||
| @@ -1,3 +1,4 @@ | |||
| 1 | obj-$(CONFIG_X86_INTEL_MID) += mrst.o | 1 | obj-$(CONFIG_X86_MRST) += mrst.o |
| 2 | obj-$(CONFIG_X86_INTEL_MID) += vrtc.o | 2 | obj-$(CONFIG_X86_MRST) += vrtc.o |
| 3 | obj-$(CONFIG_EARLY_PRINTK_INTEL_MID) += early_printk_mrst.o | 3 | obj-$(CONFIG_EARLY_PRINTK_MRST) += early_printk_mrst.o |
| 4 | obj-$(CONFIG_X86_MRST) += pmu.o | ||
diff --git a/arch/x86/platform/mrst/early_printk_mrst.c b/arch/x86/platform/mrst/early_printk_mrst.c index 028454f0c3a..25bfdbb5b13 100644 --- a/arch/x86/platform/mrst/early_printk_mrst.c +++ b/arch/x86/platform/mrst/early_printk_mrst.c | |||
| @@ -110,16 +110,19 @@ static struct kmsg_dumper dw_dumper; | |||
| 110 | static int dumper_registered; | 110 | static int dumper_registered; |
| 111 | 111 | ||
| 112 | static void dw_kmsg_dump(struct kmsg_dumper *dumper, | 112 | static void dw_kmsg_dump(struct kmsg_dumper *dumper, |
| 113 | enum kmsg_dump_reason reason) | 113 | enum kmsg_dump_reason reason, |
| 114 | const char *s1, unsigned long l1, | ||
| 115 | const char *s2, unsigned long l2) | ||
| 114 | { | 116 | { |
| 115 | static char line[1024]; | 117 | int i; |
| 116 | size_t len; | ||
| 117 | 118 | ||
| 118 | /* When run to this, we'd better re-init the HW */ | 119 | /* When run to this, we'd better re-init the HW */ |
| 119 | mrst_early_console_init(); | 120 | mrst_early_console_init(); |
| 120 | 121 | ||
| 121 | while (kmsg_dump_get_line(dumper, true, line, sizeof(line), &len)) | 122 | for (i = 0; i < l1; i++) |
| 122 | early_mrst_console.write(&early_mrst_console, line, len); | 123 | early_mrst_console.write(&early_mrst_console, s1 + i, 1); |
| 124 | for (i = 0; i < l2; i++) | ||
| 125 | early_mrst_console.write(&early_mrst_console, s2 + i, 1); | ||
| 123 | } | 126 | } |
| 124 | 127 | ||
| 125 | /* Set the ratio rate to 115200, 8n1, IRQ disabled */ | 128 | /* Set the ratio rate to 115200, 8n1, IRQ disabled */ |
| @@ -242,24 +245,16 @@ struct console early_mrst_console = { | |||
| 242 | * Following is the early console based on Medfield HSU (High | 245 | * Following is the early console based on Medfield HSU (High |
| 243 | * Speed UART) device. | 246 | * Speed UART) device. |
| 244 | */ | 247 | */ |
| 245 | #define HSU_PORT_BASE 0xffa28080 | 248 | #define HSU_PORT2_PADDR 0xffa28180 |
| 246 | 249 | ||
| 247 | static void __iomem *phsu; | 250 | static void __iomem *phsu; |
| 248 | 251 | ||
| 249 | void hsu_early_console_init(const char *s) | 252 | void hsu_early_console_init(void) |
| 250 | { | 253 | { |
| 251 | unsigned long paddr, port = 0; | ||
| 252 | u8 lcr; | 254 | u8 lcr; |
| 253 | 255 | ||
| 254 | /* | 256 | phsu = (void *)set_fixmap_offset_nocache(FIX_EARLYCON_MEM_BASE, |
| 255 | * Select the early HSU console port if specified by user in the | 257 | HSU_PORT2_PADDR); |
| 256 | * kernel command line. | ||
| 257 | */ | ||
| 258 | if (*s && !kstrtoul(s, 10, &port)) | ||
| 259 | port = clamp_val(port, 0, 2); | ||
| 260 | |||
| 261 | paddr = HSU_PORT_BASE + port * 0x80; | ||
| 262 | phsu = (void *)set_fixmap_offset_nocache(FIX_EARLYCON_MEM_BASE, paddr); | ||
| 263 | 258 | ||
| 264 | /* Disable FIFO */ | 259 | /* Disable FIFO */ |
| 265 | writeb(0x0, phsu + UART_FCR); | 260 | writeb(0x0, phsu + UART_FCR); |
diff --git a/arch/x86/platform/mrst/mrst.c b/arch/x86/platform/mrst/mrst.c index e31bcd8f2ee..fe73276e026 100644 --- a/arch/x86/platform/mrst/mrst.c +++ b/arch/x86/platform/mrst/mrst.c | |||
| @@ -14,8 +14,6 @@ | |||
| 14 | 14 | ||
| 15 | #include <linux/init.h> | 15 | #include <linux/init.h> |
| 16 | #include <linux/kernel.h> | 16 | #include <linux/kernel.h> |
| 17 | #include <linux/interrupt.h> | ||
| 18 | #include <linux/scatterlist.h> | ||
| 19 | #include <linux/sfi.h> | 17 | #include <linux/sfi.h> |
| 20 | #include <linux/intel_pmic_gpio.h> | 18 | #include <linux/intel_pmic_gpio.h> |
| 21 | #include <linux/spi/spi.h> | 19 | #include <linux/spi/spi.h> |
| @@ -26,10 +24,6 @@ | |||
| 26 | #include <linux/platform_device.h> | 24 | #include <linux/platform_device.h> |
| 27 | #include <linux/irq.h> | 25 | #include <linux/irq.h> |
| 28 | #include <linux/module.h> | 26 | #include <linux/module.h> |
| 29 | #include <linux/notifier.h> | ||
| 30 | #include <linux/mfd/intel_msic.h> | ||
| 31 | #include <linux/gpio.h> | ||
| 32 | #include <linux/i2c/tc35876x.h> | ||
| 33 | 27 | ||
| 34 | #include <asm/setup.h> | 28 | #include <asm/setup.h> |
| 35 | #include <asm/mpspec_def.h> | 29 | #include <asm/mpspec_def.h> |
| @@ -78,15 +72,6 @@ struct sfi_rtc_table_entry sfi_mrtc_array[SFI_MRTC_MAX]; | |||
| 78 | EXPORT_SYMBOL_GPL(sfi_mrtc_array); | 72 | EXPORT_SYMBOL_GPL(sfi_mrtc_array); |
| 79 | int sfi_mrtc_num; | 73 | int sfi_mrtc_num; |
| 80 | 74 | ||
| 81 | static void mrst_power_off(void) | ||
| 82 | { | ||
| 83 | } | ||
| 84 | |||
| 85 | static void mrst_reboot(void) | ||
| 86 | { | ||
| 87 | intel_scu_ipc_simple_command(IPCMSG_COLD_BOOT, 0); | ||
| 88 | } | ||
| 89 | |||
| 90 | /* parse all the mtimer info to a static mtimer array */ | 75 | /* parse all the mtimer info to a static mtimer array */ |
| 91 | static int __init sfi_parse_mtmr(struct sfi_table_header *table) | 76 | static int __init sfi_parse_mtmr(struct sfi_table_header *table) |
| 92 | { | 77 | { |
| @@ -197,29 +182,12 @@ int __init sfi_parse_mrtc(struct sfi_table_header *table) | |||
| 197 | 182 | ||
| 198 | static unsigned long __init mrst_calibrate_tsc(void) | 183 | static unsigned long __init mrst_calibrate_tsc(void) |
| 199 | { | 184 | { |
| 200 | unsigned long fast_calibrate; | 185 | unsigned long flags, fast_calibrate; |
| 201 | u32 lo, hi, ratio, fsb; | 186 | |
| 202 | 187 | local_irq_save(flags); | |
| 203 | rdmsr(MSR_IA32_PERF_STATUS, lo, hi); | 188 | fast_calibrate = apbt_quick_calibrate(); |
| 204 | pr_debug("IA32 perf status is 0x%x, 0x%0x\n", lo, hi); | 189 | local_irq_restore(flags); |
| 205 | ratio = (hi >> 8) & 0x1f; | 190 | |
| 206 | pr_debug("ratio is %d\n", ratio); | ||
| 207 | if (!ratio) { | ||
| 208 | pr_err("read a zero ratio, should be incorrect!\n"); | ||
| 209 | pr_err("force tsc ratio to 16 ...\n"); | ||
| 210 | ratio = 16; | ||
| 211 | } | ||
| 212 | rdmsr(MSR_FSB_FREQ, lo, hi); | ||
| 213 | if ((lo & 0x7) == 0x7) | ||
| 214 | fsb = PENWELL_FSB_FREQ_83SKU; | ||
| 215 | else | ||
| 216 | fsb = PENWELL_FSB_FREQ_100SKU; | ||
| 217 | fast_calibrate = ratio * fsb; | ||
| 218 | pr_debug("read penwell tsc %lu khz\n", fast_calibrate); | ||
| 219 | lapic_timer_frequency = fsb * 1000 / HZ; | ||
| 220 | /* mark tsc clocksource as reliable */ | ||
| 221 | set_cpu_cap(&boot_cpu_data, X86_FEATURE_TSC_RELIABLE); | ||
| 222 | |||
| 223 | if (fast_calibrate) | 191 | if (fast_calibrate) |
| 224 | return fast_calibrate; | 192 | return fast_calibrate; |
| 225 | 193 | ||
| @@ -252,11 +220,16 @@ static void __cpuinit mrst_arch_setup(void) | |||
| 252 | { | 220 | { |
| 253 | if (boot_cpu_data.x86 == 6 && boot_cpu_data.x86_model == 0x27) | 221 | if (boot_cpu_data.x86 == 6 && boot_cpu_data.x86_model == 0x27) |
| 254 | __mrst_cpu_chip = MRST_CPU_CHIP_PENWELL; | 222 | __mrst_cpu_chip = MRST_CPU_CHIP_PENWELL; |
| 223 | else if (boot_cpu_data.x86 == 6 && boot_cpu_data.x86_model == 0x26) | ||
| 224 | __mrst_cpu_chip = MRST_CPU_CHIP_LINCROFT; | ||
| 255 | else { | 225 | else { |
| 256 | pr_err("Unknown Intel MID CPU (%d:%d), default to Penwell\n", | 226 | pr_err("Unknown Moorestown CPU (%d:%d), default to Lincroft\n", |
| 257 | boot_cpu_data.x86, boot_cpu_data.x86_model); | 227 | boot_cpu_data.x86, boot_cpu_data.x86_model); |
| 258 | __mrst_cpu_chip = MRST_CPU_CHIP_PENWELL; | 228 | __mrst_cpu_chip = MRST_CPU_CHIP_LINCROFT; |
| 259 | } | 229 | } |
| 230 | pr_debug("Moorestown CPU %s identified\n", | ||
| 231 | (__mrst_cpu_chip == MRST_CPU_CHIP_LINCROFT) ? | ||
| 232 | "Lincroft" : "Penwell"); | ||
| 260 | } | 233 | } |
| 261 | 234 | ||
| 262 | /* MID systems don't have i8042 controller */ | 235 | /* MID systems don't have i8042 controller */ |
| @@ -265,15 +238,15 @@ static int mrst_i8042_detect(void) | |||
| 265 | return 0; | 238 | return 0; |
| 266 | } | 239 | } |
| 267 | 240 | ||
| 268 | /* | 241 | /* Reboot and power off are handled by the SCU on a MID device */ |
| 269 | * Moorestown does not have external NMI source nor port 0x61 to report | 242 | static void mrst_power_off(void) |
| 270 | * NMI status. The possible NMI sources are from pmu as a result of NMI | ||
| 271 | * watchdog or lock debug. Reading io port 0x61 results in 0xff which | ||
| 272 | * misled NMI handler. | ||
| 273 | */ | ||
| 274 | static unsigned char mrst_get_nmi_reason(void) | ||
| 275 | { | 243 | { |
| 276 | return 0; | 244 | intel_scu_ipc_simple_command(0xf1, 1); |
| 245 | } | ||
| 246 | |||
| 247 | static void mrst_reboot(void) | ||
| 248 | { | ||
| 249 | intel_scu_ipc_simple_command(0xf1, 0); | ||
| 277 | } | 250 | } |
| 278 | 251 | ||
| 279 | /* | 252 | /* |
| @@ -297,8 +270,6 @@ void __init x86_mrst_early_setup(void) | |||
| 297 | x86_platform.calibrate_tsc = mrst_calibrate_tsc; | 270 | x86_platform.calibrate_tsc = mrst_calibrate_tsc; |
| 298 | x86_platform.i8042_detect = mrst_i8042_detect; | 271 | x86_platform.i8042_detect = mrst_i8042_detect; |
| 299 | x86_init.timers.wallclock_init = mrst_rtc_init; | 272 | x86_init.timers.wallclock_init = mrst_rtc_init; |
| 300 | x86_platform.get_nmi_reason = mrst_get_nmi_reason; | ||
| 301 | |||
| 302 | x86_init.pci.init = pci_mrst_init; | 273 | x86_init.pci.init = pci_mrst_init; |
| 303 | x86_init.pci.fixup_irqs = x86_init_noop; | 274 | x86_init.pci.fixup_irqs = x86_init_noop; |
| 304 | 275 | ||
| @@ -421,7 +392,6 @@ static void __init *max3111_platform_data(void *info) | |||
| 421 | struct spi_board_info *spi_info = info; | 392 | struct spi_board_info *spi_info = info; |
| 422 | int intr = get_gpio_by_name("max3111_int"); | 393 | int intr = get_gpio_by_name("max3111_int"); |
| 423 | 394 | ||
| 424 | spi_info->mode = SPI_MODE_0; | ||
| 425 | if (intr == -1) | 395 | if (intr == -1) |
| 426 | return NULL; | 396 | return NULL; |
| 427 | spi_info->irq = intr + MRST_IRQ_OFFSET; | 397 | spi_info->irq = intr + MRST_IRQ_OFFSET; |
| @@ -473,46 +443,6 @@ static void __init *max7315_platform_data(void *info) | |||
| 473 | return max7315; | 443 | return max7315; |
| 474 | } | 444 | } |
| 475 | 445 | ||
| 476 | static void *tca6416_platform_data(void *info) | ||
| 477 | { | ||
| 478 | static struct pca953x_platform_data tca6416; | ||
| 479 | struct i2c_board_info *i2c_info = info; | ||
| 480 | int gpio_base, intr; | ||
| 481 | char base_pin_name[SFI_NAME_LEN + 1]; | ||
| 482 | char intr_pin_name[SFI_NAME_LEN + 1]; | ||
| 483 | |||
| 484 | strcpy(i2c_info->type, "tca6416"); | ||
| 485 | strcpy(base_pin_name, "tca6416_base"); | ||
| 486 | strcpy(intr_pin_name, "tca6416_int"); | ||
| 487 | |||
| 488 | gpio_base = get_gpio_by_name(base_pin_name); | ||
| 489 | intr = get_gpio_by_name(intr_pin_name); | ||
| 490 | |||
| 491 | if (gpio_base == -1) | ||
| 492 | return NULL; | ||
| 493 | tca6416.gpio_base = gpio_base; | ||
| 494 | if (intr != -1) { | ||
| 495 | i2c_info->irq = intr + MRST_IRQ_OFFSET; | ||
| 496 | tca6416.irq_base = gpio_base + MRST_IRQ_OFFSET; | ||
| 497 | } else { | ||
| 498 | i2c_info->irq = -1; | ||
| 499 | tca6416.irq_base = -1; | ||
| 500 | } | ||
| 501 | return &tca6416; | ||
| 502 | } | ||
| 503 | |||
| 504 | static void *mpu3050_platform_data(void *info) | ||
| 505 | { | ||
| 506 | struct i2c_board_info *i2c_info = info; | ||
| 507 | int intr = get_gpio_by_name("mpu3050_int"); | ||
| 508 | |||
| 509 | if (intr == -1) | ||
| 510 | return NULL; | ||
| 511 | |||
| 512 | i2c_info->irq = intr + MRST_IRQ_OFFSET; | ||
| 513 | return NULL; | ||
| 514 | } | ||
| 515 | |||
| 516 | static void __init *emc1403_platform_data(void *info) | 446 | static void __init *emc1403_platform_data(void *info) |
| 517 | { | 447 | { |
| 518 | static short intr2nd_pdata; | 448 | static short intr2nd_pdata; |
| @@ -550,168 +480,15 @@ static void __init *no_platform_data(void *info) | |||
| 550 | return NULL; | 480 | return NULL; |
| 551 | } | 481 | } |
| 552 | 482 | ||
| 553 | static struct resource msic_resources[] = { | ||
| 554 | { | ||
| 555 | .start = INTEL_MSIC_IRQ_PHYS_BASE, | ||
| 556 | .end = INTEL_MSIC_IRQ_PHYS_BASE + 64 - 1, | ||
| 557 | .flags = IORESOURCE_MEM, | ||
| 558 | }, | ||
| 559 | }; | ||
| 560 | |||
| 561 | static struct intel_msic_platform_data msic_pdata; | ||
| 562 | |||
| 563 | static struct platform_device msic_device = { | ||
| 564 | .name = "intel_msic", | ||
| 565 | .id = -1, | ||
| 566 | .dev = { | ||
| 567 | .platform_data = &msic_pdata, | ||
| 568 | }, | ||
| 569 | .num_resources = ARRAY_SIZE(msic_resources), | ||
| 570 | .resource = msic_resources, | ||
| 571 | }; | ||
| 572 | |||
| 573 | static inline bool mrst_has_msic(void) | ||
| 574 | { | ||
| 575 | return mrst_identify_cpu() == MRST_CPU_CHIP_PENWELL; | ||
| 576 | } | ||
| 577 | |||
| 578 | static int msic_scu_status_change(struct notifier_block *nb, | ||
| 579 | unsigned long code, void *data) | ||
| 580 | { | ||
| 581 | if (code == SCU_DOWN) { | ||
| 582 | platform_device_unregister(&msic_device); | ||
| 583 | return 0; | ||
| 584 | } | ||
| 585 | |||
| 586 | return platform_device_register(&msic_device); | ||
| 587 | } | ||
| 588 | |||
| 589 | static int __init msic_init(void) | ||
| 590 | { | ||
| 591 | static struct notifier_block msic_scu_notifier = { | ||
| 592 | .notifier_call = msic_scu_status_change, | ||
| 593 | }; | ||
| 594 | |||
| 595 | /* | ||
| 596 | * We need to be sure that the SCU IPC is ready before MSIC device | ||
| 597 | * can be registered. | ||
| 598 | */ | ||
| 599 | if (mrst_has_msic()) | ||
| 600 | intel_scu_notifier_add(&msic_scu_notifier); | ||
| 601 | |||
| 602 | return 0; | ||
| 603 | } | ||
| 604 | arch_initcall(msic_init); | ||
| 605 | |||
| 606 | /* | ||
| 607 | * msic_generic_platform_data - sets generic platform data for the block | ||
| 608 | * @info: pointer to the SFI device table entry for this block | ||
| 609 | * @block: MSIC block | ||
| 610 | * | ||
| 611 | * Function sets IRQ number from the SFI table entry for given device to | ||
| 612 | * the MSIC platform data. | ||
| 613 | */ | ||
| 614 | static void *msic_generic_platform_data(void *info, enum intel_msic_block block) | ||
| 615 | { | ||
| 616 | struct sfi_device_table_entry *entry = info; | ||
| 617 | |||
| 618 | BUG_ON(block < 0 || block >= INTEL_MSIC_BLOCK_LAST); | ||
| 619 | msic_pdata.irq[block] = entry->irq; | ||
| 620 | |||
| 621 | return no_platform_data(info); | ||
| 622 | } | ||
| 623 | |||
| 624 | static void *msic_battery_platform_data(void *info) | ||
| 625 | { | ||
| 626 | return msic_generic_platform_data(info, INTEL_MSIC_BLOCK_BATTERY); | ||
| 627 | } | ||
| 628 | |||
| 629 | static void *msic_gpio_platform_data(void *info) | ||
| 630 | { | ||
| 631 | static struct intel_msic_gpio_pdata pdata; | ||
| 632 | int gpio = get_gpio_by_name("msic_gpio_base"); | ||
| 633 | |||
| 634 | if (gpio < 0) | ||
| 635 | return NULL; | ||
| 636 | |||
| 637 | pdata.gpio_base = gpio; | ||
| 638 | msic_pdata.gpio = &pdata; | ||
| 639 | |||
| 640 | return msic_generic_platform_data(info, INTEL_MSIC_BLOCK_GPIO); | ||
| 641 | } | ||
| 642 | |||
| 643 | static void *msic_audio_platform_data(void *info) | ||
| 644 | { | ||
| 645 | struct platform_device *pdev; | ||
| 646 | |||
| 647 | pdev = platform_device_register_simple("sst-platform", -1, NULL, 0); | ||
| 648 | if (IS_ERR(pdev)) { | ||
| 649 | pr_err("failed to create audio platform device\n"); | ||
| 650 | return NULL; | ||
| 651 | } | ||
| 652 | |||
| 653 | return msic_generic_platform_data(info, INTEL_MSIC_BLOCK_AUDIO); | ||
| 654 | } | ||
| 655 | |||
| 656 | static void *msic_power_btn_platform_data(void *info) | ||
| 657 | { | ||
| 658 | return msic_generic_platform_data(info, INTEL_MSIC_BLOCK_POWER_BTN); | ||
| 659 | } | ||
| 660 | |||
| 661 | static void *msic_ocd_platform_data(void *info) | ||
| 662 | { | ||
| 663 | static struct intel_msic_ocd_pdata pdata; | ||
| 664 | int gpio = get_gpio_by_name("ocd_gpio"); | ||
| 665 | |||
| 666 | if (gpio < 0) | ||
| 667 | return NULL; | ||
| 668 | |||
| 669 | pdata.gpio = gpio; | ||
| 670 | msic_pdata.ocd = &pdata; | ||
| 671 | |||
| 672 | return msic_generic_platform_data(info, INTEL_MSIC_BLOCK_OCD); | ||
| 673 | } | ||
| 674 | |||
| 675 | static void *msic_thermal_platform_data(void *info) | ||
| 676 | { | ||
| 677 | return msic_generic_platform_data(info, INTEL_MSIC_BLOCK_THERMAL); | ||
| 678 | } | ||
| 679 | |||
| 680 | /* tc35876x DSI-LVDS bridge chip and panel platform data */ | ||
| 681 | static void *tc35876x_platform_data(void *data) | ||
| 682 | { | ||
| 683 | static struct tc35876x_platform_data pdata; | ||
| 684 | |||
| 685 | /* gpio pins set to -1 will not be used by the driver */ | ||
| 686 | pdata.gpio_bridge_reset = get_gpio_by_name("LCMB_RXEN"); | ||
| 687 | pdata.gpio_panel_bl_en = get_gpio_by_name("6S6P_BL_EN"); | ||
| 688 | pdata.gpio_panel_vadd = get_gpio_by_name("EN_VREG_LCD_V3P3"); | ||
| 689 | |||
| 690 | return &pdata; | ||
| 691 | } | ||
| 692 | |||
| 693 | static const struct devs_id __initconst device_ids[] = { | 483 | static const struct devs_id __initconst device_ids[] = { |
| 694 | {"bma023", SFI_DEV_TYPE_I2C, 1, &no_platform_data}, | ||
| 695 | {"pmic_gpio", SFI_DEV_TYPE_SPI, 1, &pmic_gpio_platform_data}, | 484 | {"pmic_gpio", SFI_DEV_TYPE_SPI, 1, &pmic_gpio_platform_data}, |
| 696 | {"pmic_gpio", SFI_DEV_TYPE_IPC, 1, &pmic_gpio_platform_data}, | ||
| 697 | {"spi_max3111", SFI_DEV_TYPE_SPI, 0, &max3111_platform_data}, | 485 | {"spi_max3111", SFI_DEV_TYPE_SPI, 0, &max3111_platform_data}, |
| 698 | {"i2c_max7315", SFI_DEV_TYPE_I2C, 1, &max7315_platform_data}, | 486 | {"i2c_max7315", SFI_DEV_TYPE_I2C, 1, &max7315_platform_data}, |
| 699 | {"i2c_max7315_2", SFI_DEV_TYPE_I2C, 1, &max7315_platform_data}, | 487 | {"i2c_max7315_2", SFI_DEV_TYPE_I2C, 1, &max7315_platform_data}, |
| 700 | {"tca6416", SFI_DEV_TYPE_I2C, 1, &tca6416_platform_data}, | ||
| 701 | {"emc1403", SFI_DEV_TYPE_I2C, 1, &emc1403_platform_data}, | 488 | {"emc1403", SFI_DEV_TYPE_I2C, 1, &emc1403_platform_data}, |
| 702 | {"i2c_accel", SFI_DEV_TYPE_I2C, 0, &lis331dl_platform_data}, | 489 | {"i2c_accel", SFI_DEV_TYPE_I2C, 0, &lis331dl_platform_data}, |
| 703 | {"pmic_audio", SFI_DEV_TYPE_IPC, 1, &no_platform_data}, | 490 | {"pmic_audio", SFI_DEV_TYPE_IPC, 1, &no_platform_data}, |
| 704 | {"mpu3050", SFI_DEV_TYPE_I2C, 1, &mpu3050_platform_data}, | 491 | {"msic_audio", SFI_DEV_TYPE_IPC, 1, &no_platform_data}, |
| 705 | {"i2c_disp_brig", SFI_DEV_TYPE_I2C, 0, &tc35876x_platform_data}, | ||
| 706 | |||
| 707 | /* MSIC subdevices */ | ||
| 708 | {"msic_battery", SFI_DEV_TYPE_IPC, 1, &msic_battery_platform_data}, | ||
| 709 | {"msic_gpio", SFI_DEV_TYPE_IPC, 1, &msic_gpio_platform_data}, | ||
| 710 | {"msic_audio", SFI_DEV_TYPE_IPC, 1, &msic_audio_platform_data}, | ||
| 711 | {"msic_power_btn", SFI_DEV_TYPE_IPC, 1, &msic_power_btn_platform_data}, | ||
| 712 | {"msic_ocd", SFI_DEV_TYPE_IPC, 1, &msic_ocd_platform_data}, | ||
| 713 | {"msic_thermal", SFI_DEV_TYPE_IPC, 1, &msic_thermal_platform_data}, | ||
| 714 | |||
| 715 | {}, | 492 | {}, |
| 716 | }; | 493 | }; |
| 717 | 494 | ||
| @@ -778,9 +555,6 @@ static void __init intel_scu_i2c_device_register(int bus, | |||
| 778 | i2c_devs[i2c_next_dev++] = new_dev; | 555 | i2c_devs[i2c_next_dev++] = new_dev; |
| 779 | } | 556 | } |
| 780 | 557 | ||
| 781 | BLOCKING_NOTIFIER_HEAD(intel_scu_notifier); | ||
| 782 | EXPORT_SYMBOL_GPL(intel_scu_notifier); | ||
| 783 | |||
| 784 | /* Called by IPC driver */ | 558 | /* Called by IPC driver */ |
| 785 | void intel_scu_devices_create(void) | 559 | void intel_scu_devices_create(void) |
| 786 | { | 560 | { |
| @@ -805,7 +579,6 @@ void intel_scu_devices_create(void) | |||
| 805 | } else | 579 | } else |
| 806 | i2c_register_board_info(i2c_bus[i], i2c_devs[i], 1); | 580 | i2c_register_board_info(i2c_bus[i], i2c_devs[i], 1); |
| 807 | } | 581 | } |
| 808 | intel_scu_notifier_post(SCU_AVAILABLE, NULL); | ||
| 809 | } | 582 | } |
| 810 | EXPORT_SYMBOL_GPL(intel_scu_devices_create); | 583 | EXPORT_SYMBOL_GPL(intel_scu_devices_create); |
| 811 | 584 | ||
| @@ -814,8 +587,6 @@ void intel_scu_devices_destroy(void) | |||
| 814 | { | 587 | { |
| 815 | int i; | 588 | int i; |
| 816 | 589 | ||
| 817 | intel_scu_notifier_post(SCU_DOWN, NULL); | ||
| 818 | |||
| 819 | for (i = 0; i < ipc_next_dev; i++) | 590 | for (i = 0; i < ipc_next_dev; i++) |
| 820 | platform_device_del(ipc_devs[i]); | 591 | platform_device_del(ipc_devs[i]); |
| 821 | } | 592 | } |
| @@ -832,36 +603,19 @@ static void __init install_irq_resource(struct platform_device *pdev, int irq) | |||
| 832 | platform_device_add_resources(pdev, &res, 1); | 603 | platform_device_add_resources(pdev, &res, 1); |
| 833 | } | 604 | } |
| 834 | 605 | ||
| 835 | static void __init sfi_handle_ipc_dev(struct sfi_device_table_entry *entry) | 606 | static void __init sfi_handle_ipc_dev(struct platform_device *pdev) |
| 836 | { | 607 | { |
| 837 | const struct devs_id *dev = device_ids; | 608 | const struct devs_id *dev = device_ids; |
| 838 | struct platform_device *pdev; | ||
| 839 | void *pdata = NULL; | 609 | void *pdata = NULL; |
| 840 | 610 | ||
| 841 | while (dev->name[0]) { | 611 | while (dev->name[0]) { |
| 842 | if (dev->type == SFI_DEV_TYPE_IPC && | 612 | if (dev->type == SFI_DEV_TYPE_IPC && |
| 843 | !strncmp(dev->name, entry->name, SFI_NAME_LEN)) { | 613 | !strncmp(dev->name, pdev->name, SFI_NAME_LEN)) { |
| 844 | pdata = dev->get_platform_data(entry); | 614 | pdata = dev->get_platform_data(pdev); |
| 845 | break; | 615 | break; |
| 846 | } | 616 | } |
| 847 | dev++; | 617 | dev++; |
| 848 | } | 618 | } |
| 849 | |||
| 850 | /* | ||
| 851 | * On Medfield the platform device creation is handled by the MSIC | ||
| 852 | * MFD driver so we don't need to do it here. | ||
| 853 | */ | ||
| 854 | if (mrst_has_msic()) | ||
| 855 | return; | ||
| 856 | |||
| 857 | pdev = platform_device_alloc(entry->name, 0); | ||
| 858 | if (pdev == NULL) { | ||
| 859 | pr_err("out of memory for SFI platform device '%s'.\n", | ||
| 860 | entry->name); | ||
| 861 | return; | ||
| 862 | } | ||
| 863 | install_irq_resource(pdev, entry->irq); | ||
| 864 | |||
| 865 | pdev->dev.platform_data = pdata; | 619 | pdev->dev.platform_data = pdata; |
| 866 | intel_scu_device_register(pdev); | 620 | intel_scu_device_register(pdev); |
| 867 | } | 621 | } |
| @@ -914,6 +668,7 @@ static int __init sfi_parse_devs(struct sfi_table_header *table) | |||
| 914 | struct sfi_device_table_entry *pentry; | 668 | struct sfi_device_table_entry *pentry; |
| 915 | struct spi_board_info spi_info; | 669 | struct spi_board_info spi_info; |
| 916 | struct i2c_board_info i2c_info; | 670 | struct i2c_board_info i2c_info; |
| 671 | struct platform_device *pdev; | ||
| 917 | int num, i, bus; | 672 | int num, i, bus; |
| 918 | int ioapic; | 673 | int ioapic; |
| 919 | struct io_apic_irq_attr irq_attr; | 674 | struct io_apic_irq_attr irq_attr; |
| @@ -941,9 +696,17 @@ static int __init sfi_parse_devs(struct sfi_table_header *table) | |||
| 941 | 696 | ||
| 942 | switch (pentry->type) { | 697 | switch (pentry->type) { |
| 943 | case SFI_DEV_TYPE_IPC: | 698 | case SFI_DEV_TYPE_IPC: |
| 699 | /* ID as IRQ is a hack that will go away */ | ||
| 700 | pdev = platform_device_alloc(pentry->name, irq); | ||
| 701 | if (pdev == NULL) { | ||
| 702 | pr_err("out of memory for SFI platform device '%s'.\n", | ||
| 703 | pentry->name); | ||
| 704 | continue; | ||
| 705 | } | ||
| 706 | install_irq_resource(pdev, irq); | ||
| 944 | pr_debug("info[%2d]: IPC bus, name = %16.16s, " | 707 | pr_debug("info[%2d]: IPC bus, name = %16.16s, " |
| 945 | "irq = 0x%2x\n", i, pentry->name, pentry->irq); | 708 | "irq = 0x%2x\n", i, pentry->name, irq); |
| 946 | sfi_handle_ipc_dev(pentry); | 709 | sfi_handle_ipc_dev(pdev); |
| 947 | break; | 710 | break; |
| 948 | case SFI_DEV_TYPE_SPI: | 711 | case SFI_DEV_TYPE_SPI: |
| 949 | memset(&spi_info, 0, sizeof(spi_info)); | 712 | memset(&spi_info, 0, sizeof(spi_info)); |
| @@ -1035,7 +798,6 @@ static int __init pb_keys_init(void) | |||
| 1035 | num = sizeof(gpio_button) / sizeof(struct gpio_keys_button); | 798 | num = sizeof(gpio_button) / sizeof(struct gpio_keys_button); |
| 1036 | for (i = 0; i < num; i++) { | 799 | for (i = 0; i < num; i++) { |
| 1037 | gb[i].gpio = get_gpio_by_name(gb[i].desc); | 800 | gb[i].gpio = get_gpio_by_name(gb[i].desc); |
| 1038 | pr_debug("info[%2d]: name = %s, gpio = %d\n", i, gb[i].desc, gb[i].gpio); | ||
| 1039 | if (gb[i].gpio == -1) | 801 | if (gb[i].gpio == -1) |
| 1040 | continue; | 802 | continue; |
| 1041 | 803 | ||
diff --git a/arch/x86/platform/mrst/vrtc.c b/arch/x86/platform/mrst/vrtc.c index 225bd0f0f67..6d5dbcdd444 100644 --- a/arch/x86/platform/mrst/vrtc.c +++ b/arch/x86/platform/mrst/vrtc.c | |||
| @@ -18,7 +18,6 @@ | |||
| 18 | */ | 18 | */ |
| 19 | 19 | ||
| 20 | #include <linux/kernel.h> | 20 | #include <linux/kernel.h> |
| 21 | #include <linux/export.h> | ||
| 22 | #include <linux/init.h> | 21 | #include <linux/init.h> |
| 23 | #include <linux/sfi.h> | 22 | #include <linux/sfi.h> |
| 24 | #include <linux/platform_device.h> | 23 | #include <linux/platform_device.h> |
| @@ -76,8 +75,8 @@ unsigned long vrtc_get_time(void) | |||
| 76 | 75 | ||
| 77 | spin_unlock_irqrestore(&rtc_lock, flags); | 76 | spin_unlock_irqrestore(&rtc_lock, flags); |
| 78 | 77 | ||
| 79 | /* vRTC YEAR reg contains the offset to 1972 */ | 78 | /* vRTC YEAR reg contains the offset to 1960 */ |
| 80 | year += 1972; | 79 | year += 1960; |
| 81 | 80 | ||
| 82 | printk(KERN_INFO "vRTC: sec: %d min: %d hour: %d day: %d " | 81 | printk(KERN_INFO "vRTC: sec: %d min: %d hour: %d day: %d " |
| 83 | "mon: %d year: %d\n", sec, min, hour, mday, mon, year); | 82 | "mon: %d year: %d\n", sec, min, hour, mday, mon, year); |
