diff options
author | David Sniatkiwicz <davidsn@marvell.com> | 2018-01-23 10:17:04 +0200 |
---|---|---|
committer | Kostya Porotchkin <kostap@marvell.com> | 2018-03-27 18:10:22 +0300 |
commit | e887e8f1cdcb6440f455c256e26d99a1e9c6449a (patch) | |
tree | b27c42fd78595f832023d80276ea4e9c4511d75e | |
parent | 5b0cc3da7339499a6c731ddd3278351e06902ef3 (diff) |
stream-id: cp110: fix initialization of STREAM-ID
This patch fixes stream id initialization for CP110.
- Initialize the Intr-Stream-ID in addition to the Func-Stream-ID.
Change-Id: Iab777d0660159cd4d138702b773e7310f11a5fdc
Signed-off-by: David Sniatkiwicz <davidsn@marvell.com>
Reviewed-on: http://vgitil04.il.marvell.com:8080/49299
Tested-by: iSoC Platform CI <ykjenk@marvell.com>
Reviewed-by: Hanna Hawa <hannah@marvell.com>
Reviewed-by: Kostya Porotchkin <kostap@marvell.com>
-rw-r--r-- | drivers/marvell/mochi/cp110_setup.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/drivers/marvell/mochi/cp110_setup.c b/drivers/marvell/mochi/cp110_setup.c index 5446de0f..c62dd820 100644 --- a/drivers/marvell/mochi/cp110_setup.c +++ b/drivers/marvell/mochi/cp110_setup.c @@ -296,16 +296,26 @@ static void cp110_pcie_clk_cfg(uintptr_t base) /* Set a unique stream id for all DMA capable devices */ static void cp110_stream_id_init(uintptr_t base) { - int i = 0; + int i = 0, sata_stream_id = -1; uint32_t stream_id = MAX_PCIE_STREAM_ID; while (stream_id_reg[i]) { /* SATA port 0/1 are in the same SATA unit, and they should use ** the same STREAM ID number */ - if (stream_id_reg[i] == SATA_0_STREAM_ID_REG) - mmio_write_32(base + stream_id_reg[i++], stream_id); - else - mmio_write_32(base + stream_id_reg[i++], stream_id++); + if (((stream_id_reg[i] == SATA_0_STREAM_ID_REG) || + (stream_id_reg[i] == SATA_1_STREAM_ID_REG)) && + sata_stream_id != -1) { + mmio_write_32(base + stream_id_reg[i], + sata_stream_id << 16 | sata_stream_id); + } else { + mmio_write_32(base + stream_id_reg[i], + stream_id << 16 | stream_id); + if ((stream_id_reg[i] == SATA_0_STREAM_ID_REG) || + (stream_id_reg[i] == SATA_1_STREAM_ID_REG)) + sata_stream_id = stream_id; + stream_id++; + } + i++; } } |