• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-cqtcocoa誰得pythonphprubygameguibathyscaphec翻訳計画中(planning stage)omegatframeworktwittertestdomvb.netdirectxbtronarduinopreviewerゲームエンジン

Commit MetaInfo

Revisión7277c4bddceb6b8a59ba47b8b111ab070d86919f (tree)
Tiempo2022-07-27 19:59:55
AutorTom Rini <trini@kons...>
CommiterTom Rini

Log Message

minor dm- and fdt-related fixes
start of test for fdt command
-----BEGIN PGP SIGNATURE-----

iQFFBAABCgAvFiEEslwAIq+Gp8wWVbYnfxc6PpAIreYFAmLgRtERHHNqZ0BjaHJv
bWl1bS5vcmcACgkQfxc6PpAIreYXFwgAlALOMj3bwwsIAXNa5j/hPb3j/ecIqXgn
ocyxN+U5eSb2Ju5Jc9QmSeUMnGrii9+PW9j0JApdHrbUgBI2Sx+zwqMTIfA+BS05
4xXZgk5jOT+we2489FjgFcplv+dIuVlsB/Zo6zTbZyjkobfilYsZEGYHJ/CYNaIH
n7EmZeby1cXL7DMCxT39d3hD43XSX8cqQ1IIiF9DgtHQYs2Ff8dFcbWArSdgLX3o
Eob2Qj/GjScg87zjZcsgZajWJMHUfMeD5ZiKN2fR0T/wOdO1WtzFoF2Mt8KZcW1j
BD1shgBCMSSl5EgRG1BQZw4Sa92W2IBlbJ9tfIh8qnWOzEBzOs/M6w==
=lsO4
-----END PGP SIGNATURE-----

Merge tag 'dm-pull-26jul22' of https://gitlab.denx.de/u-boot/custodians/u-boot-dm.git

minor dm- and fdt-related fixes
start of test for fdt command

Cambiar Resumen

Diferencia incremental

--- a/board/sandbox/sandbox.c
+++ b/board/sandbox/sandbox.c
@@ -4,6 +4,7 @@
44 */
55
66 #include <common.h>
7+#include <addr_map.h>
78 #include <cpu_func.h>
89 #include <cros_ec.h>
910 #include <dm.h>
@@ -155,3 +156,11 @@ int board_late_init(void)
155156 return 0;
156157 }
157158 #endif
159+
160+int init_addr_map(void)
161+{
162+ if (IS_ENABLED(CONFIG_ADDR_MAP))
163+ addrmap_set_entry(0, 0, CONFIG_SYS_SDRAM_SIZE, 0);
164+
165+ return 0;
166+}
--- a/common/cli.c
+++ b/common/cli.c
@@ -126,6 +126,21 @@ int run_command_list(const char *cmd, int len, int flag)
126126 return rcode;
127127 }
128128
129+int run_commandf(const char *fmt, ...)
130+{
131+ va_list args;
132+ char cmd[128];
133+ int i, ret;
134+
135+ va_start(args, fmt);
136+ i = vsnprintf(cmd, sizeof(cmd), fmt, args);
137+ va_end(args);
138+
139+ ret = run_command(cmd, 0);
140+
141+ return ret;
142+}
143+
129144 /****************************************************************************/
130145
131146 #if defined(CONFIG_CMD_RUN)
--- a/configs/sandbox_defconfig
+++ b/configs/sandbox_defconfig
@@ -31,6 +31,8 @@ CONFIG_CONSOLE_RECORD=y
3131 CONFIG_CONSOLE_RECORD_OUT_SIZE=0x6000
3232 CONFIG_PRE_CONSOLE_BUFFER=y
3333 CONFIG_LOG=y
34+CONFIG_LOG_MAX_LEVEL=9
35+CONFIG_LOG_DEFAULT_LEVEL=6
3436 CONFIG_DISPLAY_BOARDINFO_LATE=y
3537 CONFIG_STACKPROTECTOR=y
3638 CONFIG_ANDROID_AB=y
@@ -313,6 +315,7 @@ CONFIG_WDT_GPIO=y
313315 CONFIG_WDT_SANDBOX=y
314316 CONFIG_FS_CBFS=y
315317 CONFIG_FS_CRAMFS=y
318+CONFIG_ADDR_MAP=y
316319 CONFIG_CMD_DHRYSTONE=y
317320 CONFIG_ECDSA=y
318321 CONFIG_ECDSA_VERIFY=y
--- a/doc/develop/logging.rst
+++ b/doc/develop/logging.rst
@@ -66,26 +66,21 @@ Sometimes it is useful to turn on logging just in one file. You can use this
6666 #define LOG_DEBUG
6767
6868 to enable building in of all logging statements in a single file. Put it at
69-the top of the file, before any #includes.
70-
71-To actually get U-Boot to output this you need to also set the default logging
72-level - e.g. set CONFIG_LOG_DEFAULT_LEVEL to 7 (:c:data:`LOGL_DEBUG`) or more.
73-Otherwise debug output is suppressed and will not be generated.
69+the top of the file, before any #includes and any message in the file will be
70+written, regardless of the value of CONFIG_LOG_DEFAULT_LEVEL.
7471
7572 Using DEBUG
7673 -----------
7774
7875 U-Boot has traditionally used a #define called DEBUG to enable debugging on a
79-file-by-file basis. The debug() macro compiles to a printf() statement if
80-DEBUG is enabled, and an empty statement if not.
76+file-by-file basis but LOG_DEBUG are intended to replace it with the logging
77+facilities; DEBUG is activated when LOG_DEBUG is activated.
8178
8279 With logging enabled, debug() statements are interpreted as logging output
83-with a level of LOGL_DEBUG and a category of LOGC_NONE.
80+with a level of LOGL_DEBUG and a category of LOG_CATEGORY.
8481
85-The logging facilities are intended to replace DEBUG, but if DEBUG is defined
86-at the top of a file, then it takes precedence. This means that debug()
87-statements will result in output to the console and this output will not be
88-logged.
82+With logging disabled, the debug() macro compiles to a printf() statement
83+if DEBUG is enabled and to an empty statement if not.
8984
9085 Logging statements
9186 ------------------
--- /dev/null
+++ b/doc/usage/cmd/fdt.rst
@@ -0,0 +1,69 @@
1+.. SPDX-License-Identifier: GPL-2.0+
2+
3+fdt command
4+===========
5+
6+Synopis
7+-------
8+
9+::
10+
11+ fdt addr [-cq] [addr [len]]
12+
13+Description
14+-----------
15+
16+The fdt command provides access to flat device tree blobs in memory. It has
17+many subcommands, some of which are not documented here.
18+
19+Flags:
20+
21+-c
22+ Select the control FDT (otherwise the working FDT is used).
23+-q
24+ Don't display errors
25+
26+The control FDT is the one used by U-Boot itself to control various features,
27+including driver model. This should only be changed if you really know what you
28+are doing, since once U-Boot starts it maintains pointers into the FDT from the
29+various driver model data structures.
30+
31+The working FDT is the one passed to the Operating System when booting. This
32+can be freely modified, so far as U-Boot is concerned, since it does not affect
33+U-Boot's operation.
34+
35+fdt addr
36+~~~~~~~~
37+
38+With no arguments, this shows the address of the current working or control
39+FDT.
40+
41+If the `addr` argument is provided, then this sets the address of the working or
42+control FDT to the provided address.
43+
44+If the `len` argument is provided, then the device tree is expanded to that
45+size. This can be used to make space for more nodes and properties. It is
46+assumed that there is enough space in memory for this expansion.
47+
48+Example
49+-------
50+
51+Get the control address and copy that FDT to free memory::
52+
53+ => fdt addr -c
54+ Control fdt: 0aff9fd0
55+ => cp.b 0aff9fd0 10000 10000
56+ => md 10000 4
57+ 00010000: edfe0dd0 5b3d0000 78000000 7c270000 ......=[...x..'|
58+
59+The second word shows the size of the FDT. Now set the working FDT to that
60+address and expand it to 0xf000 in size::
61+
62+ => fdt addr 10000 f000
63+ => md 10000 4
64+ 00010000: edfe0dd0 00f00000 78000000 7c270000 ...........x..'|
65+
66+Return value
67+------------
68+
69+The return value $? indicates whether the command succeeded.
--- a/doc/usage/index.rst
+++ b/doc/usage/index.rst
@@ -43,6 +43,7 @@ Shell commands
4343 cmd/false
4444 cmd/fatinfo
4545 cmd/fatload
46+ cmd/fdt
4647 cmd/for
4748 cmd/load
4849 cmd/loadm
--- a/drivers/core/Kconfig
+++ b/drivers/core/Kconfig
@@ -18,7 +18,7 @@ config SPL_DM
1818 consider using CONFIG_SPL_SYS_MALLOC_SIMPLE. In that case you
1919 must provide CONFIG_SPL_SYS_MALLOC_F_LEN to set the size.
2020 In most cases driver model will only allocate a few uclasses
21- and devices in SPL, so 1KB should be enable. See
21+ and devices in SPL, so 1KB should be enough. See
2222 CONFIG_SPL_SYS_MALLOC_F_LEN for more details on how to enable it.
2323
2424 config TPL_DM
--- a/drivers/core/acpi.c
+++ b/drivers/core/acpi.c
@@ -159,8 +159,8 @@ static int add_item(struct acpi_ctx *ctx, struct udevice *dev,
159159 memcpy(item->buf, start, item->size);
160160 }
161161 item_count++;
162- log_debug("* %s: Added type %d, %p, size %x\n", dev->name, type, start,
163- item->size);
162+ log_debug("* %s: Added type %d, %p, size %x\n",
163+ dev ? dev->name : "other", type, start, item->size);
164164
165165 return 0;
166166 }
--- a/drivers/core/lists.c
+++ b/drivers/core/lists.c
@@ -223,10 +223,14 @@ int lists_bind_fdt(struct udevice *parent, ofnode node, struct udevice **devp,
223223 compat);
224224
225225 for (entry = driver; entry != driver + n_ents; entry++) {
226+ if (drv) {
227+ if (drv != entry)
228+ continue;
229+ if (!entry->of_match)
230+ break;
231+ }
226232 ret = driver_check_compatible(entry->of_match, &id,
227233 compat);
228- if ((drv) && (drv == entry))
229- break;
230234 if (!ret)
231235 break;
232236 }
@@ -241,9 +245,10 @@ int lists_bind_fdt(struct udevice *parent, ofnode node, struct udevice **devp,
241245 }
242246 }
243247
244- log_debug(" - found match at '%s': '%s' matches '%s'\n",
245- entry->name, entry->of_match->compatible,
246- id->compatible);
248+ if (entry->of_match)
249+ log_debug(" - found match at '%s': '%s' matches '%s'\n",
250+ entry->name, entry->of_match->compatible,
251+ id->compatible);
247252 ret = device_bind_with_driver_data(parent, entry, name,
248253 id->data, node, &dev);
249254 if (ret == -ENODEV) {
--- a/include/addr_map.h
+++ b/include/addr_map.h
@@ -14,7 +14,9 @@ struct addrmap {
1414 unsigned long vaddr;
1515 };
1616
17+#ifdef CONFIG_ADDR_MAP
1718 extern struct addrmap address_map[CONFIG_SYS_NUM_ADDR_MAP];
19+#endif
1820
1921 phys_addr_t addrmap_virt_to_phys(void *vaddr);
2022 void *addrmap_phys_to_virt(phys_addr_t paddr);
--- a/include/command.h
+++ b/include/command.h
@@ -258,6 +258,16 @@ int run_command(const char *cmd, int flag);
258258 int run_command_repeatable(const char *cmd, int flag);
259259
260260 /**
261+ * run_commandf() - Run a command created by a format string
262+ *
263+ * The command cannot be larger than 127 characters
264+ *
265+ * @fmt: printf() format string
266+ * @...: Arguments to use (flag is always 0)
267+ */
268+int run_commandf(const char *fmt, ...);
269+
270+/**
261271 * Run a list of commands separated by ; or even \0
262272 *
263273 * Note that if 'len' is not -1, then the command does not need to be nul
--- a/include/log.h
+++ b/include/log.h
@@ -194,6 +194,9 @@ int _log_buffer(enum log_category_t cat, enum log_level_t level,
194194
195195 #ifdef LOG_DEBUG
196196 #define _LOG_DEBUG LOGL_FORCE_DEBUG
197+#ifndef DEBUG
198+#define DEBUG
199+#endif
197200 #else
198201 #define _LOG_DEBUG 0
199202 #endif
--- a/include/test/suites.h
+++ b/include/test/suites.h
@@ -38,6 +38,7 @@ int do_ut_compression(struct cmd_tbl *cmdtp, int flag, int argc,
3838 char *const argv[]);
3939 int do_ut_dm(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]);
4040 int do_ut_env(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]);
41+int do_ut_fdt(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]);
4142 int do_ut_lib(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]);
4243 int do_ut_loadm(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]);
4344 int do_ut_log(struct cmd_tbl *cmdtp, int flag, int argc, char * const argv[]);
--- a/lib/addr_map.c
+++ b/lib/addr_map.c
@@ -5,6 +5,7 @@
55
66 #include <common.h>
77 #include <addr_map.h>
8+#include <mapmem.h>
89
910 struct addrmap address_map[CONFIG_SYS_NUM_ADDR_MAP];
1011
@@ -18,7 +19,7 @@ phys_addr_t addrmap_virt_to_phys(void * vaddr)
1819 if (address_map[i].size == 0)
1920 continue;
2021
21- addr = (u64)((u32)vaddr);
22+ addr = map_to_sysmem(vaddr);
2223 base = (u64)(address_map[i].vaddr);
2324 upper = (u64)(address_map[i].size) + base - 1;
2425
@@ -48,7 +49,7 @@ void *addrmap_phys_to_virt(phys_addr_t paddr)
4849
4950 offset = address_map[i].paddr - address_map[i].vaddr;
5051
51- return (void *)(unsigned long)(paddr - offset);
52+ return map_sysmem(paddr - offset, 0);
5253 }
5354 }
5455
--- a/test/cmd/Makefile
+++ b/test/cmd/Makefile
@@ -7,6 +7,7 @@ obj-$(CONFIG_CONSOLE_RECORD) += test_echo.o
77 endif
88 obj-y += mem.o
99 obj-$(CONFIG_CMD_ADDRMAP) += addrmap.o
10+obj-$(CONFIG_CMD_FDT) += fdt.o
1011 obj-$(CONFIG_CMD_LOADM) += loadm.o
1112 obj-$(CONFIG_CMD_MEM_SEARCH) += mem_search.o
1213 obj-$(CONFIG_CMD_PINMUX) += pinmux.o
--- a/test/cmd/addrmap.c
+++ b/test/cmd/addrmap.c
@@ -29,9 +29,8 @@ ADDRMAP_TEST(addrmap_test_basic, UT_TESTF_CONSOLE_REC);
2929
3030 int do_ut_addrmap(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
3131 {
32- struct unit_test *tests = ll_entry_start(struct unit_test,
33- addrmap_test);
34- const int n_ents = ll_entry_count(struct unit_test, addrmap_test);
32+ struct unit_test *tests = UNIT_TEST_SUITE_START(addrmap_test);
33+ const int n_ents = UNIT_TEST_SUITE_COUNT(addrmap_test);
3534
3635 return cmd_ut_category("cmd_addrmap", "cmd_addrmap_", tests, n_ents,
3736 argc, argv);
--- /dev/null
+++ b/test/cmd/fdt.c
@@ -0,0 +1,142 @@
1+// SPDX-License-Identifier: GPL-2.0+
2+/*
3+ * Tests for fdt command
4+ *
5+ * Copyright 2022 Google LLCmap_to_sysmem(fdt));
6+ */
7+
8+#include <common.h>
9+#include <console.h>
10+#include <fdt_support.h>
11+#include <mapmem.h>
12+#include <asm/global_data.h>
13+#include <linux/libfdt.h>
14+#include <test/suites.h>
15+#include <test/ut.h>
16+
17+DECLARE_GLOBAL_DATA_PTR;
18+
19+/* Declare a new fdt test */
20+#define FDT_TEST(_name, _flags) UNIT_TEST(_name, _flags, fdt_test)
21+
22+/**
23+ * make_test_fdt() - Create an FDT with just a root node
24+ *
25+ * The size is set to the minimum needed
26+ *
27+ * @uts: Test state
28+ * @fdt: Place to write FDT
29+ * @size: Maximum size of space for fdt
30+ */
31+static int make_test_fdt(struct unit_test_state *uts, void *fdt, int size)
32+{
33+ ut_assertok(fdt_create(fdt, size));
34+ ut_assertok(fdt_finish_reservemap(fdt));
35+ ut_assert(fdt_begin_node(fdt, "") >= 0);
36+ ut_assertok(fdt_end_node(fdt));
37+ ut_assertok(fdt_finish(fdt));
38+
39+ return 0;
40+}
41+
42+/* Test 'fdt addr' getting/setting address */
43+static int fdt_test_addr(struct unit_test_state *uts)
44+{
45+ const void *fdt_blob, *new_fdt;
46+ char fdt[256];
47+ ulong addr;
48+ int ret;
49+
50+ ut_assertok(console_record_reset_enable());
51+ ut_assertok(run_command("fdt addr -c", 0));
52+ ut_assert_nextline("Control fdt: %08lx",
53+ (ulong)map_to_sysmem(gd->fdt_blob));
54+ ut_assertok(ut_check_console_end(uts));
55+
56+ /* The working fdt is not set, so this should fail */
57+ set_working_fdt_addr(0);
58+ ut_asserteq(CMD_RET_FAILURE, run_command("fdt addr", 0));
59+ ut_assert_nextline("libfdt fdt_check_header(): FDT_ERR_BADMAGIC");
60+ ut_assertok(ut_check_console_end(uts));
61+
62+ /* Set up a working FDT and try again */
63+ ut_assertok(make_test_fdt(uts, fdt, sizeof(fdt)));
64+ addr = map_to_sysmem(fdt);
65+ set_working_fdt_addr(addr);
66+ ut_assertok(run_command("fdt addr", 0));
67+ ut_assert_nextline("Working fdt: %08lx", (ulong)map_to_sysmem(fdt));
68+ ut_assertok(ut_check_console_end(uts));
69+
70+ /* Set the working FDT */
71+ set_working_fdt_addr(0);
72+ ut_assertok(run_commandf("fdt addr %08x", addr));
73+ ut_asserteq(addr, map_to_sysmem(working_fdt));
74+ ut_assertok(ut_check_console_end(uts));
75+ set_working_fdt_addr(0);
76+
77+ /* Set the working FDT */
78+ fdt_blob = gd->fdt_blob;
79+ gd->fdt_blob = NULL;
80+ ret = run_commandf("fdt addr -c %08x", addr);
81+ new_fdt = gd->fdt_blob;
82+ gd->fdt_blob = fdt_blob;
83+ ut_assertok(ret);
84+ ut_asserteq(addr, map_to_sysmem(new_fdt));
85+ ut_assertok(ut_check_console_end(uts));
86+
87+ /* Test setting an invalid FDT */
88+ fdt[0] = 123;
89+ ut_asserteq(1, run_commandf("fdt addr %08x", addr));
90+ ut_assert_nextline("libfdt fdt_check_header(): FDT_ERR_BADMAGIC");
91+ ut_assertok(ut_check_console_end(uts));
92+
93+ /* Test detecting an invalid FDT */
94+ fdt[0] = 123;
95+ set_working_fdt_addr(addr);
96+ ut_asserteq(1, run_commandf("fdt addr"));
97+ ut_assert_nextline("libfdt fdt_check_header(): FDT_ERR_BADMAGIC");
98+ ut_assertok(ut_check_console_end(uts));
99+
100+ return 0;
101+}
102+FDT_TEST(fdt_test_addr, UT_TESTF_CONSOLE_REC);
103+
104+/* Test 'fdt addr' resizing an fdt */
105+static int fdt_test_resize(struct unit_test_state *uts)
106+{
107+ char fdt[256];
108+ const int newsize = sizeof(fdt) / 2;
109+ ulong addr;
110+
111+ ut_assertok(make_test_fdt(uts, fdt, sizeof(fdt)));
112+ addr = map_to_sysmem(fdt);
113+ set_working_fdt_addr(addr);
114+
115+ /* Test setting and resizing the working FDT to a larger size */
116+ ut_assertok(console_record_reset_enable());
117+ ut_assertok(run_commandf("fdt addr %08x %x", addr, newsize));
118+ ut_assertok(ut_check_console_end(uts));
119+
120+ /* Try shrinking it */
121+ ut_assertok(run_commandf("fdt addr %08x %x", addr, sizeof(fdt) / 4));
122+ ut_assert_nextline("New length %d < existing length %d, ignoring",
123+ (int)sizeof(fdt) / 4, newsize);
124+ ut_assertok(ut_check_console_end(uts));
125+
126+ /* ...quietly */
127+ ut_assertok(run_commandf("fdt addr -q %08x %x", addr, sizeof(fdt) / 4));
128+ ut_assertok(ut_check_console_end(uts));
129+
130+ /* We cannot easily provoke errors in fdt_open_into(), so ignore that */
131+
132+ return 0;
133+}
134+FDT_TEST(fdt_test_resize, UT_TESTF_CONSOLE_REC);
135+
136+int do_ut_fdt(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
137+{
138+ struct unit_test *tests = UNIT_TEST_SUITE_START(fdt_test);
139+ const int n_ents = UNIT_TEST_SUITE_COUNT(fdt_test);
140+
141+ return cmd_ut_category("fdt", "fdt_test_", tests, n_ents, argc, argv);
142+}
--- a/test/cmd_ut.c
+++ b/test/cmd_ut.c
@@ -39,6 +39,9 @@ static struct cmd_tbl cmd_ut_sub[] = {
3939 #if defined(CONFIG_UT_ENV)
4040 U_BOOT_CMD_MKENT(env, CONFIG_SYS_MAXARGS, 1, do_ut_env, "", ""),
4141 #endif
42+#ifdef CONFIG_CMD_FDT
43+ U_BOOT_CMD_MKENT(fdt, CONFIG_SYS_MAXARGS, 1, do_ut_fdt, "", ""),
44+#endif
4245 #ifdef CONFIG_UT_OPTEE
4346 U_BOOT_CMD_MKENT(optee, CONFIG_SYS_MAXARGS, 1, do_ut_optee, "", ""),
4447 #endif
@@ -131,6 +134,9 @@ static char ut_help_text[] =
131134 #ifdef CONFIG_UT_ENV
132135 "ut env [test-name]\n"
133136 #endif
137+#ifdef CONFIG_CMD_FDT
138+ "ut fdt [test-name] - test of the fdt command\n"
139+#endif
134140 #ifdef CONFIG_UT_LIB
135141 "ut lib [test-name] - test library functions\n"
136142 #endif
--- a/test/log/log_test.c
+++ b/test/log/log_test.c
@@ -277,7 +277,7 @@ int do_log_test_helpers(struct unit_test_state *uts)
277277 log_content("level %d\n", LOGL_DEBUG_CONTENT);
278278 log_io("level %d\n", LOGL_DEBUG_IO);
279279
280- for (i = LOGL_EMERG; i <= _LOG_MAX_LEVEL; i++)
280+ for (i = LOGL_EMERG; i <= gd->default_log_level; i++)
281281 ut_assert_nextline("%*s() level %d", CONFIG_LOGF_FUNC_PAD,
282282 __func__, i);
283283 ut_assert_console_end();
@@ -381,7 +381,8 @@ int log_test_level_deny(struct unit_test_state *uts)
381381 ut_assertok(console_record_reset_enable());
382382 log_run();
383383 check_log_entries_flags_levels(EXPECT_LOG | EXPECT_DIRECT | EXPECT_FORCE,
384- LOGL_WARNING + 1, _LOG_MAX_LEVEL);
384+ LOGL_WARNING + 1,
385+ min(gd->default_log_level, LOGL_INFO));
385386
386387 ut_assertok(log_remove_filter("console", filt1));
387388 ut_assertok(log_remove_filter("console", filt2));
@@ -420,9 +421,11 @@ int log_test_dropped(struct unit_test_state *uts)
420421 gd->log_drop_count = 0;
421422
422423 ut_assertok(console_record_reset_enable());
423- log_run();
424424
425- ut_asserteq(gd->log_drop_count, 3 * (LOGL_COUNT - LOGL_FIRST - 1));
425+ log_run();
426+ ut_asserteq(2 * (LOGL_COUNT - LOGL_FIRST) +
427+ _LOG_MAX_LEVEL - LOGL_FIRST + 1,
428+ gd->log_drop_count);
426429 check_log_entries_flags_levels(EXPECT_DEBUG, LOGL_FIRST, CONFIG_LOG_DEFAULT_LEVEL);
427430
428431 gd->flags |= GD_FLG_LOG_READY;
--- a/tools/binman/etype/fit.py
+++ b/tools/binman/etype/fit.py
@@ -658,6 +658,7 @@ class Entry_fit(Entry_section):
658658 # Build a new tree with all nodes and properties starting from the
659659 # entry node
660660 fsw = libfdt.FdtSw()
661+ fsw.INC_SIZE = 65536
661662 fsw.finish_reservemap()
662663 to_remove = []
663664 loadables = []
--- a/tools/patman/checkpatch.py
+++ b/tools/patman/checkpatch.py
@@ -186,7 +186,7 @@ def check_patch_parse(checkpatch_output, verbose=False):
186186 return result
187187
188188
189-def check_patch(fname, verbose=False, show_types=False):
189+def check_patch(fname, verbose=False, show_types=False, use_tree=False):
190190 """Run checkpatch.pl on a file and parse the results.
191191
192192 Args:
@@ -194,6 +194,7 @@ def check_patch(fname, verbose=False, show_types=False):
194194 verbose: True to print out every line of the checkpatch output as it is
195195 parsed
196196 show_types: Tell checkpatch to show the type (number) of each message
197+ use_tree (bool): If False we'll pass '--no-tree' to checkpatch.
197198
198199 Returns:
199200 namedtuple containing:
@@ -210,7 +211,9 @@ def check_patch(fname, verbose=False, show_types=False):
210211 stdout: Full output of checkpatch
211212 """
212213 chk = find_check_patch()
213- args = [chk, '--no-tree']
214+ args = [chk]
215+ if not use_tree:
216+ args.append('--no-tree')
214217 if show_types:
215218 args.append('--show-types')
216219 output = command.output(*args, fname, raise_on_error=False)
@@ -236,13 +239,13 @@ def get_warning_msg(col, msg_type, fname, line, msg):
236239 line_str = '' if line is None else '%d' % line
237240 return '%s:%s: %s: %s\n' % (fname, line_str, msg_type, msg)
238241
239-def check_patches(verbose, args):
242+def check_patches(verbose, args, use_tree):
240243 '''Run the checkpatch.pl script on each patch'''
241244 error_count, warning_count, check_count = 0, 0, 0
242245 col = terminal.Color()
243246
244247 for fname in args:
245- result = check_patch(fname, verbose)
248+ result = check_patch(fname, verbose, use_tree=use_tree)
246249 if not result.ok:
247250 error_count += result.errors
248251 warning_count += result.warnings
--- a/tools/patman/control.py
+++ b/tools/patman/control.py
@@ -64,7 +64,7 @@ def prepare_patches(col, branch, count, start, end, ignore_binary, signoff):
6464 patchstream.insert_cover_letter(cover_fname, series, to_do)
6565 return series, cover_fname, patch_files
6666
67-def check_patches(series, patch_files, run_checkpatch, verbose):
67+def check_patches(series, patch_files, run_checkpatch, verbose, use_tree):
6868 """Run some checks on a set of patches
6969
7070 This santiy-checks the patman tags like Series-version and runs the patches
@@ -77,6 +77,7 @@ def check_patches(series, patch_files, run_checkpatch, verbose):
7777 run_checkpatch (bool): True to run checkpatch.pl
7878 verbose (bool): True to print out every line of the checkpatch output as
7979 it is parsed
80+ use_tree (bool): If False we'll pass '--no-tree' to checkpatch.
8081
8182 Returns:
8283 bool: True if the patches had no errors, False if they did
@@ -86,7 +87,7 @@ def check_patches(series, patch_files, run_checkpatch, verbose):
8687
8788 # Check the patches, and run them through 'git am' just to be sure
8889 if run_checkpatch:
89- ok = checkpatch.check_patches(verbose, patch_files)
90+ ok = checkpatch.check_patches(verbose, patch_files, use_tree)
9091 else:
9192 ok = True
9293 return ok
@@ -165,7 +166,7 @@ def send(args):
165166 col, args.branch, args.count, args.start, args.end,
166167 args.ignore_binary, args.add_signoff)
167168 ok = check_patches(series, patch_files, args.check_patch,
168- args.verbose)
169+ args.verbose, args.check_patch_use_tree)
169170
170171 ok = ok and gitutil.check_suppress_cc_config()
171172
--- a/tools/patman/main.py
+++ b/tools/patman/main.py
@@ -81,6 +81,12 @@ send.add_argument('--no-binary', action='store_true', dest='ignore_binary',
8181 send.add_argument('--no-check', action='store_false', dest='check_patch',
8282 default=True,
8383 help="Don't check for patch compliance")
84+send.add_argument('--tree', dest='check_patch_use_tree', default=False,
85+ action='store_true',
86+ help=("Set `tree` to True. If `tree` is False then we'll "
87+ "pass '--no-tree' to checkpatch (default: tree=%(default)s)"))
88+send.add_argument('--no-tree', dest='check_patch_use_tree',
89+ action='store_false', help="Set `tree` to False")
8490 send.add_argument('--no-tags', action='store_false', dest='process_tags',
8591 default=True, help="Don't process subject tags as aliases")
8692 send.add_argument('--no-signoff', action='store_false', dest='add_signoff',
--- a/tools/patman/settings.py
+++ b/tools/patman/settings.py
@@ -23,6 +23,7 @@ _default_settings = {
2323 "u-boot": {},
2424 "linux": {
2525 "process_tags": "False",
26+ "check_patch_use_tree": "True",
2627 },
2728 "gcc": {
2829 "process_tags": "False",
@@ -71,7 +72,7 @@ class _ProjectConfigParser(ConfigParser.SafeConfigParser):
7172 >>> config = _ProjectConfigParser("linux")
7273 >>> config.readfp(StringIO(sample_config))
7374 >>> sorted((str(a), str(b)) for (a, b) in config.items("settings"))
74- [('am_hero', 'True'), ('process_tags', 'False')]
75+ [('am_hero', 'True'), ('check_patch_use_tree', 'True'), ('process_tags', 'False')]
7576
7677 # Check to make sure that settings works with unknown project.
7778 >>> config = _ProjectConfigParser("unknown")