[U-Boot-Users] qe: add ability to upload QE firmware

Kumar Gala galak at kernel.crashing.org
Fri Nov 30 23:28:56 CET 2007


On Nov 30, 2007, at 3:20 PM, Timur Tabi wrote:

> 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.  Fully define 'struct rsp' in
> immap_qe.h to include the actual RISC Special Registers.
>
> Signed-off-by: Timur Tabi <timur at freescale.com>
> ---
>
> This patch applies to Kim's mpc83xx branch on u-boot-mpc83xx.git at  
> denx.de.
>
> doc/README.qe_firmware     |  295 +++++++++++++++++++++++++++++++++++ 
> +++++++++
> drivers/qe/qe.c            |  213 ++++++++++++++++++++++++++++++++
> drivers/qe/qe.h            |   56 +++++++++
> include/asm-ppc/immap_qe.h |   35 +++++-
> 4 files changed, 596 insertions(+), 3 deletions(-)
> create mode 100644 doc/README.qe_firmware


> +static int qe_cmd(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
> +{
> +	ulong addr;
> +
> +	if (argc < 3) {
> +		printf ("Usage:\n%s\n", cmdtp->usage);
> +		return 1;
> +	}
> +
> +	if (strcmp(argv[1], "fw") == 0) {
> +		addr = simple_strtoul(argv[2], NULL, 16);
> +
> +		if (!addr) {
> +			printf("Invalid address\n");
> +			return -EINVAL;
> +		}
> +
> +                /*
> +                 * If a length was supplied, compare that with the  
> 'length'
> +                 * field.
> +                 */
> +
> +		if (argc >= 3) {
> +			ulong length = simple_strtoul(argv[3], NULL, 16);
> +			struct qe_firmware *firmware = (void *) addr;
> +
> +			if (length != be32_to_cpu(firmware->header.length)) {
> +				printf("Invalid length\n");
> +				return -EINVAL;
> +			}
> +		}
> +
> +		return qe_upload_firmware((const struct qe_firmware *) addr);
> +	}
> +
> +	printf ("Usage:\n%s\n", cmdtp->usage);
> +	return 1;
> +}
> +
> +U_BOOT_CMD(
> +	qe, 4, 0, qe_cmd,
> +	"qe      - QUICC Engine commands\n",
> +	"fw <addr> [<length>] - Upload firmware at address <addr>,\n"

I'm at a loss, why have length at all?  You seem to always take it  
from firmware->header.length.

Also can we be more explicit in the help with 'Upload firmware'.. to  
'Upload microcode firmware to QE' or something like that.

- k




More information about the U-Boot mailing list