From 79f5be006ec88665c7da2680e89bd0200d4426be Mon Sep 17 00:00:00 2001 From: Watson Zeng Date: Tue, 29 Jun 2021 14:57:46 +0800 Subject: [PATCH] boards: arc: hsdk: add creg_gpio driver support Add creg_gpio driver support for hsdk board. Signed-off-by: Watson Zeng --- boards/arc/hsdk/Kconfig.defconfig | 3 +++ boards/arc/hsdk/hsdk.dtsi | 14 ++++++++++++++ dts/arc/arc_hsdk.dtsi | 15 +++++++++++++++ 3 files changed, 32 insertions(+) diff --git a/boards/arc/hsdk/Kconfig.defconfig b/boards/arc/hsdk/Kconfig.defconfig index 6be6ecdaea9..967aa77e7e1 100644 --- a/boards/arc/hsdk/Kconfig.defconfig +++ b/boards/arc/hsdk/Kconfig.defconfig @@ -39,6 +39,9 @@ config SPI_DW_ARC_AUX_REGS 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 3575ab320e4..f833ed877bc 100644 --- a/boards/arc/hsdk/hsdk.dtsi +++ b/boards/arc/hsdk/hsdk.dtsi @@ -86,19 +86,33 @@ arduino_spi: &spi2 {}; 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 8c6f4aa78b4..147aefa88cd 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 = ;