mirror of
https://github.com/torvalds/linux.git
synced 2026-06-08 14:42:37 +02:00
drivers: rkflash: support 4KB page size slc nand
1.support 4KB page size slc nand; 2.support idblock update when NANDC version is 9. Change-Id: Ia4c170270264fd46dbd2bc627d0780b8fe46f7d5 Signed-off-by: jon.lin <jon.lin@rock-chips.com>
This commit is contained in:
parent
d576fa1a11
commit
19e6e2a580
|
|
@ -81,6 +81,11 @@ static void flash_bch_sel(u8 bits)
|
|||
nandc_bch_sel(bits);
|
||||
}
|
||||
|
||||
static void flash_set_sector(u8 num)
|
||||
{
|
||||
nand_para.sec_per_page = num;
|
||||
}
|
||||
|
||||
static __maybe_unused void flash_timing_cfg(u32 ahb_khz)
|
||||
{
|
||||
nandc_time_cfg(nand_para.access_freq);
|
||||
|
|
@ -427,6 +432,8 @@ static void nandc_flash_print_info(void)
|
|||
|
||||
static void ftl_flash_init(void)
|
||||
{
|
||||
u8 nandc_ver = nandc_get_version();
|
||||
|
||||
/* para init */
|
||||
g_nand_phy_info.nand_type = nand_para.cell;
|
||||
g_nand_phy_info.die_num = nand_para.die_per_chip;
|
||||
|
|
@ -449,6 +456,10 @@ static void ftl_flash_init(void)
|
|||
g_nand_ops.erase_blk = flash_erase_block;
|
||||
g_nand_ops.prog_page = flash_prog_page;
|
||||
g_nand_ops.read_page = flash_read_page;
|
||||
if (nandc_ver == 9) {
|
||||
g_nand_ops.bch_sel = flash_bch_sel;
|
||||
g_nand_ops.set_sec_num = flash_set_sector;
|
||||
}
|
||||
}
|
||||
|
||||
u32 nandc_flash_init(void __iomem *nandc_addr)
|
||||
|
|
@ -485,6 +496,9 @@ u32 nandc_flash_init(void __iomem *nandc_addr)
|
|||
if (id_byte[0][0] == 0x2C && id_byte[0][3] == 0xA6) {
|
||||
nand_para.plane_per_die = 2;
|
||||
nand_para.sec_per_page = 8;
|
||||
} else if (id_byte[0][0] == 0x98 && id_byte[0][3] == 0x26) {
|
||||
nand_para.blk_per_plane = 2048;
|
||||
nand_para.sec_per_page = 8;
|
||||
} else {
|
||||
nand_para.plane_per_die = 2;
|
||||
nand_para.blk_per_plane = 2048;
|
||||
|
|
|
|||
|
|
@ -59,6 +59,8 @@ struct nand_ops {
|
|||
u32 (*erase_blk)(u8 cs, u32 page_addr);
|
||||
u32 (*prog_page)(u8 cs, u32 page_addr, u32 *data, u32 *spare);
|
||||
u32 (*read_page)(u8 cs, u32 page_addr, u32 *data, u32 *spare);
|
||||
void (*bch_sel)(u8 bits);
|
||||
void (*set_sec_num)(u8 num);
|
||||
};
|
||||
|
||||
s32 ftl_flash_prog_pages(void *req, u32 num_req, u32 flash_type, u32 check);
|
||||
|
|
|
|||
|
|
@ -23,6 +23,11 @@ static struct MASTER_INFO_T master;
|
|||
static u32 *g_master_temp_buf;
|
||||
#endif
|
||||
|
||||
u8 nandc_get_version(void)
|
||||
{
|
||||
return g_nandc_ver;
|
||||
}
|
||||
|
||||
void nandc_init(void __iomem *nandc_addr)
|
||||
{
|
||||
union FM_CTL_T ctl_reg;
|
||||
|
|
|
|||
|
|
@ -341,5 +341,6 @@ void nandc_bch_sel(u8 bits);
|
|||
void nandc_read_not_case_busy_en(u8 en);
|
||||
void nandc_time_cfg(u32 ns);
|
||||
void nandc_clean_irq(void);
|
||||
u8 nandc_get_version(void);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
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
Loading…
Reference in New Issue
Block a user