Skip to content

Commit 760210f

Browse files
benediktibkfabiobaltieri
authored andcommitted
drivers: fpga: separate drivers of iCE40 for SPI and GPIO bitbang
Separate the current driver for the FPGA iCE40 into two different ones. One implements only the SPI load mode, the other one only the GPIO bitbang mode. Signed-off-by: Benedikt Schmidt <[email protected]>
1 parent a7a978a commit 760210f

File tree

12 files changed

+810
-720
lines changed

12 files changed

+810
-720
lines changed

doc/releases/release-notes-4.1.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,12 @@ Drivers and Sensors
130130

131131
* Flash
132132

133+
* FPGA
134+
135+
* Extracted from :dtcompatible:`lattice,ice40-fpga` the compatible and driver for
136+
:dtcompatible:`lattice,ice40-fpga-bitbang`. This replaces the original ``load_mode`` property from
137+
the binding, which selected either the SPI or GPIO bitbang load mode.
138+
133139
* GNSS
134140

135141
* GPIO

drivers/fpga/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ zephyr_library_sources_ifdef(CONFIG_FPGA_SHELL fpga_shell.c)
66

77
zephyr_library_sources_ifdef(CONFIG_ALTERA_AGILEX_BRIDGE_FPGA fpga_altera_agilex_bridge.c)
88
zephyr_library_sources_ifdef(CONFIG_EOS_S3_FPGA fpga_eos_s3.c)
9-
zephyr_library_sources_ifdef(CONFIG_ICE40_FPGA fpga_ice40.c)
9+
zephyr_library_sources_ifdef(CONFIG_ICE40_FPGA fpga_ice40_common.c)
10+
zephyr_library_sources_ifdef(CONFIG_ICE40_FPGA_SPI fpga_ice40_spi.c)
11+
zephyr_library_sources_ifdef(CONFIG_ICE40_FPGA_BITBANG fpga_ice40_bitbang.c)
1012
zephyr_library_sources_ifdef(CONFIG_MPFS_FPGA fpga_mpfs.c)
1113
zephyr_library_sources_ifdef(CONFIG_ZYNQMP_FPGA fpga_zynqmp.c)
1214
zephyr_library_sources_ifdef(CONFIG_SLG471X5_FPGA fpga_slg471x5.c)

drivers/fpga/Kconfig.ice40

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,31 @@
11
# Copyright (c) 2022 Meta
22
# SPDX-License-Identifier: Apache-2.0
33

4-
config ICE40_FPGA
5-
bool "Lattice iCE40 fpga driver [EXPERIMENTAL]"
6-
select EXPERIMENTAL
4+
menuconfig ICE40_FPGA
5+
bool "Lattice iCE40 fpga driver"
6+
default y
7+
depends on (DT_HAS_LATTICE_ICE40_FPGA_ENABLED || \
8+
DT_HAS_LATTICE_ICE40_FPGA_BITBANG_ENABLED)
79
imply CRC
810
depends on SPI
911
help
1012
Enable support for the Lattice iCE40 fpga driver.
13+
14+
if ICE40_FPGA
15+
16+
config ICE40_FPGA_SPI
17+
bool "Lattice iCE40 fpga SPI driver"
18+
default y
19+
depends on DT_HAS_LATTICE_ICE40_FPGA_ENABLED
20+
help
21+
Enable support for the Lattice iCE40 fpga SPI driver.
22+
23+
config ICE40_FPGA_BITBANG
24+
bool "Lattice iCE40 fpga driver GPIO bitbang"
25+
default y
26+
select EXPERIMENTAL
27+
depends on DT_HAS_LATTICE_ICE40_FPGA_BITBANG_ENABLED
28+
help
29+
Enable support for the Lattice iCE40 fpga GPIO bitbang driver.
30+
31+
endif # ICE40_FPGA

0 commit comments

Comments
 (0)