~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/arm/include/asm/dma.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 #ifndef __ASM_ARM_DMA_H
  3 #define __ASM_ARM_DMA_H
  4 
  5 /*
  6  * This is the maximum virtual address which can be DMA'd from.
  7  */
  8 #ifndef CONFIG_ZONE_DMA
  9 #define MAX_DMA_ADDRESS 0xffffffffUL
 10 #else
 11 #define MAX_DMA_ADDRESS ({ \
 12         extern phys_addr_t arm_dma_zone_size; \
 13         arm_dma_zone_size && arm_dma_zone_size < (0x100000000ULL - PAGE_OFFSET) ? \
 14                 (PAGE_OFFSET + arm_dma_zone_size) : 0xffffffffUL; })
 15 
 16 extern phys_addr_t arm_dma_limit;
 17 #define ARCH_LOW_ADDRESS_LIMIT arm_dma_limit
 18 #endif
 19 
 20 #ifdef CONFIG_ISA_DMA_API
 21 /*
 22  * This is used to support drivers written for the x86 ISA DMA API.
 23  * It should not be re-used except for that purpose.
 24  */
 25 #include <linux/spinlock.h>
 26 #include <linux/scatterlist.h>
 27 
 28 #include <mach/isa-dma.h>
 29 
 30 /*
 31  * The DMA modes reflect the settings for the ISA DMA controller
 32  */
 33 #define DMA_MODE_MASK    0xcc
 34 
 35 #define DMA_MODE_READ    0x44
 36 #define DMA_MODE_WRITE   0x48
 37 #define DMA_MODE_CASCADE 0xc0
 38 #define DMA_AUTOINIT     0x10
 39 
 40 extern raw_spinlock_t  dma_spin_lock;
 41 
 42 static inline unsigned long claim_dma_lock(void)
 43 {
 44         unsigned long flags;
 45         raw_spin_lock_irqsave(&dma_spin_lock, flags);
 46         return flags;
 47 }
 48 
 49 static inline void release_dma_lock(unsigned long flags)
 50 {
 51         raw_spin_unlock_irqrestore(&dma_spin_lock, flags);
 52 }
 53 
 54 /* Clear the 'DMA Pointer Flip Flop'.
 55  * Write 0 for LSB/MSB, 1 for MSB/LSB access.
 56  */
 57 #define clear_dma_ff(chan)
 58 
 59 /* Set only the page register bits of the transfer address.
 60  *
 61  * NOTE: This is an architecture specific function, and should
 62  *       be hidden from the drivers
 63  */
 64 extern void set_dma_page(unsigned int chan, char pagenr);
 65 
 66 /* Request a DMA channel
 67  *
 68  * Some architectures may need to do allocate an interrupt
 69  */
 70 extern int  request_dma(unsigned int chan, const char * device_id);
 71 
 72 /* Free a DMA channel
 73  *
 74  * Some architectures may need to do free an interrupt
 75  */
 76 extern void free_dma(unsigned int chan);
 77 
 78 /* Enable DMA for this channel
 79  *
 80  * On some architectures, this may have other side effects like
 81  * enabling an interrupt and setting the DMA registers.
 82  */
 83 extern void enable_dma(unsigned int chan);
 84 
 85 /* Disable DMA for this channel
 86  *
 87  * On some architectures, this may have other side effects like
 88  * disabling an interrupt or whatever.
 89  */
 90 extern void disable_dma(unsigned int chan);
 91 
 92 /* Test whether the specified channel has an active DMA transfer
 93  */
 94 extern int dma_channel_active(unsigned int chan);
 95 
 96 /* Set the DMA scatter gather list for this channel
 97  *
 98  * This should not be called if a DMA channel is enabled,
 99  * especially since some DMA architectures don't update the
100  * DMA address immediately, but defer it to the enable_dma().
101  */
102 extern void set_dma_sg(unsigned int chan, struct scatterlist *sg, int nr_sg);
103 
104 /* Set the DMA address for this channel
105  *
106  * This should not be called if a DMA channel is enabled,
107  * especially since some DMA architectures don't update the
108  * DMA address immediately, but defer it to the enable_dma().
109  */
110 extern void __set_dma_addr(unsigned int chan, void *addr);
111 #define set_dma_addr(chan, addr)                                \
112         __set_dma_addr(chan, (void *)isa_bus_to_virt(addr))
113 
114 /* Set the DMA byte count for this channel
115  *
116  * This should not be called if a DMA channel is enabled,
117  * especially since some DMA architectures don't update the
118  * DMA count immediately, but defer it to the enable_dma().
119  */
120 extern void set_dma_count(unsigned int chan, unsigned long count);
121 
122 /* Set the transfer direction for this channel
123  *
124  * This should not be called if a DMA channel is enabled,
125  * especially since some DMA architectures don't update the
126  * DMA transfer direction immediately, but defer it to the
127  * enable_dma().
128  */
129 extern void set_dma_mode(unsigned int chan, unsigned int mode);
130 
131 /* Set the transfer speed for this channel
132  */
133 extern void set_dma_speed(unsigned int chan, int cycle_ns);
134 
135 /* Get DMA residue count. After a DMA transfer, this
136  * should return zero. Reading this while a DMA transfer is
137  * still in progress will return unpredictable results.
138  * If called before the channel has been used, it may return 1.
139  * Otherwise, it returns the number of _bytes_ left to transfer.
140  */
141 extern int  get_dma_residue(unsigned int chan);
142 
143 #ifndef NO_DMA
144 #define NO_DMA  255
145 #endif
146 
147 #endif /* CONFIG_ISA_DMA_API */
148 
149 #endif /* __ASM_ARM_DMA_H */
150 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php