xref: /linux/drivers/mtd/devices/serial_flash_cmds.h (revision 75bf465f0bc33e9b776a46d6a1b9b990f5fb7c37)
1*8d36fe1eSThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-only */
25549fbd5SLee Jones /*
35549fbd5SLee Jones  * Generic/SFDP Flash Commands and Device Capabilities
45549fbd5SLee Jones  *
55549fbd5SLee Jones  * Copyright (C) 2013 Lee Jones <lee.jones@lianro.org>
65549fbd5SLee Jones  */
75549fbd5SLee Jones 
85549fbd5SLee Jones #ifndef _MTD_SERIAL_FLASH_CMDS_H
95549fbd5SLee Jones #define _MTD_SERIAL_FLASH_CMDS_H
105549fbd5SLee Jones 
115549fbd5SLee Jones /* Generic Flash Commands/OPCODEs */
1292d3af9aSBrian Norris #define SPINOR_OP_WRVCR		0x81
1392d3af9aSBrian Norris #define SPINOR_OP_RDVCR		0x85
145549fbd5SLee Jones 
155549fbd5SLee Jones /* JEDEC Standard - Serial Flash Discoverable Parmeters (SFDP) Commands */
1692d3af9aSBrian Norris #define SPINOR_OP_WRITE		0x02	/* PAGE PROGRAM */
1792d3af9aSBrian Norris #define SPINOR_OP_WRITE_1_1_2	0xa2	/* DUAL INPUT PROGRAM */
1892d3af9aSBrian Norris #define SPINOR_OP_WRITE_1_2_2	0xd2	/* DUAL INPUT EXT PROGRAM */
1992d3af9aSBrian Norris #define SPINOR_OP_WRITE_1_1_4	0x32	/* QUAD INPUT PROGRAM */
2092d3af9aSBrian Norris #define SPINOR_OP_WRITE_1_4_4	0x12	/* QUAD INPUT EXT PROGRAM */
215549fbd5SLee Jones 
225549fbd5SLee Jones /* Configuration flags */
235549fbd5SLee Jones #define FLASH_FLAG_SINGLE	0x000000ff
245549fbd5SLee Jones #define FLASH_FLAG_READ_WRITE	0x00000001
255549fbd5SLee Jones #define FLASH_FLAG_READ_FAST	0x00000002
265549fbd5SLee Jones #define FLASH_FLAG_SE_4K	0x00000004
275549fbd5SLee Jones #define FLASH_FLAG_SE_32K	0x00000008
285549fbd5SLee Jones #define FLASH_FLAG_CE		0x00000010
295549fbd5SLee Jones #define FLASH_FLAG_32BIT_ADDR	0x00000020
305549fbd5SLee Jones #define FLASH_FLAG_RESET	0x00000040
315549fbd5SLee Jones #define FLASH_FLAG_DYB_LOCKING	0x00000080
325549fbd5SLee Jones 
335549fbd5SLee Jones #define FLASH_FLAG_DUAL		0x0000ff00
345549fbd5SLee Jones #define FLASH_FLAG_READ_1_1_2	0x00000100
355549fbd5SLee Jones #define FLASH_FLAG_READ_1_2_2	0x00000200
365549fbd5SLee Jones #define FLASH_FLAG_READ_2_2_2	0x00000400
375549fbd5SLee Jones #define FLASH_FLAG_WRITE_1_1_2	0x00001000
385549fbd5SLee Jones #define FLASH_FLAG_WRITE_1_2_2	0x00002000
395549fbd5SLee Jones #define FLASH_FLAG_WRITE_2_2_2	0x00004000
405549fbd5SLee Jones 
415549fbd5SLee Jones #define FLASH_FLAG_QUAD		0x00ff0000
425549fbd5SLee Jones #define FLASH_FLAG_READ_1_1_4	0x00010000
435549fbd5SLee Jones #define FLASH_FLAG_READ_1_4_4	0x00020000
445549fbd5SLee Jones #define FLASH_FLAG_READ_4_4_4	0x00040000
455549fbd5SLee Jones #define FLASH_FLAG_WRITE_1_1_4	0x00100000
465549fbd5SLee Jones #define FLASH_FLAG_WRITE_1_4_4	0x00200000
475549fbd5SLee Jones #define FLASH_FLAG_WRITE_4_4_4	0x00400000
485549fbd5SLee Jones 
495549fbd5SLee Jones #endif /* _MTD_SERIAL_FLASH_CMDS_H */
50