blob: 8fa1914e0deccf90b4406fc0549fbec6d77b75c2 [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>
4#include <device/path.h>
5#include <device/smbus.h>
6#include <device/pci.h>
7#include <device/pci_ids.h>
8#include <device/pci_ops.h>
Kyösti Mälkki1cae4542020-01-06 12:31:34 +02009#include <device/smbus_host.h>
Angel Pons79b2a152020-12-05 20:43:00 +010010#include <southbridge/intel/common/smbus_ops.h>
Arthur Heymans16fe7902017-04-12 17:01:31 +020011#include "i82801jx.h"
Arthur Heymans7b9c1392017-04-09 20:40:39 +020012
Elyes HAOUAS1a8c1df2018-05-13 13:36:44 +020013static void pch_smbus_init(struct device *dev)
Arthur Heymans7b9c1392017-04-09 20:40:39 +020014{
Arthur Heymans7b9c1392017-04-09 20:40:39 +020015 /* Enable clock gating */
Angel Pons2048cb42020-06-08 02:09:33 +020016 pci_and_config16(dev, 0x80, ~((1 << 8) | (1 << 10) | (1 << 12) | (1 << 14)));
Arthur Heymans7b9c1392017-04-09 20:40:39 +020017}
18
Arthur Heymans7b9c1392017-04-09 20:40:39 +020019static struct device_operations smbus_ops = {
20 .read_resources = smbus_read_resources,
21 .set_resources = pci_dev_set_resources,
22 .enable_resources = pci_dev_enable_resources,
23 .scan_bus = scan_smbus,
24 .init = pch_smbus_init,
25 .ops_smbus_bus = &lops_smbus_bus,
Angel Pons1fc0edd2020-05-31 00:03:28 +020026 .ops_pci = &pci_dev_ops_pci,
Arthur Heymans7b9c1392017-04-09 20:40:39 +020027};
28
Arthur Heymans349e0852017-04-09 20:48:37 +020029static const unsigned short pci_device_ids[] =
30{
31 0x3a30,
32 0x3a60,
33 0
34};
Arthur Heymans7b9c1392017-04-09 20:40:39 +020035
36static const struct pci_driver pch_smbus __pci_driver = {
37 .ops = &smbus_ops,
Felix Singer43b7f412022-03-07 04:34:52 +010038 .vendor = PCI_VID_INTEL,
Arthur Heymans7b9c1392017-04-09 20:40:39 +020039 .devices = pci_device_ids,
40};