* [PATCH 0/2] memory: brcmstb_memc: Support for BCM74165
@ 2024-12-17 19:44 Florian Fainelli
2024-12-17 19:44 ` [PATCH 1/2] dt-bindings: memory-controller: Document rev c.1.5 compatible Florian Fainelli
2024-12-17 19:44 ` [PATCH 2/2] memory: brcmstb_memc: Match rev c.1.5 compatible string Florian Fainelli
0 siblings, 2 replies; 11+ messages in thread
From: Florian Fainelli @ 2024-12-17 19:44 UTC (permalink / raw)
To: linux-arm-kernel
Cc: Florian Fainelli, Krzysztof Kozlowski, Rob Herring, Conor Dooley,
Broadcom internal kernel review list,
open list:MEMORY CONTROLLER DRIVERS,
open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS
This patch series documents and matches the compatible string used on
BCM74165, thanks!
Florian Fainelli (2):
dt-bindings: memory-controller: Document rev c.1.5 compatible
memory: brcmstb_memc: Match rev c.1.5 compatible string
.../bindings/memory-controllers/brcm,brcmstb-memc-ddr.yaml | 1 +
drivers/memory/brcmstb_memc.c | 4 ++++
2 files changed, 5 insertions(+)
--
2.43.0
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 1/2] dt-bindings: memory-controller: Document rev c.1.5 compatible
2024-12-17 19:44 [PATCH 0/2] memory: brcmstb_memc: Support for BCM74165 Florian Fainelli
@ 2024-12-17 19:44 ` Florian Fainelli
2024-12-18 11:37 ` Krzysztof Kozlowski
2024-12-17 19:44 ` [PATCH 2/2] memory: brcmstb_memc: Match rev c.1.5 compatible string Florian Fainelli
1 sibling, 1 reply; 11+ messages in thread
From: Florian Fainelli @ 2024-12-17 19:44 UTC (permalink / raw)
To: linux-arm-kernel
Cc: Florian Fainelli, Krzysztof Kozlowski, Rob Herring, Conor Dooley,
Broadcom internal kernel review list,
open list:MEMORY CONTROLLER DRIVERS,
open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS
Document the revision c.1.5 compatible string that is present on newer
Broadcom STB memory controllers (74165 and onwards).
Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
---
.../bindings/memory-controllers/brcm,brcmstb-memc-ddr.yaml | 1 +
1 file changed, 1 insertion(+)
diff --git a/Documentation/devicetree/bindings/memory-controllers/brcm,brcmstb-memc-ddr.yaml b/Documentation/devicetree/bindings/memory-controllers/brcm,brcmstb-memc-ddr.yaml
index 4b072c879b02..99d79ccd1036 100644
--- a/Documentation/devicetree/bindings/memory-controllers/brcm,brcmstb-memc-ddr.yaml
+++ b/Documentation/devicetree/bindings/memory-controllers/brcm,brcmstb-memc-ddr.yaml
@@ -29,6 +29,7 @@ properties:
- brcm,brcmstb-memc-ddr-rev-c.1.2
- brcm,brcmstb-memc-ddr-rev-c.1.3
- brcm,brcmstb-memc-ddr-rev-c.1.4
+ - brcm,brcmstb-memc-ddr-rev-c.1.5
- const: brcm,brcmstb-memc-ddr
reg:
--
2.43.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 2/2] memory: brcmstb_memc: Match rev c.1.5 compatible string
2024-12-17 19:44 [PATCH 0/2] memory: brcmstb_memc: Support for BCM74165 Florian Fainelli
2024-12-17 19:44 ` [PATCH 1/2] dt-bindings: memory-controller: Document rev c.1.5 compatible Florian Fainelli
@ 2024-12-17 19:44 ` Florian Fainelli
1 sibling, 0 replies; 11+ messages in thread
From: Florian Fainelli @ 2024-12-17 19:44 UTC (permalink / raw)
To: linux-arm-kernel
Cc: Florian Fainelli, Krzysztof Kozlowski, Rob Herring, Conor Dooley,
Broadcom internal kernel review list,
open list:MEMORY CONTROLLER DRIVERS,
open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS
Match the revision c.1.5 compatible string and apply the v2.1x register
layout such that we can properly control the Self Refresh Power Down
timeouts with those controller version(s).
Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
---
drivers/memory/brcmstb_memc.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/memory/brcmstb_memc.c b/drivers/memory/brcmstb_memc.c
index 4f17a93aa028..a2750142cef7 100644
--- a/drivers/memory/brcmstb_memc.c
+++ b/drivers/memory/brcmstb_memc.c
@@ -236,6 +236,10 @@ static const struct of_device_id brcmstb_memc_of_match[] = {
.compatible = "brcm,brcmstb-memc-ddr-rev-c.1.4",
.data = &brcmstb_memc_versions[BRCMSTB_MEMC_V21]
},
+ {
+ .compatible = "brcm,brcmstb-memc-ddr-rev-c.1.5",
+ .data = &brcmstb_memc_versions[BRCMSTB_MEMC_V21]
+ },
/* default to the original offset */
{
.compatible = "brcm,brcmstb-memc-ddr",
--
2.43.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH 1/2] dt-bindings: memory-controller: Document rev c.1.5 compatible
2024-12-17 19:44 ` [PATCH 1/2] dt-bindings: memory-controller: Document rev c.1.5 compatible Florian Fainelli
@ 2024-12-18 11:37 ` Krzysztof Kozlowski
2024-12-18 17:15 ` Florian Fainelli
0 siblings, 1 reply; 11+ messages in thread
From: Krzysztof Kozlowski @ 2024-12-18 11:37 UTC (permalink / raw)
To: Florian Fainelli
Cc: linux-arm-kernel, Rob Herring, Conor Dooley,
Broadcom internal kernel review list,
open list:MEMORY CONTROLLER DRIVERS,
open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS
On Tue, Dec 17, 2024 at 11:44:38AM -0800, Florian Fainelli wrote:
> Document the revision c.1.5 compatible string that is present on newer
> Broadcom STB memory controllers (74165 and onwards).
>
> Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
> ---
> .../bindings/memory-controllers/brcm,brcmstb-memc-ddr.yaml | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/Documentation/devicetree/bindings/memory-controllers/brcm,brcmstb-memc-ddr.yaml b/Documentation/devicetree/bindings/memory-controllers/brcm,brcmstb-memc-ddr.yaml
> index 4b072c879b02..99d79ccd1036 100644
> --- a/Documentation/devicetree/bindings/memory-controllers/brcm,brcmstb-memc-ddr.yaml
> +++ b/Documentation/devicetree/bindings/memory-controllers/brcm,brcmstb-memc-ddr.yaml
> @@ -29,6 +29,7 @@ properties:
> - brcm,brcmstb-memc-ddr-rev-c.1.2
> - brcm,brcmstb-memc-ddr-rev-c.1.3
> - brcm,brcmstb-memc-ddr-rev-c.1.4
> + - brcm,brcmstb-memc-ddr-rev-c.1.5
You should use v2.1 fallback and drop driver patch. Or explain in
commit briefly why different approach is suitable.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 1/2] dt-bindings: memory-controller: Document rev c.1.5 compatible
2024-12-18 11:37 ` Krzysztof Kozlowski
@ 2024-12-18 17:15 ` Florian Fainelli
2024-12-19 8:58 ` Krzysztof Kozlowski
0 siblings, 1 reply; 11+ messages in thread
From: Florian Fainelli @ 2024-12-18 17:15 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: linux-arm-kernel, Rob Herring, Conor Dooley,
Broadcom internal kernel review list,
open list:MEMORY CONTROLLER DRIVERS,
open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS
On 12/18/24 03:37, Krzysztof Kozlowski wrote:
> On Tue, Dec 17, 2024 at 11:44:38AM -0800, Florian Fainelli wrote:
>> Document the revision c.1.5 compatible string that is present on newer
>> Broadcom STB memory controllers (74165 and onwards).
>>
>> Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
>> ---
>> .../bindings/memory-controllers/brcm,brcmstb-memc-ddr.yaml | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/Documentation/devicetree/bindings/memory-controllers/brcm,brcmstb-memc-ddr.yaml b/Documentation/devicetree/bindings/memory-controllers/brcm,brcmstb-memc-ddr.yaml
>> index 4b072c879b02..99d79ccd1036 100644
>> --- a/Documentation/devicetree/bindings/memory-controllers/brcm,brcmstb-memc-ddr.yaml
>> +++ b/Documentation/devicetree/bindings/memory-controllers/brcm,brcmstb-memc-ddr.yaml
>> @@ -29,6 +29,7 @@ properties:
>> - brcm,brcmstb-memc-ddr-rev-c.1.2
>> - brcm,brcmstb-memc-ddr-rev-c.1.3
>> - brcm,brcmstb-memc-ddr-rev-c.1.4
>> + - brcm,brcmstb-memc-ddr-rev-c.1.5
>
> You should use v2.1 fallback and drop driver patch. Or explain in
> commit briefly why different approach is suitable.
Are you suggesting that we should have fallback compatible strings, such
that we have something like this:
compatible = "brcm,brcmstb-memc-ddr-rev-c.1.5",
"brcm,brcmstb-memc-ddr-rev-c", "brcm,brcmstb-memc-ddr"
and the driver only needs to match on "brcm,brcmstb-memc-ddr-rev-c" and
apply the adequate register offset table?
If so, that is not how the current binding, and therefore DTBs are being
deployed, so that will introduce a breakage until we update all DTBs in
the field...
--
Florian
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 1/2] dt-bindings: memory-controller: Document rev c.1.5 compatible
2024-12-18 17:15 ` Florian Fainelli
@ 2024-12-19 8:58 ` Krzysztof Kozlowski
2024-12-19 23:43 ` Florian Fainelli
0 siblings, 1 reply; 11+ messages in thread
From: Krzysztof Kozlowski @ 2024-12-19 8:58 UTC (permalink / raw)
To: Florian Fainelli
Cc: linux-arm-kernel, Rob Herring, Conor Dooley,
Broadcom internal kernel review list,
open list:MEMORY CONTROLLER DRIVERS,
open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS
On Wed, Dec 18, 2024 at 09:15:08AM -0800, Florian Fainelli wrote:
> On 12/18/24 03:37, Krzysztof Kozlowski wrote:
> > On Tue, Dec 17, 2024 at 11:44:38AM -0800, Florian Fainelli wrote:
> > > Document the revision c.1.5 compatible string that is present on newer
> > > Broadcom STB memory controllers (74165 and onwards).
> > >
> > > Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
> > > ---
> > > .../bindings/memory-controllers/brcm,brcmstb-memc-ddr.yaml | 1 +
> > > 1 file changed, 1 insertion(+)
> > >
> > > diff --git a/Documentation/devicetree/bindings/memory-controllers/brcm,brcmstb-memc-ddr.yaml b/Documentation/devicetree/bindings/memory-controllers/brcm,brcmstb-memc-ddr.yaml
> > > index 4b072c879b02..99d79ccd1036 100644
> > > --- a/Documentation/devicetree/bindings/memory-controllers/brcm,brcmstb-memc-ddr.yaml
> > > +++ b/Documentation/devicetree/bindings/memory-controllers/brcm,brcmstb-memc-ddr.yaml
> > > @@ -29,6 +29,7 @@ properties:
> > > - brcm,brcmstb-memc-ddr-rev-c.1.2
> > > - brcm,brcmstb-memc-ddr-rev-c.1.3
> > > - brcm,brcmstb-memc-ddr-rev-c.1.4
> > > + - brcm,brcmstb-memc-ddr-rev-c.1.5
> >
> > You should use v2.1 fallback and drop driver patch. Or explain in
> > commit briefly why different approach is suitable.
>
> Are you suggesting that we should have fallback compatible strings, such
> that we have something like this:
>
> compatible = "brcm,brcmstb-memc-ddr-rev-c.1.5",
> "brcm,brcmstb-memc-ddr-rev-c", "brcm,brcmstb-memc-ddr"
>
> and the driver only needs to match on "brcm,brcmstb-memc-ddr-rev-c" and
> apply the adequate register offset table?
Almost, fallback should be brcm,brcmstb-memc-ddr-rev-b.2.1 or whatever
was in the driver first or whatever is the oldest known common
interface.
brcm,brcmstb-memc-ddr-rev-c is not a specific compatible.
> If so, that is not how the current binding, and therefore DTBs are being
> deployed, so that will introduce a breakage until we update all DTBs in the
> field...
No. First, I thought about new comaptible so the one you add here. No
breakage, it's new compatible. This saves you these pointless updates of
driver everytime you add new compatible.
Second, you can introduce fallbacks to older compatibles as well - there
will be no breakage, because you add one more compatible. The old
compatibles (covered by fallback) of course stays in the driver, so
there is no breakage at all. We did it multiple times for several
different bindings in Qualcomm. People were doing exactly the same:
adding compatible for new device to binding and driver, without
considering the compatibility at all.
Except being logically correct choice - using fallbacks - this really
has huge benefits when later upstreaming complete, big SoCs, like we do
for latest Qualcomm SoCs: several changes will be only bindings updates.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 1/2] dt-bindings: memory-controller: Document rev c.1.5 compatible
2024-12-19 8:58 ` Krzysztof Kozlowski
@ 2024-12-19 23:43 ` Florian Fainelli
2024-12-21 20:04 ` Krzysztof Kozlowski
0 siblings, 1 reply; 11+ messages in thread
From: Florian Fainelli @ 2024-12-19 23:43 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: linux-arm-kernel, Rob Herring, Conor Dooley,
Broadcom internal kernel review list,
open list:MEMORY CONTROLLER DRIVERS,
open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS
On 12/19/24 00:58, Krzysztof Kozlowski wrote:
> On Wed, Dec 18, 2024 at 09:15:08AM -0800, Florian Fainelli wrote:
>> On 12/18/24 03:37, Krzysztof Kozlowski wrote:
>>> On Tue, Dec 17, 2024 at 11:44:38AM -0800, Florian Fainelli wrote:
>>>> Document the revision c.1.5 compatible string that is present on newer
>>>> Broadcom STB memory controllers (74165 and onwards).
>>>>
>>>> Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
>>>> ---
>>>> .../bindings/memory-controllers/brcm,brcmstb-memc-ddr.yaml | 1 +
>>>> 1 file changed, 1 insertion(+)
>>>>
>>>> diff --git a/Documentation/devicetree/bindings/memory-controllers/brcm,brcmstb-memc-ddr.yaml b/Documentation/devicetree/bindings/memory-controllers/brcm,brcmstb-memc-ddr.yaml
>>>> index 4b072c879b02..99d79ccd1036 100644
>>>> --- a/Documentation/devicetree/bindings/memory-controllers/brcm,brcmstb-memc-ddr.yaml
>>>> +++ b/Documentation/devicetree/bindings/memory-controllers/brcm,brcmstb-memc-ddr.yaml
>>>> @@ -29,6 +29,7 @@ properties:
>>>> - brcm,brcmstb-memc-ddr-rev-c.1.2
>>>> - brcm,brcmstb-memc-ddr-rev-c.1.3
>>>> - brcm,brcmstb-memc-ddr-rev-c.1.4
>>>> + - brcm,brcmstb-memc-ddr-rev-c.1.5
>>>
>>> You should use v2.1 fallback and drop driver patch. Or explain in
>>> commit briefly why different approach is suitable.
>>
>> Are you suggesting that we should have fallback compatible strings, such
>> that we have something like this:
>>
>> compatible = "brcm,brcmstb-memc-ddr-rev-c.1.5",
>> "brcm,brcmstb-memc-ddr-rev-c", "brcm,brcmstb-memc-ddr"
>>
>> and the driver only needs to match on "brcm,brcmstb-memc-ddr-rev-c" and
>> apply the adequate register offset table?
>
> Almost, fallback should be brcm,brcmstb-memc-ddr-rev-b.2.1 or whatever
> was in the driver first or whatever is the oldest known common
> interface.
>
> brcm,brcmstb-memc-ddr-rev-c is not a specific compatible.
>
>> If so, that is not how the current binding, and therefore DTBs are being
>> deployed, so that will introduce a breakage until we update all DTBs in the
>> field...
>
> No. First, I thought about new comaptible so the one you add here. No
> breakage, it's new compatible. This saves you these pointless updates of
> driver everytime you add new compatible.
Yes, but that is not how the binding has been defined until now, so all
of the DTBs out there have:
compatible = "brcm,brcmstb-memc-ddr-rev-b.2.x", "brcm,brcmstb-memc-ddr"
(where X is in range [1..5])
and there is no fallback defined to "brcm,brcmstb-memc-ddr-rev-b.2.1",
so it is not like we can retrofit that easily by adding one now.
> > Second, you can introduce fallbacks to older compatibles as well -
there
> will be no breakage, because you add one more compatible. The old
> compatibles (covered by fallback) of course stays in the driver, so
> there is no breakage at all. We did it multiple times for several
> different bindings in Qualcomm. People were doing exactly the same:
> adding compatible for new device to binding and driver, without
> considering the compatibility at all.
>
> Except being logically correct choice - using fallbacks - this really
> has huge benefits when later upstreaming complete, big SoCs, like we do
> for latest Qualcomm SoCs: several changes will be only bindings updates.
Yes, there are advantages to using fallbacks and we (ab)use that
whenever practical.
The driver only uses a very limited subset of registers (for now), the
registers change between minor revisions as well in a way that using a
fallback like "brcm,brcmstb-memc-ddr-rev-b.2.1" is not accurate enough
not practical. In particular for some of the changes that I am thinking
of adding later on, we would need the precise minor version because the
behavior and/or register interface is subtly different that this matters.
Thanks
--
Florian
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 1/2] dt-bindings: memory-controller: Document rev c.1.5 compatible
2024-12-19 23:43 ` Florian Fainelli
@ 2024-12-21 20:04 ` Krzysztof Kozlowski
2024-12-26 18:50 ` Florian Fainelli
0 siblings, 1 reply; 11+ messages in thread
From: Krzysztof Kozlowski @ 2024-12-21 20:04 UTC (permalink / raw)
To: Florian Fainelli
Cc: linux-arm-kernel, Rob Herring, Conor Dooley,
Broadcom internal kernel review list,
open list:MEMORY CONTROLLER DRIVERS,
open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS
On 20/12/2024 00:43, Florian Fainelli wrote:
> On 12/19/24 00:58, Krzysztof Kozlowski wrote:
>> On Wed, Dec 18, 2024 at 09:15:08AM -0800, Florian Fainelli wrote:
>>> On 12/18/24 03:37, Krzysztof Kozlowski wrote:
>>>> On Tue, Dec 17, 2024 at 11:44:38AM -0800, Florian Fainelli wrote:
>>>>> Document the revision c.1.5 compatible string that is present on newer
>>>>> Broadcom STB memory controllers (74165 and onwards).
>>>>>
>>>>> Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
>>>>> ---
>>>>> .../bindings/memory-controllers/brcm,brcmstb-memc-ddr.yaml | 1 +
>>>>> 1 file changed, 1 insertion(+)
>>>>>
>>>>> diff --git a/Documentation/devicetree/bindings/memory-controllers/brcm,brcmstb-memc-ddr.yaml b/Documentation/devicetree/bindings/memory-controllers/brcm,brcmstb-memc-ddr.yaml
>>>>> index 4b072c879b02..99d79ccd1036 100644
>>>>> --- a/Documentation/devicetree/bindings/memory-controllers/brcm,brcmstb-memc-ddr.yaml
>>>>> +++ b/Documentation/devicetree/bindings/memory-controllers/brcm,brcmstb-memc-ddr.yaml
>>>>> @@ -29,6 +29,7 @@ properties:
>>>>> - brcm,brcmstb-memc-ddr-rev-c.1.2
>>>>> - brcm,brcmstb-memc-ddr-rev-c.1.3
>>>>> - brcm,brcmstb-memc-ddr-rev-c.1.4
>>>>> + - brcm,brcmstb-memc-ddr-rev-c.1.5
>>>>
>>>> You should use v2.1 fallback and drop driver patch. Or explain in
>>>> commit briefly why different approach is suitable.
>>>
>>> Are you suggesting that we should have fallback compatible strings, such
>>> that we have something like this:
>>>
>>> compatible = "brcm,brcmstb-memc-ddr-rev-c.1.5",
>>> "brcm,brcmstb-memc-ddr-rev-c", "brcm,brcmstb-memc-ddr"
>>>
>>> and the driver only needs to match on "brcm,brcmstb-memc-ddr-rev-c" and
>>> apply the adequate register offset table?
>>
>> Almost, fallback should be brcm,brcmstb-memc-ddr-rev-b.2.1 or whatever
>> was in the driver first or whatever is the oldest known common
>> interface.
>>
>> brcm,brcmstb-memc-ddr-rev-c is not a specific compatible.
>>
>>> If so, that is not how the current binding, and therefore DTBs are being
>>> deployed, so that will introduce a breakage until we update all DTBs in the
>>> field...
>>
>> No. First, I thought about new comaptible so the one you add here. No
>> breakage, it's new compatible. This saves you these pointless updates of
>> driver everytime you add new compatible.
>
> Yes, but that is not how the binding has been defined until now, so all
> of the DTBs out there have:
>
> compatible = "brcm,brcmstb-memc-ddr-rev-b.2.x", "brcm,brcmstb-memc-ddr"
I don't understand the problem. We talk about new devices here, it does
not matter what existing/old devices have in binding in that matter.
>
> (where X is in range [1..5])
>
> and there is no fallback defined to "brcm,brcmstb-memc-ddr-rev-b.2.1",
> so it is not like we can retrofit that easily by adding one now.
>
> > > Second, you can introduce fallbacks to older compatibles as well -
> there
>> will be no breakage, because you add one more compatible. The old
>> compatibles (covered by fallback) of course stays in the driver, so
>> there is no breakage at all. We did it multiple times for several
>> different bindings in Qualcomm. People were doing exactly the same:
>> adding compatible for new device to binding and driver, without
>> considering the compatibility at all.
>>
>> Except being logically correct choice - using fallbacks - this really
>> has huge benefits when later upstreaming complete, big SoCs, like we do
>> for latest Qualcomm SoCs: several changes will be only bindings updates.
>
> Yes, there are advantages to using fallbacks and we (ab)use that
> whenever practical.
>
> The driver only uses a very limited subset of registers (for now), the
> registers change between minor revisions as well in a way that using a
> fallback like "brcm,brcmstb-memc-ddr-rev-b.2.1" is not accurate enough
> not practical. In particular for some of the changes that I am thinking
> of adding later on, we would need the precise minor version because the
> behavior and/or register interface is subtly different that this matters.
Devices work fine now with the same driver data, so they are compatible.
Just because you have some differences or new features does not
invalidate that this is exactly the point for what compatibility was
created.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 1/2] dt-bindings: memory-controller: Document rev c.1.5 compatible
2024-12-21 20:04 ` Krzysztof Kozlowski
@ 2024-12-26 18:50 ` Florian Fainelli
2024-12-27 6:58 ` Krzysztof Kozlowski
0 siblings, 1 reply; 11+ messages in thread
From: Florian Fainelli @ 2024-12-26 18:50 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: linux-arm-kernel, Rob Herring, Conor Dooley,
Broadcom internal kernel review list,
open list:MEMORY CONTROLLER DRIVERS,
open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS
On 12/21/2024 12:04 PM, Krzysztof Kozlowski wrote:
> On 20/12/2024 00:43, Florian Fainelli wrote:
>> On 12/19/24 00:58, Krzysztof Kozlowski wrote:
>>> On Wed, Dec 18, 2024 at 09:15:08AM -0800, Florian Fainelli wrote:
>>>> On 12/18/24 03:37, Krzysztof Kozlowski wrote:
>>>>> On Tue, Dec 17, 2024 at 11:44:38AM -0800, Florian Fainelli wrote:
>>>>>> Document the revision c.1.5 compatible string that is present on newer
>>>>>> Broadcom STB memory controllers (74165 and onwards).
>>>>>>
>>>>>> Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
>>>>>> ---
>>>>>> .../bindings/memory-controllers/brcm,brcmstb-memc-ddr.yaml | 1 +
>>>>>> 1 file changed, 1 insertion(+)
>>>>>>
>>>>>> diff --git a/Documentation/devicetree/bindings/memory-controllers/brcm,brcmstb-memc-ddr.yaml b/Documentation/devicetree/bindings/memory-controllers/brcm,brcmstb-memc-ddr.yaml
>>>>>> index 4b072c879b02..99d79ccd1036 100644
>>>>>> --- a/Documentation/devicetree/bindings/memory-controllers/brcm,brcmstb-memc-ddr.yaml
>>>>>> +++ b/Documentation/devicetree/bindings/memory-controllers/brcm,brcmstb-memc-ddr.yaml
>>>>>> @@ -29,6 +29,7 @@ properties:
>>>>>> - brcm,brcmstb-memc-ddr-rev-c.1.2
>>>>>> - brcm,brcmstb-memc-ddr-rev-c.1.3
>>>>>> - brcm,brcmstb-memc-ddr-rev-c.1.4
>>>>>> + - brcm,brcmstb-memc-ddr-rev-c.1.5
>>>>>
>>>>> You should use v2.1 fallback and drop driver patch. Or explain in
>>>>> commit briefly why different approach is suitable.
>>>>
>>>> Are you suggesting that we should have fallback compatible strings, such
>>>> that we have something like this:
>>>>
>>>> compatible = "brcm,brcmstb-memc-ddr-rev-c.1.5",
>>>> "brcm,brcmstb-memc-ddr-rev-c", "brcm,brcmstb-memc-ddr"
>>>>
>>>> and the driver only needs to match on "brcm,brcmstb-memc-ddr-rev-c" and
>>>> apply the adequate register offset table?
>>>
>>> Almost, fallback should be brcm,brcmstb-memc-ddr-rev-b.2.1 or whatever
>>> was in the driver first or whatever is the oldest known common
>>> interface.
>>>
>>> brcm,brcmstb-memc-ddr-rev-c is not a specific compatible.
>>>
>>>> If so, that is not how the current binding, and therefore DTBs are being
>>>> deployed, so that will introduce a breakage until we update all DTBs in the
>>>> field...
>>>
>>> No. First, I thought about new comaptible so the one you add here. No
>>> breakage, it's new compatible. This saves you these pointless updates of
>>> driver everytime you add new compatible.
>>
>> Yes, but that is not how the binding has been defined until now, so all
>> of the DTBs out there have:
>>
>> compatible = "brcm,brcmstb-memc-ddr-rev-b.2.x", "brcm,brcmstb-memc-ddr"
>
> I don't understand the problem. We talk about new devices here, it does
> not matter what existing/old devices have in binding in that matter.
It does matter, because the DTBs that contain this compatible string are
already in the field, we cannot retrofit them overnight with an
additional compatible string in order to provide a fallback. Because
this is submitted now does not mean it is a new device, this was part of
my backlog to get submitted earlier on.
>
>>
>> (where X is in range [1..5])
>>
>> and there is no fallback defined to "brcm,brcmstb-memc-ddr-rev-b.2.1",
>> so it is not like we can retrofit that easily by adding one now.
>>
>> > > Second, you can introduce fallbacks to older compatibles as well -
>> there
>>> will be no breakage, because you add one more compatible. The old
>>> compatibles (covered by fallback) of course stays in the driver, so
>>> there is no breakage at all. We did it multiple times for several
>>> different bindings in Qualcomm. People were doing exactly the same:
>>> adding compatible for new device to binding and driver, without
>>> considering the compatibility at all.
>>>
>>> Except being logically correct choice - using fallbacks - this really
>>> has huge benefits when later upstreaming complete, big SoCs, like we do
>>> for latest Qualcomm SoCs: several changes will be only bindings updates.
>>
>> Yes, there are advantages to using fallbacks and we (ab)use that
>> whenever practical.
>>
>> The driver only uses a very limited subset of registers (for now), the
>> registers change between minor revisions as well in a way that using a
>> fallback like "brcm,brcmstb-memc-ddr-rev-b.2.1" is not accurate enough
>> not practical. In particular for some of the changes that I am thinking
>> of adding later on, we would need the precise minor version because the
>> behavior and/or register interface is subtly different that this matters.
>
> Devices work fine now with the same driver data, so they are compatible.
For now they do, but not for other features that will be submitted
later, they will not be, and at that point we will need to know that
this is a rev C.1.5 controller versus say a rev C.1.4 controller.
> Just because you have some differences or new features does not
> invalidate that this is exactly the point for what compatibility was
> created.
>
>
> Best regards,
> Krzysztof
--
Florian
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 1/2] dt-bindings: memory-controller: Document rev c.1.5 compatible
2024-12-26 18:50 ` Florian Fainelli
@ 2024-12-27 6:58 ` Krzysztof Kozlowski
2025-01-13 17:33 ` Florian Fainelli
0 siblings, 1 reply; 11+ messages in thread
From: Krzysztof Kozlowski @ 2024-12-27 6:58 UTC (permalink / raw)
To: Florian Fainelli
Cc: linux-arm-kernel, Rob Herring, Conor Dooley,
Broadcom internal kernel review list,
open list:MEMORY CONTROLLER DRIVERS,
open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS
On 26/12/2024 19:50, Florian Fainelli wrote:
>
>
> On 12/21/2024 12:04 PM, Krzysztof Kozlowski wrote:
>> On 20/12/2024 00:43, Florian Fainelli wrote:
>>> On 12/19/24 00:58, Krzysztof Kozlowski wrote:
>>>> On Wed, Dec 18, 2024 at 09:15:08AM -0800, Florian Fainelli wrote:
>>>>> On 12/18/24 03:37, Krzysztof Kozlowski wrote:
>>>>>> On Tue, Dec 17, 2024 at 11:44:38AM -0800, Florian Fainelli wrote:
>>>>>>> Document the revision c.1.5 compatible string that is present on newer
>>>>>>> Broadcom STB memory controllers (74165 and onwards).
>>>>>>>
>>>>>>> Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
>>>>>>> ---
>>>>>>> .../bindings/memory-controllers/brcm,brcmstb-memc-ddr.yaml | 1 +
>>>>>>> 1 file changed, 1 insertion(+)
>>>>>>>
>>>>>>> diff --git a/Documentation/devicetree/bindings/memory-controllers/brcm,brcmstb-memc-ddr.yaml b/Documentation/devicetree/bindings/memory-controllers/brcm,brcmstb-memc-ddr.yaml
>>>>>>> index 4b072c879b02..99d79ccd1036 100644
>>>>>>> --- a/Documentation/devicetree/bindings/memory-controllers/brcm,brcmstb-memc-ddr.yaml
>>>>>>> +++ b/Documentation/devicetree/bindings/memory-controllers/brcm,brcmstb-memc-ddr.yaml
>>>>>>> @@ -29,6 +29,7 @@ properties:
>>>>>>> - brcm,brcmstb-memc-ddr-rev-c.1.2
>>>>>>> - brcm,brcmstb-memc-ddr-rev-c.1.3
>>>>>>> - brcm,brcmstb-memc-ddr-rev-c.1.4
>>>>>>> + - brcm,brcmstb-memc-ddr-rev-c.1.5
>>>>>>
>>>>>> You should use v2.1 fallback and drop driver patch. Or explain in
>>>>>> commit briefly why different approach is suitable.
>>>>>
>>>>> Are you suggesting that we should have fallback compatible strings, such
>>>>> that we have something like this:
>>>>>
>>>>> compatible = "brcm,brcmstb-memc-ddr-rev-c.1.5",
>>>>> "brcm,brcmstb-memc-ddr-rev-c", "brcm,brcmstb-memc-ddr"
>>>>>
>>>>> and the driver only needs to match on "brcm,brcmstb-memc-ddr-rev-c" and
>>>>> apply the adequate register offset table?
>>>>
>>>> Almost, fallback should be brcm,brcmstb-memc-ddr-rev-b.2.1 or whatever
>>>> was in the driver first or whatever is the oldest known common
>>>> interface.
>>>>
>>>> brcm,brcmstb-memc-ddr-rev-c is not a specific compatible.
>>>>
>>>>> If so, that is not how the current binding, and therefore DTBs are being
>>>>> deployed, so that will introduce a breakage until we update all DTBs in the
>>>>> field...
>>>>
>>>> No. First, I thought about new comaptible so the one you add here. No
>>>> breakage, it's new compatible. This saves you these pointless updates of
>>>> driver everytime you add new compatible.
>>>
>>> Yes, but that is not how the binding has been defined until now, so all
>>> of the DTBs out there have:
>>>
>>> compatible = "brcm,brcmstb-memc-ddr-rev-b.2.x", "brcm,brcmstb-memc-ddr"
>>
>> I don't understand the problem. We talk about new devices here, it does
>> not matter what existing/old devices have in binding in that matter.
>
> It does matter, because the DTBs that contain this compatible string are
> already in the field, we cannot retrofit them overnight with an
> additional compatible string in order to provide a fallback. Because
Then they run downstream and it does not matter whether you change here
something or not. And anyway downstream choices do not shape choices
here. We never accept bindings just because downstream already shipped
something.
> this is submitted now does not mean it is a new device, this was part of
> my backlog to get submitted earlier on.
Well, that's great yet is not an argument in the bindings.
>
>>
>>>
>>> (where X is in range [1..5])
>>>
>>> and there is no fallback defined to "brcm,brcmstb-memc-ddr-rev-b.2.1",
>>> so it is not like we can retrofit that easily by adding one now.
>>>
>>> > > Second, you can introduce fallbacks to older compatibles as well -
>>> there
>>>> will be no breakage, because you add one more compatible. The old
>>>> compatibles (covered by fallback) of course stays in the driver, so
>>>> there is no breakage at all. We did it multiple times for several
>>>> different bindings in Qualcomm. People were doing exactly the same:
>>>> adding compatible for new device to binding and driver, without
>>>> considering the compatibility at all.
>>>>
>>>> Except being logically correct choice - using fallbacks - this really
>>>> has huge benefits when later upstreaming complete, big SoCs, like we do
>>>> for latest Qualcomm SoCs: several changes will be only bindings updates.
>>>
>>> Yes, there are advantages to using fallbacks and we (ab)use that
>>> whenever practical.
>>>
>>> The driver only uses a very limited subset of registers (for now), the
>>> registers change between minor revisions as well in a way that using a
>>> fallback like "brcm,brcmstb-memc-ddr-rev-b.2.1" is not accurate enough
>>> not practical. In particular for some of the changes that I am thinking
>>> of adding later on, we would need the precise minor version because the
>>> behavior and/or register interface is subtly different that this matters.
>>
>> Devices work fine now with the same driver data, so they are compatible.
>
> For now they do, but not for other features that will be submitted
> later, they will not be, and at that point we will need to know that
> this is a rev C.1.5 controller versus say a rev C.1.4 controller.
Which is exactly what compatibility is for.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 1/2] dt-bindings: memory-controller: Document rev c.1.5 compatible
2024-12-27 6:58 ` Krzysztof Kozlowski
@ 2025-01-13 17:33 ` Florian Fainelli
0 siblings, 0 replies; 11+ messages in thread
From: Florian Fainelli @ 2025-01-13 17:33 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: linux-arm-kernel, Rob Herring, Conor Dooley,
Broadcom internal kernel review list,
open list:MEMORY CONTROLLER DRIVERS,
open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS
On 12/26/2024 10:58 PM, Krzysztof Kozlowski wrote:
> On 26/12/2024 19:50, Florian Fainelli wrote:
>>
>>
>> On 12/21/2024 12:04 PM, Krzysztof Kozlowski wrote:
>>> On 20/12/2024 00:43, Florian Fainelli wrote:
>>>> On 12/19/24 00:58, Krzysztof Kozlowski wrote:
>>>>> On Wed, Dec 18, 2024 at 09:15:08AM -0800, Florian Fainelli wrote:
>>>>>> On 12/18/24 03:37, Krzysztof Kozlowski wrote:
>>>>>>> On Tue, Dec 17, 2024 at 11:44:38AM -0800, Florian Fainelli wrote:
>>>>>>>> Document the revision c.1.5 compatible string that is present on newer
>>>>>>>> Broadcom STB memory controllers (74165 and onwards).
>>>>>>>>
>>>>>>>> Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
>>>>>>>> ---
>>>>>>>> .../bindings/memory-controllers/brcm,brcmstb-memc-ddr.yaml | 1 +
>>>>>>>> 1 file changed, 1 insertion(+)
>>>>>>>>
>>>>>>>> diff --git a/Documentation/devicetree/bindings/memory-controllers/brcm,brcmstb-memc-ddr.yaml b/Documentation/devicetree/bindings/memory-controllers/brcm,brcmstb-memc-ddr.yaml
>>>>>>>> index 4b072c879b02..99d79ccd1036 100644
>>>>>>>> --- a/Documentation/devicetree/bindings/memory-controllers/brcm,brcmstb-memc-ddr.yaml
>>>>>>>> +++ b/Documentation/devicetree/bindings/memory-controllers/brcm,brcmstb-memc-ddr.yaml
>>>>>>>> @@ -29,6 +29,7 @@ properties:
>>>>>>>> - brcm,brcmstb-memc-ddr-rev-c.1.2
>>>>>>>> - brcm,brcmstb-memc-ddr-rev-c.1.3
>>>>>>>> - brcm,brcmstb-memc-ddr-rev-c.1.4
>>>>>>>> + - brcm,brcmstb-memc-ddr-rev-c.1.5
>>>>>>>
>>>>>>> You should use v2.1 fallback and drop driver patch. Or explain in
>>>>>>> commit briefly why different approach is suitable.
>>>>>>
>>>>>> Are you suggesting that we should have fallback compatible strings, such
>>>>>> that we have something like this:
>>>>>>
>>>>>> compatible = "brcm,brcmstb-memc-ddr-rev-c.1.5",
>>>>>> "brcm,brcmstb-memc-ddr-rev-c", "brcm,brcmstb-memc-ddr"
>>>>>>
>>>>>> and the driver only needs to match on "brcm,brcmstb-memc-ddr-rev-c" and
>>>>>> apply the adequate register offset table?
>>>>>
>>>>> Almost, fallback should be brcm,brcmstb-memc-ddr-rev-b.2.1 or whatever
>>>>> was in the driver first or whatever is the oldest known common
>>>>> interface.
>>>>>
>>>>> brcm,brcmstb-memc-ddr-rev-c is not a specific compatible.
>>>>>
>>>>>> If so, that is not how the current binding, and therefore DTBs are being
>>>>>> deployed, so that will introduce a breakage until we update all DTBs in the
>>>>>> field...
>>>>>
>>>>> No. First, I thought about new comaptible so the one you add here. No
>>>>> breakage, it's new compatible. This saves you these pointless updates of
>>>>> driver everytime you add new compatible.
>>>>
>>>> Yes, but that is not how the binding has been defined until now, so all
>>>> of the DTBs out there have:
>>>>
>>>> compatible = "brcm,brcmstb-memc-ddr-rev-b.2.x", "brcm,brcmstb-memc-ddr"
>>>
>>> I don't understand the problem. We talk about new devices here, it does
>>> not matter what existing/old devices have in binding in that matter.
>>
>> It does matter, because the DTBs that contain this compatible string are
>> already in the field, we cannot retrofit them overnight with an
>> additional compatible string in order to provide a fallback. Because
>
> Then they run downstream and it does not matter whether you change here
> something or not. And anyway downstream choices do not shape choices
> here. We never accept bindings just because downstream already shipped
> something.
Fair enough, but it does matter anyway, because as you can see from the
original binding that you accepted [1] we have a precedent for having
compatible strings of the form:
compatible = "brcm,brcmstb-memc-ddr-rev-c.1.x"
with each possible value of X being documented, this is just adding
another way, and surprise, keeps things consistent.
Why did not you reject the original binding back then? Why the change of
heart now?
All of this feels from my side very very arbitrary, and as such it is
difficult to document for other people and build a correct mental model of.
[1]:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/Documentation/devicetree/bindings/memory-controllers/brcm,brcmstb-memc-ddr.yaml?id=fa0321ba51ddff78ebe3c7c945830a85c987e3ed
>
>> this is submitted now does not mean it is a new device, this was part of
>> my backlog to get submitted earlier on.
>
> Well, that's great yet is not an argument in the bindings.
> >>
>>>
>>>>
>>>> (where X is in range [1..5])
>>>>
>>>> and there is no fallback defined to "brcm,brcmstb-memc-ddr-rev-b.2.1",
>>>> so it is not like we can retrofit that easily by adding one now.
>>>>
>>>> > > Second, you can introduce fallbacks to older compatibles as well -
>>>> there
>>>>> will be no breakage, because you add one more compatible. The old
>>>>> compatibles (covered by fallback) of course stays in the driver, so
>>>>> there is no breakage at all. We did it multiple times for several
>>>>> different bindings in Qualcomm. People were doing exactly the same:
>>>>> adding compatible for new device to binding and driver, without
>>>>> considering the compatibility at all.
>>>>>
>>>>> Except being logically correct choice - using fallbacks - this really
>>>>> has huge benefits when later upstreaming complete, big SoCs, like we do
>>>>> for latest Qualcomm SoCs: several changes will be only bindings updates.
>>>>
>>>> Yes, there are advantages to using fallbacks and we (ab)use that
>>>> whenever practical.
>>>>
>>>> The driver only uses a very limited subset of registers (for now), the
>>>> registers change between minor revisions as well in a way that using a
>>>> fallback like "brcm,brcmstb-memc-ddr-rev-b.2.1" is not accurate enough
>>>> not practical. In particular for some of the changes that I am thinking
>>>> of adding later on, we would need the precise minor version because the
>>>> behavior and/or register interface is subtly different that this matters.
>>>
>>> Devices work fine now with the same driver data, so they are compatible.
>>
>> For now they do, but not for other features that will be submitted
>> later, they will not be, and at that point we will need to know that
>> this is a rev C.1.5 controller versus say a rev C.1.4 controller.
>
> Which is exactly what compatibility is for.
Are you saying that the compatible strings must now all be updated to be
of the form:
compatible = "brcm,brcmstb-memc-ddr-rev-c.1.5",
"brcm,brcmstb-memc-ddr-rev-c.1.x", "brcm,brcmstb-memc-ddr"
or something different?
--
Florian
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2025-01-13 17:33 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-17 19:44 [PATCH 0/2] memory: brcmstb_memc: Support for BCM74165 Florian Fainelli
2024-12-17 19:44 ` [PATCH 1/2] dt-bindings: memory-controller: Document rev c.1.5 compatible Florian Fainelli
2024-12-18 11:37 ` Krzysztof Kozlowski
2024-12-18 17:15 ` Florian Fainelli
2024-12-19 8:58 ` Krzysztof Kozlowski
2024-12-19 23:43 ` Florian Fainelli
2024-12-21 20:04 ` Krzysztof Kozlowski
2024-12-26 18:50 ` Florian Fainelli
2024-12-27 6:58 ` Krzysztof Kozlowski
2025-01-13 17:33 ` Florian Fainelli
2024-12-17 19:44 ` [PATCH 2/2] memory: brcmstb_memc: Match rev c.1.5 compatible string Florian Fainelli
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).