2 * Support for Intel Camera Imaging ISP subsystem.
3 * Copyright (c) 2010-2016, Intel Corporation.
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms and conditions of the GNU General Public License,
7 * version 2, as published by the Free Software Foundation.
9 * This program is distributed in the hope it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
17 #ifndef __INLINE_DEBUG__
18 #include "debug_private.h"
19 #endif /* __INLINE_DEBUG__ */
21 #include "memory_access.h"
26 #include "assert_support.h"
28 /* The address of the remote copy */
29 hrt_address debug_buffer_address = (hrt_address)-1;
30 hrt_vaddress debug_buffer_ddr_address = (hrt_vaddress)-1;
32 debug_data_t debug_data;
33 debug_data_t *debug_data_ptr = &debug_data;
35 void debug_buffer_init(const hrt_address addr)
37 debug_buffer_address = addr;
43 void debug_buffer_ddr_init(const hrt_vaddress addr)
45 debug_buf_mode_t mode = DEBUG_BUFFER_MODE_LINEAR;
49 /* set the ddr queue */
50 debug_buffer_ddr_address = addr;
51 mmgr_store(addr + DEBUG_DATA_BUF_MODE_DDR_ADDR,
52 &mode, sizeof(debug_buf_mode_t));
53 mmgr_store(addr + DEBUG_DATA_HEAD_DDR_ADDR,
54 &head, sizeof(uint32_t));
55 mmgr_store(addr + DEBUG_DATA_TAIL_DDR_ADDR,
56 &tail, sizeof(uint32_t));
57 mmgr_store(addr + DEBUG_DATA_ENABLE_DDR_ADDR,
58 &enable, sizeof(uint32_t));
60 /* set the local copy */
65 void debug_buffer_setmode(const debug_buf_mode_t mode)
67 assert(debug_buffer_address != ((hrt_address)-1));
69 sp_dmem_store_uint32(SP0_ID,
70 debug_buffer_address + DEBUG_DATA_BUF_MODE_ADDR, mode);