public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Michael Zimmermann <sigmaepsilon92@gmail.com>
To: edk2-devel-01 <edk2-devel@lists.01.org>,
	Ard Biesheuvel <ard.biesheuvel@linaro.org>
Subject: ARM PrePI Memory setup recommendations
Date: Sat, 6 Aug 2016 13:05:13 +0200	[thread overview]
Message-ID: <CAN9vWDLyoSqvMKj=GU_uKfB=px4k9uEAhSrD8XJm3c_59t2O6w@mail.gmail.com> (raw)

Hi,

I have some problems with my current setup and would like to ask you for
the best way to configure the following setup:
- I'm using PrePi, I don't need relocations because the loading address is
fixed(0xfe000000)
- The SystemMemory address range is unknown at compile time
- the system-memory consists of multiple ranges with holes so providing
just a base and a size is not enough
- There's no NOR, edk2 gets loaded into dram

my current setup:
PcdSystemMemoryBase = loading addr(0xfe000000)
PcdSystemMemorySize = 32MB
FD_BASE = PcdSystemMemoryBase
FD_SIZE = 4MB
in ArmPlatformGetVirtualMemoryMap I call BuildResourceDescriptorHob for all
DRAM memory ranges.
In PrePiMain after MemoryPeim I call BuildMemoryAllocationHob for some
reserved memory ranges

After running into out-of-memory errors during PrePi when using bigger FV's
I revisited everything and came across a PCD I somehow never looked at when
setting up my platform a year ago: PcdSystemMemoryUefiRegionSize.
this was hardcoded to 0x00e00000 which obviously caused allocation errors
while extracting big FV's even though PcdSystemMemorySize was big enough.

Since there already was this nice comment 'PcdSystemMemorySize - PcdFdSize'
I did exactly that: 32MB-4MB = 28MB.
Unfortunately after doing that MdeModulePkg/Core/Dxe/Gcd/Gcd.c starts
bugging that he can't find a resource hob that contains the PHIT Hob.

So now that my setup and problems are clear, the questions:
- Is it ok to define ResourceHob's that cover the PcdSystemMemory range?
- what can I do to fix the PHIT Hob problem? should PcdFdSize +
PcdSystemMemoryUefiRegionSize be smaller than PcdSystemMemorySize ?
- I took a quick look at ArmVirt where they change the PcdSystemMemory
range at runtime, but they use lots of custom code like their own
MemoryPeiLib, and I think everything but Xen uses PEIM instead of PrePi.
Also as I said I have more than one range so this would work anyway.

Thanks
Michael


             reply	other threads:[~2016-08-06 11:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-06 11:05 Michael Zimmermann [this message]
2016-08-08  8:50 ` ARM PrePI Memory setup recommendations Ard Biesheuvel
2016-08-08  9:18   ` Michael Zimmermann
2016-08-08  9:25     ` Ard Biesheuvel
2016-08-08 11:34       ` Michael Zimmermann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAN9vWDLyoSqvMKj=GU_uKfB=px4k9uEAhSrD8XJm3c_59t2O6w@mail.gmail.com' \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox