2019-06-04 11:11:33 +03:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
2005-07-11 14:41:53 +04:00
|
|
|
/*
|
|
|
|
* linux/include/linux/mtd/onenand.h
|
|
|
|
*
|
mtd: OneNAND OTP support rework
What is OTP in OneNAND?
The device includes,
1. one block-sized OTP (One Time Programmable) area and
2. user-controlled 1st block OTP(Block 0)
that can be used to increase system security or to provide
identification capabilities.
What is done?
In OneNAND, one block of the NAND Array is set aside as an OTP
memory area, and 1st Block (Block 0) can be used as OTP area.
This area, available to the user, can be configured and locked
with secured user information. The OTP block can be read,
programmed and locked using the same operations as any other NAND
Flash Array memory block. After issuing an OTP-Lock, OTP block
cannot be erased. OTP block is fully-guaranteed to be a good
block.
Why it is done?
Locking the 1st Block OTP has the effect of a 'Write-protect' to
guard against accidental re-programming of data stored in the 1st
block and OTP Block.
Which problem it solves?
OTP support is provided in the existing implementation of
OneNAND/Flex-OneNAND driver, but it is not working with OneNAND
devices. Have observed the following in current OTP OneNAND Implmentation,
1. DataSheet specific sequence to lock the OTP Area is not followed.
2. Certain functions are quiet generic to cope with OTP specific activity.
This patch re-implements OTP support for OneNAND device.
How it is done?
For all blocks, 8th word is available to the user.
However, in case of OTP Block, 8th word of sector 0, page 0 is reserved as
OTP Locking Bit area. Therefore, in case of OTP Block, user usage on this
area is prohibited. Condition specific values are entered in the 8th word,
sector0, page 0 of the OTP block during the process of issuing an OTP-Lock.
The possible conditions are:
1. Only 1st Block Lock
2. Only OTP Block Lock
3. Lock both the 1st Block and the OTP Block
What Other feature additions have been done in this patch?
This patch adds feature for:
1. Only 1st Block Lock
2. Lock both the 1st Block and the OTP Blocks
Re-implemented OTP support for OneNAND
Added following features to OneNAND
1. Lock only 1st Block in OneNAND
2. Lock BOTH 1st Block and OTP Block in OneNAND
[comments were slightly tweaked by Artem]
Signed-off-by: Amul Kumar Saha <amul.saha@samsung.com>
Reviewed-by: Adrian Hunter <adrian.hunter@nokia.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2009-10-21 15:30:05 +04:00
|
|
|
* Copyright © 2005-2009 Samsung Electronics
|
2005-07-11 14:41:53 +04:00
|
|
|
* Kyungmin Park <kyungmin.park@samsung.com>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __LINUX_MTD_ONENAND_H
|
|
|
|
#define __LINUX_MTD_ONENAND_H
|
|
|
|
|
|
|
|
#include <linux/spinlock.h>
|
2006-11-16 05:23:48 +03:00
|
|
|
#include <linux/completion.h>
|
2009-09-21 01:28:14 +04:00
|
|
|
#include <linux/mtd/flashchip.h>
|
2005-07-11 14:41:53 +04:00
|
|
|
#include <linux/mtd/onenand_regs.h>
|
2005-09-03 10:15:48 +04:00
|
|
|
#include <linux/mtd/bbm.h>
|
2005-07-11 14:41:53 +04:00
|
|
|
|
2009-05-13 00:46:57 +04:00
|
|
|
#define MAX_DIES 2
|
2005-07-11 14:41:53 +04:00
|
|
|
#define MAX_BUFFERRAM 2
|
|
|
|
|
|
|
|
/* Scan and identify a OneNAND device */
|
|
|
|
extern int onenand_scan(struct mtd_info *mtd, int max_chips);
|
|
|
|
/* Free resources held by the OneNAND device */
|
|
|
|
extern void onenand_release(struct mtd_info *mtd);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* struct onenand_bufferram - OneNAND BufferRAM Data
|
2007-02-02 03:29:36 +03:00
|
|
|
* @blockpage: block & page address in BufferRAM
|
2005-07-11 14:41:53 +04:00
|
|
|
*/
|
|
|
|
struct onenand_bufferram {
|
2007-02-02 03:29:36 +03:00
|
|
|
int blockpage;
|
2005-07-11 14:41:53 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* struct onenand_chip - OneNAND Private Flash Chip Data
|
2006-06-29 08:48:38 +04:00
|
|
|
* @base: [BOARDSPECIFIC] address to access OneNAND
|
2009-05-13 00:46:57 +04:00
|
|
|
* @dies: [INTERN][FLEX-ONENAND] number of dies on chip
|
|
|
|
* @boundary: [INTERN][FLEX-ONENAND] Boundary of the dies
|
|
|
|
* @diesize: [INTERN][FLEX-ONENAND] Size of the dies
|
2006-06-29 08:48:38 +04:00
|
|
|
* @chipsize: [INTERN] the size of one chip for multichip arrays
|
2009-05-13 00:46:57 +04:00
|
|
|
* FIXME For Flex-OneNAND, chipsize holds maximum possible
|
|
|
|
* device size ie when all blocks are considered MLC
|
2006-06-29 08:48:38 +04:00
|
|
|
* @device_id: [INTERN] device ID
|
|
|
|
* @density_mask: chip density, used for DDP devices
|
|
|
|
* @verstion_id: [INTERN] version ID
|
|
|
|
* @options: [BOARDSPECIFIC] various chip options. They can
|
|
|
|
* partly be set to inform onenand_scan about
|
|
|
|
* @erase_shift: [INTERN] number of address bits in a block
|
|
|
|
* @page_shift: [INTERN] number of address bits in a page
|
|
|
|
* @page_mask: [INTERN] a page per block mask
|
[MTD] [OneNAND] 2X program support
The 2X Program is an extension of Program Operation.
Since the device is equipped with two DataRAMs, and two-plane NAND Flash
memory array, these two component enables simultaneous program of 4KiB.
Plane1 has only even blocks such as block0, block2, block4 while Plane2
has only odd blocks such as block1, block3, block5.
So MTD regards it as 4KiB page size and 256KiB block size
Now the following chips support it. (KFXXX16Q2M)
Demux: KFG2G16Q2M, KFH4G16Q2M, KFW8G16Q2M,
Mux: KFM2G16Q2M, KFN4G16Q2M,
And more recent chips
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2007-06-30 08:57:49 +04:00
|
|
|
* @writesize: [INTERN] a real page size
|
2006-06-29 08:48:38 +04:00
|
|
|
* @bufferram_index: [INTERN] BufferRAM index
|
|
|
|
* @bufferram: [INTERN] BufferRAM info
|
|
|
|
* @readw: [REPLACEABLE] hardware specific function for read short
|
|
|
|
* @writew: [REPLACEABLE] hardware specific function for write short
|
|
|
|
* @command: [REPLACEABLE] hardware specific function for writing
|
|
|
|
* commands to the chip
|
|
|
|
* @wait: [REPLACEABLE] hardware specific function for wait on ready
|
2009-05-13 00:46:57 +04:00
|
|
|
* @bbt_wait: [REPLACEABLE] hardware specific function for bbt wait on ready
|
|
|
|
* @unlock_all: [REPLACEABLE] hardware specific function for unlock all
|
2006-06-29 08:48:38 +04:00
|
|
|
* @read_bufferram: [REPLACEABLE] hardware specific function for BufferRAM Area
|
|
|
|
* @write_bufferram: [REPLACEABLE] hardware specific function for BufferRAM Area
|
|
|
|
* @read_word: [REPLACEABLE] hardware specific function for read
|
|
|
|
* register of OneNAND
|
|
|
|
* @write_word: [REPLACEABLE] hardware specific function for write
|
|
|
|
* register of OneNAND
|
|
|
|
* @mmcontrol: sync burst read function
|
2010-05-28 06:03:11 +04:00
|
|
|
* @chip_probe: [REPLACEABLE] hardware specific function for chip probe
|
2006-06-29 08:48:38 +04:00
|
|
|
* @block_markbad: function to mark a block as bad
|
|
|
|
* @scan_bbt: [REPLACEALBE] hardware specific function for scanning
|
|
|
|
* Bad block Table
|
|
|
|
* @chip_lock: [INTERN] spinlock used to protect access to this
|
|
|
|
* structure and the chip
|
|
|
|
* @wq: [INTERN] wait queue to sleep on if a OneNAND
|
|
|
|
* operation is in progress
|
|
|
|
* @state: [INTERN] the current state of the OneNAND device
|
2007-03-09 04:08:11 +03:00
|
|
|
* @page_buf: [INTERN] page main data buffer
|
|
|
|
* @oob_buf: [INTERN] page oob data buffer
|
2006-12-22 10:21:54 +03:00
|
|
|
* @subpagesize: [INTERN] holds the subpagesize
|
2006-06-29 08:48:38 +04:00
|
|
|
* @bbm: [REPLACEABLE] pointer to Bad Block Management
|
|
|
|
* @priv: [OPTIONAL] pointer to private chip date
|
2005-07-11 14:41:53 +04:00
|
|
|
*/
|
|
|
|
struct onenand_chip {
|
|
|
|
void __iomem *base;
|
2009-05-13 00:46:57 +04:00
|
|
|
unsigned dies;
|
|
|
|
unsigned boundary[MAX_DIES];
|
|
|
|
loff_t diesize[MAX_DIES];
|
2005-07-11 14:41:53 +04:00
|
|
|
unsigned int chipsize;
|
|
|
|
unsigned int device_id;
|
2006-09-26 13:45:28 +04:00
|
|
|
unsigned int version_id;
|
2009-05-13 00:46:57 +04:00
|
|
|
unsigned int technology;
|
2005-09-29 07:53:16 +04:00
|
|
|
unsigned int density_mask;
|
2005-07-11 14:41:53 +04:00
|
|
|
unsigned int options;
|
2019-04-17 15:36:35 +03:00
|
|
|
unsigned int badblockpos;
|
2005-07-11 14:41:53 +04:00
|
|
|
|
|
|
|
unsigned int erase_shift;
|
|
|
|
unsigned int page_shift;
|
|
|
|
unsigned int page_mask;
|
[MTD] [OneNAND] 2X program support
The 2X Program is an extension of Program Operation.
Since the device is equipped with two DataRAMs, and two-plane NAND Flash
memory array, these two component enables simultaneous program of 4KiB.
Plane1 has only even blocks such as block0, block2, block4 while Plane2
has only odd blocks such as block1, block3, block5.
So MTD regards it as 4KiB page size and 256KiB block size
Now the following chips support it. (KFXXX16Q2M)
Demux: KFG2G16Q2M, KFH4G16Q2M, KFW8G16Q2M,
Mux: KFM2G16Q2M, KFN4G16Q2M,
And more recent chips
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2007-06-30 08:57:49 +04:00
|
|
|
unsigned int writesize;
|
2005-07-11 14:41:53 +04:00
|
|
|
|
|
|
|
unsigned int bufferram_index;
|
|
|
|
struct onenand_bufferram bufferram[MAX_BUFFERRAM];
|
|
|
|
|
|
|
|
int (*command)(struct mtd_info *mtd, int cmd, loff_t address, size_t len);
|
|
|
|
int (*wait)(struct mtd_info *mtd, int state);
|
2009-05-13 00:46:57 +04:00
|
|
|
int (*bbt_wait)(struct mtd_info *mtd, int state);
|
|
|
|
void (*unlock_all)(struct mtd_info *mtd);
|
2005-07-11 14:41:53 +04:00
|
|
|
int (*read_bufferram)(struct mtd_info *mtd, int area,
|
|
|
|
unsigned char *buffer, int offset, size_t count);
|
|
|
|
int (*write_bufferram)(struct mtd_info *mtd, int area,
|
|
|
|
const unsigned char *buffer, int offset, size_t count);
|
|
|
|
unsigned short (*read_word)(void __iomem *addr);
|
|
|
|
void (*write_word)(unsigned short value, void __iomem *addr);
|
2005-09-03 10:07:19 +04:00
|
|
|
void (*mmcontrol)(struct mtd_info *mtd, int sync_read);
|
2010-05-28 06:03:11 +04:00
|
|
|
int (*chip_probe)(struct mtd_info *mtd);
|
2005-09-03 10:15:48 +04:00
|
|
|
int (*block_markbad)(struct mtd_info *mtd, loff_t ofs);
|
|
|
|
int (*scan_bbt)(struct mtd_info *mtd);
|
2010-02-19 17:39:52 +03:00
|
|
|
int (*enable)(struct mtd_info *mtd);
|
|
|
|
int (*disable)(struct mtd_info *mtd);
|
2005-07-11 14:41:53 +04:00
|
|
|
|
2006-11-16 05:23:48 +03:00
|
|
|
struct completion complete;
|
|
|
|
int irq;
|
|
|
|
|
2005-07-11 14:41:53 +04:00
|
|
|
spinlock_t chip_lock;
|
|
|
|
wait_queue_head_t wq;
|
2009-09-21 01:28:14 +04:00
|
|
|
flstate_t state;
|
2005-12-16 05:17:29 +03:00
|
|
|
unsigned char *page_buf;
|
2007-03-09 04:08:11 +03:00
|
|
|
unsigned char *oob_buf;
|
2010-04-28 19:46:46 +04:00
|
|
|
#ifdef CONFIG_MTD_ONENAND_VERIFY_WRITE
|
|
|
|
unsigned char *verify_buf;
|
|
|
|
#endif
|
2005-07-11 14:41:53 +04:00
|
|
|
|
2006-12-22 10:21:54 +03:00
|
|
|
int subpagesize;
|
2005-07-11 14:41:53 +04:00
|
|
|
|
2006-05-28 00:16:10 +04:00
|
|
|
void *bbm;
|
2005-09-03 10:15:48 +04:00
|
|
|
|
2005-07-11 14:41:53 +04:00
|
|
|
void *priv;
|
2010-11-03 13:55:19 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Shows that the current operation is composed
|
|
|
|
* of sequence of commands. For example, cache program.
|
|
|
|
* Such command status OnGo bit is checked at the end of
|
|
|
|
* sequence.
|
|
|
|
*/
|
|
|
|
unsigned int ongoing;
|
2005-07-11 14:41:53 +04:00
|
|
|
};
|
|
|
|
|
2005-09-03 10:20:08 +04:00
|
|
|
/*
|
|
|
|
* Helper macros
|
|
|
|
*/
|
mtd: OneNAND OTP support rework
What is OTP in OneNAND?
The device includes,
1. one block-sized OTP (One Time Programmable) area and
2. user-controlled 1st block OTP(Block 0)
that can be used to increase system security or to provide
identification capabilities.
What is done?
In OneNAND, one block of the NAND Array is set aside as an OTP
memory area, and 1st Block (Block 0) can be used as OTP area.
This area, available to the user, can be configured and locked
with secured user information. The OTP block can be read,
programmed and locked using the same operations as any other NAND
Flash Array memory block. After issuing an OTP-Lock, OTP block
cannot be erased. OTP block is fully-guaranteed to be a good
block.
Why it is done?
Locking the 1st Block OTP has the effect of a 'Write-protect' to
guard against accidental re-programming of data stored in the 1st
block and OTP Block.
Which problem it solves?
OTP support is provided in the existing implementation of
OneNAND/Flex-OneNAND driver, but it is not working with OneNAND
devices. Have observed the following in current OTP OneNAND Implmentation,
1. DataSheet specific sequence to lock the OTP Area is not followed.
2. Certain functions are quiet generic to cope with OTP specific activity.
This patch re-implements OTP support for OneNAND device.
How it is done?
For all blocks, 8th word is available to the user.
However, in case of OTP Block, 8th word of sector 0, page 0 is reserved as
OTP Locking Bit area. Therefore, in case of OTP Block, user usage on this
area is prohibited. Condition specific values are entered in the 8th word,
sector0, page 0 of the OTP block during the process of issuing an OTP-Lock.
The possible conditions are:
1. Only 1st Block Lock
2. Only OTP Block Lock
3. Lock both the 1st Block and the OTP Block
What Other feature additions have been done in this patch?
This patch adds feature for:
1. Only 1st Block Lock
2. Lock both the 1st Block and the OTP Blocks
Re-implemented OTP support for OneNAND
Added following features to OneNAND
1. Lock only 1st Block in OneNAND
2. Lock BOTH 1st Block and OTP Block in OneNAND
[comments were slightly tweaked by Artem]
Signed-off-by: Amul Kumar Saha <amul.saha@samsung.com>
Reviewed-by: Adrian Hunter <adrian.hunter@nokia.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2009-10-21 15:30:05 +04:00
|
|
|
#define ONENAND_PAGES_PER_BLOCK (1<<6)
|
|
|
|
|
2005-07-11 14:41:53 +04:00
|
|
|
#define ONENAND_CURRENT_BUFFERRAM(this) (this->bufferram_index)
|
|
|
|
#define ONENAND_NEXT_BUFFERRAM(this) (this->bufferram_index ^ 1)
|
|
|
|
#define ONENAND_SET_NEXT_BUFFERRAM(this) (this->bufferram_index ^= 1)
|
2007-01-04 10:51:26 +03:00
|
|
|
#define ONENAND_SET_PREV_BUFFERRAM(this) (this->bufferram_index ^= 1)
|
[MTD] [OneNAND] 2X program support
The 2X Program is an extension of Program Operation.
Since the device is equipped with two DataRAMs, and two-plane NAND Flash
memory array, these two component enables simultaneous program of 4KiB.
Plane1 has only even blocks such as block0, block2, block4 while Plane2
has only odd blocks such as block1, block3, block5.
So MTD regards it as 4KiB page size and 256KiB block size
Now the following chips support it. (KFXXX16Q2M)
Demux: KFG2G16Q2M, KFH4G16Q2M, KFW8G16Q2M,
Mux: KFM2G16Q2M, KFN4G16Q2M,
And more recent chips
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2007-06-30 08:57:49 +04:00
|
|
|
#define ONENAND_SET_BUFFERRAM0(this) (this->bufferram_index = 0)
|
|
|
|
#define ONENAND_SET_BUFFERRAM1(this) (this->bufferram_index = 1)
|
2005-07-11 14:41:53 +04:00
|
|
|
|
2009-05-13 00:46:57 +04:00
|
|
|
#define FLEXONENAND(this) \
|
|
|
|
(this->device_id & DEVICE_IS_FLEXONENAND)
|
2005-09-03 10:20:08 +04:00
|
|
|
#define ONENAND_GET_SYS_CFG1(this) \
|
|
|
|
(this->read_word(this->base + ONENAND_REG_SYS_CFG1))
|
|
|
|
#define ONENAND_SET_SYS_CFG1(v, this) \
|
|
|
|
(this->write_word(v, this->base + ONENAND_REG_SYS_CFG1))
|
|
|
|
|
2007-01-15 11:09:14 +03:00
|
|
|
#define ONENAND_IS_DDP(this) \
|
|
|
|
(this->device_id & ONENAND_DEVICE_IS_DDP)
|
|
|
|
|
2009-05-13 00:46:57 +04:00
|
|
|
#define ONENAND_IS_MLC(this) \
|
|
|
|
(this->technology & ONENAND_TECHNOLOGY_IS_MLC)
|
|
|
|
|
[MTD] [OneNAND] 2X program support
The 2X Program is an extension of Program Operation.
Since the device is equipped with two DataRAMs, and two-plane NAND Flash
memory array, these two component enables simultaneous program of 4KiB.
Plane1 has only even blocks such as block0, block2, block4 while Plane2
has only odd blocks such as block1, block3, block5.
So MTD regards it as 4KiB page size and 256KiB block size
Now the following chips support it. (KFXXX16Q2M)
Demux: KFG2G16Q2M, KFH4G16Q2M, KFW8G16Q2M,
Mux: KFM2G16Q2M, KFN4G16Q2M,
And more recent chips
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2007-06-30 08:57:49 +04:00
|
|
|
#ifdef CONFIG_MTD_ONENAND_2X_PROGRAM
|
|
|
|
#define ONENAND_IS_2PLANE(this) \
|
|
|
|
(this->options & ONENAND_HAS_2PLANE)
|
|
|
|
#else
|
|
|
|
#define ONENAND_IS_2PLANE(this) (0)
|
|
|
|
#endif
|
|
|
|
|
2010-11-03 13:55:19 +03:00
|
|
|
#define ONENAND_IS_CACHE_PROGRAM(this) \
|
|
|
|
(this->options & ONENAND_HAS_CACHE_PROGRAM)
|
|
|
|
|
2011-06-22 09:16:49 +04:00
|
|
|
#define ONENAND_IS_NOP_1(this) \
|
|
|
|
(this->options & ONENAND_HAS_NOP_1)
|
|
|
|
|
2006-05-12 18:02:31 +04:00
|
|
|
/* Check byte access in OneNAND */
|
|
|
|
#define ONENAND_CHECK_BYTE_ACCESS(addr) (addr & 0x1)
|
|
|
|
|
2019-04-17 15:36:35 +03:00
|
|
|
#define ONENAND_BADBLOCK_POS 0
|
|
|
|
|
2005-07-11 14:41:53 +04:00
|
|
|
/*
|
|
|
|
* Options bits
|
|
|
|
*/
|
2006-09-26 13:45:28 +04:00
|
|
|
#define ONENAND_HAS_CONT_LOCK (0x0001)
|
|
|
|
#define ONENAND_HAS_UNLOCK_ALL (0x0002)
|
[MTD] [OneNAND] 2X program support
The 2X Program is an extension of Program Operation.
Since the device is equipped with two DataRAMs, and two-plane NAND Flash
memory array, these two component enables simultaneous program of 4KiB.
Plane1 has only even blocks such as block0, block2, block4 while Plane2
has only odd blocks such as block1, block3, block5.
So MTD regards it as 4KiB page size and 256KiB block size
Now the following chips support it. (KFXXX16Q2M)
Demux: KFG2G16Q2M, KFH4G16Q2M, KFW8G16Q2M,
Mux: KFM2G16Q2M, KFN4G16Q2M,
And more recent chips
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2007-06-30 08:57:49 +04:00
|
|
|
#define ONENAND_HAS_2PLANE (0x0004)
|
2010-04-28 19:46:45 +04:00
|
|
|
#define ONENAND_HAS_4KB_PAGE (0x0008)
|
2010-11-03 13:55:19 +03:00
|
|
|
#define ONENAND_HAS_CACHE_PROGRAM (0x0010)
|
2011-06-22 09:16:49 +04:00
|
|
|
#define ONENAND_HAS_NOP_1 (0x0020)
|
2009-05-13 00:46:57 +04:00
|
|
|
#define ONENAND_SKIP_UNLOCK_CHECK (0x0100)
|
2005-12-16 05:17:29 +03:00
|
|
|
#define ONENAND_PAGEBUF_ALLOC (0x1000)
|
2007-03-09 04:08:11 +03:00
|
|
|
#define ONENAND_OOBBUF_ALLOC (0x2000)
|
2011-02-17 14:44:41 +03:00
|
|
|
#define ONENAND_SKIP_INITIAL_UNLOCKING (0x4000)
|
2005-07-11 14:41:53 +04:00
|
|
|
|
2010-04-28 19:46:45 +04:00
|
|
|
#define ONENAND_IS_4KB_PAGE(this) \
|
|
|
|
(this->options & ONENAND_HAS_4KB_PAGE)
|
|
|
|
|
2005-07-11 14:41:53 +04:00
|
|
|
/*
|
|
|
|
* OneNAND Flash Manufacturer ID Codes
|
|
|
|
*/
|
|
|
|
#define ONENAND_MFR_SAMSUNG 0xec
|
2009-05-05 12:04:19 +04:00
|
|
|
#define ONENAND_MFR_NUMONYX 0x20
|
2005-07-11 14:41:53 +04:00
|
|
|
|
|
|
|
/**
|
2006-06-29 08:48:38 +04:00
|
|
|
* struct onenand_manufacturers - NAND Flash Manufacturer ID Structure
|
|
|
|
* @name: Manufacturer name
|
|
|
|
* @id: manufacturer ID code of device.
|
2005-07-11 14:41:53 +04:00
|
|
|
*/
|
|
|
|
struct onenand_manufacturers {
|
|
|
|
int id;
|
|
|
|
char *name;
|
|
|
|
};
|
|
|
|
|
2008-04-14 18:20:38 +04:00
|
|
|
int onenand_bbt_read_oob(struct mtd_info *mtd, loff_t from,
|
|
|
|
struct mtd_oob_ops *ops);
|
2009-05-13 00:46:57 +04:00
|
|
|
unsigned onenand_block(struct onenand_chip *this, loff_t addr);
|
|
|
|
loff_t onenand_addr(struct onenand_chip *this, int block);
|
|
|
|
int flexonenand_region(struct mtd_info *mtd, loff_t addr);
|
2008-04-14 18:20:38 +04:00
|
|
|
|
2009-09-18 23:51:44 +04:00
|
|
|
struct mtd_partition;
|
|
|
|
|
|
|
|
struct onenand_platform_data {
|
|
|
|
void (*mmcontrol)(struct mtd_info *mtd, int sync_read);
|
2010-04-28 19:46:47 +04:00
|
|
|
int (*read_bufferram)(struct mtd_info *mtd, int area,
|
|
|
|
unsigned char *buffer, int offset, size_t count);
|
2009-09-18 23:51:44 +04:00
|
|
|
struct mtd_partition *parts;
|
|
|
|
unsigned int nr_parts;
|
|
|
|
};
|
|
|
|
|
2005-07-11 14:41:53 +04:00
|
|
|
#endif /* __LINUX_MTD_ONENAND_H */
|