aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2023-04-28 19:00:01 -0400
committerTom Rini <trini@konsulko.com>2023-04-28 19:00:01 -0400
commit076f13308c6f06e2c4feb8b408e997bc732586e1 (patch)
tree412d95d550e2e03214f48c89db608c57886e0995
parentc9c2c95d4cd27fe0cd41fe13a863899d268f973c (diff)
parentf43fc16812487289e98389f0f643d20c444f9c9c (diff)
downloadu-boot-076f13308c6f06e2c4feb8b408e997bc732586e1.zip
u-boot-076f13308c6f06e2c4feb8b408e997bc732586e1.tar.gz
u-boot-076f13308c6f06e2c4feb8b408e997bc732586e1.tar.bz2
Merge tag 'dm-pull-28apr23' of https://source.denx.de/u-boot/custodians/u-boot-dmWIP/28Apr2023
sandbox and fdt bug fixes / tweaks various other minor fixes
-rw-r--r--MAINTAINERS1
-rw-r--r--arch/sandbox/cpu/cpu.c2
-rw-r--r--arch/sandbox/cpu/os.c8
-rw-r--r--arch/sandbox/cpu/state.c5
-rw-r--r--arch/sandbox/include/asm/posix_types.h7
-rw-r--r--arch/sandbox/include/asm/u-boot-sandbox.h2
-rw-r--r--boot/vbe_simple.c12
-rw-r--r--cmd/bootflow.c24
-rw-r--r--common/fdt_simplefb.c8
-rw-r--r--common/fdt_support.c4
-rw-r--r--drivers/block/host_dev.c3
-rw-r--r--drivers/core/fdtaddr.c6
-rw-r--r--drivers/core/of_access.c2
-rw-r--r--drivers/core/uclass.c50
-rw-r--r--drivers/mtd/spi/sandbox.c1
-rw-r--r--drivers/sysreset/sysreset_sandbox.c1
-rw-r--r--drivers/tee/sandbox.c15
-rw-r--r--drivers/usb/emul/sandbox_flash.c1
-rw-r--r--drivers/usb/emul/sandbox_hub.c30
-rw-r--r--include/binman_sym.h8
-rw-r--r--include/dm/uclass.h17
-rw-r--r--include/fdt_simplefb.h1
-rw-r--r--include/os.h2
-rw-r--r--lib/fdtdec.c3
-rw-r--r--test/cmd/fdt.c2
-rw-r--r--test/dm/test-fdt.c5
-rw-r--r--tools/binman/cmdline.py2
-rw-r--r--tools/binman/control.py6
-rw-r--r--tools/binman/test/blob_syms.c2
-rw-r--r--tools/binman/test/u_boot_binman_syms.c2
-rw-r--r--tools/binman/test/u_boot_binman_syms_size.c2
-rw-r--r--tools/buildman/control.py6
-rwxr-xr-xtools/patman/__main__.py6
-rw-r--r--tools/patman/func_test.py4
34 files changed, 149 insertions, 101 deletions
diff --git a/MAINTAINERS b/MAINTAINERS
index 0257526..f752132 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1361,6 +1361,7 @@ F: arch/sandbox/
F: doc/arch/sandbox.rst
F: drivers/*/*sandbox*.c
F: include/dt-bindings/*/sandbox*.h
+F: include/os.h
SEAMA
M: Linus Walleij <linus.walleij@linaro.org>
diff --git a/arch/sandbox/cpu/cpu.c b/arch/sandbox/cpu/cpu.c
index 248d17a..5149633 100644
--- a/arch/sandbox/cpu/cpu.c
+++ b/arch/sandbox/cpu/cpu.c
@@ -31,7 +31,7 @@ static struct udevice *map_dev;
unsigned long map_len;
#endif
-void sandbox_exit(void)
+void __noreturn sandbox_exit(void)
{
/* Do this here while it still has an effect */
os_fd_restore();
diff --git a/arch/sandbox/cpu/os.c b/arch/sandbox/cpu/os.c
index 5e66304..9e93a0f 100644
--- a/arch/sandbox/cpu/os.c
+++ b/arch/sandbox/cpu/os.c
@@ -166,7 +166,7 @@ int os_write_file(const char *fname, const void *buf, int size)
return 0;
}
-int os_filesize(int fd)
+off_t os_filesize(int fd)
{
off_t size;
@@ -218,7 +218,7 @@ err:
int os_map_file(const char *pathname, int os_flags, void **bufp, int *sizep)
{
void *ptr;
- int size;
+ off_t size;
int ifd;
ifd = os_open(pathname, os_flags);
@@ -231,6 +231,10 @@ int os_map_file(const char *pathname, int os_flags, void **bufp, int *sizep)
printf("Cannot get file size of '%s'\n", pathname);
return -EIO;
}
+ if ((unsigned long long)size > (unsigned long long)SIZE_MAX) {
+ printf("File '%s' too large to map\n", pathname);
+ return -EIO;
+ }
ptr = mmap(0, size, PROT_READ | PROT_WRITE, MAP_SHARED, ifd, 0);
if (ptr == MAP_FAILED) {
diff --git a/arch/sandbox/cpu/state.c b/arch/sandbox/cpu/state.c
index 69da378..d678349 100644
--- a/arch/sandbox/cpu/state.c
+++ b/arch/sandbox/cpu/state.c
@@ -10,6 +10,7 @@
#include <fdtdec.h>
#include <log.h>
#include <os.h>
+#include <trace.h>
#include <asm/malloc.h>
#include <asm/state.h>
#include <asm/test.h>
@@ -525,6 +526,10 @@ int state_uninit(void)
if (state->jumped_fname)
os_unlink(state->jumped_fname);
+ /* Disable tracing before unmapping RAM */
+ if (IS_ENABLED(CONFIG_TRACE))
+ trace_set_enabled(0);
+
os_free(state->state_fdt);
os_free(state->ram_buf);
memset(state, '\0', sizeof(*state));
diff --git a/arch/sandbox/include/asm/posix_types.h b/arch/sandbox/include/asm/posix_types.h
index ec18ed7..e1442c4 100644
--- a/arch/sandbox/include/asm/posix_types.h
+++ b/arch/sandbox/include/asm/posix_types.h
@@ -1,5 +1,6 @@
+/* SPDX-License-Identifier: GPL-2.0 */
/*
- * linux/include/asm-arm/posix_types.h
+ * Based on linux/include/asm-arm/posix_types.h
*
* Copyright (C) 1996-1998 Russell King.
*
@@ -10,8 +11,8 @@
* Changelog:
* 27-06-1996 RMK Created
*/
-#ifndef __ARCH_ARM_POSIX_TYPES_H
-#define __ARCH_ARM_POSIX_TYPES_H
+#ifndef __ARCH_SANDBOX_POSIX_TYPES_H
+#define __ARCH_SANDBOX_POSIX_TYPES_H
/*
* This file is generally used by user-level software, so you need to
diff --git a/arch/sandbox/include/asm/u-boot-sandbox.h b/arch/sandbox/include/asm/u-boot-sandbox.h
index 9eb1932..e702774 100644
--- a/arch/sandbox/include/asm/u-boot-sandbox.h
+++ b/arch/sandbox/include/asm/u-boot-sandbox.h
@@ -87,6 +87,6 @@ void sandbox_set_enable_pci_map(int enable);
void sandbox_reset(void);
/* Exit sandbox (quit U-Boot) */
-void sandbox_exit(void);
+void __noreturn sandbox_exit(void);
#endif /* _U_BOOT_SANDBOX_H_ */
diff --git a/boot/vbe_simple.c b/boot/vbe_simple.c
index 59676d8..12682ab 100644
--- a/boot/vbe_simple.c
+++ b/boot/vbe_simple.c
@@ -148,11 +148,13 @@ static int vbe_simple_read_bootflow(struct udevice *dev, struct bootflow *bflow)
{
int ret;
- if (vbe_phase() == VBE_PHASE_FIRMWARE) {
- ret = vbe_simple_read_bootflow_fw(dev, bflow);
- if (ret)
- return log_msg_ret("fw", ret);
- return 0;
+ if (CONFIG_IS_ENABLED(BOOTMETH_VBE_SIMPLE_FW)) {
+ if (vbe_phase() == VBE_PHASE_FIRMWARE) {
+ ret = vbe_simple_read_bootflow_fw(dev, bflow);
+ if (ret)
+ return log_msg_ret("fw", ret);
+ return 0;
+ }
}
return -EINVAL;
diff --git a/cmd/bootflow.c b/cmd/bootflow.c
index aa06999..cfe3422 100644
--- a/cmd/bootflow.c
+++ b/cmd/bootflow.c
@@ -390,6 +390,11 @@ static int do_bootflow_menu(struct cmd_tbl *cmdtp, int flag, int argc,
bool text_mode = false;
int ret;
+ if (!IS_ENABLED(CONFIG_EXPO)) {
+ printf("Menu not supported\n");
+ return CMD_RET_FAILURE;
+ }
+
if (argc > 1 && *argv[1] == '-')
text_mode = strchr(argv[1], 't');
@@ -397,20 +402,15 @@ static int do_bootflow_menu(struct cmd_tbl *cmdtp, int flag, int argc,
if (ret)
return CMD_RET_FAILURE;
- if (IS_ENABLED(CONFIG_EXPO)) {
- ret = bootflow_menu_run(std, text_mode, &bflow);
- if (ret) {
- if (ret == -EAGAIN)
- printf("Nothing chosen\n");
- else
- printf("Menu failed (err=%d)\n", ret);
+ ret = bootflow_menu_run(std, text_mode, &bflow);
+ if (ret) {
+ if (ret == -EAGAIN)
+ printf("Nothing chosen\n");
+ else {
+ printf("Menu failed (err=%d)\n", ret);
+ return CMD_RET_FAILURE;
}
- } else {
- printf("Menu not supported\n");
- ret = -ENOSYS;
}
- if (ret)
- return CMD_RET_FAILURE;
printf("Selected: %s\n", bflow->os_name ? bflow->os_name : bflow->name);
std->cur_bootflow = bflow;
diff --git a/common/fdt_simplefb.c b/common/fdt_simplefb.c
index 282c34f..069ced7 100644
--- a/common/fdt_simplefb.c
+++ b/common/fdt_simplefb.c
@@ -71,7 +71,13 @@ int fdt_simplefb_add_node(void *blob)
return fdt_simplefb_configure_node(blob, off);
}
-int fdt_simplefb_enable_existing_node(void *blob)
+/**
+ * fdt_simplefb_enable_existing_node() - enable simple-framebuffer DT node
+ *
+ * @blob: device-tree
+ * Return: 0 on success, non-zero otherwise
+ */
+static int fdt_simplefb_enable_existing_node(void *blob)
{
int off;
diff --git a/common/fdt_support.c b/common/fdt_support.c
index dbceec6..2053fe3 100644
--- a/common/fdt_support.c
+++ b/common/fdt_support.c
@@ -1486,11 +1486,11 @@ out:
}
/**
- * fdt_node_offset_by_compat_reg: Find a node that matches compatiable and
+ * fdt_node_offset_by_compat_reg: Find a node that matches compatible and
* who's reg property matches a physical cpu address
*
* @blob: ptr to device tree
- * @compat: compatiable string to match
+ * @compat: compatible string to match
* @compat_off: property name
*
*/
diff --git a/drivers/block/host_dev.c b/drivers/block/host_dev.c
index 5885fc3..6442241 100644
--- a/drivers/block/host_dev.c
+++ b/drivers/block/host_dev.c
@@ -24,7 +24,8 @@ static int host_sb_attach_file(struct udevice *dev, const char *filename)
struct host_sb_plat *plat = dev_get_plat(dev);
struct blk_desc *desc;
struct udevice *blk;
- int ret, fd, size;
+ int ret, fd;
+ off_t size;
char *fname;
if (!filename)
diff --git a/drivers/core/fdtaddr.c b/drivers/core/fdtaddr.c
index 91bcd1a..b9b0c28 100644
--- a/drivers/core/fdtaddr.c
+++ b/drivers/core/fdtaddr.c
@@ -12,6 +12,7 @@
#include <dm.h>
#include <fdt_support.h>
#include <log.h>
+#include <mapmem.h>
#include <asm/global_data.h>
#include <asm/io.h>
#include <dm/device-internal.h>
@@ -97,7 +98,10 @@ void *devfdt_get_addr_index_ptr(const struct udevice *dev, int index)
{
fdt_addr_t addr = devfdt_get_addr_index(dev, index);
- return (addr == FDT_ADDR_T_NONE) ? NULL : (void *)(uintptr_t)addr;
+ if (addr == FDT_ADDR_T_NONE)
+ return NULL;
+
+ return map_sysmem(addr, 0);
}
fdt_addr_t devfdt_get_addr_size_index(const struct udevice *dev, int index,
diff --git a/drivers/core/of_access.c b/drivers/core/of_access.c
index 85f7da5..81a3079 100644
--- a/drivers/core/of_access.c
+++ b/drivers/core/of_access.c
@@ -33,7 +33,7 @@
DECLARE_GLOBAL_DATA_PTR;
/* list of struct alias_prop aliases */
-LIST_HEAD(aliases_lookup);
+static LIST_HEAD(aliases_lookup);
/* "/aliaes" node */
static struct device_node *of_aliases;
diff --git a/drivers/core/uclass.c b/drivers/core/uclass.c
index 1762a07..e46d571 100644
--- a/drivers/core/uclass.c
+++ b/drivers/core/uclass.c
@@ -411,18 +411,14 @@ done:
}
#if CONFIG_IS_ENABLED(OF_REAL)
-int uclass_find_device_by_phandle(enum uclass_id id, struct udevice *parent,
- const char *name, struct udevice **devp)
+static int uclass_find_device_by_phandle_id(enum uclass_id id,
+ uint find_phandle,
+ struct udevice **devp)
{
struct udevice *dev;
struct uclass *uc;
- int find_phandle;
int ret;
- *devp = NULL;
- find_phandle = dev_read_u32_default(parent, name, -1);
- if (find_phandle <= 0)
- return -ENOENT;
ret = uclass_get(id, &uc);
if (ret)
return ret;
@@ -440,6 +436,19 @@ int uclass_find_device_by_phandle(enum uclass_id id, struct udevice *parent,
return -ENODEV;
}
+
+int uclass_find_device_by_phandle(enum uclass_id id, struct udevice *parent,
+ const char *name, struct udevice **devp)
+{
+ int find_phandle;
+
+ *devp = NULL;
+ find_phandle = dev_read_u32_default(parent, name, -1);
+ if (find_phandle <= 0)
+ return -ENOENT;
+
+ return uclass_find_device_by_phandle_id(id, find_phandle, devp);
+}
#endif
int uclass_get_device_by_driver(enum uclass_id id,
@@ -535,31 +544,22 @@ int uclass_get_device_by_ofnode(enum uclass_id id, ofnode node,
return uclass_get_device_tail(dev, ret, devp);
}
-#if CONFIG_IS_ENABLED(OF_CONTROL)
+#if CONFIG_IS_ENABLED(OF_REAL)
+int uclass_get_device_by_of_path(enum uclass_id id, const char *path,
+ struct udevice **devp)
+{
+ return uclass_get_device_by_ofnode(id, ofnode_path(path), devp);
+}
+
int uclass_get_device_by_phandle_id(enum uclass_id id, uint phandle_id,
struct udevice **devp)
{
struct udevice *dev;
- struct uclass *uc;
int ret;
*devp = NULL;
- ret = uclass_get(id, &uc);
- if (ret)
- return ret;
-
- uclass_foreach_dev(dev, uc) {
- uint phandle;
-
- phandle = dev_read_phandle(dev);
-
- if (phandle == phandle_id) {
- *devp = dev;
- return uclass_get_device_tail(dev, ret, devp);
- }
- }
-
- return -ENODEV;
+ ret = uclass_find_device_by_phandle_id(id, phandle_id, &dev);
+ return uclass_get_device_tail(dev, ret, devp);
}
int uclass_get_device_by_phandle(enum uclass_id id, struct udevice *parent,
diff --git a/drivers/mtd/spi/sandbox.c b/drivers/mtd/spi/sandbox.c
index 3c01e3b..4fe5471 100644
--- a/drivers/mtd/spi/sandbox.c
+++ b/drivers/mtd/spi/sandbox.c
@@ -248,6 +248,7 @@ static int sandbox_sf_process_cmd(struct sandbox_spi_flash *sbsf, const u8 *rx,
break;
case SPINOR_OP_READ_FAST:
sbsf->pad_addr_bytes = 1;
+ fallthrough;
case SPINOR_OP_READ:
case SPINOR_OP_PP:
sbsf->state = SF_ADDR;
diff --git a/drivers/sysreset/sysreset_sandbox.c b/drivers/sysreset/sysreset_sandbox.c
index 0ee286c..3750c60 100644
--- a/drivers/sysreset/sysreset_sandbox.c
+++ b/drivers/sysreset/sysreset_sandbox.c
@@ -65,7 +65,6 @@ static int sandbox_sysreset_request(struct udevice *dev, enum sysreset_t type)
if (!state->sysreset_allowed[type])
return -EACCES;
sandbox_exit();
- break;
case SYSRESET_POWER:
if (!state->sysreset_allowed[type])
return -EACCES;
diff --git a/drivers/tee/sandbox.c b/drivers/tee/sandbox.c
index 35e8542..86219a9 100644
--- a/drivers/tee/sandbox.c
+++ b/drivers/tee/sandbox.c
@@ -119,6 +119,7 @@ static u32 pta_scp03_invoke_func(struct udevice *dev, u32 func, uint num_params,
{
u32 res;
static bool enabled;
+ static bool provisioned;
switch (func) {
case PTA_CMD_ENABLE_SCP03:
@@ -130,12 +131,18 @@ static u32 pta_scp03_invoke_func(struct udevice *dev, u32 func, uint num_params,
if (res)
return res;
- if (!enabled) {
+ /* If SCP03 was not enabled, enable it */
+ if (!enabled)
enabled = true;
- } else {
- }
- if (params[0].u.value.a)
+ /* If SCP03 was not provisioned, provision new keys */
+ if (params[0].u.value.a && !provisioned)
+ provisioned = true;
+
+ /*
+ * Either way, we asume both operations succeeded and that
+ * the communication channel has now been stablished
+ */
return TEE_SUCCESS;
default:
diff --git a/drivers/usb/emul/sandbox_flash.c b/drivers/usb/emul/sandbox_flash.c
index 01ccc4b..7c5c1ab 100644
--- a/drivers/usb/emul/sandbox_flash.c
+++ b/drivers/usb/emul/sandbox_flash.c
@@ -266,6 +266,7 @@ static int sandbox_flash_bulk(struct udevice *dev, struct usb_device *udev,
default:
break;
}
+ break;
case SANDBOX_FLASH_EP_IN:
switch (info->phase) {
case SCSIPH_DATA:
diff --git a/drivers/usb/emul/sandbox_hub.c b/drivers/usb/emul/sandbox_hub.c
index 041ec37..084cc16 100644
--- a/drivers/usb/emul/sandbox_hub.c
+++ b/drivers/usb/emul/sandbox_hub.c
@@ -220,13 +220,9 @@ static int sandbox_hub_submit_control_msg(struct udevice *bus,
udev->status = 0;
udev->act_len = sizeof(*hubsts);
return 0;
+ }
}
- default:
- debug("%s: rx ctl requesttype=%x, request=%x\n",
- __func__, setup->requesttype,
- setup->request);
- break;
- }
+ break;
case USB_RT_PORT | USB_DIR_IN:
switch (setup->request) {
case USB_REQ_GET_STATUS: {
@@ -239,13 +235,12 @@ static int sandbox_hub_submit_control_msg(struct udevice *bus,
udev->status = 0;
udev->act_len = sizeof(*portsts);
return 0;
+ }
}
- }
- default:
- debug("%s: rx ctl requesttype=%x, request=%x\n",
- __func__, setup->requesttype, setup->request);
break;
}
+ debug("%s: rx ctl requesttype=%x, request=%x\n",
+ __func__, setup->requesttype, setup->request);
} else if (pipe == usb_sndctrlpipe(udev, 0)) {
switch (setup->requesttype) {
case USB_RT_PORT:
@@ -263,7 +258,7 @@ static int sandbox_hub_submit_control_msg(struct udevice *bus,
debug(" ** Invalid feature\n");
}
return ret;
- }
+ }
case USB_REQ_CLEAR_FEATURE: {
int port;
@@ -279,18 +274,11 @@ static int sandbox_hub_submit_control_msg(struct udevice *bus,
}
udev->status = 0;
return 0;
+ }
}
- default:
- debug("%s: tx ctl requesttype=%x, request=%x\n",
- __func__, setup->requesttype,
- setup->request);
- break;
- }
- default:
- debug("%s: tx ctl requesttype=%x, request=%x\n",
- __func__, setup->requesttype, setup->request);
- break;
}
+ debug("%s: tx ctl requesttype=%x, request=%x\n",
+ __func__, setup->requesttype, setup->request);
}
debug("pipe=%lx\n", pipe);
diff --git a/include/binman_sym.h b/include/binman_sym.h
index 528d7e4..49a95ea 100644
--- a/include/binman_sym.h
+++ b/include/binman_sym.h
@@ -71,7 +71,7 @@
* value #defined above. This is used to check at runtime if the
* symbol values were filled in and are OK to use.
*/
-extern ulong _binman_sym_magic;
+extern unsigned long _binman_sym_magic;
/**
* DECLARE_BINMAN_MAGIC_SYM - Declare the internal magic symbol
@@ -81,7 +81,7 @@ extern ulong _binman_sym_magic;
* definitions of the symbol.
*/
#define DECLARE_BINMAN_MAGIC_SYM \
- ulong _binman_sym_magic \
+ unsigned long _binman_sym_magic \
__attribute__((aligned(4), section(".binman_sym")))
/**
@@ -93,14 +93,14 @@ extern ulong _binman_sym_magic;
* Return: 1 if binman symbol values are usable, 0 if not
*/
#define BINMAN_SYMS_OK \
- (*(ulong *)&_binman_sym_magic == BINMAN_SYM_MAGIC_VALUE)
+ (*(unsigned long *)&_binman_sym_magic == BINMAN_SYM_MAGIC_VALUE)
/**
* binman_sym() - Access a previously declared symbol
*
* This is used to get the value of a symbol. E.g.:
*
- * ulong address = binman_sym(ulong, u_boot_spl, pos);
+ * unsigned long address = binman_sym(unsigned long, u_boot_spl, pos);
*
* @_type: Type f the symbol (e.g. unsigned long)
* @entry_name: Name of the entry to look for (e.g. 'u_boot_spl')
diff --git a/include/dm/uclass.h b/include/dm/uclass.h
index ee15c92..5c5fb9a 100644
--- a/include/dm/uclass.h
+++ b/include/dm/uclass.h
@@ -265,6 +265,23 @@ int uclass_get_device_by_ofnode(enum uclass_id id, ofnode node,
struct udevice **devp);
/**
+ * uclass_get_device_by_of_path() - Get a uclass device by device tree path
+ *
+ * This searches the devices in the uclass for one attached to the
+ * device tree node corresponding to the given path (which may also be
+ * an alias).
+ *
+ * The device is probed to activate it ready for use.
+ *
+ * @id: ID to look up
+ * @node: Device tree path to search for (if no such path then -ENODEV is returned)
+ * @devp: Returns pointer to device (there is only one for each node)
+ * Return: 0 if OK, -ve on error
+ */
+int uclass_get_device_by_of_path(enum uclass_id id, const char *path,
+ struct udevice **devp);
+
+/**
* uclass_get_device_by_phandle_id() - Get a uclass device by phandle id
*
* This searches the devices in the uclass for one with the given phandle id.
diff --git a/include/fdt_simplefb.h b/include/fdt_simplefb.h
index 41cd740..af93e3b 100644
--- a/include/fdt_simplefb.h
+++ b/include/fdt_simplefb.h
@@ -9,6 +9,5 @@
#ifndef _FDT_SIMPLEFB_H_
#define _FDT_SIMPLEFB_H_
int fdt_simplefb_add_node(void *blob);
-int fdt_simplefb_enable_existing_node(void *blob);
int fdt_simplefb_enable_and_mem_rsv(void *blob);
#endif
diff --git a/include/os.h b/include/os.h
index 0415f0f..968412b 100644
--- a/include/os.h
+++ b/include/os.h
@@ -64,7 +64,7 @@ off_t os_lseek(int fd, off_t offset, int whence);
* @fd: File descriptor as returned by os_open()
* Return: file size or negative error code
*/
-int os_filesize(int fd);
+off_t os_filesize(int fd);
/**
* Access to the OS open() system call
diff --git a/lib/fdtdec.c b/lib/fdtdec.c
index 0827e16..55cc95d 100644
--- a/lib/fdtdec.c
+++ b/lib/fdtdec.c
@@ -1,6 +1,9 @@
// SPDX-License-Identifier: GPL-2.0+
/*
* Copyright (c) 2011 The Chromium OS Authors.
+ *
+ * NOTE: Please do not add new devicetree-reading functionality into this file.
+ * Add it to the ofnode API instead, since that is compatible with livetree.
*/
#ifndef USE_HOSTCC
diff --git a/test/cmd/fdt.c b/test/cmd/fdt.c
index 7835da2..1f103a1 100644
--- a/test/cmd/fdt.c
+++ b/test/cmd/fdt.c
@@ -2,7 +2,7 @@
/*
* Tests for fdt command
*
- * Copyright 2022 Google LLCmap_to_sysmem(fdt));
+ * Copyright 2022 Google LLC
*/
#include <common.h>
diff --git a/test/dm/test-fdt.c b/test/dm/test-fdt.c
index 8e6e42e..eeecd1d 100644
--- a/test/dm/test-fdt.c
+++ b/test/dm/test-fdt.c
@@ -617,6 +617,7 @@ static int dm_test_fdt_get_addr_ptr_flat(struct unit_test_state *uts)
{
struct udevice *gpio, *dev;
void *ptr;
+ void *paddr;
/* Test for missing reg property */
ut_assertok(uclass_first_device_err(UCLASS_GPIO, &gpio));
@@ -624,7 +625,9 @@ static int dm_test_fdt_get_addr_ptr_flat(struct unit_test_state *uts)
ut_assertok(uclass_find_device_by_seq(UCLASS_TEST_DUMMY, 0, &dev));
ptr = devfdt_get_addr_ptr(dev);
- ut_asserteq_ptr((void *)0x8000, ptr);
+
+ paddr = map_sysmem(0x8000, 0);
+ ut_asserteq_ptr(paddr, ptr);
return 0;
}
diff --git a/tools/binman/cmdline.py b/tools/binman/cmdline.py
index 4b875a9..9632ec1 100644
--- a/tools/binman/cmdline.py
+++ b/tools/binman/cmdline.py
@@ -95,7 +95,7 @@ controlled by a description in the board device tree.'''
parser.add_argument('-H', '--full-help', action='store_true',
default=False, help='Display the README file')
parser.add_argument('--tooldir', type=str,
- default=os.path.join(os.getenv('HOME'), '.binman-tools'),
+ default=os.path.join(os.path.expanduser('~/.binman-tools')),
help='Set the directory to store tools')
parser.add_argument('--toolpath', type=str, action='append',
help='Add a path to the list of directories containing tools')
diff --git a/tools/binman/control.py b/tools/binman/control.py
index 0febcb7..68597c4 100644
--- a/tools/binman/control.py
+++ b/tools/binman/control.py
@@ -7,7 +7,11 @@
from collections import OrderedDict
import glob
-import importlib.resources
+try:
+ import importlib.resources
+except ImportError:
+ # for Python 3.6
+ import importlib_resources
import os
import pkg_resources
import re
diff --git a/tools/binman/test/blob_syms.c b/tools/binman/test/blob_syms.c
index d652c79..1df8d64 100644
--- a/tools/binman/test/blob_syms.c
+++ b/tools/binman/test/blob_syms.c
@@ -5,8 +5,6 @@
* Simple program to create some binman symbols. This is used by binman tests.
*/
-typedef unsigned long ulong;
-
#include <linux/kconfig.h>
#include <binman_sym.h>
diff --git a/tools/binman/test/u_boot_binman_syms.c b/tools/binman/test/u_boot_binman_syms.c
index ed76124..147c902 100644
--- a/tools/binman/test/u_boot_binman_syms.c
+++ b/tools/binman/test/u_boot_binman_syms.c
@@ -5,8 +5,6 @@
* Simple program to create some binman symbols. This is used by binman tests.
*/
-typedef unsigned long ulong;
-
#include <linux/kconfig.h>
#include <binman_sym.h>
diff --git a/tools/binman/test/u_boot_binman_syms_size.c b/tools/binman/test/u_boot_binman_syms_size.c
index fa41b3d..f686892 100644
--- a/tools/binman/test/u_boot_binman_syms_size.c
+++ b/tools/binman/test/u_boot_binman_syms_size.c
@@ -5,8 +5,6 @@
* Simple program to create some binman symbols. This is used by binman tests.
*/
-typedef unsigned long ulong;
-
#include <linux/kconfig.h>
#include <binman_sym.h>
diff --git a/tools/buildman/control.py b/tools/buildman/control.py
index 35f44c0..09a11f2 100644
--- a/tools/buildman/control.py
+++ b/tools/buildman/control.py
@@ -3,7 +3,11 @@
#
import multiprocessing
-import importlib.resources
+try:
+ import importlib.resources
+except ImportError:
+ # for Python 3.6
+ import importlib_resources
import os
import shutil
import subprocess
diff --git a/tools/patman/__main__.py b/tools/patman/__main__.py
index 48ffbc8..8eba5d3 100755
--- a/tools/patman/__main__.py
+++ b/tools/patman/__main__.py
@@ -7,7 +7,11 @@
"""See README for more information"""
from argparse import ArgumentParser
-import importlib.resources
+try:
+ import importlib.resources
+except ImportError:
+ # for Python 3.6
+ import importlib_resources
import os
import re
import sys
diff --git a/tools/patman/func_test.py b/tools/patman/func_test.py
index 42ac4ed..e391849 100644
--- a/tools/patman/func_test.py
+++ b/tools/patman/func_test.py
@@ -489,8 +489,8 @@ complicated as possible''')
# pylint: disable=E1101
self.repo.checkout(target, strategy=pygit2.GIT_CHECKOUT_FORCE)
control.setup()
+ orig_dir = os.getcwd()
try:
- orig_dir = os.getcwd()
os.chdir(self.gitdir)
# Check that it can detect the current branch
@@ -679,8 +679,8 @@ diff --git a/lib/efi_loader/efi_memory.c b/lib/efi_loader/efi_memory.c
self.repo.checkout(target, strategy=pygit2.GIT_CHECKOUT_FORCE)
# Check that it can detect the current branch
+ orig_dir = os.getcwd()
try:
- orig_dir = os.getcwd()
os.chdir(self.gitdir)
with self.assertRaises(ValueError) as exc:
gitutil.count_commits_to_branch(None)