~funderscore blog cgit wiki get in touch
aboutsummaryrefslogtreecommitdiff
blob: b7dfbda3926f2c0067a19a19f0226efb8460fdff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// SPDX-License-Identifier: GPL-2.0+
/*
 * Copyright (C) 2021 Marvell International Ltd.
 */

/* Common definitions used by Armada 7K/8K DTs */
#define PASTER(x, y)		x ## _ ## y
#define EVALUATOR(x, y)		PASTER(x, y)

/* This define used to create die label:
 * For example:
 * CP110 master:
 *     CP110_LABEL(spi0) -> cp0_spi0
 * CP110 slave:
 *     CP110_LABEL(usb0) -> cp1_usb0
 */
#define CP110_LABEL(name)	EVALUATOR(CP110_NAME, name)

#define APPEND_NX(A, B)		A ##-## B
#define APPEND(A, B)		APPEND_NX(A, B)

#define STRINGIZE_NX(x)		#x
#define STRINGIZE(x)		STRINGIZE_NX(x)

/* Same idea here, but this define convert the name to string:
 * For example:
 * master: CP110_STRING_LABEL(ppv2) -> "cp0-ppv2"
 * slave: CP110_STRING_LABEL(ppv2) -> "cp1-ppv2"
 */
#define CP110_STRING_LABEL(name)	STRINGIZE(APPEND(CP110_NAME, name))