Skip to contentSkip to conversation

ARC: HSDK: add platform-specific stuff

PATCH New Eugeniy Paltsev 3 participants 7 messages Mar 26, 2018 – Apr 2, 2018 Synopsys ARC architecture

lore
Share & tools
lore
#0 lore raw

v2 cover ARC: HSDK: add platform-specific stuff

Add hsdk-specific commands.
Enable spi flash support for hsdk board.

Changes v1->v2:
* Mobe spi flash enable to separate patch.

Eugeniy Paltsev (2):
ARC: HSDK: add platform-specific commands
ARC: HSDK: enable spi flash support

 arch/arc/dts/hsdk.dts           |   56 +++
 arch/arc/dts/hsdk.dts.back      |  112 +++++
 board/synopsys/hsdk/MAINTAINERS |    4 +-
 board/synopsys/hsdk/Makefile    |    2 +
 board/synopsys/hsdk/clk-lib.c   |   75 +++
 board/synopsys/hsdk/clk-lib.h   |   38 ++
 board/synopsys/hsdk/env-lib.c   |  302 +++++++++++
 board/synopsys/hsdk/env-lib.h   |   58 +++
 board/synopsys/hsdk/hsdk.c      | 1046 +++++++++++++++++++++++++++++++++++++--
 configs/hsdk_defconfig          |   14 +
 configs/hsdk_defconfig.back     |   56 +++
 include/configs/hsdk.h          |   56 ++-
 12 files changed, 1768 insertions(+), 51 deletions(-)
 create mode 100644 arch/arc/dts/hsdk.dts.back
 create mode 100644 board/synopsys/hsdk/clk-lib.c
 create mode 100644 board/synopsys/hsdk/clk-lib.h
 create mode 100644 board/synopsys/hsdk/env-lib.c
 create mode 100644 board/synopsys/hsdk/env-lib.h
 create mode 100644 configs/hsdk_defconfig.back
Signature · 1 line
2.14.3
#1 lore raw

PATCH v2 1/2 ARC: HSDK: add platform-specific commands

This patch add support of hsdk platform-specific commands:

hsdk_clock set - set clock from axi_freq, cpu_freq and tun_freq environment variables/command line arguments

hsdk_clock get - save clock frequencies to axi_freq, cpu_freq and tun_freq environment variables

hsdk_clock print - show CPU, AXI, DDR and TUNNEL current clock frequencies.

hsdk_clock print_all - show all currently used clock frequencies.

hsdk_init - setup board HW in one of pre-defined configuration (hsdk_hs34 / hsdk_hs36 / hsdk_hs36_ccm / hsdk_hs38 / hsdk_hs38_ccm / hsdk_hs38x2 / hsdk_hs38x3 / hsdk_hs38x4)

hsdk_go - run baremetal application on hsdk configured by hsdk_init command.

This patch changes default behaviour of 'bootm' command:
now we are able to set number of CPUs to be kicked by setting 'core_mask' environment variable before 'bootm' command run.

---
 arch/arc/dts/hsdk.dts           |   30 ++
 board/synopsys/hsdk/MAINTAINERS |    4 +-
 board/synopsys/hsdk/Makefile    |    2 +
 board/synopsys/hsdk/clk-lib.c   |   75 +++
 board/synopsys/hsdk/clk-lib.h   |   38 ++
 board/synopsys/hsdk/env-lib.c   |  302 +++++++++++
 board/synopsys/hsdk/env-lib.h   |   58 +++
 board/synopsys/hsdk/hsdk.c      | 1046 +++++++++++++++++++++++++++++++++++++--
 configs/hsdk_defconfig          |    4 +
 include/configs/hsdk.h          |   56 ++-
 10 files changed, 1564 insertions(+), 51 deletions(-)
 create mode 100644 board/synopsys/hsdk/clk-lib.c
 create mode 100644 board/synopsys/hsdk/clk-lib.h
 create mode 100644 board/synopsys/hsdk/env-lib.c
 create mode 100644 board/synopsys/hsdk/env-lib.h
arch/arc/dts/hsdk.dts +30 -0
index 67dfb93ca8..09f3fe9a37 100644
@@ -6,6 +6,7 @@
 /dts-v1/;
 
 #include "skeleton.dtsi"
+#include "dt-bindings/clock/snps,hsdk-cgu.h"
 
 / {
 	#address-cells = <1>;
@@ -24,6 +25,35 @@
 		};
 	};
 
+	clk-fmeas {
+		clocks = <&cgu_clk CLK_ARC_PLL>, <&cgu_clk CLK_SYS_PLL>,
+			 <&cgu_clk CLK_TUN_PLL>, <&cgu_clk CLK_DDR_PLL>,
+			 <&cgu_clk CLK_ARC>, <&cgu_clk CLK_HDMI_PLL>,
+			 <&cgu_clk CLK_TUN_TUN>, <&cgu_clk CLK_HDMI>,
+			 <&cgu_clk CLK_SYS_APB>, <&cgu_clk CLK_SYS_AXI>,
+			 <&cgu_clk CLK_SYS_ETH>, <&cgu_clk CLK_SYS_USB>,
+			 <&cgu_clk CLK_SYS_SDIO>, <&cgu_clk CLK_SYS_HDMI>,
+			 <&cgu_clk CLK_SYS_GFX_CORE>, <&cgu_clk CLK_SYS_GFX_DMA>,
+			 <&cgu_clk CLK_SYS_GFX_CFG>, <&cgu_clk CLK_SYS_DMAC_CORE>,
+			 <&cgu_clk CLK_SYS_DMAC_CFG>, <&cgu_clk CLK_SYS_SDIO_REF>,
+			 <&cgu_clk CLK_SYS_SPI_REF>, <&cgu_clk CLK_SYS_I2C_REF>,
+			 <&cgu_clk CLK_SYS_UART_REF>, <&cgu_clk CLK_SYS_EBI_REF>,
+			 <&cgu_clk CLK_TUN_ROM>, <&cgu_clk CLK_TUN_PWM>;
+		clock-names = "cpu-pll", "sys-pll",
+			      "tun-pll", "ddr-clk",
+			      "cpu-clk", "hdmi-pll",
+			      "tun-clk", "hdmi-clk",
+			      "apb-clk", "axi-clk",
+			      "eth-clk", "usb-clk",
+			      "sdio-clk", "hdmi-sys-clk",
+			      "gfx-core-clk", "gfx-dma-clk",
+			      "gfx-cfg-clk", "dmac-core-clk",
+			      "dmac-cfg-clk", "sdio-ref-clk",
+			      "spi-clk", "i2c-clk",
+			      "uart-clk", "ebi-clk",
+			      "rom-clk", "pwm-clk";
+	};
+
 	cgu_clk: cgu-clk at f0000000 {
 		compatible = "snps,hsdk-cgu-clock";
 		reg = <0xf0000000 0x10>, <0xf00014B8 0x4>;
board/synopsys/hsdk/MAINTAINERS +2 -2
index d034bc479d..e22bd1e40b 100644
@@ -1,5 +1,5 @@
-AXS10X BOARD
-M:	Alexey Brodkin <[email protected]>
+HSDK BOARD
+M:	Eugeniy Paltsev <[email protected]>
 S:	Maintained
 F:	board/synopsys/hsdk/
 F:	configs/hsdk_defconfig
board/synopsys/hsdk/Makefile +2 -0
index d84dd03265..7ecff3d740 100644
@@ -5,3 +5,5 @@
 #
 
 obj-y	+= hsdk.o
+obj-y	+= env-lib.o
+obj-y	+= clk-lib.o
board/synopsys/hsdk/clk-lib.c new file +75 -0

75 lines not on this page · raw message

board/synopsys/hsdk/clk-lib.h new file +38 -0
new file mode 100644
index 0000000000..3b7dbc58ae
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2018 Synopsys, Inc. All rights reserved.
+ * Author: Eugeniy Paltsev <[email protected]>
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#ifndef __BOARD_CLK_LIB_H
+#define __BOARD_CLK_LIB_H
+
+#include <common.h>
+
+enum clk_ctl_ops {
+	CLK_SET		= BIT(0), /* set frequency */
+	CLK_GET		= BIT(1), /* get frequency */
+	CLK_ON		= BIT(2), /* enable clock */
+	CLK_OFF		= BIT(3), /* disable clock */
+	CLK_PRINT	= BIT(4), /* print frequency */
+	CLK_MHZ		= BIT(5)  /* all values in MHZ instead of HZ */
+};
+
+/*
+ * Depending on the clk_ctl_ops enable / disable /
+ * set clock rate from 'rate' argument / read clock to 'rate' argument /
+ * print clock rate. If CLK_MHZ flag set in clk_ctl_ops 'rate' is in MHz,
+ * otherwise - in Hz.
+ *
+ * This function expects "clk-fmeas" node in device tree:
+ * / {
+ *	clk-fmeas {
+ *		clocks = <&cpu_pll>, <&sys_pll>;
+ *		clock-names = "cpu-pll", "sys-pll";
+ *	};
+ * };
+ */
+int soc_clk_ctl(const char *name, ulong *rate, enum clk_ctl_ops ctl);
+
+#endif /* __BOARD_CLK_LIB_H */
board/synopsys/hsdk/env-lib.c new file +302 -0

302 lines not on this page · raw message

board/synopsys/hsdk/env-lib.h new file +58 -0

58 lines not on this page · raw message

board/synopsys/hsdk/hsdk.c +1000 -46

1,094 lines not on this page · raw message

configs/hsdk_defconfig +4 -0
index 11cb7e03a6..c72ee2d0c1 100644
@@ -7,13 +7,16 @@ CONFIG_DEFAULT_DEVICE_TREE="hsdk"
 CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyS0,115200n8"
 CONFIG_BOARD_EARLY_INIT_F=y
+CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="hsdk# "
+CONFIG_CMD_ENV_FLAGS=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_MMC=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_PING=y
+CONFIG_CMD_CACHE=y
 CONFIG_CMD_EXT2=y
 CONFIG_CMD_EXT4=y
 CONFIG_CMD_EXT4_WRITE=y
@@ -25,6 +28,7 @@ CONFIG_ENV_FAT_INTERFACE="mmc"
 CONFIG_ENV_FAT_DEVICE_AND_PART="0:1"
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DM=y
+CONFIG_CLK_HSDK=y
 CONFIG_MMC=y
 CONFIG_MMC_DW=y
 CONFIG_DM_ETH=y
include/configs/hsdk.h +53 -3

77 lines not on this page · raw message

Signature · 1 line
2.14.3
#2 lore raw

PATCH v2 1/2 ARC: HSDK: add platform-specific commands

Hi Tom,

Quoted 20 lines · Eugeniy Paltsev

This patch add support of hsdk platform-specific commands:

hsdk_clock set - set clock from axi_freq, cpu_freq and tun_freq environment variables/command line arguments

hsdk_clock get - save clock frequencies to axi_freq, cpu_freq and tun_freq environment variables

hsdk_clock print - show CPU, AXI, DDR and TUNNEL current clock frequencies.

hsdk_clock print_all - show all currently used clock frequencies.

hsdk_init - setup board HW in one of pre-defined configuration (hsdk_hs34 / hsdk_hs36 / hsdk_hs36_ccm / hsdk_hs38 / hsdk_hs38_ccm / hsdk_hs38x2 / hsdk_hs38x3 / hsdk_hs38x4)

hsdk_go - run baremetal application on hsdk configured by hsdk_init command.

Quoted 6 lines

This patch changes default behaviour of 'bootm' command:
now we are able to set number of CPUs to be kicked by setting 'core_mask' environment variable before 'bootm' command run.

---

I was about to send you a pull-request containing this one but decided to give TravisCI a shot. And what I got was a warning due to not yet supported "naked" attribute in GCC 6.x for ARC, see https://travis-ci.org/abrodkin/u-boot/jobs/360259472

Ok I bumped ARC tools to the most recent arc-2017.09 based on
GCC 7.1 where "naked" attr for ARC is already supported.
But then I got another warning:
--------------------->8-----------------------
board/synopsys/hsdk/hsdk.c: In function "hsdk_core_init_f":
board/synopsys/hsdk/hsdk.c:345:1: error: stack usage computation not supported for this target [-Werror]
}
^
--------------------->8-----------------------
see https://travis-ci.org/abrodkin/u-boot/jobs/360274604

That happens because GCC for ARC unconditionally tries to compute stack requirements for all functions even if they are "naked". And for "naked" computed value is negative thus the warning above.

So far I didn't manage to find a simple way to disable that warning.

And my question would be how to proceed with this [patch]? Given we're seeing a problem in GCC it most probably won't be fixed in U-Boot and we'll need to wait before new tools are available.

Or otherwise we'll start to see "failing" ARC jobs in TravisCI.

-Alexey

#3 lore raw

PATCH v2 1/2 ARC: HSDK: add platform-specific commands

Quoted 51 lines · Alexey Brodkin

Hi Tom,

Quoted 20 lines · Eugeniy Paltsev

This patch add support of hsdk platform-specific commands:

hsdk_clock set - set clock from axi_freq, cpu_freq and tun_freq environment variables/command line arguments

hsdk_clock get - save clock frequencies to axi_freq, cpu_freq and tun_freq environment variables

hsdk_clock print - show CPU, AXI, DDR and TUNNEL current clock frequencies.

hsdk_clock print_all - show all currently used clock frequencies.

hsdk_init - setup board HW in one of pre-defined configuration (hsdk_hs34 / hsdk_hs36 / hsdk_hs36_ccm / hsdk_hs38 / hsdk_hs38_ccm / hsdk_hs38x2 / hsdk_hs38x3 / hsdk_hs38x4)

hsdk_go - run baremetal application on hsdk configured by hsdk_init command.

Quoted 6 lines

This patch changes default behaviour of 'bootm' command:
now we are able to set number of CPUs to be kicked by setting 'core_mask' environment variable before 'bootm' command run.

---

I was about to send you a pull-request containing this one but decided to give TravisCI a shot. And what I got was a warning due to not yet supported "naked" attribute in GCC 6.x for ARC, see https://travis-ci.org/abrodkin/u-boot/jobs/360259472

Ok I bumped ARC tools to the most recent arc-2017.09 based on
GCC 7.1 where "naked" attr for ARC is already supported.
But then I got another warning:
--------------------->8-----------------------
board/synopsys/hsdk/hsdk.c: In function "hsdk_core_init_f":
board/synopsys/hsdk/hsdk.c:345:1: error: stack usage computation not supported for this target [-Werror]
}
^
--------------------->8-----------------------
see https://travis-ci.org/abrodkin/u-boot/jobs/360274604

That happens because GCC for ARC unconditionally tries to compute stack requirements for all functions even if they are "naked". And for "naked" computed value is negative thus the warning above.

Quoted 7 lines

So far I didn't manage to find a simple way to disable that warning.

And my question would be how to proceed with this [patch]? Given we're seeing a problem in GCC it most probably won't be fixed in U-Boot and we'll need to wait before new tools are available.

Or otherwise we'll start to see "failing" ARC jobs in TravisCI.

Ugh. (a) get the toolchain fixed to support this correctly and (b) kludge scripts/gcc-stack-usage.sh to have a 'naked' example too so that we'll just disable -fstack-usage on ARC for now.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180401/f857ef44/attachment.sig>
#4 lore raw

PATCH v2 2/2 ARC: HSDK: enable spi flash support

In reply to Eugeniy Paltsev

HSDK board has sst26wf016 spi flash IC which we want to support.

Add SPI controller, CS-gpio and SPI flash nodes to hsdk device tree. Enable corresponding options in hsdk defconfig.

---
 arch/arc/dts/hsdk.dts  | 26 ++++++++++++++++++++++++++
 configs/hsdk_defconfig |  9 +++++++++
 2 files changed, 35 insertions(+)
arch/arc/dts/hsdk.dts +26 -0
index 09f3fe9a37..4bb3035d53 100644
@@ -14,6 +14,7 @@
 
 	aliases {
 		console = &uart0;
+		spi0 = &spi0;
 	};
 
 	cpu_card {
@@ -83,4 +84,29 @@
 		compatible = "generic-ohci";
 		reg = <0xf0060000 0x100>;
 	};
+
+	spi0: spi at f0020000 {
+		compatible = "snps,dw-apb-ssi";
+		reg = <0xf0020000 0x1000>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+		spi-max-frequency = <4000000>;
+		clocks = <&cgu_clk CLK_SYS_SPI_REF>;
+		clock-names = "spi_clk";
+		cs-gpio = <&cs_gpio 0>;
+		spi_flash at 0 {
+			compatible = "spi-flash";
+			reg = <0>;
+			spi-max-frequency = <4000000>;
+		};
+	};
+
+	cs_gpio: gpio at f00114B0 {
+		compatible = "snps,hsdk-creg-gpio";
+		reg = <0xf00014B0 0x4>;
+		gpio-controller;
+		#gpio-cells = <1>;
+		gpio-bank-name = "hsdk-spi-cs";
+		gpio-count = <1>;
+	};
 };
configs/hsdk_defconfig +9 -0
index c72ee2d0c1..476ce6a974 100644
@@ -12,6 +12,8 @@ CONFIG_SYS_PROMPT="hsdk# "
 CONFIG_CMD_ENV_FLAGS=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_MMC=y
+CONFIG_CMD_SF=y
+CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_DHCP=y
@@ -29,12 +31,19 @@ CONFIG_ENV_FAT_DEVICE_AND_PART="0:1"
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DM=y
 CONFIG_CLK_HSDK=y
+CONFIG_DM_GPIO=y
+CONFIG_HSDK_CREG_GPIO=y
 CONFIG_MMC=y
 CONFIG_MMC_DW=y
+CONFIG_DM_SPI_FLASH=y
+CONFIG_SPI_FLASH=y
+CONFIG_SPI_FLASH_SST=y
 CONFIG_DM_ETH=y
 CONFIG_ETH_DESIGNWARE=y
 CONFIG_DM_SERIAL=y
 CONFIG_SYS_NS16550=y
+CONFIG_DM_SPI=y
+CONFIG_DESIGNWARE_SPI=y
 CONFIG_USB=y
 CONFIG_DM_USB=y
 CONFIG_USB_EHCI_HCD=y
Signature · 1 line
2.14.3
#5 lore raw

PATCH v2 2/2 ARC: HSDK: enable spi flash support

Hi Eugeniy,

Quoted 6 lines · Eugeniy Paltsev

HSDK board has sst26wf016 spi flash IC which we want to support.

Add SPI controller, CS-gpio and SPI flash nodes to hsdk device tree. Enable corresponding options in hsdk defconfig.

IMHO it worth adding a mention about dependency on SST flash patches. Also I'd add justification to GPIO addition in defconfig.

Quoted 29 lines
---
 arch/arc/dts/hsdk.dts  | 26 ++++++++++++++++++++++++++
 configs/hsdk_defconfig |  9 +++++++++
 2 files changed, 35 insertions(+)
arch/arc/dts/hsdk.dts +9 -0
index 09f3fe9a37..4bb3035d53 100644
@@ -14,6 +14,7 @@
 
 	aliases {
 		console = &uart0;
+		spi0 = &spi0;
 	};
 
 	cpu_card {
@@ -83,4 +84,29 @@
 		compatible = "generic-ohci";
 		reg = <0xf0060000 0x100>;
 	};
+
+	spi0: spi at f0020000 {
+		compatible = "snps,dw-apb-ssi";
+		reg = <0xf0020000 0x1000>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+		spi-max-frequency = <4000000>;
+		clocks = <&cgu_clk CLK_SYS_SPI_REF>;

arch/arc/dts/hsdk.dts line 104

Quoted 10 lines
arch/arc/dts/hsdk.dts +10 -0
+		clock-names = "spi_clk";
+		cs-gpio = <&cs_gpio 0>;
+		spi_flash at 0 {
+			compatible = "spi-flash";
+			reg = <0>;
+			spi-max-frequency = <4000000>;
+		};
+	};
+
+	cs_gpio: gpio at f00114B0 {

Hm "reg" value doesn't match node name: f00114B0 vs f00014B0. Which one is correct?

Quoted 31 lines
arch/arc/dts/hsdk.dts +7 -0
+		compatible = "snps,hsdk-creg-gpio";
+		reg = <0xf00014B0 0x4>;
+		gpio-controller;
+		#gpio-cells = <1>;
+		gpio-bank-name = "hsdk-spi-cs";
+		gpio-count = <1>;
+	};
 };
configs/hsdk_defconfig +6 -0
index c72ee2d0c1..476ce6a974 100644
@@ -12,6 +12,8 @@ CONFIG_SYS_PROMPT="hsdk# "
 CONFIG_CMD_ENV_FLAGS=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_MMC=y
+CONFIG_CMD_SF=y
+CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_DHCP=y
@@ -29,12 +31,19 @@ CONFIG_ENV_FAT_DEVICE_AND_PART="0:1"
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DM=y
 CONFIG_CLK_HSDK=y
+CONFIG_DM_GPIO=y
+CONFIG_HSDK_CREG_GPIO=y
 CONFIG_MMC=y
 CONFIG_MMC_DW=y
+CONFIG_DM_SPI_FLASH=y
+CONFIG_SPI_FLASH=y

configs/hsdk_defconfig CONFIG_ENV_FAT_DEVICE_AND_PART="0:1" · line 49

Quoted 10 lines
configs/hsdk_defconfig +3 -0
+CONFIG_SPI_FLASH_SST=y
 CONFIG_DM_ETH=y
 CONFIG_ETH_DESIGNWARE=y
 CONFIG_DM_SERIAL=y
 CONFIG_SYS_NS16550=y
+CONFIG_DM_SPI=y
+CONFIG_DESIGNWARE_SPI=y
 CONFIG_USB=y
 CONFIG_DM_USB=y
 CONFIG_USB_EHCI_HCD=y

-Alexey

#6 lore raw

PATCH v2 2/2 ARC: HSDK: enable spi flash support

Quoted 47 lines · Alexey Brodkin

Hi Eugeniy,

Quoted 6 lines · Eugeniy Paltsev

HSDK board has sst26wf016 spi flash IC which we want to support.

Add SPI controller, CS-gpio and SPI flash nodes to hsdk device tree. Enable corresponding options in hsdk defconfig.

IMHO it worth adding a mention about dependency on SST flash patches. Also I'd add justification to GPIO addition in defconfig.

Quoted 34 lines
---
 arch/arc/dts/hsdk.dts  | 26 ++++++++++++++++++++++++++
 configs/hsdk_defconfig |  9 +++++++++
 2 files changed, 35 insertions(+)
arch/arc/dts/hsdk.dts +14 -0
index 09f3fe9a37..4bb3035d53 100644
@@ -14,6 +14,7 @@
 
 	aliases {
 		console = &uart0;
+		spi0 = &spi0;
 	};
 
 	cpu_card {
@@ -83,4 +84,29 @@
 		compatible = "generic-ohci";
 		reg = <0xf0060000 0x100>;
 	};
+
+	spi0: spi at f0020000 {
+		compatible = "snps,dw-apb-ssi";
+		reg = <0xf0020000 0x1000>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+		spi-max-frequency = <4000000>;
+		clocks = <&cgu_clk CLK_SYS_SPI_REF>;
+		clock-names = "spi_clk";
+		cs-gpio = <&cs_gpio 0>;
+		spi_flash at 0 {
+			compatible = "spi-flash";
+			reg = <0>;
Quoted 8 lines

arch/arc/dts/hsdk.dts line 104

Quoted 5 lines
arch/arc/dts/hsdk.dts +5 -0
+			spi-max-frequency = <4000000>;
+		};
+	};
+
+	cs_gpio: gpio at f00114B0 {

Hm "reg" value doesn't match node name: f00114B0 vs f00014B0. Which one is correct?

"reg" value is correct.
So node name should be:
------------->8--------------
cs_gpio: gpio at f00014b0 {
------------->8--------------

Quoted 43 lines
Quoted 31 lines
arch/arc/dts/hsdk.dts +7 -0
+		compatible = "snps,hsdk-creg-gpio";
+		reg = <0xf00014B0 0x4>;
+		gpio-controller;
+		#gpio-cells = <1>;
+		gpio-bank-name = "hsdk-spi-cs";
+		gpio-count = <1>;
+	};
 };
configs/hsdk_defconfig +6 -0
index c72ee2d0c1..476ce6a974 100644
@@ -12,6 +12,8 @@ CONFIG_SYS_PROMPT="hsdk# "
 CONFIG_CMD_ENV_FLAGS=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_MMC=y
+CONFIG_CMD_SF=y
+CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_DHCP=y
@@ -29,12 +31,19 @@ CONFIG_ENV_FAT_DEVICE_AND_PART="0:1"
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DM=y
 CONFIG_CLK_HSDK=y
+CONFIG_DM_GPIO=y
+CONFIG_HSDK_CREG_GPIO=y
 CONFIG_MMC=y
 CONFIG_MMC_DW=y
+CONFIG_DM_SPI_FLASH=y
+CONFIG_SPI_FLASH=y

configs/hsdk_defconfig CONFIG_ENV_FAT_DEVICE_AND_PART="0:1" · line 49

Quoted 10 lines
configs/hsdk_defconfig +3 -0
+CONFIG_SPI_FLASH_SST=y
 CONFIG_DM_ETH=y
 CONFIG_ETH_DESIGNWARE=y
 CONFIG_DM_SERIAL=y
 CONFIG_SYS_NS16550=y
+CONFIG_DM_SPI=y
+CONFIG_DESIGNWARE_SPI=y
 CONFIG_USB=y
 CONFIG_DM_USB=y
 CONFIG_USB_EHCI_HCD=y

-Alexey

Signature · 1 line
 Eugeniy Paltsev