pinctrl: mpfs-mssio: three fixes
Subsystems (5)
cover pinctrl: mpfs-mssio: three fixes
From: Conor Dooley <[email protected]>
Three fixes for issues I encountered, one of which is clearly world ending if not resolved while the other two should go to stable because they'll cause the wrong bank voltage setting to be applied or reported in debugfs.
I discovered these myself while working on a new board that needed novel pinctrl configuration. I think that few customers have probably been impacted by incorrect bank voltage setting because it requires trying to set a bank voltage that differs from what the FPGA configuration set, and not only are the configurations currently in upstream and Microchip's vendor devicetrees a match for the FPGA settings, I think customers are using the FPGA configuration tool instead of pinctrl to configure IO since that's how it has had to be done for the last several years. pic64gx is where I spotted it since the config tool can't be used there, so the impact is limited to users of that SoC that want to have non-default bank voltages.
Cheers,
Conor.
Conor Dooley (3):
pinctrl: mpfs-mssio: fix whitespace in debugfs output
pinctrl: mpfs-mssio: fix width of unused bank voltage setting
pinctrl: mpfs-mssio: use correct regmap function to set bank voltage
drivers/pinctrl/microchip/pinctrl-mpfs-mssio.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
Signature · 1 line
2.53.0
PATCH 1/3 pinctrl: mpfs-mssio: fix whitespace in debugfs output
From: Conor Dooley <[email protected]>
The printout from mpfs_pinctrl_pinconf_dbg_show() is appended to information from the core, so a leading space is required or the world will end.
--- drivers/pinctrl/microchip/pinctrl-mpfs-mssio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pinctrl/microchip/pinctrl-mpfs-mssio.c +1 -1
@@ -612,7 +612,7 @@ static void mpfs_pinctrl_pinconf_dbg_show(struct pinctrl_dev *pctrl_dev, struct reg =mpfs_pinctrl_pin_to_iocfg_reg (pin); offset =mpfs_pinctrl_pin_to_iocfg_offset (pin); -seq_printf (seq,"pin: %u " , pin); +seq_printf (seq," pin: %u " , pin);seq_printf (seq,"reg: %x offset: %u " , reg, offset);if (reg <0 || offset <0 )
Signature · 1 line
2.53.0
PATCH 2/3 pinctrl: mpfs-mssio: fix width of unused bank voltage setting
In reply to Conor DooleyFrom: Conor Dooley <[email protected]>
The bank voltages are only 4 bits wide, so when a pin was unused the driver was not correctly interpreting it as being at zero volts, because the driver's value for unused had two extra set bits.
--- drivers/pinctrl/microchip/pinctrl-mpfs-mssio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pinctrl/microchip/pinctrl-mpfs-mssio.c +1 -1
@@ -86,7 +86,7 @@ static struct mpfs_pinctrl_bank_voltage mpfs_pinctrl_bank_voltages[8] = { { .uv = 1800000, .val = 4 }, { .uv = 2500000, .val = 6 }, { .uv = 3300000, .val = 8 }, - { .uv = 0, .val = 0x3f }, // pin unused + { .uv = 0, .val = 0xf }, // pin unused };static int mpfs_pinctrl_get_drive_strength_ma (u32 drive_strength)
Signature · 1 line
2.53.0
PATCH 3/3 pinctrl: mpfs-mssio: use correct regmap function to set bank voltage
In reply to Conor DooleyFrom: Conor Dooley <[email protected]>
regmap_assign_bits() is not the correct function to use for an RMW operation, as it maps to regmap_set_bits() or regmap_clear_bits() and the former will never zero a bit. Use regmap_update_bits() instead, which will actually set the bank voltages to what have been requested.
--- drivers/pinctrl/microchip/pinctrl-mpfs-mssio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/pinctrl/microchip/pinctrl-mpfs-mssio.c +2 -2
@@ -156,10 +156,10 @@ static void mpfs_pinctrl_set_bank_voltage(struct mpfs_pinctrl *pctrl, unsigned iu32 val =FIELD_PREP (MPFS_PINCTRL_BANK_VOLTAGE_MASK , bank_voltage);if (pin <MPFS_PINCTRL_BANK2_START ) -regmap_assign_bits (pctrl->sysreg_regmap,MPFS_PINCTRL_MSSIO_BANK4_CFG_CR , +regmap_update_bits (pctrl->sysreg_regmap,MPFS_PINCTRL_MSSIO_BANK4_CFG_CR ,MPFS_PINCTRL_BANK_VOLTAGE_MASK , val);else -regmap_assign_bits (pctrl->sysreg_regmap,MPFS_PINCTRL_MSSIO_BANK2_CFG_CR , +regmap_update_bits (pctrl->sysreg_regmap,MPFS_PINCTRL_MSSIO_BANK2_CFG_CR ,MPFS_PINCTRL_BANK_VOLTAGE_MASK , val); }
Signature · 1 line
2.53.0
Linus Walleij
maintainerHi Conor,
On Mon, Aug 31, 2026 at 12:51 PM Conor Dooley <[email protected]> wrote:
(...)
Quoted 2 lines
Conor Dooley (3):
pinctrl: mpfs-mssio: fix whitespace in debugfs output
Applied for next.
Quoted 2 lines
pinctrl: mpfs-mssio: fix width of unused bank voltage setting
pinctrl: mpfs-mssio: use correct regmap function to set bank voltage
Applied for fixes.
Sorry for slowness on my side :/
Yours,
Linus Walleij