mirror of
https://github.com/torvalds/linux.git
synced 2026-06-08 06:25:52 +02:00
drivers: rk_nand: enable rk nand flash support
Change-Id: I2ea7fe6218b32666b91fce54bc17f976feb7f4d2 Signed-off-by: Yifeng Zhao <zyf@rock-chips.com>
This commit is contained in:
parent
f077059630
commit
35de189e19
|
|
@ -221,5 +221,8 @@ source "drivers/slimbus/Kconfig"
|
|||
|
||||
source "drivers/energy_model/Kconfig"
|
||||
|
||||
source "drivers/rk_nand/Kconfig"
|
||||
|
||||
source "drivers/rkflash/Kconfig"
|
||||
|
||||
endmenu
|
||||
|
|
|
|||
|
|
@ -188,4 +188,5 @@ obj-$(CONFIG_MULTIPLEXER) += mux/
|
|||
obj-$(CONFIG_UNISYS_VISORBUS) += visorbus/
|
||||
obj-$(CONFIG_SIOX) += siox/
|
||||
obj-$(CONFIG_GNSS) += gnss/
|
||||
obj-$(CONFIG_RK_NAND) += rk_nand/
|
||||
obj-$(CONFIG_RK_FLASH) += rkflash/
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -23,6 +23,7 @@
|
|||
#include <linux/platform_device.h>
|
||||
#include <linux/pm_runtime.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/timer.h>
|
||||
#include <linux/uaccess.h>
|
||||
|
||||
#include "rk_nand_blk.h"
|
||||
|
|
@ -40,8 +41,8 @@ static int rk_nand_shutdown_state;
|
|||
/*1:flash 2:emmc 4:sdcard0 8:sdcard1*/
|
||||
static int rknand_boot_media = 2;
|
||||
static DECLARE_WAIT_QUEUE_HEAD(rk29_nandc_wait);
|
||||
static void rk_nand_iqr_timeout_hack(unsigned long data);
|
||||
static DEFINE_TIMER(rk_nand_iqr_timeout, rk_nand_iqr_timeout_hack, 0, 0);
|
||||
static void rk_nand_iqr_timeout_hack(struct timer_list *unused);
|
||||
static DEFINE_TIMER(rk_nand_iqr_timeout, rk_nand_iqr_timeout_hack);
|
||||
static int nandc0_xfer_completed_flag;
|
||||
static int nandc0_ready_completed_flag;
|
||||
static int nandc1_xfer_completed_flag;
|
||||
|
|
@ -188,7 +189,7 @@ int rk_nand_schedule_enable_config(int en)
|
|||
return tmp;
|
||||
}
|
||||
|
||||
static void rk_nand_iqr_timeout_hack(unsigned long data)
|
||||
static void rk_nand_iqr_timeout_hack(struct timer_list *unused)
|
||||
{
|
||||
del_timer(&rk_nand_iqr_timeout);
|
||||
rk_timer_add = 0;
|
||||
|
|
|
|||
|
|
@ -183,12 +183,12 @@ static int nand_dev_transfer(struct nand_blk_dev *dev,
|
|||
}
|
||||
|
||||
static DECLARE_WAIT_QUEUE_HEAD(rknand_thread_wait);
|
||||
static void rk_ftl_gc_timeout_hack(unsigned long data);
|
||||
static DEFINE_TIMER(rk_ftl_gc_timeout, rk_ftl_gc_timeout_hack, 0, 0);
|
||||
static void rk_ftl_gc_timeout_hack(struct timer_list *unused);
|
||||
static DEFINE_TIMER(rk_ftl_gc_timeout, rk_ftl_gc_timeout_hack);
|
||||
static unsigned long rk_ftl_gc_jiffies;
|
||||
static unsigned long rk_ftl_gc_do;
|
||||
|
||||
static void rk_ftl_gc_timeout_hack(unsigned long data)
|
||||
static void rk_ftl_gc_timeout_hack(struct timer_list *unused)
|
||||
{
|
||||
del_timer(&rk_ftl_gc_timeout);
|
||||
rk_ftl_gc_do++;
|
||||
|
|
@ -288,7 +288,7 @@ static int nand_blktrans_thread(void *arg)
|
|||
buf = 0;
|
||||
res = 0;
|
||||
|
||||
if (req->cmd_flags & REQ_DISCARD) {
|
||||
if (req->cmd_flags & REQ_OP_DISCARD) {
|
||||
spin_unlock_irq(rq->queue_lock);
|
||||
rknand_device_lock();
|
||||
if (FtlDiscard(blk_rq_pos(req) +
|
||||
|
|
@ -299,7 +299,7 @@ static int nand_blktrans_thread(void *arg)
|
|||
if (!__blk_end_request_cur(req, res))
|
||||
req = NULL;
|
||||
continue;
|
||||
} else if (req->cmd_flags & REQ_FLUSH) {
|
||||
} else if (req->cmd_flags & REQ_OP_FLUSH) {
|
||||
spin_unlock_irq(rq->queue_lock);
|
||||
rknand_device_lock();
|
||||
rk_ftl_cache_write_back();
|
||||
|
|
@ -310,7 +310,7 @@ static int nand_blktrans_thread(void *arg)
|
|||
continue;
|
||||
}
|
||||
|
||||
rw_flag = req->cmd_flags & REQ_WRITE;
|
||||
rw_flag = req->cmd_flags & REQ_OP_WRITE;
|
||||
if (rw_flag == READ && mtd_read_temp_buffer) {
|
||||
buf = mtd_read_temp_buffer;
|
||||
req_check_buffer_align(req, &buf);
|
||||
|
|
@ -586,7 +586,6 @@ static int nand_add_dev(struct nand_blk_ops *nandr, struct nand_part *part)
|
|||
part->name);
|
||||
} else {
|
||||
gd->flags = GENHD_FL_EXT_DEVT;
|
||||
gd->driverfs_dev = g_nand_device;
|
||||
gd->minors = 255;
|
||||
snprintf(gd->disk_name,
|
||||
sizeof(gd->disk_name),
|
||||
|
|
@ -674,8 +673,10 @@ static int nand_blk_register(struct nand_blk_ops *nandr)
|
|||
blk_queue_max_hw_sectors(nandr->rq, MTD_RW_SECTORS);
|
||||
blk_queue_max_segments(nandr->rq, MTD_RW_SECTORS);
|
||||
|
||||
queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, nandr->rq);
|
||||
blk_queue_flag_set(QUEUE_FLAG_DISCARD, nandr->rq);
|
||||
blk_queue_max_discard_sectors(nandr->rq, UINT_MAX >> 9);
|
||||
/* discard_granularity config to one nand page size 32KB*/
|
||||
nandr->rq->limits.discard_granularity = 64 << 9;
|
||||
|
||||
nandr->rq->queuedata = nandr;
|
||||
INIT_LIST_HEAD(&nandr->devs);
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user