Deleted Added
sdiff udiff text old ( 204431 ) new ( 204433 )
full compact
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 */
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");
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
136 while ((opt = getopt(argc, argv, "hI:O:o:V:R:S:p:fcqb:vH:")) != EOF) {
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
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
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 ---