Skip to content

Commit a803182

Browse files
AzharMCHPjhedberg
authored andcommitted
dts: arm: microchip: add pinctrl dts node and bindings for Port G1 IP
Add pinctrl dts node and binding parameters for Microchip Pinctrl Port G1 IP Signed-off-by: Mohamed Azhar <[email protected]>
1 parent 4acc520 commit a803182

File tree

2 files changed

+149
-0
lines changed

2 files changed

+149
-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
@@ -53,6 +53,29 @@
5353
#clock-cells = <1>;
5454
};
5555
};
56+
57+
pinctrl: pinctrl@41008000 {
58+
compatible = "microchip,port-g1-pinctrl";
59+
#address-cells = <1>;
60+
#size-cells = <1>;
61+
ranges = <0x41008000 0x41008000 0x200>;
62+
63+
porta: gpio@41008000 {
64+
reg = <0x41008000 0x80>;
65+
};
66+
67+
portb: gpio@41008080 {
68+
reg = <0x41008080 0x80>;
69+
};
70+
71+
portc: gpio@41008100 {
72+
reg = <0x41008100 0x80>;
73+
};
74+
75+
portd: gpio@41008180 {
76+
reg = <0x41008180 0x80>;
77+
};
78+
};
5679
};
5780
};
5881

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

0 commit comments

Comments
 (0)