From: Lukasz Majewski <lukma@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] doc: Document for generic firmware loader
Date: Mon, 18 Dec 2017 10:28:08 +0100 [thread overview]
Message-ID: <20171218102808.0fb90394@jawa> (raw)
In-Reply-To: <1513235679-4310-1-git-send-email-tien.fong.chee@intel.com>
Hi Tien,
> From: Tien Fong Chee <tien.fong.chee@intel.com>
>
> This is initial draft document about generic firmware loader.
> The intention of this patch is open for discussion, and final version
> will be included together with next version release of generic
> firmware loader patchset. Current V3 generic firmware loader patchset
> can be reviewed from
> https://www.mail-archive.com/u-boot at lists.denx.de/msg272028.html
>
> Signed-off-by: Tien Fong Chee <tien.fong.chee@intel.com>
> ---
> doc/README.firmware_loader | 77
> ++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 77
> insertions(+), 0 deletions(-) create mode 100644
> doc/README.firmware_loader
>
> diff --git a/doc/README.firmware_loader b/doc/README.firmware_loader
> new file mode 100644
> index 0000000..d250723
> --- /dev/null
> +++ b/doc/README.firmware_loader
> @@ -0,0 +1,77 @@
> +/*
> + * Copyright (C) 2017 Intel Corporation <www.intel.com>
> + *
> + * SPDX-License-Identifier: GPL-2.0
> + */
> +
> +Introduction
> +------------
> +This is firmware loader for U-Boot framework, which has very close
> to some Linux +Firmware API. For the details of Linux Firmware API,
> you can refer to
> +https://01.org/linuxgraphics/gfx-docs/drm/driver-api/firmware/index.html.
> + +Firmware loader can be used to load whatever(firmware, image, and
> binary) from +the flash in file system format into target location
^^^^^^^^^^^^^^ I suppose that you mean - load binary image
from file system put on flash?
> such as memory, then +consumer driver such as FPGA driver can program
> FPGA image from the target +location into FPGA.
> +
> +Firmware Loader API core features
> +---------------------------------
> +=> Firmware storage device partition search
> + ----------------------------------------
> + => Default storage device partition search set for mmc,
> usb and sata
> + as shown in below:
> + static struct device_location default_locations[] = {
> + {
> + .name = "mmc",
> + .devpart = "0:1",
> + },
> + {
> + .name = "usb",
> + .devpart = "0:1",
> + },
> + {
> + .name = "sata",
> + .devpart = "0:1",
> + },
> + };
> +
> + However, the default storage device .devpart value can be
> overwritten
> + with value which is defined in the environment variable
> "FW_DEV_PART".
> + For example: env_set("FW_DEV_PART", "0:2");
^^^^^^^^^^ - u-boot normally uses lower
case for env variable naming.
> +
> +Firmware Loader API
> +-------------------
> +=> int request_firmware_into_buf(struct firmware **firmware_p,
> + const char *name,
> + struct device_location *location,
> + void *buf, size_t size, u32 offset)
> + --------------------------------------------------------------
> + => Load firmware into a previously allocated buffer
> +
> + Parameters:
> + struct firmware **firmware_p
> + pointer to firmware image
> +
> + const char *name
> + name of firmware file
> +
> + struct device_location *location
> + an array of supported firmware location
> +
> + void *buf
> + address of buffer to load firmware into
> +
> + size_t size
> + size of buffer
> +
> + u32 offset
> + offset of a file for start reading into buffer
> +
> + return: size of total read
> + -ve when error
> +
> + Description:
> + The firmware is loaded directly into the buffer pointed to
> by buf and
> + the @firmware_p data member is pointed at buf.
> +
Best regards,
Lukasz Majewski
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20171218/7283ae6b/attachment.sig>
next prev parent reply other threads:[~2017-12-18 9:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-14 7:14 [U-Boot] [PATCH] doc: Document for generic firmware loader tien.fong.chee at intel.com
2017-12-18 9:28 ` Lukasz Majewski [this message]
2017-12-19 10:20 ` Chee, Tien Fong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171218102808.0fb90394@jawa \
--to=lukma@denx.de \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox