Skip to content

Commit 4e86c2a

Browse files
author
Ramya Darapuneni
committed
Release Updates
1. Minor Bug fixes 2. Authentication support for SSIT
1 parent d890ba2 commit 4e86c2a

11 files changed

Lines changed: 190 additions & 133 deletions

bootheader.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ class RegisterTable
112112
RegisterTable()
113113
: regtab(NULL)
114114
, count(0)
115+
, fileParseEnd(false)
115116
{
116117
invalidAddr.clear();
117118
}
@@ -124,6 +125,7 @@ class RegisterTable
124125
private:
125126
RegisterInitTable* regtab;
126127
uint32_t count;
128+
bool fileParseEnd;
127129
std::vector <uint32_t> invalidAddr;
128130
};
129131

bootimage.cpp

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,11 @@ void BIF_File::Process(Options& options)
9797
if (((*bifoptions)->slrBootCnt == 0) && ((*bifoptions)->slrConfigCnt == 0) && options.IsSsitBif())
9898
{
9999
(*bifoptions)->pdiType = PartitionType::SLR_SLAVE;
100+
if ((*bifoptions)->smapWidth != 0)
101+
{
102+
LOG_WARNING("smap_width for SSIT SLAVE PDIs is identified as %d. Setting it to the default value : 0.", (*bifoptions)->smapWidth);
103+
(*bifoptions)->smapWidth = 0;
104+
}
100105
}
101106

102107
if (options.archType == Arch::ZYNQMP)
@@ -260,6 +265,7 @@ BootImage::BootImage(Options& options, uint8_t index)
260265
, firstIv(NULL)
261266
, firstOptKey(NULL)
262267
, overlayCDO(NULL)
268+
, globalSlrId(0)
263269
{
264270
bifOptions = options.bifOptionsList.at(index);
265271
Name = bifOptions->GetGroupName();
@@ -353,13 +359,13 @@ void BootImage::OutputOptionalEfuseHash()
353359
}
354360

355361
/******************************************************************************/
356-
void BootImage::BuildAndLink(Binary* cache)
357-
{
358-
if( imageList.size() == 0 )
362+
void BootImage::BuildAndLink(Binary* cache)
363+
{
364+
if( imageList.size() == 0 )
359365
{
360366
LOG_WARNING("No partition images given");
361367
}
362-
368+
363369
currentAuthCtx->SetPpkSelect(bifOptions->GetPpkSelection());
364370
currentAuthCtx->SetSpkSelect(bifOptions->GetSpkSelection());
365371
currentAuthCtx->SetSpkIdentification(bifOptions->GetSpkId());

bootimage.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,5 +180,6 @@ class BootImage
180180
bool bootloaderAuthenticate;
181181
uint32_t xplm_modules_data_length;
182182
uint32_t* xplm_modules_data;
183+
char globalSlrId;
183184
};
184185
#endif

cdo-load.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@
2828
#define MAX_LINE_LENGTH 100
2929
static char slr_id_binary;
3030

31-
char SlrIdFromBinary(char ch)
31+
char slr_id_from_binary(char ch)
3232
{
3333
if (slr_id_binary != 0)
3434
{
3535
ch = slr_id_binary;
3636
slr_id_binary = 0;
3737
}
3838
return ch;
39-
}
39+
}
4040

4141
void * file_to_buf(const char * path, size_t * sizep) {
4242
FILE * f = fopen(path, "rb");
@@ -119,7 +119,8 @@ CdoSequence * cdoseq_load_cdo(const char * path) {
119119
}
120120
if (hdr_seq && seq) {
121121
cdocmd_concat_seq(hdr_seq, seq);
122-
return hdr_seq;
122+
cdocmd_delete_sequence(seq);
123+
seq = hdr_seq;
123124
}
124125
return seq;
125126
}

cdo-load.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
void * file_to_buf(const char * path, size_t * sizep);
2727
CdoSequence * cdoseq_load_cdo(const char * path);
2828

29-
char SlrIdFromBinary(char ch);
29+
char slr_id_from_binary(char ch);
3030
void cdoseq_extract_writes(CdoSequence * seq);
3131
CdoSequence* cdoseq_extract_cdo_till_ssit_sync_slaves(CdoSequence * seq, uint32_t sync_index);
3232
#endif /* D_cdo_load */

cdo-source.c

Lines changed: 33 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -21,24 +21,10 @@
2121
#include <inttypes.h>
2222
#include "cdo-load.h"
2323
#include "cdo-source.h"
24+
#include <stdbool.h>
2425

2526
static char* slr_id_ptr;
2627
static char slr_id;
27-
int MhCdoCount = 0;
28-
int PmcCdoCount = 0;
29-
int LpdCdoCount = 0;
30-
int FpdCdoCount = 0;
31-
int slavePmcCdoCount = 0;
32-
int slaveLpdCdoCount = 0;
33-
int slaveFpdCdoCount = 0;
34-
35-
char fin[] = "PMC_DATA";
36-
char fin2[] = "LPD_DATA";
37-
char fin3[] = "FPD_DATA";
38-
char fin4[] = "AIE_DATA";
39-
char slaveFin[] = "PMC_DATA_SLR_1";
40-
char slaveFin2[] = "PMC_DATA_SLR_2";
41-
char slaveFin3[] = "PMC_DATA_SLR_3";
4228

4329
#if defined(_WIN32)
4430
#define strcasecmp(x,y) stricmp(x,y)
@@ -166,6 +152,16 @@ struct command_info {
166152
{ NULL, 0 }
167153
};
168154

155+
char* marker_list[] = {
156+
"PMC_DATA",
157+
"LPD_DATA",
158+
"FPD_DATA",
159+
"PMC_DATA_SLR_1",
160+
"PMC_DATA_SLR_2",
161+
"PMC_DATA_SLR_3"
162+
};
163+
int marker_count[sizeof(marker_list) / sizeof(marker_list[0])];
164+
169165
static uint32_t iseol(char ** sp) {
170166
char * s = *sp;
171167
skipsp(s);
@@ -277,7 +273,7 @@ static uint32_t parse_string(char ** sp, char ** strp) {
277273
return 1;
278274
}
279275

280-
char SlrIdFromSource(char ch)
276+
char slr_id_from_source(char ch)
281277
{
282278
if (slr_id != 0)
283279
{
@@ -287,6 +283,26 @@ char SlrIdFromSource(char ch)
287283
return ch;
288284
}
289285

286+
static void check_redundant_markers(char * marker_string)
287+
{
288+
bool same_marker_found = false;
289+
int i = 0;
290+
for (; i < (sizeof(marker_list) / sizeof(marker_list[0])); i++)
291+
{
292+
if (strcasecmp(marker_string, marker_list[i]) == 0)
293+
{
294+
if (marker_count[i]++ > 2)
295+
{
296+
same_marker_found = true;
297+
}
298+
}
299+
}
300+
if (same_marker_found == true)
301+
{
302+
printf("[WARNING]: The marker %s is found more than once.\n", marker_string);
303+
}
304+
}
305+
290306
CdoSequence * cdoseq_from_source(FILE * f) {
291307
CdoSequence * seq = cdocmd_create_sequence();
292308
uint32_t cap = 2;
@@ -561,73 +577,7 @@ CdoSequence * cdoseq_from_source(FILE * f) {
561577
if (parse_u32(&s, &value)) goto syntax_error;
562578
if (iseol(&s)) goto syntax_error;
563579
if (parse_string(&s, &name)) goto syntax_error;
564-
int pmcCdoPtr; int lpdCdoPtr; int fpdCdoPtr; int mHCdoptr;
565-
int pmcSlr1Ptr; int pmcSlr2Ptr; int pmcSlr3Ptr;
566-
pmcSlr1Ptr = strcmp(name,slaveFin);
567-
pmcSlr2Ptr = strcmp(name,slaveFin2);
568-
pmcSlr3Ptr = strcmp(name,slaveFin3);
569-
pmcCdoPtr = strcmp(name,fin);
570-
lpdCdoPtr = strcmp(name,fin2);
571-
fpdCdoPtr = strcmp(name,fin3);
572-
mHCdoptr = strcmp(name,fin4);
573-
if (mHCdoptr == 0)
574-
{
575-
MhCdoCount++;
576-
if (MhCdoCount > 3)
577-
{
578-
printf("[WARNING]: Metadata CDO is used more than once.");
579-
}
580-
}
581-
if (pmcCdoPtr == 0)
582-
{
583-
PmcCdoCount++;
584-
if (PmcCdoCount > 3)
585-
{
586-
printf("[WARNING]: PMC CDO is used more than once.");
587-
}
588-
}
589-
if (lpdCdoPtr == 0)
590-
{
591-
LpdCdoCount++;
592-
if (LpdCdoCount > 3)
593-
{
594-
printf("[WARNING]: LPD CDO is used more than once.");
595-
}
596-
}
597-
if (fpdCdoPtr == 0)
598-
{
599-
FpdCdoCount++;
600-
if (FpdCdoCount > 3)
601-
{
602-
printf("[WARNING]: FPD CDO is used more than once.");
603-
}
604-
}
605-
606-
if (pmcSlr1Ptr == 0)
607-
{
608-
slavePmcCdoCount++;
609-
if (slavePmcCdoCount > 3)
610-
{
611-
printf("[WARNING]: SLR1 PMC CDO is used more than once.");
612-
}
613-
}
614-
if (pmcSlr2Ptr == 0)
615-
{
616-
slaveLpdCdoCount++;
617-
if (slaveLpdCdoCount > 3)
618-
{
619-
printf("[WARNING]: SLR2 PMC CDO is used more than once.");
620-
}
621-
}
622-
if (pmcSlr3Ptr == 0)
623-
{
624-
slaveFpdCdoCount++;
625-
if (slaveFpdCdoCount > 3)
626-
{
627-
printf("[WARNING]: SLR3 PMC CDO is used more than once.");
628-
}
629-
}
630-
580+
check_redundant_markers(name);
631581
if (value == MARKER_DEVICE || value == MARKER_DATE)
632582
{
633583
break;

cdo-source.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@
2222

2323
CdoSequence * cdoseq_from_source(FILE * f);
2424
void cdoseq_to_source(FILE * f, CdoSequence * seq);
25-
char SlrIdFromSource(char ch);
25+
char slr_id_from_source(char ch);
2626
#endif /* D_cdo_source */

0 commit comments

Comments
 (0)