Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

+669 -88
+6
MAINTAINERS
··· 7683 7683 Q: http://patchwork.ozlabs.org/project/netdev/list/ 7684 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 7692 SOFT-ROCE DRIVER (rxe) 7687 7693 M: Moni Shoua <monis@mellanox.com> 7688 7694 L: linux-rdma@vger.kernel.org
+12
arch/x86/Kconfig
··· 550 550 Say Y here if you have a Quark based system such as the Arduino 551 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 565 config X86_INTEL_LPSS 554 566 bool "Intel Low Power Subsystem Support" 555 567 depends on X86 && ACPI
+2 -2
arch/x86/include/asm/intel-family.h
··· 56 56 #define INTEL_FAM6_ATOM_SILVERMONT1 0x37 /* BayTrail/BYT / Valleyview */ 57 57 #define INTEL_FAM6_ATOM_SILVERMONT2 0x4D /* Avaton/Rangely */ 58 58 #define INTEL_FAM6_ATOM_AIRMONT 0x4C /* CherryTrail / Braswell */ 59 - #define INTEL_FAM6_ATOM_MERRIFIELD1 0x4A /* Tangier */ 60 - #define INTEL_FAM6_ATOM_MERRIFIELD2 0x5A /* Annidale */ 59 + #define INTEL_FAM6_ATOM_MERRIFIELD 0x4A /* Tangier */ 60 + #define INTEL_FAM6_ATOM_MOOREFIELD 0x5A /* Annidale */ 61 61 #define INTEL_FAM6_ATOM_GOLDMONT 0x5C 62 62 #define INTEL_FAM6_ATOM_DENVERTON 0x5F /* Goldmont Microserver */ 63 63
+2
arch/x86/include/asm/intel-mid.h
··· 18 18 extern int intel_mid_pci_init(void); 19 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 23 #define INTEL_MID_PWR_LSS_OFFSET 4 22 24 #define INTEL_MID_PWR_LSS_TYPE (1 << 7) 23 25
+2
arch/x86/include/asm/intel_scu_ipc.h
··· 3 3 4 4 #include <linux/notifier.h> 5 5 6 + #define IPCMSG_COLD_OFF 0x80 /* Only for Tangier */ 7 + 6 8 #define IPCMSG_WARM_RESET 0xF0 7 9 #define IPCMSG_COLD_RESET 0xF1 8 10 #define IPCMSG_SOFT_RESET 0xF2
+42 -3
arch/x86/include/asm/uv/uv_bau.h
··· 49 49 #define UV_NET_ENDPOINT_INTD (is_uv1_hub() ? \ 50 50 UV1_NET_ENDPOINT_INTD : UV2_NET_ENDPOINT_INTD) 51 51 #define UV_DESC_PSHIFT 49 52 - #define UV_PAYLOADQ_PNODE_SHIFT 49 52 + #define UV_PAYLOADQ_GNODE_SHIFT 49 53 53 #define UV_PTC_BASENAME "sgi_uv/ptc_statistics" 54 54 #define UV_BAU_BASENAME "sgi_uv/bau_tunables" 55 55 #define UV_BAU_TUNABLES_DIR "sgi_uv" 56 56 #define UV_BAU_TUNABLES_FILE "bau_tunables" 57 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 58 #define cpubit_isset(cpu, bau_local_cpumask) \ 61 59 test_bit((cpu), (bau_local_cpumask).bits) 62 60 ··· 385 387 /* bits 127:120 */ 386 388 }; 387 389 390 + /* Abstracted BAU functions */ 391 + struct bau_operations { 392 + unsigned long (*read_l_sw_ack)(void); 393 + unsigned long (*read_g_sw_ack)(int pnode); 394 + unsigned long (*bau_gpa_to_offset)(unsigned long vaddr); 395 + void (*write_l_sw_ack)(unsigned long mmr); 396 + void (*write_g_sw_ack)(int pnode, unsigned long mmr); 397 + void (*write_payload_first)(int pnode, unsigned long mmr); 398 + void (*write_payload_last)(int pnode, unsigned long mmr); 399 + }; 400 + 388 401 /* 389 402 * The activation descriptor: 390 403 * The format of the message to send, plus all accompanying control ··· 664 655 write_gmmr(pnode, UVH_LB_BAU_SB_ACTIVATION_CONTROL, mmr_image); 665 656 } 666 657 658 + static inline void write_mmr_proc_payload_first(int pnode, unsigned long mmr_image) 659 + { 660 + write_gmmr(pnode, UV4H_LB_PROC_INTD_QUEUE_FIRST, mmr_image); 661 + } 662 + 663 + static inline void write_mmr_proc_payload_last(int pnode, unsigned long mmr_image) 664 + { 665 + write_gmmr(pnode, UV4H_LB_PROC_INTD_QUEUE_LAST, mmr_image); 666 + } 667 + 667 668 static inline void write_mmr_payload_first(int pnode, unsigned long mmr_image) 668 669 { 669 670 write_gmmr(pnode, UVH_LB_BAU_INTD_PAYLOAD_QUEUE_FIRST, mmr_image); ··· 717 698 static inline unsigned long read_gmmr_sw_ack(int pnode) 718 699 { 719 700 return read_gmmr(pnode, UVH_LB_BAU_INTD_SOFTWARE_ACKNOWLEDGE); 701 + } 702 + 703 + static inline void write_mmr_proc_sw_ack(unsigned long mr) 704 + { 705 + uv_write_local_mmr(UV4H_LB_PROC_INTD_SOFT_ACK_CLEAR, mr); 706 + } 707 + 708 + static inline void write_gmmr_proc_sw_ack(int pnode, unsigned long mr) 709 + { 710 + write_gmmr(pnode, UV4H_LB_PROC_INTD_SOFT_ACK_CLEAR, mr); 711 + } 712 + 713 + static inline unsigned long read_mmr_proc_sw_ack(void) 714 + { 715 + return read_lmmr(UV4H_LB_PROC_INTD_SOFT_ACK_PENDING); 716 + } 717 + 718 + static inline unsigned long read_gmmr_proc_sw_ack(int pnode) 719 + { 720 + return read_gmmr(pnode, UV4H_LB_PROC_INTD_SOFT_ACK_PENDING); 720 721 } 721 722 722 723 static inline void write_mmr_data_config(int pnode, unsigned long mr)
+1
arch/x86/platform/Makefile
··· 8 8 obj-y += intel/ 9 9 obj-y += intel-mid/ 10 10 obj-y += intel-quark/ 11 + obj-y += mellanox/ 11 12 obj-y += olpc/ 12 13 obj-y += scx200/ 13 14 obj-y += sfi/
+1 -1
arch/x86/platform/atom/punit_atom_debug.c
··· 155 155 156 156 static const struct x86_cpu_id intel_punit_cpu_ids[] = { 157 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 159 ICPU(INTEL_FAM6_ATOM_AIRMONT, punit_device_cht), 160 160 {} 161 161 };
+4
arch/x86/platform/intel-mid/device_libs/Makefile
··· 1 1 # Family-Level Interface Shim (FLIS) 2 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 7 # IPC Devices 4 8 obj-y += platform_ipc.o 5 9 obj-$(subst m,y,$(CONFIG_MFD_INTEL_MSIC)) += platform_msic.o
+95
arch/x86/platform/intel-mid/device_libs/platform_bcm43xx.c
··· 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);
+47
arch/x86/platform/intel-mid/device_libs/platform_mrfld_sd.c
··· 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);
+5
arch/x86/platform/intel-mid/intel-mid.c
··· 70 70 71 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 80 static void intel_mid_reboot(void)
+65 -11
arch/x86/platform/intel-mid/pwr.c
··· 44 44 /* Bits in PM_CMD */ 45 45 #define PM_CMD_CMD(x) ((x) << 0) 46 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 61 /* List of commands */ 50 62 #define CMD_SET_CFG 0x01 ··· 149 137 150 138 static int mid_pwr_wait_for_cmd(struct mid_pwr *pwr, u8 cmd) 151 139 { 152 - writel(PM_CMD_CMD(cmd), pwr->regs + PM_CMD); 140 + writel(PM_CMD_CMD(cmd) | PM_CMD_CM_IMMEDIATE, pwr->regs + PM_CMD); 153 141 return mid_pwr_wait(pwr); 154 142 } 155 143 ··· 272 260 } 273 261 EXPORT_SYMBOL_GPL(intel_mid_pci_set_power_state); 274 262 263 + void intel_mid_pwr_power_off(void) 264 + { 265 + struct mid_pwr *pwr = midpwr; 266 + u32 cmd = PM_CMD_SYS_STATE_S5 | 267 + PM_CMD_CMD(CMD_SET_CFG) | 268 + PM_CMD_CM_TRIGGER | 269 + PM_CMD_CFG_TRIGGER_NC | 270 + TRIGGER_NC_MSG_2; 271 + 272 + /* Send command to SCU */ 273 + writel(cmd, pwr->regs + PM_CMD); 274 + mid_pwr_wait(pwr); 275 + } 276 + 275 277 int intel_mid_pwr_get_lss_id(struct pci_dev *pdev) 276 278 { 277 279 int vndr; ··· 380 354 return 0; 381 355 } 382 356 383 - static int mid_set_initial_state(struct mid_pwr *pwr) 357 + static int mid_set_initial_state(struct mid_pwr *pwr, const u32 *states) 384 358 { 385 359 unsigned int i, j; 386 360 int ret; ··· 405 379 * NOTE: The actual device mapping is provided by a platform at run 406 380 * time using vendor capability of PCI configuration space. 407 381 */ 408 - mid_pwr_set_state(pwr, 0, 0xffffffff); 409 - mid_pwr_set_state(pwr, 1, 0xffffffff); 410 - mid_pwr_set_state(pwr, 2, 0xffffffff); 411 - mid_pwr_set_state(pwr, 3, 0xffffffff); 382 + mid_pwr_set_state(pwr, 0, states[0]); 383 + mid_pwr_set_state(pwr, 1, states[1]); 384 + mid_pwr_set_state(pwr, 2, states[2]); 385 + mid_pwr_set_state(pwr, 3, states[3]); 412 386 413 387 /* Send command to SCU */ 414 388 ret = mid_pwr_wait_for_cmd(pwr, CMD_SET_CFG); ··· 423 397 return 0; 424 398 } 425 399 426 - static const struct mid_pwr_device_info mid_info = { 427 - .set_initial_state = mid_set_initial_state, 400 + static int pnw_set_initial_state(struct mid_pwr *pwr) 401 + { 402 + /* On Penwell SRAM must stay powered on */ 403 + const u32 states[] = { 404 + 0xf00fffff, /* PM_SSC(0) */ 405 + 0xffffffff, /* PM_SSC(1) */ 406 + 0xffffffff, /* PM_SSC(2) */ 407 + 0xffffffff, /* PM_SSC(3) */ 408 + }; 409 + return mid_set_initial_state(pwr, states); 410 + } 411 + 412 + static int tng_set_initial_state(struct mid_pwr *pwr) 413 + { 414 + const u32 states[] = { 415 + 0xffffffff, /* PM_SSC(0) */ 416 + 0xffffffff, /* PM_SSC(1) */ 417 + 0xffffffff, /* PM_SSC(2) */ 418 + 0xffffffff, /* PM_SSC(3) */ 419 + }; 420 + return mid_set_initial_state(pwr, states); 421 + } 422 + 423 + static const struct mid_pwr_device_info pnw_info = { 424 + .set_initial_state = pnw_set_initial_state, 428 425 }; 429 426 427 + static const struct mid_pwr_device_info tng_info = { 428 + .set_initial_state = tng_set_initial_state, 429 + }; 430 + 431 + /* This table should be in sync with the one in drivers/pci/pci-mid.c */ 430 432 static const struct pci_device_id mid_pwr_pci_ids[] = { 431 - { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_PENWELL), (kernel_ulong_t)&mid_info }, 432 - { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_TANGIER), (kernel_ulong_t)&mid_info }, 433 + { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_PENWELL), (kernel_ulong_t)&pnw_info }, 434 + { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_TANGIER), (kernel_ulong_t)&tng_info }, 433 435 {} 434 436 }; 435 437
+1
arch/x86/platform/mellanox/Makefile
··· 1 + obj-$(CONFIG_MLX_PLATFORM) += mlx-platform.o
+266
arch/x86/platform/mellanox/mlx-platform.c
··· 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*:");
+110 -68
arch/x86/platform/uv/tlb_uv.c
··· 24 24 #include <asm/irq_vectors.h> 25 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 50 /* timeouts in nanoseconds (indexed by UVH_AGING_PRESCALE_SEL urgency7 30:28) */ 28 51 static int timeout_base_ns[] = { 29 52 20, ··· 78 55 static int disabled_period = DISABLED_PERIOD; 79 56 80 57 static struct tunables tunables[] = { 81 - {&max_concurr, MAX_BAU_CONCURRENT}, /* must be [0] */ 82 - {&plugged_delay, PLUGGED_DELAY}, 83 - {&plugsb4reset, PLUGSB4RESET}, 84 - {&timeoutsb4reset, TIMEOUTSB4RESET}, 85 - {&ipi_reset_limit, IPI_RESET_LIMIT}, 86 - {&complete_threshold, COMPLETE_THRESHOLD}, 87 - {&congested_respns_us, CONGESTED_RESPONSE_US}, 88 - {&congested_reps, CONGESTED_REPS}, 89 - {&disabled_period, DISABLED_PERIOD}, 90 - {&giveup_limit, GIVEUP_LIMIT} 58 + {&max_concurr, MAX_BAU_CONCURRENT}, /* must be [0] */ 59 + {&plugged_delay, PLUGGED_DELAY}, 60 + {&plugsb4reset, PLUGSB4RESET}, 61 + {&timeoutsb4reset, TIMEOUTSB4RESET}, 62 + {&ipi_reset_limit, IPI_RESET_LIMIT}, 63 + {&complete_threshold, COMPLETE_THRESHOLD}, 64 + {&congested_respns_us, CONGESTED_RESPONSE_US}, 65 + {&congested_reps, CONGESTED_REPS}, 66 + {&disabled_period, DISABLED_PERIOD}, 67 + {&giveup_limit, GIVEUP_LIMIT} 91 68 }; 92 69 93 70 static struct dentry *tunables_dir; ··· 239 216 msg = mdp->msg; 240 217 if (!msg->canceled && do_acknowledge) { 241 218 dw = (msg->swack_vec << UV_SW_ACK_NPENDING) | msg->swack_vec; 242 - write_mmr_sw_ack(dw); 219 + ops.write_l_sw_ack(dw); 243 220 } 244 221 msg->replied_to = 1; 245 222 msg->swack_vec = 0; ··· 275 252 msg->swack_vec) == 0) && 276 253 (msg2->sending_cpu == msg->sending_cpu) && 277 254 (msg2->msg_type != MSG_NOOP)) { 278 - mmr = read_mmr_sw_ack(); 255 + mmr = ops.read_l_sw_ack(); 279 256 msg_res = msg2->swack_vec; 280 257 /* 281 258 * This is a message retry; clear the resources held ··· 293 270 stat->d_canceled++; 294 271 cancel_count++; 295 272 mr = (msg_res << UV_SW_ACK_NPENDING) | msg_res; 296 - write_mmr_sw_ack(mr); 273 + ops.write_l_sw_ack(mr); 297 274 } 298 275 } 299 276 } ··· 426 403 /* 427 404 * only reset the resource if it is still pending 428 405 */ 429 - mmr = read_mmr_sw_ack(); 406 + mmr = ops.read_l_sw_ack(); 430 407 msg_res = msg->swack_vec; 431 408 mr = (msg_res << UV_SW_ACK_NPENDING) | msg_res; 432 409 if (mmr & msg_res) { 433 410 stat->d_rcanceled++; 434 - write_mmr_sw_ack(mr); 411 + ops.write_l_sw_ack(mr); 435 412 } 436 413 } 437 414 } ··· 1221 1198 struct bau_pq_entry *msg = mdp->msg; 1222 1199 struct bau_pq_entry *other_msg; 1223 1200 1224 - mmr_image = read_mmr_sw_ack(); 1201 + mmr_image = ops.read_l_sw_ack(); 1225 1202 swack_vec = msg->swack_vec; 1226 1203 1227 1204 if ((swack_vec & mmr_image) == 0) { ··· 1450 1427 /* destination side statistics */ 1451 1428 seq_printf(file, 1452 1429 "%lx %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld\n", 1453 - read_gmmr_sw_ack(uv_cpu_to_pnode(cpu)), 1430 + ops.read_g_sw_ack(uv_cpu_to_pnode(cpu)), 1454 1431 stat->d_requestee, cycles_2_us(stat->d_time), 1455 1432 stat->d_alltlb, stat->d_onetlb, stat->d_multmsg, 1456 1433 stat->d_nomsg, stat->d_retries, stat->d_canceled, ··· 1516 1493 } 1517 1494 1518 1495 if (kstrtol(optstr, 10, &input_arg) < 0) { 1519 - printk(KERN_DEBUG "%s is invalid\n", optstr); 1496 + pr_debug("%s is invalid\n", optstr); 1520 1497 return -EINVAL; 1521 1498 } 1522 1499 1523 1500 if (input_arg == 0) { 1524 1501 elements = ARRAY_SIZE(stat_description); 1525 - printk(KERN_DEBUG "# cpu: cpu number\n"); 1526 - printk(KERN_DEBUG "Sender statistics:\n"); 1502 + pr_debug("# cpu: cpu number\n"); 1503 + pr_debug("Sender statistics:\n"); 1527 1504 for (i = 0; i < elements; i++) 1528 - printk(KERN_DEBUG "%s\n", stat_description[i]); 1505 + pr_debug("%s\n", stat_description[i]); 1529 1506 } else if (input_arg == -1) { 1530 1507 for_each_present_cpu(cpu) { 1531 1508 stat = &per_cpu(ptcstats, cpu); ··· 1573 1550 break; 1574 1551 } 1575 1552 if (cnt != e) { 1576 - printk(KERN_INFO "bau tunable error: should be %d values\n", e); 1553 + pr_info("bau tunable error: should be %d values\n", e); 1577 1554 return -EINVAL; 1578 1555 } 1579 1556 ··· 1590 1567 continue; 1591 1568 } 1592 1569 if (val < 1 || val > bcp->cpus_in_uvhub) { 1593 - printk(KERN_DEBUG 1570 + pr_debug( 1594 1571 "Error: BAU max concurrent %d is invalid\n", 1595 1572 val); 1596 1573 return -EINVAL; ··· 1638 1615 1639 1616 for_each_present_cpu(cpu) { 1640 1617 bcp = &per_cpu(bau_control, cpu); 1641 - bcp->max_concurr = max_concurr; 1642 - bcp->max_concurr_const = max_concurr; 1643 - bcp->plugged_delay = plugged_delay; 1644 - bcp->plugsb4reset = plugsb4reset; 1645 - bcp->timeoutsb4reset = timeoutsb4reset; 1646 - bcp->ipi_reset_limit = ipi_reset_limit; 1647 - bcp->complete_threshold = complete_threshold; 1648 - bcp->cong_response_us = congested_respns_us; 1649 - bcp->cong_reps = congested_reps; 1650 - bcp->disabled_period = sec_2_cycles(disabled_period); 1651 - bcp->giveup_limit = giveup_limit; 1618 + bcp->max_concurr = max_concurr; 1619 + bcp->max_concurr_const = max_concurr; 1620 + bcp->plugged_delay = plugged_delay; 1621 + bcp->plugsb4reset = plugsb4reset; 1622 + bcp->timeoutsb4reset = timeoutsb4reset; 1623 + bcp->ipi_reset_limit = ipi_reset_limit; 1624 + bcp->complete_threshold = complete_threshold; 1625 + bcp->cong_response_us = congested_respns_us; 1626 + bcp->cong_reps = congested_reps; 1627 + bcp->disabled_period = sec_2_cycles(disabled_period); 1628 + bcp->giveup_limit = giveup_limit; 1652 1629 } 1653 1630 return count; 1654 1631 } ··· 1695 1672 proc_uv_ptc = proc_create(UV_PTC_BASENAME, 0444, NULL, 1696 1673 &proc_uv_ptc_operations); 1697 1674 if (!proc_uv_ptc) { 1698 - printk(KERN_ERR "unable to create %s proc entry\n", 1675 + pr_err("unable to create %s proc entry\n", 1699 1676 UV_PTC_BASENAME); 1700 1677 return -EINVAL; 1701 1678 } 1702 1679 1703 1680 tunables_dir = debugfs_create_dir(UV_BAU_TUNABLES_DIR, NULL); 1704 1681 if (!tunables_dir) { 1705 - printk(KERN_ERR "unable to create debugfs directory %s\n", 1682 + pr_err("unable to create debugfs directory %s\n", 1706 1683 UV_BAU_TUNABLES_DIR); 1707 1684 return -EINVAL; 1708 1685 } 1709 1686 tunables_file = debugfs_create_file(UV_BAU_TUNABLES_FILE, 0600, 1710 1687 tunables_dir, NULL, &tunables_fops); 1711 1688 if (!tunables_file) { 1712 - printk(KERN_ERR "unable to create debugfs file %s\n", 1689 + pr_err("unable to create debugfs file %s\n", 1713 1690 UV_BAU_TUNABLES_FILE); 1714 1691 return -EINVAL; 1715 1692 } ··· 1744 1721 1745 1722 gpa = uv_gpa(bau_desc); 1746 1723 n = uv_gpa_to_gnode(gpa); 1747 - m = uv_gpa_to_offset(gpa); 1724 + m = ops.bau_gpa_to_offset(gpa); 1748 1725 if (is_uv1_hub()) 1749 1726 uv1 = 1; 1750 1727 ··· 1759 1736 memset(bd2, 0, sizeof(struct bau_desc)); 1760 1737 if (uv1) { 1761 1738 uv1_hdr = &bd2->header.uv1_hdr; 1762 - uv1_hdr->swack_flag = 1; 1739 + uv1_hdr->swack_flag = 1; 1763 1740 /* 1764 1741 * The base_dest_nasid set in the message header 1765 1742 * is the nasid of the first uvhub in the partition. ··· 1768 1745 * if nasid striding is being used. 1769 1746 */ 1770 1747 uv1_hdr->base_dest_nasid = 1771 - UV_PNODE_TO_NASID(base_pnode); 1772 - uv1_hdr->dest_subnodeid = UV_LB_SUBNODEID; 1773 - uv1_hdr->command = UV_NET_ENDPOINT_INTD; 1774 - uv1_hdr->int_both = 1; 1748 + UV_PNODE_TO_NASID(base_pnode); 1749 + uv1_hdr->dest_subnodeid = UV_LB_SUBNODEID; 1750 + uv1_hdr->command = UV_NET_ENDPOINT_INTD; 1751 + uv1_hdr->int_both = 1; 1775 1752 /* 1776 1753 * all others need to be set to zero: 1777 1754 * fairness chaining multilevel count replied_to ··· 1782 1759 * uses native mode for selective broadcasts. 1783 1760 */ 1784 1761 uv2_3_hdr = &bd2->header.uv2_3_hdr; 1785 - uv2_3_hdr->swack_flag = 1; 1762 + uv2_3_hdr->swack_flag = 1; 1786 1763 uv2_3_hdr->base_dest_nasid = 1787 - UV_PNODE_TO_NASID(base_pnode); 1788 - uv2_3_hdr->dest_subnodeid = UV_LB_SUBNODEID; 1789 - uv2_3_hdr->command = UV_NET_ENDPOINT_INTD; 1764 + UV_PNODE_TO_NASID(base_pnode); 1765 + uv2_3_hdr->dest_subnodeid = UV_LB_SUBNODEID; 1766 + uv2_3_hdr->command = UV_NET_ENDPOINT_INTD; 1790 1767 } 1791 1768 } 1792 1769 for_each_present_cpu(cpu) { ··· 1809 1786 size_t plsize; 1810 1787 char *cp; 1811 1788 void *vp; 1812 - unsigned long pn; 1813 - unsigned long first; 1814 - unsigned long pn_first; 1815 - unsigned long last; 1789 + unsigned long gnode, first, last, tail; 1816 1790 struct bau_pq_entry *pqp; 1817 1791 struct bau_control *bcp; 1818 1792 ··· 1830 1810 bcp->bau_msg_head = pqp; 1831 1811 bcp->queue_last = pqp + (DEST_Q_SIZE - 1); 1832 1812 } 1813 + 1814 + first = ops.bau_gpa_to_offset(uv_gpa(pqp)); 1815 + last = ops.bau_gpa_to_offset(uv_gpa(pqp + (DEST_Q_SIZE - 1))); 1816 + 1833 1817 /* 1834 - * need the gnode of where the memory was really allocated 1818 + * Pre UV4, the gnode is required to locate the payload queue 1819 + * and the payload queue tail must be maintained by the kernel. 1835 1820 */ 1836 - pn = uv_gpa_to_gnode(uv_gpa(pqp)); 1837 - first = uv_physnodeaddr(pqp); 1838 - pn_first = ((unsigned long)pn << UV_PAYLOADQ_PNODE_SHIFT) | first; 1839 - last = uv_physnodeaddr(pqp + (DEST_Q_SIZE - 1)); 1840 - write_mmr_payload_first(pnode, pn_first); 1841 - write_mmr_payload_tail(pnode, first); 1842 - write_mmr_payload_last(pnode, last); 1843 - write_gmmr_sw_ack(pnode, 0xffffUL); 1821 + bcp = &per_cpu(bau_control, smp_processor_id()); 1822 + if (bcp->uvhub_version <= 3) { 1823 + tail = first; 1824 + gnode = uv_gpa_to_gnode(uv_gpa(pqp)); 1825 + first = (gnode << UV_PAYLOADQ_GNODE_SHIFT) | tail; 1826 + write_mmr_payload_tail(pnode, tail); 1827 + } 1828 + 1829 + ops.write_payload_first(pnode, first); 1830 + ops.write_payload_last(pnode, last); 1831 + ops.write_g_sw_ack(pnode, 0xffffUL); 1844 1832 1845 1833 /* in effect, all msg_type's are set to MSG_NOOP */ 1846 1834 memset(pqp, 0, sizeof(struct bau_pq_entry) * DEST_Q_SIZE); ··· 1938 1910 bcp->complete_threshold = complete_threshold; 1939 1911 bcp->cong_response_us = congested_respns_us; 1940 1912 bcp->cong_reps = congested_reps; 1941 - bcp->disabled_period = sec_2_cycles(disabled_period); 1942 - bcp->giveup_limit = giveup_limit; 1913 + bcp->disabled_period = sec_2_cycles(disabled_period); 1914 + bcp->giveup_limit = giveup_limit; 1943 1915 spin_lock_init(&bcp->queue_lock); 1944 1916 spin_lock_init(&bcp->uvhub_lock); 1945 1917 spin_lock_init(&bcp->disable_lock); ··· 1968 1940 1969 1941 pnode = uv_cpu_hub_info(cpu)->pnode; 1970 1942 if ((pnode - base_pnode) >= UV_DISTRIBUTION_SIZE) { 1971 - printk(KERN_EMERG 1943 + pr_emerg( 1972 1944 "cpu %d pnode %d-%d beyond %d; BAU disabled\n", 1973 1945 cpu, pnode, base_pnode, UV_DISTRIBUTION_SIZE); 1974 1946 return 1; ··· 1993 1965 sdp->cpu_number[sdp->num_cpus] = cpu; 1994 1966 sdp->num_cpus++; 1995 1967 if (sdp->num_cpus > MAX_CPUS_PER_SOCKET) { 1996 - printk(KERN_EMERG "%d cpus per socket invalid\n", 1968 + pr_emerg("%d cpus per socket invalid\n", 1997 1969 sdp->num_cpus); 1998 1970 return 1; 1999 1971 } ··· 2059 2031 bcp->uvhub_version = 2; 2060 2032 else if (is_uv3_hub()) 2061 2033 bcp->uvhub_version = 3; 2034 + else if (is_uv4_hub()) 2035 + bcp->uvhub_version = 4; 2062 2036 else { 2063 - printk(KERN_EMERG "uvhub version not 1, 2 or 3\n"); 2037 + pr_emerg("uvhub version not 1, 2, 3, or 4\n"); 2064 2038 return 1; 2065 2039 } 2066 2040 bcp->uvhub_master = *hmasterp; 2067 2041 bcp->uvhub_cpu = uv_cpu_blade_processor_id(cpu); 2068 2042 2069 2043 if (bcp->uvhub_cpu >= MAX_CPUS_PER_UVHUB) { 2070 - printk(KERN_EMERG "%d cpus per uvhub invalid\n", 2044 + pr_emerg("%d cpus per uvhub invalid\n", 2071 2045 bcp->uvhub_cpu); 2072 2046 return 1; 2073 2047 } ··· 2124 2094 void *vp; 2125 2095 struct uvhub_desc *uvhub_descs; 2126 2096 2127 - timeout_us = calculate_destination_timeout(); 2097 + if (is_uv3_hub() || is_uv2_hub() || is_uv1_hub()) 2098 + timeout_us = calculate_destination_timeout(); 2128 2099 2129 2100 vp = kmalloc(nuvhubs * sizeof(struct uvhub_desc), GFP_KERNEL); 2130 2101 uvhub_descs = (struct uvhub_desc *)vp; ··· 2165 2134 if (!is_uv_system()) 2166 2135 return 0; 2167 2136 2137 + if (is_uv4_hub()) 2138 + ops = uv4_bau_ops; 2139 + else if (is_uv3_hub()) 2140 + ops = uv123_bau_ops; 2141 + else if (is_uv2_hub()) 2142 + ops = uv123_bau_ops; 2143 + else if (is_uv1_hub()) 2144 + ops = uv123_bau_ops; 2145 + 2168 2146 for_each_possible_cpu(cur_cpu) { 2169 2147 mask = &per_cpu(uv_flush_tlb_mask, cur_cpu); 2170 2148 zalloc_cpumask_var_node(mask, GFP_KERNEL, cpu_to_node(cur_cpu)); ··· 2189 2149 uv_base_pnode = uv_blade_to_pnode(uvhub); 2190 2150 } 2191 2151 2192 - enable_timeouts(); 2152 + /* software timeouts are not supported on UV4 */ 2153 + if (is_uv3_hub() || is_uv2_hub() || is_uv1_hub()) 2154 + enable_timeouts(); 2193 2155 2194 2156 if (init_per_cpu(nuvhubs, uv_base_pnode)) { 2195 2157 set_bau_off();
+6 -1
drivers/pci/pci-mid.c
··· 60 60 61 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 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
+2 -2
drivers/powercap/intel_rapl.c
··· 1154 1154 1155 1155 RAPL_CPU(INTEL_FAM6_ATOM_SILVERMONT1, rapl_defaults_byt), 1156 1156 RAPL_CPU(INTEL_FAM6_ATOM_AIRMONT, rapl_defaults_cht), 1157 - RAPL_CPU(INTEL_FAM6_ATOM_MERRIFIELD1, rapl_defaults_tng), 1158 - RAPL_CPU(INTEL_FAM6_ATOM_MERRIFIELD2, rapl_defaults_ann), 1157 + RAPL_CPU(INTEL_FAM6_ATOM_MERRIFIELD, rapl_defaults_tng), 1158 + RAPL_CPU(INTEL_FAM6_ATOM_MOOREFIELD, rapl_defaults_ann), 1159 1159 RAPL_CPU(INTEL_FAM6_ATOM_GOLDMONT, rapl_defaults_core), 1160 1160 RAPL_CPU(INTEL_FAM6_ATOM_DENVERTON, rapl_defaults_core), 1161 1161