mirror of
https://github.com/fail0verflow/switch-linux.git
synced 2025-05-04 02:34:21 -04:00
[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>
This commit is contained in:
parent
014da7ff47
commit
3bc0f40c28
1 changed files with 10 additions and 8 deletions
|
@ -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)
|
||||||
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
|
||||||
|
|
Loading…
Add table
Reference in a new issue