From: Abd-Alrhman Masalkhi <abd.masalkhi@gmail.com>
To: krzk@kernel.org
Cc: abd.masalkhi@gmail.com, arnd@arndb.de, conor+dt@kernel.org,
devicetree@vger.kernel.org, gregkh@linuxfoundation.org,
krzk+dt@kernel.org, linux-kernel@vger.kernel.org,
robh@kernel.org
Subject: Re: [PATCH v2 1/3] dt-bindings: Add Device Tree binding for ST M24LR control interface
Date: Mon, 2 Jun 2025 03:48:17 +0000 [thread overview]
Message-ID: <20250602034817.2028695-1-abd.masalkhi@gmail.com> (raw)
In-Reply-To: <be95cc2d-f548-4c71-a57b-8107009b8776@kernel.org>
Hi Krzysztof,
Thank you for the detailed feedback.
> Do not send next version while the discussion is still happening.
You're right, I sent the updated version too early while discussion was
still ongoing. I'll hold off on sending further revisions until the current
points are fully resolved.
> Full path, so /schemas/i2c/i2c-mux.... but this is not an i2c mux, at
> least not in your description, so something feels incomplete or incorrect.
A Brief Overview of the Device:
The M24LR series is a dual-interface EEPROM with both I2C and ISO/IEC 15693
RF support. While it is technically an EEPROM, it also exposes a control
interface over I2C via a second address, which is used to manage features
such as password protection, energy harvesting configuration, and UID access.
This secondary interface is not memory-mapped like traditional EEPROMs, which
is why I initially considered separating the control aspect in the software.
How to Access the EEPROM and the System Parameter Sector?
According to the datasheet for the M24LR04E-R, the E2 bit must be set
appropriately in the I2C device select code to distinguish between EEPROM
access and control access.
What is E2?
E2 is a bit in the I2C device select code. It determines which internal
function of the chip is being accessed.
Device Select Code Format:
Bit: b7 b6 b5 b4 b3 b2 b1 b0
Value: 1 0 1 0 E2 1 1 R/W
To access the EEPROM memory, E2 (b3) should be 0:
Device Select Code Format:
Bit: b7 b6 b5 b4 b3 b2 b1 b0
Value: 1 0 1 0 0 1 1 R/W
To access the system control interface, E2 (b3) should be 1:
Device Select Code Format:
Bit: b7 b6 b5 b4 b3 b2 b1 b0
Value: 1 0 1 0 0 1 1 R/W
Is This a Gate?
Correct me if I'm wrong, but to me this behavior resembles a form of gate,
instead of using a separate hardware pin to access the EEPROM, the chip
encodes this selection in the I2C device address. However, the datasheet
does not explicitly mention anything about a "gate" or "mux," which is
why I've been careful to not label it as an I2C gate in the binding.
That said, I see it as a kind of implicit I2C mux (of type gate), where
the chip use the 0x57 address as in the example and to select the internal
EEPROM we just reset the b3 in the device select code.
Why This View Matters in my driver design:
Looking at the device from this perspective has helped me keep the driver
design cleaner while keeping the synchronization issue in mind:
1- Avoiding code duplication (such as rewriting parts of the at24 driver).
2- Ensuring concurrent access to EEPROM and control areas is properly
handled and isolated.
3- Representing the dual-role nature of the chip more explicitly.
> What does "r" stand for?
The r in st,m24lr04e-r stands for RF, these are the RF-enabled variants
of the M24LR series, as specified by STMicroelectronics.
> Do not need '>' unless you need to preserve formatting.
I'll remove the | and > where formatting preservation is not needed.
> Don't repeat constraints in free form text. I already asked for this.
I'll avoid repeating constraints in free-form text.
> Where is the second address? It is supposed to be here.
>> + #size-cells = <0>;
>> +
>> + eeprom@53 {
>> + compatible = "atmel,24c04";
>> + reg = <0x53>;
Here is the second address is 0x53, to select the EEPROM
I appreciate your feedback.
Best regards,
Abd-Alrhman Masalkhi
next prev parent reply other threads:[~2025-06-02 3:48 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-01 15:30 [PATCH v2 0/3] Add control driver for ST M24LR RFID/NFC EEPROM chips Abd-Alrhman Masalkhi
2025-06-01 15:30 ` [PATCH v2 1/3] dt-bindings: eeprom: Add ST M24LR control interface Abd-Alrhman Masalkhi
2025-06-01 15:42 ` Krzysztof Kozlowski
2025-06-02 3:48 ` Abd-Alrhman Masalkhi [this message]
2025-06-02 6:28 ` [PATCH v2 1/3] dt-bindings: Add Device Tree binding for " Krzysztof Kozlowski
2025-06-02 17:23 ` Abd-Alrhman Masalkhi
2025-06-02 18:11 ` Krzysztof Kozlowski
2025-06-02 17:47 ` Abd-Alrhman Masalkhi
2025-06-01 16:33 ` [PATCH v2 1/3] dt-bindings: eeprom: Add " Rob Herring (Arm)
2025-06-03 5:40 ` Abd-Alrhman Masalkhi
2025-06-03 6:56 ` Krzysztof Kozlowski
2025-06-01 15:30 ` [PATCH v2 2/3] misc: add sysfs control driver for ST M24LR series RFID/NFC chips Abd-Alrhman Masalkhi
2025-06-01 15:30 ` [PATCH v2 3/3] ABI: sysfs: document control attributes for ST M24LR Abd-Alrhman Masalkhi
2025-06-01 15:50 ` [PATCH v2 0/3] Add control driver for ST M24LR RFID/NFC EEPROM chips Greg KH
-- strict thread matches above, loose matches on Subject: below --
2025-05-31 13:37 [PATCH 1/3] dt-bindings: misc: Add binding for ST M24LR control interface Krzysztof Kozlowski
2025-06-01 7:31 ` [PATCH v2 1/3] dt-bindings: Add Device Tree " Abd-Alrhman Masalkhi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250602034817.2028695-1-abd.masalkhi@gmail.com \
--to=abd.masalkhi@gmail.com \
--cc=arnd@arndb.de \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=krzk+dt@kernel.org \
--cc=krzk@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robh@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®