From 8aec9dd552bf0c09e07e07a34227af60a9cbfdda Mon Sep 17 00:00:00 2001 From: Armin Brauns Date: Tue, 24 Jan 2023 09:53:56 +0100 Subject: [PATCH] drivers/fpga: ice40: fix minimum config delay MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From FPGA-TN-02001-3.3 "iCE40 Programming and Configuration": > After driving CRESET_B High or allowing it to float High, the AP must > wait a minimum of 1200 µs, allowing the iCE40 FPGA to clear its internal > configuration memory. Signed-off-by: Armin Brauns --- drivers/fpga/fpga_ice40.c | 2 +- dts/bindings/fpga/lattice,ice40-fpga.yaml | 2 +- tests/drivers/build_all/fpga/spi.dtsi | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/fpga/fpga_ice40.c b/drivers/fpga/fpga_ice40.c index 26d98ef20ca..9d0808a2b53 100644 --- a/drivers/fpga/fpga_ice40.c +++ b/drivers/fpga/fpga_ice40.c @@ -71,7 +71,7 @@ #define FPGA_ICE40_SPI_HZ_MAX 25000000 #define FPGA_ICE40_CRESET_DELAY_NS_MIN 200 -#define FPGA_ICE40_CONFIG_DELAY_US_MIN 300 +#define FPGA_ICE40_CONFIG_DELAY_US_MIN 1200 #define FPGA_ICE40_LEADING_CLOCKS_MIN 8 #define FPGA_ICE40_TRAILING_CLOCKS_MIN 49 diff --git a/dts/bindings/fpga/lattice,ice40-fpga.yaml b/dts/bindings/fpga/lattice,ice40-fpga.yaml index f306b6c3dc1..8e5467be236 100644 --- a/dts/bindings/fpga/lattice,ice40-fpga.yaml +++ b/dts/bindings/fpga/lattice,ice40-fpga.yaml @@ -84,7 +84,7 @@ properties: description: | Delay (in microseconds) after releasing CRESET_B to clear internal configuration memory. Example usage / default: - config-delay-us = <300>; + config-delay-us = <1200>; leading-clocks: type: int description: | diff --git a/tests/drivers/build_all/fpga/spi.dtsi b/tests/drivers/build_all/fpga/spi.dtsi index d0ca6b3810a..c5b439d97e9 100644 --- a/tests/drivers/build_all/fpga/spi.dtsi +++ b/tests/drivers/build_all/fpga/spi.dtsi @@ -16,7 +16,7 @@ test_spi_fpga_ice40_gpio: ice40@0 { load-mode = <0>; cdone-gpios = <&test_gpio 0 0>; creset-gpios = <&test_gpio 0 0>; - config-delay-us = <390>; + config-delay-us = <3900>; }; test_spi_fpga_ice40_spi: ice40@1 { @@ -33,5 +33,5 @@ test_spi_fpga_ice40_spi: ice40@1 { pico-gpios = <&test_gpio 0 0>; gpios-set-reg = <0>; gpios-clear-reg = <0>; - config-delay-us = <390>; + config-delay-us = <3900>; };