diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2006-11-11 01:25:13 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-12-04 04:38:55 -0500 |
commit | 3bc0f40c287a435805b0545ffc44ea41f11cd43e (patch) | |
tree | a30860fe647dc7acc674d3da149aad22d6150b24 /drivers | |
parent | 014da7ff47b559e5f0ae3e044b73f0359c08153d (diff) |
[POWERPC] Spider uses low level BE MMIO accessors
We use the powerpc specific low level MMIO accessor variants instead
of readl() or readl_be() because we know spidernet is not a real PCI
device and we can thus avoid the performance hit caused by the PCI
workarounds.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/spider_net.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/drivers/net/spider_net.c b/drivers/net/spider_net.c index cef7e6671c49..13e0a43e423b 100644 --- a/drivers/net/spider_net.c +++ b/drivers/net/spider_net.c | |||
@@ -88,12 +88,11 @@ MODULE_DEVICE_TABLE(pci, spider_net_pci_tbl); | |||
88 | static inline u32 | 88 | static inline u32 |
89 | spider_net_read_reg(struct spider_net_card *card, u32 reg) | 89 | spider_net_read_reg(struct spider_net_card *card, u32 reg) |
90 | { | 90 | { |
91 | u32 value; | 91 | /* We use the powerpc specific variants instead of readl_be() because |
92 | 92 | * we know spidernet is not a real PCI device and we can thus avoid the | |
93 | value = readl(card->regs + reg); | 93 | * performance hit caused by the PCI workarounds. |
94 | value = le32_to_cpu(value); | 94 | */ |
95 | 95 | return in_be32(card->regs + reg); | |
96 | return value; | ||
97 | } | 96 | } |
98 | 97 | ||
99 | /** | 98 | /** |
@@ -105,8 +104,11 @@ spider_net_read_reg(struct spider_net_card *card, u32 reg) | |||
105 | static inline void | 104 | static inline void |
106 | spider_net_write_reg(struct spider_net_card *card, u32 reg, u32 value) | 105 | spider_net_write_reg(struct spider_net_card *card, u32 reg, u32 value) |
107 | { | 106 | { |
108 | value = cpu_to_le32(value); | 107 | /* We use the powerpc specific variants instead of writel_be() because |
109 | writel(value, card->regs + reg); | 108 | * we know spidernet is not a real PCI device and we can thus avoid the |
109 | * performance hit caused by the PCI workarounds. | ||
110 | */ | ||
111 | out_be32(card->regs + reg, value); | ||
110 | } | 112 | } |
111 | 113 | ||
112 | /** spider_net_write_phy - write to phy register | 114 | /** spider_net_write_phy - write to phy register |