aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2010-10-14 17:15:56 -0400
committerPaul Mundt <lethal@linux-sh.org>2010-10-14 17:15:56 -0400
commita80be1680502f99de5f9565c491208e90a9a3afe (patch)
tree987116f70cca17e598ed61fd01aecabe0d36c631 /arch/sh
parentd8d6b902b8a3b2c66151529694bb4a9a3555cf43 (diff)
sh: pci: Convert to upper/lower_32_bits() helpers.
Instead of hand-rolling our own, just use the generic ones instead. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh')
-rw-r--r--arch/sh/drivers/pci/pcie-sh7786.c4
-rw-r--r--arch/sh/drivers/pci/pcie-sh7786.h7
2 files changed, 2 insertions, 9 deletions
diff --git a/arch/sh/drivers/pci/pcie-sh7786.c b/arch/sh/drivers/pci/pcie-sh7786.c
index ae0b2c9b70a0..96e9b058aa1d 100644
--- a/arch/sh/drivers/pci/pcie-sh7786.c
+++ b/arch/sh/drivers/pci/pcie-sh7786.c
@@ -446,9 +446,9 @@ static int __init pcie_init(struct sh7786_pcie_port *port)
446 mask = (roundup_pow_of_two(size) / SZ_256K) - 1; 446 mask = (roundup_pow_of_two(size) / SZ_256K) - 1;
447 pci_write_reg(chan, mask << 18, SH4A_PCIEPAMR(win)); 447 pci_write_reg(chan, mask << 18, SH4A_PCIEPAMR(win));
448 448
449 pci_write_reg(chan, RES_TO_U32_HIGH(res->start), 449 pci_write_reg(chan, upper_32_bits(res->start),
450 SH4A_PCIEPARH(win)); 450 SH4A_PCIEPARH(win));
451 pci_write_reg(chan, RES_TO_U32_LOW(res->start), 451 pci_write_reg(chan, lower_32_bits(res->start),
452 SH4A_PCIEPARL(win)); 452 SH4A_PCIEPARL(win));
453 453
454 mask = MASK_PARE; 454 mask = MASK_PARE;
diff --git a/arch/sh/drivers/pci/pcie-sh7786.h b/arch/sh/drivers/pci/pcie-sh7786.h
index a2a0ca6e7cca..1ee054e47eae 100644
--- a/arch/sh/drivers/pci/pcie-sh7786.h
+++ b/arch/sh/drivers/pci/pcie-sh7786.h
@@ -568,13 +568,6 @@
568 568
569#define PCI_REG(x) ((x) + 0x40000) 569#define PCI_REG(x) ((x) + 0x40000)
570 570
571#define U64_TO_U32_LOW(val) ((u32)((val) & 0x00000000ffffffffULL))
572#define U64_TO_U32_HIGH(val) ((u32)((val) >> 32))
573#define RES_TO_U32_LOW(val) \
574 ((sizeof(resource_size_t) > sizeof(u32)) ? U64_TO_U32_LOW(val) : (val))
575#define RES_TO_U32_HIGH(val) \
576 ((sizeof(resource_size_t) > sizeof(u32)) ? U64_TO_U32_HIGH(val) : (0))
577
578static inline void 571static inline void
579pci_write_reg(struct pci_channel *chan, unsigned long val, unsigned long reg) 572pci_write_reg(struct pci_channel *chan, unsigned long val, unsigned long reg)
580{ 573{