18c2ecf20Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0-only 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * lpc_ich.c - LPC interface for Intel ICH 48c2ecf20Sopenharmony_ci * 58c2ecf20Sopenharmony_ci * LPC bridge function of the Intel ICH contains many other 68c2ecf20Sopenharmony_ci * functional units, such as Interrupt controllers, Timers, 78c2ecf20Sopenharmony_ci * Power Management, System Management, GPIO, RTC, and LPC 88c2ecf20Sopenharmony_ci * Configuration Registers. 98c2ecf20Sopenharmony_ci * 108c2ecf20Sopenharmony_ci * This driver is derived from lpc_sch. 118c2ecf20Sopenharmony_ci 128c2ecf20Sopenharmony_ci * Copyright (c) 2011 Extreme Engineering Solution, Inc. 138c2ecf20Sopenharmony_ci * Author: Aaron Sierra <asierra@xes-inc.com> 148c2ecf20Sopenharmony_ci * 158c2ecf20Sopenharmony_ci * This driver supports the following I/O Controller hubs: 168c2ecf20Sopenharmony_ci * (See the intel documentation on http://developer.intel.com.) 178c2ecf20Sopenharmony_ci * document number 290655-003, 290677-014: 82801AA (ICH), 82801AB (ICHO) 188c2ecf20Sopenharmony_ci * document number 290687-002, 298242-027: 82801BA (ICH2) 198c2ecf20Sopenharmony_ci * document number 290733-003, 290739-013: 82801CA (ICH3-S) 208c2ecf20Sopenharmony_ci * document number 290716-001, 290718-007: 82801CAM (ICH3-M) 218c2ecf20Sopenharmony_ci * document number 290744-001, 290745-025: 82801DB (ICH4) 228c2ecf20Sopenharmony_ci * document number 252337-001, 252663-008: 82801DBM (ICH4-M) 238c2ecf20Sopenharmony_ci * document number 273599-001, 273645-002: 82801E (C-ICH) 248c2ecf20Sopenharmony_ci * document number 252516-001, 252517-028: 82801EB (ICH5), 82801ER (ICH5R) 258c2ecf20Sopenharmony_ci * document number 300641-004, 300884-013: 6300ESB 268c2ecf20Sopenharmony_ci * document number 301473-002, 301474-026: 82801F (ICH6) 278c2ecf20Sopenharmony_ci * document number 313082-001, 313075-006: 631xESB, 632xESB 288c2ecf20Sopenharmony_ci * document number 307013-003, 307014-024: 82801G (ICH7) 298c2ecf20Sopenharmony_ci * document number 322896-001, 322897-001: NM10 308c2ecf20Sopenharmony_ci * document number 313056-003, 313057-017: 82801H (ICH8) 318c2ecf20Sopenharmony_ci * document number 316972-004, 316973-012: 82801I (ICH9) 328c2ecf20Sopenharmony_ci * document number 319973-002, 319974-002: 82801J (ICH10) 338c2ecf20Sopenharmony_ci * document number 322169-001, 322170-003: 5 Series, 3400 Series (PCH) 348c2ecf20Sopenharmony_ci * document number 320066-003, 320257-008: EP80597 (IICH) 358c2ecf20Sopenharmony_ci * document number 324645-001, 324646-001: Cougar Point (CPT) 368c2ecf20Sopenharmony_ci */ 378c2ecf20Sopenharmony_ci 388c2ecf20Sopenharmony_ci#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 398c2ecf20Sopenharmony_ci 408c2ecf20Sopenharmony_ci#include <linux/kernel.h> 418c2ecf20Sopenharmony_ci#include <linux/module.h> 428c2ecf20Sopenharmony_ci#include <linux/errno.h> 438c2ecf20Sopenharmony_ci#include <linux/acpi.h> 448c2ecf20Sopenharmony_ci#include <linux/pci.h> 458c2ecf20Sopenharmony_ci#include <linux/mfd/core.h> 468c2ecf20Sopenharmony_ci#include <linux/mfd/lpc_ich.h> 478c2ecf20Sopenharmony_ci#include <linux/platform_data/itco_wdt.h> 488c2ecf20Sopenharmony_ci 498c2ecf20Sopenharmony_ci#define ACPIBASE 0x40 508c2ecf20Sopenharmony_ci#define ACPIBASE_GPE_OFF 0x28 518c2ecf20Sopenharmony_ci#define ACPIBASE_GPE_END 0x2f 528c2ecf20Sopenharmony_ci#define ACPIBASE_SMI_OFF 0x30 538c2ecf20Sopenharmony_ci#define ACPIBASE_SMI_END 0x33 548c2ecf20Sopenharmony_ci#define ACPIBASE_PMC_OFF 0x08 558c2ecf20Sopenharmony_ci#define ACPIBASE_PMC_END 0x0c 568c2ecf20Sopenharmony_ci#define ACPIBASE_TCO_OFF 0x60 578c2ecf20Sopenharmony_ci#define ACPIBASE_TCO_END 0x7f 588c2ecf20Sopenharmony_ci#define ACPICTRL_PMCBASE 0x44 598c2ecf20Sopenharmony_ci 608c2ecf20Sopenharmony_ci#define ACPIBASE_GCS_OFF 0x3410 618c2ecf20Sopenharmony_ci#define ACPIBASE_GCS_END 0x3414 628c2ecf20Sopenharmony_ci 638c2ecf20Sopenharmony_ci#define SPIBASE_BYT 0x54 648c2ecf20Sopenharmony_ci#define SPIBASE_BYT_SZ 512 658c2ecf20Sopenharmony_ci#define SPIBASE_BYT_EN BIT(1) 668c2ecf20Sopenharmony_ci#define BYT_BCR 0xfc 678c2ecf20Sopenharmony_ci#define BYT_BCR_WPD BIT(0) 688c2ecf20Sopenharmony_ci 698c2ecf20Sopenharmony_ci#define SPIBASE_LPT 0x3800 708c2ecf20Sopenharmony_ci#define SPIBASE_LPT_SZ 512 718c2ecf20Sopenharmony_ci#define BCR 0xdc 728c2ecf20Sopenharmony_ci#define BCR_WPD BIT(0) 738c2ecf20Sopenharmony_ci 748c2ecf20Sopenharmony_ci#define SPIBASE_APL_SZ 4096 758c2ecf20Sopenharmony_ci 768c2ecf20Sopenharmony_ci#define GPIOBASE_ICH0 0x58 778c2ecf20Sopenharmony_ci#define GPIOCTRL_ICH0 0x5C 788c2ecf20Sopenharmony_ci#define GPIOBASE_ICH6 0x48 798c2ecf20Sopenharmony_ci#define GPIOCTRL_ICH6 0x4C 808c2ecf20Sopenharmony_ci 818c2ecf20Sopenharmony_ci#define RCBABASE 0xf0 828c2ecf20Sopenharmony_ci 838c2ecf20Sopenharmony_ci#define wdt_io_res(i) wdt_res(0, i) 848c2ecf20Sopenharmony_ci#define wdt_mem_res(i) wdt_res(ICH_RES_MEM_OFF, i) 858c2ecf20Sopenharmony_ci#define wdt_res(b, i) (&wdt_ich_res[(b) + (i)]) 868c2ecf20Sopenharmony_ci 878c2ecf20Sopenharmony_cistruct lpc_ich_priv { 888c2ecf20Sopenharmony_ci int chipset; 898c2ecf20Sopenharmony_ci 908c2ecf20Sopenharmony_ci int abase; /* ACPI base */ 918c2ecf20Sopenharmony_ci int actrl_pbase; /* ACPI control or PMC base */ 928c2ecf20Sopenharmony_ci int gbase; /* GPIO base */ 938c2ecf20Sopenharmony_ci int gctrl; /* GPIO control */ 948c2ecf20Sopenharmony_ci 958c2ecf20Sopenharmony_ci int abase_save; /* Cached ACPI base value */ 968c2ecf20Sopenharmony_ci int actrl_pbase_save; /* Cached ACPI control or PMC base value */ 978c2ecf20Sopenharmony_ci int gctrl_save; /* Cached GPIO control value */ 988c2ecf20Sopenharmony_ci}; 998c2ecf20Sopenharmony_ci 1008c2ecf20Sopenharmony_cistatic struct resource wdt_ich_res[] = { 1018c2ecf20Sopenharmony_ci /* ACPI - TCO */ 1028c2ecf20Sopenharmony_ci { 1038c2ecf20Sopenharmony_ci .flags = IORESOURCE_IO, 1048c2ecf20Sopenharmony_ci }, 1058c2ecf20Sopenharmony_ci /* ACPI - SMI */ 1068c2ecf20Sopenharmony_ci { 1078c2ecf20Sopenharmony_ci .flags = IORESOURCE_IO, 1088c2ecf20Sopenharmony_ci }, 1098c2ecf20Sopenharmony_ci /* GCS or PMC */ 1108c2ecf20Sopenharmony_ci { 1118c2ecf20Sopenharmony_ci .flags = IORESOURCE_MEM, 1128c2ecf20Sopenharmony_ci }, 1138c2ecf20Sopenharmony_ci}; 1148c2ecf20Sopenharmony_ci 1158c2ecf20Sopenharmony_cistatic struct resource gpio_ich_res[] = { 1168c2ecf20Sopenharmony_ci /* GPIO */ 1178c2ecf20Sopenharmony_ci { 1188c2ecf20Sopenharmony_ci .flags = IORESOURCE_IO, 1198c2ecf20Sopenharmony_ci }, 1208c2ecf20Sopenharmony_ci /* ACPI - GPE0 */ 1218c2ecf20Sopenharmony_ci { 1228c2ecf20Sopenharmony_ci .flags = IORESOURCE_IO, 1238c2ecf20Sopenharmony_ci }, 1248c2ecf20Sopenharmony_ci}; 1258c2ecf20Sopenharmony_ci 1268c2ecf20Sopenharmony_cistatic struct resource intel_spi_res[] = { 1278c2ecf20Sopenharmony_ci { 1288c2ecf20Sopenharmony_ci .flags = IORESOURCE_MEM, 1298c2ecf20Sopenharmony_ci } 1308c2ecf20Sopenharmony_ci}; 1318c2ecf20Sopenharmony_ci 1328c2ecf20Sopenharmony_cistatic struct mfd_cell lpc_ich_wdt_cell = { 1338c2ecf20Sopenharmony_ci .name = "iTCO_wdt", 1348c2ecf20Sopenharmony_ci .num_resources = ARRAY_SIZE(wdt_ich_res), 1358c2ecf20Sopenharmony_ci .resources = wdt_ich_res, 1368c2ecf20Sopenharmony_ci .ignore_resource_conflicts = true, 1378c2ecf20Sopenharmony_ci}; 1388c2ecf20Sopenharmony_ci 1398c2ecf20Sopenharmony_cistatic struct mfd_cell lpc_ich_gpio_cell = { 1408c2ecf20Sopenharmony_ci .name = "gpio_ich", 1418c2ecf20Sopenharmony_ci .num_resources = ARRAY_SIZE(gpio_ich_res), 1428c2ecf20Sopenharmony_ci .resources = gpio_ich_res, 1438c2ecf20Sopenharmony_ci .ignore_resource_conflicts = true, 1448c2ecf20Sopenharmony_ci}; 1458c2ecf20Sopenharmony_ci 1468c2ecf20Sopenharmony_ci 1478c2ecf20Sopenharmony_cistatic struct mfd_cell lpc_ich_spi_cell = { 1488c2ecf20Sopenharmony_ci .name = "intel-spi", 1498c2ecf20Sopenharmony_ci .num_resources = ARRAY_SIZE(intel_spi_res), 1508c2ecf20Sopenharmony_ci .resources = intel_spi_res, 1518c2ecf20Sopenharmony_ci .ignore_resource_conflicts = true, 1528c2ecf20Sopenharmony_ci}; 1538c2ecf20Sopenharmony_ci 1548c2ecf20Sopenharmony_ci/* chipset related info */ 1558c2ecf20Sopenharmony_cienum lpc_chipsets { 1568c2ecf20Sopenharmony_ci LPC_ICH = 0, /* ICH */ 1578c2ecf20Sopenharmony_ci LPC_ICH0, /* ICH0 */ 1588c2ecf20Sopenharmony_ci LPC_ICH2, /* ICH2 */ 1598c2ecf20Sopenharmony_ci LPC_ICH2M, /* ICH2-M */ 1608c2ecf20Sopenharmony_ci LPC_ICH3, /* ICH3-S */ 1618c2ecf20Sopenharmony_ci LPC_ICH3M, /* ICH3-M */ 1628c2ecf20Sopenharmony_ci LPC_ICH4, /* ICH4 */ 1638c2ecf20Sopenharmony_ci LPC_ICH4M, /* ICH4-M */ 1648c2ecf20Sopenharmony_ci LPC_CICH, /* C-ICH */ 1658c2ecf20Sopenharmony_ci LPC_ICH5, /* ICH5 & ICH5R */ 1668c2ecf20Sopenharmony_ci LPC_6300ESB, /* 6300ESB */ 1678c2ecf20Sopenharmony_ci LPC_ICH6, /* ICH6 & ICH6R */ 1688c2ecf20Sopenharmony_ci LPC_ICH6M, /* ICH6-M */ 1698c2ecf20Sopenharmony_ci LPC_ICH6W, /* ICH6W & ICH6RW */ 1708c2ecf20Sopenharmony_ci LPC_631XESB, /* 631xESB/632xESB */ 1718c2ecf20Sopenharmony_ci LPC_ICH7, /* ICH7 & ICH7R */ 1728c2ecf20Sopenharmony_ci LPC_ICH7DH, /* ICH7DH */ 1738c2ecf20Sopenharmony_ci LPC_ICH7M, /* ICH7-M & ICH7-U */ 1748c2ecf20Sopenharmony_ci LPC_ICH7MDH, /* ICH7-M DH */ 1758c2ecf20Sopenharmony_ci LPC_NM10, /* NM10 */ 1768c2ecf20Sopenharmony_ci LPC_ICH8, /* ICH8 & ICH8R */ 1778c2ecf20Sopenharmony_ci LPC_ICH8DH, /* ICH8DH */ 1788c2ecf20Sopenharmony_ci LPC_ICH8DO, /* ICH8DO */ 1798c2ecf20Sopenharmony_ci LPC_ICH8M, /* ICH8M */ 1808c2ecf20Sopenharmony_ci LPC_ICH8ME, /* ICH8M-E */ 1818c2ecf20Sopenharmony_ci LPC_ICH9, /* ICH9 */ 1828c2ecf20Sopenharmony_ci LPC_ICH9R, /* ICH9R */ 1838c2ecf20Sopenharmony_ci LPC_ICH9DH, /* ICH9DH */ 1848c2ecf20Sopenharmony_ci LPC_ICH9DO, /* ICH9DO */ 1858c2ecf20Sopenharmony_ci LPC_ICH9M, /* ICH9M */ 1868c2ecf20Sopenharmony_ci LPC_ICH9ME, /* ICH9M-E */ 1878c2ecf20Sopenharmony_ci LPC_ICH10, /* ICH10 */ 1888c2ecf20Sopenharmony_ci LPC_ICH10R, /* ICH10R */ 1898c2ecf20Sopenharmony_ci LPC_ICH10D, /* ICH10D */ 1908c2ecf20Sopenharmony_ci LPC_ICH10DO, /* ICH10DO */ 1918c2ecf20Sopenharmony_ci LPC_PCH, /* PCH Desktop Full Featured */ 1928c2ecf20Sopenharmony_ci LPC_PCHM, /* PCH Mobile Full Featured */ 1938c2ecf20Sopenharmony_ci LPC_P55, /* P55 */ 1948c2ecf20Sopenharmony_ci LPC_PM55, /* PM55 */ 1958c2ecf20Sopenharmony_ci LPC_H55, /* H55 */ 1968c2ecf20Sopenharmony_ci LPC_QM57, /* QM57 */ 1978c2ecf20Sopenharmony_ci LPC_H57, /* H57 */ 1988c2ecf20Sopenharmony_ci LPC_HM55, /* HM55 */ 1998c2ecf20Sopenharmony_ci LPC_Q57, /* Q57 */ 2008c2ecf20Sopenharmony_ci LPC_HM57, /* HM57 */ 2018c2ecf20Sopenharmony_ci LPC_PCHMSFF, /* PCH Mobile SFF Full Featured */ 2028c2ecf20Sopenharmony_ci LPC_QS57, /* QS57 */ 2038c2ecf20Sopenharmony_ci LPC_3400, /* 3400 */ 2048c2ecf20Sopenharmony_ci LPC_3420, /* 3420 */ 2058c2ecf20Sopenharmony_ci LPC_3450, /* 3450 */ 2068c2ecf20Sopenharmony_ci LPC_EP80579, /* EP80579 */ 2078c2ecf20Sopenharmony_ci LPC_CPT, /* Cougar Point */ 2088c2ecf20Sopenharmony_ci LPC_CPTD, /* Cougar Point Desktop */ 2098c2ecf20Sopenharmony_ci LPC_CPTM, /* Cougar Point Mobile */ 2108c2ecf20Sopenharmony_ci LPC_PBG, /* Patsburg */ 2118c2ecf20Sopenharmony_ci LPC_DH89XXCC, /* DH89xxCC */ 2128c2ecf20Sopenharmony_ci LPC_PPT, /* Panther Point */ 2138c2ecf20Sopenharmony_ci LPC_LPT, /* Lynx Point */ 2148c2ecf20Sopenharmony_ci LPC_LPT_LP, /* Lynx Point-LP */ 2158c2ecf20Sopenharmony_ci LPC_WBG, /* Wellsburg */ 2168c2ecf20Sopenharmony_ci LPC_AVN, /* Avoton SoC */ 2178c2ecf20Sopenharmony_ci LPC_BAYTRAIL, /* Bay Trail SoC */ 2188c2ecf20Sopenharmony_ci LPC_COLETO, /* Coleto Creek */ 2198c2ecf20Sopenharmony_ci LPC_WPT_LP, /* Wildcat Point-LP */ 2208c2ecf20Sopenharmony_ci LPC_BRASWELL, /* Braswell SoC */ 2218c2ecf20Sopenharmony_ci LPC_LEWISBURG, /* Lewisburg */ 2228c2ecf20Sopenharmony_ci LPC_9S, /* 9 Series */ 2238c2ecf20Sopenharmony_ci LPC_APL, /* Apollo Lake SoC */ 2248c2ecf20Sopenharmony_ci LPC_GLK, /* Gemini Lake SoC */ 2258c2ecf20Sopenharmony_ci LPC_COUGARMOUNTAIN,/* Cougar Mountain SoC*/ 2268c2ecf20Sopenharmony_ci}; 2278c2ecf20Sopenharmony_ci 2288c2ecf20Sopenharmony_cistatic struct lpc_ich_info lpc_chipset_info[] = { 2298c2ecf20Sopenharmony_ci [LPC_ICH] = { 2308c2ecf20Sopenharmony_ci .name = "ICH", 2318c2ecf20Sopenharmony_ci .iTCO_version = 1, 2328c2ecf20Sopenharmony_ci }, 2338c2ecf20Sopenharmony_ci [LPC_ICH0] = { 2348c2ecf20Sopenharmony_ci .name = "ICH0", 2358c2ecf20Sopenharmony_ci .iTCO_version = 1, 2368c2ecf20Sopenharmony_ci }, 2378c2ecf20Sopenharmony_ci [LPC_ICH2] = { 2388c2ecf20Sopenharmony_ci .name = "ICH2", 2398c2ecf20Sopenharmony_ci .iTCO_version = 1, 2408c2ecf20Sopenharmony_ci }, 2418c2ecf20Sopenharmony_ci [LPC_ICH2M] = { 2428c2ecf20Sopenharmony_ci .name = "ICH2-M", 2438c2ecf20Sopenharmony_ci .iTCO_version = 1, 2448c2ecf20Sopenharmony_ci }, 2458c2ecf20Sopenharmony_ci [LPC_ICH3] = { 2468c2ecf20Sopenharmony_ci .name = "ICH3-S", 2478c2ecf20Sopenharmony_ci .iTCO_version = 1, 2488c2ecf20Sopenharmony_ci }, 2498c2ecf20Sopenharmony_ci [LPC_ICH3M] = { 2508c2ecf20Sopenharmony_ci .name = "ICH3-M", 2518c2ecf20Sopenharmony_ci .iTCO_version = 1, 2528c2ecf20Sopenharmony_ci }, 2538c2ecf20Sopenharmony_ci [LPC_ICH4] = { 2548c2ecf20Sopenharmony_ci .name = "ICH4", 2558c2ecf20Sopenharmony_ci .iTCO_version = 1, 2568c2ecf20Sopenharmony_ci }, 2578c2ecf20Sopenharmony_ci [LPC_ICH4M] = { 2588c2ecf20Sopenharmony_ci .name = "ICH4-M", 2598c2ecf20Sopenharmony_ci .iTCO_version = 1, 2608c2ecf20Sopenharmony_ci }, 2618c2ecf20Sopenharmony_ci [LPC_CICH] = { 2628c2ecf20Sopenharmony_ci .name = "C-ICH", 2638c2ecf20Sopenharmony_ci .iTCO_version = 1, 2648c2ecf20Sopenharmony_ci }, 2658c2ecf20Sopenharmony_ci [LPC_ICH5] = { 2668c2ecf20Sopenharmony_ci .name = "ICH5 or ICH5R", 2678c2ecf20Sopenharmony_ci .iTCO_version = 1, 2688c2ecf20Sopenharmony_ci }, 2698c2ecf20Sopenharmony_ci [LPC_6300ESB] = { 2708c2ecf20Sopenharmony_ci .name = "6300ESB", 2718c2ecf20Sopenharmony_ci .iTCO_version = 1, 2728c2ecf20Sopenharmony_ci }, 2738c2ecf20Sopenharmony_ci [LPC_ICH6] = { 2748c2ecf20Sopenharmony_ci .name = "ICH6 or ICH6R", 2758c2ecf20Sopenharmony_ci .iTCO_version = 2, 2768c2ecf20Sopenharmony_ci .gpio_version = ICH_V6_GPIO, 2778c2ecf20Sopenharmony_ci }, 2788c2ecf20Sopenharmony_ci [LPC_ICH6M] = { 2798c2ecf20Sopenharmony_ci .name = "ICH6-M", 2808c2ecf20Sopenharmony_ci .iTCO_version = 2, 2818c2ecf20Sopenharmony_ci .gpio_version = ICH_V6_GPIO, 2828c2ecf20Sopenharmony_ci }, 2838c2ecf20Sopenharmony_ci [LPC_ICH6W] = { 2848c2ecf20Sopenharmony_ci .name = "ICH6W or ICH6RW", 2858c2ecf20Sopenharmony_ci .iTCO_version = 2, 2868c2ecf20Sopenharmony_ci .gpio_version = ICH_V6_GPIO, 2878c2ecf20Sopenharmony_ci }, 2888c2ecf20Sopenharmony_ci [LPC_631XESB] = { 2898c2ecf20Sopenharmony_ci .name = "631xESB/632xESB", 2908c2ecf20Sopenharmony_ci .iTCO_version = 2, 2918c2ecf20Sopenharmony_ci .gpio_version = ICH_V6_GPIO, 2928c2ecf20Sopenharmony_ci }, 2938c2ecf20Sopenharmony_ci [LPC_ICH7] = { 2948c2ecf20Sopenharmony_ci .name = "ICH7 or ICH7R", 2958c2ecf20Sopenharmony_ci .iTCO_version = 2, 2968c2ecf20Sopenharmony_ci .gpio_version = ICH_V7_GPIO, 2978c2ecf20Sopenharmony_ci }, 2988c2ecf20Sopenharmony_ci [LPC_ICH7DH] = { 2998c2ecf20Sopenharmony_ci .name = "ICH7DH", 3008c2ecf20Sopenharmony_ci .iTCO_version = 2, 3018c2ecf20Sopenharmony_ci .gpio_version = ICH_V7_GPIO, 3028c2ecf20Sopenharmony_ci }, 3038c2ecf20Sopenharmony_ci [LPC_ICH7M] = { 3048c2ecf20Sopenharmony_ci .name = "ICH7-M or ICH7-U", 3058c2ecf20Sopenharmony_ci .iTCO_version = 2, 3068c2ecf20Sopenharmony_ci .gpio_version = ICH_V7_GPIO, 3078c2ecf20Sopenharmony_ci }, 3088c2ecf20Sopenharmony_ci [LPC_ICH7MDH] = { 3098c2ecf20Sopenharmony_ci .name = "ICH7-M DH", 3108c2ecf20Sopenharmony_ci .iTCO_version = 2, 3118c2ecf20Sopenharmony_ci .gpio_version = ICH_V7_GPIO, 3128c2ecf20Sopenharmony_ci }, 3138c2ecf20Sopenharmony_ci [LPC_NM10] = { 3148c2ecf20Sopenharmony_ci .name = "NM10", 3158c2ecf20Sopenharmony_ci .iTCO_version = 2, 3168c2ecf20Sopenharmony_ci .gpio_version = ICH_V7_GPIO, 3178c2ecf20Sopenharmony_ci }, 3188c2ecf20Sopenharmony_ci [LPC_ICH8] = { 3198c2ecf20Sopenharmony_ci .name = "ICH8 or ICH8R", 3208c2ecf20Sopenharmony_ci .iTCO_version = 2, 3218c2ecf20Sopenharmony_ci .gpio_version = ICH_V7_GPIO, 3228c2ecf20Sopenharmony_ci }, 3238c2ecf20Sopenharmony_ci [LPC_ICH8DH] = { 3248c2ecf20Sopenharmony_ci .name = "ICH8DH", 3258c2ecf20Sopenharmony_ci .iTCO_version = 2, 3268c2ecf20Sopenharmony_ci .gpio_version = ICH_V7_GPIO, 3278c2ecf20Sopenharmony_ci }, 3288c2ecf20Sopenharmony_ci [LPC_ICH8DO] = { 3298c2ecf20Sopenharmony_ci .name = "ICH8DO", 3308c2ecf20Sopenharmony_ci .iTCO_version = 2, 3318c2ecf20Sopenharmony_ci .gpio_version = ICH_V7_GPIO, 3328c2ecf20Sopenharmony_ci }, 3338c2ecf20Sopenharmony_ci [LPC_ICH8M] = { 3348c2ecf20Sopenharmony_ci .name = "ICH8M", 3358c2ecf20Sopenharmony_ci .iTCO_version = 2, 3368c2ecf20Sopenharmony_ci .gpio_version = ICH_V7_GPIO, 3378c2ecf20Sopenharmony_ci }, 3388c2ecf20Sopenharmony_ci [LPC_ICH8ME] = { 3398c2ecf20Sopenharmony_ci .name = "ICH8M-E", 3408c2ecf20Sopenharmony_ci .iTCO_version = 2, 3418c2ecf20Sopenharmony_ci .gpio_version = ICH_V7_GPIO, 3428c2ecf20Sopenharmony_ci }, 3438c2ecf20Sopenharmony_ci [LPC_ICH9] = { 3448c2ecf20Sopenharmony_ci .name = "ICH9", 3458c2ecf20Sopenharmony_ci .iTCO_version = 2, 3468c2ecf20Sopenharmony_ci .gpio_version = ICH_V9_GPIO, 3478c2ecf20Sopenharmony_ci }, 3488c2ecf20Sopenharmony_ci [LPC_ICH9R] = { 3498c2ecf20Sopenharmony_ci .name = "ICH9R", 3508c2ecf20Sopenharmony_ci .iTCO_version = 2, 3518c2ecf20Sopenharmony_ci .gpio_version = ICH_V9_GPIO, 3528c2ecf20Sopenharmony_ci }, 3538c2ecf20Sopenharmony_ci [LPC_ICH9DH] = { 3548c2ecf20Sopenharmony_ci .name = "ICH9DH", 3558c2ecf20Sopenharmony_ci .iTCO_version = 2, 3568c2ecf20Sopenharmony_ci .gpio_version = ICH_V9_GPIO, 3578c2ecf20Sopenharmony_ci }, 3588c2ecf20Sopenharmony_ci [LPC_ICH9DO] = { 3598c2ecf20Sopenharmony_ci .name = "ICH9DO", 3608c2ecf20Sopenharmony_ci .iTCO_version = 2, 3618c2ecf20Sopenharmony_ci .gpio_version = ICH_V9_GPIO, 3628c2ecf20Sopenharmony_ci }, 3638c2ecf20Sopenharmony_ci [LPC_ICH9M] = { 3648c2ecf20Sopenharmony_ci .name = "ICH9M", 3658c2ecf20Sopenharmony_ci .iTCO_version = 2, 3668c2ecf20Sopenharmony_ci .gpio_version = ICH_V9_GPIO, 3678c2ecf20Sopenharmony_ci }, 3688c2ecf20Sopenharmony_ci [LPC_ICH9ME] = { 3698c2ecf20Sopenharmony_ci .name = "ICH9M-E", 3708c2ecf20Sopenharmony_ci .iTCO_version = 2, 3718c2ecf20Sopenharmony_ci .gpio_version = ICH_V9_GPIO, 3728c2ecf20Sopenharmony_ci }, 3738c2ecf20Sopenharmony_ci [LPC_ICH10] = { 3748c2ecf20Sopenharmony_ci .name = "ICH10", 3758c2ecf20Sopenharmony_ci .iTCO_version = 2, 3768c2ecf20Sopenharmony_ci .gpio_version = ICH_V10CONS_GPIO, 3778c2ecf20Sopenharmony_ci }, 3788c2ecf20Sopenharmony_ci [LPC_ICH10R] = { 3798c2ecf20Sopenharmony_ci .name = "ICH10R", 3808c2ecf20Sopenharmony_ci .iTCO_version = 2, 3818c2ecf20Sopenharmony_ci .gpio_version = ICH_V10CONS_GPIO, 3828c2ecf20Sopenharmony_ci }, 3838c2ecf20Sopenharmony_ci [LPC_ICH10D] = { 3848c2ecf20Sopenharmony_ci .name = "ICH10D", 3858c2ecf20Sopenharmony_ci .iTCO_version = 2, 3868c2ecf20Sopenharmony_ci .gpio_version = ICH_V10CORP_GPIO, 3878c2ecf20Sopenharmony_ci }, 3888c2ecf20Sopenharmony_ci [LPC_ICH10DO] = { 3898c2ecf20Sopenharmony_ci .name = "ICH10DO", 3908c2ecf20Sopenharmony_ci .iTCO_version = 2, 3918c2ecf20Sopenharmony_ci .gpio_version = ICH_V10CORP_GPIO, 3928c2ecf20Sopenharmony_ci }, 3938c2ecf20Sopenharmony_ci [LPC_PCH] = { 3948c2ecf20Sopenharmony_ci .name = "PCH Desktop Full Featured", 3958c2ecf20Sopenharmony_ci .iTCO_version = 2, 3968c2ecf20Sopenharmony_ci .gpio_version = ICH_V5_GPIO, 3978c2ecf20Sopenharmony_ci }, 3988c2ecf20Sopenharmony_ci [LPC_PCHM] = { 3998c2ecf20Sopenharmony_ci .name = "PCH Mobile Full Featured", 4008c2ecf20Sopenharmony_ci .iTCO_version = 2, 4018c2ecf20Sopenharmony_ci .gpio_version = ICH_V5_GPIO, 4028c2ecf20Sopenharmony_ci }, 4038c2ecf20Sopenharmony_ci [LPC_P55] = { 4048c2ecf20Sopenharmony_ci .name = "P55", 4058c2ecf20Sopenharmony_ci .iTCO_version = 2, 4068c2ecf20Sopenharmony_ci .gpio_version = ICH_V5_GPIO, 4078c2ecf20Sopenharmony_ci }, 4088c2ecf20Sopenharmony_ci [LPC_PM55] = { 4098c2ecf20Sopenharmony_ci .name = "PM55", 4108c2ecf20Sopenharmony_ci .iTCO_version = 2, 4118c2ecf20Sopenharmony_ci .gpio_version = ICH_V5_GPIO, 4128c2ecf20Sopenharmony_ci }, 4138c2ecf20Sopenharmony_ci [LPC_H55] = { 4148c2ecf20Sopenharmony_ci .name = "H55", 4158c2ecf20Sopenharmony_ci .iTCO_version = 2, 4168c2ecf20Sopenharmony_ci .gpio_version = ICH_V5_GPIO, 4178c2ecf20Sopenharmony_ci }, 4188c2ecf20Sopenharmony_ci [LPC_QM57] = { 4198c2ecf20Sopenharmony_ci .name = "QM57", 4208c2ecf20Sopenharmony_ci .iTCO_version = 2, 4218c2ecf20Sopenharmony_ci .gpio_version = ICH_V5_GPIO, 4228c2ecf20Sopenharmony_ci }, 4238c2ecf20Sopenharmony_ci [LPC_H57] = { 4248c2ecf20Sopenharmony_ci .name = "H57", 4258c2ecf20Sopenharmony_ci .iTCO_version = 2, 4268c2ecf20Sopenharmony_ci .gpio_version = ICH_V5_GPIO, 4278c2ecf20Sopenharmony_ci }, 4288c2ecf20Sopenharmony_ci [LPC_HM55] = { 4298c2ecf20Sopenharmony_ci .name = "HM55", 4308c2ecf20Sopenharmony_ci .iTCO_version = 2, 4318c2ecf20Sopenharmony_ci .gpio_version = ICH_V5_GPIO, 4328c2ecf20Sopenharmony_ci }, 4338c2ecf20Sopenharmony_ci [LPC_Q57] = { 4348c2ecf20Sopenharmony_ci .name = "Q57", 4358c2ecf20Sopenharmony_ci .iTCO_version = 2, 4368c2ecf20Sopenharmony_ci .gpio_version = ICH_V5_GPIO, 4378c2ecf20Sopenharmony_ci }, 4388c2ecf20Sopenharmony_ci [LPC_HM57] = { 4398c2ecf20Sopenharmony_ci .name = "HM57", 4408c2ecf20Sopenharmony_ci .iTCO_version = 2, 4418c2ecf20Sopenharmony_ci .gpio_version = ICH_V5_GPIO, 4428c2ecf20Sopenharmony_ci }, 4438c2ecf20Sopenharmony_ci [LPC_PCHMSFF] = { 4448c2ecf20Sopenharmony_ci .name = "PCH Mobile SFF Full Featured", 4458c2ecf20Sopenharmony_ci .iTCO_version = 2, 4468c2ecf20Sopenharmony_ci .gpio_version = ICH_V5_GPIO, 4478c2ecf20Sopenharmony_ci }, 4488c2ecf20Sopenharmony_ci [LPC_QS57] = { 4498c2ecf20Sopenharmony_ci .name = "QS57", 4508c2ecf20Sopenharmony_ci .iTCO_version = 2, 4518c2ecf20Sopenharmony_ci .gpio_version = ICH_V5_GPIO, 4528c2ecf20Sopenharmony_ci }, 4538c2ecf20Sopenharmony_ci [LPC_3400] = { 4548c2ecf20Sopenharmony_ci .name = "3400", 4558c2ecf20Sopenharmony_ci .iTCO_version = 2, 4568c2ecf20Sopenharmony_ci .gpio_version = ICH_V5_GPIO, 4578c2ecf20Sopenharmony_ci }, 4588c2ecf20Sopenharmony_ci [LPC_3420] = { 4598c2ecf20Sopenharmony_ci .name = "3420", 4608c2ecf20Sopenharmony_ci .iTCO_version = 2, 4618c2ecf20Sopenharmony_ci .gpio_version = ICH_V5_GPIO, 4628c2ecf20Sopenharmony_ci }, 4638c2ecf20Sopenharmony_ci [LPC_3450] = { 4648c2ecf20Sopenharmony_ci .name = "3450", 4658c2ecf20Sopenharmony_ci .iTCO_version = 2, 4668c2ecf20Sopenharmony_ci .gpio_version = ICH_V5_GPIO, 4678c2ecf20Sopenharmony_ci }, 4688c2ecf20Sopenharmony_ci [LPC_EP80579] = { 4698c2ecf20Sopenharmony_ci .name = "EP80579", 4708c2ecf20Sopenharmony_ci .iTCO_version = 2, 4718c2ecf20Sopenharmony_ci }, 4728c2ecf20Sopenharmony_ci [LPC_CPT] = { 4738c2ecf20Sopenharmony_ci .name = "Cougar Point", 4748c2ecf20Sopenharmony_ci .iTCO_version = 2, 4758c2ecf20Sopenharmony_ci .gpio_version = ICH_V5_GPIO, 4768c2ecf20Sopenharmony_ci }, 4778c2ecf20Sopenharmony_ci [LPC_CPTD] = { 4788c2ecf20Sopenharmony_ci .name = "Cougar Point Desktop", 4798c2ecf20Sopenharmony_ci .iTCO_version = 2, 4808c2ecf20Sopenharmony_ci .gpio_version = ICH_V5_GPIO, 4818c2ecf20Sopenharmony_ci }, 4828c2ecf20Sopenharmony_ci [LPC_CPTM] = { 4838c2ecf20Sopenharmony_ci .name = "Cougar Point Mobile", 4848c2ecf20Sopenharmony_ci .iTCO_version = 2, 4858c2ecf20Sopenharmony_ci .gpio_version = ICH_V5_GPIO, 4868c2ecf20Sopenharmony_ci }, 4878c2ecf20Sopenharmony_ci [LPC_PBG] = { 4888c2ecf20Sopenharmony_ci .name = "Patsburg", 4898c2ecf20Sopenharmony_ci .iTCO_version = 2, 4908c2ecf20Sopenharmony_ci }, 4918c2ecf20Sopenharmony_ci [LPC_DH89XXCC] = { 4928c2ecf20Sopenharmony_ci .name = "DH89xxCC", 4938c2ecf20Sopenharmony_ci .iTCO_version = 2, 4948c2ecf20Sopenharmony_ci }, 4958c2ecf20Sopenharmony_ci [LPC_PPT] = { 4968c2ecf20Sopenharmony_ci .name = "Panther Point", 4978c2ecf20Sopenharmony_ci .iTCO_version = 2, 4988c2ecf20Sopenharmony_ci .gpio_version = ICH_V5_GPIO, 4998c2ecf20Sopenharmony_ci }, 5008c2ecf20Sopenharmony_ci [LPC_LPT] = { 5018c2ecf20Sopenharmony_ci .name = "Lynx Point", 5028c2ecf20Sopenharmony_ci .iTCO_version = 2, 5038c2ecf20Sopenharmony_ci .gpio_version = ICH_V5_GPIO, 5048c2ecf20Sopenharmony_ci .spi_type = INTEL_SPI_LPT, 5058c2ecf20Sopenharmony_ci }, 5068c2ecf20Sopenharmony_ci [LPC_LPT_LP] = { 5078c2ecf20Sopenharmony_ci .name = "Lynx Point_LP", 5088c2ecf20Sopenharmony_ci .iTCO_version = 2, 5098c2ecf20Sopenharmony_ci .spi_type = INTEL_SPI_LPT, 5108c2ecf20Sopenharmony_ci }, 5118c2ecf20Sopenharmony_ci [LPC_WBG] = { 5128c2ecf20Sopenharmony_ci .name = "Wellsburg", 5138c2ecf20Sopenharmony_ci .iTCO_version = 2, 5148c2ecf20Sopenharmony_ci }, 5158c2ecf20Sopenharmony_ci [LPC_AVN] = { 5168c2ecf20Sopenharmony_ci .name = "Avoton SoC", 5178c2ecf20Sopenharmony_ci .iTCO_version = 3, 5188c2ecf20Sopenharmony_ci .gpio_version = AVOTON_GPIO, 5198c2ecf20Sopenharmony_ci .spi_type = INTEL_SPI_BYT, 5208c2ecf20Sopenharmony_ci }, 5218c2ecf20Sopenharmony_ci [LPC_BAYTRAIL] = { 5228c2ecf20Sopenharmony_ci .name = "Bay Trail SoC", 5238c2ecf20Sopenharmony_ci .iTCO_version = 3, 5248c2ecf20Sopenharmony_ci .spi_type = INTEL_SPI_BYT, 5258c2ecf20Sopenharmony_ci }, 5268c2ecf20Sopenharmony_ci [LPC_COLETO] = { 5278c2ecf20Sopenharmony_ci .name = "Coleto Creek", 5288c2ecf20Sopenharmony_ci .iTCO_version = 2, 5298c2ecf20Sopenharmony_ci }, 5308c2ecf20Sopenharmony_ci [LPC_WPT_LP] = { 5318c2ecf20Sopenharmony_ci .name = "Wildcat Point_LP", 5328c2ecf20Sopenharmony_ci .iTCO_version = 2, 5338c2ecf20Sopenharmony_ci .spi_type = INTEL_SPI_LPT, 5348c2ecf20Sopenharmony_ci }, 5358c2ecf20Sopenharmony_ci [LPC_BRASWELL] = { 5368c2ecf20Sopenharmony_ci .name = "Braswell SoC", 5378c2ecf20Sopenharmony_ci .iTCO_version = 3, 5388c2ecf20Sopenharmony_ci .spi_type = INTEL_SPI_BYT, 5398c2ecf20Sopenharmony_ci }, 5408c2ecf20Sopenharmony_ci [LPC_LEWISBURG] = { 5418c2ecf20Sopenharmony_ci .name = "Lewisburg", 5428c2ecf20Sopenharmony_ci .iTCO_version = 2, 5438c2ecf20Sopenharmony_ci }, 5448c2ecf20Sopenharmony_ci [LPC_9S] = { 5458c2ecf20Sopenharmony_ci .name = "9 Series", 5468c2ecf20Sopenharmony_ci .iTCO_version = 2, 5478c2ecf20Sopenharmony_ci .gpio_version = ICH_V5_GPIO, 5488c2ecf20Sopenharmony_ci }, 5498c2ecf20Sopenharmony_ci [LPC_APL] = { 5508c2ecf20Sopenharmony_ci .name = "Apollo Lake SoC", 5518c2ecf20Sopenharmony_ci .iTCO_version = 5, 5528c2ecf20Sopenharmony_ci .spi_type = INTEL_SPI_BXT, 5538c2ecf20Sopenharmony_ci }, 5548c2ecf20Sopenharmony_ci [LPC_GLK] = { 5558c2ecf20Sopenharmony_ci .name = "Gemini Lake SoC", 5568c2ecf20Sopenharmony_ci .spi_type = INTEL_SPI_BXT, 5578c2ecf20Sopenharmony_ci }, 5588c2ecf20Sopenharmony_ci [LPC_COUGARMOUNTAIN] = { 5598c2ecf20Sopenharmony_ci .name = "Cougar Mountain SoC", 5608c2ecf20Sopenharmony_ci .iTCO_version = 3, 5618c2ecf20Sopenharmony_ci }, 5628c2ecf20Sopenharmony_ci}; 5638c2ecf20Sopenharmony_ci 5648c2ecf20Sopenharmony_ci/* 5658c2ecf20Sopenharmony_ci * This data only exists for exporting the supported PCI ids 5668c2ecf20Sopenharmony_ci * via MODULE_DEVICE_TABLE. We do not actually register a 5678c2ecf20Sopenharmony_ci * pci_driver, because the I/O Controller Hub has also other 5688c2ecf20Sopenharmony_ci * functions that probably will be registered by other drivers. 5698c2ecf20Sopenharmony_ci */ 5708c2ecf20Sopenharmony_cistatic const struct pci_device_id lpc_ich_ids[] = { 5718c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x0f1c), LPC_BAYTRAIL}, 5728c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x1c41), LPC_CPT}, 5738c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x1c42), LPC_CPTD}, 5748c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x1c43), LPC_CPTM}, 5758c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x1c44), LPC_CPT}, 5768c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x1c45), LPC_CPT}, 5778c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x1c46), LPC_CPT}, 5788c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x1c47), LPC_CPT}, 5798c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x1c48), LPC_CPT}, 5808c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x1c49), LPC_CPT}, 5818c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x1c4a), LPC_CPT}, 5828c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x1c4b), LPC_CPT}, 5838c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x1c4c), LPC_CPT}, 5848c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x1c4d), LPC_CPT}, 5858c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x1c4e), LPC_CPT}, 5868c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x1c4f), LPC_CPT}, 5878c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x1c50), LPC_CPT}, 5888c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x1c51), LPC_CPT}, 5898c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x1c52), LPC_CPT}, 5908c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x1c53), LPC_CPT}, 5918c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x1c54), LPC_CPT}, 5928c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x1c55), LPC_CPT}, 5938c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x1c56), LPC_CPT}, 5948c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x1c57), LPC_CPT}, 5958c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x1c58), LPC_CPT}, 5968c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x1c59), LPC_CPT}, 5978c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x1c5a), LPC_CPT}, 5988c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x1c5b), LPC_CPT}, 5998c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x1c5c), LPC_CPT}, 6008c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x1c5d), LPC_CPT}, 6018c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x1c5e), LPC_CPT}, 6028c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x1c5f), LPC_CPT}, 6038c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x1d40), LPC_PBG}, 6048c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x1d41), LPC_PBG}, 6058c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x1e40), LPC_PPT}, 6068c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x1e41), LPC_PPT}, 6078c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x1e42), LPC_PPT}, 6088c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x1e43), LPC_PPT}, 6098c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x1e44), LPC_PPT}, 6108c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x1e45), LPC_PPT}, 6118c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x1e46), LPC_PPT}, 6128c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x1e47), LPC_PPT}, 6138c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x1e48), LPC_PPT}, 6148c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x1e49), LPC_PPT}, 6158c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x1e4a), LPC_PPT}, 6168c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x1e4b), LPC_PPT}, 6178c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x1e4c), LPC_PPT}, 6188c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x1e4d), LPC_PPT}, 6198c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x1e4e), LPC_PPT}, 6208c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x1e4f), LPC_PPT}, 6218c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x1e50), LPC_PPT}, 6228c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x1e51), LPC_PPT}, 6238c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x1e52), LPC_PPT}, 6248c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x1e53), LPC_PPT}, 6258c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x1e54), LPC_PPT}, 6268c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x1e55), LPC_PPT}, 6278c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x1e56), LPC_PPT}, 6288c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x1e57), LPC_PPT}, 6298c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x1e58), LPC_PPT}, 6308c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x1e59), LPC_PPT}, 6318c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x1e5a), LPC_PPT}, 6328c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x1e5b), LPC_PPT}, 6338c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x1e5c), LPC_PPT}, 6348c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x1e5d), LPC_PPT}, 6358c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x1e5e), LPC_PPT}, 6368c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x1e5f), LPC_PPT}, 6378c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x1f38), LPC_AVN}, 6388c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x1f39), LPC_AVN}, 6398c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x1f3a), LPC_AVN}, 6408c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x1f3b), LPC_AVN}, 6418c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x229c), LPC_BRASWELL}, 6428c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x2310), LPC_DH89XXCC}, 6438c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x2390), LPC_COLETO}, 6448c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x2410), LPC_ICH}, 6458c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x2420), LPC_ICH0}, 6468c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x2440), LPC_ICH2}, 6478c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x244c), LPC_ICH2M}, 6488c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x2450), LPC_CICH}, 6498c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x2480), LPC_ICH3}, 6508c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x248c), LPC_ICH3M}, 6518c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x24c0), LPC_ICH4}, 6528c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x24cc), LPC_ICH4M}, 6538c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x24d0), LPC_ICH5}, 6548c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x25a1), LPC_6300ESB}, 6558c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x2640), LPC_ICH6}, 6568c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x2641), LPC_ICH6M}, 6578c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x2642), LPC_ICH6W}, 6588c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x2670), LPC_631XESB}, 6598c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x2671), LPC_631XESB}, 6608c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x2672), LPC_631XESB}, 6618c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x2673), LPC_631XESB}, 6628c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x2674), LPC_631XESB}, 6638c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x2675), LPC_631XESB}, 6648c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x2676), LPC_631XESB}, 6658c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x2677), LPC_631XESB}, 6668c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x2678), LPC_631XESB}, 6678c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x2679), LPC_631XESB}, 6688c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x267a), LPC_631XESB}, 6698c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x267b), LPC_631XESB}, 6708c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x267c), LPC_631XESB}, 6718c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x267d), LPC_631XESB}, 6728c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x267e), LPC_631XESB}, 6738c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x267f), LPC_631XESB}, 6748c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x27b0), LPC_ICH7DH}, 6758c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x27b8), LPC_ICH7}, 6768c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x27b9), LPC_ICH7M}, 6778c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x27bc), LPC_NM10}, 6788c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x27bd), LPC_ICH7MDH}, 6798c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x2810), LPC_ICH8}, 6808c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x2811), LPC_ICH8ME}, 6818c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x2812), LPC_ICH8DH}, 6828c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x2814), LPC_ICH8DO}, 6838c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x2815), LPC_ICH8M}, 6848c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x2912), LPC_ICH9DH}, 6858c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x2914), LPC_ICH9DO}, 6868c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x2916), LPC_ICH9R}, 6878c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x2917), LPC_ICH9ME}, 6888c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x2918), LPC_ICH9}, 6898c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x2919), LPC_ICH9M}, 6908c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x3197), LPC_GLK}, 6918c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x2b9c), LPC_COUGARMOUNTAIN}, 6928c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x3a14), LPC_ICH10DO}, 6938c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x3a16), LPC_ICH10R}, 6948c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x3a18), LPC_ICH10}, 6958c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x3a1a), LPC_ICH10D}, 6968c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x3b00), LPC_PCH}, 6978c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x3b01), LPC_PCHM}, 6988c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x3b02), LPC_P55}, 6998c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x3b03), LPC_PM55}, 7008c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x3b06), LPC_H55}, 7018c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x3b07), LPC_QM57}, 7028c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x3b08), LPC_H57}, 7038c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x3b09), LPC_HM55}, 7048c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x3b0a), LPC_Q57}, 7058c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x3b0b), LPC_HM57}, 7068c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x3b0d), LPC_PCHMSFF}, 7078c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x3b0f), LPC_QS57}, 7088c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x3b12), LPC_3400}, 7098c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x3b14), LPC_3420}, 7108c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x3b16), LPC_3450}, 7118c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x5031), LPC_EP80579}, 7128c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x5ae8), LPC_APL}, 7138c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x8c40), LPC_LPT}, 7148c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x8c41), LPC_LPT}, 7158c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x8c42), LPC_LPT}, 7168c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x8c43), LPC_LPT}, 7178c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x8c44), LPC_LPT}, 7188c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x8c45), LPC_LPT}, 7198c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x8c46), LPC_LPT}, 7208c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x8c47), LPC_LPT}, 7218c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x8c48), LPC_LPT}, 7228c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x8c49), LPC_LPT}, 7238c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x8c4a), LPC_LPT}, 7248c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x8c4b), LPC_LPT}, 7258c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x8c4c), LPC_LPT}, 7268c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x8c4d), LPC_LPT}, 7278c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x8c4e), LPC_LPT}, 7288c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x8c4f), LPC_LPT}, 7298c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x8c50), LPC_LPT}, 7308c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x8c51), LPC_LPT}, 7318c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x8c52), LPC_LPT}, 7328c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x8c53), LPC_LPT}, 7338c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x8c54), LPC_LPT}, 7348c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x8c55), LPC_LPT}, 7358c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x8c56), LPC_LPT}, 7368c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x8c57), LPC_LPT}, 7378c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x8c58), LPC_LPT}, 7388c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x8c59), LPC_LPT}, 7398c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x8c5a), LPC_LPT}, 7408c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x8c5b), LPC_LPT}, 7418c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x8c5c), LPC_LPT}, 7428c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x8c5d), LPC_LPT}, 7438c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x8c5e), LPC_LPT}, 7448c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x8c5f), LPC_LPT}, 7458c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x8cc1), LPC_9S}, 7468c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x8cc2), LPC_9S}, 7478c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x8cc3), LPC_9S}, 7488c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x8cc4), LPC_9S}, 7498c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x8cc6), LPC_9S}, 7508c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x8d40), LPC_WBG}, 7518c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x8d41), LPC_WBG}, 7528c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x8d42), LPC_WBG}, 7538c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x8d43), LPC_WBG}, 7548c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x8d44), LPC_WBG}, 7558c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x8d45), LPC_WBG}, 7568c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x8d46), LPC_WBG}, 7578c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x8d47), LPC_WBG}, 7588c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x8d48), LPC_WBG}, 7598c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x8d49), LPC_WBG}, 7608c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x8d4a), LPC_WBG}, 7618c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x8d4b), LPC_WBG}, 7628c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x8d4c), LPC_WBG}, 7638c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x8d4d), LPC_WBG}, 7648c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x8d4e), LPC_WBG}, 7658c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x8d4f), LPC_WBG}, 7668c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x8d50), LPC_WBG}, 7678c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x8d51), LPC_WBG}, 7688c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x8d52), LPC_WBG}, 7698c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x8d53), LPC_WBG}, 7708c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x8d54), LPC_WBG}, 7718c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x8d55), LPC_WBG}, 7728c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x8d56), LPC_WBG}, 7738c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x8d57), LPC_WBG}, 7748c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x8d58), LPC_WBG}, 7758c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x8d59), LPC_WBG}, 7768c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x8d5a), LPC_WBG}, 7778c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x8d5b), LPC_WBG}, 7788c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x8d5c), LPC_WBG}, 7798c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x8d5d), LPC_WBG}, 7808c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x8d5e), LPC_WBG}, 7818c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x8d5f), LPC_WBG}, 7828c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x9c40), LPC_LPT_LP}, 7838c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x9c41), LPC_LPT_LP}, 7848c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x9c42), LPC_LPT_LP}, 7858c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x9c43), LPC_LPT_LP}, 7868c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x9c44), LPC_LPT_LP}, 7878c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x9c45), LPC_LPT_LP}, 7888c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x9c46), LPC_LPT_LP}, 7898c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x9c47), LPC_LPT_LP}, 7908c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x9cc1), LPC_WPT_LP}, 7918c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x9cc2), LPC_WPT_LP}, 7928c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x9cc3), LPC_WPT_LP}, 7938c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x9cc5), LPC_WPT_LP}, 7948c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x9cc6), LPC_WPT_LP}, 7958c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x9cc7), LPC_WPT_LP}, 7968c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0x9cc9), LPC_WPT_LP}, 7978c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0xa1c1), LPC_LEWISBURG}, 7988c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0xa1c2), LPC_LEWISBURG}, 7998c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0xa1c3), LPC_LEWISBURG}, 8008c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0xa1c4), LPC_LEWISBURG}, 8018c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0xa1c5), LPC_LEWISBURG}, 8028c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0xa1c6), LPC_LEWISBURG}, 8038c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0xa1c7), LPC_LEWISBURG}, 8048c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0xa242), LPC_LEWISBURG}, 8058c2ecf20Sopenharmony_ci { PCI_VDEVICE(INTEL, 0xa243), LPC_LEWISBURG}, 8068c2ecf20Sopenharmony_ci { 0, }, /* End of list */ 8078c2ecf20Sopenharmony_ci}; 8088c2ecf20Sopenharmony_ciMODULE_DEVICE_TABLE(pci, lpc_ich_ids); 8098c2ecf20Sopenharmony_ci 8108c2ecf20Sopenharmony_cistatic void lpc_ich_restore_config_space(struct pci_dev *dev) 8118c2ecf20Sopenharmony_ci{ 8128c2ecf20Sopenharmony_ci struct lpc_ich_priv *priv = pci_get_drvdata(dev); 8138c2ecf20Sopenharmony_ci 8148c2ecf20Sopenharmony_ci if (priv->abase_save >= 0) { 8158c2ecf20Sopenharmony_ci pci_write_config_byte(dev, priv->abase, priv->abase_save); 8168c2ecf20Sopenharmony_ci priv->abase_save = -1; 8178c2ecf20Sopenharmony_ci } 8188c2ecf20Sopenharmony_ci 8198c2ecf20Sopenharmony_ci if (priv->actrl_pbase_save >= 0) { 8208c2ecf20Sopenharmony_ci pci_write_config_byte(dev, priv->actrl_pbase, 8218c2ecf20Sopenharmony_ci priv->actrl_pbase_save); 8228c2ecf20Sopenharmony_ci priv->actrl_pbase_save = -1; 8238c2ecf20Sopenharmony_ci } 8248c2ecf20Sopenharmony_ci 8258c2ecf20Sopenharmony_ci if (priv->gctrl_save >= 0) { 8268c2ecf20Sopenharmony_ci pci_write_config_byte(dev, priv->gctrl, priv->gctrl_save); 8278c2ecf20Sopenharmony_ci priv->gctrl_save = -1; 8288c2ecf20Sopenharmony_ci } 8298c2ecf20Sopenharmony_ci} 8308c2ecf20Sopenharmony_ci 8318c2ecf20Sopenharmony_cistatic void lpc_ich_enable_acpi_space(struct pci_dev *dev) 8328c2ecf20Sopenharmony_ci{ 8338c2ecf20Sopenharmony_ci struct lpc_ich_priv *priv = pci_get_drvdata(dev); 8348c2ecf20Sopenharmony_ci u8 reg_save; 8358c2ecf20Sopenharmony_ci 8368c2ecf20Sopenharmony_ci switch (lpc_chipset_info[priv->chipset].iTCO_version) { 8378c2ecf20Sopenharmony_ci case 3: 8388c2ecf20Sopenharmony_ci /* 8398c2ecf20Sopenharmony_ci * Some chipsets (eg Avoton) enable the ACPI space in the 8408c2ecf20Sopenharmony_ci * ACPI BASE register. 8418c2ecf20Sopenharmony_ci */ 8428c2ecf20Sopenharmony_ci pci_read_config_byte(dev, priv->abase, ®_save); 8438c2ecf20Sopenharmony_ci pci_write_config_byte(dev, priv->abase, reg_save | 0x2); 8448c2ecf20Sopenharmony_ci priv->abase_save = reg_save; 8458c2ecf20Sopenharmony_ci break; 8468c2ecf20Sopenharmony_ci default: 8478c2ecf20Sopenharmony_ci /* 8488c2ecf20Sopenharmony_ci * Most chipsets enable the ACPI space in the ACPI control 8498c2ecf20Sopenharmony_ci * register. 8508c2ecf20Sopenharmony_ci */ 8518c2ecf20Sopenharmony_ci pci_read_config_byte(dev, priv->actrl_pbase, ®_save); 8528c2ecf20Sopenharmony_ci pci_write_config_byte(dev, priv->actrl_pbase, reg_save | 0x80); 8538c2ecf20Sopenharmony_ci priv->actrl_pbase_save = reg_save; 8548c2ecf20Sopenharmony_ci break; 8558c2ecf20Sopenharmony_ci } 8568c2ecf20Sopenharmony_ci} 8578c2ecf20Sopenharmony_ci 8588c2ecf20Sopenharmony_cistatic void lpc_ich_enable_gpio_space(struct pci_dev *dev) 8598c2ecf20Sopenharmony_ci{ 8608c2ecf20Sopenharmony_ci struct lpc_ich_priv *priv = pci_get_drvdata(dev); 8618c2ecf20Sopenharmony_ci u8 reg_save; 8628c2ecf20Sopenharmony_ci 8638c2ecf20Sopenharmony_ci pci_read_config_byte(dev, priv->gctrl, ®_save); 8648c2ecf20Sopenharmony_ci pci_write_config_byte(dev, priv->gctrl, reg_save | 0x10); 8658c2ecf20Sopenharmony_ci priv->gctrl_save = reg_save; 8668c2ecf20Sopenharmony_ci} 8678c2ecf20Sopenharmony_ci 8688c2ecf20Sopenharmony_cistatic void lpc_ich_enable_pmc_space(struct pci_dev *dev) 8698c2ecf20Sopenharmony_ci{ 8708c2ecf20Sopenharmony_ci struct lpc_ich_priv *priv = pci_get_drvdata(dev); 8718c2ecf20Sopenharmony_ci u8 reg_save; 8728c2ecf20Sopenharmony_ci 8738c2ecf20Sopenharmony_ci pci_read_config_byte(dev, priv->actrl_pbase, ®_save); 8748c2ecf20Sopenharmony_ci pci_write_config_byte(dev, priv->actrl_pbase, reg_save | 0x2); 8758c2ecf20Sopenharmony_ci 8768c2ecf20Sopenharmony_ci priv->actrl_pbase_save = reg_save; 8778c2ecf20Sopenharmony_ci} 8788c2ecf20Sopenharmony_ci 8798c2ecf20Sopenharmony_cistatic int lpc_ich_finalize_wdt_cell(struct pci_dev *dev) 8808c2ecf20Sopenharmony_ci{ 8818c2ecf20Sopenharmony_ci struct itco_wdt_platform_data *pdata; 8828c2ecf20Sopenharmony_ci struct lpc_ich_priv *priv = pci_get_drvdata(dev); 8838c2ecf20Sopenharmony_ci struct lpc_ich_info *info; 8848c2ecf20Sopenharmony_ci struct mfd_cell *cell = &lpc_ich_wdt_cell; 8858c2ecf20Sopenharmony_ci 8868c2ecf20Sopenharmony_ci pdata = devm_kzalloc(&dev->dev, sizeof(*pdata), GFP_KERNEL); 8878c2ecf20Sopenharmony_ci if (!pdata) 8888c2ecf20Sopenharmony_ci return -ENOMEM; 8898c2ecf20Sopenharmony_ci 8908c2ecf20Sopenharmony_ci info = &lpc_chipset_info[priv->chipset]; 8918c2ecf20Sopenharmony_ci 8928c2ecf20Sopenharmony_ci pdata->version = info->iTCO_version; 8938c2ecf20Sopenharmony_ci strlcpy(pdata->name, info->name, sizeof(pdata->name)); 8948c2ecf20Sopenharmony_ci 8958c2ecf20Sopenharmony_ci cell->platform_data = pdata; 8968c2ecf20Sopenharmony_ci cell->pdata_size = sizeof(*pdata); 8978c2ecf20Sopenharmony_ci return 0; 8988c2ecf20Sopenharmony_ci} 8998c2ecf20Sopenharmony_ci 9008c2ecf20Sopenharmony_cistatic void lpc_ich_finalize_gpio_cell(struct pci_dev *dev) 9018c2ecf20Sopenharmony_ci{ 9028c2ecf20Sopenharmony_ci struct lpc_ich_priv *priv = pci_get_drvdata(dev); 9038c2ecf20Sopenharmony_ci struct mfd_cell *cell = &lpc_ich_gpio_cell; 9048c2ecf20Sopenharmony_ci 9058c2ecf20Sopenharmony_ci cell->platform_data = &lpc_chipset_info[priv->chipset]; 9068c2ecf20Sopenharmony_ci cell->pdata_size = sizeof(struct lpc_ich_info); 9078c2ecf20Sopenharmony_ci} 9088c2ecf20Sopenharmony_ci 9098c2ecf20Sopenharmony_ci/* 9108c2ecf20Sopenharmony_ci * We don't check for resource conflict globally. There are 2 or 3 independent 9118c2ecf20Sopenharmony_ci * GPIO groups and it's enough to have access to one of these to instantiate 9128c2ecf20Sopenharmony_ci * the device. 9138c2ecf20Sopenharmony_ci */ 9148c2ecf20Sopenharmony_cistatic int lpc_ich_check_conflict_gpio(struct resource *res) 9158c2ecf20Sopenharmony_ci{ 9168c2ecf20Sopenharmony_ci int ret; 9178c2ecf20Sopenharmony_ci u8 use_gpio = 0; 9188c2ecf20Sopenharmony_ci 9198c2ecf20Sopenharmony_ci if (resource_size(res) >= 0x50 && 9208c2ecf20Sopenharmony_ci !acpi_check_region(res->start + 0x40, 0x10, "LPC ICH GPIO3")) 9218c2ecf20Sopenharmony_ci use_gpio |= 1 << 2; 9228c2ecf20Sopenharmony_ci 9238c2ecf20Sopenharmony_ci if (!acpi_check_region(res->start + 0x30, 0x10, "LPC ICH GPIO2")) 9248c2ecf20Sopenharmony_ci use_gpio |= 1 << 1; 9258c2ecf20Sopenharmony_ci 9268c2ecf20Sopenharmony_ci ret = acpi_check_region(res->start + 0x00, 0x30, "LPC ICH GPIO1"); 9278c2ecf20Sopenharmony_ci if (!ret) 9288c2ecf20Sopenharmony_ci use_gpio |= 1 << 0; 9298c2ecf20Sopenharmony_ci 9308c2ecf20Sopenharmony_ci return use_gpio ? use_gpio : ret; 9318c2ecf20Sopenharmony_ci} 9328c2ecf20Sopenharmony_ci 9338c2ecf20Sopenharmony_cistatic int lpc_ich_init_gpio(struct pci_dev *dev) 9348c2ecf20Sopenharmony_ci{ 9358c2ecf20Sopenharmony_ci struct lpc_ich_priv *priv = pci_get_drvdata(dev); 9368c2ecf20Sopenharmony_ci u32 base_addr_cfg; 9378c2ecf20Sopenharmony_ci u32 base_addr; 9388c2ecf20Sopenharmony_ci int ret; 9398c2ecf20Sopenharmony_ci bool acpi_conflict = false; 9408c2ecf20Sopenharmony_ci struct resource *res; 9418c2ecf20Sopenharmony_ci 9428c2ecf20Sopenharmony_ci /* Setup power management base register */ 9438c2ecf20Sopenharmony_ci pci_read_config_dword(dev, priv->abase, &base_addr_cfg); 9448c2ecf20Sopenharmony_ci base_addr = base_addr_cfg & 0x0000ff80; 9458c2ecf20Sopenharmony_ci if (!base_addr) { 9468c2ecf20Sopenharmony_ci dev_notice(&dev->dev, "I/O space for ACPI uninitialized\n"); 9478c2ecf20Sopenharmony_ci lpc_ich_gpio_cell.num_resources--; 9488c2ecf20Sopenharmony_ci goto gpe0_done; 9498c2ecf20Sopenharmony_ci } 9508c2ecf20Sopenharmony_ci 9518c2ecf20Sopenharmony_ci res = &gpio_ich_res[ICH_RES_GPE0]; 9528c2ecf20Sopenharmony_ci res->start = base_addr + ACPIBASE_GPE_OFF; 9538c2ecf20Sopenharmony_ci res->end = base_addr + ACPIBASE_GPE_END; 9548c2ecf20Sopenharmony_ci ret = acpi_check_resource_conflict(res); 9558c2ecf20Sopenharmony_ci if (ret) { 9568c2ecf20Sopenharmony_ci /* 9578c2ecf20Sopenharmony_ci * This isn't fatal for the GPIO, but we have to make sure that 9588c2ecf20Sopenharmony_ci * the platform_device subsystem doesn't see this resource 9598c2ecf20Sopenharmony_ci * or it will register an invalid region. 9608c2ecf20Sopenharmony_ci */ 9618c2ecf20Sopenharmony_ci lpc_ich_gpio_cell.num_resources--; 9628c2ecf20Sopenharmony_ci acpi_conflict = true; 9638c2ecf20Sopenharmony_ci } else { 9648c2ecf20Sopenharmony_ci lpc_ich_enable_acpi_space(dev); 9658c2ecf20Sopenharmony_ci } 9668c2ecf20Sopenharmony_ci 9678c2ecf20Sopenharmony_cigpe0_done: 9688c2ecf20Sopenharmony_ci /* Setup GPIO base register */ 9698c2ecf20Sopenharmony_ci pci_read_config_dword(dev, priv->gbase, &base_addr_cfg); 9708c2ecf20Sopenharmony_ci base_addr = base_addr_cfg & 0x0000ff80; 9718c2ecf20Sopenharmony_ci if (!base_addr) { 9728c2ecf20Sopenharmony_ci dev_notice(&dev->dev, "I/O space for GPIO uninitialized\n"); 9738c2ecf20Sopenharmony_ci ret = -ENODEV; 9748c2ecf20Sopenharmony_ci goto gpio_done; 9758c2ecf20Sopenharmony_ci } 9768c2ecf20Sopenharmony_ci 9778c2ecf20Sopenharmony_ci /* Older devices provide fewer GPIO and have a smaller resource size. */ 9788c2ecf20Sopenharmony_ci res = &gpio_ich_res[ICH_RES_GPIO]; 9798c2ecf20Sopenharmony_ci res->start = base_addr; 9808c2ecf20Sopenharmony_ci switch (lpc_chipset_info[priv->chipset].gpio_version) { 9818c2ecf20Sopenharmony_ci case ICH_V5_GPIO: 9828c2ecf20Sopenharmony_ci case ICH_V10CORP_GPIO: 9838c2ecf20Sopenharmony_ci res->end = res->start + 128 - 1; 9848c2ecf20Sopenharmony_ci break; 9858c2ecf20Sopenharmony_ci default: 9868c2ecf20Sopenharmony_ci res->end = res->start + 64 - 1; 9878c2ecf20Sopenharmony_ci break; 9888c2ecf20Sopenharmony_ci } 9898c2ecf20Sopenharmony_ci 9908c2ecf20Sopenharmony_ci ret = lpc_ich_check_conflict_gpio(res); 9918c2ecf20Sopenharmony_ci if (ret < 0) { 9928c2ecf20Sopenharmony_ci /* this isn't necessarily fatal for the GPIO */ 9938c2ecf20Sopenharmony_ci acpi_conflict = true; 9948c2ecf20Sopenharmony_ci goto gpio_done; 9958c2ecf20Sopenharmony_ci } 9968c2ecf20Sopenharmony_ci lpc_chipset_info[priv->chipset].use_gpio = ret; 9978c2ecf20Sopenharmony_ci lpc_ich_enable_gpio_space(dev); 9988c2ecf20Sopenharmony_ci 9998c2ecf20Sopenharmony_ci lpc_ich_finalize_gpio_cell(dev); 10008c2ecf20Sopenharmony_ci ret = mfd_add_devices(&dev->dev, PLATFORM_DEVID_AUTO, 10018c2ecf20Sopenharmony_ci &lpc_ich_gpio_cell, 1, NULL, 0, NULL); 10028c2ecf20Sopenharmony_ci 10038c2ecf20Sopenharmony_cigpio_done: 10048c2ecf20Sopenharmony_ci if (acpi_conflict) 10058c2ecf20Sopenharmony_ci pr_warn("Resource conflict(s) found affecting %s\n", 10068c2ecf20Sopenharmony_ci lpc_ich_gpio_cell.name); 10078c2ecf20Sopenharmony_ci return ret; 10088c2ecf20Sopenharmony_ci} 10098c2ecf20Sopenharmony_ci 10108c2ecf20Sopenharmony_cistatic int lpc_ich_init_wdt(struct pci_dev *dev) 10118c2ecf20Sopenharmony_ci{ 10128c2ecf20Sopenharmony_ci struct lpc_ich_priv *priv = pci_get_drvdata(dev); 10138c2ecf20Sopenharmony_ci u32 base_addr_cfg; 10148c2ecf20Sopenharmony_ci u32 base_addr; 10158c2ecf20Sopenharmony_ci int ret; 10168c2ecf20Sopenharmony_ci struct resource *res; 10178c2ecf20Sopenharmony_ci 10188c2ecf20Sopenharmony_ci /* If we have ACPI based watchdog use that instead */ 10198c2ecf20Sopenharmony_ci if (acpi_has_watchdog()) 10208c2ecf20Sopenharmony_ci return -ENODEV; 10218c2ecf20Sopenharmony_ci 10228c2ecf20Sopenharmony_ci /* Setup power management base register */ 10238c2ecf20Sopenharmony_ci pci_read_config_dword(dev, priv->abase, &base_addr_cfg); 10248c2ecf20Sopenharmony_ci base_addr = base_addr_cfg & 0x0000ff80; 10258c2ecf20Sopenharmony_ci if (!base_addr) { 10268c2ecf20Sopenharmony_ci dev_notice(&dev->dev, "I/O space for ACPI uninitialized\n"); 10278c2ecf20Sopenharmony_ci ret = -ENODEV; 10288c2ecf20Sopenharmony_ci goto wdt_done; 10298c2ecf20Sopenharmony_ci } 10308c2ecf20Sopenharmony_ci 10318c2ecf20Sopenharmony_ci res = wdt_io_res(ICH_RES_IO_TCO); 10328c2ecf20Sopenharmony_ci res->start = base_addr + ACPIBASE_TCO_OFF; 10338c2ecf20Sopenharmony_ci res->end = base_addr + ACPIBASE_TCO_END; 10348c2ecf20Sopenharmony_ci 10358c2ecf20Sopenharmony_ci res = wdt_io_res(ICH_RES_IO_SMI); 10368c2ecf20Sopenharmony_ci res->start = base_addr + ACPIBASE_SMI_OFF; 10378c2ecf20Sopenharmony_ci res->end = base_addr + ACPIBASE_SMI_END; 10388c2ecf20Sopenharmony_ci 10398c2ecf20Sopenharmony_ci lpc_ich_enable_acpi_space(dev); 10408c2ecf20Sopenharmony_ci 10418c2ecf20Sopenharmony_ci /* 10428c2ecf20Sopenharmony_ci * iTCO v2: 10438c2ecf20Sopenharmony_ci * Get the Memory-Mapped GCS register. To get access to it 10448c2ecf20Sopenharmony_ci * we have to read RCBA from PCI Config space 0xf0 and use 10458c2ecf20Sopenharmony_ci * it as base. GCS = RCBA + ICH6_GCS(0x3410). 10468c2ecf20Sopenharmony_ci * 10478c2ecf20Sopenharmony_ci * iTCO v3: 10488c2ecf20Sopenharmony_ci * Get the Power Management Configuration register. To get access 10498c2ecf20Sopenharmony_ci * to it we have to read the PMC BASE from config space and address 10508c2ecf20Sopenharmony_ci * the register at offset 0x8. 10518c2ecf20Sopenharmony_ci */ 10528c2ecf20Sopenharmony_ci if (lpc_chipset_info[priv->chipset].iTCO_version == 1) { 10538c2ecf20Sopenharmony_ci /* Don't register iomem for TCO ver 1 */ 10548c2ecf20Sopenharmony_ci lpc_ich_wdt_cell.num_resources--; 10558c2ecf20Sopenharmony_ci } else if (lpc_chipset_info[priv->chipset].iTCO_version == 2) { 10568c2ecf20Sopenharmony_ci pci_read_config_dword(dev, RCBABASE, &base_addr_cfg); 10578c2ecf20Sopenharmony_ci base_addr = base_addr_cfg & 0xffffc000; 10588c2ecf20Sopenharmony_ci if (!(base_addr_cfg & 1)) { 10598c2ecf20Sopenharmony_ci dev_notice(&dev->dev, "RCBA is disabled by " 10608c2ecf20Sopenharmony_ci "hardware/BIOS, device disabled\n"); 10618c2ecf20Sopenharmony_ci ret = -ENODEV; 10628c2ecf20Sopenharmony_ci goto wdt_done; 10638c2ecf20Sopenharmony_ci } 10648c2ecf20Sopenharmony_ci res = wdt_mem_res(ICH_RES_MEM_GCS_PMC); 10658c2ecf20Sopenharmony_ci res->start = base_addr + ACPIBASE_GCS_OFF; 10668c2ecf20Sopenharmony_ci res->end = base_addr + ACPIBASE_GCS_END; 10678c2ecf20Sopenharmony_ci } else if (lpc_chipset_info[priv->chipset].iTCO_version == 3) { 10688c2ecf20Sopenharmony_ci lpc_ich_enable_pmc_space(dev); 10698c2ecf20Sopenharmony_ci pci_read_config_dword(dev, ACPICTRL_PMCBASE, &base_addr_cfg); 10708c2ecf20Sopenharmony_ci base_addr = base_addr_cfg & 0xfffffe00; 10718c2ecf20Sopenharmony_ci 10728c2ecf20Sopenharmony_ci res = wdt_mem_res(ICH_RES_MEM_GCS_PMC); 10738c2ecf20Sopenharmony_ci res->start = base_addr + ACPIBASE_PMC_OFF; 10748c2ecf20Sopenharmony_ci res->end = base_addr + ACPIBASE_PMC_END; 10758c2ecf20Sopenharmony_ci } 10768c2ecf20Sopenharmony_ci 10778c2ecf20Sopenharmony_ci ret = lpc_ich_finalize_wdt_cell(dev); 10788c2ecf20Sopenharmony_ci if (ret) 10798c2ecf20Sopenharmony_ci goto wdt_done; 10808c2ecf20Sopenharmony_ci 10818c2ecf20Sopenharmony_ci ret = mfd_add_devices(&dev->dev, PLATFORM_DEVID_AUTO, 10828c2ecf20Sopenharmony_ci &lpc_ich_wdt_cell, 1, NULL, 0, NULL); 10838c2ecf20Sopenharmony_ci 10848c2ecf20Sopenharmony_ciwdt_done: 10858c2ecf20Sopenharmony_ci return ret; 10868c2ecf20Sopenharmony_ci} 10878c2ecf20Sopenharmony_ci 10888c2ecf20Sopenharmony_cistatic bool lpc_ich_byt_set_writeable(void __iomem *base, void *data) 10898c2ecf20Sopenharmony_ci{ 10908c2ecf20Sopenharmony_ci u32 val; 10918c2ecf20Sopenharmony_ci 10928c2ecf20Sopenharmony_ci val = readl(base + BYT_BCR); 10938c2ecf20Sopenharmony_ci if (!(val & BYT_BCR_WPD)) { 10948c2ecf20Sopenharmony_ci val |= BYT_BCR_WPD; 10958c2ecf20Sopenharmony_ci writel(val, base + BYT_BCR); 10968c2ecf20Sopenharmony_ci val = readl(base + BYT_BCR); 10978c2ecf20Sopenharmony_ci } 10988c2ecf20Sopenharmony_ci 10998c2ecf20Sopenharmony_ci return val & BYT_BCR_WPD; 11008c2ecf20Sopenharmony_ci} 11018c2ecf20Sopenharmony_ci 11028c2ecf20Sopenharmony_cistatic bool lpc_ich_lpt_set_writeable(void __iomem *base, void *data) 11038c2ecf20Sopenharmony_ci{ 11048c2ecf20Sopenharmony_ci struct pci_dev *pdev = data; 11058c2ecf20Sopenharmony_ci u32 bcr; 11068c2ecf20Sopenharmony_ci 11078c2ecf20Sopenharmony_ci pci_read_config_dword(pdev, BCR, &bcr); 11088c2ecf20Sopenharmony_ci if (!(bcr & BCR_WPD)) { 11098c2ecf20Sopenharmony_ci bcr |= BCR_WPD; 11108c2ecf20Sopenharmony_ci pci_write_config_dword(pdev, BCR, bcr); 11118c2ecf20Sopenharmony_ci pci_read_config_dword(pdev, BCR, &bcr); 11128c2ecf20Sopenharmony_ci } 11138c2ecf20Sopenharmony_ci 11148c2ecf20Sopenharmony_ci return bcr & BCR_WPD; 11158c2ecf20Sopenharmony_ci} 11168c2ecf20Sopenharmony_ci 11178c2ecf20Sopenharmony_cistatic bool lpc_ich_bxt_set_writeable(void __iomem *base, void *data) 11188c2ecf20Sopenharmony_ci{ 11198c2ecf20Sopenharmony_ci unsigned int spi = PCI_DEVFN(13, 2); 11208c2ecf20Sopenharmony_ci struct pci_bus *bus = data; 11218c2ecf20Sopenharmony_ci u32 bcr; 11228c2ecf20Sopenharmony_ci 11238c2ecf20Sopenharmony_ci pci_bus_read_config_dword(bus, spi, BCR, &bcr); 11248c2ecf20Sopenharmony_ci if (!(bcr & BCR_WPD)) { 11258c2ecf20Sopenharmony_ci bcr |= BCR_WPD; 11268c2ecf20Sopenharmony_ci pci_bus_write_config_dword(bus, spi, BCR, bcr); 11278c2ecf20Sopenharmony_ci pci_bus_read_config_dword(bus, spi, BCR, &bcr); 11288c2ecf20Sopenharmony_ci } 11298c2ecf20Sopenharmony_ci 11308c2ecf20Sopenharmony_ci return bcr & BCR_WPD; 11318c2ecf20Sopenharmony_ci} 11328c2ecf20Sopenharmony_ci 11338c2ecf20Sopenharmony_cistatic int lpc_ich_init_spi(struct pci_dev *dev) 11348c2ecf20Sopenharmony_ci{ 11358c2ecf20Sopenharmony_ci struct lpc_ich_priv *priv = pci_get_drvdata(dev); 11368c2ecf20Sopenharmony_ci struct resource *res = &intel_spi_res[0]; 11378c2ecf20Sopenharmony_ci struct intel_spi_boardinfo *info; 11388c2ecf20Sopenharmony_ci u32 spi_base, rcba; 11398c2ecf20Sopenharmony_ci 11408c2ecf20Sopenharmony_ci info = devm_kzalloc(&dev->dev, sizeof(*info), GFP_KERNEL); 11418c2ecf20Sopenharmony_ci if (!info) 11428c2ecf20Sopenharmony_ci return -ENOMEM; 11438c2ecf20Sopenharmony_ci 11448c2ecf20Sopenharmony_ci info->type = lpc_chipset_info[priv->chipset].spi_type; 11458c2ecf20Sopenharmony_ci 11468c2ecf20Sopenharmony_ci switch (info->type) { 11478c2ecf20Sopenharmony_ci case INTEL_SPI_BYT: 11488c2ecf20Sopenharmony_ci pci_read_config_dword(dev, SPIBASE_BYT, &spi_base); 11498c2ecf20Sopenharmony_ci if (spi_base & SPIBASE_BYT_EN) { 11508c2ecf20Sopenharmony_ci res->start = spi_base & ~(SPIBASE_BYT_SZ - 1); 11518c2ecf20Sopenharmony_ci res->end = res->start + SPIBASE_BYT_SZ - 1; 11528c2ecf20Sopenharmony_ci 11538c2ecf20Sopenharmony_ci info->set_writeable = lpc_ich_byt_set_writeable; 11548c2ecf20Sopenharmony_ci } 11558c2ecf20Sopenharmony_ci break; 11568c2ecf20Sopenharmony_ci 11578c2ecf20Sopenharmony_ci case INTEL_SPI_LPT: 11588c2ecf20Sopenharmony_ci pci_read_config_dword(dev, RCBABASE, &rcba); 11598c2ecf20Sopenharmony_ci if (rcba & 1) { 11608c2ecf20Sopenharmony_ci spi_base = round_down(rcba, SPIBASE_LPT_SZ); 11618c2ecf20Sopenharmony_ci res->start = spi_base + SPIBASE_LPT; 11628c2ecf20Sopenharmony_ci res->end = res->start + SPIBASE_LPT_SZ - 1; 11638c2ecf20Sopenharmony_ci 11648c2ecf20Sopenharmony_ci info->set_writeable = lpc_ich_lpt_set_writeable; 11658c2ecf20Sopenharmony_ci info->data = dev; 11668c2ecf20Sopenharmony_ci } 11678c2ecf20Sopenharmony_ci break; 11688c2ecf20Sopenharmony_ci 11698c2ecf20Sopenharmony_ci case INTEL_SPI_BXT: { 11708c2ecf20Sopenharmony_ci unsigned int p2sb = PCI_DEVFN(13, 0); 11718c2ecf20Sopenharmony_ci unsigned int spi = PCI_DEVFN(13, 2); 11728c2ecf20Sopenharmony_ci struct pci_bus *bus = dev->bus; 11738c2ecf20Sopenharmony_ci 11748c2ecf20Sopenharmony_ci /* 11758c2ecf20Sopenharmony_ci * The P2SB is hidden by BIOS and we need to unhide it in 11768c2ecf20Sopenharmony_ci * order to read BAR of the SPI flash device. Once that is 11778c2ecf20Sopenharmony_ci * done we hide it again. 11788c2ecf20Sopenharmony_ci */ 11798c2ecf20Sopenharmony_ci pci_bus_write_config_byte(bus, p2sb, 0xe1, 0x0); 11808c2ecf20Sopenharmony_ci pci_bus_read_config_dword(bus, spi, PCI_BASE_ADDRESS_0, 11818c2ecf20Sopenharmony_ci &spi_base); 11828c2ecf20Sopenharmony_ci if (spi_base != ~0) { 11838c2ecf20Sopenharmony_ci res->start = spi_base & 0xfffffff0; 11848c2ecf20Sopenharmony_ci res->end = res->start + SPIBASE_APL_SZ - 1; 11858c2ecf20Sopenharmony_ci 11868c2ecf20Sopenharmony_ci info->set_writeable = lpc_ich_bxt_set_writeable; 11878c2ecf20Sopenharmony_ci info->data = bus; 11888c2ecf20Sopenharmony_ci } 11898c2ecf20Sopenharmony_ci 11908c2ecf20Sopenharmony_ci pci_bus_write_config_byte(bus, p2sb, 0xe1, 0x1); 11918c2ecf20Sopenharmony_ci break; 11928c2ecf20Sopenharmony_ci } 11938c2ecf20Sopenharmony_ci 11948c2ecf20Sopenharmony_ci default: 11958c2ecf20Sopenharmony_ci return -EINVAL; 11968c2ecf20Sopenharmony_ci } 11978c2ecf20Sopenharmony_ci 11988c2ecf20Sopenharmony_ci if (!res->start) 11998c2ecf20Sopenharmony_ci return -ENODEV; 12008c2ecf20Sopenharmony_ci 12018c2ecf20Sopenharmony_ci lpc_ich_spi_cell.platform_data = info; 12028c2ecf20Sopenharmony_ci lpc_ich_spi_cell.pdata_size = sizeof(*info); 12038c2ecf20Sopenharmony_ci 12048c2ecf20Sopenharmony_ci return mfd_add_devices(&dev->dev, PLATFORM_DEVID_NONE, 12058c2ecf20Sopenharmony_ci &lpc_ich_spi_cell, 1, NULL, 0, NULL); 12068c2ecf20Sopenharmony_ci} 12078c2ecf20Sopenharmony_ci 12088c2ecf20Sopenharmony_cistatic int lpc_ich_probe(struct pci_dev *dev, 12098c2ecf20Sopenharmony_ci const struct pci_device_id *id) 12108c2ecf20Sopenharmony_ci{ 12118c2ecf20Sopenharmony_ci struct lpc_ich_priv *priv; 12128c2ecf20Sopenharmony_ci int ret; 12138c2ecf20Sopenharmony_ci bool cell_added = false; 12148c2ecf20Sopenharmony_ci 12158c2ecf20Sopenharmony_ci priv = devm_kzalloc(&dev->dev, 12168c2ecf20Sopenharmony_ci sizeof(struct lpc_ich_priv), GFP_KERNEL); 12178c2ecf20Sopenharmony_ci if (!priv) 12188c2ecf20Sopenharmony_ci return -ENOMEM; 12198c2ecf20Sopenharmony_ci 12208c2ecf20Sopenharmony_ci priv->chipset = id->driver_data; 12218c2ecf20Sopenharmony_ci 12228c2ecf20Sopenharmony_ci priv->actrl_pbase_save = -1; 12238c2ecf20Sopenharmony_ci priv->abase_save = -1; 12248c2ecf20Sopenharmony_ci 12258c2ecf20Sopenharmony_ci priv->abase = ACPIBASE; 12268c2ecf20Sopenharmony_ci priv->actrl_pbase = ACPICTRL_PMCBASE; 12278c2ecf20Sopenharmony_ci 12288c2ecf20Sopenharmony_ci priv->gctrl_save = -1; 12298c2ecf20Sopenharmony_ci if (priv->chipset <= LPC_ICH5) { 12308c2ecf20Sopenharmony_ci priv->gbase = GPIOBASE_ICH0; 12318c2ecf20Sopenharmony_ci priv->gctrl = GPIOCTRL_ICH0; 12328c2ecf20Sopenharmony_ci } else { 12338c2ecf20Sopenharmony_ci priv->gbase = GPIOBASE_ICH6; 12348c2ecf20Sopenharmony_ci priv->gctrl = GPIOCTRL_ICH6; 12358c2ecf20Sopenharmony_ci } 12368c2ecf20Sopenharmony_ci 12378c2ecf20Sopenharmony_ci pci_set_drvdata(dev, priv); 12388c2ecf20Sopenharmony_ci 12398c2ecf20Sopenharmony_ci if (lpc_chipset_info[priv->chipset].iTCO_version) { 12408c2ecf20Sopenharmony_ci ret = lpc_ich_init_wdt(dev); 12418c2ecf20Sopenharmony_ci if (!ret) 12428c2ecf20Sopenharmony_ci cell_added = true; 12438c2ecf20Sopenharmony_ci } 12448c2ecf20Sopenharmony_ci 12458c2ecf20Sopenharmony_ci if (lpc_chipset_info[priv->chipset].gpio_version) { 12468c2ecf20Sopenharmony_ci ret = lpc_ich_init_gpio(dev); 12478c2ecf20Sopenharmony_ci if (!ret) 12488c2ecf20Sopenharmony_ci cell_added = true; 12498c2ecf20Sopenharmony_ci } 12508c2ecf20Sopenharmony_ci 12518c2ecf20Sopenharmony_ci if (lpc_chipset_info[priv->chipset].spi_type) { 12528c2ecf20Sopenharmony_ci ret = lpc_ich_init_spi(dev); 12538c2ecf20Sopenharmony_ci if (!ret) 12548c2ecf20Sopenharmony_ci cell_added = true; 12558c2ecf20Sopenharmony_ci } 12568c2ecf20Sopenharmony_ci 12578c2ecf20Sopenharmony_ci /* 12588c2ecf20Sopenharmony_ci * We only care if at least one or none of the cells registered 12598c2ecf20Sopenharmony_ci * successfully. 12608c2ecf20Sopenharmony_ci */ 12618c2ecf20Sopenharmony_ci if (!cell_added) { 12628c2ecf20Sopenharmony_ci dev_warn(&dev->dev, "No MFD cells added\n"); 12638c2ecf20Sopenharmony_ci lpc_ich_restore_config_space(dev); 12648c2ecf20Sopenharmony_ci return -ENODEV; 12658c2ecf20Sopenharmony_ci } 12668c2ecf20Sopenharmony_ci 12678c2ecf20Sopenharmony_ci return 0; 12688c2ecf20Sopenharmony_ci} 12698c2ecf20Sopenharmony_ci 12708c2ecf20Sopenharmony_cistatic void lpc_ich_remove(struct pci_dev *dev) 12718c2ecf20Sopenharmony_ci{ 12728c2ecf20Sopenharmony_ci mfd_remove_devices(&dev->dev); 12738c2ecf20Sopenharmony_ci lpc_ich_restore_config_space(dev); 12748c2ecf20Sopenharmony_ci} 12758c2ecf20Sopenharmony_ci 12768c2ecf20Sopenharmony_cistatic struct pci_driver lpc_ich_driver = { 12778c2ecf20Sopenharmony_ci .name = "lpc_ich", 12788c2ecf20Sopenharmony_ci .id_table = lpc_ich_ids, 12798c2ecf20Sopenharmony_ci .probe = lpc_ich_probe, 12808c2ecf20Sopenharmony_ci .remove = lpc_ich_remove, 12818c2ecf20Sopenharmony_ci}; 12828c2ecf20Sopenharmony_ci 12838c2ecf20Sopenharmony_cimodule_pci_driver(lpc_ich_driver); 12848c2ecf20Sopenharmony_ci 12858c2ecf20Sopenharmony_ciMODULE_AUTHOR("Aaron Sierra <asierra@xes-inc.com>"); 12868c2ecf20Sopenharmony_ciMODULE_DESCRIPTION("LPC interface for Intel ICH"); 12878c2ecf20Sopenharmony_ciMODULE_LICENSE("GPL"); 1288