source: svn/newcon3bcm2_21bu/nexus/platforms/97552/include/nexus_platform.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: 23.6 KB
Line 
1/***************************************************************************
2*     (c)2004-2011 Broadcom Corporation
3*
4*  This program is the proprietary software of Broadcom Corporation and/or its licensors,
5*  and may only be used, duplicated, modified or distributed pursuant to the terms and
6*  conditions of a separate, written license agreement executed between you and Broadcom
7*  (an "Authorized License").  Except as set forth in an Authorized License, Broadcom grants
8*  no license (express or implied), right to use, or waiver of any kind with respect to the
9*  Software, and Broadcom expressly reserves all rights in and to the Software and all
10*  intellectual property rights therein.  IF YOU HAVE NO AUTHORIZED LICENSE, THEN YOU
11*  HAVE NO RIGHT TO USE THIS SOFTWARE IN ANY WAY, AND SHOULD IMMEDIATELY
12*  NOTIFY BROADCOM AND DISCONTINUE ALL USE OF THE SOFTWARE.
13*
14*  Except as expressly set forth in the Authorized License,
15*
16*  1.     This program, including its structure, sequence and organization, constitutes the valuable trade
17*  secrets of Broadcom, and you shall use all reasonable efforts to protect the confidentiality thereof,
18*  and to use this information only in connection with your use of Broadcom integrated circuit products.
19*
20*  2.     TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED "AS IS"
21*  AND WITH ALL FAULTS AND BROADCOM MAKES NO PROMISES, REPRESENTATIONS OR
22*  WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, WITH RESPECT TO
23*  THE SOFTWARE.  BROADCOM SPECIFICALLY DISCLAIMS ANY AND ALL IMPLIED WARRANTIES
24*  OF TITLE, MERCHANTABILITY, NONINFRINGEMENT, FITNESS FOR A PARTICULAR PURPOSE,
25*  LACK OF VIRUSES, ACCURACY OR COMPLETENESS, QUIET ENJOYMENT, QUIET POSSESSION
26*  OR CORRESPONDENCE TO DESCRIPTION. YOU ASSUME THE ENTIRE RISK ARISING OUT OF
27*  USE OR PERFORMANCE OF THE SOFTWARE.
28*
29*  3.     TO THE MAXIMUM EXTENT PERMITTED BY LAW, IN NO EVENT SHALL BROADCOM OR ITS
30*  LICENSORS BE LIABLE FOR (i) CONSEQUENTIAL, INCIDENTAL, SPECIAL, INDIRECT, OR
31*  EXEMPLARY DAMAGES WHATSOEVER ARISING OUT OF OR IN ANY WAY RELATING TO YOUR
32*  USE OF OR INABILITY TO USE THE SOFTWARE EVEN IF BROADCOM HAS BEEN ADVISED OF
33*  THE POSSIBILITY OF SUCH DAMAGES; OR (ii) ANY AMOUNT IN EXCESS OF THE AMOUNT
34*  ACTUALLY PAID FOR THE SOFTWARE ITSELF OR U.S. $1, WHICHEVER IS GREATER. THESE
35*  LIMITATIONS SHALL APPLY NOTWITHSTANDING ANY FAILURE OF ESSENTIAL PURPOSE OF
36*  ANY LIMITED REMEDY.
37*
38* $brcm_Workfile: nexus_platform.h $
39* $brcm_Revision: 61 $
40* $brcm_Date: 12/15/11 7:46p $
41*
42* API Description:
43*   API name: Platform
44*    Specific APIs to initialize the a board.
45*
46* Revision History:
47*
48* $brcm_Log: Q:/projects/7425/latest/nexus/platforms/97400/include/nexus_platform.h $
49*
50* 61   12/15/11 7:46p rgreen
51* SW7425-1140: Use NEXUS_HAS_CEC instead of NEXUS_NUM_CEC to
52*  enable/disable CEC support
53*
54* 60   12/15/11 4:26p vsilyaev
55* SW7425-1140: Merge NEXUS_Cec module support into main-line
56*
57* SW7425-1140/1   12/14/11 2:11p vle
58* SW7425-1140: add NEXUS Cec module
59*
60* 59   11/11/11 10:55a erickson
61* SW7231-317: fix NEXUS_BASE_ONLY, clean up warnings, simplify
62*  NEXUS_PlatformConfiguration if no inputs/outputs are defined
63*
64* 58   10/31/11 5:51p bandrews
65* SW7420-2078: merge to main
66*
67* SW7420-2078/2   10/18/11 7:01p bandrews
68* SW7231-391: remove global_handle attribute
69*
70* SW7420-2078/1   9/30/11 7:23p bandrews
71* SW7420-2078: added
72*
73* 57   10/13/11 11:01p hongtaoz
74* SW7425-1349: added audio dummy outputs;
75*
76* 56   9/19/11 4:33p erickson
77* SWDEPRECATED-2425: improve comment
78*
79* 55   8/18/11 5:50p jgarrett
80* SWDTV-6306: Merge DTV APE changes to main branch
81*
82* Nexus_APE_Integration/1   7/8/11 6:40p jgarrett
83* SWDTV-6760: Adding I2sMultiOutput
84*
85* 54   5/17/11 1:06p jhaberf
86* SWDTV-6928: Merge of 35233 platform code to the main
87*
88* SWDTV-6928/1   5/4/11 6:29p mstefan
89* SWDTV-6928: merge to main
90*
91* 53   3/4/11 11:27a erickson
92* SW7400-3006: add NEXUS_Platform_CreateHeap
93*
94* 52   2/22/11 4:16p gmohile
95* SW7408-210 : Fix kernelmode standby
96*
97* 51   2/18/11 2:28p erickson
98* SW7420-1078: add NEXUS_OFFSCREEN_SURFACE for
99*  NEXUS_Platform_GetFramebufferHeap
100*
101* 50   2/15/11 3:24p erickson
102* SW7420-1491: use attr{local=true} to get rid of code duplication
103*
104* 49   1/28/11 1:57p jgarrett
105* SW7125-769: Adding nexus frontend handle stub for platforms without
106*  frontend support
107*
108* 48   1/26/11 1:52p jgarrett
109* SW7125-769: Merge to main branch
110*
111* SW7125-769/1   1/24/11 11:30a mward
112* SW7125-769:  Add NEXUS_Platform_OpenFrontend().
113*
114*
115* 47   1/21/11 3:10p erickson
116* SW7420-1078: modify comment
117*
118* 46   12/7/10 5:47p erickson
119* SW7420-1148: refactor kernel mode proxy for process isolation
120*
121* 45   12/2/10 8:15p spothana
122* SW7420-1177: Adding nexus hdmi dvo module.
123*
124* SW7420-1177/1   11/1/10 8:33p spothana
125* SW7420-1177: Adding nexus hdmi dvo module.
126*
127* 44   11/19/10 11:29a spothana
128* SW7420-1078: Making changes to  get frame buffer API to follow nexus
129*  coding protocol.
130*
131* 43   11/18/10 7:10p spothana
132* SW7420-1078: Get frame buffer heap index per display for each platform.
133*
134* SW7420-1078/1   11/12/10 5:38p spothana
135* SW7420-1078: Get frame buffer heap index per display for each platform.
136*
137* 42   9/29/10 9:47a erickson
138* SW7420-1123: consolidate IPC server header file for now
139*
140* 41   9/15/10 4:51p jtna
141* SW7420-1004: moved Join() to nexus_platform_init.h as well
142*
143* 40   9/15/10 3:46p jtna
144* SW7420-1004: add synthunk for CORE and PLATFORM
145*
146* 39   8/20/10 12:35p erickson
147* SW7405-3832: add support for non-numeric NEXUS_PLATFORM defines.
148*
149* 38   8/4/10 10:51a VISHK
150* SW7335-813: Add smartcard module settings to the Platform settings.
151*
152* 37   7/14/10 12:27p erickson
153* SW7405-4621: add #include for app backward-compat
154*
155* 36   7/14/10 10:32a erickson
156* SW7405-4621: remove nexus_base.h
157*
158* 35   6/24/10 11:52a erickson
159* SW7400-2806: add NEXUS_Platform_GetStatus
160*
161* 34   4/21/10 9:29a erickson
162* SW7420-703: pass NEXUS_SurfaceModuleSettings through
163*  NEXUS_PlatformSettings
164*
165* 33   4/9/10 4:48p katrep
166* SW7405-4089:Fixed segfault in 32UMA mode
167*
168* 32   3/19/10 10:12a erickson
169* SW7405-3832: create standard method for specific
170*  NEXUS_PLATFORM_VERSION. use tagged NEXUS_Platform_Init to enforce
171*  binary compatibility. consolidate NEXUS_Platform_GetReleaseVersion
172*  using standard macros.
173*
174* 31   3/9/10 2:17p ismailk
175* SW7420-618: Include nexus_base.h for the 93380sms build.
176*
177* 30   1/6/10 2:56p garetht
178* SW7420-534: Port 7043 demo software to 93380sms (7420 + 3380) platform
179*
180* 29   12/15/09 4:30p erickson
181* SW7400-2629: add NEXUS_Platform_ReadRegister and
182*  NEXUS_Platform_WriteRegister
183*
184* 28   11/30/09 3:14p jrubio
185* SW7335-627: fixed for NEXUS_BASE_ONLY
186*
187* 27   11/12/09 1:14p erickson
188* SWDEPRECATED-2425: improve comments
189*
190* 26   10/19/09 6:28p garetht
191* SW7420-386:  Rebase 93380sms codebase to 97420 Phase 3.0
192*
193* 24   10/15/09 4:31p erickson
194* SWDEPRECATED-3881: add new members to NEXUS_PlatformConfiguration
195*
196* 23   8/28/09 4:00p jgarrett
197* SW7405-2928: Adding multichannel capture support
198*
199* 22   8/5/09 4:37p katrep
200* PR56569: Add nexus platfromm get version api
201*
202* 21   7/2/09 10:43a erickson
203* PR56558: make NEXUS_Platform_InitFrontend a public function, callable
204*  after NEXUS_Platform_Init if NEXUS_PlatformSettings.openFrontend =
205*  false.
206*
207* 20   5/22/09 11:30a vishk
208* PR 54842: rockford/unittests/nexus/general/boot should test
209*  NEXUS_PlatformSettings options
210*
211* 19   5/14/09 6:13p katrep
212* PR52109: Thunk layer build error in the kernelmode builds
213*
214* 18   4/7/09 11:42a erickson
215* PR53623: change #define to NEXUS_NUM_656_OUTPUTS
216*
217* 17   4/1/09 12:15p erickson
218* PR53623: merge 656 output support
219*
220* PR53623/1   3/31/09 12:44p mward
221* PR 53623: 656 output support.
222*
223* 16   3/26/09 11:27a erickson
224* PR53323: added NEXUS_BASE_ONLY option
225*
226* 15   3/20/09 1:08p erickson
227* PR53323: fix #if
228*
229* 14   3/19/09 4:59p erickson
230* PR53323: add more #if so that more modules can be optionally removed
231*
232* 13   3/9/09 2:33p erickson
233* PR50748: add multi-heap support
234*
235* 12   9/24/08 11:19a erickson
236* PR46457: modified usage notes on NEXUS_Platform_GetSettings
237*
238* 11   9/2/08 4:45p erickson
239* PR46457: added NEXUS_Platform_GetSettings
240*
241* 10   8/22/08 7:06p erickson
242* PR45795: remove maxOutputFormat. it's available with
243*  NEXUS_DisplayModule_GetSettings.
244*
245* 9   7/31/08 5:19p vsilyaev
246* PR 45137: Initial support for multi application mode
247*
248* 8   7/22/08 3:03p erickson
249* PR44598: move some module settings into NEXUS_PlatformSettings to allow
250*  app to customize init.
251*
252* 7   3/27/08 2:43p vsilyaev
253* PR 40818: Added settings to allocate shared heap
254*
255* 6   3/25/08 7:41p vsilyaev
256* PR 40862: Added supported video output formats
257*
258* 5   2/20/08 1:45p erickson
259* PR39405: added rfm
260*
261* 4   2/1/08 5:25p jgarrett
262* PR 39017: adding HdmiOutput
263*
264* 3   1/23/08 9:21p vobadm
265* PR35457: update docs
266*
267* 2   1/23/08 3:11p vsilyaev
268* PR 38682: Changed NEXUS_Platform_GetStreamerInputBand to follow nexus
269*  rules on return types
270*
271* 1   1/18/08 2:17p jgarrett
272* PR 38808: Merging to main branch
273*
274* Nexus_Devel/10   12/6/07 2:47p jgarrett
275* PR 37971: Adding I2sOutput
276*
277* Nexus_Devel/9   11/6/07 4:22p jgarrett
278* PR 34954: Migrating to audio connector model
279*
280* Nexus_Devel/8   11/5/07 4:34p erickson
281* PR36725: remove bootOnly
282*
283* Nexus_Devel/7   11/5/07 2:12p erickson
284* PR36725: add NEXUS_PlatformConfiguration, share more code with 97401
285*
286* Nexus_Devel/6   10/29/07 1:46p ptimariu
287* PR35002: add extern "C"
288*
289* Nexus_Devel/5   10/18/07 10:39a erickson
290* PR36152: added NEXUS_Platform_GetStreamerInputBand
291*
292* Nexus_Devel/4   9/26/07 5:36p vsilyaev
293* PR 34662: Added platform configuration
294*
295* Nexus_Devel/3   9/24/07 3:43p jgarrett
296* PR 35002: Adding platform_features
297*
298* Nexus_Devel/2   9/21/07 6:26p jgarrett
299* PR 35002: Complete 97400 build
300*
301* Nexus_Devel/1   9/19/07 6:32p jgarrett
302* PR 35002: Adding initial 97400 platform
303*
304***************************************************************************/
305#ifndef NEXUS_PLATFORM_H__
306#define NEXUS_PLATFORM_H__
307
308#include "nexus_types.h"
309#include "nexus_base_os.h"
310#include "nexus_memory.h"
311#include "nexus_platform_features.h"
312#include "nexus_platform_extint.h"
313#include "nexus_platform_init.h"
314#include "nexus_platform_standby.h"
315#include "nexus_platform_server.h"
316
317#if NEXUS_DTV_PLATFORM >= 3
318#include "nexus_panel_output.h"
319#include "nexus_component_input.h"
320#if (BCHP_CHIP==35233)
321/* There is no svideo input on the 35233 */
322#else
323#include "nexus_svideo_input.h"
324#endif
325#include "nexus_composite_input.h"
326#include "nexus_pc_input.h"
327#include "nexus_analog_audio_input.h"
328#include "nexus_scart_input.h"
329#endif
330
331#ifdef __cplusplus
332extern "C"
333{
334#endif
335
336/***************************************************************************
337Summary:
338Get settings that were passed into NEXUS_Platform_Init along with modifications
339made by Nexus. Be aware this is a different meaning of GetSettings than the
340standard definition.
341
342Description:
343For some settings, 0 means that Nexus should select a default. NEXUS_Platform_GetSettings will
344not return that 0 but will return the default that was chosen. In this sense, this
345function works more like GetStatus.
346***************************************************************************/
347void NEXUS_Platform_GetSettings(
348    NEXUS_PlatformSettings *pSettings /* [out] */
349    );
350
351/***************************************************************************
352Summary:
353Broadcom reference platform configuration
354
355Description:
356The broadcom reference platforms will open board-specific handles
357and place the handles in this structure for use by the application.
358***************************************************************************/
359typedef struct NEXUS_PlatformConfiguration {
360#if NEXUS_NUM_I2C_CHANNELS
361    NEXUS_I2cHandle i2c[NEXUS_NUM_I2C_CHANNELS];
362#endif
363#if NEXUS_MAX_FRONTENDS
364    NEXUS_FrontendHandle frontend[NEXUS_MAX_FRONTENDS];
365#endif
366
367    struct {
368#if NEXUS_NUM_COMPONENT_OUTPUTS
369        NEXUS_ComponentOutputHandle component[NEXUS_NUM_COMPONENT_OUTPUTS];
370#endif
371#if NEXUS_NUM_COMPOSITE_OUTPUTS
372        NEXUS_CompositeOutputHandle composite[NEXUS_NUM_COMPOSITE_OUTPUTS];
373#endif
374#if NEXUS_NUM_RFM_OUTPUTS
375        NEXUS_RfmHandle rfm[NEXUS_NUM_RFM_OUTPUTS];
376#endif
377#if NEXUS_NUM_SVIDEO_OUTPUTS
378        NEXUS_SvideoOutputHandle svideo[NEXUS_NUM_SVIDEO_OUTPUTS];
379#endif
380#if NEXUS_NUM_AUDIO_DACS
381        NEXUS_AudioDacHandle audioDacs[NEXUS_NUM_AUDIO_DACS];
382#endif
383#if NEXUS_NUM_AUDIO_DUMMY_OUTPUTS
384        NEXUS_AudioDummyOutputHandle audioDummy[NEXUS_NUM_AUDIO_DUMMY_OUTPUTS];
385#endif
386#if NEXUS_NUM_PANEL_OUTPUTS
387        NEXUS_PanelOutputHandle panel[NEXUS_NUM_PANEL_OUTPUTS];
388        NEXUS_PwmChannelHandle panelPwm[NEXUS_NUM_PANEL_OUTPUTS]; /* pwm channel used for each panel */
389        NEXUS_GpioHandle gpio[NEXUS_NUM_GPIO_PINS];
390#endif
391#if NEXUS_NUM_SPDIF_OUTPUTS
392        NEXUS_SpdifOutputHandle spdif[NEXUS_NUM_SPDIF_OUTPUTS];
393#endif
394#if NEXUS_NUM_I2S_OUTPUTS
395        NEXUS_I2sOutputHandle i2s[NEXUS_NUM_I2S_OUTPUTS];
396#endif
397#if NEXUS_NUM_I2S_MULTI_OUTPUTS
398        NEXUS_I2sMultiOutputHandle i2sMulti[NEXUS_NUM_I2S_MULTI_OUTPUTS];
399#endif
400#if NEXUS_NUM_HDMI_OUTPUTS
401        NEXUS_HdmiOutputHandle hdmi[NEXUS_NUM_HDMI_OUTPUTS];
402#endif
403#if NEXUS_NUM_HDMI_DVO
404        NEXUS_HdmiDvoHandle hdmiDvo[NEXUS_NUM_HDMI_DVO];
405#endif
406#if NEXUS_HAS_CEC
407                NEXUS_CecHandle cec[NEXUS_NUM_CEC];
408#endif
409#if NEXUS_NUM_656_OUTPUTS
410        NEXUS_Ccir656OutputHandle ccir656[NEXUS_NUM_656_OUTPUTS];
411#endif
412        int dummy; /* always have dummy to avoid warnings if there are no inputs */
413    } outputs;
414
415    struct {
416#if NEXUS_NUM_COMPONENT_INPUTS
417        NEXUS_ComponentInputHandle component[NEXUS_NUM_COMPONENT_INPUTS];
418    #if NEXUS_NUM_ANALOG_AUDIO_DECODERS
419        NEXUS_AnalogAudioInputHandle componentAudio[NEXUS_NUM_COMPONENT_INPUTS];
420    #endif
421#endif
422#if NEXUS_NUM_SVIDEO_INPUTS
423        NEXUS_SvideoInputHandle svideo[NEXUS_NUM_SVIDEO_INPUTS];
424    #if NEXUS_NUM_ANALOG_AUDIO_DECODERS
425        NEXUS_AnalogAudioInputHandle svideoAudio[NEXUS_NUM_SVIDEO_INPUTS];
426    #endif
427#endif
428#if NEXUS_NUM_COMPOSITE_INPUTS
429        NEXUS_CompositeInputHandle composite[NEXUS_NUM_COMPOSITE_INPUTS];
430    #if NEXUS_NUM_ANALOG_AUDIO_DECODERS
431        NEXUS_AnalogAudioInputHandle compositeAudio[NEXUS_NUM_COMPOSITE_INPUTS];
432    #endif
433#endif
434#if NEXUS_NUM_PC_INPUTS
435        NEXUS_PcInputHandle pc[NEXUS_NUM_PC_INPUTS];
436    #if NEXUS_NUM_ANALOG_AUDIO_DECODERS
437        NEXUS_AnalogAudioInputHandle pcAudio[NEXUS_NUM_PC_INPUTS];
438    #endif
439#endif
440#if NEXUS_NUM_SCART_INPUTS
441        NEXUS_ScartInputHandle scart[NEXUS_NUM_SCART_INPUTS];
442    #if NEXUS_NUM_ANALOG_AUDIO_DECODERS
443        NEXUS_AnalogAudioInputHandle scartAudio[NEXUS_NUM_SCART_INPUTS];
444    #endif
445#endif
446        int dummy; /* always have dummy to avoid warnings if there are no inputs */
447    } inputs;
448
449    struct {
450        NEXUS_VideoFormat maxOutputFormat; /* maximum supported video output format */
451        NEXUS_VideoFormat maxOutputFormatSd; /* maximum supported standard definition video output format */
452    } video;
453
454#if NEXUS_NUM_DISPLAYS
455    bool supportedDisplay[NEXUS_NUM_DISPLAYS]; /* report which displays can be opened */
456#endif
457    unsigned numWindowsPerDisplay; /* 1 = main only, 2 = PIP-capable */
458
459#if NEXUS_NUM_VIDEO_DECODERS
460    bool supportedDecoder[NEXUS_NUM_VIDEO_DECODERS]; /* This refers to regular decoders, not mosaic decoders. */
461#endif
462
463    NEXUS_HeapHandle heap[NEXUS_MAX_HEAPS];
464} NEXUS_PlatformConfiguration;
465
466/***************************************************************************
467Summary:
468Get configured handles from the platform layer
469
470Description:
471The reference nexus platform code will initialize board-specific handles
472based upon settings provided to NEXUS_Platform_Init().  Those handles
473may be retrieved by an application via this funciton.
474
475See Also:
476NEXUS_Platform_Init
477***************************************************************************/
478void NEXUS_Platform_GetConfiguration(
479    NEXUS_PlatformConfiguration *pConfiguration /* [out] */
480    );
481
482
483/***************************************************************************
484Summary:
485Get the input band for a streamer.
486
487Description:
488The assignment of streamer input to input band depends on board layout and possibly FPGA routing.
489If FPGA configuration is required for your platform to achieve this routing, you must set openI2c
490and openFpga to be true in NEXUS_PlatformSettings.
491 ***************************************************************************/
492NEXUS_Error NEXUS_Platform_GetStreamerInputBand(
493    unsigned index, /* index of the streamer input */
494    NEXUS_InputBand *pInputBand /* [out] */
495    );
496
497/***************************************************************************
498Summary:
499Initialize the frontend if NEXUS_PlatformSettings.openFrontend = false.
500
501Description:
502If NEXUS_PlatformSettings.openFrontend = true (which is default), then NEXUS_Platform_Init
503will call NEXUS_Platform_InitFrontend automatically. For faster system boot time, you can
504set openFrontend = false and then call NEXUS_Platform_InitFrontend after the system has achieved
505some baseline state (e.g. after the app has put graphics on the screen).
506***************************************************************************/
507NEXUS_Error NEXUS_Platform_InitFrontend(void);
508
509#if !NEXUS_HAS_FRONTEND
510typedef void *NEXUS_FrontendHandle;
511#endif
512/***************************************************************************
513Summary:
514Initialize a particular frontend.
515
516Description:
517This will create and initialize the specified frontend.
518Use NEXUS_Platform_UninitFrontend to uninit the frontend along with any others
519that have been created.
520***************************************************************************/
521NEXUS_FrontendHandle NEXUS_Platform_OpenFrontend(
522    unsigned id /* platform assigned ID for this frontend. See NEXUS_FrontendUserParameters.id.
523                   See nexus_platform_frontend.c for ID assignment and/or see
524                   nexus_platform_features.h for possible platform-specific macros.
525                */
526    );
527
528/***************************************************************************
529Summary:
530Uninitialize all frontends.
531
532Description:
533This will uninit whatever was created by NEXUS_Platform_OpenFrontend,
534NEXUS_Platform_InitFrontend, or NEXUS_Platform_Init.
535NEXUS_Platform_UninitFrontend is called automatically by NEXUS_Platform_Uninit.
536***************************************************************************/
537void NEXUS_Platform_UninitFrontend(void);
538
539/***************************************************************************
540Summary:
541Get the current reference software release version.
542***************************************************************************/
543void NEXUS_Platform_GetReleaseVersion( /* attr{local=true} */
544    char *pVersionString, /* [out] returns a NULL-terminated string <= size */
545    unsigned size /* maximum size data written to pVersionString, including null terminator */
546    );
547
548/***************************************************************************
549Summary:
550Platform status and general information
551***************************************************************************/
552typedef struct NEXUS_PlatformStatus
553{
554    uint16_t chipId; /* main chip, in hex, e.g. 0x7405 */
555    uint16_t chipRevision; /* main chip, in hex, e.g. 0x0010 = A0, 0x0021 = B1 */
556} NEXUS_PlatformStatus;
557
558/***************************************************************************
559Summary:
560Get platform status
561***************************************************************************/
562NEXUS_Error NEXUS_Platform_GetStatus(
563    NEXUS_PlatformStatus *pStatus /* [out] */
564    );
565
566/***************************************************************************
567Summary:
568Read a register
569
570Description:
571This function is provided for special cases and is not generally supported. Indiscriminate use will result in system failure.
572It requires the application to know the register map, usually by including RDB header files.
573
574Nexus will add the memory-mapped base pointer for register space. This means you can use RDB register addresses directly.
575***************************************************************************/
576NEXUS_Error NEXUS_Platform_ReadRegister(
577    uint32_t address,
578    uint32_t *pValue /* [out] */
579    );
580
581/***************************************************************************
582Summary:
583Write a register
584
585Description:
586This function is provided for special cases and is not generally supported. Indiscriminate use will result in system failure.
587It requires the application to know the register map, usually by including RDB header files.
588***************************************************************************/
589void NEXUS_Platform_WriteRegister(
590    uint32_t address,
591    uint32_t value
592    );
593
594/***************************************************************************
595Summary:
596Returns heap that is accessible by GFD HW block for the specified display.
597If you use this heap in your framebuffer's NEXUS_SurfaceCreateSettings.heap, the GFD will be able to read from it.
598
599Description:
600If you pass NEXUS_OFFSCREEN_SURFACE, the function will return a default heap for off-screen surface allocation.
601This is provided as a convenience for multi-platform graphics applications.
602***************************************************************************/
603NEXUS_HeapHandle NEXUS_Platform_GetFramebufferHeap(
604    unsigned displayIndex
605    );
606#define NEXUS_OFFSCREEN_SURFACE ((unsigned)-1)
607
608
609/**
610Summary:
611Settings for NEXUS_Platform_CreateHeap
612**/
613typedef struct NEXUS_PlatformCreateHeapSettings
614{
615    unsigned offset; /* physical address */
616    unsigned size; /* in bytes */
617    NEXUS_MemoryType memoryType; /* requested memory mapping */
618    unsigned alignment; /* required alignment (in bytes) of allocations in this region */
619    bool locked; /* if true, nexus is not allowed to allocate from this heap */
620    void *userAddress; /* if set, use this instead of doing an internal mmap for NEXUS_MemoryType_eApplication. */
621} NEXUS_PlatformCreateHeapSettings;
622
623/**
624Summary:
625Get default settings for NEXUS_Platform_CreateHeap
626**/
627void NEXUS_Platform_GetDefaultCreateHeapSettings(
628    NEXUS_PlatformCreateHeapSettings *pSettings /* [out] */
629    );
630
631/**
632Summary:
633Create a heap at runtime which is outside of all existing nexus heaps.
634
635Description:
636A system may have memory which nexus is not given access to at NEXUS_Platform_Init.
637NEXUS_Platform_CreateHeap can create a heap on that memory.
638There must be no overlap in offset or virtual address space with existing heaps.
639**/
640NEXUS_HeapHandle NEXUS_Platform_CreateHeap(
641    const NEXUS_PlatformCreateHeapSettings *pSettings
642    );
643
644/**
645Summary:
646Destroy a heap created by NEXUS_Platform_CreateHeap
647**/
648void NEXUS_Platform_DestroyHeap(
649    NEXUS_HeapHandle heap
650    );
651
652#if !NEXUS_HAS_I2C
653typedef void *NEXUS_I2cHandle;
654#endif
655
656/**
657Summary:
658Acquire an I2C handle that was opened by platform
659Description:
660If any client specified that platform should open I2C devices, then all clients
661must use these functions to manage their usage of said devices.
662**/
663NEXUS_Error NEXUS_Platform_AcquireI2c(
664    NEXUS_I2cHandle i2c
665    );
666
667/**
668Summary:
669Release an I2C handle that was opened by platform
670Description:
671If any client specified that platform should open I2C devices, then all clients
672must use these functions to manage their usage of said devices.
673**/
674void NEXUS_Platform_ReleaseI2c(
675    NEXUS_I2cHandle i2c
676    );
677
678/**
679Summary:
680Acquire a frontend handle that was opened by platform
681Description:
682If any client specified that platform should open frontend devices, then all clients
683must use these functions to manage their usage of said devices.
684**/
685NEXUS_Error NEXUS_Platform_AcquireFrontend(
686    NEXUS_FrontendHandle frontend
687    );
688
689/**
690Summary:
691Release a frontend handle that was opened by platform
692Description:
693If any client specified that platform should open frontend devices, then all clients
694must use these functions to manage their usage of said devices.
695**/
696void NEXUS_Platform_ReleaseFrontend(
697    NEXUS_FrontendHandle frontend
698    );
699
700#ifdef __cplusplus
701} /* extern "C" */
702#endif
703
704#endif /* #ifndef NEXUS_PLATFORM_H__ */
705
Note: See TracBrowser for help on using the repository browser.