Lines Matching refs:nand
180 struct nand_chip *nand = mtd_to_nand(mtd); in omap_enable_hwecc() local
181 struct omap_nand_info *info = nand_get_controller_data(nand); in omap_enable_hwecc()
182 unsigned int dev_width = (nand->options & NAND_BUSWIDTH_16) ? 1 : 0; in omap_enable_hwecc()
712 static int omap_select_ecc_scheme(struct nand_chip *nand, in omap_select_ecc_scheme() argument
714 struct omap_nand_info *info = nand_get_controller_data(nand); in omap_select_ecc_scheme()
725 nand->ecc.mode = NAND_ECC_SOFT; in omap_select_ecc_scheme()
726 nand->ecc.layout = NULL; in omap_select_ecc_scheme()
727 nand->ecc.size = 0; in omap_select_ecc_scheme()
740 memset(&nand->ecc, 0, sizeof(struct nand_ecc_ctrl)); in omap_select_ecc_scheme()
741 nand->ecc.mode = NAND_ECC_HW; in omap_select_ecc_scheme()
742 nand->ecc.strength = 1; in omap_select_ecc_scheme()
743 nand->ecc.size = SECTOR_BYTES; in omap_select_ecc_scheme()
744 nand->ecc.bytes = 3; in omap_select_ecc_scheme()
745 nand->ecc.hwctl = omap_enable_hwecc; in omap_select_ecc_scheme()
746 nand->ecc.correct = omap_correct_data; in omap_select_ecc_scheme()
747 nand->ecc.calculate = omap_calculate_ecc; in omap_select_ecc_scheme()
749 ecclayout->eccbytes = nand->ecc.bytes * eccsteps; in omap_select_ecc_scheme()
751 if (nand->options & NAND_BUSWIDTH_16) in omap_select_ecc_scheme()
777 memset(&nand->ecc, 0, sizeof(struct nand_ecc_ctrl)); in omap_select_ecc_scheme()
778 nand->ecc.mode = NAND_ECC_HW; in omap_select_ecc_scheme()
779 nand->ecc.strength = 8; in omap_select_ecc_scheme()
780 nand->ecc.size = SECTOR_BYTES; in omap_select_ecc_scheme()
781 nand->ecc.bytes = 13; in omap_select_ecc_scheme()
782 nand->ecc.hwctl = omap_enable_hwecc; in omap_select_ecc_scheme()
783 nand->ecc.correct = omap_correct_data_bch_sw; in omap_select_ecc_scheme()
784 nand->ecc.calculate = omap_calculate_ecc; in omap_select_ecc_scheme()
786 ecclayout->eccbytes = nand->ecc.bytes * eccsteps; in omap_select_ecc_scheme()
789 if (i % nand->ecc.bytes) in omap_select_ecc_scheme()
818 memset(&nand->ecc, 0, sizeof(struct nand_ecc_ctrl)); in omap_select_ecc_scheme()
819 nand->ecc.mode = NAND_ECC_HW; in omap_select_ecc_scheme()
820 nand->ecc.strength = 8; in omap_select_ecc_scheme()
821 nand->ecc.size = SECTOR_BYTES; in omap_select_ecc_scheme()
822 nand->ecc.bytes = 14; in omap_select_ecc_scheme()
823 nand->ecc.hwctl = omap_enable_hwecc; in omap_select_ecc_scheme()
824 nand->ecc.correct = omap_correct_data_bch; in omap_select_ecc_scheme()
825 nand->ecc.calculate = omap_calculate_ecc; in omap_select_ecc_scheme()
826 nand->ecc.read_page = omap_read_page_bch; in omap_select_ecc_scheme()
828 ecclayout->eccbytes = nand->ecc.bytes * eccsteps; in omap_select_ecc_scheme()
852 nand->ecc.mode = NAND_ECC_HW; in omap_select_ecc_scheme()
853 nand->ecc.size = SECTOR_BYTES; in omap_select_ecc_scheme()
854 nand->ecc.bytes = 26; in omap_select_ecc_scheme()
855 nand->ecc.strength = 16; in omap_select_ecc_scheme()
856 nand->ecc.hwctl = omap_enable_hwecc; in omap_select_ecc_scheme()
857 nand->ecc.correct = omap_correct_data_bch; in omap_select_ecc_scheme()
858 nand->ecc.calculate = omap_calculate_ecc; in omap_select_ecc_scheme()
859 nand->ecc.read_page = omap_read_page_bch; in omap_select_ecc_scheme()
861 ecclayout->eccbytes = nand->ecc.bytes * eccsteps; in omap_select_ecc_scheme()
865 ecclayout->oobfree[0].length = oobsize - nand->ecc.bytes - in omap_select_ecc_scheme()
879 nand->ecc.layout = ecclayout; in omap_select_ecc_scheme()
896 struct nand_chip *nand; in omap_nand_switch_ecc() local
905 nand = mtd_to_nand(mtd); in omap_nand_switch_ecc()
906 nand->options |= NAND_OWN_BUFFERS; in omap_nand_switch_ecc()
907 nand->options &= ~NAND_SUBPAGE_READ; in omap_nand_switch_ecc()
911 err = omap_select_ecc_scheme(nand, in omap_nand_switch_ecc()
915 err = omap_select_ecc_scheme(nand, in omap_nand_switch_ecc()
919 err = omap_select_ecc_scheme(nand, in omap_nand_switch_ecc()
928 err = omap_select_ecc_scheme(nand, in omap_nand_switch_ecc()
932 err = omap_select_ecc_scheme(nand, in omap_nand_switch_ecc()
963 int board_nand_init(struct nand_chip *nand) in board_nand_init() argument
994 nand->IO_ADDR_R = (void __iomem *)&gpmc_cfg->cs[cs].nand_dat; in board_nand_init()
995 nand->IO_ADDR_W = (void __iomem *)&gpmc_cfg->cs[cs].nand_cmd; in board_nand_init()
999 nand_set_controller_data(nand, &omap_nand_info[cs]); in board_nand_init()
1000 nand->cmd_ctrl = omap_nand_hwcontrol; in board_nand_init()
1001 nand->options |= NAND_NO_PADDING | NAND_CACHEPRG; in board_nand_init()
1002 nand->chip_delay = 100; in board_nand_init()
1003 nand->ecc.layout = &omap_ecclayout; in board_nand_init()
1008 nand->options |= NAND_BUSWIDTH_16; in board_nand_init()
1011 nand->options &= ~NAND_BUSWIDTH_16; in board_nand_init()
1016 err = omap_select_ecc_scheme(nand, CONFIG_NAND_OMAP_ECCSCHEME, in board_nand_init()
1020 err = omap_select_ecc_scheme(nand, OMAP_ECC_HAM1_CODE_SW, in board_nand_init()
1027 nand->read_buf = omap_nand_read_prefetch; in board_nand_init()
1029 if (nand->options & NAND_BUSWIDTH_16) in board_nand_init()
1030 nand->read_buf = nand_read_buf16; in board_nand_init()
1032 nand->read_buf = nand_read_buf; in board_nand_init()
1035 nand->dev_ready = omap_dev_ready; in board_nand_init()