2 * This file is part of the coreboot project.
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation; either version 2 of
7 * the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
15 #include <console/console.h>
16 #include <commonlib/helpers.h>
17 #include <spi_flash.h>
18 #include <spi-generic.h>
21 #include "spi_flash_internal.h"
23 /* A25L-specific commands */
24 #define CMD_A25_WREN 0x06 /* Write Enable */
25 #define CMD_A25_WRDI 0x04 /* Write Disable */
26 #define CMD_A25_RDSR 0x05 /* Read Status Register */
27 #define CMD_A25_WRSR 0x01 /* Write Status Register */
28 #define CMD_A25_READ 0x03 /* Read Data Bytes */
29 #define CMD_A25_FAST_READ 0x0b /* Read Data Bytes at Higher Speed */
30 #define CMD_A25_PP 0x02 /* Page Program */
31 #define CMD_A25_SE 0x20 /* Sector (4K) Erase */
32 #define CMD_A25_BE 0xd8 /* Block (64K) Erase */
33 #define CMD_A25_CE 0xc7 /* Chip Erase */
34 #define CMD_A25_DP 0xb9 /* Deep Power-down */
35 #define CMD_A25_RES 0xab /* Release from DP, and Read Signature */
37 static const struct spi_flash_part_id flash_table
[] = {
41 .nr_sectors_shift
= 9,
46 .nr_sectors_shift
= 9,
51 .nr_sectors_shift
= 8,
56 .nr_sectors_shift
= 9,
61 .nr_sectors_shift
= 10,
66 .nr_sectors_shift
= 8,
71 .nr_sectors_shift
= 9,
76 .nr_sectors_shift
= 10,
81 .nr_sectors_shift
= 11,
85 const struct spi_flash_vendor_info spi_flash_amic_vi
= {
88 .sector_size_kib_shift
= 2,
89 .match_id_mask
[0] = 0xffff,
91 .nr_part_ids
= ARRAY_SIZE(flash_table
),
92 .desc
= &spi_flash_pp_0x20_sector_desc
,