Masahiro Yamada | 75f16f8 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 1 | /* |
| 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 Yamada | a573188 | 2016-02-26 14:21:40 +0900 | [diff] [blame] | 10 | #include <linux/types.h> |
| 11 | |
Masahiro Yamada | 799e6f2 | 2016-02-26 14:21:34 +0900 | [diff] [blame] | 12 | #define UNIPHIER_MAX_NR_DRAM_CH 3 |
| 13 | |
| 14 | struct uniphier_dram_ch { |
| 15 | unsigned long base; |
| 16 | unsigned long size; |
| 17 | unsigned int width; |
| 18 | }; |
| 19 | |
Masahiro Yamada | 75f16f8 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 20 | struct uniphier_board_data { |
Masahiro Yamada | 799e6f2 | 2016-02-26 14:21:34 +0900 | [diff] [blame] | 21 | unsigned int dram_freq; |
| 22 | unsigned int dram_nr_ch; |
Masahiro Yamada | a573188 | 2016-02-26 14:21:40 +0900 | [diff] [blame] | 23 | bool dram_ddr3plus; |
Masahiro Yamada | 799e6f2 | 2016-02-26 14:21:34 +0900 | [diff] [blame] | 24 | struct uniphier_dram_ch dram_ch[UNIPHIER_MAX_NR_DRAM_CH]; |
Masahiro Yamada | 75f16f8 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 25 | }; |
| 26 | |
Masahiro Yamada | c93f279 | 2015-12-17 17:47:42 +0900 | [diff] [blame] | 27 | const struct uniphier_board_data *uniphier_get_board_param(void); |
Masahiro Yamada | 75f16f8 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 28 | |
Masahiro Yamada | 9890569 | 2016-03-30 20:17:02 +0900 | [diff] [blame] | 29 | int uniphier_sld3_init(const struct uniphier_board_data *bd); |
| 30 | int uniphier_ld4_init(const struct uniphier_board_data *bd); |
| 31 | int uniphier_pro4_init(const struct uniphier_board_data *bd); |
| 32 | int uniphier_sld8_init(const struct uniphier_board_data *bd); |
| 33 | int uniphier_pro5_init(const struct uniphier_board_data *bd); |
| 34 | int uniphier_pxs2_init(const struct uniphier_board_data *bd); |
Masahiro Yamada | 8bbbcbd | 2016-05-24 21:14:01 +0900 | [diff] [blame] | 35 | int uniphier_ld11_init(const struct uniphier_board_data *bd); |
Masahiro Yamada | 063eb1e | 2016-04-21 14:43:18 +0900 | [diff] [blame] | 36 | int uniphier_ld20_init(const struct uniphier_board_data *bd); |
Masahiro Yamada | 75f16f8 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 37 | |
| 38 | #if defined(CONFIG_MICRO_SUPPORT_CARD) |
Masahiro Yamada | 9890569 | 2016-03-30 20:17:02 +0900 | [diff] [blame] | 39 | int uniphier_sbc_init_admulti(const struct uniphier_board_data *bd); |
| 40 | int uniphier_sbc_init_savepin(const struct uniphier_board_data *bd); |
Masahiro Yamada | 7d600a6 | 2016-03-18 16:41:44 +0900 | [diff] [blame] | 41 | int uniphier_ld4_sbc_init(const struct uniphier_board_data *bd); |
| 42 | int uniphier_pxs2_sbc_init(const struct uniphier_board_data *bd); |
Masahiro Yamada | 75f16f8 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 43 | #else |
Masahiro Yamada | 9890569 | 2016-03-30 20:17:02 +0900 | [diff] [blame] | 44 | static inline int uniphier_sbc_init_admulti( |
| 45 | const struct uniphier_board_data *bd) |
Masahiro Yamada | 75f16f8 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 46 | { |
| 47 | return 0; |
| 48 | } |
| 49 | |
Masahiro Yamada | 9890569 | 2016-03-30 20:17:02 +0900 | [diff] [blame] | 50 | static inline int uniphier_sbc_init_savepin( |
| 51 | const struct uniphier_board_data *bd) |
Masahiro Yamada | 75f16f8 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 52 | { |
| 53 | return 0; |
| 54 | } |
| 55 | |
Masahiro Yamada | 7d600a6 | 2016-03-18 16:41:44 +0900 | [diff] [blame] | 56 | static inline int uniphier_ld4_sbc_init(const struct uniphier_board_data *bd) |
| 57 | { |
| 58 | return 0; |
| 59 | } |
| 60 | |
| 61 | static inline int uniphier_pxs2_sbc_init(const struct uniphier_board_data *bd) |
Masahiro Yamada | 1fe65d3 | 2015-09-22 00:27:41 +0900 | [diff] [blame] | 62 | { |
| 63 | return 0; |
| 64 | } |
Masahiro Yamada | 75f16f8 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 65 | #endif |
| 66 | |
Masahiro Yamada | 9890569 | 2016-03-30 20:17:02 +0900 | [diff] [blame] | 67 | int uniphier_sld3_bcu_init(const struct uniphier_board_data *bd); |
| 68 | int uniphier_ld4_bcu_init(const struct uniphier_board_data *bd); |
Masahiro Yamada | 75f16f8 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 69 | |
| 70 | int memconf_init(const struct uniphier_board_data *bd); |
Masahiro Yamada | 9890569 | 2016-03-30 20:17:02 +0900 | [diff] [blame] | 71 | int uniphier_sld3_memconf_init(const struct uniphier_board_data *bd); |
| 72 | int uniphier_pxs2_memconf_init(const struct uniphier_board_data *bd); |
Masahiro Yamada | 75f16f8 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 73 | |
Masahiro Yamada | 9890569 | 2016-03-30 20:17:02 +0900 | [diff] [blame] | 74 | int uniphier_sld3_pll_init(const struct uniphier_board_data *bd); |
| 75 | int uniphier_ld4_pll_init(const struct uniphier_board_data *bd); |
| 76 | int uniphier_pro4_pll_init(const struct uniphier_board_data *bd); |
| 77 | int uniphier_sld8_pll_init(const struct uniphier_board_data *bd); |
Masahiro Yamada | 75f16f8 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 78 | |
Masahiro Yamada | 9890569 | 2016-03-30 20:17:02 +0900 | [diff] [blame] | 79 | int uniphier_sld3_enable_dpll_ssc(const struct uniphier_board_data *bd); |
| 80 | int uniphier_ld4_enable_dpll_ssc(const struct uniphier_board_data *bd); |
Masahiro Yamada | 75f16f8 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 81 | |
Masahiro Yamada | 9890569 | 2016-03-30 20:17:02 +0900 | [diff] [blame] | 82 | int uniphier_ld4_early_clk_init(const struct uniphier_board_data *bd); |
| 83 | int uniphier_pro5_early_clk_init(const struct uniphier_board_data *bd); |
| 84 | int uniphier_pxs2_early_clk_init(const struct uniphier_board_data *bd); |
Masahiro Yamada | 8bbbcbd | 2016-05-24 21:14:01 +0900 | [diff] [blame] | 85 | int uniphier_ld11_early_clk_init(const struct uniphier_board_data *bd); |
Masahiro Yamada | 063eb1e | 2016-04-21 14:43:18 +0900 | [diff] [blame] | 86 | int uniphier_ld20_early_clk_init(const struct uniphier_board_data *bd); |
Masahiro Yamada | 75f16f8 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 87 | |
Masahiro Yamada | 9890569 | 2016-03-30 20:17:02 +0900 | [diff] [blame] | 88 | int uniphier_sld3_early_pin_init(const struct uniphier_board_data *bd); |
Masahiro Yamada | ea4d3db | 2016-04-28 15:37:15 +0900 | [diff] [blame] | 89 | int uniphier_ld20_early_pin_init(const struct uniphier_board_data *bd); |
Masahiro Yamada | 75f16f8 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 90 | |
Masahiro Yamada | 9890569 | 2016-03-30 20:17:02 +0900 | [diff] [blame] | 91 | int uniphier_ld4_umc_init(const struct uniphier_board_data *bd); |
| 92 | int uniphier_pro4_umc_init(const struct uniphier_board_data *bd); |
| 93 | int uniphier_sld8_umc_init(const struct uniphier_board_data *bd); |
| 94 | int uniphier_pxs2_umc_init(const struct uniphier_board_data *bd); |
Masahiro Yamada | 063eb1e | 2016-04-21 14:43:18 +0900 | [diff] [blame] | 95 | int uniphier_ld20_umc_init(const struct uniphier_board_data *bd); |
Masahiro Yamada | 8bbbcbd | 2016-05-24 21:14:01 +0900 | [diff] [blame] | 96 | int uniphier_ld11_umc_init(const struct uniphier_board_data *bd); |
Masahiro Yamada | 75f16f8 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 97 | |
Masahiro Yamada | 9890569 | 2016-03-30 20:17:02 +0900 | [diff] [blame] | 98 | void uniphier_sld3_pin_init(void); |
| 99 | void uniphier_ld4_pin_init(void); |
| 100 | void uniphier_pro4_pin_init(void); |
| 101 | void uniphier_sld8_pin_init(void); |
| 102 | void uniphier_pro5_pin_init(void); |
| 103 | void uniphier_pxs2_pin_init(void); |
| 104 | void uniphier_ld6b_pin_init(void); |
Masahiro Yamada | 063eb1e | 2016-04-21 14:43:18 +0900 | [diff] [blame] | 105 | void uniphier_ld20_pin_init(void); |
Masahiro Yamada | 75f16f8 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 106 | |
Masahiro Yamada | 9890569 | 2016-03-30 20:17:02 +0900 | [diff] [blame] | 107 | void uniphier_ld4_clk_init(void); |
| 108 | void uniphier_pro4_clk_init(void); |
| 109 | void uniphier_pro5_clk_init(void); |
| 110 | void uniphier_pxs2_clk_init(void); |
Masahiro Yamada | 8bbbcbd | 2016-05-24 21:14:01 +0900 | [diff] [blame] | 111 | void uniphier_ld11_clk_init(void); |
Masahiro Yamada | 063eb1e | 2016-04-21 14:43:18 +0900 | [diff] [blame] | 112 | void uniphier_ld20_clk_init(void); |
| 113 | |
| 114 | void cci500_init(int nr_slaves); |
Masahiro Yamada | 75f16f8 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 115 | |
| 116 | #define pr_err(fmt, args...) printf(fmt, ##args) |
| 117 | |
| 118 | #endif /* __MACH_INIT_H */ |