| 1 | /*************************************************************************** |
|---|
| 2 | * Copyright (c) 2004-2012, Broadcom Corporation |
|---|
| 3 | * All Rights Reserved |
|---|
| 4 | * Confidential Property of Broadcom Corporation |
|---|
| 5 | * |
|---|
| 6 | * THIS SOFTWARE MAY ONLY BE USED SUBJECT TO AN EXECUTED SOFTWARE LICENSE |
|---|
| 7 | * AGREEMENT BETWEEN THE USER AND BROADCOM. YOU HAVE NO RIGHT TO USE OR |
|---|
| 8 | * EXPLOIT THIS MATERIAL EXCEPT SUBJECT TO THE TERMS OF SUCH AN AGREEMENT. |
|---|
| 9 | * |
|---|
| 10 | * $brcm_Workfile: bmrc_monitor_priv.h $ |
|---|
| 11 | * $brcm_Revision: Hydra_Software_Devel/11 $ |
|---|
| 12 | * $brcm_Date: 2/29/12 7:19p $ |
|---|
| 13 | * |
|---|
| 14 | * Module Description: |
|---|
| 15 | * |
|---|
| 16 | * Implementation of the Realtime Memory Monitor for 7038 |
|---|
| 17 | * |
|---|
| 18 | * Revision History: |
|---|
| 19 | * |
|---|
| 20 | * $brcm_Log: /magnum/commonutils/mrc/7420/bmrc_monitor_priv.h $ |
|---|
| 21 | * |
|---|
| 22 | * Hydra_Software_Devel/11 2/29/12 7:19p albertl |
|---|
| 23 | * SW7344-37: Fixed some masks for SCB 4.2. |
|---|
| 24 | * |
|---|
| 25 | * Hydra_Software_Devel/10 3/22/11 3:50p albertl |
|---|
| 26 | * SW7344-37: Added changes for SCB Protocal 4.2. Fixed transfer size |
|---|
| 27 | * message. |
|---|
| 28 | * |
|---|
| 29 | * Hydra_Software_Devel/9 3/28/10 4:04p albertl |
|---|
| 30 | * SW7405-4059: Fixed missing MAX defines. |
|---|
| 31 | * |
|---|
| 32 | * Hydra_Software_Devel/8 3/26/10 1:32p albertl |
|---|
| 33 | * SW7405-4059: Updated debug messages to be more helpful. Included link |
|---|
| 34 | * to SCB specs documentation, also available in this JIRA. |
|---|
| 35 | * |
|---|
| 36 | * Hydra_Software_Devel/6 2/25/08 7:04p albertl |
|---|
| 37 | * PR36876: Rewrote MRC to abstract client names and streamline adding of |
|---|
| 38 | * future chips. 3548 support added. |
|---|
| 39 | * |
|---|
| 40 | * Hydra_Software_Devel/5 5/1/07 5:08p albertl |
|---|
| 41 | * PR29633: Updated and changed MRC for 7405. |
|---|
| 42 | * |
|---|
| 43 | * Hydra_Software_Devel/4 2/7/07 7:39p albertl |
|---|
| 44 | * PR25898: Changed BMRC_MONITOR range checking to JWord (256 byte) |
|---|
| 45 | * granularity to eliminate false violations from clients with JWord |
|---|
| 46 | * minimum access sizes. |
|---|
| 47 | * |
|---|
| 48 | * Hydra_Software_Devel/3 3/7/06 6:36p albertl |
|---|
| 49 | * PR19498: Added SCB Command decoding in error messages, and NMB is |
|---|
| 50 | * printed only when relevant. Checker ranges no longer cover extra |
|---|
| 51 | * bytes that exceed 8 byte size alignment. |
|---|
| 52 | * |
|---|
| 53 | * Hydra_Software_Devel/2 3/1/06 5:24p albertl |
|---|
| 54 | * PR18701: Renamed structs to use private names. Changed |
|---|
| 55 | * BMRC_P_Monitor_FileClientInfoto use char pointer instead of array. |
|---|
| 56 | * |
|---|
| 57 | * Hydra_Software_Devel/1 2/16/06 7:43p albertl |
|---|
| 58 | * PR19101: Created typedefs for structs in bmrc_monitor_clients.c. |
|---|
| 59 | * |
|---|
| 60 | ***************************************************************************/ |
|---|
| 61 | #ifndef BMRC_MONITOR_PRIV_H_ |
|---|
| 62 | #define BMRC_MONITOR_PRIV_H_ |
|---|
| 63 | #ifdef __cplusplus |
|---|
| 64 | extern "C" { |
|---|
| 65 | #endif |
|---|
| 66 | |
|---|
| 67 | /* TODO: Make this detect version at runtime */ |
|---|
| 68 | #if (BCHP_CHIP==7422) || (BCHP_CHIP==7425) || (BCHP_CHIP==7435) || (BCHP_CHIP==7325) || (BCHP_CHIP==7344) |
|---|
| 69 | #define BMRC_MONITOR_P_SCB_PROTOCOL_VER 0x42 |
|---|
| 70 | #else |
|---|
| 71 | #define BMRC_MONITOR_P_SCB_PROTOCOL_VER 0x01 |
|---|
| 72 | #endif |
|---|
| 73 | |
|---|
| 74 | /* SCB Protocol Specifications the following are derived from are available at |
|---|
| 75 | http://www.blr.broadcom.com/projects/DVT_BLR/Memc_Arch/. */ |
|---|
| 76 | typedef enum |
|---|
| 77 | { |
|---|
| 78 | BMRC_P_Monitor_ScbCommand_eLR = 1, |
|---|
| 79 | BMRC_P_Monitor_ScbCommand_eLW = 2, |
|---|
| 80 | BMRC_P_Monitor_ScbCommand_eREF = 3, |
|---|
| 81 | BMRC_P_Monitor_ScbCommand_eMRS = 4, |
|---|
| 82 | BMRC_P_Monitor_ScbCommand_eEMRS = 5, |
|---|
| 83 | BMRC_P_Monitor_ScbCommand_ePALL = 6, |
|---|
| 84 | BMRC_P_Monitor_ScbCommand_eDR = 7, |
|---|
| 85 | BMRC_P_Monitor_ScbCommand_eDW = 8, |
|---|
| 86 | BMRC_P_Monitor_ScbCommand_eMR = 9, |
|---|
| 87 | BMRC_P_Monitor_ScbCommand_eMW = 10, |
|---|
| 88 | BMRC_P_Monitor_ScbCommand_eCR4 = 11, |
|---|
| 89 | BMRC_P_Monitor_ScbCommand_eCR8 = 12, |
|---|
| 90 | BMRC_P_Monitor_ScbCommand_eUnknown = 0 |
|---|
| 91 | }BMRC_P_Monitor_ScbCommand; |
|---|
| 92 | |
|---|
| 93 | |
|---|
| 94 | typedef struct BMRC_P_Monitor_FileClientInfo |
|---|
| 95 | { |
|---|
| 96 | const char *prefix; |
|---|
| 97 | const BMRC_Client *clients; |
|---|
| 98 | } BMRC_P_Monitor_FileClientInfo; |
|---|
| 99 | |
|---|
| 100 | typedef struct BMRC_P_Monitor_ScbCommandInfo { |
|---|
| 101 | BMRC_P_Monitor_ScbCommand eScbCommand; |
|---|
| 102 | uint32_t ulCommand; |
|---|
| 103 | uint32_t ulMask; |
|---|
| 104 | char *pName; |
|---|
| 105 | }BMRC_P_Monitor_ScbCommandInfo; |
|---|
| 106 | |
|---|
| 107 | #define BMRC_P_MONITOR_SCB_MEM_ACCESS_ALIGN ~0x000000FF /* some clients have J-word min access length */ |
|---|
| 108 | #define BMRC_P_MONITOR_SCB_CHECKER_SIZE_MASK ~0x00000007 |
|---|
| 109 | #define BMRC_P_MONITOR_CHECKER_ADDR_ALIGN BMRC_P_MONITOR_SCB_MEM_ACCESS_ALIGN |
|---|
| 110 | |
|---|
| 111 | |
|---|
| 112 | /* SCB defines */ |
|---|
| 113 | |
|---|
| 114 | #if (BMRC_MONITOR_P_SCB_PROTOCOL_VER >= 0x42) |
|---|
| 115 | #define BMRC_P_MONITOR_SCB_TRANSFER_ACCESS_MASK 0x1E0 |
|---|
| 116 | #define BMRC_P_MONITOR_SCB_TRANSFER_SIZE_MASK 0x01F |
|---|
| 117 | #else |
|---|
| 118 | #define BMRC_P_MONITOR_SCB_TRANSFER_ACCESS_MASK 0x1F0 |
|---|
| 119 | #define BMRC_P_MONITOR_SCB_TRANSFER_SIZE_MASK 0x00F |
|---|
| 120 | #endif |
|---|
| 121 | |
|---|
| 122 | #define BMRC_P_MONITOR_SCB_INTERNAL_MASK 0x1FF |
|---|
| 123 | #define BMRC_P_MONITOR_SCB_MPEG_BLOCK_ACCESS_MASK 0x180 |
|---|
| 124 | #define BMRC_P_MONITOR_SCB_CACHE_ACCESS_MASK 0x1FF |
|---|
| 125 | |
|---|
| 126 | #define BMRC_P_MONITOR_SCB_TRANSFER_SIZE_MAX (BMRC_P_MONITOR_SCB_TRANSFER_SIZE_MASK + 1) |
|---|
| 127 | |
|---|
| 128 | /* SCB MPEG block command fields */ |
|---|
| 129 | #define BMRC_P_MONITOR_SCB_MPEG_X_BIT 0x080 |
|---|
| 130 | #define BMRC_P_MONITOR_SCB_MPEG_Y_MASK 0x03E |
|---|
| 131 | #define BMRC_P_MONITOR_SCB_MPEG_T_BIT 0x001 |
|---|
| 132 | |
|---|
| 133 | #define BMRC_P_MONITOR_SCB_YLINES_MAX (64) |
|---|
| 134 | |
|---|
| 135 | #if (BMRC_MONITOR_P_SCB_PROTOCOL_VER >= 0x42) |
|---|
| 136 | #define BMRC_P_MONITOR_SCB_COMMAND_LR 0x000 |
|---|
| 137 | #define BMRC_P_MONITOR_SCB_COMMAND_LW 0x020 |
|---|
| 138 | #define BMRC_P_MONITOR_SCB_COMMAND_DR 0x180 |
|---|
| 139 | #define BMRC_P_MONITOR_SCB_COMMAND_DW 0x1A0 |
|---|
| 140 | #define BMRC_P_MONITOR_SCB_COMMAND_CR4 0x044 |
|---|
| 141 | #define BMRC_P_MONITOR_SCB_COMMAND_CR8 0x048 |
|---|
| 142 | |
|---|
| 143 | #else |
|---|
| 144 | #define BMRC_P_MONITOR_SCB_COMMAND_LR 0x000 |
|---|
| 145 | #define BMRC_P_MONITOR_SCB_COMMAND_LW 0x010 |
|---|
| 146 | #define BMRC_P_MONITOR_SCB_COMMAND_DR 0x060 |
|---|
| 147 | #define BMRC_P_MONITOR_SCB_COMMAND_DW 0x070 |
|---|
| 148 | #define BMRC_P_MONITOR_SCB_COMMAND_CR4 0x024 |
|---|
| 149 | #define BMRC_P_MONITOR_SCB_COMMAND_CR8 0x028 |
|---|
| 150 | #endif |
|---|
| 151 | |
|---|
| 152 | #define BMRC_P_MONITOR_SCB_COMMAND_REF 0x05C |
|---|
| 153 | #define BMRC_P_MONITOR_SCB_COMMAND_MRS 0x05D |
|---|
| 154 | #define BMRC_P_MONITOR_SCB_COMMAND_EMRS 0x05E |
|---|
| 155 | #define BMRC_P_MONITOR_SCB_COMMAND_PALL 0x05F |
|---|
| 156 | |
|---|
| 157 | #define BMRC_P_MONITOR_SCB_COMMAND_MR 0x080 |
|---|
| 158 | #define BMRC_P_MONITOR_SCB_COMMAND_MW 0x100 |
|---|
| 159 | |
|---|
| 160 | |
|---|
| 161 | #ifdef __cplusplus |
|---|
| 162 | } /* end extern "C" */ |
|---|
| 163 | #endif |
|---|
| 164 | |
|---|
| 165 | #endif /* BMRC_MONITOR_PRIV_H_ */ |
|---|
| 166 | |
|---|
| 167 | /* End of File */ |
|---|