summaryrefslogtreecommitdiffstats
path: root/arch/mips
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2019-03-12 16:11:22 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2019-03-13 10:24:52 +0100
commited04a7c3c8741204bf566f4662c7b56c409bbce3 (patch)
treec01e6ffe7ae4afc8f089619fef995d22f33c2c5c /arch/mips
parent369d39adfe79334db5ed04d6f2acaf096c68b8a2 (diff)
downloadbarebox-ed04a7c3c8741204bf566f4662c7b56c409bbce3.tar.gz
barebox-ed04a7c3c8741204bf566f4662c7b56c409bbce3.tar.xz
pbl multiimage: Allow to check image sizes
PBL images are often constrained in size by limitations exposed by the SoCs SRAM size or partition sizes on the boot device. So far we tried to configure these limits in Kconfig, but with PBL multi images and thus different limitations for the different supported images this no longer works. This patch has another approach for it: During build time make variables containing the relevant sizes for each image are created. These are: PBL_CODE_SIZE_$(symbol) PBL_MEMORY_SIZE_$(symbol) PBL_IMAGE_SIZE_$(symbol) PBL_CODE_SIZE_$(symbol) contains the pure code size of the PBL, it should be smaller than the available SRAM during boot. Normally the PBL's bss segment also needs to be in the initial SRAM, for this case PBL_MEMORY_SIZE_$(symbol) is the relevant variable. PBL_IMAGE_SIZE_$(symbol) contains the full size of the PBL image including the compressed payload (but without any image headers created later by SoC specific image tools). $(symbol) is a placeholder for the start symbol used for this PBL image, thus for the i.MX53 QSB with entry start_imx53_loco PBL_CODE_SIZE_start_imx53_loco will be created. The images/Makefile.* can use these variables directly to check sizes or specify the same variables with a "MAX_" prefix. So when images/Makefile.imx specifies MAX_PBL_CODE_SIZE_start_imx53_loco = 0x10000 then the build system will make sure that the PBL code for the QSB will not get bigger than 64KiB. Also included in this patch are the size restrictions for the i.MX8MQ images as an example how to use this. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/mips')
-rw-r--r--arch/mips/lib/pbl.lds.S5
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/mips/lib/pbl.lds.S b/arch/mips/lib/pbl.lds.S
index 1f0285dd6f..f1752ec720 100644
--- a/arch/mips/lib/pbl.lds.S
+++ b/arch/mips/lib/pbl.lds.S
@@ -38,6 +38,8 @@ SECTIONS
. = ALIGN(4);
.data : { *(.data*) }
+ pbl_code_size = . - HEAD_TEXT_BASE;
+
. = ALIGN(4);
__piggydata_start = .;
.piggydata : {
@@ -45,9 +47,12 @@ SECTIONS
}
__piggydata_end = .;
+ pbl_image_size = . - HEAD_TEXT_BASE;
+
. = ALIGN(4);
__bss_start = .;
.bss : { *(.bss*) }
__bss_stop = .;
+ pbl_memory_size = . - HEAD_TEXT_BASE;
_end = .;
}