PCI: designware: Swap order of dw_pcie_writel_rc() reg/val arguments
Swap order of dw_pcie_writel_rc() arguments to match the "dev, pos, val" order used by pci_write_config_word() and other drivers. No functional change intended. Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
This commit is contained in:
parent
7e00dfd0fb
commit
ad88021894
|
@ -435,7 +435,7 @@ static inline u32 exynos_pcie_readl_rc(struct pcie_port *pp, u32 reg)
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void exynos_pcie_writel_rc(struct pcie_port *pp, u32 val, u32 reg)
|
static inline void exynos_pcie_writel_rc(struct pcie_port *pp, u32 reg, u32 val)
|
||||||
{
|
{
|
||||||
exynos_pcie_sideband_dbi_w_mode(pp, true);
|
exynos_pcie_sideband_dbi_w_mode(pp, true);
|
||||||
writel(val, pp->dbi_base + reg);
|
writel(val, pp->dbi_base + reg);
|
||||||
|
|
|
@ -149,10 +149,10 @@ static inline u32 dw_pcie_readl_rc(struct pcie_port *pp, u32 reg)
|
||||||
return readl(pp->dbi_base + reg);
|
return readl(pp->dbi_base + reg);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void dw_pcie_writel_rc(struct pcie_port *pp, u32 val, u32 reg)
|
static inline void dw_pcie_writel_rc(struct pcie_port *pp, u32 reg, u32 val)
|
||||||
{
|
{
|
||||||
if (pp->ops->writel_rc)
|
if (pp->ops->writel_rc)
|
||||||
pp->ops->writel_rc(pp, val, reg);
|
pp->ops->writel_rc(pp, reg, val);
|
||||||
else
|
else
|
||||||
writel(val, pp->dbi_base + reg);
|
writel(val, pp->dbi_base + reg);
|
||||||
}
|
}
|
||||||
|
@ -169,7 +169,7 @@ static inline void dw_pcie_writel_unroll(struct pcie_port *pp, u32 index,
|
||||||
{
|
{
|
||||||
u32 offset = PCIE_GET_ATU_OUTB_UNR_REG_OFFSET(index);
|
u32 offset = PCIE_GET_ATU_OUTB_UNR_REG_OFFSET(index);
|
||||||
|
|
||||||
dw_pcie_writel_rc(pp, val, offset + reg);
|
dw_pcie_writel_rc(pp, offset + reg, val);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int dw_pcie_rd_own_conf(struct pcie_port *pp, int where, int size,
|
static int dw_pcie_rd_own_conf(struct pcie_port *pp, int where, int size,
|
||||||
|
@ -211,20 +211,20 @@ static void dw_pcie_prog_outbound_atu(struct pcie_port *pp, int index,
|
||||||
dw_pcie_writel_unroll(pp, index,
|
dw_pcie_writel_unroll(pp, index,
|
||||||
PCIE_ATU_ENABLE, PCIE_ATU_UNR_REGION_CTRL2);
|
PCIE_ATU_ENABLE, PCIE_ATU_UNR_REGION_CTRL2);
|
||||||
} else {
|
} else {
|
||||||
dw_pcie_writel_rc(pp, PCIE_ATU_REGION_OUTBOUND | index,
|
dw_pcie_writel_rc(pp, PCIE_ATU_VIEWPORT,
|
||||||
PCIE_ATU_VIEWPORT);
|
PCIE_ATU_REGION_OUTBOUND | index);
|
||||||
dw_pcie_writel_rc(pp, lower_32_bits(cpu_addr),
|
dw_pcie_writel_rc(pp, PCIE_ATU_LOWER_BASE,
|
||||||
PCIE_ATU_LOWER_BASE);
|
lower_32_bits(cpu_addr));
|
||||||
dw_pcie_writel_rc(pp, upper_32_bits(cpu_addr),
|
dw_pcie_writel_rc(pp, PCIE_ATU_UPPER_BASE,
|
||||||
PCIE_ATU_UPPER_BASE);
|
upper_32_bits(cpu_addr));
|
||||||
dw_pcie_writel_rc(pp, lower_32_bits(cpu_addr + size - 1),
|
dw_pcie_writel_rc(pp, PCIE_ATU_LIMIT,
|
||||||
PCIE_ATU_LIMIT);
|
lower_32_bits(cpu_addr + size - 1));
|
||||||
dw_pcie_writel_rc(pp, lower_32_bits(pci_addr),
|
dw_pcie_writel_rc(pp, PCIE_ATU_LOWER_TARGET,
|
||||||
PCIE_ATU_LOWER_TARGET);
|
lower_32_bits(pci_addr));
|
||||||
dw_pcie_writel_rc(pp, upper_32_bits(pci_addr),
|
dw_pcie_writel_rc(pp, PCIE_ATU_UPPER_TARGET,
|
||||||
PCIE_ATU_UPPER_TARGET);
|
upper_32_bits(pci_addr));
|
||||||
dw_pcie_writel_rc(pp, type, PCIE_ATU_CR1);
|
dw_pcie_writel_rc(pp, PCIE_ATU_CR1, type);
|
||||||
dw_pcie_writel_rc(pp, PCIE_ATU_ENABLE, PCIE_ATU_CR2);
|
dw_pcie_writel_rc(pp, PCIE_ATU_CR2, PCIE_ATU_ENABLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -829,7 +829,7 @@ void dw_pcie_setup_rc(struct pcie_port *pp)
|
||||||
dev_err(pp->dev, "num-lanes %u: invalid value\n", pp->lanes);
|
dev_err(pp->dev, "num-lanes %u: invalid value\n", pp->lanes);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
dw_pcie_writel_rc(pp, val, PCIE_PORT_LINK_CONTROL);
|
dw_pcie_writel_rc(pp, PCIE_PORT_LINK_CONTROL, val);
|
||||||
|
|
||||||
/* set link width speed control register */
|
/* set link width speed control register */
|
||||||
val = dw_pcie_readl_rc(pp, PCIE_LINK_WIDTH_SPEED_CONTROL);
|
val = dw_pcie_readl_rc(pp, PCIE_LINK_WIDTH_SPEED_CONTROL);
|
||||||
|
@ -848,30 +848,30 @@ void dw_pcie_setup_rc(struct pcie_port *pp)
|
||||||
val |= PORT_LOGIC_LINK_WIDTH_8_LANES;
|
val |= PORT_LOGIC_LINK_WIDTH_8_LANES;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
dw_pcie_writel_rc(pp, val, PCIE_LINK_WIDTH_SPEED_CONTROL);
|
dw_pcie_writel_rc(pp, PCIE_LINK_WIDTH_SPEED_CONTROL, val);
|
||||||
|
|
||||||
/* setup RC BARs */
|
/* setup RC BARs */
|
||||||
dw_pcie_writel_rc(pp, 0x00000004, PCI_BASE_ADDRESS_0);
|
dw_pcie_writel_rc(pp, PCI_BASE_ADDRESS_0, 0x00000004);
|
||||||
dw_pcie_writel_rc(pp, 0x00000000, PCI_BASE_ADDRESS_1);
|
dw_pcie_writel_rc(pp, PCI_BASE_ADDRESS_1, 0x00000000);
|
||||||
|
|
||||||
/* setup interrupt pins */
|
/* setup interrupt pins */
|
||||||
val = dw_pcie_readl_rc(pp, PCI_INTERRUPT_LINE);
|
val = dw_pcie_readl_rc(pp, PCI_INTERRUPT_LINE);
|
||||||
val &= 0xffff00ff;
|
val &= 0xffff00ff;
|
||||||
val |= 0x00000100;
|
val |= 0x00000100;
|
||||||
dw_pcie_writel_rc(pp, val, PCI_INTERRUPT_LINE);
|
dw_pcie_writel_rc(pp, PCI_INTERRUPT_LINE, val);
|
||||||
|
|
||||||
/* setup bus numbers */
|
/* setup bus numbers */
|
||||||
val = dw_pcie_readl_rc(pp, PCI_PRIMARY_BUS);
|
val = dw_pcie_readl_rc(pp, PCI_PRIMARY_BUS);
|
||||||
val &= 0xff000000;
|
val &= 0xff000000;
|
||||||
val |= 0x00010100;
|
val |= 0x00010100;
|
||||||
dw_pcie_writel_rc(pp, val, PCI_PRIMARY_BUS);
|
dw_pcie_writel_rc(pp, PCI_PRIMARY_BUS, val);
|
||||||
|
|
||||||
/* setup command register */
|
/* setup command register */
|
||||||
val = dw_pcie_readl_rc(pp, PCI_COMMAND);
|
val = dw_pcie_readl_rc(pp, PCI_COMMAND);
|
||||||
val &= 0xffff0000;
|
val &= 0xffff0000;
|
||||||
val |= PCI_COMMAND_IO | PCI_COMMAND_MEMORY |
|
val |= PCI_COMMAND_IO | PCI_COMMAND_MEMORY |
|
||||||
PCI_COMMAND_MASTER | PCI_COMMAND_SERR;
|
PCI_COMMAND_MASTER | PCI_COMMAND_SERR;
|
||||||
dw_pcie_writel_rc(pp, val, PCI_COMMAND);
|
dw_pcie_writel_rc(pp, PCI_COMMAND, val);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If the platform provides ->rd_other_conf, it means the platform
|
* If the platform provides ->rd_other_conf, it means the platform
|
||||||
|
|
|
@ -55,7 +55,7 @@ struct pcie_port {
|
||||||
|
|
||||||
struct pcie_host_ops {
|
struct pcie_host_ops {
|
||||||
u32 (*readl_rc)(struct pcie_port *pp, u32 reg);
|
u32 (*readl_rc)(struct pcie_port *pp, u32 reg);
|
||||||
void (*writel_rc)(struct pcie_port *pp, u32 val, u32 reg);
|
void (*writel_rc)(struct pcie_port *pp, u32 reg, u32 val);
|
||||||
int (*rd_own_conf)(struct pcie_port *pp, int where, int size, u32 *val);
|
int (*rd_own_conf)(struct pcie_port *pp, int where, int size, u32 *val);
|
||||||
int (*wr_own_conf)(struct pcie_port *pp, int where, int size, u32 val);
|
int (*wr_own_conf)(struct pcie_port *pp, int where, int size, u32 val);
|
||||||
int (*rd_other_conf)(struct pcie_port *pp, struct pci_bus *bus,
|
int (*rd_other_conf)(struct pcie_port *pp, struct pci_bus *bus,
|
||||||
|
|
Loading…
Reference in New Issue