diff options
author | Masahiro Yamada <yamada.masahiro@socionext.com> | 2017-02-14 01:24:26 +0900 |
---|---|---|
committer | Masahiro Yamada <yamada.masahiro@socionext.com> | 2017-02-23 08:37:56 +0900 |
commit | 784548efb2b76fdbfdb73f6a505a156f90bb1e55 (patch) | |
tree | 1e8457137b8933095298964f8a6cb3675cdedfc4 /arch/arm/mach-uniphier/boot-device/boot-device.h | |
parent | 81c847bf3806f2cb275f8b084872b97508823462 (diff) |
ARM: uniphier: rework spl_boot_device() and related code
The current implementation has ugly switch statements here and there,
and duplicates similar code. Rework it using table lookups for SoC
data and reduce code duplication.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Diffstat (limited to 'arch/arm/mach-uniphier/boot-device/boot-device.h')
-rw-r--r-- | arch/arm/mach-uniphier/boot-device/boot-device.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/arch/arm/mach-uniphier/boot-device/boot-device.h b/arch/arm/mach-uniphier/boot-device/boot-device.h new file mode 100644 index 0000000000..f3fb2f32a8 --- /dev/null +++ b/arch/arm/mach-uniphier/boot-device/boot-device.h @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2017 Socionext Inc. + * Author: Masahiro Yamada <yamada.masahiro@socionext.com> + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#ifndef _UNIPHIER_BOOT_DEVICE_H_ +#define _UNIPHIER_BOOT_DEVICE_H_ + +struct uniphier_boot_device { + unsigned int boot_device; + const char *desc; +}; + +extern const struct uniphier_boot_device uniphier_sld3_boot_device_table[]; +extern const struct uniphier_boot_device uniphier_ld4_boot_device_table[]; +extern const struct uniphier_boot_device uniphier_pro5_boot_device_table[]; +extern const struct uniphier_boot_device uniphier_pxs2_boot_device_table[]; +extern const struct uniphier_boot_device uniphier_ld11_boot_device_table[]; + +extern const unsigned int uniphier_sld3_boot_device_count; +extern const unsigned int uniphier_ld4_boot_device_count; +extern const unsigned int uniphier_pro5_boot_device_count; +extern const unsigned int uniphier_pxs2_boot_device_count; +extern const unsigned int uniphier_ld11_boot_device_count; + +int uniphier_pxs2_boot_device_is_usb(u32 pinmon); +int uniphier_ld11_boot_device_is_usb(u32 pinmon); +int uniphier_ld20_boot_device_is_usb(u32 pinmon); + +unsigned int uniphier_pxs2_boot_device_fixup(unsigned int mode); +unsigned int uniphier_ld11_boot_device_fixup(unsigned int mode); + +#endif /* _UNIPHIER_BOOT_DEVICE_H_ */ |