blob: c56c44c070c046bdca2192fa4fd1f7c7daa1869a [file] [log] [blame]
Masahiro Yamada75f16f82015-09-22 00:27:39 +09001/*
2 * Copyright (C) 2015 Masahiro Yamada <yamada.masahiro@socionext.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0+
5 */
6
7#include <common.h>
Masahiro Yamada52f0c512016-03-18 16:41:52 +09008#include <debug_uart.h>
Masahiro Yamada75f16f82015-09-22 00:27:39 +09009#include <spl.h>
Masahiro Yamadaefdf3402016-01-09 01:51:13 +090010
11#include "../init.h"
12#include "../soc-info.h"
Masahiro Yamada75f16f82015-09-22 00:27:39 +090013
Masahiro Yamada75f16f82015-09-22 00:27:39 +090014void spl_board_init(void)
15{
16 const struct uniphier_board_data *param;
17
Masahiro Yamada52f0c512016-03-18 16:41:52 +090018#ifdef CONFIG_DEBUG_UART
19 debug_uart_init();
20#endif
21
Masahiro Yamadac93f2792015-12-17 17:47:42 +090022 param = uniphier_get_board_param();
Masahiro Yamada75f16f82015-09-22 00:27:39 +090023 if (!param)
24 hang();
25
26 switch (uniphier_get_soc_type()) {
Masahiro Yamada53c59ae2016-03-18 16:41:43 +090027#if defined(CONFIG_ARCH_UNIPHIER_SLD3)
28 case SOC_UNIPHIER_SLD3:
Masahiro Yamada98905692016-03-30 20:17:02 +090029 uniphier_sld3_init(param);
Masahiro Yamada75f16f82015-09-22 00:27:39 +090030 break;
31#endif
Masahiro Yamada53c59ae2016-03-18 16:41:43 +090032#if defined(CONFIG_ARCH_UNIPHIER_LD4)
33 case SOC_UNIPHIER_LD4:
Masahiro Yamada98905692016-03-30 20:17:02 +090034 uniphier_ld4_init(param);
Masahiro Yamada75f16f82015-09-22 00:27:39 +090035 break;
36#endif
Masahiro Yamada53c59ae2016-03-18 16:41:43 +090037#if defined(CONFIG_ARCH_UNIPHIER_PRO4)
38 case SOC_UNIPHIER_PRO4:
Masahiro Yamada98905692016-03-30 20:17:02 +090039 uniphier_pro4_init(param);
Masahiro Yamada75f16f82015-09-22 00:27:39 +090040 break;
41#endif
Masahiro Yamada53c59ae2016-03-18 16:41:43 +090042#if defined(CONFIG_ARCH_UNIPHIER_SLD8)
43 case SOC_UNIPHIER_SLD8:
Masahiro Yamada98905692016-03-30 20:17:02 +090044 uniphier_sld8_init(param);
Masahiro Yamada75f16f82015-09-22 00:27:39 +090045 break;
46#endif
Masahiro Yamada53c59ae2016-03-18 16:41:43 +090047#if defined(CONFIG_ARCH_UNIPHIER_PRO5)
48 case SOC_UNIPHIER_PRO5:
Masahiro Yamada98905692016-03-30 20:17:02 +090049 uniphier_pro5_init(param);
Masahiro Yamadad5167d52015-09-22 00:27:40 +090050 break;
51#endif
Masahiro Yamada53c59ae2016-03-18 16:41:43 +090052#if defined(CONFIG_ARCH_UNIPHIER_PXS2) || defined(CONFIG_ARCH_UNIPHIER_LD6B)
53 case SOC_UNIPHIER_PXS2:
54 case SOC_UNIPHIER_LD6B:
Masahiro Yamada98905692016-03-30 20:17:02 +090055 uniphier_pxs2_init(param);
Masahiro Yamada1fe65d32015-09-22 00:27:41 +090056 break;
57#endif
Masahiro Yamada75f16f82015-09-22 00:27:39 +090058 default:
59 break;
60 }
61}