mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: yy-Local-LLM via B4 Relay <devnull+yogo.0917.sabu.gmail.com@kernel.org>
To: linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org
Cc: Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	 Conor Dooley <conor+dt@kernel.org>,
	 Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	 Thomas Gleixner <tglx@kernel.org>, Radu Rendec <radu@rendec.net>,
	 Ulf Hansson <ulfh@kernel.org>,
	Daniel Lezcano <daniel.lezcano@kernel.org>,
	 Adrian Hunter <adrian.hunter@intel.com>,
	Jonathan Corbet <corbet@lwn.net>,
	 Shuah Khan <skhan@linuxfoundation.org>,
	 Randy Dunlap <rdunlap@infradead.org>,
	Russell King <linux@armlinux.org.uk>,
	 Arnd Bergmann <arnd@arndb.de>,
	 Alexandre Belloni <alexandre.belloni@bootlin.com>,
	 Linus Walleij <linusw@kernel.org>,
	Drew Fustini <fustini@kernel.org>,
	 linux-kernel@vger.kernel.org, linux-input@vger.kernel.org,
	 linux-mmc@vger.kernel.org, linux-doc@vger.kernel.org,
	soc@lists.linux.dev
Subject: [PATCH RFC 5/6] mmc: sdhci: add SiRF AT550 programmed-I/O support
Date: Tue, 17 Nov 2026 22:06:55 +0900	[thread overview]
Message-ID: <20261117-at550-rfc-v1-v1-5-5879573cb825@gmail.com> (raw)
In-Reply-To: <20261117-at550-rfc-v1-v1-0-5879573cb825@gmail.com>

From: yy-Local-LLM <yogo.0917.sabu@gmail.com>

Add a platform SDHCI host with PIO because CPU-to-controller DMA address
translation has not been validated. Reject unsupported
capability/version combinations and use the current managed host
allocation API. Board discovery and frequency restrictions are described
by the DT, rather than forcing removable-SD policy in the controller
driver.

Signed-off-by: yy-Local-LLM <yogo.0917.sabu@gmail.com>
---
 MAINTAINERS                    |  1 +
 drivers/mmc/host/Kconfig       | 10 +++++++
 drivers/mmc/host/Makefile      |  2 ++
 drivers/mmc/host/sdhci-at550.c | 62 ++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 75 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 441492230..347d46a20 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -25858,6 +25858,7 @@ F:	Documentation/devicetree/bindings/timer/sirf,at550-timer.yaml
 F:	drivers/clocksource/timer-at550.c
 F:	drivers/input/touchscreen/at550-ts.c
 F:	drivers/irqchip/irq-at550.c
+F:	drivers/mmc/host/sdhci-at550.c
 
 SIS 190 ETHERNET DRIVER
 M:	Francois Romieu <romieu@fr.zoreil.com>
diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig
index 79bfc425e..72e7c279a 100644
--- a/drivers/mmc/host/Kconfig
+++ b/drivers/mmc/host/Kconfig
@@ -1125,3 +1125,13 @@ config MMC_LITEX
 	  module will be called litex_mmc.
 
 	  If unsure, say N.
+
+config MMC_SDHCI_AT550
+	tristate "SiRF AT550 SDHCI host"
+	depends on MMC_SDHCI_PLTFM && OF
+	help
+	  Say Y to enable the AT550 removable SD host using programmed I/O.
+	  Firmware must configure the peripheral clock and pin multiplexing.
+	  DMA address translation is not supported by this initial driver.
+	  Card discovery and bus frequency are configured by the device tree.
+	  To build as a module, choose M; it will be called sdhci-at550.
diff --git a/drivers/mmc/host/Makefile b/drivers/mmc/host/Makefile
index fd043afab..6f7b0dd14 100644
--- a/drivers/mmc/host/Makefile
+++ b/drivers/mmc/host/Makefile
@@ -115,3 +115,5 @@ endif
 
 obj-$(CONFIG_MMC_SDHCI_XENON)	+= sdhci-xenon-driver.o
 sdhci-xenon-driver-y		+= sdhci-xenon.o sdhci-xenon-phy.o
+
+obj-$(CONFIG_MMC_SDHCI_AT550) += sdhci-at550.o
diff --git a/drivers/mmc/host/sdhci-at550.c b/drivers/mmc/host/sdhci-at550.c
new file mode 100644
index 000000000..100a0fdb2
--- /dev/null
+++ b/drivers/mmc/host/sdhci-at550.c
@@ -0,0 +1,62 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/* Standard SDHCI PIO only: do not assume CPU/PCI DMA address equivalence. */
+#include <linux/module.h>
+#include <linux/mmc/host.h>
+#include <linux/platform_device.h>
+#include "sdhci-pltfm.h"
+static const struct sdhci_ops at550_sdhci_ops = {
+	.set_clock = sdhci_set_clock,
+	.set_bus_width = sdhci_set_bus_width,
+	.reset = sdhci_reset,
+	.set_uhs_signaling = sdhci_set_uhs_signaling,
+};
+static const struct sdhci_pltfm_data at550_sdhci_data = {
+	.ops = &at550_sdhci_ops,
+	.quirks = SDHCI_QUIRK_BROKEN_DMA | SDHCI_QUIRK_BROKEN_ADMA,
+	.quirks2 = SDHCI_QUIRK2_NO_1_8_V,
+};
+static int at550_sdhci_probe(struct platform_device *pdev)
+{
+	struct sdhci_host *host;
+	u32 caps;
+	int ret;
+
+	host = sdhci_pltfm_init(pdev, &at550_sdhci_data, 0);
+	if (IS_ERR(host))
+		return PTR_ERR(host);
+	caps = sdhci_readl(host, SDHCI_CAPABILITIES);
+	if ((sdhci_readw(host, SDHCI_HOST_VERSION) & SDHCI_SPEC_VER_MASK) >
+	    SDHCI_SPEC_200 || !(caps & SDHCI_CLOCK_BASE_MASK)) {
+		ret = -ENODEV;
+		return ret;
+	}
+	ret = mmc_of_parse(host->mmc);
+	if (ret)
+		return ret;
+	sdhci_get_property(pdev);
+	ret = sdhci_add_host(host);
+	if (!ret)
+		return 0;
+	return ret;
+}
+static void at550_sdhci_remove(struct platform_device *pdev)
+{
+	sdhci_pltfm_remove(pdev);
+}
+static const struct of_device_id at550_sdhci_of_match[] = {
+	{ .compatible = "sirf,at550-sdhci" },
+	{ }
+};
+MODULE_DEVICE_TABLE(of, at550_sdhci_of_match);
+static struct platform_driver at550_sdhci_driver = {
+	.probe = at550_sdhci_probe,
+	.remove = at550_sdhci_remove,
+	.driver = {
+		.name = "sdhci-at550",
+		.of_match_table = at550_sdhci_of_match,
+		.pm = &sdhci_pltfm_pmops,
+	},
+};
+module_platform_driver(at550_sdhci_driver);
+MODULE_DESCRIPTION("SiRF AT550 SDHCI PIO host");
+MODULE_LICENSE("GPL");

-- 
2.56.0



  parent reply	other threads:[~2026-11-17 13:07 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-17 13:06 [PATCH RFC 0/6] SiRF AT550 / YPL514si initial RAM-boot platform support yy-Local-LLM via B4 Relay
2026-11-17 13:06 ` [PATCH RFC 1/6] dt-bindings: add SiRF AT550 and Yupiteru YPL514si descriptions yy-Local-LLM via B4 Relay
2026-11-17 13:06 ` [PATCH RFC 2/6] irqchip: add the SiRF AT550 interrupt controller yy-Local-LLM via B4 Relay
2026-11-17 13:06 ` [PATCH RFC 3/6] clocksource: add the SiRF AT550 counter and match timer yy-Local-LLM via B4 Relay
2026-11-17 13:06 ` [PATCH RFC 4/6] Input: add polled SiRF AT550 resistive touch support yy-Local-LLM via B4 Relay
2026-11-17 13:06 ` yy-Local-LLM via B4 Relay [this message]
2026-11-17 13:06 ` [PATCH RFC 6/6] ARM: add the SiRF AT550 platform and YPL514si board yy-Local-LLM via B4 Relay
2026-11-17 13:17   ` Arnd Bergmann

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=20261117-at550-rfc-v1-v1-5-5879573cb825@gmail.com \
    --to=devnull+yogo.0917.sabu.gmail.com@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=arnd@arndb.de \
    --cc=conor+dt@kernel.org \
    --cc=corbet@lwn.net \
    --cc=daniel.lezcano@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=fustini@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linusw@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=radu@rendec.net \
    --cc=rdunlap@infradead.org \
    --cc=robh@kernel.org \
    --cc=skhan@linuxfoundation.org \
    --cc=soc@lists.linux.dev \
    --cc=tglx@kernel.org \
    --cc=ulfh@kernel.org \
    --cc=yogo.0917.sabu@gmail.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

all inboxes | Powered by JetHome®