aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ibm_newemac/debug.c
diff options
context:
space:
mode:
authorGrant Erickson <gerickson@nuovations.com>2008-07-07 18:03:11 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2008-07-09 02:30:46 -0400
commit05781ccd74c63c6c8567f99101587d5c07c163e0 (patch)
treebd1e666433674363e5d0819c08afae87e7105995 /drivers/net/ibm_newemac/debug.c
parent801eb73f45371accc78ca9d6d22d647eeb722c11 (diff)
ibm_newemac: Parameterize EMAC Multicast Match Handling
Various instances of the EMAC core have varying: 1) number of address match slots, 2) width of the registers for handling address match slots, 3) number of registers for handling address match slots and 4) base offset for those registers. As the driver stands today, it assumes that all EMACs have 4 IAHT and GAHT 32-bit registers, starting at offset 0x30 from the register base, with only 16-bits of each used for a total of 64 match slots. The 405EX(r) and 460EX now use the EMAC4SYNC core rather than the EMAC4 core. This core has 8 IAHT and GAHT registers, starting at offset 0x80 from the register base, with ALL 32-bits of each used for a total of 256 match slots. This adds a new compatible device tree entry "emac4sync" and a new, related feature flag "EMAC_FTR_EMAC4SYNC" along with a series of macros and inlines which supply the appropriate parameterized value based on the presence or absence of the EMAC4SYNC feature. The code has further been reworked where appropriate to use those macros and inlines. In addition, the register size passed to ioremap is now taken from the device tree: c4 for EMAC4SYNC cores 74 for EMAC4 cores 70 for EMAC cores rather than sizeof (emac_regs). Finally, the device trees have been updated with the appropriate compatible entries and resource sizes. This has been tested on an AMCC Haleakala board such that: 1) inbound ICMP requests to 'haleakala.local' via MDNS from both Mac OS X 10.4.11 and Ubuntu 8.04 systems as well as 2) outbound ICMP requests from 'haleakala.local' to those same systems in the '.local' domain via MDNS now work. Signed-off-by: Grant Erickson <gerickson@nuovations.com> Acked-by: Jeff Garzik <jgarzik@pobox.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'drivers/net/ibm_newemac/debug.c')
-rw-r--r--drivers/net/ibm_newemac/debug.c52
1 files changed, 39 insertions, 13 deletions
diff --git a/drivers/net/ibm_newemac/debug.c b/drivers/net/ibm_newemac/debug.c
index 86b756a30784..775c850a425a 100644
--- a/drivers/net/ibm_newemac/debug.c
+++ b/drivers/net/ibm_newemac/debug.c
@@ -67,29 +67,55 @@ static void emac_desc_dump(struct emac_instance *p)
67static void emac_mac_dump(struct emac_instance *dev) 67static void emac_mac_dump(struct emac_instance *dev)
68{ 68{
69 struct emac_regs __iomem *p = dev->emacp; 69 struct emac_regs __iomem *p = dev->emacp;
70 const int xaht_regs = EMAC_XAHT_REGS(dev);
71 u32 *gaht_base = emac_gaht_base(dev);
72 u32 *iaht_base = emac_iaht_base(dev);
73 int emac4sync = emac_has_feature(dev, EMAC_FTR_EMAC4SYNC);
74 int n;
70 75
71 printk("** EMAC %s registers **\n" 76 printk("** EMAC %s registers **\n"
72 "MR0 = 0x%08x MR1 = 0x%08x TMR0 = 0x%08x TMR1 = 0x%08x\n" 77 "MR0 = 0x%08x MR1 = 0x%08x TMR0 = 0x%08x TMR1 = 0x%08x\n"
73 "RMR = 0x%08x ISR = 0x%08x ISER = 0x%08x\n" 78 "RMR = 0x%08x ISR = 0x%08x ISER = 0x%08x\n"
74 "IAR = %04x%08x VTPID = 0x%04x VTCI = 0x%04x\n" 79 "IAR = %04x%08x VTPID = 0x%04x VTCI = 0x%04x\n",
75 "IAHT: 0x%04x 0x%04x 0x%04x 0x%04x "
76 "GAHT: 0x%04x 0x%04x 0x%04x 0x%04x\n"
77 "LSA = %04x%08x IPGVR = 0x%04x\n"
78 "STACR = 0x%08x TRTR = 0x%08x RWMR = 0x%08x\n"
79 "OCTX = 0x%08x OCRX = 0x%08x IPCR = 0x%08x\n",
80 dev->ofdev->node->full_name, in_be32(&p->mr0), in_be32(&p->mr1), 80 dev->ofdev->node->full_name, in_be32(&p->mr0), in_be32(&p->mr1),
81 in_be32(&p->tmr0), in_be32(&p->tmr1), 81 in_be32(&p->tmr0), in_be32(&p->tmr1),
82 in_be32(&p->rmr), in_be32(&p->isr), in_be32(&p->iser), 82 in_be32(&p->rmr), in_be32(&p->isr), in_be32(&p->iser),
83 in_be32(&p->iahr), in_be32(&p->ialr), in_be32(&p->vtpid), 83 in_be32(&p->iahr), in_be32(&p->ialr), in_be32(&p->vtpid),
84 in_be32(&p->vtci), 84 in_be32(&p->vtci)
85 in_be32(&p->iaht1), in_be32(&p->iaht2), in_be32(&p->iaht3), 85 );
86 in_be32(&p->iaht4), 86
87 in_be32(&p->gaht1), in_be32(&p->gaht2), in_be32(&p->gaht3), 87 if (emac4sync)
88 in_be32(&p->gaht4), 88 printk("MAR = %04x%08x MMAR = %04x%08x\n",
89 in_be32(&p->u0.emac4sync.mahr),
90 in_be32(&p->u0.emac4sync.malr),
91 in_be32(&p->u0.emac4sync.mmahr),
92 in_be32(&p->u0.emac4sync.mmalr)
93 );
94
95 for (n = 0; n < xaht_regs; n++)
96 printk("IAHT%02d = 0x%08x\n", n + 1, in_be32(iaht_base + n));
97
98 for (n = 0; n < xaht_regs; n++)
99 printk("GAHT%02d = 0x%08x\n", n + 1, in_be32(gaht_base + n));
100
101 printk("LSA = %04x%08x IPGVR = 0x%04x\n"
102 "STACR = 0x%08x TRTR = 0x%08x RWMR = 0x%08x\n"
103 "OCTX = 0x%08x OCRX = 0x%08x\n",
89 in_be32(&p->lsah), in_be32(&p->lsal), in_be32(&p->ipgvr), 104 in_be32(&p->lsah), in_be32(&p->lsal), in_be32(&p->ipgvr),
90 in_be32(&p->stacr), in_be32(&p->trtr), in_be32(&p->rwmr), 105 in_be32(&p->stacr), in_be32(&p->trtr), in_be32(&p->rwmr),
91 in_be32(&p->octx), in_be32(&p->ocrx), in_be32(&p->ipcr) 106 in_be32(&p->octx), in_be32(&p->ocrx)
92 ); 107 );
108
109 if (!emac4sync) {
110 printk("IPCR = 0x%08x\n",
111 in_be32(&p->u1.emac4.ipcr)
112 );
113 } else {
114 printk("REVID = 0x%08x TPC = 0x%08x\n",
115 in_be32(&p->u1.emac4sync.revid),
116 in_be32(&p->u1.emac4sync.tpc)
117 );
118 }
93 119
94 emac_desc_dump(dev); 120 emac_desc_dump(dev);
95} 121}