2 * Copyright (c) 2011 The Chromium OS Authors.
4 * See file CREDITS for list of people who contributed to this
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License as
9 * published by the Free Software Foundation; either version 2 of
10 * the License, or (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but without any warranty; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
22 * This file is derived from the flashrom project.
25 struct ich7_spi_regs {
37 struct ich9_spi_regs {
38 uint32_t bfpr; /* 0x00 */
43 uint32_t fdata[16]; /* 0x10 */
44 uint32_t frap; /* 0x50 */
46 uint32_t _reserved1[3];
47 uint32_t pr[5]; /* 0x74 */
48 uint32_t _reserved2[2];
49 uint8_t ssfs; /* 0x90 */
51 uint16_t preop; /* 0x94 */
53 uint8_t opmenu[8]; /* 0x98 */
55 uint8_t _reserved3[12];
58 uint8_t _reserved4[8];
62 uint8_t _reserved5[4];
64 uint8_t _reserved6[28];
77 SPIS_RESERVED_MASK = 0x7ff0,
78 SSFS_RESERVED_MASK = 0x7fe2
88 SSFC_SCF_MASK = 0x070000,
89 SSFC_RESERVED = 0xf80000,
91 /* Mask for speed byte, biuts 23:16 of SSFC */
92 SSFC_SCF_33MHZ = 0x01,
99 HSFS_BERASE_MASK = 0x0018,
100 HSFS_BERASE_SHIFT = 3,
102 HSFS_FDOPSS = 0x2000,
104 HSFS_FLOCKDN = 0x8000
109 HSFC_FCYCLE_MASK = 0x0006,
110 HSFC_FCYCLE_SHIFT = 1,
111 HSFC_FDBC_MASK = 0x3f00,
117 SPI_OPCODE_TYPE_READ_NO_ADDRESS = 0,
118 SPI_OPCODE_TYPE_WRITE_NO_ADDRESS = 1,
119 SPI_OPCODE_TYPE_READ_WITH_ADDRESS = 2,
120 SPI_OPCODE_TYPE_WRITE_WITH_ADDRESS = 3
128 uint8_t cmd[ICH_MAX_CMD_LEN];
139 struct ich_spi_slave {
140 struct spi_slave slave;
141 struct spi_trans trans; /* current transaction in progress */
142 int speed; /* SPI speed in Hz */