blob: a09ad21e8796aaef10a06730b5c00598b5e24b8b [file] [log] [blame]
Caesar Wangb4003742016-10-12 08:10:12 +08001/*
2 * Copyright (c) 2016, ARM Limited and Contributors. All rights reserved.
3 *
dp-armfa3cf0b2017-05-03 09:38:09 +01004 * SPDX-License-Identifier: BSD-3-Clause
Caesar Wangb4003742016-10-12 08:10:12 +08005 */
6
7/* convoluted way to make sure that the define is pasted just the right way */
Lin Huang00960ba2018-04-20 15:55:21 +08008#define _INCBIN(file, sym, sec) \
Caesar Wangb4003742016-10-12 08:10:12 +08009 __asm__( \
Lin Huang00960ba2018-04-20 15:55:21 +080010 ".section " #sec "\n" \
Caesar Wangb4003742016-10-12 08:10:12 +080011 ".global " #sym "\n" \
12 ".type " #sym ", %object\n" \
13 ".align 4\n" \
14 #sym ":\n" \
15 ".incbin \"" #file "\"\n" \
16 ".size " #sym ", .-" #sym "\n" \
17 ".global " #sym "_end\n" \
18 #sym "_end:\n" \
19 )
20
Lin Huang00960ba2018-04-20 15:55:21 +080021#define INCBIN(file, sym, sec) _INCBIN(file, sym, sec)
Caesar Wangb4003742016-10-12 08:10:12 +080022
Lin Huang00960ba2018-04-20 15:55:21 +080023INCBIN(RK3399M0FW, rk3399m0_bin, ".sram.incbin");
24INCBIN(RK3399M0PMUFW, rk3399m0pmu_bin, ".pmusram.incbin");