summaryrefslogtreecommitdiff
path: root/drivers/pci/pcie_layerscape_fixup.c
diff options
context:
space:
mode:
authorWasim Khan <wasim.khan@nxp.com>2020-01-06 15:05:59 +0300
committerPriyanka Jain <priyanka.jain@nxp.com>2020-01-24 11:58:26 +0300
commitd20eb7a6db2e297cd16a85cdbef9c183abdade1c (patch)
tree45988ad3b5310d5f9ff182a11e6f550440d2ecaa /drivers/pci/pcie_layerscape_fixup.c
parent1185b229cca55a5ce3ee7bb35b203f788254f1a1 (diff)
downloadu-boot-d20eb7a6db2e297cd16a85cdbef9c183abdade1c.tar.xz
pci: layerscape: Move streamId allocation to common device tree fixup
Move streamId allocation to layerscape common device tree fixup. Calculate streamId based on SoC variant. Signed-off-by: Wasim Khan <wasim.khan@nxp.com> Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
Diffstat (limited to 'drivers/pci/pcie_layerscape_fixup.c')
-rw-r--r--drivers/pci/pcie_layerscape_fixup.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/drivers/pci/pcie_layerscape_fixup.c b/drivers/pci/pcie_layerscape_fixup.c
index e77404cd01..56de6d97be 100644
--- a/drivers/pci/pcie_layerscape_fixup.c
+++ b/drivers/pci/pcie_layerscape_fixup.c
@@ -31,17 +31,6 @@ static int ls_pcie_next_lut_index(struct ls_pcie *pcie)
return -ENOSPC; /* LUT is full */
}
-/* returns the next available streamid for pcie, -errno if failed */
-static int ls_pcie_next_streamid(void)
-{
- static int next_stream_id = FSL_PEX_STREAM_ID_START;
-
- if (next_stream_id > FSL_PEX_STREAM_ID_END)
- return -EINVAL;
-
- return next_stream_id++;
-}
-
static void lut_writel(struct ls_pcie *pcie, unsigned int value,
unsigned int offset)
{
@@ -192,10 +181,12 @@ static void fdt_fixup_pcie_ls(void *blob)
bus = bus->parent;
pcie = dev_get_priv(bus);
- streamid = ls_pcie_next_streamid();
+ streamid = pcie_next_streamid(pcie->stream_id_cur, pcie->idx);
if (streamid < 0) {
debug("ERROR: no stream ids free\n");
continue;
+ } else {
+ pcie->stream_id_cur++;
}
index = ls_pcie_next_lut_index(pcie);