blob: 5a0ebeb1b1552efed42705da7b94732e5b37957d [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 Yamadaa5731882016-02-26 14:21:40 +090010#include <linux/types.h>
11
Masahiro Yamada799e6f22016-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 Yamada75f16f82015-09-22 00:27:39 +090020struct uniphier_board_data {
Masahiro Yamada799e6f22016-02-26 14:21:34 +090021 unsigned int dram_freq;
22 unsigned int dram_nr_ch;
Masahiro Yamadaa5731882016-02-26 14:21:40 +090023 bool dram_ddr3plus;
Masahiro Yamada799e6f22016-02-26 14:21:34 +090024 struct uniphier_dram_ch dram_ch[UNIPHIER_MAX_NR_DRAM_CH];
Masahiro Yamada75f16f82015-09-22 00:27:39 +090025};
26
Masahiro Yamadac93f2792015-12-17 17:47:42 +090027const struct uniphier_board_data *uniphier_get_board_param(void);
Masahiro Yamada75f16f82015-09-22 00:27:39 +090028
Masahiro Yamada98905692016-03-30 20:17:02 +090029int uniphier_sld3_init(const struct uniphier_board_data *bd);
30int uniphier_ld4_init(const struct uniphier_board_data *bd);
31int uniphier_pro4_init(const struct uniphier_board_data *bd);
32int uniphier_sld8_init(const struct uniphier_board_data *bd);
33int uniphier_pro5_init(const struct uniphier_board_data *bd);
34int uniphier_pxs2_init(const struct uniphier_board_data *bd);
Masahiro Yamada063eb1e2016-04-21 14:43:18 +090035int uniphier_ld20_init(const struct uniphier_board_data *bd);
Masahiro Yamada75f16f82015-09-22 00:27:39 +090036
37#if defined(CONFIG_MICRO_SUPPORT_CARD)
Masahiro Yamada98905692016-03-30 20:17:02 +090038int uniphier_sbc_init_admulti(const struct uniphier_board_data *bd);
39int uniphier_sbc_init_savepin(const struct uniphier_board_data *bd);
Masahiro Yamada7d600a62016-03-18 16:41:44 +090040int uniphier_sld3_sbc_init(const struct uniphier_board_data *bd);
41int uniphier_ld4_sbc_init(const struct uniphier_board_data *bd);
42int uniphier_pxs2_sbc_init(const struct uniphier_board_data *bd);
Masahiro Yamada75f16f82015-09-22 00:27:39 +090043#else
Masahiro Yamada98905692016-03-30 20:17:02 +090044static inline int uniphier_sbc_init_admulti(
45 const struct uniphier_board_data *bd)
Masahiro Yamada75f16f82015-09-22 00:27:39 +090046{
47 return 0;
48}
49
Masahiro Yamada98905692016-03-30 20:17:02 +090050static inline int uniphier_sbc_init_savepin(
51 const struct uniphier_board_data *bd)
Masahiro Yamada75f16f82015-09-22 00:27:39 +090052{
53 return 0;
54}
55
Masahiro Yamada7d600a62016-03-18 16:41:44 +090056static inline int uniphier_sld3_sbc_init(const struct uniphier_board_data *bd)
Masahiro Yamada75f16f82015-09-22 00:27:39 +090057{
58 return 0;
59}
Masahiro Yamada1fe65d32015-09-22 00:27:41 +090060
Masahiro Yamada7d600a62016-03-18 16:41:44 +090061static inline int uniphier_ld4_sbc_init(const struct uniphier_board_data *bd)
62{
63 return 0;
64}
65
66static inline int uniphier_pxs2_sbc_init(const struct uniphier_board_data *bd)
Masahiro Yamada1fe65d32015-09-22 00:27:41 +090067{
68 return 0;
69}
Masahiro Yamada75f16f82015-09-22 00:27:39 +090070#endif
71
Masahiro Yamada98905692016-03-30 20:17:02 +090072int uniphier_sld3_bcu_init(const struct uniphier_board_data *bd);
73int uniphier_ld4_bcu_init(const struct uniphier_board_data *bd);
Masahiro Yamada75f16f82015-09-22 00:27:39 +090074
75int memconf_init(const struct uniphier_board_data *bd);
Masahiro Yamada98905692016-03-30 20:17:02 +090076int uniphier_sld3_memconf_init(const struct uniphier_board_data *bd);
77int uniphier_pxs2_memconf_init(const struct uniphier_board_data *bd);
Masahiro Yamada75f16f82015-09-22 00:27:39 +090078
Masahiro Yamada98905692016-03-30 20:17:02 +090079int uniphier_sld3_pll_init(const struct uniphier_board_data *bd);
80int uniphier_ld4_pll_init(const struct uniphier_board_data *bd);
81int uniphier_pro4_pll_init(const struct uniphier_board_data *bd);
82int uniphier_sld8_pll_init(const struct uniphier_board_data *bd);
Masahiro Yamada75f16f82015-09-22 00:27:39 +090083
Masahiro Yamada98905692016-03-30 20:17:02 +090084int uniphier_sld3_enable_dpll_ssc(const struct uniphier_board_data *bd);
85int uniphier_ld4_enable_dpll_ssc(const struct uniphier_board_data *bd);
Masahiro Yamada75f16f82015-09-22 00:27:39 +090086
Masahiro Yamada98905692016-03-30 20:17:02 +090087int uniphier_ld4_early_clk_init(const struct uniphier_board_data *bd);
88int uniphier_pro5_early_clk_init(const struct uniphier_board_data *bd);
89int uniphier_pxs2_early_clk_init(const struct uniphier_board_data *bd);
Masahiro Yamada063eb1e2016-04-21 14:43:18 +090090int uniphier_ld20_early_clk_init(const struct uniphier_board_data *bd);
Masahiro Yamada75f16f82015-09-22 00:27:39 +090091
Masahiro Yamada98905692016-03-30 20:17:02 +090092int uniphier_sld3_early_pin_init(const struct uniphier_board_data *bd);
Masahiro Yamadaea4d3db2016-04-28 15:37:15 +090093int uniphier_ld20_early_pin_init(const struct uniphier_board_data *bd);
Masahiro Yamada75f16f82015-09-22 00:27:39 +090094
Masahiro Yamada98905692016-03-30 20:17:02 +090095int uniphier_ld4_umc_init(const struct uniphier_board_data *bd);
96int uniphier_pro4_umc_init(const struct uniphier_board_data *bd);
97int uniphier_sld8_umc_init(const struct uniphier_board_data *bd);
98int uniphier_pxs2_umc_init(const struct uniphier_board_data *bd);
Masahiro Yamada063eb1e2016-04-21 14:43:18 +090099int uniphier_ld20_umc_init(const struct uniphier_board_data *bd);
Masahiro Yamada75f16f82015-09-22 00:27:39 +0900100
Masahiro Yamada98905692016-03-30 20:17:02 +0900101void uniphier_sld3_pin_init(void);
102void uniphier_ld4_pin_init(void);
103void uniphier_pro4_pin_init(void);
104void uniphier_sld8_pin_init(void);
105void uniphier_pro5_pin_init(void);
106void uniphier_pxs2_pin_init(void);
107void uniphier_ld6b_pin_init(void);
Masahiro Yamada063eb1e2016-04-21 14:43:18 +0900108void uniphier_ld20_pin_init(void);
Masahiro Yamada75f16f82015-09-22 00:27:39 +0900109
Masahiro Yamada98905692016-03-30 20:17:02 +0900110void uniphier_ld4_clk_init(void);
111void uniphier_pro4_clk_init(void);
112void uniphier_pro5_clk_init(void);
113void uniphier_pxs2_clk_init(void);
Masahiro Yamada063eb1e2016-04-21 14:43:18 +0900114void uniphier_ld20_clk_init(void);
115
116void cci500_init(int nr_slaves);
Masahiro Yamada75f16f82015-09-22 00:27:39 +0900117
118#define pr_err(fmt, args...) printf(fmt, ##args)
119
120#endif /* __MACH_INIT_H */