summaryrefslogtreecommitdiffstats
path: root/sys/dev/cy
diff options
context:
space:
mode:
authordg <dg@FreeBSD.org>1995-10-11 02:41:13 +0000
committerdg <dg@FreeBSD.org>1995-10-11 02:41:13 +0000
commit651b268becc6dc639e5cac3b4688efd5d7a0f78d (patch)
tree7d91789d06329eabd35add8eaf81b2d57c7a5ff4 /sys/dev/cy
parentb643998e8579619a163070a1ec730db6eb7b679d (diff)
downloadFreeBSD-src-651b268becc6dc639e5cac3b4688efd5d7a0f78d.zip
FreeBSD-src-651b268becc6dc639e5cac3b4688efd5d7a0f78d.tar.gz
Fix probe to work properly with the Cyclades cyclom-16Ye.
Diffstat (limited to 'sys/dev/cy')
-rw-r--r--sys/dev/cy/cy.c22
-rw-r--r--sys/dev/cy/cy_isa.c22
2 files changed, 26 insertions, 18 deletions
diff --git a/sys/dev/cy/cy.c b/sys/dev/cy/cy.c
index 7852317..ac0a16f 100644
--- a/sys/dev/cy/cy.c
+++ b/sys/dev/cy/cy.c
@@ -27,7 +27,7 @@
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: cy.c,v 1.13 1995/07/29 08:33:06 bde Exp $
+ * $Id: cy.c,v 1.14 1995/07/31 18:29:48 bde Exp $
*/
#include "cy.h"
@@ -453,6 +453,7 @@ sioprobe(dev)
cy_addr iobase;
int unit;
+ iobase = (cy_addr)dev->id_maddr;
unit = dev->id_unit;
if ((u_int)unit >= NCY)
return (0);
@@ -460,16 +461,19 @@ sioprobe(dev)
sioregisterdev(dev);
/* Cyclom-16Y hardware reset (Cyclom-8Ys don't care) */
- cy_inb((cy_addr)dev->id_maddr, CY16_RESET); /* XXX? */
-
+ cy_inb(iobase, CY16_RESET); /* XXX? */
DELAY(500); /* wait for the board to get its act together */
- for (cyu = 0, iobase = (cy_addr)dev->id_maddr; cyu < CY_MAX_CD1400s;
- ++cyu, iobase += CY_CD1400_MEMSIZE) {
+ /* this is needed to get the board out of reset */
+ cy_outb(iobase, CY_CLEAR_INTR, 0);
+ DELAY(500);
+
+ for (cyu = 0; cyu < CY_MAX_CD1400s;
+ ++cyu, iobase += CY_CD1400_MEMSIZE) {
int i;
/* wait for chip to become ready for new command */
- for (i = 0; i < 100; i += 50) {
+ for (i = 0; i < 10; i++) {
DELAY(50);
if (!cd_inb(iobase, CD1400_CCR))
break;
@@ -483,12 +487,12 @@ sioprobe(dev)
CD1400_CCR_CMDRESET | CD1400_CCR_FULLRESET);
/* wait for the CD1400 to initialize itself */
- for (i = 0; i < 1000; i += 50) {
+ for (i = 0; i < 200; i++) {
DELAY(50);
/* retrieve firmware version */
firmware_version = cd_inb(iobase, CD1400_GFRCR);
- if (firmware_version != 0)
+ if ((firmware_version & 0xf0) == 0x40)
break;
}
@@ -497,7 +501,7 @@ sioprobe(dev)
* If one CD1400 is bad then we don't support higher
* numbered good ones on this board.
*/
- if ((firmware_version & 0xF0) != 0x40)
+ if ((firmware_version & 0xf0) != 0x40)
break;
++cy_nr_cd1400s[unit];
}
diff --git a/sys/dev/cy/cy_isa.c b/sys/dev/cy/cy_isa.c
index 7852317..ac0a16f 100644
--- a/sys/dev/cy/cy_isa.c
+++ b/sys/dev/cy/cy_isa.c
@@ -27,7 +27,7 @@
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: cy.c,v 1.13 1995/07/29 08:33:06 bde Exp $
+ * $Id: cy.c,v 1.14 1995/07/31 18:29:48 bde Exp $
*/
#include "cy.h"
@@ -453,6 +453,7 @@ sioprobe(dev)
cy_addr iobase;
int unit;
+ iobase = (cy_addr)dev->id_maddr;
unit = dev->id_unit;
if ((u_int)unit >= NCY)
return (0);
@@ -460,16 +461,19 @@ sioprobe(dev)
sioregisterdev(dev);
/* Cyclom-16Y hardware reset (Cyclom-8Ys don't care) */
- cy_inb((cy_addr)dev->id_maddr, CY16_RESET); /* XXX? */
-
+ cy_inb(iobase, CY16_RESET); /* XXX? */
DELAY(500); /* wait for the board to get its act together */
- for (cyu = 0, iobase = (cy_addr)dev->id_maddr; cyu < CY_MAX_CD1400s;
- ++cyu, iobase += CY_CD1400_MEMSIZE) {
+ /* this is needed to get the board out of reset */
+ cy_outb(iobase, CY_CLEAR_INTR, 0);
+ DELAY(500);
+
+ for (cyu = 0; cyu < CY_MAX_CD1400s;
+ ++cyu, iobase += CY_CD1400_MEMSIZE) {
int i;
/* wait for chip to become ready for new command */
- for (i = 0; i < 100; i += 50) {
+ for (i = 0; i < 10; i++) {
DELAY(50);
if (!cd_inb(iobase, CD1400_CCR))
break;
@@ -483,12 +487,12 @@ sioprobe(dev)
CD1400_CCR_CMDRESET | CD1400_CCR_FULLRESET);
/* wait for the CD1400 to initialize itself */
- for (i = 0; i < 1000; i += 50) {
+ for (i = 0; i < 200; i++) {
DELAY(50);
/* retrieve firmware version */
firmware_version = cd_inb(iobase, CD1400_GFRCR);
- if (firmware_version != 0)
+ if ((firmware_version & 0xf0) == 0x40)
break;
}
@@ -497,7 +501,7 @@ sioprobe(dev)
* If one CD1400 is bad then we don't support higher
* numbered good ones on this board.
*/
- if ((firmware_version & 0xF0) != 0x40)
+ if ((firmware_version & 0xf0) != 0x40)
break;
++cy_nr_cd1400s[unit];
}
OpenPOWER on IntegriCloud