162306a36Sopenharmony_ci/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) */
262306a36Sopenharmony_ci/*
362306a36Sopenharmony_ci * This file is provided under a dual BSD/GPLv2 license. When using or
462306a36Sopenharmony_ci * redistributing this file, you may do so under either license.
562306a36Sopenharmony_ci *
662306a36Sopenharmony_ci * Copyright(c) 2021 Advanced Micro Devices, Inc. All rights reserved.
762306a36Sopenharmony_ci *
862306a36Sopenharmony_ci * Author: Ajit Kumar Pandey <AjitKumar.Pandey@amd.com>
962306a36Sopenharmony_ci */
1062306a36Sopenharmony_ci
1162306a36Sopenharmony_ci#ifndef _ACP_IP_OFFSET_HEADER
1262306a36Sopenharmony_ci#define _ACP_IP_OFFSET_HEADER
1362306a36Sopenharmony_ci
1462306a36Sopenharmony_ci#define ACPAXI2AXI_ATU_CTRL                           0xC40
1562306a36Sopenharmony_ci#define ACPAXI2AXI_ATU_PAGE_SIZE_GRP_5                0xC20
1662306a36Sopenharmony_ci#define ACPAXI2AXI_ATU_BASE_ADDR_GRP_5                0xC24
1762306a36Sopenharmony_ci
1862306a36Sopenharmony_ci#define ACP_PGFSM_CONTROL			0x141C
1962306a36Sopenharmony_ci#define ACP_PGFSM_STATUS                        0x1420
2062306a36Sopenharmony_ci#define ACP_SOFT_RESET                          0x1000
2162306a36Sopenharmony_ci#define ACP_CONTROL                             0x1004
2262306a36Sopenharmony_ci
2362306a36Sopenharmony_ci#define ACP_EXTERNAL_INTR_REG_ADDR(adata, offset, ctrl) \
2462306a36Sopenharmony_ci	(adata->acp_base + adata->rsrc->irq_reg_offset + offset + (ctrl * 0x04))
2562306a36Sopenharmony_ci
2662306a36Sopenharmony_ci#define ACP_EXTERNAL_INTR_ENB(adata) ACP_EXTERNAL_INTR_REG_ADDR(adata, 0x0, 0x0)
2762306a36Sopenharmony_ci#define ACP_EXTERNAL_INTR_CNTL(adata, ctrl) ACP_EXTERNAL_INTR_REG_ADDR(adata, 0x4, ctrl)
2862306a36Sopenharmony_ci#define ACP_EXTERNAL_INTR_STAT(adata, ctrl) ACP_EXTERNAL_INTR_REG_ADDR(adata, \
2962306a36Sopenharmony_ci	(0x4 + (adata->rsrc->no_of_ctrls * 0x04)), ctrl)
3062306a36Sopenharmony_ci
3162306a36Sopenharmony_ci/* Registers from ACP_AUDIO_BUFFERS block */
3262306a36Sopenharmony_ci
3362306a36Sopenharmony_ci#define ACP_I2S_RX_RINGBUFADDR                        0x2000
3462306a36Sopenharmony_ci#define ACP_I2S_RX_RINGBUFSIZE                        0x2004
3562306a36Sopenharmony_ci#define ACP_I2S_RX_LINKPOSITIONCNTR                   0x2008
3662306a36Sopenharmony_ci#define ACP_I2S_RX_FIFOADDR                           0x200C
3762306a36Sopenharmony_ci#define ACP_I2S_RX_FIFOSIZE                           0x2010
3862306a36Sopenharmony_ci#define ACP_I2S_RX_DMA_SIZE                           0x2014
3962306a36Sopenharmony_ci#define ACP_I2S_RX_LINEARPOSITIONCNTR_HIGH            0x2018
4062306a36Sopenharmony_ci#define ACP_I2S_RX_LINEARPOSITIONCNTR_LOW             0x201C
4162306a36Sopenharmony_ci#define ACP_I2S_RX_INTR_WATERMARK_SIZE                0x2020
4262306a36Sopenharmony_ci#define ACP_I2S_TX_RINGBUFADDR                        0x2024
4362306a36Sopenharmony_ci#define ACP_I2S_TX_RINGBUFSIZE                        0x2028
4462306a36Sopenharmony_ci#define ACP_I2S_TX_LINKPOSITIONCNTR                   0x202C
4562306a36Sopenharmony_ci#define ACP_I2S_TX_FIFOADDR                           0x2030
4662306a36Sopenharmony_ci#define ACP_I2S_TX_FIFOSIZE                           0x2034
4762306a36Sopenharmony_ci#define ACP_I2S_TX_DMA_SIZE                           0x2038
4862306a36Sopenharmony_ci#define ACP_I2S_TX_LINEARPOSITIONCNTR_HIGH            0x203C
4962306a36Sopenharmony_ci#define ACP_I2S_TX_LINEARPOSITIONCNTR_LOW             0x2040
5062306a36Sopenharmony_ci#define ACP_I2S_TX_INTR_WATERMARK_SIZE                0x2044
5162306a36Sopenharmony_ci#define ACP_BT_RX_RINGBUFADDR                         0x2048
5262306a36Sopenharmony_ci#define ACP_BT_RX_RINGBUFSIZE                         0x204C
5362306a36Sopenharmony_ci#define ACP_BT_RX_LINKPOSITIONCNTR                    0x2050
5462306a36Sopenharmony_ci#define ACP_BT_RX_FIFOADDR                            0x2054
5562306a36Sopenharmony_ci#define ACP_BT_RX_FIFOSIZE                            0x2058
5662306a36Sopenharmony_ci#define ACP_BT_RX_DMA_SIZE                            0x205C
5762306a36Sopenharmony_ci#define ACP_BT_RX_LINEARPOSITIONCNTR_HIGH             0x2060
5862306a36Sopenharmony_ci#define ACP_BT_RX_LINEARPOSITIONCNTR_LOW              0x2064
5962306a36Sopenharmony_ci#define ACP_BT_RX_INTR_WATERMARK_SIZE                 0x2068
6062306a36Sopenharmony_ci#define ACP_BT_TX_RINGBUFADDR                         0x206C
6162306a36Sopenharmony_ci#define ACP_BT_TX_RINGBUFSIZE                         0x2070
6262306a36Sopenharmony_ci#define ACP_BT_TX_LINKPOSITIONCNTR                    0x2074
6362306a36Sopenharmony_ci#define ACP_BT_TX_FIFOADDR                            0x2078
6462306a36Sopenharmony_ci#define ACP_BT_TX_FIFOSIZE                            0x207C
6562306a36Sopenharmony_ci#define ACP_BT_TX_DMA_SIZE                            0x2080
6662306a36Sopenharmony_ci#define ACP_BT_TX_LINEARPOSITIONCNTR_HIGH             0x2084
6762306a36Sopenharmony_ci#define ACP_BT_TX_LINEARPOSITIONCNTR_LOW              0x2088
6862306a36Sopenharmony_ci#define ACP_BT_TX_INTR_WATERMARK_SIZE                 0x208C
6962306a36Sopenharmony_ci#define ACP_HS_RX_RINGBUFADDR			      0x3A90
7062306a36Sopenharmony_ci#define ACP_HS_RX_RINGBUFSIZE			      0x3A94
7162306a36Sopenharmony_ci#define ACP_HS_RX_LINKPOSITIONCNTR		      0x3A98
7262306a36Sopenharmony_ci#define ACP_HS_RX_FIFOADDR			      0x3A9C
7362306a36Sopenharmony_ci#define ACP_HS_RX_FIFOSIZE			      0x3AA0
7462306a36Sopenharmony_ci#define ACP_HS_RX_DMA_SIZE			      0x3AA4
7562306a36Sopenharmony_ci#define ACP_HS_RX_LINEARPOSITIONCNTR_HIGH	      0x3AA8
7662306a36Sopenharmony_ci#define ACP_HS_RX_LINEARPOSITIONCNTR_LOW	      0x3AAC
7762306a36Sopenharmony_ci#define ACP_HS_RX_INTR_WATERMARK_SIZE		      0x3AB0
7862306a36Sopenharmony_ci#define ACP_HS_TX_RINGBUFADDR			      0x3AB4
7962306a36Sopenharmony_ci#define ACP_HS_TX_RINGBUFSIZE			      0x3AB8
8062306a36Sopenharmony_ci#define ACP_HS_TX_LINKPOSITIONCNTR		      0x3ABC
8162306a36Sopenharmony_ci#define ACP_HS_TX_FIFOADDR			      0x3AC0
8262306a36Sopenharmony_ci#define ACP_HS_TX_FIFOSIZE			      0x3AC4
8362306a36Sopenharmony_ci#define ACP_HS_TX_DMA_SIZE			      0x3AC8
8462306a36Sopenharmony_ci#define ACP_HS_TX_LINEARPOSITIONCNTR_HIGH	      0x3ACC
8562306a36Sopenharmony_ci#define ACP_HS_TX_LINEARPOSITIONCNTR_LOW	      0x3AD0
8662306a36Sopenharmony_ci#define ACP_HS_TX_INTR_WATERMARK_SIZE		      0x3AD4
8762306a36Sopenharmony_ci
8862306a36Sopenharmony_ci#define ACP_I2STDM_IER                                0x2400
8962306a36Sopenharmony_ci#define ACP_I2STDM_IRER                               0x2404
9062306a36Sopenharmony_ci#define ACP_I2STDM_RXFRMT                             0x2408
9162306a36Sopenharmony_ci#define ACP_I2STDM_ITER                               0x240C
9262306a36Sopenharmony_ci#define ACP_I2STDM_TXFRMT                             0x2410
9362306a36Sopenharmony_ci
9462306a36Sopenharmony_ci/* Registers from ACP_BT_TDM block */
9562306a36Sopenharmony_ci
9662306a36Sopenharmony_ci#define ACP_BTTDM_IER                                 0x2800
9762306a36Sopenharmony_ci#define ACP_BTTDM_IRER                                0x2804
9862306a36Sopenharmony_ci#define ACP_BTTDM_RXFRMT                              0x2808
9962306a36Sopenharmony_ci#define ACP_BTTDM_ITER                                0x280C
10062306a36Sopenharmony_ci#define ACP_BTTDM_TXFRMT                              0x2810
10162306a36Sopenharmony_ci
10262306a36Sopenharmony_ci/* Registers from ACP_HS_TDM block */
10362306a36Sopenharmony_ci#define ACP_HSTDM_IER                                 0x2814
10462306a36Sopenharmony_ci#define ACP_HSTDM_IRER                                0x2818
10562306a36Sopenharmony_ci#define ACP_HSTDM_RXFRMT                              0x281C
10662306a36Sopenharmony_ci#define ACP_HSTDM_ITER                                0x2820
10762306a36Sopenharmony_ci#define ACP_HSTDM_TXFRMT                              0x2824
10862306a36Sopenharmony_ci
10962306a36Sopenharmony_ci/* Registers from ACP_WOV_PDM block */
11062306a36Sopenharmony_ci
11162306a36Sopenharmony_ci#define ACP_WOV_PDM_ENABLE                            0x2C04
11262306a36Sopenharmony_ci#define ACP_WOV_PDM_DMA_ENABLE                        0x2C08
11362306a36Sopenharmony_ci#define ACP_WOV_RX_RINGBUFADDR                        0x2C0C
11462306a36Sopenharmony_ci#define ACP_WOV_RX_RINGBUFSIZE                        0x2C10
11562306a36Sopenharmony_ci#define ACP_WOV_RX_LINKPOSITIONCNTR                   0x2C14
11662306a36Sopenharmony_ci#define ACP_WOV_RX_LINEARPOSITIONCNTR_HIGH            0x2C18
11762306a36Sopenharmony_ci#define ACP_WOV_RX_LINEARPOSITIONCNTR_LOW             0x2C1C
11862306a36Sopenharmony_ci#define ACP_WOV_RX_INTR_WATERMARK_SIZE                0x2C20
11962306a36Sopenharmony_ci#define ACP_WOV_PDM_FIFO_FLUSH                        0x2C24
12062306a36Sopenharmony_ci#define ACP_WOV_PDM_NO_OF_CHANNELS                    0x2C28
12162306a36Sopenharmony_ci#define ACP_WOV_PDM_DECIMATION_FACTOR                 0x2C2C
12262306a36Sopenharmony_ci#define ACP_WOV_PDM_VAD_CTRL                          0x2C30
12362306a36Sopenharmony_ci#define ACP_WOV_BUFFER_STATUS                         0x2C58
12462306a36Sopenharmony_ci#define ACP_WOV_MISC_CTRL                             0x2C5C
12562306a36Sopenharmony_ci#define ACP_WOV_CLK_CTRL                              0x2C60
12662306a36Sopenharmony_ci#define ACP_PDM_VAD_DYNAMIC_CLK_GATING_EN             0x2C64
12762306a36Sopenharmony_ci#define ACP_WOV_ERROR_STATUS_REGISTER                 0x2C68
12862306a36Sopenharmony_ci
12962306a36Sopenharmony_ci#define ACP_I2STDM0_MSTRCLKGEN			      0x2414
13062306a36Sopenharmony_ci#define ACP_I2STDM1_MSTRCLKGEN			      0x2418
13162306a36Sopenharmony_ci#define ACP_I2STDM2_MSTRCLKGEN			      0x241C
13262306a36Sopenharmony_ci#endif
133