close Warning: Can't use blame annotator:
No changeset 2 in the repository

source: svn/newcon3bcm2_21bu/magnum/commonutils/rdc/7552/brdc_private.h

Last change on this file was 76, checked in by megakiss, 10 years ago

1W 대기전력을 만족시키기 위하여 POWEROFF시 튜너를 Standby 상태로 함

  • Property svn:executable set to *
File size: 14.1 KB
RevLine 
1/***************************************************************************
2 *     Copyright (c) 2003-2011, 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: brdc_private.h $
11 * $brcm_Revision: Hydra_Software_Devel/35 $
12 * $brcm_Date: 11/1/11 9:56a $
13 *
14 * Module Description:
15 *
16 * Revision History:
17 *
18 * $brcm_Log: /magnum/commonutils/rdc/7038/brdc_private.h $
19 *
20 * Hydra_Software_Devel/35   11/1/11 9:56a pntruong
21 * SW7435-23: Initial rdc support for 7435.
22 *
23 * Hydra_Software_Devel/34   2/9/11 3:34p pntruong
24 * SW7420-1456: Initial standby power management that used chp's pm
25 * functionalities.  Additional standardize coding style and uses of dbg
26 * object.
27 *
28 * Hydra_Software_Devel/33   3/18/10 11:36a yuxiaz
29 * SW7405-3954: Remove dependence of brdc.h in bavc.h
30 *
31 * Hydra_Software_Devel/31   3/24/09 5:29p albertl
32 * PR52513: Moved RDC debug globals into hList structure.
33 *
34 * Hydra_Software_Devel/30   2/28/08 5:03p jessem
35 * PR 38623: Added RDMA blockout support.
36 *
37 * Hydra_Software_Devel/29   10/4/07 11:52a pntruong
38 * PR34714: Update RDC trigger definitions, and removed warnings and
39 * global vars.
40 *
41 * Hydra_Software_Devel/28   9/13/07 4:20p pntruong
42 * PR 28750 : Added RDC hooks for RUL capture for splash screen.
43 *
44 * Hydra_Software_Devel/28   9/13/07 4:14p pntruong
45 * PR 28750 : Added RDC hooks for RUL capture for splash screen.
46 *
47 * Hydra_Software_Devel/27   12/21/06 1:07p hongtaoz
48 * PR25668: h/w changed RDC scratch registers layout; bring up 7403;
49 *
50 * Hydra_Software_Devel/PR28750/1   9/7/07 1:46p shyam
51 * PR 28750 : Change to RDC hooks as function pointers
52 *
53 * Hydra_Software_Devel/26   8/15/06 6:37p pntruong
54 * PR23177:  Also need to map the unknown trigger for trigger_select.
55 *
56 * Hydra_Software_Devel/25   8/14/06 7:53p pntruong
57 * PR23177: RDC module bringup.
58 *
59 * Hydra_Software_Devel/24   8/7/06 3:29p pntruong
60 * PR23177: RDC module bringup.
61 *
62 * Hydra_Software_Devel/23   6/16/06 3:26p albertl
63 * PR20276:  Removed multiple calls to BMEM address conversion functions.
64 * Converted address now stored in context.
65 *
66 * Hydra_Software_Devel/22   1/12/06 2:44p hongtaoz
67 * PR18233: need to re-compute the RUL cached start address every time in
68 * case user changes cache usage or mapping;
69 *
70 * Hydra_Software_Devel/21   1/12/06 1:31p hongtaoz
71 * PR18233: added mosaic mode support;
72 *
73 * Hydra_Software_Devel/20   1/3/06 3:01p yuxiaz
74 * PR17593: Removed unused RDC task-context code. Use the _isr version of
75 * functions for the non-_isr version.
76 *
77 * Hydra_Software_Devel/19   6/13/05 3:14p pntruong
78 * PR15862: Added rdc rul logging for debug.
79 *
80 * Hydra_Software_Devel/18   11/23/04 8:53p pntruong
81 * PR13076, PR11749: Video jitter under heavy system load.  Added RUL
82 * execution check to reduce number of programmed registers.
83 *
84 * Hydra_Software_Devel/17   10/28/04 4:07p yuxiaz
85 * PR13108: Remove BKNI_Sleep from critical section and _isr functions.
86 * Clean up _isr and non_isr functions.
87 *
88 * Hydra_Software_Devel/16   3/16/04 2:54p yuxiaz
89 * PR 10095: Added code to enable RDC acess of  regsiters outside BVN.
90 * This code is disabled for A0.
91 *
92 * Hydra_Software_Devel/15   1/14/04 4:41p yuxiaz
93 * PR 9076: Change isr functions to _isr.
94 *
95 * Hydra_Software_Devel/14   1/8/04 9:31a jasonh
96 * PR 9201: Added typedef to structures.
97 *
98 * Hydra_Software_Devel/13   12/22/03 11:51a jasonh
99 * PR 8861: Added new semaphore and debugging prototypes.
100 *
101 * Hydra_Software_Devel/12   10/30/03 2:46p yuxiaz
102 * Remove bInterrupt from BRDC_Slot_Execute and
103 * BRDC_Slot_ExecuteOnTrigger.
104 *
105 * Hydra_Software_Devel/11   10/27/03 3:13p yuxiaz
106 * Added soft reset.
107 *
108 * Hydra_Software_Devel/10   9/8/03 9:36a yuxiaz
109 * Change unsigned int to uint32_t.
110 *
111 * Hydra_Software_Devel/9   9/2/03 2:55p yuxiaz
112 * Added BRDC_Slot_GetId, moved BRDC_SlotId to brdc.h.
113 *
114 * Hydra_Software_Devel/8   8/14/03 8:58a yuxiaz
115 * Clean up include files.
116 *
117 * Hydra_Software_Devel/7   8/12/03 1:48p yuxiaz
118 * Use double link list to keep track of slots a specific list assigned
119 * to.
120 *
121 * Hydra_Software_Devel/6   7/25/03 12:12p yuxiaz
122 * Change BRDC_Trigger to use defines in RDB. Misc clean up.
123 *
124 * Hydra_Software_Devel/5   7/17/03 8:50a yuxiaz
125 * Added debug message.
126 *
127 * Hydra_Software_Devel/4   7/7/03 2:51p yuxiaz
128 * Added opcode. Misc clean up.
129 *
130 * Hydra_Software_Devel/3   7/2/03 10:19a yuxiaz
131 * Fixed register write.
132 *
133 * Hydra_Software_Devel/2   6/30/03 1:15p yuxiaz
134 * Added BRDC_Trigger.
135 *
136 * Hydra_Software_Devel/1   6/27/03 2:55p yuxiaz
137 * Initial version.
138 *
139 ***************************************************************************/
140#ifndef BRDC__PRIVATE_H__
141#define BRDC__PRIVATE_H__
142
143#include "blst_list.h"           /* Link list support */
144#include "brdc.h"
145#include "brdc_dbg.h"
146
147#ifdef __cplusplus
148extern "C" {
149#endif
150
151
152/***************************************************************************
153 * Defines
154 ***************************************************************************/
155
156#define BRDC_P_Read32(hRdc, reg)                BREG_Read32(hRdc->hReg, reg)
157#define BRDC_P_Write32(hRdc, reg, data)         BREG_Write32(hRdc->hReg, reg, data)
158
159#define BRDC_Slot_P_Read32(hSlot, reg)          BRDC_P_Read32(hSlot->hRdc, reg)
160#define BRDC_Slot_P_Write32(hSlot, reg, data)   BRDC_P_Write32(hSlot->hRdc, reg, data)
161
162/* Number of rul to capture. */
163#define BRDC_P_MAX_COUNT                        (1024*1024)
164
165/* Null int id */
166#define BRDC_P_NULL_BINTID                      ((BINT_Id)(-1))
167
168/* Macro to make a RDC trigger.*/
169#define BRDC_P_TRIGGER(trigger)                  BCHP_RDC_desc_0_config_trigger_select_##trigger
170
171/* Unkown trigger value. */
172#define BRDC_P_TRIGGER_UNKNOWN_VAL              (0x7f)
173
174/* RDC general purpose registers address*/
175#define BRDC_P_NO_TRACKING_ADDR                  UINT32_C(-1)
176
177/***************************************************************************
178Summary:
179        Scratch Registers wrapper
180
181Description:
182        The following moduals have reserved scratch registers:
183                RDC: the first 27 or 32 scratch registers are reserved internally for
184                     slot execution tracking;
185                VDC: the last 3 scratch registers are reserved for VDC format switch,
186                         which are BRDC_SCRATCH_REG_END ~ (BRDC_SCRATCH_REG_END-2);
187****************************************************************************/
188#define BRDC_P_NUM_OF_SLOTS            (32)
189#define BRDC_P_MAX_NUM_OF_DISPLAYS     (3)
190
191#if BCHP_RDC_scratch_i_ARRAY_BASE /* 7403 and beyond */
192        /* VBI: the last 4 scratch reigsters are reserved to coordinate programming
193         * of VBI encoder control registers between BVBI and BVDC. (see bavc.h
194         * for details) */
195        #define BRDC_P_NUM_OF_SCRATCH_FOR_VBI  (4)
196
197        /* the first 32 scratch registers are reserved for RDC slot execution tracking */
198        #define BRDC_P_SCRATCH_REG_START   (0)
199        #define BRDC_P_SCRATCH_REG_END     (BCHP_RDC_scratch_i_ARRAY_END - BRDC_P_NUM_OF_SCRATCH_FOR_VBI)
200
201        #define BRDC_P_SCRATCH_REG_ADDR(varx) \
202                (BCHP_RDC_scratch_i_ARRAY_BASE + ((varx) * sizeof(uint32_t)))
203
204        /* track all slots */
205        #define BRDC_P_TRACK_REG_ADDR(x) BRDC_P_SCRATCH_REG_ADDR(x)
206
207        /* BRDC_P_SCRATCH_FIRST_AVAILABLE needs to exclude RDC internally reserved
208           slot-tracking registers;
209           we also need to reserve at least 3 scratch registers for VDC display format
210           switch usage; */
211        #define BRDC_P_SCRATCH_FIRST_AVAILABLE  (BRDC_P_NUM_OF_SLOTS)
212#else /* 3563 and previous chipsets */
213        /* the first 27 or 32 scratch registers are reserved for RDC slot execution
214         * tracking */
215        #define BRDC_P_SCRATCH_REG_START        (BRDC_Variable_Max)
216        #define BRDC_P_SCRATCH_REG_END          (BCHP_RDC_data_i_ARRAY_END)
217
218        #define BRDC_P_SCRATCH_REG_ADDR(varx) \
219                (BCHP_RDC_data_i_ARRAY_BASE + ((varx) * sizeof(uint32_t)))
220
221        /* BRDC_P_SCRATCH_FIRST_AVAILABLE needs to exclude RDC internally reserved
222           slot-tracking registers;
223           we also need to reserve at least 3 scratch registers for VDC display format
224           switch usage; */
225        #if ((BRDC_P_SCRATCH_REG_END) >= (BRDC_P_SCRATCH_REG_START+BRDC_P_NUM_OF_SLOTS+BRDC_P_MAX_NUM_OF_DISPLAYS)) /* 3563 */
226        #define BRDC_P_TRACK_REG_ADDR(x) BRDC_P_SCRATCH_REG_ADDR(x)
227        #define BRDC_P_SCRATCH_FIRST_AVAILABLE  (BRDC_P_SCRATCH_REG_START+BRDC_P_NUM_OF_SLOTS)
228        #else /* previous chipsets: 7038/7438/7118/7401/7400A0/3560 */
229        #define BRDC_P_TRACK_REG_ADDR(x) \
230                (((x) > BRDC_P_SCRATCH_REG_END-BRDC_P_MAX_NUM_OF_DISPLAYS)? \
231                BRDC_P_NO_TRACKING_ADDR : BRDC_P_SCRATCH_REG_ADDR(x))
232        #define BRDC_P_SCRATCH_FIRST_AVAILABLE  (BRDC_P_SCRATCH_REG_END-BRDC_P_MAX_NUM_OF_DISPLAYS+1)
233        #endif
234#endif
235
236#if (BRDC_P_SCRATCH_FIRST_AVAILABLE+BRDC_P_MAX_NUM_OF_DISPLAYS-1)>BRDC_P_SCRATCH_REG_END
237#error "RDC doesn't have enough scratch registers! Please adjust MACRO above!"
238#endif
239
240#ifdef BCHP_RDC_desc_0_config_segmented_MASK
241#define BRDC_P_SUPPORT_SEGMENTED_RUL       (1)
242#else
243#define BRDC_P_SUPPORT_SEGMENTED_RUL       (0)
244#endif
245
246/***************************************************************************
247 * Data Structure
248 ***************************************************************************/
249
250/***************************************************************************
251 * BRDC_P_Slot_Head
252 *      Head of the double Link List for slot
253 ***************************************************************************/
254typedef struct BRDC_P_Slot_Head BRDC_P_Slot_Head;
255BLST_D_HEAD(BRDC_P_Slot_Head, BRDC_P_Slot_Handle);
256
257/***************************************************************************
258 * BRDC_P_Handle
259 ***************************************************************************/
260typedef struct BRDC_P_Handle
261{
262        BDBG_OBJECT(BRDC_RDC)
263
264        BREG_Handle                        hReg;             /* Register module handle */
265        BCHP_Handle                        hChp;             /* Chip module handle */
266        BMEM_Handle                        hMem;             /* Memory module handle */
267        BRDC_Settings                      stRdcSettings;    /* Global RDC Settings */
268        const BRDC_TrigInfo               *aTrigInfo;        /* Contain this chip trigger information. */
269
270        /* Scratch registers use flags */
271        bool                               abScratchRegUsed[BRDC_P_SCRATCH_REG_END - BRDC_P_SCRATCH_FIRST_AVAILABLE + 1];
272        bool                               bSlotUsed[BRDC_SlotId_eSlotMAX];
273        BRDC_Slot_Handle                   apSlot[BRDC_SlotId_eSlotMAX];
274
275#ifdef BRDC_USE_CAPTURE_BUFFER
276        BRDC_DBG_CaptureBuffer             captureBuffer;
277#endif
278
279        /* RDC blockout */
280        BRDC_List_Handle                   hRdcBlockOutList; /* prealloced RUL list for RDC block out */
281        BRDC_BlockOut                      astBlockOut[BRDC_MAX_RDC_BLOCKOUT_LIST_COUNT];
282        bool                               bRdcBlockOutEnabled;
283} BRDC_P_Handle;
284
285
286/***************************************************************************
287 * BRDC_P_Slot_Handle
288 ***************************************************************************/
289typedef struct BRDC_P_Slot_Handle
290{
291        BDBG_OBJECT(BRDC_SLT)
292
293        BRDC_Handle        hRdc;         /* Parent handle */
294        BRDC_List_Handle   hList;        /* RUL list handle */
295
296        bool               bRecurring;   /* Is it recurring? */
297        BRDC_SlotId        eSlotId;      /* RDMA descriptor Id */
298        BRDC_Trigger       eRDCTrigger;  /* Trigger */
299        BINT_Id            SlotIntId;    /* L2 interrupt id of this slot. */
300        uint32_t           ulRegOffset;  /* Byte offset from slot 0 */
301
302        /* Keep track if a list has been executed when assigned to a slot. */
303        bool               bTrackExecution;   /* Enable keep track of execution. */
304        uint32_t           ulTrackCount;      /* SW updates this. */
305        uint32_t           ulTrackRegAddr;    /* HW updates this. */
306
307        /* store the desc_config setting */
308        uint32_t          *pulRulConfigPrevVal; /* point to the previous RUL's config value */
309        uint32_t          *pulRulConfigVal; /* point to the current RUL's config value */
310
311        BLST_D_ENTRY(BRDC_P_Slot_Handle)  link;         /* doubly-linked list support */
312
313} BRDC_P_Slot_Handle;
314
315
316/***************************************************************************
317 * BRDC_P_List_Handle
318 ***************************************************************************/
319typedef struct BRDC_P_List_Handle
320{
321        BDBG_OBJECT(BRDC_LST)
322
323        BRDC_Handle         hRdc;              /* Parent handle */
324        uint32_t           *pulRULAddr;        /* RUL address */
325        uint32_t           *pulRULCacheAddr;   /* RUL cached address */
326        uint32_t            ulAddrOffset;      /* Device offset address */
327        uint32_t            ulEntries;         /* Number of entries in slot */
328        uint32_t            ulMaxEntries;      /* Max number of entries */
329        bool                bLastExecuted;     /* Check if last list assignment executed. */
330
331        uint32_t            ulNumSlotAssigned; /* Number of slots the list assigned to */
332        BRDC_P_Slot_Head   *pSlotAssigned;     /* Double link list to keep track of which slots the list assigned to */
333
334        /* for RDC list debugging */
335        BRDC_DBG_ListEntry  eNextEntry;
336        uint32_t           *pulCurListAddr;
337        uint32_t            ulNumEntries;
338        uint32_t            ulCurrCommand;
339        int                 iCommandIndex;
340        int                 iDataCount;
341
342} BRDC_P_List_Handle;
343
344
345/***************************************************************************
346 * Functions
347 ***************************************************************************/
348BERR_Code BRDC_P_SoftReset
349        ( BRDC_Handle                      hRdc );
350
351BERR_Code BRDC_Slot_P_GetNextSlot
352        ( BRDC_Handle                      hRdc,
353          BRDC_SlotId                     *pSlotId );
354
355BERR_Code BRDC_Slot_P_Write_Registers_isr
356        ( BRDC_Slot_Handle                 hSlot,
357          BRDC_Trigger                     eRDCTrigger,
358          bool                             bRecurring,
359          bool                             bExecuteOnTrigger );
360
361BERR_Code BRDC_P_AcquireSemaphore_isr
362        ( BRDC_Handle                      hRdc,
363          BRDC_SlotId                      eSlotId );
364
365void BRDC_P_ReleaseSemaphore_isr
366        ( BRDC_Handle                      hRdc,
367          BRDC_SlotId                      eSlotId );
368
369void BRDC_P_DumpSlot
370        ( BRDC_Handle                      hRdc,
371          BRDC_SlotId                      eSlotId );
372
373#ifdef __cplusplus
374}
375#endif
376
377#endif /* #ifndef BRDC__PRIVATE_H__ */
378
379/* end of file */
Note: See TracBrowser for help on using the repository browser.