diff options
author | raj <raj@FreeBSD.org> | 2008-12-17 15:27:49 +0000 |
---|---|---|
committer | raj <raj@FreeBSD.org> | 2008-12-17 15:27:49 +0000 |
commit | d71801145e3d4af3d6f752336d55ddcddc1a7da1 (patch) | |
tree | 0b59b4e7b12b10dfe2627893da2236192f787c24 /sys/powerpc/mpc85xx/ocpbus.c | |
parent | ce7791f58daab11561fdaeb180f17b71fbe9bcf6 (diff) | |
download | FreeBSD-src-d71801145e3d4af3d6f752336d55ddcddc1a7da1.zip FreeBSD-src-d71801145e3d4af3d6f752336d55ddcddc1a7da1.tar.gz |
Improve MPC85XX helper routines.
- Move CCSR accessors to the shared MPC85XX area
- Simplify SVR version subfield handling
- Adjust OCP
Diffstat (limited to 'sys/powerpc/mpc85xx/ocpbus.c')
-rw-r--r-- | sys/powerpc/mpc85xx/ocpbus.c | 26 |
1 files changed, 5 insertions, 21 deletions
diff --git a/sys/powerpc/mpc85xx/ocpbus.c b/sys/powerpc/mpc85xx/ocpbus.c index a741849..74af18c 100644 --- a/sys/powerpc/mpc85xx/ocpbus.c +++ b/sys/powerpc/mpc85xx/ocpbus.c @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include <machine/bootinfo.h> #include <powerpc/mpc85xx/ocpbus.h> +#include <powerpc/mpc85xx/mpc85xx.h> #include "pic_if.h" @@ -115,23 +116,6 @@ DRIVER_MODULE(ocpbus, nexus, ocpbus_driver, ocpbus_devclass, 0, 0); static int law_max = 0; -static __inline uint32_t -ccsr_read4(uintptr_t addr) -{ - volatile uint32_t *ptr = (void *)addr; - - return (*ptr); -} - -static __inline void -ccsr_write4(uintptr_t addr, uint32_t val) -{ - volatile uint32_t *ptr = (void *)addr; - - *ptr = val; - __asm __volatile("eieio; sync"); -} - static device_t ocpbus_mk_child(device_t dev, int type, int unit) { @@ -230,15 +214,15 @@ ocpbus_write_law(int trgt, int type, u_long *startp, u_long *countp) } static int -ocpbus_probe (device_t dev) +ocpbus_probe(device_t dev) { struct ocpbus_softc *sc; - uint32_t svr; + uint32_t ver; sc = device_get_softc(dev); - svr = mfspr(SPR_SVR); - if (svr == SVR_MPC8572E || svr == SVR_MPC8572) + ver = SVR_VER(mfspr(SPR_SVR)); + if (ver == SVR_MPC8572E || ver == SVR_MPC8572) law_max = 12; else law_max = 8; |