* [PATCH 0/2] SRAM dt binding and fix
@ 2023-04-17 7:34 Linus Walleij
2023-04-17 7:34 ` [PATCH 1/2] dt-bindings: sram: Add compatible for ST-Ericsson U8500 eSRAM Linus Walleij
2023-04-17 7:34 ` [PATCH 2/2] misc: sram: Generate unique names for subpools Linus Walleij
0 siblings, 2 replies; 6+ messages in thread
From: Linus Walleij @ 2023-04-17 7:34 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Arnd Bergmann,
Greg Kroah-Hartman
Cc: Rob Herring, devicetree, linux-kernel, Linus Walleij
This adds a DT binding for the U8500 SRAMs.
This patch series also fixes an issue with pool labels that I
saw on U8500.
I suppose SRAM patches will go in through the SoC tree, I kind
of feel that SRAM is a SoC concept and the driver should
actually be in drivers/soc...
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
Linus Walleij (2):
dt-bindings: sram: Add compatible for ST-Ericsson U8500 eSRAM
misc: sram: Generate unique names for subpools
Documentation/devicetree/bindings/sram/sram.yaml | 1 +
drivers/misc/sram.c | 10 ++++++----
2 files changed, 7 insertions(+), 4 deletions(-)
---
base-commit: fe15c26ee26efa11741a7b632e9f23b01aca4cc6
change-id: 20230417-ux500-sram-961796726db4
Best regards,
--
Linus Walleij <linus.walleij@linaro.org>
^ permalink raw reply [flat|nested] 6+ messages in thread* [PATCH 1/2] dt-bindings: sram: Add compatible for ST-Ericsson U8500 eSRAM
2023-04-17 7:34 [PATCH 0/2] SRAM dt binding and fix Linus Walleij
@ 2023-04-17 7:34 ` Linus Walleij
2023-04-18 22:38 ` Rob Herring
2023-04-17 7:34 ` [PATCH 2/2] misc: sram: Generate unique names for subpools Linus Walleij
1 sibling, 1 reply; 6+ messages in thread
From: Linus Walleij @ 2023-04-17 7:34 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Arnd Bergmann,
Greg Kroah-Hartman
Cc: Rob Herring, devicetree, linux-kernel, Linus Walleij
This adds an SoC-specific binding for the banks of eSRAM
available in the ST-Ericsson U8500.
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
Documentation/devicetree/bindings/sram/sram.yaml | 1 +
1 file changed, 1 insertion(+)
diff --git a/Documentation/devicetree/bindings/sram/sram.yaml b/Documentation/devicetree/bindings/sram/sram.yaml
index 993430be355b..0922d1f71ba8 100644
--- a/Documentation/devicetree/bindings/sram/sram.yaml
+++ b/Documentation/devicetree/bindings/sram/sram.yaml
@@ -94,6 +94,7 @@ patternProperties:
- samsung,exynos4210-sysram
- samsung,exynos4210-sysram-ns
- socionext,milbeaut-smp-sram
+ - stericsson,u8500-esram
reg:
description:
--
2.39.2
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH 2/2] misc: sram: Generate unique names for subpools
2023-04-17 7:34 [PATCH 0/2] SRAM dt binding and fix Linus Walleij
2023-04-17 7:34 ` [PATCH 1/2] dt-bindings: sram: Add compatible for ST-Ericsson U8500 eSRAM Linus Walleij
@ 2023-04-17 7:34 ` Linus Walleij
2023-04-18 22:38 ` Rob Herring
1 sibling, 1 reply; 6+ messages in thread
From: Linus Walleij @ 2023-04-17 7:34 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Arnd Bergmann,
Greg Kroah-Hartman
Cc: Rob Herring, devicetree, linux-kernel, Linus Walleij
The current code will, if we do not specify unique labels
for the SRAM subnodes, fail to register several nodes named
the same.
Example:
sram@40020000 {
(...)
sram@0 {
(...)
};
sram@1000 {
(...)
};
};
Since the child->name in both cases will be "sram" the
gen_pool_create() will fail because the name is not unique.
So let's use of_full_node_name() instead of child->name
so the name is "sram@0" and "sram@1000" respectively.
However if there are two or more SRAMs on the system
with subnodes named the same (that exists on the U8500)
then this again will not work. So catenate the top node
name and the subnode full name to form a string that will
always be unique.
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
drivers/misc/sram.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/misc/sram.c b/drivers/misc/sram.c
index f0e7f02605eb..84d4e090678b 100644
--- a/drivers/misc/sram.c
+++ b/drivers/misc/sram.c
@@ -240,10 +240,12 @@ static int sram_reserve_regions(struct sram_dev *sram, struct resource *res)
goto err_chunks;
}
if (!label)
- label = child->name;
-
- block->label = devm_kstrdup(sram->dev,
- label, GFP_KERNEL);
+ block->label = devm_kasprintf(sram->dev, GFP_KERNEL,
+ "%s-%s", dev_name(sram->dev),
+ of_node_full_name(child));
+ else
+ block->label = devm_kstrdup(sram->dev,
+ label, GFP_KERNEL);
if (!block->label) {
ret = -ENOMEM;
goto err_chunks;
--
2.39.2
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH 2/2] misc: sram: Generate unique names for subpools
2023-04-17 7:34 ` [PATCH 2/2] misc: sram: Generate unique names for subpools Linus Walleij
@ 2023-04-18 22:38 ` Rob Herring
2023-04-19 12:56 ` Linus Walleij
0 siblings, 1 reply; 6+ messages in thread
From: Rob Herring @ 2023-04-18 22:38 UTC (permalink / raw)
To: Linus Walleij
Cc: Krzysztof Kozlowski, Arnd Bergmann, Greg Kroah-Hartman,
devicetree, linux-kernel
On Mon, Apr 17, 2023 at 09:34:57AM +0200, Linus Walleij wrote:
> The current code will, if we do not specify unique labels
> for the SRAM subnodes, fail to register several nodes named
> the same.
>
> Example:
>
> sram@40020000 {
> (...)
> sram@0 {
> (...)
> };
> sram@1000 {
> (...)
> };
> };
>
> Since the child->name in both cases will be "sram" the
> gen_pool_create() will fail because the name is not unique.
> So let's use of_full_node_name() instead of child->name
> so the name is "sram@0" and "sram@1000" respectively.
>
> However if there are two or more SRAMs on the system
> with subnodes named the same (that exists on the U8500)
> then this again will not work. So catenate the top node
> name and the subnode full name to form a string that will
> always be unique.
Use the naming platform devices use which has the translated address.
How the addresses are defined should not affect the device name.
Rob
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH 2/2] misc: sram: Generate unique names for subpools
2023-04-18 22:38 ` Rob Herring
@ 2023-04-19 12:56 ` Linus Walleij
0 siblings, 0 replies; 6+ messages in thread
From: Linus Walleij @ 2023-04-19 12:56 UTC (permalink / raw)
To: Rob Herring
Cc: Krzysztof Kozlowski, Arnd Bergmann, Greg Kroah-Hartman,
devicetree, linux-kernel
On Wed, Apr 19, 2023 at 12:38 AM Rob Herring <robh@kernel.org> wrote:
> On Mon, Apr 17, 2023 at 09:34:57AM +0200, Linus Walleij wrote:
> > The current code will, if we do not specify unique labels
> > for the SRAM subnodes, fail to register several nodes named
> > the same.
> >
> > Example:
> >
> > sram@40020000 {
> > (...)
> > sram@0 {
> > (...)
> > };
> > sram@1000 {
> > (...)
> > };
> > };
> >
> > Since the child->name in both cases will be "sram" the
> > gen_pool_create() will fail because the name is not unique.
> > So let's use of_full_node_name() instead of child->name
> > so the name is "sram@0" and "sram@1000" respectively.
> >
> > However if there are two or more SRAMs on the system
> > with subnodes named the same (that exists on the U8500)
> > then this again will not work. So catenate the top node
> > name and the subnode full name to form a string that will
> > always be unique.
>
> Use the naming platform devices use which has the translated address.
> How the addresses are defined should not affect the device name.
Aha just dev_name(&pdev->dev) I'll try this, thanks!
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2023-04-19 12:56 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-17 7:34 [PATCH 0/2] SRAM dt binding and fix Linus Walleij
2023-04-17 7:34 ` [PATCH 1/2] dt-bindings: sram: Add compatible for ST-Ericsson U8500 eSRAM Linus Walleij
2023-04-18 22:38 ` Rob Herring
2023-04-17 7:34 ` [PATCH 2/2] misc: sram: Generate unique names for subpools Linus Walleij
2023-04-18 22:38 ` Rob Herring
2023-04-19 12:56 ` Linus Walleij
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).