source: trunk/modules/vci_spi/include/soclib/vcispi.h @ 579

Last change on this file since 579 was 579, checked in by bouyer, 11 years ago

Add some basic DMA capabilities. Passes basic read/write tests.
Can only do line-aligned transfers which are multiple of a cache line in size,
but shouldn't be a strong limitation for real use.

File size: 1.9 KB
Line 
1/*
2 * SOCLIB_LGPL_HEADER_BEGIN
3 *
4 * This file is part of SoCLib, GNU LGPLv2.1.
5 *
6 * SoCLib is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU Lesser General Public License as published
8 * by the Free Software Foundation; version 2.1 of the License.
9 *
10 * SoCLib is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with SoCLib; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 * 02110-1301 USA
19 *
20 * SOCLIB_LGPL_HEADER_END
21 *
22 * Copyright (c) UPMC, Lip6, SoC
23 *         manuel bouyer
24 *
25 * Maintainers: bouyer
26 */
27#ifndef SPISD_H
28#define SPISD_H
29
30enum SoclibBlockDeviceRegisters {
31    SPI_DATA_TXRX0,
32    SPI_DATA_TXRX1,
33    SPI_DATA_TXRX2,
34    SPI_DATA_TXRX3,
35    SPI_CTRL,
36    SPI_DIVIDER,
37    SPI_SS,
38    SPI_DMA_BASE,
39    SPI_DMA_BASEH,
40    SPI_DMA_COUNT
41};
42
43#define SPI_CTRL_DMA_BSY        (1 << 16) /* R   DMA in progress              */
44#define SPI_CTRL_CPOL           (1 << 15) /* R/W Clock polarity               */
45#define SPI_CTRL_CPHA           (1 << 14) /* R/W Clock phase                  */
46#define SPI_CTRL_IE_EN          (1 << 12) /* R/W Interrupt Enable             */
47// 9-11 reserved
48#define SPI_CTRL_GO_BSY         (1 << 8 ) /* R/W Start the transfer           */
49#define SPI_CTRL_CHAR_LEN_MASK  (0xFF   ) /* R/W Bits transmited in 1 transfer*/
50
51#define SPI_DMA_COUNT_READ      (1 << 0) /* operation is a read (else write) */
52
53#endif /* SPISD_H */
54
55// Local Variables:
56// tab-width: 4
57// c-basic-offset: 4
58// c-file-offsets:((innamespace . 0)(inline-open . 0))
59// indent-tabs-mode: nil
60// End:
61
62// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=4:softtabstop=4
63
Note: See TracBrowser for help on using the repository browser.