Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'defxx-next'

Maciej W. Rozycki says:

====================
defxx: DEFEA fixes and updates

I have finally got my hands on an EISA variation of the board (DEC
FDDIcontroller/EISA aka DEFEA) and was able to do some testing. Here are
initial updates to the driver that address problems I encountered so far.
More to come later on as I get back to the system that I have in a remote
location -- I need to double-check MMIO support and see what might have
been causing spurious interrupts I saw with the 8259A PIC the board's
interrupt line has been routed to.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>

+44 -32
+38 -26
drivers/net/fddi/defxx.c
··· 466 466 *bar_len = (bar | PI_MEM_ADD_MASK_M) + 1; 467 467 } else { 468 468 *bar_start = base_addr; 469 - *bar_len = PI_ESIC_K_CSR_IO_LEN; 469 + *bar_len = PI_ESIC_K_CSR_IO_LEN + 470 + PI_ESIC_K_BURST_HOLDOFF_LEN; 470 471 } 471 472 } 472 473 if (dfx_bus_tc) { ··· 684 683 if (dfx_bus_eisa) { 685 684 unsigned long base_addr = to_eisa_device(bdev)->base_addr; 686 685 686 + /* Disable the board before fiddling with the decoders. */ 687 + outb(0, base_addr + PI_ESIC_K_SLOT_CNTRL); 688 + 687 689 /* Get the interrupt level from the ESIC chip. */ 688 690 val = inb(base_addr + PI_ESIC_K_IO_CONFIG_STAT_0); 689 691 val &= PI_CONFIG_STAT_0_M_IRQ; ··· 713 709 /* 714 710 * Enable memory decoding (MEMCS0) and/or port decoding 715 711 * (IOCS1/IOCS0) as appropriate in Function Control 716 - * Register. One of the port chip selects seems to be 717 - * used for the Burst Holdoff register, but this bit of 718 - * documentation is missing and as yet it has not been 719 - * determined which of the two. This is also the reason 720 - * the size of the decoded port range is twice as large 721 - * as one required by the PDQ. 712 + * Register. IOCS0 is used for PDQ registers, taking 16 713 + * 32-bit words, while IOCS1 is used for the Burst Holdoff 714 + * register, taking a single 32-bit word only. We use the 715 + * slot-specific I/O range as per the ESIC spec, that is 716 + * set bits 15:12 in the mask registers to mask them out. 722 717 */ 723 718 724 719 /* Set the decode range of the board. */ 725 - val = ((bp->base.port >> 12) << PI_IO_CMP_V_SLOT); 726 - outb(base_addr + PI_ESIC_K_IO_ADD_CMP_0_1, val); 727 - outb(base_addr + PI_ESIC_K_IO_ADD_CMP_0_0, 0); 728 - outb(base_addr + PI_ESIC_K_IO_ADD_CMP_1_1, val); 729 - outb(base_addr + PI_ESIC_K_IO_ADD_CMP_1_0, 0); 730 - val = PI_ESIC_K_CSR_IO_LEN - 1; 731 - outb(base_addr + PI_ESIC_K_IO_ADD_MASK_0_1, (val >> 8) & 0xff); 732 - outb(base_addr + PI_ESIC_K_IO_ADD_MASK_0_0, val & 0xff); 733 - outb(base_addr + PI_ESIC_K_IO_ADD_MASK_1_1, (val >> 8) & 0xff); 734 - outb(base_addr + PI_ESIC_K_IO_ADD_MASK_1_0, val & 0xff); 720 + val = 0; 721 + outb(val, base_addr + PI_ESIC_K_IO_ADD_CMP_0_1); 722 + val = PI_DEFEA_K_CSR_IO; 723 + outb(val, base_addr + PI_ESIC_K_IO_ADD_CMP_0_0); 724 + 725 + val = PI_IO_CMP_M_SLOT; 726 + outb(val, base_addr + PI_ESIC_K_IO_ADD_MASK_0_1); 727 + val = (PI_ESIC_K_CSR_IO_LEN - 1) & ~3; 728 + outb(val, base_addr + PI_ESIC_K_IO_ADD_MASK_0_0); 729 + 730 + val = 0; 731 + outb(val, base_addr + PI_ESIC_K_IO_ADD_CMP_1_1); 732 + val = PI_DEFEA_K_BURST_HOLDOFF; 733 + outb(val, base_addr + PI_ESIC_K_IO_ADD_CMP_1_0); 734 + 735 + val = PI_IO_CMP_M_SLOT; 736 + outb(val, base_addr + PI_ESIC_K_IO_ADD_MASK_1_1); 737 + val = (PI_ESIC_K_BURST_HOLDOFF_LEN - 1) & ~3; 738 + outb(val, base_addr + PI_ESIC_K_IO_ADD_MASK_1_0); 735 739 736 740 /* Enable the decoders. */ 737 741 val = PI_FUNCTION_CNTRL_M_IOCS1 | PI_FUNCTION_CNTRL_M_IOCS0; 738 742 if (dfx_use_mmio) 739 743 val |= PI_FUNCTION_CNTRL_M_MEMCS0; 740 - outb(base_addr + PI_ESIC_K_FUNCTION_CNTRL, val); 744 + outb(val, base_addr + PI_ESIC_K_FUNCTION_CNTRL); 741 745 742 746 /* 743 747 * Enable access to the rest of the module 744 748 * (including PDQ and packet memory). 745 749 */ 746 750 val = PI_SLOT_CNTRL_M_ENB; 747 - outb(base_addr + PI_ESIC_K_SLOT_CNTRL, val); 751 + outb(val, base_addr + PI_ESIC_K_SLOT_CNTRL); 748 752 749 753 /* 750 754 * Map PDQ registers into memory or port space. This is ··· 760 748 */ 761 749 val = inb(base_addr + PI_DEFEA_K_BURST_HOLDOFF); 762 750 if (dfx_use_mmio) 763 - val |= PI_BURST_HOLDOFF_V_MEM_MAP; 751 + val |= PI_BURST_HOLDOFF_M_MEM_MAP; 764 752 else 765 - val &= ~PI_BURST_HOLDOFF_V_MEM_MAP; 766 - outb(base_addr + PI_DEFEA_K_BURST_HOLDOFF, val); 753 + val &= ~PI_BURST_HOLDOFF_M_MEM_MAP; 754 + outb(val, base_addr + PI_DEFEA_K_BURST_HOLDOFF); 767 755 768 756 /* Enable interrupts at EISA bus interface chip (ESIC) */ 769 757 val = inb(base_addr + PI_ESIC_K_IO_CONFIG_STAT_0); 770 758 val |= PI_CONFIG_STAT_0_M_INT_ENB; 771 - outb(base_addr + PI_ESIC_K_IO_CONFIG_STAT_0, val); 759 + outb(val, base_addr + PI_ESIC_K_IO_CONFIG_STAT_0); 772 760 } 773 761 if (dfx_bus_pci) { 774 762 struct pci_dev *pdev = to_pci_dev(bdev); ··· 837 825 /* Disable interrupts at EISA bus interface chip (ESIC) */ 838 826 val = inb(base_addr + PI_ESIC_K_IO_CONFIG_STAT_0); 839 827 val &= ~PI_CONFIG_STAT_0_M_INT_ENB; 840 - outb(base_addr + PI_ESIC_K_IO_CONFIG_STAT_0, val); 828 + outb(val, base_addr + PI_ESIC_K_IO_CONFIG_STAT_0); 841 829 } 842 830 if (dfx_bus_pci) { 843 831 /* Disable interrupts at PCI bus interface chip (PFI) */ ··· 1929 1917 1930 1918 /* Disable interrupts at the ESIC */ 1931 1919 status &= ~PI_CONFIG_STAT_0_M_INT_ENB; 1932 - outb(base_addr + PI_ESIC_K_IO_CONFIG_STAT_0, status); 1920 + outb(status, base_addr + PI_ESIC_K_IO_CONFIG_STAT_0); 1933 1921 1934 1922 /* Call interrupt service routine for this adapter */ 1935 1923 dfx_int_common(dev); ··· 1937 1925 /* Reenable interrupts at the ESIC */ 1938 1926 status = inb(base_addr + PI_ESIC_K_IO_CONFIG_STAT_0); 1939 1927 status |= PI_CONFIG_STAT_0_M_INT_ENB; 1940 - outb(base_addr + PI_ESIC_K_IO_CONFIG_STAT_0, status); 1928 + outb(status, base_addr + PI_ESIC_K_IO_CONFIG_STAT_0); 1941 1929 1942 1930 spin_unlock(&bp->lock); 1943 1931 }
+6 -6
drivers/net/fddi/defxx.h
··· 1479 1479 1480 1480 /* Define EISA controller register offsets */ 1481 1481 1482 - #define PI_ESIC_K_CSR_IO_LEN 0x80 /* 128 bytes */ 1482 + #define PI_ESIC_K_CSR_IO_LEN 0x40 /* 64 bytes */ 1483 + #define PI_ESIC_K_BURST_HOLDOFF_LEN 0x04 /* 4 bytes */ 1483 1484 1485 + #define PI_DEFEA_K_CSR_IO 0x000 1484 1486 #define PI_DEFEA_K_BURST_HOLDOFF 0x040 1485 1487 1486 1488 #define PI_ESIC_K_SLOT_ID 0xC80 ··· 1560 1558 1561 1559 #define PI_MEM_ADD_MASK_M 0x3ff 1562 1560 1563 - /* 1564 - * Define the fields in the IO Compare registers. 1565 - * The driver must initialize the slot field with the slot ID shifted by the 1566 - * amount shown below. 1567 - */ 1561 + /* Define the fields in the I/O Address Compare and Mask registers. */ 1562 + 1563 + #define PI_IO_CMP_M_SLOT 0xf0 1568 1564 1569 1565 #define PI_IO_CMP_V_SLOT 4 1570 1566