Commit 3bc0f40c authored by Benjamin Herrenschmidt's avatar Benjamin Herrenschmidt Committed by Paul Mackerras

[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: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent 014da7ff
...@@ -88,12 +88,11 @@ MODULE_DEVICE_TABLE(pci, spider_net_pci_tbl); ...@@ -88,12 +88,11 @@ MODULE_DEVICE_TABLE(pci, spider_net_pci_tbl);
static inline u32 static inline u32
spider_net_read_reg(struct spider_net_card *card, u32 reg) spider_net_read_reg(struct spider_net_card *card, u32 reg)
{ {
u32 value; /* We use the powerpc specific variants instead of readl_be() because
* we know spidernet is not a real PCI device and we can thus avoid the
value = readl(card->regs + reg); * performance hit caused by the PCI workarounds.
value = le32_to_cpu(value); */
return in_be32(card->regs + reg);
return value;
} }
/** /**
...@@ -105,8 +104,11 @@ spider_net_read_reg(struct spider_net_card *card, u32 reg) ...@@ -105,8 +104,11 @@ spider_net_read_reg(struct spider_net_card *card, u32 reg)
static inline void static inline void
spider_net_write_reg(struct spider_net_card *card, u32 reg, u32 value) spider_net_write_reg(struct spider_net_card *card, u32 reg, u32 value)
{ {
value = cpu_to_le32(value); /* We use the powerpc specific variants instead of writel_be() because
writel(value, card->regs + reg); * we know spidernet is not a real PCI device and we can thus avoid the
* performance hit caused by the PCI workarounds.
*/
out_be32(card->regs + reg, value);
} }
/** spider_net_write_phy - write to phy register /** spider_net_write_phy - write to phy register
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment