soc/intel/tigerlake: Add PMC mux control
[coreboot.git] / src / drivers / spi / amic.c
blobcb4ada01cec71be719728d903e3866d67ab902e2
1 /*
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>
19 #include <string.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[] = {
39 /* A25L16PU */
40 .id[0] = 0x2015,
41 .nr_sectors_shift = 9,
44 /* A25L16PT */
45 .id[0] = 0x2025,
46 .nr_sectors_shift = 9,
49 /* A25L080 */
50 .id[0] = 0x3014,
51 .nr_sectors_shift = 8,
54 /* A25L016 */
55 .id[0] = 0x3015,
56 .nr_sectors_shift = 9,
59 /* A25L032 */
60 .id[0] = 0x3016,
61 .nr_sectors_shift = 10,
64 /* A25LQ080 */
65 .id[0] = 0x4014,
66 .nr_sectors_shift = 8,
69 /* A25LQ16 */
70 .id[0] = 0x4015,
71 .nr_sectors_shift = 9,
74 /* A25LQ032 */
75 .id[0] = 0x4016,
76 .nr_sectors_shift = 10,
79 /* A25LQ64 */
80 .id[0] = 0x4017,
81 .nr_sectors_shift = 11,
85 const struct spi_flash_vendor_info spi_flash_amic_vi = {
86 .id = VENDOR_ID_AMIC,
87 .page_size_shift = 8,
88 .sector_size_kib_shift = 2,
89 .match_id_mask[0] = 0xffff,
90 .ids = flash_table,
91 .nr_part_ids = ARRAY_SIZE(flash_table),
92 .desc = &spi_flash_pp_0x20_sector_desc,