blob: 529cb023e2b554c48e8487908900b148b9eedeba [file] [log] [blame]
Simon Glass81afac12016-01-18 20:19:19 -07001/*
2 * Copyright (C) 2014 Google, Inc
3 *
4 * SPDX-License-Identifier: GPL-2.0+
5 */
6
7#include <common.h>
8#include <dm.h>
9#include <pch.h>
10
11#define SBASE_ADDR 0x54
12
13static int pch9_get_sbase(struct udevice *dev, ulong *sbasep)
14{
15 uint32_t sbase_addr;
16
17 dm_pci_read_config32(dev, SBASE_ADDR, &sbase_addr);
18 *sbasep = sbase_addr & 0xfffffe00;
19
20 return 0;
21}
22
23static enum pch_version pch9_get_version(struct udevice *dev)
24{
25 return PCHV_9;
26}
27
28static const struct pch_ops pch9_ops = {
29 .get_sbase = pch9_get_sbase,
30 .get_version = pch9_get_version,
31};
32
33static const struct udevice_id pch9_ids[] = {
34 { .compatible = "intel,pch9" },
35 { }
36};
37
38U_BOOT_DRIVER(pch9_drv) = {
39 .name = "intel-pch9",
40 .id = UCLASS_PCH,
41 .of_match = pch9_ids,
42 .ops = &pch9_ops,
43};