3 * Support for Intel Camera Imaging ISP subsystem.
4 * Copyright (c) 2015, Intel Corporation.
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms and conditions of the GNU General Public License,
8 * version 2, as published by the Free Software Foundation.
10 * This program is distributed in the hope it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
17 Support for Intel Camera Imaging ISP subsystem.
18 Copyright (c) 2010 - 2015, Intel Corporation.
20 This program is free software; you can redistribute it and/or modify it
21 under the terms and conditions of the GNU General Public License,
22 version 2, as published by the Free Software Foundation.
24 This program is distributed in the hope it will be useful, but WITHOUT
25 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
26 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
31 #include "sh_css_sp.h"
33 #include "dma.h" /* N_DMA_CHANNEL_ID */
35 #include <type_support.h>
36 #include "ia_css_binary.h"
37 #include "sh_css_hrt.h"
38 #include "sh_css_defs.h"
39 #include "sh_css_internal.h"
40 #include "ia_css_debug.h"
41 #include "ia_css_debug_internal.h"
42 #include "sh_css_legacy.h"
44 #include "gdc_device.h" /* HRT_GDC_N */
46 /*#include "sp.h"*/ /* host2sp_enqueue_frame_data() */
48 #include "memory_access.h"
50 #include "assert_support.h"
51 #include "platform_support.h" /* hrt_sleep() */
53 #include "ia_css_queue.h" /* host_sp_enqueue_XXX */
54 #include "ia_css_event.h" /* ia_css_event_encode */
56 * @brief Encode the information into the software-event.
57 * Refer to "sw_event_public.h" for details.
59 bool ia_css_event_encode(
69 OP___assert(nr > 0 && nr <= MAX_NR_OF_PAYLOADS_PER_SW_EVENT);
71 /* initialize the output */
74 /* get the number of bits per information */
75 nr_of_bits = sizeof(uint32_t) * 8 / nr;
77 /* compress the all inputs into a signle output */
78 for (i = 0; i < nr; i++) {
83 /* get the return value */
84 ret = (nr > 0 && nr <= MAX_NR_OF_PAYLOADS_PER_SW_EVENT);
89 void ia_css_event_decode(
93 assert(payload[1] == 0);
94 assert(payload[2] == 0);
95 assert(payload[3] == 0);
97 ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE, "ia_css_event_decode() enter:\n");
99 /* First decode according to the common case
100 * In case of a PORT_EOF event we overwrite with
101 * the specific values
102 * This is somewhat ugly but probably somewhat efficient
103 * (and it avoids some code duplication)
105 payload[0] = event & 0xff; /*event_code */
106 payload[1] = (event >> 8) & 0xff;
107 payload[2] = (event >> 16) & 0xff;
110 switch (payload[0]) {
111 case SH_CSS_SP_EVENT_PORT_EOF:
113 payload[3] = (event >> 24) & 0xff;
116 case SH_CSS_SP_EVENT_ACC_STAGE_COMPLETE:
117 case SH_CSS_SP_EVENT_TIMER:
118 case SH_CSS_SP_EVENT_FRAME_TAGGED:
119 case SH_CSS_SP_EVENT_FW_WARNING:
120 case SH_CSS_SP_EVENT_FW_ASSERT:
121 payload[3] = (event >> 24) & 0xff;