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 | |
Masahiro Yamada | 4021b43 | 2016-02-26 14:21:40 +0900 | [diff] [blame^] | 10 | #include <linux/types.h> |
| 11 | |
Masahiro Yamada | 46abfcc | 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 | 323d1f9 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 20 | struct uniphier_board_data { |
Masahiro Yamada | 46abfcc | 2016-02-26 14:21:34 +0900 | [diff] [blame] | 21 | unsigned int dram_freq; |
| 22 | unsigned int dram_nr_ch; |
Masahiro Yamada | 4021b43 | 2016-02-26 14:21:40 +0900 | [diff] [blame^] | 23 | bool dram_ddr3plus; |
Masahiro Yamada | 46abfcc | 2016-02-26 14:21:34 +0900 | [diff] [blame] | 24 | struct uniphier_dram_ch dram_ch[UNIPHIER_MAX_NR_DRAM_CH]; |
Masahiro Yamada | 323d1f9 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 25 | }; |
| 26 | |
Masahiro Yamada | 6ba60fa | 2015-12-17 17:47:42 +0900 | [diff] [blame] | 27 | const struct uniphier_board_data *uniphier_get_board_param(void); |
Masahiro Yamada | 323d1f9 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 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); |
Masahiro Yamada | 28f40d4 | 2015-09-22 00:27:40 +0900 | [diff] [blame] | 33 | int ph1_pro5_init(const struct uniphier_board_data *bd); |
Masahiro Yamada | 019df87 | 2015-09-22 00:27:41 +0900 | [diff] [blame] | 34 | int proxstream2_init(const struct uniphier_board_data *bd); |
Masahiro Yamada | 323d1f9 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 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); |
Masahiro Yamada | 019df87 | 2015-09-22 00:27:41 +0900 | [diff] [blame] | 40 | int proxstream2_sbc_init(const struct uniphier_board_data *bd); |
Masahiro Yamada | 323d1f9 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 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 | } |
Masahiro Yamada | 019df87 | 2015-09-22 00:27:41 +0900 | [diff] [blame] | 56 | |
| 57 | static inline int proxstream2_sbc_init(const struct uniphier_board_data *bd) |
| 58 | { |
| 59 | return 0; |
| 60 | } |
Masahiro Yamada | 323d1f9 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 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); |
Masahiro Yamada | 019df87 | 2015-09-22 00:27:41 +0900 | [diff] [blame] | 68 | int proxstream2_memconf_init(const struct uniphier_board_data *bd); |
Masahiro Yamada | 323d1f9 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 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); |
Masahiro Yamada | 28f40d4 | 2015-09-22 00:27:40 +0900 | [diff] [blame] | 79 | int ph1_pro5_early_clk_init(const struct uniphier_board_data *bd); |
Masahiro Yamada | 019df87 | 2015-09-22 00:27:41 +0900 | [diff] [blame] | 80 | int proxstream2_early_clk_init(const struct uniphier_board_data *bd); |
Masahiro Yamada | 323d1f9 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 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); |
Masahiro Yamada | 15607d0 | 2016-01-09 01:51:14 +0900 | [diff] [blame] | 87 | int proxstream2_umc_init(const struct uniphier_board_data *bd); |
Masahiro Yamada | 323d1f9 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 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); |
Masahiro Yamada | 28f40d4 | 2015-09-22 00:27:40 +0900 | [diff] [blame] | 93 | void ph1_pro5_pin_init(void); |
Masahiro Yamada | 019df87 | 2015-09-22 00:27:41 +0900 | [diff] [blame] | 94 | void proxstream2_pin_init(void); |
| 95 | void ph1_ld6b_pin_init(void); |
Masahiro Yamada | 323d1f9 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 96 | |
| 97 | void ph1_ld4_clk_init(void); |
| 98 | void ph1_pro4_clk_init(void); |
Masahiro Yamada | 28f40d4 | 2015-09-22 00:27:40 +0900 | [diff] [blame] | 99 | void ph1_pro5_clk_init(void); |
Masahiro Yamada | 019df87 | 2015-09-22 00:27:41 +0900 | [diff] [blame] | 100 | void proxstream2_clk_init(void); |
Masahiro Yamada | 323d1f9 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 101 | |
| 102 | #define pr_err(fmt, args...) printf(fmt, ##args) |
| 103 | |
| 104 | #endif /* __MACH_INIT_H */ |