Skip to content

dev: ti: mspm0: l: Add common pinmux for MSPM0L111x#80

Open
heghe wants to merge 1 commit intozephyrproject-rtos:masterfrom
heghe:mspm0l111x
Open

dev: ti: mspm0: l: Add common pinmux for MSPM0L111x#80
heghe wants to merge 1 commit intozephyrproject-rtos:masterfrom
heghe:mspm0l111x

Conversation

@heghe
Copy link
Copy Markdown

@heghe heghe commented Jan 16, 2026

  • Based on the TI datasheet.
  • All pins support being used as GPIO.
  • Use input-enable for all PIN TYPE I on datasheet + SPI POCI pins.
  • Define MSPM0_PIN_FUNCTION_ANALOG for every pin which is unconnected state (essentially needed for low power consumption).

Link: https://www.ti.com/lit/ds/symlink/mspm0l1116.pdf

Copy link
Copy Markdown
Collaborator

@ssekar15 ssekar15 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as far I checked most of configuration matches with existing l222x dtsi. Please resuse the existing dtsi file as include and add delta on high variants.

use name as per datasheet e.g . tima_fault1_pa0 not tima_fal1_pa0.

@heghe
Copy link
Copy Markdown
Author

heghe commented Jan 19, 2026

I didn't notice that l222x and l111x are that similar. I agree with your suggestion to have a common base for both with delta where appropriate.

As for the naming conventions, I'll use the format of l222x. But I do have a question here. For the SPI CS pins it has the name of spiN_csX_pociX*link. Is this the correct naming? Or was just a mistake and I should fix it.

@heghe
Copy link
Copy Markdown
Author

heghe commented Jan 19, 2026

@ssekar15 while in the process of creating the common base, I discover that after PINCM20 the configurations are no longer shared. Do you still want to have this part shared?

Also I notice that in my configuration, IOMUX REG is off, it seems I used PT PIN by mistake, but when I tested this on the EV board, the led was working. I guess it was just a happy coincidence.

Anyway, I'll be waiting for your feedback before continuing the work on this.

@ssekar15
Copy link
Copy Markdown
Collaborator

For the SPI CS pins it has the name of spiN_csX_pociX*link.

The naming conviction is followed from the source/ti/devices/msp/m0p/mspm0l122x.h, please identify whether typo or pin serve two configuration in different SoC on same series.

@ssekar15 while in the process of creating the common base, I discover that after PINCM20 the configurations are no longer shared. Do you still want to have this part shared?

yes, please create common base until PINCM20.

pinmux = <MSP_PINMUX(74, MSPM0_PIN_FUNCTION_9)>;
};
};
/omit-if-no-ref/ comp0_out_pa27: comp0_out_pa27 {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think most of the diffs in this file are due to the change in formatting.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the formatting/indentation change is due to the fact that the root and soc nodes were moved into the common dtsi file, and the pinctrl node is reference here only for the additions needed for mspm0l222x variant.

pinmux = <MSP_PINMUX(1, MSPM0_PIN_FUNCTION_2)>;
};

/omit-if-no-ref/ ic20_sda_pa0: ic20_sda_pa0 {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo should be i2c0_sda_pa0

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch. fixed

Since MSPM0L111x and MSPM0L222x have a common pin configuration for some
of the pins, the mspm0l111x-222x-common-pinctrl.dtsi file is added with
the shared pin configuration. The MSPM0L222x dtsi is modified to take
advantage of this.

The naming convetion was kept from the original 222x variant, with some
modifications for SPI CS pins which didn't correctly reflect their function.
For example, there was: `spi0_cs3_cd_poci3_pa01: spi0_cs3_cd_poci3_pa01`
node for the PINCM2 function 10 which in data sheet is named only SPI0_CS3,
and now the node is named: `spi0_cs3_pa01: spi0_cs3_pa01`.

As for MSPM0L111x:
- All pins support being used as GPIO.
- Use input-enable for all PIN TYPE I on datasheet + SPI POCI pins.
- Define MSPM0_PIN_FUNCTION_ANALOG for every pin which is unconnected
  state (essentially needed for low power consumption).

Link: https://www.ti.com/lit/ds/symlink/mspm0l1116.pdf
Link: https://www.ti.com/lit/ds/symlink/mspm0l2228.pdf
Signed-off-by: Razvan Heghedus <razvan.heghedus@protonmail.com>
pinmux = <MSP_PINMUX(1, MSPM0_PIN_FUNCTION_3)>;
input-enable;
drive-open-drain;
bias-disable;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add only mux setting in common dtsi, driver setting depends on board.

Copy link
Copy Markdown

@JFMSP JFMSP Mar 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with this. Furthermore, I have concerns about maintainability and tradeoffs with other mspm0l variants. while MSPM0L122 and MSPM0L222X are the same family, MSPM0L111X devices are fundamentally a different family, and there's not a planned compatibility and continuity from the TI side, so I think we're better off keeping these files separate even if there are some similarities.

pinmux = <MSP_PINMUX(3, MSPM0_PIN_FUNCTION_5)>;
input-enable;
};

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PINMUX_6 is missing

Copy link
Copy Markdown

@JFMSP JFMSP left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One note about structure, I don't know if the common file is the right approach here across different families.

There are other MSPM0L devices that can get added such as L1306 where deriving a clean common file will become really tricky.

pinmux = <MSP_PINMUX(1, MSPM0_PIN_FUNCTION_3)>;
input-enable;
drive-open-drain;
bias-disable;
Copy link
Copy Markdown

@JFMSP JFMSP Mar 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with this. Furthermore, I have concerns about maintainability and tradeoffs with other mspm0l variants. while MSPM0L122 and MSPM0L222X are the same family, MSPM0L111X devices are fundamentally a different family, and there's not a planned compatibility and continuity from the TI side, so I think we're better off keeping these files separate even if there are some similarities.

@ssekar15
Copy link
Copy Markdown
Collaborator

One note about structure, I don't know if the common file is the right approach here across different families.

There are other MSPM0L devices that can get added such as L1306 where deriving a clean common file will become really tricky.

@JFMSP
Common pinctrl is to avoid mistakes with multiple effort, streamline only difference for better understanding. Most of MSPM0 family shares the same baseline. Nevertherless completely incompatible new SoC shall have separate entity.

@JFMSP
Copy link
Copy Markdown

JFMSP commented Mar 17, 2026

One note about structure, I don't know if the common file is the right approach here across different families.
There are other MSPM0L devices that can get added such as L1306 where deriving a clean common file will become really tricky.

@JFMSP Common pinctrl is to avoid mistakes with multiple effort, streamline only difference for better understanding. Most of MSPM0 family shares the same baseline. Nevertherless completely incompatible new SoC shall have separate entity.

My point here is I think mistakes are actually more likely because this common file won't scale to other MPSM0L devices. The presence of other pin functions apart from analog and GPIO as the first two is not shared because the rest of the peripheral elements are very different. So if we were to add MSPM0L1306, for example, the PA0 functions for that are:
0. analog (same)

  1. gpio (same)
  2. uart1 TX (different uart instance)
  3. i2c0 sda (same)
  4. timg1 ccp0 (different)
  5. spi0 cs1 (different)
  6. sysctl fcc in (same)

and this starts to break the commonality in more places. Then either we ignore the common file for additional devices which then becomes clunky or we have to re-work the common file with each new device, neither of which I'm a big fan of.

I think we have much more maintainable code long term if we deal with some duplication across different devices, because there's not any shared commonality we're enforcing from the TI side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants