linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/1] rpi: enable SD/Wifi on ACPI firmware
@ 2021-01-20  0:04 Jeremy Linton
  2021-01-20  0:04 ` [PATCH v2] mmc: sdhci-iproc: Add ACPI bindings for the rpi Jeremy Linton
  0 siblings, 1 reply; 4+ messages in thread
From: Jeremy Linton @ 2021-01-20  0:04 UTC (permalink / raw)
  To: linux-mmc
  Cc: adrian.hunter, ulf.hansson, rjui, sbranden,
	bcm-kernel-feedback-list, linux-arm-kernel, linux-kernel,
	f.fainelli, stefan.wahren, nsaenzjulienne, ardb, Jeremy Linton

The rpi4 can be booted on Linux using ACPI, this set
adds the ACPI bindings to allow it to utilize the Arasan
and eMMC2 controllers.

v1->v2: Fix a build warning when !ACPI
        Some comment/change log tweaks

Jeremy Linton (1):
  mmc: sdhci-iproc: Add ACPI bindings for the rpi

 drivers/mmc/host/sdhci-iproc.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

-- 
2.26.2


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v2] mmc: sdhci-iproc: Add ACPI bindings for the rpi
  2021-01-20  0:04 [PATCH v2 0/1] rpi: enable SD/Wifi on ACPI firmware Jeremy Linton
@ 2021-01-20  0:04 ` Jeremy Linton
  2021-01-20  0:09   ` Florian Fainelli
  2021-01-20 14:08   ` Ulf Hansson
  0 siblings, 2 replies; 4+ messages in thread
From: Jeremy Linton @ 2021-01-20  0:04 UTC (permalink / raw)
  To: linux-mmc
  Cc: adrian.hunter, ulf.hansson, rjui, sbranden,
	bcm-kernel-feedback-list, linux-arm-kernel, linux-kernel,
	f.fainelli, stefan.wahren, nsaenzjulienne, ardb, Jeremy Linton

The RPi4 has an Arasan controller it carries over
from the RPi3 and a newer eMMC2 controller.
Because of a couple of quirks, it seems wiser to bind
these controllers to the same driver that DT is using
on this platform rather than the generic sdhci_acpi
driver with PNP0D40.

So, BCM2847 describes the older Arasan and
BRCME88C describes the newer eMMC2. The older
Arasan is reusing an existing ACPI _HID used
by other OSs booting these tables on the RPi.

With this change, Linux is capable of utilizing the
SD card slot, and the wifi when booted with
UEFI+ACPI on the rpi4.

Signed-off-by: Jeremy Linton <jeremy.linton@arm.com>
---
 drivers/mmc/host/sdhci-iproc.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/drivers/mmc/host/sdhci-iproc.c b/drivers/mmc/host/sdhci-iproc.c
index c9434b461aab..ddeaf8e1f72f 100644
--- a/drivers/mmc/host/sdhci-iproc.c
+++ b/drivers/mmc/host/sdhci-iproc.c
@@ -296,9 +296,27 @@ static const struct of_device_id sdhci_iproc_of_match[] = {
 MODULE_DEVICE_TABLE(of, sdhci_iproc_of_match);
 
 #ifdef CONFIG_ACPI
+/*
+ * This is a duplicate of bcm2835_(pltfrm_)data without caps quirks
+ * which are provided by the ACPI table.
+ */
+static const struct sdhci_pltfm_data sdhci_bcm_arasan_data = {
+	.quirks = SDHCI_QUIRK_BROKEN_CARD_DETECTION |
+		  SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK |
+		  SDHCI_QUIRK_NO_HISPD_BIT,
+	.quirks2 = SDHCI_QUIRK2_PRESET_VALUE_BROKEN,
+	.ops = &sdhci_iproc_32only_ops,
+};
+
+static const struct sdhci_iproc_data bcm_arasan_data = {
+	.pdata = &sdhci_bcm_arasan_data,
+};
+
 static const struct acpi_device_id sdhci_iproc_acpi_ids[] = {
 	{ .id = "BRCM5871", .driver_data = (kernel_ulong_t)&iproc_cygnus_data },
 	{ .id = "BRCM5872", .driver_data = (kernel_ulong_t)&iproc_data },
+	{ .id = "BCM2847",  .driver_data = (kernel_ulong_t)&bcm_arasan_data },
+	{ .id = "BRCME88C", .driver_data = (kernel_ulong_t)&bcm2711_data },
 	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(acpi, sdhci_iproc_acpi_ids);
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] mmc: sdhci-iproc: Add ACPI bindings for the rpi
  2021-01-20  0:04 ` [PATCH v2] mmc: sdhci-iproc: Add ACPI bindings for the rpi Jeremy Linton
@ 2021-01-20  0:09   ` Florian Fainelli
  2021-01-20 14:08   ` Ulf Hansson
  1 sibling, 0 replies; 4+ messages in thread
From: Florian Fainelli @ 2021-01-20  0:09 UTC (permalink / raw)
  To: Jeremy Linton, linux-mmc
  Cc: adrian.hunter, ulf.hansson, rjui, sbranden,
	bcm-kernel-feedback-list, linux-arm-kernel, linux-kernel,
	f.fainelli, stefan.wahren, nsaenzjulienne, ardb



On 1/19/2021 4:04 PM, Jeremy Linton wrote:
> The RPi4 has an Arasan controller it carries over
> from the RPi3 and a newer eMMC2 controller.
> Because of a couple of quirks, it seems wiser to bind
> these controllers to the same driver that DT is using
> on this platform rather than the generic sdhci_acpi
> driver with PNP0D40.
> 
> So, BCM2847 describes the older Arasan and
> BRCME88C describes the newer eMMC2. The older
> Arasan is reusing an existing ACPI _HID used
> by other OSs booting these tables on the RPi.
> 
> With this change, Linux is capable of utilizing the
> SD card slot, and the wifi when booted with
> UEFI+ACPI on the rpi4.

This is uber nit picking, but can you try to be consistent in how you
capitalize words throughout your commit subject and use common writing
such as: RPi, Wi-Fi, OSes.

> 
> Signed-off-by: Jeremy Linton <jeremy.linton@arm.com>

Acked-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] mmc: sdhci-iproc: Add ACPI bindings for the rpi
  2021-01-20  0:04 ` [PATCH v2] mmc: sdhci-iproc: Add ACPI bindings for the rpi Jeremy Linton
  2021-01-20  0:09   ` Florian Fainelli
@ 2021-01-20 14:08   ` Ulf Hansson
  1 sibling, 0 replies; 4+ messages in thread
From: Ulf Hansson @ 2021-01-20 14:08 UTC (permalink / raw)
  To: Jeremy Linton
  Cc: linux-mmc, Adrian Hunter, Ray Jui, Scott Branden,
	BCM Kernel Feedback, Linux ARM, Linux Kernel Mailing List,
	Florian Fainelli, Stefan Wahren, Nicolas Saenz Julienne, ardb

On Wed, 20 Jan 2021 at 01:04, Jeremy Linton <jeremy.linton@arm.com> wrote:
>
> The RPi4 has an Arasan controller it carries over
> from the RPi3 and a newer eMMC2 controller.
> Because of a couple of quirks, it seems wiser to bind
> these controllers to the same driver that DT is using
> on this platform rather than the generic sdhci_acpi
> driver with PNP0D40.
>
> So, BCM2847 describes the older Arasan and
> BRCME88C describes the newer eMMC2. The older
> Arasan is reusing an existing ACPI _HID used
> by other OSs booting these tables on the RPi.
>
> With this change, Linux is capable of utilizing the
> SD card slot, and the wifi when booted with
> UEFI+ACPI on the rpi4.
>
> Signed-off-by: Jeremy Linton <jeremy.linton@arm.com>

Applied for next (and by updating the commit message according to the
nitpick comment from Florian), thanks!

Kind regards
Uffe


> ---
>  drivers/mmc/host/sdhci-iproc.c | 18 ++++++++++++++++++
>  1 file changed, 18 insertions(+)
>
> diff --git a/drivers/mmc/host/sdhci-iproc.c b/drivers/mmc/host/sdhci-iproc.c
> index c9434b461aab..ddeaf8e1f72f 100644
> --- a/drivers/mmc/host/sdhci-iproc.c
> +++ b/drivers/mmc/host/sdhci-iproc.c
> @@ -296,9 +296,27 @@ static const struct of_device_id sdhci_iproc_of_match[] = {
>  MODULE_DEVICE_TABLE(of, sdhci_iproc_of_match);
>
>  #ifdef CONFIG_ACPI
> +/*
> + * This is a duplicate of bcm2835_(pltfrm_)data without caps quirks
> + * which are provided by the ACPI table.
> + */
> +static const struct sdhci_pltfm_data sdhci_bcm_arasan_data = {
> +       .quirks = SDHCI_QUIRK_BROKEN_CARD_DETECTION |
> +                 SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK |
> +                 SDHCI_QUIRK_NO_HISPD_BIT,
> +       .quirks2 = SDHCI_QUIRK2_PRESET_VALUE_BROKEN,
> +       .ops = &sdhci_iproc_32only_ops,
> +};
> +
> +static const struct sdhci_iproc_data bcm_arasan_data = {
> +       .pdata = &sdhci_bcm_arasan_data,
> +};
> +
>  static const struct acpi_device_id sdhci_iproc_acpi_ids[] = {
>         { .id = "BRCM5871", .driver_data = (kernel_ulong_t)&iproc_cygnus_data },
>         { .id = "BRCM5872", .driver_data = (kernel_ulong_t)&iproc_data },
> +       { .id = "BCM2847",  .driver_data = (kernel_ulong_t)&bcm_arasan_data },
> +       { .id = "BRCME88C", .driver_data = (kernel_ulong_t)&bcm2711_data },
>         { /* sentinel */ }
>  };
>  MODULE_DEVICE_TABLE(acpi, sdhci_iproc_acpi_ids);
> --
> 2.26.2
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-01-20 14:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-20  0:04 [PATCH v2 0/1] rpi: enable SD/Wifi on ACPI firmware Jeremy Linton
2021-01-20  0:04 ` [PATCH v2] mmc: sdhci-iproc: Add ACPI bindings for the rpi Jeremy Linton
2021-01-20  0:09   ` Florian Fainelli
2021-01-20 14:08   ` Ulf Hansson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).