From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-x22c.google.com (mail-wm0-x22c.google.com [IPv6:2a00:1450:400c:c09::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 24C3E1A1DEF for ; Sat, 6 Aug 2016 04:05:16 -0700 (PDT) Received: by mail-wm0-x22c.google.com with SMTP id q128so58247708wma.1 for ; Sat, 06 Aug 2016 04:05:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to; bh=jIVF4XemYj0Nf+nDnGdV7DH1axdhIKuHE6tiHxtBXjA=; b=gpfoB8gpfc+Kcwm1xfsvyULRFJ8FMdZ7NbJo1D43gjfKKcA7FFXvGIKsnEZU6pPEAk So24WxsyUl82cmapo/NHQWYR+m2PvoRWlvSGtWG7bz5WvIqI8gi+8ULE4p6ZuM6AoBeE xh1zePWkUKakr0HVM6rcqvdJrdzOxUVurLt4MoOxlWUbcexoBqWDLAwg7jFAsA4ABG58 eyuQem9zNC2EYWBrT5SnCUEW77DTJGwBida0JRX7I4cG9dEPH447mlZAfq03p+nfTjNK 2A6ixLtWzgINnH95qHbMW3fRM1upMTYH8ZRUHw2+2d0WaKMwQHVbVUi1KSZodunZ6AhR fPuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=jIVF4XemYj0Nf+nDnGdV7DH1axdhIKuHE6tiHxtBXjA=; b=JLqDfhoGbQSMCySQOZnex6nYdNMQxmv4PhiOLuFAzMU9eDwWcHqpt5DQ9UXK9qqqav quzKBVQjR7kByQ6HuG8+eUlWklK6T4MLNXGCVtuvyIOm5bWH+zPJ+JiMr4T8u2ZXxUO7 TwqLfiMm8/u7t+6JjR4ipDW30Ykv2kOGc/UVGYiLfQpsnz4OIPcOgLQUtvCuOM4i+vdm kycb+w4lEqupxSJARqHO7SEgaBjoR5G/9wbWl3R9EuGjUFsvuSYI057HUXXc+8YG4xXt mBRZ/FGaLAKFCSeUDKpgkr80a/EBBv17zNrAGS7MJIVkuSPaceSniALYGv09cqyg6cfd E3nQ== X-Gm-Message-State: AEkoouuYfQ8KMUDUHJUQkGZiONrvMjcFqTr1U7kGewBJNIXVWEqOxuhB5vpmC6IZM25OhakB/nUyH+i2+LVAZw== X-Received: by 10.194.120.129 with SMTP id lc1mr75985133wjb.131.1470481514104; Sat, 06 Aug 2016 04:05:14 -0700 (PDT) MIME-Version: 1.0 Received: by 10.28.238.198 with HTTP; Sat, 6 Aug 2016 04:05:13 -0700 (PDT) From: Michael Zimmermann Date: Sat, 6 Aug 2016 13:05:13 +0200 Message-ID: To: edk2-devel-01 , Ard Biesheuvel X-Content-Filtered-By: Mailman/MimeDel 2.1.21 Subject: ARM PrePI Memory setup recommendations X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Aug 2016 11:05:16 -0000 Content-Type: text/plain; charset=UTF-8 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