summaryrefslogtreecommitdiff
path: root/dtc.c
diff options
context:
space:
mode:
authorKumar Gala <galak@kernel.crashing.org>2007-11-28 10:21:12 -0600
committerJon Loeliger <jdl@freescale.com>2007-12-04 07:26:47 -0600
commit2b7dc8dce549ad72ad437b254bf756d7ba4c2a5a (patch)
tree283f79de68c8ce5d2ee125780372eea046e7bcd2 /dtc.c
parent7c44c2f9cb1cc2df7aacd13decfc4e64b73d1730 (diff)
downloaddtc-2b7dc8dce549ad72ad437b254bf756d7ba4c2a5a.tar.gz
Add an option to pad the blob that is generated
There are times when we need extra space in the blob and just want to have it added on w/o know the exact size to make it. The padding and min size options are mutually exclusive. Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'dtc.c')
-rw-r--r--dtc.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/dtc.c b/dtc.c
index 5b16e5d..566c904 100644
--- a/dtc.c
+++ b/dtc.c
@@ -29,6 +29,7 @@
int quiet; /* Level of quietness */
int reservenum; /* Number of memory reservation slots */
int minsize; /* Minimum blob size */
+int padsize; /* Additional padding to blob */
char *join_path(char *path, char *name)
{
@@ -97,6 +98,8 @@ static void __attribute__ ((noreturn)) usage(void)
fprintf(stderr, "\t\tMake space for <number> reserve map entries (relevant for \n\t\tdtb and asm output only)\n");
fprintf(stderr, "\t-S <bytes>\n");
fprintf(stderr, "\t\tMake the blob at least <bytes> long (extra space)\n");
+ fprintf(stderr, "\t-p <bytes>\n");
+ fprintf(stderr, "\t\tAdd padding to the blob of <bytes> long (extra space)\n");
fprintf(stderr, "\t-b <number>\n");
fprintf(stderr, "\t\tSet the physical boot cpu\n");
fprintf(stderr, "\t-f\n");
@@ -124,8 +127,9 @@ int main(int argc, char *argv[])
quiet = 0;
reservenum = 0;
minsize = 0;
+ padsize = 0;
- while ((opt = getopt(argc, argv, "hI:O:o:V:R:S:fcqb:v")) != EOF) {
+ while ((opt = getopt(argc, argv, "hI:O:o:V:R:S:p:fcqb:v")) != EOF) {
switch (opt) {
case 'I':
inform = optarg;
@@ -145,6 +149,9 @@ int main(int argc, char *argv[])
case 'S':
minsize = strtol(optarg, NULL, 0);
break;
+ case 'p':
+ padsize = strtol(optarg, NULL, 0);
+ break;
case 'f':
force = 1;
break;
@@ -173,6 +180,11 @@ int main(int argc, char *argv[])
else
arg = argv[optind];
+ /* minsize and padsize are mutually exclusive */
+ if ((minsize) && (padsize)) {
+ die("Can't set both -p and -S\n");
+ }
+
fprintf(stderr, "DTC: %s->%s on file \"%s\"\n",
inform, outform, arg);