blob: e969fd0c4ed638a5437af97aa5a80c56d3a77090 [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
Masahiro Yamada4021b432016-02-26 14:21:40 +090010#include <linux/types.h>
11
Masahiro Yamada46abfcc2016-02-26 14:21:34 +090012#define UNIPHIER_MAX_NR_DRAM_CH 3
13
14struct uniphier_dram_ch {
15 unsigned long base;
16 unsigned long size;
17 unsigned int width;
18};
19
Masahiro Yamada323d1f92015-09-22 00:27:39 +090020struct uniphier_board_data {
Masahiro Yamada46abfcc2016-02-26 14:21:34 +090021 unsigned int dram_freq;
22 unsigned int dram_nr_ch;
Masahiro Yamada4021b432016-02-26 14:21:40 +090023 bool dram_ddr3plus;
Masahiro Yamada46abfcc2016-02-26 14:21:34 +090024 struct uniphier_dram_ch dram_ch[UNIPHIER_MAX_NR_DRAM_CH];
Masahiro Yamada323d1f92015-09-22 00:27:39 +090025};
26
Masahiro Yamada6ba60fa2015-12-17 17:47:42 +090027const struct uniphier_board_data *uniphier_get_board_param(void);
Masahiro Yamada323d1f92015-09-22 00:27:39 +090028
29int ph1_sld3_init(const struct uniphier_board_data *bd);
30int ph1_ld4_init(const struct uniphier_board_data *bd);
31int ph1_pro4_init(const struct uniphier_board_data *bd);
32int ph1_sld8_init(const struct uniphier_board_data *bd);
Masahiro Yamada28f40d42015-09-22 00:27:40 +090033int ph1_pro5_init(const struct uniphier_board_data *bd);
Masahiro Yamada019df872015-09-22 00:27:41 +090034int proxstream2_init(const struct uniphier_board_data *bd);
Masahiro Yamada323d1f92015-09-22 00:27:39 +090035
36#if defined(CONFIG_MICRO_SUPPORT_CARD)
37int ph1_sld3_sbc_init(const struct uniphier_board_data *bd);
38int ph1_ld4_sbc_init(const struct uniphier_board_data *bd);
39int ph1_pro4_sbc_init(const struct uniphier_board_data *bd);
Masahiro Yamada019df872015-09-22 00:27:41 +090040int proxstream2_sbc_init(const struct uniphier_board_data *bd);
Masahiro Yamada323d1f92015-09-22 00:27:39 +090041#else
42static inline int ph1_sld3_sbc_init(const struct uniphier_board_data *bd)
43{
44 return 0;
45}
46
47static inline int ph1_ld4_sbc_init(const struct uniphier_board_data *bd)
48{
49 return 0;
50}
51
52static inline int ph1_pro4_sbc_init(const struct uniphier_board_data *bd)
53{
54 return 0;
55}
Masahiro Yamada019df872015-09-22 00:27:41 +090056
57static inline int proxstream2_sbc_init(const struct uniphier_board_data *bd)
58{
59 return 0;
60}
Masahiro Yamada323d1f92015-09-22 00:27:39 +090061#endif
62
63int ph1_sld3_bcu_init(const struct uniphier_board_data *bd);
64int ph1_ld4_bcu_init(const struct uniphier_board_data *bd);
65
66int memconf_init(const struct uniphier_board_data *bd);
67int ph1_sld3_memconf_init(const struct uniphier_board_data *bd);
Masahiro Yamada019df872015-09-22 00:27:41 +090068int proxstream2_memconf_init(const struct uniphier_board_data *bd);
Masahiro Yamada323d1f92015-09-22 00:27:39 +090069
70int ph1_sld3_pll_init(const struct uniphier_board_data *bd);
71int ph1_ld4_pll_init(const struct uniphier_board_data *bd);
72int ph1_pro4_pll_init(const struct uniphier_board_data *bd);
73int ph1_sld8_pll_init(const struct uniphier_board_data *bd);
74
75int ph1_sld3_enable_dpll_ssc(const struct uniphier_board_data *bd);
76int ph1_ld4_enable_dpll_ssc(const struct uniphier_board_data *bd);
77
78int ph1_ld4_early_clk_init(const struct uniphier_board_data *bd);
Masahiro Yamada28f40d42015-09-22 00:27:40 +090079int ph1_pro5_early_clk_init(const struct uniphier_board_data *bd);
Masahiro Yamada019df872015-09-22 00:27:41 +090080int proxstream2_early_clk_init(const struct uniphier_board_data *bd);
Masahiro Yamada323d1f92015-09-22 00:27:39 +090081
82int ph1_sld3_early_pin_init(const struct uniphier_board_data *bd);
83
84int ph1_ld4_umc_init(const struct uniphier_board_data *bd);
85int ph1_pro4_umc_init(const struct uniphier_board_data *bd);
86int ph1_sld8_umc_init(const struct uniphier_board_data *bd);
Masahiro Yamada15607d02016-01-09 01:51:14 +090087int proxstream2_umc_init(const struct uniphier_board_data *bd);
Masahiro Yamada323d1f92015-09-22 00:27:39 +090088
89void ph1_sld3_pin_init(void);
90void ph1_ld4_pin_init(void);
91void ph1_pro4_pin_init(void);
92void ph1_sld8_pin_init(void);
Masahiro Yamada28f40d42015-09-22 00:27:40 +090093void ph1_pro5_pin_init(void);
Masahiro Yamada019df872015-09-22 00:27:41 +090094void proxstream2_pin_init(void);
95void ph1_ld6b_pin_init(void);
Masahiro Yamada323d1f92015-09-22 00:27:39 +090096
97void ph1_ld4_clk_init(void);
98void ph1_pro4_clk_init(void);
Masahiro Yamada28f40d42015-09-22 00:27:40 +090099void ph1_pro5_clk_init(void);
Masahiro Yamada019df872015-09-22 00:27:41 +0900100void proxstream2_clk_init(void);
Masahiro Yamada323d1f92015-09-22 00:27:39 +0900101
102#define pr_err(fmt, args...) printf(fmt, ##args)
103
104#endif /* __MACH_INIT_H */