PERFORCE change 101889 for review
Olivier Houchard
cognet at FreeBSD.org
Tue Jul 18 23:10:58 UTC 2006
http://perforce.freebsd.org/chv.cgi?CH=101889
Change 101889 by cognet at cognet on 2006/07/18 23:10:11
Add some code to use rman to manage the memory mapped registers from
the IXP425.
This code is untested, we will need it for the ethernet driver as the
ethernet adapter is directly on the chip.
Affected files ...
.. //depot/projects/arm/src/sys/arm/xscale/ixp425/ixp425.c#3 edit
.. //depot/projects/arm/src/sys/arm/xscale/ixp425/ixp425var.h#2 edit
Differences ...
==== //depot/projects/arm/src/sys/arm/xscale/ixp425/ixp425.c#3 (text+ko) ====
@@ -121,6 +121,12 @@
rman_manage_region(&sc->sc_irq_rman, 0, 31) != 0)
panic("ixp425_attach: failed to set up IRQ rman");
+ sc->sc_sysmem_rman.rm_type = RMAN_ARRAY;
+ sc->sc_sysmem_rman.rm_descr = "IXP425 System memory";
+ if (rman_init(&sc->sc_sysmem_rman) != 0 ||
+ rman_manage_region(&sc->sc_sysmem_rman, IXP425_IO_VBASE,
+ IXP425_IO_VBASE + IXP425_IO_SIZE) != 0)
+ panic("ixp425_attach: failed to set up sys mem rman");
device_add_child(dev, "ixpclk", 0);
bus_generic_probe(dev);
bus_generic_attach(dev);
@@ -204,6 +210,15 @@
rman_set_rid(rv, *rid);
return (rv);
}
+ if (type == SYS_RES_MEMORY) {
+ rv = rman_reserve_resource(&sc->sc_sysmem_rman,
+ start, end, count, flags, child);
+ if (rv != NULL) {
+ rman_set_bustag(rv, &ixp425_bs_tag);
+ rman_set_bushandle(rv, start);
+ return (rv);
+ }
+ }
return (NULL);
}
==== //depot/projects/arm/src/sys/arm/xscale/ixp425/ixp425var.h#2 (text+ko) ====
@@ -80,6 +80,7 @@
struct bus_space sc_pci_memt;
vm_offset_t sc_pci_va;
struct rman sc_irq_rman;
+ struct rman sc_sysmem_rman;
/* GPIO configuration */
u_int32_t sc_gpio_out;
More information about the p4-projects
mailing list