Пример #1
0
/*
 * rbus_tag_t rbus_fakeparent_mem(struct pci_attach_args *pa)
 *
 *   This function makes an rbus tag for memory space.  This rbus tag
 *   shares the all memory region of ex_iomem.
 */
rbus_tag_t
rbus_pccbb_parent_mem(struct pci_attach_args *pa)
{
	bus_addr_t start;
	bus_size_t size;
	extern struct extent *iomem_ex;
	struct extent *ex = iomem_ex;

#if defined(PCI_ADDR_FIXUP)
	if (pciaddr.extent_mem != NULL)
		ex = pciaddr.extent_mem;
#endif

	start = ex->ex_start;

	/*
	 * XXX: unfortunately, iomem_ex cannot be used for the dynamic
	 * bus_space allocation.  There are some hidden memory (or
	 * some obstacles which are not recognised by the kernel) in
	 * the region governed by iomem_ex.  So I decide to use only
	 * very high address region.
	 *
	 * If pcibios_addr_fixup() succeeded, the PCI device is using an area
	 * which is not recognised by the kernel as already reserved.
	 */

	if (start < rbus_min_start) 
		start = rbus_min_start;

	size = ex->ex_end - start;
  
	return rbus_new_root_share(pa->pa_memt, ex, start, size, 0);
}
Пример #2
0
/*
 * This function makes an rbus tag for memory space.  This rbus tag
 * shares the all memory region of ex_iomem.
 */
rbus_tag_t
rbus_pccbb_parent_mem(struct device *self, struct pci_attach_args *pa)
{
	bus_addr_t start, rbus_min_start;
	bus_size_t size;
	struct extent *ex;

	size = RBUS_MEM_SIZE;
	start = rbus_min_start = rbus_min_start_hint();
#if NPCIBIOS > 0
	if ((ex = pciaddr_search(PCIADDR_SEARCH_MEM, &start, size)) == NULL)
#endif
	{
		extern struct extent *iomem_ex;
		ex = iomem_ex;
		start = ex->ex_start;

		/* XXX: unfortunately, iomem_ex cannot be used for the
		 * dynamic bus_space allocation.  There are some
		 * hidden memory (or some obstacles which do not
		 * recognised by the kernel) in the region governed by
		 * iomem_ex.  So I decide to use only very high
		 * address region.
		 */

		if (start < rbus_min_start)
			start = rbus_min_start;

		size = ex->ex_end - start;
	}

	return (rbus_new_root_share(pa->pa_memt, ex, start, size, 0));
}
Пример #3
0
rbus_tag_t
rbus_pccbb_parent_mem(struct device *self, struct pci_attach_args *pa)
{
	macppc_cardbus_init(pa->pa_pc, pa->pa_tag);

	return (rbus_new_root_share(pa->pa_memt, pa->pa_memex,
	    0x00000000, 0xffffffff));
}
Пример #4
0
rbus_tag_t
rbus_pccbb_parent_mem(struct device *self, struct pci_attach_args *pa)
{
	struct extent *ex = pa->pa_memex;
	bus_addr_t start;
	bus_size_t size;

	if (ex == NULL)
		return &rbus_null;

	start = RBUS_MEM_START;
	size = ex->ex_end - start;

	return (rbus_new_root_share(pa->pa_memt, ex, start, size));
}
Пример #5
0
rbus_tag_t
rbus_pccbb_parent_io(struct device *self, struct pci_attach_args *pa)
{
    struct extent *ex;
    bus_addr_t start;
    bus_size_t size;


    size = RBUS_IO_SIZE;
    if ((ex = pciaddr_search(PCIADDR_SEARCH_IO, self, &start, size)) ==
            NULL)
    {
        /* XXX */
        printf("failed\n");
    }

    return rbus_new_root_share(pa->pa_iot, ex, start, size, 0);
}
Пример #6
0
rbus_tag_t
rbus_pccbb_parent_mem(struct device *self, struct pci_attach_args *pa)
{
    bus_addr_t start;
    bus_size_t size;
    struct extent *ex;

    macppc_cardbus_init(pa->pa_pc, pa->pa_tag);

    size = RBUS_MEM_SIZE;
    if ((ex = pciaddr_search(PCIADDR_SEARCH_MEM, self, &start, size)) ==
            NULL)
    {
        /* XXX */
        printf("failed\n");
    }

    return rbus_new_root_share(pa->pa_memt, ex, start, size, 0);
}
Пример #7
0
rbus_tag_t
rbus_pccbb_parent_io(struct device *self, struct pci_attach_args *pa)
{
	bus_addr_t start;
	bus_size_t size;
	struct extent *ex;

	size = RBUS_IO_SIZE;
	start = RBUS_IO_START;

#if NPCIBIOS > 0
	if ((ex = pciaddr_search(PCIADDR_SEARCH_IO, &start, size)) == NULL)
#endif
	{
		extern struct extent *ioport_ex;
		ex = ioport_ex;
	}

	return (rbus_new_root_share(pa->pa_iot, ex, start, size, 0));
}
Пример #8
0
/*
 * rbus_tag_t rbus_pccbb_parent_io(struct pci_attach_args *pa)
 */
rbus_tag_t
rbus_pccbb_parent_io(struct pci_attach_args *pa)
{
	bus_addr_t start;
	bus_size_t size;
	rbus_tag_t ret;
	extern struct extent *ioport_ex;
	struct extent *ex = ioport_ex;

#if defined(PCI_ADDR_FIXUP)
	if (pciaddr.extent_port != NULL)
		ex = pciaddr.extent_port;
#endif

	start = RBUS_IO_BASE;
	size  = RBUS_IO_SIZE;

	ret = rbus_new_root_share(pa->pa_iot, ex, start, size, 0);
	if (ret == NULL)
	  panic("failed to alloc I/O space");

	return ret;
}
Пример #9
0
rbus_tag_t
rbus_pccbb_parent_io(struct device *self, struct pci_attach_args *pa)
{
	struct extent *ex = pa->pa_ioex;
	bus_addr_t start;
	bus_size_t size;

	if (ex == NULL)
		return &rbus_null;

	start = ex->ex_start;
	if (ex == pciio_ex) {
		/*
		 * We're on the root bus, or behind a subtractive
		 * decode PCI-PCI bridge.  To avoid conflicts with
		 * onboard legacy devices, we only make a subregion
		 * available.
		 */
		start = max(start, RBUS_IO_START);
	}
	size = ex->ex_end - start;

	return (rbus_new_root_share(pa->pa_iot, ex, start, size));
}
Пример #10
0
rbus_tag_t
rbus_pccbb_parent_io(struct device *self, struct pci_attach_args *pa)
{
	return (rbus_new_root_share(pa->pa_iot, pa->pa_ioex,
	    0x0000, 0xffff));
}