[U-Boot] [PATCH 5/7 v3] pci/layerscape: add stream ID allocator
Stuart Yoder
stuart.yoder at nxp.com
Fri Feb 26 17:32:00 CET 2016
From: Stuart Yoder <stuart.yoder at nxp.com>
add a function to return the next available stream ID
for PCI
Signed-off-by: Stuart Yoder <stuart.yoder at nxp.com>
---
-v3
-return 0xffffffff on error
drivers/pci/pcie_layerscape.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/drivers/pci/pcie_layerscape.c b/drivers/pci/pcie_layerscape.c
index 8b1e6fb..230aec4 100644
--- a/drivers/pci/pcie_layerscape.c
+++ b/drivers/pci/pcie_layerscape.c
@@ -510,6 +510,17 @@ static void ls_pcie_lut_set_mapping(struct ls_pcie *pcie, int index, u32 devid,
writel(streamid | PCIE_LUT_ENABLE, lut + PCIE_LUT_LDR(index));
}
+/* returns the next available streamid */
+static u32 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 0xffffffff;
+
+ return next_stream_id++;
+}
+
int ls_pcie_init_ctrl(int busno, enum srds_prtcl dev, struct ls_pcie_info *info)
{
struct ls_pcie *pcie;
--
1.7.9.5
More information about the U-Boot
mailing list