diff mbox series

[U-Boot,3/3] arm: socfpga: gen5: fix ERR_PTR_OFFSET

Message ID 20191022192948.11080-4-simon.k.r.goldschmidt@gmail.com
State Accepted
Commit a43b60cc78e25fddffec8b5401afab61f3dbd5c9
Delegated to: Tom Rini
Headers show
Series make ERR_PTR/PTR_ERR architecture specific | expand

Commit Message

Simon Goldschmidt Oct. 22, 2019, 7:29 p.m. UTC
The default implementation of ERR_PTR/PTR_ERR maps errno values at the
and of the address range (e.g. -EINVAL/-22 gets 0xFFFFFFEA).

For socfpga gen5 SPL, this doesn't really work, as the heap is nearly
at the end of the 32 bit address range.

This patch adjusts the ERR_PTR_OFFSET to map errno values into the range
of the Boot ROM, which should not be used for valid pointers.

Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
---

 arch/arm/mach-socfpga/Kconfig | 3 +++
 1 file changed, 3 insertions(+)

Comments

Tom Rini Nov. 8, 2019, 3:32 p.m. UTC | #1
On Tue, Oct 22, 2019 at 09:29:48PM +0200, Simon Goldschmidt wrote:

> The default implementation of ERR_PTR/PTR_ERR maps errno values at the
> and of the address range (e.g. -EINVAL/-22 gets 0xFFFFFFEA).
> 
> For socfpga gen5 SPL, this doesn't really work, as the heap is nearly
> at the end of the 32 bit address range.
> 
> This patch adjusts the ERR_PTR_OFFSET to map errno values into the range
> of the Boot ROM, which should not be used for valid pointers.
> 
> Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

Applied to u-boot/master, thanks!
diff mbox series

Patch

diff --git a/arch/arm/mach-socfpga/Kconfig b/arch/arm/mach-socfpga/Kconfig
index fc0a54214f..3770e07258 100644
--- a/arch/arm/mach-socfpga/Kconfig
+++ b/arch/arm/mach-socfpga/Kconfig
@@ -1,5 +1,8 @@ 
 if ARCH_SOCFPGA
 
+config ERR_PTR_OFFSET
+	default 0xfffec000 if TARGET_SOCFPGA_GEN5 # Boot ROM range
+
 config NR_DRAM_BANKS
 	default 1