blob: cba0bc9d37453538848d0d7b6c40b49481ca6160 [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
Masahiro Yamada5b660062016-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 Yamada667dbcd2016-05-24 21:14:01 +090035int uniphier_ld11_init(const struct uniphier_board_data *bd);
Masahiro Yamada9d0c2ce2016-04-21 14:43:18 +090036int uniphier_ld20_init(const struct uniphier_board_data *bd);
Masahiro Yamada323d1f92015-09-22 00:27:39 +090037
38#if defined(CONFIG_MICRO_SUPPORT_CARD)
Masahiro Yamada5b660062016-03-30 20:17:02 +090039int uniphier_sbc_init_admulti(const struct uniphier_board_data *bd);
40int uniphier_sbc_init_savepin(const struct uniphier_board_data *bd);
Masahiro Yamada5d0607c2016-03-18 16:41:44 +090041int uniphier_ld4_sbc_init(const struct uniphier_board_data *bd);
42int uniphier_pxs2_sbc_init(const struct uniphier_board_data *bd);
Masahiro Yamada323d1f92015-09-22 00:27:39 +090043#else
Masahiro Yamada5b660062016-03-30 20:17:02 +090044static inline int uniphier_sbc_init_admulti(
45 const struct uniphier_board_data *bd)
Masahiro Yamada323d1f92015-09-22 00:27:39 +090046{
47 return 0;
48}
49
Masahiro Yamada5b660062016-03-30 20:17:02 +090050static inline int uniphier_sbc_init_savepin(
51 const struct uniphier_board_data *bd)
Masahiro Yamada323d1f92015-09-22 00:27:39 +090052{
53 return 0;
54}
55
Masahiro Yamada5d0607c2016-03-18 16:41:44 +090056static inline int uniphier_ld4_sbc_init(const struct uniphier_board_data *bd)
57{
58 return 0;
59}
60
61static inline int uniphier_pxs2_sbc_init(const struct uniphier_board_data *bd)
Masahiro Yamada019df872015-09-22 00:27:41 +090062{
63 return 0;
64}
Masahiro Yamada323d1f92015-09-22 00:27:39 +090065#endif
66
Masahiro Yamada5b660062016-03-30 20:17:02 +090067int uniphier_sld3_bcu_init(const struct uniphier_board_data *bd);
68int uniphier_ld4_bcu_init(const struct uniphier_board_data *bd);
Masahiro Yamada323d1f92015-09-22 00:27:39 +090069
70int memconf_init(const struct uniphier_board_data *bd);
Masahiro Yamada5b660062016-03-30 20:17:02 +090071int uniphier_sld3_memconf_init(const struct uniphier_board_data *bd);
72int uniphier_pxs2_memconf_init(const struct uniphier_board_data *bd);
Masahiro Yamada323d1f92015-09-22 00:27:39 +090073
Masahiro Yamada5b660062016-03-30 20:17:02 +090074int uniphier_sld3_pll_init(const struct uniphier_board_data *bd);
75int uniphier_ld4_pll_init(const struct uniphier_board_data *bd);
76int uniphier_pro4_pll_init(const struct uniphier_board_data *bd);
77int uniphier_sld8_pll_init(const struct uniphier_board_data *bd);
Masahiro Yamada323d1f92015-09-22 00:27:39 +090078
Masahiro Yamada5b660062016-03-30 20:17:02 +090079int uniphier_sld3_enable_dpll_ssc(const struct uniphier_board_data *bd);
80int uniphier_ld4_enable_dpll_ssc(const struct uniphier_board_data *bd);
Masahiro Yamada323d1f92015-09-22 00:27:39 +090081
Masahiro Yamada5b660062016-03-30 20:17:02 +090082int uniphier_ld4_early_clk_init(const struct uniphier_board_data *bd);
83int uniphier_pro5_early_clk_init(const struct uniphier_board_data *bd);
84int uniphier_pxs2_early_clk_init(const struct uniphier_board_data *bd);
Masahiro Yamada667dbcd2016-05-24 21:14:01 +090085int uniphier_ld11_early_clk_init(const struct uniphier_board_data *bd);
Masahiro Yamada9d0c2ce2016-04-21 14:43:18 +090086int uniphier_ld20_early_clk_init(const struct uniphier_board_data *bd);
Masahiro Yamada323d1f92015-09-22 00:27:39 +090087
Masahiro Yamada5b660062016-03-30 20:17:02 +090088int uniphier_sld3_early_pin_init(const struct uniphier_board_data *bd);
Masahiro Yamada5eb41502016-04-28 15:37:15 +090089int uniphier_ld20_early_pin_init(const struct uniphier_board_data *bd);
Masahiro Yamada323d1f92015-09-22 00:27:39 +090090
Masahiro Yamada5b660062016-03-30 20:17:02 +090091int uniphier_ld4_umc_init(const struct uniphier_board_data *bd);
92int uniphier_pro4_umc_init(const struct uniphier_board_data *bd);
93int uniphier_sld8_umc_init(const struct uniphier_board_data *bd);
94int uniphier_pxs2_umc_init(const struct uniphier_board_data *bd);
Masahiro Yamada9d0c2ce2016-04-21 14:43:18 +090095int uniphier_ld20_umc_init(const struct uniphier_board_data *bd);
Masahiro Yamada667dbcd2016-05-24 21:14:01 +090096int uniphier_ld11_umc_init(const struct uniphier_board_data *bd);
Masahiro Yamada323d1f92015-09-22 00:27:39 +090097
Masahiro Yamada5b660062016-03-30 20:17:02 +090098void uniphier_sld3_pin_init(void);
99void uniphier_ld4_pin_init(void);
100void uniphier_pro4_pin_init(void);
101void uniphier_sld8_pin_init(void);
102void uniphier_pro5_pin_init(void);
103void uniphier_pxs2_pin_init(void);
104void uniphier_ld6b_pin_init(void);
Masahiro Yamada9d0c2ce2016-04-21 14:43:18 +0900105void uniphier_ld20_pin_init(void);
Masahiro Yamada323d1f92015-09-22 00:27:39 +0900106
Masahiro Yamada5b660062016-03-30 20:17:02 +0900107void uniphier_ld4_clk_init(void);
108void uniphier_pro4_clk_init(void);
109void uniphier_pro5_clk_init(void);
110void uniphier_pxs2_clk_init(void);
Masahiro Yamada667dbcd2016-05-24 21:14:01 +0900111void uniphier_ld11_clk_init(void);
Masahiro Yamada9d0c2ce2016-04-21 14:43:18 +0900112void uniphier_ld20_clk_init(void);
113
114void cci500_init(int nr_slaves);
Masahiro Yamada323d1f92015-09-22 00:27:39 +0900115
116#define pr_err(fmt, args...) printf(fmt, ##args)
117
118#endif /* __MACH_INIT_H */