Deleted Added
full compact
cfi_reg.h (251118) cfi_reg.h (255207)
1/*-
2 * Copyright (c) 2007, Juniper Networks, Inc.
1/*-
2 * Copyright (c) 2007, Juniper Networks, Inc.
3 * Copyright (c) 2012-2013, SRI International
3 * All rights reserved.
4 *
4 * All rights reserved.
5 *
6 * Portions of this software were developed by SRI International and the
7 * University of Cambridge Computer Laboratory under DARPA/AFRL contract
8 * (FA8750-10-C-0237) ("CTSRD"), as part of the DARPA CRASH research
9 * programme.
10 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.

--- 8 unchanged lines hidden (view full) ---

21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
22 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
24 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
25 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
13 * are met:
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions and the following disclaimer.
16 * 2. Redistributions in binary form must reproduce the above copyright
17 * notice, this list of conditions and the following disclaimer in the
18 * documentation and/or other materials provided with the distribution.

--- 8 unchanged lines hidden (view full) ---

27 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
28 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
30 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
31 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 * SUCH DAMAGE.
34 *
29 * $FreeBSD: head/sys/dev/cfi/cfi_reg.h 251118 2013-05-30 01:22:50Z brooks $
35 * $FreeBSD: head/sys/dev/cfi/cfi_reg.h 255207 2013-09-04 17:19:21Z brooks $
30 */
31
32#ifndef _DEV_CFI_REG_H_
33#define _DEV_CFI_REG_H_
34
35struct cfi_qry {
36 u_char reserved[16];
37 u_char ident[3]; /* "QRY" */
38 u_char pri_vend[2];
39 u_char pri_vend_eqt[2];
40 u_char alt_vend[2];
41 u_char alt_vend_eqt[2];
42 /* System Interface Information. */
43 u_char min_vcc;
44 u_char max_vcc;
45 u_char min_vpp;
46 u_char max_vpp;
36 */
37
38#ifndef _DEV_CFI_REG_H_
39#define _DEV_CFI_REG_H_
40
41struct cfi_qry {
42 u_char reserved[16];
43 u_char ident[3]; /* "QRY" */
44 u_char pri_vend[2];
45 u_char pri_vend_eqt[2];
46 u_char alt_vend[2];
47 u_char alt_vend_eqt[2];
48 /* System Interface Information. */
49 u_char min_vcc;
50 u_char max_vcc;
51 u_char min_vpp;
52 u_char max_vpp;
47 u_char tto_byte_write; /* 2**n milliseconds. */
48 u_char tto_buf_write; /* 2**n milliseconds. */
53 u_char tto_byte_write; /* 2**n microseconds. */
54 u_char tto_buf_write; /* 2**n microseconds. */
49 u_char tto_block_erase; /* 2**n milliseconds. */
50 u_char tto_chip_erase; /* 2**n milliseconds. */
51 u_char mto_byte_write; /* 2**n times typical t/o. */
52 u_char mto_buf_write; /* 2**n times typical t/o. */
53 u_char mto_block_erase; /* 2**n times typical t/o. */
54 u_char mto_chip_erase; /* 2**n times typical t/o. */
55 /* Device Geometry Definition. */
56 u_char size; /* 2**n bytes. */

--- 8 unchanged lines hidden (view full) ---

65
66#define CFI_QRY_CMD_ADDR 0x55
67#define CFI_QRY_CMD_DATA 0x98
68
69#define CFI_QRY_IDENT offsetof(struct cfi_qry, ident)
70#define CFI_QRY_VEND offsetof(struct cfi_qry, pri_vend)
71
72#define CFI_QRY_TTO_WRITE offsetof(struct cfi_qry, tto_byte_write)
55 u_char tto_block_erase; /* 2**n milliseconds. */
56 u_char tto_chip_erase; /* 2**n milliseconds. */
57 u_char mto_byte_write; /* 2**n times typical t/o. */
58 u_char mto_buf_write; /* 2**n times typical t/o. */
59 u_char mto_block_erase; /* 2**n times typical t/o. */
60 u_char mto_chip_erase; /* 2**n times typical t/o. */
61 /* Device Geometry Definition. */
62 u_char size; /* 2**n bytes. */

--- 8 unchanged lines hidden (view full) ---

71
72#define CFI_QRY_CMD_ADDR 0x55
73#define CFI_QRY_CMD_DATA 0x98
74
75#define CFI_QRY_IDENT offsetof(struct cfi_qry, ident)
76#define CFI_QRY_VEND offsetof(struct cfi_qry, pri_vend)
77
78#define CFI_QRY_TTO_WRITE offsetof(struct cfi_qry, tto_byte_write)
79#define CFI_QRY_TTO_BUFWRITE offsetof(struct cfi_qry, tto_buf_write)
73#define CFI_QRY_TTO_ERASE offsetof(struct cfi_qry, tto_block_erase)
74#define CFI_QRY_MTO_WRITE offsetof(struct cfi_qry, mto_byte_write)
80#define CFI_QRY_TTO_ERASE offsetof(struct cfi_qry, tto_block_erase)
81#define CFI_QRY_MTO_WRITE offsetof(struct cfi_qry, mto_byte_write)
82#define CFI_QRY_MTO_BUFWRITE offsetof(struct cfi_qry, mto_buf_write)
75#define CFI_QRY_MTO_ERASE offsetof(struct cfi_qry, mto_block_erase)
76
77#define CFI_QRY_SIZE offsetof(struct cfi_qry, size)
78#define CFI_QRY_IFACE offsetof(struct cfi_qry, iface)
83#define CFI_QRY_MTO_ERASE offsetof(struct cfi_qry, mto_block_erase)
84
85#define CFI_QRY_SIZE offsetof(struct cfi_qry, size)
86#define CFI_QRY_IFACE offsetof(struct cfi_qry, iface)
87#define CFI_QRY_MAXBUF offsetof(struct cfi_qry, max_buf_write_size)
79#define CFI_QRY_NREGIONS offsetof(struct cfi_qry, nregions)
80#define CFI_QRY_REGION0 offsetof(struct cfi_qry, region)
81#define CFI_QRY_REGION(x) (CFI_QRY_REGION0 + (x) * 4)
82
83#define CFI_VEND_NONE 0x0000
84#define CFI_VEND_INTEL_ECS 0x0001
85#define CFI_VEND_AMD_SCS 0x0002
86#define CFI_VEND_INTEL_SCS 0x0003

--- 10 unchanged lines hidden (view full) ---

97/* Standard Command Set (aka Basic Command Set) */
98#define CFI_BCS_BLOCK_ERASE 0x20
99#define CFI_BCS_PROGRAM 0x40
100#define CFI_BCS_CLEAR_STATUS 0x50
101#define CFI_BCS_READ_STATUS 0x70
102#define CFI_BCS_ERASE_SUSPEND 0xb0
103#define CFI_BCS_ERASE_RESUME 0xd0 /* Equals CONFIRM */
104#define CFI_BCS_CONFIRM 0xd0
88#define CFI_QRY_NREGIONS offsetof(struct cfi_qry, nregions)
89#define CFI_QRY_REGION0 offsetof(struct cfi_qry, region)
90#define CFI_QRY_REGION(x) (CFI_QRY_REGION0 + (x) * 4)
91
92#define CFI_VEND_NONE 0x0000
93#define CFI_VEND_INTEL_ECS 0x0001
94#define CFI_VEND_AMD_SCS 0x0002
95#define CFI_VEND_INTEL_SCS 0x0003

--- 10 unchanged lines hidden (view full) ---

106/* Standard Command Set (aka Basic Command Set) */
107#define CFI_BCS_BLOCK_ERASE 0x20
108#define CFI_BCS_PROGRAM 0x40
109#define CFI_BCS_CLEAR_STATUS 0x50
110#define CFI_BCS_READ_STATUS 0x70
111#define CFI_BCS_ERASE_SUSPEND 0xb0
112#define CFI_BCS_ERASE_RESUME 0xd0 /* Equals CONFIRM */
113#define CFI_BCS_CONFIRM 0xd0
114#define CFI_BCS_BUF_PROG_SETUP 0xe8
105#define CFI_BCS_READ_ARRAY 0xff
106
107/* Intel commands. */
108#define CFI_INTEL_LB 0x01 /* Lock Block */
109#define CFI_INTEL_LBS 0x60 /* Lock Block Setup */
110#define CFI_INTEL_READ_ID 0x90 /* Read Identifier */
111#define CFI_INTEL_PP_SETUP 0xc0 /* Protection Program Setup */
112#define CFI_INTEL_UB 0xd0 /* Unlock Block */

--- 30 unchanged lines hidden ---
115#define CFI_BCS_READ_ARRAY 0xff
116
117/* Intel commands. */
118#define CFI_INTEL_LB 0x01 /* Lock Block */
119#define CFI_INTEL_LBS 0x60 /* Lock Block Setup */
120#define CFI_INTEL_READ_ID 0x90 /* Read Identifier */
121#define CFI_INTEL_PP_SETUP 0xc0 /* Protection Program Setup */
122#define CFI_INTEL_UB 0xd0 /* Unlock Block */

--- 30 unchanged lines hidden ---