Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /*
0003  * Copyright (c) 2018-2019 Synopsys, Inc. and/or its affiliates.
0004  * Synopsys DesignWare eDMA v0 core
0005  *
0006  * Author: Gustavo Pimentel <gustavo.pimentel@synopsys.com>
0007  */
0008 
0009 #ifndef _DW_EDMA_V0_REGS_H
0010 #define _DW_EDMA_V0_REGS_H
0011 
0012 #include <linux/dmaengine.h>
0013 
0014 #define EDMA_V0_MAX_NR_CH               8
0015 #define EDMA_V0_VIEWPORT_MASK               GENMASK(2, 0)
0016 #define EDMA_V0_DONE_INT_MASK               GENMASK(7, 0)
0017 #define EDMA_V0_ABORT_INT_MASK              GENMASK(23, 16)
0018 #define EDMA_V0_WRITE_CH_COUNT_MASK         GENMASK(3, 0)
0019 #define EDMA_V0_READ_CH_COUNT_MASK          GENMASK(19, 16)
0020 #define EDMA_V0_CH_STATUS_MASK              GENMASK(6, 5)
0021 #define EDMA_V0_DOORBELL_CH_MASK            GENMASK(2, 0)
0022 #define EDMA_V0_LINKED_LIST_ERR_MASK            GENMASK(7, 0)
0023 
0024 #define EDMA_V0_CH_ODD_MSI_DATA_MASK            GENMASK(31, 16)
0025 #define EDMA_V0_CH_EVEN_MSI_DATA_MASK           GENMASK(15, 0)
0026 
0027 struct dw_edma_v0_ch_regs {
0028     u32 ch_control1;                /* 0x0000 */
0029     u32 ch_control2;                /* 0x0004 */
0030     u32 transfer_size;              /* 0x0008 */
0031     union {
0032         u64 reg;                /* 0x000c..0x0010 */
0033         struct {
0034             u32 lsb;            /* 0x000c */
0035             u32 msb;            /* 0x0010 */
0036         };
0037     } sar;
0038     union {
0039         u64 reg;                /* 0x0014..0x0018 */
0040         struct {
0041             u32 lsb;            /* 0x0014 */
0042             u32 msb;            /* 0x0018 */
0043         };
0044     } dar;
0045     union {
0046         u64 reg;                /* 0x001c..0x0020 */
0047         struct {
0048             u32 lsb;            /* 0x001c */
0049             u32 msb;            /* 0x0020 */
0050         };
0051     } llp;
0052 } __packed;
0053 
0054 struct dw_edma_v0_ch {
0055     struct dw_edma_v0_ch_regs wr;           /* 0x0200 */
0056     u32 padding_1[55];              /* 0x0224..0x02fc */
0057     struct dw_edma_v0_ch_regs rd;           /* 0x0300 */
0058     u32 padding_2[55];              /* 0x0324..0x03fc */
0059 } __packed;
0060 
0061 struct dw_edma_v0_unroll {
0062     u32 padding_1;                  /* 0x00f8 */
0063     u32 wr_engine_chgroup;              /* 0x0100 */
0064     u32 rd_engine_chgroup;              /* 0x0104 */
0065     union {
0066         u64 reg;                /* 0x0108..0x010c */
0067         struct {
0068             u32 lsb;            /* 0x0108 */
0069             u32 msb;            /* 0x010c */
0070         };
0071     } wr_engine_hshake_cnt;
0072     u32 padding_2[2];               /* 0x0110..0x0114 */
0073     union {
0074         u64 reg;                /* 0x0120..0x0124 */
0075         struct {
0076             u32 lsb;            /* 0x0120 */
0077             u32 msb;            /* 0x0124 */
0078         };
0079     } rd_engine_hshake_cnt;
0080     u32 padding_3[2];               /* 0x0120..0x0124 */
0081     u32 wr_ch0_pwr_en;              /* 0x0128 */
0082     u32 wr_ch1_pwr_en;              /* 0x012c */
0083     u32 wr_ch2_pwr_en;              /* 0x0130 */
0084     u32 wr_ch3_pwr_en;              /* 0x0134 */
0085     u32 wr_ch4_pwr_en;              /* 0x0138 */
0086     u32 wr_ch5_pwr_en;              /* 0x013c */
0087     u32 wr_ch6_pwr_en;              /* 0x0140 */
0088     u32 wr_ch7_pwr_en;              /* 0x0144 */
0089     u32 padding_4[8];               /* 0x0148..0x0164 */
0090     u32 rd_ch0_pwr_en;              /* 0x0168 */
0091     u32 rd_ch1_pwr_en;              /* 0x016c */
0092     u32 rd_ch2_pwr_en;              /* 0x0170 */
0093     u32 rd_ch3_pwr_en;              /* 0x0174 */
0094     u32 rd_ch4_pwr_en;              /* 0x0178 */
0095     u32 rd_ch5_pwr_en;              /* 0x018c */
0096     u32 rd_ch6_pwr_en;              /* 0x0180 */
0097     u32 rd_ch7_pwr_en;              /* 0x0184 */
0098     u32 padding_5[30];              /* 0x0188..0x01fc */
0099     struct dw_edma_v0_ch ch[EDMA_V0_MAX_NR_CH]; /* 0x0200..0x1120 */
0100 } __packed;
0101 
0102 struct dw_edma_v0_legacy {
0103     u32 viewport_sel;               /* 0x00f8 */
0104     struct dw_edma_v0_ch_regs ch;           /* 0x0100..0x0120 */
0105 } __packed;
0106 
0107 struct dw_edma_v0_regs {
0108     /* eDMA global registers */
0109     u32 ctrl_data_arb_prior;            /* 0x0000 */
0110     u32 padding_1;                  /* 0x0004 */
0111     u32 ctrl;                   /* 0x0008 */
0112     u32 wr_engine_en;               /* 0x000c */
0113     u32 wr_doorbell;                /* 0x0010 */
0114     u32 padding_2;                  /* 0x0014 */
0115     union {
0116         u64 reg;                /* 0x0018..0x001c */
0117         struct {
0118             u32 lsb;            /* 0x0018 */
0119             u32 msb;            /* 0x001c */
0120         };
0121     } wr_ch_arb_weight;
0122     u32 padding_3[3];               /* 0x0020..0x0028 */
0123     u32 rd_engine_en;               /* 0x002c */
0124     u32 rd_doorbell;                /* 0x0030 */
0125     u32 padding_4;                  /* 0x0034 */
0126     union {
0127         u64 reg;                /* 0x0038..0x003c */
0128         struct {
0129             u32 lsb;            /* 0x0038 */
0130             u32 msb;            /* 0x003c */
0131         };
0132     } rd_ch_arb_weight;
0133     u32 padding_5[3];               /* 0x0040..0x0048 */
0134     /* eDMA interrupts registers */
0135     u32 wr_int_status;              /* 0x004c */
0136     u32 padding_6;                  /* 0x0050 */
0137     u32 wr_int_mask;                /* 0x0054 */
0138     u32 wr_int_clear;               /* 0x0058 */
0139     u32 wr_err_status;              /* 0x005c */
0140     union {
0141         u64 reg;                /* 0x0060..0x0064 */
0142         struct {
0143             u32 lsb;            /* 0x0060 */
0144             u32 msb;            /* 0x0064 */
0145         };
0146     } wr_done_imwr;
0147     union {
0148         u64 reg;                /* 0x0068..0x006c */
0149         struct {
0150             u32 lsb;            /* 0x0068 */
0151             u32 msb;            /* 0x006c */
0152         };
0153     } wr_abort_imwr;
0154     u32 wr_ch01_imwr_data;              /* 0x0070 */
0155     u32 wr_ch23_imwr_data;              /* 0x0074 */
0156     u32 wr_ch45_imwr_data;              /* 0x0078 */
0157     u32 wr_ch67_imwr_data;              /* 0x007c */
0158     u32 padding_7[4];               /* 0x0080..0x008c */
0159     u32 wr_linked_list_err_en;          /* 0x0090 */
0160     u32 padding_8[3];               /* 0x0094..0x009c */
0161     u32 rd_int_status;              /* 0x00a0 */
0162     u32 padding_9;                  /* 0x00a4 */
0163     u32 rd_int_mask;                /* 0x00a8 */
0164     u32 rd_int_clear;               /* 0x00ac */
0165     u32 padding_10;                 /* 0x00b0 */
0166     union {
0167         u64 reg;                /* 0x00b4..0x00b8 */
0168         struct {
0169             u32 lsb;            /* 0x00b4 */
0170             u32 msb;            /* 0x00b8 */
0171         };
0172     } rd_err_status;
0173     u32 padding_11[2];              /* 0x00bc..0x00c0 */
0174     u32 rd_linked_list_err_en;          /* 0x00c4 */
0175     u32 padding_12;                 /* 0x00c8 */
0176     union {
0177         u64 reg;                /* 0x00cc..0x00d0 */
0178         struct {
0179             u32 lsb;            /* 0x00cc */
0180             u32 msb;            /* 0x00d0 */
0181         };
0182     } rd_done_imwr;
0183     union {
0184         u64 reg;                /* 0x00d4..0x00d8 */
0185         struct {
0186             u32 lsb;            /* 0x00d4 */
0187             u32 msb;            /* 0x00d8 */
0188         };
0189     } rd_abort_imwr;
0190     u32 rd_ch01_imwr_data;              /* 0x00dc */
0191     u32 rd_ch23_imwr_data;              /* 0x00e0 */
0192     u32 rd_ch45_imwr_data;              /* 0x00e4 */
0193     u32 rd_ch67_imwr_data;              /* 0x00e8 */
0194     u32 padding_13[4];              /* 0x00ec..0x00f8 */
0195     /* eDMA channel context grouping */
0196     union dw_edma_v0_type {
0197         struct dw_edma_v0_legacy legacy;    /* 0x00f8..0x0120 */
0198         struct dw_edma_v0_unroll unroll;    /* 0x00f8..0x1120 */
0199     } type;
0200 } __packed;
0201 
0202 struct dw_edma_v0_lli {
0203     u32 control;
0204     u32 transfer_size;
0205     union {
0206         u64 reg;
0207         struct {
0208             u32 lsb;
0209             u32 msb;
0210         };
0211     } sar;
0212     union {
0213         u64 reg;
0214         struct {
0215             u32 lsb;
0216             u32 msb;
0217         };
0218     } dar;
0219 } __packed;
0220 
0221 struct dw_edma_v0_llp {
0222     u32 control;
0223     u32 reserved;
0224     union {
0225         u64 reg;
0226         struct {
0227             u32 lsb;
0228             u32 msb;
0229         };
0230     } llp;
0231 } __packed;
0232 
0233 #endif /* _DW_EDMA_V0_REGS_H */