blob: 15643bd8e0aeb1731cd3ab61f82907f28fc217da [file] [log] [blame]
Angel Pons182dbde2020-04-02 23:49:05 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Arthur Heymans7b9c1392017-04-09 20:40:39 +02002
Arthur Heymans7b9c1392017-04-09 20:40:39 +02003#include <device/device.h>
Arthur Heymans7b9c1392017-04-09 20:40:39 +02004#include <device/smbus.h>
5#include <device/pci.h>
6#include <device/pci_ids.h>
7#include <device/pci_ops.h>
Kyösti Mälkki1cae4542020-01-06 12:31:34 +02008#include <device/smbus_host.h>
Angel Pons79b2a152020-12-05 20:43:00 +01009#include <southbridge/intel/common/smbus_ops.h>
Arthur Heymans16fe7902017-04-12 17:01:31 +020010#include "i82801jx.h"
Arthur Heymans7b9c1392017-04-09 20:40:39 +020011
Elyes HAOUAS1a8c1df2018-05-13 13:36:44 +020012static void pch_smbus_init(struct device *dev)
Arthur Heymans7b9c1392017-04-09 20:40:39 +020013{
Arthur Heymans7b9c1392017-04-09 20:40:39 +020014 /* Enable clock gating */
Angel Pons2048cb42020-06-08 02:09:33 +020015 pci_and_config16(dev, 0x80, ~((1 << 8) | (1 << 10) | (1 << 12) | (1 << 14)));
Arthur Heymans7b9c1392017-04-09 20:40:39 +020016}
17
Arthur Heymans7b9c1392017-04-09 20:40:39 +020018static struct device_operations smbus_ops = {
19 .read_resources = smbus_read_resources,
20 .set_resources = pci_dev_set_resources,
21 .enable_resources = pci_dev_enable_resources,
22 .scan_bus = scan_smbus,
23 .init = pch_smbus_init,
24 .ops_smbus_bus = &lops_smbus_bus,
Angel Pons1fc0edd2020-05-31 00:03:28 +020025 .ops_pci = &pci_dev_ops_pci,
Arthur Heymans7b9c1392017-04-09 20:40:39 +020026};
27
Arthur Heymans349e0852017-04-09 20:48:37 +020028static const unsigned short pci_device_ids[] =
29{
30 0x3a30,
31 0x3a60,
32 0
33};
Arthur Heymans7b9c1392017-04-09 20:40:39 +020034
35static const struct pci_driver pch_smbus __pci_driver = {
36 .ops = &smbus_ops,
Felix Singer43b7f412022-03-07 04:34:52 +010037 .vendor = PCI_VID_INTEL,
Arthur Heymans7b9c1392017-04-09 20:40:39 +020038 .devices = pci_device_ids,
39};