[PATCH 06/15] habanalabs: set DMA0 completion to SOB 1007

From: Oded Gabbay
Date: Thu Feb 28 2019 - 03:46:46 EST


This patch fix a bug where DMA channel 0 completion address wasn't
initialized by the driver.

The patch sets the address to Sync Object no. 1007

Signed-off-by: Oded Gabbay <oded.gabbay@xxxxxxxxx>
---
drivers/misc/habanalabs/goya/goya.c | 14 +++++++-------
.../habanalabs/include/goya/asic_reg/goya_regs.h | 1 +
2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/drivers/misc/habanalabs/goya/goya.c b/drivers/misc/habanalabs/goya/goya.c
index 6f0075c4e935..578e4bdc3a49 100644
--- a/drivers/misc/habanalabs/goya/goya.c
+++ b/drivers/misc/habanalabs/goya/goya.c
@@ -1036,15 +1036,15 @@ static void goya_init_dma_ch(struct hl_device *hdev, int dma_id)
WREG32(mmDMA_CH_0_ERRMSG_WDATA + reg_off,
GOYA_ASYNC_EVENT_ID_DMA0_CH + dma_id);

- if (dma_id) {
+ if (dma_id)
sob_addr = CFG_BASE + mmSYNC_MNGR_SOB_OBJ_1000 +
(dma_id - 1) * 4;
- WREG32(mmDMA_CH_0_WR_COMP_ADDR_LO + reg_off,
- lower_32_bits(sob_addr));
- WREG32(mmDMA_CH_0_WR_COMP_ADDR_HI + reg_off,
- upper_32_bits(sob_addr));
- WREG32(mmDMA_CH_0_WR_COMP_WDATA + reg_off, 0x80000001);
- }
+ else
+ sob_addr = CFG_BASE + mmSYNC_MNGR_SOB_OBJ_1007;
+
+ WREG32(mmDMA_CH_0_WR_COMP_ADDR_LO + reg_off, lower_32_bits(sob_addr));
+ WREG32(mmDMA_CH_0_WR_COMP_ADDR_HI + reg_off, upper_32_bits(sob_addr));
+ WREG32(mmDMA_CH_0_WR_COMP_WDATA + reg_off, 0x80000001);
}

/*
diff --git a/drivers/misc/habanalabs/include/goya/asic_reg/goya_regs.h b/drivers/misc/habanalabs/include/goya/asic_reg/goya_regs.h
index a3c746849f02..6cb0b6e54d41 100644
--- a/drivers/misc/habanalabs/include/goya/asic_reg/goya_regs.h
+++ b/drivers/misc/habanalabs/include/goya/asic_reg/goya_regs.h
@@ -108,6 +108,7 @@
#define mmSYNC_MNGR_MON_PAY_ADDRL_0 0x113000
#define mmSYNC_MNGR_SOB_OBJ_0 0x112000
#define mmSYNC_MNGR_SOB_OBJ_1000 0x112FA0
+#define mmSYNC_MNGR_SOB_OBJ_1007 0x112FBC
#define mmSYNC_MNGR_SOB_OBJ_1023 0x112FFC
#define mmSYNC_MNGR_MON_STATUS_0 0x114000
#define mmSYNC_MNGR_MON_STATUS_255 0x1143FC
--
2.17.1