diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-10-03 20:22:25 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-10-03 20:22:25 -0400 |
commit | a6c4e4cd44649b696038326f90161113d8569170 (patch) | |
tree | 94bc13db00eb0720ee359fc6ed7609f9445decc9 | |
parent | a8adc0f0911227996b3e79690562e6e325e4c09b (diff) | |
parent | 65f7422288cd19c4a9202c4ac7a9cca673b9b2ea (diff) |
Merge branch 'x86-platform-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 platform changes from Ingo Molnar:
"The main changes in this cycle were:
- SGI UV updates (Andrew Banman)
- Intel MID updates (Andy Shevchenko)
- Initial Mellanox systems platform (Vadim Pasternak)"
* 'x86-platform-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
x86/platform/mellanox: Fix return value check in mlxplat_init()
x86/platform/mellanox: Introduce support for Mellanox systems platform
x86/platform/uv/BAU: Add UV4-specific functions
x86/platform/uv/BAU: Fix payload queue setup on UV4 hardware
x86/platform/uv/BAU: Disable software timeout on UV4 hardware
x86/platform/uv/BAU: Populate ->uvhub_version with UV4 version information
x86/platform/uv/BAU: Use generic function pointers
x86/platform/uv/BAU: Add generic function pointers
x86/platform/uv/BAU: Convert uv_physnodeaddr() use to uv_gpa_to_offset()
x86/platform/uv/BAU: Clean up pq_init()
x86/platform/uv/BAU: Clean up and update printks
x86/platform/uv/BAU: Clean up vertical alignment
x86/platform/intel-mid: Keep SRAM powered on at boot
x86/platform/intel-mid: Add Intel Penwell to ID table
x86/cpu: Rename Merrifield2 to Moorefield
x86/platform/intel-mid: Implement power off sequence
x86/platform/intel-mid: Enable SD card detection on Merrifield
x86/platform/intel-mid: Enable WiFi on Intel Edison
x86/platform/intel-mid: Run PWRMU command immediately
-rw-r--r-- | MAINTAINERS | 6 | ||||
-rw-r--r-- | arch/x86/Kconfig | 12 | ||||
-rw-r--r-- | arch/x86/include/asm/intel-family.h | 4 | ||||
-rw-r--r-- | arch/x86/include/asm/intel-mid.h | 2 | ||||
-rw-r--r-- | arch/x86/include/asm/intel_scu_ipc.h | 2 | ||||
-rw-r--r-- | arch/x86/include/asm/uv/uv_bau.h | 45 | ||||
-rw-r--r-- | arch/x86/platform/Makefile | 1 | ||||
-rw-r--r-- | arch/x86/platform/atom/punit_atom_debug.c | 2 | ||||
-rw-r--r-- | arch/x86/platform/intel-mid/device_libs/Makefile | 4 | ||||
-rw-r--r-- | arch/x86/platform/intel-mid/device_libs/platform_bcm43xx.c | 95 | ||||
-rw-r--r-- | arch/x86/platform/intel-mid/device_libs/platform_mrfld_sd.c | 47 | ||||
-rw-r--r-- | arch/x86/platform/intel-mid/intel-mid.c | 5 | ||||
-rw-r--r-- | arch/x86/platform/intel-mid/pwr.c | 76 | ||||
-rw-r--r-- | arch/x86/platform/mellanox/Makefile | 1 | ||||
-rw-r--r-- | arch/x86/platform/mellanox/mlx-platform.c | 266 | ||||
-rw-r--r-- | arch/x86/platform/uv/tlb_uv.c | 178 | ||||
-rw-r--r-- | drivers/pci/pci-mid.c | 7 | ||||
-rw-r--r-- | drivers/powercap/intel_rapl.c | 4 |
18 files changed, 669 insertions, 88 deletions
diff --git a/MAINTAINERS b/MAINTAINERS index 9a7a9c6cd64c..bbfe20ca52b3 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -7683,6 +7683,12 @@ W: http://www.mellanox.com | |||
7683 | Q: http://patchwork.ozlabs.org/project/netdev/list/ | 7683 | Q: http://patchwork.ozlabs.org/project/netdev/list/ |
7684 | F: drivers/net/ethernet/mellanox/mlxsw/ | 7684 | F: drivers/net/ethernet/mellanox/mlxsw/ |
7685 | 7685 | ||
7686 | MELLANOX PLATFORM DRIVER | ||
7687 | M: Vadim Pasternak <vadimp@mellanox.com> | ||
7688 | L: platform-driver-x86@vger.kernel.org | ||
7689 | S: Supported | ||
7690 | F: arch/x86/platform/mellanox/mlx-platform.c | ||
7691 | |||
7686 | SOFT-ROCE DRIVER (rxe) | 7692 | SOFT-ROCE DRIVER (rxe) |
7687 | M: Moni Shoua <monis@mellanox.com> | 7693 | M: Moni Shoua <monis@mellanox.com> |
7688 | L: linux-rdma@vger.kernel.org | 7694 | L: linux-rdma@vger.kernel.org |
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index ac5944fa6da2..9b2d50a73a11 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig | |||
@@ -550,6 +550,18 @@ config X86_INTEL_QUARK | |||
550 | Say Y here if you have a Quark based system such as the Arduino | 550 | Say Y here if you have a Quark based system such as the Arduino |
551 | compatible Intel Galileo. | 551 | compatible Intel Galileo. |
552 | 552 | ||
553 | config MLX_PLATFORM | ||
554 | tristate "Mellanox Technologies platform support" | ||
555 | depends on X86_64 | ||
556 | depends on X86_EXTENDED_PLATFORM | ||
557 | ---help--- | ||
558 | This option enables system support for the Mellanox Technologies | ||
559 | platform. | ||
560 | |||
561 | Say Y here if you are building a kernel for Mellanox system. | ||
562 | |||
563 | Otherwise, say N. | ||
564 | |||
553 | config X86_INTEL_LPSS | 565 | config X86_INTEL_LPSS |
554 | bool "Intel Low Power Subsystem Support" | 566 | bool "Intel Low Power Subsystem Support" |
555 | depends on X86 && ACPI | 567 | depends on X86 && ACPI |
diff --git a/arch/x86/include/asm/intel-family.h b/arch/x86/include/asm/intel-family.h index 627719475457..9ae5ab80a497 100644 --- a/arch/x86/include/asm/intel-family.h +++ b/arch/x86/include/asm/intel-family.h | |||
@@ -56,8 +56,8 @@ | |||
56 | #define INTEL_FAM6_ATOM_SILVERMONT1 0x37 /* BayTrail/BYT / Valleyview */ | 56 | #define INTEL_FAM6_ATOM_SILVERMONT1 0x37 /* BayTrail/BYT / Valleyview */ |
57 | #define INTEL_FAM6_ATOM_SILVERMONT2 0x4D /* Avaton/Rangely */ | 57 | #define INTEL_FAM6_ATOM_SILVERMONT2 0x4D /* Avaton/Rangely */ |
58 | #define INTEL_FAM6_ATOM_AIRMONT 0x4C /* CherryTrail / Braswell */ | 58 | #define INTEL_FAM6_ATOM_AIRMONT 0x4C /* CherryTrail / Braswell */ |
59 | #define INTEL_FAM6_ATOM_MERRIFIELD1 0x4A /* Tangier */ | 59 | #define INTEL_FAM6_ATOM_MERRIFIELD 0x4A /* Tangier */ |
60 | #define INTEL_FAM6_ATOM_MERRIFIELD2 0x5A /* Annidale */ | 60 | #define INTEL_FAM6_ATOM_MOOREFIELD 0x5A /* Annidale */ |
61 | #define INTEL_FAM6_ATOM_GOLDMONT 0x5C | 61 | #define INTEL_FAM6_ATOM_GOLDMONT 0x5C |
62 | #define INTEL_FAM6_ATOM_DENVERTON 0x5F /* Goldmont Microserver */ | 62 | #define INTEL_FAM6_ATOM_DENVERTON 0x5F /* Goldmont Microserver */ |
63 | 63 | ||
diff --git a/arch/x86/include/asm/intel-mid.h b/arch/x86/include/asm/intel-mid.h index 9d6b097aa73d..5b6753d1f7f4 100644 --- a/arch/x86/include/asm/intel-mid.h +++ b/arch/x86/include/asm/intel-mid.h | |||
@@ -18,6 +18,8 @@ | |||
18 | extern int intel_mid_pci_init(void); | 18 | extern int intel_mid_pci_init(void); |
19 | extern int intel_mid_pci_set_power_state(struct pci_dev *pdev, pci_power_t state); | 19 | extern int intel_mid_pci_set_power_state(struct pci_dev *pdev, pci_power_t state); |
20 | 20 | ||
21 | extern void intel_mid_pwr_power_off(void); | ||
22 | |||
21 | #define INTEL_MID_PWR_LSS_OFFSET 4 | 23 | #define INTEL_MID_PWR_LSS_OFFSET 4 |
22 | #define INTEL_MID_PWR_LSS_TYPE (1 << 7) | 24 | #define INTEL_MID_PWR_LSS_TYPE (1 << 7) |
23 | 25 | ||
diff --git a/arch/x86/include/asm/intel_scu_ipc.h b/arch/x86/include/asm/intel_scu_ipc.h index 925b605eb5c6..4fb1d0abef95 100644 --- a/arch/x86/include/asm/intel_scu_ipc.h +++ b/arch/x86/include/asm/intel_scu_ipc.h | |||
@@ -3,6 +3,8 @@ | |||
3 | 3 | ||
4 | #include <linux/notifier.h> | 4 | #include <linux/notifier.h> |
5 | 5 | ||
6 | #define IPCMSG_COLD_OFF 0x80 /* Only for Tangier */ | ||
7 | |||
6 | #define IPCMSG_WARM_RESET 0xF0 | 8 | #define IPCMSG_WARM_RESET 0xF0 |
7 | #define IPCMSG_COLD_RESET 0xF1 | 9 | #define IPCMSG_COLD_RESET 0xF1 |
8 | #define IPCMSG_SOFT_RESET 0xF2 | 10 | #define IPCMSG_SOFT_RESET 0xF2 |
diff --git a/arch/x86/include/asm/uv/uv_bau.h b/arch/x86/include/asm/uv/uv_bau.h index cc44d926c17e..57ab86d94d64 100644 --- a/arch/x86/include/asm/uv/uv_bau.h +++ b/arch/x86/include/asm/uv/uv_bau.h | |||
@@ -49,14 +49,12 @@ | |||
49 | #define UV_NET_ENDPOINT_INTD (is_uv1_hub() ? \ | 49 | #define UV_NET_ENDPOINT_INTD (is_uv1_hub() ? \ |
50 | UV1_NET_ENDPOINT_INTD : UV2_NET_ENDPOINT_INTD) | 50 | UV1_NET_ENDPOINT_INTD : UV2_NET_ENDPOINT_INTD) |
51 | #define UV_DESC_PSHIFT 49 | 51 | #define UV_DESC_PSHIFT 49 |
52 | #define UV_PAYLOADQ_PNODE_SHIFT 49 | 52 | #define UV_PAYLOADQ_GNODE_SHIFT 49 |
53 | #define UV_PTC_BASENAME "sgi_uv/ptc_statistics" | 53 | #define UV_PTC_BASENAME "sgi_uv/ptc_statistics" |
54 | #define UV_BAU_BASENAME "sgi_uv/bau_tunables" | 54 | #define UV_BAU_BASENAME "sgi_uv/bau_tunables" |
55 | #define UV_BAU_TUNABLES_DIR "sgi_uv" | 55 | #define UV_BAU_TUNABLES_DIR "sgi_uv" |
56 | #define UV_BAU_TUNABLES_FILE "bau_tunables" | 56 | #define UV_BAU_TUNABLES_FILE "bau_tunables" |
57 | #define WHITESPACE " \t\n" | 57 | #define WHITESPACE " \t\n" |
58 | #define uv_mmask ((1UL << uv_hub_info->m_val) - 1) | ||
59 | #define uv_physnodeaddr(x) ((__pa((unsigned long)(x)) & uv_mmask)) | ||
60 | #define cpubit_isset(cpu, bau_local_cpumask) \ | 58 | #define cpubit_isset(cpu, bau_local_cpumask) \ |
61 | test_bit((cpu), (bau_local_cpumask).bits) | 59 | test_bit((cpu), (bau_local_cpumask).bits) |
62 | 60 | ||
@@ -387,6 +385,17 @@ struct uv2_3_bau_msg_header { | |||
387 | /* bits 127:120 */ | 385 | /* bits 127:120 */ |
388 | }; | 386 | }; |
389 | 387 | ||
388 | /* Abstracted BAU functions */ | ||
389 | struct bau_operations { | ||
390 | unsigned long (*read_l_sw_ack)(void); | ||
391 | unsigned long (*read_g_sw_ack)(int pnode); | ||
392 | unsigned long (*bau_gpa_to_offset)(unsigned long vaddr); | ||
393 | void (*write_l_sw_ack)(unsigned long mmr); | ||
394 | void (*write_g_sw_ack)(int pnode, unsigned long mmr); | ||
395 | void (*write_payload_first)(int pnode, unsigned long mmr); | ||
396 | void (*write_payload_last)(int pnode, unsigned long mmr); | ||
397 | }; | ||
398 | |||
390 | /* | 399 | /* |
391 | * The activation descriptor: | 400 | * The activation descriptor: |
392 | * The format of the message to send, plus all accompanying control | 401 | * The format of the message to send, plus all accompanying control |
@@ -655,6 +664,16 @@ static inline void write_gmmr_activation(int pnode, unsigned long mmr_image) | |||
655 | write_gmmr(pnode, UVH_LB_BAU_SB_ACTIVATION_CONTROL, mmr_image); | 664 | write_gmmr(pnode, UVH_LB_BAU_SB_ACTIVATION_CONTROL, mmr_image); |
656 | } | 665 | } |
657 | 666 | ||
667 | static inline void write_mmr_proc_payload_first(int pnode, unsigned long mmr_image) | ||
668 | { | ||
669 | write_gmmr(pnode, UV4H_LB_PROC_INTD_QUEUE_FIRST, mmr_image); | ||
670 | } | ||
671 | |||
672 | static inline void write_mmr_proc_payload_last(int pnode, unsigned long mmr_image) | ||
673 | { | ||
674 | write_gmmr(pnode, UV4H_LB_PROC_INTD_QUEUE_LAST, mmr_image); | ||
675 | } | ||
676 | |||
658 | static inline void write_mmr_payload_first(int pnode, unsigned long mmr_image) | 677 | static inline void write_mmr_payload_first(int pnode, unsigned long mmr_image) |
659 | { | 678 | { |
660 | write_gmmr(pnode, UVH_LB_BAU_INTD_PAYLOAD_QUEUE_FIRST, mmr_image); | 679 | write_gmmr(pnode, UVH_LB_BAU_INTD_PAYLOAD_QUEUE_FIRST, mmr_image); |
@@ -700,6 +719,26 @@ static inline unsigned long read_gmmr_sw_ack(int pnode) | |||
700 | return read_gmmr(pnode, UVH_LB_BAU_INTD_SOFTWARE_ACKNOWLEDGE); | 719 | return read_gmmr(pnode, UVH_LB_BAU_INTD_SOFTWARE_ACKNOWLEDGE); |
701 | } | 720 | } |
702 | 721 | ||
722 | static inline void write_mmr_proc_sw_ack(unsigned long mr) | ||
723 | { | ||
724 | uv_write_local_mmr(UV4H_LB_PROC_INTD_SOFT_ACK_CLEAR, mr); | ||
725 | } | ||
726 | |||
727 | static inline void write_gmmr_proc_sw_ack(int pnode, unsigned long mr) | ||
728 | { | ||
729 | write_gmmr(pnode, UV4H_LB_PROC_INTD_SOFT_ACK_CLEAR, mr); | ||
730 | } | ||
731 | |||
732 | static inline unsigned long read_mmr_proc_sw_ack(void) | ||
733 | { | ||
734 | return read_lmmr(UV4H_LB_PROC_INTD_SOFT_ACK_PENDING); | ||
735 | } | ||
736 | |||
737 | static inline unsigned long read_gmmr_proc_sw_ack(int pnode) | ||
738 | { | ||
739 | return read_gmmr(pnode, UV4H_LB_PROC_INTD_SOFT_ACK_PENDING); | ||
740 | } | ||
741 | |||
703 | static inline void write_mmr_data_config(int pnode, unsigned long mr) | 742 | static inline void write_mmr_data_config(int pnode, unsigned long mr) |
704 | { | 743 | { |
705 | uv_write_global_mmr64(pnode, UVH_BAU_DATA_CONFIG, mr); | 744 | uv_write_global_mmr64(pnode, UVH_BAU_DATA_CONFIG, mr); |
diff --git a/arch/x86/platform/Makefile b/arch/x86/platform/Makefile index 184842ef332e..3c3c19ea94df 100644 --- a/arch/x86/platform/Makefile +++ b/arch/x86/platform/Makefile | |||
@@ -8,6 +8,7 @@ obj-y += iris/ | |||
8 | obj-y += intel/ | 8 | obj-y += intel/ |
9 | obj-y += intel-mid/ | 9 | obj-y += intel-mid/ |
10 | obj-y += intel-quark/ | 10 | obj-y += intel-quark/ |
11 | obj-y += mellanox/ | ||
11 | obj-y += olpc/ | 12 | obj-y += olpc/ |
12 | obj-y += scx200/ | 13 | obj-y += scx200/ |
13 | obj-y += sfi/ | 14 | obj-y += sfi/ |
diff --git a/arch/x86/platform/atom/punit_atom_debug.c b/arch/x86/platform/atom/punit_atom_debug.c index 8ff7b9355416..d49d3be81953 100644 --- a/arch/x86/platform/atom/punit_atom_debug.c +++ b/arch/x86/platform/atom/punit_atom_debug.c | |||
@@ -155,7 +155,7 @@ static void punit_dbgfs_unregister(void) | |||
155 | 155 | ||
156 | static const struct x86_cpu_id intel_punit_cpu_ids[] = { | 156 | static const struct x86_cpu_id intel_punit_cpu_ids[] = { |
157 | ICPU(INTEL_FAM6_ATOM_SILVERMONT1, punit_device_byt), | 157 | ICPU(INTEL_FAM6_ATOM_SILVERMONT1, punit_device_byt), |
158 | ICPU(INTEL_FAM6_ATOM_MERRIFIELD1, punit_device_tng), | 158 | ICPU(INTEL_FAM6_ATOM_MERRIFIELD, punit_device_tng), |
159 | ICPU(INTEL_FAM6_ATOM_AIRMONT, punit_device_cht), | 159 | ICPU(INTEL_FAM6_ATOM_AIRMONT, punit_device_cht), |
160 | {} | 160 | {} |
161 | }; | 161 | }; |
diff --git a/arch/x86/platform/intel-mid/device_libs/Makefile b/arch/x86/platform/intel-mid/device_libs/Makefile index fc135bf70511..429d08be7848 100644 --- a/arch/x86/platform/intel-mid/device_libs/Makefile +++ b/arch/x86/platform/intel-mid/device_libs/Makefile | |||
@@ -1,5 +1,9 @@ | |||
1 | # Family-Level Interface Shim (FLIS) | 1 | # Family-Level Interface Shim (FLIS) |
2 | obj-$(subst m,y,$(CONFIG_PINCTRL_MERRIFIELD)) += platform_mrfld_pinctrl.o | 2 | obj-$(subst m,y,$(CONFIG_PINCTRL_MERRIFIELD)) += platform_mrfld_pinctrl.o |
3 | # SDHCI Devices | ||
4 | obj-$(subst m,y,$(CONFIG_MMC_SDHCI_PCI)) += platform_mrfld_sd.o | ||
5 | # WiFi | ||
6 | obj-$(subst m,y,$(CONFIG_BRCMFMAC_SDIO)) += platform_bcm43xx.o | ||
3 | # IPC Devices | 7 | # IPC Devices |
4 | obj-y += platform_ipc.o | 8 | obj-y += platform_ipc.o |
5 | obj-$(subst m,y,$(CONFIG_MFD_INTEL_MSIC)) += platform_msic.o | 9 | obj-$(subst m,y,$(CONFIG_MFD_INTEL_MSIC)) += platform_msic.o |
diff --git a/arch/x86/platform/intel-mid/device_libs/platform_bcm43xx.c b/arch/x86/platform/intel-mid/device_libs/platform_bcm43xx.c new file mode 100644 index 000000000000..4392c15ed9e0 --- /dev/null +++ b/arch/x86/platform/intel-mid/device_libs/platform_bcm43xx.c | |||
@@ -0,0 +1,95 @@ | |||
1 | /* | ||
2 | * platform_bcm43xx.c: bcm43xx platform data initilization file | ||
3 | * | ||
4 | * (C) Copyright 2016 Intel Corporation | ||
5 | * Author: Andy Shevchenko <andriy.shevchenko@linux.intel.com> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or | ||
8 | * modify it under the terms of the GNU General Public License | ||
9 | * as published by the Free Software Foundation; version 2 | ||
10 | * of the License. | ||
11 | */ | ||
12 | |||
13 | #include <linux/gpio.h> | ||
14 | #include <linux/platform_device.h> | ||
15 | #include <linux/regulator/machine.h> | ||
16 | #include <linux/regulator/fixed.h> | ||
17 | #include <linux/sfi.h> | ||
18 | |||
19 | #include <asm/intel-mid.h> | ||
20 | |||
21 | #define WLAN_SFI_GPIO_IRQ_NAME "WLAN-interrupt" | ||
22 | #define WLAN_SFI_GPIO_ENABLE_NAME "WLAN-enable" | ||
23 | |||
24 | #define WLAN_DEV_NAME "0000:00:01.3" | ||
25 | |||
26 | static struct regulator_consumer_supply bcm43xx_vmmc_supply = { | ||
27 | .dev_name = WLAN_DEV_NAME, | ||
28 | .supply = "vmmc", | ||
29 | }; | ||
30 | |||
31 | static struct regulator_init_data bcm43xx_vmmc_data = { | ||
32 | .constraints = { | ||
33 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, | ||
34 | }, | ||
35 | .num_consumer_supplies = 1, | ||
36 | .consumer_supplies = &bcm43xx_vmmc_supply, | ||
37 | }; | ||
38 | |||
39 | static struct fixed_voltage_config bcm43xx_vmmc = { | ||
40 | .supply_name = "bcm43xx-vmmc-regulator", | ||
41 | /* | ||
42 | * Announce 2.0V here to be compatible with SDIO specification. The | ||
43 | * real voltage and signaling are still 1.8V. | ||
44 | */ | ||
45 | .microvolts = 2000000, /* 1.8V */ | ||
46 | .gpio = -EINVAL, | ||
47 | .startup_delay = 250 * 1000, /* 250ms */ | ||
48 | .enable_high = 1, /* active high */ | ||
49 | .enabled_at_boot = 0, /* disabled at boot */ | ||
50 | .init_data = &bcm43xx_vmmc_data, | ||
51 | }; | ||
52 | |||
53 | static struct platform_device bcm43xx_vmmc_regulator = { | ||
54 | .name = "reg-fixed-voltage", | ||
55 | .id = PLATFORM_DEVID_AUTO, | ||
56 | .dev = { | ||
57 | .platform_data = &bcm43xx_vmmc, | ||
58 | }, | ||
59 | }; | ||
60 | |||
61 | static int __init bcm43xx_regulator_register(void) | ||
62 | { | ||
63 | int ret; | ||
64 | |||
65 | bcm43xx_vmmc.gpio = get_gpio_by_name(WLAN_SFI_GPIO_ENABLE_NAME); | ||
66 | ret = platform_device_register(&bcm43xx_vmmc_regulator); | ||
67 | if (ret) { | ||
68 | pr_err("%s: vmmc regulator register failed\n", __func__); | ||
69 | return ret; | ||
70 | } | ||
71 | |||
72 | return 0; | ||
73 | } | ||
74 | |||
75 | static void __init *bcm43xx_platform_data(void *info) | ||
76 | { | ||
77 | int ret; | ||
78 | |||
79 | ret = bcm43xx_regulator_register(); | ||
80 | if (ret) | ||
81 | return NULL; | ||
82 | |||
83 | pr_info("Using generic wifi platform data\n"); | ||
84 | |||
85 | /* For now it's empty */ | ||
86 | return NULL; | ||
87 | } | ||
88 | |||
89 | static const struct devs_id bcm43xx_clk_vmmc_dev_id __initconst = { | ||
90 | .name = "bcm43xx_clk_vmmc", | ||
91 | .type = SFI_DEV_TYPE_SD, | ||
92 | .get_platform_data = &bcm43xx_platform_data, | ||
93 | }; | ||
94 | |||
95 | sfi_device(bcm43xx_clk_vmmc_dev_id); | ||
diff --git a/arch/x86/platform/intel-mid/device_libs/platform_mrfld_sd.c b/arch/x86/platform/intel-mid/device_libs/platform_mrfld_sd.c new file mode 100644 index 000000000000..00c4a034ad93 --- /dev/null +++ b/arch/x86/platform/intel-mid/device_libs/platform_mrfld_sd.c | |||
@@ -0,0 +1,47 @@ | |||
1 | /* | ||
2 | * SDHCI platform data initilisation file | ||
3 | * | ||
4 | * (C) Copyright 2016 Intel Corporation | ||
5 | * Author: Andy Shevchenko <andriy.shevchenko@linux.intel.com> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or | ||
8 | * modify it under the terms of the GNU General Public License | ||
9 | * as published by the Free Software Foundation; version 2 | ||
10 | * of the License. | ||
11 | */ | ||
12 | |||
13 | #include <linux/init.h> | ||
14 | #include <linux/pci.h> | ||
15 | |||
16 | #include <linux/mmc/sdhci-pci-data.h> | ||
17 | |||
18 | #include <asm/intel-mid.h> | ||
19 | |||
20 | #define INTEL_MRFLD_SD 2 | ||
21 | #define INTEL_MRFLD_SD_CD_GPIO 77 | ||
22 | |||
23 | static struct sdhci_pci_data mrfld_sdhci_pci_data = { | ||
24 | .rst_n_gpio = -EINVAL, | ||
25 | .cd_gpio = INTEL_MRFLD_SD_CD_GPIO, | ||
26 | }; | ||
27 | |||
28 | static struct sdhci_pci_data * | ||
29 | mrfld_sdhci_pci_get_data(struct pci_dev *pdev, int slotno) | ||
30 | { | ||
31 | unsigned int func = PCI_FUNC(pdev->devfn); | ||
32 | |||
33 | if (func == INTEL_MRFLD_SD) | ||
34 | return &mrfld_sdhci_pci_data; | ||
35 | |||
36 | return NULL; | ||
37 | } | ||
38 | |||
39 | static int __init mrfld_sd_init(void) | ||
40 | { | ||
41 | if (intel_mid_identify_cpu() != INTEL_MID_CPU_CHIP_TANGIER) | ||
42 | return -ENODEV; | ||
43 | |||
44 | sdhci_pci_get_data = mrfld_sdhci_pci_get_data; | ||
45 | return 0; | ||
46 | } | ||
47 | arch_initcall(mrfld_sd_init); | ||
diff --git a/arch/x86/platform/intel-mid/intel-mid.c b/arch/x86/platform/intel-mid/intel-mid.c index ce119d2ba0d0..7850128f0026 100644 --- a/arch/x86/platform/intel-mid/intel-mid.c +++ b/arch/x86/platform/intel-mid/intel-mid.c | |||
@@ -70,6 +70,11 @@ EXPORT_SYMBOL_GPL(__intel_mid_cpu_chip); | |||
70 | 70 | ||
71 | static void intel_mid_power_off(void) | 71 | static void intel_mid_power_off(void) |
72 | { | 72 | { |
73 | /* Shut down South Complex via PWRMU */ | ||
74 | intel_mid_pwr_power_off(); | ||
75 | |||
76 | /* Only for Tangier, the rest will ignore this command */ | ||
77 | intel_scu_ipc_simple_command(IPCMSG_COLD_OFF, 1); | ||
73 | }; | 78 | }; |
74 | 79 | ||
75 | static void intel_mid_reboot(void) | 80 | static void intel_mid_reboot(void) |
diff --git a/arch/x86/platform/intel-mid/pwr.c b/arch/x86/platform/intel-mid/pwr.c index c901a3423772..5d3b45ad1c03 100644 --- a/arch/x86/platform/intel-mid/pwr.c +++ b/arch/x86/platform/intel-mid/pwr.c | |||
@@ -44,7 +44,19 @@ | |||
44 | /* Bits in PM_CMD */ | 44 | /* Bits in PM_CMD */ |
45 | #define PM_CMD_CMD(x) ((x) << 0) | 45 | #define PM_CMD_CMD(x) ((x) << 0) |
46 | #define PM_CMD_IOC (1 << 8) | 46 | #define PM_CMD_IOC (1 << 8) |
47 | #define PM_CMD_D3cold (1 << 21) | 47 | #define PM_CMD_CM_NOP (0 << 9) |
48 | #define PM_CMD_CM_IMMEDIATE (1 << 9) | ||
49 | #define PM_CMD_CM_DELAY (2 << 9) | ||
50 | #define PM_CMD_CM_TRIGGER (3 << 9) | ||
51 | |||
52 | /* System states */ | ||
53 | #define PM_CMD_SYS_STATE_S5 (5 << 16) | ||
54 | |||
55 | /* Trigger variants */ | ||
56 | #define PM_CMD_CFG_TRIGGER_NC (3 << 19) | ||
57 | |||
58 | /* Message to wait for TRIGGER_NC case */ | ||
59 | #define TRIGGER_NC_MSG_2 (2 << 22) | ||
48 | 60 | ||
49 | /* List of commands */ | 61 | /* List of commands */ |
50 | #define CMD_SET_CFG 0x01 | 62 | #define CMD_SET_CFG 0x01 |
@@ -137,7 +149,7 @@ static int mid_pwr_wait(struct mid_pwr *pwr) | |||
137 | 149 | ||
138 | static int mid_pwr_wait_for_cmd(struct mid_pwr *pwr, u8 cmd) | 150 | static int mid_pwr_wait_for_cmd(struct mid_pwr *pwr, u8 cmd) |
139 | { | 151 | { |
140 | writel(PM_CMD_CMD(cmd), pwr->regs + PM_CMD); | 152 | writel(PM_CMD_CMD(cmd) | PM_CMD_CM_IMMEDIATE, pwr->regs + PM_CMD); |
141 | return mid_pwr_wait(pwr); | 153 | return mid_pwr_wait(pwr); |
142 | } | 154 | } |
143 | 155 | ||
@@ -260,6 +272,20 @@ int intel_mid_pci_set_power_state(struct pci_dev *pdev, pci_power_t state) | |||
260 | } | 272 | } |
261 | EXPORT_SYMBOL_GPL(intel_mid_pci_set_power_state); | 273 | EXPORT_SYMBOL_GPL(intel_mid_pci_set_power_state); |
262 | 274 | ||
275 | void intel_mid_pwr_power_off(void) | ||
276 | { | ||
277 | struct mid_pwr *pwr = midpwr; | ||
278 | u32 cmd = PM_CMD_SYS_STATE_S5 | | ||
279 | PM_CMD_CMD(CMD_SET_CFG) | | ||
280 | PM_CMD_CM_TRIGGER | | ||
281 | PM_CMD_CFG_TRIGGER_NC | | ||
282 | TRIGGER_NC_MSG_2; | ||
283 | |||
284 | /* Send command to SCU */ | ||
285 | writel(cmd, pwr->regs + PM_CMD); | ||
286 | mid_pwr_wait(pwr); | ||
287 | } | ||
288 | |||
263 | int intel_mid_pwr_get_lss_id(struct pci_dev *pdev) | 289 | int intel_mid_pwr_get_lss_id(struct pci_dev *pdev) |
264 | { | 290 | { |
265 | int vndr; | 291 | int vndr; |
@@ -354,7 +380,7 @@ static int mid_pwr_probe(struct pci_dev *pdev, const struct pci_device_id *id) | |||
354 | return 0; | 380 | return 0; |
355 | } | 381 | } |
356 | 382 | ||
357 | static int mid_set_initial_state(struct mid_pwr *pwr) | 383 | static int mid_set_initial_state(struct mid_pwr *pwr, const u32 *states) |
358 | { | 384 | { |
359 | unsigned int i, j; | 385 | unsigned int i, j; |
360 | int ret; | 386 | int ret; |
@@ -379,10 +405,10 @@ static int mid_set_initial_state(struct mid_pwr *pwr) | |||
379 | * NOTE: The actual device mapping is provided by a platform at run | 405 | * NOTE: The actual device mapping is provided by a platform at run |
380 | * time using vendor capability of PCI configuration space. | 406 | * time using vendor capability of PCI configuration space. |
381 | */ | 407 | */ |
382 | mid_pwr_set_state(pwr, 0, 0xffffffff); | 408 | mid_pwr_set_state(pwr, 0, states[0]); |
383 | mid_pwr_set_state(pwr, 1, 0xffffffff); | 409 | mid_pwr_set_state(pwr, 1, states[1]); |
384 | mid_pwr_set_state(pwr, 2, 0xffffffff); | 410 | mid_pwr_set_state(pwr, 2, states[2]); |
385 | mid_pwr_set_state(pwr, 3, 0xffffffff); | 411 | mid_pwr_set_state(pwr, 3, states[3]); |
386 | 412 | ||
387 | /* Send command to SCU */ | 413 | /* Send command to SCU */ |
388 | ret = mid_pwr_wait_for_cmd(pwr, CMD_SET_CFG); | 414 | ret = mid_pwr_wait_for_cmd(pwr, CMD_SET_CFG); |
@@ -397,13 +423,41 @@ static int mid_set_initial_state(struct mid_pwr *pwr) | |||
397 | return 0; | 423 | return 0; |
398 | } | 424 | } |
399 | 425 | ||
400 | static const struct mid_pwr_device_info mid_info = { | 426 | static int pnw_set_initial_state(struct mid_pwr *pwr) |
401 | .set_initial_state = mid_set_initial_state, | 427 | { |
428 | /* On Penwell SRAM must stay powered on */ | ||
429 | const u32 states[] = { | ||
430 | 0xf00fffff, /* PM_SSC(0) */ | ||
431 | 0xffffffff, /* PM_SSC(1) */ | ||
432 | 0xffffffff, /* PM_SSC(2) */ | ||
433 | 0xffffffff, /* PM_SSC(3) */ | ||
434 | }; | ||
435 | return mid_set_initial_state(pwr, states); | ||
436 | } | ||
437 | |||
438 | static int tng_set_initial_state(struct mid_pwr *pwr) | ||
439 | { | ||
440 | const u32 states[] = { | ||
441 | 0xffffffff, /* PM_SSC(0) */ | ||
442 | 0xffffffff, /* PM_SSC(1) */ | ||
443 | 0xffffffff, /* PM_SSC(2) */ | ||
444 | 0xffffffff, /* PM_SSC(3) */ | ||
445 | }; | ||
446 | return mid_set_initial_state(pwr, states); | ||
447 | } | ||
448 | |||
449 | static const struct mid_pwr_device_info pnw_info = { | ||
450 | .set_initial_state = pnw_set_initial_state, | ||
451 | }; | ||
452 | |||
453 | static const struct mid_pwr_device_info tng_info = { | ||
454 | .set_initial_state = tng_set_initial_state, | ||
402 | }; | 455 | }; |
403 | 456 | ||
457 | /* This table should be in sync with the one in drivers/pci/pci-mid.c */ | ||
404 | static const struct pci_device_id mid_pwr_pci_ids[] = { | 458 | static const struct pci_device_id mid_pwr_pci_ids[] = { |
405 | { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_PENWELL), (kernel_ulong_t)&mid_info }, | 459 | { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_PENWELL), (kernel_ulong_t)&pnw_info }, |
406 | { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_TANGIER), (kernel_ulong_t)&mid_info }, | 460 | { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_TANGIER), (kernel_ulong_t)&tng_info }, |
407 | {} | 461 | {} |
408 | }; | 462 | }; |
409 | 463 | ||
diff --git a/arch/x86/platform/mellanox/Makefile b/arch/x86/platform/mellanox/Makefile new file mode 100644 index 000000000000..f43c93188a1d --- /dev/null +++ b/arch/x86/platform/mellanox/Makefile | |||
@@ -0,0 +1 @@ | |||
obj-$(CONFIG_MLX_PLATFORM) += mlx-platform.o | |||
diff --git a/arch/x86/platform/mellanox/mlx-platform.c b/arch/x86/platform/mellanox/mlx-platform.c new file mode 100644 index 000000000000..7dcfcca97399 --- /dev/null +++ b/arch/x86/platform/mellanox/mlx-platform.c | |||
@@ -0,0 +1,266 @@ | |||
1 | /* | ||
2 | * arch/x86/platform/mellanox/mlx-platform.c | ||
3 | * Copyright (c) 2016 Mellanox Technologies. All rights reserved. | ||
4 | * Copyright (c) 2016 Vadim Pasternak <vadimp@mellanox.com> | ||
5 | * | ||
6 | * Redistribution and use in source and binary forms, with or without | ||
7 | * modification, are permitted provided that the following conditions are met: | ||
8 | * | ||
9 | * 1. Redistributions of source code must retain the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer. | ||
11 | * 2. Redistributions in binary form must reproduce the above copyright | ||
12 | * notice, this list of conditions and the following disclaimer in the | ||
13 | * documentation and/or other materials provided with the distribution. | ||
14 | * 3. Neither the names of the copyright holders nor the names of its | ||
15 | * contributors may be used to endorse or promote products derived from | ||
16 | * this software without specific prior written permission. | ||
17 | * | ||
18 | * Alternatively, this software may be distributed under the terms of the | ||
19 | * GNU General Public License ("GPL") version 2 as published by the Free | ||
20 | * Software Foundation. | ||
21 | * | ||
22 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
23 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
24 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
25 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE | ||
26 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
27 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
28 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
29 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
30 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
31 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
32 | * POSSIBILITY OF SUCH DAMAGE. | ||
33 | */ | ||
34 | |||
35 | #include <linux/device.h> | ||
36 | #include <linux/dmi.h> | ||
37 | #include <linux/i2c.h> | ||
38 | #include <linux/i2c-mux.h> | ||
39 | #include <linux/module.h> | ||
40 | #include <linux/platform_device.h> | ||
41 | #include <linux/platform_data/i2c-mux-reg.h> | ||
42 | |||
43 | #define MLX_PLAT_DEVICE_NAME "mlxplat" | ||
44 | |||
45 | /* LPC bus IO offsets */ | ||
46 | #define MLXPLAT_CPLD_LPC_I2C_BASE_ADRR 0x2000 | ||
47 | #define MLXPLAT_CPLD_LPC_REG_BASE_ADRR 0x2500 | ||
48 | #define MLXPLAT_CPLD_LPC_IO_RANGE 0x100 | ||
49 | #define MLXPLAT_CPLD_LPC_I2C_CH1_OFF 0xdb | ||
50 | #define MLXPLAT_CPLD_LPC_I2C_CH2_OFF 0xda | ||
51 | #define MLXPLAT_CPLD_LPC_PIO_OFFSET 0x10000UL | ||
52 | #define MLXPLAT_CPLD_LPC_REG1 ((MLXPLAT_CPLD_LPC_REG_BASE_ADRR + \ | ||
53 | MLXPLAT_CPLD_LPC_I2C_CH1_OFF) | \ | ||
54 | MLXPLAT_CPLD_LPC_PIO_OFFSET) | ||
55 | #define MLXPLAT_CPLD_LPC_REG2 ((MLXPLAT_CPLD_LPC_REG_BASE_ADRR + \ | ||
56 | MLXPLAT_CPLD_LPC_I2C_CH2_OFF) | \ | ||
57 | MLXPLAT_CPLD_LPC_PIO_OFFSET) | ||
58 | |||
59 | /* Start channel numbers */ | ||
60 | #define MLXPLAT_CPLD_CH1 2 | ||
61 | #define MLXPLAT_CPLD_CH2 10 | ||
62 | |||
63 | /* Number of LPC attached MUX platform devices */ | ||
64 | #define MLXPLAT_CPLD_LPC_MUX_DEVS 2 | ||
65 | |||
66 | /* mlxplat_priv - platform private data | ||
67 | * @pdev_i2c - i2c controller platform device | ||
68 | * @pdev_mux - array of mux platform devices | ||
69 | */ | ||
70 | struct mlxplat_priv { | ||
71 | struct platform_device *pdev_i2c; | ||
72 | struct platform_device *pdev_mux[MLXPLAT_CPLD_LPC_MUX_DEVS]; | ||
73 | }; | ||
74 | |||
75 | /* Regions for LPC I2C controller and LPC base register space */ | ||
76 | static const struct resource mlxplat_lpc_resources[] = { | ||
77 | [0] = DEFINE_RES_NAMED(MLXPLAT_CPLD_LPC_I2C_BASE_ADRR, | ||
78 | MLXPLAT_CPLD_LPC_IO_RANGE, | ||
79 | "mlxplat_cpld_lpc_i2c_ctrl", IORESOURCE_IO), | ||
80 | [1] = DEFINE_RES_NAMED(MLXPLAT_CPLD_LPC_REG_BASE_ADRR, | ||
81 | MLXPLAT_CPLD_LPC_IO_RANGE, | ||
82 | "mlxplat_cpld_lpc_regs", | ||
83 | IORESOURCE_IO), | ||
84 | }; | ||
85 | |||
86 | /* Platform default channels */ | ||
87 | static const int mlxplat_default_channels[][8] = { | ||
88 | { | ||
89 | MLXPLAT_CPLD_CH1, MLXPLAT_CPLD_CH1 + 1, MLXPLAT_CPLD_CH1 + 2, | ||
90 | MLXPLAT_CPLD_CH1 + 3, MLXPLAT_CPLD_CH1 + 4, MLXPLAT_CPLD_CH1 + | ||
91 | 5, MLXPLAT_CPLD_CH1 + 6, MLXPLAT_CPLD_CH1 + 7 | ||
92 | }, | ||
93 | { | ||
94 | MLXPLAT_CPLD_CH2, MLXPLAT_CPLD_CH2 + 1, MLXPLAT_CPLD_CH2 + 2, | ||
95 | MLXPLAT_CPLD_CH2 + 3, MLXPLAT_CPLD_CH2 + 4, MLXPLAT_CPLD_CH2 + | ||
96 | 5, MLXPLAT_CPLD_CH2 + 6, MLXPLAT_CPLD_CH2 + 7 | ||
97 | }, | ||
98 | }; | ||
99 | |||
100 | /* Platform channels for MSN21xx system family */ | ||
101 | static const int mlxplat_msn21xx_channels[] = { 1, 2, 3, 4, 5, 6, 7, 8 }; | ||
102 | |||
103 | /* Platform mux data */ | ||
104 | static struct i2c_mux_reg_platform_data mlxplat_mux_data[] = { | ||
105 | { | ||
106 | .parent = 1, | ||
107 | .base_nr = MLXPLAT_CPLD_CH1, | ||
108 | .write_only = 1, | ||
109 | .reg = (void __iomem *)MLXPLAT_CPLD_LPC_REG1, | ||
110 | .reg_size = 1, | ||
111 | .idle_in_use = 1, | ||
112 | }, | ||
113 | { | ||
114 | .parent = 1, | ||
115 | .base_nr = MLXPLAT_CPLD_CH2, | ||
116 | .write_only = 1, | ||
117 | .reg = (void __iomem *)MLXPLAT_CPLD_LPC_REG2, | ||
118 | .reg_size = 1, | ||
119 | .idle_in_use = 1, | ||
120 | }, | ||
121 | |||
122 | }; | ||
123 | |||
124 | static struct platform_device *mlxplat_dev; | ||
125 | |||
126 | static int __init mlxplat_dmi_default_matched(const struct dmi_system_id *dmi) | ||
127 | { | ||
128 | int i; | ||
129 | |||
130 | for (i = 0; i < ARRAY_SIZE(mlxplat_mux_data); i++) { | ||
131 | mlxplat_mux_data[i].values = mlxplat_default_channels[i]; | ||
132 | mlxplat_mux_data[i].n_values = | ||
133 | ARRAY_SIZE(mlxplat_default_channels[i]); | ||
134 | } | ||
135 | |||
136 | return 1; | ||
137 | }; | ||
138 | |||
139 | static int __init mlxplat_dmi_msn21xx_matched(const struct dmi_system_id *dmi) | ||
140 | { | ||
141 | int i; | ||
142 | |||
143 | for (i = 0; i < ARRAY_SIZE(mlxplat_mux_data); i++) { | ||
144 | mlxplat_mux_data[i].values = mlxplat_msn21xx_channels; | ||
145 | mlxplat_mux_data[i].n_values = | ||
146 | ARRAY_SIZE(mlxplat_msn21xx_channels); | ||
147 | } | ||
148 | |||
149 | return 1; | ||
150 | }; | ||
151 | |||
152 | static struct dmi_system_id mlxplat_dmi_table[] __initdata = { | ||
153 | { | ||
154 | .callback = mlxplat_dmi_default_matched, | ||
155 | .matches = { | ||
156 | DMI_MATCH(DMI_BOARD_VENDOR, "Mellanox Technologies"), | ||
157 | DMI_MATCH(DMI_PRODUCT_NAME, "MSN24"), | ||
158 | }, | ||
159 | }, | ||
160 | { | ||
161 | .callback = mlxplat_dmi_default_matched, | ||
162 | .matches = { | ||
163 | DMI_MATCH(DMI_BOARD_VENDOR, "Mellanox Technologies"), | ||
164 | DMI_MATCH(DMI_PRODUCT_NAME, "MSN27"), | ||
165 | }, | ||
166 | }, | ||
167 | { | ||
168 | .callback = mlxplat_dmi_default_matched, | ||
169 | .matches = { | ||
170 | DMI_MATCH(DMI_BOARD_VENDOR, "Mellanox Technologies"), | ||
171 | DMI_MATCH(DMI_PRODUCT_NAME, "MSB"), | ||
172 | }, | ||
173 | }, | ||
174 | { | ||
175 | .callback = mlxplat_dmi_default_matched, | ||
176 | .matches = { | ||
177 | DMI_MATCH(DMI_BOARD_VENDOR, "Mellanox Technologies"), | ||
178 | DMI_MATCH(DMI_PRODUCT_NAME, "MSX"), | ||
179 | }, | ||
180 | }, | ||
181 | { | ||
182 | .callback = mlxplat_dmi_msn21xx_matched, | ||
183 | .matches = { | ||
184 | DMI_MATCH(DMI_BOARD_VENDOR, "Mellanox Technologies"), | ||
185 | DMI_MATCH(DMI_PRODUCT_NAME, "MSN21"), | ||
186 | }, | ||
187 | }, | ||
188 | { } | ||
189 | }; | ||
190 | |||
191 | static int __init mlxplat_init(void) | ||
192 | { | ||
193 | struct mlxplat_priv *priv; | ||
194 | int i, err; | ||
195 | |||
196 | if (!dmi_check_system(mlxplat_dmi_table)) | ||
197 | return -ENODEV; | ||
198 | |||
199 | mlxplat_dev = platform_device_register_simple(MLX_PLAT_DEVICE_NAME, -1, | ||
200 | mlxplat_lpc_resources, | ||
201 | ARRAY_SIZE(mlxplat_lpc_resources)); | ||
202 | |||
203 | if (IS_ERR(mlxplat_dev)) | ||
204 | return PTR_ERR(mlxplat_dev); | ||
205 | |||
206 | priv = devm_kzalloc(&mlxplat_dev->dev, sizeof(struct mlxplat_priv), | ||
207 | GFP_KERNEL); | ||
208 | if (!priv) { | ||
209 | err = -ENOMEM; | ||
210 | goto fail_alloc; | ||
211 | } | ||
212 | platform_set_drvdata(mlxplat_dev, priv); | ||
213 | |||
214 | priv->pdev_i2c = platform_device_register_simple("i2c_mlxcpld", -1, | ||
215 | NULL, 0); | ||
216 | if (IS_ERR(priv->pdev_i2c)) { | ||
217 | err = PTR_ERR(priv->pdev_i2c); | ||
218 | goto fail_alloc; | ||
219 | }; | ||
220 | |||
221 | for (i = 0; i < ARRAY_SIZE(mlxplat_mux_data); i++) { | ||
222 | priv->pdev_mux[i] = platform_device_register_resndata( | ||
223 | &mlxplat_dev->dev, | ||
224 | "i2c-mux-reg", i, NULL, | ||
225 | 0, &mlxplat_mux_data[i], | ||
226 | sizeof(mlxplat_mux_data[i])); | ||
227 | if (IS_ERR(priv->pdev_mux[i])) { | ||
228 | err = PTR_ERR(priv->pdev_mux[i]); | ||
229 | goto fail_platform_mux_register; | ||
230 | } | ||
231 | } | ||
232 | |||
233 | return 0; | ||
234 | |||
235 | fail_platform_mux_register: | ||
236 | for (i--; i > 0 ; i--) | ||
237 | platform_device_unregister(priv->pdev_mux[i]); | ||
238 | platform_device_unregister(priv->pdev_i2c); | ||
239 | fail_alloc: | ||
240 | platform_device_unregister(mlxplat_dev); | ||
241 | |||
242 | return err; | ||
243 | } | ||
244 | module_init(mlxplat_init); | ||
245 | |||
246 | static void __exit mlxplat_exit(void) | ||
247 | { | ||
248 | struct mlxplat_priv *priv = platform_get_drvdata(mlxplat_dev); | ||
249 | int i; | ||
250 | |||
251 | for (i = ARRAY_SIZE(mlxplat_mux_data) - 1; i >= 0 ; i--) | ||
252 | platform_device_unregister(priv->pdev_mux[i]); | ||
253 | |||
254 | platform_device_unregister(priv->pdev_i2c); | ||
255 | platform_device_unregister(mlxplat_dev); | ||
256 | } | ||
257 | module_exit(mlxplat_exit); | ||
258 | |||
259 | MODULE_AUTHOR("Vadim Pasternak (vadimp@mellanox.com)"); | ||
260 | MODULE_DESCRIPTION("Mellanox platform driver"); | ||
261 | MODULE_LICENSE("Dual BSD/GPL"); | ||
262 | MODULE_ALIAS("dmi:*:*Mellanox*:MSN24*:"); | ||
263 | MODULE_ALIAS("dmi:*:*Mellanox*:MSN27*:"); | ||
264 | MODULE_ALIAS("dmi:*:*Mellanox*:MSB*:"); | ||
265 | MODULE_ALIAS("dmi:*:*Mellanox*:MSX*:"); | ||
266 | MODULE_ALIAS("dmi:*:*Mellanox*:MSN21*:"); | ||
diff --git a/arch/x86/platform/uv/tlb_uv.c b/arch/x86/platform/uv/tlb_uv.c index 276e1b7bba3c..9e42842e924a 100644 --- a/arch/x86/platform/uv/tlb_uv.c +++ b/arch/x86/platform/uv/tlb_uv.c | |||
@@ -24,6 +24,29 @@ | |||
24 | #include <asm/irq_vectors.h> | 24 | #include <asm/irq_vectors.h> |
25 | #include <asm/timer.h> | 25 | #include <asm/timer.h> |
26 | 26 | ||
27 | static struct bau_operations ops; | ||
28 | |||
29 | static struct bau_operations uv123_bau_ops = { | ||
30 | .bau_gpa_to_offset = uv_gpa_to_offset, | ||
31 | .read_l_sw_ack = read_mmr_sw_ack, | ||
32 | .read_g_sw_ack = read_gmmr_sw_ack, | ||
33 | .write_l_sw_ack = write_mmr_sw_ack, | ||
34 | .write_g_sw_ack = write_gmmr_sw_ack, | ||
35 | .write_payload_first = write_mmr_payload_first, | ||
36 | .write_payload_last = write_mmr_payload_last, | ||
37 | }; | ||
38 | |||
39 | static struct bau_operations uv4_bau_ops = { | ||
40 | .bau_gpa_to_offset = uv_gpa_to_soc_phys_ram, | ||
41 | .read_l_sw_ack = read_mmr_proc_sw_ack, | ||
42 | .read_g_sw_ack = read_gmmr_proc_sw_ack, | ||
43 | .write_l_sw_ack = write_mmr_proc_sw_ack, | ||
44 | .write_g_sw_ack = write_gmmr_proc_sw_ack, | ||
45 | .write_payload_first = write_mmr_proc_payload_first, | ||
46 | .write_payload_last = write_mmr_proc_payload_last, | ||
47 | }; | ||
48 | |||
49 | |||
27 | /* timeouts in nanoseconds (indexed by UVH_AGING_PRESCALE_SEL urgency7 30:28) */ | 50 | /* timeouts in nanoseconds (indexed by UVH_AGING_PRESCALE_SEL urgency7 30:28) */ |
28 | static int timeout_base_ns[] = { | 51 | static int timeout_base_ns[] = { |
29 | 20, | 52 | 20, |
@@ -55,16 +78,16 @@ static int congested_reps = CONGESTED_REPS; | |||
55 | static int disabled_period = DISABLED_PERIOD; | 78 | static int disabled_period = DISABLED_PERIOD; |
56 | 79 | ||
57 | static struct tunables tunables[] = { | 80 | static struct tunables tunables[] = { |
58 | {&max_concurr, MAX_BAU_CONCURRENT}, /* must be [0] */ | 81 | {&max_concurr, MAX_BAU_CONCURRENT}, /* must be [0] */ |
59 | {&plugged_delay, PLUGGED_DELAY}, | 82 | {&plugged_delay, PLUGGED_DELAY}, |
60 | {&plugsb4reset, PLUGSB4RESET}, | 83 | {&plugsb4reset, PLUGSB4RESET}, |
61 | {&timeoutsb4reset, TIMEOUTSB4RESET}, | 84 | {&timeoutsb4reset, TIMEOUTSB4RESET}, |
62 | {&ipi_reset_limit, IPI_RESET_LIMIT}, | 85 | {&ipi_reset_limit, IPI_RESET_LIMIT}, |
63 | {&complete_threshold, COMPLETE_THRESHOLD}, | 86 | {&complete_threshold, COMPLETE_THRESHOLD}, |
64 | {&congested_respns_us, CONGESTED_RESPONSE_US}, | 87 | {&congested_respns_us, CONGESTED_RESPONSE_US}, |
65 | {&congested_reps, CONGESTED_REPS}, | 88 | {&congested_reps, CONGESTED_REPS}, |
66 | {&disabled_period, DISABLED_PERIOD}, | 89 | {&disabled_period, DISABLED_PERIOD}, |
67 | {&giveup_limit, GIVEUP_LIMIT} | 90 | {&giveup_limit, GIVEUP_LIMIT} |
68 | }; | 91 | }; |
69 | 92 | ||
70 | static struct dentry *tunables_dir; | 93 | static struct dentry *tunables_dir; |
@@ -216,7 +239,7 @@ static void reply_to_message(struct msg_desc *mdp, struct bau_control *bcp, | |||
216 | msg = mdp->msg; | 239 | msg = mdp->msg; |
217 | if (!msg->canceled && do_acknowledge) { | 240 | if (!msg->canceled && do_acknowledge) { |
218 | dw = (msg->swack_vec << UV_SW_ACK_NPENDING) | msg->swack_vec; | 241 | dw = (msg->swack_vec << UV_SW_ACK_NPENDING) | msg->swack_vec; |
219 | write_mmr_sw_ack(dw); | 242 | ops.write_l_sw_ack(dw); |
220 | } | 243 | } |
221 | msg->replied_to = 1; | 244 | msg->replied_to = 1; |
222 | msg->swack_vec = 0; | 245 | msg->swack_vec = 0; |
@@ -252,7 +275,7 @@ static void bau_process_retry_msg(struct msg_desc *mdp, | |||
252 | msg->swack_vec) == 0) && | 275 | msg->swack_vec) == 0) && |
253 | (msg2->sending_cpu == msg->sending_cpu) && | 276 | (msg2->sending_cpu == msg->sending_cpu) && |
254 | (msg2->msg_type != MSG_NOOP)) { | 277 | (msg2->msg_type != MSG_NOOP)) { |
255 | mmr = read_mmr_sw_ack(); | 278 | mmr = ops.read_l_sw_ack(); |
256 | msg_res = msg2->swack_vec; | 279 | msg_res = msg2->swack_vec; |
257 | /* | 280 | /* |
258 | * This is a message retry; clear the resources held | 281 | * This is a message retry; clear the resources held |
@@ -270,7 +293,7 @@ static void bau_process_retry_msg(struct msg_desc *mdp, | |||
270 | stat->d_canceled++; | 293 | stat->d_canceled++; |
271 | cancel_count++; | 294 | cancel_count++; |
272 | mr = (msg_res << UV_SW_ACK_NPENDING) | msg_res; | 295 | mr = (msg_res << UV_SW_ACK_NPENDING) | msg_res; |
273 | write_mmr_sw_ack(mr); | 296 | ops.write_l_sw_ack(mr); |
274 | } | 297 | } |
275 | } | 298 | } |
276 | } | 299 | } |
@@ -403,12 +426,12 @@ static void do_reset(void *ptr) | |||
403 | /* | 426 | /* |
404 | * only reset the resource if it is still pending | 427 | * only reset the resource if it is still pending |
405 | */ | 428 | */ |
406 | mmr = read_mmr_sw_ack(); | 429 | mmr = ops.read_l_sw_ack(); |
407 | msg_res = msg->swack_vec; | 430 | msg_res = msg->swack_vec; |
408 | mr = (msg_res << UV_SW_ACK_NPENDING) | msg_res; | 431 | mr = (msg_res << UV_SW_ACK_NPENDING) | msg_res; |
409 | if (mmr & msg_res) { | 432 | if (mmr & msg_res) { |
410 | stat->d_rcanceled++; | 433 | stat->d_rcanceled++; |
411 | write_mmr_sw_ack(mr); | 434 | ops.write_l_sw_ack(mr); |
412 | } | 435 | } |
413 | } | 436 | } |
414 | } | 437 | } |
@@ -1198,7 +1221,7 @@ void process_uv2_message(struct msg_desc *mdp, struct bau_control *bcp) | |||
1198 | struct bau_pq_entry *msg = mdp->msg; | 1221 | struct bau_pq_entry *msg = mdp->msg; |
1199 | struct bau_pq_entry *other_msg; | 1222 | struct bau_pq_entry *other_msg; |
1200 | 1223 | ||
1201 | mmr_image = read_mmr_sw_ack(); | 1224 | mmr_image = ops.read_l_sw_ack(); |
1202 | swack_vec = msg->swack_vec; | 1225 | swack_vec = msg->swack_vec; |
1203 | 1226 | ||
1204 | if ((swack_vec & mmr_image) == 0) { | 1227 | if ((swack_vec & mmr_image) == 0) { |
@@ -1427,7 +1450,7 @@ static int ptc_seq_show(struct seq_file *file, void *data) | |||
1427 | /* destination side statistics */ | 1450 | /* destination side statistics */ |
1428 | seq_printf(file, | 1451 | seq_printf(file, |
1429 | "%lx %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld\n", | 1452 | "%lx %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld\n", |
1430 | read_gmmr_sw_ack(uv_cpu_to_pnode(cpu)), | 1453 | ops.read_g_sw_ack(uv_cpu_to_pnode(cpu)), |
1431 | stat->d_requestee, cycles_2_us(stat->d_time), | 1454 | stat->d_requestee, cycles_2_us(stat->d_time), |
1432 | stat->d_alltlb, stat->d_onetlb, stat->d_multmsg, | 1455 | stat->d_alltlb, stat->d_onetlb, stat->d_multmsg, |
1433 | stat->d_nomsg, stat->d_retries, stat->d_canceled, | 1456 | stat->d_nomsg, stat->d_retries, stat->d_canceled, |
@@ -1493,16 +1516,16 @@ static ssize_t ptc_proc_write(struct file *file, const char __user *user, | |||
1493 | } | 1516 | } |
1494 | 1517 | ||
1495 | if (kstrtol(optstr, 10, &input_arg) < 0) { | 1518 | if (kstrtol(optstr, 10, &input_arg) < 0) { |
1496 | printk(KERN_DEBUG "%s is invalid\n", optstr); | 1519 | pr_debug("%s is invalid\n", optstr); |
1497 | return -EINVAL; | 1520 | return -EINVAL; |
1498 | } | 1521 | } |
1499 | 1522 | ||
1500 | if (input_arg == 0) { | 1523 | if (input_arg == 0) { |
1501 | elements = ARRAY_SIZE(stat_description); | 1524 | elements = ARRAY_SIZE(stat_description); |
1502 | printk(KERN_DEBUG "# cpu: cpu number\n"); | 1525 | pr_debug("# cpu: cpu number\n"); |
1503 | printk(KERN_DEBUG "Sender statistics:\n"); | 1526 | pr_debug("Sender statistics:\n"); |
1504 | for (i = 0; i < elements; i++) | 1527 | for (i = 0; i < elements; i++) |
1505 | printk(KERN_DEBUG "%s\n", stat_description[i]); | 1528 | pr_debug("%s\n", stat_description[i]); |
1506 | } else if (input_arg == -1) { | 1529 | } else if (input_arg == -1) { |
1507 | for_each_present_cpu(cpu) { | 1530 | for_each_present_cpu(cpu) { |
1508 | stat = &per_cpu(ptcstats, cpu); | 1531 | stat = &per_cpu(ptcstats, cpu); |
@@ -1550,7 +1573,7 @@ static int parse_tunables_write(struct bau_control *bcp, char *instr, | |||
1550 | break; | 1573 | break; |
1551 | } | 1574 | } |
1552 | if (cnt != e) { | 1575 | if (cnt != e) { |
1553 | printk(KERN_INFO "bau tunable error: should be %d values\n", e); | 1576 | pr_info("bau tunable error: should be %d values\n", e); |
1554 | return -EINVAL; | 1577 | return -EINVAL; |
1555 | } | 1578 | } |
1556 | 1579 | ||
@@ -1567,7 +1590,7 @@ static int parse_tunables_write(struct bau_control *bcp, char *instr, | |||
1567 | continue; | 1590 | continue; |
1568 | } | 1591 | } |
1569 | if (val < 1 || val > bcp->cpus_in_uvhub) { | 1592 | if (val < 1 || val > bcp->cpus_in_uvhub) { |
1570 | printk(KERN_DEBUG | 1593 | pr_debug( |
1571 | "Error: BAU max concurrent %d is invalid\n", | 1594 | "Error: BAU max concurrent %d is invalid\n", |
1572 | val); | 1595 | val); |
1573 | return -EINVAL; | 1596 | return -EINVAL; |
@@ -1615,17 +1638,17 @@ static ssize_t tunables_write(struct file *file, const char __user *user, | |||
1615 | 1638 | ||
1616 | for_each_present_cpu(cpu) { | 1639 | for_each_present_cpu(cpu) { |
1617 | bcp = &per_cpu(bau_control, cpu); | 1640 | bcp = &per_cpu(bau_control, cpu); |
1618 | bcp->max_concurr = max_concurr; | 1641 | bcp->max_concurr = max_concurr; |
1619 | bcp->max_concurr_const = max_concurr; | 1642 | bcp->max_concurr_const = max_concurr; |
1620 | bcp->plugged_delay = plugged_delay; | 1643 | bcp->plugged_delay = plugged_delay; |
1621 | bcp->plugsb4reset = plugsb4reset; | 1644 | bcp->plugsb4reset = plugsb4reset; |
1622 | bcp->timeoutsb4reset = timeoutsb4reset; | 1645 | bcp->timeoutsb4reset = timeoutsb4reset; |
1623 | bcp->ipi_reset_limit = ipi_reset_limit; | 1646 | bcp->ipi_reset_limit = ipi_reset_limit; |
1624 | bcp->complete_threshold = complete_threshold; | 1647 | bcp->complete_threshold = complete_threshold; |
1625 | bcp->cong_response_us = congested_respns_us; | 1648 | bcp->cong_response_us = congested_respns_us; |
1626 | bcp->cong_reps = congested_reps; | 1649 | bcp->cong_reps = congested_reps; |
1627 | bcp->disabled_period = sec_2_cycles(disabled_period); | 1650 | bcp->disabled_period = sec_2_cycles(disabled_period); |
1628 | bcp->giveup_limit = giveup_limit; | 1651 | bcp->giveup_limit = giveup_limit; |
1629 | } | 1652 | } |
1630 | return count; | 1653 | return count; |
1631 | } | 1654 | } |
@@ -1672,21 +1695,21 @@ static int __init uv_ptc_init(void) | |||
1672 | proc_uv_ptc = proc_create(UV_PTC_BASENAME, 0444, NULL, | 1695 | proc_uv_ptc = proc_create(UV_PTC_BASENAME, 0444, NULL, |
1673 | &proc_uv_ptc_operations); | 1696 | &proc_uv_ptc_operations); |
1674 | if (!proc_uv_ptc) { | 1697 | if (!proc_uv_ptc) { |
1675 | printk(KERN_ERR "unable to create %s proc entry\n", | 1698 | pr_err("unable to create %s proc entry\n", |
1676 | UV_PTC_BASENAME); | 1699 | UV_PTC_BASENAME); |
1677 | return -EINVAL; | 1700 | return -EINVAL; |
1678 | } | 1701 | } |
1679 | 1702 | ||
1680 | tunables_dir = debugfs_create_dir(UV_BAU_TUNABLES_DIR, NULL); | 1703 | tunables_dir = debugfs_create_dir(UV_BAU_TUNABLES_DIR, NULL); |
1681 | if (!tunables_dir) { | 1704 | if (!tunables_dir) { |
1682 | printk(KERN_ERR "unable to create debugfs directory %s\n", | 1705 | pr_err("unable to create debugfs directory %s\n", |
1683 | UV_BAU_TUNABLES_DIR); | 1706 | UV_BAU_TUNABLES_DIR); |
1684 | return -EINVAL; | 1707 | return -EINVAL; |
1685 | } | 1708 | } |
1686 | tunables_file = debugfs_create_file(UV_BAU_TUNABLES_FILE, 0600, | 1709 | tunables_file = debugfs_create_file(UV_BAU_TUNABLES_FILE, 0600, |
1687 | tunables_dir, NULL, &tunables_fops); | 1710 | tunables_dir, NULL, &tunables_fops); |
1688 | if (!tunables_file) { | 1711 | if (!tunables_file) { |
1689 | printk(KERN_ERR "unable to create debugfs file %s\n", | 1712 | pr_err("unable to create debugfs file %s\n", |
1690 | UV_BAU_TUNABLES_FILE); | 1713 | UV_BAU_TUNABLES_FILE); |
1691 | return -EINVAL; | 1714 | return -EINVAL; |
1692 | } | 1715 | } |
@@ -1721,7 +1744,7 @@ static void activation_descriptor_init(int node, int pnode, int base_pnode) | |||
1721 | 1744 | ||
1722 | gpa = uv_gpa(bau_desc); | 1745 | gpa = uv_gpa(bau_desc); |
1723 | n = uv_gpa_to_gnode(gpa); | 1746 | n = uv_gpa_to_gnode(gpa); |
1724 | m = uv_gpa_to_offset(gpa); | 1747 | m = ops.bau_gpa_to_offset(gpa); |
1725 | if (is_uv1_hub()) | 1748 | if (is_uv1_hub()) |
1726 | uv1 = 1; | 1749 | uv1 = 1; |
1727 | 1750 | ||
@@ -1736,7 +1759,7 @@ static void activation_descriptor_init(int node, int pnode, int base_pnode) | |||
1736 | memset(bd2, 0, sizeof(struct bau_desc)); | 1759 | memset(bd2, 0, sizeof(struct bau_desc)); |
1737 | if (uv1) { | 1760 | if (uv1) { |
1738 | uv1_hdr = &bd2->header.uv1_hdr; | 1761 | uv1_hdr = &bd2->header.uv1_hdr; |
1739 | uv1_hdr->swack_flag = 1; | 1762 | uv1_hdr->swack_flag = 1; |
1740 | /* | 1763 | /* |
1741 | * The base_dest_nasid set in the message header | 1764 | * The base_dest_nasid set in the message header |
1742 | * is the nasid of the first uvhub in the partition. | 1765 | * is the nasid of the first uvhub in the partition. |
@@ -1745,10 +1768,10 @@ static void activation_descriptor_init(int node, int pnode, int base_pnode) | |||
1745 | * if nasid striding is being used. | 1768 | * if nasid striding is being used. |
1746 | */ | 1769 | */ |
1747 | uv1_hdr->base_dest_nasid = | 1770 | uv1_hdr->base_dest_nasid = |
1748 | UV_PNODE_TO_NASID(base_pnode); | 1771 | UV_PNODE_TO_NASID(base_pnode); |
1749 | uv1_hdr->dest_subnodeid = UV_LB_SUBNODEID; | 1772 | uv1_hdr->dest_subnodeid = UV_LB_SUBNODEID; |
1750 | uv1_hdr->command = UV_NET_ENDPOINT_INTD; | 1773 | uv1_hdr->command = UV_NET_ENDPOINT_INTD; |
1751 | uv1_hdr->int_both = 1; | 1774 | uv1_hdr->int_both = 1; |
1752 | /* | 1775 | /* |
1753 | * all others need to be set to zero: | 1776 | * all others need to be set to zero: |
1754 | * fairness chaining multilevel count replied_to | 1777 | * fairness chaining multilevel count replied_to |
@@ -1759,11 +1782,11 @@ static void activation_descriptor_init(int node, int pnode, int base_pnode) | |||
1759 | * uses native mode for selective broadcasts. | 1782 | * uses native mode for selective broadcasts. |
1760 | */ | 1783 | */ |
1761 | uv2_3_hdr = &bd2->header.uv2_3_hdr; | 1784 | uv2_3_hdr = &bd2->header.uv2_3_hdr; |
1762 | uv2_3_hdr->swack_flag = 1; | 1785 | uv2_3_hdr->swack_flag = 1; |
1763 | uv2_3_hdr->base_dest_nasid = | 1786 | uv2_3_hdr->base_dest_nasid = |
1764 | UV_PNODE_TO_NASID(base_pnode); | 1787 | UV_PNODE_TO_NASID(base_pnode); |
1765 | uv2_3_hdr->dest_subnodeid = UV_LB_SUBNODEID; | 1788 | uv2_3_hdr->dest_subnodeid = UV_LB_SUBNODEID; |
1766 | uv2_3_hdr->command = UV_NET_ENDPOINT_INTD; | 1789 | uv2_3_hdr->command = UV_NET_ENDPOINT_INTD; |
1767 | } | 1790 | } |
1768 | } | 1791 | } |
1769 | for_each_present_cpu(cpu) { | 1792 | for_each_present_cpu(cpu) { |
@@ -1786,10 +1809,7 @@ static void pq_init(int node, int pnode) | |||
1786 | size_t plsize; | 1809 | size_t plsize; |
1787 | char *cp; | 1810 | char *cp; |
1788 | void *vp; | 1811 | void *vp; |
1789 | unsigned long pn; | 1812 | unsigned long gnode, first, last, tail; |
1790 | unsigned long first; | ||
1791 | unsigned long pn_first; | ||
1792 | unsigned long last; | ||
1793 | struct bau_pq_entry *pqp; | 1813 | struct bau_pq_entry *pqp; |
1794 | struct bau_control *bcp; | 1814 | struct bau_control *bcp; |
1795 | 1815 | ||
@@ -1810,17 +1830,25 @@ static void pq_init(int node, int pnode) | |||
1810 | bcp->bau_msg_head = pqp; | 1830 | bcp->bau_msg_head = pqp; |
1811 | bcp->queue_last = pqp + (DEST_Q_SIZE - 1); | 1831 | bcp->queue_last = pqp + (DEST_Q_SIZE - 1); |
1812 | } | 1832 | } |
1833 | |||
1834 | first = ops.bau_gpa_to_offset(uv_gpa(pqp)); | ||
1835 | last = ops.bau_gpa_to_offset(uv_gpa(pqp + (DEST_Q_SIZE - 1))); | ||
1836 | |||
1813 | /* | 1837 | /* |
1814 | * need the gnode of where the memory was really allocated | 1838 | * Pre UV4, the gnode is required to locate the payload queue |
1839 | * and the payload queue tail must be maintained by the kernel. | ||
1815 | */ | 1840 | */ |
1816 | pn = uv_gpa_to_gnode(uv_gpa(pqp)); | 1841 | bcp = &per_cpu(bau_control, smp_processor_id()); |
1817 | first = uv_physnodeaddr(pqp); | 1842 | if (bcp->uvhub_version <= 3) { |
1818 | pn_first = ((unsigned long)pn << UV_PAYLOADQ_PNODE_SHIFT) | first; | 1843 | tail = first; |
1819 | last = uv_physnodeaddr(pqp + (DEST_Q_SIZE - 1)); | 1844 | gnode = uv_gpa_to_gnode(uv_gpa(pqp)); |
1820 | write_mmr_payload_first(pnode, pn_first); | 1845 | first = (gnode << UV_PAYLOADQ_GNODE_SHIFT) | tail; |
1821 | write_mmr_payload_tail(pnode, first); | 1846 | write_mmr_payload_tail(pnode, tail); |
1822 | write_mmr_payload_last(pnode, last); | 1847 | } |
1823 | write_gmmr_sw_ack(pnode, 0xffffUL); | 1848 | |
1849 | ops.write_payload_first(pnode, first); | ||
1850 | ops.write_payload_last(pnode, last); | ||
1851 | ops.write_g_sw_ack(pnode, 0xffffUL); | ||
1824 | 1852 | ||
1825 | /* in effect, all msg_type's are set to MSG_NOOP */ | 1853 | /* in effect, all msg_type's are set to MSG_NOOP */ |
1826 | memset(pqp, 0, sizeof(struct bau_pq_entry) * DEST_Q_SIZE); | 1854 | memset(pqp, 0, sizeof(struct bau_pq_entry) * DEST_Q_SIZE); |
@@ -1910,8 +1938,8 @@ static void __init init_per_cpu_tunables(void) | |||
1910 | bcp->complete_threshold = complete_threshold; | 1938 | bcp->complete_threshold = complete_threshold; |
1911 | bcp->cong_response_us = congested_respns_us; | 1939 | bcp->cong_response_us = congested_respns_us; |
1912 | bcp->cong_reps = congested_reps; | 1940 | bcp->cong_reps = congested_reps; |
1913 | bcp->disabled_period = sec_2_cycles(disabled_period); | 1941 | bcp->disabled_period = sec_2_cycles(disabled_period); |
1914 | bcp->giveup_limit = giveup_limit; | 1942 | bcp->giveup_limit = giveup_limit; |
1915 | spin_lock_init(&bcp->queue_lock); | 1943 | spin_lock_init(&bcp->queue_lock); |
1916 | spin_lock_init(&bcp->uvhub_lock); | 1944 | spin_lock_init(&bcp->uvhub_lock); |
1917 | spin_lock_init(&bcp->disable_lock); | 1945 | spin_lock_init(&bcp->disable_lock); |
@@ -1940,7 +1968,7 @@ static int __init get_cpu_topology(int base_pnode, | |||
1940 | 1968 | ||
1941 | pnode = uv_cpu_hub_info(cpu)->pnode; | 1969 | pnode = uv_cpu_hub_info(cpu)->pnode; |
1942 | if ((pnode - base_pnode) >= UV_DISTRIBUTION_SIZE) { | 1970 | if ((pnode - base_pnode) >= UV_DISTRIBUTION_SIZE) { |
1943 | printk(KERN_EMERG | 1971 | pr_emerg( |
1944 | "cpu %d pnode %d-%d beyond %d; BAU disabled\n", | 1972 | "cpu %d pnode %d-%d beyond %d; BAU disabled\n", |
1945 | cpu, pnode, base_pnode, UV_DISTRIBUTION_SIZE); | 1973 | cpu, pnode, base_pnode, UV_DISTRIBUTION_SIZE); |
1946 | return 1; | 1974 | return 1; |
@@ -1965,7 +1993,7 @@ static int __init get_cpu_topology(int base_pnode, | |||
1965 | sdp->cpu_number[sdp->num_cpus] = cpu; | 1993 | sdp->cpu_number[sdp->num_cpus] = cpu; |
1966 | sdp->num_cpus++; | 1994 | sdp->num_cpus++; |
1967 | if (sdp->num_cpus > MAX_CPUS_PER_SOCKET) { | 1995 | if (sdp->num_cpus > MAX_CPUS_PER_SOCKET) { |
1968 | printk(KERN_EMERG "%d cpus per socket invalid\n", | 1996 | pr_emerg("%d cpus per socket invalid\n", |
1969 | sdp->num_cpus); | 1997 | sdp->num_cpus); |
1970 | return 1; | 1998 | return 1; |
1971 | } | 1999 | } |
@@ -2031,15 +2059,17 @@ static int scan_sock(struct socket_desc *sdp, struct uvhub_desc *bdp, | |||
2031 | bcp->uvhub_version = 2; | 2059 | bcp->uvhub_version = 2; |
2032 | else if (is_uv3_hub()) | 2060 | else if (is_uv3_hub()) |
2033 | bcp->uvhub_version = 3; | 2061 | bcp->uvhub_version = 3; |
2062 | else if (is_uv4_hub()) | ||
2063 | bcp->uvhub_version = 4; | ||
2034 | else { | 2064 | else { |
2035 | printk(KERN_EMERG "uvhub version not 1, 2 or 3\n"); | 2065 | pr_emerg("uvhub version not 1, 2, 3, or 4\n"); |
2036 | return 1; | 2066 | return 1; |
2037 | } | 2067 | } |
2038 | bcp->uvhub_master = *hmasterp; | 2068 | bcp->uvhub_master = *hmasterp; |
2039 | bcp->uvhub_cpu = uv_cpu_blade_processor_id(cpu); | 2069 | bcp->uvhub_cpu = uv_cpu_blade_processor_id(cpu); |
2040 | 2070 | ||
2041 | if (bcp->uvhub_cpu >= MAX_CPUS_PER_UVHUB) { | 2071 | if (bcp->uvhub_cpu >= MAX_CPUS_PER_UVHUB) { |
2042 | printk(KERN_EMERG "%d cpus per uvhub invalid\n", | 2072 | pr_emerg("%d cpus per uvhub invalid\n", |
2043 | bcp->uvhub_cpu); | 2073 | bcp->uvhub_cpu); |
2044 | return 1; | 2074 | return 1; |
2045 | } | 2075 | } |
@@ -2094,7 +2124,8 @@ static int __init init_per_cpu(int nuvhubs, int base_part_pnode) | |||
2094 | void *vp; | 2124 | void *vp; |
2095 | struct uvhub_desc *uvhub_descs; | 2125 | struct uvhub_desc *uvhub_descs; |
2096 | 2126 | ||
2097 | timeout_us = calculate_destination_timeout(); | 2127 | if (is_uv3_hub() || is_uv2_hub() || is_uv1_hub()) |
2128 | timeout_us = calculate_destination_timeout(); | ||
2098 | 2129 | ||
2099 | vp = kmalloc(nuvhubs * sizeof(struct uvhub_desc), GFP_KERNEL); | 2130 | vp = kmalloc(nuvhubs * sizeof(struct uvhub_desc), GFP_KERNEL); |
2100 | uvhub_descs = (struct uvhub_desc *)vp; | 2131 | uvhub_descs = (struct uvhub_desc *)vp; |
@@ -2134,6 +2165,15 @@ static int __init uv_bau_init(void) | |||
2134 | if (!is_uv_system()) | 2165 | if (!is_uv_system()) |
2135 | return 0; | 2166 | return 0; |
2136 | 2167 | ||
2168 | if (is_uv4_hub()) | ||
2169 | ops = uv4_bau_ops; | ||
2170 | else if (is_uv3_hub()) | ||
2171 | ops = uv123_bau_ops; | ||
2172 | else if (is_uv2_hub()) | ||
2173 | ops = uv123_bau_ops; | ||
2174 | else if (is_uv1_hub()) | ||
2175 | ops = uv123_bau_ops; | ||
2176 | |||
2137 | for_each_possible_cpu(cur_cpu) { | 2177 | for_each_possible_cpu(cur_cpu) { |
2138 | mask = &per_cpu(uv_flush_tlb_mask, cur_cpu); | 2178 | mask = &per_cpu(uv_flush_tlb_mask, cur_cpu); |
2139 | zalloc_cpumask_var_node(mask, GFP_KERNEL, cpu_to_node(cur_cpu)); | 2179 | zalloc_cpumask_var_node(mask, GFP_KERNEL, cpu_to_node(cur_cpu)); |
@@ -2149,7 +2189,9 @@ static int __init uv_bau_init(void) | |||
2149 | uv_base_pnode = uv_blade_to_pnode(uvhub); | 2189 | uv_base_pnode = uv_blade_to_pnode(uvhub); |
2150 | } | 2190 | } |
2151 | 2191 | ||
2152 | enable_timeouts(); | 2192 | /* software timeouts are not supported on UV4 */ |
2193 | if (is_uv3_hub() || is_uv2_hub() || is_uv1_hub()) | ||
2194 | enable_timeouts(); | ||
2153 | 2195 | ||
2154 | if (init_per_cpu(nuvhubs, uv_base_pnode)) { | 2196 | if (init_per_cpu(nuvhubs, uv_base_pnode)) { |
2155 | set_bau_off(); | 2197 | set_bau_off(); |
diff --git a/drivers/pci/pci-mid.c b/drivers/pci/pci-mid.c index c878aa71173b..55f453de562e 100644 --- a/drivers/pci/pci-mid.c +++ b/drivers/pci/pci-mid.c | |||
@@ -60,8 +60,13 @@ static struct pci_platform_pm_ops mid_pci_platform_pm = { | |||
60 | 60 | ||
61 | #define ICPU(model) { X86_VENDOR_INTEL, 6, model, X86_FEATURE_ANY, } | 61 | #define ICPU(model) { X86_VENDOR_INTEL, 6, model, X86_FEATURE_ANY, } |
62 | 62 | ||
63 | /* | ||
64 | * This table should be in sync with the one in | ||
65 | * arch/x86/platform/intel-mid/pwr.c. | ||
66 | */ | ||
63 | static const struct x86_cpu_id lpss_cpu_ids[] = { | 67 | static const struct x86_cpu_id lpss_cpu_ids[] = { |
64 | ICPU(INTEL_FAM6_ATOM_MERRIFIELD1), | 68 | ICPU(INTEL_FAM6_ATOM_PENWELL), |
69 | ICPU(INTEL_FAM6_ATOM_MERRIFIELD), | ||
65 | {} | 70 | {} |
66 | }; | 71 | }; |
67 | 72 | ||
diff --git a/drivers/powercap/intel_rapl.c b/drivers/powercap/intel_rapl.c index fbab29dfa793..243b233ff31b 100644 --- a/drivers/powercap/intel_rapl.c +++ b/drivers/powercap/intel_rapl.c | |||
@@ -1154,8 +1154,8 @@ static const struct x86_cpu_id rapl_ids[] __initconst = { | |||
1154 | 1154 | ||
1155 | RAPL_CPU(INTEL_FAM6_ATOM_SILVERMONT1, rapl_defaults_byt), | 1155 | RAPL_CPU(INTEL_FAM6_ATOM_SILVERMONT1, rapl_defaults_byt), |
1156 | RAPL_CPU(INTEL_FAM6_ATOM_AIRMONT, rapl_defaults_cht), | 1156 | RAPL_CPU(INTEL_FAM6_ATOM_AIRMONT, rapl_defaults_cht), |
1157 | RAPL_CPU(INTEL_FAM6_ATOM_MERRIFIELD1, rapl_defaults_tng), | 1157 | RAPL_CPU(INTEL_FAM6_ATOM_MERRIFIELD, rapl_defaults_tng), |
1158 | RAPL_CPU(INTEL_FAM6_ATOM_MERRIFIELD2, rapl_defaults_ann), | 1158 | RAPL_CPU(INTEL_FAM6_ATOM_MOOREFIELD, rapl_defaults_ann), |
1159 | RAPL_CPU(INTEL_FAM6_ATOM_GOLDMONT, rapl_defaults_core), | 1159 | RAPL_CPU(INTEL_FAM6_ATOM_GOLDMONT, rapl_defaults_core), |
1160 | RAPL_CPU(INTEL_FAM6_ATOM_DENVERTON, rapl_defaults_core), | 1160 | RAPL_CPU(INTEL_FAM6_ATOM_DENVERTON, rapl_defaults_core), |
1161 | 1161 | ||