From: AKASHI Takahiro <takahiro.akashi@linaro.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [RFC v3 03/10] cmd: bootefi: carve out fdt handling from do_bootefi()
Date: Thu, 18 Apr 2019 09:16:32 +0900 [thread overview]
Message-ID: <20190418001631.GV7158@linaro.org> (raw)
In-Reply-To: <5d62170b-0238-2374-4e8b-a305bea0f68a@gmx.de>
On Wed, Apr 17, 2019 at 06:35:57PM +0200, Heinrich Schuchardt wrote:
> On 4/17/19 9:01 AM, AKASHI Takahiro wrote:
> >On Tue, Apr 16, 2019 at 06:54:58AM +0200, Heinrich Schuchardt wrote:
> >>On 4/16/19 6:24 AM, AKASHI Takahiro wrote:
> >>>This is a preparatory patch for reworking do_bootefi() in later patch.
> >>
> >>I would prefer a more informative commit message like:
> >>
> >>Carve out a function to handle the installation of the device tree as a
> >>configuration table.
> >
> >Okay, but it doesn't convey more than the subject.
> >
> >-Takahiro Akashi
> >
> >>Otherwise
> >>Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> >>
> >>>
> >>>Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
> >>>---
> >>> cmd/bootefi.c | 53 ++++++++++++++++++++++++++++++++++++---------------
> >>> 1 file changed, 38 insertions(+), 15 deletions(-)
> >>>
> >>>diff --git a/cmd/bootefi.c b/cmd/bootefi.c
> >>>index 3619a20e6433..8cd9644115eb 100644
> >>>--- a/cmd/bootefi.c
> >>>+++ b/cmd/bootefi.c
> >>>@@ -198,6 +198,38 @@ static efi_status_t efi_install_fdt(ulong fdt_addr)
> >>> return ret;
> >>> }
> >>>
> >>>+/**
> >>>+ * efi_process_fdt() - process fdt passed by a command argument
> >>>+ * @fdt_opt: pointer to argument
> >>>+ * Return: status code
> >>>+ *
> >>>+ * If specified, fdt will be installed as configuration table,
> >>>+ * otherwise no fdt will be passed.
> >>>+ */
> >>>+static efi_status_t efi_process_fdt(const char *fdt_opt)
> >>>+{
> >>>+ unsigned long fdt_addr;
> >>>+ efi_status_t ret;
> >>>+
> >>>+ if (fdt_opt) {
> >>>+ fdt_addr = simple_strtoul(fdt_opt, NULL, 16);
> >>>+ if (!fdt_addr && *fdt_opt != '0')
> >>>+ return EFI_INVALID_PARAMETER;
> >>>+
> >>>+ /* Install device tree */
> >>>+ ret = efi_install_fdt(fdt_addr);
> >>>+ if (ret != EFI_SUCCESS) {
> >>>+ printf("ERROR: failed to install device tree\n");
> >>>+ return ret;
> >>>+ }
> >>>+ } else {
> >>>+ /* Remove device tree. EFI_NOT_FOUND can be ignored here */
> >>>+ efi_install_configuration_table(&efi_guid_fdt, NULL);
> >>>+ }
> >>>+
> >>>+ return EFI_SUCCESS;
> >>>+}
> >>>+
> >>> static efi_status_t bootefi_run_prepare(const char *load_options_path,
> >>> struct efi_device_path *device_path,
> >>> struct efi_device_path *image_path,
> >>>@@ -407,21 +439,12 @@ static int do_bootefi(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
> >>> if (argc < 2)
> >>> return CMD_RET_USAGE;
> >>>
> >>>- if (argc > 2) {
> >>>- fdt_addr = simple_strtoul(argv[2], NULL, 16);
> >>>- if (!fdt_addr && *argv[2] != '0')
> >>>- return CMD_RET_USAGE;
> >>>- /* Install device tree */
> >>>- r = efi_install_fdt(fdt_addr);
> >>>- if (r != EFI_SUCCESS) {
> >>>- printf("ERROR: failed to install device tree\n");
> >>>- return CMD_RET_FAILURE;
> >>>- }
> >>>- } else {
> >>>- /* Remove device tree. EFI_NOT_FOUND can be ignored here */
> >>>- efi_install_configuration_table(&efi_guid_fdt, NULL);
> >>>- printf("WARNING: booting without device tree\n");
> >>>- }
> >>>+ r = fdt_process_fdt(argc > 2 ? argv[2] : NULL);
>
> cmd/bootefi.c: In function ‘do_bootefi’:
> cmd/bootefi.c:442:6: warning: implicit declaration of function
> ‘fdt_process_fdt’; did you mean ‘efi_process_fdt’?
> [-Wimplicit-function-declaration]
> r = fdt_process_fdt(argc > 2 ? argv[2] : NULL);
> ^~~~~~~~~~~~~~~
> efi_process_fdt
Oops. I think that I fixed it before.
Will fix along with patch#4.
> cmd/bootefi.c:424:16: warning: unused variable ‘fdt_addr’
> [-Wunused-variable]
> unsigned long fdt_addr;
> ^~~~~~~~
Okay.
Thanks,
-Takahiro Akashi
> At top level:
> CC drivers/virtio/virtio_pci_legacy.o
> cmd/bootefi.c:209:21: warning: ‘efi_process_fdt’ defined but not used
> [-Wunused-function]
> static efi_status_t efi_process_fdt(const char *fdt_opt)
> ^~~~~~~~~~~~~~~
>
> Please, check.
>
> Best regards
>
> Heinrich
>
> >>>+ if (r == EFI_INVALID_PARAMETER)
> >>>+ return CMD_RET_USAGE;
> >>>+ else if (r != EFI_SUCCESS)
> >>>+ return CMD_RET_FAILURE;
> >>>+
> >>> #ifdef CONFIG_CMD_BOOTEFI_HELLO
> >>> if (!strcmp(argv[1], "hello")) {
> >>> ulong size = __efi_helloworld_end - __efi_helloworld_begin;
> >>>
> >>
> >
>
next prev parent reply other threads:[~2019-04-18 0:16 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-16 4:24 [U-Boot] [RFC v3 00/10] efi_loader: rework bootefi/bootmgr AKASHI Takahiro
2019-04-16 4:24 ` [U-Boot] [RFC v3 01/10] efi_loader: device_path: handle special case of loading AKASHI Takahiro
2019-04-16 4:44 ` Heinrich Schuchardt
2019-04-16 4:24 ` [U-Boot] [RFC v3 02/10] efi_loader: export root node handle AKASHI Takahiro
2019-04-16 4:48 ` Heinrich Schuchardt
2019-04-17 6:57 ` AKASHI Takahiro
2019-04-16 4:24 ` [U-Boot] [RFC v3 03/10] cmd: bootefi: carve out fdt handling from do_bootefi() AKASHI Takahiro
2019-04-16 4:54 ` Heinrich Schuchardt
2019-04-17 7:01 ` AKASHI Takahiro
2019-04-17 16:35 ` Heinrich Schuchardt
2019-04-18 0:16 ` AKASHI Takahiro [this message]
2019-04-16 4:24 ` [U-Boot] [RFC v3 04/10] cmd: bootefi: merge efi_install_fdt() and efi_process_fdt() AKASHI Takahiro
2019-04-16 5:05 ` Heinrich Schuchardt
2019-04-17 10:53 ` Heinrich Schuchardt
2019-04-16 4:24 ` [U-Boot] [RFC v3 05/10] cmd: bootefi: carve out efi_selftest code from do_bootefi() AKASHI Takahiro
2019-04-16 5:21 ` Heinrich Schuchardt
2019-04-17 7:19 ` AKASHI Takahiro
2019-04-16 4:24 ` [U-Boot] [RFC v3 06/10] cmd: bootefi: move do_bootefi_bootmgr_exec() forward AKASHI Takahiro
2019-04-16 5:22 ` Heinrich Schuchardt
2019-04-16 4:24 ` [U-Boot] [RFC v3 07/10] cmd: bootefi: carve out bootmgr code from do_bootefi() AKASHI Takahiro
2019-04-16 4:24 ` [U-Boot] [RFC v3 08/10] cmd: bootefi: carve out do_boot_efi() " AKASHI Takahiro
2019-04-16 5:31 ` Heinrich Schuchardt
2019-04-17 7:43 ` AKASHI Takahiro
2019-04-16 4:24 ` [U-Boot] [RFC v3 09/10] efi_loader: rework bootmgr/bootefi using load_image API AKASHI Takahiro
2019-04-16 10:56 ` Heinrich Schuchardt
2019-04-16 16:20 ` Heinrich Schuchardt
2019-04-18 8:29 ` Alexander Graf
2019-04-18 0:13 ` AKASHI Takahiro
2019-04-18 3:06 ` AKASHI Takahiro
2019-04-16 4:24 ` [U-Boot] [RFC v3 10/10] cmd: add efibootmgr command AKASHI Takahiro
2019-04-16 5:27 ` Heinrich Schuchardt
2019-04-17 8:07 ` AKASHI Takahiro
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=20190418001631.GV7158@linaro.org \
--to=takahiro.akashi@linaro.org \
--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