coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
amic.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
3 #include <commonlib/helpers.h>
4 #include <spi_flash.h>
5 #include <spi-generic.h>
6 
7 #include "spi_flash_internal.h"
8 
9 /* A25L-specific commands */
10 #define CMD_A25_WREN 0x06 /* Write Enable */
11 #define CMD_A25_WRDI 0x04 /* Write Disable */
12 #define CMD_A25_RDSR 0x05 /* Read Status Register */
13 #define CMD_A25_WRSR 0x01 /* Write Status Register */
14 #define CMD_A25_READ 0x03 /* Read Data Bytes */
15 #define CMD_A25_FAST_READ 0x0b /* Read Data Bytes at Higher Speed */
16 #define CMD_A25_PP 0x02 /* Page Program */
17 #define CMD_A25_SE 0x20 /* Sector (4K) Erase */
18 #define CMD_A25_BE 0xd8 /* Block (64K) Erase */
19 #define CMD_A25_CE 0xc7 /* Chip Erase */
20 #define CMD_A25_DP 0xb9 /* Deep Power-down */
21 #define CMD_A25_RES 0xab /* Release from DP, and Read Signature */
22 
23 static const struct spi_flash_part_id flash_table[] = {
24  {
25  /* A25L16PU */
26  .id[0] = 0x2015,
27  .nr_sectors_shift = 9,
28  },
29  {
30  /* A25L16PT */
31  .id[0] = 0x2025,
32  .nr_sectors_shift = 9,
33  },
34  {
35  /* A25L080 */
36  .id[0] = 0x3014,
37  .nr_sectors_shift = 8,
38  },
39  {
40  /* A25L016 */
41  .id[0] = 0x3015,
42  .nr_sectors_shift = 9,
43  },
44  {
45  /* A25L032 */
46  .id[0] = 0x3016,
47  .nr_sectors_shift = 10,
48  },
49  {
50  /* A25LQ080 */
51  .id[0] = 0x4014,
52  .nr_sectors_shift = 8,
53  },
54  {
55  /* A25LQ16 */
56  .id[0] = 0x4015,
57  .nr_sectors_shift = 9,
58  },
59  {
60  /* A25LQ032 */
61  .id[0] = 0x4016,
62  .nr_sectors_shift = 10,
63  },
64  {
65  /* A25LQ64 */
66  .id[0] = 0x4017,
67  .nr_sectors_shift = 11,
68  },
69 };
70 
72  .id = VENDOR_ID_AMIC,
73  .page_size_shift = 8,
74  .sector_size_kib_shift = 2,
75  .match_id_mask[0] = 0xffff,
76  .ids = flash_table,
77  .nr_part_ids = ARRAY_SIZE(flash_table),
79 };
const struct spi_flash_vendor_info spi_flash_amic_vi
Definition: amic.c:71
static const struct spi_flash_part_id flash_table[]
Definition: amic.c:23
#define ARRAY_SIZE(a)
Definition: helpers.h:12
#define VENDOR_ID_AMIC
Definition: spi-generic.h:19
const struct spi_flash_ops_descriptor spi_flash_pp_0x20_sector_desc
Definition: spi_flash.c:793