1 /*
2  * Copyright (c) 2023 EPAM Systems
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 #ifndef ZEPHYR_INCLUDE_DT_BINDINGS_PINCTRL_RENESAS_PINCTRL_R8A77961_H_
7 #define ZEPHYR_INCLUDE_DT_BINDINGS_PINCTRL_RENESAS_PINCTRL_R8A77961_H_
8 
9 #include "pinctrl-rcar-common.h"
10 
11 /* Pins declaration */
12 #define PIN_NONE       -1
13 
14 #define PIN_SD0_CLK    RCAR_GP_PIN(3, 0)
15 #define PIN_SD0_CMD    RCAR_GP_PIN(3, 1)
16 #define PIN_SD0_DATA0  RCAR_GP_PIN(3, 2)
17 #define PIN_SD0_DATA1  RCAR_GP_PIN(3, 3)
18 #define PIN_SD0_DATA2  RCAR_GP_PIN(3, 4)
19 #define PIN_SD0_DATA3  RCAR_GP_PIN(3, 5)
20 #define PIN_SD0_CD     RCAR_GP_PIN(3, 12)
21 #define PIN_SD0_WP     RCAR_GP_PIN(3, 13)
22 
23 #define PIN_SD1_CLK    RCAR_GP_PIN(3, 6)
24 #define PIN_SD1_CMD    RCAR_GP_PIN(3, 7)
25 /*
26  * note: the next data pins shared with SD2,
27  *       and for SD2 they represent DATA4-DATA7
28  */
29 #define PIN_SD1_DATA0  RCAR_GP_PIN(3, 8)
30 #define PIN_SD1_DATA1  RCAR_GP_PIN(3, 9)
31 #define PIN_SD1_DATA2  RCAR_GP_PIN(3, 10)
32 #define PIN_SD1_DATA3  RCAR_GP_PIN(3, 11)
33 
34 #define PIN_SD1_CD     RCAR_GP_PIN(3, 14)
35 #define PIN_SD1_WP     RCAR_GP_PIN(3, 15)
36 
37 #define PIN_SD2_CLK    RCAR_GP_PIN(4, 0)
38 #define PIN_SD2_CMD    RCAR_GP_PIN(4,  1)
39 #define PIN_SD2_DATA0  RCAR_GP_PIN(4,  2)
40 #define PIN_SD2_DATA1  RCAR_GP_PIN(4,  3)
41 #define PIN_SD2_DATA2  RCAR_GP_PIN(4,  4)
42 #define PIN_SD2_DATA3  RCAR_GP_PIN(4,  5)
43 #define PIN_SD2_DS     RCAR_GP_PIN(4,  6)
44 
45 #define PIN_SD3_CLK    RCAR_GP_PIN(4,  7)
46 #define PIN_SD3_CMD    RCAR_GP_PIN(4,  8)
47 #define PIN_SD3_DATA0  RCAR_GP_PIN(4,  9)
48 #define PIN_SD3_DATA1  RCAR_GP_PIN(4,  10)
49 #define PIN_SD3_DATA2  RCAR_GP_PIN(4,  11)
50 #define PIN_SD3_DATA3  RCAR_GP_PIN(4,  12)
51 #define PIN_SD3_DATA4  RCAR_GP_PIN(4,  13)
52 #define PIN_SD3_DATA5  RCAR_GP_PIN(4,  14)
53 #define PIN_SD3_DATA6  RCAR_GP_PIN(4,  15)
54 #define PIN_SD3_DATA7  RCAR_GP_PIN(4,  16)
55 #define PIN_SD3_DS     RCAR_GP_PIN(4,  17)
56 
57 #define PIN_TX2_A      RCAR_GP_PIN(5, 10)
58 #define PIN_RX2_A      RCAR_GP_PIN(5, 11)
59 
60 /* Pinmux function declarations */
61 #define FUNC_SD0_CLK   IPSR(7, 12, 0)
62 #define FUNC_SD0_CMD   IPSR(7, 16, 0)
63 #define FUNC_SD0_DAT0  IPSR(7, 20, 0)
64 #define FUNC_SD0_DAT1  IPSR(7, 24, 0)
65 #define FUNC_SD0_DAT2  IPSR(8, 0, 0)
66 #define FUNC_SD0_DAT3  IPSR(8, 4, 0)
67 #define FUNC_SD0_CD    IPSR(11, 8, 0)
68 #define FUNC_SD0_WP    IPSR(11, 12, 0)
69 
70 #define FUNC_SD1_CLK   IPSR(8, 8, 0)
71 #define FUNC_SD1_CMD   IPSR(8, 12, 0)
72 #define FUNC_SD1_DAT0  IPSR(8, 16, 0)
73 #define FUNC_SD1_DAT1  IPSR(8, 20, 0)
74 #define FUNC_SD1_DAT2  IPSR(8, 24, 0)
75 #define FUNC_SD1_DAT3  IPSR(8, 28, 0)
76 #define FUNC_SD1_CD    IPSR(11, 16, 0)
77 #define FUNC_SD1_WP    IPSR(11, 20, 0)
78 
79 #define FUNC_SD2_CLK   IPSR(9, 0, 0)
80 #define FUNC_SD2_CMD   IPSR(9, 4, 0)
81 #define FUNC_SD2_DAT0  IPSR(9, 8, 0)
82 #define FUNC_SD2_DAT1  IPSR(9, 12, 0)
83 #define FUNC_SD2_DAT2  IPSR(9, 16, 0)
84 #define FUNC_SD2_DAT3  IPSR(9, 20, 0)
85 #define FUNC_SD2_DAT4  IPSR(8, 16, 1)
86 #define FUNC_SD2_DAT5  IPSR(8, 20, 1)
87 #define FUNC_SD2_DAT6  IPSR(8, 24, 1)
88 #define FUNC_SD2_DAT7  IPSR(8, 28, 1)
89 #define FUNC_SD2_CD_A  IPSR(10, 20, 1)
90 #define FUNC_SD2_WP_A  IPSR(10, 24, 1)
91 #define FUNC_SD2_CD_B  IPSR(13, 0, 3)
92 #define FUNC_SD2_WP_B  IPSR(13, 4, 3)
93 #define FUNC_SD2_DS    IPSR(9, 24, 0)
94 
95 #define FUNC_SD3_CLK   IPSR(9, 28, 0)
96 #define FUNC_SD3_CMD   IPSR(10, 0, 0)
97 #define FUNC_SD3_DAT0  IPSR(10, 4, 0)
98 #define FUNC_SD3_DAT1  IPSR(10, 8, 0)
99 #define FUNC_SD3_DAT2  IPSR(10, 12, 0)
100 #define FUNC_SD3_DAT3  IPSR(10, 16, 0)
101 #define FUNC_SD3_DAT4  IPSR(10, 20, 0)
102 #define FUNC_SD3_DAT5  IPSR(10, 24, 0)
103 #define FUNC_SD3_DAT6  IPSR(10, 28, 0)
104 #define FUNC_SD3_DAT7  IPSR(11, 0, 0)
105 #define FUNC_SD3_CD    IPSR(10, 28, 1)
106 #define FUNC_SD3_WP    IPSR(11, 0, 1)
107 #define FUNC_SD3_DS    IPSR(11, 4, 0)
108 
109 #define FUNC_TX2_A     IPSR(13, 0, 0)
110 #define FUNC_RX2_A     IPSR(13, 4, 0)
111 
112 #endif /* ZEPHYR_INCLUDE_DT_BINDINGS_PINCTRL_RENESAS_PINCTRL_R8A77961_H_ */
113