Add platform support for the Motorola Ultra Plus and Ultra 60x boards.

Note that this currently matches only the boards built into Bull Estrella
systems, as Bull chose to change the board identification string whose
original content is not known at this time.
This commit is contained in:
kleink 2002-02-26 16:09:14 +00:00
parent 3cb5f61784
commit 9fcf8c7e63
5 changed files with 199 additions and 4 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: files.prep,v 1.26 2002/02/25 19:09:43 kleink Exp $
# $NetBSD: files.prep,v 1.27 2002/02/26 16:09:14 kleink Exp $
#
# prep-specific configuration info
#
@ -11,6 +11,10 @@ file arch/prep/prep/ibm_machdep.c
file arch/prep/prep/ibm_6050.c
file arch/prep/prep/ibm_7248.c
# Motorola
file arch/prep/prep/mot_machdep.c
file arch/prep/prep/mot_ulmb60xa.c
file arch/prep/prep/platform.c
file arch/prep/prep/autoconf.c

View File

@ -1,4 +1,4 @@
/* $NetBSD: platform.h,v 1.2 2002/02/24 13:19:07 kleink Exp $ */
/* $NetBSD: platform.h,v 1.3 2002/02/26 16:09:15 kleink Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@ -78,4 +78,11 @@ void reset_ibm_generic(void);
void pci_intr_fixup_ibm_6050(int, int, int *);
void pci_intr_fixup_ibm_7248(int, int, int *);
/* Motorola */
extern struct plattab plattab_mot;
extern struct platform platform_mot_ulmb60xa;
void pci_intr_fixup_mot_ulmb60xa(int, int, int *);
#endif /* !_PREP_PLATFORM_H_ */

View File

@ -0,0 +1,50 @@
/* $NetBSD: mot_machdep.c,v 1.1 2002/02/26 16:09:15 kleink Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Klaus J. Klein.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the NetBSD
* Foundation, Inc. and its contributors.
* 4. Neither the name of The NetBSD Foundation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/param.h>
#include <sys/systm.h>
#include <machine/platform.h>
static struct platform *platform_mot[] = {
&platform_mot_ulmb60xa
};
struct plattab plattab_mot = {
platform_mot, sizeof(platform_mot)/sizeof(platform_mot[0])
};

View File

@ -0,0 +1,127 @@
/* $NetBSD: mot_ulmb60xa.c,v 1.1 2002/02/26 16:09:15 kleink Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Klaus J. Klein.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the NetBSD
* Foundation, Inc. and its contributors.
* 4. Neither the name of The NetBSD Foundation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/param.h>
#include <sys/systm.h>
#include <machine/bus.h>
#include <machine/intr.h>
#include <machine/platform.h>
#include <machine/residual.h>
/*
* CPU Type Register
* These definitions should eventually be moved to a separate header file.
*/
#define MOT_CPUTYPE_REG (PREP_BUS_SPACE_IO + 0x0800)
/* Cache Size */
#define MOT_CPUTYPE_CSIZE_SHIFT 0
#define MOT_CPUTYPE_CSIZE_MASK 0x3
#define MOT_CPUTYPE_CSIZE(ct) \
(((ct) >> MOT_CPUTYPE_CSIZE_SHIFT) & MOT_CPUTYPE_CSIZE_MASK)
#define MOT_CPUTYPE_CSIZE_512K 0
#define MOT_CPUTYPE_CSIZE_256K 1
#define MOT_CPUTYPE_CSIZE_RESERVED 2
#define MOT_CPUTYPE_CSIZE_NONE 3
/* Board ID */
#define MOT_CPUTYPE_BOARDID_SHIFT 4
#define MOT_CPUTYPE_BOARDID_MASK 0xf
#define MOT_CPUTYPE_BOARDID(ct) \
(((ct) >> MOT_CPUTYPE_BOARDID_SHIFT) & MOT_CPUTYPE_BOARDID_MASK)
#define MOT_CPUTYPE_BOARDID_ULTRA 4
static int mot_ulmb60xa_match(struct platform *);
struct platform platform_mot_ulmb60xa = {
"BULL ESTRELLA (e0) (e0)", /* model */ /* XXX */
mot_ulmb60xa_match, /* match */
prep_pci_get_chipset_tag_indirect, /* pci_get_chipset_tag */
pci_intr_fixup_mot_ulmb60xa, /* pci_intr_fixup */
ext_intr_ivr, /* ext_intr */
cpu_setup_unknown, /* cpu_setup */
reset_ibm_generic, /* reset */
};
static int
mot_ulmb60xa_match(struct platform *p)
{
uint8_t cputype;
if (p->model == NULL)
return 0;
if (strcmp(res->VitalProductData.PrintableModel, p->model) != 0)
return 0;
/* Should possibly match against the FirmwareSupplier as well. */
cputype = *(volatile uint8_t *)MOT_CPUTYPE_REG;
__asm __volatile ("eieio; sync");
if (MOT_CPUTYPE_BOARDID(cputype) != MOT_CPUTYPE_BOARDID_ULTRA)
return 0;
return 1;
}
void
pci_intr_fixup_mot_ulmb60xa(int bus, int dev, int *line)
{
if (bus != 0)
return;
switch (dev) {
case 12: /* NCR 53c810 */
*line = 11;
break;
case 14: /* DEC 21440 */
*line = 9;
break;
case 16: /* Slot #1 */
*line = 9;
break;
case 17: /* Slot #2 */
*line = 9;
break;
case 18: /* Slot #3 */
*line = 11;
break;
}
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: platform.c,v 1.3 2002/02/24 13:19:09 kleink Exp $ */
/* $NetBSD: platform.c,v 1.4 2002/02/26 16:09:15 kleink Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@ -71,8 +71,15 @@ ident_platform(void)
if (res == NULL)
return 0;
if (strncmp(res->VitalProductData.PrintableModel, "IBM", 3) == 0)
if (strncmp(res->VitalProductData.PrintableModel,
"IBM", 3) == 0)
p = &plattab_ibm;
else if (strncmp(res->VitalProductData.PrintableModel,
"MOT", 3) == 0)
p = &plattab_mot;
else if (strncmp(res->VitalProductData.PrintableModel,
"BULL ESTRELLA (e0) (e0)", 31) == 0) /* XXX */
p = &plattab_mot;
else
p = &plattab_unknown;