From f0dbde4675e3c37890abf8a61a14b6cb03b2ef67 Mon Sep 17 00:00:00 2001 From: Ioana Ciornei Date: Wed, 1 Apr 2026 18:04:45 +0300 Subject: drivers: net: fsl-mc: add the nowait option when applying the DPL The process through which the MC firmware parses the DPL and initializes all the requested DPAA2 objects is a complex one which can take quite a bit of time. For the those circumstances in which a fast boot is required on DPAA2 based SoCs, add the 'nowait' optional parameter for the fsl_mc [lazy]apply dpl command. When this option is used, the Linux kernel fsl-mc bus must wait for the firmware to finish parsing the DPL before proceeding with probing all the DPAA2 objects. Signed-off-by: Ioana Ciornei Signed-off-by: Peng Fan --- drivers/net/fsl-mc/mc.c | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/drivers/net/fsl-mc/mc.c b/drivers/net/fsl-mc/mc.c index 039375e5dfd..e28f8d96ed7 100644 --- a/drivers/net/fsl-mc/mc.c +++ b/drivers/net/fsl-mc/mc.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0+ /* * Copyright 2014 Freescale Semiconductor, Inc. - * Copyright 2017-2018, 2020-2021 NXP + * Copyright 2017-2018, 2020-2021, 2025 NXP */ #include #include @@ -72,6 +72,7 @@ static u64 mc_lazy_dpl_addr; static u32 dpsparser_obj_id; static u16 dpsparser_handle; static char *mc_err_msg_apply_spb[] = MC_ERROR_MSG_APPLY_SPB; +static bool wait_for_dpl; #ifdef DEBUG void dump_ram_words(const char *title, void *addr) @@ -855,13 +856,20 @@ int mc_apply_dpl(u64 mc_dpl_addr) * Tell the MC to deploy the DPL: */ out_le32(&mc_ccsr_regs->reg_gsr, 0x0); - printf("fsl-mc: Deploying data path layout ... "); - error = wait_for_mc(®_gsr); - if (!error) - mc_dpl_applied = 0; + /* Wait for the MC firmware to finish processing the DPL */ + if (wait_for_dpl) { + printf("fsl-mc: Deploying data path layout ... "); + error = wait_for_mc(®_gsr); + if (error) + return error; + } else { + printf("fsl-mc: Started the DPL deploy process\n"); + } - return error; + mc_dpl_applied = 0; + + return 0; } int get_mc_boot_status(void) @@ -1995,6 +2003,11 @@ static int do_fsl_mc(struct cmd_tbl *cmdtp, int flag, int argc, * later from announce_and_cleanup(). */ mc_lazy_dpl_addr = mc_dpl_addr; + + wait_for_dpl = true; + if (argc >= 5 && strcmp(argv[4], "nowait") == 0) + wait_for_dpl = false; + break; } @@ -2023,6 +2036,10 @@ static int do_fsl_mc(struct cmd_tbl *cmdtp, int flag, int argc, mc_apply_addr = simple_strtoull(argv[3], NULL, 16); + wait_for_dpl = true; + if (argc >= 5 && strcmp(argv[4], "nowait") == 0) + wait_for_dpl = false; + /* The user wants DPL applied now */ if (!fsl_mc_ldpaa_exit(NULL)) err = mc_apply_dpl(mc_apply_addr); @@ -2071,8 +2088,8 @@ U_BOOT_CMD( fsl_mc, CONFIG_SYS_MAXARGS, 1, do_fsl_mc, "DPAA2 command to manage Management Complex (MC)", "fsl_mc start mc - Start the Management Complex firmware\n" - "fsl_mc apply dpl - Apply the DPL (Data Path Layout) file\n" - "fsl_mc lazyapply dpl - Apply the DPL (Data Path Layout) file on exit\n" + "fsl_mc apply dpl [nowait] - Apply the DPL (Data Path Layout) file\n" + "fsl_mc lazyapply dpl [nowait] - Apply the DPL (Data Path Layout) file on exit\n" "fsl_mc apply spb - Apply the SPB Soft Parser Blob\n" "fsl_mc start aiop - Start AIOP\n" "fsl_mc dump_log - Dump the MC Log\n" -- cgit v1.2.3