1 /* 2 * Copyright (c) 2016, Fuzhou Rockchip Electronics Co., Ltd 3 * 4 * This program is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU General Public License as published by 6 * the Free Software Foundation; either version 2 of the License, or 7 * (at your option) any later version. 8 */ 9 10 #ifndef __RK_FTL_API_H 11 #define __RK_FTL_API_H 12 13 void rk_nandc_flash_xfer_completed(void *nandc_reg); 14 void rk_nandc_flash_ready(void *nandc_reg); 15 u32 rk_nandc_get_irq_status(void *nandc_reg); 16 int rknand_proc_ftlread(char *page); 17 int FtlRead(u8 lun, u32 index, u32 sectors, u8 *buf); 18 int FtlWrite(u8 lun, u32 index, u32 sectors, u8 *buf); 19 int rk_ftl_garbage_collect(u32 mode, u32 pages); 20 void rk_ftl_cache_write_back(void); 21 int FtlDiscard(u32 index, u32 sectors); 22 int rk_nand_schedule_enable_config(int en); 23 int rk_ftl_get_capacity(void); 24 void rk_ftl_storage_sys_init(void); 25 int rk_ftl_init(void); 26 void rk_nand_de_init(void); 27 void rk_ftl_de_init(void); 28 void rk_nand_suspend(void); 29 void rk_nand_resume(void); 30 int rknand_get_reg_addr(unsigned long *p_nandc0, unsigned long *p_nandc1); 31 long rknand_sys_storage_ioctl(struct file *file, unsigned int cmd, 32 unsigned long arg); 33 long rk_ftl_vendor_storage_ioctl(struct file *file, unsigned int cmd, 34 unsigned long arg); 35 int rk_ftl_vendor_write(u32 id, void *pbuf, u32 size); 36 int rk_ftl_vendor_read(u32 id, void *pbuf, u32 size); 37 int rk_ftl_vendor_storage_init(void); 38 int rknand_vendor_storage_init(void); 39 40 #endif 41 42