b081469c96e9c551c54c3e6df723fd3c5ce21481
[oweals/u-boot.git] / arch / x86 / cpu / ivybridge / pci.c
1 /*
2  * Copyright (c) 2011 The Chromium OS Authors.
3  * (C) Copyright 2008,2009
4  * Graeme Russ, <graeme.russ@gmail.com>
5  *
6  * (C) Copyright 2002
7  * Daniel Engström, Omicron Ceti AB, <daniel@omicron.se>
8  *
9  * SPDX-License-Identifier:     GPL-2.0+
10  */
11
12 #include <common.h>
13 #include <dm.h>
14 #include <pci.h>
15 #include <asm/pci.h>
16 #include <asm/post.h>
17 #include <asm/arch/bd82x6x.h>
18 #include <asm/arch/pch.h>
19
20 static int pci_ivybridge_probe(struct udevice *bus)
21 {
22         if (!(gd->flags & GD_FLG_RELOC))
23                 return 0;
24         post_code(0x50);
25         bd82x6x_init_extra();
26         post_code(0x51);
27
28         return 0;
29 }
30
31 static const struct dm_pci_ops pci_ivybridge_ops = {
32         .read_config    = pci_x86_read_config,
33         .write_config   = pci_x86_write_config,
34 };
35
36 static const struct udevice_id pci_ivybridge_ids[] = {
37         { .compatible = "intel,pci-ivybridge" },
38         { }
39 };
40
41 U_BOOT_DRIVER(pci_ivybridge_drv) = {
42         .name           = "pci_ivybridge",
43         .id             = UCLASS_PCI,
44         .of_match       = pci_ivybridge_ids,
45         .ops            = &pci_ivybridge_ops,
46         .probe          = pci_ivybridge_probe,
47 };