2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
6 * Copyright (C) 1992 - 1997, 2000-2003 Silicon Graphics, Inc. All rights reserved.
9 #include <linux/types.h>
10 #include <linux/config.h>
11 #include <linux/slab.h>
12 #include <asm/sn/sgi.h>
13 #include <asm/sn/io.h>
14 #include <asm/sn/sn_cpuid.h>
15 #include <asm/sn/klconfig.h>
16 #include <asm/sn/sn_private.h>
17 #include <asm/sn/pda.h>
18 #include <linux/smp.h>
20 extern int init_hcl(void);
25 * This code is executed once for each Hub chip.
28 per_hub_init(cnodeid_t cnode)
34 ii_ilcsr_u_t ii_ilcsr;
36 nasid = COMPACT_TO_NASID_NODEID(cnode);
38 ASSERT(nasid != INVALID_NASID);
39 ASSERT(NASID_TO_COMPACT_NODEID(nasid) == cnode);
41 npdap = NODEPDA(cnode);
43 /* Disable the request and reply errors. */
44 REMOTE_HUB_S(nasid, IIO_IWEIM, 0xC000);
47 * Set the total number of CRBs that can be used.
49 ii_icmr.ii_icmr_regval= 0x0;
50 ii_icmr.ii_icmr_fld_s.i_c_cnt = 0xf;
51 if (enable_shub_wars_1_1() ) {
52 // Set bit one of ICMR to prevent II from sending interrupt for II bug.
53 ii_icmr.ii_icmr_regval |= 0x1;
55 REMOTE_HUB_S(nasid, IIO_ICMR, ii_icmr.ii_icmr_regval);
58 * Set the number of CRBs that both of the BTEs combined
61 ii_ibcr.ii_ibcr_regval= 0x0;
62 ii_ilcsr.ii_ilcsr_regval = REMOTE_HUB_L(nasid, IIO_LLP_CSR);
63 if (ii_ilcsr.ii_ilcsr_fld_s.i_llp_stat & LNK_STAT_WORKING) {
64 ii_ibcr.ii_ibcr_fld_s.i_count = 0x8;
67 * if the LLP is down, there is no attached I/O, so
68 * give BTE all the CRBs.
70 ii_ibcr.ii_ibcr_fld_s.i_count = 0x14;
72 REMOTE_HUB_S(nasid, IIO_IBCR, ii_ibcr.ii_ibcr_regval);
75 * Set CRB timeout to be 10ms.
77 REMOTE_HUB_S(nasid, IIO_ICTP, 0xffffff );
78 REMOTE_HUB_S(nasid, IIO_ICTO, 0xff);
80 /* Initialize error interrupts for this hub. */
81 hub_error_init(cnode);
85 * This routine is responsible for the setup of all the IRIX hwgraph style
86 * stuff that's been pulled into linux. It's called by sn_pci_find_bios which
87 * is called just before the generic Linux PCI layer does its probing (by
88 * platform_pci_fixup aka sn_pci_fixup).
90 * It is very IMPORTANT that this call is only made by the Master CPU!
95 sgi_master_io_infr_init(void)
97 extern void irix_io_init(void);
99 init_hcl(); /* Sets up the hwgraph compatibility layer with devfs */
100 irix_io_init(); /* Do IRIX Compatibility IO Init */
104 extern void kdba_io_init(void);