Skip to content

Commit 51acc19

Browse files
Kartik Rajputnvidia-bfigg
authored andcommitted
NVIDIA: VR: SAUCE: i2c: tegra: Add support for Tegra410
BugLink: https://bugs.launchpad.net/bugs/2138238 Add support for the Tegra410 SoC, which has 4 I2C controllers. The controllers are feature-equivalent to Tegra264; only the register offsets differ. Signed-off-by: Kartik Rajput <kkartik@nvidia.com> (backported from https://lore.kernel.org/all/20260107142649.14917-1-kkartik@nvidia.com/) Signed-off-by: Matthew R. Ochs <mochs@nvidia.com> Acked-by: Carol L Soto <csoto@nvidia.com> Acked-by: Jamie Nguyen <jamien@nvidia.com> Acked-by: Nirmoy Das <nirmoyd@nvidia.com> Acked-by: Abdur Rahman <abdur.rahman@canonical.com> Acked-by: Noah Wager <noah.wager@canonical.com> Signed-off-by: Brad Figg <bfigg@nvidia.com>
1 parent 8c067c6 commit 51acc19

File tree

1 file changed

+64
-0
lines changed

1 file changed

+64
-0
lines changed

drivers/i2c/busses/i2c-tegra.c

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,35 @@ static const struct tegra_i2c_regs tegra264_i2c_regs = {
280280
.sw_mutex = 0x0ec,
281281
};
282282

283+
static const struct tegra_i2c_regs tegra410_i2c_regs = {
284+
.cnfg = 0x000,
285+
.status = 0x01c,
286+
.sl_cnfg = 0x020,
287+
.sl_addr1 = 0x02c,
288+
.sl_addr2 = 0x030,
289+
.tlow_sext = 0x034,
290+
.tx_fifo = 0x054,
291+
.rx_fifo = 0x058,
292+
.packet_transfer_status = 0x05c,
293+
.fifo_control = 0x060,
294+
.fifo_status = 0x064,
295+
.int_mask = 0x068,
296+
.int_status = 0x06c,
297+
.clk_divisor = 0x070,
298+
.bus_clear_cnfg = 0x088,
299+
.bus_clear_status = 0x08c,
300+
.config_load = 0x090,
301+
.clken_override = 0x094,
302+
.interface_timing_0 = 0x098,
303+
.interface_timing_1 = 0x09c,
304+
.hs_interface_timing_0 = 0x0a0,
305+
.hs_interface_timing_1 = 0x0a4,
306+
.master_reset_cntrl = 0x0ac,
307+
.mst_fifo_control = 0x0b8,
308+
.mst_fifo_status = 0x0bc,
309+
.sw_mutex = 0x0f0,
310+
};
311+
283312
/*
284313
* msg_end_type: The bus control which needs to be sent at end of transfer.
285314
* @MSG_END_STOP: Send stop pulse.
@@ -2081,6 +2110,40 @@ static const struct tegra_i2c_hw_feature tegra264_i2c_hw = {
20812110
.regs = &tegra264_i2c_regs,
20822111
};
20832112

2113+
static const struct tegra_i2c_hw_feature tegra410_i2c_hw = {
2114+
.has_continue_xfer_support = true,
2115+
.has_per_pkt_xfer_complete_irq = true,
2116+
.clk_divisor_hs_mode = 1,
2117+
.clk_divisor_std_mode = 0x3f,
2118+
.clk_divisor_fast_mode = 0x2c,
2119+
.clk_divisor_fast_plus_mode = 0x11,
2120+
.has_config_load_reg = true,
2121+
.has_multi_master_mode = true,
2122+
.has_slcg_override_reg = true,
2123+
.has_mst_fifo = true,
2124+
.has_mst_reset = true,
2125+
.quirks = &tegra194_i2c_quirks,
2126+
.supports_bus_clear = true,
2127+
.has_apb_dma = false,
2128+
.tlow_std_mode = 0x8,
2129+
.thigh_std_mode = 0x7,
2130+
.tlow_fast_mode = 0x2,
2131+
.thigh_fast_mode = 0x2,
2132+
.tlow_fastplus_mode = 0x2,
2133+
.thigh_fastplus_mode = 0x2,
2134+
.tlow_hs_mode = 0x8,
2135+
.thigh_hs_mode = 0x6,
2136+
.setup_hold_time_std_mode = 0x08080808,
2137+
.setup_hold_time_fast_mode = 0x02020202,
2138+
.setup_hold_time_fastplus_mode = 0x02020202,
2139+
.setup_hold_time_hs_mode = 0x0b0b0b,
2140+
.has_interface_timing_reg = true,
2141+
.enable_hs_mode_support = true,
2142+
.has_mutex = true,
2143+
.variant = TEGRA_I2C_VARIANT_DEFAULT,
2144+
.regs = &tegra410_i2c_regs,
2145+
};
2146+
20842147
static const struct of_device_id tegra_i2c_of_match[] = {
20852148
{ .compatible = "nvidia,tegra264-i2c", .data = &tegra264_i2c_hw, },
20862149
{ .compatible = "nvidia,tegra256-i2c", .data = &tegra256_i2c_hw, },
@@ -2391,6 +2454,7 @@ static const struct acpi_device_id tegra_i2c_acpi_match[] = {
23912454
{.id = "NVDA0101", .driver_data = (kernel_ulong_t)&tegra210_i2c_hw},
23922455
{.id = "NVDA0201", .driver_data = (kernel_ulong_t)&tegra186_i2c_hw},
23932456
{.id = "NVDA0301", .driver_data = (kernel_ulong_t)&tegra194_i2c_hw},
2457+
{.id = "NVDA2017", .driver_data = (kernel_ulong_t)&tegra410_i2c_hw},
23942458
{ }
23952459
};
23962460
MODULE_DEVICE_TABLE(acpi, tegra_i2c_acpi_match);

0 commit comments

Comments
 (0)