/* MN10300 ISA DMA handlers and definitions1*2* Copyright (C) 2007 Matsushita Electric Industrial Co., Ltd.3* Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.4*5* This program is free software; you can redistribute it and/or6* modify it under the terms of the GNU General Public Licence7* as published by the Free Software Foundation; either version8* 2 of the Licence, or (at your option) any later version.9*/10#ifndef _ASM_DMA_H11#define _ASM_DMA_H1213#include <asm/system.h>14#include <linux/spinlock.h>15#include <asm/io.h>16#include <linux/delay.h>1718#undef MAX_DMA_CHANNELS /* switch off linux/kernel/dma.c */19#define MAX_DMA_ADDRESS 0xbfffffff2021extern spinlock_t dma_spin_lock;2223static inline unsigned long claim_dma_lock(void)24{25unsigned long flags;26spin_lock_irqsave(&dma_spin_lock, flags);27return flags;28}2930static inline void release_dma_lock(unsigned long flags)31{32spin_unlock_irqrestore(&dma_spin_lock, flags);33}3435/* enable/disable a specific DMA channel */36static inline void enable_dma(unsigned int dmanr)37{38}3940static inline void disable_dma(unsigned int dmanr)41{42}4344/* Clear the 'DMA Pointer Flip Flop'.45* Write 0 for LSB/MSB, 1 for MSB/LSB access.46* Use this once to initialize the FF to a known state.47* After that, keep track of it. :-)48* --- In order to do that, the DMA routines below should ---49* --- only be used while holding the DMA lock ! ---50*/51static inline void clear_dma_ff(unsigned int dmanr)52{53}5455/* set mode (above) for a specific DMA channel */56static inline void set_dma_mode(unsigned int dmanr, char mode)57{58}5960/* Set only the page register bits of the transfer address.61* This is used for successive transfers when we know the contents of62* the lower 16 bits of the DMA current address register, but a 64k boundary63* may have been crossed.64*/65static inline void set_dma_page(unsigned int dmanr, char pagenr)66{67}686970/* Set transfer address & page bits for specific DMA channel.71* Assumes dma flipflop is clear.72*/73static inline void set_dma_addr(unsigned int dmanr, unsigned int a)74{75}767778/* Set transfer size (max 64k for DMA1..3, 128k for DMA5..7) for79* a specific DMA channel.80* You must ensure the parameters are valid.81* NOTE: from a manual: "the number of transfers is one more82* than the initial word count"! This is taken into account.83* Assumes dma flip-flop is clear.84* NOTE 2: "count" represents _bytes_ and must be even for channels 5-7.85*/86static inline void set_dma_count(unsigned int dmanr, unsigned int count)87{88}899091/* Get DMA residue count. After a DMA transfer, this92* should return zero. Reading this while a DMA transfer is93* still in progress will return unpredictable results.94* If called before the channel has been used, it may return 1.95* Otherwise, it returns the number of _bytes_ left to transfer.96*97* Assumes DMA flip-flop is clear.98*/99static inline int get_dma_residue(unsigned int dmanr)100{101return 0;102}103104105/* These are in kernel/dma.c: */106extern int request_dma(unsigned int dmanr, const char *device_id);107extern void free_dma(unsigned int dmanr);108109/* From PCI */110111#ifdef CONFIG_PCI112extern int isa_dma_bridge_buggy;113#else114#define isa_dma_bridge_buggy (0)115#endif116117#endif /* _ASM_DMA_H */118119120