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 #include <linux/types.h> 11 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 20 struct uniphier_board_data { 21 unsigned int dram_freq; 22 unsigned int dram_nr_ch; 23 bool dram_ddr3plus; 24 struct uniphier_dram_ch dram_ch[UNIPHIER_MAX_NR_DRAM_CH]; 25 }; 26 27 const struct uniphier_board_data *uniphier_get_board_param(void); 28 29 int ph1_sld3_init(const struct uniphier_board_data *bd); 30 int ph1_ld4_init(const struct uniphier_board_data *bd); 31 int ph1_pro4_init(const struct uniphier_board_data *bd); 32 int ph1_sld8_init(const struct uniphier_board_data *bd); 33 int ph1_pro5_init(const struct uniphier_board_data *bd); 34 int proxstream2_init(const struct uniphier_board_data *bd); 35 36 #if defined(CONFIG_MICRO_SUPPORT_CARD) 37 int ph1_sld3_sbc_init(const struct uniphier_board_data *bd); 38 int ph1_ld4_sbc_init(const struct uniphier_board_data *bd); 39 int ph1_pro4_sbc_init(const struct uniphier_board_data *bd); 40 int proxstream2_sbc_init(const struct uniphier_board_data *bd); 41 #else 42 static inline int ph1_sld3_sbc_init(const struct uniphier_board_data *bd) 43 { 44 return 0; 45 } 46 47 static inline int ph1_ld4_sbc_init(const struct uniphier_board_data *bd) 48 { 49 return 0; 50 } 51 52 static inline int ph1_pro4_sbc_init(const struct uniphier_board_data *bd) 53 { 54 return 0; 55 } 56 57 static inline int proxstream2_sbc_init(const struct uniphier_board_data *bd) 58 { 59 return 0; 60 } 61 #endif 62 63 int ph1_sld3_bcu_init(const struct uniphier_board_data *bd); 64 int ph1_ld4_bcu_init(const struct uniphier_board_data *bd); 65 66 int memconf_init(const struct uniphier_board_data *bd); 67 int ph1_sld3_memconf_init(const struct uniphier_board_data *bd); 68 int proxstream2_memconf_init(const struct uniphier_board_data *bd); 69 70 int ph1_sld3_pll_init(const struct uniphier_board_data *bd); 71 int ph1_ld4_pll_init(const struct uniphier_board_data *bd); 72 int ph1_pro4_pll_init(const struct uniphier_board_data *bd); 73 int ph1_sld8_pll_init(const struct uniphier_board_data *bd); 74 75 int ph1_sld3_enable_dpll_ssc(const struct uniphier_board_data *bd); 76 int ph1_ld4_enable_dpll_ssc(const struct uniphier_board_data *bd); 77 78 int ph1_ld4_early_clk_init(const struct uniphier_board_data *bd); 79 int ph1_pro5_early_clk_init(const struct uniphier_board_data *bd); 80 int proxstream2_early_clk_init(const struct uniphier_board_data *bd); 81 82 int ph1_sld3_early_pin_init(const struct uniphier_board_data *bd); 83 84 int ph1_ld4_umc_init(const struct uniphier_board_data *bd); 85 int ph1_pro4_umc_init(const struct uniphier_board_data *bd); 86 int ph1_sld8_umc_init(const struct uniphier_board_data *bd); 87 int proxstream2_umc_init(const struct uniphier_board_data *bd); 88 89 void ph1_sld3_pin_init(void); 90 void ph1_ld4_pin_init(void); 91 void ph1_pro4_pin_init(void); 92 void ph1_sld8_pin_init(void); 93 void ph1_pro5_pin_init(void); 94 void proxstream2_pin_init(void); 95 void ph1_ld6b_pin_init(void); 96 97 void ph1_ld4_clk_init(void); 98 void ph1_pro4_clk_init(void); 99 void ph1_pro5_clk_init(void); 100 void proxstream2_clk_init(void); 101 102 #define pr_err(fmt, args...) printf(fmt, ##args) 103 104 #endif /* __MACH_INIT_H */ 105