1 /***************************************************************************
2 * Copyright (c) 2005-2009, Broadcom Corporation.
4 * Name: crystalhd_fw_if . h
7 * BCM70012 Firmware interface definitions.
11 **********************************************************************
12 * This file is part of the crystalhd device driver.
14 * This driver is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation, version 2 of the License.
18 * This driver is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
23 * You should have received a copy of the GNU General Public License
24 * along with this driver. If not, see <http://www.gnu.org/licenses/>.
25 **********************************************************************/
27 #ifndef _CRYSTALHD_FW_IF_H_
28 #define _CRYSTALHD_FW_IF_H_
30 /* TBD: Pull in only required defs into this file.. */
34 /* User Data Header */
35 typedef struct user_data
{
36 struct user_data
*next
;
43 /*------------------------------------------------------*
44 * MPEG Extension to the PPB *
45 *------------------------------------------------------*/
47 uint32_t to_be_defined
;
50 /* Always valid, defaults to picture size if no
51 sequence display extension in the stream. */
52 uint32_t display_horizontal_size
;
53 uint32_t display_vertical_size
;
56 Offsets are a copy values from the MPEG stream. */
57 uint32_t offset_count
;
58 int32_t horizontal_offset
[3];
59 int32_t vertical_offset
[3];
61 /* MPEG_VALID_USERDATA
62 User data is in the form of a linked list. */
69 /*------------------------------------------------------*
70 * VC1 Extension to the PPB *
71 *------------------------------------------------------*/
73 uint32_t to_be_defined
;
76 /* Always valid, defaults to picture size if no
77 sequence display extension in the stream. */
78 uint32_t display_horizontal_size
;
79 uint32_t display_vertical_size
;
81 /* VC1 pan scan windows */
82 uint32_t num_panscan_windows
;
83 int32_t ps_horiz_offset
[4];
84 int32_t ps_vert_offset
[4];
89 User data is in the form of a linked list. */
95 /*------------------------------------------------------*
96 * H.264 Extension to the PPB *
97 *------------------------------------------------------*/
100 * @brief Film grain SEI message.
102 * Content of the film grain SEI message.
105 /* maximum number of model-values as for Thomson spec(standard says 5) */
106 #define MAX_FGT_MODEL_VALUE (3)
108 /* maximum number of intervals(as many as 256 intervals?) */
109 #define MAX_FGT_VALUE_INTERVAL (256)
111 typedef struct FGT_SEI
{
112 struct FGT_SEI
*next
;
113 unsigned char model_values
[3][MAX_FGT_VALUE_INTERVAL
][MAX_FGT_MODEL_VALUE
];
114 unsigned char upper_bound
[3][MAX_FGT_VALUE_INTERVAL
];
115 unsigned char lower_bound
[3][MAX_FGT_VALUE_INTERVAL
];
117 unsigned char cancel_flag
; /* Cancel flag: 1 no film grain. */
118 unsigned char model_id
; /* Model id. */
120 /* +unused SE based on Thomson spec */
121 unsigned char color_desc_flag
; /* Separate color descrition flag. */
122 unsigned char bit_depth_luma
; /* Bit depth luma minus 8. */
123 unsigned char bit_depth_chroma
; /* Bit depth chroma minus 8. */
124 unsigned char full_range_flag
; /* Full range flag. */
125 unsigned char color_primaries
; /* Color primaries. */
126 unsigned char transfer_charact
; /* Transfer characteristics. */
127 unsigned char matrix_coeff
; /*< Matrix coefficients. */
128 /* -unused SE based on Thomson spec */
130 unsigned char blending_mode_id
; /* Blending mode. */
131 unsigned char log2_scale_factor
; /* Log2 scale factor (2-7). */
132 unsigned char comp_flag
[3]; /* Components [0,2] parameters present flag. */
133 unsigned char num_intervals_minus1
[3]; /* Number of intensity level intervals. */
134 unsigned char num_model_values
[3]; /* Number of model values. */
135 uint16_t repetition_period
; /* Repetition period (0-16384) */
140 /* 'valid' specifies which fields (or sets of
141 * fields) below are valid. If the corresponding
142 * bit in 'valid' is NOT set then that field(s)
143 * is (are) not initialized. */
146 int32_t poc_top
; /* POC for Top Field/Frame */
147 int32_t poc_bottom
; /* POC for Bottom Field */
150 /* H264_VALID_PANSCAN */
151 uint32_t pan_scan_count
;
152 int32_t pan_scan_left
[3];
153 int32_t pan_scan_right
[3];
154 int32_t pan_scan_top
[3];
155 int32_t pan_scan_bottom
[3];
157 /* H264_VALID_CT_TYPE */
158 uint32_t ct_type_count
;
161 /* H264_VALID_SPS_CROP */
162 int32_t sps_crop_left
;
163 int32_t sps_crop_right
;
164 int32_t sps_crop_top
;
165 int32_t sps_crop_bottom
;
169 uint32_t chroma_bottom
;
171 /* H264_VALID_USER */
172 uint32_t user_data_size
;
182 uint32_t picture_number
; /* Ordinal display number */
183 uint32_t video_buffer
; /* Video (picbuf) number */
184 uint32_t video_address
; /* Address of picbuf Y */
185 uint32_t video_address_uv
; /* Address of picbuf UV */
186 uint32_t video_stripe
; /* Picbuf stripe */
187 uint32_t video_width
; /* Picbuf width */
188 uint32_t video_height
; /* Picbuf height */
190 uint32_t channel_id
; /* Decoder channel ID */
191 uint32_t status
; /* reserved */
192 uint32_t width
; /* pixels */
193 uint32_t height
; /* pixels */
194 uint32_t chroma_format
; /* see above */
195 uint32_t pulldown
; /* see above */
196 uint32_t flags
; /* see above */
197 uint32_t pts
; /* 32 LSBs of PTS */
198 uint32_t protocol
; /* protocolXXX (above) */
200 uint32_t frame_rate
; /* see above */
201 uint32_t matrix_coeff
; /* see above */
202 uint32_t aspect_ratio
; /* see above */
203 uint32_t colour_primaries
; /* see above */
204 uint32_t transfer_char
; /* see above */
205 uint32_t pcr_offset
; /* 45kHz if PCR type; else 27MHz */
206 uint32_t n_drop
; /* Number of pictures to be dropped */
208 uint32_t custom_aspect_ratio_width_height
;
209 /* upper 16-bits is Y and lower 16-bits is X */
211 uint32_t picture_tag
; /* Indexing tag from BUD packets */
212 uint32_t picture_done_payload
;
213 uint32_t picture_meta_payload
;
214 uint32_t reserved
[1];
216 /* Protocol-specific extensions. */
226 uint32_t bFormatChange
;
230 int32_t ptsStcOffset
;
231 uint32_t zeroPanscanValid
;
232 uint32_t dramOutBufAddr
;
246 uint32_t picInfoDeliveryQ
;
247 uint32_t picInfoReleaseQ
;
248 uint32_t channelStatus
;
249 uint32_t userDataDeliveryQ
;
250 uint32_t userDataReleaseQ
;
251 uint32_t transportStreamCaptureAddr
;
252 uint32_t asyncEventQ
;
254 } DecRspChannelStartVideo
;
256 #define eCMD_C011_CMD_BASE (0x73763000)
260 eCMD_TS_GET_NEXT_PIC
= 0x7376F100, /* debug get next picture */
261 eCMD_TS_GET_LAST_PIC
= 0x7376F102, /* debug get last pic status */
262 eCMD_TS_READ_WRITE_MEM
= 0x7376F104, /* debug read write memory */
264 /* New API commands */
265 /* General commands */
266 eCMD_C011_INIT
= eCMD_C011_CMD_BASE
+ 0x01,
267 eCMD_C011_RESET
= eCMD_C011_CMD_BASE
+ 0x02,
268 eCMD_C011_SELF_TEST
= eCMD_C011_CMD_BASE
+ 0x03,
269 eCMD_C011_GET_VERSION
= eCMD_C011_CMD_BASE
+ 0x04,
270 eCMD_C011_GPIO
= eCMD_C011_CMD_BASE
+ 0x05,
271 eCMD_C011_DEBUG_SETUP
= eCMD_C011_CMD_BASE
+ 0x06,
273 /* Decoding commands */
274 eCMD_C011_DEC_CHAN_OPEN
= eCMD_C011_CMD_BASE
+ 0x100,
275 eCMD_C011_DEC_CHAN_CLOSE
= eCMD_C011_CMD_BASE
+ 0x101,
276 eCMD_C011_DEC_CHAN_ACTIVATE
= eCMD_C011_CMD_BASE
+ 0x102,
277 eCMD_C011_DEC_CHAN_STATUS
= eCMD_C011_CMD_BASE
+ 0x103,
278 eCMD_C011_DEC_CHAN_FLUSH
= eCMD_C011_CMD_BASE
+ 0x104,
279 eCMD_C011_DEC_CHAN_TRICK_PLAY
= eCMD_C011_CMD_BASE
+ 0x105,
280 eCMD_C011_DEC_CHAN_TS_PIDS
= eCMD_C011_CMD_BASE
+ 0x106,
281 eCMD_C011_DEC_CHAN_PS_STREAM_ID
= eCMD_C011_CMD_BASE
+ 0x107,
282 eCMD_C011_DEC_CHAN_INPUT_PARAMS
= eCMD_C011_CMD_BASE
+ 0x108,
283 eCMD_C011_DEC_CHAN_VIDEO_OUTPUT
= eCMD_C011_CMD_BASE
+ 0x109,
284 eCMD_C011_DEC_CHAN_OUTPUT_FORMAT
= eCMD_C011_CMD_BASE
+ 0x10A,
285 eCMD_C011_DEC_CHAN_SCALING_FILTERS
= eCMD_C011_CMD_BASE
+ 0x10B,
286 eCMD_C011_DEC_CHAN_OSD_MODE
= eCMD_C011_CMD_BASE
+ 0x10D,
287 eCMD_C011_DEC_CHAN_DROP
= eCMD_C011_CMD_BASE
+ 0x10E,
288 eCMD_C011_DEC_CHAN_RELEASE
= eCMD_C011_CMD_BASE
+ 0x10F,
289 eCMD_C011_DEC_CHAN_STREAM_SETTINGS
= eCMD_C011_CMD_BASE
+ 0x110,
290 eCMD_C011_DEC_CHAN_PAUSE_OUTPUT
= eCMD_C011_CMD_BASE
+ 0x111,
291 eCMD_C011_DEC_CHAN_CHANGE
= eCMD_C011_CMD_BASE
+ 0x112,
292 eCMD_C011_DEC_CHAN_SET_STC
= eCMD_C011_CMD_BASE
+ 0x113,
293 eCMD_C011_DEC_CHAN_SET_PTS
= eCMD_C011_CMD_BASE
+ 0x114,
294 eCMD_C011_DEC_CHAN_CC_MODE
= eCMD_C011_CMD_BASE
+ 0x115,
295 eCMD_C011_DEC_CREATE_AUDIO_CONTEXT
= eCMD_C011_CMD_BASE
+ 0x116,
296 eCMD_C011_DEC_COPY_AUDIO_CONTEXT
= eCMD_C011_CMD_BASE
+ 0x117,
297 eCMD_C011_DEC_DELETE_AUDIO_CONTEXT
= eCMD_C011_CMD_BASE
+ 0x118,
298 eCMD_C011_DEC_CHAN_SET_DECYPTION
= eCMD_C011_CMD_BASE
+ 0x119,
299 eCMD_C011_DEC_CHAN_START_VIDEO
= eCMD_C011_CMD_BASE
+ 0x11A,
300 eCMD_C011_DEC_CHAN_STOP_VIDEO
= eCMD_C011_CMD_BASE
+ 0x11B,
301 eCMD_C011_DEC_CHAN_PIC_CAPTURE
= eCMD_C011_CMD_BASE
+ 0x11C,
302 eCMD_C011_DEC_CHAN_PAUSE
= eCMD_C011_CMD_BASE
+ 0x11D,
303 eCMD_C011_DEC_CHAN_PAUSE_STATE
= eCMD_C011_CMD_BASE
+ 0x11E,
304 eCMD_C011_DEC_CHAN_SET_SLOWM_RATE
= eCMD_C011_CMD_BASE
+ 0x11F,
305 eCMD_C011_DEC_CHAN_GET_SLOWM_RATE
= eCMD_C011_CMD_BASE
+ 0x120,
306 eCMD_C011_DEC_CHAN_SET_FF_RATE
= eCMD_C011_CMD_BASE
+ 0x121,
307 eCMD_C011_DEC_CHAN_GET_FF_RATE
= eCMD_C011_CMD_BASE
+ 0x122,
308 eCMD_C011_DEC_CHAN_FRAME_ADVANCE
= eCMD_C011_CMD_BASE
+ 0x123,
309 eCMD_C011_DEC_CHAN_SET_SKIP_PIC_MODE
= eCMD_C011_CMD_BASE
+ 0x124,
310 eCMD_C011_DEC_CHAN_GET_SKIP_PIC_MODE
= eCMD_C011_CMD_BASE
+ 0x125,
311 eCMD_C011_DEC_CHAN_FILL_PIC_BUF
= eCMD_C011_CMD_BASE
+ 0x126,
312 eCMD_C011_DEC_CHAN_SET_CONTINUITY_CHECK
= eCMD_C011_CMD_BASE
+ 0x127,
313 eCMD_C011_DEC_CHAN_GET_CONTINUITY_CHECK
= eCMD_C011_CMD_BASE
+ 0x128,
314 eCMD_C011_DEC_CHAN_SET_BRCM_TRICK_MODE
= eCMD_C011_CMD_BASE
+ 0x129,
315 eCMD_C011_DEC_CHAN_GET_BRCM_TRICK_MODE
= eCMD_C011_CMD_BASE
+ 0x12A,
316 eCMD_C011_DEC_CHAN_REVERSE_FIELD_STATUS
= eCMD_C011_CMD_BASE
+ 0x12B,
317 eCMD_C011_DEC_CHAN_I_PICTURE_FOUND
= eCMD_C011_CMD_BASE
+ 0x12C,
318 eCMD_C011_DEC_CHAN_SET_PARAMETER
= eCMD_C011_CMD_BASE
+ 0x12D,
319 eCMD_C011_DEC_CHAN_SET_USER_DATA_MODE
= eCMD_C011_CMD_BASE
+ 0x12E,
320 eCMD_C011_DEC_CHAN_SET_PAUSE_DISPLAY_MODE
= eCMD_C011_CMD_BASE
+ 0x12F,
321 eCMD_C011_DEC_CHAN_SET_SLOW_DISPLAY_MODE
= eCMD_C011_CMD_BASE
+ 0x130,
322 eCMD_C011_DEC_CHAN_SET_FF_DISPLAY_MODE
= eCMD_C011_CMD_BASE
+ 0x131,
323 eCMD_C011_DEC_CHAN_SET_DISPLAY_TIMING_MODE
= eCMD_C011_CMD_BASE
+ 0x132,
324 eCMD_C011_DEC_CHAN_SET_DISPLAY_MODE
= eCMD_C011_CMD_BASE
+ 0x133,
325 eCMD_C011_DEC_CHAN_GET_DISPLAY_MODE
= eCMD_C011_CMD_BASE
+ 0x134,
326 eCMD_C011_DEC_CHAN_SET_REVERSE_FIELD
= eCMD_C011_CMD_BASE
+ 0x135,
327 eCMD_C011_DEC_CHAN_STREAM_OPEN
= eCMD_C011_CMD_BASE
+ 0x136,
328 eCMD_C011_DEC_CHAN_SET_PCR_PID
= eCMD_C011_CMD_BASE
+ 0x137,
329 eCMD_C011_DEC_CHAN_SET_VID_PID
= eCMD_C011_CMD_BASE
+ 0x138,
330 eCMD_C011_DEC_CHAN_SET_PAN_SCAN_MODE
= eCMD_C011_CMD_BASE
+ 0x139,
331 eCMD_C011_DEC_CHAN_START_DISPLAY_AT_PTS
= eCMD_C011_CMD_BASE
+ 0x140,
332 eCMD_C011_DEC_CHAN_STOP_DISPLAY_AT_PTS
= eCMD_C011_CMD_BASE
+ 0x141,
333 eCMD_C011_DEC_CHAN_SET_DISPLAY_ORDER
= eCMD_C011_CMD_BASE
+ 0x142,
334 eCMD_C011_DEC_CHAN_GET_DISPLAY_ORDER
= eCMD_C011_CMD_BASE
+ 0x143,
335 eCMD_C011_DEC_CHAN_SET_HOST_TRICK_MODE
= eCMD_C011_CMD_BASE
+ 0x144,
336 eCMD_C011_DEC_CHAN_SET_OPERATION_MODE
= eCMD_C011_CMD_BASE
+ 0x145,
337 eCMD_C011_DEC_CHAN_DISPLAY_PAUSE_UNTO_PTS
= eCMD_C011_CMD_BASE
+ 0x146,
338 eCMD_C011_DEC_CHAN_SET_PTS_STC_DIFF_THRESHOLD
= eCMD_C011_CMD_BASE
+ 0x147,
339 eCMD_C011_DEC_CHAN_SEND_COMPRESSED_BUF
= eCMD_C011_CMD_BASE
+ 0x148,
340 eCMD_C011_DEC_CHAN_SET_CLIPPING
= eCMD_C011_CMD_BASE
+ 0x149,
341 eCMD_C011_DEC_CHAN_SET_PARAMETERS_FOR_HARD_RESET_INTERRUPT_TO_HOST
342 = eCMD_C011_CMD_BASE
+ 0x150,
344 /* Decoder RevD commands */
345 eCMD_C011_DEC_CHAN_SET_CSC
= eCMD_C011_CMD_BASE
+ 0x180, /* color space conversion */
346 eCMD_C011_DEC_CHAN_SET_RANGE_REMAP
= eCMD_C011_CMD_BASE
+ 0x181,
347 eCMD_C011_DEC_CHAN_SET_FGT
= eCMD_C011_CMD_BASE
+ 0x182,
348 /* Note: 0x183 not implemented yet in Rev D main */
349 eCMD_C011_DEC_CHAN_SET_LASTPICTURE_PADDING
= eCMD_C011_CMD_BASE
+ 0x183,
351 /* Decoder 7412 commands (7412-only) */
352 eCMD_C011_DEC_CHAN_SET_CONTENT_KEY
= eCMD_C011_CMD_BASE
+ 0x190,
353 eCMD_C011_DEC_CHAN_SET_SESSION_KEY
= eCMD_C011_CMD_BASE
+ 0x191,
354 eCMD_C011_DEC_CHAN_FMT_CHANGE_ACK
= eCMD_C011_CMD_BASE
+ 0x192,
356 eCMD_C011_DEC_CHAN_CUSTOM_VIDOUT
= eCMD_C011_CMD_BASE
+ 0x1FF,
358 /* Encoding commands */
359 eCMD_C011_ENC_CHAN_OPEN
= eCMD_C011_CMD_BASE
+ 0x200,
360 eCMD_C011_ENC_CHAN_CLOSE
= eCMD_C011_CMD_BASE
+ 0x201,
361 eCMD_C011_ENC_CHAN_ACTIVATE
= eCMD_C011_CMD_BASE
+ 0x202,
362 eCMD_C011_ENC_CHAN_CONTROL
= eCMD_C011_CMD_BASE
+ 0x203,
363 eCMD_C011_ENC_CHAN_STATISTICS
= eCMD_C011_CMD_BASE
+ 0x204,
365 eNOTIFY_C011_ENC_CHAN_EVENT
= eCMD_C011_CMD_BASE
+ 0x210,