~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/alpha/kernel/pc873xx.c

Version: ~ [ linux-6.11-rc3 ] ~ [ linux-6.10.4 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.45 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.104 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.164 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.223 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.281 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.319 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /arch/alpha/kernel/pc873xx.c (Architecture m68k) and /arch/alpha/kernel/pc873xx.c (Architecture alpha)


  1 // SPDX-License-Identifier: GPL-2.0                 1 // SPDX-License-Identifier: GPL-2.0
  2 #include <linux/ioport.h>                           2 #include <linux/ioport.h>
  3 #include <asm/io.h>                                 3 #include <asm/io.h>
  4                                                     4 
  5 #include "pc873xx.h"                                5 #include "pc873xx.h"
  6                                                     6 
  7 static unsigned pc873xx_probelist[] = {0x398,       7 static unsigned pc873xx_probelist[] = {0x398, 0x26e, 0};
  8                                                     8 
  9 static char *pc873xx_names[] = {                    9 static char *pc873xx_names[] = {
 10         "PC87303", "PC87306", "PC87312", "PC87     10         "PC87303", "PC87306", "PC87312", "PC87332", "PC87334"
 11 };                                                 11 };
 12                                                    12 
 13 static unsigned int base, model;                   13 static unsigned int base, model;
 14                                                    14 
 15                                                    15 
 16 unsigned int __init pc873xx_get_base(void)         16 unsigned int __init pc873xx_get_base(void)
 17 {                                                  17 {
 18         return base;                               18         return base;
 19 }                                                  19 }
 20                                                    20 
 21 char *__init pc873xx_get_model(void)               21 char *__init pc873xx_get_model(void)
 22 {                                                  22 {
 23         return pc873xx_names[model];               23         return pc873xx_names[model];
 24 }                                                  24 }
 25                                                    25 
 26 static unsigned char __init pc873xx_read(unsig     26 static unsigned char __init pc873xx_read(unsigned int base, int reg)
 27 {                                                  27 {
 28         outb(reg, base);                           28         outb(reg, base);
 29         return inb(base + 1);                      29         return inb(base + 1);
 30 }                                                  30 }
 31                                                    31 
 32 static void __init pc873xx_write(unsigned int      32 static void __init pc873xx_write(unsigned int base, int reg, unsigned char data)
 33 {                                                  33 {
 34         unsigned long flags;                       34         unsigned long flags;
 35                                                    35 
 36         local_irq_save(flags);                     36         local_irq_save(flags);
 37         outb(reg, base);                           37         outb(reg, base);
 38         outb(data, base + 1);                      38         outb(data, base + 1);
 39         outb(data, base + 1);           /* Mus     39         outb(data, base + 1);           /* Must be written twice */
 40         local_irq_restore(flags);                  40         local_irq_restore(flags);
 41 }                                                  41 }
 42                                                    42 
 43 int __init pc873xx_probe(void)                     43 int __init pc873xx_probe(void)
 44 {                                                  44 {
 45         int val, index = 0;                        45         int val, index = 0;
 46                                                    46 
 47         while ((base = pc873xx_probelist[index     47         while ((base = pc873xx_probelist[index++])) {
 48                                                    48 
 49                 if (request_region(base, 2, "S     49                 if (request_region(base, 2, "Super IO PC873xx") == NULL)
 50                         continue;                  50                         continue;
 51                                                    51 
 52                 val = pc873xx_read(base, REG_S     52                 val = pc873xx_read(base, REG_SID);
 53                 if ((val & 0xf0) == 0x10) {        53                 if ((val & 0xf0) == 0x10) {
 54                         model = PC87332;           54                         model = PC87332;
 55                         break;                     55                         break;
 56                 } else if ((val & 0xf8) == 0x7     56                 } else if ((val & 0xf8) == 0x70) {
 57                         model = PC87306;           57                         model = PC87306;
 58                         break;                     58                         break;
 59                 } else if ((val & 0xf8) == 0x5     59                 } else if ((val & 0xf8) == 0x50) {
 60                         model = PC87334;           60                         model = PC87334;
 61                         break;                     61                         break;
 62                 } else if ((val & 0xf8) == 0x4     62                 } else if ((val & 0xf8) == 0x40) {
 63                         model = PC87303;           63                         model = PC87303;
 64                         break;                     64                         break;
 65                 }                                  65                 }
 66                                                    66 
 67                 release_region(base, 2);           67                 release_region(base, 2);
 68         }                                          68         }
 69                                                    69 
 70         return (base == 0) ? -1 : 1;               70         return (base == 0) ? -1 : 1;
 71 }                                                  71 }
 72                                                    72 
 73 void __init pc873xx_enable_epp19(void)             73 void __init pc873xx_enable_epp19(void)
 74 {                                                  74 {
 75         unsigned char data;                        75         unsigned char data;
 76                                                    76 
 77         printk(KERN_INFO "PC873xx enabling EPP     77         printk(KERN_INFO "PC873xx enabling EPP v1.9\n");
 78         data = pc873xx_read(base, REG_PCR);        78         data = pc873xx_read(base, REG_PCR);
 79         pc873xx_write(base, REG_PCR, (data & 0     79         pc873xx_write(base, REG_PCR, (data & 0xFC) | 0x02);
 80 }                                                  80 }
 81                                                    81 
 82 void __init pc873xx_enable_ide(void)               82 void __init pc873xx_enable_ide(void)
 83 {                                                  83 {
 84         unsigned char data;                        84         unsigned char data;
 85                                                    85 
 86         printk(KERN_INFO "PC873xx enabling IDE     86         printk(KERN_INFO "PC873xx enabling IDE interrupt\n");
 87         data = pc873xx_read(base, REG_FER);        87         data = pc873xx_read(base, REG_FER);
 88         pc873xx_write(base, REG_FER, data | 0x     88         pc873xx_write(base, REG_FER, data | 0x40);
 89 }                                                  89 }
 90                                                    90 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php