Skip to content

Commit 64aa494

Browse files
inochisalinusw
authored andcommitted
dt-bindings: pinctrl: Add pinctrl for Sophgo CV1800 series SoC.
Add pinctrl support for Sophgo CV1800 series SoC. Signed-off-by: Inochi Amaoto <[email protected]> Reviewed-by: Rob Herring (Arm) <[email protected]> Link: https://lore.kernel.org/IA1PR20MB4953680DE7977CAD906DBDB4BBB32@IA1PR20MB4953.namprd20.prod.outlook.com Signed-off-by: Linus Walleij <[email protected]>
1 parent 8400291 commit 64aa494

File tree

6 files changed

+537
-0
lines changed

6 files changed

+537
-0
lines changed
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/pinctrl/sophgo,cv1800-pinctrl.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Sophgo CV1800 Pin Controller
8+
9+
maintainers:
10+
- Inochi Amaoto <[email protected]>
11+
12+
properties:
13+
compatible:
14+
enum:
15+
- sophgo,cv1800b-pinctrl
16+
- sophgo,cv1812h-pinctrl
17+
- sophgo,sg2000-pinctrl
18+
- sophgo,sg2002-pinctrl
19+
20+
reg:
21+
items:
22+
- description: pinctrl for system domain
23+
- description: pinctrl for rtc domain
24+
25+
reg-names:
26+
items:
27+
- const: sys
28+
- const: rtc
29+
30+
resets:
31+
maxItems: 1
32+
33+
patternProperties:
34+
'-cfg$':
35+
type: object
36+
description:
37+
A pinctrl node should contain at least one subnode representing the
38+
pinctrl groups available on the machine.
39+
40+
additionalProperties: false
41+
42+
patternProperties:
43+
'-pins$':
44+
type: object
45+
description: |
46+
Each subnode will list the pins it needs, and how they should
47+
be configured, with regard to muxer configuration, bias, input
48+
enable/disable, input schmitt trigger, slew-rate, drive strength
49+
and bus hold state. In addition, all pins in the same subnode
50+
should have the same power domain. For configuration detail,
51+
refer to https://github.com/sophgo/sophgo-doc/.
52+
53+
allOf:
54+
- $ref: pincfg-node.yaml#
55+
- $ref: pinmux-node.yaml#
56+
57+
properties:
58+
pinmux:
59+
description: |
60+
The list of GPIOs and their mux settings that properties in the
61+
node apply to. This should be set using the GPIOMUX or GPIOMUX2
62+
macro.
63+
64+
bias-pull-up:
65+
type: boolean
66+
67+
bias-pull-down:
68+
type: boolean
69+
70+
drive-strength-microamp:
71+
description: typical current when output high level.
72+
73+
input-schmitt-microvolt:
74+
description: typical threshold for schmitt trigger.
75+
76+
power-source:
77+
description: power supplies at X mV.
78+
enum: [ 1800, 3300 ]
79+
80+
slew-rate:
81+
description: slew rate for output buffer (0 is fast, 1 is slow)
82+
enum: [ 0, 1 ]
83+
84+
bias-bus-hold: true
85+
86+
required:
87+
- pinmux
88+
- power-source
89+
90+
additionalProperties: false
91+
92+
required:
93+
- compatible
94+
- reg
95+
- reg-names
96+
97+
additionalProperties: false
98+
99+
examples:
100+
- |
101+
#include <dt-bindings/pinctrl/pinctrl-cv1800b.h>
102+
103+
pinctrl@3001000 {
104+
compatible = "sophgo,cv1800b-pinctrl";
105+
reg = <0x03001000 0x1000>,
106+
<0x05027000 0x1000>;
107+
reg-names = "sys", "rtc";
108+
109+
uart0_cfg: uart0-cfg {
110+
uart0-pins {
111+
pinmux = <PINMUX(PIN_UART0_TX, 0)>,
112+
<PINMUX(PIN_UART0_RX, 0)>;
113+
bias-pull-up;
114+
drive-strength-microamp = <10800>;
115+
input-schmitt-microvolt = <0>;
116+
power-source = <3300>;
117+
slew-rate = <0>;
118+
};
119+
};
120+
};
121+
122+
...
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
/* SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause */
2+
/*
3+
* Copyright (C) 2024 Inochi Amaoto <[email protected]>
4+
*
5+
* This file is generated from vendor pinout definition.
6+
*/
7+
8+
#ifndef _DT_BINDINGS_PINCTRL_CV1800B_H
9+
#define _DT_BINDINGS_PINCTRL_CV1800B_H
10+
11+
#include <dt-bindings/pinctrl/pinctrl-cv18xx.h>
12+
13+
#define PIN_AUD_AOUTR 1
14+
#define PIN_SD0_CLK 3
15+
#define PIN_SD0_CMD 4
16+
#define PIN_SD0_D0 5
17+
#define PIN_SD0_D1 7
18+
#define PIN_SD0_D2 8
19+
#define PIN_SD0_D3 9
20+
#define PIN_SD0_CD 11
21+
#define PIN_SD0_PWR_EN 12
22+
#define PIN_SPK_EN 14
23+
#define PIN_UART0_TX 15
24+
#define PIN_UART0_RX 16
25+
#define PIN_SPINOR_HOLD_X 17
26+
#define PIN_SPINOR_SCK 18
27+
#define PIN_SPINOR_MOSI 19
28+
#define PIN_SPINOR_WP_X 20
29+
#define PIN_SPINOR_MISO 21
30+
#define PIN_SPINOR_CS_X 22
31+
#define PIN_IIC0_SCL 23
32+
#define PIN_IIC0_SDA 24
33+
#define PIN_AUX0 25
34+
#define PIN_PWR_VBAT_DET 30
35+
#define PIN_PWR_SEQ2 31
36+
#define PIN_XTAL_XIN 33
37+
#define PIN_SD1_GPIO0 35
38+
#define PIN_SD1_GPIO1 36
39+
#define PIN_SD1_D3 38
40+
#define PIN_SD1_D2 39
41+
#define PIN_SD1_D1 40
42+
#define PIN_SD1_D0 41
43+
#define PIN_SD1_CMD 42
44+
#define PIN_SD1_CLK 43
45+
#define PIN_ADC1 44
46+
#define PIN_USB_VBUS_DET 45
47+
#define PIN_ETH_TXP 47
48+
#define PIN_ETH_TXM 48
49+
#define PIN_ETH_RXP 49
50+
#define PIN_ETH_RXM 50
51+
#define PIN_MIPIRX4N 56
52+
#define PIN_MIPIRX4P 57
53+
#define PIN_MIPIRX3N 58
54+
#define PIN_MIPIRX3P 59
55+
#define PIN_MIPIRX2N 60
56+
#define PIN_MIPIRX2P 61
57+
#define PIN_MIPIRX1N 62
58+
#define PIN_MIPIRX1P 63
59+
#define PIN_MIPIRX0N 64
60+
#define PIN_MIPIRX0P 65
61+
#define PIN_AUD_AINL_MIC 67
62+
63+
#endif /* _DT_BINDINGS_PINCTRL_CV1800B_H */
Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
/* SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause */
2+
/*
3+
* Copyright (C) 2024 Inochi Amaoto <[email protected]>
4+
*
5+
* This file is generated from vendor pinout definition.
6+
*/
7+
8+
#ifndef _DT_BINDINGS_PINCTRL_CV1812H_H
9+
#define _DT_BINDINGS_PINCTRL_CV1812H_H
10+
11+
#include <dt-bindings/pinctrl/pinctrl-cv18xx.h>
12+
13+
#define PINPOS(row, col) \
14+
((((row) - 'A' + 1) << 8) + ((col) - 1))
15+
16+
#define PIN_MIPI_TXM4 PINPOS('A', 2)
17+
#define PIN_MIPIRX0N PINPOS('A', 4)
18+
#define PIN_MIPIRX3P PINPOS('A', 6)
19+
#define PIN_MIPIRX4P PINPOS('A', 7)
20+
#define PIN_VIVO_D2 PINPOS('A', 9)
21+
#define PIN_VIVO_D3 PINPOS('A', 10)
22+
#define PIN_VIVO_D10 PINPOS('A', 12)
23+
#define PIN_USB_VBUS_DET PINPOS('A', 13)
24+
#define PIN_MIPI_TXP3 PINPOS('B', 1)
25+
#define PIN_MIPI_TXM3 PINPOS('B', 2)
26+
#define PIN_MIPI_TXP4 PINPOS('B', 3)
27+
#define PIN_MIPIRX0P PINPOS('B', 4)
28+
#define PIN_MIPIRX1N PINPOS('B', 5)
29+
#define PIN_MIPIRX2N PINPOS('B', 6)
30+
#define PIN_MIPIRX4N PINPOS('B', 7)
31+
#define PIN_MIPIRX5N PINPOS('B', 8)
32+
#define PIN_VIVO_D1 PINPOS('B', 9)
33+
#define PIN_VIVO_D5 PINPOS('B', 10)
34+
#define PIN_VIVO_D7 PINPOS('B', 11)
35+
#define PIN_VIVO_D9 PINPOS('B', 12)
36+
#define PIN_USB_ID PINPOS('B', 13)
37+
#define PIN_ETH_RXM PINPOS('B', 15)
38+
#define PIN_MIPI_TXP2 PINPOS('C', 1)
39+
#define PIN_MIPI_TXM2 PINPOS('C', 2)
40+
#define PIN_CAM_PD0 PINPOS('C', 3)
41+
#define PIN_CAM_MCLK0 PINPOS('C', 4)
42+
#define PIN_MIPIRX1P PINPOS('C', 5)
43+
#define PIN_MIPIRX2P PINPOS('C', 6)
44+
#define PIN_MIPIRX3N PINPOS('C', 7)
45+
#define PIN_MIPIRX5P PINPOS('C', 8)
46+
#define PIN_VIVO_CLK PINPOS('C', 9)
47+
#define PIN_VIVO_D6 PINPOS('C', 10)
48+
#define PIN_VIVO_D8 PINPOS('C', 11)
49+
#define PIN_USB_VBUS_EN PINPOS('C', 12)
50+
#define PIN_ETH_RXP PINPOS('C', 14)
51+
#define PIN_GPIO_RTX PINPOS('C', 15)
52+
#define PIN_MIPI_TXP1 PINPOS('D', 1)
53+
#define PIN_MIPI_TXM1 PINPOS('D', 2)
54+
#define PIN_CAM_MCLK1 PINPOS('D', 3)
55+
#define PIN_IIC3_SCL PINPOS('D', 4)
56+
#define PIN_VIVO_D4 PINPOS('D', 10)
57+
#define PIN_ETH_TXM PINPOS('D', 14)
58+
#define PIN_ETH_TXP PINPOS('D', 15)
59+
#define PIN_MIPI_TXP0 PINPOS('E', 1)
60+
#define PIN_MIPI_TXM0 PINPOS('E', 2)
61+
#define PIN_CAM_PD1 PINPOS('E', 4)
62+
#define PIN_CAM_RST0 PINPOS('E', 5)
63+
#define PIN_VIVO_D0 PINPOS('E', 10)
64+
#define PIN_ADC1 PINPOS('E', 13)
65+
#define PIN_ADC2 PINPOS('E', 14)
66+
#define PIN_ADC3 PINPOS('E', 15)
67+
#define PIN_AUD_AOUTL PINPOS('F', 2)
68+
#define PIN_IIC3_SDA PINPOS('F', 4)
69+
#define PIN_SD1_D2 PINPOS('F', 14)
70+
#define PIN_AUD_AOUTR PINPOS('G', 2)
71+
#define PIN_SD1_D3 PINPOS('G', 13)
72+
#define PIN_SD1_CLK PINPOS('G', 14)
73+
#define PIN_SD1_CMD PINPOS('G', 15)
74+
#define PIN_AUD_AINL_MIC PINPOS('H', 1)
75+
#define PIN_RSTN PINPOS('H', 12)
76+
#define PIN_PWM0_BUCK PINPOS('H', 13)
77+
#define PIN_SD1_D1 PINPOS('H', 14)
78+
#define PIN_SD1_D0 PINPOS('H', 15)
79+
#define PIN_AUD_AINR_MIC PINPOS('J', 1)
80+
#define PIN_IIC2_SCL PINPOS('J', 13)
81+
#define PIN_IIC2_SDA PINPOS('J', 14)
82+
#define PIN_SD0_CD PINPOS('K', 2)
83+
#define PIN_SD0_D1 PINPOS('K', 3)
84+
#define PIN_UART2_RX PINPOS('K', 13)
85+
#define PIN_UART2_CTS PINPOS('K', 14)
86+
#define PIN_UART2_TX PINPOS('K', 15)
87+
#define PIN_SD0_CLK PINPOS('L', 1)
88+
#define PIN_SD0_D0 PINPOS('L', 2)
89+
#define PIN_SD0_CMD PINPOS('L', 3)
90+
#define PIN_CLK32K PINPOS('L', 14)
91+
#define PIN_UART2_RTS PINPOS('L', 15)
92+
#define PIN_SD0_D3 PINPOS('M', 1)
93+
#define PIN_SD0_D2 PINPOS('M', 2)
94+
#define PIN_UART0_RX PINPOS('M', 4)
95+
#define PIN_UART0_TX PINPOS('M', 5)
96+
#define PIN_JTAG_CPU_TRST PINPOS('M', 6)
97+
#define PIN_PWR_ON PINPOS('M', 11)
98+
#define PIN_PWR_GPIO2 PINPOS('M', 12)
99+
#define PIN_PWR_GPIO0 PINPOS('M', 13)
100+
#define PIN_CLK25M PINPOS('M', 14)
101+
#define PIN_SD0_PWR_EN PINPOS('N', 1)
102+
#define PIN_SPK_EN PINPOS('N', 3)
103+
#define PIN_JTAG_CPU_TCK PINPOS('N', 4)
104+
#define PIN_JTAG_CPU_TMS PINPOS('N', 6)
105+
#define PIN_PWR_WAKEUP1 PINPOS('N', 11)
106+
#define PIN_PWR_WAKEUP0 PINPOS('N', 12)
107+
#define PIN_PWR_GPIO1 PINPOS('N', 13)
108+
#define PIN_EMMC_DAT3 PINPOS('P', 1)
109+
#define PIN_EMMC_DAT0 PINPOS('P', 2)
110+
#define PIN_EMMC_DAT2 PINPOS('P', 3)
111+
#define PIN_EMMC_RSTN PINPOS('P', 4)
112+
#define PIN_AUX0 PINPOS('P', 5)
113+
#define PIN_IIC0_SDA PINPOS('P', 6)
114+
#define PIN_PWR_SEQ3 PINPOS('P', 10)
115+
#define PIN_PWR_VBAT_DET PINPOS('P', 11)
116+
#define PIN_PWR_SEQ1 PINPOS('P', 12)
117+
#define PIN_PWR_BUTTON1 PINPOS('P', 13)
118+
#define PIN_EMMC_DAT1 PINPOS('R', 2)
119+
#define PIN_EMMC_CMD PINPOS('R', 3)
120+
#define PIN_EMMC_CLK PINPOS('R', 4)
121+
#define PIN_IIC0_SCL PINPOS('R', 6)
122+
#define PIN_GPIO_ZQ PINPOS('R', 10)
123+
#define PIN_PWR_RSTN PINPOS('R', 11)
124+
#define PIN_PWR_SEQ2 PINPOS('R', 12)
125+
#define PIN_XTAL_XIN PINPOS('R', 13)
126+
127+
#endif /* _DT_BINDINGS_PINCTRL_CV1812H_H */
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/* SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause */
2+
/*
3+
* Copyright (C) 2023 Sophgo Ltd.
4+
*
5+
* Author: Inochi Amaoto <[email protected]>
6+
*/
7+
8+
#ifndef _DT_BINDINGS_PINCTRL_CV18XX_H
9+
#define _DT_BINDINGS_PINCTRL_CV18XX_H
10+
11+
#define PIN_MUX_INVALD 0xff
12+
13+
#define PINMUX2(pin, mux, mux2) \
14+
(((pin) & 0xffff) | (((mux) & 0xff) << 16) | (((mux2) & 0xff) << 24))
15+
16+
#define PINMUX(pin, mux) \
17+
PINMUX2(pin, mux, PIN_MUX_INVALD)
18+
19+
#endif /* _DT_BINDINGS_PINCTRL_CV18XX_H */

0 commit comments

Comments
 (0)