Home | History | Annotate | Line # | Download | only in nvidia
tegra_apbdmareg.h revision 1.1
      1  1.1  jmcneill /* $NetBSD: tegra_apbdmareg.h,v 1.1 2017/04/29 11:01:51 jmcneill Exp $ */
      2  1.1  jmcneill 
      3  1.1  jmcneill /*-
      4  1.1  jmcneill  * Copyright (c) 2017 Jared D. McNeill <jmcneill (at) invisible.ca>
      5  1.1  jmcneill  * All rights reserved.
      6  1.1  jmcneill  *
      7  1.1  jmcneill  * Redistribution and use in source and binary forms, with or without
      8  1.1  jmcneill  * modification, are permitted provided that the following conditions
      9  1.1  jmcneill  * are met:
     10  1.1  jmcneill  * 1. Redistributions of source code must retain the above copyright
     11  1.1  jmcneill  *    notice, this list of conditions and the following disclaimer.
     12  1.1  jmcneill  * 2. Redistributions in binary form must reproduce the above copyright
     13  1.1  jmcneill  *    notice, this list of conditions and the following disclaimer in the
     14  1.1  jmcneill  *    documentation and/or other materials provided with the distribution.
     15  1.1  jmcneill  *
     16  1.1  jmcneill  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     17  1.1  jmcneill  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     18  1.1  jmcneill  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     19  1.1  jmcneill  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     20  1.1  jmcneill  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
     21  1.1  jmcneill  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
     22  1.1  jmcneill  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
     23  1.1  jmcneill  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
     24  1.1  jmcneill  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     25  1.1  jmcneill  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     26  1.1  jmcneill  * SUCH DAMAGE.
     27  1.1  jmcneill  */
     28  1.1  jmcneill 
     29  1.1  jmcneill #ifndef _ARM_TEGRA_APBDMAREG_H
     30  1.1  jmcneill #define _ARM_TEGRA_APBDMAREG_H
     31  1.1  jmcneill 
     32  1.1  jmcneill /*
     33  1.1  jmcneill  * APB DMA registers
     34  1.1  jmcneill  */
     35  1.1  jmcneill #define	APBDMA_COMMAND_REG		0x00
     36  1.1  jmcneill #define	 APBDMA_COMMAND_GEN		__BIT(31)
     37  1.1  jmcneill #define	APBDMA_STATUS_REG		0x04
     38  1.1  jmcneill #define	APBDMA_CNTRL_REG		0x10
     39  1.1  jmcneill #define	APBDMA_IRQ_STA_CPU_REG		0x14
     40  1.1  jmcneill #define	APBDMA_IRQ_STA_COP_REG		0x18
     41  1.1  jmcneill #define	APBDMA_IRQ_MASK_REG		0x1c
     42  1.1  jmcneill #define	APBDMA_IRQ_MASK_SET_REG		0x20
     43  1.1  jmcneill #define	APBDMA_IRQ_MASK_CLR_REG		0x24
     44  1.1  jmcneill #define	APBDMA_TRIG_REG			0x28
     45  1.1  jmcneill #define	APBDMA_CHANNEL_TRIG_REG		0x2c
     46  1.1  jmcneill #define	APBDMA_DMA_STATUS_REG		0x30
     47  1.1  jmcneill #define	APBDMA_CHANNEL_EN_REG		0x34
     48  1.1  jmcneill #define	APBDMA_SECURITY_REG		0x38
     49  1.1  jmcneill #define	APBDMA_CHANNEL_SWID_REG		0x3c
     50  1.1  jmcneill #define	APBDMA_CHAN_WT_0_REG		0x44
     51  1.1  jmcneill #define	APBDMA_CHAN_WT_1_REG		0x48
     52  1.1  jmcneill #define	APBDMA_CHAN_WT_2_REG		0x4c
     53  1.1  jmcneill #define	APBDMA_CHAN_WT_3_REG		0x50
     54  1.1  jmcneill #define	APBDMA_CHANNEL_SWID1_REG	0x54
     55  1.1  jmcneill 
     56  1.1  jmcneill /*
     57  1.1  jmcneill  * APB DMA channel registers
     58  1.1  jmcneill  */
     59  1.1  jmcneill #define	APBDMACHAN_CSR_REG(n)		(0x00 + ((n) * 0x40))
     60  1.1  jmcneill #define	 APBDMACHAN_CSR_ENB		__BIT(31)
     61  1.1  jmcneill #define	 APBDMACHAN_CSR_IE_EOC		__BIT(30)
     62  1.1  jmcneill #define	 APBDMACHAN_CSR_HOLD		__BIT(29)
     63  1.1  jmcneill #define	 APBDMACHAN_CSR_DIR		__BIT(28)
     64  1.1  jmcneill #define	 APBDMACHAN_CSR_ONCE		__BIT(27)
     65  1.1  jmcneill #define	 APBDMACHAN_CSR_FLOW		__BIT(21)
     66  1.1  jmcneill #define	 APBDMACHAN_CSR_REQ_SEL		__BITS(20,16)
     67  1.1  jmcneill #define	APBDMACHAN_STA_REG(n)		(0x04 + ((n) * 0x40))
     68  1.1  jmcneill #define	APBDMACHAN_DMA_BYTE_STA_REG(n)	(0x08 + ((n) * 0x40))
     69  1.1  jmcneill #define	APBDMACHAN_CSRE_REG(n)		(0x0c + ((n) * 0x40))
     70  1.1  jmcneill #define	APBDMACHAN_AHB_PTR_REG(n)	(0x10 + ((n) * 0x40))
     71  1.1  jmcneill #define	 APBDMACHAN_AHB_PTR_MASK	__BITS(31,2)
     72  1.1  jmcneill #define	APBDMACHAN_AHB_SEQ_REG(n)	(0x14 + ((n) * 0x40))
     73  1.1  jmcneill #define	 APBDMACHAN_AHB_SEQ_INTR_ENB	__BIT(31)
     74  1.1  jmcneill #define	 APBDMACHAN_AHB_SEQ_BUS_WIDTH	__BITS(30,28)
     75  1.1  jmcneill #define	  APBDMACHAN_AHB_SEQ_BUS_WIDTH_32	2
     76  1.1  jmcneill #define	 APBDMACHAN_AHB_SEQ_DATA_SWAP	__BIT(27)
     77  1.1  jmcneill #define	 APBDMACHAN_AHB_SEQ_BURST	__BITS(26,24)
     78  1.1  jmcneill #define	  APBDMACHAN_AHB_SEQ_BURST_1		4
     79  1.1  jmcneill #define	  APBDMACHAN_AHB_SEQ_BURST_4		5
     80  1.1  jmcneill #define	  APBDMACHAN_AHB_SEQ_BURST_8		6
     81  1.1  jmcneill #define	 APBDMACHAN_AHB_SEQ_DBL_BUF	__BIT(19)
     82  1.1  jmcneill #define	 APBDMACHAN_AHB_SEQ_WRAP	__BITS(18,16)
     83  1.1  jmcneill #define	  APBDMACHAN_AHB_SEQ_WRAP_NO_WRAP	0
     84  1.1  jmcneill #define	  APBDMACHAN_AHB_SEQ_WRAP_32		1
     85  1.1  jmcneill #define	  APBDMACHAN_AHB_SEQ_WRAP_64		2
     86  1.1  jmcneill #define	  APBDMACHAN_AHB_SEQ_WRAP_128		3
     87  1.1  jmcneill #define	  APBDMACHAN_AHB_SEQ_WRAP_256		4
     88  1.1  jmcneill #define	  APBDMACHAN_AHB_SEQ_WRAP_512		5
     89  1.1  jmcneill #define	  APBDMACHAN_AHB_SEQ_WRAP_1024		6
     90  1.1  jmcneill #define	  APBDMACHAN_AHB_SEQ_WRAP_2048		7
     91  1.1  jmcneill #define	APBDMACHAN_APB_PTR_REG(n)	(0x18 + ((n) * 0x40))
     92  1.1  jmcneill #define	 APBDMACHAN_APB_PTR_MASK	__BITS(31,2)
     93  1.1  jmcneill #define	APBDMACHAN_APB_SEQ_REG(n)	(0x1c + ((n) * 0x40))
     94  1.1  jmcneill #define	 APBDMACHAN_APB_SEQ_BUS_WIDTH	__BITS(30,28)
     95  1.1  jmcneill #define	  APBDMACHAN_APB_SEQ_BUS_WIDTH_8	0
     96  1.1  jmcneill #define	  APBDMACHAN_APB_SEQ_BUS_WIDTH_16	1
     97  1.1  jmcneill #define	  APBDMACHAN_APB_SEQ_BUS_WIDTH_32	2
     98  1.1  jmcneill #define	 APBDMACHAN_APB_SEQ_DATA_SWAP	__BIT(27)
     99  1.1  jmcneill #define	 APBDMACHAN_APB_SEQ_WRAP	__BITS(18,16)
    100  1.1  jmcneill #define	  APBDMACHAN_APB_SEQ_WRAP_NO_WRAP	0
    101  1.1  jmcneill #define	  APBDMACHAN_APB_SEQ_WRAP_1		1
    102  1.1  jmcneill #define	  APBDMACHAN_APB_SEQ_WRAP_2		2
    103  1.1  jmcneill #define	  APBDMACHAN_APB_SEQ_WRAP_4		3
    104  1.1  jmcneill #define	  APBDMACHAN_APB_SEQ_WRAP_8		4
    105  1.1  jmcneill #define	  APBDMACHAN_APB_SEQ_WRAP_16		5
    106  1.1  jmcneill #define	  APBDMACHAN_APB_SEQ_WRAP_32		6
    107  1.1  jmcneill #define	  APBDMACHAN_APB_SEQ_WRAP_64		7
    108  1.1  jmcneill #define	APBDMACHAN_WCOUNT_REG(n)	(0x20 + ((n) * 0x40))
    109  1.1  jmcneill #define	APBDMACHAN_WORD_REG(n)		(0x24 + ((n) * 0x40))
    110  1.1  jmcneill 
    111  1.1  jmcneill 
    112  1.1  jmcneill #endif /* _ARM_TEGRA_APBDMAREG_H */
    113