imxdma            144 drivers/dma/imx-dma.c 	struct imxdma_engine		*imxdma;
imxdma            191 drivers/dma/imx-dma.c 	struct imxdma_engine	*imxdma;
imxdma            227 drivers/dma/imx-dma.c static inline int is_imx1_dma(struct imxdma_engine *imxdma)
imxdma            229 drivers/dma/imx-dma.c 	return imxdma->devtype == IMX1_DMA;
imxdma            232 drivers/dma/imx-dma.c static inline int is_imx27_dma(struct imxdma_engine *imxdma)
imxdma            234 drivers/dma/imx-dma.c 	return imxdma->devtype == IMX27_DMA;
imxdma            257 drivers/dma/imx-dma.c static void imx_dmav1_writel(struct imxdma_engine *imxdma, unsigned val,
imxdma            260 drivers/dma/imx-dma.c 	__raw_writel(val, imxdma->base + offset);
imxdma            263 drivers/dma/imx-dma.c static unsigned imx_dmav1_readl(struct imxdma_engine *imxdma, unsigned offset)
imxdma            265 drivers/dma/imx-dma.c 	return __raw_readl(imxdma->base + offset);
imxdma            270 drivers/dma/imx-dma.c 	struct imxdma_engine *imxdma = imxdmac->imxdma;
imxdma            272 drivers/dma/imx-dma.c 	if (is_imx27_dma(imxdma))
imxdma            284 drivers/dma/imx-dma.c 	struct imxdma_engine *imxdma = imxdmac->imxdma;
imxdma            293 drivers/dma/imx-dma.c 		imx_dmav1_writel(imxdma, sg->dma_address,
imxdma            296 drivers/dma/imx-dma.c 		imx_dmav1_writel(imxdma, sg->dma_address,
imxdma            299 drivers/dma/imx-dma.c 	imx_dmav1_writel(imxdma, now, DMA_CNTR(imxdmac->channel));
imxdma            301 drivers/dma/imx-dma.c 	dev_dbg(imxdma->dev, " %s channel: %d dst 0x%08x, src 0x%08x, "
imxdma            303 drivers/dma/imx-dma.c 		 imx_dmav1_readl(imxdma, DMA_DAR(imxdmac->channel)),
imxdma            304 drivers/dma/imx-dma.c 		 imx_dmav1_readl(imxdma, DMA_SAR(imxdmac->channel)),
imxdma            305 drivers/dma/imx-dma.c 		 imx_dmav1_readl(imxdma, DMA_CNTR(imxdmac->channel)));
imxdma            311 drivers/dma/imx-dma.c 	struct imxdma_engine *imxdma = imxdmac->imxdma;
imxdma            315 drivers/dma/imx-dma.c 	dev_dbg(imxdma->dev, "%s channel %d\n", __func__, channel);
imxdma            319 drivers/dma/imx-dma.c 	imx_dmav1_writel(imxdma, 1 << channel, DMA_DISR);
imxdma            320 drivers/dma/imx-dma.c 	imx_dmav1_writel(imxdma, imx_dmav1_readl(imxdma, DMA_DIMR) &
imxdma            322 drivers/dma/imx-dma.c 	imx_dmav1_writel(imxdma, imx_dmav1_readl(imxdma, DMA_CCR(channel)) |
imxdma            325 drivers/dma/imx-dma.c 	if (!is_imx1_dma(imxdma) &&
imxdma            331 drivers/dma/imx-dma.c 			tmp = imx_dmav1_readl(imxdma, DMA_CCR(channel));
imxdma            332 drivers/dma/imx-dma.c 			imx_dmav1_writel(imxdma, tmp | CCR_RPT | CCR_ACRPT,
imxdma            342 drivers/dma/imx-dma.c 	struct imxdma_engine *imxdma = imxdmac->imxdma;
imxdma            346 drivers/dma/imx-dma.c 	dev_dbg(imxdma->dev, "%s channel %d\n", __func__, channel);
imxdma            352 drivers/dma/imx-dma.c 	imx_dmav1_writel(imxdma, imx_dmav1_readl(imxdma, DMA_DIMR) |
imxdma            354 drivers/dma/imx-dma.c 	imx_dmav1_writel(imxdma, imx_dmav1_readl(imxdma, DMA_CCR(channel)) &
imxdma            356 drivers/dma/imx-dma.c 	imx_dmav1_writel(imxdma, 1 << channel, DMA_DISR);
imxdma            363 drivers/dma/imx-dma.c 	struct imxdma_engine *imxdma = imxdmac->imxdma;
imxdma            366 drivers/dma/imx-dma.c 	imx_dmav1_writel(imxdma, 0, DMA_CCR(channel));
imxdma            370 drivers/dma/imx-dma.c 	dev_dbg(imxdma->dev, "channel %d: watchdog timeout!\n",
imxdma            376 drivers/dma/imx-dma.c 	struct imxdma_engine *imxdma = dev_id;
imxdma            381 drivers/dma/imx-dma.c 	disr = imx_dmav1_readl(imxdma, DMA_DISR);
imxdma            383 drivers/dma/imx-dma.c 	err_mask = imx_dmav1_readl(imxdma, DMA_DBTOSR) |
imxdma            384 drivers/dma/imx-dma.c 		   imx_dmav1_readl(imxdma, DMA_DRTOSR) |
imxdma            385 drivers/dma/imx-dma.c 		   imx_dmav1_readl(imxdma, DMA_DSESR)  |
imxdma            386 drivers/dma/imx-dma.c 		   imx_dmav1_readl(imxdma, DMA_DBOSR);
imxdma            391 drivers/dma/imx-dma.c 	imx_dmav1_writel(imxdma, disr & err_mask, DMA_DISR);
imxdma            398 drivers/dma/imx-dma.c 		if (imx_dmav1_readl(imxdma, DMA_DBTOSR) & (1 << i)) {
imxdma            399 drivers/dma/imx-dma.c 			imx_dmav1_writel(imxdma, 1 << i, DMA_DBTOSR);
imxdma            402 drivers/dma/imx-dma.c 		if (imx_dmav1_readl(imxdma, DMA_DRTOSR) & (1 << i)) {
imxdma            403 drivers/dma/imx-dma.c 			imx_dmav1_writel(imxdma, 1 << i, DMA_DRTOSR);
imxdma            406 drivers/dma/imx-dma.c 		if (imx_dmav1_readl(imxdma, DMA_DSESR) & (1 << i)) {
imxdma            407 drivers/dma/imx-dma.c 			imx_dmav1_writel(imxdma, 1 << i, DMA_DSESR);
imxdma            410 drivers/dma/imx-dma.c 		if (imx_dmav1_readl(imxdma, DMA_DBOSR) & (1 << i)) {
imxdma            411 drivers/dma/imx-dma.c 			imx_dmav1_writel(imxdma, 1 << i, DMA_DBOSR);
imxdma            415 drivers/dma/imx-dma.c 		tasklet_schedule(&imxdma->channel[i].dma_tasklet);
imxdma            417 drivers/dma/imx-dma.c 		dev_warn(imxdma->dev,
imxdma            429 drivers/dma/imx-dma.c 	struct imxdma_engine *imxdma = imxdmac->imxdma;
imxdma            434 drivers/dma/imx-dma.c 	spin_lock_irqsave(&imxdma->lock, flags);
imxdma            436 drivers/dma/imx-dma.c 		spin_unlock_irqrestore(&imxdma->lock, flags);
imxdma            443 drivers/dma/imx-dma.c 	spin_unlock_irqrestore(&imxdma->lock, flags);
imxdma            452 drivers/dma/imx-dma.c 			tmp = imx_dmav1_readl(imxdma, DMA_CCR(chno));
imxdma            462 drivers/dma/imx-dma.c 				imx_dmav1_writel(imxdma, tmp, DMA_CCR(chno));
imxdma            464 drivers/dma/imx-dma.c 				imx_dmav1_writel(imxdma, tmp & ~CCR_CEN,
imxdma            469 drivers/dma/imx-dma.c 			imx_dmav1_writel(imxdma, tmp, DMA_CCR(chno));
imxdma            485 drivers/dma/imx-dma.c 	imx_dmav1_writel(imxdma, 0, DMA_CCR(chno));
imxdma            492 drivers/dma/imx-dma.c 	struct imxdma_engine *imxdma = dev_id;
imxdma            495 drivers/dma/imx-dma.c 	if (!is_imx1_dma(imxdma))
imxdma            498 drivers/dma/imx-dma.c 	disr = imx_dmav1_readl(imxdma, DMA_DISR);
imxdma            500 drivers/dma/imx-dma.c 	dev_dbg(imxdma->dev, "%s called, disr=0x%08x\n", __func__, disr);
imxdma            502 drivers/dma/imx-dma.c 	imx_dmav1_writel(imxdma, disr, DMA_DISR);
imxdma            505 drivers/dma/imx-dma.c 			dma_irq_handle_channel(&imxdma->channel[i]);
imxdma            514 drivers/dma/imx-dma.c 	struct imxdma_engine *imxdma = imxdmac->imxdma;
imxdma            523 drivers/dma/imx-dma.c 			if ((imxdma->slots_2d[i].count > 0) &&
imxdma            524 drivers/dma/imx-dma.c 			((imxdma->slots_2d[i].xsr != d->x) ||
imxdma            525 drivers/dma/imx-dma.c 			(imxdma->slots_2d[i].ysr != d->y) ||
imxdma            526 drivers/dma/imx-dma.c 			(imxdma->slots_2d[i].wsr != d->w)))
imxdma            534 drivers/dma/imx-dma.c 		imxdma->slots_2d[slot].xsr = d->x;
imxdma            535 drivers/dma/imx-dma.c 		imxdma->slots_2d[slot].ysr = d->y;
imxdma            536 drivers/dma/imx-dma.c 		imxdma->slots_2d[slot].wsr = d->w;
imxdma            537 drivers/dma/imx-dma.c 		imxdma->slots_2d[slot].count++;
imxdma            545 drivers/dma/imx-dma.c 			imx_dmav1_writel(imxdma, d->x, DMA_XSRA);
imxdma            546 drivers/dma/imx-dma.c 			imx_dmav1_writel(imxdma, d->y, DMA_YSRA);
imxdma            547 drivers/dma/imx-dma.c 			imx_dmav1_writel(imxdma, d->w, DMA_WSRA);
imxdma            551 drivers/dma/imx-dma.c 			imx_dmav1_writel(imxdma, d->x, DMA_XSRB);
imxdma            552 drivers/dma/imx-dma.c 			imx_dmav1_writel(imxdma, d->y, DMA_YSRB);
imxdma            553 drivers/dma/imx-dma.c 			imx_dmav1_writel(imxdma, d->w, DMA_WSRB);
imxdma            561 drivers/dma/imx-dma.c 		imx_dmav1_writel(imxdma, d->src, DMA_SAR(imxdmac->channel));
imxdma            562 drivers/dma/imx-dma.c 		imx_dmav1_writel(imxdma, d->dest, DMA_DAR(imxdmac->channel));
imxdma            563 drivers/dma/imx-dma.c 		imx_dmav1_writel(imxdma, d->config_mem | (d->config_port << 2),
imxdma            566 drivers/dma/imx-dma.c 		imx_dmav1_writel(imxdma, d->len, DMA_CNTR(imxdmac->channel));
imxdma            568 drivers/dma/imx-dma.c 		dev_dbg(imxdma->dev,
imxdma            579 drivers/dma/imx-dma.c 			imx_dmav1_writel(imxdma, imxdmac->per_address,
imxdma            581 drivers/dma/imx-dma.c 			imx_dmav1_writel(imxdma, imxdmac->ccr_from_device,
imxdma            584 drivers/dma/imx-dma.c 			dev_dbg(imxdma->dev,
imxdma            590 drivers/dma/imx-dma.c 			imx_dmav1_writel(imxdma, imxdmac->per_address,
imxdma            592 drivers/dma/imx-dma.c 			imx_dmav1_writel(imxdma, imxdmac->ccr_to_device,
imxdma            595 drivers/dma/imx-dma.c 			dev_dbg(imxdma->dev,
imxdma            601 drivers/dma/imx-dma.c 			dev_err(imxdma->dev, "%s channel: %d bad dma mode\n",
imxdma            619 drivers/dma/imx-dma.c 	struct imxdma_engine *imxdma = imxdmac->imxdma;
imxdma            623 drivers/dma/imx-dma.c 	spin_lock_irqsave(&imxdma->lock, flags);
imxdma            627 drivers/dma/imx-dma.c 		spin_unlock_irqrestore(&imxdma->lock, flags);
imxdma            643 drivers/dma/imx-dma.c 		imxdma->slots_2d[imxdmac->slot_2d].count--;
imxdma            654 drivers/dma/imx-dma.c 			dev_warn(imxdma->dev, "%s: channel: %d couldn't xfer desc\n",
imxdma            658 drivers/dma/imx-dma.c 	spin_unlock_irqrestore(&imxdma->lock, flags);
imxdma            666 drivers/dma/imx-dma.c 	struct imxdma_engine *imxdma = imxdmac->imxdma;
imxdma            671 drivers/dma/imx-dma.c 	spin_lock_irqsave(&imxdma->lock, flags);
imxdma            674 drivers/dma/imx-dma.c 	spin_unlock_irqrestore(&imxdma->lock, flags);
imxdma            683 drivers/dma/imx-dma.c 	struct imxdma_engine *imxdma = imxdmac->imxdma;
imxdma            717 drivers/dma/imx-dma.c 	imx_dmav1_writel(imxdma, imxdmac->dma_request,
imxdma            721 drivers/dma/imx-dma.c 	imx_dmav1_writel(imxdma, imxdmac->watermark_level *
imxdma            747 drivers/dma/imx-dma.c 	struct imxdma_engine *imxdma = imxdmac->imxdma;
imxdma            751 drivers/dma/imx-dma.c 	spin_lock_irqsave(&imxdma->lock, flags);
imxdma            754 drivers/dma/imx-dma.c 	spin_unlock_irqrestore(&imxdma->lock, flags);
imxdma            793 drivers/dma/imx-dma.c 	struct imxdma_engine *imxdma = imxdmac->imxdma;
imxdma            797 drivers/dma/imx-dma.c 	spin_lock_irqsave(&imxdma->lock, flags);
imxdma            803 drivers/dma/imx-dma.c 	spin_unlock_irqrestore(&imxdma->lock, flags);
imxdma            872 drivers/dma/imx-dma.c 	struct imxdma_engine *imxdma = imxdmac->imxdma;
imxdma            877 drivers/dma/imx-dma.c 	dev_dbg(imxdma->dev, "%s channel: %d buf_len=%zu period_len=%zu\n",
imxdma            929 drivers/dma/imx-dma.c 	struct imxdma_engine *imxdma = imxdmac->imxdma;
imxdma            932 drivers/dma/imx-dma.c 	dev_dbg(imxdma->dev, "%s channel: %d src=0x%llx dst=0x%llx len=%zu\n",
imxdma            960 drivers/dma/imx-dma.c 	struct imxdma_engine *imxdma = imxdmac->imxdma;
imxdma            963 drivers/dma/imx-dma.c 	dev_dbg(imxdma->dev, "%s channel: %d src_start=0x%llx dst_start=0x%llx\n"
imxdma           1002 drivers/dma/imx-dma.c 	struct imxdma_engine *imxdma = imxdmac->imxdma;
imxdma           1006 drivers/dma/imx-dma.c 	spin_lock_irqsave(&imxdma->lock, flags);
imxdma           1013 drivers/dma/imx-dma.c 			dev_warn(imxdma->dev,
imxdma           1021 drivers/dma/imx-dma.c 	spin_unlock_irqrestore(&imxdma->lock, flags);
imxdma           1029 drivers/dma/imx-dma.c 	if (chan->device->dev != fdata->imxdma->dev)
imxdma           1042 drivers/dma/imx-dma.c 	struct imxdma_engine *imxdma = ofdma->of_dma_data;
imxdma           1044 drivers/dma/imx-dma.c 		.imxdma = imxdma,
imxdma           1052 drivers/dma/imx-dma.c 	return dma_request_channel(imxdma->dma_device.cap_mask,
imxdma           1058 drivers/dma/imx-dma.c 	struct imxdma_engine *imxdma;
imxdma           1068 drivers/dma/imx-dma.c 	imxdma = devm_kzalloc(&pdev->dev, sizeof(*imxdma), GFP_KERNEL);
imxdma           1069 drivers/dma/imx-dma.c 	if (!imxdma)
imxdma           1072 drivers/dma/imx-dma.c 	imxdma->dev = &pdev->dev;
imxdma           1073 drivers/dma/imx-dma.c 	imxdma->devtype = pdev->id_entry->driver_data;
imxdma           1076 drivers/dma/imx-dma.c 	imxdma->base = devm_ioremap_resource(&pdev->dev, res);
imxdma           1077 drivers/dma/imx-dma.c 	if (IS_ERR(imxdma->base))
imxdma           1078 drivers/dma/imx-dma.c 		return PTR_ERR(imxdma->base);
imxdma           1084 drivers/dma/imx-dma.c 	imxdma->dma_ipg = devm_clk_get(&pdev->dev, "ipg");
imxdma           1085 drivers/dma/imx-dma.c 	if (IS_ERR(imxdma->dma_ipg))
imxdma           1086 drivers/dma/imx-dma.c 		return PTR_ERR(imxdma->dma_ipg);
imxdma           1088 drivers/dma/imx-dma.c 	imxdma->dma_ahb = devm_clk_get(&pdev->dev, "ahb");
imxdma           1089 drivers/dma/imx-dma.c 	if (IS_ERR(imxdma->dma_ahb))
imxdma           1090 drivers/dma/imx-dma.c 		return PTR_ERR(imxdma->dma_ahb);
imxdma           1092 drivers/dma/imx-dma.c 	ret = clk_prepare_enable(imxdma->dma_ipg);
imxdma           1095 drivers/dma/imx-dma.c 	ret = clk_prepare_enable(imxdma->dma_ahb);
imxdma           1100 drivers/dma/imx-dma.c 	imx_dmav1_writel(imxdma, DCR_DRST, DMA_DCR);
imxdma           1102 drivers/dma/imx-dma.c 	if (is_imx1_dma(imxdma)) {
imxdma           1104 drivers/dma/imx-dma.c 				       dma_irq_handler, 0, "DMA", imxdma);
imxdma           1106 drivers/dma/imx-dma.c 			dev_warn(imxdma->dev, "Can't register IRQ for DMA\n");
imxdma           1109 drivers/dma/imx-dma.c 		imxdma->irq = irq;
imxdma           1118 drivers/dma/imx-dma.c 				       imxdma_err_handler, 0, "DMA", imxdma);
imxdma           1120 drivers/dma/imx-dma.c 			dev_warn(imxdma->dev, "Can't register ERRIRQ for DMA\n");
imxdma           1123 drivers/dma/imx-dma.c 		imxdma->irq_err = irq_err;
imxdma           1127 drivers/dma/imx-dma.c 	imx_dmav1_writel(imxdma, DCR_DEN, DMA_DCR);
imxdma           1130 drivers/dma/imx-dma.c 	imx_dmav1_writel(imxdma, (1 << IMX_DMA_CHANNELS) - 1, DMA_DISR);
imxdma           1133 drivers/dma/imx-dma.c 	imx_dmav1_writel(imxdma, (1 << IMX_DMA_CHANNELS) - 1, DMA_DIMR);
imxdma           1135 drivers/dma/imx-dma.c 	INIT_LIST_HEAD(&imxdma->dma_device.channels);
imxdma           1137 drivers/dma/imx-dma.c 	dma_cap_set(DMA_SLAVE, imxdma->dma_device.cap_mask);
imxdma           1138 drivers/dma/imx-dma.c 	dma_cap_set(DMA_CYCLIC, imxdma->dma_device.cap_mask);
imxdma           1139 drivers/dma/imx-dma.c 	dma_cap_set(DMA_MEMCPY, imxdma->dma_device.cap_mask);
imxdma           1140 drivers/dma/imx-dma.c 	dma_cap_set(DMA_INTERLEAVE, imxdma->dma_device.cap_mask);
imxdma           1144 drivers/dma/imx-dma.c 		imxdma->slots_2d[i].count = 0;
imxdma           1146 drivers/dma/imx-dma.c 	spin_lock_init(&imxdma->lock);
imxdma           1150 drivers/dma/imx-dma.c 		struct imxdma_channel *imxdmac = &imxdma->channel[i];
imxdma           1152 drivers/dma/imx-dma.c 		if (!is_imx1_dma(imxdma)) {
imxdma           1154 drivers/dma/imx-dma.c 					dma_irq_handler, 0, "DMA", imxdma);
imxdma           1156 drivers/dma/imx-dma.c 				dev_warn(imxdma->dev, "Can't register IRQ %d "
imxdma           1166 drivers/dma/imx-dma.c 		imxdmac->imxdma = imxdma;
imxdma           1174 drivers/dma/imx-dma.c 		imxdmac->chan.device = &imxdma->dma_device;
imxdma           1180 drivers/dma/imx-dma.c 			      &imxdma->dma_device.channels);
imxdma           1183 drivers/dma/imx-dma.c 	imxdma->dma_device.dev = &pdev->dev;
imxdma           1185 drivers/dma/imx-dma.c 	imxdma->dma_device.device_alloc_chan_resources = imxdma_alloc_chan_resources;
imxdma           1186 drivers/dma/imx-dma.c 	imxdma->dma_device.device_free_chan_resources = imxdma_free_chan_resources;
imxdma           1187 drivers/dma/imx-dma.c 	imxdma->dma_device.device_tx_status = imxdma_tx_status;
imxdma           1188 drivers/dma/imx-dma.c 	imxdma->dma_device.device_prep_slave_sg = imxdma_prep_slave_sg;
imxdma           1189 drivers/dma/imx-dma.c 	imxdma->dma_device.device_prep_dma_cyclic = imxdma_prep_dma_cyclic;
imxdma           1190 drivers/dma/imx-dma.c 	imxdma->dma_device.device_prep_dma_memcpy = imxdma_prep_dma_memcpy;
imxdma           1191 drivers/dma/imx-dma.c 	imxdma->dma_device.device_prep_interleaved_dma = imxdma_prep_dma_interleaved;
imxdma           1192 drivers/dma/imx-dma.c 	imxdma->dma_device.device_config = imxdma_config;
imxdma           1193 drivers/dma/imx-dma.c 	imxdma->dma_device.device_terminate_all = imxdma_terminate_all;
imxdma           1194 drivers/dma/imx-dma.c 	imxdma->dma_device.device_issue_pending = imxdma_issue_pending;
imxdma           1196 drivers/dma/imx-dma.c 	platform_set_drvdata(pdev, imxdma);
imxdma           1198 drivers/dma/imx-dma.c 	imxdma->dma_device.copy_align = DMAENGINE_ALIGN_4_BYTES;
imxdma           1199 drivers/dma/imx-dma.c 	imxdma->dma_device.dev->dma_parms = &imxdma->dma_parms;
imxdma           1200 drivers/dma/imx-dma.c 	dma_set_max_seg_size(imxdma->dma_device.dev, 0xffffff);
imxdma           1202 drivers/dma/imx-dma.c 	ret = dma_async_device_register(&imxdma->dma_device);
imxdma           1210 drivers/dma/imx-dma.c 				imxdma_xlate, imxdma);
imxdma           1220 drivers/dma/imx-dma.c 	dma_async_device_unregister(&imxdma->dma_device);
imxdma           1222 drivers/dma/imx-dma.c 	clk_disable_unprepare(imxdma->dma_ahb);
imxdma           1224 drivers/dma/imx-dma.c 	clk_disable_unprepare(imxdma->dma_ipg);
imxdma           1228 drivers/dma/imx-dma.c static void imxdma_free_irq(struct platform_device *pdev, struct imxdma_engine *imxdma)
imxdma           1232 drivers/dma/imx-dma.c 	if (is_imx1_dma(imxdma)) {
imxdma           1233 drivers/dma/imx-dma.c 		disable_irq(imxdma->irq);
imxdma           1234 drivers/dma/imx-dma.c 		disable_irq(imxdma->irq_err);
imxdma           1238 drivers/dma/imx-dma.c 		struct imxdma_channel *imxdmac = &imxdma->channel[i];
imxdma           1240 drivers/dma/imx-dma.c 		if (!is_imx1_dma(imxdma))
imxdma           1249 drivers/dma/imx-dma.c 	struct imxdma_engine *imxdma = platform_get_drvdata(pdev);
imxdma           1251 drivers/dma/imx-dma.c 	imxdma_free_irq(pdev, imxdma);
imxdma           1253 drivers/dma/imx-dma.c         dma_async_device_unregister(&imxdma->dma_device);
imxdma           1258 drivers/dma/imx-dma.c 	clk_disable_unprepare(imxdma->dma_ipg);
imxdma           1259 drivers/dma/imx-dma.c 	clk_disable_unprepare(imxdma->dma_ahb);