| 1 |
|
| 2 |
|
| 3 |
#include <console/console.h> |
| 4 |
#include <commonlib/helpers.h> |
| 5 |
#include <spi_flash.h> |
| 6 |
#include <spi-generic.h> |
| 7 |
#include <delay.h> |
| 8 |
#include <lib.h> |
| 9 |
|
| 10 |
#include "spi_flash_internal.h" |
| 11 |
#include "spi_winbond.h" |
| 12 |
|
| 13 |
union status_reg1 { |
| 14 |
uint8_t u; |
| 15 |
struct { |
| 16 |
uint8_t busy : 1; |
| 17 |
uint8_t wel : 1; |
| 18 |
uint8_t bp : 3; |
| 19 |
uint8_t tb : 1; |
| 20 |
uint8_t sec : 1; |
| 21 |
uint8_t srp0 : 1; |
| 22 |
} bp3; |
| 23 |
struct { |
| 24 |
uint8_t busy : 1; |
| 25 |
uint8_t wel : 1; |
| 26 |
uint8_t bp : 4; |
| 27 |
uint8_t tb : 1; |
| 28 |
uint8_t srp0 : 1; |
| 29 |
} bp4; |
| 30 |
}; |
| 31 |
|
| 32 |
union status_reg2 { |
| 33 |
uint8_t u; |
| 34 |
struct { |
| 35 |
uint8_t srp1 : 1; |
| 36 |
uint8_t qe : 1; |
| 37 |
uint8_t res : 1; |
| 38 |
uint8_t lb : 3; |
| 39 |
uint8_t cmp : 1; |
| 40 |
uint8_t sus : 1; |
| 41 |
}; |
| 42 |
}; |
| 43 |
|
| 44 |
struct status_regs { |
| 45 |
union { |
| 46 |
struct { |
| 47 |
#if defined(__BIG_ENDIAN) |
| 48 |
union status_reg2 reg2; |
| 49 |
union status_reg1 reg1; |
| 50 |
#else |
| 51 |
union status_reg1 reg1; |
| 52 |
union status_reg2 reg2; |
| 53 |
#endif |
| 54 |
}; |
| 55 |
u16 u; |
| 56 |
}; |
| 57 |
}; |
| 58 |
|
| 59 |
static const struct spi_flash_part_id flash_table[] = { |
| 60 |
{ |
| 61 |
|
| 62 |
.id[0] = 0x2014, |
| 63 |
.nr_sectors_shift = 8, |
| 64 |
}, |
| 65 |
{ |
| 66 |
|
| 67 |
.id[0] = 0x2015, |
| 68 |
.nr_sectors_shift = 9, |
| 69 |
}, |
| 70 |
{ |
| 71 |
|
| 72 |
.id[0] = 0x2016, |
| 73 |
.nr_sectors_shift = 10, |
| 74 |
}, |
| 75 |
{ |
| 76 |
|
| 77 |
.id[0] = 0x3014, |
| 78 |
.nr_sectors_shift = 8, |
| 79 |
.fast_read_dual_output_support = 1, |
| 80 |
}, |
| 81 |
{ |
| 82 |
|
| 83 |
.id[0] = 0x3015, |
| 84 |
.nr_sectors_shift = 9, |
| 85 |
.fast_read_dual_output_support = 1, |
| 86 |
}, |
| 87 |
{ |
| 88 |
|
| 89 |
.id[0] = 0x3016, |
| 90 |
.nr_sectors_shift = 10, |
| 91 |
.fast_read_dual_output_support = 1, |
| 92 |
}, |
| 93 |
{ |
| 94 |
|
| 95 |
.id[0] = 0x3017, |
| 96 |
.nr_sectors_shift = 11, |
| 97 |
.fast_read_dual_output_support = 1, |
| 98 |
}, |
| 99 |
{ |
| 100 |
|
| 101 |
.id[0] = 0x4014, |
| 102 |
.nr_sectors_shift = 8, |
| 103 |
.fast_read_dual_output_support = 1, |
| 104 |
.fast_read_dual_io_support = 1, |
| 105 |
}, |
| 106 |
{ |
| 107 |
|
| 108 |
.id[0] = 0x4015, |
| 109 |
.nr_sectors_shift = 9, |
| 110 |
.fast_read_dual_output_support = 1, |
| 111 |
.fast_read_dual_io_support = 1, |
| 112 |
.protection_granularity_shift = 16, |
| 113 |
.bp_bits = 3, |
| 114 |
}, |
| 115 |
{ |
| 116 |
|
| 117 |
.id[0] = 0x6015, |
| 118 |
.nr_sectors_shift = 9, |
| 119 |
.fast_read_dual_output_support = 1, |
| 120 |
.fast_read_dual_io_support = 1, |
| 121 |
.protection_granularity_shift = 16, |
| 122 |
.bp_bits = 3, |
| 123 |
}, |
| 124 |
{ |
| 125 |
|
| 126 |
.id[0] = 0x4016, |
| 127 |
.nr_sectors_shift = 10, |
| 128 |
.fast_read_dual_output_support = 1, |
| 129 |
.fast_read_dual_io_support = 1, |
| 130 |
.protection_granularity_shift = 16, |
| 131 |
.bp_bits = 3, |
| 132 |
}, |
| 133 |
{ |
| 134 |
|
| 135 |
.id[0] = 0x6016, |
| 136 |
.nr_sectors_shift = 10, |
| 137 |
.fast_read_dual_output_support = 1, |
| 138 |
.fast_read_dual_io_support = 1, |
| 139 |
.protection_granularity_shift = 16, |
| 140 |
.bp_bits = 3, |
| 141 |
}, |
| 142 |
{ |
| 143 |
|
| 144 |
.id[0] = 0x4017, |
| 145 |
.nr_sectors_shift = 11, |
| 146 |
.fast_read_dual_output_support = 1, |
| 147 |
.fast_read_dual_io_support = 1, |
| 148 |
.protection_granularity_shift = 17, |
| 149 |
.bp_bits = 3, |
| 150 |
}, |
| 151 |
{ |
| 152 |
|
| 153 |
.id[0] = 0x6017, |
| 154 |
.nr_sectors_shift = 11, |
| 155 |
.fast_read_dual_output_support = 1, |
| 156 |
.fast_read_dual_io_support = 1, |
| 157 |
.protection_granularity_shift = 17, |
| 158 |
.bp_bits = 3, |
| 159 |
}, |
| 160 |
{ |
| 161 |
|
| 162 |
.id[0] = 0x7017, |
| 163 |
.nr_sectors_shift = 11, |
| 164 |
.fast_read_dual_output_support = 1, |
| 165 |
.fast_read_dual_io_support = 1, |
| 166 |
.protection_granularity_shift = 17, |
| 167 |
.bp_bits = 3, |
| 168 |
}, |
| 169 |
{ |
| 170 |
|
| 171 |
.id[0] = 0x8017, |
| 172 |
.nr_sectors_shift = 11, |
| 173 |
.fast_read_dual_output_support = 1, |
| 174 |
.fast_read_dual_io_support = 1, |
| 175 |
.protection_granularity_shift = 17, |
| 176 |
.bp_bits = 3, |
| 177 |
}, |
| 178 |
{ |
| 179 |
|
| 180 |
.id[0] = 0x4018, |
| 181 |
.nr_sectors_shift = 12, |
| 182 |
.fast_read_dual_output_support = 1, |
| 183 |
.fast_read_dual_io_support = 1, |
| 184 |
.protection_granularity_shift = 18, |
| 185 |
.bp_bits = 3, |
| 186 |
}, |
| 187 |
{ |
| 188 |
|
| 189 |
.id[0] = 0x6018, |
| 190 |
.nr_sectors_shift = 12, |
| 191 |
.fast_read_dual_output_support = 1, |
| 192 |
.fast_read_dual_io_support = 1, |
| 193 |
.protection_granularity_shift = 18, |
| 194 |
.bp_bits = 3, |
| 195 |
}, |
| 196 |
{ |
| 197 |
|
| 198 |
.id[0] = 0x7018, |
| 199 |
.nr_sectors_shift = 12, |
| 200 |
.fast_read_dual_output_support = 1, |
| 201 |
.fast_read_dual_io_support = 1, |
| 202 |
.protection_granularity_shift = 18, |
| 203 |
.bp_bits = 3, |
| 204 |
}, |
| 205 |
{ |
| 206 |
|
| 207 |
.id[0] = 0x8018, |
| 208 |
.nr_sectors_shift = 12, |
| 209 |
.fast_read_dual_output_support = 1, |
| 210 |
.fast_read_dual_io_support = 1, |
| 211 |
.protection_granularity_shift = 18, |
| 212 |
.bp_bits = 3, |
| 213 |
}, |
| 214 |
{ |
| 215 |
|
| 216 |
.id[0] = 0x8020, |
| 217 |
.nr_sectors_shift = 14, |
| 218 |
.fast_read_dual_output_support = 1, |
| 219 |
.fast_read_dual_io_support = 1, |
| 220 |
.protection_granularity_shift = 16, |
| 221 |
.bp_bits = 4, |
| 222 |
}, |
| 223 |
{ |
| 224 |
|
| 225 |
.id[0] = 0x4019, |
| 226 |
.nr_sectors_shift = 13, |
| 227 |
.fast_read_dual_output_support = 1, |
| 228 |
.fast_read_dual_io_support = 1, |
| 229 |
.protection_granularity_shift = 16, |
| 230 |
.bp_bits = 4, |
| 231 |
}, |
| 232 |
{ |
| 233 |
|
| 234 |
.id[0] = 0x7019, |
| 235 |
.nr_sectors_shift = 13, |
| 236 |
.fast_read_dual_output_support = 1, |
| 237 |
.fast_read_dual_io_support = 1, |
| 238 |
.protection_granularity_shift = 16, |
| 239 |
.bp_bits = 4, |
| 240 |
}, |
| 241 |
{ |
| 242 |
|
| 243 |
.id[0] = 0x6019, |
| 244 |
.nr_sectors_shift = 13, |
| 245 |
.fast_read_dual_output_support = 1, |
| 246 |
.fast_read_dual_io_support = 1, |
| 247 |
.protection_granularity_shift = 16, |
| 248 |
.bp_bits = 4, |
| 249 |
}, |
| 250 |
{ |
| 251 |
|
| 252 |
.id[0] = 0x8019, |
| 253 |
.nr_sectors_shift = 13, |
| 254 |
.fast_read_dual_output_support = 1, |
| 255 |
.fast_read_dual_io_support = 1, |
| 256 |
.protection_granularity_shift = 16, |
| 257 |
.bp_bits = 4, |
| 258 |
}, |
| 259 |
}; |
| 260 |
|
| 261 |
|
| 262 |
|
| 263 |
|
| 264 |
|
| 265 |
static void winbond_bpbits_to_region(const size_t granularity, |
| 266 |
const struct spi_flash_bpbits *bits, |
| 267 |
const size_t flash_size, |
| 268 |
struct region *out) |
| 269 |
{ |
| 270 |
size_t protected_size = |
| 271 |
MIN(bits->bp ? granularity << (bits->bp - 1) : 0, flash_size); |
| 272 |
|
| 273 |
int tb = bits->tb; |
| 274 |
if (bits->cmp) { |
| 275 |
protected_size = flash_size - protected_size; |
| 276 |
tb = !tb; |
| 277 |
} |
| 278 |
|
| 279 |
*out = region_create(tb ? 0 : flash_size - protected_size, protected_size); |
| 280 |
} |
| 281 |
|
| 282 |
|
| 283 |
|
| 284 |
|
| 285 |
|
| 286 |
|
| 287 |
|
| 288 |
|
| 289 |
|
| 290 |
|
| 291 |
|
| 292 |
static int winbond_get_write_protection(const struct spi_flash *flash, |
| 293 |
const struct region *region) |
| 294 |
{ |
| 295 |
const struct spi_flash_part_id *params; |
| 296 |
struct region wp_region; |
| 297 |
struct spi_flash_bpbits bpbits; |
| 298 |
int ret; |
| 299 |
|
| 300 |
params = flash->part; |
| 301 |
|
| 302 |
if (!params) |
| 303 |
return -1; |
| 304 |
|
| 305 |
const size_t granularity = (1 << params->protection_granularity_shift); |
| 306 |
|
| 307 |
union status_reg1 reg1 = { .u = 0 }; |
| 308 |
union status_reg2 reg2 = { .u = 0 }; |
| 309 |
|
| 310 |
ret = spi_flash_cmd(&flash->spi, flash->status_cmd, ®1.u, |
| 311 |
sizeof(reg1.u)); |
| 312 |
if (ret) |
| 313 |
return ret; |
| 314 |
|
| 315 |
ret = spi_flash_cmd(&flash->spi, CMD_W25_RDSR2, ®2.u, |
| 316 |
sizeof(reg2.u)); |
| 317 |
if (ret) |
| 318 |
return ret; |
| 319 |
|
| 320 |
if (params->bp_bits == 3) { |
| 321 |
if (reg1.bp3.sec) { |
| 322 |
|
| 323 |
return -1; |
| 324 |
} |
| 325 |
|
| 326 |
bpbits = (struct spi_flash_bpbits){ |
| 327 |
.bp = reg1.bp3.bp, |
| 328 |
.cmp = reg2.cmp, |
| 329 |
.tb = reg1.bp3.tb, |
| 330 |
|
| 331 |
|
| 332 |
|
| 333 |
|
| 334 |
|
| 335 |
|
| 336 |
|
| 337 |
|
| 338 |
|
| 339 |
|
| 340 |
|
| 341 |
.winbond = { |
| 342 |
.srp0 = reg1.bp3.srp0, |
| 343 |
.srp1 = reg2.srp1, |
| 344 |
}, |
| 345 |
}; |
| 346 |
} else if (params->bp_bits == 4) { |
| 347 |
bpbits = (struct spi_flash_bpbits){ |
| 348 |
.bp = reg1.bp4.bp, |
| 349 |
.cmp = reg2.cmp, |
| 350 |
.tb = reg1.bp4.tb, |
| 351 |
|
| 352 |
|
| 353 |
|
| 354 |
|
| 355 |
|
| 356 |
|
| 357 |
|
| 358 |
|
| 359 |
|
| 360 |
|
| 361 |
|
| 362 |
|
| 363 |
|
| 364 |
|
| 365 |
|
| 366 |
.winbond = { |
| 367 |
.srp0 = reg1.bp4.srp0, |
| 368 |
.srp1 = reg2.srp1, |
| 369 |
}, |
| 370 |
}; |
| 371 |
} else { |
| 372 |
|
| 373 |
return -1; |
| 374 |
} |
| 375 |
|
| 376 |
winbond_bpbits_to_region(granularity, &bpbits, flash->size, |
| 377 |
&wp_region); |
| 378 |
|
| 379 |
if (!region_sz(&wp_region)) { |
| 380 |
printk(BIOS_DEBUG, "WINBOND: flash isn't protected\n"); |
| 381 |
|
| 382 |
return 0; |
| 383 |
} |
| 384 |
|
| 385 |
printk(BIOS_DEBUG, "WINBOND: flash protected range 0x%08zx-0x%08zx\n", |
| 386 |
region_offset(&wp_region), region_last(&wp_region)); |
| 387 |
|
| 388 |
return region_is_subregion(&wp_region, region); |
| 389 |
} |
| 390 |
|
| 391 |
|
| 392 |
|
| 393 |
|
| 394 |
|
| 395 |
|
| 396 |
|
| 397 |
|
| 398 |
|
| 399 |
|
| 400 |
|
| 401 |
|
| 402 |
static int winbond_flash_cmd_status(const struct spi_flash *flash, |
| 403 |
const u16 mask, |
| 404 |
const u16 val, |
| 405 |
const bool non_volatile) |
| 406 |
{ |
| 407 |
struct { |
| 408 |
u8 cmd; |
| 409 |
u16 sreg; |
| 410 |
} __packed cmdbuf; |
| 411 |
u8 reg8; |
| 412 |
int ret; |
| 413 |
|
| 414 |
if (!flash) |
| 415 |
return -1; |
| 416 |
|
| 417 |
ret = spi_flash_cmd(&flash->spi, CMD_W25_RDSR, ®8, sizeof(reg8)); |
| 418 |
if (ret) |
| 419 |
return ret; |
| 420 |
|
| 421 |
cmdbuf.sreg = reg8; |
| 422 |
|
| 423 |
ret = spi_flash_cmd(&flash->spi, CMD_W25_RDSR2, ®8, sizeof(reg8)); |
| 424 |
if (ret) |
| 425 |
return ret; |
| 426 |
|
| 427 |
cmdbuf.sreg |= reg8 << 8; |
| 428 |
|
| 429 |
if ((val & mask) == (cmdbuf.sreg & mask)) |
| 430 |
return 0; |
| 431 |
|
| 432 |
if (non_volatile) { |
| 433 |
ret = spi_flash_cmd(&flash->spi, CMD_W25_WREN, NULL, 0); |
| 434 |
} else { |
| 435 |
ret = spi_flash_cmd(&flash->spi, CMD_VOLATILE_SREG_WREN, NULL, |
| 436 |
0); |
| 437 |
} |
| 438 |
if (ret) |
| 439 |
return ret; |
| 440 |
|
| 441 |
cmdbuf.sreg &= ~mask; |
| 442 |
cmdbuf.sreg |= val & mask; |
| 443 |
cmdbuf.cmd = CMD_W25_WRSR; |
| 444 |
|
| 445 |
|
| 446 |
ret = spi_flash_cmd_write(&flash->spi, (u8 *)&cmdbuf, sizeof(cmdbuf), |
| 447 |
NULL, 0); |
| 448 |
if (ret) |
| 449 |
return ret; |
| 450 |
|
| 451 |
if (non_volatile) { |
| 452 |
|
| 453 |
ret = spi_flash_cmd_wait_ready(flash, WINBOND_FLASH_TIMEOUT); |
| 454 |
if (ret) |
| 455 |
return ret; |
| 456 |
} else { |
| 457 |
|
| 458 |
udelay(1); |
| 459 |
} |
| 460 |
|
| 461 |
|
| 462 |
ret = spi_flash_cmd(&flash->spi, CMD_W25_RDSR, ®8, sizeof(reg8)); |
| 463 |
if (ret) |
| 464 |
return ret; |
| 465 |
|
| 466 |
cmdbuf.sreg = reg8; |
| 467 |
|
| 468 |
ret = spi_flash_cmd(&flash->spi, CMD_W25_RDSR2, ®8, sizeof(reg8)); |
| 469 |
if (ret) |
| 470 |
return ret; |
| 471 |
|
| 472 |
cmdbuf.sreg |= reg8 << 8; |
| 473 |
|
| 474 |
printk(BIOS_DEBUG, "WINBOND: SREG=%02x SREG2=%02x\n", |
| 475 |
cmdbuf.sreg & 0xff, |
| 476 |
cmdbuf.sreg >> 8); |
| 477 |
|
| 478 |
|
| 479 |
if ((val & mask) != (cmdbuf.sreg & mask)) { |
| 480 |
printk(BIOS_ERR, "WINBOND: SREG is locked!\n"); |
| 481 |
ret = -1; |
| 482 |
} |
| 483 |
|
| 484 |
return ret; |
| 485 |
} |
| 486 |
|
| 487 |
|
| 488 |
|
| 489 |
|
| 490 |
|
| 491 |
|
| 492 |
|
| 493 |
|
| 494 |
|
| 495 |
|
| 496 |
|
| 497 |
|
| 498 |
|
| 499 |
|
| 500 |
|
| 501 |
|
| 502 |
static int |
| 503 |
winbond_set_write_protection(const struct spi_flash *flash, |
| 504 |
const struct region *region, |
| 505 |
const enum spi_flash_status_reg_lockdown mode) |
| 506 |
{ |
| 507 |
const struct spi_flash_part_id *params; |
| 508 |
struct status_regs mask, val; |
| 509 |
struct region wp_region; |
| 510 |
u8 cmp, bp, tb; |
| 511 |
int ret; |
| 512 |
|
| 513 |
|
| 514 |
if (region_offset(region) != 0 && region_last(region) != flash->size - 1) |
| 515 |
return -1; |
| 516 |
|
| 517 |
params = flash->part; |
| 518 |
|
| 519 |
if (!params) |
| 520 |
return -1; |
| 521 |
|
| 522 |
if (params->bp_bits != 3 && params->bp_bits != 4) { |
| 523 |
|
| 524 |
return -1; |
| 525 |
} |
| 526 |
|
| 527 |
wp_region = *region; |
| 528 |
|
| 529 |
if (region_offset(&wp_region) == 0) |
| 530 |
tb = 1; |
| 531 |
else |
| 532 |
tb = 0; |
| 533 |
|
| 534 |
if (region_sz(&wp_region) > flash->size / 2) { |
| 535 |
cmp = 1; |
| 536 |
wp_region = region_create(tb ? 0 : region_sz(&wp_region), |
| 537 |
flash->size - region_sz(&wp_region)); |
| 538 |
tb = !tb; |
| 539 |
} else { |
| 540 |
cmp = 0; |
| 541 |
} |
| 542 |
|
| 543 |
if (region_sz(&wp_region) == 0) { |
| 544 |
bp = 0; |
| 545 |
} else if (IS_POWER_OF_2(region_sz(&wp_region)) && |
| 546 |
(region_sz(&wp_region) >= |
| 547 |
(1 << params->protection_granularity_shift))) { |
| 548 |
bp = log2(region_sz(&wp_region)) - |
| 549 |
params->protection_granularity_shift + 1; |
| 550 |
} else { |
| 551 |
printk(BIOS_ERR, "WINBOND: ERROR: unsupported region size\n"); |
| 552 |
return -1; |
| 553 |
} |
| 554 |
|
| 555 |
|
| 556 |
|
| 557 |
if (params->bp_bits == 3) { |
| 558 |
val.reg1 = (union status_reg1) { |
| 559 |
.bp3 = { .bp = bp, .tb = tb, .sec = 0 } |
| 560 |
}; |
| 561 |
mask.reg1 = (union status_reg1) { |
| 562 |
.bp3 = { .bp = ~0, .tb = 1, .sec = 1 } |
| 563 |
}; |
| 564 |
} else { |
| 565 |
val.reg1 = (union status_reg1) { |
| 566 |
.bp4 = { .bp = bp, .tb = tb } |
| 567 |
}; |
| 568 |
mask.reg1 = (union status_reg1) { |
| 569 |
.bp4 = { .bp = ~0, .tb = 1 } |
| 570 |
}; |
| 571 |
} |
| 572 |
|
| 573 |
val.reg2 = (union status_reg2) { .cmp = cmp }; |
| 574 |
mask.reg2 = (union status_reg2) { .cmp = 1 }; |
| 575 |
|
| 576 |
if (mode != SPI_WRITE_PROTECTION_PRESERVE) { |
| 577 |
u8 srp; |
| 578 |
switch (mode) { |
| 579 |
case SPI_WRITE_PROTECTION_NONE: |
| 580 |
srp = 0; |
| 581 |
break; |
| 582 |
case SPI_WRITE_PROTECTION_PIN: |
| 583 |
srp = 1; |
| 584 |
break; |
| 585 |
case SPI_WRITE_PROTECTION_REBOOT: |
| 586 |
srp = 2; |
| 587 |
break; |
| 588 |
case SPI_WRITE_PROTECTION_PERMANENT: |
| 589 |
srp = 3; |
| 590 |
break; |
| 591 |
default: |
| 592 |
return -1; |
| 593 |
} |
| 594 |
|
| 595 |
if (params->bp_bits == 3) { |
| 596 |
val.reg1.bp3.srp0 = !!(srp & 1); |
| 597 |
mask.reg1.bp3.srp0 = 1; |
| 598 |
} else { |
| 599 |
val.reg1.bp4.srp0 = !!(srp & 1); |
| 600 |
mask.reg1.bp4.srp0 = 1; |
| 601 |
} |
| 602 |
|
| 603 |
val.reg2.srp1 = !!(srp & 2); |
| 604 |
mask.reg2.srp1 = 1; |
| 605 |
} |
| 606 |
|
| 607 |
ret = winbond_flash_cmd_status(flash, mask.u, val.u, true); |
| 608 |
if (ret) |
| 609 |
return ret; |
| 610 |
|
| 611 |
printk(BIOS_DEBUG, "WINBOND: write-protection set to range " |
| 612 |
"0x%08zx-0x%08zx\n", region_offset(region), region_last(region)); |
| 613 |
|
| 614 |
return ret; |
| 615 |
} |
| 616 |
|
| 617 |
static const struct spi_flash_protection_ops spi_flash_protection_ops = { |
| 618 |
.get_write = winbond_get_write_protection, |
| 619 |
.set_write = winbond_set_write_protection, |
| 620 |
}; |
| 621 |
|
| 622 |
const struct spi_flash_vendor_info spi_flash_winbond_vi = { |
| 623 |
.id = VENDOR_ID_WINBOND, |
| 624 |
.page_size_shift = 8, |
| 625 |
.sector_size_kib_shift = 2, |
| 626 |
.match_id_mask[0] = 0xffff, |
| 627 |
.ids = flash_table, |
| 628 |
.nr_part_ids = ARRAY_SIZE(flash_table), |
| 629 |
.desc = &spi_flash_pp_0x20_sector_desc, |
| 630 |
.prot_ops = &spi_flash_protection_ops, |
| 631 |
}; |