-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
i3c: mipi-i3c-hci: Add a quirk to set timing parameters
The AMD HCI controller is currently unstable at 12.5 MHz. To address this, a quirk is added to configure the clock rate to 9 MHz as a workaround, with proportional adjustments to the Open-Drain (OD) and Push-Pull (PP) values. Reviewed-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Co-developed-by: Guruvendra Punugupati <Guruvendra.Punugupati@amd.com> Signed-off-by: Guruvendra Punugupati <Guruvendra.Punugupati@amd.com> Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com> Link: https://lore.kernel.org/r/20240829091713.736217-6-Shyam-sundar.S-k@amd.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
- Loading branch information
Shyam Sundar S K
authored and
Alexandre Belloni
committed
Sep 5, 2024
1 parent
216201b
commit 46d4daa
Showing
4 changed files
with
42 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// SPDX-License-Identifier: GPL-2.0-or-later | ||
/* | ||
* I3C HCI Quirks | ||
* | ||
* Copyright 2024 Advanced Micro Devices, Inc. | ||
* | ||
* Authors: Shyam Sundar S K <Shyam-sundar.S-k@amd.com> | ||
* Guruvendra Punugupati <Guruvendra.Punugupati@amd.com> | ||
*/ | ||
|
||
#include <linux/i3c/master.h> | ||
#include "hci.h" | ||
|
||
/* Timing registers */ | ||
#define HCI_SCL_I3C_OD_TIMING 0x214 | ||
#define HCI_SCL_I3C_PP_TIMING 0x218 | ||
#define HCI_SDA_HOLD_SWITCH_DLY_TIMING 0x230 | ||
|
||
/* Timing values to configure 9MHz frequency */ | ||
#define AMD_SCL_I3C_OD_TIMING 0x00cf00cf | ||
#define AMD_SCL_I3C_PP_TIMING 0x00160016 | ||
|
||
void amd_set_od_pp_timing(struct i3c_hci *hci) | ||
{ | ||
u32 data; | ||
|
||
reg_write(HCI_SCL_I3C_OD_TIMING, AMD_SCL_I3C_OD_TIMING); | ||
reg_write(HCI_SCL_I3C_PP_TIMING, AMD_SCL_I3C_PP_TIMING); | ||
data = reg_read(HCI_SDA_HOLD_SWITCH_DLY_TIMING); | ||
/* Configure maximum TX hold time */ | ||
data |= W0_MASK(18, 16); | ||
reg_write(HCI_SDA_HOLD_SWITCH_DLY_TIMING, data); | ||
} |