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 | 75f16f8 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 35 | |
| 36 | #if defined(CONFIG_MICRO_SUPPORT_CARD) |
Masahiro Yamada | 9890569 | 2016-03-30 20:17:02 +0900 | [diff] [blame] | 37 | int uniphier_sbc_init_admulti(const struct uniphier_board_data *bd); |
| 38 | int uniphier_sbc_init_savepin(const struct uniphier_board_data *bd); |
Masahiro Yamada | 7d600a6 | 2016-03-18 16:41:44 +0900 | [diff] [blame] | 39 | int uniphier_sld3_sbc_init(const struct uniphier_board_data *bd); |
| 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_sld3_sbc_init(const struct uniphier_board_data *bd) |
Masahiro Yamada | 75f16f8 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 56 | { |
| 57 | return 0; |
| 58 | } |
Masahiro Yamada | 1fe65d3 | 2015-09-22 00:27:41 +0900 | [diff] [blame] | 59 | |
Masahiro Yamada | 7d600a6 | 2016-03-18 16:41:44 +0900 | [diff] [blame] | 60 | static inline int uniphier_ld4_sbc_init(const struct uniphier_board_data *bd) |
| 61 | { |
| 62 | return 0; |
| 63 | } |
| 64 | |
| 65 | 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] | 66 | { |
| 67 | return 0; |
| 68 | } |
Masahiro Yamada | 75f16f8 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 69 | #endif |
| 70 | |
Masahiro Yamada | 9890569 | 2016-03-30 20:17:02 +0900 | [diff] [blame] | 71 | int uniphier_sld3_bcu_init(const struct uniphier_board_data *bd); |
| 72 | int uniphier_ld4_bcu_init(const struct uniphier_board_data *bd); |
Masahiro Yamada | 75f16f8 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 73 | |
| 74 | int memconf_init(const struct uniphier_board_data *bd); |
Masahiro Yamada | 9890569 | 2016-03-30 20:17:02 +0900 | [diff] [blame] | 75 | int uniphier_sld3_memconf_init(const struct uniphier_board_data *bd); |
| 76 | int uniphier_pxs2_memconf_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_pll_init(const struct uniphier_board_data *bd); |
| 79 | int uniphier_ld4_pll_init(const struct uniphier_board_data *bd); |
| 80 | int uniphier_pro4_pll_init(const struct uniphier_board_data *bd); |
| 81 | int uniphier_sld8_pll_init(const struct uniphier_board_data *bd); |
Masahiro Yamada | 75f16f8 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 82 | |
Masahiro Yamada | 9890569 | 2016-03-30 20:17:02 +0900 | [diff] [blame] | 83 | int uniphier_sld3_enable_dpll_ssc(const struct uniphier_board_data *bd); |
| 84 | int uniphier_ld4_enable_dpll_ssc(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_ld4_early_clk_init(const struct uniphier_board_data *bd); |
| 87 | int uniphier_pro5_early_clk_init(const struct uniphier_board_data *bd); |
| 88 | int uniphier_pxs2_early_clk_init(const struct uniphier_board_data *bd); |
Masahiro Yamada | 75f16f8 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 89 | |
Masahiro Yamada | 9890569 | 2016-03-30 20:17:02 +0900 | [diff] [blame] | 90 | int uniphier_sld3_early_pin_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_ld4_umc_init(const struct uniphier_board_data *bd); |
| 93 | int uniphier_pro4_umc_init(const struct uniphier_board_data *bd); |
| 94 | int uniphier_sld8_umc_init(const struct uniphier_board_data *bd); |
| 95 | int uniphier_pxs2_umc_init(const struct uniphier_board_data *bd); |
Masahiro Yamada | 75f16f8 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 96 | |
Masahiro Yamada | 9890569 | 2016-03-30 20:17:02 +0900 | [diff] [blame] | 97 | void uniphier_sld3_pin_init(void); |
| 98 | void uniphier_ld4_pin_init(void); |
| 99 | void uniphier_pro4_pin_init(void); |
| 100 | void uniphier_sld8_pin_init(void); |
| 101 | void uniphier_pro5_pin_init(void); |
| 102 | void uniphier_pxs2_pin_init(void); |
| 103 | void uniphier_ld6b_pin_init(void); |
Masahiro Yamada | 75f16f8 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 104 | |
Masahiro Yamada | 9890569 | 2016-03-30 20:17:02 +0900 | [diff] [blame] | 105 | void uniphier_ld4_clk_init(void); |
| 106 | void uniphier_pro4_clk_init(void); |
| 107 | void uniphier_pro5_clk_init(void); |
| 108 | void uniphier_pxs2_clk_init(void); |
Masahiro Yamada | 75f16f8 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 109 | |
| 110 | #define pr_err(fmt, args...) printf(fmt, ##args) |
| 111 | |
| 112 | #endif /* __MACH_INIT_H */ |