Re: [EXTERNAL] Re: [PATCH 1/2] dt-bindings: mux-controller: ti: add binding for event mux router

From: rahul sharma

Date: Wed Sep 02 2026 - 08:29:59 EST


Hi Alvin,


On 28/08/26 17:20, Alvin Šipraga wrote:
Hi Rahul, On Fri, Aug 28, 2026 at 03: 36: 14PM +0530, Rahul Sharma wrote: > Add binding for the event mux router of TI's K3 based SoC AM62L. [. . . ] > + ti,reg-mask-val: > + $ref: /schemas/types. yaml#/ definitions/uint32-matrix > + items: 


Hi Rahul,

On Fri, Aug 28, 2026 at 03:36:14PM +0530, Rahul Sharma wrote:
Add binding for the event mux router of TI's K3 based SoC AM62L.

[...]

+ ti,reg-mask-val:
+ $ref: /schemas/types.yaml#/definitions/uint32-matrix
+ items:
+ items:
+ - description: Register offset (relative to reg base)
+ - description: Bit mask for the mux control bits
+ - description: Value to write when mux is active (state 1)
+ minItems: 1
+ description: |
+ Array of triplets specifying register offset, mask, and value for each
+ mux control. Each triplet contains:
+ - register offset (relative to reg base)
+ - bit mask for the mux control bits
+ - value to write when mux is active (state 1)

As I understand it, you are creating a binary (0=off / 1=on) mux control
for each reg-mask-val triplet. But couldn't you just use the mmio-mux
binding/driver for this, delegating the value setting to the consumer?

[...]

+examples:
+ - |
+ #include <dt-bindings/mux/mux.h>
+
+ // Example 1: TI AM62L GPIO Mux Router
+ mux-controller@a00000 {
+ compatible = "ti,am62l-event-mux-router";
+ reg = <0xa00000 0x400>;
+ #mux-control-cells = <1>;
+
+ /* Mux Register addresses: 0xa00004 + (J × 4) */
+ /* GPIO0_40 -> BCDMA trigger 15 */
+ ti,reg-mask-val = <0x40 0x000ff 0x00028>;
+ idle-states = <0>;
+ };

Alternatively,

foo_mux: mux-controller {
compatible = "mmio-mux";
reg = <...>;
#mux-control-cells = <1>;
mux-reg-masks = <0x40 0x000ff>;
idle-states = <0>;
};

toto-consumer {
compatible = "toto";
mux-states = <&foo_mux 0 0x00028>;
mux-state-names = "gpio-trigger";
};

What's wrong with that?

We wanted to go with this approach initially, but we had trouble assigning consumer node(s) because of lot of modifications will be needed in already existing consumer nodes.

So, we came up with another plan of not using a consumer node at all to enable this. Now in this approach you can see, the mux-controller itself assigns that value to mux register and takes care of routing.

Also If you look at the driver, to establish a mux route path we need to 2 things to be done 1. Set the mux register value, this comes from DT property 2. Enable the mux route by setting 16th bit in mux register.

And this cannot be accommodated in current mmio-mux driver.

BR,
Rahul


Kind regards,
Alvin