filename | test/dma.h |
changeset | 185:6755a04c447f |
next | 561:533f6b478071 |
author | nkeynes |
date | Sat Aug 05 00:18:21 2006 +0000 (17 years ago) |
permissions | -rw-r--r-- |
last change | Add error lines to tests with incomplete polys Split clip tests to separate data file Add tests for cmd bit 23 ("use list size field") |
file | annotate | diff | log | raw |
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +00001.2 +++ b/test/dma.h Sat Aug 05 00:18:21 2006 +00001.3 @@ -0,0 +1,47 @@1.4 +/**1.5 + * $Id: dma.h,v 1.1 2006-07-11 01:35:23 nkeynes Exp $1.6 + *1.7 + * DMA support code1.8 + *1.9 + * Copyright (c) 2006 Nathan Keynes.1.10 + *1.11 + * This program is free software; you can redistribute it and/or modify1.12 + * it under the terms of the GNU General Public License as published by1.13 + * the Free Software Foundation; either version 2 of the License, or1.14 + * (at your option) any later version.1.15 + *1.16 + * This program is distributed in the hope that it will be useful,1.17 + * but WITHOUT ANY WARRANTY; without even the implied warranty of1.18 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the1.19 + * GNU General Public License for more details.1.20 + */1.21 +1.22 +#include "lib.h"1.23 +1.24 +/**1.25 + * Setup the DMAC for a transfer. Assumes 32-byte block transfer.1.26 + * Caller is responsible for making sure no-one else is using the1.27 + * channel already.1.28 + *1.29 + * @param channel DMA channel to use, 0 to 31.30 + * @param source source address (if a memory source)1.31 + * @param dest destination address (if a memory destination)1.32 + * @param length number of bytes to transfer (must be a multiple of1.33 + * 32.1.34 + * @param direction 0 = host to device, 1 = device to host1.35 + */1.36 +void dmac_prepare_channel( int channel, uint32_t source, uint32_t dest,1.37 + uint32_t length, int direction );1.38 +1.39 +/**1.40 + * Transfer data to the PVR via DMA. Target address should be1.41 + * 0x10000000 for the TA, and 0x11000000 + VRAM address for VRAM.1.42 + *1.43 + * @param target Target address1.44 + * @param buf Data to write (must be 32-byte aligned)1.45 + * @param length Size of data to write, in bytes.1.46 + * @param region Target region for VRAM writes, 0 for 64-byte region, 1 for 32-byte region.1.47 + *1.48 + * @return 0 on success, non-zero on failure.1.49 + */1.50 +int pvr_dma_write( unsigned int target, char *buf, int length, int region );
.