Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add zffs #11026

Closed
wants to merge 12 commits into from
Closed

Add zffs #11026

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions boards/arm/nrf52840_pca10056/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,10 @@ config IEEE802154_NRF5
endif # IEEE802154

endif # BOARD_NRF52840_PCA10056

if QSPI_FLASH_NRF

config QSPI_FLASH_NRF_DEV_MX25R6435F
def_bool y

endif # QSPI_FLASH_NRF
15 changes: 15 additions & 0 deletions boards/arm/nrf52840_pca10056/nrf52840_pca10056.dts
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,21 @@
};
};

&qspi {
status = "ok";

csn-pin = <17>;
sck-pin = <19>;
io-pins = <20 21 22 23>;
qspi-max-frequency = <80000000>;

mx25r6435f: serial-flash@12000000 {
compatible = "serial-flash";
reg = <0x12000000 DT_SIZE_K(8192)>;
label = "NRF_QSPI_FLASH";
};
};

&usbd {
compatible = "nordic,nrf-usbd";
status = "ok";
Expand Down
1 change: 1 addition & 0 deletions drivers/flash/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ zephyr_library_sources_ifdef(CONFIG_USERSPACE flash_handlers.c)
zephyr_library_sources_ifdef(CONFIG_SOC_FLASH_SAM0 flash_sam0.c)
zephyr_library_sources_ifdef(CONFIG_SOC_FLASH_NIOS2_QSPI soc_flash_nios2_qspi.c)
zephyr_library_sources_ifdef(CONFIG_SOC_FLASH_GECKO flash_gecko.c)
zephyr_library_sources_ifdef(CONFIG_QSPI_FLASH_NRF qspi_flash_nrf.c)

if(CONFIG_SOC_SERIES_STM32F0X)
zephyr_library_sources_ifdef(CONFIG_SOC_FLASH_STM32
Expand Down
2 changes: 2 additions & 0 deletions drivers/flash/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,6 @@ source "drivers/flash/Kconfig.sam0"

source "drivers/flash/Kconfig.w25qxxdv"

source "drivers/flash/Kconfig.qspi.nrf"

endif
130 changes: 130 additions & 0 deletions drivers/flash/Kconfig.qspi.nrf
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
# Kconfig.spi - Nordic QSPI Flash driver configuration options

#
# Copyright (c) 2018 Findlay Feng
#
# SPDX-License-Identifier: Apache-2.0
#

config QSPI_FLASH_NRF
bool "Nordic Semiconductor nRF QSPI flash driver"
depends on SOC_FAMILY_NRF && HAS_HW_NRF_QSPI
default n
select NRFX_QSPI
select HAS_DTS_SPI
help
Enables Nordic Semiconductor nRF QSPI flash driver.

if QSPI_FLASH_NRF

choice
prompt "QSPI read Opcode"
default QSPI_FLASH_NRF_READOC_READ4IO

config QSPI_FLASH_NRF_READOC_FASTREAD
bool "Read bytes at higher speed"
help
Single data line SPI. (opcode 0x0B).

config QSPI_FLASH_NRF_READOC_READ2O
bool "Dual-read output"
help
Dual data line SPI. (opcode 0x3B).

config QSPI_FLASH_NRF_READOC_READ2IO
bool "Dual-read input/output"
help
Dual data line SPI. (opcode 0xBB).

config QSPI_FLASH_NRF_READOC_READ4O
bool "Quad-read output"
help
Quad data line SPI. (opcode 0x6B).

config QSPI_FLASH_NRF_READOC_READ4IO
bool "Quad-read input/output"
help
Quad data line SPI. (opcode 0xEB).

endchoice

choice
prompt "QSPI write Opcode"
default QSPI_FLASH_NRF_WRITEOC_PP4IO

config QSPI_FLASH_NRF_WRITEOC_PP
bool "Page program"
help
Single data line SPI. (opcode 0x0B).

config QSPI_FLASH_NRF_WRITEOC_PP2O
bool "Dual-page program output"
help
Dual data line SPI. (opcode 0x3B).

config QSPI_FLASH_NRF_WRITEOC_PP4O
bool "Quad-page program output"
help
Dual data line SPI. (opcode 0xBB).

config QSPI_FLASH_NRF_WRITEOC_PP4IO
bool "Quad-page program input/output"
help
Quad data line SPI. (opcode 0x6B).

endchoice

choice
prompt "QSPI addressing mode"
default QSPI_FLASH_NRF_ADDRMODE_24BIT

config QSPI_FLASH_NRF_ADDRMODE_24BIT
bool "24-bit"
help
24-bit addressing.

config QSPI_FLASH_NRF_ADDRMODE_32BIT
bool "32-bit"
help
32-bit addressing.
endchoice

choice
prompt "QSPI SPI mode."
default QSPI_NRF_MODE_0

config QSPI_NRF_MODE_0
bool "mode 0"
help
Mode 0 (CPOL=0, CPHA=0).

config QSPI_NRF_MODE_1
bool "mode 1"
help
Mode 1 (CPOL=1, CPHA=1).

endchoice

config QSPI_FLASH_NRF_DPM
bool "Deep Power-down Mode"
default n
help
Enable the Deep Power-down Mode (DPM) feature.

config QSPI_FLASH_NRF_DELAY
int "QSPI CS delay"
range 0 255
default 1
help
Minimum amount of time that the CSN pin must stay high
before it can go low again. Value is specified in number of
16 MHz periods (62.5 ns).

config QSPI_FLASH_NRF_DEV_MX25R6435F
bool "NOR Flash MX25R6435F"
default n
help
MX25R6435F Chip initialization

endif # QSPI_FLASH

Loading