diff options
author | Timur Tabi <timur@freescale.com> | 2008-01-07 13:31:19 -0600 |
---|---|---|
committer | Andrew Fleming-AFLEMING <afleming@freescale.com> | 2008-01-09 16:28:12 -0600 |
commit | b8ec2385038c094b07ec5b49336289a46b6e9cc6 (patch) | |
tree | cecfa15b2de1ed5be9716c81df2da7a2a4b34b63 /common | |
parent | b009f3eca99bb7b9e6ba6639a8909a138dd5e9fe (diff) | |
download | u-boot-imx-b8ec2385038c094b07ec5b49336289a46b6e9cc6.zip u-boot-imx-b8ec2385038c094b07ec5b49336289a46b6e9cc6.tar.gz u-boot-imx-b8ec2385038c094b07ec5b49336289a46b6e9cc6.tar.bz2 |
85xx: add ability to upload QE firmware
Define the layout of a binary blob that contains a QE firmware and instructions
on how to upload it. Add function qe_upload_firmware() to parse the blob and
perform the actual upload. Add command-line command "qe fw" to take a firmware
blob in memory and upload it. Update ft_cpu_setup() on 85xx to create the
'firmware' device tree node if U-Boot has uploaded a firmware. Fully define
'struct rsp' in immap_qe.h to include the actual RISC Special Registers.
Signed-off-by: Timur Tabi <timur@freescale.com>
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 |