From: Krzysztof Kozlowski <krzk@kernel.org>
To: Santhosh Kumar K <s-k6@ti.com>, robh@kernel.org, conor+dt@kernel.org
Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v2 2/2] memory: ti-k3-fsas: Add TI FSS_FSAS driver
Date: Wed, 8 Jul 2026 13:09:14 +0200 [thread overview]
Message-ID: <cf5903d7-9ece-49f0-92a8-9f0dd2c27b01@kernel.org> (raw)
In-Reply-To: <20260629072055.896322-3-s-k6@ti.com>
On 29/06/2026 09:20, Santhosh Kumar K wrote:
> Add a platform driver for the TI Flash SubSystem Application Subsystem
> (FSS_FSAS_GENREGS) in K3 SoCs. This driver takes care of disabling the
> OSPI XIP prefetch which causes DMA transfer data corruption.
>
> Set SYSCONFIG.DISXIP to disable XIP read prefetch, preventing DMA data
> corruption when the OSPI DMA source address is not 4K-aligned.
>
> Signed-off-by: Santhosh Kumar K <s-k6@ti.com>
> ---
> drivers/memory/Kconfig | 10 +++++
> drivers/memory/Makefile | 1 +
> drivers/memory/ti-k3-fsas.c | 74 +++++++++++++++++++++++++++++++++++++
> 3 files changed, 85 insertions(+)
> create mode 100644 drivers/memory/ti-k3-fsas.c
>
> diff --git a/drivers/memory/Kconfig b/drivers/memory/Kconfig
> index e5527020ff33..954e47810e8d 100644
> --- a/drivers/memory/Kconfig
> +++ b/drivers/memory/Kconfig
> @@ -125,6 +125,16 @@ config TI_EMIF_SRAM
> sequence so this driver provides several relocatable PM functions
> for the SoC PM code to use.
>
> +config TI_K3_FSS_FSAS
> + tristate "TI K3 Flash Subsystem Application Subsystem (FSAS) support"
> + depends on ARCH_K3 || COMPILE_TEST
> + help
> + Driver for the TI K3 Flash Subsystem Application Subsystem
> + (FSS_FSAS_GENREGS) wrapper found on K3 related SoCs.
> +
> + This driver takes care of disabling the OSPI XIP prefetch which
> + causes DMA transfer data corruption.
> +
> config FPGA_DFL_EMIF
> tristate "FPGA DFL EMIF Driver"
> depends on FPGA_DFL && HAS_IOMEM
> diff --git a/drivers/memory/Makefile b/drivers/memory/Makefile
> index 3ee883c8759a..8dc4860f615d 100644
> --- a/drivers/memory/Makefile
> +++ b/drivers/memory/Makefile
> @@ -28,6 +28,7 @@ obj-$(CONFIG_STM32_OMM) += stm32_omm.o
> obj-$(CONFIG_SAMSUNG_MC) += samsung/
> obj-$(CONFIG_TEGRA_MC) += tegra/
> obj-$(CONFIG_TI_EMIF_SRAM) += ti-emif-sram.o
> +obj-$(CONFIG_TI_K3_FSS_FSAS) += ti-k3-fsas.o
> obj-$(CONFIG_FPGA_DFL_EMIF) += dfl-emif.o
>
> ti-emif-sram-objs := ti-emif-pm.o ti-emif-sram-pm.o
> diff --git a/drivers/memory/ti-k3-fsas.c b/drivers/memory/ti-k3-fsas.c
> new file mode 100644
> index 000000000000..a5f42afc694c
> --- /dev/null
> +++ b/drivers/memory/ti-k3-fsas.c
> @@ -0,0 +1,74 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * TI K3 Flash Subsystem Application Subsystem (FSS_FSAS) driver
> + *
> + * Copyright (C) 2025 Texas Instruments Incorporated - https://www.ti.com
> + */
> +
> +#include <linux/io.h>
> +#include <linux/module.h>
> +#include <linux/of.h>
> +#include <linux/platform_device.h>
> +#include <linux/pm.h>
> +
> +#define FSAS_GENREGS_SYSCONFIG 0x04
> +#define FSAS_SYSCONFIG_DISXIP BIT(7)
> +
> +struct k3_fsas {
> + void __iomem *base;
> +};
> +
> +static void k3_fsas_disable_xip_prefetch(struct k3_fsas *fsas)
> +{
> + u32 val;
> +
> + val = readl(fsas->base + FSAS_GENREGS_SYSCONFIG);
> + val |= FSAS_SYSCONFIG_DISXIP;
> + writel(val, fsas->base + FSAS_GENREGS_SYSCONFIG);
> +}
> +
> +static int k3_fsas_probe(struct platform_device *pdev)
> +{
> + struct k3_fsas *fsas;
> +
> + fsas = devm_kzalloc(&pdev->dev, sizeof(*fsas), GFP_KERNEL);
> + if (!fsas)
> + return -ENOMEM;
> +
> + fsas->base = devm_platform_ioremap_resource(pdev, 0);
> + if (IS_ERR(fsas->base))
> + return PTR_ERR(fsas->base);
> +
> + platform_set_drvdata(pdev, fsas);
> +
> + k3_fsas_disable_xip_prefetch(fsas);
So a driver for FSAS device just writes to one register. That's why I
claim binding is either incomplete or not really a separate device.
Plus how does this work when you probe QSPI before this FSAS?
Best regards,
Krzysztof
next prev parent reply other threads:[~2026-07-08 11:09 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-29 7:20 [PATCH v2 0/2] Fix OSPI DMA corruption via FSS_FSAS driver Santhosh Kumar K
2026-06-29 7:20 ` [PATCH v2 1/2] dt-bindings: memory: Add TI FSS_FSAS binding Santhosh Kumar K
2026-07-02 16:33 ` Rob Herring (Arm)
2026-07-08 11:07 ` Krzysztof Kozlowski
2026-06-29 7:20 ` [PATCH v2 2/2] memory: ti-k3-fsas: Add TI FSS_FSAS driver Santhosh Kumar K
2026-06-29 7:32 ` sashiko-bot
2026-07-08 11:09 ` Krzysztof Kozlowski [this message]
2026-06-30 7:13 ` [PATCH v2 0/2] Fix OSPI DMA corruption via " Krzysztof Kozlowski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cf5903d7-9ece-49f0-92a8-9f0dd2c27b01@kernel.org \
--to=krzk@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robh@kernel.org \
--cc=s-k6@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox