FreeCalypso > hg > freecalypso-tools
comparison loadtools/romdump.c @ 575:cef70d53fc5e
loadtools: new -P boot control mechanism implemented
| author | Mychaela Falconia <falcon@freecalypso.org> |
|---|---|
| date | Sun, 02 Feb 2020 20:01:22 +0000 |
| parents | aba969153d20 |
| children | ecea01f65146 |
comparison
equal
deleted
inserted
replaced
| 574:aba969153d20 | 575:cef70d53fc5e |
|---|---|
| 42 extern int optind; | 42 extern int optind; |
| 43 int c; | 43 int c; |
| 44 struct baudrate *br; | 44 struct baudrate *br; |
| 45 char *targv[2]; | 45 char *targv[2]; |
| 46 | 46 |
| 47 while ((c = getopt(argc, argv, "a:b:B:c:C:h:H:i:")) != EOF) | 47 while ((c = getopt(argc, argv, "a:b:B:c:C:h:H:i:P:")) != EOF) |
| 48 switch (c) { | 48 switch (c) { |
| 49 case 'a': | 49 case 'a': |
| 50 iramimage.filename = optarg; | 50 iramimage.filename = optarg; |
| 51 continue; | 51 continue; |
| 52 case 'b': | 52 case 'b': |
| 71 read_hwparam_file_fullpath(optarg); | 71 read_hwparam_file_fullpath(optarg); |
| 72 continue; | 72 continue; |
| 73 case 'i': | 73 case 'i': |
| 74 set_beacon_interval(optarg); | 74 set_beacon_interval(optarg); |
| 75 continue; | 75 continue; |
| 76 case 'P': | |
| 77 if (find_bootctrl_entry(optarg) < 0) | |
| 78 exit(1); /* error msg already printed */ | |
| 79 continue; | |
| 76 case '?': | 80 case '?': |
| 77 default: | 81 default: |
| 78 usage: fprintf(stderr, | 82 usage: fprintf(stderr, |
| 79 "usage: fc-dspromdump [options] ttyport output-file\n"); | 83 "usage: fc-dspromdump [options] ttyport output-file\n"); |
| 80 exit(1); | 84 exit(1); |
| 85 output_filename = argv[optind+1]; | 89 output_filename = argv[optind+1]; |
| 86 if (!iramimage.filename) | 90 if (!iramimage.filename) |
| 87 iramimage.filename = default_dspdump_image; | 91 iramimage.filename = default_dspdump_image; |
| 88 | 92 |
| 89 open_serial_port(target_ttydev); | 93 open_serial_port(target_ttydev); |
| 94 pwon_if_needed(); | |
| 90 perform_compal_stage(); | 95 perform_compal_stage(); |
| 91 perform_romload(); | 96 perform_romload(); |
| 92 /* dspdump target program should be running now */ | 97 /* dspdump target program should be running now */ |
| 93 if (tpinterf_pass_output(1) < 0) | 98 if (tpinterf_pass_output(1) < 0) |
| 94 exit(1); | 99 exit(1); |
