blob: 6b5cd7b0cf32f3eccd352ed1962ecaa715035b2a [file] [log] [blame]
Aurelien Jacquiot14aa7e82011-10-04 12:17:19 -04001/*
2 * Port on Texas Instruments TMS320C6x architecture
3 *
4 * Copyright (C) 2004, 2009, 2010, 2011 Texas Instruments Incorporated
5 * Author: Aurelien Jacquiot <aurelien.jacquiot@ti.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 */
12#ifndef _ASM_C6X_DMA_MAPPING_H
13#define _ASM_C6X_DMA_MAPPING_H
14
Aurelien Jacquiot14aa7e82011-10-04 12:17:19 -040015/*
16 * DMA errors are defined by all-bits-set in the DMA address.
17 */
Christoph Hellwig4605f04b2016-01-20 15:01:35 -080018#define DMA_ERROR_CODE ~0
19
20extern struct dma_map_ops c6x_dma_ops;
21
22static inline struct dma_map_ops *get_dma_ops(struct device *dev)
Aurelien Jacquiot14aa7e82011-10-04 12:17:19 -040023{
Christoph Hellwig4605f04b2016-01-20 15:01:35 -080024 return &c6x_dma_ops;
Aurelien Jacquiot14aa7e82011-10-04 12:17:19 -040025}
26
Aurelien Jacquiot14aa7e82011-10-04 12:17:19 -040027extern void coherent_mem_init(u32 start, u32 size);
Christoph Hellwig4605f04b2016-01-20 15:01:35 -080028void *c6x_dma_alloc(struct device *dev, size_t size, dma_addr_t *handle,
29 gfp_t gfp, struct dma_attrs *attrs);
30void c6x_dma_free(struct device *dev, size_t size, void *vaddr,
31 dma_addr_t dma_handle, struct dma_attrs *attrs);
Geert Uytterhoeven18180652013-01-27 09:33:22 +000032
Aurelien Jacquiot14aa7e82011-10-04 12:17:19 -040033#endif /* _ASM_C6X_DMA_MAPPING_H */