Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/external/bsd/drm2/include/linux Add pci_enable_rom/pci_d...
details: https://anonhg.NetBSD.org/src/rev/03fef3b05112
branches: trunk
changeset: 336314:03fef3b05112
user: riastradh <riastradh%NetBSD.org@localhost>
date: Wed Feb 25 14:49:01 2015 +0000
description:
Add pci_enable_rom/pci_disable_rom to <linux/pci.h>.
diffstat:
sys/external/bsd/drm2/include/linux/pci.h | 37 ++++++++++++++++++++++++++++++-
1 files changed, 36 insertions(+), 1 deletions(-)
diffs (58 lines):
diff -r bacd66d15875 -r 03fef3b05112 sys/external/bsd/drm2/include/linux/pci.h
--- a/sys/external/bsd/drm2/include/linux/pci.h Wed Feb 25 14:36:58 2015 +0000
+++ b/sys/external/bsd/drm2/include/linux/pci.h Wed Feb 25 14:49:01 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pci.h,v 1.11 2014/11/11 11:30:21 nonaka Exp $ */
+/* $NetBSD: pci.h,v 1.12 2015/02/25 14:49:01 riastradh Exp $ */
/*-
* Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -444,6 +444,7 @@
pci_unmap_rom(struct pci_dev *pdev, void __pci_rom_iomem *vaddr __unused)
{
+ /* XXX Disable the ROM address decoder. */
KASSERT(ISSET(pdev->pd_kludges, NBPCI_KLUDGE_MAP_ROM));
KASSERT(vaddr == pdev->pd_rom_vaddr);
bus_space_unmap(pdev->pd_rom_bst, pdev->pd_rom_bsh, pdev->pd_rom_size);
@@ -510,6 +511,40 @@
return pdev->pd_rom_vaddr;
}
+static inline int
+pci_enable_rom(struct pci_dev *pdev)
+{
+ const pci_chipset_tag_t pc = pdev->pd_pa.pa_pc;
+ const pcitag_t tag = pdev->pd_pa.pa_tag;
+ pcireg_t addr;
+ int s;
+
+ /* XXX Don't do anything if the ROM isn't there. */
+
+ s = splhigh();
+ addr = pci_conf_read(pc, tag, PCI_MAPREG_ROM);
+ addr |= PCI_MAPREG_ROM_ENABLE;
+ pci_conf_write(pc, tag, PCI_MAPREG_ROM, addr);
+ splx(s);
+
+ return 0;
+}
+
+static inline void
+pci_disable_rom(struct pci_dev *pdev)
+{
+ const pci_chipset_tag_t pc = pdev->pd_pa.pa_pc;
+ const pcitag_t tag = pdev->pd_pa.pa_tag;
+ pcireg_t addr;
+ int s;
+
+ s = splhigh();
+ addr = pci_conf_read(pc, tag, PCI_MAPREG_ROM);
+ addr &= ~(pcireg_t)PCI_MAPREG_ROM_ENABLE;
+ pci_conf_write(pc, tag, PCI_MAPREG_ROM, addr);
+ splx(s);
+}
+
static inline bus_addr_t
pci_resource_start(struct pci_dev *pdev, unsigned i)
{
Home |
Main Index |
Thread Index |
Old Index