• Home
  • Raw
  • Download

Lines Matching +full:isa +full:- +full:base

1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Routines for tracking a legacy ISA bridge
26 #include <asm/pci-bridge.h>
28 #include <asm/ppc-pci.h>
29 #include <asm/isa-bridge.h>
31 unsigned long isa_io_base; /* NULL if no ISA bus */
34 /* Cached ISA bridge dev. */
89 /* From "ISA Binding to 1275" in pci_process_ISA_OF_ranges()
92 * cells 0 - 1: an ISA address in pci_process_ISA_OF_ranges()
93 * cells 2 - 4: a PCI address in pci_process_ISA_OF_ranges()
94 * (size depending on dev->n_addr_cells) in pci_process_ISA_OF_ranges()
97 if ((range->isa_addr.a_hi & ISA_SPACE_MASK) != ISA_SPACE_IO) { in pci_process_ISA_OF_ranges()
99 rlen -= sizeof(struct isa_range); in pci_process_ISA_OF_ranges()
103 if ((range->isa_addr.a_hi & ISA_SPACE_MASK) != ISA_SPACE_IO) in pci_process_ISA_OF_ranges()
106 isa_addr = range->isa_addr.a_lo; in pci_process_ISA_OF_ranges()
107 pci_addr = (unsigned long) range->pci_addr.a_mid << 32 | in pci_process_ISA_OF_ranges()
108 range->pci_addr.a_lo; in pci_process_ISA_OF_ranges()
112 * now as nobody uses fancy mappings for ISA bridges in pci_process_ISA_OF_ranges()
115 printk(KERN_ERR "unexpected isa to pci mapping: %s\n", in pci_process_ISA_OF_ranges()
121 size = PAGE_ALIGN(range->size); in pci_process_ISA_OF_ranges()
129 printk(KERN_ERR "no ISA IO ranges or unexpected isa range, " in pci_process_ISA_OF_ranges()
136 * isa_bridge_find_early - Find and map the ISA IO space early before
139 * access to ISA IO ports
145 /* If we already have an ISA bridge, bail off */ in isa_bridge_find_early()
149 /* For each "isa" node in the system. Note : we do a search by in isa_bridge_find_early()
154 for_each_node_by_type(np, "isa") { in isa_bridge_find_early()
157 if (parent == hose->dn) { in isa_bridge_find_early()
172 /* Now parse the "ranges" property and setup the ISA mapping */ in isa_bridge_find_early()
173 pci_process_ISA_OF_ranges(np, hose->io_base_phys); in isa_bridge_find_early()
175 /* Set the global ISA io base to indicate we have an ISA bridge */ in isa_bridge_find_early()
178 pr_debug("ISA bridge (early) is %pOF\n", np); in isa_bridge_find_early()
182 * isa_bridge_find_early - Find and map the ISA IO space early before
185 * access to ISA IO ports
194 /* If we already have an ISA bridge, bail off */ in isa_bridge_init_non_pci()
199 if (of_property_read_u32(np, "#address-cells", &na) || in isa_bridge_init_non_pci()
200 of_property_read_u32(np, "#size-cells", &ns)) { in isa_bridge_init_non_pci()
201 pr_warn("ISA: Non-PCI bridge %pOF is missing address format\n", in isa_bridge_init_non_pci()
208 pr_warn("ISA: Non-PCI bridge %pOF has unsupported address format\n", in isa_bridge_init_non_pci()
217 pr_warn("ISA: Non-PCI bridge %pOF has absent or invalid ranges\n", in isa_bridge_init_non_pci()
223 for (i = 0; (i + rs - 1) < rlen; i += rs) { in isa_bridge_init_non_pci()
234 pr_warn("ISA: Non-PCI bridge %pOF has no usable IO range\n", in isa_bridge_init_non_pci()
247 pr_warn("ISA: Non-PCI bridge %pOF failed to translate IO base\n", in isa_bridge_init_non_pci()
254 pr_warn("ISA: Non-PCI bridge %pOF has non aligned IO range\n", in isa_bridge_init_non_pci()
262 /* Set the global ISA io base to indicate we have an ISA bridge in isa_bridge_init_non_pci()
268 pr_debug("ISA: Non-PCI bridge is %pOF\n", np); in isa_bridge_init_non_pci()
272 * isa_bridge_find_late - Find and map the ISA IO space upon discovery of
273 * a new ISA bridge
278 struct pci_controller *hose = pci_bus_to_host(pdev->bus); in isa_bridge_find_late()
280 /* Store ISA device node and PCI device */ in isa_bridge_find_late()
284 /* Now parse the "ranges" property and setup the ISA mapping */ in isa_bridge_find_late()
285 pci_process_ISA_OF_ranges(devnode, hose->io_base_phys); in isa_bridge_find_late()
287 /* Set the global ISA io base to indicate we have an ISA bridge */ in isa_bridge_find_late()
290 pr_debug("ISA bridge (late) is %pOF on %s\n", in isa_bridge_find_late()
295 * isa_bridge_remove - Remove/unmap an ISA bridge
299 pr_debug("ISA bridge removed !\n"); in isa_bridge_remove()
301 /* Clear the global ISA io base to indicate that we have no more in isa_bridge_remove()
302 * ISA bridge. Note that drivers don't quite handle that, though in isa_bridge_remove()
304 * have ISA bridges being removed on machines using legacy devices ? in isa_bridge_remove()
313 /* Unmap the ISA area */ in isa_bridge_remove()
318 * isa_bridge_notify - Get notified of PCI devices addition/removal
329 /* Check if we have an early ISA device, without PCI dev */ in isa_bridge_notify()
332 pr_debug("ISA bridge PCI attached: %s\n", in isa_bridge_notify()
337 /* Check if we have no ISA device, and this happens to be one, in isa_bridge_notify()
340 if (!isa_bridge_devnode && of_node_is_type(devnode, "isa")) in isa_bridge_notify()
345 /* Check if this our existing ISA device */ in isa_bridge_notify()
359 * isa_bridge_init - register to be notified of ISA bridge addition/removal