Skip to content

Commit 0140893

Browse files
Shyam Sundar S Kalexandrebelloni
authored andcommitted
i3c: mipi-i3c-hci: Add a quirk to set PIO mode
The AMD HCI controller currently only supports PIO mode but exposes DMA rings to the OS, which leads to the controller being configured in DMA mode. To address this, add a quirk to avoid configuring the controller in DMA mode and default to PIO mode. Additionally, introduce a generic quirk infrastructure to the mipi-i3c-hci driver to facilitate seamless future quirk additions. Reviewed-by: Jarkko Nikula <[email protected]> Co-developed-by: Krishnamoorthi M <[email protected]> Signed-off-by: Krishnamoorthi M <[email protected]> Co-developed-by: Guruvendra Punugupati <[email protected]> Signed-off-by: Guruvendra Punugupati <[email protected]> Signed-off-by: Shyam Sundar S K <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
1 parent 039b236 commit 0140893

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

drivers/i3c/master/mipi-i3c-hci/core.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -756,6 +756,10 @@ static int i3c_hci_init(struct i3c_hci *hci)
756756
mode_selector = hci->version_major > 1 ||
757757
(hci->version_major == 1 && hci->version_minor > 0);
758758

759+
/* Quirk for HCI_QUIRK_PIO_MODE on AMD platforms */
760+
if (hci->quirks & HCI_QUIRK_PIO_MODE)
761+
hci->RHS_regs = NULL;
762+
759763
/* Try activating DMA operations first */
760764
if (hci->RHS_regs) {
761765
reg_clear(HC_CONTROL, HC_CONTROL_PIO_MODE);
@@ -806,6 +810,8 @@ static int i3c_hci_probe(struct platform_device *pdev)
806810
/* temporary for dev_printk's, to be replaced in i3c_master_register */
807811
hci->master.dev.init_name = dev_name(&pdev->dev);
808812

813+
hci->quirks = (unsigned long)device_get_match_data(&pdev->dev);
814+
809815
ret = i3c_hci_init(hci);
810816
if (ret)
811817
return ret;
@@ -838,7 +844,7 @@ static const __maybe_unused struct of_device_id i3c_hci_of_match[] = {
838844
MODULE_DEVICE_TABLE(of, i3c_hci_of_match);
839845

840846
static const struct acpi_device_id i3c_hci_acpi_match[] = {
841-
{ "AMDI5017" },
847+
{ "AMDI5017", HCI_QUIRK_PIO_MODE },
842848
{}
843849
};
844850
MODULE_DEVICE_TABLE(acpi, i3c_hci_acpi_match);

drivers/i3c/master/mipi-i3c-hci/hci.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ struct i3c_hci_dev_data {
135135

136136
/* list of quirks */
137137
#define HCI_QUIRK_RAW_CCC BIT(1) /* CCC framing must be explicit */
138+
#define HCI_QUIRK_PIO_MODE BIT(2) /* Set PIO mode for AMD platforms */
138139

139140

140141
/* global functions */

0 commit comments

Comments
 (0)