mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-12-30 18:41:11 +00:00
This patch allows a board to include another RW image in ec.bin. The size of each copy is a quarter of the flash size on Fizz. BUG=b:38462249 BRANCH=none CQ-DEPEND=CL:568297 TEST=Run sysjump RW/A/B. Verify there is no size change by running make savesizes/newsizes. Run objdump -h build/fizz/ec.obj: Idx Name Size VMA LMA File off Algn 0 .image.RO 0001700c 10088000 10088000 00008000 2**0 CONTENTS, ALLOC, LOAD, READONLY, CODE 1 .image.RO.key 00000340 1009f00c 100a7c40 0001f00c 2**0 CONTENTS, ALLOC, LOAD, READONLY, DATA 2 .image.RW 00016ddc 1009f34c 100c8000 0001f34c 2**0 CONTENTS, ALLOC, LOAD, READONLY, CODE 3 .image.RW.sign 000001b8 100b6128 100e7c00 00036128 2**0 CONTENTS, ALLOC, LOAD, READONLY, DATA 4 .image.RW_B 00016ddc 100b62e0 100e8000 000362e0 2**0 CONTENTS, ALLOC, LOAD, READONLY, CODE 5 .image.RW_B.sign 000001b8 100cd0bc 10107c00 0004d0bc 2**0 CONTENTS, ALLOC, LOAD, READONLY, DATA 6 .padding 00000001 100cd274 10107fff 0004d274 2**0 CONTENTS, ALLOC, LOAD, DATA 7 .ARM.attributes 00000014 00000000 00000000 0004d275 2**0 CONTENTS, READONLY Change-Id: Iaa687c1d7d704fec4cccfa127376c8db102267fa Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/557305 Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
70 lines
1.7 KiB
ArmAsm
70 lines
1.7 KiB
ArmAsm
/* Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
* found in the LICENSE file.
|
|
*
|
|
* Build the full image with up to three program components (one Read only,
|
|
* and one or two Read write).
|
|
*/
|
|
|
|
#include "config.h"
|
|
#include "rollback.h"
|
|
|
|
#define FW_FILE(builddir,proj,sect,suffix,ext) \
|
|
builddir##/##sect##/##proj##.##sect##suffix##.flat##ext
|
|
|
|
#define STRINGIFY0(name) #name
|
|
#define STRINGIFY(name) STRINGIFY0(name)
|
|
#define FW_IMAGE(sect,suffix) \
|
|
STRINGIFY(FW_FILE(FINAL_OUTDIR,PROJECT,sect,suffix,))
|
|
#define FW_IMAGE_SIGN(sect,suffix) \
|
|
STRINGIFY(FW_FILE(FINAL_OUTDIR,PROJECT,sect,suffix,.sig))
|
|
|
|
/* Read Only firmware */
|
|
#ifdef CONFIG_FW_INCLUDE_RO
|
|
.section .image.RO, "ax"
|
|
.incbin FW_IMAGE(RO,)
|
|
#endif
|
|
|
|
#ifdef CONFIG_RWSIG_TYPE_RWSIG
|
|
.section .image.RO.key, "a"
|
|
.incbin STRINGIFY(FINAL_OUTDIR/key.vbpubk2)
|
|
#endif
|
|
|
|
#ifdef CONFIG_ROLLBACK
|
|
/* Note: matches struct rollback_data in common/rollback.c. */
|
|
.section .image.ROLLBACK, "a"
|
|
.long 0
|
|
.long CONFIG_ROLLBACK_VERSION
|
|
#ifdef CONFIG_ROLLBACK_SECRET_SIZE
|
|
.space CONFIG_ROLLBACK_SECRET_SIZE, 0
|
|
#endif
|
|
.long CROS_EC_ROLLBACK_COOKIE
|
|
#endif
|
|
|
|
/* Shared objects library */
|
|
#ifdef CONFIG_SHAREDLIB
|
|
.section .image.libsharedobjs, "ax"
|
|
.incbin STRINGIFY(FINAL_OUTDIR/libsharedobjs/libsharedobjs.flat)
|
|
#endif
|
|
|
|
/* Read Write firmware */
|
|
.section .image.RW, "ax"
|
|
.incbin FW_IMAGE(RW,)
|
|
|
|
#ifdef CONFIG_RWSIG_TYPE_RWSIG
|
|
.section .image.RW.sign, "a"
|
|
.incbin FW_IMAGE_SIGN(RW,)
|
|
#endif
|
|
|
|
#ifdef CONFIG_RW_B
|
|
#ifdef CONFIG_RWSIG_TYPE_RWSIG
|
|
.section .image.RW_B, "ax"
|
|
.incbin FW_IMAGE(RW,)
|
|
.section .image.RW_B.sign, "a"
|
|
.incbin FW_IMAGE_SIGN(RW,)
|
|
#else
|
|
.section .image.RW_B, "ax"
|
|
.incbin FW_IMAGE(RW,_B)
|
|
#endif
|
|
#endif
|