1/* $NetBSD: bcm2835_spireg.h,v 1.1 2013/01/05 20:31:23 jakllsch Exp $ */ 2 3/* 4 * Copyright (c) 2012 Jonathan A. Kollasch 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions 9 * are met: 10 * 1. Redistributions of source code must retain the above copyright 11 * notice, this list of conditions and the following disclaimer. 12 * 2. Redistributions in binary form must reproduce the above copyright 13 * notice, this list of conditions and the following disclaimer in the 14 * documentation and/or other materials provided with the distribution. 15 * 16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 17 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 18 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 19 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 20 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 */ 28 29#ifndef _BROADCOM_BCM2835_SPIREG_H_ 30#define _BROADCOM_BCM2835_SPIREG_H_ 31 32#include <sys/cdefs.h> 33 34#define __BIT32(x) ((uint32_t)__BIT(x)) 35#define __BITS32(x, y) ((uint32_t)__BITS((x), (y))) 36 37#define SPI_CS 0x000 38#define SPI_CS_CS __BITS32(1,0) 39#define SPI_CS_CPHA __BIT32(2) 40#define SPI_CS_CPOL __BIT32(3) 41#define SPI_CS_CLEAR_TX __BIT32(4) 42#define SPI_CS_CLEAR_RX __BIT32(5) 43#define SPI_CS_CSPOL __BIT32(6) 44#define SPI_CS_TA __BIT32(7) 45#define SPI_CS_DMAEN __BIT32(8) 46#define SPI_CS_INTD __BIT32(9) 47#define SPI_CS_INTR __BIT32(10) 48#define SPI_CS_ADCS __BIT32(11) 49#define SPI_CS_REN __BIT32(12) 50#define SPI_CS_LEN __BIT32(13) 51#define SPI_CS_LMONO __BIT32(14) 52#define SPI_CS_TE_EN __BIT32(15) 53#define SPI_CS_DONE __BIT32(16) 54#define SPI_CS_RXD __BIT32(17) 55#define SPI_CS_TXD __BIT32(18) 56#define SPI_CS_RXR __BIT32(19) 57#define SPI_CS_RXF __BIT32(20) 58#define SPI_CS_CSPOL0 __BIT32(21) 59#define SPI_CS_CSPOL1 __BIT32(22) 60#define SPI_CS_CSPOL2 __BIT32(23) 61#define SPI_CS_DMA_LEN __BIT32(24) 62#define SPI_CS_LEN_LONG __BIT32(25) 63 64#define SPI_FIFO 0x004 65 66#define SPI_CLK 0x008 67#define SPI_CLK_CDIV __BITS32(15,0) 68 69#define SPI_DLEN 0x00c 70 71#define SPI_LTOH 0x010 72 73#define SPI_DC 0x014 74 75#endif /* _BROADCOM_BCM2835_SPIREG_H_ */ 76