2005-04-17 06:20:36 +08:00
|
|
|
/*
|
|
|
|
* This file is subject to the terms and conditions of the GNU General Public
|
|
|
|
* License. See the file "COPYING" in the main directory of this archive
|
|
|
|
* for more details.
|
|
|
|
*
|
Altix: Add initial ACPI IO support
First phase in introducing ACPI support to SN.
In this phase, when running with an ACPI capable PROM,
the DSDT will define the root busses and all SN nodes
(SGIHUB, SGITIO). An ACPI bus driver will be registered
for the node devices, with the acpi_pci_root_driver being
used for the root busses. An ACPI vendor descriptor is
now used to pass platform specific information for both
nodes and busses, eliminating the need for the current
SAL calls. Also, with ACPI support, SN fixup code is no longer
needed to initiate the PCI bus scans, as the acpi_pci_root_driver
does that.
However, to maintain backward compatibility with non-ACPI capable
PROMs, none of the current 'fixup' code can been deleted, though
much restructuring has been done. For example, the bulk of the code
in io_common.c is relocated code that is now common regardless
of what PROM is running, while io_acpi_init.c and io_init.c contain
routines specific to an ACPI or non ACPI capable PROM respectively.
A new pci bus fixup platform vector has been created to provide
a hook for invoking platform specific bus fixup from pcibios_fixup_bus().
The size of io_space[] has been increased to support systems with
large IO configurations.
Signed-off-by: John Keller <jpk@sgi.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-10-05 05:49:25 +08:00
|
|
|
* Copyright (C) 1992 - 1997, 2000-2006 Silicon Graphics, Inc. All rights reserved.
|
2005-04-17 06:20:36 +08:00
|
|
|
*/
|
|
|
|
|
include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
percpu.h is included by sched.h and module.h and thus ends up being
included when building most .c files. percpu.h includes slab.h which
in turn includes gfp.h making everything defined by the two files
universally available and complicating inclusion dependencies.
percpu.h -> slab.h dependency is about to be removed. Prepare for
this change by updating users of gfp and slab facilities include those
headers directly instead of assuming availability. As this conversion
needs to touch large number of source files, the following script is
used as the basis of conversion.
http://userweb.kernel.org/~tj/misc/slabh-sweep.py
The script does the followings.
* Scan files for gfp and slab usages and update includes such that
only the necessary includes are there. ie. if only gfp is used,
gfp.h, if slab is used, slab.h.
* When the script inserts a new include, it looks at the include
blocks and try to put the new include such that its order conforms
to its surrounding. It's put in the include block which contains
core kernel includes, in the same order that the rest are ordered -
alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
doesn't seem to be any matching order.
* If the script can't find a place to put a new include (mostly
because the file doesn't have fitting include block), it prints out
an error message indicating which .h file needs to be added to the
file.
The conversion was done in the following steps.
1. The initial automatic conversion of all .c files updated slightly
over 4000 files, deleting around 700 includes and adding ~480 gfp.h
and ~3000 slab.h inclusions. The script emitted errors for ~400
files.
2. Each error was manually checked. Some didn't need the inclusion,
some needed manual addition while adding it to implementation .h or
embedding .c file was more appropriate for others. This step added
inclusions to around 150 files.
3. The script was run again and the output was compared to the edits
from #2 to make sure no file was left behind.
4. Several build tests were done and a couple of problems were fixed.
e.g. lib/decompress_*.c used malloc/free() wrappers around slab
APIs requiring slab.h to be added manually.
5. The script was run on all .h files but without automatically
editing them as sprinkling gfp.h and slab.h inclusions around .h
files could easily lead to inclusion dependency hell. Most gfp.h
inclusion directives were ignored as stuff from gfp.h was usually
wildly available and often used in preprocessor macros. Each
slab.h inclusion directive was examined and added manually as
necessary.
6. percpu.h was updated not to include slab.h.
7. Build test were done on the following configurations and failures
were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
distributed build env didn't work with gcov compiles) and a few
more options had to be turned off depending on archs to make things
build (like ipr on powerpc/64 which failed due to missing writeq).
* x86 and x86_64 UP and SMP allmodconfig and a custom test config.
* powerpc and powerpc64 SMP allmodconfig
* sparc and sparc64 SMP allmodconfig
* ia64 SMP allmodconfig
* s390 SMP allmodconfig
* alpha SMP allmodconfig
* um on x86_64 SMP allmodconfig
8. percpu.h modifications were reverted so that it could be applied as
a separate patch and serve as bisection point.
Given the fact that I had only a couple of failures from tests on step
6, I'm fairly confident about the coverage of this conversion patch.
If there is a breakage, it's likely to be something in one of the arch
headers which should be easily discoverable easily on most builds of
the specific arch.
Signed-off-by: Tejun Heo <tj@kernel.org>
Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
2010-03-24 16:04:11 +08:00
|
|
|
#include <linux/slab.h>
|
2005-04-17 06:20:36 +08:00
|
|
|
#include <asm/sn/types.h>
|
|
|
|
#include <asm/sn/addrs.h>
|
|
|
|
#include <asm/sn/io.h>
|
2006-03-09 02:30:18 +08:00
|
|
|
#include <asm/sn/module.h>
|
Altix: Add initial ACPI IO support
First phase in introducing ACPI support to SN.
In this phase, when running with an ACPI capable PROM,
the DSDT will define the root busses and all SN nodes
(SGIHUB, SGITIO). An ACPI bus driver will be registered
for the node devices, with the acpi_pci_root_driver being
used for the root busses. An ACPI vendor descriptor is
now used to pass platform specific information for both
nodes and busses, eliminating the need for the current
SAL calls. Also, with ACPI support, SN fixup code is no longer
needed to initiate the PCI bus scans, as the acpi_pci_root_driver
does that.
However, to maintain backward compatibility with non-ACPI capable
PROMs, none of the current 'fixup' code can been deleted, though
much restructuring has been done. For example, the bulk of the code
in io_common.c is relocated code that is now common regardless
of what PROM is running, while io_acpi_init.c and io_init.c contain
routines specific to an ACPI or non ACPI capable PROM respectively.
A new pci bus fixup platform vector has been created to provide
a hook for invoking platform specific bus fixup from pcibios_fixup_bus().
The size of io_space[] has been increased to support systems with
large IO configurations.
Signed-off-by: John Keller <jpk@sgi.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-10-05 05:49:25 +08:00
|
|
|
#include <asm/sn/intr.h>
|
2005-07-07 06:26:51 +08:00
|
|
|
#include <asm/sn/pcibus_provider_defs.h>
|
|
|
|
#include <asm/sn/pcidev.h>
|
|
|
|
#include <asm/sn/sn_sal.h>
|
|
|
|
#include "xtalk/hubdev.h"
|
2005-08-04 04:35:00 +08:00
|
|
|
|
2005-04-26 02:26:03 +08:00
|
|
|
/*
|
Altix: Add initial ACPI IO support
First phase in introducing ACPI support to SN.
In this phase, when running with an ACPI capable PROM,
the DSDT will define the root busses and all SN nodes
(SGIHUB, SGITIO). An ACPI bus driver will be registered
for the node devices, with the acpi_pci_root_driver being
used for the root busses. An ACPI vendor descriptor is
now used to pass platform specific information for both
nodes and busses, eliminating the need for the current
SAL calls. Also, with ACPI support, SN fixup code is no longer
needed to initiate the PCI bus scans, as the acpi_pci_root_driver
does that.
However, to maintain backward compatibility with non-ACPI capable
PROMs, none of the current 'fixup' code can been deleted, though
much restructuring has been done. For example, the bulk of the code
in io_common.c is relocated code that is now common regardless
of what PROM is running, while io_acpi_init.c and io_init.c contain
routines specific to an ACPI or non ACPI capable PROM respectively.
A new pci bus fixup platform vector has been created to provide
a hook for invoking platform specific bus fixup from pcibios_fixup_bus().
The size of io_space[] has been increased to support systems with
large IO configurations.
Signed-off-by: John Keller <jpk@sgi.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-10-05 05:49:25 +08:00
|
|
|
* The code in this file will only be executed when running with
|
|
|
|
* a PROM that does _not_ have base ACPI IO support.
|
|
|
|
* (i.e., SN_ACPI_BASE_SUPPORT() == 0)
|
2005-04-26 02:26:03 +08:00
|
|
|
*/
|
|
|
|
|
Altix: Add initial ACPI IO support
First phase in introducing ACPI support to SN.
In this phase, when running with an ACPI capable PROM,
the DSDT will define the root busses and all SN nodes
(SGIHUB, SGITIO). An ACPI bus driver will be registered
for the node devices, with the acpi_pci_root_driver being
used for the root busses. An ACPI vendor descriptor is
now used to pass platform specific information for both
nodes and busses, eliminating the need for the current
SAL calls. Also, with ACPI support, SN fixup code is no longer
needed to initiate the PCI bus scans, as the acpi_pci_root_driver
does that.
However, to maintain backward compatibility with non-ACPI capable
PROMs, none of the current 'fixup' code can been deleted, though
much restructuring has been done. For example, the bulk of the code
in io_common.c is relocated code that is now common regardless
of what PROM is running, while io_acpi_init.c and io_init.c contain
routines specific to an ACPI or non ACPI capable PROM respectively.
A new pci bus fixup platform vector has been created to provide
a hook for invoking platform specific bus fixup from pcibios_fixup_bus().
The size of io_space[] has been increased to support systems with
large IO configurations.
Signed-off-by: John Keller <jpk@sgi.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-10-05 05:49:25 +08:00
|
|
|
static int max_segment_number; /* Default highest segment number */
|
|
|
|
static int max_pcibus_number = 255; /* Default highest pci bus number */
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Retrieve the hub device info structure for the given nasid.
|
|
|
|
*/
|
2005-12-24 02:33:25 +08:00
|
|
|
static inline u64 sal_get_hubdev_info(u64 handle, u64 address)
|
2005-04-17 06:20:36 +08:00
|
|
|
{
|
|
|
|
struct ia64_sal_retval ret_stuff;
|
|
|
|
ret_stuff.status = 0;
|
|
|
|
ret_stuff.v0 = 0;
|
|
|
|
|
|
|
|
SAL_CALL_NOLOCK(ret_stuff,
|
|
|
|
(u64) SN_SAL_IOIF_GET_HUBDEV_INFO,
|
|
|
|
(u64) handle, (u64) address, 0, 0, 0, 0, 0);
|
|
|
|
return ret_stuff.v0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Retrieve the pci bus information given the bus number.
|
|
|
|
*/
|
2005-12-24 02:33:25 +08:00
|
|
|
static inline u64 sal_get_pcibus_info(u64 segment, u64 busnum, u64 address)
|
2005-04-17 06:20:36 +08:00
|
|
|
{
|
|
|
|
struct ia64_sal_retval ret_stuff;
|
|
|
|
ret_stuff.status = 0;
|
|
|
|
ret_stuff.v0 = 0;
|
|
|
|
|
|
|
|
SAL_CALL_NOLOCK(ret_stuff,
|
|
|
|
(u64) SN_SAL_IOIF_GET_PCIBUS_INFO,
|
|
|
|
(u64) segment, (u64) busnum, (u64) address, 0, 0, 0, 0);
|
|
|
|
return ret_stuff.v0;
|
|
|
|
}
|
|
|
|
|
2007-01-30 14:17:37 +08:00
|
|
|
/*
|
|
|
|
* Retrieve the pci device information given the bus and device|function number.
|
|
|
|
*/
|
|
|
|
static inline u64
|
|
|
|
sal_get_pcidev_info(u64 segment, u64 bus_number, u64 devfn, u64 pci_dev,
|
|
|
|
u64 sn_irq_info)
|
|
|
|
{
|
|
|
|
struct ia64_sal_retval ret_stuff;
|
|
|
|
ret_stuff.status = 0;
|
|
|
|
ret_stuff.v0 = 0;
|
|
|
|
|
|
|
|
SAL_CALL_NOLOCK(ret_stuff,
|
|
|
|
(u64) SN_SAL_IOIF_GET_PCIDEV_INFO,
|
|
|
|
(u64) segment, (u64) bus_number, (u64) devfn,
|
|
|
|
(u64) pci_dev,
|
|
|
|
sn_irq_info, 0, 0);
|
|
|
|
return ret_stuff.v0;
|
|
|
|
}
|
|
|
|
|
2006-01-17 04:31:52 +08:00
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
/*
|
Altix: Add initial ACPI IO support
First phase in introducing ACPI support to SN.
In this phase, when running with an ACPI capable PROM,
the DSDT will define the root busses and all SN nodes
(SGIHUB, SGITIO). An ACPI bus driver will be registered
for the node devices, with the acpi_pci_root_driver being
used for the root busses. An ACPI vendor descriptor is
now used to pass platform specific information for both
nodes and busses, eliminating the need for the current
SAL calls. Also, with ACPI support, SN fixup code is no longer
needed to initiate the PCI bus scans, as the acpi_pci_root_driver
does that.
However, to maintain backward compatibility with non-ACPI capable
PROMs, none of the current 'fixup' code can been deleted, though
much restructuring has been done. For example, the bulk of the code
in io_common.c is relocated code that is now common regardless
of what PROM is running, while io_acpi_init.c and io_init.c contain
routines specific to an ACPI or non ACPI capable PROM respectively.
A new pci bus fixup platform vector has been created to provide
a hook for invoking platform specific bus fixup from pcibios_fixup_bus().
The size of io_space[] has been increased to support systems with
large IO configurations.
Signed-off-by: John Keller <jpk@sgi.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-10-05 05:49:25 +08:00
|
|
|
* sn_fixup_ionodes() - This routine initializes the HUB data structure for
|
|
|
|
* each node in the system. This function is only
|
|
|
|
* executed when running with a non-ACPI capable PROM.
|
2005-04-17 06:20:36 +08:00
|
|
|
*/
|
2006-02-02 18:15:51 +08:00
|
|
|
static void __init sn_fixup_ionodes(void)
|
2005-04-17 06:20:36 +08:00
|
|
|
{
|
Altix: Add initial ACPI IO support
First phase in introducing ACPI support to SN.
In this phase, when running with an ACPI capable PROM,
the DSDT will define the root busses and all SN nodes
(SGIHUB, SGITIO). An ACPI bus driver will be registered
for the node devices, with the acpi_pci_root_driver being
used for the root busses. An ACPI vendor descriptor is
now used to pass platform specific information for both
nodes and busses, eliminating the need for the current
SAL calls. Also, with ACPI support, SN fixup code is no longer
needed to initiate the PCI bus scans, as the acpi_pci_root_driver
does that.
However, to maintain backward compatibility with non-ACPI capable
PROMs, none of the current 'fixup' code can been deleted, though
much restructuring has been done. For example, the bulk of the code
in io_common.c is relocated code that is now common regardless
of what PROM is running, while io_acpi_init.c and io_init.c contain
routines specific to an ACPI or non ACPI capable PROM respectively.
A new pci bus fixup platform vector has been created to provide
a hook for invoking platform specific bus fixup from pcibios_fixup_bus().
The size of io_space[] has been increased to support systems with
large IO configurations.
Signed-off-by: John Keller <jpk@sgi.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-10-05 05:49:25 +08:00
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
struct hubdev_info *hubdev;
|
2005-12-24 02:33:25 +08:00
|
|
|
u64 status;
|
|
|
|
u64 nasid;
|
Altix: Add initial ACPI IO support
First phase in introducing ACPI support to SN.
In this phase, when running with an ACPI capable PROM,
the DSDT will define the root busses and all SN nodes
(SGIHUB, SGITIO). An ACPI bus driver will be registered
for the node devices, with the acpi_pci_root_driver being
used for the root busses. An ACPI vendor descriptor is
now used to pass platform specific information for both
nodes and busses, eliminating the need for the current
SAL calls. Also, with ACPI support, SN fixup code is no longer
needed to initiate the PCI bus scans, as the acpi_pci_root_driver
does that.
However, to maintain backward compatibility with non-ACPI capable
PROMs, none of the current 'fixup' code can been deleted, though
much restructuring has been done. For example, the bulk of the code
in io_common.c is relocated code that is now common regardless
of what PROM is running, while io_acpi_init.c and io_init.c contain
routines specific to an ACPI or non ACPI capable PROM respectively.
A new pci bus fixup platform vector has been created to provide
a hook for invoking platform specific bus fixup from pcibios_fixup_bus().
The size of io_space[] has been increased to support systems with
large IO configurations.
Signed-off-by: John Keller <jpk@sgi.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-10-05 05:49:25 +08:00
|
|
|
int i;
|
|
|
|
extern void sn_common_hubdev_init(struct hubdev_info *);
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2005-08-04 04:35:00 +08:00
|
|
|
/*
|
|
|
|
* Get SGI Specific HUB chipset information.
|
|
|
|
* Inform Prom that this kernel can support domain bus numbering.
|
|
|
|
*/
|
2005-09-13 01:15:43 +08:00
|
|
|
for (i = 0; i < num_cnodes; i++) {
|
2005-04-17 06:20:36 +08:00
|
|
|
hubdev = (struct hubdev_info *)(NODEPDA(i)->pdinfo);
|
|
|
|
nasid = cnodeid_to_nasid(i);
|
2005-08-04 04:35:00 +08:00
|
|
|
hubdev->max_segment_number = 0xffffffff;
|
|
|
|
hubdev->max_pcibus_number = 0xff;
|
2005-12-24 02:33:25 +08:00
|
|
|
status = sal_get_hubdev_info(nasid, (u64) __pa(hubdev));
|
2005-04-17 06:20:36 +08:00
|
|
|
if (status)
|
|
|
|
continue;
|
|
|
|
|
2005-08-04 04:35:00 +08:00
|
|
|
/* Save the largest Domain and pcibus numbers found. */
|
|
|
|
if (hubdev->max_segment_number) {
|
|
|
|
/*
|
|
|
|
* Dealing with a Prom that supports segments.
|
|
|
|
*/
|
|
|
|
max_segment_number = hubdev->max_segment_number;
|
|
|
|
max_pcibus_number = hubdev->max_pcibus_number;
|
|
|
|
}
|
Altix: Add initial ACPI IO support
First phase in introducing ACPI support to SN.
In this phase, when running with an ACPI capable PROM,
the DSDT will define the root busses and all SN nodes
(SGIHUB, SGITIO). An ACPI bus driver will be registered
for the node devices, with the acpi_pci_root_driver being
used for the root busses. An ACPI vendor descriptor is
now used to pass platform specific information for both
nodes and busses, eliminating the need for the current
SAL calls. Also, with ACPI support, SN fixup code is no longer
needed to initiate the PCI bus scans, as the acpi_pci_root_driver
does that.
However, to maintain backward compatibility with non-ACPI capable
PROMs, none of the current 'fixup' code can been deleted, though
much restructuring has been done. For example, the bulk of the code
in io_common.c is relocated code that is now common regardless
of what PROM is running, while io_acpi_init.c and io_init.c contain
routines specific to an ACPI or non ACPI capable PROM respectively.
A new pci bus fixup platform vector has been created to provide
a hook for invoking platform specific bus fixup from pcibios_fixup_bus().
The size of io_space[] has been increased to support systems with
large IO configurations.
Signed-off-by: John Keller <jpk@sgi.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-10-05 05:49:25 +08:00
|
|
|
sn_common_hubdev_init(hubdev);
|
|
|
|
}
|
|
|
|
}
|
2005-08-04 04:35:00 +08:00
|
|
|
|
Altix: Add initial ACPI IO support
First phase in introducing ACPI support to SN.
In this phase, when running with an ACPI capable PROM,
the DSDT will define the root busses and all SN nodes
(SGIHUB, SGITIO). An ACPI bus driver will be registered
for the node devices, with the acpi_pci_root_driver being
used for the root busses. An ACPI vendor descriptor is
now used to pass platform specific information for both
nodes and busses, eliminating the need for the current
SAL calls. Also, with ACPI support, SN fixup code is no longer
needed to initiate the PCI bus scans, as the acpi_pci_root_driver
does that.
However, to maintain backward compatibility with non-ACPI capable
PROMs, none of the current 'fixup' code can been deleted, though
much restructuring has been done. For example, the bulk of the code
in io_common.c is relocated code that is now common regardless
of what PROM is running, while io_acpi_init.c and io_init.c contain
routines specific to an ACPI or non ACPI capable PROM respectively.
A new pci bus fixup platform vector has been created to provide
a hook for invoking platform specific bus fixup from pcibios_fixup_bus().
The size of io_space[] has been increased to support systems with
large IO configurations.
Signed-off-by: John Keller <jpk@sgi.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-10-05 05:49:25 +08:00
|
|
|
/*
|
|
|
|
* sn_pci_legacy_window_fixup - Create PCI controller windows for
|
|
|
|
* legacy IO and MEM space. This needs to
|
|
|
|
* be done here, as the PROM does not have
|
|
|
|
* ACPI support defining the root buses
|
|
|
|
* and their resources (_CRS),
|
|
|
|
*/
|
|
|
|
static void
|
|
|
|
sn_legacy_pci_window_fixup(struct pci_controller *controller,
|
|
|
|
u64 legacy_io, u64 legacy_mem)
|
|
|
|
{
|
|
|
|
controller->window = kcalloc(2, sizeof(struct pci_window),
|
|
|
|
GFP_KERNEL);
|
2009-03-10 13:10:30 +08:00
|
|
|
BUG_ON(controller->window == NULL);
|
Altix: Add initial ACPI IO support
First phase in introducing ACPI support to SN.
In this phase, when running with an ACPI capable PROM,
the DSDT will define the root busses and all SN nodes
(SGIHUB, SGITIO). An ACPI bus driver will be registered
for the node devices, with the acpi_pci_root_driver being
used for the root busses. An ACPI vendor descriptor is
now used to pass platform specific information for both
nodes and busses, eliminating the need for the current
SAL calls. Also, with ACPI support, SN fixup code is no longer
needed to initiate the PCI bus scans, as the acpi_pci_root_driver
does that.
However, to maintain backward compatibility with non-ACPI capable
PROMs, none of the current 'fixup' code can been deleted, though
much restructuring has been done. For example, the bulk of the code
in io_common.c is relocated code that is now common regardless
of what PROM is running, while io_acpi_init.c and io_init.c contain
routines specific to an ACPI or non ACPI capable PROM respectively.
A new pci bus fixup platform vector has been created to provide
a hook for invoking platform specific bus fixup from pcibios_fixup_bus().
The size of io_space[] has been increased to support systems with
large IO configurations.
Signed-off-by: John Keller <jpk@sgi.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-10-05 05:49:25 +08:00
|
|
|
controller->window[0].offset = legacy_io;
|
|
|
|
controller->window[0].resource.name = "legacy_io";
|
|
|
|
controller->window[0].resource.flags = IORESOURCE_IO;
|
|
|
|
controller->window[0].resource.start = legacy_io;
|
|
|
|
controller->window[0].resource.end =
|
|
|
|
controller->window[0].resource.start + 0xffff;
|
|
|
|
controller->window[0].resource.parent = &ioport_resource;
|
|
|
|
controller->window[1].offset = legacy_mem;
|
|
|
|
controller->window[1].resource.name = "legacy_mem";
|
|
|
|
controller->window[1].resource.flags = IORESOURCE_MEM;
|
|
|
|
controller->window[1].resource.start = legacy_mem;
|
|
|
|
controller->window[1].resource.end =
|
|
|
|
controller->window[1].resource.start + (1024 * 1024) - 1;
|
|
|
|
controller->window[1].resource.parent = &iomem_resource;
|
|
|
|
controller->windows = 2;
|
2005-04-17 06:20:36 +08:00
|
|
|
}
|
|
|
|
|
2005-11-30 06:36:32 +08:00
|
|
|
/*
|
|
|
|
* sn_pci_window_fixup() - Create a pci_window for each device resource.
|
Altix: Add initial ACPI IO support
First phase in introducing ACPI support to SN.
In this phase, when running with an ACPI capable PROM,
the DSDT will define the root busses and all SN nodes
(SGIHUB, SGITIO). An ACPI bus driver will be registered
for the node devices, with the acpi_pci_root_driver being
used for the root busses. An ACPI vendor descriptor is
now used to pass platform specific information for both
nodes and busses, eliminating the need for the current
SAL calls. Also, with ACPI support, SN fixup code is no longer
needed to initiate the PCI bus scans, as the acpi_pci_root_driver
does that.
However, to maintain backward compatibility with non-ACPI capable
PROMs, none of the current 'fixup' code can been deleted, though
much restructuring has been done. For example, the bulk of the code
in io_common.c is relocated code that is now common regardless
of what PROM is running, while io_acpi_init.c and io_init.c contain
routines specific to an ACPI or non ACPI capable PROM respectively.
A new pci bus fixup platform vector has been created to provide
a hook for invoking platform specific bus fixup from pcibios_fixup_bus().
The size of io_space[] has been increased to support systems with
large IO configurations.
Signed-off-by: John Keller <jpk@sgi.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-10-05 05:49:25 +08:00
|
|
|
* It will setup pci_windows for use by
|
|
|
|
* pcibios_bus_to_resource(), pcibios_resource_to_bus(),
|
|
|
|
* etc.
|
2005-11-30 06:36:32 +08:00
|
|
|
*/
|
|
|
|
static void
|
|
|
|
sn_pci_window_fixup(struct pci_dev *dev, unsigned int count,
|
2006-01-17 11:54:40 +08:00
|
|
|
s64 * pci_addrs)
|
2005-11-30 06:36:32 +08:00
|
|
|
{
|
|
|
|
struct pci_controller *controller = PCI_CONTROLLER(dev->bus);
|
|
|
|
unsigned int i;
|
|
|
|
unsigned int idx;
|
|
|
|
unsigned int new_count;
|
|
|
|
struct pci_window *new_window;
|
|
|
|
|
|
|
|
if (count == 0)
|
|
|
|
return;
|
|
|
|
idx = controller->windows;
|
|
|
|
new_count = controller->windows + count;
|
|
|
|
new_window = kcalloc(new_count, sizeof(struct pci_window), GFP_KERNEL);
|
2009-03-10 13:10:30 +08:00
|
|
|
BUG_ON(new_window == NULL);
|
2005-11-30 06:36:32 +08:00
|
|
|
if (controller->window) {
|
|
|
|
memcpy(new_window, controller->window,
|
|
|
|
sizeof(struct pci_window) * controller->windows);
|
|
|
|
kfree(controller->window);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Setup a pci_window for each device resource. */
|
|
|
|
for (i = 0; i <= PCI_ROM_RESOURCE; i++) {
|
|
|
|
if (pci_addrs[i] == -1)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
new_window[idx].offset = dev->resource[i].start - pci_addrs[i];
|
|
|
|
new_window[idx].resource = dev->resource[i];
|
|
|
|
idx++;
|
|
|
|
}
|
|
|
|
|
|
|
|
controller->windows = new_count;
|
|
|
|
controller->window = new_window;
|
|
|
|
}
|
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
/*
|
2007-01-30 14:17:37 +08:00
|
|
|
* sn_io_slot_fixup() - We are not running with an ACPI capable PROM,
|
Altix: Add initial ACPI IO support
First phase in introducing ACPI support to SN.
In this phase, when running with an ACPI capable PROM,
the DSDT will define the root busses and all SN nodes
(SGIHUB, SGITIO). An ACPI bus driver will be registered
for the node devices, with the acpi_pci_root_driver being
used for the root busses. An ACPI vendor descriptor is
now used to pass platform specific information for both
nodes and busses, eliminating the need for the current
SAL calls. Also, with ACPI support, SN fixup code is no longer
needed to initiate the PCI bus scans, as the acpi_pci_root_driver
does that.
However, to maintain backward compatibility with non-ACPI capable
PROMs, none of the current 'fixup' code can been deleted, though
much restructuring has been done. For example, the bulk of the code
in io_common.c is relocated code that is now common regardless
of what PROM is running, while io_acpi_init.c and io_init.c contain
routines specific to an ACPI or non ACPI capable PROM respectively.
A new pci bus fixup platform vector has been created to provide
a hook for invoking platform specific bus fixup from pcibios_fixup_bus().
The size of io_space[] has been increased to support systems with
large IO configurations.
Signed-off-by: John Keller <jpk@sgi.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-10-05 05:49:25 +08:00
|
|
|
* and need to convert the pci_dev->resource
|
|
|
|
* 'start' and 'end' addresses to mapped addresses,
|
|
|
|
* and setup the pci_controller->window array entries.
|
2005-04-17 06:20:36 +08:00
|
|
|
*/
|
Altix: Add initial ACPI IO support
First phase in introducing ACPI support to SN.
In this phase, when running with an ACPI capable PROM,
the DSDT will define the root busses and all SN nodes
(SGIHUB, SGITIO). An ACPI bus driver will be registered
for the node devices, with the acpi_pci_root_driver being
used for the root busses. An ACPI vendor descriptor is
now used to pass platform specific information for both
nodes and busses, eliminating the need for the current
SAL calls. Also, with ACPI support, SN fixup code is no longer
needed to initiate the PCI bus scans, as the acpi_pci_root_driver
does that.
However, to maintain backward compatibility with non-ACPI capable
PROMs, none of the current 'fixup' code can been deleted, though
much restructuring has been done. For example, the bulk of the code
in io_common.c is relocated code that is now common regardless
of what PROM is running, while io_acpi_init.c and io_init.c contain
routines specific to an ACPI or non ACPI capable PROM respectively.
A new pci bus fixup platform vector has been created to provide
a hook for invoking platform specific bus fixup from pcibios_fixup_bus().
The size of io_space[] has been increased to support systems with
large IO configurations.
Signed-off-by: John Keller <jpk@sgi.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-10-05 05:49:25 +08:00
|
|
|
void
|
2007-01-30 14:17:37 +08:00
|
|
|
sn_io_slot_fixup(struct pci_dev *dev)
|
2005-04-17 06:20:36 +08:00
|
|
|
{
|
2005-11-30 06:36:32 +08:00
|
|
|
unsigned int count = 0;
|
2005-04-17 06:20:36 +08:00
|
|
|
int idx;
|
2006-01-17 11:54:40 +08:00
|
|
|
s64 pci_addrs[PCI_ROM_RESOURCE + 1];
|
Altix: Add initial ACPI IO support
First phase in introducing ACPI support to SN.
In this phase, when running with an ACPI capable PROM,
the DSDT will define the root busses and all SN nodes
(SGIHUB, SGITIO). An ACPI bus driver will be registered
for the node devices, with the acpi_pci_root_driver being
used for the root busses. An ACPI vendor descriptor is
now used to pass platform specific information for both
nodes and busses, eliminating the need for the current
SAL calls. Also, with ACPI support, SN fixup code is no longer
needed to initiate the PCI bus scans, as the acpi_pci_root_driver
does that.
However, to maintain backward compatibility with non-ACPI capable
PROMs, none of the current 'fixup' code can been deleted, though
much restructuring has been done. For example, the bulk of the code
in io_common.c is relocated code that is now common regardless
of what PROM is running, while io_acpi_init.c and io_init.c contain
routines specific to an ACPI or non ACPI capable PROM respectively.
A new pci bus fixup platform vector has been created to provide
a hook for invoking platform specific bus fixup from pcibios_fixup_bus().
The size of io_space[] has been increased to support systems with
large IO configurations.
Signed-off-by: John Keller <jpk@sgi.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-10-05 05:49:25 +08:00
|
|
|
unsigned long addr, end, size, start;
|
2007-01-30 14:17:37 +08:00
|
|
|
struct pcidev_info *pcidev_info;
|
|
|
|
struct sn_irq_info *sn_irq_info;
|
|
|
|
int status;
|
|
|
|
|
|
|
|
pcidev_info = kzalloc(sizeof(struct pcidev_info), GFP_KERNEL);
|
|
|
|
if (!pcidev_info)
|
2008-03-05 07:15:00 +08:00
|
|
|
panic("%s: Unable to alloc memory for pcidev_info", __func__);
|
2007-01-30 14:17:37 +08:00
|
|
|
|
|
|
|
sn_irq_info = kzalloc(sizeof(struct sn_irq_info), GFP_KERNEL);
|
|
|
|
if (!sn_irq_info)
|
2008-03-05 07:15:00 +08:00
|
|
|
panic("%s: Unable to alloc memory for sn_irq_info", __func__);
|
2007-01-30 14:17:37 +08:00
|
|
|
|
|
|
|
/* Call to retrieve pci device information needed by kernel. */
|
|
|
|
status = sal_get_pcidev_info((u64) pci_domain_nr(dev),
|
|
|
|
(u64) dev->bus->number,
|
|
|
|
dev->devfn,
|
|
|
|
(u64) __pa(pcidev_info),
|
|
|
|
(u64) __pa(sn_irq_info));
|
|
|
|
|
2009-03-10 13:10:30 +08:00
|
|
|
BUG_ON(status); /* Cannot get platform pci device information */
|
2007-01-30 14:17:37 +08:00
|
|
|
|
2005-11-30 06:36:32 +08:00
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
/* Copy over PIO Mapped Addresses */
|
|
|
|
for (idx = 0; idx <= PCI_ROM_RESOURCE; idx++) {
|
|
|
|
|
2005-11-30 06:36:32 +08:00
|
|
|
if (!pcidev_info->pdi_pio_mapped_addr[idx]) {
|
|
|
|
pci_addrs[idx] = -1;
|
2005-04-17 06:20:36 +08:00
|
|
|
continue;
|
2005-11-30 06:36:32 +08:00
|
|
|
}
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
start = dev->resource[idx].start;
|
|
|
|
end = dev->resource[idx].end;
|
|
|
|
size = end - start;
|
2005-11-30 06:36:32 +08:00
|
|
|
if (size == 0) {
|
|
|
|
pci_addrs[idx] = -1;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
pci_addrs[idx] = start;
|
|
|
|
count++;
|
|
|
|
addr = pcidev_info->pdi_pio_mapped_addr[idx];
|
2005-04-17 06:20:36 +08:00
|
|
|
addr = ((addr << 4) >> 4) | __IA64_UNCACHED_OFFSET;
|
|
|
|
dev->resource[idx].start = addr;
|
|
|
|
dev->resource[idx].end = addr + size;
|
2007-03-18 17:26:08 +08:00
|
|
|
|
|
|
|
/*
|
|
|
|
* if it's already in the device structure, remove it before
|
|
|
|
* inserting
|
|
|
|
*/
|
|
|
|
if (dev->resource[idx].parent && dev->resource[idx].parent->child)
|
|
|
|
release_resource(&dev->resource[idx]);
|
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
if (dev->resource[idx].flags & IORESOURCE_IO)
|
2007-03-18 17:26:08 +08:00
|
|
|
insert_resource(&ioport_resource, &dev->resource[idx]);
|
2005-04-17 06:20:36 +08:00
|
|
|
else
|
2007-03-18 17:26:08 +08:00
|
|
|
insert_resource(&iomem_resource, &dev->resource[idx]);
|
2007-07-10 02:42:24 +08:00
|
|
|
/*
|
|
|
|
* If ROM, set the actual ROM image size, and mark as
|
|
|
|
* shadowed in PROM.
|
|
|
|
*/
|
|
|
|
if (idx == PCI_ROM_RESOURCE) {
|
|
|
|
size_t image_size;
|
|
|
|
void __iomem *rom;
|
|
|
|
|
|
|
|
rom = ioremap(pci_resource_start(dev, PCI_ROM_RESOURCE),
|
|
|
|
size + 1);
|
2009-01-30 03:12:47 +08:00
|
|
|
image_size = pci_get_rom_size(dev, rom, size + 1);
|
2007-07-10 02:42:24 +08:00
|
|
|
dev->resource[PCI_ROM_RESOURCE].end =
|
|
|
|
dev->resource[PCI_ROM_RESOURCE].start +
|
|
|
|
image_size - 1;
|
|
|
|
dev->resource[PCI_ROM_RESOURCE].flags |=
|
|
|
|
IORESOURCE_ROM_BIOS_COPY;
|
|
|
|
}
|
2005-04-17 06:20:36 +08:00
|
|
|
}
|
2005-11-30 06:36:32 +08:00
|
|
|
/* Create a pci_window in the pci_controller struct for
|
|
|
|
* each device resource.
|
|
|
|
*/
|
|
|
|
if (count > 0)
|
|
|
|
sn_pci_window_fixup(dev, count, pci_addrs);
|
2007-01-30 14:17:37 +08:00
|
|
|
|
|
|
|
sn_pci_fixup_slot(dev, pcidev_info, sn_irq_info);
|
2005-04-17 06:20:36 +08:00
|
|
|
}
|
|
|
|
|
2007-01-30 14:17:37 +08:00
|
|
|
EXPORT_SYMBOL(sn_io_slot_fixup);
|
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
/*
|
|
|
|
* sn_pci_controller_fixup() - This routine sets up a bus's resources
|
Altix: Add initial ACPI IO support
First phase in introducing ACPI support to SN.
In this phase, when running with an ACPI capable PROM,
the DSDT will define the root busses and all SN nodes
(SGIHUB, SGITIO). An ACPI bus driver will be registered
for the node devices, with the acpi_pci_root_driver being
used for the root busses. An ACPI vendor descriptor is
now used to pass platform specific information for both
nodes and busses, eliminating the need for the current
SAL calls. Also, with ACPI support, SN fixup code is no longer
needed to initiate the PCI bus scans, as the acpi_pci_root_driver
does that.
However, to maintain backward compatibility with non-ACPI capable
PROMs, none of the current 'fixup' code can been deleted, though
much restructuring has been done. For example, the bulk of the code
in io_common.c is relocated code that is now common regardless
of what PROM is running, while io_acpi_init.c and io_init.c contain
routines specific to an ACPI or non ACPI capable PROM respectively.
A new pci bus fixup platform vector has been created to provide
a hook for invoking platform specific bus fixup from pcibios_fixup_bus().
The size of io_space[] has been increased to support systems with
large IO configurations.
Signed-off-by: John Keller <jpk@sgi.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-10-05 05:49:25 +08:00
|
|
|
* consistent with the Linux PCI abstraction layer.
|
2005-04-17 06:20:36 +08:00
|
|
|
*/
|
2008-11-23 01:38:24 +08:00
|
|
|
static void __init
|
Altix: Add initial ACPI IO support
First phase in introducing ACPI support to SN.
In this phase, when running with an ACPI capable PROM,
the DSDT will define the root busses and all SN nodes
(SGIHUB, SGITIO). An ACPI bus driver will be registered
for the node devices, with the acpi_pci_root_driver being
used for the root busses. An ACPI vendor descriptor is
now used to pass platform specific information for both
nodes and busses, eliminating the need for the current
SAL calls. Also, with ACPI support, SN fixup code is no longer
needed to initiate the PCI bus scans, as the acpi_pci_root_driver
does that.
However, to maintain backward compatibility with non-ACPI capable
PROMs, none of the current 'fixup' code can been deleted, though
much restructuring has been done. For example, the bulk of the code
in io_common.c is relocated code that is now common regardless
of what PROM is running, while io_acpi_init.c and io_init.c contain
routines specific to an ACPI or non ACPI capable PROM respectively.
A new pci bus fixup platform vector has been created to provide
a hook for invoking platform specific bus fixup from pcibios_fixup_bus().
The size of io_space[] has been increased to support systems with
large IO configurations.
Signed-off-by: John Keller <jpk@sgi.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-10-05 05:49:25 +08:00
|
|
|
sn_pci_controller_fixup(int segment, int busnum, struct pci_bus *bus)
|
2005-04-17 06:20:36 +08:00
|
|
|
{
|
Altix: Add initial ACPI IO support
First phase in introducing ACPI support to SN.
In this phase, when running with an ACPI capable PROM,
the DSDT will define the root busses and all SN nodes
(SGIHUB, SGITIO). An ACPI bus driver will be registered
for the node devices, with the acpi_pci_root_driver being
used for the root busses. An ACPI vendor descriptor is
now used to pass platform specific information for both
nodes and busses, eliminating the need for the current
SAL calls. Also, with ACPI support, SN fixup code is no longer
needed to initiate the PCI bus scans, as the acpi_pci_root_driver
does that.
However, to maintain backward compatibility with non-ACPI capable
PROMs, none of the current 'fixup' code can been deleted, though
much restructuring has been done. For example, the bulk of the code
in io_common.c is relocated code that is now common regardless
of what PROM is running, while io_acpi_init.c and io_init.c contain
routines specific to an ACPI or non ACPI capable PROM respectively.
A new pci bus fixup platform vector has been created to provide
a hook for invoking platform specific bus fixup from pcibios_fixup_bus().
The size of io_space[] has been increased to support systems with
large IO configurations.
Signed-off-by: John Keller <jpk@sgi.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-10-05 05:49:25 +08:00
|
|
|
s64 status = 0;
|
2005-04-17 06:20:36 +08:00
|
|
|
struct pci_controller *controller;
|
|
|
|
struct pcibus_bussoft *prom_bussoft_ptr;
|
Altix: Add initial ACPI IO support
First phase in introducing ACPI support to SN.
In this phase, when running with an ACPI capable PROM,
the DSDT will define the root busses and all SN nodes
(SGIHUB, SGITIO). An ACPI bus driver will be registered
for the node devices, with the acpi_pci_root_driver being
used for the root busses. An ACPI vendor descriptor is
now used to pass platform specific information for both
nodes and busses, eliminating the need for the current
SAL calls. Also, with ACPI support, SN fixup code is no longer
needed to initiate the PCI bus scans, as the acpi_pci_root_driver
does that.
However, to maintain backward compatibility with non-ACPI capable
PROMs, none of the current 'fixup' code can been deleted, though
much restructuring has been done. For example, the bulk of the code
in io_common.c is relocated code that is now common regardless
of what PROM is running, while io_acpi_init.c and io_init.c contain
routines specific to an ACPI or non ACPI capable PROM respectively.
A new pci bus fixup platform vector has been created to provide
a hook for invoking platform specific bus fixup from pcibios_fixup_bus().
The size of io_space[] has been increased to support systems with
large IO configurations.
Signed-off-by: John Keller <jpk@sgi.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-10-05 05:49:25 +08:00
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2005-07-07 06:29:53 +08:00
|
|
|
status = sal_get_pcibus_info((u64) segment, (u64) busnum,
|
|
|
|
(u64) ia64_tpa(&prom_bussoft_ptr));
|
|
|
|
if (status > 0)
|
|
|
|
return; /*bus # does not exist */
|
2005-04-17 06:20:36 +08:00
|
|
|
prom_bussoft_ptr = __va(prom_bussoft_ptr);
|
|
|
|
|
Altix: Add initial ACPI IO support
First phase in introducing ACPI support to SN.
In this phase, when running with an ACPI capable PROM,
the DSDT will define the root busses and all SN nodes
(SGIHUB, SGITIO). An ACPI bus driver will be registered
for the node devices, with the acpi_pci_root_driver being
used for the root busses. An ACPI vendor descriptor is
now used to pass platform specific information for both
nodes and busses, eliminating the need for the current
SAL calls. Also, with ACPI support, SN fixup code is no longer
needed to initiate the PCI bus scans, as the acpi_pci_root_driver
does that.
However, to maintain backward compatibility with non-ACPI capable
PROMs, none of the current 'fixup' code can been deleted, though
much restructuring has been done. For example, the bulk of the code
in io_common.c is relocated code that is now common regardless
of what PROM is running, while io_acpi_init.c and io_init.c contain
routines specific to an ACPI or non ACPI capable PROM respectively.
A new pci bus fixup platform vector has been created to provide
a hook for invoking platform specific bus fixup from pcibios_fixup_bus().
The size of io_space[] has been increased to support systems with
large IO configurations.
Signed-off-by: John Keller <jpk@sgi.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-10-05 05:49:25 +08:00
|
|
|
controller = kzalloc(sizeof(*controller), GFP_KERNEL);
|
2009-03-10 13:10:30 +08:00
|
|
|
BUG_ON(!controller);
|
2005-08-04 04:35:00 +08:00
|
|
|
controller->segment = segment;
|
2005-07-07 06:29:53 +08:00
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
/*
|
Altix: Add initial ACPI IO support
First phase in introducing ACPI support to SN.
In this phase, when running with an ACPI capable PROM,
the DSDT will define the root busses and all SN nodes
(SGIHUB, SGITIO). An ACPI bus driver will be registered
for the node devices, with the acpi_pci_root_driver being
used for the root busses. An ACPI vendor descriptor is
now used to pass platform specific information for both
nodes and busses, eliminating the need for the current
SAL calls. Also, with ACPI support, SN fixup code is no longer
needed to initiate the PCI bus scans, as the acpi_pci_root_driver
does that.
However, to maintain backward compatibility with non-ACPI capable
PROMs, none of the current 'fixup' code can been deleted, though
much restructuring has been done. For example, the bulk of the code
in io_common.c is relocated code that is now common regardless
of what PROM is running, while io_acpi_init.c and io_init.c contain
routines specific to an ACPI or non ACPI capable PROM respectively.
A new pci bus fixup platform vector has been created to provide
a hook for invoking platform specific bus fixup from pcibios_fixup_bus().
The size of io_space[] has been increased to support systems with
large IO configurations.
Signed-off-by: John Keller <jpk@sgi.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-10-05 05:49:25 +08:00
|
|
|
* Temporarily save the prom_bussoft_ptr for use by sn_bus_fixup().
|
|
|
|
* (platform_data will be overwritten later in sn_common_bus_fixup())
|
2005-04-17 06:20:36 +08:00
|
|
|
*/
|
Altix: Add initial ACPI IO support
First phase in introducing ACPI support to SN.
In this phase, when running with an ACPI capable PROM,
the DSDT will define the root busses and all SN nodes
(SGIHUB, SGITIO). An ACPI bus driver will be registered
for the node devices, with the acpi_pci_root_driver being
used for the root busses. An ACPI vendor descriptor is
now used to pass platform specific information for both
nodes and busses, eliminating the need for the current
SAL calls. Also, with ACPI support, SN fixup code is no longer
needed to initiate the PCI bus scans, as the acpi_pci_root_driver
does that.
However, to maintain backward compatibility with non-ACPI capable
PROMs, none of the current 'fixup' code can been deleted, though
much restructuring has been done. For example, the bulk of the code
in io_common.c is relocated code that is now common regardless
of what PROM is running, while io_acpi_init.c and io_init.c contain
routines specific to an ACPI or non ACPI capable PROM respectively.
A new pci bus fixup platform vector has been created to provide
a hook for invoking platform specific bus fixup from pcibios_fixup_bus().
The size of io_space[] has been increased to support systems with
large IO configurations.
Signed-off-by: John Keller <jpk@sgi.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-10-05 05:49:25 +08:00
|
|
|
controller->platform_data = prom_bussoft_ptr;
|
2005-04-17 06:20:36 +08:00
|
|
|
|
Altix: Add initial ACPI IO support
First phase in introducing ACPI support to SN.
In this phase, when running with an ACPI capable PROM,
the DSDT will define the root busses and all SN nodes
(SGIHUB, SGITIO). An ACPI bus driver will be registered
for the node devices, with the acpi_pci_root_driver being
used for the root busses. An ACPI vendor descriptor is
now used to pass platform specific information for both
nodes and busses, eliminating the need for the current
SAL calls. Also, with ACPI support, SN fixup code is no longer
needed to initiate the PCI bus scans, as the acpi_pci_root_driver
does that.
However, to maintain backward compatibility with non-ACPI capable
PROMs, none of the current 'fixup' code can been deleted, though
much restructuring has been done. For example, the bulk of the code
in io_common.c is relocated code that is now common regardless
of what PROM is running, while io_acpi_init.c and io_init.c contain
routines specific to an ACPI or non ACPI capable PROM respectively.
A new pci bus fixup platform vector has been created to provide
a hook for invoking platform specific bus fixup from pcibios_fixup_bus().
The size of io_space[] has been increased to support systems with
large IO configurations.
Signed-off-by: John Keller <jpk@sgi.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-10-05 05:49:25 +08:00
|
|
|
bus = pci_scan_bus(busnum, &pci_root_ops, controller);
|
|
|
|
if (bus == NULL)
|
|
|
|
goto error_return; /* error, or bus already scanned */
|
2005-04-26 02:26:03 +08:00
|
|
|
|
2005-08-03 01:08:00 +08:00
|
|
|
bus->sysdata = controller;
|
2005-07-07 06:29:53 +08:00
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
error_return:
|
|
|
|
|
Altix: Add initial ACPI IO support
First phase in introducing ACPI support to SN.
In this phase, when running with an ACPI capable PROM,
the DSDT will define the root busses and all SN nodes
(SGIHUB, SGITIO). An ACPI bus driver will be registered
for the node devices, with the acpi_pci_root_driver being
used for the root busses. An ACPI vendor descriptor is
now used to pass platform specific information for both
nodes and busses, eliminating the need for the current
SAL calls. Also, with ACPI support, SN fixup code is no longer
needed to initiate the PCI bus scans, as the acpi_pci_root_driver
does that.
However, to maintain backward compatibility with non-ACPI capable
PROMs, none of the current 'fixup' code can been deleted, though
much restructuring has been done. For example, the bulk of the code
in io_common.c is relocated code that is now common regardless
of what PROM is running, while io_acpi_init.c and io_init.c contain
routines specific to an ACPI or non ACPI capable PROM respectively.
A new pci bus fixup platform vector has been created to provide
a hook for invoking platform specific bus fixup from pcibios_fixup_bus().
The size of io_space[] has been increased to support systems with
large IO configurations.
Signed-off-by: John Keller <jpk@sgi.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-10-05 05:49:25 +08:00
|
|
|
kfree(controller);
|
2005-07-07 06:29:53 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
Altix: Add initial ACPI IO support
First phase in introducing ACPI support to SN.
In this phase, when running with an ACPI capable PROM,
the DSDT will define the root busses and all SN nodes
(SGIHUB, SGITIO). An ACPI bus driver will be registered
for the node devices, with the acpi_pci_root_driver being
used for the root busses. An ACPI vendor descriptor is
now used to pass platform specific information for both
nodes and busses, eliminating the need for the current
SAL calls. Also, with ACPI support, SN fixup code is no longer
needed to initiate the PCI bus scans, as the acpi_pci_root_driver
does that.
However, to maintain backward compatibility with non-ACPI capable
PROMs, none of the current 'fixup' code can been deleted, though
much restructuring has been done. For example, the bulk of the code
in io_common.c is relocated code that is now common regardless
of what PROM is running, while io_acpi_init.c and io_init.c contain
routines specific to an ACPI or non ACPI capable PROM respectively.
A new pci bus fixup platform vector has been created to provide
a hook for invoking platform specific bus fixup from pcibios_fixup_bus().
The size of io_space[] has been increased to support systems with
large IO configurations.
Signed-off-by: John Keller <jpk@sgi.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-10-05 05:49:25 +08:00
|
|
|
/*
|
|
|
|
* sn_bus_fixup
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
sn_bus_fixup(struct pci_bus *bus)
|
2005-07-07 06:29:53 +08:00
|
|
|
{
|
Altix: Add initial ACPI IO support
First phase in introducing ACPI support to SN.
In this phase, when running with an ACPI capable PROM,
the DSDT will define the root busses and all SN nodes
(SGIHUB, SGITIO). An ACPI bus driver will be registered
for the node devices, with the acpi_pci_root_driver being
used for the root busses. An ACPI vendor descriptor is
now used to pass platform specific information for both
nodes and busses, eliminating the need for the current
SAL calls. Also, with ACPI support, SN fixup code is no longer
needed to initiate the PCI bus scans, as the acpi_pci_root_driver
does that.
However, to maintain backward compatibility with non-ACPI capable
PROMs, none of the current 'fixup' code can been deleted, though
much restructuring has been done. For example, the bulk of the code
in io_common.c is relocated code that is now common regardless
of what PROM is running, while io_acpi_init.c and io_init.c contain
routines specific to an ACPI or non ACPI capable PROM respectively.
A new pci bus fixup platform vector has been created to provide
a hook for invoking platform specific bus fixup from pcibios_fixup_bus().
The size of io_space[] has been increased to support systems with
large IO configurations.
Signed-off-by: John Keller <jpk@sgi.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-10-05 05:49:25 +08:00
|
|
|
struct pci_dev *pci_dev = NULL;
|
|
|
|
struct pcibus_bussoft *prom_bussoft_ptr;
|
|
|
|
|
|
|
|
if (!bus->parent) { /* If root bus */
|
|
|
|
prom_bussoft_ptr = PCI_CONTROLLER(bus)->platform_data;
|
|
|
|
if (prom_bussoft_ptr == NULL) {
|
|
|
|
printk(KERN_ERR
|
|
|
|
"sn_bus_fixup: 0x%04x:0x%02x Unable to "
|
|
|
|
"obtain prom_bussoft_ptr\n",
|
|
|
|
pci_domain_nr(bus), bus->number);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
sn_common_bus_fixup(bus, prom_bussoft_ptr);
|
|
|
|
sn_legacy_pci_window_fixup(PCI_CONTROLLER(bus),
|
|
|
|
prom_bussoft_ptr->bs_legacy_io,
|
|
|
|
prom_bussoft_ptr->bs_legacy_mem);
|
|
|
|
}
|
|
|
|
list_for_each_entry(pci_dev, &bus->devices, bus_list) {
|
2007-01-30 14:17:37 +08:00
|
|
|
sn_io_slot_fixup(pci_dev);
|
Altix: Add initial ACPI IO support
First phase in introducing ACPI support to SN.
In this phase, when running with an ACPI capable PROM,
the DSDT will define the root busses and all SN nodes
(SGIHUB, SGITIO). An ACPI bus driver will be registered
for the node devices, with the acpi_pci_root_driver being
used for the root busses. An ACPI vendor descriptor is
now used to pass platform specific information for both
nodes and busses, eliminating the need for the current
SAL calls. Also, with ACPI support, SN fixup code is no longer
needed to initiate the PCI bus scans, as the acpi_pci_root_driver
does that.
However, to maintain backward compatibility with non-ACPI capable
PROMs, none of the current 'fixup' code can been deleted, though
much restructuring has been done. For example, the bulk of the code
in io_common.c is relocated code that is now common regardless
of what PROM is running, while io_acpi_init.c and io_init.c contain
routines specific to an ACPI or non ACPI capable PROM respectively.
A new pci bus fixup platform vector has been created to provide
a hook for invoking platform specific bus fixup from pcibios_fixup_bus().
The size of io_space[] has been increased to support systems with
large IO configurations.
Signed-off-by: John Keller <jpk@sgi.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-10-05 05:49:25 +08:00
|
|
|
}
|
2005-07-07 06:29:53 +08:00
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
Altix: Add initial ACPI IO support
First phase in introducing ACPI support to SN.
In this phase, when running with an ACPI capable PROM,
the DSDT will define the root busses and all SN nodes
(SGIHUB, SGITIO). An ACPI bus driver will be registered
for the node devices, with the acpi_pci_root_driver being
used for the root busses. An ACPI vendor descriptor is
now used to pass platform specific information for both
nodes and busses, eliminating the need for the current
SAL calls. Also, with ACPI support, SN fixup code is no longer
needed to initiate the PCI bus scans, as the acpi_pci_root_driver
does that.
However, to maintain backward compatibility with non-ACPI capable
PROMs, none of the current 'fixup' code can been deleted, though
much restructuring has been done. For example, the bulk of the code
in io_common.c is relocated code that is now common regardless
of what PROM is running, while io_acpi_init.c and io_init.c contain
routines specific to an ACPI or non ACPI capable PROM respectively.
A new pci bus fixup platform vector has been created to provide
a hook for invoking platform specific bus fixup from pcibios_fixup_bus().
The size of io_space[] has been increased to support systems with
large IO configurations.
Signed-off-by: John Keller <jpk@sgi.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-10-05 05:49:25 +08:00
|
|
|
* sn_io_init - PROM does not have ACPI support to define nodes or root buses,
|
|
|
|
* so we need to do things the hard way, including initiating the
|
|
|
|
* bus scanning ourselves.
|
2005-04-17 06:20:36 +08:00
|
|
|
*/
|
|
|
|
|
Altix: Add initial ACPI IO support
First phase in introducing ACPI support to SN.
In this phase, when running with an ACPI capable PROM,
the DSDT will define the root busses and all SN nodes
(SGIHUB, SGITIO). An ACPI bus driver will be registered
for the node devices, with the acpi_pci_root_driver being
used for the root busses. An ACPI vendor descriptor is
now used to pass platform specific information for both
nodes and busses, eliminating the need for the current
SAL calls. Also, with ACPI support, SN fixup code is no longer
needed to initiate the PCI bus scans, as the acpi_pci_root_driver
does that.
However, to maintain backward compatibility with non-ACPI capable
PROMs, none of the current 'fixup' code can been deleted, though
much restructuring has been done. For example, the bulk of the code
in io_common.c is relocated code that is now common regardless
of what PROM is running, while io_acpi_init.c and io_init.c contain
routines specific to an ACPI or non ACPI capable PROM respectively.
A new pci bus fixup platform vector has been created to provide
a hook for invoking platform specific bus fixup from pcibios_fixup_bus().
The size of io_space[] has been increased to support systems with
large IO configurations.
Signed-off-by: John Keller <jpk@sgi.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-10-05 05:49:25 +08:00
|
|
|
void __init sn_io_init(void)
|
2005-04-17 06:20:36 +08:00
|
|
|
{
|
2006-02-13 18:29:57 +08:00
|
|
|
int i, j;
|
2005-04-26 02:26:03 +08:00
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
sn_fixup_ionodes();
|
|
|
|
|
2005-07-07 06:29:53 +08:00
|
|
|
/* busses are not known yet ... */
|
2005-08-04 04:35:00 +08:00
|
|
|
for (i = 0; i <= max_segment_number; i++)
|
|
|
|
for (j = 0; j <= max_pcibus_number; j++)
|
|
|
|
sn_pci_controller_fixup(i, j, NULL);
|
2005-04-17 06:20:36 +08:00
|
|
|
}
|