18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci *  Driver for the Conexant CX25821 PCIe bridge
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci *  Copyright (C) 2009 Conexant Systems Inc.
68c2ecf20Sopenharmony_ci *  Authors  <shu.lin@conexant.com>, <hiep.huynh@conexant.com>
78c2ecf20Sopenharmony_ci */
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_ci#ifndef __ATHENA_SRAM_H__
108c2ecf20Sopenharmony_ci#define __ATHENA_SRAM_H__
118c2ecf20Sopenharmony_ci
128c2ecf20Sopenharmony_ci/* #define RX_SRAM_START_SIZE        = 0;  //  Start of reserved SRAM */
138c2ecf20Sopenharmony_ci#define VID_CMDS_SIZE             80	/* Video CMDS size in bytes */
148c2ecf20Sopenharmony_ci#define AUDIO_CMDS_SIZE           80	/* AUDIO CMDS size in bytes */
158c2ecf20Sopenharmony_ci#define MBIF_CMDS_SIZE            80	/* MBIF  CMDS size in bytes */
168c2ecf20Sopenharmony_ci
178c2ecf20Sopenharmony_ci/* #define RX_SRAM_POOL_START_SIZE   = 0;  //  Start of usable RX SRAM for buffers */
188c2ecf20Sopenharmony_ci#define VID_IQ_SIZE               64	/* VID instruction queue size in bytes */
198c2ecf20Sopenharmony_ci#define MBIF_IQ_SIZE              64
208c2ecf20Sopenharmony_ci#define AUDIO_IQ_SIZE             64	/* AUD instruction queue size in bytes */
218c2ecf20Sopenharmony_ci
228c2ecf20Sopenharmony_ci#define VID_CDT_SIZE              64	/* VID cluster descriptor table size in bytes */
238c2ecf20Sopenharmony_ci#define MBIF_CDT_SIZE             64	/* MBIF/HBI cluster descriptor table size in bytes */
248c2ecf20Sopenharmony_ci#define AUDIO_CDT_SIZE            48	/* AUD cluster descriptor table size in bytes */
258c2ecf20Sopenharmony_ci
268c2ecf20Sopenharmony_ci/* #define RX_SRAM_POOL_FREE_SIZE    = 16; //  Start of available RX SRAM */
278c2ecf20Sopenharmony_ci/* #define RX_SRAM_END_SIZE          = 0;  //  End of RX SRAM */
288c2ecf20Sopenharmony_ci
298c2ecf20Sopenharmony_ci/* #define TX_SRAM_POOL_START_SIZE   = 0;  //  Start of transmit pool SRAM */
308c2ecf20Sopenharmony_ci/* #define MSI_DATA_SIZE             = 64; //  Reserved (MSI Data, RISC working stora */
318c2ecf20Sopenharmony_ci
328c2ecf20Sopenharmony_ci#define VID_CLUSTER_SIZE          1440	/* VID cluster data line */
338c2ecf20Sopenharmony_ci#define AUDIO_CLUSTER_SIZE        128	/* AUDIO cluster data line */
348c2ecf20Sopenharmony_ci#define MBIF_CLUSTER_SIZE         1440	/* MBIF/HBI cluster data line */
358c2ecf20Sopenharmony_ci
368c2ecf20Sopenharmony_ci/* #define TX_SRAM_POOL_FREE_SIZE    = 704;    //  Start of available TX SRAM */
378c2ecf20Sopenharmony_ci/* #define TX_SRAM_END_SIZE          = 0;      //  End of TX SRAM */
388c2ecf20Sopenharmony_ci
398c2ecf20Sopenharmony_ci/* Receive SRAM */
408c2ecf20Sopenharmony_ci#define RX_SRAM_START             0x10000
418c2ecf20Sopenharmony_ci#define VID_A_DOWN_CMDS           0x10000
428c2ecf20Sopenharmony_ci#define VID_B_DOWN_CMDS           0x10050
438c2ecf20Sopenharmony_ci#define VID_C_DOWN_CMDS           0x100A0
448c2ecf20Sopenharmony_ci#define VID_D_DOWN_CMDS           0x100F0
458c2ecf20Sopenharmony_ci#define VID_E_DOWN_CMDS           0x10140
468c2ecf20Sopenharmony_ci#define VID_F_DOWN_CMDS           0x10190
478c2ecf20Sopenharmony_ci#define VID_G_DOWN_CMDS           0x101E0
488c2ecf20Sopenharmony_ci#define VID_H_DOWN_CMDS           0x10230
498c2ecf20Sopenharmony_ci#define VID_A_UP_CMDS             0x10280
508c2ecf20Sopenharmony_ci#define VID_B_UP_CMDS             0x102D0
518c2ecf20Sopenharmony_ci#define VID_C_UP_CMDS             0x10320
528c2ecf20Sopenharmony_ci#define VID_D_UP_CMDS             0x10370
538c2ecf20Sopenharmony_ci#define VID_E_UP_CMDS             0x103C0
548c2ecf20Sopenharmony_ci#define VID_F_UP_CMDS             0x10410
558c2ecf20Sopenharmony_ci#define VID_I_UP_CMDS             0x10460
568c2ecf20Sopenharmony_ci#define VID_J_UP_CMDS             0x104B0
578c2ecf20Sopenharmony_ci#define AUD_A_DOWN_CMDS           0x10500
588c2ecf20Sopenharmony_ci#define AUD_B_DOWN_CMDS           0x10550
598c2ecf20Sopenharmony_ci#define AUD_C_DOWN_CMDS           0x105A0
608c2ecf20Sopenharmony_ci#define AUD_D_DOWN_CMDS           0x105F0
618c2ecf20Sopenharmony_ci#define AUD_A_UP_CMDS             0x10640
628c2ecf20Sopenharmony_ci#define AUD_B_UP_CMDS             0x10690
638c2ecf20Sopenharmony_ci#define AUD_C_UP_CMDS             0x106E0
648c2ecf20Sopenharmony_ci#define AUD_E_UP_CMDS             0x10730
658c2ecf20Sopenharmony_ci#define MBIF_A_DOWN_CMDS          0x10780
668c2ecf20Sopenharmony_ci#define MBIF_B_DOWN_CMDS          0x107D0
678c2ecf20Sopenharmony_ci#define DMA_SCRATCH_PAD           0x10820	/* Scratch pad area from 0x10820 to 0x10B40 */
688c2ecf20Sopenharmony_ci
698c2ecf20Sopenharmony_ci/* #define RX_SRAM_POOL_START        = 0x105B0; */
708c2ecf20Sopenharmony_ci
718c2ecf20Sopenharmony_ci#define VID_A_IQ                  0x11000
728c2ecf20Sopenharmony_ci#define VID_B_IQ                  0x11040
738c2ecf20Sopenharmony_ci#define VID_C_IQ                  0x11080
748c2ecf20Sopenharmony_ci#define VID_D_IQ                  0x110C0
758c2ecf20Sopenharmony_ci#define VID_E_IQ                  0x11100
768c2ecf20Sopenharmony_ci#define VID_F_IQ                  0x11140
778c2ecf20Sopenharmony_ci#define VID_G_IQ                  0x11180
788c2ecf20Sopenharmony_ci#define VID_H_IQ                  0x111C0
798c2ecf20Sopenharmony_ci#define VID_I_IQ                  0x11200
808c2ecf20Sopenharmony_ci#define VID_J_IQ                  0x11240
818c2ecf20Sopenharmony_ci#define AUD_A_IQ                  0x11280
828c2ecf20Sopenharmony_ci#define AUD_B_IQ                  0x112C0
838c2ecf20Sopenharmony_ci#define AUD_C_IQ                  0x11300
848c2ecf20Sopenharmony_ci#define AUD_D_IQ                  0x11340
858c2ecf20Sopenharmony_ci#define AUD_E_IQ                  0x11380
868c2ecf20Sopenharmony_ci#define MBIF_A_IQ                 0x11000
878c2ecf20Sopenharmony_ci#define MBIF_B_IQ                 0x110C0
888c2ecf20Sopenharmony_ci
898c2ecf20Sopenharmony_ci#define VID_A_CDT                 0x10C00
908c2ecf20Sopenharmony_ci#define VID_B_CDT                 0x10C40
918c2ecf20Sopenharmony_ci#define VID_C_CDT                 0x10C80
928c2ecf20Sopenharmony_ci#define VID_D_CDT                 0x10CC0
938c2ecf20Sopenharmony_ci#define VID_E_CDT                 0x10D00
948c2ecf20Sopenharmony_ci#define VID_F_CDT                 0x10D40
958c2ecf20Sopenharmony_ci#define VID_G_CDT                 0x10D80
968c2ecf20Sopenharmony_ci#define VID_H_CDT                 0x10DC0
978c2ecf20Sopenharmony_ci#define VID_I_CDT                 0x10E00
988c2ecf20Sopenharmony_ci#define VID_J_CDT                 0x10E40
998c2ecf20Sopenharmony_ci#define AUD_A_CDT                 0x10E80
1008c2ecf20Sopenharmony_ci#define AUD_B_CDT                 0x10EB0
1018c2ecf20Sopenharmony_ci#define AUD_C_CDT                 0x10EE0
1028c2ecf20Sopenharmony_ci#define AUD_D_CDT                 0x10F10
1038c2ecf20Sopenharmony_ci#define AUD_E_CDT                 0x10F40
1048c2ecf20Sopenharmony_ci#define MBIF_A_CDT                0x10C00
1058c2ecf20Sopenharmony_ci#define MBIF_B_CDT                0x10CC0
1068c2ecf20Sopenharmony_ci
1078c2ecf20Sopenharmony_ci/* Cluster Buffer for RX */
1088c2ecf20Sopenharmony_ci#define VID_A_UP_CLUSTER_1        0x11400
1098c2ecf20Sopenharmony_ci#define VID_A_UP_CLUSTER_2        0x119A0
1108c2ecf20Sopenharmony_ci#define VID_A_UP_CLUSTER_3        0x11F40
1118c2ecf20Sopenharmony_ci#define VID_A_UP_CLUSTER_4        0x124E0
1128c2ecf20Sopenharmony_ci
1138c2ecf20Sopenharmony_ci#define VID_B_UP_CLUSTER_1        0x12A80
1148c2ecf20Sopenharmony_ci#define VID_B_UP_CLUSTER_2        0x13020
1158c2ecf20Sopenharmony_ci#define VID_B_UP_CLUSTER_3        0x135C0
1168c2ecf20Sopenharmony_ci#define VID_B_UP_CLUSTER_4        0x13B60
1178c2ecf20Sopenharmony_ci
1188c2ecf20Sopenharmony_ci#define VID_C_UP_CLUSTER_1        0x14100
1198c2ecf20Sopenharmony_ci#define VID_C_UP_CLUSTER_2        0x146A0
1208c2ecf20Sopenharmony_ci#define VID_C_UP_CLUSTER_3        0x14C40
1218c2ecf20Sopenharmony_ci#define VID_C_UP_CLUSTER_4        0x151E0
1228c2ecf20Sopenharmony_ci
1238c2ecf20Sopenharmony_ci#define VID_D_UP_CLUSTER_1        0x15780
1248c2ecf20Sopenharmony_ci#define VID_D_UP_CLUSTER_2        0x15D20
1258c2ecf20Sopenharmony_ci#define VID_D_UP_CLUSTER_3        0x162C0
1268c2ecf20Sopenharmony_ci#define VID_D_UP_CLUSTER_4        0x16860
1278c2ecf20Sopenharmony_ci
1288c2ecf20Sopenharmony_ci#define VID_E_UP_CLUSTER_1        0x16E00
1298c2ecf20Sopenharmony_ci#define VID_E_UP_CLUSTER_2        0x173A0
1308c2ecf20Sopenharmony_ci#define VID_E_UP_CLUSTER_3        0x17940
1318c2ecf20Sopenharmony_ci#define VID_E_UP_CLUSTER_4        0x17EE0
1328c2ecf20Sopenharmony_ci
1338c2ecf20Sopenharmony_ci#define VID_F_UP_CLUSTER_1        0x18480
1348c2ecf20Sopenharmony_ci#define VID_F_UP_CLUSTER_2        0x18A20
1358c2ecf20Sopenharmony_ci#define VID_F_UP_CLUSTER_3        0x18FC0
1368c2ecf20Sopenharmony_ci#define VID_F_UP_CLUSTER_4        0x19560
1378c2ecf20Sopenharmony_ci
1388c2ecf20Sopenharmony_ci#define VID_I_UP_CLUSTER_1        0x19B00
1398c2ecf20Sopenharmony_ci#define VID_I_UP_CLUSTER_2        0x1A0A0
1408c2ecf20Sopenharmony_ci#define VID_I_UP_CLUSTER_3        0x1A640
1418c2ecf20Sopenharmony_ci#define VID_I_UP_CLUSTER_4        0x1ABE0
1428c2ecf20Sopenharmony_ci
1438c2ecf20Sopenharmony_ci#define VID_J_UP_CLUSTER_1        0x1B180
1448c2ecf20Sopenharmony_ci#define VID_J_UP_CLUSTER_2        0x1B720
1458c2ecf20Sopenharmony_ci#define VID_J_UP_CLUSTER_3        0x1BCC0
1468c2ecf20Sopenharmony_ci#define VID_J_UP_CLUSTER_4        0x1C260
1478c2ecf20Sopenharmony_ci
1488c2ecf20Sopenharmony_ci#define AUD_A_UP_CLUSTER_1        0x1C800
1498c2ecf20Sopenharmony_ci#define AUD_A_UP_CLUSTER_2        0x1C880
1508c2ecf20Sopenharmony_ci#define AUD_A_UP_CLUSTER_3        0x1C900
1518c2ecf20Sopenharmony_ci
1528c2ecf20Sopenharmony_ci#define AUD_B_UP_CLUSTER_1        0x1C980
1538c2ecf20Sopenharmony_ci#define AUD_B_UP_CLUSTER_2        0x1CA00
1548c2ecf20Sopenharmony_ci#define AUD_B_UP_CLUSTER_3        0x1CA80
1558c2ecf20Sopenharmony_ci
1568c2ecf20Sopenharmony_ci#define AUD_C_UP_CLUSTER_1        0x1CB00
1578c2ecf20Sopenharmony_ci#define AUD_C_UP_CLUSTER_2        0x1CB80
1588c2ecf20Sopenharmony_ci#define AUD_C_UP_CLUSTER_3        0x1CC00
1598c2ecf20Sopenharmony_ci
1608c2ecf20Sopenharmony_ci#define AUD_E_UP_CLUSTER_1        0x1CC80
1618c2ecf20Sopenharmony_ci#define AUD_E_UP_CLUSTER_2        0x1CD00
1628c2ecf20Sopenharmony_ci#define AUD_E_UP_CLUSTER_3        0x1CD80
1638c2ecf20Sopenharmony_ci
1648c2ecf20Sopenharmony_ci#define RX_SRAM_POOL_FREE         0x1CE00
1658c2ecf20Sopenharmony_ci#define RX_SRAM_END               0x1D000
1668c2ecf20Sopenharmony_ci
1678c2ecf20Sopenharmony_ci/* Free Receive SRAM    144 Bytes */
1688c2ecf20Sopenharmony_ci
1698c2ecf20Sopenharmony_ci/* Transmit SRAM */
1708c2ecf20Sopenharmony_ci#define TX_SRAM_POOL_START        0x00000
1718c2ecf20Sopenharmony_ci
1728c2ecf20Sopenharmony_ci#define VID_A_DOWN_CLUSTER_1      0x00040
1738c2ecf20Sopenharmony_ci#define VID_A_DOWN_CLUSTER_2      0x005E0
1748c2ecf20Sopenharmony_ci#define VID_A_DOWN_CLUSTER_3      0x00B80
1758c2ecf20Sopenharmony_ci#define VID_A_DOWN_CLUSTER_4      0x01120
1768c2ecf20Sopenharmony_ci
1778c2ecf20Sopenharmony_ci#define VID_B_DOWN_CLUSTER_1      0x016C0
1788c2ecf20Sopenharmony_ci#define VID_B_DOWN_CLUSTER_2      0x01C60
1798c2ecf20Sopenharmony_ci#define VID_B_DOWN_CLUSTER_3      0x02200
1808c2ecf20Sopenharmony_ci#define VID_B_DOWN_CLUSTER_4      0x027A0
1818c2ecf20Sopenharmony_ci
1828c2ecf20Sopenharmony_ci#define VID_C_DOWN_CLUSTER_1      0x02D40
1838c2ecf20Sopenharmony_ci#define VID_C_DOWN_CLUSTER_2      0x032E0
1848c2ecf20Sopenharmony_ci#define VID_C_DOWN_CLUSTER_3      0x03880
1858c2ecf20Sopenharmony_ci#define VID_C_DOWN_CLUSTER_4      0x03E20
1868c2ecf20Sopenharmony_ci
1878c2ecf20Sopenharmony_ci#define VID_D_DOWN_CLUSTER_1      0x043C0
1888c2ecf20Sopenharmony_ci#define VID_D_DOWN_CLUSTER_2      0x04960
1898c2ecf20Sopenharmony_ci#define VID_D_DOWN_CLUSTER_3      0x04F00
1908c2ecf20Sopenharmony_ci#define VID_D_DOWN_CLUSTER_4      0x054A0
1918c2ecf20Sopenharmony_ci
1928c2ecf20Sopenharmony_ci#define VID_E_DOWN_CLUSTER_1      0x05a40
1938c2ecf20Sopenharmony_ci#define VID_E_DOWN_CLUSTER_2      0x05FE0
1948c2ecf20Sopenharmony_ci#define VID_E_DOWN_CLUSTER_3      0x06580
1958c2ecf20Sopenharmony_ci#define VID_E_DOWN_CLUSTER_4      0x06B20
1968c2ecf20Sopenharmony_ci
1978c2ecf20Sopenharmony_ci#define VID_F_DOWN_CLUSTER_1      0x070C0
1988c2ecf20Sopenharmony_ci#define VID_F_DOWN_CLUSTER_2      0x07660
1998c2ecf20Sopenharmony_ci#define VID_F_DOWN_CLUSTER_3      0x07C00
2008c2ecf20Sopenharmony_ci#define VID_F_DOWN_CLUSTER_4      0x081A0
2018c2ecf20Sopenharmony_ci
2028c2ecf20Sopenharmony_ci#define VID_G_DOWN_CLUSTER_1      0x08740
2038c2ecf20Sopenharmony_ci#define VID_G_DOWN_CLUSTER_2      0x08CE0
2048c2ecf20Sopenharmony_ci#define VID_G_DOWN_CLUSTER_3      0x09280
2058c2ecf20Sopenharmony_ci#define VID_G_DOWN_CLUSTER_4      0x09820
2068c2ecf20Sopenharmony_ci
2078c2ecf20Sopenharmony_ci#define VID_H_DOWN_CLUSTER_1      0x09DC0
2088c2ecf20Sopenharmony_ci#define VID_H_DOWN_CLUSTER_2      0x0A360
2098c2ecf20Sopenharmony_ci#define VID_H_DOWN_CLUSTER_3      0x0A900
2108c2ecf20Sopenharmony_ci#define VID_H_DOWN_CLUSTER_4      0x0AEA0
2118c2ecf20Sopenharmony_ci
2128c2ecf20Sopenharmony_ci#define AUD_A_DOWN_CLUSTER_1      0x0B500
2138c2ecf20Sopenharmony_ci#define AUD_A_DOWN_CLUSTER_2      0x0B580
2148c2ecf20Sopenharmony_ci#define AUD_A_DOWN_CLUSTER_3      0x0B600
2158c2ecf20Sopenharmony_ci
2168c2ecf20Sopenharmony_ci#define AUD_B_DOWN_CLUSTER_1      0x0B680
2178c2ecf20Sopenharmony_ci#define AUD_B_DOWN_CLUSTER_2      0x0B700
2188c2ecf20Sopenharmony_ci#define AUD_B_DOWN_CLUSTER_3      0x0B780
2198c2ecf20Sopenharmony_ci
2208c2ecf20Sopenharmony_ci#define AUD_C_DOWN_CLUSTER_1      0x0B800
2218c2ecf20Sopenharmony_ci#define AUD_C_DOWN_CLUSTER_2      0x0B880
2228c2ecf20Sopenharmony_ci#define AUD_C_DOWN_CLUSTER_3      0x0B900
2238c2ecf20Sopenharmony_ci
2248c2ecf20Sopenharmony_ci#define AUD_D_DOWN_CLUSTER_1      0x0B980
2258c2ecf20Sopenharmony_ci#define AUD_D_DOWN_CLUSTER_2      0x0BA00
2268c2ecf20Sopenharmony_ci#define AUD_D_DOWN_CLUSTER_3      0x0BA80
2278c2ecf20Sopenharmony_ci
2288c2ecf20Sopenharmony_ci#define TX_SRAM_POOL_FREE         0x0BB00
2298c2ecf20Sopenharmony_ci#define TX_SRAM_END               0x0C000
2308c2ecf20Sopenharmony_ci
2318c2ecf20Sopenharmony_ci#define BYTES_TO_DWORDS(bcount) ((bcount) >> 2)
2328c2ecf20Sopenharmony_ci#define BYTES_TO_QWORDS(bcount) ((bcount) >> 3)
2338c2ecf20Sopenharmony_ci#define BYTES_TO_OWORDS(bcount) ((bcount) >> 4)
2348c2ecf20Sopenharmony_ci
2358c2ecf20Sopenharmony_ci#define VID_IQ_SIZE_DW             BYTES_TO_DWORDS(VID_IQ_SIZE)
2368c2ecf20Sopenharmony_ci#define VID_CDT_SIZE_QW            BYTES_TO_QWORDS(VID_CDT_SIZE)
2378c2ecf20Sopenharmony_ci#define VID_CLUSTER_SIZE_OW        BYTES_TO_OWORDS(VID_CLUSTER_SIZE)
2388c2ecf20Sopenharmony_ci
2398c2ecf20Sopenharmony_ci#define AUDIO_IQ_SIZE_DW           BYTES_TO_DWORDS(AUDIO_IQ_SIZE)
2408c2ecf20Sopenharmony_ci#define AUDIO_CDT_SIZE_QW          BYTES_TO_QWORDS(AUDIO_CDT_SIZE)
2418c2ecf20Sopenharmony_ci#define AUDIO_CLUSTER_SIZE_QW      BYTES_TO_QWORDS(AUDIO_CLUSTER_SIZE)
2428c2ecf20Sopenharmony_ci
2438c2ecf20Sopenharmony_ci#define MBIF_IQ_SIZE_DW            BYTES_TO_DWORDS(MBIF_IQ_SIZE)
2448c2ecf20Sopenharmony_ci#define MBIF_CDT_SIZE_QW           BYTES_TO_QWORDS(MBIF_CDT_SIZE)
2458c2ecf20Sopenharmony_ci#define MBIF_CLUSTER_SIZE_OW       BYTES_TO_OWORDS(MBIF_CLUSTER_SIZE)
2468c2ecf20Sopenharmony_ci
2478c2ecf20Sopenharmony_ci#endif
248