blob: ab0a68d83d8183b47befc5850fa130676a252746 [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 Yamada9d0c2ce2016-04-21 14:43:18 +090035int uniphier_ld20_init(const struct uniphier_board_data *bd);
Masahiro Yamada323d1f92015-09-22 00:27:39 +090036
37#if defined(CONFIG_MICRO_SUPPORT_CARD)
Masahiro Yamada5b660062016-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 Yamada5d0607c2016-03-18 16:41:44 +090040int uniphier_ld4_sbc_init(const struct uniphier_board_data *bd);
41int uniphier_pxs2_sbc_init(const struct uniphier_board_data *bd);
Masahiro Yamada323d1f92015-09-22 00:27:39 +090042#else
Masahiro Yamada5b660062016-03-30 20:17:02 +090043static inline int uniphier_sbc_init_admulti(
44 const struct uniphier_board_data *bd)
Masahiro Yamada323d1f92015-09-22 00:27:39 +090045{
46 return 0;
47}
48
Masahiro Yamada5b660062016-03-30 20:17:02 +090049static inline int uniphier_sbc_init_savepin(
50 const struct uniphier_board_data *bd)
Masahiro Yamada323d1f92015-09-22 00:27:39 +090051{
52 return 0;
53}
54
Masahiro Yamada5d0607c2016-03-18 16:41:44 +090055static inline int uniphier_ld4_sbc_init(const struct uniphier_board_data *bd)
56{
57 return 0;
58}
59
60static inline int uniphier_pxs2_sbc_init(const struct uniphier_board_data *bd)
Masahiro Yamada019df872015-09-22 00:27:41 +090061{
62 return 0;
63}
Masahiro Yamada323d1f92015-09-22 00:27:39 +090064#endif
65
Masahiro Yamada5b660062016-03-30 20:17:02 +090066int uniphier_sld3_bcu_init(const struct uniphier_board_data *bd);
67int uniphier_ld4_bcu_init(const struct uniphier_board_data *bd);
Masahiro Yamada323d1f92015-09-22 00:27:39 +090068
69int memconf_init(const struct uniphier_board_data *bd);
Masahiro Yamada5b660062016-03-30 20:17:02 +090070int uniphier_sld3_memconf_init(const struct uniphier_board_data *bd);
71int uniphier_pxs2_memconf_init(const struct uniphier_board_data *bd);
Masahiro Yamada323d1f92015-09-22 00:27:39 +090072
Masahiro Yamada5b660062016-03-30 20:17:02 +090073int uniphier_sld3_pll_init(const struct uniphier_board_data *bd);
74int uniphier_ld4_pll_init(const struct uniphier_board_data *bd);
75int uniphier_pro4_pll_init(const struct uniphier_board_data *bd);
76int uniphier_sld8_pll_init(const struct uniphier_board_data *bd);
Masahiro Yamada323d1f92015-09-22 00:27:39 +090077
Masahiro Yamada5b660062016-03-30 20:17:02 +090078int uniphier_sld3_enable_dpll_ssc(const struct uniphier_board_data *bd);
79int uniphier_ld4_enable_dpll_ssc(const struct uniphier_board_data *bd);
Masahiro Yamada323d1f92015-09-22 00:27:39 +090080
Masahiro Yamada5b660062016-03-30 20:17:02 +090081int uniphier_ld4_early_clk_init(const struct uniphier_board_data *bd);
82int uniphier_pro5_early_clk_init(const struct uniphier_board_data *bd);
83int uniphier_pxs2_early_clk_init(const struct uniphier_board_data *bd);
Masahiro Yamada9d0c2ce2016-04-21 14:43:18 +090084int uniphier_ld20_early_clk_init(const struct uniphier_board_data *bd);
Masahiro Yamada323d1f92015-09-22 00:27:39 +090085
Masahiro Yamada5b660062016-03-30 20:17:02 +090086int uniphier_sld3_early_pin_init(const struct uniphier_board_data *bd);
Masahiro Yamada5eb41502016-04-28 15:37:15 +090087int uniphier_ld20_early_pin_init(const struct uniphier_board_data *bd);
Masahiro Yamada323d1f92015-09-22 00:27:39 +090088
Masahiro Yamada5b660062016-03-30 20:17:02 +090089int uniphier_ld4_umc_init(const struct uniphier_board_data *bd);
90int uniphier_pro4_umc_init(const struct uniphier_board_data *bd);
91int uniphier_sld8_umc_init(const struct uniphier_board_data *bd);
92int uniphier_pxs2_umc_init(const struct uniphier_board_data *bd);
Masahiro Yamada9d0c2ce2016-04-21 14:43:18 +090093int uniphier_ld20_umc_init(const struct uniphier_board_data *bd);
Masahiro Yamada323d1f92015-09-22 00:27:39 +090094
Masahiro Yamada5b660062016-03-30 20:17:02 +090095void uniphier_sld3_pin_init(void);
96void uniphier_ld4_pin_init(void);
97void uniphier_pro4_pin_init(void);
98void uniphier_sld8_pin_init(void);
99void uniphier_pro5_pin_init(void);
100void uniphier_pxs2_pin_init(void);
101void uniphier_ld6b_pin_init(void);
Masahiro Yamada9d0c2ce2016-04-21 14:43:18 +0900102void uniphier_ld20_pin_init(void);
Masahiro Yamada323d1f92015-09-22 00:27:39 +0900103
Masahiro Yamada5b660062016-03-30 20:17:02 +0900104void uniphier_ld4_clk_init(void);
105void uniphier_pro4_clk_init(void);
106void uniphier_pro5_clk_init(void);
107void uniphier_pxs2_clk_init(void);
Masahiro Yamada9d0c2ce2016-04-21 14:43:18 +0900108void uniphier_ld20_clk_init(void);
109
110void cci500_init(int nr_slaves);
Masahiro Yamada323d1f92015-09-22 00:27:39 +0900111
112#define pr_err(fmt, args...) printf(fmt, ##args)
113
114#endif /* __MACH_INIT_H */