Skip to content
This repository was archived by the owner on Dec 26, 2023. It is now read-only.

Commit 79f5be0

Browse files
IRISZZWcfriedt
authored andcommittedJul 13, 2021
boards: arc: hsdk: add creg_gpio driver support
Add creg_gpio driver support for hsdk board. Signed-off-by: Watson Zeng <[email protected]>
1 parent 1103402 commit 79f5be0

File tree

3 files changed

+32
-0
lines changed

3 files changed

+32
-0
lines changed
 

‎boards/arc/hsdk/Kconfig.defconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ config SPI_DW_ARC_AUX_REGS
3939
config SPI_DW_ACCESS_WORD_ONLY
4040
default y
4141

42+
config GPIO_SNPS_CREG
43+
default y
44+
4245
endif # SPI_DW
4346

4447
endif # SPI

‎boards/arc/hsdk/hsdk.dtsi

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,19 +86,33 @@ arduino_spi: &spi2 {};
8686
interrupts = <56 1>;
8787
};
8888

89+
&creg_gpio {
90+
status = "okay";
91+
};
92+
8993
&spi0 {
9094
status = "okay";
9195
clock-frequency = <33333333>;
96+
cs-gpios = <&creg_gpio 0 GPIO_ACTIVE_HIGH>,
97+
<&creg_gpio 1 GPIO_ACTIVE_HIGH>,
98+
<&creg_gpio 2 GPIO_ACTIVE_HIGH>,
99+
<&creg_gpio 3 GPIO_ACTIVE_HIGH>;
92100
};
93101

94102
&spi1 {
95103
status = "okay";
96104
clock-frequency = <33333333>;
105+
cs-gpios = <&creg_gpio 4 GPIO_ACTIVE_HIGH>,
106+
<&creg_gpio 5 GPIO_ACTIVE_HIGH>,
107+
<&creg_gpio 6 GPIO_ACTIVE_HIGH>;
97108
};
98109

99110
&spi2 {
100111
status = "okay";
101112
clock-frequency = <33333333>;
113+
cs-gpios = <&creg_gpio 8 GPIO_ACTIVE_HIGH>,
114+
<&creg_gpio 9 GPIO_ACTIVE_HIGH>,
115+
<&creg_gpio 10 GPIO_ACTIVE_HIGH>;
102116
};
103117

104118
&i2c0 {

‎dts/arc/arc_hsdk.dtsi

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,21 @@
122122
status = "disabled";
123123
};
124124

125+
creg_gpio: creg_gpio@f00014b0 {
126+
compatible = "snps,creg-gpio";
127+
reg = <0xf00014b0 0x4>;
128+
ngpios = <12>;
129+
label = "CREG_GPIO";
130+
bit_per_gpio = <2>;
131+
off_val = <0>;
132+
on_val = <2>;
133+
134+
gpio-controller;
135+
#gpio-cells = <2>;
136+
137+
status = "disabled";
138+
};
139+
125140
i2c0: i2c@f0023000 {
126141
compatible = "snps,designware-i2c";
127142
clock-frequency = <I2C_BITRATE_STANDARD>;

0 commit comments

Comments
 (0)
This repository has been archived.