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