Skip to contentSkip to conversation

i2c: tegra: Add Tegra256 I2C controller support

PATCH RESEND Applied Akhil R 4 participants 13 messages Aug 18, 2025 – Oct 8, 2025

Subsystems (4)
lore
Share & tools
lore

Akhil R

author
#0 lore raw

cover i2c: tegra: Add Tegra256 I2C controller support

This series adds support for Tegra256 I2C controllers to the Tegra I2C driver.

Tegra256 consists of 8 generic I2C controllers similar to previous Tegra generations, but with a different parent clock frequency requiring adjusted timing parameters.

The changes add the "nvidia,tegra256-i2c" compatible string to device tree bindings and implement the corresponding hardware feature structure with appropriate timing parameters and clock divisors.

Akhil R (2):
dt-bindings: i2c: nvidia,tegra20-i2c: Add Tegra256 I2C
i2c: tegra: Add Tegra256 support

 .../bindings/i2c/nvidia,tegra20-i2c.yaml      |  6 +++++
 drivers/i2c/busses/i2c-tegra.c                | 26 +++++++++++++++++++
 2 files changed, 32 insertions(+)
Signature · 1 line
2.50.1
author
#1 lore raw

PATCH RESEND 1/2 dt-bindings: i2c: nvidia,tegra20-i2c: Add Tegra256 I2C compatible

Add compatible for Tegra256 I2C controllers. Tegra256 consists of 8 generic Tegra I2C controllers similar to previous generations. The parent clock frequency is different in these controllers and hence the timing parameter values are different from the previous ones.

---
 .../devicetree/bindings/i2c/nvidia,tegra20-i2c.yaml         | 6 ++++++
 1 file changed, 6 insertions(+)
Documentation/devicetree/bindings/i2c/nvidia,tegra20-i2c.yaml +6 -0
index 6b6f6762d122..6f58eb79a7b3 100644
@@ -80,6 +80,11 @@ properties:
           support for 64 KiB transactions whereas earlier chips supported no
           more than 4 KiB per transactions.
         const: nvidia,tegra194-i2c
+      - description: |
+          Tegra256 has 8 generic I2C controllers. The controllers are similar to
+          the previous generations, but have a different parent clock and hence
+          the timing parameters are configured differently.
+        const: nvidia,tegra256-i2c
 
   reg:
     maxItems: 1
@@ -186,6 +191,7 @@ allOf:
             contains:
               enum:
                 - nvidia,tegra194-i2c
+                - nvidia,tegra256-i2c
     then:
       required:
         - resets
Signature · 1 line
2.50.1
Applied
#2 lore raw

Re: [PATCH RESEND 1/2] dt-bindings: i2c: nvidia,tegra20-i2c: Add Tegra256 I2C compatible

Quoted 10 lines · Akhil R

Add compatible for Tegra256 I2C controllers. Tegra256 consists of 8 generic Tegra I2C controllers similar to previous generations. The parent clock frequency is different in these controllers and hence the timing parameter values are different from the previous ones.

Applied to for-next, thanks!

author
#3 lore raw

PATCH RESEND 2/2 i2c: tegra: Add Tegra256 support

In reply to Akhil R

Add compatible and the hardware struct for Tegra256. Tegra256 controllers use a different parent clock. Hence the timing parameters are different from the previous generations to meet the expected frequencies.

---
 drivers/i2c/busses/i2c-tegra.c | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
drivers/i2c/busses/i2c-tegra.c +26 -0
index 4eb31b913c1a..e533460bccc3 100644
@@ -1649,7 +1649,33 @@ static const struct tegra_i2c_hw_feature tegra194_i2c_hw = {
 	.has_interface_timing_reg = true,
 };
 
+static const struct tegra_i2c_hw_feature tegra256_i2c_hw = {
+	.has_continue_xfer_support = true,
+	.has_per_pkt_xfer_complete_irq = true,
+	.clk_divisor_hs_mode = 7,
+	.clk_divisor_std_mode = 0x7a,
+	.clk_divisor_fast_mode = 0x40,
+	.clk_divisor_fast_plus_mode = 0x19,
+	.has_config_load_reg = true,
+	.has_multi_master_mode = true,
+	.has_slcg_override_reg = true,
+	.has_mst_fifo = true,
+	.has_mst_reset = true,
+	.quirks = &tegra194_i2c_quirks,
+	.supports_bus_clear = true,
+	.has_apb_dma = false,
+	.tlow_std_mode = 0x8,
+	.thigh_std_mode = 0x7,
+	.tlow_fast_fastplus_mode = 0x3,
+	.thigh_fast_fastplus_mode = 0x3,
+	.setup_hold_time_std_mode = 0x08080808,
+	.setup_hold_time_fast_fast_plus_mode = 0x02020202,
+	.setup_hold_time_hs_mode = 0x090909,
+	.has_interface_timing_reg = true,
+};
+
 static const struct of_device_id tegra_i2c_of_match[] = {
+	{ .compatible = "nvidia,tegra256-i2c", .data = &tegra256_i2c_hw, },
 	{ .compatible = "nvidia,tegra194-i2c", .data = &tegra194_i2c_hw, },
 	{ .compatible = "nvidia,tegra186-i2c", .data = &tegra186_i2c_hw, },
 #if IS_ENABLED(CONFIG_ARCH_TEGRA_210_SOC)
Signature · 1 line
2.50.1
Applied
#4 lore raw

Re: [PATCH RESEND 2/2] i2c: tegra: Add Tegra256 support

Quoted 7 lines · Akhil R

Add compatible and the hardware struct for Tegra256. Tegra256 controllers use a different parent clock. Hence the timing parameters are different from the previous generations to meet the expected frequencies.

Applied to for-next, thanks!

maintainer
#5 lore raw

Re: [PATCH RESEND 2/2] i2c: tegra: Add Tegra256 support

In reply to Akhil R

Hi Akhil,

Quoted 16 lines · Akhil R

Add compatible and the hardware struct for Tegra256. Tegra256 controllers use a different parent clock. Hence the timing parameters are different from the previous generations to meet the expected frequencies.

---
  drivers/i2c/busses/i2c-tegra.c | 26 ++++++++++++++++++++++++++
  1 file changed, 26 insertions(+)
drivers/i2c/busses/i2c-tegra.c +0 -0
index 4eb31b913c1a..e533460bccc3 100644

drivers/i2c/busses/i2c-tegra.c static const struct tegra_i2c_hw_feature tegra194_i2c_hw = { · line 1658

Quoted 10 lines
drivers/i2c/busses/i2c-tegra.c +7 -0
@@ -1649,7 +1649,33 @@ static const struct tegra_i2c_hw_feature tegra194_i2c_hw = {
  	.has_interface_timing_reg = true,
  };
 
+static const struct tegra_i2c_hw_feature tegra256_i2c_hw = {
+	.has_continue_xfer_support = true,
+	.has_per_pkt_xfer_complete_irq = true,
+	.clk_divisor_hs_mode = 7,
+	.clk_divisor_std_mode = 0x7a,
+	.clk_divisor_fast_mode = 0x40,
+	.clk_divisor_fast_plus_mode = 0x19,

Can you check this divisor value? I see we have been using a value of 0x14 for this which does not align with what we have here. Can you confirm if this should be 0x19 or 0x14?

Thanks
Jon

Signature · 1 line
nvpublic
author
#6 lore raw

Re: [PATCH RESEND 2/2] i2c: tegra: Add Tegra256 support

Hi Jon,

Quoted 20 lines · Jon Hunter
Quoted 19 lines · Akhil R

Add compatible and the hardware struct for Tegra256. Tegra256 controllers use a different parent clock. Hence the timing parameters are different from the previous generations to meet the expected frequencies.

---
  drivers/i2c/busses/i2c-tegra.c | 26 ++++++++++++++++++++++++++
  1 file changed, 26 insertions(+)
drivers/i2c/busses/i2c-tegra.c +0 -0
index 4eb31b913c1a..e533460bccc3 100644
@@ -1649,7 +1649,33 @@ static const struct tegra_i2c_hw_feature tegra194_i2c_hw = {
       .has_interface_timing_reg = true,
  };
 
Quoted 12 lines

drivers/i2c/busses/i2c-tegra.c static const struct tegra_i2c_hw_feature tegra194_i2c_hw = { · line 1658

Quoted 7 lines
drivers/i2c/busses/i2c-tegra.c +7 -0
+static const struct tegra_i2c_hw_feature tegra256_i2c_hw = {
+     .has_continue_xfer_support = true,
+     .has_per_pkt_xfer_complete_irq = true,
+     .clk_divisor_hs_mode = 7,
+     .clk_divisor_std_mode = 0x7a,
+     .clk_divisor_fast_mode = 0x40,
+     .clk_divisor_fast_plus_mode = 0x19,

Can you check this divisor value? I see we have been using a value of 0x14 for this which does not align with what we have here. Can you confirm if this should be 0x19 or 0x14?

If you happen to notice, we are using a different tlow, thigh and hold time values as well internally. We are also using separate variables (tlow, thigh) for fast and fastplus modes, whereas this driver currently uses the same variable (and value) for both fast and fastplus mode. With that limitation, these are the closest timing values we can use now to get the required frequency.

I am preparing the patches for the above changes and to align with the internally used values. But I would probably wait for Kartik's patches to conclude before sending this out, so as to reduce any conflicts.

Regards,
Akhil

maintainer
#7 lore raw

Re: [PATCH RESEND 2/2] i2c: tegra: Add Tegra256 support

Hi Akhil,

Quoted 36 lines · Akhil R

Hi Jon,

Quoted 20 lines · Jon Hunter
Quoted 19 lines · Akhil R

Add compatible and the hardware struct for Tegra256. Tegra256 controllers use a different parent clock. Hence the timing parameters are different from the previous generations to meet the expected frequencies.

---
   drivers/i2c/busses/i2c-tegra.c | 26 ++++++++++++++++++++++++++
   1 file changed, 26 insertions(+)
drivers/i2c/busses/i2c-tegra.c +0 -0
index 4eb31b913c1a..e533460bccc3 100644
@@ -1649,7 +1649,33 @@ static const struct tegra_i2c_hw_feature tegra194_i2c_hw = {
        .has_interface_timing_reg = true,
   };
 
Quoted 12 lines

drivers/i2c/busses/i2c-tegra.c static const struct tegra_i2c_hw_feature tegra194_i2c_hw = { · line 1658

Quoted 7 lines
drivers/i2c/busses/i2c-tegra.c +7 -0
+static const struct tegra_i2c_hw_feature tegra256_i2c_hw = {
+     .has_continue_xfer_support = true,
+     .has_per_pkt_xfer_complete_irq = true,
+     .clk_divisor_hs_mode = 7,
+     .clk_divisor_std_mode = 0x7a,
+     .clk_divisor_fast_mode = 0x40,
+     .clk_divisor_fast_plus_mode = 0x19,

Can you check this divisor value? I see we have been using a value of 0x14 for this which does not align with what we have here. Can you confirm if this should be 0x19 or 0x14?

Quoted 6 lines

If you happen to notice, we are using a different tlow, thigh and hold time values as well internally. We are also using separate variables (tlow, thigh) for fast and fastplus modes, whereas this driver currently uses the same variable (and value) for both fast and fastplus mode. With that limitation, these are the closest timing values we can use now to get the required frequency.

Yes I did see that we have been re-working these variables and separated some of the variables. However, this parameter itself has not changed and now we have a different value in upstream. So regardless of the changes being planned, I don't see why we are not using the same value for this variable everywhere.

Jon

Signature · 1 line
nvpublic
maintainer
#8 lore raw

Re: [PATCH RESEND 2/2] i2c: tegra: Add Tegra256 support

Quoted 39 lines · Jon Hunter

Hi Akhil,

Quoted 36 lines · Akhil R

Hi Jon,

Quoted 32 lines · Jon Hunter
Quoted 16 lines · Akhil R

Add compatible and the hardware struct for Tegra256. Tegra256 controllers use a different parent clock. Hence the timing parameters are different from the previous generations to meet the expected frequencies.

---
   drivers/i2c/busses/i2c-tegra.c | 26 ++++++++++++++++++++++++++

   1 file changed, 26 insertions(+)
drivers/i2c/busses/i2c-tegra.c +0 -0
index 4eb31b913c1a..e533460bccc3 100644

drivers/i2c/busses/i2c-tegra.c static const struct tegra_i2c_hw_feature · line 1658

Quoted 10 lines
drivers/i2c/busses/i2c-tegra.c +7 -0
@@ -1649,7 +1649,33 @@ static const struct tegra_i2c_hw_feature 
 tegra194_i2c_hw = {
         .has_interface_timing_reg = true,
    };
+static const struct tegra_i2c_hw_feature tegra256_i2c_hw = {
+     .has_continue_xfer_support = true,
+     .has_per_pkt_xfer_complete_irq = true,
+     .clk_divisor_hs_mode = 7,
+     .clk_divisor_std_mode = 0x7a,
+     .clk_divisor_fast_mode = 0x40,
+     .clk_divisor_fast_plus_mode = 0x19,

Can you check this divisor value? I see we have been using a value of 0x14 for this which does not align with what we have here. Can you confirm if this should be 0x19 or 0x14?

Quoted 8 lines
Quoted 6 lines

If you happen to notice, we are using a different tlow, thigh and hold time values as well internally. We are also using separate variables (tlow, thigh) for fast and fastplus modes, whereas this driver currently uses the same variable (and value) for both fast and fastplus mode. With that limitation, these are the closest timing values we can use now to get the required frequency.

Yes I did see that we have been re-working these variables and separated some of the variables. However, this parameter itself has not changed and now we have a different value in upstream. So regardless of the changes being planned, I don't see why we are not using the same value for this variable everywhere.

Or are you saying that this divisor value is correct per the other settings we have here? And when we push the other changes to separate the settings for fast mode and fast plus mode, we will then update this accordingly? If so, then that is fine.

Jon

Signature · 1 line
nvpublic
author
#9 lore raw

Re: [PATCH RESEND 2/2] i2c: tegra: Add Tegra256 support

Quoted 55 lines · Jon Hunter
Quoted 48 lines · Jon Hunter

Hi Akhil,

Quoted 38 lines · Akhil R

Hi Jon,

Quoted 26 lines · Jon Hunter
Quoted 25 lines · Akhil R

Add compatible and the hardware struct for Tegra256. Tegra256 controllers
use a different parent clock. Hence the timing parameters are different from the previous generations to meet the expected frequencies.

---
   drivers/i2c/busses/i2c-tegra.c | 26 ++++++++++++++++++++++++++
   1 file changed, 26 insertions(+)
drivers/i2c/busses/ renamed from drivers/i2c/busses/i2c-tegra.c +0 -0

i2c-tegra.c
index 4eb31b913c1a..e533460bccc3 100644

drivers/i2c/busses/i2c-tegra.c +4 -0
@@ -1649,7 +1649,33 @@ static const struct tegra_i2c_hw_feature
 tegra194_i2c_hw = {
        .has_interface_timing_reg = true,
   };
+static const struct tegra_i2c_hw_feature tegra256_i2c_hw = {
+     .has_continue_xfer_support = true,
+     .has_per_pkt_xfer_complete_irq = true,
+     .clk_divisor_hs_mode = 7,
Quoted 8 lines

drivers/i2c/busses/i2c-tegra.c static const struct tegra_i2c_hw_feature tegra194_i2c_hw = { · line 1658

Quoted 3 lines
drivers/i2c/busses/i2c-tegra.c +3 -0
+     .clk_divisor_std_mode = 0x7a,
+     .clk_divisor_fast_mode = 0x40,
+     .clk_divisor_fast_plus_mode = 0x19,

Can you check this divisor value? I see we have been using a value of 0x14 for this which does not align with what we have here. Can you confirm if this should be 0x19 or 0x14?

Quoted 6 lines

If you happen to notice, we are using a different tlow, thigh and hold time values as well internally. We are also using separate variables (tlow, thigh) for fast and fastplus modes, whereas this driver currently uses the same variable (and value) for both fast and fastplus mode. With that limitation, these are the closest timing values we can use now to get the required frequency.

Quoted 5 lines

Yes I did see that we have been re-working these variables and separated some of the variables. However, this parameter itself has not changed and now we have a different value in upstream. So regardless of the changes being planned, I don't see why we are not using the same value for this variable everywhere.

Quoted 4 lines

Or are you saying that this divisor value is correct per the other settings we have here? And when we push the other changes to separate the settings for fast mode and fast plus mode, we will then update this accordingly? If so, then that is fine.

Correct. For this tlow/thigh etc values, we have to use 0x19 as the clock divisor to get the required frequency.

Regards,
Akhil

author
#10 lore raw

cover i2c: tegra: Add Tegra256 I2C controller support

In reply to Akhil R
Quoted 9 lines · Akhil R

This series adds support for Tegra256 I2C controllers to the Tegra I2C driver.

Tegra256 consists of 8 generic I2C controllers similar to previous Tegra generations, but with a different parent clock frequency requiring adjusted timing parameters.

The changes add the "nvidia,tegra256-i2c" compatible string to device tree bindings and implement the corresponding hardware feature structure with appropriate timing parameters and clock divisors.

Quoted 7 lines

Akhil R (2):
dt-bindings: i2c: nvidia,tegra20-i2c: Add Tegra256 I2C
i2c: tegra: Add Tegra256 support

 .../bindings/i2c/nvidia,tegra20-i2c.yaml      |  6 +++++
 drivers/i2c/busses/i2c-tegra.c                | 26 +++++++++++++++++++
 2 files changed, 32 insertions(+)

Hi Andi,

Did you get a chance to check this patchset, do you see any concerns?

Thanks & Regards,
Akhil

#11 lore raw
In reply to Akhil R
Quoted 9 lines · Akhil R

This series adds support for Tegra256 I2C controllers to the Tegra I2C driver.

Tegra256 consists of 8 generic I2C controllers similar to previous Tegra generations, but with a different parent clock frequency requiring adjusted timing parameters.

The changes add the "nvidia,tegra256-i2c" compatible string to device tree bindings and implement the corresponding hardware feature structure with appropriate timing parameters and clock divisors.

Quoted 7 lines

Akhil R (2):
dt-bindings: i2c: nvidia,tegra20-i2c: Add Tegra256 I2C
i2c: tegra: Add Tegra256 support

 .../bindings/i2c/nvidia,tegra20-i2c.yaml      |  6 +++++
 drivers/i2c/busses/i2c-tegra.c                | 26 +++++++++++++++++++
 2 files changed, 32 insertions(+)

Hi Andi, Wolfram,

Do you want me to pick up the DT bindings patch? There's currently no DT files that require this, so taking both through the I2C tree is fine, but either way works for me.

Thanks,
Thierry

#12 lore raw
Quoted 4 lines

Do you want me to pick up the DT bindings patch? There's currently no DT files that require this, so taking both through the I2C tree is fine, but either way works for me.

Agreed, this should be I2C material.