]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blame - arch/cris/include/uapi/arch-v10/arch/svinto.h
Merge remote-tracking branches 'asoc/topic/dwc', 'asoc/topic/fallthrough', 'asoc...
[mirror_ubuntu-bionic-kernel.git] / arch / cris / include / uapi / arch-v10 / arch / svinto.h
CommitLineData
6f52b16c 1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
1da177e4
LT
2#ifndef _ASM_CRIS_SVINTO_H
3#define _ASM_CRIS_SVINTO_H
4
a1ce3928 5#include <arch/sv_addr_ag.h>
1da177e4
LT
6
7extern unsigned int genconfig_shadow; /* defined and set in head.S */
8
9/* dma stuff */
10
11enum { /* Available in: */
12 d_eol = (1 << 0), /* flags */
13 d_eop = (1 << 1), /* flags & status */
14 d_wait = (1 << 2), /* flags */
15 d_int = (1 << 3), /* flags */
16 d_txerr = (1 << 4), /* flags */
17 d_stop = (1 << 4), /* status */
18 d_ecp = (1 << 4), /* flags & status */
19 d_pri = (1 << 5), /* flags & status */
20 d_alignerr = (1 << 6), /* status */
21 d_crcerr = (1 << 7) /* status */
22};
23
24/* Do remember that DMA does not go through the MMU and needs
25 * a real physical address, not an address virtually mapped or
26 * paged. Therefore the buf/next ptrs below are unsigned long instead
27 * of void * to give a warning if you try to put a pointer directly
28 * to them instead of going through virt_to_phys/phys_to_virt.
29 */
30
31typedef struct etrax_dma_descr {
32 unsigned short sw_len; /* 0-1 */
33 unsigned short ctrl; /* 2-3 */
34 unsigned long next; /* 4-7 */
35 unsigned long buf; /* 8-11 */
36 unsigned short hw_len; /* 12-13 */
37 unsigned char status; /* 14 */
38 unsigned char fifo_len; /* 15 */
39} etrax_dma_descr;
40
41
42/* Use this for constant numbers only */
43#define RESET_DMA_NUM( n ) \
44 *R_DMA_CH##n##_CMD = IO_STATE( R_DMA_CH0_CMD, cmd, reset )
45
46/* Use this for constant numbers or symbols,
47 * having two macros makes it possible to use constant expressions.
48 */
49#define RESET_DMA( n ) RESET_DMA_NUM( n )
50
51
52/* Use this for constant numbers only */
53#define WAIT_DMA_NUM( n ) \
54 while( (*R_DMA_CH##n##_CMD & IO_MASK( R_DMA_CH0_CMD, cmd )) != \
55 IO_STATE( R_DMA_CH0_CMD, cmd, hold ) )
56
57/* Use this for constant numbers or symbols
58 * having two macros makes it possible to use constant expressions.
59 */
60#define WAIT_DMA( n ) WAIT_DMA_NUM( n )
61
62extern void prepare_rx_descriptor(struct etrax_dma_descr *desc);
63extern void flush_etrax_cache(void);
64
65#endif