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];
42 uint8_t _reserved4
[8];
46 uint8_t _reserved5
[4];
48 uint8_t _reserved6
[28];
61 SPIS_RESERVED_MASK
= 0x7ff0,
62 SSFS_RESERVED_MASK
= 0x7fe2
72 SSFC_SCF_MASK
= 0x070000,
73 SSFC_RESERVED
= 0xf80000,
75 /* Mask for speed byte, biuts 23:16 of SSFC */
76 SSFC_SCF_33MHZ
= 0x01,
83 HSFS_BERASE_MASK
= 0x0018,
84 HSFS_BERASE_SHIFT
= 3,
93 HSFC_FCYCLE_MASK
= 0x0006,
94 HSFC_FCYCLE_SHIFT
= 1,
95 HSFC_FDBC_MASK
= 0x3f00,
101 SPI_OPCODE_TYPE_READ_NO_ADDRESS
= 0,
102 SPI_OPCODE_TYPE_WRITE_NO_ADDRESS
= 1,
103 SPI_OPCODE_TYPE_READ_WITH_ADDRESS
= 2,
104 SPI_OPCODE_TYPE_WRITE_WITH_ADDRESS
= 3
112 uint8_t cmd
[ICH_MAX_CMD_LEN
];
123 struct ich_spi_slave
{
124 struct spi_slave slave
;
125 struct spi_trans trans
; /* current transaction in progress */
126 int speed
; /* SPI speed in Hz */