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 | 799e6f2 | 2016-02-26 14:21:34 +0900 | [diff] [blame^] | 10 | #define UNIPHIER_MAX_NR_DRAM_CH 3 |
| 11 | |
| 12 | struct uniphier_dram_ch { |
| 13 | unsigned long base; |
| 14 | unsigned long size; |
| 15 | unsigned int width; |
| 16 | }; |
| 17 | |
Masahiro Yamada | 75f16f8 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 18 | struct uniphier_board_data { |
Masahiro Yamada | 799e6f2 | 2016-02-26 14:21:34 +0900 | [diff] [blame^] | 19 | unsigned int dram_freq; |
| 20 | unsigned int dram_nr_ch; |
| 21 | struct uniphier_dram_ch dram_ch[UNIPHIER_MAX_NR_DRAM_CH]; |
Masahiro Yamada | 75f16f8 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 22 | }; |
| 23 | |
Masahiro Yamada | c93f279 | 2015-12-17 17:47:42 +0900 | [diff] [blame] | 24 | const struct uniphier_board_data *uniphier_get_board_param(void); |
Masahiro Yamada | 75f16f8 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 25 | |
| 26 | int ph1_sld3_init(const struct uniphier_board_data *bd); |
| 27 | int ph1_ld4_init(const struct uniphier_board_data *bd); |
| 28 | int ph1_pro4_init(const struct uniphier_board_data *bd); |
| 29 | int ph1_sld8_init(const struct uniphier_board_data *bd); |
Masahiro Yamada | d5167d5 | 2015-09-22 00:27:40 +0900 | [diff] [blame] | 30 | int ph1_pro5_init(const struct uniphier_board_data *bd); |
Masahiro Yamada | 1fe65d3 | 2015-09-22 00:27:41 +0900 | [diff] [blame] | 31 | int proxstream2_init(const struct uniphier_board_data *bd); |
Masahiro Yamada | 75f16f8 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 32 | |
| 33 | #if defined(CONFIG_MICRO_SUPPORT_CARD) |
| 34 | int ph1_sld3_sbc_init(const struct uniphier_board_data *bd); |
| 35 | int ph1_ld4_sbc_init(const struct uniphier_board_data *bd); |
| 36 | int ph1_pro4_sbc_init(const struct uniphier_board_data *bd); |
Masahiro Yamada | 1fe65d3 | 2015-09-22 00:27:41 +0900 | [diff] [blame] | 37 | int proxstream2_sbc_init(const struct uniphier_board_data *bd); |
Masahiro Yamada | 75f16f8 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 38 | #else |
| 39 | static inline int ph1_sld3_sbc_init(const struct uniphier_board_data *bd) |
| 40 | { |
| 41 | return 0; |
| 42 | } |
| 43 | |
| 44 | static inline int ph1_ld4_sbc_init(const struct uniphier_board_data *bd) |
| 45 | { |
| 46 | return 0; |
| 47 | } |
| 48 | |
| 49 | static inline int ph1_pro4_sbc_init(const struct uniphier_board_data *bd) |
| 50 | { |
| 51 | return 0; |
| 52 | } |
Masahiro Yamada | 1fe65d3 | 2015-09-22 00:27:41 +0900 | [diff] [blame] | 53 | |
| 54 | static inline int proxstream2_sbc_init(const struct uniphier_board_data *bd) |
| 55 | { |
| 56 | return 0; |
| 57 | } |
Masahiro Yamada | 75f16f8 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 58 | #endif |
| 59 | |
| 60 | int ph1_sld3_bcu_init(const struct uniphier_board_data *bd); |
| 61 | int ph1_ld4_bcu_init(const struct uniphier_board_data *bd); |
| 62 | |
| 63 | int memconf_init(const struct uniphier_board_data *bd); |
| 64 | int ph1_sld3_memconf_init(const struct uniphier_board_data *bd); |
Masahiro Yamada | 1fe65d3 | 2015-09-22 00:27:41 +0900 | [diff] [blame] | 65 | int proxstream2_memconf_init(const struct uniphier_board_data *bd); |
Masahiro Yamada | 75f16f8 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 66 | |
| 67 | int ph1_sld3_pll_init(const struct uniphier_board_data *bd); |
| 68 | int ph1_ld4_pll_init(const struct uniphier_board_data *bd); |
| 69 | int ph1_pro4_pll_init(const struct uniphier_board_data *bd); |
| 70 | int ph1_sld8_pll_init(const struct uniphier_board_data *bd); |
| 71 | |
| 72 | int ph1_sld3_enable_dpll_ssc(const struct uniphier_board_data *bd); |
| 73 | int ph1_ld4_enable_dpll_ssc(const struct uniphier_board_data *bd); |
| 74 | |
| 75 | int ph1_ld4_early_clk_init(const struct uniphier_board_data *bd); |
Masahiro Yamada | d5167d5 | 2015-09-22 00:27:40 +0900 | [diff] [blame] | 76 | int ph1_pro5_early_clk_init(const struct uniphier_board_data *bd); |
Masahiro Yamada | 1fe65d3 | 2015-09-22 00:27:41 +0900 | [diff] [blame] | 77 | int proxstream2_early_clk_init(const struct uniphier_board_data *bd); |
Masahiro Yamada | 75f16f8 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 78 | |
| 79 | int ph1_sld3_early_pin_init(const struct uniphier_board_data *bd); |
| 80 | |
| 81 | int ph1_ld4_umc_init(const struct uniphier_board_data *bd); |
| 82 | int ph1_pro4_umc_init(const struct uniphier_board_data *bd); |
| 83 | int ph1_sld8_umc_init(const struct uniphier_board_data *bd); |
Masahiro Yamada | 95e7487 | 2016-01-09 01:51:14 +0900 | [diff] [blame] | 84 | int proxstream2_umc_init(const struct uniphier_board_data *bd); |
Masahiro Yamada | 75f16f8 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 85 | |
| 86 | void ph1_sld3_pin_init(void); |
| 87 | void ph1_ld4_pin_init(void); |
| 88 | void ph1_pro4_pin_init(void); |
| 89 | void ph1_sld8_pin_init(void); |
Masahiro Yamada | d5167d5 | 2015-09-22 00:27:40 +0900 | [diff] [blame] | 90 | void ph1_pro5_pin_init(void); |
Masahiro Yamada | 1fe65d3 | 2015-09-22 00:27:41 +0900 | [diff] [blame] | 91 | void proxstream2_pin_init(void); |
| 92 | void ph1_ld6b_pin_init(void); |
Masahiro Yamada | 75f16f8 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 93 | |
| 94 | void ph1_ld4_clk_init(void); |
| 95 | void ph1_pro4_clk_init(void); |
Masahiro Yamada | d5167d5 | 2015-09-22 00:27:40 +0900 | [diff] [blame] | 96 | void ph1_pro5_clk_init(void); |
Masahiro Yamada | 1fe65d3 | 2015-09-22 00:27:41 +0900 | [diff] [blame] | 97 | void proxstream2_clk_init(void); |
Masahiro Yamada | 75f16f8 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 98 | |
| 99 | #define pr_err(fmt, args...) printf(fmt, ##args) |
| 100 | |
| 101 | #endif /* __MACH_INIT_H */ |