From: "Sascha Hauer" <s.hauer@pengutronix.de>
To: "Ahmad Fatoum" <a.fatoum@barebox.org>
Cc: barebox@lists.infradead.org, "Ahmad Fatoum" <a.fatoum@barebox.org>
Subject: Re: [PATCH v2 7/9] mci: add PCI SDHCI controller support
Date: Mon, 29 Jun 2026 08:47:43 +0000 [thread overview]
Message-ID: <E1we7eZ-00000005eQz-3Roc@pty.whiteo.stw.pengutronix.de> (raw)
In-Reply-To: <20260626162136.1885999-7-a.fatoum@barebox.org>
On 2026-06-26 18:19, Ahmad Fatoum wrote:
> QEMU can expose eMMC through the class-compliant sdhci-pci device, but
> barebox only had platform SDHCI glue. Add a PCI host driver that maps BAR0,
> enables bus mastering, initializes the SDHCI core and registers an MCI host.
>
> This is intentionally small and PIO-based, which is enough for the QEMU RPMB
> test environment while reusing the common SDHCI helpers.
Is this comment wrong? The driver depends on HAS_DMA and even calls
sdhci_setup_adma().
>
> Assisted-by: Codex:gpt-5.5
> Signed-off-by: Ahmad Fatoum <a.fatoum@barebox.org>
> ---
> v1 -> v2:
> - new commit
> ---
> drivers/mci/Kconfig | 8 ++
> drivers/mci/Makefile | 1 +
> drivers/mci/mci-core.c | 2 +-
> drivers/mci/sdhci-pci.c | 203 ++++++++++++++++++++++++++++++++++++++++
> 4 files changed, 213 insertions(+), 1 deletion(-)
> create mode 100644 drivers/mci/sdhci-pci.c
>
> diff --git a/drivers/mci/Kconfig b/drivers/mci/Kconfig
> index b38f7a3bdf8b..55e63aad92d4 100644
> --- a/drivers/mci/Kconfig
> +++ b/drivers/mci/Kconfig
> @@ -90,6 +90,14 @@ config MCI_MMC_RPMB
>
> comment "--- MCI host drivers ---"
>
> +config MCI_SDHCI_PCI
> + bool "PCI SDHCI controller"
> + depends on PCI && HAS_DMA
> + select MCI_SDHCI
> + help
> + Enable support for PCI-attached SDHCI controllers, such as QEMU's
> + sdhci-pci device used to attach emulated eMMC devices.
> +
> config MCI_DWC_MSHC
> bool "Synopsys DesignWare Cores MSHC"
> depends on HAS_DMA
> diff --git a/drivers/mci/Makefile b/drivers/mci/Makefile
> index 67a1f7bf1724..761f4187c079 100644
> --- a/drivers/mci/Makefile
> +++ b/drivers/mci/Makefile
> @@ -2,6 +2,7 @@
> obj-$(CONFIG_MCI) += mci-core.o
> pbl-$(CONFIG_MCI) += mci-pbl.o
> obj-$(CONFIG_MCI_MMC_RPMB) += rpmb.o
> +obj-$(CONFIG_MCI_SDHCI_PCI) += sdhci-pci.o
> obj-$(CONFIG_MCI_AM654) += am654-sdhci.o
> obj-$(CONFIG_MCI_ARASAN) += arasan-sdhci.o
> obj-$(CONFIG_MCI_ATMEL) += atmel_mci.o atmel_mci_common.o
> diff --git a/drivers/mci/mci-core.c b/drivers/mci/mci-core.c
> index 4413fd1655aa..d6746fbec28f 100644
> --- a/drivers/mci/mci-core.c
> +++ b/drivers/mci/mci-core.c
> @@ -2942,7 +2942,7 @@ static struct device_node *mci_get_partition_node(struct device_node *hwnode,
> struct device_node *np;
> char partnodename[sizeof("bootx-partitions")];
>
> - if (index > 8)
> + if (!hwnode || index > 8)
> return NULL;
Should this be an extra patch?
Sascha
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
next prev parent reply other threads:[~2026-06-29 8:49 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-26 16:19 [PATCH v2 1/9] scripts: duplicate conftest.py as qemu_interactive.py Ahmad Fatoum
2026-06-26 16:19 ` [PATCH v2 2/9] test: move interactive QEMU launcher out of pytest Ahmad Fatoum
2026-06-26 16:19 ` [PATCH v2 3/9] usb: xhci-hcd: add XHCI over PCI driver Ahmad Fatoum
2026-06-26 16:19 ` [PATCH v2 4/9] scripts: qemu_interactive.py: add new --usbblk option Ahmad Fatoum
2026-06-26 16:19 ` [PATCH v2 5/9] scripts: qemu_interactive.py: add new --nvmeblk option Ahmad Fatoum
2026-06-26 16:19 ` [PATCH v2 6/9] mci: sdhci: define same SDHCI_INT_* constants as Linux Ahmad Fatoum
2026-06-26 16:19 ` [PATCH v2 7/9] mci: add PCI SDHCI controller support Ahmad Fatoum
2026-06-29 8:47 ` Sascha Hauer [this message]
2026-06-29 8:51 ` Ahmad Fatoum
2026-06-29 9:04 ` Sascha Hauer
2026-06-29 9:05 ` Ahmad Fatoum
2026-06-29 9:09 ` Sascha Hauer
2026-06-26 16:19 ` [PATCH v2 8/9] ARM: multi_v8_defconfig: enable OP-TEE and RPMB support Ahmad Fatoum
2026-06-26 16:19 ` [PATCH v2 9/9] scripts: qemu_interactive.py: add new --sdblk and --emmcblk options Ahmad Fatoum
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=E1we7eZ-00000005eQz-3Roc@pty.whiteo.stw.pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=a.fatoum@barebox.org \
--cc=barebox@lists.infradead.org \
/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