162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */
262306a36Sopenharmony_ci/*
362306a36Sopenharmony_ci * HD audio interface patch for Creative CA0132 chip.
462306a36Sopenharmony_ci * CA0132 registers defines.
562306a36Sopenharmony_ci *
662306a36Sopenharmony_ci * Copyright (c) 2011, Creative Technology Ltd.
762306a36Sopenharmony_ci */
862306a36Sopenharmony_ci
962306a36Sopenharmony_ci#ifndef __CA0132_REGS_H
1062306a36Sopenharmony_ci#define __CA0132_REGS_H
1162306a36Sopenharmony_ci
1262306a36Sopenharmony_ci#define DSP_CHIP_OFFSET                0x100000
1362306a36Sopenharmony_ci#define DSP_DBGCNTL_MODULE_OFFSET      0xE30
1462306a36Sopenharmony_ci#define DSP_DBGCNTL_INST_OFFSET \
1562306a36Sopenharmony_ci	(DSP_CHIP_OFFSET + DSP_DBGCNTL_MODULE_OFFSET)
1662306a36Sopenharmony_ci
1762306a36Sopenharmony_ci#define DSP_DBGCNTL_EXEC_LOBIT         0x0
1862306a36Sopenharmony_ci#define DSP_DBGCNTL_EXEC_HIBIT         0x3
1962306a36Sopenharmony_ci#define DSP_DBGCNTL_EXEC_MASK          0xF
2062306a36Sopenharmony_ci
2162306a36Sopenharmony_ci#define DSP_DBGCNTL_SS_LOBIT           0x4
2262306a36Sopenharmony_ci#define DSP_DBGCNTL_SS_HIBIT           0x7
2362306a36Sopenharmony_ci#define DSP_DBGCNTL_SS_MASK            0xF0
2462306a36Sopenharmony_ci
2562306a36Sopenharmony_ci#define DSP_DBGCNTL_STATE_LOBIT        0xA
2662306a36Sopenharmony_ci#define DSP_DBGCNTL_STATE_HIBIT        0xD
2762306a36Sopenharmony_ci#define DSP_DBGCNTL_STATE_MASK         0x3C00
2862306a36Sopenharmony_ci
2962306a36Sopenharmony_ci#define XRAM_CHIP_OFFSET               0x0
3062306a36Sopenharmony_ci#define XRAM_XRAM_CHANNEL_COUNT        0xE000
3162306a36Sopenharmony_ci#define XRAM_XRAM_MODULE_OFFSET        0x0
3262306a36Sopenharmony_ci#define XRAM_XRAM_CHAN_INCR            4
3362306a36Sopenharmony_ci#define XRAM_XRAM_INST_OFFSET(_chan) \
3462306a36Sopenharmony_ci	(XRAM_CHIP_OFFSET + XRAM_XRAM_MODULE_OFFSET + \
3562306a36Sopenharmony_ci	(_chan * XRAM_XRAM_CHAN_INCR))
3662306a36Sopenharmony_ci
3762306a36Sopenharmony_ci#define YRAM_CHIP_OFFSET               0x40000
3862306a36Sopenharmony_ci#define YRAM_YRAM_CHANNEL_COUNT        0x8000
3962306a36Sopenharmony_ci#define YRAM_YRAM_MODULE_OFFSET        0x0
4062306a36Sopenharmony_ci#define YRAM_YRAM_CHAN_INCR            4
4162306a36Sopenharmony_ci#define YRAM_YRAM_INST_OFFSET(_chan) \
4262306a36Sopenharmony_ci	(YRAM_CHIP_OFFSET + YRAM_YRAM_MODULE_OFFSET + \
4362306a36Sopenharmony_ci	(_chan * YRAM_YRAM_CHAN_INCR))
4462306a36Sopenharmony_ci
4562306a36Sopenharmony_ci#define UC_CHIP_OFFSET                 0x80000
4662306a36Sopenharmony_ci#define UC_UC_CHANNEL_COUNT            0x10000
4762306a36Sopenharmony_ci#define UC_UC_MODULE_OFFSET            0x0
4862306a36Sopenharmony_ci#define UC_UC_CHAN_INCR                4
4962306a36Sopenharmony_ci#define UC_UC_INST_OFFSET(_chan) \
5062306a36Sopenharmony_ci	(UC_CHIP_OFFSET + UC_UC_MODULE_OFFSET + \
5162306a36Sopenharmony_ci	(_chan * UC_UC_CHAN_INCR))
5262306a36Sopenharmony_ci
5362306a36Sopenharmony_ci#define AXRAM_CHIP_OFFSET              0x3C000
5462306a36Sopenharmony_ci#define AXRAM_AXRAM_CHANNEL_COUNT      0x1000
5562306a36Sopenharmony_ci#define AXRAM_AXRAM_MODULE_OFFSET      0x0
5662306a36Sopenharmony_ci#define AXRAM_AXRAM_CHAN_INCR          4
5762306a36Sopenharmony_ci#define AXRAM_AXRAM_INST_OFFSET(_chan) \
5862306a36Sopenharmony_ci	(AXRAM_CHIP_OFFSET + AXRAM_AXRAM_MODULE_OFFSET + \
5962306a36Sopenharmony_ci	(_chan * AXRAM_AXRAM_CHAN_INCR))
6062306a36Sopenharmony_ci
6162306a36Sopenharmony_ci#define AYRAM_CHIP_OFFSET              0x78000
6262306a36Sopenharmony_ci#define AYRAM_AYRAM_CHANNEL_COUNT      0x1000
6362306a36Sopenharmony_ci#define AYRAM_AYRAM_MODULE_OFFSET      0x0
6462306a36Sopenharmony_ci#define AYRAM_AYRAM_CHAN_INCR          4
6562306a36Sopenharmony_ci#define AYRAM_AYRAM_INST_OFFSET(_chan) \
6662306a36Sopenharmony_ci	(AYRAM_CHIP_OFFSET + AYRAM_AYRAM_MODULE_OFFSET + \
6762306a36Sopenharmony_ci	(_chan * AYRAM_AYRAM_CHAN_INCR))
6862306a36Sopenharmony_ci
6962306a36Sopenharmony_ci#define DSPDMAC_CHIP_OFFSET            0x110000
7062306a36Sopenharmony_ci#define DSPDMAC_DMA_CFG_CHANNEL_COUNT  12
7162306a36Sopenharmony_ci#define DSPDMAC_DMACFG_MODULE_OFFSET   0xF00
7262306a36Sopenharmony_ci#define DSPDMAC_DMACFG_CHAN_INCR       0x10
7362306a36Sopenharmony_ci#define DSPDMAC_DMACFG_INST_OFFSET(_chan) \
7462306a36Sopenharmony_ci	(DSPDMAC_CHIP_OFFSET + DSPDMAC_DMACFG_MODULE_OFFSET + \
7562306a36Sopenharmony_ci	(_chan * DSPDMAC_DMACFG_CHAN_INCR))
7662306a36Sopenharmony_ci
7762306a36Sopenharmony_ci#define DSPDMAC_DMACFG_DBADR_LOBIT     0x0
7862306a36Sopenharmony_ci#define DSPDMAC_DMACFG_DBADR_HIBIT     0x10
7962306a36Sopenharmony_ci#define DSPDMAC_DMACFG_DBADR_MASK      0x1FFFF
8062306a36Sopenharmony_ci#define DSPDMAC_DMACFG_LP_LOBIT        0x11
8162306a36Sopenharmony_ci#define DSPDMAC_DMACFG_LP_HIBIT        0x11
8262306a36Sopenharmony_ci#define DSPDMAC_DMACFG_LP_MASK         0x20000
8362306a36Sopenharmony_ci
8462306a36Sopenharmony_ci#define DSPDMAC_DMACFG_AINCR_LOBIT     0x12
8562306a36Sopenharmony_ci#define DSPDMAC_DMACFG_AINCR_HIBIT     0x12
8662306a36Sopenharmony_ci#define DSPDMAC_DMACFG_AINCR_MASK      0x40000
8762306a36Sopenharmony_ci
8862306a36Sopenharmony_ci#define DSPDMAC_DMACFG_DWR_LOBIT       0x13
8962306a36Sopenharmony_ci#define DSPDMAC_DMACFG_DWR_HIBIT       0x13
9062306a36Sopenharmony_ci#define DSPDMAC_DMACFG_DWR_MASK        0x80000
9162306a36Sopenharmony_ci
9262306a36Sopenharmony_ci#define DSPDMAC_DMACFG_AJUMP_LOBIT     0x14
9362306a36Sopenharmony_ci#define DSPDMAC_DMACFG_AJUMP_HIBIT     0x17
9462306a36Sopenharmony_ci#define DSPDMAC_DMACFG_AJUMP_MASK      0xF00000
9562306a36Sopenharmony_ci
9662306a36Sopenharmony_ci#define DSPDMAC_DMACFG_AMODE_LOBIT     0x18
9762306a36Sopenharmony_ci#define DSPDMAC_DMACFG_AMODE_HIBIT     0x19
9862306a36Sopenharmony_ci#define DSPDMAC_DMACFG_AMODE_MASK      0x3000000
9962306a36Sopenharmony_ci
10062306a36Sopenharmony_ci#define DSPDMAC_DMACFG_LK_LOBIT        0x1A
10162306a36Sopenharmony_ci#define DSPDMAC_DMACFG_LK_HIBIT        0x1A
10262306a36Sopenharmony_ci#define DSPDMAC_DMACFG_LK_MASK         0x4000000
10362306a36Sopenharmony_ci
10462306a36Sopenharmony_ci#define DSPDMAC_DMACFG_AICS_LOBIT      0x1B
10562306a36Sopenharmony_ci#define DSPDMAC_DMACFG_AICS_HIBIT      0x1F
10662306a36Sopenharmony_ci#define DSPDMAC_DMACFG_AICS_MASK       0xF8000000
10762306a36Sopenharmony_ci
10862306a36Sopenharmony_ci#define DSPDMAC_DMACFG_LP_SINGLE                 0
10962306a36Sopenharmony_ci#define DSPDMAC_DMACFG_LP_LOOPING                1
11062306a36Sopenharmony_ci
11162306a36Sopenharmony_ci#define DSPDMAC_DMACFG_AINCR_XANDY               0
11262306a36Sopenharmony_ci#define DSPDMAC_DMACFG_AINCR_XORY                1
11362306a36Sopenharmony_ci
11462306a36Sopenharmony_ci#define DSPDMAC_DMACFG_DWR_DMA_RD                0
11562306a36Sopenharmony_ci#define DSPDMAC_DMACFG_DWR_DMA_WR                1
11662306a36Sopenharmony_ci
11762306a36Sopenharmony_ci#define DSPDMAC_DMACFG_AMODE_LINEAR              0
11862306a36Sopenharmony_ci#define DSPDMAC_DMACFG_AMODE_RSV1                1
11962306a36Sopenharmony_ci#define DSPDMAC_DMACFG_AMODE_WINTLV              2
12062306a36Sopenharmony_ci#define DSPDMAC_DMACFG_AMODE_GINTLV              3
12162306a36Sopenharmony_ci
12262306a36Sopenharmony_ci#define DSPDMAC_DSP_ADR_OFS_CHANNEL_COUNT 12
12362306a36Sopenharmony_ci#define DSPDMAC_DSPADROFS_MODULE_OFFSET 0xF04
12462306a36Sopenharmony_ci#define DSPDMAC_DSPADROFS_CHAN_INCR    0x10
12562306a36Sopenharmony_ci#define DSPDMAC_DSPADROFS_INST_OFFSET(_chan) \
12662306a36Sopenharmony_ci	(DSPDMAC_CHIP_OFFSET + DSPDMAC_DSPADROFS_MODULE_OFFSET + \
12762306a36Sopenharmony_ci	(_chan * DSPDMAC_DSPADROFS_CHAN_INCR))
12862306a36Sopenharmony_ci
12962306a36Sopenharmony_ci#define DSPDMAC_DSPADROFS_COFS_LOBIT   0x0
13062306a36Sopenharmony_ci#define DSPDMAC_DSPADROFS_COFS_HIBIT   0xF
13162306a36Sopenharmony_ci#define DSPDMAC_DSPADROFS_COFS_MASK    0xFFFF
13262306a36Sopenharmony_ci
13362306a36Sopenharmony_ci#define DSPDMAC_DSPADROFS_BOFS_LOBIT   0x10
13462306a36Sopenharmony_ci#define DSPDMAC_DSPADROFS_BOFS_HIBIT   0x1F
13562306a36Sopenharmony_ci#define DSPDMAC_DSPADROFS_BOFS_MASK    0xFFFF0000
13662306a36Sopenharmony_ci
13762306a36Sopenharmony_ci#define DSPDMAC_DSP_ADR_WOFS_CHANNEL_COUNT 12
13862306a36Sopenharmony_ci#define DSPDMAC_DSPADRWOFS_MODULE_OFFSET 0xF04
13962306a36Sopenharmony_ci#define DSPDMAC_DSPADRWOFS_CHAN_INCR   0x10
14062306a36Sopenharmony_ci
14162306a36Sopenharmony_ci#define DSPDMAC_DSPADRWOFS_INST_OFFSET(_chan) \
14262306a36Sopenharmony_ci	(DSPDMAC_CHIP_OFFSET + DSPDMAC_DSPADRWOFS_MODULE_OFFSET + \
14362306a36Sopenharmony_ci	(_chan * DSPDMAC_DSPADRWOFS_CHAN_INCR))
14462306a36Sopenharmony_ci
14562306a36Sopenharmony_ci#define DSPDMAC_DSPADRWOFS_WCOFS_LOBIT 0x0
14662306a36Sopenharmony_ci#define DSPDMAC_DSPADRWOFS_WCOFS_HIBIT 0xA
14762306a36Sopenharmony_ci#define DSPDMAC_DSPADRWOFS_WCOFS_MASK  0x7FF
14862306a36Sopenharmony_ci
14962306a36Sopenharmony_ci#define DSPDMAC_DSPADRWOFS_WCBFR_LOBIT 0xB
15062306a36Sopenharmony_ci#define DSPDMAC_DSPADRWOFS_WCBFR_HIBIT 0xF
15162306a36Sopenharmony_ci#define DSPDMAC_DSPADRWOFS_WCBFR_MASK  0xF800
15262306a36Sopenharmony_ci
15362306a36Sopenharmony_ci#define DSPDMAC_DSPADRWOFS_WBOFS_LOBIT 0x10
15462306a36Sopenharmony_ci#define DSPDMAC_DSPADRWOFS_WBOFS_HIBIT 0x1A
15562306a36Sopenharmony_ci#define DSPDMAC_DSPADRWOFS_WBOFS_MASK  0x7FF0000
15662306a36Sopenharmony_ci
15762306a36Sopenharmony_ci#define DSPDMAC_DSPADRWOFS_WBBFR_LOBIT 0x1B
15862306a36Sopenharmony_ci#define DSPDMAC_DSPADRWOFS_WBBFR_HIBIT 0x1F
15962306a36Sopenharmony_ci#define DSPDMAC_DSPADRWOFS_WBBFR_MASK  0xF8000000
16062306a36Sopenharmony_ci
16162306a36Sopenharmony_ci#define DSPDMAC_DSP_ADR_GOFS_CHANNEL_COUNT 12
16262306a36Sopenharmony_ci#define DSPDMAC_DSPADRGOFS_MODULE_OFFSET 0xF04
16362306a36Sopenharmony_ci#define DSPDMAC_DSPADRGOFS_CHAN_INCR   0x10
16462306a36Sopenharmony_ci#define DSPDMAC_DSPADRGOFS_INST_OFFSET(_chan) \
16562306a36Sopenharmony_ci	(DSPDMAC_CHIP_OFFSET + DSPDMAC_DSPADRGOFS_MODULE_OFFSET + \
16662306a36Sopenharmony_ci	(_chan * DSPDMAC_DSPADRGOFS_CHAN_INCR))
16762306a36Sopenharmony_ci
16862306a36Sopenharmony_ci#define DSPDMAC_DSPADRGOFS_GCOFS_LOBIT 0x0
16962306a36Sopenharmony_ci#define DSPDMAC_DSPADRGOFS_GCOFS_HIBIT 0x9
17062306a36Sopenharmony_ci#define DSPDMAC_DSPADRGOFS_GCOFS_MASK  0x3FF
17162306a36Sopenharmony_ci
17262306a36Sopenharmony_ci#define DSPDMAC_DSPADRGOFS_GCS_LOBIT   0xA
17362306a36Sopenharmony_ci#define DSPDMAC_DSPADRGOFS_GCS_HIBIT   0xC
17462306a36Sopenharmony_ci#define DSPDMAC_DSPADRGOFS_GCS_MASK    0x1C00
17562306a36Sopenharmony_ci
17662306a36Sopenharmony_ci#define DSPDMAC_DSPADRGOFS_GCBFR_LOBIT 0xD
17762306a36Sopenharmony_ci#define DSPDMAC_DSPADRGOFS_GCBFR_HIBIT 0xF
17862306a36Sopenharmony_ci#define DSPDMAC_DSPADRGOFS_GCBFR_MASK  0xE000
17962306a36Sopenharmony_ci
18062306a36Sopenharmony_ci#define DSPDMAC_DSPADRGOFS_GBOFS_LOBIT 0x10
18162306a36Sopenharmony_ci#define DSPDMAC_DSPADRGOFS_GBOFS_HIBIT 0x19
18262306a36Sopenharmony_ci#define DSPDMAC_DSPADRGOFS_GBOFS_MASK  0x3FF0000
18362306a36Sopenharmony_ci
18462306a36Sopenharmony_ci#define DSPDMAC_DSPADRGOFS_GBS_LOBIT   0x1A
18562306a36Sopenharmony_ci#define DSPDMAC_DSPADRGOFS_GBS_HIBIT   0x1C
18662306a36Sopenharmony_ci#define DSPDMAC_DSPADRGOFS_GBS_MASK    0x1C000000
18762306a36Sopenharmony_ci
18862306a36Sopenharmony_ci#define DSPDMAC_DSPADRGOFS_GBBFR_LOBIT 0x1D
18962306a36Sopenharmony_ci#define DSPDMAC_DSPADRGOFS_GBBFR_HIBIT 0x1F
19062306a36Sopenharmony_ci#define DSPDMAC_DSPADRGOFS_GBBFR_MASK  0xE0000000
19162306a36Sopenharmony_ci
19262306a36Sopenharmony_ci#define DSPDMAC_XFR_CNT_CHANNEL_COUNT  12
19362306a36Sopenharmony_ci#define DSPDMAC_XFRCNT_MODULE_OFFSET   0xF08
19462306a36Sopenharmony_ci#define DSPDMAC_XFRCNT_CHAN_INCR       0x10
19562306a36Sopenharmony_ci
19662306a36Sopenharmony_ci#define DSPDMAC_XFRCNT_INST_OFFSET(_chan) \
19762306a36Sopenharmony_ci	(DSPDMAC_CHIP_OFFSET + DSPDMAC_XFRCNT_MODULE_OFFSET + \
19862306a36Sopenharmony_ci	(_chan * DSPDMAC_XFRCNT_CHAN_INCR))
19962306a36Sopenharmony_ci
20062306a36Sopenharmony_ci#define DSPDMAC_XFRCNT_CCNT_LOBIT      0x0
20162306a36Sopenharmony_ci#define DSPDMAC_XFRCNT_CCNT_HIBIT      0xF
20262306a36Sopenharmony_ci#define DSPDMAC_XFRCNT_CCNT_MASK       0xFFFF
20362306a36Sopenharmony_ci
20462306a36Sopenharmony_ci#define DSPDMAC_XFRCNT_BCNT_LOBIT      0x10
20562306a36Sopenharmony_ci#define DSPDMAC_XFRCNT_BCNT_HIBIT      0x1F
20662306a36Sopenharmony_ci#define DSPDMAC_XFRCNT_BCNT_MASK       0xFFFF0000
20762306a36Sopenharmony_ci
20862306a36Sopenharmony_ci#define DSPDMAC_IRQ_CNT_CHANNEL_COUNT  12
20962306a36Sopenharmony_ci#define DSPDMAC_IRQCNT_MODULE_OFFSET   0xF0C
21062306a36Sopenharmony_ci#define DSPDMAC_IRQCNT_CHAN_INCR       0x10
21162306a36Sopenharmony_ci#define DSPDMAC_IRQCNT_INST_OFFSET(_chan) \
21262306a36Sopenharmony_ci	(DSPDMAC_CHIP_OFFSET + DSPDMAC_IRQCNT_MODULE_OFFSET + \
21362306a36Sopenharmony_ci	(_chan * DSPDMAC_IRQCNT_CHAN_INCR))
21462306a36Sopenharmony_ci
21562306a36Sopenharmony_ci#define DSPDMAC_IRQCNT_CICNT_LOBIT     0x0
21662306a36Sopenharmony_ci#define DSPDMAC_IRQCNT_CICNT_HIBIT     0xF
21762306a36Sopenharmony_ci#define DSPDMAC_IRQCNT_CICNT_MASK      0xFFFF
21862306a36Sopenharmony_ci
21962306a36Sopenharmony_ci#define DSPDMAC_IRQCNT_BICNT_LOBIT     0x10
22062306a36Sopenharmony_ci#define DSPDMAC_IRQCNT_BICNT_HIBIT     0x1F
22162306a36Sopenharmony_ci#define DSPDMAC_IRQCNT_BICNT_MASK      0xFFFF0000
22262306a36Sopenharmony_ci
22362306a36Sopenharmony_ci#define DSPDMAC_AUD_CHSEL_CHANNEL_COUNT 12
22462306a36Sopenharmony_ci#define DSPDMAC_AUDCHSEL_MODULE_OFFSET 0xFC0
22562306a36Sopenharmony_ci#define DSPDMAC_AUDCHSEL_CHAN_INCR     0x4
22662306a36Sopenharmony_ci#define DSPDMAC_AUDCHSEL_INST_OFFSET(_chan) \
22762306a36Sopenharmony_ci	(DSPDMAC_CHIP_OFFSET + DSPDMAC_AUDCHSEL_MODULE_OFFSET + \
22862306a36Sopenharmony_ci	(_chan * DSPDMAC_AUDCHSEL_CHAN_INCR))
22962306a36Sopenharmony_ci
23062306a36Sopenharmony_ci#define DSPDMAC_AUDCHSEL_ACS_LOBIT     0x0
23162306a36Sopenharmony_ci#define DSPDMAC_AUDCHSEL_ACS_HIBIT     0x1F
23262306a36Sopenharmony_ci#define DSPDMAC_AUDCHSEL_ACS_MASK      0xFFFFFFFF
23362306a36Sopenharmony_ci
23462306a36Sopenharmony_ci#define DSPDMAC_CHNLSTART_MODULE_OFFSET 0xFF0
23562306a36Sopenharmony_ci#define DSPDMAC_CHNLSTART_INST_OFFSET \
23662306a36Sopenharmony_ci	(DSPDMAC_CHIP_OFFSET + DSPDMAC_CHNLSTART_MODULE_OFFSET)
23762306a36Sopenharmony_ci
23862306a36Sopenharmony_ci#define DSPDMAC_CHNLSTART_EN_LOBIT     0x0
23962306a36Sopenharmony_ci#define DSPDMAC_CHNLSTART_EN_HIBIT     0xB
24062306a36Sopenharmony_ci#define DSPDMAC_CHNLSTART_EN_MASK      0xFFF
24162306a36Sopenharmony_ci
24262306a36Sopenharmony_ci#define DSPDMAC_CHNLSTART_VAI1_LOBIT   0xC
24362306a36Sopenharmony_ci#define DSPDMAC_CHNLSTART_VAI1_HIBIT   0xF
24462306a36Sopenharmony_ci#define DSPDMAC_CHNLSTART_VAI1_MASK    0xF000
24562306a36Sopenharmony_ci
24662306a36Sopenharmony_ci#define DSPDMAC_CHNLSTART_DIS_LOBIT    0x10
24762306a36Sopenharmony_ci#define DSPDMAC_CHNLSTART_DIS_HIBIT    0x1B
24862306a36Sopenharmony_ci#define DSPDMAC_CHNLSTART_DIS_MASK     0xFFF0000
24962306a36Sopenharmony_ci
25062306a36Sopenharmony_ci#define DSPDMAC_CHNLSTART_VAI2_LOBIT   0x1C
25162306a36Sopenharmony_ci#define DSPDMAC_CHNLSTART_VAI2_HIBIT   0x1F
25262306a36Sopenharmony_ci#define DSPDMAC_CHNLSTART_VAI2_MASK    0xF0000000
25362306a36Sopenharmony_ci
25462306a36Sopenharmony_ci#define DSPDMAC_CHNLSTATUS_MODULE_OFFSET 0xFF4
25562306a36Sopenharmony_ci#define DSPDMAC_CHNLSTATUS_INST_OFFSET \
25662306a36Sopenharmony_ci	(DSPDMAC_CHIP_OFFSET + DSPDMAC_CHNLSTATUS_MODULE_OFFSET)
25762306a36Sopenharmony_ci
25862306a36Sopenharmony_ci#define DSPDMAC_CHNLSTATUS_ISC_LOBIT   0x0
25962306a36Sopenharmony_ci#define DSPDMAC_CHNLSTATUS_ISC_HIBIT   0xB
26062306a36Sopenharmony_ci#define DSPDMAC_CHNLSTATUS_ISC_MASK    0xFFF
26162306a36Sopenharmony_ci
26262306a36Sopenharmony_ci#define DSPDMAC_CHNLSTATUS_AOO_LOBIT   0xC
26362306a36Sopenharmony_ci#define DSPDMAC_CHNLSTATUS_AOO_HIBIT   0xC
26462306a36Sopenharmony_ci#define DSPDMAC_CHNLSTATUS_AOO_MASK    0x1000
26562306a36Sopenharmony_ci
26662306a36Sopenharmony_ci#define DSPDMAC_CHNLSTATUS_AOU_LOBIT   0xD
26762306a36Sopenharmony_ci#define DSPDMAC_CHNLSTATUS_AOU_HIBIT   0xD
26862306a36Sopenharmony_ci#define DSPDMAC_CHNLSTATUS_AOU_MASK    0x2000
26962306a36Sopenharmony_ci
27062306a36Sopenharmony_ci#define DSPDMAC_CHNLSTATUS_AIO_LOBIT   0xE
27162306a36Sopenharmony_ci#define DSPDMAC_CHNLSTATUS_AIO_HIBIT   0xE
27262306a36Sopenharmony_ci#define DSPDMAC_CHNLSTATUS_AIO_MASK    0x4000
27362306a36Sopenharmony_ci
27462306a36Sopenharmony_ci#define DSPDMAC_CHNLSTATUS_AIU_LOBIT   0xF
27562306a36Sopenharmony_ci#define DSPDMAC_CHNLSTATUS_AIU_HIBIT   0xF
27662306a36Sopenharmony_ci#define DSPDMAC_CHNLSTATUS_AIU_MASK    0x8000
27762306a36Sopenharmony_ci
27862306a36Sopenharmony_ci#define DSPDMAC_CHNLSTATUS_IEN_LOBIT   0x10
27962306a36Sopenharmony_ci#define DSPDMAC_CHNLSTATUS_IEN_HIBIT   0x1B
28062306a36Sopenharmony_ci#define DSPDMAC_CHNLSTATUS_IEN_MASK    0xFFF0000
28162306a36Sopenharmony_ci
28262306a36Sopenharmony_ci#define DSPDMAC_CHNLSTATUS_VAI0_LOBIT  0x1C
28362306a36Sopenharmony_ci#define DSPDMAC_CHNLSTATUS_VAI0_HIBIT  0x1F
28462306a36Sopenharmony_ci#define DSPDMAC_CHNLSTATUS_VAI0_MASK   0xF0000000
28562306a36Sopenharmony_ci
28662306a36Sopenharmony_ci#define DSPDMAC_CHNLPROP_MODULE_OFFSET 0xFF8
28762306a36Sopenharmony_ci#define DSPDMAC_CHNLPROP_INST_OFFSET \
28862306a36Sopenharmony_ci	(DSPDMAC_CHIP_OFFSET + DSPDMAC_CHNLPROP_MODULE_OFFSET)
28962306a36Sopenharmony_ci
29062306a36Sopenharmony_ci#define DSPDMAC_CHNLPROP_DCON_LOBIT    0x0
29162306a36Sopenharmony_ci#define DSPDMAC_CHNLPROP_DCON_HIBIT    0xB
29262306a36Sopenharmony_ci#define DSPDMAC_CHNLPROP_DCON_MASK     0xFFF
29362306a36Sopenharmony_ci
29462306a36Sopenharmony_ci#define DSPDMAC_CHNLPROP_FFS_LOBIT     0xC
29562306a36Sopenharmony_ci#define DSPDMAC_CHNLPROP_FFS_HIBIT     0xC
29662306a36Sopenharmony_ci#define DSPDMAC_CHNLPROP_FFS_MASK      0x1000
29762306a36Sopenharmony_ci
29862306a36Sopenharmony_ci#define DSPDMAC_CHNLPROP_NAJ_LOBIT     0xD
29962306a36Sopenharmony_ci#define DSPDMAC_CHNLPROP_NAJ_HIBIT     0xD
30062306a36Sopenharmony_ci#define DSPDMAC_CHNLPROP_NAJ_MASK      0x2000
30162306a36Sopenharmony_ci
30262306a36Sopenharmony_ci#define DSPDMAC_CHNLPROP_ENH_LOBIT     0xE
30362306a36Sopenharmony_ci#define DSPDMAC_CHNLPROP_ENH_HIBIT     0xE
30462306a36Sopenharmony_ci#define DSPDMAC_CHNLPROP_ENH_MASK      0x4000
30562306a36Sopenharmony_ci
30662306a36Sopenharmony_ci#define DSPDMAC_CHNLPROP_MSPCE_LOBIT   0x10
30762306a36Sopenharmony_ci#define DSPDMAC_CHNLPROP_MSPCE_HIBIT   0x1B
30862306a36Sopenharmony_ci#define DSPDMAC_CHNLPROP_MSPCE_MASK    0xFFF0000
30962306a36Sopenharmony_ci
31062306a36Sopenharmony_ci#define DSPDMAC_CHNLPROP_AC_LOBIT      0x1C
31162306a36Sopenharmony_ci#define DSPDMAC_CHNLPROP_AC_HIBIT      0x1F
31262306a36Sopenharmony_ci#define DSPDMAC_CHNLPROP_AC_MASK       0xF0000000
31362306a36Sopenharmony_ci
31462306a36Sopenharmony_ci#define DSPDMAC_ACTIVE_MODULE_OFFSET   0xFFC
31562306a36Sopenharmony_ci#define DSPDMAC_ACTIVE_INST_OFFSET \
31662306a36Sopenharmony_ci	(DSPDMAC_CHIP_OFFSET + DSPDMAC_ACTIVE_MODULE_OFFSET)
31762306a36Sopenharmony_ci
31862306a36Sopenharmony_ci#define DSPDMAC_ACTIVE_AAR_LOBIT       0x0
31962306a36Sopenharmony_ci#define DSPDMAC_ACTIVE_AAR_HIBIT       0xB
32062306a36Sopenharmony_ci#define DSPDMAC_ACTIVE_AAR_MASK        0xFFF
32162306a36Sopenharmony_ci
32262306a36Sopenharmony_ci#define DSPDMAC_ACTIVE_WFR_LOBIT       0xC
32362306a36Sopenharmony_ci#define DSPDMAC_ACTIVE_WFR_HIBIT       0x17
32462306a36Sopenharmony_ci#define DSPDMAC_ACTIVE_WFR_MASK        0xFFF000
32562306a36Sopenharmony_ci
32662306a36Sopenharmony_ci#define DSP_AUX_MEM_BASE            0xE000
32762306a36Sopenharmony_ci#define INVALID_CHIP_ADDRESS        (~0U)
32862306a36Sopenharmony_ci
32962306a36Sopenharmony_ci#define X_SIZE  (XRAM_XRAM_CHANNEL_COUNT   * XRAM_XRAM_CHAN_INCR)
33062306a36Sopenharmony_ci#define Y_SIZE  (YRAM_YRAM_CHANNEL_COUNT   * YRAM_YRAM_CHAN_INCR)
33162306a36Sopenharmony_ci#define AX_SIZE (AXRAM_AXRAM_CHANNEL_COUNT * AXRAM_AXRAM_CHAN_INCR)
33262306a36Sopenharmony_ci#define AY_SIZE (AYRAM_AYRAM_CHANNEL_COUNT * AYRAM_AYRAM_CHAN_INCR)
33362306a36Sopenharmony_ci#define UC_SIZE (UC_UC_CHANNEL_COUNT       * UC_UC_CHAN_INCR)
33462306a36Sopenharmony_ci
33562306a36Sopenharmony_ci#define XEXT_SIZE (X_SIZE + AX_SIZE)
33662306a36Sopenharmony_ci#define YEXT_SIZE (Y_SIZE + AY_SIZE)
33762306a36Sopenharmony_ci
33862306a36Sopenharmony_ci#define U64K 0x10000UL
33962306a36Sopenharmony_ci
34062306a36Sopenharmony_ci#define X_END  (XRAM_CHIP_OFFSET  + X_SIZE)
34162306a36Sopenharmony_ci#define X_EXT  (XRAM_CHIP_OFFSET  + XEXT_SIZE)
34262306a36Sopenharmony_ci#define AX_END (XRAM_CHIP_OFFSET  + U64K*4)
34362306a36Sopenharmony_ci
34462306a36Sopenharmony_ci#define Y_END  (YRAM_CHIP_OFFSET  + Y_SIZE)
34562306a36Sopenharmony_ci#define Y_EXT  (YRAM_CHIP_OFFSET  + YEXT_SIZE)
34662306a36Sopenharmony_ci#define AY_END (YRAM_CHIP_OFFSET  + U64K*4)
34762306a36Sopenharmony_ci
34862306a36Sopenharmony_ci#define UC_END (UC_CHIP_OFFSET    + UC_SIZE)
34962306a36Sopenharmony_ci
35062306a36Sopenharmony_ci#define X_RANGE_MAIN(a, s) \
35162306a36Sopenharmony_ci	(((a)+((s)-1)*XRAM_XRAM_CHAN_INCR <  X_END))
35262306a36Sopenharmony_ci#define X_RANGE_AUX(a, s)  \
35362306a36Sopenharmony_ci	(((a) >= X_END) && ((a)+((s)-1)*XRAM_XRAM_CHAN_INCR < AX_END))
35462306a36Sopenharmony_ci#define X_RANGE_EXT(a, s)  \
35562306a36Sopenharmony_ci	(((a)+((s)-1)*XRAM_XRAM_CHAN_INCR <  X_EXT))
35662306a36Sopenharmony_ci#define X_RANGE_ALL(a, s)  \
35762306a36Sopenharmony_ci	(((a)+((s)-1)*XRAM_XRAM_CHAN_INCR < AX_END))
35862306a36Sopenharmony_ci
35962306a36Sopenharmony_ci#define Y_RANGE_MAIN(a, s) \
36062306a36Sopenharmony_ci	(((a) >= YRAM_CHIP_OFFSET) && \
36162306a36Sopenharmony_ci	((a)+((s)-1)*YRAM_YRAM_CHAN_INCR <  Y_END))
36262306a36Sopenharmony_ci#define Y_RANGE_AUX(a, s)  \
36362306a36Sopenharmony_ci	(((a) >= Y_END) && \
36462306a36Sopenharmony_ci	((a)+((s)-1)*YRAM_YRAM_CHAN_INCR < AY_END))
36562306a36Sopenharmony_ci#define Y_RANGE_EXT(a, s)  \
36662306a36Sopenharmony_ci	(((a) >= YRAM_CHIP_OFFSET) && \
36762306a36Sopenharmony_ci	((a)+((s)-1)*YRAM_YRAM_CHAN_INCR <  Y_EXT))
36862306a36Sopenharmony_ci#define Y_RANGE_ALL(a, s)  \
36962306a36Sopenharmony_ci	(((a) >= YRAM_CHIP_OFFSET) && \
37062306a36Sopenharmony_ci	((a)+((s)-1)*YRAM_YRAM_CHAN_INCR < AY_END))
37162306a36Sopenharmony_ci
37262306a36Sopenharmony_ci#define UC_RANGE(a, s) \
37362306a36Sopenharmony_ci	(((a) >= UC_CHIP_OFFSET) && \
37462306a36Sopenharmony_ci	((a)+((s)-1)*UC_UC_CHAN_INCR     < UC_END))
37562306a36Sopenharmony_ci
37662306a36Sopenharmony_ci#define X_OFF(a) \
37762306a36Sopenharmony_ci	(((a) - XRAM_CHIP_OFFSET) / XRAM_XRAM_CHAN_INCR)
37862306a36Sopenharmony_ci#define AX_OFF(a) \
37962306a36Sopenharmony_ci	(((a) % (AXRAM_AXRAM_CHANNEL_COUNT * \
38062306a36Sopenharmony_ci	AXRAM_AXRAM_CHAN_INCR)) / AXRAM_AXRAM_CHAN_INCR)
38162306a36Sopenharmony_ci
38262306a36Sopenharmony_ci#define Y_OFF(a) \
38362306a36Sopenharmony_ci	(((a) - YRAM_CHIP_OFFSET) / YRAM_YRAM_CHAN_INCR)
38462306a36Sopenharmony_ci#define AY_OFF(a) \
38562306a36Sopenharmony_ci	(((a) % (AYRAM_AYRAM_CHANNEL_COUNT * \
38662306a36Sopenharmony_ci	AYRAM_AYRAM_CHAN_INCR)) / AYRAM_AYRAM_CHAN_INCR)
38762306a36Sopenharmony_ci
38862306a36Sopenharmony_ci#define UC_OFF(a)  (((a) - UC_CHIP_OFFSET) / UC_UC_CHAN_INCR)
38962306a36Sopenharmony_ci
39062306a36Sopenharmony_ci#define X_EXT_MAIN_SIZE(a)  (XRAM_XRAM_CHANNEL_COUNT - X_OFF(a))
39162306a36Sopenharmony_ci#define X_EXT_AUX_SIZE(a, s) ((s) - X_EXT_MAIN_SIZE(a))
39262306a36Sopenharmony_ci
39362306a36Sopenharmony_ci#define Y_EXT_MAIN_SIZE(a)  (YRAM_YRAM_CHANNEL_COUNT - Y_OFF(a))
39462306a36Sopenharmony_ci#define Y_EXT_AUX_SIZE(a, s) ((s) - Y_EXT_MAIN_SIZE(a))
39562306a36Sopenharmony_ci
39662306a36Sopenharmony_ci#endif
397