Konstantin Porotchkin | a0ba97e | 2021-01-17 17:19:49 +0200 | [diff] [blame^] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
| 2 | /* |
| 3 | * Copyright (C) 2021 Marvell International Ltd. |
| 4 | */ |
| 5 | |
| 6 | /* Common definitions used by Armada 7K/8K DTs */ |
| 7 | #define PASTER(x, y) x ## _ ## y |
| 8 | #define EVALUATOR(x, y) PASTER(x, y) |
| 9 | |
| 10 | /* This define used to create die label: |
| 11 | * For example: |
| 12 | * CP110 master: |
| 13 | * CP110_LABEL(spi0) -> cp0_spi0 |
| 14 | * CP110 slave: |
| 15 | * CP110_LABEL(usb0) -> cp1_usb0 |
| 16 | */ |
| 17 | #define CP110_LABEL(name) EVALUATOR(CP110_NAME, name) |
| 18 | |
| 19 | #define APPEND_NX(A, B) A ##-## B |
| 20 | #define APPEND(A, B) APPEND_NX(A, B) |
| 21 | |
| 22 | #define STRINGIZE_NX(x) #x |
| 23 | #define STRINGIZE(x) STRINGIZE_NX(x) |
| 24 | |
| 25 | /* Same idea here, but this define convert the name to string: |
| 26 | * For example: |
| 27 | * master: CP110_STRING_LABEL(ppv2) -> "cp0-ppv2" |
| 28 | * slave: CP110_STRING_LABEL(ppv2) -> "cp1-ppv2" |
| 29 | */ |
| 30 | #define CP110_STRING_LABEL(name) STRINGIZE(APPEND(CP110_NAME, name)) |