]>
Commit | Line | Data |
---|---|---|
ef5a5b00 GB |
1 | /* |
2 | * Copyright (c) 2011 The Chromium OS Authors. | |
3 | * (C) Copyright 2008,2009 | |
4 | * Graeme Russ, <[email protected]> | |
5 | * | |
6 | * (C) Copyright 2002 | |
7 | * Daniel Engström, Omicron Ceti AB, <[email protected]> | |
8 | * | |
3765b3e7 | 9 | * SPDX-License-Identifier: GPL-2.0+ |
ef5a5b00 GB |
10 | */ |
11 | ||
452f50f7 GB |
12 | #include <common.h> |
13 | #include <pci.h> | |
14 | #include <asm/pci.h> | |
15 | ||
16 | static struct pci_controller coreboot_hose; | |
17 | ||
82e73f0e GB |
18 | static void config_pci_bridge(struct pci_controller *hose, pci_dev_t dev, |
19 | struct pci_config_table *table) | |
20 | { | |
21 | u8 secondary; | |
22 | hose->read_byte(hose, dev, PCI_SECONDARY_BUS, &secondary); | |
23 | hose->last_busno = max(hose->last_busno, secondary); | |
24 | pci_hose_scan_bus(hose, secondary); | |
25 | } | |
26 | ||
27 | static struct pci_config_table pci_coreboot_config_table[] = { | |
28 | /* vendor, device, class, bus, dev, func */ | |
29 | { PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_BRIDGE_PCI, | |
30 | PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, &config_pci_bridge }, | |
31 | {} | |
32 | }; | |
33 | ||
ef5a5b00 GB |
34 | void pci_init_board(void) |
35 | { | |
82e73f0e | 36 | coreboot_hose.config_table = pci_coreboot_config_table; |
452f50f7 | 37 | coreboot_hose.first_busno = 0; |
82e73f0e GB |
38 | coreboot_hose.last_busno = 0; |
39 | ||
40 | pci_set_region(coreboot_hose.regions + 0, 0x0, 0x0, 0xffffffff, | |
41 | PCI_REGION_MEM); | |
42 | coreboot_hose.region_count = 1; | |
452f50f7 GB |
43 | |
44 | pci_setup_type1(&coreboot_hose); | |
45 | ||
46 | pci_register_hose(&coreboot_hose); | |
47 | ||
82e73f0e | 48 | pci_hose_scan(&coreboot_hose); |
ef5a5b00 | 49 | } |