mirror of
https://github.com/andreili/SBC_builder.git
synced 2025-08-24 03:14:06 +02:00
86 lines
2.5 KiB
Diff
86 lines
2.5 KiB
Diff
From 3b39764173b1cd726267af2c4510f1ac145c1def Mon Sep 17 00:00:00 2001
|
|
From: Ondrej Jirman <megi@xff.cz>
|
|
Date: Tue, 1 Aug 2023 14:56:33 +0200
|
|
Subject: mtd: spi-nor: Add Alliance memory support
|
|
|
|
- 128MBit flash: as25f1128mq
|
|
|
|
Signed-off-by: Ondrej Jirman <megi@xff.cz>
|
|
---
|
|
drivers/mtd/spi-nor/Makefile | 1 +
|
|
drivers/mtd/spi-nor/alliance.c | 24 ++++++++++++++++++++++++
|
|
drivers/mtd/spi-nor/core.c | 1 +
|
|
drivers/mtd/spi-nor/core.h | 1 +
|
|
4 files changed, 27 insertions(+)
|
|
create mode 100644 drivers/mtd/spi-nor/alliance.c
|
|
|
|
diff --git a/drivers/mtd/spi-nor/Makefile b/drivers/mtd/spi-nor/Makefile
|
|
index 5dd9c35f6b6f..998876920319 100644
|
|
--- a/drivers/mtd/spi-nor/Makefile
|
|
+++ b/drivers/mtd/spi-nor/Makefile
|
|
@@ -1,6 +1,7 @@
|
|
# SPDX-License-Identifier: GPL-2.0
|
|
|
|
spi-nor-objs := core.o sfdp.o swp.o otp.o sysfs.o
|
|
+spi-nor-objs += alliance.o
|
|
spi-nor-objs += atmel.o
|
|
spi-nor-objs += eon.o
|
|
spi-nor-objs += esmt.o
|
|
diff --git a/drivers/mtd/spi-nor/alliance.c b/drivers/mtd/spi-nor/alliance.c
|
|
new file mode 100644
|
|
index 000000000000..f3f03d458a5c
|
|
--- /dev/null
|
|
+++ b/drivers/mtd/spi-nor/alliance.c
|
|
@@ -0,0 +1,24 @@
|
|
+// SPDX-License-Identifier: GPL-2.0
|
|
+/*
|
|
+ * Copyright (C) 2023, Ondrej Jirman <megi@xff.cz>
|
|
+ */
|
|
+
|
|
+#include <linux/mtd/spi-nor.h>
|
|
+
|
|
+#include "core.h"
|
|
+
|
|
+static const struct flash_info alliance_nor_parts[] = {
|
|
+ {
|
|
+ .id = SNOR_ID(0x52, 0x42, 0x18),
|
|
+ .name = "as25f1128mq",
|
|
+ .size = SZ_16M,
|
|
+ .flags = SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB,
|
|
+ .no_sfdp_flags = SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ,
|
|
+ },
|
|
+};
|
|
+
|
|
+const struct spi_nor_manufacturer spi_nor_alliance = {
|
|
+ .name = "alliance",
|
|
+ .parts = alliance_nor_parts,
|
|
+ .nparts = ARRAY_SIZE(alliance_nor_parts),
|
|
+};
|
|
diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c
|
|
index 7bb44fabe093..12c3b844e135 100644
|
|
--- a/drivers/mtd/spi-nor/core.c
|
|
+++ b/drivers/mtd/spi-nor/core.c
|
|
@@ -1967,6 +1967,7 @@ int spi_nor_sr2_bit7_quad_enable(struct spi_nor *nor)
|
|
}
|
|
|
|
static const struct spi_nor_manufacturer *manufacturers[] = {
|
|
+ &spi_nor_alliance,
|
|
&spi_nor_atmel,
|
|
&spi_nor_eon,
|
|
&spi_nor_esmt,
|
|
diff --git a/drivers/mtd/spi-nor/core.h b/drivers/mtd/spi-nor/core.h
|
|
index ceff412f7d65..fff7ee7c504e 100644
|
|
--- a/drivers/mtd/spi-nor/core.h
|
|
+++ b/drivers/mtd/spi-nor/core.h
|
|
@@ -584,6 +584,7 @@ struct sfdp {
|
|
};
|
|
|
|
/* Manufacturer drivers. */
|
|
+extern const struct spi_nor_manufacturer spi_nor_alliance;
|
|
extern const struct spi_nor_manufacturer spi_nor_atmel;
|
|
extern const struct spi_nor_manufacturer spi_nor_eon;
|
|
extern const struct spi_nor_manufacturer spi_nor_esmt;
|
|
--
|
|
2.35.3
|
|
|