cachepc-linux

Fork of AMDESE/linux with modifications for CachePC side-channel attack
git clone https://git.sinitax.com/sinitax/cachepc-linux
Log | Files | Refs | README | LICENSE | sfeed.txt

nand-ecc-mxic.h (1341B)


      1/* SPDX-License-Identifier: GPL-2.0 */
      2/*
      3 * Copyright © 2019 Macronix
      4 * Author: Miquèl Raynal <miquel.raynal@bootlin.com>
      5 *
      6 * Header for the Macronix external ECC engine.
      7 */
      8
      9#ifndef __MTD_NAND_ECC_MXIC_H__
     10#define __MTD_NAND_ECC_MXIC_H__
     11
     12#include <linux/platform_device.h>
     13#include <linux/device.h>
     14
     15struct mxic_ecc_engine;
     16
     17#if IS_ENABLED(CONFIG_MTD_NAND_ECC_MXIC) && IS_REACHABLE(CONFIG_MTD_NAND_CORE)
     18
     19struct nand_ecc_engine_ops *mxic_ecc_get_pipelined_ops(void);
     20struct nand_ecc_engine *mxic_ecc_get_pipelined_engine(struct platform_device *spi_pdev);
     21void mxic_ecc_put_pipelined_engine(struct nand_ecc_engine *eng);
     22int mxic_ecc_process_data_pipelined(struct nand_ecc_engine *eng,
     23				    unsigned int direction, dma_addr_t dirmap);
     24
     25#else /* !CONFIG_MTD_NAND_ECC_MXIC */
     26
     27static inline struct nand_ecc_engine_ops *mxic_ecc_get_pipelined_ops(void)
     28{
     29	return NULL;
     30}
     31
     32static inline struct nand_ecc_engine *
     33mxic_ecc_get_pipelined_engine(struct platform_device *spi_pdev)
     34{
     35	return ERR_PTR(-EOPNOTSUPP);
     36}
     37
     38static inline void mxic_ecc_put_pipelined_engine(struct nand_ecc_engine *eng) {}
     39
     40static inline int mxic_ecc_process_data_pipelined(struct nand_ecc_engine *eng,
     41						  unsigned int direction,
     42						  dma_addr_t dirmap)
     43{
     44	return -EOPNOTSUPP;
     45}
     46
     47#endif /* CONFIG_MTD_NAND_ECC_MXIC */
     48
     49#endif /* __MTD_NAND_ECC_MXIC_H__ */