Add macro MVA_{UNIT,OFFSET,IRQ}_DEFAULT.
This commit is contained in:
parent
c1903f8449
commit
2c444bf727
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: gt.c,v 1.24 2010/06/09 02:19:51 kiyohara Exp $ */
|
||||
/* $NetBSD: gt.c,v 1.25 2010/07/11 08:43:36 kiyohara Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2002 Allegro Networks, Inc., Wasabi Systems, Inc.
|
||||
@ -42,7 +42,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: gt.c,v 1.24 2010/06/09 02:19:51 kiyohara Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: gt.c,v 1.25 2010/07/11 08:43:36 kiyohara Exp $");
|
||||
|
||||
#include "opt_marvell.h"
|
||||
#include "gtmpsc.h"
|
||||
@ -110,8 +110,8 @@ static int gt_watchdog_state = 0;
|
||||
#endif
|
||||
|
||||
|
||||
#define OFFSET_DEFAULT GTCF_OFFSET_DEFAULT
|
||||
#define IRQ_DEFAULT GTCF_IRQ_DEFAULT
|
||||
#define OFFSET_DEFAULT MVA_OFFSET_DEFAULT
|
||||
#define IRQ_DEFAULT MVA_IRQ_DEFAULT
|
||||
static const struct gt_dev {
|
||||
int model;
|
||||
const char *name;
|
||||
@ -159,15 +159,15 @@ gt_cfprint(void *aux, const char *pnp)
|
||||
aprint_normal("%s at %s unit %d",
|
||||
mva->mva_name, pnp, mva->mva_unit);
|
||||
else {
|
||||
if (mva->mva_unit != GTCF_UNIT_DEFAULT)
|
||||
if (mva->mva_unit != MVA_UNIT_DEFAULT)
|
||||
aprint_normal(" unit %d", mva->mva_unit);
|
||||
if (mva->mva_offset != GTCF_OFFSET_DEFAULT) {
|
||||
if (mva->mva_offset != MVA_OFFSET_DEFAULT) {
|
||||
aprint_normal(" offset 0x%04x", mva->mva_offset);
|
||||
if (mva->mva_size > 0)
|
||||
aprint_normal("-0x%04x",
|
||||
mva->mva_offset + mva->mva_size - 1);
|
||||
}
|
||||
if (mva->mva_irq != GTCF_IRQ_DEFAULT)
|
||||
if (mva->mva_irq != MVA_IRQ_DEFAULT)
|
||||
aprint_normal(" irq %d", mva->mva_irq);
|
||||
}
|
||||
|
||||
@ -181,7 +181,7 @@ gt_cfsearch(device_t parent, cfdata_t cf, const int *ldesc, void *aux)
|
||||
{
|
||||
struct marvell_attach_args *mva = aux;
|
||||
|
||||
if (cf->cf_loc[GTCF_IRQ] != GTCF_IRQ_DEFAULT)
|
||||
if (cf->cf_loc[GTCF_IRQ] != MVA_IRQ_DEFAULT)
|
||||
mva->mva_irq = cf->cf_loc[GTCF_IRQ];
|
||||
|
||||
return config_match(parent, cf, aux);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: gtidmac.c,v 1.3 2010/06/04 06:31:50 kiyohara Exp $ */
|
||||
/* $NetBSD: gtidmac.c,v 1.4 2010/07/11 08:43:36 kiyohara Exp $ */
|
||||
/*
|
||||
* Copyright (c) 2008 KIYOHARA Takashi
|
||||
* All rights reserved.
|
||||
@ -26,7 +26,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: gtidmac.c,v 1.3 2010/06/04 06:31:50 kiyohara Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: gtidmac.c,v 1.4 2010/07/11 08:43:36 kiyohara Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/bus.h>
|
||||
@ -289,8 +289,8 @@ gtidmac_match(device_t parent, struct cfdata *match, void *aux)
|
||||
if (mva->mva_model == MARVELL_ORION_1_88F6082)
|
||||
return 0;
|
||||
|
||||
if (mva->mva_offset == GTCF_OFFSET_DEFAULT ||
|
||||
mva->mva_irq == GTCF_IRQ_DEFAULT)
|
||||
if (mva->mva_offset == MVA_OFFSET_DEFAULT ||
|
||||
mva->mva_irq == MVA_IRQ_DEFAULT)
|
||||
return 0;
|
||||
|
||||
mva->mva_size = GTIDMAC_SIZE;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: gtmpsc.c,v 1.38 2010/04/28 13:51:56 kiyohara Exp $ */
|
||||
/* $NetBSD: gtmpsc.c,v 1.39 2010/07/11 08:43:36 kiyohara Exp $ */
|
||||
/*
|
||||
* Copyright (c) 2009 KIYOHARA Takashi
|
||||
* All rights reserved.
|
||||
@ -29,7 +29,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: gtmpsc.c,v 1.38 2010/04/28 13:51:56 kiyohara Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: gtmpsc.c,v 1.39 2010/07/11 08:43:36 kiyohara Exp $");
|
||||
|
||||
#include "opt_kgdb.h"
|
||||
|
||||
@ -229,8 +229,8 @@ gtmpscmatch(device_t parent, cfdata_t match, void *aux)
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
if (mva->mva_offset == GTCF_OFFSET_DEFAULT ||
|
||||
mva->mva_irq == GTCF_IRQ_DEFAULT)
|
||||
if (mva->mva_offset == MVA_OFFSET_DEFAULT ||
|
||||
mva->mva_irq == MVA_IRQ_DEFAULT)
|
||||
return 0;
|
||||
|
||||
mva->mva_size = GTMPSC_SIZE;
|
||||
@ -251,7 +251,7 @@ gtmpscattach(device_t parent, device_t self, void *aux)
|
||||
aprint_naive("\n");
|
||||
aprint_normal(": Multi-Protocol Serial Controller\n");
|
||||
|
||||
if (mva->mva_unit != GTCF_UNIT_DEFAULT)
|
||||
if (mva->mva_unit != MVA_UNIT_DEFAULT)
|
||||
unit = mva->mva_unit;
|
||||
else
|
||||
unit = (mva->mva_offset == GTMPSC_BASE(0)) ? 0 : 1;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: gtpci.c,v 1.25 2010/06/02 06:44:32 kiyohara Exp $ */
|
||||
/* $NetBSD: gtpci.c,v 1.26 2010/07/11 08:43:36 kiyohara Exp $ */
|
||||
/*
|
||||
* Copyright (c) 2008, 2009 KIYOHARA Takashi
|
||||
* All rights reserved.
|
||||
@ -26,7 +26,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: gtpci.c,v 1.25 2010/06/02 06:44:32 kiyohara Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: gtpci.c,v 1.26 2010/07/11 08:43:36 kiyohara Exp $");
|
||||
|
||||
#include "opt_pci.h"
|
||||
#include "pci.h"
|
||||
@ -99,8 +99,8 @@ gtpci_match(device_t parent, struct cfdata *match, void *aux)
|
||||
case MARVELL_DISCOVERY_V:
|
||||
case MARVELL_DISCOVERY_VI:
|
||||
#endif
|
||||
if (mva->mva_unit == GTCF_UNIT_DEFAULT ||
|
||||
mva->mva_offset != GTCF_OFFSET_DEFAULT)
|
||||
if (mva->mva_unit == MVA_UNIT_DEFAULT ||
|
||||
mva->mva_offset != MVA_OFFSET_DEFAULT)
|
||||
return 0;
|
||||
break;
|
||||
|
||||
@ -109,7 +109,7 @@ gtpci_match(device_t parent, struct cfdata *match, void *aux)
|
||||
case MARVELL_ORION_1_88F5182:
|
||||
case MARVELL_ORION_2_88F5281:
|
||||
case MARVELL_ORION_1_88W8660:
|
||||
if (mva->mva_offset == GTCF_OFFSET_DEFAULT)
|
||||
if (mva->mva_offset == MVA_OFFSET_DEFAULT)
|
||||
return 0;
|
||||
mva->mva_unit = 0; /* unit 0 only */
|
||||
break;
|
||||
@ -206,7 +206,7 @@ gtpci_attach(device_t parent, device_t self, void *aux)
|
||||
sc->sc_unit = mva->mva_unit;
|
||||
sc->sc_iot = mva->mva_iot;
|
||||
if (bus_space_subregion(mva->mva_iot, mva->mva_ioh,
|
||||
(mva->mva_offset != GTCF_OFFSET_DEFAULT) ? mva->mva_offset : 0,
|
||||
(mva->mva_offset != MVA_OFFSET_DEFAULT) ? mva->mva_offset : 0,
|
||||
mva->mva_size, &sc->sc_ioh)) {
|
||||
aprint_error_dev(self, "can't map registers\n");
|
||||
return;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: gttwsi.c,v 1.1 2010/04/28 13:51:56 kiyohara Exp $ */
|
||||
/* $NetBSD: gttwsi.c,v 1.2 2010/07/11 08:43:36 kiyohara Exp $ */
|
||||
/*
|
||||
* Copyright (c) 2008 Eiji Kawauchi.
|
||||
* All rights reserved.
|
||||
@ -66,7 +66,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: gttwsi.c,v 1.1 2010/04/28 13:51:56 kiyohara Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: gttwsi.c,v 1.2 2010/07/11 08:43:36 kiyohara Exp $");
|
||||
#include "locators.h"
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -158,8 +158,8 @@ gttwsi_match(device_t parent, cfdata_t match, void *aux)
|
||||
if (strcmp(mva->mva_name, match->cf_name) != 0)
|
||||
return 0;
|
||||
|
||||
if (mva->mva_offset == GTCF_OFFSET_DEFAULT ||
|
||||
mva->mva_irq == GTCF_IRQ_DEFAULT)
|
||||
if (mva->mva_offset == MVA_OFFSET_DEFAULT ||
|
||||
mva->mva_irq == MVA_IRQ_DEFAULT)
|
||||
return 0;
|
||||
|
||||
mva->mva_size = GTTWSI_SIZE;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: if_gfe.c,v 1.36 2010/04/28 13:51:56 kiyohara Exp $ */
|
||||
/* $NetBSD: if_gfe.c,v 1.37 2010/07/11 08:43:36 kiyohara Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2002 Allegro Networks, Inc., Wasabi Systems, Inc.
|
||||
@ -42,7 +42,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_gfe.c,v 1.36 2010/04/28 13:51:56 kiyohara Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_gfe.c,v 1.37 2010/07/11 08:43:36 kiyohara Exp $");
|
||||
|
||||
#include "opt_inet.h"
|
||||
#include "rnd.h"
|
||||
@ -226,7 +226,7 @@ gfec_match(device_t parent, cfdata_t cf, void *aux)
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
if (mva->mva_offset == GTCF_OFFSET_DEFAULT)
|
||||
if (mva->mva_offset == MVA_OFFSET_DEFAULT)
|
||||
return 0;
|
||||
|
||||
mva->mva_size = ETHC_SIZE;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: if_mvgbe.c,v 1.1 2010/06/02 06:18:11 kiyohara Exp $ */
|
||||
/* $NetBSD: if_mvgbe.c,v 1.2 2010/07/11 08:43:36 kiyohara Exp $ */
|
||||
/*
|
||||
* Copyright (c) 2007, 2008 KIYOHARA Takashi
|
||||
* All rights reserved.
|
||||
@ -25,7 +25,7 @@
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_mvgbe.c,v 1.1 2010/06/02 06:18:11 kiyohara Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_mvgbe.c,v 1.2 2010/07/11 08:43:36 kiyohara Exp $");
|
||||
|
||||
#include "rnd.h"
|
||||
|
||||
@ -297,7 +297,7 @@ mvgbec_match(device_t parent, struct cfdata *match, void *aux)
|
||||
if (strcmp(mva->mva_name, match->cf_name) != 0)
|
||||
return 0;
|
||||
|
||||
if (mva->mva_offset == GTCF_OFFSET_DEFAULT)
|
||||
if (mva->mva_offset == MVA_OFFSET_DEFAULT)
|
||||
return 0;
|
||||
|
||||
for (i = 0; i < __arraycount(mvgbe_ports); i++)
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: marvellvar.h,v 1.1 2010/04/28 13:51:56 kiyohara Exp $ */
|
||||
/* $NetBSD: marvellvar.h,v 1.2 2010/07/11 08:43:36 kiyohara Exp $ */
|
||||
/*
|
||||
* Copyright (c) 2009 KIYOHARA Takashi
|
||||
* All rights reserved.
|
||||
@ -54,6 +54,13 @@ struct marvell_attach_args {
|
||||
int mva_irq;
|
||||
};
|
||||
|
||||
#include "locators.h"
|
||||
|
||||
#define MVA_UNIT_DEFAULT GTCF_UNIT_DEFAULT
|
||||
#define MVA_OFFSET_DEFAULT GTCF_OFFSET_DEFAULT
|
||||
#define MVA_IRQ_DEFAULT GTCF_IRQ_DEFAULT
|
||||
|
||||
|
||||
void *marvell_intr_establish(int, int, int (*)(void *), void *);
|
||||
int marvell_winparams_by_tag(device_t, int, int *, int *, uint64_t *,
|
||||
uint32_t *);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: obio.c,v 1.14 2010/06/02 05:59:36 kiyohara Exp $ */
|
||||
/* $NetBSD: obio.c,v 1.15 2010/07/11 08:43:36 kiyohara Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2002 Allegro Networks, Inc., Wasabi Systems, Inc.
|
||||
@ -38,7 +38,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: obio.c,v 1.14 2010/06/02 05:59:36 kiyohara Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: obio.c,v 1.15 2010/07/11 08:43:36 kiyohara Exp $");
|
||||
|
||||
#include "opt_marvell.h"
|
||||
|
||||
@ -89,7 +89,7 @@ obio_match(device_t parent, cfdata_t cf, void *aux)
|
||||
return 0;
|
||||
|
||||
#define NUM_OBIO 5
|
||||
if (mva->mva_unit == GTCF_UNIT_DEFAULT ||
|
||||
if (mva->mva_unit == MVA_UNIT_DEFAULT ||
|
||||
mva->mva_unit > NUM_OBIO)
|
||||
return 0;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user