[coreboot-gerrit] Change in coreboot[master]: util/blobtool: rename to bincfg

Denis 'GNUtoo' Carikli (Code Review) gerrit at coreboot.org
Fri Jan 12 07:51:21 CET 2018


Denis 'GNUtoo' Carikli has uploaded this change for review. ( https://review.coreboot.org/23239


Change subject: util/blobtool: rename to bincfg
......................................................................

util/blobtool: rename to bincfg

The name blobtool is confusing as 'blob' is also used to
describe nonfree software in binary form.

Since this utility deals with binary configurations it
makes more sense to call it bincfg.

Change-Id: I3339274f1c42df4bb4a6b30b9538d91c3c03d7d0
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo at no-log.org>
---
M .gitignore
M Makefile.inc
M src/Kconfig
M src/southbridge/intel/common/firmware/Makefile.inc
R util/bincfg/Makefile
A util/bincfg/Makefile.inc
R util/bincfg/bincfg.l
R util/bincfg/bincfg.lex.c_shipped
R util/bincfg/bincfg.tab.c_shipped
R util/bincfg/bincfg.tab.h_shipped
R util/bincfg/bincfg.y
R util/bincfg/ddr3_unregistered_spd_128.spec
R util/bincfg/ddr3_unregistered_spd_256.spec
R util/bincfg/gbe-ich9m.set
R util/bincfg/gbe-ich9m.spec
R util/bincfg/ifd-x200.set
R util/bincfg/ifd-x200.spec
R util/bincfg/it8718f-ec.spec
D util/blobtool/Makefile.inc
19 files changed, 71 insertions(+), 71 deletions(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/39/23239/1

diff --git a/.gitignore b/.gitignore
index e3fa3fe..7ee954d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -84,7 +84,7 @@
 util/amdfwtool/amdfwtool
 util/archive/archive
 util/bimgtool/bimgtool
-util/blobtool/blobtool
+util/bincfg/bincfg
 util/board_status/board-status
 util/cbfstool/cbfs-compression-tool
 util/cbfstool/cbfstool
diff --git a/Makefile.inc b/Makefile.inc
index 413f7ad..2ac6a59 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -88,7 +88,7 @@
 subdirs-y += $(wildcard src/drivers/*) $(wildcard src/drivers/*/*)
 subdirs-y += src/cpu src/vendorcode
 subdirs-y += util/cbfstool util/sconfig util/nvramtool util/broadcom
-subdirs-y += util/futility util/marvell util/blobtool
+subdirs-y += util/futility util/marvell util/bincfg
 subdirs-y += $(wildcard src/arch/*)
 subdirs-y += src/mainboard/$(MAINBOARDDIR)
 subdirs-y += src/security
@@ -494,7 +494,7 @@
 	@# https://www.coreboot.org/pipermail/coreboot/2010-February/055825.html
 	$(HOSTCC) -g $(STACK) -Wall -o $@ $<
 
-BLOBTOOL:=$(objutil)/blobtool/blobtool
+BINCFG:=$(objutil)/bincfg/bincfg
 
 IFDTOOL:=$(objutil)/ifdtool/ifdtool
 $(IFDTOOL):
@@ -575,7 +575,7 @@
 include util/crossgcc/Makefile.inc
 
 .PHONY: tools
-tools: $(objutil)/kconfig/conf $(CBFSTOOL) $(objutil)/cbfstool/cbfs-compression-tool $(FMAPTOOL) $(RMODTOOL) $(IFWITOOL) $(objutil)/nvramtool/nvramtool $(ROMCC_BIN) $(objutil)/sconfig/sconfig $(IFDTOOL) $(IFDFAKE) $(CBOOTIMAGE) $(AMDFWTOOL) $(FUTILITY) $(BLOBTOOL)
+tools: $(objutil)/kconfig/conf $(CBFSTOOL) $(objutil)/cbfstool/cbfs-compression-tool $(FMAPTOOL) $(RMODTOOL) $(IFWITOOL) $(objutil)/nvramtool/nvramtool $(ROMCC_BIN) $(objutil)/sconfig/sconfig $(IFDTOOL) $(IFDFAKE) $(CBOOTIMAGE) $(AMDFWTOOL) $(FUTILITY) $(BINCFG)
 
 ###########################################################################
 # Common recipes for all stages
diff --git a/src/Kconfig b/src/Kconfig
index 6896d0e..a67540a 100644
--- a/src/Kconfig
+++ b/src/Kconfig
@@ -104,11 +104,11 @@
 	  Otherwise, say N to use the provided pregenerated scanner/parser.
 
 config UTIL_GENPARSER
-	bool "Generate SCONFIG & BLOBTOOL parser using flex and bison"
+	bool "Generate SCONFIG & BINCFG parser using flex and bison"
 	default n
 	help
 	  Enable this option if you are working on the sconfig device tree
-	  parser or blobtool and made changes to the .l or .y files.
+	  parser or bincfg and made changes to the .l or .y files.
 
 	  Otherwise, say N to use the provided pregenerated scanner/parser.
 
diff --git a/src/southbridge/intel/common/firmware/Makefile.inc b/src/southbridge/intel/common/firmware/Makefile.inc
index d6e6296..6c5a241 100644
--- a/src/southbridge/intel/common/firmware/Makefile.inc
+++ b/src/southbridge/intel/common/firmware/Makefile.inc
@@ -38,7 +38,7 @@
 endif
 endif
 
-add_intel_firmware: $(obj)/coreboot.pre $(IFDTOOL) $(IFDFAKE)
+add_intel_firmware: $(obj)/coreboot.pre $(IFDTOOL) $(BINCFG)
 ifeq ($(CONFIG_BUILD_WITH_FAKE_IFD),y)
 	printf "\n** WARNING **\n"
 	printf "coreboot will be built with a fake Intel Firmware Descriptor (IFD).\n"
diff --git a/util/blobtool/Makefile b/util/bincfg/Makefile
similarity index 72%
rename from util/blobtool/Makefile
rename to util/bincfg/Makefile
index ee706db..1b3e936 100644
--- a/util/blobtool/Makefile
+++ b/util/bincfg/Makefile
@@ -1,7 +1,7 @@
 CC = gcc
 YACC = bison
 LEX = flex
-TARGET=blobtool
+TARGET=bincfg
 
 $(TARGET): $(TARGET).lex.o $(TARGET).tab.o
 	$(CC) $^ -Wall -Wno-unused-function -g -lfl -o $@
@@ -14,16 +14,16 @@
 
 # Use this target to generate GbE for X200
 gen-gbe-ich9m:
-	./blobtool gbe-ich9m.spec gbe-ich9m.set gbe1.bin
+	./bincfg gbe-ich9m.spec gbe-ich9m.set gbe1.bin
 	# duplicate binary as per spec
 	cat gbe1.bin gbe1.bin > flashregion_3_gbe.bin
 	rm -f gbe1.bin
 
 # Use this target to generate IFD for X200
 gen-ifd-x200:
-	./blobtool ifd-x200.spec ifd-x200.set flashregion_0_fd.bin
+	./bincfg ifd-x200.spec ifd-x200.set flashregion_0_fd.bin
 
 .PHONY: clean gen-gbe-ich9m gen-ifd-x200
 
 clean:
-	rm -f *.lex.c *.tab.c *.tab.h *.o blobtool flashregion_0_fd.bin flashregion_3_gbe.bin
+	rm -f *.lex.c *.tab.c *.tab.h *.o bincfg flashregion_0_fd.bin flashregion_3_gbe.bin
diff --git a/util/bincfg/Makefile.inc b/util/bincfg/Makefile.inc
new file mode 100644
index 0000000..81c6af6
--- /dev/null
+++ b/util/bincfg/Makefile.inc
@@ -0,0 +1,41 @@
+bincfg_obj := bincfg.lex.o bincfg.tab.o
+
+BINCFG_FLAGS += -I$(top)/util/bincfg -I$(objutil)/bincfg
+
+$(objutil)/bincfg:
+	mkdir -p $@
+
+$(objutil)/bincfg/.generated: $(objutil)/bincfg
+	touch $@
+
+$(objutil)/bincfg/%.o: util/bincfg/%.c | $(objutil)/bincfg/.generated
+	printf "    HOSTCC     $(subst $(obj)/,,$(@))\n"
+	$(HOSTCC) $(BINCFG_FLAGS) $(HOSTCFLAGS) -c -o $@ $<
+
+$(objutil)/bincfg/%.o: $(objutil)/bincfg/%.c
+	printf "    HOSTCC     $(subst $(obj)/,,$(@))\n"
+	$(HOSTCC) $(BINCFG_FLAGS) $(HOSTCFLAGS) -c -o $@ $<
+
+ifeq ($(CONFIG_UTIL_GENPARSER),y)
+$(top)/util/bincfg/bincfg.lex.c_shipped: $(top)/util/bincfg/bincfg.l
+	printf "    FLEX       $(subst $(top)/,,$(@))\n"
+	flex -L -o $@ $<
+
+# the .c rule also creates .h
+$(top)/util/bincfg/bincfg.tab.h_shipped: $(top)/util/bincfg/bincfg.tab.c_shipped
+$(top)/util/bincfg/bincfg.tab.c_shipped: $(top)/util/bincfg/bincfg.y
+	printf "    BISON      $(subst $(top)/,,$(@))\n"
+	bison -l --defines=$(top)/util/bincfg/bincfg.tab.h_shipped -o $@ $<
+endif
+
+$(objutil)/bincfg/bincfg.lex.o: $(objutil)/bincfg/bincfg.tab.h
+
+$(objutil)/bincfg/%: $(top)/util/bincfg/%_shipped
+	mkdir -p $(dir $@)
+	cp $< $@
+
+$(objutil)/bincfg/bincfg: $(addprefix $(objutil)/bincfg/,$(bincfg_obj))
+	printf "    HOSTCC     $(subst $(obj)/,,$(@)) (link)\n"
+	$(HOSTCC) $(BINCFG_FLAGS) -o $@ $(addprefix $(objutil)/bincfg/,$(bincfg_obj))
+
+$(addprefix $(objutil)/bincfg/,$(bincfg_obj)) : $(objutil)/bincfg/bincfg.tab.h $(objutil)/bincfg/bincfg.tab.c $(objutil)/bincfg/bincfg.lex.c
diff --git a/util/blobtool/blobtool.l b/util/bincfg/bincfg.l
similarity index 95%
rename from util/blobtool/blobtool.l
rename to util/bincfg/bincfg.l
index b80cc55..f9e880f 100644
--- a/util/blobtool/blobtool.l
+++ b/util/bincfg/bincfg.l
@@ -1,5 +1,5 @@
 /*
- * blobtool - Compiler/Decompiler for data blobs with specs
+ * bincfg - Compiler/Decompiler for data blobs with specs
  * Copyright (C) 2017 Damien Zammit <damien at zamaudio.com>
  *
  * This program is free software: you can redistribute it and/or modify
@@ -17,7 +17,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include "blobtool.tab.h"
+#include "bincfg.tab.h"
 
 extern struct blob binary;
 
diff --git a/util/blobtool/blobtool.lex.c_shipped b/util/bincfg/bincfg.lex.c_shipped
similarity index 99%
rename from util/blobtool/blobtool.lex.c_shipped
rename to util/bincfg/bincfg.lex.c_shipped
index df5b060..44a76a1 100644
--- a/util/blobtool/blobtool.lex.c_shipped
+++ b/util/bincfg/bincfg.lex.c_shipped
@@ -1,5 +1,5 @@
 
-#line 3 "/coreboot/util/blobtool/blobtool.lex.c_shipped"
+#line 3 "/coreboot/util/bincfg/bincfg.lex.c_shipped"
 
 #define  YY_INT_ALIGNED short int
 
@@ -485,7 +485,7 @@
 #define YY_RESTORE_YY_MORE_OFFSET
 char *yytext;
 /*
- * blobtool - Compiler/Decompiler for data blobs with specs
+ * bincfg - Compiler/Decompiler for data blobs with specs
  * Copyright (C) 2017 Damien Zammit <damien at zamaudio.com>
  *
  * This program is free software: you can redistribute it and/or modify
@@ -501,7 +501,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include "blobtool.tab.h"
+#include "bincfg.tab.h"
 
 extern struct blob binary;
 
diff --git a/util/blobtool/blobtool.tab.c_shipped b/util/bincfg/bincfg.tab.c_shipped
similarity index 98%
rename from util/blobtool/blobtool.tab.c_shipped
rename to util/bincfg/bincfg.tab.c_shipped
index 06bbb15..a76f40e 100644
--- a/util/blobtool/blobtool.tab.c_shipped
+++ b/util/bincfg/bincfg.tab.c_shipped
@@ -299,7 +299,7 @@
 	/* Reset blob position to zero */
 	binary->bloblen = 0;
 
-	fprintf (fp, "# AUTOGENERATED SETTER BY BLOBTOOL\n{\n");
+	fprintf (fp, "# AUTOGENERATED SETTER BY BINCFG\n{\n");
 
 	/* Traverse spec and output bitfield setters based on blob values */
 	for (ptr = sym_table; ptr != (struct field *) 0; ptr = ptr->next) {
@@ -440,9 +440,9 @@
 #endif
 
 /* In a future release of Bison, this section will be replaced
-   by #include "blobtool.tab.h_shipped".  */
-#ifndef YY_YY_COREBOOT_UTIL_BLOBTOOL_BLOBTOOL_TAB_H_SHIPPED_INCLUDED
-# define YY_YY_COREBOOT_UTIL_BLOBTOOL_BLOBTOOL_TAB_H_SHIPPED_INCLUDED
+   by #include "bincfg.tab.h_shipped".  */
+#ifndef YY_YY_COREBOOT_UTIL_BINCFG_BINCFG_TAB_H_SHIPPED_INCLUDED
+# define YY_YY_COREBOOT_UTIL_BINCFG_BINCFG_TAB_H_SHIPPED_INCLUDED
 /* Debug traces.  */
 #ifndef YYDEBUG
 # define YYDEBUG 0
@@ -489,7 +489,7 @@
 
 int yyparse (void);
 
-#endif /* !YY_YY_COREBOOT_UTIL_BLOBTOOL_BLOBTOOL_TAB_H_SHIPPED_INCLUDED  */
+#endif /* !YY_YY_COREBOOT_UTIL_BINCFG_BINCFG_TAB_H_SHIPPED_INCLUDED  */
 
 /* Copy the second part of user declarations.  */
 
@@ -1979,10 +1979,10 @@
 		fclose(fp);
 	} else {
 		printf("Usage: Compile mode\n\n");
-		printf("       blobtool    spec  setter  binaryoutput\n");
+		printf("       bincfg    spec  setter  binaryoutput\n");
 		printf("                  (file) (file)     (file)\n");
 		printf(" OR  : Decompile mode\n\n");
-		printf("       blobtool -d spec  binary  setteroutput\n");
+		printf("       bincfg -d spec  binary  setteroutput\n");
 	}
 	return ret;
 }
diff --git a/util/blobtool/blobtool.tab.h_shipped b/util/bincfg/bincfg.tab.h_shipped
similarity index 90%
rename from util/blobtool/blobtool.tab.h_shipped
rename to util/bincfg/bincfg.tab.h_shipped
index 07d83ca..f1c223f 100644
--- a/util/blobtool/blobtool.tab.h_shipped
+++ b/util/bincfg/bincfg.tab.h_shipped
@@ -30,8 +30,8 @@
    This special exception was added by the Free Software Foundation in
    version 2.2 of Bison.  */
 
-#ifndef YY_YY_COREBOOT_UTIL_BLOBTOOL_BLOBTOOL_TAB_H_SHIPPED_INCLUDED
-# define YY_YY_COREBOOT_UTIL_BLOBTOOL_BLOBTOOL_TAB_H_SHIPPED_INCLUDED
+#ifndef YY_YY_COREBOOT_UTIL_BINCFG_BINCFG_TAB_H_SHIPPED_INCLUDED
+# define YY_YY_COREBOOT_UTIL_BINCFG_BINCFG_TAB_H_SHIPPED_INCLUDED
 /* Debug traces.  */
 #ifndef YYDEBUG
 # define YYDEBUG 0
@@ -78,4 +78,4 @@
 
 int yyparse (void);
 
-#endif /* !YY_YY_COREBOOT_UTIL_BLOBTOOL_BLOBTOOL_TAB_H_SHIPPED_INCLUDED  */
+#endif /* !YY_YY_COREBOOT_UTIL_BINCFG_BINCFG_TAB_H_SHIPPED_INCLUDED  */
diff --git a/util/blobtool/blobtool.y b/util/bincfg/bincfg.y
similarity index 97%
rename from util/blobtool/blobtool.y
rename to util/bincfg/bincfg.y
index 11f8db4..7a098cd 100644
--- a/util/blobtool/blobtool.y
+++ b/util/bincfg/bincfg.y
@@ -1,5 +1,5 @@
 /*
- * blobtool - Compiler/Decompiler for data blobs with specs
+ * bincfg - Compiler/Decompiler for data blobs with specs
  * Copyright (C) 2017 Damien Zammit <damien at zamaudio.com>
  *
  * This program is free software: you can redistribute it and/or modify
@@ -249,7 +249,7 @@
 	/* Reset blob position to zero */
 	binary->bloblen = 0;
 
-	fprintf (fp, "# AUTOGENERATED SETTER BY BLOBTOOL\n{\n");
+	fprintf (fp, "# AUTOGENERATED SETTER BY BINCFG\n{\n");
 
 	/* Traverse spec and output bitfield setters based on blob values */
 	for (ptr = sym_table; ptr != (struct field *) 0; ptr = ptr->next) {
@@ -542,10 +542,10 @@
 		fclose(fp);
 	} else {
 		printf("Usage: Compile mode\n\n");
-		printf("       blobtool    spec  setter  binaryoutput\n");
+		printf("       bincfg    spec  setter  binaryoutput\n");
 		printf("                  (file) (file)     (file)\n");
 		printf(" OR  : Decompile mode\n\n");
-		printf("       blobtool -d spec  binary  setteroutput\n");
+		printf("       bincfg -d spec  binary  setteroutput\n");
 	}
 	return ret;
 }
diff --git a/util/blobtool/ddr3_unregistered_spd_128.spec b/util/bincfg/ddr3_unregistered_spd_128.spec
similarity index 100%
rename from util/blobtool/ddr3_unregistered_spd_128.spec
rename to util/bincfg/ddr3_unregistered_spd_128.spec
diff --git a/util/blobtool/ddr3_unregistered_spd_256.spec b/util/bincfg/ddr3_unregistered_spd_256.spec
similarity index 100%
rename from util/blobtool/ddr3_unregistered_spd_256.spec
rename to util/bincfg/ddr3_unregistered_spd_256.spec
diff --git a/util/blobtool/gbe-ich9m.set b/util/bincfg/gbe-ich9m.set
similarity index 100%
rename from util/blobtool/gbe-ich9m.set
rename to util/bincfg/gbe-ich9m.set
diff --git a/util/blobtool/gbe-ich9m.spec b/util/bincfg/gbe-ich9m.spec
similarity index 100%
rename from util/blobtool/gbe-ich9m.spec
rename to util/bincfg/gbe-ich9m.spec
diff --git a/util/blobtool/ifd-x200.set b/util/bincfg/ifd-x200.set
similarity index 100%
rename from util/blobtool/ifd-x200.set
rename to util/bincfg/ifd-x200.set
diff --git a/util/blobtool/ifd-x200.spec b/util/bincfg/ifd-x200.spec
similarity index 100%
rename from util/blobtool/ifd-x200.spec
rename to util/bincfg/ifd-x200.spec
diff --git a/util/blobtool/it8718f-ec.spec b/util/bincfg/it8718f-ec.spec
similarity index 100%
rename from util/blobtool/it8718f-ec.spec
rename to util/bincfg/it8718f-ec.spec
diff --git a/util/blobtool/Makefile.inc b/util/blobtool/Makefile.inc
deleted file mode 100644
index 3434041..0000000
--- a/util/blobtool/Makefile.inc
+++ /dev/null
@@ -1,41 +0,0 @@
-blobtool_obj := blobtool.lex.o blobtool.tab.o
-
-BLOBTOOL_FLAGS += -I$(top)/util/blobtool -I$(objutil)/blobtool
-
-$(objutil)/blobtool:
-	mkdir -p $@
-
-$(objutil)/blobtool/.generated: $(objutil)/blobtool
-	touch $@
-
-$(objutil)/blobtool/%.o: util/blobtool/%.c | $(objutil)/blobtool/.generated
-	printf "    HOSTCC     $(subst $(obj)/,,$(@))\n"
-	$(HOSTCC) $(BLOBTOOL_FLAGS) $(HOSTCFLAGS) -c -o $@ $<
-
-$(objutil)/blobtool/%.o: $(objutil)/blobtool/%.c
-	printf "    HOSTCC     $(subst $(obj)/,,$(@))\n"
-	$(HOSTCC) $(BLOBTOOL_FLAGS) $(HOSTCFLAGS) -c -o $@ $<
-
-ifeq ($(CONFIG_UTIL_GENPARSER),y)
-$(top)/util/blobtool/blobtool.lex.c_shipped: $(top)/util/blobtool/blobtool.l
-	printf "    FLEX       $(subst $(top)/,,$(@))\n"
-	flex -L -o $@ $<
-
-# the .c rule also creates .h
-$(top)/util/blobtool/blobtool.tab.h_shipped: $(top)/util/blobtool/blobtool.tab.c_shipped
-$(top)/util/blobtool/blobtool.tab.c_shipped: $(top)/util/blobtool/blobtool.y
-	printf "    BISON      $(subst $(top)/,,$(@))\n"
-	bison -l --defines=$(top)/util/blobtool/blobtool.tab.h_shipped -o $@ $<
-endif
-
-$(objutil)/blobtool/blobtool.lex.o: $(objutil)/blobtool/blobtool.tab.h
-
-$(objutil)/blobtool/%: $(top)/util/blobtool/%_shipped
-	mkdir -p $(dir $@)
-	cp $< $@
-
-$(objutil)/blobtool/blobtool: $(addprefix $(objutil)/blobtool/,$(blobtool_obj))
-	printf "    HOSTCC     $(subst $(obj)/,,$(@)) (link)\n"
-	$(HOSTCC) $(BLOBTOOL_FLAGS) -o $@ $(addprefix $(objutil)/blobtool/,$(blobtool_obj))
-
-$(addprefix $(objutil)/blobtool/,$(blobtool_obj)) : $(objutil)/blobtool/blobtool.tab.h $(objutil)/blobtool/blobtool.tab.c $(objutil)/blobtool/blobtool.lex.c

-- 
To view, visit https://review.coreboot.org/23239
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I3339274f1c42df4bb4a6b30b9538d91c3c03d7d0
Gerrit-Change-Number: 23239
Gerrit-PatchSet: 1
Gerrit-Owner: Denis 'GNUtoo' Carikli <GNUtoo at no-log.org>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20180112/0c8bc86e/attachment-0001.html>


More information about the coreboot-gerrit mailing list