blob: cef9d621c9d5dbe6f087863cecd39420f0508ccd [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
29int ph1_sld3_init(const struct uniphier_board_data *bd);
30int ph1_ld4_init(const struct uniphier_board_data *bd);
31int ph1_pro4_init(const struct uniphier_board_data *bd);
32int ph1_sld8_init(const struct uniphier_board_data *bd);
Masahiro Yamada28f40d42015-09-22 00:27:40 +090033int ph1_pro5_init(const struct uniphier_board_data *bd);
Masahiro Yamada019df872015-09-22 00:27:41 +090034int proxstream2_init(const struct uniphier_board_data *bd);
Masahiro Yamada323d1f92015-09-22 00:27:39 +090035
36#if defined(CONFIG_MICRO_SUPPORT_CARD)
Masahiro Yamada5d0607c2016-03-18 16:41:44 +090037int sbc_admulti_init(const struct uniphier_board_data *bd);
38int sbc_savepin_init(const struct uniphier_board_data *bd);
39int 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 Yamada323d1f92015-09-22 00:27:39 +090042#else
Masahiro Yamada5d0607c2016-03-18 16:41:44 +090043static inline int sbc_admulti_init(const struct uniphier_board_data *bd)
Masahiro Yamada323d1f92015-09-22 00:27:39 +090044{
45 return 0;
46}
47
Masahiro Yamada5d0607c2016-03-18 16:41:44 +090048static inline int sbc_savepin_init(const struct uniphier_board_data *bd)
Masahiro Yamada323d1f92015-09-22 00:27:39 +090049{
50 return 0;
51}
52
Masahiro Yamada5d0607c2016-03-18 16:41:44 +090053static inline int uniphier_sld3_sbc_init(const struct uniphier_board_data *bd)
Masahiro Yamada323d1f92015-09-22 00:27:39 +090054{
55 return 0;
56}
Masahiro Yamada019df872015-09-22 00:27:41 +090057
Masahiro Yamada5d0607c2016-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 Yamada019df872015-09-22 00:27:41 +090064{
65 return 0;
66}
Masahiro Yamada323d1f92015-09-22 00:27:39 +090067#endif
68
69int ph1_sld3_bcu_init(const struct uniphier_board_data *bd);
70int ph1_ld4_bcu_init(const struct uniphier_board_data *bd);
71
72int memconf_init(const struct uniphier_board_data *bd);
73int ph1_sld3_memconf_init(const struct uniphier_board_data *bd);
Masahiro Yamada019df872015-09-22 00:27:41 +090074int proxstream2_memconf_init(const struct uniphier_board_data *bd);
Masahiro Yamada323d1f92015-09-22 00:27:39 +090075
76int ph1_sld3_pll_init(const struct uniphier_board_data *bd);
77int ph1_ld4_pll_init(const struct uniphier_board_data *bd);
78int ph1_pro4_pll_init(const struct uniphier_board_data *bd);
79int ph1_sld8_pll_init(const struct uniphier_board_data *bd);
80
81int ph1_sld3_enable_dpll_ssc(const struct uniphier_board_data *bd);
82int ph1_ld4_enable_dpll_ssc(const struct uniphier_board_data *bd);
83
84int ph1_ld4_early_clk_init(const struct uniphier_board_data *bd);
Masahiro Yamada28f40d42015-09-22 00:27:40 +090085int ph1_pro5_early_clk_init(const struct uniphier_board_data *bd);
Masahiro Yamada019df872015-09-22 00:27:41 +090086int proxstream2_early_clk_init(const struct uniphier_board_data *bd);
Masahiro Yamada323d1f92015-09-22 00:27:39 +090087
88int ph1_sld3_early_pin_init(const struct uniphier_board_data *bd);
89
90int ph1_ld4_umc_init(const struct uniphier_board_data *bd);
91int ph1_pro4_umc_init(const struct uniphier_board_data *bd);
92int ph1_sld8_umc_init(const struct uniphier_board_data *bd);
Masahiro Yamada15607d02016-01-09 01:51:14 +090093int proxstream2_umc_init(const struct uniphier_board_data *bd);
Masahiro Yamada323d1f92015-09-22 00:27:39 +090094
95void ph1_sld3_pin_init(void);
96void ph1_ld4_pin_init(void);
97void ph1_pro4_pin_init(void);
98void ph1_sld8_pin_init(void);
Masahiro Yamada28f40d42015-09-22 00:27:40 +090099void ph1_pro5_pin_init(void);
Masahiro Yamada019df872015-09-22 00:27:41 +0900100void proxstream2_pin_init(void);
101void ph1_ld6b_pin_init(void);
Masahiro Yamada323d1f92015-09-22 00:27:39 +0900102
103void ph1_ld4_clk_init(void);
104void ph1_pro4_clk_init(void);
Masahiro Yamada28f40d42015-09-22 00:27:40 +0900105void ph1_pro5_clk_init(void);
Masahiro Yamada019df872015-09-22 00:27:41 +0900106void proxstream2_clk_init(void);
Masahiro Yamada323d1f92015-09-22 00:27:39 +0900107
108#define pr_err(fmt, args...) printf(fmt, ##args)
109
110#endif /* __MACH_INIT_H */