2 * Copyright (c) 2011 The Chromium OS Authors.
4 * SPDX-License-Identifier: GPL-2.0+
6 * This file is derived from the flashrom project.
21 struct ich9_spi_regs {
22 uint32_t bfpr; /* 0x00 */
27 uint32_t fdata[16]; /* 0x10 */
28 uint32_t frap; /* 0x50 */
30 uint32_t _reserved1[3];
31 uint32_t pr[5]; /* 0x74 */
32 uint32_t _reserved2[2];
33 uint8_t ssfs; /* 0x90 */
35 uint16_t preop; /* 0x94 */
37 uint8_t opmenu[8]; /* 0x98 */
39 uint8_t _reserved3[12];
40 uint32_t fdoc; /* 0xb0 */
42 uint8_t _reserved4[8];
43 uint32_t afc; /* 0xc0 */
46 uint8_t _reserved5[4];
47 uint32_t fpb; /* 0xd0 */
48 uint8_t _reserved6[28];
49 uint32_t srdl; /* 0xf0 */
62 SPIS_RESERVED_MASK = 0x7ff0,
63 SSFS_RESERVED_MASK = 0x7fe2
73 SSFC_SCF_MASK = 0x070000,
74 SSFC_RESERVED = 0xf80000,
76 /* Mask for speed byte, biuts 23:16 of SSFC */
77 SSFC_SCF_33MHZ = 0x01,
84 HSFS_BERASE_MASK = 0x0018,
85 HSFS_BERASE_SHIFT = 3,
94 HSFC_FCYCLE_MASK = 0x0006,
95 HSFC_FCYCLE_SHIFT = 1,
96 HSFC_FDBC_MASK = 0x3f00,
102 SPI_OPCODE_TYPE_READ_NO_ADDRESS = 0,
103 SPI_OPCODE_TYPE_WRITE_NO_ADDRESS = 1,
104 SPI_OPCODE_TYPE_READ_WITH_ADDRESS = 2,
105 SPI_OPCODE_TYPE_WRITE_WITH_ADDRESS = 3
113 uint8_t cmd[ICH_MAX_CMD_LEN];
124 struct ich_spi_slave {
125 struct spi_slave slave;
126 struct spi_trans trans; /* current transaction in progress */
127 int speed; /* SPI speed in Hz */