All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] arm64: dts: marvell: armada-37xx: reserve memory for ATF
@ 2018-04-21 14:03 ` Miquel Raynal
  0 siblings, 0 replies; 10+ messages in thread
From: Miquel Raynal @ 2018-04-21 14:03 UTC (permalink / raw)
  To: Gregory Clement, Jason Cooper, Andrew Lunn, Sebastian Hesselbarth
  Cc: Mark Rutland, devicetree, Antoine Tenart, Catalin Marinas,
	Will Deacon, Maxime Chevallier, Nadav Haklai, Rob Herring,
	Thomas Petazzoni, Miquel Raynal, Victor Gu, linux-arm-kernel

From: Victor Gu <xigu@marvell.com>

The PSCI area should be reserved in Linux for PSCI operations such as
suspend/resume.

Reserve 2MiB of memory which matches the area used by ATF (BL1, BL2,
BL3x, see [1] in ATF source code). This covers all PSCI code and data
area and is 2MiB aligned, which is required by Linux for huge pages
handling.

[1] plat/marvell/a3700/common/include/platform_def.h

Signed-off-by: Victor Gu <xigu@marvell.com>
[miquel.raynal@bootlin.com: reword of commit message]
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 arch/arm64/boot/dts/marvell/armada-37xx.dtsi | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/arch/arm64/boot/dts/marvell/armada-37xx.dtsi b/arch/arm64/boot/dts/marvell/armada-37xx.dtsi
index 97207a61bc79..429ce91bfc39 100644
--- a/arch/arm64/boot/dts/marvell/armada-37xx.dtsi
+++ b/arch/arm64/boot/dts/marvell/armada-37xx.dtsi
@@ -22,6 +22,17 @@
 		serial1 = &uart1;
 	};
 
+	reserved-memory {
+		#address-cells = <2>;
+		#size-cells = <2>;
+		ranges;
+
+		psci-area@4000000 {
+			reg = <0 0x4000000 0 0x200000>;
+			no-map;
+		};
+	};
+
 	cpus {
 		#address-cells = <1>;
 		#size-cells = <0>;
-- 
2.14.1

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH] arm64: dts: marvell: armada-37xx: reserve memory for ATF
@ 2018-04-21 14:03 ` Miquel Raynal
  0 siblings, 0 replies; 10+ messages in thread
From: Miquel Raynal @ 2018-04-21 14:03 UTC (permalink / raw)
  To: linux-arm-kernel

From: Victor Gu <xigu@marvell.com>

The PSCI area should be reserved in Linux for PSCI operations such as
suspend/resume.

Reserve 2MiB of memory which matches the area used by ATF (BL1, BL2,
BL3x, see [1] in ATF source code). This covers all PSCI code and data
area and is 2MiB aligned, which is required by Linux for huge pages
handling.

[1] plat/marvell/a3700/common/include/platform_def.h

Signed-off-by: Victor Gu <xigu@marvell.com>
[miquel.raynal at bootlin.com: reword of commit message]
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 arch/arm64/boot/dts/marvell/armada-37xx.dtsi | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/arch/arm64/boot/dts/marvell/armada-37xx.dtsi b/arch/arm64/boot/dts/marvell/armada-37xx.dtsi
index 97207a61bc79..429ce91bfc39 100644
--- a/arch/arm64/boot/dts/marvell/armada-37xx.dtsi
+++ b/arch/arm64/boot/dts/marvell/armada-37xx.dtsi
@@ -22,6 +22,17 @@
 		serial1 = &uart1;
 	};
 
+	reserved-memory {
+		#address-cells = <2>;
+		#size-cells = <2>;
+		ranges;
+
+		psci-area at 4000000 {
+			reg = <0 0x4000000 0 0x200000>;
+			no-map;
+		};
+	};
+
 	cpus {
 		#address-cells = <1>;
 		#size-cells = <0>;
-- 
2.14.1

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH] arm64: dts: marvell: armada-37xx: reserve memory for ATF
  2018-04-21 14:03 ` Miquel Raynal
@ 2018-04-21 14:18   ` Thomas Petazzoni
  -1 siblings, 0 replies; 10+ messages in thread
From: Thomas Petazzoni @ 2018-04-21 14:18 UTC (permalink / raw)
  To: Miquel Raynal
  Cc: Mark Rutland, Andrew Lunn, Jason Cooper, devicetree,
	Antoine Tenart, Catalin Marinas, Gregory Clement, Will Deacon,
	Maxime Chevallier, Nadav Haklai, Rob Herring, Victor Gu,
	linux-arm-kernel, Sebastian Hesselbarth

Hello,

On Sat, 21 Apr 2018 16:03:42 +0200, Miquel Raynal wrote:
> From: Victor Gu <xigu@marvell.com>
> 
> The PSCI area should be reserved in Linux for PSCI operations such as
> suspend/resume.
> 
> Reserve 2MiB of memory which matches the area used by ATF (BL1, BL2,
> BL3x, see [1] in ATF source code). This covers all PSCI code and data
> area and is 2MiB aligned, which is required by Linux for huge pages
> handling.
> 
> [1] plat/marvell/a3700/common/include/platform_def.h
> 
> Signed-off-by: Victor Gu <xigu@marvell.com>
> [miquel.raynal@bootlin.com: reword of commit message]
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>

Shouldn't this be done automatically by the bootloader, before passing
the DTB to the kernel ?

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH] arm64: dts: marvell: armada-37xx: reserve memory for ATF
@ 2018-04-21 14:18   ` Thomas Petazzoni
  0 siblings, 0 replies; 10+ messages in thread
From: Thomas Petazzoni @ 2018-04-21 14:18 UTC (permalink / raw)
  To: linux-arm-kernel

Hello,

On Sat, 21 Apr 2018 16:03:42 +0200, Miquel Raynal wrote:
> From: Victor Gu <xigu@marvell.com>
> 
> The PSCI area should be reserved in Linux for PSCI operations such as
> suspend/resume.
> 
> Reserve 2MiB of memory which matches the area used by ATF (BL1, BL2,
> BL3x, see [1] in ATF source code). This covers all PSCI code and data
> area and is 2MiB aligned, which is required by Linux for huge pages
> handling.
> 
> [1] plat/marvell/a3700/common/include/platform_def.h
> 
> Signed-off-by: Victor Gu <xigu@marvell.com>
> [miquel.raynal at bootlin.com: reword of commit message]
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>

Shouldn't this be done automatically by the bootloader, before passing
the DTB to the kernel ?

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] arm64: dts: marvell: armada-37xx: reserve memory for ATF
  2018-04-21 14:18   ` Thomas Petazzoni
@ 2018-04-23  8:31     ` Miquel Raynal
  -1 siblings, 0 replies; 10+ messages in thread
From: Miquel Raynal @ 2018-04-23  8:31 UTC (permalink / raw)
  To: Thomas Petazzoni
  Cc: Mark Rutland, Andrew Lunn, Jason Cooper, devicetree,
	Antoine Tenart, Catalin Marinas, Gregory Clement, Will Deacon,
	Maxime Chevallier, Nadav Haklai, Rob Herring, Victor Gu,
	linux-arm-kernel, Sebastian Hesselbarth

Hi Thomas,

On Sat, 21 Apr 2018 16:18:59 +0200, Thomas Petazzoni
<thomas.petazzoni@bootlin.com> wrote:

> Hello,
> 
> On Sat, 21 Apr 2018 16:03:42 +0200, Miquel Raynal wrote:
> > From: Victor Gu <xigu@marvell.com>
> > 
> > The PSCI area should be reserved in Linux for PSCI operations such as
> > suspend/resume.
> > 
> > Reserve 2MiB of memory which matches the area used by ATF (BL1, BL2,
> > BL3x, see [1] in ATF source code). This covers all PSCI code and data
> > area and is 2MiB aligned, which is required by Linux for huge pages
> > handling.
> > 
> > [1] plat/marvell/a3700/common/include/platform_def.h
> > 
> > Signed-off-by: Victor Gu <xigu@marvell.com>
> > [miquel.raynal@bootlin.com: reword of commit message]
> > Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>  
> 
> Shouldn't this be done automatically by the bootloader, before passing
> the DTB to the kernel ?

I am working with a 2017.09 mainline U-Boot.

I did not know the bootloader was supposedly in charge of that. But
what if it fails doing it? Fixing the bootloader is one thing, I assume
very few people would update it. Is it worth keeping this in Linux DT?

Thanks,
Miquèl

-- 
Miquel Raynal, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH] arm64: dts: marvell: armada-37xx: reserve memory for ATF
@ 2018-04-23  8:31     ` Miquel Raynal
  0 siblings, 0 replies; 10+ messages in thread
From: Miquel Raynal @ 2018-04-23  8:31 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Thomas,

On Sat, 21 Apr 2018 16:18:59 +0200, Thomas Petazzoni
<thomas.petazzoni@bootlin.com> wrote:

> Hello,
> 
> On Sat, 21 Apr 2018 16:03:42 +0200, Miquel Raynal wrote:
> > From: Victor Gu <xigu@marvell.com>
> > 
> > The PSCI area should be reserved in Linux for PSCI operations such as
> > suspend/resume.
> > 
> > Reserve 2MiB of memory which matches the area used by ATF (BL1, BL2,
> > BL3x, see [1] in ATF source code). This covers all PSCI code and data
> > area and is 2MiB aligned, which is required by Linux for huge pages
> > handling.
> > 
> > [1] plat/marvell/a3700/common/include/platform_def.h
> > 
> > Signed-off-by: Victor Gu <xigu@marvell.com>
> > [miquel.raynal at bootlin.com: reword of commit message]
> > Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>  
> 
> Shouldn't this be done automatically by the bootloader, before passing
> the DTB to the kernel ?

I am working with a 2017.09 mainline U-Boot.

I did not know the bootloader was supposedly in charge of that. But
what if it fails doing it? Fixing the bootloader is one thing, I assume
very few people would update it. Is it worth keeping this in Linux DT?

Thanks,
Miqu?l

-- 
Miquel Raynal, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] arm64: dts: marvell: armada-37xx: reserve memory for ATF
  2018-04-23  8:31     ` Miquel Raynal
@ 2018-04-23 12:49       ` Thomas Petazzoni
  -1 siblings, 0 replies; 10+ messages in thread
From: Thomas Petazzoni @ 2018-04-23 12:49 UTC (permalink / raw)
  To: Miquel Raynal
  Cc: Mark Rutland, Andrew Lunn, Jason Cooper, devicetree,
	Antoine Tenart, Catalin Marinas, Gregory Clement, Will Deacon,
	Maxime Chevallier, Nadav Haklai, Rob Herring, Victor Gu,
	linux-arm-kernel, Sebastian Hesselbarth

Hello,

On Mon, 23 Apr 2018 10:31:27 +0200, Miquel Raynal wrote:

> > Shouldn't this be done automatically by the bootloader, before passing
> > the DTB to the kernel ?  
> 
> I am working with a 2017.09 mainline U-Boot.
> 
> I did not know the bootloader was supposedly in charge of that.

I thought it should be the case, but I indeed see nothing in U-Boot
that does that, except for OMAP2 platforms.

> But what if it fails doing it?

Well if something fails in the boot process, the platform fails to boot.
I find this question a bit weird/silly. It's like "and what if the user
used the wrong DT for the wrong platform ?"

> Fixing the bootloader is one thing, I assume very few people would
> update it. Is it worth keeping this in Linux DT?

The issue I see with having this in the Linux DT is that depending on
the bootloader, the memory area that is used to keep the PSCI firmware
may very well be different. It's really not a property of the HW
itself, but a pure software choice of the bootloader. For example, are
you sure the mainline U-Boot puts the PSCI firmware at the same place
as the vendor U-Boot ?

What are other platforms doing to solve this problem ?

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH] arm64: dts: marvell: armada-37xx: reserve memory for ATF
@ 2018-04-23 12:49       ` Thomas Petazzoni
  0 siblings, 0 replies; 10+ messages in thread
From: Thomas Petazzoni @ 2018-04-23 12:49 UTC (permalink / raw)
  To: linux-arm-kernel

Hello,

On Mon, 23 Apr 2018 10:31:27 +0200, Miquel Raynal wrote:

> > Shouldn't this be done automatically by the bootloader, before passing
> > the DTB to the kernel ?  
> 
> I am working with a 2017.09 mainline U-Boot.
> 
> I did not know the bootloader was supposedly in charge of that.

I thought it should be the case, but I indeed see nothing in U-Boot
that does that, except for OMAP2 platforms.

> But what if it fails doing it?

Well if something fails in the boot process, the platform fails to boot.
I find this question a bit weird/silly. It's like "and what if the user
used the wrong DT for the wrong platform ?"

> Fixing the bootloader is one thing, I assume very few people would
> update it. Is it worth keeping this in Linux DT?

The issue I see with having this in the Linux DT is that depending on
the bootloader, the memory area that is used to keep the PSCI firmware
may very well be different. It's really not a property of the HW
itself, but a pure software choice of the bootloader. For example, are
you sure the mainline U-Boot puts the PSCI firmware at the same place
as the vendor U-Boot ?

What are other platforms doing to solve this problem ?

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] arm64: dts: marvell: armada-37xx: reserve memory for ATF
  2018-04-23 12:49       ` Thomas Petazzoni
@ 2018-04-23 15:15         ` Miquel Raynal
  -1 siblings, 0 replies; 10+ messages in thread
From: Miquel Raynal @ 2018-04-23 15:15 UTC (permalink / raw)
  To: Thomas Petazzoni
  Cc: Mark Rutland, Andrew Lunn, Jason Cooper, devicetree,
	Antoine Tenart, Catalin Marinas, Gregory Clement, Will Deacon,
	Maxime Chevallier, Nadav Haklai, Rob Herring, Victor Gu,
	linux-arm-kernel, Sebastian Hesselbarth

Hi Thomas,

On Mon, 23 Apr 2018 14:49:40 +0200, Thomas Petazzoni
<thomas.petazzoni@bootlin.com> wrote:

> Hello,
> 
> On Mon, 23 Apr 2018 10:31:27 +0200, Miquel Raynal wrote:
> 
> > > Shouldn't this be done automatically by the bootloader, before passing
> > > the DTB to the kernel ?    
> > 
> > I am working with a 2017.09 mainline U-Boot.
> > 
> > I did not know the bootloader was supposedly in charge of that.  
> 
> I thought it should be the case, but I indeed see nothing in U-Boot
> that does that, except for OMAP2 platforms.
> 
> > But what if it fails doing it?  
> 
> Well if something fails in the boot process, the platform fails to boot.
> I find this question a bit weird/silly. It's like "and what if the user
> used the wrong DT for the wrong platform ?"

Sorry, I meant "what if the bootloader does not do it?", in other
words: currently the bootloader does not do it, let's assume it should,
shall we take into account that it does not and add this code to Linux
too, or shall we say to people "upgrade your bootloader/ATF"? But from
the rest of your answer I assume the latter is the right approach.

> 
> > Fixing the bootloader is one thing, I assume very few people would
> > update it. Is it worth keeping this in Linux DT?  
> 
> The issue I see with having this in the Linux DT is that depending on
> the bootloader, the memory area that is used to keep the PSCI firmware
> may very well be different. It's really not a property of the HW
> itself, but a pure software choice of the bootloader. For example, are
> you sure the mainline U-Boot puts the PSCI firmware at the same place
> as the vendor U-Boot ?
> 
> What are other platforms doing to solve this problem ?

I will also check if it is actually U-Boot or ATF choice. My
understanding is that ATF's handle the PSCI firmware but U-Boot should
propagate a reserved node (for this firmware) in Linux's DTB. Let me
check all of that.

> 
> Best regards,
> 
> Thomas


Thanks,
Miquèl

-- 
Miquel Raynal, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH] arm64: dts: marvell: armada-37xx: reserve memory for ATF
@ 2018-04-23 15:15         ` Miquel Raynal
  0 siblings, 0 replies; 10+ messages in thread
From: Miquel Raynal @ 2018-04-23 15:15 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Thomas,

On Mon, 23 Apr 2018 14:49:40 +0200, Thomas Petazzoni
<thomas.petazzoni@bootlin.com> wrote:

> Hello,
> 
> On Mon, 23 Apr 2018 10:31:27 +0200, Miquel Raynal wrote:
> 
> > > Shouldn't this be done automatically by the bootloader, before passing
> > > the DTB to the kernel ?    
> > 
> > I am working with a 2017.09 mainline U-Boot.
> > 
> > I did not know the bootloader was supposedly in charge of that.  
> 
> I thought it should be the case, but I indeed see nothing in U-Boot
> that does that, except for OMAP2 platforms.
> 
> > But what if it fails doing it?  
> 
> Well if something fails in the boot process, the platform fails to boot.
> I find this question a bit weird/silly. It's like "and what if the user
> used the wrong DT for the wrong platform ?"

Sorry, I meant "what if the bootloader does not do it?", in other
words: currently the bootloader does not do it, let's assume it should,
shall we take into account that it does not and add this code to Linux
too, or shall we say to people "upgrade your bootloader/ATF"? But from
the rest of your answer I assume the latter is the right approach.

> 
> > Fixing the bootloader is one thing, I assume very few people would
> > update it. Is it worth keeping this in Linux DT?  
> 
> The issue I see with having this in the Linux DT is that depending on
> the bootloader, the memory area that is used to keep the PSCI firmware
> may very well be different. It's really not a property of the HW
> itself, but a pure software choice of the bootloader. For example, are
> you sure the mainline U-Boot puts the PSCI firmware at the same place
> as the vendor U-Boot ?
> 
> What are other platforms doing to solve this problem ?

I will also check if it is actually U-Boot or ATF choice. My
understanding is that ATF's handle the PSCI firmware but U-Boot should
propagate a reserved node (for this firmware) in Linux's DTB. Let me
check all of that.

> 
> Best regards,
> 
> Thomas


Thanks,
Miqu?l

-- 
Miquel Raynal, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2018-04-23 15:15 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-21 14:03 [PATCH] arm64: dts: marvell: armada-37xx: reserve memory for ATF Miquel Raynal
2018-04-21 14:03 ` Miquel Raynal
2018-04-21 14:18 ` Thomas Petazzoni
2018-04-21 14:18   ` Thomas Petazzoni
2018-04-23  8:31   ` Miquel Raynal
2018-04-23  8:31     ` Miquel Raynal
2018-04-23 12:49     ` Thomas Petazzoni
2018-04-23 12:49       ` Thomas Petazzoni
2018-04-23 15:15       ` Miquel Raynal
2018-04-23 15:15         ` Miquel Raynal

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.