ops-sni.c (1da177e4c3f41524e886b7f1b8a0c1fc7321cac2) | ops-sni.c (4a0312fca6599299bbed944ce09278d90388a3e5) |
---|---|
1/* 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 4 * for more details. 5 * 6 * SNI specific PCI support for RM200/RM300. 7 * 8 * Copyright (C) 1997 - 2000, 2003 Ralf Baechle <ralf@linux-mips.org> --- 33 unchanged lines hidden (view full) --- 42{ 43 int res; 44 45 if ((res = set_config_address(bus->number, devfn, reg))) 46 return res; 47 48 switch (size) { 49 case 1: | 1/* 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 4 * for more details. 5 * 6 * SNI specific PCI support for RM200/RM300. 7 * 8 * Copyright (C) 1997 - 2000, 2003 Ralf Baechle <ralf@linux-mips.org> --- 33 unchanged lines hidden (view full) --- 42{ 43 int res; 44 45 if ((res = set_config_address(bus->number, devfn, reg))) 46 return res; 47 48 switch (size) { 49 case 1: |
50 *val = *(volatile u8 *) (PCIMT_CONFIG_DATA + (reg & 3)); | 50 *val = inb(PCIMT_CONFIG_DATA + (reg & 3)); |
51 break; 52 case 2: | 51 break; 52 case 2: |
53 *val = *(volatile u16 *) (PCIMT_CONFIG_DATA + (reg & 2)); | 53 *val = inw(PCIMT_CONFIG_DATA + (reg & 2)); |
54 break; 55 case 4: | 54 break; 55 case 4: |
56 *val = *(volatile u32 *) PCIMT_CONFIG_DATA; | 56 *val = inl(PCIMT_CONFIG_DATA); |
57 break; 58 } 59 60 return 0; 61} 62 63static int pcimt_write(struct pci_bus *bus, unsigned int devfn, int reg, 64 int size, u32 val) 65{ 66 int res; 67 68 if ((res = set_config_address(bus->number, devfn, reg))) 69 return res; 70 71 switch (size) { 72 case 1: | 57 break; 58 } 59 60 return 0; 61} 62 63static int pcimt_write(struct pci_bus *bus, unsigned int devfn, int reg, 64 int size, u32 val) 65{ 66 int res; 67 68 if ((res = set_config_address(bus->number, devfn, reg))) 69 return res; 70 71 switch (size) { 72 case 1: |
73 *(volatile u8 *) (PCIMT_CONFIG_DATA + (reg & 3)) = val; | 73 outb (val, PCIMT_CONFIG_DATA + (reg & 3)); |
74 break; 75 case 2: | 74 break; 75 case 2: |
76 *(volatile u16 *) (PCIMT_CONFIG_DATA + (reg & 2)) = val; | 76 outw (val, PCIMT_CONFIG_DATA + (reg & 2)); |
77 break; 78 case 4: | 77 break; 78 case 4: |
79 *(volatile u32 *) PCIMT_CONFIG_DATA = val; | 79 outl (val, PCIMT_CONFIG_DATA); |
80 break; 81 } 82 83 return 0; 84} 85 86struct pci_ops sni_pci_ops = { 87 .read = pcimt_read, 88 .write = pcimt_write, 89}; | 80 break; 81 } 82 83 return 0; 84} 85 86struct pci_ops sni_pci_ops = { 87 .read = pcimt_read, 88 .write = pcimt_write, 89}; |