@@ -211,7 +211,7 @@ static struct default_ssd_cfg ssd_cfg = {
211
211
};
212
212
213
213
214
- void program_eeprom (const char * serial , struct gpu_cfg_descriptor * descriptor , size_t len )
214
+ void program_eeprom (const char * serial , struct gpu_cfg_descriptor * descriptor , size_t len , const char * outpath )
215
215
{
216
216
crc_t crc ;
217
217
size_t addr = 0 ;
@@ -229,9 +229,9 @@ void program_eeprom(const char * serial, struct gpu_cfg_descriptor * descriptor,
229
229
crc = crc_update (crc , descriptor , sizeof (struct gpu_cfg_descriptor )- sizeof (uint32_t ));
230
230
descriptor -> crc32 = crc_finalize (crc );
231
231
232
- printf ("writing EEPROM to %s\n" , "eeprom.bin" );
232
+ printf ("writing EEPROM to %s\n" , outpath );
233
233
234
- fptr = fopen ("eeprom.bin" ,"wb" );
234
+ fptr = fopen (outpath ,"wb" );
235
235
fwrite (descriptor , len , 1 , fptr );
236
236
fclose (fptr );
237
237
@@ -276,6 +276,8 @@ int main(int argc, char *argv[]) {
276
276
default :
277
277
abort ();
278
278
}
279
+ printf ("Build: %s %s" , __DATE__ , __TIME__ );
280
+ printf ("Descriptor Version: %d %d" , 0 , 1 );
279
281
280
282
printf ("gpu = %d, ssd = %d, module SN = %s pcb SN = %s\n" ,
281
283
gpuflag , ssdflag , serialvalue , pcbvalue );
@@ -284,10 +286,10 @@ int main(int argc, char *argv[]) {
284
286
if (pcbvalue ) {
285
287
strncpy (gpu_cfg .pcba_serial .serial , pcbvalue , GPU_SERIAL_LEN );
286
288
}
287
- program_eeprom (serialvalue , (void * )& gpu_cfg , sizeof (gpu_cfg ));
289
+ program_eeprom (serialvalue , (void * )& gpu_cfg , sizeof (gpu_cfg ), "gpueeprom.bin" );
288
290
}
289
291
290
292
if (ssdflag ) {
291
- program_eeprom (serialvalue , (void * )& ssd_cfg , sizeof (ssd_cfg ));
293
+ program_eeprom (serialvalue , (void * )& ssd_cfg , sizeof (ssd_cfg ), "ssdeeprom.bin" );
292
294
}
293
295
}
0 commit comments