Add AHC_USETARGETDEFAULTS to ahc_flag, which enables to
use default target (but not for host) device settings on ahc(4) interface without its SEEPROM (mostly on-board one). This flag could be useful if host's BIOS (firmware) initializes ahc(4) chip with some conservative (async, no tagged queuing etc.) target settings for minimum support to load its primary loader etc., and it will be enabled in each attachment according to MD device properties(9). Currently this property is set only on sgimips for O2 on-board aic7880 adapters. No objection on tech-kern (and netbsd-bugs), and closes PR kern/23276.
This commit is contained in:
parent
b817a6b4f0
commit
ce21617f93
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: autoconf.c,v 1.28 2006/03/28 17:38:27 thorpej Exp $ */
|
||||
/* $NetBSD: autoconf.c,v 1.29 2006/04/15 14:22:52 tsutsui Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2000 Soren S. Jorvang
|
||||
|
@ -33,7 +33,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.28 2006/03/28 17:38:27 thorpej Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.29 2006/04/15 14:22:52 tsutsui Exp $");
|
||||
|
||||
#include "opt_ddb.h"
|
||||
|
||||
|
@ -48,6 +48,8 @@ __KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.28 2006/03/28 17:38:27 thorpej Exp $"
|
|||
#include <machine/machtype.h>
|
||||
#include <machine/autoconf.h>
|
||||
|
||||
#include <dev/pci/pcivar.h>
|
||||
|
||||
#include <dev/scsipi/scsi_all.h>
|
||||
#include <dev/scsipi/scsipi_all.h>
|
||||
#include <dev/scsipi/scsiconf.h>
|
||||
|
@ -166,14 +168,37 @@ cpu_rootconf()
|
|||
}
|
||||
|
||||
/*
|
||||
* Try to determine the boot device.
|
||||
* Try to determine the boot device and set up some device properties
|
||||
* to handle machine depedent quirks.
|
||||
*/
|
||||
|
||||
#define BUILTIN_AHC_P(pa) \
|
||||
(((pa)->pa_bus == 0 && (pa)->pa_device == 1 && (pa)->pa_function == 0) || \
|
||||
((pa)->pa_bus == 0 && (pa)->pa_device == 2 && (pa)->pa_function == 0))
|
||||
|
||||
void
|
||||
device_register(struct device *dev, void *aux)
|
||||
{
|
||||
static int found, initted, scsiboot, netboot;
|
||||
struct device *parent = device_parent(dev);
|
||||
|
||||
if (mach_type == MACH_SGI_IP32 &&
|
||||
parent != NULL && device_is_a(parent, "pci")) {
|
||||
struct pci_attach_args *pa = aux;
|
||||
|
||||
if (BUILTIN_AHC_P(pa)) {
|
||||
boolean_t usetd;
|
||||
|
||||
usetd = TRUE;
|
||||
if (devprop_set(dev, "use-target-defaults",
|
||||
&usetd, sizeof(usetd), 0, 0) != 0) {
|
||||
printf("WARNING: unable to set"
|
||||
"use-target-defaults property for %s\n",
|
||||
dev->dv_xname);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (found)
|
||||
return;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: aic7xxx.c,v 1.119 2006/03/14 15:24:30 tsutsui Exp $ */
|
||||
/* $NetBSD: aic7xxx.c,v 1.120 2006/04/15 14:22:52 tsutsui Exp $ */
|
||||
|
||||
/*
|
||||
* Core routines and tables shareable across OS platforms.
|
||||
|
@ -39,7 +39,7 @@
|
|||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGES.
|
||||
*
|
||||
* $Id: aic7xxx.c,v 1.119 2006/03/14 15:24:30 tsutsui Exp $
|
||||
* $Id: aic7xxx.c,v 1.120 2006/04/15 14:22:52 tsutsui Exp $
|
||||
*
|
||||
* //depot/aic7xxx/aic7xxx/aic7xxx.c#112 $
|
||||
*
|
||||
|
@ -50,7 +50,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: aic7xxx.c,v 1.119 2006/03/14 15:24:30 tsutsui Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: aic7xxx.c,v 1.120 2006/04/15 14:22:52 tsutsui Exp $");
|
||||
|
||||
#include <dev/ic/aic7xxx_osm.h>
|
||||
#include <dev/ic/aic7xxx_inline.h>
|
||||
|
@ -4634,13 +4634,20 @@ ahc_init(struct ahc_softc *ahc)
|
|||
|
||||
/* Grab the disconnection disable table and invert it for our needs */
|
||||
if ((ahc->flags & AHC_USEDEFAULTS) != 0) {
|
||||
printf("%s: Host Adapter Bios disabled. Using default SCSI "
|
||||
"device parameters\n", ahc_name(ahc));
|
||||
printf("%s: Host Adapter BIOS disabled. Using default SCSI "
|
||||
"host and target device parameters\n", ahc_name(ahc));
|
||||
ahc->flags |= AHC_EXTENDED_TRANS_A|AHC_EXTENDED_TRANS_B|
|
||||
AHC_TERM_ENB_A|AHC_TERM_ENB_B;
|
||||
discenable = ALL_TARGETS_MASK;
|
||||
if ((ahc->features & AHC_ULTRA) != 0)
|
||||
ultraenb = ALL_TARGETS_MASK;
|
||||
} else if ((ahc->flags & AHC_USETARGETDEFAULTS) != 0) {
|
||||
printf("%s: Host Adapter has no SEEPROM. Using default SCSI"
|
||||
" target parameters\n", ahc_name(ahc));
|
||||
ahc->flags |= AHC_EXTENDED_TRANS_A|AHC_EXTENDED_TRANS_B;
|
||||
discenable = ALL_TARGETS_MASK;
|
||||
if ((ahc->features & AHC_ULTRA) != 0)
|
||||
ultraenb = ALL_TARGETS_MASK;
|
||||
} else {
|
||||
discenable = ~((ahc_inb(ahc, DISC_DSB + 1) << 8)
|
||||
| ahc_inb(ahc, DISC_DSB));
|
||||
|
@ -4671,7 +4678,7 @@ ahc_init(struct ahc_softc *ahc)
|
|||
target_id, &tstate);
|
||||
/* Default to async narrow across the board */
|
||||
memset(tinfo, 0, sizeof(*tinfo));
|
||||
if (ahc->flags & AHC_USEDEFAULTS) {
|
||||
if (ahc->flags & (AHC_USEDEFAULTS | AHC_USETARGETDEFAULTS)) {
|
||||
if ((ahc->features & AHC_WIDE) != 0)
|
||||
tinfo->user.width = MSG_EXT_WDTR_BUS_16_BIT;
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGES.
|
||||
*
|
||||
* $Id: aic7xxxvar.h,v 1.51 2006/03/14 15:30:03 tsutsui Exp $
|
||||
* $Id: aic7xxxvar.h,v 1.52 2006/04/15 14:22:52 tsutsui Exp $
|
||||
*
|
||||
* $FreeBSD: /repoman/r/ncvs/src/sys/dev/aic7xxx/aic7xxx.h,v 1.44 2003/01/20 20:44:55 gibbs Exp $
|
||||
*/
|
||||
|
@ -415,8 +415,7 @@ typedef enum {
|
|||
AHC_USEDEFAULTS = 0x004, /*
|
||||
* For cards without an seeprom
|
||||
* or a BIOS to initialize the chip's
|
||||
* SRAM, we use the default target
|
||||
* settings.
|
||||
* SRAM, we use the default settings.
|
||||
*/
|
||||
AHC_SEQUENCER_DEBUG = 0x008,
|
||||
AHC_SHARED_SRAM = 0x010,
|
||||
|
@ -455,7 +454,14 @@ typedef enum {
|
|||
AHC_LSCBS_ENABLED = 0x2000000, /* 64Byte SCBs enabled */
|
||||
AHC_SCB_CONFIG_USED = 0x4000000, /* No SEEPROM but SCB2 had info. */
|
||||
AHC_NO_BIOS_INIT = 0x8000000, /* No BIOS left over settings. */
|
||||
AHC_DISABLE_PCI_PERR = 0x10000000
|
||||
AHC_DISABLE_PCI_PERR = 0x10000000,
|
||||
AHC_USETARGETDEFAULTS = 0x20000000 /*
|
||||
* For cards without an seeprom but
|
||||
* with BIOS which initializes chip's
|
||||
* SRAM with some conservative target
|
||||
* settings, we use the default
|
||||
* SCSI target settings.
|
||||
*/
|
||||
} ahc_flag;
|
||||
|
||||
/************************* Hardware SCB Definition ***************************/
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGES.
|
||||
*
|
||||
* $Id: ahc_pci.c,v 1.53 2005/12/24 20:27:42 perry Exp $
|
||||
* $Id: ahc_pci.c,v 1.54 2006/04/15 14:22:52 tsutsui Exp $
|
||||
*
|
||||
* //depot/aic7xxx/aic7xxx/aic7xxx_pci.c#57 $
|
||||
*
|
||||
|
@ -50,7 +50,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: ahc_pci.c,v 1.53 2005/12/24 20:27:42 perry Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: ahc_pci.c,v 1.54 2006/04/15 14:22:52 tsutsui Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
|
@ -1039,9 +1039,22 @@ ahc_pci_attach(struct device *parent, struct device *self, void *aux)
|
|||
/* See if someone else set us up already */
|
||||
if ((ahc->flags & AHC_NO_BIOS_INIT) == 0
|
||||
&& scsiseq != 0) {
|
||||
boolean_t usetd;
|
||||
|
||||
printf("%s: Using left over BIOS settings\n",
|
||||
ahc_name(ahc));
|
||||
ahc->flags &= ~AHC_USEDEFAULTS;
|
||||
/*
|
||||
* Ignore target device settings and use default
|
||||
* if BIOS initializes chip's SRAM with some
|
||||
* conservative settings (async, no tagged
|
||||
* queuing etc.) and machine dependent device
|
||||
* property is set.
|
||||
*/
|
||||
if (devprop_get(&ahc->sc_dev, "use-target-defaults",
|
||||
&usetd, sizeof(usetd), NULL) == sizeof(usetd) &&
|
||||
usetd == TRUE)
|
||||
ahc->flags |= AHC_USETARGETDEFAULTS;
|
||||
ahc->flags |= AHC_BIOS_ENABLED;
|
||||
} else {
|
||||
/*
|
||||
|
|
Loading…
Reference in New Issue