summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Graf <agraf@suse.de>2014-12-12 02:05:10 +0100
committerWei Xu <xuwei5@huawei.com>2014-12-17 16:57:00 +0800
commit09bb9ce8a13f962e686e9494ba2846a58e760b6c (patch)
treef53540a7d8dbd14f0e3f988ef0fe202b2f4c3b9a
parent1bf2674138346392644bd9108f7110e815289447 (diff)
HisiPkg: D01: Move bootwrapper and kernel offsets to header
We have 2 files that need to know the location of kernel and bootwrapper in the physical address layout. Move the definitions to a header file so both can use defines rather than hard coded values. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Wei Xu <xuwei5@huawei.com>
-rw-r--r--HisiPkg/D01BoardPkg/Bds/Bds.c6
-rw-r--r--HisiPkg/D01BoardPkg/Bds/BdsInternal.h6
-rw-r--r--HisiPkg/D01BoardPkg/Bds/BootMenu.c8
3 files changed, 10 insertions, 10 deletions
diff --git a/HisiPkg/D01BoardPkg/Bds/Bds.c b/HisiPkg/D01BoardPkg/Bds/Bds.c
index 600ae64c7..267bb4f71 100644
--- a/HisiPkg/D01BoardPkg/Bds/Bds.c
+++ b/HisiPkg/D01BoardPkg/Bds/Bds.c
@@ -72,12 +72,6 @@ BootGo (
);
//************************************************
-//address of Linux in DDR
-#define TEXT_DDR_BASE 0x10c00000
-#define MONITOR_DDR_BASE 0x10c08000
-#define KERNEL_DDR_BASE 0x10008000
-#define FILESYSTEM_DDR_BASE 0x10d00000
-
//estimate size of Linux kernel,the size for copying file to DDR isn't bigger than this
#define TEXT_SIZE 0x400000
#define MONITOR_SIZE 0x400000
diff --git a/HisiPkg/D01BoardPkg/Bds/BdsInternal.h b/HisiPkg/D01BoardPkg/Bds/BdsInternal.h
index 447b8c9cd..7481a8eaa 100644
--- a/HisiPkg/D01BoardPkg/Bds/BdsInternal.h
+++ b/HisiPkg/D01BoardPkg/Bds/BdsInternal.h
@@ -37,6 +37,12 @@
#define BOOT_DEVICE_OPTION_MAX 300
#define BOOT_DEVICE_ADDRESS_MAX (sizeof(L"0x0000000000000000"))
+//address of Linux in DDR
+#define TEXT_DDR_BASE 0x10c00000
+#define MONITOR_DDR_BASE 0x10c08000
+#define KERNEL_DDR_BASE 0x10008000
+#define FILESYSTEM_DDR_BASE 0x10d00000
+
#define ARM_BDS_OPTIONAL_DATA_SIGNATURE SIGNATURE_32('a', 'b', 'o', 'd')
#define IS_ARM_BDS_BOOTENTRY(ptr) \
diff --git a/HisiPkg/D01BoardPkg/Bds/BootMenu.c b/HisiPkg/D01BoardPkg/Bds/BootMenu.c
index c9cc4b08d..2bd84a024 100644
--- a/HisiPkg/D01BoardPkg/Bds/BootMenu.c
+++ b/HisiPkg/D01BoardPkg/Bds/BootMenu.c
@@ -772,14 +772,14 @@ BootLinuxAtagLoader (
EFI_STATUS LoadLinuxAtSecEnd()
{
- LinuxEntry entry = (LinuxEntry)(0x10c00000);
+ LinuxEntry entry = (LinuxEntry)(TEXT_DDR_BASE);
EFI_STATUS Status = EFI_SUCCESS;
ArmDisableDataCache();
ArmCleanInvalidateDataCache();
ArmDisableInstructionCache ();
ArmInvalidateInstructionCache ();
ArmDisableMmu();
- DEBUG(( EFI_D_ERROR, "MOVE PC 0x10c00000\n"));
+ DEBUG(( EFI_D_ERROR, "MOVE PC TEXT_DDR_BASE\n"));
(void)entry();
return Status;
}
@@ -798,8 +798,8 @@ BootGo (
*(UINTN*)(UINTN)(0xe302b000 + 0x18) = 0;
*(UINTN*)(UINTN)(0xe302b000 + 0x1c) = 0;
-
- *(volatile UINT32 *)(0xe0000000 + 0x100) = 0x10c00000;
+
+ *(volatile UINT32 *)(0xe0000000 + 0x100) = TEXT_DDR_BASE;
ArmCleanDataCache();
*(UINT8*)(0xf4007000) = 'G';
Status = LoadLinuxAtSecEnd();