diff options
author | Denis 'GNUtoo' Carikli <GNUtoo@no-log.org> | 2018-01-10 14:35:55 +0100 |
---|---|---|
committer | Nico Huber <nico.h@gmx.de> | 2018-01-18 13:47:20 +0000 |
commit | 780e931eed8937bd8e304449913f487fa1d056c5 (patch) | |
tree | 24446641394bdabfee26130913eed808fe658ffa | |
parent | 86391f16054ff1aa8af75b552204d24f3c00d50e (diff) | |
download | coreboot-780e931eed8937bd8e304449913f487fa1d056c5.tar.xz |
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@no-log.org>
Reviewed-on: https://review.coreboot.org/23239
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Kocialkowski <contact@paulk.fr>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | Makefile.inc | 6 | ||||
-rw-r--r-- | src/Kconfig | 4 | ||||
-rw-r--r-- | util/bincfg/Makefile (renamed from util/blobtool/Makefile) | 8 | ||||
-rw-r--r-- | util/bincfg/Makefile.inc | 41 | ||||
-rw-r--r-- | util/bincfg/bincfg.l (renamed from util/blobtool/blobtool.l) | 4 | ||||
-rw-r--r-- | util/bincfg/bincfg.lex.c_shipped (renamed from util/blobtool/blobtool.lex.c_shipped) | 6 | ||||
-rw-r--r-- | util/bincfg/bincfg.tab.c_shipped (renamed from util/blobtool/blobtool.tab.c_shipped) | 14 | ||||
-rw-r--r-- | util/bincfg/bincfg.tab.h_shipped (renamed from util/blobtool/blobtool.tab.h_shipped) | 6 | ||||
-rw-r--r-- | util/bincfg/bincfg.y (renamed from util/blobtool/blobtool.y) | 8 | ||||
-rw-r--r-- | util/bincfg/ddr3_unregistered_spd_128.spec (renamed from util/blobtool/ddr3_unregistered_spd_128.spec) | 0 | ||||
-rw-r--r-- | util/bincfg/ddr3_unregistered_spd_256.spec (renamed from util/blobtool/ddr3_unregistered_spd_256.spec) | 0 | ||||
-rw-r--r-- | util/bincfg/gbe-ich9m.set (renamed from util/blobtool/gbe-ich9m.set) | 0 | ||||
-rw-r--r-- | util/bincfg/gbe-ich9m.spec (renamed from util/blobtool/gbe-ich9m.spec) | 0 | ||||
-rw-r--r-- | util/bincfg/ifd-x200.set (renamed from util/blobtool/ifd-x200.set) | 0 | ||||
-rw-r--r-- | util/bincfg/ifd-x200.spec (renamed from util/blobtool/ifd-x200.spec) | 0 | ||||
-rw-r--r-- | util/bincfg/it8718f-ec.spec (renamed from util/blobtool/it8718f-ec.spec) | 0 | ||||
-rw-r--r-- | util/blobtool/Makefile.inc | 41 |
18 files changed, 70 insertions, 70 deletions
diff --git a/.gitignore b/.gitignore index e3fa3fe94f..7ee954db44 100644 --- a/.gitignore +++ b/.gitignore @@ -84,7 +84,7 @@ util/*/.test 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 ca157a29ab..2c25ab8910 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -88,7 +88,7 @@ subdirs-y += src/superio 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 @@ -497,7 +497,7 @@ $(ROMCC_BIN): $(top)/util/romcc/romcc.c @# 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): @@ -578,7 +578,7 @@ gitconfig: 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 e362281c77..459280dc1d 100644 --- a/src/Kconfig +++ b/src/Kconfig @@ -104,11 +104,11 @@ config FMD_GENPARSER 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/util/blobtool/Makefile b/util/bincfg/Makefile index ee706db536..1b3e93643e 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 @@ $(TARGET).tab.c $(TARGET).tab.h: $(TARGET).y # 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 0000000000..81c6af63b2 --- /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 index b80cc5550d..f9e880f333 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@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 index df5b0609c5..44a76a1a25 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 @@ int yy_flex_debug = 0; #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@zamaudio.com> * * This program is free software: you can redistribute it and/or modify @@ -501,7 +501,7 @@ char *yytext; #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 index 06bbb15d08..a76f40ecbd 100644 --- a/util/blobtool/blobtool.tab.c_shipped +++ b/util/bincfg/bincfg.tab.c_shipped @@ -299,7 +299,7 @@ static void generate_setter_bitfields(unsigned char *bin) /* 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 @@ static void generate_binary(void) #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 @@ extern YYSTYPE yylval; 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 @@ int main (int argc, char *argv[]) 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 index 07d83ca4f0..f1c223f1fe 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 @@ extern YYSTYPE yylval; 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 index 11f8db4886..7a098cd258 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@zamaudio.com> * * This program is free software: you can redistribute it and/or modify @@ -249,7 +249,7 @@ static void generate_setter_bitfields(unsigned char *bin) /* 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 @@ int main (int argc, char *argv[]) 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 index 3bf027af80..3bf027af80 100644 --- a/util/blobtool/ddr3_unregistered_spd_128.spec +++ b/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 index d9cf51e857..d9cf51e857 100644 --- a/util/blobtool/ddr3_unregistered_spd_256.spec +++ b/util/bincfg/ddr3_unregistered_spd_256.spec diff --git a/util/blobtool/gbe-ich9m.set b/util/bincfg/gbe-ich9m.set index 01f85aba86..01f85aba86 100644 --- a/util/blobtool/gbe-ich9m.set +++ b/util/bincfg/gbe-ich9m.set diff --git a/util/blobtool/gbe-ich9m.spec b/util/bincfg/gbe-ich9m.spec index 45eed0e043..45eed0e043 100644 --- a/util/blobtool/gbe-ich9m.spec +++ b/util/bincfg/gbe-ich9m.spec diff --git a/util/blobtool/ifd-x200.set b/util/bincfg/ifd-x200.set index 255eb88b70..255eb88b70 100644 --- a/util/blobtool/ifd-x200.set +++ b/util/bincfg/ifd-x200.set diff --git a/util/blobtool/ifd-x200.spec b/util/bincfg/ifd-x200.spec index 0cdbb9d2dd..0cdbb9d2dd 100644 --- a/util/blobtool/ifd-x200.spec +++ b/util/bincfg/ifd-x200.spec diff --git a/util/blobtool/it8718f-ec.spec b/util/bincfg/it8718f-ec.spec index 7fa325f203..7fa325f203 100644 --- a/util/blobtool/it8718f-ec.spec +++ b/util/bincfg/it8718f-ec.spec diff --git a/util/blobtool/Makefile.inc b/util/blobtool/Makefile.inc deleted file mode 100644 index 34340412c8..0000000000 --- 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 |