diff --git a/.gitignore b/.gitignore index f99e590..f4e115c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ #Build Script /uefi.img -/boot-a72q.img +/boot-a72q*.img /ramdisk /workspace diff --git a/GalaxyA72/GalaxyA72.dsc b/GalaxyA72/GalaxyA72.dsc index 2386e77..5ea277d 100644 --- a/GalaxyA72/GalaxyA72.dsc +++ b/GalaxyA72/GalaxyA72.dsc @@ -10,22 +10,6 @@ # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. # -################################################################################ -# -# Defines Section - statements that will be processed to create a Makefile. -# -################################################################################ -[Defines] - PLATFORM_NAME = GalaxyA72 - PLATFORM_GUID = 28f1a3bf-193a-47e3-a7b9-5a435eaab2ee - PLATFORM_VERSION = 0.1 - DSC_SPECIFICATION = 0x00010019 - OUTPUT_DIRECTORY = Build/$(PLATFORM_NAME) - SUPPORTED_ARCHITECTURES = AARCH64 - BUILD_TARGETS = DEBUG|RELEASE - SKUID_IDENTIFIER = DEFAULT - FLASH_DEFINITION = GalaxyA72/GalaxyA72.fdf - !include GalaxyA72/CommonDsc.dsc.inc [LibraryClasses.common] diff --git a/GalaxyA72/GalaxyA72_6G.dsc b/GalaxyA72/GalaxyA72_6G.dsc new file mode 100644 index 0000000..77925a8 --- /dev/null +++ b/GalaxyA72/GalaxyA72_6G.dsc @@ -0,0 +1,16 @@ +[Defines] + PLATFORM_NAME = GalaxyA72 + PLATFORM_GUID = 28f1a3bf-193a-47e3-a7b9-5a435eaab2ee + PLATFORM_VERSION = 0.1 + DSC_SPECIFICATION = 0x00010019 + OUTPUT_DIRECTORY = Build/$(PLATFORM_NAME) + SUPPORTED_ARCHITECTURES = AARCH64 + BUILD_TARGETS = DEBUG|RELEASE + SKUID_IDENTIFIER = DEFAULT + FLASH_DEFINITION = GalaxyA72/GalaxyA72.fdf + +!include GalaxyA72/GalaxyA72.dsc + +[PcdsFixedAtBuild.common] + # System Memory (6GB) + gArmTokenSpaceGuid.PcdSystemMemorySize|0x180000000 \ No newline at end of file diff --git a/GalaxyA72/GalaxyA72_8G.dsc b/GalaxyA72/GalaxyA72_8G.dsc new file mode 100644 index 0000000..3419375 --- /dev/null +++ b/GalaxyA72/GalaxyA72_8G.dsc @@ -0,0 +1,19 @@ +[Defines] + PLATFORM_NAME = GalaxyA72_8G + PLATFORM_GUID = 28f1a3bf-193a-47e3-a7b9-5a435eaab2ee + PLATFORM_VERSION = 0.1 + DSC_SPECIFICATION = 0x00010019 + OUTPUT_DIRECTORY = Build/$(PLATFORM_NAME) + SUPPORTED_ARCHITECTURES = AARCH64 + BUILD_TARGETS = DEBUG|RELEASE + SKUID_IDENTIFIER = DEFAULT + FLASH_DEFINITION = GalaxyA72/GalaxyA72.fdf + +!include GalaxyA72/GalaxyA72.dsc + +[BuildOptions.common] + GCC:*_*_AARCH64_CC_FLAGS = -DMEMORY_8G + +[PcdsFixedAtBuild.common] + # System Memory (8GB) + gArmTokenSpaceGuid.PcdSystemMemorySize|0x200000000 \ No newline at end of file diff --git a/GalaxyA72/Include/Configuration/DeviceMemoryMap.h b/GalaxyA72/Include/Configuration/DeviceMemoryMap.h index 129675d..39f4c9d 100644 --- a/GalaxyA72/Include/Configuration/DeviceMemoryMap.h +++ b/GalaxyA72/Include/Configuration/DeviceMemoryMap.h @@ -30,9 +30,15 @@ static ARM_MEMORY_REGION_DESCRIPTOR_EX gDeviceMemoryDescriptorEx[] = { /* Address, Length, ResourceType, Resource Attribute, ARM MMU Attribute, HobOption, EFI Memory Type */ + #ifdef MEMORY_8G + {0xC0000000, 0x1C0000000, EFI_RESOURCE_SYSTEM_MEMORY, + SYSTEM_MEMORY_RESOURCE_ATTR_CAPABILITIES, ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK, + AddMem, EfiConventionalMemory}, + #else {0xC0000000, 0x140000000, EFI_RESOURCE_SYSTEM_MEMORY, SYSTEM_MEMORY_RESOURCE_ATTR_CAPABILITIES, ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK, AddMem, EfiConventionalMemory}, + #endif /* HYP */ {0x80000000, 0x00600000, EFI_RESOURCE_MEMORY_RESERVED, diff --git a/README.md b/README.md index b8dc052..24e2b68 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,10 @@ Build ``` ./build.sh ``` +Or this for 8Gb RAM model +``` +./build_8G.sh +``` Flash ``` heimdall flash --BOOT boot-a72q.img diff --git a/build.sh b/build.sh index 62d17e6..e92adc0 100755 --- a/build.sh +++ b/build.sh @@ -3,7 +3,7 @@ set -e . build_common.sh # not actually GCC5; it's GCC7 on Ubuntu 18.04. -GCC5_AARCH64_PREFIX=aarch64-linux-gnu- build -s -n 0 -a AARCH64 -t GCC5 -p GalaxyA72/GalaxyA72.dsc -b RELEASE +GCC5_AARCH64_PREFIX=aarch64-linux-gnu- build -s -n 0 -a AARCH64 -t GCC5 -p GalaxyA72/GalaxyA72_6G.dsc -b RELEASE gzip -c < workspace/Build/GalaxyA72/RELEASE_GCC5/FV/GALAXYA72_UEFI.fd >uefi.img cat a72q.dtb >>uefi.img echo > ramdisk diff --git a/build_8G.sh b/build_8G.sh new file mode 100755 index 0000000..9391c61 --- /dev/null +++ b/build_8G.sh @@ -0,0 +1,10 @@ +#!/bin/bash +# based on the instructions from edk2-platform +set -e +. build_common.sh +# not actually GCC5; it's GCC7 on Ubuntu 18.04. +GCC5_AARCH64_PREFIX=aarch64-linux-gnu- build -s -n 0 -a AARCH64 -t GCC5 -p GalaxyA72/GalaxyA72_8G.dsc -b RELEASE +gzip -c < workspace/Build/GalaxyA72_8G/RELEASE_GCC5/FV/GALAXYA72_UEFI.fd >uefi.img +cat a72q.dtb >>uefi.img +echo > ramdisk +abootimg --create boot-a72q_8G.img -k uefi.img -r ramdisk \ No newline at end of file diff --git a/build_debug.sh b/build_debug.sh index 0ae884d..b57a347 100755 --- a/build_debug.sh +++ b/build_debug.sh @@ -3,8 +3,8 @@ set -e . build_common.sh # not actually GCC5; it's GCC7 on Ubuntu 18.04. -GCC5_AARCH64_PREFIX=aarch64-linux-gnu- build -s -n 0 -a AARCH64 -t GCC5 -p GalaxyA72/GalaxyA72.dsc +GCC5_AARCH64_PREFIX=aarch64-linux-gnu- build -s -n 0 -a AARCH64 -t GCC5 -p GalaxyA72/GalaxyA72_6G.dsc gzip -c < workspace/Build/GalaxyA72/DEBUG_GCC5/FV/GALAXYA72_UEFI.fd >uefi.img cat a72q.dtb >>uefi.img echo > ramdisk -abootimg --create boot-a72q.img -k uefi.img -r ramdisk \ No newline at end of file +abootimg --create boot-a72q_DEBUG.img -k uefi.img -r ramdisk \ No newline at end of file