From cbadff2712615ebad5ebd0dabe6e7302f9ab0e08 Mon Sep 17 00:00:00 2001 From: augustss Date: Thu, 12 May 2005 06:21:01 +0000 Subject: [PATCH] Make the Adaptec 1480 cardbus Slim SCSI card work. From a person wishing to remain anonymous. --- sys/dev/cardbus/ahc_cardbus.c | 24 ++++++++++++++++-------- sys/dev/cardbus/files.cardbus | 3 ++- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/sys/dev/cardbus/ahc_cardbus.c b/sys/dev/cardbus/ahc_cardbus.c index 0861f0092cba..96346e243cd9 100644 --- a/sys/dev/cardbus/ahc_cardbus.c +++ b/sys/dev/cardbus/ahc_cardbus.c @@ -1,7 +1,7 @@ -/* $NetBSD: ahc_cardbus.c,v 1.16 2005/02/27 00:26:59 perry Exp $ */ +/* $NetBSD: ahc_cardbus.c,v 1.17 2005/05/12 06:21:01 augustss Exp $ */ /*- - * Copyright (c) 2000 The NetBSD Foundation, Inc. + * Copyright (c) 2000, 2005 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation @@ -45,7 +45,9 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ahc_cardbus.c,v 1.16 2005/02/27 00:26:59 perry Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ahc_cardbus.c,v 1.17 2005/05/12 06:21:01 augustss Exp $"); + +#include "opt_ahc_cardbus.h" #include #include @@ -70,6 +72,10 @@ __KERNEL_RCSID(0, "$NetBSD: ahc_cardbus.c,v 1.16 2005/02/27 00:26:59 perry Exp $ #include +#ifndef AHC_CARDBUS_DEFAULT_SCSI_ID +#define AHC_CARDBUS_DEFAULT_SCSI_ID 0x7 +#endif + #define AHC_CARDBUS_IOBA 0x10 #define AHC_CARDBUS_MMBA 0x14 @@ -233,13 +239,15 @@ ahc_cardbus_attach(parent, self, aux) ahc_outb(ahc, DSPCISTATUS, DFTHRSH_100); if (ahc->flags & AHC_USEDEFAULTS) { + int our_id; /* - * We can't "use defaults", as we have no way - * of knowing what default settings hould be. + * Assume only one connector and always turn + * on termination. */ - printf("%s: CardBus device requires an SEEPROM\n", - ahc_name(ahc)); - return; + our_id = AHC_CARDBUS_DEFAULT_SCSI_ID; + sxfrctl1 = STPWEN; + ahc_outb(ahc, SCSICONF, our_id | ENSPCHK | RESET_SCSI); + ahc->our_id = our_id; } printf("%s: aic7860", ahc_name(ahc)); diff --git a/sys/dev/cardbus/files.cardbus b/sys/dev/cardbus/files.cardbus index 0e85b83f3668..8b2205c381a8 100644 --- a/sys/dev/cardbus/files.cardbus +++ b/sys/dev/cardbus/files.cardbus @@ -1,4 +1,4 @@ -# $NetBSD: files.cardbus,v 1.27 2005/01/29 22:05:26 jonathan Exp $ +# $NetBSD: files.cardbus,v 1.28 2005/05/12 06:21:01 augustss Exp $ # # files.cardbus # @@ -75,6 +75,7 @@ file dev/cardbus/fwohci_cardbus.c fwohci_cardbus # attach ahc at cardbus with ahc_cardbus: ahc_seeprom, smc93cx6 file dev/cardbus/ahc_cardbus.c ahc_cardbus +defparam opt_ahc_cardbus.h AHC_CARDBUS_DEFAULT_SCSI_ID # # PCI bridge