Commit 5ae0beb6 authored by Dave Jiang's avatar Dave Jiang Committed by Jon Mason

NTB: Enable link for Intel root port mode in probe

Link training should be enabled in the driver probe for root port mode.
We should not have to wait for transport to be loaded for this to
happen.  Otherwise the ntb device will not show up on the transparent
bridge side of the link.
Signed-off-by: default avatarDave Jiang <dave.jiang@intel.com>
Signed-off-by: default avatarJon Mason <jdmason@kudzu.us>
parent 0f69a7df
...@@ -1317,6 +1317,9 @@ static int snb_poll_link(struct intel_ntb_dev *ndev) ...@@ -1317,6 +1317,9 @@ static int snb_poll_link(struct intel_ntb_dev *ndev)
static int snb_link_is_up(struct intel_ntb_dev *ndev) static int snb_link_is_up(struct intel_ntb_dev *ndev)
{ {
if (ndev->ntb.topo == NTB_TOPO_SEC)
return 1;
return NTB_LNK_STA_ACTIVE(ndev->lnk_sta); return NTB_LNK_STA_ACTIVE(ndev->lnk_sta);
} }
...@@ -1613,6 +1616,7 @@ static int snb_setup_b2b_mw(struct intel_ntb_dev *ndev, ...@@ -1613,6 +1616,7 @@ static int snb_setup_b2b_mw(struct intel_ntb_dev *ndev,
static int snb_init_ntb(struct intel_ntb_dev *ndev) static int snb_init_ntb(struct intel_ntb_dev *ndev)
{ {
int rc; int rc;
u32 ntb_ctl;
if (ndev->bar4_split) if (ndev->bar4_split)
ndev->mw_count = HSX_SPLIT_BAR_MW_COUNT; ndev->mw_count = HSX_SPLIT_BAR_MW_COUNT;
...@@ -1629,6 +1633,12 @@ static int snb_init_ntb(struct intel_ntb_dev *ndev) ...@@ -1629,6 +1633,12 @@ static int snb_init_ntb(struct intel_ntb_dev *ndev)
dev_err(ndev_dev(ndev), "NTB Primary config disabled\n"); dev_err(ndev_dev(ndev), "NTB Primary config disabled\n");
return -EINVAL; return -EINVAL;
} }
/* enable link to allow secondary side device to appear */
ntb_ctl = ioread32(ndev->self_mmio + ndev->reg->ntb_ctl);
ntb_ctl &= ~NTB_CTL_DISABLE;
iowrite32(ntb_ctl, ndev->self_mmio + ndev->reg->ntb_ctl);
/* use half the spads for the peer */ /* use half the spads for the peer */
ndev->spad_count >>= 1; ndev->spad_count >>= 1;
ndev->self_reg = &snb_pri_reg; ndev->self_reg = &snb_pri_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