]> git.kernelconcepts.de Git - karo-tx-uboot.git/blob - arch/x86/cpu/coreboot/pci.c
Merge branch 'master' of git://git.denx.de/u-boot-usb
[karo-tx-uboot.git] / arch / x86 / cpu / coreboot / 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 <pci.h>
14 #include <asm/pci.h>
15
16 static void config_pci_bridge(struct pci_controller *hose, pci_dev_t dev,
17                               struct pci_config_table *table)
18 {
19         u8 secondary;
20         hose->read_byte(hose, dev, PCI_SECONDARY_BUS, &secondary);
21         hose->last_busno = max(hose->last_busno, (int)secondary);
22         pci_hose_scan_bus(hose, secondary);
23 }
24
25 static struct pci_config_table pci_coreboot_config_table[] = {
26         /* vendor, device, class, bus, dev, func */
27         { PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_BRIDGE_PCI,
28                 PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, &config_pci_bridge },
29         {}
30 };
31
32 void board_pci_setup_hose(struct pci_controller *hose)
33 {
34         hose->config_table = pci_coreboot_config_table;
35         hose->first_busno = 0;
36         hose->last_busno = 0;
37
38         pci_set_region(hose->regions + 0, 0x0, 0x0, 0xffffffff,
39                        PCI_REGION_MEM);
40         hose->region_count = 1;
41 }