/* * Driver for the Atmel Extensible DMA Controller (aka XDMAC on AT91 systems) * * Copyright (C) 2014 Atmel Corporation * * Author: Ludovic Desroches <ludovic.desroches@atmel.com> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published by * the Free Software Foundation. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see <http://www.gnu.org/licenses/>. */#include<asm/barrier.h>#include<dt-bindings/dma/at91.h>#include<linux/clk.h>#include<linux/dmaengine.h>#include<linux/dmapool.h>#include<linux/interrupt.h>#include<linux/irq.h>#include<linux/list.h>#include<linux/module.h>#include<linux/of_dma.h>#include<linux/of_platform.h>#include<linux/platform_device.h>#include<linux/pm.h>#include"dmaengine.h"/* Global registers */#define AT_XDMAC_GTYPE 0x00 /* Global Type Register */#define AT_XDMAC_NB_CH(i) (((i) & 0x1F) + 1) /* Number of Channels Minus One */#define AT_XDMAC_FIFO_SZ(i) (((i) >> 5) & 0x7FF) /* Number of Bytes */#define AT_XDMAC_NB_REQ(i) ((((i) >> 16) & 0x3F) + 1) /* Number of Peripheral Requests Minus One */#define AT_XDMAC_GCFG 0x04 /* Global Configuration Register */#define AT_XDMAC_GWAC 0x08 /* Global Weighted Arbiter Configuration Register */#define AT_XDMAC_GIE 0x0C /* Global Interrupt Enable Register */#define AT_XDMAC_GID 0x10