boards: arc: hsdk: add creg_gpio driver support
Add creg_gpio driver support for hsdk board.
Signed-off-by: Watson Zeng <zhiwei@synopsys.com>
diff --git a/boards/arc/hsdk/Kconfig.defconfig b/boards/arc/hsdk/Kconfig.defconfig
index 6be6ecd..967aa77 100644
--- a/boards/arc/hsdk/Kconfig.defconfig
+++ b/boards/arc/hsdk/Kconfig.defconfig
@@ -39,6 +39,9 @@
config SPI_DW_ACCESS_WORD_ONLY
default y
+config GPIO_SNPS_CREG
+ default y
+
endif # SPI_DW
endif # SPI
diff --git a/boards/arc/hsdk/hsdk.dtsi b/boards/arc/hsdk/hsdk.dtsi
index 3575ab3..f833ed8 100644
--- a/boards/arc/hsdk/hsdk.dtsi
+++ b/boards/arc/hsdk/hsdk.dtsi
@@ -86,19 +86,33 @@
interrupts = <56 1>;
};
+&creg_gpio {
+ status = "okay";
+};
+
&spi0 {
status = "okay";
clock-frequency = <33333333>;
+ cs-gpios = <&creg_gpio 0 GPIO_ACTIVE_HIGH>,
+ <&creg_gpio 1 GPIO_ACTIVE_HIGH>,
+ <&creg_gpio 2 GPIO_ACTIVE_HIGH>,
+ <&creg_gpio 3 GPIO_ACTIVE_HIGH>;
};
&spi1 {
status = "okay";
clock-frequency = <33333333>;
+ cs-gpios = <&creg_gpio 4 GPIO_ACTIVE_HIGH>,
+ <&creg_gpio 5 GPIO_ACTIVE_HIGH>,
+ <&creg_gpio 6 GPIO_ACTIVE_HIGH>;
};
&spi2 {
status = "okay";
clock-frequency = <33333333>;
+ cs-gpios = <&creg_gpio 8 GPIO_ACTIVE_HIGH>,
+ <&creg_gpio 9 GPIO_ACTIVE_HIGH>,
+ <&creg_gpio 10 GPIO_ACTIVE_HIGH>;
};
&i2c0 {
diff --git a/dts/arc/arc_hsdk.dtsi b/dts/arc/arc_hsdk.dtsi
index 8c6f4aa..147aefa 100644
--- a/dts/arc/arc_hsdk.dtsi
+++ b/dts/arc/arc_hsdk.dtsi
@@ -122,6 +122,21 @@
status = "disabled";
};
+ creg_gpio: creg_gpio@f00014b0 {
+ compatible = "snps,creg-gpio";
+ reg = <0xf00014b0 0x4>;
+ ngpios = <12>;
+ label = "CREG_GPIO";
+ bit_per_gpio = <2>;
+ off_val = <0>;
+ on_val = <2>;
+
+ gpio-controller;
+ #gpio-cells = <2>;
+
+ status = "disabled";
+ };
+
i2c0: i2c@f0023000 {
compatible = "snps,designware-i2c";
clock-frequency = <I2C_BITRATE_STANDARD>;