clkbrd.c (152961) | clkbrd.c (157225) |
---|---|
1/*- 2 * Copyright (c) 2004 Jason L. Wright (jason@thought.net) 3 * Copyright (c) 2005 Marius Strobl <marius@FreeBSD.org> 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 14 unchanged lines hidden (view full) --- 23 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 24 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 * POSSIBILITY OF SUCH DAMAGE. 26 * 27 * from: OpenBSD: clkbrd.c,v 1.5 2004/10/01 18:18:49 jason Exp 28 */ 29 30#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2004 Jason L. Wright (jason@thought.net) 3 * Copyright (c) 2005 Marius Strobl <marius@FreeBSD.org> 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 14 unchanged lines hidden (view full) --- 23 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 24 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 * POSSIBILITY OF SUCH DAMAGE. 26 * 27 * from: OpenBSD: clkbrd.c,v 1.5 2004/10/01 18:18:49 jason Exp 28 */ 29 30#include <sys/cdefs.h> |
31__FBSDID("$FreeBSD: head/sys/sparc64/fhc/clkbrd.c 152961 2005-11-30 16:13:49Z marius $"); | 31__FBSDID("$FreeBSD: head/sys/sparc64/fhc/clkbrd.c 157225 2006-03-28 19:46:48Z marius $"); |
32 33#include <sys/param.h> 34#include <sys/systm.h> 35#include <sys/kernel.h> 36#include <sys/module.h> 37#include <sys/resource.h> 38#include <sys/rman.h> 39 --- 86 unchanged lines hidden (view full) --- 126 sc->sc_bh[i] = rman_get_bushandle(sc->sc_res[i]); 127 if (i == CLKBRD_CLKVER) 128 sc->sc_flags |= CLKBRD_HAS_CLKVER; 129 } 130 131 slots = 4; 132 r = bus_space_read_1(sc->sc_bt[CLKBRD_CLK], sc->sc_bh[CLKBRD_CLK], 133 CLK_STS1); | 32 33#include <sys/param.h> 34#include <sys/systm.h> 35#include <sys/kernel.h> 36#include <sys/module.h> 37#include <sys/resource.h> 38#include <sys/rman.h> 39 --- 86 unchanged lines hidden (view full) --- 126 sc->sc_bh[i] = rman_get_bushandle(sc->sc_res[i]); 127 if (i == CLKBRD_CLKVER) 128 sc->sc_flags |= CLKBRD_HAS_CLKVER; 129 } 130 131 slots = 4; 132 r = bus_space_read_1(sc->sc_bt[CLKBRD_CLK], sc->sc_bh[CLKBRD_CLK], 133 CLK_STS1); |
134 switch (r & 0xc0) { 135 case 0x40: | 134 switch (r & CLK_STS1_SLOTS_MASK) { 135 case CLK_STS1_SLOTS_16: |
136 slots = 16; 137 break; | 136 slots = 16; 137 break; |
138 case 0xc0: | 138 case CLK_STS1_SLOTS_8: |
139 slots = 8; 140 break; | 139 slots = 8; 140 break; |
141 case 0x80: | 141 case CLK_STS1_SLOTS_4: |
142 if (sc->sc_flags & CLKBRD_HAS_CLKVER) { 143 r = bus_space_read_1(sc->sc_bt[CLKBRD_CLKVER], | 142 if (sc->sc_flags & CLKBRD_HAS_CLKVER) { 143 r = bus_space_read_1(sc->sc_bt[CLKBRD_CLKVER], |
144 sc->sc_bh[CLKBRD_CLKVER], 0); 145 if (r != 0 && (r & 0x80) == 0) 146 slots = 5; | 144 sc->sc_bh[CLKBRD_CLKVER], CLKVER_SLOTS); 145 if (r != 0 && 146 (r & CLKVER_SLOTS_MASK) == CLKVER_SLOTS_PLUS) 147 slots = 5; |
147 } 148 } 149 150 device_printf(sc->sc_dev, "Sun Enterprise Exx00 machine: %d slots\n", 151 slots); 152 153 sc->sc_clk_ctrl = bus_space_read_1(sc->sc_bt[CLKBRD_CLK], 154 sc->sc_bh[CLKBRD_CLK], CLK_CTRL); --- 57 unchanged lines hidden --- | 148 } 149 } 150 151 device_printf(sc->sc_dev, "Sun Enterprise Exx00 machine: %d slots\n", 152 slots); 153 154 sc->sc_clk_ctrl = bus_space_read_1(sc->sc_bt[CLKBRD_CLK], 155 sc->sc_bh[CLKBRD_CLK], CLK_CTRL); --- 57 unchanged lines hidden --- |