2 * Support for Intel Camera Imaging ISP subsystem.
3 * Copyright (c) 2010-2015, 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
15 #ifndef __SP_LOCAL_H_INCLUDED__
16 #define __SP_LOCAL_H_INCLUDED__
18 #include <type_support.h>
19 #include "sp_global.h"
47 #define sp_address_of(var) (HIVE_ADDR_ ## var)
52 #define store_sp_int(var, value) \
53 sp_dmem_store_uint32(SP0_ID, (unsigned)sp_address_of(var), \
56 #define store_sp_ptr(var, value) \
57 sp_dmem_store_uint32(SP0_ID, (unsigned)sp_address_of(var), \
60 #define load_sp_uint(var) \
61 sp_dmem_load_uint32(SP0_ID, (unsigned)sp_address_of(var))
63 #define load_sp_array_uint8(array_name, index) \
64 sp_dmem_load_uint8(SP0_ID, (unsigned)sp_address_of(array_name) + \
65 (index)*sizeof(uint8_t))
67 #define load_sp_array_uint16(array_name, index) \
68 sp_dmem_load_uint16(SP0_ID, (unsigned)sp_address_of(array_name) + \
69 (index)*sizeof(uint16_t))
71 #define load_sp_array_uint(array_name, index) \
72 sp_dmem_load_uint32(SP0_ID, (unsigned)sp_address_of(array_name) + \
73 (index)*sizeof(uint32_t))
75 #define store_sp_var(var, data, bytes) \
76 sp_dmem_store(SP0_ID, (unsigned)sp_address_of(var), data, bytes)
78 #define store_sp_array_uint8(array_name, index, value) \
79 sp_dmem_store_uint8(SP0_ID, (unsigned)sp_address_of(array_name) + \
80 (index)*sizeof(uint8_t), value)
82 #define store_sp_array_uint16(array_name, index, value) \
83 sp_dmem_store_uint16(SP0_ID, (unsigned)sp_address_of(array_name) + \
84 (index)*sizeof(uint16_t), value)
86 #define store_sp_array_uint(array_name, index, value) \
87 sp_dmem_store_uint32(SP0_ID, (unsigned)sp_address_of(array_name) + \
88 (index)*sizeof(uint32_t), value)
90 #define store_sp_var_with_offset(var, offset, data, bytes) \
91 sp_dmem_store(SP0_ID, (unsigned)sp_address_of(var) + \
94 #define load_sp_var(var, data, bytes) \
95 sp_dmem_load(SP0_ID, (unsigned)sp_address_of(var), data, bytes)
97 #define load_sp_var_with_offset(var, offset, data, bytes) \
98 sp_dmem_load(SP0_ID, (unsigned)sp_address_of(var) + offset, \
101 #endif /* __SP_LOCAL_H_INCLUDED__ */