All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] arm: mvebu: Fix the memory size on the Mirabox
@ 2013-03-29 17:51 Ryan Press
  2013-03-29 18:04 ` Jason Cooper
  0 siblings, 1 reply; 12+ messages in thread
From: Ryan Press @ 2013-03-29 17:51 UTC (permalink / raw)
  To: linux-arm-kernel

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.

Signed-off-by: Ryan Press <ryan@presslab.us>
---
 arch/arm/boot/dts/armada-370-mirabox.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/armada-370-mirabox.dts b/arch/arm/boot/dts/armada-370-mirabox.dts
index dd0c57d..cfe3dd2 100644
--- a/arch/arm/boot/dts/armada-370-mirabox.dts
+++ b/arch/arm/boot/dts/armada-370-mirabox.dts
@@ -21,7 +21,7 @@
 
 	memory {
 		device_type = "memory";
-		reg = <0x00000000 0x20000000>; /* 512 MB */
+		reg = <0x00000000 0x40000000>; /* 1 GB */
 	};
 
 	soc {
-- 
1.8.1.2

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

* [PATCH] arm: mvebu: Fix the memory size on the Mirabox
  2013-03-29 17:51 [PATCH] arm: mvebu: Fix the memory size on the Mirabox Ryan Press
@ 2013-03-29 18:04 ` Jason Cooper
  2013-03-29 18:09   ` Ryan Press
  0 siblings, 1 reply; 12+ messages in thread
From: Jason Cooper @ 2013-03-29 18:04 UTC (permalink / raw)
  To: linux-arm-kernel

Ryan,

On Fri, Mar 29, 2013 at 10:51:17AM -0700, Ryan Press wrote:
> 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.
> 
> Signed-off-by: Ryan Press <ryan@presslab.us>
> ---
>  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.

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

* [PATCH] arm: mvebu: Fix the memory size on the Mirabox
  2013-03-29 18:04 ` Jason Cooper
@ 2013-03-29 18:09   ` Ryan Press
  2013-03-29 19:37     ` Ezequiel Garcia
  0 siblings, 1 reply; 12+ messages in thread
From: Ryan Press @ 2013-03-29 18:09 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Jason,

On Fri, Mar 29, 2013 at 11:04 AM, Jason Cooper <jason@lakedaemon.net> wrote:
> On Fri, Mar 29, 2013 at 10:51:17AM -0700, Ryan Press wrote:
>> 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.
>>
>> Signed-off-by: Ryan Press <ryan@presslab.us>
>> ---
>>  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.

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

Ryan

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

* [PATCH] arm: mvebu: Fix the memory size on the Mirabox
  2013-03-29 18:09   ` Ryan Press
@ 2013-03-29 19:37     ` Ezequiel Garcia
  2013-03-29 19:44       ` Jason Cooper
                         ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Ezequiel Garcia @ 2013-03-29 19:37 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Mar 29, 2013 at 11:09:23AM -0700, Ryan Press wrote:
> Hi Jason,
> 
> On Fri, Mar 29, 2013 at 11:04 AM, Jason Cooper <jason@lakedaemon.net> wrote:
> > On Fri, Mar 29, 2013 at 10:51:17AM -0700, Ryan Press wrote:
> >> 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.
> >>
> >> Signed-off-by: Ryan Press <ryan@presslab.us>
> >> ---
> >>  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.

> > 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.

-- 
Ezequiel Garc?a, Free Electrons
Embedded Linux, Kernel and Android Engineering
http://free-electrons.com

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

* [PATCH] arm: mvebu: Fix the memory size on the Mirabox
  2013-03-29 19:37     ` Ezequiel Garcia
@ 2013-03-29 19:44       ` Jason Cooper
  2013-03-30  3:30         ` Ryan Press
  2013-04-03 10:46       ` Thomas Petazzoni
  2013-04-04 13:55       ` Gregory CLEMENT
  2 siblings, 1 reply; 12+ messages in thread
From: Jason Cooper @ 2013-03-29 19:44 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Mar 29, 2013 at 04:37:17PM -0300, Ezequiel Garcia wrote:
> On Fri, Mar 29, 2013 at 11:09:23AM -0700, Ryan Press wrote:
> > Hi Jason,
> > 
> > On Fri, Mar 29, 2013 at 11:04 AM, Jason Cooper <jason@lakedaemon.net> wrote:
> > > On Fri, Mar 29, 2013 at 10:51:17AM -0700, Ryan Press wrote:
> > >> 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.
> > >>
> > >> Signed-off-by: Ryan Press <ryan@presslab.us>
> > >> ---
> > >>  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.

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.

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

* [PATCH] arm: mvebu: Fix the memory size on the Mirabox
  2013-03-29 19:44       ` Jason Cooper
@ 2013-03-30  3:30         ` Ryan Press
  2013-03-30 19:20           ` Jason Cooper
  0 siblings, 1 reply; 12+ messages in thread
From: Ryan Press @ 2013-03-30  3:30 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Jason,

On Fri, Mar 29, 2013 at 12:44 PM, Jason Cooper <jason@lakedaemon.net> wrote:
> On Fri, Mar 29, 2013 at 04:37:17PM -0300, Ezequiel Garcia wrote:
>> On Fri, Mar 29, 2013 at 11:09:23AM -0700, Ryan Press wrote:
>> > On Fri, Mar 29, 2013 at 11:04 AM, Jason Cooper <jason@lakedaemon.net> wrote:
>> > > On Fri, Mar 29, 2013 at 10:51:17AM -0700, Ryan Press wrote:
>> > >> 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.
>> > >>
>> > >> Signed-off-by: Ryan Press <ryan@presslab.us>
>> > >> ---
>> > >>  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.
>
> 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

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

* [PATCH] arm: mvebu: Fix the memory size on the Mirabox
  2013-03-30  3:30         ` Ryan Press
@ 2013-03-30 19:20           ` Jason Cooper
  2013-03-30 19:28             ` Jason Cooper
  2013-03-30 19:40             ` Ryan Press
  0 siblings, 2 replies; 12+ messages in thread
From: Jason Cooper @ 2013-03-30 19:20 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Mar 29, 2013 at 08:30:35PM -0700, Ryan Press wrote:
> On Fri, Mar 29, 2013 at 12:44 PM, Jason Cooper <jason@lakedaemon.net> wrote:
...
> > 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.

> 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.

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

hth,

Jason.

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

* [PATCH] arm: mvebu: Fix the memory size on the Mirabox
  2013-03-30 19:20           ` Jason Cooper
@ 2013-03-30 19:28             ` Jason Cooper
  2013-03-30 19:40             ` Ryan Press
  1 sibling, 0 replies; 12+ messages in thread
From: Jason Cooper @ 2013-03-30 19:28 UTC (permalink / raw)
  To: linux-arm-kernel

On Sat, Mar 30, 2013 at 03:20:30PM -0400, Jason Cooper wrote:
> On Fri, Mar 29, 2013 at 08:30:35PM -0700, Ryan Press wrote:
> > 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.

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

* [PATCH] arm: mvebu: Fix the memory size on the Mirabox
  2013-03-30 19:20           ` Jason Cooper
  2013-03-30 19:28             ` Jason Cooper
@ 2013-03-30 19:40             ` Ryan Press
  2013-03-30 20:12               ` Jason Cooper
  1 sibling, 1 reply; 12+ messages in thread
From: Ryan Press @ 2013-03-30 19:40 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Jason,

Thanks for your thoughts!

On Sat, Mar 30, 2013 at 12:20 PM, Jason Cooper <jason@lakedaemon.net> wrote:
> On Fri, Mar 29, 2013 at 08:30:35PM -0700, Ryan Press wrote:
>> On Fri, Mar 29, 2013 at 12:44 PM, Jason Cooper <jason@lakedaemon.net> wrote:
> ...
>> > 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.

>> 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.  :)

>> 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

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

* [PATCH] arm: mvebu: Fix the memory size on the Mirabox
  2013-03-30 19:40             ` Ryan Press
@ 2013-03-30 20:12               ` Jason Cooper
  0 siblings, 0 replies; 12+ messages in thread
From: Jason Cooper @ 2013-03-30 20:12 UTC (permalink / raw)
  To: linux-arm-kernel

On Sat, Mar 30, 2013 at 12:40:33PM -0700, Ryan Press wrote:
> 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).

> 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

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

* [PATCH] arm: mvebu: Fix the memory size on the Mirabox
  2013-03-29 19:37     ` Ezequiel Garcia
  2013-03-29 19:44       ` Jason Cooper
@ 2013-04-03 10:46       ` Thomas Petazzoni
  2013-04-04 13:55       ` Gregory CLEMENT
  2 siblings, 0 replies; 12+ messages in thread
From: Thomas Petazzoni @ 2013-04-03 10:46 UTC (permalink / raw)
  To: linux-arm-kernel

Dear Ezequiel Garcia,

On Fri, 29 Mar 2013 16:37:17 -0300, Ezequiel Garcia wrote:

> 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
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

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

* [PATCH] arm: mvebu: Fix the memory size on the Mirabox
  2013-03-29 19:37     ` Ezequiel Garcia
  2013-03-29 19:44       ` Jason Cooper
  2013-04-03 10:46       ` Thomas Petazzoni
@ 2013-04-04 13:55       ` Gregory CLEMENT
  2 siblings, 0 replies; 12+ messages in thread
From: Gregory CLEMENT @ 2013-04-04 13:55 UTC (permalink / raw)
  To: linux-arm-kernel

On 03/29/2013 08:37 PM, Ezequiel Garcia wrote:
> On Fri, Mar 29, 2013 at 11:09:23AM -0700, Ryan Press wrote:
>> Hi Jason,
>>
>> On Fri, Mar 29, 2013 at 11:04 AM, Jason Cooper <jason@lakedaemon.net> wrote:
>>> On Fri, Mar 29, 2013 at 10:51:17AM -0700, Ryan Press wrote:
>>>> 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.
>>>>
>>>> Signed-off-by: Ryan Press <ryan@presslab.us>
>>>> ---
>>>>  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?

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)

> 
> 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.
> 
>>> 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.
> 


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

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

end of thread, other threads:[~2013-04-04 13:55 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-29 17:51 [PATCH] arm: mvebu: Fix the memory size on the Mirabox Ryan Press
2013-03-29 18:04 ` Jason Cooper
2013-03-29 18:09   ` Ryan Press
2013-03-29 19:37     ` Ezequiel Garcia
2013-03-29 19:44       ` Jason Cooper
2013-03-30  3:30         ` Ryan Press
2013-03-30 19:20           ` Jason Cooper
2013-03-30 19:28             ` Jason Cooper
2013-03-30 19:40             ` Ryan Press
2013-03-30 20:12               ` Jason Cooper
2013-04-03 10:46       ` Thomas Petazzoni
2013-04-04 13:55       ` Gregory CLEMENT

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.