blob: 0a47e70dcf7de1001183f16b79f15ca6d275ceae [file] [log] [blame]
Masahiro Yamada323d1f92015-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
10struct uniphier_board_data {
11 unsigned long dram_ch0_base;
12 unsigned long dram_ch0_size;
13 unsigned long dram_ch0_width;
14 unsigned long dram_ch1_base;
15 unsigned long dram_ch1_size;
16 unsigned long dram_ch1_width;
17 unsigned long dram_ch2_base;
18 unsigned long dram_ch2_size;
19 unsigned long dram_ch2_width;
20 unsigned int dram_freq;
21};
22
Masahiro Yamada6ba60fa2015-12-17 17:47:42 +090023const struct uniphier_board_data *uniphier_get_board_param(void);
Masahiro Yamada323d1f92015-09-22 00:27:39 +090024
25int ph1_sld3_init(const struct uniphier_board_data *bd);
26int ph1_ld4_init(const struct uniphier_board_data *bd);
27int ph1_pro4_init(const struct uniphier_board_data *bd);
28int ph1_sld8_init(const struct uniphier_board_data *bd);
Masahiro Yamada28f40d42015-09-22 00:27:40 +090029int ph1_pro5_init(const struct uniphier_board_data *bd);
Masahiro Yamada019df872015-09-22 00:27:41 +090030int proxstream2_init(const struct uniphier_board_data *bd);
Masahiro Yamada323d1f92015-09-22 00:27:39 +090031
32#if defined(CONFIG_MICRO_SUPPORT_CARD)
33int ph1_sld3_sbc_init(const struct uniphier_board_data *bd);
34int ph1_ld4_sbc_init(const struct uniphier_board_data *bd);
35int ph1_pro4_sbc_init(const struct uniphier_board_data *bd);
Masahiro Yamada019df872015-09-22 00:27:41 +090036int proxstream2_sbc_init(const struct uniphier_board_data *bd);
Masahiro Yamada323d1f92015-09-22 00:27:39 +090037#else
38static inline int ph1_sld3_sbc_init(const struct uniphier_board_data *bd)
39{
40 return 0;
41}
42
43static inline int ph1_ld4_sbc_init(const struct uniphier_board_data *bd)
44{
45 return 0;
46}
47
48static inline int ph1_pro4_sbc_init(const struct uniphier_board_data *bd)
49{
50 return 0;
51}
Masahiro Yamada019df872015-09-22 00:27:41 +090052
53static inline int proxstream2_sbc_init(const struct uniphier_board_data *bd)
54{
55 return 0;
56}
Masahiro Yamada323d1f92015-09-22 00:27:39 +090057#endif
58
59int ph1_sld3_bcu_init(const struct uniphier_board_data *bd);
60int ph1_ld4_bcu_init(const struct uniphier_board_data *bd);
61
62int memconf_init(const struct uniphier_board_data *bd);
63int ph1_sld3_memconf_init(const struct uniphier_board_data *bd);
Masahiro Yamada019df872015-09-22 00:27:41 +090064int proxstream2_memconf_init(const struct uniphier_board_data *bd);
Masahiro Yamada323d1f92015-09-22 00:27:39 +090065
66int ph1_sld3_pll_init(const struct uniphier_board_data *bd);
67int ph1_ld4_pll_init(const struct uniphier_board_data *bd);
68int ph1_pro4_pll_init(const struct uniphier_board_data *bd);
69int ph1_sld8_pll_init(const struct uniphier_board_data *bd);
70
71int ph1_sld3_enable_dpll_ssc(const struct uniphier_board_data *bd);
72int ph1_ld4_enable_dpll_ssc(const struct uniphier_board_data *bd);
73
74int ph1_ld4_early_clk_init(const struct uniphier_board_data *bd);
Masahiro Yamada28f40d42015-09-22 00:27:40 +090075int ph1_pro5_early_clk_init(const struct uniphier_board_data *bd);
Masahiro Yamada019df872015-09-22 00:27:41 +090076int proxstream2_early_clk_init(const struct uniphier_board_data *bd);
Masahiro Yamada323d1f92015-09-22 00:27:39 +090077
78int ph1_sld3_early_pin_init(const struct uniphier_board_data *bd);
79
80int ph1_ld4_umc_init(const struct uniphier_board_data *bd);
81int ph1_pro4_umc_init(const struct uniphier_board_data *bd);
82int ph1_sld8_umc_init(const struct uniphier_board_data *bd);
Masahiro Yamada15607d02016-01-09 01:51:14 +090083int proxstream2_umc_init(const struct uniphier_board_data *bd);
Masahiro Yamada323d1f92015-09-22 00:27:39 +090084
85void ph1_sld3_pin_init(void);
86void ph1_ld4_pin_init(void);
87void ph1_pro4_pin_init(void);
88void ph1_sld8_pin_init(void);
Masahiro Yamada28f40d42015-09-22 00:27:40 +090089void ph1_pro5_pin_init(void);
Masahiro Yamada019df872015-09-22 00:27:41 +090090void proxstream2_pin_init(void);
91void ph1_ld6b_pin_init(void);
Masahiro Yamada323d1f92015-09-22 00:27:39 +090092
93void ph1_ld4_clk_init(void);
94void ph1_pro4_clk_init(void);
Masahiro Yamada28f40d42015-09-22 00:27:40 +090095void ph1_pro5_clk_init(void);
Masahiro Yamada019df872015-09-22 00:27:41 +090096void proxstream2_clk_init(void);
Masahiro Yamada323d1f92015-09-22 00:27:39 +090097
98#define pr_err(fmt, args...) printf(fmt, ##args)
99
100#endif /* __MACH_INIT_H */