18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */
28c2ecf20Sopenharmony_ci#ifndef __SOUND_CS46XX_H
38c2ecf20Sopenharmony_ci#define __SOUND_CS46XX_H
48c2ecf20Sopenharmony_ci
58c2ecf20Sopenharmony_ci/*
68c2ecf20Sopenharmony_ci *  Copyright (c) by Jaroslav Kysela <perex@perex.cz>,
78c2ecf20Sopenharmony_ci *		     Cirrus Logic, Inc.
88c2ecf20Sopenharmony_ci *  Definitions for Cirrus Logic CS46xx chips
98c2ecf20Sopenharmony_ci */
108c2ecf20Sopenharmony_ci
118c2ecf20Sopenharmony_ci#include <sound/pcm.h>
128c2ecf20Sopenharmony_ci#include <sound/pcm-indirect.h>
138c2ecf20Sopenharmony_ci#include <sound/rawmidi.h>
148c2ecf20Sopenharmony_ci#include <sound/ac97_codec.h>
158c2ecf20Sopenharmony_ci#include "cs46xx_dsp_spos.h"
168c2ecf20Sopenharmony_ci
178c2ecf20Sopenharmony_ci/*
188c2ecf20Sopenharmony_ci *  Direct registers
198c2ecf20Sopenharmony_ci */
208c2ecf20Sopenharmony_ci
218c2ecf20Sopenharmony_ci/*
228c2ecf20Sopenharmony_ci *  The following define the offsets of the registers accessed via base address
238c2ecf20Sopenharmony_ci *  register zero on the CS46xx part.
248c2ecf20Sopenharmony_ci */
258c2ecf20Sopenharmony_ci#define BA0_HISR				0x00000000
268c2ecf20Sopenharmony_ci#define BA0_HSR0                                0x00000004
278c2ecf20Sopenharmony_ci#define BA0_HICR                                0x00000008
288c2ecf20Sopenharmony_ci#define BA0_DMSR                                0x00000100
298c2ecf20Sopenharmony_ci#define BA0_HSAR                                0x00000110
308c2ecf20Sopenharmony_ci#define BA0_HDAR                                0x00000114
318c2ecf20Sopenharmony_ci#define BA0_HDMR                                0x00000118
328c2ecf20Sopenharmony_ci#define BA0_HDCR                                0x0000011C
338c2ecf20Sopenharmony_ci#define BA0_PFMC                                0x00000200
348c2ecf20Sopenharmony_ci#define BA0_PFCV1                               0x00000204
358c2ecf20Sopenharmony_ci#define BA0_PFCV2                               0x00000208
368c2ecf20Sopenharmony_ci#define BA0_PCICFG00                            0x00000300
378c2ecf20Sopenharmony_ci#define BA0_PCICFG04                            0x00000304
388c2ecf20Sopenharmony_ci#define BA0_PCICFG08                            0x00000308
398c2ecf20Sopenharmony_ci#define BA0_PCICFG0C                            0x0000030C
408c2ecf20Sopenharmony_ci#define BA0_PCICFG10                            0x00000310
418c2ecf20Sopenharmony_ci#define BA0_PCICFG14                            0x00000314
428c2ecf20Sopenharmony_ci#define BA0_PCICFG18                            0x00000318
438c2ecf20Sopenharmony_ci#define BA0_PCICFG1C                            0x0000031C
448c2ecf20Sopenharmony_ci#define BA0_PCICFG20                            0x00000320
458c2ecf20Sopenharmony_ci#define BA0_PCICFG24                            0x00000324
468c2ecf20Sopenharmony_ci#define BA0_PCICFG28                            0x00000328
478c2ecf20Sopenharmony_ci#define BA0_PCICFG2C                            0x0000032C
488c2ecf20Sopenharmony_ci#define BA0_PCICFG30                            0x00000330
498c2ecf20Sopenharmony_ci#define BA0_PCICFG34                            0x00000334
508c2ecf20Sopenharmony_ci#define BA0_PCICFG38                            0x00000338
518c2ecf20Sopenharmony_ci#define BA0_PCICFG3C                            0x0000033C
528c2ecf20Sopenharmony_ci#define BA0_CLKCR1                              0x00000400
538c2ecf20Sopenharmony_ci#define BA0_CLKCR2                              0x00000404
548c2ecf20Sopenharmony_ci#define BA0_PLLM                                0x00000408
558c2ecf20Sopenharmony_ci#define BA0_PLLCC                               0x0000040C
568c2ecf20Sopenharmony_ci#define BA0_FRR                                 0x00000410
578c2ecf20Sopenharmony_ci#define BA0_CFL1                                0x00000414
588c2ecf20Sopenharmony_ci#define BA0_CFL2                                0x00000418
598c2ecf20Sopenharmony_ci#define BA0_SERMC1                              0x00000420
608c2ecf20Sopenharmony_ci#define BA0_SERMC2                              0x00000424
618c2ecf20Sopenharmony_ci#define BA0_SERC1                               0x00000428
628c2ecf20Sopenharmony_ci#define BA0_SERC2                               0x0000042C
638c2ecf20Sopenharmony_ci#define BA0_SERC3                               0x00000430
648c2ecf20Sopenharmony_ci#define BA0_SERC4                               0x00000434
658c2ecf20Sopenharmony_ci#define BA0_SERC5                               0x00000438
668c2ecf20Sopenharmony_ci#define BA0_SERBSP                              0x0000043C
678c2ecf20Sopenharmony_ci#define BA0_SERBST                              0x00000440
688c2ecf20Sopenharmony_ci#define BA0_SERBCM                              0x00000444
698c2ecf20Sopenharmony_ci#define BA0_SERBAD                              0x00000448
708c2ecf20Sopenharmony_ci#define BA0_SERBCF                              0x0000044C
718c2ecf20Sopenharmony_ci#define BA0_SERBWP                              0x00000450
728c2ecf20Sopenharmony_ci#define BA0_SERBRP                              0x00000454
738c2ecf20Sopenharmony_ci#ifndef NO_CS4612
748c2ecf20Sopenharmony_ci#define BA0_ASER_FADDR                          0x00000458
758c2ecf20Sopenharmony_ci#endif
768c2ecf20Sopenharmony_ci#define BA0_ACCTL                               0x00000460
778c2ecf20Sopenharmony_ci#define BA0_ACSTS                               0x00000464
788c2ecf20Sopenharmony_ci#define BA0_ACOSV                               0x00000468
798c2ecf20Sopenharmony_ci#define BA0_ACCAD                               0x0000046C
808c2ecf20Sopenharmony_ci#define BA0_ACCDA                               0x00000470
818c2ecf20Sopenharmony_ci#define BA0_ACISV                               0x00000474
828c2ecf20Sopenharmony_ci#define BA0_ACSAD                               0x00000478
838c2ecf20Sopenharmony_ci#define BA0_ACSDA                               0x0000047C
848c2ecf20Sopenharmony_ci#define BA0_JSPT                                0x00000480
858c2ecf20Sopenharmony_ci#define BA0_JSCTL                               0x00000484
868c2ecf20Sopenharmony_ci#define BA0_JSC1                                0x00000488
878c2ecf20Sopenharmony_ci#define BA0_JSC2                                0x0000048C
888c2ecf20Sopenharmony_ci#define BA0_MIDCR                               0x00000490
898c2ecf20Sopenharmony_ci#define BA0_MIDSR                               0x00000494
908c2ecf20Sopenharmony_ci#define BA0_MIDWP                               0x00000498
918c2ecf20Sopenharmony_ci#define BA0_MIDRP                               0x0000049C
928c2ecf20Sopenharmony_ci#define BA0_JSIO                                0x000004A0
938c2ecf20Sopenharmony_ci#ifndef NO_CS4612
948c2ecf20Sopenharmony_ci#define BA0_ASER_MASTER                         0x000004A4
958c2ecf20Sopenharmony_ci#endif
968c2ecf20Sopenharmony_ci#define BA0_CFGI                                0x000004B0
978c2ecf20Sopenharmony_ci#define BA0_SSVID                               0x000004B4
988c2ecf20Sopenharmony_ci#define BA0_GPIOR                               0x000004B8
998c2ecf20Sopenharmony_ci#ifndef NO_CS4612
1008c2ecf20Sopenharmony_ci#define BA0_EGPIODR                             0x000004BC
1018c2ecf20Sopenharmony_ci#define BA0_EGPIOPTR                            0x000004C0
1028c2ecf20Sopenharmony_ci#define BA0_EGPIOTR                             0x000004C4
1038c2ecf20Sopenharmony_ci#define BA0_EGPIOWR                             0x000004C8
1048c2ecf20Sopenharmony_ci#define BA0_EGPIOSR                             0x000004CC
1058c2ecf20Sopenharmony_ci#define BA0_SERC6                               0x000004D0
1068c2ecf20Sopenharmony_ci#define BA0_SERC7                               0x000004D4
1078c2ecf20Sopenharmony_ci#define BA0_SERACC                              0x000004D8
1088c2ecf20Sopenharmony_ci#define BA0_ACCTL2                              0x000004E0
1098c2ecf20Sopenharmony_ci#define BA0_ACSTS2                              0x000004E4
1108c2ecf20Sopenharmony_ci#define BA0_ACOSV2                              0x000004E8
1118c2ecf20Sopenharmony_ci#define BA0_ACCAD2                              0x000004EC
1128c2ecf20Sopenharmony_ci#define BA0_ACCDA2                              0x000004F0
1138c2ecf20Sopenharmony_ci#define BA0_ACISV2                              0x000004F4
1148c2ecf20Sopenharmony_ci#define BA0_ACSAD2                              0x000004F8
1158c2ecf20Sopenharmony_ci#define BA0_ACSDA2                              0x000004FC
1168c2ecf20Sopenharmony_ci#define BA0_IOTAC0                              0x00000500
1178c2ecf20Sopenharmony_ci#define BA0_IOTAC1                              0x00000504
1188c2ecf20Sopenharmony_ci#define BA0_IOTAC2                              0x00000508
1198c2ecf20Sopenharmony_ci#define BA0_IOTAC3                              0x0000050C
1208c2ecf20Sopenharmony_ci#define BA0_IOTAC4                              0x00000510
1218c2ecf20Sopenharmony_ci#define BA0_IOTAC5                              0x00000514
1228c2ecf20Sopenharmony_ci#define BA0_IOTAC6                              0x00000518
1238c2ecf20Sopenharmony_ci#define BA0_IOTAC7                              0x0000051C
1248c2ecf20Sopenharmony_ci#define BA0_IOTAC8                              0x00000520
1258c2ecf20Sopenharmony_ci#define BA0_IOTAC9                              0x00000524
1268c2ecf20Sopenharmony_ci#define BA0_IOTAC10                             0x00000528
1278c2ecf20Sopenharmony_ci#define BA0_IOTAC11                             0x0000052C
1288c2ecf20Sopenharmony_ci#define BA0_IOTFR0                              0x00000540
1298c2ecf20Sopenharmony_ci#define BA0_IOTFR1                              0x00000544
1308c2ecf20Sopenharmony_ci#define BA0_IOTFR2                              0x00000548
1318c2ecf20Sopenharmony_ci#define BA0_IOTFR3                              0x0000054C
1328c2ecf20Sopenharmony_ci#define BA0_IOTFR4                              0x00000550
1338c2ecf20Sopenharmony_ci#define BA0_IOTFR5                              0x00000554
1348c2ecf20Sopenharmony_ci#define BA0_IOTFR6                              0x00000558
1358c2ecf20Sopenharmony_ci#define BA0_IOTFR7                              0x0000055C
1368c2ecf20Sopenharmony_ci#define BA0_IOTFIFO                             0x00000580
1378c2ecf20Sopenharmony_ci#define BA0_IOTRRD                              0x00000584
1388c2ecf20Sopenharmony_ci#define BA0_IOTFP                               0x00000588
1398c2ecf20Sopenharmony_ci#define BA0_IOTCR                               0x0000058C
1408c2ecf20Sopenharmony_ci#define BA0_DPCID                               0x00000590
1418c2ecf20Sopenharmony_ci#define BA0_DPCIA                               0x00000594
1428c2ecf20Sopenharmony_ci#define BA0_DPCIC                               0x00000598
1438c2ecf20Sopenharmony_ci#define BA0_PCPCIR                              0x00000600
1448c2ecf20Sopenharmony_ci#define BA0_PCPCIG                              0x00000604
1458c2ecf20Sopenharmony_ci#define BA0_PCPCIEN                             0x00000608
1468c2ecf20Sopenharmony_ci#define BA0_EPCIPMC                             0x00000610
1478c2ecf20Sopenharmony_ci#endif
1488c2ecf20Sopenharmony_ci
1498c2ecf20Sopenharmony_ci/*
1508c2ecf20Sopenharmony_ci *  The following define the offsets of the registers and memories accessed via
1518c2ecf20Sopenharmony_ci *  base address register one on the CS46xx part.
1528c2ecf20Sopenharmony_ci */
1538c2ecf20Sopenharmony_ci#define BA1_SP_DMEM0                            0x00000000
1548c2ecf20Sopenharmony_ci#define BA1_SP_DMEM1                            0x00010000
1558c2ecf20Sopenharmony_ci#define BA1_SP_PMEM                             0x00020000
1568c2ecf20Sopenharmony_ci#define BA1_SP_REG				0x00030000
1578c2ecf20Sopenharmony_ci#define BA1_SPCR                                0x00030000
1588c2ecf20Sopenharmony_ci#define BA1_DREG                                0x00030004
1598c2ecf20Sopenharmony_ci#define BA1_DSRWP                               0x00030008
1608c2ecf20Sopenharmony_ci#define BA1_TWPR                                0x0003000C
1618c2ecf20Sopenharmony_ci#define BA1_SPWR                                0x00030010
1628c2ecf20Sopenharmony_ci#define BA1_SPIR                                0x00030014
1638c2ecf20Sopenharmony_ci#define BA1_FGR1                                0x00030020
1648c2ecf20Sopenharmony_ci#define BA1_SPCS                                0x00030028
1658c2ecf20Sopenharmony_ci#define BA1_SDSR                                0x0003002C
1668c2ecf20Sopenharmony_ci#define BA1_FRMT                                0x00030030
1678c2ecf20Sopenharmony_ci#define BA1_FRCC                                0x00030034
1688c2ecf20Sopenharmony_ci#define BA1_FRSC                                0x00030038
1698c2ecf20Sopenharmony_ci#define BA1_OMNI_MEM                            0x000E0000
1708c2ecf20Sopenharmony_ci
1718c2ecf20Sopenharmony_ci
1728c2ecf20Sopenharmony_ci/*
1738c2ecf20Sopenharmony_ci *  The following defines are for the flags in the host interrupt status
1748c2ecf20Sopenharmony_ci *  register.
1758c2ecf20Sopenharmony_ci */
1768c2ecf20Sopenharmony_ci#define HISR_VC_MASK                            0x0000FFFF
1778c2ecf20Sopenharmony_ci#define HISR_VC0                                0x00000001
1788c2ecf20Sopenharmony_ci#define HISR_VC1                                0x00000002
1798c2ecf20Sopenharmony_ci#define HISR_VC2                                0x00000004
1808c2ecf20Sopenharmony_ci#define HISR_VC3                                0x00000008
1818c2ecf20Sopenharmony_ci#define HISR_VC4                                0x00000010
1828c2ecf20Sopenharmony_ci#define HISR_VC5                                0x00000020
1838c2ecf20Sopenharmony_ci#define HISR_VC6                                0x00000040
1848c2ecf20Sopenharmony_ci#define HISR_VC7                                0x00000080
1858c2ecf20Sopenharmony_ci#define HISR_VC8                                0x00000100
1868c2ecf20Sopenharmony_ci#define HISR_VC9                                0x00000200
1878c2ecf20Sopenharmony_ci#define HISR_VC10                               0x00000400
1888c2ecf20Sopenharmony_ci#define HISR_VC11                               0x00000800
1898c2ecf20Sopenharmony_ci#define HISR_VC12                               0x00001000
1908c2ecf20Sopenharmony_ci#define HISR_VC13                               0x00002000
1918c2ecf20Sopenharmony_ci#define HISR_VC14                               0x00004000
1928c2ecf20Sopenharmony_ci#define HISR_VC15                               0x00008000
1938c2ecf20Sopenharmony_ci#define HISR_INT0                               0x00010000
1948c2ecf20Sopenharmony_ci#define HISR_INT1                               0x00020000
1958c2ecf20Sopenharmony_ci#define HISR_DMAI                               0x00040000
1968c2ecf20Sopenharmony_ci#define HISR_FROVR                              0x00080000
1978c2ecf20Sopenharmony_ci#define HISR_MIDI                               0x00100000
1988c2ecf20Sopenharmony_ci#ifdef NO_CS4612
1998c2ecf20Sopenharmony_ci#define HISR_RESERVED                           0x0FE00000
2008c2ecf20Sopenharmony_ci#else
2018c2ecf20Sopenharmony_ci#define HISR_SBINT                              0x00200000
2028c2ecf20Sopenharmony_ci#define HISR_RESERVED                           0x0FC00000
2038c2ecf20Sopenharmony_ci#endif
2048c2ecf20Sopenharmony_ci#define HISR_H0P                                0x40000000
2058c2ecf20Sopenharmony_ci#define HISR_INTENA                             0x80000000
2068c2ecf20Sopenharmony_ci
2078c2ecf20Sopenharmony_ci/*
2088c2ecf20Sopenharmony_ci *  The following defines are for the flags in the host signal register 0.
2098c2ecf20Sopenharmony_ci */
2108c2ecf20Sopenharmony_ci#define HSR0_VC_MASK                            0xFFFFFFFF
2118c2ecf20Sopenharmony_ci#define HSR0_VC16                               0x00000001
2128c2ecf20Sopenharmony_ci#define HSR0_VC17                               0x00000002
2138c2ecf20Sopenharmony_ci#define HSR0_VC18                               0x00000004
2148c2ecf20Sopenharmony_ci#define HSR0_VC19                               0x00000008
2158c2ecf20Sopenharmony_ci#define HSR0_VC20                               0x00000010
2168c2ecf20Sopenharmony_ci#define HSR0_VC21                               0x00000020
2178c2ecf20Sopenharmony_ci#define HSR0_VC22                               0x00000040
2188c2ecf20Sopenharmony_ci#define HSR0_VC23                               0x00000080
2198c2ecf20Sopenharmony_ci#define HSR0_VC24                               0x00000100
2208c2ecf20Sopenharmony_ci#define HSR0_VC25                               0x00000200
2218c2ecf20Sopenharmony_ci#define HSR0_VC26                               0x00000400
2228c2ecf20Sopenharmony_ci#define HSR0_VC27                               0x00000800
2238c2ecf20Sopenharmony_ci#define HSR0_VC28                               0x00001000
2248c2ecf20Sopenharmony_ci#define HSR0_VC29                               0x00002000
2258c2ecf20Sopenharmony_ci#define HSR0_VC30                               0x00004000
2268c2ecf20Sopenharmony_ci#define HSR0_VC31                               0x00008000
2278c2ecf20Sopenharmony_ci#define HSR0_VC32                               0x00010000
2288c2ecf20Sopenharmony_ci#define HSR0_VC33                               0x00020000
2298c2ecf20Sopenharmony_ci#define HSR0_VC34                               0x00040000
2308c2ecf20Sopenharmony_ci#define HSR0_VC35                               0x00080000
2318c2ecf20Sopenharmony_ci#define HSR0_VC36                               0x00100000
2328c2ecf20Sopenharmony_ci#define HSR0_VC37                               0x00200000
2338c2ecf20Sopenharmony_ci#define HSR0_VC38                               0x00400000
2348c2ecf20Sopenharmony_ci#define HSR0_VC39                               0x00800000
2358c2ecf20Sopenharmony_ci#define HSR0_VC40                               0x01000000
2368c2ecf20Sopenharmony_ci#define HSR0_VC41                               0x02000000
2378c2ecf20Sopenharmony_ci#define HSR0_VC42                               0x04000000
2388c2ecf20Sopenharmony_ci#define HSR0_VC43                               0x08000000
2398c2ecf20Sopenharmony_ci#define HSR0_VC44                               0x10000000
2408c2ecf20Sopenharmony_ci#define HSR0_VC45                               0x20000000
2418c2ecf20Sopenharmony_ci#define HSR0_VC46                               0x40000000
2428c2ecf20Sopenharmony_ci#define HSR0_VC47                               0x80000000
2438c2ecf20Sopenharmony_ci
2448c2ecf20Sopenharmony_ci/*
2458c2ecf20Sopenharmony_ci *  The following defines are for the flags in the host interrupt control
2468c2ecf20Sopenharmony_ci *  register.
2478c2ecf20Sopenharmony_ci */
2488c2ecf20Sopenharmony_ci#define HICR_IEV                                0x00000001
2498c2ecf20Sopenharmony_ci#define HICR_CHGM                               0x00000002
2508c2ecf20Sopenharmony_ci
2518c2ecf20Sopenharmony_ci/*
2528c2ecf20Sopenharmony_ci *  The following defines are for the flags in the DMA status register.
2538c2ecf20Sopenharmony_ci */
2548c2ecf20Sopenharmony_ci#define DMSR_HP                                 0x00000001
2558c2ecf20Sopenharmony_ci#define DMSR_HR                                 0x00000002
2568c2ecf20Sopenharmony_ci#define DMSR_SP                                 0x00000004
2578c2ecf20Sopenharmony_ci#define DMSR_SR                                 0x00000008
2588c2ecf20Sopenharmony_ci
2598c2ecf20Sopenharmony_ci/*
2608c2ecf20Sopenharmony_ci *  The following defines are for the flags in the host DMA source address
2618c2ecf20Sopenharmony_ci *  register.
2628c2ecf20Sopenharmony_ci */
2638c2ecf20Sopenharmony_ci#define HSAR_HOST_ADDR_MASK                     0xFFFFFFFF
2648c2ecf20Sopenharmony_ci#define HSAR_DSP_ADDR_MASK                      0x0000FFFF
2658c2ecf20Sopenharmony_ci#define HSAR_MEMID_MASK                         0x000F0000
2668c2ecf20Sopenharmony_ci#define HSAR_MEMID_SP_DMEM0                     0x00000000
2678c2ecf20Sopenharmony_ci#define HSAR_MEMID_SP_DMEM1                     0x00010000
2688c2ecf20Sopenharmony_ci#define HSAR_MEMID_SP_PMEM                      0x00020000
2698c2ecf20Sopenharmony_ci#define HSAR_MEMID_SP_DEBUG                     0x00030000
2708c2ecf20Sopenharmony_ci#define HSAR_MEMID_OMNI_MEM                     0x000E0000
2718c2ecf20Sopenharmony_ci#define HSAR_END                                0x40000000
2728c2ecf20Sopenharmony_ci#define HSAR_ERR                                0x80000000
2738c2ecf20Sopenharmony_ci
2748c2ecf20Sopenharmony_ci/*
2758c2ecf20Sopenharmony_ci *  The following defines are for the flags in the host DMA destination address
2768c2ecf20Sopenharmony_ci *  register.
2778c2ecf20Sopenharmony_ci */
2788c2ecf20Sopenharmony_ci#define HDAR_HOST_ADDR_MASK                     0xFFFFFFFF
2798c2ecf20Sopenharmony_ci#define HDAR_DSP_ADDR_MASK                      0x0000FFFF
2808c2ecf20Sopenharmony_ci#define HDAR_MEMID_MASK                         0x000F0000
2818c2ecf20Sopenharmony_ci#define HDAR_MEMID_SP_DMEM0                     0x00000000
2828c2ecf20Sopenharmony_ci#define HDAR_MEMID_SP_DMEM1                     0x00010000
2838c2ecf20Sopenharmony_ci#define HDAR_MEMID_SP_PMEM                      0x00020000
2848c2ecf20Sopenharmony_ci#define HDAR_MEMID_SP_DEBUG                     0x00030000
2858c2ecf20Sopenharmony_ci#define HDAR_MEMID_OMNI_MEM                     0x000E0000
2868c2ecf20Sopenharmony_ci#define HDAR_END                                0x40000000
2878c2ecf20Sopenharmony_ci#define HDAR_ERR                                0x80000000
2888c2ecf20Sopenharmony_ci
2898c2ecf20Sopenharmony_ci/*
2908c2ecf20Sopenharmony_ci *  The following defines are for the flags in the host DMA control register.
2918c2ecf20Sopenharmony_ci */
2928c2ecf20Sopenharmony_ci#define HDMR_AC_MASK                            0x0000F000
2938c2ecf20Sopenharmony_ci#define HDMR_AC_8_16                            0x00001000
2948c2ecf20Sopenharmony_ci#define HDMR_AC_M_S                             0x00002000
2958c2ecf20Sopenharmony_ci#define HDMR_AC_B_L                             0x00004000
2968c2ecf20Sopenharmony_ci#define HDMR_AC_S_U                             0x00008000
2978c2ecf20Sopenharmony_ci
2988c2ecf20Sopenharmony_ci/*
2998c2ecf20Sopenharmony_ci *  The following defines are for the flags in the host DMA control register.
3008c2ecf20Sopenharmony_ci */
3018c2ecf20Sopenharmony_ci#define HDCR_COUNT_MASK                         0x000003FF
3028c2ecf20Sopenharmony_ci#define HDCR_DONE                               0x00004000
3038c2ecf20Sopenharmony_ci#define HDCR_OPT                                0x00008000
3048c2ecf20Sopenharmony_ci#define HDCR_WBD                                0x00400000
3058c2ecf20Sopenharmony_ci#define HDCR_WBS                                0x00800000
3068c2ecf20Sopenharmony_ci#define HDCR_DMS_MASK                           0x07000000
3078c2ecf20Sopenharmony_ci#define HDCR_DMS_LINEAR                         0x00000000
3088c2ecf20Sopenharmony_ci#define HDCR_DMS_16_DWORDS                      0x01000000
3098c2ecf20Sopenharmony_ci#define HDCR_DMS_32_DWORDS                      0x02000000
3108c2ecf20Sopenharmony_ci#define HDCR_DMS_64_DWORDS                      0x03000000
3118c2ecf20Sopenharmony_ci#define HDCR_DMS_128_DWORDS                     0x04000000
3128c2ecf20Sopenharmony_ci#define HDCR_DMS_256_DWORDS                     0x05000000
3138c2ecf20Sopenharmony_ci#define HDCR_DMS_512_DWORDS                     0x06000000
3148c2ecf20Sopenharmony_ci#define HDCR_DMS_1024_DWORDS                    0x07000000
3158c2ecf20Sopenharmony_ci#define HDCR_DH                                 0x08000000
3168c2ecf20Sopenharmony_ci#define HDCR_SMS_MASK                           0x70000000
3178c2ecf20Sopenharmony_ci#define HDCR_SMS_LINEAR                         0x00000000
3188c2ecf20Sopenharmony_ci#define HDCR_SMS_16_DWORDS                      0x10000000
3198c2ecf20Sopenharmony_ci#define HDCR_SMS_32_DWORDS                      0x20000000
3208c2ecf20Sopenharmony_ci#define HDCR_SMS_64_DWORDS                      0x30000000
3218c2ecf20Sopenharmony_ci#define HDCR_SMS_128_DWORDS                     0x40000000
3228c2ecf20Sopenharmony_ci#define HDCR_SMS_256_DWORDS                     0x50000000
3238c2ecf20Sopenharmony_ci#define HDCR_SMS_512_DWORDS                     0x60000000
3248c2ecf20Sopenharmony_ci#define HDCR_SMS_1024_DWORDS                    0x70000000
3258c2ecf20Sopenharmony_ci#define HDCR_SH                                 0x80000000
3268c2ecf20Sopenharmony_ci#define HDCR_COUNT_SHIFT                        0
3278c2ecf20Sopenharmony_ci
3288c2ecf20Sopenharmony_ci/*
3298c2ecf20Sopenharmony_ci *  The following defines are for the flags in the performance monitor control
3308c2ecf20Sopenharmony_ci *  register.
3318c2ecf20Sopenharmony_ci */
3328c2ecf20Sopenharmony_ci#define PFMC_C1SS_MASK                          0x0000001F
3338c2ecf20Sopenharmony_ci#define PFMC_C1EV                               0x00000020
3348c2ecf20Sopenharmony_ci#define PFMC_C1RS                               0x00008000
3358c2ecf20Sopenharmony_ci#define PFMC_C2SS_MASK                          0x001F0000
3368c2ecf20Sopenharmony_ci#define PFMC_C2EV                               0x00200000
3378c2ecf20Sopenharmony_ci#define PFMC_C2RS                               0x80000000
3388c2ecf20Sopenharmony_ci#define PFMC_C1SS_SHIFT                         0
3398c2ecf20Sopenharmony_ci#define PFMC_C2SS_SHIFT                         16
3408c2ecf20Sopenharmony_ci#define PFMC_BUS_GRANT                          0
3418c2ecf20Sopenharmony_ci#define PFMC_GRANT_AFTER_REQ                    1
3428c2ecf20Sopenharmony_ci#define PFMC_TRANSACTION                        2
3438c2ecf20Sopenharmony_ci#define PFMC_DWORD_TRANSFER                     3
3448c2ecf20Sopenharmony_ci#define PFMC_SLAVE_READ                         4
3458c2ecf20Sopenharmony_ci#define PFMC_SLAVE_WRITE                        5
3468c2ecf20Sopenharmony_ci#define PFMC_PREEMPTION                         6
3478c2ecf20Sopenharmony_ci#define PFMC_DISCONNECT_RETRY                   7
3488c2ecf20Sopenharmony_ci#define PFMC_INTERRUPT                          8
3498c2ecf20Sopenharmony_ci#define PFMC_BUS_OWNERSHIP                      9
3508c2ecf20Sopenharmony_ci#define PFMC_TRANSACTION_LAG                    10
3518c2ecf20Sopenharmony_ci#define PFMC_PCI_CLOCK                          11
3528c2ecf20Sopenharmony_ci#define PFMC_SERIAL_CLOCK                       12
3538c2ecf20Sopenharmony_ci#define PFMC_SP_CLOCK                           13
3548c2ecf20Sopenharmony_ci
3558c2ecf20Sopenharmony_ci/*
3568c2ecf20Sopenharmony_ci *  The following defines are for the flags in the performance counter value 1
3578c2ecf20Sopenharmony_ci *  register.
3588c2ecf20Sopenharmony_ci */
3598c2ecf20Sopenharmony_ci#define PFCV1_PC1V_MASK                         0xFFFFFFFF
3608c2ecf20Sopenharmony_ci#define PFCV1_PC1V_SHIFT                        0
3618c2ecf20Sopenharmony_ci
3628c2ecf20Sopenharmony_ci/*
3638c2ecf20Sopenharmony_ci *  The following defines are for the flags in the performance counter value 2
3648c2ecf20Sopenharmony_ci *  register.
3658c2ecf20Sopenharmony_ci */
3668c2ecf20Sopenharmony_ci#define PFCV2_PC2V_MASK                         0xFFFFFFFF
3678c2ecf20Sopenharmony_ci#define PFCV2_PC2V_SHIFT                        0
3688c2ecf20Sopenharmony_ci
3698c2ecf20Sopenharmony_ci/*
3708c2ecf20Sopenharmony_ci *  The following defines are for the flags in the clock control register 1.
3718c2ecf20Sopenharmony_ci */
3728c2ecf20Sopenharmony_ci#define CLKCR1_OSCS                             0x00000001
3738c2ecf20Sopenharmony_ci#define CLKCR1_OSCP                             0x00000002
3748c2ecf20Sopenharmony_ci#define CLKCR1_PLLSS_MASK                       0x0000000C
3758c2ecf20Sopenharmony_ci#define CLKCR1_PLLSS_SERIAL                     0x00000000
3768c2ecf20Sopenharmony_ci#define CLKCR1_PLLSS_CRYSTAL                    0x00000004
3778c2ecf20Sopenharmony_ci#define CLKCR1_PLLSS_PCI                        0x00000008
3788c2ecf20Sopenharmony_ci#define CLKCR1_PLLSS_RESERVED                   0x0000000C
3798c2ecf20Sopenharmony_ci#define CLKCR1_PLLP                             0x00000010
3808c2ecf20Sopenharmony_ci#define CLKCR1_SWCE                             0x00000020
3818c2ecf20Sopenharmony_ci#define CLKCR1_PLLOS                            0x00000040
3828c2ecf20Sopenharmony_ci
3838c2ecf20Sopenharmony_ci/*
3848c2ecf20Sopenharmony_ci *  The following defines are for the flags in the clock control register 2.
3858c2ecf20Sopenharmony_ci */
3868c2ecf20Sopenharmony_ci#define CLKCR2_PDIVS_MASK                       0x0000000F
3878c2ecf20Sopenharmony_ci#define CLKCR2_PDIVS_1                          0x00000001
3888c2ecf20Sopenharmony_ci#define CLKCR2_PDIVS_2                          0x00000002
3898c2ecf20Sopenharmony_ci#define CLKCR2_PDIVS_4                          0x00000004
3908c2ecf20Sopenharmony_ci#define CLKCR2_PDIVS_7                          0x00000007
3918c2ecf20Sopenharmony_ci#define CLKCR2_PDIVS_8                          0x00000008
3928c2ecf20Sopenharmony_ci#define CLKCR2_PDIVS_16                         0x00000000
3938c2ecf20Sopenharmony_ci
3948c2ecf20Sopenharmony_ci/*
3958c2ecf20Sopenharmony_ci *  The following defines are for the flags in the PLL multiplier register.
3968c2ecf20Sopenharmony_ci */
3978c2ecf20Sopenharmony_ci#define PLLM_MASK                               0x000000FF
3988c2ecf20Sopenharmony_ci#define PLLM_SHIFT                              0
3998c2ecf20Sopenharmony_ci
4008c2ecf20Sopenharmony_ci/*
4018c2ecf20Sopenharmony_ci *  The following defines are for the flags in the PLL capacitor coefficient
4028c2ecf20Sopenharmony_ci *  register.
4038c2ecf20Sopenharmony_ci */
4048c2ecf20Sopenharmony_ci#define PLLCC_CDR_MASK                          0x00000007
4058c2ecf20Sopenharmony_ci#ifndef NO_CS4610
4068c2ecf20Sopenharmony_ci#define PLLCC_CDR_240_350_MHZ                   0x00000000
4078c2ecf20Sopenharmony_ci#define PLLCC_CDR_184_265_MHZ                   0x00000001
4088c2ecf20Sopenharmony_ci#define PLLCC_CDR_144_205_MHZ                   0x00000002
4098c2ecf20Sopenharmony_ci#define PLLCC_CDR_111_160_MHZ                   0x00000003
4108c2ecf20Sopenharmony_ci#define PLLCC_CDR_87_123_MHZ                    0x00000004
4118c2ecf20Sopenharmony_ci#define PLLCC_CDR_67_96_MHZ                     0x00000005
4128c2ecf20Sopenharmony_ci#define PLLCC_CDR_52_74_MHZ                     0x00000006
4138c2ecf20Sopenharmony_ci#define PLLCC_CDR_45_58_MHZ                     0x00000007
4148c2ecf20Sopenharmony_ci#endif
4158c2ecf20Sopenharmony_ci#ifndef NO_CS4612
4168c2ecf20Sopenharmony_ci#define PLLCC_CDR_271_398_MHZ                   0x00000000
4178c2ecf20Sopenharmony_ci#define PLLCC_CDR_227_330_MHZ                   0x00000001
4188c2ecf20Sopenharmony_ci#define PLLCC_CDR_167_239_MHZ                   0x00000002
4198c2ecf20Sopenharmony_ci#define PLLCC_CDR_150_215_MHZ                   0x00000003
4208c2ecf20Sopenharmony_ci#define PLLCC_CDR_107_154_MHZ                   0x00000004
4218c2ecf20Sopenharmony_ci#define PLLCC_CDR_98_140_MHZ                    0x00000005
4228c2ecf20Sopenharmony_ci#define PLLCC_CDR_73_104_MHZ                    0x00000006
4238c2ecf20Sopenharmony_ci#define PLLCC_CDR_63_90_MHZ                     0x00000007
4248c2ecf20Sopenharmony_ci#endif
4258c2ecf20Sopenharmony_ci#define PLLCC_LPF_MASK                          0x000000F8
4268c2ecf20Sopenharmony_ci#ifndef NO_CS4610
4278c2ecf20Sopenharmony_ci#define PLLCC_LPF_23850_60000_KHZ               0x00000000
4288c2ecf20Sopenharmony_ci#define PLLCC_LPF_7960_26290_KHZ                0x00000008
4298c2ecf20Sopenharmony_ci#define PLLCC_LPF_4160_10980_KHZ                0x00000018
4308c2ecf20Sopenharmony_ci#define PLLCC_LPF_1740_4580_KHZ                 0x00000038
4318c2ecf20Sopenharmony_ci#define PLLCC_LPF_724_1910_KHZ                  0x00000078
4328c2ecf20Sopenharmony_ci#define PLLCC_LPF_317_798_KHZ                   0x000000F8
4338c2ecf20Sopenharmony_ci#endif
4348c2ecf20Sopenharmony_ci#ifndef NO_CS4612
4358c2ecf20Sopenharmony_ci#define PLLCC_LPF_25580_64530_KHZ               0x00000000
4368c2ecf20Sopenharmony_ci#define PLLCC_LPF_14360_37270_KHZ               0x00000008
4378c2ecf20Sopenharmony_ci#define PLLCC_LPF_6100_16020_KHZ                0x00000018
4388c2ecf20Sopenharmony_ci#define PLLCC_LPF_2540_6690_KHZ                 0x00000038
4398c2ecf20Sopenharmony_ci#define PLLCC_LPF_1050_2780_KHZ                 0x00000078
4408c2ecf20Sopenharmony_ci#define PLLCC_LPF_450_1160_KHZ                  0x000000F8
4418c2ecf20Sopenharmony_ci#endif
4428c2ecf20Sopenharmony_ci
4438c2ecf20Sopenharmony_ci/*
4448c2ecf20Sopenharmony_ci *  The following defines are for the flags in the feature reporting register.
4458c2ecf20Sopenharmony_ci */
4468c2ecf20Sopenharmony_ci#define FRR_FAB_MASK                            0x00000003
4478c2ecf20Sopenharmony_ci#define FRR_MASK_MASK                           0x0000001C
4488c2ecf20Sopenharmony_ci#ifdef NO_CS4612
4498c2ecf20Sopenharmony_ci#define FRR_CFOP_MASK                           0x000000E0
4508c2ecf20Sopenharmony_ci#else
4518c2ecf20Sopenharmony_ci#define FRR_CFOP_MASK                           0x00000FE0
4528c2ecf20Sopenharmony_ci#endif
4538c2ecf20Sopenharmony_ci#define FRR_CFOP_NOT_DVD                        0x00000020
4548c2ecf20Sopenharmony_ci#define FRR_CFOP_A3D                            0x00000040
4558c2ecf20Sopenharmony_ci#define FRR_CFOP_128_PIN                        0x00000080
4568c2ecf20Sopenharmony_ci#ifndef NO_CS4612
4578c2ecf20Sopenharmony_ci#define FRR_CFOP_CS4280                         0x00000800
4588c2ecf20Sopenharmony_ci#endif
4598c2ecf20Sopenharmony_ci#define FRR_FAB_SHIFT                           0
4608c2ecf20Sopenharmony_ci#define FRR_MASK_SHIFT                          2
4618c2ecf20Sopenharmony_ci#define FRR_CFOP_SHIFT                          5
4628c2ecf20Sopenharmony_ci
4638c2ecf20Sopenharmony_ci/*
4648c2ecf20Sopenharmony_ci *  The following defines are for the flags in the configuration load 1
4658c2ecf20Sopenharmony_ci *  register.
4668c2ecf20Sopenharmony_ci */
4678c2ecf20Sopenharmony_ci#define CFL1_CLOCK_SOURCE_MASK                  0x00000003
4688c2ecf20Sopenharmony_ci#define CFL1_CLOCK_SOURCE_CS423X                0x00000000
4698c2ecf20Sopenharmony_ci#define CFL1_CLOCK_SOURCE_AC97                  0x00000001
4708c2ecf20Sopenharmony_ci#define CFL1_CLOCK_SOURCE_CRYSTAL               0x00000002
4718c2ecf20Sopenharmony_ci#define CFL1_CLOCK_SOURCE_DUAL_AC97             0x00000003
4728c2ecf20Sopenharmony_ci#define CFL1_VALID_DATA_MASK                    0x000000FF
4738c2ecf20Sopenharmony_ci
4748c2ecf20Sopenharmony_ci/*
4758c2ecf20Sopenharmony_ci *  The following defines are for the flags in the configuration load 2
4768c2ecf20Sopenharmony_ci *  register.
4778c2ecf20Sopenharmony_ci */
4788c2ecf20Sopenharmony_ci#define CFL2_VALID_DATA_MASK                    0x000000FF
4798c2ecf20Sopenharmony_ci
4808c2ecf20Sopenharmony_ci/*
4818c2ecf20Sopenharmony_ci *  The following defines are for the flags in the serial port master control
4828c2ecf20Sopenharmony_ci *  register 1.
4838c2ecf20Sopenharmony_ci */
4848c2ecf20Sopenharmony_ci#define SERMC1_MSPE                             0x00000001
4858c2ecf20Sopenharmony_ci#define SERMC1_PTC_MASK                         0x0000000E
4868c2ecf20Sopenharmony_ci#define SERMC1_PTC_CS423X                       0x00000000
4878c2ecf20Sopenharmony_ci#define SERMC1_PTC_AC97                         0x00000002
4888c2ecf20Sopenharmony_ci#define SERMC1_PTC_DAC                          0x00000004
4898c2ecf20Sopenharmony_ci#define SERMC1_PLB                              0x00000010
4908c2ecf20Sopenharmony_ci#define SERMC1_XLB                              0x00000020
4918c2ecf20Sopenharmony_ci
4928c2ecf20Sopenharmony_ci/*
4938c2ecf20Sopenharmony_ci *  The following defines are for the flags in the serial port master control
4948c2ecf20Sopenharmony_ci *  register 2.
4958c2ecf20Sopenharmony_ci */
4968c2ecf20Sopenharmony_ci#define SERMC2_LROE                             0x00000001
4978c2ecf20Sopenharmony_ci#define SERMC2_MCOE                             0x00000002
4988c2ecf20Sopenharmony_ci#define SERMC2_MCDIV                            0x00000004
4998c2ecf20Sopenharmony_ci
5008c2ecf20Sopenharmony_ci/*
5018c2ecf20Sopenharmony_ci *  The following defines are for the flags in the serial port 1 configuration
5028c2ecf20Sopenharmony_ci *  register.
5038c2ecf20Sopenharmony_ci */
5048c2ecf20Sopenharmony_ci#define SERC1_SO1EN                             0x00000001
5058c2ecf20Sopenharmony_ci#define SERC1_SO1F_MASK                         0x0000000E
5068c2ecf20Sopenharmony_ci#define SERC1_SO1F_CS423X                       0x00000000
5078c2ecf20Sopenharmony_ci#define SERC1_SO1F_AC97                         0x00000002
5088c2ecf20Sopenharmony_ci#define SERC1_SO1F_DAC                          0x00000004
5098c2ecf20Sopenharmony_ci#define SERC1_SO1F_SPDIF                        0x00000006
5108c2ecf20Sopenharmony_ci
5118c2ecf20Sopenharmony_ci/*
5128c2ecf20Sopenharmony_ci *  The following defines are for the flags in the serial port 2 configuration
5138c2ecf20Sopenharmony_ci *  register.
5148c2ecf20Sopenharmony_ci */
5158c2ecf20Sopenharmony_ci#define SERC2_SI1EN                             0x00000001
5168c2ecf20Sopenharmony_ci#define SERC2_SI1F_MASK                         0x0000000E
5178c2ecf20Sopenharmony_ci#define SERC2_SI1F_CS423X                       0x00000000
5188c2ecf20Sopenharmony_ci#define SERC2_SI1F_AC97                         0x00000002
5198c2ecf20Sopenharmony_ci#define SERC2_SI1F_ADC                          0x00000004
5208c2ecf20Sopenharmony_ci#define SERC2_SI1F_SPDIF                        0x00000006
5218c2ecf20Sopenharmony_ci
5228c2ecf20Sopenharmony_ci/*
5238c2ecf20Sopenharmony_ci *  The following defines are for the flags in the serial port 3 configuration
5248c2ecf20Sopenharmony_ci *  register.
5258c2ecf20Sopenharmony_ci */
5268c2ecf20Sopenharmony_ci#define SERC3_SO2EN                             0x00000001
5278c2ecf20Sopenharmony_ci#define SERC3_SO2F_MASK                         0x00000006
5288c2ecf20Sopenharmony_ci#define SERC3_SO2F_DAC                          0x00000000
5298c2ecf20Sopenharmony_ci#define SERC3_SO2F_SPDIF                        0x00000002
5308c2ecf20Sopenharmony_ci
5318c2ecf20Sopenharmony_ci/*
5328c2ecf20Sopenharmony_ci *  The following defines are for the flags in the serial port 4 configuration
5338c2ecf20Sopenharmony_ci *  register.
5348c2ecf20Sopenharmony_ci */
5358c2ecf20Sopenharmony_ci#define SERC4_SO3EN                             0x00000001
5368c2ecf20Sopenharmony_ci#define SERC4_SO3F_MASK                         0x00000006
5378c2ecf20Sopenharmony_ci#define SERC4_SO3F_DAC                          0x00000000
5388c2ecf20Sopenharmony_ci#define SERC4_SO3F_SPDIF                        0x00000002
5398c2ecf20Sopenharmony_ci
5408c2ecf20Sopenharmony_ci/*
5418c2ecf20Sopenharmony_ci *  The following defines are for the flags in the serial port 5 configuration
5428c2ecf20Sopenharmony_ci *  register.
5438c2ecf20Sopenharmony_ci */
5448c2ecf20Sopenharmony_ci#define SERC5_SI2EN                             0x00000001
5458c2ecf20Sopenharmony_ci#define SERC5_SI2F_MASK                         0x00000006
5468c2ecf20Sopenharmony_ci#define SERC5_SI2F_ADC                          0x00000000
5478c2ecf20Sopenharmony_ci#define SERC5_SI2F_SPDIF                        0x00000002
5488c2ecf20Sopenharmony_ci
5498c2ecf20Sopenharmony_ci/*
5508c2ecf20Sopenharmony_ci *  The following defines are for the flags in the serial port backdoor sample
5518c2ecf20Sopenharmony_ci *  pointer register.
5528c2ecf20Sopenharmony_ci */
5538c2ecf20Sopenharmony_ci#define SERBSP_FSP_MASK                         0x0000000F
5548c2ecf20Sopenharmony_ci#define SERBSP_FSP_SHIFT                        0
5558c2ecf20Sopenharmony_ci
5568c2ecf20Sopenharmony_ci/*
5578c2ecf20Sopenharmony_ci *  The following defines are for the flags in the serial port backdoor status
5588c2ecf20Sopenharmony_ci *  register.
5598c2ecf20Sopenharmony_ci */
5608c2ecf20Sopenharmony_ci#define SERBST_RRDY                             0x00000001
5618c2ecf20Sopenharmony_ci#define SERBST_WBSY                             0x00000002
5628c2ecf20Sopenharmony_ci
5638c2ecf20Sopenharmony_ci/*
5648c2ecf20Sopenharmony_ci *  The following defines are for the flags in the serial port backdoor command
5658c2ecf20Sopenharmony_ci *  register.
5668c2ecf20Sopenharmony_ci */
5678c2ecf20Sopenharmony_ci#define SERBCM_RDC                              0x00000001
5688c2ecf20Sopenharmony_ci#define SERBCM_WRC                              0x00000002
5698c2ecf20Sopenharmony_ci
5708c2ecf20Sopenharmony_ci/*
5718c2ecf20Sopenharmony_ci *  The following defines are for the flags in the serial port backdoor address
5728c2ecf20Sopenharmony_ci *  register.
5738c2ecf20Sopenharmony_ci */
5748c2ecf20Sopenharmony_ci#ifdef NO_CS4612
5758c2ecf20Sopenharmony_ci#define SERBAD_FAD_MASK                         0x000000FF
5768c2ecf20Sopenharmony_ci#else
5778c2ecf20Sopenharmony_ci#define SERBAD_FAD_MASK                         0x000001FF
5788c2ecf20Sopenharmony_ci#endif
5798c2ecf20Sopenharmony_ci#define SERBAD_FAD_SHIFT                        0
5808c2ecf20Sopenharmony_ci
5818c2ecf20Sopenharmony_ci/*
5828c2ecf20Sopenharmony_ci *  The following defines are for the flags in the serial port backdoor
5838c2ecf20Sopenharmony_ci *  configuration register.
5848c2ecf20Sopenharmony_ci */
5858c2ecf20Sopenharmony_ci#define SERBCF_HBP                              0x00000001
5868c2ecf20Sopenharmony_ci
5878c2ecf20Sopenharmony_ci/*
5888c2ecf20Sopenharmony_ci *  The following defines are for the flags in the serial port backdoor write
5898c2ecf20Sopenharmony_ci *  port register.
5908c2ecf20Sopenharmony_ci */
5918c2ecf20Sopenharmony_ci#define SERBWP_FWD_MASK                         0x000FFFFF
5928c2ecf20Sopenharmony_ci#define SERBWP_FWD_SHIFT                        0
5938c2ecf20Sopenharmony_ci
5948c2ecf20Sopenharmony_ci/*
5958c2ecf20Sopenharmony_ci *  The following defines are for the flags in the serial port backdoor read
5968c2ecf20Sopenharmony_ci *  port register.
5978c2ecf20Sopenharmony_ci */
5988c2ecf20Sopenharmony_ci#define SERBRP_FRD_MASK                         0x000FFFFF
5998c2ecf20Sopenharmony_ci#define SERBRP_FRD_SHIFT                        0
6008c2ecf20Sopenharmony_ci
6018c2ecf20Sopenharmony_ci/*
6028c2ecf20Sopenharmony_ci *  The following defines are for the flags in the async FIFO address register.
6038c2ecf20Sopenharmony_ci */
6048c2ecf20Sopenharmony_ci#ifndef NO_CS4612
6058c2ecf20Sopenharmony_ci#define ASER_FADDR_A1_MASK                      0x000001FF
6068c2ecf20Sopenharmony_ci#define ASER_FADDR_EN1                          0x00008000
6078c2ecf20Sopenharmony_ci#define ASER_FADDR_A2_MASK                      0x01FF0000
6088c2ecf20Sopenharmony_ci#define ASER_FADDR_EN2                          0x80000000
6098c2ecf20Sopenharmony_ci#define ASER_FADDR_A1_SHIFT                     0
6108c2ecf20Sopenharmony_ci#define ASER_FADDR_A2_SHIFT                     16
6118c2ecf20Sopenharmony_ci#endif
6128c2ecf20Sopenharmony_ci
6138c2ecf20Sopenharmony_ci/*
6148c2ecf20Sopenharmony_ci *  The following defines are for the flags in the AC97 control register.
6158c2ecf20Sopenharmony_ci */
6168c2ecf20Sopenharmony_ci#define ACCTL_RSTN                              0x00000001
6178c2ecf20Sopenharmony_ci#define ACCTL_ESYN                              0x00000002
6188c2ecf20Sopenharmony_ci#define ACCTL_VFRM                              0x00000004
6198c2ecf20Sopenharmony_ci#define ACCTL_DCV                               0x00000008
6208c2ecf20Sopenharmony_ci#define ACCTL_CRW                               0x00000010
6218c2ecf20Sopenharmony_ci#define ACCTL_ASYN                              0x00000020
6228c2ecf20Sopenharmony_ci#ifndef NO_CS4612
6238c2ecf20Sopenharmony_ci#define ACCTL_TC                                0x00000040
6248c2ecf20Sopenharmony_ci#endif
6258c2ecf20Sopenharmony_ci
6268c2ecf20Sopenharmony_ci/*
6278c2ecf20Sopenharmony_ci *  The following defines are for the flags in the AC97 status register.
6288c2ecf20Sopenharmony_ci */
6298c2ecf20Sopenharmony_ci#define ACSTS_CRDY                              0x00000001
6308c2ecf20Sopenharmony_ci#define ACSTS_VSTS                              0x00000002
6318c2ecf20Sopenharmony_ci#ifndef NO_CS4612
6328c2ecf20Sopenharmony_ci#define ACSTS_WKUP                              0x00000004
6338c2ecf20Sopenharmony_ci#endif
6348c2ecf20Sopenharmony_ci
6358c2ecf20Sopenharmony_ci/*
6368c2ecf20Sopenharmony_ci *  The following defines are for the flags in the AC97 output slot valid
6378c2ecf20Sopenharmony_ci *  register.
6388c2ecf20Sopenharmony_ci */
6398c2ecf20Sopenharmony_ci#define ACOSV_SLV3                              0x00000001
6408c2ecf20Sopenharmony_ci#define ACOSV_SLV4                              0x00000002
6418c2ecf20Sopenharmony_ci#define ACOSV_SLV5                              0x00000004
6428c2ecf20Sopenharmony_ci#define ACOSV_SLV6                              0x00000008
6438c2ecf20Sopenharmony_ci#define ACOSV_SLV7                              0x00000010
6448c2ecf20Sopenharmony_ci#define ACOSV_SLV8                              0x00000020
6458c2ecf20Sopenharmony_ci#define ACOSV_SLV9                              0x00000040
6468c2ecf20Sopenharmony_ci#define ACOSV_SLV10                             0x00000080
6478c2ecf20Sopenharmony_ci#define ACOSV_SLV11                             0x00000100
6488c2ecf20Sopenharmony_ci#define ACOSV_SLV12                             0x00000200
6498c2ecf20Sopenharmony_ci
6508c2ecf20Sopenharmony_ci/*
6518c2ecf20Sopenharmony_ci *  The following defines are for the flags in the AC97 command address
6528c2ecf20Sopenharmony_ci *  register.
6538c2ecf20Sopenharmony_ci */
6548c2ecf20Sopenharmony_ci#define ACCAD_CI_MASK                           0x0000007F
6558c2ecf20Sopenharmony_ci#define ACCAD_CI_SHIFT                          0
6568c2ecf20Sopenharmony_ci
6578c2ecf20Sopenharmony_ci/*
6588c2ecf20Sopenharmony_ci *  The following defines are for the flags in the AC97 command data register.
6598c2ecf20Sopenharmony_ci */
6608c2ecf20Sopenharmony_ci#define ACCDA_CD_MASK                           0x0000FFFF
6618c2ecf20Sopenharmony_ci#define ACCDA_CD_SHIFT                          0
6628c2ecf20Sopenharmony_ci
6638c2ecf20Sopenharmony_ci/*
6648c2ecf20Sopenharmony_ci *  The following defines are for the flags in the AC97 input slot valid
6658c2ecf20Sopenharmony_ci *  register.
6668c2ecf20Sopenharmony_ci */
6678c2ecf20Sopenharmony_ci#define ACISV_ISV3                              0x00000001
6688c2ecf20Sopenharmony_ci#define ACISV_ISV4                              0x00000002
6698c2ecf20Sopenharmony_ci#define ACISV_ISV5                              0x00000004
6708c2ecf20Sopenharmony_ci#define ACISV_ISV6                              0x00000008
6718c2ecf20Sopenharmony_ci#define ACISV_ISV7                              0x00000010
6728c2ecf20Sopenharmony_ci#define ACISV_ISV8                              0x00000020
6738c2ecf20Sopenharmony_ci#define ACISV_ISV9                              0x00000040
6748c2ecf20Sopenharmony_ci#define ACISV_ISV10                             0x00000080
6758c2ecf20Sopenharmony_ci#define ACISV_ISV11                             0x00000100
6768c2ecf20Sopenharmony_ci#define ACISV_ISV12                             0x00000200
6778c2ecf20Sopenharmony_ci
6788c2ecf20Sopenharmony_ci/*
6798c2ecf20Sopenharmony_ci *  The following defines are for the flags in the AC97 status address
6808c2ecf20Sopenharmony_ci *  register.
6818c2ecf20Sopenharmony_ci */
6828c2ecf20Sopenharmony_ci#define ACSAD_SI_MASK                           0x0000007F
6838c2ecf20Sopenharmony_ci#define ACSAD_SI_SHIFT                          0
6848c2ecf20Sopenharmony_ci
6858c2ecf20Sopenharmony_ci/*
6868c2ecf20Sopenharmony_ci *  The following defines are for the flags in the AC97 status data register.
6878c2ecf20Sopenharmony_ci */
6888c2ecf20Sopenharmony_ci#define ACSDA_SD_MASK                           0x0000FFFF
6898c2ecf20Sopenharmony_ci#define ACSDA_SD_SHIFT                          0
6908c2ecf20Sopenharmony_ci
6918c2ecf20Sopenharmony_ci/*
6928c2ecf20Sopenharmony_ci *  The following defines are for the flags in the joystick poll/trigger
6938c2ecf20Sopenharmony_ci *  register.
6948c2ecf20Sopenharmony_ci */
6958c2ecf20Sopenharmony_ci#define JSPT_CAX                                0x00000001
6968c2ecf20Sopenharmony_ci#define JSPT_CAY                                0x00000002
6978c2ecf20Sopenharmony_ci#define JSPT_CBX                                0x00000004
6988c2ecf20Sopenharmony_ci#define JSPT_CBY                                0x00000008
6998c2ecf20Sopenharmony_ci#define JSPT_BA1                                0x00000010
7008c2ecf20Sopenharmony_ci#define JSPT_BA2                                0x00000020
7018c2ecf20Sopenharmony_ci#define JSPT_BB1                                0x00000040
7028c2ecf20Sopenharmony_ci#define JSPT_BB2                                0x00000080
7038c2ecf20Sopenharmony_ci
7048c2ecf20Sopenharmony_ci/*
7058c2ecf20Sopenharmony_ci *  The following defines are for the flags in the joystick control register.
7068c2ecf20Sopenharmony_ci */
7078c2ecf20Sopenharmony_ci#define JSCTL_SP_MASK                           0x00000003
7088c2ecf20Sopenharmony_ci#define JSCTL_SP_SLOW                           0x00000000
7098c2ecf20Sopenharmony_ci#define JSCTL_SP_MEDIUM_SLOW                    0x00000001
7108c2ecf20Sopenharmony_ci#define JSCTL_SP_MEDIUM_FAST                    0x00000002
7118c2ecf20Sopenharmony_ci#define JSCTL_SP_FAST                           0x00000003
7128c2ecf20Sopenharmony_ci#define JSCTL_ARE                               0x00000004
7138c2ecf20Sopenharmony_ci
7148c2ecf20Sopenharmony_ci/*
7158c2ecf20Sopenharmony_ci *  The following defines are for the flags in the joystick coordinate pair 1
7168c2ecf20Sopenharmony_ci *  readback register.
7178c2ecf20Sopenharmony_ci */
7188c2ecf20Sopenharmony_ci#define JSC1_Y1V_MASK                           0x0000FFFF
7198c2ecf20Sopenharmony_ci#define JSC1_X1V_MASK                           0xFFFF0000
7208c2ecf20Sopenharmony_ci#define JSC1_Y1V_SHIFT                          0
7218c2ecf20Sopenharmony_ci#define JSC1_X1V_SHIFT                          16
7228c2ecf20Sopenharmony_ci
7238c2ecf20Sopenharmony_ci/*
7248c2ecf20Sopenharmony_ci *  The following defines are for the flags in the joystick coordinate pair 2
7258c2ecf20Sopenharmony_ci *  readback register.
7268c2ecf20Sopenharmony_ci */
7278c2ecf20Sopenharmony_ci#define JSC2_Y2V_MASK                           0x0000FFFF
7288c2ecf20Sopenharmony_ci#define JSC2_X2V_MASK                           0xFFFF0000
7298c2ecf20Sopenharmony_ci#define JSC2_Y2V_SHIFT                          0
7308c2ecf20Sopenharmony_ci#define JSC2_X2V_SHIFT                          16
7318c2ecf20Sopenharmony_ci
7328c2ecf20Sopenharmony_ci/*
7338c2ecf20Sopenharmony_ci *  The following defines are for the flags in the MIDI control register.
7348c2ecf20Sopenharmony_ci */
7358c2ecf20Sopenharmony_ci#define MIDCR_TXE                               0x00000001	/* Enable transmitting. */
7368c2ecf20Sopenharmony_ci#define MIDCR_RXE                               0x00000002	/* Enable receiving. */
7378c2ecf20Sopenharmony_ci#define MIDCR_RIE                               0x00000004	/* Interrupt upon tx ready. */
7388c2ecf20Sopenharmony_ci#define MIDCR_TIE                               0x00000008	/* Interrupt upon rx ready. */
7398c2ecf20Sopenharmony_ci#define MIDCR_MLB                               0x00000010	/* Enable midi loopback. */
7408c2ecf20Sopenharmony_ci#define MIDCR_MRST                              0x00000020	/* Reset interface. */
7418c2ecf20Sopenharmony_ci
7428c2ecf20Sopenharmony_ci/*
7438c2ecf20Sopenharmony_ci *  The following defines are for the flags in the MIDI status register.
7448c2ecf20Sopenharmony_ci */
7458c2ecf20Sopenharmony_ci#define MIDSR_TBF                               0x00000001	/* Tx FIFO is full. */
7468c2ecf20Sopenharmony_ci#define MIDSR_RBE                               0x00000002	/* Rx FIFO is empty. */
7478c2ecf20Sopenharmony_ci
7488c2ecf20Sopenharmony_ci/*
7498c2ecf20Sopenharmony_ci *  The following defines are for the flags in the MIDI write port register.
7508c2ecf20Sopenharmony_ci */
7518c2ecf20Sopenharmony_ci#define MIDWP_MWD_MASK                          0x000000FF
7528c2ecf20Sopenharmony_ci#define MIDWP_MWD_SHIFT                         0
7538c2ecf20Sopenharmony_ci
7548c2ecf20Sopenharmony_ci/*
7558c2ecf20Sopenharmony_ci *  The following defines are for the flags in the MIDI read port register.
7568c2ecf20Sopenharmony_ci */
7578c2ecf20Sopenharmony_ci#define MIDRP_MRD_MASK                          0x000000FF
7588c2ecf20Sopenharmony_ci#define MIDRP_MRD_SHIFT                         0
7598c2ecf20Sopenharmony_ci
7608c2ecf20Sopenharmony_ci/*
7618c2ecf20Sopenharmony_ci *  The following defines are for the flags in the joystick GPIO register.
7628c2ecf20Sopenharmony_ci */
7638c2ecf20Sopenharmony_ci#define JSIO_DAX                                0x00000001
7648c2ecf20Sopenharmony_ci#define JSIO_DAY                                0x00000002
7658c2ecf20Sopenharmony_ci#define JSIO_DBX                                0x00000004
7668c2ecf20Sopenharmony_ci#define JSIO_DBY                                0x00000008
7678c2ecf20Sopenharmony_ci#define JSIO_AXOE                               0x00000010
7688c2ecf20Sopenharmony_ci#define JSIO_AYOE                               0x00000020
7698c2ecf20Sopenharmony_ci#define JSIO_BXOE                               0x00000040
7708c2ecf20Sopenharmony_ci#define JSIO_BYOE                               0x00000080
7718c2ecf20Sopenharmony_ci
7728c2ecf20Sopenharmony_ci/*
7738c2ecf20Sopenharmony_ci *  The following defines are for the flags in the master async/sync serial
7748c2ecf20Sopenharmony_ci *  port enable register.
7758c2ecf20Sopenharmony_ci */
7768c2ecf20Sopenharmony_ci#ifndef NO_CS4612
7778c2ecf20Sopenharmony_ci#define ASER_MASTER_ME                          0x00000001
7788c2ecf20Sopenharmony_ci#endif
7798c2ecf20Sopenharmony_ci
7808c2ecf20Sopenharmony_ci/*
7818c2ecf20Sopenharmony_ci *  The following defines are for the flags in the configuration interface
7828c2ecf20Sopenharmony_ci *  register.
7838c2ecf20Sopenharmony_ci */
7848c2ecf20Sopenharmony_ci#define CFGI_CLK                                0x00000001
7858c2ecf20Sopenharmony_ci#define CFGI_DOUT                               0x00000002
7868c2ecf20Sopenharmony_ci#define CFGI_DIN_EEN                            0x00000004
7878c2ecf20Sopenharmony_ci#define CFGI_EELD                               0x00000008
7888c2ecf20Sopenharmony_ci
7898c2ecf20Sopenharmony_ci/*
7908c2ecf20Sopenharmony_ci *  The following defines are for the flags in the subsystem ID and vendor ID
7918c2ecf20Sopenharmony_ci *  register.
7928c2ecf20Sopenharmony_ci */
7938c2ecf20Sopenharmony_ci#define SSVID_VID_MASK                          0x0000FFFF
7948c2ecf20Sopenharmony_ci#define SSVID_SID_MASK                          0xFFFF0000
7958c2ecf20Sopenharmony_ci#define SSVID_VID_SHIFT                         0
7968c2ecf20Sopenharmony_ci#define SSVID_SID_SHIFT                         16
7978c2ecf20Sopenharmony_ci
7988c2ecf20Sopenharmony_ci/*
7998c2ecf20Sopenharmony_ci *  The following defines are for the flags in the GPIO pin interface register.
8008c2ecf20Sopenharmony_ci */
8018c2ecf20Sopenharmony_ci#define GPIOR_VOLDN                             0x00000001
8028c2ecf20Sopenharmony_ci#define GPIOR_VOLUP                             0x00000002
8038c2ecf20Sopenharmony_ci#define GPIOR_SI2D                              0x00000004
8048c2ecf20Sopenharmony_ci#define GPIOR_SI2OE                             0x00000008
8058c2ecf20Sopenharmony_ci
8068c2ecf20Sopenharmony_ci/*
8078c2ecf20Sopenharmony_ci *  The following defines are for the flags in the extended GPIO pin direction
8088c2ecf20Sopenharmony_ci *  register.
8098c2ecf20Sopenharmony_ci */
8108c2ecf20Sopenharmony_ci#ifndef NO_CS4612
8118c2ecf20Sopenharmony_ci#define EGPIODR_GPOE0                           0x00000001
8128c2ecf20Sopenharmony_ci#define EGPIODR_GPOE1                           0x00000002
8138c2ecf20Sopenharmony_ci#define EGPIODR_GPOE2                           0x00000004
8148c2ecf20Sopenharmony_ci#define EGPIODR_GPOE3                           0x00000008
8158c2ecf20Sopenharmony_ci#define EGPIODR_GPOE4                           0x00000010
8168c2ecf20Sopenharmony_ci#define EGPIODR_GPOE5                           0x00000020
8178c2ecf20Sopenharmony_ci#define EGPIODR_GPOE6                           0x00000040
8188c2ecf20Sopenharmony_ci#define EGPIODR_GPOE7                           0x00000080
8198c2ecf20Sopenharmony_ci#define EGPIODR_GPOE8                           0x00000100
8208c2ecf20Sopenharmony_ci#endif
8218c2ecf20Sopenharmony_ci
8228c2ecf20Sopenharmony_ci/*
8238c2ecf20Sopenharmony_ci *  The following defines are for the flags in the extended GPIO pin polarity/
8248c2ecf20Sopenharmony_ci *  type register.
8258c2ecf20Sopenharmony_ci */
8268c2ecf20Sopenharmony_ci#ifndef NO_CS4612
8278c2ecf20Sopenharmony_ci#define EGPIOPTR_GPPT0                          0x00000001
8288c2ecf20Sopenharmony_ci#define EGPIOPTR_GPPT1                          0x00000002
8298c2ecf20Sopenharmony_ci#define EGPIOPTR_GPPT2                          0x00000004
8308c2ecf20Sopenharmony_ci#define EGPIOPTR_GPPT3                          0x00000008
8318c2ecf20Sopenharmony_ci#define EGPIOPTR_GPPT4                          0x00000010
8328c2ecf20Sopenharmony_ci#define EGPIOPTR_GPPT5                          0x00000020
8338c2ecf20Sopenharmony_ci#define EGPIOPTR_GPPT6                          0x00000040
8348c2ecf20Sopenharmony_ci#define EGPIOPTR_GPPT7                          0x00000080
8358c2ecf20Sopenharmony_ci#define EGPIOPTR_GPPT8                          0x00000100
8368c2ecf20Sopenharmony_ci#endif
8378c2ecf20Sopenharmony_ci
8388c2ecf20Sopenharmony_ci/*
8398c2ecf20Sopenharmony_ci *  The following defines are for the flags in the extended GPIO pin sticky
8408c2ecf20Sopenharmony_ci *  register.
8418c2ecf20Sopenharmony_ci */
8428c2ecf20Sopenharmony_ci#ifndef NO_CS4612
8438c2ecf20Sopenharmony_ci#define EGPIOTR_GPS0                            0x00000001
8448c2ecf20Sopenharmony_ci#define EGPIOTR_GPS1                            0x00000002
8458c2ecf20Sopenharmony_ci#define EGPIOTR_GPS2                            0x00000004
8468c2ecf20Sopenharmony_ci#define EGPIOTR_GPS3                            0x00000008
8478c2ecf20Sopenharmony_ci#define EGPIOTR_GPS4                            0x00000010
8488c2ecf20Sopenharmony_ci#define EGPIOTR_GPS5                            0x00000020
8498c2ecf20Sopenharmony_ci#define EGPIOTR_GPS6                            0x00000040
8508c2ecf20Sopenharmony_ci#define EGPIOTR_GPS7                            0x00000080
8518c2ecf20Sopenharmony_ci#define EGPIOTR_GPS8                            0x00000100
8528c2ecf20Sopenharmony_ci#endif
8538c2ecf20Sopenharmony_ci
8548c2ecf20Sopenharmony_ci/*
8558c2ecf20Sopenharmony_ci *  The following defines are for the flags in the extended GPIO ping wakeup
8568c2ecf20Sopenharmony_ci *  register.
8578c2ecf20Sopenharmony_ci */
8588c2ecf20Sopenharmony_ci#ifndef NO_CS4612
8598c2ecf20Sopenharmony_ci#define EGPIOWR_GPW0                            0x00000001
8608c2ecf20Sopenharmony_ci#define EGPIOWR_GPW1                            0x00000002
8618c2ecf20Sopenharmony_ci#define EGPIOWR_GPW2                            0x00000004
8628c2ecf20Sopenharmony_ci#define EGPIOWR_GPW3                            0x00000008
8638c2ecf20Sopenharmony_ci#define EGPIOWR_GPW4                            0x00000010
8648c2ecf20Sopenharmony_ci#define EGPIOWR_GPW5                            0x00000020
8658c2ecf20Sopenharmony_ci#define EGPIOWR_GPW6                            0x00000040
8668c2ecf20Sopenharmony_ci#define EGPIOWR_GPW7                            0x00000080
8678c2ecf20Sopenharmony_ci#define EGPIOWR_GPW8                            0x00000100
8688c2ecf20Sopenharmony_ci#endif
8698c2ecf20Sopenharmony_ci
8708c2ecf20Sopenharmony_ci/*
8718c2ecf20Sopenharmony_ci *  The following defines are for the flags in the extended GPIO pin status
8728c2ecf20Sopenharmony_ci *  register.
8738c2ecf20Sopenharmony_ci */
8748c2ecf20Sopenharmony_ci#ifndef NO_CS4612
8758c2ecf20Sopenharmony_ci#define EGPIOSR_GPS0                            0x00000001
8768c2ecf20Sopenharmony_ci#define EGPIOSR_GPS1                            0x00000002
8778c2ecf20Sopenharmony_ci#define EGPIOSR_GPS2                            0x00000004
8788c2ecf20Sopenharmony_ci#define EGPIOSR_GPS3                            0x00000008
8798c2ecf20Sopenharmony_ci#define EGPIOSR_GPS4                            0x00000010
8808c2ecf20Sopenharmony_ci#define EGPIOSR_GPS5                            0x00000020
8818c2ecf20Sopenharmony_ci#define EGPIOSR_GPS6                            0x00000040
8828c2ecf20Sopenharmony_ci#define EGPIOSR_GPS7                            0x00000080
8838c2ecf20Sopenharmony_ci#define EGPIOSR_GPS8                            0x00000100
8848c2ecf20Sopenharmony_ci#endif
8858c2ecf20Sopenharmony_ci
8868c2ecf20Sopenharmony_ci/*
8878c2ecf20Sopenharmony_ci *  The following defines are for the flags in the serial port 6 configuration
8888c2ecf20Sopenharmony_ci *  register.
8898c2ecf20Sopenharmony_ci */
8908c2ecf20Sopenharmony_ci#ifndef NO_CS4612
8918c2ecf20Sopenharmony_ci#define SERC6_ASDO2EN                           0x00000001
8928c2ecf20Sopenharmony_ci#endif
8938c2ecf20Sopenharmony_ci
8948c2ecf20Sopenharmony_ci/*
8958c2ecf20Sopenharmony_ci *  The following defines are for the flags in the serial port 7 configuration
8968c2ecf20Sopenharmony_ci *  register.
8978c2ecf20Sopenharmony_ci */
8988c2ecf20Sopenharmony_ci#ifndef NO_CS4612
8998c2ecf20Sopenharmony_ci#define SERC7_ASDI2EN                           0x00000001
9008c2ecf20Sopenharmony_ci#define SERC7_POSILB                            0x00000002
9018c2ecf20Sopenharmony_ci#define SERC7_SIPOLB                            0x00000004
9028c2ecf20Sopenharmony_ci#define SERC7_SOSILB                            0x00000008
9038c2ecf20Sopenharmony_ci#define SERC7_SISOLB                            0x00000010
9048c2ecf20Sopenharmony_ci#endif
9058c2ecf20Sopenharmony_ci
9068c2ecf20Sopenharmony_ci/*
9078c2ecf20Sopenharmony_ci *  The following defines are for the flags in the serial port AC link
9088c2ecf20Sopenharmony_ci *  configuration register.
9098c2ecf20Sopenharmony_ci */
9108c2ecf20Sopenharmony_ci#ifndef NO_CS4612
9118c2ecf20Sopenharmony_ci#define SERACC_CHIP_TYPE_MASK                  0x00000001
9128c2ecf20Sopenharmony_ci#define SERACC_CHIP_TYPE_1_03                  0x00000000
9138c2ecf20Sopenharmony_ci#define SERACC_CHIP_TYPE_2_0                   0x00000001
9148c2ecf20Sopenharmony_ci#define SERACC_TWO_CODECS                      0x00000002
9158c2ecf20Sopenharmony_ci#define SERACC_MDM                             0x00000004
9168c2ecf20Sopenharmony_ci#define SERACC_HSP                             0x00000008
9178c2ecf20Sopenharmony_ci#define SERACC_ODT                             0x00000010 /* only CS4630 */
9188c2ecf20Sopenharmony_ci#endif
9198c2ecf20Sopenharmony_ci
9208c2ecf20Sopenharmony_ci/*
9218c2ecf20Sopenharmony_ci *  The following defines are for the flags in the AC97 control register 2.
9228c2ecf20Sopenharmony_ci */
9238c2ecf20Sopenharmony_ci#ifndef NO_CS4612
9248c2ecf20Sopenharmony_ci#define ACCTL2_RSTN                             0x00000001
9258c2ecf20Sopenharmony_ci#define ACCTL2_ESYN                             0x00000002
9268c2ecf20Sopenharmony_ci#define ACCTL2_VFRM                             0x00000004
9278c2ecf20Sopenharmony_ci#define ACCTL2_DCV                              0x00000008
9288c2ecf20Sopenharmony_ci#define ACCTL2_CRW                              0x00000010
9298c2ecf20Sopenharmony_ci#define ACCTL2_ASYN                             0x00000020
9308c2ecf20Sopenharmony_ci#endif
9318c2ecf20Sopenharmony_ci
9328c2ecf20Sopenharmony_ci/*
9338c2ecf20Sopenharmony_ci *  The following defines are for the flags in the AC97 status register 2.
9348c2ecf20Sopenharmony_ci */
9358c2ecf20Sopenharmony_ci#ifndef NO_CS4612
9368c2ecf20Sopenharmony_ci#define ACSTS2_CRDY                             0x00000001
9378c2ecf20Sopenharmony_ci#define ACSTS2_VSTS                             0x00000002
9388c2ecf20Sopenharmony_ci#endif
9398c2ecf20Sopenharmony_ci
9408c2ecf20Sopenharmony_ci/*
9418c2ecf20Sopenharmony_ci *  The following defines are for the flags in the AC97 output slot valid
9428c2ecf20Sopenharmony_ci *  register 2.
9438c2ecf20Sopenharmony_ci */
9448c2ecf20Sopenharmony_ci#ifndef NO_CS4612
9458c2ecf20Sopenharmony_ci#define ACOSV2_SLV3                             0x00000001
9468c2ecf20Sopenharmony_ci#define ACOSV2_SLV4                             0x00000002
9478c2ecf20Sopenharmony_ci#define ACOSV2_SLV5                             0x00000004
9488c2ecf20Sopenharmony_ci#define ACOSV2_SLV6                             0x00000008
9498c2ecf20Sopenharmony_ci#define ACOSV2_SLV7                             0x00000010
9508c2ecf20Sopenharmony_ci#define ACOSV2_SLV8                             0x00000020
9518c2ecf20Sopenharmony_ci#define ACOSV2_SLV9                             0x00000040
9528c2ecf20Sopenharmony_ci#define ACOSV2_SLV10                            0x00000080
9538c2ecf20Sopenharmony_ci#define ACOSV2_SLV11                            0x00000100
9548c2ecf20Sopenharmony_ci#define ACOSV2_SLV12                            0x00000200
9558c2ecf20Sopenharmony_ci#endif
9568c2ecf20Sopenharmony_ci
9578c2ecf20Sopenharmony_ci/*
9588c2ecf20Sopenharmony_ci *  The following defines are for the flags in the AC97 command address
9598c2ecf20Sopenharmony_ci *  register 2.
9608c2ecf20Sopenharmony_ci */
9618c2ecf20Sopenharmony_ci#ifndef NO_CS4612
9628c2ecf20Sopenharmony_ci#define ACCAD2_CI_MASK                          0x0000007F
9638c2ecf20Sopenharmony_ci#define ACCAD2_CI_SHIFT                         0
9648c2ecf20Sopenharmony_ci#endif
9658c2ecf20Sopenharmony_ci
9668c2ecf20Sopenharmony_ci/*
9678c2ecf20Sopenharmony_ci *  The following defines are for the flags in the AC97 command data register
9688c2ecf20Sopenharmony_ci *  2.
9698c2ecf20Sopenharmony_ci */
9708c2ecf20Sopenharmony_ci#ifndef NO_CS4612
9718c2ecf20Sopenharmony_ci#define ACCDA2_CD_MASK                          0x0000FFFF
9728c2ecf20Sopenharmony_ci#define ACCDA2_CD_SHIFT                         0
9738c2ecf20Sopenharmony_ci#endif
9748c2ecf20Sopenharmony_ci
9758c2ecf20Sopenharmony_ci/*
9768c2ecf20Sopenharmony_ci *  The following defines are for the flags in the AC97 input slot valid
9778c2ecf20Sopenharmony_ci *  register 2.
9788c2ecf20Sopenharmony_ci */
9798c2ecf20Sopenharmony_ci#ifndef NO_CS4612
9808c2ecf20Sopenharmony_ci#define ACISV2_ISV3                             0x00000001
9818c2ecf20Sopenharmony_ci#define ACISV2_ISV4                             0x00000002
9828c2ecf20Sopenharmony_ci#define ACISV2_ISV5                             0x00000004
9838c2ecf20Sopenharmony_ci#define ACISV2_ISV6                             0x00000008
9848c2ecf20Sopenharmony_ci#define ACISV2_ISV7                             0x00000010
9858c2ecf20Sopenharmony_ci#define ACISV2_ISV8                             0x00000020
9868c2ecf20Sopenharmony_ci#define ACISV2_ISV9                             0x00000040
9878c2ecf20Sopenharmony_ci#define ACISV2_ISV10                            0x00000080
9888c2ecf20Sopenharmony_ci#define ACISV2_ISV11                            0x00000100
9898c2ecf20Sopenharmony_ci#define ACISV2_ISV12                            0x00000200
9908c2ecf20Sopenharmony_ci#endif
9918c2ecf20Sopenharmony_ci
9928c2ecf20Sopenharmony_ci/*
9938c2ecf20Sopenharmony_ci *  The following defines are for the flags in the AC97 status address
9948c2ecf20Sopenharmony_ci *  register 2.
9958c2ecf20Sopenharmony_ci */
9968c2ecf20Sopenharmony_ci#ifndef NO_CS4612
9978c2ecf20Sopenharmony_ci#define ACSAD2_SI_MASK                          0x0000007F
9988c2ecf20Sopenharmony_ci#define ACSAD2_SI_SHIFT                         0
9998c2ecf20Sopenharmony_ci#endif
10008c2ecf20Sopenharmony_ci
10018c2ecf20Sopenharmony_ci/*
10028c2ecf20Sopenharmony_ci *  The following defines are for the flags in the AC97 status data register 2.
10038c2ecf20Sopenharmony_ci */
10048c2ecf20Sopenharmony_ci#ifndef NO_CS4612
10058c2ecf20Sopenharmony_ci#define ACSDA2_SD_MASK                          0x0000FFFF
10068c2ecf20Sopenharmony_ci#define ACSDA2_SD_SHIFT                         0
10078c2ecf20Sopenharmony_ci#endif
10088c2ecf20Sopenharmony_ci
10098c2ecf20Sopenharmony_ci/*
10108c2ecf20Sopenharmony_ci *  The following defines are for the flags in the I/O trap address and control
10118c2ecf20Sopenharmony_ci *  registers (all 12).
10128c2ecf20Sopenharmony_ci */
10138c2ecf20Sopenharmony_ci#ifndef NO_CS4612
10148c2ecf20Sopenharmony_ci#define IOTAC_SA_MASK                           0x0000FFFF
10158c2ecf20Sopenharmony_ci#define IOTAC_MSK_MASK                          0x000F0000
10168c2ecf20Sopenharmony_ci#define IOTAC_IODC_MASK                         0x06000000
10178c2ecf20Sopenharmony_ci#define IOTAC_IODC_16_BIT                       0x00000000
10188c2ecf20Sopenharmony_ci#define IOTAC_IODC_10_BIT                       0x02000000
10198c2ecf20Sopenharmony_ci#define IOTAC_IODC_12_BIT                       0x04000000
10208c2ecf20Sopenharmony_ci#define IOTAC_WSPI                              0x08000000
10218c2ecf20Sopenharmony_ci#define IOTAC_RSPI                              0x10000000
10228c2ecf20Sopenharmony_ci#define IOTAC_WSE                               0x20000000
10238c2ecf20Sopenharmony_ci#define IOTAC_WE                                0x40000000
10248c2ecf20Sopenharmony_ci#define IOTAC_RE                                0x80000000
10258c2ecf20Sopenharmony_ci#define IOTAC_SA_SHIFT                          0
10268c2ecf20Sopenharmony_ci#define IOTAC_MSK_SHIFT                         16
10278c2ecf20Sopenharmony_ci#endif
10288c2ecf20Sopenharmony_ci
10298c2ecf20Sopenharmony_ci/*
10308c2ecf20Sopenharmony_ci *  The following defines are for the flags in the I/O trap fast read registers
10318c2ecf20Sopenharmony_ci *  (all 8).
10328c2ecf20Sopenharmony_ci */
10338c2ecf20Sopenharmony_ci#ifndef NO_CS4612
10348c2ecf20Sopenharmony_ci#define IOTFR_D_MASK                            0x0000FFFF
10358c2ecf20Sopenharmony_ci#define IOTFR_A_MASK                            0x000F0000
10368c2ecf20Sopenharmony_ci#define IOTFR_R_MASK                            0x0F000000
10378c2ecf20Sopenharmony_ci#define IOTFR_ALL                               0x40000000
10388c2ecf20Sopenharmony_ci#define IOTFR_VL                                0x80000000
10398c2ecf20Sopenharmony_ci#define IOTFR_D_SHIFT                           0
10408c2ecf20Sopenharmony_ci#define IOTFR_A_SHIFT                           16
10418c2ecf20Sopenharmony_ci#define IOTFR_R_SHIFT                           24
10428c2ecf20Sopenharmony_ci#endif
10438c2ecf20Sopenharmony_ci
10448c2ecf20Sopenharmony_ci/*
10458c2ecf20Sopenharmony_ci *  The following defines are for the flags in the I/O trap FIFO register.
10468c2ecf20Sopenharmony_ci */
10478c2ecf20Sopenharmony_ci#ifndef NO_CS4612
10488c2ecf20Sopenharmony_ci#define IOTFIFO_BA_MASK                         0x00003FFF
10498c2ecf20Sopenharmony_ci#define IOTFIFO_S_MASK                          0x00FF0000
10508c2ecf20Sopenharmony_ci#define IOTFIFO_OF                              0x40000000
10518c2ecf20Sopenharmony_ci#define IOTFIFO_SPIOF                           0x80000000
10528c2ecf20Sopenharmony_ci#define IOTFIFO_BA_SHIFT                        0
10538c2ecf20Sopenharmony_ci#define IOTFIFO_S_SHIFT                         16
10548c2ecf20Sopenharmony_ci#endif
10558c2ecf20Sopenharmony_ci
10568c2ecf20Sopenharmony_ci/*
10578c2ecf20Sopenharmony_ci *  The following defines are for the flags in the I/O trap retry read data
10588c2ecf20Sopenharmony_ci *  register.
10598c2ecf20Sopenharmony_ci */
10608c2ecf20Sopenharmony_ci#ifndef NO_CS4612
10618c2ecf20Sopenharmony_ci#define IOTRRD_D_MASK                           0x0000FFFF
10628c2ecf20Sopenharmony_ci#define IOTRRD_RDV                              0x80000000
10638c2ecf20Sopenharmony_ci#define IOTRRD_D_SHIFT                          0
10648c2ecf20Sopenharmony_ci#endif
10658c2ecf20Sopenharmony_ci
10668c2ecf20Sopenharmony_ci/*
10678c2ecf20Sopenharmony_ci *  The following defines are for the flags in the I/O trap FIFO pointer
10688c2ecf20Sopenharmony_ci *  register.
10698c2ecf20Sopenharmony_ci */
10708c2ecf20Sopenharmony_ci#ifndef NO_CS4612
10718c2ecf20Sopenharmony_ci#define IOTFP_CA_MASK                           0x00003FFF
10728c2ecf20Sopenharmony_ci#define IOTFP_PA_MASK                           0x3FFF0000
10738c2ecf20Sopenharmony_ci#define IOTFP_CA_SHIFT                          0
10748c2ecf20Sopenharmony_ci#define IOTFP_PA_SHIFT                          16
10758c2ecf20Sopenharmony_ci#endif
10768c2ecf20Sopenharmony_ci
10778c2ecf20Sopenharmony_ci/*
10788c2ecf20Sopenharmony_ci *  The following defines are for the flags in the I/O trap control register.
10798c2ecf20Sopenharmony_ci */
10808c2ecf20Sopenharmony_ci#ifndef NO_CS4612
10818c2ecf20Sopenharmony_ci#define IOTCR_ITD                               0x00000001
10828c2ecf20Sopenharmony_ci#define IOTCR_HRV                               0x00000002
10838c2ecf20Sopenharmony_ci#define IOTCR_SRV                               0x00000004
10848c2ecf20Sopenharmony_ci#define IOTCR_DTI                               0x00000008
10858c2ecf20Sopenharmony_ci#define IOTCR_DFI                               0x00000010
10868c2ecf20Sopenharmony_ci#define IOTCR_DDP                               0x00000020
10878c2ecf20Sopenharmony_ci#define IOTCR_JTE                               0x00000040
10888c2ecf20Sopenharmony_ci#define IOTCR_PPE                               0x00000080
10898c2ecf20Sopenharmony_ci#endif
10908c2ecf20Sopenharmony_ci
10918c2ecf20Sopenharmony_ci/*
10928c2ecf20Sopenharmony_ci *  The following defines are for the flags in the direct PCI data register.
10938c2ecf20Sopenharmony_ci */
10948c2ecf20Sopenharmony_ci#ifndef NO_CS4612
10958c2ecf20Sopenharmony_ci#define DPCID_D_MASK                            0xFFFFFFFF
10968c2ecf20Sopenharmony_ci#define DPCID_D_SHIFT                           0
10978c2ecf20Sopenharmony_ci#endif
10988c2ecf20Sopenharmony_ci
10998c2ecf20Sopenharmony_ci/*
11008c2ecf20Sopenharmony_ci *  The following defines are for the flags in the direct PCI address register.
11018c2ecf20Sopenharmony_ci */
11028c2ecf20Sopenharmony_ci#ifndef NO_CS4612
11038c2ecf20Sopenharmony_ci#define DPCIA_A_MASK                            0xFFFFFFFF
11048c2ecf20Sopenharmony_ci#define DPCIA_A_SHIFT                           0
11058c2ecf20Sopenharmony_ci#endif
11068c2ecf20Sopenharmony_ci
11078c2ecf20Sopenharmony_ci/*
11088c2ecf20Sopenharmony_ci *  The following defines are for the flags in the direct PCI command register.
11098c2ecf20Sopenharmony_ci */
11108c2ecf20Sopenharmony_ci#ifndef NO_CS4612
11118c2ecf20Sopenharmony_ci#define DPCIC_C_MASK                            0x0000000F
11128c2ecf20Sopenharmony_ci#define DPCIC_C_IOREAD                          0x00000002
11138c2ecf20Sopenharmony_ci#define DPCIC_C_IOWRITE                         0x00000003
11148c2ecf20Sopenharmony_ci#define DPCIC_BE_MASK                           0x000000F0
11158c2ecf20Sopenharmony_ci#endif
11168c2ecf20Sopenharmony_ci
11178c2ecf20Sopenharmony_ci/*
11188c2ecf20Sopenharmony_ci *  The following defines are for the flags in the PC/PCI request register.
11198c2ecf20Sopenharmony_ci */
11208c2ecf20Sopenharmony_ci#ifndef NO_CS4612
11218c2ecf20Sopenharmony_ci#define PCPCIR_RDC_MASK                         0x00000007
11228c2ecf20Sopenharmony_ci#define PCPCIR_C_MASK                           0x00007000
11238c2ecf20Sopenharmony_ci#define PCPCIR_REQ                              0x00008000
11248c2ecf20Sopenharmony_ci#define PCPCIR_RDC_SHIFT                        0
11258c2ecf20Sopenharmony_ci#define PCPCIR_C_SHIFT                          12
11268c2ecf20Sopenharmony_ci#endif
11278c2ecf20Sopenharmony_ci
11288c2ecf20Sopenharmony_ci/*
11298c2ecf20Sopenharmony_ci *  The following defines are for the flags in the PC/PCI grant register.
11308c2ecf20Sopenharmony_ci */
11318c2ecf20Sopenharmony_ci#ifndef NO_CS4612
11328c2ecf20Sopenharmony_ci#define PCPCIG_GDC_MASK                         0x00000007
11338c2ecf20Sopenharmony_ci#define PCPCIG_VL                               0x00008000
11348c2ecf20Sopenharmony_ci#define PCPCIG_GDC_SHIFT                        0
11358c2ecf20Sopenharmony_ci#endif
11368c2ecf20Sopenharmony_ci
11378c2ecf20Sopenharmony_ci/*
11388c2ecf20Sopenharmony_ci *  The following defines are for the flags in the PC/PCI master enable
11398c2ecf20Sopenharmony_ci *  register.
11408c2ecf20Sopenharmony_ci */
11418c2ecf20Sopenharmony_ci#ifndef NO_CS4612
11428c2ecf20Sopenharmony_ci#define PCPCIEN_EN                              0x00000001
11438c2ecf20Sopenharmony_ci#endif
11448c2ecf20Sopenharmony_ci
11458c2ecf20Sopenharmony_ci/*
11468c2ecf20Sopenharmony_ci *  The following defines are for the flags in the extended PCI power
11478c2ecf20Sopenharmony_ci *  management control register.
11488c2ecf20Sopenharmony_ci */
11498c2ecf20Sopenharmony_ci#ifndef NO_CS4612
11508c2ecf20Sopenharmony_ci#define EPCIPMC_GWU                             0x00000001
11518c2ecf20Sopenharmony_ci#define EPCIPMC_FSPC                            0x00000002
11528c2ecf20Sopenharmony_ci#endif
11538c2ecf20Sopenharmony_ci
11548c2ecf20Sopenharmony_ci/*
11558c2ecf20Sopenharmony_ci *  The following defines are for the flags in the SP control register.
11568c2ecf20Sopenharmony_ci */
11578c2ecf20Sopenharmony_ci#define SPCR_RUN                                0x00000001
11588c2ecf20Sopenharmony_ci#define SPCR_STPFR                              0x00000002
11598c2ecf20Sopenharmony_ci#define SPCR_RUNFR                              0x00000004
11608c2ecf20Sopenharmony_ci#define SPCR_TICK                               0x00000008
11618c2ecf20Sopenharmony_ci#define SPCR_DRQEN                              0x00000020
11628c2ecf20Sopenharmony_ci#define SPCR_RSTSP                              0x00000040
11638c2ecf20Sopenharmony_ci#define SPCR_OREN                               0x00000080
11648c2ecf20Sopenharmony_ci#ifndef NO_CS4612
11658c2ecf20Sopenharmony_ci#define SPCR_PCIINT                             0x00000100
11668c2ecf20Sopenharmony_ci#define SPCR_OINTD                              0x00000200
11678c2ecf20Sopenharmony_ci#define SPCR_CRE                                0x00008000
11688c2ecf20Sopenharmony_ci#endif
11698c2ecf20Sopenharmony_ci
11708c2ecf20Sopenharmony_ci/*
11718c2ecf20Sopenharmony_ci *  The following defines are for the flags in the debug index register.
11728c2ecf20Sopenharmony_ci */
11738c2ecf20Sopenharmony_ci#define DREG_REGID_MASK                         0x0000007F
11748c2ecf20Sopenharmony_ci#define DREG_DEBUG                              0x00000080
11758c2ecf20Sopenharmony_ci#define DREG_RGBK_MASK                          0x00000700
11768c2ecf20Sopenharmony_ci#define DREG_TRAP                               0x00000800
11778c2ecf20Sopenharmony_ci#if !defined(NO_CS4612)
11788c2ecf20Sopenharmony_ci#if !defined(NO_CS4615)
11798c2ecf20Sopenharmony_ci#define DREG_TRAPX                              0x00001000
11808c2ecf20Sopenharmony_ci#endif
11818c2ecf20Sopenharmony_ci#endif
11828c2ecf20Sopenharmony_ci#define DREG_REGID_SHIFT                        0
11838c2ecf20Sopenharmony_ci#define DREG_RGBK_SHIFT                         8
11848c2ecf20Sopenharmony_ci#define DREG_RGBK_REGID_MASK                    0x0000077F
11858c2ecf20Sopenharmony_ci#define DREG_REGID_R0                           0x00000010
11868c2ecf20Sopenharmony_ci#define DREG_REGID_R1                           0x00000011
11878c2ecf20Sopenharmony_ci#define DREG_REGID_R2                           0x00000012
11888c2ecf20Sopenharmony_ci#define DREG_REGID_R3                           0x00000013
11898c2ecf20Sopenharmony_ci#define DREG_REGID_R4                           0x00000014
11908c2ecf20Sopenharmony_ci#define DREG_REGID_R5                           0x00000015
11918c2ecf20Sopenharmony_ci#define DREG_REGID_R6                           0x00000016
11928c2ecf20Sopenharmony_ci#define DREG_REGID_R7                           0x00000017
11938c2ecf20Sopenharmony_ci#define DREG_REGID_R8                           0x00000018
11948c2ecf20Sopenharmony_ci#define DREG_REGID_R9                           0x00000019
11958c2ecf20Sopenharmony_ci#define DREG_REGID_RA                           0x0000001A
11968c2ecf20Sopenharmony_ci#define DREG_REGID_RB                           0x0000001B
11978c2ecf20Sopenharmony_ci#define DREG_REGID_RC                           0x0000001C
11988c2ecf20Sopenharmony_ci#define DREG_REGID_RD                           0x0000001D
11998c2ecf20Sopenharmony_ci#define DREG_REGID_RE                           0x0000001E
12008c2ecf20Sopenharmony_ci#define DREG_REGID_RF                           0x0000001F
12018c2ecf20Sopenharmony_ci#define DREG_REGID_RA_BUS_LOW                   0x00000020
12028c2ecf20Sopenharmony_ci#define DREG_REGID_RA_BUS_HIGH                  0x00000038
12038c2ecf20Sopenharmony_ci#define DREG_REGID_YBUS_LOW                     0x00000050
12048c2ecf20Sopenharmony_ci#define DREG_REGID_YBUS_HIGH                    0x00000058
12058c2ecf20Sopenharmony_ci#define DREG_REGID_TRAP_0                       0x00000100
12068c2ecf20Sopenharmony_ci#define DREG_REGID_TRAP_1                       0x00000101
12078c2ecf20Sopenharmony_ci#define DREG_REGID_TRAP_2                       0x00000102
12088c2ecf20Sopenharmony_ci#define DREG_REGID_TRAP_3                       0x00000103
12098c2ecf20Sopenharmony_ci#define DREG_REGID_TRAP_4                       0x00000104
12108c2ecf20Sopenharmony_ci#define DREG_REGID_TRAP_5                       0x00000105
12118c2ecf20Sopenharmony_ci#define DREG_REGID_TRAP_6                       0x00000106
12128c2ecf20Sopenharmony_ci#define DREG_REGID_TRAP_7                       0x00000107
12138c2ecf20Sopenharmony_ci#define DREG_REGID_INDIRECT_ADDRESS             0x0000010E
12148c2ecf20Sopenharmony_ci#define DREG_REGID_TOP_OF_STACK                 0x0000010F
12158c2ecf20Sopenharmony_ci#if !defined(NO_CS4612)
12168c2ecf20Sopenharmony_ci#if !defined(NO_CS4615)
12178c2ecf20Sopenharmony_ci#define DREG_REGID_TRAP_8                       0x00000110
12188c2ecf20Sopenharmony_ci#define DREG_REGID_TRAP_9                       0x00000111
12198c2ecf20Sopenharmony_ci#define DREG_REGID_TRAP_10                      0x00000112
12208c2ecf20Sopenharmony_ci#define DREG_REGID_TRAP_11                      0x00000113
12218c2ecf20Sopenharmony_ci#define DREG_REGID_TRAP_12                      0x00000114
12228c2ecf20Sopenharmony_ci#define DREG_REGID_TRAP_13                      0x00000115
12238c2ecf20Sopenharmony_ci#define DREG_REGID_TRAP_14                      0x00000116
12248c2ecf20Sopenharmony_ci#define DREG_REGID_TRAP_15                      0x00000117
12258c2ecf20Sopenharmony_ci#define DREG_REGID_TRAP_16                      0x00000118
12268c2ecf20Sopenharmony_ci#define DREG_REGID_TRAP_17                      0x00000119
12278c2ecf20Sopenharmony_ci#define DREG_REGID_TRAP_18                      0x0000011A
12288c2ecf20Sopenharmony_ci#define DREG_REGID_TRAP_19                      0x0000011B
12298c2ecf20Sopenharmony_ci#define DREG_REGID_TRAP_20                      0x0000011C
12308c2ecf20Sopenharmony_ci#define DREG_REGID_TRAP_21                      0x0000011D
12318c2ecf20Sopenharmony_ci#define DREG_REGID_TRAP_22                      0x0000011E
12328c2ecf20Sopenharmony_ci#define DREG_REGID_TRAP_23                      0x0000011F
12338c2ecf20Sopenharmony_ci#endif
12348c2ecf20Sopenharmony_ci#endif
12358c2ecf20Sopenharmony_ci#define DREG_REGID_RSA0_LOW                     0x00000200
12368c2ecf20Sopenharmony_ci#define DREG_REGID_RSA0_HIGH                    0x00000201
12378c2ecf20Sopenharmony_ci#define DREG_REGID_RSA1_LOW                     0x00000202
12388c2ecf20Sopenharmony_ci#define DREG_REGID_RSA1_HIGH                    0x00000203
12398c2ecf20Sopenharmony_ci#define DREG_REGID_RSA2                         0x00000204
12408c2ecf20Sopenharmony_ci#define DREG_REGID_RSA3                         0x00000205
12418c2ecf20Sopenharmony_ci#define DREG_REGID_RSI0_LOW                     0x00000206
12428c2ecf20Sopenharmony_ci#define DREG_REGID_RSI0_HIGH                    0x00000207
12438c2ecf20Sopenharmony_ci#define DREG_REGID_RSI1                         0x00000208
12448c2ecf20Sopenharmony_ci#define DREG_REGID_RSI2                         0x00000209
12458c2ecf20Sopenharmony_ci#define DREG_REGID_SAGUSTATUS                   0x0000020A
12468c2ecf20Sopenharmony_ci#define DREG_REGID_RSCONFIG01_LOW               0x0000020B
12478c2ecf20Sopenharmony_ci#define DREG_REGID_RSCONFIG01_HIGH              0x0000020C
12488c2ecf20Sopenharmony_ci#define DREG_REGID_RSCONFIG23_LOW               0x0000020D
12498c2ecf20Sopenharmony_ci#define DREG_REGID_RSCONFIG23_HIGH              0x0000020E
12508c2ecf20Sopenharmony_ci#define DREG_REGID_RSDMA01E                     0x0000020F
12518c2ecf20Sopenharmony_ci#define DREG_REGID_RSDMA23E                     0x00000210
12528c2ecf20Sopenharmony_ci#define DREG_REGID_RSD0_LOW                     0x00000211
12538c2ecf20Sopenharmony_ci#define DREG_REGID_RSD0_HIGH                    0x00000212
12548c2ecf20Sopenharmony_ci#define DREG_REGID_RSD1_LOW                     0x00000213
12558c2ecf20Sopenharmony_ci#define DREG_REGID_RSD1_HIGH                    0x00000214
12568c2ecf20Sopenharmony_ci#define DREG_REGID_RSD2_LOW                     0x00000215
12578c2ecf20Sopenharmony_ci#define DREG_REGID_RSD2_HIGH                    0x00000216
12588c2ecf20Sopenharmony_ci#define DREG_REGID_RSD3_LOW                     0x00000217
12598c2ecf20Sopenharmony_ci#define DREG_REGID_RSD3_HIGH                    0x00000218
12608c2ecf20Sopenharmony_ci#define DREG_REGID_SRAR_HIGH                    0x0000021A
12618c2ecf20Sopenharmony_ci#define DREG_REGID_SRAR_LOW                     0x0000021B
12628c2ecf20Sopenharmony_ci#define DREG_REGID_DMA_STATE                    0x0000021C
12638c2ecf20Sopenharmony_ci#define DREG_REGID_CURRENT_DMA_STREAM           0x0000021D
12648c2ecf20Sopenharmony_ci#define DREG_REGID_NEXT_DMA_STREAM              0x0000021E
12658c2ecf20Sopenharmony_ci#define DREG_REGID_CPU_STATUS                   0x00000300
12668c2ecf20Sopenharmony_ci#define DREG_REGID_MAC_MODE                     0x00000301
12678c2ecf20Sopenharmony_ci#define DREG_REGID_STACK_AND_REPEAT             0x00000302
12688c2ecf20Sopenharmony_ci#define DREG_REGID_INDEX0                       0x00000304
12698c2ecf20Sopenharmony_ci#define DREG_REGID_INDEX1                       0x00000305
12708c2ecf20Sopenharmony_ci#define DREG_REGID_DMA_STATE_0_3                0x00000400
12718c2ecf20Sopenharmony_ci#define DREG_REGID_DMA_STATE_4_7                0x00000404
12728c2ecf20Sopenharmony_ci#define DREG_REGID_DMA_STATE_8_11               0x00000408
12738c2ecf20Sopenharmony_ci#define DREG_REGID_DMA_STATE_12_15              0x0000040C
12748c2ecf20Sopenharmony_ci#define DREG_REGID_DMA_STATE_16_19              0x00000410
12758c2ecf20Sopenharmony_ci#define DREG_REGID_DMA_STATE_20_23              0x00000414
12768c2ecf20Sopenharmony_ci#define DREG_REGID_DMA_STATE_24_27              0x00000418
12778c2ecf20Sopenharmony_ci#define DREG_REGID_DMA_STATE_28_31              0x0000041C
12788c2ecf20Sopenharmony_ci#define DREG_REGID_DMA_STATE_32_35              0x00000420
12798c2ecf20Sopenharmony_ci#define DREG_REGID_DMA_STATE_36_39              0x00000424
12808c2ecf20Sopenharmony_ci#define DREG_REGID_DMA_STATE_40_43              0x00000428
12818c2ecf20Sopenharmony_ci#define DREG_REGID_DMA_STATE_44_47              0x0000042C
12828c2ecf20Sopenharmony_ci#define DREG_REGID_DMA_STATE_48_51              0x00000430
12838c2ecf20Sopenharmony_ci#define DREG_REGID_DMA_STATE_52_55              0x00000434
12848c2ecf20Sopenharmony_ci#define DREG_REGID_DMA_STATE_56_59              0x00000438
12858c2ecf20Sopenharmony_ci#define DREG_REGID_DMA_STATE_60_63              0x0000043C
12868c2ecf20Sopenharmony_ci#define DREG_REGID_DMA_STATE_64_67              0x00000440
12878c2ecf20Sopenharmony_ci#define DREG_REGID_DMA_STATE_68_71              0x00000444
12888c2ecf20Sopenharmony_ci#define DREG_REGID_DMA_STATE_72_75              0x00000448
12898c2ecf20Sopenharmony_ci#define DREG_REGID_DMA_STATE_76_79              0x0000044C
12908c2ecf20Sopenharmony_ci#define DREG_REGID_DMA_STATE_80_83              0x00000450
12918c2ecf20Sopenharmony_ci#define DREG_REGID_DMA_STATE_84_87              0x00000454
12928c2ecf20Sopenharmony_ci#define DREG_REGID_DMA_STATE_88_91              0x00000458
12938c2ecf20Sopenharmony_ci#define DREG_REGID_DMA_STATE_92_95              0x0000045C
12948c2ecf20Sopenharmony_ci#define DREG_REGID_TRAP_SELECT                  0x00000500
12958c2ecf20Sopenharmony_ci#define DREG_REGID_TRAP_WRITE_0                 0x00000500
12968c2ecf20Sopenharmony_ci#define DREG_REGID_TRAP_WRITE_1                 0x00000501
12978c2ecf20Sopenharmony_ci#define DREG_REGID_TRAP_WRITE_2                 0x00000502
12988c2ecf20Sopenharmony_ci#define DREG_REGID_TRAP_WRITE_3                 0x00000503
12998c2ecf20Sopenharmony_ci#define DREG_REGID_TRAP_WRITE_4                 0x00000504
13008c2ecf20Sopenharmony_ci#define DREG_REGID_TRAP_WRITE_5                 0x00000505
13018c2ecf20Sopenharmony_ci#define DREG_REGID_TRAP_WRITE_6                 0x00000506
13028c2ecf20Sopenharmony_ci#define DREG_REGID_TRAP_WRITE_7                 0x00000507
13038c2ecf20Sopenharmony_ci#if !defined(NO_CS4612)
13048c2ecf20Sopenharmony_ci#if !defined(NO_CS4615)
13058c2ecf20Sopenharmony_ci#define DREG_REGID_TRAP_WRITE_8                 0x00000510
13068c2ecf20Sopenharmony_ci#define DREG_REGID_TRAP_WRITE_9                 0x00000511
13078c2ecf20Sopenharmony_ci#define DREG_REGID_TRAP_WRITE_10                0x00000512
13088c2ecf20Sopenharmony_ci#define DREG_REGID_TRAP_WRITE_11                0x00000513
13098c2ecf20Sopenharmony_ci#define DREG_REGID_TRAP_WRITE_12                0x00000514
13108c2ecf20Sopenharmony_ci#define DREG_REGID_TRAP_WRITE_13                0x00000515
13118c2ecf20Sopenharmony_ci#define DREG_REGID_TRAP_WRITE_14                0x00000516
13128c2ecf20Sopenharmony_ci#define DREG_REGID_TRAP_WRITE_15                0x00000517
13138c2ecf20Sopenharmony_ci#define DREG_REGID_TRAP_WRITE_16                0x00000518
13148c2ecf20Sopenharmony_ci#define DREG_REGID_TRAP_WRITE_17                0x00000519
13158c2ecf20Sopenharmony_ci#define DREG_REGID_TRAP_WRITE_18                0x0000051A
13168c2ecf20Sopenharmony_ci#define DREG_REGID_TRAP_WRITE_19                0x0000051B
13178c2ecf20Sopenharmony_ci#define DREG_REGID_TRAP_WRITE_20                0x0000051C
13188c2ecf20Sopenharmony_ci#define DREG_REGID_TRAP_WRITE_21                0x0000051D
13198c2ecf20Sopenharmony_ci#define DREG_REGID_TRAP_WRITE_22                0x0000051E
13208c2ecf20Sopenharmony_ci#define DREG_REGID_TRAP_WRITE_23                0x0000051F
13218c2ecf20Sopenharmony_ci#endif
13228c2ecf20Sopenharmony_ci#endif
13238c2ecf20Sopenharmony_ci#define DREG_REGID_MAC0_ACC0_LOW                0x00000600
13248c2ecf20Sopenharmony_ci#define DREG_REGID_MAC0_ACC1_LOW                0x00000601
13258c2ecf20Sopenharmony_ci#define DREG_REGID_MAC0_ACC2_LOW                0x00000602
13268c2ecf20Sopenharmony_ci#define DREG_REGID_MAC0_ACC3_LOW                0x00000603
13278c2ecf20Sopenharmony_ci#define DREG_REGID_MAC1_ACC0_LOW                0x00000604
13288c2ecf20Sopenharmony_ci#define DREG_REGID_MAC1_ACC1_LOW                0x00000605
13298c2ecf20Sopenharmony_ci#define DREG_REGID_MAC1_ACC2_LOW                0x00000606
13308c2ecf20Sopenharmony_ci#define DREG_REGID_MAC1_ACC3_LOW                0x00000607
13318c2ecf20Sopenharmony_ci#define DREG_REGID_MAC0_ACC0_MID                0x00000608
13328c2ecf20Sopenharmony_ci#define DREG_REGID_MAC0_ACC1_MID                0x00000609
13338c2ecf20Sopenharmony_ci#define DREG_REGID_MAC0_ACC2_MID                0x0000060A
13348c2ecf20Sopenharmony_ci#define DREG_REGID_MAC0_ACC3_MID                0x0000060B
13358c2ecf20Sopenharmony_ci#define DREG_REGID_MAC1_ACC0_MID                0x0000060C
13368c2ecf20Sopenharmony_ci#define DREG_REGID_MAC1_ACC1_MID                0x0000060D
13378c2ecf20Sopenharmony_ci#define DREG_REGID_MAC1_ACC2_MID                0x0000060E
13388c2ecf20Sopenharmony_ci#define DREG_REGID_MAC1_ACC3_MID                0x0000060F
13398c2ecf20Sopenharmony_ci#define DREG_REGID_MAC0_ACC0_HIGH               0x00000610
13408c2ecf20Sopenharmony_ci#define DREG_REGID_MAC0_ACC1_HIGH               0x00000611
13418c2ecf20Sopenharmony_ci#define DREG_REGID_MAC0_ACC2_HIGH               0x00000612
13428c2ecf20Sopenharmony_ci#define DREG_REGID_MAC0_ACC3_HIGH               0x00000613
13438c2ecf20Sopenharmony_ci#define DREG_REGID_MAC1_ACC0_HIGH               0x00000614
13448c2ecf20Sopenharmony_ci#define DREG_REGID_MAC1_ACC1_HIGH               0x00000615
13458c2ecf20Sopenharmony_ci#define DREG_REGID_MAC1_ACC2_HIGH               0x00000616
13468c2ecf20Sopenharmony_ci#define DREG_REGID_MAC1_ACC3_HIGH               0x00000617
13478c2ecf20Sopenharmony_ci#define DREG_REGID_RSHOUT_LOW                   0x00000620
13488c2ecf20Sopenharmony_ci#define DREG_REGID_RSHOUT_MID                   0x00000628
13498c2ecf20Sopenharmony_ci#define DREG_REGID_RSHOUT_HIGH                  0x00000630
13508c2ecf20Sopenharmony_ci
13518c2ecf20Sopenharmony_ci/*
13528c2ecf20Sopenharmony_ci *  The following defines are for the flags in the DMA stream requestor write
13538c2ecf20Sopenharmony_ci */
13548c2ecf20Sopenharmony_ci#define DSRWP_DSR_MASK                          0x0000000F
13558c2ecf20Sopenharmony_ci#define DSRWP_DSR_BG_RQ                         0x00000001
13568c2ecf20Sopenharmony_ci#define DSRWP_DSR_PRIORITY_MASK                 0x00000006
13578c2ecf20Sopenharmony_ci#define DSRWP_DSR_PRIORITY_0                    0x00000000
13588c2ecf20Sopenharmony_ci#define DSRWP_DSR_PRIORITY_1                    0x00000002
13598c2ecf20Sopenharmony_ci#define DSRWP_DSR_PRIORITY_2                    0x00000004
13608c2ecf20Sopenharmony_ci#define DSRWP_DSR_PRIORITY_3                    0x00000006
13618c2ecf20Sopenharmony_ci#define DSRWP_DSR_RQ_PENDING                    0x00000008
13628c2ecf20Sopenharmony_ci
13638c2ecf20Sopenharmony_ci/*
13648c2ecf20Sopenharmony_ci *  The following defines are for the flags in the trap write port register.
13658c2ecf20Sopenharmony_ci */
13668c2ecf20Sopenharmony_ci#define TWPR_TW_MASK                            0x0000FFFF
13678c2ecf20Sopenharmony_ci#define TWPR_TW_SHIFT                           0
13688c2ecf20Sopenharmony_ci
13698c2ecf20Sopenharmony_ci/*
13708c2ecf20Sopenharmony_ci *  The following defines are for the flags in the stack pointer write
13718c2ecf20Sopenharmony_ci *  register.
13728c2ecf20Sopenharmony_ci */
13738c2ecf20Sopenharmony_ci#define SPWR_STKP_MASK                          0x0000000F
13748c2ecf20Sopenharmony_ci#define SPWR_STKP_SHIFT                         0
13758c2ecf20Sopenharmony_ci
13768c2ecf20Sopenharmony_ci/*
13778c2ecf20Sopenharmony_ci *  The following defines are for the flags in the SP interrupt register.
13788c2ecf20Sopenharmony_ci */
13798c2ecf20Sopenharmony_ci#define SPIR_FRI                                0x00000001
13808c2ecf20Sopenharmony_ci#define SPIR_DOI                                0x00000002
13818c2ecf20Sopenharmony_ci#define SPIR_GPI2                               0x00000004
13828c2ecf20Sopenharmony_ci#define SPIR_GPI3                               0x00000008
13838c2ecf20Sopenharmony_ci#define SPIR_IP0                                0x00000010
13848c2ecf20Sopenharmony_ci#define SPIR_IP1                                0x00000020
13858c2ecf20Sopenharmony_ci#define SPIR_IP2                                0x00000040
13868c2ecf20Sopenharmony_ci#define SPIR_IP3                                0x00000080
13878c2ecf20Sopenharmony_ci
13888c2ecf20Sopenharmony_ci/*
13898c2ecf20Sopenharmony_ci *  The following defines are for the flags in the functional group 1 register.
13908c2ecf20Sopenharmony_ci */
13918c2ecf20Sopenharmony_ci#define FGR1_F1S_MASK                           0x0000FFFF
13928c2ecf20Sopenharmony_ci#define FGR1_F1S_SHIFT                          0
13938c2ecf20Sopenharmony_ci
13948c2ecf20Sopenharmony_ci/*
13958c2ecf20Sopenharmony_ci *  The following defines are for the flags in the SP clock status register.
13968c2ecf20Sopenharmony_ci */
13978c2ecf20Sopenharmony_ci#define SPCS_FRI                                0x00000001
13988c2ecf20Sopenharmony_ci#define SPCS_DOI                                0x00000002
13998c2ecf20Sopenharmony_ci#define SPCS_GPI2                               0x00000004
14008c2ecf20Sopenharmony_ci#define SPCS_GPI3                               0x00000008
14018c2ecf20Sopenharmony_ci#define SPCS_IP0                                0x00000010
14028c2ecf20Sopenharmony_ci#define SPCS_IP1                                0x00000020
14038c2ecf20Sopenharmony_ci#define SPCS_IP2                                0x00000040
14048c2ecf20Sopenharmony_ci#define SPCS_IP3                                0x00000080
14058c2ecf20Sopenharmony_ci#define SPCS_SPRUN                              0x00000100
14068c2ecf20Sopenharmony_ci#define SPCS_SLEEP                              0x00000200
14078c2ecf20Sopenharmony_ci#define SPCS_FG                                 0x00000400
14088c2ecf20Sopenharmony_ci#define SPCS_ORUN                               0x00000800
14098c2ecf20Sopenharmony_ci#define SPCS_IRQ                                0x00001000
14108c2ecf20Sopenharmony_ci#define SPCS_FGN_MASK                           0x0000E000
14118c2ecf20Sopenharmony_ci#define SPCS_FGN_SHIFT                          13
14128c2ecf20Sopenharmony_ci
14138c2ecf20Sopenharmony_ci/*
14148c2ecf20Sopenharmony_ci *  The following defines are for the flags in the SP DMA requestor status
14158c2ecf20Sopenharmony_ci *  register.
14168c2ecf20Sopenharmony_ci */
14178c2ecf20Sopenharmony_ci#define SDSR_DCS_MASK                           0x000000FF
14188c2ecf20Sopenharmony_ci#define SDSR_DCS_SHIFT                          0
14198c2ecf20Sopenharmony_ci#define SDSR_DCS_NONE                           0x00000007
14208c2ecf20Sopenharmony_ci
14218c2ecf20Sopenharmony_ci/*
14228c2ecf20Sopenharmony_ci *  The following defines are for the flags in the frame timer register.
14238c2ecf20Sopenharmony_ci */
14248c2ecf20Sopenharmony_ci#define FRMT_FTV_MASK                           0x0000FFFF
14258c2ecf20Sopenharmony_ci#define FRMT_FTV_SHIFT                          0
14268c2ecf20Sopenharmony_ci
14278c2ecf20Sopenharmony_ci/*
14288c2ecf20Sopenharmony_ci *  The following defines are for the flags in the frame timer current count
14298c2ecf20Sopenharmony_ci *  register.
14308c2ecf20Sopenharmony_ci */
14318c2ecf20Sopenharmony_ci#define FRCC_FCC_MASK                           0x0000FFFF
14328c2ecf20Sopenharmony_ci#define FRCC_FCC_SHIFT                          0
14338c2ecf20Sopenharmony_ci
14348c2ecf20Sopenharmony_ci/*
14358c2ecf20Sopenharmony_ci *  The following defines are for the flags in the frame timer save count
14368c2ecf20Sopenharmony_ci *  register.
14378c2ecf20Sopenharmony_ci */
14388c2ecf20Sopenharmony_ci#define FRSC_FCS_MASK                           0x0000FFFF
14398c2ecf20Sopenharmony_ci#define FRSC_FCS_SHIFT                          0
14408c2ecf20Sopenharmony_ci
14418c2ecf20Sopenharmony_ci/*
14428c2ecf20Sopenharmony_ci *  The following define the various flags stored in the scatter/gather
14438c2ecf20Sopenharmony_ci *  descriptors.
14448c2ecf20Sopenharmony_ci */
14458c2ecf20Sopenharmony_ci#define DMA_SG_NEXT_ENTRY_MASK                  0x00000FF8
14468c2ecf20Sopenharmony_ci#define DMA_SG_SAMPLE_END_MASK                  0x0FFF0000
14478c2ecf20Sopenharmony_ci#define DMA_SG_SAMPLE_END_FLAG                  0x10000000
14488c2ecf20Sopenharmony_ci#define DMA_SG_LOOP_END_FLAG                    0x20000000
14498c2ecf20Sopenharmony_ci#define DMA_SG_SIGNAL_END_FLAG                  0x40000000
14508c2ecf20Sopenharmony_ci#define DMA_SG_SIGNAL_PAGE_FLAG                 0x80000000
14518c2ecf20Sopenharmony_ci#define DMA_SG_NEXT_ENTRY_SHIFT                 3
14528c2ecf20Sopenharmony_ci#define DMA_SG_SAMPLE_END_SHIFT                 16
14538c2ecf20Sopenharmony_ci
14548c2ecf20Sopenharmony_ci/*
14558c2ecf20Sopenharmony_ci *  The following define the offsets of the fields within the on-chip generic
14568c2ecf20Sopenharmony_ci *  DMA requestor.
14578c2ecf20Sopenharmony_ci */
14588c2ecf20Sopenharmony_ci#define DMA_RQ_CONTROL1                         0x00000000
14598c2ecf20Sopenharmony_ci#define DMA_RQ_CONTROL2                         0x00000004
14608c2ecf20Sopenharmony_ci#define DMA_RQ_SOURCE_ADDR                      0x00000008
14618c2ecf20Sopenharmony_ci#define DMA_RQ_DESTINATION_ADDR                 0x0000000C
14628c2ecf20Sopenharmony_ci#define DMA_RQ_NEXT_PAGE_ADDR                   0x00000010
14638c2ecf20Sopenharmony_ci#define DMA_RQ_NEXT_PAGE_SGDESC                 0x00000014
14648c2ecf20Sopenharmony_ci#define DMA_RQ_LOOP_START_ADDR                  0x00000018
14658c2ecf20Sopenharmony_ci#define DMA_RQ_POST_LOOP_ADDR                   0x0000001C
14668c2ecf20Sopenharmony_ci#define DMA_RQ_PAGE_MAP_ADDR                    0x00000020
14678c2ecf20Sopenharmony_ci
14688c2ecf20Sopenharmony_ci/*
14698c2ecf20Sopenharmony_ci *  The following defines are for the flags in the first control word of the
14708c2ecf20Sopenharmony_ci *  on-chip generic DMA requestor.
14718c2ecf20Sopenharmony_ci */
14728c2ecf20Sopenharmony_ci#define DMA_RQ_C1_COUNT_MASK                    0x000003FF
14738c2ecf20Sopenharmony_ci#define DMA_RQ_C1_DESTINATION_SCATTER           0x00001000
14748c2ecf20Sopenharmony_ci#define DMA_RQ_C1_SOURCE_GATHER                 0x00002000
14758c2ecf20Sopenharmony_ci#define DMA_RQ_C1_DONE_FLAG                     0x00004000
14768c2ecf20Sopenharmony_ci#define DMA_RQ_C1_OPTIMIZE_STATE                0x00008000
14778c2ecf20Sopenharmony_ci#define DMA_RQ_C1_SAMPLE_END_STATE_MASK         0x00030000
14788c2ecf20Sopenharmony_ci#define DMA_RQ_C1_FULL_PAGE                     0x00000000
14798c2ecf20Sopenharmony_ci#define DMA_RQ_C1_BEFORE_SAMPLE_END             0x00010000
14808c2ecf20Sopenharmony_ci#define DMA_RQ_C1_PAGE_MAP_ERROR                0x00020000
14818c2ecf20Sopenharmony_ci#define DMA_RQ_C1_AT_SAMPLE_END                 0x00030000
14828c2ecf20Sopenharmony_ci#define DMA_RQ_C1_LOOP_END_STATE_MASK           0x000C0000
14838c2ecf20Sopenharmony_ci#define DMA_RQ_C1_NOT_LOOP_END                  0x00000000
14848c2ecf20Sopenharmony_ci#define DMA_RQ_C1_BEFORE_LOOP_END               0x00040000
14858c2ecf20Sopenharmony_ci#define DMA_RQ_C1_2PAGE_LOOP_BEGIN              0x00080000
14868c2ecf20Sopenharmony_ci#define DMA_RQ_C1_LOOP_BEGIN                    0x000C0000
14878c2ecf20Sopenharmony_ci#define DMA_RQ_C1_PAGE_MAP_MASK                 0x00300000
14888c2ecf20Sopenharmony_ci#define DMA_RQ_C1_PM_NONE_PENDING               0x00000000
14898c2ecf20Sopenharmony_ci#define DMA_RQ_C1_PM_NEXT_PENDING               0x00100000
14908c2ecf20Sopenharmony_ci#define DMA_RQ_C1_PM_RESERVED                   0x00200000
14918c2ecf20Sopenharmony_ci#define DMA_RQ_C1_PM_LOOP_NEXT_PENDING          0x00300000
14928c2ecf20Sopenharmony_ci#define DMA_RQ_C1_WRITEBACK_DEST_FLAG           0x00400000
14938c2ecf20Sopenharmony_ci#define DMA_RQ_C1_WRITEBACK_SRC_FLAG            0x00800000
14948c2ecf20Sopenharmony_ci#define DMA_RQ_C1_DEST_SIZE_MASK                0x07000000
14958c2ecf20Sopenharmony_ci#define DMA_RQ_C1_DEST_LINEAR                   0x00000000
14968c2ecf20Sopenharmony_ci#define DMA_RQ_C1_DEST_MOD16                    0x01000000
14978c2ecf20Sopenharmony_ci#define DMA_RQ_C1_DEST_MOD32                    0x02000000
14988c2ecf20Sopenharmony_ci#define DMA_RQ_C1_DEST_MOD64                    0x03000000
14998c2ecf20Sopenharmony_ci#define DMA_RQ_C1_DEST_MOD128                   0x04000000
15008c2ecf20Sopenharmony_ci#define DMA_RQ_C1_DEST_MOD256                   0x05000000
15018c2ecf20Sopenharmony_ci#define DMA_RQ_C1_DEST_MOD512                   0x06000000
15028c2ecf20Sopenharmony_ci#define DMA_RQ_C1_DEST_MOD1024                  0x07000000
15038c2ecf20Sopenharmony_ci#define DMA_RQ_C1_DEST_ON_HOST                  0x08000000
15048c2ecf20Sopenharmony_ci#define DMA_RQ_C1_SOURCE_SIZE_MASK              0x70000000
15058c2ecf20Sopenharmony_ci#define DMA_RQ_C1_SOURCE_LINEAR                 0x00000000
15068c2ecf20Sopenharmony_ci#define DMA_RQ_C1_SOURCE_MOD16                  0x10000000
15078c2ecf20Sopenharmony_ci#define DMA_RQ_C1_SOURCE_MOD32                  0x20000000
15088c2ecf20Sopenharmony_ci#define DMA_RQ_C1_SOURCE_MOD64                  0x30000000
15098c2ecf20Sopenharmony_ci#define DMA_RQ_C1_SOURCE_MOD128                 0x40000000
15108c2ecf20Sopenharmony_ci#define DMA_RQ_C1_SOURCE_MOD256                 0x50000000
15118c2ecf20Sopenharmony_ci#define DMA_RQ_C1_SOURCE_MOD512                 0x60000000
15128c2ecf20Sopenharmony_ci#define DMA_RQ_C1_SOURCE_MOD1024                0x70000000
15138c2ecf20Sopenharmony_ci#define DMA_RQ_C1_SOURCE_ON_HOST                0x80000000
15148c2ecf20Sopenharmony_ci#define DMA_RQ_C1_COUNT_SHIFT                   0
15158c2ecf20Sopenharmony_ci
15168c2ecf20Sopenharmony_ci/*
15178c2ecf20Sopenharmony_ci *  The following defines are for the flags in the second control word of the
15188c2ecf20Sopenharmony_ci *  on-chip generic DMA requestor.
15198c2ecf20Sopenharmony_ci */
15208c2ecf20Sopenharmony_ci#define DMA_RQ_C2_VIRTUAL_CHANNEL_MASK          0x0000003F
15218c2ecf20Sopenharmony_ci#define DMA_RQ_C2_VIRTUAL_SIGNAL_MASK           0x00000300
15228c2ecf20Sopenharmony_ci#define DMA_RQ_C2_NO_VIRTUAL_SIGNAL             0x00000000
15238c2ecf20Sopenharmony_ci#define DMA_RQ_C2_SIGNAL_EVERY_DMA              0x00000100
15248c2ecf20Sopenharmony_ci#define DMA_RQ_C2_SIGNAL_SOURCE_PINGPONG        0x00000200
15258c2ecf20Sopenharmony_ci#define DMA_RQ_C2_SIGNAL_DEST_PINGPONG          0x00000300
15268c2ecf20Sopenharmony_ci#define DMA_RQ_C2_AUDIO_CONVERT_MASK            0x0000F000
15278c2ecf20Sopenharmony_ci#define DMA_RQ_C2_AC_NONE                       0x00000000
15288c2ecf20Sopenharmony_ci#define DMA_RQ_C2_AC_8_TO_16_BIT                0x00001000
15298c2ecf20Sopenharmony_ci#define DMA_RQ_C2_AC_MONO_TO_STEREO             0x00002000
15308c2ecf20Sopenharmony_ci#define DMA_RQ_C2_AC_ENDIAN_CONVERT             0x00004000
15318c2ecf20Sopenharmony_ci#define DMA_RQ_C2_AC_SIGNED_CONVERT             0x00008000
15328c2ecf20Sopenharmony_ci#define DMA_RQ_C2_LOOP_END_MASK                 0x0FFF0000
15338c2ecf20Sopenharmony_ci#define DMA_RQ_C2_LOOP_MASK                     0x30000000
15348c2ecf20Sopenharmony_ci#define DMA_RQ_C2_NO_LOOP                       0x00000000
15358c2ecf20Sopenharmony_ci#define DMA_RQ_C2_ONE_PAGE_LOOP                 0x10000000
15368c2ecf20Sopenharmony_ci#define DMA_RQ_C2_TWO_PAGE_LOOP                 0x20000000
15378c2ecf20Sopenharmony_ci#define DMA_RQ_C2_MULTI_PAGE_LOOP               0x30000000
15388c2ecf20Sopenharmony_ci#define DMA_RQ_C2_SIGNAL_LOOP_BACK              0x40000000
15398c2ecf20Sopenharmony_ci#define DMA_RQ_C2_SIGNAL_POST_BEGIN_PAGE        0x80000000
15408c2ecf20Sopenharmony_ci#define DMA_RQ_C2_VIRTUAL_CHANNEL_SHIFT         0
15418c2ecf20Sopenharmony_ci#define DMA_RQ_C2_LOOP_END_SHIFT                16
15428c2ecf20Sopenharmony_ci
15438c2ecf20Sopenharmony_ci/*
15448c2ecf20Sopenharmony_ci *  The following defines are for the flags in the source and destination words
15458c2ecf20Sopenharmony_ci *  of the on-chip generic DMA requestor.
15468c2ecf20Sopenharmony_ci */
15478c2ecf20Sopenharmony_ci#define DMA_RQ_SD_ADDRESS_MASK                  0x0000FFFF
15488c2ecf20Sopenharmony_ci#define DMA_RQ_SD_MEMORY_ID_MASK                0x000F0000
15498c2ecf20Sopenharmony_ci#define DMA_RQ_SD_SP_PARAM_ADDR                 0x00000000
15508c2ecf20Sopenharmony_ci#define DMA_RQ_SD_SP_SAMPLE_ADDR                0x00010000
15518c2ecf20Sopenharmony_ci#define DMA_RQ_SD_SP_PROGRAM_ADDR               0x00020000
15528c2ecf20Sopenharmony_ci#define DMA_RQ_SD_SP_DEBUG_ADDR                 0x00030000
15538c2ecf20Sopenharmony_ci#define DMA_RQ_SD_OMNIMEM_ADDR                  0x000E0000
15548c2ecf20Sopenharmony_ci#define DMA_RQ_SD_END_FLAG                      0x40000000
15558c2ecf20Sopenharmony_ci#define DMA_RQ_SD_ERROR_FLAG                    0x80000000
15568c2ecf20Sopenharmony_ci#define DMA_RQ_SD_ADDRESS_SHIFT                 0
15578c2ecf20Sopenharmony_ci
15588c2ecf20Sopenharmony_ci/*
15598c2ecf20Sopenharmony_ci *  The following defines are for the flags in the page map address word of the
15608c2ecf20Sopenharmony_ci *  on-chip generic DMA requestor.
15618c2ecf20Sopenharmony_ci */
15628c2ecf20Sopenharmony_ci#define DMA_RQ_PMA_LOOP_THIRD_PAGE_ENTRY_MASK   0x00000FF8
15638c2ecf20Sopenharmony_ci#define DMA_RQ_PMA_PAGE_TABLE_MASK              0xFFFFF000
15648c2ecf20Sopenharmony_ci#define DMA_RQ_PMA_LOOP_THIRD_PAGE_ENTRY_SHIFT  3
15658c2ecf20Sopenharmony_ci#define DMA_RQ_PMA_PAGE_TABLE_SHIFT             12
15668c2ecf20Sopenharmony_ci
15678c2ecf20Sopenharmony_ci#define BA1_VARIDEC_BUF_1       0x000
15688c2ecf20Sopenharmony_ci
15698c2ecf20Sopenharmony_ci#define BA1_PDTC                0x0c0    /* BA1_PLAY_DMA_TRANSACTION_COUNT_REG */
15708c2ecf20Sopenharmony_ci#define BA1_PFIE                0x0c4    /* BA1_PLAY_FORMAT_&_INTERRUPT_ENABLE_REG */
15718c2ecf20Sopenharmony_ci#define BA1_PBA                 0x0c8    /* BA1_PLAY_BUFFER_ADDRESS */
15728c2ecf20Sopenharmony_ci#define BA1_PVOL                0x0f8    /* BA1_PLAY_VOLUME_REG */
15738c2ecf20Sopenharmony_ci#define BA1_PSRC                0x288    /* BA1_PLAY_SAMPLE_RATE_CORRECTION_REG */
15748c2ecf20Sopenharmony_ci#define BA1_PCTL                0x2a4    /* BA1_PLAY_CONTROL_REG */
15758c2ecf20Sopenharmony_ci#define BA1_PPI                 0x2b4    /* BA1_PLAY_PHASE_INCREMENT_REG */
15768c2ecf20Sopenharmony_ci
15778c2ecf20Sopenharmony_ci#define BA1_CCTL                0x064    /* BA1_CAPTURE_CONTROL_REG */
15788c2ecf20Sopenharmony_ci#define BA1_CIE                 0x104    /* BA1_CAPTURE_INTERRUPT_ENABLE_REG */
15798c2ecf20Sopenharmony_ci#define BA1_CBA                 0x10c    /* BA1_CAPTURE_BUFFER_ADDRESS */
15808c2ecf20Sopenharmony_ci#define BA1_CSRC                0x2c8    /* BA1_CAPTURE_SAMPLE_RATE_CORRECTION_REG */
15818c2ecf20Sopenharmony_ci#define BA1_CCI                 0x2d8    /* BA1_CAPTURE_COEFFICIENT_INCREMENT_REG */
15828c2ecf20Sopenharmony_ci#define BA1_CD                  0x2e0    /* BA1_CAPTURE_DELAY_REG */
15838c2ecf20Sopenharmony_ci#define BA1_CPI                 0x2f4    /* BA1_CAPTURE_PHASE_INCREMENT_REG */
15848c2ecf20Sopenharmony_ci#define BA1_CVOL                0x2f8    /* BA1_CAPTURE_VOLUME_REG */
15858c2ecf20Sopenharmony_ci
15868c2ecf20Sopenharmony_ci#define BA1_CFG1                0x134    /* BA1_CAPTURE_FRAME_GROUP_1_REG */
15878c2ecf20Sopenharmony_ci#define BA1_CFG2                0x138    /* BA1_CAPTURE_FRAME_GROUP_2_REG */
15888c2ecf20Sopenharmony_ci#define BA1_CCST                0x13c    /* BA1_CAPTURE_CONSTANT_REG */
15898c2ecf20Sopenharmony_ci#define BA1_CSPB                0x340    /* BA1_CAPTURE_SPB_ADDRESS */
15908c2ecf20Sopenharmony_ci
15918c2ecf20Sopenharmony_ci/*
15928c2ecf20Sopenharmony_ci *
15938c2ecf20Sopenharmony_ci */
15948c2ecf20Sopenharmony_ci
15958c2ecf20Sopenharmony_ci#define CS46XX_MODE_OUTPUT	(1<<0)	 /* MIDI UART - output */
15968c2ecf20Sopenharmony_ci#define CS46XX_MODE_INPUT	(1<<1)	 /* MIDI UART - input */
15978c2ecf20Sopenharmony_ci
15988c2ecf20Sopenharmony_ci/*
15998c2ecf20Sopenharmony_ci *
16008c2ecf20Sopenharmony_ci */
16018c2ecf20Sopenharmony_ci
16028c2ecf20Sopenharmony_ci#define SAVE_REG_MAX             0x10
16038c2ecf20Sopenharmony_ci#define POWER_DOWN_ALL         0x7f0f
16048c2ecf20Sopenharmony_ci
16058c2ecf20Sopenharmony_ci/* maxinum number of AC97 codecs connected, AC97 2.0 defined 4 */
16068c2ecf20Sopenharmony_ci#define MAX_NR_AC97				            4
16078c2ecf20Sopenharmony_ci#define CS46XX_PRIMARY_CODEC_INDEX          0
16088c2ecf20Sopenharmony_ci#define CS46XX_SECONDARY_CODEC_INDEX		1
16098c2ecf20Sopenharmony_ci#define CS46XX_SECONDARY_CODEC_OFFSET		0x80
16108c2ecf20Sopenharmony_ci#define CS46XX_DSP_CAPTURE_CHANNEL          1
16118c2ecf20Sopenharmony_ci
16128c2ecf20Sopenharmony_ci/* capture */
16138c2ecf20Sopenharmony_ci#define CS46XX_DSP_CAPTURE_CHANNEL          1
16148c2ecf20Sopenharmony_ci
16158c2ecf20Sopenharmony_ci/* mixer */
16168c2ecf20Sopenharmony_ci#define CS46XX_MIXER_SPDIF_INPUT_ELEMENT    1
16178c2ecf20Sopenharmony_ci#define CS46XX_MIXER_SPDIF_OUTPUT_ELEMENT   2
16188c2ecf20Sopenharmony_ci
16198c2ecf20Sopenharmony_ci
16208c2ecf20Sopenharmony_cistruct snd_cs46xx_pcm {
16218c2ecf20Sopenharmony_ci	struct snd_dma_buffer hw_buf;
16228c2ecf20Sopenharmony_ci
16238c2ecf20Sopenharmony_ci	unsigned int ctl;
16248c2ecf20Sopenharmony_ci	unsigned int shift;	/* Shift count to trasform frames in bytes */
16258c2ecf20Sopenharmony_ci	struct snd_pcm_indirect pcm_rec;
16268c2ecf20Sopenharmony_ci	struct snd_pcm_substream *substream;
16278c2ecf20Sopenharmony_ci
16288c2ecf20Sopenharmony_ci	struct dsp_pcm_channel_descriptor * pcm_channel;
16298c2ecf20Sopenharmony_ci
16308c2ecf20Sopenharmony_ci	int pcm_channel_id;    /* Fron Rear, Center Lfe  ... */
16318c2ecf20Sopenharmony_ci};
16328c2ecf20Sopenharmony_ci
16338c2ecf20Sopenharmony_cistruct snd_cs46xx_region {
16348c2ecf20Sopenharmony_ci	char name[24];
16358c2ecf20Sopenharmony_ci	unsigned long base;
16368c2ecf20Sopenharmony_ci	void __iomem *remap_addr;
16378c2ecf20Sopenharmony_ci	unsigned long size;
16388c2ecf20Sopenharmony_ci	struct resource *resource;
16398c2ecf20Sopenharmony_ci};
16408c2ecf20Sopenharmony_ci
16418c2ecf20Sopenharmony_cistruct snd_cs46xx {
16428c2ecf20Sopenharmony_ci	int irq;
16438c2ecf20Sopenharmony_ci	unsigned long ba0_addr;
16448c2ecf20Sopenharmony_ci	unsigned long ba1_addr;
16458c2ecf20Sopenharmony_ci	union {
16468c2ecf20Sopenharmony_ci		struct {
16478c2ecf20Sopenharmony_ci			struct snd_cs46xx_region ba0;
16488c2ecf20Sopenharmony_ci			struct snd_cs46xx_region data0;
16498c2ecf20Sopenharmony_ci			struct snd_cs46xx_region data1;
16508c2ecf20Sopenharmony_ci			struct snd_cs46xx_region pmem;
16518c2ecf20Sopenharmony_ci			struct snd_cs46xx_region reg;
16528c2ecf20Sopenharmony_ci		} name;
16538c2ecf20Sopenharmony_ci		struct snd_cs46xx_region idx[5];
16548c2ecf20Sopenharmony_ci	} region;
16558c2ecf20Sopenharmony_ci
16568c2ecf20Sopenharmony_ci	unsigned int mode;
16578c2ecf20Sopenharmony_ci
16588c2ecf20Sopenharmony_ci	struct {
16598c2ecf20Sopenharmony_ci		struct snd_dma_buffer hw_buf;
16608c2ecf20Sopenharmony_ci
16618c2ecf20Sopenharmony_ci		unsigned int ctl;
16628c2ecf20Sopenharmony_ci		unsigned int shift;	/* Shift count to trasform frames in bytes */
16638c2ecf20Sopenharmony_ci		struct snd_pcm_indirect pcm_rec;
16648c2ecf20Sopenharmony_ci		struct snd_pcm_substream *substream;
16658c2ecf20Sopenharmony_ci	} capt;
16668c2ecf20Sopenharmony_ci
16678c2ecf20Sopenharmony_ci
16688c2ecf20Sopenharmony_ci	int nr_ac97_codecs;
16698c2ecf20Sopenharmony_ci	struct snd_ac97_bus *ac97_bus;
16708c2ecf20Sopenharmony_ci	struct snd_ac97 *ac97[MAX_NR_AC97];
16718c2ecf20Sopenharmony_ci
16728c2ecf20Sopenharmony_ci	struct pci_dev *pci;
16738c2ecf20Sopenharmony_ci	struct snd_card *card;
16748c2ecf20Sopenharmony_ci	struct snd_pcm *pcm;
16758c2ecf20Sopenharmony_ci
16768c2ecf20Sopenharmony_ci	struct snd_rawmidi *rmidi;
16778c2ecf20Sopenharmony_ci	struct snd_rawmidi_substream *midi_input;
16788c2ecf20Sopenharmony_ci	struct snd_rawmidi_substream *midi_output;
16798c2ecf20Sopenharmony_ci
16808c2ecf20Sopenharmony_ci	spinlock_t reg_lock;
16818c2ecf20Sopenharmony_ci	unsigned int midcr;
16828c2ecf20Sopenharmony_ci	unsigned int uartm;
16838c2ecf20Sopenharmony_ci
16848c2ecf20Sopenharmony_ci	int amplifier;
16858c2ecf20Sopenharmony_ci	void (*amplifier_ctrl)(struct snd_cs46xx *, int);
16868c2ecf20Sopenharmony_ci	void (*active_ctrl)(struct snd_cs46xx *, int);
16878c2ecf20Sopenharmony_ci  	void (*mixer_init)(struct snd_cs46xx *);
16888c2ecf20Sopenharmony_ci
16898c2ecf20Sopenharmony_ci	int acpi_port;
16908c2ecf20Sopenharmony_ci	struct snd_kcontrol *eapd_switch; /* for amplifier hack */
16918c2ecf20Sopenharmony_ci	int accept_valid;	/* accept mmap valid (for OSS) */
16928c2ecf20Sopenharmony_ci	int in_suspend;
16938c2ecf20Sopenharmony_ci
16948c2ecf20Sopenharmony_ci	struct gameport *gameport;
16958c2ecf20Sopenharmony_ci
16968c2ecf20Sopenharmony_ci#ifdef CONFIG_SND_CS46XX_NEW_DSP
16978c2ecf20Sopenharmony_ci	struct mutex spos_mutex;
16988c2ecf20Sopenharmony_ci
16998c2ecf20Sopenharmony_ci	struct dsp_spos_instance * dsp_spos_instance;
17008c2ecf20Sopenharmony_ci
17018c2ecf20Sopenharmony_ci	struct snd_pcm *pcm_rear;
17028c2ecf20Sopenharmony_ci	struct snd_pcm *pcm_center_lfe;
17038c2ecf20Sopenharmony_ci	struct snd_pcm *pcm_iec958;
17048c2ecf20Sopenharmony_ci
17058c2ecf20Sopenharmony_ci#define CS46XX_DSP_MODULES	5
17068c2ecf20Sopenharmony_ci	struct dsp_module_desc *modules[CS46XX_DSP_MODULES];
17078c2ecf20Sopenharmony_ci#else /* for compatibility */
17088c2ecf20Sopenharmony_ci	struct snd_cs46xx_pcm *playback_pcm;
17098c2ecf20Sopenharmony_ci	unsigned int play_ctl;
17108c2ecf20Sopenharmony_ci
17118c2ecf20Sopenharmony_ci	struct ba1_struct *ba1;
17128c2ecf20Sopenharmony_ci#endif
17138c2ecf20Sopenharmony_ci
17148c2ecf20Sopenharmony_ci#ifdef CONFIG_PM_SLEEP
17158c2ecf20Sopenharmony_ci	u32 *saved_regs;
17168c2ecf20Sopenharmony_ci#endif
17178c2ecf20Sopenharmony_ci};
17188c2ecf20Sopenharmony_ci
17198c2ecf20Sopenharmony_ciint snd_cs46xx_create(struct snd_card *card,
17208c2ecf20Sopenharmony_ci		      struct pci_dev *pci,
17218c2ecf20Sopenharmony_ci		      int external_amp, int thinkpad,
17228c2ecf20Sopenharmony_ci		      struct snd_cs46xx **rcodec);
17238c2ecf20Sopenharmony_ciextern const struct dev_pm_ops snd_cs46xx_pm;
17248c2ecf20Sopenharmony_ci
17258c2ecf20Sopenharmony_ciint snd_cs46xx_pcm(struct snd_cs46xx *chip, int device);
17268c2ecf20Sopenharmony_ciint snd_cs46xx_pcm_rear(struct snd_cs46xx *chip, int device);
17278c2ecf20Sopenharmony_ciint snd_cs46xx_pcm_iec958(struct snd_cs46xx *chip, int device);
17288c2ecf20Sopenharmony_ciint snd_cs46xx_pcm_center_lfe(struct snd_cs46xx *chip, int device);
17298c2ecf20Sopenharmony_ciint snd_cs46xx_mixer(struct snd_cs46xx *chip, int spdif_device);
17308c2ecf20Sopenharmony_ciint snd_cs46xx_midi(struct snd_cs46xx *chip, int device);
17318c2ecf20Sopenharmony_ciint snd_cs46xx_start_dsp(struct snd_cs46xx *chip);
17328c2ecf20Sopenharmony_ciint snd_cs46xx_gameport(struct snd_cs46xx *chip);
17338c2ecf20Sopenharmony_ci
17348c2ecf20Sopenharmony_ci#endif /* __SOUND_CS46XX_H */
1735