linux/include/linux/mtd/cfi_endian.h

/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
 * Copyright © 2001-2010 David Woodhouse <[email protected]>
 */

#include <asm/byteorder.h>

#define CFI_HOST_ENDIAN
#define CFI_LITTLE_ENDIAN
#define CFI_BIG_ENDIAN

#if !defined(CONFIG_MTD_CFI_ADV_OPTIONS) || defined(CONFIG_MTD_CFI_NOSWAP)
#define CFI_DEFAULT_ENDIAN
#elif defined(CONFIG_MTD_CFI_LE_BYTE_SWAP)
#define CFI_DEFAULT_ENDIAN
#elif defined(CONFIG_MTD_CFI_BE_BYTE_SWAP)
#define CFI_DEFAULT_ENDIAN
#else
#error No CFI endianness defined
#endif

#define cfi_default(s)
#define cfi_be(s)
#define cfi_le(s)
#define cfi_host(s)

#define cpu_to_cfi8(map, x)
#define cfi8_to_cpu(map, x)
#define cpu_to_cfi16(map, x)
#define cpu_to_cfi32(map, x)
#define cpu_to_cfi64(map, x)
#define cfi16_to_cpu(map, x)
#define cfi32_to_cpu(map, x)
#define cfi64_to_cpu(map, x)

#define _cpu_to_cfi(w, s, x)
#define _cfi_to_cpu(w, s, x)
#define _swap_to_cfi(w, s, x)
#define _swap_to_cpu(w, s, x)