Skip to contentSkip to conversation

arm: mvebu: Fix the memory size on the Mirabox

PATCH New Ryan Press 5 participants 12 messages Mar 29, 2013 – Apr 4, 2013 Device tree bindings

lore
Share & tools
lore

Ryan Press

author
#0 lore raw

PATCH 1/1 arm: mvebu: Fix the memory size on the Mirabox

The memory size in the device tree is only 512 MB, but the Mirabox actually has 1 GB.

Tested the change with memtester and no problems found.

---
 arch/arm/boot/dts/armada-370-mirabox.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/armada-370-mirabox.dts +1 -1
index dd0c57d..cfe3dd2 100644
@@ -21,7 +21,7 @@
 
 	memory {
 		device_type = "memory";
-		reg = <0x00000000 0x20000000>; /* 512 MB */
+		reg = <0x00000000 0x40000000>; /* 1 GB */
 	};
 
 	soc {
Signature · 1 line
1.8.1.2
#1 lore raw

PATCH 1/1 arm: mvebu: Fix the memory size on the Mirabox

Ryan,

Quoted 9 lines · Ryan Press

The memory size in the device tree is only 512 MB, but the Mirabox actually has 1 GB.

Tested the change with memtester and no problems found.

---
 arch/arm/boot/dts/armada-370-mirabox.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Thanks for the patch. It looks good, but please don't forget to Cc: the maintainers (Andrew Lunn, Gregory Clemente, and myself). I almost missed this one. :)

thx,

Jason.

author
#2 lore raw

PATCH 1/1 arm: mvebu: Fix the memory size on the Mirabox

Hi Jason,

Quoted 11 lines · Jason Cooper
Quoted 9 lines · Ryan Press

The memory size in the device tree is only 512 MB, but the Mirabox actually has 1 GB.

Tested the change with memtester and no problems found.

---
 arch/arm/boot/dts/armada-370-mirabox.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 7 lines

Thanks for the patch. It looks good, but please don't forget to Cc: the maintainers (Andrew Lunn, Gregory Clemente, and myself). I almost missed this one. :)

thx,

Jason.

Okay I didn't know I needed to do that. Thanks!

Ryan

#3 lore raw

PATCH 1/1 arm: mvebu: Fix the memory size on the Mirabox

Quoted 18 lines · Ryan Press

Hi Jason,

Quoted 15 lines · Jason Cooper
Quoted 9 lines · Ryan Press

The memory size in the device tree is only 512 MB, but the Mirabox actually has 1 GB.

Tested the change with memtester and no problems found.

---
 arch/arm/boot/dts/armada-370-mirabox.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Thanks for the patch. It looks good, but please don't forget to Cc: the maintainers (Andrew Lunn, Gregory Clemente, and myself). I almost missed this one. :)

As far as I can remember, Gregory has a Mirabox with only 512 MiB, which means some boards were shipped with 512 MiB and some with 1 GiB. Moreover, apparently nothing can distinguish one from the other.

@Gregory: can you confirm this?

If Gregory confirms this, then we shouldn't apply this patch. Don't forget in-kernel DTS are only meant for developers and for reference. The vendor (Globalscale in this case) has to ship a proper DTS for each board.

Quoted 6 lines
Quoted 3 lines

thx,

Jason.

Okay I didn't know I needed to do that. Thanks!

Although it's not mandatory, you can do a 'git blame' on the file you're patching and find out who should you put on Cc.

Signature · 3 lines
Ezequiel Garc?a, Free Electrons
Embedded Linux, Kernel and Android Engineering
http://free-electrons.com
#4 lore raw

PATCH 1/1 arm: mvebu: Fix the memory size on the Mirabox

Quoted 24 lines · Ezequiel Garcia
Quoted 18 lines · Ryan Press

Hi Jason,

Quoted 15 lines · Jason Cooper
Quoted 9 lines · Ryan Press

The memory size in the device tree is only 512 MB, but the Mirabox actually has 1 GB.

Tested the change with memtester and no problems found.

---
 arch/arm/boot/dts/armada-370-mirabox.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Thanks for the patch. It looks good, but please don't forget to Cc: the maintainers (Andrew Lunn, Gregory Clemente, and myself). I almost missed this one. :)

As far as I can remember, Gregory has a Mirabox with only 512 MiB, which means some boards were shipped with 512 MiB and some with 1 GiB. Moreover, apparently nothing can distinguish one from the other.

Quoted 6 lines

@Gregory: can you confirm this?

If Gregory confirms this, then we shouldn't apply this patch. Don't forget in-kernel DTS are only meant for developers and for reference. The vendor (Globalscale in this case) has to ship a proper DTS for each board.

In this case, the bootloader should be amending the dtb to provide the correct value for the particular board. If your bootloader is devicetree-capable, it'll happen auto-magically. Otherwise, you'll need to enable ARM_ATAG_DTB_COMPAT.

I'll drop this patch unless Gregory says it's ok.

hth,

Jason.

author
#5 lore raw

PATCH 1/1 arm: mvebu: Fix the memory size on the Mirabox

Hi Jason,

Quoted 30 lines · Jason Cooper
Quoted 22 lines · Ezequiel Garcia
Quoted 12 lines · Ryan Press
Quoted 11 lines · Jason Cooper
Quoted 9 lines · Ryan Press

The memory size in the device tree is only 512 MB, but the Mirabox actually has 1 GB.

Tested the change with memtester and no problems found.

---
 arch/arm/boot/dts/armada-370-mirabox.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 4 lines
Quoted 4 lines

Thanks for the patch. It looks good, but please don't forget to Cc: the maintainers (Andrew Lunn, Gregory Clemente, and myself). I almost missed this one. :)

As far as I can remember, Gregory has a Mirabox with only 512 MiB, which means some boards were shipped with 512 MiB and some with 1 GiB. Moreover, apparently nothing can distinguish one from the other.

Quoted 6 lines

@Gregory: can you confirm this?

If Gregory confirms this, then we shouldn't apply this patch. Don't forget in-kernel DTS are only meant for developers and for reference. The vendor (Globalscale in this case) has to ship a proper DTS for each board.

Quoted 6 lines

In this case, the bootloader should be amending the dtb to provide the correct value for the particular board. If your bootloader is devicetree-capable, it'll happen auto-magically. Otherwise, you'll need to enable ARM_ATAG_DTB_COMPAT.

I'll drop this patch unless Gregory says it's ok.

I didn't realize that some Mirabox had 512 MB, so that makes sense. The U-Boot that comes with the Mirabox is not capable of devicetree; it is circa 2009 so it has some support for other CPUs but not ARM. I didn't see any Armada support in mainline U-Boot. I am working on making the old U-Boot devicetree capable and I am close. I see that there is an fdt_memory_fixup function that adds the memory entries, so I will be sure to implement that. I think getting a devicetree capable bootloader is the best way forward.

Thanks,
Ryan

#6 lore raw

PATCH 1/1 arm: mvebu: Fix the memory size on the Mirabox

Quoted 1 line · Ryan Press

On Fri, Mar 29, 2013 at 12:44 PM, Jason Cooper <[email protected]> wrote:

...

Quoted 4 lines
Quoted 4 lines

In this case, the bootloader should be amending the dtb to provide the correct value for the particular board. If your bootloader is devicetree-capable, it'll happen auto-magically. Otherwise, you'll need to enable ARM_ATAG_DTB_COMPAT.

To clarify, I meant to enable this in the kernel. It'll then take the ATAGs passed from the bootloader (including RAM size), and modify the dtb accordingly. No bootloader modification necessary.

It's used as a stop-gap measure (including ARM_APPENDED_DTB) until everyone is shipping devices with devicetree-aware bootloaders. Primarily for developers and tinkerers.

Quoted 2 lines

The U-Boot that comes with the Mirabox is not capable of devicetree; it is circa 2009 so it has some support for other CPUs but not ARM.

?

Quoted 5 lines

I didn't see any Armada support in mainline U-Boot. I am working on making the old U-Boot devicetree capable and I am close. I see that there is an fdt_memory_fixup function that adds the memory entries, so I will be sure to implement that. I think getting a devicetree capable bootloader is the best way forward.

See my comment above. It's a lot less work ;-)

hth,

Jason.

#7 lore raw

PATCH 1/1 arm: mvebu: Fix the memory size on the Mirabox

Quoted 5 lines · Jason Cooper
Quoted 2 lines · Ryan Press

The U-Boot that comes with the Mirabox is not capable of devicetree; it is circa 2009 so it has some support for other CPUs but not ARM.

?

nevermind, I originally read it that your version of u-boot didn't support ARM, hence the question. Now I'm tracking. The warm weather here must be throwing me for a loop. :)

thx,

Jason.

author
#8 lore raw

PATCH 1/1 arm: mvebu: Fix the memory size on the Mirabox

In reply to Jason Cooper

Hi Jason,

Thanks for your thoughts!

Quoted 12 lines · Jason Cooper
Quoted 1 line · Ryan Press

On Fri, Mar 29, 2013 at 12:44 PM, Jason Cooper <[email protected]> wrote:

...

Quoted 4 lines
Quoted 4 lines

In this case, the bootloader should be amending the dtb to provide the correct value for the particular board. If your bootloader is devicetree-capable, it'll happen auto-magically. Otherwise, you'll need to enable ARM_ATAG_DTB_COMPAT.

To clarify, I meant to enable this in the kernel. It'll then take the ATAGs passed from the bootloader (including RAM size), and modify the dtb accordingly. No bootloader modification necessary.

Yep, I saw that option and I understand how it works.

Quoted 4 lines
Quoted 2 lines

The U-Boot that comes with the Mirabox is not capable of devicetree; it is circa 2009 so it has some support for other CPUs but not ARM.

?

It has devicetree support for PPC, etc. but not for ARM. In the ARM specific boot functions there is no devicetree stuff. And there were some endian-ness bugs in the common devicetree code. Obviously it supports ARM in general. :)

Quoted 7 lines
Quoted 5 lines

I didn't see any Armada support in mainline U-Boot. I am working on making the old U-Boot devicetree capable and I am close. I see that there is an fdt_memory_fixup function that adds the memory entries, so I will be sure to implement that. I think getting a devicetree capable bootloader is the best way forward.

See my comment above. It's a lot less work ;-)

There really isn't streamlined support for appending a dtb to the kernel zImage. So that means every time I install a different kernel I need to make a custom uImage. With devicetree support in the kernel I can just make a deb package and install it with less worry about soft bricking it.

I have recently built and am testing a U-Boot that is working with devicetree, including the memory fixup. If anyone wants to try it on their Mirabox, let me know. So more work in the short term, but it eliminates the 'DOH! moments when I forget to install the special uImage and need to fart around in the bootloader.

Ryan

#9 lore raw

PATCH 1/1 arm: mvebu: Fix the memory size on the Mirabox

Quoted 2 lines · Ryan Press

There really isn't streamlined support for appending a dtb to the kernel zImage.

$ cat my.dtb >>zImage
$ mkimage ...

which could be done in a pre-install hook in the deb, or as a kernel post-install hook (eg running update-grub on a desktop).

Quoted 5 lines

I have recently built and am testing a U-Boot that is working with devicetree, including the memory fixup. If anyone wants to try it on their Mirabox, let me know. So more work in the short term, but it eliminates the 'DOH! moments when I forget to install the special uImage and need to fart around in the bootloader.

mainline u-boot supports devicetree on ARM very well. It might a better use of time to add support for the Armada 370/XP to mainline u-boot.

As an alternative, there is also barebox [1] which is more similar to the kernel in layout, and has native Kconfig support. It also needs patches for Armada 370/XP, and kirkwood/dove/orion5x...

hth,

Jason.

[1] http://www.barebox.org

#10 lore raw

PATCH 1/1 arm: mvebu: Fix the memory size on the Mirabox

In reply to Ezequiel Garcia

Dear Ezequiel Garcia,

Quoted 3 lines · Ezequiel Garcia

As far as I can remember, Gregory has a Mirabox with only 512 MiB, which means some boards were shipped with 512 MiB and some with 1 GiB. Moreover, apparently nothing can distinguish one from the other.

I do confirm that some Mirabox only have 512 MB of RAM, at least according to U-Boot:

U-Boot 2009.08 (May 23 2012 - 16:35:03)Marvell version: 1.1.0 NQ U-Boot Addressing:

       Code:		00600000:006AFFF0
       BSS:		006F8E40
       Stack:		0x5fff70
       PageTable:	0x8e0000
       Heap address:	0x900000:0xe00000
Board: DB-88F6710-BP
SoC:   MV6710 Z1
CPU:   Marvell PJ4B v7 UP (Rev 1) LE
       DDR @ 600Mhz, TClock @ 200Mhz
       DDR 16Bit Width, FastPath Memory Access
PEX 0: Root Complex Interface, Detected Link X1
PEX 1: Root Complex Interface, Detected Link X1
DRAM:  512 MB

CS 0: base 0x00000000 size 512 MB Addresses 14M - 0M are saved for the U-Boot usage.

The mvebu_defconfig contains CONFIG_ARM_ATAG_DTB_COMPAT=y, so it should automatically pick up the amount of memory defined by U-Boot in the ATAGS.

Best regards,

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#11 lore raw

PATCH 1/1 arm: mvebu: Fix the memory size on the Mirabox

In reply to Ezequiel Garcia
Quoted 20 lines · Ezequiel Garcia
Quoted 18 lines · Ryan Press

Hi Jason,

Quoted 15 lines · Jason Cooper
Quoted 9 lines · Ryan Press

The memory size in the device tree is only 512 MB, but the Mirabox actually has 1 GB.

Tested the change with memtester and no problems found.

---
 arch/arm/boot/dts/armada-370-mirabox.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Thanks for the patch. It looks good, but please don't forget to Cc: the maintainers (Andrew Lunn, Gregory Clemente, and myself). I almost missed this one. :)

Quoted 5 lines

As far as I can remember, Gregory has a Mirabox with only 512 MiB, which means some boards were shipped with 512 MiB and some with 1 GiB. Moreover, apparently nothing can distinguish one from the other.

@Gregory: can you confirm this?

I saw that you eventually found a solution, but just in case you still wait for my answer: I confirm that my board have only 512MiB (according to U-Boot)

Quoted 16 lines

If Gregory confirms this, then we shouldn't apply this patch. Don't forget in-kernel DTS are only meant for developers and for reference. The vendor (Globalscale in this case) has to ship a proper DTS for each board.

Quoted 6 lines
Quoted 3 lines

thx,

Jason.

Okay I didn't know I needed to do that. Thanks!

Although it's not mandatory, you can do a 'git blame' on the file you're patching and find out who should you put on Cc.

Signature · 4 lines
Gregory Clement, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com