From d113b295232dd6d819140169d7178d10d155c7e5 Mon Sep 17 00:00:00 2001 From: Kamlesh Gurudasani Date: Mon, 23 Mar 2026 16:59:27 +0530 Subject: clk: scmi: Fix protocol version fetch for non-CCF platforms The SCMI clock protocol version was only being fetched when CLK_CCF was enabled. On non-CCF platforms, the probe function returned early without fetching the version, leaving priv->version as 0. This caused issues because code paths like scmi_clk_gate() and scmi_clk_get_permissions() depend on priv->version to determine which protocol message format to use, even in non-CCF mode. Fix this by moving the scmi_generic_protocol_version() call before the CLK_CCF check, ensuring the version is fetched for both CCF and non-CCF platforms. Tested on am62lx_evm. Fixes: ae7e0330ce22 ("clk: scmi: add compatibility with clock protocol 2.0") Signed-off-by: Kamlesh Gurudasani Signed-off-by: Peng Fan --- drivers/clk/clk_scmi.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/clk/clk_scmi.c b/drivers/clk/clk_scmi.c index ee237ed6337..12c7b1e8254 100644 --- a/drivers/clk/clk_scmi.c +++ b/drivers/clk/clk_scmi.c @@ -341,6 +341,12 @@ static int scmi_clk_probe(struct udevice *dev) if (ret) return ret; + ret = scmi_generic_protocol_version(dev, SCMI_PROTOCOL_ID_CLOCK, &priv->version); + if (ret) { + dev_dbg(dev, "%s: get SCMI clock management protocol version failed\n", __func__); + return ret; + } + if (!CONFIG_IS_ENABLED(CLK_CCF)) return 0; @@ -352,12 +358,6 @@ static int scmi_clk_probe(struct udevice *dev) if (ret) return ret; - ret = scmi_generic_protocol_version(dev, SCMI_PROTOCOL_ID_CLOCK, &priv->version); - if (ret) { - dev_dbg(dev, "%s: get SCMI clock management protocol version failed\n", __func__); - return ret; - } - clk_scmi_bulk = kzalloc(num_clocks * sizeof(*clk_scmi), GFP_KERNEL); if (!clk_scmi_bulk) return -ENOMEM; -- cgit v1.2.3 From af7b6bb05a810a0ec94fd864e3477401b3d1b60a Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Tue, 24 Mar 2026 14:16:56 +0300 Subject: gpio: scmi: Add gpio_scmi driver This provides GPIO support over SCMI. It is built on top of the pinctrl-scmi driver. A typical device tree entry might look like this: gpio1 { compatible = "scmi-pinctrl-gpio"; gpio-controller; #gpio-cells = <2>; ngpios = <10>; gpio-ranges = <&scmi_pinctrl 0 8 4>, <&scmi_pinctrl 4 12 1>, <&scmi_pinctrl 5 15 1>, <&scmi_pinctrl 6 17 4>; pinctrl-names = "default"; pinctrl-0 = <&i2c2_pins>; }; In this GPIO driver the one thing which is different is that in the gpio-ranges the first numbers which represent how the pins are exposed to the users have to start at zero and it can't have gaps. Signed-off-by: Dan Carpenter Signed-off-by: Peng Fan --- drivers/gpio/Kconfig | 6 ++ drivers/gpio/Makefile | 1 + drivers/gpio/gpio_scmi.c | 248 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 255 insertions(+) create mode 100644 drivers/gpio/gpio_scmi.c diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig index 1484dd3504c..0b5466b39b8 100644 --- a/drivers/gpio/Kconfig +++ b/drivers/gpio/Kconfig @@ -732,6 +732,12 @@ config SLG7XL45106_I2C_GPO 8-bit gpo expander, all gpo lines are controlled by writing value into data register. +config GPIO_SCMI + bool "SCMI GPIO pinctrl driver" + depends on DM_GPIO && PINCTRL_SCMI + help + Support pinctrl GPIO over the SCMI interface. + config ADP5585_GPIO bool "ADP5585 GPIO driver" depends on DM_GPIO && DM_I2C diff --git a/drivers/gpio/Makefile b/drivers/gpio/Makefile index fec258f59f5..863557e45ce 100644 --- a/drivers/gpio/Makefile +++ b/drivers/gpio/Makefile @@ -78,6 +78,7 @@ obj-$(CONFIG_SL28CPLD_GPIO) += sl28cpld-gpio.o obj-$(CONFIG_ADP5588_GPIO) += adp5588_gpio.o obj-$(CONFIG_ZYNQMP_GPIO_MODEPIN) += zynqmp_gpio_modepin.o obj-$(CONFIG_SLG7XL45106_I2C_GPO) += gpio_slg7xl45106.o +obj-$(CONFIG_GPIO_SCMI) += gpio_scmi.o obj-$(CONFIG_$(PHASE_)ADP5585_GPIO) += adp5585_gpio.o obj-$(CONFIG_RZG2L_GPIO) += rzg2l-gpio.o obj-$(CONFIG_MPFS_GPIO) += mpfs_gpio.o diff --git a/drivers/gpio/gpio_scmi.c b/drivers/gpio/gpio_scmi.c new file mode 100644 index 00000000000..d25e3b6a4aa --- /dev/null +++ b/drivers/gpio/gpio_scmi.c @@ -0,0 +1,248 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright 2026 Linaro Ltd. + */ + +#include +#include +#include +#include +#include +#include + +struct scmi_gpio_range { + u32 base; + u32 offset; + u32 npins; + struct list_head list; +}; + +static int bank_cnt; + +struct scmi_gpio_priv { + struct udevice *pin_dev; + struct list_head gpio_ranges; + char *bank_name; + u32 num_pins; + u16 *pins; +}; + +static int scmi_gpio_request(struct udevice *dev, unsigned int offset, const char *label) +{ + struct scmi_gpio_priv *priv = dev_get_priv(dev); + int pin; + int ret; + + if (offset >= priv->num_pins) + return -EINVAL; + pin = priv->pins[offset]; + + ret = scmi_pinctrl_request(priv->pin_dev, SCMI_PIN, pin); + if (ret == -EOPNOTSUPP) + ret = 0; + if (ret) + dev_err(dev, "%s(): request failed: %d\n", __func__, ret); + return ret; +} + +static int scmi_gpio_rfree(struct udevice *dev, unsigned int offset) +{ + struct scmi_gpio_priv *priv = dev_get_priv(dev); + int pin; + int ret; + + if (offset >= priv->num_pins) + return -EINVAL; + pin = priv->pins[offset]; + + ret = scmi_pinctrl_release(priv->pin_dev, SCMI_PIN, pin); + if (ret == -EOPNOTSUPP) + ret = 0; + if (ret) + dev_err(dev, "%s(): release failed: %d\n", __func__, ret); + return ret; +} + +static int scmi_gpio_set_flags(struct udevice *dev, unsigned int offset, ulong flags) +{ + struct scmi_gpio_priv *priv = dev_get_priv(dev); + const int MAX_FLAGS = 10; + u32 configs[MAX_FLAGS * 2]; + int cnt = 0; + u32 pin; + + if (offset >= priv->num_pins) + return -EINVAL; + pin = priv->pins[offset]; + + if (flags & GPIOD_IS_OUT) { + configs[cnt++] = SCMI_PIN_OUTPUT_MODE; + configs[cnt++] = 1; + configs[cnt++] = SCMI_PIN_OUTPUT_VALUE; + if (flags & GPIOD_IS_OUT_ACTIVE) + configs[cnt++] = 1; + else + configs[cnt++] = 0; + } + if (flags & GPIOD_IS_IN) { + configs[cnt++] = SCMI_PIN_INPUT_MODE; + configs[cnt++] = 1; + } + if (flags & GPIOD_OPEN_DRAIN) { + configs[cnt++] = SCMI_PIN_DRIVE_OPEN_DRAIN; + configs[cnt++] = 1; + } + if (flags & GPIOD_OPEN_SOURCE) { + configs[cnt++] = SCMI_PIN_DRIVE_OPEN_SOURCE; + configs[cnt++] = 1; + } + if (flags & GPIOD_PULL_UP) { + configs[cnt++] = SCMI_PIN_BIAS_PULL_UP; + configs[cnt++] = 1; + } + if (flags & GPIOD_PULL_DOWN) { + configs[cnt++] = SCMI_PIN_BIAS_PULL_DOWN; + configs[cnt++] = 1; + } + /* TODO: handle GPIOD_ACTIVE_LOW and GPIOD_IS_AF flags */ + + return scmi_pinctrl_settings_configure(priv->pin_dev, SCMI_PIN, pin, + cnt / 2, &configs[0]); +} + +static int scmi_gpio_get_value(struct udevice *dev, unsigned int offset) +{ + struct scmi_gpio_priv *priv = dev_get_priv(dev); + u32 value; + int pin; + int ret; + + if (offset >= priv->num_pins) + return -EINVAL; + pin = priv->pins[offset]; + + ret = scmi_pinctrl_settings_get_one(priv->pin_dev, SCMI_PIN, pin, + SCMI_PIN_INPUT_VALUE, &value); + if (ret) { + dev_err(dev, "settings_get_one() failed: %d\n", ret); + return ret; + } + + return value; +} + +static int scmi_gpio_get_function(struct udevice *dev, unsigned int offset) +{ + struct scmi_gpio_priv *priv = dev_get_priv(dev); + u32 value; + int pin; + int ret; + + if (offset >= priv->num_pins) + return -EINVAL; + pin = priv->pins[offset]; + + ret = scmi_pinctrl_settings_get_one(priv->pin_dev, SCMI_PIN, pin, + SCMI_PIN_INPUT_MODE, + &value); + if (ret) { + dev_err(dev, "settings_get() failed %d\n", ret); + return ret; + } + + if (value) + return GPIOF_INPUT; + return GPIOF_OUTPUT; +} + +static const struct dm_gpio_ops scmi_gpio_ops = { + .request = scmi_gpio_request, + .rfree = scmi_gpio_rfree, + .set_flags = scmi_gpio_set_flags, + .get_value = scmi_gpio_get_value, + .get_function = scmi_gpio_get_function, +}; + +static int scmi_gpio_probe(struct udevice *dev) +{ + struct gpio_dev_priv *uc_priv = dev_get_uclass_priv(dev); + struct scmi_gpio_priv *priv = dev_get_priv(dev); + struct ofnode_phandle_args args; + struct scmi_gpio_range *range; + int index = 0; + int ret, i; + + INIT_LIST_HEAD(&priv->gpio_ranges); + + for (;; index++) { + ret = dev_read_phandle_with_args(dev, "gpio-ranges", + NULL, 3, index, &args); + if (ret) + break; + + if (index == 0) { + ret = uclass_get_device_by_ofnode(UCLASS_PINCTRL, + args.node, + &priv->pin_dev); + if (ret) { + dev_err(dev, "failed to find pinctrl device: %d\n", ret); + return ret; + } + } + + range = devm_kmalloc(dev, sizeof(*range), GFP_KERNEL); + if (!range) + return -ENOMEM; + + range->base = args.args[0]; + if (range->base != priv->num_pins) { + dev_err(dev, "no gaps allowed in between pins %d vs %d\n", + priv->num_pins, range->base); + return -EINVAL; + } + range->offset = args.args[1]; + range->npins = args.args[2]; + priv->num_pins += args.args[2]; + list_add_tail(&range->list, &priv->gpio_ranges); + } + + if (priv->num_pins == 0) { + dev_err(dev, "failed to registier pin-groups\n"); + return -EINVAL; + } + + priv->pins = devm_kzalloc(dev, priv->num_pins * sizeof(u16), GFP_KERNEL); + if (!priv->pins) + return -ENOMEM; + + list_for_each_entry(range, &priv->gpio_ranges, list) { + for (i = 0; i < range->npins; i++) + priv->pins[range->base + i] = range->offset + i; + } + + ret = snprintf(NULL, 0, "gpio_scmi%d_", bank_cnt); + uc_priv->bank_name = devm_kzalloc(dev, ret + 1, GFP_KERNEL); + if (!uc_priv->bank_name) + return -ENOMEM; + snprintf((char *)uc_priv->bank_name, ret + 1, "gpio_scmi%d_", bank_cnt); + bank_cnt++; + + uc_priv->gpio_count = priv->num_pins; + + return 0; +} + +static const struct udevice_id scmi_gpio_match[] = { + { .compatible = "scmi-pinctrl-gpio" }, + { } +}; + +U_BOOT_DRIVER(scmi_pinctrl_gpio) = { + .name = "scmi_pinctrl_gpio", + .id = UCLASS_GPIO, + .of_match = scmi_gpio_match, + .probe = scmi_gpio_probe, + .priv_auto = sizeof(struct scmi_gpio_priv), + .ops = &scmi_gpio_ops, +}; + -- cgit v1.2.3 From 3a29dfc92e9d03ca6446ebf4f462307a038caf60 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Thu, 26 Mar 2026 15:08:17 +0300 Subject: firmware: scmi: Fix setting the function Set BIT(10) when the function needs to be set, otherwise the setting is ignored. Fixes: 0cb160f1b629 ("scmi: pinctrl: add pinctrl driver for SCMI") Signed-off-by: Dan Carpenter Signed-off-by: Peng Fan --- drivers/firmware/scmi/pinctrl.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/firmware/scmi/pinctrl.c b/drivers/firmware/scmi/pinctrl.c index 47f7a8ad9b8..e670538c87f 100644 --- a/drivers/firmware/scmi/pinctrl.c +++ b/drivers/firmware/scmi/pinctrl.c @@ -259,6 +259,8 @@ static int scmi_pinctrl_settings_configure_helper(struct udevice *dev, in->attr = 0; in->attr |= FIELD_PREP(GENMASK(9, 2), num_configs); in->attr |= FIELD_PREP(GENMASK(1, 0), select_type); + if (function_id != SCMI_PINCTRL_FUNCTION_NONE) + in->attr |= BIT(10); memcpy(in->configs, configs, num_configs * sizeof(u32) * 2); ret = devm_scmi_process_msg(dev, &msg); -- cgit v1.2.3 From a2536daf93dc66f8b58008884e7070449fb8f4d0 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Thu, 26 Mar 2026 15:08:25 +0300 Subject: pinctrl: scmi: Use standard device tree pin muxing format In the original code, I wrote a custom pin muxing parser but the upstream device trees wouldn't accept something like that so it would have complicated mergine the device tree files. Use the standard device tree format with function and groups: pinmux1: pinmux1 { function = "f_gpio1"; groups = "grp_1", "grp_3"; }; Signed-off-by: Dan Carpenter Acked-by: Linus Walleij Signed-off-by: Peng Fan --- drivers/pinctrl/pinctrl-scmi.c | 151 +++++++++++++++-------------------------- 1 file changed, 54 insertions(+), 97 deletions(-) diff --git a/drivers/pinctrl/pinctrl-scmi.c b/drivers/pinctrl/pinctrl-scmi.c index 63d4f8ffeb5..fa31b573f31 100644 --- a/drivers/pinctrl/pinctrl-scmi.c +++ b/drivers/pinctrl/pinctrl-scmi.c @@ -33,20 +33,6 @@ static const struct pinconf_param pinctrl_scmi_conf_params[] = { /* The SCMI spec also include "default", "pull-mode" and "input-value */ }; -static bool valid_selector(struct udevice *dev, enum select_type select_type, u32 selector) -{ - struct pinctrl_scmi_priv *priv = dev_get_priv(dev); - - if (select_type == SCMI_PIN) - return selector < priv->num_pins; - if (select_type == SCMI_GROUP) - return selector < priv->num_groups; - if (select_type == SCMI_FUNCTION) - return selector < priv->num_functions; - - return false; -} - static int pinctrl_scmi_get_pins_count(struct udevice *dev) { struct pinctrl_scmi_priv *priv = dev_get_priv(dev); @@ -98,6 +84,38 @@ static const char *pinctrl_scmi_get_function_name(struct udevice *dev, unsigned return (const char *)priv->function_info[selector].name; } +static int pinctrl_scmi_get_function_id(struct udevice *dev, const char *function) +{ + struct pinctrl_scmi_priv *priv = dev_get_priv(dev); + int i; + + if (!function) + return -EINVAL; + + for (i = 0; i < priv->num_functions; i++) { + if (strcmp(priv->function_info[i].name, function) == 0) + return i; + } + + return -EINVAL; +} + +static int pinctrl_scmi_get_group_id(struct udevice *dev, const char *group) +{ + struct pinctrl_scmi_priv *priv = dev_get_priv(dev); + int i; + + if (!group) + return -EINVAL; + + for (i = 0; i < priv->num_groups; i++) { + if (strcmp(priv->group_info[i].name, group) == 0) + return i; + } + + return -EINVAL; +} + static int pinctrl_scmi_pinmux_set(struct udevice *dev, u32 pin, u32 function) { struct pinctrl_scmi_priv *priv = dev_get_priv(dev); @@ -120,96 +138,35 @@ static int pinctrl_scmi_pinmux_group_set(struct udevice *dev, u32 group, u32 fun static int pinctrl_scmi_set_state(struct udevice *dev, struct udevice *config) { - struct pinctrl_scmi_priv *priv = dev_get_priv(dev); - /* batch the setup into 20 lines at a go (there are 5 u32s in a config) */ - const int batch_count = 20 * 5; - u32 prev_type = -1u; - u32 prev_selector; - u32 *configs; - const u32 *prop; - int offset, cnt, len; - int ret = 0; - - prop = dev_read_prop(config, "pinmux", &len); - if (!prop) - return 0; - - if (len % sizeof(u32) * 5) { - dev_err(dev, "invalid pin configuration: len=%d\n", len); - return -FDT_ERR_BADSTRUCTURE; - } - - configs = kcalloc(batch_count, sizeof(u32), GFP_KERNEL); - if (!configs) - return -ENOMEM; - - offset = 0; - cnt = 0; - while (offset + 4 < len / sizeof(u32)) { - u32 select_type = fdt32_to_cpu(prop[offset]); - u32 selector = fdt32_to_cpu(prop[offset + 1]); - u32 function = fdt32_to_cpu(prop[offset + 2]); - u32 config_type = fdt32_to_cpu(prop[offset + 3]); - u32 config_value = fdt32_to_cpu(prop[offset + 4]); - - if (select_type > SCMI_GROUP || - !valid_selector(dev, select_type, selector) || - (function != SCMI_PINCTRL_FUNCTION_NONE && - function > priv->num_functions)) { - dev_err(dev, "invalid pinctrl data (%u %u %u %u %u)\n", - select_type, selector, function, config_type, - config_value); - ret = -EINVAL; - goto free; - } + int function_id, group_id; + const char *function; + const char **groups; + int group_count; + int ret; + int i; - if (function != SCMI_PINCTRL_FUNCTION_NONE) { - if (cnt) { - ret = scmi_pinctrl_settings_configure(dev, - prev_type, - prev_selector, - cnt / 2, configs); - if (ret) - goto free; - prev_type = -1u; - cnt = 0; - } - scmi_pinctrl_set_function(dev, select_type, selector, function); - offset += 5; - continue; - } + ret = dev_read_string_index(config, "function", 0, &function); + if (ret) + return ret; - if (cnt == batch_count) - goto set; + function_id = pinctrl_scmi_get_function_id(dev, function); + if (function_id < 0) + return function_id; - if (prev_type == -1u) - goto store; + group_count = dev_read_string_list(config, "groups", &groups); + if (group_count < 0) + return group_count; - if (select_type == prev_type && selector == prev_selector) - goto store; -set: - ret = scmi_pinctrl_settings_configure(dev, prev_type, prev_selector, - cnt / 2, configs); + for (i = 0; i < group_count; i++) { + group_id = pinctrl_scmi_get_group_id(dev, groups[i]); + if (group_id < 0) + return group_id; + ret = pinctrl_scmi_pinmux_group_set(dev, group_id, function_id); if (ret) - goto free; - cnt = 0; -store: - prev_type = select_type; - prev_selector = selector; - configs[cnt++] = config_type; - configs[cnt++] = config_value; - offset += 5; + return ret; } - if (cnt) - ret = scmi_pinctrl_settings_configure(dev, prev_type, prev_selector, - cnt / 2, configs); -free: - kfree(configs); - if (ret) - dev_err(dev, "set_state() failed: %d\n", ret); - - return ret; + return 0; } static int get_pin_muxing(struct udevice *dev, unsigned int selector, -- cgit v1.2.3 From d6e73ce02e5c4d74948495f102d57af9b5b1c9fe Mon Sep 17 00:00:00 2001 From: Ioana Ciornei Date: Wed, 1 Apr 2026 18:04:43 +0300 Subject: drivers: net: fsl-mc: remove unused parameter from the wait_for_mc() function The first parameter of the wait_for_mc() function - booting_mc - is not used. Remove it. Signed-off-by: Ioana Ciornei Signed-off-by: Peng Fan --- drivers/net/fsl-mc/mc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/fsl-mc/mc.c b/drivers/net/fsl-mc/mc.c index c8ed702f50a..6e42fde536a 100644 --- a/drivers/net/fsl-mc/mc.c +++ b/drivers/net/fsl-mc/mc.c @@ -653,7 +653,7 @@ static int load_mc_aiop_img(u64 aiop_fw_addr) } #endif -static int wait_for_mc(bool booting_mc, u32 *final_reg_gsr) +static int wait_for_mc(u32 *final_reg_gsr) { u32 reg_gsr; u32 mc_fw_boot_status; @@ -792,7 +792,7 @@ int mc_init(u64 mc_fw_addr, u64 mc_dpc_addr) * Deassert reset and release MC core 0 to run */ out_le32(&mc_ccsr_regs->reg_gcr1, GCR1_P1_DE_RST | GCR1_M_ALL_DE_RST); - error = wait_for_mc(true, ®_gsr); + error = wait_for_mc(®_gsr); if (error != 0) goto out; @@ -856,7 +856,7 @@ int mc_apply_dpl(u64 mc_dpl_addr) */ out_le32(&mc_ccsr_regs->reg_gsr, 0x0); printf("fsl-mc: Deploying data path layout ... "); - error = wait_for_mc(false, ®_gsr); + error = wait_for_mc(®_gsr); if (!error) mc_dpl_applied = 0; -- cgit v1.2.3 From d3c0f53d65eefa9081be243e66a03e38d869151d Mon Sep 17 00:00:00 2001 From: Ioana Ciornei Date: Wed, 1 Apr 2026 18:04:44 +0300 Subject: drivers: net: fsl-mc: cleanup the fsl_mc command help text All the parameters that can be currently passed to the fsl_mc command are positional arguments which are mandatory. This is not perfectly clear when reading the help text because of the use of square brackets. Fix this by changing the square brackets, which are commonly used for optional parameters, with < .. >. Signed-off-by: Ioana Ciornei Signed-off-by: Peng Fan --- drivers/net/fsl-mc/mc.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/net/fsl-mc/mc.c b/drivers/net/fsl-mc/mc.c index 6e42fde536a..039375e5dfd 100644 --- a/drivers/net/fsl-mc/mc.c +++ b/drivers/net/fsl-mc/mc.c @@ -2070,12 +2070,12 @@ static int do_fsl_mc(struct cmd_tbl *cmdtp, int flag, int argc, U_BOOT_CMD( fsl_mc, CONFIG_SYS_MAXARGS, 1, do_fsl_mc, "DPAA2 command to manage Management Complex (MC)", - "start mc [FW_addr] [DPC_addr] - Start Management Complex\n" - "fsl_mc apply DPL [DPL_addr] - Apply DPL file\n" - "fsl_mc lazyapply DPL [DPL_addr] - Apply DPL file on exit\n" - "fsl_mc apply spb [spb_addr] - Apply SPB Soft Parser Blob\n" - "fsl_mc start aiop [FW_addr] - Start AIOP\n" - "fsl_mc dump_log - Dump MC Log\n" + "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 spb - Apply the SPB Soft Parser Blob\n" + "fsl_mc start aiop - Start AIOP\n" + "fsl_mc dump_log - Dump the MC Log\n" ); void mc_env_boot(void) -- cgit v1.2.3 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 From 0cbf30fbbfc2deaef76650ebb3f511fa70bf95dc Mon Sep 17 00:00:00 2001 From: Chunguang Li Date: Thu, 2 Apr 2026 11:51:29 +0800 Subject: ls1028ardb: add env variables to assist boot Add image, extra_bootargs, othbootargs and console_dbg to assist boot. Signed-off-by: Chunguang Li Signed-off-by: Peng Fan --- include/configs/ls1028ardb.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/configs/ls1028ardb.h b/include/configs/ls1028ardb.h index 9c869ee6840..613abc50567 100644 --- a/include/configs/ls1028ardb.h +++ b/include/configs/ls1028ardb.h @@ -54,6 +54,9 @@ "board=ls1028ardb\0" \ "hwconfig=fsl_ddr:bank_intlv=auto\0" \ "fdtfile=fsl-ls1028a-rdb.dtb\0" \ + "image=Image\0" \ + "extra_bootargs=iommu.passthrough=1 arm-smmu.disable_bypass=0\0" \ + "othbootargs=video=1920x1080-32@60 cma=640M\0" \ "ramdisk_addr=0x800000\0" \ "ramdisk_size=0x2000000\0" \ "bootm_size=0x10000000\0" \ @@ -76,6 +79,7 @@ "kernelhdr_addr_sd=0x3000\0" \ "kernelhdr_size_sd=0x20\0" \ "console=ttyS0,115200\0" \ + "console_dbg=earlycon=uart8250,mmio,0x21c0500\0" \ BOOTENV \ "boot_scripts=ls1028ardb_boot.scr\0" \ "boot_script_hdr=hdr_ls1028ardb_bs.out\0" \ -- cgit v1.2.3 From 496504be0b871f4ed7baa82b365b864c10d1cd97 Mon Sep 17 00:00:00 2001 From: Chunguang Li Date: Thu, 2 Apr 2026 11:51:31 +0800 Subject: ls1046a: add env variables to assist boot Add LS1046ARDB-specific variables to assist the boot flow, and update the related common and other LS1046A board settings accordingly. Signed-off-by: Chunguang Li Signed-off-by: Peng Fan --- include/configs/ls1046a_common.h | 2 +- include/configs/ls1046afrwy.h | 6 ++++++ include/configs/ls1046aqds.h | 5 +++++ include/configs/ls1046ardb.h | 10 ++++++++++ 4 files changed, 22 insertions(+), 1 deletion(-) diff --git a/include/configs/ls1046a_common.h b/include/configs/ls1046a_common.h index 53ef5975a28..89f96bb3e74 100644 --- a/include/configs/ls1046a_common.h +++ b/include/configs/ls1046a_common.h @@ -83,7 +83,7 @@ #endif #ifndef SPL_NO_MISC /* Initial environment variables */ -#define CFG_EXTRA_ENV_SETTINGS \ +#define EXTRA_ENV_SETTINGS \ "hwconfig=fsl_ddr:bank_intlv=auto\0" \ "ramdisk_addr=0x800000\0" \ "ramdisk_size=0x2000000\0" \ diff --git a/include/configs/ls1046afrwy.h b/include/configs/ls1046afrwy.h index 21804fc6654..07846c3bd25 100644 --- a/include/configs/ls1046afrwy.h +++ b/include/configs/ls1046afrwy.h @@ -70,6 +70,12 @@ /* * Environment */ +#ifndef SPL_NO_MISC +/* Initial environment variables */ +#define CFG_EXTRA_ENV_SETTINGS \ + EXTRA_ENV_SETTINGS +#endif + #define CFG_SYS_FSL_QSPI_BASE 0x40000000 #undef BOOT_TARGET_DEVICES diff --git a/include/configs/ls1046aqds.h b/include/configs/ls1046aqds.h index 4b4bd7cbe48..001118b8504 100644 --- a/include/configs/ls1046aqds.h +++ b/include/configs/ls1046aqds.h @@ -312,6 +312,11 @@ /* * Environment */ +#ifndef SPL_NO_MISC +/* Initial environment variables */ +#define CFG_EXTRA_ENV_SETTINGS \ + EXTRA_ENV_SETTINGS +#endif #ifdef CONFIG_TFABOOT #define IFC_NAND_BOOTCOMMAND "run distro_bootcmd; run nand_bootcmd; " \ diff --git a/include/configs/ls1046ardb.h b/include/configs/ls1046ardb.h index 0e42a51fc59..a032e52c519 100644 --- a/include/configs/ls1046ardb.h +++ b/include/configs/ls1046ardb.h @@ -131,4 +131,14 @@ #include +#ifndef SPL_NO_MISC +/* Initial environment variables */ +#define CFG_EXTRA_ENV_SETTINGS \ + EXTRA_ENV_SETTINGS \ + "board=ls1046ardb\0" \ + "fdtfile=fsl-ls1046a-rdb-sdk.dtb\0" \ + "image=Image\0" \ + "console_dbg=earlycon=uart8250,mmio,0x21c0500\0" +#endif + #endif /* __LS1046ARDB_H__ */ -- cgit v1.2.3 From 3e99d17ab372f5c8067e6153a71457a1b7848cf3 Mon Sep 17 00:00:00 2001 From: Chunguang Li Date: Thu, 2 Apr 2026 11:51:32 +0800 Subject: lx2160ardb: add env variables to assist boot Update the console baudrate to 115200 as default. Also add env variables to assist boot process. Signed-off-by: Chunguang Li Signed-off-by: Peng Fan --- include/configs/lx2160a_common.h | 2 +- include/configs/lx2160ardb.h | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/include/configs/lx2160a_common.h b/include/configs/lx2160a_common.h index 4c1b4bf2b2c..45b5cbdd85a 100644 --- a/include/configs/lx2160a_common.h +++ b/include/configs/lx2160a_common.h @@ -137,7 +137,7 @@ "kernelhdr_addr_sd=0x3000\0" \ "kernel_size_sd=0x14000\0" \ "kernelhdr_size_sd=0x20\0" \ - "console=ttyAMA0,38400n8\0" \ + "console=ttyAMA0,115200\0" \ BOOTENV \ "mcmemsize=0x70000000\0" \ XSPI_MC_INIT_CMD \ diff --git a/include/configs/lx2160ardb.h b/include/configs/lx2160ardb.h index e700a7b1135..725220c5747 100644 --- a/include/configs/lx2160ardb.h +++ b/include/configs/lx2160ardb.h @@ -21,6 +21,11 @@ /* Initial environment variables */ #define CFG_EXTRA_ENV_SETTINGS \ + "board=lx2160ardb\0" \ + "fdtfile=fsl-lx2160a-rdb.dtb\0" \ + "image=Image\0" \ + "extra_bootargs=pci=pcie_bus_perf\0" \ + "console_dbg=earlycon=pl011,mmio32,0x21c0000\0" \ EXTRA_ENV_SETTINGS \ "boot_scripts=lx2160ardb_boot.scr\0" \ "boot_script_hdr=hdr_lx2160ardb_bs.out\0" \ -- cgit v1.2.3 From f98f2e26125f111df60d1ebdab483f91cc1f8e71 Mon Sep 17 00:00:00 2001 From: Chunguang Li Date: Thu, 2 Apr 2026 11:51:30 +0800 Subject: ls1043a: add env variables to assist boot Add LS1043ARDB-specific variables to assist the boot process, and update the related common and LS1043AQDS settings accordingly. Signed-off-by: Chunguang Li Signed-off-by: Peng Fan --- include/configs/ls1043a_common.h | 2 +- include/configs/ls1043aqds.h | 5 +++++ include/configs/ls1043ardb.h | 10 ++++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/include/configs/ls1043a_common.h b/include/configs/ls1043a_common.h index 4c695388d2f..24a717706af 100644 --- a/include/configs/ls1043a_common.h +++ b/include/configs/ls1043a_common.h @@ -88,7 +88,7 @@ #include /* Initial environment variables */ -#define CFG_EXTRA_ENV_SETTINGS \ +#define EXTRA_ENV_SETTINGS \ "hwconfig=fsl_ddr:bank_intlv=auto\0" \ "initrd_high=0xffffffffffffffff\0" \ "kernel_addr=0x61000000\0" \ diff --git a/include/configs/ls1043aqds.h b/include/configs/ls1043aqds.h index 7ccbb20bf2e..c06e986e93f 100644 --- a/include/configs/ls1043aqds.h +++ b/include/configs/ls1043aqds.h @@ -295,6 +295,11 @@ /* * Environment */ +#ifndef SPL_NO_MISC +/* Initial environment variables */ +#define CFG_EXTRA_ENV_SETTINGS \ + EXTRA_ENV_SETTINGS +#endif #include diff --git a/include/configs/ls1043ardb.h b/include/configs/ls1043ardb.h index ef8fdc1912b..90caf8a1371 100644 --- a/include/configs/ls1043ardb.h +++ b/include/configs/ls1043ardb.h @@ -201,4 +201,14 @@ #include +#ifndef SPL_NO_MISC +/* Initial environment variables */ +#define CFG_EXTRA_ENV_SETTINGS \ + EXTRA_ENV_SETTINGS \ + "board=ls1043ardb\0" \ + "fdtfile=fsl-ls1043a-rdb-sdk.dtb\0" \ + "image=Image\0" \ + "console_dbg=earlycon=uart8250,mmio,0x21c0500\0" +#endif + #endif /* __LS1043ARDB_H__ */ -- cgit v1.2.3