/src/barebox/common/imd-barebox.c
Line | Count | Source |
1 | | // SPDX-License-Identifier: GPL-2.0-only |
2 | | |
3 | | #include <common.h> |
4 | | #include <image-metadata.h> |
5 | | #include <generated/compile.h> |
6 | | #include <generated/utsrelease.h> |
7 | | #include <generated/utsversion.h> |
8 | | |
9 | | /* |
10 | | * Mark a imd entry as used so that the linker cannot |
11 | | * throw it away. |
12 | | */ |
13 | | void imd_used(const void *used) |
14 | 0 | { |
15 | 0 | } |
16 | | |
17 | | struct imd_header imd_start_header |
18 | | __BAREBOX_IMD_SECTION(.barebox_imd_start) = { |
19 | | .type = cpu_to_le32(IMD_TYPE_START), |
20 | | }; |
21 | | |
22 | | struct imd_header imd_end_header |
23 | | __BAREBOX_IMD_SECTION(.barebox_imd_end) = { |
24 | | .type = cpu_to_le32(IMD_TYPE_END), |
25 | | }; |
26 | | |
27 | | #ifdef CONFIG_IMD_ENDIANNESS |
28 | | #ifdef CONFIG_CPU_LITTLE_ENDIAN |
29 | | #define IMD_ENDIANNESS "little" |
30 | | #else |
31 | | #define IMD_ENDIANNESS "big" |
32 | | #endif |
33 | | BAREBOX_IMD_TAG_STRING(imd_endianness_tag, IMD_TYPE_PARAMETER, |
34 | | "endianness=" IMD_ENDIANNESS, 1); |
35 | | #endif /* CONFIG_IMD_ENDIANNESS */ |
36 | | |
37 | | BAREBOX_IMD_TAG_STRING(imd_build_tag, IMD_TYPE_BUILD, UTS_VERSION, 1); |
38 | | BAREBOX_IMD_TAG_STRING(imd_release_tag, IMD_TYPE_RELEASE, UTS_RELEASE, 1); |
39 | | BAREBOX_IMD_TAG_STRING(imd_buildsystem_version_tag, IMD_TYPE_BUILDSYSTEM, BUILDSYSTEM_VERSION, 1); |
40 | | BAREBOX_IMD_CRC(imd_crc32, 0x0, 1); |