comparison loadtools/clmain.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
35 extern char *optarg; 35 extern char *optarg;
36 extern int optind; 36 extern int optind;
37 int c; 37 int c;
38 struct baudrate *br; 38 struct baudrate *br;
39 39
40 while ((c = getopt(argc, argv, "+a:b:B:c:C:h:H:i:jr:")) != EOF) 40 while ((c = getopt(argc, argv, "+a:b:B:c:C:h:H:i:jP:r:")) != EOF)
41 switch (c) { 41 switch (c) {
42 case 'a': 42 case 'a':
43 iramimage.filename = optarg; 43 iramimage.filename = optarg;
44 continue; 44 continue;
45 case 'b': 45 case 'b':
67 set_beacon_interval(optarg); 67 set_beacon_interval(optarg);
68 continue; 68 continue;
69 case 'j': 69 case 'j':
70 xram_jtag_mode = 1; 70 xram_jtag_mode = 1;
71 continue; 71 continue;
72 case 'P':
73 if (find_bootctrl_entry(optarg) < 0)
74 exit(1); /* error msg already printed */
75 continue;
72 case 'r': 76 case 'r':
73 br = find_baudrate_by_name(optarg); 77 br = find_baudrate_by_name(optarg);
74 if (!br) 78 if (!br)
75 exit(1); /* error msg already printed */ 79 exit(1); /* error msg already printed */
76 xram_run_baudrate = br; 80 xram_run_baudrate = br;
91 passon_argv = argv + optind + 2; 95 passon_argv = argv + optind + 2;
92 passon_argc = argc - optind - 2; 96 passon_argc = argc - optind - 2;
93 } 97 }
94 98
95 open_serial_port(target_ttydev); 99 open_serial_port(target_ttydev);
100 pwon_if_needed();
96 perform_compal_stage(); 101 perform_compal_stage();
97 perform_romload(); 102 perform_romload();
98 /* loadagent should be running now */ 103 /* loadagent should be running now */
99 if (tpinterf_pass_output(1) < 0) 104 if (tpinterf_pass_output(1) < 0)
100 exit(1); 105 exit(1);