Merge branch 'pci/host-designware' into next
* pci/host-designware: PCI: dwc: Clear MSI interrupt status after it is handled, not before PCI: qcom: Allow ->post_init() to fail PCI: qcom: Don't unroll init if ->init() fails PCI: dwc: designware: Handle ->host_init() failures PCI: dwc: designware: Test PCIE_ATU_ENABLE bit specifically PCI: dwc: designware: Make dw_pcie_prog_*_atu_unroll() static
This commit is contained in:
commit
ee75520eb2
|
@ -195,7 +195,7 @@ static void dra7xx_pcie_enable_interrupts(struct dra7xx_pcie *dra7xx)
|
||||||
dra7xx_pcie_enable_msi_interrupts(dra7xx);
|
dra7xx_pcie_enable_msi_interrupts(dra7xx);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void dra7xx_pcie_host_init(struct pcie_port *pp)
|
static int dra7xx_pcie_host_init(struct pcie_port *pp)
|
||||||
{
|
{
|
||||||
struct dw_pcie *pci = to_dw_pcie_from_pp(pp);
|
struct dw_pcie *pci = to_dw_pcie_from_pp(pp);
|
||||||
struct dra7xx_pcie *dra7xx = to_dra7xx_pcie(pci);
|
struct dra7xx_pcie *dra7xx = to_dra7xx_pcie(pci);
|
||||||
|
@ -206,6 +206,8 @@ static void dra7xx_pcie_host_init(struct pcie_port *pp)
|
||||||
dw_pcie_wait_for_link(pci);
|
dw_pcie_wait_for_link(pci);
|
||||||
dw_pcie_msi_init(pp);
|
dw_pcie_msi_init(pp);
|
||||||
dra7xx_pcie_enable_interrupts(dra7xx);
|
dra7xx_pcie_enable_interrupts(dra7xx);
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct dw_pcie_host_ops dra7xx_pcie_host_ops = {
|
static const struct dw_pcie_host_ops dra7xx_pcie_host_ops = {
|
||||||
|
|
|
@ -581,13 +581,15 @@ static int exynos_pcie_link_up(struct dw_pcie *pci)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void exynos_pcie_host_init(struct pcie_port *pp)
|
static int exynos_pcie_host_init(struct pcie_port *pp)
|
||||||
{
|
{
|
||||||
struct dw_pcie *pci = to_dw_pcie_from_pp(pp);
|
struct dw_pcie *pci = to_dw_pcie_from_pp(pp);
|
||||||
struct exynos_pcie *ep = to_exynos_pcie(pci);
|
struct exynos_pcie *ep = to_exynos_pcie(pci);
|
||||||
|
|
||||||
exynos_pcie_establish_link(ep);
|
exynos_pcie_establish_link(ep);
|
||||||
exynos_pcie_enable_interrupts(ep);
|
exynos_pcie_enable_interrupts(ep);
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct dw_pcie_host_ops exynos_pcie_host_ops = {
|
static const struct dw_pcie_host_ops exynos_pcie_host_ops = {
|
||||||
|
|
|
@ -636,7 +636,7 @@ static int imx6_pcie_establish_link(struct imx6_pcie *imx6_pcie)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void imx6_pcie_host_init(struct pcie_port *pp)
|
static int imx6_pcie_host_init(struct pcie_port *pp)
|
||||||
{
|
{
|
||||||
struct dw_pcie *pci = to_dw_pcie_from_pp(pp);
|
struct dw_pcie *pci = to_dw_pcie_from_pp(pp);
|
||||||
struct imx6_pcie *imx6_pcie = to_imx6_pcie(pci);
|
struct imx6_pcie *imx6_pcie = to_imx6_pcie(pci);
|
||||||
|
@ -649,6 +649,8 @@ static void imx6_pcie_host_init(struct pcie_port *pp)
|
||||||
|
|
||||||
if (IS_ENABLED(CONFIG_PCI_MSI))
|
if (IS_ENABLED(CONFIG_PCI_MSI))
|
||||||
dw_pcie_msi_init(pp);
|
dw_pcie_msi_init(pp);
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int imx6_pcie_link_up(struct dw_pcie *pci)
|
static int imx6_pcie_link_up(struct dw_pcie *pci)
|
||||||
|
|
|
@ -261,7 +261,7 @@ static int keystone_pcie_fault(unsigned long addr, unsigned int fsr,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void __init ks_pcie_host_init(struct pcie_port *pp)
|
static int __init ks_pcie_host_init(struct pcie_port *pp)
|
||||||
{
|
{
|
||||||
struct dw_pcie *pci = to_dw_pcie_from_pp(pp);
|
struct dw_pcie *pci = to_dw_pcie_from_pp(pp);
|
||||||
struct keystone_pcie *ks_pcie = to_keystone_pcie(pci);
|
struct keystone_pcie *ks_pcie = to_keystone_pcie(pci);
|
||||||
|
@ -289,6 +289,8 @@ static void __init ks_pcie_host_init(struct pcie_port *pp)
|
||||||
*/
|
*/
|
||||||
hook_fault_code(17, keystone_pcie_fault, SIGBUS, 0,
|
hook_fault_code(17, keystone_pcie_fault, SIGBUS, 0,
|
||||||
"Asynchronous external abort");
|
"Asynchronous external abort");
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct dw_pcie_host_ops keystone_pcie_host_ops = {
|
static const struct dw_pcie_host_ops keystone_pcie_host_ops = {
|
||||||
|
|
|
@ -108,31 +108,35 @@ static int ls1021_pcie_link_up(struct dw_pcie *pci)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ls1021_pcie_host_init(struct pcie_port *pp)
|
static int ls1021_pcie_host_init(struct pcie_port *pp)
|
||||||
{
|
{
|
||||||
struct dw_pcie *pci = to_dw_pcie_from_pp(pp);
|
struct dw_pcie *pci = to_dw_pcie_from_pp(pp);
|
||||||
struct ls_pcie *pcie = to_ls_pcie(pci);
|
struct ls_pcie *pcie = to_ls_pcie(pci);
|
||||||
struct device *dev = pci->dev;
|
struct device *dev = pci->dev;
|
||||||
u32 index[2];
|
u32 index[2];
|
||||||
|
int ret;
|
||||||
|
|
||||||
pcie->scfg = syscon_regmap_lookup_by_phandle(dev->of_node,
|
pcie->scfg = syscon_regmap_lookup_by_phandle(dev->of_node,
|
||||||
"fsl,pcie-scfg");
|
"fsl,pcie-scfg");
|
||||||
if (IS_ERR(pcie->scfg)) {
|
if (IS_ERR(pcie->scfg)) {
|
||||||
|
ret = PTR_ERR(pcie->scfg);
|
||||||
dev_err(dev, "No syscfg phandle specified\n");
|
dev_err(dev, "No syscfg phandle specified\n");
|
||||||
pcie->scfg = NULL;
|
pcie->scfg = NULL;
|
||||||
return;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (of_property_read_u32_array(dev->of_node,
|
if (of_property_read_u32_array(dev->of_node,
|
||||||
"fsl,pcie-scfg", index, 2)) {
|
"fsl,pcie-scfg", index, 2)) {
|
||||||
pcie->scfg = NULL;
|
pcie->scfg = NULL;
|
||||||
return;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
pcie->index = index[1];
|
pcie->index = index[1];
|
||||||
|
|
||||||
dw_pcie_setup_rc(pp);
|
dw_pcie_setup_rc(pp);
|
||||||
|
|
||||||
ls_pcie_drop_msg_tlp(pcie);
|
ls_pcie_drop_msg_tlp(pcie);
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ls_pcie_link_up(struct dw_pcie *pci)
|
static int ls_pcie_link_up(struct dw_pcie *pci)
|
||||||
|
@ -150,7 +154,7 @@ static int ls_pcie_link_up(struct dw_pcie *pci)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ls_pcie_host_init(struct pcie_port *pp)
|
static int ls_pcie_host_init(struct pcie_port *pp)
|
||||||
{
|
{
|
||||||
struct dw_pcie *pci = to_dw_pcie_from_pp(pp);
|
struct dw_pcie *pci = to_dw_pcie_from_pp(pp);
|
||||||
struct ls_pcie *pcie = to_ls_pcie(pci);
|
struct ls_pcie *pcie = to_ls_pcie(pci);
|
||||||
|
@ -160,6 +164,8 @@ static void ls_pcie_host_init(struct pcie_port *pp)
|
||||||
ls_pcie_clear_multifunction(pcie);
|
ls_pcie_clear_multifunction(pcie);
|
||||||
ls_pcie_drop_msg_tlp(pcie);
|
ls_pcie_drop_msg_tlp(pcie);
|
||||||
iowrite32(0, pci->dbi_base + PCIE_DBI_RO_WR_EN);
|
iowrite32(0, pci->dbi_base + PCIE_DBI_RO_WR_EN);
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ls_pcie_msi_host_init(struct pcie_port *pp,
|
static int ls_pcie_msi_host_init(struct pcie_port *pp,
|
||||||
|
|
|
@ -134,13 +134,15 @@ static void armada8k_pcie_establish_link(struct armada8k_pcie *pcie)
|
||||||
dev_err(pci->dev, "Link not up after reconfiguration\n");
|
dev_err(pci->dev, "Link not up after reconfiguration\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void armada8k_pcie_host_init(struct pcie_port *pp)
|
static int armada8k_pcie_host_init(struct pcie_port *pp)
|
||||||
{
|
{
|
||||||
struct dw_pcie *pci = to_dw_pcie_from_pp(pp);
|
struct dw_pcie *pci = to_dw_pcie_from_pp(pp);
|
||||||
struct armada8k_pcie *pcie = to_armada8k_pcie(pci);
|
struct armada8k_pcie *pcie = to_armada8k_pcie(pci);
|
||||||
|
|
||||||
dw_pcie_setup_rc(pp);
|
dw_pcie_setup_rc(pp);
|
||||||
armada8k_pcie_establish_link(pcie);
|
armada8k_pcie_establish_link(pcie);
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static irqreturn_t armada8k_pcie_irq_handler(int irq, void *arg)
|
static irqreturn_t armada8k_pcie_irq_handler(int irq, void *arg)
|
||||||
|
|
|
@ -175,13 +175,15 @@ static void artpec6_pcie_enable_interrupts(struct artpec6_pcie *artpec6_pcie)
|
||||||
dw_pcie_msi_init(pp);
|
dw_pcie_msi_init(pp);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void artpec6_pcie_host_init(struct pcie_port *pp)
|
static int artpec6_pcie_host_init(struct pcie_port *pp)
|
||||||
{
|
{
|
||||||
struct dw_pcie *pci = to_dw_pcie_from_pp(pp);
|
struct dw_pcie *pci = to_dw_pcie_from_pp(pp);
|
||||||
struct artpec6_pcie *artpec6_pcie = to_artpec6_pcie(pci);
|
struct artpec6_pcie *artpec6_pcie = to_artpec6_pcie(pci);
|
||||||
|
|
||||||
artpec6_pcie_establish_link(artpec6_pcie);
|
artpec6_pcie_establish_link(artpec6_pcie);
|
||||||
artpec6_pcie_enable_interrupts(artpec6_pcie);
|
artpec6_pcie_enable_interrupts(artpec6_pcie);
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct dw_pcie_host_ops artpec6_pcie_host_ops = {
|
static const struct dw_pcie_host_ops artpec6_pcie_host_ops = {
|
||||||
|
|
|
@ -71,9 +71,9 @@ irqreturn_t dw_handle_msi_irq(struct pcie_port *pp)
|
||||||
while ((pos = find_next_bit((unsigned long *) &val, 32,
|
while ((pos = find_next_bit((unsigned long *) &val, 32,
|
||||||
pos)) != 32) {
|
pos)) != 32) {
|
||||||
irq = irq_find_mapping(pp->irq_domain, i * 32 + pos);
|
irq = irq_find_mapping(pp->irq_domain, i * 32 + pos);
|
||||||
|
generic_handle_irq(irq);
|
||||||
dw_pcie_wr_own_conf(pp, PCIE_MSI_INTR0_STATUS + i * 12,
|
dw_pcie_wr_own_conf(pp, PCIE_MSI_INTR0_STATUS + i * 12,
|
||||||
4, 1 << pos);
|
4, 1 << pos);
|
||||||
generic_handle_irq(irq);
|
|
||||||
pos++;
|
pos++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -401,8 +401,11 @@ int dw_pcie_host_init(struct pcie_port *pp)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pp->ops->host_init)
|
if (pp->ops->host_init) {
|
||||||
pp->ops->host_init(pp);
|
ret = pp->ops->host_init(pp);
|
||||||
|
if (ret)
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
|
|
||||||
pp->root_bus_nr = pp->busn->start;
|
pp->root_bus_nr = pp->busn->start;
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,7 @@ static irqreturn_t dw_plat_pcie_msi_irq_handler(int irq, void *arg)
|
||||||
return dw_handle_msi_irq(pp);
|
return dw_handle_msi_irq(pp);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void dw_plat_pcie_host_init(struct pcie_port *pp)
|
static int dw_plat_pcie_host_init(struct pcie_port *pp)
|
||||||
{
|
{
|
||||||
struct dw_pcie *pci = to_dw_pcie_from_pp(pp);
|
struct dw_pcie *pci = to_dw_pcie_from_pp(pp);
|
||||||
|
|
||||||
|
@ -44,6 +44,8 @@ static void dw_plat_pcie_host_init(struct pcie_port *pp)
|
||||||
|
|
||||||
if (IS_ENABLED(CONFIG_PCI_MSI))
|
if (IS_ENABLED(CONFIG_PCI_MSI))
|
||||||
dw_pcie_msi_init(pp);
|
dw_pcie_msi_init(pp);
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct dw_pcie_host_ops dw_plat_pcie_host_ops = {
|
static const struct dw_pcie_host_ops dw_plat_pcie_host_ops = {
|
||||||
|
|
|
@ -107,8 +107,9 @@ static void dw_pcie_writel_ob_unroll(struct dw_pcie *pci, u32 index, u32 reg,
|
||||||
dw_pcie_writel_dbi(pci, offset + reg, val);
|
dw_pcie_writel_dbi(pci, offset + reg, val);
|
||||||
}
|
}
|
||||||
|
|
||||||
void dw_pcie_prog_outbound_atu_unroll(struct dw_pcie *pci, int index, int type,
|
static void dw_pcie_prog_outbound_atu_unroll(struct dw_pcie *pci, int index,
|
||||||
u64 cpu_addr, u64 pci_addr, u32 size)
|
int type, u64 cpu_addr,
|
||||||
|
u64 pci_addr, u32 size)
|
||||||
{
|
{
|
||||||
u32 retries, val;
|
u32 retries, val;
|
||||||
|
|
||||||
|
@ -177,7 +178,7 @@ void dw_pcie_prog_outbound_atu(struct dw_pcie *pci, int index, int type,
|
||||||
*/
|
*/
|
||||||
for (retries = 0; retries < LINK_WAIT_MAX_IATU_RETRIES; retries++) {
|
for (retries = 0; retries < LINK_WAIT_MAX_IATU_RETRIES; retries++) {
|
||||||
val = dw_pcie_readl_dbi(pci, PCIE_ATU_CR2);
|
val = dw_pcie_readl_dbi(pci, PCIE_ATU_CR2);
|
||||||
if (val == PCIE_ATU_ENABLE)
|
if (val & PCIE_ATU_ENABLE)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
usleep_range(LINK_WAIT_IATU_MIN, LINK_WAIT_IATU_MAX);
|
usleep_range(LINK_WAIT_IATU_MIN, LINK_WAIT_IATU_MAX);
|
||||||
|
@ -200,8 +201,9 @@ static void dw_pcie_writel_ib_unroll(struct dw_pcie *pci, u32 index, u32 reg,
|
||||||
dw_pcie_writel_dbi(pci, offset + reg, val);
|
dw_pcie_writel_dbi(pci, offset + reg, val);
|
||||||
}
|
}
|
||||||
|
|
||||||
int dw_pcie_prog_inbound_atu_unroll(struct dw_pcie *pci, int index, int bar,
|
static int dw_pcie_prog_inbound_atu_unroll(struct dw_pcie *pci, int index,
|
||||||
u64 cpu_addr, enum dw_pcie_as_type as_type)
|
int bar, u64 cpu_addr,
|
||||||
|
enum dw_pcie_as_type as_type)
|
||||||
{
|
{
|
||||||
int type;
|
int type;
|
||||||
u32 retries, val;
|
u32 retries, val;
|
||||||
|
|
|
@ -134,7 +134,7 @@ struct dw_pcie_host_ops {
|
||||||
unsigned int devfn, int where, int size, u32 *val);
|
unsigned int devfn, int where, int size, u32 *val);
|
||||||
int (*wr_other_conf)(struct pcie_port *pp, struct pci_bus *bus,
|
int (*wr_other_conf)(struct pcie_port *pp, struct pci_bus *bus,
|
||||||
unsigned int devfn, int where, int size, u32 val);
|
unsigned int devfn, int where, int size, u32 val);
|
||||||
void (*host_init)(struct pcie_port *pp);
|
int (*host_init)(struct pcie_port *pp);
|
||||||
void (*msi_set_irq)(struct pcie_port *pp, int irq);
|
void (*msi_set_irq)(struct pcie_port *pp, int irq);
|
||||||
void (*msi_clear_irq)(struct pcie_port *pp, int irq);
|
void (*msi_clear_irq)(struct pcie_port *pp, int irq);
|
||||||
phys_addr_t (*get_msi_addr)(struct pcie_port *pp);
|
phys_addr_t (*get_msi_addr)(struct pcie_port *pp);
|
||||||
|
|
|
@ -430,9 +430,11 @@ static int kirin_pcie_establish_link(struct pcie_port *pp)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void kirin_pcie_host_init(struct pcie_port *pp)
|
static int kirin_pcie_host_init(struct pcie_port *pp)
|
||||||
{
|
{
|
||||||
kirin_pcie_establish_link(pp);
|
kirin_pcie_establish_link(pp);
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct dw_pcie_ops kirin_dw_pcie_ops = {
|
static struct dw_pcie_ops kirin_dw_pcie_ops = {
|
||||||
|
|
|
@ -124,6 +124,7 @@ struct qcom_pcie_ops {
|
||||||
int (*init)(struct qcom_pcie *pcie);
|
int (*init)(struct qcom_pcie *pcie);
|
||||||
int (*post_init)(struct qcom_pcie *pcie);
|
int (*post_init)(struct qcom_pcie *pcie);
|
||||||
void (*deinit)(struct qcom_pcie *pcie);
|
void (*deinit)(struct qcom_pcie *pcie);
|
||||||
|
void (*post_deinit)(struct qcom_pcie *pcie);
|
||||||
void (*ltssm_enable)(struct qcom_pcie *pcie);
|
void (*ltssm_enable)(struct qcom_pcie *pcie);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -517,13 +518,19 @@ static void qcom_pcie_deinit_v2(struct qcom_pcie *pcie)
|
||||||
{
|
{
|
||||||
struct qcom_pcie_resources_v2 *res = &pcie->res.v2;
|
struct qcom_pcie_resources_v2 *res = &pcie->res.v2;
|
||||||
|
|
||||||
clk_disable_unprepare(res->pipe_clk);
|
|
||||||
clk_disable_unprepare(res->slave_clk);
|
clk_disable_unprepare(res->slave_clk);
|
||||||
clk_disable_unprepare(res->master_clk);
|
clk_disable_unprepare(res->master_clk);
|
||||||
clk_disable_unprepare(res->cfg_clk);
|
clk_disable_unprepare(res->cfg_clk);
|
||||||
clk_disable_unprepare(res->aux_clk);
|
clk_disable_unprepare(res->aux_clk);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void qcom_pcie_post_deinit_v2(struct qcom_pcie *pcie)
|
||||||
|
{
|
||||||
|
struct qcom_pcie_resources_v2 *res = &pcie->res.v2;
|
||||||
|
|
||||||
|
clk_disable_unprepare(res->pipe_clk);
|
||||||
|
}
|
||||||
|
|
||||||
static int qcom_pcie_init_v2(struct qcom_pcie *pcie)
|
static int qcom_pcie_init_v2(struct qcom_pcie *pcie)
|
||||||
{
|
{
|
||||||
struct qcom_pcie_resources_v2 *res = &pcie->res.v2;
|
struct qcom_pcie_resources_v2 *res = &pcie->res.v2;
|
||||||
|
@ -891,7 +898,7 @@ static int qcom_pcie_link_up(struct dw_pcie *pci)
|
||||||
return !!(val & PCI_EXP_LNKSTA_DLLLA);
|
return !!(val & PCI_EXP_LNKSTA_DLLLA);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void qcom_pcie_host_init(struct pcie_port *pp)
|
static int qcom_pcie_host_init(struct pcie_port *pp)
|
||||||
{
|
{
|
||||||
struct dw_pcie *pci = to_dw_pcie_from_pp(pp);
|
struct dw_pcie *pci = to_dw_pcie_from_pp(pp);
|
||||||
struct qcom_pcie *pcie = to_qcom_pcie(pci);
|
struct qcom_pcie *pcie = to_qcom_pcie(pci);
|
||||||
|
@ -901,14 +908,17 @@ static void qcom_pcie_host_init(struct pcie_port *pp)
|
||||||
|
|
||||||
ret = pcie->ops->init(pcie);
|
ret = pcie->ops->init(pcie);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto err_deinit;
|
return ret;
|
||||||
|
|
||||||
ret = phy_power_on(pcie->phy);
|
ret = phy_power_on(pcie->phy);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto err_deinit;
|
goto err_deinit;
|
||||||
|
|
||||||
if (pcie->ops->post_init)
|
if (pcie->ops->post_init) {
|
||||||
pcie->ops->post_init(pcie);
|
ret = pcie->ops->post_init(pcie);
|
||||||
|
if (ret)
|
||||||
|
goto err_disable_phy;
|
||||||
|
}
|
||||||
|
|
||||||
dw_pcie_setup_rc(pp);
|
dw_pcie_setup_rc(pp);
|
||||||
|
|
||||||
|
@ -921,12 +931,17 @@ static void qcom_pcie_host_init(struct pcie_port *pp)
|
||||||
if (ret)
|
if (ret)
|
||||||
goto err;
|
goto err;
|
||||||
|
|
||||||
return;
|
return 0;
|
||||||
err:
|
err:
|
||||||
qcom_ep_reset_assert(pcie);
|
qcom_ep_reset_assert(pcie);
|
||||||
|
if (pcie->ops->post_deinit)
|
||||||
|
pcie->ops->post_deinit(pcie);
|
||||||
|
err_disable_phy:
|
||||||
phy_power_off(pcie->phy);
|
phy_power_off(pcie->phy);
|
||||||
err_deinit:
|
err_deinit:
|
||||||
pcie->ops->deinit(pcie);
|
pcie->ops->deinit(pcie);
|
||||||
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int qcom_pcie_rd_own_conf(struct pcie_port *pp, int where, int size,
|
static int qcom_pcie_rd_own_conf(struct pcie_port *pp, int where, int size,
|
||||||
|
@ -969,6 +984,7 @@ static const struct qcom_pcie_ops ops_v2 = {
|
||||||
.init = qcom_pcie_init_v2,
|
.init = qcom_pcie_init_v2,
|
||||||
.post_init = qcom_pcie_post_init_v2,
|
.post_init = qcom_pcie_post_init_v2,
|
||||||
.deinit = qcom_pcie_deinit_v2,
|
.deinit = qcom_pcie_deinit_v2,
|
||||||
|
.post_deinit = qcom_pcie_post_deinit_v2,
|
||||||
.ltssm_enable = qcom_pcie_v2_ltssm_enable,
|
.ltssm_enable = qcom_pcie_v2_ltssm_enable,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -177,13 +177,15 @@ static int spear13xx_pcie_link_up(struct dw_pcie *pci)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void spear13xx_pcie_host_init(struct pcie_port *pp)
|
static int spear13xx_pcie_host_init(struct pcie_port *pp)
|
||||||
{
|
{
|
||||||
struct dw_pcie *pci = to_dw_pcie_from_pp(pp);
|
struct dw_pcie *pci = to_dw_pcie_from_pp(pp);
|
||||||
struct spear13xx_pcie *spear13xx_pcie = to_spear13xx_pcie(pci);
|
struct spear13xx_pcie *spear13xx_pcie = to_spear13xx_pcie(pci);
|
||||||
|
|
||||||
spear13xx_pcie_establish_link(spear13xx_pcie);
|
spear13xx_pcie_establish_link(spear13xx_pcie);
|
||||||
spear13xx_pcie_enable_interrupts(spear13xx_pcie);
|
spear13xx_pcie_enable_interrupts(spear13xx_pcie);
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct dw_pcie_host_ops spear13xx_pcie_host_ops = {
|
static const struct dw_pcie_host_ops spear13xx_pcie_host_ops = {
|
||||||
|
|
Loading…
Reference in New Issue