diff options
author | Maciej W. Rozycki <macro@linux-mips.org> | 2014-09-25 06:06:55 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-09-28 17:22:10 -0400 |
commit | b98dfaf2b0a3e72fa5967dafb4f246442584a780 (patch) | |
tree | 4cc04f9085d0b1863dd6cf27e9fdc95d8b5d28cd /drivers/net/fddi/defxx.c | |
parent | b1a6d3ecf806457d3e76ac0044db424be3c9422d (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>
Diffstat (limited to 'drivers/net/fddi/defxx.c')
-rw-r--r-- | drivers/net/fddi/defxx.c | 40 |
1 files changed, 26 insertions, 14 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; |