Note the origin (hi FreeBSD!) of a couple clever bits of Xbox

initialization code. No functional changes.
This commit is contained in:
jmcneill 2007-02-04 15:26:26 +00:00
parent dc3fb2d32c
commit 95e6498e25
2 changed files with 21 additions and 4 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.593 2007/01/12 20:34:09 gdt Exp $ */
/* $NetBSD: machdep.c,v 1.594 2007/02/04 15:26:26 jmcneill Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998, 2000, 2004, 2006 The NetBSD Foundation, Inc.
@ -72,7 +72,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.593 2007/01/12 20:34:09 gdt Exp $");
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.594 2007/02/04 15:26:26 jmcneill Exp $");
#include "opt_beep.h"
#include "opt_compat_ibcs2.h"
@ -1536,6 +1536,8 @@ init386(paddr_t first_avail)
#ifdef XBOX
/*
* From Rink Springer @ FreeBSD:
*
* The following code queries the PCI ID of 0:0:0. For the XBOX,
* This should be 0x10de / 0x02a5.
*

View File

@ -1,4 +1,4 @@
/* $NetBSD: xbox.c,v 1.2 2007/01/07 01:04:26 jmcneill Exp $ */
/* $NetBSD: xbox.c,v 1.3 2007/02/04 15:26:27 jmcneill Exp $ */
/*-
* Copyright (c) 2007 Jared D. McNeill <jmcneill@invisible.ca>
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: xbox.c,v 1.2 2007/01/07 01:04:26 jmcneill Exp $");
__KERNEL_RCSID(0, "$NetBSD: xbox.c,v 1.3 2007/02/04 15:26:27 jmcneill Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -66,6 +66,21 @@ xbox_startup(void)
if (!arch_i386_is_xbox)
return;
/*
* From Rink Springer @ FreeBSD:
*
* Some XBOX loaders, such as Cromwell, have a flaw which cause the
* nfe(4) driver to fail attaching to the NIC.
*
* This is because they leave the NIC running; this will cause the
* Nvidia driver to fail as the NIC does not return any sensible
* values and thus fails attaching (using an error 0x5, this means
* it cannot find a valid PHY)
*
* We bluntly tell the NIC to stop whatever it's doing; this makes
* nfe(4) attach correctly. As the NIC always resides at
* 0xfef00000-0xfef003ff on an XBOX, we simply hardcode this address.
*/
rv = bus_space_map(X86_BUS_SPACE_MEM, XBOX_NFORCE_NIC,
0x400, 0, &h);
if (!rv) {