Skip to content

soc: ti: introduce ti,control-module for MMR partition unlocking#103330

Merged
nashif merged 5 commits intozephyrproject-rtos:mainfrom
natto1784:control_module
Mar 12, 2026
Merged

soc: ti: introduce ti,control-module for MMR partition unlocking#103330
nashif merged 5 commits intozephyrproject-rtos:mainfrom
natto1784:control_module

Conversation

@natto1784
Copy link
Copy Markdown
Contributor

@natto1784 natto1784 commented Feb 2, 2026

This binding is for TI devices that use control modules for configuring
registers and information related to control MMRs, power, reset and
clocking.

These control modules consist of regions that require writing specific
values to specific kick registers to unlock that region. This is provided
as ti,unlock-offsets property.

Currently we maintain addresses and values as static configurations using
static configurations and macros in ctrl_partitions.c. Instead use the
new ti,control-module binding to get these values from the device tree and
unlock the partitions during early init.

Rationale behind driver-less DT binding

I am aware that this is not a preferred thing in the codebase, however writing a driver separately for doing a couple of I/O operations makes little sense in this case. It would pretty much just be the same as the generic syscon driver with a different init() API.

Usecases

One usecase is already addressed in this PR which is unlocking of pinctrl/pinmux regions.

There are several more usecases for other MMR regions that are not currently in the DT. These involve having something like compatible = "ti,control-module", "syscon"; to enable the syscon driver as well.

In general, it would be used as a generic syscon driver for many peripheral configurations (or in case of pinctrl, syscon-less for reduced complexity) in addition to the unlocking mechanism in early init hook.

Testing

Built for

  • AM62-SK A53 and M4 cores
  • AM243x-EVM R5F and M4 cores

Ran on

  • AM62-SK A53 core
  • AM243x-EVM R5F core

@zephyrbot zephyrbot added area: ARM64 ARM (64-bit) Architecture platform: TI K3 Texas Instruments Keystone 3 Processors platform: TI SimpleLink Texas Instruments SimpleLink MCU area: Boards/SoCs area: Devicetree Binding PR modifies or adds a Device Tree binding labels Feb 2, 2026
@natto1784 natto1784 force-pushed the control_module branch 2 times, most recently from 89cdc05 to e6b09ae Compare February 2, 2026 09:50
Copy link
Copy Markdown

@pablofsmelo pablofsmelo left a comment

Choose a reason for hiding this comment

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

Modify the PR title to something like "soc: ti: introduce ti,control-module for MMR partition unlocking" to maintain compatibility.

@natto1784 natto1784 changed the title Introduce ti,control-module for unlocking MMR regions in TI SoCs soc: ti: introduce ti,control-module for MMR partition unlocking Feb 2, 2026
Comment thread dts/arm/ti/am62x_m4.dtsi Outdated
@natto1784 natto1784 force-pushed the control_module branch 2 times, most recently from b33f1ea to e49392e Compare February 3, 2026 10:49
Comment thread soc/ti/k3/am6x/CMakeLists.txt Outdated
Comment thread soc/ti/k3/am6x/r5/soc.c Outdated
Comment thread soc/ti/k3/am6x/common/ctrl_partitions.c
@natto1784
Copy link
Copy Markdown
Contributor Author

@glneo thanks for the review, I have added two more patches to demonstrate a usecase for such a syscon node - these patches also take care of the problems in #101283. Let me know if they are outside the scope of this PR and I will send them separately.

This binding is for TI devices that use control modules for configuring
registers and information related to control MMRs, power, reset and
clocking.

These control modules consist of regions that require writing specific
values to specific kick registers to unlock that region. This is provided
as ti,unlock-offsets property.

Signed-off-by: Amneesh Singh <amneesh@ti.com>
Currently we maintain addresses and values as static configurations using
static configurations and macros in ctrl_partitions.c. Instead use the
new ti,control-module binding to get these values from the device tree and
unlock the partitions during early init.

Only compile and call `k3_unlock_all_ctrl_partitions` if at least one node
with status okay and compatible "ti,control-module" is present.

Also make sure to map and unmap the regions in case MMU is present.

Signed-off-by: Amneesh Singh <amneesh@ti.com>
Allow unlocking partitions as part of early_init_hook if the device tree
contains an unlock configuration as part of ti,control-module.

Signed-off-by: Amneesh Singh <amneesh@ti.com>
Allow providing an unlock configuration for unlocking the padcfg region as
part of the ti,control-module node.

Map the child pinctrl node using the `ranges` property to the base address
space.

Signed-off-by: Amneesh Singh <amneesh@ti.com>
Allow providing an unlock configuration for unlocking the padcfg region as
part of the ti,control-module node.

Map the child pinctrl node using the `ranges` property to the base address
space.

Signed-off-by: Amneesh Singh <amneesh@ti.com>
@glneo
Copy link
Copy Markdown
Contributor

glneo commented Mar 4, 2026

Yeah the last two patches are good examples but feel very un-related. Plus one is giving a bunch Doxygen warnings. Better to just move those to a different PR. Everything else looks good to me.

@natto1784
Copy link
Copy Markdown
Contributor Author

Yeah the last two patches are good examples but feel very un-related. Plus one is giving a bunch Doxygen warnings. Better to just move those to a different PR. Everything else looks good to me.

Dropped the last two patches, will be moved to a separate PR.

@sonarqubecloud
Copy link
Copy Markdown

@nashif nashif merged commit fcd4786 into zephyrproject-rtos:main Mar 12, 2026
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: ARM64 ARM (64-bit) Architecture area: Boards/SoCs area: Devicetree Binding PR modifies or adds a Device Tree binding area: Timer Timer platform: TI K3 Texas Instruments Keystone 3 Processors platform: TI SimpleLink Texas Instruments SimpleLink MCU

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants