diff options
author | Wolfgang Denk <wd@denx.de> | 2008-01-10 00:49:59 +0100 |
---|---|---|
committer | Wolfgang Denk <wd@denx.de> | 2008-01-10 00:49:59 +0100 |
commit | 694976afa5dcc5c4e7eaeaa0612eac35cd5bd8ec (patch) | |
tree | 711b1a20a1bab99fc304b6fa55374daf35f4919c /common | |
parent | 80adb2761627ec10eb8997bea6c1e52e34816c6b (diff) | |
parent | 17a41e4492121ccf9fa2c10c2cb1a6d1c18d74f7 (diff) | |
download | u-boot-imx-694976afa5dcc5c4e7eaeaa0612eac35cd5bd8ec.zip u-boot-imx-694976afa5dcc5c4e7eaeaa0612eac35cd5bd8ec.tar.gz u-boot-imx-694976afa5dcc5c4e7eaeaa0612eac35cd5bd8ec.tar.bz2 |
Merge branch 'master' of git://www.denx.de/git/u-boot-mpc85xx
Diffstat (limited to 'common')
-rw-r--r-- | common/fdt_support.c | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/common/fdt_support.c b/common/fdt_support.c index 92f1c7f..a13c140 100644 --- a/common/fdt_support.c +++ b/common/fdt_support.c @@ -30,6 +30,9 @@ #include <fdt_support.h> #include <exports.h> +#ifdef CONFIG_QE +#include "../drivers/qe/qe.h" +#endif /* * Global data (for the gd->bd) */ @@ -614,4 +617,49 @@ void fdt_fixup_ethernet(void *fdt, bd_t *bd) #endif } } + +#ifdef CONFIG_QE +/* + * If a QE firmware has been uploaded, then add the 'firmware' node under + * the 'qe' node. + */ +void fdt_fixup_qe_firmware(void *fdt) +{ + struct qe_firmware_info *qe_fw_info; + int node, ret; + + qe_fw_info = qe_get_firmware_info(); + if (!qe_fw_info) + return; + + node = fdt_path_offset(fdt, "/qe"); + if (node < 0) + return; + + /* We assume the node doesn't exist yet */ + node = fdt_add_subnode(fdt, node, "firmware"); + if (node < 0) + return; + + ret = fdt_setprop(fdt, node, "extended-modes", + &qe_fw_info->extended_modes, sizeof(u64)); + if (ret < 0) + goto error; + + ret = fdt_setprop_string(fdt, node, "id", qe_fw_info->id); + if (ret < 0) + goto error; + + ret = fdt_setprop(fdt, node, "virtual-traps", qe_fw_info->vtraps, + sizeof(qe_fw_info->vtraps)); + if (ret < 0) + goto error; + + return; + +error: + fdt_del_node(fdt, node); +} +#endif + #endif |