[PATCH 11/12] mtd: rawnand: stm32_fmc2: add MP25 support

From: Christophe Kerello
Date: Mon Feb 12 2024 - 12:54:55 EST


Add MP25 SOC support (4 chip select are available).

Signed-off-by: Christophe Kerello <christophe.kerello@xxxxxxxxxxx>
---
drivers/mtd/nand/raw/stm32_fmc2_nand.c | 21 ++++++++++++++++++---
1 file changed, 18 insertions(+), 3 deletions(-)

diff --git a/drivers/mtd/nand/raw/stm32_fmc2_nand.c b/drivers/mtd/nand/raw/stm32_fmc2_nand.c
index c5bdb43f7221..d71ec12cd5b1 100644
--- a/drivers/mtd/nand/raw/stm32_fmc2_nand.c
+++ b/drivers/mtd/nand/raw/stm32_fmc2_nand.c
@@ -1878,11 +1878,14 @@ static int stm32_fmc2_nfc_set_cdev(struct stm32_fmc2_nfc *nfc)
struct device *dev = nfc->dev;
bool ebi_found = false;

- if (dev->parent && of_device_is_compatible(dev->parent->of_node,
- "st,stm32mp1-fmc2-ebi"))
+ if (dev->parent && (of_device_is_compatible(dev->parent->of_node,
+ "st,stm32mp1-fmc2-ebi") ||
+ of_device_is_compatible(dev->parent->of_node,
+ "st,stm32mp25-fmc2-ebi")))
ebi_found = true;

- if (of_device_is_compatible(dev->of_node, "st,stm32mp1-fmc2-nfc")) {
+ if (of_device_is_compatible(dev->of_node, "st,stm32mp1-fmc2-nfc") ||
+ of_device_is_compatible(dev->of_node, "st,stm32mp25-fmc2-nfc")) {
if (ebi_found) {
nfc->cdev = dev->parent;

@@ -2119,6 +2122,10 @@ static const struct stm32_fmc2_nfc_data stm32_fmc2_nfc_mp1_data = {
.max_ncs = 2,
};

+static const struct stm32_fmc2_nfc_data stm32_fmc2_nfc_mp25_data = {
+ .max_ncs = 4,
+};
+
static const struct of_device_id stm32_fmc2_nfc_match[] = {
{
.compatible = "st,stm32mp15-fmc2",
@@ -2128,6 +2135,14 @@ static const struct of_device_id stm32_fmc2_nfc_match[] = {
.compatible = "st,stm32mp1-fmc2-nfc",
.data = &stm32_fmc2_nfc_mp1_data,
},
+ {
+ .compatible = "st,stm32mp25-fmc2",
+ .data = &stm32_fmc2_nfc_mp25_data,
+ },
+ {
+ .compatible = "st,stm32mp25-fmc2-nfc",
+ .data = &stm32_fmc2_nfc_mp25_data,
+ },
{}
};
MODULE_DEVICE_TABLE(of, stm32_fmc2_nfc_match);
--
2.25.1