aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaciej W. Rozycki <macro@linux-mips.org>2014-09-25 06:06:55 -0400
committerDavid S. Miller <davem@davemloft.net>2014-09-28 17:22:10 -0400
commitb98dfaf2b0a3e72fa5967dafb4f246442584a780 (patch)
tree4cc04f9085d0b1863dd6cf27e9fdc95d8b5d28cd
parentb1a6d3ecf806457d3e76ac0044db424be3c9422d (diff)
defxx: DEFEA's ESIC port I/O decoding cleanup
Use the slot-specific I/O range for decoding accesses to PDQ ASIC registers (IOCS0) and the discrete Burst Holdoff register (IOCS1) as per the "HD64981F EISA Slave Interface Controller (ESIC)" datasheet. Use disjoint decode ranges now that the assignment of chip selects is known. Update the span of the port I/O resource requested accordingly. Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/fddi/defxx.c40
-rw-r--r--drivers/net/fddi/defxx.h12
2 files changed, 32 insertions, 20 deletions
diff --git a/drivers/net/fddi/defxx.c b/drivers/net/fddi/defxx.c
index 15a18fbe30cf..caed6eee289c 100644
--- a/drivers/net/fddi/defxx.c
+++ b/drivers/net/fddi/defxx.c
@@ -466,7 +466,8 @@ static void dfx_get_bars(struct device *bdev,
466 *bar_len = (bar | PI_MEM_ADD_MASK_M) + 1; 466 *bar_len = (bar | PI_MEM_ADD_MASK_M) + 1;
467 } else { 467 } else {
468 *bar_start = base_addr; 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 if (dfx_bus_tc) { 473 if (dfx_bus_tc) {
@@ -683,6 +684,9 @@ static void dfx_bus_init(struct net_device *dev)
683 if (dfx_bus_eisa) { 684 if (dfx_bus_eisa) {
684 unsigned long base_addr = to_eisa_device(bdev)->base_addr; 685 unsigned long base_addr = to_eisa_device(bdev)->base_addr;
685 686
687 /* Disable the board before fiddling with the decoders. */
688 outb(0, base_addr + PI_ESIC_K_SLOT_CNTRL);
689
686 /* Get the interrupt level from the ESIC chip. */ 690 /* Get the interrupt level from the ESIC chip. */
687 val = inb(base_addr + PI_ESIC_K_IO_CONFIG_STAT_0); 691 val = inb(base_addr + PI_ESIC_K_IO_CONFIG_STAT_0);
688 val &= PI_CONFIG_STAT_0_M_IRQ; 692 val &= PI_CONFIG_STAT_0_M_IRQ;
@@ -709,25 +713,33 @@ static void dfx_bus_init(struct net_device *dev)
709 /* 713 /*
710 * Enable memory decoding (MEMCS0) and/or port decoding 714 * Enable memory decoding (MEMCS0) and/or port decoding
711 * (IOCS1/IOCS0) as appropriate in Function Control 715 * (IOCS1/IOCS0) as appropriate in Function Control
712 * Register. One of the port chip selects seems to be 716 * Register. IOCS0 is used for PDQ registers, taking 16
713 * used for the Burst Holdoff register, but this bit of 717 * 32-bit words, while IOCS1 is used for the Burst Holdoff
714 * documentation is missing and as yet it has not been 718 * register, taking a single 32-bit word only. We use the
715 * determined which of the two. This is also the reason 719 * slot-specific I/O range as per the ESIC spec, that is
716 * the size of the decoded port range is twice as large 720 * set bits 15:12 in the mask registers to mask them out.
717 * as one required by the PDQ.
718 */ 721 */
719 722
720 /* Set the decode range of the board. */ 723 /* Set the decode range of the board. */
721 val = ((bp->base.port >> 12) << PI_IO_CMP_V_SLOT); 724 val = 0;
722 outb(val, base_addr + PI_ESIC_K_IO_ADD_CMP_0_1); 725 outb(val, base_addr + PI_ESIC_K_IO_ADD_CMP_0_1);
723 outb(0, base_addr + PI_ESIC_K_IO_ADD_CMP_0_0); 726 val = PI_DEFEA_K_CSR_IO;
724 outb(val, base_addr + PI_ESIC_K_IO_ADD_CMP_1_1); 727 outb(val, base_addr + PI_ESIC_K_IO_ADD_CMP_0_0);
725 outb(0, base_addr + PI_ESIC_K_IO_ADD_CMP_1_0); 728
726 val = PI_ESIC_K_CSR_IO_LEN - 1; 729 val = PI_IO_CMP_M_SLOT;
727 outb(val, base_addr + PI_ESIC_K_IO_ADD_MASK_0_1); 730 outb(val, base_addr + PI_ESIC_K_IO_ADD_MASK_0_1);
728 outb(0, base_addr + PI_ESIC_K_IO_ADD_MASK_0_0); 731 val = (PI_ESIC_K_CSR_IO_LEN - 1) & ~3;
732 outb(val, base_addr + PI_ESIC_K_IO_ADD_MASK_0_0);
733
734 val = 0;
735 outb(val, base_addr + PI_ESIC_K_IO_ADD_CMP_1_1);
736 val = PI_DEFEA_K_BURST_HOLDOFF;
737 outb(val, base_addr + PI_ESIC_K_IO_ADD_CMP_1_0);
738
739 val = PI_IO_CMP_M_SLOT;
729 outb(val, base_addr + PI_ESIC_K_IO_ADD_MASK_1_1); 740 outb(val, base_addr + PI_ESIC_K_IO_ADD_MASK_1_1);
730 outb(0, base_addr + PI_ESIC_K_IO_ADD_MASK_1_0); 741 val = (PI_ESIC_K_BURST_HOLDOFF_LEN - 1) & ~3;
742 outb(val, base_addr + PI_ESIC_K_IO_ADD_MASK_1_0);
731 743
732 /* Enable the decoders. */ 744 /* Enable the decoders. */
733 val = PI_FUNCTION_CNTRL_M_IOCS1 | PI_FUNCTION_CNTRL_M_IOCS0; 745 val = PI_FUNCTION_CNTRL_M_IOCS1 | PI_FUNCTION_CNTRL_M_IOCS0;
diff --git a/drivers/net/fddi/defxx.h b/drivers/net/fddi/defxx.h
index adb63f3f7b4a..9527f0182fd4 100644
--- a/drivers/net/fddi/defxx.h
+++ b/drivers/net/fddi/defxx.h
@@ -1479,8 +1479,10 @@ typedef union
1479 1479
1480/* Define EISA controller register offsets */ 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#define PI_DEFEA_K_BURST_HOLDOFF 0x040 1486#define PI_DEFEA_K_BURST_HOLDOFF 0x040
1485 1487
1486#define PI_ESIC_K_SLOT_ID 0xC80 1488#define PI_ESIC_K_SLOT_ID 0xC80
@@ -1558,11 +1560,9 @@ typedef union
1558 1560
1559#define PI_MEM_ADD_MASK_M 0x3ff 1561#define PI_MEM_ADD_MASK_M 0x3ff
1560 1562
1561/* 1563/* Define the fields in the I/O Address Compare and Mask registers. */
1562 * Define the fields in the IO Compare registers. 1564
1563 * The driver must initialize the slot field with the slot ID shifted by the 1565#define PI_IO_CMP_M_SLOT 0xf0
1564 * amount shown below.
1565 */
1566 1566
1567#define PI_IO_CMP_V_SLOT 4 1567#define PI_IO_CMP_V_SLOT 4
1568 1568