1 /*
2  * Copyright (c) 2020 Intel Corporation
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #include <zephyr/kernel.h>
8 #include <zephyr/init.h>
9 #include <zephyr/device.h>
10 #include <version.h>
11 
12 #if defined(CONFIG_BOOT_DELAY) && (CONFIG_BOOT_DELAY > 0)
13 #define DELAY_STR STRINGIFY(CONFIG_BOOT_DELAY)
14 #define BANNER_POSTFIX " (delayed boot " DELAY_STR "ms)"
15 #else
16 #define BANNER_POSTFIX ""
17 #endif
18 
19 #ifndef BANNER_VERSION
20 #ifdef BUILD_VERSION
21 #define BANNER_VERSION STRINGIFY(BUILD_VERSION)
22 #else
23 #define BANNER_VERSION KERNEL_VERSION_STRING
24 #endif
25 #endif
26 
boot_banner(void)27 void boot_banner(void)
28 {
29 #if defined(CONFIG_BOOT_DELAY) && (CONFIG_BOOT_DELAY > 0)
30 	printk("***** delaying boot " DELAY_STR "ms (per build configuration) *****\n");
31 	k_busy_wait(CONFIG_BOOT_DELAY * USEC_PER_MSEC);
32 #endif /* defined(CONFIG_BOOT_DELAY) && (CONFIG_BOOT_DELAY > 0) */
33 
34 #ifdef CONFIG_BOOT_BANNER
35 	printk("*** " CONFIG_BOOT_BANNER_STRING " " BANNER_VERSION BANNER_POSTFIX " ***\n");
36 #endif /* CONFIG_BOOT_BANNER */
37 }
38