lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID:
 <DU0PR04MB94172086AB4EF0389B78CA6A885A2@DU0PR04MB9417.eurprd04.prod.outlook.com>
Date: Mon, 26 Feb 2024 13:16:51 +0000
From: Peng Fan <peng.fan@....com>
To: "Peng Fan (OSS)" <peng.fan@....nxp.com>, "sudeep.holla@....com"
	<sudeep.holla@....com>, "cristian.marussi@....com"
	<cristian.marussi@....com>, "linus.walleij@...aro.org"
	<linus.walleij@...aro.org>
CC: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"linux-arm-kernel@...ts.infradead.org"
	<linux-arm-kernel@...ts.infradead.org>, "linux-gpio@...r.kernel.org"
	<linux-gpio@...r.kernel.org>, Aisheng Dong <aisheng.dong@....com>, Nitin Garg
	<nitin.garg_3@....com>, Ranjani Vaidyanathan <ranjani.vaidyanathan@....com>,
	Ye Li <ye.li@....com>
Subject: RE: [PATCH] pinctrl: scmi: support i.MX OEM pin configuration type

Hi Linus, Sudeep, Cristian,

> Subject: [PATCH] pinctrl: scmi: support i.MX OEM pin configuration type

Sorry to ping early, but this impacts the design and i.MX95 SoC upstream(
although I removed pinctrl to let uboot init pinmux as of now), so I would
like see whether are you ok with the approach or not. This is the best as
of now I could think out to not adding more size to firmware and make the
dts format similar as previous i.MX.

Thanks,
Peng.

> 
> From: Peng Fan <peng.fan@....com>
> 
> i.MX95 System Manager FW supports SCMI PINCTRL protocol, but uses OEM
> Pin Configuration type, so extend the driver to support custom params.
> 
> Signed-off-by: Peng Fan <peng.fan@....com>
> ---
> 
> V1:
>  Based on https://lore.kernel.org/all/20240223-pinctrl-scmi-v4-0-
> 10eb5a379274@....com/
>  This is an reimplementation for supporting i.MX95 OEM settings.
>  With this patch, the dts will be like:
> 
> +#define IMX95_PAD_SD1_CLK__USDHC1_CLK(val)	\
> +	sd1clk {				\
> +		pins = "sd1clk";		\
> +		imx,func-id = <0>;		\
> +		imx,pin-conf = <val>;		\
> +	}
>   ....
> +
> +	pinctrl_usdhc1: usdhc1grp {
> +		IMX95_PAD_SD1_CLK__USDHC1_CLK(0x158e);
> +		IMX95_PAD_SD1_CMD__USDHC1_CMD(0x138e);
>  ....
> +	};
> 
>  drivers/pinctrl/pinctrl-scmi.c | 10 ++++++++++  drivers/pinctrl/pinctrl-scmi.h
> | 15 +++++++++++++++
>  2 files changed, 25 insertions(+)
>  create mode 100644 drivers/pinctrl/pinctrl-scmi.h
> 
> diff --git a/drivers/pinctrl/pinctrl-scmi.c b/drivers/pinctrl/pinctrl-scmi.c index
> f2fef3fb85ae..e58f1aaf9963 100644
> --- a/drivers/pinctrl/pinctrl-scmi.c
> +++ b/drivers/pinctrl/pinctrl-scmi.c
> @@ -19,6 +19,7 @@
>  #include <linux/pinctrl/pinctrl.h>
>  #include <linux/pinctrl/pinmux.h>
> 
> +#include "pinctrl-scmi.h"
>  #include "pinctrl-utils.h"
>  #include "core.h"
>  #include "pinconf.h"
> @@ -472,6 +473,13 @@ static const struct pinconf_ops
> pinctrl_scmi_pinconf_ops = {
>  	.pin_config_config_dbg_show = pinconf_generic_dump_config,  };
> 
> +static const struct pinconf_generic_params pinctrl_scmi_oem_dt_params[] =
> {
> +	{"imx,func-id", IMX_SCMI_PIN_MUX, -1},
> +	{"imx,daisy-id", IMX_SCMI_PIN_DAISY_ID, -1},
> +	{"imx,daisy-conf", IMX_SCMI_PIN_DAISY_CFG, -1},
> +	{"imx,pin-conf", IMX_SCMI_PIN_CONF, -1}, };
> +
>  static int pinctrl_scmi_get_pins(struct scmi_pinctrl *pmx,
>  				 unsigned int *nr_pins,
>  				 const struct pinctrl_pin_desc **pins) @@ -
> 548,6 +556,8 @@ static int scmi_pinctrl_probe(struct scmi_device *sdev)
>  	pmx->pctl_desc.pctlops = &pinctrl_scmi_pinctrl_ops;
>  	pmx->pctl_desc.pmxops = &pinctrl_scmi_pinmux_ops;
>  	pmx->pctl_desc.confops = &pinctrl_scmi_pinconf_ops;
> +	pmx->pctl_desc.custom_params = pinctrl_scmi_oem_dt_params;
> +	pmx->pctl_desc.num_custom_params =
> +ARRAY_SIZE(pinctrl_scmi_oem_dt_params);
> 
>  	ret = pinctrl_scmi_get_pins(pmx, &pmx->pctl_desc.npins,
>  				    &pmx->pctl_desc.pins);
> diff --git a/drivers/pinctrl/pinctrl-scmi.h b/drivers/pinctrl/pinctrl-scmi.h new
> file mode 100644 index 000000000000..fcc61bc19c98
> --- /dev/null
> +++ b/drivers/pinctrl/pinctrl-scmi.h
> @@ -0,0 +1,15 @@
> +/* SPDX-License-Identifier: GPL-2.0 */
> +/*
> + * Copyright 2024 NXP
> + */
> +
> +#ifndef __DRIVERS_PINCTRL_SCMI_H
> +#define __DRIVERS_PINCTRL_SCMI_H
> +
> +/* OEM VENDOR Pin Configuration Type */
> +#define IMX_SCMI_PIN_MUX	192
> +#define IMX_SCMI_PIN_CONF	193
> +#define IMX_SCMI_PIN_DAISY_ID	194
> +#define IMX_SCMI_PIN_DAISY_CFG	195
> +
> +#endif /* __DRIVERS_PINCTRL_SCMI_H */
> --
> 2.37.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ