0001
0002
0003
0004
0005
0006
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
0028 u8 sgi_ioc_reset, sgi_ioc_write;
0029
0030 extern char *system_type;
0031
0032 void __init sgihpc_init(void)
0033 {
0034
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
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
0045
0046 sgint = (struct sgint_regs *)hpc3c0->pbus_extregs[4];
0047 system_type = "SGI Indigo2";
0048 } else {
0049
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 }