blob: aabd84a8ed63073f862f3993166800f93a3b744f [file] [log] [blame]
Masahiro Yamada75f16f82015-09-22 00:27:39 +09001/*
2 * Copyright (C) 2015 Masahiro Yamada <yamada.masahiro@socionext.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0+
5 */
6
7#ifndef __MACH_INIT_H
8#define __MACH_INIT_H
9
Masahiro Yamada799e6f22016-02-26 14:21:34 +090010#define UNIPHIER_MAX_NR_DRAM_CH 3
11
12struct uniphier_dram_ch {
13 unsigned long base;
14 unsigned long size;
15 unsigned int width;
16};
17
Masahiro Yamada75f16f82015-09-22 00:27:39 +090018struct uniphier_board_data {
Masahiro Yamada799e6f22016-02-26 14:21:34 +090019 unsigned int dram_freq;
20 unsigned int dram_nr_ch;
21 struct uniphier_dram_ch dram_ch[UNIPHIER_MAX_NR_DRAM_CH];
Masahiro Yamada75f16f82015-09-22 00:27:39 +090022};
23
Masahiro Yamadac93f2792015-12-17 17:47:42 +090024const struct uniphier_board_data *uniphier_get_board_param(void);
Masahiro Yamada75f16f82015-09-22 00:27:39 +090025
26int ph1_sld3_init(const struct uniphier_board_data *bd);
27int ph1_ld4_init(const struct uniphier_board_data *bd);
28int ph1_pro4_init(const struct uniphier_board_data *bd);
29int ph1_sld8_init(const struct uniphier_board_data *bd);
Masahiro Yamadad5167d52015-09-22 00:27:40 +090030int ph1_pro5_init(const struct uniphier_board_data *bd);
Masahiro Yamada1fe65d32015-09-22 00:27:41 +090031int proxstream2_init(const struct uniphier_board_data *bd);
Masahiro Yamada75f16f82015-09-22 00:27:39 +090032
33#if defined(CONFIG_MICRO_SUPPORT_CARD)
34int ph1_sld3_sbc_init(const struct uniphier_board_data *bd);
35int ph1_ld4_sbc_init(const struct uniphier_board_data *bd);
36int ph1_pro4_sbc_init(const struct uniphier_board_data *bd);
Masahiro Yamada1fe65d32015-09-22 00:27:41 +090037int proxstream2_sbc_init(const struct uniphier_board_data *bd);
Masahiro Yamada75f16f82015-09-22 00:27:39 +090038#else
39static inline int ph1_sld3_sbc_init(const struct uniphier_board_data *bd)
40{
41 return 0;
42}
43
44static inline int ph1_ld4_sbc_init(const struct uniphier_board_data *bd)
45{
46 return 0;
47}
48
49static inline int ph1_pro4_sbc_init(const struct uniphier_board_data *bd)
50{
51 return 0;
52}
Masahiro Yamada1fe65d32015-09-22 00:27:41 +090053
54static inline int proxstream2_sbc_init(const struct uniphier_board_data *bd)
55{
56 return 0;
57}
Masahiro Yamada75f16f82015-09-22 00:27:39 +090058#endif
59
60int ph1_sld3_bcu_init(const struct uniphier_board_data *bd);
61int ph1_ld4_bcu_init(const struct uniphier_board_data *bd);
62
63int memconf_init(const struct uniphier_board_data *bd);
64int ph1_sld3_memconf_init(const struct uniphier_board_data *bd);
Masahiro Yamada1fe65d32015-09-22 00:27:41 +090065int proxstream2_memconf_init(const struct uniphier_board_data *bd);
Masahiro Yamada75f16f82015-09-22 00:27:39 +090066
67int ph1_sld3_pll_init(const struct uniphier_board_data *bd);
68int ph1_ld4_pll_init(const struct uniphier_board_data *bd);
69int ph1_pro4_pll_init(const struct uniphier_board_data *bd);
70int ph1_sld8_pll_init(const struct uniphier_board_data *bd);
71
72int ph1_sld3_enable_dpll_ssc(const struct uniphier_board_data *bd);
73int ph1_ld4_enable_dpll_ssc(const struct uniphier_board_data *bd);
74
75int ph1_ld4_early_clk_init(const struct uniphier_board_data *bd);
Masahiro Yamadad5167d52015-09-22 00:27:40 +090076int ph1_pro5_early_clk_init(const struct uniphier_board_data *bd);
Masahiro Yamada1fe65d32015-09-22 00:27:41 +090077int proxstream2_early_clk_init(const struct uniphier_board_data *bd);
Masahiro Yamada75f16f82015-09-22 00:27:39 +090078
79int ph1_sld3_early_pin_init(const struct uniphier_board_data *bd);
80
81int ph1_ld4_umc_init(const struct uniphier_board_data *bd);
82int ph1_pro4_umc_init(const struct uniphier_board_data *bd);
83int ph1_sld8_umc_init(const struct uniphier_board_data *bd);
Masahiro Yamada95e74872016-01-09 01:51:14 +090084int proxstream2_umc_init(const struct uniphier_board_data *bd);
Masahiro Yamada75f16f82015-09-22 00:27:39 +090085
86void ph1_sld3_pin_init(void);
87void ph1_ld4_pin_init(void);
88void ph1_pro4_pin_init(void);
89void ph1_sld8_pin_init(void);
Masahiro Yamadad5167d52015-09-22 00:27:40 +090090void ph1_pro5_pin_init(void);
Masahiro Yamada1fe65d32015-09-22 00:27:41 +090091void proxstream2_pin_init(void);
92void ph1_ld6b_pin_init(void);
Masahiro Yamada75f16f82015-09-22 00:27:39 +090093
94void ph1_ld4_clk_init(void);
95void ph1_pro4_clk_init(void);
Masahiro Yamadad5167d52015-09-22 00:27:40 +090096void ph1_pro5_clk_init(void);
Masahiro Yamada1fe65d32015-09-22 00:27:41 +090097void proxstream2_clk_init(void);
Masahiro Yamada75f16f82015-09-22 00:27:39 +090098
99#define pr_err(fmt, args...) printf(fmt, ##args)
100
101#endif /* __MACH_INIT_H */