Commit a80be168 authored by Paul Mundt's avatar Paul Mundt

sh: pci: Convert to upper/lower_32_bits() helpers.

Instead of hand-rolling our own, just use the generic ones instead.
Signed-off-by: default avatarPaul Mundt <lethal@linux-sh.org>
parent d8d6b902
...@@ -446,9 +446,9 @@ static int __init pcie_init(struct sh7786_pcie_port *port) ...@@ -446,9 +446,9 @@ static int __init pcie_init(struct sh7786_pcie_port *port)
mask = (roundup_pow_of_two(size) / SZ_256K) - 1; mask = (roundup_pow_of_two(size) / SZ_256K) - 1;
pci_write_reg(chan, mask << 18, SH4A_PCIEPAMR(win)); pci_write_reg(chan, mask << 18, SH4A_PCIEPAMR(win));
pci_write_reg(chan, RES_TO_U32_HIGH(res->start), pci_write_reg(chan, upper_32_bits(res->start),
SH4A_PCIEPARH(win)); SH4A_PCIEPARH(win));
pci_write_reg(chan, RES_TO_U32_LOW(res->start), pci_write_reg(chan, lower_32_bits(res->start),
SH4A_PCIEPARL(win)); SH4A_PCIEPARL(win));
mask = MASK_PARE; mask = MASK_PARE;
......
...@@ -568,13 +568,6 @@ ...@@ -568,13 +568,6 @@
#define PCI_REG(x) ((x) + 0x40000) #define PCI_REG(x) ((x) + 0x40000)
#define U64_TO_U32_LOW(val) ((u32)((val) & 0x00000000ffffffffULL))
#define U64_TO_U32_HIGH(val) ((u32)((val) >> 32))
#define RES_TO_U32_LOW(val) \
((sizeof(resource_size_t) > sizeof(u32)) ? U64_TO_U32_LOW(val) : (val))
#define RES_TO_U32_HIGH(val) \
((sizeof(resource_size_t) > sizeof(u32)) ? U64_TO_U32_HIGH(val) : (0))
static inline void static inline void
pci_write_reg(struct pci_channel *chan, unsigned long val, unsigned long reg) pci_write_reg(struct pci_channel *chan, unsigned long val, unsigned long reg)
{ {
......
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