blob: 3abf4aadc4d9fc8aca3caab96220b7521356fd77 [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 Yamada75f16f82015-09-22 00:27:39 +090035
36#if defined(CONFIG_MICRO_SUPPORT_CARD)
Masahiro Yamada98905692016-03-30 20:17:02 +090037int uniphier_sbc_init_admulti(const struct uniphier_board_data *bd);
38int uniphier_sbc_init_savepin(const struct uniphier_board_data *bd);
Masahiro Yamada7d600a62016-03-18 16:41:44 +090039int uniphier_sld3_sbc_init(const struct uniphier_board_data *bd);
40int uniphier_ld4_sbc_init(const struct uniphier_board_data *bd);
41int uniphier_pxs2_sbc_init(const struct uniphier_board_data *bd);
Masahiro Yamada75f16f82015-09-22 00:27:39 +090042#else
Masahiro Yamada98905692016-03-30 20:17:02 +090043static inline int uniphier_sbc_init_admulti(
44 const struct uniphier_board_data *bd)
Masahiro Yamada75f16f82015-09-22 00:27:39 +090045{
46 return 0;
47}
48
Masahiro Yamada98905692016-03-30 20:17:02 +090049static inline int uniphier_sbc_init_savepin(
50 const struct uniphier_board_data *bd)
Masahiro Yamada75f16f82015-09-22 00:27:39 +090051{
52 return 0;
53}
54
Masahiro Yamada7d600a62016-03-18 16:41:44 +090055static inline int uniphier_sld3_sbc_init(const struct uniphier_board_data *bd)
Masahiro Yamada75f16f82015-09-22 00:27:39 +090056{
57 return 0;
58}
Masahiro Yamada1fe65d32015-09-22 00:27:41 +090059
Masahiro Yamada7d600a62016-03-18 16:41:44 +090060static inline int uniphier_ld4_sbc_init(const struct uniphier_board_data *bd)
61{
62 return 0;
63}
64
65static inline int uniphier_pxs2_sbc_init(const struct uniphier_board_data *bd)
Masahiro Yamada1fe65d32015-09-22 00:27:41 +090066{
67 return 0;
68}
Masahiro Yamada75f16f82015-09-22 00:27:39 +090069#endif
70
Masahiro Yamada98905692016-03-30 20:17:02 +090071int uniphier_sld3_bcu_init(const struct uniphier_board_data *bd);
72int uniphier_ld4_bcu_init(const struct uniphier_board_data *bd);
Masahiro Yamada75f16f82015-09-22 00:27:39 +090073
74int memconf_init(const struct uniphier_board_data *bd);
Masahiro Yamada98905692016-03-30 20:17:02 +090075int uniphier_sld3_memconf_init(const struct uniphier_board_data *bd);
76int uniphier_pxs2_memconf_init(const struct uniphier_board_data *bd);
Masahiro Yamada75f16f82015-09-22 00:27:39 +090077
Masahiro Yamada98905692016-03-30 20:17:02 +090078int uniphier_sld3_pll_init(const struct uniphier_board_data *bd);
79int uniphier_ld4_pll_init(const struct uniphier_board_data *bd);
80int uniphier_pro4_pll_init(const struct uniphier_board_data *bd);
81int uniphier_sld8_pll_init(const struct uniphier_board_data *bd);
Masahiro Yamada75f16f82015-09-22 00:27:39 +090082
Masahiro Yamada98905692016-03-30 20:17:02 +090083int uniphier_sld3_enable_dpll_ssc(const struct uniphier_board_data *bd);
84int uniphier_ld4_enable_dpll_ssc(const struct uniphier_board_data *bd);
Masahiro Yamada75f16f82015-09-22 00:27:39 +090085
Masahiro Yamada98905692016-03-30 20:17:02 +090086int uniphier_ld4_early_clk_init(const struct uniphier_board_data *bd);
87int uniphier_pro5_early_clk_init(const struct uniphier_board_data *bd);
88int uniphier_pxs2_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 Yamada75f16f82015-09-22 00:27:39 +090091
Masahiro Yamada98905692016-03-30 20:17:02 +090092int uniphier_ld4_umc_init(const struct uniphier_board_data *bd);
93int uniphier_pro4_umc_init(const struct uniphier_board_data *bd);
94int uniphier_sld8_umc_init(const struct uniphier_board_data *bd);
95int uniphier_pxs2_umc_init(const struct uniphier_board_data *bd);
Masahiro Yamada75f16f82015-09-22 00:27:39 +090096
Masahiro Yamada98905692016-03-30 20:17:02 +090097void uniphier_sld3_pin_init(void);
98void uniphier_ld4_pin_init(void);
99void uniphier_pro4_pin_init(void);
100void uniphier_sld8_pin_init(void);
101void uniphier_pro5_pin_init(void);
102void uniphier_pxs2_pin_init(void);
103void uniphier_ld6b_pin_init(void);
Masahiro Yamada75f16f82015-09-22 00:27:39 +0900104
Masahiro Yamada98905692016-03-30 20:17:02 +0900105void uniphier_ld4_clk_init(void);
106void uniphier_pro4_clk_init(void);
107void uniphier_pro5_clk_init(void);
108void uniphier_pxs2_clk_init(void);
Masahiro Yamada75f16f82015-09-22 00:27:39 +0900109
110#define pr_err(fmt, args...) printf(fmt, ##args)
111
112#endif /* __MACH_INIT_H */