diff options
author | Hao Wu <wuhaotsh@google.com> | 2025-04-28 17:05:21 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-04-28 17:05:21 -0700 |
commit | d6e3386709b3e49322a94ffadc2aaab9944ab77b (patch) | |
tree | 10f0c53ca860fef470219ee99583eb4a6960375c | |
parent | 82bed5ca62295228ea7bcdc721b63db178f686e8 (diff) | |
parent | f8ab63506992f172238bd61823c1a6287a5edf51 (diff) | |
download | vbootrom-d6e3386709b3e49322a94ffadc2aaab9944ab77b.zip vbootrom-d6e3386709b3e49322a94ffadc2aaab9944ab77b.tar.gz vbootrom-d6e3386709b3e49322a94ffadc2aaab9944ab77b.tar.bz2 |
Merge pull request #7 from jamin-aspeed/issues-6
ast27x0: Show build date and git version
-rw-r--r-- | ast27x0/Makefile | 3 | ||||
-rw-r--r-- | ast27x0/image.c | 13 |
2 files changed, 12 insertions, 4 deletions
diff --git a/ast27x0/Makefile b/ast27x0/Makefile index 9fef3b1..3096884 100644 --- a/ast27x0/Makefile +++ b/ast27x0/Makefile @@ -19,6 +19,8 @@ CC ?= $(CROSS_COMPILE)gcc OBJCOPY ?= $(CROSS_COMPILE)objcopy OBJDUMP ?= $(CROSS_COMPILE)objdump +GIT_VERSION := git-$(shell git rev-parse --short HEAD) + # Why we use -no-pie -fno-pic in bare-metal builds: # # By default, modern GCC compilers enable PIE (Position-Independent Executable) @@ -39,6 +41,7 @@ OBJDUMP ?= $(CROSS_COMPILE)objdump CFLAGS = -Os -Wall -Wextra -g -mcpu=cortex-a35 -fno-stack-protector \ -no-pie -fno-pic \ -I ./include -I ../lib/libfdt -I ../lib/libc/minimal/include +CFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\" ASFLAGS = $(CFLAGS) -Wa,-mcpu=cortex-a35 LDSCRIPT = bootrom.ld MAPFILE = bootrom.map diff --git a/ast27x0/image.c b/ast27x0/image.c index ba27d6a..ab88ee7 100644 --- a/ast27x0/image.c +++ b/ast27x0/image.c @@ -61,10 +61,16 @@ static const char *splash_screen = "| | / / __ / / / / / / / / / / /_/ / / / / /|_/ /_____/ /| | \\__ \\ / / __/ / / /| / / / /\n" "| |/ / /_/ / /_/ / /_/ / / / / _, _/ /_/ / / / /_____/ ___ |___/ // / / __/ / // / /_/ /\n" "|___/_____/\\____/\\____/ /_/ /_/ |_|\\____/_/ /_/ /_/ |_/____//_/ /____/ /_//_/|_\\____/\n" - "\n" - "Version:1.0.0\n" "\n"; +static void print_build_info() +{ + uprintf("%s", splash_screen); + uprintf("Build Date : %s %s\n", __DATE__, __TIME__); + uprintf("FW Version : %s\n", GIT_VERSION); + uprintf("\n"); +} + /* * Remap 32-bit BootMCU load address to 64-bit Cortex-A35 DRAM address. * BootMCU loads the U-BOOT FIT image to a 32-bit address (e.g. 0x80000000), @@ -369,8 +375,7 @@ uint64_t load_boot_image(void) uart_aspeed_init(UART12); uart_console_register(&ucons); - uprintf("%s", splash_screen); - + print_build_info(); fit_blob = find_fit_image(FIT_SEARCH_START, FIT_SEARCH_END, FIT_SEARCH_STEP); |