All of lore.kernel.org
 help / color / mirror / Atom feed
* are there PHYS_OFFSET alignment requirements for ARM Linux?
@ 2012-07-18 23:32 John Linn
  2012-07-19 19:07 ` Nicolas Pitre
  0 siblings, 1 reply; 4+ messages in thread
From: John Linn @ 2012-07-18 23:32 UTC (permalink / raw)
  To: linux-arm-kernel

I have seen some mention of 2 MB alignment requirements, but it's not
clear to me if that's true or not (looks old)?

My apologies if it's obvious somewhere, but are there any alignment
requirements?

Thanks
John

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

* are there PHYS_OFFSET alignment requirements for ARM Linux?
  2012-07-18 23:32 are there PHYS_OFFSET alignment requirements for ARM Linux? John Linn
@ 2012-07-19 19:07 ` Nicolas Pitre
  2012-07-20  4:10   ` John Linn
  0 siblings, 1 reply; 4+ messages in thread
From: Nicolas Pitre @ 2012-07-19 19:07 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, 18 Jul 2012, John Linn wrote:

> I have seen some mention of 2 MB alignment requirements, but it's not
> clear to me if that's true or not (looks old)?
> 
> My apologies if it's obvious somewhere, but are there any alignment
> requirements?

There is a 2MB alignment requirement on PHYS_OFFSET.  You may play 
tricks with memory reservation if a smaller offset is required, but I'd 
recommend against that.  Even 2MB is too small an alignment if you want 
to have CONFIG_ARM_PATCH_PHYS_VIRT=y (the default) which requires a 16MB 
alignment.

It is very exceptional to see systems where RAM is not aligned to a much 
bigger boundary.  Why would you need a 2MB alignment?


Nicolas

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

* are there PHYS_OFFSET alignment requirements for ARM Linux?
  2012-07-19 19:07 ` Nicolas Pitre
@ 2012-07-20  4:10   ` John Linn
  2012-07-20 12:38     ` Nicolas Pitre
  0 siblings, 1 reply; 4+ messages in thread
From: John Linn @ 2012-07-20  4:10 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Jul 19, 2012 at 12:07 PM, Nicolas Pitre <nico@fluxnic.net> wrote:
> On Wed, 18 Jul 2012, John Linn wrote:
>
>> I have seen some mention of 2 MB alignment requirements, but it's not
>> clear to me if that's true or not (looks old)?
>>
>> My apologies if it's obvious somewhere, but are there any alignment
>> requirements?
>
> There is a 2MB alignment requirement on PHYS_OFFSET.  You may play
> tricks with memory reservation if a smaller offset is required, but I'd
> recommend against that.  Even 2MB is too small an alignment if you want
> to have CONFIG_ARM_PATCH_PHYS_VIRT=y (the default) which requires a 16MB
> alignment.
>

Thanks, it wasn't clear to me. If it's documented somewhere it would
be great to know where I overlooked it.

> It is very exceptional to see systems where RAM is not aligned to a much
> bigger boundary.  Why would you need a 2MB alignment?

Our DDR can be from anywhere from 0 to 1 GB address. Our platform
can't DMA to the lower 1MB and we have on chip memory (OCM) at 0.

We are currently starting DDR at 0, taking care of the DMA issue in
the kernel (kind of a pain) and moving OCM to higher address, but we'd
like to simplify our memory map so moving the start address of DDR to
1MB (or 2) would do that we were thinking.

I tested it at 1MB and it seemed fine with some simple boot testing,
but nothing exhaustive.  Sounds like a 2MB (rather than 1 MB) start
address would be wise.

Thanks,
John

>
>
> Nicolas

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

* are there PHYS_OFFSET alignment requirements for ARM Linux?
  2012-07-20  4:10   ` John Linn
@ 2012-07-20 12:38     ` Nicolas Pitre
  0 siblings, 0 replies; 4+ messages in thread
From: Nicolas Pitre @ 2012-07-20 12:38 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, 19 Jul 2012, John Linn wrote:

> On Thu, Jul 19, 2012 at 12:07 PM, Nicolas Pitre <nico@fluxnic.net> wrote:
> > On Wed, 18 Jul 2012, John Linn wrote:
> >
> >> I have seen some mention of 2 MB alignment requirements, but it's not
> >> clear to me if that's true or not (looks old)?
> >>
> >> My apologies if it's obvious somewhere, but are there any alignment
> >> requirements?
> >
> > There is a 2MB alignment requirement on PHYS_OFFSET.  You may play
> > tricks with memory reservation if a smaller offset is required, but I'd
> > recommend against that.  Even 2MB is too small an alignment if you want
> > to have CONFIG_ARM_PATCH_PHYS_VIRT=y (the default) which requires a 16MB
> > alignment.
> >
> 
> Thanks, it wasn't clear to me. If it's documented somewhere it would
> be great to know where I overlooked it.

I think this is not documented anywhere.  Only the code would tell.  And 
even then I'm not sure if a 1MB might be a problem or not, although I 
suspect it might.

With CONFIG_ARM_PATCH_PHYS_VIRT=y the requirement is really 16MB and 
that one is documented in the help text for that option.

> > It is very exceptional to see systems where RAM is not aligned to a much
> > bigger boundary.  Why would you need a 2MB alignment?
> 
> Our DDR can be from anywhere from 0 to 1 GB address. Our platform
> can't DMA to the lower 1MB and we have on chip memory (OCM) at 0.
> 
> We are currently starting DDR at 0, taking care of the DMA issue in
> the kernel (kind of a pain) and moving OCM to higher address, but we'd
> like to simplify our memory map so moving the start address of DDR to
> 1MB (or 2) would do that we were thinking.

Could you move it to 16MB?  That would be the simplest and most 
efficient location.


Nicolas

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

end of thread, other threads:[~2012-07-20 12:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-18 23:32 are there PHYS_OFFSET alignment requirements for ARM Linux? John Linn
2012-07-19 19:07 ` Nicolas Pitre
2012-07-20  4:10   ` John Linn
2012-07-20 12:38     ` Nicolas Pitre

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.