xref: /openbmc/linux/drivers/mtd/spi-nor/atmel.c (revision 3a83e4e6)
1 // SPDX-License-Identifier: GPL-2.0
2 /*
3  * Copyright (C) 2005, Intec Automation Inc.
4  * Copyright (C) 2014, Freescale Semiconductor, Inc.
5  */
6 
7 #include <linux/mtd/spi-nor.h>
8 
9 #include "core.h"
10 
11 static const struct flash_info atmel_parts[] = {
12 	/* Atmel -- some are (confusingly) marketed as "DataFlash" */
13 	{ "at25fs010",  INFO(0x1f6601, 0, 32 * 1024,   4, SECT_4K) },
14 	{ "at25fs040",  INFO(0x1f6604, 0, 64 * 1024,   8, SECT_4K) },
15 
16 	{ "at25df041a", INFO(0x1f4401, 0, 64 * 1024,   8, SECT_4K) },
17 	{ "at25df321",  INFO(0x1f4700, 0, 64 * 1024,  64, SECT_4K) },
18 	{ "at25df321a", INFO(0x1f4701, 0, 64 * 1024,  64, SECT_4K) },
19 	{ "at25df641",  INFO(0x1f4800, 0, 64 * 1024, 128, SECT_4K) },
20 
21 	{ "at25sl321",	INFO(0x1f4216, 0, 64 * 1024, 64,
22 			     SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
23 
24 	{ "at26f004",   INFO(0x1f0400, 0, 64 * 1024,  8, SECT_4K) },
25 	{ "at26df081a", INFO(0x1f4501, 0, 64 * 1024, 16, SECT_4K) },
26 	{ "at26df161a", INFO(0x1f4601, 0, 64 * 1024, 32, SECT_4K) },
27 	{ "at26df321",  INFO(0x1f4700, 0, 64 * 1024, 64, SECT_4K) },
28 
29 	{ "at45db081d", INFO(0x1f2500, 0, 64 * 1024, 16, SECT_4K) },
30 };
31 
32 static void atmel_default_init(struct spi_nor *nor)
33 {
34 	nor->flags |= SNOR_F_HAS_LOCK;
35 }
36 
37 static const struct spi_nor_fixups atmel_fixups = {
38 	.default_init = atmel_default_init,
39 };
40 
41 const struct spi_nor_manufacturer spi_nor_atmel = {
42 	.name = "atmel",
43 	.parts = atmel_parts,
44 	.nparts = ARRAY_SIZE(atmel_parts),
45 	.fixups = &atmel_fixups,
46 };
47