Re: [PATCH v16 1/3] dt-bindings: i2c: aspeed: support for AST2600-i2cv2

Krzysztof Kozlowski
2025-03-25T10:18:48Z

On 25/03/2025 10:52, Ryan Chen wrote:
>>
>>> i2c-aspeed.c for legacy layout, compatible "aspeed,ast2600-i2c-bus"
>>> i2c-ast2600.c for the new register set, compatible compatible
>> "aspeed,ast2600-i2cv2"
>>> Do you mean I have integrate into 1 driver at i2c-aspeed.c ? can't be
>> separate two driver?
>>
>> What is this patch about? Bindings. Not drivers. Look at email month ago:
>>
>> "All this describes driver, not hardware."
>>
>> Why are you keep bringing here drivers since a month?
> Let me try to rephrase the reasoning from a hardware point of view:
>
> On AST2600, each I2C controller instance is functionally the same type of device (I2C controller),
> but it can present two different and incompatible register layouts,
> depending on a hardware-controlled configuration (via global register bits that are fixed in production SoCs).
> The layouts are not backward-compatible:
> Registers are at different offsets. Bit definitions differ.
> The programming sequence is not the same.
> Because of this incompatibility at the register level, software cannot handle both layouts in a generic way without explicit knowledge of which version is present.
> That’s why I proposed a new compatible string — to represent a hardware-visible difference in register interface, even though the logical function (I2C controller) is the same.

You implied software is set in stone and that's not true. You have a
compatible which says to the software - this device has two programming
interfaces, choose whatever you wish and work with that.

Different compatible would mean the device is different, it changes or
you have compatibility issues.

NONE of these cases are here.

I am done with this topic, because explaining this and other
trivialities to Aspeed takes way too much time, so last opinion:

Your compatible already expressed that there are two interfaces, so your
drivers can just choose whichever they want. If you need to toggle a bit
in system controller, it is fine. If you need different compatible, then
that's a NAK.

Best regards,
Krzysztof