Lines Matching +full:u +full:- +full:boot
1 // SPDX-License-Identifier: GPL-2.0-only
9 #include <linux/nvmem-provider.h>
14 #include "layouts/u-boot-env.h"
28 struct device *dev = priv->dev; in u_boot_env_read()
32 err = mtd_read(priv->mtd, offset, bytes, &bytes_read, val); in u_boot_env_read()
40 return -EIO; in u_boot_env_read()
49 .name = "u-boot-env", in u_boot_env_probe()
52 struct device *dev = &pdev->dev; in u_boot_env_probe()
53 struct device_node *np = dev->of_node; in u_boot_env_probe()
58 return -ENOMEM; in u_boot_env_probe()
59 priv->dev = dev; in u_boot_env_probe()
61 priv->format = (uintptr_t)of_device_get_match_data(dev); in u_boot_env_probe()
63 priv->mtd = of_get_mtd_device_by_node(np); in u_boot_env_probe()
64 if (IS_ERR(priv->mtd)) { in u_boot_env_probe()
65 dev_err_probe(dev, PTR_ERR(priv->mtd), "Failed to get %pOF MTD\n", np); in u_boot_env_probe()
66 return PTR_ERR(priv->mtd); in u_boot_env_probe()
71 config.size = priv->mtd->size; in u_boot_env_probe()
73 priv->nvmem = devm_nvmem_register(dev, &config); in u_boot_env_probe()
74 if (IS_ERR(priv->nvmem)) in u_boot_env_probe()
75 return PTR_ERR(priv->nvmem); in u_boot_env_probe()
77 return u_boot_env_parse(dev, priv->nvmem, priv->format); in u_boot_env_probe()
81 { .compatible = "u-boot,env", .data = (void *)U_BOOT_FORMAT_SINGLE, },
82 { .compatible = "u-boot,env-redundant-bool", .data = (void *)U_BOOT_FORMAT_REDUNDANT, },
83 { .compatible = "u-boot,env-redundant-count", .data = (void *)U_BOOT_FORMAT_REDUNDANT, },
98 MODULE_DESCRIPTION("U-Boot environment variables support module");