[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen stable-4.5] hvmloader: don't treat ROM BAR like other BARs
commit 0327c934e4a2029fd3a1d922936eec4ad82fc3e4 Author: Jan Beulich <jbeulich@xxxxxxxx> AuthorDate: Tue Apr 21 09:12:50 2015 +0200 Commit: Jan Beulich <jbeulich@xxxxxxxx> CommitDate: Tue Apr 21 09:12:50 2015 +0200 hvmloader: don't treat ROM BAR like other BARs Its low 11 bits have different meaning. Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx> Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx> Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx> Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx> master commit: 73aa7fc2926c5ae30d8ebd049beadbb48e24d6c6 master date: 2015-03-26 11:17:51 +0100 --- tools/firmware/hvmloader/pci.c | 36 +++++++++++++++++++++++++----------- 1 files changed, 25 insertions(+), 11 deletions(-) diff --git a/tools/firmware/hvmloader/pci.c b/tools/firmware/hvmloader/pci.c index 4e8d803..5ff87a7 100644 --- a/tools/firmware/hvmloader/pci.c +++ b/tools/firmware/hvmloader/pci.c @@ -179,18 +179,31 @@ void pci_setup(void) bar_reg = PCI_ROM_ADDRESS; bar_data = pci_readl(devfn, bar_reg); - is_64bar = !!((bar_data & (PCI_BASE_ADDRESS_SPACE | - PCI_BASE_ADDRESS_MEM_TYPE_MASK)) == - (PCI_BASE_ADDRESS_SPACE_MEMORY | - PCI_BASE_ADDRESS_MEM_TYPE_64)); - pci_writel(devfn, bar_reg, ~0); + if ( bar_reg != PCI_ROM_ADDRESS ) + { + is_64bar = !!((bar_data & (PCI_BASE_ADDRESS_SPACE | + PCI_BASE_ADDRESS_MEM_TYPE_MASK)) == + (PCI_BASE_ADDRESS_SPACE_MEMORY | + PCI_BASE_ADDRESS_MEM_TYPE_64)); + pci_writel(devfn, bar_reg, ~0); + } + else + { + is_64bar = 0; + pci_writel(devfn, bar_reg, + (bar_data | PCI_ROM_ADDRESS_MASK) & + ~PCI_ROM_ADDRESS_ENABLE); + } bar_sz = pci_readl(devfn, bar_reg); pci_writel(devfn, bar_reg, bar_data); - bar_sz &= (((bar_data & PCI_BASE_ADDRESS_SPACE) == - PCI_BASE_ADDRESS_SPACE_MEMORY) ? - PCI_BASE_ADDRESS_MEM_MASK : - (PCI_BASE_ADDRESS_IO_MASK & 0xffff)); + if ( bar_reg != PCI_ROM_ADDRESS ) + bar_sz &= (((bar_data & PCI_BASE_ADDRESS_SPACE) == + PCI_BASE_ADDRESS_SPACE_MEMORY) ? + PCI_BASE_ADDRESS_MEM_MASK : + (PCI_BASE_ADDRESS_IO_MASK & 0xffff)); + else + bar_sz &= PCI_ROM_ADDRESS_MASK; if (is_64bar) { bar_data_upper = pci_readl(devfn, bar_reg + 4); pci_writel(devfn, bar_reg + 4, ~0); @@ -214,8 +227,9 @@ void pci_setup(void) bars[i].bar_reg = bar_reg; bars[i].bar_sz = bar_sz; - if ( (bar_data & PCI_BASE_ADDRESS_SPACE) == - PCI_BASE_ADDRESS_SPACE_MEMORY ) + if ( ((bar_data & PCI_BASE_ADDRESS_SPACE) == + PCI_BASE_ADDRESS_SPACE_MEMORY) || + (bar_reg == PCI_ROM_ADDRESS) ) mmio_total += bar_sz; nr_bars++; -- generated by git-patchbot for /home/xen/git/xen.git#stable-4.5 _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |