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_ld4_sbc_init(const struct uniphier_board_data *bd); |
| 41 | int uniphier_pxs2_sbc_init(const struct uniphier_board_data *bd); |
Masahiro Yamada | 75f16f8 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 42 | #else |
Masahiro Yamada | 9890569 | 2016-03-30 20:17:02 +0900 | [diff] [blame] | 43 | static inline int uniphier_sbc_init_admulti( |
| 44 | const struct uniphier_board_data *bd) |
Masahiro Yamada | 75f16f8 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 45 | { |
| 46 | return 0; |
| 47 | } |
| 48 | |
Masahiro Yamada | 9890569 | 2016-03-30 20:17:02 +0900 | [diff] [blame] | 49 | static inline int uniphier_sbc_init_savepin( |
| 50 | const struct uniphier_board_data *bd) |
Masahiro Yamada | 75f16f8 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 51 | { |
| 52 | return 0; |
| 53 | } |
| 54 | |
Masahiro Yamada | 7d600a6 | 2016-03-18 16:41:44 +0900 | [diff] [blame] | 55 | static inline int uniphier_ld4_sbc_init(const struct uniphier_board_data *bd) |
| 56 | { |
| 57 | return 0; |
| 58 | } |
| 59 | |
| 60 | 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] | 61 | { |
| 62 | return 0; |
| 63 | } |
Masahiro Yamada | 75f16f8 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 64 | #endif |
| 65 | |
Masahiro Yamada | 9890569 | 2016-03-30 20:17:02 +0900 | [diff] [blame] | 66 | int uniphier_sld3_bcu_init(const struct uniphier_board_data *bd); |
| 67 | int uniphier_ld4_bcu_init(const struct uniphier_board_data *bd); |
Masahiro Yamada | 75f16f8 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 68 | |
| 69 | int memconf_init(const struct uniphier_board_data *bd); |
Masahiro Yamada | 9890569 | 2016-03-30 20:17:02 +0900 | [diff] [blame] | 70 | int uniphier_sld3_memconf_init(const struct uniphier_board_data *bd); |
| 71 | int uniphier_pxs2_memconf_init(const struct uniphier_board_data *bd); |
Masahiro Yamada | 75f16f8 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 72 | |
Masahiro Yamada | 9890569 | 2016-03-30 20:17:02 +0900 | [diff] [blame] | 73 | int uniphier_sld3_pll_init(const struct uniphier_board_data *bd); |
| 74 | int uniphier_ld4_pll_init(const struct uniphier_board_data *bd); |
| 75 | int uniphier_pro4_pll_init(const struct uniphier_board_data *bd); |
| 76 | int uniphier_sld8_pll_init(const struct uniphier_board_data *bd); |
Masahiro Yamada | 75f16f8 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 77 | |
Masahiro Yamada | 9890569 | 2016-03-30 20:17:02 +0900 | [diff] [blame] | 78 | int uniphier_sld3_enable_dpll_ssc(const struct uniphier_board_data *bd); |
| 79 | int uniphier_ld4_enable_dpll_ssc(const struct uniphier_board_data *bd); |
Masahiro Yamada | 75f16f8 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 80 | |
Masahiro Yamada | 9890569 | 2016-03-30 20:17:02 +0900 | [diff] [blame] | 81 | int uniphier_ld4_early_clk_init(const struct uniphier_board_data *bd); |
| 82 | int uniphier_pro5_early_clk_init(const struct uniphier_board_data *bd); |
| 83 | int uniphier_pxs2_early_clk_init(const struct uniphier_board_data *bd); |
Masahiro Yamada | 063eb1e | 2016-04-21 14:43:18 +0900 | [diff] [blame] | 84 | int uniphier_ld20_early_clk_init(const struct uniphier_board_data *bd); |
Masahiro Yamada | 75f16f8 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 85 | |
Masahiro Yamada | 9890569 | 2016-03-30 20:17:02 +0900 | [diff] [blame] | 86 | int uniphier_sld3_early_pin_init(const struct uniphier_board_data *bd); |
Masahiro Yamada | ea4d3db | 2016-04-28 15:37:15 +0900 | [diff] [blame] | 87 | int uniphier_ld20_early_pin_init(const struct uniphier_board_data *bd); |
Masahiro Yamada | 75f16f8 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 88 | |
Masahiro Yamada | 9890569 | 2016-03-30 20:17:02 +0900 | [diff] [blame] | 89 | int uniphier_ld4_umc_init(const struct uniphier_board_data *bd); |
| 90 | int uniphier_pro4_umc_init(const struct uniphier_board_data *bd); |
| 91 | int uniphier_sld8_umc_init(const struct uniphier_board_data *bd); |
| 92 | int uniphier_pxs2_umc_init(const struct uniphier_board_data *bd); |
Masahiro Yamada | 063eb1e | 2016-04-21 14:43:18 +0900 | [diff] [blame] | 93 | int uniphier_ld20_umc_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 | void uniphier_sld3_pin_init(void); |
| 96 | void uniphier_ld4_pin_init(void); |
| 97 | void uniphier_pro4_pin_init(void); |
| 98 | void uniphier_sld8_pin_init(void); |
| 99 | void uniphier_pro5_pin_init(void); |
| 100 | void uniphier_pxs2_pin_init(void); |
| 101 | void uniphier_ld6b_pin_init(void); |
Masahiro Yamada | 063eb1e | 2016-04-21 14:43:18 +0900 | [diff] [blame] | 102 | void uniphier_ld20_pin_init(void); |
Masahiro Yamada | 75f16f8 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 103 | |
Masahiro Yamada | 9890569 | 2016-03-30 20:17:02 +0900 | [diff] [blame] | 104 | void uniphier_ld4_clk_init(void); |
| 105 | void uniphier_pro4_clk_init(void); |
| 106 | void uniphier_pro5_clk_init(void); |
| 107 | void uniphier_pxs2_clk_init(void); |
Masahiro Yamada | 063eb1e | 2016-04-21 14:43:18 +0900 | [diff] [blame] | 108 | void uniphier_ld20_clk_init(void); |
| 109 | |
| 110 | void cci500_init(int nr_slaves); |
Masahiro Yamada | 75f16f8 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 111 | |
| 112 | #define pr_err(fmt, args...) printf(fmt, ##args) |
| 113 | |
| 114 | #endif /* __MACH_INIT_H */ |