Path: blob/main/sys/arm/broadcom/bcm2835/bcm2835_spireg.h
39566 views
/*-1* SPDX-License-Identifier: BSD-2-Clause2*3* Copyright (c) 2012 Oleksandr Tymoshenko <[email protected]>4* Copyright (c) 2013 Luiz Otavio O Souza <[email protected]>5* All rights reserved.6*7* Redistribution and use in source and binary forms, with or without8* modification, are permitted provided that the following conditions9* are met:10* 1. Redistributions of source code must retain the above copyright11* notice, this list of conditions and the following disclaimer.12* 2. Redistributions in binary form must reproduce the above copyright13* notice, this list of conditions and the following disclaimer in the14* documentation and/or other materials provided with the distribution.15*16* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND17* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE18* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE19* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE20* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL21* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS22* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)23* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT24* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY25* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF26* SUCH DAMAGE.27*/2829#ifndef _BCM2835_SPIREG_H_30#define _BCM2835_SPIREG_H_3132#define SPI_CORE_CLK 250000000U33#define SPI_CS 0x0034#define SPI_CS_LEN_LONG (1 << 25)35#define SPI_CS_DMA_LEN (1 << 24)36#define SPI_CS_CSPOL2 (1 << 23)37#define SPI_CS_CSPOL1 (1 << 22)38#define SPI_CS_CSPOL0 (1 << 21)39#define SPI_CS_RXF (1 << 20)40#define SPI_CS_RXR (1 << 19)41#define SPI_CS_TXD (1 << 18)42#define SPI_CS_RXD (1 << 17)43#define SPI_CS_DONE (1 << 16)44#define SPI_CS_LEN (1 << 13)45#define SPI_CS_REN (1 << 12)46#define SPI_CS_ADCS (1 << 11)47#define SPI_CS_INTR (1 << 10)48#define SPI_CS_INTD (1 << 9)49#define SPI_CS_DMAEN (1 << 8)50#define SPI_CS_TA (1 << 7)51#define SPI_CS_CSPOL (1 << 6)52#define SPI_CS_CLEAR_RXFIFO (1 << 5)53#define SPI_CS_CLEAR_TXFIFO (1 << 4)54#define SPI_CS_CPOL (1 << 3)55#define SPI_CS_CPHA (1 << 2)56#define SPI_CS_MASK 0x357#define SPI_FIFO 0x0458#define SPI_CLK 0x0859#define SPI_CLK_MASK 0xffff60#define SPI_DLEN 0x0c61#define SPI_DLEN_MASK 0xffff62#define SPI_LTOH 0x1063#define SPI_LTOH_MASK 0xf64#define SPI_DC 0x1465#define SPI_DC_RPANIC_SHIFT 2466#define SPI_DC_RPANIC_MASK (0xff << SPI_DC_RPANIC_SHIFT)67#define SPI_DC_RDREQ_SHIFT 1668#define SPI_DC_RDREQ_MASK (0xff << SPI_DC_RDREQ_SHIFT)69#define SPI_DC_TPANIC_SHIFT 870#define SPI_DC_TPANIC_MASK (0xff << SPI_DC_TPANIC_SHIFT)71#define SPI_DC_TDREQ_SHIFT 072#define SPI_DC_TDREQ_MASK 0xff7374#endif /* _BCM2835_SPIREG_H_ */757677