Carl-Daniel Hailfinger | 5cca01f | 2009-11-24 00:20:03 +0000 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the flashrom project. |
| 3 | * |
Carl-Daniel Hailfinger | 5824fbf | 2010-05-21 23:09:42 +0000 | [diff] [blame] | 4 | * Copyright (C) 2009, 2010 Carl-Daniel Hailfinger |
Carl-Daniel Hailfinger | 5cca01f | 2009-11-24 00:20:03 +0000 | [diff] [blame] | 5 | * |
| 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 | #include <stdio.h> |
| 21 | #include <stdint.h> |
| 22 | #include <string.h> |
| 23 | #include <stdlib.h> |
| 24 | #include <ctype.h> |
Carl-Daniel Hailfinger | 5cca01f | 2009-11-24 00:20:03 +0000 | [diff] [blame] | 25 | #include "flash.h" |
Sean Nelson | 14ba668 | 2010-02-26 05:48:29 +0000 | [diff] [blame] | 26 | #include "chipdrivers.h" |
Carl-Daniel Hailfinger | 5cca01f | 2009-11-24 00:20:03 +0000 | [diff] [blame] | 27 | #include "spi.h" |
| 28 | |
| 29 | /* Change this to #define if you want to test without a serial implementation */ |
| 30 | #undef FAKE_COMMUNICATION |
| 31 | |
| 32 | #ifndef FAKE_COMMUNICATION |
Carl-Daniel Hailfinger | ad3cc55 | 2010-07-03 11:02:10 +0000 | [diff] [blame] | 33 | static int buspirate_serialport_setup(char *dev) |
Carl-Daniel Hailfinger | 5cca01f | 2009-11-24 00:20:03 +0000 | [diff] [blame] | 34 | { |
| 35 | /* 115200bps, 8 databits, no parity, 1 stopbit */ |
| 36 | sp_fd = sp_openserport(dev, 115200); |
| 37 | return 0; |
| 38 | } |
Carl-Daniel Hailfinger | 5cca01f | 2009-11-24 00:20:03 +0000 | [diff] [blame] | 39 | #else |
| 40 | #define buspirate_serialport_setup(...) 0 |
Carl-Daniel Hailfinger | efa151e | 2010-01-06 16:09:10 +0000 | [diff] [blame] | 41 | #define serialport_shutdown(...) 0 |
Carl-Daniel Hailfinger | 5cca01f | 2009-11-24 00:20:03 +0000 | [diff] [blame] | 42 | #define serialport_write(...) 0 |
| 43 | #define serialport_read(...) 0 |
Patrick Georgi | 3b6237d | 2010-01-06 19:09:40 +0000 | [diff] [blame] | 44 | #define sp_flush_incoming(...) 0 |
Carl-Daniel Hailfinger | 5cca01f | 2009-11-24 00:20:03 +0000 | [diff] [blame] | 45 | #endif |
| 46 | |
Carl-Daniel Hailfinger | ad3cc55 | 2010-07-03 11:02:10 +0000 | [diff] [blame] | 47 | static int buspirate_sendrecv(unsigned char *buf, unsigned int writecnt, unsigned int readcnt) |
Carl-Daniel Hailfinger | 5cca01f | 2009-11-24 00:20:03 +0000 | [diff] [blame] | 48 | { |
| 49 | int i, ret = 0; |
| 50 | |
Sean Nelson | 84f7bce | 2010-01-09 23:56:41 +0000 | [diff] [blame] | 51 | msg_pspew("%s: write %i, read %i ", __func__, writecnt, readcnt); |
Carl-Daniel Hailfinger | 5cca01f | 2009-11-24 00:20:03 +0000 | [diff] [blame] | 52 | if (!writecnt && !readcnt) { |
Sean Nelson | 84f7bce | 2010-01-09 23:56:41 +0000 | [diff] [blame] | 53 | msg_perr("Zero length command!\n"); |
Carl-Daniel Hailfinger | 5cca01f | 2009-11-24 00:20:03 +0000 | [diff] [blame] | 54 | return 1; |
| 55 | } |
Sean Nelson | 84f7bce | 2010-01-09 23:56:41 +0000 | [diff] [blame] | 56 | msg_pspew("Sending"); |
Carl-Daniel Hailfinger | 5cca01f | 2009-11-24 00:20:03 +0000 | [diff] [blame] | 57 | for (i = 0; i < writecnt; i++) |
Sean Nelson | 84f7bce | 2010-01-09 23:56:41 +0000 | [diff] [blame] | 58 | msg_pspew(" 0x%02x", buf[i]); |
Carl-Daniel Hailfinger | 5cca01f | 2009-11-24 00:20:03 +0000 | [diff] [blame] | 59 | #ifdef FAKE_COMMUNICATION |
| 60 | /* Placate the caller for now. */ |
| 61 | if (readcnt) { |
| 62 | buf[0] = 0x01; |
| 63 | memset(buf + 1, 0xff, readcnt - 1); |
| 64 | } |
| 65 | ret = 0; |
| 66 | #else |
| 67 | if (writecnt) |
| 68 | ret = serialport_write(buf, writecnt); |
| 69 | if (ret) |
| 70 | return ret; |
| 71 | if (readcnt) |
| 72 | ret = serialport_read(buf, readcnt); |
| 73 | if (ret) |
| 74 | return ret; |
| 75 | #endif |
Sean Nelson | 84f7bce | 2010-01-09 23:56:41 +0000 | [diff] [blame] | 76 | msg_pspew(", receiving"); |
Carl-Daniel Hailfinger | 5cca01f | 2009-11-24 00:20:03 +0000 | [diff] [blame] | 77 | for (i = 0; i < readcnt; i++) |
Sean Nelson | 84f7bce | 2010-01-09 23:56:41 +0000 | [diff] [blame] | 78 | msg_pspew(" 0x%02x", buf[i]); |
| 79 | msg_pspew("\n"); |
Carl-Daniel Hailfinger | 5cca01f | 2009-11-24 00:20:03 +0000 | [diff] [blame] | 80 | return 0; |
| 81 | } |
| 82 | |
Carl-Daniel Hailfinger | d5b28fa | 2009-11-24 18:27:10 +0000 | [diff] [blame] | 83 | static const struct buspirate_spispeeds spispeeds[] = { |
| 84 | {"30k", 0x0}, |
| 85 | {"125k", 0x1}, |
| 86 | {"250k", 0x2}, |
| 87 | {"1M", 0x3}, |
| 88 | {"2M", 0x4}, |
| 89 | {"2.6M", 0x5}, |
| 90 | {"4M", 0x6}, |
| 91 | {"8M", 0x7}, |
| 92 | {NULL, 0x0} |
| 93 | }; |
| 94 | |
Carl-Daniel Hailfinger | 5cca01f | 2009-11-24 00:20:03 +0000 | [diff] [blame] | 95 | int buspirate_spi_init(void) |
| 96 | { |
| 97 | unsigned char buf[512]; |
| 98 | int ret = 0; |
| 99 | int i; |
Carl-Daniel Hailfinger | 5cca01f | 2009-11-24 00:20:03 +0000 | [diff] [blame] | 100 | char *dev = NULL; |
Carl-Daniel Hailfinger | d5b28fa | 2009-11-24 18:27:10 +0000 | [diff] [blame] | 101 | char *speed = NULL; |
| 102 | int spispeed = 0x7; |
Carl-Daniel Hailfinger | 5cca01f | 2009-11-24 00:20:03 +0000 | [diff] [blame] | 103 | |
Carl-Daniel Hailfinger | 744132a | 2010-07-06 09:55:48 +0000 | [diff] [blame^] | 104 | dev = extract_param(&programmer_param, "dev", ",:"); |
| 105 | if (!dev || !strlen(dev)) { |
Sean Nelson | 84f7bce | 2010-01-09 23:56:41 +0000 | [diff] [blame] | 106 | msg_perr("No serial device given. Use flashrom -p " |
Carl-Daniel Hailfinger | 7112772 | 2010-05-31 15:27:27 +0000 | [diff] [blame] | 107 | "buspirate_spi:dev=/dev/ttyUSB0\n"); |
Carl-Daniel Hailfinger | 5cca01f | 2009-11-24 00:20:03 +0000 | [diff] [blame] | 108 | return 1; |
| 109 | } |
Carl-Daniel Hailfinger | 744132a | 2010-07-06 09:55:48 +0000 | [diff] [blame^] | 110 | |
| 111 | speed = extract_param(&programmer_param, "spispeed", ",:"); |
Carl-Daniel Hailfinger | d5b28fa | 2009-11-24 18:27:10 +0000 | [diff] [blame] | 112 | if (speed) { |
| 113 | for (i = 0; spispeeds[i].name; i++) |
| 114 | if (!strncasecmp(spispeeds[i].name, speed, |
| 115 | strlen(spispeeds[i].name))) { |
| 116 | spispeed = spispeeds[i].speed; |
| 117 | break; |
| 118 | } |
| 119 | if (!spispeeds[i].name) |
Sean Nelson | 84f7bce | 2010-01-09 23:56:41 +0000 | [diff] [blame] | 120 | msg_perr("Invalid SPI speed, using default.\n"); |
Carl-Daniel Hailfinger | d5b28fa | 2009-11-24 18:27:10 +0000 | [diff] [blame] | 121 | } |
Carl-Daniel Hailfinger | 744132a | 2010-07-06 09:55:48 +0000 | [diff] [blame^] | 122 | free(speed); |
| 123 | |
Carl-Daniel Hailfinger | d5b28fa | 2009-11-24 18:27:10 +0000 | [diff] [blame] | 124 | /* This works because speeds numbering starts at 0 and is contiguous. */ |
Sean Nelson | 84f7bce | 2010-01-09 23:56:41 +0000 | [diff] [blame] | 125 | msg_pdbg("SPI speed is %sHz\n", spispeeds[spispeed].name); |
Carl-Daniel Hailfinger | 5cca01f | 2009-11-24 00:20:03 +0000 | [diff] [blame] | 126 | |
| 127 | ret = buspirate_serialport_setup(dev); |
| 128 | if (ret) |
| 129 | return ret; |
Carl-Daniel Hailfinger | 744132a | 2010-07-06 09:55:48 +0000 | [diff] [blame^] | 130 | free(dev); |
Carl-Daniel Hailfinger | 5cca01f | 2009-11-24 00:20:03 +0000 | [diff] [blame] | 131 | |
| 132 | /* This is the brute force version, but it should work. */ |
| 133 | for (i = 0; i < 19; i++) { |
| 134 | /* Enter raw bitbang mode */ |
| 135 | buf[0] = 0x00; |
| 136 | /* Send the command, don't read the response. */ |
| 137 | ret = buspirate_sendrecv(buf, 1, 0); |
| 138 | if (ret) |
| 139 | return ret; |
| 140 | /* Read any response and discard it. */ |
Patrick Georgi | 3b6237d | 2010-01-06 19:09:40 +0000 | [diff] [blame] | 141 | sp_flush_incoming(); |
Carl-Daniel Hailfinger | 5cca01f | 2009-11-24 00:20:03 +0000 | [diff] [blame] | 142 | } |
| 143 | /* Enter raw bitbang mode */ |
| 144 | buf[0] = 0x00; |
| 145 | ret = buspirate_sendrecv(buf, 1, 5); |
| 146 | if (ret) |
| 147 | return ret; |
| 148 | if (memcmp(buf, "BBIO", 4)) { |
Sean Nelson | 84f7bce | 2010-01-09 23:56:41 +0000 | [diff] [blame] | 149 | msg_perr("Entering raw bitbang mode failed!\n"); |
Carl-Daniel Hailfinger | 5cca01f | 2009-11-24 00:20:03 +0000 | [diff] [blame] | 150 | return 1; |
| 151 | } |
Sean Nelson | 84f7bce | 2010-01-09 23:56:41 +0000 | [diff] [blame] | 152 | msg_pdbg("Raw bitbang mode version %c\n", buf[4]); |
Carl-Daniel Hailfinger | 5cca01f | 2009-11-24 00:20:03 +0000 | [diff] [blame] | 153 | if (buf[4] != '1') { |
Sean Nelson | 84f7bce | 2010-01-09 23:56:41 +0000 | [diff] [blame] | 154 | msg_perr("Can't handle raw bitbang mode version %c!\n", |
Carl-Daniel Hailfinger | 5cca01f | 2009-11-24 00:20:03 +0000 | [diff] [blame] | 155 | buf[4]); |
| 156 | return 1; |
| 157 | } |
| 158 | /* Enter raw SPI mode */ |
| 159 | buf[0] = 0x01; |
| 160 | ret = buspirate_sendrecv(buf, 1, 4); |
| 161 | if (memcmp(buf, "SPI", 3)) { |
Sean Nelson | 84f7bce | 2010-01-09 23:56:41 +0000 | [diff] [blame] | 162 | msg_perr("Entering raw SPI mode failed!\n"); |
Carl-Daniel Hailfinger | 5cca01f | 2009-11-24 00:20:03 +0000 | [diff] [blame] | 163 | return 1; |
| 164 | } |
Sean Nelson | 84f7bce | 2010-01-09 23:56:41 +0000 | [diff] [blame] | 165 | msg_pdbg("Raw SPI mode version %c\n", buf[3]); |
Carl-Daniel Hailfinger | 5cca01f | 2009-11-24 00:20:03 +0000 | [diff] [blame] | 166 | if (buf[3] != '1') { |
Sean Nelson | 84f7bce | 2010-01-09 23:56:41 +0000 | [diff] [blame] | 167 | msg_perr("Can't handle raw SPI mode version %c!\n", |
Carl-Daniel Hailfinger | 5cca01f | 2009-11-24 00:20:03 +0000 | [diff] [blame] | 168 | buf[3]); |
| 169 | return 1; |
| 170 | } |
| 171 | |
| 172 | /* Initial setup (SPI peripherals config): Enable power, CS high, AUX */ |
| 173 | buf[0] = 0x40 | 0xb; |
| 174 | ret = buspirate_sendrecv(buf, 1, 1); |
| 175 | if (ret) |
| 176 | return 1; |
| 177 | if (buf[0] != 0x01) { |
Sean Nelson | 84f7bce | 2010-01-09 23:56:41 +0000 | [diff] [blame] | 178 | msg_perr("Protocol error while setting power/CS/AUX!\n"); |
Carl-Daniel Hailfinger | 5cca01f | 2009-11-24 00:20:03 +0000 | [diff] [blame] | 179 | return 1; |
| 180 | } |
| 181 | |
Carl-Daniel Hailfinger | d5b28fa | 2009-11-24 18:27:10 +0000 | [diff] [blame] | 182 | /* Set SPI speed */ |
| 183 | buf[0] = 0x60 | spispeed; |
Carl-Daniel Hailfinger | 5cca01f | 2009-11-24 00:20:03 +0000 | [diff] [blame] | 184 | ret = buspirate_sendrecv(buf, 1, 1); |
| 185 | if (ret) |
| 186 | return 1; |
| 187 | if (buf[0] != 0x01) { |
Sean Nelson | 84f7bce | 2010-01-09 23:56:41 +0000 | [diff] [blame] | 188 | msg_perr("Protocol error while setting SPI speed!\n"); |
Carl-Daniel Hailfinger | 5cca01f | 2009-11-24 00:20:03 +0000 | [diff] [blame] | 189 | return 1; |
| 190 | } |
| 191 | |
| 192 | /* Set SPI config: output type, idle, clock edge, sample */ |
| 193 | buf[0] = 0x80 | 0xa; |
| 194 | ret = buspirate_sendrecv(buf, 1, 1); |
| 195 | if (ret) |
| 196 | return 1; |
| 197 | if (buf[0] != 0x01) { |
Sean Nelson | 84f7bce | 2010-01-09 23:56:41 +0000 | [diff] [blame] | 198 | msg_perr("Protocol error while setting SPI config!\n"); |
Carl-Daniel Hailfinger | 5cca01f | 2009-11-24 00:20:03 +0000 | [diff] [blame] | 199 | return 1; |
| 200 | } |
| 201 | |
| 202 | /* De-assert CS# */ |
| 203 | buf[0] = 0x03; |
| 204 | ret = buspirate_sendrecv(buf, 1, 1); |
| 205 | if (ret) |
| 206 | return 1; |
| 207 | if (buf[0] != 0x01) { |
Sean Nelson | 84f7bce | 2010-01-09 23:56:41 +0000 | [diff] [blame] | 208 | msg_perr("Protocol error while raising CS#!\n"); |
Carl-Daniel Hailfinger | 5cca01f | 2009-11-24 00:20:03 +0000 | [diff] [blame] | 209 | return 1; |
| 210 | } |
| 211 | |
| 212 | buses_supported = CHIP_BUSTYPE_SPI; |
| 213 | spi_controller = SPI_CONTROLLER_BUSPIRATE; |
| 214 | |
| 215 | return 0; |
| 216 | } |
| 217 | |
| 218 | int buspirate_spi_shutdown(void) |
| 219 | { |
| 220 | unsigned char buf[5]; |
| 221 | int ret = 0; |
| 222 | |
| 223 | /* Exit raw SPI mode (enter raw bitbang mode) */ |
| 224 | buf[0] = 0x00; |
| 225 | ret = buspirate_sendrecv(buf, 1, 5); |
| 226 | if (ret) |
| 227 | return ret; |
| 228 | if (memcmp(buf, "BBIO", 4)) { |
Sean Nelson | 84f7bce | 2010-01-09 23:56:41 +0000 | [diff] [blame] | 229 | msg_perr("Entering raw bitbang mode failed!\n"); |
Carl-Daniel Hailfinger | 5cca01f | 2009-11-24 00:20:03 +0000 | [diff] [blame] | 230 | return 1; |
| 231 | } |
Sean Nelson | 84f7bce | 2010-01-09 23:56:41 +0000 | [diff] [blame] | 232 | msg_pdbg("Raw bitbang mode version %c\n", buf[4]); |
Carl-Daniel Hailfinger | 5cca01f | 2009-11-24 00:20:03 +0000 | [diff] [blame] | 233 | if (buf[4] != '1') { |
Sean Nelson | 84f7bce | 2010-01-09 23:56:41 +0000 | [diff] [blame] | 234 | msg_perr("Can't handle raw bitbang mode version %c!\n", |
Carl-Daniel Hailfinger | 5cca01f | 2009-11-24 00:20:03 +0000 | [diff] [blame] | 235 | buf[4]); |
| 236 | return 1; |
| 237 | } |
| 238 | /* Reset Bus Pirate (return to user terminal) */ |
| 239 | buf[0] = 0x0f; |
| 240 | ret = buspirate_sendrecv(buf, 1, 0); |
| 241 | if (ret) |
| 242 | return ret; |
| 243 | |
| 244 | /* Shut down serial port communication */ |
Carl-Daniel Hailfinger | efa151e | 2010-01-06 16:09:10 +0000 | [diff] [blame] | 245 | ret = serialport_shutdown(); |
Carl-Daniel Hailfinger | 5cca01f | 2009-11-24 00:20:03 +0000 | [diff] [blame] | 246 | if (ret) |
| 247 | return ret; |
Sean Nelson | 84f7bce | 2010-01-09 23:56:41 +0000 | [diff] [blame] | 248 | msg_pdbg("Bus Pirate shutdown completed.\n"); |
Carl-Daniel Hailfinger | 5cca01f | 2009-11-24 00:20:03 +0000 | [diff] [blame] | 249 | |
| 250 | return 0; |
| 251 | } |
| 252 | |
| 253 | int buspirate_spi_send_command(unsigned int writecnt, unsigned int readcnt, |
| 254 | const unsigned char *writearr, unsigned char *readarr) |
| 255 | { |
| 256 | static unsigned char *buf = NULL; |
| 257 | int i = 0, ret = 0; |
| 258 | |
| 259 | if (writecnt > 16 || readcnt > 16 || (readcnt + writecnt) > 16) |
| 260 | return SPI_INVALID_LENGTH; |
| 261 | |
| 262 | /* +2 is pretty arbitrary. */ |
| 263 | buf = realloc(buf, writecnt + readcnt + 2); |
| 264 | if (!buf) { |
Sean Nelson | 84f7bce | 2010-01-09 23:56:41 +0000 | [diff] [blame] | 265 | msg_perr("Out of memory!\n"); |
Carl-Daniel Hailfinger | 5cca01f | 2009-11-24 00:20:03 +0000 | [diff] [blame] | 266 | exit(1); // -1 |
| 267 | } |
| 268 | |
| 269 | /* Assert CS# */ |
| 270 | buf[i++] = 0x02; |
| 271 | ret = buspirate_sendrecv(buf, 1, 1); |
| 272 | if (ret) |
| 273 | return SPI_GENERIC_ERROR; |
| 274 | if (buf[0] != 0x01) { |
Sean Nelson | 84f7bce | 2010-01-09 23:56:41 +0000 | [diff] [blame] | 275 | msg_perr("Protocol error while lowering CS#!\n"); |
Carl-Daniel Hailfinger | 5cca01f | 2009-11-24 00:20:03 +0000 | [diff] [blame] | 276 | return SPI_GENERIC_ERROR; |
| 277 | } |
| 278 | |
| 279 | i = 0; |
| 280 | buf[i++] = 0x10 | (writecnt + readcnt - 1); |
| 281 | memcpy(buf + i, writearr, writecnt); |
| 282 | i += writecnt; |
| 283 | memset(buf + i, 0, readcnt); |
| 284 | ret = buspirate_sendrecv(buf, i + readcnt, i + readcnt); |
| 285 | if (ret) |
| 286 | return SPI_GENERIC_ERROR; |
| 287 | if (buf[0] != 0x01) { |
Sean Nelson | 84f7bce | 2010-01-09 23:56:41 +0000 | [diff] [blame] | 288 | msg_perr("Protocol error while reading/writing SPI!\n"); |
Carl-Daniel Hailfinger | 5cca01f | 2009-11-24 00:20:03 +0000 | [diff] [blame] | 289 | return SPI_GENERIC_ERROR; |
| 290 | } |
| 291 | memcpy(readarr, buf + i, readcnt); |
| 292 | |
| 293 | i = 0; |
| 294 | /* De-assert CS# */ |
| 295 | buf[i++] = 0x03; |
| 296 | ret = buspirate_sendrecv(buf, 1, 1); |
| 297 | if (ret) |
| 298 | return SPI_GENERIC_ERROR; |
| 299 | if (buf[0] != 0x01) { |
Sean Nelson | 84f7bce | 2010-01-09 23:56:41 +0000 | [diff] [blame] | 300 | msg_perr("Protocol error while raising CS#!\n"); |
Carl-Daniel Hailfinger | 5cca01f | 2009-11-24 00:20:03 +0000 | [diff] [blame] | 301 | return SPI_GENERIC_ERROR; |
| 302 | } |
| 303 | |
| 304 | return ret; |
| 305 | } |
| 306 | |
| 307 | int buspirate_spi_read(struct flashchip *flash, uint8_t *buf, int start, int len) |
| 308 | { |
Carl-Daniel Hailfinger | d5b28fa | 2009-11-24 18:27:10 +0000 | [diff] [blame] | 309 | return spi_read_chunked(flash, buf, start, len, 12); |
Carl-Daniel Hailfinger | 5cca01f | 2009-11-24 00:20:03 +0000 | [diff] [blame] | 310 | } |
| 311 | |
Carl-Daniel Hailfinger | 408e47a | 2010-03-22 03:30:58 +0000 | [diff] [blame] | 312 | int buspirate_spi_write_256(struct flashchip *flash, uint8_t *buf) |
| 313 | { |
| 314 | int total_size = 1024 * flash->total_size; |
Carl-Daniel Hailfinger | 408e47a | 2010-03-22 03:30:58 +0000 | [diff] [blame] | 315 | |
| 316 | spi_disable_blockprotect(); |
| 317 | /* Erase first. */ |
| 318 | msg_pinfo("Erasing flash before programming... "); |
| 319 | if (erase_flash(flash)) { |
| 320 | msg_perr("ERASE FAILED!\n"); |
| 321 | return -1; |
| 322 | } |
| 323 | msg_pinfo("done.\n"); |
| 324 | |
Carl-Daniel Hailfinger | 5824fbf | 2010-05-21 23:09:42 +0000 | [diff] [blame] | 325 | return spi_write_chunked(flash, buf, 0, total_size, 12); |
Carl-Daniel Hailfinger | 408e47a | 2010-03-22 03:30:58 +0000 | [diff] [blame] | 326 | } |