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 | 063eb1e | 2016-04-21 14:43:18 +0900 | [diff] [blame] | 35 | int uniphier_ld20_init(const struct uniphier_board_data *bd); |
Masahiro Yamada | 75f16f8 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 36 | |
| 37 | #if defined(CONFIG_MICRO_SUPPORT_CARD) |
Masahiro Yamada | 9890569 | 2016-03-30 20:17:02 +0900 | [diff] [blame] | 38 | int uniphier_sbc_init_admulti(const struct uniphier_board_data *bd); |
| 39 | int uniphier_sbc_init_savepin(const struct uniphier_board_data *bd); |
Masahiro Yamada | 7d600a6 | 2016-03-18 16:41:44 +0900 | [diff] [blame] | 40 | int uniphier_sld3_sbc_init(const struct uniphier_board_data *bd); |
| 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_sld3_sbc_init(const struct uniphier_board_data *bd) |
Masahiro Yamada | 75f16f8 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 57 | { |
| 58 | return 0; |
| 59 | } |
Masahiro Yamada | 1fe65d3 | 2015-09-22 00:27:41 +0900 | [diff] [blame] | 60 | |
Masahiro Yamada | 7d600a6 | 2016-03-18 16:41:44 +0900 | [diff] [blame] | 61 | static inline int uniphier_ld4_sbc_init(const struct uniphier_board_data *bd) |
| 62 | { |
| 63 | return 0; |
| 64 | } |
| 65 | |
| 66 | 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] | 67 | { |
| 68 | return 0; |
| 69 | } |
Masahiro Yamada | 75f16f8 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 70 | #endif |
| 71 | |
Masahiro Yamada | 9890569 | 2016-03-30 20:17:02 +0900 | [diff] [blame] | 72 | int uniphier_sld3_bcu_init(const struct uniphier_board_data *bd); |
| 73 | int uniphier_ld4_bcu_init(const struct uniphier_board_data *bd); |
Masahiro Yamada | 75f16f8 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 74 | |
| 75 | int memconf_init(const struct uniphier_board_data *bd); |
Masahiro Yamada | 9890569 | 2016-03-30 20:17:02 +0900 | [diff] [blame] | 76 | int uniphier_sld3_memconf_init(const struct uniphier_board_data *bd); |
| 77 | int uniphier_pxs2_memconf_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_pll_init(const struct uniphier_board_data *bd); |
| 80 | int uniphier_ld4_pll_init(const struct uniphier_board_data *bd); |
| 81 | int uniphier_pro4_pll_init(const struct uniphier_board_data *bd); |
| 82 | int uniphier_sld8_pll_init(const struct uniphier_board_data *bd); |
Masahiro Yamada | 75f16f8 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 83 | |
Masahiro Yamada | 9890569 | 2016-03-30 20:17:02 +0900 | [diff] [blame] | 84 | int uniphier_sld3_enable_dpll_ssc(const struct uniphier_board_data *bd); |
| 85 | int uniphier_ld4_enable_dpll_ssc(const struct uniphier_board_data *bd); |
Masahiro Yamada | 75f16f8 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 86 | |
Masahiro Yamada | 9890569 | 2016-03-30 20:17:02 +0900 | [diff] [blame] | 87 | int uniphier_ld4_early_clk_init(const struct uniphier_board_data *bd); |
| 88 | int uniphier_pro5_early_clk_init(const struct uniphier_board_data *bd); |
| 89 | int uniphier_pxs2_early_clk_init(const struct uniphier_board_data *bd); |
Masahiro Yamada | 063eb1e | 2016-04-21 14:43:18 +0900 | [diff] [blame] | 90 | int uniphier_ld20_early_clk_init(const struct uniphier_board_data *bd); |
Masahiro Yamada | 75f16f8 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 91 | |
Masahiro Yamada | 9890569 | 2016-03-30 20:17:02 +0900 | [diff] [blame] | 92 | int uniphier_sld3_early_pin_init(const struct uniphier_board_data *bd); |
Masahiro Yamada | ea4d3db | 2016-04-28 15:37:15 +0900 | [diff] [blame^] | 93 | int uniphier_ld20_early_pin_init(const struct uniphier_board_data *bd); |
Masahiro Yamada | 75f16f8 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 94 | |
Masahiro Yamada | 9890569 | 2016-03-30 20:17:02 +0900 | [diff] [blame] | 95 | int uniphier_ld4_umc_init(const struct uniphier_board_data *bd); |
| 96 | int uniphier_pro4_umc_init(const struct uniphier_board_data *bd); |
| 97 | int uniphier_sld8_umc_init(const struct uniphier_board_data *bd); |
| 98 | int uniphier_pxs2_umc_init(const struct uniphier_board_data *bd); |
Masahiro Yamada | 063eb1e | 2016-04-21 14:43:18 +0900 | [diff] [blame] | 99 | int uniphier_ld20_umc_init(const struct uniphier_board_data *bd); |
Masahiro Yamada | 75f16f8 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 100 | |
Masahiro Yamada | 9890569 | 2016-03-30 20:17:02 +0900 | [diff] [blame] | 101 | void uniphier_sld3_pin_init(void); |
| 102 | void uniphier_ld4_pin_init(void); |
| 103 | void uniphier_pro4_pin_init(void); |
| 104 | void uniphier_sld8_pin_init(void); |
| 105 | void uniphier_pro5_pin_init(void); |
| 106 | void uniphier_pxs2_pin_init(void); |
| 107 | void uniphier_ld6b_pin_init(void); |
Masahiro Yamada | 063eb1e | 2016-04-21 14:43:18 +0900 | [diff] [blame] | 108 | void uniphier_ld20_pin_init(void); |
Masahiro Yamada | 75f16f8 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 109 | |
Masahiro Yamada | 9890569 | 2016-03-30 20:17:02 +0900 | [diff] [blame] | 110 | void uniphier_ld4_clk_init(void); |
| 111 | void uniphier_pro4_clk_init(void); |
| 112 | void uniphier_pro5_clk_init(void); |
| 113 | void uniphier_pxs2_clk_init(void); |
Masahiro Yamada | 063eb1e | 2016-04-21 14:43:18 +0900 | [diff] [blame] | 114 | void uniphier_ld20_clk_init(void); |
| 115 | |
| 116 | void cci500_init(int nr_slaves); |
Masahiro Yamada | 75f16f8 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 117 | |
| 118 | #define pr_err(fmt, args...) printf(fmt, ##args) |
| 119 | |
| 120 | #endif /* __MACH_INIT_H */ |