drivers: rknand: add nand flash drivers for spl

Signed-off-by: Yifeng Zhao <yifeng.zhao@rock-chips.com>
Change-Id: I21c449226f57f2ff05fdcf241dde014062634cb5
This commit is contained in:
Yifeng Zhao 2020-11-25 15:58:09 +08:00
parent d7965d03e2
commit e18e709024
5 changed files with 33189 additions and 7 deletions

View File

@ -59,7 +59,7 @@ obj-$(CONFIG_SPL_USB_HOST_SUPPORT) += block/
obj-$(CONFIG_SPL_MMC_SUPPORT) += block/
obj-$(CONFIG_SPL_MTD_SUPPORT) += block/
obj-$(CONFIG_SPL_FPGA_SUPPORT) += fpga/
obj-$(CONFIG_SPL_RKNAND_SUPPORT) += rknand/
endif
endif

View File

@ -7,15 +7,15 @@
config RKNAND
bool "Rockchip NAND FLASH device support"
depends on BLK
select ZFTL if ROCKCHIP_PX30
select ZFTL if (ROCKCHIP_PX30 || ROCKCHIP_RK3568)
help
This option enables support for Rockchip NAND FLASH devices.
It supports block interface(with rk ftl) to read and write NAND FLASH.
config ZFTL
bool "Rockchip ZFTL for rkpx30/rk3326 to support 3D/2D TLC/MLC"
depends on RKNAND && (ROCKCHIP_PX30)
default y if ROCKCHIP_PX30
depends on RKNAND && (ROCKCHIP_PX30 || ROCKCHIP_RK3568)
default y if (ROCKCHIP_PX30 || ROCKCHIP_RK3568)
help
This option enables support for Rockchip NAND FLASH devices.
It supports block interface(with zftl) to read and write 3D/2D TLC/MLC

View File

@ -8,7 +8,11 @@ obj-y += rknand.o
ifdef CONFIG_ARM64
ifdef CONFIG_ZFTL
ifdef CONFIG_SPL_BUILD
obj-y += rk_zftl_spl_arm_v8.o
else
obj-y += rk_zftl_arm_v8.o
endif
else
obj-y += rk_ftl_arm_v8.o
endif
@ -21,4 +25,4 @@ else
obj-y += rk_ftl_arm_v7.o
endif
endif
endif

File diff suppressed because it is too large Load Diff

View File

@ -191,9 +191,11 @@ static int rockchip_nand_probe(struct udevice *udev)
ndev->read = ftl_read;
ndev->write = ftl_write;
ndev->erase = ftl_discard;
#ifndef CONFIG_SPL_BUILD
#ifdef CONFIG_ROCKCHIP_VENDOR_PARTITION
flash_vendor_dev_ops_register(rkftl_nand_vendor_read,
rkftl_nand_vendor_write);
#endif
#endif
}
@ -202,10 +204,8 @@ static int rockchip_nand_probe(struct udevice *udev)
static const struct blk_ops rknand_blk_ops = {
.read = rknand_bread,
#ifndef CONFIG_SPL_BUILD
.write = rknand_bwrite,
.erase = rknand_berase,
#endif
};
static const struct udevice_id rockchip_nand_ids[] = {