Skip to content

Commit 5853403

Browse files
AzharMCHPArunMCHP
authored andcommitted
bindings: pinctrl: microchip: pinctrl bindings for Port G1 IP
Add binding parameters for Microchip Pinctrl Port G1 IP Signed-off-by: Mohamed Azhar <[email protected]>
1 parent 88d493b commit 5853403

File tree

2 files changed

+147
-0
lines changed

2 files changed

+147
-0
lines changed

dts/arm/microchip/sam/sam_d5x_e5x/common/samd5xe5x.dtsi

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,29 @@
6565
write-block-size = <8>;
6666
};
6767
};
68+
69+
pinctrl: pinctrl@41008000 {
70+
compatible = "microchip,port-g1-pinctrl";
71+
#address-cells = <1>;
72+
#size-cells = <1>;
73+
ranges = <0x41008000 0x41008000 0x200>;
74+
75+
porta: gpio@41008000 {
76+
reg = <0x41008000 0x80>;
77+
};
78+
79+
portb: gpio@41008080 {
80+
reg = <0x41008080 0x80>;
81+
};
82+
83+
portc: gpio@41008100 {
84+
reg = <0x41008100 0x80>;
85+
};
86+
87+
portd: gpio@41008180 {
88+
reg = <0x41008180 0x80>;
89+
};
90+
};
6891
};
6992
};
7093

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
# Copyright (c) 2025 Microchip Technology Inc.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
description: |
5+
Microchip port-g1 Pinctrl container node
6+
7+
The Microchip port-g1 pin controller is a singleton node responsible for controlling
8+
pin function selection and pin properties. For example, you can use this node
9+
to route SERCOM0 as UART were RX to pin PAD1 and enable the pull-up resistor
10+
on the pin.
11+
12+
The is used in the below families:
13+
- SAM D5x/E5x
14+
15+
The node has the 'pinctrl' node label set in your SoC's devicetree, so you can
16+
modify it like this:
17+
18+
&pinctrl {
19+
/* your modifications go here */
20+
};
21+
22+
All device pin configurations should be placed in child nodes of the 'pinctrl'
23+
node, as shown in this example:
24+
25+
/** You can put this in places like a <board>-pinctrl.dtsi file in
26+
* your board directory, or a devicetree overlay in your application.
27+
*/
28+
29+
/** include pre-defined combinations for the SoC variant used by the board */
30+
#include <dt-bindings/pinctrl/sam/same54/atsame54p20a-pinctrl.h>
31+
32+
&pinctrl {
33+
/* configuration for the usart0 "default" state */
34+
sercom0_uart_default: sercom0_uart_default {
35+
/* group 1 */
36+
group1 {
37+
/* configure PA6 as USART0 TX and PA8 as USART0 CTS */
38+
pinmux = <PA5D_SERCOM0_PAD1>, <PA6D_SERCOM0_PAD2>;
39+
};
40+
/* group 2 */
41+
group2 {
42+
/* configure PA5 as USART0 RX and PA7 as USART0 RTS */
43+
pinmux = <PA4D_SERCOM0_PAD0>, <PA7D_SERCOM0_PAD3>;
44+
/* both PA5 and PA7 have pull-up enabled */
45+
bias-pull-up;
46+
};
47+
};
48+
};
49+
50+
The 'usart0_default' child node encodes the pin configurations for a
51+
particular state of a device; in this case, the default (that is, active)
52+
state.
53+
54+
As shown, pin configurations are organized in groups within each child node.
55+
Each group can specify a list of pin function selections in the 'pinmux'
56+
property.
57+
58+
A group can also specify shared pin properties common to all the specified
59+
pins, such as the 'bias-pull-up' property in group 2. Here is a list of
60+
supported standard pin properties:
61+
62+
- bias-pull-up: Enable pull-up resistor.
63+
- bias-pull-down: Enable pull-down resistor.
64+
- drive-strength: Increase sink current.
65+
- input-enable: Enable input on pin.
66+
- output-enable: Enable output on a pin without actively driving it.
67+
68+
To link pin configurations with a device, use a pinctrl-N property for some
69+
number N, like this example you could place in your board's DTS file:
70+
71+
#include "board-pinctrl.dtsi"
72+
73+
&usart0 {
74+
pinctrl-0 = <&usart0_default>;
75+
pinctrl-names = "default";
76+
};
77+
78+
compatible: "microchip,port-g1-pinctrl"
79+
80+
include: base.yaml
81+
82+
properties:
83+
"#address-cells":
84+
required: true
85+
const: 1
86+
"#size-cells":
87+
required: true
88+
const: 1
89+
90+
child-binding:
91+
description: |
92+
Each child node defines the configuration for a particular state.
93+
child-binding:
94+
description: |
95+
The grandchild nodes group pins that share the same pin configuration.
96+
97+
include:
98+
- name: pincfg-node.yaml
99+
property-allowlist:
100+
- bias-pull-up
101+
- bias-pull-down
102+
- drive-strength
103+
- input-enable
104+
- output-enable
105+
106+
properties:
107+
pinmux:
108+
required: true
109+
type: array
110+
description: |
111+
An array of pins sharing the same group properties. The pins should
112+
be defined using pre-defined macros or, alternatively, using the
113+
SAM_PINMUX utility macros depending on the pinmux model used by the
114+
SoC series.
115+
drive-strength:
116+
enum:
117+
- 0
118+
- 1
119+
default: 0
120+
description: |
121+
The drive strength controls the output driver strength of an I/O pin
122+
configured as an output.
123+
0: Pin drive strength is set to normal drive strength.
124+
1: Pin drive strength is set to stronger drive strength.

0 commit comments

Comments
 (0)