From 91a8c95623af3aad1c9579f6ae9eff274d4c1b0a Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Fri, 11 Oct 2019 16:16:46 -0600 Subject: sandbox: test: Show hex values on failure Quite a few tests use addresses or hex values for comparisons. Add hex output for test failures, e.g.: 0x55ca22fa == reg: Expected 0x55ca22fa (1439310586), got 0x55ea22fb (1441407739) Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- include/test/ut.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/test/ut.h b/include/test/ut.h index 19bcb8c374..fbfde10719 100644 --- a/include/test/ut.h +++ b/include/test/ut.h @@ -61,7 +61,8 @@ void ut_failf(struct unit_test_state *uts, const char *fname, int line, if (val1 != val2) { \ ut_failf(uts, __FILE__, __LINE__, __func__, \ #expr1 " == " #expr2, \ - "Expected %d, got %d", val1, val2); \ + "Expected %#x (%d), got %#x (%d)", val1, val1, \ + val2, val2); \ return CMD_RET_FAILURE; \ } \ } -- cgit From 5ca5ec1e3272f40a7ad26a15e3df3bb18e0b11d8 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Fri, 11 Oct 2019 16:16:49 -0600 Subject: dm: regmap: Fix mask in regmap_update_bits() This function assumes that the 'val' parameter has no masked bits set. This is not defined by the function prototype though. Fix the function to mask the value and update the documentation. Signed-off-by: Simon Glass Reviewed-by: Bin Meng Reviewed-by: Jean-Jacques Hiblot --- include/regmap.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/regmap.h b/include/regmap.h index 0854200a9c..9ada1af5ef 100644 --- a/include/regmap.h +++ b/include/regmap.h @@ -295,7 +295,8 @@ int regmap_raw_read_range(struct regmap *map, uint range_num, uint offset, * @map: The map returned by regmap_init_mem*() * @offset: Offset of the memory * @mask: Mask to apply to the read value - * @val: Value to apply to the value to write + * @val: Value to OR with the read value after masking. Note that any + * bits set in @val which are not set in @mask are ignored * Return: 0 if OK, -ve on error */ int regmap_update_bits(struct regmap *map, uint offset, uint mask, uint val); -- cgit From 5256beecb8a14efba805a2f3f14afb33752ac71a Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Mon, 21 Oct 2019 17:26:51 -0600 Subject: bootstage: Mark the start/end of TPL and SPL separately At present bootstage in TPL and SPL use the same ID so it is not possible to see the timing of each. Separate out the IDs and use the correct one depending on which phase we are at. Example output: Timer summary in microseconds (14 records): Mark Elapsed Stage 0 0 reset 224,787 224,787 TPL 282,248 57,461 end TPL 341,067 58,819 SPL 925,436 584,369 end SPL 931,710 6,274 board_init_f 1,035,482 103,772 board_init_r 1,387,852 352,370 main_loop 1,387,911 59 id=175 Accumulated time: 196 dm_r 8,300 dm_spl 14,139 dm_f 229,121 fsp-m 262,992 fsp-s Signed-off-by: Simon Glass --- include/bootstage.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/bootstage.h b/include/bootstage.h index 5e7e242b83..d105ae0181 100644 --- a/include/bootstage.h +++ b/include/bootstage.h @@ -170,6 +170,8 @@ enum bootstage_id { * rough boot timing information. */ BOOTSTAGE_ID_AWAKE, + BOOTSTAGE_ID_START_TPL, + BOOTSTAGE_ID_END_TPL, BOOTSTAGE_ID_START_SPL, BOOTSTAGE_ID_END_SPL, BOOTSTAGE_ID_START_UBOOT_F, -- cgit From d60ae4c59df55c08dc96202ff58fed21ab3afb7d Mon Sep 17 00:00:00 2001 From: Jean-Jacques Hiblot Date: Tue, 22 Oct 2019 10:05:22 +0200 Subject: fdt: Fix alignment issue when reading 64-bits properties from fdt The FDT specification [0] gives a requirement of aligning properties on 32-bits. Make sure that the compiler is aware of this constraint when accessing 64-bits properties. [0]: https://github.com/devicetree-org/devicetree-specification/blob/master/source/flattened-format.rst Signed-off-by: Jean-Jacques Hiblot Reviewed-by: Simon Glass --- include/linux/libfdt_env.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/linux/libfdt_env.h b/include/linux/libfdt_env.h index e2bf79c7ee..e49fcd72bd 100644 --- a/include/linux/libfdt_env.h +++ b/include/linux/libfdt_env.h @@ -16,6 +16,7 @@ typedef __be16 fdt16_t; typedef __be32 fdt32_t; typedef __be64 fdt64_t; +typedef __be64 unaligned_fdt64_t __aligned(4); #define fdt32_to_cpu(x) be32_to_cpu(x) #define cpu_to_fdt32(x) cpu_to_be32(x) -- cgit