mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-24 23:51:17 +07:00
d800edebe3
Latest Samsung SoCs have one or more PL330 as their DMACs. This patch implements the S3C DMA API for PL330 core driver. The design has been kept as generic as possible while keeping effort to add support for new SoCs to the minimum possible level. Some of the salient features of this driver are:- o Automatic scheduling of client requests onto DMAC if more than one DMAC can reach the peripheral. Factors, such as current load and number of exclusive but inactive peripherals that are supported by the DMAC, are used to decide suitability of a DMAC for a particular client. o CIRCULAR buffer option is supported. o The driver scales transparently with the number of DMACs and total peripherals in the platform, since all peripherals are added to the peripheral pool and DMACs to the controller pool. For most conservative use of memory, smallest driver size and best performance, we don't employ legacy data structures of the S3C DMA API. That should not have any affect since those data structures are completely invisible to the DMA clients. Signed-off-by: Jassi Brar <jassi.brar@samsung.com> Signed-off-by: Ben Dooks <ben-linux@fluff.org>
79 lines
1.6 KiB
C
79 lines
1.6 KiB
C
/*
|
|
* Copyright (C) 2010 Samsung Electronics Co. Ltd.
|
|
* Jaswinder Singh <jassi.brar@samsung.com>
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
* (at your option) any later version.
|
|
*/
|
|
|
|
#ifndef __S3C_DMA_PL330_H_
|
|
#define __S3C_DMA_PL330_H_
|
|
|
|
#define S3C2410_DMAF_AUTOSTART (1 << 0)
|
|
#define S3C2410_DMAF_CIRCULAR (1 << 1)
|
|
|
|
/*
|
|
* PL330 can assign any channel to communicate with
|
|
* any of the peripherals attched to the DMAC.
|
|
* For the sake of consistency across client drivers,
|
|
* We keep the channel names unchanged and only add
|
|
* missing peripherals are added.
|
|
* Order is not important since S3C PL330 API driver
|
|
* use these just as IDs.
|
|
*/
|
|
enum dma_ch {
|
|
DMACH_UART0_RX,
|
|
DMACH_UART0_TX,
|
|
DMACH_UART1_RX,
|
|
DMACH_UART1_TX,
|
|
DMACH_UART2_RX,
|
|
DMACH_UART2_TX,
|
|
DMACH_UART3_RX,
|
|
DMACH_UART3_TX,
|
|
DMACH_IRDA,
|
|
DMACH_I2S0_RX,
|
|
DMACH_I2S0_TX,
|
|
DMACH_I2S0S_TX,
|
|
DMACH_I2S1_RX,
|
|
DMACH_I2S1_TX,
|
|
DMACH_I2S2_RX,
|
|
DMACH_I2S2_TX,
|
|
DMACH_SPI0_RX,
|
|
DMACH_SPI0_TX,
|
|
DMACH_SPI1_RX,
|
|
DMACH_SPI1_TX,
|
|
DMACH_SPI2_RX,
|
|
DMACH_SPI2_TX,
|
|
DMACH_AC97_MICIN,
|
|
DMACH_AC97_PCMIN,
|
|
DMACH_AC97_PCMOUT,
|
|
DMACH_EXTERNAL,
|
|
DMACH_PWM,
|
|
DMACH_SPDIF,
|
|
DMACH_HSI_RX,
|
|
DMACH_HSI_TX,
|
|
DMACH_PCM0_TX,
|
|
DMACH_PCM0_RX,
|
|
DMACH_PCM1_TX,
|
|
DMACH_PCM1_RX,
|
|
DMACH_PCM2_TX,
|
|
DMACH_PCM2_RX,
|
|
DMACH_MSM_REQ3,
|
|
DMACH_MSM_REQ2,
|
|
DMACH_MSM_REQ1,
|
|
DMACH_MSM_REQ0,
|
|
/* END Marker, also used to denote a reserved channel */
|
|
DMACH_MAX,
|
|
};
|
|
|
|
static inline bool s3c_dma_has_circular(void)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
#include <plat/dma.h>
|
|
|
|
#endif /* __S3C_DMA_PL330_H_ */
|