From b9aa3ac670403ef09eb9d8ea44e5ea367c1b72a4 Mon Sep 17 00:00:00 2001 From: Jon Lin Date: Thu, 24 Mar 2022 17:22:10 +0800 Subject: [PATCH] mtd: spi-nor: fmsh: Add code Change-Id: I8d95f3535c841a9829228eed1d213afda19ef0e6 Signed-off-by: Jon Lin --- drivers/mtd/spi-nor/Makefile | 1 + drivers/mtd/spi-nor/core.c | 1 + drivers/mtd/spi-nor/core.h | 1 + drivers/mtd/spi-nor/fmsh.c | 21 +++++++++++++++++++++ 4 files changed, 24 insertions(+) create mode 100644 drivers/mtd/spi-nor/fmsh.c diff --git a/drivers/mtd/spi-nor/Makefile b/drivers/mtd/spi-nor/Makefile index 3f7a52d7fa0b..f090a2082761 100644 --- a/drivers/mtd/spi-nor/Makefile +++ b/drivers/mtd/spi-nor/Makefile @@ -6,6 +6,7 @@ spi-nor-objs += catalyst.o spi-nor-objs += eon.o spi-nor-objs += esmt.o spi-nor-objs += everspin.o +spi-nor-objs += fmsh.o spi-nor-objs += fujitsu.o spi-nor-objs += gigadevice.o spi-nor-objs += intel.o diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c index e322d164464a..06eb70d68f76 100644 --- a/drivers/mtd/spi-nor/core.c +++ b/drivers/mtd/spi-nor/core.c @@ -2014,6 +2014,7 @@ static const struct spi_nor_manufacturer *manufacturers[] = { &spi_nor_eon, &spi_nor_esmt, &spi_nor_everspin, + &spi_nor_fmsh, &spi_nor_fujitsu, &spi_nor_gigadevice, &spi_nor_intel, diff --git a/drivers/mtd/spi-nor/core.h b/drivers/mtd/spi-nor/core.h index e20710d3c377..8522c29aac41 100644 --- a/drivers/mtd/spi-nor/core.h +++ b/drivers/mtd/spi-nor/core.h @@ -386,6 +386,7 @@ extern const struct spi_nor_manufacturer spi_nor_catalyst; extern const struct spi_nor_manufacturer spi_nor_eon; extern const struct spi_nor_manufacturer spi_nor_esmt; extern const struct spi_nor_manufacturer spi_nor_everspin; +extern const struct spi_nor_manufacturer spi_nor_fmsh; extern const struct spi_nor_manufacturer spi_nor_fujitsu; extern const struct spi_nor_manufacturer spi_nor_gigadevice; extern const struct spi_nor_manufacturer spi_nor_intel; diff --git a/drivers/mtd/spi-nor/fmsh.c b/drivers/mtd/spi-nor/fmsh.c new file mode 100644 index 000000000000..f46ef47588be --- /dev/null +++ b/drivers/mtd/spi-nor/fmsh.c @@ -0,0 +1,21 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (c) 2022 Rockchip Electronics Co., Ltd. + */ + +#include + +#include "core.h" + +static const struct flash_info fmsh_parts[] = { + { "FM25Q64A", INFO(0xA14017, 0, 64 * 1024, 128, + SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) }, + { "FM25Q128A", INFO(0xA14018, 0, 64 * 1024, 256, + SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) }, +}; + +const struct spi_nor_manufacturer spi_nor_fmsh = { + .name = "fmsh", + .parts = fmsh_parts, + .nparts = ARRAY_SIZE(fmsh_parts), +};