summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsvccamerajenkins <svccamerajenkins@nvidia.com>2018-07-03 19:41:29 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2018-07-04 17:03:57 -0400
commit063a64423885d6d65d2513492d782269eb80e03e (patch)
tree9d65c6149ef6f0c3e73c547800dd620ebfca4622
parent54539e98f9d1d7215cc6432bbf398f76a64e9c08 (diff)
tegra: camera: rtcpu: update firmware api headers
tag b5e08441a70fd2d09ae93942363d63295fce18de rtcpu@634a51f aeec1f0 capture: implement VI channel error actions c1607e4 rtcpu: misc MISRA fixes 3914405 isp5: Add error recovery and notification support b3af7ae rtcpu: Add task number and priority to task stats 63f5e50 t194: Remove deprecated downscaler params d81a4a3 rce: improve boot protocol message validation Bug 2047639 Bug 2109186 Jira CAMASIL-212 Jira CAMC-599 Jira CP-1445 Change-Id: I45e0bfaa151f0d53bacb4ab305873a11c7c06a3a Signed-off-by: svccamerajenkins <svccamerajenkins@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1769913 GVS: Gerrit_Virtual_Submit Tested-by: Mika Liljeberg <mliljeberg@nvidia.com> Reviewed-by: Mika Liljeberg <mliljeberg@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
-rw-r--r--include/soc/tegra/camrtc-capture.h107
-rw-r--r--include/soc/tegra/camrtc-channels.h9
-rw-r--r--include/soc/tegra/camrtc-dbg-messages.h12
-rw-r--r--include/soc/tegra/camrtc-trace.h17
4 files changed, 111 insertions, 34 deletions
diff --git a/include/soc/tegra/camrtc-capture.h b/include/soc/tegra/camrtc-capture.h
index 44a237303..117da55e1 100644
--- a/include/soc/tegra/camrtc-capture.h
+++ b/include/soc/tegra/camrtc-capture.h
@@ -150,6 +150,13 @@ typedef struct syncpoint_info {
150 * <dt>ISPB: <dd>Channel outputs to ISPB 150 * <dt>ISPB: <dd>Channel outputs to ISPB
151 * <dt>ISP_DIRECT: <dd>Channel outputs directly to selected ISP (ISO mode) 151 * <dt>ISP_DIRECT: <dd>Channel outputs directly to selected ISP (ISO mode)
152 * <dt>ISPSW: <dd>Channel outputs to software ISP (reserved) 152 * <dt>ISPSW: <dd>Channel outputs to software ISP (reserved)
153 * <dt>ENABLE_ERROR_ACTIONS_MASKS: <dd>Channel handles errors according to
154 * error_mask_correctable and error_mask_uncorrectable.
155 * This flag take precedence over RESET_ON_ERROR.
156 * <dt>RESET_ON_ERROR: <dd>Channel treats all errors as uncorrectable
157 * and requires reset for recovery. This flag is ignored if
158 * ENABLE_ERROR_ACTIONS_MASKS is set.
159 *
153 * </dl> 160 * </dl>
154 * 161 *
155 * @param vi_channel_mask A bit mask indicating which VI channels to 162 * @param vi_channel_mask A bit mask indicating which VI channels to
@@ -174,6 +181,7 @@ struct capture_channel_config {
174#define CAPTURE_CHANNEL_FLAG_RESET_ON_ERROR U32_C(0x0800) 181#define CAPTURE_CHANNEL_FLAG_RESET_ON_ERROR U32_C(0x0800)
175#define CAPTURE_CHANNEL_FLAG_LINETIMER U32_C(0x1000) 182#define CAPTURE_CHANNEL_FLAG_LINETIMER U32_C(0x1000)
176#define CAPTURE_CHANNEL_FLAG_SLVSEC U32_C(0x2000) 183#define CAPTURE_CHANNEL_FLAG_SLVSEC U32_C(0x2000)
184#define CAPTURE_CHANNEL_FLAG_ENABLE_ERROR_ACTIONS_MASKS U32_C(0x4000)
177 185
178 uint32_t channel_id; /* rtcpu internal - set to zero */ 186 uint32_t channel_id; /* rtcpu internal - set to zero */
179 uint64_t vi_channel_mask; 187 uint64_t vi_channel_mask;
@@ -198,6 +206,35 @@ struct capture_channel_config {
198 struct syncpoint_info progress_sp; 206 struct syncpoint_info progress_sp;
199 struct syncpoint_info embdata_sp; 207 struct syncpoint_info embdata_sp;
200 struct syncpoint_info linetimer_sp; 208 struct syncpoint_info linetimer_sp;
209
210 /**
211 * Errors defined in error_mask_uncorrectable are reported and stop channel.
212 * User reset is required for channel recovery.
213 */
214 uint32_t error_mask_uncorrectable;
215 /**
216 * Errors defined in error_mask_correctable are reported, but
217 * don't stop the channel.
218 */
219 uint32_t error_mask_correctable;
220#define CAPTURE_CHANNEL_ERROR_ERROR_EMBED_INCOMPLETE (U32_C(1) << 21)
221#define CAPTURE_CHANNEL_ERROR_INCOMPLETE (U32_C(1) << 20)
222#define CAPTURE_CHANNEL_ERROR_STALE_FRAME (U32_C(1) << 19)
223#define CAPTURE_CHANNEL_ERROR_COLLISION (U32_C(1) << 18)
224#define CAPTURE_CHANNEL_ERROR_FORCE_FE (U32_C(1) << 17)
225#define CAPTURE_CHANNEL_ERROR_LOAD_FRAMED (U32_C(1) << 16)
226#define CAPTURE_CHANNEL_ERROR_DTYPE_MISMATCH (U32_C(1) << 15)
227#define CAPTURE_CHANNEL_ERROR_EMBED_INFRINGE (U32_C(1) << 14)
228#define CAPTURE_CHANNEL_ERROR_EMBED_LONG_LINE (U32_C(1) << 13)
229#define CAPTURE_CHANNEL_ERROR_EMBED_SPURIOUS (U32_C(1) << 12)
230#define CAPTURE_CHANNEL_ERROR_EMBED_RUNAWAY (U32_C(1) << 11)
231#define CAPTURE_CHANNEL_ERROR_EMBED_MISSING_LE (U32_C(1) << 10)
232#define CAPTURE_CHANNEL_ERROR_PIXEL_SHORT_LINE (U32_C(1) << 9)
233#define CAPTURE_CHANNEL_ERROR_PIXEL_LONG_LINE (U32_C(1) << 8)
234#define CAPTURE_CHANNEL_ERROR_PIXEL_SPURIOUS (U32_C(1) << 7)
235#define CAPTURE_CHANNEL_ERROR_PIXEL_RUNAWAY (U32_C(1) << 6)
236#define CAPTURE_CHANNEL_ERROR_PIXEL_MISSING_LE (U32_C(1) << 5)
237
201} __CAPTURE_IVC_ALIGN; 238} __CAPTURE_IVC_ALIGN;
202 239
203struct vi_channel_config { 240struct vi_channel_config {
@@ -340,11 +377,14 @@ struct capture_status {
340#define CAPTURE_STATUS_NOTIFIER_BACKEND_DOWN U32_C(13) 377#define CAPTURE_STATUS_NOTIFIER_BACKEND_DOWN U32_C(13)
341#define CAPTURE_STATUS_FALCON_ERROR U32_C(14) 378#define CAPTURE_STATUS_FALCON_ERROR U32_C(14)
342#define CAPTURE_STATUS_CHANSEL_NOMATCH U32_C(15) 379#define CAPTURE_STATUS_CHANSEL_NOMATCH U32_C(15)
380#define CAPTURE_STATUS_ABORTED U32_C(16)
343 381
344 uint64_t sof_timestamp; 382 uint64_t sof_timestamp;
345 uint64_t eof_timestamp; 383 uint64_t eof_timestamp;
346 uint32_t err_data; 384 uint32_t err_data;
347 uint32_t __pad; 385
386#define CAPTURE_STATUS_FLAG_CHANNEL_IN_ERROR U32_C(1)
387 uint32_t flags;
348} __CAPTURE_IVC_ALIGN; 388} __CAPTURE_IVC_ALIGN;
349 389
350#define VI_AFM_NUM_ROI 8 390#define VI_AFM_NUM_ROI 8
@@ -853,6 +893,19 @@ struct nvcsi_tpg_rate_config {
853 * 893 *
854 * @param channel_flags channel specific flags 894 * @param channel_flags channel specific flags
855 * 895 *
896 * @param error_mask_correctable: Bitmask of the errors that are treated as correctable.
897 * In case of correctable errors syncpoints of active capture are
898 * advanced (in falcon) and error is reported and capture
899 * continues.
900 *
901 * @param error_mask_uncorrectable: Bitmask of the errors that are treated as uncorrectable.
902 * In case of uncorrectable errors, syncpoints of active capture are
903 * advanced (in falcon) and isp channel is ABORTed by ISP
904 * tasklist driver which halts the captures on the channel with
905 * immediate effect, and then error is reported. Client needs
906 * to RESET the channel explicitly in reaction to the
907 * uncorrectable errors reported.
908 *
856 */ 909 */
857struct capture_channel_isp_config { 910struct capture_channel_isp_config {
858 uint8_t channel_id; 911 uint8_t channel_id;
@@ -873,6 +926,17 @@ struct capture_channel_isp_config {
873 struct syncpoint_info progress_sp; 926 struct syncpoint_info progress_sp;
874 struct syncpoint_info stats_progress_sp; 927 struct syncpoint_info stats_progress_sp;
875 928
929 /** Error action attributes */
930 uint32_t error_mask_correctable;
931 uint32_t error_mask_uncorrectable;
932
933#define CAPTURE_ISP_CHANNEL_ERROR_DMA_PBUF_ERR (U32_C(1) << 0)
934#define CAPTURE_ISP_CHANNEL_ERROR_DMA_SBUF_ERR (U32_C(1) << 1)
935#define CAPTURE_ISP_CHANNEL_ERROR_DMA_SEQ_ERR (U32_C(1) << 2)
936#define CAPTURE_ISP_CHANNEL_ERROR_FRAMEID_ERR (U32_C(1) << 3)
937#define CAPTURE_ISP_CHANNEL_ERROR_TIMEOUT (U32_C(1) << 4)
938#define CAPTURE_ISP_CHANNEL_ERROR_ALL U32_C(0x001F)
939
876#define HAVE_ISP_GOS_TABLES 940#define HAVE_ISP_GOS_TABLES
877 /* 941 /*
878 * GoS tables can only be programmed when there are no 942 * GoS tables can only be programmed when there are no
@@ -889,13 +953,13 @@ struct capture_isp_status {
889 uint8_t chan_id; 953 uint8_t chan_id;
890 uint8_t __pad; 954 uint8_t __pad;
891 uint16_t frame_id; 955 uint16_t frame_id;
892 uint32_t status; 956 uint32_t status; /** SUCCESS OR ERROR */
957 uint32_t error_mask; /** ZERO in case of SUCCESS. Error bitmask in case of ERROR */
958 uint32_t __pad2;
893 959
894#define CAPTURE_ISP_STATUS_UNKNOWN U32_C(0) 960#define CAPTURE_ISP_STATUS_UNKNOWN U32_C(0)
895#define CAPTURE_ISP_STATUS_SUCCESS U32_C(1) 961#define CAPTURE_ISP_STATUS_SUCCESS U32_C(1)
896// TODO : Further breakdown errors to sub-types, as per http://nvbugs/200336192/11
897#define CAPTURE_ISP_STATUS_ERROR U32_C(2) 962#define CAPTURE_ISP_STATUS_ERROR U32_C(2)
898/** Add error codes and data if any */
899} __CAPTURE_IVC_ALIGN; 963} __CAPTURE_IVC_ALIGN;
900 964
901 965
@@ -903,14 +967,14 @@ struct capture_isp_program_status {
903 uint8_t chan_id; 967 uint8_t chan_id;
904 uint8_t settings_id; 968 uint8_t settings_id;
905 uint16_t __pad_id; 969 uint16_t __pad_id;
906 uint32_t status; 970 uint32_t status; /** SUCCESS OR ERROR */
971 uint32_t error_mask; /** ZERO in case of SUCCESS/STALE. Error bitmask in case of ERROR */
972 uint32_t __pad2;
907 973
908#define CAPTURE_ISP_PROGRAM_STATUS_UNKNOWN U32_C(0) 974#define CAPTURE_ISP_PROGRAM_STATUS_UNKNOWN U32_C(0)
909#define CAPTURE_ISP_PROGRAM_STATUS_SUCCESS U32_C(1) 975#define CAPTURE_ISP_PROGRAM_STATUS_SUCCESS U32_C(1)
910// TODO : Further breakdown errors to sub-types, as per http://nvbugs/200336192/11
911#define CAPTURE_ISP_PROGRAM_STATUS_ERROR U32_C(2) 976#define CAPTURE_ISP_PROGRAM_STATUS_ERROR U32_C(2)
912#define CAPTURE_ISP_PROGRAM_STATUS_STALE U32_C(3) 977#define CAPTURE_ISP_PROGRAM_STATUS_STALE U32_C(3)
913/** Add error codes and data if any */
914} __CAPTURE_IVC_ALIGN; 978} __CAPTURE_IVC_ALIGN;
915 979
916/** 980/**
@@ -964,7 +1028,7 @@ struct isp_program_descriptor {
964#define CAPTURE_ACTIVATE_FLAG_COUPLED U32_C(0x4) /* 1 << 2 */ 1028#define CAPTURE_ACTIVATE_FLAG_COUPLED U32_C(0x4) /* 1 << 2 */
965 1029
966 /** Pad to aligned size */ 1030 /** Pad to aligned size */
967 uint32_t __pad[7]; 1031 uint32_t __pad[5];
968} __CAPTURE_DESCRIPTOR_ALIGN; 1032} __CAPTURE_DESCRIPTOR_ALIGN;
969 1033
970/** 1034/**
@@ -1091,7 +1155,7 @@ struct isp_capture_descriptor {
1091#define CAPTURE_ISP_FLAG_ERROR_REPORT_ENABLE (U32_C(1) << 1) 1155#define CAPTURE_ISP_FLAG_ERROR_REPORT_ENABLE (U32_C(1) << 1)
1092 1156
1093 /** 1 MR port, max 3 input surfaces */ 1157 /** 1 MR port, max 3 input surfaces */
1094#define ISP_MAX_INPUT_SURFACES 3 1158#define ISP_MAX_INPUT_SURFACES (3U)
1095 1159
1096 /** input surfaces */ 1160 /** input surfaces */
1097 struct image_surface input_mr_surfaces[ISP_MAX_INPUT_SURFACES]; 1161 struct image_surface input_mr_surfaces[ISP_MAX_INPUT_SURFACES];
@@ -1099,8 +1163,8 @@ struct isp_capture_descriptor {
1099 /** 1163 /**
1100 * 3 MW ports, max 2 surfaces (multiplanar) per port. 1164 * 3 MW ports, max 2 surfaces (multiplanar) per port.
1101 */ 1165 */
1102#define ISP_MAX_OUTPUTS 3U 1166#define ISP_MAX_OUTPUTS (3U)
1103#define ISP_MAX_OUTPUT_SURFACES 2U 1167#define ISP_MAX_OUTPUT_SURFACES (2U)
1104 1168
1105 /** output surfaces */ 1169 /** output surfaces */
1106 struct { 1170 struct {
@@ -1184,7 +1248,7 @@ struct isp_capture_descriptor {
1184 }; 1248 };
1185 1249
1186 /* TBD: Decide exact max count */ 1250 /* TBD: Decide exact max count */
1187#define ISP_MAX_PREFENCES ISP_MAX_OUTPUTS + ISP_MAX_INPUT_SURFACES 1251#define ISP_MAX_PREFENCES (ISP_MAX_OUTPUTS + ISP_MAX_INPUT_SURFACES)
1188 1252
1189 uint32_t num_prefences; 1253 uint32_t num_prefences;
1190 uint32_t __pad_prefences; 1254 uint32_t __pad_prefences;
@@ -1198,7 +1262,7 @@ struct isp_capture_descriptor {
1198 struct capture_isp_status status; 1262 struct capture_isp_status status;
1199 1263
1200 /** Pad to aligned size */ 1264 /** Pad to aligned size */
1201 uint32_t __pad[6]; 1265 uint32_t __pad[4];
1202} __CAPTURE_DESCRIPTOR_ALIGN; 1266} __CAPTURE_DESCRIPTOR_ALIGN;
1203 1267
1204/** 1268/**
@@ -1347,18 +1411,9 @@ struct isp5_program
1347 * This is needed by ISP Falcon firmware to program 1411 * This is needed by ISP Falcon firmware to program
1348 * tile starting state correctly. 1412 * tile starting state correctly.
1349 */ 1413 */
1350 union { 1414 uint32_t ds0_pixel_incr_h;
1351 uint32_t ds0_pixel_incr_h; 1415 uint32_t ds1_pixel_incr_h;
1352 struct isp5_downscaler_configbuf ds0 CAMRTC_DEPRECATED; 1416 uint32_t ds2_pixel_incr_h;
1353 };
1354 union {
1355 uint32_t ds1_pixel_incr_h;
1356 struct isp5_downscaler_configbuf ds1 CAMRTC_DEPRECATED;
1357 };
1358 union {
1359 uint32_t ds2_pixel_incr_h;
1360 struct isp5_downscaler_configbuf ds2 CAMRTC_DEPRECATED;
1361 };
1362 1417
1363 /** 1418 /**
1364 * Overfetch needed by this ISP program. 1419 * Overfetch needed by this ISP program.
@@ -1401,7 +1456,7 @@ struct isp5_program
1401 uint8_t alignment; 1456 uint8_t alignment;
1402 uint8_t __pad1[2]; 1457 uint8_t __pad1[2];
1403 } overfetch; 1458 } overfetch;
1404 uint32_t _pad1[10]; 1459 uint32_t _pad1[3];
1405 1460
1406 /** 1461 /**
1407 * Push buffer containing ISP settings related to this program. 1462 * Push buffer containing ISP settings related to this program.
diff --git a/include/soc/tegra/camrtc-channels.h b/include/soc/tegra/camrtc-channels.h
index 034be8866..6bb368bf3 100644
--- a/include/soc/tegra/camrtc-channels.h
+++ b/include/soc/tegra/camrtc-channels.h
@@ -23,11 +23,10 @@
23 ((uint64_t)(s4) << 32U) | ((uint64_t)(s5) << 40U) | \ 23 ((uint64_t)(s4) << 32U) | ((uint64_t)(s5) << 40U) | \
24 ((uint64_t)(s6) << 48U) | ((uint64_t)(s7) << 56U)) 24 ((uint64_t)(s6) << 48U) | ((uint64_t)(s7) << 56U))
25 25
26#define CAMRTC_TAG_IVC_SETUP CAMRTC_TAG64('I','V','C', '-', 'S','E','T','U') 26#define CAMRTC_TAG_IVC_SETUP CAMRTC_TAG64('I', 'V', 'C', '-', 'S', 'E', 'T', 'U')
27 27#define CAMRTC_TAG_NV_TRACE CAMRTC_TAG64('N', 'V', ' ', 'T', 'R', 'A', 'C', 'E')
28#define CAMRTC_TAG_NV_TRACE CAMRTC_TAG64('N','V',' ','T','R','A','C','E') 28#define CAMRTC_TAG_NV_CAM_TRACE CAMRTC_TAG64('N', 'V', ' ', 'C', 'A', 'M', 'T', 'R')
29 29#define CAMRTC_TAG_NV_COVERAGE CAMRTC_TAG64('N', 'V', ' ', 'C', 'O', 'V', 'E', 'R')
30#define CAMRTC_TAG_NV_COVERAGE CAMRTC_TAG64('N','V',' ','C','O','V','E','R')
31 30
32struct camrtc_tlv { 31struct camrtc_tlv {
33 uint64_t tag; 32 uint64_t tag;
diff --git a/include/soc/tegra/camrtc-dbg-messages.h b/include/soc/tegra/camrtc-dbg-messages.h
index 26c362be3..ded80128a 100644
--- a/include/soc/tegra/camrtc-dbg-messages.h
+++ b/include/soc/tegra/camrtc-dbg-messages.h
@@ -239,12 +239,24 @@ struct camrtc_dbg_run_mem_test_data {
239 char data[CAMRTC_DBG_MAX_MEM_TEST_DATA]; 239 char data[CAMRTC_DBG_MAX_MEM_TEST_DATA];
240} __packed; 240} __packed;
241 241
242/* This structure is used get information on system tasks.
243 * Fields:
244 * n_task: number of reported tasks
245 * total_count: total runtime
246 * task: array of reported tasks
247 * id: task name
248 * count: runtime allocated to task
249 * number: unique task number
250 * priority: priority of task when this structure was populated
251 */
242struct camrtc_dbg_task_stat { 252struct camrtc_dbg_task_stat {
243 uint32_t n_task; 253 uint32_t n_task;
244 uint32_t total_count; 254 uint32_t total_count;
245 struct { 255 struct {
246 uint32_t id[2]; 256 uint32_t id[2];
247 uint32_t count; 257 uint32_t count;
258 uint32_t number;
259 uint32_t priority;
248 } task[CAMRTC_DBG_TASK_STAT_MAX]; 260 } task[CAMRTC_DBG_TASK_STAT_MAX];
249} __packed; 261} __packed;
250 262
diff --git a/include/soc/tegra/camrtc-trace.h b/include/soc/tegra/camrtc-trace.h
index 115c46a52..6994ea353 100644
--- a/include/soc/tegra/camrtc-trace.h
+++ b/include/soc/tegra/camrtc-trace.h
@@ -12,6 +12,7 @@
12#define INCLUDE_CAMRTC_TRACE_H 12#define INCLUDE_CAMRTC_TRACE_H
13 13
14#include "camrtc-common.h" 14#include "camrtc-common.h"
15#include "camrtc-channels.h"
15 16
16#pragma GCC diagnostic error "-Wpadded" 17#pragma GCC diagnostic error "-Wpadded"
17 18
@@ -68,9 +69,18 @@
68#define CAMRTC_TRACE_SIGNATURE_1 U32_C(0x5420564e) 69#define CAMRTC_TRACE_SIGNATURE_1 U32_C(0x5420564e)
69#define CAMRTC_TRACE_SIGNATURE_2 U32_C(0x45434152) 70#define CAMRTC_TRACE_SIGNATURE_2 U32_C(0x45434152)
70 71
72#define CAMRTC_TRACE_ALIGN __aligned(U32_C(64))
73
71struct camrtc_trace_memory_header { 74struct camrtc_trace_memory_header {
72 /* layout: offset 0 */ 75 /* layout: offset 0 */
73 uint32_t signature[2]; 76 union {
77 /*
78 * Temporary union to provide source compatiblity
79 * during the transition to new header format.
80 */
81 struct camrtc_tlv tlv;
82 uint32_t signature[4] __attribute__((deprecated));
83 };
74 uint32_t revision; 84 uint32_t revision;
75 uint32_t reserved1; 85 uint32_t reserved1;
76 uint32_t exception_offset; 86 uint32_t exception_offset;
@@ -81,13 +91,14 @@ struct camrtc_trace_memory_header {
81 uint32_t event_size; 91 uint32_t event_size;
82 uint32_t event_entries; 92 uint32_t event_entries;
83 uint32_t reserved3; 93 uint32_t reserved3;
84 uint32_t reserved4[0xd0 / 4]; 94 uint32_t reserved4[0xc8 / 4];
85 95
86 /* pointer: offset 0x100 */ 96 /* pointer: offset 0x100 */
87 uint32_t exception_next_idx; 97 uint32_t exception_next_idx;
88 uint32_t event_next_idx; 98 uint32_t event_next_idx;
89 uint32_t reserved_ptrs[0x38 / 4]; 99 uint32_t reserved_ptrs[0x38 / 4];
90}; 100} CAMRTC_TRACE_ALIGN;
101
91 102
92/* 103/*
93 * Exception entry 104 * Exception entry