H A D | sunxi_nand.c | 1 // SPDX-License-Identifier: GPL-2.0+ 6 * https://github.com/yuq/sunxi-nfc-mtd 9 * https://github.com/hno/Allwinner-Info 16 #include <linux/dma-mapping.h> 70 #define NFC_PAGE_SHIFT(x) (((x) < 10 ? 0 : (x) - 10) << 8) 107 #define NFC_ADR_NUM(x) (((x) - 1) << 16) 161 * struct sunxi_nand_chip_sel - store 194 struct nand_chip nand; global() member 195 struct sunxi_nand_hw_ecc ecc; global() member 203 to_sunxi_nand(struct nand_chip * nand) to_sunxi_nand() argument 415 sunxi_nfc_select_chip(struct nand_chip * nand,unsigned int cs) sunxi_nfc_select_chip() argument 446 sunxi_nfc_read_buf(struct nand_chip * nand,uint8_t * buf,int len) sunxi_nfc_read_buf() argument 483 sunxi_nfc_write_buf(struct nand_chip * nand,const uint8_t * buf,int len) sunxi_nfc_write_buf() argument 602 sunxi_nfc_randomizer_state(struct nand_chip * nand,int page,bool ecc) sunxi_nfc_randomizer_state() argument 603 sunxi_nfc_randomizer_state(struct nand_chip * nand,int page,bool ecc) sunxi_nfc_randomizer_state() argument 622 sunxi_nfc_randomizer_config(struct nand_chip * nand,int page,bool ecc) sunxi_nfc_randomizer_config() argument 623 sunxi_nfc_randomizer_config(struct nand_chip * nand,int page,bool ecc) sunxi_nfc_randomizer_config() argument 638 sunxi_nfc_randomizer_enable(struct nand_chip * nand) sunxi_nfc_randomizer_enable() argument 649 sunxi_nfc_randomizer_disable(struct nand_chip * nand) sunxi_nfc_randomizer_disable() argument 660 sunxi_nfc_randomize_bbm(struct nand_chip * nand,int page,u8 * bbm) sunxi_nfc_randomize_bbm() argument 668 sunxi_nfc_randomizer_write_buf(struct nand_chip * nand,const uint8_t * buf,int len,bool ecc,int page) sunxi_nfc_randomizer_write_buf() argument 670 sunxi_nfc_randomizer_write_buf(struct nand_chip * nand,const uint8_t * buf,int len,bool ecc,int page) sunxi_nfc_randomizer_write_buf() argument 678 sunxi_nfc_randomizer_read_buf(struct nand_chip * nand,uint8_t * buf,int len,bool ecc,int page) sunxi_nfc_randomizer_read_buf() argument 679 sunxi_nfc_randomizer_read_buf(struct nand_chip * nand,uint8_t * buf,int len,bool ecc,int page) sunxi_nfc_randomizer_read_buf() argument 687 sunxi_nfc_hw_ecc_enable(struct nand_chip * nand) sunxi_nfc_hw_ecc_enable() argument 695 sunxi_nfc_hw_ecc_disable(struct nand_chip * nand) sunxi_nfc_hw_ecc_disable() argument 715 sunxi_nfc_hw_ecc_get_prot_oob_bytes(struct nand_chip * nand,u8 * oob,int step,bool bbm,int page) sunxi_nfc_hw_ecc_get_prot_oob_bytes() argument 728 sunxi_nfc_hw_ecc_set_prot_oob_bytes(struct nand_chip * nand,const u8 * oob,int step,bool bbm,int page) sunxi_nfc_hw_ecc_set_prot_oob_bytes() argument 746 sunxi_nfc_hw_ecc_update_stats(struct nand_chip * nand,unsigned int * max_bitflips,int ret) sunxi_nfc_hw_ecc_update_stats() argument 759 sunxi_nfc_hw_ecc_correct(struct nand_chip * nand,u8 * data,u8 * oob,int step,u32 status,bool * erased) sunxi_nfc_hw_ecc_correct() argument 763 struct nand_ecc_ctrl *ecc = &nand->ecc; sunxi_nfc_hw_ecc_correct() local 795 sunxi_nfc_hw_ecc_read_chunk(struct nand_chip * nand,u8 * data,int data_off,u8 * oob,int oob_off,int * cur_off,unsigned int * max_bitflips,bool bbm,bool oob_required,int page) sunxi_nfc_hw_ecc_read_chunk() argument 803 struct nand_ecc_ctrl *ecc = &nand->ecc; sunxi_nfc_hw_ecc_read_chunk() local 876 sunxi_nfc_hw_ecc_read_extra_oob(struct nand_chip * nand,u8 * oob,int * cur_off,bool randomize,int page) sunxi_nfc_hw_ecc_read_extra_oob() argument 881 struct nand_ecc_ctrl *ecc = &nand->ecc; sunxi_nfc_hw_ecc_read_extra_oob() local 902 sunxi_nfc_hw_ecc_read_chunks_dma(struct nand_chip * nand,uint8_t * buf,int oob_required,int page,int nchunks) sunxi_nfc_hw_ecc_read_chunks_dma() argument 909 struct nand_ecc_ctrl *ecc = &nand->ecc; sunxi_nfc_hw_ecc_read_chunks_dma() local 1030 sunxi_nfc_hw_ecc_write_chunk(struct nand_chip * nand,const u8 * data,int data_off,const u8 * oob,int oob_off,int * cur_off,bool bbm,int page) sunxi_nfc_hw_ecc_write_chunk() argument 1037 struct nand_ecc_ctrl *ecc = &nand->ecc; sunxi_nfc_hw_ecc_write_chunk() local 1069 sunxi_nfc_hw_ecc_write_extra_oob(struct nand_chip * nand,u8 * oob,int * cur_off,int page) sunxi_nfc_hw_ecc_write_extra_oob() argument 1074 struct nand_ecc_ctrl *ecc = &nand->ecc; sunxi_nfc_hw_ecc_write_extra_oob() local 1091 sunxi_nfc_hw_ecc_read_page(struct nand_chip * nand,uint8_t * buf,int oob_required,int page) sunxi_nfc_hw_ecc_read_page() argument 1095 struct nand_ecc_ctrl *ecc = &nand->ecc; sunxi_nfc_hw_ecc_read_page() local 1131 sunxi_nfc_hw_ecc_read_page_dma(struct nand_chip * nand,u8 * buf,int oob_required,int page) sunxi_nfc_hw_ecc_read_page_dma() argument 1149 sunxi_nfc_hw_ecc_read_subpage(struct nand_chip * nand,u32 data_offs,u32 readlen,u8 * bufpoi,int page) sunxi_nfc_hw_ecc_read_subpage() argument 1154 struct nand_ecc_ctrl *ecc = &nand->ecc; sunxi_nfc_hw_ecc_read_subpage() local 1185 sunxi_nfc_hw_ecc_read_subpage_dma(struct nand_chip * nand,u32 data_offs,u32 readlen,u8 * buf,int page) sunxi_nfc_hw_ecc_read_subpage_dma() argument 1205 sunxi_nfc_hw_ecc_write_page(struct nand_chip * nand,const uint8_t * buf,int oob_required,int page) sunxi_nfc_hw_ecc_write_page() argument 1210 struct nand_ecc_ctrl *ecc = &nand->ecc; sunxi_nfc_hw_ecc_write_page() local 1241 sunxi_nfc_hw_ecc_write_subpage(struct nand_chip * nand,u32 data_offs,u32 data_len,const u8 * buf,int oob_required,int page) sunxi_nfc_hw_ecc_write_subpage() argument 1247 struct nand_ecc_ctrl *ecc = &nand->ecc; sunxi_nfc_hw_ecc_write_subpage() local 1275 sunxi_nfc_hw_ecc_write_page_dma(struct nand_chip * nand,const u8 * buf,int oob_required,int page) sunxi_nfc_hw_ecc_write_page_dma() argument 1281 struct nand_ecc_ctrl *ecc = &nand->ecc; sunxi_nfc_hw_ecc_write_page_dma() local 1346 sunxi_nfc_hw_ecc_read_oob(struct nand_chip * nand,int page) sunxi_nfc_hw_ecc_read_oob() argument 1353 sunxi_nfc_hw_ecc_write_oob(struct nand_chip * nand,int page) sunxi_nfc_hw_ecc_write_oob() argument 1389 sunxi_nfc_setup_interface(struct nand_chip * nand,int csline,const struct nand_interface_config * conf) sunxi_nfc_setup_interface() argument 1562 struct nand_chip *nand = mtd_to_nand(mtd); sunxi_nand_ooblayout_ecc() local 1563 struct nand_ecc_ctrl *ecc = &nand->ecc; sunxi_nand_ooblayout_ecc() local 1577 struct nand_chip *nand = mtd_to_nand(mtd); sunxi_nand_ooblayout_free() local 1578 struct nand_ecc_ctrl *ecc = &nand->ecc; sunxi_nand_ooblayout_free() local 1617 sunxi_nand_hw_ecc_ctrl_init(struct nand_chip * nand,struct nand_ecc_ctrl * ecc,struct device_node * np) sunxi_nand_hw_ecc_ctrl_init() argument 1618 sunxi_nand_hw_ecc_ctrl_init(struct nand_chip * nand,struct nand_ecc_ctrl * ecc,struct device_node * np) sunxi_nand_hw_ecc_ctrl_init() argument 1724 sunxi_nand_attach_chip(struct nand_chip * nand) sunxi_nand_attach_chip() argument 1728 struct nand_ecc_ctrl *ecc = &nand->ecc; sunxi_nand_attach_chip() local 1764 sunxi_nfc_exec_subop(struct nand_chip * nand,const struct nand_subop * subop) sunxi_nfc_exec_subop() argument 1860 sunxi_nfc_soft_waitrdy(struct nand_chip * nand,const struct nand_subop * subop) sunxi_nfc_soft_waitrdy() argument 1897 sunxi_nfc_exec_op(struct nand_chip * nand,const struct nand_operation * op,bool check_only) sunxi_nfc_exec_op() argument 1943 struct nand_chip *nand; sunxi_nand_chip_init() local [all...] |