Nico Huber has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/30581
Change subject: [TEST] squashed patches ......................................................................
[TEST] squashed patches
Change-Id: I29d54846d8bf81053ba95710dd928f1dd4db522d Signed-off-by: Nico Huber nico.h@gmx.de --- M Makefile M Makefile.inc M payloads/external/LinuxBoot/Kconfig M src/device/Kconfig M src/drivers/intel/gma/hires_fb/gma.adb M src/lib/Makefile.inc A src/lib/cb.ads M src/mainboard/intel/glkrvp/Kconfig M util/kconfig/confdata.c 9 files changed, 169 insertions(+), 7 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/81/30581/1
diff --git a/Makefile b/Makefile index f12b616..3acb97d 100644 --- a/Makefile +++ b/Makefile @@ -44,6 +44,7 @@
DOTCONFIG ?= $(top)/.config KCONFIG_CONFIG = $(DOTCONFIG) +KCONFIG_AUTOADS := $(obj)/cb-config.ads KCONFIG_AUTOHEADER := $(obj)/config.h KCONFIG_AUTOCONFIG := $(obj)/auto.conf KCONFIG_DEPENDENCIES := $(obj)/auto.conf.cmd @@ -51,10 +52,12 @@ KCONFIG_TRISTATE := $(obj)/tristate.conf KCONFIG_NEGATIVES := 1 KCONFIG_STRICT := 1 +KCONFIG_PACKAGE := CB.Config
COREBOOT_EXPORTS += KCONFIG_CONFIG KCONFIG_AUTOHEADER KCONFIG_AUTOCONFIG COREBOOT_EXPORTS += KCONFIG_DEPENDENCIES KCONFIG_SPLITCONFIG KCONFIG_TRISTATE COREBOOT_EXPORTS += KCONFIG_NEGATIVES KCONFIG_STRICT +COREBOOT_EXPORTS += KCONFIG_AUTOADS KCONFIG_PACKAGE
# directory containing the toplevel Makefile.inc TOPLEVEL := . @@ -179,6 +182,12 @@ $(KCONFIG_AUTOHEADER): $(KCONFIG_CONFIG) $(objutil)/kconfig/conf +$(MAKE) oldconfig
+$(KCONFIG_AUTOADS): $(KCONFIG_AUTOHEADER) + true + +$(obj)/%/$(notdir $(KCONFIG_AUTOADS)): $(KCONFIG_AUTOADS) + cp $< $@ + # Add a new class of source/object files to the build system add-class= \ $(eval $(1)-srcs:=) \ @@ -263,6 +272,11 @@ # Eliminate duplicate mentions of source files in a class $(foreach class,$(classes),$(eval $(class)-srcs:=$(sort $($(class)-srcs))))
+# Build Kconfig .ads if necessary +ifeq ($(CONFIG_RAMSTAGE_ADA),y) +ramstage-srcs += $(obj)/ramstage/$(notdir $(KCONFIG_AUTOADS)) +endif + # To track dependencies, we need all Ada specification (.ads) files in # *-srcs. Extract / filter all specification files that have a matching # body (.adb) file here (specifications without a body are valid sources @@ -311,7 +325,7 @@ ifn$(EMPTY)def $(1)-objs_$(2)_template de$(EMPTY)fine $(1)-objs_$(2)_template ifn$(EMPTY)eq ($(filter ads adb,$(2)),) -$$(call src-to-obj,$1,$$(1).$2): $$(1).$2 $$(call create_ada_deps,$1,$$(call src-to-ali,$1,$$(1).$2)) $(KCONFIG_AUTOHEADER) $(4) +$$(call src-to-obj,$1,$$(1).$2): $$(1).$2 $$(call create_ada_deps,$1,$$(call src-to-ali,$1,$$(1).$2)) $(4) @printf " GCC $$$$(subst $$$$(obj)/,,$$$$(@))\n" $(GCC_$(1)) \ $$$$(ADAFLAGS_$(1)) $$$$(addprefix -I,$$$$($(1)-ada-dirs)) \ diff --git a/Makefile.inc b/Makefile.inc index b25ac6b..4292e79 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -210,7 +210,9 @@ bootblock-c-deps:=$$(OPTION_TABLE_H) $(foreach type,ads adb, \ $(foreach stage,$(COREBOOT_STANDARD_STAGES), \ - $(eval $(stage)-$(type)-deps := $(obj)/libgnat-$(ARCH-$(stage)-y)/libgnat.a))) + $(eval $(stage)-$(type)-deps := \ + $(obj)/$(stage)/$(notdir $(KCONFIG_AUTOADS)) \ + $(obj)/libgnat-$(ARCH-$(stage)-y)/libgnat.a)))
# Add handler to copy linker scripts define generic-objs_ld_template_gen diff --git a/payloads/external/LinuxBoot/Kconfig b/payloads/external/LinuxBoot/Kconfig index 3b8b70c..31b238c 100644 --- a/payloads/external/LinuxBoot/Kconfig +++ b/payloads/external/LinuxBoot/Kconfig @@ -219,7 +219,7 @@
endif #LINUXBOOT_BUILD_INITRAMFS
-choice LINUXBOOT_INITRAMFS_COMPRESSION +choice prompt "Initramfs compression format" default LINUXBOOT_INITRAMFS_COMPRESSION_XZ
diff --git a/src/device/Kconfig b/src/device/Kconfig index 85f1d65..f868d2f 100644 --- a/src/device/Kconfig +++ b/src/device/Kconfig @@ -445,6 +445,16 @@ def_bool y depends on VBE_LINEAR_FRAMEBUFFER || GENERIC_LINEAR_FRAMEBUFFER
+config LINEAR_FRAMEBUFFER_MAX_WIDTH + int "Maximum width in pixels" + depends on MAINBOARD_USE_LIBGFXINIT && LINEAR_FRAMEBUFFER + default 4096 + +config LINEAR_FRAMEBUFFER_MAX_HEIGHT + int "Maximum height in pixels" + depends on MAINBOARD_USE_LIBGFXINIT && LINEAR_FRAMEBUFFER + default 4096 + endmenu # "Display"
config SMBUS_HAS_AUX_CHANNELS diff --git a/src/drivers/intel/gma/hires_fb/gma.adb b/src/drivers/intel/gma/hires_fb/gma.adb index bd14132..1437ce2 100644 --- a/src/drivers/intel/gma/hires_fb/gma.adb +++ b/src/drivers/intel/gma/hires_fb/gma.adb @@ -1,3 +1,7 @@ +with CB.Config; + +use CB.Config; + with HW.GFX; with HW.GFX.Framebuffer_Filler; with HW.GFX.GMA; @@ -60,8 +64,8 @@
success : boolean;
- min_h : pos32 := pos32'last; - min_v : pos32 := pos32'last; + min_h : pos32 := LINEAR_FRAMEBUFFER_MAX_WIDTH; + min_v : pos32 := LINEAR_FRAMEBUFFER_MAX_HEIGHT; begin lightup_ok := 0;
diff --git a/src/lib/Makefile.inc b/src/lib/Makefile.inc index 2fd4e4c..1bfe9cd 100644 --- a/src/lib/Makefile.inc +++ b/src/lib/Makefile.inc @@ -295,6 +295,8 @@ $(obj)/%.elf.rmod: $(obj)/%.elf | $(RMODTOOL) $(RMODTOOL) -i $< -o $@
+ramstage-$(CONFIG_RAMSTAGE_ADA) += cb.ads + ifeq ($(CONFIG_RAMSTAGE_LIBHWBASE),y)
to-ada-hex = $(eval $(1) := 16\#$(patsubst 0x%,%,$($(1)))\#) diff --git a/src/lib/cb.ads b/src/lib/cb.ads new file mode 100644 index 0000000..41a2a42 --- /dev/null +++ b/src/lib/cb.ads @@ -0,0 +1,2 @@ +package CB is +end CB; diff --git a/src/mainboard/intel/glkrvp/Kconfig b/src/mainboard/intel/glkrvp/Kconfig index 9484559..94207ba 100644 --- a/src/mainboard/intel/glkrvp/Kconfig +++ b/src/mainboard/intel/glkrvp/Kconfig @@ -19,7 +19,7 @@ def_bool n select SYSTEM_TYPE_LAPTOP
-choice GLK_EC +choice prompt "ON BOARD EC" default GLK_CHROME_EC help diff --git a/util/kconfig/confdata.c b/util/kconfig/confdata.c index fc4a07a..a4c602c 100644 --- a/util/kconfig/confdata.c +++ b/util/kconfig/confdata.c @@ -634,6 +634,99 @@ };
/* + * Ada spec printer + */ +static void +spec_print_symbol(FILE *fp, struct symbol *sym, const char *value, void *arg) +{ + switch (sym->type) { + case S_BOOLEAN: + case S_TRISTATE: + switch (*value) { + case 'n': + if (getenv("KCONFIG_NEGATIVES")) { + fprintf(fp, + " %-37s : constant boolean := false;\n", + sym->name); + } + break; + case 'm': + fprintf(fp, " %s_MODULE : constant boolean := true;\n", + sym->name); + break; + default: + fprintf(fp, " %-37s : constant boolean := true;\n", + sym->name); + break; + } + break; + case S_HEX: { + unsigned int hexlen; + + if (!value || (value[0] == '\0')) + value = "0"; + else if (value[0] == '0' && (value[1] == 'x' || value[1] == 'X')) + value += 2; + + fprintf(fp, " %-37s : constant := 16#", + sym->name); + for (hexlen = strlen(value); hexlen > 0;) { + const unsigned int len = hexlen % 4 ? : 4; + char quad[] = "0000"; + unsigned int i; + + for (i = 0; i < len; ++i) + quad[4 - len + i] = value[i]; + fprintf(fp, "%s", quad); + + value += len; + hexlen -= len; + if (hexlen > 0) + fprintf(fp, "_"); + } + fprintf(fp, "#;\n"); + break; + } + case S_INT: + if (!value || (value[0] == '\0')) + value = "0"; + fprintf(fp, " %-37s : constant := %s;\n", sym->name, value); + break; + case S_STRING: + fprintf(fp, " %-37s : constant string := %s;\n", sym->name, value); + break; + default: + break; + } +} + +static void +spec_print_comment(FILE *fp, const char *value, void *arg) +{ + const char *p = value; + size_t l; + + for (;;) { + l = strcspn(p, "\n"); + fprintf(fp, "--"); + if (l) { + fprintf(fp, " "); + xfwrite(p, l, 1, fp); + p += l; + } + fprintf(fp, "\n"); + if (*p++ == '\0') + break; + } +} + +static struct conf_printer spec_printer_cb = +{ + .print_symbol = spec_print_symbol, + .print_comment = spec_print_comment, +}; + +/* * Tristate printer * * This printer is used when generating the `include/config/tristate.conf' file. @@ -985,7 +1078,7 @@ { struct symbol *sym; const char *name; - FILE *out, *tristate, *out_h; + FILE *out, *tristate, *out_h, *out_ads; int i; int print_negatives;
@@ -1045,12 +1138,36 @@ return 1; }
+ char *tmpconfig_ads = malloc(PATH_MAX); + if (getenv("COREBOOT_BUILD_DIR")) { + sprintf(tmpconfig_ads, "%s/.tmpconfig_tristate.XXXXXX", + getenv("COREBOOT_BUILD_DIR")); + } else { + sprintf(tmpconfig_ads, ".tmpconfig_tristate.XXXXXX"); + } + if ((i = mkstemp(tmpconfig_ads)) == -1) + return 1; + out_ads = fdopen(i, "w"); + if (!out_ads) { + fclose(out_h); + fclose(out); + fclose(tristate); + return 1; + } + conf_write_heading(out, &kconfig_printer_cb, NULL);
conf_write_heading(tristate, &tristate_printer_cb, NULL);
conf_write_heading(out_h, &header_printer_cb, NULL);
+ conf_write_heading(out_ads, &spec_printer_cb, NULL); + + const char *package = getenv("KCONFIG_PACKAGE"); + if (!package) + package = "KConfig"; + fprintf(out_ads, "\npackage %s is\n\n", package); + for_all_symbols(i, sym) { sym_calc_value(sym); if (!sym->name) @@ -1072,11 +1189,22 @@ conf_write_symbol(tristate, sym, &tristate_printer_cb, print_negatives?NULL:(void *)1);
conf_write_symbol(out_h, sym, &header_printer_cb, NULL); + + conf_write_symbol(out_ads, sym, &spec_printer_cb, NULL); } + + fprintf(out_ads, "\nend %s;\n", package); + fclose(out); fclose(tristate); fclose(out_h); + fclose(out_ads);
+ name = getenv("KCONFIG_AUTOADS"); + if (!name) + name = "include/generated/autoconf.ads"; + if (rename(tmpconfig_ads, name)) + return 1; name = getenv("KCONFIG_AUTOHEADER"); if (!name) name = "include/generated/autoconf.h";