Skip to content

Commit 002031d

Browse files
Tomasz Bursztykanashif
authored andcommitted
drivers/flash: Cleaning up Kconfig
Splitting to dedicated Kconfig for w25qxxdv and qmsi. Signed-off-by: Tomasz Bursztyka <[email protected]>
1 parent af411f3 commit 002031d

File tree

3 files changed

+135
-126
lines changed

3 files changed

+135
-126
lines changed

drivers/flash/Kconfig

Lines changed: 4 additions & 126 deletions
Original file line numberDiff line numberDiff line change
@@ -36,132 +36,6 @@ config FLASH_PAGE_LAYOUT
3636
help
3737
Enables API for retrieving the layout of flash memory pages.
3838

39-
config SPI_FLASH_W25QXXDV
40-
bool
41-
prompt "SPI NOR Flash Winbond W25QXXDV"
42-
select FLASH_HAS_DRIVER_ENABLED
43-
depends on SPI && FLASH
44-
45-
config SPI_FLASH_W25QXXDV_SPI_NAME
46-
string
47-
prompt "SPI controller device name"
48-
depends on SPI_FLASH_W25QXXDV
49-
default ""
50-
51-
config SPI_FLASH_W25QXXDV_DRV_NAME
52-
string
53-
prompt "SPI flash device name"
54-
depends on SPI_FLASH_W25QXXDV
55-
default "W25QXXDV"
56-
57-
config SPI_FLASH_W25QXXDV_INIT_PRIORITY
58-
int
59-
depends on SPI_FLASH_W25QXXDV
60-
default 80
61-
help
62-
Device driver initialization priority.
63-
Device is connected to SPI bus, it has to
64-
be initialized after SPI driver.
65-
66-
config SPI_FLASH_W25QXXDV_SPI_FREQ_0
67-
int "SPI system frequency"
68-
depends on SPI_FLASH_W25QXXDV
69-
default 8000000
70-
help
71-
This option sets the SPI controller's frequency. Beware this value
72-
depends on the SPI controller being used and also on the system
73-
clock.
74-
75-
config SPI_FLASH_W25QXXDV_SPI_SLAVE
76-
int "SPI slave linked to SPI flash"
77-
depends on SPI_FLASH_W25QXXDV
78-
help
79-
This option sets the SPI slave number the SPI controller has to switch
80-
to when dealing with WinBond SPI flash chip.
81-
82-
config SPI_FLASH_W25QXXDV_GPIO_SPI_CS
83-
bool "Manage SPI CS through a GPIO pin"
84-
default n
85-
depends on SPI_FLASH_W25QXXDV
86-
help
87-
This option is useful if one needs to manage SPI CS through a GPIO
88-
pin to by-pass the SPI controller's CS logic.
89-
90-
config SPI_FLASH_W25QXXDV_GPIO_SPI_CS_DRV_NAME
91-
string "GPIO driver's name to use to drive SPI CS through"
92-
default ""
93-
depends on SPI_FLASH_W25QXXDV_GPIO_SPI_CS
94-
help
95-
This option is mandatory to set which GPIO controller to use in order
96-
to actually emulate the SPI CS.
97-
98-
config SPI_FLASH_W25QXXDV_GPIO_SPI_CS_PIN
99-
int "GPIO PIN to use to drive SPI CS through"
100-
default 0
101-
depends on SPI_FLASH_W25QXXDV_GPIO_SPI_CS
102-
help
103-
This option is mandatory to set which GPIO pin to use in order
104-
to actually emulate the SPI CS.
105-
106-
config SPI_FLASH_W25QXXDV_FLASH_SIZE
107-
int "Flash size in bytes"
108-
depends on SPI_FLASH_W25QXXDV
109-
default 2097152
110-
help
111-
This is the flash capacity in bytes.
112-
113-
config SPI_FLASH_W25QXXDV_MAX_DATA_LEN
114-
int
115-
range 1 256
116-
depends on SPI_FLASH_W25QXXDV
117-
default 256
118-
help
119-
Maximum transmit or receive data length in one user data frame.
120-
121-
config SOC_FLASH_QMSI
122-
bool
123-
prompt "QMSI flash driver"
124-
depends on QMSI && FLASH
125-
select FLASH_HAS_DRIVER_ENABLED
126-
default n
127-
help
128-
Enable QMSI Quark flash driver.
129-
130-
config SOC_FLASH_QMSI_DEV_NAME
131-
string "QMSI flash device name"
132-
depends on SOC_FLASH_QMSI
133-
default "QUARK_FLASH"
134-
help
135-
Specify the device name for the flash driver.
136-
137-
config SOC_FLASH_QMSI_CLK_COUNT_US
138-
int "System clk count per microsecond"
139-
depends on SOC_FLASH_QMSI
140-
default 32
141-
help
142-
Specify the system clk cycles per microsecond.
143-
144-
config SOC_FLASH_QMSI_WAIT_STATES
145-
int "The number of flash wait states"
146-
depends on SOC_FLASH_QMSI
147-
default 1
148-
help
149-
Specify the number of wait states for Quark flash.
150-
151-
config SOC_FLASH_QMSI_SYS_SIZE
152-
hex "SOC system flash size"
153-
depends on SOC_FLASH_QMSI
154-
help
155-
Specify system flash size on the Quark SOC.
156-
157-
config SOC_FLASH_QMSI_API_REENTRANCY
158-
bool
159-
prompt "flash driver API reentrancy for QMSI shim driver"
160-
depends on SOC_FLASH_QMSI
161-
default n
162-
help
163-
Enable support for QMSI flash driver API reentrancy.
164-
16539
config SOC_FLASH_NRF
16640
bool "Nordic Semiconductor nRF flash driver"
16741
depends on FLASH && SOC_FAMILY_NRF
@@ -206,6 +80,10 @@ config SOC_FLASH_NIOS2_QSPI_DEV_NAME
20680
help
20781
Specify the device name for the QSPI flash driver.
20882

83+
source "drivers/flash/Kconfig.qmsi"
84+
20985
source "drivers/flash/Kconfig.stm32"
21086

21187
source "drivers/flash/Kconfig.sam0"
88+
89+
source "drivers/flash/Kconfig.w25qxxdv"

drivers/flash/Kconfig.qmsi

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#
2+
# Copyright (c) 2018 Intel Corporation
3+
#
4+
# SPDX-License-Identifier: Apache-2.0
5+
#
6+
7+
menuconfig SOC_FLASH_QMSI
8+
bool
9+
prompt "QMSI flash driver"
10+
depends on QMSI && FLASH
11+
select FLASH_HAS_DRIVER_ENABLED
12+
default n
13+
help
14+
Enable QMSI Quark flash driver.
15+
16+
if SOC_FLASH_QMSI
17+
18+
config SOC_FLASH_QMSI_DEV_NAME
19+
string "QMSI flash device name"
20+
default "QUARK_FLASH"
21+
help
22+
Specify the device name for the flash driver.
23+
24+
config SOC_FLASH_QMSI_CLK_COUNT_US
25+
int "System clk count per microsecond"
26+
default 32
27+
help
28+
Specify the system clk cycles per microsecond.
29+
30+
config SOC_FLASH_QMSI_WAIT_STATES
31+
int "The number of flash wait states"
32+
default 1
33+
help
34+
Specify the number of wait states for Quark flash.
35+
36+
config SOC_FLASH_QMSI_SYS_SIZE
37+
hex "SOC system flash size"
38+
help
39+
Specify system flash size on the Quark SOC.
40+
41+
config SOC_FLASH_QMSI_API_REENTRANCY
42+
bool "flash driver API reentrancy for QMSI shim driver"
43+
default n
44+
help
45+
Enable support for QMSI flash driver API reentrancy.
46+
47+
endif # SOC_FLASH_QMSI

drivers/flash/Kconfig.w25qxxdv

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
#
2+
# Copyright (c) 2018 Intel Corporation
3+
#
4+
# SPDX-License-Identifier: Apache-2.0
5+
#
6+
7+
8+
menuconfig SPI_FLASH_W25QXXDV
9+
bool
10+
prompt "SPI NOR Flash Winbond W25QXXDV"
11+
select FLASH_HAS_DRIVER_ENABLED
12+
depends on SPI && FLASH
13+
14+
if SPI_FLASH_W25QXXDV
15+
16+
config SPI_FLASH_W25QXXDV_SPI_NAME
17+
string
18+
prompt "SPI controller device name"
19+
default ""
20+
21+
config SPI_FLASH_W25QXXDV_DRV_NAME
22+
string
23+
prompt "SPI flash device name"
24+
default "W25QXXDV"
25+
26+
config SPI_FLASH_W25QXXDV_INIT_PRIORITY
27+
int
28+
default 80
29+
help
30+
Device driver initialization priority.
31+
Device is connected to SPI bus, it has to
32+
be initialized after SPI driver.
33+
34+
config SPI_FLASH_W25QXXDV_SPI_FREQ_0
35+
int "SPI system frequency"
36+
default 8000000
37+
help
38+
This option sets the SPI controller's frequency. Beware this value
39+
depends on the SPI controller being used and also on the system
40+
clock.
41+
42+
config SPI_FLASH_W25QXXDV_SPI_SLAVE
43+
int "SPI slave linked to SPI flash"
44+
help
45+
This option sets the SPI slave number the SPI controller has to switch
46+
to when dealing with WinBond SPI flash chip.
47+
48+
config SPI_FLASH_W25QXXDV_GPIO_SPI_CS
49+
bool "Manage SPI CS through a GPIO pin"
50+
default n
51+
help
52+
This option is useful if one needs to manage SPI CS through a GPIO
53+
pin to by-pass the SPI controller's CS logic.
54+
55+
config SPI_FLASH_W25QXXDV_GPIO_SPI_CS_DRV_NAME
56+
string "GPIO driver's name to use to drive SPI CS through"
57+
default ""
58+
depends on SPI_FLASH_W25QXXDV_GPIO_SPI_CS
59+
help
60+
This option is mandatory to set which GPIO controller to use in order
61+
to actually emulate the SPI CS.
62+
63+
config SPI_FLASH_W25QXXDV_GPIO_SPI_CS_PIN
64+
int "GPIO PIN to use to drive SPI CS through"
65+
default 0
66+
depends on SPI_FLASH_W25QXXDV_GPIO_SPI_CS
67+
help
68+
This option is mandatory to set which GPIO pin to use in order
69+
to actually emulate the SPI CS.
70+
71+
config SPI_FLASH_W25QXXDV_FLASH_SIZE
72+
int "Flash size in bytes"
73+
default 2097152
74+
help
75+
This is the flash capacity in bytes.
76+
77+
config SPI_FLASH_W25QXXDV_MAX_DATA_LEN
78+
int
79+
range 1 256
80+
default 256
81+
help
82+
Maximum transmit or receive data length in one user data frame.
83+
84+
endif # SPI_FLASH_W25QXXDV

0 commit comments

Comments
 (0)