mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-10 15:14:43 +00:00
Merge branch '2021-09-22-general-updates' into next
- Some sandbox improvements - Make cleanups related to the overusage of the exact build time variable.
This commit is contained in:
commit
63823da4b9
54 changed files with 294 additions and 105 deletions
|
@ -9,7 +9,6 @@
|
|||
#include <init.h>
|
||||
#include <ram.h>
|
||||
#include <spl.h>
|
||||
#include <version.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/arch-rockchip/bootrom.h>
|
||||
#include <asm/arch-rockchip/sdram_px30.h>
|
||||
|
|
|
@ -16,6 +16,10 @@
|
|||
#include <asm/arch-rockchip/bootrom.h>
|
||||
#include <linux/bitops.h>
|
||||
|
||||
#if CONFIG_IS_ENABLED(BANNER_PRINT)
|
||||
#include <timestamp.h>
|
||||
#endif
|
||||
|
||||
#define TIMER_LOAD_COUNT_L 0x00
|
||||
#define TIMER_LOAD_COUNT_H 0x04
|
||||
#define TIMER_CONTROL_REG 0x10
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
|
||||
#include <asm-offsets.h>
|
||||
#include <config.h>
|
||||
#include "version.h"
|
||||
#include <asm/cache.h>
|
||||
|
||||
#define _START _start
|
||||
|
@ -489,7 +488,4 @@ _int_handler:
|
|||
|
||||
/******************************************************************************/
|
||||
|
||||
.globl version_string
|
||||
version_string:
|
||||
.ascii U_BOOT_VERSION_STRING, "\0"
|
||||
.align 4
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
|
||||
#include <asm-offsets.h>
|
||||
#include <config.h>
|
||||
#include "version.h"
|
||||
#include <asm/cache.h>
|
||||
|
||||
#define _START _start
|
||||
|
@ -253,7 +252,4 @@ _int_handler:
|
|||
|
||||
/******************************************************************************/
|
||||
|
||||
.globl version_string
|
||||
version_string:
|
||||
.ascii U_BOOT_VERSION_STRING, "\0"
|
||||
.align 4
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
|
||||
#include <asm-offsets.h>
|
||||
#include <config.h>
|
||||
#include "version.h"
|
||||
#include <asm/cache.h>
|
||||
|
||||
#define _START _start
|
||||
|
@ -335,7 +334,4 @@ _int_handler:
|
|||
|
||||
/******************************************************************************/
|
||||
|
||||
.globl version_string
|
||||
version_string:
|
||||
.ascii U_BOOT_VERSION_STRING, "\0"
|
||||
.align 4
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
|
||||
#include <asm-offsets.h>
|
||||
#include <config.h>
|
||||
#include "version.h"
|
||||
#include <asm/cache.h>
|
||||
|
||||
#define _START _start
|
||||
|
@ -258,9 +257,4 @@ _int_handler:
|
|||
|
||||
/******************************************************************************/
|
||||
|
||||
.globl version_string
|
||||
version_string:
|
||||
.ascii U_BOOT_VERSION
|
||||
.ascii " (", U_BOOT_DATE, " - ", U_BOOT_TIME, ")"
|
||||
.ascii CONFIG_IDENT_STRING, "\0"
|
||||
.align 4
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
|
||||
#include <asm-offsets.h>
|
||||
#include <config.h>
|
||||
#include "version.h"
|
||||
#include <asm/cache.h>
|
||||
|
||||
#define _START _start
|
||||
|
@ -268,7 +267,4 @@ _int_handler:
|
|||
|
||||
/******************************************************************************/
|
||||
|
||||
.globl version_string
|
||||
version_string:
|
||||
.ascii U_BOOT_VERSION_STRING, "\0"
|
||||
.align 4
|
||||
|
|
|
@ -10,8 +10,6 @@
|
|||
#include <common.h>
|
||||
#include <asm-offsets.h>
|
||||
#include <config.h>
|
||||
#include <timestamp.h>
|
||||
#include "version.h"
|
||||
#include <asm/cache.h>
|
||||
|
||||
#define _START _start
|
||||
|
@ -610,7 +608,4 @@ _int_handler:
|
|||
|
||||
/******************************************************************************/
|
||||
|
||||
.globl version_string
|
||||
version_string:
|
||||
.ascii U_BOOT_VERSION_STRING, "\0"
|
||||
.align 4
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include <config.h>
|
||||
|
||||
OUTPUT_ARCH(m68k)
|
||||
ENTRY(_start)
|
||||
|
||||
#ifndef LDS_BOARD_TEXT
|
||||
#define LDS_BOARD_TEXT
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
|
||||
#include <asm-offsets.h>
|
||||
#include <config.h>
|
||||
#include <version.h>
|
||||
|
||||
/*
|
||||
* icache and dcache configuration used only for start.S.
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
#include <asm-offsets.h>
|
||||
#include <config.h>
|
||||
#include <mpc83xx.h>
|
||||
#include <version.h>
|
||||
|
||||
#define CONFIG_83XX 1 /* needed for Linux kernel header files*/
|
||||
|
||||
|
@ -92,12 +91,6 @@
|
|||
*/
|
||||
.long 0x27051956 /* U-Boot Magic Number */
|
||||
|
||||
.globl version_string
|
||||
version_string:
|
||||
.ascii U_BOOT_VERSION_STRING, "\0"
|
||||
|
||||
.align 2
|
||||
|
||||
.globl enable_addr_trans
|
||||
enable_addr_trans:
|
||||
/* enable address translation */
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
#include <asm-offsets.h>
|
||||
#include <config.h>
|
||||
#include <mpc85xx.h>
|
||||
#include <version.h>
|
||||
|
||||
#include <ppc_asm.tmpl>
|
||||
#include <ppc_defs.h>
|
||||
|
@ -1138,11 +1137,7 @@ switch_as:
|
|||
.globl _start
|
||||
_start:
|
||||
.long 0x27051956 /* U-BOOT Magic Number */
|
||||
.globl version_string
|
||||
version_string:
|
||||
.ascii U_BOOT_VERSION_STRING, "\0"
|
||||
|
||||
.align 4
|
||||
.globl _start_cont
|
||||
_start_cont:
|
||||
/* Setup the stack in initial RAM,could be L2-as-SRAM or L1 dcache*/
|
||||
|
|
|
@ -23,7 +23,6 @@
|
|||
#include <asm-offsets.h>
|
||||
#include <config.h>
|
||||
#include <mpc8xx.h>
|
||||
#include <version.h>
|
||||
|
||||
#include <ppc_asm.tmpl>
|
||||
#include <ppc_defs.h>
|
||||
|
@ -62,9 +61,6 @@
|
|||
*/
|
||||
.text
|
||||
.long 0x27051956 /* U-Boot Magic Number */
|
||||
.globl version_string
|
||||
version_string:
|
||||
.ascii U_BOOT_VERSION_STRING, "\0"
|
||||
|
||||
. = EXC_OFF_SYS_RESET
|
||||
.globl _start
|
||||
|
|
|
@ -133,6 +133,19 @@ int os_write_file(const char *fname, const void *buf, int size)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int os_filesize(int fd)
|
||||
{
|
||||
off_t size;
|
||||
|
||||
size = os_lseek(fd, 0, OS_SEEK_END);
|
||||
if (size < 0)
|
||||
return -errno;
|
||||
if (os_lseek(fd, 0, OS_SEEK_SET) < 0)
|
||||
return -errno;
|
||||
|
||||
return size;
|
||||
}
|
||||
|
||||
int os_read_file(const char *fname, void **bufp, int *sizep)
|
||||
{
|
||||
off_t size;
|
||||
|
@ -144,15 +157,12 @@ int os_read_file(const char *fname, void **bufp, int *sizep)
|
|||
printf("Cannot open file '%s'\n", fname);
|
||||
goto err;
|
||||
}
|
||||
size = os_lseek(fd, 0, OS_SEEK_END);
|
||||
size = os_filesize(fd);
|
||||
if (size < 0) {
|
||||
printf("Cannot seek to end of file '%s'\n", fname);
|
||||
goto err;
|
||||
}
|
||||
if (os_lseek(fd, 0, OS_SEEK_SET) < 0) {
|
||||
printf("Cannot seek to start of file '%s'\n", fname);
|
||||
printf("Cannot get file size of '%s'\n", fname);
|
||||
goto err;
|
||||
}
|
||||
|
||||
*bufp = os_malloc(size);
|
||||
if (!*bufp) {
|
||||
printf("Not enough memory to read file '%s'\n", fname);
|
||||
|
@ -172,6 +182,35 @@ err:
|
|||
return ret;
|
||||
}
|
||||
|
||||
int os_map_file(const char *pathname, int os_flags, void **bufp, int *sizep)
|
||||
{
|
||||
void *ptr;
|
||||
int size;
|
||||
int ifd;
|
||||
|
||||
ifd = os_open(pathname, os_flags);
|
||||
if (ifd < 0) {
|
||||
printf("Cannot open file '%s'\n", pathname);
|
||||
return -EIO;
|
||||
}
|
||||
size = os_filesize(ifd);
|
||||
if (size < 0) {
|
||||
printf("Cannot get file size of '%s'\n", pathname);
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
ptr = mmap(0, size, PROT_READ | PROT_WRITE, MAP_SHARED, ifd, 0);
|
||||
if (ptr == MAP_FAILED) {
|
||||
printf("Can't map file '%s': %s\n", pathname, strerror(errno));
|
||||
return -EPERM;
|
||||
}
|
||||
|
||||
*bufp = ptr;
|
||||
*sizep = size;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Restore tty state when we exit */
|
||||
static struct termios orig_term;
|
||||
static bool term_setup;
|
||||
|
@ -690,7 +729,6 @@ static int add_args(char ***argvp, char *add_args[], int count)
|
|||
continue;
|
||||
}
|
||||
} else if (!strcmp(arg, "--rm_memory")) {
|
||||
ap++;
|
||||
continue;
|
||||
}
|
||||
argv[argc++] = arg;
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* Overlay test file
|
||||
*/
|
||||
|
||||
/dts-v1/;
|
||||
/plugin/;
|
||||
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* Overlay test file
|
||||
*/
|
||||
|
||||
/dts-v1/;
|
||||
/plugin/;
|
||||
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* Main sandbox devicetree
|
||||
*/
|
||||
|
||||
/dts-v1/;
|
||||
|
||||
#include <config.h>
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* This is the common sandbox device-tree nodes. This is shared between sandbox
|
||||
* and sandbox64 builds.
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* Main sandbox64 devicetree
|
||||
*/
|
||||
/dts-v1/;
|
||||
|
||||
#include <config.h>
|
||||
|
|
|
@ -1,3 +1,12 @@
|
|||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* Devicetree file for running sandbox tests
|
||||
*
|
||||
* This includes lots of extra devices used by various tests.
|
||||
*
|
||||
* Note that SPL use the main sandbox.dts file
|
||||
*/
|
||||
|
||||
/dts-v1/;
|
||||
|
||||
#include <dt-bindings/gpio/gpio.h>
|
||||
|
|
|
@ -33,7 +33,6 @@
|
|||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <version.h>
|
||||
#include <asm/arch/mrc.h>
|
||||
#include <asm/arch/msg_port.h>
|
||||
#include "mrc_util.h"
|
||||
|
@ -191,8 +190,7 @@ void mrc_init(struct mrc_params *mrc_params)
|
|||
{
|
||||
ENTERFN();
|
||||
|
||||
DPF(D_INFO, "MRC Version %04x %s %s\n", MRC_VERSION,
|
||||
U_BOOT_DATE, U_BOOT_TIME);
|
||||
DPF(D_INFO, "MRC Version %04x\n", MRC_VERSION);
|
||||
|
||||
/* Set up the data structures used by mrc_mem_init() */
|
||||
mrc_adjust_params(mrc_params);
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
#include <dm/uclass-internal.h>
|
||||
#include <mapmem.h>
|
||||
#include <serial.h>
|
||||
#include <version.h>
|
||||
#include <acpi/acpigen.h>
|
||||
#include <acpi/acpi_device.h>
|
||||
#include <acpi/acpi_table.h>
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
#include <i2c.h>
|
||||
#include <init.h>
|
||||
#include <nand.h>
|
||||
#include <version.h>
|
||||
#include <asm/global_data.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/arch/at91_common.h>
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
#include <panel.h>
|
||||
#include <rtc.h>
|
||||
#include <spi_flash.h>
|
||||
#include <version.h>
|
||||
#include <version_string.h>
|
||||
|
||||
#include "../common/vpd_reader.h"
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
#include <power/pmic.h>
|
||||
#include <input.h>
|
||||
#include <pwm.h>
|
||||
#include <version.h>
|
||||
#include <version_string.h>
|
||||
#include <stdlib.h>
|
||||
#include <dm/root.h>
|
||||
#include "../common/ge_rtc.h"
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
#include <fsl_pmic.h>
|
||||
#include <linux/fb.h>
|
||||
#include <ipu_pixfmt.h>
|
||||
#include <version.h>
|
||||
#include <version_string.h>
|
||||
#include <watchdog.h>
|
||||
#include "ppd_gpio.h"
|
||||
#include <stdlib.h>
|
||||
|
|
|
@ -30,7 +30,6 @@
|
|||
#include <netdev.h>
|
||||
#include <nand.h>
|
||||
#include <spi.h>
|
||||
#include <version.h>
|
||||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
* Copyright (C) 2017 Chris Brandt
|
||||
*/
|
||||
#include <config.h>
|
||||
#include <version.h>
|
||||
#include <asm/macro.h>
|
||||
|
||||
/* Watchdog Registers */
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
#include <env.h>
|
||||
#include <spi.h>
|
||||
#include <i2c.h>
|
||||
#include <timestamp.h>
|
||||
#include <version.h>
|
||||
#include <vsprintf.h>
|
||||
#include <linux/delay.h>
|
||||
|
|
|
@ -6,13 +6,18 @@
|
|||
|
||||
#include <common.h>
|
||||
#include <command.h>
|
||||
#include <timestamp.h>
|
||||
#include <version.h>
|
||||
#include <version_string.h>
|
||||
#include <linux/compiler.h>
|
||||
#ifdef CONFIG_SYS_COREBOOT
|
||||
#include <asm/cb_sysinfo.h>
|
||||
#endif
|
||||
|
||||
const char __weak version_string[] = U_BOOT_VERSION_STRING;
|
||||
#define U_BOOT_VERSION_STRING U_BOOT_VERSION " (" U_BOOT_DATE " - " \
|
||||
U_BOOT_TIME " " U_BOOT_TZ ")" CONFIG_IDENT_STRING
|
||||
|
||||
const char version_string[] = U_BOOT_VERSION_STRING;
|
||||
|
||||
static int do_version(struct cmd_tbl *cmdtp, int flag, int argc,
|
||||
char *const argv[])
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
#include <env.h>
|
||||
#include <init.h>
|
||||
#include <net.h>
|
||||
#include <version.h>
|
||||
#include <version_string.h>
|
||||
#include <efi_loader.h>
|
||||
|
||||
static void run_preboot_environment_command(void)
|
||||
|
|
|
@ -24,6 +24,9 @@
|
|||
#include <nand.h>
|
||||
#include <fat.h>
|
||||
#include <u-boot/crc.h>
|
||||
#if CONFIG_IS_ENABLED(BANNER_PRINT)
|
||||
#include <timestamp.h>
|
||||
#endif
|
||||
#include <version.h>
|
||||
#include <image.h>
|
||||
#include <malloc.h>
|
||||
|
|
|
@ -600,6 +600,11 @@ as a macro included in the driver definition::
|
|||
Problems
|
||||
--------
|
||||
|
||||
This section shows some common problems and how to fix them.
|
||||
|
||||
Driver not found
|
||||
~~~~~~~~~~~~~~~~
|
||||
|
||||
In some cases you will you see something like this::
|
||||
|
||||
WARNING: the driver rockchip_rk3188_grf was not found in the driver list
|
||||
|
@ -633,6 +638,9 @@ the devicetree. For example, if the devicetree has::
|
|||
then dtoc looks at the first compatible string ("rockchip,rk3188-grf"),
|
||||
converts that to a C identifier (rockchip_rk3188_grf) and then looks for that.
|
||||
|
||||
Missing .compatible or Missing .id
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Various things can cause dtoc to fail to find the driver and it tries to
|
||||
warn about these. For example:
|
||||
|
||||
|
@ -649,6 +657,82 @@ Checks are also made to confirm that the referenced driver has a .compatible
|
|||
member and a .id member. The first provides the array of compatible strings and
|
||||
the second provides the uclass ID.
|
||||
|
||||
Missing parent
|
||||
~~~~~~~~~~~~~~
|
||||
|
||||
When a device is used, its parent must be present as well. If you see an error
|
||||
like::
|
||||
|
||||
Node '/i2c@0/emul/emul0' requires parent node '/i2c@0/emul' but it is not in
|
||||
the valid list
|
||||
|
||||
it indicates that you are using a node whose parent is not present in the
|
||||
devicetree. In this example, if you look at the device tree output
|
||||
(e.g. fdtdump tpl/u-boot-tpl.dtb in your build directory), you may see something
|
||||
like this::
|
||||
|
||||
emul {
|
||||
emul0 {
|
||||
compatible = "sandbox,i2c-rtc-emul";
|
||||
#emul-cells = <0x00000000>;
|
||||
phandle = <0x00000003>;
|
||||
};
|
||||
};
|
||||
|
||||
In this example, 'emul0' exists but its parent 'emul' has no properties. These
|
||||
have been dropped by fdtgrep in an effort to reduce the devicetree size. This
|
||||
indicates that the two nodes have different phase settings. Looking at the
|
||||
source .dts::
|
||||
|
||||
i2c_emul: emul {
|
||||
u-boot,dm-spl;
|
||||
reg = <0xff>;
|
||||
compatible = "sandbox,i2c-emul-parent";
|
||||
emul0: emul0 {
|
||||
u-boot,dm-pre-reloc;
|
||||
compatible = "sandbox,i2c-rtc-emul";
|
||||
#emul-cells = <0>;
|
||||
};
|
||||
};
|
||||
|
||||
you can see that the child node 'emul0' usees 'u-boot,dm-pre-reloc', indicating
|
||||
that the node is present in all SPL builds, but its parent uses 'u-boot,dm-spl'
|
||||
indicating it is only present in SPL, not TPL. For a TPL build, this will fail
|
||||
with the above message. The fix is to change 'emul0' to use the same
|
||||
'u-boot,dm-spl' condition, so that it is not present in TPL, like its parent.
|
||||
|
||||
Link errors / undefined reference
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Sometimes dtoc does not find the problem for you, but something is wrong and
|
||||
you get a link error, e.g.::
|
||||
|
||||
:(.u_boot_list_2_udevice_2_spl_test5+0x0): undefined reference to
|
||||
`_u_boot_list_2_driver_2_sandbox_spl_test'
|
||||
/usr/bin/ld: dts/dt-uclass.o:(.u_boot_list_2_uclass_2_misc+0x8):
|
||||
undefined reference to `_u_boot_list_2_uclass_driver_2_misc'
|
||||
|
||||
The first one indicates that the device cannot find its driver. This means that
|
||||
there is a driver 'sandbox_spl_test' but it is not compiled into the build.
|
||||
Check your Kconfig settings to make sure it is. If you don't want that in the
|
||||
build, adjust your phase settings, e.g. by using 'u-boot,dm-spl' in the node
|
||||
to exclude it from the TPL build::
|
||||
|
||||
spl-test5 {
|
||||
u-boot,dm-tpl;
|
||||
compatible = "sandbox,spl-test";
|
||||
stringarray = "tpl";
|
||||
};
|
||||
|
||||
We can drop the 'u-boot,dm-tpl' line so this node won't appear in the TPL
|
||||
devicetree and thus the driver won't be needed.
|
||||
|
||||
The second error above indicates that the MISC uclass is needed by the driver
|
||||
(since it is in the MISC uclass) but that uclass is not compiled in the build.
|
||||
The fix above would fix this error too. But if you do want this uclass in the
|
||||
build, check your Kconfig settings to make sure the uclass is being built
|
||||
(CONFIG_MISC in this case).
|
||||
|
||||
|
||||
Caveats
|
||||
-------
|
||||
|
@ -697,7 +781,7 @@ Internals
|
|||
---------
|
||||
|
||||
Generated files
|
||||
```````````````
|
||||
~~~~~~~~~~~~~~~
|
||||
|
||||
When enabled, dtoc generates the following five files:
|
||||
|
||||
|
@ -738,7 +822,7 @@ spl/dt-plat.c.
|
|||
|
||||
|
||||
CONFIG options
|
||||
``````````````
|
||||
~~~~~~~~~~~~~~
|
||||
|
||||
Several CONFIG options are used to control the behaviour of of-platdata, all
|
||||
available for both SPL and TPL:
|
||||
|
@ -793,7 +877,7 @@ READ_ONLY
|
|||
the nodes cannot be updated, OF_PLATDATA_NO_BIND is enabled.
|
||||
|
||||
Data structures
|
||||
```````````````
|
||||
~~~~~~~~~~~~~~~
|
||||
|
||||
A few extra data structures are used with of-platdata:
|
||||
|
||||
|
@ -821,7 +905,7 @@ A few extra data structures are used with of-platdata:
|
|||
`device_get_by_ofplat_idx()`.
|
||||
|
||||
Other changes
|
||||
`````````````
|
||||
~~~~~~~~~~~~~
|
||||
|
||||
Some other changes are made with of-platdata:
|
||||
|
||||
|
|
|
@ -60,15 +60,6 @@ The following are available:
|
|||
|
||||
This is used as part of the banner string when U-Boot starts.
|
||||
|
||||
U_BOOT_VERSION_STRING (string #define)
|
||||
U_BOOT_VERSION followed by build-time information
|
||||
and CONFIG_IDENT_STRING.
|
||||
|
||||
Examples::
|
||||
|
||||
U-Boot 2020.10 (Jan 06 2021 - 08:50:36 -0700)
|
||||
U-Boot 2021.01-rc5-00248-g60dd854f3ba-dirty (Jan 06 2021 - 08:50:36 -0700) for spring
|
||||
|
||||
U_BOOT_VERSION_NUM (integer #define)
|
||||
Release year, e.g. 2021 for release 2021.01. Note
|
||||
this is an integer, not a string.
|
||||
|
@ -77,6 +68,18 @@ The following are available:
|
|||
Patch number, e.g. 1 for release 2020.01. Note
|
||||
this is an integer, not a string.
|
||||
|
||||
Human readable U-Boot version string is available in header file
|
||||
include/version_string.h in following variable:
|
||||
|
||||
version_string (const char[])
|
||||
U_BOOT_VERSION followed by build-time information
|
||||
and CONFIG_IDENT_STRING.
|
||||
|
||||
Examples::
|
||||
|
||||
U-Boot 2020.10 (Jan 06 2021 - 08:50:36 -0700)
|
||||
U-Boot 2021.01-rc5-00248-g60dd854f3ba-dirty (Jan 06 2021 - 08:50:36 -0700) for spring
|
||||
|
||||
Build date/time is also included. See the generated file
|
||||
include/generated/timestamp_autogenerated.h for the available
|
||||
fields. For example::
|
||||
|
|
|
@ -9,8 +9,8 @@
|
|||
#include <div64.h>
|
||||
#include <dm.h>
|
||||
#include <env.h>
|
||||
#include <generated/timestamp_autogenerated.h>
|
||||
#include <rtc.h>
|
||||
#include <timestamp.h>
|
||||
|
||||
/**
|
||||
* struct emul_rtc - private data for emulated RTC driver
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
#include <linux/usb/gadget.h>
|
||||
#include <linux/usb/composite.h>
|
||||
#include <linux/compiler.h>
|
||||
#include <version.h>
|
||||
#include <g_dnl.h>
|
||||
#include <asm/arch-rockchip/f_rockusb.h>
|
||||
|
||||
|
|
|
@ -71,7 +71,7 @@
|
|||
#include <fdtdec.h>
|
||||
#include <gzip.h>
|
||||
#include <log.h>
|
||||
#include <version.h>
|
||||
#include <version_string.h>
|
||||
#include <malloc.h>
|
||||
#include <video.h>
|
||||
#include <asm/global_data.h>
|
||||
|
@ -108,7 +108,6 @@
|
|||
* Console device
|
||||
*/
|
||||
|
||||
#include <version.h>
|
||||
#include <linux/types.h>
|
||||
#include <stdio_dev.h>
|
||||
#include <video_font.h>
|
||||
|
|
|
@ -918,7 +918,11 @@ static int btrfs_scan_fs_devices(struct blk_desc *desc,
|
|||
|
||||
ret = btrfs_scan_one_device(desc, part, fs_devices, &total_devs);
|
||||
if (ret) {
|
||||
fprintf(stderr, "No valid Btrfs found\n");
|
||||
/*
|
||||
* Avoid showing this when probing for a possible Btrfs
|
||||
*
|
||||
* fprintf(stderr, "No valid Btrfs found\n");
|
||||
*/
|
||||
return ret;
|
||||
}
|
||||
return 0;
|
||||
|
@ -1007,7 +1011,7 @@ struct btrfs_fs_info *open_ctree_fs_info(struct blk_desc *desc,
|
|||
disk_super = fs_info->super_copy;
|
||||
ret = btrfs_read_dev_super(desc, part, disk_super);
|
||||
if (ret) {
|
||||
printk("No valid btrfs found\n");
|
||||
debug("No valid btrfs found\n");
|
||||
goto out_devices;
|
||||
}
|
||||
|
||||
|
|
|
@ -1090,7 +1090,7 @@ int sqfs_probe(struct blk_desc *fs_dev_desc, struct disk_partition *fs_partition
|
|||
|
||||
/* Make sure it has a valid SquashFS magic number*/
|
||||
if (get_unaligned_le32(&sblk->s_magic) != SQFS_MAGIC_NUMBER) {
|
||||
printf("Bad magic number for SquashFS image.\n");
|
||||
debug("Bad magic number for SquashFS image.\n");
|
||||
ret = -EINVAL;
|
||||
goto error;
|
||||
}
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
#ifndef __BCMSTB_H
|
||||
#define __BCMSTB_H
|
||||
|
||||
#include "version.h"
|
||||
#include <linux/sizes.h>
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
|
|
@ -738,7 +738,7 @@ int device_find_next_child(struct udevice **devp);
|
|||
*
|
||||
* @parent: Parent device to search
|
||||
* @uclass_id: Uclass to look for
|
||||
* @devp: Returns device found, if any
|
||||
* @devp: Returns device found, if any, else NULL
|
||||
* @return 0 if found, else -ENODEV
|
||||
*/
|
||||
int device_find_first_inactive_child(const struct udevice *parent,
|
||||
|
@ -750,7 +750,7 @@ int device_find_first_inactive_child(const struct udevice *parent,
|
|||
*
|
||||
* @parent: Parent device to search
|
||||
* @uclass_id: Uclass to look for
|
||||
* @devp: Returns first child device in that uclass, if any
|
||||
* @devp: Returns first child device in that uclass, if any, else NULL
|
||||
* @return 0 if found, else -ENODEV
|
||||
*/
|
||||
int device_find_first_child_by_uclass(const struct udevice *parent,
|
||||
|
|
|
@ -354,7 +354,7 @@ int uclass_next_device(struct udevice **devp);
|
|||
* The device returned is probed if necessary, and ready for use
|
||||
*
|
||||
* @devp: On entry, pointer to device to lookup. On exit, returns pointer
|
||||
* to the next device in the uclass if no error occurred, or -ENODEV if
|
||||
* to the next device in the uclass if no error occurred, or NULL if
|
||||
* there is no next device.
|
||||
* @return 0 if found, -ENODEV if not found, other -ve on error
|
||||
*/
|
||||
|
|
21
include/os.h
21
include/os.h
|
@ -51,6 +51,14 @@ off_t os_lseek(int fd, off_t offset, int whence);
|
|||
#define OS_SEEK_CUR 1
|
||||
#define OS_SEEK_END 2
|
||||
|
||||
/**
|
||||
* os_filesize() - Calculate the size of a file
|
||||
*
|
||||
* @fd: File descriptor as returned by os_open()
|
||||
* Return: file size or negative error code
|
||||
*/
|
||||
int os_filesize(int fd);
|
||||
|
||||
/**
|
||||
* Access to the OS open() system call
|
||||
*
|
||||
|
@ -398,6 +406,19 @@ int os_write_file(const char *name, const void *buf, int size);
|
|||
*/
|
||||
int os_read_file(const char *name, void **bufp, int *sizep);
|
||||
|
||||
/**
|
||||
* os_map_file() - Map a file from the host filesystem into memory
|
||||
*
|
||||
* This can be useful when to provide a backing store for an emulated device
|
||||
*
|
||||
* @pathname: File pathname to map
|
||||
* @os_flags: Flags, like OS_O_RDONLY, OS_O_RDWR
|
||||
* @bufp: Returns buffer containing the file
|
||||
* @sizep: Returns size of data
|
||||
* Return: 0 if OK, -ve on error
|
||||
*/
|
||||
int os_map_file(const char *pathname, int os_flags, void **bufp, int *sizep);
|
||||
|
||||
/*
|
||||
* os_find_text_base() - Find the text section in this running process
|
||||
*
|
||||
|
|
|
@ -82,6 +82,21 @@ int ut_check_console_linen(struct unit_test_state *uts, const char *fmt, ...)
|
|||
*/
|
||||
int ut_check_skipline(struct unit_test_state *uts);
|
||||
|
||||
/**
|
||||
* ut_check_skip_to_line() - skip output until a line is found
|
||||
*
|
||||
* This creates a string and then checks it against the following lines of
|
||||
* console output obtained with console_record_readline() until it is found.
|
||||
*
|
||||
* After the function returns, uts->expect_str holds the expected string and
|
||||
* uts->actual_str holds the actual string read from the console.
|
||||
*
|
||||
* @uts: Test state
|
||||
* @fmt: printf() format string to look for, followed by args
|
||||
* @return 0 if OK, -ENOENT if not found, other value on error
|
||||
*/
|
||||
int ut_check_skip_to_line(struct unit_test_state *uts, const char *fmt, ...);
|
||||
|
||||
/**
|
||||
* ut_check_console_end() - Check there is no more console output
|
||||
*
|
||||
|
@ -286,6 +301,15 @@ int ut_check_console_dump(struct unit_test_state *uts, int total_bytes);
|
|||
return CMD_RET_FAILURE; \
|
||||
} \
|
||||
|
||||
/* Assert that a following console output line matches */
|
||||
#define ut_assert_skip_to_line(fmt, args...) \
|
||||
if (ut_check_skip_to_line(uts, fmt, ##args)) { \
|
||||
ut_failf(uts, __FILE__, __LINE__, __func__, \
|
||||
"console", "\nExpected '%s',\n got to '%s'", \
|
||||
uts->expect_str, uts->actual_str); \
|
||||
return CMD_RET_FAILURE; \
|
||||
} \
|
||||
|
||||
/* Assert that there is no more console output */
|
||||
#define ut_assert_console_end() \
|
||||
if (ut_check_console_end(uts)) { \
|
||||
|
|
|
@ -7,16 +7,8 @@
|
|||
#ifndef __VERSION_H__
|
||||
#define __VERSION_H__
|
||||
|
||||
#include <timestamp.h>
|
||||
|
||||
#ifndef DO_DEPS_ONLY
|
||||
#include "generated/version_autogenerated.h"
|
||||
#endif
|
||||
|
||||
#define U_BOOT_VERSION_STRING U_BOOT_VERSION " (" U_BOOT_DATE " - " \
|
||||
U_BOOT_TIME " " U_BOOT_TZ ")" CONFIG_IDENT_STRING
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
extern const char version_string[];
|
||||
#endif /* __ASSEMBLY__ */
|
||||
#endif /* __VERSION_H__ */
|
||||
|
|
8
include/version_string.h
Normal file
8
include/version_string.h
Normal file
|
@ -0,0 +1,8 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0+ */
|
||||
|
||||
#ifndef __VERSION_STRING_H__
|
||||
#define __VERSION_STRING_H__
|
||||
|
||||
extern const char version_string[];
|
||||
|
||||
#endif /* __VERSION_STRING_H__ */
|
|
@ -11,6 +11,7 @@
|
|||
#include <log.h>
|
||||
#include <mapmem.h>
|
||||
#include <tables_csum.h>
|
||||
#include <timestamp.h>
|
||||
#include <version.h>
|
||||
#include <acpi/acpi_table.h>
|
||||
#include <asm/global_data.h>
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
#include <compiler.h>
|
||||
#include <console.h>
|
||||
#include <div64.h>
|
||||
#include <version.h>
|
||||
#include <version_string.h>
|
||||
#include <linux/ctype.h>
|
||||
#include <asm/io.h>
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
#include <efi_tcg2.h>
|
||||
#include <log.h>
|
||||
#include <malloc.h>
|
||||
#include <version.h>
|
||||
#include <version_string.h>
|
||||
#include <tpm-v2.h>
|
||||
#include <u-boot/hash-checksum.h>
|
||||
#include <u-boot/sha1.h>
|
||||
|
@ -1337,10 +1337,11 @@ out:
|
|||
*/
|
||||
static efi_status_t efi_append_scrtm_version(struct udevice *dev)
|
||||
{
|
||||
u8 ver[] = U_BOOT_VERSION_STRING;
|
||||
efi_status_t ret;
|
||||
|
||||
ret = tcg2_measure_event(dev, 0, EV_S_CRTM_VERSION, sizeof(ver), ver);
|
||||
ret = tcg2_measure_event(dev, 0, EV_S_CRTM_VERSION,
|
||||
strlen(version_string) + 1,
|
||||
(u8 *)version_string);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -11,9 +11,6 @@
|
|||
|
||||
#include <common.h>
|
||||
#include <net.h>
|
||||
#if defined(CONFIG_CDP_VERSION)
|
||||
#include <timestamp.h>
|
||||
#endif
|
||||
|
||||
#include "cdp.h"
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
/* Declare a new compression test */
|
||||
/* Declare a new bloblist test */
|
||||
#define BLOBLIST_TEST(_name, _flags) \
|
||||
UNIT_TEST(_name, _flags, bloblist_test)
|
||||
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
#include <dm.h>
|
||||
#include <malloc.h>
|
||||
#include <mapmem.h>
|
||||
#include <timestamp.h>
|
||||
#include <version.h>
|
||||
#include <tables_csum.h>
|
||||
#include <version.h>
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
#include <display_options.h>
|
||||
#include <log.h>
|
||||
#include <mapmem.h>
|
||||
#include <version.h>
|
||||
#include <version_string.h>
|
||||
#include <test/suites.h>
|
||||
#include <test/test.h>
|
||||
#include <test/ut.h>
|
||||
|
|
26
test/ut.c
26
test/ut.c
|
@ -121,6 +121,32 @@ int ut_check_skipline(struct unit_test_state *uts)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int ut_check_skip_to_line(struct unit_test_state *uts, const char *fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
int len;
|
||||
int ret;
|
||||
|
||||
va_start(args, fmt);
|
||||
len = vsnprintf(uts->expect_str, sizeof(uts->expect_str), fmt, args);
|
||||
va_end(args);
|
||||
if (len >= sizeof(uts->expect_str)) {
|
||||
ut_fail(uts, __FILE__, __LINE__, __func__,
|
||||
"unit_test_state->expect_str too small");
|
||||
return -EOVERFLOW;
|
||||
}
|
||||
while (1) {
|
||||
if (!console_record_avail())
|
||||
return -ENOENT;
|
||||
ret = readline_check(uts);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
if (!strcmp(uts->expect_str, uts->actual_str))
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
int ut_check_console_end(struct unit_test_state *uts)
|
||||
{
|
||||
int ret;
|
||||
|
|
Loading…
Reference in a new issue