]> git.ipfire.org Git - people/ms/u-boot.git/blame - arch/arm/mach-uniphier/boot-mode/boot-mode.c
ARM: uniphier: support USB boot mode for ProXstream2 / PH1-LD6b SoC
[people/ms/u-boot.git] / arch / arm / mach-uniphier / boot-mode / boot-mode.c
CommitLineData
323d1f9d
MY
1/*
2 * Copyright (C) 2015 Masahiro Yamada <yamada.masahiro@socionext.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0+
5 */
6
7#include <common.h>
8#include <spl.h>
107b3fb4
MY
9
10#include "../sbc/sbc-regs.h"
11#include "../soc-info.h"
12#include "boot-device.h"
323d1f9d 13
fec48163 14u32 spl_boot_device_raw(void)
323d1f9d
MY
15{
16 if (boot_is_swapped())
17 return BOOT_DEVICE_NOR;
18
19 switch (uniphier_get_soc_type()) {
20#if defined(CONFIG_ARCH_UNIPHIER_PH1_SLD3)
21 case SOC_UNIPHIER_PH1_SLD3:
22 return ph1_sld3_boot_device();
23#endif
24#if defined(CONFIG_ARCH_UNIPHIER_PH1_LD4) || \
25 defined(CONFIG_ARCH_UNIPHIER_PH1_PRO4) || \
26 defined(CONFIG_ARCH_UNIPHIER_PH1_SLD8)
27 case SOC_UNIPHIER_PH1_LD4:
28 case SOC_UNIPHIER_PH1_PRO4:
29 case SOC_UNIPHIER_PH1_SLD8:
30 return ph1_ld4_boot_device();
28f40d4a
MY
31#endif
32#if defined(CONFIG_ARCH_UNIPHIER_PH1_PRO5)
33 case SOC_UNIPHIER_PH1_PRO5:
34 return ph1_pro5_boot_device();
019df879
MY
35#endif
36#if defined(CONFIG_ARCH_UNIPHIER_PROXSTREAM2) || \
37 defined(CONFIG_ARCH_UNIPHIER_PH1_LD6B)
38 case SOC_UNIPHIER_PROXSTREAM2:
39 case SOC_UNIPHIER_PH1_LD6B:
40 return proxstream2_boot_device();
323d1f9d
MY
41#endif
42 default:
43 return BOOT_DEVICE_NONE;
44 }
45}
fec48163
MY
46
47u32 spl_boot_device(void)
48{
49 u32 ret;
50
51 ret = spl_boot_device_raw();
52
53 return ret == BOOT_DEVICE_USB ? BOOT_DEVICE_NOR : ret;
54}