blob: fe915eecc2fc9a93ba013191f0274284a2e5429f [file] [log] [blame]
arch import user (historical)98d0d302005-07-06 17:13:46 +00001/*
Uwe Hermann8af6d552010-10-17 19:13:18 +00002 * This file is part of the coreboot project.
3 *
Timothy Pearson40ce5d92015-01-23 20:18:19 -06004 * Copyright (C) 2015 Timothy Pearson <tpearson@raptorengineeringinc.com>, Raptor Engineering
Uwe Hermann8af6d552010-10-17 19:13:18 +00005 * Copyright (C) 2003 Linux Networx
6 * Copyright (C) 2003 SuSE Linux AG
7 * Copyright (C) 2004 Tyan Computer
8 * Written by Yinghai Lu <yhlu@tyan.com> for Tyan Computer.
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; version 2 of the License.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
arch import user (historical)98d0d302005-07-06 17:13:46 +000018 */
Uwe Hermann7f3d48c2008-10-02 18:19:17 +000019
arch import user (historical)98d0d302005-07-06 17:13:46 +000020#include <console/console.h>
21#include <device/device.h>
22#include <device/pci.h>
23#include <device/pnp.h>
24#include <device/pci_ids.h>
25#include <device/pci_ops.h>
26#include <pc80/mc146818rtc.h>
27#include <pc80/isa-dma.h>
arch import user (historical)98d0d302005-07-06 17:13:46 +000028#include <arch/io.h>
Stefan Reinauer0401bd82010-01-16 18:31:34 +000029#include <arch/ioapic.h>
Vladimir Serbinenko6985d4e2014-09-21 14:31:19 +020030#include <arch/acpi.h>
Yinghai Lub8170f72006-01-06 01:55:42 +000031#include <cpu/x86/lapic.h>
Carl-Daniel Hailfinger2ee67792008-10-01 12:52:52 +000032#include <stdlib.h>
Jonathan A. Kollasch948dede2013-10-11 15:52:30 -050033#include <assert.h>
Timothy Pearson7f3ae392015-01-27 01:44:37 -060034#include <cpu/amd/powernow.h>
Kyösti Mälkki413e3da2015-02-03 08:05:55 +020035#include "chip.h"
arch import user (historical)98d0d302005-07-06 17:13:46 +000036
arch import user (historical)98d0d302005-07-06 17:13:46 +000037#define NMI_OFF 0
38
Timothy Pearson40ce5d92015-01-23 20:18:19 -060039// Power restoration control register is at 0x7a
arch import user (historical)98d0d302005-07-06 17:13:46 +000040#define PREVIOUS_POWER_STATE 0x7A
41
Timothy Pearson40ce5d92015-01-23 20:18:19 -060042 // Auxiliary power control register possibly located at 0xe3
43#define PREVIOUS_POWER_STATE_AUX 0xe3
44
arch import user (historical)98d0d302005-07-06 17:13:46 +000045#define MAINBOARD_POWER_OFF 0
46#define MAINBOARD_POWER_ON 1
47#define SLOW_CPU_OFF 0
48#define SLOW_CPU__ON 1
49
Elyes HAOUAS1cbe19f2018-05-19 10:57:04 +020050static void lpc_common_init(struct device *dev)
arch import user (historical)98d0d302005-07-06 17:13:46 +000051{
Uwe Hermann7e2fbd52011-01-04 17:36:55 +000052 u32 dword;
Jonathan A. Kollasch948dede2013-10-11 15:52:30 -050053 struct resource *res;
Myles Watson64caf362008-09-18 16:27:00 +000054
Uwe Hermann7e2fbd52011-01-04 17:36:55 +000055 /* I/O APIC initialization. */
Jonathan A. Kollasch948dede2013-10-11 15:52:30 -050056 res = find_resource(dev, PCI_BASE_ADDRESS_1); /* IOAPIC */
57 ASSERT(res != NULL);
Kevin Paul Herbertbde6d302014-12-24 18:43:20 -080058 setup_ioapic(res2mmio(res, 0, 0), 0); /* Don't rename IOAPIC ID. */
Myles Watson64caf362008-09-18 16:27:00 +000059
arch import user (historical)98d0d302005-07-06 17:13:46 +000060#if 1
Myles Watson64caf362008-09-18 16:27:00 +000061 dword = pci_read_config32(dev, 0xe4);
Uwe Hermann7f3d48c2008-10-02 18:19:17 +000062 dword |= (1 << 23);
Myles Watson64caf362008-09-18 16:27:00 +000063 pci_write_config32(dev, 0xe4, dword);
64#endif
arch import user (historical)98d0d302005-07-06 17:13:46 +000065}
66
Elyes HAOUAS1cbe19f2018-05-19 10:57:04 +020067static void lpc_slave_init(struct device *dev)
arch import user (historical)98d0d302005-07-06 17:13:46 +000068{
69 lpc_common_init(dev);
70}
71
Elyes HAOUAS1cbe19f2018-05-19 10:57:04 +020072static void rom_dummy_write(struct device *dev)
Uwe Hermann7f3d48c2008-10-02 18:19:17 +000073{
Uwe Hermann7e2fbd52011-01-04 17:36:55 +000074 u8 old, new;
75 u8 *p;
Myles Watson64caf362008-09-18 16:27:00 +000076
77 old = pci_read_config8(dev, 0x88);
78 new = old | 0xc0;
Uwe Hermann7f3d48c2008-10-02 18:19:17 +000079 if (new != old)
Myles Watson64caf362008-09-18 16:27:00 +000080 pci_write_config8(dev, 0x88, new);
Uwe Hermann7f3d48c2008-10-02 18:19:17 +000081 /* Enable write. */
Myles Watson64caf362008-09-18 16:27:00 +000082 old = pci_read_config8(dev, 0x6d);
83 new = old | 0x01;
Uwe Hermann7f3d48c2008-10-02 18:19:17 +000084 if (new != old)
Myles Watson64caf362008-09-18 16:27:00 +000085 pci_write_config8(dev, 0x6d, new);
arch import user (historical)98d0d302005-07-06 17:13:46 +000086
Uwe Hermann7f3d48c2008-10-02 18:19:17 +000087 /* Dummy write. */
Uwe Hermann7e2fbd52011-01-04 17:36:55 +000088 p = (u8 *) 0xffffffe0;
arch import user (historical)98d0d302005-07-06 17:13:46 +000089 old = 0;
90 *p = old;
91 old = *p;
92
Uwe Hermann7f3d48c2008-10-02 18:19:17 +000093 /* Disable write. */
Myles Watson64caf362008-09-18 16:27:00 +000094 old = pci_read_config8(dev, 0x6d);
95 new = old & 0xfe;
Uwe Hermann7f3d48c2008-10-02 18:19:17 +000096 if (new != old)
Myles Watson64caf362008-09-18 16:27:00 +000097 pci_write_config8(dev, 0x6d, new);
arch import user (historical)98d0d302005-07-06 17:13:46 +000098}
Uwe Hermann7f3d48c2008-10-02 18:19:17 +000099
Uwe Hermann7e2fbd52011-01-04 17:36:55 +0000100unsigned pm_base = 0;
arch import user (historical)98d0d302005-07-06 17:13:46 +0000101
Elyes HAOUAS1cbe19f2018-05-19 10:57:04 +0200102static void lpc_init(struct device *dev)
arch import user (historical)98d0d302005-07-06 17:13:46 +0000103{
Uwe Hermann7e2fbd52011-01-04 17:36:55 +0000104 u8 byte, byte_old;
Luc Verhaegena9c5ea02009-06-03 14:19:33 +0000105 int on, nmi_option;
arch import user (historical)98d0d302005-07-06 17:13:46 +0000106
107 lpc_common_init(dev);
108
Myles Watson283a4942009-03-10 20:39:27 +0000109 pm_base = pci_read_config32(dev, 0x60) & 0xff00;
Elyes HAOUAS7f9df962016-08-21 12:06:54 +0200110 printk(BIOS_INFO, "%s: pm_base = %x\n", __func__, pm_base);
Myles Watson283a4942009-03-10 20:39:27 +0000111
Uwe Hermann7e2fbd52011-01-04 17:36:55 +0000112 /* Power after power fail */
Nico Huber9faae2b2018-11-14 00:00:35 +0100113 on = CONFIG_MAINBOARD_POWER_FAILURE_STATE;
Luc Verhaegena9c5ea02009-06-03 14:19:33 +0000114 get_option(&on, "power_on_after_fail");
Myles Watson64caf362008-09-18 16:27:00 +0000115 byte = pci_read_config8(dev, PREVIOUS_POWER_STATE);
Timothy Pearson40ce5d92015-01-23 20:18:19 -0600116 byte &= ~0x45;
Uwe Hermann7f3d48c2008-10-02 18:19:17 +0000117 if (!on)
Timothy Pearson40ce5d92015-01-23 20:18:19 -0600118 byte |= 0x45;
Myles Watson64caf362008-09-18 16:27:00 +0000119 pci_write_config8(dev, PREVIOUS_POWER_STATE, byte);
Stefan Reinauerc02b4fc2010-03-22 11:42:32 +0000120 printk(BIOS_INFO, "set power %s after power fail\n", on ? "on" : "off");
arch import user (historical)98d0d302005-07-06 17:13:46 +0000121
Uwe Hermann7f3d48c2008-10-02 18:19:17 +0000122 /* Throttle the CPU speed down for testing. */
Myles Watson64caf362008-09-18 16:27:00 +0000123 on = SLOW_CPU_OFF;
Luc Verhaegena9c5ea02009-06-03 14:19:33 +0000124 get_option(&on, "slow_cpu");
Uwe Hermann7f3d48c2008-10-02 18:19:17 +0000125 if (on) {
Uwe Hermann7e2fbd52011-01-04 17:36:55 +0000126 u16 pm10_bar;
127 u32 dword;
Uwe Hermann7f3d48c2008-10-02 18:19:17 +0000128 pm10_bar = (pci_read_config16(dev, 0x60) & 0xff00);
129 outl(((on << 1) + 0x10), (pm10_bar + 0x10));
Myles Watson64caf362008-09-18 16:27:00 +0000130 dword = inl(pm10_bar + 0x10);
Uwe Hermann7f3d48c2008-10-02 18:19:17 +0000131 on = 8 - on;
Stefan Reinauerc02b4fc2010-03-22 11:42:32 +0000132 printk(BIOS_DEBUG, "Throttling CPU %2d.%1.1d percent.\n",
Uwe Hermann7e2fbd52011-01-04 17:36:55 +0000133 (on * 12) + (on >> 1), (on & 1) * 5);
Myles Watson64caf362008-09-18 16:27:00 +0000134 }
arch import user (historical)98d0d302005-07-06 17:13:46 +0000135
Uwe Hermann7f3d48c2008-10-02 18:19:17 +0000136 /* Set up NMI on errors. */
137 byte = inb(0x70); /* RTC70 */
arch import user (historical)98d0d302005-07-06 17:13:46 +0000138 byte_old = byte;
139 nmi_option = NMI_OFF;
Luc Verhaegena9c5ea02009-06-03 14:19:33 +0000140 get_option(&nmi_option, "nmi");
Uwe Hermann7e2fbd52011-01-04 17:36:55 +0000141 if (nmi_option)
Uwe Hermann7f3d48c2008-10-02 18:19:17 +0000142 byte &= ~(1 << 7); /* Set NMI. */
Uwe Hermann7e2fbd52011-01-04 17:36:55 +0000143 else
Uwe Hermann7f3d48c2008-10-02 18:19:17 +0000144 byte |= (1 << 7); /* Can't mask NMI from PCI-E and NMI_NOW. */
Uwe Hermann7f3d48c2008-10-02 18:19:17 +0000145 if (byte != byte_old)
Ed Swierke42e1422009-07-10 15:05:35 +0000146 outb(byte, 0x70);
Myles Watson64caf362008-09-18 16:27:00 +0000147
Uwe Hermann7f3d48c2008-10-02 18:19:17 +0000148 /* Initialize the real time clock (RTC). */
Gabe Blackb3f08c62014-04-30 17:12:25 -0700149 cmos_init(0);
arch import user (historical)98d0d302005-07-06 17:13:46 +0000150
Uwe Hermann7f3d48c2008-10-02 18:19:17 +0000151 /* Initialize ISA DMA. */
arch import user (historical)98d0d302005-07-06 17:13:46 +0000152 isa_dma_init();
153
arch import user (historical)98d0d302005-07-06 17:13:46 +0000154 rom_dummy_write(dev);
arch import user (historical)98d0d302005-07-06 17:13:46 +0000155}
156
Elyes HAOUAS1cbe19f2018-05-19 10:57:04 +0200157static void ck804_lpc_read_resources(struct device *dev)
arch import user (historical)98d0d302005-07-06 17:13:46 +0000158{
159 struct resource *res;
160 unsigned long index;
161
Uwe Hermann7f3d48c2008-10-02 18:19:17 +0000162 /* Get the normal PCI resources of this device. */
163 /* We got one for APIC, or one more for TRAP. */
164 pci_dev_read_resources(dev);
arch import user (historical)98d0d302005-07-06 17:13:46 +0000165
Jonathan Kollaschfadb0042011-03-03 20:52:50 +0000166 /* HPET */
167 pci_get_resource(dev, 0x44);
168
Uwe Hermann7f3d48c2008-10-02 18:19:17 +0000169 /* Get resource for ACPI, SYSTEM_CONTROL, ANALOG_CONTROL. */
170 for (index = 0x60; index <= 0x68; index += 4) /* We got another 3. */
Myles Watson64caf362008-09-18 16:27:00 +0000171 pci_get_resource(dev, index);
Myles Watson64caf362008-09-18 16:27:00 +0000172 compact_resources(dev);
173
Uwe Hermann7f3d48c2008-10-02 18:19:17 +0000174 /* Add an extra subtractive resource for both memory and I/O. */
Myles Watson64caf362008-09-18 16:27:00 +0000175 res = new_resource(dev, IOINDEX_SUBTRACTIVE(0, 0));
Myles Watson29cc9ed2009-07-02 18:56:24 +0000176 res->base = 0;
177 res->size = 0x1000;
178 res->flags = IORESOURCE_IO | IORESOURCE_SUBTRACTIVE |
179 IORESOURCE_ASSIGNED | IORESOURCE_FIXED;
Myles Watson64caf362008-09-18 16:27:00 +0000180
181 res = new_resource(dev, IOINDEX_SUBTRACTIVE(1, 0));
Myles Watson29cc9ed2009-07-02 18:56:24 +0000182 res->base = 0xff800000;
183 res->size = 0x00800000; /* 8 MB for flash */
184 res->flags = IORESOURCE_MEM | IORESOURCE_SUBTRACTIVE |
185 IORESOURCE_ASSIGNED | IORESOURCE_FIXED;
186
Jonathan Kollaschfadb0042011-03-03 20:52:50 +0000187 if (dev->device != PCI_DEVICE_ID_NVIDIA_CK804_SLAVE) {
Jonathan A. Kollasch772d0262013-10-11 16:09:37 -0500188 res = find_resource(dev, PCI_BASE_ADDRESS_1); /* IOAPIC */
Jonathan Kollaschfadb0042011-03-03 20:52:50 +0000189 if (res) {
190 res->base = IO_APIC_ADDR;
191 res->flags |= IORESOURCE_ASSIGNED | IORESOURCE_FIXED;
192 }
193
194 res = find_resource(dev, 0x44); /* HPET */
195 if (res) {
Jonathan A. Kollasch6f0e8bd2015-07-15 13:47:33 -0500196 res->base = CONFIG_HPET_ADDRESS;
Jonathan Kollaschfadb0042011-03-03 20:52:50 +0000197 res->flags |= IORESOURCE_ASSIGNED | IORESOURCE_FIXED;
198 }
199 }
200}
201
Elyes HAOUAS1cbe19f2018-05-19 10:57:04 +0200202static void ck804_lpc_set_resources(struct device *dev)
Jonathan Kollaschfadb0042011-03-03 20:52:50 +0000203{
Jonathan A. Kollaschcf18c852013-10-11 16:14:18 -0500204 u8 byte;
Jonathan Kollaschfadb0042011-03-03 20:52:50 +0000205 struct resource *res;
206
207 pci_dev_set_resources(dev);
208
209 /* APIC */
Jonathan A. Kollasch772d0262013-10-11 16:09:37 -0500210 res = find_resource(dev, PCI_BASE_ADDRESS_1);
Jonathan Kollaschfadb0042011-03-03 20:52:50 +0000211 if (res) {
Jonathan A. Kollaschcf18c852013-10-11 16:14:18 -0500212 byte = pci_read_config8(dev, 0x74);
213 byte |= (1 << 1); /* enable access to PCI_BASE_ADDRESS_1 */
214 pci_write_config8(dev, 0x74, byte);
Jonathan A. Kollasch772d0262013-10-11 16:09:37 -0500215 pci_write_config32(dev, PCI_BASE_ADDRESS_1, res->base);
Jonathan Kollaschfadb0042011-03-03 20:52:50 +0000216 res->flags |= IORESOURCE_STORED;
217 report_resource_stored(dev, res, "");
Jonathan A. Kollaschcf18c852013-10-11 16:14:18 -0500218 byte |= (1 << 0); /* enable decode of IOAPIC space */
219 byte &= ~(1 << 1); /* hide PCI_BASE_ADDRESS_1 */
220 pci_write_config8(dev, 0x74, byte);
Jonathan Kollaschfadb0042011-03-03 20:52:50 +0000221 }
222
223 /* HPET */
224 res = find_resource(dev, 0x44);
225 if (res) {
226 pci_write_config32(dev, 0x44, res->base|1);
227 res->flags |= IORESOURCE_STORED;
228 report_resource_stored(dev, res, "");
229 }
arch import user (historical)98d0d302005-07-06 17:13:46 +0000230}
231
Myles Watson64caf362008-09-18 16:27:00 +0000232/**
Uwe Hermann7f3d48c2008-10-02 18:19:17 +0000233 * Enable resources for children devices.
Myles Watson64caf362008-09-18 16:27:00 +0000234 *
Uwe Hermann7f3d48c2008-10-02 18:19:17 +0000235 * This function is called by the global enable_resources() indirectly via the
arch import user (historical)98d0d302005-07-06 17:13:46 +0000236 * device_operation::enable_resources() method of devices.
Myles Watson64caf362008-09-18 16:27:00 +0000237 */
Elyes HAOUAS1cbe19f2018-05-19 10:57:04 +0200238static void ck804_lpc_enable_childrens_resources(struct device *dev)
Myles Watson64caf362008-09-18 16:27:00 +0000239{
Myles Watson894a3472010-06-09 22:41:35 +0000240 struct bus *link;
Uwe Hermann7e2fbd52011-01-04 17:36:55 +0000241 u32 reg, reg_var[4];
Uwe Hermann7f3d48c2008-10-02 18:19:17 +0000242 int i, var_num = 0;
Myles Watson64caf362008-09-18 16:27:00 +0000243
arch import user (historical)98d0d302005-07-06 17:13:46 +0000244 reg = pci_read_config32(dev, 0xa0);
245
Myles Watson894a3472010-06-09 22:41:35 +0000246 for (link = dev->link_list; link; link = link->next) {
Elyes HAOUAS1cbe19f2018-05-19 10:57:04 +0200247 struct device *child;
Myles Watson894a3472010-06-09 22:41:35 +0000248 for (child = link->children; child; child = child->sibling) {
Myles Watson29cc9ed2009-07-02 18:56:24 +0000249 if (child->enabled && (child->path.type == DEVICE_PATH_PNP)) {
Myles Watsonc25cc112010-05-21 14:33:48 +0000250 struct resource *res;
251 for (res = child->resource_list; res; res = res->next) {
Uwe Hermann7e2fbd52011-01-04 17:36:55 +0000252 unsigned long base, end; /* Don't need long long. */
Uwe Hermann7f3d48c2008-10-02 18:19:17 +0000253 if (!(res->flags & IORESOURCE_IO))
254 continue;
Myles Watson64caf362008-09-18 16:27:00 +0000255 base = res->base;
256 end = resource_end(res);
Stefan Reinauer64ed2b72010-03-31 14:47:43 +0000257 printk(BIOS_DEBUG, "ck804 lpc decode:%s, base=0x%08lx, end=0x%08lx\n", dev_path(child), base, end);
Uwe Hermann7f3d48c2008-10-02 18:19:17 +0000258 switch (base) {
259 case 0x3f8: // COM1
260 reg |= (1 << 0);
261 break;
262 case 0x2f8: // COM2
263 reg |= (1 << 1);
264 break;
265 case 0x378: // Parallel 1
266 reg |= (1 << 24);
267 break;
268 case 0x3f0: // FD0
269 reg |= (1 << 20);
270 break;
271 case 0x220: // Audio 0
272 reg |= (1 << 8);
273 break;
274 case 0x300: // Midi 0
275 reg |= (1 << 12);
276 break;
arch import user (historical)98d0d302005-07-06 17:13:46 +0000277 }
Uwe Hermann7f3d48c2008-10-02 18:19:17 +0000278 if (base == 0x290 || base >= 0x400) {
Uwe Hermann7e2fbd52011-01-04 17:36:55 +0000279 /* Only 4 var; compact them? */
Uwe Hermann7f3d48c2008-10-02 18:19:17 +0000280 if (var_num >= 4)
Uwe Hermann7e2fbd52011-01-04 17:36:55 +0000281 continue;
Uwe Hermann7f3d48c2008-10-02 18:19:17 +0000282 reg |= (1 << (28 + var_num));
283 reg_var[var_num++] = (base & 0xffff) | ((end & 0xffff) << 16);
Myles Watson64caf362008-09-18 16:27:00 +0000284 }
arch import user (historical)98d0d302005-07-06 17:13:46 +0000285 }
286 }
Myles Watson64caf362008-09-18 16:27:00 +0000287 }
288 }
arch import user (historical)98d0d302005-07-06 17:13:46 +0000289 pci_write_config32(dev, 0xa0, reg);
Uwe Hermann7f3d48c2008-10-02 18:19:17 +0000290 for (i = 0; i < var_num; i++)
291 pci_write_config32(dev, 0xa8 + i * 4, reg_var[i]);
arch import user (historical)98d0d302005-07-06 17:13:46 +0000292}
293
Elyes HAOUAS1cbe19f2018-05-19 10:57:04 +0200294static void ck804_lpc_enable_resources(struct device *dev)
arch import user (historical)98d0d302005-07-06 17:13:46 +0000295{
Myles Watson64caf362008-09-18 16:27:00 +0000296 pci_dev_enable_resources(dev);
297 ck804_lpc_enable_childrens_resources(dev);
arch import user (historical)98d0d302005-07-06 17:13:46 +0000298}
299
Vladimir Serbinenko83f81ca2014-11-09 13:30:50 +0100300#if IS_ENABLED(CONFIG_HAVE_ACPI_TABLES)
Timothy Pearson7f3ae392015-01-27 01:44:37 -0600301
Elyes HAOUAS1cbe19f2018-05-19 10:57:04 +0200302static void southbridge_acpi_fill_ssdt_generator(struct device *device)
Timothy Pearson7f3ae392015-01-27 01:44:37 -0600303{
304 amd_generate_powernow(0, 0, 0);
305}
306
307#endif
308
Uwe Hermann7f3d48c2008-10-02 18:19:17 +0000309static struct device_operations lpc_ops = {
arch import user (historical)98d0d302005-07-06 17:13:46 +0000310 .read_resources = ck804_lpc_read_resources,
Jonathan Kollaschfadb0042011-03-03 20:52:50 +0000311 .set_resources = ck804_lpc_set_resources,
arch import user (historical)98d0d302005-07-06 17:13:46 +0000312 .enable_resources = ck804_lpc_enable_resources,
Vladimir Serbinenkof21271e2014-10-16 18:00:27 +0200313#if IS_ENABLED(CONFIG_HAVE_ACPI_TABLES)
Timothy Pearson7f3ae392015-01-27 01:44:37 -0600314 .acpi_fill_ssdt_generator = southbridge_acpi_fill_ssdt_generator,
Vladimir Serbinenko6985d4e2014-09-21 14:31:19 +0200315 .write_acpi_tables = acpi_write_hpet,
316#endif
arch import user (historical)98d0d302005-07-06 17:13:46 +0000317 .init = lpc_init,
Kyösti Mälkkid0e212c2015-02-26 20:47:47 +0200318 .scan_bus = scan_lpc_bus,
Jonathan Kollaschc7f3f802010-10-29 15:56:04 +0000319 .ops_pci = &ck804_pci_ops,
arch import user (historical)98d0d302005-07-06 17:13:46 +0000320};
Uwe Hermann7f3d48c2008-10-02 18:19:17 +0000321
Stefan Reinauerf1cf1f72007-10-24 09:08:58 +0000322static const struct pci_driver lpc_driver __pci_driver = {
arch import user (historical)98d0d302005-07-06 17:13:46 +0000323 .ops = &lpc_ops,
324 .vendor = PCI_VENDOR_ID_NVIDIA,
325 .device = PCI_DEVICE_ID_NVIDIA_CK804_LPC,
326};
327
Stefan Reinauerf1cf1f72007-10-24 09:08:58 +0000328static const struct pci_driver lpc_driver_pro __pci_driver = {
Myles Watson64caf362008-09-18 16:27:00 +0000329 .ops = &lpc_ops,
330 .vendor = PCI_VENDOR_ID_NVIDIA,
331 .device = PCI_DEVICE_ID_NVIDIA_CK804_PRO,
arch import user (historical)98d0d302005-07-06 17:13:46 +0000332};
333
Uwe Hermann7f3d48c2008-10-02 18:19:17 +0000334static struct device_operations lpc_slave_ops = {
Myles Watson64caf362008-09-18 16:27:00 +0000335 .read_resources = ck804_lpc_read_resources,
336 .set_resources = pci_dev_set_resources,
337 .enable_resources = pci_dev_enable_resources,
Vladimir Serbinenkof21271e2014-10-16 18:00:27 +0200338#if IS_ENABLED(CONFIG_HAVE_ACPI_TABLES)
Vladimir Serbinenko6985d4e2014-09-21 14:31:19 +0200339 .write_acpi_tables = acpi_write_hpet,
340#endif
Myles Watson64caf362008-09-18 16:27:00 +0000341 .init = lpc_slave_init,
Jonathan Kollaschc7f3f802010-10-29 15:56:04 +0000342 .ops_pci = &ck804_pci_ops,
arch import user (historical)98d0d302005-07-06 17:13:46 +0000343};
344
Stefan Reinauerf1cf1f72007-10-24 09:08:58 +0000345static const struct pci_driver lpc_driver_slave __pci_driver = {
Myles Watson64caf362008-09-18 16:27:00 +0000346 .ops = &lpc_slave_ops,
347 .vendor = PCI_VENDOR_ID_NVIDIA,
348 .device = PCI_DEVICE_ID_NVIDIA_CK804_SLAVE,
349};