Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 26 Apr 2006 23:27:54 GMT
From:      Marcel Moolenaar <marcel@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 96170 for review
Message-ID:  <200604262327.k3QNRsam015497@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=96170

Change 96170 by marcel@marcel_nfs on 2006/04/26 23:26:58

	Save the final value of the SPR register in the least
	significant bits. That allows us easy access from
	within the interrupt handler.

Affected files ...

.. //depot/projects/uart/dev/puc/pucdata.c#29 edit

Differences ...

==== //depot/projects/uart/dev/puc/pucdata.c#29 (text+ko) ====

@@ -743,7 +743,7 @@
 		/* Clear DLAB in the LCR register of UART 0. */
 		bus_write_1(bar->b_res, 3, 0);
 		/* Save the two values read-back from the SPR register. */
-		sc->sc_cfg_data = (v1 << 8) | v0;
+		sc->sc_cfg_data = (v0 << 8) | v1;
 		if (v0 == 0 && v1 == 0x80 + -cfg->clock) {
 			/*
 			 * The SPR register echoed the two values written
@@ -779,8 +779,8 @@
 			    "%d selected\n", 1 << -cfg->clock);
 		return (0);
 	case PUC_CFG_GET_CLOCK:
-		v0 = sc->sc_cfg_data & 0xff;
-		v1 = (sc->sc_cfg_data >> 8) & 0xff;
+		v0 = (sc->sc_cfg_data >> 8) & 0xff;
+		v1 = sc->sc_cfg_data & 0xff;
 		if (v0 == 0 && v1 == 0x80 + -cfg->clock) {
 			/*
 			 * XXX With the SPAD jumper applied, there's no
@@ -801,8 +801,8 @@
 			*res = DEFAULT_RCLK << v0;
 		return (0);
 	case PUC_CFG_GET_ILR:
-		v0 = sc->sc_cfg_data & 0xff;
-		v1 = (sc->sc_cfg_data >> 8) & 0xff;
+		v0 = (sc->sc_cfg_data >> 8) & 0xff;
+		v1 = sc->sc_cfg_data & 0xff;
 		*res = (v0 == 0 && v1 == 0x80 + -cfg->clock)
 		    ? PUC_ILR_NONE : PUC_ILR_QUATECH;
 		return (0);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200604262327.k3QNRsam015497>