Annotation of margi2/dram.h, revision 1.1
1.1 ! cvs 1: /*
! 2: dram.h
! 3:
! 4: Copyright (C) Christian Wolff for convergence integrated media.
! 5:
! 6: This program is free software; you can redistribute it and/or modify
! 7: it under the terms of the GNU General Public License as published by
! 8: the Free Software Foundation; either version 2 of the License, or
! 9: (at your option) any later version.
! 10:
! 11: This program is distributed in the hope that it will be useful,
! 12: but WITHOUT ANY WARRANTY; without even the implied warranty of
! 13: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! 14: GNU General Public License for more details.
! 15:
! 16: You should have received a copy of the GNU General Public License
! 17: along with this program; if not, write to the Free Software
! 18: Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
! 19: */
! 20:
! 21: #ifndef DRAM_H
! 22: #define DRAM_H
! 23:
! 24: /////////////////////////////////
! 25: // //
! 26: // L64021 DRAM Memory Access //
! 27: // //
! 28: /////////////////////////////////
! 29:
! 30: #include "cardbase.h"
! 31:
! 32: // where: 21 bit DRAM Word-Address, 4 word aligned
! 33: // size: bytes (8 byte aligned, remainder will be filled with fill value)
! 34: // data: fill value
! 35: // returns 0 on success, -1 on collision with DMA transfer
! 36: int DRAMFillByte(struct cvdv_cards *card, u32 where, int size, u8 data);
! 37:
! 38: // where: 21 bit DRAM Word-Address, 8 byte aligned
! 39: // size: bytes (8 byte aligned, remainder will be filled with garbage)
! 40: // swap: 0=normal mode, 1=write each 8 bytes on reverse order (7,6,5,4,3,2,1,0,15,14,13,etc.)
! 41: // returns 0 on success, -1 on collision with DMA transfer
! 42: int DRAMWriteByte(struct cvdv_cards *card, u32 where, int size, u8 * data,
! 43: int swapburst);
! 44:
! 45: // where: 21 bit DRAM Word-Address, 4 word aligned
! 46: // size: words (4 word aligned, remainder will be filled with garbage)
! 47: // swap: 0=normal mode, 1=write each 8 bytes on reverse order (7,6,5,4,3,2,1,0,15,14,13,etc.)
! 48: // returns 0 on success, -1 on collision with DMA transfer
! 49: int DRAMWriteWord(struct cvdv_cards *card, u32 where, int size, u16 * data,
! 50: int swap);
! 51:
! 52: // where: 21 bit DRAM Word-Address, 8 byte aligned
! 53: // size: bytes
! 54: // swap: 0=normal mode, 1=write each 8 bytes on reverse order (7,6,5,4,3,2,1,0,15,14,13,etc.)
! 55: // returns 0 on success, -1 on collision with DMA transfer
! 56: int DRAMReadByte(struct cvdv_cards *card, u32 where, int size, u8 * data,
! 57: int swap);
! 58:
! 59:
! 60: // where: 21 bit DRAM Word-Address, 4 word aligned
! 61: // size: words
! 62: // swap: 0=normal mode, 1=write each 8 bytes on reverse order (7,6,5,4,3,2,1,0,15,14,13,etc.)
! 63: // returns 0 on success, -1 on collision with DMA transfer
! 64: int DRAMReadWord(struct cvdv_cards *card, u32 where, int size, u16 * data,
! 65: int swap);
! 66:
! 67: // where: 21 bit DRAM Word-Address, 4 word aligned
! 68: // size: words
! 69: // swap: 0=normal mode, 1=write each 8 bytes on reverse order (7,6,5,4,3,2,1,0,15,14,13,etc.)
! 70: // returns -1 on success (equal content),
! 71: // word position on error (compare failure),
! 72: // -2 on collision with DMA transfer
! 73: int DRAMVerifyWord(struct cvdv_cards *card, u32 where, int size,
! 74: u16 * data, int swap);
! 75:
! 76: // WARNING: better not use this one. It can collide with normal DRAM access and other DMA transfers
! 77: // If you want to use it, implement card->DMAMoveBusy in all other DMA functions, initialisation, and header file
! 78: // source, destination: 21 bit DRAM Word-Address, 4 word aligned
! 79: // size: byte (8 byte aligned, hang over bytes will NOT be moved)
! 80: // returns 0 on success on success,
! 81: // -1 on collision with DMA transfer,
! 82: // -2 on interrupt handler not installed
! 83: int DRAMMove(struct cvdv_cards *card, u32 source, u32 destination,
! 84: int size);
! 85:
! 86: // size in words
! 87: // align: number of words on wich start of block will be aligned
! 88: // return value is 21 bit word address, or 0xFFFFFFFF on error
! 89: u32 DRAMAlloc(struct cvdv_cards *card, u32 size, int align);
! 90:
! 91: // addr is the return value of that resp. DRAMAlloc call
! 92: // returns 0 on success (always)
! 93: int DRAMFree(struct cvdv_cards *card, u32 addr);
! 94:
! 95: // free all blocks
! 96: // returns 0 on success (always)
! 97: int DRAMRelease(struct cvdv_cards *card);
! 98:
! 99: #endif /* DRAM_H */
LinuxTV legacy CVS <linuxtv.org/cvs>