public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Marcin Wojtas <mw@semihalf.com>
To: edk2-devel@lists.01.org
Cc: leif.lindholm@linaro.org, ard.biesheuvel@linaro.org,
	mw@semihalf.com, jsd@semihalf.com, jinghua@marvell.com,
	jaz@semihalf.com, davidsn@marvell.com
Subject: [platforms PATCH v3 1/5] Marvell/Armada70x0Db: Shift main FV from 0x0 address
Date: Mon,  4 Jun 2018 18:41:53 +0200	[thread overview]
Message-ID: <1528130517-11387-2-git-send-email-mw@semihalf.com> (raw)
In-Reply-To: <1528130517-11387-1-git-send-email-mw@semihalf.com>

When using PEI phase, UEFI interprets 0x0 address
of boot FV as an error. In order to avoid it, shift
it to 0x1000 and put a hardcoded 'jump to 0x1000' at
offset 0x0. This patch is a preparation for using PEI
by Armada platforms.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Marcin Wojtas <mw@semihalf.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
---
 Platform/Marvell/Armada70x0Db/Armada70x0Db.fdf | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/Platform/Marvell/Armada70x0Db/Armada70x0Db.fdf b/Platform/Marvell/Armada70x0Db/Armada70x0Db.fdf
index befb107..69cb4cd 100644
--- a/Platform/Marvell/Armada70x0Db/Armada70x0Db.fdf
+++ b/Platform/Marvell/Armada70x0Db/Armada70x0Db.fdf
@@ -49,7 +49,21 @@ NumBlocks     = 0x400
 #
 ################################################################################
 
-0x00000000|0x00100000
+#
+# UEFI has trouble dealing with FVs that reside at physical address 0x0.
+# So instead, put a hardcoded 'jump to 0x1000' at offset 0x0, and put the
+# real FV at offset 0x1000
+#
+0x00000000|0x00001000
+DATA = {
+!if $(ARCH) == AARCH64
+  0x00, 0x04, 0x00, 0x14   # 'b 0x1000' in AArch64 ASM
+!else
+  0xfe, 0x03, 0x00, 0xea   # 'b 0x1000' in AArch32 ASM
+!endif
+}
+
+0x00001000|0x000ff000
 gArmTokenSpaceGuid.PcdFvBaseAddress|gArmTokenSpaceGuid.PcdFvSize
 FV = FVMAIN_COMPACT
 
@@ -191,7 +205,6 @@ FvNameGuid         = 5eda4200-2c5f-43cb-9da3-0baf74b1b30c
 # PEI phase firmware volume
 [FV.FVMAIN_COMPACT]
 FvAlignment        = 8
-FvForceRebase      = TRUE
 ERASE_POLARITY     = 1
 MEMORY_MAPPED      = TRUE
 STICKY_WRITE       = TRUE
-- 
2.7.4



  reply	other threads:[~2018-06-04 16:42 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-04 16:41 [platforms PATCH v3 0/5] Armada capsule support Marcin Wojtas
2018-06-04 16:41 ` Marcin Wojtas [this message]
2018-06-04 16:41 ` [platforms PATCH v3 2/5] Marvell/Aramda7k8k: Enable PEI booting stage Marcin Wojtas
2018-06-04 16:41 ` [platforms PATCH v3 3/5] Marvell/Drivers: MvSpiFlashDxe: Add progress API Marcin Wojtas
2018-06-04 16:41 ` [platforms PATCH v3 4/5] Marvell/Armada7k8k: Introduce capsule FW update implementation Marcin Wojtas
2018-06-04 16:41 ` [platforms PATCH v3 5/5] Marvell/Armada7k8k: Wire up capsule support Marcin Wojtas
2018-06-04 16:47   ` Ard Biesheuvel
2018-06-04 16:58     ` Marcin Wojtas
2018-06-04 17:00       ` Ard Biesheuvel
2018-06-04 17:38       ` Leif Lindholm
2018-06-04 19:03         ` Marcin Wojtas

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=1528130517-11387-2-git-send-email-mw@semihalf.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