Skip to content

Commit dc29ab5

Browse files
committed
update output paths and readme
Signed-off-by: Kieran Levin <[email protected]>
1 parent 61d7686 commit dc29ab5

File tree

2 files changed

+34
-5
lines changed

2 files changed

+34
-5
lines changed

gpu_cfg_generator.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -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
}

readme.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# build notes
2+
3+
uses
4+
https://github.com/jart/cosmopolitan
5+
6+
extract cosmopolitan one folder up
7+
8+
run make
9+
10+
11+
to use on windows rename
12+
13+
gpu_cfg_gen to gpu_cfg_gen.exe
14+
15+
16+
17+
# Running
18+
when the application is run, pass in the serial, and for the GPU, the PCB serial.
19+
The application will generate a .bin file in the same directory with the EEPROM contents
20+
## Generate GPU Serial
21+
22+
./gpu_cfg_gen -g -s FRAKMBCP81331ASSY0 -p FRAGMASP81331PCB00
23+
24+
25+
## Generate SSD
26+
27+
./gpu_cfg_gen -d -s FRAKMBCP81331ASSY0

0 commit comments

Comments
 (0)