@@ -211,7 +211,7 @@ static struct default_ssd_cfg ssd_cfg = {
211211};
212212
213213
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 )
215215{
216216 crc_t crc ;
217217 size_t addr = 0 ;
@@ -229,9 +229,9 @@ void program_eeprom(const char * serial, struct gpu_cfg_descriptor * descriptor,
229229 crc = crc_update (crc , descriptor , sizeof (struct gpu_cfg_descriptor )- sizeof (uint32_t ));
230230 descriptor -> crc32 = crc_finalize (crc );
231231
232- printf ("writing EEPROM to %s\n" , "eeprom.bin" );
232+ printf ("writing EEPROM to %s\n" , outpath );
233233
234- fptr = fopen ("eeprom.bin" ,"wb" );
234+ fptr = fopen (outpath ,"wb" );
235235 fwrite (descriptor , len , 1 , fptr );
236236 fclose (fptr );
237237
@@ -276,6 +276,8 @@ int main(int argc, char *argv[]) {
276276 default :
277277 abort ();
278278 }
279+ printf ("Build: %s %s" , __DATE__ , __TIME__ );
280+ printf ("Descriptor Version: %d %d" , 0 , 1 );
279281
280282 printf ("gpu = %d, ssd = %d, module SN = %s pcb SN = %s\n" ,
281283 gpuflag , ssdflag , serialvalue , pcbvalue );
@@ -284,10 +286,10 @@ int main(int argc, char *argv[]) {
284286 if (pcbvalue ) {
285287 strncpy (gpu_cfg .pcba_serial .serial , pcbvalue , GPU_SERIAL_LEN );
286288 }
287- program_eeprom (serialvalue , (void * )& gpu_cfg , sizeof (gpu_cfg ));
289+ program_eeprom (serialvalue , (void * )& gpu_cfg , sizeof (gpu_cfg ), "gpueeprom.bin" );
288290 }
289291
290292 if (ssdflag ) {
291- program_eeprom (serialvalue , (void * )& ssd_cfg , sizeof (ssd_cfg ));
293+ program_eeprom (serialvalue , (void * )& ssd_cfg , sizeof (ssd_cfg ), "ssdeeprom.bin" );
292294 }
293295}
0 commit comments