blob: 01d8e234aa2edbee54d7590fbccae7e8b7c0c87e [file] [log] [blame]
Carl-Daniel Hailfinger70539262007-10-15 21:45:29 +00001/*
2 * This file is part of the flashrom project.
3 *
Ronald Hoogenboom7ff530b2008-01-19 00:04:46 +00004 * Copyright (C) 2007, 2008 Carl-Daniel Hailfinger
Carl-Daniel Hailfinger70539262007-10-15 21:45:29 +00005 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19
20/*
21 * Contains the generic SPI framework
22 */
23
24#include <stdio.h>
25#include <pci/pci.h>
26#include <stdint.h>
27#include <string.h>
28#include "flash.h"
Carl-Daniel Hailfingerd6cbf762008-05-13 14:58:23 +000029#include "spi.h"
Carl-Daniel Hailfinger70539262007-10-15 21:45:29 +000030
Ronald Hoogenboom7ff530b2008-01-19 00:04:46 +000031
32void spi_prettyprint_status_register(struct flashchip *flash);
Carl-Daniel Hailfinger70539262007-10-15 21:45:29 +000033
Peter Stugefa8c5502008-05-10 23:07:52 +000034int spi_command(unsigned int writecnt, unsigned int readcnt, const unsigned char *writearr, unsigned char *readarr)
Carl-Daniel Hailfinger3d94a0e2007-10-16 21:09:06 +000035{
36 if (it8716f_flashport)
Carl-Daniel Hailfingera5b8efd2008-05-10 23:40:51 +000037 return it8716f_spi_command(writecnt, readcnt, writearr, readarr);
Dominik Geyerb46acba2008-05-16 12:55:55 +000038 else if (ich9_detected)
39 return ich_spi_command(writecnt, readcnt, writearr, readarr);
Carl-Daniel Hailfinger9a3ec822007-12-29 10:15:58 +000040 printf_debug("%s called, but no SPI chipset detected\n", __FUNCTION__);
Carl-Daniel Hailfinger3d94a0e2007-10-16 21:09:06 +000041 return 1;
42}
43
Peter Stugefa8c5502008-05-10 23:07:52 +000044static int spi_rdid(unsigned char *readarr)
Carl-Daniel Hailfinger70539262007-10-15 21:45:29 +000045{
Carl-Daniel Hailfinger228231f2008-05-13 14:01:22 +000046 const unsigned char cmd[JEDEC_RDID_OUTSIZE] = {JEDEC_RDID};
Carl-Daniel Hailfinger70539262007-10-15 21:45:29 +000047
Peter Stugefa8c5502008-05-10 23:07:52 +000048 if (spi_command(JEDEC_RDID_OUTSIZE, JEDEC_RDID_INSIZE, cmd, readarr))
Carl-Daniel Hailfinger70539262007-10-15 21:45:29 +000049 return 1;
Carl-Daniel Hailfinger9a3ec822007-12-29 10:15:58 +000050 printf_debug("RDID returned %02x %02x %02x.\n", readarr[0], readarr[1], readarr[2]);
Carl-Daniel Hailfinger70539262007-10-15 21:45:29 +000051 return 0;
52}
53
Carl-Daniel Hailfinger42c54972008-05-15 03:19:49 +000054static int spi_res(unsigned char *readarr)
55{
56 const unsigned char cmd[JEDEC_RES_OUTSIZE] = {JEDEC_RES, 0, 0, 0};
57
58 if (spi_command(JEDEC_RES_OUTSIZE, JEDEC_RES_INSIZE, cmd, readarr))
59 return 1;
60 printf_debug("RES returned %02x.\n", readarr[0]);
61 return 0;
62}
63
Peter Stugefa8c5502008-05-10 23:07:52 +000064void spi_write_enable()
Carl-Daniel Hailfinger6b444962007-10-18 00:24:07 +000065{
Carl-Daniel Hailfinger228231f2008-05-13 14:01:22 +000066 const unsigned char cmd[JEDEC_WREN_OUTSIZE] = {JEDEC_WREN};
Carl-Daniel Hailfinger6b444962007-10-18 00:24:07 +000067
68 /* Send WREN (Write Enable) */
Peter Stugefa8c5502008-05-10 23:07:52 +000069 spi_command(JEDEC_WREN_OUTSIZE, JEDEC_WREN_INSIZE, cmd, NULL);
Carl-Daniel Hailfinger6b444962007-10-18 00:24:07 +000070}
71
Peter Stugefa8c5502008-05-10 23:07:52 +000072void spi_write_disable()
Carl-Daniel Hailfinger6b444962007-10-18 00:24:07 +000073{
Carl-Daniel Hailfinger228231f2008-05-13 14:01:22 +000074 const unsigned char cmd[JEDEC_WRDI_OUTSIZE] = {JEDEC_WRDI};
Carl-Daniel Hailfinger6b444962007-10-18 00:24:07 +000075
76 /* Send WRDI (Write Disable) */
Peter Stugefa8c5502008-05-10 23:07:52 +000077 spi_command(JEDEC_WRDI_OUTSIZE, JEDEC_WRDI_INSIZE, cmd, NULL);
Carl-Daniel Hailfinger6b444962007-10-18 00:24:07 +000078}
79
Carl-Daniel Hailfinger42c54972008-05-15 03:19:49 +000080int probe_spi_rdid(struct flashchip *flash)
Carl-Daniel Hailfinger70539262007-10-15 21:45:29 +000081{
82 unsigned char readarr[3];
Carl-Daniel Hailfinger1263d2a2008-02-06 22:07:58 +000083 uint32_t manuf_id;
84 uint32_t model_id;
Carl-Daniel Hailfinger9a3ec822007-12-29 10:15:58 +000085
Peter Stugeda4e5f32008-06-24 01:22:03 +000086 if (spi_rdid(readarr))
87 return 0;
88
89 if (!oddparity(readarr[0]))
90 printf_debug("RDID byte 0 parity violation.\n");
91
92 /* Check if this is a continuation vendor ID */
93 if (readarr[0] == 0x7f) {
94 if (!oddparity(readarr[1]))
95 printf_debug("RDID byte 1 parity violation.\n");
96 manuf_id = (readarr[0] << 8) | readarr[1];
97 model_id = readarr[2];
98 } else {
99 manuf_id = readarr[0];
100 model_id = (readarr[1] << 8) | readarr[2];
Carl-Daniel Hailfinger70539262007-10-15 21:45:29 +0000101 }
102
Peter Stugeda4e5f32008-06-24 01:22:03 +0000103 printf_debug("%s: id1 0x%x, id2 0x%x\n", __FUNCTION__, manuf_id, model_id);
104
105 if (manuf_id == flash->manufacture_id &&
106 model_id == flash->model_id) {
107 /* Print the status register to tell the
108 * user about possible write protection.
109 */
110 spi_prettyprint_status_register(flash);
111
112 return 1;
113 }
114
115 /* Test if this is a pure vendor match. */
116 if (manuf_id == flash->manufacture_id &&
117 GENERIC_DEVICE_ID == flash->model_id)
118 return 1;
119
Carl-Daniel Hailfinger70539262007-10-15 21:45:29 +0000120 return 0;
121}
122
Carl-Daniel Hailfinger42c54972008-05-15 03:19:49 +0000123int probe_spi_res(struct flashchip *flash)
124{
125 unsigned char readarr[3];
126 uint32_t model_id;
Peter Stugeda4e5f32008-06-24 01:22:03 +0000127
128 if (spi_rdid(readarr))
Carl-Daniel Hailfinger42c54972008-05-15 03:19:49 +0000129 /* We couldn't issue RDID, it's pointless to try RES. */
130 return 0;
Carl-Daniel Hailfinger42c54972008-05-15 03:19:49 +0000131
Peter Stugeda4e5f32008-06-24 01:22:03 +0000132 /* Check if RDID returns 0xff 0xff 0xff, then we use RES. */
133 if ((readarr[0] != 0xff) || (readarr[1] != 0xff) ||
134 (readarr[2] != 0xff))
135 return 0;
Carl-Daniel Hailfinger42c54972008-05-15 03:19:49 +0000136
Peter Stugeda4e5f32008-06-24 01:22:03 +0000137 if (spi_res(readarr))
138 return 0;
139
140 model_id = readarr[0];
141 printf_debug("%s: id 0x%x\n", __FUNCTION__, model_id);
142 if (model_id != flash->model_id)
143 return 0;
144
145 /* Print the status register to tell the
146 * user about possible write protection.
147 */
148 spi_prettyprint_status_register(flash);
149 return 1;
Carl-Daniel Hailfinger42c54972008-05-15 03:19:49 +0000150}
151
Peter Stugefa8c5502008-05-10 23:07:52 +0000152uint8_t spi_read_status_register()
Carl-Daniel Hailfinger6b444962007-10-18 00:24:07 +0000153{
Carl-Daniel Hailfinger228231f2008-05-13 14:01:22 +0000154 const unsigned char cmd[JEDEC_RDSR_OUTSIZE] = {JEDEC_RDSR};
Carl-Daniel Hailfinger6b444962007-10-18 00:24:07 +0000155 unsigned char readarr[1];
156
157 /* Read Status Register */
Peter Stugefa8c5502008-05-10 23:07:52 +0000158 spi_command(JEDEC_RDSR_OUTSIZE, JEDEC_RDSR_INSIZE, cmd, readarr);
Carl-Daniel Hailfinger6b444962007-10-18 00:24:07 +0000159 return readarr[0];
160}
161
Ronald Hoogenboom7ff530b2008-01-19 00:04:46 +0000162/* Prettyprint the status register. Common definitions.
163 */
164void spi_prettyprint_status_register_common(uint8_t status)
165{
166 printf_debug("Chip status register: Bit 5 / Block Protect 3 (BP3) is "
167 "%sset\n", (status & (1 << 5)) ? "" : "not ");
168 printf_debug("Chip status register: Bit 4 / Block Protect 2 (BP2) is "
169 "%sset\n", (status & (1 << 4)) ? "" : "not ");
170 printf_debug("Chip status register: Bit 3 / Block Protect 1 (BP1) is "
171 "%sset\n", (status & (1 << 3)) ? "" : "not ");
172 printf_debug("Chip status register: Bit 2 / Block Protect 0 (BP0) is "
173 "%sset\n", (status & (1 << 2)) ? "" : "not ");
174 printf_debug("Chip status register: Write Enable Latch (WEL) is "
175 "%sset\n", (status & (1 << 1)) ? "" : "not ");
176 printf_debug("Chip status register: Write In Progress (WIP/BUSY) is "
177 "%sset\n", (status & (1 << 0)) ? "" : "not ");
178}
179
Carl-Daniel Hailfinger9a3ec822007-12-29 10:15:58 +0000180/* Prettyprint the status register. Works for
181 * ST M25P series
182 * MX MX25L series
183 */
Ronald Hoogenboom7ff530b2008-01-19 00:04:46 +0000184void spi_prettyprint_status_register_st_m25p(uint8_t status)
Carl-Daniel Hailfinger9a3ec822007-12-29 10:15:58 +0000185{
186 printf_debug("Chip status register: Status Register Write Disable "
187 "(SRWD) is %sset\n", (status & (1 << 7)) ? "" : "not ");
188 printf_debug("Chip status register: Bit 6 is "
189 "%sset\n", (status & (1 << 6)) ? "" : "not ");
Ronald Hoogenboom7ff530b2008-01-19 00:04:46 +0000190 spi_prettyprint_status_register_common(status);
Carl-Daniel Hailfinger9a3ec822007-12-29 10:15:58 +0000191}
192
Ronald Hoogenboom7ff530b2008-01-19 00:04:46 +0000193/* Prettyprint the status register. Works for
194 * SST 25VF016
195 */
196void spi_prettyprint_status_register_sst25vf016(uint8_t status)
197{
Carl-Daniel Hailfingerd3568ad2008-01-22 14:37:31 +0000198 const char *bpt[] = {
Ronald Hoogenboom7ff530b2008-01-19 00:04:46 +0000199 "none",
200 "1F0000H-1FFFFFH",
201 "1E0000H-1FFFFFH",
202 "1C0000H-1FFFFFH",
203 "180000H-1FFFFFH",
204 "100000H-1FFFFFH",
Carl-Daniel Hailfingerd3568ad2008-01-22 14:37:31 +0000205 "all", "all"
Ronald Hoogenboom7ff530b2008-01-19 00:04:46 +0000206 };
207 printf_debug("Chip status register: Block Protect Write Disable "
208 "(BPL) is %sset\n", (status & (1 << 7)) ? "" : "not ");
209 printf_debug("Chip status register: Auto Address Increment Programming "
210 "(AAI) is %sset\n", (status & (1 << 6)) ? "" : "not ");
211 spi_prettyprint_status_register_common(status);
212 printf_debug("Resulting block protection : %s\n",
213 bpt[(status & 0x1c) >> 2]);
214}
215
216void spi_prettyprint_status_register(struct flashchip *flash)
Carl-Daniel Hailfinger9a3ec822007-12-29 10:15:58 +0000217{
218 uint8_t status;
219
Peter Stugefa8c5502008-05-10 23:07:52 +0000220 status = spi_read_status_register();
Carl-Daniel Hailfinger9a3ec822007-12-29 10:15:58 +0000221 printf_debug("Chip status register is %02x\n", status);
222 switch (flash->manufacture_id) {
223 case ST_ID:
Carl-Daniel Hailfingerf43e6422008-05-15 22:32:08 +0000224 if (((flash->model_id & 0xff00) == 0x2000) ||
225 ((flash->model_id & 0xff00) == 0x2500))
226 spi_prettyprint_status_register_st_m25p(status);
227 break;
Carl-Daniel Hailfinger9a3ec822007-12-29 10:15:58 +0000228 case MX_ID:
229 if ((flash->model_id & 0xff00) == 0x2000)
Ronald Hoogenboom7ff530b2008-01-19 00:04:46 +0000230 spi_prettyprint_status_register_st_m25p(status);
231 break;
232 case SST_ID:
233 if (flash->model_id == SST_25VF016B)
234 spi_prettyprint_status_register_sst25vf016(status);
Carl-Daniel Hailfinger9a3ec822007-12-29 10:15:58 +0000235 break;
236 }
237}
238
Peter Stugefa8c5502008-05-10 23:07:52 +0000239int spi_chip_erase_c7(struct flashchip *flash)
Carl-Daniel Hailfinger6b444962007-10-18 00:24:07 +0000240{
Carl-Daniel Hailfinger228231f2008-05-13 14:01:22 +0000241 const unsigned char cmd[JEDEC_CE_C7_OUTSIZE] = {JEDEC_CE_C7};
Carl-Daniel Hailfingerf5df46f2007-12-16 21:15:27 +0000242
Ronald Hoogenboom7ff530b2008-01-19 00:04:46 +0000243 spi_disable_blockprotect();
Peter Stugefa8c5502008-05-10 23:07:52 +0000244 spi_write_enable();
Carl-Daniel Hailfinger6b444962007-10-18 00:24:07 +0000245 /* Send CE (Chip Erase) */
Peter Stugefa8c5502008-05-10 23:07:52 +0000246 spi_command(JEDEC_CE_C7_OUTSIZE, JEDEC_CE_C7_INSIZE, cmd, NULL);
Carl-Daniel Hailfinger5b1c6ed2007-10-22 16:15:28 +0000247 /* Wait until the Write-In-Progress bit is cleared.
248 * This usually takes 1-85 s, so wait in 1 s steps.
249 */
Peter Stugefa8c5502008-05-10 23:07:52 +0000250 while (spi_read_status_register() & JEDEC_RDSR_BIT_WIP)
Carl-Daniel Hailfinger6b444962007-10-18 00:24:07 +0000251 sleep(1);
Carl-Daniel Hailfinger6b444962007-10-18 00:24:07 +0000252 return 0;
253}
254
Carl-Daniel Hailfinger5b1c6ed2007-10-22 16:15:28 +0000255/* Block size is usually
256 * 64k for Macronix
257 * 32k for SST
258 * 4-32k non-uniform for EON
259 */
Peter Stugefa8c5502008-05-10 23:07:52 +0000260int spi_block_erase_d8(const struct flashchip *flash, unsigned long addr)
Carl-Daniel Hailfinger5b1c6ed2007-10-22 16:15:28 +0000261{
Carl-Daniel Hailfinger228231f2008-05-13 14:01:22 +0000262 unsigned char cmd[JEDEC_BE_D8_OUTSIZE] = {JEDEC_BE_D8};
Carl-Daniel Hailfinger5b1c6ed2007-10-22 16:15:28 +0000263
264 cmd[1] = (addr & 0x00ff0000) >> 16;
265 cmd[2] = (addr & 0x0000ff00) >> 8;
266 cmd[3] = (addr & 0x000000ff);
Peter Stugefa8c5502008-05-10 23:07:52 +0000267 spi_write_enable();
Carl-Daniel Hailfinger5b1c6ed2007-10-22 16:15:28 +0000268 /* Send BE (Block Erase) */
Peter Stugefa8c5502008-05-10 23:07:52 +0000269 spi_command(JEDEC_BE_D8_OUTSIZE, JEDEC_BE_D8_INSIZE, cmd, NULL);
Carl-Daniel Hailfinger5b1c6ed2007-10-22 16:15:28 +0000270 /* Wait until the Write-In-Progress bit is cleared.
271 * This usually takes 100-4000 ms, so wait in 100 ms steps.
272 */
Peter Stugefa8c5502008-05-10 23:07:52 +0000273 while (spi_read_status_register() & JEDEC_RDSR_BIT_WIP)
Carl-Daniel Hailfinger5b1c6ed2007-10-22 16:15:28 +0000274 usleep(100 * 1000);
275 return 0;
276}
277
278/* Sector size is usually 4k, though Macronix eliteflash has 64k */
Peter Stugefa8c5502008-05-10 23:07:52 +0000279int spi_sector_erase(const struct flashchip *flash, unsigned long addr)
Carl-Daniel Hailfinger5b1c6ed2007-10-22 16:15:28 +0000280{
Carl-Daniel Hailfinger228231f2008-05-13 14:01:22 +0000281 unsigned char cmd[JEDEC_SE_OUTSIZE] = {JEDEC_SE};
Carl-Daniel Hailfinger5b1c6ed2007-10-22 16:15:28 +0000282 cmd[1] = (addr & 0x00ff0000) >> 16;
283 cmd[2] = (addr & 0x0000ff00) >> 8;
284 cmd[3] = (addr & 0x000000ff);
285
Peter Stugefa8c5502008-05-10 23:07:52 +0000286 spi_write_enable();
Carl-Daniel Hailfinger5b1c6ed2007-10-22 16:15:28 +0000287 /* Send SE (Sector Erase) */
Peter Stugefa8c5502008-05-10 23:07:52 +0000288 spi_command(JEDEC_SE_OUTSIZE, JEDEC_SE_INSIZE, cmd, NULL);
Carl-Daniel Hailfinger5b1c6ed2007-10-22 16:15:28 +0000289 /* Wait until the Write-In-Progress bit is cleared.
290 * This usually takes 15-800 ms, so wait in 10 ms steps.
291 */
Peter Stugefa8c5502008-05-10 23:07:52 +0000292 while (spi_read_status_register() & JEDEC_RDSR_BIT_WIP)
Carl-Daniel Hailfinger5b1c6ed2007-10-22 16:15:28 +0000293 usleep(10 * 1000);
294 return 0;
295}
296
Peter Stugefa8c5502008-05-10 23:07:52 +0000297void spi_page_program(int block, uint8_t *buf, uint8_t *bios)
Carl-Daniel Hailfinger6b444962007-10-18 00:24:07 +0000298{
Carl-Daniel Hailfingerbfe5b4a2008-05-13 23:03:12 +0000299 if (it8716f_flashport) {
Carl-Daniel Hailfinger6b444962007-10-18 00:24:07 +0000300 it8716f_spi_page_program(block, buf, bios);
Carl-Daniel Hailfingerbfe5b4a2008-05-13 23:03:12 +0000301 return;
302 }
303 printf_debug("%s called, but no SPI chipset detected\n", __FUNCTION__);
Carl-Daniel Hailfinger6b444962007-10-18 00:24:07 +0000304}
305
Ronald Hoogenboom7ff530b2008-01-19 00:04:46 +0000306/*
307 * This is according the SST25VF016 datasheet, who knows it is more
308 * generic that this...
309 */
310void spi_write_status_register(int status)
311{
Carl-Daniel Hailfinger228231f2008-05-13 14:01:22 +0000312 const unsigned char cmd[JEDEC_WRSR_OUTSIZE] = {JEDEC_WRSR, (unsigned char)status};
Ronald Hoogenboom7ff530b2008-01-19 00:04:46 +0000313
314 /* Send WRSR (Write Status Register) */
Peter Stugefa8c5502008-05-10 23:07:52 +0000315 spi_command(JEDEC_WRSR_OUTSIZE, JEDEC_WRSR_INSIZE, cmd, NULL);
Ronald Hoogenboom7ff530b2008-01-19 00:04:46 +0000316}
317
318void spi_byte_program(int address, uint8_t byte)
319{
320 const unsigned char cmd[JEDEC_BYTE_PROGRAM_OUTSIZE] = {JEDEC_BYTE_PROGRAM,
321 (address>>16)&0xff,
322 (address>>8)&0xff,
323 (address>>0)&0xff,
324 byte
325 };
326
327 /* Send Byte-Program */
Peter Stugefa8c5502008-05-10 23:07:52 +0000328 spi_command(JEDEC_BYTE_PROGRAM_OUTSIZE, JEDEC_BYTE_PROGRAM_INSIZE, cmd, NULL);
Ronald Hoogenboom7ff530b2008-01-19 00:04:46 +0000329}
330
331void spi_disable_blockprotect(void)
332{
333 uint8_t status;
334
Peter Stugefa8c5502008-05-10 23:07:52 +0000335 status = spi_read_status_register();
Ronald Hoogenboom7ff530b2008-01-19 00:04:46 +0000336 /* If there is block protection in effect, unprotect it first. */
337 if ((status & 0x3c) != 0) {
338 printf_debug("Some block protection in effect, disabling\n");
Peter Stugefa8c5502008-05-10 23:07:52 +0000339 spi_write_enable();
Ronald Hoogenboom7ff530b2008-01-19 00:04:46 +0000340 spi_write_status_register(status & ~0x3c);
341 }
342}
343
Carl-Daniel Hailfingerbfe5b4a2008-05-13 23:03:12 +0000344void spi_nbyte_read(int address, uint8_t *bytes, int len)
Ronald Hoogenboom7ff530b2008-01-19 00:04:46 +0000345{
346 const unsigned char cmd[JEDEC_READ_OUTSIZE] = {JEDEC_READ,
Carl-Daniel Hailfingerd3568ad2008-01-22 14:37:31 +0000347 (address >> 16) & 0xff,
348 (address >> 8) & 0xff,
349 (address >> 0) & 0xff,
Ronald Hoogenboom7ff530b2008-01-19 00:04:46 +0000350 };
351
352 /* Send Read */
Peter Stugefa8c5502008-05-10 23:07:52 +0000353 spi_command(JEDEC_READ_OUTSIZE, len, cmd, bytes);
Ronald Hoogenboom7ff530b2008-01-19 00:04:46 +0000354}
355
Peter Stugefa8c5502008-05-10 23:07:52 +0000356int spi_chip_read(struct flashchip *flash, uint8_t *buf)
Ronald Hoogenboom7ff530b2008-01-19 00:04:46 +0000357{
Carl-Daniel Hailfingerbfe5b4a2008-05-13 23:03:12 +0000358 if (it8716f_flashport)
359 return it8716f_spi_chip_read(flash, buf);
Dominik Geyerb46acba2008-05-16 12:55:55 +0000360 else if (ich9_detected)
361 return ich_spi_read(flash, buf);
Carl-Daniel Hailfingerbfe5b4a2008-05-13 23:03:12 +0000362 printf_debug("%s called, but no SPI chipset detected\n", __FUNCTION__);
363 return 1;
Ronald Hoogenboom7ff530b2008-01-19 00:04:46 +0000364}
365
Carl-Daniel Hailfingerbfe5b4a2008-05-13 23:03:12 +0000366int spi_chip_write(struct flashchip *flash, uint8_t *buf)
367{
368 if (it8716f_flashport)
369 return it8716f_spi_chip_write(flash, buf);
Dominik Geyerb46acba2008-05-16 12:55:55 +0000370 else if (ich9_detected)
371 return ich_spi_write(flash, buf);
Carl-Daniel Hailfingerbfe5b4a2008-05-13 23:03:12 +0000372 printf_debug("%s called, but no SPI chipset detected\n", __FUNCTION__);
373 return 1;
Carl-Daniel Hailfinger6b444962007-10-18 00:24:07 +0000374}
375