Caesar Wang | b400374 | 2016-10-12 08:10:12 +0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2016, ARM Limited and Contributors. All rights reserved. |
| 3 | * |
dp-arm | fa3cf0b | 2017-05-03 09:38:09 +0100 | [diff] [blame] | 4 | * SPDX-License-Identifier: BSD-3-Clause |
Caesar Wang | b400374 | 2016-10-12 08:10:12 +0800 | [diff] [blame] | 5 | */ |
| 6 | |
| 7 | /* convoluted way to make sure that the define is pasted just the right way */ |
Lin Huang | 00960ba | 2018-04-20 15:55:21 +0800 | [diff] [blame] | 8 | #define _INCBIN(file, sym, sec) \ |
Caesar Wang | b400374 | 2016-10-12 08:10:12 +0800 | [diff] [blame] | 9 | __asm__( \ |
Lin Huang | 00960ba | 2018-04-20 15:55:21 +0800 | [diff] [blame] | 10 | ".section " #sec "\n" \ |
Caesar Wang | b400374 | 2016-10-12 08:10:12 +0800 | [diff] [blame] | 11 | ".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 Huang | 00960ba | 2018-04-20 15:55:21 +0800 | [diff] [blame] | 21 | #define INCBIN(file, sym, sec) _INCBIN(file, sym, sec) |
Caesar Wang | b400374 | 2016-10-12 08:10:12 +0800 | [diff] [blame] | 22 | |
Lin Huang | 00960ba | 2018-04-20 15:55:21 +0800 | [diff] [blame] | 23 | INCBIN(RK3399M0FW, rk3399m0_bin, ".sram.incbin"); |
| 24 | INCBIN(RK3399M0PMUFW, rk3399m0pmu_bin, ".pmusram.incbin"); |