blob: 31da605bb45ad01d020486e148b0b6002a23b509 [file] [log] [blame]
Masahiro Yamada75f16f82015-09-22 00:27:39 +09001/*
Masahiro Yamadafcdbbec2016-07-22 13:38:32 +09002 * Copyright (C) 2015-2016 Socionext Inc.
3 * Author: Masahiro Yamada <yamada.masahiro@socionext.com>
Masahiro Yamada75f16f82015-09-22 00:27:39 +09004 *
5 * SPDX-License-Identifier: GPL-2.0+
6 */
7
8#ifndef __MACH_INIT_H
9#define __MACH_INIT_H
10
Masahiro Yamadaa5731882016-02-26 14:21:40 +090011#include <linux/types.h>
12
Masahiro Yamada799e6f22016-02-26 14:21:34 +090013#define UNIPHIER_MAX_NR_DRAM_CH 3
14
15struct uniphier_dram_ch {
16 unsigned long base;
17 unsigned long size;
18 unsigned int width;
19};
20
Masahiro Yamada75f16f82015-09-22 00:27:39 +090021struct uniphier_board_data {
Masahiro Yamada799e6f22016-02-26 14:21:34 +090022 unsigned int dram_freq;
23 unsigned int dram_nr_ch;
24 struct uniphier_dram_ch dram_ch[UNIPHIER_MAX_NR_DRAM_CH];
Masahiro Yamadafcdbbec2016-07-22 13:38:32 +090025 unsigned int flags;
26#define UNIPHIER_BD_DDR3PLUS BIT(2)
Masahiro Yamada75f16f82015-09-22 00:27:39 +090027};
28
Masahiro Yamadac93f2792015-12-17 17:47:42 +090029const struct uniphier_board_data *uniphier_get_board_param(void);
Masahiro Yamada75f16f82015-09-22 00:27:39 +090030
Masahiro Yamada98905692016-03-30 20:17:02 +090031int uniphier_sld3_init(const struct uniphier_board_data *bd);
32int uniphier_ld4_init(const struct uniphier_board_data *bd);
33int uniphier_pro4_init(const struct uniphier_board_data *bd);
34int uniphier_sld8_init(const struct uniphier_board_data *bd);
35int uniphier_pro5_init(const struct uniphier_board_data *bd);
36int uniphier_pxs2_init(const struct uniphier_board_data *bd);
Masahiro Yamada8bbbcbd2016-05-24 21:14:01 +090037int uniphier_ld11_init(const struct uniphier_board_data *bd);
Masahiro Yamada063eb1e2016-04-21 14:43:18 +090038int uniphier_ld20_init(const struct uniphier_board_data *bd);
Masahiro Yamada75f16f82015-09-22 00:27:39 +090039
40#if defined(CONFIG_MICRO_SUPPORT_CARD)
Masahiro Yamada98905692016-03-30 20:17:02 +090041int uniphier_sbc_init_admulti(const struct uniphier_board_data *bd);
42int uniphier_sbc_init_savepin(const struct uniphier_board_data *bd);
Masahiro Yamada7d600a62016-03-18 16:41:44 +090043int uniphier_ld4_sbc_init(const struct uniphier_board_data *bd);
44int uniphier_pxs2_sbc_init(const struct uniphier_board_data *bd);
Masahiro Yamada75f16f82015-09-22 00:27:39 +090045#else
Masahiro Yamada98905692016-03-30 20:17:02 +090046static inline int uniphier_sbc_init_admulti(
47 const struct uniphier_board_data *bd)
Masahiro Yamada75f16f82015-09-22 00:27:39 +090048{
49 return 0;
50}
51
Masahiro Yamada98905692016-03-30 20:17:02 +090052static inline int uniphier_sbc_init_savepin(
53 const struct uniphier_board_data *bd)
Masahiro Yamada75f16f82015-09-22 00:27:39 +090054{
55 return 0;
56}
57
Masahiro Yamada7d600a62016-03-18 16:41:44 +090058static inline int uniphier_ld4_sbc_init(const struct uniphier_board_data *bd)
59{
60 return 0;
61}
62
63static inline int uniphier_pxs2_sbc_init(const struct uniphier_board_data *bd)
Masahiro Yamada1fe65d32015-09-22 00:27:41 +090064{
65 return 0;
66}
Masahiro Yamada75f16f82015-09-22 00:27:39 +090067#endif
68
Masahiro Yamada98905692016-03-30 20:17:02 +090069int uniphier_sld3_bcu_init(const struct uniphier_board_data *bd);
70int uniphier_ld4_bcu_init(const struct uniphier_board_data *bd);
Masahiro Yamada75f16f82015-09-22 00:27:39 +090071
72int memconf_init(const struct uniphier_board_data *bd);
Masahiro Yamada98905692016-03-30 20:17:02 +090073int uniphier_sld3_memconf_init(const struct uniphier_board_data *bd);
74int uniphier_pxs2_memconf_init(const struct uniphier_board_data *bd);
Masahiro Yamada75f16f82015-09-22 00:27:39 +090075
Masahiro Yamada98905692016-03-30 20:17:02 +090076int uniphier_sld3_pll_init(const struct uniphier_board_data *bd);
77int uniphier_ld4_pll_init(const struct uniphier_board_data *bd);
78int uniphier_pro4_pll_init(const struct uniphier_board_data *bd);
79int uniphier_sld8_pll_init(const struct uniphier_board_data *bd);
Masahiro Yamada75f16f82015-09-22 00:27:39 +090080
Masahiro Yamada98905692016-03-30 20:17:02 +090081int uniphier_sld3_enable_dpll_ssc(const struct uniphier_board_data *bd);
82int uniphier_ld4_enable_dpll_ssc(const struct uniphier_board_data *bd);
Masahiro Yamada75f16f82015-09-22 00:27:39 +090083
Masahiro Yamada98905692016-03-30 20:17:02 +090084int uniphier_ld4_early_clk_init(const struct uniphier_board_data *bd);
85int uniphier_pro5_early_clk_init(const struct uniphier_board_data *bd);
86int uniphier_pxs2_early_clk_init(const struct uniphier_board_data *bd);
Masahiro Yamada8bbbcbd2016-05-24 21:14:01 +090087int uniphier_ld11_early_clk_init(const struct uniphier_board_data *bd);
Masahiro Yamada063eb1e2016-04-21 14:43:18 +090088int uniphier_ld20_early_clk_init(const struct uniphier_board_data *bd);
Masahiro Yamada75f16f82015-09-22 00:27:39 +090089
Masahiro Yamada98905692016-03-30 20:17:02 +090090int uniphier_sld3_early_pin_init(const struct uniphier_board_data *bd);
Masahiro Yamadaea4d3db2016-04-28 15:37:15 +090091int uniphier_ld20_early_pin_init(const struct uniphier_board_data *bd);
Masahiro Yamada75f16f82015-09-22 00:27:39 +090092
Masahiro Yamada98905692016-03-30 20:17:02 +090093int uniphier_ld4_umc_init(const struct uniphier_board_data *bd);
94int uniphier_pro4_umc_init(const struct uniphier_board_data *bd);
95int uniphier_sld8_umc_init(const struct uniphier_board_data *bd);
96int uniphier_pxs2_umc_init(const struct uniphier_board_data *bd);
Masahiro Yamada063eb1e2016-04-21 14:43:18 +090097int uniphier_ld20_umc_init(const struct uniphier_board_data *bd);
Masahiro Yamada8bbbcbd2016-05-24 21:14:01 +090098int uniphier_ld11_umc_init(const struct uniphier_board_data *bd);
Masahiro Yamada75f16f82015-09-22 00:27:39 +090099
Masahiro Yamada98905692016-03-30 20:17:02 +0900100void uniphier_sld3_pin_init(void);
101void uniphier_ld4_pin_init(void);
102void uniphier_pro4_pin_init(void);
103void uniphier_sld8_pin_init(void);
104void uniphier_pro5_pin_init(void);
105void uniphier_pxs2_pin_init(void);
106void uniphier_ld6b_pin_init(void);
Masahiro Yamada063eb1e2016-04-21 14:43:18 +0900107void uniphier_ld20_pin_init(void);
Masahiro Yamada75f16f82015-09-22 00:27:39 +0900108
Masahiro Yamada98905692016-03-30 20:17:02 +0900109void uniphier_ld4_clk_init(void);
110void uniphier_pro4_clk_init(void);
111void uniphier_pro5_clk_init(void);
112void uniphier_pxs2_clk_init(void);
Masahiro Yamada8bbbcbd2016-05-24 21:14:01 +0900113void uniphier_ld11_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 */