FreeCalypso > hg > freecalypso-tools
comparison loadtools/bpmain.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 |
---|---|
25 extern char *optarg; | 25 extern char *optarg; |
26 extern int optind; | 26 extern int optind; |
27 int c; | 27 int c; |
28 char command[512]; | 28 char command[512]; |
29 | 29 |
30 while ((c = getopt(argc, argv, "a:b:c:C:h:H:i:r:")) != EOF) | 30 while ((c = getopt(argc, argv, "a:b:c:C:h:H:i:P:r:")) != EOF) |
31 switch (c) { | 31 switch (c) { |
32 case 'a': | 32 case 'a': |
33 iramimage.filename = optarg; | 33 iramimage.filename = optarg; |
34 continue; | 34 continue; |
35 case 'b': | 35 case 'b': |
48 read_hwparam_file_fullpath(optarg); | 48 read_hwparam_file_fullpath(optarg); |
49 continue; | 49 continue; |
50 case 'i': | 50 case 'i': |
51 set_beacon_interval(optarg); | 51 set_beacon_interval(optarg); |
52 continue; | 52 continue; |
53 case 'P': | |
54 if (find_bootctrl_entry(optarg) < 0) | |
55 exit(1); /* error msg already printed */ | |
56 continue; | |
53 case 'r': | 57 case 'r': |
54 reattach = find_baudrate_by_name(optarg); | 58 reattach = find_baudrate_by_name(optarg); |
55 if (!reattach) | 59 if (!reattach) |
56 exit(1); /* error msg already printed */ | 60 exit(1); /* error msg already printed */ |
57 continue; | 61 continue; |
69 | 73 |
70 open_serial_port(target_ttydev); | 74 open_serial_port(target_ttydev); |
71 if (reattach) | 75 if (reattach) |
72 set_serial_baudrate(reattach); | 76 set_serial_baudrate(reattach); |
73 else { | 77 else { |
78 pwon_if_needed(); | |
74 perform_compal_stage(); | 79 perform_compal_stage(); |
75 perform_romload(); | 80 perform_romload(); |
76 putchar('\n'); | 81 putchar('\n'); |
77 if (tpinterf_pass_output(1) < 0) | 82 if (tpinterf_pass_output(1) < 0) |
78 exit(1); | 83 exit(1); |