Skip to content

at24: SMBus fallback read/write for 16-bit addressed EEPROMs on PIIX4#550

Open
nissampa wants to merge 2 commits intosonic-net:masterfrom
nissampa:at24_smbus
Open

at24: SMBus fallback read/write for 16-bit addressed EEPROMs on PIIX4#550
nissampa wants to merge 2 commits intosonic-net:masterfrom
nissampa:at24_smbus

Conversation

@nissampa
Copy link
Copy Markdown

AMD PIIX4 SMBus adapters (found on AMD SP5/EPYC platforms including Cisco 8000 series) support BYTE_DATA and WORD_DATA but lack I2C_FUNC_I2C and I2C_FUNC_SMBUS_I2C_BLOCK. For AT24_FLAG_ADDR16 EEPROMs this causes regmap_get_i2c_bus() to return -ENOTSUPP, making the EEPROM inaccessible.

Add a smbus_addr16_fallback detection and two new helpers:

  • at24_smbus_read(): write_byte_data sets 16-bit pointer, repeated read_byte() fetches bytes (EEPROM auto-increments)
  • at24_smbus_write(): write_word_data encodes address+data in one WORD

Force regmap_config.reg_bits=8 when fallback is active so regmap init succeeds; all actual I/O is handled by the SMBus helpers.

Fixes EEPROM access on Cisco 8000-series with AMD SP5 on-die PIIX4 SMBus.

@nissampa nissampa requested a review from a team as a code owner March 27, 2026 22:13
@mssonicbld
Copy link
Copy Markdown

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Copy Markdown
Contributor

@paulmenzel paulmenzel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sent the commit upstream for review.

@mssonicbld
Copy link
Copy Markdown

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@nissampa nissampa requested a review from paulmenzel March 31, 2026 21:41
@nissampa
Copy link
Copy Markdown
Author

Please sent the commit upstream for review.

can you let me know how to do it ?
Is there a mailing list I need to send it to ?

@nissampa
Copy link
Copy Markdown
Author

nissampa commented Apr 2, 2026

@paulmenzel Can you help me in approving and merging it ?

AMD PIIX4 SMBus adapters (found on AMD SP5/EPYC platforms including
Cisco 8000 series) support BYTE_DATA and WORD_DATA but lack I2C_FUNC_I2C
and I2C_FUNC_SMBUS_I2C_BLOCK.  For AT24_FLAG_ADDR16 EEPROMs this causes
regmap_get_i2c_bus() to return -ENOTSUPP, making the EEPROM inaccessible.

Add a smbus_addr16_fallback detection and two new helpers:
  - at24_smbus_read():  write_byte_data sets 16-bit pointer, repeated
                        read_byte() fetches bytes (EEPROM auto-increments)
  - at24_smbus_write(): write_word_data encodes address+data in one WORD

Force regmap_config.reg_bits=8 when fallback is active so regmap init
succeeds; all actual I/O is handled by the SMBus helpers.

Fixes EEPROM access on Cisco 8000-series with AMD SP5 on-die PIIX4 SMBus.

Signed-off-by: Nishanth Sampath Kumar <nissampa@cisco.com>
@mssonicbld
Copy link
Copy Markdown

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@saiarcot895
Copy link
Copy Markdown
Contributor

@nissampa See https://docs.kernel.org/process/submitting-patches.html for sending patches to the appropriate mailing list. Please make sure that the email you send is in plain text (not HTML) and is formatted properly.

checkpatch.pl fixes:
- correct indentation of smbus retry block to 1/2/3 tab nesting
- add blank line after struct regmap_config smbus_config declaration

Signed-off-by: Nishanth Sampath Kumar <nissampa@cisco.com>
@mssonicbld
Copy link
Copy Markdown

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@nissampa
Copy link
Copy Markdown
Author

nissampa commented Apr 7, 2026

@nissampa See https://docs.kernel.org/process/submitting-patches.html for sending patches to the appropriate mailing list. Please make sure that the email you send is in plain text (not HTML) and is formatted properly.

Thank you for the instructions. I did as stated in that link

@paulmenzel
Copy link
Copy Markdown
Contributor

Thank you for sending it upstream. For the record:

  1. v1: https://lore.kernel.org/all/20260404021920.359902-1-nissampa@cisco.com/
  2. v2: https://lore.kernel.org/all/20260407233927.498932-1-nissampa@cisco.com/

Let’s see, what the comments on v2 are.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants