162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */ 262306a36Sopenharmony_ci/* 362306a36Sopenharmony_ci * Driver for the Conexant CX25821 PCIe bridge 462306a36Sopenharmony_ci * 562306a36Sopenharmony_ci * Copyright (C) 2009 Conexant Systems Inc. 662306a36Sopenharmony_ci * Authors <shu.lin@conexant.com>, <hiep.huynh@conexant.com> 762306a36Sopenharmony_ci */ 862306a36Sopenharmony_ci 962306a36Sopenharmony_ci#ifndef __ATHENA_SRAM_H__ 1062306a36Sopenharmony_ci#define __ATHENA_SRAM_H__ 1162306a36Sopenharmony_ci 1262306a36Sopenharmony_ci/* #define RX_SRAM_START_SIZE = 0; // Start of reserved SRAM */ 1362306a36Sopenharmony_ci#define VID_CMDS_SIZE 80 /* Video CMDS size in bytes */ 1462306a36Sopenharmony_ci#define AUDIO_CMDS_SIZE 80 /* AUDIO CMDS size in bytes */ 1562306a36Sopenharmony_ci#define MBIF_CMDS_SIZE 80 /* MBIF CMDS size in bytes */ 1662306a36Sopenharmony_ci 1762306a36Sopenharmony_ci/* #define RX_SRAM_POOL_START_SIZE = 0; // Start of usable RX SRAM for buffers */ 1862306a36Sopenharmony_ci#define VID_IQ_SIZE 64 /* VID instruction queue size in bytes */ 1962306a36Sopenharmony_ci#define MBIF_IQ_SIZE 64 2062306a36Sopenharmony_ci#define AUDIO_IQ_SIZE 64 /* AUD instruction queue size in bytes */ 2162306a36Sopenharmony_ci 2262306a36Sopenharmony_ci#define VID_CDT_SIZE 64 /* VID cluster descriptor table size in bytes */ 2362306a36Sopenharmony_ci#define MBIF_CDT_SIZE 64 /* MBIF/HBI cluster descriptor table size in bytes */ 2462306a36Sopenharmony_ci#define AUDIO_CDT_SIZE 48 /* AUD cluster descriptor table size in bytes */ 2562306a36Sopenharmony_ci 2662306a36Sopenharmony_ci/* #define RX_SRAM_POOL_FREE_SIZE = 16; // Start of available RX SRAM */ 2762306a36Sopenharmony_ci/* #define RX_SRAM_END_SIZE = 0; // End of RX SRAM */ 2862306a36Sopenharmony_ci 2962306a36Sopenharmony_ci/* #define TX_SRAM_POOL_START_SIZE = 0; // Start of transmit pool SRAM */ 3062306a36Sopenharmony_ci/* #define MSI_DATA_SIZE = 64; // Reserved (MSI Data, RISC working stora */ 3162306a36Sopenharmony_ci 3262306a36Sopenharmony_ci#define VID_CLUSTER_SIZE 1440 /* VID cluster data line */ 3362306a36Sopenharmony_ci#define AUDIO_CLUSTER_SIZE 128 /* AUDIO cluster data line */ 3462306a36Sopenharmony_ci#define MBIF_CLUSTER_SIZE 1440 /* MBIF/HBI cluster data line */ 3562306a36Sopenharmony_ci 3662306a36Sopenharmony_ci/* #define TX_SRAM_POOL_FREE_SIZE = 704; // Start of available TX SRAM */ 3762306a36Sopenharmony_ci/* #define TX_SRAM_END_SIZE = 0; // End of TX SRAM */ 3862306a36Sopenharmony_ci 3962306a36Sopenharmony_ci/* Receive SRAM */ 4062306a36Sopenharmony_ci#define RX_SRAM_START 0x10000 4162306a36Sopenharmony_ci#define VID_A_DOWN_CMDS 0x10000 4262306a36Sopenharmony_ci#define VID_B_DOWN_CMDS 0x10050 4362306a36Sopenharmony_ci#define VID_C_DOWN_CMDS 0x100A0 4462306a36Sopenharmony_ci#define VID_D_DOWN_CMDS 0x100F0 4562306a36Sopenharmony_ci#define VID_E_DOWN_CMDS 0x10140 4662306a36Sopenharmony_ci#define VID_F_DOWN_CMDS 0x10190 4762306a36Sopenharmony_ci#define VID_G_DOWN_CMDS 0x101E0 4862306a36Sopenharmony_ci#define VID_H_DOWN_CMDS 0x10230 4962306a36Sopenharmony_ci#define VID_A_UP_CMDS 0x10280 5062306a36Sopenharmony_ci#define VID_B_UP_CMDS 0x102D0 5162306a36Sopenharmony_ci#define VID_C_UP_CMDS 0x10320 5262306a36Sopenharmony_ci#define VID_D_UP_CMDS 0x10370 5362306a36Sopenharmony_ci#define VID_E_UP_CMDS 0x103C0 5462306a36Sopenharmony_ci#define VID_F_UP_CMDS 0x10410 5562306a36Sopenharmony_ci#define VID_I_UP_CMDS 0x10460 5662306a36Sopenharmony_ci#define VID_J_UP_CMDS 0x104B0 5762306a36Sopenharmony_ci#define AUD_A_DOWN_CMDS 0x10500 5862306a36Sopenharmony_ci#define AUD_B_DOWN_CMDS 0x10550 5962306a36Sopenharmony_ci#define AUD_C_DOWN_CMDS 0x105A0 6062306a36Sopenharmony_ci#define AUD_D_DOWN_CMDS 0x105F0 6162306a36Sopenharmony_ci#define AUD_A_UP_CMDS 0x10640 6262306a36Sopenharmony_ci#define AUD_B_UP_CMDS 0x10690 6362306a36Sopenharmony_ci#define AUD_C_UP_CMDS 0x106E0 6462306a36Sopenharmony_ci#define AUD_E_UP_CMDS 0x10730 6562306a36Sopenharmony_ci#define MBIF_A_DOWN_CMDS 0x10780 6662306a36Sopenharmony_ci#define MBIF_B_DOWN_CMDS 0x107D0 6762306a36Sopenharmony_ci#define DMA_SCRATCH_PAD 0x10820 /* Scratch pad area from 0x10820 to 0x10B40 */ 6862306a36Sopenharmony_ci 6962306a36Sopenharmony_ci/* #define RX_SRAM_POOL_START = 0x105B0; */ 7062306a36Sopenharmony_ci 7162306a36Sopenharmony_ci#define VID_A_IQ 0x11000 7262306a36Sopenharmony_ci#define VID_B_IQ 0x11040 7362306a36Sopenharmony_ci#define VID_C_IQ 0x11080 7462306a36Sopenharmony_ci#define VID_D_IQ 0x110C0 7562306a36Sopenharmony_ci#define VID_E_IQ 0x11100 7662306a36Sopenharmony_ci#define VID_F_IQ 0x11140 7762306a36Sopenharmony_ci#define VID_G_IQ 0x11180 7862306a36Sopenharmony_ci#define VID_H_IQ 0x111C0 7962306a36Sopenharmony_ci#define VID_I_IQ 0x11200 8062306a36Sopenharmony_ci#define VID_J_IQ 0x11240 8162306a36Sopenharmony_ci#define AUD_A_IQ 0x11280 8262306a36Sopenharmony_ci#define AUD_B_IQ 0x112C0 8362306a36Sopenharmony_ci#define AUD_C_IQ 0x11300 8462306a36Sopenharmony_ci#define AUD_D_IQ 0x11340 8562306a36Sopenharmony_ci#define AUD_E_IQ 0x11380 8662306a36Sopenharmony_ci#define MBIF_A_IQ 0x11000 8762306a36Sopenharmony_ci#define MBIF_B_IQ 0x110C0 8862306a36Sopenharmony_ci 8962306a36Sopenharmony_ci#define VID_A_CDT 0x10C00 9062306a36Sopenharmony_ci#define VID_B_CDT 0x10C40 9162306a36Sopenharmony_ci#define VID_C_CDT 0x10C80 9262306a36Sopenharmony_ci#define VID_D_CDT 0x10CC0 9362306a36Sopenharmony_ci#define VID_E_CDT 0x10D00 9462306a36Sopenharmony_ci#define VID_F_CDT 0x10D40 9562306a36Sopenharmony_ci#define VID_G_CDT 0x10D80 9662306a36Sopenharmony_ci#define VID_H_CDT 0x10DC0 9762306a36Sopenharmony_ci#define VID_I_CDT 0x10E00 9862306a36Sopenharmony_ci#define VID_J_CDT 0x10E40 9962306a36Sopenharmony_ci#define AUD_A_CDT 0x10E80 10062306a36Sopenharmony_ci#define AUD_B_CDT 0x10EB0 10162306a36Sopenharmony_ci#define AUD_C_CDT 0x10EE0 10262306a36Sopenharmony_ci#define AUD_D_CDT 0x10F10 10362306a36Sopenharmony_ci#define AUD_E_CDT 0x10F40 10462306a36Sopenharmony_ci#define MBIF_A_CDT 0x10C00 10562306a36Sopenharmony_ci#define MBIF_B_CDT 0x10CC0 10662306a36Sopenharmony_ci 10762306a36Sopenharmony_ci/* Cluster Buffer for RX */ 10862306a36Sopenharmony_ci#define VID_A_UP_CLUSTER_1 0x11400 10962306a36Sopenharmony_ci#define VID_A_UP_CLUSTER_2 0x119A0 11062306a36Sopenharmony_ci#define VID_A_UP_CLUSTER_3 0x11F40 11162306a36Sopenharmony_ci#define VID_A_UP_CLUSTER_4 0x124E0 11262306a36Sopenharmony_ci 11362306a36Sopenharmony_ci#define VID_B_UP_CLUSTER_1 0x12A80 11462306a36Sopenharmony_ci#define VID_B_UP_CLUSTER_2 0x13020 11562306a36Sopenharmony_ci#define VID_B_UP_CLUSTER_3 0x135C0 11662306a36Sopenharmony_ci#define VID_B_UP_CLUSTER_4 0x13B60 11762306a36Sopenharmony_ci 11862306a36Sopenharmony_ci#define VID_C_UP_CLUSTER_1 0x14100 11962306a36Sopenharmony_ci#define VID_C_UP_CLUSTER_2 0x146A0 12062306a36Sopenharmony_ci#define VID_C_UP_CLUSTER_3 0x14C40 12162306a36Sopenharmony_ci#define VID_C_UP_CLUSTER_4 0x151E0 12262306a36Sopenharmony_ci 12362306a36Sopenharmony_ci#define VID_D_UP_CLUSTER_1 0x15780 12462306a36Sopenharmony_ci#define VID_D_UP_CLUSTER_2 0x15D20 12562306a36Sopenharmony_ci#define VID_D_UP_CLUSTER_3 0x162C0 12662306a36Sopenharmony_ci#define VID_D_UP_CLUSTER_4 0x16860 12762306a36Sopenharmony_ci 12862306a36Sopenharmony_ci#define VID_E_UP_CLUSTER_1 0x16E00 12962306a36Sopenharmony_ci#define VID_E_UP_CLUSTER_2 0x173A0 13062306a36Sopenharmony_ci#define VID_E_UP_CLUSTER_3 0x17940 13162306a36Sopenharmony_ci#define VID_E_UP_CLUSTER_4 0x17EE0 13262306a36Sopenharmony_ci 13362306a36Sopenharmony_ci#define VID_F_UP_CLUSTER_1 0x18480 13462306a36Sopenharmony_ci#define VID_F_UP_CLUSTER_2 0x18A20 13562306a36Sopenharmony_ci#define VID_F_UP_CLUSTER_3 0x18FC0 13662306a36Sopenharmony_ci#define VID_F_UP_CLUSTER_4 0x19560 13762306a36Sopenharmony_ci 13862306a36Sopenharmony_ci#define VID_I_UP_CLUSTER_1 0x19B00 13962306a36Sopenharmony_ci#define VID_I_UP_CLUSTER_2 0x1A0A0 14062306a36Sopenharmony_ci#define VID_I_UP_CLUSTER_3 0x1A640 14162306a36Sopenharmony_ci#define VID_I_UP_CLUSTER_4 0x1ABE0 14262306a36Sopenharmony_ci 14362306a36Sopenharmony_ci#define VID_J_UP_CLUSTER_1 0x1B180 14462306a36Sopenharmony_ci#define VID_J_UP_CLUSTER_2 0x1B720 14562306a36Sopenharmony_ci#define VID_J_UP_CLUSTER_3 0x1BCC0 14662306a36Sopenharmony_ci#define VID_J_UP_CLUSTER_4 0x1C260 14762306a36Sopenharmony_ci 14862306a36Sopenharmony_ci#define AUD_A_UP_CLUSTER_1 0x1C800 14962306a36Sopenharmony_ci#define AUD_A_UP_CLUSTER_2 0x1C880 15062306a36Sopenharmony_ci#define AUD_A_UP_CLUSTER_3 0x1C900 15162306a36Sopenharmony_ci 15262306a36Sopenharmony_ci#define AUD_B_UP_CLUSTER_1 0x1C980 15362306a36Sopenharmony_ci#define AUD_B_UP_CLUSTER_2 0x1CA00 15462306a36Sopenharmony_ci#define AUD_B_UP_CLUSTER_3 0x1CA80 15562306a36Sopenharmony_ci 15662306a36Sopenharmony_ci#define AUD_C_UP_CLUSTER_1 0x1CB00 15762306a36Sopenharmony_ci#define AUD_C_UP_CLUSTER_2 0x1CB80 15862306a36Sopenharmony_ci#define AUD_C_UP_CLUSTER_3 0x1CC00 15962306a36Sopenharmony_ci 16062306a36Sopenharmony_ci#define AUD_E_UP_CLUSTER_1 0x1CC80 16162306a36Sopenharmony_ci#define AUD_E_UP_CLUSTER_2 0x1CD00 16262306a36Sopenharmony_ci#define AUD_E_UP_CLUSTER_3 0x1CD80 16362306a36Sopenharmony_ci 16462306a36Sopenharmony_ci#define RX_SRAM_POOL_FREE 0x1CE00 16562306a36Sopenharmony_ci#define RX_SRAM_END 0x1D000 16662306a36Sopenharmony_ci 16762306a36Sopenharmony_ci/* Free Receive SRAM 144 Bytes */ 16862306a36Sopenharmony_ci 16962306a36Sopenharmony_ci/* Transmit SRAM */ 17062306a36Sopenharmony_ci#define TX_SRAM_POOL_START 0x00000 17162306a36Sopenharmony_ci 17262306a36Sopenharmony_ci#define VID_A_DOWN_CLUSTER_1 0x00040 17362306a36Sopenharmony_ci#define VID_A_DOWN_CLUSTER_2 0x005E0 17462306a36Sopenharmony_ci#define VID_A_DOWN_CLUSTER_3 0x00B80 17562306a36Sopenharmony_ci#define VID_A_DOWN_CLUSTER_4 0x01120 17662306a36Sopenharmony_ci 17762306a36Sopenharmony_ci#define VID_B_DOWN_CLUSTER_1 0x016C0 17862306a36Sopenharmony_ci#define VID_B_DOWN_CLUSTER_2 0x01C60 17962306a36Sopenharmony_ci#define VID_B_DOWN_CLUSTER_3 0x02200 18062306a36Sopenharmony_ci#define VID_B_DOWN_CLUSTER_4 0x027A0 18162306a36Sopenharmony_ci 18262306a36Sopenharmony_ci#define VID_C_DOWN_CLUSTER_1 0x02D40 18362306a36Sopenharmony_ci#define VID_C_DOWN_CLUSTER_2 0x032E0 18462306a36Sopenharmony_ci#define VID_C_DOWN_CLUSTER_3 0x03880 18562306a36Sopenharmony_ci#define VID_C_DOWN_CLUSTER_4 0x03E20 18662306a36Sopenharmony_ci 18762306a36Sopenharmony_ci#define VID_D_DOWN_CLUSTER_1 0x043C0 18862306a36Sopenharmony_ci#define VID_D_DOWN_CLUSTER_2 0x04960 18962306a36Sopenharmony_ci#define VID_D_DOWN_CLUSTER_3 0x04F00 19062306a36Sopenharmony_ci#define VID_D_DOWN_CLUSTER_4 0x054A0 19162306a36Sopenharmony_ci 19262306a36Sopenharmony_ci#define VID_E_DOWN_CLUSTER_1 0x05a40 19362306a36Sopenharmony_ci#define VID_E_DOWN_CLUSTER_2 0x05FE0 19462306a36Sopenharmony_ci#define VID_E_DOWN_CLUSTER_3 0x06580 19562306a36Sopenharmony_ci#define VID_E_DOWN_CLUSTER_4 0x06B20 19662306a36Sopenharmony_ci 19762306a36Sopenharmony_ci#define VID_F_DOWN_CLUSTER_1 0x070C0 19862306a36Sopenharmony_ci#define VID_F_DOWN_CLUSTER_2 0x07660 19962306a36Sopenharmony_ci#define VID_F_DOWN_CLUSTER_3 0x07C00 20062306a36Sopenharmony_ci#define VID_F_DOWN_CLUSTER_4 0x081A0 20162306a36Sopenharmony_ci 20262306a36Sopenharmony_ci#define VID_G_DOWN_CLUSTER_1 0x08740 20362306a36Sopenharmony_ci#define VID_G_DOWN_CLUSTER_2 0x08CE0 20462306a36Sopenharmony_ci#define VID_G_DOWN_CLUSTER_3 0x09280 20562306a36Sopenharmony_ci#define VID_G_DOWN_CLUSTER_4 0x09820 20662306a36Sopenharmony_ci 20762306a36Sopenharmony_ci#define VID_H_DOWN_CLUSTER_1 0x09DC0 20862306a36Sopenharmony_ci#define VID_H_DOWN_CLUSTER_2 0x0A360 20962306a36Sopenharmony_ci#define VID_H_DOWN_CLUSTER_3 0x0A900 21062306a36Sopenharmony_ci#define VID_H_DOWN_CLUSTER_4 0x0AEA0 21162306a36Sopenharmony_ci 21262306a36Sopenharmony_ci#define AUD_A_DOWN_CLUSTER_1 0x0B500 21362306a36Sopenharmony_ci#define AUD_A_DOWN_CLUSTER_2 0x0B580 21462306a36Sopenharmony_ci#define AUD_A_DOWN_CLUSTER_3 0x0B600 21562306a36Sopenharmony_ci 21662306a36Sopenharmony_ci#define AUD_B_DOWN_CLUSTER_1 0x0B680 21762306a36Sopenharmony_ci#define AUD_B_DOWN_CLUSTER_2 0x0B700 21862306a36Sopenharmony_ci#define AUD_B_DOWN_CLUSTER_3 0x0B780 21962306a36Sopenharmony_ci 22062306a36Sopenharmony_ci#define AUD_C_DOWN_CLUSTER_1 0x0B800 22162306a36Sopenharmony_ci#define AUD_C_DOWN_CLUSTER_2 0x0B880 22262306a36Sopenharmony_ci#define AUD_C_DOWN_CLUSTER_3 0x0B900 22362306a36Sopenharmony_ci 22462306a36Sopenharmony_ci#define AUD_D_DOWN_CLUSTER_1 0x0B980 22562306a36Sopenharmony_ci#define AUD_D_DOWN_CLUSTER_2 0x0BA00 22662306a36Sopenharmony_ci#define AUD_D_DOWN_CLUSTER_3 0x0BA80 22762306a36Sopenharmony_ci 22862306a36Sopenharmony_ci#define TX_SRAM_POOL_FREE 0x0BB00 22962306a36Sopenharmony_ci#define TX_SRAM_END 0x0C000 23062306a36Sopenharmony_ci 23162306a36Sopenharmony_ci#define BYTES_TO_DWORDS(bcount) ((bcount) >> 2) 23262306a36Sopenharmony_ci#define BYTES_TO_QWORDS(bcount) ((bcount) >> 3) 23362306a36Sopenharmony_ci#define BYTES_TO_OWORDS(bcount) ((bcount) >> 4) 23462306a36Sopenharmony_ci 23562306a36Sopenharmony_ci#define VID_IQ_SIZE_DW BYTES_TO_DWORDS(VID_IQ_SIZE) 23662306a36Sopenharmony_ci#define VID_CDT_SIZE_QW BYTES_TO_QWORDS(VID_CDT_SIZE) 23762306a36Sopenharmony_ci#define VID_CLUSTER_SIZE_OW BYTES_TO_OWORDS(VID_CLUSTER_SIZE) 23862306a36Sopenharmony_ci 23962306a36Sopenharmony_ci#define AUDIO_IQ_SIZE_DW BYTES_TO_DWORDS(AUDIO_IQ_SIZE) 24062306a36Sopenharmony_ci#define AUDIO_CDT_SIZE_QW BYTES_TO_QWORDS(AUDIO_CDT_SIZE) 24162306a36Sopenharmony_ci#define AUDIO_CLUSTER_SIZE_QW BYTES_TO_QWORDS(AUDIO_CLUSTER_SIZE) 24262306a36Sopenharmony_ci 24362306a36Sopenharmony_ci#define MBIF_IQ_SIZE_DW BYTES_TO_DWORDS(MBIF_IQ_SIZE) 24462306a36Sopenharmony_ci#define MBIF_CDT_SIZE_QW BYTES_TO_QWORDS(MBIF_CDT_SIZE) 24562306a36Sopenharmony_ci#define MBIF_CLUSTER_SIZE_OW BYTES_TO_OWORDS(MBIF_CLUSTER_SIZE) 24662306a36Sopenharmony_ci 24762306a36Sopenharmony_ci#endif 248