};
bootstd {
+ u-boot,dm-vpl;
compatible = "u-boot,boot-std";
filename-prefixes = "/", "/boot/";
efi {
compatible = "u-boot,distro-efi";
};
+
+ firmware0 {
+ u-boot,dm-vpl;
+ compatible = "fwupd,vbe-simple";
+ storage = "mmc1";
+ skip-offset = <0x200>;
+ area-start = <0x400>;
+ area-size = <0x1000>;
+ state-offset = <0x400>;
+ state-size = <0x40>;
+ version-offset = <0x800>;
+ version-size = <0x100>;
+ };
};
fuzzing-engine {
compatible = "denx,u-boot-fdt-test";
reg = <9 1>;
};
-
- fwupd {
- compatible = "simple-bus";
- firmware0 {
- compatible = "fwupd,vbe-simple";
- storage = "mmc1";
- area-start = <0x400>;
- area-size = <0x1000>;
- skip-offset = <0x200>;
- state-offset = <0x400>;
- state-size = <0x40>;
- version-offset = <0x800>;
- version-size = <0x100>;
- };
- };
};
translation-test@8000 {
*/
for (vbe_find_first_device(&dev); dev; vbe_find_next_device(&dev)) {
struct simple_state state;
- ofnode node, subnode;
+ ofnode node, subnode, chosen;
int ret;
if (strcmp("vbe_simple", dev->driver->name))
continue;
- /* Check if there is a node to fix up */
- node = oftree_path(tree, "/chosen/fwupd");
- if (!ofnode_valid(node))
- continue;
- subnode = ofnode_find_subnode(node, dev->name);
- if (!ofnode_valid(subnode))
+ /* Check if there is a node to fix up, adding if not */
+ chosen = oftree_path(tree, "/chosen");
+ if (!ofnode_valid(chosen))
continue;
+ ret = ofnode_add_subnode(chosen, "fwupd", &node);
+ if (ret && ret != -EEXIST)
+ return log_msg_ret("fwu", ret);
+
+ ret = ofnode_add_subnode(node, dev->name, &subnode);
+ if (ret && ret != -EEXIST)
+ return log_msg_ret("dev", ret);
- log_debug("Fixing up: %s\n", dev->name);
ret = device_probe(dev);
if (ret)
return log_msg_ret("probe", ret);
+
+ /* Copy over the vbe properties for fwupd */
+ log_debug("Fixing up: %s\n", dev->name);
+ ret = ofnode_copy_props(dev_ofnode(dev), subnode);
+ if (ret)
+ return log_msg_ret("cp", ret);
+
ret = vbe_simple_read_state(dev, &state);
if (ret)
return log_msg_ret("read", ret);
#include <test/ut.h>
#include "bootstd_common.h"
-/* Basic test of reading nvdata and updating a fwupd node in the device tree */
+/*
+ * Basic test of reading nvdata and updating a fwupd node in the device tree
+ *
+ * This sets up its own VBE info in the device, using bootstd_setup_for_tests()
+ * then does a VBE fixup and checks that everything is present.
+ */
static int vbe_simple_test_base(struct unit_test_state *uts)
{
const char *version, *bl_version;