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) |
Masahiro Yamada | 5d0607c | 2016-03-18 16:41:44 +0900 | [diff] [blame] | 37 | int sbc_admulti_init(const struct uniphier_board_data *bd); |
| 38 | int sbc_savepin_init(const struct uniphier_board_data *bd); |
| 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 | 323d1f9 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 42 | #else |
Masahiro Yamada | 5d0607c | 2016-03-18 16:41:44 +0900 | [diff] [blame] | 43 | static inline int sbc_admulti_init(const struct uniphier_board_data *bd) |
Masahiro Yamada | 323d1f9 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 44 | { |
| 45 | return 0; |
| 46 | } |
| 47 | |
Masahiro Yamada | 5d0607c | 2016-03-18 16:41:44 +0900 | [diff] [blame] | 48 | static inline int sbc_savepin_init(const struct uniphier_board_data *bd) |
Masahiro Yamada | 323d1f9 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 49 | { |
| 50 | return 0; |
| 51 | } |
| 52 | |
Masahiro Yamada | 5d0607c | 2016-03-18 16:41:44 +0900 | [diff] [blame] | 53 | static inline int uniphier_sld3_sbc_init(const struct uniphier_board_data *bd) |
Masahiro Yamada | 323d1f9 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 54 | { |
| 55 | return 0; |
| 56 | } |
Masahiro Yamada | 019df87 | 2015-09-22 00:27:41 +0900 | [diff] [blame] | 57 | |
Masahiro Yamada | 5d0607c | 2016-03-18 16:41:44 +0900 | [diff] [blame] | 58 | static inline int uniphier_ld4_sbc_init(const struct uniphier_board_data *bd) |
| 59 | { |
| 60 | return 0; |
| 61 | } |
| 62 | |
| 63 | static inline int uniphier_pxs2_sbc_init(const struct uniphier_board_data *bd) |
Masahiro Yamada | 019df87 | 2015-09-22 00:27:41 +0900 | [diff] [blame] | 64 | { |
| 65 | return 0; |
| 66 | } |
Masahiro Yamada | 323d1f9 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 67 | #endif |
| 68 | |
| 69 | int ph1_sld3_bcu_init(const struct uniphier_board_data *bd); |
| 70 | int ph1_ld4_bcu_init(const struct uniphier_board_data *bd); |
| 71 | |
| 72 | int memconf_init(const struct uniphier_board_data *bd); |
| 73 | int ph1_sld3_memconf_init(const struct uniphier_board_data *bd); |
Masahiro Yamada | 019df87 | 2015-09-22 00:27:41 +0900 | [diff] [blame] | 74 | int proxstream2_memconf_init(const struct uniphier_board_data *bd); |
Masahiro Yamada | 323d1f9 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 75 | |
| 76 | int ph1_sld3_pll_init(const struct uniphier_board_data *bd); |
| 77 | int ph1_ld4_pll_init(const struct uniphier_board_data *bd); |
| 78 | int ph1_pro4_pll_init(const struct uniphier_board_data *bd); |
| 79 | int ph1_sld8_pll_init(const struct uniphier_board_data *bd); |
| 80 | |
| 81 | int ph1_sld3_enable_dpll_ssc(const struct uniphier_board_data *bd); |
| 82 | int ph1_ld4_enable_dpll_ssc(const struct uniphier_board_data *bd); |
| 83 | |
| 84 | int ph1_ld4_early_clk_init(const struct uniphier_board_data *bd); |
Masahiro Yamada | 28f40d4 | 2015-09-22 00:27:40 +0900 | [diff] [blame] | 85 | int ph1_pro5_early_clk_init(const struct uniphier_board_data *bd); |
Masahiro Yamada | 019df87 | 2015-09-22 00:27:41 +0900 | [diff] [blame] | 86 | int proxstream2_early_clk_init(const struct uniphier_board_data *bd); |
Masahiro Yamada | 323d1f9 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 87 | |
| 88 | int ph1_sld3_early_pin_init(const struct uniphier_board_data *bd); |
| 89 | |
| 90 | int ph1_ld4_umc_init(const struct uniphier_board_data *bd); |
| 91 | int ph1_pro4_umc_init(const struct uniphier_board_data *bd); |
| 92 | int ph1_sld8_umc_init(const struct uniphier_board_data *bd); |
Masahiro Yamada | 15607d0 | 2016-01-09 01:51:14 +0900 | [diff] [blame] | 93 | int proxstream2_umc_init(const struct uniphier_board_data *bd); |
Masahiro Yamada | 323d1f9 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 94 | |
| 95 | void ph1_sld3_pin_init(void); |
| 96 | void ph1_ld4_pin_init(void); |
| 97 | void ph1_pro4_pin_init(void); |
| 98 | void ph1_sld8_pin_init(void); |
Masahiro Yamada | 28f40d4 | 2015-09-22 00:27:40 +0900 | [diff] [blame] | 99 | void ph1_pro5_pin_init(void); |
Masahiro Yamada | 019df87 | 2015-09-22 00:27:41 +0900 | [diff] [blame] | 100 | void proxstream2_pin_init(void); |
| 101 | void ph1_ld6b_pin_init(void); |
Masahiro Yamada | 323d1f9 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 102 | |
| 103 | void ph1_ld4_clk_init(void); |
| 104 | void ph1_pro4_clk_init(void); |
Masahiro Yamada | 28f40d4 | 2015-09-22 00:27:40 +0900 | [diff] [blame] | 105 | void ph1_pro5_clk_init(void); |
Masahiro Yamada | 019df87 | 2015-09-22 00:27:41 +0900 | [diff] [blame] | 106 | void proxstream2_clk_init(void); |
Masahiro Yamada | 323d1f9 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 107 | |
| 108 | #define pr_err(fmt, args...) printf(fmt, ##args) |
| 109 | |
| 110 | #endif /* __MACH_INIT_H */ |