linux/drivers/mtd/chips/jedec_probe.c

// SPDX-License-Identifier: GPL-2.0
/*
   Common Flash Interface probe code.
   (C) 2000 Red Hat.
   See JEDEC (http://www.jedec.org/) standard JESD21C (section 3.5)
   for the standard this probe goes back to.

   Occasionally maintained by Thayne Harbaugh tharbaugh at lnxi dot com
*/

#include <linux/module.h>
#include <linux/init.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <asm/io.h>
#include <asm/byteorder.h>
#include <linux/errno.h>
#include <linux/slab.h>
#include <linux/interrupt.h>

#include <linux/mtd/mtd.h>
#include <linux/mtd/map.h>
#include <linux/mtd/cfi.h>
#include <linux/mtd/gen_probe.h>

/* AMD */
#define AM29DL800BB
#define AM29DL800BT

#define AM29F800BB
#define AM29F800BT
#define AM29LV400BB
#define AM29LV400BT
#define AM29LV800BB
#define AM29LV800BT
#define AM29LV160DT
#define AM29LV160DB
#define AM29F017D
#define AM29F016D
#define AM29F080
#define AM29F040
#define AM29LV040B
#define AM29F032B
#define AM29F002T
#define AM29SL800DB
#define AM29SL800DT

/* Atmel */
#define AT49BV512
#define AT29LV512
#define AT49BV16X
#define AT49BV16XT
#define AT49BV32X
#define AT49BV32XT

/* Eon */
#define EN29LV400AT
#define EN29LV400AB
#define EN29SL800BB
#define EN29SL800BT

/* Fujitsu */
#define MBM29F040C
#define MBM29F800BA
#define MBM29LV650UE
#define MBM29LV320TE
#define MBM29LV320BE
#define MBM29LV160TE
#define MBM29LV160BE
#define MBM29LV800BA
#define MBM29LV800TA
#define MBM29LV400TC
#define MBM29LV400BC

/* Hyundai */
#define HY29F002T

/* Intel */
#define I28F004B3T
#define I28F004B3B
#define I28F400B3T
#define I28F400B3B
#define I28F008S5
#define I28F016S5
#define I28F008SA
#define I28F008B3T
#define I28F008B3B
#define I28F800B3T
#define I28F800B3B
#define I28F016S3
#define I28F016B3T
#define I28F016B3B
#define I28F160B3T
#define I28F160B3B
#define I28F320B3T
#define I28F320B3B
#define I28F640B3T
#define I28F640B3B
#define I28F640C3B
#define I28F160F3T
#define I28F160F3B
#define I28F160C3T
#define I28F160C3B
#define I82802AB
#define I82802AC

/* Macronix */
#define MX29LV040C
#define MX29LV160T
#define MX29LV160B
#define MX29F040
#define MX29F016
#define MX29F002T
#define MX29F004T
#define MX29F004B

/* NEC */
#define UPD29F064115

/* PMC */
#define PM49FL002
#define PM49FL004
#define PM49FL008

/* Sharp */
#define LH28F640BF

/* ST - www.st.com */
#define M29F800AB
#define M29W800DT
#define M29W800DB
#define M29W400DT
#define M29W400DB
#define M29W160DT
#define M29W160DB
#define M29W040B
#define M50FW040
#define M50FW080
#define M50FW016
#define M50LPW080
#define M50FLW080A
#define M50FLW080B
#define PSD4256G6V

/* SST */
#define SST29EE020
#define SST29LE020
#define SST29EE512
#define SST29LE512
#define SST39LF800
#define SST39LF160
#define SST39VF1601
#define SST39VF3201
#define SST39WF1601
#define SST39WF1602
#define SST39LF512
#define SST39LF010
#define SST39LF020
#define SST39LF040
#define SST39SF010A
#define SST39SF020A
#define SST39SF040
#define SST49LF004B
#define SST49LF040B
#define SST49LF008A
#define SST49LF030A
#define SST49LF040A
#define SST49LF080A
#define SST36VF3203

/* Toshiba */
#define TC58FVT160
#define TC58FVB160
#define TC58FVT321
#define TC58FVB321
#define TC58FVT641
#define TC58FVB641

/* Winbond */
#define W49V002A


/*
 * Unlock address sets for AMD command sets.
 * Intel command sets use the MTD_UADDR_UNNECESSARY.
 * Each identifier, except MTD_UADDR_UNNECESSARY, and
 * MTD_UADDR_NO_SUPPORT must be defined below in unlock_addrs[].
 * MTD_UADDR_NOT_SUPPORTED must be 0 so that structure
 * initialization need not require initializing all of the
 * unlock addresses for all bit widths.
 */
enum uaddr {};


struct unlock_addr {};


/*
 * I don't like the fact that the first entry in unlock_addrs[]
 * exists, but is for MTD_UADDR_NOT_SUPPORTED - and, therefore,
 * should not be used.  The  problem is that structures with
 * initializers have extra fields initialized to 0.  It is _very_
 * desirable to have the unlock address entries for unsupported
 * data widths automatically initialized - that means that
 * MTD_UADDR_NOT_SUPPORTED must be 0 and the first entry here
 * must go unused.
 */
static const struct unlock_addr  unlock_addrs[] =;

struct amd_flash_info {};

#define ERASEINFO(size,blocks)

#define SIZE_64KiB
#define SIZE_128KiB
#define SIZE_256KiB
#define SIZE_512KiB
#define SIZE_1MiB
#define SIZE_2MiB
#define SIZE_4MiB
#define SIZE_8MiB


/*
 * Please keep this list ordered by manufacturer!
 * Fortunately, the list isn't searched often and so a
 * slow, linear search isn't so bad.
 */
static const struct amd_flash_info jedec_table[] =;

static inline u32 jedec_read_mfr(struct map_info *map, uint32_t base,
	struct cfi_private *cfi)
{}

static inline u32 jedec_read_id(struct map_info *map, uint32_t base,
	struct cfi_private *cfi)
{}

static void jedec_reset(u32 base, struct map_info *map, struct cfi_private *cfi)
{}


static int cfi_jedec_setup(struct map_info *map, struct cfi_private *cfi, int index)
{}


/*
 * There is a BIG problem properly ID'ing the JEDEC device and guaranteeing
 * the mapped address, unlock addresses, and proper chip ID.  This function
 * attempts to minimize errors.  It is doubtfull that this probe will ever
 * be perfect - consequently there should be some module parameters that
 * could be manually specified to force the chip info.
 */
static inline int jedec_match( uint32_t base,
			       struct map_info *map,
			       struct cfi_private *cfi,
			       const struct amd_flash_info *finfo )
{}


static int jedec_probe_chip(struct map_info *map, __u32 base,
			    unsigned long *chip_map, struct cfi_private *cfi)
{}

static struct chip_probe jedec_chip_probe =;

static struct mtd_info *jedec_probe(struct map_info *map)
{}

static struct mtd_chip_driver jedec_chipdrv =;

static int __init jedec_probe_init(void)
{}

static void __exit jedec_probe_exit(void)
{}

module_init();
module_exit(jedec_probe_exit);

MODULE_LICENSE();
MODULE_AUTHOR();
MODULE_DESCRIPTION();