Skip to content

Commit 24a4a29

Browse files
zongboxbebarino
authored andcommitted
clk: sifive: Add SoCs prefix in each SoCs-dependent data
This patch is prerequisite for moving SoCs C files into SoCs header files. Currently, fu540-prci.c and fu740-prci.c use same names for several macro definitions and variables, it would cause redefinition error when we trying to include all stuff in sifive-prci.c. In this patch, we also remove the temporary macro definitions which are added by previous patch. Signed-off-by: Zong Li <[email protected]> Acked-by: Palmer Dabbelt <[email protected]> Link: https://lore.kernel.org/r/7728ef662c59449ce954b1b62c6ad5241e07adfb.1646388139.git.zong.li@sifive.com Signed-off-by: Stephen Boyd <[email protected]>
1 parent 990d627 commit 24a4a29

File tree

2 files changed

+35
-50
lines changed

2 files changed

+35
-50
lines changed

drivers/clk/sifive/fu540-prci.c

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// SPDX-License-Identifier: GPL-2.0
22
/*
3-
* Copyright (C) 2018-2019 SiFive, Inc.
3+
* Copyright (C) 2018-2022 SiFive, Inc.
44
* Copyright (C) 2018-2019 Wesley Terpstra
55
* Copyright (C) 2018-2019 Paul Walmsley
6-
* Copyright (C) 2020 Zong Li
6+
* Copyright (C) 2020-2022 Zong Li
77
*
88
* The FU540 PRCI implements clock and reset control for the SiFive
99
* FU540-C000 chip. This driver assumes that it has sole control
@@ -22,26 +22,21 @@
2222

2323
#include "sifive-prci.h"
2424

25-
#define PRCI_CLK_COREPLL 0
26-
#define PRCI_CLK_DDRPLL 1
27-
#define PRCI_CLK_GEMGXLPLL 2
28-
#define PRCI_CLK_TLCLK 3
29-
3025
/* PRCI integration data for each WRPLL instance */
3126

32-
static struct __prci_wrpll_data __prci_corepll_data = {
27+
static struct __prci_wrpll_data sifive_fu540_prci_corepll_data = {
3328
.cfg0_offs = PRCI_COREPLLCFG0_OFFSET,
3429
.cfg1_offs = PRCI_COREPLLCFG1_OFFSET,
3530
.enable_bypass = sifive_prci_coreclksel_use_hfclk,
3631
.disable_bypass = sifive_prci_coreclksel_use_corepll,
3732
};
3833

39-
static struct __prci_wrpll_data __prci_ddrpll_data = {
34+
static struct __prci_wrpll_data sifive_fu540_prci_ddrpll_data = {
4035
.cfg0_offs = PRCI_DDRPLLCFG0_OFFSET,
4136
.cfg1_offs = PRCI_DDRPLLCFG1_OFFSET,
4237
};
4338

44-
static struct __prci_wrpll_data __prci_gemgxlpll_data = {
39+
static struct __prci_wrpll_data sifive_fu540_prci_gemgxlpll_data = {
4540
.cfg0_offs = PRCI_GEMGXLPLLCFG0_OFFSET,
4641
.cfg1_offs = PRCI_GEMGXLPLLCFG1_OFFSET,
4742
};
@@ -67,25 +62,25 @@ static const struct clk_ops sifive_fu540_prci_tlclksel_clk_ops = {
6762

6863
/* List of clock controls provided by the PRCI */
6964
struct __prci_clock __prci_init_clocks_fu540[] = {
70-
[PRCI_CLK_COREPLL] = {
65+
[FU540_PRCI_CLK_COREPLL] = {
7166
.name = "corepll",
7267
.parent_name = "hfclk",
7368
.ops = &sifive_fu540_prci_wrpll_clk_ops,
74-
.pwd = &__prci_corepll_data,
69+
.pwd = &sifive_fu540_prci_corepll_data,
7570
},
76-
[PRCI_CLK_DDRPLL] = {
71+
[FU540_PRCI_CLK_DDRPLL] = {
7772
.name = "ddrpll",
7873
.parent_name = "hfclk",
7974
.ops = &sifive_fu540_prci_wrpll_ro_clk_ops,
80-
.pwd = &__prci_ddrpll_data,
75+
.pwd = &sifive_fu540_prci_ddrpll_data,
8176
},
82-
[PRCI_CLK_GEMGXLPLL] = {
77+
[FU540_PRCI_CLK_GEMGXLPLL] = {
8378
.name = "gemgxlpll",
8479
.parent_name = "hfclk",
8580
.ops = &sifive_fu540_prci_wrpll_clk_ops,
86-
.pwd = &__prci_gemgxlpll_data,
81+
.pwd = &sifive_fu540_prci_gemgxlpll_data,
8782
},
88-
[PRCI_CLK_TLCLK] = {
83+
[FU540_PRCI_CLK_TLCLK] = {
8984
.name = "tlclk",
9085
.parent_name = "corepll",
9186
.ops = &sifive_fu540_prci_tlclksel_clk_ops,

drivers/clk/sifive/fu740-prci.c

Lines changed: 23 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-License-Identifier: GPL-2.0
22
/*
3-
* Copyright (C) 2020 SiFive, Inc.
4-
* Copyright (C) 2020 Zong Li
3+
* Copyright (C) 2020-2022 SiFive, Inc.
4+
* Copyright (C) 2020-2022 Zong Li
55
*/
66

77
#include <linux/module.h>
@@ -10,50 +10,40 @@
1010

1111
#include "sifive-prci.h"
1212

13-
#define PRCI_CLK_COREPLL 0
14-
#define PRCI_CLK_DDRPLL 1
15-
#define PRCI_CLK_GEMGXLPLL 2
16-
#define PRCI_CLK_DVFSCOREPLL 3
17-
#define PRCI_CLK_HFPCLKPLL 4
18-
#define PRCI_CLK_CLTXPLL 5
19-
#define PRCI_CLK_TLCLK 6
20-
#define PRCI_CLK_PCLK 7
21-
#define PRCI_CLK_PCIE_AUX 8
22-
2313
/* PRCI integration data for each WRPLL instance */
2414

25-
static struct __prci_wrpll_data __prci_corepll_data = {
15+
static struct __prci_wrpll_data sifive_fu740_prci_corepll_data = {
2616
.cfg0_offs = PRCI_COREPLLCFG0_OFFSET,
2717
.cfg1_offs = PRCI_COREPLLCFG1_OFFSET,
2818
.enable_bypass = sifive_prci_coreclksel_use_hfclk,
2919
.disable_bypass = sifive_prci_coreclksel_use_final_corepll,
3020
};
3121

32-
static struct __prci_wrpll_data __prci_ddrpll_data = {
22+
static struct __prci_wrpll_data sifive_fu740_prci_ddrpll_data = {
3323
.cfg0_offs = PRCI_DDRPLLCFG0_OFFSET,
3424
.cfg1_offs = PRCI_DDRPLLCFG1_OFFSET,
3525
};
3626

37-
static struct __prci_wrpll_data __prci_gemgxlpll_data = {
27+
static struct __prci_wrpll_data sifive_fu740_prci_gemgxlpll_data = {
3828
.cfg0_offs = PRCI_GEMGXLPLLCFG0_OFFSET,
3929
.cfg1_offs = PRCI_GEMGXLPLLCFG1_OFFSET,
4030
};
4131

42-
static struct __prci_wrpll_data __prci_dvfscorepll_data = {
32+
static struct __prci_wrpll_data sifive_fu740_prci_dvfscorepll_data = {
4333
.cfg0_offs = PRCI_DVFSCOREPLLCFG0_OFFSET,
4434
.cfg1_offs = PRCI_DVFSCOREPLLCFG1_OFFSET,
4535
.enable_bypass = sifive_prci_corepllsel_use_corepll,
4636
.disable_bypass = sifive_prci_corepllsel_use_dvfscorepll,
4737
};
4838

49-
static struct __prci_wrpll_data __prci_hfpclkpll_data = {
39+
static struct __prci_wrpll_data sifive_fu740_prci_hfpclkpll_data = {
5040
.cfg0_offs = PRCI_HFPCLKPLLCFG0_OFFSET,
5141
.cfg1_offs = PRCI_HFPCLKPLLCFG1_OFFSET,
5242
.enable_bypass = sifive_prci_hfpclkpllsel_use_hfclk,
5343
.disable_bypass = sifive_prci_hfpclkpllsel_use_hfpclkpll,
5444
};
5545

56-
static struct __prci_wrpll_data __prci_cltxpll_data = {
46+
static struct __prci_wrpll_data sifive_fu740_prci_cltxpll_data = {
5747
.cfg0_offs = PRCI_CLTXPLLCFG0_OFFSET,
5848
.cfg1_offs = PRCI_CLTXPLLCFG1_OFFSET,
5949
};
@@ -89,53 +79,53 @@ static const struct clk_ops sifive_fu740_prci_pcie_aux_clk_ops = {
8979

9080
/* List of clock controls provided by the PRCI */
9181
struct __prci_clock __prci_init_clocks_fu740[] = {
92-
[PRCI_CLK_COREPLL] = {
82+
[FU740_PRCI_CLK_COREPLL] = {
9383
.name = "corepll",
9484
.parent_name = "hfclk",
9585
.ops = &sifive_fu740_prci_wrpll_clk_ops,
96-
.pwd = &__prci_corepll_data,
86+
.pwd = &sifive_fu740_prci_corepll_data,
9787
},
98-
[PRCI_CLK_DDRPLL] = {
88+
[FU740_PRCI_CLK_DDRPLL] = {
9989
.name = "ddrpll",
10090
.parent_name = "hfclk",
10191
.ops = &sifive_fu740_prci_wrpll_ro_clk_ops,
102-
.pwd = &__prci_ddrpll_data,
92+
.pwd = &sifive_fu740_prci_ddrpll_data,
10393
},
104-
[PRCI_CLK_GEMGXLPLL] = {
94+
[FU740_PRCI_CLK_GEMGXLPLL] = {
10595
.name = "gemgxlpll",
10696
.parent_name = "hfclk",
10797
.ops = &sifive_fu740_prci_wrpll_clk_ops,
108-
.pwd = &__prci_gemgxlpll_data,
98+
.pwd = &sifive_fu740_prci_gemgxlpll_data,
10999
},
110-
[PRCI_CLK_DVFSCOREPLL] = {
100+
[FU740_PRCI_CLK_DVFSCOREPLL] = {
111101
.name = "dvfscorepll",
112102
.parent_name = "hfclk",
113103
.ops = &sifive_fu740_prci_wrpll_clk_ops,
114-
.pwd = &__prci_dvfscorepll_data,
104+
.pwd = &sifive_fu740_prci_dvfscorepll_data,
115105
},
116-
[PRCI_CLK_HFPCLKPLL] = {
106+
[FU740_PRCI_CLK_HFPCLKPLL] = {
117107
.name = "hfpclkpll",
118108
.parent_name = "hfclk",
119109
.ops = &sifive_fu740_prci_wrpll_clk_ops,
120-
.pwd = &__prci_hfpclkpll_data,
110+
.pwd = &sifive_fu740_prci_hfpclkpll_data,
121111
},
122-
[PRCI_CLK_CLTXPLL] = {
112+
[FU740_PRCI_CLK_CLTXPLL] = {
123113
.name = "cltxpll",
124114
.parent_name = "hfclk",
125115
.ops = &sifive_fu740_prci_wrpll_clk_ops,
126-
.pwd = &__prci_cltxpll_data,
116+
.pwd = &sifive_fu740_prci_cltxpll_data,
127117
},
128-
[PRCI_CLK_TLCLK] = {
118+
[FU740_PRCI_CLK_TLCLK] = {
129119
.name = "tlclk",
130120
.parent_name = "corepll",
131121
.ops = &sifive_fu740_prci_tlclksel_clk_ops,
132122
},
133-
[PRCI_CLK_PCLK] = {
123+
[FU740_PRCI_CLK_PCLK] = {
134124
.name = "pclk",
135125
.parent_name = "hfpclkpll",
136126
.ops = &sifive_fu740_prci_hfpclkplldiv_clk_ops,
137127
},
138-
[PRCI_CLK_PCIE_AUX] = {
128+
[FU740_PRCI_CLK_PCIE_AUX] = {
139129
.name = "pcie_aux",
140130
.parent_name = "hfclk",
141131
.ops = &sifive_fu740_prci_pcie_aux_clk_ops,

0 commit comments

Comments
 (0)