// SPDX-License-Identifier: GPL-2.0 /* * Copyright (C) 2000 Steven J. Hill ([email protected]) * 2002-2006 Thomas Gleixner ([email protected]) * * Credits: * David Woodhouse for adding multichip support * * Aleph One Ltd. and Toby Churchill Ltd. for supporting the * rework for 2K page size chips * * This file contains all ONFI helpers. */ #include <linux/slab.h> #include "internals.h" #define ONFI_PARAM_PAGES … u16 onfi_crc16(u16 crc, u8 const *p, size_t len) { … } /* Parse the Extended Parameter Page. */ static int nand_flash_detect_ext_param_page(struct nand_chip *chip, struct nand_onfi_params *p) { … } /* * Recover data with bit-wise majority */ static void nand_bit_wise_majority(const void **srcbufs, unsigned int nsrcbufs, void *dstbuf, unsigned int bufsize) { … } /* * Check if the NAND chip is ONFI compliant, returns 1 if it is, 0 otherwise. */ int nand_onfi_detect(struct nand_chip *chip) { … }