summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2004-01-18 18:49:15 -0800
committerLinus Torvalds <torvalds@home.osdl.org>2004-01-18 18:49:15 -0800
commitfb7c5f7b57560e7746e23f3a809cf57d0a226521 (patch)
treeea84f47986400298d35b10ab75c8c88e6375038f
parentb0c782a616bca09dc7b8948c55bade4d2677d0c1 (diff)
[PATCH] sn: Merged 2 files into another (sgi_io_sim and irix_io_init into sgi_io_init)
From: Pat Gefre <pfg@sgi.com> Merged 2 files into another (sgi_io_sim and irix_io_init into sgi_io_init)
-rw-r--r--arch/ia64/sn/io/Makefile2
-rw-r--r--arch/ia64/sn/io/platform_init/Makefile2
-rw-r--r--arch/ia64/sn/io/platform_init/irix_io_init.c81
-rw-r--r--arch/ia64/sn/io/platform_init/sgi_io_init.c131
-rw-r--r--arch/ia64/sn/io/sgi_io_sim.c56
-rw-r--r--arch/ia64/sn/io/sn2/ml_SN_init.c1
6 files changed, 116 insertions, 157 deletions
diff --git a/arch/ia64/sn/io/Makefile b/arch/ia64/sn/io/Makefile
index ccb407a8a008..868f2b1a1823 100644
--- a/arch/ia64/sn/io/Makefile
+++ b/arch/ia64/sn/io/Makefile
@@ -9,5 +9,5 @@
# Makefile for the sn io routines.
#
-obj-y += xswitch.o sgi_io_sim.o cdl.o snia_if.o \
+obj-y += xswitch.o cdl.o snia_if.o \
io.o machvec/ drivers/ platform_init/ sn2/ hwgfs/
diff --git a/arch/ia64/sn/io/platform_init/Makefile b/arch/ia64/sn/io/platform_init/Makefile
index a35f957ee118..3252088084d8 100644
--- a/arch/ia64/sn/io/platform_init/Makefile
+++ b/arch/ia64/sn/io/platform_init/Makefile
@@ -7,4 +7,4 @@
#
# Makefile for the sn2 io routines.
-obj-y += sgi_io_init.o irix_io_init.o
+obj-y += sgi_io_init.o
diff --git a/arch/ia64/sn/io/platform_init/irix_io_init.c b/arch/ia64/sn/io/platform_init/irix_io_init.c
deleted file mode 100644
index 26f5ff6b7cff..000000000000
--- a/arch/ia64/sn/io/platform_init/irix_io_init.c
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * 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.
- *
- * Copyright (C) 1992 - 1997, 2000-2003 Silicon Graphics, Inc. All rights reserved.
- */
-
-#include <linux/types.h>
-#include <linux/config.h>
-#include <linux/slab.h>
-#include <asm/sn/sgi.h>
-#include <asm/sn/io.h>
-#include <asm/sn/sn_cpuid.h>
-#include <asm/sn/klconfig.h>
-#include <asm/sn/sn_private.h>
-#include <linux/smp.h>
-#include <asm/sn/simulator.h>
-
-extern void init_all_devices(void);
-extern void klhwg_add_all_modules(vertex_hdl_t);
-extern void klhwg_add_all_nodes(vertex_hdl_t);
-
-extern int init_hcl(void);
-extern vertex_hdl_t hwgraph_root;
-extern void io_module_init(void);
-extern int pci_bus_to_hcl_cvlink(void);
-
-nasid_t master_baseio_nasid;
-nasid_t master_nasid = INVALID_NASID; /* This is the partition master nasid */
-
-/*
- * This routine is responsible for the setup of all the IRIX hwgraph style
- * stuff that's been pulled into linux. It's called by sn_pci_find_bios which
- * is called just before the generic Linux PCI layer does its probing (by
- * platform_pci_fixup aka sn_pci_fixup).
- *
- * It is very IMPORTANT that this call is only made by the Master CPU!
- *
- */
-
-void __init
-sgi_master_io_infr_init(void)
-{
- cnodeid_t cnode;
-
- if (init_hcl() < 0) { /* Sets up the hwgraph compatibility layer */
- printk("sgi_master_io_infr_init: Cannot init hcl\n");
- return;
- }
-
- /*
- * Initialize platform-dependent vertices in the hwgraph:
- * module
- * node
- * cpu
- * memory
- * slot
- * hub
- * router
- * xbow
- */
-
- io_module_init(); /* Use to be called module_init() .. */
- klhwg_add_all_modules(hwgraph_root);
- klhwg_add_all_nodes(hwgraph_root);
-
- for (cnode = 0; cnode < numnodes; cnode++) {
- extern void per_hub_init(cnodeid_t);
- per_hub_init(cnode);
- }
-
- /*
- *
- * Our IO Infrastructure drivers are in place ..
- * Initialize the whole IO Infrastructure .. xwidget/device probes.
- *
- */
- init_all_devices();
- pci_bus_to_hcl_cvlink();
-}
diff --git a/arch/ia64/sn/io/platform_init/sgi_io_init.c b/arch/ia64/sn/io/platform_init/sgi_io_init.c
index 6a8992849777..240482bd2f3d 100644
--- a/arch/ia64/sn/io/platform_init/sgi_io_init.c
+++ b/arch/ia64/sn/io/platform_init/sgi_io_init.c
@@ -17,19 +17,35 @@
#include <asm/sn/sn_private.h>
#include <asm/sn/pda.h>
+extern void init_all_devices(void);
+extern void klhwg_add_all_modules(vertex_hdl_t);
+extern void klhwg_add_all_nodes(vertex_hdl_t);
+
+extern int init_hcl(void);
+extern vertex_hdl_t hwgraph_root;
+extern void io_module_init(void);
+extern int pci_bus_to_hcl_cvlink(void);
+
+cpuid_t master_procid;
+nasid_t console_nasid = (nasid_t) - 1;
+char master_baseio_wid;
+
+nasid_t master_baseio_nasid;
+nasid_t master_nasid = INVALID_NASID; /* This is the partition master nasid */
+
/*
* per_hub_init
*
* This code is executed once for each Hub chip.
*/
-void
+static void
per_hub_init(cnodeid_t cnode)
{
- nasid_t nasid;
- nodepda_t *npdap;
- ii_icmr_u_t ii_icmr;
- ii_ibcr_u_t ii_ibcr;
- ii_ilcsr_u_t ii_ilcsr;
+ nasid_t nasid;
+ nodepda_t *npdap;
+ ii_icmr_u_t ii_icmr;
+ ii_ibcr_u_t ii_ibcr;
+ ii_ilcsr_u_t ii_ilcsr;
nasid = COMPACT_TO_NASID_NODEID(cnode);
@@ -44,11 +60,11 @@ per_hub_init(cnodeid_t cnode)
/*
* Set the total number of CRBs that can be used.
*/
- ii_icmr.ii_icmr_regval= 0x0;
+ ii_icmr.ii_icmr_regval = 0x0;
ii_icmr.ii_icmr_fld_s.i_c_cnt = 0xf;
- if (enable_shub_wars_1_1() ) {
+ if (enable_shub_wars_1_1()) {
// Set bit one of ICMR to prevent II from sending interrupt for II bug.
- ii_icmr.ii_icmr_regval |= 0x1;
+ ii_icmr.ii_icmr_regval |= 0x1;
}
REMOTE_HUB_S(nasid, IIO_ICMR, ii_icmr.ii_icmr_regval);
@@ -56,25 +72,106 @@ per_hub_init(cnodeid_t cnode)
* Set the number of CRBs that both of the BTEs combined
* can use minus 1.
*/
- ii_ibcr.ii_ibcr_regval= 0x0;
+ ii_ibcr.ii_ibcr_regval = 0x0;
ii_ilcsr.ii_ilcsr_regval = REMOTE_HUB_L(nasid, IIO_LLP_CSR);
if (ii_ilcsr.ii_ilcsr_fld_s.i_llp_stat & LNK_STAT_WORKING) {
- ii_ibcr.ii_ibcr_fld_s.i_count = 0x8;
+ ii_ibcr.ii_ibcr_fld_s.i_count = 0x8;
} else {
- /*
- * if the LLP is down, there is no attached I/O, so
- * give BTE all the CRBs.
- */
- ii_ibcr.ii_ibcr_fld_s.i_count = 0x14;
+ /*
+ * if the LLP is down, there is no attached I/O, so
+ * give BTE all the CRBs.
+ */
+ ii_ibcr.ii_ibcr_fld_s.i_count = 0x14;
}
REMOTE_HUB_S(nasid, IIO_IBCR, ii_ibcr.ii_ibcr_regval);
/*
* Set CRB timeout to be 10ms.
*/
- REMOTE_HUB_S(nasid, IIO_ICTP, 0xffffff );
+ REMOTE_HUB_S(nasid, IIO_ICTP, 0xffffff);
REMOTE_HUB_S(nasid, IIO_ICTO, 0xff);
/* Initialize error interrupts for this hub. */
hub_error_init(cnode);
}
+
+/*
+ * This routine is responsible for the setup of all the IRIX hwgraph style
+ * stuff that's been pulled into linux. It's called by sn_pci_find_bios which
+ * is called just before the generic Linux PCI layer does its probing (by
+ * platform_pci_fixup aka sn_pci_fixup).
+ *
+ * It is very IMPORTANT that this call is only made by the Master CPU!
+ *
+ */
+
+void __init
+sgi_master_io_infr_init(void)
+{
+ cnodeid_t cnode;
+
+ if (init_hcl() < 0) { /* Sets up the hwgraph compatibility layer */
+ printk("sgi_master_io_infr_init: Cannot init hcl\n");
+ return;
+ }
+
+ /*
+ * Initialize platform-dependent vertices in the hwgraph:
+ * module
+ * node
+ * cpu
+ * memory
+ * slot
+ * hub
+ * router
+ * xbow
+ */
+
+ io_module_init(); /* Use to be called module_init() .. */
+ klhwg_add_all_modules(hwgraph_root);
+ klhwg_add_all_nodes(hwgraph_root);
+
+ for (cnode = 0; cnode < numnodes; cnode++) {
+ extern void per_hub_init(cnodeid_t);
+ per_hub_init(cnode);
+ }
+
+ /*
+ *
+ * Our IO Infrastructure drivers are in place ..
+ * Initialize the whole IO Infrastructure .. xwidget/device probes.
+ *
+ */
+ init_all_devices();
+ pci_bus_to_hcl_cvlink();
+}
+
+inline int
+check_nasid_equiv(nasid_t nasida, nasid_t nasidb)
+{
+ if ((nasida == nasidb)
+ || (nasida == NODEPDA(NASID_TO_COMPACT_NODEID(nasidb))->xbow_peer))
+ return 1;
+ else
+ return 0;
+}
+
+int
+is_master_baseio_nasid_widget(nasid_t test_nasid, xwidgetnum_t test_wid)
+{
+ /*
+ * If the widget numbers are different, we're not the master.
+ */
+ if (test_wid != (xwidgetnum_t) master_baseio_wid) {
+ return 0;
+ }
+
+ /*
+ * If the NASIDs are the same or equivalent, we're the master.
+ */
+ if (check_nasid_equiv(test_nasid, master_baseio_nasid)) {
+ return 1;
+ } else {
+ return 0;
+ }
+}
diff --git a/arch/ia64/sn/io/sgi_io_sim.c b/arch/ia64/sn/io/sgi_io_sim.c
deleted file mode 100644
index 45976551be0f..000000000000
--- a/arch/ia64/sn/io/sgi_io_sim.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * 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.
- *
- * Copyright (C) 1992-1997,2000-2003 Silicon Graphics, Inc. All rights reserved.
- */
-
-#include <linux/config.h>
-#include <linux/types.h>
-#include <asm/sn/sgi.h>
-#include <asm/sn/sn_sal.h>
-#include <asm/sn/io.h>
-#include <asm/sn/sn_cpuid.h>
-#include <asm/sn/klconfig.h>
-#include <asm/sn/module.h>
-#include <asm/sn/sn_private.h>
-
-cpuid_t master_procid;
-
-/*
- * Routines provided by ml/SN/promif.c.
- */
-nasid_t console_nasid = (nasid_t)-1;
-char master_baseio_wid;
-
-int
-check_nasid_equiv(nasid_t nasida, nasid_t nasidb)
-{
- if ((nasida == nasidb) || (nasida == NODEPDA(NASID_TO_COMPACT_NODEID(nasidb))->xbow_peer))
- return 1;
- else
- return 0;
-}
-
-int
-is_master_baseio_nasid_widget(nasid_t test_nasid, xwidgetnum_t test_wid)
-{
- extern nasid_t master_baseio_nasid;
-
- /*
- * If the widget numbers are different, we're not the master.
- */
- if (test_wid != (xwidgetnum_t)master_baseio_wid) {
- return 0;
- }
-
- /*
- * If the NASIDs are the same or equivalent, we're the master.
- */
- if (check_nasid_equiv(test_nasid, master_baseio_nasid)) {
- return 1;
- } else {
- return 0;
- }
-}
diff --git a/arch/ia64/sn/io/sn2/ml_SN_init.c b/arch/ia64/sn/io/sn2/ml_SN_init.c
index fa80b05f4f58..a0c5614a9ea5 100644
--- a/arch/ia64/sn/io/sn2/ml_SN_init.c
+++ b/arch/ia64/sn/io/sn2/ml_SN_init.c
@@ -18,7 +18,6 @@
#include <asm/sn/klconfig.h>
#include <asm/sn/sn_cpuid.h>
-extern cpuid_t master_procid;
int maxcpus;
extern xwidgetnum_t hub_widget_id(nasid_t);