[PATCH v4 3/6] i3c: mipi-i3c-hci: Add a quirk to set PIO mode
Jarkko Nikula
jarkko.nikula at linux.intel.com
Fri Aug 23 03:10:13 PDT 2024
On 8/21/24 4:35 PM, Shyam Sundar S K wrote:
> 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.
>
> Co-developed-by: Krishnamoorthi M <krishnamoorthi.m at amd.com>
> Signed-off-by: Krishnamoorthi M <krishnamoorthi.m at amd.com>
> Co-developed-by: Guruvendra Punugupati <Guruvendra.Punugupati at amd.com>
> Signed-off-by: Guruvendra Punugupati <Guruvendra.Punugupati at amd.com>
> Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k at amd.com>
> ---
> drivers/i3c/master/mipi-i3c-hci/core.c | 9 ++++++++-
> drivers/i3c/master/mipi-i3c-hci/hci.h | 1 +
> 2 files changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/i3c/master/mipi-i3c-hci/core.c b/drivers/i3c/master/mipi-i3c-hci/core.c
> index d1952a5619d4..3aa4aa9deb56 100644
> --- a/drivers/i3c/master/mipi-i3c-hci/core.c
> +++ b/drivers/i3c/master/mipi-i3c-hci/core.c
> @@ -754,6 +754,11 @@ static int i3c_hci_init(struct i3c_hci *hci)
> return -EINVAL;
> }
>
> + /* Quirk for HCI_QUIRK_PIO_MODE on AMD platforms */
> + regval = reg_read(HCI_VERSION);
> + if (hci->quirks & HCI_QUIRK_PIO_MODE)
> + hci->RHS_regs = NULL;
> +
> /* Try activating DMA operations first */
> if (hci->RHS_regs) {
> reg_clear(HC_CONTROL, HC_CONTROL_PIO_MODE);
This looks otherwise ok to me but with "regval = reg_read(HCI_VERSION);"
removed. I commented that in the patch 2/6.
More information about the linux-i3c
mailing list