Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0
0002 /*
0003  * ip22-hpc.c: Routines for generic manipulation of the HPC controllers.
0004  *
0005  * Copyright (C) 1996 David S. Miller (davem@davemloft.net)
0006  * Copyright (C) 1998 Ralf Baechle
0007  */
0008 
0009 #include <linux/export.h>
0010 #include <linux/init.h>
0011 #include <linux/types.h>
0012 
0013 #include <asm/io.h>
0014 #include <asm/sgi/hpc3.h>
0015 #include <asm/sgi/ioc.h>
0016 #include <asm/sgi/ip22.h>
0017 
0018 struct hpc3_regs *hpc3c0, *hpc3c1;
0019 
0020 EXPORT_SYMBOL(hpc3c0);
0021 EXPORT_SYMBOL(hpc3c1);
0022 
0023 struct sgioc_regs *sgioc;
0024 
0025 EXPORT_SYMBOL(sgioc);
0026 
0027 /* We need software copies of these because they are write only. */
0028 u8 sgi_ioc_reset, sgi_ioc_write;
0029 
0030 extern char *system_type;
0031 
0032 void __init sgihpc_init(void)
0033 {
0034     /* ioremap can't fail */
0035     hpc3c0 = (struct hpc3_regs *)
0036          ioremap(HPC3_CHIP0_BASE, sizeof(struct hpc3_regs));
0037     hpc3c1 = (struct hpc3_regs *)
0038          ioremap(HPC3_CHIP1_BASE, sizeof(struct hpc3_regs));
0039     /* IOC lives in PBUS PIO channel 6 */
0040     sgioc = (struct sgioc_regs *)hpc3c0->pbus_extregs[6];
0041 
0042     hpc3c0->pbus_piocfg[6][0] |= HPC3_PIOCFG_DS16;
0043     if (ip22_is_fullhouse()) {
0044         /* Full House comes with INT2 which lives in PBUS PIO
0045          * channel 4 */
0046         sgint = (struct sgint_regs *)hpc3c0->pbus_extregs[4];
0047         system_type = "SGI Indigo2";
0048     } else {
0049         /* Guiness comes with INT3 which is part of IOC */
0050         sgint = &sgioc->int3;
0051         system_type = "SGI Indy";
0052     }
0053 
0054     sgi_ioc_reset = (SGIOC_RESET_PPORT | SGIOC_RESET_KBDMOUSE |
0055              SGIOC_RESET_EISA | SGIOC_RESET_ISDN |
0056              SGIOC_RESET_LC0OFF);
0057 
0058     sgi_ioc_write = (SGIOC_WRITE_EASEL | SGIOC_WRITE_NTHRESH |
0059              SGIOC_WRITE_TPSPEED | SGIOC_WRITE_EPSEL |
0060              SGIOC_WRITE_U0AMODE | SGIOC_WRITE_U1AMODE);
0061 
0062     sgioc->reset = sgi_ioc_reset;
0063     sgioc->write = sgi_ioc_write;
0064 }