Skip to content

Commit

Permalink
DM:Support NOR CFI flash
Browse files Browse the repository at this point in the history
Signed-off-by: GuEe-GUI <[email protected]>
  • Loading branch information
GuEe-GUI committed Jun 17, 2024
1 parent 5b1385a commit d6dfbdb
Show file tree
Hide file tree
Showing 7 changed files with 1,331 additions and 8 deletions.
1 change: 1 addition & 0 deletions components/drivers/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -708,6 +708,7 @@ menuconfig RT_USING_VIRTIO
source "$RTT_DIR/components/drivers/clk/Kconfig"
source "$RTT_DIR/components/drivers/firmware/Kconfig"
source "$RTT_DIR/components/drivers/hwtimer/Kconfig"
source "$RTT_DIR/components/drivers/mtd/Kconfig"
source "$RTT_DIR/components/drivers/ofw/Kconfig"
source "$RTT_DIR/components/drivers/pci/Kconfig"
source "$RTT_DIR/components/drivers/pic/Kconfig"
Expand Down
2 changes: 2 additions & 0 deletions components/drivers/mtd/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
source "$RTT_DIR/components/drivers/mtd/Kconfig.nand"
source "$RTT_DIR/components/drivers/mtd/Kconfig.nor"
9 changes: 9 additions & 0 deletions components/drivers/mtd/Kconfig.nand
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
menuconfig RT_USING_MTD_NAND
bool "Using MTD Nand Flash device drivers"
default n

if RT_USING_MTD_NAND
config RT_MTD_NAND_DEBUG
bool "Enable MTD Nand operations debug information"
default n
endif
9 changes: 9 additions & 0 deletions components/drivers/mtd/Kconfig.nor
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
menuconfig RT_USING_MTD_NOR
bool "Using MTD Nor Flash device drivers"
default n

config RT_USING_MTD_NOR_CFI
bool "CFI Flash driver"
depends on RT_USING_MTD_NOR
depends on RT_USING_DM
default n
19 changes: 11 additions & 8 deletions components/drivers/mtd/SConscript
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
from building import *

cwd = GetCurrentDir()
src = []
depend = ['']
group = []

if not GetDepend(['RT_USING_MTD_NOR']) and not GetDepend(['RT_USING_MTD_NAND']):
Return('group')

cwd = GetCurrentDir()
CPPPATH = [cwd + '/../include']
group = []

src = []

if GetDepend(['RT_USING_MTD_NOR']):
src += ['mtd_nor.c']
depend += ['RT_USING_MTD_NOR']

if GetDepend(['RT_USING_MTD_NAND']):
src += ['mtd_nand.c']
depend += ['RT_USING_MTD_NAND']

if src:
group = DefineGroup('DeviceDrivers', src, depend = depend, CPPPATH = CPPPATH)
if GetDepend(['RT_USING_MTD_NOR_CFI']):
src += ['mtd-cfi.c']

group = DefineGroup('DeviceDrivers', src, depend = [''], CPPPATH = CPPPATH)

Return('group')
Loading

0 comments on commit d6dfbdb

Please sign in to comment.