mfd: intel-lpss: Add default I2C device properties for Apollo Lake
PATCH 1/1 mfd: intel-lpss: Add default I2C device properties for Apollo Lake
Default I2C device properties for Intel Broxton, especially SDA hold time may not be enough on Intel Apollo Lake. These properties are used in case we don't get timing parameters from ACPI.
The default SDA hold time for Broxton may fail with arbitration lost errors on Apollo Lake:
i2c_designware i2c_designware.1: i2c_dw_handle_tx_abort: lost arbitration
Fix this by using different default device properties on Apollo Lake than Broxton.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=156181
---
Hi Paul. This is the same patch I shared you offline but rebased on top of mfd.git, essentially on top of commit 19063e1b0aaa ("mfd: lpss: Add Intel Kaby Lake PCH-H PCI IDs") and commit log a little bit edited.
--- drivers/mfd/intel-lpss-acpi.c | 14 +++++++++++++- drivers/mfd/intel-lpss-pci.c | 28 ++++++++++++++++++++-------- 2 files changed, 33 insertions(+), 9 deletions(-)
drivers/mfd/intel-lpss-acpi.c +13 -1
@@ -52,6 +52,18 @@ static const struct intel_lpss_platform_info bxt_i2c_info = { .properties = bxt_i2c_properties, }; +static struct property_entry apl_i2c_properties[] = { +PROPERTY_ENTRY_U32 ("i2c-sda-hold-time-ns" ,207 ), +PROPERTY_ENTRY_U32 ("i2c-sda-falling-time-ns" ,171 ), +PROPERTY_ENTRY_U32 ("i2c-scl-falling-time-ns" ,208 ), + { }, +}; + +static const struct intel_lpss_platform_info apl_i2c_info = { + .clk_rate =133000000 , + .properties = apl_i2c_properties, +}; +static const struct acpi_device_id intel_lpss_acpi_ids[] = {/* SPT */ {"INT3446" , (kernel_ulong_t)&spt_i2c_info },
@@ -61,7 +73,7 @@ static const struct acpi_device_id intel_lpss_acpi_ids[] = { { "80860ABC", (kernel_ulong_t)&bxt_info }, { "80860AC2", (kernel_ulong_t)&bxt_info },/* APL */ - { "80865AAC", (kernel_ulong_t)&bxt_i2c_info }, + { "80865AAC", (kernel_ulong_t)&apl_i2c_info }, { "80865ABC", (kernel_ulong_t)&bxt_info }, { "80865AC2", (kernel_ulong_t)&bxt_info }, { }
drivers/mfd/intel-lpss-pci.c +20 -8
@@ -111,6 +111,18 @@ static const struct intel_lpss_platform_info bxt_i2c_info = { .properties = bxt_i2c_properties, }; +static struct property_entry apl_i2c_properties[] = { +PROPERTY_ENTRY_U32 ("i2c-sda-hold-time-ns" ,207 ), +PROPERTY_ENTRY_U32 ("i2c-sda-falling-time-ns" ,171 ), +PROPERTY_ENTRY_U32 ("i2c-scl-falling-time-ns" ,208 ), + { }, +}; + +static const struct intel_lpss_platform_info apl_i2c_info = { + .clk_rate =133000000 , + .properties = apl_i2c_properties, +}; +static const struct intel_lpss_platform_info kbl_info = { .clk_rate =120000000 , };
@@ -159,14 +171,14 @@ static const struct pci_device_id intel_lpss_pci_ids[] = { { PCI_VDEVICE(INTEL, 0x1aee), (kernel_ulong_t)&bxt_uart_info },/* APL */ - { PCI_VDEVICE(INTEL, 0x5aac), (kernel_ulong_t)&bxt_i2c_info }, - { PCI_VDEVICE(INTEL, 0x5aae), (kernel_ulong_t)&bxt_i2c_info }, - { PCI_VDEVICE(INTEL, 0x5ab0), (kernel_ulong_t)&bxt_i2c_info }, - { PCI_VDEVICE(INTEL, 0x5ab2), (kernel_ulong_t)&bxt_i2c_info }, - { PCI_VDEVICE(INTEL, 0x5ab4), (kernel_ulong_t)&bxt_i2c_info }, - { PCI_VDEVICE(INTEL, 0x5ab6), (kernel_ulong_t)&bxt_i2c_info }, - { PCI_VDEVICE(INTEL, 0x5ab8), (kernel_ulong_t)&bxt_i2c_info }, - { PCI_VDEVICE(INTEL, 0x5aba), (kernel_ulong_t)&bxt_i2c_info }, + { PCI_VDEVICE(INTEL, 0x5aac), (kernel_ulong_t)&apl_i2c_info }, + { PCI_VDEVICE(INTEL, 0x5aae), (kernel_ulong_t)&apl_i2c_info }, + { PCI_VDEVICE(INTEL, 0x5ab0), (kernel_ulong_t)&apl_i2c_info }, + { PCI_VDEVICE(INTEL, 0x5ab2), (kernel_ulong_t)&apl_i2c_info }, + { PCI_VDEVICE(INTEL, 0x5ab4), (kernel_ulong_t)&apl_i2c_info }, + { PCI_VDEVICE(INTEL, 0x5ab6), (kernel_ulong_t)&apl_i2c_info }, + { PCI_VDEVICE(INTEL, 0x5ab8), (kernel_ulong_t)&apl_i2c_info }, + { PCI_VDEVICE(INTEL, 0x5aba), (kernel_ulong_t)&apl_i2c_info }, { PCI_VDEVICE(INTEL, 0x5abc), (kernel_ulong_t)&bxt_uart_info }, { PCI_VDEVICE(INTEL, 0x5abe), (kernel_ulong_t)&bxt_uart_info }, { PCI_VDEVICE(INTEL, 0x5ac0), (kernel_ulong_t)&bxt_uart_info },
Signature · 1 line
2.9.3
Quoted 7 lines · Jarkko Nikula
Default I2C device properties for Intel Broxton, especially SDA hold time may not be enough on Intel Apollo Lake. These properties are used in case we don't get timing parameters from ACPI.
The default SDA hold time for Broxton may fail with arbitration lost errors on Apollo Lake:
Quoted 8 lines
i2c_designwarei2c_designware.1:i2c_dw_handle_tx_abort: lost arbitrationFix this by using different default device properties on Apollo Lake than Broxton.
Reported-by Paul Liu <[email protected]>Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=156181
Signed-off-by Jarkko Nikula <[email protected]>
Quoted 15 lines · Jarkko Nikula
Default I2C device properties for Intel Broxton, especially SDA hold time may not be enough on Intel Apollo Lake. These properties are used in case we don't get timing parameters from ACPI.
The default SDA hold time for Broxton may fail with arbitration lost errors on Apollo Lake:
i2c_designwarei2c_designware.1:i2c_dw_handle_tx_abort: lost arbitrationFix this by using different default device properties on Apollo Lake than Broxton.
Reported-by Paul Liu <[email protected]>Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=156181
Signed-off-by Jarkko Nikula <[email protected]>
Quoted 8 lines
---
Hi Paul. This is the same patch I shared you offline but rebased on top of mfd.git, essentially on top of commit19063e1b0aaa("mfd: lpss: Add Intel Kaby Lake PCH-H PCI IDs") and commit log a little bit edited.--- drivers/mfd/intel-lpss-acpi.c | 14 +++++++++++++- drivers/mfd/intel-lpss-pci.c | 28 ++++++++++++++++++++-------- 2 files changed, 33 insertions(+), 9 deletions(-)
Patch looks okay.
Would like Paul's Acked-by or Tested-by to complete the loop.
Quoted 78 lines
drivers/mfd/intel-lpss-acpi.c +13
-1@@ -52,6 +52,18 @@ static const struct intel_lpss_platform_info bxt_i2c_info = { .properties = bxt_i2c_properties, }; +static struct property_entry apl_i2c_properties[] = { +PROPERTY_ENTRY_U32 ("i2c-sda-hold-time-ns" ,207 ), +PROPERTY_ENTRY_U32 ("i2c-sda-falling-time-ns" ,171 ), +PROPERTY_ENTRY_U32 ("i2c-scl-falling-time-ns" ,208 ), + { }, +}; + +static const struct intel_lpss_platform_info apl_i2c_info = { + .clk_rate =133000000 , + .properties = apl_i2c_properties, +}; +static const struct acpi_device_id intel_lpss_acpi_ids[] = {/* SPT */ {"INT3446" , (kernel_ulong_t)&spt_i2c_info },@@ -61,7 +73,7 @@ static const struct acpi_device_id intel_lpss_acpi_ids[] = { { "80860ABC", (kernel_ulong_t)&bxt_info }, { "80860AC2", (kernel_ulong_t)&bxt_info },/* APL */ - { "80865AAC", (kernel_ulong_t)&bxt_i2c_info }, + { "80865AAC", (kernel_ulong_t)&apl_i2c_info }, { "80865ABC", (kernel_ulong_t)&bxt_info }, { "80865AC2", (kernel_ulong_t)&bxt_info }, { }drivers/mfd/intel-lpss-pci.c +20
-8@@ -111,6 +111,18 @@ static const struct intel_lpss_platform_info bxt_i2c_info = { .properties = bxt_i2c_properties, }; +static struct property_entry apl_i2c_properties[] = { +PROPERTY_ENTRY_U32 ("i2c-sda-hold-time-ns" ,207 ), +PROPERTY_ENTRY_U32 ("i2c-sda-falling-time-ns" ,171 ), +PROPERTY_ENTRY_U32 ("i2c-scl-falling-time-ns" ,208 ), + { }, +}; + +static const struct intel_lpss_platform_info apl_i2c_info = { + .clk_rate =133000000 , + .properties = apl_i2c_properties, +}; +static const struct intel_lpss_platform_info kbl_info = { .clk_rate =120000000 , };@@ -159,14 +171,14 @@ static const struct pci_device_id intel_lpss_pci_ids[] = { { PCI_VDEVICE(INTEL, 0x1aee), (kernel_ulong_t)&bxt_uart_info },/* APL */ - { PCI_VDEVICE(INTEL, 0x5aac), (kernel_ulong_t)&bxt_i2c_info }, - { PCI_VDEVICE(INTEL, 0x5aae), (kernel_ulong_t)&bxt_i2c_info }, - { PCI_VDEVICE(INTEL, 0x5ab0), (kernel_ulong_t)&bxt_i2c_info }, - { PCI_VDEVICE(INTEL, 0x5ab2), (kernel_ulong_t)&bxt_i2c_info }, - { PCI_VDEVICE(INTEL, 0x5ab4), (kernel_ulong_t)&bxt_i2c_info }, - { PCI_VDEVICE(INTEL, 0x5ab6), (kernel_ulong_t)&bxt_i2c_info }, - { PCI_VDEVICE(INTEL, 0x5ab8), (kernel_ulong_t)&bxt_i2c_info }, - { PCI_VDEVICE(INTEL, 0x5aba), (kernel_ulong_t)&bxt_i2c_info }, + { PCI_VDEVICE(INTEL, 0x5aac), (kernel_ulong_t)&apl_i2c_info }, + { PCI_VDEVICE(INTEL, 0x5aae), (kernel_ulong_t)&apl_i2c_info }, + { PCI_VDEVICE(INTEL, 0x5ab0), (kernel_ulong_t)&apl_i2c_info }, + { PCI_VDEVICE(INTEL, 0x5ab2), (kernel_ulong_t)&apl_i2c_info }, + { PCI_VDEVICE(INTEL, 0x5ab4), (kernel_ulong_t)&apl_i2c_info }, + { PCI_VDEVICE(INTEL, 0x5ab6), (kernel_ulong_t)&apl_i2c_info }, + { PCI_VDEVICE(INTEL, 0x5ab8), (kernel_ulong_t)&apl_i2c_info }, + { PCI_VDEVICE(INTEL, 0x5aba), (kernel_ulong_t)&apl_i2c_info }, { PCI_VDEVICE(INTEL, 0x5abc), (kernel_ulong_t)&bxt_uart_info }, { PCI_VDEVICE(INTEL, 0x5abe), (kernel_ulong_t)&bxt_uart_info }, { PCI_VDEVICE(INTEL, 0x5ac0), (kernel_ulong_t)&bxt_uart_info },
Signature · 4 lines
Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog
Lee Jones
AppliedQuoted 15 lines · Jarkko Nikula
Default I2C device properties for Intel Broxton, especially SDA hold time may not be enough on Intel Apollo Lake. These properties are used in case we don't get timing parameters from ACPI.
The default SDA hold time for Broxton may fail with arbitration lost errors on Apollo Lake:
i2c_designwarei2c_designware.1:i2c_dw_handle_tx_abort: lost arbitrationFix this by using different default device properties on Apollo Lake than Broxton.
Reported-by Paul Liu <[email protected]>Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=156181
Signed-off-by Jarkko Nikula <[email protected]>
Quoted 8 lines
---
Hi Paul. This is the same patch I shared you offline but rebased on top of mfd.git, essentially on top of commit19063e1b0aaa("mfd: lpss: Add Intel Kaby Lake PCH-H PCI IDs") and commit log a little bit edited.--- drivers/mfd/intel-lpss-acpi.c | 14 +++++++++++++- drivers/mfd/intel-lpss-pci.c | 28 ++++++++++++++++++++-------- 2 files changed, 33 insertions(+), 9 deletions(-)
Mika's Ack is good enough.
Applied, thanks.
Quoted 78 lines
drivers/mfd/intel-lpss-acpi.c +13
-1@@ -52,6 +52,18 @@ static const struct intel_lpss_platform_info bxt_i2c_info = { .properties = bxt_i2c_properties, }; +static struct property_entry apl_i2c_properties[] = { +PROPERTY_ENTRY_U32 ("i2c-sda-hold-time-ns" ,207 ), +PROPERTY_ENTRY_U32 ("i2c-sda-falling-time-ns" ,171 ), +PROPERTY_ENTRY_U32 ("i2c-scl-falling-time-ns" ,208 ), + { }, +}; + +static const struct intel_lpss_platform_info apl_i2c_info = { + .clk_rate =133000000 , + .properties = apl_i2c_properties, +}; +static const struct acpi_device_id intel_lpss_acpi_ids[] = {/* SPT */ {"INT3446" , (kernel_ulong_t)&spt_i2c_info },@@ -61,7 +73,7 @@ static const struct acpi_device_id intel_lpss_acpi_ids[] = { { "80860ABC", (kernel_ulong_t)&bxt_info }, { "80860AC2", (kernel_ulong_t)&bxt_info },/* APL */ - { "80865AAC", (kernel_ulong_t)&bxt_i2c_info }, + { "80865AAC", (kernel_ulong_t)&apl_i2c_info }, { "80865ABC", (kernel_ulong_t)&bxt_info }, { "80865AC2", (kernel_ulong_t)&bxt_info }, { }drivers/mfd/intel-lpss-pci.c +20
-8@@ -111,6 +111,18 @@ static const struct intel_lpss_platform_info bxt_i2c_info = { .properties = bxt_i2c_properties, }; +static struct property_entry apl_i2c_properties[] = { +PROPERTY_ENTRY_U32 ("i2c-sda-hold-time-ns" ,207 ), +PROPERTY_ENTRY_U32 ("i2c-sda-falling-time-ns" ,171 ), +PROPERTY_ENTRY_U32 ("i2c-scl-falling-time-ns" ,208 ), + { }, +}; + +static const struct intel_lpss_platform_info apl_i2c_info = { + .clk_rate =133000000 , + .properties = apl_i2c_properties, +}; +static const struct intel_lpss_platform_info kbl_info = { .clk_rate =120000000 , };@@ -159,14 +171,14 @@ static const struct pci_device_id intel_lpss_pci_ids[] = { { PCI_VDEVICE(INTEL, 0x1aee), (kernel_ulong_t)&bxt_uart_info },/* APL */ - { PCI_VDEVICE(INTEL, 0x5aac), (kernel_ulong_t)&bxt_i2c_info }, - { PCI_VDEVICE(INTEL, 0x5aae), (kernel_ulong_t)&bxt_i2c_info }, - { PCI_VDEVICE(INTEL, 0x5ab0), (kernel_ulong_t)&bxt_i2c_info }, - { PCI_VDEVICE(INTEL, 0x5ab2), (kernel_ulong_t)&bxt_i2c_info }, - { PCI_VDEVICE(INTEL, 0x5ab4), (kernel_ulong_t)&bxt_i2c_info }, - { PCI_VDEVICE(INTEL, 0x5ab6), (kernel_ulong_t)&bxt_i2c_info }, - { PCI_VDEVICE(INTEL, 0x5ab8), (kernel_ulong_t)&bxt_i2c_info }, - { PCI_VDEVICE(INTEL, 0x5aba), (kernel_ulong_t)&bxt_i2c_info }, + { PCI_VDEVICE(INTEL, 0x5aac), (kernel_ulong_t)&apl_i2c_info }, + { PCI_VDEVICE(INTEL, 0x5aae), (kernel_ulong_t)&apl_i2c_info }, + { PCI_VDEVICE(INTEL, 0x5ab0), (kernel_ulong_t)&apl_i2c_info }, + { PCI_VDEVICE(INTEL, 0x5ab2), (kernel_ulong_t)&apl_i2c_info }, + { PCI_VDEVICE(INTEL, 0x5ab4), (kernel_ulong_t)&apl_i2c_info }, + { PCI_VDEVICE(INTEL, 0x5ab6), (kernel_ulong_t)&apl_i2c_info }, + { PCI_VDEVICE(INTEL, 0x5ab8), (kernel_ulong_t)&apl_i2c_info }, + { PCI_VDEVICE(INTEL, 0x5aba), (kernel_ulong_t)&apl_i2c_info }, { PCI_VDEVICE(INTEL, 0x5abc), (kernel_ulong_t)&bxt_uart_info }, { PCI_VDEVICE(INTEL, 0x5abe), (kernel_ulong_t)&bxt_uart_info }, { PCI_VDEVICE(INTEL, 0x5ac0), (kernel_ulong_t)&bxt_uart_info },
Signature · 4 lines
Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog