[PATCH] cmd: pxe: Add relocation to pxe_sub cmds

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH] cmd: pxe: Add relocation to pxe_sub cmds

Michal Simek-3
From: T Karthik Reddy <[hidden email]>

pxe sub commands need to be manually relocated for architectures which
enables MANUAL_RELOC as Microblaze.

Signed-off-by: T Karthik Reddy <[hidden email]>
Signed-off-by: Michal Simek <[hidden email]>
---

 cmd/pxe.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/cmd/pxe.c b/cmd/pxe.c
index 6372fc987187..46ac08fa3a03 100644
--- a/cmd/pxe.c
+++ b/cmd/pxe.c
@@ -212,10 +212,24 @@ static struct cmd_tbl cmd_pxe_sub[] = {
  U_BOOT_CMD_MKENT(boot, 2, 1, do_pxe_boot, "", "")
 };
 
+static void __maybe_unused pxe_reloc(void)
+{
+ static int relocated_pxe;
+
+ if (!relocated_pxe) {
+ fixup_cmdtable(cmd_pxe_sub, ARRAY_SIZE(cmd_pxe_sub));
+ relocated_pxe = 1;
+ }
+}
+
 static int do_pxe(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
 {
  struct cmd_tbl *cp;
 
+#if defined(CONFIG_NEEDS_MANUAL_RELOC)
+ pxe_reloc();
+#endif
+
  if (argc < 2)
  return CMD_RET_USAGE;
 
--
2.28.0

Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] cmd: pxe: Add relocation to pxe_sub cmds

Simon Glass-3
On Wed, 16 Sep 2020 at 02:48, Michal Simek <[hidden email]> wrote:

>
> From: T Karthik Reddy <[hidden email]>
>
> pxe sub commands need to be manually relocated for architectures which
> enables MANUAL_RELOC as Microblaze.
>
> Signed-off-by: T Karthik Reddy <[hidden email]>
> Signed-off-by: Michal Simek <[hidden email]>
> ---
>
>  cmd/pxe.c | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)

Reviewed-by: Simon Glass <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] cmd: pxe: Add relocation to pxe_sub cmds

Michal Simek-4
In reply to this post by Michal Simek-3
st 16. 9. 2020 v 10:48 odesílatel Michal Simek <[hidden email]> napsal:

>
> From: T Karthik Reddy <[hidden email]>
>
> pxe sub commands need to be manually relocated for architectures which
> enables MANUAL_RELOC as Microblaze.
>
> Signed-off-by: T Karthik Reddy <[hidden email]>
> Signed-off-by: Michal Simek <[hidden email]>
> ---
>
>  cmd/pxe.c | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
>
> diff --git a/cmd/pxe.c b/cmd/pxe.c
> index 6372fc987187..46ac08fa3a03 100644
> --- a/cmd/pxe.c
> +++ b/cmd/pxe.c
> @@ -212,10 +212,24 @@ static struct cmd_tbl cmd_pxe_sub[] = {
>         U_BOOT_CMD_MKENT(boot, 2, 1, do_pxe_boot, "", "")
>  };
>
> +static void __maybe_unused pxe_reloc(void)
> +{
> +       static int relocated_pxe;
> +
> +       if (!relocated_pxe) {
> +               fixup_cmdtable(cmd_pxe_sub, ARRAY_SIZE(cmd_pxe_sub));
> +               relocated_pxe = 1;
> +       }
> +}
> +
>  static int do_pxe(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
>  {
>         struct cmd_tbl *cp;
>
> +#if defined(CONFIG_NEEDS_MANUAL_RELOC)
> +       pxe_reloc();
> +#endif
> +
>         if (argc < 2)
>                 return CMD_RET_USAGE;
>
> --
> 2.28.0
>

Applied.
M

--
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Xilinx Microblaze
Maintainer of Linux kernel - Xilinx Zynq ARM and ZynqMP ARM64 SoCs
U-Boot custodian - Xilinx Microblaze/Zynq/ZynqMP/Versal SoCs