0
0
mirror of https://github.com/libretro/Lakka-LibreELEC.git synced 2025-03-01 11:31:22 +00:00
Lakka-LibreELEC/projects/Allwinner/devices/H3/patches/u-boot/0006-Makefile-Add-support-for-building-a-sunxi-resume-shi.patch
2021-01-30 12:37:36 +01:00

45 lines
1.1 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Sat, 12 Dec 2020 23:55:04 -0600
Subject: [PATCH] Makefile: Add support for building a sunxi resume shim
---
.gitignore | 1 +
Makefile | 15 +++++++++++++++
2 files changed, 16 insertions(+)
--- a/.gitignore
+++ b/.gitignore
@@ -44,6 +44,7 @@ fit-dtb.blob*
/u-boot*
/boards.cfg
/*.log
+/resume.*
#
# git files that we don't want to ignore even it they are dot-files
--- a/Makefile
+++ b/Makefile
@@ -961,6 +961,21 @@ INPUTS-$(CONFIG_X86) += u-boot-x86-start
$(if $(CONFIG_SPL_X86_16BIT_INIT),spl/u-boot-spl.bin) \
$(if $(CONFIG_TPL_X86_16BIT_INIT),tpl/u-boot-tpl.bin)
+INPUTS-$(CONFIG_ARCH_SUNXI) += resume.egon
+
+MKIMAGEFLAGS_resume.egon := -T sunxi_egon
+
+resume.egon: resume.bin
+ $(call if_changed,mkimage)
+
+OBJCOPYFLAGS_resume.bin := -O binary
+
+resume.bin: resume.o
+ $(call if_changed,objcopy)
+
+resume.S: u-boot
+ @sed -En 's/(0x[[:xdigit:]]+) +psci_cpu_entry/ldr pc, =\1/p' $<.map > $@
+
LDFLAGS_u-boot += $(LDFLAGS_FINAL)
# Avoid 'Not enough room for program headers' error on binutils 2.28 onwards.