Mike Frysinger | 6f070e1 | 2010-05-05 00:56:30 -0400 | [diff] [blame] | 1 | /* |
| 2 | * dma.h - Blackfin DMA defines/structures/etc... |
| 3 | * |
| 4 | * Copyright 2004-2008 Analog Devices Inc. |
| 5 | * Licensed under the GPL-2 or later. |
| 6 | */ |
| 7 | |
| 8 | #ifndef _BLACKFIN_DMA_H_ |
| 9 | #define _BLACKFIN_DMA_H_ |
| 10 | |
Bob Liu | ee82596 | 2012-08-16 11:19:08 +0800 | [diff] [blame] | 11 | #include <linux/types.h> |
| 12 | #ifdef __ADSPBF60x__ |
| 13 | #include <asm/mach-common/bits/dde.h> |
| 14 | #else |
Mike Frysinger | 6f070e1 | 2010-05-05 00:56:30 -0400 | [diff] [blame] | 15 | #include <asm/mach-common/bits/dma.h> |
Bob Liu | ee82596 | 2012-08-16 11:19:08 +0800 | [diff] [blame] | 16 | #endif |
Mike Frysinger | 6f070e1 | 2010-05-05 00:56:30 -0400 | [diff] [blame] | 17 | |
| 18 | struct dmasg_large { |
| 19 | void *next_desc_addr; |
Sonic Zhang | 1cd9158 | 2013-02-08 17:04:58 +0800 | [diff] [blame] | 20 | u32 start_addr; |
| 21 | u16 cfg; |
| 22 | u16 x_count; |
| 23 | s16 x_modify; |
| 24 | u16 y_count; |
| 25 | s16 y_modify; |
Mike Frysinger | 6f070e1 | 2010-05-05 00:56:30 -0400 | [diff] [blame] | 26 | } __attribute__((packed)); |
| 27 | |
| 28 | struct dmasg { |
Sonic Zhang | 1cd9158 | 2013-02-08 17:04:58 +0800 | [diff] [blame] | 29 | u32 start_addr; |
| 30 | u16 cfg; |
| 31 | u16 x_count; |
| 32 | s16 x_modify; |
| 33 | u16 y_count; |
| 34 | s16 y_modify; |
Mike Frysinger | 6f070e1 | 2010-05-05 00:56:30 -0400 | [diff] [blame] | 35 | } __attribute__((packed)); |
| 36 | |
| 37 | struct dma_register { |
Bob Liu | ee82596 | 2012-08-16 11:19:08 +0800 | [diff] [blame] | 38 | #ifdef __ADSPBF60x__ |
Mike Frysinger | 6f070e1 | 2010-05-05 00:56:30 -0400 | [diff] [blame] | 39 | void *next_desc_ptr; /* DMA Next Descriptor Pointer register */ |
Bob Liu | ee82596 | 2012-08-16 11:19:08 +0800 | [diff] [blame] | 40 | u32 start_addr; /* DMA Start address register */ |
| 41 | u32 config; /* DMA Configuration register */ |
Mike Frysinger | 6f070e1 | 2010-05-05 00:56:30 -0400 | [diff] [blame] | 42 | |
Bob Liu | ee82596 | 2012-08-16 11:19:08 +0800 | [diff] [blame] | 43 | u32 x_count; /* DMA x_count register */ |
| 44 | s32 x_modify; /* DMA x_modify register */ |
| 45 | u32 y_count; /* DMA y_count register */ |
| 46 | s32 y_modify; /* DMA y_modify register */ |
| 47 | u32 __pad0[2]; |
Mike Frysinger | 6f070e1 | 2010-05-05 00:56:30 -0400 | [diff] [blame] | 48 | |
Bob Liu | ee82596 | 2012-08-16 11:19:08 +0800 | [diff] [blame] | 49 | void *curr_desc_ptr; /* DMA Curr Descriptor Pointer register */ |
| 50 | void *prev_desc_ptr; /* DMA Prev Descriptor Pointer register */ |
| 51 | void *curr_addr; /* DMA Current Address Pointer register */ |
| 52 | u32 status; /* DMA irq status register */ |
| 53 | u32 curr_x_count; /* DMA Current x-count register */ |
| 54 | u32 curr_y_count; /* DMA Current y-count register */ |
| 55 | u32 __pad1[2]; |
Mike Frysinger | 6f070e1 | 2010-05-05 00:56:30 -0400 | [diff] [blame] | 56 | |
Bob Liu | ee82596 | 2012-08-16 11:19:08 +0800 | [diff] [blame] | 57 | u32 bw_limit; /* DMA Bandwidth Limit Count */ |
| 58 | u32 curr_bw_limit; /* DMA curr Bandwidth Limit Count */ |
| 59 | u32 bw_monitor; /* DMA Bandwidth Monitor Count */ |
| 60 | u32 curr_bw_monitor; /* DMA curr Bandwidth Monitor Count */ |
| 61 | #else |
| 62 | void *next_desc_ptr; /* DMA Next Descriptor Pointer register */ |
| 63 | u32 start_addr; /* DMA Start address register */ |
Mike Frysinger | 6f070e1 | 2010-05-05 00:56:30 -0400 | [diff] [blame] | 64 | |
Bob Liu | ee82596 | 2012-08-16 11:19:08 +0800 | [diff] [blame] | 65 | u16 config; /* DMA Configuration register */ |
| 66 | u16 dummy1; /* DMA Configuration register */ |
Mike Frysinger | 6f070e1 | 2010-05-05 00:56:30 -0400 | [diff] [blame] | 67 | |
Bob Liu | ee82596 | 2012-08-16 11:19:08 +0800 | [diff] [blame] | 68 | u32 reserved; |
Mike Frysinger | 6f070e1 | 2010-05-05 00:56:30 -0400 | [diff] [blame] | 69 | |
Bob Liu | ee82596 | 2012-08-16 11:19:08 +0800 | [diff] [blame] | 70 | u16 x_count; /* DMA x_count register */ |
| 71 | u16 dummy2; |
Mike Frysinger | 6f070e1 | 2010-05-05 00:56:30 -0400 | [diff] [blame] | 72 | |
Bob Liu | ee82596 | 2012-08-16 11:19:08 +0800 | [diff] [blame] | 73 | s16 x_modify; /* DMA x_modify register */ |
| 74 | u16 dummy3; |
Mike Frysinger | 6f070e1 | 2010-05-05 00:56:30 -0400 | [diff] [blame] | 75 | |
Bob Liu | ee82596 | 2012-08-16 11:19:08 +0800 | [diff] [blame] | 76 | u16 y_count; /* DMA y_count register */ |
| 77 | u16 dummy4; |
Mike Frysinger | 6f070e1 | 2010-05-05 00:56:30 -0400 | [diff] [blame] | 78 | |
Bob Liu | ee82596 | 2012-08-16 11:19:08 +0800 | [diff] [blame] | 79 | s16 y_modify; /* DMA y_modify register */ |
| 80 | u16 dummy5; |
Mike Frysinger | 6f070e1 | 2010-05-05 00:56:30 -0400 | [diff] [blame] | 81 | |
Bob Liu | ee82596 | 2012-08-16 11:19:08 +0800 | [diff] [blame] | 82 | void *curr_desc_ptr; /* DMA Current Descriptor Pointer register */ |
Mike Frysinger | 6f070e1 | 2010-05-05 00:56:30 -0400 | [diff] [blame] | 83 | |
Bob Liu | ee82596 | 2012-08-16 11:19:08 +0800 | [diff] [blame] | 84 | u32 curr_addr_ptr; /* DMA Current Address Pointer register */ |
Mike Frysinger | 6f070e1 | 2010-05-05 00:56:30 -0400 | [diff] [blame] | 85 | |
Bob Liu | ee82596 | 2012-08-16 11:19:08 +0800 | [diff] [blame] | 86 | u16 status; /* DMA irq status register */ |
| 87 | u16 dummy6; |
Mike Frysinger | 6f070e1 | 2010-05-05 00:56:30 -0400 | [diff] [blame] | 88 | |
Bob Liu | ee82596 | 2012-08-16 11:19:08 +0800 | [diff] [blame] | 89 | u16 peripheral_map; /* DMA peripheral map register */ |
| 90 | u16 dummy7; |
| 91 | |
| 92 | u16 curr_x_count; /* DMA Current x-count register */ |
| 93 | u16 dummy8; |
| 94 | |
| 95 | u32 reserved2; |
| 96 | |
| 97 | u16 curr_y_count; /* DMA Current y-count register */ |
| 98 | u16 dummy9; |
| 99 | |
| 100 | u32 reserved3; |
| 101 | #endif |
Mike Frysinger | 6f070e1 | 2010-05-05 00:56:30 -0400 | [diff] [blame] | 102 | }; |
| 103 | |
| 104 | #endif |