diff options
Diffstat (limited to 'boot/bootmeth_pxe.c')
-rw-r--r-- | boot/bootmeth_pxe.c | 50 |
1 files changed, 26 insertions, 24 deletions
diff --git a/boot/bootmeth_pxe.c b/boot/bootmeth_pxe.c index 5a8af2bbd0b..ce986bd260d 100644 --- a/boot/bootmeth_pxe.c +++ b/boot/bootmeth_pxe.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0+ /* - * Bootmethod for distro boot using PXE (network boot) + * Bootmethod for extlinux boot using PXE (network boot) * * Copyright 2021 Google LLC * Written by Simon Glass <sjg@chromium.org> @@ -13,8 +13,8 @@ #include <bootflow.h> #include <bootmeth.h> #include <command.h> -#include <distro.h> #include <dm.h> +#include <extlinux.h> #include <fs.h> #include <log.h> #include <malloc.h> @@ -23,10 +23,10 @@ #include <net.h> #include <pxe_utils.h> -static int distro_pxe_getfile(struct pxe_context *ctx, const char *file_path, - char *file_addr, ulong *sizep) +static int extlinux_pxe_getfile(struct pxe_context *ctx, const char *file_path, + char *file_addr, ulong *sizep) { - struct distro_info *info = ctx->userdata; + struct extlinux_info *info = ctx->userdata; ulong addr; int ret; @@ -39,7 +39,7 @@ static int distro_pxe_getfile(struct pxe_context *ctx, const char *file_path, return 0; } -static int distro_pxe_check(struct udevice *dev, struct bootflow_iter *iter) +static int extlinux_pxe_check(struct udevice *dev, struct bootflow_iter *iter) { int ret; @@ -54,7 +54,8 @@ static int distro_pxe_check(struct udevice *dev, struct bootflow_iter *iter) return 0; } -static int distro_pxe_read_bootflow(struct udevice *dev, struct bootflow *bflow) +static int extlinux_pxe_read_bootflow(struct udevice *dev, + struct bootflow *bflow) { const char *addr_str; char fname[200]; @@ -90,7 +91,7 @@ static int distro_pxe_read_bootflow(struct udevice *dev, struct bootflow *bflow) } } snprintf(fname, sizeof(fname), "%s%s", - bflow->subdir ? bflow->subdir : "", DISTRO_FNAME); + bflow->subdir ? bflow->subdir : "", EXTLINUX_FNAME); bflow->fname = strdup(fname); if (!bflow->fname) @@ -108,8 +109,9 @@ static int distro_pxe_read_bootflow(struct udevice *dev, struct bootflow *bflow) return 0; } -static int distro_pxe_read_file(struct udevice *dev, struct bootflow *bflow, - const char *file_path, ulong addr, ulong *sizep) +static int extlinux_pxe_read_file(struct udevice *dev, struct bootflow *bflow, + const char *file_path, ulong addr, + ulong *sizep) { char *tftp_argv[] = {"tftp", NULL, NULL, NULL}; struct pxe_context *ctx = dev_get_priv(dev); @@ -133,11 +135,11 @@ static int distro_pxe_read_file(struct udevice *dev, struct bootflow *bflow, return 0; } -static int distro_pxe_boot(struct udevice *dev, struct bootflow *bflow) +static int extlinux_pxe_boot(struct udevice *dev, struct bootflow *bflow) { struct pxe_context *ctx = dev_get_priv(dev); struct cmd_tbl cmdtp = {}; /* dummy */ - struct distro_info info; + struct extlinux_info info; ulong addr; int ret; @@ -145,7 +147,7 @@ static int distro_pxe_boot(struct udevice *dev, struct bootflow *bflow) info.dev = dev; info.bflow = bflow; info.cmdtp = &cmdtp; - ret = pxe_setup_ctx(ctx, &cmdtp, distro_pxe_getfile, &info, false, + ret = pxe_setup_ctx(ctx, &cmdtp, extlinux_pxe_getfile, &info, false, bflow->subdir, false); if (ret) return log_msg_ret("ctx", -EINVAL); @@ -157,7 +159,7 @@ static int distro_pxe_boot(struct udevice *dev, struct bootflow *bflow) return 0; } -static int distro_bootmeth_pxe_bind(struct udevice *dev) +static int extlinux_bootmeth_pxe_bind(struct udevice *dev) { struct bootmeth_uc_plat *plat = dev_get_uclass_plat(dev); @@ -167,23 +169,23 @@ static int distro_bootmeth_pxe_bind(struct udevice *dev) return 0; } -static struct bootmeth_ops distro_bootmeth_pxe_ops = { - .check = distro_pxe_check, - .read_bootflow = distro_pxe_read_bootflow, - .read_file = distro_pxe_read_file, - .boot = distro_pxe_boot, +static struct bootmeth_ops extlinux_bootmeth_pxe_ops = { + .check = extlinux_pxe_check, + .read_bootflow = extlinux_pxe_read_bootflow, + .read_file = extlinux_pxe_read_file, + .boot = extlinux_pxe_boot, }; -static const struct udevice_id distro_bootmeth_pxe_ids[] = { - { .compatible = "u-boot,distro-pxe" }, +static const struct udevice_id extlinux_bootmeth_pxe_ids[] = { + { .compatible = "u-boot,extlinux-pxe" }, { } }; U_BOOT_DRIVER(bootmeth_pxe) = { .name = "bootmeth_pxe", .id = UCLASS_BOOTMETH, - .of_match = distro_bootmeth_pxe_ids, - .ops = &distro_bootmeth_pxe_ops, - .bind = distro_bootmeth_pxe_bind, + .of_match = extlinux_bootmeth_pxe_ids, + .ops = &extlinux_bootmeth_pxe_ops, + .bind = extlinux_bootmeth_pxe_bind, .priv_auto = sizeof(struct pxe_context), }; |