dtc.c (204431) | dtc.c (204433) |
---|---|
1/* 2 * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation. 2005. 3 * 4 * 5 * This program is free software; you can redistribute it and/or 6 * modify it under the terms of the GNU General Public License as 7 * published by the Free Software Foundation; either version 2 of the 8 * License, or (at your option) any later version. --- 16 unchanged lines hidden (view full) --- 25 26/* 27 * Command line options 28 */ 29int quiet; /* Level of quietness */ 30int reservenum; /* Number of memory reservation slots */ 31int minsize; /* Minimum blob size */ 32int padsize; /* Additional padding to blob */ | 1/* 2 * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation. 2005. 3 * 4 * 5 * This program is free software; you can redistribute it and/or 6 * modify it under the terms of the GNU General Public License as 7 * published by the Free Software Foundation; either version 2 of the 8 * License, or (at your option) any later version. --- 16 unchanged lines hidden (view full) --- 25 26/* 27 * Command line options 28 */ 29int quiet; /* Level of quietness */ 30int reservenum; /* Number of memory reservation slots */ 31int minsize; /* Minimum blob size */ 32int padsize; /* Additional padding to blob */ |
33int phandle_format = PHANDLE_BOTH; /* Use linux,phandle or phandle properties */ |
|
33 34char *join_path(const char *path, const char *name) 35{ 36 int lenp = strlen(path); 37 int lenn = strlen(name); 38 int len; 39 int needslash = 1; 40 char *str; --- 60 unchanged lines hidden (view full) --- 101 fprintf(stderr, "\t-p <bytes>\n"); 102 fprintf(stderr, "\t\tAdd padding to the blob of <bytes> long (extra space)\n"); 103 fprintf(stderr, "\t-b <number>\n"); 104 fprintf(stderr, "\t\tSet the physical boot cpu\n"); 105 fprintf(stderr, "\t-f\n"); 106 fprintf(stderr, "\t\tForce - try to produce output even if the input tree has errors\n"); 107 fprintf(stderr, "\t-v\n"); 108 fprintf(stderr, "\t\tPrint DTC version and exit\n"); | 34 35char *join_path(const char *path, const char *name) 36{ 37 int lenp = strlen(path); 38 int lenn = strlen(name); 39 int len; 40 int needslash = 1; 41 char *str; --- 60 unchanged lines hidden (view full) --- 102 fprintf(stderr, "\t-p <bytes>\n"); 103 fprintf(stderr, "\t\tAdd padding to the blob of <bytes> long (extra space)\n"); 104 fprintf(stderr, "\t-b <number>\n"); 105 fprintf(stderr, "\t\tSet the physical boot cpu\n"); 106 fprintf(stderr, "\t-f\n"); 107 fprintf(stderr, "\t\tForce - try to produce output even if the input tree has errors\n"); 108 fprintf(stderr, "\t-v\n"); 109 fprintf(stderr, "\t\tPrint DTC version and exit\n"); |
110 fprintf(stderr, "\t-H <phandle format>\n"); 111 fprintf(stderr, "\t\tphandle formats are:\n"); 112 fprintf(stderr, "\t\t\tlegacy - \"linux,phandle\" properties only\n"); 113 fprintf(stderr, "\t\t\tepapr - \"phandle\" properties only\n"); 114 fprintf(stderr, "\t\t\tboth - Both \"linux,phandle\" and \"phandle\" properties\n"); |
|
109 exit(3); 110} 111 112int main(int argc, char *argv[]) 113{ 114 struct boot_info *bi; 115 const char *inform = "dts"; 116 const char *outform = "dts"; --- 5 unchanged lines hidden (view full) --- 122 int outversion = DEFAULT_FDT_VERSION; 123 long long cmdline_boot_cpuid = -1; 124 125 quiet = 0; 126 reservenum = 0; 127 minsize = 0; 128 padsize = 0; 129 | 115 exit(3); 116} 117 118int main(int argc, char *argv[]) 119{ 120 struct boot_info *bi; 121 const char *inform = "dts"; 122 const char *outform = "dts"; --- 5 unchanged lines hidden (view full) --- 128 int outversion = DEFAULT_FDT_VERSION; 129 long long cmdline_boot_cpuid = -1; 130 131 quiet = 0; 132 reservenum = 0; 133 minsize = 0; 134 padsize = 0; 135 |
130 while ((opt = getopt(argc, argv, "hI:O:o:V:R:S:p:fcqb:v")) != EOF) { | 136 while ((opt = getopt(argc, argv, "hI:O:o:V:R:S:p:fcqb:vH:")) != EOF) { |
131 switch (opt) { 132 case 'I': 133 inform = optarg; 134 break; 135 case 'O': 136 outform = optarg; 137 break; 138 case 'o': --- 21 unchanged lines hidden (view full) --- 160 quiet++; 161 break; 162 case 'b': 163 cmdline_boot_cpuid = strtoll(optarg, NULL, 0); 164 break; 165 case 'v': 166 printf("Version: %s\n", DTC_VERSION); 167 exit(0); | 137 switch (opt) { 138 case 'I': 139 inform = optarg; 140 break; 141 case 'O': 142 outform = optarg; 143 break; 144 case 'o': --- 21 unchanged lines hidden (view full) --- 166 quiet++; 167 break; 168 case 'b': 169 cmdline_boot_cpuid = strtoll(optarg, NULL, 0); 170 break; 171 case 'v': 172 printf("Version: %s\n", DTC_VERSION); 173 exit(0); |
174 case 'H': 175 if (streq(optarg, "legacy")) 176 phandle_format = PHANDLE_LEGACY; 177 else if (streq(optarg, "epapr")) 178 phandle_format = PHANDLE_EPAPR; 179 else if (streq(optarg, "both")) 180 phandle_format = PHANDLE_BOTH; 181 else 182 die("Invalid argument \"%s\" to -H option\n", 183 optarg); 184 break; 185 |
|
168 case 'h': 169 default: 170 usage(); 171 } 172 } 173 174 if (argc > (optind+1)) 175 usage(); 176 else if (argc < (optind+1)) 177 arg = "-"; 178 else 179 arg = argv[optind]; 180 181 /* minsize and padsize are mutually exclusive */ 182 if (minsize && padsize) 183 die("Can't set both -p and -S\n"); 184 | 186 case 'h': 187 default: 188 usage(); 189 } 190 } 191 192 if (argc > (optind+1)) 193 usage(); 194 else if (argc < (optind+1)) 195 arg = "-"; 196 else 197 arg = argv[optind]; 198 199 /* minsize and padsize are mutually exclusive */ 200 if (minsize && padsize) 201 die("Can't set both -p and -S\n"); 202 |
203 if (minsize) 204 fprintf(stderr, "DTC: Use of \"-S\" is deprecated; it will be removed soon, use \"-p\" instead\n"); 205 |
|
185 fprintf(stderr, "DTC: %s->%s on file \"%s\"\n", 186 inform, outform, arg); 187 188 if (streq(inform, "dts")) 189 bi = dt_from_source(arg); 190 else if (streq(inform, "fs")) 191 bi = dt_from_fs(arg); 192 else if(streq(inform, "dtb")) --- 34 unchanged lines hidden --- | 206 fprintf(stderr, "DTC: %s->%s on file \"%s\"\n", 207 inform, outform, arg); 208 209 if (streq(inform, "dts")) 210 bi = dt_from_source(arg); 211 else if (streq(inform, "fs")) 212 bi = dt_from_fs(arg); 213 else if(streq(inform, "dtb")) --- 34 unchanged lines hidden --- |