SDL API Guide for J721E
sdl_ip_rom_checksum.h
Go to the documentation of this file.
1 /********************************************************************
2  * Copyright (C) 2023 Texas Instruments Incorporated.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  *
8  * Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  *
11  * Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in the
13  * documentation and/or other materials provided with the
14  * distribution.
15  *
16  * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  *
32  */
33 
34 #ifndef SDLR_ROM_CHECKSUM_TOP_H_
35 #define SDLR_ROM_CHECKSUM_TOP_H_
36 
37 #include <sdlr.h>
38 #include <tistdtypes.h>
39 
40 #if defined(SOC_J721E)|| defined(SOC_J7200) || defined (SOC_J721S2) || defined (SOC_J784S4)
41 #include <src/ip/rom_checksum/sdl_ip_rom_checksum.h>
42 #endif
43 #ifdef __cplusplus
44 extern "C"
45 {
46 #endif
47 
89 typedef struct
90 {
92  uint64_t length;
93 
95  uint64_t state[8];
96 
98  uint32_t curlen;
99 
101  uint8_t buf[128];
103 
105 /********************************************************************************************************
106 * Below are the Declarations of Low Level Functions
107 ********************************************************************************************************/
108 
119 
128 int32_t SDL_ROM_Checksum_process (SDL_ROM_Checksum_obj * md, uint8_t *in, uint32_t inlen);
129 
134 void SDL_ROM_Checksum_compress(SDL_ROM_Checksum_obj * md, uint8_t *buf);
135 
144 
145 
154 int32_t SDL_ROM_Checksum_compareResult (uint64_t buflen, SDL_ROM_Checksum_obj * md, uint64_t *golden_value);
155 
160 void SDL_memcpy(void *dest, void *src, uint32_t n);
161 
164 #ifdef __cplusplus
165 }
166 #endif
167 #endif /* SDLR_ROM_CHECKSUM_TOP_H_ */
void SDL_ROM_Checksum_compress(SDL_ROM_Checksum_obj *md, uint8_t *buf)
This API is used to compress the data of ROM region and store the result in md->state.
int32_t SDL_ROM_Checksum_compareResult(uint64_t buflen, SDL_ROM_Checksum_obj *md, uint64_t *golden_value)
This API will compare the resultant hash value of golden value.
void SDL_ROM_Checksum_init(SDL_ROM_Checksum_obj *const md)
This API will Initialize the buffer where hash value to be stored.
int32_t SDL_ROM_Checksum_done(SDL_ROM_Checksum_obj *md)
This API will increase our data length with the help of padding ( because our algorithm can compress ...
This structure is used to store the resultant value of ROM Checksum.
Definition: sdl_ip_rom_checksum.h:89
uint32_t curlen
Definition: sdl_ip_rom_checksum.h:98
int32_t SDL_ROM_Checksum_process(SDL_ROM_Checksum_obj *md, uint8_t *in, uint32_t inlen)
This API is used to process the ROM region data.
uint64_t length
Definition: sdl_ip_rom_checksum.h:92
void SDL_memcpy(void *dest, void *src, uint32_t n)
This API will copy source pointer data to destination pointer.