• Home
  • Raw
  • Download

Lines Matching refs:cntlr

78 static int HiDmacIsrErrProc(struct DmaCntlr *cntlr, uint16_t chan)  in HiDmacIsrErrProc()  argument
82 chanErrStats[ERROR_STATUS_NUM_0] = OSAL_READL(cntlr->remapBase + HIDMAC_INT_ERR1_OFFSET); in HiDmacIsrErrProc()
84 chanErrStats[ERROR_STATUS_NUM_1] = OSAL_READL(cntlr->remapBase + HIDMAC_INT_ERR2_OFFSET); in HiDmacIsrErrProc()
86 chanErrStats[ERROR_STATUS_NUM_2] = OSAL_READL(cntlr->remapBase + HIDMAC_INT_ERR3_OFFSET); in HiDmacIsrErrProc()
93 OSAL_WRITEL(1 << chan, cntlr->remapBase + HIDMAC_INT_ERR1_RAW_OFFSET); in HiDmacIsrErrProc()
94 … HDF_LOGE("HIDMAC_INT_ERR1_RAW = 0x%x", OSAL_READL(cntlr->remapBase + HIDMAC_INT_ERR1_RAW_OFFSET)); in HiDmacIsrErrProc()
95 OSAL_WRITEL(1 << chan, cntlr->remapBase + HIDMAC_INT_ERR2_RAW_OFFSET); in HiDmacIsrErrProc()
96 … HDF_LOGE("HIDMAC_INT_ERR2_RAW = 0x%x", OSAL_READL(cntlr->remapBase + HIDMAC_INT_ERR2_RAW_OFFSET)); in HiDmacIsrErrProc()
97 OSAL_WRITEL(1 << chan, cntlr->remapBase + HIDMAC_INT_ERR3_RAW_OFFSET); in HiDmacIsrErrProc()
98 … HDF_LOGE("HIDMAC_INT_ERR3_RAW = 0x%x", OSAL_READL(cntlr->remapBase + HIDMAC_INT_ERR3_RAW_OFFSET)); in HiDmacIsrErrProc()
104 static int HiDmacGetChanStat(struct DmaCntlr *cntlr, uint16_t chan) in HiDmacGetChanStat() argument
110 chanStatus = OSAL_READL(cntlr->remapBase + HIDMAC_INT_STAT_OFFSET); in HiDmacGetChanStat()
112 chanTcStatus = OSAL_READL(cntlr->remapBase + HIDMAC_INT_TC1_OFFSET); in HiDmacGetChanStat()
118 OSAL_WRITEL(chanTcStatus << chan, cntlr->remapBase + HIDMAC_INT_TC1_RAW_OFFSET); in HiDmacGetChanStat()
121 ret = HiDmacIsrErrProc(cntlr, chan); in HiDmacGetChanStat()
126 chanTcStatus = OSAL_READL(cntlr->remapBase + HIDMAC_INT_TC2_OFFSET); in HiDmacGetChanStat()
132 OSAL_WRITEL(chanTcStatus << chan, cntlr->remapBase + HIDMAC_INT_TC2_RAW_OFFSET); in HiDmacGetChanStat()
169 static int32_t HiDmacGetChanInfo(struct DmaCntlr *cntlr, struct DmacChanInfo *chanInfo, struct Dmac… in HiDmacGetChanInfo() argument
175 if (cntlr == NULL) { in HiDmacGetChanInfo()
205 static inline void HiDmacDisable(struct DmaCntlr *cntlr, uint16_t channel) in HiDmacDisable() argument
207 if (cntlr != NULL) { in HiDmacDisable()
208 OSAL_WRITEL(HIDMAC_CX_DISABLE, cntlr->remapBase + HIDMAC_CX_CFG_OFFSET(channel)); in HiDmacDisable()
216 static int32_t HiDmacStartM2M(struct DmaCntlr *cntlr, struct DmacChanInfo *chanInfo, in HiDmacStartM2M() argument
219 if (cntlr == NULL) { in HiDmacStartM2M()
228 …OSAL_WRITEL(psrc & HIDMAC_32BITS_MASK, cntlr->remapBase + HIDMAC_CX_SRC_OFFSET_L(chanInfo->channel… in HiDmacStartM2M()
231 cntlr->remapBase + HIDMAC_CX_SRC_OFFSET_H(chanInfo->channel)); in HiDmacStartM2M()
233 OSAL_WRITEL(0, cntlr->remapBase + HIDMAC_CX_SRC_OFFSET_H(chanInfo->channel)); in HiDmacStartM2M()
236 …OSAL_WRITEL(pdst & HIDMAC_32BITS_MASK, cntlr->remapBase + HIDMAC_CX_DST_OFFSET_L(chanInfo->channel… in HiDmacStartM2M()
239 cntlr->remapBase + HIDMAC_CX_DST_OFFSET_H(chanInfo->channel)); in HiDmacStartM2M()
241 OSAL_WRITEL(0, cntlr->remapBase + HIDMAC_CX_DST_OFFSET_H(chanInfo->channel)); in HiDmacStartM2M()
244 OSAL_WRITEL(0, cntlr->remapBase + HIDMAC_CX_LLI_OFFSET_L(chanInfo->channel)); in HiDmacStartM2M()
245 OSAL_WRITEL(len, cntlr->remapBase + HIDMAC_CX_CNT0_OFFSET(chanInfo->channel)); in HiDmacStartM2M()
246 OSAL_WRITEL(HIDMAC_CX_CFG_M2M, cntlr->remapBase + HIDMAC_CX_CFG_OFFSET(chanInfo->channel)); in HiDmacStartM2M()
250 static int32_t HiDmacStartLli(struct DmaCntlr *cntlr, struct DmacChanInfo *chanInfo) in HiDmacStartLli() argument
254 if (cntlr == NULL) { in HiDmacStartLli()
264 …OSAL_WRITEL(plli->srcAddr & HIDMAC_32BITS_MASK, cntlr->remapBase + HIDMAC_CX_SRC_OFFSET_L(chanInfo… in HiDmacStartLli()
267 cntlr->remapBase + HIDMAC_CX_SRC_OFFSET_H(chanInfo->channel)); in HiDmacStartLli()
269 OSAL_WRITEL(0, cntlr->remapBase + HIDMAC_CX_SRC_OFFSET_H(chanInfo->channel)); in HiDmacStartLli()
272 …OSAL_WRITEL(plli->destAddr & HIDMAC_32BITS_MASK, cntlr->remapBase + HIDMAC_CX_DST_OFFSET_L(chanInf… in HiDmacStartLli()
275 cntlr->remapBase + HIDMAC_CX_DST_OFFSET_H(chanInfo->channel)); in HiDmacStartLli()
277 OSAL_WRITEL(0, cntlr->remapBase + HIDMAC_CX_DST_OFFSET_H(chanInfo->channel)); in HiDmacStartLli()
280 …OSAL_WRITEL(plli->nextLli & HIDMAC_32BITS_MASK, cntlr->remapBase + HIDMAC_CX_LLI_OFFSET_L(chanInfo… in HiDmacStartLli()
283 cntlr->remapBase + HIDMAC_CX_LLI_OFFSET_H(chanInfo->channel)); in HiDmacStartLli()
285 OSAL_WRITEL(0, cntlr->remapBase + HIDMAC_CX_LLI_OFFSET_H(chanInfo->channel)); in HiDmacStartLli()
288 OSAL_WRITEL(plli->count, cntlr->remapBase + HIDMAC_CX_CNT0_OFFSET(chanInfo->channel)); in HiDmacStartLli()
290 …OSAL_WRITEL(plli->config | HIDMAC_CX_CFG_CHN_START, cntlr->remapBase + HIDMAC_CX_CFG_OFFSET(chanIn… in HiDmacStartLli()
294 static uintptr_t HiDmacGetCurrDstAddr(struct DmaCntlr *cntlr, uint16_t channel) in HiDmacGetCurrDstAddr() argument
296 if (cntlr == NULL || channel >= HIDMAC_CHANNEL_NUM) { in HiDmacGetCurrDstAddr()
299 return OSAL_READL(cntlr->remapBase + HIDMAC_CX_CUR_DST_OFFSET(channel)); in HiDmacGetCurrDstAddr()
328 static int32_t Hi35xxDmacInit(struct DmaCntlr *cntlr) in Hi35xxDmacInit() argument
332 HiDmacClkEn(cntlr->index); in Hi35xxDmacInit()
333 HiDmacUnReset(cntlr->index); in Hi35xxDmacInit()
335 OSAL_WRITEL(HIDMAC_ALL_CHAN_CLR, cntlr->remapBase + HIDMAC_INT_TC1_RAW_OFFSET); in Hi35xxDmacInit()
336 OSAL_WRITEL(HIDMAC_ALL_CHAN_CLR, cntlr->remapBase + HIDMAC_INT_TC2_RAW_OFFSET); in Hi35xxDmacInit()
337 OSAL_WRITEL(HIDMAC_ALL_CHAN_CLR, cntlr->remapBase + HIDMAC_INT_ERR1_RAW_OFFSET); in Hi35xxDmacInit()
338 OSAL_WRITEL(HIDMAC_ALL_CHAN_CLR, cntlr->remapBase + HIDMAC_INT_ERR2_RAW_OFFSET); in Hi35xxDmacInit()
339 OSAL_WRITEL(HIDMAC_ALL_CHAN_CLR, cntlr->remapBase + HIDMAC_INT_ERR3_RAW_OFFSET); in Hi35xxDmacInit()
340 OSAL_WRITEL(HIDMAC_INT_ENABLE_ALL_CHAN, cntlr->remapBase + HIDMAC_INT_TC1_MASK_OFFSET); in Hi35xxDmacInit()
341 OSAL_WRITEL(HIDMAC_INT_ENABLE_ALL_CHAN, cntlr->remapBase + HIDMAC_INT_TC2_MASK_OFFSET); in Hi35xxDmacInit()
342 OSAL_WRITEL(HIDMAC_INT_ENABLE_ALL_CHAN, cntlr->remapBase + HIDMAC_INT_ERR1_MASK_OFFSET); in Hi35xxDmacInit()
343 OSAL_WRITEL(HIDMAC_INT_ENABLE_ALL_CHAN, cntlr->remapBase + HIDMAC_INT_ERR2_MASK_OFFSET); in Hi35xxDmacInit()
344 OSAL_WRITEL(HIDMAC_INT_ENABLE_ALL_CHAN, cntlr->remapBase + HIDMAC_INT_ERR3_MASK_OFFSET); in Hi35xxDmacInit()
374 static int32_t HiDmacParseHcs(struct DmaCntlr *cntlr, const struct DeviceResourceNode *node) in HiDmacParseHcs() argument
379 if (cntlr == NULL) { in HiDmacParseHcs()
388 ret = drsOps->GetUint32(node, "reg_pbase", &cntlr->phyBase, 0); in HiDmacParseHcs()
393 cntlr->remapBase = OsalIoRemap((unsigned long)cntlr->phyBase, (unsigned long)cntlr->regSize); in HiDmacParseHcs()
395 ret = drsOps->GetUint32(node, "reg_size", &cntlr->regSize, 0); in HiDmacParseHcs()
400 ret = drsOps->GetUint16(node, "index", &cntlr->index, 0); in HiDmacParseHcs()
405 ret = drsOps->GetUint32(node, "irq", &cntlr->irq, 0); in HiDmacParseHcs()
410 ret = drsOps->GetUint32(node, "max_transfer_size", &cntlr->maxTransSize, 0); in HiDmacParseHcs()
415 ret = drsOps->GetUint16(node, "channel_num", &cntlr->channelNum, 0); in HiDmacParseHcs()
421cntlr->phyBase, cntlr->regSize, cntlr->index, cntlr->irq, cntlr->maxTransSize, cntlr->channelNum); in HiDmacParseHcs()
427 struct DmaCntlr *cntlr = NULL; in HiDmacBind() local
429 cntlr = DmaCntlrCreate(device); in HiDmacBind()
430 if (cntlr == NULL) { in HiDmacBind()
433 cntlr->getChanInfo = HiDmacGetChanInfo; in HiDmacBind()
434 cntlr->dmacCacheFlush = HiDmacCacheFlush; in HiDmacBind()
435 cntlr->dmacCacheInv = HiDmacCacheInv; in HiDmacBind()
436 cntlr->dmaChanEnable = HiDmacStartLli; in HiDmacBind()
437 cntlr->dmaM2mChanEnable = HiDmacStartM2M; in HiDmacBind()
438 cntlr->dmacChanDisable = HiDmacDisable; in HiDmacBind()
439 cntlr->dmacVaddrToPaddr = HiDmacVaddrToPaddr; in HiDmacBind()
440 cntlr->dmacPaddrToVaddr = HiDmacPaddrToVaddr; in HiDmacBind()
441 cntlr->dmacGetChanStatus = HiDmacGetChanStat; in HiDmacBind()
442 cntlr->dmacGetCurrDestAddr = HiDmacGetCurrDstAddr; in HiDmacBind()
443 device->service = &cntlr->service; in HiDmacBind()
450 struct DmaCntlr *cntlr = NULL; in HiDmacInit() local
457 cntlr = CONTAINER_OF(device->service, struct DmaCntlr, service); in HiDmacInit()
458 ret = HiDmacParseHcs(cntlr, device->property); in HiDmacInit()
462 ret = Hi35xxDmacInit(cntlr); in HiDmacInit()
466 return DmacCntlrAdd(cntlr); in HiDmacInit()
471 struct DmaCntlr *cntlr = NULL; in HiDmacRelease() local
476 cntlr = CONTAINER_OF(device->service, struct DmaCntlr, service); in HiDmacRelease()
477 DmacCntlrRemove(cntlr); in HiDmacRelease()
478 DmaCntlrDestroy(cntlr); in HiDmacRelease()